1(()=>{if(window.__cbCartDrawerPlacementBound)return;window.__cbCartDrawerPlacementBound=!0;const closeDrawer=cartDrawer=>{cartDrawer.close?.(),cartDrawer.querySelector("dialog[open]")?.close()},bindDetachedDrawer=(cartDrawer,header2)=>{cartDrawer.dataset.cbCloseBound!=="true"&&(cartDrawer.dataset.cbCloseBound="true",cartDrawer.addEventListener("click",event=>{!(event.target instanceof Element)||!event.target.closest(".cart-drawer__close-button")||(event.preventDefault(),closeDrawer(cartDrawer),header2.querySelectorAll("cart-drawer-component").forEach(closeDrawer))}))},detachDrawerFromHiddenHeader=()=>{const header2=document.querySelector("#header-component"),hiddenDrawers=[...header2?.querySelectorAll("cart-drawer-component")??[]];if(!header2||getComputedStyle(header2).display!=="none")return;let cartDrawer=document.querySelector("body > cart-drawer-component.cb-cart-drawer--detached");if(!cartDrawer){if(cartDrawer=hiddenDrawers.shift(),!cartDrawer)return;cartDrawer.classList.add("cb-cart-drawer--detached"),document.body.appendChild(cartDrawer)}cartDrawer.removeAttribute("auto-open"),hiddenDrawers.forEach(duplicate=>{duplicate.removeAttribute("auto-open"),closeDrawer(duplicate)}),bindDetachedDrawer(cartDrawer,header2)},refreshDetachedDrawer=event=>{const sections=event.detail?.data?.sections;if(!sections||!Object.keys(sections).length||event.detail?.data?.didError)return;const header2=document.querySelector("#header-component");if(!header2||getComputedStyle(header2).display!=="none")return;const shouldOpen=!!document.querySelector("body > cart-drawer-component.cb-cart-drawer--detached")?.querySelector("dialog[open]")||event.detail?.data?.source==="product-form-component";window.requestAnimationFrame(()=>{const currentHeader=document.querySelector("#header-component"),detachedDrawer2=document.querySelector("body > cart-drawer-component.cb-cart-drawer--detached"),freshDrawer=currentHeader?.querySelector("cart-drawer-component"),detachedDialog=detachedDrawer2?.querySelector("dialog"),freshDialog=freshDrawer?.querySelector("dialog");!currentHeader||!detachedDrawer2||!freshDrawer||!detachedDialog||!freshDialog||(["class","aria-labelledby","cart-summary-sticky"].forEach(attribute=>{const value=freshDialog.getAttribute(attribute);value==null?detachedDialog.removeAttribute(attribute):detachedDialog.setAttribute(attribute,value)}),detachedDialog.replaceChildren(...[...freshDialog.childNodes].map(node=>node.cloneNode(!0))),currentHeader.querySelectorAll("cart-drawer-component").forEach(duplicate=>{duplicate.removeAttribute("auto-open"),closeDrawer(duplicate)}),shouldOpen&&!detachedDialog.open&&window.requestAnimationFrame(()=>detachedDrawer2.open?.()))})};detachDrawerFromHiddenHeader(),document.readyState==="loading"&&document.addEventListener("DOMContentLoaded",detachDrawerFromHiddenHeader,{once:!0}),document.addEventListener("shopify:section:load",detachDrawerFromHiddenHeader),document.addEventListener("cart:update",refreshDetachedDrawer);const header=document.querySelector("#header-component");header&&new MutationObserver(detachDrawerFromHiddenHeader).observe(header,{childList:!0,subtree:!0})})(); 2//# sourceMappingURL=/cdn/shop/t/51/assets/cb-cart-fast-open.js.map?v=376922965842119041789412949
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.