1import{f as Oe,S as Be,a as Ue}from"./hoisted.CIevLTVD.js";import{E as Fe}from"./embla-carousel.esm.CMPFBS9o.js";import{f as pe}from"./currency.bCqyxxyW.js";import{d as He,a as $e}from"./customerApi.D3VKpn5k.js";import"./product-image.h_NVNI2L.js";import"./image-path.DZr9LMbE.js";var We=.93,ge=document.getElementById("emblaScale");if(ge){let t=function(){Se=H.slideNodes().map(function(n){return n.querySelector(".embla-scale__inner")})},r=function(){var n=H.selectedScrollSnap(),d=H.slideNodes();Se.forEach(function(u,s){if(u){var l=s===n;u.style.transform=l?"scale(1)":"scale("+We+")",l?d[s].classList.add("is-active"):d[s].classList.remove("is-active")}})},a=function(){var n=H.selectedScrollSnap();window.dispatchEvent(new CustomEvent("embla-vw-select",{detail:{index:n}}))};var H=Fe(ge,{loop:!0,align:"center"}),Se=[];t(),r(),H.on("reInit",function(){t(),r()}),H.on("select",r),H.on("select",a),function(){var n=document.querySelector(".vw-section");if(n&&"IntersectionObserver"in window){var d=new IntersectionObserver(function(u){u.forEach(function(s){s.isIntersecting&&(a(),d.disconnect())})},{rootMargin:"300px"});d.observe(n)}else a()}();var Ee=document.getElementById("emblaScalePrev"),Le=document.getElementById("emblaScaleNext");Ee&&Ee.addEventListener("click",function(){H.scrollPrev()}),Le&&Le.addEventListener("click",function(){H.scrollNext()})}const ze=t=>{window.__cocunatClubMembership=t&&t.club===!0,document.dispatchEvent(new CustomEvent("cocunat:club-membership",{detail:{club:window.__cocunatClubMembership}}))},Ne=()=>{Oe().then(ze).catch(()=>{})};Ne();document.addEventListener("cocunat:identity-changed",Ne);(()=>{var t={792:(n,d,u)=>{u.d(d,{Z:()=>b});var s=u(609),l=u.n(s)()(function(C){return C[1]});l.push([n.id,':host{--divider-width: 1px;--divider-color: #fff;--divider-shadow: none;--default-handle-width: 50px;--default-handle-color: #fff;--default-handle-opacity: 1;--default-handle-shadow: none;--handle-position-start: 50%;position:relative;display:inline-block;overflow:hidden;line-height:0;direction:ltr}@media screen and (-webkit-min-device-pixel-ratio: 0)and (min-resolution: 0.001dpcm){:host{outline-offset:1px}}:host(:focus){outline:2px solid -webkit-focus-ring-color}::slotted(*){-webkit-user-drag:none;-khtml-user-drag:none;-moz-user-drag:none;-o-user-drag:none;user-drag:none;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.first{position:absolute;left:0;top:0;right:0;line-height:normal;font-size:100%;max-height:100%;height:100%;width:100%;--exposure: 50%;--keyboard-transition-time: 0ms;--default-transition-time: 0ms;--transition-time: var(--default-transition-time)}.first .first-overlay-container{position:relative;clip-path:inset(0 var(--exposure) 0 0);transition:clip-path var(--transition-time);height:100%}.first .first-overlay{overflow:hidden;height:100%}.first.focused{will-change:clip-path}.first.focused .first-overlay-container{will-change:clip-path}.second{position:relative}.handle-container{transform:translateX(50%);position:absolute;top:0;right:var(--exposure);height:100%;transition:right var(--transition-time),bottom var(--transition-time)}.focused .handle-container{will-change:right}.divider{position:absolute;height:100%;width:100%;left:0;top:0;display:flex;align-items:center;justify-content:center;flex-direction:column}.divider:after{content:" ";display:block;height:100%;border-left-width:var(--divider-width);border-left-style:solid;border-left-color:var(--divider-color);box-shadow:var(--divider-shadow)}.handle{position:absolute;top:var(--handle-position-start);pointer-events:none;box-sizing:border-box;margin-left:1px;transform:translate(calc(-50% - 0.5px), -50%);line-height:0}.default-handle{width:var(--default-handle-width);opacity:var(--default-handle-opacity);transition:all 1s;filter:drop-shadow(var(--default-handle-shadow))}.default-handle path{stroke:var(--default-handle-color)}.vertical .first-overlay-container{clip-path:inset(0 0 var(--exposure) 0)}.vertical .handle-container{transform:translateY(50%);height:auto;top:unset;bottom:var(--exposure);width:100%;left:0;flex-direction:row}.vertical .divider:after{height:1px;width:100%;
1border-top-width:var(--divider-width);border-top-style:solid;border-top-color:var(--divider-color);border-left:0}.vertical .handle{top:auto;left:var(--handle-position-start);transform:translate(calc(-50% - 0.5px), -50%) rotate(90deg)}',""]);const b=l},609:n=>{n.exports=function(d){var u=[];return u.toString=function(){return this.map(function(s){var l=d(s);return s[2]?"@media ".concat(s[2]," {").concat(l,"}"):l}).join("")},u.i=function(s,l,b){typeof s=="string"&&(s=[[null,s,""]]);var C={};if(b)for(var y=0;y<this.length;y++){var S=this[y][0];S!=null&&(C[S]=!0)}for(var o=0;o<s.length;o++){var h=[].concat(s[o]);b&&C[h[0]]||(l&&(h[2]?h[2]="".concat(l," and ").concat(h[2]):h[2]=l),u.push(h))}},u}}},r={};function a(n){var d=r[n];if(d!==void 0)return d.exports;var u=r[n]={id:n,exports:{}};return t[n](u,u.exports,a),u.exports}a.n=n=>{var d=n&&n.__esModule?()=>n.default:()=>n;return a.d(d,{a:d}),d},a.d=(n,d)=>{for(var u in d)a.o(d,u)&&!a.o(n,u)&&Object.defineProperty(n,u,{enumerable:!0,get:d[u]})},a.o=(n,d)=>Object.prototype.hasOwnProperty.call(n,d),(()=>{var n=a(792);const d="rendered",u=(o,h)=>{const c=o.getBoundingClientRect();let f,L;return h.type==="mousedown"?(f=h.clientX,L=h.clientY):(f=h.touches[0].clientX,L=h.touches[0].clientY),f>=c.x&&f<=c.x+c.width&&L>=c.y&&L<=c.y+c.height};let s;const l={ArrowLeft:-1,ArrowRight:1},b=["horizontal","vertical"],C=o=>({x:o.touches[0].pageX,y:o.touches[0].pageY}),y=o=>({x:o.pageX,y:o.pageY}),S=typeof window<"u"&&window?.HTMLElement;typeof window<"u"&&(window.document&&(s=document.createElement("template"),s.innerHTML='<div class="second" id="second"> <slot name="second"><slot name="before"></slot></slot> </div> <div class="first" id="first"> <div class="first-overlay"> <div class="first-overlay-container" id="firstImageContainer"> <slot name="first"><slot name="after"></slot></slot> </div> </div> <div class="handle-container"> <div class="divider"></div> <div class="handle" id="handle"> <slot name="handle"> <svg xmlns="http://www.w3.org/2000/svg" class="default-handle" viewBox="-8 -3 16 6"> <path d="M -5 -2 L -7 0 L -5 2 M 5 -2 L 7 0 L 5 2" fill="none" vector-effect="non-scaling-stroke"/> </svg> </slot> </div> </div> </div> '),window.customElements.define("img-comparison-slider",class extends S{constructor(){super(),this.exposure=this.hasAttribute("value")?parseFloat(this.getAttribute("value")):50,this.slideOnHover=!1,this.slideDirection="horizontal",this.keyboard="enabled",this.isMouseDown=!1,this.animationDirection=0,this.isFocused=!1,this.dragByHandle=!1,this.onMouseMove=c=>{if(this.isMouseDown||this.slideOnHover){const f=y(c);this.slideToPage(f)}},this.bodyUserSelectStyle="",this.bodyWebkitUserSelectStyle="",this.onMouseDown=c=>{if(this.slideOnHover||this.handle&&!u(this.handleElement,c))return;c.preventDefault(),window.addEventListener("mousemove",this.onMouseMove),window.addEventListener("mouseup",this.onWindowMouseUp),this.isMouseDown=!0,this.enableTransition();const f=y(c);this.slideToPage(f),this.focus(),this.bodyUserSelectStyle=window.document.body.style.userSelect,this.bodyWebkitUserSelectStyle=window.document.body.style.webkitUserSelect,window.document.body.style.userSelect="none",window.document.body.style.webkitUserSelect="none"},this.onWindowMouseUp=()=>{this.isMouseDown=!1,window.document.body.style.userSelect=this.bodyUserSelectStyle,window.document.body.style.webkitUserSelect=this.bodyWebkitUserSelectStyle,window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("mouseup",this.onWindowMouseUp)},this.touchStartPoint=null,this.isTouchComparing=!1,this.hasTouchMoved=!1,this.onTouchStart=c=>{this.dragByHandle&&!u(this.handleElement,c)||(this.touchStartPoint=C(c),this.isFocused&&(this.enableTransition(),this.slideToPage(this.touchStartPoint)))},this.onTouchMove=c=>{if(this.touchStartPoint===null)return;const f=C(c);if(this.isTouchComparing)return this.slideToPage(f),c.preventDefault(),!1;if(!this.hasTouchMoved){const L=Math.abs(f.y-this.touchStartPoint.y),m=Math.abs(f.x-this.touchStartPoint.x);if(this.slideDirection==="horizontal"&&L<m||this.slideDirection==="vertical"&&L>m)return this.isTouchComparing=!0,this.focus(),this.slideToPage(f),c.preventDefault(),!1;this.hasTouchMoved=!0}
1},this.onTouchEnd=()=>{this.isTouchComparing=!1,this.hasTouchMoved=!1,this.touchStartPoint=null},this.onBlur=()=>{this.stopSlideAnimation(),this.isFocused=!1,this.firstElement.classList.remove("focused")},this.onFocus=()=>{this.isFocused=!0,this.firstElement.classList.add("focused")},this.onKeyDown=c=>{if(this.keyboard==="disabled")return;const f=l[c.key];this.animationDirection!==f&&f!==void 0&&(this.animationDirection=f,this.startSlideAnimation())},this.onKeyUp=c=>{if(this.keyboard==="disabled")return;const f=l[c.key];f!==void 0&&this.animationDirection===f&&this.stopSlideAnimation()},this.resetDimensions=()=>{this.imageWidth=this.offsetWidth,this.imageHeight=this.offsetHeight};const o=this.attachShadow({mode:"open"}),h=new CSSStyleSheet;h.replaceSync(n.Z),o.adoptedStyleSheets=[h],o.appendChild(s.content.cloneNode(!0)),this.firstElement=o.getElementById("first"),this.handleElement=o.getElementById("handle")}set handle(o){this.dragByHandle=o.toString().toLowerCase()!=="false"}get handle(){return this.dragByHandle}get value(){return this.exposure}set value(o){const h=parseFloat(o);h!==this.exposure&&(this.exposure=h,this.enableTransition(),this.setExposure())}get hover(){return this.slideOnHover}set hover(o){this.slideOnHover=o.toString().toLowerCase()!=="false",this.removeEventListener("mousemove",this.onMouseMove),this.slideOnHover&&this.addEventListener("mousemove",this.onMouseMove)}get direction(){return this.slideDirection}set direction(o){this.slideDirection=o.toString().toLowerCase(),this.slide(0),this.firstElement.classList.remove(...b),b.includes(this.slideDirection)&&this.firstElement.classList.add(this.slideDirection)}static get observedAttributes(){return["hover","direction"]}connectedCallback(){this.hasAttribute("tabindex")||(this.tabIndex=0),this.addEventListener("dragstart",o=>(o.preventDefault(),!1)),new ResizeObserver(this.resetDimensions).observe(this),this.setExposure(0),this.keyboard=this.hasAttribute("keyboard")&&this.getAttribute("keyboard")==="disabled"?"disabled":"enabled",this.addEventListener("keydown",this.onKeyDown),this.addEventListener("keyup",this.onKeyUp),this.addEventListener("focus",this.onFocus),this.addEventListener("blur",this.onBlur),this.addEventListener("touchstart",this.onTouchStart,{passive:!0}),this.addEventListener("touchmove",this.onTouchMove,{passive:!1}),this.addEventListener("touchend",this.onTouchEnd),this.addEventListener("mousedown",this.onMouseDown),this.handle=this.hasAttribute("handle")?this.getAttribute("handle"):this.dragByHandle,this.hover=this.hasAttribute("hover")?this.getAttribute("hover"):this.slideOnHover,this.direction=this.hasAttribute("direction")?this.getAttribute("direction"):this.slideDirection,this.resetDimensions(),this.classList.contains(d)||this.classList.add(d)}disconnectedCallback(){this.transitionTimer&&window.clearTimeout(this.transitionTimer)}attributeChangedCallback(o,h,c){o==="hover"&&(this.hover=c),o==="direction"&&(this.direction=c),o==="keyboard"&&(this.keyboard=c==="disabled"?"disabled":"enabled")}setExposure(o=0){var h;this.exposure=(h=this.exposure+o)<0?0:h>100?100:h,this.firstElement.style.setProperty("--exposure",100-this.exposure+"%")}slide(o=0){this.setExposure(o);const h=new Event("slide");this.dispatchEvent(h)}slideToPage(o){this.slideDirection==="horizontal"&&this.slideToPageX(o.x),this.slideDirection==="vertical"&&this.slideToPageY(o.y)}slideToPageX(o){const h=o-this.getBoundingClientRect().left-window.scrollX;this.exposure=h/this.imageWidth*100,this.slide(0)}slideToPageY(o){const h=o-this.getBoundingClientRect().top-window.scrollY;this.exposure=h/this.imageHeight*100,this.slide(0)}enableTransition(){this.firstElement.style.setProperty("--transition-time","100ms"),this.transitionTimer=window.setTimeout(()=>{this.firstElement.style.setProperty("--transition-time","var(--default-transition-time)"),this.transitionTimer=null},100)}startSlideAnimation(){let o=null,h=this.animationDirection;this.firstElement.style.setProperty("--transition-time","var(--keyboard-transition-time)");const c=f=>{if(this.animationDirection===0||h!==this.animationDirection)return;o===null&&(o=f);const L=(f-o)/16.666666666666668*this.animationDirection;this.slide(L),setTimeout(()=>window.requestAnimationFrame(c),0),o=f};window.requestAnimationFrame(c)}stopSlideAnimation(){this.animationDirection=0,this.firstElement.style.setProperty("--transition-time","var(--default-transition-time)")}}))})()})();const je=60,Ye="https://api-less.cocunat.com",Ve="â",xe={first_purchase:0,promotion:1,subscriber:2};let ae=new Map,Q=new Map,ce=0,ke=!1;function Xe(){ce+=1,ae=new Map,Q=new Map}function Ke(){ke||typeof document>"u"||(ke=!0,document.addEventListener("cocunat:identity-changed",Xe))}function De(t){return[...new Set((t||[]).map(a=>
1String(a??"").trim()).filter(Boolean))].slice(0,je)}function Je({apiBaseUrl:t,market:r,lang:a,promoCode:n,skus:d}){const u=String(t).replace(/\/$/,""),s=new URLSearchParams;s.set("market",String(r||"").trim().toLowerCase()),s.set("lang",String(a).trim().toLowerCase());const l=String(n||"").trim();return l&&s.set("promo_code",l),s.set("skus",De(d).join(",")),`${u}/api/pricing/breakdown?${s.toString()}`}async function Qe({apiBaseUrl:t,market:r,lang:a,promoCode:n,skus:d}){if(typeof window>"u")return null;Ke();const u=De(d);if(u.length===0||!r)return null;const s=t||window.__API_LESS_URL||Ye,l=Je({apiBaseUrl:s,market:r,lang:a,promoCode:n,skus:u}),b=`${ce}|${l}`;if(ae.has(b))return ae.get(b);if(Q.has(b))return Q.get(b);const C=ce,y=fetch(l,{credentials:"include",cache:"no-store"}).then(async S=>{if(!S.ok)throw new Error(`pricing_breakdown_${S.status}`);return S.json()}).then(S=>(ce===C&&ae.set(b,S),S)).catch(()=>null).finally(()=>{Q.get(b)===y&&Q.delete(b)});return Q.set(b,y),y}function ne(t){return Number(Number(t).toFixed(2))}function re(t,r){return String(t??"").replace(/\{(\w+)\}/g,(a,n)=>r[n]===void 0||r[n]===null?"":String(r[n]))}function Ge(t,r,a){const n=t.percent;return t.type==="first_purchase"?re(a.first_purchase,{percent:n}):t.type==="subscriber"?re(a.subscriber,{percent:n}):r&&r.is_market_default?re(a.web_discount,{percent:n}):re(a.promotion,{percent:n,name:r&&(r.name||r.code)||""})}function Ze({item:t,promotion:r,texts:a,formatPrice:n}){if(!t||t.status!=="priced")return null;const d=Number(t.retail_price)||0;if(d<=0)return null;const u=ne(Number(t.first_unit&&t.first_unit.price!=null?t.first_unit.price:d)),s=(t.components||[]).filter(y=>y.status==="applied"&&Number(y.percent)>0).sort((y,S)=>(xe[y.type]??9)-(xe[S.type]??9));if(s.length===0)return null;const l=ne(d-u);let b=0;const C=s.map((y,S)=>{const h=S===s.length-1?Math.max(0,ne(l-b)):ne(d*Number(y.percent)/100);return b=ne(b+h),{type:y.type,percent:Number(y.percent),label:Ge(y,r,a||{}),amount:h,amountText:`${Ve}${n(h)}`}});return{retail:d,retailText:n(d),rows:C,finalPrice:u,finalText:n(u),savings:l,savingsText:re((a||{}).savings,{amount:n(l)}),totalPercent:Number(t.first_unit&&t.first_unit.total_percent)||0}}const et="[data-cbf-sub-option], [data-pdp3-club-onetime-option], [data-pdp3-main-price]",tt=["relative","!z-[70]"],nt="(max-width: 767px)",
1it=300,Ce=["rounded-[12px]","p-[24px]","shadow-[0_12px_32px_rgba(0,0,0,0.14)]"],_e=["before:hidden"],ie=document.querySelector("[data-price-breakdown-config]"),Pe=Array.from(document.querySelectorAll("[data-price-breakdown]"));if(ie&&Pe.length>0){const t=ie.dataset.market||"",r=ie.dataset.lang||"en",a=ie.dataset.currency||"EUR";let n={};try{n=JSON.parse(ie.dataset.texts||"{}")}catch{n={}}const d=m=>pe(m,a),u=window.matchMedia(nt),s=()=>u.matches;let l=null,b=null,C=null,y=null;const S=()=>l||(l=document.createElement("div"),l.setAttribute("data-price-breakdown-sheet",""),l.className="fixed inset-0 z-[9999] hidden items-end justify-center bg-black/50 opacity-0 transition-opacity duration-300 motion-reduce:transition-none",l.innerHTML=` 2 <div 3 class="w-full max-h-[82vh] translate-y-full overflow-y-auto overscroll-contain rounded-t-[12px] bg-white p-[20px] shadow-[0_-8px_32px_rgba(0,0,0,0.16)] transition-transform duration-300 ease-out motion-reduce:transition-none" 4 data-price-breakdown-sheet-panel 5 role="dialog" 6 aria-modal="true" 7 > 8 <div data-price-breakdown-sheet-body></div> 9 </div>`,document.body.appendChild(l),b=l.querySelector("[data-price-breakdown-sheet-panel]"),C=l.querySelector("[data-price-breakdown-sheet-body]"),b?.setAttribute("aria-label",n.title||""),l.addEventListener("click",m=>{m.target===l&&y?.close()}),l),o=Pe.map((m,D)=>{const x=m.querySelector("[data-price-breakdown-trigger]"),_=m.querySelector("[data-price-breakdown-popover]"),T=m.querySelector("[data-price-breakdown-card]"),M=m.querySelector("[data-price-breakdown-title]"),X=m.querySelector("[data-price-breakdown-price-label]"),$=m.querySelector("[data-price-breakdown-retail]"),B=m.querySelector("[data-price-breakdown-rows]"),W=m.querySelector("[data-price-breakdown-final-label]"),U=m.querySelector("[data-price-breakdown-final]"),k=m.querySelector("[data-price-breakdown-savings]"),P=m.querySelector("[data-price-breakdown-sheet-close]"),z=m.closest(et),G=`price-breakdown-popover-${D}`;_&&(_.id=G),x?.setAttribute("aria-controls",G);let E=!1,N=null,I=0;const q=()=>N!==null,F=()=>{!_||!x||(N="popover",_.classList.remove("hidden"),_.setAttribute("aria-hidden","false"),x.setAttribute("aria-expanded","true"),z?.classList.add(...tt))},se=()=>{!T||!_||(T.classList.remove(..._e),T.classList.add(...Ce),_.appendChild(T))},de=()=>{if(!T||!x)return;const w=S();y&&y!==K&&y.close(!0),y=K,window.clearTimeout(I),N="sheet",T.classList.remove(...Ce),T.classList.add(..._e),C?.replaceChildren(T),w.classList.remove("hidden"),w.classList.add("flex"),document.body.style.overflow="hidden",x.setAttribute("aria-expanded","true"),window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{N==="sheet"&&(w.classList.add("opacity-100"),b?.classList.remove("translate-y-full"))})})},A=()=>{m.classList.contains("hidden")||(s()?de():F())},R=(w=!1)=>{if(E=!1,N==="popover"&&_&&(_.classList.add("hidden"),_.setAttribute("aria-hidden","true"),z?.classList.remove("!z-[70]")),N==="sheet"&&l){l.classList.remove("opacity-100"),b?.classList.add("translate-y-full");const O=()=>{y===K&&(l?.classList.add("hidden"),l?.classList.remove("flex"),document.body.style.overflow="",y=null),se()};w?O():I=window.setTimeout(O,it)}N=null,x?.setAttribute("aria-expanded","false")};m.addEventListener("mouseenter",()=>{!s()&&!q()&&A()}),m.addEventListener("mouseleave",()=>{!s()&&!E&&R()}),x?.addEventListener("click",w=>{if(w.preventDefault(),w.stopPropagation(),q()&&(E||s())){R();return}A(),E=!0}),_?.addEventListener("click",w=>w.stopPropagation()),P?.addEventListener("click",w=>{w.preventDefault(),w.stopPropagation(),R()}),document.addEventListener("keydown",w=>{w.key==="Escape"&&q()&&(R(),x?.focus())}),document.addEventListener("click",w=>{N==="popover"&&!m.contains(w.target)&&R()});const K={get sku(){return m.dataset.sku||""},paint:w=>{if(!w){R(!0),m.classList.add("hidden"),m.classList.remove("inline-flex");return}M&&(M.textContent=n.title||""),X&&(X.textContent=n.price||""),$&&($.textContent=w.retailText),B&&B.replaceChildren(...w.rows.map(O=>
9{const J=document.createElement("li");J.className="flex items-baseline justify-between gap-[12px] font-brownLight text-[14px] leading-[20px] text-[#737373] md:text-[15px]",J.dataset.priceBreakdownRow=O.type;const j=document.createElement("span");j.textContent=O.label;const Y=document.createElement("span");return Y.className="whitespace-nowrap text-[#eb4335]",Y.textContent=O.amountText,J.append(j,Y),J})),W&&(W.textContent=n.final||""),U&&(U.textContent=w.finalText),k&&(k.textContent=w.savingsText),x?.setAttribute("aria-label",n.button||""),P?.setAttribute("aria-label",n.close||""),m.classList.remove("hidden"),m.classList.add("inline-flex")},close:R};return K});let h=0;const c=async()=>{const m=++h,D=[...new Set(o.map(M=>M.sku).filter(Boolean))],x=window.cart,_=typeof x?.getStoredPromoCode=="function"?x.getStoredPromoCode():"",T=await Qe({market:t,lang:r,promoCode:_,skus:D});m===h&&o.forEach(M=>{M.paint(Ze({item:T?.items?.[M.sku],promotion:T?.promotion||null,texts:n,formatPrice:d}))})};let f=!1;const L=()=>{f||(f=!0,c())};window.addEventListener("PricesAppliedUI",L,{once:!0}),window.setTimeout(L,2500),document.addEventListener("cocunat:product-selected",()=>{f=!0,o.forEach(m=>m.paint(null)),c()}),document.addEventListener("cocunat:identity-changed",()=>{f=!0,window.setTimeout(c,150)})}class me extends Error{constructor({status:r,code:a,retryAfterSeconds:n}){super(`new_customer_request_failed_${r}`),this.name="NewCustomerRequestError",this.status=r,this.code=a,this.retryAfterSeconds=n}}function rt(t){if(!t)return null;const r=Number(t);if(Number.isFinite(r))return Math.max(1,Math.ceil(r));const a=Date.parse(t);return Number.isFinite(a)?Math.max(1,Math.ceil((a-Date.now())/1e3)):null}async function ve(t,r){const a=await fetch(`${Be}${t}`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}),n=await a.json().catch(()=>({}));if(!a.ok)throw new me({status:a.status,code:typeof n?.error=="string"?n.error:null,retryAfterSeconds:rt(a.headers.get("Retry-After"))});return n}function Te({email:t,sku:r,lang:a}){return ve("/api/new-customer/request-code",{email:t,sku:r,lang:a})}function st({email:t,sku:r,code:a,lang:n,market:d,promo_code:u}){return ve("/api/new-customer/verify-code",{email:t,sku:r,code:a,lang:n,...d?{market:d}:{},...u?{promo_code:u}:{}})}function ot({sku:t,lang:r,market:a,promo_code:n}){return ve("/api/new-customer/check-eligibility",{sku:t,lang:r,...a?{market:a}:{},...n?{promo_code:n}:{}})}async function at(){const{response:t,data:r}=await He();if(!t.ok)throw new Error(`customer_session_failed_${t.status}`);if(r?.authenticated===!1)return null;if(r?.authenticated!==!0)throw new Error("customer_session_invalid_payload");const a=$e(r);return{authenticated:!0,fullLogin:a,email:null,source:a?"shopify":"soft"}}const ct=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,dt=/^\d{6}$/,lt=60,ut=180;function qe(){try{const r=window.cart?.getStoredPromoCode?.();if(r)return r}catch{}const t=document.cookie.match(/(?:^|;\s*)promo_code=([^;]+)/);return t?decodeURIComponent(t[1]):""}function Ae(){const t=document.querySelector("[data-new-customer-modal]");if(!t||t.dataset.ncReady==="1")return;t.dataset.ncReady="1";let r=t.dataset.sku||"";const a=t.dataset.lang||"en",n=t.dataset.market||"";let d=Number(t.dataset.price||0),u=t.dataset.currency||"EUR",s={};try{s=JSON.parse(t.dataset.texts||"{}")}catch{s={}}const l={email:t.querySelector('[data-nc-step="email"]'),code:t.querySelector('[data-nc-step="code"]'),success:t.querySelector('[data-nc-step="success"]'),denegado:t.querySelector('[data-nc-step="denegado"]'),status:t.querySelector('[data-nc-step="status"]')},b=t.querySelector("[data-nc-col]"),C=t.querySelector("[data-nc-email-form]"),y=t.querySelector("[data-nc-email-input]"),S=t.querySelector("[data-nc-email-error]"),o=t.querySelector("[data-nc-email-submit]"),h=t.querySelector("[data-nc-code-form]"),c=Array.from(t.querySelectorAll("[data-nc-otp-digit]")),f=t.querySelector("[data-nc-code-error]"),L=t.querySelector("[data-nc-code-submit]"),m=t.querySelector("[data-nc-code-sent-text]"),D=t.querySelector("[data-nc-resend]"),x=t.querySelector("[data-nc-resend-wait]"),_=t.querySelector("[data-nc-price-old]"),T=t.querySelector("[data-nc-price-new]"),M=t.querySelector("[data-nc-price-badge]"),X=t.querySelector("[data-nc-see-subscription]"),$=t.querySelector("[data-nc-status-result]"),B=t.querySelector("[data-nc-status-retry]");let W="",U=!1,k=null,P="idle",z=null,G="email",E=0;function N(e,i){const v=Number(e),g=Number(i??e);t.querySelectorAll("[data-nc-tpl]").forEach(p=>{const te=s[p.dataset.ncTpl];if(!te)return;const fe=p.dataset.ncTpl==="headlineSuccess"?g:v;!Number.isInteger(fe)||fe<1||(p.textContent=te.replace("{percent}",String(fe)))})}(async()=>{try{const e=await window.cart?.getActivePromoData?.(),i=Number(e?.exceptions_new_customer?.[r]);Number.isInteger(i)&&i>0&&N(i)}catch{}})();function I(e,i){e&&(e.textContent=i,e.classList.remove("hidden"))}function q(e){e&&(e.textContent="",e.classList.add("hidden"))}
9function F(e){c.forEach(i=>{i.classList.toggle("border-[#eb4335]",e)})}function se(e,i,v){if(!(v instanceof me)||v.status!==429)return!1;const g=Math.max(1,Number(v.retryAfterSeconds)||60);return I(e,(s.rateLimited||"Too many attempts. Try again in {seconds} seconds.").replace("{seconds}",String(g))),i&&(i.disabled=!0,window.setTimeout(()=>{i.disabled=!1,q(e)},g*1e3)),!0}function de(e){(e==="email"?y:e==="code"?c[0]:l[e]?.querySelector("button:not(.hidden)"))?.focus()}function A(e,i=!1){const v=()=>{G=e,Object.entries(l).forEach(([g,p])=>{p&&p.classList.toggle("hidden",g!==e)}),q(S),q(f),F(!1),de(e)};if(!i||!b){v();return}b.classList.add("opacity-0","-translate-y-[6px]"),window.setTimeout(()=>{v(),b.classList.remove("-translate-y-[6px]"),b.classList.add("translate-y-[6px]"),b.offsetHeight,b.classList.remove("opacity-0","translate-y-[6px]")},ut)}function R(){document.querySelectorAll("[data-new-customer-trigger]").forEach(e=>{e.querySelector("[data-new-customer-trigger-label]")?.classList.add("hidden");const i=e.querySelector("[data-new-customer-trigger-verified]");i&&(i.classList.remove("hidden"),i.classList.add("inline-flex"))})}async function be(){for(let e=0;e<100;e+=1){if(typeof window.cart?.getActivePromoData=="function")return window.cart.getActivePromoData();await new Promise(i=>window.setTimeout(i,50))}return null}async function K(){try{const e=await be(),i=Number(e?.exceptions_new_customer?.[r]);return Number.isInteger(i)&&i>0?i:null}catch{return null}}async function w(e){const i=E;let v=Number(e);(!Number.isInteger(v)||v<1)&&(v=await K()),!(!v||i!==E)&&document.querySelectorAll("[data-new-customer-banner]").forEach(g=>{const p=g.querySelector("[data-first-purchase-offer-text]");if(p){const te=p.getAttribute("data-template")||p.textContent||"";te.includes("{percent}")&&(p.textContent=te.replace("{percent}",String(v)))}g.style.removeProperty("display")})}function O(){document.querySelectorAll("[data-new-customer-banner]").forEach(e=>{e.style.display="none"})}function J(){if(!k?.promotion_available)return null;const e=Number(k.first_purchase_percentage);if(!Number.isInteger(e)||e<1||!(d>0)||!r)return null;const i=Number(k.base_percentage)||0,v=document.querySelector(`.price[data-sku="${CSS.escape(r)}"]`),g=Number(v?.getAttribute("data-subscriber-discount"))||0,p=Ue({basePrice:d,promoPercent:i,subscriberPercent:g,firstPurchasePercent:e});return{firstPurchasePercent:e,before:d,after:p.finalPrice,badge:p.badge,effectivePercent:p.effectivePercent}}function j(){const e=J();e&&(_&&(_.textContent=pe(e.before,u)),T&&(T.textContent=pe(e.after,u)),M&&(M.textContent=e.badge),N(e.firstPurchasePercent,e.effectivePercent))}function Y(){if(!r||typeof window.cart?.setFirstPurchase!="function")return;const e=Number(k?.first_purchase_percentage),i=k?.promotion_available===!0&&Number.isInteger(e)&&e>=1;window.cart.setFirstPurchase(r,i?{percent:e,basePercent:Number(k.base_percentage)||0,basePrice:d,labels:{pair:s.badgeLabel||""}}:null)}window.addEventListener("PricesAppliedUI",()=>{Y(),j()});function Z(){B?.classList.toggle("hidden",P!=="error"),$&&(P==="loading"||P==="idle"?$.textContent=s.statusChecking||"â¦":P==="error"?$.textContent=s.genericError||"Error":$.textContent=s.statusAvailable||"")}async function ee(){if(!U)return;const e=E;P="loading",Z(),B&&(B.disabled=!0);try{const i=await ot({sku:r,lang:a,market:n,promo_code:qe()});if(e!==E)return;k=i,P=k?.eligibility_unavailable?"error":"done",Y(),k?.promotion_available&&(R(),w(k.first_purchase_percentage),j())}catch{if(e!==E)return;P="error"}finally{B&&e===E&&(B.disabled=!1)}Z(),!t.classList.contains("hidden")&&G==="status"&&(P==="done"?A(k?.promotion_available?"success":"denegado",!0):Z())}function oe(){z&&(window.clearInterval(z),z=null)}function le(e=lt){if(!D||!x)return;let i=Math.max(1,Math.floor(e));const v=s.resendWait||"You can request another code in {seconds} s",g=()=>{x.textContent=v.replace("{seconds}",String(i))};oe(),D.classList.add("hidden"),x.classList.remove("hidden"),g(),z=window.setInterval(()=>{if(i-=1,i<=0){oe(),x.classList.add("hidden"),D.classList.remove("hidden");return}g()},1e3)}
9function ue(){c.forEach(e=>{e.value="",delete e.dataset.filled})}function Me(){return c.map(e=>e.value.trim()).join("")}function he(e){e.value?e.dataset.filled="":delete e.dataset.filled}c.forEach((e,i)=>{e.addEventListener("input",()=>{e.value=e.value.replace(/\D/g,"").slice(0,1),he(e),q(f),F(!1),e.value&&i<c.length-1&&c[i+1].focus()}),e.addEventListener("keydown",v=>{v.key==="Backspace"&&!e.value&&i>0&&(c[i-1].focus(),c[i-1].value="",he(c[i-1]),v.preventDefault())}),e.addEventListener("paste",v=>{v.preventDefault();const g=(v.clipboardData||window.clipboardData).getData("text").replace(/\D/g,"");if(g){for(let p=0;p<c.length-i&&g[p]!==void 0;p+=1)c[i+p].value=g[p],he(c[i+p]);c[Math.min(i+g.length,c.length-1)].focus(),q(f),F(!1)}})});function ye(e){e.key==="Escape"&&V()}function Ie(){U?P==="done"?k?.promotion_available?(j(),A("success")):A("denegado"):(Z(),A("status"),(P==="idle"||P==="error")&&ee()):A("email"),t.classList.remove("hidden"),t.classList.add("flex"),document.body.style.overflow="hidden",document.addEventListener("keydown",ye)}function V(){t.classList.add("hidden"),t.classList.remove("flex"),window.cart?.isCartOpen||(document.body.style.overflow=""),document.removeEventListener("keydown",ye)}document.addEventListener("click",e=>{(e.target instanceof Element?e.target.closest("[data-new-customer-trigger]"):null)&&Ie()}),t.addEventListener("click",e=>{e.target===t&&V()}),t.querySelector("[data-nc-close]")?.addEventListener("click",V),t.querySelector("[data-nc-close-denied]")?.addEventListener("click",V),t.querySelector("[data-nc-close-status]")?.addEventListener("click",V),B?.addEventListener("click",()=>void ee()),t.querySelector("[data-nc-buy]")?.addEventListener("click",()=>{const e=Number(t.dataset.variantId||0);V(),e>0&&typeof window.cart?.addItem=="function"&&window.cart.runCartAction(window.cart.addItem(e,1))}),document.addEventListener("cocunat:product-selected",e=>{const i=e.detail;!i?.sku||i.sku===r||(E+=1,r=i.sku,d=i.price,u=i.currency,t.dataset.sku=r,t.dataset.price=String(d),t.dataset.currency=u,t.dataset.variantId=String(i.variantId),k=null,P="idle",O(),oe(),ue(),U?ee():w())});function we(){return document.querySelector('[data-cbf-subscription-options] input[data-club-choice="pdp-subscription"]')||document.querySelector('input[data-club-choice="pdp-subscription"]')}X&&we()&&(X.classList.remove("hidden"),t.querySelector("[data-nc-close-denied]")?.classList.add("hidden"),X.addEventListener("click",()=>{const e=we();V(),e&&(e.click(),e.closest("label, [data-cbf-subscription-options]")?.scrollIntoView({behavior:"smooth",block:"center"}))})),C?.addEventListener("submit",async e=>{e.preventDefault();const i=(y?.value||"").trim();if(!ct.test(i)){I(S,s.emailError||"Invalid email");return}q(S),o&&(o.disabled=!0);let v=!1;const g=E;try{if(await Te({email:i,sku:r,lang:a}),g!==E)return;W=i,Re(i),ue(),A("code",!0),le()}catch(p){if(g!==E)return;v=se(S,o,p),v||I(S,s.genericError||"Error")}finally{o&&!v&&(o.disabled=!1)}});function Re(e){if(!m)return;const i=s.codeSent||"{email}",[v,g]=i.split("{email}");m.textContent="",m.append(document.createTextNode(v??""));const p=document.createElement("strong");p.className="font-brownRegular",p.textContent=e,m.append(p,document.createTextNode(g??""))}D?.addEventListener("click",async()=>{if(!W)return;q(f),F(!1),ue(),c[0]?.focus(),D.disabled=!0;const e=E;try{if(await Te({email:W,sku:r,lang:a}),e!==E)return;le()}catch(i){if(e!==E)return;i instanceof me&&i.status===429?le(Math.max(1,Number(i.retryAfterSeconds)||60)):I(f,s.genericError||"Error")}finally{D.disabled=!1}}),h?.addEventListener("submit",async e=>{e.preventDefault();const i=Me();if(!dt.test(i)){F(!0),I(f,s.codeError||"Invalid code");return}q(f),F(!1),L&&(L.disabled=!0);let v=!1;const g=E;try{const p=await st({email:W,sku:r,code:i,lang:a,market:n,promo_code:qe()});if(g!==E){p.code_valid&&(U=!0,document.dispatchEvent(new CustomEvent("cocunat:identity-changed",{detail:{authenticated:!0}})),ee());return}p.code_valid?(U=!0,k=p,P=p.eligibility_unavailable?"error":"done",oe(),document.dispatchEvent(new CustomEvent("cocunat:identity-changed",{detail:{authenticated:!0}})),Y(),p.eligibility_unavailable?(O(),Z(),A("status",!0)):p.promotion_available?(R(),j(),A("success",!0)):(O(),A("denegado",!0))):(F(!0),I(f,p.code_error==="expired"?s.codeExpired||s.codeError||"Expired code":s.codeError||"Invalid code"))}catch(p){if(g!==E)return;v=se(f,L,p),v||I(f,s.genericError||"Error")}finally{L&&!v&&(L.disabled=!1)}}),(async()=>{let e;try{e=await at()}catch{return}if(!e){w();return}U=!0,ee()})()}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Ae):Ae();
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.