1var m=Object.defineProperty;var A=s=>{throw TypeError(s)};var $=(s,t,i)=>t in s?m(s,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):s[t]=i;var a=(s,t)=>m(s,"name",{value:t,configurable:!0});var o=(s,t,i)=>$(s,typeof t!="symbol"?t+"":t,i),E=(s,t,i)=>t.has(s)||A("Cannot "+i);var f=(s,t,i)=>t.has(s)?A("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,i);var d=(s,t,i)=>(E(s,t,"access private method"),i);import{f as u,h as p,G as r,i as O,c as L,j as n,b as v,d as C,e as S}from"./site-B0JexaGd.js";var l,h;const e=class e{constructor(t,i={}){f(this,l);o(this,"onModalClick",a(t=>{(t.target.hasAttribute(e.Attributes.CLOSE_TRIGGER)||t.target.nodeName==="use"&&t.target.parentNode.parentNode.hasAttribute(e.Attributes.CLOSE_TRIGGER))&&!this.$element.hasAttribute(e.Attributes.FORCE_ACTION)&&(t.preventDefault(),t.stopPropagation(),this.closeModal())},"onModalClick"));o(this,"onCloseModalId",a(t=>{t===this.id&&this.closeModal()},"onCloseModalId"));o(this,"onMediaQueryChange",a(()=>{this.mql.matches&&this.status===e.Status.ENABLED&&(this.status=e.Status.DISABLED,this.disable()),!this.mql.matches&&this.status===e.Status.DISABLED&&(this.status=e.Status.ENABLED,this.init())},"onMediaQueryChange"));o(this,"onOpenModalId",a(t=>{t===this.id&&this.openModal()},"onOpenModalId"));o(this,"openModal",a(()=>{this.isOpen||(this.$element.classList.remove("hidden"),this.$element.removeAttribute("inert"),this.$element.setAttribute("aria-modal","true"),C(this.$content,{reserveScrollBarGap:!0}),this.focusTrap.activate(),this.addModalEventListeners(),this.isOpen=!0,r.emit(n.IS_OPEN,this.id))},"openModal"));o(this,"closeModal",a(()=>{this.isOpen&&(this.$content.scrollTop=0,this.removeModalEventListeners(),this.focusTrap.deactivate(),S(this.$content),this.$element.setAttribute("inert",""),this.$element.removeAttribute("aria-modal"),this.$element.classList.add("hidden"),this.isOpen=!1,r.emit(n.IS_CLOSED,this.id))},"closeModal"));this.$element=t,this.options={...e.Options,...i},this.options.disableAtScreen&&(this.mql=p(this.options.disableAtScreen),r.on(O[this.options.disableAtScreen],this.onMediaQueryChange)),this.id=this.$element.id,this.isOpen=!1,this.status=this.mql?.matches?e.Status.DISABLED:e.Status.ENABLED,this.init()}static _handleClick(t){const i=t.target.getAttribute(e.Attributes.OPEN_TRIGGER);if(!i)return;const c=e._instances.get(i);c&&(t.preventDefault(),t.stopImmediatePropagation(),c.openModal())}static _handleKeydown(t){if(t.key!=="Escape")return;const i=t.target.closest(`[${u.Attributes.MODULE}="${e.name}"]`);if(!i||i.hasAttribute(e.Attributes.FORCE_ACTION))return;const c=e._instances.get(i.id);c&&(t.stopImmediatePropagation(),c.closeModal())}static _registerInstance(t,i){e._instances.set(t,i)}static _unregisterInstance(t){e._instances.delete(t)}init(){return this.status===e.Status.ENABLED&&this.createChildRefs().layout().enable(),this}createChildRefs(){return this.$container&&this.$content&&this.$overlay?this:(this.$container=this.$element.querySelector(`[${e.Attributes.CONTAINER}]`),this.$content=this.$element.querySelector(`[${e.Attributes.CONTENT}]`),this.$header=this.$element.querySelector(`[${e.Attributes.HEADER}]`),this.$footer=this.$element.querySelector(`[${e.Attributes.FOOTER}]`),this.$overlay=this.$element.querySelector(`[${e.Attributes.OVERLAY}]`),this.$title=this.$element.querySelector(`[${e.Attributes.TITLE}]`),this.focusTrap=L(this.$container,{allowOutsideClick:!this.options.forceAction,preventScroll:!0}),this)}layout(){if(this.$element.className="hidden",this.$element.setAttribute("inert",""),this.$element.setAttribute("role","dialog"),this.options.forceAction&&this.$element.setAttribute(e.Attributes.FORCE_ACTION,"true"),this.$overlay.classList.add(...d(this,l,h).call(this,"overlay")),this.options.forceAction||this.$overlay.setAttribute("aria-controls",this.$element.id),this.$container.setAttribute(u.Attributes.COLOR_THEME,this.options.colorTheme),this.$container.classList.add(...d(this,l,h).call(this,"container")),this.$content.setAttribute("role","document"),this.$content.classList.add(...d(this,l,h).call(this,"content")),this.$header&&this.$header.classList.add(...d(this,l,h).call(this,"header")),this.$title){const t=`${this.id}_ModalTitle`;this.$title.setAttribute("id",t),this.$element.setAttribute("aria-labelledby",t)}return this.$footer&&this.$footer.classList.add(...d(this,l,h).call(this,"footer")),this}enable(){return e._registerInstance(this.id,this),r.on(n.CLOSE_MODAL_ID,this.onCloseModalId),r.on(n.OPEN_MODAL_ID,this.onOpenModalId),this}disable(){return this.$element.className=this.options.hideMarkupAfterDisable?"hidden":"",this.$element.removeAttribute("inert"),this.$element.removeAttribute("aria-modal"),this.$element.removeAttribute("role"),this.$overlay.removeAttribute("class"),this.$overlay.removeAttribute("aria-controls"),this.$container.removeAttribute(u.Attributes.COLOR_THEME),this.$container.removeAttribute("class"),this.$content.removeAttribute("class"),this.$content.removeAttribute("role"),this.$header&&(this.$header.removeAttribute("class"),this.$header.removeAttribute("id"),this.$element.removeAttribute("aria-labelledby")),this.$footer&&this.$footer.removeAttribute("class"),this.focusTrap.deactivate(),v(),e._unregisterInstance(this.id
1),r.off(n.CLOSE_MODAL_ID,this.onCloseModalId),r.off(n.OPEN_MODAL_ID,this.onOpenModalId),this}addModalEventListeners(){this.options.forceAction||this.$element.addEventListener("click",this.onModalClick),r.on(n.FORCE_CLOSE,this.closeModal)}removeModalEventListeners(){this.options.forceAction||this.$element.removeEventListener("click",this.onModalClick),r.off(n.FORCE_CLOSE,this.closeModal)}};l=new WeakSet,h=a(function(t){return[...this.options.classList[t]||[],...this.options.extraClassList[t]||[]]},"#getClassList"),a(e,"Modal"),o(e,"Attributes",{CLOSE_TRIGGER:"data-modal-close",CONTAINER:"data-modal-container",CONTENT:"data-modal-content",FOOTER:"data-modal-footer",FORCE_ACTION:"data-modal-force-action",HEADER:"data-modal-header",OPEN_TRIGGER:"data-modal-trigger",OVERLAY:"data-modal-overlay",TITLE:"data-modal-title"}),o(e,"Status",{ENABLED:"enabled",DISABLED:"disabled"}),o(e,"Options",{colorTheme:"light",disableAtScreen:!1,forceAction:!1,hideMarkupAfterDisable:!1,classList:{container:["absolute","max-h-full","flex","flex-col","overflow-hidden","rounded-t-lg","top-lg-xl","bottom-0","left-0","right-0","md:relative","md:top-auto","md:bottom-auto","md:left-auto","md:right-auto","md:w-full","md:max-w-2xl","md:rounded-lg"],content:["overflow-auto","p-md"],footer:["sticky","bottom-0","mt-auto","p-md","z-20","border-t","border-theme-border-color-weak"],header:["flex","items-baseline","justify-between","gap-md","p-md","border-b","border-theme-border-color-weak"],overlay:["fixed","inset-0","z-50","bg-ac-blue-1000/88%","flex","items-start","justify-center","md:py-xl-2xl"]},extraClassList:{container:void 0,content:void 0,footer:void 0,header:void 0,overlay:void 0}}),o(e,"_instances",new Map),document.addEventListener("click",e._handleClick),document.addEventListener("keydown",e._handleKeydown);let b=e;export{b as default};
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.