PageSourceSearch

https://www.toplicht.de/theme/d60ccf83309a25cc46e83c9acfcd61ad/js/…tedia-advanced-product-slider.js?1790928603

js toplicht.de collected 2026-10-02 11:05:45 UTC 18,477 bytes, 1 lines download raw bytes

1(()=>{"use strict";var e={857:e=>{var t=function(e){var t;return!!e&&"object"==typeof e&&"[object RegExp]"!==(t=Object.prototype.toString.call(e))&&"[object Date]"!==t&&e.$$typeof!==r},r="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function i(e,t){return!1!==t.clone&&t.isMergeableObject(e)?o(Array.isArray(e)?[]:{},e,t):e}function n(e,t,r){return e.concat(t).map(function(e){return i(e,r)})}function s(e){return Object.keys(e).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[])}function a(e,t){try{return t in e}catch(e){return!1}}function o(e,r,l){(l=l||{}).arrayMerge=l.arrayMerge||n,l.isMergeableObject=l.isMergeableObject||t,l.cloneUnlessOtherwiseSpecified=i;var c,d,u=Array.isArray(r);return u!==Array.isArray(e)?i(r,l):u?l.arrayMerge(e,r,l):(d={},(c=l).isMergeableObject(e)&&s(e).forEach(function(t){d[t]=i(e[t],c)}),s(r).forEach(function(t){(!a(e,t)||Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))&&(a(e,t)&&c.isMergeableObject(r[t])?d[t]=(function(e,t){if(!t.customMerge)return o;var r=t.customMerge(e);return"function"==typeof r?r:o})(t,c)(e[t],r[t],c):d[t]=i(r[t],c))}),d)}o.all=function(e,t){if(!Array.isArray(e))throw Error("first argument should be an array");return e.reduce(function(e,r){return o(e,r,t)},{})},e.exports=o},450:(e,t,r)=>{r.d(t,{default:()=>i});class i{trackProductView(e){if(e)try{let t=this.getRecentlyViewedIds();(t=t.filter(t=>t!==e)).unshift(e),t.length>this.maxItems&&(t=t.slice(0,this.maxItems)),localStorage.setItem(this.storageKey,JSON.stringify(t))}catch(e){}}getRecentlyViewedIds(){try{let e=localStorage.getItem(this.storageKey);if(e){let t=JSON.parse(e);return Array.isArray(t)?t:[]}}catch(e){}return[]}clear(){try{localStorage.removeItem(this.storageKey)}catch(e){}}getCount(){return this.getRecentlyViewedIds().length}constructor(){this.storageKey="intedia_recently_viewed_products",this.maxItems=20}}}},t={};function r(i){var n=t[i];if(void 0!==n)return n.exports;var s=t[i]={exports:{}};return e[i](s,s.exports,r),s.exports}r.m=e,(()=>{r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t}})(),(()=>{r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})}})(),(()=>{r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((t,i)=>(r.f[i](e,t),t),[]))})(),(()=>{r.u=e=>"./js/intedia-advanced-product-slider/"+e+".js"})(),(()=>{r.miniCssF=e=>{}})(),(()=>{r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}()})(),(()=>{r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{var e={};r.l=(t,i,n,s)=>{if(e[t]){e[t].push(i);return}if(void 0!==n)for(var a,o,l=document.getElementsByTagName("script"),c=0;c<l.length;c++){var d=l[c];if(d.getAttribute("src")==t){a=d;break}}a||(o=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,r.nc&&a.setAttribute("nonce",r.nc),a.src=t),e[t]=[i];var u=(r,i)=>{a.onerror=a.onload=null,clearTimeout(p);var n=e[t];if(delete e[t],a.parentNode&&a.parentNode.removeChild(a),n&&n.forEach(e=>e(i)),r)return r(i)},p=setTimeout(u.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=u.bind(null,a.onerror),a.onload=u.bind(null,a.onload),o&&document.head.appendChild(a)}})(),(()=>{r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})(),(()=>{r.g.importScripts&&(e=r.g.location+"");var e,t=r.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var i=t.getElementsByTagName("script");if(i.length)for(var n=i.length-1;n>-1&&!e;)e=i[n--].src}if(!e)throw Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e+"../../"})(),(()=>{var e={"intedia-advanced-product-slider":0};r.f.j=(t,i)=>{var n=r.o(e,t)?e[t]:void 0;if(0!==n){if(n)i.push(n[2]);else{var s=new Promise((r,i)=>n=e[t]=[r,i]);i.push(n[2]=s);var a=r.p+r.u(t),o=Error();r.l(a,i=>{if(r.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var s=i&&("load"===i.type?"missing":i.type),a=i&&i.target&&i.target.src;o.message="Loading chunk "+t+" failed.\n("+s+": "+a+")",o.name="ChunkLoadError",o.type=s,o.request=a,n[1](o)}},"chunk-"+t,t)}}};var t=(t,i)=>{var n,s,[a,o,l]=i,c=0;if(a.some(t=>0!==e[t])){for(n in o)r.o(o,n)&&(r.m[n]=o[n]);l&&l(r)}for(t&&t(i);c<a.length;c++)s=a[c],r.o(e,s)&&e[s]&&e[s][0](),e[s]=0},i=self.webpackChunk=self.webpackChunk||[];
1i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))})(),(()=>{var e=r(857),t=r.n(e);class i{static ucFirst(e){return e.charAt(0).toUpperCase()+e.slice(1)}static lcFirst(e){return e.charAt(0).toLowerCase()+e.slice(1)}static toDashCase(e){return e.replace(/([A-Z])/g,"-$1").replace(/^-/,"").toLowerCase()}static toLowerCamelCase(e,t){let r=i.toUpperCamelCase(e,t);return i.lcFirst(r)}static toUpperCamelCase(e,t){return t?e.split(t).map(e=>i.ucFirst(e.toLowerCase())).join(""):i.ucFirst(e.toLowerCase())}static parsePrimitive(e){try{return/^\d+(.|,)\d+$/.test(e)&&(e=e.replace(",",".")),JSON.parse(e)}catch(t){return e.toString()}}}class n{static isNode(e){return"object"==typeof e&&null!==e&&(e===document||e===window||e instanceof Node)}static hasAttribute(e,t){if(!n.isNode(e))throw Error("The element must be a valid HTML Node!");return"function"==typeof e.hasAttribute&&e.hasAttribute(t)}static getAttribute(e,t){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(r&&!1===n.hasAttribute(e,t))throw Error('The required property "'.concat(t,'" does not exist!'));if("function"!=typeof e.getAttribute){if(r)throw Error("This node doesn't support the getAttribute function!");return}return e.getAttribute(t)}static getDataAttribute(e,t){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2],s=t.replace(/^data(|-)/,""),a=i.toLowerCamelCase(s,"-");if(!n.isNode(e)){if(r)throw Error("The passed node is not a valid HTML Node!");return}if(void 0===e.dataset){if(r)throw Error("This node doesn't support the dataset attribute!");return}let o=e.dataset[a];if(void 0===o){if(r)throw Error('The required data attribute "'.concat(t,'" does not exist on ').concat(e,"!"));return o}return i.parsePrimitive(o)}static querySelector(e,t){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(r&&!n.isNode(e))throw Error("The parent node is not a valid HTML Node!");let i=e.querySelector(t)||!1;if(r&&!1===i)throw Error('The required element "'.concat(t,'" does not exist in parent node!'));return i}static querySelectorAll(e,t){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(r&&!n.isNode(e))throw Error("The parent node is not a valid HTML Node!");let i=e.querySelectorAll(t);if(0===i.length&&(i=!1),r&&!1===i)throw Error('At least one item of "'.concat(t,'" must exist in parent node!'));return i}static getFocusableElements(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body;return e.querySelectorAll('\n            input:not([tabindex^="-"]):not([disabled]):not([type="hidden"]),\n            select:not([tabindex^="-"]):not([disabled]),\n            textarea:not([tabindex^="-"]):not([disabled]),\n            button:not([tabindex^="-"]):not([disabled]),\n            a[href]:not([tabindex^="-"]):not([disabled]),\n            [tabindex]:not([tabindex^="-"]):not([disabled])\n        ')}static getFirstFocusableElement(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body;return this.getFocusableElements(e)[0]}static getLastFocusableElement(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,t=this.getFocusableElements(e);return t[t.length-1]}}class s{publish(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=new CustomEvent(e,{detail:t,cancelable:r});return this.el.dispatchEvent(i),i}subscribe(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this,n=e.split("."),s=r.scope?t.bind(r.scope):t;if(r.once&&!0===r.once){let t=s;s=function(r){i.unsubscribe(e),t(r)}}return this.el.addEventListener(n[0],s),this.listeners.push({splitEventName:n,opts:r,cb:s}),!0}unsubscribe(e){let t=e.split(".");return this.listeners=this.listeners.reduce((e,r)=>([...r.splitEventName].sort().toString()===t.sort().toString()?this.el.removeEventListener(r.splitEventName[0],r.cb):e.push(r),e),[]),!0}reset(){return this.listeners.forEach(e=>{this.el.removeEventListener(e.splitEventName[0],e.cb)}),this.listeners=[],!0}get el(){return this._el}set el(e){this._el=e}get listeners(){return this._listeners}set listeners(e){this._listeners=e}constructor(e=document){this._el=e,e.$emitter=this,this._listeners=[]}}class a{init(){throw Error('The "init" method for the plugin "'.concat(this._pluginName,'" is not defined.'))}update(){}
1_init(){this._initialized||(this.init(),this._initialized=!0)}_update(){this._initialized&&this.update()}_mergeOptions(e){let r=i.toDashCase(this._pluginName),s=n.getDataAttribute(this.el,"data-".concat(r,"-config"),!1),a=n.getAttribute(this.el,"data-".concat(r,"-options"),!1),o=[this.constructor.options,this.options,e];s&&o.push(window.PluginConfigManager.get(this._pluginName,s));try{a&&o.push(JSON.parse(a))}catch(e){throw console.error(this.el),Error('The data attribute "data-'.concat(r,'-options" could not be parsed to json: ').concat(e.message))}return t().all(o.filter(e=>e instanceof Object&&!(e instanceof Array)).map(e=>e||{}))}_registerInstance(){window.PluginManager.getPluginInstancesFromElement(this.el).set(this._pluginName,this),window.PluginManager.getPlugin(this._pluginName,!1).get("instances").push(this)}_getPluginName(e){return e||(e=this.constructor.name),e}constructor(e,t={},r=!1){if(!n.isNode(e))throw Error("There is no valid element given.");this.el=e,this.$emitter=new s(this.el),this._pluginName=this._getPluginName(r),this.options=this._mergeOptions(t),this._initialized=!1,this._registerInstance(),this._init()}}class o{get(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"application/json",i=this._createPreparedRequest("GET",e,r);return this._sendRequest(i,null,t)}post(e,t,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";i=this._getContentType(t,i);let n=this._createPreparedRequest("POST",e,i);return this._sendRequest(n,t,r)}delete(e,t,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";i=this._getContentType(t,i);let n=this._createPreparedRequest("DELETE",e,i);return this._sendRequest(n,t,r)}patch(e,t,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";i=this._getContentType(t,i);let n=this._createPreparedRequest("PATCH",e,i);return this._sendRequest(n,t,r)}
1abort(){if(this._request)return this._request.abort()}setErrorHandlingInternal(e){this._errorHandlingInternal=e}_registerOnLoaded(e,t){t&&(!0===this._errorHandlingInternal?(e.addEventListener("load",()=>{t(e.responseText,e)}),e.addEventListener("abort",()=>{console.warn("the request to ".concat(e.responseURL," was aborted"))}),e.addEventListener("error",()=>{console.warn("the request to ".concat(e.responseURL," failed with status ").concat(e.status))}),e.addEventListener("timeout",()=>{console.warn("the request to ".concat(e.responseURL," timed out"))})):e.addEventListener("loadend",()=>{t(e.responseText,e)}))}_sendRequest(e,t,r){return this._registerOnLoaded(e,r),e.send(t),e}_getContentType(e,t){return e instanceof FormData&&(t=!1),t}_createPreparedRequest(e,t,r){return this._request=new XMLHttpRequest,this._request.open(e,t),this._request.setRequestHeader("X-Requested-With","XMLHttpRequest"),r&&this._request.setRequestHeader("Content-type",r),this._request}constructor(){this._request=null,this._errorHandlingInternal=!1}}class l extends a{init(){"true"===this.el.dataset.recentlyViewed?this._loadRecentlyViewedProducts():this._loadSwiperAndInit(),this._setupTabListener()}async _loadSwiperAndInit(){try{let e=await r.e("custom_plugins_IntediaAdvancedProductSlider_src_Resources_app_storefront_node_modules_swiper_-1b1cfb").then(r.bind(r,925)),t=e.default||e.Swiper,i=await r.e("custom_plugins_IntediaAdvancedProductSlider_src_Resources_app_storefront_node_modules_swiper_-428f48").then(r.bind(r,756)),n=i.Navigation,s=i.Pagination,a=i.Autoplay;t.use([n,s,a]),this._SwiperClass=t,window.Swiper=t,this._initializeSlider()}catch(e){}}_initializeSlider(){let e=this.el.querySelectorAll(".swiper");0!==e.length&&e.forEach((e,t)=>{this._initializeSingleSlider(e,t)})}_initializeSingleSlider(e,t){let r=this._getConfigFromDataAttributes(e),i=e.querySelectorAll(".swiper-slide").length;r.loop&&i<=this._getMaxSlidesPerView(r)&&(r.loop=!1);try{let t=new this._SwiperClass(e,r);this._swiperInstances.push(t);let n=e.dataset.swiperPrevSelector,s=e.dataset.swiperNextSelector;if(n&&s){let e=this.el.querySelector(n),r=this.el.querySelector(s);e&&r&&(e.addEventListener("click",()=>{t.slidePrev()}),r.addEventListener("click",()=>{t.slideNext()}))}this._handleNavigationVisibility(t,i,n,s)}catch(e){}}_getConfigFromDataAttributes(e){let t=e.dataset.swiperPrevSelector,r=e.dataset.swiperNextSelector,i=e.dataset.swiperPaginationSelector,n=parseInt(e.dataset.swiperPerView)||3,s="true"===e.dataset.swiperLoop;return{slidesPerView:n,spaceBetween:parseInt(e.dataset.swiperSpaceBetween)||20,loop:s,loopedSlides:s?Math.max(2*n,6):null,autoplay:"true"===e.dataset.swiperAutoplay&&{delay:3e3,disableOnInteraction:!1,pauseOnMouseEnter:!0},navigation:(()=>{if(t&&r){let e=this.el.querySelector(t),i=this.el.querySelector(r);if(e&&i)return{prevEl:e,nextEl:i,disabledClass:"swiper-button-disabled"}}return!1})(),pagination:(()=>{let e=i?this.el.querySelector(i):this.el.querySelector(".swiper-pagination");return!!e&&{el:e,clickable:!0,dynamicBullets:!1}})(),watchOverflow:!1,breakpoints:this._parseBreakpoints(e.dataset.swiperBreakpoints),on:{init:function(){},slideChange:()=>{}}}}_parseBreakpoints(e){if(!e)return{320:{slidesPerView:1,spaceBetween:10},768:{slidesPerView:2,spaceBetween:15},1024:{slidesPerView:3,spaceBetween:20}};try{return JSON.parse(e)}catch(e){return{320:{slidesPerView:1,spaceBetween:10},768:{slidesPerView:2,spaceBetween:15},1024:{slidesPerView:3,spaceBetween:20}}}}_getMaxSlidesPerView(e){let t=e.slidesPerView||1;return e.breakpoints&&Object.values(e.breakpoints).forEach(e=>{e.slidesPerView&&e.slidesPerView>t&&(t=e.slidesPerView)}),t}_handleNavigationVisibility(e,t,r,i){if(!r&&!i)return;let n=r?this.el.querySelector(r):null,s=i?this.el.querySelector(i):null,a=()=>{let r=t<=e.params.slidesPerView;n&&(n.style.display=r?"none":""),s&&(s.style.display=r?"none":"")};e.on("breakpoint",a),a()}_setupOutsideNavigation(e){let t=this.el.querySelector(".swiper-button-next-outside"),r=this.el.querySelector(".swiper-button-prev-outside");t&&t.addEventListener("click",()=>{e.slideNext()}),r&&r.addEventListener("click",()=>{e.slidePrev()});let i=this.el.querySelector(".swiper-button-next.navigation-overlay.advanced-product-slider-nav"),n=this.el.querySelector(".swiper-button-prev.navigation-overlay.advanced-product-slider-nav");i&&i.addEventListener("click",()=>{e.slideNext()}),n&&n.addEventListener("click",()=>{e.slidePrev()})}async _loadRecentlyViewedProducts(){try{let{default:e}=await Promise.resolve().then(r.bind(r,450)),t=new e().getRecentlyViewedIds(),i=window.intediaRecentlyViewedProductId;i&&(t=t.filter(e=>e!==i));let n=parseInt(this.el.dataset.recentlyViewedLimit)||12;
1if(t=t.slice(0,n),0===t.length){this.el.style.display="none";return}await this._fetchAndRenderProducts(t),this._loadSwiperAndInit()}catch(e){this.el.style.display="none"}}async _fetchAndRenderProducts(e){return new Promise((t,r)=>{let i=new o,n=window.intediaRecentlyViewedProductsUrl,s=new FormData;e.forEach((e,t)=>{s.append("ids[".concat(t,"]"),e)}),i.post(n,s,e=>{try{let i=this.el.querySelector(".swiper-wrapper");if(!i){r(Error("Swiper wrapper not found"));return}i.innerHTML="",i.innerHTML=e,t()}catch(e){r(e)}},"text/html")})}async _renderProducts(e){let t=this.el.querySelector(".swiper-wrapper");if(t)for(let r of(t.innerHTML="",e)){let e=document.createElement("div");e.className="swiper-slide";let i=this._createProductCard(r);e.appendChild(i),t.appendChild(e)}}_createProductCard(e){var t,r,i;let n=document.createElement("div");n.className="product-box";let s=((r=e.cover)===null||void 0===r?void 0:(t=r.media)===null||void 0===t?void 0:t.url)||"",a=((i=e.translated)===null||void 0===i?void 0:i.name)||e.name||"",o=this._getProductUrl(e);return n.innerHTML='\n			<div class="product-image-wrapper">\n				<a href="'.concat(o,'" class="product-image-link">\n					').concat(s?'<img src="'.concat(s,'" alt="').concat(a,'" loading="lazy">'):'<div class="product-image-placeholder"></div>','\n				</a>\n			</div>\n			<div class="product-info">\n				<a href="').concat(o,'" class="product-name-link">\n					<h3 class="product-name">').concat(a,"</h3>\n				</a>\n				").concat(e.calculatedPrice?'\n					<div class="product-price">\n						'.concat(this._formatPrice(e.calculatedPrice.unitPrice),"\n					</div>\n				"):"","\n			</div>\n		"),n}_getProductUrl(e){return e.seoUrls&&e.seoUrls.length>0?"/".concat(e.seoUrls[0].seoPathInfo):"/detail/".concat(e.id)}_formatPrice(e){return new Intl.NumberFormat("de-DE",{style:"currency",currency:"EUR"}).format(e)}_setupTabListener(){let e=this.el.querySelectorAll('[data-bs-toggle="tab"]');0!==e.length&&e.forEach(e=>{e.addEventListener("shown.bs.tab",t=>{let r=e.dataset.bsTarget,i=document.querySelector(r);i&&i.querySelectorAll(".swiper").forEach(e=>{e.swiper&&e.swiper.update()})})})}destroy(){this._swiperInstance&&(this._swiperInstance.destroy(!0,!0),this._swiperInstance=null),this._swiperInstances&&this._swiperInstances.length>0&&(this._swiperInstances.forEach(e=>{e.destroy(!0,!0)}),this._swiperInstances=[]),super.destroy()}constructor(e,t,r){super(e,t,r),this._SwiperClass=null,this._swiperInstances=[]}}l.options={debug:!1};var c=r(450);let d=window.PluginManager;d.register("IntediaAdvancedProductSliderPlugin",l,".cms-element-intedia-advanced-product-slider"),d.register("RecentlyViewedTrackerPlugin",class extends a{init(){this.trackerService=new c.default,this.trackCurrentProduct()}trackCurrentProduct(){let e=window.intediaRecentlyViewedProductId;e&&this.trackerService.trackProductView(e)}},".is-ctl-product.is-act-index")})()})();

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.