PageSourceSearch

https://polstareaperiny.cz/modules/rcpganalytics/views/js/hook/eventsClient.bundle.js?prsv=20260829a

js polstareaperiny.cz collected 2026-10-08 22:55:42 UTC 62,762 bytes, 12 lines download raw bytes

1/**
2 * NOTICE OF LICENSE
3 * This source file is subject to a trade license awarded by
4 * Garamo Online S.L.
5 * Any use, public communication, reproduction, modification or
6 * distribution of this source file without the written consent of
7 * Garamo Online S.L. It Is prohibited.
8 *
9 * @author    ReactionCode <[email protected]>
10 * @copyright Garamo Online S.L. 2025.
11 * @license   Commercial license
12 */(()=>{"use strict";class t{constructor(){}static getContext(){return t.instance||(t.instance=new t),t.instance}getTrackingConfig(){if(this.trackingConfig)return this.trackingConfig;throw Error("Unable to load Tracking Config Context")}setTrackingConfig(t){this.trackingConfig=t}getTrackingData(){return this.trackingData}setTrackingData(t){this.trackingData=t}getTrackingPlatform(){if(this.trackingPlatform)return this.trackingPlatform;throw Error("Unable to load Tracking Platform Context")}setTrackingPlatform(t){this.trackingPlatform=t}getSessionStorage(){if(this.sessionStorage)return this.sessionStorage;throw Error("Unable to load Session Storage Context")}setSessionStorage(t){this.sessionStorage=t}}class e{constructor(t,e){this.sessionStorage=t,this.idLang=e,this.storageKey="RcProductList",this.storageValue={},this.initStorage()}initStorage(){const t=this.sessionStorage.getItem(this.storageKey);t&&(this.storageValue=JSON.parse(t))}addProduct(t){const e=this.buildIndex({idProduct:t.id_product,idProductAttribute:t.id_attribute});this.storageValue[e]=t,this.updateSessionStorageValue()}updateSessionStorageValue(){const t=JSON.stringify(this.storageValue);this.sessionStorage.setItem(this.storageKey,t)}getProduct(t){let e=null;const i=this.buildIndex(t);return Object.prototype.hasOwnProperty.call(this.storageValue,i)&&(e=this.storageValue[i]),e}buildIndex(t){return[t.idProduct,t.idProductAttribute,this.idLang].join("-")}}class i{constructor(t){this.sessionStorage=t,this.storageKey="RcAttributionList",this.storageValue={},this.initStorage()}initStorage(){const t=this.sessionStorage.getItem(this.storageKey);t&&(this.storageValue=JSON.parse(t))}addAttribution(t,e){this.storageValue[t]=e,this.updateSessionStorageValue()}updateSessionStorageValue(){const t=JSON.stringify(this.storageValue);this.sessionStorage.setItem(this.storageKey,t)}getAttributionList(){return this.storageValue}getAttribution(t){let e=null;return Object.prototype.hasOwnProperty.call(this.storageValue,t)&&(e=this.storageValue[t]),e}removeSessionStorageKey(){this.sessionStorage.removeItem(this.storageKey)}}
12class r{constructor(){this.storageMethod=this.getStorageMethod()}getItem(t){return this.storageMethod.getItem(t)}setItem(t,e){this.storageMethod.setItem(t,e)}removeItem(t){this.storageMethod.removeItem(t)}clearAll(){this.storageMethod.clear()}}class n extends r{constructor(){super()}getStorageMethod(){return sessionStorage}}class s{constructor(){this.trackingConfig=t.getContext().getTrackingConfig();const r=this.trackingConfig.context.localization.id_lang,s=new n;this.attributionStorage=new i(s),this.productStorage=new e(s,r)}initTrackingData(t){Object.prototype.hasOwnProperty.call(t,"detail_products_list")&&t.detail_products_list.length&&this.addProductsList(t.detail_products_list)}getProductModel(t){return this.productStorage.getProduct(t)}addProductsList(t){t.forEach((t=>this.productStorage.addProduct(t)))}addAttributionData(t,e){const i={productList:this.trackingConfig.context.page.controller_name,productPosition:e};this.attributionStorage.addAttribution(t,i)}getAttributionDataList(){return this.attributionStorage.getAttributionList()}}class o{constructor(e){this.errorLog=[],this.context=t.getContext(),this.context.setTrackingConfig(e.trackingConfig),this.context.setTrackingData(e.trackingData),this.sessionStorage=new s,this.context.setSessionStorage(this.sessionStorage)}}class a{constructor(){this.actionTrackingEvents=[],this.dataTrackingEvents=[],this.trackingConfig=t.getContext().getTrackingConfig(),this.createPageEvents()}createPageEvents(){this.createAddToCartEvent(),this.createCartViewEvent(),this.createCategoryEvent(),this.createCheckoutEvent(),this.createCustomerLogin(),this.createCustomerSignUp(),this.createHomeEvent(),this.createOrderCompleteEvent(),this.createProductClickEvent(),this.createProductShareEvent(),this.createProductViewEvent(),this.createPromotionClickEvent(),this.createSearchEvent(),this.createViewItemsListEvent()}initPageEvents(){this.actionTrackingEvents.forEach((t=>t.initEvent()))}initDataEvents(t){t&&this.dataTrackingEvents.forEach((e=>e.initDataEvent(t)))}}class c{constructor(){this.trackingConfig=t.getContext().getTrackingConfig(),this.trackingPlatform=t.getContext().getTrackingPlatform()}}class d{constructor(t){this.requestConfig=t,this.errorMessage="Something went wrong on request",this.requestConfig=t,this.formData=this.buildFormData()}buildFormData(){const t=new FormData;return t.append("fc",this.requestConfig.fc),t.append("module",this.requestConfig.module),t.append("controller",this.requestConfig.controller),t.append("action",this.requestConfig.action),t.append("data",encodeURIComponent(JSON.stringify(this.requestConfig.data))),t.append("token",this.requestConfig.token),t}fetchRequest(){return t=this,e=void 0,r=function*(){const t={method:"POST",mode:"same-origin",body:this.formData},e=new Request(this.requestConfig.url,t),i=yield fetch(e);if(i.ok){const t=yield i.json();return Promise.resolve(t)}return Promise.reject(new Error(this.errorMessage))},new((i=void 0)||(i=Promise))((function(n,s){function o(t){try{c(r.next(t))}catch(t){s(t)}}function a(t){try{c(r.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}c((r=r.apply(t,e||[])).next())}));var t,e,i,r}xhrRequest(){return new Promise(((t,e)=>{const i=new XMLHttpRequest;i.open("POST",this.requestConfig.url,!0),i.responseType="json",i.onload=()=>{200===i.status?t(i.response):e(new Error(this.errorMessage))},i.send(this.formData)}))}}var u=function(t,e,i,r){return new(i||(i=Promise))((function(n,s){function o(t){try{c(r.next(t))}catch(t){s(t)}}function a(t){try{c(r.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}c((r=r.apply(t,e||[])).next())}))};class l{static getProductsDetailList(e){return u(this,void 0,void 0,(function*(){const i=t.getContext().getSessionStorage();let r=[];const n=[];if(e.forEach((t=>{const e=i.getProductModel(t);e?r.push(e):n.push(t)})),n.length){const t=yield l.fetchProductsLists(e);t.length&&i.addProductsList(t),r=[...r,...t]}return r}))}static fetchProductsLists(e){return u(this,void 0,void 0,(function*(){const i=t.getContext().getTrackingConfig(),r={url:i.context.shop.base_dir+"index.php",fc:"module",module:i.context.tracking_module.module_name,controller:"datarequest",action:"getProductsDetail",data:e,token:i.context.tracking_module.token};return new d(r).fetchRequest()}))}}class g extends c{constructor(){super(...arguments),this.cartProducts=[],this.productThemeDataList=[]}initEvent(){this.updateCartProducts(),prestashop.on("updateCart",this.triggerEvent.bind(this))}updateCartProducts(){var t,e;void 0===(null===(t=null===prestashop||void 0===prestashop?void 0:prestashop.cart)||void 0===t?void 0:t.products)&&"complete"!==document.readyState?window.addEventListener("load",this.updateCartProducts.bind(this),!1):this.cartProducts=(null===(e=null===prestashop||void 0===prestashop?void 0:prestashop.cart)||void 0===e?void 0:e.products)||[]}triggerEvent(t){return e=this,i=void 0,n=function*(){if(this.productThemeDataList=g.getProductsDataList(t),this.productThemeDataList.length){const t=yield l.getProductsDetail
12List(this.productThemeDataList),e=this.getQuantity();t.length&&e&&this.trackingPlatform.addToCart(t[0],e)}this.updateCartProducts()},new((r=void 0)||(r=Promise))((function(t,s){function o(t){try{c(n.next(t))}catch(t){s(t)}}function a(t){try{c(n.throw(t))}catch(t){s(t)}}function c(e){var i;e.done?t(e.value):(i=e.value,i instanceof r?i:new r((function(t){t(i)}))).then(o,a)}c((n=n.apply(e,i||[])).next())}));var e,i,r,n}static getProductsDataList(t){const e=[];return g.isValidResponse(t)&&e.push({idProduct:t.resp.id_product,idProductAttribute:t.resp.id_product_attribute}),e}static isValidResponse(t){return Object.prototype.hasOwnProperty.call(t,"resp")&&t.resp.success}getQuantity(){const t=this.cartProducts.filter(this.filterCartProducts.bind(this)),e=prestashop.cart.products.filter(this.filterCartProducts.bind(this));let i=0;return e.length&&(i=e[0].quantity,t.length&&(i-=t[0].quantity)),i}filterCartProducts(t){const e=this.productThemeDataList[0];return t.id_product.toString()===e.idProduct.toString()&&t.id_product_attribute.toString()===e.idProductAttribute.toString()}}class h{constructor(){this.trackingPlatform=t.getContext().getTrackingPlatform()}initDataEvent(t){Object.prototype.hasOwnProperty.call(t,"detail_products_list")&&Object.prototype.hasOwnProperty.call(t,"order_products_list")&&t.detail_products_list.length&&t.order_products_list.length&&this.trackingPlatform.cartView(t.detail_products_list,t.order_products_list)}}var m=function(t,e,i,r){return new(i||(i=Promise))((function(n,s){function o(t){try{c(r.next(t))}catch(t){s(t)}}function a(t){try{c(r.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}c((r=r.apply(t,e||[])).next())}))};class p extends h{constructor(){super(...arguments),this.cartProductsQuantities={}}initEvent(){document.addEventListener("click",this.handleEvent.bind(this),!0),prestashop.on("updateCart",this.updateQuantity.bind(this))}handleEvent(t){0===t.button&&t.target instanceof HTMLElement&&(t.target.closest(".js-increase-product-quantity")&&!p.isFocused(t.target)?this.increaseQuantity(t.target):t.target.closest(".js-decrease-product-quantity")&&!p.isFocused(t.target)?this.decreaseQuantity(t.target):t.target.closest(".js-cart-line-product-quantity")?this.setInputCurrentQuantity(t.target):t.target.closest(".remove-from-cart")&&this.removeFromCart(t.target))}static isFocused(t){const e=t.closest(".cart-item");if(e instanceof HTMLElement){const t=e.querySelector(".js-cart-line-product-quantity");return document.activeElement===t}return!1}increaseQuantity(t){return m(this,void 0,void 0,(function*(){const e=p.getProductsDataList(t);this.triggerEvent(e,1,this.trackingPlatform.addToCart.bind(this.trackingPlatform))}))}decreaseQuantity(t){return m(this,void 0,void 0,(function*(){const e=p.getProductsDataList(t);this.triggerEvent(e,1,this.trackingPlatform.removeFromCart.bind(this.trackingPlatform))}))}removeFromCart(t){const e=p.getProductsDataList(t),i=t.closest(".cart-item");if(i instanceof HTMLElement){const t=i.querySelector(".js-cart-line-product-quantity");if(t instanceof HTMLInputElement){const i=parseInt(t.value);this.triggerEvent(e,i,this.trackingPlatform.removeFromCart.bind(this.trackingPlatform))}}}static getProductsDataList(t){const e=t.closest(".cart-item"),i=[];let r,n;if(e instanceof HTMLElement){const t=e.querySelector(".remove-from-cart");t instanceof HTMLElement&&(r=parseInt(t.dataset.idProduct||"0"),n=parseInt(t.dataset.idProductAttribute||"0"),r&&i.push({idProduct:r,idProductAttribute:n}))}return i}setInputCurrentQuantity(t){return m(this,void 0,void 0,(function*(){const e=p.getProductsDataList(t),i=e[0],r=t.closest(".js-cart-line-product-quantity");if(e.length&&r instanceof HTMLInputElement){const t=JSON.stringify(i);this.cartProductsQuantities[t]=parseInt(r.value)}}))}updateQuantity(t){return m(this,void 0,void 0,(function*(){if(t.reason.success){const e={idProduct:t.reason.id_product,idProductAttribute:t.reason.id_product_attribute},i=[e];if(i.length){const r=JSON.stringify(e),n=t.reason.quantity;if(n>this.cartProductsQuantities[r]){const t=n-this.cartProductsQuantities[r];this.triggerEvent(i,t,this.trackingPlatform.addToCart.bind(this.trackingPlatform))}else{const t=this.cartProductsQuantities[r]-n;this.triggerEvent(i,t,this.trackingPlatform.removeFromCart.bind(this.trackingPlatform))}this.cartProductsQuantities[r]=n}}}))}triggerEvent(t,e,i){return m(this,void 0,void 0,(function*(){if(t.length){const r=yield l.getProductsDetail
12List(t);r.length&&e&&i(r[0],e)}}))}initDataEvent(t){Object.prototype.hasOwnProperty.call(t,"detail_products_list")&&Object.prototype.hasOwnProperty.call(t,"order_products_list")&&t.detail_products_list.length&&t.order_products_list.length&&(this.initCartProductsQuantities(t),this.trackingPlatform.cartView(t.detail_products_list,t.order_products_list))}initCartProductsQuantities(t){t.detail_products_list.forEach(((e,i)=>{const r=JSON.stringify({idProduct:e.id_product,idProductAttribute:e.id_attribute});this.cartProductsQuantities[r]=t.order_products_list[i].quantity||0}))}}class v{constructor(){this.trackingConfig=t.getContext().getTrackingConfig(),this.trackingPlatform=t.getContext().getTrackingPlatform()}initEvent(){this.triggerEvent()}triggerEvent(){this.hasCategoryData()&&this.trackingPlatform.categoryPageView()}hasCategoryData(){return Object.prototype.hasOwnProperty.call(this.trackingConfig.context.page,"category")&&Object.prototype.hasOwnProperty.call(this.trackingConfig.context.page.category,"id_category")&&Object.prototype.hasOwnProperty.call(this.trackingConfig.context.page.category,"name")&&Object.prototype.hasOwnProperty.call(this.trackingConfig.context.page.category,"path")}}class f extends v{}class k{constructor(){this.trackingConfig=t.getContext().getTrackingConfig(),this.checkoutController=this.getCheckoutModule()}initEvent(){this.isValidCheckoutController()&&this.checkoutController.initEvent()}isValidCheckoutController(){return this.trackingConfig.context.page.controller_name===this.trackingConfig.context.tracking_module.checkout_module.controller}initDataEvent(t){this.isValidCheckoutController()&&k.isValidTrackingData(t)&&this.checkoutController.initDataEvent(t)}static isValidTrackingData(t){return Object.prototype.hasOwnProperty.call(t,"detail_products_list")&&Object.prototype.hasOwnProperty.call(t,"order_products_list")&&Boolean(t.detail_products_list.length)&&Boolean(t.order_products_list.length)}}class P{constructor(e){this.checkoutTrait=e,this.step=1,this.carrierSelected="",this.paymentSelected="",this.trackingPlatform=t.getContext().getTrackingPlatform()}initCheckoutEvent(){this.setDefaultCheckoutValues(),document.addEventListener("click",this.delegateCheckoutEvent.bind(this),!0)}static isValidMouseEvent(t){return 0===t.button&&t.isTrusted}static isValidAgreement(t="input[name=cgv]"){const e=document.querySelector(t);return!(e instanceof HTMLInputElement)||e.checked}static isCheckoutWithCarrier(t){return Boolean(document.querySelector(t))}sendTrackingCarrierOption(){this.checkoutTrait.getCartProductsData().then((t=>{t&&(this.detailProductsList=t[0],this.orderProductsList=t[1]),this.trackingPlatform.checkoutOption("shipping",this.carrierSelected,this.step,this.detailProductsList,this.orderProductsList)}))}sendTrackingPaymentOption(){this.checkoutTrait.getCartProductsData().then((t=>{t&&(this.detailProductsList=t[0],this.orderProductsList=t[1]),this.trackingPlatform.checkoutOption("payment",this.paymentSelected,this.step,this.detailProductsList,this.orderProductsList)}))}initDataEvent(t){this.detailProductsList=t.detail_products_list,this.orderProductsList=t.order_products_list,this.trackingPlatform.checkoutProgress(t.detail_products_list,t.order_products_list,this.step)}}class C extends P{initEvent(){this.setCurrentStep(),this.initCheckoutEvent()}setCurrentStep(){const t=document.querySelectorAll(".checkout-step"),e=Array.prototype.findIndex.call(t,(t=>t.classList.contains("js-current-step")));this.step=-1!==e?e:1}setDefaultCheckoutValues(){this.getCarrierSelected()}delegateCheckoutEvent(t){if(C.isValidMouseEvent(t)){const e=t.target;C.isValidCarrierSelectionEvent(e)?this.getCarrierSelected():C.isValidCarrierEvent(e)?this.sendTrackingCarrierOption():C.isValidPaymentSelectionEvent(e)?this.getPaymentSelected():C.isValidPurchaseEvent(e)&&this.sendTrackingPaymentOption()}}static isValidCarrierSelectionEvent(t){return t.matches("#checkout-delivery-step .delivery-options *")}getCarrierSelected(){let t="",e=document.querySelector("[id^=delivery_option_]:checked");e=e?e.closest(".delivery-option"):null,e=e?e.querySelector(".carrier-name"):null,e&&(t=e.textContent||""),this.carrierSelected=t.trim()}static isValidCarrierEvent(t){return Boolean(t.closest("#checkout-delivery-step button[type=submit]"))}static isValidPaymentSelectionEvent(t){return t.matches("#checkout-payment-step .payment-options *")}getPaymentSelected(){let t="";const e=document.querySelector("[id^=payment-option-]:checked");e&&Object.hasOwnProperty.call(e.dataset,"moduleName")&&(t=e.dataset.moduleName||""),this.paymentSelected=t.trim()}static isValidPurchaseEvent(t){return Boolean(t.closest("#payment-confirmation button[type=submit]"))&&C.isValidAgreement()}static isValidAgreement(){const t=document.querySelector("input[name^=conditions_to_approve]");return!(t instanceof HTMLInputElement)||t.checked}initDataEvent(t){0!==this.step&&super.initDataEvent(t)}}class _ extends P{setDefaultCheckoutValues(){this.getCarrierSelected(),this.getPaymentSelected()}static isValidCarrierSelectionEvent(t){return t.matches("#pwc-delivery-options *")}getPaymentSelected(){this.paymentSelected="sveacheckout"}static isValidPurchaseEvent(t){return t.matches("a *")}triggerPurchaseEvent(){this.sendTrackingCarrierOption(),this.sendTrackingPaymentOption()}}class y extends _{constructor(t){super(t),this.cartViewEvent=new p}initEvent(){this.cartViewEvent.initEvent(),this.initCheckoutEvent()}delegateCheckoutEvent(t){if(y.isValidMouseEvent(t)){const e=t.target;y.isValidCarrierSelectionEvent(e)?this.getCarrierSelected():y.isValidPurchaseEvent(e)&&this.triggerPurchaseEvent()}}getCarrierSelected(){let t="";const e=document.querySelector(".selected[id^=delivery_option] .flex-grow-1.flex-shrink-1");return e instanceof HTMLElement&&e.firstElementChild instanceof HTMLElement&&(t=e.firstElementChild.innerText.trim().toLowerCase()),this.carrierSelected=t}}class E extends P{setDefaultCheckoutValues(){this.getCarrierSelected(),this.getPaymentSelected()}static isValidCarrierSelectionEvent(t){return t.matches("#klarnacarrier *")}getPaymentSelected(){this.paymentSelected="klarna"}triggerPurchaseEvent(){this.sendTrackingCarrierOption(),this.sendTrackingPaymentOption()}static isValidPurchaseEvent(t){return t.matches("a *")}}
12class w extends E{constructor(t){super(t),this.cartViewEvent=new p}initEvent(){this.cartViewEvent.initEvent(),this.initCheckoutEvent()}delegateCheckoutEvent(t){if(w.isValidMouseEvent(t)){const e=t.target;w.isValidCarrierSelectionEvent(e)?this.getCarrierSelected():w.isValidPurchaseEvent(e)&&this.triggerPurchaseEvent()}}getCarrierSelected(){let t="";const e=document.querySelector("#klarnacarrier .selected .kco-sel-list__item__title");e instanceof HTMLElement&&e.firstElementChild instanceof HTMLElement&&(t=e.firstElementChild.innerText.trim().toLowerCase()),this.carrierSelected=t}}class S extends P{delegateCheckoutEvent(t){}setDefaultCheckoutValues(){this.getCarrierSelected(),this.getPaymentSelected()}getCarrierSelected(){this.carrierSelected="not detected"}getPaymentSelected(){this.paymentSelected="qliro"}}class V extends S{constructor(t){super(t),this.cartViewEvent=new p}initEvent(){this.cartViewEvent.initEvent()}}class L extends P{setDefaultCheckoutValues(){setTimeout(this.getCheckoutLazyOptions.bind(this),1e3)}getCheckoutLazyOptions(){document.querySelector("#thecheckout-payment")?(this.getCarrierSelected(),this.getPaymentSelected()):setTimeout(this.getCheckoutLazyOptions.bind(this),1e3)}}class x extends L{constructor(t){super(t),this.cartViewEvent=new p}initEvent(){this.cartViewEvent.initEvent(),this.initCheckoutEvent()}delegateCheckoutEvent(t){if(x.isValidMouseEvent(t)){const e=t.target;e.matches("[id^=tc-container] *")&&(x.isValidCarrierSelectionEvent(e)?this.getCarrierSelected():x.isValidPaymentSelectionEvent(e)?this.getPaymentSelected():x.isValidPurchaseEvent(e)&&this.triggerPurchaseEvent())}}static isValidCarrierSelectionEvent(t){return t.matches("#thecheckout-shipping *")}getCarrierSelected(){let t="";const e=document.querySelector(".delivery-options input:checked");if(e instanceof HTMLInputElement){const i=e.closest(".delivery-option-row");if(i instanceof HTMLElement){const e=i.querySelector(".carrier-name");t=e instanceof HTMLElement?e.innerText:""}}this.carrierSelected=t.trim().toLowerCase()}static isValidPaymentSelectionEvent(t){return t.matches("#thecheckout-payment *")}getPaymentSelected(){let t="";const e=document.querySelector(".payment-options input:checked");e instanceof HTMLInputElement&&(t=e.dataset.moduleName||""),this.paymentSelected=t.trim().toLowerCase()}static isValidPurchaseEvent(t){return Boolean(t.closest("#confirm_order"))&&x.isValidAgreement()}static isValidAgreement(){const t=document.querySelector("input[name^=conditions_to_approve]");return!(t instanceof HTMLInputElement)||t.checked}triggerPurchaseEvent(){x.isCheckoutWithCarrier("body:not(.is-virtual-cart) #thecheckout-shipping")&&this.sendTrackingCarrierOption(),this.sendTrackingPaymentOption()}}class b extends P{static isCartViewEvent(){return Boolean(document.querySelector("#cart_summary"))}setDefaultCheckoutValues(){setTimeout(this.getCheckoutLazyOptions.bind(this),1e3)}getCheckoutLazyOptions(){document.querySelector("#payment_method_container")?(this.getCarrierSelected(),this.getPaymentSelected()):setTimeout(this.getCheckoutLazyOptions.bind(this),1e3)}static isValidPaymentSelectionEvent(t){return t.matches("#payment_method_container *")}static isValidPurchaseEvent(t,e){return Boolean(t.closest("#btn_place_order, #btn-placer_order"))&&P.isValidAgreement(e)}}class T extends b{constructor(t){super(t),this.cartViewEvent=new p}initEvent(){T.isCartViewEvent()?this.cartViewEvent.initEvent():this.initCheckoutEvent()}delegateCheckoutEvent(t){if(T.isValidMouseEvent(t)){const e=t.target;e.matches("#onepagecheckoutps_contenedor *, #opc_main *")&&(T.isValidCarrierSelectionEvent(e)?this.getCarrierSelected():T.isValidPaymentSelectionEvent(e)?this.getPaymentSelected():T.isValidPurchaseEvent(e,"input[name=conditions_to_approve]")&&this.triggerPurchaseEvent())}}static isValidCarrierSelectionEvent(t){return t.matches("#js-delivery *, #form-shipping_container .delivery-options *")}getCarrierSelected(){let t="";const e=document.querySelector("[name^=delivery_option]:checked");if(e instanceof HTMLInputElement){const i=e.closest(".delivery-option");if(i instanceof HTMLElement){const e=i.querySelector(".delivery_option_title");t=e instanceof HTMLElement&&e.textContent?e.textContent:""}}this.carrierSelected=t.trim().toLowerCase()}getPaymentSelected(){let t="";const e=document.querySelector("[name=payment-option]:checked");e instanceof HTMLInputElement&&(t=e.value.trim().toLowerCase()),this.paymentSelected=t}triggerPurchaseEvent(){T.isCheckoutWithCarrier("#onepagecheckoutps_contenedor #js-delivery, #opc_main #form-shipping_container")&&this.sendTrackingCarrierOption(),this.sendTrackingPaymentOption()}initDataEvent(t){T.isCartViewEvent()?this.cartViewEvent.initDataEvent(t):super.initDataEvent(t)}}class O extends P{setDefaultCheckoutValues(){setTimeout(this.getCheckoutLazyOptions.bind(this),1e3)}getCheckoutLazyOptions(){document.querySelector("#st-checkout-payment-step")?(this.getCarrierSelected(),this.getPaymentSelected()):setTimeout(this.getCheckoutLazyOptions.bind(this),1e3)}}class M extends O{constructor(t){super(t),this.cartViewEvent=new p}initEvent(){this.cartViewEvent.initEvent(),this.initCheckoutEvent()}delegateCheckoutEvent(t){if(M.isValidMouseEvent(t)){const e=t.target;e.matches("#content.steco_container *")&&(M.isValidCarrierSelectionEvent(e)?this.getCarrierSelected():M.isValidPaymentSelectionEvent(e)?this.getPaymentSelected():M.isValidPurchaseEvent(e)&&this.triggerPurchaseEvent())}}static isValidCarrierSelectionEvent(t){return t.matches("#st-checkout-delivery-step *")}getCarrierSelected(){let t="";const e=document.querySelector(".delivery-options input:checked");if(e instanceof HTMLInputElement){const i=e.closest(".delivery-option");if(i instanceof HTMLElement){const e=i.querySelector(".carrier-name");
12t=e instanceof HTMLElement?e.innerText:""}}this.carrierSelected=t.trim().toLowerCase()}static isValidPaymentSelectionEvent(t){return t.matches("#st-checkout-payment-step *")}getPaymentSelected(){let t="";const e=document.querySelector(".payment-options input:checked");e instanceof HTMLInputElement&&(t=e.dataset.moduleName||""),this.paymentSelected=t.trim().toLowerCase()}static isValidPurchaseEvent(t){return Boolean(t.closest("#payment-confirmation"))&&M.isValidAgreement()}static isValidAgreement(){const t=document.querySelector("input[name^=conditions_to_approve]");return!(t instanceof HTMLInputElement)||t.checked}triggerPurchaseEvent(){M.isCheckoutWithCarrier("#st-checkout-delivery-step")&&this.sendTrackingCarrierOption(),this.sendTrackingPaymentOption()}}class I extends P{setDefaultCheckoutValues(){setTimeout(this.getCheckoutLazyOptions.bind(this),1e3)}getCheckoutLazyOptions(){document.querySelector("#supercheckout-fieldset")?(this.getCarrierSelected(),this.getPaymentSelected()):setTimeout(this.getCheckoutLazyOptions.bind(this),1e3)}}class D extends I{constructor(t){super(t),this.cartViewEvent=new p}initEvent(){this.cartViewEvent.initEvent(),this.initCheckoutEvent()}delegateCheckoutEvent(t){if(D.isValidMouseEvent(t)){const e=t.target;e.matches("#supercheckout-fieldset *")&&(D.isValidCarrierSelectionEvent(e)?this.getCarrierSelected():D.isValidPaymentSelectionEvent(e)?this.getPaymentSelected():D.isValidPurchaseEvent(e)&&this.triggerPurchaseEvent())}}static isValidCarrierSelectionEvent(t){return t.matches("#shipping-method *")}getCarrierSelected(){let t="";const e=document.querySelector("input.supercheckout_shipping_option:checked");if(e instanceof HTMLInputElement){const i=e.closest("li");if(i instanceof HTMLElement){const e=i.querySelector("img")||i.querySelector("label");e instanceof HTMLImageElement?t=e.alt:e instanceof HTMLLabelElement&&e.firstChild instanceof Text&&e.firstChild.textContent&&(t=e.firstChild.textContent)}}this.carrierSelected=t.trim().toLowerCase()}static isValidPaymentSelectionEvent(t){return t.matches("#payment-method *")}getPaymentSelected(){let t="";const e=document.querySelector(".payment-options input:checked");e instanceof HTMLInputElement&&(t=e.dataset.moduleName||""),this.paymentSelected=t.trim().toLowerCase()}static isValidPurchaseEvent(t){return Boolean(t.closest("#supercheckout_confirm_order"))&&D.isValidAgreement()}static isValidAgreement(){const t=document.querySelector("input[name^=conditions_to_approve]");return!(t instanceof HTMLInputElement)||t.checked}triggerPurchaseEvent(){D.isCheckoutWithCarrier("input.supercheckout_shipping_option")&&this.sendTrackingCarrierOption(),this.sendTrackingPaymentOption()}}class A{constructor(){this.productsThemeData=[],this.detailProductsList=[],this.orderProductsList=[]}}var q=function(t,e,i,r){return new(i||(i=Promise))((function(n,s){function o(t){try{c(r.next(t))}catch(t){s(t)}}function a(t){try{c(r.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}c((r=r.apply(t,e||[])).next())}))};class j extends A{getCartProductsData(){return q(this,void 0,void 0,(function*(){return this.updateCartProducts(),this.getProductsThemeData(),yield this.getProductsListData(),this.detailProductsList&&this.getOrderProductsList(),[this.detailProductsList,this.orderProductsList]}))}updateCartProducts(){this.cartProducts=prestashop.cart.products}getProductsThemeData(){this.cartProducts&&this.cartProducts.forEach((t=>{const e={idProduct:parseInt(t.id_product),idProductAttribute:parseInt(t.id_product_attribute)};this.isNewProduct(e)&&this.productsThemeData.push(e)}))}isNewProduct(t){return!this.productsThemeData.some((e=>e.idProduct===t.idProduct&&e.idProductAttribute===t.idProductAttribute))}getProductsListData(){return q(this,void 0,void 0,(function*(){this.productsThemeData.length&&(this.detailProductsList=yield l.getProductsDetailList(this.productsThemeData))}))}getOrderProductsList(){this.detailProductsList&&this.cartProducts&&(this.orderProductsList=JSON.parse(JSON.stringify(this.detailProductsList)),this.cartProducts.forEac
12h(((t,e)=>{this.orderProductsList[e].quantity=t.quantity})))}}class B{static getCheckoutController(){let e;const i=new j;switch(t.getContext().getTrackingConfig().context.tracking_module.checkout_module.module){case"klarnaofficial":e=new w(i);break;case"onepagecheckoutps":e=new T(i);break;case"pw_qlirocheckout":e=new V(i);break;case"steasycheckout":e=new M(i);break;case"supercheckout":e=new D(i);break;case"sveacheckout":e=new y(i);break;case"thecheckout":e=new x(i);break;default:e=new C(i)}return e}}class H extends k{getCheckoutModule(){return B.getCheckoutController()}}class G{constructor(){this.trackingConfig=t.getContext().getTrackingConfig(),this.trackingPlatform=t.getContext().getTrackingPlatform()}initEvent(){this.triggerEvent()}triggerEvent(){this.trackingConfig.context.user&&this.trackingConfig.context.user.is_new_login&&this.trackingPlatform.customerLogin()}}class Q extends G{}class N{constructor(){this.trackingConfig=t.getContext().getTrackingConfig(),this.trackingPlatform=t.getContext().getTrackingPlatform()}initEvent(){this.triggerEvent()}triggerEvent(){this.trackingConfig.context.user&&this.trackingConfig.context.user.is_new_account&&this.trackingPlatform.customerSignUp()}}class R extends N{}class F{constructor(){this.trackingConfig=t.getContext().getTrackingConfig(),this.trackingPlatform=t.getContext().getTrackingPlatform()}initEvent(){"index"===this.trackingConfig.context.page.controller_name&&this.triggerEvent()}triggerEvent(){this.trackingPlatform.homePageView()}}class J extends F{}class U{constructor(){this.blockUpdate=!1,this.trackingConfig=t.getContext().getTrackingConfig(),this.trackingPlatform=t.getContext().getTrackingPlatform()}initDataEvent(t){U.isValidTrackingData(t)&&(this.trackingPlatform.isAvailable()?this.trackingPlatform.orderComplete(t.order_complete_data,t.detail_products_list,t.order_products_list,t.order_context_user_data,this.setOrderTrackingStatus.bind(this)):this.handleAdBlockOrderAborted(t.order_complete_data))}static isValidTrackingData(t){return Object.prototype.hasOwnProperty.call(t,"order_complete_data")&&Object.prototype.hasOwnProperty.call(t,"detail_products_list")&&Object.prototype.hasOwnProperty.call(t,"order_products_list")&&Object.prototype.hasOwnProperty.call(t,"order_context_user_data")&&Boolean(Object.keys(t.order_complete_data).length)&&Boolean(Object.keys(t.detail_products_list).length)&&Boolean(Object.keys(t.order_products_list).length)&&Boolean(Object.keys(t.order_context_user_data).length)}setOrderTrackingStatus(t){this.blockUpdate?setTimeout(this.setOrderTrackingStatus.bind(this),30,t):(this.blockUpdate=!0,this.serverRequest("setOrderTrackingStatus",t))}handleAdBlockOrderAborted(t){this.serverRequest("handleAdBlockOrderAborted",t)}serverRequest(t,e){const i={url:this.trackingConfig.context.shop.base_dir+"index.php",fc:"module",module:this.trackingConfig.context.tracking_module.module_name,controller:"datarequest",action:t,data:e,token:this.trackingConfig.context.tracking_module.token};new d(i).fetchRequest().then((t=>this.blockUpdate=!1))}}class z extends U{}class K{constructor(){this.trackingPlatform=t.getContext().getTrackingPlatform(),this.sessionStorage=t.getContext().getSessionStorage()}initEvent(){document.addEventListener("click",this.handleEvent.bind(this),!0)}triggerEvent(t){return e=this,i=void 0,n=function*(){if(t.length){const e=yield l.getProductsDetailList(t);if(e.length){const t=this.sessionStorage.getAttributionDataList();this.trackingPlatform.productClick(e[0],t)}}},new((r=void 0)||(r=Promise))((function(t,s){function o(t){try{c(n.next(t))}catch(t){s(t)}}function a(t){try{c(n.throw(t))}catch(t){s(t)}}function c(e){var i;e.done?t(e.value):(i=e.value,i instanceof r?i:new r((function(t){t(i)}))).then(o,a)}c((n=n.apply(e,i||[])).next())}));var e,i,r,n}}class W extends K{handleEvent(t){if(0===t.button&&t.target instanceof Element){const e=W.getProductThemeDataList(t.target);this.triggerEvent(e)}}static getProductThemeDataList(t){const e=[],i=t.closest(".js-product-miniature a");if(i instanceof HTMLElement){const r=".js-product-miniature",n=t.closest(r);if(n instanceof HTMLElement){const t=parseInt(n.dataset.idProduct||"0"),r=parseInt(i.dataset.idProductAttribute||n.dataset.idProductAttribute||"0");t&&e.push({idProduct:t,idProductAttribute:r})}}return e}}class X{constructor(){this.trackingConfig=t.getContext().getTrackingConfig(),this.trackingPlatform=t.getContext().getTrackingPlatform()}initEvent(){document.addEventListener("click",this.handleEvent.bind(this),!1)}triggerEvent(t,e){return i=this,r=void 0,s=function*(){if(t.length&&e){const i=yield l.getProductsDetail
12List(t);i.length&&this.trackingPlatform.productShare(i[0],e)}},new((n=void 0)||(n=Promise))((function(t,e){function o(t){try{c(s.next(t))}catch(t){e(t)}}function a(t){try{c(s.throw(t))}catch(t){e(t)}}function c(e){var i;e.done?t(e.value):(i=e.value,i instanceof n?i:new n((function(t){t(i)}))).then(o,a)}c((s=s.apply(i,r||[])).next())}));var i,r,n,s}static getSocialNetwork(t){return t.dataset.network||t.dataset.type||t.title||""}}class Y extends X{constructor(){super(...arguments),this.productView={idProduct:0,idProductAttribute:0},this.productQuickView={idProduct:0,idProductAttribute:0}}initEvent(){super.initEvent(),prestashop.on("clickQuickView",this.handlePSEvent.bind(this)),prestashop.on("updatedProduct",this.handlePSEvent.bind(this))}handlePSEvent(t){Y.isEventQuickView(t)?(this.productQuickView.idProduct=t.dataset.idProduct,this.productQuickView.idProductAttribute=t.dataset.idProductAttribute):this.productView.idProductAttribute=parseInt(t.id_product_attribute)}static isEventQuickView(t){return Object.prototype.hasOwnProperty.call(t,"dataset")}handleEvent(t){if(0===t.button&&t.target instanceof Element){const e=".js-social-sharing",i=t.target.closest(e);if(i instanceof HTMLElement){const t=this.getProductsDataList(i),e=Y.getSocialNetwork(i);this.triggerEvent(t,e)}}}getProductsDataList(t){const e=[],i=t.closest("[id^=quickview-modal-]")instanceof HTMLElement?this.productQuickView:this.productView;return i.idProduct&&e.push(i),e}initDataEvent(t){"product"===this.trackingConfig.context.page.controller_name&&Object.prototype.hasOwnProperty.call(t,"detail_product_view")&&t.detail_product_view.length&&(this.productView.idProduct=t.detail_product_view[0].id_product,this.productView.idProductAttribute=t.detail_product_view[0].id_attribute)}}class Z{constructor(){this.trackingPlatform=t.getContext().getTrackingPlatform(),this.sessionStorage=t.getContext().getSessionStorage()}}class $ extends Z{constructor(){super(...arguments),this.latestProductView="",this.productView={idProduct:0,idProductAttribute:0},this.productQuickView={idProduct:0,idProductAttribute:0}}initEvent(){prestashop.on("clickQuickView",this.triggerEvent.bind(this)),prestashop.on("updatedProduct",this.triggerEvent.bind(this))}triggerEvent(t){return e=this,i=void 0,n=function*(){const e=this.getProductsDataList(t);if(e.length){const t=yield l.getProductsDetailList(e);t.length&&this.trackingPlatform.productView(t[0])}},new((r=void 0)||(r=Promise))((function(t,s){function o(t){try{c(n.next(t))}catch(t){s(t)}}function a(t){try{c(n.throw(t))}catch(t){s(t)}}function c(e){var i;e.done?t(e.value):(i=e.value,i instanceof r?i:new r((function(t){t(i)}))).then(o,a)}c((n=n.apply(e,i||[])).next())}));var e,i,r,n}getProductsDataList(t){const e=[];if($.isEventQuickView(t))this.productQuickView.idProduct=t.dataset.idProduct,this.productQuickView.idProductAttribute=t.dataset.idProductAttribute,e.push(this.productQuickView);else{const i=$.isQuickViewModal()?this.productQuickView:this.productView;i.idProductAttribute=parseInt(t.id_product_attribute),this.isLatestProductView(i)&&(e.push(i),this.setLatestProductView(i))}return e}static isEventQuickView(t){return Object.prototype.hasOwnProperty.call(t,"dataset")}static isQuickViewModal(){return Boolean(document.querySelector("[id^=quickview]"))}isLatestProductView(t){return this.latestProductView!==JSON.stringify(t)}setLatestProductView(t){this.latestProductView=JSON.stringify(t)}initDataEvent(t){if(Object.prototype.hasOwnProperty.call(t,"detail_product_view")&&t.detail_product_view.length){this.sessionStorage.addProductsList(t.detail_product_view);const e=t.detail_product_view[0];this.productView.idProduct=e.id_product,this.productView.idProductAttribute=e.id_attribute,this.trackingPlatform.productView(e),this.setLatestProductView(this.productView)}}}var tt=function(t,e,i,r){return new(i||(i=Promise))((function(n,s){function o(t){try{c(r.next(t))}catch(t){s(t)}}function a(t){try{c(r.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}c((r=r.apply(t,e||[])).next())}))};class et{static getThemeParameters(t){const e={pid:"",pnm:"",cnm:"",csl:"",ppid:"",ppaid:""};if(t.search){const i=new URLSearchParams(t.search);if(et.hasRequiredPromotionParams(i))return Object.keys(e).forEach((t=>{const r=i.get(t);r&&(e[t]=r)})),e}}static hasRequiredPromotionParams(t){return Boolean(t.get("pid"))}static getDetailPromotionModel(t){return tt(this,void 0,void 0,(function*(){const e={promotion_url:"",promotion_params:{promotion_id:"",promotion_name:"",creative_slot:"",creative_name:""}};if(t&&t.parameters&&(e.promotion_url=t.url,Object.entries({pid:"promotion_id",pnm:"promotion_name",cnm:"creative_name",csl:"creative_slot"}
12).forEach((([i,r])=>{var n;e.promotion_params[r]=(null===(n=t.parameters)||void 0===n?void 0:n[i])||""})),et.hasPromotionItem(t.parameters))){const i=yield et.getPromotionItem(t);i&&(e.promotion_item=i[0])}return e}))}static hasPromotionItem(t){return Boolean(t.ppid)}static getPromotionItem(t){return tt(this,void 0,void 0,(function*(){var e,i;const r={idProduct:parseInt(null===(e=t.parameters)||void 0===e?void 0:e.ppid),idProductAttribute:parseInt((null===(i=t.parameters)||void 0===i?void 0:i.ppaid)||"0")};return l.getProductsDetailList([r])}))}}var it=function(t,e,i,r){return new(i||(i=Promise))((function(n,s){function o(t){try{c(r.next(t))}catch(t){s(t)}}function a(t){try{c(r.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}c((r=r.apply(t,e||[])).next())}))};class rt{constructor(){this.trackingPlatform=t.getContext().getTrackingPlatform()}initEvent(){document.addEventListener("click",this.triggerEvent.bind(this),!0)}triggerEvent(t){return it(this,void 0,void 0,(function*(){const e=yield this.getPromotionData(t);e&&this.trackingPlatform.promotionClick(e)}))}getPromotionData(t){return it(this,void 0,void 0,(function*(){let e;if(0===t.button&&t.target instanceof Element){const i=t.target.closest(".js-track-promo a");if(i){const t={url:i.href,parameters:et.getThemeParameters(i)};e=yield et.getDetailPromotionModel(t)}}return e}))}}class nt extends rt{}class st{constructor(){this.trackingConfig=t.getContext().getTrackingConfig(),this.trackingPlatform=t.getContext().getTrackingPlatform()}initEvent(){var t;(null===(t=this.trackingConfig.context.page.search_term)||void 0===t?void 0:t.length)&&this.trackingPlatform.searchPageView()}}class ot extends st{}class at{constructor(){this.scrollTimeout=0,this.trackingConfig=t.getContext().getTrackingConfig(),this.trackingPlatform=t.getContext().getTrackingPlatform(),this.allItemsList=this.getAllItemsList()}initEvent(){window.addEventListener("scroll",this.triggerEvent.bind(this),!0),this.parseItemsList(),this.sendItems()}triggerEvent(){window.clearTimeout(this.scrollTimeout),this.parseItemsList(),this.scrollTimeout=window.setTimeout((()=>this.sendItems()),800)}parseItemsList(){this.allItemsList.length&&this.allItemsList.forEach((t=>{const e=t.getItemsListDetected();e.length&&e.forEach((e=>{at.isElementInViewport(e)&&t.addItem(e)}))}))}static isElementInViewport(t){let e=!1;const i=window.innerHeight,r=window.scrollY,n=r,s=r+i;let o,a,c,d,u;const l=t.clientHeight;return l&&(c=getComputedStyle(t),d=parseInt(c.paddingTop)+parseInt(c.paddingBottom),u=t.getBoundingClientRect(),o=u.top+r,a=o+(l-d),e=o>=n&&o<s||a>=n&&a<s),e}sendItems(){this.allItemsList.forEach((t=>{t.sendItems()})),window.clearTimeout(this.scrollTimeout)}}class ct{constructor(e){this.itemSelector=e,this.sendProducts=new Set,this.sentProducts=new Set,this.productsPosition={},this.trackingConfig=t.getContext().getTrackingConfig(),this.trackingPlatform=t.getContext().getTrackingPlatform(),this.sessionStorage=t.getContext().getSessionStorage()}getItemsListDetected(){return document.querySelectorAll(this.itemSelector)}addItem(t){const e=parseInt(t.getAttribute("data-id-product")||"0"),i=parseInt(t.getAttribute("data-id-product-attribute")||"0");if(e){const t={idProduct:e,idProductAttribute:i},r=JSON.stringify(t);this.sentProducts.has(r)||this.sendProducts.has(r)||this.sendProducts.add(r)}}sendItems(){return t=this,e=void 0,r=function*(){if(this.sendProducts.size){this.buildProductPositions();const t=this.getProductsDataListFromSendProducts(),e=yield l.getProductsDetailList(t);e.length&&(this.trackingPlatform.productsList(e,this.productsPosition),this.sentProducts=new Set([...Array.from(this.sentProducts),...Array.from(this.sendProducts)]),this.sendProducts.clear())}},new((i=void 0)||(i=Promise))((function(n,s){function o(t){try{c(r.next(t))}catch(t){s(t)}}function a(t){try{c(r.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}c((r=r.apply(t,e||[])).next())}));var t,e,i,r}getProductsDataListFromSendProducts(){const t=[];
12return this.sendProducts.forEach((e=>{t.push(JSON.parse(e))})),t}buildProductPositions(){const t=this.getItemsListDetected();let e,i,r=this.getPageFirstPosition();t.forEach((t=>{if(e=parseInt(t.getAttribute("data-id-product")||"0"),i=parseInt(t.getAttribute("data-id-product-attribute")||"0"),e){const t={idProduct:e,idProductAttribute:i},n=JSON.stringify(t);Object.prototype.hasOwnProperty.call(this.productsPosition,n)||(this.productsPosition[n]=r,r+=1),this.sessionStorage.addAttributionData(n,this.productsPosition[n])}}))}}class dt extends ct{constructor(){super(".js-product-miniature")}getPageFirstPosition(){let t=1;const e=this.trackingConfig.context.page.products_per_page,i=new URLSearchParams(window.location.search).get("page");return i&&(t=parseInt(i)),e*t-e+1}}class ut{constructor(){this.itemSelector=".js-track-promo",this.sendPromotions=new Set,this.sentPromotions=new Set,this.trackingPlatform=t.getContext().getTrackingPlatform()}getItemsListDetected(){return document.querySelectorAll(this.itemSelector)}addItem(t){const e=t.querySelector("a");if(e){const t={url:e.href,parameters:et.getThemeParameters(e)};if(t.parameters){const e=JSON.stringify(t);this.sendPromotions.has(e)||this.sentPromotions.has(e)||this.sendPromotions.add(e)}}}sendItems(){return t=this,e=void 0,r=function*(){if(this.sendPromotions.size){const t=[];for(const e of this.sendPromotions){const i=JSON.parse(e),r=yield et.getDetailPromotionModel(i);r&&t.push(r)}this.trackingPlatform.promotionsList(t),this.sentPromotions=new Set([...Array.from(this.sentPromotions),...Array.from(this.sendPromotions)]),this.sendPromotions.clear()}},new((i=void 0)||(i=Promise))((function(n,s){function o(t){try{c(r.next(t))}catch(t){s(t)}}function a(t){try{c(r.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}c((r=r.apply(t,e||[])).next())}));var t,e,i,r}}class lt extends ut{}class gt extends at{getAllItemsList(){return[new dt,new lt]}}class ht extends a{createAddToCartEvent(){"cart"!==this.trackingConfig.context.page.controller_name&&this.actionTrackingEvents.push(new g)}createCartViewEvent(){if("cart"===this.trackingConfig.context.page.controller_name){const t=new p;this.actionTrackingEvents.push(t),this.dataTrackingEvents.push(t)}}createCategoryEvent(){"category"===this.trackingConfig.context.page.controller_name&&this.actionTrackingEvents.push(new f)}createCheckoutEvent(){if(this.trackingConfig.context.page.controller_name===this.trackingConfig.context.tracking_module.checkout_module.controller){const t=new H;this.actionTrackingEvents.push(t),this.dataTrackingEvents.push(t)}}createCustomerLogin(){this.trackingConfig.context.user.is_new_login&&this.actionTrackingEvents.push(new Q)}createCustomerSignUp(){this.trackingConfig.context.user.is_new_account&&this.actionTrackingEvents.push(new R)}createHomeEvent(){this.actionTrackingEvents.push(new J)}createOrderCompleteEvent(){this.dataTrackingEvents.push(new z)}createProductClickEvent(){this.actionTrackingEvents.push(new W)}createProductShareEvent(){const t=new Y;this.actionTrackingEvents.push(t),"product"===this.trackingConfig.context.page.controller_name&&this.dataTrackingEvents.push(t)}createProductViewEvent(){const t=new $;this.actionTrackingEvents.push(t),"product"===this.trackingConfig.context.page.controller_name&&this.dataTrackingEvents.push(t)}createPromotionClickEvent(){this.actionTrackingEvents.push(new nt)}createSearchEvent(){new RegExp("search").test(this.trackingConfig.context.page.controller_name)&&this.actionTrackingEvents.push(new ot)}createViewItemsListEvent(){this.actionTrackingEvents.push(new gt)}}class mt{static getEventFactory(){switch(t.getContext().getTrackingConfig().context.tracking_module.service_version){case"1":case"8":case"9":return new ht;default:throw Error("Unable to load event manager")}}}class pt{addToCart(t,e){}cartView(t,e){}categoryPageView(){}checkoutProgress(t,e,i){}checkoutOption(t,e,i){}customerLogin(){}customerSignUp(){}homePageView(){}orderComplete(t,e,i,r,n){}productClick(t,e){}productsList(t,e){}productView(t){}productShare(t,e){}promotionsList(t){}promotionClick(t){}removeFromCart(t,e){}searchPageView(){}}class vt{constructor(t,e){this.trackingConfig=t,this.component=e,this.eventTimeout=300}addToCart(t,e){this.component.addToCart(t,e)}homePageView(){this.component.homePageView()}categoryPageView(){this.component.categoryPageView()}searchPageView(){this.component.searchPageView()}productsList(t,e){this.component.productsList(t,e)}productClick(t,e){this.component.productClick(t,e)}productView(t){this.component.productView(t)}productShare(t,e){this.component.productShare(t,e)}removeFromCart(t,e){this.component.removeFromCart(t,e)}cartView(t,e){this.component.cartView(t,e)}checkoutProgress(t,e,i){this.component.checkoutProgress(t,e,i)}
12checkoutOption(t,e,i,r,n){this.component.checkoutOption(t,e,i,r,n)}orderComplete(t,e,i,r,n){this.component.orderComplete(t,e,i,r,n)}promotionsList(t){this.component.promotionsList(t)}promotionClick(t){this.component.promotionClick(t)}customerSignUp(){this.component.customerSignUp()}customerLogin(){this.component.customerLogin()}}class ft{constructor(t){this.trackingConfig=t}static getItemLIst(t){return"product"!==(t=ft.camelToSnake(t))?t:"accessories"}static camelToSnake(t){return t.replace(/[A-Z]/g,(t=>"_"+t.toLowerCase()))}static getPromotionParams(t){const e={promotion_id:"promotion_id",promotion_name:"promotion_name",creative_name:"creative_name",creative_slot:"creative_slot"},i={},r={};return Object.entries(t.promotion_params).forEach((([t,i])=>{i&&(r[e[t]]=i)})),t.promotion_item&&(i.items=[t.promotion_item]),i}static getItemFingerprint(t){return t.id_product+"-"+t.id_attribute}static getOrderProductListValue(t,e=!1){let i=0;return t&&(i=t.reduce(((t,i)=>{const r=e?i.price_sale:i.price_sale_tax_excl,n=Math.round(100*r)*i.quantity;return((t=Math.round(100*t))+n)/100}),0)),i}static getItemValue(t,e,i=!1){const r=i?t.price_sale:t.price_sale_tax_excl;return Math.round(100*r)*e/100}static getItemDiscount(t){return(Math.round(100*t.price_main_tax_excl)-Math.round(100*t.price_sale_tax_excl))/100}static getOrderValue(t){return(Math.round(100*t.total_amounts.products_tax_excl)-Math.round(100*t.total_amounts.discounts_tax_excl))/100}getItemID(t){let e=this.trackingConfig.google_feed.id_product_prefix+t[this.trackingConfig.google_feed.id_product_source_key];return this.trackingConfig.google_feed.id_variant_prefix&&t[this.trackingConfig.google_feed.id_variant_source_key]&&(e+=this.trackingConfig.google_feed.id_variant_prefix+t[this.trackingConfig.google_feed.id_variant_source_key]),e}}class kt extends ft{static getRemarketingValue(t){let e=0;return t.length&&(e=t.reduce(((t,e)=>{const i=Math.round(100*e.price)*(e.quantity||1);return((t=Math.round(100*t))+i)/100}),0)),e}getGAdsServerSideDataModel(t,e){const i={retail:[],custom:[],value:0,country:this.trackingConfig.context.localization.country_code,language:this.trackingConfig.context.localization.lang_code,currency:this.trackingConfig.context.localization.currency_code};if(i.retail=t.map((t=>Object.assign(Object.assign({},t),{google_business_vertical:"retail"}))),i.value=kt.getRemarketingValue(t),this.trackingConfig.gads.is_custom_remarketing&&(i.custom=t.map((t=>Object.assign(Object.assign({},t),{google_business_vertical:"custom"})))),e&&e.total_amounts){e.total_amounts.products&&(i.value=e.total_amounts.products),e.total_amounts.discounts&&(i.discount=e.total_amounts.discounts);const t=this.getCustomerData();Object.assign(i,t)}return i}getItemListModel(t,e){const i=[];return t.forEach(((t,r)=>{let n;(null==e?void 0:e.length)&&(n=e[r].quantity);const s=this.getItemModel(t,n);i.push(s)})),i}getItemModel(t,e){const i={id:this.getItemID(t),price:t.price_sale};return e&&(i.quantity=e),i}setGoogleBusinessVertical(t,e){return t.google_business_vertical=e,t}getCustomerData(){const t={new_customer:!1,customer_lifetime_value:this.trackingConfig.context.user.stats.total_spent};return this.trackingConfig.context.user.stats.orders_placed||(t.new_customer=!0),t}}class Pt extends vt{constructor(t,e){super(t,e),this.trackingConfig=t,this.component=e,this.modelBuilder=new kt(this.trackingConfig),this.googleBusinessVerticals=this.getGoogleBusinessVerticals()}addToCart(t,e){const i=this.modelBuilder.getItemModel(t,e);this.sendRemarketingEvents("add_to_cart",[i]),this.sendConversion(this.trackingConfig.gads.conversion_labels.add_to_cart,[i]),super.addToCart(t,e)}cartView(t,e){super.cartView(t,e)}categoryPageView(){super.categoryPageView()}checkoutOption(t,e,i,r,n){super.checkoutOption(t,e,i,r,n)}checkoutProgress(t,e,i){if(1===i){const i=this.modelBuilder.getItemListModel(t,e);this.sendConversion(this.trackingConfig.gads.conversion_labels.begin_checkout,i)}super.checkoutProgress(t,e,i)}customerLogin(){super.customerLogin()}customerSignUp(){this.sendConversion(this.trackingConfig.gads.conversion_labels.create_account),super.customerSignUp()}homePageView(){super.homePageView()}orderComplete(t,e,i,r,n){const s=this.modelBuilder.getItemListModel(e,i);this.sendRemarketingEvents("purchase",s,t),this.sendConversion(this.trackingConfig.gads.conversion_labels.purchase,s,t,n),super.orderComplete(t,e,i,r,n)}productClick(t,e){super.productClick(t,e)}productShare(t,e){super.productShare(t,e)}productView(t){const e=this.modelBuilder.getItemModel(t);this.sendRemarketingEvents("view_item",[e]),this.sendConversion(this.trackingConfig.gads.conversion_labels.product_view,[e]),super.productView(t)}productsList(t,e){const i=this.modelBuilder.getItemListModel(t);this.sendRemarketingEvents("view_item_list",i),super.productsList(t,e)}promotionClick(t){super.promotionClick(t)}promotionsList(t){super.promotionsList(t)}removeFromCart(t,e){super.removeFromCart(t,e)}searchPageView(){super.searchPageView()}getGoogleBusinessVerticals(){const t=[];return t.push("retail"),this.trackingConfig.gads.is_custom_remarketing&&t.push("custom"),t}sendRemarketingEvents(t,e,i){this.googleBusinessVerticals.forEac
12h((r=>{const n=e.map((t=>Object.assign(Object.assign({},t),{google_business_vertical:r})));this.sendRemarketing(t,n,i)}))}sendRemarketing(t,e,i){const r=this.getEventParams();r.items=e,r.value=kt.getRemarketingValue(e),r.currency=this.trackingConfig.context.localization.currency_code,(null==i?void 0:i.total_amounts.discounts)&&(r.transaction_id=i.id,r.discount=i.total_amounts.discounts,r.value=i.total_amounts.products),gtag("event",t,r)}sendConversion(t,e,i,r){if(t){const n=this.getEventParams(t);if(n.currency=this.trackingConfig.context.localization.currency_code,e&&e.length&&(n.items=e,n.value=kt.getRemarketingValue(e)),i){const t=Object.assign({},i);n.transaction_id=t.id,n.value=t.total_amounts.products,this.trackingConfig.gads.merchant_id&&(n.aw_merchant_id=this.trackingConfig.gads.merchant_id,n.aw_feed_country=this.trackingConfig.context.localization.country_code,n.aw_feed_language=this.trackingConfig.context.localization.lang_code),t.total_amounts.discounts&&(n.discount=t.total_amounts.discounts);const e=this.modelBuilder.getCustomerData();Object.assign(n,e),r&&(n.event_callback=(...e)=>{e[0]===this.trackingConfig.gads.tracking_id&&(t.platform_name="gads",r(t))},n.event_timeout=this.eventTimeout)}gtag("event","conversion",n)}}getEventParams(t=""){const e=[this.trackingConfig.gads.tracking_id];return t&&e.push(t),{send_to:e.join("/")}}}class Ct{static getProductPosition(t,e){let i=0;const r=Ct.getProductThemeData(t),n=JSON.stringify(r);return Object.prototype.hasOwnProperty.call(e,n)&&(i=e[n]),i}static getProductAttribution(t,e){let i=null;const r=Ct.getProductThemeData(t),n=JSON.stringify(r);return Object.prototype.hasOwnProperty.call(e,n)&&(i=e[n]),i}static getProductThemeData(t){return{idProduct:t.id_product,idProductAttribute:t.id_attribute}}}class _t extends ft{constructor(){super(...arguments),this.pipe=" / ",this.attributePipe=" : "}getItemListModel(t,e,i){const r=[];return t.forEach((t=>{let n,s,o;if(e){const i=e.find((e=>_t.getItemFingerprint(e)===_t.getItemFingerprint(t)));n=null==i?void 0:i.quantity}i&&(s=_t.getItemLIst(this.trackingConfig.context.page.controller_name),o=Ct.getProductPosition(t,i)),r.push(this.getItemModel(t,n,s,o))})),r}getItemModel(t,e,i,r){const n=this.getProductCommonData(t);return e&&(n.quantity=e),r&&(n.item_list_name=i||_t.getItemLIst(this.trackingConfig.context.page.controller_name),n.index=r),n}getProductCommonData(t){let e={item_id:this.getItemID(t),price:t.price_sale_tax_excl};return this.trackingConfig.ga4.is_data_import||(e.item_name=t.name,e.item_brand=t.manufacturer_name,t.category_path.length&&(e=Object.assign(Object.assign({},e),_t.getCategories(t.category_path))),t.attributes&&(e.item_variant=this.getVariant(t.attributes))),t.price_main_tax_excl>t.price_sale_tax_excl&&(e.discount=_t.getItemDiscount(t)),e}static getCategories(t){const e={},i=["item_category","item_category2","item_category3","item_category4","item_category5"],r=i.length;return t.length>r&&t.slice(t.length-r),t.forEach(((t,r)=>{e[i[r]]=t})),e}getVariant(t){const e=[];return t.forEach((t=>{e.push(t.join(this.attributePipe))})),e.join(this.pipe)}}class yt extends vt{constructor(t,e){super(t,e),this.trackingConfig=t,this.component=e,this.modelBuilder=new _t(this.trackingConfig),this.isGAdsServerSide()&&(this.GAdsModelBuilder=new kt(this.trackingConfig))}isGAdsServerSide(){return this.trackingConfig.ga4.server_container_url&&this.trackingConfig.gads.tracking_id}addToCart(t,e){const i=this.getEventParams();if(i.value=_t.getItemValue(t,e),i.items=[this.modelBuilder.getItemModel(t,e)],this.GAdsModelBuilder){const r=this.GAdsModelBuilder.getItemModel(t,e);i.gads_ss_data_model=JSON.stringify(this.GAdsModelBuilder.getGAdsServerSideDataModel([r]))}gtag("event","add_to_cart",i),super.addToCart(t,e)}cartView(t,e){const i=this.getEventParams();if(i.value=_t.getOrderProductListValue(e),i.items=this.modelBuilder.getItemListModel(t,e),this.GAdsModelBuilder){const r=this.GAdsModelBuilder.getItemListModel(t,e);i.gads_ss_data_model=JSON.stringify(this.GAdsModelBuilder.getGAdsServerSideDataModel(r))}gtag("event","view_cart",i),super.cartView(t,e)}categoryPageView(){if(this.trackingConfig.context.page.category){const t=this.getEventParam
12s();t.category_name=this.trackingConfig.context.page.category.name,gtag("event","view_category",t)}super.categoryPageView()}checkoutProgress(t,e,i){if(1===i){const i=this.getEventParams();if(i.value=_t.getOrderProductListValue(e),i.items=this.modelBuilder.getItemListModel(t,e),this.GAdsModelBuilder){const r=this.GAdsModelBuilder.getItemListModel(t,e);i.gads_ss_data_model=JSON.stringify(this.GAdsModelBuilder.getGAdsServerSideDataModel(r))}gtag("event","begin_checkout",i)}super.checkoutProgress(t,e,i)}checkoutOption(t,e,i,r,n){let s="";const o=this.getEventParams();"shipping"===t?(s="add_shipping_info",o.shipping_tier=e):"payment"===t&&(s="add_payment_info",o.payment_type=e),s&&r&&n&&(o.value=_t.getOrderProductListValue(n),o.items=this.modelBuilder.getItemListModel(r,n),gtag("event",s,o)),super.checkoutOption(t,e,i,r,n)}customerLogin(){const t=this.getEventParams();gtag("event","login",t),super.customerLogin()}customerSignUp(){const t=this.getEventParams();gtag("event","sign_up",t),super.customerSignUp()}homePageView(){super.homePageView()}orderComplete(t,e,i,r,n){const s=Object.assign({},t),o=this.modelBuilder.getItemListModel(e,i),a=this.getEventParams();if(a.transaction_id=s.id,a.tax=s.total_amounts.tax,a.shipping=s.total_amounts.shipping_tax_excl,a.value=_t.getOrderValue(s),a.items=o,s.coupons&&(a.coupon=s.coupons.join(", "),a.order_coupon_discount_amount=s.total_amounts.discounts_tax_excl),n&&(a.event_callback=(...t)=>{t[0]===this.trackingConfig.ga4.tracking_id&&(s.platform_name="ga4",n(s))},a.event_timeout=this.eventTimeout),this.GAdsModelBuilder){const r=this.GAdsModelBuilder.getItemListModel(e,i);a.gads_ss_data_model=JSON.stringify(this.GAdsModelBuilder.getGAdsServerSideDataModel(r,t))}gtag("event","purchase",a),super.orderComplete(t,e,i,r,n)}productClick(t,e){let i=0,r=this.trackingConfig.context.page.controller_name;const n=Ct.getProductAttribution(t,e);n&&(i=n.productPosition,r=n.productList);const s=this.modelBuilder.getItemModel(t,void 0,r,i),o=this.getEventParams();o.items=[s],gtag("event","select_item",o),super.productClick(t,e)}productsList(t,e){const i=this.trackingConfig.context.page.search_term?"view_search_results":"view_item_list",r=this.getEventParams();if(r.items=this.modelBuilder.getItemListModel(t,void 0,e),this.GAdsModelBuilder){const e=this.GAdsModelBuilder.getItemListModel(t);r.gads_ss_data_model=JSON.stringify(this.GAdsModelBuilder.getGAdsServerSideDataModel(e))}gtag("event",i,r),super.productsList(t,e)}productView(t){const e=this.modelBuilder.getItemModel(t),i=this.getEventParams();if(i.items=[e],this.GAdsModelBuilder){const e=this.GAdsModelBuilder.getItemModel(t);i.gads_ss_data_model=JSON.stringify(this.GAdsModelBuilder.getGAdsServerSideDataModel([e]))}gtag("event","view_item",i),super.productView(t)}productShare(t,e){if(e){const i=this.getEventParams();i.method=e,t&&(i.item_id=this.modelBuilder.getItemID(t)),gtag("event","share",i)}super.productShare(t,e)}promotionClick(t){const e=_t.getPromotionParams(t);if(e){const t=Object.assign(Object.assign({},this.getEventParams()),e);gtag("event","select_promotion",t)}super.promotionClick(t)}promotionsList(t){t.forEach((t=>{const e=_t.getPromotionParams(t);if(e){const t=Object.assign(Object.assign({},this.getEventParams()),e);gtag("event","view_promotion",t)}})),super.promotionsList(t)}removeFromCart(t,e){const i=this.getEventParams();i.value=_t.getItemValue(t,e),i.items=[this.modelBuilder.getItemModel(t,e)],gtag("event","remove_from_cart",i),super.removeFromCart(t,e)}searchPageView(){if(this.trackingConfig.context.page.search_term){const t=this.getEventParams();t.search_term=this.trackingConfig.context.page.search_term,gtag("event","search",t)}super.searchPageView()}getEventParams(){return{send_to:this.trackingConfig.ga4.tracking_id}}}class Et{constructor(){this.trackingConfig=t.getContext().getTrackingConfig(),this.trackingComponent=new pt,this.createGAdsCommandDecorator(),this.createGA4CommandDecorator()}createGA4CommandDecorator(){this.trackingConfig.ga4.tracking_id&&!this.trackingConfig.gtag.is_internal_traffic&&(this.trackingComponent=new yt(this.trackingConfig,this.trackingComponent))}createGAdsCommandDecorator(){!this.trackingConfig.gads.tracking_id||this.trackingConfig.gtag.is_internal_traffic||this.trackingConfig.ga4.server_container_url||(this.trackingComponent=new Pt(this.trackingConfig,this.trackingComponent))}}class wt{constructor(){this.trackingComponent=(new Et).trackingComponent}isAvailable(){return Boolean(Object.prototype.hasOwnProperty.call(window,"google_tag_manager"))}homePageView(){this.trackingComponent.homePageView()}categoryPageView(){this.trackingComponent.categoryPageView()}searchPageView(){this.trackingComponent.searchPageView()}productShare(t,e){this.trackingComponent.productShare(t,e)}customerSignUp(){this.trackingComponent.customerSignUp()}customerLogin(){this.trackingComponent.customerLogin()}productsList(t,e){this.trackingComponent.productsList(t,e)}productClick(t,e){this.trackingComponent.productClick(t,e)}productView(t){this.trackingComponent.productView(t)}addToCart(t,e){this.trackingComponent.addToCart(t,e)}removeFromCart(t,e){this.trackingComponent.removeFromCart(t,e)}cartView(t,e){this.trackingComponent.cartView(t,e)}checkoutProgress(t,e,i){this.trackingComponent.checkoutProgress(t,e,i)}
12checkoutOption(t,e,i,r,n){this.trackingComponent.checkoutOption(t,e,i,r,n)}orderComplete(t,e,i,r,n){this.trackingComponent.orderComplete(t,e,i,r,n)}promotionsList(t){this.trackingComponent.promotionsList(t)}promotionClick(t){this.trackingComponent.promotionClick(t)}}class St extends o{constructor(t){super(t),this.sessionStorage&&(this.gtag=new wt,this.context.setTrackingPlatform(this.gtag),this.eventManager=mt.getEventFactory(),this.init())}init(){this.initEvents()}initEvents(){this.eventManager&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",this.eventManager.initPageEvents.bind(this.eventManager),!1):this.eventManager.initPageEvents(),"complete"!==document.readyState?window.addEventListener("load",this.initTrackingDataEvents.bind(this),!1):this.initTrackingDataEvents())}initTrackingDataEvents(){const t=this.context.getTrackingData();t&&this.sessionStorage&&this.eventManager&&(this.sessionStorage.initTrackingData(t),this.eventManager.initDataEvents(t))}}document.addEventListener("DOMContentLoaded",(()=>{const t=document.getElementById("js-rcpga-app-data");if(null==t?void 0:t.textContent)try{const e=JSON.parse(t.textContent);window.RCPGAClient=new St(e)}catch(t){console.error("Error parsing server data:",t)}else console.error("RCPGA app data element not found.")}))})();

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.