PageSourceSearch

https://www.siniat.pl/etex/js/assets/js/3324.9c24ddfbc38d67650822.mjs

js siniat.pl collected 2026-10-07 23:23:48 UTC 11,475 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkwebpack=self.webpackChunkwebpack||[]).push([[3324],{23324:function(e,t,i){i.r(t),i.d(t,{default:function(){return E}});var s=i(42799),n=i(83491),r=i(79234),o=i(15539),l=i(24448),a=i(78097),h=i(33876),c=i(64198);class d extends o.h{constructor(e,t,i,s){super(e),this.SELECTOR_SLIDE=".js-color-trigger",this.SELECTOR_MODAL_COLOR=".js-modal-color-trigger",this.ACTIVE_CLASS="is-active",this.SELECTOR_COLOUR_LABEL=".js-colour-name",this.SELECTOR_ALL_COLOR_CTA=".js-all-color-cta",this.SELECTOR_ALL_COLOR_MODAL=".js-all-color-modal",this.SELECTOR_CONTAINER=".js-product-carousel-colors-container",this.initialSlideIndex=t,this.imageClickCallBack=s,this.productInfo=i,this.colourSlides=this.getColorSlides(),this.bindSlideClicks(),this.bindAllColorsModalBehavior(),this.onSplideInit=()=>{this.colourSlides=this.getColorSlides();const e=this.getCurrentSlideIndex();this.setActiveByIndex(e),this.goToSlide(e)},this.setActiveByIndex(this.initialSlideIndex),this.initColorsCarousel(),this.makeProductDetailView()}getContainer(){return this.element.closest(this.SELECTOR_CONTAINER)}getCurrentSlideIndex(){if(null!=this.activeIndex&&""!==this.activeIndex){const e=parseInt(this.activeIndex,10);if(!isNaN(e))return e}return this.initialSlideIndex}setActiveByIndex(e){const t=String(e);this.activeIndex=t,this.setActiveSlides(t),this.setActiveModalColor(t);const i=this.findSlideByIndex(t);i&&this.setItemName(this.getItemName(i))}findSlideByIndex(e){return Array.from(this.colourSlides).find((t=>{if(this.getSlideIndex(t)!==e)return!1;const i=t.closest(".splide__slide");return!i?.classList.contains("splide__slide--clone")}))}getColorSlides(){return this.element.querySelectorAll(this.SELECTOR_SLIDE)}bindSlideClicks(){this.element.addEventListener("click",(e=>{const t=e.target.closest(this.SELECTOR_SLIDE);if(!t||!this.element.contains(t))return;const i=parseInt(this.getSlideIndex(t),10);isNaN(i)||(this.setActiveByIndex(i),this.imageClickCallBack(this.getItemId(t),this.getItemName(t)),this.makeProductDetailView())}))}bindAllColorsModalBehavior(){const e=this.getContainer();if(!e)return;const t=e.querySelector(this.SELECTOR_ALL_COLOR_CTA),i=e.querySelector(this.SELECTOR_ALL_COLOR_MODAL);t&&i&&(t.addEventListener("click",(()=>{this.allColorsDialog?this.allColorsDialog.reInit():this.allColorsDialog=new h.Vq(i),this.allColorsDialog.show()})),i.addEventListener("click",(e=>{const t=e.target.closest(this.SELECTOR_MODAL_COLOR);if(!t)return;const i=parseInt(this.getSlideIndex(t),10);isNaN(i)||(this.setActiveByIndex(i),this.imageClickCallBack(this.getItemId(t),this.getItemName(t)),this.goToSlide(i))})))}getItemId(e){return e.dataset.id}getItemName(e){return e.dataset.name}getSlideIndex(e){return e.dataset.index}setItemName(e){const t=this.getContainer();t&&t.querySelectorAll(this.SELECTOR_COLOUR_LABEL).forEach((t=>{t.innerHTML=e}))}activateSlide(e){e.classList.add(this.ACTIVE_CLASS)}deActivateSlide(e){e.classList.remove(this.ACTIVE_CLASS)}setActiveSlides(e){const t=parseInt(e,10);this.colourSlides.forEach((i=>{let s=e;!isNaN(t)&&t>=this.colourSlides.length&&(s="0"),s===this.getSlideIndex(i)?this.activateSlide(i):this.deActivateSlide(i)}))}setActiveModalColor(e){const t=this.getContainer();if(!t)return;const i=t.querySelectorAll(this.SELECTOR_MODAL_COLOR),s=parseInt(e,10);i.forEach((t=>{let n=e;!isNaN(s)&&s>=i.length&&(n="0"),n===this.getSlideIndex(t)?this.activateSlide(t):this.deActivateSlide(t)}))}goToSlide(e){const t=this.getSplide();!t||isNaN(e)||e<0||(t.go(e),requestAnimationFrame((()=>{t.go(e)})))}initColorsCarousel(){const e=l.Z.getExteriorColoursCarouselOptions(),t=parseInt(this.element.dataset.colors,10),i={};i[c.OA.mobileLarge]={perPage:6.3,type:t>6?"loop":"slide"},i[c.OA.breakpoint]={perPage:8.3,perMove:1,arrows:!1,type:t>8?"loop":"slide"},e.breakpoints=i,e.start=this.getCurrentSlideIndex(),this.initCarousel(e)}makeProductDetailView(){a.yY.pushProductDetailViewGA4(this.mapSlide(this.colourSlides[this.activeIndex]))}mapSlide(e){var t=new a.rY;return t.id=this.getItemId(e),t.name=this.productInfo.Name,t.brand=this.productInfo.Brand,t.category=this.productInfo.Category,t.variant=this.getItemName(e),t}}var u=i(21887),S=i(70392),p=i.n(S),C=i(23201);class E extends s.o{constructor(e){super(e),this.SELECTOR_COLOUR_CAROUSEL_CONTAINER=".js-product-carou
1sel-colors-container",this.SELECTOR_COLOUR_CAROUSEL=".js-product-carousel-colors",this.SELECTOR_IMAGE_GALLERY=".js-product-image-gallery",this.SELECTOR_FINISH_CONTAINER=".js-finishes-container",this.SELECTOR_FINISH=".js-finish",this.SELECTOR_SPINNER_MAIN=".js-spinner-main",this.SELECTOR_SPINNER_COLOURS=".js-spinner-colours",this.SELECTOR_CTA_BUTTONS=".js-cta-buttons",this.ACTIVE_CLASS="is-active",this.CTA_BUTTONS_SELECTOR=".js-cta-buttons-container",this.colourClickCallback=(e,t)=>{this.switchLook(e,t)},this.init()}init(){this.spinnerHandler=C.Z.getInstance(),this.initCtaButtons(),this.getFirstLook()}getFirstLook(){let e={productId:this.parm.productId,productAssetIds:this.parm.productAssetIds,productThumbnailImages:this.parm.productThumbnailImages,productMainImages:this.parm.productMainImages},t=new r.o(this.parm.getFirstLookUrl,e,!1);return this.spinnerHandler.showSpinner(this.element.querySelector(this.SELECTOR_SPINNER_MAIN)),this.ajaxWrapper.doFetch(t).then((e=>{if(200===e.status)return e.clone().text().then((e=>{var t=new n.E(e);let i=t.getComponentUpdate("gallery").content;this.replaceGallery(i);let s=t.getComponentUpdate("finishes");if(s){this.element.querySelector(this.SELECTOR_FINISH_CONTAINER).outerHTML=s.content,s.json.shouldRenderDropdown?(this.finishesDropDown=this.element.querySelector(this.SELECTOR_FINISH),this.finishesDropDown&&(this.finishesDropDown.addEventListener("change",(e=>{this.activeFinish=e.target.value,this.switchFinish(this.activeFinish)})),this.activeFinish=this.finishesDropDown.value=s.json.activeFinish)):(this.finishes=this.element.querySelectorAll(this.SELECTOR_FINISH),this.finishes&&(this.finishes.forEach((e=>{e.addEventListener("click",(()=>{this.activeFinish=e.getAttribute("data-value"),this.setFinishClasses(),this.switchFinish(this.activeFinish)}))})),this.activeFinish=s.json.activeFinish,this.setFinishClasses()))}this.spinnerHandler.hideSpinner(this.element.querySelector(this.SELECTOR_SPINNER_MAIN)),this.getRemainingLooks()}));this.spinnerHandler.hideSpinner(this.element.querySelector(this.SELECTOR_SPINNER_MAIN))}))}getActiveColourIndex(){const e=this.parm.selectedColorId;if(!e||!this.colours?.length)return 0;const t=this.colours.findIndex((t=>t.id===e));return t>=0?t:0}getRemainingLooks(){let e={productId:this.parm.productId,finish:this.activeFinish},t=new r.o(this.parm.getRemainingLooksUrl,e,!1);return this.spinnerHandler.showSpinner(this.element.querySelector(this.SELECTOR_SPINNER_COLOURS)),this.ajaxWrapper.doFetch(t).then((e=>{if(200===e.status)return e.clone().text().then((e=>{var t=new n.E(e);this.colours=t.getComponentUpdate("colours").json;const i=this.getActiveColourIndex(),s=this.colours[i];this.onColourLoaded(s.id),this.replaceColourCarousel(t.getComponentUpdate("colours").content,i),this.spinnerHandler.hideSpinner(this.element.querySelector(this.SELECTOR_SPINNER_COLOURS));const r=this.element.querySelectorAll(this.SELECTOR_CTA_BUTTONS);r&&r.forEach((e=>{e.classList.remove("u-hidden")}))}));this.spinnerHandler.hideSpinner(this.element.querySelector(this.SELECTOR_SPINNER_COLOURS))}))}updateColorQueryString(e){if(!e||!window.history?.replaceState)return;const t=new URL(window.location.href);t.searchParams.get("color")!==e&&(t.searchParams.set("color",e),window.history.replaceState(window.history.state,"",t))}switchLook(e,t){const i=this.colours.find((t=>t.id===e));if(!i)return;this.updateColorQueryString(e),this.onColourLoaded(e);let s={productItemAssetIds:i.assetIds,productThumbnailImages:this.parm.productThumbnailImages,productMainImages:this.parm.productMainImages},o=new r.o(this.parm.switchLookUrl,s,!1);this.spinnerHandler.showSpinner(this.element.querySelector(this.SELECTOR_SPINNER_MAIN)),this.ajaxWrapper.doFetch(o).then((e=>{if(200===e.status)return e.clone().text().then((e=>{let t=new n.E(e).getComponentUpdate("gallery").content;this.replaceGallery(t),this.spinnerHandler.hideSpinner(this.element.querySelector(this.SELECTOR_SPINNER_MAIN))}));this.spinnerHandler.hideSpinner(this.element.querySelector(this.SELECTOR_SPINNER_MAIN))}))}clearColorQueryString(){if(!window.history?.replaceState)return;const e=new URL(window.location.href);e.searchParams.has("color")&&(e.searchParams.delete("color"),window.history.replaceState(window.history.state,"",e))}switchFinish(e){let t={finish:e,productId:this.parm.productId,productAssetIds:this.parm.productAssetIds,productThumbn
1ailImages:this.parm.productThumbnailImages,productMainImages:this.parm.productMainImages},i=new r.o(this.parm.switchFinishUrl,t,!1);return this.spinnerHandler.showSpinner(this.element.querySelector(this.SELECTOR_SPINNER_MAIN)),this.spinnerHandler.showSpinner(this.element.querySelector(this.SELECTOR_SPINNER_COLOURS)),this.ajaxWrapper.doFetch(i).then((e=>{if(200===e.status)return e.clone().text().then((e=>{var t=new n.E(e);let i=t.getComponentUpdate("gallery").content;this.replaceGallery(i),this.colours=t.getComponentUpdate("colours").json,this.clearColorQueryString(),this.onColourLoaded(this.colours[0].id),this.replaceColourCarousel(t.getComponentUpdate("colours").content),this.spinnerHandler.hideSpinner(this.element.querySelector(this.SELECTOR_SPINNER_MAIN)),this.spinnerHandler.hideSpinner(this.element.querySelector(this.SELECTOR_SPINNER_COLOURS))}));this.spinnerHandler.hideSpinner(this.element.querySelector(this.SELECTOR_SPINNER_MAIN)),this.spinnerHandler.hideSpinner(this.element.querySelector(this.SELECTOR_SPINNER_COLOURS))}))}initCtaButtons(){const e=this.element.querySelector(this.CTA_BUTTONS_SELECTOR);if(e){this.reInitCompsOnDomChangeFor(e,!0);const t=new r.o(this.parm.ctaButtonsUrl,{},!0);this.ajaxWrapper.doFetch(t).then((t=>t.clone().text().then((t=>{e.outerHTML=t}))))}}replaceGallery(e){const t=this.element.querySelector(this.SELECTOR_IMAGE_GALLERY);t.innerHTML="";const i=document.createRange().createContextualFragment(e);t.appendChild(i)}replaceColourCarousel(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.unbindColorsCarousel();let i=this.replaceCarousel(e,this.SELECTOR_COLOUR_CAROUSEL_CONTAINER).querySelector(this.SELECTOR_COLOUR_CAROUSEL);this.colorsCarousel=new d(i,t,this.parm.productInfo,this.colourClickCallback)}setFinishClasses(){this.finishes.forEach((e=>{let t=e.getAttribute("data-value"),i=e.querySelector("input");this.activeFinish===t?(i.checked=!0,e.classList.add(this.ACTIVE_CLASS)):(i.checked=!1,e.classList.remove(this.ACTIVE_CLASS))}))}replaceCarousel(e,t){let i=this.element.querySelector(t);return i.innerHTML=e,i}unbindColorsCarousel(){this.colorsCarousel&&this.colorsCarousel.destroySplide()}onColourLoaded(e){p().publish(u.z.productColorChanged,new u.p(e,!0,!1))}}},83491:function(e,t,i){i.d(t,{E:function(){return r}});var s=i(47277),n=i.n(s);class r{constructor(e){this.rawResponse=e,this.response=n()(e)}getComponentUpdate(e){var t=this.response.filter("[data-component="+e+"]");return t.length?{content:t.html().trim(),json:n().parseJSON(t.find("script[type='json']")[0].innerHTML)}:null}getChildComponentUpdate(e){var t=this.response.find("[data-component="+e+"]");return t.length?{content:t[0].innerHTML,json:n().parseJSON(this.response.find("script")[0].innerHTML)}:null}}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.