1(()=>{var Te=class extends Event{oldState;newState;constructor(i,{oldState:t="",newState:e="",...s}={}){super(i,s),this.oldState=String(t||""),this.newState=String(e||"")}},Ps=new WeakMap;function Rs(i,t,e){Ps.set(i,setTimeout(()=>{Ps.has(i)&&i.dispatchEvent(new Te("toggle",{cancelable:!1,oldState:t,newState:e}))},0))}var bi=globalThis.ShadowRoot||function(){},Za=globalThis.HTMLDialogElement||function(){},_e=new WeakMap,vt=new WeakMap,Qt=new WeakMap;function ke(i){return Qt.get(i)||"hidden"}var Ee=new WeakMap;function Qa(i){let t=i.popoverTargetElement;if(!(t instanceof HTMLElement))return;let e=ke(t);i.popoverTargetAction==="show"&&e==="showing"||i.popoverTargetAction==="hide"&&e==="hidden"||(e==="showing"?Zt(t,!0,!0):Tt(t,!1)&&(Ee.set(t,i),pi(t)))}function Tt(i,t){return!(i.popover!=="auto"&&i.popover!=="manual"||!i.isConnected||t&&ke(i)!=="showing"||!t&&ke(i)!=="hidden"||i instanceof Za&&i.hasAttribute("open")||document.fullscreenElement===i)}function Ls(i){return i?Array.from(vt.get(i.ownerDocument)||[]).indexOf(i)+1:0}function tr(i){let t=Us(i),e=er(i);return Ls(t)>Ls(e)?t:e}function Ce(i){let t=vt.get(i);for(let e of t||[])if(!e.isConnected)t.delete(e);else return e;return null}function Rt(i){return typeof i.getRootNode=="function"?i.getRootNode():i.parentNode?Rt(i.parentNode):i}function Us(i){for(;i;){if(i instanceof HTMLElement&&i.popover==="auto"&&Qt.get(i)==="showing")return i;if(i=i instanceof Element&&i.assignedSlot||i.parentElement||Rt(i),i instanceof bi&&(i=i.host),i instanceof Document)return}}function er(i){for(;i;){let t=i.popoverTargetElement;if(t instanceof HTMLElement)return t;if(i=i.parentElement||Rt(i),i instanceof bi&&(i=i.host),i instanceof Document)return}}function ir(i){let t=new Map,e=0;for(let r of vt.get(i.ownerDocument)||[])t.set(r,e),e+=1;t.set(i,e),e+=1;let s=null;function a(r){let n=Us(r);if(n===null)return null;let l=t.get(n);(s===null||t.get(s)<l)&&(s=n)}return a(i.parentElement||Rt(i)),s}function sr(i){return i.hidden||i instanceof bi||(i instanceof HTMLButtonElement||i instanceof HTMLInputElement||i instanceof HTMLSelectElement||i instanceof HTMLTextAreaElement||i instanceof HTMLOptGroupElement||i instanceof HTMLOptionElement||i instanceof HTMLFieldSetElement)&&i.disabled||i instanceof HTMLInputElement&&i.type==="hidden"||i instanceof HTMLAnchorElement&&i.href===""?!1:typeof i.tabIndex=="number"&&i.tabIndex!==-1}function ar(i){if(i.shadowRoot&&i.shadowRoot.delegatesFocus!==!0)return null;let t=i;t.shadowRoot&&(t=t.shadowRoot);let e=t.querySelector("[autofocus]");if(e)return e;{let r=t.querySelectorAll("slot");for(let n of r){let l=n.assignedElements({flatten:!0});for(let o of l){if(o.hasAttribute("autofocus"))return o;if(e=o.querySelector("[autofocus]"),e)return e}}}let s=i.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_ELEMENT),a=s.currentNode;for(;a;){if(sr(a))return a;a=s.nextNode()}}function rr(i){ar(i)?.focus()}var De=new WeakMap;function pi(i){if(!Tt(i,!1))return;let t=i.ownerDocument;if(!i.dispatchEvent(new Te("beforetoggle",{cancelable:!0,oldState:"closed",newState:"open"}))||!Tt(i,!1))return;let e=!1;if(i.popover==="auto"){let a=i.getAttribute("popover"),r=ir(i)||t;if(Me(r,!1,!0),a!==i.getAttribute("popover")||!Tt(i,!1))return}Ce(t)||(e=!0),De.delete(i);let s=t.activeElement;i.classList.add(":popover-open"),Qt.set(i,"showing"),_e.has(t)||_e.set(t,new Set),_e.get(t).add(i),rr(i),i.popover==="auto"&&(vt.has(t)||vt.set(t,new Set),vt.get(t).add(i),qs(Ee.get(i),!0)),e&&s&&i.popover==="auto"&&De.set(i,s),Rs(i,"closed","open")}function Zt(i,t=!1,e=!1){if(!Tt(i,!0))return;let s=i.ownerDocument;if(i.popover==="auto"&&(Me(i,t,e),!Tt(i,!0))||(qs(Ee.get(i),!1),Ee.delete(i),e&&(i.dispatchEvent(new Te("beforetoggle",{oldState:"open",newState:"closed"})),!Tt(i,!0))))return;_e.get(s)?.delete(i),vt.get(s)?.delete(i),i.classList.remove(":popover-open"),Qt.set(i,"hidden"),e&&Rs(i,"open","closed");let a=De.get(i);a&&(De.delete(i),t&&a.focus())}function Is(i,t=!1,e=!1){let s=Ce(i);for(;s;)Zt(s,t,e),s=Ce(i)}function Me(i,t,e){let s=i.ownerDocument||i;if(i instanceof Document)return Is(s,t,e);let a=null,r=!1;for(let n of vt.get(s)||[])if(n===i)r=!0;else if(r){a=n;break}if(!r)return Is(s,t,e);for(;a&&ke(a)==="showing"&&vt.get(s)?.size;)Zt(a,t,e)}var hi=new WeakMap;function Ns(i){if(!i.isTrusted)return;let t=i.composedPath()[0];if(!t)return;let e=t.ownerDocument;if(!Ce(e))return;let a=tr(t);if(a&&i.type==="pointerdown")hi.set(e,a);else if(i.type==="pointerup"){let r=hi.get(e)===a;hi.delete(e),r&&Me(a||e,!1,!0)}}var di=new WeakMap;function qs(i,t=!1){if(!i)return;di.has(i)||di.set(i,i.getAttribute("aria-expanded"));let e=i.popoverTargetElement;if(e instanceof HTMLElement&&e.popover==="auto")i.setAttribute("aria-expanded",String(t));else{let s=di.get(i);s?i.setAttribute("aria-expanded",s):i.removeAttribute("aria-expanded")}}var Fs=globalThis.ShadowRoot||function(){};function nr(){return typeof HTMLElement<"u"&&typeof HTMLElement.prototype=="object"&&"popover"in HTMLElement.prototype}function Dt(i,t,e){let s=i[t];Object.defineProperty(i,t,{value(a){return s.call(this,e(a))}})}var or=/(^|[^\\]):popover-open\b/g;function lr(){return typeof globalThis.CSSLayerBlockRule=="function"}function ur(){let i=lr();return` 2${i?"@layer popover-polyfill {":""} 3 :where([popover]) { 4 position: fixed; 5 z-index: 2147483647; 6 inset: 0; 7 padding: 0.25em; 8 width: fit-content; 9 height: fit-content; 10 border-width: initial; 11 border-color: initial; 12 border-image: initial; 13 border-style: solid; 14 background-color: canvas; 15 color: canvastext; 16 overflow: auto; 17 margin: auto; 18 } 19 20 :where([popover]:not(.\\:popover-open)) { 21 display: none; 22 } 23 24 :where(dialog[popover].\\:popover-open) { 25 display: block; 26 } 27 28 :where(dialog[popover][open]) { 29 display: revert; 30 } 31 32 :where([anchor].\\:popover-open) { 33 inset: auto; 34 } 35 36 :where([anchor]:popover-open) { 37 inset: auto; 38 } 39 40 @supports not (background-color: canvas) { 41 :where([popover]) { 42 background-color: white; 43 color: black; 44 } 45 } 46 47 @supports (width: -moz-fit-content) { 48 :where([popover]) { 49 width: -moz-fit-content; 50 height: -moz-fit-content; 51 } 52 } 53 54 @supports not (inset: 0) { 55 :where([popover]) { 56 top: 0; 57 left: 0; 58 right: 0; 59 bottom: 0; 60 } 61 } 62${i?"}":""} 63`}var Ft=null;function fi(i){let t=ur();if(Ft===null)try{Ft=new CSSStyleSheet,Ft.replaceSync(t)}catch{Ft=!1}if(Ft===!1){let e=document.createElement("style");e.textContent=t,i instanceof Document?i.head.prepend(e):i.prepend(e)}else i.adoptedStyleSheets=[Ft,...i.adoptedStyleSheets]}function cr(){if(typeof window>"u")return;window.ToggleEvent=window.ToggleEvent||Te;function i(o){return o?.includes(":popover-open")&&(o=o.replace(or,"$1.\\:popover-open")),o}
63Dt(Document.prototype,"querySelector",i),Dt(Document.prototype,"querySelectorAll",i),Dt(Element.prototype,"querySelector",i),Dt(Element.prototype,"querySelectorAll",i),Dt(Element.prototype,"matches",i),Dt(Element.prototype,"closest",i),Dt(DocumentFragment.prototype,"querySelectorAll",i),Object.defineProperties(HTMLElement.prototype,{popover:{enumerable:!0,configurable:!0,get(){if(!this.hasAttribute("popover"))return null;let o=(this.getAttribute("popover")||"").toLowerCase();return o===""||o=="auto"?"auto":"manual"},set(o){o===null?this.removeAttribute("popover"):this.setAttribute("popover",o)}},showPopover:{enumerable:!0,configurable:!0,value(){pi(this)}},hidePopover:{enumerable:!0,configurable:!0,value(){Zt(this,!0,!0)}},togglePopover:{enumerable:!0,configurable:!0,value(o){Qt.get(this)==="showing"&&o===void 0||o===!1?Zt(this,!0,!0):(o===void 0||o===!0)&&pi(this)}}});let t=Element.prototype.attachShadow;t&&Object.defineProperties(Element.prototype,{attachShadow:{enumerable:!0,configurable:!0,writable:!0,value(o){let u=t.call(this,o);return fi(u),u}}});let e=HTMLElement.prototype.attachInternals;e&&Object.defineProperties(HTMLElement.prototype,{attachInternals:{enumerable:!0,configurable:!0,writable:!0,value(){let o=e.call(this);return o.shadowRoot&&fi(o.shadowRoot),o}}});let s=new WeakMap;function a(o){Object.defineProperties(o.prototype,{popoverTargetElement:{enumerable:!0,configurable:!0,set(u){if(u===null)this.removeAttribute("popovertarget"),s.delete(this);else if(u instanceof Element)this.setAttribute("popovertarget",""),s.set(this,u);else throw new TypeError("popoverTargetElement must be an element or null")},get(){if(this.localName!=="button"&&this.localName!=="input"||this.localName==="input"&&this.type!=="reset"&&this.type!=="image"&&this.type!=="button"||this.disabled||this.form&&this.type==="submit")return null;let u=s.get(this);if(u&&u.isConnected)return u;if(u&&!u.isConnected)return s.delete(this),null;let h=Rt(this),p=this.getAttribute("popovertarget");return(h instanceof Document||h instanceof Fs)&&p&&h.getElementById(p)||null}},popoverTargetAction:{enumerable:!0,configurable:!0,get(){let u=(this.getAttribute("popovertargetaction")||"").toLowerCase();return u==="show"||u==="hide"?u:"toggle"},set(u){this.setAttribute("popovertargetaction",u)}}})}a(HTMLButtonElement),a(HTMLInputElement);let r=o=>{let u=o.composedPath(),h=u[0];if(!(h instanceof Element)||h?.shadowRoot)return;let p=Rt(h);if(!(p instanceof Fs||p instanceof Document))return;let g=u.find(v=>v.matches?.("[popovertargetaction],[popovertarget]"));if(g){Qa(g),o.preventDefault();return}},n=o=>{let u=o.key,h=o.target;!o.defaultPrevented&&h&&(u==="Escape"||u==="Esc")&&Me(h.ownerDocument,!0,!0)};(o=>{o.addEventListener("click",r),o.addEventListener("keydown",n),o.addEventListener("pointerdown",Ns),o.addEventListener("pointerup",Ns)})(document),fi(document)}nr()||cr();var Fe=class extends Event{oldState;newState;constructor(i,{oldState:t="",newState:e="",...s}={}){super(i,s),this.oldState=String(t||""),this.newState=String(e||"")}},Ws=new WeakMap;function $s(i,t,e){Ws.set(i,setTimeout(()=>{Ws.has(i)&&i.dispatchEvent(new Fe("toggle",{cancelable:!1,oldState:t,newState:e}))},0))}var wi=globalThis.ShadowRoot||function(){},hr=globalThis.HTMLDialogElement||function(){},Oe=new WeakMap,yt=new WeakMap,ee=new WeakMap;function Pe(i){return ee.get(i)||"hidden"}var Le=new WeakMap;function dr(i){let t=i.popoverTargetElement;if(!(t instanceof HTMLElement))return;let e=Pe(t);i.popoverTargetAction==="show"&&e==="showing"||i.popoverTargetAction==="hide"&&e==="hidden"||(e==="showing"?te(t,!0,!0):Ot(t,!1)&&(Le.set(t,i),yi(t)))}function Ot(i,t){return!(i.popover!=="auto"&&i.popover!=="manual"||!i.isConnected||t&&Pe(i)!=="showing"||!t&&Pe(i)!=="hidden"||i instanceof hr&&i.hasAttribute("open")||document.fullscreenElement===i)}function Vs(i){return i?Array.from(yt.get(i.ownerDocument)||[]).indexOf(i)+1:0}function fr(i){let t=zs(i),e=pr(i);return Vs(t)>Vs(e)?t:e}function Ie(i){let t=yt.get(i);for(let e of t||[])if(!e.isConnected)t.delete(e);else return e;return null}function qt(i){return typeof i.getRootNode=="function"?i.getRootNode():i.parentNode?qt(i.parentNode):i}function zs(i){for(;i;){if(i instanceof HTMLElement&&i.popover==="auto"&&ee.get(i)==="showing")return i;if(i=i instanceof Element&&i.assignedSlot||i.parentElement||qt(i),i instanceof wi&&(i=i.host),i instanceof Document)return}}function pr(i){for(;i;){let t=i.popoverTargetElement;if(t instanceof HTMLElement)return t;if(i=i.parentElement||qt(i),i instanceof wi&&(i=i.host),i instanceof Document)return}}function br(i){let t=new Map,e=0;for(let r of yt.get(i.ownerDocument)||[])t.set(r,e),e+=1;t.set(i,e),e+=1;let s=null;function a(r){let n=zs(r);if(n===null)return null;let l=t.get(n);(s===null||t.get(s)<l)&&(s=n)}return a(i.parentElement||qt(i)),s}function mr(i){return i.hidden||i instanceof wi||(i instanceof HTMLButtonElement||i instanceof HTMLInputElement||i instanceof HTMLSelectElement||i instanceof HTMLTextAreaElement||i instanceof HTMLOptGroupElement||i instanceof HTMLOptionElement||i instanceof HTMLFieldSetElement)&&i.disabled||i instanceof HTMLInputElement&&i.type==="hidden"||i instanceof HTMLAnchorElement&&i.href===""?!1:typeof i.tabIndex=="number"&&i.tabIndex!==-1}function gr(i){if(i.shadowRoot&&i.shadowRoot.delegatesFocus!==!0)return null;let t=i;t.shadowRoot&&(t=t.shadowRoot);let e=t.querySelector("[autofocus]");if(e)return e;{let r=t.querySelectorAll("slot");for(let n of r){let l=n.assignedElements({flatten:!0});for(let o of l){if(o.hasAttribute("autofocus"))return o;if(e=o.querySelector("[autofocus]"),e)return e}}}let s=i.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_ELEMENT),a=s.currentNode;for(;a;){if(mr(a))return a;a=s.nextNode()}}
63function vr(i){gr(i)?.focus()}var Ne=new WeakMap;function yi(i){if(!Ot(i,!1))return;let t=i.ownerDocument;if(!i.dispatchEvent(new Fe("beforetoggle",{cancelable:!0,oldState:"closed",newState:"open"}))||!Ot(i,!1))return;let e=!1;if(i.popover==="auto"){let a=i.getAttribute("popover"),r=br(i)||t;if(Re(r,!1,!0),a!==i.getAttribute("popover")||!Ot(i,!1))return}Ie(t)||(e=!0),Ne.delete(i);let s=t.activeElement;i.classList.add(":popover-open"),ee.set(i,"showing"),Oe.has(t)||Oe.set(t,new Set),Oe.get(t).add(i),vr(i),i.popover==="auto"&&(yt.has(t)||yt.set(t,new Set),yt.get(t).add(i),js(Le.get(i),!0)),e&&s&&i.popover==="auto"&&Ne.set(i,s),$s(i,"closed","open")}function te(i,t=!1,e=!1){if(!Ot(i,!0))return;let s=i.ownerDocument;if(i.popover==="auto"&&(Re(i,t,e),!Ot(i,!0))||(js(Le.get(i),!1),Le.delete(i),e&&(i.dispatchEvent(new Fe("beforetoggle",{oldState:"open",newState:"closed"})),!Ot(i,!0))))return;Oe.get(s)?.delete(i),yt.get(s)?.delete(i),i.classList.remove(":popover-open"),ee.set(i,"hidden"),e&&$s(i,"open","closed");let a=Ne.get(i);a&&(Ne.delete(i),t&&a.focus())}function Bs(i,t=!1,e=!1){let s=Ie(i);for(;s;)te(s,t,e),s=Ie(i)}function Re(i,t,e){let s=i.ownerDocument||i;if(i instanceof Document)return Bs(s,t,e);let a=null,r=!1;for(let n of yt.get(s)||[])if(n===i)r=!0;else if(r){a=n;break}if(!r)return Bs(s,t,e);for(;a&&Pe(a)==="showing"&&yt.get(s)?.size;)te(a,t,e)}var mi=new WeakMap;function Hs(i){if(!i.isTrusted)return;let t=i.composedPath()[0];if(!t)return;let e=t.ownerDocument;if(!Ie(e))return;let a=fr(t);if(a&&i.type==="pointerdown")mi.set(e,a);else if(i.type==="pointerup"){let r=mi.get(e)===a;mi.delete(e),r&&Re(a||e,!1,!0)}}var gi=new WeakMap;function js(i,t=!1){if(!i)return;gi.has(i)||gi.set(i,i.getAttribute("aria-expanded"));let e=i.popoverTargetElement;if(e instanceof HTMLElement&&e.popover==="auto")i.setAttribute("aria-expanded",String(t));else{let s=gi.get(i);s?i.setAttribute("aria-expanded",s):i.removeAttribute("aria-expanded")}}var Ys=globalThis.ShadowRoot||function(){};function Gs(){return typeof HTMLElement<"u"&&typeof HTMLElement.prototype=="object"&&"popover"in HTMLElement.prototype}function Xs(){return!!(document.body?.showPopover&&!/native code/i.test(document.body.showPopover.toString()))}function Mt(i,t,e){let s=i[t];Object.defineProperty(i,t,{value(a){return s.call(this,e(a))}})}var yr=/(^|[^\\]):popover-open\b/g;function wr(){return typeof globalThis.CSSLayerBlockRule=="function"}function xr(){let i=wr();return` 64${i?"@layer popover-polyfill {":""} 65 :where([popover]) { 66 position: fixed; 67 z-index: 2147483647; 68 inset: 0; 69 padding: 0.25em; 70 width: fit-content; 71 height: fit-content; 72 border-width: initial; 73 border-color: initial; 74 border-image: initial; 75 border-style: solid; 76 background-color: canvas; 77 color: canvastext; 78 overflow: auto; 79 margin: auto; 80 } 81 82 :where([popover]:not(.\\:popover-open)) { 83 display: none; 84 } 85 86 :where(dialog[popover].\\:popover-open) { 87 display: block; 88 } 89 90 :where(dialog[popover][open]) { 91 display: revert; 92 } 93 94 :where([anchor].\\:popover-open) { 95 inset: auto; 96 } 97 98 :where([anchor]:popover-open) { 99 inset: auto; 100 } 101 102 @supports not (background-color: canvas) { 103 :where([popover]) { 104 background-color: white; 105 color: black; 106 } 107 } 108 109 @supports (width: -moz-fit-content) { 110 :where([popover]) { 111 width: -moz-fit-content; 112 height: -moz-fit-content; 113 } 114 } 115 116 @supports not (inset: 0) { 117 :where([popover]) { 118 top: 0; 119 left: 0; 120 right: 0; 121 bottom: 0; 122 } 123 } 124${i?"}":""} 125`}var Ut=null;function vi(i){let t=xr();if(Ut===null)try{Ut=new CSSStyleSheet,Ut.replaceSync(t)}catch{Ut=!1}if(Ut===!1){let e=document.createElement("style");e.textContent=t,i instanceof Document?i.head.prepend(e):i.prepend(e)}else i.adoptedStyleSheets=[Ut,...i.adoptedStyleSheets]}function Ks(){if(typeof window>"u")return;window.ToggleEvent=window.ToggleEvent||Fe;function i(o){return o?.includes(":popover-open")&&(o=o.replace(yr,"$1.\\:popover-open")),o}Mt(Document.prototype,"querySelector",i),Mt(Document.prototype,"querySelectorAll",i),Mt(Element.prototype,"querySelector",i),Mt(Element.prototype,"querySelectorAll",i),Mt(Element.prototype,"matches",i),Mt(Element.prototype,"closest",i),Mt(DocumentFragment.prototype,"querySelectorAll",i),Object.defineProperties(HTMLElement.prototype,{popover:{enumerable:!0,configurable:!0,get(){if
125(!this.hasAttribute("popover"))return null;let o=(this.getAttribute("popover")||"").toLowerCase();return o===""||o=="auto"?"auto":"manual"},set(o){o===null?this.removeAttribute("popover"):this.setAttribute("popover",o)}},showPopover:{enumerable:!0,configurable:!0,value(){yi(this)}},hidePopover:{enumerable:!0,configurable:!0,value(){te(this,!0,!0)}},togglePopover:{enumerable:!0,configurable:!0,value(o){ee.get(this)==="showing"&&o===void 0||o===!1?te(this,!0,!0):(o===void 0||o===!0)&&yi(this)}}});let t=Element.prototype.attachShadow;t&&Object.defineProperties(Element.prototype,{attachShadow:{enumerable:!0,configurable:!0,writable:!0,value(o){let u=t.call(this,o);return vi(u),u}}});let e=HTMLElement.prototype.attachInternals;e&&Object.defineProperties(HTMLElement.prototype,{attachInternals:{enumerable:!0,configurable:!0,writable:!0,value(){let o=e.call(this);return o.shadowRoot&&vi(o.shadowRoot),o}}});let s=new WeakMap;function a(o){Object.defineProperties(o.prototype,{popoverTargetElement:{enumerable:!0,configurable:!0,set(u){if(u===null)this.removeAttribute("popovertarget"),s.delete(this);else if(u instanceof Element)this.setAttribute("popovertarget",""),s.set(this,u);else throw new TypeError("popoverTargetElement must be an element or null")},get(){if(this.localName!=="button"&&this.localName!=="input"||this.localName==="input"&&this.type!=="reset"&&this.type!=="image"&&this.type!=="button"||this.disabled||this.form&&this.type==="submit")return null;let u=s.get(this);if(u&&u.isConnected)return u;if(u&&!u.isConnected)return s.delete(this),null;let h=qt(this),p=this.getAttribute("popovertarget");return(h instanceof Document||h instanceof Ys)&&p&&h.getElementById(p)||null}},popoverTargetAction:{enumerable:!0,configurable:!0,get(){let u=(this.getAttribute("popovertargetaction")||"").toLowerCase();return u==="show"||u==="hide"?u:"toggle"},set(u){this.setAttribute("popovertargetaction",u)}}})}a(HTMLButtonElement),a(HTMLInputElement);let r=o=>{let u=o.composedPath(),h=u[0];if(!(h instanceof Element)||h?.shadowRoot)return;let p=qt(h);if(!(p instanceof Ys||p instanceof Document))return;let g=u.find(v=>v.matches?.("[popovertargetaction],[popovertarget]"));if(g){dr(g),o.preventDefault();return}},n=o=>{let u=o.key,h=o.target;!o.defaultPrevented&&h&&(u==="Escape"||u==="Esc")&&Re(h.ownerDocument,!0,!0)};(o=>{o.addEventListener("click",r),o.addEventListener("keydown",n),o.addEventListener("pointerdown",Hs),o.addEventListener("pointerup",Hs)})(document),vi(document)}function O(i){let t=i({css:(s,...a)=>`@layer base { ${s.raw[0]+a.join("")} }`});if(document.adoptedStyleSheets===void 0){let s=document.createElement("style");s.textContent=t,document.head.appendChild(s);return}let e=new CSSStyleSheet;e.replaceSync(t),document.adoptedStyleSheets=[...document.adoptedStyleSheets,e]}function Ue(i,t){let e=i;for(;e;){if(t(e))return e;e=e.parentElement}}function W(i,t){let e=document.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,t?{acceptNode:s=>{let a,r;return t(s,{skip:()=>a=!0,reject:()=>r=!0}),a?NodeFilter.FILTER_SKIP:r?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}:{});return new xi(e)}var xi=class{constructor(t){this.walker=t}from(t){return this.walker.currentNode=t,this}first(){return this.walker.firstChild()}last(){return this.walker.lastChild()}next(t){return this.walker.currentNode=t,this.walker.nextSibling()}nextOrFirst(t){let e=this.next(t);return e||(this.walker.currentNode=this.walker.root,this.first())}prev(t){return this.walker.currentNode=t,this.walker.previousSibling()}prevOrLast(t){let e=this.prev(t);return e||(this.walker.currentNode=this.walker.root,this.last())}closest(t,e){let s=this.from(t).walker;for(;s.currentNode;){if(e(s.currentNode))return s.currentNode;s.parentNode()}}contains(t){return this.find(e=>e===t)}find(t){return this.walk((e,s)=>{t(e)&&s(e)})}findOrFirst(t){return this.find(t)||(this.walker.currentNode=this.walker.root),this.first()}each(t){this.walk(e=>t(e))}some(t){return!!this.find(t)}every(t){let e=!0;return this.walk(s=>{t(s)||(e=!1)}),e}map(t){let e=[];return this.walk(s=>e.push(t(s))),e}filter(t){let e=[];return this.walk(s=>t(s)&&e.push(s)),e}walk(t){let e,s=this.walker,a;for(;s.nextNode()&&(e=s.currentNode,t(e,r=>a=r),a===void 0););return a}};function C(i,t){customElements.define(`ui-${i}`,t)}function A(i,t,e,s={}){return i.addEventListener(t,e,s),{off:()=>i.removeEventListener(t,e),pause:a=>{i.removeEventListener(t,e),a(),i.addEventListener(t,e)}}}function Zs(i){return["a[href]","area[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","iframe","object","embed","[tabindex]","[contenteditable]"].some(e=>i.matches(e))&&i.tabIndex>=0}function Ai(i,t){let e;return function(){let s=this,a=arguments;e||(i.apply(s,a),e=!0,setTimeout(()=>e=!1,t))}}var qe="pointer";document.addEventListener("keydown",()=>qe="keyboard",{capture:!0});document.addEventListener("pointerdown",i=>{qe=i.pointerType==="mouse"?"mouse":"touch"},{capture:!0});function ie(){return qe==="keyboard"}function Ar(){return qe==="touch"}function We(i,t){let e="",s=Mr(()=>{e=""},300);i.addEventListener("keydown",a=>{a.key.length===1&&/[a-zA-Z]/.test(a.key)&&(e+=a.key,t(e),a.stopPropagation()),s()})}function Sr(i,t){return"lofi-"+(t?t+"-":"")+Math.random().toString(16).slice(2)}function U(i,t){let e=i.hasAttribute("id")?i.getAttribute("id"):Sr(i,t);return d(i,"id",e),i._x_bindings||(i._x_bindings={}),i._x_bindings.id||(i._x_bindings.id=e),e}function L(){let i=!1;return t=>(...e)=>{i||(i=!0,t(...e),i=!1)}}
125function Bt(i,t,{gain:e,lose:s,focusable:a,useSafeArea:r}){let n=!1;a&&document.addEventListener("focusin",p=>{ie()&&(i.contains(p.target)||t.contains(p.target)?(n=!0,e()):(n=!1,s()))});let l=()=>{},o=()=>{},u=()=>{n=!1,s(),l(),o()},h=()=>{n=!1,l(),o()};return i.addEventListener("pointerenter",p=>{Ar()||n||(n=!0,e(),setTimeout(()=>{let{safeArea:g,redraw:v,remove:b}=r?_r(i,t,p.clientX,p.clientY):Tr();l=b;let c,_=Ai(y=>{let f=t.getBoundingClientRect(),w=i.getBoundingClientRect(),x;switch(g.contains(y.target)&&kr(w,f,y.clientX,y.clientY)?x="safeArea":t.contains(y.target)?x="panel":i.contains(y.target)?x="trigger":x="outside",c&&clearTimeout(c),x){case"outside":u();break;case"trigger":v(y.clientX,y.clientY);break;case"panel":l();break;case"safeArea":v(y.clientX,y.clientY),c=setTimeout(()=>{u()},300);break;default:break}},100);document.addEventListener("pointermove",_),o=()=>document.removeEventListener("pointermove",_)}))}),{clear:h}}function _r(i,t,e,s){let a=document.createElement("div"),r=t.getBoundingClientRect(),n=i.getBoundingClientRect();a.style.position="fixed",d(a,"data-safe-area","");let l=(o,u)=>{if(r.top===0&&r.bottom===0)return;let h;r.left<n.left&&(h="left"),r.right>n.right&&(h="right"),r.top<n.top&&r.bottom<u&&(h="up"),r.bottom>n.bottom&&r.top>u&&(h="down"),h===void 0&&(h="right");let p,g,v,b,c,_,y,f,w=10;switch(h){case"left":p=r.right,g=Math.max(r.right,o)+5,v=g-p,b=Math.min(n.top,r.top)-w,c=Math.max(n.bottom,r.bottom)+w,_=c-b,y=u-b,f=`polygon(0% 0%, 100% ${y}px, 0% 100%)`;break;case"right":p=Math.min(r.left,o)-5,g=r.left,v=g-p,b=Math.min(n.top,r.top)-w,c=Math.max(n.bottom,r.bottom)+w,_=c-b,y=u-b,f=`polygon(0% ${y}px, 100% 0%, 100% 100%)`;break;case"up":p=Math.min(o,r.left)-w,g=Math.max(o,r.right)+w,v=g-p,b=r.bottom,c=Math.max(r.bottom,u)+5,_=c-b,y=o-p,f=`polygon(0% 0%, 100% 0%, ${y}px 100%)`;break;case"down":p=Math.min(o,r.left)-w,g=Math.max(o,r.right)+w,v=g-p,b=Math.min(r.top,u)-5,c=r.top,_=c-b,y=o-p,f=`polygon(${y}px 0%, 100% 100%, 0% 100%)`;break}a.style.left=`${p}px`,a.style.top=`${b}px`,a.style.width=`${v}px`,a.style.height=`${_}px`,a.style.clipPath=f};return{safeArea:a,redraw:(o,u)=>{a.isConnected||i.appendChild(a),l(o,u)},remove:()=>{a.remove()}}}function kr(i,t,e,s){return!Er(i,e,s)&&!Cr(t,e,s)}function Er(i,t,e){return i.left<=t&&t<=i.right&&i.top<=e&&e<=i.bottom}function Cr(i,t,e){return i.left<=t&&t<=i.right&&i.top<=e&&e<=i.bottom}function d(i,t,e){i._durableAttributeObserver===void 0&&(i._durableAttributeObserver=Qs(i,[t])),i._durableAttributeObserver.hasAttribute(t)||i._durableAttributeObserver.addAttribute(t),i._durableAttributeObserver.pause(()=>{i.setAttribute(t,e)})}function se(i,t){S(i,t),Dr(i,t)}function S(i,t){i._durableAttributeObserver===void 0&&(i._durableAttributeObserver=Qs(i,[t])),i._durableAttributeObserver.hasAttribute(t)||i._durableAttributeObserver.addAttribute(t),i._durableAttributeObserver.pause(()=>{i.removeAttribute(t)})}function Dr(i,t){i?._durableAttributeObserver?.hasAttribute(t)&&i._durableAttributeObserver.releaseAttribute(t)}function Qs(i,t){let e=a=>{a.forEach(r=>{r.oldValue===null?i._durableAttributeObserver.pause(()=>S(i,r.attributeName)):i._durableAttributeObserver.pause(()=>d(i,r.attributeName,r.oldValue))})},s=new MutationObserver(a=>e(a));return s.observe(i,{attributeFilter:t,attributeOldValue:!0}),{attributes:t,hasAttribute(a){return this.attributes.includes(a)},addAttribute(a){this.attributes.includes(a)||this.attributes.push(a),s.observe(i,{attributeFilter:this.attributes,attributeOldValue:!0})},releaseAttribute(a){this.hasAttribute(a)&&s.observe(i,{attributeFilter:this.attributes,attributeOldValue:!0})},pause(a){e(s.takeRecords()),s.disconnect(),a(),s.observe(i,{attributeFilter:this.attributes,attributeOldValue:!0})}}}function Tr(){return{safeArea:{contains:()=>!1},redraw:()=>{},remove:()=>{}}}function Mr(i,t){let e;return(...s)=>{clearTimeout(e),e=setTimeout(()=>{i(...s)},t)}}var Wt=0,Vt=!1;O(({css:i})=>i`[data-flux-allow-scroll] { pointer-events: auto; }`);function ct(i=null,t=!1){if(t)return{lock:()=>{},unlock:()=>{}};let e=(a=!1)=>{Js(document.documentElement),Or(document.documentElement,{paddingRight:`calc(${window.innerWidth-document.documentElement.clientWidth}px + ${window.getComputedStyle(document.documentElement).paddingRight})`,overflow:"hidden",...a?{pointerEvents:"none"}:{}}),a&&(d(i,"data-flux-allow-scroll",""),Vt=!0)},s=(a=!1)=>{Js(document.documentElement),a&&(se(i,"data-flux-allow-scroll"),Vt=!1)};
125return{lock(){Wt++,!(Wt>1&&i!==null&&Vt)&&e(i!==null&&!Vt)},unlock(){Wt=Math.max(0,Wt-1),!(Wt>0&&i!==null&&!Vt)&&(s(i!==null&&Vt),Wt>0&&e(!1))}}}function Or(i,t){let e=JSON.parse(i.getAttribute("data-flux-scroll-unlock")||"{}");Object.entries(t).forEach(([s,a])=>{e[s]===void 0&&(e[s]=i.style[s],i.style[s]=a)}),i.setAttribute("data-flux-scroll-unlock",JSON.stringify(e))}function Js(i){let t=JSON.parse(i.getAttribute("data-flux-scroll-unlock")||"{}");Object.entries(t).forEach(([e,s])=>{i.style[e]=s}),i.removeAttribute("data-flux-scroll-unlock")}function Ht(i,t,e){let s=(n,l)=>o=>{o.key===n&&!t()&&(l(),o.preventDefault(),o.stopPropagation())};d(i,"role","button");let a=()=>{i.hasAttribute("disabled")?(d(i,"aria-disabled","true"),d(i,"tabindex","-1")):(S(i,"aria-disabled"),d(i,"tabindex","0"))};new MutationObserver(()=>a()).observe(i,{attributes:!0,attributeFilter:["disabled"]}),a(),A(i,"click",()=>e()),A(i,"keydown",s("Enter",()=>e())),A(i,"keydown",s(" ",()=>{})),A(i,"keyup",s(" ",()=>e()))}function ta(i,t,e=null){let s=()=>{let n=i.getAttribute(t),l={sm:640,md:768,lg:1024,xl:1280,"2xl":1536};for(let[o,u]of Object.entries(l).reverse()){let h=i.getAttribute(`${o}:${t}`);if(h&&window.innerWidth>=u)return h}return n||e},a=s(),r=[];return new ResizeObserver(()=>{let n=s(),l=JSON.stringify(a);JSON.stringify(n)!==l&&(a=n,r.forEach(o=>o(n)))}).observe(window.document.documentElement),[a,n=>r.push(n)]}function ht(){return navigator?.language||document.documentElement.lang||"en-US"}function Ve(i,t={slots:{},attrs:{}}){let{slots:e={},attrs:s={}}=t,a=i.content.cloneNode(!0).firstElementChild;return Object.entries(e).forEach(([r,n])=>{(r==="default"?a.querySelectorAll("slot:not([name])"):a.querySelectorAll(`slot[name="${r}"]`)).forEach(o=>o.replaceWith(typeof n=="string"?document.createTextNode(n):n))}),a.querySelectorAll("slot").forEach(r=>r.remove()),Object.entries(s).forEach(([r,n])=>{a.setAttribute(r,n)}),a.setAttribute("data-appended",""),a}function ae(){return document.documentElement.dir==="rtl"}function ea(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&!navigator.userAgent.includes("CriOS")&&!navigator.userAgent.includes("FxiOS")}function ia(){return/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream}var D=class extends HTMLElement{wasDisconnected=!1;constructor(){super(),this.boot?.()}connectedCallback(){if(this.wasDisconnected){this.wasDisconnected=!1;return}queueMicrotask(()=>{this.mount?.()})}disconnectedCallback(){this.wasDisconnected=!0,queueMicrotask(()=>{this.wasDisconnected&&this.unmount?.(),this.wasDisconnected=!1})}mixin(t,e={}){return new t(this,e)}appendMixin(t,e={}){return new t(this,e)}use(t){let e;return this.mixins.forEach(s=>{s instanceof t&&(e=s)}),e}uses(t){let e;return this.mixins.forEach(s=>{s instanceof t&&(e=!0)}),!!e}on(t,e){return A(this,t,e)}root(t,e={}){if(t===void 0)return this.__root;let s=document.createElement(t);for(let r in e)setAttribute(s,r,e[r]);let a=this.attachShadow({mode:"open"});return s.appendChild(document.createElement("slot")),a.appendChild(s),this.__root=s,this.__root}},V=class extends D{};var F=class{constructor(t,e={}){this.el=t,this.grouped=e.grouped===void 0,this.el.mixins=this.el.mixins?this.el.mixins:new Map,this.el.mixins.set(this.constructor.name,this),this.el[this.constructor.name]=!0,this.el.use||(this.el.use=D.prototype.use.bind(this.el)),this.opts=e,this.boot?.({options:s=>{let a=s;Object.entries(this.opts).forEach(([r,n])=>{n!==void 0&&(a[r]=n)}),this.opts=a}}),queueMicrotask(()=>{this.mount?.()})}options(){return this.opts}hasGroup(){return!!this.group()}group(){if(this.grouped!==!1)return Ue(this.el,t=>t[this.groupedByType.name])?.use(this.groupedByType)}on(t,e){return A(this.el,t,e)}},mt=class extends F{constructor(t,e={}){super(t,e)}walker(){return W(this.el,(t,{skip:e,reject:s})=>{if(t[this.constructor.name]&&t!==this.el)return s();if(!t[this.groupOfType.name]||!t.mixins.get(this.groupOfType.name).grouped)return e()})}};var I=class extends F{boot({options:t}){t({bubbles:!1}),this.initialState=this.el.value,this.getterFunc=()=>{},this.setterFunc=e=>this.initialState=e,Object.defineProperty(this.el,"value",{get:()=>this.getterFunc(),set:e=>{this.setterFunc(e)}})}initial(t){t(this.initialState)}getter(t){this.getterFunc=t}setter(t){this.setterFunc=t}dispatch(){this.el.dispatchEvent(new Event("input",{bubbles:this.options().bubbles,cancelable:!0})),this.el.dispatchEvent(new Event("change",{bubbles:this.options().bubbles,cancelable:!0}))}};var re=null;document.addEventListener("mousedown",i=>re=i);var Yt=class extends F{boot({options:t}){t({clickOutside:!0,triggers:[]}),this.onChanges=[],this.state=!1,this.stopDialogFromFocusingTheFirstElement();let e=this.options().triggers;new MutationObserver(a=>{a.forEach(r=>{r.attributeName==="open"&&(this.el.hasAttribute("open")?this.state=!0:this.state=!1)}
125),this.onChanges.forEach(r=>r())}).observe(this.el,{attributeFilter:["open"]}),this.options().clickOutside&&this.el.addEventListener("click",a=>{if(a.target!==this.el){re=null;return}re&&sa(this.el,re)&&sa(this.el,a)&&(this.cancel(),a.preventDefault(),a.stopPropagation()),re=null}),this.el.hasAttribute("open")&&(this.state=!0,this.hide(),this.show())}onChange(t){this.onChanges.push(t)}show(){this.el.showModal()}hide(){this.el.close()}toggle(){this.state?this.hide():this.show()}cancel(){let t=new Event("cancel",{bubbles:!1,cancelable:!0});this.el.dispatchEvent(t),t.defaultPrevented||this.hide()}getState(){return this.state}setState(t){t?this.show():this.hide()}stopDialogFromFocusingTheFirstElement(){let t=document.createElement("div");t.setAttribute("data-flux-focus-placeholder",""),t.setAttribute("data-appended",""),t.setAttribute("tabindex","0"),this.el.prepend(t),this.onChange(()=>{d(t,"style",this.state?"display: none":"display: block"),this.state&&ea()&&!this.el.hasAttribute("autofocus")&&this.el.querySelectorAll("[autofocus]").length===0&&setTimeout(()=>{this.el.setAttribute("tabindex","-1"),this.el.focus(),this.el.blur()})})}};function sa(i,t){let e=i.getBoundingClientRect(),s=t.clientX,a=t.clientY;return!(s>=e.left&&s<=e.right&&a>=e.top&&a<=e.bottom)}var Si=class extends D{boot(){this.querySelectorAll("[data-appended]").forEach(l=>l.remove()),this._controllable=new I(this,{disabled:this.hasAttribute("disabled")});let t=this.button(),e=this.dialog();if(!e)return;e._dialogable=new Yt(e,{clickOutside:!this.hasAttribute("disable-click-outside")}),this._controllable.initial(l=>l&&e._dialogable.show()),this._controllable.getter(()=>e._dialogable.getState());let s=L();this._controllable.setter(s(l=>{e._dialogable.setState(l)})),e._dialogable.onChange(s(()=>{this._controllable.dispatch()}));let a=()=>{e._dialogable.getState()?(d(this,"data-open",""),t?.setAttribute("data-open",""),d(e,"data-open","")):(S(this,"data-open"),t?.removeAttribute("data-open"),S(e,"data-open"))};e._dialogable.onChange(()=>a()),a();let{lock:r,unlock:n}=ct();e._dialogable.onChange(()=>{e._dialogable.getState()?r():n()}),t&&A(t,"click",l=>{e._dialogable.show()})}unmount(){let{unlock:t}=ct();this.dialog()._dialogable.getState()&&t()}button(){let t=this.querySelector("button");if(!this.dialog()?.contains(t))return t}dialog(){return this.querySelector("dialog")}showModal(){let t=this.dialog();t&&t.showModal()}},_i=class extends D{mount(){let t=this.querySelector("button");A(t,"click",()=>{Ue(this,s=>!!s._dialogable)?._dialogable?.hide()})}};O(({css:i})=>i`dialog, ::backdrop { margin: auto; }`);C("modal",Si);C("close",_i);var Be=class extends F{boot({options:t}){this.onChanges=[],this.state=!1}onChange(t){this.onChanges.push(t)}getState(){return this.state}setState(t){let e=this.state;
125this.state=!!t,this.state!==e&&this.onChanges.forEach(s=>s())}};var ki=class extends D{boot(){let t=this.button(),e=this.details();if(t){if(!e)return console.warn("ui-disclosure: no panel element found",this)}else return console.warn("ui-disclosure: no trigger element found",this);this._disabled=this.hasAttribute("disabled"),this._controllable=new I(this,{disabled:this._disabled}),e._disclosable=new Be(e),this._controllable.initial(r=>r&&e._disclosable.setState(!0)),this._controllable.getter(()=>e._disclosable.getState()),this._controllable.setter(r=>e._disclosable.setState(r)),e._disclosable.onChange(()=>{this.dispatchEvent(new CustomEvent("lofi-disclosable-change",{bubbles:!0})),this._controllable.dispatch()});let s=()=>{e._disclosable.getState()?(d(this,"data-open",""),d(t,"data-open",""),d(e,"data-open","")):(S(this,"data-open"),S(t,"data-open"),S(e,"data-open"))};e._disclosable.onChange(()=>s()),s(),this._disabled||A(t,"click",r=>{e._disclosable.setState(!e._disclosable.getState())});let a=U(e,"disclosure");d(t,"aria-controls",a),d(t,"aria-expanded","false"),e._disclosable.onChange(()=>{e._disclosable.getState()?d(t,"aria-expanded","true"):d(t,"aria-expanded","false")}),this.hasAttribute("open")&&e._disclosable.setState(!0)}button(){return this.querySelector("button")}details(){return this.lastElementChild}},Ei=class i extends D{boot(){this.exclusive=this.hasAttribute("exclusive"),this.exclusive&&A(this,"lofi-disclosable-change",t=>{t.stopPropagation(),t.target.localName==="ui-disclosure"&&t.target.value&&this.disclosureWalker().each(e=>{e!==t.target&&(e.value=!1)})})}disclosureWalker(){return W(this,(t,{skip:e,reject:s})=>{if(t instanceof i&&t!==this||t.localName!=="ui-disclosure")return s()})}};O(({css:i})=>i`ui-disclosure { display: block; }`);C("disclosure",ki);C("disclosure-group",Ei);var Ci=class extends D{boot(){}},Di=class extends D{boot(){let t=this.hasAttribute("resize")?this.getAttribute("resize"):"both",e=this.hasAttribute("shrink"),s=this.closest("ui-resizable"),a,r,n=!1;if(!s)throw"Resizable container not found";this.addEventListener("pointerdown",l=>{n||(a=s.offsetWidth,r=s.offsetHeight,n=!0);let o=l.clientX,u=l.clientY,h=parseInt(getComputedStyle(s).width,10),p=parseInt(getComputedStyle(s).height,10),g=v=>{let b=h+(v.clientX-o),c=p+(v.clientY-u);(t==="width"||t==="both")&&(e?s.style.width=`${Math.min(b,a)}px`:s.style.width=`${b}px`),(t==="height"||t==="both")&&(e?s.style.height=`${Math.min(c,r)}px`:s.style.height=`${c}px`)};document.addEventListener("pointermove",g),document.addEventListener("pointerup",()=>{this.releasePointerCapture(l.pointerId),document.removeEventListener("pointermove",g)},{once:!0}),this.setPointerCapture(l.pointerId)})}};O(({css:i})=>i`ui-resizable { display: block; }`);C("resizable",Ci);C("grip",Di);var $=class extends mt{groupOfType=P;boot({options:t}){t({multiple:!1}),this.state=this.options().multiple?new Set:null,this.onChanges=[]}onInitAndChange(t){t(),this.onChanges.push(t)}onChange(t){this.onChanges.push(t)}changed(t,e=!1){if(t.ungrouped)return;let s=t.value,a=t.isSelected(),r=this.options().multiple;a?r?this.state.add(s):this.state=s:r?this.state.delete(s):this.state=null,e||this.onChanges.forEac
125h(n=>n())}getState(){return this.options().multiple?Array.from(this.state):this.state}hasValue(t){return this.options().multiple?this.state.has(t):this.state===t}setState(t){(t===null||t==="")&&(t=this.options().multiple?[]:""),this.options().multiple?(Array.isArray(t)||(t=[t]),t=t.map(s=>s+"")):t=t+"",this.state=this.options().multiple?new Set(t):t;let e=this.options().multiple?t:[t];this.walker().each(s=>{let a=s.use(P);if(a.ungrouped)return;let r=e.includes(a.value);r&&!a.isSelected()?a.surgicallySelect():!r&&a.isSelected()&&a.surgicallyDeselect()}),this.onChanges.forEach(s=>s())}selected(){return this.walker().find(t=>t.use(P).isSelected()).use(P)}selecteds(){return this.walker().filter(t=>t.use(P).isSelected()).map(t=>t.use(P))}selectFirst(){this.walker().first()?.use(P).select()}selectAll(){this.walker().filter(t=>!t.use(P).isSelected()).map(t=>t.use(P).select())}deselectAll(){this.walker().filter(t=>t.use(P).isSelected()).map(t=>t.use(P).deselect())}allAreSelected(){return this.walker().filter(t=>t.use(P).isSelected()).length===this.walker().filter(t=>!0).length}noneAreSelected(){return this.state===null||this.state?.size===0}selectableByValue(t){return this.walker().find(e=>e.use(P).value===t)?.use(P)}deselectOthers(t){this.walker().each(e=>{e!==t&&e.use(P).surgicallyDeselect()})}selectedTextValue(){return this.options().multiple?Array.from(this.state).map(t=>this.convertValueStringToElementText(t)).join(", "):this.convertValueStringToElementText(this.state)}convertValueStringToElementText(t){let e=this.findByValue(t);return e?e.label||e.value:t}findByValue(t){return this.selecteds().find(e=>e.value===t)}walker(){return W(this.el,(t,{skip:e,reject:s})=>{if(t[this.constructor.name]&&t!==this.el)return s();if(!t[this.groupOfType.name]||t.mixins.get(this.groupOfType.name).ungrouped)return e()})}},P=class extends F{boot({options:t}){this.groupedByType=$,t({ungrouped:!1,togglable:!1,value:void 0,label:void 0,selectedInitially:!1,dataAttr:"data-selected",ariaAttr:"aria-selected"}),this.ungrouped=this.options().ungrouped,this.value=this.options().value===void 0?this.el.value:this.options().value,this.value=this.value+"",this.label=this.options().label;let e=this.options().selectedInitially;this.group()&&this.group().hasValue(this.value)&&(e=!0),this.multiple=this.hasGroup()?this.group().options().multiple:!1,this.toggleable=this.options().toggleable||this.multiple,this.onSelects=[],this.onUnselects=[],this.onChanges=[],e?this.select(!0):(this.state=e,this.surgicallyDeselect(!0))}mount(){this.el.hasAttribute(this.options().ariaAttr)||d(this.el,this.options().ariaAttr,"false")}onInitAndChange(t){t(),this.onChanges.push(t)}onChange(t){this.onChanges.push(t)}onSelect(t){this.onSelects.push(t)}onUnselect(t){this.onUnselects.push(t)}setState(t){t?this.select():this.deselect()}getState(){return this.state}press(){this.toggleable?this.toggle():this.select()}trigger(){this.toggleable?this.toggle():this.select()}toggle(){this.isSelected()?this.deselect():this.select()}isSelected(){return this.state}select(t=!1){let e=!this.isSelected();this.toggleable||this.group()?.deselectOthers(this.el),this.state=!0,d(this.el,this.options().ariaAttr,"true"),d(this.el,this.options().dataAttr,""),e&&(t||(this.onSelects.forEach(s=>
125s()),this.onChanges.forEach(s=>s())),this.group()?.changed(this,t))}surgicallySelect(){let t=!this.isSelected();this.state=!0,d(this.el,this.options().ariaAttr,"true"),d(this.el,this.options().dataAttr,""),t&&(this.onSelects.forEach(e=>e()),this.onChanges.forEach(e=>e()))}deselect(t=!0){let e=this.isSelected();this.state=!1,d(this.el,this.options().ariaAttr,"false"),S(this.el,this.options().dataAttr),e&&(this.onUnselects.forEach(s=>s()),this.onChanges.forEach(s=>s()),t&&this.group()?.changed(this))}surgicallyDeselect(t=!1){let e=this.isSelected();this.state=!1,d(this.el,this.options().ariaAttr,"false"),S(this.el,this.options().dataAttr),e&&!t&&(this.onUnselects.forEach(s=>s()),this.onChanges.forEach(s=>s()))}getValue(){return this.value}getLabel(){return this.label}};var N=class extends F{boot({options:t}){t({disableWithParent:!0}),this.onChanges=[],Object.defineProperty(this.el,"disabled",{get:()=>this.el.hasAttribute("disabled"),set:s=>{s?this.el.setAttribute("disabled",""):this.el.removeAttribute("disabled")}}),this.el.hasAttribute("disabled")?this.el.disabled=!0:this.options().disableWithParent&&this.el.closest("[disabled]")&&(this.el.disabled=!0),new MutationObserver(s=>
125{this.onChanges.forEach(a=>a(this.el.disabled))}).observe(this.el,{attributeFilter:["disabled"]})}onChange(t){this.onChanges.push(t)}onInitAndChange(t){t(this.el.disabled),this.onChanges.push(t)}enabled(t){return(...e)=>{if(!this.el.disabled)return t(...e)}}disabled(t){return(...e)=>{if(this.el.disabled)return t(...e)}}isDisabled(){return this.el.disabled}};var J=class extends F{boot({options:t}){t({name:void 0,value:void 0,includeWhenEmpty:!0,shouldUpdateValue:!0}),this.name=this.options().name,this.value=this.options().value===void 0?this.el.value:this.options().value,this.state=!1,this.observer=new MutationObserver(()=>{this.renderHiddenInputs()}),this.observer.observe(this.el,{childList:!0})}mount(){this.renderHiddenInputs()}update(t){this.options().shouldUpdateValue?this.value=t:this.state=!!t,this.renderHiddenInputs()}valueIsEmpty(){return this.value===void 0||this.value===null||this.value===""}renderHiddenInputs(){if(this.observer.disconnect(),!this.name)return;let t=this.el.children,e=[];for(let a=0;a<t.length;a++){let r=t[a];r.hasAttribute("data-flux-hidden")&&e.push(r)}e.forEach(a=>a.remove());let s;this.options().shouldUpdateValue?s=!this.valueIsEmpty()||this.options().includeWhenEmpty?this.generateInputs(this.name,this.value):[]:s=this.state||this.options().includeWhenEmpty?this.generateInputs(this.name,this.value):[],s.forEach(a=>{this.el.append(a)}),this.observer.observe(this.el,{childList:!0})}generateInputs(t,e,s=[]){if(this.isObjectOrArray(e))for(let a in e)s=s.concat(this.generateInputs(`${t}[${a}]`,e[a]));else{let a=document.createElement("input");return a.setAttribute("type","hidden"),a.setAttribute("name",t),a.setAttribute("value",e===null?"":""+e),a.setAttribute("data-flux-hidden",""),a.setAttribute("data-appended",""),[a]}return s}isObjectOrArray(t){return typeof t=="object"&&t!==null}};var Ti=class i extends V{boot(){this._disableable=new N(this);let t=[];this._disableable.onInitAndChange(e=>{e?this.walker().each(s=>{s.hasAttribute("disabled")||(s.setAttribute("disabled",""),t.push(()=>s.removeAttribute("disabled")))}):(t.forEach(s=>s()),t=[])}),this._selectable=new $(this,{multiple:!0}),this._controllable=new I(this,{disabled:this._disabled,bubbles:!0}),this.walker().each(e=>{e.addEventListener("input",s=>s.stopPropagation()),e.addEventListener("change",s=>s.stopPropagation())}),this._submittable=new J(this,{name:this.getAttribute("name"),value:this.getAttribute("value"),includeWhenEmpty:!1}),this._controllable.initial(e=>e&&this._selectable.setState(e)),this._controllable.getter(()=>this._selectable.getState()),this._detangled=L(),this._controllable.setter(this._detangled(e=>{this._selectable.setState(e)})),this._selectable.onChange(this._detangled(()=>{this._controllable.dispatch()})),this._selectable.onInitAndChange(()=>{this._submittable.update(this._selectable.getState())}),d(this,"role","group"),queueMicrotask(()=>{this._submittable.update(this._selectable.getState())})}initCheckAll(t){let e=L();t._selectable.onChange(e(()=>{t.indeterminate?(this._selectable.selectAll(),t.checked=!0,t.indeterminate=!1):t.checked?(this._selectable.selectAll(),t.checked=!0,t.indeterminate=!1):(this._selectable.deselectAll(),t.checked=!1,t.indeterminate=!1)}));let s=()=>{this._selectable.allAreSelected()?(t.indeterminate=!1,t._selectable.select()):this._selectable.noneAreSelected()?(t.indeterminate=!1,t._selectable.deselect()):t.indeterminate=!0};this._selectable.onChange(e(()=>{s()})),s()}walker(){return W(this,(t,{skip:e,reject:s})=>{if(t instanceof i)return s();if(t.localName!=="ui-checkbox")return e()})}},Mi=class extends V{boot(){let t=this;this.isIndeterminate=!1,this._disableable=new N(this),this.hasAttribute("all")?(this._selectable=new P(t,{ungrouped:!0,toggleable:!0,value:this.hasAttribute("value")?this.getAttribute("value"):Math.random().toString(36).substring(2,10),label:this.hasAttribute("label")?this.getAttribute("label"):null,selectedInitially:this.hasAttribute("checked"),dataAttr:"data-checked",ariaAttr:"aria-checked"}),queueMicrotask(()=>{this.closest("ui-checkbox-group")?.initCheckAll(this)})):(this._selectable=new P(t,{toggleable:!0,dataAttr:"data-checked",ariaAttr:"aria-checked",value:this.hasAttribute("value")?this.getAttribute("value"):Math.random().toString(36).substring(2,10),label:this.hasAttribute("label")?this.getAttribute("label"):null,selectedInitially:this.hasAttribute("checked")}),this._submittable=new J(this,{name:this.getAttribute("name"),value:this.getAttribute("value")??"on",includeWhenEmpty:!1,shouldUpdateValue:!1}),this._selectable.onChange(()=>{this.indeterminate&&(this.indeterminate=!1)}),this._selectable.onInitAndChange(()=>{this._submittable.update(this._selectable.isSelected())}),this.value=this._selectable.getValue()),this._detangled=L(),this._selectable.onChange(this._detangled(()=>{this.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))})),d(t,"role","checkbox"),this._disableable.onInitAndChange(e=>{e?S(t,"tabindex","0"):d(t,"tabindex","0")}),A(t,"click",this._disableable.disabled(e=>{e.preventDefault(),e.stopPropagation()}),{capture:!0}),A(t,"click",this._disableable.enabled(e=>{this._selectable.press()})),A(t,"keydown",this._disableable.enabled(e=>{e.key==="Enter"&&(this._selectable.press(),e.preventDefault(),e.stopPropagation())})),A(t,"keydown",this._disableable.enabled(e=>{e.key===" "&&(e.preventDefault(),e.stopPropagation())})),A(t,"keyup",this._disableable.enabled(e=>{e.key===" "&&(this._selectable.press(),e.preventDefault(),e.stopPropagation())})),Pr(t)}get checked(){return this._selectable.isSelected()}set checked(t){let e=this.closest("ui-checkbox-group")?._detangled||(s=>s);this._detangled(e(()=>{t?this._selectable.select():this._selectable.deselect()}
125))()}get indeterminate(){return this.isIndeterminate}set indeterminate(t){this.isIndeterminate=!!t,this.isIndeterminate?d(this,"data-indeterminate",""):S(this,"data-indeterminate")}};C("checkbox-group",Ti);C("checkbox",Mi);O(({css:i})=>i`ui-checkbox-group { display: block; user-select: none; }`);O(({css:i})=>i`ui-checkbox { display: inline-block; user-select: none; }`);function Pr(i){i.closest("label")?.addEventListener("click",t=>{i.contains(t.target)||i._selectable.press()})}var wt=new Map,it=class extends F{boot({options:t}){t({triggers:[],scope:null});let e=this.options().scope||"global";d(this.el,"popover","manual"),this.triggers=this.options().triggers,this.onChanges=[],this.state=!1,A(this.el,"beforetoggle",s=>{let a=this.state;if(this.state=s.newState==="open",this.state){Lr(this.el,e);let r=new AbortController,n=document.activeElement,l=[...this.triggers,n];setTimeout(()=>{Ir(this.el,l,r),Nr(this.el,l,r),Fr(this.el,l,r)}),this.el.addEventListener("beforetoggle",o=>{o.newState==="closed"&&(r.abort(),n?.focus())},{signal:r.signal})}
125a!==this.state&&this.onChanges.forEach(r=>r(this.state,a))}),A(this.el,"toggle",s=>{if(s.newState==="open")wt.has(e)||wt.set(e,new Set),wt.get(e).add(this.el);else if(s.newState==="closed"){if(!wt.has(e))return;wt.get(e).delete(this.el),wt.get(e).size===0&&wt.delete(e)}})}onChange(t){this.onChanges.push(t)}setState(t){t?this.show():this.hide()}getState(){return this.state}toggle(){this.el.togglePopover()}show(){this.el.showPopover()}hide(){this.el.hidePopover()}};function Lr(i,t){wt.has(t)&&wt.get(t).forEach(e=>{i.contains(e)||e.contains(i)||e.hidePopover()})}function Ir(i,t,e){document.addEventListener("click",s=>{i.contains(s.target)||t.includes(s.target)||i.hidePopover()},{signal:e.signal})}function Nr(i,t,e){document.addEventListener("focusin",s=>{i.contains(s.target)||t.includes(s.target)||(e.abort(),i.hidePopover())},{capture:!0,signal:e.signal})}function Fr(i,t,e){document.addEventListener("keydown",s=>{s.key==="Escape"&&i.hidePopover()},{signal:e.signal})}var kt=Math.min,Z=Math.max,oe=Math.round,le=Math.floor,dt=i=>({x:i,y:i}),Rr={left:"right",right:"left",bottom:"top",top:"bottom"},Ur={start:"end",end:"start"};function Oi(i,t,e){return Z(i,kt(t,e))}function $t(i,t){return typeof i=="function"?i(t):i}function xt(i){return i.split("-")[0]}function zt(i){return i.split("-")[1]}function Pi(i){return i==="x"?"y":"x"}function Li(i){return i==="y"?"height":"width"}function Et(i){return["top","bottom"].includes(xt(i))?"y":"x"}function Ii(i){return Pi(Et(i))}function aa(i,t,e){e===void 0&&(e=!1);let s=zt(i),a=Ii(i),r=Li(a),n=a==="x"?s===(e?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(n=ne(n)),[n,ne(n)]}function ra(i){let t=ne(i);return[He(i),t,He(t)]}function He(i){return i.replace(/start|end/g,t=>Ur[t])}function qr(i,t,e){let s=["left","right"],a=["right","left"],r=["top","bottom"],n=["bottom","top"];switch(i){case"top":case"bottom":return e?t?a:s:t?s:a;case"left":case"right":return t?r:n;default:return[]}}function na(i,t,e,s){let a=zt(i),r=qr(xt(i),e==="start",s);return a&&(r=r.map(n=>n+"-"+a),t&&(r=r.concat(r.map(He)))),r}function ne(i){return i.replace(/left|right|bottom|top/g,t=>Rr[t])}function Wr(i){return{top:0,right:0,bottom:0,left:0,...i}}function oa(i){return typeof i!="number"?Wr(i):{top:i,right:i,bottom:i,left:i}}function Pt(i){let{x:t,y:e,width:s,height:a}=i;return{width:s,height:a,top:e,left:t,right:t+s,bottom:e+a,x:t,y:e}}function la(i,t,e){let{reference:s,floating:a}=i,r=Et(t),n=Ii(t),l=Li(n),o=xt(t),u=r==="y",h=s.x+s.width/2-a.width/2,p=s.y+s.height/2-a.height/2,g=s[l]/2-a[l]/2,v;switch(o){case"top":v={x:h,y:s.y-a.height};break;case"bottom":v={x:h,y:s.y+s.height};break;case"right":v={x:s.x+s.width,y:p};break;case"left":v={x:s.x-a.width,y:p};break;default:v={x:s.x,y:s.y}}switch(zt(t)){case"start":v[n]-=g*(e&&u?-1:1);break;case"end":v[n]+=g*(e&&u?-1:1);break}return v}var ua=async(i,t,e)=>{let{placement:s="bottom",strategy:a="absolute",middleware:r=[],platform:n}=e,l=r.filter(Boolean),o=await(n.isRTL==null?void 0:n.isRTL(t)),u=await n.getElementRects({reference:i,floating:t,strategy:a}),{x:h,y:p}=la(u,s,o),g=s,v={},b=0;for(let c=0;c<l.length;c++){let{name:_,fn:y}=l[c],{x:f,y:w,data:x,reset:k}=await y({x:h,y:p,initialPlacement:s,placement:g,strategy:a,middlewareData:v,rects:u,platform:n,elements:{reference:i,floating:t}});h=f??h,p=w??p,v={...v,[_]:{...v[_],...x}},k&&b<=50&&(b++,typeof k=="object"&&(k.placement&&(g=k.placement),k.rects&&(u=k.rects===!0?await n.getElementRects({reference:i,floating:t,strategy:a}):k.rects),{x:h,y:p}=la(u,g,o)),c=-1)}return{x:h,y:p,placement:g,strategy:a,middlewareData:v}};async function Ye(i,t){var e;t===void 0&&(t={});let{x:s,y:a,platform:r,rects:n,elements:l,strategy:o}=i,{boundary:u="clippingAncestors",rootBoundary:h="viewport",elementContext:p="floating",altBoundary:g=!1,padding:v=0}=$t(t,i),b=oa(v),_=l[g?p==="floating"?"reference":"floating":p],y=Pt(await r.getClippingRect({element:(e=await(r.isElement==null?void 0:r.isElement(_)))==null||e?_:_.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(l.floating)),boundary:u,rootBoundary:h,strategy:o})),f=p==="floating"?{x:s,y:a,width:n.floating.width,height:n.floating.height}:n.reference,w=await(r.getOffsetParent==null?void 0:r.getOffsetParent(l.floating)),x=await(r.isElement==null?void 0:r.isElement(w))?await(r.getScale==null?void 0:r.getScale(w))||{x:1,y:1}:{x:1,y:1},k=Pt(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:f,offsetParent:w,strategy:o}):f);return{top:(y.top-k.top+b.top)/x.y,bottom:(k.bottom-y.bottom+b.bottom)/x.y,left:(y.left-k.left+b.left)/x.x,right:(k.right-y.right+b.right)/x.x}}var ca=function(i){return i===void 0&&(i={}),{name:"flip",options:i,async fn(t){var e,s;let{placement:a,middlewareData:r,rects:n,initialPlacement:l,platform:o,elements:u}=t,{mainAxis:h=!0,crossAxis:p=!0,fallbackPlacements:g,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:c=!0,..._}=$t(i,t);
vendor: 5,335 bytes, line 125
125if((e=r.arrow)!=null&&e.alignmentOffset)return{};let y=xt(a),f=Et(l),w=xt(l)===l,x=await(o.isRTL==null?void 0:o.isRTL(u.floating)),k=g||(w||!c?[ne(l)]:ra(l)),E=b!=="none";!g&&E&&k.push(...na(l,c,b,x));let T=[l,...k],R=await Ye(t,_),rt=[],j=((s=r.flip)==null?void 0:s.overflows)||[];if(h&&rt.push(R[y]),p){let X=aa(a,n,x);rt.push(R[X[0]],R[X[1]])}if(j=[...j,{placement:a,overflows:rt}],!rt.every(X=>X<=0)){var nt,tt;let X=(((nt=r.flip)==null?void 0:nt.index)||0)+1,ut=T[X];if(ut)return{data:{index:X,overflows:j},reset:{placement:ut}};let H=(tt=j.filter(gt=>gt.overflows[0]<=0).sort((gt,K)=>gt.overflows[1]-K.overflows[1])[0])==null?void 0:tt.placement;if(!H)switch(v){case"bestFit":{var G;let gt=(G=j.filter(K=>{if(E){let et=Et(K.placement);return et===f||et==="y"}return!0}).map(K=>[K.placement,K.overflows.filter(et=>et>0).reduce((et,Ja)=>et+Ja,0)]).sort((K,et)=>K[1]-et[1])[0])==null?void 0:G[0];gt&&(H=gt);break}case"initialPlacement":H=l;break}if(a!==H)return{reset:{placement:H}}}return{}}}};async function Vr(i,t){let{placement:e,platform:s,elements:a}=i,r=await(s.isRTL==null?void 0:s.isRTL(a.floating)),n=xt(e),l=zt(e),o=Et(e)==="y",u=["left","top"].includes(n)?-1:1,h=r&&o?-1:1,p=$t(t,i),{mainAxis:g,crossAxis:v,alignmentAxis:b}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&typeof b=="number"&&(v=l==="end"?b*-1:b),o?{x:v*h,y:g*u}:{x:g*u,y:v*h}}var ha=function(i){return i===void 0&&(i=0),{name:"offset",options:i,async fn(t){var e,s;let{x:a,y:r,placement:n,middlewareData:l}=t,o=await Vr(t,i);return n===((e=l.offset)==null?void 0:e.placement)&&(s=l.arrow)!=null&&s.alignmentOffset?{}:{x:a+o.x,y:r+o.y,data:{...o,placement:n}}}}},da=function(i){return i===void 0&&(i={}),{name:"shift",options:i,async fn(t){let{x:e,y:s,placement:a}=t,{mainAxis:r=!0,crossAxis:n=!1,limiter:l={fn:_=>{let{x:y,y:f}=_;return{x:y,y:f}}},...o}=$t(i,t),u={x:e,y:s},h=await Ye(t,o),p=Et(xt(a)),g=Pi(p),v=u[g],b=u[p];if(r){let _=g==="y"?"top":"left",y=g==="y"?"bottom":"right",f=v+h[_],w=v-h[y];v=Oi(f,v,w)}if(n){let _=p==="y"?"top":"left",y=p==="y"?"bottom":"right",f=b+h[_],w=b-h[y];b=Oi(f,b,w)}let c=l.fn({...t,[g]:v,[p]:b});return{...c,data:{x:c.x-e,y:c.y-s,enabled:{[g]:r,[p]:n}}}}}};var fa=function(i){return i===void 0&&(i={}),{name:"size",options:i,async fn(t){var e,s;let{placement:a,rects:r,platform:n,elements:l}=t,{apply:o=()=>{},...u}=$t(i,t),h=await Ye(t,u),p=xt(a),g=zt(a),v=Et(a)==="y",{width:b,height:c}=r.floating,_,y;p==="top"||p==="bottom"?(_=p,y=g===(await(n.isRTL==null?void 0:n.isRTL(l.floating))?"start":"end")?"left":"right"):(y=p,_=g==="end"?"top":"bottom");let f=c-h.top-h.bottom,w=b-h.left-h.right,x=kt(c-h[_],f),k=kt(b-h[y],w),E=!t.middlewareData.shift,T=x,R=k;if((e=t.middlewareData.shift)!=null&&e.enabled.x&&(R=w),(s=t.middlewareData.shift)!=null&&s.enabled.y&&(T=f),E&&!g){let j=Z(h.left,0),nt=Z(h.right,0),tt=Z(h.top,0),G=Z(h.bottom,0);v?R=b-2*(j!==0||nt!==0?j+nt:Z(h.left,h.right)):T=c-2*(tt!==0||G!==0?tt+G:Z(h.top,h.bottom))}await o({...t,availableWidth:R,availableHeight:T});let rt=await n.getDimensions(l.floating);return b!==rt.width||c!==rt.height?{reset:{rects:!0}}:{}}}};function $e(){return typeof window<"u"}function Lt(i){return ba(i)?(i.nodeName||"").toLowerCase():"#document"}function st(i){var t;return(i==null||(t=i.ownerDocument)==null?void 0:t.defaultView)||window}function ft(i){var t;return(t=(ba(i)?i.ownerDocument:i.document)||window.document)==null?void 0:t.documentElement}function ba(i){return $e()?i instanceof Node||i instanceof st(i).Node:!1}function ot(i){return $e()?i instanceof Element||i instanceof st(i).Element:!1}function pt(i){return $e()?i instanceof HTMLElement||i instanceof st(i).HTMLElement:!1}function pa(i){return!$e()||typeof ShadowRoot>"u"?!1:i instanceof ShadowRoot||i instanceof st(i).ShadowRoot}function Gt(i){let{overflow:t,overflowX:e,overflowY:s,display:a}=lt(i);return/auto|scroll|overlay|hidden|clip/.test(t+s+e)&&!["inline","contents"].includes(a)}function ma(i){return["table","td","th"].includes(Lt(i))}function ue(i){return[":popover-open",":modal"].some(t=>{try{return i.matches(t)}catch{return!1}})}function ze(i){let t=je(),e=ot(i)?lt(i):i;return["transform","translate","scale","rotate","perspective"].some(s=>e[s]?e[s]!=="none":!1)||(e.containerType?e.containerType!=="normal":!1)||!t&&(e.backdropFilter?e.backdropFilter!=="none":!1)||!t&&(e.filter?e.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(s=>(e.willChange||"").includes(s))||["paint","layout","strict","content"].some(s=>(e.contain||"").includes(s))}function ga(i){let t=At(i);for(;pt(t)&&!It(t);){if(ze(t))return t;if(ue(t))return null;t=At(t)}return null}function je(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function It(i){return["html","body","#document"].includes(Lt(i))}function lt(i){return st(i).getComputedStyle(i)}function ce(i){return ot(i)?{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}:{scrollLeft:i.scrollX,scrollTop:i.scrollY}}function At(i){if(Lt(i)==="html")return i;let t=i.assignedSlot||i.parentNode||pa(i)&&i.host||ft(i);return pa(t)?t.host:t}function va(i){let t=At(i);return It(t)?i.ownerDocument?i.ownerDocument.body:i.body:pt(t)&&Gt(t)?t:va(t)}function jt(i,t,e){var s;
vendor: 2,591 bytes, line 125
125t===void 0&&(t=[]),e===void 0&&(e=!0);let a=va(i),r=a===((s=i.ownerDocument)==null?void 0:s.body),n=st(a);if(r){let l=Ge(n);return t.concat(n,n.visualViewport||[],Gt(a)?a:[],l&&e?jt(l):[])}return t.concat(a,jt(a,[],e))}function Ge(i){return i.parent&&Object.getPrototypeOf(i.parent)?i.frameElement:null}function xa(i){let t=lt(i),e=parseFloat(t.width)||0,s=parseFloat(t.height)||0,a=pt(i),r=a?i.offsetWidth:e,n=a?i.offsetHeight:s,l=oe(e)!==r||oe(s)!==n;return l&&(e=r,s=n),{width:e,height:s,$:l}}function Fi(i){return ot(i)?i:i.contextElement}function Xt(i){let t=Fi(i);if(!pt(t))return dt(1);let e=t.getBoundingClientRect(),{width:s,height:a,$:r}=xa(t),n=(r?oe(e.width):e.width)/s,l=(r?oe(e.height):e.height)/a;return(!n||!Number.isFinite(n))&&(n=1),(!l||!Number.isFinite(l))&&(l=1),{x:n,y:l}}var Br=dt(0);function Aa(i){let t=st(i);return!je()||!t.visualViewport?Br:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Hr(i,t,e){return t===void 0&&(t=!1),!e||t&&e!==st(i)?!1:t}function Nt(i,t,e,s){t===void 0&&(t=!1),e===void 0&&(e=!1);let a=i.getBoundingClientRect(),r=Fi(i),n=dt(1);t&&(s?ot(s)&&(n=Xt(s)):n=Xt(i));let l=Hr(r,e,s)?Aa(r):dt(0),o=(a.left+l.x)/n.x,u=(a.top+l.y)/n.y,h=a.width/n.x,p=a.height/n.y;if(r){let g=st(r),v=s&&ot(s)?st(s):s,b=g,c=Ge(b);for(;c&&s&&v!==b;){let _=Xt(c),y=c.getBoundingClientRect(),f=lt(c),w=y.left+(c.clientLeft+parseFloat(f.paddingLeft))*_.x,x=y.top+(c.clientTop+parseFloat(f.paddingTop))*_.y;o*=_.x,u*=_.y,h*=_.x,p*=_.y,o+=w,u+=x,b=st(c),c=Ge(b)}}return Pt({width:h,height:p,x:o,y:u})}function Ri(i,t){let e=ce(i).scrollLeft;return t?t.left+e:Nt(ft(i)).left+e}function Sa(i,t,e){e===void 0&&(e=!1);let s=i.getBoundingClientRect(),a=s.left+t.scrollLeft-(e?0:Ri(i,s)),r=s.top+t.scrollTop;return{x:a,y:r}}function Yr(i){let{elements:t,rect:e,offsetParent:s,strategy:a}=i,r=a==="fixed",n=ft(s),l=t?ue(t.floating):!1;if(s===n||l&&r)return e;let o={scrollLeft:0,scrollTop:0},u=dt(1),h=dt(0),p=pt(s);if((p||!p&&!r)&&((Lt(s)!=="body"||Gt(n))&&(o=ce(s)),pt(s))){let v=Nt(s);u=Xt(s),h.x=v.x+s.clientLeft,h.y=v.y+s.clientTop}let g=n&&!p&&!r?Sa(n,o,!0):dt(0);return{width:e.width*u.x,height:e.height*u.y,x:e.x*u.x-o.scrollLeft*u.x+h.x+g.x,y:e.y*u.y-o.scrollTop*u.y+h.y+g.y}}function $r(i){return Array.from(i.getClientRects())}function zr(i){let t=ft(i),e=ce(i),s=i.ownerDocument.body,a=Z(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),r=Z(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight),n=-e.scrollLeft+Ri(i),l=-e.scrollTop;return lt(s).direction==="rtl"&&(n+=Z(t.clientWidth,s.clientWidth)-a),{width:a,height:r,x:n,y:l}}
vendor: 4,626 bytes, line 125
125function jr(i,t){let e=st(i),s=ft(i),a=e.visualViewport,r=s.clientWidth,n=s.clientHeight,l=0,o=0;if(a){r=a.width,n=a.height;let u=je();(!u||u&&t==="fixed")&&(l=a.offsetLeft,o=a.offsetTop)}return{width:r,height:n,x:l,y:o}}function Gr(i,t){let e=Nt(i,!0,t==="fixed"),s=e.top+i.clientTop,a=e.left+i.clientLeft,r=pt(i)?Xt(i):dt(1),n=i.clientWidth*r.x,l=i.clientHeight*r.y,o=a*r.x,u=s*r.y;return{width:n,height:l,x:o,y:u}}function ya(i,t,e){let s;if(t==="viewport")s=jr(i,e);else if(t==="document")s=zr(ft(i));else if(ot(t))s=Gr(t,e);else{let a=Aa(i);s={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Pt(s)}function _a(i,t){let e=At(i);return e===t||!ot(e)||It(e)?!1:lt(e).position==="fixed"||_a(e,t)}function Xr(i,t){let e=t.get(i);if(e)return e;let s=jt(i,[],!1).filter(l=>ot(l)&&Lt(l)!=="body"),a=null,r=lt(i).position==="fixed",n=r?At(i):i;for(;ot(n)&&!It(n);){let l=lt(n),o=ze(n);!o&&l.position==="fixed"&&(a=null),(r?!o&&!a:!o&&l.position==="static"&&!!a&&["absolute","fixed"].includes(a.position)||Gt(n)&&!o&&_a(i,n))?s=s.filter(h=>h!==n):a=l,n=At(n)}return t.set(i,s),s}function Kr(i){let{element:t,boundary:e,rootBoundary:s,strategy:a}=i,n=[...e==="clippingAncestors"?ue(t)?[]:Xr(t,this._c):[].concat(e),s],l=n[0],o=n.reduce((u,h)=>{let p=ya(t,h,a);return u.top=Z(p.top,u.top),u.right=kt(p.right,u.right),u.bottom=kt(p.bottom,u.bottom),u.left=Z(p.left,u.left),u},ya(t,l,a));return{width:o.right-o.left,height:o.bottom-o.top,x:o.left,y:o.top}}function Jr(i){let{width:t,height:e}=xa(i);return{width:t,height:e}}function Zr(i,t,e){let s=pt(t),a=ft(t),r=e==="fixed",n=Nt(i,!0,r,t),l={scrollLeft:0,scrollTop:0},o=dt(0);if(s||!s&&!r)if((Lt(t)!=="body"||Gt(a))&&(l=ce(t)),s){let g=Nt(t,!0,r,t);o.x=g.x+t.clientLeft,o.y=g.y+t.clientTop}else a&&(o.x=Ri(a));let u=a&&!s&&!r?Sa(a,l):dt(0),h=n.left+l.scrollLeft-o.x-u.x,p=n.top+l.scrollTop-o.y-u.y;return{x:h,y:p,width:n.width,height:n.height}}function Ni(i){return lt(i).position==="static"}function wa(i,t){if(!pt(i)||lt(i).position==="fixed")return null;if(t)return t(i);let e=i.offsetParent;return ft(i)===e&&(e=e.ownerDocument.body),e}function ka(i,t){let e=st(i);if(ue(i))return e;if(!pt(i)){let a=At(i);for(;a&&!It(a);){if(ot(a)&&!Ni(a))return a;a=At(a)}return e}let s=wa(i,t);for(;s&&ma(s)&&Ni(s);)s=wa(s,t);return s&&It(s)&&Ni(s)&&!ze(s)?e:s||ga(i)||e}var Qr=async function(i){let t=this.getOffsetParent||ka,e=this.getDimensions,s=await e(i.floating);return{reference:Zr(i.reference,await t(i.floating),i.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function tn(i){return lt(i).direction==="rtl"}var en={convertOffsetParentRelativeRectToViewportRelativeRect:Yr,getDocumentElement:ft,getClippingRect:Kr,getOffsetParent:ka,getElementRects:Qr,getClientRects:$r,getDimensions:Jr,getScale:Xt,isElement:ot,isRTL:tn};function Ea(i,t){return i.x===t.x&&i.y===t.y&&i.width===t.width&&i.height===t.height}function sn(i,t){let e=null,s,a=ft(i);function r(){var l;clearTimeout(s),(l=e)==null||l.disconnect(),e=null}function n(l,o){l===void 0&&(l=!1),o===void 0&&(o=1),r();let u=i.getBoundingClientRect(),{left:h,top:p,width:g,height:v}=u;if(l||t(),!g||!v)return;let b=le(p),c=le(a.clientWidth-(h+g)),_=le(a.clientHeight-(p+v)),y=le(h),w={rootMargin:-b+"px "+-c+"px "+-_+"px "+-y+"px",threshold:Z(0,kt(1,o))||1},x=!0;function k(E){let T=E[0].intersectionRatio;if(T!==o){if(!x)return n();T?n(!1,T):s=setTimeout(()=>{n(!1,1e-7)},1e3)}T===1&&!Ea(u,i.getBoundingClientRect())&&n(),x=!1}try{e=new IntersectionObserver(k,{...w,root:a.ownerDocument})}catch{e=new IntersectionObserver(k,w)}e.observe(i)}return n(!0),r}function Ca(i,t,e,s){s===void 0&&(s={});let{ancestorScroll:a=!0,ancestorResize:r=!0,elementResize:n=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:o=!1}=s,u=Fi(i),h=a||r?[...u?jt(u):[],...jt(t)]:[];h.forEach(y=>{a&&y.addEventListener("scroll",e,{passive:!0}),r&&y.addEventListener("resize",e)});let p=u&&l?sn(u,e):null,g=-1,v=null;n&&(v=new ResizeObserver(y=>{let[f]=y;f&&f.target===u&&v&&(v.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var w;(w=v)==null||w.observe(t)})),e()}),u&&!o&&v.observe(u),v.observe(t));let b,c=o?Nt(i):null;o&&_();function _(){let y=Nt(i);c&&!Ea(c,y)&&e(),c=y,b=requestAnimationFrame(_)}return e(),()=>{var y;h.forEach(f=>{a&&f.removeEventListener("scroll",e),r&&f.removeEventListener("resize",e)}),p?.(),(y=v)==null||y.disconnect(),v=null,o&&cancelAnimationFrame(b)}}var Da=ha;var Ta=da,Ma=ca,Oa=fa;var Pa=(i,t,e)=>{let s=new Map,a={platform:en,...e},r={...a.platform,_c:s};return ua(i,t,{...a,platform:r})};var z=class extends F{boot({options:t}
125){if(t({reference:null,auto:!0,position:"bottom start",gap:"5",offset:"0",matchWidth:!1,crossAxis:!1,scrollY:!0}),this.options().reference===null||this.options().position===null)return;let[e,s]=nn(this.el,{scrollY:this.options().scrollY}),a=an(this.el,this.options().reference,e,{position:this.options().position,gap:this.options().gap,offset:this.options().offset,matchWidth:this.options().matchWidth,crossAxis:this.options().crossAxis,scrollY:this.options().scrollY}),r=()=>{};this.reposition=(...n)=>{this.options().auto?r=Ca(this.options().reference,this.el,a):a(null,...n)},this.cleanup=()=>{r(),s()}}};function an(i,t,e,{position:s,offset:a,gap:r,matchWidth:n,crossAxis:l,scrollY:o}){let u=window.getComputedStyle(i).maxHeight;return u=u==="none"?null:parseFloat(u),(h,p,g)=>{Pa(t,i,{placement:rn(s),middleware:[Da({mainAxis:Number(r),alignmentAxis:Number(a)}),Ma(),Ta({padding:5,crossAxis:l}),Oa({padding:5,apply({rects:v,elements:b,availableHeight:c}){n&&Object.assign(b.floating.style,{width:`${v.reference.width}px`});let _=u;_===null&&(_=o?b.floating.scrollHeight:b.floating.offsetHeight),b.floating.style.maxHeight=c>_?"":`${c}px`}})]}).then(({x:v,y:b})=>{e(p||v,g||b)})}}function rn(i){let t=i.split(" ");switch(t[0]){case"start":t[0]=ae()?"right":"left";break;case"end":t[0]=ae()?"left":"right";break}return t.join("-")}function nn(i,{scrollY:t=!0}){let e=(n,l)=>{Object.assign(i.style,{position:"absolute",overflowY:t?"auto":"hidden",left:`${n}px`,top:`${l}px`,right:"auto",bottom:"auto"})},s,a,r=new MutationObserver(()=>e(s,a));return[(n,l)=>{s=n,a=l,r.disconnect(),e(s,a),r.observe(i,{attributeFilter:["style"]})},()=>{r.disconnect()}]}var Ui=class extends D{boot(){let t=this.trigger(),e=this.overlay();if(t){if(!e)return console.warn("ui-dropdown: no [popover] overlay found",this)}else return console.warn("ui-dropdown: no trigger element found",this);if(this._disabled=this.hasAttribute("disabled"),this._controllable=new I(this),e._popoverable=new it(e),e._anch
125orable=new z(e,{reference:t,position:this.hasAttribute("position")?this.getAttribute("position"):void 0,gap:this.hasAttribute("gap")?this.getAttribute("gap"):void 0,offset:this.hasAttribute("offset")?this.getAttribute("offset"):void 0}),e._popoverable.onChange(()=>{e._popoverable.getState()?e._anchorable.reposition():e._anchorable.cleanup()}),["ui-menu","ui-context"].includes(e.localName)){let{lock:r,unlock:n}=ct(e._popoverable.el);e._popoverable.onChange(()=>{e._popoverable.getState()?r():n()})}this._controllable.initial(r=>e._popoverable.setState(r)),this._controllable.getter(()=>e._popoverable.getState());let s=L();this._controllable.setter(r=>e._popoverable.setState(r)),e._popoverable.onChange(s(()=>this._controllable.dispatch())),this.hasAttribute("hover")&&Bt(t,e,{gain(){e._popoverable.setState(!0)},lose(){e._popoverable.setState(!1)},focusable:!1}),A(t,"click",()=>e._popoverable.toggle()),e._popoverable.getState()?(d(this,"data-open",""),d(t,"data-open",""),d(e,"data-open","")):(S(this,"data-open"),S(t,"data-open"),S(e,"data-open")),e._popoverable.onChange(()=>{e._popoverable.getState()?(d(this,"data-open",""),d(t,"data-open",""),d(e,"data-open","")):(S(this,"data-open"),S(t,"data-open"),S(e,"data-open"))});let a=U(e,"dropdown");d(t,"aria-haspopup","true"),d(t,"aria-controls",a),d(t,"aria-expanded",e._popoverable.getState()?"true":"false"),e._popoverable.onChange(()=>{d(t,"aria-expanded",e._popoverable.getState()?"true":"false")}),e._popoverable.onChange(()=>{setTimeout(()=>e._popoverable.getState()?e.onPopoverShow?.():e.onPopoverHide?.())})}trigger(){return this.querySelector("button")}overlay(){return this.lastElementChild?.matches("[popover]")&&this.lastElementChild}};C("dropdown",Ui);var m=class i{constructor(t,e,s=1){this._date=new Date(Date.UTC(t,e-1,s))}isBetween(t,e){return!t&&!e?!0:t?e?this._date>=t._date&&this._date<=e._date:this._date>=t._date:this._date<=e._date}isSameDay(t){return t?this._date.getUTCDate()===t._date.getUTCDate()&&this._date.getUTCMonth()===t._date.getUTCMonth()&&this._date.getUTCFullYear()===t._date.getUTCFullYear():!1}isBefore(t){return t?this._date<t._date:!1}isAfter(t){return t?this._date>t._date:!1}incrementDays(t){let e=this.getCopy();return e._date.setUTCDate(e._date.getUTCDate()+t),e}addMonths(t){let e=this.getCopy();return e._date.setUTCMonth(e._date.getUTCMonth()+t),e}addDays(t){let e=this.getCopy();return e._date.setUTCDate(e._date.getUTCDate()+t),e}getYear(){return this._date.getUTCFullYear()}getMonth(){return this._date.getUTCMonth()+1}getPaddedMonth(){return String(this.getMonth()).padStart(2,"0")}getDay(){return this._date.getUTCDate()}getPaddedDay(){return String(this.getDay()).padStart(2,"0")}getDate(){return this._date}getCopy(){return new i(this.getYear(),this.getMonth(),this.getDay())}getDayOfWeek(){return this._date.getUTCDay()}getDaysInMonth(){return new i(this.getYear(),this.getMonth()+1,0).getDay()}getFirstDayOfMonth(){return new i(this.getYear(),this.getMonth(),1).getDayOfWeek()}getWeekNumber(){let t=new Date(Date.UTC(this._date.getUTCFullYear(),0,1)),e=new Date(t);e.setUTCDate(1+(11-t.getUTCDay())%7);let s=new Date(this._date);return s.setUTCDate(this._date.getUTCDate()+(11-this._date.getUTCDay())%7),Math.floor((s.getTime()-e.getTime())/(7*24*60*60*1e3))+1}setDay(t){this._date.setUTCDate(t)}setMonth(t){this._date.setUTCMonth(t-1)}setYear(t){this._date.setUTCFullYear(t)}static fromIsoDateString(t){if(!t)return null;let[e,s,a]=t.split("T")[0]?.split("-")?.map(Number);return new i(e,s,a)}static fromLocalDate(t){return t?new i(t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate()):null}static fromDate(t){return t?new i(t.getFullYear(),t.getMonth()+1,t.getDate()):null}static fromParts(t,e,s){return new i(t,e,s)}static today(){return i.fromDate(new Date)}static firstDayOfMonth(t){return new i(t.getYear(),t.getMonth(),1)}toIsoDateString(){return[this.getYear(),this.getPaddedMonth(),this.getPaddedDay()].join("-")}toParts(){return[this.getYear(),this.getMonth(),this.getDay()]}toDate(){return new Date(this.getYear(),this.getMonth()-1,this.getDay())}toFormattedString(t,e){return this.toDate().toLocaleDateString(t,e)}};function La(i,t,e,s){let a=i.querySelector('template[name="heading"]'),r=i.querySelector('template[name="weekday"]'),n=i.querySelector('template[name="week"]');a&&on(a,t,e),r&&ln(r,t),n&&un(n,t,e,s)}function on(i,t,e){Q(i,s=>s({slots:{default:new Intl.DateTimeFormat(t.locale,{month:i.hasAttribute("display")?i.getAttribute("display"):"long",year:"numeric",timeZone:"UTC"}).format(new m(e.year,e.month).getDate())}}))}function ln(i,t){let e=a=>i.hasAttribute("display")?new Intl.DateTimeFormat(t.locale,{weekday:i.getAttribute("display")}).format(a):["en","es","de","fr","it","pt"].includes(t.locale.split("-")[0])?new Intl.DateTimeFormat(t.locale,{weekday:"short"}).format(a).slice(0,2):new Intl.DateTimeFormat(t.locale,{weekday:"narrow"}).format(a),s=Array.from({length:7},(a,r)=>{let n=(r+t.startDay)%7,l=new Date(2024,0,n+7);return e(l)});Q(i,a=>s.map(r=>a({slots:{default:r}})))}function un(i,t,e,s){let a=e.month,r=e.year,n=(new m(r,a).getFirstDayOfMonth()-t.startDay+7)%7,l=new m(r,a).getDaysInMonth(),[o,u]=new m(r,a).addMonths(-1).toParts(),h=new m(o,u).getDaysInMonth(),[p,g]=[[],[]];for(let x=0;x<n;x++){p.push(0);let k=h-n+x+1;g.push(new m(o,u,k).toIsoDateString())}for(let x=1;x<=l;
125x++)p.push(x),g.push(new m(r,a,x).toIsoDateString());let b=(7-(n+l)%7)%7,[c,_]=new m(r,a).addMonths(1).toParts();for(let x=1;x<=b;x++)p.push(0),g.push(new m(c,_,x).toIsoDateString());if(t.fixedWeeks){let x=Math.ceil(p.length/7),k=t.fixedWeeks,E=k-x;if(E>0)for(let T=0;T<E*7;T++)p.push(0),g.push(m.fromIsoDateString(g[g.length-1]).addDays(1).toIsoDateString());else E<0&&(p.length=k*7,g.length=k*7)}let y=x=>Array.from({length:Math.ceil(x.length/7)},(k,E)=>x.slice(E*7,(E+1)*7)),f=y(p),w=y(g);Q(i,x=>f.map((k,E)=>{let T=x(),R=w[E],rt=T.querySelector('template[name="number"]');if(rt){let j=(4-t.startDay+7)%7,nt=m.fromIsoDateString(R[j]).getWeekNumber();Q(rt,tt=>tt({slots:{default:nt}}))}return Q(T.querySelector('template[name="day"]'),j=>k.map((nt,tt)=>{if(nt===0){let et=m.fromIsoDateString(R[tt]).getDay();return j({slots:{default:et},attrs:{"data-outside":""}})}let G=m.fromIsoDateString(R[tt]),X=j({slots:{default:nt},attrs:{"data-date":R[tt]}}),ut=s.subtext(G),H=s.details(G),gt=s.variant(G);if([!1,null,void 0].includes(gt)||(X.dataset.dateVariant=gt),![!1,null,void 0].includes(ut)){let K=X.querySelector('template[name="subtext"]');K&&Q(K,et=>et({slots:{default:ut}}))}if(![!1,null,void 0].includes(H)){let K=X.querySelector('template[name="details"]');K&&Q(K,et=>et({slots:{default:H}}))}return X})),T}))}function Ia(i,t,e,s,a,r){let l=((o,u)=>a.lowerBound(()=>m.today().getMonth()===o&&m.today().getYear()===u?m.today():new m(u,o)))(s.month,s.year);i.querySelectorAll("[data-outside]").forEach(o=>{d(o,"disabled",""),d(o,"role","gridcell"),d(o,"aria-hidden","true"),d(o,"aria-disabled","true");let u=o.querySelector("button");u&&d(u,"tabindex","-1"),u&&d(u,"disabled",""),u&&d(u,"aria-disabled","true")}),i.querySelectorAll("[data-date]").forEach(o=>{d(o,"role","gridcell");let u=o.querySelector("button"),h=cn(o);h&&(u?d(u,"aria-label",h.toFormattedString(e.locale,{day:"numeric",month:"long",year:"numeric",weekday:"long"})):d(o,"aria-label",h.toFormattedString(e.locale,{day:"numeric",month:"long",year:"numeric",weekday:"long"})),r.isValid(h)?t?(d(o,"disabled",""),d(o,"aria-disabled","true"),u&&d(u,"disabled","")):(S(o,"disabled"),S(o,"data-unavailable"),S(o,"aria-disabled"),u&&S(u,"disabled")):(d(o,"disabled",""),d(o,"aria-disabled","true"),u&&d(u,"disabled",""),r.isUnavailable(h)&&d(o,"data-unavailable","")),m.today().isSameDay(h)?d(o,"data-today",""):S(o,"data-today",""),a.attributes(o,h),h.isSameDay(l)?u&&d(u,"tabindex","0"):u&&d(u,"tabindex","-1"))})}function Q(i,t){if(!i)return;let e=()=>{let a=i.nextElementSibling;for(;a&&a.hasAttribute("data-appended");){let r=a;a=a.nextElementSibling,r.remove()}};e();let s=t(({slots:a={},attrs:r={}}={})=>{let n=i.content.cloneNode(!0).firstElementChild;return Object.entries(a).forEach(([l,o])=>{(l==="default"?n.querySelectorAll("slot:not([name])"):n.querySelectorAll(`slot[name="${l}"]`)).forEach(h=>h.replaceWith(typeof o=="string"?document.createTextNode(o):o))}),n.querySelectorAll("slot").forEach(l=>l.remove()),Object.entries(r).forEach(([l,o])=>{n.setAttribute(l,o)}),n});return s=Array.isArray(s)?s:[s],s.reverse().forEach(a=>{d(a,"data-appended",""),i.after(a)}),{cleanup:e}}function cn(i){return!i||!i.hasAttribute("data-date")?null:m.fromIsoDateString(i.getAttribute("data-date"))}var M=class{static SELECTION=1;static ACTIVATION=2;static VIEW_CHANGE=3},Kt=class{constructor(){this.subscribers=[],this.subscriberTypes=new WeakMap}subscribe(t,e){let s=Array.isArray(t)?t:[t];this.subscribers.push(e),this.subscriberTypes.has(e)||this.subscriberTypes.set(e,[]),this.subscriberTypes.get(e).push(...s)}notify(t){let e=Array.isArray(t)?t:[t];this.subscribers.forEach(s=>{e.length&&!this.subscriberTypes.get(s)?.some(a=>e.includes(a))||s()})}};var Y=class{static SINGLE="single";static MULTIPLE="multiple";static RANGE="range"},Xe=class i{constructor(t,e,s){this.config=e,this.observable=s,this.selection=t,this.active=null,this.displayResolver=a=>a}setDisplayResolver(t){this.displayResolver=t}select(t){let e=this.selection;this.selection=this.selection.select(t,this.config),this.selection.shouldNotify(e)?this.observable.notify(M.SELECTION):this.observable.notify(M.ACTIVATION)}activate(t){let e=this.active;t?this.active=t:this.active=null,this.selection.activate(t),e!==this.active&&this.observable.notify(M.ACTIVATION)}setValue(t){let e=this.selection;this.selection=this.createSelectionFromValue(t,this.config),this.selection.shouldNotify(e)?this.observable.notify(M.SELECTION):this.observable.notify(M.ACTIVATION)}getValue(){return this.selection.value()}isSelectable(t){return this.selection.selectable(t,this.config)}contains(...t){return this.selection.contains(...t)}hasSelection(){return this.selection.hasSelection()}lowerBound(...t){return this.selection.lowerBound(...t)}upperBound(...t){return this.selection.upperBound(...t)}
125display(...t){return this.displayResolver(this.selection.display(...t))}attributes(...t){return this.selection.attributes(...t)}createSelectionFromValue(t,e){if(e.mode===Y.MULTIPLE){let s=t?t.map(a=>m.fromIsoDateString(a)):[];return new Je(s)}else if(e.mode===Y.RANGE){let{start:s,end:a,preset:r}=t||{};return r&&Qe[r]&&r!=="custom"?new Ze(r,e):!s&&!a?new fe:a?new pe(m.fromIsoDateString(s),m.fromIsoDateString(a)):new Ct(m.fromIsoDateString(s))}else return t?new de(m.fromIsoDateString(t)):new he}static createFromValueStringAttribute(t,e,s){let a=i.createSelectionFromValueStringAttribute(t,e);return new i(a,e,s)}static createSelectionFromValueStringAttribute(t,e){if(e.mode===Y.MULTIPLE){let s=t?t.split(",").map(a=>a.trim()).map(a=>m.fromIsoDateString(a)):[];return new Je(s)}else if(e.mode===Y.RANGE){if(!t)return new fe;let[s,a]=t.split("/").map(r=>r.trim());return!a&&s&&Qe[s]&&s!=="custom"?new Ze(s,e):(s=m.fromIsoDateString(s),a?(a=m.fromIsoDateString(a),new pe(s,a)):new Ct(s))}else return t?new de(m.fromIsoDateString(t)):new he}},Ke=class{constructor(t,e){this.selectable=t,this.observable=e,this._selection=this.selectable.selection,this.selectable.observable.subscribe(M.SELECTION,()=>{this._blockSync()||this.sync()}),this._blockSync=()=>{}}blockSyncIf(t){this._blockSync=t}sync(){this._selection=this.selectable.selection,this.observable.notify(M.SELECTION)}setValue(t){return this.selectable.setValue(t)}getValue(){return this._selection.value()}isSelectable(t){return this._selection.selectable(t,this.config)}hasSelection(){return this._selection.hasSelection()}display(...t){return this.selectable.displayResolver(this._selection.display(...t))}},St=class{contains(){}shouldNotify(t){return!0}hasSelection(){return!1}lowerBound(t){return be(t)}upperBound(t){return this.lowerBound(t)}selectable(t,e){return!0}display(){}value(){}activate(){}attributes(t,e){this.contains(e)?(d(t,"data-selected",""),d(t,"aria-selected","true")):(S(t,"data-selected"),d(t,"aria-selected","false"))}},he=class i extends St{shouldNotify(t){return!(t instanceof i)}hasSelection(){return!1}contains(){return!1}select(t){return new de(t)}lowerBound(t){return be(t)}display(t){return""}value(){return null}},de=class i extends St{constructor(t){super(),this._date=t}hasSelection(){return!0}shouldNotify(t){return!(t instanceof i&&this._date.isSameDay(t._date))}select(t){return this._date.isSameDay(t)?new he:new i(t)}contains(t){return this._date.isSameDay(t)}lowerBound(){return this._date}display(t){return this._date.toFormattedString(t,{day:"numeric",month:"short",year:"numeric"})}value(){return this._date.toIsoDateString()}},Je=class i extends St{constructor(t){super(),this._dates=t}hasSelection(){return this._dates.length>0}shouldNotify(t){return!(t instanceof i&&this._dates.every(e=>t._dates.includes(e))&&t._dates.every(e=>this._dates.includes(e)))}select(t){return this._dates.some(s=>s.isSameDay(t))?new i(this._dates.filter(s=>!s.isSameDay(t))):new i([...this._dates,t])}contains(t){return this._dates.some(e=>e.isSameDay(t))}lowerBound(t){return this._dates.sort((s,a)=>s.isBefore(a)?-1:1)[0]||be(t)}upperBound(t){let e=this._dates.sort((s,a)=>s.isBefore(a)?-1:1);return e[e.length-1]||be(t)}display(t){return this._dates.map(e=>e.toFormattedString(t,{day:"numeric",month:"short",year:"numeric"})).join(", ")}value(){return this._dates.map(t=>t.toIsoDateString())}},fe=class i extends St{constructor(){super()}hasSelection(){return!1}shouldNotify(t){return!(t instanceof i||t instanceof Ct)}select(t){return new Ct(t)}contains(){return!1}lowerBound(t){return be(t)}display(t){return""}value(){return null}},Ct=class i extends St{constructor(t){super(),this._start=t,this._endPreview=null}hasSelection(){return!1}shouldNotify(t){return!1}select(t,e){return t.isBefore(this._start)?new i(t):t.isSameDay(this._start)&&e.minRange>1?new fe:new pe(this._start,t)}activate(t){this._endPreview=t}selectable(t,e){if(e.maxRange&&(t.isBefore(this._start)||this._start.addDays(e.maxRange-1).isBefore(t)))return!1;if(e.minRange){if(this._start.isSameDay(t))return!0;if(t.isBefore(this._start)||this._start.addDays(e.minRange-1).isAfter(t))return!1}let s=e.unavailable.filter(r=>r.isAfter(this._start)).sort((r,n)=>r.toDate()-n.toDate())[0],a=e.unavailable.filter(r=>r.isBefore(this._start)).sort((r,n)=>n.toDate()-r.toDate())[0];return t.isAfter(this._start)?!s||t.isBefore(s):t.isBefore(this._start)?!a||t.isAfter(a):!0}contains(t){return t.isSameDay(this._start)}lowerBound(){return this._start}display(t){return new Intl.DateTimeFormat(t,{day:"numeric",month:"short",year:"numeric",timeZone:"UTC"}).format(this._start.getDate())+" -"}value(){return null}attributes(t,e){this._endPreview&&e.isBetween(this._start,this._endPreview)?(d(t,"data-in-range",""),d(t,"aria-selected","true")):(S(t,"data-in-range"),S(t,"aria-selected")),e.isSameDay(this._start)?d(t,"data-selected",""):S(t,"data-selected"),e.isSameDay(this._start)?d(t,"aria-selected","true"):S(t,"aria-selected"),e.isSameDay(this._start)?d(t,"data-start",""):S(t,"data-start"),e.isSameDay(this._endPreview)?d(t,"data-end-preview",""):S(t,"data-end-preview")}},pe=class i extends St{constructor(t,e){super(),this._start=t,this._end=e}hasSelection(){return!0}shouldNotify(t){return!(t instanceof i&&this._start.isSameDay(t._start)&&this._end.isSameDay(t._end))}select(t){return new Ct(t)}contains(t){return t.isBetween(this._start,this._end)}lowerBound(){return this._start}upperBound(){return this._end}display(t){return new Intl.DateTimeFormat(t,{day:"numeric",month:"short",year:"numeric",timeZone:"UTC"}).formatRange(this._start.getDate(),this._end.getDate()).replaceAll("\u2009"," ")}value(){return{start:this._start.toIsoDateString(),end:this._end.toIsoDateString()}}attributes(t,e){e.isSameDay(this._start)||e.isSameDay(this._end)?d(t,"data-selected",""):S(t,"data-selected"),e.isSameDay(this._start)?d(t,"data-start",""):S(t,"data-start"),e.isSameDay(this._end)?d(t,"data-end",""):S(t,"data-end"),this.contains(e)?(d(t,"data-in-range",""),d(t,"aria-selected","true")):(S(t,"data-in-range"),S(t,"aria-selected"))}},Ze=class i extends St{constructor(t,e){super(),this._preset=t,this._config=e}get _start(){let[t]=Qe[this._preset](this._config);return this._config.min&&t.isBefore(this._config.min)?this._config.min:t}get _end(){let[,t]=Qe[this._preset](this._config);return this._config.max&&t.isAfter(this._config.max)?this._config.max:t}hasSelection(){return!0}shouldNotify(t){return!(t instanceof i&&this._preset===t._preset)}select(t){return new Ct(t,this._config)}contains(t){return t.isBetween(this._start,this._end)}lowerBound(){return this._preset==="allTime"?m.today():this._start}upperBound(){return this._preset==="allTime"?m.today():m.today()}display(t){return new Intl.DateTimeFormat(t,{day:"numeric",month:"short",year:"numeric",timeZone:"UTC"}).formatRange(this._start.getDate(),this._end.getDate()).replaceAll("\u2009"," ")}value(){return{start:this._start.toIsoDateString(),end:this._end.toIsoDateString(),preset:this._preset}}attributes(t,e){e.isSameDay(this._start)||e.isSameDay(this._end)?d(t,"data-selected",""):S(t,"data-selected"),e.isSameDay(this._start)?d(t,"data-start",""):S(t,"data-start"),e.isSameDay(this._end)?d(t,"data-end",""):S(t,"data-end"),this.contains(e)?(d(t,"data-in-range",""),d(t,"aria-selected","true")):(S(t,"data-in-range"),S(t,"aria-selected"))}};function be(i){return typeof i=="function"?i():i}var Qe={today:()=>[m.today(),m.today()],yesterday:()=>{let i=m.today().incrementDays(-1);return[i,i]},thisWeek:i=>{let t=m.today().getCopy().incrementDays(i.startDay-m.today().getDayOfWeek()),e=t.incrementDays(6);return[t,e]},lastWeek:i=>{let t=m.today().incrementDays(i.startDay-(m.today().getDayOfWeek()+7)),e=t.incrementDays(6);return[t,e]},last7Days:()=>{let i=m.today();return[m.today().incrementDays(-6),i]},thisMonth:()=>{let i=m.fromParts(m.today().getYear(),m.today().getMonth(),1),t=m.fromParts(m.today().getYear(),m.today().getMonth(),m.today().getDaysInMonth());return[i,t]},lastMonth:()=>{let i=m.today().getMonth()-1,t=m.today().getYear();i<1&&(i+=12,t--);let e=m.fromParts(t,i,1),s=m.fromParts(t,i,e.getDaysInMonth());return[e,s]},thisQuarter:()=>{let t=Math.floor((m.today().getMonth()-1)/3)*3+1,e=t+2,s=m.fromParts(m.today().getYear(),t,1),a=m.fromParts(m.today().getYear(),e,1),r=m.fromParts(m.today().getYear(),e,a.getDaysInMonth());return[s,r]},lastQuarter:()=>{let t=Math.floor((m.today().getMonth()-4)/3)*3+1,e=t+2,s=m.today().getYear();t<1&&(t+=12,e+=12,s--);let a=m.fromParts(s,t,1),r=m.fromParts(s,e,1),n=m.fromParts(s,e,r.getDaysInMonth());return[a,n]},thisYear:()=>{let i=m.fromParts(m.today().getYear(),1,1),t=m.fromParts(m.today().getYear(),12,31);return[i,t]},lastYear:()=>{let i=m.today().getYear()-1,t=m.fromParts(i,1,1),e=m.fromParts(i,12,31);return[t,e]},last14Days:()=>{let i=m.today();return[m.today().incrementDays(-13),i]},last30Days:()=>{let i=m.today();return[m.today().incrementDays(-29),i]},last3Months:()=>{let i=m.today(),t=m.today().getDay()+1,e=m.today().getMonth()-3,s=m.today().getYear();return e<1&&(e+=12,s--),[m.fromParts(s,e,t),i]},last6Months:()=>{let i=m.today(),t=m.today().getDay()+1,e=m.today().getMonth()-6,s=m.today().getYear();return e<1&&(e+=12,s--),[m.fromParts(s,e,t),i]},yearToDate:()=>{let i=m.fromParts(m.today().getYear(),1,1),t=m.today();return[i,t]},allTime:i=>{if(!i.min)throw new Error("Min date is required for allTime preset");let t=i.min,e=m.today();return[t,e]}};var ti=class{constructor(t,e,s,a){this.month=t,this.year=e,this.config=s,this.observable=a}generateOffsetState(t){return new qi(this,t)}canNavigatePrevious(){let[t,e]=new m(this.year,this.month).addMonths(-1).toParts();return!(this.config.min&&m.fromParts(t,e).isBefore(m.firstDayOfMonth(this.config.min)))}canNavigateNext(){let[t,e]=new m(this.year,this.month).addMonths(this.config.months).toParts();return!(this.config.max&&m.fromParts(t,e).isAfter(this.config.max))}nextMonth(){this.canNavigateNext()&&this.adjustMonth(1)}previousMonth(){this.adjustMonth(-1)}setMonth(t){t&&(this.isWithinMinAndMax(t,this.year)&&(this.month=t),this.observable.notify(M.VIEW_CHANGE))}setYear(t){t&&(this.isWithinMinAndMax(this.month,t)&&(this.year=t),this.observable.notify(M.VIEW_CHANGE))}setDate(t){t&&(this.isWithinMinAndMax(t.getMonth(),t.getYear())&&(this.month=t.getMonth(),this.year=t.getYear()),this.observable.notify(M.VIEW_CHANGE))}isWithinMinAndMax(t,e){return!(this.config.min&&m.fromParts(e,t).isBefore(m.firstDayOfMonth(this.config.min))||this.config.max&&m.fromParts(e,t).isAfter(this.config.max))}adjustMonth(t){let[e,s]=new m(this.year,this.month).addMonths(t).toParts();this.config.min&&m.fromParts(e,s).isBefore(m.firstDayOfMonth(this.config.min))||this.config.max&&m.fromParts(e,s).isAfter(this.config.max)||([this.month,this.year]=[s,e],this.observable.notify(M.VIEW_CHANGE))}},qi=class{constructor(t,e=0){this.offset=e,this.viewState=t}get month(){let[,t]=new m(this.viewState.year,this.viewState.month).addMonths(this.offset).toParts();return t}get year(){let[t]=new m(this.viewState.year,this.viewState.month).addMonths(this.offset).toParts();return t}};var ei=class{constructor(t,e,s){this.min=s.min,this.max=s.max,this.unavailable=s.unavailable,this.selectable=t,this.metadata=e}isBetweenMinMax(t){return t.isBetween(this.min,this.max)}isUnavailable(t){return this.unavailable.some(e=>e.isSameDay(t))||this.metadata.unavailable(t)}isBlocked(t){return!this.selectable.isSelectable(t)}isValid(t){return this.isBetweenMinMax(t)&&!this.isUnavailable(t)&&!this.isBlocked(t)}};var ii=class{constructor(t){this.metadata={},this.observable=t}resetFromJSON(t){this.reset(JSON.parse(t))}appendFromJSON(t){this.append(JSON.parse(t))}append(t){this.metadata={...this.metadata,...t},this.observable.notify(M.VIEW_CHANGE)}reset(t){this.metadata=t,this.observable.notify(M.VIEW_CHANGE)}get(t){return this.metadata[t.toIsoDateString()]}has(t){return this.metadata[t.toIsoDateString()]!==void 0}subtext(t){return this.metadata[t.toIsoDateString()]?.subtext}
125details(t){return this.metadata[t.toIsoDateString()]?.details}variant(t){return this.metadata[t.toIsoDateString()]?.variant}unavailable(t){return!!this.metadata[t.toIsoDateString()]?.unavailable}};var Wi=class extends D{boot(){let t=this.closest("ui-date-picker")||this;this.querySelectorAll("[data-appended]").forEach(l=>l.remove());let[e,s]=ta(t,"months",1);this.observable=new Kt;let a=t.hasAttribute("locale")?t.getAttribute("locale"):ht();this.config={mode:t.getAttribute("mode")==="range"?Y.RANGE:t.hasAttribute("multiple")?Y.MULTIPLE:Y.SINGLE,months:parseInt(e),min:t.hasAttribute("min")?t.getAttribute("min")==="today"?m.today():m.fromIsoDateString(t.getAttribute("min")):null,max:t.hasAttribute("max")?t.getAttribute("max")==="today"?m.today():m.fromIsoDateString(t.getAttribute("max")):null,maxRange:t.hasAttribute("max-range")?parseInt(t.getAttribute("max-range")):null,minRange:t.hasAttribute("min-range")?parseInt(t.getAttribute("min-range")):null,startDay:t.hasAttribute("start-day")?parseInt(t.getAttribute("start-day")):(new Intl.Locale(a).weekInfo?.firstDay||7)%7,unavailable:t.hasAttribute("unavailable")?t.getAttribute("unavailable").split(",").map(l=>m.fromIsoDateString(l.trim())):[],locale:a,fixedWeeks:t.hasAttribute("fixed-weeks")?6:null},s(l=>{this.config.months=parseInt(l),this.observable.notify(M.VIEW_CHANGE)}),this.selectable=Xe.createFromValueStringAttribute(t.getAttribute("value"),this.config,this.observable),this.metadata=new ii(this.observable),this.validator=new ei(this.selectable,this.metadata,this.config);let r=this.selectable.getValue()===null&&t.hasAttribute("open-to")?t.getAttribute("open-to")==="today"?m.today():m.fromIsoDateString(t.getAttribute("open-to")):this.selectable.lowerBound(()=>m.today());if(this.viewState=new ti(r.getMonth(),r.getYear(),this.config,this.observable),this._disableable=new N(this,{disableWithParent:!1}),!this.hasAttribute("static")){let{enable:l,disable:o}=hn(this,this.selectable,this.viewState,this.validator);this._disableable.onInitAndChange(u=>{u?o():l()})}this._controllable=new I(this,{bubbles:!0}),this._submittable=new J(this,{name:this.getAttribute("name"),value:this.selectable.getValue()});let n=L();this._controllable.initial(l=>l&&this.selectable.setValue(l)),this._controllable.getter(()=>this.selectable.getValue()),this._controllable.setter(n(l=>{this.selectable.setValue(l)}
125)),this.observable.subscribe(M.SELECTION,n(()=>{this.dispatchEvent(new Event("select",{bubbles:!1,cancelable:!0})),this._controllable.dispatch(),this._submittable.update(this.selectable.getValue())})),this.observable.subscribe(M.SELECTION,()=>{this.anchorSelection()}),this.observable.subscribe(M.VIEW_CHANGE,()=>{this.dispatchEvent(new Event("navigate",{bubbles:!1,cancelable:!0}))}),queueMicrotask(()=>{this.closest("ui-date-picker")?.bootWithCalendar(this)})}navigateNext(){this.viewState.nextMonth()}navigatePrevious(){this.viewState.previousMonth()}anchorSelection(){let t=document.activeElement;this.contains(t)&&t.closest("[data-date]")!==null||this.viewState.setDate(this.selectable.lowerBound(m.today()))}appendMetadata(t){this.metadata.append(t)}resetMetadata(t={}){this.metadata.reset(t)}visibleDateRange(){return[m.fromParts(this.viewState.year,this.viewState.month,1).toIsoDateString(),m.fromParts(this.viewState.year,this.viewState.month+1,0).toIsoDateString()]}},Vi=class extends D{boot(){let t=this.closest("ui-calendar");this._disableable=t._disableable,Ht(this,()=>this._disableable.isDisabled(),()=>t.navigatePrevious());let e=()=>{t.viewState.canNavigatePrevious()&&!this._disableable.isDisabled()?S(this,"disabled"):d(this,"disabled","")};t.observable.subscribe(M.VIEW_CHANGE,e),this._disableable.onInitAndChange(()=>{e()})}},Bi=class extends D{boot(){let t=this.closest("ui-calendar");this._disableable=t._disableable,Ht(this,()=>this._disableable.isDisabled(),()=>t.navigateNext());let e=()=>{t.viewState.canNavigateNext()&&!this._disableable.isDisabled()?S(this,"disabled"):d(this,"disabled","")};t.observable.subscribe(M.VIEW_CHANGE,e),this._disableable.onInitAndChange(()=>{e()})}},Hi=class extends D{boot(){let t=this.closest("ui-calendar");this._disableable=t._disableable,this.offset=this.hasAttribute("offset")?parseInt(this.getAttribute("offset")):0,this.config=t.config,this.viewState=t.viewState,this.offsetState=this.viewState.generateOffsetState(this.offset),this.validator=t.validator;let e=this.querySelector("select"),s=this.hasAttribute("display")?this.getAttribute("display"):"long";if(e)this.renderSelectOptions(e,s),e.value=this.viewState.month,e.addEventListener("change",this._disableable.enabled(()=>{this.viewState.setMonth(parseInt(e.value))})),t.observable.subscribe(M.VIEW_CHANGE,()=>{this.renderSelectOptions(e,s),e.value=this.viewState.month}),this._disableable.onInitAndChange(a=>{a?d(e,"disabled",""):S(e,"disabled")});else{let a=()=>this.textContent=new Intl.DateTimeFormat(this.config.locale,{month:this.hasAttribute("display")?this.getAttribute("display"):"long",timeZone:"UTC"}).format(new m(this.offsetState.year,this.offsetState.month).getDate());a(),this.viewState.observable.subscribe(M.VIEW_CHANGE,()=>a())}}renderSelectOptions(t,e){let a=Array.from({length:12},(r,n)=>n+1).map(r=>{let n=new m(this.viewState.year,r),l=new m(this.viewState.year,r+1,0);return!this.validator.isBetweenMinMax(n)&&!this.validator.isBetweenMinMax(l)?null:{month:r,label:new Intl.DateTimeFormat(this.config.locale,{month:e,timeZone:"UTC"}).format(new m(2024,r).getDate())}}).filter(Boolean);Q(t.querySelector("template"),r=>a.map(n=>{let l=r({slots:{default:n.label}});return l.setAttribute("value",n.month),l}))}},Yi=class extends D{boot(){let t=this.closest("ui-calendar");this._disableable=t._disableable,this.offset=this.hasAttribute("offset")?parseInt(this.getAttribute("offset")):0,this.config=t.config,this.viewState=t.viewState,this.offsetState=this.viewState.generateOffsetState(this.offset),this.numberOfPastYears=100,this.numberOfFutureYears=10,this.validator=t.validator;let e=this.querySelector("select");if(e)this.renderSelectOptions(e),e.value=this.viewState.year,e.addEventListener("change",this._disableable.enabled(()=>{this.viewState.setYear(parseInt(e.value))})),t.observable.subscribe(M.VIEW_CHANGE,()=>{this.yearIsLessThanMinimum(this.viewState.year)&&(this.numberOfPastYears+=100,this.renderSelectOptions(e)),this.yearIsGreaterThanMaximum(this.viewState.year)&&(this.numberOfFutureYears+=10,this.renderSelectOptions(e)),e.value=this.viewState.year}),this._disableable.onInitAndChange(s=>{s?d(e,"disabled",""):S(e,"disabled")});else{let s=()=>this.textContent=new Intl.DateTimeFormat(this.config.locale,{year:this.hasAttribute("display")?this.getAttribute("display"):"numeric",timeZone:"UTC"}).format(new m(this.offsetState.year,this.offsetState.month).getDate());s(),this.viewState.observable.subscribe(M.VIEW_CHANGE,()=>s())}}yearIsLessThanMinimum(t){return t<this.minimumYear()}yearIsGreaterThanMaximum(t){return t>this.maximumYear()}minimumYear(){return new Date().getFullYear()-this.numberOfPastYears}maximumYear(){return new Date().getFullYear()+this.numberOfFutureYears}renderSelectOptions(t){let e=new Date().getFullYear(),a=Array.from({length:this.numberOfPastYears+this.numberOfFutureYears+1},(r,n)=>e-this.numberOfPastYears+n).map(r=>{let n=new m(r,1),l=new m(r,12,31);return!this.validator.isBetweenMinMax(n)&&!this.validator.isBetweenMinMax(l)?null:r}
125).filter(Boolean);Q(t.querySelector("template"),r=>a.map(n=>r({slots:{default:n}})))}},$i=class extends D{boot(){let t=this.closest("ui-calendar");this._disableable=t._disableable,this.offset=this.hasAttribute("offset")?parseInt(this.getAttribute("offset")):0,this.config=t.config,this.selectable=t.selectable,this.observable=t.observable,this.metadata=t.metadata,this.validator=t.validator,this.viewState=t.viewState,this.offsetState=this.viewState.generateOffsetState(this.offset),this.monthEls=[],this.renderMonths();let e=()=>this.monthEls.forEach(r=>La(r,this.config,r.offsetState,this.metadata)),s=()=>this.monthEls.forEach(r=>Ia(r,this._disableable.isDisabled(),this.config,r.offsetState,this.selectable,this.validator));e(),s();let a=this.config.months;this.viewState.observable.subscribe(M.VIEW_CHANGE,()=>{a!==this.config.months&&(a=this.config.months,this.renderMonths()),e(),s()}),this.observable.subscribe([M.SELECTION,M.ACTIVATION],()=>{s()}),this._disableable.onChange(()=>s())}renderMonths(){let t=this.querySelector('template:not([name]), template[name="month"]');Q(t,e=>{let s=Array.from({length:this.config.months}).map((a,r)=>r);return this.monthEls=s.map(a=>{let r=this.viewState.generateOffsetState(a),n=e({attrs:{"data-month":""}});n.offsetState=r;let l=n.querySelector("thead")?.set;return d(n,"role","grid"),l&&d(l,"aria-hidden","true"),n}),this.monthEls})}},zi=class extends D{boot(){let t=this.closest("ui-calendar, ui-date-picker");this._disableable=t._disableable,this.behavior=this.hasAttribute("behavior")?this.getAttribute("behavior"):"auto",t.hasAttribute("static")&&(this.behavior="none"),Ht(this,()=>this._disableable.isDisabled(),()=>this.navigateAndSelectToday()),this._disableable.onInitAndChange(s=>{s?d(this,"disabled",""):S(this,"disabled")});let e=this.querySelector("template");e&&Q(e,s=>s({slots:{default:m.today().getDay()}}))}navigateAndSelectToday(){let t=this.closest("ui-calendar, ui-date-picker"),e=()=>{let a=t.viewState,r=m.today();return a.year===r.getYear()&&a.month===r.getMonth()};(this.behavior==="select"||this.behavior==="auto"&&e())&&(t.config.mode===Y.RANGE?t.selectable.setValue({start:m.today().toIsoDateString(),end:m.today().toIsoDateString()}):t.config.mode===Y.MULTIPLE?t.selectable.setValue([m.today().toIsoDateString()]):t.selectable.setValue(m.today().toIsoDateString())),t.viewState.setMonth(m.today().getMonth()),t.viewState.setYear(m.today().getYear())}},ji=class extends D{boot(){let t=this.closest("ui-calendar");if(this._disableable=t._disableable,this.offset=this.hasAttribute("offset")?parseInt(this.getAttribute("offset")):0,this.selectable=t.selectable,this.observable=t.observable,this.config=t.config,this.viewState=t.viewState,this.offsetState=this.viewState.generateOffsetState(this.offset),this.config.mode!==Y.RANGE)throw"Presets can only be used with range calendars";let e=this.firstElementChild;if(e){let s=a=>{if(e._selectable instanceof $){let r=e._selectable.findByValue(a);return r?r?.el?.textContent:null}else if(e instanceof HTMLSelectElement)return e.querySelector(`option[value="${a}"]`)?.textContent;return null};this.selectable.setDisplayResolver(a=>{let r=this.selectable.getValue()?.preset||"";if(r){let n=s(r);if(n)return n}return a}),e.value=this.selectable.getValue()?.preset||"custom",e.addEventListener("change",this._disableable.enabled(()=>{if(["","custom"].includes(e.value)){let{start:a,end:r}=this.selectable.getValue()||{};a&&r&&this.selectable.setValue({start:a,end:r})}else this.selectable.setValue({preset:e.value})})),this.observable.subscribe(M.SELECTION,()=>{let a=this.selectable.getValue();e.value=a?.preset||"custom"}),this._disableable.onInitAndChange(a=>{a?d(e,"disabled",""):S(e,"disabled")})}}},Gi=class extends D{boot(){let t=this.closest("ui-calendar");this._disableable=t._disableable,this.offset=this.hasAttribute("offset")?parseInt(this.getAttribute("offset")):0,this.selectable=t.selectable,this.observable=t.observable,this.config=t.config,this.viewState=t.viewState,this.offsetState=this.viewState.generateOffsetState(this.offset);let[e,s]=this.querySelectorAll("input");this.config.mode===Y.RANGE?Ji(e,s,t):Ki(e,t)}};O(({css:i})=>i` 126 ui-calendar-preset, 127 ui-calendar-previous, 128 ui-calendar-next { 129 display: block; 130 user-select: none; 131 } 132`);C("calendar",Wi);C("calendar-today",zi);C("calendar-presets",ji);C("calendar-previous",Vi);C("calendar-inputs",Gi);C("calendar-next",Bi);C("calendar-months",$i);C("calendar-month",Hi);C("calendar-year",Yi);function hn(i,t,e,s){let a=!1,r=i.hasAttribute("readonly");return A(i,"click",n=>{if(a||r)return;let l=n.target.closest("[data-date]");if(!l)return;let o=Jt(l);s.isValid(o)&&t.select(o)}),A(i,"mouseover",n=>{if(a||r)return;let l=n.target.closest("[data-date]");if(!l)return;let o=Jt(l);s.isValid(o)&&t.activate(o)}),A(i,"mouseout",()=>{a||r||t.activate(null)}
132),A(i,"focusin",n=>{if(a||r)return;let l=n.target.closest("[data-date]");if(!l)return;let o=Jt(l);s.isValid(o)&&t.activate(o)}),A(i,"keydown",n=>{if(a)return;let l=n.target.closest("[data-date]");if(!l)return;let o=!0,u,h=Jt(l),p=g=>{let v=h.getCopy(),b=Math.sign(g),c=366;for(v.setDay(v.getDay()+g);!s.isValid(v)&&c>0;)v.setDay(v.getDay()+b),c--;h=v};switch(n.key){case"ArrowRight":u="forward",p(1);break;case"ArrowLeft":u="backward",p(-1);break;case"ArrowUp":u="backward",p(-7);break;case"ArrowDown":u="forward",p(7);break;case"Home":e.previousMonth();break;case"End":e.nextMonth();break;case"PageUp":n.shiftKey,e.previousMonth();break;case"PageDown":n.shiftKey,e.nextMonth();break;default:o=!1}if(o){n.preventDefault(),n.stopPropagation();let g=Array.from(i.querySelectorAll("[data-date]")).find(v=>Jt(v).isSameDay(h));!g&&u&&(u==="forward"?e.nextMonth():e.previousMonth(),g=Array.from(i.querySelectorAll("[data-date]")).find(v=>Jt(v).isSameDay(h))),g?.querySelector("button")?.focus()}}),{enable(){a=!1},disable(){a=!0}}}function Jt(i){return!i||!i.hasAttribute("data-date")?null:m.fromIsoDateString(i.getAttribute("data-date"))}function Ki(i,t){Xi(i);let e=L(),s=e(()=>{let a=t.selectable.getValue();i.value=a||""});t.observable.subscribe(M.SELECTION,s),s(),i.addEventListener("change",e(()=>{let a=i.valueAsDate;a?(t.selectable.setValue(m.fromLocalDate(a).toIsoDateString()),t.viewState.setDate(m.fromLocalDate(a))):t.selectable.setValue("")}))}function Ji(i,t,e){Xi(i),Xi(t);let s=L(),a=s(()=>{let{start:n,end:l}=e.selectable.getValue()||{};i.value=n||"",t.value=l||""}),r=s(()=>{let n=i.valueAsDate,l=t.valueAsDate;n&&l?e.selectable.setValue({start:m.fromLocalDate(n).toIsoDateString(),end:m.fromLocalDate(l).toIsoDateString()}):n?e.selectable.setValue({start:m.fromLocalDate(n).toIsoDateString(),end:null}):e.selectable.setValue({start:null,end:null})});e.observable.subscribe(M.SELECTION,a),a(),i.addEventListener("change",r),t.addEventListener("change",r)}function Xi(i){A(i,"change",t=>t.stopPropagation()),A(i,"input",t=>t.stopPropagation())}var Qi=class extends V{bootWithCalendar(t){let e=t.config.mode===Y.RANGE;this.calendar=t,this._disableable=new N(this),this.observable=new Kt,this.selectable=new Ke(this.calendar.selectable,this.observable),this.viewState=this.calendar.viewState,this.querySelector("ui-selected-date")?.bootWithCalendar(),this.querySelector("ui-date-picker-select")?.bootWithCalendar();let s=this.querySelector("dialog");if(!s)return;let a=this.querySelector("input");a=s?.contains(a)?null:a;let r=Array.from(this.querySelectorAll("input")).find(h=>h!==a);r=s?.contains(r)?null:r,a&&a.addEventListener("click",h=>h.preventDefault()),r&&r.addEventListener("click",h=>h.preventDefault());let n=this.querySelector("button");n=s?.contains(n)?null:n;let l=U(this.calendar,"calendar"),o=a||n;if(!o)return;if(d(o,"role","combobox"),d(o,"aria-controls",l),this._disableable.onInitAndChange(h=>{h?d(o,"disabled",""):S(o,"disabled")}),this._dialogable=new Yt(s,{clickOutside:!this.hasAttribute("disable-click-outside"),triggers:[n,a,r].filter(Boolean)}),this._anchorable=new z(s,{reference:o,position:this.hasAttribute("position")?this.getAttribute("position"):void 0,gap:this.hasAttribute("gap")?this.getAttribute("gap"):void 0,offset:this.hasAttribute("offset")?this.getAttribute("offset"):void 0}),ia()&&(a&&this.showIOSOverlay(a),r&&this.showIOSOverlay(r)),this.querySelectorAll("button").forEach(h=>{h!==o&&(s.contains(h)||(d(h,"aria-controls",l),d(h,"aria-haspopup","combobox"),Na(h,this._dialogable),A(h,"click",()=>this._dialogable.toggle())))}),dn(this,o,s,this._dialogable,this._anchorable),Na(o,this._dialogable),bn(this,this._dialogable),fn(o,this._dialogable),mn(this,this.calendar.config.mode,this.observable,this.selectable,this._dialogable),e&&s&&a&&r)Zi(a),Zi(r),Ji(a,r,this);else if(s&&a){let h=a;Zi(h),Ki(h,this)}else s&&pn(n,this._dialogable);this._controllable=new I(this,{bubbles:!0}),this.calendar.addEventListener("change",h=>h.stopPropagation()),this.calendar.addEventListener("input",h=>h.stopPropagation()),this._submittable=new J(this,{name:this.getAttribute("name"),value:this.selectable.getValue()});let u=L();this._controllable.initial(h=>h&&this.selectable.setValue(h)),this._controllable.getter(()=>this.selectable.getValue()),this._controllable.setter(u(h=>this.selectable.setValue(h))),this.observable.subscribe(M.SELECTION,u(()=>{this.dispatchEvent(new Event("select",{bubbles:!1,cancelable:!0})),this._controllable.dispatch(),this._submittable.update(this.selectable.getValue())})),this.observable.subscribe(M.VIEW_CHANGE,()=>{this.dispatchEvent(new Event("navigate",{bubbles:!1,cancelable:!0}))})}showIOSOverlay(t){let e=document.createElement("button");e.setAttribute("data-flux-ios-overlay",""),e.setAttribute("data-appended",""),e.classList.add("absolute","
132inset-0"),t.after(e)}input(){return this.querySelector("input")}clear(){this.selectable.setValue(null)}open(){this._dialogable.setState(!0)}close(){this._dialogable.setState(!1)}},ts=class extends D{bootWithCalendar(){if(this.picker=this.closest("ui-date-picker"),this.querySelectorAll("[data-appended]").forEach(t=>t.remove()),!this.querySelector('template[name="date"]')){let t=document.createElement("template");t.setAttribute("name","date"),t.innerHTML="<div><slot></slot></div>",this.appendChild(t)}this.templates={placeholder:this.querySelector('template[name="placeholder"]'),date:this.querySelector('template[name="date"]')},this.picker.observable.subscribe(M.SELECTION,()=>{this.render(this.picker)}),this.render(this.picker)}render(t){if(this.templates.placeholder?.clearPlaceholder?.(),this.templates.date?.clearDate?.(),t.selectable.hasSelection()){let{cleanup:e}=Q(this.templates.date,s=>s({slots:{default:t.selectable.display(this.picker.calendar.config.locale)}}));this.templates.date.clearDate=e}else{if(!this.templates.placeholder)return;let{cleanup:e}=Q(this.templates.placeholder,s=>s({slots:{}}));this.templates.placeholder.clearPlaceholder=e}}},es=class extends D{bootWithCalendar(){this.picker=this.closest("ui-date-picker"),this.picker.selectable.blockSyncIf(()=>this.getBoundingClientRect().width>0),Ht(this,()=>this.picker._disableable.isDisabled(),()=>{this.picker.selectable.sync(),this.picker._dialogable.setState(!1)})}};C("date-picker",Qi);C("date-picker-select",es);C("selected-date",ts);O(({css:i})=>i`ui-date-picker { display: block; }`);O(({css:i})=>i` 133/* For Chrome, Safari, Edge */ 134ui-date-picker input[type="date"]::-webkit-calendar-picker-indicator { 135 display: none; 136 -webkit-appearance: none; 137} 138`);function Na(i,t){d(i,"aria-haspopup","listbox");let e=()=>{d(i,"aria-expanded",t.getState()?"true":"false"),t.getState()?d(i,"data-open",""):S(i,"data-open","")};t.onChange(()=>{e()}),e()}function dn(i,t,e,s,a){let r=()=>{Array.from([i,e]).forEach(n=>{s.getState()?d(n,"data-open",""):S(n,"data-open","")}),s.getState()&&a.reposition()};s.onChange(()=>r()),r(),s.onChange(()=>{s.getState()?i.dispatchEvent(new Event("open",{bubbles:!1,cancelable:!1})):i.dispatchEvent(new Event("close",{bubbles:!1,cancelable:!1}))})}function fn(i,t){A(i,"keydown",e=>{["ArrowDown","ArrowUp","Escape"].includes(e.key)&&(e.key==="ArrowDown"||e.key==="ArrowUp"?t.getState()||(t.setState(!0),e.preventDefault(),e.stopImmediatePropagation()):e.key==="Escape"&&t.getState()&&t.setState(!1))})}function pn(i,t){A(i,"click",()=>{t.setState(!t.getState())})}function Zi(i){A(i,"focus",()=>i.select())}function bn(i,t){let{lock:e,unlock:s}=ct(t.el);t.onChange(()=>{t.getState()?e():s()})}function mn(i,t,e,s,a){let r=t!==Y.MULTIPLE;if(i.hasAttribute("close")){let n=i.getAttribute("close");r=n.split(" ").includes("auto"),n==="manual"&&(r=!1)}r&&e.subscribe(M.SELECTION,()=>{s.hasSelection()&&a.setState(!1)})}var is=class extends D{boot(){let t=this.trigger(),e=this.overlay();this._disabled=this.hasAttribute("disabled"),this._popoverable=new it(e),this._anchorable=new z(e,{reference:t,auto:!1,position:this.hasAttribute("position")?this.getAttribute("position"):void 0,gap:this.hasAttribute("gap")?this.getAttribute("gap"):void 0,offset:this.hasAttribute("offset")?this.getAttribute("offset"):void 0});let{lock:s,unlock:a}=ct(this._popoverable.el);this._popoverable.onChange(()=>{this._popoverable.getState()?s():a()}),A(t,"contextmenu",r=>{r.preventDefault(),this._anchorable.reposition(r.pageX,r.pageY),this._popoverable.setState(!0),this.hasAttribute("detail")&&d(e,"data-detail",this.getAttribute("detail"))}),this.hasAttribute("detail")&&d(e,"data-detail","")}trigger(){return this.firstElementChild}overlay(){if(this.hasAttribute("target")){let t=this.getAttribute("target");return document.getElementById(t)}else return this.lastElementChild.matches("[popover]")&&this.lastElementChild}};C("context",is);var me=class extends mt{groupOfType=B;boot({options:t}){t({wrap:!1,filter:!1}),this.onChanges=[]}onChange(t){this.onChanges.push(t)}
138activated(t){this.onChanges.forEach(e=>e())}activateFirst(){this.filterAwareWalker().first()?.use(B).activate()}activateBySearch(t){this.filterAwareWalker().find(s=>s.textContent.toLowerCase().trim().startsWith(t.toLowerCase()))?.use(B).activate()}activateSelectedOrFirst(t){if(!t||(s=>s.matches("ui-option")?getComputedStyle(s).display==="none":!1)(t)){this.filterAwareWalker().first()?.use(B).activate();return}t?.use(B).activate()}activateActiveOrFirst(){let t=this.getActive();if(!t){this.filterAwareWalker().first()?.use(B).activate();return}t?.use(B).activate()}activateActiveOrLast(){let t=this.getActive();if(!t){this.filterAwareWalker().last()?.use(B).activate();return}t?.use(B).activate()}activatePrev(){let t=this.getActive();if(!t){this.filterAwareWalker().last()?.use(B).activate();return}let e;this.options.wrap?e=this.filterAwareWalker().prevOrLast(t):e=this.filterAwareWalker().prev(t),e?.use(B).activate()}activateNext(){let t=this.getActive();if(!t){this.filterAwareWalker().first()?.use(B).activate();return}let e;this.options.wrap?e=this.filterAwareWalker().nextOrFirst(t):e=this.filterAwareWalker().next(t),e?.use(B).activate()}getActive(){return this.walker().find(t=>t.use(B).isActive())}clearActive(){this.getActive()?.use(B).deactivate()}filterAwareWalker(){let t=e=>e.matches("ui-option")?getComputedStyle(e).display==="none":!1;return W(this.el,(e,{skip:s,reject:a})=>{if(e[this.constructor.name]&&e!==this.el)return a();if(!e[this.groupOfType.name])return s();if(e.hasAttribute("disabled")||t(e))return a()})}},B=class i extends F{groupedByType=me;mount(){this.el.addEventListener("mouseenter",()=>{this.activate()}),this.el.addEventListener("mouseleave",()=>{this.deactivate()})}activate(){this.group()&&this.group().walker().each(t=>t.use(i).deactivate(!1)),!this.el.hasAttribute("disabled")&&(d(this.el,"data-active",""),this.el.scrollIntoView({block:"nearest"}),this.group()&&this.group().activated(this.el))}deactivate(t=!0){S(this.el,"data-active"),t&&this.group()&&this.group().activated(this.el)}isActive(){return this.el.hasAttribute("data-active")}};var ge=class extends mt{groupOfType=_t;boot({options:t}){t({}),this.onChanges=[],this.lastSearch=""}onChange(t){this.onChanges.push(t)}filter(t){t===""?this.walker().each(e=>{e.use(_t).unfilter()}):this.walker().each(e=>{this.matches(e,t)?e.use(_t).unfilter():e.use(_t).filter()}
138),this.lastSearch!==t&&this.onChanges.forEach(e=>e()),this.lastSearch=t}matches(t,e){return t.textContent.toLowerCase().trim().includes(e.toLowerCase().trim())}hasResults(){return this.walker().some(t=>!t.use(_t).isFiltered())}},_t=class extends F{groupedByType=ge;boot({options:t}){t({mirror:null,keep:!1}),this.onChanges=[]}filter(){this.options().keep||(d(this.el,"data-hidden",""),this.options().mirror&&d(this.options().mirror,"data-hidden",""))}unfilter(){S(this.el,"data-hidden"),this.options().mirror&&S(this.options().mirror,"data-hidden","")}isFiltered(){return this.el.hasAttribute("data-hidden")}};var bt=class extends mt{groupOfType=q;boot({options:t}){t({wrap:!1,ensureTabbable:!0})}mount(){this.options().ensureTabbable&&this.ensureTabbable()}focusFirst(){let t;t=t||this.walker().find(e=>e.hasAttribute("autofocus")),t=t||this.walker().find(e=>e.getAttribute("tabindex")==="0"),t=t||this.walker().find(e=>e.getAttribute("tabindex")==="-1"),t=t||this.walker().find(e=>Zs(e)),t?.focus()}focusPrev(){this.moveFocus(t=>this.options().wrap?this.walker().prevOrLast(t):this.walker().prev(t))}focusNext(){this.moveFocus(t=>this.options().wrap?this.walker().nextOrFirst(t):this.walker().next(t))}focusBySearch(t){let e=this.walker().find(s=>s.textContent.toLowerCase().trim().startsWith(t.toLowerCase()));e?.use(q).tabbable(),e?.use(q).focus()}moveFocus(t){let e=this.walker().find(a=>a.use(q).isTabbable());t(e)?.use(q).focus()}ensureTabbable(){this.walker().findOrFirst(t=>{t.use(q).isTabbable()})?.use(q).tabbable()}wipeTabbables(){this.walker().each(t=>{t.use(q).untabbable()})}untabbleOthers(t){this.walker().each(e=>{e!==t&&e.use(q).untabbable()})}walker(){return W(this.el,(t,{skip:e,reject:s})=>{if(t[this.constructor.name]&&t!==this.el)return s();if(!t[this.groupOfType.name])return e();if(t.hasAttribute("disabled"))return s()})}},q=class extends F{groupedByType=bt;boot({options:t}){t({hover:!1,disableable:null,tabbable:!1,tabbableAttr:null})}mount(){let t=this.options().disableable;if(!t)throw"Focusable requires a Disableable instance...";this.el.hasAttribute("tabindex")||(this.options().tabbable?this.tabbable():this.untabbable()),this.pauseFocusListener=this.on("focus",t.enabled(()=>{this.focus(!1)})).pause,this.on("focus",t.enabled(()=>{ie()&&d(this.el,"data-focus","")})),this.on("blur",t.enabled(()=>{S(this.el,"data-focus")})),this.options().hover&&this.on("pointerenter",t.enabled(()=>{this.group()?.untabbleOthers(this.el),this.tabbable()})),this.options().hover&&this.on("pointerleave",t.enabled(e=>{this.untabbable()}))}focus(t=!0){this.group()?.untabbleOthers(this.el),this.tabbable(),t&&this.pauseFocusListener(()=>{this.el.focus({focusVisible:!1})})}tabbable(){d(this.el,"tabindex","0"),this.options().tabbableAttr&&d(this.el,this.options().tabbableAttr,"")}untabbable(){d(this.el,"tabindex","-1"),this.options().tabbableAttr&&S(this.el,this.options().tabbableAttr)}isTabbable(){return this.el.getAttribute("tabindex")==="0"}};var ve=class extends D{boot(){d(this,"tabindex","-1"),this.hasAttribute("popover")&&this.addEventListener("lofi-close-popovers",()=>{this.hidePopover()}),d(this,"role","listbox")}},ss=class extends D{mount(){let t=this;this._disableable=new N(t,{disableWithParent:!1}),this._disableable.onInitAndChange(a=>{a?d(t,"aria-disabled","true"):S(t,"aria-disabled")});let e=U(t,"option");d(t,"role","option"),this._filterable=new _t(t,{mirror:this,keep:!!this.closest("ui-empty")||this.getAttribute("filter")==="manual"}),this._activatable=new B(t),this.hasAttribute("action")||(this._selectable=new P(t,{value:this.getValue(),label:this.getLabel(),selectedInitially:this.hasAttribute("selected")})),new MutationObserver(a=>{a.forEach(r=>{r.attributeName==="selected"&&(this.hasAttribute("selected")?this._selectable.setState(!0):this._selectable.setState(!1))})}).observe(this,{attributeFilter:["selected"]})}get selected(){return this?._selectable?this._selectable.isSelected():!1}set selected(t){if(!this?._selectable)return!1;this._selectable.setState(t)}getLabel(){return this.hasAttribute("label")?this.getAttribute("label"):this.textContent.trim()}getValue(){return this.hasAttribute("value")?this.getAttribute("value"):this.textContent.trim()}};O(({css:i})=>i`ui-options:not([popover]), ui-option { display: block; cursor: default; }`);C("options",ve);C("option",ss);var si=class extends D{boot(){if(this.querySelectorAll("[data-appended]").forEach(t=>t.remove()),!this.querySelector("template")){let t=document.createElement("template");t.setAttribute("name","placeholder"),t.innerHTML="<span>"+this.innerHTML+"</span>",this.innerHTML="",this.appendChild(t)}if(!this.querySelector('template[name="options"]')){let t=document.createElement("template");t.setAttribute("name","options"),t.innerHTML="<div><slot></slot></div>",this.appendChild(t)}if(!this.querySelector('template[name="option"]')){let t=document.createElement("template");t.setAttribute("name","option"),t.innerHTML="<div><slot></slot></div>",this.appendChild(t)}this.templates={placeholder:this.querySelector('template[name="placeholder"]'),overflow:this.querySelector('template[name="overflow"]'),options:this.querySelector('template[name="options"]'),option:this.querySelector('template[name="option"]')},this.templates.options.elsByValue=new Map,this.max=this.templates.overflow?.getAttribute("max")?this.templates.overflow.getAttribute("max"):1/0,this.selecteds=new Map,this.picker=this.closest("ui-select"),this.multiple=this.picker.hasAttribute("multiple")}mount(){queueMicrotask(()=>{this.picker._selectable.onInitAndChange(()=>{this.render(!0)});let t=this.picker.list();t&&new MutationObserver(e=>{queueMicrotask(()=>this.render())}).observe(t,{childList:!0})})}render(t){if(this.multiple){let e=this.picker.value,s=Array.from(this.selecteds.keys()).filter(n=>!e.includes(n)),a=e.filter(n=>!this.selecteds.has(n));
138s.forEach(n=>this.selecteds.delete(n));let r=new Map;for(let n of a){let l=this.picker._selectable.findByValue(n);if(!l){if(t)return setTimeout(()=>this.render());throw`Could not find option for value "${n}"`}r.set(n,l)}r.forEach((n,l)=>this.selecteds.set(l,n)),this.templates.placeholder?.clearPlaceholder?.(),this.templates.overflow?.clearOverflow?.(),this.templates.options?.clearOptions?.(),this.selecteds.size>0?this.renderOptions({hasOverflowed:n=>{if(this.max==="auto"){let l=!1;if(this.renderOverflow(this.selecteds.size,this.selecteds.size-n),this.clientWidth<this.scrollWidth&&(l=!0),this.templates.overflow?.clearOverflow?.(),l)return!0}return n>parseInt(this.max)},renderOverflow:n=>{this.templates?.overflow?.getAttribute("mode")!=="append"&&this.templates.options?.clearOptions?.(),this.renderOverflow(this.selecteds.size,n)}}):this.renderPlaceholder()}else{let e=this.picker.value;if(Array.from(this.selecteds.keys()).includes(e))return;this.selecteds.clear();let s=this.picker._selectable.findByValue(e);if(s)this.selecteds.set(e,s);else if(!["",null,void 0].includes(e)){if(t)return setTimeout(()=>{console.log("retrying..."),this.render()});throw`Could not find option for value "${e}"`}this.templates.placeholder?.clearPlaceholder?.(),this.templates.option?.clearOption?.(),this.selecteds.size>0?this.renderOption():this.renderPlaceholder()}}renderOptions({hasOverflowed:t,renderOverflow:e}){let s=document.createElement("div");s.style.display="contents";let a=ye(this.templates.options,{default:s});this.templates.options.after(a),this.templates.options.clearOptions=()=>{a.remove(),this.templates.options.clearOptions=()=>{}};let r=0,n=!1;for(let[o,u]of this.selecteds){let h=new DocumentFragment;h.append(...u.el.cloneNode(!0).childNodes);let p=ye(this.templates.option,{text:u.el.textContent.trim(),default:h,value:o});if(p.setAttribute("data-value",o),p.setAttribute("data-appended",""),p.deselect=()=>u.deselect(),s.appendChild(p),r++,t(r)){n=!0,s.removeChild(p),r--;break}}let l=new DocumentFragment;l.append(...s.childNodes),s.replaceWith(l),n&&e(this.selecteds.size-r)}renderOption(){for(let[t,e]of this.selecteds){let s=new DocumentFragment;s.append(...e.el.cloneNode(!0).childNodes);let a=ye(this.templates.option,{text:e.el.textContent.trim(),default:s,value:t});a.setAttribute("data-value",t),a.setAttribute("data-appended",t),a.deselect=()=>e.deselect(),this.templates.option.after(a),this.templates.option.clearOption=()=>{a.remove(),this.templates.option.clearOption=()=>{}}}}renderPlaceholder(){if(!this.templates.placeholder)return;let t=ye(this.templates.placeholder);t.setAttribute("data-appended",""),this.templates.placeholder.after(t),this.templates.placeholder.clearPlaceholder=()=>{t.remove(),this.templates.placeholder.clearPlaceholder=()=>{}}}renderOverflow(t,e){if(!this.templates.overflow)return;let s=ye(this.templates.overflow,{remainder:e,count:this.selecteds.size});s.setAttribute("data-appended",""),this.templates.overflow.after(s),this.templates.overflow.clearOverflow=()=>{s.remove(),this.templates.placeholder.clearOverflow=()=>{}}}};function ye(i,t={}){let e=i.content.cloneNode(!0);return Object.entries(t).forEach(([s,a])=>{(s==="default"?e.querySelectorAll("slot:not([name])"):e.querySelectorAll(`slot[name="${s}"]`)).forEach(n=>n.replaceWith(typeof a=="string"?document.createTextNode(a):a))}),e.firstElementChild}var Ae=class extends V{boot(){let t=this.list();this._controllable=new I(this,{bubbles:!0}),this._selectable=new $(t,{multiple:this.hasAttribute("multiple")}),this._submittable=new J(this,{name:this.getAttribute("name"),value:this._selectable.getState()}),this._controllable.initial(s=>s&&this._selectable.setState(s)),this._controllable.getter(()=>this._selectable.getState());let e=L();this._controllable.setter(e(s=>{this._selectable.setState(s)})),this._selectable.onChange(e(()=>{this._controllable.dispatch(),this.dispatchEvent(new CustomEvent("select",{bubbles:!1}))})),this._selectable.onInitAndChange(()=>{this._submittable.update(this._selectable.getState())}),queueMicrotask(()=>{this._submittable.update(this._selectable.getState())})}mount(){this._disableable=new N(this);let t=this.input(),e=this.button(),s=this.list(),a=this.hasAttribute("multiple"),r=this.hasAttribute("autocomplete"),n=this.hasAttribute("autocomplete")&&this.getAttribute("autocomplete").trim().split(" ").includes("strict"),l=this.querySelector("ui-options")||this,o=gn(l,"options");this._activatable=new me(l,{filter:"data-hidden"}),!t&&!e&&this._disableable.onInitAndChange(b=>{b?this.removeAttribute("tabindex"):this.setAttribute("tabindex","0")}),this.hasAttribute("filter")&&this.getAttribute("filter")!=="manual"&&(this._filterable=new ge(s),this._filterable.onChange(()=>{this._activatable.clearActive(),this._filterable.hasResults()&&this._activatable.activateFirst()}),this.addEventListener("close",()=>{this._filterable&&this._filterable.filter("")}
138));let u=this.querySelector("[popover]:not(ui-tooltip > [popover])"),h=u?.querySelector('input:not([type="hidden"])'),p=this.querySelector('input:not([type="hidden"])');p=u?.contains(p)?null:p;let g=this.querySelector("button");if(g=u?.contains(g)?null:g,!(u||p))we(this,this._activatable),xe(this,this,this._activatable),Ra(this,this._activatable,this._selectable);else if(!u&&p){let b=p;this._disableable.onInitAndChange(c=>{c?b&&d(b,"disabled",""):b&&S(b,"disabled")}),hs(this,b,this._selectable,this._popoverable),Ra(b,this._activatable,this._selectable),qa(r,n,this,b,this._selectable,this._popoverable),cs(b),us(b),this._filterable&&ls(b,this._filterable),fs(b,this._activatable),we(b,this._activatable),xe(this,b,this._activatable),ai(this,this._activatable)}else if(u&&p){let b=p;d(b,"role","combobox"),d(b,"aria-controls",o);let c=u;this._popoverable=new it(c),this._anchorable=new z(c,{reference:b,matchWidth:!0,position:this.hasAttribute("position")?this.getAttribute("position"):void 0,gap:this.hasAttribute("gap")?this.getAttribute("gap"):void 0,offset:this.hasAttribute("offset")?this.getAttribute("offset"):void 0}),qa(r,n,this,b,this._selectable,this._popoverable),this._disableable.onInitAndChange(_=>{_?b&&d(b,"disabled",""):b&&S(b,"disabled")}),this.querySelectorAll("button").forEach(_=>{c.contains(_)||(d(_,"tabindex","-1"),d(_,"aria-controls",o),d(_,"aria-haspopup","listbox"),ri(_,this._popoverable),A(_,"click",()=>{this._popoverable.toggle(),b.focus()}))}),hs(this,b,this._selectable,this._popoverable),as(this,b,c,this._popoverable,this._anchorable),ps(this,this._popoverable),ri(b,this._popoverable),cs(b),us(b),this._filterable&&ls(b,this._filterable),fs(b,this._activatable),wn(b,this._popoverable),os(b,this._popoverable,this._activatable,this._selectable),vn(b,this._popoverable),ns(this,this._popoverable),we(b,this._activatable),xe(this,b,this._activatable),ai(this,this._activatable),rs(this._popoverable,this._activatable,this._selectable),ds(this,this._selectable,this._popoverable,a)}else if(u&&h){let b=g,c=h,_=u;d(b,"role","combobox"),d(c,"role","combobox"),d(b,"aria-controls",o),this._disableable.onInitAndChange(y=>{y?(b&&d(b,"disabled",""),c&&d(c,"disabled","")):(b&&S(b,"disabled"),c&&S(c,"disabled"))}),this._popoverable=new it(_),this._anchorable=new z(_,{reference:b,matchWidth:!0,position:this.hasAttribute("position")?this.getAttribute("position"):void 0,gap:this.hasAttribute("gap")?this.getAttribute("gap"):void 0,offset:this.hasAttribute("offset")?this.getAttribute("offset"):void 0,scrollY:!1}),cs(c),us(c),this._filterable&&ls(c,this._filterable),yn(c,this._popoverable),as(this,b,_,this._popoverable,this._anchorable),ps(this,this._popoverable),ri(b,this._popoverable),hs(this,c,this._selectable,this._popoverable),os(b,this._popoverable,this._activatable,this._selectable),Ua(b,this._popoverable),ns(this,this._popoverable),we(c,this._activatable),Fa(b,this._activatable,this._popoverable),xe(this,c,this._activatable),ai(this,this._activatable),rs(this._popoverable,this._activatable,this._selectable),ds(this,this._selectable,this._popoverable,a)}else if(u){let b=g,c=u;d(b,"role","combobox"),d(b,"aria-controls",o),this._disableable.onInitAndChange(_=>{_?(b&&d(b,"disabled",""),t&&d(t,"disabled","")):(b&&S(b,"disabled"),t&&S(t,"disabled"))}),this._popoverable=new it(c),this._anchorable=new z(c,{reference:b,matchWidth:!0,position:this.hasAttribute("position")?this.getAttribute("position"):void 0,gap:this.hasAttribute("gap")?this.getAttribute("gap"):void 0,offset:this.hasAttribute("offset")?this.getAttribute("offset"):void 0}),as(this,b,c,this._popoverable,this._anchorable),ps(this,this._popoverable),ri(b,this._popoverable),os(b,this._popoverable,this._activatable,this._selectable),Ua(b,this._popoverable),fs(b,this._activatable),ns(this,this._popoverable),we(b,this._activatable),Fa(b,this._activatable,this._popoverable),xe(this,b,this._activatable),ai(this,this._activatable),rs(this._popoverable,this._activatable,this._selectable),ds(this,this._selectable,this._popoverable,a)}new MutationObserver(()=>{setTimeout(()=>{if(!this._popoverable||this._popoverable.getState()){let b=this._selectable.selecteds().find(c=>!c.el._disableable.isDisabled())?.el;setTimeout(()=>{this._activatable.activateSelectedOrFirst(b)})}else this._activatable.clearActive()})}).observe(s,{childList:!0})}button(){return Array.from(this.querySelectorAll("button")).find(t=>t.nextElementSibling?.matches("[popover]"))||null}input(){return this.querySelector('input:not([type="hidden"])')}list(){return this.querySelector("ui-options")||this}clear(){this.input()&&(this.input().value="",this.input().dispatchEvent(new Event("input",{bubbles:!1})))}open(){this._popoverable.setState(!0)}close(){this._popoverable.setState(!1)}deselectLast(){!this.hasAttribute("multiple")&&this.value!==null&&(this.value=null,this.dispatchEvent(new Event("input",{bubbles:!1})),this.dispatchEvent(new Event("change",{bubbles:!1}))),this.hasAttribute("multiple")&&this.value.length!==0&&(this.value=this.value.slice(0,-1),this.dispatchEvent(new Event("input",{bubbles:!1})),this.dispatchEvent(new Event("change",{bubbles:!1})))}},bs=class extends D{boot(){d(this,"data-hidden","")}mount(){queueMicrotask(()=>{let t=this.closest("ui-autocomplete, ui-combobox, ui-select"),e=this.closest("ui-options");
138if(!e)return;let s=l=>l.hasAttribute("data-hidden"),a=()=>{let l;CSS.supports("selector(&)")?l=Array.from(e.querySelectorAll("& > ui-option")).filter(o=>!s(o)).length===0:l=Array.from(e.querySelectorAll(":scope > ui-option")).filter(o=>!s(o)).length===0,l?S(this,"data-hidden"):d(this,"data-hidden","")};a();let r=t._filterable;r&&r.onChange(a),new MutationObserver(l=>{setTimeout(()=>a())}).observe(e,{childList:!0})})}};C("selected",si);C("select",Ae);C("empty",bs);O(({css:i})=>i`ui-select { display: block; }`);O(({css:i})=>i`ui-selected-option { display: contents; }`);O(({css:i})=>i`ui-empty { display: block; cursor: default; }`);function we(i,t){A(i,"keydown",e=>{["ArrowDown","ArrowUp"].includes(e.key)&&(e.key==="ArrowDown"?(t.activateNext(),e.preventDefault(),e.stopPropagation()):e.key==="ArrowUp"&&(t.activatePrev(),e.preventDefault(),e.stopPropagation()))})}function Fa(i,t,e){We(i,s=>{t.activateBySearch(s),e.getState()||t.getActive()?.click()})}function xe(i,t,e){A(t,"keydown",s=>{if(s.key==="Enter"){let a=e.getActive();if(s.preventDefault(),s.stopPropagation(),!a)return;a.click(),i.dispatchEvent(new CustomEvent("action",{bubbles:!1,cancelable:!1}))}})}function ai(i,t,e=!1){A(i,e?"pointerdown":"click",s=>{if(s.target.closest("ui-option")){let a=s.target.closest("ui-option");if(a._disableable.isDisabled())return;a._selectable?.trigger(),i.dispatchEvent(new CustomEvent("action",{bubbles:!1,cancelable:!1})),s.preventDefault(),s.stopPropagation()}})}function Ra(i,t,e){A(i,"focus",()=>{let s=e.selecteds().find(a=>!a.el._disableable.isDisabled())?.el;t.activateSelectedOrFirst(s)}),A(i,"blur",()=>{t.clearActive()})}function gn(i){let t=U(i,"options");return d(i,"role","listbox"),t}function ri(i,t){d(i,"aria-haspopup","listbox");let e=()=>{d(i,"aria-expanded",t.getState()?"true":"false"),t.getState()?d(i,"data-open",""):S(i,"data-open","")};t.onChange(()=>{e()}),e()}function as(i,t,e,s,a){let r=()=>{Array.from([i,e]).forEach(n=>{s.getState()?d(n,"data-open",""):S(n,"data-open","")}),s.getState()?a.reposition():a.cleanup()};s.onChange(()=>r()),r(),s.onChange(()=>{s.getState()?i.dispatchEvent(new Event("open",{bubbles:!1,cancelable:!1})):i.dispatchEvent(new Event("close",{bubbles:!1,cancelable:!1}))})}function rs(i,t,e){i.onChange(()=>{if(i.getState()){let s=e.selecteds().find(a=>!a.el._disableable.isDisabled())?.el;setTimeout(()=>{t.activateSelectedOrFirst(s)})}else t.clearActive()})}function ns(i,t){A(i,"keydown",e=>{e.key==="Escape"&&t.getState()&&(t.setState(!1),e.preventDefault(),e.stopImmediatePropagation())})}function os(i,t){A(i,"keydown",e=>{["ArrowDown","ArrowUp"].includes(e.key)&&(e.key==="ArrowDown"||e.key==="ArrowUp")&&(t.getState()||(t.setState(!0),e.preventDefault(),e.stopImmediatePropagation()))})}function vn(i,t){A(i,"click",()=>{t.getState()||(t.setState(!0),i.focus())})}function Ua(i,t){A(i,"click",()=>{t.setState(!t.getState()),i.focus()})}function yn(i,t){t.onChange(()=>{t.getState()&&setTimeout(()=>i.focus())})}function ls(i,t){t&&A(i,"input",e=>{t.filter(e.target.value)})}function us(i){A(i,"focus",()=>i.select())}function cs(i){A(i,"change",t=>t.stopPropagation()),A(i,"input",t=>t.stopPropagation())}function wn(i,t){A(i,"keydown",e=>{(/^[a-zA-Z0-9]$/.test(e.key)||e.key==="Backspace")&&(t.getState()||t.setState(!0))})}function hs(i,t,e,s){if(!i.hasAttribute("clear"))return;let r=p=>{t.value=p,t.dispatchEvent(new Event("input",{bubbles:!1}))},n=i.getAttribute("clear"),l=n===""||n.split(" ").includes("action"),o=n===""||n.split(" ").includes("select"),u=n===""||n.split(" ").includes("close"),h=n===""||n.split(" ").includes("esc");n==="none"&&(l=o=u=h=!1),l?i.addEventListener("action",p=>{r("")}):o&&e.onChange(()=>{queueMicrotask(()=>r(""))}),u&&s.onChange(()=>{s.getState()||r("")}),h&&A(t,"keydown",p=>{p.key==="Escape"&&r("")})}function ds(i,t,e,s){let a=!s,r=!s;if(i.hasAttribute("close")){let n=i.getAttribute("close");a=n===""||n.split(" ").includes("action"),r=n.split(" ").includes("select"),n==="none"&&(a=r=!1)}a?i.addEventListener("action",n=>{e.setState(!1)}):r&&t.onChange(()=>{e.setState(!1)})}function fs(i,t){t.onChange(()=>{let e=t.getActive();e?d(i,"aria-activedescendant",e.id):S(i,"aria-activedescendant")})}function qa(i,t,e,s,a,r){if(!i){d(s,"autocomplete","off"),d(s,"aria-autocomplete","none");return}let n=l=>{s.value=l,s.dispatchEvent(new Event("input",{bubbles:!1}))};d(s,"autocomplete","off"),d(s,"aria-autocomplete","list"),a.setState(s.value),queueMicrotask(()=>{a.onInitAndChange(()=>{s.value=a.selectedTextValue()})}),e.addEventListener("action",l=>{n(a.selectedTextValue())}),t&&r.onChange(()=>{r.getState()||n(a.selectedTextValue())})}function ps(i,t){let{lock:e,unlock:s}=ct(t.el);
138t.onChange(()=>{t.getState()?e():s()})}var Se=class i extends D{boot(){if(this._focusable=new bt(this,{wrap:!1,ensureTabbable:!1}),A(this,"keydown",t=>{["ArrowDown"].includes(t.key)?(t.target===this?this._focusable.focusFirst():this._focusable.focusNext(),t.preventDefault(),t.stopPropagation()):["ArrowUp"].includes(t.key)&&(t.target===this?this._focusable.focusFirst():this._focusable.focusPrev(),t.preventDefault(),t.stopPropagation())}),We(this,t=>this._focusable.focusBySearch(t)),this.hasAttribute("popover")&&this.addEventListener("lofi-close-popovers",()=>{this.hasAttribute("keep-open")||setTimeout(()=>this.hidePopover(),50)}),this.parentElement.localName==="ui-dropdown"){let t=this.parentElement;A(t.trigger(),"keydown",e=>{e.key==="ArrowDown"&&(this.fromArrowDown=!0,this.showPopover(),e.preventDefault(),e.stopPropagation())})}d(this,"role","menu"),d(this,"tabindex","-1")}mount(){this.initializeMenuItems(),new MutationObserver(e=>{this.initializeMenuItems()}).observe(this,{childList:!0,subtree:!0})}onPopoverShow(){queueMicrotask(()=>{this.fromArrowDown?(this._focusable.focusFirst(),this.fromArrowDown=!1):this.focus()})}onPopoverHide(){this._focusable.wipeTabbables()}initializeMenuItems(){this.walker().each(t=>{t._disableable||xn(t)})}walker(){return W(this,(t,{skip:e,reject:s})=>{if(t instanceof i||t instanceof Ae)return s();if(!["a","button"].includes(t.localName))return e()})}},ms=class extends D{boot(){}},gs=class extends D{boot(){this._disabled=this.hasAttribute("disabled"),this._disableable=new N(this);let t=this;if(this._disabled&&(d(t,"disabled",""),d(t,"aria-disabled","true")),U(t,"menu-checkbox"),d(t,"role","menuitemcheckbox"),this._disabled)return;t._focusable=new q(t,{disableable:this._disableable,hover:!0,tabbableAttr:"data-active"}),t._selectable=new P(t,{toggleable:!0,value:this.hasAttribute("value")?this.getAttribute("value"):t.textContent.trim(),label:this.hasAttribute("label")?this.getAttribute("label"):t.textContent.trim(),dataAttr:"data-checked",ariaAttr:"aria-checked",selectedInitially:this.hasAttribute("checked")}),this._controllable=new I(this),this._controllable.initial(s=>s&&t._selectable.setState(s)),this._controllable.getter(()=>t._selectable.getState());let e=L();this._controllable.setter(e(s=>{this._selectable.setState(s)})),this._selectable.onChange(e(()=>{this._controllable.dispatch()})),A(t,"click",()=>{this.hasAttribute("keep-open")||this.dispatchEvent(new CustomEvent("lofi-close-popovers",{bubbles:!0})),t._selectable.press()}),xs(t)}},vs=class extends D{boot(){this._disabled=this.hasAttribute("disabled"),this._disableable=new N(this);let t=this;this._disabled&&(d(t,"disabled",""),d(t,"aria-disabled","true")),U(t,"menu-radio"),d(t,"role","menuitemradio"),!this._disabled&&(t._focusable=new q(t,{disableable:this._disableable,hover:!0,tabbableAttr:"data-active"}),t._selectable=new P(t,{toggleable:!1,value:this.hasAttribute("value")?this.getAttribute("value"):t.textContent.trim(),label:this.hasAttribute("label")?this.getAttribute("label"):t.textContent.trim(),dataAttr:"data-checked",ariaAttr:"aria-checked",selectedInitially:this.hasAttribute("checked")}),A(t,"click",()=>{this.hasAttribute("keep-open")||this.dispatchEvent(new CustomEvent("lofi-close-popovers",{bubbles:!0})),t._selectable.press()}),xs(t))}},ys=class extends D{boot(){this._selectable=new $(this),this._controllable=new I(this),d(this,"role","group"),this._controllable.initial(e=>e&&this._selectable.setState(e)),this._controllable.getter(()=>this._selectable.getState());let t=L();this._controllable.setter(t(e=>{this._selectable.setState(e)})),this._selectable.onChange(t(()=>{this._controllable.dispatch()})),A(this,"lofi-close-popovers",e=>{this.hasAttribute("keep-open")&&(e.preventDefault(),e.stopPropagation())})}},ws=class extends D{boot(){this._selectable=new $(this,{multiple:!0}),this._controllable=new I(this),d(this,"role","group"),this._controllable.initial(e=>e&&this._selectable.setState(e)),this._controllable.getter(()=>this._selectable.getState());let t=L();this._controllable.setter(t(e=>{this._selectable.setState(e)})),this._selectable.onChange(t(()=>{this._controllable.dispatch()}))}};O(({css:i})=>i`ui-menu[popover]:popover-open { display: block; }`);O(({css:i})=>i`ui-menu[popover].\:popover-open { display: block; }`);O(({css:i})=>i`ui-menu-checkbox, ui-menu-radio { cursor: default; display: contents; }`);C("menu",Se);C("submenu",ms);C("menu-checkbox",gs);C("menu-radio",vs);C("menu-radio-group",ys);C("menu-checkbox-group",ws);function xs(i){A(i,"keydown",t=>{t.key==="Enter"&&(i.click(),t.preventDefault(),t.stopPropagation())}),A(i,"keydown",t=>{t.key===" "&&(t.preventDefault(),t.stopPropagation())}),A(i,"keyup",t=>{t.key===" "&&(i.click(),t.preventDefault(),t.stopPropagation())})}function xn(i){i._disableable=new N(i),i._disabled=i.hasAttribute("disabled");let t=i.querySelector("a"),e=i,s=i.parentElement.matches("ui-submenu")&&i.parentElement.querySelector("ui-menu[popover]"),a=t||e;if(i._disabled&&(d(a,"disabled",""),d(a,"aria-disabled","true")),U(a,"menu-item"),d(a,"role","menuitem"),!i._disabled)if(a._focusable=new q(a,{disableable:i._disableable,hover:!0,tabbableAttr:"data-active"}),!s)i.hasAttribute("disabled")||A(i,"click",()=>{i.hasAttribute("keep-open")||i.dispatchEvent(new CustomEvent("lofi-close-popovers",{bubbles:!0}))}),xs(e);else{s._popoverable=new it(s,{triggers:[e]}),s._anchorable=new z(s,{reference:e,position:s.hasAttribute("position")?s.getAttribute("position"):ae()?"left start":"right start",ga
138p:s.hasAttribute("gap")?s.getAttribute("gap"):"-5",crossAxis:!0}),e.addEventListener("click",n=>{s._popoverable.setState(!0)});let{clear:r}=Bt(e,s,{gain(){s._popoverable.setState(!0)},lose(){s._popoverable.setState(!1)},focusable:!1,useSafeArea:!0});s._popoverable.onChange(()=>{s._popoverable.getState()||(r(),s._focusable.wipeTabbables()),s._popoverable.getState()?s._anchorable.reposition():s._anchorable.cleanup()}),A(e,"keydown",n=>{n.key==="Enter"&&(s._popoverable.setState(!0),setTimeout(()=>s._focusable.focusFirst()))}),A(e,"keydown",n=>{n.key==="ArrowRight"&&(s._popoverable.setState(!0),setTimeout(()=>s._focusable.focusFirst()))}),A(s,"keydown",n=>{n.key==="ArrowLeft"&&(s._popoverable.setState(!1),e.focus(),n.stopPropagation())})}}var As=class i extends D{mount(){this._focusable=new bt(this,{wrap:!0}),this._disableable=new N(this);let t=[];this._disableable.onInitAndChange(e=>{e?(d(this,"aria-disabled","true"),this.walker().each(s=>{s.hasAttribute("disabled")||(d(s,"disabled","true"),d(s,"aria-disabled","true"),t.push(()=>{se(s,"disabled"),se(s,"aria-disabled")}))})):(se(this,"aria-disabled"),t.forEach(s=>s()),t=[])}),A(this,"keydown",e=>{["ArrowRight"].includes(e.key)?(e.target===this?this._focusable.focusFirst():this._focusable.focusNext(),e.preventDefault(),e.stopPropagation()):["ArrowLeft"].includes(e.key)&&(e.target===this?this._focusable.focusFirst():this._focusable.focusPrev(),e.preventDefault(),e.stopPropagation())}),d(this,"role","toolbar"),this.initializeToolbarItems()}initializeToolbarItems(){this.walker().each(t=>{t._disableable||An(t)})}walker(){return W(this,(t,{skip:e,reject:s})=>{if(t instanceof i||t.hasAttribute("popover")||t instanceof Se||t instanceof ve)return s();if(!["a","button"].includes(t.localName))return e()})}};C("toolbar",As);function An(i){i._disableable=new N(i),i._disabled=i.hasAttribute("disabled");let s=i.querySelector("a")||i;i._disabled&&(d(s,"disabled",""),d(s,"aria-disabled","true")),!i._disabled&&(s._focusable=new q(s,{disableable:i._disableable}))}var Ss=class extends D{boot(){let t=this.hasAttribute("label")?"label":"description",e=this.button(),s=this.overlay();if(e){if(!s)return}else return console.warn("ui-tooltip: no trigger element found",this);this._disabled=this.hasAttribute("disabled"),s._popoverable=new it(s,{scope:"tooltip"}),s._anchorable=new z(s,{reference:e,position:this.hasAttribute("position")?this.getAttribute("position"):void 0,gap:this.hasAttribute("gap")?this.getAttribute("gap"):void 0,offset:this.hasAttribute("offset")?this.getAttribute("offset"):void 0}),s._popoverable.onChange(()=>{s._popoverable.getState()?s._anchorable.reposition():s._anchorable.cleanup()}),this._disabled||Bt(e,s,{gain(){s._popoverable.setState(!0)},lose(){s._popoverable.setState(!1)},focusable:!0,useSafeArea:!1});let a=U(s,"tooltip"),r=this.hasAttribute("interactive"),n=this.hasAttribute("label")||e.textContent.trim()==="";r?(d(e,"aria-controls",a),d(e,"aria-expanded","false"),s._popoverable.onChange(()=>{s._popoverable.getState()?d(e,"aria-expanded","true"):d(e,"aria-expanded","false")})):(n?d(e,"aria-labelledby",a):d(e,"aria-describedby",a),d(s,"aria-hidden","true")),d(s,"role","tooltip")}button(){return this.firstElementChild}overlay(){return this.lastElementChild!==this.button()&&this.lastElementChild.tagName!=="TEMPLATE"&&this.lastElementChild}};C("tooltip",Ss);var _s=class extends V{boot(){let t=this;this._disableable=new N(this),this._selectable=new P(t,{toggleable:!0,dataAttr:"data-checked",ariaAttr:"aria-checked",value:this.hasAttribute("value")?this.getAttribute("value"):null,label:this.hasAttribute("label")?this.getAttribute("label"):null,selectedInitially:this.hasAttribute("checked")}),this._submittable=new J(this,{name:this.getAttribute("name"),value:this.getAttribute("value")??"on",includeWhenEmpty:!1,shouldUpdateValue:!1}),this.value=this._selectable.getValue(),this._detangled=L(),this._selectable.onChange(this._detangled(()=>{this.dispatchEvent(new Event("input",{bubbles:!1,cancelable:!0})),this.dispatchEvent(new Event("change",{bubbles:!1,cancelable:!0}))})),d(t,"role","switch"),this._selectable.onInitAndChange(()=>{this._submittable.update(this._selectable.getState())}),this._disableable.onInitAndChange(e=>{e?S(t,"tabindex","0"):d(t,"tabindex","0")}),A(t,"click",this._disableable.disabled(e=>{e.preventDefault(),e.stopPropagation()}),{capture:!0}),A(t,"click",this._disableable.enabled(e=>{this._selectable.press()})),A(t,"keydown",this._disableable.enabled(e=>{e.key==="Enter"&&(this._selectable.press(),e.preventDefault(),e.stopPropagation())})),A(t,"keydown",this._disableable.enabled(e=>{e.key===" "&&(e.preventDefault(),e.stopPropagation())})),A(t,"keyup",this._disableable.enabled(e=>{e.key===" "&&(this._selectable.press(),e.preventDefault(),e.stopPropagation())})),Sn(t)}get checked(){return this._selectable.isSelected()}set checked(t){this._detangled(()=>{t?this._selectable.select():this._selectable.deselect()})()}};function Sn(i){i.closest("label")?.addEventListener("click",t=>{i.contains(t.target)||i.click()})}O(({css:i})=>i`ui-switch { display: inline-block; user-select: none; }`);C("switch",_s);var ks=class i extends D{mount(){this.control=this.fieldWalker().find(t=>this.isControl(t)),this.control}associateLabelWithControl(t){t&&this.label&&(this.control=t,!this.control.hasAttribute("aria-labelledby")&&(d(this.elOrButton(this.control),"aria-labelledby",this.label.id),this.control&&!(this.control instanceof V)&&this.hasAttribute("disabled")&&this.control.setAttribute("disabled","")))}associateDescriptionWithControl(t){t&&this.description&&(this.control=t,!this.control.hasAttribute("aria-describedby")&&d(this.elOrButton(this.control),"aria-describedby",this.description.id))}associateLabel(t){this.label=t,A(t,"click",e=>{["a","button"].includes(e.target.localName)||this.focusOrTogggle(this.control)}),this.control&&this.associateLabelWithControl(this.control)}associateDescription(t){this.description=t,this.control&&this.associateDescriptionWithControl(this.control)}fieldWalker(){return W(this,(t,{skip:e,reject:s})=>{if(t instanceof i&&t!==this||t.parentElement.localName==="ui-editor"&&t!==this)return s()})}isControl(t){return!!(t instanceof V||t.matches("input, textarea, select"))}focusOrTogggle(t){if(!t||t.disabled||t.hasAttribute("disabled"))return;t.localName==="input"&&["checkbox","radio"].includes(t.type)||["ui-switch","ui-radio","ui-checkbox"].includes(t.localName)?(t.click(),t.focus()):t.localName==="input"&&["file"].includes(t.type)?t.click():["ui-select"].includes(t.localName)?t.trigger().focus():(["ui-editor"].includes(t.localName),t.focu
138s())}elOrButton(t){return t instanceof D&&t.firstElementChild instanceof HTMLButtonElement?t.firstElementChild:t}},Es=class extends D{mount(){U(this,"label"),d(this,"aria-hidden","true"),this.closest("ui-field")?.associateLabel(this)}},Cs=class extends D{mount(){U(this,"description"),d(this,"aria-hidden","true"),this.closest("ui-field")?.associateDescription(this)}};O(({css:i})=>i` 139 ui-label { display: inline-block; cursor: default; } 140 ui-description { display: block; } 141`);C("field",ks);C("label",Es);C("description",Cs);var ni=class{constructor(){this.subscribers=[]}subscribe(t,e){this.subscribers.push({reason:t,callback:e})}notify(t,e){this.subscribers.forEach(({reason:s,callback:a})=>{t===s&&a(e)})}};function Ya(i){let t={time:Tn,linear:kn,categorical:_n},e=Date.now(),s=Date.now(),a={},r=(l,o,u)=>{let h=`${l}-${o}`;for(let p in a)p.startsWith(`${l}-`)&&!p.endsWith(String(o))&&delete a[p];return a[h]||(a[h]=u()),a[h]},n={data:[],width:i.width,height:i.height,inset:i.inset,axes:{x:{axis:"x",key:i.axes.x.key,format:i.axes.x.format,inset:{start:0,end:0},position:i.axes.x.position||"bottom",tickStart:i.axes.x.tickStart,tickEnd:i.axes.x.tickEnd,tickCount:i.axes.x.tickCount,tickStep:i.axes.x.tickStep,tickValues:i.axes.x.tickValues,tickSuffix:i.axes.x.tickSuffix,tickPrefix:i.axes.x.tickPrefix,get rawValues(){return r("x.rawValues",e,()=>n.data.map(l=>l[this.key]))},get type(){return r("x.type",e,()=>i.axes.x.scale||(this.rawValues.every(l=>Cn(l))?"time":"categorical"))},get interval(){return r("x.interval",e,()=>i.axes.x.interval||"auto")},get values(){return r("x.values",e,()=>this.rawValues.map(l=>this.type==="time"?li(l):this.type==="linear"?Number(l):l))},get ticks(){return r("x.ticks",e,()=>{let l=Wa(n.data,this,oi(this.type,this.values)),o=Va(l,this.type,this.format,this.tickSuffix,this.tickPrefix,this.interval);return l.map((u,h)=>({value:u,label:o[h]}))})},get domain(){return r("x.domain",e,()=>oi(this.type,[...this.ticks.map(l=>l.value),...this.values]))},get range(){return r("x.range",s,()=>[n.inset.left+this.inset.start,n.width-n.inset.right-this.inset.end])},get scale(){return r("x.scale",s+e,()=>t[this.type](this.domain,this.range,this.values))}},y:{axis:"y",keys:i.axes.y.keys,format:i.axes.y.format,inset:{start:0,end:0},position:i.axes.y.position||"left",tickStart:i.axes.y.tickStart,tickEnd:i.axes.y.tickEnd,tickCount:i.axes.y.tickCount,tickStep:i.axes.y.tickStep,tickValues:i.axes.y.tickValues,tickSuffix:i.axes.y.tickSuffix,tickPrefix:i.axes.y.tickPrefix,get values(){return r("y.values",e,()=>n.data.flatMap(l=>this.keys.reduce((o,u)=>(l[u]===void 0||o.push(l[u]),o),[])))},get type(){return r("y.type",e,()=>i.axes.y.scale||"linear")},get interval(){return r("y.interval",e,()=>i.axes.y.interval||"auto")},get ticks(){return r("y.ticks",e,()=>{let l=Wa(n.data,this,oi(this.type,this.values)),o=Va(l,this.type,this.format,this.tickSuffix,this.tickPrefix,this.interval);return l.map((u,h)=>({value:u,label:o[h]}))})},get domain(){return r("y.domain",e,()=>oi(this.type,[...this.ticks.map(l=>l.value),...this.values]))},get range(){return r("y.range",s,()=>[n.height-n.inset.bottom-this.inset.end,n.inset.top+this.inset.start])},get scale(){return r("y.scale",s+e,()=>t[this.type](this.domain,this.range,this.values))}}},get series(){return r("series",e+s,()=>this.axes.y.keys.reduce((l,o)=>{if(!n.data[0].hasOwnProperty(o))return console.warn(`ui-chart: series field "${o}" does not exist`),l;let u=n.data.map(p=>({x:n.axes.x.scale(p[n.axes.x.key]),y:n.axes.y.scale(p[o]),datum:p})),h={field:o,values:n.data.map(p=>p[o]),linePath(p="smooth"){let g=this.points.map(v=>[v.x,v.y]);return{smooth:Ba,none:Ha}[p](g)},areaPath(p="smooth"){return`${{smooth:Ba,none:Ha}[p](this.points.map(b=>[b.x,b.y]))} L${n.axes.x.scale(n.axes.x.domain[1])},${n.axes.y.scale(n.axes.y.domain[0])} L${n.axes.x.scale(n.axes.x.domain[0])},${n.axes.y.scale(n.axes.y.domain[0])} Z`},points:u};return l[o]=h,l},{}))},closestXPoint(l){return this.closestXPoints(l)[0]},closestXPoints(l){return r("closestXPoints",e+s+l,()=>{let o=[],u=1/0;
141return Object.values(this.series).forEach(h=>{let p=null;h.points.forEach(g=>{let v=Math.abs(g.x-l);v<u&&(u=v,p=g)}),p&&o.push(p)}),o})},updateDimensions(l,o){this.width=l.width,this.height=l.height,this.inset=o,s=Date.now()},updateData(l){let o=JSON.parse(JSON.stringify(l));o[0]!==void 0&&typeof o[0]!="object"&&(o=o.map((u,h)=>({value:u}))),o.every(u=>u.index)||o.forEach((u,h)=>{u.index=h}),this.data=o,e=Date.now()}};return n.updateData(i.data),n}function oi(i,t){let e=[...new Set(t)];return i==="time"?Dn(e):i==="linear"?(e.sort((s,a)=>Number(s)-Number(a)),e.length===1?e[0]===0?[Number(e[0]),1]:e[0]>0?[0,Number(e[0])]:[Number(e[0]),0]:[Number(e[0]),Number(e[e.length-1])]):[e[0],e[e.length-1]]}function Wa(i,t,e){let s=[];if(t.type==="linear"){if(t.tickValues)return t.tickValues;let[a,r]=e,n=t.tickCount?Number(t.tickCount):5,l=t.tickStart===0||t.tickStart==="0"?0:t.tickStart||"auto",o=t.tickEnd===0||t.tickEnd==="0"?0:t.tickEnd||"auto";l==="auto"&&a>0&&r>0&&(a=0),o!=="auto"&&o!=="max"&&!isNaN(Number(o))&&(r=Number(o));let u=Number(t.interval),h;if(t.interval==="auto"||Number.isNaN(u)){let b=(r-a)/(n-1),c=Math.pow(10,Math.floor(Math.log10(b))),_=b/c;_<1.5?h=1:_<3?h=2:_<7?h=5:h=10,h*=c}else h=u;let p;l==="auto"?p=Math.floor(a/h)*h:l==="min"?p=a:p=Number(l);let g=p;for(;g<=r+h*.1;)g>=a-h*.1&&s.push(g),g+=h;if(o==="max")Math.abs(s[s.length-1]-e[1])>h*.1&&s.push(e[1]);else if(o!=="auto"&&!isNaN(Number(o))){let v=Number(o),b=s.length;s=Array.from({length:b},(c,_)=>p+(v-p)*(_/(b-1)))}if(s.length>n*2){let v=Math.ceil(s.length/n);s=s.filter((b,c)=>c%v===0)}}else if(t.type==="time"){let[a,r]=$a(e[0],e[1],t.tickCount,t.interval);return r}else if(t.type==="categorical"&&(i.forEach(a=>{let r=a[t.key];s.push(r)}),t.tickCount&&s.length>t.tickCount)){let a=Math.ceil(s.length/t.tickCount);s=s.filter((r,n)=>n%a===0)}return s}function Va(i,t,e,s,a,r){let n=[];return t==="time"?(e||([e]=$a(i[0],i[i.length-1],null,r)),e={...e,timeZone:"UTC"},n=i.map(l=>new Date(l).toLocaleString(ht(),e))):t==="linear"?e?n=i.map(l=>l.toLocaleString(ht(),e)):n=i.map(l=>l.toLocaleString(ht())):n=i.map(l=>l+""),a&&(n=n.map(l=>a+l)),s&&(n=n.map(l=>l+s)),n}function _n(i,t,e){let s=[...new Set(e)],a=(t[1]-t[0])/(s.length-1),r=new Map(s.map((n,l)=>[n,t[0]+l*a]));return function(n){if(n!=null)return r.get(n)}}function kn(i,t){let e=i[1]-i[0],s=t[1]-t[0];return function(a){return t[0]+(a-i[0])*(s/e)}}function Ba(i){if(i.length<2)return"";let t=o=>o<0?-1:1,e=(o,u,h,p,g,v)=>{let b=h-o,c=g-h,_=(p-u)/(b||c<0&&-0),y=(v-p)/(c||b<0&&-0),f=(_*c+y*b)/(b+c);return(t(_)+t(y))*Math.min(Math.abs(_),Math.abs(y),.5*Math.abs(f))||0},s=(o,u,h,p,g)=>{let v=h-o;return v?(3*(p-u)/v-g)/2:g},a=`M${i[0][0]},${i[0][1]}`;if(i.length===2)return a+`L${i[1][0]},${i[1][1]}`;for(let o=0;o<i.length-2;o++){let u=i[o],h=i[o+1];if(u[0]===h[0]&&u[1]===h[1])continue;let p=i[o+2],g=e(u[0],u[1],h[0],h[1],p[0],p[1]),v=(h[0]-u[0])/3,b=u[0]+v,c=u[1]+v*(o===0?s(u[0],u[1],h[0],h[1],g):i[o-1]?e(i[o-1][0],i[o-1][1],u[0],u[1],h[0],h[1]):g),_=h[0]-v,y=h[1]-v*g;a+=`C${b},${c} ${_},${y} ${h[0]},${h[1]}`}let r=i.length,n=i[r-1],l=i[r-2];if(!(n[0]===l[0]&&n[1]===l[1])){let o=e(i[r-3][0],i[r-3][1],l[0],l[1],n[0],n[1]),u=(n[0]-l[0])/3,h=l[0]+u,p=l[1]+u*o,g=n[0]-u,v=n[1]-u*s(l[0],l[1],n[0],n[1],o);a+=`C${h},${p} ${g},${v} ${n[0]},${n[1]}`}return a}function En(i,t=.05){if(!i||i.length<2)return"";let e=`M ${i[0][0]} ${i[0][1]}`;for(let s=1;s<i.length;s++){let a=i[s],r=i[s-1],n=i[s-2]||r,l=i[s+1]||a,o=r[0]+(l[0]-n[0])*t,u=r[1]+(l[1]-n[1])*t,h=a[0]-(l[0]-n[0])*t,p=a[1]-(l[1]-n[1])*t;e+=` C ${o} ${u}, ${h} ${p}, ${a[0]} ${a[1]}`}return e}function Ha(i){return En(i,0)}function Cn(i){return i instanceof Date||typeof i=="string"&&i.includes("-")&&!isNaN(Date.parse(i))}function Dn(i){return i.sort((t,e)=>typeof t=="string"?t.localeCompare(e):t-e),[li(i[0]),li(i[i.length-1])]}function Tn(i,t){let e=new Date(i[0]).getTime(),a=new Date(i[1]).getTime()-e,r=t[1]-t[0];return function(n){if(!n)return;let l=li(n);if(isNaN(l.getTime()))return;let o=(l.getTime()-e)/a;return t[0]+o*r}}function $a(i,t,e,s){let a=i,r=t,o=(r-a)/1e3/60,u=o/60,h=u/24,p=h/30,g=h/365,v,b,c;switch(s){case"second":v={hour:"numeric",minute:"numeric",second:"numeric"},b=f=>new Date(Date.UTC(f.getUTCFullYear(),f.getUTCMonth(),f.getUTCDate(),f.getUTCHours(),f.getUTCMinutes(),f.getUTCSeconds()+1)),c=new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate(),a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds()));break;case"minute":v={hour:"numeric",minute:"numeric"},b=f=>new Date(Date.UTC(f.getUTCFullYear(),f.getUTCMonth(),f.getUTCDate(),f.getUTCHours(),f.getUTCMinutes()+1)),c=new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate(),a.getUTCHours(),a.getUTCMinutes()));break;case"hour":v={hour:"numeric",minute:"numeric"},b=f=>new Date(Date.UTC(f.getUTCFullYear(),f.getUTCMonth(),f.getUTCDate(),f.getUTCHours()+1)),c=new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate(),a.getUTCHours()));break;case"day":v={day:"numeric"},b=f=>new Date(Date.UTC(f.getUTCFullYear(),f.getUTCMonth(),f.getUTCDate()+1)),c=new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()));break;case"week":v={day:"numeric",month:"short"},b=f=>new Date(Date.UTC(f.getUTCFullYear(),f.getUTCMonth(),f.getUTCDate()+7)),c=new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()));break;case"month":v={month:"short",day:"numeric"},b=f=>
141new Date(Date.UTC(f.getUTCFullYear(),f.getUTCMonth()+1,1)),c=new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),1));break;case"year":v={year:"numeric"},b=f=>new Date(Date.UTC(f.getUTCFullYear()+1,0,1)),c=new Date(Date.UTC(a.getUTCFullYear(),0,1));break;default:}if(!b)if(u<1){v={hour:"numeric",minute:"numeric"};let f=e?Math.max(1,Math.floor(o/(e-1))):1;b=w=>new Date(Date.UTC(w.getUTCFullYear(),w.getUTCMonth(),w.getUTCDate(),w.getUTCHours(),w.getUTCMinutes()+f)),c=new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate(),a.getUTCHours()))}else if(h<1){v={hour:"numeric"};let f=e?Math.max(1,Math.floor(u/(e-1))):1;b=w=>new Date(Date.UTC(w.getUTCFullYear(),w.getUTCMonth(),w.getUTCDate(),w.getUTCHours()+f)),c=new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate(),0))}else if(h<=7){v={weekday:"short",hour:"numeric"};let f=e?Math.max(1,Math.floor(u/(e-1))):6;b=w=>new Date(Date.UTC(w.getUTCFullYear(),w.getUTCMonth(),w.getUTCDate(),w.getUTCHours()+f)),c=new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate(),0))}else if(h<=30){v={month:"short",day:"numeric"};let f=e?Math.max(1,Math.floor(h/(e-1))):1;b=w=>new Date(Date.UTC(w.getUTCFullYear(),w.getUTCMonth(),w.getUTCDate()+f)),c=new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()))}else if(p<=6){v={month:"short",day:"numeric"};let f=e?Math.max(1,Math.floor(h/(e-1))):7;b=w=>new Date(Date.UTC(w.getUTCFullYear(),w.getUTCMonth(),w.getUTCDate()+f)),c=new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()))}else if(g<2){v={month:"short"};let f=e?Math.max(1,Math.floor(p/(e-1))):1;b=w=>new Date(Date.UTC(w.getUTCFullYear(),w.getUTCMonth()+f,1)),c=new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth()))}else{v={year:"numeric"};let f=e?Math.max(1,Math.floor(g/(e-1))):1;b=w=>new Date(Date.UTC(w.getUTCFullYear()+f,0,1)),c=new Date(Date.UTC(a.getUTCFullYear(),0,1))}let _=[a],y=a;for(;y<=r;)y=b(y),y<=r&&_.push(new Date(y.getTime()));return[v,_]}function li(i){if(i instanceof Date)return i;let{year:t,month:e,day:s,hour:a,minute:r,second:n,millisecond:l}=Mn(i);return new Date(Date.UTC(t,e-1,s,a,r,n,l))}function Mn(i){let t=i.match(/^(\d{4})(?:-(\d{2}))?(?:-(\d{2}))?(?:T(\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(Z)?)?$/);if(!t)throw new Error("Invalid date format");return{year:t[1]?parseInt(t[1],10):null,month:t[2]?parseInt(t[2],10):null,day:t[3]?parseInt(t[3],10):null,hour:t[4]?parseInt(t[4],10):null,minute:t[5]?parseInt(t[5],10):null,second:t[6]?parseInt(t[6],10):null,millisecond:t[7]?parseInt(t[7].padEnd(3,"0"),10):null,utc:!!t[8]}}var Ds=class extends HTMLElement{constructor(){super(),this.querySelectorAll("[data-appended]").forEach(s=>s.remove());let t=this.querySelector('template[name="svg"]'),e=Ve(t);t.after(e),this.init(t,e)}init(t,e){this._data=this.hasAttribute("value")?JSON.parse(this.getAttribute("value")):[],this._observable=new ni,this._selectable={getState:()=>this._data,setState:y=>{this._data=y,this._observable.notify("data",this._data)}},this._controllable=new I(this),this._controllable.initial(y=>y&&this._selectable.setState(y)),this._controllable.getter(()=>this._selectable.getState()),this._controllable.setter(y=>{this._selectable.setState(y)});let s={svg:t,lines:{},areas:{},points:{},cursor:t.content.querySelector('template[name="cursor"]'),zeroLine:t.content.querySelector('template[name="zero-line"]'),axes:{x:{template:t.content.querySelector('template[name="axis"][axis="x"]'),axisLine:t.content.querySelector('template[name="axis"][axis="x"] template[name="axis-line"]'),gridLine:t.content.querySelector('template[name="axis"][axis="x"] template[name="grid-line"]'),tickMark:t.content.querySelector('template[name="axis"][axis="x"] template[name="tick-mark"]'),tickLabel:t.content.querySelector('template[name="axis"][axis="x"] template[name="tick-label"]')},y:{template:t.content.querySelector('template[name="axis"][axis="y"]'),axisLine:t.content.querySelector('template[name="axis"][axis="y"] template[name="axis-line"]'),gridLine:t.content.querySelector('template[name="axis"][axis="y"] template[name="grid-line"]'),tickMark:t.content.querySelector('template[name="axis"][axis="y"] template[name="tick-mark"]'),tickLabel:t.content.querySelector('template[name="axis"][axis="y"] template[name="tick-label"]')}},tooltip:this.querySelector('template[name="tooltip"]'),summary:this.querySelector('template[name="summary"]')};t.content.querySelectorAll('template[name="line"]').forEach(y=>{s.lines[y.getAttribute("field")]=y}),t.content.querySelectorAll('template[name="area"]').forEach(y=>{s.areas[y.getAttribute("field")]=y}),t.content.querySelectorAll('template[name="point"]').forEach(y=>{s.points[y.getAttribute("field")]=y});let a=()=>{},r=()=>{},n=()=>{},l=()=>{},o=null,u=null,h=null,p=null;u=document.createElementNS("http://www.w3.org/2000/svg","rect"),u.setAttribute("data-overlay",""),u.setAttribute("fill","none"),u.setAttribute("pointer-events","all"),u.addEventListener("mousemove",Ai(function(y){a(y),r(y),n(y),l(y)}
141,1)),u.addEventListener("mouseleave",()=>{a(null),r(null),n(null),l(null)}),e.appendChild(u),s.cursor&&(o=at(s.cursor),o.setAttribute("data-cursor",""),e.appendChild(o)),s.tooltip&&(h=Ve(s.tooltip),s.tooltip.after(h)),s.summary&&(p=Ve(s.summary),s.summary.after(p));let g={left:8,right:8,top:8,bottom:8};if(s.svg?.hasAttribute("gutter")){let y=s.svg?.getAttribute("gutter").split(" ").map(f=>f.replace("px","")).map(Number);y.length===1?(g.top=y[0],g.right=y[0],g.bottom=y[0],g.left=y[0]):y.length===2?(g.top=y[0],g.right=y[1],g.bottom=y[0],g.left=y[1]):y.length===3?(g.top=y[0],g.right=y[1],g.bottom=y[2],g.left=y[1]):y.length===4&&(g.top=y[0],g.right=y[1],g.bottom=y[2],g.left=y[3])}let[v,b]=On(e),c=Ya({data:this._data,width:e.parentElement.getBoundingClientRect().width,height:e.parentElement.getBoundingClientRect().height,inset:{left:0,right:0,top:0,bottom:0},axes:{x:{key:v,format:s.axes.x.template?.hasAttribute("format")?JSON.parse(s.axes.x.template?.getAttribute("format")):null,scale:s.axes.x.template?.getAttribute("scale"),interval:s.axes.x.template?.getAttribute("interval"),position:s.axes.x.template?.getAttribute("position"),tickCount:s.axes.x.template?.getAttribute("tick-count")||s.axes.x.tickLabel?.getAttribute("target-tick-count"),tickStart:s.axes.x.template?.getAttribute("tick-start"),tickEnd:s.axes.x.template?.getAttribute("tick-end"),tickStep:s.axes.x.template?.getAttribute("tick-step")?Number(s.axes.x.template?.getAttribute("tick-step")):null,tickSuffix:s.axes.x.template?.getAttribute("tick-suffix"),tickPrefix:s.axes.x.template?.getAttribute("tick-prefix"),tickValues:s.axes.x.template?.hasAttribute("tick-values")?JSON.parse(s.axes.x.template?.getAttribute("tick-values")):null},y:{keys:b,format:s.axes.y.template?.hasAttribute("format")?JSON.parse(s.axes.y.template?.getAttribute("format")):null,scale:s.axes.y.template?.getAttribute("scale"),interval:s.axes.y.template?.getAttribute("interval"),position:s.axes.y.template?.getAttribute("position"),tickCount:s.axes.y.template?.getAttribute("tick-count")||s.axes.y.tickLabel?.getAttribute("target-tick-count"),tickStart:s.axes.y.template?.getAttribute("tick-start"),tickEnd:s.axes.y.template?.getAttribute("tick-end"),tickStep:s.axes.y.template?.getAttribute("tick-step")?Number(s.axes.y.template?.getAttribute("tick-step")):null,tickSuffix:s.axes.y.template?.getAttribute("tick-suffix"),tickPrefix:s.axes.y.template?.getAttribute("tick-prefix"),tickValues:s.axes.y.template?.hasAttribute("tick-values")?JSON.parse(s.axes.y.template?.getAttribute("tick-values")):null}}}),_=(y=!0)=>{if(d(e,"viewBox",`0 0 ${c.width} ${c.height}`),c.data.length!==0){if(c.data.length===1){console.warn("ui-chart: chart only has one data point so it cannot be rendered.");return}if(c.data[0][c.axes.x.key]===void 0){console.warn(`ui-chart: axis field "${c.axes.x.key}" does not exist`);return}if(Object.entries(c.series).forEach(([f,w])=>{let x=e.querySelector(`[data-line][data-series="${f}"]`),k=s.lines[f];if(k){let E=k.getAttribute("curve")||"smooth";if(x)x.setAttribute("d",w.linePath(E));else{let T=at(k);T.setAttribute("data-line",""),T.setAttribute("data-series",f),T.setAttribute("d",w.linePath(E)),e.appendChild(T)}}}),Object.entries(c.series).forEach(([f,w])=>{let x=e.querySelector(`[data-area][data-series="${f}"]`),k=s.areas[f];if(k){let E=k.getAttribute("curve")||"smooth";if(x)x.setAttribute("d",w.areaPath(E));else{let T=at(k);T.setAttribute("data-area",""),T.setAttribute("data-series",f),T.setAttribute("d",w.areaPath(E)),e.appendChild(T)}}}),Object.entries(c.series).forEach(([f,w])=>
141{let x=e.querySelector(`[data-point-group][data-series="${f}"]`),k=s.points[f];k&&(e.querySelector(`[data-point-group][data-series="${f}"]`)?.remove(),x=document.createElementNS("http://www.w3.org/2000/svg","g"),x.setAttribute("data-point-group",""),x.setAttribute("data-series",f),w.points.forEach(E=>{let T=at(k);T.setAttribute("data-point",""),T.setAttribute("data-series",f),T.setAttribute("cx",E.x),T.setAttribute("cy",E.y),x.appendChild(T)}),e.appendChild(x))}),l=f=>{e.querySelectorAll("[data-point-group]").forEach(w=>{if(w.querySelectorAll("[data-point]").forEach(x=>x.removeAttribute("data-active")),f){let x=f.clientX-e.getBoundingClientRect().left,k=f.clientY-e.getBoundingClientRect().top;x>=c.inset.left&&x<=c.width-c.inset.right&&k>=c.inset.top&&k<=c.height-c.inset.bottom&&c.closestXPoints(x).forEach(T=>{w.querySelectorAll(`[data-point][cx="${T.x}"]`).forEach(R=>R.setAttribute("data-active",""))})}else w.querySelectorAll("[data-point]").forEach(x=>x.removeAttribute("data-active"))})},s.axes.x.template){if(s.axes.x.axisLine){e.querySelector('[data-axis-line][data-axis="x"]')?.remove();let f=at(s.axes.x.axisLine);f.setAttribute("data-axis-line",""),f.setAttribute("data-axis","x"),f.setAttribute("x1",c.axes.x.scale(c.axes.x.domain[0])),f.setAttribute("x2",c.axes.x.scale(c.axes.x.domain[1])),f.setAttribute("y1",c.axes.y.scale(c.axes.y.domain[c.axes.x.position==="bottom"?0:1])),f.setAttribute("y2",c.axes.y.scale(c.axes.y.domain[c.axes.x.position==="bottom"?0:1])),e.appendChild(f)}if(s.axes.x.gridLine){e.querySelector('[data-grid-line-group][data-axis="x"]')?.remove();let f=document.createElementNS("http://www.w3.org/2000/svg","g");f.setAttribute("data-grid-line-group",""),f.setAttribute("data-axis","x"),c.axes.x.ticks.forEach(({value:w})=>{let x=at(s.axes.x.gridLine);x.setAttribute("data-grid-line",""),x.setAttribute("data-axis","x"),x.setAttribute("x1",c.axes.x.scale(w)),x.setAttribute("x2",c.axes.x.scale(w)),x.setAttribute("y1",c.inset.top),x.setAttribute("y2",c.height-c.inset.bottom),f.appendChild(x)}),e.appendChild(f)}if(s.axes.x.tickMark){e.querySelector('[data-tick-mark-group][data-axis="x"]')?.remove();let f=document.createElementNS("http://www.w3.org/2000/svg","g");f.setAttribute("data-tick-mark-group",""),f.setAttribute("data-axis","x"),c.axes.x.ticks.forEach(({value:w,label:
141x})=>{let k={x:c.axes.x.scale(w),y:c.axes.y.scale(c.axes.y.domain[c.axes.x.position==="bottom"?0:1])},E=at(s.axes.x.tickMark);E.setAttribute("data-tick-mark",""),E.setAttribute("data-axis","x"),E.setAttribute("transform",`translate(${k.x}, ${k.y})`),f.appendChild(E)}),e.appendChild(f)}if(s.axes.x.tickLabel){e.querySelector('[data-tick-label-group][data-axis="x"]')?.remove();let f=document.createElementNS("http://www.w3.org/2000/svg","g");f.setAttribute("data-tick-label-group",""),f.setAttribute("data-axis","x"),c.axes.x.ticks.forEach(({value:w,label:x})=>{let k={x:c.axes.x.scale(w),y:c.axes.y.scale(c.axes.y.domain[c.axes.x.position==="bottom"?0:1])},E=at(s.axes.x.tickLabel);E.querySelectorAll("slot").forEach(T=>T.replaceWith(document.createTextNode(x))),E.setAttribute("data-tick-label",""),E.setAttribute("data-axis","x"),E.setAttribute("transform",`translate(${k.x}, ${k.y})`),f.appendChild(E)}),e.appendChild(f),za(f,c.axes.x)}}if(s.axes.y.template){if(s.axes.y.axisLine){e.querySelector('[data-axis-line][data-axis="y"]')?.remove();let f=at(s.axes.y.axisLine);f.setAttribute("data-axis-line",""),f.setAttribute("data-axis","y"),f.setAttribute("x1",c.axes.x.scale(c.axes.x.domain[c.axes.y.position==="left"?0:1])),f.setAttribute("x2",c.axes.x.scale(c.axes.x.domain[c.axes.y.position==="left"?0:1])),f.setAttribute("y1",c.axes.y.scale(c.axes.y.domain[0])),f.setAttribute("y2",c.axes.y.scale(c.axes.y.domain[1])),e.appendChild(f)}if(s.axes.y.gridLine){e.querySelector('[data-grid-line-group][data-axis="y"]')?.remove();let f=document.createElementNS("http://www.w3.org/2000/svg","g");f.setAttribute("data-grid-line-group",""),f.setAttribute("data-axis","y"),c.axes.y.ticks.forEach(({value:w,label:
141x})=>{let k={x:c.axes.x.scale(c.axes.x.domain[0]),y:c.axes.y.scale(w)},E=at(s.axes.y.gridLine);E.setAttribute("data-grid-line",""),E.setAttribute("data-axis","y"),E.setAttribute("x1",c.inset.left),E.setAttribute("x2",c.width-c.inset.right),E.setAttribute("y1",k.y),E.setAttribute("y2",k.y),f.appendChild(E)}),e.appendChild(f)}if(s.axes.y.tickMark){e.querySelector('[data-tick-mark-group][data-axis="y"]')?.remove();let f=document.createElementNS("http://www.w3.org/2000/svg","g");f.setAttribute("data-tick-mark-group",""),f.setAttribute("data-axis","y"),c.axes.y.ticks.forEach(({value:w,label:x})=>{let k={x:c.axes.x.scale(c.axes.x.domain[c.axes.y.position==="left"?0:1]),y:c.axes.y.scale(w)},E=at(s.axes.y.tickMark);E.setAttribute("data-tick-mark",""),E.setAttribute("data-axis","y"),E.setAttribute("transform",`translate(${k.x}, ${k.y})`),f.appendChild(E)}),e.appendChild(f)}if(s.axes.y.tickLabel){e.querySelector('[data-tick-label-group][data-axis="y"]')?.remove();let f=document.createElementNS("http://www.w3.org/2000/svg","g");f.setAttribute("data-tick-label-group",""),f.setAttribute("data-axis","y"),c.axes.y.ticks.forEach(({value:w,label:
141x})=>{let k={x:c.axes.x.scale(c.axes.x.domain[c.axes.y.position==="left"?0:1]),y:c.axes.y.scale(w)},E=at(s.axes.y.tickLabel);E.querySelectorAll("slot").forEach(T=>T.replaceWith(document.createTextNode(x))),E.setAttribute("data-tick-label",""),E.setAttribute("data-axis","y"),E.setAttribute("transform",`translate(${k.x}, ${k.y})`),f.appendChild(E)}),e.appendChild(f),za(f,c.axes.y)}if(s.zeroLine&&c.axes.y.domain[0]<0&&c.axes.y.domain[1]>0){e.querySelector('[data-zero-line][data-axis="y"]')?.remove();let f=at(s.zeroLine);f.setAttribute("data-zero-line",""),f.setAttribute("data-axis","y"),f.setAttribute("x1",c.axes.x.scale(c.axes.x.domain[0])),f.setAttribute("x2",c.axes.x.scale(c.axes.x.domain[1])),f.setAttribute("y1",c.axes.y.scale(0)),f.setAttribute("y2",c.axes.y.scale(0)),e.appendChild(f)}}if(u&&(u.setAttribute("width",c.width),u.setAttribute("height",c.height),u.setAttribute("x",0),u.setAttribute("y",0)),o&&(a=f=>{if(f){let w=f.clientX-e.getBoundingClientRect().left,x=f.clientY-e.getBoundingClientRect().top;if(w>=c.inset.left&&w<=c.width-c.inset.right&&x>=c.inset.top&&x<=c.height-c.inset.bottom){let k=c.closestXPoint(w);o.setAttribute("opacity","1"),o.setAttribute("x1",k.x),o.setAttribute("x2",k.x),o.setAttribute("y1",c.axes.y.scale(c.axes.y.domain[0])),o.setAttribute("y2",c.axes.y.scale(c.axes.y.domain[1]))}else o.setAttribute("opacity","0")}else o.setAttribute("opacity","0")}),h&&(r=f=>{if(f===null)S(h,"data-active");else{let w=f.clientX-e.getBoundingClientRect().left,x=f.clientY-e.getBoundingClientRect().top;if(w>=c.inset.left&&w<=c.width-c.inset.right&&x>=c.inset.top&&x<=c.height-c.inset.bottom){let k=c.closestXPoint(w);if(k){d(h,"data-active","");let E=h.getBoundingClientRect(),T=e.getBoundingClientRect(),R=T.width-(k.x+E.width+15),rt=T.height-(x+E.height+15),j=R<0?k.x-E.width-15:k.x+15,nt=rt<0?x-E.height-15:x+15;h.style.transform=`translate(${j}px, ${nt}px)`;let tt=s.tooltip.content.cloneNode(!0).firstElementChild;tt.querySelectorAll("slot").forEach(G=>{let X=G.getAttribute("field");if(X){let ut=G.hasAttribute("format")?JSON.parse(G.getAttribute("format")):null,H=k.datum[X];if(ut===null)return G.textContent=H;ut={...ut,timeZone:"UTC"}
141,Ga(H)?H=Number(H).toLocaleString(ht(),ut):Xa(H)&&(H=new Date(H).toLocaleDateString(ht(),ut)),G.textContent=H}}),h.innerHTML=tt.innerHTML}else S(h,"data-active")}else S(h,"data-active")}}),p&&(n=f=>{let w=null;if(f!==null){let x=f.clientX-e.getBoundingClientRect().left,k=f.clientY-e.getBoundingClientRect().top;x>=c.inset.left&&x<=c.width-c.inset.right&&k>=c.inset.top&&k<=c.height-c.inset.bottom&&(w=c.closestXPoint(x))}if(w=w||c.closestXPoint(c.axes.x.range[1]),w){let x=s.summary.content.cloneNode(!0).firstElementChild;x.querySelectorAll("slot").forEach(k=>{let E=k.getAttribute("field");if(E){let T=k.hasAttribute("format")?JSON.parse(k.getAttribute("format")):{};T={...T,timeZone:"UTC"};let R=k.hasAttribute("fallback")&&f===null?k.getAttribute("fallback"):w.datum[E];Ga(R)?R=Number(R).toLocaleString(ht(),T):Xa(R)&&(R=new Date(R).toLocaleString(ht(),T)),k.textContent=R}}),p.innerHTML=x.innerHTML}},n(null)),e.appendChild(u),e.querySelectorAll("[data-grid-line-group]").forEach(f=>u.before(f)),e.querySelectorAll("[data-axis-line]").forEach(f=>u.before(f)),e.querySelectorAll("[data-zero-line]").forEach(f=>u.before(f)),e.querySelectorAll("[data-area]").forEach(f=>u.before(f)),e.querySelectorAll("[data-line]").forEach(f=>u.before(f)),e.querySelectorAll("[data-cursor]").forEach(f=>u.before(f)),e.querySelectorAll("[data-point-group]").forEach(f=>u.before(f)),y){let f=Nn(e);c.updateDimensions({width:c.width,height:c.height},{left:g.left+f.left,right:g.right+f.right,top:g.top+f.top,bottom:g.bottom+f.bottom}),_(!1)}}};this._observable.subscribe("resize",()=>{c.updateDimensions({width:e.parentElement.getBoundingClientRect().width,height:e.parentElement.getBoundingClientRect().height},{left:0,right:0,top:0,bottom:0}),_()}),this._observable.subscribe("data",()=>{c.updateData(this._data),c.updateDimensions({width:c.width,height:c.height},{left:0,right:0,top:0,bottom:0}),_()}),new ResizeObserver(()=>{this._observable.notify("resize")}).observe(this),new MutationObserver(y=>{y.forEach(f=>{f.attributeName==="value"&&this._selectable.setState(this.hasAttribute("value")?JSON.parse(this.getAttribute("value")):[])})}).observe(this,{attributes:!0,attributeFilter:["value"]})}};customElements.define("ui-chart",Ds);function On(i){let t=null,e=[];return i.querySelectorAll('template[name="line"], template[name="area"], template[name="point"]').forEach(s=>{e.push(s.getAttribute("field")||"value")}),i.querySelectorAll('template[name="axis"][axis="x"]').forEach(s=>{t=s.getAttribute("field")||"index"}),e=Array.from(new Set(e)),t===null&&(t="index"),e.length===0&&(e=["value"]),[t,e]}function at(i){let t=document.createElementNS("http://www.w3.org/2000/svg","svg");return t.setAttribute("xmlns","http://www.w3.org/2000/svg"),t.setAttribute("version","1.1"),t.innerHTML=i.innerHTML,t.firstElementChild}function za(i,t){if(ja(i,t)){if(t.axis==="x"&&t.type==="categorical")Pn(i);else if(t.axis==="x"&&t.type==="time"){let e=Ln(i);if(!ja(i,t))return;e(),In(i)}}}function ja(i,t){let e=Array.from(i.children);e=e.filter(s=>s.style.display!="none");for(let s=0;s<e.length;s++){let a=e[s],r=e[s+1];if(!r)break;let n=a.getBoundingClientRect(),l=r.getBoundingClientRect(),o=20;if(t.axis==="y"){if(n.bottom+o<l.top)return!0}else if(n.right+o>l.left)return!0}return!1}function Pn(i){let t=[];return Array.from(i.children).forEach((e,s)=>{let a=e.matches("text")?e:e.querySelector("text");Array.from(i.children).forEach((r,n)=>{let l=r.matches("text")?r:r.querySelector("text");l&&(l.style.transform="rotate(-45deg)",l.style.textAnchor="end",t.push(()=>{l.style.transform=null,l.style.textAnchor=null}))})}),()=>t.forEach(e=>e())}function Ln(i){let t=Array.from(i.children);return t.forEach((e,s)=>{s%2===1&&(e.style.display="none")}),()=>t.forEach((e,s)=>{e.style.display="inline"})}function In(i){let t=Array.from(i.children);t.forEach((n,l)=>{n.style.display="none"});let e=t[0],s=t[t.length-1],a=e.matches("text")?e:e.querySelector("text"),r=s.matches("text")?s:s.querySelector("text");return e.style.display="inline",a.style.textAnchor="start",s.style.display="inline",r.style.textAnchor="end",()=>t.forEach((n,l)=>{n.style.display="inline"})}function Ga(i){return typeof i=="number"||typeof i=="string"&&!isNaN(Number(i))}function Xa(i){return i instanceof Date||typeof i=="string"&&!isNaN(Date.parse(i))}function Nn(i){let t=i.getBoundingClientRect(),e={top:1/0,right:-1/0,bottom:-1/0,left:1/0};
141return Array.from(i.children).forEach(s=>{if(s.hasAttribute("data-overlay")||s.style.display==="none")return;let a=s.getBoundingClientRect();!a.width&&!a.height||(e.top=Math.min(e.top,a.top),e.right=Math.max(e.right,a.right),e.bottom=Math.max(e.bottom,a.bottom),e.left=Math.min(e.left,a.left))}),{top:Math.max(0,t.top-e.top),right:Math.max(0,e.right-t.right),bottom:Math.max(0,e.bottom-t.bottom),left:Math.max(0,t.left-e.left)}}var Ts=class extends D{mount(){d(this,"role","status"),document.addEventListener("keydown",t=>{t.key==="Escape"&&this.hideToast()})}showToast(t={}){let e=this.template().nextElementSibling;e&&e.destroyToast();let s=Number(t.duration===void 0?5e3:t.duration),a=t.slots||{},r=t.dataset||{},n=this.querySelector("template");if(!n)return console.warn("ui-toast: no template element found",this);let l=n.content.cloneNode(!0).firstElementChild;l.setAttribute("aria-atomic","true"),Object.entries(a).forEach(([p,g])=>{[null,void 0,!1].includes(g)||l.querySelectorAll(`slot[name="${p}"]`).forEach(v=>{v.replaceWith(document.createTextNode(g))})}),Object.entries(r).forEach(([p,g])=>{l.dataset[p]=g}),l.querySelectorAll("slot").forEach(p=>p.remove());let o=()=>{l.showPopover()},u=()=>{l._hiding=!0,l.hidePopover(),l.getAnimations().length?l.addEventListener("transitionend",()=>{l.remove()},{once:!0}):l.remove()};this.appendChild(l),o(),l.hideToast=u;let h=s!==0&&setTimeout(()=>{u()},s);l.destroyToast=()=>{h&&clearTimeout(h),l.remove()}}hideToast(){let t=this.template().nextElementSibling;t&&t.destroyToast()}template(){return this.querySelector("template")}};C("toast",Ts);var Ms=class extends V{boot(){this._selectable=new $(this),this._controllable=new I(this,{disabled:this._disabled,bubbles:!0}),this._focusable=new bt(this,{wrap:!0}),this._submittable=new J(this,{name:this.getAttribute("name"),value:this._selectable.getState(),includeWhenEmpty:!1}),this._controllable.initial(t=>t&&this._selectable.setState(t)),this._controllable.getter(()=>this._selectable.getState()),this._detangled=L(),this._controllable.setter(this._detangled(t=>{this._selectable.setState(t)})),this._selectable.onChange(this._detangled(()=>{this._controllable.dispatch()})),this._selectable.onInitAndChange(()=>{this._submittable.update(this._selectable.getState())}),A(this,"keydown",t=>{["ArrowDown","ArrowRight"].includes(t.key)?(this._focusable.focusNext(),t.preventDefault(),t.stopPropagation()):["ArrowUp","ArrowLeft"].includes(t.key)&&(this._focusable.focusPrev(),t.preventDefault(),t.stopPropagation())}),d(this,"role","radiogroup"),queueMicrotask(()=>{this._submittable.update(this._selectable.getState())})}}
141,Os=class extends V{boot(){let t=this;this._disableable=new N(this),this._selectable=new P(t,{value:this.hasAttribute("value")?this.getAttribute("value"):Math.random().toString(36).substring(2,10),label:this.hasAttribute("label")?this.getAttribute("label"):null,selectedInitially:this.hasAttribute("checked"),dataAttr:"data-checked",ariaAttr:"aria-checked"}),this.value=this._selectable.getValue(),this._selectable.onChange(()=>{this._selectable.isSelected()&&this._focusable.focus(!1)}),this._disableable.onChange(e=>{e?this._focusable.untabbable():this._selectable.isSelected()&&this._focusable.tabbable()}),d(t,"role","radio"),this._focusable=new q(t,{disableable:this._disableable,tabbableAttr:"data-active"}),A(t,"click",this._disableable.disabled(e=>{e.preventDefault(),e.stopPropagation()}),{capture:!0}),A(t,"click",this._disableable.enabled(e=>{this._selectable.press()})),A(t,"keydown",this._disableable.enabled(e=>{e.key==="Enter"&&(this._selectable.press(),e.preventDefault(),e.stopPropagation())})),A(t,"keydown",this._disableable.enabled(e=>{e.key===" "&&(e.preventDefault(),e.stopPropagation())})),A(t,"keyup",this._disableable.enabled(e=>{e.key===" "&&(this._selectable.press(),e.preventDefault(),e.stopPropagation())})),Fn(t),A(t,"focus",e=>{ie()&&this._selectable.select()})}get checked(){return this._selectable.isSelected()}set checked(t){(this.closest("ui-radio-group")?._detangled||(()=>{}))(()=>{t&&this._selectable.select()})()}};function Fn(i){i.closest("label")?.addEventListener("click",t=>{i.contains(t.target)||i.click()})}O(({css:i})=>i`ui-radio-group { display: block; }`);O(({css:i})=>i`ui-radio { display: inline-block; user-select: none; }`);C("radio-group",Ms);C("radio",Os);var ui=class i extends D{boot(){this._disabled=this.hasAttribute("disabled")}mount(){this.walkPanels(t=>Ka(t)),new MutationObserver(t=>{this.walkPanels(e=>Ka(e))}).observe(this,{childList:!0})}showPanel(t){this.walkPanels(e=>{e.getAttribute("name")===t?e.show():e.hide()})}getPanel(t){return this.walkPanels((e,s)=>{e.getAttribute("name")===t&&s(e)})}walkPanels(t){let e=!1,s;for(let a of this.children)if(!(a instanceof i)&&!(a instanceof ci)&&(t(a,r=>{e=!0,s=r}),e))break;return s}},ci=class i extends V{boot(){this._focusable=new bt(this,{wrap:!0}),this._selectableGroup=new $(this),this._controllable=new I(this,{disabled:this._disabled}),this._controllable.initial(e=>e&&this._selectableGroup.setState(e)),this._controllable.getter(()=>this._selectableGroup.getState());let t=L();this._controllable.setter(t(e=>{this._selectableGroup.setState(e)})),this._selectableGroup.onChange(t(()=>{this._controllable.dispatch()})),A(this,"keydown",e=>{["ArrowDown","ArrowRight"].includes(e.key)?(this._focusable.focusNext(),e.preventDefault(),e.stopPropagation()):["ArrowUp","ArrowLeft"].includes(e.key)&&(this._focusable.focusPrev(),e.preventDefault(),e.stopPropagation())}),d(this,"role","tablist")}mount(){this.initializeTabs(),this._focusable.ensureTabbable(),this._selectableGroup.getState()||this._selectableGroup.selectFirst(),new MutationObserver(t=>{this.initializeTabs();let e=this._selectableGroup.selected();e.el.closest("ui-tab-group").showPanel(e.value)}).observe(this,{childList:!0})}initializeTabs(){this.walker().each(t=>{t._initialized||t._disableable||t.hasAttribute("action")||(Rn(t),t._initialized=!0)})}walker(){return W(this,(t,{skip:e,reject:s})=>{if(t instanceof ui||t instanceof i)return s();if(!["a","button"].includes(t.localName))return e()})}};function Rn(i){i._disableable=new N(i);let t=i.matches("a")?i:null,e=t||i;i._disableable.onInitAndChange(a=>{a?d(e,"aria-disabled","true"):S(e,"aria-disabled")});let s=U(e,"tab");if(d(e,"role","tab"),e._focusable=new q(e,{disableable:i._disableable,tabbableAttr:"data-active"}),!t){let a=i.getAttribute("name");i._selectable=new P(i,{value:a||Math.random().toString(36).substring(2,10),label:i.hasAttribute("label")?i.getAttribute("label"):i.textContent.trim(),selectedInitially:i.hasAttribute("selected"),toggleable:!1}),A(i,"click",()=>i._selectable.press()),i._selectable.onInitAndChange(()=>{let r=i.closest("ui-tab-group")?.getPanel(a);i._selectable.getState()?r?.show():r?.hide(),i._selectable.getState()&&i._focusable.focus(!1)}
141),i.closest("ui-tab-group")?.hasAttribute("manual")||A(i,"focus",()=>i._selectable.select()),queueMicrotask(()=>{let r=i.closest("ui-tab-group");if(!r)return;let n=r.getPanel(a);if(!n)throw new Error("Could not find panel...");d(i,"aria-controls",n.id),d(n,"aria-labelledby",i.id)})}}function Ka(i){i._initialized||(U(i,"tab-panel"),d(i,"role","tabpanel"),i.hasAttribute("tabindex")||d(i,"tabindex","-1"),i.show=()=>{d(i,"data-selected",""),d(i,"tabindex","0")},i.hide=()=>{S(i,"data-selected"),d(i,"tabindex","-1")},i._initialized=!0)}O(({css:i})=>i`ui-tab-group, ui-tabs { display: block; cursor: default; }`);C("tab-group",ui);C("tabs",ci);document.addEventListener("alpine:init",()=>{let i=window.Flux?.applyAppearance;i||(i=()=>{window.Flux.appearance=null,window.localStorage.removeItem("flux.appearance")});let t=Alpine.reactive({toast(...s){let a={slots:{},dataset:{}};typeof s[0]=="string"&&(a.slots.text=s.shift()),typeof s[0]=="string"&&(a.slots.heading=a.slots.text,a.slots.text=s.shift());let r=s.shift()||{};r.text&&(a.slots.text=r.text),r.heading&&(a.slots.heading=r.heading),r.variant&&(a.dataset.variant=r.variant),r.position&&(a.dataset.position=r.position),r.duration!==void 0&&(a.duration=r.duration),document.dispatchEvent(new CustomEvent("toast-show",{detail:a}))},modal(s){return{show(){document.dispatchEvent(new CustomEvent("modal-show",{detail:{name:s}}))},close(){document.dispatchEvent(new CustomEvent("modal-close",{detail:{name:s}}))}}},modals(){return{close(){document.dispatchEvent(new CustomEvent("modal-close",{detail:{}}))}}},appearance:window.localStorage.getItem("flux.appearance")||"system",systemAppearanceChanged:1,get dark(){return JSON.stringify(t.systemAppearanceChanged),t.appearance==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches:t.appearance==="dark"},set dark(s){let a=this.dark;s!==a&&(s?t.appearance="dark":t.appearance="light")}});window.Flux=t,Alpine.magic("flux",()=>t),Alpine.effect(()=>{i(t.appearance)}),document.addEventListener("livewire:navigated",()=>{i(t.appearance)}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{t.systemAppearanceChanged++,i(t.appearance)})});!Gs()&&!Xs()&&Ks();})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.