PageSourceSearch

https://vintagemenuart.com/cdn/shop/t/29/assets/modal-dialog.js?v=20747059355321374381761600916

js vintagemenuart.com collected 2026-09-24 21:06:07 UTC 3,025 bytes, 2 lines download raw bytes

1/*! Copyright (c) Safe As Milk. All rights reserved. */import A11yDialog from"a11y-dialog";class ModalDialog extends HTMLElement{#dialog;#boundOnOpening;#boundOnClosing;#boundOnShow;#boundOnHide;constructor(){super(),this.movedModalsElementId="moved-modal-elements";const movedModalsElement=document.getElementById(this.movedModalsElementId);Object.hasOwn(this.dataset,"moveToModalsElement")&&movedModalsElement&&movedModalsElement.appendChild(this),this.#boundOnOpening=this.#onOpening.bind(this),this.#boundOnClosing=this.#onClosing.bind(this),this.#boundOnShow=this.#onShow.bind(this),this.#boundOnHide=this.#onHide.bind(this)}connectedCallback(){this.init()}disconnectedCallback(){this.destroy()}get shown(){return this.#dialog.shown}init(){this.#dialog=new A11yDialog(this),this.content=this.querySelector('[role="document"]'),document.querySelectorAll(`[data-a11y-dialog-show="${this.#dialog.id}"]`).forEach((trigger=>{trigger.addEventListener("click",ModalDialog.#onTriggerClick)})),this.#dialog.on("opening",this.#boundOnOpening).on("show",this.#boundOnShow).on("closing",this.#boundOnClosing).on("hide",this.#boundOnHide)}destroy(){document.querySelectorAll(`[data-a11y-dialog-show="${this.#dialog.id}"]`).forEach((trigger=>{trigger.removeEventListener("click",ModalDialog.#onTriggerClick)})),this.#dialog.off("opening",this.#boundOnOpening).off("show",this.#boundOnShow).off("closing",this.#boundOnClosing).off("hide",this.#boundOnHide),this.removeAttribute("aria-modal"),this.removeAttribute("tabindex"),this.removeAttribute("role")}async open(openElementAfterClose=null){return openElementAfterClose&&openElementAfterClose instanceof HTMLElement&&openElementAfterClose.tagName==="MODAL-DIALOG"&&this.#dialog.on("hide",(()=>openElementAfterClose.open()),{once:!0}),this.#dialog.show(),new Promise((resolve=>{this.#dialog.shown?resolve():this.#dialog.on("show",(()=>{resolve()}),{once:!0})}))}openInstantly(){this.content.style.animation="none",this.#dialog.show(),this.content.style.animation=null}async close(){return this.#dialog.hide(),new Promise((resolve=>{this.#dialog.shown?this.#dialog.on("hide",(()=>{resolve()}),{once:!0}):resolve()}))}closeInstantly(){this.content.style.animation="none",this.#dialog.hide(),this.content.style.animation=null}on(type,handler,options){return this.addEventListener(type,handler,options),this}off(type,handler,options){return this.removeEventListener(type,handler,options),this}#onOpening(){this.dispatchEvent(new CustomEvent("on:modal:opening")),document.body.classList.add("u-scroll-disabled")}#onClosing(){this.dispatchEvent(new CustomEvent("on:modal:closing"))}#onShow(){this.dispatchEvent(new CustomEvent("on:modal:opened"))}#onHide(){this.dispatchEvent(new CustomEvent("on:modal:closed")),document.body.classList.remove("u-scroll-disabled")}static#onTriggerClick(event){event.preventDefault()}}customElements.define("modal-dialog",ModalDialog);export default ModalDialog;
2//# sourceMappingURL=/cdn/shop/t/29/assets/modal-dialog.js.map?v=20747059355321374381761600916

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.