PageSourceSearch

https://lesdelicesduverger.com/assets/v2467.0.0/storefront/upsell.48e124fc.js

js lesdelicesduverger.com collected 2026-10-08 16:25:16 UTC 26,920 bytes, 1 lines download raw bytes

1"use strict";var storefront;(self.webpackChunkstorefront=self.webpackChunkstorefront||[]).push([[988],{6211:(t,e,n)=>{n.d(e,{A:()=>o});var a=n(1083),i=n(3623),r=storefront.shared.globals;const o=function(){function t(){var t=this;this.apiUrl=storefront.shared.globals.shopInfo.checkoutUrl,this.userKey=storefront.shared.userKey,this.shopUUID=storefront.shared.globals.shopInfo.uuid,this.getUnavailableVariant=function(t){var e=[];return t.items.forEach((function(t){!t.availability.isAvailable&&t.availability.trackingEnabled&&e.push(t)})),e},this.removeUnavailableItems=function(e){var n=t.getUnavailableVariant(e),a=[];return new Promise((function(e,i){n.length?(n.forEach((function(e){e.availability.quantity>0?a.push(t.updateCartItem(e.variantId,e.itemId,e.availability.quantity)):a.push(t.removeItemFromCart(e.variantId,e.itemId))})),Promise.all(a).then((function(){e(!0)})).catch((function(){i(new Error("failed"))}))):i(new Error("failed"))}))},this.sendUpdateCartEvent=function(){document.dispatchEvent(new CustomEvent("updateCartEvent"))},this.sendUpdatedCartEvent=function(t){document.dispatchEvent(new CustomEvent("updatedCartEvent",{detail:t}))},this.sendViewCartEvent=function(t,e){var n=[];t.items.forEach((function(t){var e={item_id:t.itemId,item_name:t.productTitle,price:Number(t.priceGross/100).toFixed(2),quantity:t.quantity};n.push(e)}));var a={event:"view_cart",currency:storefront.shared.globals.shopInfo.currencyCode,value:Number(t.total/100).toFixed(2),cart_type:e,items:n};document.dispatchEvent(new CustomEvent("viewCartEvent",{detail:a}))},this.debounce=function(t,e){var n;return function(){for(var a,i=[],r=0;r<arguments.length;r++)i[r]=arguments[r];return n&&clearTimeout(n),n=setTimeout((function(){a=t.apply(void 0,i)}),e),a}},this.updateProductQuantity=function(t,e){var n=0;switch(t){case"plus":n=e+1;break;case"minus":n=e>1?e-1:1}return String(n)},this.getPriceWithCurrency=function(t){return"".concat((0,i.lI)({value:t,locale:r.shopInfo.locale,currency:r.shopInfo.currencyCode}))}}return t.getInstance=function(){return this.instance?this.instance:new this},t.prototype.getCart=function(){return void 0!==storefront.themePreview&&storefront.themePreview&&storefront.themePreview.cartMock?Promise.resolve({status:200,statusText:"OK",config:{},headers:{},data:storefront.themePreview.cartMock}):a.A.get("".concat(this.apiUrl,"/api/cart/").concat(this.shopUUID,"/").concat(this.userKey))},t.prototype.updateCartData=function(t){return a.A.put("".concat(this.apiUrl,"/api/cart/").concat(this.shopUUID,"/").concat(this.userKey),t)},t.prototype.updateCartItem=function(t,e,n){var i={quantity:n};return a.A.put("".concat(this.apiUrl,"/api/cart/").concat(this.shopUUID,"/").concat(this.userKey,"/").concat(e,"/").concat(t),i)},t.prototype.removeItemFromCart=function(t,e){return a.A.delete("".concat(this.apiUrl,"/api/cart/").concat(this.shopUUID,"/").concat(this.userKey,"/").concat(e,"/").concat(t))},t.prototype.addToCart=function(t,e,n){var i={quantity:n};return a.A.post("".concat(this.apiUrl,"/api/cart/").concat(this.shopUUID,"/").concat(this.userKey,"/").concat(e,"/").concat(t),i)},t}().getInstance()},3623:(t,e,n)=>{n.d(e,{lI:()=>o});var a=n(9517),i=n(9354);function r(t){var e=t.locale,n=t.currency,a=(0,i.v2)(e,n),r=2;return a&&(r=a.maximumFractionDigits),r}function o(t){var e=t.value,n=t.locale,i=t.currency,o=r({locale:n,currency:i});return Intl.NumberFormat(n,{style:"currency",currency:i,minimumFractionDigits:o}).format((0,a.A)({amount:e||0,precision:o}).toUnit())}},1960:(t,e,n)=>{n.d(e,{default:()=>P});var a=n(1083);const i=function(){function t(){this.apiUrl="".concat(storefront.shared.globals.shopInfo.domain,"/api"),this.sendAddToCartEvent=function(t,e,n,a){var i={event:"cross-sell-offer_added-to-cart",source:a,offer_id:t,trigger_item_id:e,item_id:n};document.dispatchEvent(new CustomEvent("crossSellOfferAddToCart",{detail:i}))},this.sendItemRedirectEvent=function(t,e,n){var a={event:"cross-sell-offer-item_redirected",offer_id:t,trigger_item_id:e,item_id:n};document.dispatchEvent(new CustomEvent("crossSellOfferItemRedirect",{detail:a}))},this.sendOfferOpenEvent=function(t,e){var n={event:"cross-sell-offer_opened",offer_id:t,trigger_item_id:e};document.dispatchEvent(new CustomEvent("crossSellOfferOpen",{detail:n}))}}return t.getInstance=function(){return this.instance?this.instance:new this},t.prototype.getCampaign=function(t){return a.A.get("".concat(this.apiUrl,"/item/").concat(t,"/suggested-items"))},t}().getInstance();var r=n(7846),o="upsellItemProperties",s="variantPrice",c="installmentPrice",l="basePrice",d="lowestPrice",u="discountBadge",p="product-actions",v="product-sold-out-label",h="list-product-price-discount",m="cross-sell-offer",f="cross-sell-offer-trigger-item",g=n(6211),C=n(2802),y=n.n(C),b=n(3623),I=storefront.shared.globals,E=function(t){return(0,b.lI)({value:t,locale:I.shopInfo.locale,currency:I.shopInfo.currencyCode})};const T=function(){function t(t){var e,n=this;
1if(this.productContainer=null,this.properties=null,this.variantPrice=null,this.installmentPrice=null,this.basePrice=null,this.lowestPrice=null,this.discountBadge=null,this.soldOutLabel=null,this.productActionsWrapper=null,this.variantIdInput=null,this.addToCartButton=null,this.itemPhoto=null,this.variantsData=null,this.variantsMapData=null,this.hasMultivariants=!1,this.productIsSoldOut="",this.isTrackingEnabled="",this.currentVariant=void 0,this.selectedVariantUUID="",this.assignSelectors=function(){var t,e,a,i,r,h,m,f,g,C,y,b;n.properties=null===(t=n.productContainer)||void 0===t?void 0:t.getElementsByClassName(o),n.variantPrice=null===(e=n.productContainer)||void 0===e?void 0:e.getElementsByClassName(s)[0],n.installmentPrice=null===(a=n.productContainer)||void 0===a?void 0:a.querySelector(c),n.basePrice=null===(i=n.productContainer)||void 0===i?void 0:i.getElementsByClassName(l)[0],n.lowestPrice=null===(r=n.productContainer)||void 0===r?void 0:r.getElementsByClassName(d)[0],n.discountBadge=null===(h=n.productContainer)||void 0===h?void 0:h.getElementsByClassName(u)[0],n.soldOutLabel=null===(m=n.productContainer)||void 0===m?void 0:m.getElementsByClassName(v)[0],n.productActionsWrapper=null===(f=n.productContainer)||void 0===f?void 0:f.getElementsByClassName(p)[0],n.variantIdInput=null===(g=n.productContainer)||void 0===g?void 0:g.getElementsByTagName("input")[0],n.addToCartButton=null===(C=n.productContainer)||void 0===C?void 0:C.getElementsByClassName("add-to-cart-button")[0],(null===(y=n.productContainer)||void 0===y?void 0:y.getElementsByTagName("img").length)&&(n.itemPhoto=null===(b=n.productContainer)||void 0===b?void 0:b.getElementsByTagName("img")[0])},this.bindUiActions=function(){var t;n.propertiesSelectChangeListener(),null===(t=n.addToCartButton)||void 0===t||t.addEventListener("click",(function(t){t.preventDefault(),n.handleAddToCart()}))},this.selectVariantByUUID=function(t){var e=!!n.variantsData&&n.variantsData.filter((function(e){return e.uuid===t})).length>0;n.properties&&e&&n.hasMultivariants&&n.selectMultiPropertyVariant(t)},this.selectMultiPropertyVariant=function(t){if(n.properties){var e=n.getVariantData(t);e&&Array.from(n.properties).forEach((function(t,a){var i,r=t,o=t.getAttribute("data-property"),s=null===(i=e.options)||void 0===i?void 0:i.find((function(t){return t.name===o}));if(s&&(r.value=s.value,n.properties&&a===n.properties.length-1)){var c=new Event("change",{bubbles:!0});setTimeout((function(){r.dispatchEvent(c)}))}}))}},this.selectSinglePropertyVariant=function(t){if(n.properties&&0!==n.properties.length){var e=n.properties[0];e.value=t;var a=new Event("change",{bubbles:!0});setTimeout((function(){e.dispatchEvent(a)}
1))}else{var i=n.getVariantData(t);i&&n.setSelectedVariant(i)}},this.propertiesSelectChangeListener=function(){n.properties&&Array.from(n.properties).forEach((function(t){t.addEventListener("change",(function(t){return n.hasMultivariants?n.handlePropertyChange():n.handleVariantChange(t)}))}))},this.setFirstAvailableVariant=function(){var t,e=null===(t=n.variantsData)||void 0===t?void 0:t.find((function(t){return!0===t.isAvailable}));e&&n.properties&&(n.hasMultivariants?n.selectMultiPropertyVariant(e.uuid):n.selectSinglePropertyVariant(e.uuid))},this.getVariantData=function(t){return n.variantsData?n.variantsData.find((function(e){return e.uuid===t})):null},this.getSelectedPropertiesValues=function(){var t=[];return n.properties&&Array.from(n.properties).forEach((function(e){var n=e;t.push(n.value)})),t.join("")},this.setProductSoldOut=function(){n.blockUI()},this.setVariantSoldOut=function(t){var e,a;t?n.blockUI():(null===(e=n.addToCartButton)||void 0===e||e.removeAttribute("disabled"),null===(a=n.soldOutLabel)||void 0===a||a.classList.add("invisible"))},this.blockUI=function(){var t,e,a;null===(t=n.addToCartButton)||void 0===t||t.setAttribute("disabled","true"),null===(e=n.soldOutLabel)||void 0===e||e.classList.remove("invisible"),null===(a=n.productActionsWrapper)||void 0===a||a.classList.remove("invalid")},this.handleAddToCart=function(){n.changeAddToCartState("loading");n.isTrackingEnabled?g.A.getCart().then((function(t){var e=t.data;n.isVarianInCart(e).then((function(t){var e=t.remainingQuantity;e-Number(1)<0?(document.dispatchEvent(new CustomEvent("showNotification",{detail:{type:"error",message:"".concat(Translator.trans("errors.product.insufficient_quantity",{quantity:e}))}})),n.changeAddToCartState("pristine")):n.addItemToCart(Number(1))})).catch((function(){n.addItemToCart(Number(1))}))})):n.addItemToCart(Number(1))},this.addItemToCart=function(t,e){var a,i;void 0===e&&(e=!1);var r=null===(a=n.variantIdInput)||void 0===a?void 0:a.value,o=null===(i=n.variantIdInput)||void 0===i?void 0:i.getAttribute("data-product-uuid");r&&g.A.addToCart(r,o,Number(t)).then((function(){var a;if(n.changeAddToCartState("pristine"),n.createAnalyticsEvent(),e)null===(a=n.addToCartButton)||void 0===a||a.removeAttribute("disabled");else{var i=new CustomEvent("updateCartEvent"),r=new CustomEvent("highlightCartButtonQuantity",{detail:{newItemQuantity:t}});document.dispatchEvent(i),document.dispatchEvent(new CustomEvent("showNotification",{detail:{type:"success",message:Translator.trans("cart_widget.added_to_cart")}})),document.dispatchEvent(r)}})).catch((function(t){var e,a,i,r,o;return n.changeAddToCartState("pristine"),500===(null===(e=t.response)||void 0===e?void 0:e.status)?(document.dispatchEvent(new CustomEvent("showNotification",{detail:{type:"error",message:Translator.trans("errors.product.insufficient_quantity")}})),!1):!!(422===(null===(a=t.response)||void 0===a?void 0:a.status)&&t.response.data&&(null===(i=t.response.data)||void 0===i?void 0:i.errors.length)>0)&&void((null===(o=null===(r=t.response)||void 0===r?void 0:r.data)||void 0===o?void 0:o.errors.findIndex((function(t){return"Cart item max quantity reached"===t.message})))>-1&&document.dispatchEvent(new CustomEvent("showNotification",{detail:{type:"error",message:Translator.trans("errors.product.item_reached_limit_one_order")}})))}))},this.isVarianInCart=function(t){return new Promise((function(e,a){var i=t.items.filter((function(t){var e;return t.variantId===(null===(e=n.variantIdInput)||void 0===e?void 0:e.value)}));i[0]?e({remainingQuantity:i[0].availability.quantity-i[0].quantity}):a()}))},this.createAnalyticsEvent=function(){var t,e,a,i,r={item_id:null===(t=n.variantIdInput)||void 0===t?void 0:t.value,item_name:null===(e=n.variantIdInput)||void 0===e?void 0:e.getAttribute("data-title"),price:Number(null===(a=n.currentVariant)||void 0===a?void 0:a.price).toFixed(2),quantity:1,currency:null===(i=n.variantIdInput)||void 0===i?void 0:i.getAttribute("data-currency")},o=new CustomEvent("itemAddedToCartEvent",{detail:r}),s=new CustomEvent("crossSellItemAddedToCartEvent",{detail:r});document.dispatchEvent(o),document.dispatchEvent(s)},this.changeAddToCartState=function(t){var e,a,i,r;switch(t){case"loading":null===(e=n.addToCartButton)||void 0===e||e.setAttribute("disabled","true"),null===(a=n.addToCartButton)||void 0===a||a.classList.add("loading"),n.addToCartButton&&(n.addToCartButton.textContent=Translator.trans("product.adding"));break;case"pristine":null===(i=n.addToCartButton)||void 0===i||i.removeAttribute("disabled"),null===(r=n.addToCartButton)||void 0===r||r.classList.remove("loading"),n.addToCartButton&&(n.addToCartButton.textContent=Translator.trans("product.add_to_cart"))}},this.getCurrentProperty=function(t){var e,a=null===(e=n.variantsData)||void 0===e?void 0:e.filter((function(e){return e.uuid===t}));return a?a[0]:void 0},this.setUUID=function(t){var e;null===(e=n.variantIdInput)||void 0===e||(e.value=t)},this.setNewPrice=function(t,e,a,i){var r,o,s;null===(r=n.variantPrice)||void 0===r||(r.innerHTML=t),n.installmentPrice&&(n.installmentPrice.getElementsByTagName("span")[0].innerHTML=e),n.basePrice&&(n.basePrice.innerHTML=a,i?(null===(o=n.variantPrice)||void 0===o||o.classList.add(h),n.basePrice.classList.remove("hidden")):(null===(s=n.variantPrice)||void 0===s||s.classList.remove(h),n.basePrice.classList.add("hidden"))),n.discountBadge&&(i?n.discountBadge.classList.remove("hidden"):n.discountBadge.classList.add("hidden")),n.lowestPrice&&n.lowestPrice.classList.add("invisible")},this.selectImageInGallery=function(t){n.itemPhoto&&(t.thumbnails&&t.thumbnails.th640?n.itemPhoto.src=t.thumbnails.th640:n.itemPhoto.src=n.itemPhoto.dataset.defaultImg)}
1,this.productContainer=document.getElementById(t),this.assignSelectors(),this.productContainer&&(this.variantsData=this.productContainer.dataset.variants?JSON.parse(this.productContainer.dataset.variants):null,this.variantsMapData=JSON.parse(this.productContainer.dataset.variantsMap),this.hasMultivariants=JSON.parse(this.productContainer.dataset.hasMultivariants),this.productIsSoldOut=this.productContainer.dataset.soldOut,this.isTrackingEnabled=this.productContainer.dataset.tracking),1===(null===(e=this.variantsData)||void 0===e?void 0:e.length)){var a=this.variantsData[0],i=a.uuid,r=a.price,m=a.installmentsPrice,f=a.basePrice,C=a.hasDiscount;this.currentVariant=this.getCurrentProperty(i),this.setNewPrice(E(r),E(m),E(f),C)}this.selectedVariantUUID?(this.bindUiActions(),this.selectVariantByUUID(this.selectedVariantUUID)):"true"===this.productIsSoldOut?(this.setProductSoldOut(),this.propertiesSelectChangeListener()):(this.setFirstAvailableVariant(),this.bindUiActions())}return t.prototype.handlePropertyChange=function(){var t=this.getSelectedPropertiesValues(),e=y()("sha1").update(t).digest("hex"),n=this.variantsMapData[e],a=this.getVariantData(n);a?this.setSelectedVariant(a):this.setVariantSoldOut(!0)},t.prototype.setSelectedVariant=function(t){this.setUUID(t.uuid),this.currentVariant=this.getCurrentProperty(t.uuid),this.setNewPrice(E(t.price),E(t.installmentsPrice),E(t.basePrice),t.hasDiscount),this.selectImageInGallery(t),t.isAvailable?this.setVariantSoldOut(!1):this.setVariantSoldOut(!0)},t.prototype.handleVariantChange=function(t){var e=t.target,n=this.getCurrentProperty(e.value);n&&(this.currentVariant=n,this.setUUID(e.value),this.setNewPrice(E(n.price),E(n.installmentsPrice),E(n.basePrice),n.hasDiscount),this.selectImageInGallery(this.currentVariant),n.isAvailable?this.setVariantSoldOut(!1):this.setVariantSoldOut(!0))},t}();const P=function(){function t(){this.itemPlaceholderImage=storefront.shared.globalVariables.imagesUrl.placeholderItem,this.upsellModal=document.getElementById("upsell"),this.redirectToCheckoutState=!1,this.activeCrossSellOfferId="",this.activeCrossSellTriggerItemId="",this.queryString=window.location.search,this.crossSellOfferUrlParamId="",this.init()}return t.getInstance=function(){return t.instance||(t.instance=new t),t.instance},t.prototype.init=function(){if(this.queryString&&this.queryString.indexOf(m)&&this.queryString.indexOf(f)){var t=new URLSearchParams(this.queryString),e=t.get(m),n=t.get(f);this.crossSellOfferUrlParamId=e||"",this.activeCrossSellTriggerItemId=n||""}this.initListeners()},t.prototype.generateItemsList=function(t){for(var e=t.length,n=Object.assign(document.createElement("ul"),{className:"upsell-items-list splide__list"}),a=0;a<e;a++)n.appendChild(this.createItemElement(t[a],e>1,1===e));return n},t.prototype.createItemElement=function(t,e,n){var a=Object.assign(document.createElement("li"),{className:"upsell-item-wrapper".concat(e?" splide__slide":"")}),i="".concat(t.url,"?").concat(m,"=").concat(this.activeCrossSellOfferId,"&").concat(f,"=").concat(this.activeCrossSellTriggerItemId);return a.innerHTML='<div id="itemListProduct-'.concat(t.id,'" class="list-product upsell-list-product" data-selector="list-product-view" data-variants=\'').concat(JSON.stringify(t.variants).replaceAll(/\\"/g,"\\&quot;").replaceAll(/'/g,"&#39;"),"' data-variants-map='").concat(JSON.stringify(t.variantMap).replaceAll(/\\"/g,"\\&quot;"),"'\n     data-has-multivariants=\"").concat(Object.keys(t.optionsList).length>1?1:0,'" \n     ').concat(t.isAvailable?"":'data-sold-out="false"'," ").concat(t.isTrackingEnabled?'data-tracking="true"':"",'\n    >
1\n      <span class="list-product-discount discountBadge hidden">%</span>\n      <a href="').concat(i,'" title="').concat(t.name.replaceAll(/"/g,"&quot;"),'">\n        <div class="list-product-image">\n          <div class="img-wrapper ').concat("string"==typeof t.thumbnails.th640?"img-wrapper-placeholder":"",'">\n            <img data-default-img="').concat("string"==typeof t.thumbnails.th640?t.thumbnails.th640:this.itemPlaceholderImage,'" src="').concat("string"==typeof t.thumbnails.th640?t.thumbnails.th640:this.itemPlaceholderImage,'" data-selector="os-theme-product-list-image" alt="').concat(t.image?t.name:"product_list_image_cover",'" />\n          </div>\n        </div>\n      </a>\n    <div class="list-product-info">\n      <a href="').concat(i,'" title="').concat(t.name.replaceAll(/"/g,"&quot;"),'">\n        <h3 class="').concat(n?"headline-5":"body-2-bold",'" data-selector="os-theme-product-list-name">\n          ').concat(t.name,'\n        </h3>\n      </a>\n       <div class="product-actions">\n         <input type="hidden" name="id" value="').concat(t.variants[0].uuid,'" data-product-uuid="').concat(t.id,'" data-title="').concat(t.name.replaceAll(/"/g,"&quot;"),'" data-currency="').concat(storefront.shared.globalVariables.shopInfo.currencyCode,'"/>\n          <div class="list-product-price-wrapper">\n              <span class="product-sold-out-label ').concat(t.isAvailable?"invisible":"",'">').concat(Translator.trans("product.sold_out"),'</span>\n\n          <div class="list-product-price">\n          <span class="list-product-price-regular ').concat("body-1-bold"," variantPrice ").concat(t.hasDiscount&&h,'" data-selector="os-theme-product-list-price-regular">').concat(g.A.getPriceWithCurrency(t.price),'</span>\n             <span class="list-product-base-price ').concat("body-1-regular"," basePrice ").concat(t.hasDiscount?"":"hidden",'" data-selector="os-theme-product-list-base-price">\n                  ').concat(g.A.getPriceWithCurrency(t.basePrice),"</span>\n          </div>\n          </div>\n            ").concat(this.generateVariantsSelect(t),'\n            <button type="button" class="btn btn-1 btn-small add-to-cart-button">\n              ').concat(Translator.trans("product.add_to_cart"),'\n            </button>\n          </div>\n          <span class="quantity-validation-message"></span>\n      \n    </div>\n  </div>'),a},t.prototype.generateVariantsSelect=function(t){if(Object.keys(t.optionsList).length<2){var e="",n=function(n){var a=n.toLowerCase().trim(),i="";
1t.variants.forEach((function(e,n){var a=e.name?e.name:"".concat(t.name," - ").concat(n);i+='<option data-selector="os-theme-product-variant-'.concat(n,'-value"\n                data-price="').concat(e.price,'"\n                data-price-without-currency="').concat(e.price,'"\n                data-uuid="').concat(e.uuid,'"\n                class="property" \n                value="').concat(e.uuid,'">\n            ').concat(a,"\n        </option>")})),e+='<div id="variantsWrapper" class="variants-wrapper single-property-wrapper">\n             <label data-selector="os-theme-product-variants-label"\n               for="'.concat(a,'-variant-element"\n               class="label">\n               ').concat(n,'\n             </label>\n             <div class="variants select-wrapper">\n               <select name="').concat(t.id,'-variant" product-properties class="').concat(o,'">\n                ').concat(i,"\n               </select>\n             </div>\n           </div>")};for(var a in t.optionsList)n(a);return e}e="";for(var a in t.optionsList){for(var i=a.toLowerCase().trim(),r="",s=0,c=t.optionsList[a];s<c.length;s++){var l=c[s],d=l.replaceAll(/"/g,"&quot;").replaceAll(/'/g,"&#39;");r+='<option data-selector="os-theme-product-option-'.concat(d,'-value" class="property" value="').concat(d,'">\n            ').concat(l,"\n          </option>")}e+='<div class="variants-wrapper">\n             <label data-selector="os-theme-product-variants-label"\n               for="'.concat(i,'-variant-element"\n               class="label">\n               ').concat(a,'\n             </label>\n             <div class="variants select-wrapper">\n               <select id="').concat(i,'-variant-element" data-selector="os-theme-option-').concat(i,'"\n                 name="').concat(i,'-option"\n                 data-property="').concat(a,'"\n                 class="').concat(o,'">\n                  ').concat(r,"\n               </select>\n             </div>\n           </div>")}return e},t.prototype.removeSoldOutItems=function(t){return t.filter((function(t){return t.isAvailable}))},t.prototype.getItemCampaign=function(t){var e=this;i.getCampaign(t).then((function(n){if(""!==n.data.uuid&&n.data.suggestions.length){var a=e.removeSoldOutItems(n.data.suggestions);a.length?(e.activeCrossSellOfferId=n.data.uuid,e.activeCrossSellTriggerItemId=t,e.displayModal(a)):e.redirectToCheckoutState&&e.redirectToCheckout()}else e.redirectToCheckoutState&&e.redirectToCheckout()})).catch((function(){e.redirectToCheckoutState&&e.redirectToCheckout()}))},t.prototype.itemsPrePageDesktop=function(t){return t<=3?t:3},t.prototype.createCarousel=function(){return'<div class="upsell-splide splide">\n      <div id="upsell-carousel-content" class="splide__track"></div>\n      <div class="splide__arrows">\n          <button class="splide__arrow splide__arrow--prev banner-arrow banner-arrow-prev"\n                  data-selector="os-theme-gallery-arrow-prev">\n              <i class="icon icon-chevron-left"></i>\n          </button>\n          <button class="splide__arrow splide__arrow--next banner-arrow banner-arrow-next"\n                  data-selector="os-theme-gallery-arrow-next">\n              <i class="icon icon-chevron-right"></i>\n          </button>\n      </div>\n  </div>'},t.prototype.displayModal=function(t){var e,n,a=t.length,o=this.generateItemsList(t),s='<div id="upsell" class="jw-modal">\n    <div class="jw-modal-background"></div>\n    <div class="jw-modal-container">\n        <div class="jw-modal-body">\n            <button id="upsellClose" type="button" class="modal-close"><i class="icon icon-close"></i></button>\n            <h5 class="headline-5 headline-4-md upsell-title">'.concat(Translator.trans("cross_sell.title"),'</h5>\n            <div class="upsell-items">').concat(this.createCarousel(),"</div>\n        </div>\n    </div>\n</div>\n");document.body.insertAdjacentHTML("beforeend",s),null===(e=document.getElementById("upsell-carousel-content"))||void 0===e||e.appendChild(o),null===(n=document.getElementById("upsell-carousel-content"))||void 0===n||n.classList.add("upsell-items-list-".concat(a<4?a:4)),document.querySelectorAll(".upsell-list-product").forEach((function(t){var e=t.getAttribute("id");e&&new T(e)})),this.openModal("upsell"),i.sendOfferOpenEvent(this.activeCrossSellOfferId,this.activeCrossSellTriggerItemId),new r.Ay(".upsell-splide",{pagination:!1,perPage:this.itemsPrePageDesktop(a),drag:a>1,gap:"24px",autoHeight:!0,breakpoints:{480:{perPage:1,gap:"0"},768:{perPage:1},959:{perPage:2},1247:{perPage:a>3?3:2}}}).mount()},t.prototype.openModal=function(t){var e=document.getElementById(t);null==e||e.classList.add("open"),document.body.classList.add("jw-modal-open"),setTimeout((function(){var t=null==e?void 0:e.querySelector('a[href], button, input, textarea, select, [tabindex]:not
1([tabindex="-1"])');t?t.focus():(null==e||e.setAttribute("tabindex","-1"),null==e||e.focus())}),100)},t.prototype.closeModal=function(){var t;this.redirectToCheckoutState&&this.redirectToCheckout(),"side_cart"===storefront.shared.globalVariables.settings.cartType&&document.dispatchEvent(new CustomEvent("openCart")),null===(t=document.querySelector("#upsell.open"))||void 0===t||t.classList.remove("open"),document.body.classList.remove("jw-modal-open"),setTimeout((function(){var t;null===(t=document.getElementById("upsell"))||void 0===t||t.remove()}),500),this.redirectToCheckoutState=!1},t.prototype.initListeners=function(){var t,e=this;if(document.addEventListener("itemAddedToCart",(function(t){var n;(null===(n=e.upsellModal)||void 0===n?void 0:n.classList.contains("open"))||(e.redirectToCheckoutState=t.detail.redirectToCheckout,e.getItemCampaign(t.detail.productId))})),document.addEventListener("closeUpsellModal",(function(){e.closeModal()})),document.addEventListener("openCart",(function(){var t=document.querySelector("#osCartBtn a, #osCartBtn button");t&&t.click()})),document.addEventListener("redirectToCheckout",(function(){e.redirectToCheckout()})),document.addEventListener("crossSellItemAddedToCartEvent",(function(t){e.activeCrossSellOfferId&&t.detail.item_id&&i.sendAddToCartEvent(e.activeCrossSellOfferId,e.activeCrossSellTriggerItemId,t.detail.item_id,"modal")})),document.addEventListener("click",(function(t){var n=t.target;((null==n?void 0:n.classList.contains("jw-modal-container"))&&n.closest("#upsell")||"upsellClose"===(null==n?void 0:n.id)||n.closest("#upsellClose"))&&e.closeModal()})),this.crossSellOfferUrlParamId&&this.activeCrossSellTriggerItemId){document.addEventListener("itemAddedToCartEvent",(function(t){t.detail.item_id&&i.sendAddToCartEvent(e.crossSellOfferUrlParamId,e.activeCrossSellTriggerItemId,t.detail.item_id,"pdp")}));var n=null===(t=document.getElementById("productContainer"))||void 0===t?void 0:t.dataset.itemId;n&&document.addEventListener("analyticsIsLoaded",(function(){i.sendItemRedirectEvent(e.crossSellOfferUrlParamId,e.activeCrossSellTriggerItemId,n);var t=new URLSearchParams(e.queryString);t.delete(m),t.delete(f),window.history.propertyIsEnumerable(null,"","?".concat(t.toString()))}))}},t.prototype.redirectToCheckout=function(){void 0!==storefront.shared&&storefront.shared.goToCheckout()},t}().getInstance()}},t=>{t.O(0,[502],(()=>{return e=1960,t(t.s=e);var e}));var e=t.O();(storefront=void 0===storefront?{}:storefront).upsell=e.default}]);

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.