PageSourceSearch

https://couteauxduchef.com/cdn/shop/t/2/assets/bundle-critical-20260716T100000-sh.js

js couteauxduchef.com collected 2026-10-07 08:16:43 UTC 20,742 bytes, 1 lines download raw bytes

1import{E as l,y as d,B as O,S as h,u as x}from"./index-20260716T100000-sh.js";class u extends l{FirstFocusableElement=null;LastFocusableElement=null;_pendingTransitionEnd=null;get isStatic(){return this.getAttribute("static")!==null}createHeadingCloseBtn(){const e=this.querySelector("slot-heading");if(!e||e.querySelector("layer-action"))return;const t=document.createElement("layer-action");t.setAttribute("close",""),t.role="button",t.setAttribute("tabindex","0"),t.setAttribute("aria-label","Close panel"),t.dataset.escapeTo=this.id;const s=document.createElement("span");s.className="icon icon-sm",s.innerHTML=window.SHARP_ICONS.close_sm,t.appendChild(s),e.appendChild(t)}setupMutationObserver(){const e=new MutationObserver(()=>{this.createHeadingCloseBtn();const t=this.querySelectorAll('a, button, [tabindex="0"], layer-action');this.FirstFocusableElement=t[0],this.LastFocusableElement=t[t.length-1];const s=document.activeElement,i=s instanceof HTMLInputElement||s instanceof HTMLTextAreaElement||s instanceof HTMLSelectElement;this.FirstFocusableElement&&!i&&this.FirstFocusableElement.focus()});e.observe(this,{childList:!0,subtree:!0}),this.addEffect(()=>()=>e.disconnect())}moveToManager(){!this.isStatic&&(!this.parentNode||this.parentNode!==document.body&&this.parentNode!==this.closest("website-manager"))&&this.closest("website-manager")?.appendChild(this)}setupLayerManager(){if(!this.id)throw new d({message:"No id provided",element:this});const e=this.closest("website-manager");if(!e)throw new d({message:"No manager found",element:this});e.subscribeLayerManager(t=>{const s=t.lastIndexOf(this.id);if(this._pendingTransitionEnd||(this._pendingTransitionEnd=null),s>-1)this.classList.add("is-active"),this.style.zIndex=`${51+s}`,this.classList.contains("lg:cancel-panel-skin")||(this.removeAttribute("inert"),this.removeAttribute("hidden")),this.FirstFocusableElement?.focus(),this.classList.toggle("!transition-none",s!==0),this._pendingTransitionEnd&&(this.removeEventListener("transitionend",this._pendingTransitionEnd),this._pendingTransitionEnd=null);else{this.classList.remove("is-active"),this.classList.contains("lg:cancel-panel-skin")||(this.setAttribute("inert",""),this.setAttribute("hidden",""));const i=document.querySelectorAll(`layer-action[layer-id="${this.id}"]`);for(const a of i)a.setAttribute("aria-expanded","false");const n=a=>{a.propertyName==="transform"&&(this.classList.contains("is-active")||(this.style.zIndex=""),this.removeEventListener("transitionend",n),this._pendingTransitionEnd=null)};this._pendingTransitionEnd=n,this.addEventListener("transitionend",n,{signal:this.signal}),t.length||this.classList.remove("!transition-none")}},{signal:this.signal})}onStart(){this.classList.contains("lg:cancel-panel-skin")||(this.setAttribute("inert",""),this.setAttribute("hidden","")),this.setAttribute("role","dialog"),this.setAttribute("aria-modal","true"),this.moveToManager(),this.createHeadingCloseBtn(),this.setupMutationObserver(),this.setupLayerManager();const e=this.querySelectorAll('a, button, [tabindex="0"], layer-action');this.FirstFocusableElement=e[0],this.LastFocusableElement=e[e.length-1],this.addEventListener("keydown",t=>{if(t.key==="Escape"){const s=this.querySelector("[back]"),i=this.querySelector("[close]");if(s)this.closest("website-manager")?.backOverlayHistory();else if(i){const n=i.dataset.escapeTo;if(n){const a=document.querySelector(n);a&&this.closest("website-manager")?.pushPreviousSelectedElement(a)}this.closest("website-manager")?.resetOverlayHistory()}}t.key==="Tab"&&(t.shiftKey&&document.activeElement===this.FirstFocusableElement?(t.preventDefault(),this.LastFocusableElement?.focus()):!t.shiftKey&&document.activeElement===this.LastFocusableElement&&(t.preventDefault(),this.FirstFocusableElement?.focus()))},{signal:this.signal})}}customElements.define("ui-panel",u);const F=Object.freeze(Object.defineProperty({__proto__:null,UiPanel:u},Symbol.toStringTag,{value:"Module"}));class m extends l{async handleClick(){const e={items:[]};for(let t=1;;t+=1){const s=this.dataset[`addtocartId${t}`],i=this.dataset[`addtocartPlan${t}`],n=this.dataset[`addtocartQty${t}`],a=this.dataset[`addtocartProp${t}`];if(!s)break;const r=n?Number.parseInt(n,10):1,o={id:Number.parseInt(s,10),quantity:r};i&&(o.selling_plan=Number.parseInt(i,10)),a&&a.length>0&&(o.properties=JSON.parse(a)),e.items.push(o)}e.items.length&&(this.classList.add("is-loading","is-adding"),await O(e),this.classList.remove("is-loading","is-adding"),window.$WM.openCartPanel())}onStart(){this.addEventListener("click",()=>this.handleClick(),{signal:this.signal}),this.addEventListener("keydown",e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.handleClick())},{signal:this.signal})}}customElements.define("atc-btn",m);const C=Object.freeze(Object.defineProperty({__proto__:null,AtcBtn:m},Symbol.toStringTag,{value:"Module"}));class b extends l{onStart(){const e=this.attributes,t={};for(const s of e){const i=s.name,n=s.value,a=/@([a-zA-Z0-9_-]+):([a-zA-Z0-9_-]+)/g.exec(i);if(a){const[,r,o]=a;t[r]={methodName:o,value:n}}}for(const[s,{methodName:i,value:n}]of Object.entries(t))this.addEventListener(s,()=>{const a=this.getAttribute("parent");
1if(!a)throw new d({message:"No parent attribute found",element:this});const r=this.closest(a);if(!r)throw new d({message:"Parent element not found",element:this});const o=this.kebabToCamelCase(i);if(!(o in r))throw new d({message:`Method '${o}' not found in parent '${a}'`,element:this});if(typeof r[o]!="function")throw new d({message:`Method '${o}' is not a function in parent '${a}'`,element:this});r[o](n)},{signal:this.signal})}kebabToCamelCase(e){return e.replace(/-([a-z])/g,t=>t[1].toUpperCase())}}customElements.define("call-parent",b);const P=Object.freeze(Object.defineProperty({__proto__:null,CallParent:b},Symbol.toStringTag,{value:"Module"}));class g extends l{onStart(){const e=this.children[0];if(!e)throw new d({message:"child element is missing",element:this});for(const[t,s]of Object.entries(this.dataset))t.startsWith("attr")&&t.length>4&&s&&e.setAttribute(t.slice(4),s)}}customElements.define("child-defer-attr",g);const N=Object.freeze(Object.defineProperty({__proto__:null,ChildDeferAttr:g},Symbol.toStringTag,{value:"Module"}));class f extends l{onStart(){const e=this.dataset.vars;if(!e)return;const t=e.split(" ");window.$WM.cssVars.listenChange(s=>{requestAnimationFrame(()=>{for(const i of t)this.style.setProperty(i,s[i])})},{signal:this.signal})}}customElements.define("css-var",f);const H=Object.freeze(Object.defineProperty({__proto__:null,CssVar:f},Symbol.toStringTag,{value:"Module"}));class y extends l{editClassAll(e,t,s,i=0){setTimeout(()=>{for(const n of e)n.classList[s](t)},i)}processClass(){const e=["add","remove","toggle"];for(const t of e){const s=`${t}Target`,i=`${t}Classname`,n=`${t}Delay`,a=this.dataset[s];if(!a||a.length===0)continue;const r=this.dataset[i]||"is-active",o=Number(this.dataset[n])||0,M=h(this,a);this.editClassAll(M,r,t,o)}}onStart(){this.addEventListener("click",()=>this.processClass(),{signal:this.signal}),this.addEventListener("keydown",e=>{e.key===" "&&e.preventDefault(),e.key==="Enter"&&(e.preventDefault(),this.processClass())},{signal:this.signal}),this.addEventListener("keyup",e=>{e.key===" "&&(e.preventDefault(),this.processClass())},{signal:this.signal})}}customElements.define("edit-class",y);const j=Object.freeze(Object.defineProperty({__proto__:null,EditClass:y},Symbol.toStringTag,{value:"Module"}));class p extends l{visibilityTimeout=null;latestLayerValue=[];clearVisibilityTimeout(){this.visibilityTimeout!==null&&(window.clearTimeout(this.visibilityTimeout),this.visibilityTimeout=null)}setVisibility(e){const t=(e||[]).filter(s=>{const i=document.getElementById(s);return i&&!i.hasAttribute("no-overlay")});if(t.length>0){let s=t.at(-1)??this._throwError("overlay id is required"),i=document.getElementById(s);const n=new Set;for(;i&&"zelement"in(i.dataset||{})&&!n.has(i.id);){n.add(i.id);const r=i.dataset.zelement||"";if(r===s||r==="")break;const o=document.getElementById(r);if(!o)break;s=r,i=o}const a=Number(i?window.getComputedStyle(i).zIndex:0);this.style.zIndex=`${Math.max(0,a-1)}`,this.classList.add("is-active"),document.body.style.overflow="hidden"}else this.classList.remove("is-active"),document.body.style.overflow=""}onStart(){(!this.parentNode||this.parentNode!==document.body&&this.parentNode!==this.closest("website-manager"))&&this.closest("website-manager")?.appendChild(this),this.addEventListener("click",()=>{this.clearVisibilityTimeout(),this.setVisibility([]),this.closest("website-manager")?.resetOverlayHistory()},{signal:this.signal});const e=this.closest("website-manager");if(!e)throw new Error("No manager found");e.subscribeLayerManager(t=>{this.latestLayerValue=[...t],this.clearVisibilityTimeout(),this.visibilityTimeout=window.setTimeout(()=>{this.setVisibility(this.latestLayerValue),this.visibilityTimeout=null},10)},{signal:this.signal})}}customElements.define("global-overlay",p);const I=Object.freeze(Object.defineProperty({__proto__:null,GlobalOverlay:p},Symbol.toStringTag,{value:"Module"}));class v extends l{#e=this._attribute("parent","string",!0);#t=this._attribute("path");onStart(){const e=this.closest(this.#e??"website-manager");if(!e)throw new d({message:"No parent found",element:this});const[t,...s]=this.#t.split(".");if(!(t in e))throw new d({message:"Public method not found",element:this});const i=e[t];typeof i=="function"&&i(n=>{const a=n?x(n,s.join(".")):this.getAttribute("value");this.textContent=a,this.setAttribute("value",a??"")},{signal:this.signal})}}customElements.define("inject-parent-state",v);const q=Object.freeze(Object.defineProperty({__proto__:null,InjectParentState:v},Symbol.toStringTag,{value:"Module"}));class E extends l{persistIfNeeded(){const e=this.dataset.storeAction;e&&localStorage.setItem(e,"true")}onStart(){const e=this.getAttribute("layer-id");
1e&&(this.ariaControls=e),!this.hasAttribute("back")&&!this.hasAttribute("close")&&(this.ariaExpanded="false",this.ariaHasPopup="dialog"),this.setAttribute("tabindex","0"),this.setAttribute("role","button"),this.addEventListener("click",t=>{if(t.preventDefault(),this.persistIfNeeded(),this.hasAttribute("back")){this.closest("website-manager")?.backOverlayHistory();return}if(this.hasAttribute("close")){this.closest("website-manager")?.resetOverlayHistory();return}if(!e)throw new d({message:"No layer-id provided",element:this});const s=e.split(",").map(i=>i.trim());this.ariaExpanded!==null&&(this.ariaExpanded="true"),this.hasAttribute("replace")?this.closest("website-manager")?.replaceOverlayHistory(s):this.closest("website-manager")?.addOverlayHistory(s)},{signal:this.signal}),this.addEventListener("keydown",t=>{if(t.key==="Enter"||t.key===" "){t.preventDefault();const s=this.getAttribute("escape-to");if(s){const i=document.querySelector(s);i&&this.closest("website-manager")?.pushPreviousSelectedElement(i)}this.click()}},{signal:this.signal}),this.closest("website-manager")?.subscribeLayerManager(t=>{!this.hasAttribute("close")&&!this.hasAttribute("back")&&t.at(-1)!==this.getAttribute("layer-id")&&(this.ariaExpanded="false")})}}customElements.define("layer-action",E);const z=Object.freeze(Object.defineProperty({__proto__:null,LayerAction:E},Symbol.toStringTag,{value:"Module"}));class w extends l{async onStart(){await this.refresh()}async refresh(){const{url:e}=this.dataset;if(!e)throw this._throwError("URL is missing");if(!this.id)throw this._throwError("Element ID is missing");const s=(await fetch(e).then(i=>i.text()).then(i=>new DOMParser().parseFromString(i,"text/html"))).getElementById(this.id);if(!s)throw this._throwError("Element not found after fetching");this.innerHTML=s.innerHTML}}customElements.define("lazyload-fetch",w);const B=Object.freeze(Object.defineProperty({__proto__:null,LazyloadFetch:w},Symbol.toStringTag,{value:"Module"}));class S extends l{onStart(){const e=this.querySelectorAll("[megamenu-link]");for(const i of e)i.addEventListener("click",()=>{const{megamenuId:n}=i.dataset;i.classList.contains("is-open")?this.closest("website-manager")?.resetOverlayHistory():n&&this.closest("website-manager")?.replaceOverlayHistory([n])},{signal:this.signal});const t=this.closest("website-manager");if(!t)throw new d({message:"No manager found",element:this});t.subscribeLayerManager(i=>{if(this.closeMegamenu(),i.length){const n=this.querySelector(`#${i}`);if(n){n.classList.add("is-active"),n.setAttribute("aria-hidden","false");const r=n.querySelector('a, button, [tabindex="0"], layer-action');r&&r.focus()}const a=this.querySelector(`[data-megamenu-id="${i}"]`);a&&(a.classList.add("is-open"),a.setAttribute("aria-expanded","true"))}},{signal:this.signal});const s=this.querySelectorAll("[megamenu-item]");for(const i of s){const n=i.querySelectorAll('a, button, [tabindex="0"], layer-action'),a=n[n.length-1];a&&a.addEventListener("keydown",r=>{r.key==="Tab"&&(this.closeMegamenu(),this.closest("website-manager")?.resetOverlayHistory())},{signal:this.signal}),i.addEventListener("keydown",r=>{r.key==="Escape"&&(this.closeMegamenu(),this.closest("website-manager")?.resetOverlayHistory())},{signal:this.signal})}}closeMegamenu(){const e=this.querySelectorAll("[megamenu-item]");for(const s of e)s.classList.remove("is-active"),s.setAttribute("aria-hidden","true");const t=this.querySelectorAll("[megamenu-link].is-open");for(const s of t)s.classList.remove("is-open"),s.setAttribute("aria-expanded","false")}}customElements.define("mega-menu",S);const D=Object.freeze(Object.defineProperty({__proto__:null,Megamenu:S},Symbol.toStringTag,{value:"Module"}));class T extends l{onStart(){this.addEventListener("click",async()=>{const e=this._attribute("data-url"),t=this._attribute("data-replace-mode","string",!0)||"outer",s=h(this,this._attribute("data-replace-selector"));if(s.length===0)throw this._throwError("No target elements found");const i=await fetch(e).then(r=>r.text()).then(r=>new DOMParser().parseFromString(r,"text/html")),n=this._attribute("data-fetch-selector","string",!0);let a;if(n){const r=h(i.body,n);if(r.length===0)throw this._throwError("Source element not found in fetched content");a=r[0]}else a=i.body;for(const r of s)t==="outer"?r.outerHTML=a.outerHTML:r.innerHTML=a.innerHTML},{signal:this.signal})}}customElements.define("onclick-fetch",T);const V=Object.freeze(Object.defineProperty({__proto__:null,OnClickFetch:T},Symbol.toStringTag,{value:"Module"}));class _ extends l{$clamp=null;$buttons=null;observer;onStart(){const e=this.dataset.clampTarget,t=this.dataset.buttonsTarget;if(!e||!t){console.warn("ReadMoreToggle: Missing data attributes",this);return}if(this.$clamp=this.querySelector(e),this.$buttons=this.querySelector(t),!this.$clamp||!this.$buttons){console.warn("ReadMoreToggle: Target elements not found",this);return}this.update(),this.observer=new ResizeObserver(()=>this.update()),this.observer.observe(this.$clamp)}onStop(){this.observer?.disconnect(),this.observer=void 0}update(){if(!this.$clamp||!this.$buttons){console.warn("ReadMoreToggle: Target elements not found",this);return}if(this.classList.contains("is-active"))return;const e=this.$clamp.scrollHeight-1>this.$clamp.clientHeight;this.$buttons.classList.toggle("invisible",!e)}}customElements.define("read-more-ellipsis",_);const R=Object.freeze(Object.defineProperty({__proto__:null,ReadMoreEllipsis:_},Symbol.toStringTag,{value:"Module"}));class L extends l{getHeight(e){const{height:t}=e.getBoundingClientRect(),{heightVariable:s}=e.dataset,{body:i}=document;if(!s)throw new Error("Missing data-height-variable attribute");i.style.setProperty(`--${s}`,`${t}px`)}onStart(){const e=new ResizeObserver(()=>{this.getHeight(this)});this.addEffect(()=>(e.observe(this),()=>e.disconnect()))}}customElements.define("set-height-variable",L);const K=Object.freeze(Object.defineProperty({__proto__:null,SetHeightVariable:L},Symbol.toStringTag,{value:"Module"}));class $ extends l{FirstFocusableElement=null;LastFocusableElement=null;createHeadingCloseBtn(){const e=this.querySelector("slot-heading");if(!e||e.querySelector("layer-action"))return;const t=document.createElement("layer-action");t.setAttribute("close",""),t.role="button",t.setAttribute("tabindex","0"),t.setAttribute("aria-label","Close modal"),t.dataset.escapeTo=this.id;const s=document.createElement("span");s.className="btn btn-ghost btn-square btn-sm svg-fit",s.innerHTML=window.SHARP_ICONS.close,t.appendChild(s),e.appendChild(t)}setupMutationObserver(){const e=new MutationObserver(()=>{this.createHeadingCloseBtn();const t=this.querySelectorAll('a, button, [tabindex="0"], layer-action');this.FirstFocusableElement=t[0],this.LastFocusableElement=t[t.length-1],this.FirstFocusableElement&&this.FirstFocusableElement.focus()});e.observe(this,{childList:!0,subtree:!0}),this.addEffect(()=>()=>e.disconnect())}wait(e){return new Promise(t=>setTimeout(t,e))}async openThroughManager(e){!e||!this.id||e.addOverlayHistory([this.id])}setupOnEventTrigger(e){const t=this.dataset.eventListener||"openPopup";document.addEventListener(t,()=>{this.openThroughManager(e)},{signal:this.signal})}getSessionPageviews(){return Number(localStorage.getItem("pageViews")||"0")}async setupOnLoadTrigger(e){const t=this.id;if(t&&localStorage.getItem(t))return;const s=Number(this.dataset.eventDelay||"0"),i=Number(this.dataset.eventPageviews||"0"),n=[];if(s>0&&n.push(async()=>(await this.wait(s),!0)),i>0&&n.push(async()=>this.getSessionPageviews()>i),n.length===0){await this.openThroughManager(e);return}(await Promise.all(n.map(r=>r()))).every(Boolean)&&await this.openThroughManager(e)}
1onStart(){if(this.setAttribute("inert",""),this.setAttribute("hidden",""),this.setAttribute("role","dialog"),this.setAttribute("aria-modal","true"),(!this.parentNode||this.parentNode!==document.body&&this.parentNode!==this.closest("website-manager"))&&this.closest("website-manager")?.appendChild(this),!this.id){console.error({message:"No id provided",element:this});return}const e=this.closest("website-manager");if(!e)throw new Error("No manager found");this.createHeadingCloseBtn(),this.setupMutationObserver();const t=this.dataset.trigger;t==="on-load"?this.setupOnLoadTrigger(e):t==="on-event"&&this.setupOnEventTrigger(e),e.subscribeLayerManager(i=>{const n=i.lastIndexOf(this.id);if(n>-1)this.classList.add("is-active"),this.style.zIndex=`${51+n}`,this.removeAttribute("inert"),this.removeAttribute("hidden"),this.FirstFocusableElement?.focus(),n!==0?this.classList.add("!transition-none"):this.classList.remove("!transition-none");else{this.classList.remove("is-active"),this.style.zIndex="",this.setAttribute("inert",""),this.setAttribute("hidden","");const a=document.querySelectorAll(`layer-action[layer-id="${this.id}"]`);for(const r of a)r.setAttribute("aria-expanded","false");i.length||this.classList.remove("!transition-none")}},{signal:this.signal});const s=this.querySelectorAll('a, button, [tabindex="0"], layer-action');this.FirstFocusableElement=s[0],this.LastFocusableElement=s[s.length-1],this.addEventListener("keydown",i=>{if(i.key==="Escape"){const n=this.querySelector("[close],[back]");if(n){const a=n.dataset.escapeTo;if(a){const r=document.querySelector(a);r&&this.closest("website-manager")?.pushPreviousSelectedElement(r)}this.closest("website-manager")?.resetOverlayHistory()}}i.key==="Tab"&&(i.shiftKey&&document.activeElement===this.FirstFocusableElement?(i.preventDefault(),this.LastFocusableElement?.focus()):!i.shiftKey&&document.activeElement===this.LastFocusableElement&&(i.preventDefault(),this.FirstFocusableElement?.focus()))},{signal:this.signal})}}customElements.define("ui-modal",$);const U=Object.freeze(Object.defineProperty({__proto__:null,UiModal:$},Symbol.toStringTag,{value:"Module"}));class A extends l{onStart(){const e=this.querySelectorAll("[tab-btn]");for(const s of e)s.addEventListener("click",i=>{i.preventDefault();const n=this.querySelector("[tab-btn].tab-active");n?.classList.remove("tab-active"),n?.setAttribute("aria-selected","false"),s.classList.add("tab-active"),s.setAttribute("aria-selected","true");const a=s.dataset.id,r=this.querySelector(`[tab-content][data-id="${a}"]`),o=this.querySelector("[tab-content].is-active");o?.classList.remove("is-active"),o?.setAttribute("aria-hidden","true"),r?.classList.add("is-active"),r?.setAttribute("aria-hidden","false")},{signal:this.signal});this.querySelector("[tab-btn].tab-active")||this.querySelector("[tab-btn]")?.click()}}customElements.define("ui-tabs",A);const Q=Object.freeze(Object.defineProperty({__proto__:null,UiTabs:A},Symbol.toStringTag,{value:"Module"}));export{u as U,C as a,N as b,P as c,H as d,j as e,B as f,I as g,U as h,q as i,Q as j,z as l,D as m,V as o,R as r,K as s,F as u};

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.