vrembem 4.0.0-next.2 → 4.0.0-next.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,10 @@
1
- (function(J,at){typeof exports=="object"&&typeof module<"u"?at(exports):typeof define=="function"&&define.amd?define(["exports"],at):(J=typeof globalThis<"u"?globalThis:J||self,at(J.vrembem={}))})(this,function(J){"use strict";var at=(e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)},A=(e,t,i)=>(at(e,t,"read from private field"),i?i.call(e):t.get(e)),jt=(e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)},X=(e,t,i,n)=>(at(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),i),D;let Ei=class{constructor(t,i){jt(this,D,void 0),this.value=t,X(this,D,i),this.mql=null}get handler(){return A(this,D)}set handler(t){this.mql&&(typeof this.mql.removeEventListener=="function"?this.mql.removeEventListener("change",A(this,D)):this.mql.removeListener(A(this,D))),X(this,D,t)}mount(t,i){return t&&(this.value=t),i&&X(this,D,i),this.value?(this.mql=window.matchMedia(`(min-width: ${this.value})`),typeof this.mql.addEventListener=="function"?this.mql.addEventListener("change",A(this,D)):this.mql.addListener(A(this,D)),A(this,D).call(this,this.mql),this):this}unmount(){return this.mql?(typeof this.mql.removeEventListener=="function"?this.mql.removeEventListener("change",A(this,D)):this.mql.removeListener(A(this,D)),this.value=null,X(this,D,null),this.mql=null,this):this}};D=new WeakMap;let xi=class{constructor(){this.collection=[]}async register(t){return await this.deregister(t),this.collection.push(t),this.collection}async deregister(t){const i=this.collection.findIndex(n=>n===t);if(i>=0){const n=this.collection[i];Object.getOwnPropertyNames(n).forEach(s=>{delete n[s]}),this.collection.splice(i,1)}return this.collection}async registerCollection(t){return await Promise.all(Array.from(t,i=>{this.register(i)})),this.collection}async deregisterCollection(){for(;this.collection.length>0;)await this.deregister(this.collection[0]);return this.collection}get(t,i="id"){return this.collection.find(n=>n[i]===t)}};const f={inert:":not([inert]):not([inert] *)",negTabIndex:':not([tabindex^="-"])',disabled:":not(:disabled)"},Li=[`a[href]${f.inert}${f.negTabIndex}`,`area[href]${f.inert}${f.negTabIndex}`,`input:not([type="hidden"]):not([type="radio"])${f.inert}${f.negTabIndex}${f.disabled}`,`input[type="radio"]${f.inert}${f.negTabIndex}${f.disabled}`,`select${f.inert}${f.negTabIndex}${f.disabled}`,`textarea${f.inert}${f.negTabIndex}${f.disabled}`,`button${f.inert}${f.negTabIndex}${f.disabled}`,`details${f.inert} > summary:first-of-type${f.negTabIndex}`,`iframe${f.inert}${f.negTabIndex}`,`audio[controls]${f.inert}${f.negTabIndex}`,`video[controls]${f.inert}${f.negTabIndex}`,`[contenteditable]${f.inert}${f.negTabIndex}`,`[tabindex]${f.inert}${f.negTabIndex}`];var yt,lt,ct;let Oi=class{constructor(t=null,i="[data-focus]"){jt(this,yt,void 0),jt(this,lt,void 0),jt(this,ct,void 0),this.el=t,this.selectorFocus=i,X(this,lt,ki.bind(this)),X(this,ct,Ti.bind(this))}get focusable(){return A(this,yt)}set focusable(t){X(this,yt,t),A(this,yt).length?(document.removeEventListener("keydown",A(this,ct)),document.addEventListener("keydown",A(this,lt))):(document.removeEventListener("keydown",A(this,lt)),document.addEventListener("keydown",A(this,ct)))}get focusableFirst(){return this.focusable[0]}get focusableLast(){return this.focusable[this.focusable.length-1]}mount(t,i){t&&(this.el=t),i&&(this.selectorFocus=i),this.focusable=this.getFocusable(),this.focus()}unmount(){this.el=null,this.focusable=[],document.removeEventListener("keydown",A(this,lt)),document.removeEventListener("keydown",A(this,ct))}focus(t=this.el,i=this.selectorFocus){(t.querySelector(i)||t).focus()}getFocusable(t=this.el){const i=[],n=document.activeElement,s=t.scrollTop;return t.querySelectorAll(Li.join(",")).forEach(r=>{r.focus(),document.activeElement===r&&i.push(r)}),t.scrollTop=s,n.focus(),i}};yt=new WeakMap,lt=new WeakMap,ct=new WeakMap;function ki(e){(e.key==="Tab"||e.keyCode===9)&&(e.shiftKey?(document.activeElement===this.focusableFirst||document.activeElement===this.el)&&(e.preventDefault(),this.focusableLast.focus()):(document.activeElement===this.focusableLast||document.activeElement===this.el)&&(e.preventDefault(),this.focusableFirst.focus()))}function Ti(e){(e.key==="Tab"||e.keyCode===9)&&e.preventDefault()}function Ai(e,t){const i=(e.getAttribute(`data-${t}`)||"").replace(/'/g,'"');return i?JSON.parse(i):{}}function Ci(){return getComputedStyle(document.body).getPropertyValue("--vrembem-variable-prefix").trim()}function Ii(e,t=!0){const i=localStorage.getItem(e),n=i?JSON.parse(i):{};return{get(s){return s?n[s]:n},set(s,r){return r?n[s]=r:delete n[s],t&&localStorage.setItem(e,JSON.stringify(n)),n}}}function Si(e,t,i){const n=t.nodeType===Node.COMMENT_NODE,s=t.nodeType===Node.ELEMENT_NODE;if(t=n||s?t:document.querySelector(t),n&&(i="after"),!t)throw new Error(`Not a valid teleport reference: '${t}'`);if(typeof t[i]!="function")throw new Error(`Not a valid teleport method: '${i}'`);let r=null;return n||(r=document.createComment("teleported #"+e.id),e.before(r)),t[i](e),n&&t.remove(),r}const Pi=(e,t)=>new Promise(i=>{t.transition?(e.classList.remove(t.stateClosed),e.classList.add(t.stateOpening),e.addEventListener("transitionend",function n(s){s.target==e&&(e.classList.add(t.stateOpened),e.classList.remove(t.stateOpening),i(e),this.removeEventListener("transitionend",n))})):(e.classList.add(t.stateOpened),e.classList.remove(t.stateClosed),i(e))}),qi=(e,t)=>new Promise(i=>{t.transition?(e.classList.add(t.stateClosing),e.classList.remove(t.stateOpened),e.addEventListener("transitionend",function n(s){s.target==e&&(e.classList.remove(t.stateClosing),e.classList.add(t.stateClosed),i(e),this.removeEventListener("transitionend",n))})):(e.classList.add(t.stateClosed),e.classList.remove(t.stateOpened),i(e))});function Di(e,t){t&&document.querySelectorAll(t).forEach(i=>{e?i.style.overflow="hidden":i.style.removeProperty("overflow")})}function Mi(e,t){t&&document.querySelectorAll(t).forEach(i=>{e?(i.inert=!0,i.setAttribute("aria-hidden",!0)):(i.inert=null,i.removeAttribute("aria-hidden"))})}function ji(e,t){Mi(!!e,t.selectorInert),Di(!!e,t.selectorOverflow)}const Wi=Object.freeze(Object.defineProperty({__proto__:null,Breakpoint:Ei,Collection:xi,FocusTrap:Oi,closeTransition:qi,getConfig:Ai,getPrefix:Ci,localStore:Ii,openTransition:Pi,teleport:Si,updateGlobalState:ji},Symbol.toStringTag,{value:"Module"})),Ni={autoInit:!1,stateAttr:"aria-checked",stateValue:"mixed"};let _i=class{constructor(t){this.defaults=Ni,this.settings={...this.defaults,...t},this.__handlerClick=this.handlerClick.bind(this),this.settings.autoInit&&this.init()}init(t=null){t&&(this.settings={...this.settings,...t});const i=`[${this.settings.stateAttr}="${this.settings.stateValue}"]`,n=document.querySelectorAll(i);this.setIndeterminate(n),document.addEventListener("click",this.__handlerClick,!1)}destroy(){document.removeEventListener("click",this.__handlerClick,!1)}handlerClick(t){const i=`[${this.settings.stateAttr}="${this.settings.stateValue}"]`,n=t.target.closest(i);n&&(this.removeAriaState(n),this.setIndeterminate(n))}setAriaState(t,i=this.settings.stateValue){t=t.forEach?t:[t],t.forEach(n=>{n.setAttribute(this.settings.stateAttr,i)})}removeAriaState(t){t=t.forEach?t:[t],t.forEach(i=>{i.removeAttribute(this.settings.stateAttr)})}setIndeterminate(t){t=t.forEach?t:[t],t.forEach(i=>{i.hasAttribute(this.settings.stateAttr)?i.indeterminate=!0:i.indeterminate=!1})}};var Oe=(e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)},Wt=(e,t,i)=>(Oe(e,t,"read from private field"),i?i.call(e):t.get(e)),ke=(e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)},Te=(e,t,i,n)=>(Oe(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),i),Ae=(e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)},C=(e,t,i)=>(Ae(e,t,"read from private field"),i?i.call(e):t.get(e)),Nt=(e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)},Y=(e,t,i,n)=>(Ae(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),i),M;let Fi=class{constructor(t,i){Nt(this,M,void 0),this.value=t,Y(this,M,i),this.mql=null}get handler(){return C(this,M)}set handler(t){this.mql&&(typeof this.mql.removeEventListener=="function"?this.mql.removeEventListener("change",C(this,M)):this.mql.removeListener(C(this,M))),Y(this,M,t)}mount(t,i){return t&&(this.value=t),i&&Y(this,M,i),this.value?(this.mql=window.matchMedia(`(min-width: ${this.value})`),typeof this.mql.addEventListener=="function"?this.mql.addEventListener("change",C(this,M)):this.mql.addListener(C(this,M)),C(this,M).call(this,this.mql),this):this}unmount(){return this.mql?(typeof this.mql.removeEventListener=="function"?this.mql.removeEventListener("change",C(this,M)):this.mql.removeListener(C(this,M)),this.value=null,Y(this,M,null),this.mql=null,this):this}};M=new WeakMap;let Bi=class{constructor(){this.collection=[]}async register(t){return await this.deregister(t),this.collection.push(t),this.collection}async deregister(t){const i=this.collection.findIndex(n=>n===t);if(i>=0){const n=this.collection[i];Object.getOwnPropertyNames(n).forEach(s=>{delete n[s]}),this.collection.splice(i,1)}return this.collection}async registerCollection(t){return await Promise.all(Array.from(t,i=>{this.register(i)})),this.collection}async deregisterCollection(){for(;this.collection.length>0;)await this.deregister(this.collection[0]);return this.collection}get(t,i="id"){return this.collection.find(n=>n[i]===t)}};const p={inert:":not([inert]):not([inert] *)",negTabIndex:':not([tabindex^="-"])',disabled:":not(:disabled)"},Ri=[`a[href]${p.inert}${p.negTabIndex}`,`area[href]${p.inert}${p.negTabIndex}`,`input:not([type="hidden"]):not([type="radio"])${p.inert}${p.negTabIndex}${p.disabled}`,`input[type="radio"]${p.inert}${p.negTabIndex}${p.disabled}`,`select${p.inert}${p.negTabIndex}${p.disabled}`,`textarea${p.inert}${p.negTabIndex}${p.disabled}`,`button${p.inert}${p.negTabIndex}${p.disabled}`,`details${p.inert} > summary:first-of-type${p.negTabIndex}`,`iframe${p.inert}${p.negTabIndex}`,`audio[controls]${p.inert}${p.negTabIndex}`,`video[controls]${p.inert}${p.negTabIndex}`,`[contenteditable]${p.inert}${p.negTabIndex}`,`[tabindex]${p.inert}${p.negTabIndex}`];var wt,dt,ut;let Hi=class{constructor(t=null,i="[data-focus]"){Nt(this,wt,void 0),Nt(this,dt,void 0),Nt(this,ut,void 0),this.el=t,this.selectorFocus=i,Y(this,dt,Vi.bind(this)),Y(this,ut,Ji.bind(this))}get focusable(){return C(this,wt)}set focusable(t){Y(this,wt,t),C(this,wt).length?(document.removeEventListener("keydown",C(this,ut)),document.addEventListener("keydown",C(this,dt))):(document.removeEventListener("keydown",C(this,dt)),document.addEventListener("keydown",C(this,ut)))}get focusableFirst(){return this.focusable[0]}get focusableLast(){return this.focusable[this.focusable.length-1]}mount(t,i){t&&(this.el=t),i&&(this.selectorFocus=i),this.focusable=this.getFocusable(),this.focus()}unmount(){this.el=null,this.focusable=[],document.removeEventListener("keydown",C(this,dt)),document.removeEventListener("keydown",C(this,ut))}focus(t=this.el,i=this.selectorFocus){(t.querySelector(i)||t).focus()}getFocusable(t=this.el){const i=[],n=document.activeElement,s=t.scrollTop;return t.querySelectorAll(Ri.join(",")).forEach(r=>{r.focus(),document.activeElement===r&&i.push(r)}),t.scrollTop=s,n.focus(),i}};wt=new WeakMap,dt=new WeakMap,ut=new WeakMap;function Vi(e){(e.key==="Tab"||e.keyCode===9)&&(e.shiftKey?(document.activeElement===this.focusableFirst||document.activeElement===this.el)&&(e.preventDefault(),this.focusableLast.focus()):(document.activeElement===this.focusableLast||document.activeElement===this.el)&&(e.preventDefault(),this.focusableFirst.focus()))}function Ji(e){(e.key==="Tab"||e.keyCode===9)&&e.preventDefault()}function zi(e,t){const i=(e.getAttribute(`data-${t}`)||"").replace(/'/g,'"');return i?JSON.parse(i):{}}function Ki(){return getComputedStyle(document.body).getPropertyValue("--vrembem-variable-prefix").trim()}function Gi(e,t=!0){const i=localStorage.getItem(e),n=i?JSON.parse(i):{};return{get(s){return s?n[s]:n},set(s,r){return r?n[s]=r:delete n[s],t&&localStorage.setItem(e,JSON.stringify(n)),n}}}const Qi=(e,t)=>new Promise(i=>{t.transition?(e.classList.remove(t.stateClosed),e.classList.add(t.stateOpening),e.addEventListener("transitionend",function n(s){s.target==e&&(e.classList.add(t.stateOpened),e.classList.remove(t.stateOpening),i(e),this.removeEventListener("transitionend",n))})):(e.classList.add(t.stateOpened),e.classList.remove(t.stateClosed),i(e))}),Zi=(e,t)=>new Promise(i=>{t.transition?(e.classList.add(t.stateClosing),e.classList.remove(t.stateOpened),e.addEventListener("transitionend",function n(s){s.target==e&&(e.classList.remove(t.stateClosing),e.classList.add(t.stateClosed),i(e),this.removeEventListener("transitionend",n))})):(e.classList.add(t.stateClosed),e.classList.remove(t.stateOpened),i(e))});function Ui(e,t){t&&document.querySelectorAll(t).forEach(i=>{e?i.style.overflow="hidden":i.style.removeProperty("overflow")})}function Xi(e,t){t&&document.querySelectorAll(t).forEach(i=>{e?(i.inert=!0,i.setAttribute("aria-hidden",!0)):(i.inert=null,i.removeAttribute("aria-hidden"))})}function Xt(e,t){Xi(!!e,t.selectorInert),Ui(!!e,t.selectorOverflow)}const Yi={autoInit:!1,dataOpen:"drawer-open",dataClose:"drawer-close",dataToggle:"drawer-toggle",dataBreakpoint:"drawer-breakpoint",dataConfig:"drawer-config",selectorDrawer:".drawer",selectorDialog:".drawer__dialog",selectorFocus:"[data-focus]",selectorInert:null,selectorOverflow:"body",stateOpened:"is-opened",stateOpening:"is-opening",stateClosing:"is-closing",stateClosed:"is-closed",classModal:"drawer_modal",breakpoints:null,customEventPrefix:"drawer:",eventListeners:!0,store:!0,storeKey:"VB:DrawerState",setTabindex:!0,transition:!0};function tn(e){const t=e.target.closest(`
1
+ (function(K,at){typeof exports=="object"&&typeof module<"u"?at(exports):typeof define=="function"&&define.amd?define(["exports"],at):(K=typeof globalThis<"u"?globalThis:K||self,at(K.vrembem={}))})(this,function(K){"use strict";var at=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},M=(e,t,n)=>(at(e,t,"read from private field"),n?n.call(e):t.get(e)),qt=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Y=(e,t,n,i)=>(at(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n),B;let On=class{constructor(t,n){qt(this,B,void 0),this.value=t,Y(this,B,n),this.mql=null}get handler(){return M(this,B)}set handler(t){this.mql&&this.mql.removeEventListener("change",M(this,B)),Y(this,B,t)}mount(t,n){return t&&(this.value=t),n&&Y(this,B,n),this.value?(this.mql=window.matchMedia(`(min-width: ${this.value})`),this.mql.addEventListener("change",M(this,B)),M(this,B).call(this,this.mql),this):this}unmount(){return this.mql?(this.mql.removeEventListener("change",M(this,B)),this.value=null,Y(this,B,null),this.mql=null,this):this}};B=new WeakMap;let Ln=class{constructor(){this.collection=[]}async register(t){return await this.deregister(t),this.collection.push(t),this.collection}async deregister(t){const n=this.collection.findIndex(i=>i===t);if(n>=0){const i=this.collection[n];Object.getOwnPropertyNames(i).forEach(r=>{delete i[r]}),this.collection.splice(n,1)}return this.collection}async registerCollection(t){return await Promise.all(Array.from(t,n=>{this.register(n)})),this.collection}async deregisterCollection(){for(;this.collection.length>0;)await this.deregister(this.collection[0]);return this.collection}get(t,n="id"){return this.collection.find(i=>i[n]===t)}};const f={inert:":not([inert]):not([inert] *)",negTabIndex:':not([tabindex^="-"])',disabled:":not(:disabled)"},kn=[`a[href]${f.inert}${f.negTabIndex}`,`area[href]${f.inert}${f.negTabIndex}`,`input:not([type="hidden"]):not([type="radio"])${f.inert}${f.negTabIndex}${f.disabled}`,`input[type="radio"]${f.inert}${f.negTabIndex}${f.disabled}`,`select${f.inert}${f.negTabIndex}${f.disabled}`,`textarea${f.inert}${f.negTabIndex}${f.disabled}`,`button${f.inert}${f.negTabIndex}${f.disabled}`,`details${f.inert} > summary:first-of-type${f.negTabIndex}`,`iframe${f.inert}${f.negTabIndex}`,`audio[controls]${f.inert}${f.negTabIndex}`,`video[controls]${f.inert}${f.negTabIndex}`,`[contenteditable]${f.inert}${f.negTabIndex}`,`[tabindex]${f.inert}${f.negTabIndex}`];var yt,lt,ct;let Tn=class{constructor(t=null,n="[data-focus]"){qt(this,yt,void 0),qt(this,lt,void 0),qt(this,ct,void 0),this.el=t,this.selectorFocus=n,Y(this,lt,Sn.bind(this)),Y(this,ct,Cn.bind(this))}get focusable(){return M(this,yt)}set focusable(t){Y(this,yt,t),M(this,yt).length?(document.removeEventListener("keydown",M(this,ct)),document.addEventListener("keydown",M(this,lt))):(document.removeEventListener("keydown",M(this,lt)),document.addEventListener("keydown",M(this,ct)))}get focusableFirst(){return this.focusable[0]}get focusableLast(){return this.focusable[this.focusable.length-1]}mount(t,n){t&&(this.el=t),n&&(this.selectorFocus=n),this.focusable=this.getFocusable(),this.focus()}unmount(){this.el=null,this.focusable=[],document.removeEventListener("keydown",M(this,lt)),document.removeEventListener("keydown",M(this,ct))}focus(t=this.el,n=this.selectorFocus){(t.querySelector(n)||t).focus()}getFocusable(t=this.el){const n=[],i=document.activeElement,r=t.scrollTop;return t.querySelectorAll(kn.join(",")).forEach(s=>{s.focus(),document.activeElement===s&&n.push(s)}),t.scrollTop=r,i.focus(),n}};yt=new WeakMap,lt=new WeakMap,ct=new WeakMap;function Sn(e){(e.key==="Tab"||e.keyCode===9)&&(e.shiftKey?(document.activeElement===this.focusableFirst||document.activeElement===this.el)&&(e.preventDefault(),this.focusableLast.focus()):(document.activeElement===this.focusableLast||document.activeElement===this.el)&&(e.preventDefault(),this.focusableFirst.focus()))}function Cn(e){(e.key==="Tab"||e.keyCode===9)&&e.preventDefault()}function Oe(){return getComputedStyle(document.body).getPropertyValue("--vrembem-prefix").trim()}function Le(e,t=document.body,n=!0){if(n){const r=Oe();r&&!e.includes(`--${r}`)&&(e=e.replace("--",`--${r}`))}const i=getComputedStyle(t).getPropertyValue(e).trim();if(i)return i;throw new Error(`CSS variable "${e}" was not found!`)}function In(e,t){const n=(e.getAttribute(`data-${t}`)||"").replace(/'/g,'"');return n?JSON.parse(n):{}}function An(e,t=!0){const n=localStorage.getItem(e),i=n?JSON.parse(n):{};return{get(r){return r?i[r]:i},set(r,s){return s?i[r]=s:delete i[r],t&&localStorage.setItem(e,JSON.stringify(i)),i}}}function Pn(e,t,n){const i=t.nodeType===Node.COMMENT_NODE,r=t.nodeType===Node.ELEMENT_NODE;if(t=i||r?t:document.querySelector(t),i&&(n="after"),!t)throw new Error(`Not a valid teleport reference: '${t}'`);if(typeof t[n]!="function")throw new Error(`Not a valid teleport method: '${n}'`);let s=null;return i||(s=document.createComment("teleported #"+e.id),e.before(s)),t[n](e),i&&t.remove(),s}function Dn(e,t,n,i="--transition-duration"){return new Promise(r=>{if(typeof i=="string"){const s=Le(i,e),a=!!s.includes("ms");i=parseFloat(s)*(a?1:1e3)}e.classList.remove(t.finish),e.classList.add(n.start),setTimeout(()=>{e.classList.add(n.finish),e.classList.remove(n.start),r(e)},i)})}function Mn(e,t){t&&document.querySelectorAll(t).forEach(n=>{e?n.style.overflow="hidden":n.style.removeProperty("overflow")})}function jn(e,t){t&&document.querySelectorAll(t).forEach(n=>{e?(n.inert=!0,n.setAttribute("aria-hidden",!0)):(n.inert=null,n.removeAttribute("aria-hidden"))})}function qn(e,t){jn(!!e,t.selectorInert),Mn(!!e,t.selectorOverflow)}const Fn=Object.freeze(Object.defineProperty({__proto__:null,Breakpoint:On,Collection:Ln,FocusTrap:Tn,cssVar:Le,getConfig:In,getPrefix:Oe,localStore:An,teleport:Pn,transition:Dn,updateGlobalState:qn},Symbol.toStringTag,{value:"Module"}));var ke=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},Ft=(e,t,n)=>(ke(e,t,"read from private field"),n?n.call(e):t.get(e)),Te=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Se=(e,t,n,i)=>(ke(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n),Ce=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},j=(e,t,n)=>(Ce(e,t,"read from private field"),n?n.call(e):t.get(e)),Nt=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},U=(e,t,n,i)=>(Ce(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n),R;let Nn=class{constructor(t,n){Nt(this,R,void 0),this.value=t,U(this,R,n),this.mql=null}get handler(){return j(this,R)}set handler(t){this.mql&&this.mql.removeEventListener("change",j(this,R)),U(this,R,t)}mount(t,n){return t&&(this.value=t),n&&U(this,R,n),this.value?(this.mql=window.matchMedia(`(min-width: ${this.value})`),this.mql.addEventListener("change",j(this,R)),j(this,R).call(this,this.mql),this):this}unmount(){return this.mql?(this.mql.removeEventListener("change",j(this,R)),this.value=null,U(this,R,null),this.mql=null,this):this}};R=new WeakMap;let Wn=class{constructor(){this.collection=[]}async register(t){return await this.deregister(t),this.collection.push(t),this.collection}async deregister(t){const n=this.collection.findIndex(i=>i===t);if(n>=0){const i=this.collection[n];Object.getOwnPropertyNames(i).forEach(r=>{delete i[r]}),this.collection.splice(n,1)}return this.collection}async registerCollection(t){return await Promise.all(Array.from(t,n=>{this.register(n)})),this.collection}async deregisterCollection(){for(;this.collection.length>0;)await this.deregister(this.collection[0]);return this.collection}get(t,n="id"){return this.collection.find(i=>i[n]===t)}};const p={inert:":not([inert]):not([inert] *)",negTabIndex:':not([tabindex^="-"])',disabled:":not(:disabled)"},_n=[`a[href]${p.inert}${p.negTabIndex}`,`area[href]${p.inert}${p.negTabIndex}`,`input:not([type="hidden"]):not([type="radio"])${p.inert}${p.negTabIndex}${p.disabled}`,`input[type="radio"]${p.inert}${p.negTabIndex}${p.disabled}`,`select${p.inert}${p.negTabIndex}${p.disabled}`,`textarea${p.inert}${p.negTabIndex}${p.disabled}`,`button${p.inert}${p.negTabIndex}${p.disabled}`,`details${p.inert} > summary:first-of-type${p.negTabIndex}`,`iframe${p.inert}${p.negTabIndex}`,`audio[controls]${p.inert}${p.negTabIndex}`,`video[controls]${p.inert}${p.negTabIndex}`,`[contenteditable]${p.inert}${p.negTabIndex}`,`[tabindex]${p.inert}${p.negTabIndex}`];var wt,dt,ut;let Bn=class{constructor(t=null,n="[data-focus]"){Nt(this,wt,void 0),Nt(this,dt,void 0),Nt(this,ut,void 0),this.el=t,this.selectorFocus=n,U(this,dt,Rn.bind(this)),U(this,ut,Vn.bind(this))}get focusable(){return j(this,wt)}set focusable(t){U(this,wt,t),j(this,wt).length?(document.removeEventListener("keydown",j(this,ut)),document.addEventListener("keydown",j(this,dt))):(document.removeEventListener("keydown",j(this,dt)),document.addEventListener("keydown",j(this,ut)))}get focusableFirst(){return this.focusable[0]}get focusableLast(){return this.focusable[this.focusable.length-1]}mount(t,n){t&&(this.el=t),n&&(this.selectorFocus=n),this.focusable=this.getFocusable(),this.focus()}unmount(){this.el=null,this.focusable=[],document.removeEventListener("keydown",j(this,dt)),document.removeEventListener("keydown",j(this,ut))}focus(t=this.el,n=this.selectorFocus){(t.querySelector(n)||t).focus()}getFocusable(t=this.el){const n=[],i=document.activeElement,r=t.scrollTop;return t.querySelectorAll(_n.join(",")).forEach(s=>{s.focus(),document.activeElement===s&&n.push(s)}),t.scrollTop=r,i.focus(),n}};wt=new WeakMap,dt=new WeakMap,ut=new WeakMap;function Rn(e){(e.key==="Tab"||e.keyCode===9)&&(e.shiftKey?(document.activeElement===this.focusableFirst||document.activeElement===this.el)&&(e.preventDefault(),this.focusableLast.focus()):(document.activeElement===this.focusableLast||document.activeElement===this.el)&&(e.preventDefault(),this.focusableFirst.focus()))}function Vn(e){(e.key==="Tab"||e.keyCode===9)&&e.preventDefault()}function Ie(){return getComputedStyle(document.body).getPropertyValue("--vrembem-prefix").trim()}function Hn(e,t=document.body,n=!0){if(n){const r=Ie();r&&!e.includes(`--${r}`)&&(e=e.replace("--",`--${r}`))}const i=getComputedStyle(t).getPropertyValue(e).trim();if(i)return i;throw new Error(`CSS variable "${e}" was not found!`)}function Jn(e,t){const n=(e.getAttribute(`data-${t}`)||"").replace(/'/g,'"');return n?JSON.parse(n):{}}function zn(e,t=!0){const n=localStorage.getItem(e),i=n?JSON.parse(n):{};return{get(r){return r?i[r]:i},set(r,s){return s?i[r]=s:delete i[r],t&&localStorage.setItem(e,JSON.stringify(i)),i}}}function Ae(e,t,n,i="--transition-duration"){return new Promise(r=>{if(typeof i=="string"){const s=Hn(i,e),a=!!s.includes("ms");i=parseFloat(s)*(a?1:1e3)}e.classList.remove(t.finish),e.classList.add(n.start),setTimeout(()=>{e.classList.add(n.finish),e.classList.remove(n.start),r(e)},i)})}function Kn(e,t){t&&document.querySelectorAll(t).forEach(n=>{e?n.style.overflow="hidden":n.style.removeProperty("overflow")})}function Gn(e,t){t&&document.querySelectorAll(t).forEach(n=>{e?(n.inert=!0,n.setAttribute("aria-hidden",!0)):(n.inert=null,n.removeAttribute("aria-hidden"))})}function Xt(e,t){Gn(!!e,t.selectorInert),Kn(!!e,t.selectorOverflow)}const Qn={autoInit:!1,dataOpen:"drawer-open",dataClose:"drawer-close",dataToggle:"drawer-toggle",dataBreakpoint:"drawer-breakpoint",dataConfig:"drawer-config",selectorDrawer:".drawer",selectorDialog:".drawer__dialog",selectorScreen:".drawer",selectorFocus:"[data-focus]",selectorInert:null,selectorOverflow:"body",stateOpened:"is-opened",stateOpening:"is-opening",stateClosing:"is-closing",stateClosed:"is-closed",classModal:"drawer_modal",breakpoints:null,customEventPrefix:"drawer:",eventListeners:!0,store:!0,storeKey:"VB:DrawerState",setTabindex:!0,transition:!0,transitionDuration:"--vb-drawer-transition-duration"};async function Zn(e){const t=e.target.closest(`
2
2
  [data-${this.settings.dataOpen}],
3
3
  [data-${this.settings.dataToggle}],
4
4
  [data-${this.settings.dataClose}]
5
- `);if(t){e.preventDefault(),t.matches(`[data-${this.settings.dataToggle}]`)&&t.getAttribute(`data-${this.settings.dataToggle}`).trim().split(" ").forEach(i=>{const n=this.get(i);n.trigger=t,n.toggle()}),t.matches(`[data-${this.settings.dataOpen}]`)&&t.getAttribute(`data-${this.settings.dataOpen}`).trim().split(" ").forEach(i=>{const n=this.get(i);n.trigger=t,n.open()}),t.matches(`[data-${this.settings.dataClose}]`)&&t.getAttribute(`data-${this.settings.dataClose}`).trim().split(" ").forEach(i=>{if(i){const n=this.get(i);n.trigger=t,n.close()}else{const n=e.target.closest(this.settings.selectorDrawer);n&&this.close(n)}});return}e.target.matches(this.settings.selectorDrawer)&&this.close(e.target.id)}function en(e){if(e.key==="Escape"){const t=this.activeModal;t&&this.close(t)}}async function Yt(e,t=!0){if(!e)return this.collection;const i=this.collection.findIndex(n=>n.id===e.id);if(i>=0){const n=this.collection[i];t&&n.state==="opened"&&await n.close(!1),this.store.set(n.id),n.unmountBreakpoint(),Object.getOwnPropertyNames(n).forEach(s=>{delete n[s]}),this.collection.splice(i,1)}return this.collection}function nn(e){const t=Ki(),i=e.getAttribute(`data-${this.settings.dataBreakpoint}`);return this.settings.breakpoints&&this.settings.breakpoints[i]?this.settings.breakpoints[i]:getComputedStyle(document.body).getPropertyValue(`--${t}breakpoint-${i}`).trim()?getComputedStyle(document.body).getPropertyValue(`--${t}breakpoint-${i}`).trim():i}function te(e){const t=typeof e=="string"?this.get(e):this.get(e.id);if(t)return t;throw new Error(`Drawer not found in collection with id of "${e.id||e}".`)}function Ce(e){return typeof e=="string"?e:typeof e.hasAttribute=="function"?e.hasAttribute(`data-${this.settings.dataOpen}`)?e.getAttribute(`data-${this.settings.dataOpen}`):e.hasAttribute(`data-${this.settings.dataClose}`)?e.getAttribute(`data-${this.settings.dataClose}`)||!1:e.hasAttribute(`data-${this.settings.dataToggle}`)?e.getAttribute(`data-${this.settings.dataToggle}`):e.closest(this.settings.selectorDrawer)?(e=e.closest(this.settings.selectorDrawer),e.id||!1):!1:e.id?e.id:!1}function sn(e){const t=Ce.call(this,e);if(t){const i=document.querySelector(`#${t}`),n=i?i.querySelector(this.settings.selectorDialog):null;return!i&&!n?{error:new Error(`No drawer elements found using the ID: "${t}".`)}:n?{drawer:i,dialog:n}:{error:new Error("Drawer is missing dialog element.")}}else return{error:new Error("Could not resolve the drawer ID.")}}async function Ie(e){this.store.get(e.id)?this.store.get(e.id)==="opened"?await e.open(!1,!1):await e.close(!1,!1):e.el.classList.contains(this.settings.stateOpened)?e.state="opened":(e.el.classList.remove(this.settings.stateOpening),e.el.classList.remove(this.settings.stateClosing),e.el.classList.add(this.settings.stateClosed))}function Se(e){e.state==="opened"?e.mode==="modal"?this.focusTrap.mount(e.dialog,this.settings.selectorFocus):this.focusTrap.focus(e.dialog,this.settings.selectorFocus):(e.trigger&&(e.trigger.focus(),e.trigger=null),this.focusTrap.unmount())}async function ee(e,t,i=!0){const n=te.call(this,e),s={...this.settings,...n.settings};return t!==void 0&&(s.transition=t),n.state==="closed"&&(n.state="opening",await Qi(n.el,s),n.mode==="modal"&&Xt(!0,s),n.state="opened"),i&&Se.call(this,n),n.el.dispatchEvent(new CustomEvent(s.customEventPrefix+"opened",{detail:this,bubbles:!0})),n}async function _t(e,t,i=!0){const n=te.call(this,e),s={...this.settings,...n.settings};return t!==void 0&&(s.transition=t),n.state==="opened"&&(n.state="closing",document.activeElement.blur(),await Zi(n.el,s),n.mode==="modal"&&Xt(!1,s),i&&Se.call(this,n),n.state="closed",n.el.dispatchEvent(new CustomEvent(s.customEventPrefix+"closed",{detail:this,bubbles:!0}))),n}async function Pe(e,t,i){const n=te.call(this,e);return n.state==="closed"?ee.call(this,n,t,i):_t.call(this,n,t,i)}function rn(e){switch(e.mode){case"inline":return on.call(this,e);case"modal":return an.call(this,e);default:throw new Error(`"${e.mode}" is not a valid drawer mode.`)}}async function on(e){return e.el.classList.remove(e.getSetting("classModal")),e.dialog.removeAttribute("aria-modal"),Xt(!1,{...this.settings,...e.settings}),this.focusTrap.unmount(),await Ie.call(this,e),e.el.dispatchEvent(new CustomEvent(e.getSetting("customEventPrefix")+"switchMode",{detail:this,bubbles:!0})),e}async function an(e){return e.el.classList.add(e.getSetting("classModal")),e.dialog.setAttribute("aria-modal","true"),!this.store.get(e.id)&&e.el.classList.contains(e.getSetting("stateOpened"))&&this.store.set(e.id,"opened"),await _t.call(this,e,!1,!1),e.el.dispatchEvent(new CustomEvent(e.getSetting("customEventPrefix")+"switchMode",{detail:this,bubbles:!0})),e}async function ln(e,t){await Yt.call(this,e,!1);const i=this,n=new Fi,s={open(o,c){return ee.call(i,this,o,c)},close(o,c){return _t.call(i,this,o,c)},toggle(o,c){return Pe.call(i,this,o,c)},deregister(){return Yt.call(i,this)},mountBreakpoint(){const o=this.breakpoint,c=this.handleBreakpoint.bind(this);return n.mount(o,c),this},unmountBreakpoint(){return n.unmount(),this},handleBreakpoint(o){return this.mode=o.matches?"inline":"modal",this},getSetting(o){return o in this.settings?this.settings[o]:i.settings[o]}},r={id:e.id,el:e,dialog:t,trigger:null,settings:zi(e,this.settings.dataConfig),get breakpoint(){return nn.call(i,e)},get state(){return a},set state(o){a=o,(o==="opened"||o==="closed")&&this.mode==="inline"&&i.store.set(this.id,this.state)},get mode(){return l},set mode(o){l=o,rn.call(i,this)},...s};let a=e.classList.contains(r.getSetting("stateOpened"))?"opened":"closed",l=e.classList.contains(r.getSetting("classModal"))?"modal":"inline";return r.mode==="modal"?r.dialog.setAttribute("aria-modal","true"):r.dialog.removeAttribute("aria-modal"),r.getSetting("setTabindex")&&r.dialog.setAttribute("tabindex","-1"),this.collection.push(r),r.breakpoint?r.mountBreakpoint():await Ie.call(this,r),r}var $t,Et;let cn=class extends Bi{constructor(t){super(),ke(this,$t,void 0),ke(this,Et,void 0),this.defaults=Yi,this.settings={...this.defaults,...t},this.focusTrap=new Hi,this.store=Gi(this.settings.storeKey,this.settings.store),Te(this,$t,tn.bind(this)),Te(this,Et,en.bind(this)),this.settings.autoInit&&this.init()}get activeModal(){return this.collection.find(t=>t.state==="opened"&&t.mode==="modal")}async init(t=null){t&&(this.settings={...this.settings,...t});const i=document.querySelectorAll(this.settings.selectorDrawer);return await this.registerCollection(i),this.settings.eventListeners&&this.initEventListeners(),this}async destroy(){return await this.deregisterCollection(),this.settings.eventListeners&&this.destroyEventListeners(),this}initEventListeners(){document.addEventListener("click",Wt(this,$t),!1),document.addEventListener("keydown",Wt(this,Et),!1)}destroyEventListeners(){document.removeEventListener("click",Wt(this,$t),!1),document.removeEventListener("keydown",Wt(this,Et),!1)}register(t){const i=sn.call(this,t);return i.error?Promise.reject(i.error):ln.call(this,i.drawer,i.dialog)}deregister(t){const i=this.get(Ce.call(this,t));return Yt.call(this,i)}open(t,i,n){return ee.call(this,t,i,n)}close(t,i,n){return _t.call(this,t,i,n)}toggle(t,i,n){return Pe.call(this,t,i,n)}};$t=new WeakMap,Et=new WeakMap;var qe=(e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)},Ft=(e,t,i)=>(qe(e,t,"read from private field"),i?i.call(e):t.get(e)),De=(e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)},Me=(e,t,i,n)=>(qe(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),i),je=(e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)},Z=(e,t,i)=>(je(e,t,"read from private field"),i?i.call(e):t.get(e)),ie=(e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)},ne=(e,t,i,n)=>(je(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),i);class dn{constructor(){this.collection=[]}async register(t){return await this.deregister(t),this.collection.push(t),this.collection}async deregister(t){const i=this.collection.findIndex(n=>n===t);if(i>=0){const n=this.collection[i];Object.getOwnPropertyNames(n).forEach(s=>{delete n[s]}),this.collection.splice(i,1)}return this.collection}async registerCollection(t){return await Promise.all(Array.from(t,i=>{this.register(i)})),this.collection}async deregisterCollection(){for(;this.collection.length>0;)await this.deregister(this.collection[0]);return this.collection}get(t,i="id"){return this.collection.find(n=>n[i]===t)}}const g={inert:":not([inert]):not([inert] *)",negTabIndex:':not([tabindex^="-"])',disabled:":not(:disabled)"},un=[`a[href]${g.inert}${g.negTabIndex}`,`area[href]${g.inert}${g.negTabIndex}`,`input:not([type="hidden"]):not([type="radio"])${g.inert}${g.negTabIndex}${g.disabled}`,`input[type="radio"]${g.inert}${g.negTabIndex}${g.disabled}`,`select${g.inert}${g.negTabIndex}${g.disabled}`,`textarea${g.inert}${g.negTabIndex}${g.disabled}`,`button${g.inert}${g.negTabIndex}${g.disabled}`,`details${g.inert} > summary:first-of-type${g.negTabIndex}`,`iframe${g.inert}${g.negTabIndex}`,`audio[controls]${g.inert}${g.negTabIndex}`,`video[controls]${g.inert}${g.negTabIndex}`,`[contenteditable]${g.inert}${g.negTabIndex}`,`[tabindex]${g.inert}${g.negTabIndex}`];var xt,ht,ft;let hn=class{constructor(t=null,i="[data-focus]"){ie(this,xt,void 0),ie(this,ht,void 0),ie(this,ft,void 0),this.el=t,this.selectorFocus=i,ne(this,ht,fn.bind(this)),ne(this,ft,pn.bind(this))}get focusable(){return Z(this,xt)}set focusable(t){ne(this,xt,t),Z(this,xt).length?(document.removeEventListener("keydown",Z(this,ft)),document.addEventListener("keydown",Z(this,ht))):(document.removeEventListener("keydown",Z(this,ht)),document.addEventListener("keydown",Z(this,ft)))}get focusableFirst(){return this.focusable[0]}get focusableLast(){return this.focusable[this.focusable.length-1]}mount(t,i){t&&(this.el=t),i&&(this.selectorFocus=i),this.focusable=this.getFocusable(),this.focus()}unmount(){this.el=null,this.focusable=[],document.removeEventListener("keydown",Z(this,ht)),document.removeEventListener("keydown",Z(this,ft))}focus(t=this.el,i=this.selectorFocus){(t.querySelector(i)||t).focus()}getFocusable(t=this.el){const i=[],n=document.activeElement,s=t.scrollTop;return t.querySelectorAll(un.join(",")).forEach(r=>{r.focus(),document.activeElement===r&&i.push(r)}),t.scrollTop=s,n.focus(),i}};xt=new WeakMap,ht=new WeakMap,ft=new WeakMap;function fn(e){(e.key==="Tab"||e.keyCode===9)&&(e.shiftKey?(document.activeElement===this.focusableFirst||document.activeElement===this.el)&&(e.preventDefault(),this.focusableLast.focus()):(document.activeElement===this.focusableLast||document.activeElement===this.el)&&(e.preventDefault(),this.focusableFirst.focus()))}function pn(e){(e.key==="Tab"||e.keyCode===9)&&e.preventDefault()}function gn(e,t){const i=(e.getAttribute(`data-${t}`)||"").replace(/'/g,'"');return i?JSON.parse(i):{}}function We(e,t,i){const n=t.nodeType===Node.COMMENT_NODE,s=t.nodeType===Node.ELEMENT_NODE;if(t=n||s?t:document.querySelector(t),n&&(i="after"),!t)throw new Error(`Not a valid teleport reference: '${t}'`);if(typeof t[i]!="function")throw new Error(`Not a valid teleport method: '${i}'`);let r=null;return n||(r=document.createComment("teleported #"+e.id),e.before(r)),t[i](e),n&&t.remove(),r}const mn=(e,t)=>new Promise(i=>{t.transition?(e.classList.remove(t.stateClosed),e.classList.add(t.stateOpening),e.addEventListener("transitionend",function n(s){s.target==e&&(e.classList.add(t.stateOpened),e.classList.remove(t.stateOpening),i(e),this.removeEventListener("transitionend",n))})):(e.classList.add(t.stateOpened),e.classList.remove(t.stateClosed),i(e))}),vn=(e,t)=>new Promise(i=>{t.transition?(e.classList.add(t.stateClosing),e.classList.remove(t.stateOpened),e.addEventListener("transitionend",function n(s){s.target==e&&(e.classList.remove(t.stateClosing),e.classList.add(t.stateClosed),i(e),this.removeEventListener("transitionend",n))})):(e.classList.add(t.stateClosed),e.classList.remove(t.stateOpened),i(e))});function bn(e,t){t&&document.querySelectorAll(t).forEach(i=>{e?i.style.overflow="hidden":i.style.removeProperty("overflow")})}function yn(e,t){t&&document.querySelectorAll(t).forEach(i=>{e?(i.inert=!0,i.setAttribute("aria-hidden",!0)):(i.inert=null,i.removeAttribute("aria-hidden"))})}function wn(e,t){yn(!!e,t.selectorInert),bn(!!e,t.selectorOverflow)}const $n={autoInit:!1,dataOpen:"modal-open",dataClose:"modal-close",dataReplace:"modal-replace",dataConfig:"modal-config",selectorModal:".modal",selectorDialog:".modal__dialog",selectorRequired:'[role="alertdialog"]',selectorFocus:"[data-focus]",selectorInert:null,selectorOverflow:"body",stateOpened:"is-opened",stateOpening:"is-opening",stateClosing:"is-closing",stateClosed:"is-closed",customEventPrefix:"modal:",eventListeners:!0,teleport:null,teleportMethod:"append",setTabindex:!0,transition:!0};function se(e){const t=typeof e=="string"?this.get(e):this.get(e.id);if(t)return t;throw new Error(`Modal not found in collection with id of "${e.id||e}".`)}function Bt(e){return typeof e=="string"?e:typeof e.hasAttribute=="function"?e.hasAttribute(`data-${this.settings.dataOpen}`)?e.getAttribute(`data-${this.settings.dataOpen}`):e.hasAttribute(`data-${this.settings.dataClose}`)?e.getAttribute(`data-${this.settings.dataClose}`)||!1:e.hasAttribute(`data-${this.settings.dataReplace}`)?e.getAttribute(`data-${this.settings.dataReplace}`):e.closest(this.settings.selectorModal)?(e=e.closest(this.settings.selectorModal),e.id||!1):!1:e.id?e.id:!1}function En(e){const t=Bt.call(this,e);if(t){const i=document.querySelector(`#${t}`),n=i?i.querySelector(this.settings.selectorDialog):null;return!i&&!n?{error:new Error(`No modal elements found using the ID: "${t}".`)}:n?{modal:i,dialog:n}:{error:new Error("Modal is missing dialog element.")}}else return{error:new Error("Could not resolve the modal ID.")}}function Rt(){this.active?this.focusTrap.mount(this.active.dialog,this.settings.selectorFocus):(this.trigger&&(this.trigger.focus(),this.trigger=null),this.focusTrap.unmount())}async function xn(e){let t=e.target.closest(`[data-${this.settings.dataOpen}], [data-${this.settings.dataReplace}]`);if(t){e.preventDefault(),e.target.closest(this.settings.selectorModal)||(this.trigger=t);const i=this.get(Bt.call(this,t));return t.matches(`[data-${this.settings.dataOpen}]`)?i.open():i.replace()}if(t=e.target.closest(`[data-${this.settings.dataClose}]`),t){e.preventDefault();const i=t.getAttribute(`data-${this.settings.dataClose}`);return i==="*"?this.closeAll():this.close(i)}if(e.target.matches(this.settings.selectorModal)&&!e.target.querySelector(this.settings.selectorRequired))return this.close(Bt.call(this,e.target))}function Ln(e){if(e.key==="Escape"&&this.active&&!this.active.dialog.matches(this.settings.selectorRequired))return this.close()}async function re(e,t=!0){if(!e)return this.collection;const i=this.collection.findIndex(n=>n.id===e.id);if(i>=0){const n=this.collection[i];t&&n.state==="opened"?await n.close(!1):this.stack.remove(n),n.getSetting("teleport")&&n.teleportReturn(),Object.getOwnPropertyNames(n).forEach(s=>{delete n[s]}),this.collection.splice(i,1)}return this.collection}async function oe(e,t,i=!0){const n=se.call(this,e),s={...this.settings,...n.settings};return t!==void 0&&(s.transition=t),this.stack.moveToTop(n),n.state==="closed"&&(n.state="opening",this.stack.add(n),await mn(n.el,s),n.state="opened"),i&&Rt.call(this),n.el.dispatchEvent(new CustomEvent(s.customEventPrefix+"opened",{detail:this,bubbles:!0})),n}async function ae(e,t,i=!0){const n=e?se.call(this,e):this.active;if(n&&n.state==="opened"){n.state="closing";const s={...this.settings,...n.settings};t!==void 0&&(s.transition=t),document.activeElement.blur(),await vn(n.el,s),this.stack.remove(n),i&&Rt.call(this),n.state="closed",n.el.dispatchEvent(new CustomEvent(s.customEventPrefix+"closed",{detail:this,bubbles:!0}))}return n}async function le(e,t){const i=[];return await Promise.all(this.stack.value.map(async n=>{e&&e===n.id?Promise.resolve():i.push(await ae.call(this,n,t,!1)),n.trigger=null})),i}async function Ne(e,t,i=!0){const n=se.call(this,e);let s,r;return n.state==="opened"?(s=n,r=await le.call(this,n.id,t)):(s=oe.call(this,n,t,!1),r=le.call(this,!1,t),await Promise.all([s,r])),i&&Rt.call(this),{opened:s,closed:r}}async function On(e,t){await re.call(this,e,!1);const i=this,n={open(r,a){return oe.call(i,this,r,a)},close(r,a){return ae.call(i,this,r,a)},replace(r,a){return Ne.call(i,this,r,a)},deregister(){return re.call(i,this)},teleport(r=this.getSetting("teleport"),a=this.getSetting("teleportMethod")){return this.returnRef?(console.error("Element has already been teleported:",this.el),!1):(this.returnRef=We(this.el,r,a),this.el)},teleportReturn(){return this.returnRef?(this.returnRef=We(this.el,this.returnRef),this.el):(console.error("No return reference found:",this.el),!1)},getSetting(r){return r in this.settings?this.settings[r]:i.settings[r]}},s={id:e.id,state:"closed",el:e,dialog:t,returnRef:null,settings:gn(e,this.settings.dataConfig),...n};return s.dialog.setAttribute("aria-modal","true"),s.dialog.hasAttribute("role")||s.dialog.setAttribute("role","dialog"),s.getSetting("setTabindex")&&s.dialog.setAttribute("tabindex","-1"),s.getSetting("teleport")&&s.teleport(),this.collection.push(s),s.el.classList.contains(this.settings.stateOpened)?await s.open(!1):(s.el.classList.remove(this.settings.stateOpening),s.el.classList.remove(this.settings.stateClosing),s.el.classList.add(this.settings.stateClosed)),s}function kn(e){const t=[];return{get value(){return[...t]},get top(){return t[t.length-1]},updateIndex(){t.forEach((i,n)=>{i.el.style.zIndex=null;const s=getComputedStyle(i.el)["z-index"];i.el.style.zIndex=parseInt(s)+n+1})},updateGlobalState(){wn(this.top,e),this.updateIndex()},add(i){i.el.style.zIndex=null;const n=getComputedStyle(i.el)["z-index"];i.el.style.zIndex=parseInt(n)+t.length+1,t.push(i),this.updateGlobalState()},remove(i){const n=t.findIndex(s=>s.id===i.id);n>=0&&(i.el.style.zIndex=null,t.splice(n,1),this.updateGlobalState())},moveToTop(i){const n=t.findIndex(s=>s.id===i.id);n>=0&&(t.splice(n,1),this.add(i))}}}var Lt,Ot;class Tn extends dn{constructor(t){super(),De(this,Lt,void 0),De(this,Ot,void 0),this.defaults=$n,this.settings={...this.defaults,...t},this.trigger=null,this.focusTrap=new hn,this.stack=kn(this.settings),Me(this,Lt,xn.bind(this)),Me(this,Ot,Ln.bind(this)),this.settings.autoInit&&this.init()}get active(){return this.stack.top}async init(t){t&&(this.settings={...this.settings,...t});const i=document.querySelectorAll(this.settings.selectorModal);return await this.registerCollection(i),this.settings.eventListeners&&this.initEventListeners(),this}async destroy(){return this.trigger=null,await this.deregisterCollection(),this.settings.eventListeners&&this.destroyEventListeners(),this}initEventListeners(){document.addEventListener("click",Ft(this,Lt),!1),document.addEventListener("keydown",Ft(this,Ot),!1)}destroyEventListeners(){document.removeEventListener("click",Ft(this,Lt),!1),document.removeEventListener("keydown",Ft(this,Ot),!1)}register(t){const i=En.call(this,t);return i.error?Promise.reject(i.error):On.call(this,i.modal,i.dialog)}deregister(t){const i=this.get(Bt.call(this,t));return re.call(this,i)}open(t,i,n){return oe.call(this,t,i,n)}close(t,i,n){return ae.call(this,t,i,n)}replace(t,i,n){return Ne.call(this,t,i,n)}async closeAll(t=!1,i,n=!0){const s=await le.call(this,t,i);return n&&Rt.call(this),s}}Lt=new WeakMap,Ot=new WeakMap;var _e=(e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)},Fe=(e,t,i)=>(_e(e,t,"read from private field"),i?i.call(e):t.get(e)),An=(e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)},Cn=(e,t,i,n)=>(_e(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),i);class In{constructor(){this.collection=[]}async register(t){return await this.deregister(t),this.collection.push(t),this.collection}async deregister(t){const i=this.collection.findIndex(n=>n===t);if(i>=0){const n=this.collection[i];Object.getOwnPropertyNames(n).forEach(s=>{delete n[s]}),this.collection.splice(i,1)}return this.collection}async registerCollection(t){return await Promise.all(Array.from(t,i=>{this.register(i)})),this.collection}async deregisterCollection(){for(;this.collection.length>0;)await this.deregister(this.collection[0]);return this.collection}get(t,i="id"){return this.collection.find(n=>n[i]===t)}}function Sn(){return getComputedStyle(document.body).getPropertyValue("--vrembem-variable-prefix").trim()}const Pn={autoInit:!1,selectorPopover:".popover",selectorArrow:".popover__arrow",stateActive:"is-active",eventListeners:!0,eventType:"click",placement:"bottom"};function Be(e,t){const i=getComputedStyle(e),n={placement:t.placement,event:t.eventType,offset:0,"overflow-padding":0,"flip-padding":0,"arrow-element":t.selectorArrow,"arrow-padding":0};for(const s in n){const r=Sn(),a=i.getPropertyValue(`--${r}popover-${s}`).trim();a&&(n[s]=a)}return n}function ce(e){let t;const i=typeof e=="string"?e.trim().split(" "):[e];switch(i.forEach(function(n,s){i[s]=parseInt(n,10)}),i.length){case 1:t=i[0];break;case 2:t={top:i[0],right:i[1],bottom:i[0],left:i[1]};break;case 3:t={top:i[0],right:i[1],bottom:i[2],left:i[1]};break;case 4:t={top:i[0],right:i[1],bottom:i[2],left:i[3]};break;default:t=!1;break}return t}function qn(e){return[{name:"offset",options:{offset:[0,parseInt(e.offset,10)]}},{name:"preventOverflow",options:{padding:ce(e["overflow-padding"])}},{name:"flip",options:{padding:ce(e["flip-padding"])}},{name:"arrow",options:{element:e["arrow-element"],padding:ce(e["arrow-padding"])}}]}function Re(e){const t=typeof e=="string"?this.get(e):this.get(e.id);if(t)return t;throw new Error(`Popover not found in collection with id of "${e}".`)}function He(e){return typeof e=="string"?e:typeof e.hasAttribute=="function"?e.closest(this.settings.selectorPopover)?(e=e.closest(this.settings.selectorPopover),e.id):e.hasAttribute("aria-controls")?e.getAttribute("aria-controls"):e.hasAttribute("aria-describedby")?e.getAttribute("aria-describedby"):!1:e.id?e.id:!1}function Dn(e){const t=He.call(this,e);if(t){const i=document.querySelector(`#${t}`),n=document.querySelector(`[aria-controls="${t}"]`)||document.querySelector(`[aria-describedby="${t}"]`);return!n&&!i?{error:new Error(`No popover elements found using the ID: "${t}".`)}:n?i?{popover:i,trigger:n}:{error:new Error("No popover associated with the provided popover trigger.")}:{error:new Error("No popover trigger associated with the provided popover.")}}else return{error:new Error("Could not resolve the popover ID.")}}async function de(e){const t=e?Re.call(this,e):await Ve.call(this);return t&&t.state==="opened"&&(t.el.classList.remove(this.settings.stateActive),t.trigger.hasAttribute("aria-controls")&&t.trigger.setAttribute("aria-expanded","false"),t.popper.setOptions({modifiers:[{name:"eventListeners",enabled:!1}]}),t.state="closed",t.trigger===this.trigger&&(this.trigger=null)),t}async function Ve(){const e=[];return await Promise.all(this.collection.map(async t=>{t.state==="opened"&&e.push(await de.call(this,t))})),e}function Je(e){e.state=="opened"&&setTimeout(()=>{const t=e.el.closest(":hover")===e.el||e.trigger.closest(":hover")===e.trigger,i=document.activeElement.closest(`#${e.id}, [aria-controls="${e.id}"], [aria-describedby="${e.id}"]`);return!t&&!i&&e.close(),e},1)}function Mn(e){e.state==="opened"?e.close():(this.trigger=e.trigger,e.open(),ze.call(this,e))}function jn(e){switch(e.key){case"Escape":this.trigger&&this.trigger.focus(),Ve.call(this);return;case"Tab":this.collection.forEach(t=>{Je.call(this,t)});return;default:return}}function ze(e){const t=this;document.addEventListener("click",function i(n){n.target.closest(`#${e.id}, [aria-controls="${e.id}"], [aria-describedby="${e.id}"]`)?e.el&&!e.el.classList.contains(t.settings.stateActive)&&this.removeEventListener("click",i):(e.el&&e.el.classList.contains(t.settings.stateActive)&&e.close(),this.removeEventListener("click",i))})}var j="top",F="bottom",B="right",W="left",ue="auto",kt=[j,F,B,W],pt="start",Tt="end",Wn="clippingParents",Ke="viewport",At="popper",Nn="reference",Ge=kt.reduce(function(e,t){return e.concat([t+"-"+pt,t+"-"+Tt])},[]),Qe=[].concat(kt,[ue]).reduce(function(e,t){return e.concat([t,t+"-"+pt,t+"-"+Tt])},[]),_n="beforeRead",Fn="read",Bn="afterRead",Rn="beforeMain",Hn="main",Vn="afterMain",Jn="beforeWrite",zn="write",Kn="afterWrite",Gn=[_n,Fn,Bn,Rn,Hn,Vn,Jn,zn,Kn];function z(e){return e?(e.nodeName||"").toLowerCase():null}function N(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function tt(e){var t=N(e).Element;return e instanceof t||e instanceof Element}function R(e){var t=N(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function he(e){if(typeof ShadowRoot>"u")return!1;var t=N(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Qn(e){var t=e.state;Object.keys(t.elements).forEach(function(i){var n=t.styles[i]||{},s=t.attributes[i]||{},r=t.elements[i];!R(r)||!z(r)||(Object.assign(r.style,n),Object.keys(s).forEach(function(a){var l=s[a];l===!1?r.removeAttribute(a):r.setAttribute(a,l===!0?"":l)}))})}function Zn(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow),function(){Object.keys(t.elements).forEach(function(n){var s=t.elements[n],r=t.attributes[n]||{},a=Object.keys(t.styles.hasOwnProperty(n)?t.styles[n]:i[n]),l=a.reduce(function(o,c){return o[c]="",o},{});!R(s)||!z(s)||(Object.assign(s.style,l),Object.keys(r).forEach(function(o){s.removeAttribute(o)}))})}}const Un={name:"applyStyles",enabled:!0,phase:"write",fn:Qn,effect:Zn,requires:["computeStyles"]};function K(e){return e.split("-")[0]}var et=Math.max,Ht=Math.min,gt=Math.round;function fe(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function Ze(){return!/^((?!chrome|android).)*safari/i.test(fe())}function mt(e,t,i){t===void 0&&(t=!1),i===void 0&&(i=!1);var n=e.getBoundingClientRect(),s=1,r=1;t&&R(e)&&(s=e.offsetWidth>0&&gt(n.width)/e.offsetWidth||1,r=e.offsetHeight>0&&gt(n.height)/e.offsetHeight||1);var a=tt(e)?N(e):window,l=a.visualViewport,o=!Ze()&&i,c=(n.left+(o&&l?l.offsetLeft:0))/s,d=(n.top+(o&&l?l.offsetTop:0))/r,b=n.width/s,v=n.height/r;return{width:b,height:v,top:d,right:c+b,bottom:d+v,left:c,x:c,y:d}}function pe(e){var t=mt(e),i=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-i)<=1&&(i=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:i,height:n}}function Ue(e,t){var i=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(i&&he(i)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function G(e){return N(e).getComputedStyle(e)}function Xn(e){return["table","td","th"].indexOf(z(e))>=0}function U(e){return((tt(e)?e.ownerDocument:e.document)||window.document).documentElement}function Vt(e){return z(e)==="html"?e:e.assignedSlot||e.parentNode||(he(e)?e.host:null)||U(e)}function Xe(e){return!R(e)||G(e).position==="fixed"?null:e.offsetParent}function Yn(e){var t=/firefox/i.test(fe()),i=/Trident/i.test(fe());if(i&&R(e)){var n=G(e);if(n.position==="fixed")return null}var s=Vt(e);for(he(s)&&(s=s.host);R(s)&&["html","body"].indexOf(z(s))<0;){var r=G(s);if(r.transform!=="none"||r.perspective!=="none"||r.contain==="paint"||["transform","perspective"].indexOf(r.willChange)!==-1||t&&r.willChange==="filter"||t&&r.filter&&r.filter!=="none")return s;s=s.parentNode}return null}function Ct(e){for(var t=N(e),i=Xe(e);i&&Xn(i)&&G(i).position==="static";)i=Xe(i);return i&&(z(i)==="html"||z(i)==="body"&&G(i).position==="static")?t:i||Yn(e)||t}function ge(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function It(e,t,i){return et(e,Ht(t,i))}function ts(e,t,i){var n=It(e,t,i);return n>i?i:n}function Ye(){return{top:0,right:0,bottom:0,left:0}}function ti(e){return Object.assign({},Ye(),e)}function ei(e,t){return t.reduce(function(i,n){return i[n]=e,i},{})}var es=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,ti(typeof e!="number"?e:ei(e,kt))};function is(e){var t,i=e.state,n=e.name,s=e.options,r=i.elements.arrow,a=i.modifiersData.popperOffsets,l=K(i.placement),o=ge(l),c=[W,B].indexOf(l)>=0,d=c?"height":"width";if(!(!r||!a)){var b=es(s.padding,i),v=pe(r),h=o==="y"?j:W,$=o==="y"?F:B,u=i.rects.reference[d]+i.rects.reference[o]-a[o]-i.rects.popper[d],w=a[o]-i.rects.reference[o],E=Ct(r),L=E?o==="y"?E.clientHeight||0:E.clientWidth||0:0,O=u/2-w/2,m=b[h],y=L-v[d]-b[$],x=L/2-v[d]/2+O,k=It(m,x,y),T=o;i.modifiersData[n]=(t={},t[T]=k,t.centerOffset=k-x,t)}}function ns(e){var t=e.state,i=e.options,n=i.element,s=n===void 0?"[data-popper-arrow]":n;s!=null&&(typeof s=="string"&&(s=t.elements.popper.querySelector(s),!s)||Ue(t.elements.popper,s)&&(t.elements.arrow=s))}const ss={name:"arrow",enabled:!0,phase:"main",fn:is,effect:ns,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function vt(e){return e.split("-")[1]}var rs={top:"auto",right:"auto",bottom:"auto",left:"auto"};function os(e,t){var i=e.x,n=e.y,s=t.devicePixelRatio||1;return{x:gt(i*s)/s||0,y:gt(n*s)/s||0}}function ii(e){var t,i=e.popper,n=e.popperRect,s=e.placement,r=e.variation,a=e.offsets,l=e.position,o=e.gpuAcceleration,c=e.adaptive,d=e.roundOffsets,b=e.isFixed,v=a.x,h=v===void 0?0:v,$=a.y,u=$===void 0?0:$,w=typeof d=="function"?d({x:h,y:u}):{x:h,y:u};h=w.x,u=w.y;var E=a.hasOwnProperty("x"),L=a.hasOwnProperty("y"),O=W,m=j,y=window;if(c){var x=Ct(i),k="clientHeight",T="clientWidth";if(x===N(i)&&(x=U(i),G(x).position!=="static"&&l==="absolute"&&(k="scrollHeight",T="scrollWidth")),x=x,s===j||(s===W||s===B)&&r===Tt){m=F;var I=b&&x===y&&y.visualViewport?y.visualViewport.height:x[k];u-=I-n.height,u*=o?1:-1}if(s===W||(s===j||s===F)&&r===Tt){O=B;var S=b&&x===y&&y.visualViewport?y.visualViewport.width:x[T];h-=S-n.width,h*=o?1:-1}}var P=Object.assign({position:l},c&&rs),H=d===!0?os({x:h,y:u},N(i)):{x:h,y:u};if(h=H.x,u=H.y,o){var q;return Object.assign({},P,(q={},q[m]=L?"0":"",q[O]=E?"0":"",q.transform=(y.devicePixelRatio||1)<=1?"translate("+h+"px, "+u+"px)":"translate3d("+h+"px, "+u+"px, 0)",q))}return Object.assign({},P,(t={},t[m]=L?u+"px":"",t[O]=E?h+"px":"",t.transform="",t))}function as(e){var t=e.state,i=e.options,n=i.gpuAcceleration,s=n===void 0?!0:n,r=i.adaptive,a=r===void 0?!0:r,l=i.roundOffsets,o=l===void 0?!0:l,c={placement:K(t.placement),variation:vt(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:s,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,ii(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:o})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,ii(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:o})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const ls={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:as,data:{}};var Jt={passive:!0};function cs(e){var t=e.state,i=e.instance,n=e.options,s=n.scroll,r=s===void 0?!0:s,a=n.resize,l=a===void 0?!0:a,o=N(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return r&&c.forEach(function(d){d.addEventListener("scroll",i.update,Jt)}),l&&o.addEventListener("resize",i.update,Jt),function(){r&&c.forEach(function(d){d.removeEventListener("scroll",i.update,Jt)}),l&&o.removeEventListener("resize",i.update,Jt)}}const ds={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:cs,data:{}};var us={left:"right",right:"left",bottom:"top",top:"bottom"};function zt(e){return e.replace(/left|right|bottom|top/g,function(t){return us[t]})}var hs={start:"end",end:"start"};function ni(e){return e.replace(/start|end/g,function(t){return hs[t]})}function me(e){var t=N(e),i=t.pageXOffset,n=t.pageYOffset;return{scrollLeft:i,scrollTop:n}}function ve(e){return mt(U(e)).left+me(e).scrollLeft}function fs(e,t){var i=N(e),n=U(e),s=i.visualViewport,r=n.clientWidth,a=n.clientHeight,l=0,o=0;if(s){r=s.width,a=s.height;var c=Ze();(c||!c&&t==="fixed")&&(l=s.offsetLeft,o=s.offsetTop)}return{width:r,height:a,x:l+ve(e),y:o}}function ps(e){var t,i=U(e),n=me(e),s=(t=e.ownerDocument)==null?void 0:t.body,r=et(i.scrollWidth,i.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),a=et(i.scrollHeight,i.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),l=-n.scrollLeft+ve(e),o=-n.scrollTop;return G(s||i).direction==="rtl"&&(l+=et(i.clientWidth,s?s.clientWidth:0)-r),{width:r,height:a,x:l,y:o}}function be(e){var t=G(e),i=t.overflow,n=t.overflowX,s=t.overflowY;return/auto|scroll|overlay|hidden/.test(i+s+n)}function si(e){return["html","body","#document"].indexOf(z(e))>=0?e.ownerDocument.body:R(e)&&be(e)?e:si(Vt(e))}function St(e,t){var i;t===void 0&&(t=[]);var n=si(e),s=n===((i=e.ownerDocument)==null?void 0:i.body),r=N(n),a=s?[r].concat(r.visualViewport||[],be(n)?n:[]):n,l=t.concat(a);return s?l:l.concat(St(Vt(a)))}function ye(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function gs(e,t){var i=mt(e,!1,t==="fixed");return i.top=i.top+e.clientTop,i.left=i.left+e.clientLeft,i.bottom=i.top+e.clientHeight,i.right=i.left+e.clientWidth,i.width=e.clientWidth,i.height=e.clientHeight,i.x=i.left,i.y=i.top,i}function ri(e,t,i){return t===Ke?ye(fs(e,i)):tt(t)?gs(t,i):ye(ps(U(e)))}function ms(e){var t=St(Vt(e)),i=["absolute","fixed"].indexOf(G(e).position)>=0,n=i&&R(e)?Ct(e):e;return tt(n)?t.filter(function(s){return tt(s)&&Ue(s,n)&&z(s)!=="body"}):[]}function vs(e,t,i,n){var s=t==="clippingParents"?ms(e):[].concat(t),r=[].concat(s,[i]),a=r[0],l=r.reduce(function(o,c){var d=ri(e,c,n);return o.top=et(d.top,o.top),o.right=Ht(d.right,o.right),o.bottom=Ht(d.bottom,o.bottom),o.left=et(d.left,o.left),o},ri(e,a,n));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function oi(e){var t=e.reference,i=e.element,n=e.placement,s=n?K(n):null,r=n?vt(n):null,a=t.x+t.width/2-i.width/2,l=t.y+t.height/2-i.height/2,o;switch(s){case j:o={x:a,y:t.y-i.height};break;case F:o={x:a,y:t.y+t.height};break;case B:o={x:t.x+t.width,y:l};break;case W:o={x:t.x-i.width,y:l};break;default:o={x:t.x,y:t.y}}var c=s?ge(s):null;if(c!=null){var d=c==="y"?"height":"width";switch(r){case pt:o[c]=o[c]-(t[d]/2-i[d]/2);break;case Tt:o[c]=o[c]+(t[d]/2-i[d]/2);break}}return o}function Pt(e,t){t===void 0&&(t={});var i=t,n=i.placement,s=n===void 0?e.placement:n,r=i.strategy,a=r===void 0?e.strategy:r,l=i.boundary,o=l===void 0?Wn:l,c=i.rootBoundary,d=c===void 0?Ke:c,b=i.elementContext,v=b===void 0?At:b,h=i.altBoundary,$=h===void 0?!1:h,u=i.padding,w=u===void 0?0:u,E=ti(typeof w!="number"?w:ei(w,kt)),L=v===At?Nn:At,O=e.rects.popper,m=e.elements[$?L:v],y=vs(tt(m)?m:m.contextElement||U(e.elements.popper),o,d,a),x=mt(e.elements.reference),k=oi({reference:x,element:O,strategy:"absolute",placement:s}),T=ye(Object.assign({},O,k)),I=v===At?T:x,S={top:y.top-I.top+E.top,bottom:I.bottom-y.bottom+E.bottom,left:y.left-I.left+E.left,right:I.right-y.right+E.right},P=e.modifiersData.offset;if(v===At&&P){var H=P[s];Object.keys(S).forEach(function(q){var it=[B,F].indexOf(q)>=0?1:-1,nt=[j,F].indexOf(q)>=0?"y":"x";S[q]+=H[nt]*it})}return S}function bs(e,t){t===void 0&&(t={});var i=t,n=i.placement,s=i.boundary,r=i.rootBoundary,a=i.padding,l=i.flipVariations,o=i.allowedAutoPlacements,c=o===void 0?Qe:o,d=vt(n),b=d?l?Ge:Ge.filter(function($){return vt($)===d}):kt,v=b.filter(function($){return c.indexOf($)>=0});v.length===0&&(v=b);var h=v.reduce(function($,u){return $[u]=Pt(e,{placement:u,boundary:s,rootBoundary:r,padding:a})[K(u)],$},{});return Object.keys(h).sort(function($,u){return h[$]-h[u]})}function ys(e){if(K(e)===ue)return[];var t=zt(e);return[ni(e),t,ni(t)]}function ws(e){var t=e.state,i=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var s=i.mainAxis,r=s===void 0?!0:s,a=i.altAxis,l=a===void 0?!0:a,o=i.fallbackPlacements,c=i.padding,d=i.boundary,b=i.rootBoundary,v=i.altBoundary,h=i.flipVariations,$=h===void 0?!0:h,u=i.allowedAutoPlacements,w=t.options.placement,E=K(w),L=E===w,O=o||(L||!$?[zt(w)]:ys(w)),m=[w].concat(O).reduce(function(rt,Q){return rt.concat(K(Q)===ue?bs(t,{placement:Q,boundary:d,rootBoundary:b,padding:c,flipVariations:$,allowedAutoPlacements:u}):Q)},[]),y=t.rects.reference,x=t.rects.popper,k=new Map,T=!0,I=m[0],S=0;S<m.length;S++){var P=m[S],H=K(P),q=vt(P)===pt,it=[j,F].indexOf(H)>=0,nt=it?"width":"height",_=Pt(t,{placement:P,boundary:d,rootBoundary:b,altBoundary:v,padding:c}),V=it?q?B:W:q?F:j;y[nt]>x[nt]&&(V=zt(V));var Kt=zt(V),st=[];if(r&&st.push(_[H]<=0),l&&st.push(_[V]<=0,_[Kt]<=0),st.every(function(rt){return rt})){I=P,T=!1;break}k.set(P,st)}if(T)for(var Gt=$?3:1,Ee=function(rt){var Q=m.find(function(Zt){var Mt=k.get(Zt);if(Mt)return Mt.slice(0,rt).every(function(bt){return bt})});if(Q)return I=Q,"break"},Dt=Gt;Dt>0;Dt--){var Qt=Ee(Dt);if(Qt==="break")break}t.placement!==I&&(t.modifiersData[n]._skip=!0,t.placement=I,t.reset=!0)}}const $s={name:"flip",enabled:!0,phase:"main",fn:ws,requiresIfExists:["offset"],data:{_skip:!1}};function ai(e,t,i){return i===void 0&&(i={x:0,y:0}),{top:e.top-t.height-i.y,right:e.right-t.width+i.x,bottom:e.bottom-t.height+i.y,left:e.left-t.width-i.x}}function li(e){return[j,B,F,W].some(function(t){return e[t]>=0})}function Es(e){var t=e.state,i=e.name,n=t.rects.reference,s=t.rects.popper,r=t.modifiersData.preventOverflow,a=Pt(t,{elementContext:"reference"}),l=Pt(t,{altBoundary:!0}),o=ai(a,n),c=ai(l,s,r),d=li(o),b=li(c);t.modifiersData[i]={referenceClippingOffsets:o,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:b},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":b})}const xs={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Es};function Ls(e,t,i){var n=K(e),s=[W,j].indexOf(n)>=0?-1:1,r=typeof i=="function"?i(Object.assign({},t,{placement:e})):i,a=r[0],l=r[1];return a=a||0,l=(l||0)*s,[W,B].indexOf(n)>=0?{x:l,y:a}:{x:a,y:l}}function Os(e){var t=e.state,i=e.options,n=e.name,s=i.offset,r=s===void 0?[0,0]:s,a=Qe.reduce(function(d,b){return d[b]=Ls(b,t.rects,r),d},{}),l=a[t.placement],o=l.x,c=l.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=o,t.modifiersData.popperOffsets.y+=c),t.modifiersData[n]=a}const ks={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Os};function Ts(e){var t=e.state,i=e.name;t.modifiersData[i]=oi({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const As={name:"popperOffsets",enabled:!0,phase:"read",fn:Ts,data:{}};function Cs(e){return e==="x"?"y":"x"}function Is(e){var t=e.state,i=e.options,n=e.name,s=i.mainAxis,r=s===void 0?!0:s,a=i.altAxis,l=a===void 0?!1:a,o=i.boundary,c=i.rootBoundary,d=i.altBoundary,b=i.padding,v=i.tether,h=v===void 0?!0:v,$=i.tetherOffset,u=$===void 0?0:$,w=Pt(t,{boundary:o,rootBoundary:c,padding:b,altBoundary:d}),E=K(t.placement),L=vt(t.placement),O=!L,m=ge(E),y=Cs(m),x=t.modifiersData.popperOffsets,k=t.rects.reference,T=t.rects.popper,I=typeof u=="function"?u(Object.assign({},t.rects,{placement:t.placement})):u,S=typeof I=="number"?{mainAxis:I,altAxis:I}:Object.assign({mainAxis:0,altAxis:0},I),P=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,H={x:0,y:0};if(x){if(r){var q,it=m==="y"?j:W,nt=m==="y"?F:B,_=m==="y"?"height":"width",V=x[m],Kt=V+w[it],st=V-w[nt],Gt=h?-T[_]/2:0,Ee=L===pt?k[_]:T[_],Dt=L===pt?-T[_]:-k[_],Qt=t.elements.arrow,rt=h&&Qt?pe(Qt):{width:0,height:0},Q=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Ye(),Zt=Q[it],Mt=Q[nt],bt=It(0,k[_],rt[_]),Js=O?k[_]/2-Gt-bt-Zt-S.mainAxis:Ee-bt-Zt-S.mainAxis,zs=O?-k[_]/2+Gt+bt+Mt+S.mainAxis:Dt+bt+Mt+S.mainAxis,xe=t.elements.arrow&&Ct(t.elements.arrow),Ks=xe?m==="y"?xe.clientTop||0:xe.clientLeft||0:0,fi=(q=P==null?void 0:P[m])!=null?q:0,Gs=V+Js-fi-Ks,Qs=V+zs-fi,pi=It(h?Ht(Kt,Gs):Kt,V,h?et(st,Qs):st);x[m]=pi,H[m]=pi-V}if(l){var gi,Zs=m==="x"?j:W,Us=m==="x"?F:B,ot=x[y],Ut=y==="y"?"height":"width",mi=ot+w[Zs],vi=ot-w[Us],Le=[j,W].indexOf(E)!==-1,bi=(gi=P==null?void 0:P[y])!=null?gi:0,yi=Le?mi:ot-k[Ut]-T[Ut]-bi+S.altAxis,wi=Le?ot+k[Ut]+T[Ut]-bi-S.altAxis:vi,$i=h&&Le?ts(yi,ot,wi):It(h?yi:mi,ot,h?wi:vi);x[y]=$i,H[y]=$i-ot}t.modifiersData[n]=H}}const Ss={name:"preventOverflow",enabled:!0,phase:"main",fn:Is,requiresIfExists:["offset"]};function Ps(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function qs(e){return e===N(e)||!R(e)?me(e):Ps(e)}function Ds(e){var t=e.getBoundingClientRect(),i=gt(t.width)/e.offsetWidth||1,n=gt(t.height)/e.offsetHeight||1;return i!==1||n!==1}function Ms(e,t,i){i===void 0&&(i=!1);var n=R(t),s=R(t)&&Ds(t),r=U(t),a=mt(e,s,i),l={scrollLeft:0,scrollTop:0},o={x:0,y:0};return(n||!n&&!i)&&((z(t)!=="body"||be(r))&&(l=qs(t)),R(t)?(o=mt(t,!0),o.x+=t.clientLeft,o.y+=t.clientTop):r&&(o.x=ve(r))),{x:a.left+l.scrollLeft-o.x,y:a.top+l.scrollTop-o.y,width:a.width,height:a.height}}function js(e){var t=new Map,i=new Set,n=[];e.forEach(function(r){t.set(r.name,r)});function s(r){i.add(r.name);var a=[].concat(r.requires||[],r.requiresIfExists||[]);a.forEach(function(l){if(!i.has(l)){var o=t.get(l);o&&s(o)}}),n.push(r)}return e.forEach(function(r){i.has(r.name)||s(r)}),n}function Ws(e){var t=js(e);return Gn.reduce(function(i,n){return i.concat(t.filter(function(s){return s.phase===n}))},[])}function Ns(e){var t;return function(){return t||(t=new Promise(function(i){Promise.resolve().then(function(){t=void 0,i(e())})})),t}}function _s(e){var t=e.reduce(function(i,n){var s=i[n.name];return i[n.name]=s?Object.assign({},s,n,{options:Object.assign({},s.options,n.options),data:Object.assign({},s.data,n.data)}):n,i},{});return Object.keys(t).map(function(i){return t[i]})}var ci={placement:"bottom",modifiers:[],strategy:"absolute"};function di(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return!t.some(function(n){return!(n&&typeof n.getBoundingClientRect=="function")})}function Fs(e){e===void 0&&(e={});var t=e,i=t.defaultModifiers,n=i===void 0?[]:i,s=t.defaultOptions,r=s===void 0?ci:s;return function(a,l,o){o===void 0&&(o=r);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},ci,r),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},d=[],b=!1,v={state:c,setOptions:function(u){var w=typeof u=="function"?u(c.options):u;$(),c.options=Object.assign({},r,c.options,w),c.scrollParents={reference:tt(a)?St(a):a.contextElement?St(a.contextElement):[],popper:St(l)};var E=Ws(_s([].concat(n,c.options.modifiers)));return c.orderedModifiers=E.filter(function(L){return L.enabled}),h(),v.update()},forceUpdate:function(){if(!b){var u=c.elements,w=u.reference,E=u.popper;if(di(w,E)){c.rects={reference:Ms(w,Ct(E),c.options.strategy==="fixed"),popper:pe(E)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(T){return c.modifiersData[T.name]=Object.assign({},T.data)});for(var L=0;L<c.orderedModifiers.length;L++){if(c.reset===!0){c.reset=!1,L=-1;continue}var O=c.orderedModifiers[L],m=O.fn,y=O.options,x=y===void 0?{}:y,k=O.name;typeof m=="function"&&(c=m({state:c,options:x,name:k,instance:v})||c)}}}},update:Ns(function(){return new Promise(function(u){v.forceUpdate(),u(c)})}),destroy:function(){$(),b=!0}};if(!di(a,l))return v;v.setOptions(o).then(function(u){!b&&o.onFirstUpdate&&o.onFirstUpdate(u)});function h(){c.orderedModifiers.forEach(function(u){var w=u.name,E=u.options,L=E===void 0?{}:E,O=u.effect;if(typeof O=="function"){var m=O({state:c,name:w,instance:v,options:L}),y=function(){};d.push(m||y)}})}function $(){d.forEach(function(u){return u()}),d=[]}return v}}var Bs=[ds,As,ls,Un,ks,$s,Ss,ss,xs],Rs=Fs({defaultModifiers:Bs});async function we(e){if(!e)return this.collection;const t=this.collection.findIndex(i=>i.id===e.id);if(t>=0){const i=this.collection[t];i.state==="opened"&&i.close(),i.popper.destroy(),ui(i),Object.getOwnPropertyNames(i).forEach(n=>{delete i[n]}),this.collection.splice(t,1)}return this.collection}function ui(e){return e.__eventListeners&&(e.__eventListeners.forEach(t=>{t.el.forEach(i=>{t.type.forEach(n=>{e[i].removeEventListener(n,t.listener,!1)})})}),delete e.__eventListeners),e}async function $e(e){const t=Re.call(this,e);return t.el.classList.add(this.settings.stateActive),t.trigger.hasAttribute("aria-controls")&&t.trigger.setAttribute("aria-expanded","true"),t.config=Be(t.el,this.settings),t.popper.setOptions({placement:t.config.placement,modifiers:[{name:"eventListeners",enabled:!0},...qn(t.config)]}),t.popper.update(),t.state="opened",t}async function Hs(e,t){we.call(this,e);const i=this,n={open(){return $e.call(i,this)},close(){return de.call(i,this)},deregister(){return we.call(i,this)}},s={id:e.id,state:"closed",el:e,trigger:t,popper:Rs(t,e),config:Be(e,this.settings),...n};return s.trigger.hasAttribute("aria-controls")&&s.trigger.setAttribute("aria-expanded","false"),hi.call(this,s),this.collection.push(s),s.el.classList.contains(this.settings.stateActive)&&(await s.open(),ze.call(this,s)),s}function hi(e){return e.__eventListeners||(e.config.event==="hover"?(e.__eventListeners=[{el:["trigger"],type:["mouseenter","focus"],listener:$e.bind(this,e)},{el:["el","trigger"],type:["mouseleave","focusout"],listener:Je.bind(this,e)}],e.__eventListeners.forEach(t=>{t.el.forEach(i=>{t.type.forEach(n=>{e[i].addEventListener(n,t.listener,!1)})})})):(e.__eventListeners=[{el:["trigger"],type:["click"],listener:Mn.bind(this,e)}],e.__eventListeners.forEach(t=>{t.el.forEach(i=>{t.type.forEach(n=>{e[i].addEventListener(n,t.listener,!1)})})}))),e}var qt;class Vs extends In{constructor(t){super(),An(this,qt,void 0),this.defaults=Pn,this.settings={...this.defaults,...t},this.trigger=null,Cn(this,qt,jn.bind(this)),this.settings.autoInit&&this.init()}async init(t){t&&(this.settings={...this.settings,...t});const i=document.querySelectorAll(this.settings.selectorPopover);return await this.registerCollection(i),this.settings.eventListeners&&this.initEventListeners(!1),this}async destroy(){return this.trigger=null,await this.deregisterCollection(),this.settings.eventListeners&&this.destroyEventListeners(!1),this}initEventListeners(t=!0){t&&this.collection.forEach(i=>{hi.call(this,i)}),document.addEventListener("keydown",Fe(this,qt),!1)}destroyEventListeners(t=!0){t&&this.collection.forEach(i=>{ui(i)}),document.removeEventListener("keydown",Fe(this,qt),!1)}register(t){const i=Dn.call(this,t);return i.error?Promise.reject(i.error):Hs.call(this,i.popover,i.trigger)}deregister(t){const i=this.get(He.call(this,t));return we.call(this,i)}open(t){return $e.call(this,t)}close(t){return de.call(this,t)}}qt=new WeakMap,J.Checkbox=_i,J.Drawer=cn,J.Modal=Tn,J.Popover=Vs,J.core=Wi,Object.defineProperty(J,Symbol.toStringTag,{value:"Module"})});
5
+ `);if(t){e.preventDefault(),t.matches(`[data-${this.settings.dataToggle}]`)&&t.getAttribute(`data-${this.settings.dataToggle}`).trim().split(" ").forEach(n=>{const i=this.get(n);return i.trigger=t,i.toggle()}),t.matches(`[data-${this.settings.dataOpen}]`)&&t.getAttribute(`data-${this.settings.dataOpen}`).trim().split(" ").forEach(n=>{const i=this.get(n);return i.trigger=t,i.open()}),t.matches(`[data-${this.settings.dataClose}]`)&&t.getAttribute(`data-${this.settings.dataClose}`).trim().split(" ").forEach(n=>{if(n){const i=this.get(n);return i.trigger=t,i.close()}else{const i=e.target.closest(this.settings.selectorDrawer);if(i)return this.close(i)}});return}if(this.activeModal&&e.target.matches(this.settings.selectorScreen))return this.close(this.activeModal.id)}function Xn(e){if(e.key==="Escape"&&this.activeModal)return this.close(this.activeModal)}async function Yt(e,t=!0){const n=this.collection.findIndex(i=>i.id===e.id);if(n>=0){const i=this.collection[n];t&&i.state==="opened"&&await i.close(!1),this.store.set(i.id),i.unmountBreakpoint(),Object.getOwnPropertyNames(i).forEach(r=>{delete i[r]}),this.collection.splice(n,1)}return this.collection}function Yn(e){e.store==="opened"?e.open(!1,!1):e.store==="closed"?e.close(!1,!1):e.store==="indeterminate"?e.state="indeterminate":e.el.classList.contains(e.getSetting("stateOpened"))?e.open(!1,!1):e.el.classList.contains(e.getSetting("stateClosed"))?e.close(!1,!1):e.state="indeterminate"}async function Un(e){e.store==="opened"?await e.open(!1,!1):e.store==="closed"?await e.close(!1,!1):e.store==="indeterminate"?e.state!="indeterminate"&&(e.state="indeterminate"):(e.state!=e.inlineState&&(e.state=e.inlineState),e.inlineState==="opened"?await e.open(!1,!1):e.inlineState==="closed"&&await e.close(!1,!1))}function ti(e){const t=Ie(),n=e.getAttribute(`data-${this.settings.dataBreakpoint}`);return this.settings.breakpoints&&this.settings.breakpoints[n]?this.settings.breakpoints[n]:getComputedStyle(document.body).getPropertyValue(`--${t}breakpoint-${n}`).trim()?getComputedStyle(document.body).getPropertyValue(`--${t}breakpoint-${n}`).trim():n}function Ut(e){const t=typeof e=="string"?this.get(e):this.get(e.id);if(t)return t;throw new Error(`Drawer not found in collection with id of "${e.id||e}".`)}function Pe(e){e.state==="opened"?e.mode==="modal"?this.focusTrap.mount(e.dialog,this.settings.selectorFocus):this.focusTrap.focus(e.dialog,this.settings.selectorFocus):(e.trigger&&(e.trigger.focus(),e.trigger=null),this.focusTrap.unmount())}async function te(e,t,n=!0){const i=Ut.call(this,e),r={...this.settings,...i.settings};return t!==void 0&&(r.transition=t),(i.state==="closed"||i.state==="indeterminate")&&(i.state="opening",r.transition?await Ae(i.el,{start:r.stateClosing,finish:r.stateClosed},{start:r.stateOpening,finish:r.stateOpened},r.transitionDuration):(i.el.classList.add(r.stateOpened),i.el.classList.remove(r.stateClosed)),i.state="opened",i.mode==="modal"&&Xt(!0,r),n&&Pe.call(this,i),i.el.dispatchEvent(new CustomEvent(r.customEventPrefix+"opened",{detail:this,bubbles:!0}))),i}async function Wt(e,t,n=!0){const i=Ut.call(this,e),r={...this.settings,...i.settings};return t!==void 0&&(r.transition=t),(i.state==="opened"||i.state==="indeterminate")&&(i.state="closing",document.activeElement.blur(),r.transition?await Ae(i.el,{start:r.stateOpening,finish:r.stateOpened},{start:r.stateClosing,finish:r.stateClosed},r.transitionDuration):(i.el.classList.add(r.stateClosed),i.el.classList.remove(r.stateOpened)),i.state="closed",i.mode==="modal"&&Xt(!1,r),n&&Pe.call(this,i),i.el.dispatchEvent(new CustomEvent(r.customEventPrefix+"closed",{detail:this,bubbles:!0}))),i}async function De(e,t,n){const i=Ut.call(this,e);return i.state==="closed"?te.call(this,i,t,n):Wt.call(this,i,t,n)}function ei(e){switch(e.mode){case"inline":return ni.call(this,e);case"modal":return ii.call(this,e);default:throw new Error(`"${e.mode}" is not a valid drawer mode.`)}}async function ni(e){return e.el.classList.remove(e.getSetting("classModal")),e.dialog.removeAttribute("aria-modal"),Xt(!1,{...this.settings,...e.settings}),this.focusTrap.unmount(),await Un(e),e.el.dispatchEvent(new CustomEvent(e.getSetting("customEventPrefix")+"switchMode",{detail:this,bubbles:!0})),e}async function ii(e){return e.el.classList.add(e.getSetting("classModal")),e.dialog.setAttribute("aria-modal","true"),await Wt.call(this,e,!1,!1),e.el.dispatchEvent(new CustomEvent(e.getSetting("customEventPrefix")+"switchMode",{detail:this,bubbles:!0})),e}async function ri(e,t={}){await Yt.call(this,e,!1);const n=this,i=new Nn;let r,s="indeterminate";const a={id:e.id,el:e,dialog:null,trigger:null,settings:{...Jn(e,this.settings.dataConfig),...t},inlineState:"indeterminate",get breakpoint(){return ti.call(n,e)},get store(){return n.store.get(this.id)},get mode(){return r},set mode(o){r=o,ei.call(n,this)},get state(){return s},set state(o){s=o,this.mode==="inline"&&o!="opening"&&o!="closing"&&(this.inlineState=o,this.getSetting("store")&&n.store.set(this.id,o)),o==="indeterminate"&&(this.el.classList.remove(this.getSetting("stateOpened")),this.el.classList.remove(this.getSetting("stateOpening")),this.el.classList.remove(this.getSetting("stateClosed")),this.el.classList.remove(this.getSetting("stateClosing")))},open(o,l){return te.call(n,this,o,l)},close(o,l){return Wt.call(n,this,o,l)},toggle(o,l){return De.call(n,this,o,l)},deregister(){return Yt.call(n,this)},mountBreakpoint(){const o=this.breakpoint,l=this.handleBreakpoint.bind(this);return i.mount(o,l),this},unmountBreakpoint(){return i.unmount(),this},handleBreakpoint(o){const l=o.matches?"inline":"modal";return this.mode!=l&&(this.mode=l),this},getSetting(o){return o in this.settings?this.settings[o]:n.settings[o]}};this.collection.push(a);const c=e.querySelector(a.getSetting("selectorDialog"));return a.dialog=c||e,a.getSetting("setTabindex")&&a.dialog.setAttribute("tabindex","-1"),await Yn(a),a.inlineState=a.state,a.mode=e.classList.contains(a.getSetting("classModal"))?"modal":"inline",a.breakpoint&&a.mountBreakpoint(),a}var $t,Et;let si=class extends Wn{constructor(t){super(),Te(this,$t,void 0),Te(this,Et,void 0),this.defaults=Qn,this.settings={...this.defaults,...t},this.focusTrap=new Bn,this.store=zn(this.settings.storeKey,this.settings.store),Se(this,$t,Zn.bind(this)),Se(this,Et,Xn.bind(this)),this.settings.autoInit&&this.init()}get activeModal(){return this.collection.find(t=>t.state==="opened"&&t.mode==="modal")}async init(t=null){t&&(this.settings={...this.settings,...t});const n=document.querySelectorAll(this.settings.selectorDrawer);return await this.registerCollection(n),this.settings.eventListeners&&this.initEventListeners(),this}async destroy(){return await this.deregisterCollection(),this.settings.eventListeners&&this.destroyEventListeners(),this}initEventListeners(){document.addEventListener("click",Ft(this,$t),!1),document.addEventListener("keydown",Ft(this,Et),!1)}destroyEventListeners(){document.removeEventListener("click",Ft(this,$t),!1),document.removeEventListener("keydown",Ft(this,Et),!1)}register(t,n={}){let i=typeof t=="string"?document.getElementById(t):t;return i?ri.call(this,i,n):Promise.reject(new Error(`Failed to register; drawer not found with ID of: "${t.id||t}".`))}deregister(t){let n=this.get(t.id||t);return n?Yt.call(this,n):Promise.reject(new Error(`Failed to deregister; drawer does not exist in collection with ID of: "${t.id||t}".`))}open(t,n,i){return te.call(this,t,n,i)}close(t,n,i){return Wt.call(this,t,n,i)}toggle(t,n,i){return De.call(this,t,n,i)}};$t=new WeakMap,Et=new WeakMap;var Me=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},_t=(e,t,n)=>(Me(e,t,"read from private field"),n?n.call(e):t.get(e)),je=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},qe=(e,t,n,i)=>(Me(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n),Fe=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},Z=(e,t,n)=>(Fe(e,t,"read from private field"),n?n.call(e):t.get(e)),ee=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},ne=(e,t,n,i)=>(Fe(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n);class oi{constructor(){this.collection=[]}async register(t){return await this.deregister(t),this.collection.push(t),this.collection}async deregister(t){const n=this.collection.findIndex(i=>i===t);if(n>=0){const i=this.collection[n];Object.getOwnPropertyNames(i).forEach(r=>{delete i[r]}),this.collection.splice(n,1)}return this.collection}async registerCollection(t){return await Promise.all(Array.from(t,n=>{this.register(n)})),this.collection}async deregisterCollection(){for(;this.collection.length>0;)await this.deregister(this.collection[0]);return this.collection}get(t,n="id"){return this.collection.find(i=>i[n]===t)}}const g={inert:":not([inert]):not([inert] *)",negTabIndex:':not([tabindex^="-"])',disabled:":not(:disabled)"},ai=[`a[href]${g.inert}${g.negTabIndex}`,`area[href]${g.inert}${g.negTabIndex}`,`input:not([type="hidden"]):not([type="radio"])${g.inert}${g.negTabIndex}${g.disabled}`,`input[type="radio"]${g.inert}${g.negTabIndex}${g.disabled}`,`select${g.inert}${g.negTabIndex}${g.disabled}`,`textarea${g.inert}${g.negTabIndex}${g.disabled}`,`button${g.inert}${g.negTabIndex}${g.disabled}`,`details${g.inert} > summary:first-of-type${g.negTabIndex}`,`iframe${g.inert}${g.negTabIndex}`,`audio[controls]${g.inert}${g.negTabIndex}`,`video[controls]${g.inert}${g.negTabIndex}`,`[contenteditable]${g.inert}${g.negTabIndex}`,`[tabindex]${g.inert}${g.negTabIndex}`];var xt,ht,ft;class li{constructor(t=null,n="[data-focus]"){ee(this,xt,void 0),ee(this,ht,void 0),ee(this,ft,void 0),this.el=t,this.selectorFocus=n,ne(this,ht,ci.bind(this)),ne(this,ft,di.bind(this))}get focusable(){return Z(this,xt)}set focusable(t){ne(this,xt,t),Z(this,xt).length?(document.removeEventListener("keydown",Z(this,ft)),document.addEventListener("keydown",Z(this,ht))):(document.removeEventListener("keydown",Z(this,ht)),document.addEventListener("keydown",Z(this,ft)))}get focusableFirst(){return this.focusable[0]}get focusableLast(){return this.focusable[this.focusable.length-1]}mount(t,n){t&&(this.el=t),n&&(this.selectorFocus=n),this.focusable=this.getFocusable(),this.focus()}unmount(){this.el=null,this.focusable=[],document.removeEventListener("keydown",Z(this,ht)),document.removeEventListener("keydown",Z(this,ft))}focus(t=this.el,n=this.selectorFocus){(t.querySelector(n)||t).focus()}getFocusable(t=this.el){const n=[],i=document.activeElement,r=t.scrollTop;return t.querySelectorAll(ai.join(",")).forEach(s=>{s.focus(),document.activeElement===s&&n.push(s)}),t.scrollTop=r,i.focus(),n}}xt=new WeakMap,ht=new WeakMap,ft=new WeakMap;function ci(e){(e.key==="Tab"||e.keyCode===9)&&(e.shiftKey?(document.activeElement===this.focusableFirst||document.activeElement===this.el)&&(e.preventDefault(),this.focusableLast.focus()):(document.activeElement===this.focusableLast||document.activeElement===this.el)&&(e.preventDefault(),this.focusableFirst.focus()))}function di(e){(e.key==="Tab"||e.keyCode===9)&&e.preventDefault()}function ui(){return getComputedStyle(document.body).getPropertyValue("--vrembem-prefix").trim()}function hi(e,t=document.body,n=!0){if(n){const r=ui();r&&!e.includes(`--${r}`)&&(e=e.replace("--",`--${r}`))}const i=getComputedStyle(t).getPropertyValue(e).trim();if(i)return i;throw new Error(`CSS variable "${e}" was not found!`)}function fi(e,t){const n=(e.getAttribute(`data-${t}`)||"").replace(/'/g,'"');return n?JSON.parse(n):{}}function Ne(e,t,n){const i=t.nodeType===Node.COMMENT_NODE,r=t.nodeType===Node.ELEMENT_NODE;if(t=i||r?t:document.querySelector(t),i&&(n="after"),!t)throw new Error(`Not a valid teleport reference: '${t}'`);if(typeof t[n]!="function")throw new Error(`Not a valid teleport method: '${n}'`);let s=null;return i||(s=document.createComment("teleported #"+e.id),e.before(s)),t[n](e),i&&t.remove(),s}function We(e,t,n,i="--transition-duration"){return new Promise(r=>{if(typeof i=="string"){const s=hi(i,e),a=!!s.includes("ms");i=parseFloat(s)*(a?1:1e3)}e.classList.remove(t.finish),e.classList.add(n.start),setTimeout(()=>{e.classList.add(n.finish),e.classList.remove(n.start),r(e)},i)})}function pi(e,t){t&&document.querySelectorAll(t).forEach(n=>{e?n.style.overflow="hidden":n.style.removeProperty("overflow")})}function gi(e,t){t&&document.querySelectorAll(t).forEach(n=>{e?(n.inert=!0,n.setAttribute("aria-hidden",!0)):(n.inert=null,n.removeAttribute("aria-hidden"))})}function mi(e,t){gi(!!e,t.selectorInert),pi(!!e,t.selectorOverflow)}const vi={autoInit:!1,dataOpen:"modal-open",dataClose:"modal-close",dataReplace:"modal-replace",dataConfig:"modal-config",selectorModal:".modal",selectorDialog:".modal__dialog",selectorScreen:".modal",selectorRequired:'[role="alertdialog"]',selectorFocus:"[data-focus]",selectorInert:null,selectorOverflow:"body",stateOpened:"is-opened",stateOpening:"is-opening",stateClosing:"is-closing",stateClosed:"is-closed",customEventPrefix:"modal:",eventListeners:!0,teleport:null,teleportMethod:"append",setTabindex:!0,transition:!0,transitionDuration:"--vb-modal-transition-duration"};async function bi(e){const t=e.target.closest(`
6
+ [data-${this.settings.dataOpen}],
7
+ [data-${this.settings.dataReplace}],
8
+ [data-${this.settings.dataClose}]
9
+ `);if(t){if(e.preventDefault(),t.matches(`[data-${this.settings.dataOpen}]`)){const n=t.getAttribute(`data-${this.settings.dataOpen}`).trim(),i=this.get(n);return e.target.closest(this.settings.selectorModal)||(this.trigger=t),i.open()}if(t.matches(`[data-${this.settings.dataReplace}]`)){const n=t.getAttribute(`data-${this.settings.dataReplace}`).trim(),i=this.get(n);return e.target.closest(this.settings.selectorModal)||(this.trigger=t),i.replace()}if(t.matches(`[data-${this.settings.dataClose}]`)){const n=t.getAttribute(`data-${this.settings.dataClose}`).trim();return n==="*"?this.closeAll():this.close(n)}}if(this.active&&e.target.matches(this.settings.selectorScreen)&&!this.active.required)return this.close(this.active.id)}function yi(e){if(e.key==="Escape"&&this.active&&!this.active.dialog.matches(this.settings.selectorRequired))return this.close()}async function ie(e,t=!0){const n=this.collection.findIndex(i=>i.id===e.id);if(n>=0){const i=this.collection[n];t&&i.state==="opened"?await i.close(!1):this.stack.remove(i),i.getSetting("teleport")&&i.teleportReturn(),Object.getOwnPropertyNames(i).forEach(r=>{delete i[r]}),this.collection.splice(n,1)}return this.collection}function re(e){const t=typeof e=="string"?this.get(e):this.get(e.id);if(t)return t;throw new Error(`Modal not found in collection with id of "${e.id||e}".`)}function Bt(){this.active?this.focusTrap.mount(this.active.dialog,this.settings.selectorFocus):(this.trigger&&(this.trigger.focus(),this.trigger=null),this.focusTrap.unmount())}async function se(e,t,n=!0){const i=re.call(this,e),r={...this.settings,...i.settings};return t!==void 0&&(r.transition=t),this.stack.moveToTop(i),i.state==="closed"&&(i.state="opening",this.stack.add(i),r.transition?await We(i.el,{start:r.stateClosing,finish:r.stateClosed},{start:r.stateOpening,finish:r.stateOpened},r.transitionDuration):(i.el.classList.add(r.stateOpened),i.el.classList.remove(r.stateClosed)),i.state="opened"),n&&Bt.call(this),i.el.dispatchEvent(new CustomEvent(r.customEventPrefix+"opened",{detail:this,bubbles:!0})),i}async function oe(e,t,n=!0){const i=e?re.call(this,e):this.active;if(i&&i.state==="opened"){i.state="closing";const r={...this.settings,...i.settings};t!==void 0&&(r.transition=t),document.activeElement.blur(),r.transition?await We(i.el,{start:r.stateOpening,finish:r.stateOpened},{start:r.stateClosing,finish:r.stateClosed},r.transitionDuration):(i.el.classList.add(r.stateClosed),i.el.classList.remove(r.stateOpened)),this.stack.remove(i),i.state="closed",n&&Bt.call(this),i.el.dispatchEvent(new CustomEvent(r.customEventPrefix+"closed",{detail:this,bubbles:!0}))}return i}async function ae(e,t){const n=[];return await Promise.all(this.stack.value.map(async i=>{e&&e===i.id?Promise.resolve():n.push(await oe.call(this,i,t,!1)),i.trigger=null})),n}async function _e(e,t,n=!0){const i=re.call(this,e);let r,s;return i.state==="opened"?(r=i,s=await ae.call(this,i.id,t)):(s=ae.call(this,!1,t),r=se.call(this,i,t,!1),await Promise.all([r,s])),n&&Bt.call(this),{opened:r,closed:s}}async function wi(e,t={}){await ie.call(this,e,!1);const n=this,i={id:e.id,state:"closed",el:e,dialog:null,get required(){return this.dialog.matches(this.getSetting("selectorRequired"))},returnRef:null,settings:{...fi(e,this.settings.dataConfig),...t},open(s,a){return se.call(n,this,s,a)},close(s,a){return oe.call(n,this,s,a)},replace(s,a){return _e.call(n,this,s,a)},deregister(){return ie.call(n,this)},teleport(s=this.getSetting("teleport"),a=this.getSetting("teleportMethod")){return this.returnRef?(console.error("Element has already been teleported:",this.el),!1):(this.returnRef=Ne(this.el,s,a),this.el)},teleportReturn(){return this.returnRef?(this.returnRef=Ne(this.el,this.returnRef),this.el):(console.error("No return reference found:",this.el),!1)},getSetting(s){return s in this.settings?this.settings[s]:n.settings[s]}},r=e.querySelector(i.getSetting("selectorDialog"));return i.dialog=r||e,i.dialog.setAttribute("aria-modal","true"),i.dialog.hasAttribute("role")||i.dialog.setAttribute("role","dialog"),i.getSetting("setTabindex")&&i.dialog.setAttribute("tabindex","-1"),i.getSetting("teleport")&&i.teleport(),this.collection.push(i),i.el.classList.contains(this.settings.stateOpened)?await i.open(!1):(i.el.classList.remove(this.settings.stateOpening),i.el.classList.remove(this.settings.stateClosing),i.el.classList.add(this.settings.stateClosed)),i}function $i(e){const t=[];return{get value(){return[...t]},get top(){return t[t.length-1]},updateIndex(){t.forEach((n,i)=>{n.el.style.zIndex=null;const r=getComputedStyle(n.el)["z-index"];n.el.style.zIndex=parseInt(r)+i+1})},updateGlobalState(){mi(this.top,e),this.updateIndex()},add(n){n.el.style.zIndex=null;const i=getComputedStyle(n.el)["z-index"];n.el.style.zIndex=parseInt(i)+t.length+1,t.push(n),this.updateGlobalState()},remove(n){const i=t.findIndex(r=>r.id===n.id);i>=0&&(n.el.style.zIndex=null,t.splice(i,1),this.updateGlobalState())},moveToTop(n){const i=t.findIndex(r=>r.id===n.id);i>=0&&(t.splice(i,1),this.add(n))}}}var Ot,Lt;let Ei=class extends oi{constructor(t){super(),je(this,Ot,void 0),je(this,Lt,void 0),this.defaults=vi,this.settings={...this.defaults,...t},this.trigger=null,this.focusTrap=new li,this.stack=$i(this.settings),qe(this,Ot,bi.bind(this)),qe(this,Lt,yi.bind(this)),this.settings.autoInit&&this.init()}get active(){return this.stack.top}async init(t){t&&(this.settings={...this.settings,...t});const n=document.querySelectorAll(this.settings.selectorModal);return await this.registerCollection(n),this.settings.eventListeners&&this.initEventListeners(),this}async destroy(){return this.trigger=null,await this.deregisterCollection(),this.settings.eventListeners&&this.destroyEventListeners(),this}initEventListeners(){document.addEventListener("click",_t(this,Ot),!1),document.addEventListener("keydown",_t(this,Lt),!1)}destroyEventListeners(){document.removeEventListener("click",_t(this,Ot),!1),document.removeEventListener("keydown",_t(this,Lt),!1)}register(t,n={}){let i=typeof t=="string"?document.getElementById(t):t;return i?wi.call(this,i,n):Promise.reject(new Error(`Failed to register; modal not found with ID of: "${t.id||t}".`))}deregister(t){let n=this.get(t.id||t);return n?ie.call(this,n):Promise.reject(new Error(`Failed to deregister; modal does not exist in collection with ID of: "${t.id||t}".`))}open(t,n,i){return se.call(this,t,n,i)}close(t,n,i){return oe.call(this,t,n,i)}replace(t,n,i){return _e.call(this,t,n,i)}async closeAll(t=!1,n,i=!0){const r=await ae.call(this,t,n);return i&&Bt.call(this),r}};Ot=new WeakMap,Lt=new WeakMap;var Be=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},Re=(e,t,n)=>(Be(e,t,"read from private field"),n?n.call(e):t.get(e)),xi=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Oi=(e,t,n,i)=>(Be(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n);class Li{constructor(){this.collection=[]}async register(t){return await this.deregister(t),this.collection.push(t),this.collection}async deregister(t){const n=this.collection.findIndex(i=>i===t);if(n>=0){const i=this.collection[n];Object.getOwnPropertyNames(i).forEach(r=>{delete i[r]}),this.collection.splice(n,1)}return this.collection}async registerCollection(t){return await Promise.all(Array.from(t,n=>{this.register(n)})),this.collection}async deregisterCollection(){for(;this.collection.length>0;)await this.deregister(this.collection[0]);return this.collection}get(t,n="id"){return this.collection.find(i=>i[n]===t)}}function ki(){return getComputedStyle(document.body).getPropertyValue("--vrembem-prefix").trim()}const Ti={autoInit:!1,selectorPopover:".popover",selectorArrow:".popover__arrow",stateActive:"is-active",eventListeners:!0,eventType:"click",placement:"bottom"};function Ve(e,t){const n=getComputedStyle(e),i={placement:t.placement,event:t.eventType,offset:0,"overflow-padding":0,"flip-padding":0,"arrow-element":t.selectorArrow,"arrow-padding":0};for(const r in i){const s=ki(),a=n.getPropertyValue(`--${s}popover-${r}`).trim();a&&(i[r]=a)}return i}function le(e){let t;const n=typeof e=="string"?e.trim().split(" "):[e];switch(n.forEach(function(i,r){n[r]=parseInt(i,10)}),n.length){case 1:t=n[0];break;case 2:t={top:n[0],right:n[1],bottom:n[0],left:n[1]};break;case 3:t={top:n[0],right:n[1],bottom:n[2],left:n[1]};break;case 4:t={top:n[0],right:n[1],bottom:n[2],left:n[3]};break;default:t=!1;break}return t}function Si(e){return[{name:"offset",options:{offset:[0,parseInt(e.offset,10)]}},{name:"preventOverflow",options:{padding:le(e["overflow-padding"])}},{name:"flip",options:{padding:le(e["flip-padding"])}},{name:"arrow",options:{element:e["arrow-element"],padding:le(e["arrow-padding"])}}]}function He(e){const t=typeof e=="string"?this.get(e):this.get(e.id);if(t)return t;throw new Error(`Popover not found in collection with id of "${e}".`)}function Ci(e){return typeof e=="string"?e:typeof e.hasAttribute=="function"?e.closest(this.settings.selectorPopover)?(e=e.closest(this.settings.selectorPopover),e.id):e.hasAttribute("aria-controls")?e.getAttribute("aria-controls"):e.hasAttribute("aria-describedby")?e.getAttribute("aria-describedby"):!1:!1}function Ii(e){const t=Ci.call(this,e);if(t){const n=document.querySelector(`#${t}`),i=document.querySelector(`[aria-controls="${t}"]`)||document.querySelector(`[aria-describedby="${t}"]`);return!i&&!n?{error:new Error(`No popover elements found using the ID: "${t}".`)}:i?n?{popover:n,trigger:i}:{error:new Error("No popover associated with the provided popover trigger.")}:{error:new Error("No popover trigger associated with the provided popover.")}}else return{error:new Error("Could not resolve the popover ID.")}}async function ce(e){const t=e?He.call(this,e):await Je.call(this);return t&&t.state==="opened"&&(t.el.classList.remove(this.settings.stateActive),t.trigger.hasAttribute("aria-controls")&&t.trigger.setAttribute("aria-expanded","false"),t.popper.setOptions({modifiers:[{name:"eventListeners",enabled:!1}]}),t.state="closed",t.trigger===this.trigger&&(this.trigger=null)),t}async function Je(){const e=[];return await Promise.all(this.collection.map(async t=>{t.state==="opened"&&e.push(await ce.call(this,t))})),e}function ze(e){e.state=="opened"&&setTimeout(()=>{const t=e.el.closest(":hover")===e.el||e.trigger.closest(":hover")===e.trigger,n=document.activeElement.closest(`#${e.id}, [aria-controls="${e.id}"], [aria-describedby="${e.id}"]`);return!t&&!n&&e.close(),e},1)}function Ai(e){e.state==="opened"?e.close():(this.trigger=e.trigger,e.open(),Ke.call(this,e))}function Pi(e){switch(e.key){case"Escape":this.trigger&&this.trigger.focus(),Je.call(this);return;case"Tab":this.collection.forEach(t=>{ze.call(this,t)});return;default:return}}function Ke(e){const t=this;document.addEventListener("click",function n(i){i.target.closest(`#${e.id}, [aria-controls="${e.id}"], [aria-describedby="${e.id}"]`)?e.el&&!e.el.classList.contains(t.settings.stateActive)&&this.removeEventListener("click",n):(e.el&&e.el.classList.contains(t.settings.stateActive)&&e.close(),this.removeEventListener("click",n))})}var P="top",N="bottom",W="right",D="left",de="auto",kt=[P,N,W,D],pt="start",Tt="end",Di="clippingParents",Ge="viewport",St="popper",Mi="reference",Qe=kt.reduce(function(e,t){return e.concat([t+"-"+pt,t+"-"+Tt])},[]),Ze=[].concat(kt,[de]).reduce(function(e,t){return e.concat([t,t+"-"+pt,t+"-"+Tt])},[]),ji="beforeRead",qi="read",Fi="afterRead",Ni="beforeMain",Wi="main",_i="afterMain",Bi="beforeWrite",Ri="write",Vi="afterWrite",Hi=[ji,qi,Fi,Ni,Wi,_i,Bi,Ri,Vi];function J(e){return e?(e.nodeName||"").toLowerCase():null}function q(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function tt(e){var t=q(e).Element;return e instanceof t||e instanceof Element}function _(e){var t=q(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function ue(e){if(typeof ShadowRoot>"u")return!1;var t=q(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Ji(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var i=t.styles[n]||{},r=t.attributes[n]||{},s=t.elements[n];!_(s)||!J(s)||(Object.assign(s.style,i),Object.keys(r).forEach(function(a){var c=r[a];c===!1?s.removeAttribute(a):s.setAttribute(a,c===!0?"":c)}))})}function zi(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(i){var r=t.elements[i],s=t.attributes[i]||{},a=Object.keys(t.styles.hasOwnProperty(i)?t.styles[i]:n[i]),c=a.reduce(function(o,l){return o[l]="",o},{});!_(r)||!J(r)||(Object.assign(r.style,c),Object.keys(s).forEach(function(o){r.removeAttribute(o)}))})}}const Ki={name:"applyStyles",enabled:!0,phase:"write",fn:Ji,effect:zi,requires:["computeStyles"]};function z(e){return e.split("-")[0]}var et=Math.max,Rt=Math.min,gt=Math.round;function he(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function Xe(){return!/^((?!chrome|android).)*safari/i.test(he())}function mt(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var i=e.getBoundingClientRect(),r=1,s=1;t&&_(e)&&(r=e.offsetWidth>0&&gt(i.width)/e.offsetWidth||1,s=e.offsetHeight>0&&gt(i.height)/e.offsetHeight||1);var a=tt(e)?q(e):window,c=a.visualViewport,o=!Xe()&&n,l=(i.left+(o&&c?c.offsetLeft:0))/r,d=(i.top+(o&&c?c.offsetTop:0))/s,b=i.width/r,v=i.height/s;return{width:b,height:v,top:d,right:l+b,bottom:d+v,left:l,x:l,y:d}}function fe(e){var t=mt(e),n=e.offsetWidth,i=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:i}}function Ye(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&ue(n)){var i=t;do{if(i&&e.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function G(e){return q(e).getComputedStyle(e)}function Gi(e){return["table","td","th"].indexOf(J(e))>=0}function X(e){return((tt(e)?e.ownerDocument:e.document)||window.document).documentElement}function Vt(e){return J(e)==="html"?e:e.assignedSlot||e.parentNode||(ue(e)?e.host:null)||X(e)}function Ue(e){return!_(e)||G(e).position==="fixed"?null:e.offsetParent}function Qi(e){var t=/firefox/i.test(he()),n=/Trident/i.test(he());if(n&&_(e)){var i=G(e);if(i.position==="fixed")return null}var r=Vt(e);for(ue(r)&&(r=r.host);_(r)&&["html","body"].indexOf(J(r))<0;){var s=G(r);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||t&&s.willChange==="filter"||t&&s.filter&&s.filter!=="none")return r;r=r.parentNode}return null}function Ct(e){for(var t=q(e),n=Ue(e);n&&Gi(n)&&G(n).position==="static";)n=Ue(n);return n&&(J(n)==="html"||J(n)==="body"&&G(n).position==="static")?t:n||Qi(e)||t}function pe(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function It(e,t,n){return et(e,Rt(t,n))}function Zi(e,t,n){var i=It(e,t,n);return i>n?n:i}function tn(){return{top:0,right:0,bottom:0,left:0}}function en(e){return Object.assign({},tn(),e)}function nn(e,t){return t.reduce(function(n,i){return n[i]=e,n},{})}var Xi=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,en(typeof e!="number"?e:nn(e,kt))};function Yi(e){var t,n=e.state,i=e.name,r=e.options,s=n.elements.arrow,a=n.modifiersData.popperOffsets,c=z(n.placement),o=pe(c),l=[D,W].indexOf(c)>=0,d=l?"height":"width";if(!(!s||!a)){var b=Xi(r.padding,n),v=fe(s),h=o==="y"?P:D,$=o==="y"?N:W,u=n.rects.reference[d]+n.rects.reference[o]-a[o]-n.rects.popper[d],w=a[o]-n.rects.reference[o],E=Ct(s),O=E?o==="y"?E.clientHeight||0:E.clientWidth||0:0,L=u/2-w/2,m=b[h],y=O-v[d]-b[$],x=O/2-v[d]/2+L,k=It(m,x,y),T=o;n.modifiersData[i]=(t={},t[T]=k,t.centerOffset=k-x,t)}}function Ui(e){var t=e.state,n=e.options,i=n.element,r=i===void 0?"[data-popper-arrow]":i;r!=null&&(typeof r=="string"&&(r=t.elements.popper.querySelector(r),!r)||Ye(t.elements.popper,r)&&(t.elements.arrow=r))}const tr={name:"arrow",enabled:!0,phase:"main",fn:Yi,effect:Ui,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function vt(e){return e.split("-")[1]}var er={top:"auto",right:"auto",bottom:"auto",left:"auto"};function nr(e,t){var n=e.x,i=e.y,r=t.devicePixelRatio||1;return{x:gt(n*r)/r||0,y:gt(i*r)/r||0}}function rn(e){var t,n=e.popper,i=e.popperRect,r=e.placement,s=e.variation,a=e.offsets,c=e.position,o=e.gpuAcceleration,l=e.adaptive,d=e.roundOffsets,b=e.isFixed,v=a.x,h=v===void 0?0:v,$=a.y,u=$===void 0?0:$,w=typeof d=="function"?d({x:h,y:u}):{x:h,y:u};h=w.x,u=w.y;var E=a.hasOwnProperty("x"),O=a.hasOwnProperty("y"),L=D,m=P,y=window;if(l){var x=Ct(n),k="clientHeight",T="clientWidth";if(x===q(n)&&(x=X(n),G(x).position!=="static"&&c==="absolute"&&(k="scrollHeight",T="scrollWidth")),x=x,r===P||(r===D||r===W)&&s===Tt){m=N;var S=b&&x===y&&y.visualViewport?y.visualViewport.height:x[k];u-=S-i.height,u*=o?1:-1}if(r===D||(r===P||r===N)&&s===Tt){L=W;var C=b&&x===y&&y.visualViewport?y.visualViewport.width:x[T];h-=C-i.width,h*=o?1:-1}}var I=Object.assign({position:c},l&&er),V=d===!0?nr({x:h,y:u},q(n)):{x:h,y:u};if(h=V.x,u=V.y,o){var A;return Object.assign({},I,(A={},A[m]=O?"0":"",A[L]=E?"0":"",A.transform=(y.devicePixelRatio||1)<=1?"translate("+h+"px, "+u+"px)":"translate3d("+h+"px, "+u+"px, 0)",A))}return Object.assign({},I,(t={},t[m]=O?u+"px":"",t[L]=E?h+"px":"",t.transform="",t))}function ir(e){var t=e.state,n=e.options,i=n.gpuAcceleration,r=i===void 0?!0:i,s=n.adaptive,a=s===void 0?!0:s,c=n.roundOffsets,o=c===void 0?!0:c,l={placement:z(t.placement),variation:vt(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,rn(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:o})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,rn(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:o})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const rr={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:ir,data:{}};var Ht={passive:!0};function sr(e){var t=e.state,n=e.instance,i=e.options,r=i.scroll,s=r===void 0?!0:r,a=i.resize,c=a===void 0?!0:a,o=q(t.elements.popper),l=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&l.forEach(function(d){d.addEventListener("scroll",n.update,Ht)}),c&&o.addEventListener("resize",n.update,Ht),function(){s&&l.forEach(function(d){d.removeEventListener("scroll",n.update,Ht)}),c&&o.removeEventListener("resize",n.update,Ht)}}const or={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:sr,data:{}};var ar={left:"right",right:"left",bottom:"top",top:"bottom"};function Jt(e){return e.replace(/left|right|bottom|top/g,function(t){return ar[t]})}var lr={start:"end",end:"start"};function sn(e){return e.replace(/start|end/g,function(t){return lr[t]})}function ge(e){var t=q(e),n=t.pageXOffset,i=t.pageYOffset;return{scrollLeft:n,scrollTop:i}}function me(e){return mt(X(e)).left+ge(e).scrollLeft}function cr(e,t){var n=q(e),i=X(e),r=n.visualViewport,s=i.clientWidth,a=i.clientHeight,c=0,o=0;if(r){s=r.width,a=r.height;var l=Xe();(l||!l&&t==="fixed")&&(c=r.offsetLeft,o=r.offsetTop)}return{width:s,height:a,x:c+me(e),y:o}}function dr(e){var t,n=X(e),i=ge(e),r=(t=e.ownerDocument)==null?void 0:t.body,s=et(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=et(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),c=-i.scrollLeft+me(e),o=-i.scrollTop;return G(r||n).direction==="rtl"&&(c+=et(n.clientWidth,r?r.clientWidth:0)-s),{width:s,height:a,x:c,y:o}}function ve(e){var t=G(e),n=t.overflow,i=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+i)}function on(e){return["html","body","#document"].indexOf(J(e))>=0?e.ownerDocument.body:_(e)&&ve(e)?e:on(Vt(e))}function At(e,t){var n;t===void 0&&(t=[]);var i=on(e),r=i===((n=e.ownerDocument)==null?void 0:n.body),s=q(i),a=r?[s].concat(s.visualViewport||[],ve(i)?i:[]):i,c=t.concat(a);return r?c:c.concat(At(Vt(a)))}function be(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function ur(e,t){var n=mt(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function an(e,t,n){return t===Ge?be(cr(e,n)):tt(t)?ur(t,n):be(dr(X(e)))}function hr(e){var t=At(Vt(e)),n=["absolute","fixed"].indexOf(G(e).position)>=0,i=n&&_(e)?Ct(e):e;return tt(i)?t.filter(function(r){return tt(r)&&Ye(r,i)&&J(r)!=="body"}):[]}function fr(e,t,n,i){var r=t==="clippingParents"?hr(e):[].concat(t),s=[].concat(r,[n]),a=s[0],c=s.reduce(function(o,l){var d=an(e,l,i);return o.top=et(d.top,o.top),o.right=Rt(d.right,o.right),o.bottom=Rt(d.bottom,o.bottom),o.left=et(d.left,o.left),o},an(e,a,i));return c.width=c.right-c.left,c.height=c.bottom-c.top,c.x=c.left,c.y=c.top,c}function ln(e){var t=e.reference,n=e.element,i=e.placement,r=i?z(i):null,s=i?vt(i):null,a=t.x+t.width/2-n.width/2,c=t.y+t.height/2-n.height/2,o;switch(r){case P:o={x:a,y:t.y-n.height};break;case N:o={x:a,y:t.y+t.height};break;case W:o={x:t.x+t.width,y:c};break;case D:o={x:t.x-n.width,y:c};break;default:o={x:t.x,y:t.y}}var l=r?pe(r):null;if(l!=null){var d=l==="y"?"height":"width";switch(s){case pt:o[l]=o[l]-(t[d]/2-n[d]/2);break;case Tt:o[l]=o[l]+(t[d]/2-n[d]/2);break}}return o}function Pt(e,t){t===void 0&&(t={});var n=t,i=n.placement,r=i===void 0?e.placement:i,s=n.strategy,a=s===void 0?e.strategy:s,c=n.boundary,o=c===void 0?Di:c,l=n.rootBoundary,d=l===void 0?Ge:l,b=n.elementContext,v=b===void 0?St:b,h=n.altBoundary,$=h===void 0?!1:h,u=n.padding,w=u===void 0?0:u,E=en(typeof w!="number"?w:nn(w,kt)),O=v===St?Mi:St,L=e.rects.popper,m=e.elements[$?O:v],y=fr(tt(m)?m:m.contextElement||X(e.elements.popper),o,d,a),x=mt(e.elements.reference),k=ln({reference:x,element:L,strategy:"absolute",placement:r}),T=be(Object.assign({},L,k)),S=v===St?T:x,C={top:y.top-S.top+E.top,bottom:S.bottom-y.bottom+E.bottom,left:y.left-S.left+E.left,right:S.right-y.right+E.right},I=e.modifiersData.offset;if(v===St&&I){var V=I[r];Object.keys(C).forEach(function(A){var nt=[W,N].indexOf(A)>=0?1:-1,it=[P,N].indexOf(A)>=0?"y":"x";C[A]+=V[it]*nt})}return C}function pr(e,t){t===void 0&&(t={});var n=t,i=n.placement,r=n.boundary,s=n.rootBoundary,a=n.padding,c=n.flipVariations,o=n.allowedAutoPlacements,l=o===void 0?Ze:o,d=vt(i),b=d?c?Qe:Qe.filter(function($){return vt($)===d}):kt,v=b.filter(function($){return l.indexOf($)>=0});v.length===0&&(v=b);var h=v.reduce(function($,u){return $[u]=Pt(e,{placement:u,boundary:r,rootBoundary:s,padding:a})[z(u)],$},{});return Object.keys(h).sort(function($,u){return h[$]-h[u]})}function gr(e){if(z(e)===de)return[];var t=Jt(e);return[sn(e),t,sn(t)]}function mr(e){var t=e.state,n=e.options,i=e.name;if(!t.modifiersData[i]._skip){for(var r=n.mainAxis,s=r===void 0?!0:r,a=n.altAxis,c=a===void 0?!0:a,o=n.fallbackPlacements,l=n.padding,d=n.boundary,b=n.rootBoundary,v=n.altBoundary,h=n.flipVariations,$=h===void 0?!0:h,u=n.allowedAutoPlacements,w=t.options.placement,E=z(w),O=E===w,L=o||(O||!$?[Jt(w)]:gr(w)),m=[w].concat(L).reduce(function(st,Q){return st.concat(z(Q)===de?pr(t,{placement:Q,boundary:d,rootBoundary:b,padding:l,flipVariations:$,allowedAutoPlacements:u}):Q)},[]),y=t.rects.reference,x=t.rects.popper,k=new Map,T=!0,S=m[0],C=0;C<m.length;C++){var I=m[C],V=z(I),A=vt(I)===pt,nt=[P,N].indexOf(V)>=0,it=nt?"width":"height",F=Pt(t,{placement:I,boundary:d,rootBoundary:b,altBoundary:v,padding:l}),H=nt?A?W:D:A?N:P;y[it]>x[it]&&(H=Jt(H));var zt=Jt(H),rt=[];if(s&&rt.push(F[V]<=0),c&&rt.push(F[H]<=0,F[zt]<=0),rt.every(function(st){return st})){S=I,T=!1;break}k.set(I,rt)}if(T)for(var Kt=$?3:1,$e=function(st){var Q=m.find(function(Qt){var jt=k.get(Qt);if(jt)return jt.slice(0,st).every(function(bt){return bt})});if(Q)return S=Q,"break"},Mt=Kt;Mt>0;Mt--){var Gt=$e(Mt);if(Gt==="break")break}t.placement!==S&&(t.modifiersData[i]._skip=!0,t.placement=S,t.reset=!0)}}const vr={name:"flip",enabled:!0,phase:"main",fn:mr,requiresIfExists:["offset"],data:{_skip:!1}};function cn(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function dn(e){return[P,W,N,D].some(function(t){return e[t]>=0})}function br(e){var t=e.state,n=e.name,i=t.rects.reference,r=t.rects.popper,s=t.modifiersData.preventOverflow,a=Pt(t,{elementContext:"reference"}),c=Pt(t,{altBoundary:!0}),o=cn(a,i),l=cn(c,r,s),d=dn(o),b=dn(l);t.modifiersData[n]={referenceClippingOffsets:o,popperEscapeOffsets:l,isReferenceHidden:d,hasPopperEscaped:b},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":b})}const yr={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:br};function wr(e,t,n){var i=z(e),r=[D,P].indexOf(i)>=0?-1:1,s=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=s[0],c=s[1];return a=a||0,c=(c||0)*r,[D,W].indexOf(i)>=0?{x:c,y:a}:{x:a,y:c}}function $r(e){var t=e.state,n=e.options,i=e.name,r=n.offset,s=r===void 0?[0,0]:r,a=Ze.reduce(function(d,b){return d[b]=wr(b,t.rects,s),d},{}),c=a[t.placement],o=c.x,l=c.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=o,t.modifiersData.popperOffsets.y+=l),t.modifiersData[i]=a}const Er={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:$r};function xr(e){var t=e.state,n=e.name;t.modifiersData[n]=ln({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const Or={name:"popperOffsets",enabled:!0,phase:"read",fn:xr,data:{}};function Lr(e){return e==="x"?"y":"x"}function kr(e){var t=e.state,n=e.options,i=e.name,r=n.mainAxis,s=r===void 0?!0:r,a=n.altAxis,c=a===void 0?!1:a,o=n.boundary,l=n.rootBoundary,d=n.altBoundary,b=n.padding,v=n.tether,h=v===void 0?!0:v,$=n.tetherOffset,u=$===void 0?0:$,w=Pt(t,{boundary:o,rootBoundary:l,padding:b,altBoundary:d}),E=z(t.placement),O=vt(t.placement),L=!O,m=pe(E),y=Lr(m),x=t.modifiersData.popperOffsets,k=t.rects.reference,T=t.rects.popper,S=typeof u=="function"?u(Object.assign({},t.rects,{placement:t.placement})):u,C=typeof S=="number"?{mainAxis:S,altAxis:S}:Object.assign({mainAxis:0,altAxis:0},S),I=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,V={x:0,y:0};if(x){if(s){var A,nt=m==="y"?P:D,it=m==="y"?N:W,F=m==="y"?"height":"width",H=x[m],zt=H+w[nt],rt=H-w[it],Kt=h?-T[F]/2:0,$e=O===pt?k[F]:T[F],Mt=O===pt?-T[F]:-k[F],Gt=t.elements.arrow,st=h&&Gt?fe(Gt):{width:0,height:0},Q=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:tn(),Qt=Q[nt],jt=Q[it],bt=It(0,k[F],st[F]),Br=L?k[F]/2-Kt-bt-Qt-C.mainAxis:$e-bt-Qt-C.mainAxis,Rr=L?-k[F]/2+Kt+bt+jt+C.mainAxis:Mt+bt+jt+C.mainAxis,Ee=t.elements.arrow&&Ct(t.elements.arrow),Vr=Ee?m==="y"?Ee.clientTop||0:Ee.clientLeft||0:0,gn=(A=I==null?void 0:I[m])!=null?A:0,Hr=H+Br-gn-Vr,Jr=H+Rr-gn,mn=It(h?Rt(zt,Hr):zt,H,h?et(rt,Jr):rt);x[m]=mn,V[m]=mn-H}if(c){var vn,zr=m==="x"?P:D,Kr=m==="x"?N:W,ot=x[y],Zt=y==="y"?"height":"width",bn=ot+w[zr],yn=ot-w[Kr],xe=[P,D].indexOf(E)!==-1,wn=(vn=I==null?void 0:I[y])!=null?vn:0,$n=xe?bn:ot-k[Zt]-T[Zt]-wn+C.altAxis,En=xe?ot+k[Zt]+T[Zt]-wn-C.altAxis:yn,xn=h&&xe?Zi($n,ot,En):It(h?$n:bn,ot,h?En:yn);x[y]=xn,V[y]=xn-ot}t.modifiersData[i]=V}}const Tr={name:"preventOverflow",enabled:!0,phase:"main",fn:kr,requiresIfExists:["offset"]};function Sr(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Cr(e){return e===q(e)||!_(e)?ge(e):Sr(e)}function Ir(e){var t=e.getBoundingClientRect(),n=gt(t.width)/e.offsetWidth||1,i=gt(t.height)/e.offsetHeight||1;return n!==1||i!==1}function Ar(e,t,n){n===void 0&&(n=!1);var i=_(t),r=_(t)&&Ir(t),s=X(t),a=mt(e,r,n),c={scrollLeft:0,scrollTop:0},o={x:0,y:0};return(i||!i&&!n)&&((J(t)!=="body"||ve(s))&&(c=Cr(t)),_(t)?(o=mt(t,!0),o.x+=t.clientLeft,o.y+=t.clientTop):s&&(o.x=me(s))),{x:a.left+c.scrollLeft-o.x,y:a.top+c.scrollTop-o.y,width:a.width,height:a.height}}function Pr(e){var t=new Map,n=new Set,i=[];e.forEach(function(s){t.set(s.name,s)});function r(s){n.add(s.name);var a=[].concat(s.requires||[],s.requiresIfExists||[]);a.forEach(function(c){if(!n.has(c)){var o=t.get(c);o&&r(o)}}),i.push(s)}return e.forEach(function(s){n.has(s.name)||r(s)}),i}function Dr(e){var t=Pr(e);return Hi.reduce(function(n,i){return n.concat(t.filter(function(r){return r.phase===i}))},[])}function Mr(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function jr(e){var t=e.reduce(function(n,i){var r=n[i.name];return n[i.name]=r?Object.assign({},r,i,{options:Object.assign({},r.options,i.options),data:Object.assign({},r.data,i.data)}):i,n},{});return Object.keys(t).map(function(n){return t[n]})}var un={placement:"bottom",modifiers:[],strategy:"absolute"};function hn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(i){return!(i&&typeof i.getBoundingClientRect=="function")})}function qr(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,i=n===void 0?[]:n,r=t.defaultOptions,s=r===void 0?un:r;return function(a,c,o){o===void 0&&(o=s);var l={placement:"bottom",orderedModifiers:[],options:Object.assign({},un,s),modifiersData:{},elements:{reference:a,popper:c},attributes:{},styles:{}},d=[],b=!1,v={state:l,setOptions:function(u){var w=typeof u=="function"?u(l.options):u;$(),l.options=Object.assign({},s,l.options,w),l.scrollParents={reference:tt(a)?At(a):a.contextElement?At(a.contextElement):[],popper:At(c)};var E=Dr(jr([].concat(i,l.options.modifiers)));return l.orderedModifiers=E.filter(function(O){return O.enabled}),h(),v.update()},forceUpdate:function(){if(!b){var u=l.elements,w=u.reference,E=u.popper;if(hn(w,E)){l.rects={reference:Ar(w,Ct(E),l.options.strategy==="fixed"),popper:fe(E)},l.reset=!1,l.placement=l.options.placement,l.orderedModifiers.forEach(function(T){return l.modifiersData[T.name]=Object.assign({},T.data)});for(var O=0;O<l.orderedModifiers.length;O++){if(l.reset===!0){l.reset=!1,O=-1;continue}var L=l.orderedModifiers[O],m=L.fn,y=L.options,x=y===void 0?{}:y,k=L.name;typeof m=="function"&&(l=m({state:l,options:x,name:k,instance:v})||l)}}}},update:Mr(function(){return new Promise(function(u){v.forceUpdate(),u(l)})}),destroy:function(){$(),b=!0}};if(!hn(a,c))return v;v.setOptions(o).then(function(u){!b&&o.onFirstUpdate&&o.onFirstUpdate(u)});function h(){l.orderedModifiers.forEach(function(u){var w=u.name,E=u.options,O=E===void 0?{}:E,L=u.effect;if(typeof L=="function"){var m=L({state:l,name:w,instance:v,options:O}),y=function(){};d.push(m||y)}})}function $(){d.forEach(function(u){return u()}),d=[]}return v}}var Fr=[or,Or,rr,Ki,Er,vr,Tr,tr,yr],Nr=qr({defaultModifiers:Fr});async function ye(e){const t=this.collection.findIndex(n=>n.id===e.id);if(t>=0){const n=this.collection[t];n.state==="opened"&&n.close(),n.popper.destroy(),fn(n),Object.getOwnPropertyNames(n).forEach(i=>{delete n[i]}),this.collection.splice(t,1)}return this.collection}function fn(e){return e.__eventListeners&&(e.__eventListeners.forEach(t=>{t.el.forEach(n=>{t.type.forEach(i=>{e[n].removeEventListener(i,t.listener,!1)})})}),delete e.__eventListeners),e}async function we(e){const t=He.call(this,e);return t.el.classList.add(this.settings.stateActive),t.trigger.hasAttribute("aria-controls")&&t.trigger.setAttribute("aria-expanded","true"),t.config=Ve(t.el,this.settings),t.popper.setOptions({placement:t.config.placement,modifiers:[{name:"eventListeners",enabled:!0},...Si(t.config)]}),t.popper.update(),t.state="opened",t}async function Wr(e,t){ye.call(this,e);const n=this,i={id:e.id,state:"closed",el:e,trigger:t,popper:Nr(t,e),config:Ve(e,this.settings),open(){return we.call(n,this)},close(){return ce.call(n,this)},deregister(){return ye.call(n,this)}};return i.trigger.hasAttribute("aria-controls")&&i.trigger.setAttribute("aria-expanded","false"),pn.call(this,i),this.collection.push(i),i.el.classList.contains(this.settings.stateActive)&&(await i.open(),Ke.call(this,i)),i}function pn(e){return e.__eventListeners||(e.config.event==="hover"?(e.__eventListeners=[{el:["trigger"],type:["mouseenter","focus"],listener:we.bind(this,e)},{el:["el","trigger"],type:["mouseleave","focusout"],listener:ze.bind(this,e)}],e.__eventListeners.forEach(t=>{t.el.forEach(n=>{t.type.forEach(i=>{e[n].addEventListener(i,t.listener,!1)})})})):(e.__eventListeners=[{el:["trigger"],type:["click"],listener:Ai.bind(this,e)}],e.__eventListeners.forEach(t=>{t.el.forEach(n=>{t.type.forEach(i=>{e[n].addEventListener(i,t.listener,!1)})})}))),e}var Dt;class _r extends Li{constructor(t){super(),xi(this,Dt,void 0),this.defaults=Ti,this.settings={...this.defaults,...t},this.trigger=null,Oi(this,Dt,Pi.bind(this)),this.settings.autoInit&&this.init()}async init(t){t&&(this.settings={...this.settings,...t});const n=document.querySelectorAll(this.settings.selectorPopover);return await this.registerCollection(n),this.settings.eventListeners&&this.initEventListeners(!1),this}async destroy(){return this.trigger=null,await this.deregisterCollection(),this.settings.eventListeners&&this.destroyEventListeners(!1),this}initEventListeners(t=!0){t&&this.collection.forEach(n=>{pn.call(this,n)}),document.addEventListener("keydown",Re(this,Dt),!1)}destroyEventListeners(t=!0){t&&this.collection.forEach(n=>{fn(n)}),document.removeEventListener("keydown",Re(this,Dt),!1)}register(t){const n=Ii.call(this,t);return n.error?Promise.reject(n.error):Wr.call(this,n.popover,n.trigger)}deregister(t){let n=this.get(t.id||t);return n?ye.call(this,n):Promise.reject(new Error(`Failed to deregister; popover does not exist in collection with ID of: "${t.id||t}".`))}open(t){return we.call(this,t)}close(t){return ce.call(this,t)}}Dt=new WeakMap,K.Drawer=si,K.Modal=Ei,K.Popover=_r,K.core=Fn,Object.defineProperty(K,Symbol.toStringTag,{value:"Module"})});
6
10
  //# sourceMappingURL=index.umd.cjs.map