PageSourceSearch

https://astore.pk/cdn/shop/t/5/assets/cart-disclosure-modal.js?v=154804774285276548271782512539

js astore.pk collected 2026-09-26 04:53:27 UTC 4,476 bytes, 2 lines download raw bytes

1if(!customElements.get("cart-disclosure-modal")){class CartDisclosureModal extends HTMLElement{constructor(){super(),this.onOpenerClick=this.onOpenerClick.bind(this),this.onCloseClick=this.onCloseClick.bind(this),this.onModalClick=this.onModalClick.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.removeIfOpenerDisconnected=this.removeIfOpenerDisconnected.bind(this)}connectedCallback(){if(this.initialized)return;this.initialized=!0,this.dialog=this.querySelector('[role="dialog"]');const controlsId=this.dialog?.id;this.opener=this.previousElementSibling?.classList.contains("cart-item__disclosure")?this.previousElementSibling:controlsId?document.querySelector(`[aria-controls="${controlsId}"]`):null,this.closeButton=this.querySelector("[data-cart-disclosure-close]");let shouldRestoreOpen=!1;document.querySelectorAll("cart-disclosure-modal").forEach(modal=>{modal===this||modal.id!==this.id||(shouldRestoreOpen=shouldRestoreOpen||modal.hasAttribute("open"),modal.remove())}),this.opener?.addEventListener("click",this.onOpenerClick),this.closeButton?.addEventListener("click",this.onCloseClick),this.addEventListener("click",this.onModalClick),this.addEventListener("keyup",this.onKeyUp),this.parentElement!==document.body&&(this.isMoving=!0,document.body.appendChild(this),this.isMoving=!1),this.observeOpener(),shouldRestoreOpen&&this.show()}disconnectedCallback(){this.isMoving||(this.openerObserver?.disconnect(),this.opener?.removeEventListener("click",this.onOpenerClick),this.closeButton?.removeEventListener("click",this.onCloseClick),this.removeEventListener("click",this.onModalClick),this.removeEventListener("keyup",this.onKeyUp),this.hasAttribute("open")&&this.hide(!1))}observeOpener(){this.openerObserver?.disconnect(),this.opener&&(this.openerObserver=new MutationObserver(this.removeIfOpenerDisconnected),this.openerObserver.observe(document.body,{childList:!0,subtree:!0}),this.removeIfOpenerDisconnected())}removeIfOpenerDisconnected(){this.isMoving||!this.isConnected||this.opener?.isConnected||this.remove()}onOpenerClick(event){event.preventDefault(),event.stopPropagation(),this.show()}onCloseClick(event){event.preventDefault(),event.stopPropagation(),this.hide()}onModalClick(event){event.stopPropagation(),event.target===this&&this.hide()}onKeyUp(event){event.code.toUpperCase()==="ESCAPE"&&(event.preventDefault(),event.stopPropagation(),this.hide())}show(){this.hasAttribute("open")||(document.querySelectorAll("cart-disclosure-modal[open]").forEach(modal=>{modal!==this&&modal.hide(!1)}),this.lockScroll(),this.setAttribute("open",""),this.opener?.setAttribute("aria-expanded","true"),typeof trapFocus=="function"?trapFocus(this,this.dialog):this.dialog?.focus(),window.pauseAllMedia())}hide(restoreFocus=!0){this.hasAttribute("open")&&(this.removeAttribute("open"),this.opener?.setAttribute("aria-expanded","false"),this.unlockScroll(),restoreFocus?this.restoreFocusTrap():typeof removeTrapFocus=="function"&&removeTrapFocus(),window.pauseAllMedia())}lockScroll(){if(this.bodyOverflowWasHidden=document.body.classList.contains("overflow-hidden"),this.previousBodyPaddingRight=document.body.style.paddingRight,this.bodyOverflowWasHidden)return;const scrollbarWidth=window.innerWidth-document.documentElement.clientWidth;if(scrollbarWidth>0){const currentPaddingRight=parseFloat(window.getComputedStyle(document.body).paddingRight)||0;document.body.style.paddingRight=`${currentPaddingRight+scrollbarWidth}px`}document.body.classList.add("overflow-hidden")}unlockScroll(){this.bodyOverflowWasHidden||(document.body.classList.remove("overflow-hidden"),document.body.style.paddingRight=this.previousBodyPaddingRight)}restoreFocusTrap(){const cartDrawer=this.opener?.closest("cart-drawer.active"),cartNotification=this.opener?.closest("cart-notification")?.querySelector("#cart-notification.active");if(cartDrawer&&typeof trapFocus=="function"){const containerToTrapFocusOn=cartDrawer.classList.contains("is-empty")?cartDrawer.querySelector(".drawer__inner-empty"):document.getElementById("CartDrawer");if(containerToTrapFocusOn){trapFocus(containerToTrapFocusOn,this.opener);return}}if(cartNotification&&typeof trapFocus=="function"){trapFocus(cartNotification,this.opener);return}typeof removeTrapFocus=="function"?removeTrapFocus(this.opener):this.opener?.focus()}}customElements.define("cart-disclosure-modal",CartDisclosureModal)}
2//# sourceMappingURL=/cdn/shop/t/5/assets/cart-disclosure-modal.js.map?v=154804774285276548271782512539

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.