@vireo-ai/trellis-ui 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -1
- package/src/components/accordion/styles.css +16 -0
- package/src/components/brand/styles.css +8 -0
- package/src/components/button/styles.css +178 -0
- package/src/components/date-picker/styles.css +426 -0
- package/src/components/field/styles.css +12 -0
- package/src/components/file-upload/styles.css +28 -0
- package/src/components/input/styles.css +11 -0
- package/src/components/radio/styles.css +112 -0
- package/src/components/scroll-area/styles.css +27 -0
- package/src/components/select/styles.css +51 -0
- package/src/components/sidebar/styles.css +10 -0
- package/src/components/toast/styles.css +43 -0
- package/src/components.css +20 -0
- package/src/theme.css +332 -46
- package/trellis_ui/static/trellis_ui/css/styles.css +955 -214
- package/trellis_ui/static/trellis_ui/js/esm/index.js +1149 -910
- package/trellis_ui/static/trellis_ui/js/esm/index.js.map +1 -1
- package/trellis_ui/static/trellis_ui/js/index.js +7 -7
- package/types/components/app/contract.d.ts +7 -2
- package/types/components/badge/contract.d.ts +8 -6
- package/types/components/box/contract.d.ts +29 -21
- package/types/components/box/index.d.ts +1 -1
- package/types/components/button/contract.d.ts +10 -7
- package/types/components/card/contract.d.ts +25 -11
- package/types/components/combobox/contract.d.ts +6 -3
- package/types/components/common.d.ts +239 -2
- package/types/components/date-picker/contract.d.ts +7 -4
- package/types/components/file-upload/index.d.ts +1 -0
- package/types/components/frame/contract.d.ts +43 -18
- package/types/components/frame/index.d.ts +2 -2
- package/types/components/heading/contract.d.ts +3 -2
- package/types/components/input/contract.d.ts +7 -3
- package/types/components/menu/contract.d.ts +1 -1
- package/types/components/modal/contract.d.ts +12 -6
- package/types/components/select/contract.d.ts +10 -7
- package/types/components/sidebar/contract.d.ts +1 -1
- package/types/components/table/contract.d.ts +1 -1
- package/types/components/tabs/index.d.ts +1 -0
- package/types/components/text/contract.d.ts +3 -2
- package/types/components/textarea/contract.d.ts +1 -0
- package/types/components/toast/contract.d.ts +11 -5
- package/types/components/toast/index.d.ts +2 -1
- package/types/index.d.ts +4 -4
- package/types/motion/animate.d.ts +4 -0
- package/types/motion/presence.d.ts +1 -1
- package/types/runtime/index.d.ts +4 -4
- package/types/runtime/manifest.d.ts +5 -1
- package/types/runtime/merge-bindings.d.ts +9 -0
- package/types/runtime/theme.d.ts +8 -3
- package/types/runtime/props.d.ts +0 -9
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
var TrellisUI=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=Object.defineProperty,n=(e,t)=>()=>(e&&(t=e(e=0)),t),r=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),i=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},a={headers:{},mergeStrategy:`replace`,transitions:!1,mapDelimiter:`:`},o=()=>{console.error(`You can't use the "morph" merge without first installing the Alpine "morph" plugin here: https://alpinejs.dev/plugins/morph`)};function s(e){e.morph&&(o=e.morph),e.addInitSelector(()=>`[${e.prefixed(`target`)}]`),e.addInitSelector(()=>`[${e.prefixed(`target\\.push`)}]`),e.addInitSelector(()=>`[${e.prefixed(`target\\.replace`)}]`),e.directive(`target`,(e,{value:t,modifiers:n,expression:r},{evaluateLater:i,effect:a})=>{let o=t=>{e._ajax_target=e._ajax_target||{};let r={ids:x(e,t),sync:!0,focus:!n.includes(`nofocus`),history:n.includes(`push`)?`push`:n.includes(`replace`)?`replace`:!1},i=n.filter(e=>[`back`,`away`,`error`].includes(e)||parseInt(e));i=i.length?i:[`xxx`],i.forEach(t=>{t.charAt(0)===`3`&&(t=`3xx`),e._ajax_target[t]=r})};if(t===`dynamic`){let e=i(r);a(()=>e(o))}else o(r)}),e.directive(`headers`,(e,{expression:t},{evaluateLater:n,effect:r})=>{let i=n(t||`{}`);r(()=>{i(t=>{e._ajax_headers=t})})}),e.addInitSelector(()=>`[${e.prefixed(`merge`)}]`),e.addInitSelector(()=>`[${e.prefixed(`merge\\.transition`)}]`),e.directive(`merge`,(e,{value:t,modifiers:n,expression:r},{evaluateLater:i,effect:o})=>{let s=t=>{e._ajax_strategy=t,e._ajax_transition=a.transitions||n.includes(`transition`)};if(t===`dynamic`){let e=i(r);o(()=>e(s))}else s(r)}),e.magic(`ajax`,e=>async(t,n={})=>{let r={el:e,target:{xxx:{ids:x(e,n.targets||n.target),sync:!!n.sync,history:`history`in n?n.history:!1,focus:`focus`in n?n.focus:!0}},headers:n.headers||{}},i=n.method?n.method.toUpperCase():`GET`,a=n.body;return h(r,t,i,a)});let t=!1;e.ajax={start(){t||=(document.addEventListener(`submit`,d),document.addEventListener(`click`,u),window.addEventListener(`popstate`,l),!0)},configure:s.configure,stop(){document.removeEventListener(`submit`,d),document.removeEventListener(`click`,u),window.removeEventListener(`popstate`,l),t=!1}},e.ajax.start()}s.configure=e=>(a=Object.assign(a,e),s);var c=s;function l(e){!e.state||!e.state.__ajax||window.location.reload(!0)}async function u(e){if(e.defaultPrevented||e.which>1||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)return;let t=e?.target.closest(`a[href]:not([download]):not([noajax])`);if(!t||!t._ajax_target||t.isContentEditable||t.origin!==window.location.origin||t.getAttribute(`href`).startsWith(`#`)||t.hash&&C(t,new URL(document.baseURI)))return;e.preventDefault(),e.stopImmediatePropagation();let n={el:t,target:t._ajax_target,headers:t._ajax_headers||{}},r=t.getAttribute(`href`);try{return await h(n,r)}catch(e){if(e.name===`RenderError`){console.warn(e.message),window.location.href=t.href;return}throw e}}async function d(e){if(e.defaultPrevented)return;let t=e.target,n=e.submitter,r=(n?.getAttribute(`formmethod`)||t.getAttribute(`method`)||`GET`).toUpperCase();if(!t||!t._ajax_target||r===`DIALOG`||n?.hasAttribute(`formnoajax`)||n?.hasAttribute(`formtarget`)||t.hasAttribute(`noajax`)||t.hasAttribute(`target`))return;e.preventDefault(),e.stopImmediatePropagation();let i={el:t,target:t._ajax_target,headers:t._ajax_headers||{}},a=new FormData(t),o=t.getAttribute(`enctype`),s=t.getAttribute(`action`);n&&(o=n.getAttribute(`formenctype`)||o,s=n.getAttribute(`formaction`)||s,n.name&&a.append(n.name,n.value));try{return await f(n,()=>h(i,s,r,a,o))}catch(e){if(e.name===`RenderError`){console.warn(e.message),t.setAttribute(`noajax`,`true`),t.requestSubmit(n);return}throw e}}async function f(e,t){if(!e)return await t();let n=e=>e.preventDefault();e.setAttribute(`aria-disabled`,`true`),e.addEventListener(`click`,n);let r;try{r=await t()}finally{e.removeAttribute(`aria-disabled`),e.removeEventListener(`click`,n)}return r}var p={store:new Map,plan(e,t){if(e.ids.forEach(e=>{let n=e[0],r=[`_self`,`_top`,`_none`].includes(n)?document.documentElement:document.getElementById(n);if(!r)return console.warn(`Target [#${n}] was not found in current document.`);r._ajax_id=e[1],this.set(r,t)}),e.sync){let n=e.ids.flat();document.querySelectorAll(`[x-sync]`).forEach(e=>{let r=e.getAttribute(`id`);if(!r)throw new T(e);n.includes(r)||(e._ajax_id=r,e._ajax_sync=!0,this.set(e,t))})}},purge(e){this.store.forEach((t,n)=>e===t&&this.delete(n))},get(e){let t=[];return this.store.forEach((n,r)=>e===n&&t.push(r)),t},set(e,t){e.querySelectorAll(`[aria-busy]`).forEach(e=>{this.delete(e)}),e.setAttribute(`aria-busy`,`true`),this.store.set(e,t)},delete(e){e.removeAttribute(`aria-busy`),this.store.delete(e)}},m=new Map;async function h(e,t=``,n=`GET`,r=null,i=`application/x-www-form-urlencoded`){if(!S(e.el,`ajax:before`))return;let o=e.target.xxx,s={ok:!1,redirected:!1,url:``,status:``,html:``,raw:``};p.plan(o,s);let c=new URL(e.el.closest(`[data-source]`)?.dataset.source||``,document.baseURI);t=new URL(t||c,document.baseURI),r&&(r=g(r),n===`GET`?(t.search=_(r).toString(),r=null):i!==`multipart/form-data`&&r instanceof FormData?r=_(r):i=null);let l={action:t.toString(),method:n,body:r,enctype:i,referrer:c.toString(),headers:Object.assign({"X-Alpine-Request":!0,"X-Alpine-Target":p.get(s).map(e=>e._ajax_id).join(` `)},a.headers,e.headers)};l.enctype||delete l.enctype,S(e.el,`ajax:send`,l);let u;if(l.method===`GET`&&m.has(l.action)?u=m.get(l.action):(u=fetch(l.action,l).then(async e=>{let t=await e.text();return e.html=document.createRange().createContextualFragment(`<template>`+t+`</template>`).firstElementChild.content,e.raw=t,e}),m.set(l.action,u)),await u.then(e=>{s.ok=e.ok,s.redirected=e.redirected,s.url=e.url,s.status=e.status,s.html=e.html,s.raw=e.raw,s.headers=e.headers}),s.ok?(s.redirected&&(S(e.el,`ajax:redirect`,s),m.set(s.url,u),setTimeout(()=>{m.delete(s.url)},5)),S(e.el,`ajax:success`,s)):S(e.el,`ajax:error`,s),S(e.el,`ajax:sent`,s),m.delete(l.action),!s.html){p.purge(s);return}let d=s.redirected?`3xx`:s.status.toString(),f=C(new URL(s.url),new URL(l.referrer,document.baseURI)),h=[s.redirected?f?`back`:`away`:null,d,d.charAt(0)+`xx`,s.ok?`xxx`:`error`,`xxx`].find(t=>t in e.target);h!==`xxx`&&(o=e.target[h],(!s.redirected||!f||!o.ids.flat().includes(`_self`))&&(p.purge(s),p.plan(o,s))),o.history&&b(o.history,s.url);let x=!o.focus,w=p.get(s).map(async t=>{if(!t.isConnected||t._ajax_id===`_none`){p.delete(t);return}if(t===document.documentElement){window.location.href=s.url;return}let n=s.html.getElementById(t._ajax_id);if(!n){if(t._ajax_sync||!S(e.el,`ajax:missing`,{target:t,response:s}))return;if(s.ok)return t.remove();throw new ee(t,s.status)}let r=t._ajax_strategy||a.mergeStrategy,i=async()=>{if(t=await v(r,t,n),t){t.dataset.source=s.url,p.delete(t);let e=[`[x-autofocus]`,`[autofocus]`];for(;!x&&e.length;){let n=e.shift();t.matches(n)&&(x=y(t)),x||=Array.from(t.querySelectorAll(n)).some(e=>y(e))}}return S(t,`ajax:merged`),t};if(S(t,`ajax:merge`,{strategy:r,content:n,merge:i}))return i()}),T=await Promise.all(w);return e.el&&e.el.isConnected?S(e.el,`ajax:after`,{response:s,render:T}):S(window,`ajax:after`,{response:s,render:T}),T}function g(e){if(e instanceof FormData)return e;if(e instanceof HTMLFormElement)return new FormData(e);if(typeof e==`string`||e instanceof ArrayBuffer||e instanceof DataView||e instanceof Blob||e instanceof File||e instanceof URLSearchParams||e instanceof ReadableStream)return e;let t=new FormData;for(let n in e)typeof e[n]==`object`?t.append(n,JSON.stringify(e[n])):t.append(n,e[n]);return t}function _(e){let t=Array.from(e.entries()).filter(([e,t])=>!(t instanceof File));return new URLSearchParams(t)}async function v(e,t,n){let r={before(e,t){return e.before(...t.childNodes),e},replace(e,t){return e.replaceWith(t),t},update(e,t){return e.replaceChildren(...t.childNodes),e},prepend(e,t){return e.prepend(...t.childNodes),e},append(e,t){return e.append(...t.childNodes),e},after(e,t){return e.after(...t.childNodes),e},morph(e,t){return o(e,t),document.getElementById(t.getAttribute(`id`))}};return!t._ajax_transition||!document.startViewTransition?r[e](t,n):(await document.startViewTransition(()=>(t=r[e](t,n),Promise.resolve())).updateCallbackDone,t)}function y(e){return!e||!e.getClientRects().length?!1:(setTimeout(()=>{e.hasAttribute(`tabindex`)||e.setAttribute(`tabindex`,`0`),e.focus()},0),!0)}function b(e,t){return{push:()=>window.history.pushState({__ajax:!0},``,t),replace:()=>window.history.replaceState({__ajax:!0},``,t)}[e]()}function x(e,t=null){let n=e.getAttribute(`id`),r=[n];if(t&&(r=Array.isArray(t)?t:t.split(` `)),r=r.filter(e=>e).map(e=>{let t=e.split(a.mapDelimiter).map(e=>e||n);return t[1]=t[1]||t[0],t}),r.length===0)throw new T(e);return r}function S(e,t,n){return e.dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!0,composed:!0,cancelable:!0}))}function C(e,t){return w(e.pathname)===w(t.pathname)}function w(e){return e.replace(/\/$/,``)}var T=class extends DOMException{constructor(e){let t=(e.outerHTML.match(/<[^>]+>/)??[])[0]??`[Element]`;super(`${t} is missing an ID to target.`,`IDError`)}},ee=class extends DOMException{constructor(e,t){let n=e.getAttribute(`id`);super(`Target [#${n}] was not found in response with status [${t}].`,`RenderError`)}},te=c;function ne(e,t,n){fe();let r=ie(n),i=typeof t==`string`?ce(t):t;return window.Alpine&&window.Alpine.closestDataStack&&!e._x_dataStack&&(i._x_dataStack=window.Alpine.closestDataStack(e),i._x_dataStack&&window.Alpine.cloneNode(e,i)),r.patch(e,i),e}function re(e,t,n,r={}){fe();let i=ie(r),a=e.parentNode,o=new ue(e,t),s=typeof n==`string`?(()=>{let e=document.createElement(`div`);return e.insertAdjacentHTML(`beforeend`,n),e})():n,c=document.createComment(`[morph-start]`),l=document.createComment(`[morph-end]`);s.insertBefore(c,s.firstChild),s.appendChild(l);let u=new ue(c,l);window.Alpine&&window.Alpine.closestDataStack&&(s._x_dataStack=window.Alpine.closestDataStack(a),s._x_dataStack&&window.Alpine.cloneNode(a,s)),i.patchChildren(o,u)}function ie(e={}){let t=e=>e.getAttribute(`key`),n=()=>{},r={key:e.key||t,lookahead:e.lookahead||!1,updating:e.updating||n,updated:e.updated||n,removing:e.removing||n,removed:e.removed||n,adding:e.adding||n,added:e.added||n};return r.patch=function(e,t){if(r.differentElementNamesTypesOrKeys(e,t))return r.swapElements(e,t);let n=!1,i=!1;if(!oe(r.updating,()=>i=!0,e=>r.skipUntilCondition=e,e,t,()=>n=!0)){if(e.nodeType===1&&window.Alpine&&(window.Alpine.cloneNode(e,t),e._x_teleport&&t._x_teleport&&r.patch(e._x_teleport,t._x_teleport)),le(t)){r.patchNodeValue(e,t),r.updated(e,t);return}n||r.patchAttributes(e,t),r.updated(e,t),i||r.patchChildren(e,t)}},r.differentElementNamesTypesOrKeys=function(e,t){return e.nodeType!=t.nodeType||e.nodeName!=t.nodeName||r.getKey(e)!=r.getKey(t)},r.swapElements=function(e,t){if(ae(r.removing,e))return;let n=t.cloneNode(!0);ae(r.adding,n)||(e.replaceWith(n),r.removed(e),r.added(n))},r.patchNodeValue=function(e,t){let n=t.nodeValue;e.nodeValue!==n&&(e.nodeValue=n)},r.patchAttributes=function(e,t){if(e._x_transitioning||e._x_isShown&&!t._x_isShown||!e._x_isShown&&t._x_isShown)return;let n=Array.from(e.attributes),r=Array.from(t.attributes);for(let r=n.length-1;r>=0;r--){let i=n[r].name;t.hasAttribute(i)||(i===`open`&&e.nodeName===`DIALOG`&&e.open?e.close():e.removeAttribute(i))}for(let t=r.length-1;t>=0;t--){let n=r[t].name,i=r[t].value;e.getAttribute(n)!==i&&e.setAttribute(n,i)}},r.patchChildren=function(e,t){let n=r.keyToMap(e.children),i={},a=de(t),o=de(e);for(;a;){pe(a,o);let s=r.getKey(a),c=r.getKey(o);if(r.skipUntilCondition){let n=!o||r.skipUntilCondition(o),i=!a||r.skipUntilCondition(a);if(n&&i)r.skipUntilCondition=null;else{n||(o&&=E(e,o)),i||(a&&=E(t,a));continue}}if(!o)if(s&&i[s]){let t=i[s];e.appendChild(t),o=t,c=r.getKey(o)}else{if(!ae(r.adding,a)){let t=a.cloneNode(!0);e.appendChild(t),r.added(t)}a=E(t,a);continue}let l=e=>e&&e.nodeType===8&&e.textContent===`[if BLOCK]><![endif]`,u=e=>e&&e.nodeType===8&&e.textContent===`[if ENDBLOCK]><![endif]`;if(l(a)&&l(o)){let n=0,i=o;for(;o;){let t=E(e,o);if(l(t))n++;else if(u(t)&&n>0)n--;else if(u(t)&&n===0){o=t;break}o=t}let s=o;n=0;let c=a;for(;a;){let e=E(t,a);if(l(e))n++;else if(u(e)&&n>0)n--;else if(u(e)&&n===0){a=e;break}a=e}let d=a,f=new ue(i,s),p=new ue(c,d);r.patchChildren(f,p);continue}if(o.nodeType===1&&r.lookahead&&!o.isEqualNode(a)){let n=E(t,a),i=!1;for(;!i&&n;)n.nodeType===1&&o.isEqualNode(n)&&(i=!0,o=r.addNodeBefore(e,a,o),c=r.getKey(o)),n=E(t,n)}if(s!==c){if(!s&&c){i[c]=o,o=r.addNodeBefore(e,a,o),i[c].remove(),o=E(e,o),a=E(t,a);continue}if(s&&!c&&n[s]&&(o.replaceWith(n[s]),o=n[s],c=r.getKey(o)),s&&c){let l=n[s];if(l)i[c]=o,o.replaceWith(l),o=l,c=r.getKey(o);else{i[c]=o,o=r.addNodeBefore(e,a,o),i[c].remove(),o=E(e,o),a=E(t,a);continue}}}let d=o&&E(e,o);r.patch(o,a),a&&=E(t,a),o=d}let s=[];for(;o;)ae(r.removing,o)||s.push(o),o=E(e,o);for(;s.length;){let e=s.shift();e.remove(),r.removed(e)}},r.getKey=function(e){return e&&e.nodeType===1&&r.key(e)},r.keyToMap=function(e){let t={};for(let n of e){let e=r.getKey(n);e&&(t[e]=n)}return t},r.addNodeBefore=function(e,t,n){if(!ae(r.adding,t)){let i=t.cloneNode(!0);return e.insertBefore(i,n),r.added(i),i}return t},r}ne.step=()=>{},ne.log=()=>{};function ae(e,...t){let n=!1;return e(...t,()=>n=!0),n}function oe(e,t,n,...r){let i=!1;return e(...r,()=>i=!0,t,n),i}var se=!1;function ce(e){let t=document.createElement(`template`);return t.innerHTML=e,t.content.firstElementChild}function le(e){return e.nodeType===3||e.nodeType===8}var ue=class{constructor(e,t){this.startComment=e,this.endComment=t}get children(){let e=[],t=this.startComment.nextSibling;for(;t&&t!==this.endComment;)e.push(t),t=t.nextSibling;return e}appendChild(e){this.endComment.before(e)}get firstChild(){let e=this.startComment.nextSibling;if(e!==this.endComment)return e}nextNode(e){let t=e.nextSibling;if(t!==this.endComment)return t}insertBefore(e,t){return t.before(e),e}};function de(e){return e.firstChild}function E(e,t){let n;return n=e instanceof ue?e.nextNode(t):t.nextSibling,n}function fe(){if(se)return;se=!0;let e=Element.prototype.setAttribute,t=document.createElement(`div`);Element.prototype.setAttribute=function(n,r){if(!n.includes(`@`))return e.call(this,n,r);t.innerHTML=`<span ${n}="${r.replace(/&/g,`&`).replace(/"/g,`"`)}"></span>`;let i=t.firstElementChild.getAttributeNode(n);t.firstElementChild.removeAttributeNode(i),this.setAttributeNode(i)}}function pe(e,t){let n=t&&t._x_bindings&&t._x_bindings.id;n&&e.setAttribute&&(e.setAttribute(`id`,n),e.id=n)}function me(e){e.morph=ne,e.morphBetween=re}var he=me,ge=e=>{e.bind(`UiDisclosureRoot`,function(){let e=this;return{":data-state"(){return e.isOpen?`open`:`closed`}}}),e.bind(`UiDisclosureTrigger`,function(){let e=this;return{type:`button`,":id"(){return e.triggerId},":aria-controls"(){return e.contentId},":aria-expanded"(){return e.isOpen?`true`:`false`},":data-state"(){return e.isOpen?`open`:`closed`},"@click"(t){e.toggle(t)},"@keydown.enter.prevent"(t){e.toggle(t)},"@keydown.space.prevent"(t){e.toggle(t)},"@keydown.escape.stop"(t){e.close(t)}}}),e.bind(`UiDisclosureContent`,function(){let e=this;return{":id"(){return e.contentId},":data-state"(){return e.isOpen?`open`:`closed`},"@keydown.escape.stop"(t){e.close(t)}}})};function _e(e,t){e.indexOf(t)===-1&&e.push(t)}function ve(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var ye=(e,t,n)=>n>t?t:n<e?e:n;function be(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}var xe={},Se=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Ce=e=>typeof e==`object`&&!!e,we=e=>/^0[^.\s]+$/u.test(e);function Te(e){let t;return()=>(t===void 0&&(t=e()),t)}var Ee=e=>e,De=(...e)=>e.reduce((e,t)=>n=>t(e(n))),Oe=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1},ke=class{constructor(){this.subscriptions=[]}add(e){return _e(this.subscriptions,e),()=>ve(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},D=e=>e*1e3,Ae=e=>e/1e3,je=(e,t)=>t?1e3/t*e:0,Me=new Set;function Ne(e,t,n){e||Me.has(t)||(console.warn(be(t,n)),Me.add(t))}var Pe=(e,t,n)=>{let r=t-e;return((n-e)%r+r)%r+e},Fe=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Ie=1e-7,Le=12;function Re(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=Fe(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>Ie&&++s<Le);return o}function ze(e,t,n,r){if(e===t&&n===r)return Ee;let i=t=>Re(t,0,1,e,n);return e=>e===0||e===1?e:Fe(i(e),t,r)}var Be=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Ve=e=>t=>1-e(1-t),He=ze(.33,1.53,.69,.99),Ue=Ve(He),We=Be(Ue),Ge=e=>e>=1?1:(e*=2)<1?.5*Ue(e):.5*(2-2**(-10*(e-1))),Ke=e=>1-Math.sin(Math.acos(e)),qe=Ve(Ke),Je=Be(Ke),Ye=ze(.42,0,1,1),Xe=ze(0,0,.58,1),Ze=ze(.42,0,.58,1),Qe=e=>Array.isArray(e)&&typeof e[0]!=`number`;function $e(e,t){return Qe(e)?e[Pe(0,e.length,t)]:e}var et=e=>Array.isArray(e)&&typeof e[0]==`number`,tt={linear:Ee,easeIn:Ye,easeInOut:Ze,easeOut:Xe,circIn:Ke,circInOut:Je,circOut:qe,backIn:Ue,backInOut:We,backOut:He,anticipate:Ge},nt=e=>typeof e==`string`,rt=e=>{if(et(e)){e.length;let[t,n,r,i]=e;return ze(t,n,r,i)}else if(nt(e))return tt[e],`${e}`,tt[e];return e},it=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function at(e){let t=new Set,n=new Set,r=!1,i=!1,a=new WeakSet,o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(c.schedule(t),e()),t(o)}let c={schedule:(e,i=!1,o=!1)=>{let s=o&&r?t:n;return i&&a.add(e),s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(o=e,r){i=!0;return}r=!0;let a=t;t=n,n=a,t.forEach(s),t.clear(),r=!1,i&&(i=!1,c.process(e))}};return c}var ot=40;function st(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=it.reduce((e,t)=>(e[t]=at(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=xe.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,ot),1)),i.timestamp=o,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:it.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||g(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<it.length;t++)o[it[t]].cancel(e)},state:i,steps:o}}var{schedule:ct,cancel:lt,state:ut,steps:dt}=st(typeof requestAnimationFrame<`u`?requestAnimationFrame:Ee,!0),ft;function pt(){ft=void 0}var O={now:()=>(ft===void 0&&O.set(ut.isProcessing||xe.useManualTiming?ut.timestamp:performance.now()),ft),set:e=>{ft=e,queueMicrotask(pt)}},mt=e=>t=>typeof t==`string`&&t.startsWith(e),ht=mt(`--`),gt=mt(`var(--`),_t=e=>gt(e)?vt.test(e.split(`/*`)[0].trim()):!1,vt=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function yt(e){return typeof e==`string`?e.split(`/*`)[0].includes(`var(--`):!1}var bt={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},xt={...bt,transform:e=>ye(0,1,e)},St={...bt,default:1},Ct=e=>Math.round(e*1e5)/1e5,wt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Tt(e){return e==null}var Et=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Dt=(e,t)=>n=>!!(typeof n==`string`&&Et.test(n)&&n.startsWith(e)||t&&!Tt(n)&&Object.prototype.hasOwnProperty.call(n,t)),Ot=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(wt);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},kt=e=>ye(0,255,e),At={...bt,transform:e=>Math.round(kt(e))},jt={test:Dt(`rgb`,`red`),parse:Ot(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+At.transform(e)+`, `+At.transform(t)+`, `+At.transform(n)+`, `+Ct(xt.transform(r))+`)`};function Mt(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var Nt={test:Dt(`#`),parse:Mt,transform:jt.transform},Pt=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ft=Pt(`deg`),It=Pt(`%`),k=Pt(`px`),Lt=Pt(`vh`),Rt=Pt(`vw`),zt={...It,parse:e=>It.parse(e)/100,transform:e=>It.transform(e*100)},Bt={test:Dt(`hsl`,`hue`),parse:Ot(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+It.transform(Ct(t))+`, `+It.transform(Ct(n))+`, `+Ct(xt.transform(r))+`)`},A={test:e=>jt.test(e)||Nt.test(e)||Bt.test(e),parse:e=>jt.test(e)?jt.parse(e):Bt.test(e)?Bt.parse(e):Nt.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?jt.transform(e):Bt.transform(e),getAnimatableNone:e=>{let t=A.parse(e);return t.alpha=0,A.transform(t)}},Vt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Ht(e){return isNaN(e)&&typeof e==`string`&&(e.match(wt)?.length||0)+(e.match(Vt)?.length||0)>0}var Ut=`number`,Wt=`color`,Gt=`var`,Kt=`var(`,qt="${}",Jt=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Yt(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(Jt,e=>(A.test(e)?(r.color.push(a),i.push(Wt),n.push(A.parse(e))):e.startsWith(Kt)?(r.var.push(a),i.push(Gt),n.push(e)):(r.number.push(a),i.push(Ut),n.push(parseFloat(e))),++a,qt)).split(qt),indexes:r,types:i}}function Xt(e){return Yt(e).values}function Zt({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];e===Ut?i+=Ct(r[a]):e===Wt?i+=A.transform(r[a]):i+=r[a]}return i}}function Qt(e){return Zt(Yt(e))}var $t=e=>typeof e==`number`?0:A.test(e)?A.getAnimatableNone(e):e,en=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:$t(e);function tn(e){let t=Yt(e);return Zt(t)(t.values.map((e,n)=>en(e,t.split[n])))}var j={test:Ht,parse:Xt,createTransformer:Qt,getAnimatableNone:tn};function nn(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function rn({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=nn(s,r,e+1/3),a=nn(s,r,e),o=nn(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function an(e,t){return n=>n>0?t:e}var on=(e,t,n)=>e+(t-e)*n,sn=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},cn=[Nt,jt,Bt],ln=e=>cn.find(t=>t.test(e));function un(e){let t=ln(e);if(`${e}`,!t)return!1;let n=t.parse(e);return t===Bt&&(n=rn(n)),n}var dn=(e,t)=>{let n=un(e),r=un(t);if(!n||!r)return an(e,t);let i={...n};return e=>(i.red=sn(n.red,r.red,e),i.green=sn(n.green,r.green,e),i.blue=sn(n.blue,r.blue,e),i.alpha=on(n.alpha,r.alpha,e),jt.transform(i))},fn=new Set([`none`,`hidden`]);function pn(e,t){return fn.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function mn(e,t){return n=>on(e,t,n)}function hn(e){return typeof e==`number`?mn:typeof e==`string`?_t(e)?an:A.test(e)?dn:yn:Array.isArray(e)?gn:typeof e==`object`?A.test(e)?dn:_n:an}function gn(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>hn(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function _n(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=hn(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function vn(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]];n[i]=e.values[o]??0,r[a]++}return n}var yn=(e,t)=>{let n=j.createTransformer(t),r=Yt(e),i=Yt(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?fn.has(e)&&!i.values.length||fn.has(t)&&!r.values.length?pn(e,t):De(gn(vn(r,i),i.values),n):(`${e}${t}`,an(e,t))};function bn(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?on(e,t,n):hn(e)(e,t)}var xn=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>ct.update(t,e),stop:()=>lt(t),now:()=>ut.isProcessing?ut.timestamp:O.now()}},Sn=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},Cn=2e4;function wn(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}function Tn(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(wn(r),Cn);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:Ae(i)}}var M={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function En(e,t){return e*Math.sqrt(1-t*t)}var Dn=12;function On(e,t,n){let r=n;for(let n=1;n<Dn;n++)r-=e(r)/t(r);return r}var kn=.001;function An({duration:e=M.duration,bounce:t=M.bounce,velocity:n=M.velocity,mass:r=M.mass}){let i,a;M.maxDuration;let o=1-t;o=ye(M.minDamping,M.maxDamping,o),e=ye(M.minDuration,M.maxDuration,Ae(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=En(t,o),c=Math.exp(-i);return kn-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=En(t**2,o);return(-i(t)+kn>0?-1:1)*((a-s)*c)/l}):(i=t=>-.001+Math.exp(-t*e)*((t-n)*e+1),a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=On(i,a,s);if(e=D(e),isNaN(c))return{stiffness:M.stiffness,damping:M.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var jn=[`duration`,`bounce`],Mn=[`stiffness`,`damping`,`mass`];function Nn(e,t){return t.some(t=>e[t]!==void 0)}function Pn(e){let t={velocity:M.velocity,stiffness:M.stiffness,damping:M.damping,mass:M.mass,isResolvedFromDuration:!1,...e};if(!Nn(e,Mn)&&Nn(e,jn))if(t.velocity=0,e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*ye(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:M.mass,stiffness:i,damping:a}}else{let n=An({...e,velocity:0});t={...t,...n,mass:M.mass},t.isResolvedFromDuration=!0}return t}function Fn(e=M.visualDuration,t=M.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=Pn({...n,velocity:-Ae(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=Ae(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?M.restSpeed.granular:M.restSpeed.default,i||=v?M.restDelta.granular:M.restDelta.default;let y,b,x,S,C,w;if(h<1)x=En(_,h),S=(m+h*_*g)/x,y=e=>o-Math.exp(-h*_*e)*(S*Math.sin(x*e)+g*Math.cos(x*e)),C=h*_*S+g*x,w=h*_*g-S*x,b=e=>Math.exp(-h*_*e)*(C*Math.sin(x*e)+w*Math.cos(x*e));else if(h===1){y=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);let e=m+_*g;b=t=>Math.exp(-_*t)*(_*e*t-m)}else{let e=_*Math.sqrt(h*h-1);y=t=>{let n=Math.exp(-h*_*t),r=Math.min(e*t,300);return o-n*((m+h*_*g)*Math.sinh(r)+e*g*Math.cosh(r))/e};let t=(m+h*_*g)/e,n=h*_*t-g*e,r=h*_*g-t*e;b=t=>{let i=Math.exp(-h*_*t),a=Math.min(e*t,300);return i*(n*Math.sinh(a)+r*Math.cosh(a))}}let T={calculatedDuration:p&&d||null,velocity:e=>D(b(e)),next:e=>{if(!p&&h<1){let t=Math.exp(-h*_*e),n=Math.sin(x*e),a=Math.cos(x*e),c=o-t*(S*n+g*a),l=D(t*(C*n+w*a));return s.done=Math.abs(l)<=r&&Math.abs(o-c)<=i,s.value=s.done?o:c,s}let t=y(e);if(p)s.done=e>=d;else{let n=D(b(e));s.done=Math.abs(n)<=r&&Math.abs(o-t)<=i}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min(wn(T),Cn),t=Sn(t=>T.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return T}Fn.applyToOptions=e=>{let t=Tn(e,100,Fn);return e.ease=t.ease,e.duration=D(t.duration),e.type=`keyframes`,e};var In=5;function Ln(e,t,n){let r=Math.max(t-In,0);return je(n-e(r),t-r)}function Rn({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>s!==void 0&&e<s||c!==void 0&&e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>_+v(e),b=e=>{let t=v(e),n=y(e);f.done=Math.abs(t)<=l,f.value=f.done?_:n},x,S,C=e=>{p(f.value)&&(x=e,S=Fn({keyframes:[f.value,m(f.value)],velocity:Ln(y,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!S&&x===void 0&&(t=!0,b(e),C(e)),x!==void 0&&e>=x?S.next(e-x):(!t&&b(e),f)}}}function zn(e,t,n){let r=[],i=n||xe.mix||bn,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=De(Array.isArray(t)?t[n]||Ee:t,a)),r.push(a)}return r}function Bn(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=zn(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=Oe(e[r],e[r+1],n);return s[r](i)};return n?t=>l(ye(e[0],e[a-1],t)):l}function Vn(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=Oe(0,t,r);e.push(on(n,1,i))}}function Hn(e){let t=[0];return Vn(t,e.length-1),t}function Un(e,t){return e.map(e=>e*t)}function Wn(e,t){return e.map(()=>t||Ze).splice(0,e.length-1)}function Gn({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=Qe(r)?r.map(rt):rt(r),a={done:!1,value:t[0]},o=Bn(Un(n&&n.length===t.length?n:Hn(t),e),t,{ease:Array.isArray(i)?i:Wn(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var Kn=e=>e!==null;function qn(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(Kn),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var Jn={decay:Rn,inertia:Rn,tween:Gn,keyframes:Gn,spring:Fn};function Yn(e){typeof e.type==`string`&&(e.type=Jn[e.type])}var Xn=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}},Zn=e=>e/100,Qn=class extends Xn{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==O.now()&&this.tick(O.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;Yn(e);let{type:t=Gn,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||Gn;s!==Gn&&typeof o[0]!=`number`&&(this.mixKeyframes=De(Zn,bn(o[0],o[1])),o=[0,100]);let c=s({...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=wn(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime===null?this.currentTime=t:this.currentTime=this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=ye(0,1,n)*o}let b;_?(this.delayState.value=l[0],b=this.delayState):b=y.next(v),i&&!_&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==Rn&&(b.value=qn(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return Ae(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+Ae(e)}get time(){return Ae(this.currentTime)}set time(e){e=D(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){let e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);let t=this.generator.next(e).value;return Ln(e=>this.generator.next(e).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(O.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=Ae(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=xn,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(O.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}};function $n(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var er=e=>e*180/Math.PI,tr=e=>rr(er(Math.atan2(e[1],e[0]))),nr={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:tr,rotateZ:tr,skewX:e=>er(Math.atan(e[1])),skewY:e=>er(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},rr=e=>(e%=360,e<0&&(e+=360),e),ir=tr,ar=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),or=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),sr={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ar,scaleY:or,scale:e=>(ar(e)+or(e))/2,rotateX:e=>rr(er(Math.atan2(e[6],e[5]))),rotateY:e=>rr(er(Math.atan2(-e[2],e[0]))),rotateZ:ir,rotate:ir,skewX:e=>er(Math.atan(e[4])),skewY:e=>er(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function cr(e){return+!!e.includes(`scale`)}function lr(e,t){if(!e||e===`none`)return cr(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=sr,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=nr,i=t}if(!i)return cr(t);let a=r[t],o=i[1].split(`,`).map(dr);return typeof a==`function`?a(o):o[a]}var ur=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return lr(n,t)};function dr(e){return parseFloat(e.trim())}var fr=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],pr=new Set([...fr,`pathRotation`]),mr=e=>e===bt||e===k,hr=new Set([`x`,`y`,`z`]),gr=fr.filter(e=>!hr.has(e));function _r(e){let t=[];return gr.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(+!!n.startsWith(`scale`)))}),t}var vr={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>lr(t,`x`),y:(e,{transform:t})=>lr(t,`y`)};vr.translateX=vr.x,vr.translateY=vr.y;var yr=new Set,br=!1,xr=!1,Sr=!1;function Cr(){if(xr){let e=Array.from(yr).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=_r(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}xr=!1,br=!1,yr.forEach(e=>e.complete(Sr)),yr.clear()}function wr(){yr.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(xr=!0)})}function Tr(){Sr=!0,wr(),Cr(),Sr=!1}var Er=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(yr.add(this),br||(br=!0,ct.read(wr),ct.resolveKeyframes(Cr))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}$n(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),yr.delete(this)}cancel(){this.state===`scheduled`&&(yr.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},Dr=e=>e.startsWith(`--`);function Or(e,t,n){Dr(t)?e.style.setProperty(t,n):e.style[t]=n}var kr={};function Ar(e,t){let n=Te(e);return()=>kr[t]??n()}var jr=Ar(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),Mr=Ar(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),Nr=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Pr={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:Nr([0,.65,.55,1]),circOut:Nr([.55,0,1,.45]),backIn:Nr([.31,.01,.66,-.59]),backOut:Nr([.33,1.53,.69,.99])};function Fr(e,t){if(e)return typeof e==`function`?Mr()?Sn(e,t):`ease-out`:et(e)?Nr(e):Array.isArray(e)?e.map(e=>Fr(e,t)||Pr.easeOut):Pr[e]}function Ir(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=Fr(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function Lr(e){return typeof e==`function`&&`applyToOptions`in e}function Rr({type:e,...t}){return Lr(e)&&Mr()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var zr=class extends Xn{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=Rr(e);this.animation=Ir(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=qn(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),Or(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e===`idle`||e===`finished`||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return Ae(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+Ae(e)}get time(){return Ae(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=D(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&jr()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),Ee):r(this)}},Br={anticipate:Ge,backInOut:We,circInOut:Je};function Vr(e){return e in Br}function Hr(e){typeof e.ease==`string`&&Vr(e.ease)&&(e.ease=Br[e.ease])}var Ur=10,Wr=class extends zr{constructor(e){Hr(e),Yn(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new Qn({...a,autoplay:!1}),s=Math.max(Ur,O.now()-this.startTime),c=ye(0,Ur,s-Ur),l=o.sample(s).value,{name:u}=this.options;i&&u&&Or(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}},Gr=(e,t)=>t===`zIndex`?!1:!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(j.test(e)||e===`0`)&&!e.startsWith(`url(`));function Kr(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function qr(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=Gr(i,t),s=Gr(a,t);return`${t}${i}${a}${o?a:i}`,!o||!s?!1:Kr(e)||(n===`spring`||Lr(n))&&r}function Jr(e){e.duration=0,e.type=`keyframes`}var Yr=new Set([`opacity`,`clipPath`,`filter`,`transform`]),Xr=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function Zr(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&Xr.test(e[t]))return!0;return!1}var Qr=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),$r=Te(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function ei(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;let{onUpdate:c,transformTemplate:l}=t.owner.getProps();return $r()&&n&&(Yr.has(n)||Qr.has(n)&&Zr(s))&&(n!==`transform`||!l)&&!c&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var ti=40,ni=class extends Xn{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,keyframes:o,name:s,motionValue:c,element:l,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=O.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u},f=l?.KeyframeResolver||Er;this.keyframeResolver=new f(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=O.now();let u=!0;qr(e,i,a,o)||(u=!1,(xe.instantAnimations||!s)&&l?.(qn(e,n,t)),e[0]=e[e.length-1],Jr(n),n.repeat=0);let d={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>ti?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},f=u&&!c&&ei(d),p=d.motionValue?.owner?.current,m;if(f)try{m=new Wr({...d,element:p})}catch{m=new Qn(d)}else m=new Qn(d);m.finished.then(()=>{this.notifyFinished()}).catch(Ee),this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Tr()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}},ri=class{constructor(e){this.stop=()=>this.runAll(`stop`),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=t}attachTimeline(e){let t=this.animations.map(t=>t.attachTimeline(e));return()=>{t.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll(`time`)}set time(e){this.setAll(`time`,e)}get speed(){return this.getAll(`speed`)}set speed(e){this.setAll(`speed`,e)}get state(){return this.getAll(`state`)}get startTime(){return this.getAll(`startTime`)}get duration(){return ii(this.animations,`duration`)}get iterationDuration(){return ii(this.animations,`iterationDuration`)}runAll(e){this.animations.forEach(t=>t[e]())}play(){this.runAll(`play`)}pause(){this.runAll(`pause`)}cancel(){this.runAll(`cancel`)}complete(){this.runAll(`complete`)}};function ii(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e[r][t];i!==null&&i>n&&(n=i)}return n}var ai=class extends ri{then(e,t){return this.finished.finally(e).then(()=>{})}},oi=class extends zr{constructor(e){super(),this.animation=e,e.onfinish=()=>{this.finishedTime=this.time,this.notifyFinished()}}},si=30,ci=e=>!isNaN(parseFloat(e)),li={current:void 0},ui=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=O.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=O.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=ci(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){this.events[e]||(this.events[e]=new ke);let n=this.events[e].add(t);return e===`change`?()=>{n(),ct.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return li.current&&li.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=O.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>si)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,si);return je(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function di(e,t){return new ui(e,t)}function fi(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function pi(e,t){let n=e?.[t]??e?.default??e;return n===e?n:fi(n,e)}var mi={type:`spring`,stiffness:500,damping:25,restSpeed:10},hi=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),gi={type:`keyframes`,duration:.8},_i={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},vi=(e,{keyframes:t})=>t.length>2?gi:pr.has(e)?e.startsWith(`scale`)?hi(t[1]):mi:_i,yi=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function bi(e){for(let t in e)if(!yi.has(t))return!0;return!1}var xi=(e,t,n,r={},i,a)=>o=>{let s=pi(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=D(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};bi(s)||Object.assign(u,vi(e,u)),u.duration&&=D(u.duration),u.repeatDelay&&=D(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(Jr(u),u.delay===0&&(d=!0)),(xe.instantAnimations||xe.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,Jr(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=qn(u.keyframes,s);if(e!==void 0){ct.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new Qn(u):new ni(u)},Si=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ci(e){let t=Si.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function wi(e,t,n=1){`${e}`;let[r,i]=Ci(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return Se(e)?parseFloat(e):e}return _t(i)?wi(i,t,n+1):i}function Ti(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function Ei(e,t,n,r){if(typeof t==`function`){let[i,a]=Ti(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=Ti(r);t=t(n===void 0?e.custom:n,i,a)}return t}function Di(e,t,n){let r=e.getProps();return Ei(r,t,n===void 0?r.custom:n,e)}var Oi=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...fr]),ki=e=>Array.isArray(e);function Ai(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,di(n))}function ji(e){return ki(e)?e[e.length-1]||0:e}function Mi(e,t){let{transitionEnd:n={},transition:r={},...i}=Di(e,t)||{};i={...i,...n};for(let t in i)Ai(e,t,ji(i[t]))}var N=e=>!!(e&&e.getVelocity);function Ni(e){return!!(N(e)&&e.add)}function Pi(e,t){let n=e.getValue(`willChange`);if(Ni(n))return n.add(t);if(!n&&xe.WillChange){let n=new xe.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function Fi(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var Ii=`data-`+Fi(`framerAppearId`);function Li(e){return e.props[Ii]}function Ri({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function zi(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?fi(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState&&e.animationState.getState()[i],p=a?.path;p&&p.animateVisualElement(e,s,a,n,d);for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&Ri(f,t))continue;let o={delay:n,...pi(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){ct.update(()=>r.set(i));continue}let p=!1;if(window.MotionHandoffAnimation){let n=Li(e);if(n){let e=window.MotionHandoffAnimation(n,t,ct);e!==null&&(o.startTime=e,p=!0)}}Pi(e,t);let m=l??e.shouldReduceMotion;r.start(xi(t,r,i,m&&Oi.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>ct.update(()=>{o&&Mi(e,o)});d.length?Promise.all(d).then(t):t()}return d}var Bi={test:e=>e===`auto`,parse:e=>e},Vi=e=>t=>t.test(e),Hi=[bt,k,It,Ft,Rt,Lt,Bi],Ui=e=>Hi.find(Vi(e));function Wi(e){return typeof e==`number`?e===0:e===null?!0:e===`none`||e===`0`||we(e)}var Gi=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function Ki(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(wt)||[];if(!r)return e;let i=n.replace(r,``),a=+!!Gi.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var qi=/\b([a-z-]*)\(.*?\)/gu,Ji={...j,getAnimatableNone:e=>{let t=e.match(qi);return t?t.map(Ki).join(` `):e}},Yi={...j,getAnimatableNone:e=>{let t=j.parse(e);return j.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},Xi={...bt,transform:Math.round},Zi={borderWidth:k,borderTopWidth:k,borderRightWidth:k,borderBottomWidth:k,borderLeftWidth:k,borderRadius:k,borderTopLeftRadius:k,borderTopRightRadius:k,borderBottomRightRadius:k,borderBottomLeftRadius:k,width:k,maxWidth:k,height:k,maxHeight:k,top:k,right:k,bottom:k,left:k,inset:k,insetBlock:k,insetBlockStart:k,insetBlockEnd:k,insetInline:k,insetInlineStart:k,insetInlineEnd:k,padding:k,paddingTop:k,paddingRight:k,paddingBottom:k,paddingLeft:k,paddingBlock:k,paddingBlockStart:k,paddingBlockEnd:k,paddingInline:k,paddingInlineStart:k,paddingInlineEnd:k,margin:k,marginTop:k,marginRight:k,marginBottom:k,marginLeft:k,marginBlock:k,marginBlockStart:k,marginBlockEnd:k,marginInline:k,marginInlineStart:k,marginInlineEnd:k,fontSize:k,backgroundPositionX:k,backgroundPositionY:k,rotate:Ft,pathRotation:Ft,rotateX:Ft,rotateY:Ft,rotateZ:Ft,scale:St,scaleX:St,scaleY:St,scaleZ:St,skew:Ft,skewX:Ft,skewY:Ft,distance:k,translateX:k,translateY:k,translateZ:k,x:k,y:k,z:k,perspective:k,transformPerspective:k,opacity:xt,originX:zt,originY:zt,originZ:k,zIndex:Xi,fillOpacity:xt,strokeOpacity:xt,numOctaves:Xi},Qi={...Zi,color:A,backgroundColor:A,outlineColor:A,fill:A,stroke:A,borderColor:A,borderTopColor:A,borderRightColor:A,borderBottomColor:A,borderLeftColor:A,filter:Ji,WebkitFilter:Ji,mask:Yi,WebkitMask:Yi},$i=e=>Qi[e],ea=new Set([Ji,Yi]);function ta(e,t){let n=$i(e);return ea.has(n)||(n=j),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var na=new Set([`auto`,`none`,`0`]);function ra(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!na.has(t)&&Yt(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=ta(n,i)}var ia=class extends Er{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),_t(r))){let i=wi(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!Oi.has(n)||e.length!==2)return;let[r,i]=e,a=Ui(r),o=Ui(i);if(yt(r)!==yt(i)&&vr[n]){this.needsMeasurement=!0;return}if(a!==o)if(mr(a)&&mr(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else vr[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||Wi(e[t]))&&n.push(t);n.length&&ra(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=vr[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&e.getValue(n,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let i=n.length-1,a=n[i];n[i]=vr[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}};function aa(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var oa=(e,t)=>t&&typeof e==`number`?t.transform(e):e,{schedule:sa,cancel:ca}=st(queueMicrotask,!1);function la(e){return Ce(e)&&`ownerSVGElement`in e}function ua(e){return la(e)&&e.tagName===`svg`}var da=[...Hi,A,j],fa=e=>da.find(Vi(e)),pa=0,ma=()=>`motion-view-${pa++}`,ha=e=>e.startsWith(`motion-view-`);function ga(e,t,n){t&&(e.style?.setProperty(`view-transition-class`,t),n.push(e))}function _a(e,t,n,r,i){if(n&&(e.style?.setProperty(`view-transition-group`,n),r.push(e),n!==`none`&&i)){let n=getComputedStyle(e);(n.overflowX!==`visible`||n.overflowY!==`visible`)&&i.add(t)}}function va(e,t,n,r,i,a=[],o,s=[],c){let l=aa(e);if(r)return l.map((e,l)=>{let u=t.get(e);if(u)return u;let d=r[l]??ma();return e.style?.setProperty(`view-transition-name`,d),n.push(e),t.set(e,d),ga(e,i,a),_a(e,d,o,s,c),d});let u=l.map(e=>t.has(e)?void 0:getComputedStyle(e).getPropertyValue(`view-transition-name`));return l.map((e,r)=>{let l=t.get(e);if(l)return l;let d=u[r],f;return d&&d!==`none`&&d!==`auto`&&d!==`match-element`&&!ha(d)?f=d:(f=ma(),e.style?.setProperty(`view-transition-name`,f),n.push(e)),t.set(e,f),ga(e,i,a),_a(e,f,o,s,c),f})}function ya(e,t=[],n=[]){for(let t of e)t.style?.removeProperty(`view-transition-name`);for(let e of t)e.style?.removeProperty(`view-transition-class`);for(let e of n)e.style?.removeProperty(`view-transition-group`)}function ba(e){return e===`layout`?`group`:e===`enter`||e===`new`?`new`:`old`}var xa={},Sa=null,Ca={set:(e,t)=>{xa[e]=t},commit:()=>{Sa||(Sa=document.createElement(`style`),Sa.id=`motion-view`);let e=``;for(let t in xa){let n=xa[t];e+=`${t} {\n`;for(let[t,r]of Object.entries(n))e+=` ${t}: ${r};\n`;e+=`}
|
|
2
|
-
`}Sa.textContent=e,document.head.appendChild(Sa),xa={}},remove:()=>{Sa&&Sa.parentElement&&Sa.parentElement.removeChild(Sa)}};function wa(e){let t=e.match(/::view-transition-(old|new|group-children|group|image-pair)\((.*?)\)/);return t?{layer:t[2],type:t[1]}:null}function Ta(){return document.getAnimations().filter(e=>{let{effect:t}=e;return!!t&&t.target===document.documentElement&&t.pseudoElement?.startsWith(`::view-transition`)})}function Ea(e,t){return t.has(e)&&Object.keys(t.get(e)).length>0}var Da=[`layout`,`enter`,`exit`,`new`,`old`],Oa={group:[`layout`],new:[`new`,`enter`],old:[`old`,`exit`]},ka={new:{opacity:0,scale:.85},old:{opacity:1,scale:1}},Aa=.2;function ja(e){let{update:t,targets:n,resolveDefs:r,cropOverride:i,pairs:a,classNames:o,flatGroups:s,options:c}=e;if(!document.startViewTransition)return(async()=>(await t(),new ri([])))();let l=new Map,u=[],d=[],f=[],p=new Set,m=new Map,h=new Set,g=new Map,_=new Map,v=new Map,y=new Map,b=e=>{n.forEach((t,n)=>{let c=o.get(n),h=n===`root`||!r.has(n)?void 0:s.has(n)?`none`:`contain`,b;if(n===`root`||!r.has(n))b=[n];else if(a.has(n))if(e===`old`)y.set(n,aa(n)),b=va(n,l,u,void 0,c,d,h,f,p),v.set(n,b);else{for(let e of y.get(n)??[])e.style?.removeProperty(`view-transition-name`),l.delete(e);b=va(a.get(n),l,u,v.get(n),c,d,h,f,p)}else b=va(n,l,u,void 0,c,d,h,f,p);let x=i.get(n);b.forEach((n,r)=>{let i=m.get(n);m.set(n,i&&i!==t?{...i,...t}:t),x!==void 0&&g.set(n,x);let a=_.get(n)??{};a[e]=[r,b.length],_.set(n,a)})})},x=(e,t)=>{let n=_.get(e);return(t===`old`?n?.old:t===`new`?n?.new:n?.new??n?.old)??[-1,1]},S=(e,t,n,r,i)=>{let a=Na(pi(c,n),pi(Ma(e,t)??{},n));return typeof a.delay==`function`&&(a.delay=a.delay(r,i)),a},C=new Map,w=e=>l.forEach((t,n)=>{let r=n.getBoundingClientRect?.();if(r&&r.height){let n=C.get(t)??{};n[e]={width:r.width,height:r.height},C.set(t,n)}}),T=()=>{h.clear();for(let e of _.keys())e!==`root`&&(g.get(e)??ee(e))&&h.add(e)},ee=e=>{let t=C.get(e);return!t?.old||!t?.new||!t.old.height||!t.new.height?!1:Math.abs(t.old.width/t.old.height-t.new.width/t.new.height)>Aa},te=()=>{Ea(`root`,n)||Ca.set(`:root`,{"view-transition-name":`none`}),Ca.set(`::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)`,{"animation-timing-function":`linear !important`}),h.forEach(e=>{Ca.set(`::view-transition-group(${e})`,{overflow:`clip`}),Ca.set(`::view-transition-old(${e}), ::view-transition-new(${e})`,{width:`100%`,height:`100%`,"object-fit":`cover`})}),p.forEach(e=>{Ca.set(`::view-transition-group-children(${e})`,{overflow:`clip`})}),Ca.commit()},ne=()=>{ya(u,d,f),Ca.remove()},re=async()=>{await t(),b(`new`),w(`new`),T(),te()},ie;try{b(`old`),w(`old`),te(),ie=document.startViewTransition(re)}catch(e){return ne(),Promise.reject(e)}return ie.finished.finally(ne),new Promise((e,t)=>{ie.ready.then(()=>{let t=Ta(),n=[],r=new Set,i=new Set;m.forEach((e,t)=>{let a=_.get(t),o=!!a?.new&&!a?.old,s=!!a?.old&&!a?.new;for(let a of Da){if(!e[a]||a===`enter`&&!o||a===`exit`&&!s)continue;let l=ba(a),[u,d]=x(t,l);if(u===-1)continue;let{keyframes:f,options:p}=e[a];for(let[m,h]of Object.entries(f)){if(h==null)continue;if(m===`x`||m===`y`){Ne(!1,`animateView() animates view-transition layers with CSS properties; the "${m}" shorthand has no effect - use transform, e.g. { transform: "translateX(40px)" }.`);continue}if(a===`new`&&o&&e.enter?.keyframes[m]!=null||a===`old`&&s&&e.exit?.keyframes[m]!=null)continue;let f=Na(pi(c,m),pi(p,m));if(!Array.isArray(h)){let t=a===`enter`?e.exit?.keyframes[m]:void 0,n=t==null?m===`opacity`||(l===`new`?o:s)?ka[l]?.[m]:void 0:Array.isArray(t)?t[t.length-1]:t;n!==void 0&&(h=[n,h])}typeof f.delay==`function`&&(f.delay=f.delay(u,d)),f.duration&&=D(f.duration),f.delay&&=D(f.delay),n.push(new zr({...f,element:document.documentElement,name:m,pseudoElement:`::view-transition-${l}(${t})`,keyframes:h})),r.add(`${t}:${l}`),m===`opacity`&&i.add(`${t}:${l}`)}}});for(let e of t){if(e.playState===`finished`)continue;let{effect:t}=e;if(!t||!(t instanceof KeyframeEffect))continue;let{pseudoElement:a}=t;if(!a)continue;let o=wa(a);if(!o)continue;let s=m.get(o.layer);if(r.has(`${o.layer}:${o.type}`)){i.has(`${o.layer}:new`)&&i.has(`${o.layer}:old`)&&t.getKeyframes().some(e=>e.mixBlendMode)?n.push(new oi(e)):e.cancel();continue}let c=_.get(o.layer),l=(o.type===`old`||o.type===`new`)&&!!c?.old&&!!c?.new,u=o.type.startsWith(`group`)||l?`group`:o.type,[d,f]=x(o.layer,u),p=S(s,u,u===`group`?`layout`:``,d===-1?0:d,f),h=p.visualDuration;p.duration&&=D(p.duration),p=Rr(p);let g=l&&h!==void 0?D(h):p.duration,v=l?`linear`:Fr(p.ease,p.duration);t.updateTiming({delay:D(p.delay??0),duration:g,easing:v}),n.push(new oi(e))}e(new ri(n))}).catch(()=>ie.updateCallbackDone.then(()=>e(new ri([])),t))})}function Ma(e,t){for(let n of Oa[t]??[]){let t=e?.[n]?.options;if(t)return t}}function Na(e,t){let n={...e,...t};return t.duration!==void 0&&(t.visualDuration===void 0&&delete n.visualDuration,t.type===void 0&&delete n.type),n}var Pa=[],Fa=null;function Ia(){Fa=null;let[e]=Pa;e&&La(e)}function La(e){ve(Pa,e),Fa=e,ja(e).then(t=>(e.notifyReady(t),t.finished)).catch(t=>e.notifyReject(t)).finally(Ia)}function Ra(){for(let e=Pa.length-1;e>=0;e--){let t=Pa[e],{interrupt:n}=t.options;if(n===`immediate`){let n=Pa.slice(0,e+1).map(e=>e.update),r=Pa.slice(e+1);t.update=()=>{n.forEach(e=>e())},Pa=[t,...r];break}}(!Fa||Pa[0]?.options.interrupt===`immediate`)&&Ia()}function za(e){Pa.push(e),sa.render(Ra)}var Ba=class{constructor(e,t={}){this.currentSubject=`root`,this.targets=new Map,this.resolveDefs=new Set,this.cropOverride=new Map,this.pairs=new Map,this.classNames=new Map,this.flatGroups=new Set,this.notifyReady=Ee,this.notifyReject=Ee,this.readyPromise=new Promise((e,t)=>{this.notifyReady=e,this.notifyReject=t}),this.update=e,this.options={interrupt:`wait`,...t},this.readyPromise.catch(Ee),za(this)}add(e,t){return this.currentSubject=e,this.resolveDefs.add(e),t!==void 0&&this.pairs.set(e,t),this.targets.has(e)||this.targets.set(e,{}),this}crop(e=!0){return this.cropOverride.set(this.currentSubject,e),this}group(e=!0){return e?this.flatGroups.delete(this.currentSubject):this.flatGroups.add(this.currentSubject),this}class(e){return this.classNames.set(this.currentSubject,e),this}layout(e={}){return this.updateTarget(`layout`,{},e),this}enter(e,t){return this.updateTarget(`enter`,e,t),this}exit(e,t){return this.updateTarget(`exit`,e,t),this}new(e,t){return this.updateTarget(`new`,e,t),this}old(e,t){return this.updateTarget(`old`,e,t),this}updateTarget(e,t,n={}){let{currentSubject:r,targets:i}=this;i.has(r)||i.set(r,{});let a=i.get(r);a[e]={keyframes:t,options:n}}then(e,t){return this.readyPromise.then(e,t)}};function Va(e,t={}){return new Ba(e,t)}var Ha=()=>({min:0,max:0}),Ua=()=>({x:Ha(),y:Ha()}),Wa=new WeakMap;function Ga(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function Ka(e){return typeof e==`string`||Array.isArray(e)}var qa=[`initial`,`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`];function Ja(e){return Ga(e.animate)||qa.some(t=>Ka(e[t]))}function Ya(e){return!!(Ja(e)||e.variants)}function Xa(e,t,n){for(let r in t){let i=t[r],a=n[r];if(N(i))e.addValue(r,i);else if(N(a))e.addValue(r,di(i,{owner:e}));else if(a!==i)if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,di(t===void 0?i:t,{owner:e}))}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var Za={current:null},Qa={current:!1},$a=typeof window<`u`;function eo(){if(Qa.current=!0,$a)if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>Za.current=e.matches;e.addEventListener(`change`,t),t()}else Za.current=!1}var to=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],no={},ro=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Er,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=O.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,ct.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=Ja(t),this.isVariantNode=Ya(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&N(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];this.current=e,Wa.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(Qa.current||eo(),this.shouldReduceMotion=Za.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),lt(this.notifyUpdate),lt(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&Yr.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new zr({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:D(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=pr.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&ct.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in no){let t=no[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ua()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<to.length;t++){let n=to[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=Xa(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=di(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(Se(n)||we(n))?n=parseFloat(n):!fa(n)&&j.test(t)&&(n=ta(e,t)),this.setBaseTarget(e,N(n)?n.get():n)),N(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=Ei(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!N(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new ke),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){sa.render(this.render)}},io=class extends ro{constructor(){super(...arguments),this.KeyframeResolver=ia}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;N(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}};function ao({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function oo(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function so(e,t){return ao(oo(e.getBoundingClientRect(),t))}var co={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},lo=fr.length;function uo(e,t,n){let r=``,i=!0;for(let a=0;a<lo;a++){let o=fr[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=oa(s,Zi[o]);if(!c){i=!1;let t=co[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${oa(a,Zi.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function fo(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(pr.has(e)){o=!0;continue}else if(ht(e)){i[e]=n;continue}else{let t=oa(n,Zi[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=uo(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}function po(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function mo(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var ho={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`)if(k.test(e))e=parseFloat(e);else return e;return`${mo(e,t.target.x)}% ${mo(e,t.target.y)}%`}},go={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=j.parse(e);if(i.length>5)return r;let a=j.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=on(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},_o={borderRadius:{...ho,applyTo:[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`]},borderTopLeftRadius:ho,borderTopRightRadius:ho,borderBottomLeftRadius:ho,borderBottomRightRadius:ho,boxShadow:go};function vo(e,{layout:t,layoutId:n}){return pr.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!_o[e]||e===`opacity`)}function yo(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(N(r[t])||i&&N(i[t])||vo(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function bo(e){return window.getComputedStyle(e)}var xo=class extends io{constructor(){super(...arguments),this.type=`html`,this.renderInstance=po}readValueFromInstance(e,t){if(pr.has(t))return this.projection?.isProjecting?cr(t):ur(e,t);{let n=bo(e),r=(ht(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return so(e,t)}build(e,t,n){fo(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return yo(e,t,n)}};function So(e,t){return e in t}var Co=class extends ro{constructor(){super(...arguments),this.type=`object`}readValueFromInstance(e,t){if(So(t,e)){let n=e[t];if(typeof n==`string`||typeof n==`number`)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(e,t){delete t.output[e]}measureInstanceViewportBox(){return Ua()}build(e,t){Object.assign(e.output,t)}renderInstance(e,{output:t}){Object.assign(e,t)}sortInstanceNodePosition(){return 0}},wo={offset:`stroke-dashoffset`,array:`stroke-dasharray`},To={offset:`strokeDashoffset`,array:`strokeDasharray`};function Eo(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?wo:To;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var Do=[`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function Oo(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(fo(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox);for(let e of Do)d[e]!==void 0&&(f[e]=d[e],delete d[e]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&Eo(d,i,a,o,!1)}var ko=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),Ao=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function jo(e,t,n,r){po(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(ko.has(n)?n:Fi(n),t.attrs[n])}function Mo(e,t,n){let r=yo(e,t,n);for(let n in e)if(N(e[n])||N(t[n])){let t=fr.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var No=class extends io{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=Ua}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(pr.has(t)){let e=$i(t);return e&&e.default||0}return t=ko.has(t)?t:Fi(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return Mo(e,t,n)}build(e,t,n){Oo(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){jo(e,t,n,r)}mount(e){this.isSVGTag=Ao(e.tagName),super.mount(e)}};function Po(e,t,n){let r=N(e)?e:di(e);return r.start(xi(``,r,t,n)),r.animation}function Fo(e){return typeof e==`object`&&!Array.isArray(e)}function Io(e,t,n,r){return e==null?[]:typeof e==`string`&&Fo(t)?aa(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>e!=null):[e]}function Lo(e,t,n){return e*(t+1)+n*t}function Ro(e,t,n,r){return typeof t==`number`?t:t.startsWith(`-`)||t.startsWith(`+`)?Math.max(0,e+parseFloat(t)):t===`<`?n:t.startsWith(`<`)?Math.max(0,n+parseFloat(t.slice(1))):r.get(t)??e}function zo(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];i.at>t&&i.at<n&&(ve(e,i),r--)}}function Bo(e,t,n,r,i,a){zo(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:on(i,a,r[o]),easing:$e(n,o)})}function Vo(e,t,n=0){let r=t+1+t*n;for(let t=0;t<e.length;t++)e[t]=e[t]/r}function Ho(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var Uo=`easeInOut`,Wo=20;function Go(e,{defaultTransition:t={},...n}={},r,i){let a=t.duration||.3,o=new Map,s=new Map,c={},l=new Map,u=0,d=0,f=0;for(let n=0;n<e.length;n++){let o=e[n];if(typeof o==`string`){l.set(o,d);continue}else if(!Array.isArray(o)){l.set(o.name,Ro(d,o.at,u,l));continue}let[p,m,h={}]=o;h.at!==void 0&&(d=Ro(d,h.at,u,l));let g=0,_=(e,n,r,o=0,s=0)=>{let c=Jo(e),{delay:l=0,times:u=Hn(c),type:p=t.type||`keyframes`,repeat:m,repeatType:h,repeatDelay:_=0,...v}=n,{ease:y=t.ease||`easeOut`,duration:b}=n,x=typeof l==`function`?l(o,s):l,S=c.length,C=Lr(p)?p:i?.[p||`keyframes`];if(S<=2&&C){let e=100;if(S===2&&Zo(c)){let t=c[1]-c[0];e=Math.abs(t)}let n={...t,...v};b!==void 0&&(n.duration=D(b));let r=Tn(n,e,C);y=r.ease,b=r.duration}b??=a;let w=d+x;u.length===1&&u[0]===0&&(u[1]=1);let T=u.length-c.length;if(T>0&&Vn(u,T),c.length===1&&c.unshift(null),m&&`${m}${Wo}`,m&&m<Wo){let e=b>0?_/b:0;b=Lo(b,m,_);let t=[...c],n=[...u];y=Array.isArray(y)?[...y]:[y];let r=[...y],i=h===`reverse`||h===`mirror`,a=t,o=r;i&&(a=[...t].reverse(),h===`reverse`&&(o=[...r].reverse().map(e=>typeof e==`function`?Ve(e):e)));for(let s=0;s<m;s++){let l=i&&s%2==0,d=l?a:t,f=l?o:r,p=(s+1)*(1+e);e>0&&(c.push(c[c.length-1]),u.push(p),y.push(`linear`)),c.push(...d);for(let e=0;e<d.length;e++)u.push(n[e]+p),y.push(e===0?`linear`:$e(f,e-1))}Vo(u,m,e)}let ee=w+b;Bo(r,c,y,u,w,ee),g=Math.max(x+b,g),f=Math.max(ee,f)};if(N(p)){let e=Ko(p,s);_(m,h,qo(`default`,e))}else{let e=Io(p,m,r,c),t=e.length;for(let n=0;n<t;n++){m=m,h=h;let r=e[n],i=Ko(r,s);for(let e in m)_(m[e],Yo(h,e),qo(e,i),n,t)}}u=d,d+=g}return s.forEach((e,r)=>{for(let i in e){let a=e[i];a.sort(Ho);let s=[],c=[],l=[];for(let e=0;e<a.length;e++){let{at:t,value:n,easing:r}=a[e];s.push(n),c.push(Oe(0,f,t)),l.push(r||`easeOut`)}c[0]!==0&&(c.unshift(0),s.unshift(s[0]),l.unshift(Uo)),c[c.length-1]!==1&&(c.push(1),s.push(null)),o.has(r)||o.set(r,{keyframes:{},transition:{}});let u=o.get(r);u.keyframes[i]=s;let{type:d,...p}=t;u.transition[i]={...p,duration:f,ease:l,times:c,...n}}}),o}function Ko(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function qo(e,t){return t[e]||(t[e]=[]),t[e]}function Jo(e){return Array.isArray(e)?e:[e]}function Yo(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var Xo=e=>typeof e==`number`,Zo=e=>e.every(Xo);function Qo(e){let t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=la(e)&&!ua(e)?new No(t):new xo(t);n.mount(e),Wa.set(e,n)}function $o(e){let t=new Co({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});t.mount(e),Wa.set(e,t)}function es(e,t){return N(e)||typeof e==`number`||typeof e==`string`&&!Fo(t)}function ts(e,t,n,r){let i=[];if(es(e,t))i.push(Po(e,Fo(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;let a=Io(e,t,r),o=a.length;for(let e=0;e<o;e++){let r=a[e],s=r instanceof Element?Qo:$o;Wa.has(r)||s(r);let c=Wa.get(r),l={...n};`delay`in l&&typeof l.delay==`function`&&(l.delay=l.delay(e,o)),i.push(...zi(c,{...t,transition:l},{}))}}return i}function ns(e,t,n){let r=[];return Go(e.map(e=>{if(Array.isArray(e)&&typeof e[0]==`function`){let t=e[0],n=di(0);return n.on(`change`,t),e.length===1?[n,[0,1]]:e.length===2?[n,[0,1],e[1]]:[n,e[1],e[2]]}return e}),t,n,{spring:Fn}).forEach(({keyframes:e,transition:t},n)=>{r.push(...ts(n,e,t))}),r}function rs(e){return Array.isArray(e)&&e.some(Array.isArray)}function is(e={}){let{scope:t,reduceMotion:n,skipAnimations:r}=e;function i(e,i,a){let o=[],s,c={};if(n!==void 0&&(c.reduceMotion=n),r!==void 0&&(c.skipAnimations=r),rs(e)){let{onComplete:n,...r}=i||{};typeof n==`function`&&(s=n),o=ns(e,{...c,...r},t)}else{let{onComplete:n,...r}=a||{};typeof n==`function`&&(s=n),o=ts(e,i,{...c,...r},t)}let l=new ai(o);return s&&l.finished.then(s),t&&(t.animations.push(l),l.finished.then(()=>{ve(t.animations,l)})),l}return i}var as=is(),os=e=>({finished:(async()=>{await e?.()})(),cancel(){},stop(){},complete(){}}),ss=(e,t)=>{let n=!1,r=()=>{n||(n=!0,t?.())};return{finished:e.finished.then(()=>{},()=>{}).finally(r),cancel(){e.cancel(),r()},stop(){e.stop(),r()},complete(){e.complete(),r()}}},cs=(e,t)=>{let n=typeof e==`object`&&e&&`get`in e?e:di(e);return{value:n,animateTo(e,r){return ss(as(n,e,{...t,...r}))}}},ls=(...e)=>({finished:Promise.allSettled(e.map(e=>e.finished)).then(()=>{}),cancel(){e.forEach(e=>e.cancel())},stop(){e.forEach(e=>e.stop())},complete(){e.forEach(e=>e.complete())}}),us=(...e)=>{let t=!1,n=null;return{finished:(async()=>{for(let r of e){if(t)break;n=r(),await n.finished.catch(()=>{})}})(),cancel(){t=!0,n?.cancel()},stop(){t=!0,n?.stop()},complete(){n?.complete()}}},ds=(e,t,n,r=e=>String(e))=>{let i=n=>{e.style[t]=r(n)};return i(n.get()),n.on(`change`,i)},fs=(e,t,n)=>{let r=()=>{e.style.transform=n(t)},i=Object.values(t).map(e=>e.on(`change`,r));return r(),()=>i.forEach(e=>e())},P={fast:.14,normal:.18,slow:.24},F={out:[.23,1,.32,1],inOut:[.77,0,.175,1]},ps={popover:{duration:P.fast,ease:F.out},modal:{duration:P.slow,ease:F.out},toast:{duration:P.normal,ease:F.out},sidebar:{duration:P.slow,ease:F.out}},ms=`(prefers-reduced-motion: reduce)`,hs=()=>typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(ms).matches,gs=(e=`user`)=>e===`always`?!0:e===`never`?!1:hs(),_s=(e,t={},n=`user`)=>gs(n)?{...e,duration:0,...t}:e,vs=e=>{let t={};return`opacity`in e&&(t.opacity=e.opacity),t},ys=`data-ui-motion-key`,bs=`data-ui-motion-layout`,xs=`data-ui-motion-temp`,Ss=`data-ui-motion-active`,Cs=e=>typeof e==`object`&&!!e&&Symbol.iterator in e,ws=e=>{let t=globalThis.CSS;return typeof t?.escape==`function`?t.escape(e):e.replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`)},Ts=(e=document)=>typeof e==`string`?Array.from(document.querySelectorAll(e)):e instanceof Document||e instanceof Element?[e]:Cs(e)?Array.from(e):[document],Es=(e,t)=>Ts(e).flatMap(e=>Array.from(e.querySelectorAll(t))),Ds=e=>`[${ys}="${ws(e)}"]`,Os=e=>`[data-ui-${ws(e)}]`,ks=e=>e instanceof Element?null:typeof e==`string`?e:`selector`in e?e.selector:`part`in e?Os(e.part):`key`in e?Ds(e.key):null,As=(e=document,t)=>{if(!t)return[];let n=(Array.isArray(t)?t:[t]).flatMap(t=>{if(t instanceof Element)return[t];if(typeof t==`object`&&`from`in t)return[...As(e,t.from),...As(e,t.to)];let n=ks(t);return n?Es(e,n):[]});return Array.from(new Set(n))},js=(e,t)=>{if(e instanceof Element)return[e];let n=ks(e);return n?typeof e==`string`||`selector`in e||`key`in e||`part`in e?[n]:As(t,e):[]},Ms=(e=document,t)=>t?(Array.isArray(t)?t:[t]).flatMap(t=>{if(t instanceof Element)return[{subject:t}];if(typeof t==`object`&&`from`in t){let n=js(t.from,e),r=js(t.to,e);return n.flatMap((e,t)=>{let n=r[t]??r[0];return n?[{subject:e,newSubject:n}]:[]})}let n=ks(t);return n?[{subject:n}]:[]}):[],Ns=(e=document,t={})=>{let n=Ts(e).filter(e=>e instanceof Element),r=[],i=(e,t,n)=>{r.push({element:e,attr:t,previous:e.getAttribute(t)}),e.setAttribute(t,n)};return n.forEach(e=>{let n=!1;(t.layout??!0)&&i(e,bs,``),t.key&&!e.hasAttribute(`data-ui-motion-key`)&&(i(e,ys,t.key),n=!0),n&&i(e,xs,``)}),()=>{r.reverse().forEach(({element:e,attr:t,previous:n})=>{if(n===null){e.removeAttribute(t);return}e.setAttribute(t,n)})}},Ps=e=>{let t=e.getAttribute(`data-side`),n=e.getAttribute(`data-align`);return`${t===`left`?`right`:t===`right`?`left`:n===`end`?`right`:n===`start`?`left`:`center`} ${t===`top`?`bottom`:t===`bottom`?`top`:`center`}`},Fs=e=>typeof e==`string`,Is=(e,t,n)=>{if(t===`fade`)return{opacity:e===`enter`?[0,1]:[1,0]};if(t===`sidebar`){let t=n?.dataset.side===`right`?`translateX(100%)`:`translateX(-100%)`;return e===`enter`?{transform:[t,`translateX(0)`]}:{transform:[`translateX(0)`,t]}}if(t===`toast`){let t=n?.style,r=Number.parseFloat(t?.getPropertyValue(`--ui-toast-stack-offset`)||`0`)||0,i=Number.parseFloat(t?.getPropertyValue(`--ui-toast-stack-scale`)||`1`)||1,a=Number.parseFloat(t?.getPropertyValue(`--ui-toast-stack-direction`)||`1`)||1,o=Number.parseFloat(t?.getPropertyValue(`--ui-toast-stack-opacity`)||`1`)||1,s=(e,t)=>`translateY(${r+e*a}px) scale(${i*t})`;return e===`enter`?{opacity:[0,o],transform:[s(8,.98),s(0,1)]}:{opacity:[o,0],transform:[s(0,1),s(-4,.98)]}}return t===`modal`?e===`enter`?{opacity:[0,1],transform:[`translateY(8px) scale(0.98)`,`translateY(0) scale(1)`]}:{opacity:[1,0],transform:[`translateY(0) scale(1)`,`translateY(4px) scale(0.98)`]}:e===`enter`?{opacity:[0,1],transform:[`scale(0.97)`,`scale(1)`]}:{opacity:[1,0],transform:[`scale(1)`,`scale(0.97)`]}},Ls=(e,t,n=`fade`,r={})=>{if(!(e instanceof HTMLElement))return{finished:Promise.resolve(),cancel(){},stop(){},complete(){}};let{reducedMotion:i,...a}=r,o=e.style.transformOrigin;(n===`popover`||n===`menu`)&&(e.style.transformOrigin=Ps(e)),e.setAttribute(Ss,t);let s=gs(i),c=Fs(n)?Is(t,n,e):n,l=s?vs(c):c,u=!Fs(n)||n===`menu`?`popover`:n,d=u===`fade`?{duration:P.fast,ease:F.out}:ps[u];return ss(as(e,l,{...d,duration:s?.08:d.duration,...a}),()=>{e.style.transformOrigin=o,e.getAttribute(`data-ui-motion-active`)===t&&e.removeAttribute(Ss)})},Rs=({element:e,preset:t=`fade`,enter:n,exit:r,options:i,enterOptions:a,exitOptions:o,owner:s=`component`})=>{let c=null,l=0,u=(u,d={})=>{let f=++l;c?.cancel(),c=null,d.before?.();let p=e();if(!(p instanceof Element))return d.after?.(),{finished:Promise.resolve(),cancel(){},stop(){},complete(){}};s===`component`&&p.setAttribute(`data-ui-motion-owner`,`component`);let m=u===`enter`?n??t:r??t,h=u===`enter`?a:o,g=Ls(p,u,m,{...i,...h});return c=g,g.finished.finally(()=>{f!==l||c!==g||(c=null,d.after?.())}),g},d=()=>{l+=1,c?.cancel(),c=null};return{get runId(){return l},enter(e){return u(`enter`,e)},exit(e){return u(`exit`,e)},cancel:d,destroy:d}},zs={duration:P.slow,ease:F.inOut},Bs={transform:[`none`,`none`]},Vs=`[${ys}], [${bs}]`,Hs=(e,t,n={})=>{if(typeof document.startViewTransition!=`function`||gs(n.reducedMotion))return os(e);let r=t??(n.layout||n.preset===`layout`?Vs:null),i=Ms(n.scope??document,r),a=Va(e,{duration:P.normal,ease:F.inOut,interrupt:`immediate`,...n.transition});return i.forEach(({subject:e,newSubject:t})=>{a.add(e,t),n.className&&a.class(n.className),typeof n.crop==`boolean`&&a.crop(n.crop),typeof n.group==`boolean`&&a.group(n.group),n.layout!==!1&&n.preset!==`none`&&a.layout(typeof n.layout==`object`?n.layout:zs);let r=n.newView??(n.preset===`stream`?Bs:void 0),i=n.oldView??(n.preset===`stream`?Bs:void 0),o=n.enter,s=n.exit;r&&a.new(r,{duration:P.fast,ease:F.out}),i&&a.old(i,{duration:P.fast,ease:F.out}),o&&a.enter(o,{duration:P.fast,ease:F.out}),s&&a.exit(s,{duration:P.fast,ease:F.out})}),{finished:Promise.resolve(a.then(()=>{},()=>{})),cancel(){Ta().forEach(e=>e.cancel())},stop(){Ta().forEach(e=>e.pause())},complete(){Ta().forEach(e=>{try{e.finish()}catch{e.cancel()}})}}},Us=e=>e.selector?e.selector:e.target?e.target.startsWith(`#`)?e.target:`#${ws(e.target)}`:null,Ws=e=>{let t=getComputedStyle(e);return[t.overflow,t.overflowX,t.overflowY].some(e=>e&&e!==`visible`)},Gs=e=>{let t=e.parentElement;for(;t&&t!==document.body&&t!==document.documentElement;){if(Ws(t))return t;t=t.parentElement}return null},Ks=e=>e.width===0&&e.height===0&&e.top===0&&e.left===0,qs=e=>{let t=Gs(e);if(!t)return!0;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect();if(Ks(n)&&Ks(r))return!0;let i=Math.min(n.height,160);return n.top>=r.top&&n.left<r.right&&n.right>r.left&&n.bottom+i<=r.bottom},Js=e=>{let t=[];return e.forEach(e=>{let n=Us(e),r=n?document.querySelector(n):null;if(!r)return;let i=[],a=r.getAttribute(`data-ui-motion-key`);if(r.querySelectorAll(`[data-ui-motion-key]`).forEach(e=>{let t=e.getAttribute(`data-ui-motion-key`);if(t&&qs(e)){let e=Ds(t);i.push({from:{selector:e},to:{selector:e}})}}),(a||r.hasAttribute(`data-ui-motion-layout`))&&qs(r)){let e=a?Ds(a):n;i.unshift({from:{selector:e},to:{selector:e}})}t.push(...i)}),t},Ys=(e,t,n={})=>{let r=n.update;if(!r)return os();let i=Js(Array.isArray(t)?t:[t]);if(i.length===0||gs(n.reducedMotion))return os(r);let a={...n,preset:`stream`};return n.scope&&n.scope!==`target`&&(a.scope=n.scope),Hs(r,i,a)},Xs={createAnimator:cs,parallel:ls,sequential:us,bindTransform:fs,bindStyle:ds,withReducedMotion:_s,resolveTargets:As,applyViewKeys:Ns,animateView:Hs,animatePresence:Ls,createPresenceLifecycle:Rs,animateStreamPatch:Ys},Zs=(e,t)=>{if(!(!e||typeof t.evaluate!=`function`))return t.evaluate(e)},Qs=e=>{if(typeof e==`string`)return{key:e};if(typeof e==`object`&&e){let t=e.key??e.id;return t?{key:t}:{}}return{}},$s=e=>{e.directive(`ui-layout`,(e,{expression:t},n)=>{if(!(e instanceof Element))return;let r=Ns(e,Qs(Zs(t,n)));n.cleanup?.(()=>{r()})})},ec=e=>{e.bind(`UiDisabled`,function(){let e=this;return{":aria-disabled"(){return e.props.disabled?`true`:null},":data-disabled"(){return e.props.disabled?`true`:null}}}),e.bind(`UiInvalid`,function(){let e=this;return{":aria-invalid"(){return e.props.invalid?`true`:null},":aria-describedby"(){return e.describedBy||null},":data-invalid"(){return e.props.invalid?`true`:null}}}),e.bind(`UiInteractive`,function(){let e=this;return{":data-ui-interactive"(){return e.isInteractive??e.props?.interactive?e.interactiveKind||`true`:null}}}),e.bind(`UiSelected`,function(){let e=this;return{":aria-selected"(){return e.isSelected?`true`:`false`},":data-selected"(){return e.isSelected?`true`:null}}}),e.bind(`UiActiveDescendant`,function(){let e=this;return{":aria-activedescendant"(){return e.activeId}}})},tc=e=>{ge(e),$s(e),ec(e)},nc=Math.min,rc=Math.max,ic=Math.round,ac=Math.floor,oc=e=>({x:e,y:e}),sc={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function cc(e,t,n){return rc(e,nc(t,n))}function lc(e,t){return typeof e==`function`?e(t):e}function uc(e){return e.split(`-`)[0]}function dc(e){return e.split(`-`)[1]}function fc(e){return e===`x`?`y`:`x`}function pc(e){return e===`y`?`height`:`width`}function mc(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function hc(e){return fc(mc(e))}function gc(e,t,n){n===void 0&&(n=!1);let r=dc(e),i=hc(e),a=pc(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Tc(o)),[o,Tc(o)]}function _c(e){let t=Tc(e);return[vc(e),t,vc(t)]}function vc(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var yc=[`left`,`right`],bc=[`right`,`left`],xc=[`top`,`bottom`],Sc=[`bottom`,`top`];function Cc(e,t,n){switch(e){case`top`:case`bottom`:return n?t?bc:yc:t?yc:bc;case`left`:case`right`:return t?xc:Sc;default:return[]}}function wc(e,t,n,r){let i=dc(e),a=Cc(uc(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(vc)))),a}function Tc(e){let t=uc(e);return sc[t]+e.slice(t.length)}function Ec(e){return{top:0,right:0,bottom:0,left:0,...e}}function Dc(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Ec(e)}function Oc(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function kc(e,t,n){let{reference:r,floating:i}=e,a=mc(t),o=hc(t),s=pc(o),c=uc(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(dc(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function Ac(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=lc(t,e),p=Dc(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Oc(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Oc(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var jc=50,Mc=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Ac},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=kc(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<jc&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=kc(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Nc=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=lc(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=uc(r),_=mc(o),v=uc(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Tc(o)]:_c(o)),x=p!==`none`;!d&&x&&b.push(...wc(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=gc(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==mc(t))||T.every(e=>mc(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=mc(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}},Pc=new Set([`left`,`top`]);async function Fc(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=uc(n),s=dc(n),c=mc(n)===`y`,l=Pc.has(o)?-1:1,u=a&&c?-1:1,d=lc(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Ic=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Fc(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Lc=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=lc(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=mc(uc(i)),p=fc(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=cc(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=cc(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}};function Rc(){return typeof window<`u`}function zc(e){return Vc(e)?(e.nodeName||``).toLowerCase():`#document`}function I(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Bc(e){return((Vc(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Vc(e){return Rc()?e instanceof Node||e instanceof I(e).Node:!1}function L(e){return Rc()?e instanceof Element||e instanceof I(e).Element:!1}function Hc(e){return Rc()?e instanceof HTMLElement||e instanceof I(e).HTMLElement:!1}function Uc(e){return!Rc()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof I(e).ShadowRoot}function Wc(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=R(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Gc(e){return/^(table|td|th)$/.test(zc(e))}function Kc(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var qc=/transform|translate|scale|rotate|perspective|filter/,Jc=/paint|layout|strict|content/,Yc=e=>!!e&&e!==`none`,Xc;function Zc(e){let t=L(e)?R(e):e;return Yc(t.transform)||Yc(t.translate)||Yc(t.scale)||Yc(t.rotate)||Yc(t.perspective)||!$c()&&(Yc(t.backdropFilter)||Yc(t.filter))||qc.test(t.willChange||``)||Jc.test(t.contain||``)}function Qc(e){let t=nl(e);for(;Hc(t)&&!el(t);){if(Zc(t))return t;if(Kc(t))return null;t=nl(t)}return null}function $c(){return Xc??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Xc}function el(e){return/^(html|body|#document)$/.test(zc(e))}function R(e){return I(e).getComputedStyle(e)}function tl(e){return L(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function nl(e){if(zc(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Uc(e)&&e.host||Bc(e);return Uc(t)?t.host:t}function rl(e){let t=nl(e);return el(t)?e.ownerDocument?e.ownerDocument.body:e.body:Hc(t)&&Wc(t)?t:rl(t)}function il(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=rl(e),i=r===e.ownerDocument?.body,a=I(r);if(i){let e=al(a);return t.concat(a,a.visualViewport||[],Wc(r)?r:[],e&&n?il(e):[])}else return t.concat(r,il(r,[],n))}function al(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ol(e){let t=R(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Hc(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=ic(n)!==a||ic(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function sl(e){return L(e)?e:e.contextElement}function cl(e){let t=sl(e);if(!Hc(t))return oc(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=ol(t),o=(a?ic(n.width):n.width)/r,s=(a?ic(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var ll=oc(0);function ul(e){let t=I(e);return!$c()||!t.visualViewport?ll:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function dl(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==I(e)?!1:t}function fl(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=sl(e),o=oc(1);t&&(r?L(r)&&(o=cl(r)):o=cl(e));let s=dl(a,n,r)?ul(a):oc(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=I(a),t=r&&L(r)?I(r):r,n=e,i=al(n);for(;i&&r&&t!==n;){let e=cl(i),t=i.getBoundingClientRect(),r=R(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=I(i),i=al(n)}}return Oc({width:u,height:d,x:c,y:l})}function pl(e,t){let n=tl(e).scrollLeft;return t?t.left+n:fl(Bc(e)).left+n}function ml(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-pl(e,n),y:n.top+t.scrollTop}}function hl(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Bc(r),s=t?Kc(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=oc(1),u=oc(0),d=Hc(r);if((d||!d&&!a)&&((zc(r)!==`body`||Wc(o))&&(c=tl(r)),d)){let e=fl(r);l=cl(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?ml(o,c):oc(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function gl(e){return Array.from(e.getClientRects())}function _l(e){let t=Bc(e),n=tl(e),r=e.ownerDocument.body,i=rc(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=rc(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+pl(e),s=-n.scrollTop;return R(r).direction===`rtl`&&(o+=rc(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var vl=25;function yl(e,t){let n=I(e),r=Bc(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=$c();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=pl(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=vl&&(a-=o)}else l<=vl&&(a+=l);return{width:a,height:o,x:s,y:c}}function bl(e,t){let n=fl(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Hc(e)?cl(e):oc(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function xl(e,t,n){let r;if(t===`viewport`)r=yl(e,n);else if(t===`document`)r=_l(Bc(e));else if(L(t))r=bl(t,n);else{let n=ul(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Oc(r)}function Sl(e,t){let n=nl(e);return n===t||!L(n)||el(n)?!1:R(n).position===`fixed`||Sl(n,t)}function Cl(e,t){let n=t.get(e);if(n)return n;let r=il(e,[],!1).filter(e=>L(e)&&zc(e)!==`body`),i=null,a=R(e).position===`fixed`,o=a?nl(e):e;for(;L(o)&&!el(o);){let t=R(o),n=Zc(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||Wc(o)&&!n&&Sl(e,o))?r=r.filter(e=>e!==o):i=t,o=nl(o)}return t.set(e,r),r}function wl(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Kc(t)?[]:Cl(t,this._c):[].concat(n),r],o=xl(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=xl(t,a[e],i);s=rc(n.top,s),c=nc(n.right,c),l=nc(n.bottom,l),u=rc(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Tl(e){let{width:t,height:n}=ol(e);return{width:t,height:n}}function El(e,t,n){let r=Hc(t),i=Bc(t),a=n===`fixed`,o=fl(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=oc(0);function l(){c.x=pl(i)}if(r||!r&&!a)if((zc(t)!==`body`||Wc(i))&&(s=tl(t)),r){let e=fl(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?ml(i,s):oc(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Dl(e){return R(e).position===`static`}function Ol(e,t){if(!Hc(e)||R(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Bc(e)===n&&(n=n.ownerDocument.body),n}function kl(e,t){let n=I(e);if(Kc(e))return n;if(!Hc(e)){let t=nl(e);for(;t&&!el(t);){if(L(t)&&!Dl(t))return t;t=nl(t)}return n}let r=Ol(e,t);for(;r&&Gc(r)&&Dl(r);)r=Ol(r,t);return r&&el(r)&&Dl(r)&&!Zc(r)?n:r||Qc(e)||n}var Al=async function(e){let t=this.getOffsetParent||kl,n=this.getDimensions,r=await n(e.floating);return{reference:El(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function jl(e){return R(e).direction===`rtl`}var Ml={convertOffsetParentRelativeRectToViewportRelativeRect:hl,getDocumentElement:Bc,getClippingRect:wl,getOffsetParent:kl,getElementRects:Al,getClientRects:gl,getDimensions:Tl,getScale:cl,isElement:L,isRTL:jl};function Nl(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Pl(e,t){let n=null,r,i=Bc(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=ac(d),h=ac(i.clientWidth-(u+f)),g=ac(i.clientHeight-(d+p)),_=ac(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:rc(0,nc(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!Nl(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Fl(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=sl(e),u=i||a?[...l?il(l):[],...t?il(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Pl(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?fl(e):null;c&&g();function g(){let t=fl(e);h&&!Nl(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Il=Ic,Ll=Lc,Rl=Nc,zl=(e,t,n)=>{let r=new Map,i={platform:Ml,...n},a={...i.platform,_c:r};return Mc(e,t,{...i,platform:a})},Bl=(e,t)=>t===`center`?e:`${e}-${t}`,Vl=({reference:e,floating:t,position:n,align:r,gap:i,offset:a,matchReferenceWidth:o=!1})=>{let s=null,c=e=>`${e.getBoundingClientRect().width}px`,l=()=>{let s=e(),l=t();o&&(l.style.width=c(s)),zl(s,l,{placement:Bl(n(),r()),middleware:[Il({mainAxis:i(),crossAxis:a()}),Rl(),Ll({padding:5})]}).then(({x:e,y:t,strategy:n,placement:r})=>{let[i=`bottom`,a=`center`]=r.split(`-`);Object.assign(l.style,{position:n,inset:`${t}px auto auto ${e}px`,...o?{width:c(s)}:{}}),l.dataset.side=i,l.dataset.align=a})};return{mounted(){return s!==null},mount(){if(s){l();return}s=Fl(e(),t(),l)},unmount(){s?.(),s=null},sync(){this.unmount(),this.mount()}}};function Hl(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Hl(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Ul(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Hl(e))&&(r&&(r+=` `),r+=t);return r}var Wl=({values:e})=>Ul(e),Gl=Wl,Kl=e=>e.dataset.disabled===`true`||e.hasAttribute(`disabled`),ql=e=>typeof e==`function`?e():e!==!1,Jl=({root:e,itemSelector:t,activeAttribute:n=`data-active`,isDisabled:r=Kl,loop:i})=>{let a=()=>{let n=e();return n?Array.from(n.querySelectorAll(t)):[]},o=()=>a().filter(e=>!r(e)),s=()=>{a().forEach(e=>{e.removeAttribute(n)})},c=({items:e=o()}={})=>{let t=e.find(e=>e.getAttribute(n)===`true`);if(t)return e.indexOf(t);let r=document.activeElement,i=r instanceof HTMLElement?e.find(e=>e===r||e.contains(r)):void 0;return i?e.indexOf(i):-1},l=({el:e})=>{o().includes(e)&&(s(),e.setAttribute(n,`true`))},u=({el:e})=>{l({el:e}),e.focus()},d=(e,t)=>e<0?0:e<t-1?e+1:ql(i)?0:t-1,f=(e,t)=>e<0?t-1:e>0?e-1:ql(i)?t-1:0,p=e=>{let t=o()[e];t&&u({el:t})},m=()=>{let e=o();e.length!==0&&u({el:e[d(c({items:e}),e.length)]})},h=()=>{let e=o();e.length!==0&&u({el:e[f(c({items:e}),e.length)]})},g=()=>p(0),_=()=>{p(o().length-1)};return{allItems:a,items:o,currentActiveIndex:c,activateItem:l,clearActiveItem:s,focusItem:u,focusNext:m,focusPrevious:h,focusFirst:g,focusLast:_,handleKeydown:({event:e})=>e.key===`ArrowDown`?(e.preventDefault(),m(),!0):e.key===`ArrowUp`?(e.preventDefault(),h(),!0):e.key===`Home`?(e.preventDefault(),g(),!0):e.key===`End`?(e.preventDefault(),_(),!0):!1}},Yl=`Are you sure?`,Xl=null,Zl=new WeakSet,Ql=e=>e instanceof HTMLButtonElement||e instanceof HTMLInputElement,$l=({form:e,submitter:t})=>{let n=t?.dataset.uiConfirm;if(n!==void 0)return n||Yl;let r=e.dataset.uiConfirm;return r===void 0?null:r||Yl},eu=({form:e,submitter:t})=>{if(Zl.add(e),t){e.requestSubmit(t);return}e.requestSubmit()},tu=e=>{let t=e.target;if(!(t instanceof HTMLFormElement))return;if(Zl.has(t)){Zl.delete(t);return}let n=Ql(e.submitter)?e.submitter:null,r=$l({form:t,submitter:n});if(r===null)return;e.preventDefault();let i=!1,a=()=>{i||(i=!0,eu({form:t,submitter:n}))},o=()=>{i=!0},s=new CustomEvent(`ui:confirm`,{bubbles:!0,cancelable:!0,detail:{form:t,message:r,submitter:n,triggeringEvent:e,proceed:a,cancel:o}});t.dispatchEvent(s),!s.defaultPrevented&&(window.confirm(r)?a():o())},nu=({root:e=document}={})=>{Xl||=(e.addEventListener(`submit`,tu,{capture:!0}),()=>e.removeEventListener(`submit`,tu,{capture:!0}))},ru=()=>{Xl?.(),Xl=null},iu=e=>typeof e!=`object`||!e?e:(Object.freeze(e),Object.values(e).forEach(e=>{iu(e)}),e),au=({definition:e})=>iu(e),ou=[`:`,`@`,`x-`,`data-`,`aria-`],su=e=>typeof e==`object`&&!!e&&!Array.isArray(e),cu=e=>Object.keys(e).some(e=>e===`class`||e===`style`||e===`id`||e===`role`||e===`type`||e===`tabindex`||ou.some(t=>e.startsWith(t))),lu=(e,t,n)=>{Object.entries(t).forEach(([t,r])=>{if(t===`class`){n.push(r);return}if(r==null||r===!1){delete e[t];return}e[t]=r})},uu=({inputs:e})=>{let t={},n=[];e.forEach(e=>{if(e){if(su(e)&&cu(e)){lu(t,e,n);return}n.push(e)}});let r=Wl({values:n});return r&&(t.class=r),t},du=e=>e.replace(/([A-Z])/g,`-$1`).toLowerCase(),fu=e=>e.replace(/([A-Z])/g,`-$1`).toLowerCase().replace(/[\s_]+/g,`-`),pu=e=>e.replace(/[-_\s]+([a-z])/g,(e,t)=>t.toUpperCase()),mu=e=>e.replace(/([A-Z])/g,`_$1`).toLowerCase().replace(/[\s-]+/g,`_`),hu=(e,t)=>e.dataset[t],gu=(e,t)=>e.hasAttribute(`data-${du(t)}`),_u=(e,t)=>(Object.defineProperty(e,"meta",{value:Object.freeze(t),enumerable:!1}),e);function z(e,t,n=`default`){let r=((r,i)=>{let a=hu(r,i);return a===void 0||a===``&&n==="default"?t:e.reduce((e,t)=>t(e),a)});return Object.defineProperties(r,{trim:{get:()=>z([...e,e=>e.trim()],t,n)},lower:{get:()=>z([...e,e=>e.toLowerCase()],t,n)},upper:{get:()=>z([...e,e=>e.toUpperCase()],t,n)},kebab:{get:()=>z([...e,fu],t,n)},camel:{get:()=>z([...e,pu],t,n)},snake:{get:()=>z([...e,mu],t,n)},default:{value:t=>z(e,t,n)},emptyAsValue:{get:()=>z(e,t,`value`)},emptyAsDefault:{get:()=>z(e,t,`default`)},maxLength:{value:r=>z([...e,e=>e.slice(0,r)],t,n)},prefix:{value:r=>z([...e,e=>e.startsWith(r)?e:`${r}${e}`],t,n)},suffix:{value:r=>z([...e,e=>e.endsWith(r)?e:`${e}${r}`],t,n)}}),_u(r,{type:`string`,default:t,emptyString:n})}function vu(e,t){let n=((n,r)=>{let i=hu(n,r);if(i===void 0||i===``)return t;let a=Number(i);return Number.isFinite(a)?e.reduce((e,t)=>t(e),a):t});return Object.defineProperties(n,{clamp:{value:(n,r)=>vu([...e,e=>Math.min(r,Math.max(n,e))],t)},min:{value:n=>vu([...e,e=>Math.max(n,e)],t)},max:{value:n=>vu([...e,e=>Math.min(n,e)],t)},step:{value:n=>vu([...e,e=>Math.round(e/n)*n],t)},default:{value:t=>vu(e,t)}}),_u(n,{type:`number`,default:t})}function yu(e){let t=((t,n)=>{let r=hu(t,n);return r===void 0?gu(t,n)||e:r===``?!0:[`true`,`1`,`yes`,`on`].includes(r.toLowerCase())});return Object.defineProperties(t,{default:{value:e=>yu(e)}}),_u(t,{type:`boolean`,default:e})}function bu(e,t){let n=((n,r)=>{let i=hu(n,r);return i!==void 0&&e.includes(i)?i:t});return Object.defineProperties(n,{default:{value:t=>bu(e,t)}}),_u(n,{type:`enum`,default:t,values:e})}function xu(e){let t=((t,n)=>{let r=hu(t,n);if(r===void 0||r===``)return e;try{return JSON.parse(r)}catch{return e}});return Object.defineProperties(t,{default:{value:e=>xu(e)}}),_u(t,{type:`json`,default:e})}var Su=(e,t)=>Object.fromEntries(Object.entries(t).map(([t,n])=>[t,n(e,t)])),Cu=(e,t)=>{Object.keys(t).forEach(n=>{let r=n;e[r]!==t[r]&&(e[r]=t[r])})},wu=e=>e,Tu=e=>{wu=e},B=({el:e,schema:t})=>{let n=wu(Su(e,t)),r=new MutationObserver(()=>{Cu(n,Su(e,t))});return r.observe(e,{attributes:!0,attributeFilter:Object.keys(t).map(e=>`data-${du(e)}`)}),Object.defineProperty(n,"disconnect",{value:()=>r.disconnect(),enumerable:!1}),n},V=z([],``),H=vu([],0),U=yu(!1),Eu=Object.assign(e=>xu(e),{object:e=>xu(e),array:e=>xu(e)}),W=(e,t)=>bu(e,t),Du=[`true`,`1`,`yes`,`on`],Ou=({value:e})=>e!==void 0&&(e===``||Du.includes(e.toLowerCase())),ku=({el:e,name:t,detail:n})=>{let r={bubbles:!0};n!==void 0&&(r.detail=n),e.dispatchEvent(new CustomEvent(t,r))},Au=({target:e,event:t,handler:n,cleanup:r,options:i})=>{e.addEventListener(t,n,i);let a=()=>e.removeEventListener(t,n,i);return r?.push(a),a},ju=({el:e,attr:t,present:n,value:r=``})=>{if(n){e.getAttribute(t)!==r&&e.setAttribute(t,r);return}e.removeAttribute(t)},Mu=({el:e,attr:t,value:n})=>{e.getAttribute(t)!==n&&e.setAttribute(t,n)},Nu=({el:e,attr:t})=>{e.hasAttribute(t)&&e.removeAttribute(t)},Pu=({el:e})=>(e.closest(`[dir]`)?.dir||document.dir).toLowerCase()===`rtl`,Fu=(e,t)=>e.includes(t),Iu=({isEnabled:e,roots:t,onDismiss:n})=>{let r=r=>{if(!e())return;let i=r.composedPath();t().filter(e=>e!=null).some(e=>Fu(i,e))||n(r)};return document.addEventListener(`pointerdown`,r,{capture:!0}),()=>{document.removeEventListener(`pointerdown`,r,{capture:!0})}},Lu=({el:e,state:t,value:n=``})=>{ju({el:e,attr:`data-disabled`,present:t.disabled??!1,value:n}),ju({el:e,attr:`data-required`,present:t.required??!1,value:n}),ju({el:e,attr:`data-invalid`,present:t.invalid??!1,value:n})},Ru=({input:e,state:t})=>{t.name!==void 0&&t.name!==``&&(e.name=t.name),t.value!==void 0&&(e.value=t.value),e.disabled=t.disabled??!1,e.required=t.nativeRequired??t.required??!1,`readOnly`in e&&(e.readOnly=t.readonly??!1),t.ariaRequired!==void 0&&e.setAttribute(`aria-required`,t.ariaRequired?`true`:`false`),t.invalid?e.setAttribute(`aria-invalid`,`true`):e.removeAttribute(`aria-invalid`)},zu=e=>JSON.stringify({name:e.name,values:e.values,required:e.required??!1,form:e.form??``,marker:e.marker??`data-ui-hidden-input`}),Bu=({container:e,state:t,currentKey:n=``})=>{let r=t.marker??`data-ui-hidden-input`,i=zu({...t,marker:r});return i===n?n:(e.replaceChildren(),t.name&&t.values.forEach(n=>{let i=document.createElement(`input`);i.type=`hidden`,i.name=t.name,i.value=n,i.setAttribute(r,``),t.required&&(i.required=!0),t.form&&i.setAttribute(`form`,t.form),e.append(i)}),i)},Vu=({container:e,fallback:t,marker:n})=>{let r=e?.querySelector(`input[${n}]`)??t;r.dispatchEvent(new Event(`input`,{bubbles:!0})),r.dispatchEvent(new Event(`change`,{bubbles:!0}))},Hu=e=>e.trim().toLowerCase(),Uu=e=>e.split(`,`).map(e=>e.trim()).filter(Boolean),Wu=e=>{if(e)try{return JSON.parse(e)}catch{return}},Gu=(e,t)=>{if(!(!t||e==null))return t.split(`.`).reduce((e,t)=>{if(!(typeof e!=`object`||!e))return e[t]},e)};function Ku(e){if(Array.isArray(e))return e}function qu(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Ju(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Yu(e,t){if(e){if(typeof e==`string`)return Ju(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ju(e,t):void 0}}function Xu(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
4
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
5
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function
|
|
6
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function uf(e,t){if(e){if(typeof e==`string`)return df(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?df(e,t):void 0}}function df(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ff(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function pf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ff(Object(n),!0).forEach(function(t){sd(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ff(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function mf(){var e=new Set,t=null;function n(e){t&&(!e.canMonitor||e.canMonitor(t.canMonitorArgs))&&t.active.add(e)}function r(r){var i=pf({},r);e.add(i),n(i);function a(){e.delete(i),t&&t.active.delete(i)}return ud(a)}function i(r){var i=r.eventName,a=r.payload;if(i===`onGenerateDragPreview`){t={canMonitorArgs:{initial:a.location.initial,source:a.source},active:new Set};var o=lf(e),s;try{for(o.s();!(s=o.n()).done;){var c=s.value;n(c)}}catch(e){o.e(e)}finally{o.f()}}if(t){for(var l=Array.from(t.active),u=0,d=l;u<d.length;u++){var f=d[u];if(t.active.has(f)){var p;(p=f[i])==null||p.call(f,a)}}i===`onDrop`&&(t.active.clear(),t=null)}}return{dispatchEvent:i,monitorForConsumers:r}}function hf(e){var t=e.typeKey,n=e.mount,r=e.dispatchEventToSource,i=e.onPostDispatch,a=e.defaultDropEffect,o=mf(),s=cf({typeKey:t,defaultDropEffect:a});function c(e){r?.(e),s.dispatchEvent(e),o.dispatchEvent(e),i?.(e)}function l(e){var t=e.event,n=e.dragType;Yd.start({event:t,dragType:n,getDropTargetsOver:s.getIsOver,dispatchEvent:c})}function u(){function e(){return n({canStart:Yd.canStart,start:l})}return Qd({typeKey:t,mount:e})}return{registerUsage:u,dropTarget:s.dropTargetForConsumers,monitor:o.monitorForConsumers}}var gf=ud(function(){return navigator.userAgent.toLocaleLowerCase().includes(`android`)}),_f=`pdnd:android-fallback`,vf=`text/plain`,yf=`application/vnd.pdnd`,bf=new WeakMap;function xf(e){return bf.set(e.element,e),function(){bf.delete(e.element)}}var Sf=wd(),Cf=hf({typeKey:`element`,defaultDropEffect:`move`,mount:function(e){return $d(Sf.bindEvents(),(0,ed.bind)(document,{type:`dragstart`,listener:function(t){if(e.canStart(t)&&!t.defaultPrevented&&t.dataTransfer){var n=t.target;if(n instanceof HTMLElement){var r=bf.get(n);if(r){var i=Rd(t),a={element:r.element,dragHandle:r.dragHandle??null,input:i};if(r.canDrag&&!r.canDrag(a)){t.preventDefault();return}if(r.dragHandle){var o=rd({x:i.clientX,y:i.clientY});if(!r.dragHandle.contains(o)){t.preventDefault();return}}var s=r.getInitialDataForExternal?.call(r,a)??null;if(s)for(var c=0,l=Object.entries(s);c<l.length;c++){var u=Zu(l[c],2),d=u[0],f=u[1];t.dataTransfer.setData(d,f??``)}gf()&&!t.dataTransfer.types.includes(`text/plain`)&&!t.dataTransfer.types.includes(`text/uri-list`)&&t.dataTransfer.setData(vf,_f),t.dataTransfer.setData(yf,``);var p={type:`element`,payload:{element:r.element,dragHandle:r.dragHandle??null,data:r.getInitialData?.call(r,a)??{}},startedFrom:`internal`};e.start({event:t,dragType:p})}}}}}))},dispatchEventToSource:function(e){var t,n,r=e.eventName,i=e.payload;(t=bf.get(i.source.element))==null||(n=t[r])==null||n.call(t,i)},onPostDispatch:Sf.getOnPostDispatch()});Cf.dropTarget,Cf.monitor;function wf(e){return ud($d(Cf.registerUsage(),xf(e),ef(e.element,{attribute:`draggable`,value:`true`})))}var Tf=function(){if(typeof window>`u`)return null;var e=new Image;return e.src=`data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==`,e}();function Ef(e){var t=e.nativeSetDragImage;t&&Tf&&t(Tf,0,0)}var Df=60,Of=1,kf=8,Af=24,jf=`[x-ui-resizable\\:handle], [data-ui-resize-handle]`,Mf=`data-ui-resizable-managed-disabled`,Nf=(e,t,n)=>{let r=Math.max(e,t);return n===null?r:Math.min(r,n)},Pf=(e,t)=>!Number.isFinite(t)||t<=1?e:Math.round(e/t)*t,Ff=(e,t,n,r)=>Nf(Pf(e,r),t,n),If=(e,t)=>{if(e===void 0||e.trim()===``)return t;let n=Number(e);return Number.isFinite(n)?n:t},Lf=e=>e===`onEnd`?`onEnd`:`onChange`,Rf=e=>e===`y`?`y`:`x`,zf=({value:e,element:t,axis:n,fallback:r})=>{if(e===void 0||e.trim()===``)return r;let i=Number(e);if(Number.isFinite(i))return i;if(e.endsWith(`px`)){let t=Number(e.slice(0,-2));if(Number.isFinite(t))return t}if(e.endsWith(`rem`)){let t=Number(e.slice(0,-3)),n=Number.parseFloat(getComputedStyle(document.documentElement).fontSize||`16`);if(Number.isFinite(t)&&Number.isFinite(n))return t*n}if(e.endsWith(`em`)){let n=Number(e.slice(0,-2)),r=Number.parseFloat(getComputedStyle(t).fontSize||`16`);if(Number.isFinite(n)&&Number.isFinite(r))return n*r}if(typeof document>`u`)return r;let a=document.createElement(`div`);a.style.position=`absolute`,a.style.visibility=`hidden`,a.style.pointerEvents=`none`,a.style.width=n===`x`?e:`0`,a.style.height=n===`y`?e:`0`,t.append(a);let o=a.getBoundingClientRect();a.remove();let s=n===`x`?o.width:o.height;return s>0?s:r},Bf=e=>({clientX:e.location.current.input.clientX,clientY:e.location.current.input.clientY}),Vf=e=>({clientX:e.location.initial.input.clientX,clientY:e.location.initial.input.clientY}),Hf=e=>({$width:e.width,$height:e.height,$delta:e.delta,$axis:e.axis,$phase:e.phase,$previewWidth:e.previewWidth,$previewHeight:e.previewHeight}),Uf=({el:e,name:t,event:n})=>{e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:n}))},Wf=({element:e,handle:t,axis:n=`x`,min:r=Df,max:i=null,step:a=Of,mode:o=`onChange`,hitArea:s=kf,coarseHitArea:c=Af,disabled:l=()=>!1,onStart:u,onResize:d,onEnd:f})=>{let p=null,m=[],h=()=>{let n=l();return n?(e.setAttribute(`data-disabled`,``),e.setAttribute(Mf,``),t.setAttribute(`data-disabled`,``),t.setAttribute(Mf,``)):(e.hasAttribute(Mf)&&(e.removeAttribute(`data-disabled`),e.removeAttribute(Mf)),t.hasAttribute(Mf)&&(t.removeAttribute(`data-disabled`),t.removeAttribute(Mf))),t.setAttribute(`aria-disabled`,n?`true`:`false`),n},g=()=>typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(pointer: coarse)`).matches?c:s,_=()=>{e.setAttribute(`data-ui-resizable`,``),e.dataset.resizeAxis=n,e.dataset.resizeMode=o,t.setAttribute(`data-ui-resize-handle`,``),t.setAttribute(`role`,`separator`),t.setAttribute(`tabindex`,t.getAttribute(`tabindex`)??`0`),t.setAttribute(`aria-orientation`,n===`x`?`vertical`:`horizontal`),t.style.touchAction=`none`,n===`x`?t.style.minWidth=`${g()}px`:t.style.minHeight=`${g()}px`},v=n=>{ju({el:e,attr:`data-resizing`,present:n}),ju({el:t,attr:`data-resizing`,present:n})},y=({phase:t,delta:o,input:s,previewOnly:c=!1})=>{let l=e.getBoundingClientRect(),u=p??{width:l.width,height:l.height,startWidth:l.width,startHeight:l.height,startClientX:s.clientX,startClientY:s.clientY},d=n===`x`?Ff(u.startWidth+o,r,i,a):u.startWidth,f=n===`y`?Ff(u.startHeight+o,r,i,a):u.startHeight;return{width:c?u.width:d,height:c?u.height:f,previewWidth:d,previewHeight:f,delta:o,axis:n,phase:t,input:s}},b=e=>{let a=n===`x`?e.previewWidth:e.previewHeight;t.setAttribute(`aria-valuenow`,String(Math.round(a))),t.setAttribute(`aria-valuemin`,String(Math.round(r))),i===null?t.removeAttribute(`aria-valuemax`):t.setAttribute(`aria-valuemax`,String(Math.round(i)))},x=t=>{let n=e.getBoundingClientRect();p={width:n.width,height:n.height,startWidth:n.width,startHeight:n.height,startClientX:t.clientX,startClientY:t.clientY};let r=y({phase:`start`,delta:0,input:t});return b(r),v(!0),u?.(r),r},S=e=>{if(!p)return null;let t=y({phase:`resize`,delta:n===`x`?e.clientX-p.startClientX:e.clientY-p.startClientY,input:e,previewOnly:o===`onEnd`});return b(t),d?.(t),o===`onChange`&&(p.width=t.width,p.height=t.height),t},C=e=>{if(!p)return null;let t=y({phase:`end`,delta:n===`x`?e.clientX-p.startClientX:e.clientY-p.startClientY,input:e});return b(t),f?.(t),p=null,v(!1),t};_(),h(),b(y({phase:`start`,delta:0,input:{clientX:0,clientY:0}})),m.push(wf({element:e,dragHandle:t,canDrag:()=>!h(),getInitialData:()=>({type:`ui-resizable`}),onGenerateDragPreview:({nativeSetDragImage:e})=>Ef({nativeSetDragImage:e}),onDragStart:e=>{h()||x(Vf(e))},onDrag:e=>{h()||S(Bf(e))},onDrop:e=>{C(Bf(e))}}));let w=t=>{if(h())return;let o=a*(t.shiftKey?10:1),s=null;if(n===`x`&&t.key===`ArrowRight`&&(s=o),n===`x`&&t.key===`ArrowLeft`&&(s=-o),n===`y`&&t.key===`ArrowDown`&&(s=o),n===`y`&&t.key===`ArrowUp`&&(s=-o),t.key===`Home`&&(s=r-e.getBoundingClientRect()[n===`x`?`width`:`height`]),t.key===`End`&&i!==null&&(s=i-e.getBoundingClientRect()[n===`x`?`width`:`height`]),s!==null&&(t.preventDefault(),x({clientX:0,clientY:0}),p)){p.startClientX=0,p.startClientY=0;let e=n===`x`?{clientX:s,clientY:0}:{clientX:0,clientY:s};S(e),C(e)}};return t.addEventListener(`keydown`,w),m.push(()=>t.removeEventListener(`keydown`,w)),()=>{m.forEach(e=>e()),v(!1)}},Gf=e=>{typeof e.directive==`function`&&e.directive(`ui-resizable`,(t,{value:n,expression:r},{cleanup:i})=>{if(!(t instanceof HTMLElement)||n===`handle`)return;let a=t,o=a.querySelector(jf);if(!o)return;let s=Rf(a.dataset.resizeAxis),c=zf({value:a.dataset.resizeMin??a.dataset.minWidth,element:a,axis:s,fallback:Df}),l=a.dataset.resizeMax??a.dataset.maxWidth,u=l?zf({value:l,element:a,axis:s,fallback:1/0}):null,d=Lf(a.dataset.resizeMode),f=r?e.evaluateLater(a,r):null,p=e=>{Uf({el:a,name:e.phase===`start`?`ui:resize-start`:e.phase===`end`?`ui:resize-end`:`ui:resize`,event:e}),f&&(d===`onEnd`&&e.phase===`resize`||f(void 0,Hf(e)))};i(Wf({element:a,handle:o,axis:s,min:c,max:u===1/0?null:u,step:If(a.dataset.resizeStep,Of),mode:d,hitArea:If(a.dataset.resizeHitArea,kf),coarseHitArea:If(a.dataset.resizeCoarseHitArea,Af),disabled:()=>a.hasAttribute(`data-disabled`)&&!a.hasAttribute(Mf)||a.hasAttribute(`data-resize-disabled`)||a.dataset.disabled===`true`&&!a.hasAttribute(Mf),onStart:p,onResize:p,onEnd:p}))})},Kf=e=>e.replace(/([A-Z])/g,`_$1`).toLowerCase(),qf=({manifest:e})=>Object.freeze(e),Jf=({schema:e,details:t})=>Object.fromEntries(Object.entries(e).map(([e,n])=>{let r=t[e]??{},i=n.meta,a={type:i.type,default:i.default};return i.values&&(a.values=i.values),r.description&&(a.description=r.description),[r.name??Kf(e),a]})),G=({definition:e})=>Object.freeze(e),Yf=e=>e===!0?`true`:e===!1||e==null?`false`:String(e),Xf=(e,t,n)=>Yf(t[n]??e.defaults?.[n]),Zf=(e,t,n)=>Object.entries(n.when).every(([n,r])=>Xf(e,t,n)===Yf(r)),K=({part:e,props:t={},className:n})=>{let r=[e.base];return Object.entries(e.variants??{}).forEach(([n,i])=>{r.push(i[Xf(e,t,n)])}),e.compounds?.forEach(n=>{Zf(e,t,n)&&r.push(n.class)}),r.push(n),Ul(r)};function Qf(e,t){if(e===`__proto__`||e===`constructor`&&t&&typeof t==`object`&&`prototype`in t){$f(e);return}return t}function $f(e){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`)}function ep(e,t={}){if(typeof e!=`string`)return e;if(e[0]===`"`&&e[e.length-1]===`"`&&e.indexOf(`\\`)===-1)return e.slice(1,-1);let n=e.trim();if(n.length<=9)switch(n.toLowerCase()){case`true`:return!0;case`false`:return!1;case`undefined`:return;case`null`:return null;case`nan`:return NaN;case`infinity`:return 1/0;case`-infinity`:return-1/0}if(!rp.test(e)){if(t.strict)throw SyntaxError(`[destr] Invalid JSON`);return e}try{if(tp.test(e)||np.test(e)){if(t.strict)throw Error(`[destr] Possible prototype pollution`);return JSON.parse(e,Qf)}return JSON.parse(e)}catch(n){if(t.strict)throw n;return e}}var tp,np,rp,ip=n((()=>{tp=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,np=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,rp=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/}));function ap(e){return encodeURI(``+e).replace(Np,`|`)}function op(e){return ap(typeof e==`string`?e:JSON.stringify(e)).replace(Ap,`%2B`).replace(Pp,`+`).replace(Ep,`%23`).replace(Dp,`%26`).replace(Mp,"`").replace(jp,`^`).replace(Op,`%2F`)}function sp(e){return op(e).replace(kp,`%3D`)}function cp(e=``){try{return decodeURIComponent(``+e)}catch{return``+e}}function lp(e){return cp(e.replace(Ap,` `))}function up(e){return cp(e.replace(Ap,` `))}function dp(e=``){let t=Object.create(null);e[0]===`?`&&(e=e.slice(1));for(let n of e.split(`&`)){let e=n.match(/([^=]+)=?(.*)/)||[];if(e.length<2)continue;let r=lp(e[1]);if(r===`__proto__`||r===`constructor`)continue;let i=up(e[2]||``);t[r]===void 0?t[r]=i:Array.isArray(t[r])?t[r].push(i):t[r]=[t[r],i]}return t}function fp(e,t){return(typeof t==`number`||typeof t==`boolean`)&&(t=String(t)),t?Array.isArray(t)?t.map(t=>`${sp(e)}=${op(t)}`).join(`&`):`${sp(e)}=${op(t)}`:sp(e)}function pp(e){return Object.keys(e).filter(t=>e[t]!==void 0).map(t=>fp(t,e[t])).filter(Boolean).join(`&`)}function mp(e,t={}){return typeof t==`boolean`&&(t={acceptRelative:t}),t.strict?Fp.test(e):Ip.test(e)||(t.acceptRelative?Lp.test(e):!1)}function hp(e=``,t){return t?Rp.test(e):e.endsWith(`/`)}function gp(e=``,t){if(!t)return(hp(e)?e.slice(0,-1):e)||`/`;if(!hp(e,!0))return e||`/`;let n=e,r=``,i=e.indexOf(`#`);i!==-1&&(n=e.slice(0,i),r=e.slice(i));let[a,...o]=n.split(`?`);return((a.endsWith(`/`)?a.slice(0,-1):a)||`/`)+(o.length>0?`?${o.join(`?`)}`:``)+r}function _p(e=``,t){if(!t)return e.endsWith(`/`)?e:e+`/`;if(hp(e,!0))return e||`/`;let n=e,r=``,i=e.indexOf(`#`);if(i!==-1&&(n=e.slice(0,i),r=e.slice(i),!n))return r;let[a,...o]=n.split(`?`);return a+`/`+(o.length>0?`?${o.join(`?`)}`:``)+r}function vp(e,t){if(bp(t)||mp(e))return e;let n=gp(t);if(e.startsWith(n)){let t=e[n.length];if(!t||t===`/`||t===`?`)return e}return Sp(n,e)}function yp(e,t){let n=Cp(e);return n.search=pp({...dp(n.search),...t}),Tp(n)}function bp(e){return!e||e===`/`}function xp(e){return e&&e!==`/`}function Sp(e,...t){let n=e||``;for(let e of t.filter(e=>xp(e)))if(n){let t=e.replace(zp,``);n=_p(n)+t}else n=e;return n}function Cp(e=``,t){let n=e.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);if(n){let[,e,t=``]=n;return{protocol:e.toLowerCase(),pathname:t,href:e+t,auth:``,host:``,search:``,hash:``}}if(!mp(e,{acceptRelative:!0}))return t?Cp(t+e):wp(e);let[,r=``,i,a=``]=e.replace(/\\/g,`/`).match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[],[,o=``,s=``]=a.match(/([^#/?]*)(.*)?/)||[];r===`file:`&&(s=s.replace(/\/(?=[A-Za-z]:)/,``));let{pathname:c,search:l,hash:u}=wp(s);return{protocol:r.toLowerCase(),auth:i?i.slice(0,Math.max(0,i.length-1)):``,host:o,pathname:c,search:l,hash:u,[Bp]:!r}}function wp(e=``){let[t=``,n=``,r=``]=(e.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:t,search:n,hash:r}}function Tp(e){let t=e.pathname||``,n=e.search?(e.search.startsWith(`?`)?``:`?`)+e.search:``,r=e.hash||``,i=e.auth?e.auth+`@`:``,a=e.host||``;return(e.protocol||e[Bp]?(e.protocol||``)+`//`:``)+i+a+t+n+r}var Ep,Dp,Op,kp,Ap,jp,Mp,Np,Pp,Fp,Ip,Lp,Rp,zp,Bp,Vp=n((()=>{String.fromCharCode,Ep=/#/g,Dp=/&/g,Op=/\//g,kp=/=/g,Ap=/\+/g,jp=/%5e/gi,Mp=/%60/gi,Np=/%7c/gi,Pp=/%20/gi,Fp=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,Ip=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,Lp=/^([/\\]\s*){2,}[^/\\]/,Rp=/\/$|\/\?|\/#/,zp=/^\.?\//,Bp=Symbol.for(`ufo:protocolRelative`)}));function Hp(e){let t=e.error?.message||e.error?.toString()||``,n=e.request?.method||e.options?.method||`GET`,r=e.request?.url||String(e.request)||`/`,i=new Xp(`${`[${n}] ${JSON.stringify(r)}`}: ${e.response?`${e.response.status} ${e.response.statusText}`:`<no response>`}${t?` ${t}`:``}`,e.error?{cause:e.error}:void 0);for(let t of[`request`,`options`,`response`])Object.defineProperty(i,t,{get(){return e[t]}});for(let[t,n]of[[`data`,`_data`],[`status`,`status`],[`statusCode`,`status`],[`statusText`,`statusText`],[`statusMessage`,`statusText`]])Object.defineProperty(i,t,{get(){return e.response&&e.response[n]}});return i}function Up(e=`GET`){return Zp.has(e.toUpperCase())}function Wp(e){if(e===void 0)return!1;let t=typeof e;return t===`string`||t===`number`||t===`boolean`||t===null?!0:t===`object`?Array.isArray(e)?!0:e.buffer||e instanceof FormData||e instanceof URLSearchParams?!1:e.constructor&&e.constructor.name===`Object`||typeof e.toJSON==`function`:!1}function Gp(e=``){if(!e)return`json`;let t=e.split(`;`).shift()||``;return $p.test(t)?`json`:t===`text/event-stream`?`stream`:Qp.has(t)||t.startsWith(`text/`)?`text`:`blob`}function Kp(e,t,n,r){let i=qp(t?.headers??e?.headers,n?.headers,r),a;return(n?.query||n?.params||t?.params||t?.query)&&(a={...n?.params,...n?.query,...t?.params,...t?.query}),{...n,...t,query:a,params:a,headers:i}}function qp(e,t,n){if(!t)return new n(e);let r=new n(t);if(e)for(let[t,i]of Symbol.iterator in e||Array.isArray(e)?e:new n(e))r.set(t,i);return r}async function Jp(e,t){if(t)if(Array.isArray(t))for(let n of t)await n(e);else await t(e)}function Yp(e={}){let{fetch:t=globalThis.fetch,Headers:n=globalThis.Headers,AbortController:r=globalThis.AbortController}=e;async function i(e){let t=e.error&&e.error.name===`AbortError`&&!e.options.timeout||!1;if(e.options.retry!==!1&&!t){let t;t=typeof e.options.retry==`number`?e.options.retry:+!Up(e.options.method);let n=e.response&&e.response.status||500;if(t>0&&(Array.isArray(e.options.retryStatusCodes)?e.options.retryStatusCodes.includes(n):em.has(n))){let n=typeof e.options.retryDelay==`function`?e.options.retryDelay(e):e.options.retryDelay||0;return n>0&&await new Promise(e=>setTimeout(e,n)),a(e.request,{...e.options,retry:t-1})}}let n=Hp(e);throw Error.captureStackTrace&&Error.captureStackTrace(n,a),n}let a=async function(a,o={}){let s={request:a,options:Kp(a,o,e.defaults,n),response:void 0,error:void 0};if(s.options.method&&(s.options.method=s.options.method.toUpperCase()),s.options.onRequest&&(await Jp(s,s.options.onRequest),s.options.headers instanceof n||(s.options.headers=new n(s.options.headers||{}))),typeof s.request==`string`&&(s.options.baseURL&&(s.request=vp(s.request,s.options.baseURL)),s.options.query&&(s.request=yp(s.request,s.options.query),delete s.options.query),`query`in s.options&&delete s.options.query,`params`in s.options&&delete s.options.params),s.options.body&&Up(s.options.method))if(Wp(s.options.body)){let e=s.options.headers.get(`content-type`);typeof s.options.body!=`string`&&(s.options.body=e===`application/x-www-form-urlencoded`?new URLSearchParams(s.options.body).toString():JSON.stringify(s.options.body)),e||s.options.headers.set(`content-type`,`application/json`),s.options.headers.has(`accept`)||s.options.headers.set(`accept`,`application/json`)}else (`pipeTo`in s.options.body&&typeof s.options.body.pipeTo==`function`||typeof s.options.body.pipe==`function`)&&(`duplex`in s.options||(s.options.duplex=`half`));let c;if(!s.options.signal&&s.options.timeout){let e=new r;c=setTimeout(()=>{let t=Error(`[TimeoutError]: The operation was aborted due to timeout`);t.name=`TimeoutError`,t.code=23,e.abort(t)},s.options.timeout),s.options.signal=e.signal}try{s.response=await t(s.request,s.options)}catch(e){return s.error=e,s.options.onRequestError&&await Jp(s,s.options.onRequestError),await i(s)}finally{c&&clearTimeout(c)}if((s.response.body||s.response._bodyInit)&&!tm.has(s.response.status)&&s.options.method!==`HEAD`){let e=(s.options.parseResponse?`json`:s.options.responseType)||Gp(s.response.headers.get(`content-type`)||``);switch(e){case`json`:{let e=await s.response.text(),t=s.options.parseResponse||ep;s.response._data=t(e);break}case`stream`:s.response._data=s.response.body||s.response._bodyInit;break;default:s.response._data=await s.response[e]()}}return s.options.onResponse&&await Jp(s,s.options.onResponse),!s.options.ignoreResponseError&&s.response.status>=400&&s.response.status<600?(s.options.onResponseError&&await Jp(s,s.options.onResponseError),await i(s)):s.response},o=async function(e,t){return(await a(e,t))._data};return o.raw=a,o.native=(...e)=>t(...e),o.create=(t={},n={})=>Yp({...e,...n,defaults:{...e.defaults,...n.defaults,...t}}),o}var Xp,Zp,Qp,$p,em,tm,nm=n((()=>{ip(),Vp(),Xp=class extends Error{constructor(e,t){super(e,t),this.name=`FetchError`,t?.cause&&!this.cause&&(this.cause=t.cause)}},Zp=new Set(Object.freeze([`PATCH`,`POST`,`PUT`,`DELETE`])),Qp=new Set([`image/svg`,`application/xml`,`application/xhtml`,`application/html`]),$p=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i,em=new Set([408,409,425,429,500,502,503,504]),tm=new Set([101,204,205,304])})),rm,im,am,om,sm,cm=n((()=>{nm(),rm=(function(){if(typeof globalThis<`u`)return globalThis;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(typeof global<`u`)return global;throw Error(`unable to locate global object`)})(),im=rm.fetch?(...e)=>rm.fetch(...e):()=>Promise.reject(Error(`[ofetch] global.fetch is not supported!`)),am=rm.Headers,om=rm.AbortController,sm=Yp({fetch:im,Headers:am,AbortController:om})})),lm=i({EventSourceController:()=>ym,EventSourcePlus:()=>vm,EventStreamContentType:()=>gm,HTTP_METHOD_VALS:()=>bm,_handleResponse:()=>hm,getBytes:()=>pm,messageListFromString:()=>dm,parseLine:()=>fm});async function um(e){return new Promise(t=>{setTimeout(()=>{t(!0)},e)})}function dm(e){let t=[],n=``,r=!1,i,a,o,s,c,l=0,u=!1;function d(e){let r=fm(n);i=r.data??i,a=r.id??a,o=r.event??o,s=r.retry??s,u&&(typeof i==`string`&&t.push({id:a,data:i,event:o??`message`,retry:s}),a=void 0,i=void 0,o=void 0,s=void 0,l=e),n=``}for(let t=0;t<e.length;t++){let i=e[t];switch(i){case`\r`:u=c===`
|
|
1
|
+
var TrellisUI=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=Object.defineProperty,n=(e,t)=>()=>(e&&(t=e(e=0)),t),r=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),i=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},a={headers:{},mergeStrategy:`replace`,transitions:!1,mapDelimiter:`:`},o=()=>{console.error(`You can't use the "morph" merge without first installing the Alpine "morph" plugin here: https://alpinejs.dev/plugins/morph`)};function s(e){e.morph&&(o=e.morph),e.addInitSelector(()=>`[${e.prefixed(`target`)}]`),e.addInitSelector(()=>`[${e.prefixed(`target\\.push`)}]`),e.addInitSelector(()=>`[${e.prefixed(`target\\.replace`)}]`),e.directive(`target`,(e,{value:t,modifiers:n,expression:r},{evaluateLater:i,effect:a})=>{let o=t=>{e._ajax_target=e._ajax_target||{};let r={ids:x(e,t),sync:!0,focus:!n.includes(`nofocus`),history:n.includes(`push`)?`push`:n.includes(`replace`)?`replace`:!1},i=n.filter(e=>[`back`,`away`,`error`].includes(e)||parseInt(e));i=i.length?i:[`xxx`],i.forEach(t=>{t.charAt(0)===`3`&&(t=`3xx`),e._ajax_target[t]=r})};if(t===`dynamic`){let e=i(r);a(()=>e(o))}else o(r)}),e.directive(`headers`,(e,{expression:t},{evaluateLater:n,effect:r})=>{let i=n(t||`{}`);r(()=>{i(t=>{e._ajax_headers=t})})}),e.addInitSelector(()=>`[${e.prefixed(`merge`)}]`),e.addInitSelector(()=>`[${e.prefixed(`merge\\.transition`)}]`),e.directive(`merge`,(e,{value:t,modifiers:n,expression:r},{evaluateLater:i,effect:o})=>{let s=t=>{e._ajax_strategy=t,e._ajax_transition=a.transitions||n.includes(`transition`)};if(t===`dynamic`){let e=i(r);o(()=>e(s))}else s(r)}),e.magic(`ajax`,e=>async(t,n={})=>{let r={el:e,target:{xxx:{ids:x(e,n.targets||n.target),sync:!!n.sync,history:`history`in n?n.history:!1,focus:`focus`in n?n.focus:!0}},headers:n.headers||{}},i=n.method?n.method.toUpperCase():`GET`,a=n.body;return h(r,t,i,a)});let t=!1;e.ajax={start(){t||=(document.addEventListener(`submit`,d),document.addEventListener(`click`,u),window.addEventListener(`popstate`,l),!0)},configure:s.configure,stop(){document.removeEventListener(`submit`,d),document.removeEventListener(`click`,u),window.removeEventListener(`popstate`,l),t=!1}},e.ajax.start()}s.configure=e=>(a=Object.assign(a,e),s);var c=s;function l(e){!e.state||!e.state.__ajax||window.location.reload(!0)}async function u(e){if(e.defaultPrevented||e.which>1||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)return;let t=e?.target.closest(`a[href]:not([download]):not([noajax])`);if(!t||!t._ajax_target||t.isContentEditable||t.origin!==window.location.origin||t.getAttribute(`href`).startsWith(`#`)||t.hash&&C(t,new URL(document.baseURI)))return;e.preventDefault(),e.stopImmediatePropagation();let n={el:t,target:t._ajax_target,headers:t._ajax_headers||{}},r=t.getAttribute(`href`);try{return await h(n,r)}catch(e){if(e.name===`RenderError`){console.warn(e.message),window.location.href=t.href;return}throw e}}async function d(e){if(e.defaultPrevented)return;let t=e.target,n=e.submitter,r=(n?.getAttribute(`formmethod`)||t.getAttribute(`method`)||`GET`).toUpperCase();if(!t||!t._ajax_target||r===`DIALOG`||n?.hasAttribute(`formnoajax`)||n?.hasAttribute(`formtarget`)||t.hasAttribute(`noajax`)||t.hasAttribute(`target`))return;e.preventDefault(),e.stopImmediatePropagation();let i={el:t,target:t._ajax_target,headers:t._ajax_headers||{}},a=new FormData(t),o=t.getAttribute(`enctype`),s=t.getAttribute(`action`);n&&(o=n.getAttribute(`formenctype`)||o,s=n.getAttribute(`formaction`)||s,n.name&&a.append(n.name,n.value));try{return await f(n,()=>h(i,s,r,a,o))}catch(e){if(e.name===`RenderError`){console.warn(e.message),t.setAttribute(`noajax`,`true`),t.requestSubmit(n);return}throw e}}async function f(e,t){if(!e)return await t();let n=e=>e.preventDefault();e.setAttribute(`aria-disabled`,`true`),e.addEventListener(`click`,n);let r;try{r=await t()}finally{e.removeAttribute(`aria-disabled`),e.removeEventListener(`click`,n)}return r}var p={store:new Map,plan(e,t){if(e.ids.forEach(e=>{let n=e[0],r=[`_self`,`_top`,`_none`].includes(n)?document.documentElement:document.getElementById(n);if(!r)return console.warn(`Target [#${n}] was not found in current document.`);r._ajax_id=e[1],this.set(r,t)}),e.sync){let n=e.ids.flat();document.querySelectorAll(`[x-sync]`).forEach(e=>{let r=e.getAttribute(`id`);if(!r)throw new T(e);n.includes(r)||(e._ajax_id=r,e._ajax_sync=!0,this.set(e,t))})}},purge(e){this.store.forEach((t,n)=>e===t&&this.delete(n))},get(e){let t=[];return this.store.forEach((n,r)=>e===n&&t.push(r)),t},set(e,t){e.querySelectorAll(`[aria-busy]`).forEach(e=>{this.delete(e)}),e.setAttribute(`aria-busy`,`true`),this.store.set(e,t)},delete(e){e.removeAttribute(`aria-busy`),this.store.delete(e)}},m=new Map;async function h(e,t=``,n=`GET`,r=null,i=`application/x-www-form-urlencoded`){if(!S(e.el,`ajax:before`))return;let o=e.target.xxx,s={ok:!1,redirected:!1,url:``,status:``,html:``,raw:``};p.plan(o,s);let c=new URL(e.el.closest(`[data-source]`)?.dataset.source||``,document.baseURI);t=new URL(t||c,document.baseURI),r&&(r=g(r),n===`GET`?(t.search=_(r).toString(),r=null):i!==`multipart/form-data`&&r instanceof FormData?r=_(r):i=null);let l={action:t.toString(),method:n,body:r,enctype:i,referrer:c.toString(),headers:Object.assign({"X-Alpine-Request":!0,"X-Alpine-Target":p.get(s).map(e=>e._ajax_id).join(` `)},a.headers,e.headers)};l.enctype||delete l.enctype,S(e.el,`ajax:send`,l);let u;if(l.method===`GET`&&m.has(l.action)?u=m.get(l.action):(u=fetch(l.action,l).then(async e=>{let t=await e.text();return e.html=document.createRange().createContextualFragment(`<template>`+t+`</template>`).firstElementChild.content,e.raw=t,e}),m.set(l.action,u)),await u.then(e=>{s.ok=e.ok,s.redirected=e.redirected,s.url=e.url,s.status=e.status,s.html=e.html,s.raw=e.raw,s.headers=e.headers}),s.ok?(s.redirected&&(S(e.el,`ajax:redirect`,s),m.set(s.url,u),setTimeout(()=>{m.delete(s.url)},5)),S(e.el,`ajax:success`,s)):S(e.el,`ajax:error`,s),S(e.el,`ajax:sent`,s),m.delete(l.action),!s.html){p.purge(s);return}let d=s.redirected?`3xx`:s.status.toString(),f=C(new URL(s.url),new URL(l.referrer,document.baseURI)),h=[s.redirected?f?`back`:`away`:null,d,d.charAt(0)+`xx`,s.ok?`xxx`:`error`,`xxx`].find(t=>t in e.target);h!==`xxx`&&(o=e.target[h],(!s.redirected||!f||!o.ids.flat().includes(`_self`))&&(p.purge(s),p.plan(o,s))),o.history&&b(o.history,s.url);let x=!o.focus,w=p.get(s).map(async t=>{if(!t.isConnected||t._ajax_id===`_none`){p.delete(t);return}if(t===document.documentElement){window.location.href=s.url;return}let n=s.html.getElementById(t._ajax_id);if(!n){if(t._ajax_sync||!S(e.el,`ajax:missing`,{target:t,response:s}))return;if(s.ok)return t.remove();throw new ee(t,s.status)}let r=t._ajax_strategy||a.mergeStrategy,i=async()=>{if(t=await v(r,t,n),t){t.dataset.source=s.url,p.delete(t);let e=[`[x-autofocus]`,`[autofocus]`];for(;!x&&e.length;){let n=e.shift();t.matches(n)&&(x=y(t)),x||=Array.from(t.querySelectorAll(n)).some(e=>y(e))}}return S(t,`ajax:merged`),t};if(S(t,`ajax:merge`,{strategy:r,content:n,merge:i}))return i()}),T=await Promise.all(w);return e.el&&e.el.isConnected?S(e.el,`ajax:after`,{response:s,render:T}):S(window,`ajax:after`,{response:s,render:T}),T}function g(e){if(e instanceof FormData)return e;if(e instanceof HTMLFormElement)return new FormData(e);if(typeof e==`string`||e instanceof ArrayBuffer||e instanceof DataView||e instanceof Blob||e instanceof File||e instanceof URLSearchParams||e instanceof ReadableStream)return e;let t=new FormData;for(let n in e)typeof e[n]==`object`?t.append(n,JSON.stringify(e[n])):t.append(n,e[n]);return t}function _(e){let t=Array.from(e.entries()).filter(([e,t])=>!(t instanceof File));return new URLSearchParams(t)}async function v(e,t,n){let r={before(e,t){return e.before(...t.childNodes),e},replace(e,t){return e.replaceWith(t),t},update(e,t){return e.replaceChildren(...t.childNodes),e},prepend(e,t){return e.prepend(...t.childNodes),e},append(e,t){return e.append(...t.childNodes),e},after(e,t){return e.after(...t.childNodes),e},morph(e,t){return o(e,t),document.getElementById(t.getAttribute(`id`))}};return!t._ajax_transition||!document.startViewTransition?r[e](t,n):(await document.startViewTransition(()=>(t=r[e](t,n),Promise.resolve())).updateCallbackDone,t)}function y(e){return!e||!e.getClientRects().length?!1:(setTimeout(()=>{e.hasAttribute(`tabindex`)||e.setAttribute(`tabindex`,`0`),e.focus()},0),!0)}function b(e,t){return{push:()=>window.history.pushState({__ajax:!0},``,t),replace:()=>window.history.replaceState({__ajax:!0},``,t)}[e]()}function x(e,t=null){let n=e.getAttribute(`id`),r=[n];if(t&&(r=Array.isArray(t)?t:t.split(` `)),r=r.filter(e=>e).map(e=>{let t=e.split(a.mapDelimiter).map(e=>e||n);return t[1]=t[1]||t[0],t}),r.length===0)throw new T(e);return r}function S(e,t,n){return e.dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!0,composed:!0,cancelable:!0}))}function C(e,t){return w(e.pathname)===w(t.pathname)}function w(e){return e.replace(/\/$/,``)}var T=class extends DOMException{constructor(e){let t=(e.outerHTML.match(/<[^>]+>/)??[])[0]??`[Element]`;super(`${t} is missing an ID to target.`,`IDError`)}},ee=class extends DOMException{constructor(e,t){let n=e.getAttribute(`id`);super(`Target [#${n}] was not found in response with status [${t}].`,`RenderError`)}},te=c;function ne(e,t,n){fe();let r=ie(n),i=typeof t==`string`?ce(t):t;return window.Alpine&&window.Alpine.closestDataStack&&!e._x_dataStack&&(i._x_dataStack=window.Alpine.closestDataStack(e),i._x_dataStack&&window.Alpine.cloneNode(e,i)),r.patch(e,i),e}function re(e,t,n,r={}){fe();let i=ie(r),a=e.parentNode,o=new ue(e,t),s=typeof n==`string`?(()=>{let e=document.createElement(`div`);return e.insertAdjacentHTML(`beforeend`,n),e})():n,c=document.createComment(`[morph-start]`),l=document.createComment(`[morph-end]`);s.insertBefore(c,s.firstChild),s.appendChild(l);let u=new ue(c,l);window.Alpine&&window.Alpine.closestDataStack&&(s._x_dataStack=window.Alpine.closestDataStack(a),s._x_dataStack&&window.Alpine.cloneNode(a,s)),i.patchChildren(o,u)}function ie(e={}){let t=e=>e.getAttribute(`key`),n=()=>{},r={key:e.key||t,lookahead:e.lookahead||!1,updating:e.updating||n,updated:e.updated||n,removing:e.removing||n,removed:e.removed||n,adding:e.adding||n,added:e.added||n};return r.patch=function(e,t){if(r.differentElementNamesTypesOrKeys(e,t))return r.swapElements(e,t);let n=!1,i=!1;if(!oe(r.updating,()=>i=!0,e=>r.skipUntilCondition=e,e,t,()=>n=!0)){if(e.nodeType===1&&window.Alpine&&(window.Alpine.cloneNode(e,t),e._x_teleport&&t._x_teleport&&r.patch(e._x_teleport,t._x_teleport)),le(t)){r.patchNodeValue(e,t),r.updated(e,t);return}n||r.patchAttributes(e,t),r.updated(e,t),i||r.patchChildren(e,t)}},r.differentElementNamesTypesOrKeys=function(e,t){return e.nodeType!=t.nodeType||e.nodeName!=t.nodeName||r.getKey(e)!=r.getKey(t)},r.swapElements=function(e,t){if(ae(r.removing,e))return;let n=t.cloneNode(!0);ae(r.adding,n)||(e.replaceWith(n),r.removed(e),r.added(n))},r.patchNodeValue=function(e,t){let n=t.nodeValue;e.nodeValue!==n&&(e.nodeValue=n)},r.patchAttributes=function(e,t){if(e._x_transitioning||e._x_isShown&&!t._x_isShown||!e._x_isShown&&t._x_isShown)return;let n=Array.from(e.attributes),r=Array.from(t.attributes);for(let r=n.length-1;r>=0;r--){let i=n[r].name;t.hasAttribute(i)||(i===`open`&&e.nodeName===`DIALOG`&&e.open?e.close():e.removeAttribute(i))}for(let t=r.length-1;t>=0;t--){let n=r[t].name,i=r[t].value;e.getAttribute(n)!==i&&e.setAttribute(n,i)}},r.patchChildren=function(e,t){let n=r.keyToMap(e.children),i={},a=de(t),o=de(e);for(;a;){pe(a,o);let s=r.getKey(a),c=r.getKey(o);if(r.skipUntilCondition){let n=!o||r.skipUntilCondition(o),i=!a||r.skipUntilCondition(a);if(n&&i)r.skipUntilCondition=null;else{n||(o&&=E(e,o)),i||(a&&=E(t,a));continue}}if(!o)if(s&&i[s]){let t=i[s];e.appendChild(t),o=t,c=r.getKey(o)}else{if(!ae(r.adding,a)){let t=a.cloneNode(!0);e.appendChild(t),r.added(t)}a=E(t,a);continue}let l=e=>e&&e.nodeType===8&&e.textContent===`[if BLOCK]><![endif]`,u=e=>e&&e.nodeType===8&&e.textContent===`[if ENDBLOCK]><![endif]`;if(l(a)&&l(o)){let n=0,i=o;for(;o;){let t=E(e,o);if(l(t))n++;else if(u(t)&&n>0)n--;else if(u(t)&&n===0){o=t;break}o=t}let s=o;n=0;let c=a;for(;a;){let e=E(t,a);if(l(e))n++;else if(u(e)&&n>0)n--;else if(u(e)&&n===0){a=e;break}a=e}let d=a,f=new ue(i,s),p=new ue(c,d);r.patchChildren(f,p);continue}if(o.nodeType===1&&r.lookahead&&!o.isEqualNode(a)){let n=E(t,a),i=!1;for(;!i&&n;)n.nodeType===1&&o.isEqualNode(n)&&(i=!0,o=r.addNodeBefore(e,a,o),c=r.getKey(o)),n=E(t,n)}if(s!==c){if(!s&&c){i[c]=o,o=r.addNodeBefore(e,a,o),i[c].remove(),o=E(e,o),a=E(t,a);continue}if(s&&!c&&n[s]&&(o.replaceWith(n[s]),o=n[s],c=r.getKey(o)),s&&c){let l=n[s];if(l)i[c]=o,o.replaceWith(l),o=l,c=r.getKey(o);else{i[c]=o,o=r.addNodeBefore(e,a,o),i[c].remove(),o=E(e,o),a=E(t,a);continue}}}let d=o&&E(e,o);r.patch(o,a),a&&=E(t,a),o=d}let s=[];for(;o;)ae(r.removing,o)||s.push(o),o=E(e,o);for(;s.length;){let e=s.shift();e.remove(),r.removed(e)}},r.getKey=function(e){return e&&e.nodeType===1&&r.key(e)},r.keyToMap=function(e){let t={};for(let n of e){let e=r.getKey(n);e&&(t[e]=n)}return t},r.addNodeBefore=function(e,t,n){if(!ae(r.adding,t)){let i=t.cloneNode(!0);return e.insertBefore(i,n),r.added(i),i}return t},r}ne.step=()=>{},ne.log=()=>{};function ae(e,...t){let n=!1;return e(...t,()=>n=!0),n}function oe(e,t,n,...r){let i=!1;return e(...r,()=>i=!0,t,n),i}var se=!1;function ce(e){let t=document.createElement(`template`);return t.innerHTML=e,t.content.firstElementChild}function le(e){return e.nodeType===3||e.nodeType===8}var ue=class{constructor(e,t){this.startComment=e,this.endComment=t}get children(){let e=[],t=this.startComment.nextSibling;for(;t&&t!==this.endComment;)e.push(t),t=t.nextSibling;return e}appendChild(e){this.endComment.before(e)}get firstChild(){let e=this.startComment.nextSibling;if(e!==this.endComment)return e}nextNode(e){let t=e.nextSibling;if(t!==this.endComment)return t}insertBefore(e,t){return t.before(e),e}};function de(e){return e.firstChild}function E(e,t){let n;return n=e instanceof ue?e.nextNode(t):t.nextSibling,n}function fe(){if(se)return;se=!0;let e=Element.prototype.setAttribute,t=document.createElement(`div`);Element.prototype.setAttribute=function(n,r){if(!n.includes(`@`))return e.call(this,n,r);t.innerHTML=`<span ${n}="${r.replace(/&/g,`&`).replace(/"/g,`"`)}"></span>`;let i=t.firstElementChild.getAttributeNode(n);t.firstElementChild.removeAttributeNode(i),this.setAttributeNode(i)}}function pe(e,t){let n=t&&t._x_bindings&&t._x_bindings.id;n&&e.setAttribute&&(e.setAttribute(`id`,n),e.id=n)}function me(e){e.morph=ne,e.morphBetween=re}var he=me,ge=e=>{e.bind(`UiDisclosureRoot`,function(){let e=this;return{":data-state"(){return e.isOpen?`open`:`closed`}}}),e.bind(`UiDisclosureTrigger`,function(){let e=this;return{type:`button`,":id"(){return e.triggerId},":aria-controls"(){return e.contentId},":aria-expanded"(){return e.isOpen?`true`:`false`},":data-state"(){return e.isOpen?`open`:`closed`},"@click"(t){e.toggle(t)},"@keydown.enter.prevent"(t){e.toggle(t)},"@keydown.space.prevent"(t){e.toggle(t)},"@keydown.escape.stop"(t){e.close(t)}}}),e.bind(`UiDisclosureContent`,function(){let e=this;return{":id"(){return e.contentId},":data-state"(){return e.isOpen?`open`:`closed`},"@keydown.escape.stop"(t){e.close(t)}}})};function _e(e,t){e.indexOf(t)===-1&&e.push(t)}function ve(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var ye=(e,t,n)=>n>t?t:n<e?e:n;function be(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}var xe={},Se=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Ce=e=>typeof e==`object`&&!!e,we=e=>/^0[^.\s]+$/u.test(e);function Te(e){let t;return()=>(t===void 0&&(t=e()),t)}var Ee=e=>e,De=(...e)=>e.reduce((e,t)=>n=>t(e(n))),Oe=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1},ke=class{constructor(){this.subscriptions=[]}add(e){return _e(this.subscriptions,e),()=>ve(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},D=e=>e*1e3,O=e=>e/1e3,Ae=(e,t)=>t?1e3/t*e:0,je=new Set;function Me(e,t,n){e||je.has(t)||(console.warn(be(t,n)),je.add(t))}var Ne=(e,t,n)=>{let r=t-e;return((n-e)%r+r)%r+e},Pe=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Fe=1e-7,Ie=12;function Le(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=Pe(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>Fe&&++s<Ie);return o}function Re(e,t,n,r){if(e===t&&n===r)return Ee;let i=t=>Le(t,0,1,e,n);return e=>e===0||e===1?e:Pe(i(e),t,r)}var ze=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Be=e=>t=>1-e(1-t),Ve=Re(.33,1.53,.69,.99),He=Be(Ve),Ue=ze(He),We=e=>e>=1?1:(e*=2)<1?.5*He(e):.5*(2-2**(-10*(e-1))),Ge=e=>1-Math.sin(Math.acos(e)),Ke=Be(Ge),qe=ze(Ge),Je=Re(.42,0,1,1),Ye=Re(0,0,.58,1),Xe=Re(.42,0,.58,1),Ze=e=>Array.isArray(e)&&typeof e[0]!=`number`;function Qe(e,t){return Ze(e)?e[Ne(0,e.length,t)]:e}var $e=e=>Array.isArray(e)&&typeof e[0]==`number`,et={linear:Ee,easeIn:Je,easeInOut:Xe,easeOut:Ye,circIn:Ge,circInOut:qe,circOut:Ke,backIn:He,backInOut:Ue,backOut:Ve,anticipate:We},tt=e=>typeof e==`string`,nt=e=>{if($e(e)){e.length;let[t,n,r,i]=e;return Re(t,n,r,i)}else if(tt(e))return et[e],`${e}`,et[e];return e},rt=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function it(e){let t=new Set,n=new Set,r=!1,i=!1,a=new WeakSet,o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(c.schedule(t),e()),t(o)}let c={schedule:(e,i=!1,o=!1)=>{let s=o&&r?t:n;return i&&a.add(e),s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(o=e,r){i=!0;return}r=!0;let a=t;t=n,n=a,t.forEach(s),t.clear(),r=!1,i&&(i=!1,c.process(e))}};return c}var at=40;function ot(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=rt.reduce((e,t)=>(e[t]=it(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=xe.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,at),1)),i.timestamp=o,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:rt.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||g(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<rt.length;t++)o[rt[t]].cancel(e)},state:i,steps:o}}var{schedule:st,cancel:ct,state:lt,steps:ut}=ot(typeof requestAnimationFrame<`u`?requestAnimationFrame:Ee,!0),dt;function ft(){dt=void 0}var k={now:()=>(dt===void 0&&k.set(lt.isProcessing||xe.useManualTiming?lt.timestamp:performance.now()),dt),set:e=>{dt=e,queueMicrotask(ft)}},pt=e=>t=>typeof t==`string`&&t.startsWith(e),mt=pt(`--`),ht=pt(`var(--`),gt=e=>ht(e)?_t.test(e.split(`/*`)[0].trim()):!1,_t=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function vt(e){return typeof e==`string`?e.split(`/*`)[0].includes(`var(--`):!1}var yt={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},bt={...yt,transform:e=>ye(0,1,e)},xt={...yt,default:1},St=e=>Math.round(e*1e5)/1e5,Ct=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function wt(e){return e==null}var Tt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Et=(e,t)=>n=>!!(typeof n==`string`&&Tt.test(n)&&n.startsWith(e)||t&&!wt(n)&&Object.prototype.hasOwnProperty.call(n,t)),Dt=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(Ct);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},Ot=e=>ye(0,255,e),kt={...yt,transform:e=>Math.round(Ot(e))},At={test:Et(`rgb`,`red`),parse:Dt(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+kt.transform(e)+`, `+kt.transform(t)+`, `+kt.transform(n)+`, `+St(bt.transform(r))+`)`};function jt(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var Mt={test:Et(`#`),parse:jt,transform:At.transform},Nt=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Pt=Nt(`deg`),Ft=Nt(`%`),A=Nt(`px`),It=Nt(`vh`),Lt=Nt(`vw`),Rt={...Ft,parse:e=>Ft.parse(e)/100,transform:e=>Ft.transform(e*100)},zt={test:Et(`hsl`,`hue`),parse:Dt(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+Ft.transform(St(t))+`, `+Ft.transform(St(n))+`, `+St(bt.transform(r))+`)`},j={test:e=>At.test(e)||Mt.test(e)||zt.test(e),parse:e=>At.test(e)?At.parse(e):zt.test(e)?zt.parse(e):Mt.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?At.transform(e):zt.transform(e),getAnimatableNone:e=>{let t=j.parse(e);return t.alpha=0,j.transform(t)}},Bt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Vt(e){return isNaN(e)&&typeof e==`string`&&(e.match(Ct)?.length||0)+(e.match(Bt)?.length||0)>0}var Ht=`number`,Ut=`color`,Wt=`var`,Gt=`var(`,Kt="${}",qt=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Jt(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(qt,e=>(j.test(e)?(r.color.push(a),i.push(Ut),n.push(j.parse(e))):e.startsWith(Gt)?(r.var.push(a),i.push(Wt),n.push(e)):(r.number.push(a),i.push(Ht),n.push(parseFloat(e))),++a,Kt)).split(Kt),indexes:r,types:i}}function Yt(e){return Jt(e).values}function Xt({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];e===Ht?i+=St(r[a]):e===Ut?i+=j.transform(r[a]):i+=r[a]}return i}}function Zt(e){return Xt(Jt(e))}var Qt=e=>typeof e==`number`?0:j.test(e)?j.getAnimatableNone(e):e,$t=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:Qt(e);function en(e){let t=Jt(e);return Xt(t)(t.values.map((e,n)=>$t(e,t.split[n])))}var M={test:Vt,parse:Yt,createTransformer:Zt,getAnimatableNone:en};function tn(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function nn({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=tn(s,r,e+1/3),a=tn(s,r,e),o=tn(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function rn(e,t){return n=>n>0?t:e}var an=(e,t,n)=>e+(t-e)*n,on=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},sn=[Mt,At,zt],cn=e=>sn.find(t=>t.test(e));function ln(e){let t=cn(e);if(`${e}`,!t)return!1;let n=t.parse(e);return t===zt&&(n=nn(n)),n}var un=(e,t)=>{let n=ln(e),r=ln(t);if(!n||!r)return rn(e,t);let i={...n};return e=>(i.red=on(n.red,r.red,e),i.green=on(n.green,r.green,e),i.blue=on(n.blue,r.blue,e),i.alpha=an(n.alpha,r.alpha,e),At.transform(i))},dn=new Set([`none`,`hidden`]);function fn(e,t){return dn.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function pn(e,t){return n=>an(e,t,n)}function mn(e){return typeof e==`number`?pn:typeof e==`string`?gt(e)?rn:j.test(e)?un:vn:Array.isArray(e)?hn:typeof e==`object`?j.test(e)?un:gn:rn}function hn(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>mn(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function gn(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=mn(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function _n(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]];n[i]=e.values[o]??0,r[a]++}return n}var vn=(e,t)=>{let n=M.createTransformer(t),r=Jt(e),i=Jt(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?dn.has(e)&&!i.values.length||dn.has(t)&&!r.values.length?fn(e,t):De(hn(_n(r,i),i.values),n):(`${e}${t}`,rn(e,t))};function yn(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?an(e,t,n):mn(e)(e,t)}var bn=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>st.update(t,e),stop:()=>ct(t),now:()=>lt.isProcessing?lt.timestamp:k.now()}},xn=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},Sn=2e4;function Cn(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}function wn(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(Cn(r),Sn);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:O(i)}}var N={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Tn(e,t){return e*Math.sqrt(1-t*t)}var En=12;function Dn(e,t,n){let r=n;for(let n=1;n<En;n++)r-=e(r)/t(r);return r}var On=.001;function kn({duration:e=N.duration,bounce:t=N.bounce,velocity:n=N.velocity,mass:r=N.mass}){let i,a;N.maxDuration;let o=1-t;o=ye(N.minDamping,N.maxDamping,o),e=ye(N.minDuration,N.maxDuration,O(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=Tn(t,o),c=Math.exp(-i);return On-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=Tn(t**2,o);return(-i(t)+On>0?-1:1)*((a-s)*c)/l}):(i=t=>-.001+Math.exp(-t*e)*((t-n)*e+1),a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=Dn(i,a,s);if(e=D(e),isNaN(c))return{stiffness:N.stiffness,damping:N.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var An=[`duration`,`bounce`],jn=[`stiffness`,`damping`,`mass`];function Mn(e,t){return t.some(t=>e[t]!==void 0)}function Nn(e){let t={velocity:N.velocity,stiffness:N.stiffness,damping:N.damping,mass:N.mass,isResolvedFromDuration:!1,...e};if(!Mn(e,jn)&&Mn(e,An))if(t.velocity=0,e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*ye(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:N.mass,stiffness:i,damping:a}}else{let n=kn({...e,velocity:0});t={...t,...n,mass:N.mass},t.isResolvedFromDuration=!0}return t}function Pn(e=N.visualDuration,t=N.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=Nn({...n,velocity:-O(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=O(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?N.restSpeed.granular:N.restSpeed.default,i||=v?N.restDelta.granular:N.restDelta.default;let y,b,x,S,C,w;if(h<1)x=Tn(_,h),S=(m+h*_*g)/x,y=e=>o-Math.exp(-h*_*e)*(S*Math.sin(x*e)+g*Math.cos(x*e)),C=h*_*S+g*x,w=h*_*g-S*x,b=e=>Math.exp(-h*_*e)*(C*Math.sin(x*e)+w*Math.cos(x*e));else if(h===1){y=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);let e=m+_*g;b=t=>Math.exp(-_*t)*(_*e*t-m)}else{let e=_*Math.sqrt(h*h-1);y=t=>{let n=Math.exp(-h*_*t),r=Math.min(e*t,300);return o-n*((m+h*_*g)*Math.sinh(r)+e*g*Math.cosh(r))/e};let t=(m+h*_*g)/e,n=h*_*t-g*e,r=h*_*g-t*e;b=t=>{let i=Math.exp(-h*_*t),a=Math.min(e*t,300);return i*(n*Math.sinh(a)+r*Math.cosh(a))}}let T={calculatedDuration:p&&d||null,velocity:e=>D(b(e)),next:e=>{if(!p&&h<1){let t=Math.exp(-h*_*e),n=Math.sin(x*e),a=Math.cos(x*e),c=o-t*(S*n+g*a),l=D(t*(C*n+w*a));return s.done=Math.abs(l)<=r&&Math.abs(o-c)<=i,s.value=s.done?o:c,s}let t=y(e);if(p)s.done=e>=d;else{let n=D(b(e));s.done=Math.abs(n)<=r&&Math.abs(o-t)<=i}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min(Cn(T),Sn),t=xn(t=>T.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return T}Pn.applyToOptions=e=>{let t=wn(e,100,Pn);return e.ease=t.ease,e.duration=D(t.duration),e.type=`keyframes`,e};var Fn=5;function In(e,t,n){let r=Math.max(t-Fn,0);return Ae(n-e(r),t-r)}function Ln({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>s!==void 0&&e<s||c!==void 0&&e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>_+v(e),b=e=>{let t=v(e),n=y(e);f.done=Math.abs(t)<=l,f.value=f.done?_:n},x,S,C=e=>{p(f.value)&&(x=e,S=Pn({keyframes:[f.value,m(f.value)],velocity:In(y,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!S&&x===void 0&&(t=!0,b(e),C(e)),x!==void 0&&e>=x?S.next(e-x):(!t&&b(e),f)}}}function Rn(e,t,n){let r=[],i=n||xe.mix||yn,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=De(Array.isArray(t)?t[n]||Ee:t,a)),r.push(a)}return r}function zn(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=Rn(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=Oe(e[r],e[r+1],n);return s[r](i)};return n?t=>l(ye(e[0],e[a-1],t)):l}function Bn(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=Oe(0,t,r);e.push(an(n,1,i))}}function Vn(e){let t=[0];return Bn(t,e.length-1),t}function Hn(e,t){return e.map(e=>e*t)}function Un(e,t){return e.map(()=>t||Xe).splice(0,e.length-1)}function Wn({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=Ze(r)?r.map(nt):nt(r),a={done:!1,value:t[0]},o=zn(Hn(n&&n.length===t.length?n:Vn(t),e),t,{ease:Array.isArray(i)?i:Un(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var Gn=e=>e!==null;function Kn(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(Gn),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var qn={decay:Ln,inertia:Ln,tween:Wn,keyframes:Wn,spring:Pn};function Jn(e){typeof e.type==`string`&&(e.type=qn[e.type])}var Yn=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}},Xn=e=>e/100,Zn=class extends Yn{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==k.now()&&this.tick(k.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;Jn(e);let{type:t=Wn,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||Wn;s!==Wn&&typeof o[0]!=`number`&&(this.mixKeyframes=De(Xn,yn(o[0],o[1])),o=[0,100]);let c=s({...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=Cn(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime===null?this.currentTime=t:this.currentTime=this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=ye(0,1,n)*o}let b;_?(this.delayState.value=l[0],b=this.delayState):b=y.next(v),i&&!_&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==Ln&&(b.value=Kn(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return O(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+O(e)}get time(){return O(this.currentTime)}set time(e){e=D(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){let e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);let t=this.generator.next(e).value;return In(e=>this.generator.next(e).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(k.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=O(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=bn,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(k.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}};function Qn(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var $n=e=>e*180/Math.PI,er=e=>nr($n(Math.atan2(e[1],e[0]))),tr={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:er,rotateZ:er,skewX:e=>$n(Math.atan(e[1])),skewY:e=>$n(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},nr=e=>(e%=360,e<0&&(e+=360),e),rr=er,ir=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),ar=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),or={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ir,scaleY:ar,scale:e=>(ir(e)+ar(e))/2,rotateX:e=>nr($n(Math.atan2(e[6],e[5]))),rotateY:e=>nr($n(Math.atan2(-e[2],e[0]))),rotateZ:rr,rotate:rr,skewX:e=>$n(Math.atan(e[4])),skewY:e=>$n(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function sr(e){return+!!e.includes(`scale`)}function cr(e,t){if(!e||e===`none`)return sr(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=or,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=tr,i=t}if(!i)return sr(t);let a=r[t],o=i[1].split(`,`).map(ur);return typeof a==`function`?a(o):o[a]}var lr=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return cr(n,t)};function ur(e){return parseFloat(e.trim())}var dr=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],fr=new Set([...dr,`pathRotation`]),pr=e=>e===yt||e===A,mr=new Set([`x`,`y`,`z`]),hr=dr.filter(e=>!mr.has(e));function gr(e){let t=[];return hr.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(+!!n.startsWith(`scale`)))}),t}var _r={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>cr(t,`x`),y:(e,{transform:t})=>cr(t,`y`)};_r.translateX=_r.x,_r.translateY=_r.y;var vr=new Set,yr=!1,br=!1,xr=!1;function Sr(){if(br){let e=Array.from(vr).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=gr(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}br=!1,yr=!1,vr.forEach(e=>e.complete(xr)),vr.clear()}function Cr(){vr.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(br=!0)})}function wr(){xr=!0,Cr(),Sr(),xr=!1}var Tr=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(vr.add(this),yr||(yr=!0,st.read(Cr),st.resolveKeyframes(Sr))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}Qn(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),vr.delete(this)}cancel(){this.state===`scheduled`&&(vr.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},Er=e=>e.startsWith(`--`);function Dr(e,t,n){Er(t)?e.style.setProperty(t,n):e.style[t]=n}var Or={};function kr(e,t){let n=Te(e);return()=>Or[t]??n()}var Ar=kr(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),jr=kr(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),Mr=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Nr={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:Mr([0,.65,.55,1]),circOut:Mr([.55,0,1,.45]),backIn:Mr([.31,.01,.66,-.59]),backOut:Mr([.33,1.53,.69,.99])};function Pr(e,t){if(e)return typeof e==`function`?jr()?xn(e,t):`ease-out`:$e(e)?Mr(e):Array.isArray(e)?e.map(e=>Pr(e,t)||Nr.easeOut):Nr[e]}function Fr(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=Pr(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function Ir(e){return typeof e==`function`&&`applyToOptions`in e}function Lr({type:e,...t}){return Ir(e)&&jr()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var Rr=class extends Yn{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=Lr(e);this.animation=Fr(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=Kn(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),Dr(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e===`idle`||e===`finished`||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return O(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+O(e)}get time(){return O(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=D(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&Ar()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),Ee):r(this)}},zr={anticipate:We,backInOut:Ue,circInOut:qe};function Br(e){return e in zr}function Vr(e){typeof e.ease==`string`&&Br(e.ease)&&(e.ease=zr[e.ease])}var Hr=10,Ur=class extends Rr{constructor(e){Vr(e),Jn(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new Zn({...a,autoplay:!1}),s=Math.max(Hr,k.now()-this.startTime),c=ye(0,Hr,s-Hr),l=o.sample(s).value,{name:u}=this.options;i&&u&&Dr(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}},Wr=(e,t)=>t===`zIndex`?!1:!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(M.test(e)||e===`0`)&&!e.startsWith(`url(`));function Gr(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Kr(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=Wr(i,t),s=Wr(a,t);return`${t}${i}${a}${o?a:i}`,!o||!s?!1:Gr(e)||(n===`spring`||Ir(n))&&r}function qr(e){e.duration=0,e.type=`keyframes`}var Jr=new Set([`opacity`,`clipPath`,`filter`,`transform`]),Yr=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function Xr(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&Yr.test(e[t]))return!0;return!1}var Zr=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),Qr=Te(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function $r(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;let{onUpdate:c,transformTemplate:l}=t.owner.getProps();return Qr()&&n&&(Jr.has(n)||Zr.has(n)&&Xr(s))&&(n!==`transform`||!l)&&!c&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var ei=40,ti=class extends Yn{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,keyframes:o,name:s,motionValue:c,element:l,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=k.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u},f=l?.KeyframeResolver||Tr;this.keyframeResolver=new f(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=k.now();let u=!0;Kr(e,i,a,o)||(u=!1,(xe.instantAnimations||!s)&&l?.(Kn(e,n,t)),e[0]=e[e.length-1],qr(n),n.repeat=0);let d={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>ei?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},f=u&&!c&&$r(d),p=d.motionValue?.owner?.current,m;if(f)try{m=new Ur({...d,element:p})}catch{m=new Zn(d)}else m=new Zn(d);m.finished.then(()=>{this.notifyFinished()}).catch(Ee),this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),wr()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}},ni=class{constructor(e){this.stop=()=>this.runAll(`stop`),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=t}attachTimeline(e){let t=this.animations.map(t=>t.attachTimeline(e));return()=>{t.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll(`time`)}set time(e){this.setAll(`time`,e)}get speed(){return this.getAll(`speed`)}set speed(e){this.setAll(`speed`,e)}get state(){return this.getAll(`state`)}get startTime(){return this.getAll(`startTime`)}get duration(){return ri(this.animations,`duration`)}get iterationDuration(){return ri(this.animations,`iterationDuration`)}runAll(e){this.animations.forEach(t=>t[e]())}play(){this.runAll(`play`)}pause(){this.runAll(`pause`)}cancel(){this.runAll(`cancel`)}complete(){this.runAll(`complete`)}};function ri(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e[r][t];i!==null&&i>n&&(n=i)}return n}var ii=class extends ni{then(e,t){return this.finished.finally(e).then(()=>{})}},ai=class extends Rr{constructor(e){super(),this.animation=e,e.onfinish=()=>{this.finishedTime=this.time,this.notifyFinished()}}},oi=30,si=e=>!isNaN(parseFloat(e)),ci={current:void 0},li=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=k.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=k.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=si(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){this.events[e]||(this.events[e]=new ke);let n=this.events[e].add(t);return e===`change`?()=>{n(),st.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return ci.current&&ci.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=k.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>oi)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,oi);return Ae(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function ui(e,t){return new li(e,t)}function di(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function fi(e,t){let n=e?.[t]??e?.default??e;return n===e?n:di(n,e)}var pi={type:`spring`,stiffness:500,damping:25,restSpeed:10},mi=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),hi={type:`keyframes`,duration:.8},gi={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},_i=(e,{keyframes:t})=>t.length>2?hi:fr.has(e)?e.startsWith(`scale`)?mi(t[1]):pi:gi,vi=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function yi(e){for(let t in e)if(!vi.has(t))return!0;return!1}var bi=(e,t,n,r={},i,a)=>o=>{let s=fi(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=D(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};yi(s)||Object.assign(u,_i(e,u)),u.duration&&=D(u.duration),u.repeatDelay&&=D(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(qr(u),u.delay===0&&(d=!0)),(xe.instantAnimations||xe.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,qr(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=Kn(u.keyframes,s);if(e!==void 0){st.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new Zn(u):new ti(u)},xi=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Si(e){let t=xi.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function Ci(e,t,n=1){`${e}`;let[r,i]=Si(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return Se(e)?parseFloat(e):e}return gt(i)?Ci(i,t,n+1):i}function wi(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function Ti(e,t,n,r){if(typeof t==`function`){let[i,a]=wi(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=wi(r);t=t(n===void 0?e.custom:n,i,a)}return t}function Ei(e,t,n){let r=e.getProps();return Ti(r,t,n===void 0?r.custom:n,e)}var Di=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...dr]),Oi=e=>Array.isArray(e);function ki(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,ui(n))}function Ai(e){return Oi(e)?e[e.length-1]||0:e}function ji(e,t){let{transitionEnd:n={},transition:r={},...i}=Ei(e,t)||{};i={...i,...n};for(let t in i)ki(e,t,Ai(i[t]))}var P=e=>!!(e&&e.getVelocity);function Mi(e){return!!(P(e)&&e.add)}function Ni(e,t){let n=e.getValue(`willChange`);if(Mi(n))return n.add(t);if(!n&&xe.WillChange){let n=new xe.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function Pi(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var Fi=`data-`+Pi(`framerAppearId`);function Ii(e){return e.props[Fi]}function Li({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Ri(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?di(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState&&e.animationState.getState()[i],p=a?.path;p&&p.animateVisualElement(e,s,a,n,d);for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&Li(f,t))continue;let o={delay:n,...fi(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){st.update(()=>r.set(i));continue}let p=!1;if(window.MotionHandoffAnimation){let n=Ii(e);if(n){let e=window.MotionHandoffAnimation(n,t,st);e!==null&&(o.startTime=e,p=!0)}}Ni(e,t);let m=l??e.shouldReduceMotion;r.start(bi(t,r,i,m&&Di.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>st.update(()=>{o&&ji(e,o)});d.length?Promise.all(d).then(t):t()}return d}var zi={test:e=>e===`auto`,parse:e=>e},Bi=e=>t=>t.test(e),Vi=[yt,A,Ft,Pt,Lt,It,zi],Hi=e=>Vi.find(Bi(e));function Ui(e){return typeof e==`number`?e===0:e===null?!0:e===`none`||e===`0`||we(e)}var Wi=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function Gi(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(Ct)||[];if(!r)return e;let i=n.replace(r,``),a=+!!Wi.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var Ki=/\b([a-z-]*)\(.*?\)/gu,qi={...M,getAnimatableNone:e=>{let t=e.match(Ki);return t?t.map(Gi).join(` `):e}},Ji={...M,getAnimatableNone:e=>{let t=M.parse(e);return M.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},Yi={...yt,transform:Math.round},Xi={borderWidth:A,borderTopWidth:A,borderRightWidth:A,borderBottomWidth:A,borderLeftWidth:A,borderRadius:A,borderTopLeftRadius:A,borderTopRightRadius:A,borderBottomRightRadius:A,borderBottomLeftRadius:A,width:A,maxWidth:A,height:A,maxHeight:A,top:A,right:A,bottom:A,left:A,inset:A,insetBlock:A,insetBlockStart:A,insetBlockEnd:A,insetInline:A,insetInlineStart:A,insetInlineEnd:A,padding:A,paddingTop:A,paddingRight:A,paddingBottom:A,paddingLeft:A,paddingBlock:A,paddingBlockStart:A,paddingBlockEnd:A,paddingInline:A,paddingInlineStart:A,paddingInlineEnd:A,margin:A,marginTop:A,marginRight:A,marginBottom:A,marginLeft:A,marginBlock:A,marginBlockStart:A,marginBlockEnd:A,marginInline:A,marginInlineStart:A,marginInlineEnd:A,fontSize:A,backgroundPositionX:A,backgroundPositionY:A,rotate:Pt,pathRotation:Pt,rotateX:Pt,rotateY:Pt,rotateZ:Pt,scale:xt,scaleX:xt,scaleY:xt,scaleZ:xt,skew:Pt,skewX:Pt,skewY:Pt,distance:A,translateX:A,translateY:A,translateZ:A,x:A,y:A,z:A,perspective:A,transformPerspective:A,opacity:bt,originX:Rt,originY:Rt,originZ:A,zIndex:Yi,fillOpacity:bt,strokeOpacity:bt,numOctaves:Yi},Zi={...Xi,color:j,backgroundColor:j,outlineColor:j,fill:j,stroke:j,borderColor:j,borderTopColor:j,borderRightColor:j,borderBottomColor:j,borderLeftColor:j,filter:qi,WebkitFilter:qi,mask:Ji,WebkitMask:Ji},Qi=e=>Zi[e],$i=new Set([qi,Ji]);function ea(e,t){let n=Qi(e);return $i.has(n)||(n=M),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var ta=new Set([`auto`,`none`,`0`]);function na(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!ta.has(t)&&Jt(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=ea(n,i)}var ra=class extends Tr{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),gt(r))){let i=Ci(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!Di.has(n)||e.length!==2)return;let[r,i]=e,a=Hi(r),o=Hi(i);if(vt(r)!==vt(i)&&_r[n]){this.needsMeasurement=!0;return}if(a!==o)if(pr(a)&&pr(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else _r[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||Ui(e[t]))&&n.push(t);n.length&&na(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=_r[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&e.getValue(n,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let i=n.length-1,a=n[i];n[i]=_r[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}};function ia(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var aa=(e,t)=>t&&typeof e==`number`?t.transform(e):e,{schedule:oa,cancel:sa}=ot(queueMicrotask,!1);function ca(e){return Ce(e)&&`ownerSVGElement`in e}function la(e){return ca(e)&&e.tagName===`svg`}var ua=[...Vi,j,M],da=e=>ua.find(Bi(e)),fa=0,pa=()=>`motion-view-${fa++}`,ma=e=>e.startsWith(`motion-view-`);function ha(e,t,n){t&&(e.style?.setProperty(`view-transition-class`,t),n.push(e))}function ga(e,t,n,r,i){if(n&&(e.style?.setProperty(`view-transition-group`,n),r.push(e),n!==`none`&&i)){let n=getComputedStyle(e);(n.overflowX!==`visible`||n.overflowY!==`visible`)&&i.add(t)}}function _a(e,t,n,r,i,a=[],o,s=[],c){let l=ia(e);if(r)return l.map((e,l)=>{let u=t.get(e);if(u)return u;let d=r[l]??pa();return e.style?.setProperty(`view-transition-name`,d),n.push(e),t.set(e,d),ha(e,i,a),ga(e,d,o,s,c),d});let u=l.map(e=>t.has(e)?void 0:getComputedStyle(e).getPropertyValue(`view-transition-name`));return l.map((e,r)=>{let l=t.get(e);if(l)return l;let d=u[r],f;return d&&d!==`none`&&d!==`auto`&&d!==`match-element`&&!ma(d)?f=d:(f=pa(),e.style?.setProperty(`view-transition-name`,f),n.push(e)),t.set(e,f),ha(e,i,a),ga(e,f,o,s,c),f})}function va(e,t=[],n=[]){for(let t of e)t.style?.removeProperty(`view-transition-name`);for(let e of t)e.style?.removeProperty(`view-transition-class`);for(let e of n)e.style?.removeProperty(`view-transition-group`)}function ya(e){return e===`layout`?`group`:e===`enter`||e===`new`?`new`:`old`}var ba={},xa=null,Sa={set:(e,t)=>{ba[e]=t},commit:()=>{xa||(xa=document.createElement(`style`),xa.id=`motion-view`);let e=``;for(let t in ba){let n=ba[t];e+=`${t} {\n`;for(let[t,r]of Object.entries(n))e+=` ${t}: ${r};\n`;e+=`}
|
|
2
|
+
`}xa.textContent=e,document.head.appendChild(xa),ba={}},remove:()=>{xa&&xa.parentElement&&xa.parentElement.removeChild(xa)}};function Ca(e){let t=e.match(/::view-transition-(old|new|group-children|group|image-pair)\((.*?)\)/);return t?{layer:t[2],type:t[1]}:null}function wa(){return document.getAnimations().filter(e=>{let{effect:t}=e;return!!t&&t.target===document.documentElement&&t.pseudoElement?.startsWith(`::view-transition`)})}function Ta(e,t){return t.has(e)&&Object.keys(t.get(e)).length>0}var Ea=[`layout`,`enter`,`exit`,`new`,`old`],Da={group:[`layout`],new:[`new`,`enter`],old:[`old`,`exit`]},Oa={new:{opacity:0,scale:.85},old:{opacity:1,scale:1}},ka=.2;function Aa(e){let{update:t,targets:n,resolveDefs:r,cropOverride:i,pairs:a,classNames:o,flatGroups:s,options:c}=e;if(!document.startViewTransition)return(async()=>(await t(),new ni([])))();let l=new Map,u=[],d=[],f=[],p=new Set,m=new Map,h=new Set,g=new Map,_=new Map,v=new Map,y=new Map,b=e=>{n.forEach((t,n)=>{let c=o.get(n),h=n===`root`||!r.has(n)?void 0:s.has(n)?`none`:`contain`,b;if(n===`root`||!r.has(n))b=[n];else if(a.has(n))if(e===`old`)y.set(n,ia(n)),b=_a(n,l,u,void 0,c,d,h,f,p),v.set(n,b);else{for(let e of y.get(n)??[])e.style?.removeProperty(`view-transition-name`),l.delete(e);b=_a(a.get(n),l,u,v.get(n),c,d,h,f,p)}else b=_a(n,l,u,void 0,c,d,h,f,p);let x=i.get(n);b.forEach((n,r)=>{let i=m.get(n);m.set(n,i&&i!==t?{...i,...t}:t),x!==void 0&&g.set(n,x);let a=_.get(n)??{};a[e]=[r,b.length],_.set(n,a)})})},x=(e,t)=>{let n=_.get(e);return(t===`old`?n?.old:t===`new`?n?.new:n?.new??n?.old)??[-1,1]},S=(e,t,n,r,i)=>{let a=Ma(fi(c,n),fi(ja(e,t)??{},n));return typeof a.delay==`function`&&(a.delay=a.delay(r,i)),a},C=new Map,w=e=>l.forEach((t,n)=>{let r=n.getBoundingClientRect?.();if(r&&r.height){let n=C.get(t)??{};n[e]={width:r.width,height:r.height},C.set(t,n)}}),T=()=>{h.clear();for(let e of _.keys())e!==`root`&&(g.get(e)??ee(e))&&h.add(e)},ee=e=>{let t=C.get(e);return!t?.old||!t?.new||!t.old.height||!t.new.height?!1:Math.abs(t.old.width/t.old.height-t.new.width/t.new.height)>ka},te=()=>{Ta(`root`,n)||Sa.set(`:root`,{"view-transition-name":`none`}),Sa.set(`::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)`,{"animation-timing-function":`linear !important`}),h.forEach(e=>{Sa.set(`::view-transition-group(${e})`,{overflow:`clip`}),Sa.set(`::view-transition-old(${e}), ::view-transition-new(${e})`,{width:`100%`,height:`100%`,"object-fit":`cover`})}),p.forEach(e=>{Sa.set(`::view-transition-group-children(${e})`,{overflow:`clip`})}),Sa.commit()},ne=()=>{va(u,d,f),Sa.remove()},re=async()=>{await t(),b(`new`),w(`new`),T(),te()},ie;try{b(`old`),w(`old`),te(),ie=document.startViewTransition(re)}catch(e){return ne(),Promise.reject(e)}return ie.finished.finally(ne),new Promise((e,t)=>{ie.ready.then(()=>{let t=wa(),n=[],r=new Set,i=new Set;m.forEach((e,t)=>{let a=_.get(t),o=!!a?.new&&!a?.old,s=!!a?.old&&!a?.new;for(let a of Ea){if(!e[a]||a===`enter`&&!o||a===`exit`&&!s)continue;let l=ya(a),[u,d]=x(t,l);if(u===-1)continue;let{keyframes:f,options:p}=e[a];for(let[m,h]of Object.entries(f)){if(h==null)continue;if(m===`x`||m===`y`){Me(!1,`animateView() animates view-transition layers with CSS properties; the "${m}" shorthand has no effect - use transform, e.g. { transform: "translateX(40px)" }.`);continue}if(a===`new`&&o&&e.enter?.keyframes[m]!=null||a===`old`&&s&&e.exit?.keyframes[m]!=null)continue;let f=Ma(fi(c,m),fi(p,m));if(!Array.isArray(h)){let t=a===`enter`?e.exit?.keyframes[m]:void 0,n=t==null?m===`opacity`||(l===`new`?o:s)?Oa[l]?.[m]:void 0:Array.isArray(t)?t[t.length-1]:t;n!==void 0&&(h=[n,h])}typeof f.delay==`function`&&(f.delay=f.delay(u,d)),f.duration&&=D(f.duration),f.delay&&=D(f.delay),n.push(new Rr({...f,element:document.documentElement,name:m,pseudoElement:`::view-transition-${l}(${t})`,keyframes:h})),r.add(`${t}:${l}`),m===`opacity`&&i.add(`${t}:${l}`)}}});for(let e of t){if(e.playState===`finished`)continue;let{effect:t}=e;if(!t||!(t instanceof KeyframeEffect))continue;let{pseudoElement:a}=t;if(!a)continue;let o=Ca(a);if(!o)continue;let s=m.get(o.layer);if(r.has(`${o.layer}:${o.type}`)){i.has(`${o.layer}:new`)&&i.has(`${o.layer}:old`)&&t.getKeyframes().some(e=>e.mixBlendMode)?n.push(new ai(e)):e.cancel();continue}let c=_.get(o.layer),l=(o.type===`old`||o.type===`new`)&&!!c?.old&&!!c?.new,u=o.type.startsWith(`group`)||l?`group`:o.type,[d,f]=x(o.layer,u),p=S(s,u,u===`group`?`layout`:``,d===-1?0:d,f),h=p.visualDuration;p.duration&&=D(p.duration),p=Lr(p);let g=l&&h!==void 0?D(h):p.duration,v=l?`linear`:Pr(p.ease,p.duration);t.updateTiming({delay:D(p.delay??0),duration:g,easing:v}),n.push(new ai(e))}e(new ni(n))}).catch(()=>ie.updateCallbackDone.then(()=>e(new ni([])),t))})}function ja(e,t){for(let n of Da[t]??[]){let t=e?.[n]?.options;if(t)return t}}function Ma(e,t){let n={...e,...t};return t.duration!==void 0&&(t.visualDuration===void 0&&delete n.visualDuration,t.type===void 0&&delete n.type),n}var Na=[],Pa=null;function Fa(){Pa=null;let[e]=Na;e&&Ia(e)}function Ia(e){ve(Na,e),Pa=e,Aa(e).then(t=>(e.notifyReady(t),t.finished)).catch(t=>e.notifyReject(t)).finally(Fa)}function La(){for(let e=Na.length-1;e>=0;e--){let t=Na[e],{interrupt:n}=t.options;if(n===`immediate`){let n=Na.slice(0,e+1).map(e=>e.update),r=Na.slice(e+1);t.update=()=>{n.forEach(e=>e())},Na=[t,...r];break}}(!Pa||Na[0]?.options.interrupt===`immediate`)&&Fa()}function Ra(e){Na.push(e),oa.render(La)}var za=class{constructor(e,t={}){this.currentSubject=`root`,this.targets=new Map,this.resolveDefs=new Set,this.cropOverride=new Map,this.pairs=new Map,this.classNames=new Map,this.flatGroups=new Set,this.notifyReady=Ee,this.notifyReject=Ee,this.readyPromise=new Promise((e,t)=>{this.notifyReady=e,this.notifyReject=t}),this.update=e,this.options={interrupt:`wait`,...t},this.readyPromise.catch(Ee),Ra(this)}add(e,t){return this.currentSubject=e,this.resolveDefs.add(e),t!==void 0&&this.pairs.set(e,t),this.targets.has(e)||this.targets.set(e,{}),this}crop(e=!0){return this.cropOverride.set(this.currentSubject,e),this}group(e=!0){return e?this.flatGroups.delete(this.currentSubject):this.flatGroups.add(this.currentSubject),this}class(e){return this.classNames.set(this.currentSubject,e),this}layout(e={}){return this.updateTarget(`layout`,{},e),this}enter(e,t){return this.updateTarget(`enter`,e,t),this}exit(e,t){return this.updateTarget(`exit`,e,t),this}new(e,t){return this.updateTarget(`new`,e,t),this}old(e,t){return this.updateTarget(`old`,e,t),this}updateTarget(e,t,n={}){let{currentSubject:r,targets:i}=this;i.has(r)||i.set(r,{});let a=i.get(r);a[e]={keyframes:t,options:n}}then(e,t){return this.readyPromise.then(e,t)}};function Ba(e,t={}){return new za(e,t)}var Va=()=>({min:0,max:0}),Ha=()=>({x:Va(),y:Va()}),Ua=new WeakMap;function Wa(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function Ga(e){return typeof e==`string`||Array.isArray(e)}var Ka=[`initial`,`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`];function qa(e){return Wa(e.animate)||Ka.some(t=>Ga(e[t]))}function Ja(e){return!!(qa(e)||e.variants)}function Ya(e,t,n){for(let r in t){let i=t[r],a=n[r];if(P(i))e.addValue(r,i);else if(P(a))e.addValue(r,ui(i,{owner:e}));else if(a!==i)if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,ui(t===void 0?i:t,{owner:e}))}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var Xa={current:null},Za={current:!1},Qa=typeof window<`u`;function $a(){if(Za.current=!0,Qa)if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>Xa.current=e.matches;e.addEventListener(`change`,t),t()}else Xa.current=!1}var eo=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],to={},no=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Tr,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=k.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,st.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=qa(t),this.isVariantNode=Ja(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&P(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];this.current=e,Ua.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(Za.current||$a(),this.shouldReduceMotion=Xa.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),ct(this.notifyUpdate),ct(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&Jr.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new Rr({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:D(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=fr.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&st.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in to){let t=to[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ha()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<eo.length;t++){let n=eo[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=Ya(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=ui(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(Se(n)||we(n))?n=parseFloat(n):!da(n)&&M.test(t)&&(n=ea(e,t)),this.setBaseTarget(e,P(n)?n.get():n)),P(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=Ti(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!P(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new ke),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){oa.render(this.render)}},ro=class extends no{constructor(){super(...arguments),this.KeyframeResolver=ra}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;P(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}};function io({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function ao(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function oo(e,t){return io(ao(e.getBoundingClientRect(),t))}var so={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},co=dr.length;function lo(e,t,n){let r=``,i=!0;for(let a=0;a<co;a++){let o=dr[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=aa(s,Xi[o]);if(!c){i=!1;let t=so[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${aa(a,Xi.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function uo(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(fr.has(e)){o=!0;continue}else if(mt(e)){i[e]=n;continue}else{let t=aa(n,Xi[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=lo(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}function fo(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function po(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var mo={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`)if(A.test(e))e=parseFloat(e);else return e;return`${po(e,t.target.x)}% ${po(e,t.target.y)}%`}},ho={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=M.parse(e);if(i.length>5)return r;let a=M.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=an(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},go={borderRadius:{...mo,applyTo:[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`]},borderTopLeftRadius:mo,borderTopRightRadius:mo,borderBottomLeftRadius:mo,borderBottomRightRadius:mo,boxShadow:ho};function _o(e,{layout:t,layoutId:n}){return fr.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!go[e]||e===`opacity`)}function vo(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(P(r[t])||i&&P(i[t])||_o(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function yo(e){return window.getComputedStyle(e)}var bo=class extends ro{constructor(){super(...arguments),this.type=`html`,this.renderInstance=fo}readValueFromInstance(e,t){if(fr.has(t))return this.projection?.isProjecting?sr(t):lr(e,t);{let n=yo(e),r=(mt(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return oo(e,t)}build(e,t,n){uo(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return vo(e,t,n)}};function xo(e,t){return e in t}var So=class extends no{constructor(){super(...arguments),this.type=`object`}readValueFromInstance(e,t){if(xo(t,e)){let n=e[t];if(typeof n==`string`||typeof n==`number`)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(e,t){delete t.output[e]}measureInstanceViewportBox(){return Ha()}build(e,t){Object.assign(e.output,t)}renderInstance(e,{output:t}){Object.assign(e,t)}sortInstanceNodePosition(){return 0}},Co={offset:`stroke-dashoffset`,array:`stroke-dasharray`},wo={offset:`strokeDashoffset`,array:`strokeDasharray`};function To(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?Co:wo;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var Eo=[`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function Do(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(uo(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox);for(let e of Eo)d[e]!==void 0&&(f[e]=d[e],delete d[e]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&To(d,i,a,o,!1)}var Oo=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),ko=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function Ao(e,t,n,r){fo(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(Oo.has(n)?n:Pi(n),t.attrs[n])}function jo(e,t,n){let r=vo(e,t,n);for(let n in e)if(P(e[n])||P(t[n])){let t=dr.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var Mo=class extends ro{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=Ha}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(fr.has(t)){let e=Qi(t);return e&&e.default||0}return t=Oo.has(t)?t:Pi(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return jo(e,t,n)}build(e,t,n){Do(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){Ao(e,t,n,r)}mount(e){this.isSVGTag=ko(e.tagName),super.mount(e)}};function No(e,t,n){let r=P(e)?e:ui(e);return r.start(bi(``,r,t,n)),r.animation}function Po(e){return typeof e==`object`&&!Array.isArray(e)}function Fo(e,t,n,r){return e==null?[]:typeof e==`string`&&Po(t)?ia(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>e!=null):[e]}function Io(e,t,n){return e*(t+1)+n*t}function Lo(e,t,n,r){return typeof t==`number`?t:t.startsWith(`-`)||t.startsWith(`+`)?Math.max(0,e+parseFloat(t)):t===`<`?n:t.startsWith(`<`)?Math.max(0,n+parseFloat(t.slice(1))):r.get(t)??e}function Ro(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];i.at>t&&i.at<n&&(ve(e,i),r--)}}function zo(e,t,n,r,i,a){Ro(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:an(i,a,r[o]),easing:Qe(n,o)})}function Bo(e,t,n=0){let r=t+1+t*n;for(let t=0;t<e.length;t++)e[t]=e[t]/r}function Vo(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var Ho=`easeInOut`,Uo=20;function Wo(e,{defaultTransition:t={},...n}={},r,i){let a=t.duration||.3,o=new Map,s=new Map,c={},l=new Map,u=0,d=0,f=0;for(let n=0;n<e.length;n++){let o=e[n];if(typeof o==`string`){l.set(o,d);continue}else if(!Array.isArray(o)){l.set(o.name,Lo(d,o.at,u,l));continue}let[p,m,h={}]=o;h.at!==void 0&&(d=Lo(d,h.at,u,l));let g=0,_=(e,n,r,o=0,s=0)=>{let c=qo(e),{delay:l=0,times:u=Vn(c),type:p=t.type||`keyframes`,repeat:m,repeatType:h,repeatDelay:_=0,...v}=n,{ease:y=t.ease||`easeOut`,duration:b}=n,x=typeof l==`function`?l(o,s):l,S=c.length,C=Ir(p)?p:i?.[p||`keyframes`];if(S<=2&&C){let e=100;if(S===2&&Xo(c)){let t=c[1]-c[0];e=Math.abs(t)}let n={...t,...v};b!==void 0&&(n.duration=D(b));let r=wn(n,e,C);y=r.ease,b=r.duration}b??=a;let w=d+x;u.length===1&&u[0]===0&&(u[1]=1);let T=u.length-c.length;if(T>0&&Bn(u,T),c.length===1&&c.unshift(null),m&&`${m}${Uo}`,m&&m<Uo){let e=b>0?_/b:0;b=Io(b,m,_);let t=[...c],n=[...u];y=Array.isArray(y)?[...y]:[y];let r=[...y],i=h===`reverse`||h===`mirror`,a=t,o=r;i&&(a=[...t].reverse(),h===`reverse`&&(o=[...r].reverse().map(e=>typeof e==`function`?Be(e):e)));for(let s=0;s<m;s++){let l=i&&s%2==0,d=l?a:t,f=l?o:r,p=(s+1)*(1+e);e>0&&(c.push(c[c.length-1]),u.push(p),y.push(`linear`)),c.push(...d);for(let e=0;e<d.length;e++)u.push(n[e]+p),y.push(e===0?`linear`:Qe(f,e-1))}Bo(u,m,e)}let ee=w+b;zo(r,c,y,u,w,ee),g=Math.max(x+b,g),f=Math.max(ee,f)};if(P(p)){let e=Go(p,s);_(m,h,Ko(`default`,e))}else{let e=Fo(p,m,r,c),t=e.length;for(let n=0;n<t;n++){m=m,h=h;let r=e[n],i=Go(r,s);for(let e in m)_(m[e],Jo(h,e),Ko(e,i),n,t)}}u=d,d+=g}return s.forEach((e,r)=>{for(let i in e){let a=e[i];a.sort(Vo);let s=[],c=[],l=[];for(let e=0;e<a.length;e++){let{at:t,value:n,easing:r}=a[e];s.push(n),c.push(Oe(0,f,t)),l.push(r||`easeOut`)}c[0]!==0&&(c.unshift(0),s.unshift(s[0]),l.unshift(Ho)),c[c.length-1]!==1&&(c.push(1),s.push(null)),o.has(r)||o.set(r,{keyframes:{},transition:{}});let u=o.get(r);u.keyframes[i]=s;let{type:d,...p}=t;u.transition[i]={...p,duration:f,ease:l,times:c,...n}}}),o}function Go(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function Ko(e,t){return t[e]||(t[e]=[]),t[e]}function qo(e){return Array.isArray(e)?e:[e]}function Jo(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var Yo=e=>typeof e==`number`,Xo=e=>e.every(Yo);function Zo(e){let t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=ca(e)&&!la(e)?new Mo(t):new bo(t);n.mount(e),Ua.set(e,n)}function Qo(e){let t=new So({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});t.mount(e),Ua.set(e,t)}function $o(e,t){return P(e)||typeof e==`number`||typeof e==`string`&&!Po(t)}function es(e,t,n,r){let i=[];if($o(e,t))i.push(No(e,Po(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;let a=Fo(e,t,r),o=a.length;for(let e=0;e<o;e++){let r=a[e],s=r instanceof Element?Zo:Qo;Ua.has(r)||s(r);let c=Ua.get(r),l={...n};`delay`in l&&typeof l.delay==`function`&&(l.delay=l.delay(e,o)),i.push(...Ri(c,{...t,transition:l},{}))}}return i}function ts(e,t,n){let r=[];return Wo(e.map(e=>{if(Array.isArray(e)&&typeof e[0]==`function`){let t=e[0],n=ui(0);return n.on(`change`,t),e.length===1?[n,[0,1]]:e.length===2?[n,[0,1],e[1]]:[n,e[1],e[2]]}return e}),t,n,{spring:Pn}).forEach(({keyframes:e,transition:t},n)=>{r.push(...es(n,e,t))}),r}function ns(e){return Array.isArray(e)&&e.some(Array.isArray)}function rs(e={}){let{scope:t,reduceMotion:n,skipAnimations:r}=e;function i(e,i,a){let o=[],s,c={};if(n!==void 0&&(c.reduceMotion=n),r!==void 0&&(c.skipAnimations=r),ns(e)){let{onComplete:n,...r}=i||{};typeof n==`function`&&(s=n),o=ts(e,{...c,...r},t)}else{let{onComplete:n,...r}=a||{};typeof n==`function`&&(s=n),o=es(e,i,{...c,...r},t)}let l=new ii(o);return s&&l.finished.then(s),t&&(t.animations.push(l),l.finished.then(()=>{ve(t.animations,l)})),l}return i}var is=rs(),as=e=>({finished:(async()=>{await e?.()})(),cancel(){},stop(){},complete(){}}),os=(e,t)=>{let n=!1,r=()=>{n||(n=!0,t?.())};return{finished:e.finished.then(()=>{},()=>{}).finally(r),cancel(){e.cancel(),r()},stop(){e.stop(),r()},complete(){e.complete(),r()}}},ss=(e,t)=>{let n=typeof e==`object`&&e&&`get`in e?e:ui(e);return{value:n,animateTo(e,r){return os(is(n,e,{...t,...r}))}}},cs=(...e)=>({finished:Promise.allSettled(e.map(e=>e.finished)).then(()=>{}),cancel(){e.forEach(e=>e.cancel())},stop(){e.forEach(e=>e.stop())},complete(){e.forEach(e=>e.complete())}}),ls=(...e)=>{let t=!1,n=null;return{finished:(async()=>{for(let r of e){if(t)break;n=r(),await n.finished.catch(()=>{})}})(),cancel(){t=!0,n?.cancel()},stop(){t=!0,n?.stop()},complete(){n?.complete()}}},us=(e,t,n,r=e=>String(e))=>{let i=n=>{e.style[t]=r(n)};return i(n.get()),n.on(`change`,i)},ds=(e,t,n)=>{let r=()=>{e.style.transform=n(t)},i=Object.values(t).map(e=>e.on(`change`,r));return r(),()=>i.forEach(e=>e())},F={fast:.14,normal:.18,slow:.24},I={out:[.23,1,.32,1],inOut:[.77,0,.175,1]},fs={popover:{duration:F.fast,ease:I.out},modal:{duration:F.slow,ease:I.out},toast:{duration:F.normal,ease:I.out},sidebar:{duration:F.slow,ease:I.out},sheet:{duration:F.slow,ease:I.out}},ps=`(prefers-reduced-motion: reduce)`,ms=()=>typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(ps).matches,hs=(e=`user`)=>e===`always`?!0:e===`never`?!1:ms(),gs=(e,t={},n=`user`)=>hs(n)?{...e,duration:0,...t}:e,_s=e=>{let t={};return`opacity`in e&&(t.opacity=e.opacity),t},vs=`data-ui-motion-key`,ys=`data-ui-motion-layout`,bs=`data-ui-motion-temp`,xs=`data-ui-motion-active`,Ss=e=>typeof e==`object`&&!!e&&Symbol.iterator in e,Cs=e=>{let t=globalThis.CSS;return typeof t?.escape==`function`?t.escape(e):e.replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`)},ws=(e=document)=>typeof e==`string`?Array.from(document.querySelectorAll(e)):e instanceof Document||e instanceof Element?[e]:Ss(e)?Array.from(e):[document],Ts=(e,t)=>ws(e).flatMap(e=>Array.from(e.querySelectorAll(t))),Es=e=>`[${vs}="${Cs(e)}"]`,Ds=e=>`[data-ui-${Cs(e)}]`,Os=e=>e instanceof Element?null:typeof e==`string`?e:`selector`in e?e.selector:`part`in e?Ds(e.part):`key`in e?Es(e.key):null,ks=(e=document,t)=>{if(!t)return[];let n=(Array.isArray(t)?t:[t]).flatMap(t=>{if(t instanceof Element)return[t];if(typeof t==`object`&&`from`in t)return[...ks(e,t.from),...ks(e,t.to)];let n=Os(t);return n?Ts(e,n):[]});return Array.from(new Set(n))},As=(e,t)=>{if(e instanceof Element)return[e];let n=Os(e);return n?typeof e==`string`||`selector`in e||`key`in e||`part`in e?[n]:ks(t,e):[]},js=(e=document,t)=>t?(Array.isArray(t)?t:[t]).flatMap(t=>{if(t instanceof Element)return[{subject:t}];if(typeof t==`object`&&`from`in t){let n=As(t.from,e),r=As(t.to,e);return n.flatMap((e,t)=>{let n=r[t]??r[0];return n?[{subject:e,newSubject:n}]:[]})}let n=Os(t);return n?[{subject:n}]:[]}):[],Ms=(e=document,t={})=>{let n=ws(e).filter(e=>e instanceof Element),r=[],i=(e,t,n)=>{r.push({element:e,attr:t,previous:e.getAttribute(t)}),e.setAttribute(t,n)};return n.forEach(e=>{let n=!1;(t.layout??!0)&&i(e,ys,``),t.key&&!e.hasAttribute(`data-ui-motion-key`)&&(i(e,vs,t.key),n=!0),n&&i(e,bs,``)}),()=>{r.reverse().forEach(({element:e,attr:t,previous:n})=>{if(n===null){e.removeAttribute(t);return}e.setAttribute(t,n)})}},Ns=e=>{let t=e.getAttribute(`data-side`),n=e.getAttribute(`data-align`);return`${t===`left`?`right`:t===`right`?`left`:n===`end`?`right`:n===`start`?`left`:`center`} ${t===`top`?`bottom`:t===`bottom`?`top`:`center`}`},Ps=e=>typeof e==`string`,Fs=(e,t,n)=>{if(t===`fade`)return{opacity:e===`enter`?[0,1]:[1,0]};if(t===`sidebar`){let t=n?.dataset.side===`right`?`translateX(100%)`:`translateX(-100%)`;return e===`enter`?{transform:[t,`translateX(0)`]}:{transform:[`translateX(0)`,t]}}if(t===`sheet`){let t=n?.dataset.side,r=t===`right`?`inset(0 0 0 100%)`:t===`left`?`inset(0 100% 0 0)`:t===`bottom`?`inset(100% 0 0 0)`:`inset(0 0 100% 0)`;return e===`enter`?{clipPath:[r,`inset(0 0 0 0)`]}:{clipPath:[`inset(0 0 0 0)`,r]}}if(t===`toast`){let t=n?.style,r=Number.parseFloat(t?.getPropertyValue(`--ui-toast-stack-offset`)||`0`)||0,i=Number.parseFloat(t?.getPropertyValue(`--ui-toast-stack-scale`)||`1`)||1,a=Number.parseFloat(t?.getPropertyValue(`--ui-toast-stack-direction`)||`1`)||1,o=Number.parseFloat(t?.getPropertyValue(`--ui-toast-stack-opacity`)||`1`)||1,s=(e,t)=>`translateY(${r+e*a}px) scale(${i*t})`;return e===`enter`?{opacity:[0,o],transform:[s(8,.98),s(0,1)]}:{opacity:[o,0],transform:[s(0,1),s(-4,.98)]}}return t===`modal`?e===`enter`?{opacity:[0,1],transform:[`translateY(8px) scale(0.98)`,`translateY(0) scale(1)`]}:{opacity:[1,0],transform:[`translateY(0) scale(1)`,`translateY(4px) scale(0.98)`]}:e===`enter`?{opacity:[0,1],transform:[`scale(0.97)`,`scale(1)`]}:{opacity:[1,0],transform:[`scale(1)`,`scale(0.97)`]}},Is=(e,t,n=`fade`,r={})=>{if(!(e instanceof HTMLElement))return{finished:Promise.resolve(),cancel(){},stop(){},complete(){}};let{reducedMotion:i,...a}=r,o=e.style.transformOrigin;(n===`popover`||n===`menu`)&&(e.style.transformOrigin=Ns(e)),e.setAttribute(xs,t);let s=hs(i),c=Ps(n)?Fs(t,n,e):n,l=s?_s(c):c,u=!Ps(n)||n===`menu`?`popover`:n,d=u===`fade`?{duration:F.fast,ease:I.out}:fs[u];return os(is(e,l,{...d,duration:s?.08:d.duration,...a}),()=>{e.style.transformOrigin=o,e.getAttribute(`data-ui-motion-active`)===t&&e.removeAttribute(xs)})},Ls=({element:e,preset:t=`fade`,enter:n,exit:r,options:i,enterOptions:a,exitOptions:o,owner:s=`component`})=>{let c=null,l=0,u=(u,d={})=>{let f=++l;c?.cancel(),c=null,d.before?.();let p=e();if(!(p instanceof Element))return d.after?.(),{finished:Promise.resolve(),cancel(){},stop(){},complete(){}};s===`component`&&p.setAttribute(`data-ui-motion-owner`,`component`);let m=u===`enter`?n??t:r??t,h=u===`enter`?a:o,g=Is(p,u,m,{...i,...h});return c=g,g.finished.finally(()=>{f!==l||c!==g||(c=null,d.after?.())}),g},d=()=>{l+=1,c?.cancel(),c=null};return{get runId(){return l},enter(e){return u(`enter`,e)},exit(e){return u(`exit`,e)},cancel:d,destroy:d}},Rs={duration:F.slow,ease:I.inOut},zs={transform:[`none`,`none`]},Bs=`[${vs}], [${ys}]`,Vs=(e,t,n={})=>{if(typeof document.startViewTransition!=`function`||hs(n.reducedMotion))return as(e);let r=t??(n.layout||n.preset===`layout`?Bs:null),i=js(n.scope??document,r),a=Ba(e,{duration:F.normal,ease:I.inOut,interrupt:`immediate`,...n.transition});return i.forEach(({subject:e,newSubject:t})=>{a.add(e,t),n.className&&a.class(n.className),typeof n.crop==`boolean`&&a.crop(n.crop),typeof n.group==`boolean`&&a.group(n.group),n.layout!==!1&&n.preset!==`none`&&a.layout(typeof n.layout==`object`?n.layout:Rs);let r=n.newView??(n.preset===`stream`?zs:void 0),i=n.oldView??(n.preset===`stream`?zs:void 0),o=n.enter,s=n.exit;r&&a.new(r,{duration:F.fast,ease:I.out}),i&&a.old(i,{duration:F.fast,ease:I.out}),o&&a.enter(o,{duration:F.fast,ease:I.out}),s&&a.exit(s,{duration:F.fast,ease:I.out})}),{finished:Promise.resolve(a.then(()=>{},()=>{})),cancel(){wa().forEach(e=>e.cancel())},stop(){wa().forEach(e=>e.pause())},complete(){wa().forEach(e=>{try{e.finish()}catch{e.cancel()}})}}},Hs=e=>e.selector?e.selector:e.target?e.target.startsWith(`#`)?e.target:`#${Cs(e.target)}`:null,Us=e=>{let t=getComputedStyle(e);return[t.overflow,t.overflowX,t.overflowY].some(e=>e&&e!==`visible`)},Ws=e=>{let t=e.parentElement;for(;t&&t!==document.body&&t!==document.documentElement;){if(Us(t))return t;t=t.parentElement}return null},Gs=e=>e.width===0&&e.height===0&&e.top===0&&e.left===0,Ks=e=>{let t=Ws(e);if(!t)return!0;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect();if(Gs(n)&&Gs(r))return!0;let i=Math.min(n.height,160);return n.top>=r.top&&n.left<r.right&&n.right>r.left&&n.bottom+i<=r.bottom},qs=e=>{let t=[];return e.forEach(e=>{let n=Hs(e),r=n?document.querySelector(n):null;if(!r)return;let i=[],a=r.getAttribute(`data-ui-motion-key`);if(r.querySelectorAll(`[data-ui-motion-key]`).forEach(e=>{let t=e.getAttribute(`data-ui-motion-key`);if(t&&Ks(e)){let e=Es(t);i.push({from:{selector:e},to:{selector:e}})}}),(a||r.hasAttribute(`data-ui-motion-layout`))&&Ks(r)){let e=a?Es(a):n;i.unshift({from:{selector:e},to:{selector:e}})}t.push(...i)}),t},Js=(e,t,n={})=>{let r=n.update;if(!r)return as();let i=qs(Array.isArray(t)?t:[t]);if(i.length===0||hs(n.reducedMotion))return as(r);let a={...n,preset:`stream`};return n.scope&&n.scope!==`target`&&(a.scope=n.scope),Vs(r,i,a)},Ys={createAnimator:ss,parallel:cs,sequential:ls,bindTransform:ds,bindStyle:us,withReducedMotion:gs,resolveTargets:ks,applyViewKeys:Ms,animateView:Vs,animatePresence:Is,createPresenceLifecycle:Ls,animateStreamPatch:Js},Xs=(e,t)=>{if(!(!e||typeof t.evaluate!=`function`))return t.evaluate(e)},Zs=e=>{if(typeof e==`string`)return{key:e};if(typeof e==`object`&&e){let t=e.key??e.id;return t?{key:t}:{}}return{}},Qs=e=>{e.directive(`ui-layout`,(e,{expression:t},n)=>{if(!(e instanceof Element))return;let r=Ms(e,Zs(Xs(t,n)));n.cleanup?.(()=>{r()})})},$s=e=>{e.bind(`UiDisabled`,function(){let e=this;return{":aria-disabled"(){return e.props.disabled?`true`:null},":data-disabled"(){return e.props.disabled?`true`:null}}}),e.bind(`UiInvalid`,function(){let e=this;return{":aria-invalid"(){return e.props.invalid?`true`:null},":aria-describedby"(){return e.describedBy||null},":data-invalid"(){return e.props.invalid?`true`:null}}}),e.bind(`UiInteractive`,function(){let e=this;return{":data-ui-interactive"(){return e.isInteractive??e.props?.interactive?e.interactiveKind||`true`:null}}}),e.bind(`UiSelected`,function(){let e=this;return{":aria-selected"(){return e.isSelected?`true`:`false`},":data-selected"(){return e.isSelected?`true`:null}}}),e.bind(`UiActiveDescendant`,function(){let e=this;return{":aria-activedescendant"(){return e.activeId}}})},ec=e=>{ge(e),Qs(e),$s(e)},tc=Math.min,nc=Math.max,rc=Math.round,ic=Math.floor,ac=e=>({x:e,y:e}),oc={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function sc(e,t,n){return nc(e,tc(t,n))}function cc(e,t){return typeof e==`function`?e(t):e}function lc(e){return e.split(`-`)[0]}function uc(e){return e.split(`-`)[1]}function dc(e){return e===`x`?`y`:`x`}function fc(e){return e===`y`?`height`:`width`}function pc(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function mc(e){return dc(pc(e))}function hc(e,t,n){n===void 0&&(n=!1);let r=uc(e),i=mc(e),a=fc(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=wc(o)),[o,wc(o)]}function gc(e){let t=wc(e);return[_c(e),t,_c(t)]}function _c(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var vc=[`left`,`right`],yc=[`right`,`left`],bc=[`top`,`bottom`],xc=[`bottom`,`top`];function Sc(e,t,n){switch(e){case`top`:case`bottom`:return n?t?yc:vc:t?vc:yc;case`left`:case`right`:return t?bc:xc;default:return[]}}function Cc(e,t,n,r){let i=uc(e),a=Sc(lc(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(_c)))),a}function wc(e){let t=lc(e);return oc[t]+e.slice(t.length)}function Tc(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ec(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Tc(e)}function Dc(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Oc(e,t,n){let{reference:r,floating:i}=e,a=pc(t),o=mc(t),s=fc(o),c=lc(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(uc(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function kc(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=cc(t,e),p=Ec(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Dc(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Dc(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Ac=50,jc=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:kc},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Oc(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Ac&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Oc(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Mc=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=cc(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=lc(r),_=pc(o),v=lc(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[wc(o)]:gc(o)),x=p!==`none`;!d&&x&&b.push(...Cc(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=hc(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==pc(t))||T.every(e=>pc(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=pc(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}},Nc=new Set([`left`,`top`]);async function Pc(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=lc(n),s=uc(n),c=pc(n)===`y`,l=Nc.has(o)?-1:1,u=a&&c?-1:1,d=cc(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Fc=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Pc(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Ic=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=cc(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=pc(lc(i)),p=dc(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=sc(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=sc(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}};function Lc(){return typeof window<`u`}function Rc(e){return Bc(e)?(e.nodeName||``).toLowerCase():`#document`}function L(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function zc(e){return((Bc(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Bc(e){return Lc()?e instanceof Node||e instanceof L(e).Node:!1}function Vc(e){return Lc()?e instanceof Element||e instanceof L(e).Element:!1}function Hc(e){return Lc()?e instanceof HTMLElement||e instanceof L(e).HTMLElement:!1}function Uc(e){return!Lc()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof L(e).ShadowRoot}function Wc(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=tl(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Gc(e){return/^(table|td|th)$/.test(Rc(e))}function Kc(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var qc=/transform|translate|scale|rotate|perspective|filter/,Jc=/paint|layout|strict|content/,Yc=e=>!!e&&e!==`none`,Xc;function Zc(e){let t=Vc(e)?tl(e):e;return Yc(t.transform)||Yc(t.translate)||Yc(t.scale)||Yc(t.rotate)||Yc(t.perspective)||!$c()&&(Yc(t.backdropFilter)||Yc(t.filter))||qc.test(t.willChange||``)||Jc.test(t.contain||``)}function Qc(e){let t=rl(e);for(;Hc(t)&&!el(t);){if(Zc(t))return t;if(Kc(t))return null;t=rl(t)}return null}function $c(){return Xc??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Xc}function el(e){return/^(html|body|#document)$/.test(Rc(e))}function tl(e){return L(e).getComputedStyle(e)}function nl(e){return Vc(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function rl(e){if(Rc(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Uc(e)&&e.host||zc(e);return Uc(t)?t.host:t}function il(e){let t=rl(e);return el(t)?e.ownerDocument?e.ownerDocument.body:e.body:Hc(t)&&Wc(t)?t:il(t)}function al(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=il(e),i=r===e.ownerDocument?.body,a=L(r);if(i){let e=ol(a);return t.concat(a,a.visualViewport||[],Wc(r)?r:[],e&&n?al(e):[])}else return t.concat(r,al(r,[],n))}function ol(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function sl(e){let t=tl(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Hc(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=rc(n)!==a||rc(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function cl(e){return Vc(e)?e:e.contextElement}function ll(e){let t=cl(e);if(!Hc(t))return ac(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=sl(t),o=(a?rc(n.width):n.width)/r,s=(a?rc(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var ul=ac(0);function dl(e){let t=L(e);return!$c()||!t.visualViewport?ul:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function fl(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==L(e)?!1:t}function pl(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=cl(e),o=ac(1);t&&(r?Vc(r)&&(o=ll(r)):o=ll(e));let s=fl(a,n,r)?dl(a):ac(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=L(a),t=r&&Vc(r)?L(r):r,n=e,i=ol(n);for(;i&&r&&t!==n;){let e=ll(i),t=i.getBoundingClientRect(),r=tl(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=L(i),i=ol(n)}}return Dc({width:u,height:d,x:c,y:l})}function ml(e,t){let n=nl(e).scrollLeft;return t?t.left+n:pl(zc(e)).left+n}function hl(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-ml(e,n),y:n.top+t.scrollTop}}function gl(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=zc(r),s=t?Kc(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=ac(1),u=ac(0),d=Hc(r);if((d||!d&&!a)&&((Rc(r)!==`body`||Wc(o))&&(c=nl(r)),d)){let e=pl(r);l=ll(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?hl(o,c):ac(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function _l(e){return Array.from(e.getClientRects())}function vl(e){let t=zc(e),n=nl(e),r=e.ownerDocument.body,i=nc(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=nc(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+ml(e),s=-n.scrollTop;return tl(r).direction===`rtl`&&(o+=nc(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var yl=25;function bl(e,t){let n=L(e),r=zc(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=$c();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=ml(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=yl&&(a-=o)}else l<=yl&&(a+=l);return{width:a,height:o,x:s,y:c}}function xl(e,t){let n=pl(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Hc(e)?ll(e):ac(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Sl(e,t,n){let r;if(t===`viewport`)r=bl(e,n);else if(t===`document`)r=vl(zc(e));else if(Vc(t))r=xl(t,n);else{let n=dl(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Dc(r)}function Cl(e,t){let n=rl(e);return n===t||!Vc(n)||el(n)?!1:tl(n).position===`fixed`||Cl(n,t)}function wl(e,t){let n=t.get(e);if(n)return n;let r=al(e,[],!1).filter(e=>Vc(e)&&Rc(e)!==`body`),i=null,a=tl(e).position===`fixed`,o=a?rl(e):e;for(;Vc(o)&&!el(o);){let t=tl(o),n=Zc(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||Wc(o)&&!n&&Cl(e,o))?r=r.filter(e=>e!==o):i=t,o=rl(o)}return t.set(e,r),r}function Tl(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Kc(t)?[]:wl(t,this._c):[].concat(n),r],o=Sl(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Sl(t,a[e],i);s=nc(n.top,s),c=tc(n.right,c),l=tc(n.bottom,l),u=nc(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function El(e){let{width:t,height:n}=sl(e);return{width:t,height:n}}function Dl(e,t,n){let r=Hc(t),i=zc(t),a=n===`fixed`,o=pl(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=ac(0);function l(){c.x=ml(i)}if(r||!r&&!a)if((Rc(t)!==`body`||Wc(i))&&(s=nl(t)),r){let e=pl(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?hl(i,s):ac(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Ol(e){return tl(e).position===`static`}function kl(e,t){if(!Hc(e)||tl(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return zc(e)===n&&(n=n.ownerDocument.body),n}function Al(e,t){let n=L(e);if(Kc(e))return n;if(!Hc(e)){let t=rl(e);for(;t&&!el(t);){if(Vc(t)&&!Ol(t))return t;t=rl(t)}return n}let r=kl(e,t);for(;r&&Gc(r)&&Ol(r);)r=kl(r,t);return r&&el(r)&&Ol(r)&&!Zc(r)?n:r||Qc(e)||n}var jl=async function(e){let t=this.getOffsetParent||Al,n=this.getDimensions,r=await n(e.floating);return{reference:Dl(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ml(e){return tl(e).direction===`rtl`}var Nl={convertOffsetParentRelativeRectToViewportRelativeRect:gl,getDocumentElement:zc,getClippingRect:Tl,getOffsetParent:Al,getElementRects:jl,getClientRects:_l,getDimensions:El,getScale:ll,isElement:Vc,isRTL:Ml};function Pl(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Fl(e,t){let n=null,r,i=zc(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=ic(d),h=ic(i.clientWidth-(u+f)),g=ic(i.clientHeight-(d+p)),_=ic(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:nc(0,tc(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!Pl(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Il(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=cl(e),u=i||a?[...l?al(l):[],...t?al(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Fl(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?pl(e):null;c&&g();function g(){let t=pl(e);h&&!Pl(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Ll=Fc,Rl=Ic,zl=Mc,Bl=(e,t,n)=>{let r=new Map,i={platform:Nl,...n},a={...i.platform,_c:r};return jc(e,t,{...i,platform:a})},Vl=(e,t)=>t===`center`?e:`${e}-${t}`,Hl=({reference:e,floating:t,position:n,align:r,gap:i,offset:a,matchReferenceWidth:o=!1})=>{let s=null,c=e=>`${e.getBoundingClientRect().width}px`,l=()=>{let s=e(),l=t();o&&(l.style.width=c(s)),Bl(s,l,{placement:Vl(n(),r()),middleware:[Ll({mainAxis:i(),crossAxis:a()}),zl(),Rl({padding:5})]}).then(({x:e,y:t,strategy:n,placement:r})=>{let[i=`bottom`,a=`center`]=r.split(`-`);Object.assign(l.style,{position:n,inset:`${t}px auto auto ${e}px`,...o?{width:c(s)}:{}}),l.dataset.side=i,l.dataset.align=a})};return{mounted(){return s!==null},mount(){if(s){l();return}s=Il(e(),t(),l)},unmount(){s?.(),s=null},sync(){this.unmount(),this.mount()}}};function Ul(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Ul(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Wl(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Ul(e))&&(r&&(r+=` `),r+=t);return r}var Gl=({values:e})=>Wl(e),Kl=Gl,ql=e=>e.dataset.disabled===`true`||e.hasAttribute(`disabled`),Jl=e=>typeof e==`function`?e():e!==!1,Yl=({root:e,itemSelector:t,activeAttribute:n=`data-active`,isDisabled:r=ql,loop:i})=>{let a=()=>{let n=e();return n?Array.from(n.querySelectorAll(t)):[]},o=()=>a().filter(e=>!r(e)),s=()=>{a().forEach(e=>{e.removeAttribute(n)})},c=({items:e=o()}={})=>{let t=e.find(e=>e.getAttribute(n)===`true`);if(t)return e.indexOf(t);let r=document.activeElement,i=r instanceof HTMLElement?e.find(e=>e===r||e.contains(r)):void 0;return i?e.indexOf(i):-1},l=({el:e})=>{o().includes(e)&&(s(),e.setAttribute(n,`true`))},u=({el:e})=>{l({el:e}),e.focus()},d=(e,t)=>e<0?0:e<t-1?e+1:Jl(i)?0:t-1,f=(e,t)=>e<0?t-1:e>0?e-1:Jl(i)?t-1:0,p=e=>{let t=o()[e];t&&u({el:t})},m=()=>{let e=o();e.length!==0&&u({el:e[d(c({items:e}),e.length)]})},h=()=>{let e=o();e.length!==0&&u({el:e[f(c({items:e}),e.length)]})},g=()=>p(0),_=()=>{p(o().length-1)};return{allItems:a,items:o,currentActiveIndex:c,activateItem:l,clearActiveItem:s,focusItem:u,focusNext:m,focusPrevious:h,focusFirst:g,focusLast:_,handleKeydown:({event:e})=>e.key===`ArrowDown`?(e.preventDefault(),m(),!0):e.key===`ArrowUp`?(e.preventDefault(),h(),!0):e.key===`Home`?(e.preventDefault(),g(),!0):e.key===`End`?(e.preventDefault(),_(),!0):!1}},Xl=`Are you sure?`,Zl=null,Ql=new WeakSet,$l=e=>e instanceof HTMLButtonElement||e instanceof HTMLInputElement,eu=({form:e,submitter:t})=>{let n=t?.dataset.uiConfirm;if(n!==void 0)return n||Xl;let r=e.dataset.uiConfirm;return r===void 0?null:r||Xl},tu=({form:e,submitter:t})=>{if(Ql.add(e),t){e.requestSubmit(t);return}e.requestSubmit()},nu=e=>{let t=e.target;if(!(t instanceof HTMLFormElement))return;if(Ql.has(t)){Ql.delete(t);return}let n=$l(e.submitter)?e.submitter:null,r=eu({form:t,submitter:n});if(r===null)return;e.preventDefault();let i=!1,a=()=>{i||(i=!0,tu({form:t,submitter:n}))},o=()=>{i=!0},s=new CustomEvent(`ui:confirm`,{bubbles:!0,cancelable:!0,detail:{form:t,message:r,submitter:n,triggeringEvent:e,proceed:a,cancel:o}});t.dispatchEvent(s),!s.defaultPrevented&&(window.confirm(r)?a():o())},ru=({root:e=document}={})=>{Zl||=(e.addEventListener(`submit`,nu,{capture:!0}),()=>e.removeEventListener(`submit`,nu,{capture:!0}))},iu=()=>{Zl?.(),Zl=null},au=e=>typeof e!=`object`||!e?e:(Object.freeze(e),Object.values(e).forEach(e=>{au(e)}),e),ou=({definition:e})=>au(e),su=[`:`,`@`,`x-`,`data-`,`aria-`],cu=e=>typeof e==`object`&&!!e&&!Array.isArray(e),lu=e=>Object.keys(e).some(e=>e===`class`||e===`style`||e===`id`||e===`role`||e===`type`||e===`tabindex`||su.some(t=>e.startsWith(t))),uu=(e,t,n)=>{Object.entries(t).forEach(([t,r])=>{if(t===`class`){n.push(r);return}if(r==null||r===!1){delete e[t];return}e[t]=r})},du=({inputs:e})=>{let t={},n=[];e.forEach(e=>{if(e){if(cu(e)&&lu(e)){uu(t,e,n);return}n.push(e)}});let r=Gl({values:n});return r&&(t.class=r),t},fu=e=>e.replace(/([A-Z])/g,`-$1`).toLowerCase(),pu=e=>e.replace(/([A-Z])/g,`-$1`).toLowerCase().replace(/[\s_]+/g,`-`),mu=e=>e.replace(/[-_\s]+([a-z])/g,(e,t)=>t.toUpperCase()),hu=e=>e.replace(/([A-Z])/g,`_$1`).toLowerCase().replace(/[\s-]+/g,`_`),gu=(e,t)=>e.dataset[t],_u=(e,t)=>e.hasAttribute(`data-${fu(t)}`),vu=(e,t)=>(Object.defineProperty(e,"meta",{value:Object.freeze(t),enumerable:!1}),e);function R(e,t,n=`default`){let r=((r,i)=>{let a=gu(r,i);return a===void 0||a===``&&n==="default"?t:e.reduce((e,t)=>t(e),a)});return Object.defineProperties(r,{trim:{get:()=>R([...e,e=>e.trim()],t,n)},lower:{get:()=>R([...e,e=>e.toLowerCase()],t,n)},upper:{get:()=>R([...e,e=>e.toUpperCase()],t,n)},kebab:{get:()=>R([...e,pu],t,n)},camel:{get:()=>R([...e,mu],t,n)},snake:{get:()=>R([...e,hu],t,n)},default:{value:t=>R(e,t,n)},emptyAsValue:{get:()=>R(e,t,`value`)},emptyAsDefault:{get:()=>R(e,t,`default`)},maxLength:{value:r=>R([...e,e=>e.slice(0,r)],t,n)},prefix:{value:r=>R([...e,e=>e.startsWith(r)?e:`${r}${e}`],t,n)},suffix:{value:r=>R([...e,e=>e.endsWith(r)?e:`${e}${r}`],t,n)}}),vu(r,{type:`string`,default:t,emptyString:n})}function yu(e,t){let n=((n,r)=>{let i=gu(n,r);if(i===void 0||i===``)return t;let a=Number(i);return Number.isFinite(a)?e.reduce((e,t)=>t(e),a):t});return Object.defineProperties(n,{clamp:{value:(n,r)=>yu([...e,e=>Math.min(r,Math.max(n,e))],t)},min:{value:n=>yu([...e,e=>Math.max(n,e)],t)},max:{value:n=>yu([...e,e=>Math.min(n,e)],t)},step:{value:n=>yu([...e,e=>Math.round(e/n)*n],t)},default:{value:t=>yu(e,t)}}),vu(n,{type:`number`,default:t})}function bu(e){let t=((t,n)=>{let r=gu(t,n);return r===void 0?_u(t,n)||e:r===``?!0:[`true`,`1`,`yes`,`on`].includes(r.toLowerCase())});return Object.defineProperties(t,{default:{value:e=>bu(e)}}),vu(t,{type:`boolean`,default:e})}function xu(e,t){let n=((n,r)=>{let i=gu(n,r);return i!==void 0&&e.includes(i)?i:t});return Object.defineProperties(n,{default:{value:t=>xu(e,t)}}),vu(n,{type:`enum`,default:t,values:e})}function Su(e){let t=((t,n)=>{let r=gu(t,n);if(r===void 0||r===``)return e;try{return JSON.parse(r)}catch{return e}});return Object.defineProperties(t,{default:{value:e=>Su(e)}}),vu(t,{type:`json`,default:e})}var Cu=(e,t)=>Object.fromEntries(Object.entries(t).map(([t,n])=>[t,n(e,t)])),wu=(e,t)=>{Object.keys(t).forEach(n=>{let r=n;e[r]!==t[r]&&(e[r]=t[r])})},Tu=e=>e,Eu=e=>{Tu=e},z=({el:e,schema:t})=>{let n=Tu(Cu(e,t)),r=new MutationObserver(()=>{wu(n,Cu(e,t))});return r.observe(e,{attributes:!0,attributeFilter:Object.keys(t).map(e=>`data-${fu(e)}`)}),Object.defineProperty(n,"disconnect",{value:()=>r.disconnect(),enumerable:!1}),n},B=R([],``),V=yu([],0),H=bu(!1),Du=Object.assign(e=>Su(e),{object:e=>Su(e),array:e=>Su(e)}),U=(e,t)=>xu(e,t),Ou=[`true`,`1`,`yes`,`on`],ku=({value:e})=>e!==void 0&&(e===``||Ou.includes(e.toLowerCase())),Au=({el:e,name:t,detail:n})=>{let r={bubbles:!0};n!==void 0&&(r.detail=n),e.dispatchEvent(new CustomEvent(t,r))},ju=({target:e,event:t,handler:n,cleanup:r,options:i})=>{e.addEventListener(t,n,i);let a=()=>e.removeEventListener(t,n,i);return r?.push(a),a},Mu=({el:e,attr:t,present:n,value:r=``})=>{if(n){e.getAttribute(t)!==r&&e.setAttribute(t,r);return}e.removeAttribute(t)},Nu=({el:e,attr:t,value:n})=>{e.getAttribute(t)!==n&&e.setAttribute(t,n)},Pu=({el:e,attr:t})=>{e.hasAttribute(t)&&e.removeAttribute(t)},Fu=({el:e})=>(e.closest(`[dir]`)?.dir||document.dir).toLowerCase()===`rtl`,Iu=(e,t)=>e.includes(t),Lu=({isEnabled:e,roots:t,onDismiss:n})=>{let r=r=>{if(!e())return;let i=r.composedPath();t().filter(e=>e!=null).some(e=>Iu(i,e))||n(r)};return document.addEventListener(`pointerdown`,r,{capture:!0}),()=>{document.removeEventListener(`pointerdown`,r,{capture:!0})}},Ru=({el:e,state:t,value:n=``})=>{Mu({el:e,attr:`data-disabled`,present:t.disabled??!1,value:n}),Mu({el:e,attr:`data-required`,present:t.required??!1,value:n}),Mu({el:e,attr:`data-invalid`,present:t.invalid??!1,value:n})},zu=({input:e,state:t})=>{t.name!==void 0&&t.name!==``&&(e.name=t.name),t.value!==void 0&&(e.value=t.value),e.disabled=t.disabled??!1,e.required=t.nativeRequired??t.required??!1,`readOnly`in e&&(e.readOnly=t.readonly??!1),t.ariaRequired!==void 0&&e.setAttribute(`aria-required`,t.ariaRequired?`true`:`false`),t.invalid?e.setAttribute(`aria-invalid`,`true`):e.removeAttribute(`aria-invalid`)},Bu=e=>JSON.stringify({name:e.name,values:e.values,required:e.required??!1,form:e.form??``,marker:e.marker??`data-ui-hidden-input`}),Vu=({container:e,state:t,currentKey:n=``})=>{let r=t.marker??`data-ui-hidden-input`,i=Bu({...t,marker:r});return i===n?n:(e.replaceChildren(),t.name&&t.values.forEach(n=>{let i=document.createElement(`input`);i.type=`hidden`,i.name=t.name,i.value=n,i.setAttribute(r,``),t.required&&(i.required=!0),t.form&&i.setAttribute(`form`,t.form),e.append(i)}),i)},Hu=({container:e,fallback:t,marker:n})=>{let r=e?.querySelector(`input[${n}]`)??t;r.dispatchEvent(new Event(`input`,{bubbles:!0})),r.dispatchEvent(new Event(`change`,{bubbles:!0}))},Uu=e=>e.trim().toLowerCase(),Wu=e=>e.split(`,`).map(e=>e.trim()).filter(Boolean),Gu=e=>{if(e)try{return JSON.parse(e)}catch{return}},Ku=(e,t)=>{if(!(!t||e==null))return t.split(`.`).reduce((e,t)=>{if(!(typeof e!=`object`||!e))return e[t]},e)};function qu(e){if(Array.isArray(e))return e}function Ju(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Yu(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Xu(e,t){if(e){if(typeof e==`string`)return Yu(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Yu(e,t):void 0}}function Zu(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Qu(e,t){return qu(e)||Ju(e,t)||Xu(e,t)||Zu()}var $u=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.bind=void 0;function t(e,t){var n=t.type,r=t.listener,i=t.options;return e.addEventListener(n,r,i),function(){e.removeEventListener(n,r,i)}}e.bind=t})),ed=r((e=>{var t=e&&e.__assign||function(){return t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},t.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.bindAll=void 0;var n=$u();function r(e){if(e!==void 0)return typeof e==`boolean`?{capture:e}:e}function i(e,n){return n==null?e:t(t({},e),{options:t(t({},r(n)),r(e.options))})}function a(e,t,r){var a=t.map(function(t){var a=i(t,r);return(0,n.bind)(e,a)});return function(){a.forEach(function(e){return e()})}}e.bindAll=a})),td=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.bindAll=e.bind=void 0;var t=$u();Object.defineProperty(e,"bind",{enumerable:!0,get:function(){return t.bind}});var n=ed();Object.defineProperty(e,"bindAll",{enumerable:!0,get:function(){return n.bindAll}})}))(),nd=`data-pdnd-honey-pot`;function rd(e){return e instanceof Element&&e.hasAttribute(`data-pdnd-honey-pot`)}function id(e){var t=Qu(document.elementsFromPoint(e.x,e.y),2),n=t[0],r=t[1];return n?rd(n)?r??null:n:null}function ad(e){"@babel/helpers - typeof";return ad=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},ad(e)}function od(e,t){if(ad(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(ad(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function sd(e){var t=od(e,`string`);return ad(t)==`symbol`?t:t+``}function cd(e,t,n){return(t=sd(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ld=2147483647,ud={inset:`unset`,border:`none`,padding:0,margin:0,overflow:`visible`,color:`inherit`,background:`transparent`,width:`auto`,height:`auto`};function dd(e){var t=null;return function(){if(!t){for(var n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];t={result:e.apply(this,r)}}return t.result}}var fd=dd(function(){return typeof HTMLElement<`u`&&typeof HTMLElement.prototype.showPopover==`function`});function pd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function md(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?pd(Object(n),!0).forEach(function(t){cd(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pd(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var hd=2,gd=hd/2;function _d(e){return{x:Math.floor(e.x),y:Math.floor(e.y)}}function vd(e){return{x:e.x-gd,y:e.y-gd}}function yd(e){return{x:Math.max(e.x,0),y:Math.max(e.y,0)}}function bd(e){return{x:Math.min(e.x,window.innerWidth-hd),y:Math.min(e.y,window.innerHeight-hd)}}function xd(e){var t=e.client,n=bd(yd(vd(_d(t))));return DOMRect.fromRect({x:n.x,y:n.y,width:hd,height:hd})}function Sd(e){var t=e.clientRect;return{left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`}}function Cd(e){var t=e.client,n=e.clientRect;return t.x>=n.x&&t.x<=n.x+n.width&&t.y>=n.y&&t.y<=n.y+n.height}function wd(e){var t=e.initial,n=document.createElement(`div`);n.setAttribute(nd,`true`),fd()&&n.setAttribute(`popover`,`manual`);var r=xd({client:t});Object.assign(n.style,md(md({position:`fixed`},fd()?ud:{zIndex:ld}),{},{backgroundColor:`transparent`,padding:0,margin:0,boxSizing:`border-box`,pointerEvents:`auto`},Sd({clientRect:r}))),document.body.appendChild(n),fd()&&n.showPopover();var i=(0,td.bind)(window,{type:`pointermove`,listener:function(e){r=xd({client:{x:e.clientX,y:e.clientY}}),Object.assign(n.style,Sd({clientRect:r}))},options:{capture:!0}});return function(e){var t=e.current;if(i(),Cd({client:t,clientRect:r})){n.remove();return}function a(){o(),n.remove()}var o=(0,td.bindAll)(window,[{type:`pointerdown`,listener:a},{type:`pointermove`,listener:a},{type:`focusin`,listener:a},{type:`focusout`,listener:a},{type:`dragstart`,listener:a},{type:`dragenter`,listener:a},{type:`dragover`,listener:a}],{capture:!0})}}function Td(){var e=null;function t(){return e=null,(0,td.bind)(window,{type:`pointermove`,listener:function(t){e={x:t.clientX,y:t.clientY}},options:{capture:!0}})}function n(){var t=null;return function(n){var r=n.eventName,i=n.payload;if(r===`onDragStart`){var a=i.location.initial.input;t=wd({initial:e??{x:a.clientX,y:a.clientY}})}if(r===`onDrop`){var o,s=i.location.current.input;(o=t)==null||o({current:{x:s.clientX,y:s.clientY}}),t=null,e=null}}}return{bindEvents:t,getOnPostDispatch:n}}function Ed(e){if(Array.isArray(e))return Yu(e)}function Dd(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function Od(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
4
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kd(e){return Ed(e)||Dd(e)||Xu(e)||Od()}var Ad=dd(function(){return navigator.userAgent.includes(`Firefox`)}),jd=dd(function(){var e=navigator.userAgent;return e.includes(`AppleWebKit`)&&!e.includes(`Chrome`)}),Md={isLeavingWindow:Symbol(`leaving`),isEnteringWindow:Symbol(`entering`)};function Nd(e){var t=e.dragEnter;return jd()?t.hasOwnProperty(Md.isEnteringWindow):!1}function Pd(e){var t=e.dragLeave;return jd()?t.hasOwnProperty(Md.isLeavingWindow):!1}(function(){if(typeof window>`u`||!jd())return;function e(){return{enterCount:0,isOverWindow:!1}}var t=e();function n(){t=e()}(0,td.bindAll)(window,[{type:`dragstart`,listener:function(){t.enterCount=0,t.isOverWindow=!0}},{type:`drop`,listener:n},{type:`dragend`,listener:n},{type:`dragenter`,listener:function(e){!t.isOverWindow&&t.enterCount===0&&(e[Md.isEnteringWindow]=!0),t.isOverWindow=!0,t.enterCount++}},{type:`dragleave`,listener:function(e){t.enterCount--,t.isOverWindow&&t.enterCount===0&&(e[Md.isLeavingWindow]=!0,t.isOverWindow=!1)}}],{capture:!0})})();function Fd(e){return`nodeName`in e}function Id(e){return Fd(e)&&e.ownerDocument!==document}function Ld(e){var t=e.dragLeave,n=t.type,r=t.relatedTarget;return n===`dragleave`?jd()?Pd({dragLeave:t}):r==null?!0:Ad()?Id(r):r instanceof HTMLIFrameElement:!1}function Rd(e){var t=e.onDragEnd;return[{type:`pointermove`,listener:function(){var e=0;return function(){if(e<20){e++;return}t()}}()},{type:`pointerdown`,listener:t}]}function zd(e){return{altKey:e.altKey,button:e.button,buttons:e.buttons,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY}}var Bd=function(e){var t=[],n=null,r=function(){for(var r=arguments.length,i=Array(r),a=0;a<r;a++)i[a]=arguments[a];t=i,!n&&(n=requestAnimationFrame(function(){n=null,e.apply(void 0,t)}))};return r.cancel=function(){n&&=(cancelAnimationFrame(n),null)},r}(function(e){return e()}),Vd=function(){var e=null;function t(t){e={frameId:requestAnimationFrame(function(){e=null,t()}),fn:t}}function n(){e&&=(cancelAnimationFrame(e.frameId),e.fn(),null)}return{schedule:t,flush:n}}();function Hd(e){var t=e.source,n=e.initial,r=e.dispatchEvent,i={dropTargets:[]};function a(e){r(e),i={dropTargets:e.payload.location.current.dropTargets}}return{start:function(e){var r=e.nativeSetDragImage,o={current:n,previous:i,initial:n};a({eventName:`onGenerateDragPreview`,payload:{source:t,location:o,nativeSetDragImage:r}}),Vd.schedule(function(){a({eventName:`onDragStart`,payload:{source:t,location:o}})})},dragUpdate:function(e){var r=e.current;Vd.flush(),Bd.cancel(),a({eventName:`onDropTargetChange`,payload:{source:t,location:{initial:n,previous:i,current:r}}})},drag:function(e){var r=e.current;Bd(function(){Vd.flush(),a({eventName:`onDrag`,payload:{source:t,location:{initial:n,previous:i,current:r}}})})},drop:function(e){var r=e.current,o=e.updatedSourcePayload;Vd.flush(),Bd.cancel(),a({eventName:`onDrop`,payload:{source:o??t,location:{current:r,previous:i,initial:n}}})}}}var Ud={isActive:!1};function Wd(){return!Ud.isActive}function Gd(e){return e.dataTransfer?e.dataTransfer.setDragImage.bind(e.dataTransfer):null}function Kd(e){var t=e.current,n=e.next;if(t.length!==n.length)return!0;for(var r=0;r<t.length;r++)if(t[r].element!==n[r].element)return!0;return!1}function qd(e){var t=e.event,n=e.dragType,r=e.getDropTargetsOver,i=e.dispatchEvent;if(!Wd())return;var a=Yd({event:t,dragType:n,getDropTargetsOver:r});Ud.isActive=!0;var o={current:a};Jd({event:t,current:a.dropTargets});var s=Hd({source:n.payload,dispatchEvent:i,initial:a});function c(e){var t=Kd({current:o.current.dropTargets,next:e.dropTargets});o.current=e,t&&s.dragUpdate({current:o.current})}function l(e){var t=zd(e),i=r({target:rd(e.target)?id({x:t.clientX,y:t.clientY}):e.target,input:t,source:n.payload,current:o.current.dropTargets});i.length&&(e.preventDefault(),Jd({event:e,current:i})),c({dropTargets:i,input:t})}function u(){o.current.dropTargets.length&&c({dropTargets:[],input:o.current.input}),s.drop({current:o.current,updatedSourcePayload:null}),d()}function d(){Ud.isActive=!1,f()}var f=(0,td.bindAll)(window,[{type:`dragover`,listener:function(e){l(e),s.drag({current:o.current})}},{type:`dragenter`,listener:l},{type:`dragleave`,listener:function(e){Ld({dragLeave:e})&&(c({input:o.current.input,dropTargets:[]}),n.startedFrom===`external`&&u())}},{type:`drop`,listener:function(e){if(o.current={dropTargets:o.current.dropTargets,input:zd(e)},!o.current.dropTargets.length){u();return}e.preventDefault(),Jd({event:e,current:o.current.dropTargets}),s.drop({current:o.current,updatedSourcePayload:n.type===`external`?n.getDropPayload(e):null}),d()}},{type:`dragend`,listener:function(e){o.current={dropTargets:o.current.dropTargets,input:zd(e)},u()}}].concat(kd(Rd({onDragEnd:u}))),{capture:!0});s.start({nativeSetDragImage:Gd(t)})}function Jd(e){var t=e.event,n=e.current[0]?.dropEffect;n!=null&&t.dataTransfer&&(t.dataTransfer.dropEffect=n)}function Yd(e){var t=e.event,n=e.dragType,r=e.getDropTargetsOver,i=zd(t);return n.startedFrom===`external`?{input:i,dropTargets:[]}:{input:i,dropTargets:r({input:i,source:n.payload,target:t.target,current:[]})}}var Xd={canStart:Wd,start:qd},Zd=new Map;function Qd(e){var t=e.typeKey,n=e.mount,r=Zd.get(t);if(r)return r.usageCount++,r;var i={typeKey:t,unmount:n(),usageCount:1};return Zd.set(t,i),i}function $d(e){var t=Qd(e);return function(){t.usageCount--,!(t.usageCount>0)&&(t.unmount(),Zd.delete(e.typeKey))}}function ef(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(){t.forEach(function(e){return e()})}}function tf(e,t){var n=t.attribute,r=t.value;return e.setAttribute(n,r),function(){return e.removeAttribute(n)}}function nf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function rf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?nf(Object(n),!0).forEach(function(t){cd(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nf(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function af(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=of(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
5
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function of(e,t){if(e){if(typeof e==`string`)return sf(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?sf(e,t):void 0}}function sf(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function cf(e){return e.slice(0).reverse()}function lf(e){var t=e.typeKey,n=e.defaultDropEffect,r=new WeakMap,i=`data-drop-target-for-${t}`,a=`[${i}]`;function o(e){return r.set(e.element,e),function(){return r.delete(e.element)}}function s(e){return dd(ef(tf(e.element,{attribute:i,value:`true`}),o(e)))}function c(e){var t=e.source,i=e.target,o=e.input,s=e.result,l=s===void 0?[]:s;if(i==null)return l;if(!(i instanceof Element))return i instanceof Node?c({source:t,target:i.parentElement,input:o,result:l}):l;var u=i.closest(a);if(u==null)return l;var d=r.get(u);if(d==null)return l;var f={input:o,source:t,element:d.element};if(d.canDrop&&!d.canDrop(f))return c({source:t,target:d.element.parentElement,input:o,result:l});var p=d.getData?.call(d,f)??{},m=d.getDropEffect?.call(d,f)??n,h={data:p,element:d.element,dropEffect:m,isActiveDueToStickiness:!1};return c({source:t,target:d.element.parentElement,input:o,result:[].concat(kd(l),[h])})}function l(e){var t=e.eventName,n=e.payload,i=af(n.location.current.dropTargets),a;try{for(i.s();!(a=i.n()).done;){var o,s=a.value,c=r.get(s.element),l=rf(rf({},n),{},{self:s});c==null||(o=c[t])==null||o.call(c,l)}}catch(e){i.e(e)}finally{i.f()}}var u={onGenerateDragPreview:l,onDrag:l,onDragStart:l,onDrop:l,onDropTargetChange:function(e){var t=e.payload,n=new Set(t.location.current.dropTargets.map(function(e){return e.element})),i=new Set,a=af(t.location.previous.dropTargets),o;try{for(a.s();!(o=a.n()).done;){var s,c=o.value;i.add(c.element);var l=r.get(c.element),u=n.has(c.element),d=rf(rf({},t),{},{self:c});if(l==null||(s=l.onDropTargetChange)==null||s.call(l,d),!u){var f;l==null||(f=l.onDragLeave)==null||f.call(l,d)}}}catch(e){a.e(e)}finally{a.f()}var p=af(t.location.current.dropTargets),m;try{for(p.s();!(m=p.n()).done;){var h,g,_=m.value;if(!i.has(_.element)){var v=rf(rf({},t),{},{self:_}),y=r.get(_.element);y==null||(h=y.onDropTargetChange)==null||h.call(y,v),y==null||(g=y.onDragEnter)==null||g.call(y,v)}}}catch(e){p.e(e)}finally{p.f()}}};function d(e){u[e.eventName](e)}function f(e){var t=e.source,n=e.target,i=e.input,a=e.current,o=c({source:t,target:n,input:i});if(o.length>=a.length)return o;for(var s=cf(a),l=cf(o),u=[],d=0;d<s.length;d++){var f,p=s[d],m=l[d];if(m!=null){u.push(m);continue}var h=u[d-1],g=s[d-1];if(h?.element!==g?.element)break;var _=r.get(p.element);if(!_)break;var v={input:i,source:t,element:_.element};if(_.canDrop&&!_.canDrop(v)||!((f=_.getIsSticky)!=null&&f.call(_,v)))break;u.push(rf(rf({},p),{},{isActiveDueToStickiness:!0}))}return cf(u)}return{dropTargetForConsumers:s,getIsOver:f,dispatchEvent:d}}function uf(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=df(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
6
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function df(e,t){if(e){if(typeof e==`string`)return ff(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ff(e,t):void 0}}function ff(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function pf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function mf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?pf(Object(n),!0).forEach(function(t){cd(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pf(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function hf(){var e=new Set,t=null;function n(e){t&&(!e.canMonitor||e.canMonitor(t.canMonitorArgs))&&t.active.add(e)}function r(r){var i=mf({},r);e.add(i),n(i);function a(){e.delete(i),t&&t.active.delete(i)}return dd(a)}function i(r){var i=r.eventName,a=r.payload;if(i===`onGenerateDragPreview`){t={canMonitorArgs:{initial:a.location.initial,source:a.source},active:new Set};var o=uf(e),s;try{for(o.s();!(s=o.n()).done;){var c=s.value;n(c)}}catch(e){o.e(e)}finally{o.f()}}if(t){for(var l=Array.from(t.active),u=0,d=l;u<d.length;u++){var f=d[u];if(t.active.has(f)){var p;(p=f[i])==null||p.call(f,a)}}i===`onDrop`&&(t.active.clear(),t=null)}}return{dispatchEvent:i,monitorForConsumers:r}}function gf(e){var t=e.typeKey,n=e.mount,r=e.dispatchEventToSource,i=e.onPostDispatch,a=e.defaultDropEffect,o=hf(),s=lf({typeKey:t,defaultDropEffect:a});function c(e){r?.(e),s.dispatchEvent(e),o.dispatchEvent(e),i?.(e)}function l(e){var t=e.event,n=e.dragType;Xd.start({event:t,dragType:n,getDropTargetsOver:s.getIsOver,dispatchEvent:c})}function u(){function e(){return n({canStart:Xd.canStart,start:l})}return $d({typeKey:t,mount:e})}return{registerUsage:u,dropTarget:s.dropTargetForConsumers,monitor:o.monitorForConsumers}}var _f=dd(function(){return navigator.userAgent.toLocaleLowerCase().includes(`android`)}),vf=`pdnd:android-fallback`,yf=`text/plain`,bf=`application/vnd.pdnd`,xf=new WeakMap;function Sf(e){return xf.set(e.element,e),function(){xf.delete(e.element)}}var Cf=Td(),wf=gf({typeKey:`element`,defaultDropEffect:`move`,mount:function(e){return ef(Cf.bindEvents(),(0,td.bind)(document,{type:`dragstart`,listener:function(t){if(e.canStart(t)&&!t.defaultPrevented&&t.dataTransfer){var n=t.target;if(n instanceof HTMLElement){var r=xf.get(n);if(r){var i=zd(t),a={element:r.element,dragHandle:r.dragHandle??null,input:i};if(r.canDrag&&!r.canDrag(a)){t.preventDefault();return}if(r.dragHandle){var o=id({x:i.clientX,y:i.clientY});if(!r.dragHandle.contains(o)){t.preventDefault();return}}var s=r.getInitialDataForExternal?.call(r,a)??null;if(s)for(var c=0,l=Object.entries(s);c<l.length;c++){var u=Qu(l[c],2),d=u[0],f=u[1];t.dataTransfer.setData(d,f??``)}_f()&&!t.dataTransfer.types.includes(`text/plain`)&&!t.dataTransfer.types.includes(`text/uri-list`)&&t.dataTransfer.setData(yf,vf),t.dataTransfer.setData(bf,``);var p={type:`element`,payload:{element:r.element,dragHandle:r.dragHandle??null,data:r.getInitialData?.call(r,a)??{}},startedFrom:`internal`};e.start({event:t,dragType:p})}}}}}))},dispatchEventToSource:function(e){var t,n,r=e.eventName,i=e.payload;(t=xf.get(i.source.element))==null||(n=t[r])==null||n.call(t,i)},onPostDispatch:Cf.getOnPostDispatch()});wf.dropTarget,wf.monitor;function Tf(e){return dd(ef(wf.registerUsage(),Sf(e),tf(e.element,{attribute:`draggable`,value:`true`})))}var Ef=function(){if(typeof window>`u`)return null;var e=new Image;return e.src=`data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==`,e}();function Df(e){var t=e.nativeSetDragImage;t&&Ef&&t(Ef,0,0)}var Of=60,kf=1,Af=8,jf=24,Mf=`[x-ui-resizable\\:handle], [data-ui-resize-handle]`,Nf=`data-ui-resizable-managed-disabled`,Pf=(e,t,n)=>{let r=Math.max(e,t);return n===null?r:Math.min(r,n)},Ff=(e,t)=>!Number.isFinite(t)||t<=1?e:Math.round(e/t)*t,If=(e,t,n,r)=>Pf(Ff(e,r),t,n),Lf=(e,t)=>{if(e===void 0||e.trim()===``)return t;let n=Number(e);return Number.isFinite(n)?n:t},Rf=e=>e===`onEnd`?`onEnd`:`onChange`,zf=e=>e===`y`?`y`:`x`,Bf=({value:e,element:t,axis:n,fallback:r})=>{if(e===void 0||e.trim()===``)return r;let i=Number(e);if(Number.isFinite(i))return i;if(e.endsWith(`px`)){let t=Number(e.slice(0,-2));if(Number.isFinite(t))return t}if(e.endsWith(`rem`)){let t=Number(e.slice(0,-3)),n=Number.parseFloat(getComputedStyle(document.documentElement).fontSize||`16`);if(Number.isFinite(t)&&Number.isFinite(n))return t*n}if(e.endsWith(`em`)){let n=Number(e.slice(0,-2)),r=Number.parseFloat(getComputedStyle(t).fontSize||`16`);if(Number.isFinite(n)&&Number.isFinite(r))return n*r}if(typeof document>`u`)return r;let a=document.createElement(`div`);a.style.position=`absolute`,a.style.visibility=`hidden`,a.style.pointerEvents=`none`,a.style.width=n===`x`?e:`0`,a.style.height=n===`y`?e:`0`,t.append(a);let o=a.getBoundingClientRect();a.remove();let s=n===`x`?o.width:o.height;return s>0?s:r},Vf=e=>({clientX:e.location.current.input.clientX,clientY:e.location.current.input.clientY}),Hf=e=>({clientX:e.location.initial.input.clientX,clientY:e.location.initial.input.clientY}),Uf=e=>({$width:e.width,$height:e.height,$delta:e.delta,$axis:e.axis,$phase:e.phase,$previewWidth:e.previewWidth,$previewHeight:e.previewHeight}),Wf=({el:e,name:t,event:n})=>{e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:n}))},Gf=({element:e,handle:t,axis:n=`x`,min:r=Of,max:i=null,step:a=kf,mode:o=`onChange`,hitArea:s=Af,coarseHitArea:c=jf,disabled:l=()=>!1,onStart:u,onResize:d,onEnd:f})=>{let p=null,m=[],h=()=>{let n=l();return n?(e.setAttribute(`data-disabled`,``),e.setAttribute(Nf,``),t.setAttribute(`data-disabled`,``),t.setAttribute(Nf,``)):(e.hasAttribute(Nf)&&(e.removeAttribute(`data-disabled`),e.removeAttribute(Nf)),t.hasAttribute(Nf)&&(t.removeAttribute(`data-disabled`),t.removeAttribute(Nf))),t.setAttribute(`aria-disabled`,n?`true`:`false`),n},g=()=>typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(pointer: coarse)`).matches?c:s,_=()=>{e.setAttribute(`data-ui-resizable`,``),e.dataset.resizeAxis=n,e.dataset.resizeMode=o,t.setAttribute(`data-ui-resize-handle`,``),t.setAttribute(`role`,`separator`),t.setAttribute(`tabindex`,t.getAttribute(`tabindex`)??`0`),t.setAttribute(`aria-orientation`,n===`x`?`vertical`:`horizontal`),t.style.touchAction=`none`,n===`x`?t.style.minWidth=`${g()}px`:t.style.minHeight=`${g()}px`},v=n=>{Mu({el:e,attr:`data-resizing`,present:n}),Mu({el:t,attr:`data-resizing`,present:n})},y=({phase:t,delta:o,input:s,previewOnly:c=!1})=>{let l=e.getBoundingClientRect(),u=p??{width:l.width,height:l.height,startWidth:l.width,startHeight:l.height,startClientX:s.clientX,startClientY:s.clientY},d=n===`x`?If(u.startWidth+o,r,i,a):u.startWidth,f=n===`y`?If(u.startHeight+o,r,i,a):u.startHeight;return{width:c?u.width:d,height:c?u.height:f,previewWidth:d,previewHeight:f,delta:o,axis:n,phase:t,input:s}},b=e=>{let a=n===`x`?e.previewWidth:e.previewHeight;t.setAttribute(`aria-valuenow`,String(Math.round(a))),t.setAttribute(`aria-valuemin`,String(Math.round(r))),i===null?t.removeAttribute(`aria-valuemax`):t.setAttribute(`aria-valuemax`,String(Math.round(i)))},x=t=>{let n=e.getBoundingClientRect();p={width:n.width,height:n.height,startWidth:n.width,startHeight:n.height,startClientX:t.clientX,startClientY:t.clientY};let r=y({phase:`start`,delta:0,input:t});return b(r),v(!0),u?.(r),r},S=e=>{if(!p)return null;let t=y({phase:`resize`,delta:n===`x`?e.clientX-p.startClientX:e.clientY-p.startClientY,input:e,previewOnly:o===`onEnd`});return b(t),d?.(t),o===`onChange`&&(p.width=t.width,p.height=t.height),t},C=e=>{if(!p)return null;let t=y({phase:`end`,delta:n===`x`?e.clientX-p.startClientX:e.clientY-p.startClientY,input:e});return b(t),f?.(t),p=null,v(!1),t};_(),h(),b(y({phase:`start`,delta:0,input:{clientX:0,clientY:0}})),m.push(Tf({element:e,dragHandle:t,canDrag:()=>!h(),getInitialData:()=>({type:`ui-resizable`}),onGenerateDragPreview:({nativeSetDragImage:e})=>Df({nativeSetDragImage:e}),onDragStart:e=>{h()||x(Hf(e))},onDrag:e=>{h()||S(Vf(e))},onDrop:e=>{C(Vf(e))}}));let w=t=>{if(h())return;let o=a*(t.shiftKey?10:1),s=null;if(n===`x`&&t.key===`ArrowRight`&&(s=o),n===`x`&&t.key===`ArrowLeft`&&(s=-o),n===`y`&&t.key===`ArrowDown`&&(s=o),n===`y`&&t.key===`ArrowUp`&&(s=-o),t.key===`Home`&&(s=r-e.getBoundingClientRect()[n===`x`?`width`:`height`]),t.key===`End`&&i!==null&&(s=i-e.getBoundingClientRect()[n===`x`?`width`:`height`]),s!==null&&(t.preventDefault(),x({clientX:0,clientY:0}),p)){p.startClientX=0,p.startClientY=0;let e=n===`x`?{clientX:s,clientY:0}:{clientX:0,clientY:s};S(e),C(e)}};return t.addEventListener(`keydown`,w),m.push(()=>t.removeEventListener(`keydown`,w)),()=>{m.forEach(e=>e()),v(!1)}},Kf=e=>{typeof e.directive==`function`&&e.directive(`ui-resizable`,(t,{value:n,expression:r},{cleanup:i})=>{if(!(t instanceof HTMLElement)||n===`handle`)return;let a=t,o=a.querySelector(Mf);if(!o)return;let s=zf(a.dataset.resizeAxis),c=Bf({value:a.dataset.resizeMin??a.dataset.minWidth,element:a,axis:s,fallback:Of}),l=a.dataset.resizeMax??a.dataset.maxWidth,u=l?Bf({value:l,element:a,axis:s,fallback:1/0}):null,d=Rf(a.dataset.resizeMode),f=r?e.evaluateLater(a,r):null,p=e=>{Wf({el:a,name:e.phase===`start`?`ui:resize-start`:e.phase===`end`?`ui:resize-end`:`ui:resize`,event:e}),f&&(d===`onEnd`&&e.phase===`resize`||f(void 0,Uf(e)))};i(Gf({element:a,handle:o,axis:s,min:c,max:u===1/0?null:u,step:Lf(a.dataset.resizeStep,kf),mode:d,hitArea:Lf(a.dataset.resizeHitArea,Af),coarseHitArea:Lf(a.dataset.resizeCoarseHitArea,jf),disabled:()=>a.hasAttribute(`data-disabled`)&&!a.hasAttribute(Nf)||a.hasAttribute(`data-resize-disabled`)||a.dataset.disabled===`true`&&!a.hasAttribute(Nf),onStart:p,onResize:p,onEnd:p}))})},qf=e=>e.replace(/([A-Z])/g,`_$1`).toLowerCase(),Jf=({manifest:e})=>Object.freeze(e),Yf=({schema:e,details:t})=>Object.fromEntries(Object.entries(e).map(([e,n])=>{let r=t[e]??{},i=n.meta,a={type:i.type,default:i.default};return i.values&&(a.values=i.values),r.description&&(a.description=r.description),[r.name??qf(e),a]})),W=({definition:e})=>Object.freeze(e),Xf=e=>e===!0?`true`:e===!1||e==null?`false`:String(e),Zf=(e,t,n)=>Xf(t[n]??e.defaults?.[n]),Qf=(e,t,n)=>Object.entries(n.when).every(([n,r])=>Zf(e,t,n)===Xf(r)),G=({part:e,props:t={},className:n})=>{let r=[e.base];return Object.entries(e.variants??{}).forEach(([n,i])=>{r.push(i[Zf(e,t,n)])}),e.compounds?.forEach(n=>{Qf(e,t,n)&&r.push(n.class)}),r.push(n),Wl(r)};function $f(e,t){if(e===`__proto__`||e===`constructor`&&t&&typeof t==`object`&&`prototype`in t){ep(e);return}return t}function ep(e){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`)}function tp(e,t={}){if(typeof e!=`string`)return e;if(e[0]===`"`&&e[e.length-1]===`"`&&e.indexOf(`\\`)===-1)return e.slice(1,-1);let n=e.trim();if(n.length<=9)switch(n.toLowerCase()){case`true`:return!0;case`false`:return!1;case`undefined`:return;case`null`:return null;case`nan`:return NaN;case`infinity`:return 1/0;case`-infinity`:return-1/0}if(!ip.test(e)){if(t.strict)throw SyntaxError(`[destr] Invalid JSON`);return e}try{if(np.test(e)||rp.test(e)){if(t.strict)throw Error(`[destr] Possible prototype pollution`);return JSON.parse(e,$f)}return JSON.parse(e)}catch(n){if(t.strict)throw n;return e}}var np,rp,ip,ap=n((()=>{np=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,rp=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,ip=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/}));function op(e){return encodeURI(``+e).replace(Pp,`|`)}function sp(e){return op(typeof e==`string`?e:JSON.stringify(e)).replace(jp,`%2B`).replace(Fp,`+`).replace(Dp,`%23`).replace(Op,`%26`).replace(Np,"`").replace(Mp,`^`).replace(kp,`%2F`)}function cp(e){return sp(e).replace(Ap,`%3D`)}function lp(e=``){try{return decodeURIComponent(``+e)}catch{return``+e}}function up(e){return lp(e.replace(jp,` `))}function dp(e){return lp(e.replace(jp,` `))}function fp(e=``){let t=Object.create(null);e[0]===`?`&&(e=e.slice(1));for(let n of e.split(`&`)){let e=n.match(/([^=]+)=?(.*)/)||[];if(e.length<2)continue;let r=up(e[1]);if(r===`__proto__`||r===`constructor`)continue;let i=dp(e[2]||``);t[r]===void 0?t[r]=i:Array.isArray(t[r])?t[r].push(i):t[r]=[t[r],i]}return t}function pp(e,t){return(typeof t==`number`||typeof t==`boolean`)&&(t=String(t)),t?Array.isArray(t)?t.map(t=>`${cp(e)}=${sp(t)}`).join(`&`):`${cp(e)}=${sp(t)}`:cp(e)}function mp(e){return Object.keys(e).filter(t=>e[t]!==void 0).map(t=>pp(t,e[t])).filter(Boolean).join(`&`)}function hp(e,t={}){return typeof t==`boolean`&&(t={acceptRelative:t}),t.strict?Ip.test(e):Lp.test(e)||(t.acceptRelative?Rp.test(e):!1)}function gp(e=``,t){return t?zp.test(e):e.endsWith(`/`)}function _p(e=``,t){if(!t)return(gp(e)?e.slice(0,-1):e)||`/`;if(!gp(e,!0))return e||`/`;let n=e,r=``,i=e.indexOf(`#`);i!==-1&&(n=e.slice(0,i),r=e.slice(i));let[a,...o]=n.split(`?`);return((a.endsWith(`/`)?a.slice(0,-1):a)||`/`)+(o.length>0?`?${o.join(`?`)}`:``)+r}function vp(e=``,t){if(!t)return e.endsWith(`/`)?e:e+`/`;if(gp(e,!0))return e||`/`;let n=e,r=``,i=e.indexOf(`#`);if(i!==-1&&(n=e.slice(0,i),r=e.slice(i),!n))return r;let[a,...o]=n.split(`?`);return a+`/`+(o.length>0?`?${o.join(`?`)}`:``)+r}function yp(e,t){if(xp(t)||hp(e))return e;let n=_p(t);if(e.startsWith(n)){let t=e[n.length];if(!t||t===`/`||t===`?`)return e}return Cp(n,e)}function bp(e,t){let n=wp(e);return n.search=mp({...fp(n.search),...t}),Ep(n)}function xp(e){return!e||e===`/`}function Sp(e){return e&&e!==`/`}function Cp(e,...t){let n=e||``;for(let e of t.filter(e=>Sp(e)))if(n){let t=e.replace(Bp,``);n=vp(n)+t}else n=e;return n}function wp(e=``,t){let n=e.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);if(n){let[,e,t=``]=n;return{protocol:e.toLowerCase(),pathname:t,href:e+t,auth:``,host:``,search:``,hash:``}}if(!hp(e,{acceptRelative:!0}))return t?wp(t+e):Tp(e);let[,r=``,i,a=``]=e.replace(/\\/g,`/`).match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[],[,o=``,s=``]=a.match(/([^#/?]*)(.*)?/)||[];r===`file:`&&(s=s.replace(/\/(?=[A-Za-z]:)/,``));let{pathname:c,search:l,hash:u}=Tp(s);return{protocol:r.toLowerCase(),auth:i?i.slice(0,Math.max(0,i.length-1)):``,host:o,pathname:c,search:l,hash:u,[Vp]:!r}}function Tp(e=``){let[t=``,n=``,r=``]=(e.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:t,search:n,hash:r}}function Ep(e){let t=e.pathname||``,n=e.search?(e.search.startsWith(`?`)?``:`?`)+e.search:``,r=e.hash||``,i=e.auth?e.auth+`@`:``,a=e.host||``;return(e.protocol||e[Vp]?(e.protocol||``)+`//`:``)+i+a+t+n+r}var Dp,Op,kp,Ap,jp,Mp,Np,Pp,Fp,Ip,Lp,Rp,zp,Bp,Vp,Hp=n((()=>{String.fromCharCode,Dp=/#/g,Op=/&/g,kp=/\//g,Ap=/=/g,jp=/\+/g,Mp=/%5e/gi,Np=/%60/gi,Pp=/%7c/gi,Fp=/%20/gi,Ip=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,Lp=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,Rp=/^([/\\]\s*){2,}[^/\\]/,zp=/\/$|\/\?|\/#/,Bp=/^\.?\//,Vp=Symbol.for(`ufo:protocolRelative`)}));function Up(e){let t=e.error?.message||e.error?.toString()||``,n=e.request?.method||e.options?.method||`GET`,r=e.request?.url||String(e.request)||`/`,i=new Zp(`${`[${n}] ${JSON.stringify(r)}`}: ${e.response?`${e.response.status} ${e.response.statusText}`:`<no response>`}${t?` ${t}`:``}`,e.error?{cause:e.error}:void 0);for(let t of[`request`,`options`,`response`])Object.defineProperty(i,t,{get(){return e[t]}});for(let[t,n]of[[`data`,`_data`],[`status`,`status`],[`statusCode`,`status`],[`statusText`,`statusText`],[`statusMessage`,`statusText`]])Object.defineProperty(i,t,{get(){return e.response&&e.response[n]}});return i}function Wp(e=`GET`){return Qp.has(e.toUpperCase())}function Gp(e){if(e===void 0)return!1;let t=typeof e;return t===`string`||t===`number`||t===`boolean`||t===null?!0:t===`object`?Array.isArray(e)?!0:e.buffer||e instanceof FormData||e instanceof URLSearchParams?!1:e.constructor&&e.constructor.name===`Object`||typeof e.toJSON==`function`:!1}function Kp(e=``){if(!e)return`json`;let t=e.split(`;`).shift()||``;return em.test(t)?`json`:t===`text/event-stream`?`stream`:$p.has(t)||t.startsWith(`text/`)?`text`:`blob`}function qp(e,t,n,r){let i=Jp(t?.headers??e?.headers,n?.headers,r),a;return(n?.query||n?.params||t?.params||t?.query)&&(a={...n?.params,...n?.query,...t?.params,...t?.query}),{...n,...t,query:a,params:a,headers:i}}function Jp(e,t,n){if(!t)return new n(e);let r=new n(t);if(e)for(let[t,i]of Symbol.iterator in e||Array.isArray(e)?e:new n(e))r.set(t,i);return r}async function Yp(e,t){if(t)if(Array.isArray(t))for(let n of t)await n(e);else await t(e)}function Xp(e={}){let{fetch:t=globalThis.fetch,Headers:n=globalThis.Headers,AbortController:r=globalThis.AbortController}=e;async function i(e){let t=e.error&&e.error.name===`AbortError`&&!e.options.timeout||!1;if(e.options.retry!==!1&&!t){let t;t=typeof e.options.retry==`number`?e.options.retry:+!Wp(e.options.method);let n=e.response&&e.response.status||500;if(t>0&&(Array.isArray(e.options.retryStatusCodes)?e.options.retryStatusCodes.includes(n):tm.has(n))){let n=typeof e.options.retryDelay==`function`?e.options.retryDelay(e):e.options.retryDelay||0;return n>0&&await new Promise(e=>setTimeout(e,n)),a(e.request,{...e.options,retry:t-1})}}let n=Up(e);throw Error.captureStackTrace&&Error.captureStackTrace(n,a),n}let a=async function(a,o={}){let s={request:a,options:qp(a,o,e.defaults,n),response:void 0,error:void 0};if(s.options.method&&(s.options.method=s.options.method.toUpperCase()),s.options.onRequest&&(await Yp(s,s.options.onRequest),s.options.headers instanceof n||(s.options.headers=new n(s.options.headers||{}))),typeof s.request==`string`&&(s.options.baseURL&&(s.request=yp(s.request,s.options.baseURL)),s.options.query&&(s.request=bp(s.request,s.options.query),delete s.options.query),`query`in s.options&&delete s.options.query,`params`in s.options&&delete s.options.params),s.options.body&&Wp(s.options.method))if(Gp(s.options.body)){let e=s.options.headers.get(`content-type`);typeof s.options.body!=`string`&&(s.options.body=e===`application/x-www-form-urlencoded`?new URLSearchParams(s.options.body).toString():JSON.stringify(s.options.body)),e||s.options.headers.set(`content-type`,`application/json`),s.options.headers.has(`accept`)||s.options.headers.set(`accept`,`application/json`)}else (`pipeTo`in s.options.body&&typeof s.options.body.pipeTo==`function`||typeof s.options.body.pipe==`function`)&&(`duplex`in s.options||(s.options.duplex=`half`));let c;if(!s.options.signal&&s.options.timeout){let e=new r;c=setTimeout(()=>{let t=Error(`[TimeoutError]: The operation was aborted due to timeout`);t.name=`TimeoutError`,t.code=23,e.abort(t)},s.options.timeout),s.options.signal=e.signal}try{s.response=await t(s.request,s.options)}catch(e){return s.error=e,s.options.onRequestError&&await Yp(s,s.options.onRequestError),await i(s)}finally{c&&clearTimeout(c)}if((s.response.body||s.response._bodyInit)&&!nm.has(s.response.status)&&s.options.method!==`HEAD`){let e=(s.options.parseResponse?`json`:s.options.responseType)||Kp(s.response.headers.get(`content-type`)||``);switch(e){case`json`:{let e=await s.response.text(),t=s.options.parseResponse||tp;s.response._data=t(e);break}case`stream`:s.response._data=s.response.body||s.response._bodyInit;break;default:s.response._data=await s.response[e]()}}return s.options.onResponse&&await Yp(s,s.options.onResponse),!s.options.ignoreResponseError&&s.response.status>=400&&s.response.status<600?(s.options.onResponseError&&await Yp(s,s.options.onResponseError),await i(s)):s.response},o=async function(e,t){return(await a(e,t))._data};return o.raw=a,o.native=(...e)=>t(...e),o.create=(t={},n={})=>Xp({...e,...n,defaults:{...e.defaults,...n.defaults,...t}}),o}var Zp,Qp,$p,em,tm,nm,rm=n((()=>{ap(),Hp(),Zp=class extends Error{constructor(e,t){super(e,t),this.name=`FetchError`,t?.cause&&!this.cause&&(this.cause=t.cause)}},Qp=new Set(Object.freeze([`PATCH`,`POST`,`PUT`,`DELETE`])),$p=new Set([`image/svg`,`application/xml`,`application/xhtml`,`application/html`]),em=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i,tm=new Set([408,409,425,429,500,502,503,504]),nm=new Set([101,204,205,304])})),im,am,om,sm,cm,lm=n((()=>{rm(),im=(function(){if(typeof globalThis<`u`)return globalThis;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(typeof global<`u`)return global;throw Error(`unable to locate global object`)})(),am=im.fetch?(...e)=>im.fetch(...e):()=>Promise.reject(Error(`[ofetch] global.fetch is not supported!`)),om=im.Headers,sm=im.AbortController,cm=Xp({fetch:am,Headers:om,AbortController:sm})})),um=i({EventSourceController:()=>bm,EventSourcePlus:()=>ym,EventStreamContentType:()=>_m,HTTP_METHOD_VALS:()=>xm,_handleResponse:()=>gm,getBytes:()=>mm,messageListFromString:()=>fm,parseLine:()=>pm});async function dm(e){return new Promise(t=>{setTimeout(()=>{t(!0)},e)})}function fm(e){let t=[],n=``,r=!1,i,a,o,s,c,l=0,u=!1;function d(e){let r=pm(n);i=r.data??i,a=r.id??a,o=r.event??o,s=r.retry??s,u&&(typeof i==`string`&&t.push({id:a,data:i,event:o??`message`,retry:s}),a=void 0,i=void 0,o=void 0,s=void 0,l=e),n=``}for(let t=0;t<e.length;t++){let i=e[t];switch(i){case`\r`:u=c===`
|
|
7
7
|
`||c===`\r`,r=!0,d(e[t+1]===`
|
|
8
8
|
`?t+2:t+1);break;case`
|
|
9
9
|
`:if(r){r=!1;break}u=c===`
|
|
10
|
-
`,d(t+1);break;default:n+=i;break}c=i}return{messages:t,leftoverData:e.substring(l)}}function fm(e){if(e.startsWith(`data:`))return{data:e.substring(5).trim()};if(e.startsWith(`id:`))return{id:e.substring(3).trim()};if(e.startsWith(`event:`))return{event:e.substring(6).trim()};if(e.startsWith(`retry:`)){let t=Number(e.substring(6).trim());if(!Number.isNaN(t))return Number.isInteger(t)?{retry:t}:{retry:Math.round(t)}}return{}}async function pm(e,t,n){let r=t.getReader(),i;for(;!e.signal.aborted&&!(i=await r.read()).done;)n(i.value)}function mm(e){return e instanceof DOMException&&e.name===`AbortError`}async function hm(e,t){if(typeof t.onResponse==`function`&&await t.onResponse(e),!e.response.ok)return;let n=e.response.headers.get(`Content-Type`);if(typeof n!=`string`||!n.includes(`text/event-stream`)){let r=Error(`Expected server to response with Content-Type: '${gm}'. Got '${n}'`);throw e.error=r,typeof t.onResponseError==`function`&&await t.onResponseError(e),r}}var gm,_m,vm,ym,bm,xm=n((()=>{cm(),gm=`text/event-stream`,_m=`last-event-id`,vm=class{url;lastEventId;options;retryCount=0;retryInterval=0;maxRetryCount;maxRetryInterval;fetch;timeoutDurationMs;timeout;constructor(e,t={}){this.url=e,this.options=t,this.maxRetryCount=t.maxRetryCount,this.maxRetryInterval=t.maxRetryInterval??3e4,this.fetch=Yp({fetch:t.fetch})??sm,this.timeoutDurationMs=t.timeout}async _handleRetry(e,t){if(this.retryCount++,typeof this.maxRetryCount==`number`&&this.retryCount>=this.maxRetryCount){e._emitEvent({type:`error`,reason:`max retry count reached`});return}this.retryInterval===0?this.retryInterval=2:this.retryInterval>0&&(this.retryInterval*=2,this.retryInterval>=this.maxRetryInterval&&(this.retryInterval=this.maxRetryInterval)),await um(this.retryInterval),e._abortController.abort(),e._abortController=new AbortController,await this._handleConnection(e,t)}async _handleConnection(e,t){let n,r=e._abortController.signal;if(typeof this.options.headers==`function`){let e=this.options.headers();n=`then`in e&&typeof e.then==`function`?new Headers(await e.then(e=>e)):new Headers(e)}else n=new Headers(this.options.headers??{});typeof n.get(`accept`)!=`string`&&n.set(`accept`,gm),typeof this.lastEventId==`string`&&n.set(_m,this.lastEventId);let i,a={...this.options,method:this.options.method??`get`,responseType:`stream`,headers:n,signal:r,retry:!1,onRequest:n=>{if(!(e.signal.aborted||r.aborted)&&!mm(n.error))return t.onRequest?.(n)},onRequestError:async n=>{if(!(e.signal.aborted||r.aborted)&&!mm(n.error))return t.onRequestError?.(n)},onResponse:async e=>(i=e,hm(e,t)),onResponseError:async e=>{if(!r.aborted&&!mm(e.error))throw e.error===void 0&&(e.error=new Xp(`${e.response.status} ${e.response.statusText}`)),await t.onResponseError?.(e),e.error}};try{this.timeoutDurationMs&&(this.timeout=setTimeout(()=>{e._emitEvent({type:`error`,reason:`Timeout of ${this.timeoutDurationMs}ms exceeded`})},this.timeoutDurationMs));let n=await this.fetch.raw(this.url,a);clearTimeout(this.timeout),this.timeout=void 0,this.retryCount=0,this.retryInterval=0;let r=new TextDecoder,o=``,s=n.body;if(!s){let e=Error(`Expected response body to contain ReadableStream`);throw i.response=n,i.error=e,await t.onResponseError?.(i),e}await pm(e,s,e=>{let n=dm(o+r.decode(e,{stream:!0}));o=n.leftoverData??``;for(let e of n.messages)typeof e.id==`string`&&e.id.length>0&&(this.lastEventId=e.id),t.onMessage(e)})}catch(n){return r.aborted||e.signal.aborted||mm(n)?void 0:this._handleRetry(e,t)}if(!(e.signal.aborted||r.aborted)){if(this.options.retryStrategy===`on-error`){e._emitEvent({type:`end-of-stream`,reason:`Stream has ended`});return}return this._handleRetry(e,t)}}listen(e){let t=new ym(new AbortController,n=>{if(n===void 0){this._handleConnection(t,e);return}this._handleConnection(t,{...e,...n})});return this._handleConnection(t,e),t}},ym=class{didAbort=!1;_abortController;_connect;constructor(e,t){this._abortController=e??new AbortController,this._connect=t}abort(e){this._emitEvent({type:`manual`,reason:e})}reconnect(e){this.didAbort=!1,this._abortController.abort(),this._abortController=new AbortController,this._connect?.(e)}_abortHook;_emitEvent(e){this.didAbort||(this.didAbort=!0,this._abortHook?.(e),this._abortController.abort(e.reason))}onAbort(e){this._abortHook=e}get signal(){return this._abortController.signal}},bm=[`get`,`head`,`post`,`put`,`delete`,`connect`,`options`,`trace`,`patch`]})),Sm=!1,Cm=!1,wm=`__trellisUi`,Tm=(e,...t)=>{typeof console<`u`&&console.warn(e,...t)},Em=e=>{let t=document.createElement(`template`);return t.innerHTML=e,t},Dm=e=>Array.from(Em(e).content.children).filter(e=>e instanceof HTMLElement),Om=(e,t)=>{t.forEach(t=>e.initTree(t))},km=(e,t)=>t||e.getAttribute(`x-merge`)||`replace`,Am=e=>{if(e.selector)return document.querySelector(e.selector);if(!e.target)return null;let t=e.target.startsWith(`#`)?e.target.slice(1):e.target;return document.getElementById(t)},jm=(e,t,n)=>{let r=km(t,n.mode);if(r===`remove`){t.remove();return}if(!n.html){Tm(`x-ui-stream: received patch with no html`);return}if(r===`morph`||r===`outer`){if(typeof e.morph==`function`){e.morph(t,n.html,{key(e){return e.getAttribute(`data-ui-key`)||e.id||null}});return}Tm(`x-ui-stream: morph mode requires @alpinejs/morph; falling back to replace`)}if(r===`replace`||r===`morph`||r===`outer`){let[r]=Dm(n.html);if(!r){Tm(`x-ui-stream: replace mode produced no element`);return}t.replaceWith(r),e.initTree(r);return}if(r===`update`){let r=Dm(n.html);t.innerHTML=n.html,Om(e,Array.from(t.children).filter(e=>e instanceof HTMLElement)),r.length===0&&n.html.trim()&&e.initTree(t);return}let i=Em(n.html),a=Array.from(i.content.children).filter(e=>e instanceof HTMLElement);if(r===`append`){t.append(i.content),Om(e,a);return}if(r===`prepend`){t.prepend(i.content),Om(e,a);return}if(r===`before`){t.before(i.content),Om(e,a);return}r===`after`&&(t.after(i.content),Om(e,a))},Mm=(e,t)=>{let n=Am(t);if(n){jm(e,n,t);return}if(t.selector||t.target){Tm(`x-ui-stream: target not found`,t.selector??t.target);return}if(!t.html){Tm(`x-ui-stream: received patch with no html`);return}Dm(t.html).forEach(n=>{if(!n.id){Tm(`x-ui-stream: top-level element has no id, skipping`,n);return}let r=document.getElementById(n.id);r&&jm(e,r,{...t,html:n.outerHTML})})},Nm=(e,t)=>{let n=Array.isArray(t)?t:[t];Ys(e,n,{scope:`target`,update:()=>{n.forEach(t=>Mm(e,t))}})},Pm=(e,t)=>{Mm(e,t)},Fm=e=>{document.dispatchEvent(new CustomEvent(e.event,{detail:e.detail??{},bubbles:!0,composed:!0}))},Im=e=>typeof e==`object`&&!!e,Lm=e=>({...Im(e)?e:{},[wm]:!0}),Rm=e=>Im(e)&&e[wm]===!0,zm=()=>{Rm(window.history.state)||window.history.replaceState(Lm(window.history.state),``,window.location.href)},Bm=e=>{Rm(e.state)&&window.location.reload()},Vm=e=>{if(!(e instanceof Element))return!1;let t=e._ajax_target;return!!(t&&Object.values(t).some(e=>e?.history===`push`))},Hm=e=>{Vm(e.target)&&zm()},Um=()=>{Cm||=(window.addEventListener(`popstate`,Bm),!0)},Wm=e=>{let t=e.mode??`push`;if(t===`assign`){window.location.assign(e.url);return}Um(),zm();let n=Lm(window.history.state);if(t===`replace`){window.history.replaceState(n,``,e.url);return}window.history.pushState(n,``,e.url)},Gm=(e,t)=>{if(t.type===`patch`){let{type:n,...r}=t;Nm(e,r);return}if(t.type===`dispatch`){let{type:e,...n}=t;Fm(n);return}if(t.type===`location`){Wm(t);return}Tm(`x-ui-stream: unknown UI effect`,t)},Km=(e,t)=>{(Array.isArray(t)?t:[t]).forEach(t=>Gm(e,t))},qm=e=>typeof e==`object`&&!!e&&Array.isArray(e.events),Jm=e=>{let t=e instanceof CustomEvent?e.detail:null,n=t?.headers;if(!n)return null;let r=n.get(`X-Trellis-UI-Events`);if(r)try{let e=JSON.parse(r);return Array.isArray(e)?e:null}catch{return Tm(`x-ui-stream: received invalid UI effect header`,r),null}if(n.get(`X-Trellis-UI-Response`)!==`events`)return null;try{let e=JSON.parse(t?.raw??`{}`);return qm(e)?e.events??[]:null}catch{return Tm(`x-ui-stream: received invalid UI effect response`,t?.raw),null}},Ym=e=>{try{return JSON.parse(e.data)}catch{return Tm(`x-ui-stream: received invalid JSON`,e.data),null}},Xm=async(e,t)=>{let{EventSourcePlus:n}=await Promise.resolve().then(()=>(xm(),lm));return new n(t).listen({onMessage(t){if(t.event===`trellis-ui-patch`){let n=Ym(t);n&&Nm(e,n);return}if(t.event===`trellis-ui-event`){let e=Ym(t);e&&Fm(e);return}if(t.event===`trellis-ui-effects`){let n=Ym(t);n&&Km(e,n)}}})},Zm=e=>{typeof e.directive==`function`&&(Um(),e.directive(`ui-stream`,(t,{expression:n},{cleanup:r})=>{if(!n)return;let i=null,a=!1;Xm(e,n).then(e=>{if(a){e.abort();return}i=e}),r(()=>{a=!0,i?.abort()})}),Sm||=(document.addEventListener(`ajax:success`,t=>{Hm(t);let n=Jm(t);n&&Km(e,n)}),!0))},Qm=[`light`,`dark`,`system`],$m=e=>typeof e==`string`&&Qm.includes(e),eh=e=>$m(e)?e:`system`,th=()=>document.documentElement.dataset.themeStorageKey||`trellis-ui-theme`,nh=()=>eh(document.documentElement.dataset.theme),rh=()=>{try{return eh(window.localStorage.getItem(th())||nh())}catch{return nh()}},ih=e=>{try{window.localStorage.setItem(th(),e)}catch{}},ah=()=>window.matchMedia(`(prefers-color-scheme: dark)`).matches,oh=e=>e===`dark`||e===`system`&&ah(),sh=e=>{let t=oh(e),n=document.documentElement;return n.classList.toggle(`dark`,t),n.dataset.theme=e,n.dispatchEvent(new CustomEvent(`ui:theme-change`,{detail:{mode:e,on:t},bubbles:!0})),{mode:e,on:t}},ch=()=>{let e=sh(rh());return{mode:e.mode,on:e.on,set(e){let t=eh(e);ih(t);let n=sh(t);this.mode=n.mode,this.on=n.on},toggle(){this.set(this.on?`light`:`dark`)}}},lh=e=>{if(typeof e.store!=`function`)return;let t=e.store(`darkMode`)??ch();e.store(`darkMode`,t),window.matchMedia(`(prefers-color-scheme: dark)`).addEventListener(`change`,()=>{if(t.mode!==`system`)return;let e=sh(`system`);t.mode=e.mode,t.on=e.on})},uh=0,dh=null,fh=()=>{if(uh===0){let e=document.documentElement,t=document.body,n=Math.max(0,window.innerWidth-e.clientWidth);dh={bodyOverflow:t.style.overflow,bodyPaddingRight:t.style.paddingRight,rootOverflow:e.style.overflow},e.style.overflow=`hidden`,t.style.overflow=`hidden`,n>0&&(t.style.paddingRight=`${n}px`),e.setAttribute(`data-ui-scroll-locked`,``)}uh+=1},ph=()=>{if(uh===0||(--uh,uh>0))return;let e=document.documentElement,t=document.body;t.style.overflow=dh?.bodyOverflow??``,t.style.paddingRight=dh?.bodyPaddingRight??``,e.style.overflow=dh?.rootOverflow??``,e.removeAttribute(`data-ui-scroll-locked`),dh=null},q={createAnchoredPopover:Vl,createCollectionNavigation:Jl,create:au,addDismissableLayer:Iu,addListener:Au,asBool:Ou,dispatch:ku,dispatchNativeControlChange:Vu,isRtl:Pu,removeAttribute:Nu,setAttribute:Mu,setPresence:ju,syncControlPresence:Lu,syncNativeControl:Ru,syncRepeatedHiddenInputs:Bu,getPathValue:Gu,normalizeOptionText:Hu,parseItemData:Wu,splitControlValues:Uu,createResizable:Wf,props:uu,propsFromSchema:Jf,resolveStyle:K,className:Wl,cx:Gl,motion:Xs,applyStreamPatch:Pm,applyStreamPatches:Nm,applyUiEffect:Gm,applyUiEffects:Km,connectStream:Xm,dispatchStreamEvent:Fm,applyThemeMode:sh,createDarkModeStore:ch,lockDocumentScroll:fh,registerConfirm:nu,registerResizable:Gf,registerStream:Zm,registerThemeStore:lh,unregisterConfirm:ru,unlockDocumentScroll:ph},mh=[`xs`,`sm`,`md`,`lg`,`xlg`],hh=[`outline`,`filled`],gh=[`outline`,`solid`,`mini`,`micro`],_h=[`button`,`submit`,`reset`],vh=[`start`,`center`,`end`],yh=[`bottom`,`top`,`left`,`right`],bh=[`top`,`right`,`bottom`,`left`],xh=[`vertical`,`horizontal`],Sh=[`leading`,`trailing`,`center`,`top-leading`,`top-trailing`,`bottom-leading`,`bottom-trailing`],Ch=[`default`],wh=[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`],Th=[`flex w-full min-w-0 items-center gap-control rounded-control border text-control-fg outline-none`,`focus-within:border-control-border-focus`,`data-disabled:cursor-not-allowed data-disabled:opacity-50`,`data-invalid:border-control-border-invalid data-invalid:focus-within:border-control-border-invalid-focus`],Eh=[`data-[state=open]:border-control-border-focus`,`data-invalid:data-[state=open]:border-control-border-invalid-focus`,`data-invalid:focus-within:shadow-danger-focus data-invalid:data-[state=open]:shadow-danger-focus`],Dh={xs:`min-h-control-xs px-1.5 text-xs`,sm:`min-h-control-sm px-2 text-xs`,md:`min-h-control-md px-3 text-sm`,lg:`min-h-control-lg px-3 text-sm`,xlg:`min-h-control-xlg px-4 text-sm`},Oh={outline:`border-control-border bg-control shadow-control`,filled:`border-transparent bg-control-hover shadow-none hover:bg-control-active`},kh=[`border-0 bg-transparent p-0 text-inherit text-control-fg outline-none`,`placeholder:text-control-placeholder disabled:cursor-not-allowed`],Ah=[`inline-flex size-control-xs shrink-0 items-center justify-center rounded-2 border-0 bg-transparent`,`text-icon outline-none hover:bg-control-hover hover:text-control-fg`,`focus-visible:ring-2 focus-visible:ring-focus`],jh=[`min-h-control-lg w-full rounded-control border border-control-border bg-control px-3 text-sm text-control-fg shadow-control outline-none`,`focus:border-control-border-focus disabled:cursor-not-allowed disabled:opacity-50`,`aria-[invalid=true]:border-control-border-invalid aria-[invalid=true]:focus:border-control-border-invalid-focus aria-[invalid=true]:focus:shadow-danger-focus`],Mh=[`absolute left-0 top-0 z-popover m-0 grid`,`rounded-3 bg-popover text-popover-fg shadow-popover outline-none`],Nh=[`ui-interactive:hover:bg-interactive-hover`,`ui-interactive:ui-active:bg-interactive-active`,`ui-interactive:ui-selected:bg-interactive-selected`,`ui-interactive:ui-selected:hover:bg-interactive-selected-hover`];[...Nh];var Ph=[`flex h-menu-item w-full cursor-default select-none items-center gap-2 rounded-2 px-menu-item-x`,`text-left text-sm font-normal text-menu-item-fg outline-none`,Nh,`data-disabled:pointer-events-none data-disabled:opacity-50`],Fh=`size-icon shrink-0 fill-current text-current opacity-70`,Ih=`ml-auto size-icon shrink-0 fill-current text-current opacity-0 data-selected:opacity-100`,Lh=[`single`,`multiple`],Rh=xh,zh=[`trailing`,`leading`];[...zh];var Bh=wh;[...Bh];var Vh={mode:W(Lh,`single`),collapsible:U,disabled:U,orientation:W(Rh,`vertical`),defaultValue:V,defaultValues:V,loop:U.default(!0),iconPosition:W(zh,`trailing`),headingAs:W(Bh,`h3`),class:V},Hh=G({definition:{component:`ui.accordion`,parts:{root:{base:`grid w-full min-w-0 gap-0`,variants:{orientation:{vertical:``,horizontal:`gap-2 md:grid-flow-col md:auto-cols-fr`}},defaults:{orientation:`vertical`}},item:{base:`min-w-0 border-b border-border last:border-b-0 data-disabled:opacity-50`},heading:{base:`block text-foreground`},trigger:{base:[`flex min-h-control-xlg w-full min-w-0 items-center gap-2 rounded-2 border border-transparent px-3 py-2`,`text-left text-sm font-medium text-foreground outline-none`,`focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2 focus-visible:ring-offset-app`,`data-disabled:pointer-events-none data-disabled:opacity-50`]},triggerLabel:{base:`min-w-0 flex-1`},icon:{base:`size-icon shrink-0 fill-current text-icon`},content:{base:`overflow-hidden text-sm text-foreground-muted`},contentInner:{base:`min-w-0 px-3 pb-3 pt-1`}}}}),Uh=e=>e.split(`,`).map(e=>e.trim()).filter(Boolean),Wh=e=>e?`open`:`closed`,Gh=e=>e instanceof HTMLButtonElement,Kh=()=>({props:null,openValues:new Set,collection:null,cleanup:[],init(){this.props=B({el:this.$el,schema:Vh}),this.openValues=new Set(this.initialValues()),this.setupTriggers(),this.syncAll()},destroy(){this.props.disconnect(),this.teardown()},get root(){return q.props({inputs:[q.resolveStyle({part:Hh.parts.root,props:this.props,className:this.props.class}),{"data-ui-accordion":``,":data-orientation":()=>this.props.orientation,":data-disabled":()=>this.props.disabled?``:void 0}]})},items(){return Array.from(this.$el.querySelectorAll(`[data-ui-accordion-item]`)).map((e,t)=>{let n=e.querySelector(`[data-ui-accordion-trigger]`),r=e.querySelector(`[data-ui-accordion-content]`);return!Gh(n)||!r?null:(e.dataset.value||(e.dataset.value=`item-${t+1}`),{item:e,heading:e.querySelector(`[data-ui-accordion-heading]`),trigger:n,content:r,value:e.dataset.value,isDisabled:this.props.disabled||q.asBool({value:e.dataset.disabled})})}).filter(e=>e!==null)},itemFromTrigger(e){return this.items().find(t=>t.trigger===e)??null},initialValues(){return this.props.mode===`multiple`&&this.props.defaultValues?this.normalizeValues(Uh(this.props.defaultValues)):this.props.mode===`single`&&this.props.defaultValue?this.normalizeValues([this.props.defaultValue]):this.normalizeValues(this.items().filter(e=>q.asBool({value:e.item.dataset.open})||e.item.dataset.state===`open`).map(e=>e.value))},normalizeValues(e){let t=Array.from(new Set(e.filter(Boolean)));return this.props.mode===`single`?t.slice(0,1):t},isItemOpen(e){return this.openValues.has(e.value)},isItemDisabled(e){return e.isDisabled},canCollapseOpenItem(e){return this.props.mode===`multiple`||this.props.collapsible||!this.isItemOpen(e)},toggleItem(e,t){if(t?.preventDefault(),this.isItemDisabled(e)||!this.canCollapseOpenItem(e))return;if(this.props.mode===`single`){this.setOpenValues(this.isItemOpen(e)?[]:[e.value]);return}let n=new Set(this.openValues);n.has(e.value)?n.delete(e.value):n.add(e.value),this.setOpenValues(Array.from(n))},setOpenValues(e){this.openValues=new Set(this.normalizeValues(e)),this.syncAll(),this.dispatchChange()},syncAll(){this.syncRoot(),this.items().forEach(e=>this.syncItem(e))},syncRoot(){this.$el.dataset.orientation=this.props.orientation,this.$el.dataset.iconPosition=this.props.iconPosition,this.$el.dataset.mode=this.props.mode,this.props.disabled?this.$el.setAttribute(`data-disabled`,``):this.$el.removeAttribute(`data-disabled`)},syncItem(e){let t=this.isItemOpen(e),n=Wh(t),r=this.isItemDisabled(e),i=t&&!this.canCollapseOpenItem(e);if(e.item.dataset.state=n,e.item.dataset.orientation=this.props.orientation,e.item.className=q.resolveStyle({part:Hh.parts.item,props:this.props,className:e.item.dataset.class??``}),e.heading?.setAttribute(`data-state`,n),e.heading?.setAttribute(`data-orientation`,this.props.orientation),e.trigger.id||=this.$id(`accordion-trigger-${e.value}`),e.content.id||=this.$id(`accordion-content-${e.value}`),e.trigger.type=`button`,e.trigger.dataset.state=n,e.trigger.dataset.orientation=this.props.orientation,e.trigger.className=q.resolveStyle({part:Hh.parts.trigger,props:this.props,className:e.trigger.dataset.class??``}),e.trigger.setAttribute(`aria-expanded`,t?`true`:`false`),e.trigger.setAttribute(`aria-controls`,e.content.id),e.content.dataset.state=n,e.content.dataset.orientation=this.props.orientation,e.content.setAttribute(`aria-labelledby`,e.trigger.id),this.syncContent(e.content,t),r){e.item.setAttribute(`data-disabled`,``),e.heading?.setAttribute(`data-disabled`,``),e.trigger.setAttribute(`data-disabled`,``),e.trigger.setAttribute(`aria-disabled`,`true`),e.trigger.disabled=!0,e.content.setAttribute(`data-disabled`,``);return}e.item.removeAttribute(`data-disabled`),e.heading?.removeAttribute(`data-disabled`),e.trigger.removeAttribute(`data-disabled`),e.trigger.disabled=!1,e.content.removeAttribute(`data-disabled`),i?e.trigger.setAttribute(`aria-disabled`,`true`):e.trigger.removeAttribute(`aria-disabled`)},syncContent(e,t){e.hidden=!t},setupTriggers(){this.items().forEach(e=>{q.addListener({target:e.trigger,event:`click`,handler:t=>this.toggleItem(e,t),cleanup:this.cleanup}),q.addListener({target:e.trigger,event:`keydown`,handler:t=>{t instanceof KeyboardEvent&&this.handleTriggerKeydown(e.trigger,t)},cleanup:this.cleanup}),q.addListener({target:e.trigger,event:`focus`,handler:()=>this.collectionNav().activateItem({el:e.trigger}),cleanup:this.cleanup})})},teardown(){this.cleanup.forEach(e=>e()),this.cleanup=[]},collectionNav(){return this.collection||=q.createCollectionNavigation({root:()=>this.$el,itemSelector:`[data-ui-accordion-trigger]`,isDisabled:e=>q.asBool({value:e.dataset.disabled})||e.hasAttribute(`disabled`),loop:()=>this.props.loop}),this.collection},handleTriggerKeydown(e,t){let n=this.itemFromTrigger(e);if(!n)return;if(t.key===`Enter`||t.key===` `){this.toggleItem(n,t);return}let r=this.props.orientation;if(t.key===`Home`){t.preventDefault(),this.focusFirst();return}if(t.key===`End`){t.preventDefault(),this.focusLast();return}if(r===`vertical`){if(t.key===`ArrowDown`){t.preventDefault(),this.focusNext();return}t.key===`ArrowUp`&&(t.preventDefault(),this.focusPrevious());return}if(t.key===`ArrowRight`){t.preventDefault(),q.isRtl({el:this.$el})?this.focusPrevious():this.focusNext();return}t.key===`ArrowLeft`&&(t.preventDefault(),q.isRtl({el:this.$el})?this.focusNext():this.focusPrevious())},focusNext(){this.collectionNav().focusNext()},focusPrevious(){this.collectionNav().focusPrevious()},focusFirst(){this.collectionNav().focusFirst()},focusLast(){this.collectionNav().focusLast()},dispatchChange(){let e=Array.from(this.openValues),t={value:this.props.mode===`single`?e[0]??``:``,values:e};q.dispatch({el:this.$el,name:`ui:change`,detail:t})}}),qh=e=>{e.data(`UiAccordion`,()=>Kh())};G({definition:{component:`ui.button`,parts:{root:{base:[`relative inline-flex min-w-0 shrink-0 select-none items-center gap-2 whitespace-nowrap rounded-3 font-normal outline-none`,`focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2 focus-visible:ring-offset-app`],variants:{align:{start:`justify-start`,center:`justify-center`,end:`justify-end`},size:{xs:`h-control-xs text-xs`,sm:`h-control-sm text-xs`,md:`h-control-md text-sm`,lg:`h-control-lg text-sm`,xlg:`h-control-xlg text-sm`},padded:{true:``,false:``},variant:{default:`bg-surface text-foreground shadow-border hover:shadow-border-hover`,outline:`bg-surface text-foreground shadow-border hover:shadow-border-hover`,subtle:`bg-base-a2 text-foreground shadow-none`,filled:`shadow-none`,ghost:`bg-transparent text-foreground shadow-none`,link:`bg-transparent px-0 shadow-none`},color:{neutral:``,accent:``,success:``,warning:``,danger:``},insetLeft:{true:``,false:``},insetRight:{true:``,false:``},insetTop:{true:`-mt-1`,false:``},insetBottom:{true:`-mb-1`,false:``}},compounds:[{when:{padded:!0,size:`xs`},class:`px-2`},{when:{padded:!0,size:`sm`},class:`px-2`},{when:{padded:!0,size:`md`},class:`px-3`},{when:{padded:!0,size:`lg`},class:`px-3`},{when:{padded:!0,size:`xlg`},class:`px-4`},{when:{padded:!1,size:`xs`},class:`w-control-xs px-0`},{when:{padded:!1,size:`sm`},class:`w-control-sm px-0`},{when:{padded:!1,size:`md`},class:`w-control-md px-0`},{when:{padded:!1,size:`lg`},class:`w-control-lg px-0`},{when:{padded:!1,size:`xlg`},class:`w-control-xlg px-0`},{when:{insetLeft:!0,size:`xs`},class:`-ml-2`},{when:{insetLeft:!0,size:`sm`},class:`-ml-2`},{when:{insetLeft:!0,size:`md`},class:`-ml-3`},{when:{insetLeft:!0,size:`lg`},class:`-ml-3`},{when:{insetLeft:!0,size:`xlg`},class:`-ml-4`},{when:{insetRight:!0,size:`xs`},class:`-mr-2`},{when:{insetRight:!0,size:`sm`},class:`-mr-2`},{when:{insetRight:!0,size:`md`},class:`-mr-3`},{when:{insetRight:!0,size:`lg`},class:`-mr-3`},{when:{insetRight:!0,size:`xlg`},class:`-mr-4`},{when:{variant:`filled`,color:`accent`},class:`bg-accent-solid text-accent-contrast shadow-1`},{when:{variant:`filled`,color:`danger`},class:`bg-danger-solid text-danger-contrast shadow-1`},{when:{variant:`filled`,color:`neutral`},class:`bg-base-a3 text-foreground`},{when:{variant:`link`,color:`neutral`},class:`text-foreground hover:text-foreground`},{when:{variant:`link`,color:`accent`},class:`text-accent-text hover:text-accent-12`},{when:{variant:`link`,color:`danger`},class:`text-danger-text hover:text-danger-contrast`}],defaults:{align:`center`,size:`md`,padded:!0,variant:`default`,color:`neutral`,insetLeft:!1,insetRight:!1,insetTop:!1,insetBottom:!1}},group:{base:`inline-flex items-center isolate`},content:{base:`flex min-w-0 flex-1 items-center gap-2`,variants:{align:{start:`justify-start`,center:`justify-center`,end:`justify-end`}},defaults:{align:`center`}},label:{base:`min-w-0`},loadingIndicator:{base:`pointer-events-none absolute inset-0 flex items-center justify-center`},icon:{base:`size-icon shrink-0 fill-current text-current`,variants:{position:{leading:``,trailing:`ml-auto`}},defaults:{position:`leading`}}}}});var Jh=`[data-ui-button]:not([data-ui-loading-mode="false"])`,Yh=[`hx-`,`data-on`,`data-bind`,`data-ref`,`data-show`,`data-action`,`data-request`,`data-ui-request`,`wire:`],Xh=[`ui:request-complete`,`ui:loading-complete`,`htmx:afterRequest`,`htmx:sendError`,`htmx:responseError`,`htmx:timeout`,`htmx:abort`,`datastar:afterRequest`,`datastar:responseError`],Zh=null,Qh=e=>e instanceof HTMLButtonElement||e instanceof HTMLAnchorElement,$h=e=>{if(!(e instanceof Element))return null;let t=e.closest(Jh);return Qh(t)?t:null},eg=e=>e.getAttributeNames().some(e=>Yh.some(t=>e.startsWith(t))),tg=e=>e instanceof HTMLButtonElement&&e.type===`submit`,ng=e=>e.dataset.uiLoadingMode===`true`||tg(e)||eg(e),rg=e=>e.dataset.uiSubmitting===`true`||e.getAttribute(`aria-disabled`)===`true`||e.hasAttribute(`disabled`),ig=e=>{e.dataset.uiSubmitting=`true`,e.setAttribute(`data-ui-loading`,``),e.setAttribute(`aria-disabled`,`true`),e.setAttribute(`aria-busy`,`true`),e.dispatchEvent(new CustomEvent(`ui:loading-start`,{bubbles:!0})),e instanceof HTMLButtonElement?e.disabled=!0:e.tabIndex=-1},ag=e=>{e.dataset.initialLoading!==`true`&&(delete e.dataset.uiSubmitting,e.removeAttribute(`data-ui-loading`),e.removeAttribute(`aria-busy`),e.dataset.initialDisabled!==`true`&&(e.removeAttribute(`aria-disabled`),e instanceof HTMLButtonElement?e.disabled=!1:e.removeAttribute(`tabindex`),e.dispatchEvent(new CustomEvent(`ui:loading-end`,{bubbles:!0}))))},og=(e,t)=>{window.setTimeout(()=>{!e.isConnected||rg(e)||ig(e)},0)},sg=e=>{let t=$h(e.target);if(!(!t||!ng(t))){if(rg(t)){e.preventDefault(),e.stopImmediatePropagation();return}t instanceof HTMLButtonElement&&t.form&&!t.form.checkValidity()||og(t,e)}},cg=e=>{let t=e,n=Qh(t.submitter)?t.submitter:null,r=e.target instanceof HTMLFormElement?e.target:null,i=n?.matches(Jh)?n:r?.querySelector(Jh)??null;!i||!tg(i)||og(i,e)},lg=()=>{document.querySelectorAll(`[data-ui-button][data-ui-submitting="true"]`).forEach(e=>ag(e))},ug=()=>{Zh||=(document.addEventListener(`click`,sg,!0),document.addEventListener(`submit`,cg),Xh.forEach(e=>document.addEventListener(e,lg)),()=>{document.removeEventListener(`click`,sg,!0),document.removeEventListener(`submit`,cg),Xh.forEach(e=>document.removeEventListener(e,lg)),Zh=null})},dg=xh,fg=Ch,pg=Sh,mg=mh,hg=Ch,gg={value:V.default(`on`),name:V,label:V,description:V,checked:U,indeterminate:U,disabled:U,required:U,invalid:U,indicator:U.default(!0),placement:W(pg,`leading`),icon:V,variant:W(hg,`default`),size:W(mg,`md`),inputClass:V,indicatorClass:V,indicatorIconClass:V,iconClass:V,contentClass:V,labelClass:V,descriptionClass:V,class:V};({...gg});var _g={name:V,orientation:W(dg,`vertical`),variant:W(fg,`default`),indicator:U.default(!0),placement:W(pg,`leading`),disabled:U,required:U,invalid:U,class:V};W(mg,`md`);var vg=e=>{let t=e.querySelector(`[data-ui-checkbox-input]`);return t?{root:e,input:t,indicator:e.querySelector(`[data-ui-checkbox-indicator]`),checkedIcon:e.querySelector(`[data-ui-checkbox-indicator-icon="checked"]`),indeterminateIcon:e.querySelector(`[data-ui-checkbox-indicator-icon="indeterminate"]`),name:e.dataset.name||t.name||``,disabled:e.hasAttribute(`data-disabled`)||t.disabled,required:e.hasAttribute(`data-required`)||t.required,invalid:e.hasAttribute(`data-invalid`)||t.getAttribute(`aria-invalid`)===`true`}:null},yg=(e,t={})=>{let n=t.disabled??e.disabled,r=t.required??e.required,i=t.invalid??e.invalid,a=e.input.indeterminate||e.root.hasAttribute(`data-indeterminate`),o=e.input.checked&&!a,s=a?`indeterminate`:o?`checked`:`unchecked`;e.input.indeterminate=a,q.syncNativeControl({input:e.input,state:{disabled:n,required:r,invalid:i}}),a?e.input.setAttribute(`aria-checked`,`mixed`):e.input.removeAttribute(`aria-checked`),q.setAttribute({el:e.root,attr:`data-state`,value:s}),q.setPresence({el:e.root,attr:`data-checked`,present:o}),q.setPresence({el:e.root,attr:`data-indeterminate`,present:a}),q.syncControlPresence({el:e.root,state:{disabled:n,required:r,invalid:i}}),q.setPresence({el:e.input,attr:`data-checked`,present:o}),q.setPresence({el:e.input,attr:`data-indeterminate`,present:a}),e.indicator&&(q.setAttribute({el:e.indicator,attr:`data-state`,value:s}),q.setPresence({el:e.indicator,attr:`data-checked`,present:o}),q.setPresence({el:e.indicator,attr:`data-indeterminate`,present:a}),q.setPresence({el:e.indicator,attr:`data-invalid`,present:i})),e.checkedIcon&&(q.setPresence({el:e.checkedIcon,attr:`data-checked`,present:o}),q.removeAttribute({el:e.checkedIcon,attr:`data-indeterminate`})),e.indeterminateIcon&&(q.setPresence({el:e.indeterminateIcon,attr:`data-indeterminate`,present:a}),q.removeAttribute({el:e.indeterminateIcon,attr:`data-checked`}))},bg=()=>({props:null,listeners:[],init(){this.props=B({el:this.$el,schema:gg});let e=this.input();(this.props.indeterminate||this.$el.hasAttribute(`data-indeterminate`))&&(e.indeterminate=!0),q.addListener({target:e,event:`change`,handler:()=>{e.indeterminate=!1,this.$el.removeAttribute(`data-indeterminate`),this.sync()},cleanup:this.listeners}),this.sync()},destroy(){this.props.disconnect(),this.listeners.forEach(e=>e()),this.listeners=[]},input(){let e=this.$el.querySelector(`[data-ui-checkbox-input]`);if(!e)throw Error(`Checkbox requires a native checkbox input.`);return e},item(){let e=vg(this.$el);if(!e)throw Error(`Checkbox requires a native checkbox input.`);return e},sync(){let e=this.item();this.props.name&&(e.input.name=this.props.name),this.props.value&&(e.input.value=this.props.value),yg(e,{disabled:this.props.disabled||e.disabled,required:this.props.required||e.required,invalid:this.props.invalid||e.invalid})}}),xg=()=>({props:null,listeners:[],observer:null,init(){this.props=B({el:this.$el,schema:_g}),q.addListener({target:this.$el,event:`change`,handler:e=>{let t=e.target;!(t instanceof HTMLInputElement)||t.type!==`checkbox`||(t.indeterminate=!1,t.closest(`[data-ui-checkbox]`)?.removeAttribute(`data-indeterminate`),this.sync())},cleanup:this.listeners}),this.observer=new MutationObserver(()=>this.sync()),this.observer.observe(this.$el,{childList:!0,subtree:!0}),this.sync()},destroy(){this.props.disconnect(),this.listeners.forEach(e=>e()),this.listeners=[],this.observer?.disconnect()},items(){return Array.from(this.$el.querySelectorAll(`[data-ui-checkbox]`)).map(vg).filter(e=>e!==null)},sync(){let e=this.$el;q.setAttribute({el:e,attr:`data-orientation`,value:this.props.orientation}),q.setAttribute({el:e,attr:`data-variant`,value:this.props.variant}),q.syncControlPresence({el:e,state:this.props}),this.items().forEach(e=>this.syncItem(e))},syncItem(e){this.props.name&&!e.name&&(e.input.name=this.props.name),yg(e,{disabled:this.props.disabled||e.disabled,required:this.props.required||e.required,invalid:this.props.invalid||e.invalid})}}),Sg=e=>{e.data(`UiCheckbox`,()=>bg()),e.data(`UiCheckboxGroup`,()=>xg())},Cg=mh,wg=hh,Tg=yh,Eg=vh,Dg=gh,Og={name:V,value:V,values:V,placeholder:V,multiple:U,open:U,disabled:U,readonly:U,required:U,invalid:U,clearable:U,autoHighlight:U,filter:U.default(!0),path:V,loop:U.default(!0),size:W(Cg,`lg`),variant:W(wg,`outline`),side:W(Tg,`bottom`),align:W(Eg,`start`),offset:H.clamp(-100,100).default(0),gap:H.clamp(0,50).default(4),icon:V,iconTrailing:V.default(`chevron__down`),iconVariant:W(Dg,`outline`),inputClass:V,listboxClass:V,chipClass:V,class:V};W(Dg,`outline`);var kg=G({definition:{component:`ui.combobox`,parts:{root:{base:`relative inline-grid w-full min-w-0`},control:{base:Th,variants:{size:Dh,variant:Oh},defaults:{size:`lg`,variant:`outline`}},chips:{base:`-ml-1.5 flex min-w-0 flex-wrap items-center gap-1`},chip:{base:[`inline-flex h-control-sm max-w-48 min-w-0 items-center gap-1 rounded-2 border border-border bg-base-a2 px-2`,`text-sm font-normal text-foreground`]},chipLabel:{base:`min-w-0 flex-1`},chipRemove:{base:[`-mr-1 inline-flex size-control-xs shrink-0 items-center justify-center rounded-2 border-0 bg-transparent`,`text-icon outline-none hover:bg-base-a3 hover:text-foreground`,`focus-visible:ring-2 focus-visible:ring-focus`]},input:{base:[`w-full min-w-16 flex-1`,kh]},icon:{base:`size-icon shrink-0 fill-current text-icon`,variants:{position:{leading:``,trailing:``}},defaults:{position:`leading`}},clear:{base:Ah},listbox:{base:[Mh,`auto-rows-min content-start max-h-combobox-listbox min-w-48 gap-1 overflow-auto p-popover`]},option:{base:Ph},optionLabel:{base:`min-w-0 flex-1`},optionMeta:{base:`ml-auto text-menu-item-muted`},optionIcon:{base:Fh,variants:{position:{leading:``,trailing:`ml-auto`}},defaults:{position:`leading`}},optionIndicator:{base:Ih},group:{base:`grid auto-rows-min content-start gap-1`},label:{base:`px-menu-item-x py-1 text-menu-heading-fg`},empty:{base:`px-menu-item-x py-2 text-sm text-foreground-muted`},separatorRoot:{base:`-mx-popover my-popover h-px`},separatorRule:{base:`h-px w-full border-0 bg-menu-separator`}}}}),Ag=()=>({isOpen:!1,query:``,selectedValues:[],selectedLabels:[],activeValue:``,inputId:``,listboxId:``,props:null,popover:null,listboxMotion:null,listeners:[],observer:null,renderedChipsKey:``,renderedHiddenInputsKey:``,init(){this.props=B({el:this.$el,schema:Og}),this.inputId=this.$id(`combobox-input`),this.listboxId=this.$id(`combobox-listbox`),this.isOpen=this.props.open;let e=this.options(),t=this.props.multiple?[...q.splitControlValues(this.props.values),...q.splitControlValues(this.props.value)]:q.splitControlValues(this.props.value).slice(0,1),n=e.filter(e=>q.asBool({value:e.el.dataset.selected})).map(e=>e.value);this.selectedValues=t.length>0?t:n,this.props.multiple||(this.selectedValues=this.selectedValues.slice(0,1)),this.selectedLabels=this.selectedValues.map(t=>e.find(e=>e.value===t)?.label??t),this.query=this.props.multiple?``:this.selectedLabels[0]??``,this.popover=q.createAnchoredPopover({reference:()=>this.control(),floating:()=>this.listbox(),position:()=>this.props.side,align:()=>this.props.align,gap:()=>this.props.gap,offset:()=>this.props.offset,matchReferenceWidth:!0}),this.listboxMotion=q.motion.createPresenceLifecycle({element:()=>this.listbox(),preset:`popover`}),this.setup(),this.sync(),this.isOpen&&this.mount()},destroy(){this.props.disconnect(),this.listboxMotion?.destroy(),this.listeners.forEach(e=>e()),this.listeners=[],this.observer?.disconnect(),this.unmount()},get root(){return q.props({inputs:[K({part:kg.parts.root,props:this.props,className:this.props.class}),{"data-ui-combobox":``,":data-state":()=>this.isOpen?`open`:`closed`,":data-disabled":()=>this.props.disabled?`true`:void 0,":data-invalid":()=>this.props.invalid?`true`:void 0}]})},control(){let e=this.$el.querySelector(`[data-ui-combobox-control]`);if(!e)throw Error(`Combobox requires a control element.`);return e},input(){let e=this.$el.querySelector(`[data-ui-combobox-input]`);if(!e)throw Error(`Combobox requires an input element.`);return e},listbox(){let e=this.$el.querySelector(`[data-ui-combobox-listbox]`);if(!e)throw Error(`Combobox requires a listbox element.`);return e},chipsEl(){return this.$el.querySelector(`[data-ui-combobox-chips]`)},hiddenInputsEl(){return this.$el.querySelector(`[data-ui-combobox-hidden-inputs]`)},options(){let e=q.normalizeOptionText(this.query);return Array.from(this.$el.querySelectorAll(`[data-ui-combobox-option]`)).map((t,n)=>{let r=this.resolveOptionLabel(t),i=this.optionValue(t,r),a=q.asBool({value:t.dataset.disabled}),o=this.selectedValues.includes(i),s=!this.props.filter||e===``||q.normalizeOptionText(`${r} ${t.dataset.suffix??``}`).includes(e);return{el:t,id:t.id||`${this.listboxId}-option-${n}`,value:i,label:r,disabled:a,selected:o,visible:s}})},enabledVisibleOptions(){return this.options().filter(e=>e.visible&&!e.disabled)},hasSelection(){return this.selectedValues.length>0},hasClearValue(){return this.query.length>0||this.hasSelection()},open(e){if(e?.preventDefault(),this.props.disabled)return;let t=this.isOpen;this.isOpen=!0,this.props.autoHighlight&&!this.activeValue&&this.setActive(this.enabledVisibleOptions()[0]??null),this.sync(),t||this.listboxMotion?.enter({before:()=>{let e=this.listbox();e.hidden=!1,e.showPopover?.(),this.mount()}}),q.dispatch({el:this.$el,name:`ui:open`})},close(e){e?.preventDefault();let t=this.isOpen;this.isOpen=!1,this.activeValue=``,!this.props.multiple&&this.hasSelection()&&(this.query=this.selectedLabels[0]??``),this.sync(),t&&this.listboxMotion?.exit({before:()=>{let e=this.listbox();e.dataset.state=`closed`,e.hidden=!1},after:()=>{this.isOpen||(this.listbox().hidePopover?.(),this.unmount(),this.syncListbox(),q.dispatch({el:this.$el,name:`ui:close`}))}})},toggle(e){if(e?.preventDefault(),!(this.props.readonly||this.props.disabled)){if(this.isOpen){this.close();return}this.open(),this.input().focus({preventScroll:!0})}},clear(e){e?.preventDefault(),!(this.props.disabled||this.props.readonly)&&(this.query=``,this.selectedValues=[],this.selectedLabels=[],this.activeValue=``,this.sync(),this.input().focus({preventScroll:!0}),q.dispatchNativeControlChange({container:this.hiddenInputsEl(),fallback:this.$el,marker:`data-ui-combobox-hidden-input`}),q.dispatch({el:this.$el,name:`ui:clear`}),q.dispatch({el:this.$el,name:`ui:change`,detail:{value:``,values:[],labels:[]}}))},removeValue(e){if(this.props.disabled||this.props.readonly)return;let t=this.options();this.selectedValues=this.selectedValues.filter(t=>t!==e),this.selectedLabels=this.selectedValues.map(e=>t.find(t=>t.value===e)?.label??e),this.sync(),q.dispatchNativeControlChange({container:this.hiddenInputsEl(),fallback:this.$el,marker:`data-ui-combobox-hidden-input`}),this.input().focus({preventScroll:!0}),q.dispatch({el:this.$el,name:`ui:change`,detail:{value:this.selectedValues[0]??``,values:[...this.selectedValues],labels:[...this.selectedLabels]}})},removeLastValue(e){!this.props.multiple||this.query!==``||this.selectedValues.length===0||(e?.preventDefault(),this.removeValue(this.selectedValues[this.selectedValues.length-1]))},selectOption(e,t){if(t?.preventDefault(),!(this.props.disabled||this.props.readonly||e.disabled)){if(this.props.multiple){this.selectedValues.includes(e.value)?this.selectedValues=this.selectedValues.filter(t=>t!==e.value):this.selectedValues=[...this.selectedValues,e.value];let t=this.options();this.selectedLabels=this.selectedValues.map(e=>t.find(t=>t.value===e)?.label??e),this.query=``,this.open()}else this.selectedValues=[e.value],this.selectedLabels=[e.label],this.query=e.label,this.input().focus({preventScroll:!0}),this.close();this.sync(),this.props.multiple&&this.input().focus({preventScroll:!0}),q.dispatchNativeControlChange({container:this.hiddenInputsEl(),fallback:this.$el,marker:`data-ui-combobox-hidden-input`}),q.dispatch({el:this.$el,name:`ui:change`,detail:{value:this.selectedValues[0]??``,values:[...this.selectedValues],label:this.selectedLabels[0]??``,labels:[...this.selectedLabels]}})}},setActive(e){(e?.value??``)!==this.activeValue&&(this.activeValue=e?.value??``,this.syncOptions(),this.syncInput())},moveActive(e){let t=this.enabledVisibleOptions();if(t.length===0)return;let n=t.findIndex(e=>e.value===this.activeValue),r=n+e;n<0&&(r=e>0?0:t.length-1),r>=t.length&&(r=this.props.loop?0:t.length-1),r<0&&(r=this.props.loop?t.length-1:0),this.setActive(t[r]??null)},focusFirst(){this.setActive(this.enabledVisibleOptions()[0]??null)},focusLast(){let e=this.enabledVisibleOptions();this.setActive(e[e.length-1]??null)},handleInput(e){if(this.props.readonly||this.props.disabled)return;let t=e.target;t instanceof HTMLInputElement&&(this.query=t.value,!this.props.multiple&&this.selectedLabels[0]!==this.query&&(this.selectedValues=[],this.selectedLabels=[]),this.open(),this.props.autoHighlight?this.focusFirst():this.setActive(null),this.sync())},handleKeydown(e){if(e.key===`ArrowDown`){e.preventDefault(),this.isOpen||this.open(),this.moveActive(1);return}if(e.key===`ArrowUp`){e.preventDefault(),this.isOpen||this.open(),this.moveActive(-1);return}if(this.isOpen&&e.key===`Home`){e.preventDefault(),this.focusFirst();return}if(this.isOpen&&e.key===`End`){e.preventDefault(),this.focusLast();return}if(e.key===`Enter`&&this.isOpen&&this.activeValue){let t=this.options().find(e=>e.value===this.activeValue);t&&this.selectOption(t,e);return}if((e.key===`Backspace`||e.key===`Delete`)&&this.props.multiple&&this.query===``){let t=this.input();t.selectionStart===0&&t.selectionEnd===0&&this.removeLastValue(e);return}e.key===`Escape`&&this.isOpen&&this.close(e)},handleFocusout(e){let t=e.relatedTarget;if(!(t instanceof Node)){this.close();return}this.$el.contains(t)||this.listbox().contains(t)||this.close()},sync(){this.syncControl(),this.syncInput(),this.syncListbox(),this.syncOptions(),this.syncHiddenInputs(),this.syncChips()},syncOptions(){let e=this.options(),t=this.$el.querySelector(`[data-ui-combobox-empty]`),n=e.some(e=>e.visible);e.forEach(e=>{e.el.id=e.id,e.el.hidden=!e.visible,e.el.setAttribute(`role`,`option`),e.el.setAttribute(`aria-selected`,e.selected?`true`:`false`),e.el.dataset.value=e.value,e.el.dataset.label=e.label,q.setPresence({el:e.el,attr:`data-selected`,present:e.selected,value:`true`}),q.setPresence({el:e.el,attr:`data-highlighted`,present:e.value===this.activeValue,value:`true`}),q.setPresence({el:e.el,attr:`data-disabled`,present:e.disabled,value:`true`}),e.el.querySelectorAll(`[data-ui-combobox-option-indicator]`).forEach(t=>{q.setPresence({el:t,attr:`data-selected`,present:e.selected,value:`true`})}),e.disabled?e.el.setAttribute(`aria-disabled`,`true`):e.el.removeAttribute(`aria-disabled`)}),t&&(t.hidden=n)},syncInput(){let e=this.input();e.id||=this.inputId,e.value!==this.query&&(e.value=this.query),e.setAttribute(`role`,`combobox`),e.setAttribute(`autocomplete`,`off`),e.setAttribute(`aria-autocomplete`,`list`),e.setAttribute(`aria-expanded`,this.isOpen?`true`:`false`),e.setAttribute(`aria-controls`,this.listboxId),q.syncNativeControl({input:e,state:{disabled:this.props.disabled,readonly:this.props.readonly,required:this.props.required,nativeRequired:this.props.required&&!this.props.multiple,invalid:this.props.invalid,ariaRequired:this.props.required}});let t=this.options().find(e=>e.value===this.activeValue);t?e.setAttribute(`aria-activedescendant`,t.id):e.removeAttribute(`aria-activedescendant`)},syncControl(){let e=this.control(),t=K({part:kg.parts.control,props:this.props});e.setAttribute(`class`,t),e.setAttribute(`data-ui-control`,``),e.setAttribute(`data-ui-combobox-control`,``),e.dataset.state=this.isOpen?`open`:`closed`,e.dataset.variant=this.props.variant,q.syncControlPresence({el:e,state:{disabled:this.props.disabled,invalid:this.props.invalid},value:`true`})},syncListbox(){let e=this.listbox(),t=K({part:kg.parts.listbox,props:this.props,className:this.props.listboxClass});e.id=this.listboxId,e.setAttribute(`class`,t),e.setAttribute(`role`,`listbox`),e.setAttribute(`tabindex`,`-1`),e.setAttribute(`popover`,`manual`),e.setAttribute(`data-ui-combobox-listbox`,``),e.dataset.state=this.isOpen?`open`:`closed`,e.hidden=!this.isOpen,this.props.multiple?e.setAttribute(`aria-multiselectable`,`true`):e.removeAttribute(`aria-multiselectable`)},syncHiddenInputs(){let e=this.hiddenInputsEl();e&&(this.renderedHiddenInputsKey=q.syncRepeatedHiddenInputs({container:e,state:{name:this.props.name,required:this.props.required,values:this.selectedValues,form:this.$el.dataset.form??``,marker:`data-ui-combobox-hidden-input`},currentKey:this.renderedHiddenInputsKey}))},syncChips(){let e=this.chipsEl();if(!e)return;let t=!this.props.multiple||this.selectedValues.length===0;e.hidden=t;let n=JSON.stringify({hidden:t,values:this.selectedValues,labels:this.selectedLabels,chipClass:this.props.chipClass});if(n===this.renderedChipsKey||(this.renderedChipsKey=n,e.replaceChildren(),e.hidden))return;let r=K({part:kg.parts.chip,props:{},className:this.props.chipClass}),i=K({part:kg.parts.chipLabel}),a=K({part:kg.parts.chipRemove});this.selectedValues.forEach((t,n)=>{let o=this.selectedLabels[n]??t,s=document.createElement(`span`);s.className=r,s.setAttribute(`data-ui-combobox-chip`,``);let c=document.createElement(`span`);c.className=i,c.setAttribute(`data-ui-combobox-chip-label`,``),c.textContent=o,s.append(c);let l=document.createElement(`button`);l.type=`button`,l.className=a,l.setAttribute(`data-ui-combobox-chip-remove`,``),l.setAttribute(`aria-label`,`Remove ${o}`);let u=this.$el.querySelector(`[data-ui-combobox-chip-remove-icon]`);u?l.append(u.content.cloneNode(!0)):l.textContent=`x`,l.addEventListener(`click`,()=>this.removeValue(t)),s.append(l),e.append(s)})},syncPosition(){this.popover?.sync()},mount(){this.popover?.mount()},unmount(){this.popover?.unmount()},setup(){let e=this.input(),t=this.control(),n=this.listbox();q.addListener({target:e,event:`focus`,handler:()=>this.open(),cleanup:this.listeners}),q.addListener({target:e,event:`input`,handler:e=>this.handleInput(e),cleanup:this.listeners}),q.addListener({target:e,event:`keydown`,handler:e=>{e instanceof KeyboardEvent&&this.handleKeydown(e)},cleanup:this.listeners}),q.addListener({target:this.$el,event:`focusout`,handler:e=>{e instanceof FocusEvent&&this.handleFocusout(e)},cleanup:this.listeners}),q.addListener({target:t,event:`click`,handler:t=>{let n=t.target;n instanceof Element&&n.closest(`[data-ui-combobox-clear], [data-ui-combobox-toggle]`)||document.activeElement!==e&&e.focus({preventScroll:!0})},cleanup:this.listeners}),q.addListener({target:t,event:`click`,handler:e=>{let t=e.target;t instanceof Element&&(t.closest(`[data-ui-combobox-clear]`)&&this.clear(e),t.closest(`[data-ui-combobox-toggle]`)&&this.toggle(e))},cleanup:this.listeners}),q.addListener({target:n,event:`pointerdown`,handler:e=>{let t=e.target;t instanceof Element&&t.closest(`[data-ui-combobox-option]`)&&e.preventDefault()},cleanup:this.listeners}),q.addListener({target:n,event:`click`,handler:e=>{let t=e.target;if(!(t instanceof Element))return;let n=t.closest(`[data-ui-combobox-option]`),r=n?this.options().find(e=>e.el===n):void 0;r&&this.selectOption(r,e)},cleanup:this.listeners}),q.addListener({target:n,event:`pointermove`,handler:e=>{let t=e.target;if(!(t instanceof Element))return;let n=t.closest(`[data-ui-combobox-option]`),r=n?this.options().find(e=>e.el===n):void 0;r&&!r.disabled&&this.setActive(r)},cleanup:this.listeners}),q.addListener({target:n,event:`pointerleave`,handler:()=>{this.setActive(null)},cleanup:this.listeners}),this.listeners.push(q.addDismissableLayer({isEnabled:()=>this.isOpen,roots:()=>[this.$el,n],onDismiss:()=>this.close()})),this.observer=new MutationObserver(()=>{this.sync(),this.props.autoHighlight&&this.isOpen&&!this.activeValue&&this.focusFirst()}),this.observer.observe(n,{childList:!0,subtree:!0})},resolveOptionLabel(e){let t=q.parseItemData(e.dataset.item),n=q.getPathValue(t,this.props.path);return n==null?(e.querySelector(`[data-ui-combobox-option-label]`)?.textContent??e.textContent??``).trim():String(n)},optionValue(e,t){return e.dataset.value||t}}),jg=e=>{e.data(`UiCombobox`,()=>Ag())},Mg=[`single`,`range`],Ng=[`enhanced`,`native`],Pg=[`popover`,`modal`,`native`],Fg=[`select`,`confirm`],Ig=[`neutral`,`accent`],Lg=[`left`,`right`,`top`,`bottom`],Rg={name:V,value:V,startName:V,endName:V,mode:W(Mg,`single`),placeholder:V,min:V,max:V,today:V,openTo:V,forceOpenTo:U,months:H.clamp(0,12).default(0),firstDayOfWeek:H.clamp(-1,6).default(0),locale:V,showOutsideDays:U,showWeekNumbers:U,fixedWeeks:U.default(!0),selectableHeader:U,withToday:U,clearable:U,disabled:U,readonly:U,required:U,invalid:U,side:W(yh,`bottom`),align:W(vh,`start`),offset:H.clamp(-100,100).default(0),gap:H.clamp(0,50).default(4),mobile:W(Pg,`modal`),variant:W(Ng,`enhanced`),color:W(Ig,`neutral`),close:W(Fg,`select`),presets:Eu.array([]),presetsPosition:W(Lg,`left`),preset:V,presetName:V,triggerClass:V,inputClass:V,popoverClass:V,calendarClass:V,presetsClass:V,presetClass:V,class:V,form:V};W(Lg,`left`);var zg=G({definition:{component:`ui.date-picker`,parts:{root:{base:`relative inline-grid w-full min-w-0`},trigger:{base:[Th,Eh,Dh.lg,Oh.outline,`text-left`]},customTrigger:{base:[`inline-flex min-h-control-lg min-w-control-lg shrink-0 items-center justify-center gap-control rounded-control border border-control-border bg-control px-2 text-sm text-control-fg shadow-control outline-none`,`hover:bg-control-hover hover:text-control-fg`,`focus-visible:ring-2 focus-visible:ring-focus`,`data-disabled:cursor-not-allowed data-disabled:opacity-50`]},input:{base:[`min-w-0 flex-1 text-sm`,kh]},icon:{base:`size-icon shrink-0 fill-current text-icon`},action:{base:Ah},popover:{base:[Mh,`max-h-lg overflow-hidden`]},panel:{base:`grid min-w-72 max-w-[calc(100vw-2rem)] gap-0 overflow-hidden`,variants:{hasPresets:{true:``,false:``},presetsPosition:{left:``,right:``,top:``,bottom:``}},compounds:[{when:{hasPresets:!0,presetsPosition:`left`},class:`sm:grid-cols-[minmax(9rem,11rem)_auto]`},{when:{hasPresets:!0,presetsPosition:`right`},class:`sm:grid-cols-[auto_minmax(9rem,11rem)]`}],defaults:{hasPresets:!1,presetsPosition:`left`}},calendarWrap:{base:`relative grid size-full place-items-center overflow-x-auto overflow-y-auto p-popover`},calendar:{base:`grid max-w-full gap-2 text-sm text-foreground`},presets:{base:[`grid content-start gap-1 border-popover-border p-popover`,`sm:data-[position=left]:border-r sm:data-[position=right]:border-l data-[position=top]:border-b data-[position=bottom]:border-t`]},preset:{base:Ph},footer:{base:`flex items-center justify-end gap-2 border-t border-popover-border p-popover`},nativeWrapper:{base:`relative w-full min-w-0`},native:{base:[jh]}}}}),Bg=i({CalendarDate:()=>ey,CalendarMonth:()=>Jv,CalendarMulti:()=>oy,CalendarRange:()=>ay,CalendarSelectMonth:()=>ry,CalendarSelectYear:()=>ny});function Vg(e,t){let n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}function Hg(e,t){let n,r=e=>{let{length:i}=e;for(let a=0;a<i;a++){let i=e[a];if(i&&Array.isArray(i))r(i);else{let e=typeof i;if(i==null||e===`function`||e===`boolean`)continue;e===`string`||e===`number`?(n??=``,n+=i):(n!=null&&(t(n),n=null),t(i))}}};r(e),n!=null&&t(n)}function Ug(e,t,n,r,i){let{type:a,reflect:o,event:s,value:c,attr:l=Y_(t)}=n?.name!=G_&&R_(n)&&n!=K_?n:{type:n},u=a?.name===G_&&a.map,d=c==null?null:a==Function||!Y(c)?()=>c:c;Object.defineProperty(e,t,{configurable:!0,set(e){let n=this[t];d&&a!=Boolean&&e==null&&(e=d());let{error:r,value:i}=(u?Q_:$_)(a,e);if(r&&i!=null)throw new U_(this,`The value defined for prop '${t}' must be of type '${a.name}'`,i);n!=i&&(this._props[t]=i??void 0,this.update(),s&&J_(this,s),this.updated.then(()=>{o&&(this._ignoreAttr=l,X_(this,a,l,this[t]),this._ignoreAttr=null)}))},get(){return this._props[t]}}),d&&(i[t]=d()),r[l]={prop:t,type:a}}function Wg(e){let{styles:t}=e.constructor,{shadowRoot:n}=e;if(n&&t.length){let e=[];Hg(t,t=>{t&&(t instanceof Element?n.appendChild(t.cloneNode(!0)):e.push(t))}),e.length&&(n.adoptedStyleSheets=e)}}function Gg(e,t,n){return Kg(this,e,t,n)}function Kg(e,t,n=yv,r,i){let a;if(t&&t[n]&&t[n].vnode==e||e[bv]!=Sv)return t;(e||!t)&&(i||=e.type==`svg`,a=e.type!=`host`&&(e.raw==1?(t&&e.clone?t[xv]:t)!=e.type:e.raw==2?!(t instanceof e.type):t?t[xv]||t.localName!=e.type:!t),a&&e.type!=null&&(e.raw==1&&e.clone?(r=!0,t=e.type.cloneNode(!0),t[xv]=e.type):t=e.raw==1?e.type:e.raw==2?new e.type:i?document.createElementNS(`http://www.w3.org/2000/svg`,e.type):document.createElement(e.type,e.is?{is:e.is}:void 0)));let o=t[n]?t[n]:gv,{vnode:s=gv,cycle:c=0}=o,{fragment:l,handlers:u}=o,{children:d=_v,props:f=gv}=s;if(u=a?{}:u||{},e.static&&!a)return t;if(e.shadow&&!t.shadowRoot&&t.attachShadow({mode:`open`,...e.shadow}),e.props!=f&&Yg(t,f,e.props,u,i),e.children!==d){let a=e.shadow?t.shadowRoot:t;l=Jg(e.children,l,a,n,!c&&r,i&&e.type==`foreignObject`?!1:i)}return t[n]={vnode:e,handlers:u,fragment:l,cycle:c+1},t}function qg(e,t){let n=new vv(``),r=new vv(``),i;if(e[t?`prepend`:`append`](n),t){let{lastElementChild:t}=e;for(;t;){let{previousElementSibling:e}=t;if(B_(t,!0)&&!B_(e,!0)){i=t;break}t=e}}return i?i.before(r):e.append(r),{markStart:n,markEnd:r}}function Jg(e,t,n,r,i,a){e=e==null?null:z_(e)?e:[e];let o=t||qg(n,i),{markStart:s,markEnd:c,keyes:l}=o,u,d=l&&new Set,f=s;if(e&&Hg(e,e=>{if(typeof e==`object`&&!e[bv])return;let t=e[bv]&&e.key,o=l&&t!=null&&l.get(t);f!=c&&f===o?d.delete(f):f=f==c?c:f.nextSibling;let s=l?o:f,p=s;if(e[bv])p=Kg(e,s,r,i,a);else{let t=e+``;!(p instanceof Text)||p instanceof vv?p=new Text(t):p.data!=t&&(p.data=t)}p!=f&&(l&&d.delete(p),!s||l?(n.insertBefore(p,f),l&&f!=c&&d.add(f)):s==c?n.insertBefore(p,c):(n.replaceChild(p,s),f=p)),t!=null&&(u||=new Map,u.set(t,p))}),f=f==c?c:f.nextSibling,t&&f!=c)for(;f!=c;){let e=f;f=f.nextSibling,e.remove()}return d&&d.forEach(e=>e.remove()),o.keyes=u,o}function Yg(e,t,n,r,i){for(let a in t)!(a in n)&&Xg(e,a,t[a],null,i,r);for(let a in n)Xg(e,a,t[a],n[a],i,r)}function Xg(e,t,n,r,i,a){if(t=t==`class`&&!i?`className`:t,n??=null,r??=null,t in e&&pv[t]&&(n=e[t]),!(r===n||hv[t]||t[0]==`_`))if(e.localName===`slot`&&t===`assignNode`&&`assign`in e)e.assign(r);else if(t[0]==`o`&&t[1]==`n`&&(Y(r)||Y(n)))Zg(e,t.slice(2),r,a);else if(t==`ref`)r&&(Y(r)?r(e):r.current=e);else if(t==`style`){let{style:t}=e;n||=``,r||=``;let i=R_(n),a=R_(r);if(i)for(let e in n)if(a)!(e in r)&&Qg(t,e,null);else break;if(a)for(let e in r){let a=r[e];i&&n[e]===a||Qg(t,e,a)}else t.cssText=r}else{let a=t[0]==`$`?t.slice(1):t;a===t&&(!i&&!mv[t]&&t in e||Y(r)||Y(n))?e[t]=r??``:r==null?e.removeAttribute(a):e.setAttribute(a,R_(r)?JSON.stringify(r):r)}}function Zg(e,t,n,r){if(r.handleEvent||=t=>r[t.type].call(e,t),n){if(!r[t]){let i=n.capture||n.once||n.passive?Object.assign({},n):null;e.addEventListener(t,r,i)}r[t]=n}else r[t]&&(e.removeEventListener(t,r),delete r[t])}function Qg(e,t,n){let r=`setProperty`;n??=(r=`removeProperty`,null),~t.indexOf(`-`)?e[r](t,n):e[t]=n}function $g(e,...t){let n=(e.raw||e).reduce((e,n,r)=>e+n+(t[r]||``),``);return Av[n]=Av[n]||e_(n)}function e_(e){if(dv.sheet){let t=new CSSStyleSheet;return t.replaceSync(e),t}else{let t=document.createElement(`style`);return t.textContent=e,t}}function t_(){let e=new Date;return new Q(e.getFullYear(),e.getMonth()+1,e.getDate())}function n_(e){let t=J(e);t.setUTCDate(t.getUTCDate()+3-(t.getUTCDay()+6)%7);let n=new Date(Date.UTC(t.getUTCFullYear(),0,4));return 1+Math.round(((t.getTime()-n.getTime())/Pv-3+(n.getUTCDay()+6)%7)/7)}function r_(e,t=0){let n=J(e),r=n.getUTCDay(),i=(r<t?7:0)+r-t;return n.setUTCDate(n.getUTCDate()-i),Q.from(n)}function i_(e,t=0){return r_(e,t).add({days:6})}function a_(e){return Q.from(new Date(Date.UTC(e.year,e.month,0)))}function o_(e,t,n){return t&&Q.compare(e,t)<0?t:n&&Q.compare(e,n)>0?n:e}function s_(e,t=0){let n=r_(e.toPlainDate(),t),r=i_(a_(e),t),i=[];for(;Q.compare(n,r)<0;){let e=[];for(let t=0;t<7;t++)e.push(n),n=n.add(Fv);i.push(e)}return i}function J(e){return new Date(Date.UTC(e.year,e.month-1,e.day??1))}function c_(e,t){if(t)try{return e.from(t)}catch{}}function l_(e){let[t,n]=cv(e);return[X(()=>c_(Q,t),[t]),e=>n(e?.toString())]}function u_(e){let[t=``,n]=cv(e);return[X(()=>{let[e,n]=t.split(`/`),r=c_(Q,e),i=c_(Q,n);return r&&i?[r,i]:[]},[t]),e=>n(`${e[0]}/${e[1]}`)]}function d_(e){let[t=``,n]=cv(e);return[X(()=>{let e=[];for(let n of t.trim().split(/\s+/)){let t=c_(Q,n);t&&e.push(t)}return e},[t]),e=>n(e.join(` `))]}function f_(e,t){return X(()=>new Intl.DateTimeFormat(t,{timeZone:`UTC`,...e}),[t,e])}function p_(e,t,n){let r=f_(e,n);return X(()=>{let e=[],n=new Date;for(var i=0;i<7;i++){let i=(n.getUTCDay()-t+7)%7;e[i]=r.format(n),n.setUTCDate(n.getUTCDate()+1)}return e},[t,r])}function m_({props:e,context:t}){let{offset:n}=e,{firstDayOfWeek:r,isDateDisallowed:i,min:a,max:o,today:s,page:c,locale:l,focusedDate:u,formatWeekday:d}=t,f=s??t_(),p=p_(Uv,r,l),m=p_(X(()=>({weekday:d}),[d]),r,l),h=f_(Vv,l),g=f_(Hv,l),_=X(()=>c.start.add({months:n}),[c,n]),v=X(()=>s_(_,r),[_,r]),y=lv(`focusday`,Wv),b=lv(`selectday`,Wv),x=lv(`hoverday`,Wv);function S(e){y(o_(e,a,o))}function C(e){let t;switch(e.key){case`ArrowRight`:t=u.add({days:Bv(e)?1:-1});break;case`ArrowLeft`:t=u.add({days:Bv(e)?-1:1});break;case`ArrowDown`:t=u.add({days:7});break;case`ArrowUp`:t=u.add({days:-7});break;case`PageUp`:t=u.add(e.shiftKey?{years:-1}:{months:-1});break;case`PageDown`:t=u.add(e.shiftKey?{years:1}:{months:1});break;case`Home`:t=r_(u,r);break;case`End`:t=i_(u,r);break;default:return}S(t),e.preventDefault()}function w(e){let n=_.equals(e);if(!t.showOutsideDays&&!n)return;let r=e.equals(u),s=e.equals(f),c=J(e),l=i?.(c),d=!zv(e,a,o),p=``,m;if(t.type===`range`){let[n,r]=t.value,i=n?.equals(e),a=r?.equals(e);m=n&&r&&zv(e,n,r),p=`${i?`range-start`:``} ${a?`range-end`:``} ${m&&!i&&!a?`range-inner`:``}`}else m=t.type===`multi`?t.value.some(t=>t.equals(e)):t.value?.equals(e);return{part:`${`button day day-${c.getUTCDay()} ${n?m?`selected`:``:`outside`} ${l?`disallowed`:``} ${s?`today`:``} ${t.getDayParts?.(c)??``}`} ${p}`,tabindex:n&&r?0:-1,disabled:d,"aria-disabled":l?`true`:void 0,"aria-pressed":n&&m,"aria-current":s?`date`:void 0,"aria-label":h.format(c),onkeydown:C,onclick(){l||b(e),S(e)},onmouseover(){!l&&!d&&x(e)}}}return{weeks:v,yearMonth:_,daysLong:p,daysVisible:m,formatter:g,getDayProps:w}}function h_(e){return Z(`button`,{part:`button ${e.name} ${e.onclick?``:`disabled`}`,onclick:e.onclick,"aria-disabled":e.onclick?null:`true`,children:Z(`slot`,{name:e.name,children:e.children})})}function g_(e){let t=J(e.page.start),n=J(e.page.end);return Z(Kv,{value:e,onselectday:e.onSelect,onfocusday:e.onFocus,onhoverday:e.onHover,children:jv(`div`,{role:`group`,"aria-labelledby":`h`,part:`container`,children:[Z(`div`,{id:`h`,class:`vh`,"aria-live":`polite`,"aria-atomic":`true`,children:e.formatVerbose.formatRange(t,n)}),jv(`div`,{part:`header`,children:[Z(h_,{name:`previous`,onclick:e.previous,children:`Previous`}),Z(`slot`,{part:`heading`,name:`heading`,children:Z(`div`,{"aria-hidden":`true`,children:e.format.formatRange(t,n)})}),Z(h_,{name:`next`,onclick:e.next,children:`Next`})]}),Z(`slot`,{part:`months`})]})})}function __(e,t){return(t.year-e.year)*12+t.month-e.month}function v_({pageBy:e,focusedDate:t,months:n,max:r,min:i,goto:a}){let o=e===`single`?1:n,[s,c]=sv(()=>$v(t.toPlainYearMonth(),n)),l=e=>c($v(s.start.add({months:e}),n)),u=e=>{let t=__(s.start,e.toPlainYearMonth());return t>=0&&t<n};return iv(()=>{if(u(t))return;let e=__(t.toPlainYearMonth(),s.start);a(t.add({months:e}))},[s.start]),iv(()=>{if(u(t))return;let e=__(s.start,t.toPlainYearMonth());l(e===-1?-o:e===n?o:Math.floor(e/n)*n)},[t,o,n]),{page:s,previous:!i||!u(i)?()=>l(-o):void 0,next:!r||!u(r)?()=>l(o):void 0}}function y_({months:e,pageBy:t,locale:n,focusedDate:r,setFocusedDate:i}){let[a]=l_(`min`),[o]=l_(`max`),[s]=l_(`today`),c=lv(`focusday`),l=lv(`change`),u=X(()=>o_(r??s??t_(),a,o),[r,s,a,o]);function d(e){i(e),c(J(e))}let{next:f,previous:p,page:m}=v_({pageBy:t,focusedDate:u,months:e,min:a,max:o,goto:d}),h=P_();function g(e){let t=e?.target??`day`;t===`day`?h.current.querySelectorAll(`calendar-month`).forEach(t=>t.focus(e)):h.current.shadowRoot.querySelector(`[part~='${t}']`).focus(e)}return{format:f_(Zv,n),formatVerbose:f_(Qv,n),page:m,focusedDate:u,dispatch:l,onFocus(e){e.stopPropagation(),d(e.detail),setTimeout(g)},min:a,max:o,today:s,next:f,previous:p,focus:g}}function b_(e){return jv(Cv,{children:[Z(`label`,{part:`label`,for:`s`,children:Z(`slot`,{name:`label`,children:e.label})}),Z(`select`,{id:`s`,part:`select`,onchange:e.onChange,children:e.options.map(e=>Z(`option`,{part:`option`,...e}))})]})}function x_(e,t){return Array.from({length:e},(e,n)=>t(n))}function S_(e){let{min:t,max:n,focusedDate:r}=Ov(Kv),i=lv(`focusday`,{bubbles:!0}),a=r.toPlainYearMonth(),o=a.year,s=Math.floor(e.maxYears/2),c=o-s,l=o+(e.maxYears-s-1),u=Math.max(c,t?.year??-1/0),d=x_(Math.min(l,n?.year??1/0)-u+1,e=>{let t=u+e;return{label:`${t}`,value:`${t}`,selected:t===a.year}});function f(e){let t=parseInt(e.currentTarget.value)-a.year;i(r.add({years:t}))}return{options:d,onChange:f}}function C_(e){let{min:t,max:n,focusedDate:r,locale:i}=Ov(Kv),a=lv(`focusday`,{bubbles:!0}),o=f_(X(()=>({month:e.formatMonth}),[e.formatMonth]),i),s=X(()=>{let e=[],t=new Date;t.setUTCDate(1);for(var n=0;n<12;n++){let n=(t.getUTCMonth()+12)%12;e[n]=o.format(t),t.setUTCMonth(t.getUTCMonth()+1)}return e},[o]),c=r.toPlainYearMonth(),l=s.map((e,r)=>{let i=r+1,a=c.add({months:i-c.month}),o=t!=null&&Rv.compare(a,t)<0||n!=null&&Rv.compare(a,n)>0;return{label:e,value:`${i}`,disabled:o,selected:i===c.month}});function u(e){let t=parseInt(e.currentTarget.value)-c.month;a(r.add({months:t}))}return{options:l,onChange:u}}var w_,T_,E_,D_,O_,k_,A_,j_,M_,N_,P_,F_,I_,L_,Y,R_,z_,B_,V_,H_,U_,W_,G_,K_,q_,J_,Y_,X_,Z_,Q_,$_,ev,tv,nv,rv,iv,av,ov,sv,X,cv,lv,uv,dv,fv,pv,mv,hv,gv,_v,vv,yv,bv,xv,Sv,Cv,wv,Tv,Ev,Dv,Ov,kv,Av,Z,jv,Mv,Nv,Pv,Fv,Iv,Lv,Q,Rv,zv,Bv,Vv,Hv,Uv,Wv,Gv,Kv,qv,Jv,Yv,Xv,Zv,Qv,$v,ey,ty,ny,ry,iy,ay,oy,sy=n((()=>{w_=class{#e;#t=new Set;constructor(e){this.#e=e}get current(){return this.#e}set current(e){this.#e!=e&&(this.#e=e,this.#t.forEach(t=>t(e)))}on(e){return this.#t.add(e),()=>this.#t.delete(e)}},T_=e=>new w_(e),E_=Symbol.for(`atomico.hooks`),globalThis[E_]=globalThis[E_]||{},D_=globalThis[E_],O_=Symbol.for(`Atomico.suspense`),k_=Symbol.for(`Atomico.effect`),A_=Symbol.for(`Atomico.layoutEffect`),j_=Symbol.for(`Atomico.insertionEffect`),M_=(e,t,n)=>{let{i:r,hooks:i}=D_.c,a=i[r]=i[r]||{};return a.value=e(a.value),a.effect=t,a.tag=n,D_.c.i++,i[r].value},N_=e=>M_((t=T_(e))=>t),P_=()=>M_((e=T_(D_.c.host))=>e),F_=()=>D_.c.update,I_=(e,t,n=0)=>{let r={},i=!1,a=()=>i,o=(e,t)=>{for(let n in r){let i=r[n];i.effect&&i.tag===e&&(i.value=i.effect(i.value,t))}};return{load:a=>{D_.c={host:t,hooks:r,update:e,i:0,id:n};let o;try{i=!1,o=a()}catch(e){if(e!==O_)throw e;i=!0}finally{D_.c=null}return o},cleanEffects:e=>(o(j_,e),()=>(o(A_,e),()=>{o(k_,e)})),isSuspense:a}},L_=Symbol.for,Y=e=>typeof e==`function`,R_=e=>typeof e==`object`,{isArray:z_}=Array,B_=(e,t)=>(t?e instanceof HTMLStyleElement:!0)&&`hydrate`in(e?.dataset||{}),V_=(e,t,n)=>(e.addEventListener(t,n),()=>e.removeEventListener(t,n)),H_=class{constructor(e,t,n){this.message=t,this.target=e,this.value=n}},U_=class extends H_{},W_=class extends H_{},G_=`Custom`,K_=null,q_={true:1,"":1,1:1},J_=(e,{type:t,base:n=CustomEvent,...r})=>e.dispatchEvent(new n(t,r)),Y_=e=>e.replace(/([A-Z])/g,`-$1`).toLowerCase(),X_=(e,t,n,r)=>r==null||t==Boolean&&!r?e.removeAttribute(n):e.setAttribute(n,t?.name===G_&&t?.serialize?t?.serialize(r):R_(r)?JSON.stringify(r):t==Boolean?``:r),Z_=(e,t)=>e==Boolean?!!q_[t]:e==Number?Number(t):e==String?t:e==Array||e==Object?JSON.parse(t):e.name==G_?t:new e(t),Q_=({map:e},t)=>{try{return{value:e(t),error:!1}}catch{return{value:t,error:!0}}},$_=(e,t)=>e==null||t==null?{value:t,error:!1}:e!=String&&t===``?{value:void 0,error:!1}:e==Object||e==Array||e==Symbol?{value:t,error:{}.toString.call(t)!==`[object ${e.name}]`}:t instanceof e?{value:t,error:e==Number&&Number.isNaN(t.valueOf())}:e==String||e==Number||e==Boolean?{value:t,error:e==Number?typeof t==`number`?Number.isNaN(t):!0:e==String?typeof t!=`string`:typeof t!=`boolean`}:{value:t,error:!0},ev=0,tv=e=>(e?.dataset||{})?.hydrate||`c`+ ev++,nv=(e,t=HTMLElement)=>{let n={},r={},i=`prototype`in t&&t.prototype instanceof Element,a=i?t:`base`in t?t.base:HTMLElement,{props:o,styles:s}=i?e:t;class c extends a{constructor(){super(),this._setup(),this._render=()=>e({...this._props});for(let e in r)this[e]=r[e]}static get styles(){return[super.styles,s]}async _setup(){if(this._props)return;this._props={};let e,t;this.mounted=new Promise(n=>this.mount=()=>{n(),e!=this.parentNode&&(t==e?this.update():this.unmounted.then(this.update)),e=this.parentNode}),this.unmounted=new Promise(r=>this.unmount=()=>{r(),(e!=this.parentNode||!this.isConnected)&&(n.cleanEffects(!0)()(),t=this.parentNode,e=null)}),this.symbolId=this.symbolId||Symbol(),this.symbolIdParent=Symbol();let n=I_(()=>this.update(),this,tv(this)),r,i=!0,a=B_(this);this.update=()=>(r||(r=!0,this.updated=(this.updated||this.mounted).then(()=>{try{let e=n.load(this._render),t=n.cleanEffects();return e&&e.render(this,this.symbolId,a),r=!1,i&&!n.isSuspense()&&(i=!1,!a&&Wg(this)),t()}finally{r=!1}}).then(e=>{e&&e()})),this.updated),this.update()}connectedCallback(){this.mount(),super.connectedCallback&&super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback&&super.disconnectedCallback(),this.unmount()}attributeChangedCallback(e,t,r){if(n[e]){if(e===this._ignoreAttr||t===r)return;let{prop:i,type:a}=n[e];try{this[i]=Z_(a,r)}catch{throw new W_(this,`The value defined as attr '${e}' cannot be parsed by type '${a.name}'`,r)}}else super.attributeChangedCallback(e,t,r)}static get props(){return{...super.props,...o}}static get observedAttributes(){let e=super.observedAttributes||[];for(let e in o)Ug(this.prototype,e,o[e],n,r);return Object.keys(n).concat(e)}}return c},rv=e=>(t,n)=>{M_(([e,t]=[])=>((t||!t)&&(t&&Vg(t,n)?e||=!0:(Y(e)&&e(),e=null)),[e,n]),([e,n],r)=>r?(Y(e)&&e(),[]):[e||t(),n],e)},iv=rv(k_),av=rv(j_),ov=class extends Array{constructor(e,t){let n=!0,r=e=>{try{t(e,this,n)}finally{n=!1}};super(void 0,r,t),r(e)}},sv=e=>{let t=F_();return M_((n=new ov(e,(e,n,r)=>{e=Y(e)?e(n[0]):e,e!==n[0]&&(n[0]=e,r||t())}))=>n)},X=(e,t)=>{let[n]=M_(([n,r,i=0]=[])=>((!r||r&&!Vg(r,t))&&(n=e()),[n,t,i]));return n},cv=e=>{let{current:t}=P_();if(!(e in t))throw new U_(t,`For useProp("${e}"), the prop does not exist on the host.`,e);return M_((n=new ov(t[e],(n,r)=>{n=Y(n)?n(t[e]):n,t[e]=n}))=>(n[0]=t[e],n))},lv=(e,t={})=>{let n=P_();return n[e]||(n[e]=(r=t.detail)=>J_(n.current,{type:e,...t,detail:r})),n[e]},uv=L_(`atomico/options`),globalThis[uv]=globalThis[uv]||{sheet:!!document.adoptedStyleSheets},dv=globalThis[uv],fv=new Promise(e=>{dv.ssr||(document.readyState===`loading`?V_(document,`DOMContentLoaded`,e):e())}),pv={checked:1,value:1,selected:1},mv={list:1,type:1,size:1,form:1,width:1,height:1,src:1,href:1,slot:1},hv={shadowDom:1,staticNode:1,cloneNode:1,children:1,key:1},gv={},_v=[],vv=class extends Text{},yv=L_(`atomico/id`),bv=L_(`atomico/type`),xv=L_(`atomico/ref`),Sv=L_(`atomico/vnode`),Cv=()=>{},wv=(e,t,...n)=>{let r=t||gv,{children:i}=r;if(i??=n.length?n:_v,e===Cv)return i;let a=e?e instanceof Node?1:e.prototype instanceof HTMLElement&&2:0;if(a===!1&&e instanceof Function)return e(i==_v?r:{children:i,...r});let o=dv.render||Gg;return{[bv]:Sv,type:e,props:r,children:i,key:r.key,shadow:r.shadowDom,static:r.staticNode,raw:a,is:r.is,clone:r.cloneNode,render:o}},Tv=wv(`host`,{style:`display: contents`}),Ev=`value`,Dv=(e,t)=>{let n=P_(),r=N_();av(()=>V_(n.current,`ConnectContext`,t=>{t.composedPath().at(0)!==t.currentTarget&&e===t.detail.id&&(t.stopPropagation(),t.detail.connect(r))}),[e]),r.current=t},Ov=e=>{let t=lv(`ConnectContext`,{bubbles:!0,composed:!0}),[n,r]=sv(()=>{if(dv.ssr)return;let n;return t({id:e,connect(e){n=e}}),n}),i=F_();return iv(()=>{fv.then(()=>t({id:e,connect:r}))},[e]),iv(()=>{if(n)return n.on(i)},[n]),n?.current||e[Ev]},kv=e=>{let t=nv(({value:e})=>(Dv(t,e),Tv),{props:{value:{type:Object,value:()=>e}}});return t[Ev]=e,t},kv({dispatch(e,t){}}),Av={},Z=(e,t,n)=>(t==null?t={key:n}:t.key=n,wv(e,t)),jv=Z,Mv=$g`*,*:before,*:after{box-sizing:border-box}button{padding:0;touch-action:manipulation;cursor:pointer;user-select:none}`,Nv=$g`.vh{position:absolute;transform:scale(0)}`,Pv=864e5,Fv={days:1},Iv=/^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[0-1])$/,Lv=(e,t)=>e.toString().padStart(t,`0`),Q=class e{constructor(e,t,n){this.year=e,this.month=t,this.day=n}add(t){let n=J(this);if(`days`in t)return n.setUTCDate(this.day+t.days),e.from(n);let{year:r,month:i}=this;`months`in t?(i=this.month+t.months,n.setUTCMonth(i-1)):(r=this.year+t.years,n.setUTCFullYear(r));let a=e.from(J({year:r,month:i,day:1}));return o_(e.from(n),a,a_(a))}toString(){return`${Lv(this.year,4)}-${Lv(this.month,2)}-${Lv(this.day,2)}`}toPlainYearMonth(){return new Rv(this.year,this.month)}equals(t){return e.compare(this,t)===0}static compare(e,t){return e.year<t.year?-1:e.year>t.year?1:e.month<t.month?-1:e.month>t.month?1:e.day<t.day?-1:+(e.day>t.day)}static from(t){if(typeof t==`string`){let n=t.match(Iv);if(!n)throw TypeError(t);let[,r,i,a]=n;return new e(parseInt(r,10),parseInt(i,10),parseInt(a,10))}return new e(t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate())}},Rv=class e{constructor(e,t){this.year=e,this.month=t}add(t){let n=J(this),r=(t.months??0)+(t.years??0)*12;return n.setUTCMonth(n.getUTCMonth()+r),new e(n.getUTCFullYear(),n.getUTCMonth()+1)}equals(e){return this.year===e.year&&this.month===e.month}toPlainDate(){return new Q(this.year,this.month,1)}static compare(e,t){return e.year<t.year?-1:e.year>t.year?1:e.month<t.month?-1:+(e.month>t.month)}},zv=(e,t,n)=>o_(e,t,n)===e,Bv=e=>e.target.matches(`:dir(ltr)`),Vv={month:`long`,day:`numeric`},Hv={month:`long`},Uv={weekday:`long`},Wv={bubbles:!0},Gv=t_(),Kv=kv({type:`date`,firstDayOfWeek:1,focusedDate:Gv,page:{start:Gv.toPlainYearMonth(),end:Gv.toPlainYearMonth()}}),customElements.define(`calendar-ctx`,Kv),qv=(e,t)=>(t+e)%7,Jv=nv(e=>{let t=Ov(Kv),n=N_(),r=m_({props:e,context:t});function i(){n.current.querySelector(`button[tabindex='0']`)?.focus()}return jv(`host`,{shadowDom:!0,focus:i,children:[Z(`div`,{id:`h`,part:`heading`,children:r.formatter.format(J(r.yearMonth))}),jv(`table`,{ref:n,"aria-labelledby":`h`,part:`table`,children:[jv(`colgroup`,{children:[t.showWeekNumbers&&Z(`col`,{part:`col-weeknumber`}),Z(`col`,{part:`col-1`}),Z(`col`,{part:`col-2`}),Z(`col`,{part:`col-3`}),Z(`col`,{part:`col-4`}),Z(`col`,{part:`col-5`}),Z(`col`,{part:`col-6`}),Z(`col`,{part:`col-7`})]}),Z(`thead`,{children:jv(`tr`,{part:`tr head`,children:[t.showWeekNumbers&&Z(`th`,{part:`th weeknumber`,children:jv(`slot`,{name:`weeknumber`,children:[Z(`span`,{class:`vh`,children:`Week`}),Z(`span`,{"aria-hidden":`true`,children:`#`})]})}),r.daysLong.map((e,n)=>jv(`th`,{part:`th day day-${qv(t.firstDayOfWeek,n)}`,scope:`col`,children:[Z(`span`,{class:`vh`,children:e}),Z(`span`,{"aria-hidden":`true`,children:r.daysVisible[n]})]}))]})}),Z(`tbody`,{children:r.weeks.map((e,n)=>jv(`tr`,{part:`tr week`,children:[t.showWeekNumbers&&Z(`th`,{class:`num`,part:`th weeknumber`,scope:`row`,children:n_(e[0])}),e.map((e,t)=>{let n=r.getDayProps(e);return Z(`td`,{part:`td`,children:n&&Z(`button`,{class:`num`,...n,children:e.day})},t)})]},n))})]})]})},{props:{offset:{type:Number,value:0}},styles:[Mv,Nv,$g`:host{--color-accent: black;--color-text-on-accent: white;display:flex;flex-direction:column;gap:.25rem;text-align:center;inline-size:fit-content}table{border-collapse:collapse;font-size:.875rem}th{inline-size:2.25rem;block-size:2.25rem}td{padding-inline:0}.num{font-variant-numeric:tabular-nums}button{color:inherit;font-size:inherit;background:transparent;border:0;block-size:2.25rem;inline-size:2.25rem}button:hover:where(:not(:disabled,[aria-disabled])){background:#0000000d}button:is([aria-pressed=true],:focus-visible){background:var(--color-accent);color:var(--color-text-on-accent)}button:focus-visible{outline:1px solid var(--color-text-on-accent);outline-offset:-2px}button:disabled,:host::part(outside),:host::part(disallowed){cursor:default;opacity:.5}`]}),customElements.define(`calendar-month`,Jv),Yv={value:{type:String,value:``},min:{type:String,value:``},max:{type:String,value:``},today:{type:String,value:``},isDateDisallowed:{type:Function,value:e=>!1},formatWeekday:{type:String,value:()=>`narrow`},getDayParts:{type:Function,value:e=>``},firstDayOfWeek:{type:Number,value:()=>1},showOutsideDays:{type:Boolean,value:!1},locale:{type:String,value:()=>{}},months:{type:Number,value:1},focusedDate:{type:String,value:()=>{}},pageBy:{type:String,value:()=>`months`},showWeekNumbers:{type:Boolean,value:!1}},Xv=[Mv,Nv,$g`:host{display:block;inline-size:fit-content}:host::part(container){display:flex;flex-direction:column;gap:1em}:host::part(header){display:flex;align-items:center;justify-content:space-between}:host::part(heading){font-weight:700;font-size:1.25em}:host::part(button){display:flex;align-items:center;justify-content:center}:host::part(button disabled){cursor:default;opacity:.5}`],Zv={year:`numeric`},Qv={year:`numeric`,month:`long`},$v=(e,t)=>(e=t===12?new Rv(e.year,1):e,{start:e,end:e.add({months:t-1})}),ey=nv(e=>{let[t,n]=l_(`value`),[r=t,i]=l_(`focusedDate`),a=y_({...e,focusedDate:r,setFocusedDate:i});function o(e){n(e.detail),a.dispatch()}return Z(`host`,{shadowDom:!0,focus:a.focus,children:Z(g_,{...e,...a,type:`date`,value:t,onSelect:o})})},{props:Yv,styles:Xv}),customElements.define(`calendar-date`,ey),ty=[Mv,Nv],ny=nv(e=>Z(`host`,{shadowDom:!0,children:Z(b_,{label:`Year`,...S_(e)})}),{props:{maxYears:{type:Number,value:20}},styles:ty}),customElements.define(`calendar-select-year`,ny),ry=nv(e=>Z(`host`,{shadowDom:!0,children:Z(b_,{label:`Month`,...C_(e)})}),{props:{formatMonth:{type:String,value:()=>`long`}},styles:ty}),customElements.define(`calendar-select-month`,ry),iy=(e,t)=>Q.compare(e,t)<0?[e,t]:[t,e],ay=nv(e=>{let[t,n]=u_(`value`),[r=t[0],i]=l_(`focusedDate`),a=y_({...e,focusedDate:r,setFocusedDate:i}),o=lv(`rangestart`),s=lv(`rangeend`),[c,l]=l_(`tentative`),[u,d]=sv();iv(()=>d(void 0),[c]);function f(e){a.onFocus(e),p(e)}function p(e){e.stopPropagation(),c&&d(e.detail)}function m(e){let t=e.detail;e.stopPropagation(),c?(n(iy(c,t)),l(void 0),s(J(t)),a.dispatch()):(l(t),o(J(t)))}let h=c?iy(c,u??c):t;return Z(`host`,{shadowDom:!0,focus:a.focus,children:Z(g_,{...e,...a,type:`range`,value:h,onFocus:f,onHover:p,onSelect:m})})},{props:{...Yv,tentative:{type:String,value:``}},styles:Xv}),customElements.define(`calendar-range`,ay),oy=nv(e=>{let[t,n]=d_(`value`),[r=t[0],i]=l_(`focusedDate`),a=y_({...e,focusedDate:r,setFocusedDate:i});function o(e){let r=[...t],i=t.findIndex(t=>t.equals(e.detail));i<0?r.push(e.detail):r.splice(i,1),n(r),a.dispatch()}return Z(`host`,{shadowDom:!0,focus:a.focus,children:Z(g_,{...e,...a,type:`multi`,value:t,onSelect:o})})},{props:Yv,styles:Xv}),customElements.define(`calendar-multi`,oy)})),cy=/^\d{4}-\d{2}-\d{2}$/,ly=/^\d{4}-\d{2}-\d{2}\/\d{4}-\d{2}-\d{2}$/,uy=100,dy=10,fy=null,py=()=>typeof customElements>`u`||customElements.get(`calendar-ctx`)?Promise.resolve():(fy??=Promise.resolve().then(()=>(sy(),Bg)).then(()=>void 0).catch(e=>{if(!customElements.get(`calendar-ctx`))throw e}),fy),my=e=>{let[t=``,n=``]=e.split(`/`);return[t,n]},hy=(e,t)=>e===``||(t?ly.test(e):cy.test(e)),gy=()=>new Date().getFullYear(),_y=()=>`${gy()-uy}-01-01`,vy=()=>`${gy()+dy}-12-31`,yy=()=>new Date().toISOString().slice(0,10),by=(e,t)=>{if(!e.match(cy))return``;let n=new Date(`${e}T00:00:00.000Z`);return new Intl.DateTimeFormat(t||void 0,{month:`long`,timeZone:`UTC`,year:`numeric`}).format(n)},xy=e=>({value:e.dataset.value??``,label:e.dataset.label??e.textContent?.trim()??``,start:e.dataset.start??``,end:e.dataset.end??``,disabled:q.asBool({value:e.dataset.disabled})}),Sy=()=>({isOpen:!1,value:``,pendingValue:``,presetValue:``,triggerId:``,popoverId:``,liveMessage:``,props:null,popover:null,popoverMotion:null,listeners:[],hiddenInputsKey:``,presetInputKey:``,init(){this.props=B({el:this.$el,schema:Rg}),this.value=this.props.value,this.pendingValue=this.value,this.presetValue=this.props.preset,this.triggerId=this.$id(`date-picker-trigger`),this.popoverId=this.$id(`date-picker-popover`),this.popover=q.createAnchoredPopover({reference:()=>this.trigger(),floating:()=>this.popoverEl(),position:()=>this.props.side,align:()=>this.props.align,gap:()=>this.props.gap,offset:()=>this.props.offset,matchReferenceWidth:!1}),this.popoverMotion=q.motion.createPresenceLifecycle({element:()=>this.popoverEl(),preset:`popover`}),this.setup(),this.sync(),py().then(()=>this.sync())},destroy(){this.props.disconnect(),this.popoverMotion?.destroy(),this.listeners.forEach(e=>e()),this.listeners=[],this.popover?.unmount()},get root(){return q.props({inputs:[K({part:zg.parts.root,props:this.props,className:this.props.class}),{"data-ui-date-picker":``,":data-state":()=>this.isOpen?`open`:`closed`,":data-color":()=>this.props.color,":data-disabled":()=>this.props.disabled?`true`:void 0,":data-invalid":()=>this.props.invalid?`true`:void 0}]})},trigger(){let e=this.$el.querySelector(`[data-ui-date-picker-trigger]`);if(!e)throw Error(`Date picker requires a trigger.`);return e},input(){let e=this.$el.querySelector(`[data-ui-date-picker-input]`);if(!e)throw Error(`Date picker requires an input.`);return e},toggleButton(){return this.$el.querySelector(`[data-ui-date-picker-toggle]`)},popoverEl(){let e=this.$el.querySelector(`[data-ui-date-picker-popover]`);if(!e)throw Error(`Date picker requires a popover.`);return e},calendar(){return this.$el.querySelector(`[data-ui-date-picker-calendar]`)},hiddenInputsEl(){return this.$el.querySelector(`[data-ui-date-picker-hidden-inputs]`)},presetInputsEl(){return this.$el.querySelector(`[data-ui-date-picker-preset-inputs]`)},presetItems(){let e=Array.from(this.$el.querySelectorAll(`[data-ui-date-picker-preset]`)).map(xy).filter(e=>e.value&&e.start&&e.end);return e.length?e:this.props.presets},isRange(){return this.props.mode===`range`},closeMode(){return this.props.close===`confirm`?`confirm`:`select`},displayValue(){if(!this.value)return``;if(!this.isRange())return this.value;let[e,t]=my(this.value);return e&&t?`${e} to ${t}`:this.value},effectivePlaceholder(){return this.props.placeholder?this.props.placeholder:this.isRange()?`YYYY-MM-DD to YYYY-MM-DD`:`YYYY-MM-DD`},effectiveMonths(){return this.props.months>0?this.props.months:this.isRange()?2:1},open(e){if(e?.preventDefault(),this.props.disabled||this.props.readonly)return;let t=this.isOpen;this.isOpen=!0,this.pendingValue=this.value,this.sync(),t||this.popoverMotion?.enter({before:()=>{let e=this.popoverEl();e.hidden=!1,e.showPopover?.(),this.popover?.mount()}}),e instanceof KeyboardEvent&&py().then(()=>{queueMicrotask(()=>this.calendar()?.focus({preventScroll:!0}))}),q.dispatch({el:this.$el,name:`ui:open`})},close(e){e?.preventDefault();let t=this.isOpen;this.isOpen=!1,this.pendingValue=this.value,this.sync(),this.trigger().focus({preventScroll:!0}),t&&this.popoverMotion?.exit({before:()=>{let e=this.popoverEl();e.dataset.state=`closed`,e.hidden=!1},after:()=>{if(this.isOpen)return;let e=this.popoverEl();e.hidePopover?.(),e.hidden=!0,this.popover?.unmount(),q.dispatch({el:this.$el,name:`ui:close`})}})},toggle(e){this.isOpen?this.close(e):this.open(e)},clear(e){e?.preventDefault(),!(this.props.disabled||this.props.readonly)&&(this.value=``,this.pendingValue=``,this.presetValue=``,this.liveMessage=`Date cleared`,this.sync(),q.dispatchNativeControlChange({container:this.hiddenInputsEl(),fallback:this.input(),marker:`data-ui-date-picker-hidden-input`}),q.dispatch({el:this.$el,name:`ui:clear`}))},cancel(e){e?.preventDefault(),this.close()},apply(e){e?.preventDefault(),this.commitValue(this.pendingValue),this.close()},commitValue(e){this.value=e,this.pendingValue=e,this.sync(),q.dispatchNativeControlChange({container:this.hiddenInputsEl(),fallback:this.input(),marker:`data-ui-date-picker-hidden-input`}),q.dispatch({el:this.$el,name:`ui:change`})},selectToday(e){e?.preventDefault();let t=this.props.today||new Date().toISOString().slice(0,10),n=this.isRange()?`${t}/${t}`:t;this.commitValue(n),this.close()},selectPreset(e,t){t?.preventDefault();let n=xy(e);if(n.disabled)return;let r=this.isRange()?`${n.start}/${n.end}`:n.start;this.presetValue=n.value,this.commitValue(r),this.close()},handleInput(e){let t=e.target;if(!(t instanceof HTMLInputElement))return;let n=t.value.trim(),r=this.isRange()?n.replace(/\s+to\s+/i,`/`):n;hy(r,this.isRange())&&r!==this.value&&this.commitValue(r)},handleKeydown(e){if((e.key===`ArrowDown`||e.key===`Enter`||e.key===` `)&&!this.isOpen){this.open(e);return}e.key===`Escape`&&this.isOpen&&this.close(e)},handleCalendarChange(e){let t=e.currentTarget;this.pendingValue=t.value,this.isRange()&&(this.liveMessage=this.pendingValue.includes(`/`)?`Range selected`:`Start date selected`),this.closeMode()===`select`&&(!this.isRange()||ly.test(this.pendingValue))?(this.commitValue(this.pendingValue),this.close()):this.sync()},handleCalendarFocus(e){let t=e.detail;t instanceof Date&&this.syncCalendarHeading(t.toISOString().slice(0,10))},sync(){this.syncControl(),this.syncCalendar(),this.syncCalendarHeading(),this.syncTodayButton(),this.syncHiddenInputs(),this.syncPresetInput(),this.syncPresets(),this.syncPosition()},syncControl(){let e=this.trigger(),t=this.input(),n=this.popoverEl(),r=this.$el.querySelector(`[data-ui-date-picker-live]`);e.id=this.triggerId,n.id=this.popoverId,n.dataset.state=this.isOpen?`open`:`closed`,n.hidden=!this.isOpen,e.setAttribute(`data-state`,this.isOpen?`open`:`closed`),q.syncControlPresence({el:e,state:this.props,value:`true`});let i=this.toggleButton();i?(i.setAttribute(`aria-expanded`,this.isOpen?`true`:`false`),i.setAttribute(`aria-controls`,this.popoverId)):(e.setAttribute(`aria-haspopup`,`dialog`),e.setAttribute(`aria-expanded`,this.isOpen?`true`:`false`),e.setAttribute(`aria-controls`,this.popoverId)),e instanceof HTMLButtonElement&&(e.disabled=this.props.disabled),q.syncNativeControl({input:t,state:{name:this.isRange()?``:this.props.name,value:this.displayValue(),disabled:this.props.disabled,readonly:this.props.readonly,required:this.props.required,invalid:this.props.invalid}}),t.placeholder=this.effectivePlaceholder(),r&&(r.textContent=this.liveMessage)},syncCalendar(){let e=this.calendar();if(!e)return;e.setAttribute(`value`,this.pendingValue),this.isRange()&&!this.pendingValue&&e.setAttribute(`tentative`,``),e.setAttribute(`months`,String(this.effectiveMonths())),e.style.setProperty(`--ui-date-picker-month-columns`,String(this.effectiveMonths())),e.setAttribute(`format-weekday`,`short`),e.setAttribute(`min`,this.props.min||_y()),e.setAttribute(`max`,this.props.max||vy()),this.props.today&&e.setAttribute(`today`,this.props.today);let t=this.props.forceOpenTo?this.props.openTo:this.value||this.props.openTo||this.props.today||yy();e.setAttribute(`focused-date`,my(t)[0]),this.props.locale&&e.setAttribute(`locale`,this.props.locale),this.props.firstDayOfWeek>=0&&e.setAttribute(`first-day-of-week`,String(this.props.firstDayOfWeek));let n=!this.props.selectableHeader&&this.effectiveMonths()===1;q.setPresence({el:e,attr:`data-inline-heading`,present:n,value:`true`}),q.setPresence({el:e,attr:`data-hide-month-heading`,present:this.props.selectableHeader&&!this.isRange()||n,value:`true`}),q.setPresence({el:e,attr:`data-fixed-weeks`,present:this.props.fixedWeeks,value:`true`}),q.setPresence({el:e,attr:`show-outside-days`,present:this.props.showOutsideDays||this.props.fixedWeeks}),q.setPresence({el:e,attr:`show-week-numbers`,present:this.props.showWeekNumbers})},syncCalendarHeading(e){let t=this.$el.querySelector(`[data-ui-date-picker-calendar-heading]`);t&&(t.textContent=by(e||my(this.value||this.props.openTo||this.props.today||yy())[0],this.props.locale))},syncTodayButton(){let e=this.$el.querySelector(`[data-ui-date-picker-calendar-today]`),t=this.$el.querySelector(`[data-ui-date-picker-today-day]`);if(!e||!t)return;let n=this.props.today||yy(),r=n.match(cy)?String(Number(n.slice(-2))):``;t.textContent=r,e.setAttribute(`aria-label`,r?`Go to today, ${n}`:`Go to today`)},syncHiddenInputs(){let e=this.hiddenInputsEl();if(!e)return;if(!this.isRange()){this.hiddenInputsKey=q.syncRepeatedHiddenInputs({container:e,currentKey:this.hiddenInputsKey,state:{name:``,values:[],form:this.props.form,marker:`data-ui-date-picker-hidden-input`}});return}let[t,n]=my(this.value);if(this.props.startName||this.props.endName){let r=JSON.stringify({startName:this.props.startName,endName:this.props.endName,start:t,end:n,form:this.props.form});if(r===this.hiddenInputsKey)return;e.replaceChildren(),[[this.props.startName,t],[this.props.endName,n]].forEach(([t,n])=>{if(!t)return;let r=document.createElement(`input`);r.type=`hidden`,r.name=t,r.value=n,r.setAttribute(`data-ui-date-picker-hidden-input`,``),this.props.form&&r.setAttribute(`form`,this.props.form),e.append(r)}),this.hiddenInputsKey=r;return}this.hiddenInputsKey=q.syncRepeatedHiddenInputs({container:e,currentKey:this.hiddenInputsKey,state:{name:this.props.name,values:this.value?[this.value]:[],required:this.props.required,form:this.props.form,marker:`data-ui-date-picker-hidden-input`}})},syncPresetInput(){let e=this.presetInputsEl();if(!e)return;let t=this.presetItems().find(e=>(this.isRange()?`${e.start}/${e.end}`:e.start)===this.value),n=this.presetItems().find(e=>e.value===`custom`),r=t?.value??(this.value&&n?`custom`:``);this.presetValue=r,this.presetInputKey=q.syncRepeatedHiddenInputs({container:e,currentKey:this.presetInputKey,state:{name:this.props.presetName,values:r?[r]:[],form:this.props.form,marker:`data-ui-date-picker-preset-input`}})},syncPresets(){let e=this.pendingValue||this.value;Array.from(this.$el.querySelectorAll(`[data-ui-date-picker-preset]`)).forEach(t=>{let n=xy(t),r=this.isRange()?`${n.start}/${n.end}`:n.start;q.setPresence({el:t,attr:`data-selected`,present:r===e,value:`true`}),q.setPresence({el:t,attr:`data-disabled`,present:n.disabled??!1,value:`true`})})},syncPosition(){this.isOpen&&this.popover?.sync()},setup(){let e=this.trigger(),t=this.input(),n=this.popoverEl();q.addListener({target:e,event:`click`,handler:e=>{let t=e.target;if(t instanceof Element&&t.closest(`[data-ui-date-picker-clear]`)){this.clear(e);return}this.toggle(e)},cleanup:this.listeners}),q.addListener({target:e,event:`keydown`,handler:e=>this.handleKeydown(e),cleanup:this.listeners}),q.addListener({target:t,event:`input`,handler:e=>this.handleInput(e),cleanup:this.listeners}),q.addListener({target:n,event:`pointerdown`,handler:e=>e.stopPropagation(),cleanup:this.listeners}),q.addListener({target:n,event:`click`,handler:e=>{let t=e.target;if(!(t instanceof Element))return;let n=t.closest(`[data-ui-date-picker-preset]`);n&&this.selectPreset(n,e),t.closest(`[data-ui-date-picker-clear]`)&&this.clear(e),t.closest(`[data-ui-date-picker-cancel]`)&&this.cancel(e),t.closest(`[data-ui-date-picker-apply]`)&&this.apply(e),t.closest(`[data-ui-date-picker-today]`)&&this.selectToday(e)},cleanup:this.listeners});let r=this.calendar();r&&(q.addListener({target:r,event:`change`,handler:e=>this.handleCalendarChange(e),cleanup:this.listeners}),q.addListener({target:r,event:`focusday`,handler:e=>this.handleCalendarFocus(e),cleanup:this.listeners}),q.addListener({target:r,event:`rangestart`,handler:()=>{this.liveMessage=`Start date selected`},cleanup:this.listeners}),q.addListener({target:r,event:`rangeend`,handler:()=>{this.liveMessage=`Range selected`},cleanup:this.listeners})),this.listeners.push(q.addDismissableLayer({isEnabled:()=>this.isOpen,roots:()=>[this.$el,n],onDismiss:()=>this.close()}))}}),Cy=e=>{e.data(`UiDatePicker`,()=>Sy())},wy=G({definition:{component:`ui.menu`,parts:{menu:{base:[Mh,`auto-rows-min content-start min-w-48 gap-1 overflow-hidden p-popover`]},item:{base:[Ph],variants:{variant:{default:``,subtle:`bg-base-a2`,filled:`bg-base-a3`,ghost:`bg-transparent`},color:{neutral:``,accent:``,success:``,warning:``,danger:`text-menu-item-danger-fg ui-interactive:hover:bg-menu-item-danger-hover ui-interactive:ui-active:bg-menu-item-danger-hover`}},defaults:{variant:`default`,color:`neutral`}},itemLabel:{base:`min-w-0 flex-1`},itemMeta:{base:`ml-auto text-menu-item-muted`},itemIcon:{base:Fh,variants:{position:{leading:``,trailing:`ml-auto`}},defaults:{position:`leading`}},group:{base:`grid auto-rows-min content-start gap-1`},label:{base:`px-menu-item-x py-1 text-menu-heading-fg`},separatorRoot:{variants:{orientation:{vertical:`self-stretch self-center`,horizontal:`-mx-popover my-popover h-px`}},defaults:{orientation:`horizontal`}},separatorRule:{variants:{orientation:{vertical:`h-full w-px border-0 bg-menu-separator`,horizontal:`h-px w-full border-0 bg-menu-separator`}},defaults:{orientation:`horizontal`}}}}}),Ty=yh,Ey=vh,Dy={side:W(Ty,`bottom`),align:W(Ey,`start`),offset:H.clamp(-100,100).default(0),gap:H.clamp(0,50).default(4),open:U,disabled:U,class:V},Oy=G({definition:{component:`ui.dropdown`,parts:{root:{base:`contents`}}}}),ky=()=>({isOpen:!1,menuMotion:null,triggerId:``,menuId:``,props:null,collection:null,popover:null,triggerCleanup:[],menuCleanup:[],init(){this.props=B({el:this.$el,schema:Dy}),this.triggerId=this.$id(`dropdown-trigger`),this.menuId=this.$id(`dropdown-menu`),this.collection=q.createCollectionNavigation({root:()=>this.menuEl(),itemSelector:`[data-ui-menu-item]`,isDisabled:e=>q.asBool({value:e.dataset.disabled})||e.hasAttribute(`disabled`),loop:()=>q.asBool({value:this.menuEl().dataset.loop})}),this.popover=q.createAnchoredPopover({reference:()=>this.triggerEl(),floating:()=>this.menuEl(),position:()=>this.props.side,align:()=>this.props.align,gap:()=>this.props.gap,offset:()=>this.props.offset}),this.setupTrigger(),this.setupMenu(),this.menuMotion=q.motion.createPresenceLifecycle({element:()=>this.menuEl(),preset:`menu`}),this.$watch(`isOpen`,e=>{let t=this.menuEl();if(this.syncTriggerAttributes(),e){this.menuMotion?.enter({before:()=>{this.syncMenuAttributes(),t.showPopover(),this.mount()}}),queueMicrotask(()=>t.focus({preventScroll:!0})),q.dispatch({el:this.$el,name:`ui:open`});return}this.menuMotion?.exit({before:()=>{t.dataset.state=`closed`,t.hidden=!1},after:()=>this.finishClose()}),this.menuMotion||(t.dataset.state=`closed`,t.hidden=!1,this.finishClose())}),this.props.open&&queueMicrotask(()=>this.open())},destroy(){this.props.disconnect(),this.menuMotion?.destroy(),this.teardownTrigger(),this.teardownMenu(),this.unmount()},get root(){return q.props({inputs:[K({part:Oy.parts.root,props:this.props,className:this.props.class}),{"data-ui-dropdown":``,":data-state":()=>this.isOpen?`open`:`closed`,"@keydown.escape.stop":e=>this.close(e)}]})},menu(e){return q.props({inputs:[K({part:wy.parts.menu,props:{},className:e.dataset.class}),{id:this.menuId,popover:`manual`,role:`menu`,tabindex:`-1`,hidden:()=>!this.isOpen,"data-ui-menu":``,":data-state":()=>this.isOpen?`open`:`closed`}]})},menuItem(e){let t=e.dataset.variant||`default`,n=e.dataset.color||`neutral`,r=q.asBool({value:e.dataset.disabled}),i=e instanceof HTMLButtonElement?e.getAttribute(`type`)||e.dataset.type||`button`:void 0;return q.props({inputs:[K({part:wy.parts.item,props:{variant:t,color:n},className:e.dataset.class}),{role:`menuitem`,tabindex:r?`-1`:`0`,type:i,disabled:e.tagName===`BUTTON`&&r,"data-ui-menu-item":``,"data-variant":t,"data-color":n,"data-disabled":r?`true`:void 0,"aria-disabled":r?`true`:void 0}]})},open(e){e?.preventDefault(),!this.props.disabled&&(this.isOpen=!0)},close(e){e?.preventDefault(),this.isOpen=!1,this.clearActiveItem(),e?.type===`keydown`&&this.triggerEl().focus()},toggle(e){e?.preventDefault(),!this.props.disabled&&(this.isOpen=!this.isOpen)},triggerEl(){let e=Array.from(this.$el.children).find(e=>e instanceof HTMLElement&&!e.matches(`[data-ui-menu]`));if(!(e instanceof HTMLElement))throw Error(`Dropdown requires a trigger element before the menu.`);return e},menuEl(){let e=this.$el.querySelector(`[data-ui-menu]`);if(!(e instanceof HTMLElement))throw Error(`Dropdown requires a menu element.`);return e},allItemEls(){return this.collectionNav().allItems()},itemEls(){return this.collectionNav().items()},focusNext(){this.collectionNav().focusNext()},focusPrevious(){this.collectionNav().focusPrevious()},focusFirst(){this.collectionNav().focusFirst()},focusLast(){this.collectionNav().focusLast()},focusItem(e){this.collectionNav().focusItem({el:e})},activateItem(e){this.collectionNav().activateItem({el:e})},clearActiveItem(){this.collectionNav().clearActiveItem()},collectionNav(){return this.collection||=q.createCollectionNavigation({root:()=>this.menuEl(),itemSelector:`[data-ui-menu-item]`,isDisabled:e=>q.asBool({value:e.dataset.disabled})||e.hasAttribute(`disabled`),loop:()=>q.asBool({value:this.menuEl().dataset.loop})}),this.collection},mount(){this.popover?.mount()},unmount(){this.popover?.unmount()},syncFromPopover(e){this.isOpen=e.newState===`open`},syncPosition(){this.popover?.sync()},syncMenuAttributes(){let e=this.menuEl();e.hidden=!this.isOpen,e.dataset.state=this.isOpen?`open`:`closed`},syncTriggerAttributes(){let e=this.triggerEl();if(e.id||=this.triggerId,e.setAttribute(`data-ui-dropdown-trigger`,``),e.setAttribute(`aria-expanded`,this.isOpen?`true`:`false`),e.setAttribute(`aria-controls`,this.menuId),e.setAttribute(`data-state`,this.isOpen?`open`:`closed`),this.props.disabled){e.setAttribute(`aria-disabled`,`true`),e.setAttribute(`tabindex`,`-1`),e instanceof HTMLButtonElement&&(e.disabled=!0);return}e.removeAttribute(`aria-disabled`),e.hasAttribute(`tabindex`)||e.setAttribute(`tabindex`,`0`)},finishClose(){this.isOpen||(this.menuEl().hidePopover(),this.unmount(),this.syncMenuAttributes(),q.dispatch({el:this.$el,name:`ui:close`}))},setupTrigger(){let e=this.triggerEl();this.syncTriggerAttributes(),q.addListener({target:e,event:`click`,handler:e=>this.toggle(e),cleanup:this.triggerCleanup}),q.addListener({target:e,event:`keydown`,handler:e=>{if(e instanceof KeyboardEvent){if(e.key===`Enter`||e.key===` `){this.toggle(e);return}e.key===`ArrowDown`&&(e.preventDefault(),this.open(e),queueMicrotask(()=>this.focusFirst()))}},cleanup:this.triggerCleanup})},setupMenu(){let e=this.menuEl(),t=this.menu(e).class;typeof t==`string`&&e.setAttribute(`class`,t),e.id=this.menuId,e.setAttribute(`popover`,`manual`),e.setAttribute(`role`,`menu`),e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-ui-menu`,``),e.setAttribute(`data-ui-motion-owner`,`component`),this.syncMenuAttributes(),q.addListener({target:e,event:`toggle`,handler:e=>this.syncFromPopover(e),cleanup:this.menuCleanup}),this.menuCleanup.push(q.addDismissableLayer({isEnabled:()=>this.isOpen,roots:()=>[this.$el,e],onDismiss:e=>this.close(e)})),q.addListener({target:e,event:`keydown`,handler:e=>{e instanceof KeyboardEvent&&this.collectionNav().handleKeydown({event:e})},cleanup:this.menuCleanup}),this.allItemEls().forEach(e=>{let t=this.menuItem(e),n=t.class,r=t.disabled===!0;typeof n==`string`&&e.setAttribute(`class`,n),e.setAttribute(`role`,`menuitem`),e.setAttribute(`tabindex`,r?`-1`:`0`),e.setAttribute(`data-ui-menu-item`,``),e instanceof HTMLButtonElement&&!e.hasAttribute(`type`)&&e.setAttribute(`type`,e.dataset.type||`button`),r&&(e.setAttribute(`aria-disabled`,`true`),e instanceof HTMLButtonElement&&(e.disabled=!0)),q.addListener({target:e,event:`click`,handler:t=>this.selectItem(e,t),cleanup:this.menuCleanup}),q.addListener({target:e,event:`focus`,handler:()=>this.activateItem(e),cleanup:this.menuCleanup}),q.addListener({target:e,event:`pointerenter`,handler:()=>{q.asBool({value:e.dataset.disabled})||this.activateItem(e)},cleanup:this.menuCleanup})})},teardownTrigger(){this.triggerCleanup.forEach(e=>e()),this.triggerCleanup=[]},teardownMenu(){this.menuCleanup.forEach(e=>e()),this.menuCleanup=[]},selectItem(e,t){if(q.asBool({value:e.dataset.disabled})){t.preventDefault();return}let n=q.asBool({value:this.menuEl().dataset.keepOpen});(e.dataset.keepOpen===void 0||e.dataset.keepOpen===``?n:q.asBool({value:e.dataset.keepOpen}))||this.close(t)}}),Ay=e=>{e.data(`UiDropdown`,()=>ky())},jy=`input:not([type="hidden"]), textarea, select, button, [data-ui-control-target]`,My=(e,t)=>{let n=new Set((e??``).split(/\s+/).filter(Boolean));return n.add(t),Array.from(n).join(` `)},Ny=(e,t)=>(e.id||=`ui-${t}-${crypto.randomUUID()}`,e.id),Py=()=>({observer:null,listeners:[],init(){this.sync(),this.observer=new MutationObserver(()=>this.sync()),this.observer.observe(this.$el,{childList:!0,subtree:!0})},destroy(){this.observer?.disconnect(),this.listeners.forEach(e=>e()),this.listeners=[]},sync(){let e=this.$el,t=Array.from(e.querySelectorAll(jy)).filter(t=>!t.closest(`[data-ui-field], [data-ui-fieldset]`)||t.closest(`[data-ui-field], [data-ui-fieldset]`)===e)[0],n=e.querySelector(`:scope > [data-ui-field-label]`),r=e.querySelector(`:scope > [data-ui-fieldset-legend]`),i=Array.from(e.querySelectorAll(`:scope > [data-ui-field-description]`)),a=Array.from(e.querySelectorAll(`:scope > [data-ui-field-error]`)),o=[...i,...a].filter(e=>!e.hasAttribute(`hidden`)).map(e=>Ny(e,e.hasAttribute(`data-ui-field-error`)?`field-error`:`field-description`));if(t){let i=Ny(t,`control`);if(n&&!n.htmlFor&&(n.htmlFor=i),r){let e=Ny(r,`fieldset-legend`);q.setAttribute({el:t,attr:`aria-labelledby`,value:My(t.getAttribute(`aria-labelledby`),e)})}o.forEach(e=>{q.setAttribute({el:t,attr:`aria-describedby`,value:My(t.getAttribute(`aria-describedby`),e)})}),e.hasAttribute(`data-invalid`)&&!t.hasAttribute(`aria-invalid`)&&t.setAttribute(`aria-invalid`,`true`)}e.matches(`fieldset`)&&o.length>0&&o.forEach(t=>{q.setAttribute({el:e,attr:`aria-describedby`,value:My(e.getAttribute(`aria-describedby`),t)})})}}),Fy=e=>{e.data(`UiField`,Py)};function Iy(e){return e.source.types.includes(`Files`)}function Ly(e){return e.source.items.filter(function(e){return e.kind===`file`}).map(function(e){return e.getAsFile()}).filter(function(e){return e!=null})}function Ry(e){var t=e.dragEnter,n=t.type,r=t.relatedTarget;return n===`dragenter`?Ad()?Md({dragEnter:t}):r==null?!0:kd()?Fd(r):r instanceof HTMLIFrameElement:!1}function zy(e){var t=e.type,n=e.value;return!(t===`application/vnd.pdnd`||t===`text/plain`&&n===`pdnd:android-fallback`)}function By(e){return Array.from(e.types).filter(function(t){return zy({type:t,value:e.getData(t)})})}function Vy(e){return Array.from(e.items).filter(function(t){return t.kind===`file`||zy({type:t.type,value:e.getData(t.type)})})}var Hy=!1,Uy=hf({typeKey:`external`,defaultDropEffect:`copy`,mount:function(e){return(0,ed.bind)(window,{type:`dragenter`,listener:function(t){if(!Hy&&t.dataTransfer&&e.canStart(t)&&Ry({dragEnter:t})){var n=By(t.dataTransfer);if(n.length){var r={types:n,items:[],getStringData:function(){return null}};e.start({event:t,dragType:{type:`external`,startedFrom:`external`,payload:r,getDropPayload:function(e){if(!e.dataTransfer)return r;var t=Vy(e.dataTransfer),i=e.dataTransfer.getData.bind(e.dataTransfer);return{types:n,items:t,getStringData:function(e){if(!n.includes(e))return null;var t=i(e);return zy({type:e,value:t})?t:null}}}}})}}}})}});function Wy(e){return Uy.dropTarget(e)}function Gy(e){return Uy.monitor(e)}(function(){if(typeof window>`u`)return;Uy.registerUsage();var e={type:`idle`},t=e;function n(){t.type===`dragging`&&(Hy=!1,t.cleanup(),t=e)}function r(){return(0,ed.bindAll)(window,[{type:`dragend`,listener:n}].concat(Od(Ld({onDragEnd:n}))),{capture:!0})}(0,ed.bind)(window,{type:`dragstart`,listener:function(){t.type===`idle`&&(Hy=!0,t={type:`dragging`,cleanup:r()})},options:{capture:!0}})})();var Ky=[`stack`,`inline`],qy=[`auto`,`image`,`none`],Jy=[`sm`,`md`,`lg`],Yy={name:V,accept:V,capture:V,multiple:U,required:U,disabled:U,invalid:U,preview:W(qy,`auto`),layout:W(Ky,`stack`),size:W(Jy,`md`),heading:V.default(`Drop files here or browse`),text:V,browseLabel:V,empty:V,maxItems:H.min(0).default(0),clearable:U.default(!0),rootClass:V,dropzoneClass:V,listClass:V,itemClass:V,class:V};V.default(`Drop files here or browse`),V.default(`cloud__upload`),W(Ky,`stack`),W(Jy,`md`),V.default(`document__blank`),V.default(`Remove file`);var Xy=G({definition:{component:`ui.file-upload`,parts:{root:{base:[`grid w-full min-w-0 gap-3`,`data-disabled:cursor-not-allowed`]},control:{base:`grid min-w-0 gap-3`},input:{base:[`absolute inset-0 z-10 h-full w-full cursor-pointer opacity-0`,`disabled:cursor-not-allowed`]},dropzone:{base:[`relative grid min-w-0 overflow-hidden rounded-4 border border-border bg-surface text-foreground shadow-control outline-none`,`focus-within:border-control-border-focus focus-within:shadow-focus`,`hover:bg-base-a2 data-dragging:border-control-border-focus data-dragging:bg-base-a3`,`data-invalid:border-control-border-invalid data-invalid:focus-within:border-control-border-invalid-focus data-invalid:focus-within:shadow-danger-focus`,`data-disabled:pointer-events-none data-disabled:cursor-not-allowed data-disabled:bg-surface data-disabled:hover:bg-surface`],variants:{layout:{stack:`justify-items-center text-center`,inline:`grid-cols-[auto_minmax(0,1fr)_auto] items-center text-left`},size:{sm:`gap-2 p-3`,md:`gap-3 p-4`,lg:`gap-3 p-5`}},defaults:{layout:`stack`,size:`md`}},icon:{base:`size-icon-lg shrink-0 fill-current text-icon`},body:{base:`grid min-w-0 gap-1`},heading:{base:`text-sm font-medium text-foreground`},text:{base:`text-xs font-normal text-foreground-muted`},browse:{base:[`inline-flex min-w-0 items-center justify-center rounded-3 bg-base-a2 px-2 py-1 text-xs font-medium text-foreground`,`shadow-border`]},list:{base:`grid min-w-0 gap-2`},empty:{base:`text-xs text-foreground-muted`},item:{base:[`grid min-w-0 grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-3 rounded-3 bg-surface px-3 py-2 shadow-border`,`hover:shadow-border-hover`,`data-invalid:shadow-danger-focus`]},preview:{base:`flex size-9 shrink-0 items-center justify-center overflow-hidden rounded-2 bg-base-a2 text-icon`},previewImage:{base:`size-full`},itemIcon:{base:`size-icon fill-current`},itemBody:{base:`grid min-w-0 gap-0.5`},itemName:{base:`truncate text-sm font-medium text-foreground`},itemMeta:{base:`truncate text-xs font-normal text-foreground-muted`},itemError:{base:`truncate text-xs font-normal text-danger-text`},remove:{base:[`relative z-20 inline-flex size-control-sm shrink-0 items-center justify-center rounded-3 border-0 bg-transparent`,`text-icon outline-none hover:bg-base-a2 hover:text-foreground`,`focus-visible:ring-2 focus-visible:ring-focus`]},removeIcon:{base:`size-icon-xs fill-current leading-none`},clear:{base:`sr-only`}}}}),Zy=e=>{if(e===0)return`0 B`;let t=[`B`,`KB`,`MB`,`GB`],n=Math.min(Math.floor(Math.log(e)/Math.log(1024)),t.length-1),r=e/1024**n;return`${r>=10||n===0?Math.round(r):Number(r.toFixed(1))} ${t[n]}`},Qy=(e,t)=>[t,e.name,e.size,e.lastModified].join(`:`),$y=e=>e.type.startsWith(`image/`),eb=(e,t)=>t!==`none`&&(t===`image`||$y(e)),tb=e=>e?Array.from(e):[],nb=(e,t)=>{let n=t.split(`,`).map(e=>e.trim().toLowerCase()).filter(Boolean);if(n.length===0)return!0;let r=e.name.toLowerCase(),i=e.type.toLowerCase();return n.some(e=>e.startsWith(`.`)?r.endsWith(e):e.endsWith(`/*`)?i.startsWith(`${e.slice(0,-1)}`):e.includes(`/`)?i===e:!1)},rb=(e,t)=>e.filter(e=>nb(e,t)),ib=(e,t)=>e.maxItems>0&&t>=e.maxItems,ab=e=>{if(typeof DataTransfer>`u`)return null;let t=new DataTransfer;return e.forEach(e=>t.items.add(e)),t.files},ob=(e,t)=>{let n=ab(t);if(!n)return!1;try{return e.files=n,!0}catch{return!1}},sb=e=>{e.dispatchEvent(new Event(`input`,{bubbles:!0})),e.dispatchEvent(new Event(`change`,{bubbles:!0}))},cb=e=>{let t=`http://www.w3.org/2000/svg`,n=document.createElementNS(t,`svg`),r=document.createElementNS(t,`polygon`);return n.setAttribute(`viewBox`,`0 0 32 32`),n.setAttribute(`aria-hidden`,`true`),n.setAttribute(`class`,e),r.setAttribute(`points`,`17.4141 16 24 9.4141 22.5859 8 16 14.5859 9.4143 8 8 9.4141 14.5859 16 8 22.5859 9.4143 24 16 17.4141 22.5859 24 24 22.5859 17.4141 16`),n.append(r),n},lb=()=>({props:null,listeners:[],files:[],limitReached:!1,init(){this.props=B({el:this.$el,schema:Yy});let e=this.input(),t=this.dropzone();q.addListener({target:e,event:`change`,handler:()=>this.syncFromInput(),cleanup:this.listeners}),q.addListener({target:e,event:`click`,handler:e=>{this.isInputUnavailable()&&(e.preventDefault(),e.stopPropagation())},cleanup:this.listeners}),q.addListener({target:e,event:`keydown`,handler:e=>{!(e instanceof KeyboardEvent)||!this.isInputUnavailable()||e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),e.stopPropagation())},cleanup:this.listeners}),q.addListener({target:this.$el,event:`click`,handler:e=>{let t=e.target;if(!(t instanceof Element))return;let n=t.closest(`[data-ui-file-upload-remove][data-file-index]`);if(n){e.preventDefault(),this.removePending(Number(n.dataset.fileIndex));return}let r=t.closest(`[data-ui-file-upload-remove][data-existing-file]`);r&&(e.preventDefault(),this.clearExisting(r))},cleanup:this.listeners}),t&&(this.listeners.push(Wy({element:t,canDrop:({source:e})=>!this.isInputUnavailable()&&Iy({source:e}),getDropEffect:()=>`copy`,onDragEnter:()=>this.setDragging(!0),onDragLeave:()=>this.setDragging(!1),onDrop:({source:e})=>{this.setDragging(!1),!(this.isInputUnavailable()||!Iy({source:e}))&&this.addFiles(Ly({source:e}))}})),this.listeners.push(Gy({canMonitor:({source:e})=>Iy({source:e}),onDrop:()=>this.setDragging(!1)}))),this.syncFromInput(),this.sync()},destroy(){this.files.forEach(e=>{e.previewUrl&&URL.revokeObjectURL(e.previewUrl)}),this.props.disconnect(),this.listeners.forEach(e=>e()),this.listeners=[]},root(){return this.$el},input(){let e=this.$el.querySelector(`[data-ui-file-upload-input]`);if(!e)throw Error(`File upload requires a native file input.`);return e},dropzone(){return this.$el.querySelector(`[data-ui-file-upload-dropzone]`)},list(){return this.$el.querySelector(`[data-ui-file-upload-list]`)},isInputUnavailable(){return this.props.disabled||ib(this.props,tb(this.input().files).length)},sync(){let e=this.root(),t=this.dropzone(),n=!!e.querySelector(`[data-ui-file-upload-item][data-existing-file]:not([hidden])`),r=this.files.length>0||n,i=this.isInputUnavailable();this.syncInputAttributes(),this.syncFormEncoding(),q.syncControlPresence({el:e,state:this.props,value:`true`}),q.setPresence({el:e,attr:`data-empty`,present:!r,value:`true`}),q.setPresence({el:e,attr:`data-has-files`,present:r,value:`true`}),q.setPresence({el:e,attr:`data-multiple`,present:this.props.multiple,value:`true`}),q.setPresence({el:e,attr:`data-max-items-reached`,present:this.limitReached,value:`true`}),q.setPresence({el:e,attr:`data-has-existing-file`,present:n,value:`true`}),t&&(q.syncControlPresence({el:t,state:{disabled:i,invalid:this.props.invalid},value:`true`}),q.setPresence({el:t,attr:`data-multiple`,present:this.props.multiple,value:`true`}),q.setPresence({el:t,attr:`data-has-files`,present:r,value:`true`}),q.setPresence({el:t,attr:`data-max-items-reached`,present:this.limitReached,value:`true`}))},syncFormEncoding(){let e=this.input().form;e&&(e.enctype=`multipart/form-data`)},syncInputAttributes(){let e=this.input();q.syncNativeControl({input:e,state:{name:this.props.name,disabled:this.props.disabled,required:this.props.required,invalid:this.props.invalid}}),e.multiple=this.props.multiple,this.props.accept?e.accept=this.props.accept:e.removeAttribute(`accept`),this.props.capture?e.setAttribute(`capture`,this.props.capture):e.removeAttribute(`capture`),this.isInputUnavailable()&&!this.props.disabled?(e.setAttribute(`aria-disabled`,`true`),e.tabIndex=-1):this.props.disabled||(e.removeAttribute(`aria-disabled`),e.removeAttribute(`tabindex`))},syncFromInput(){let e=this.input(),t=tb(e.files),n=rb(t,this.props.accept),r=this.props.multiple?this.props.maxItems:1,i=r>0?n.slice(0,r):n,a=t.length-n.length,o=n.length-i.length,s=a+o;this.limitReached=ib(this.props,i.length),s>0&&(ob(e,i),o>0&&q.dispatch({el:this.root(),name:`ui:file-upload-limit`,detail:{rejectedCount:o}})),this.files.forEach(e=>{e.previewUrl&&URL.revokeObjectURL(e.previewUrl)}),this.files=i.map((e,t)=>({id:Qy(e,t),file:e,name:e.name,size:Zy(e.size),type:e.type||`File`,previewUrl:eb(e,this.props.preview)?URL.createObjectURL(e):``})),this.renderFiles(),this.sync(),q.dispatch({el:this.root(),name:`ui:file-upload-change`,detail:{files:this.files.map(({name:e,size:t,type:n})=>({name:e,size:t,type:n}))}})},addFiles(e){if(this.isInputUnavailable()||e.length===0)return;let t=this.input(),n=rb(e,this.props.accept),r=this.props.multiple?tb(t.files):[],i=this.props.maxItems>0?Math.max(this.props.maxItems-r.length,0):n.length,a=this.props.multiple?n.slice(0,i):n.slice(0,1),o=n.length-a.length,s=this.props.multiple?[...r,...a]:a;if(o>0&&q.dispatch({el:this.root(),name:`ui:file-upload-limit`,detail:{rejectedCount:o}}),this.props.maxItems>0?this.limitReached=ib(this.props,s.length):this.limitReached=!1,s.length===0){this.sync();return}if(!ob(t,s)){t.click();return}sb(t)},removePending(e){if(this.props.disabled||!Number.isInteger(e))return;let t=this.input(),n=tb(t.files).filter((t,n)=>n!==e);if(n.length===0){t.value=``,sb(t);return}ob(t,n)||(t.value=``),sb(t)},clearExisting(e){if(this.props.disabled||!this.props.clearable)return;let t=this.root().querySelector(`[data-ui-file-upload-clear]`);t&&(t.checked=!0,t.dispatchEvent(new Event(`change`,{bubbles:!0})));let n=e.closest(`[data-ui-file-upload-item][data-existing-file]`);n&&(n.hidden=!0),this.sync()},renderFiles(){let e=this.list();if(!e)return;e.querySelectorAll(`[data-ui-file-upload-pending]`).forEach(e=>e.remove());let t=e.querySelector(`[data-ui-file-upload-empty]`);t&&(t.hidden=this.files.length>0||!!e.querySelector(`[data-existing-file]:not([hidden])`));let n=K({part:Xy.parts.item,props:{},className:this.props.itemClass}),r=K({part:Xy.parts.preview}),i=[`relative block overflow-hidden ui-image-outline`,K({part:Xy.parts.previewImage})].filter(Boolean).join(` `),a=K({part:Xy.parts.itemBody}),o=K({part:Xy.parts.itemName}),s=K({part:Xy.parts.itemMeta}),c=K({part:Xy.parts.remove}),l=K({part:Xy.parts.removeIcon});this.files.forEach((t,u)=>{let d=document.createElement(`li`);d.dataset.uiFileUploadItem=``,d.dataset.uiFileUploadPending=``,d.dataset.fileIndex=String(u),d.className=n;let f=document.createElement(`span`);if(f.dataset.uiFileUploadPreview=``,f.className=r,f.setAttribute(`aria-hidden`,`true`),t.previewUrl){let e=document.createElement(`span`);e.dataset.uiImage=``,e.className=i;let n=document.createElement(`img`);n.src=t.previewUrl,n.alt=``,n.loading=`lazy`,n.decoding=`async`,n.dataset.uiImageImg=``,n.className=`block size-full object-cover`,e.append(n),f.append(e)}else f.textContent=t.name.slice(0,1).toUpperCase();let p=document.createElement(`span`);p.className=a;let m=document.createElement(`span`);m.dataset.uiFileUploadItemName=``,m.className=o,m.textContent=t.name;let h=document.createElement(`span`);h.dataset.uiFileUploadItemMeta=``,h.className=s,h.textContent=[t.size,t.type].filter(Boolean).join(` · `),p.append(m,h);let g=document.createElement(`button`);g.type=`button`,g.dataset.uiFileUploadRemove=``,g.dataset.fileIndex=String(u),g.className=c,g.setAttribute(`aria-label`,`Remove ${t.name}`),g.append(cb(l)),d.append(f,p,g),e.append(d)})},setDragging(e){let t=this.root(),n=this.dropzone();q.setPresence({el:t,attr:`data-dragging`,present:e,value:`true`}),n&&q.setPresence({el:n,attr:`data-dragging`,present:e,value:`true`})}}),ub=e=>{e.data(`UiFileUpload`,()=>lb())},db=mh,fb=hh,pb=gh,mb={type:V.default(`text`),name:V,value:V,placeholder:V,size:W(db,`lg`),variant:W(fb,`outline`),disabled:U,readonly:U,required:U,invalid:U,icon:V,iconTrailing:V,iconVariant:W(pb,`outline`),clearable:U,copyable:U,kbd:V,prefix:V,suffix:V,rootClass:V,controlClass:V,class:V};W(db,`lg`),W(fb,`outline`);var hb=()=>({props:null,listeners:[],copiedTimer:null,init(){this.props=B({el:this.$el,schema:mb});let e=this.input();q.addListener({target:e,event:`input`,handler:()=>this.sync(),cleanup:this.listeners}),q.addListener({target:this.$el,event:`click`,handler:e=>{let t=e.target;t instanceof Element&&(t.closest(`[data-ui-input-clear]`)&&this.clear(e),t.closest(`[data-ui-input-copy]`)&&this.copy(e))},cleanup:this.listeners}),this.sync()},destroy(){this.props.disconnect(),this.listeners.forEach(e=>e()),this.listeners=[],this.copiedTimer!==null&&window.clearTimeout(this.copiedTimer)},input(){let e=this.$el.querySelector(`[data-ui-input]`);if(!e)throw Error(`Input requires a native input element.`);return e},root(){return this.$el},sync(){let e=this.input().value.length>0;this.$el.querySelectorAll(`[data-ui-input-clear]`).forEach(t=>{t.hidden=!e})},clear(e){e?.preventDefault();let t=this.input();t.disabled||t.readOnly||(t.value=``,t.dispatchEvent(new InputEvent(`input`,{bubbles:!0,inputType:`deleteContentBackward`})),t.dispatchEvent(new Event(`change`,{bubbles:!0})),t.focus({preventScroll:!0}),this.sync())},async copy(e){e?.preventDefault();let t=this.input();if(t.disabled)return;navigator.clipboard?.writeText&&await navigator.clipboard.writeText(t.value);let n=this.root();q.setPresence({el:n,attr:`data-copied`,present:!0,value:`true`}),this.$el.querySelectorAll(`[data-ui-input-copy]`).forEach(e=>{q.setPresence({el:e,attr:`data-copied`,present:!0,value:`true`})}),this.copiedTimer!==null&&window.clearTimeout(this.copiedTimer),this.copiedTimer=window.setTimeout(()=>{q.setPresence({el:n,attr:`data-copied`,present:!1,value:`true`}),this.$el.querySelectorAll(`[data-ui-input-copy]`).forEach(e=>{q.setPresence({el:e,attr:`data-copied`,present:!1,value:`true`})})},1200)}}),gb=e=>{e.data(`UiInput`,()=>hb())},_b=[`modal`,`sheet`,`drawer`,`flyout`,`floating`],vb=bh,yb=[`sm`,`md`,`lg`,`xl`,`full`],bb=wh,xb={name:V,open:U,mode:W(_b,`modal`),side:W(vb,`right`),size:W(yb,`md`),dismissible:U.default(!0),closable:U.default(!0),disabled:U,autofocusTitle:U,label:V,descriptionId:V,panelClass:V,overlayClass:V,class:V},Sb={name:V,disabled:U,class:V};V.default(`ui-modal-root`),W(bb,`h2`),V.default(`Close`);var Cb=G({definition:{component:`ui.modal`,parts:{instance:{base:`contents`},root:{base:[`fixed inset-0 z-dialog m-0 h-auto max-h-none w-auto max-w-none overflow-visible border-0 bg-transparent p-0 text-foreground`,`backdrop:bg-transparent`]},viewport:{base:`fixed inset-0 z-dialog flex min-h-dvh overflow-y-auto`,variants:{mode:{modal:`items-center justify-center p-4`,sheet:``,drawer:``,flyout:``,floating:`p-4`},side:{top:``,right:``,bottom:``,left:``}},compounds:[{when:{mode:`sheet`,side:`top`},class:`items-start justify-center`},{when:{mode:`sheet`,side:`right`},class:`items-center justify-end`},{when:{mode:`sheet`,side:`bottom`},class:`items-end justify-center`},{when:{mode:`sheet`,side:`left`},class:`items-center justify-start`},{when:{mode:`drawer`,side:`top`},class:`items-start justify-center`},{when:{mode:`drawer`,side:`right`},class:`items-center justify-end`},{when:{mode:`drawer`,side:`bottom`},class:`items-end justify-center`},{when:{mode:`drawer`,side:`left`},class:`items-center justify-start`},{when:{mode:`flyout`,side:`top`},class:`items-start justify-center`},{when:{mode:`flyout`,side:`right`},class:`items-center justify-end`},{when:{mode:`flyout`,side:`bottom`},class:`items-end justify-center`},{when:{mode:`flyout`,side:`left`},class:`items-center justify-start`},{when:{mode:`floating`,side:`top`},class:`items-start justify-center`},{when:{mode:`floating`,side:`right`},class:`items-center justify-end`},{when:{mode:`floating`,side:`bottom`},class:`items-end justify-center`},{when:{mode:`floating`,side:`left`},class:`items-center justify-start`}],defaults:{mode:`modal`,side:`right`}},overlay:{base:`fixed inset-0 bg-overlay`},panel:{base:[`relative z-dialog grid w-full min-w-0 gap-4 overflow-auto bg-surface-raised p-5 text-foreground shadow-panel outline-none`,`max-h-full`],variants:{mode:{modal:`rounded-4`,sheet:`rounded-4`,drawer:`rounded-4`,flyout:`rounded-4`,floating:`rounded-4`},side:{top:``,right:``,bottom:``,left:``},size:{sm:`max-w-sm`,md:`max-w-lg`,lg:`max-w-2xl`,xl:`max-w-4xl`,full:`max-w-full`}},compounds:[{when:{mode:`sheet`,side:`right`},class:`min-h-dvh max-w-lg rounded-r-none`},{when:{mode:`sheet`,side:`left`},class:`min-h-dvh max-w-lg rounded-l-none`},{when:{mode:`sheet`,side:`top`},class:`max-w-full rounded-t-none`},{when:{mode:`sheet`,side:`bottom`},class:`max-w-full rounded-b-none`},{when:{mode:`drawer`,side:`right`},class:`min-h-dvh max-w-md rounded-r-none`},{when:{mode:`drawer`,side:`left`},class:`min-h-dvh max-w-md rounded-l-none`},{when:{mode:`drawer`,side:`top`},class:`max-w-full rounded-t-none`},{when:{mode:`drawer`,side:`bottom`},class:`max-w-full rounded-b-none`},{when:{mode:`flyout`,side:`right`},class:`min-h-dvh max-w-sm rounded-r-none`},{when:{mode:`flyout`,side:`left`},class:`min-h-dvh max-w-sm rounded-l-none`},{when:{mode:`flyout`,side:`top`},class:`max-w-md rounded-t-none`},{when:{mode:`flyout`,side:`bottom`},class:`max-w-md rounded-b-none`},{when:{mode:`floating`,side:`right`},class:`h-full`},{when:{mode:`floating`,side:`left`},class:`h-full`},{when:{mode:`floating`,side:`top`},class:`max-w-full`},{when:{mode:`floating`,side:`bottom`},class:`max-w-full`}],defaults:{mode:`modal`,side:`right`,size:`md`}},trigger:{base:`contents`},outlet:{base:``},title:{base:`pr-8`},description:{base:`-mt-3 pr-8`},body:{base:`grid min-w-0 gap-3 text-sm text-foreground`},footer:{base:`flex min-w-0 items-center justify-end gap-2 pt-1`},close:{base:[`absolute right-3 top-3 inline-flex size-control-md items-center justify-center rounded-2 border border-transparent text-icon outline-none`,`hover:bg-base-a2 focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2 focus-visible:ring-offset-app`]},closeIcon:{base:`size-icon fill-current`}}}}),wb=new Set,Tb=new Set,Eb=[`a[href]`,`area[href]`,`button:not([disabled])`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`,`[contenteditable="true"]`].join(`,`),Db=e=>e?`open`:`closed`,Ob=e=>Array.from(wb).find(t=>t.name===e)??null,kb=e=>Array.from(Tb).filter(t=>t.name===e),Ab=e=>{let t=e.detail;t?.name&&Ob(t.name)?.close(e)},jb=e=>!e.hasAttribute(`disabled`)&&e.getAttribute(`aria-disabled`)!==`true`&&!e.hidden&&e.tabIndex!==-1,Mb=e=>e.matches(Eb)&&jb(e)?e:e.querySelector(Eb)??e,Nb=(e,t)=>{let n=Db(t);e.setAttribute(`data-state`,n),e.setAttribute(`aria-expanded`,t?`true`:`false`)},Pb=()=>({props:null,isOpen:!1,dialogId:``,activeTrigger:null,cleanup:[],localTriggerCleanup:[],isRegistered:!1,didShowModal:!1,hasScrollLock:!1,modalMotionRun:0,overlayMotion:null,panelMotion:null,get name(){return this.props?.name??``},init(){this.props=B({el:this.$el,schema:xb}),this.isOpen=this.props.open,this.dialogId=this.dialogEl().id||this.$id(`modal${this.props.name?`-${this.props.name}`:``}`),this.register(),this.mountLocalTrigger(),this.setupDialog(),this.overlayMotion=q.motion.createPresenceLifecycle({element:()=>this.overlayEl(),preset:`fade`}),this.panelMotion=q.motion.createPresenceLifecycle({element:()=>this.panelEl(),preset:`modal`}),this.syncAll(),this.$watch(`isOpen`,e=>{e?this.applyOpenState():this.applyClosedState()}),this.isOpen&&queueMicrotask(()=>this.applyOpenState())},destroy(){this.props.disconnect(),this.overlayMotion?.destroy(),this.panelMotion?.destroy(),this.hasScrollLock&&=(ph(),!1),this.unregister(),this.teardownLocalTrigger(),this.teardown()},get root(){return q.props({inputs:[q.resolveStyle({part:Cb.parts.instance,props:{},className:``}),{"data-ui-modal-instance":``}]})},dialogEl(){let e=this.$el.querySelector(`[data-ui-modal]`);if(!(e instanceof HTMLDialogElement))throw Error(`Modal requires a dialog element.`);return e},viewportEl(){let e=this.$el.querySelector(`[data-ui-modal-viewport]`);if(!e)throw Error(`Modal requires a viewport element.`);return e},overlayEl(){let e=this.$el.querySelector(`[data-ui-modal-overlay]`);if(!e)throw Error(`Modal requires an overlay element.`);return e},panelEl(){let e=this.$el.querySelector(`[data-ui-modal-panel]`);if(!e)throw Error(`Modal requires a panel element.`);return e},titleEl(){return this.$el.querySelector(`[data-ui-modal-title]`)},descriptionEl(){return this.$el.querySelector(`[data-ui-modal-description]`)},closeEls(){return Array.from(this.$el.querySelectorAll(`[data-ui-modal-close]`))},localTriggerEl(){return Array.from(this.$el.children).find(e=>e instanceof HTMLElement&&e.matches(`[data-ui-modal-trigger]`))??null},triggerTarget(e){return Mb(e)},focusableEls(){return Array.from(this.panelEl().querySelectorAll(Eb)).filter(jb)},firstAutofocusEl(){return this.panelEl().querySelector(`[autofocus]`)},mountLocalTrigger(){let e=this.dialogEl(),t=e.querySelector(`[data-ui-modal-trigger]`);!t||t.dataset.name||(this.$el.insertBefore(t,e),this.setupLocalTrigger(t))},setupLocalTrigger(e){let t=this.triggerTarget(e);this.teardownLocalTrigger(),this.syncExternalTrigger(t,this.props.disabled),q.addListener({target:t,event:`click`,handler:e=>this.openFrom(t),cleanup:this.localTriggerCleanup}),q.addListener({target:t,event:`keydown`,handler:e=>{e instanceof KeyboardEvent&&(t instanceof HTMLButtonElement||t instanceof HTMLAnchorElement||e.key!==`Enter`&&e.key!==` `||this.open(e))},cleanup:this.localTriggerCleanup})},setupDialog(){let e=this.dialogEl();q.addListener({target:e,event:`cancel`,handler:t=>{t.target===e&&(t.preventDefault(),this.cancel(`escape`,t))},cleanup:this.cleanup}),q.addListener({target:e,event:`close`,handler:()=>{this.isOpen&&this.close()},cleanup:this.cleanup}),q.addListener({target:e,event:`keydown`,handler:e=>{e instanceof KeyboardEvent&&this.handleKeydown(e)},cleanup:this.cleanup}),this.closeEls().forEach(e=>{q.addListener({target:e,event:`click`,handler:e=>this.close(e),cleanup:this.cleanup})}),this.cleanup.push(q.addDismissableLayer({isEnabled:()=>this.isOpen,roots:()=>[this.panelEl(),this.activeTrigger,this.localTriggerEl()],onDismiss:e=>this.cancel(`outside`,e)}))},register(){this.isRegistered||=(wb.add(this),!0)},unregister(){wb.delete(this),this.isRegistered=!1},open(e){if(e?.preventDefault(),this.props.disabled)return;let t=this.localTriggerEl();this.activeTrigger=t?this.triggerTarget(t):this.activeTrigger,this.isOpen=!0},openFrom(e){this.props.disabled||(this.activeTrigger=e,this.isOpen=!0)},close(e){e?.preventDefault(),this.isOpen=!1},cancel(e,t){if(!this.props.dismissible){t?.preventDefault();return}this.close(t),q.dispatch({el:this.dialogEl(),name:`ui:cancel`,detail:{reason:e}})},syncExternalTrigger(e,t){if(Nb(e,this.isOpen),e.setAttribute(`aria-controls`,this.dialogId),e.setAttribute(`data-ui-modal-trigger-target`,this.dialogId),e.setAttribute(`data-state`,Db(this.isOpen)),t||this.props.disabled){e.setAttribute(`aria-disabled`,`true`),e.setAttribute(`data-disabled`,``),e instanceof HTMLButtonElement&&(e.disabled=!0),e.matches(Eb)||(e.tabIndex=-1);return}e.removeAttribute(`aria-disabled`),e.removeAttribute(`data-disabled`),e instanceof HTMLButtonElement&&(e.disabled=!1),e.matches(Eb)||(e.tabIndex=0)},syncAll(){this.syncDialog(),this.syncLocalTrigger(),this.syncNamedTriggers()},syncDialog(){let e=this.dialogEl(),t=this.viewportEl(),n=this.overlayEl(),r=this.panelEl(),i=this.titleEl(),a=this.descriptionEl(),o=Db(this.isOpen);e.id=this.dialogId,e.setAttribute(`role`,`dialog`),e.setAttribute(`aria-modal`,`true`),e.setAttribute(`data-state`,o),e.dataset.mode=this.props.mode,e.dataset.side=this.props.side,e.dataset.size=this.props.size,e.className=q.resolveStyle({part:Cb.parts.root,props:this.props,className:this.props.class}),t.setAttribute(`data-state`,o),t.dataset.mode=this.props.mode,t.dataset.side=this.props.side,t.className=q.resolveStyle({part:Cb.parts.viewport,props:this.props}),n.setAttribute(`data-state`,o),n.className=q.resolveStyle({part:Cb.parts.overlay,props:this.props,className:this.props.overlayClass}),r.id||=this.$id(`modal-panel${this.props.name?`-${this.props.name}`:``}`),r.setAttribute(`data-state`,o),r.dataset.mode=this.props.mode,r.dataset.side=this.props.side,r.dataset.size=this.props.size,r.tabIndex=-1,r.className=q.resolveStyle({part:Cb.parts.panel,props:this.props,className:this.props.panelClass}),i?(i.id||=this.$id(`modal-title${this.props.name?`-${this.props.name}`:``}`),e.setAttribute(`aria-labelledby`,i.id),e.removeAttribute(`aria-label`),this.props.autofocusTitle&&(i.tabIndex=-1)):this.props.label&&(e.setAttribute(`aria-label`,this.props.label),e.removeAttribute(`aria-labelledby`)),a&&(a.id||=this.$id(`modal-description${this.props.name?`-${this.props.name}`:``}`)),this.props.descriptionId===`none`?e.removeAttribute(`aria-describedby`):this.props.descriptionId?e.setAttribute(`aria-describedby`,this.props.descriptionId):a&&e.setAttribute(`aria-describedby`,a.id)},syncLocalTrigger(){let e=this.localTriggerEl();e&&this.syncExternalTrigger(this.triggerTarget(e),this.props.disabled)},syncNamedTriggers(){this.props.name&&kb(this.props.name).forEach(e=>e.sync())},applyOpenState(){this.modalMotionRun+=1;let e=this.dialogEl();typeof e.showModal==`function`?this.didShowModal||=(e.open&&e.removeAttribute(`open`),e.showModal(),!0):e.open||e.setAttribute(`open`,``),this.hasScrollLock||=(fh(),!0),this.syncAll(),this.overlayMotion?.enter(),this.panelMotion?.enter(),queueMicrotask(()=>this.focusInitial()),q.dispatch({el:e,name:`ui:open`})},applyClosedState(){let e=++this.modalMotionRun;this.syncAll();let t=this.overlayMotion?.exit(),n=this.panelMotion?.exit();Promise.allSettled([t?.finished??Promise.resolve(),n?.finished??Promise.resolve()]).then(()=>this.finishClosedState(e))},finishClosedState(e){if(e!==this.modalMotionRun||this.isOpen)return;let t=this.dialogEl();t.open&&t.close(),this.didShowModal=!1,this.hasScrollLock&&=(ph(),!1),this.restoreFocus(),q.dispatch({el:t,name:`ui:close`})},focusInitial(){let e=this.firstAutofocusEl();if(e&&jb(e)){e.focus({preventScroll:!0});return}let t=this.titleEl();if(this.props.autofocusTitle&&t){t.focus({preventScroll:!0});return}let n=this.focusableEls()[0];if(n){n.focus({preventScroll:!0});return}this.panelEl().focus({preventScroll:!0})},restoreFocus(){!this.activeTrigger||!document.contains(this.activeTrigger)||this.activeTrigger.focus({preventScroll:!0})},handleKeydown(e){e.key===`Tab`&&this.trapFocus(e)},trapFocus(e){let t=this.focusableEls();if(t.length===0){e.preventDefault(),this.panelEl().focus({preventScroll:!0});return}let n=t[0],r=t[t.length-1];if(!(!n||!r)){if(e.shiftKey&&document.activeElement===n){e.preventDefault(),r.focus({preventScroll:!0});return}!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n.focus({preventScroll:!0}))}},teardownLocalTrigger(){this.localTriggerCleanup.forEach(e=>e()),this.localTriggerCleanup=[]},teardown(){this.cleanup.forEach(e=>e()),this.cleanup=[]}}),Fb=()=>({props:null,target:null,cleanup:[],get name(){return this.props?.name??``},init(){this.props=B({el:this.$el,schema:Sb}),this.target=this.targetEl(),Tb.add(this),this.sync(),q.addListener({target:this.target,event:`click`,handler:e=>this.open(e),cleanup:this.cleanup}),q.addListener({target:this.target,event:`keydown`,handler:e=>{e instanceof KeyboardEvent&&(this.target instanceof HTMLButtonElement||this.target instanceof HTMLAnchorElement||e.key!==`Enter`&&e.key!==` `||this.open(e))},cleanup:this.cleanup})},destroy(){this.props.disconnect(),Tb.delete(this),this.cleanup.forEach(e=>e()),this.cleanup=[]},get root(){return q.props({inputs:[q.resolveStyle({part:Cb.parts.trigger,props:{},className:this.props.class}),{"data-ui-modal-trigger":``,":data-name":()=>this.props.name||void 0,":data-disabled":()=>this.props.disabled?``:void 0}]})},sync(){let e=this.modal();if(e){e.syncExternalTrigger(this.target,this.props.disabled);return}Nb(this.target,!1),this.props.disabled?(this.target.setAttribute(`aria-disabled`,`true`),this.target.setAttribute(`data-disabled`,``)):(this.target.removeAttribute(`aria-disabled`),this.target.removeAttribute(`data-disabled`))},modal(){return this.props.name?Ob(this.props.name):null},open(e){e?.preventDefault(),!this.props.disabled&&this.modal()?.openFrom(this.target)},targetEl(){return Mb(this.$el)}}),Ib=e=>{e.data(`UiModal`,()=>Pb()),e.data(`UiModalTrigger`,()=>Fb()),document.addEventListener(`ui:modal-close`,Ab)},Lb=xh,Rb=[`default`,`cards`,`pills`],zb=Sh,Bb=mh,Vb=[`default`,`cards`,`pills`],Hb={name:V,value:V,orientation:W(Lb,`vertical`),variant:W(Rb,`default`),indicator:U.default(!0),placement:W(zb,`leading`),disabled:U,required:U,invalid:U,loop:U.default(!0),class:V};U.default(!0),W(zb,`leading`),W(Vb,`default`),W(Bb,`md`),W(Bb,`md`);var Ub=(e,t)=>t.value||e.dataset.value||e.textContent?.trim()||``,Wb=()=>({props:null,value:``,listeners:[],observer:null,init(){this.props=B({el:this.$el,schema:Hb});let e=this.items().find(e=>e.input.checked);this.value=this.props.value||e?.value||``,q.addListener({target:this.$el,event:`change`,handler:e=>{let t=e.target;if(!(t instanceof HTMLInputElement)||t.type!==`radio`)return;let n=this.items().find(e=>e.input===t);n&&this.select(n,e)},cleanup:this.listeners}),q.addListener({target:this.$el,event:`keydown`,handler:e=>{let t=e.target;if(!(t instanceof HTMLInputElement)||t.type!==`radio`)return;let n=this.items().find(e=>e.input===t);n&&e instanceof KeyboardEvent&&this.handleKeydown(n,e)},cleanup:this.listeners}),this.observer=new MutationObserver(()=>this.sync()),this.observer.observe(this.$el,{childList:!0,subtree:!0}),this.sync()},destroy(){this.props.disconnect(),this.listeners.forEach(e=>e()),this.listeners=[],this.observer?.disconnect()},items(){return Array.from(this.$el.querySelectorAll(`[data-ui-radio]`)).map(e=>{let t=e.querySelector(`[data-ui-radio-input]`);if(!t)return null;let n=this.props.disabled||e.hasAttribute(`data-disabled`);return{root:e,input:t,indicator:e.querySelector(`[data-ui-radio-indicator]`),dot:e.querySelector(`[data-ui-radio-indicator-dot]`),value:Ub(e,t),disabled:n}}).filter(e=>e!==null)},enabledItems(){return this.items().filter(e=>!e.disabled)},select(e,t){e.disabled||(this.value=e.value,this.sync(),t?.type!==`change`&&(e.input.dispatchEvent(new Event(`input`,{bubbles:!0})),e.input.dispatchEvent(new Event(`change`,{bubbles:!0}))))},move(e,t){let n=this.enabledItems(),r=n.findIndex(t=>t.input===e.input);if(r<0)return;let i=r+t;if(i<0||i>=n.length){if(!this.props.loop)return;i=i<0?n.length-1:0}let a=n[i];a&&(this.select(a),a.input.focus({preventScroll:!0}))},sync(){let e=this.$el;q.setAttribute({el:e,attr:`data-orientation`,value:this.props.orientation}),q.setAttribute({el:e,attr:`data-variant`,value:this.props.variant}),q.setAttribute({el:e,attr:`data-placement`,value:this.props.placement}),q.setAttribute({el:e,attr:`aria-orientation`,value:this.props.orientation}),this.props.indicator?e.removeAttribute(`data-indicator`):q.setAttribute({el:e,attr:`data-indicator`,value:`false`}),q.syncControlPresence({el:e,state:this.props});let t=this.items();this.value||=t.find(e=>e.input.checked)?.value||``,t.forEach(e=>this.syncItem(e))},syncItem(e){let t=e.value===this.value,n=this.enabledItems()[0],r=t||!this.value&&n?.input===e.input;e.input.checked=t,q.syncNativeControl({input:e.input,state:{name:this.props.name,value:e.value,disabled:e.disabled,required:this.props.required||e.root.hasAttribute(`data-required`),invalid:this.props.invalid||e.root.hasAttribute(`data-invalid`)}}),e.input.tabIndex=e.disabled?-1:r?0:-1,q.setPresence({el:e.root,attr:`data-ui-interactive`,present:this.props.variant===`cards`||e.root.dataset.variant===`cards`,value:`surface`}),q.setAttribute({el:e.root,attr:`data-state`,value:t?`checked`:`unchecked`}),q.setPresence({el:e.root,attr:`data-checked`,present:t}),q.setPresence({el:e.root,attr:`data-disabled`,present:e.disabled}),q.setPresence({el:e.root,attr:`data-invalid`,present:this.props.invalid||e.root.hasAttribute(`data-invalid`)}),q.setPresence({el:e.input,attr:`data-checked`,present:t}),e.indicator&&q.setPresence({el:e.indicator,attr:`data-checked`,present:t}),e.dot&&q.setPresence({el:e.dot,attr:`data-checked`,present:t})},handleKeydown(e,t){if(t.key===` `||t.key===`Spacebar`){t.preventDefault(),this.select(e);return}[`ArrowUp`,`ArrowLeft`].includes(t.key)&&(t.preventDefault(),this.move(e,-1)),[`ArrowDown`,`ArrowRight`].includes(t.key)&&(t.preventDefault(),this.move(e,1))}}),Gb=e=>{e.data(`UiRadioGroup`,()=>Wb())},Kb={orientation:W([`vertical`,`horizontal`,`both`],`vertical`),type:W([`hover`,`always`,`scroll`],`hover`),size:W([`sm`,`md`],`sm`),fill:U,hideNative:U.default(!0),disabled:U,class:V,viewportClass:V,scrollbarClass:V,thumbClass:V,cornerClass:V},qb=G({definition:{component:`ui.scroll-area`,parts:{root:{base:[`relative min-w-0 overflow-hidden text-foreground`,`data-disabled:opacity-60`],variants:{fill:{true:`flex min-h-0 flex-1 flex-col`,false:``},size:{sm:``,md:``}},defaults:{fill:!1,size:`sm`}},viewport:{base:[`min-h-0 min-w-0 outline-none`,`focus-visible:shadow-focus`],variants:{orientation:{vertical:`h-full w-full overflow-x-hidden overflow-y-auto`,horizontal:`h-full w-full overflow-x-auto overflow-y-hidden`,both:`size-full overflow-auto`},fill:{true:`flex-1`,false:``}},defaults:{orientation:`vertical`,fill:!1}},content:{base:`min-w-0`,variants:{orientation:{vertical:``,horizontal:`w-max min-w-full`,both:`min-w-full`}},defaults:{orientation:`vertical`}},scrollbar:{base:[`pointer-events-none absolute z-10 rounded-scrollbar-thumb opacity-0`,`data-visible:pointer-events-auto data-visible:opacity-100 data-disabled:pointer-events-none`],variants:{orientation:{vertical:`bottom-scrollbar-inset right-scrollbar-inset top-scrollbar-inset w-scrollbar`,horizontal:`bottom-scrollbar-inset left-scrollbar-inset right-scrollbar-inset h-scrollbar`}},defaults:{orientation:`vertical`}},thumb:{base:[`absolute rounded-scrollbar-thumb bg-scrollbar-thumb`,`hover:bg-scrollbar-thumb-hover data-dragging:bg-scrollbar-thumb-hover`],variants:{orientation:{vertical:`left-0 top-0 w-full`,horizontal:`left-0 top-0 h-full`}},defaults:{orientation:`vertical`}},corner:{base:[`pointer-events-none absolute bottom-scrollbar-inset right-scrollbar-inset z-10 size-scrollbar rounded-scrollbar-thumb`,`bg-transparent opacity-0`,`data-visible:opacity-100`]}}}}),Jb=18,Yb=1e3,Xb=null,Zb=(e,t,n)=>Math.min(n,Math.max(t,e)),Qb=(e,t)=>e===`both`||e===`horizontal`&&t===`x`||e===`vertical`&&t===`y`,$b=()=>{if(Xb)return Xb;let e=document.createElement(`div`),t=document.createElement(`div`);return e.dir=`rtl`,e.style.cssText=`position:absolute;left:-9999px;width:4px;height:1px;overflow:scroll;`,t.style.cssText=`width:8px;height:1px;`,e.append(t),document.body.append(e),e.scrollLeft=1,e.scrollLeft===0?Xb=`negative`:(e.scrollLeft=0,Xb=e.scrollLeft===0?`reverse`:`default`),e.remove(),Xb},ex=e=>{let t=Math.max(0,e.scrollWidth-e.clientWidth);if(!q.isRtl({el:e}))return e.scrollLeft;let n=$b();return n===`negative`?-e.scrollLeft:n===`reverse`?t-e.scrollLeft:e.scrollLeft},tx=(e,t)=>{let n=Math.max(0,e.scrollWidth-e.clientWidth),r=Zb(t,0,n);if(!q.isRtl({el:e})){e.scrollLeft=r;return}let i=$b();i===`negative`?e.scrollLeft=-r:i===`reverse`?e.scrollLeft=n-r:e.scrollLeft=r},nx=e=>e.dataset.orientation===`horizontal`?`x`:`y`,rx=e=>e instanceof HTMLElement,ix=(e,t)=>{let n=e.querySelector(`:scope > ${t}`);return rx(n)?n:null},ax=()=>({props:null,listeners:[],resizeObserver:null,mutationObserver:null,frame:0,positionFrame:0,fadeTimer:0,isHovered:!1,isFocused:!1,isScrolling:!1,dragging:null,overflowX:!1,overflowY:!1,verticalGeometry:null,horizontalGeometry:null,init(){this.props=B({el:this.$el,schema:Kb});let e=this.elements();this.resizeObserver=new ResizeObserver(()=>this.scheduleSync()),this.resizeObserver.observe(e.viewport),e.content&&this.resizeObserver.observe(e.content),this.mutationObserver=new MutationObserver(()=>this.scheduleSync()),e.content&&this.mutationObserver.observe(e.content,{childList:!0,subtree:!0,characterData:!0}),q.addListener({target:e.viewport,event:`scroll`,handler:()=>this.onScroll(),cleanup:this.listeners,options:{passive:!0}}),q.addListener({target:this.$el,event:`pointerenter`,handler:()=>{this.isHovered=!0,this.sync()},cleanup:this.listeners}),q.addListener({target:this.$el,event:`pointerleave`,handler:()=>{this.isHovered=!1,this.updateVisibility(this.elements())},cleanup:this.listeners}),q.addListener({target:this.$el,event:`focusin`,handler:()=>{this.isFocused=!0,this.sync()},cleanup:this.listeners}),q.addListener({target:this.$el,event:`focusout`,handler:()=>{this.isFocused=this.$el.contains(document.activeElement),this.updateVisibility(this.elements())},cleanup:this.listeners}),q.addListener({target:document,event:`pointermove`,handler:e=>this.onPointerMove(e),cleanup:this.listeners}),q.addListener({target:document,event:`pointerup`,handler:e=>this.onPointerUp(e),cleanup:this.listeners}),q.addListener({target:document,event:`pointercancel`,handler:e=>this.onPointerUp(e),cleanup:this.listeners}),e.verticalThumb&&q.addListener({target:e.verticalThumb,event:`pointerdown`,handler:e=>{e.preventDefault(),this.onPointerDown(e,`y`)},cleanup:this.listeners}),e.horizontalThumb&&q.addListener({target:e.horizontalThumb,event:`pointerdown`,handler:e=>{e.preventDefault(),this.onPointerDown(e,`x`)},cleanup:this.listeners}),this.$watch(`props.orientation`,()=>this.scheduleSync()),this.$watch(`props.type`,()=>this.scheduleSync()),this.$watch(`props.hideNative`,()=>this.scheduleSync()),this.$watch(`props.disabled`,()=>this.scheduleSync()),this.scheduleSync()},destroy(){this.props.disconnect(),this.listeners.splice(0).forEach(e=>e()),this.resizeObserver?.disconnect(),this.mutationObserver?.disconnect(),this.clearFadeTimer(),this.frame&&cancelAnimationFrame(this.frame),this.positionFrame&&cancelAnimationFrame(this.positionFrame),this.frame=0,this.positionFrame=0,this.dragging=null},get root(){return q.props({inputs:[K({part:qb.parts.root,props:{fill:this.props.fill,size:this.props.size},className:this.props.class}),{"data-ui-scroll-area":``,":data-orientation":()=>this.props.orientation,":data-type":()=>this.props.type,":data-size":()=>this.props.size,":data-fill":()=>this.props.fill?``:void 0,":data-disabled":()=>this.props.disabled?``:void 0}]})},viewport(e){return q.props({inputs:[K({part:qb.parts.viewport,props:{orientation:this.props.orientation,fill:this.props.fill},className:e.dataset.class}),{tabindex:`0`,"data-ui-scroll-area-viewport":``,":data-orientation":()=>this.props.orientation,":data-hide-native":()=>this.props.hideNative?``:void 0}]})},scrollbar(e){let t=nx(e)===`x`?`horizontal`:`vertical`;return q.props({inputs:[K({part:qb.parts.scrollbar,props:{orientation:t},className:e.dataset.class}),{"data-ui-scroll-area-scrollbar":``,"aria-hidden":`true`,":data-disabled":()=>this.props.disabled?``:void 0}]})},thumb(e){let t=nx(e),n=t===`x`?`horizontal`:`vertical`;return q.props({inputs:[K({part:qb.parts.thumb,props:{orientation:n},className:e.dataset.class}),{"data-ui-scroll-area-thumb":``,"aria-hidden":`true`,"@pointerdown.prevent":e=>this.onPointerDown(e,t),":data-dragging":()=>this.dragging?.axis===t?``:void 0}]})},corner(e){return q.props({inputs:[K({part:qb.parts.corner,className:e.dataset.class}),{"data-ui-scroll-area-corner":``,"aria-hidden":`true`}]})},elements(){let e=this.$el,t=ix(e,`[data-ui-scroll-area-viewport]`)??e;return{root:e,viewport:t,content:ix(t,`[data-ui-scroll-area-content]`),verticalScrollbar:ix(e,`[data-ui-scroll-area-scrollbar][data-orientation="vertical"]`),horizontalScrollbar:ix(e,`[data-ui-scroll-area-scrollbar][data-orientation="horizontal"]`),verticalThumb:ix(e,`[data-ui-scroll-area-scrollbar][data-orientation="vertical"] > [data-ui-scroll-area-thumb][data-orientation="vertical"]`),horizontalThumb:ix(e,`[data-ui-scroll-area-scrollbar][data-orientation="horizontal"] > [data-ui-scroll-area-thumb][data-orientation="horizontal"]`),corner:ix(e,`[data-ui-scroll-area-corner]`)}},scheduleSync(){this.frame||=requestAnimationFrame(()=>{this.frame=0,this.sync()})},schedulePositionSync(){this.positionFrame||=requestAnimationFrame(()=>{this.positionFrame=0,this.updateThumbPositions(this.elements())})},sync(){let e=this.elements(),{viewport:t}=e;this.overflowX=Qb(this.props.orientation,`x`)&&t.scrollWidth>t.clientWidth+1,this.overflowY=Qb(this.props.orientation,`y`)&&t.scrollHeight>t.clientHeight+1,q.setPresence({el:this.$el,attr:`data-overflow-x`,present:this.overflowX}),q.setPresence({el:this.$el,attr:`data-overflow-y`,present:this.overflowY}),q.setPresence({el:this.$el,attr:`data-scrolling`,present:this.isScrolling}),q.setPresence({el:this.$el,attr:`data-dragging`,present:this.dragging!==null}),q.setPresence({el:this.$el,attr:`data-disabled`,present:this.props.disabled}),q.setAttribute({el:t,attr:`data-orientation`,value:this.props.orientation}),q.setPresence({el:t,attr:`data-hide-native`,present:this.props.hideNative}),this.updateGeometry(e),this.updateVisibility(e)},updateGeometry(e){let{viewport:t}=e,n=(e,n,r,i)=>{if(!n||!r||!i)return r&&(r.style.width=``,r.style.height=``,r.style.transform=``),null;let a=e===`y`?n.clientHeight:n.clientWidth,o=e===`y`?t.clientHeight:t.clientWidth,s=e===`y`?t.scrollHeight:t.scrollWidth,c=Math.max(1,s-o),l=Math.min(a,Math.max(Jb,o/s*a)),u=Math.max(0,a-l);return e===`y`?(r.style.height=`${l}px`,r.style.width=``):(r.style.width=`${l}px`,r.style.height=``),{trackLength:a,thumbLength:l,maxOffset:u,maxScroll:c}};this.verticalGeometry=n(`y`,e.verticalScrollbar,e.verticalThumb,this.overflowY),this.horizontalGeometry=n(`x`,e.horizontalScrollbar,e.horizontalThumb,this.overflowX),this.updateThumbPositions(e)},updateThumbPositions(e){let{viewport:t}=e;if(e.verticalThumb&&this.verticalGeometry){let{maxOffset:n,maxScroll:r}=this.verticalGeometry,i=n*Zb(t.scrollTop/r,0,1);e.verticalThumb.style.transform=`translate3d(0, ${i}px, 0)`}if(e.horizontalThumb&&this.horizontalGeometry){let{maxOffset:n,maxScroll:r}=this.horizontalGeometry,i=n*Zb(ex(t)/r,0,1);e.horizontalThumb.style.transform=`translate3d(${i}px, 0, 0)`}},updateVisibility(e){let t=this.isHovered||this.isFocused||this.isScrolling||this.dragging!==null,n=e=>e?this.props.type===`always`?!0:this.props.type===`scroll`?this.isScrolling||this.dragging!==null:t:!1,r=n(this.overflowY),i=n(this.overflowX);[e.verticalScrollbar,e.verticalThumb].forEach(e=>{e&&q.setPresence({el:e,attr:`data-visible`,present:r})}),[e.horizontalScrollbar,e.horizontalThumb].forEach(e=>{e&&q.setPresence({el:e,attr:`data-visible`,present:i})}),[e.verticalScrollbar,e.horizontalScrollbar].forEach(e=>{e&&q.setPresence({el:e,attr:`data-disabled`,present:this.props.disabled})}),[e.verticalThumb,e.horizontalThumb].forEach(e=>{e&&q.setPresence({el:e,attr:`data-dragging`,present:this.dragging?.axis===nx(e)})}),e.corner&&q.setPresence({el:e.corner,attr:`data-visible`,present:r&&i})},startFadeTimer(){this.clearFadeTimer(),this.fadeTimer=window.setTimeout(()=>{this.isScrolling=!1,q.setPresence({el:this.$el,attr:`data-scrolling`,present:!1}),this.updateVisibility(this.elements())},Yb)},clearFadeTimer(){this.fadeTimer&&=(window.clearTimeout(this.fadeTimer),0)},onScroll(){let e=this.isScrolling;this.isScrolling=!0,e||(q.setPresence({el:this.$el,attr:`data-scrolling`,present:!0}),this.updateVisibility(this.elements())),this.overflowY&&!this.verticalGeometry||this.overflowX&&!this.horizontalGeometry?this.scheduleSync():this.schedulePositionSync(),this.startFadeTimer()},onPointerDown(e,t){if(this.props.disabled)return;let n=this.elements(),r=n.viewport,i=t===`y`?n.verticalScrollbar:n.horizontalScrollbar,a=t===`y`?n.verticalThumb:n.horizontalThumb,o=t===`y`?this.overflowY:this.overflowX;if(!i||!a||!o)return;let s=t===`y`?i.clientHeight:i.clientWidth,c=t===`y`?a.offsetHeight:a.offsetWidth,l=t===`y`?Math.max(0,r.scrollHeight-r.clientHeight):Math.max(0,r.scrollWidth-r.clientWidth),u=t===`y`?r.scrollTop:ex(r);this.dragging={axis:t,pointerId:e.pointerId,startPointer:t===`y`?e.clientY:e.clientX,startScroll:u,trackLength:s,thumbLength:c,maxScroll:l};try{a.setPointerCapture?.(e.pointerId)}catch{}this.isScrolling=!0,this.clearFadeTimer(),this.sync()},onPointerMove(e){if(!this.dragging||this.dragging.pointerId!==e.pointerId)return;e.preventDefault();let t=this.elements().viewport,n=(this.dragging.axis===`y`?e.clientY:e.clientX)-this.dragging.startPointer,r=Math.max(1,this.dragging.trackLength-this.dragging.thumbLength),i=this.dragging.startScroll+n/r*this.dragging.maxScroll;this.dragging.axis===`y`?t.scrollTop=Zb(i,0,this.dragging.maxScroll):tx(t,i),this.schedulePositionSync()},onPointerUp(e){if(!this.dragging||this.dragging.pointerId!==e.pointerId)return;let t=this.elements(),n=this.dragging.axis===`y`?t.verticalThumb:t.horizontalThumb;try{n?.releasePointerCapture?.(e.pointerId)}catch{}this.dragging=null,this.startFadeTimer(),this.sync()}}),ox=e=>{e.data(`UiScrollArea`,()=>ax())},sx=G({definition:{component:`ui.badge`,parts:{root:{base:[`inline-flex min-w-0 shrink-0 select-none items-center justify-center gap-1 whitespace-nowrap font-medium outline-none`,`focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2 focus-visible:ring-offset-app`,`data-disabled:pointer-events-none data-disabled:opacity-50`],variants:{variant:{soft:`bg-base-a2 text-foreground-muted`,surface:`bg-surface text-foreground shadow-border`,outline:`border border-border bg-transparent text-foreground-muted`,solid:`bg-base-12 text-base-1 shadow-1`},color:{neutral:``,accent:``,success:``,warning:``,danger:``},size:{xs:`min-h-control-xs px-1.5 text-xs`,sm:`min-h-control-sm px-2 text-xs`,md:`min-h-control-md px-2.5 text-sm`,lg:`min-h-control-lg px-3 text-sm`,xlg:`min-h-control-xlg px-4 text-sm`},rounded:{true:`rounded-full`,false:`rounded-2`},insetLeft:{true:``,false:``},insetRight:{true:``,false:``},insetTop:{true:`-mt-1`,false:``},insetBottom:{true:`-mb-1`,false:``}},compounds:[{when:{variant:`soft`,color:`accent`},class:`bg-accent-surface text-accent-text`},{when:{variant:`soft`,color:`success`},class:`bg-success-surface text-success-text`},{when:{variant:`soft`,color:`warning`},class:`bg-warning-surface text-warning-text`},{when:{variant:`soft`,color:`danger`},class:`bg-danger-surface text-danger-text`},{when:{variant:`surface`,color:`accent`},class:`border border-accent-border bg-surface text-accent-text shadow-none`},{when:{variant:`surface`,color:`success`},class:`border border-success-border bg-surface text-success-text shadow-none`},{when:{variant:`surface`,color:`warning`},class:`border border-warning-border bg-surface text-warning-text shadow-none`},{when:{variant:`surface`,color:`danger`},class:`border border-danger-border bg-surface text-danger-text shadow-none`},{when:{variant:`outline`,color:`accent`},class:`border border-accent-border bg-transparent text-accent-text`},{when:{variant:`outline`,color:`success`},class:`border border-success-border bg-transparent text-success-text`},{when:{variant:`outline`,color:`warning`},class:`border border-warning-border bg-transparent text-warning-text`},{when:{variant:`outline`,color:`danger`},class:`border border-danger-border bg-transparent text-danger-text`},{when:{variant:`solid`,color:`accent`},class:`bg-accent-solid text-accent-contrast shadow-1`},{when:{variant:`solid`,color:`success`},class:`bg-success-solid text-success-contrast shadow-1`},{when:{variant:`solid`,color:`warning`},class:`bg-warning-solid text-warning-contrast shadow-1`},{when:{variant:`solid`,color:`danger`},class:`bg-danger-solid text-danger-contrast shadow-1`},{when:{insetLeft:!0,size:`xs`},class:`-ml-1.5`},{when:{insetLeft:!0,size:`sm`},class:`-ml-2`},{when:{insetLeft:!0,size:`md`},class:`-ml-2.5`},{when:{insetRight:!0,size:`xs`},class:`-mr-1.5`},{when:{insetRight:!0,size:`sm`},class:`-mr-2`},{when:{insetRight:!0,size:`md`},class:`-mr-2.5`}],defaults:{variant:`soft`,color:`neutral`,size:`sm`,rounded:!1,insetLeft:!1,insetRight:!1,insetTop:!1,insetBottom:!1}},label:{base:`contents`},icon:{base:`shrink-0 fill-current text-current`,variants:{size:{xs:`size-icon-xs`,sm:`size-icon-xs`,md:`size-icon-sm`,lg:`size-icon-sm`,xlg:`size-icon`},position:{leading:``,trailing:``}},defaults:{size:`sm`,position:`leading`}},close:{base:[`-mr-1 inline-flex shrink-0 items-center justify-center rounded-full text-current outline-none`,`hover:bg-current/10 focus-visible:bg-current/10`,`focus-visible:ring-1 focus-visible:ring-current data-disabled:pointer-events-none data-disabled:opacity-50`],variants:{size:{xs:`size-4`,sm:`size-4`,md:`size-5`,lg:`size-5`,xlg:`size-6`}},defaults:{size:`sm`}},closeIcon:{base:`size-icon-xs shrink-0 fill-current text-current`}}}}),cx=[`soft`,`surface`,`outline`,`solid`],lx=[`neutral`,`accent`,`success`,`warning`,`danger`],ux=mh,dx=[`span`,`button`],fx=_h,px=gh;W(cx,`soft`),W(lx,`neutral`),W(ux,`sm`),W(dx,`span`),W(fx,`button`),W(px,`mini`),W(fx,`button`),V.default(`close`),W(px,`mini`),W(ux,`sm`),V.default(`Remove`);var mx=[`listbox`,`combobox`,`pillbox`,`native`],hx=hh,gx=mh,_x=yh,vx=vh,yx=gh,bx={name:V,value:V,values:V,placeholder:V,mode:W(mx,`listbox`),multiple:U,searchable:U,filter:U.default(!0),clearable:U,clear:W([`stay`,`close`],`stay`),suffix:V.default(`selected`),mark:W([`check`,`checkbox`],`check`),open:U,disabled:U,readonly:U,required:U,invalid:U,autoHighlight:U.default(!0),loop:U.default(!0),path:V,size:W(gx,`lg`),variant:W(hx,`outline`),side:W(_x,`bottom`),align:W(vx,`start`),offset:H.clamp(-100,100).default(0),gap:H.clamp(0,50).default(4),empty:V.default(`No results found.`),searchPlaceholder:V.default(`Search...`),searchIcon:V.default(`search`),icon:V,iconTrailing:V.default(`chevron__down`),iconVariant:W(yx,`outline`),buttonClass:V,inputClass:V,searchClass:V,listboxClass:V,optionClass:V,chipVariant:W(cx,`soft`),chipColor:W(lx,`neutral`),chipClass:V,class:V};W(yx,`outline`),H.clamp(0,100).default(0);var xx=G({definition:{component:`ui.select`,parts:{root:{base:`relative inline-grid w-full min-w-0`},control:{base:[Th,Eh],variants:{size:Dh,variant:Oh,mode:{listbox:``,combobox:``,pillbox:`flex-wrap gap-1 py-1`,native:``},empty:{true:``,false:``}},compounds:[{when:{mode:`pillbox`,empty:!1},class:`!pl-1.5`}],defaults:{size:`lg`,variant:`outline`,mode:`listbox`,empty:!1}},button:{base:[`flex min-w-0 flex-1 items-center gap-2 border-0 bg-transparent p-0 text-left text-inherit outline-none`,`disabled:cursor-not-allowed`]},value:{base:`min-w-0 flex-1`},placeholder:{base:`min-w-0 flex-1 text-foreground`},input:{base:[`w-full min-w-16 flex-1`,kh]},search:{base:[`flex min-h-control-xlg shrink-0 items-center gap-2 border-b border-popover-border px-3`,`text-sm text-foreground`]},searchInput:{base:[`min-w-0 flex-1 text-sm`,kh]},chips:{base:`flex min-w-0 flex-wrap items-center gap-1`},chip:{base:[`max-w-64`]},chipLabel:{base:`block min-w-0 flex-1 truncate`},chipRemove:{base:``},icon:{base:`size-icon shrink-0 fill-current text-icon`,variants:{position:{leading:``,trailing:``}},defaults:{position:`leading`}},action:{base:Ah},popover:{base:[Mh,`max-h-combobox-listbox overflow-hidden`]},viewport:{base:`grid auto-rows-min content-start max-h-combobox-listbox gap-1 overflow-auto p-popover`},option:{base:Ph},optionLabel:{base:`min-w-0 flex-1`},optionMeta:{base:`ml-auto text-menu-item-muted`},optionIcon:{base:Fh,variants:{position:{leading:``,trailing:`ml-auto`}},defaults:{position:`leading`}},optionIndicator:{base:Ih},optionCheckbox:{base:[`ml-auto inline-flex size-icon-sm shrink-0 items-center justify-center rounded-1 border border-border bg-surface text-accent-contrast`,`data-selected:border-accent-solid data-selected:bg-accent-solid`]},group:{base:`grid auto-rows-min content-start gap-1`},label:{base:`px-menu-item-x py-1 text-menu-heading-fg`},empty:{base:`px-menu-item-x py-2 text-sm text-foreground-muted`},separatorRoot:{base:`-mx-popover my-popover h-px`},separatorRule:{base:`h-px w-full border-0 bg-menu-separator`},nativeWrapper:{base:`relative w-full min-w-0`},native:{base:[jh,`appearance-none pe-10`]},nativeIcon:{base:`pointer-events-none absolute right-3 top-1/2 size-icon -translate-y-1/2 fill-current text-icon`}}}}),Sx=`[data-ui-select-option], [data-ui-select-option-create]`,Cx=`template[data-ui-select-option-selected-template]`,wx=new WeakSet,Tx=(e,t)=>e.composedPath().some(e=>e instanceof Element&&e.matches(t)),Ex=e=>{if(!(e instanceof Element)){e.childNodes.forEach(e=>Ex(e));return}Array.from(e.attributes).forEach(t=>{let n=t.name;(n===`id`||n===`role`||n===`tabindex`||n.startsWith(`aria-selected`)||n.startsWith(`aria-disabled`)||n.startsWith(`data-ui-select-option`)||n.startsWith(`data-selected`)||n.startsWith(`data-highlighted`)||n.startsWith(`data-disabled`)||n.startsWith(`x-`)||n.startsWith(`@`)||n.startsWith(`:`)||n.startsWith(`on`))&&e.removeAttribute(n)}),e.childNodes.forEach(e=>Ex(e)),e.setAttribute(`x-ignore`,`true`)},Dx=e=>{let t=document.createDocumentFragment();return Array.from(e).forEach(e=>{if(e instanceof HTMLTemplateElement&&e.matches(Cx))return;let n=e.cloneNode(!0);Ex(n),t.append(n)}),t},Ox=()=>({isOpen:!1,search:``,selectedValues:[],selectedLabels:[],activeValue:``,inputSearching:!1,buttonId:``,inputId:``,listboxId:``,props:null,popover:null,popoverMotion:null,listeners:[],observer:null,renderedChipsKey:``,renderedHiddenInputsKey:``,init(){this.props=B({el:this.$el,schema:bx}),this.buttonId=this.$id(`select-button`),this.inputId=this.$id(`select-input`),this.listboxId=this.$id(`select-listbox`),this.isOpen=this.props.open&&!this.props.disabled&&!this.props.readonly;let e=this.options(),t=this.props.multiple?[...q.splitControlValues(this.props.values),...q.splitControlValues(this.props.value)]:q.splitControlValues(this.props.value).slice(0,1),n=e.filter(e=>q.asBool({value:e.el.dataset.selected})).map(e=>e.value);this.selectedValues=t.length>0?t:n,this.props.multiple||(this.selectedValues=this.selectedValues.slice(0,1)),this.selectedLabels=this.selectedValues.map(t=>e.find(e=>e.value===t)?.selectedLabel??t),this.popover=q.createAnchoredPopover({reference:()=>this.control(),floating:()=>this.popoverEl(),position:()=>this.props.side,align:()=>this.props.align,gap:()=>this.props.gap,offset:()=>this.props.offset,matchReferenceWidth:!0}),this.popoverMotion=q.motion.createPresenceLifecycle({element:()=>this.popoverEl(),preset:`popover`}),this.setup(),this.sync(),this.isOpen&&this.mount()},destroy(){this.props.disconnect(),this.popoverMotion?.destroy(),this.listeners.forEach(e=>e()),this.listeners=[],this.observer?.disconnect(),this.unmount()},get root(){return q.props({inputs:[K({part:xx.parts.root,props:this.props,className:this.props.class}),{"data-ui-select":``,":data-state":()=>this.isOpen?`open`:`closed`,":data-disabled":()=>this.props.disabled?`true`:void 0,":data-invalid":()=>this.props.invalid?`true`:void 0}]})},control(){let e=this.$el.querySelector(`[data-ui-select-control]`);if(!e)throw Error(`Select requires a control element.`);return e},trigger(){let e=this.$el.querySelector(`[data-ui-select-trigger], [data-ui-select-button], [data-ui-select-input]`);if(!e)throw Error(`Select requires a trigger element.`);return e},input(){return this.$el.querySelector(`[data-ui-select-input]`)},searchInput(){return this.$el.querySelector(`[data-ui-select-search-input]`)},popoverEl(){let e=this.$el.querySelector(`[data-ui-select-popover]`);if(!e)throw Error(`Select requires a popover element.`);return e},listbox(){let e=this.$el.querySelector(`[data-ui-select-listbox]`);if(!e)throw Error(`Select requires a listbox element.`);return e},chipsEl(){return this.$el.querySelector(`[data-ui-select-chips]`)},hiddenInputsEl(){return this.$el.querySelector(`[data-ui-select-hidden-inputs]`)},options(){let e=q.normalizeOptionText(this.search),t=Array.from(this.$el.querySelectorAll(Sx)).map((t,n)=>{let r=this.resolveOptionLabel(t),i=this.optionValue(t,r),a=this.resolveSelectedLabel(t,r),o=q.asBool({value:t.dataset.disabled}),s=this.selectedValues.includes(i),c=t.hasAttribute(`data-ui-select-option-create`),l=!this.props.filter||e===``||q.normalizeOptionText(`${r} ${t.dataset.suffix??``}`).includes(e),u=e!==``&&q.normalizeOptionText(r)===e,d=Number(t.dataset.minLength??`0`),f=c?e.length>=d&&!u:l;return{el:t,id:t.id||`${this.listboxId}-option-${n}`,value:i,label:r,selectedLabel:a,disabled:o,selected:s,visible:f,create:c}}),n=t.some(t=>!t.create&&q.normalizeOptionText(t.label)===e);return t.map(e=>e.create&&n?{...e,visible:!1}:e)},enabledVisibleOptions(){return this.options().filter(e=>e.visible&&!e.disabled)},hasSelection(){return this.selectedValues.length>0},hasClearValue(){return this.search.length>0||this.hasSelection()},isPillbox(){return this.props.mode===`pillbox`&&this.props.multiple},controlLayoutMode(){return this.isPillbox()?`pillbox`:this.props.mode===`combobox`?`combobox`:`listbox`},selectedSummary(){return!this.hasSelection()||this.isPillbox()?``:this.props.multiple&&this.selectedValues.length>1?`${this.selectedValues.length} ${this.props.suffix}`:this.selectedLabels[0]??this.selectedValues[0]??``},openSelect(e){if(e?.preventDefault(),this.props.disabled||this.props.readonly)return;let t=this.isOpen;this.isOpen=!0,this.props.autoHighlight&&!this.activeValue&&this.setActive(this.enabledVisibleOptions()[0]??null),this.sync(),t||this.popoverMotion?.enter({before:()=>{let e=this.popoverEl();e.hidden=!1,e.showPopover?.(),this.mount()}});let n=this.searchInput();this.props.searchable&&n&&n.focus({preventScroll:!0}),q.dispatch({el:this.$el,name:`ui:open`})},closeSelect(e){e?.preventDefault();let t=this.isOpen;this.isOpen=!1,this.activeValue=``,this.search=``,this.inputSearching=!1,this.sync(),t&&this.popoverMotion?.exit({before:()=>{let e=this.popoverEl();e.dataset.state=`closed`,e.hidden=!1},after:()=>{this.isOpen||(this.popoverEl().hidePopover?.(),this.unmount(),this.syncListbox(),q.dispatch({el:this.$el,name:`ui:close`}))}})},toggle(e){if(e?.preventDefault(),this.isOpen){this.closeSelect();return}this.openSelect()},clear(e){e?.preventDefault(),e?.stopPropagation(),!(this.props.disabled||this.props.readonly)&&(this.search=``,this.inputSearching=!1,this.selectedValues=[],this.selectedLabels=[],this.activeValue=``,this.props.clear===`close`?this.closeSelect(e):this.sync(),q.dispatchNativeControlChange({container:this.hiddenInputsEl(),fallback:this.$el,marker:`data-ui-select-hidden-input`}),q.dispatch({el:this.$el,name:`ui:clear`}),q.dispatch({el:this.$el,name:`ui:change`,detail:{value:``,values:[],labels:[]}}))},select(e,t){let n=typeof e==`string`?this.options().find(t=>t.value===e):e;n&&this.selectOption(n,t)},deselect(e,t){if(t?.preventDefault(),this.props.disabled||this.props.readonly)return;let n=this.options();n.find(t=>t.value===e)?.disabled||(this.selectedValues=this.selectedValues.filter(t=>t!==e),this.selectedLabels=this.selectedValues.map(e=>n.find(t=>t.value===e)?.selectedLabel??e),this.sync(),q.dispatchNativeControlChange({container:this.hiddenInputsEl(),fallback:this.$el,marker:`data-ui-select-hidden-input`}),q.dispatch({el:this.$el,name:`ui:change`,detail:{value:this.selectedValues[0]??``,values:[...this.selectedValues],labels:[...this.selectedLabels]}}))},removeLastValue(e){if(!this.isPillbox()||this.search!==``||this.selectedValues.length===0)return;let t=this.options(),n=[...this.selectedValues].reverse().find(e=>!t.find(t=>t.value===e)?.disabled);n&&(e?.preventDefault(),this.deselect(n,e))},setSearch(e){this.props.disabled||this.props.readonly||(this.search=e,this.isOpen||=!0,this.props.autoHighlight&&this.focusFirst(),this.sync(),q.dispatch({el:this.$el,name:`ui:search`,detail:{search:this.search}}))},refreshOptions(){this.syncOptions(),this.syncTrigger()},selectOption(e,t){if(t?.preventDefault(),this.props.disabled||this.props.readonly||e.disabled)return;let n=this.isOpen;if(e.create){q.dispatch({el:this.$el,name:`ui:create`,detail:{search:this.search,value:e.value||this.search}}),this.closeSelect();return}if(this.props.multiple){this.selectedValues.includes(e.value)?this.selectedValues=this.selectedValues.filter(t=>t!==e.value):this.selectedValues=[...this.selectedValues,e.value];let t=this.options();this.selectedLabels=this.selectedValues.map(e=>t.find(t=>t.value===e)?.selectedLabel??e),this.search=``,this.inputSearching=!1,this.isOpen=!0}else this.selectedValues=[e.value],this.selectedLabels=[e.selectedLabel],this.search=``,this.inputSearching=!1,this.isOpen=!1;this.sync(),n&&!this.isOpen&&this.popoverMotion?.exit({before:()=>{let e=this.popoverEl();e.dataset.state=`closed`,e.hidden=!1},after:()=>{this.isOpen||(this.popoverEl().hidePopover?.(),this.unmount(),this.syncListbox(),q.dispatch({el:this.$el,name:`ui:close`}))}}),q.dispatchNativeControlChange({container:this.hiddenInputsEl(),fallback:this.$el,marker:`data-ui-select-hidden-input`}),q.dispatch({el:this.$el,name:`ui:change`,detail:{value:this.selectedValues[0]??``,values:[...this.selectedValues],label:this.selectedLabels[0]??``,labels:[...this.selectedLabels],option:e.el}})},setActive(e){(e?.value??``)!==this.activeValue&&(this.activeValue=e?.value??``,this.syncOptions(),this.syncInputs(),q.dispatch({el:this.$el,name:`ui:highlight`,detail:{value:this.activeValue,option:e?.el??null}}))},moveActive(e){let t=this.enabledVisibleOptions();if(t.length===0)return;let n=t.findIndex(e=>e.value===this.activeValue),r=n+e;n<0&&(r=e>0?0:t.length-1),r>=t.length&&(r=this.props.loop?0:t.length-1),r<0&&(r=this.props.loop?t.length-1:0),this.setActive(t[r]??null)},focusFirst(){this.setActive(this.enabledVisibleOptions()[0]??null)},focusLast(){let e=this.enabledVisibleOptions();this.setActive(e[e.length-1]??null)},handleSearchInput(e){let t=e.target;t instanceof HTMLInputElement&&this.setSearch(t.value)},handleInput(e){let t=e.target;t instanceof HTMLInputElement&&(this.inputSearching=!0,this.setSearch(t.value))},handleKeydown(e){if(e.key===`ArrowDown`){e.preventDefault(),this.isOpen||this.openSelect(),this.moveActive(1);return}if(e.key===`ArrowUp`){e.preventDefault(),this.isOpen||this.openSelect(),this.moveActive(-1);return}if(this.isOpen&&e.key===`Home`){e.preventDefault(),this.focusFirst();return}if(this.isOpen&&e.key===`End`){e.preventDefault(),this.focusLast();return}if((e.key===`Enter`||e.key===` `)&&this.isOpen&&this.activeValue){let t=this.options().find(e=>e.value===this.activeValue);t&&this.selectOption(t,e);return}if((e.key===`Backspace`||e.key===`Delete`)&&this.isPillbox()&&this.search===``){let t=this.input();(!t||t.selectionStart===0&&t.selectionEnd===0)&&this.removeLastValue(e);return}e.key===`Escape`&&this.isOpen&&(this.closeSelect(e),this.trigger().focus({preventScroll:!0}))},handleFocusout(e){let t=e.relatedTarget;if(!(t instanceof Node)){this.closeSelect();return}this.$el.contains(t)||this.popoverEl().contains(t)||this.closeSelect()},sync(){this.syncRoot(),this.syncControl(),this.syncTrigger(),this.syncInputs(),this.syncListbox(),this.syncOptions(),this.syncChips(),this.syncHiddenInputs()},syncRoot(){this.$el.dataset.state=this.isOpen?`open`:`closed`,q.syncControlPresence({el:this.$el,state:{disabled:this.props.disabled,required:this.props.required,invalid:this.props.invalid},value:`true`})},syncControl(){let e=this.control();e.setAttribute(`class`,K({part:xx.parts.control,props:{...this.props,mode:this.controlLayoutMode(),empty:this.isPillbox()&&!this.hasSelection()}})),e.dataset.state=this.isOpen?`open`:`closed`,e.dataset.mode=this.controlLayoutMode(),q.setPresence({el:e,attr:`data-ui-select-pillbox-control`,present:this.isPillbox(),value:``}),q.setPresence({el:e,attr:`data-empty`,present:this.isPillbox()&&!this.hasSelection(),value:`true`}),q.syncControlPresence({el:e,state:{disabled:this.props.disabled,invalid:this.props.invalid},value:`true`})},syncTrigger(){let e=this.trigger();e.id||=this.buttonId,e.dataset.state=this.isOpen?`open`:`closed`,e.setAttribute(`aria-haspopup`,`listbox`),e.setAttribute(`aria-expanded`,this.isOpen?`true`:`false`),e.setAttribute(`aria-controls`,this.listboxId),this.props.invalid?e.setAttribute(`aria-invalid`,`true`):e.removeAttribute(`aria-invalid`),this.props.disabled?e.setAttribute(`disabled`,``):e.removeAttribute(`disabled`);let t=this.selectedSummary(),n=this.$el.querySelector(`[data-ui-select-button-value]`),r=this.$el.querySelector(`[data-ui-select-button-placeholder]`);if(n){n.replaceChildren();let e=(!this.props.multiple||this.selectedValues.length===1)&&t?this.selectedOption():null;e?n.append(this.selectedContent(e)):n.textContent=t,n.hidden=t===``}r&&(r.hidden=t!==``),this.$el.querySelectorAll(`[data-ui-select-clear], [data-ui-select-button-clear], [data-ui-select-search-clear]`).forEach(e=>{e.hidden=this.props.disabled||!this.props.clearable||!this.hasClearValue(),e instanceof HTMLButtonElement&&(e.disabled=this.props.disabled)})},syncInputs(){let e=this.input();if(e){e.id||=this.inputId;let t=this.selectedSummary();e.className=K({part:xx.parts.input,className:this.props.inputClass}),this.isPillbox()?(e.value=this.search,e.placeholder=this.hasSelection()?``:this.props.placeholder):(e.value=this.isOpen&&this.inputSearching?this.search:t,e.placeholder=this.props.placeholder),e.setAttribute(`role`,`combobox`),e.setAttribute(`autocomplete`,`off`),e.setAttribute(`aria-autocomplete`,`list`),e.setAttribute(`aria-expanded`,this.isOpen?`true`:`false`),e.setAttribute(`aria-controls`,this.listboxId),q.syncNativeControl({input:e,state:{disabled:this.props.disabled,readonly:this.props.readonly,required:this.props.required,nativeRequired:!1,invalid:this.props.invalid,ariaRequired:this.props.required}})}let t=this.searchInput();t&&(t.value=this.search,t.disabled=this.props.disabled);let n=this.options().find(e=>e.value===this.activeValue)?.id??``;[e,t].forEach(e=>{e&&(n?e.setAttribute(`aria-activedescendant`,n):e.removeAttribute(`aria-activedescendant`))})},syncListbox(){let e=this.popoverEl(),t=this.listbox();e.id=`${this.listboxId}-popover`,e.setAttribute(`class`,K({part:xx.parts.popover,props:this.props,className:this.props.listboxClass})),e.setAttribute(`popover`,`manual`),e.dataset.state=this.isOpen?`open`:`closed`,e.hidden=!this.isOpen,t.id=this.listboxId,t.setAttribute(`role`,`listbox`),t.setAttribute(`tabindex`,`-1`),t.setAttribute(`aria-labelledby`,this.trigger().id),this.props.multiple?t.setAttribute(`aria-multiselectable`,`true`):t.removeAttribute(`aria-multiselectable`)},syncOptions(){let e=this.options(),t=this.$el.querySelector(`[data-ui-select-option-empty]`),n=e.some(e=>e.visible&&!e.create);e.forEach(e=>{e.el.id=e.id,e.el.hidden=!e.visible,e.el.setAttribute(`role`,`option`),e.el.setAttribute(`aria-selected`,e.selected?`true`:`false`),e.el.dataset.value=e.value,e.el.dataset.label=e.label,q.setPresence({el:e.el,attr:`data-selected`,present:e.selected,value:`true`}),q.setPresence({el:e.el,attr:`data-highlighted`,present:e.value===this.activeValue,value:`true`}),q.setPresence({el:e.el,attr:`data-disabled`,present:e.disabled,value:`true`}),e.el.querySelectorAll(`[data-ui-select-option-indicator]`).forEach(t=>{q.setPresence({el:t,attr:`data-selected`,present:e.selected,value:`true`})}),e.disabled?e.el.setAttribute(`aria-disabled`,`true`):e.el.removeAttribute(`aria-disabled`)}),t&&(t.hidden=n)},syncChips(){let e=this.chipsEl();if(!e)return;let t=!this.isPillbox()||this.selectedValues.length===0;e.hidden=t;let n=this.options(),r=this.selectedValues.map((e,t)=>{let r=n.find(t=>t.value===e);return{value:e,label:this.selectedLabels[t]??r?.selectedLabel??e,disabled:r?.disabled??!1}}),i=JSON.stringify({hidden:t,chips:r,disabled:this.props.disabled,readonly:this.props.readonly,chipVariant:this.props.chipVariant,chipColor:this.props.chipColor,chipClass:this.props.chipClass});if(i===this.renderedChipsKey||(this.renderedChipsKey=i,e.replaceChildren(),e.hidden))return;let a=K({part:sx.parts.root,props:{variant:this.props.chipVariant,color:this.props.chipColor,size:`sm`,rounded:!1},className:K({part:xx.parts.chip,props:{},className:this.props.chipClass})}),o=K({part:xx.parts.chipLabel}),s=K({part:sx.parts.close,props:{size:`sm`},className:K({part:xx.parts.chipRemove})});r.forEach(t=>{let n=document.createElement(`span`);n.className=a,n.setAttribute(`data-ui-badge`,``),n.setAttribute(`data-ui-select-chip`,``),n.dataset.variant=this.props.chipVariant,n.dataset.color=this.props.chipColor,n.dataset.size=`sm`,n.dataset.value=t.value,q.setPresence({el:n,attr:`data-disabled`,present:t.disabled,value:`true`});let r=document.createElement(`span`);r.className=o,r.setAttribute(`data-ui-badge-label`,``),r.setAttribute(`data-ui-select-chip-label`,``),r.textContent=t.label,n.append(r);let i=document.createElement(`button`);i.type=`button`,i.className=s,i.setAttribute(`data-ui-badge-close`,``),i.setAttribute(`data-ui-select-chip-remove`,``),i.setAttribute(`aria-label`,`Remove ${t.label}`),i.disabled=this.props.disabled||this.props.readonly||t.disabled,q.setPresence({el:i,attr:`data-disabled`,present:i.disabled,value:`true`}),i.disabled&&i.setAttribute(`aria-disabled`,`true`);let c=this.$el.querySelector(`[data-ui-select-chip-remove-icon]`);c?(i.append(c.content.cloneNode(!0)),i.querySelectorAll(`[aria-hidden="true"]`).forEach(e=>{e.setAttribute(`data-ui-badge-close-icon`,``)})):i.textContent=`x`,i.addEventListener(`click`,e=>this.deselect(t.value,e)),n.append(i),e.append(n)})},syncHiddenInputs(){let e=this.hiddenInputsEl();e&&(this.renderedHiddenInputsKey=q.syncRepeatedHiddenInputs({container:e,state:{name:this.props.name,required:this.props.required,values:this.selectedValues,form:this.$el.dataset.form??``,marker:`data-ui-select-hidden-input`},currentKey:this.renderedHiddenInputsKey}))},mount(){this.popover?.mount()},unmount(){this.popover?.unmount()},setup(){let e=this.control(),t=this.trigger(),n=this.popoverEl(),r=this.listbox(),i=this.input(),a=this.searchInput();q.addListener({target:t,event:`click`,handler:e=>{wx.add(e);let n=e.target;if(n instanceof Element&&n.closest(`[data-ui-select-clear], [data-ui-select-button-clear]`)){this.clear(e);return}if(!(n instanceof Element&&n.closest(`[data-ui-select-chip-remove]`))){if(this.trigger().focus({preventScroll:!0}),t instanceof HTMLInputElement){this.isOpen||this.openSelect(e);return}this.toggle(e)}},cleanup:this.listeners}),q.addListener({target:t,event:`keydown`,handler:e=>{e instanceof KeyboardEvent&&this.handleKeydown(e)},cleanup:this.listeners}),q.addListener({target:e,event:`pointerdown`,handler:e=>{let t=e.target;t instanceof Element&&t.closest(`[data-ui-select-icon="trailing"]`)&&e.preventDefault()},cleanup:this.listeners}),q.addListener({target:e,event:`click`,handler:e=>{let n=e.target;if(!(n instanceof Element))return;if(n.closest(`[data-ui-select-clear], [data-ui-select-button-clear]`)){this.clear(e);return}if(n.closest(`[data-ui-select-chip-remove]`))return;if(Tx(e,`[data-ui-select-trigger]`)){if(wx.has(e))return;if(this.trigger().focus({preventScroll:!0}),t instanceof HTMLInputElement){this.isOpen||this.openSelect(e);return}this.toggle(e);return}if(n.closest(`[data-ui-select-icon="trailing"]`)){let t=this.isOpen;this.trigger().focus({preventScroll:!0}),t?this.closeSelect(e):this.openSelect(e);return}if(this.isPillbox()){this.trigger().focus({preventScroll:!0}),this.isOpen||this.openSelect(e);return}let r=this.isOpen;this.trigger().focus({preventScroll:!0}),r?this.closeSelect(e):this.openSelect(e)},cleanup:this.listeners}),i&&(q.addListener({target:i,event:`focus`,handler:()=>this.openSelect(),cleanup:this.listeners}),q.addListener({target:i,event:`input`,handler:e=>this.handleInput(e),cleanup:this.listeners})),a&&(q.addListener({target:a,event:`input`,handler:e=>this.handleSearchInput(e),cleanup:this.listeners}),q.addListener({target:a,event:`keydown`,handler:e=>{e instanceof KeyboardEvent&&this.handleKeydown(e)},cleanup:this.listeners})),q.addListener({target:this.$el,event:`focusout`,handler:e=>{e instanceof FocusEvent&&this.handleFocusout(e)},cleanup:this.listeners}),q.addListener({target:n,event:`pointerdown`,handler:e=>{let t=e.target;t instanceof Element&&t.closest(Sx)&&e.preventDefault()},cleanup:this.listeners}),q.addListener({target:n,event:`click`,handler:e=>{let t=e.target;if(!(t instanceof Element))return;if(t.closest(`[data-ui-select-search-clear]`)){this.setSearch(``);return}let n=t.closest(Sx),r=n?this.options().find(e=>e.el===n):void 0;r&&this.selectOption(r,e)},cleanup:this.listeners}),q.addListener({target:n,event:`pointermove`,handler:e=>{let t=e.target;if(!(t instanceof Element))return;let n=t.closest(Sx),r=n?this.options().find(e=>e.el===n):void 0;r&&!r.disabled&&this.setActive(r)},cleanup:this.listeners}),q.addListener({target:n,event:`pointerleave`,handler:()=>{this.setActive(null)},cleanup:this.listeners}),this.listeners.push(q.addDismissableLayer({isEnabled:()=>this.isOpen,roots:()=>[this.$el,n],onDismiss:()=>this.closeSelect()})),this.observer=new MutationObserver(()=>{this.sync(),this.props.autoHighlight&&this.isOpen&&!this.activeValue&&this.focusFirst()}),this.observer.observe(r,{childList:!0,subtree:!0})},selectedOption(){let e=this.selectedValues[0]??``;return e?this.options().find(t=>t.value===e)??null:null},selectedContent(e){let t=e.el.querySelector(Cx);if(t)return Dx(t.content.childNodes);let n=e.el.querySelector(`[data-ui-select-option-selected-content]`)??e.el.querySelector(`[data-ui-select-option-label]`);if(n)return Dx(n.childNodes);let r=document.createDocumentFragment();return r.append(document.createTextNode(e.selectedLabel)),r},resolveOptionLabel(e){let t=e.dataset.label||e.getAttribute(`aria-label`)||``;if(t)return t;let n=e.dataset.textValue??``;if(n)return n;let r=q.parseItemData(e.dataset.item),i=q.getPathValue(r,this.props.path);return i==null?(e.querySelector(`[data-ui-select-option-label]`)?.textContent??e.textContent??``).trim():String(i)},resolveSelectedLabel(e,t){return e.dataset.selectedLabel||t},optionValue(e,t){return e.dataset.value||t}}),kx=e=>{e.data(`UiSelect`,()=>Ox())},Ax=[`left`,`right`],jx=[`none`,`mobile`,`desktop`,`both`],Mx=[`toggle`,`open`,`close`,`stash`,`expand`],Nx=[`a`,`button`],Px=[`ghost`,`surface`],Fx=[`neutral`,`accent`],Ix={id:V.default(`ui-sidebar`),side:W(Ax,`left`),sticky:U.default(!0),collapse:W(jx,`mobile`),open:U,stashed:U,persist:U.default(!0),width:V.default(`16rem`),minWidth:V.default(`12rem`),maxWidth:V.default(`28rem`),mobile:V.default(`18rem`),breakpoint:V.default(`lg`),edgeReveal:U.default(!0),resizable:U,class:V};W(Nx,`a`),W(Px,`ghost`),W(Fx,`neutral`),U.default(!0);var Lx={target:V,icon:V.default(`side_panel`),label:V.default(`Toggle sidebar`),action:W(Mx,`toggle`),class:V},Rx=G({definition:{component:`ui.sidebar`,parts:{root:{base:[`fixed inset-y-0 z-dialog flex min-h-0 w-[var(--ui-sidebar-mobile-width)] flex-col overflow-hidden`,`border-base-a3 bg-surface-muted text-foreground shadow-2 outline-none`,`data-[mobile-state=closed]:-translate-x-full data-[mobile-state=open]:translate-x-0`,`lg:top-0 lg:z-auto lg:w-[var(--ui-sidebar-width)] lg:translate-x-0 lg:data-[mobile-state=closed]:translate-x-0 lg:data-[mobile-state=open]:translate-x-0 lg:shadow-none`,`lg:data-[desktop-state=stashed]:data-[drawer-state=closed]:data-[sidebar-exiting=false]:hidden`,`lg:data-[desktop-state=stashed]:data-[drawer-state=open]:fixed lg:data-[desktop-state=stashed]:data-[drawer-state=open]:inset-y-2`,`lg:data-[desktop-state=stashed]:data-[drawer-state=open]:z-dialog lg:data-[desktop-state=stashed]:data-[drawer-state=open]:h-auto lg:data-[desktop-state=stashed]:data-[drawer-state=open]:rounded-4 lg:data-[desktop-state=stashed]:data-[drawer-state=open]:border lg:data-[desktop-state=stashed]:data-[drawer-state=open]:shadow-2`,`[grid-area:sidebar]`],variants:{side:{left:`left-0 border-r lg:left-auto lg:data-[desktop-state=stashed]:data-[drawer-state=open]:left-2`,right:`right-0 border-l data-[mobile-state=closed]:translate-x-full data-[mobile-state=open]:translate-x-0 lg:right-auto lg:data-[desktop-state=stashed]:data-[drawer-state=open]:right-2`},sticky:{true:`lg:sticky lg:h-screen`,false:`lg:relative lg:h-auto lg:data-[sticky=false]:relative lg:data-[sticky=False]:relative lg:data-[sticky=false]:h-auto lg:data-[sticky=False]:h-auto`}},defaults:{side:`left`,sticky:!0}},header:{base:`flex min-h-control-xlg shrink-0 items-center gap-2 px-3 py-2`},content:{base:[`min-h-0 flex-1 overflow-hidden`]},contentInner:{base:[`grid min-w-0 content-start gap-1 px-2 py-2`,`[&>[data-ui-separator]]:-mx-2 [&>[data-ui-separator]]:w-auto`]},footer:{base:`grid shrink-0 gap-1 px-2 py-2`},nav:{base:`grid gap-1`},item:{base:[`group/sidebar-item flex h-control-md w-full min-w-0 items-center gap-2 rounded-3 px-2`,`border border-transparent text-left text-sm font-medium text-foreground outline-none`,Nh,`focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2 focus-visible:ring-offset-app`,`data-disabled:pointer-events-none data-disabled:opacity-50`],variants:{variant:{ghost:``,surface:`data-current:border-transparent data-current:shadow-none`},color:{neutral:`[--color-interactive-selected:var(--color-base-a3)] [--color-interactive-selected-hover:var(--color-base-a4)]`,accent:`[--color-interactive-selected:var(--color-accent-surface)] [--color-interactive-selected-hover:var(--color-accent-surface-hover)]`},withActions:{true:`pr-9`,false:``}},defaults:{variant:`ghost`,color:`neutral`,withActions:!1}},itemRow:{base:`group/sidebar-item-row relative min-w-0`},itemIcon:{base:`size-icon-xs shrink-0 fill-current text-icon`,variants:{position:{leading:``,trailing:`ml-auto`}},defaults:{position:`leading`}},itemLabel:{base:`min-w-0 flex-1`},itemBadge:{base:`ml-auto shrink-0 rounded-2 bg-base-a3 px-1.5 py-0.5 text-xs text-foreground-muted`},itemActions:{base:`absolute right-1 top-1/2 z-10 flex -translate-y-1/2 items-center gap-1`},group:{base:`relative grid gap-1`},groupSummary:{base:[`block h-control-md cursor-pointer list-none rounded-3 text-xs font-medium text-foreground-muted outline-none`,`hover:bg-base-a2 hover:text-foreground focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2 focus-visible:ring-offset-app`,`[&::-webkit-details-marker]:hidden`],variants:{hasActions:{true:``,false:``}},defaults:{hasActions:!1}},groupSummaryInner:{base:`flex h-full min-w-0 items-center gap-2 px-2`},groupHeading:{base:`flex min-h-control-md min-w-0 items-center gap-2 px-2 py-1`},groupIcon:{base:`size-icon-xs shrink-0 fill-current text-icon group-open/sidebar-group:rotate-90`},groupLabel:{base:`min-w-0 flex-1`},groupHeadingLabel:{base:`min-w-0 flex-1`},groupActions:{base:`ml-auto flex shrink-0 items-center gap-1`},groupContent:{base:`grid gap-1`},toggle:{base:[`inline-flex h-control-md w-control-md shrink-0 items-center justify-center rounded-3 text-foreground-muted outline-none`,`hover:bg-base-a2 hover:text-foreground focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2 focus-visible:ring-offset-app`]},toggleIcon:{base:`size-icon fill-current text-current`},edge:{base:[`fixed inset-y-0 z-30 hidden w-2 bg-transparent outline-none lg:block`,`focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2 focus-visible:ring-offset-app`,`data-[state=hidden]:hidden`],variants:{side:{left:`left-0`,right:`right-0`}},defaults:{side:`left`}},resizeHandle:{base:[`absolute inset-y-0 z-10 hidden w-3 cursor-col-resize touch-none border-transparent outline-none lg:block`,`hover:border-border-interactive`,`focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2 focus-visible:ring-offset-app`,`data-disabled:hidden`],variants:{side:{left:`right-0 border-r`,right:`left-0 border-l`}},defaults:{side:`left`}}}}}),zx={target:Lx.target,action:Lx.action,class:Lx.class},Bx={target:Lx.target,action:Lx.action,class:Lx.class},Vx=new Set,Hx={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},Ux=(e,t)=>!t?.id||t.id===e.id,Wx=e=>{let t=Hx[e];return t?`(min-width: ${t}px)`:/^\d+$/.test(e)?`(min-width: ${e}px)`:/^\d+(\.\d+)?(px|rem|em)$/.test(e)?`(min-width: ${e})`:`(min-width: ${Hx.lg}px)`},Gx=e=>e instanceof CustomEvent&&typeof e.detail==`object`&&e.detail!==null?e.detail:{},Kx=e=>e.target instanceof Element&&e.target.hasAttribute(`data-ui-sidebar`),qx=(e,t)=>{if(Kx(e))return;let n=Gx(e);Vx.forEach(e=>{Ux(e,n)&&e.perform(n.action??t,n.trigger??null)})},Jx=(()=>{let e=!1;return()=>{e||typeof document>`u`||(document.addEventListener(`ui:sidebar-open`,e=>qx(e,`open`)),document.addEventListener(`ui:sidebar-close`,e=>qx(e,`close`)),document.addEventListener(`ui:sidebar-toggle`,e=>qx(e,`toggle`)),e=!0)}})(),Yx=()=>({props:null,mobileOpen:!1,desktopStashed:!1,desktopDrawerOpen:!1,drawerExiting:!1,sidebarExiting:!1,sidebarExitFreezeCleanup:null,drawerMotionRun:0,drawerMotionPhase:null,desktopMode:!1,renderedExpanded:!1,renderedDrawerOpen:!1,lastPointer:null,activeTrigger:null,currentWidth:`16rem`,cleanup:[],drawerMotion:null,backdropMotion:null,hasScrollLock:!1,mediaQuery:null,get id(){return this.$el.id||this.props.id||`ui-sidebar`},init(){Jx(),this.props=B({el:this.$el,schema:Ix});let e=this.storedStashed();this.currentWidth=this.props.width,this.mobileOpen=this.props.open,this.desktopStashed=e??this.props.stashed,this.mediaQuery=window.matchMedia(Wx(this.props.breakpoint)),this.desktopMode=this.isDesktop(),this.drawerMotion=q.motion.createPresenceLifecycle({element:()=>this.$el,preset:`sidebar`}),this.backdropMotion=q.motion.createPresenceLifecycle({element:()=>this.backdropEl(),preset:`fade`}),Vx.add(this),q.addListener({target:this.mediaQuery,event:`change`,handler:()=>this.handleBreakpointChange(),cleanup:this.cleanup}),q.addListener({target:document,event:`keydown`,handler:e=>{e instanceof KeyboardEvent&&e.key===`Escape`&&this.hasOpenDrawer()&&this.close()},cleanup:this.cleanup}),q.addListener({target:document,event:`pointermove`,handler:e=>this.handlePointerMove(e),cleanup:this.cleanup}),q.addListener({target:document,event:`mousemove`,handler:e=>this.handlePointerMove(e),cleanup:this.cleanup});let t=this.backdropEl();t&&(q.addListener({target:t,event:`pointerenter`,handler:e=>this.closeTemporaryDrawer(null,e),cleanup:this.cleanup}),q.addListener({target:t,event:`mouseenter`,handler:e=>this.closeTemporaryDrawer(null,e),cleanup:this.cleanup}),q.addListener({target:t,event:`pointermove`,handler:e=>this.closeTemporaryDrawer(null,e),cleanup:this.cleanup}),q.addListener({target:t,event:`mousemove`,handler:e=>this.closeTemporaryDrawer(null,e),cleanup:this.cleanup})),q.addListener({target:this.$el,event:`ui:resize`,handler:e=>this.handleResize(e),cleanup:this.cleanup}),q.addListener({target:this.$el,event:`ui:resize-end`,handler:e=>this.handleResize(e),cleanup:this.cleanup}),this.cleanup.push(q.addDismissableLayer({isEnabled:()=>this.hasOpenDrawer(),roots:()=>[this.$el,this.activeTrigger],onDismiss:()=>this.close()})),this.setupGroups(),this.syncAll()},destroy(){this.props.disconnect(),this.drawerMotion?.destroy(),this.backdropMotion?.destroy(),this.clearSidebarExitFreeze(),Vx.delete(this),this.cleanup.forEach(e=>e()),this.cleanup=[],this.hasScrollLock&&=(ph(),!1)},get root(){return q.props({inputs:[q.resolveStyle({part:Rx.parts.root,props:this.props,className:this.props.class}),{"data-ui-sidebar":``,"@pointerleave":e=>this.closeTemporaryDrawer(null,e),"@mouseleave":e=>this.closeTemporaryDrawer(null,e)}]})},isDesktop(){return this.mediaQuery?.matches??!1},isMobileCollapsible(){return this.props.collapse===`mobile`||this.props.collapse===`both`},isDesktopCollapsible(){return this.props.collapse===`desktop`||this.props.collapse===`both`},hasOpenDrawer(){return this.isDesktop()?this.desktopStashed&&this.desktopDrawerOpen:this.mobileOpen},isExpanded(){return this.isDesktop()?!this.desktopStashed||this.desktopDrawerOpen:this.mobileOpen},perform(e,t){if(e===`expand`){this.activeTrigger=t??this.activeTrigger;let e=this.hasOpenDrawer();if(this.drawerExiting=!1,this.sidebarExiting=!1,this.clearSidebarExitFreeze(),this.drawerMotionRun+=1,this.isDesktop()&&this.isDesktopCollapsible()){let t=this.desktopStashed;this.desktopStashed=!1,this.desktopDrawerOpen=!1,this.syncAll(),t&&!e&&this.drawerMotion?.enter({before:()=>{this.$el.hidden=!1}})}else !this.isDesktop()&&this.isMobileCollapsible()&&(this.mobileOpen=!0),this.syncAll();!e&&this.hasOpenDrawer()&&this.animateDrawerEnter(),q.dispatch({el:this.$el,name:`ui:sidebar-open`,detail:{id:this.id}});return}if(e===`open`){this.open(t);return}if(e===`close`||e===`stash`){this.close(t);return}this.toggle(t)},open(e){this.activeTrigger=e??this.activeTrigger;let t=this.hasOpenDrawer();this.drawerExiting=!1,this.sidebarExiting=!1,this.clearSidebarExitFreeze(),this.drawerMotionRun+=1,this.isDesktop()?this.isDesktopCollapsible()&&(this.desktopStashed?this.desktopDrawerOpen=!0:this.desktopStashed=!1):this.isMobileCollapsible()&&(this.mobileOpen=!0),this.syncAll(),!t&&this.hasOpenDrawer()&&this.animateDrawerEnter(),q.dispatch({el:this.$el,name:`ui:sidebar-open`,detail:{id:this.id}})},close(e){this.activeTrigger=e??this.activeTrigger;let t=this.hasOpenDrawer(),n=this.isDesktop()&&this.isDesktopCollapsible()&&!this.desktopStashed&&!this.desktopDrawerOpen,r=document.activeElement,i=r instanceof HTMLElement&&this.$el.contains(r),a=i?this.focusRestoreTarget(e):null;i&&this.moveFocusBeforeHide(a);let o=n&&!t?this.freezeSidebarForExit():null,s=++this.drawerMotionRun;this.drawerExiting=t,this.sidebarExiting=n&&!t,this.isDesktop()?this.isDesktopCollapsible()&&(this.desktopDrawerOpen=!1,this.desktopStashed=!0):this.mobileOpen=!1,this.syncAll(),t?this.animateDrawerExit(s):this.sidebarExiting&&this.animateSidebarExit(s,o),q.dispatch({el:this.$el,name:`ui:sidebar-close`,detail:{id:this.id}}),i&&a&&document.contains(a)&&a.focus({preventScroll:!0})},closeTemporaryDrawer(e,t){t instanceof MouseEvent&&(this.lastPointer={clientX:t.clientX,clientY:t.clientY},this.pointerWithinRevealArea(t))||this.drawerMotionPhase===`enter`&&!t||this.isDesktop()&&this.desktopStashed&&this.desktopDrawerOpen&&this.close(e)},handlePointerMove(e){if(!(!(e instanceof MouseEvent)||!this.isDesktop())){if(this.lastPointer={clientX:e.clientX,clientY:e.clientY},!this.hasOpenDrawer()){this.props.edgeReveal&&this.isDesktopCollapsible()&&this.desktopStashed&&!this.desktopDrawerOpen&&this.pointerWithinEdge(e)&&this.open();return}if(!this.pointerWithinRevealArea(e)){if(this.drawerMotionPhase===`enter`){this.closeTemporaryDrawer(null,e);return}this.closeTemporaryDrawer()}}},pointerWithinEdge(e){return this.edgeEls().some(t=>{if(t.hidden)return!1;let n=t.getBoundingClientRect();return e.clientX>=n.left&&e.clientX<=n.right&&e.clientY>=n.top&&e.clientY<=n.bottom})},pointerWithinRevealArea(e){return this.pointerWithinDrawer(e)},pointerWithinDrawer(e){let t=this.$el.getBoundingClientRect(),n=e.clientY>=t.top&&e.clientY<=t.bottom;return n&&e.clientX>=t.left&&e.clientX<=t.right?!0:this.props.side===`right`?n&&e.clientX>=t.right&&e.clientX<=window.innerWidth:n&&e.clientX>=0&&e.clientX<=t.left},toggle(e){if(this.isDesktop()&&this.isDesktopCollapsible()){if(this.desktopDrawerOpen||!this.desktopStashed){this.close(e);return}this.perform(`expand`,e);return}this.isExpanded()?this.close(e):this.open(e)},handleBreakpointChange(){let e=this.renderedExpanded,t=this.renderedDrawerOpen,n=e?this.freezeSidebarForExit():null,r=++this.drawerMotionRun;this.desktopMode=this.isDesktop(),this.drawerExiting=!1,this.sidebarExiting=!1,this.drawerMotionPhase=null;let i=this.isExpanded();if(e&&!i){this.drawerExiting=t,this.sidebarExiting=!0,this.syncAll(),this.animateSidebarExit(r,n,t);return}this.clearSidebarExitFreeze(n),this.syncAll(),!e&&i&&this.animateSidebarEnter(r)},syncAll(){this.syncRoot(),this.syncApp(),this.syncBackdrop(),this.syncEdge(),this.syncToggles(),this.persistStashed()},syncRoot(){let e=this.isExpanded(),t=this.isDesktop(),n=this.mobileOpen?`open`:`closed`,r=this.desktopStashed?`stashed`:`expanded`,i=this.hasOpenDrawer()?`open`:`closed`,a=e?`open`:`closed`,o=this.hasOpenDrawer()||this.drawerExiting,s=this.sidebarExiting;this.$el.dataset.state=a,this.$el.dataset.mobileState=n,this.$el.dataset.desktopState=r,this.$el.dataset.drawerState=i,this.$el.dataset.sidebarExiting=this.sidebarExiting?`true`:`false`,this.$el.dataset.side=this.props.side,this.$el.dataset.collapse=this.props.collapse,this.$el.hidden=t&&this.desktopStashed&&!this.desktopDrawerOpen&&!this.drawerExiting&&!s,q.setPresence({el:this.$el,attr:`data-resize-disabled`,present:this.props.resizable&&(!t||this.desktopStashed||this.desktopDrawerOpen),value:`true`}),e?(this.$el.removeAttribute(`inert`),this.$el.removeAttribute(`aria-hidden`)):(this.$el.setAttribute(`inert`,``),this.$el.setAttribute(`aria-hidden`,`true`)),o&&!this.hasScrollLock?(fh(),this.hasScrollLock=!0):!o&&this.hasScrollLock&&(ph(),this.hasScrollLock=!1),this.renderedExpanded=e,this.renderedDrawerOpen=this.hasOpenDrawer()},syncBackdrop(){let e=this.backdropEl();if(!e)return;let t=this.hasOpenDrawer();e.hidden=!(t||this.drawerExiting),e.dataset.state=t?`open`:`closed`,e.dataset.sidebarState=this.isDesktop()&&this.desktopStashed?`stashed`:`expanded`},syncApp(){let e=this.appEl();e&&(e.style.setProperty(`--ui-app-sidebar-width`,this.currentWidth),e.dataset.sidebarState=this.isDesktop()&&this.desktopStashed?`stashed`:`expanded`,e.dataset.sidebarSide=this.props.side)},handleResize(e){let t=(e instanceof CustomEvent?e.detail:void 0)?.width;Number.isFinite(t)&&(this.currentWidth=`${Math.round(t)}px`,this.$el.style.setProperty(`--ui-sidebar-width`,this.currentWidth),this.syncApp())},syncEdge(){let e=this.props.edgeReveal&&this.isDesktop()&&this.isDesktopCollapsible()&&this.desktopStashed&&!this.desktopDrawerOpen;this.edgeEls().forEach(t=>{t.hidden=!e,t.dataset.state=e?`visible`:`hidden`,t.dataset.side=this.props.side,t.setAttribute(`aria-controls`,this.id),t.setAttribute(`aria-expanded`,this.isExpanded()?`true`:`false`)})},syncToggles(){let e=this.isExpanded();Array.from(document.querySelectorAll(`[data-ui-sidebar-toggle]`)).filter(e=>!e.dataset.target||e.dataset.target===this.id).forEach(t=>{t.setAttribute(`aria-controls`,this.id),t.setAttribute(`aria-expanded`,e?`true`:`false`),t.dataset.state=e?`open`:`closed`}),this.syncStateIcons()},syncStateIcons(){let e=this.isExpanded();Array.from(document.querySelectorAll(`[data-ui-sidebar-state-icon]`)).filter(e=>!e.dataset.target||e.dataset.target===this.id).forEach(t=>{t.dataset.state=e?`open`:`closed`})},animateDrawerEnter(){let e=this.drawerMotionRun;this.drawerMotionPhase=`enter`,(this.drawerMotion?.enter({before:()=>{this.$el.hidden=!1},after:()=>{e!==this.drawerMotionRun||!this.hasOpenDrawer()||(this.drawerMotionPhase=null,this.isDesktop()&&this.desktopStashed&&this.lastPointer&&!this.pointerWithinDrawer(this.lastPointer)&&this.closeTemporaryDrawer())}})?.finished??Promise.resolve()).finally(()=>{e!==this.drawerMotionRun||this.drawerMotionPhase!==`enter`||(this.drawerMotionPhase=null,this.hasOpenDrawer()&&this.isDesktop()&&this.desktopStashed&&this.lastPointer&&!this.pointerWithinDrawer(this.lastPointer)&&this.closeTemporaryDrawer())}),this.backdropMotion?.enter({before:()=>{let e=this.backdropEl();e&&(e.hidden=!1)}})},animateDrawerExit(e){this.animateSidebarExit(e,null,!0)},animateSidebarEnter(e){this.drawerMotionPhase=`enter`,(this.drawerMotion?.enter({before:()=>{this.$el.hidden=!1},after:()=>{e!==this.drawerMotionRun||this.drawerMotionPhase!==`enter`||(this.drawerMotionPhase=null)}})?.finished??Promise.resolve()).finally(()=>{e!==this.drawerMotionRun||this.drawerMotionPhase!==`enter`||(this.drawerMotionPhase=null)})},animateSidebarExit(e,t=null,n=!1){this.drawerMotionPhase=`exit`;let r=this.drawerMotion?.exit({before:()=>{this.$el.hidden=!1}}),i=n?this.backdropMotion?.exit({before:()=>{let e=this.backdropEl();e&&(e.hidden=!1)}}):null;Promise.allSettled([r?.finished??Promise.resolve(),i?.finished??Promise.resolve()]).then(()=>this.finishSidebarExit(e,t))},finishSidebarExit(e,t=null){if(e!==this.drawerMotionRun||this.hasOpenDrawer()){this.clearSidebarExitFreeze(t);return}this.drawerExiting=!1,this.sidebarExiting=!1,this.drawerMotionPhase=null,this.clearSidebarExitFreeze(t),this.syncRoot(),this.syncBackdrop()},freezeSidebarForExit(){this.clearSidebarExitFreeze();let e=this.$el.getBoundingClientRect();if(e.width<=0||e.height<=0)return null;let t={position:this.$el.style.position,top:this.$el.style.top,right:this.$el.style.right,bottom:this.$el.style.bottom,left:this.$el.style.left,width:this.$el.style.width,height:this.$el.style.height,zIndex:this.$el.style.zIndex,transform:this.$el.style.transform,pointerEvents:this.$el.style.pointerEvents};this.$el.dataset.sidebarFrozen=`true`,this.$el.style.position=`fixed`,this.$el.style.top=`${e.top}px`,this.$el.style.right=`auto`,this.$el.style.bottom=`auto`,this.$el.style.left=`${e.left}px`,this.$el.style.width=`${e.width}px`,this.$el.style.height=`${e.height}px`,this.$el.style.zIndex=`var(--z-dialog, 60)`,this.$el.style.transform=`translateX(0)`,this.$el.style.pointerEvents=`none`;let n=()=>{this.$el.style.position=t.position,this.$el.style.top=t.top,this.$el.style.right=t.right,this.$el.style.bottom=t.bottom,this.$el.style.left=t.left,this.$el.style.width=t.width,this.$el.style.height=t.height,this.$el.style.zIndex=t.zIndex,this.$el.style.transform=t.transform,this.$el.style.pointerEvents=t.pointerEvents,delete this.$el.dataset.sidebarFrozen};return this.sidebarExitFreezeCleanup=n,n},clearSidebarExitFreeze(e=null){let t=e??this.sidebarExitFreezeCleanup;t&&(t(),(!e||e===this.sidebarExitFreezeCleanup)&&(this.sidebarExitFreezeCleanup=null))},setupGroups(){Array.from(this.$el.querySelectorAll(`details[data-ui-sidebar-group]`)).forEach(e=>{Array.from(e.querySelectorAll(`[data-ui-sidebar-group-actions]`)).forEach(e=>{q.addListener({target:e,event:`click`,handler:e=>e.stopPropagation(),cleanup:this.cleanup}),q.addListener({target:e,event:`keydown`,handler:e=>e.stopPropagation(),cleanup:this.cleanup})}),q.addListener({target:e,event:`toggle`,handler:()=>{let t=e.open;e.dataset.state=t?`open`:`closed`,q.dispatch({el:e,name:`ui:sidebar-group-change`,detail:{open:t}})},cleanup:this.cleanup})})},backdropEl(){return this.appEl()?.querySelector(`[data-ui-app-backdrop]`)??null},appEl(){return this.$el.closest(`[data-ui-app]`)},edgeEls(){return Array.from(document.querySelectorAll(`[data-ui-sidebar-edge]`)).filter(e=>!e.dataset.target||e.dataset.target===this.id)},focusRestoreTarget(e){return e&&document.contains(e)&&!this.$el.contains(e)?e:Array.from(document.querySelectorAll(`[data-ui-sidebar-toggle]`)).find(t=>t!==e&&!this.$el.contains(t)&&(!t.dataset.target||t.dataset.target===this.id)&&!t.hasAttribute(`disabled`)&&!t.hidden)??null},moveFocusBeforeHide(e){let t=document.activeElement;if(!(!(t instanceof HTMLElement)||!this.$el.contains(t))){if(e&&document.contains(e)){e.focus({preventScroll:!0});return}t.blur()}},storageKey(){return`trellis-ui-sidebar:${this.id}:stashed`},storedStashed(){if(!this.props.persist)return null;try{let e=window.localStorage.getItem(this.storageKey());return e===null?null:e===`true`}catch{return null}},persistStashed(){if(!(!this.props.persist||!this.isDesktopCollapsible()))try{window.localStorage.setItem(this.storageKey(),this.desktopStashed?`true`:`false`)}catch{}}}),Xx=()=>({props:null,init(){this.props=B({el:this.$el,schema:zx})},destroy(){this.props.disconnect()},get root(){return q.props({inputs:[q.resolveStyle({part:Rx.parts.toggle,props:{},className:this.props.class}),{"data-ui-sidebar-toggle":``,":data-target":()=>this.props.target,":data-action":()=>this.props.action,"@click":e=>this.trigger(e)}]})},targetId(){return this.props.target||`ui-sidebar`},trigger(e){e?.preventDefault(),document.dispatchEvent(new CustomEvent(`ui:sidebar-toggle`,{bubbles:!0,detail:{id:this.targetId(),action:this.props.action,trigger:this.$el}}))}}),Zx=()=>({props:null,init(){this.props=B({el:this.$el,schema:Bx})},destroy(){this.props.disconnect()},get root(){return q.props({inputs:[q.resolveStyle({part:Rx.parts.edge,props:{side:this.$el.dataset.side||`left`},className:this.props.class}),{"data-ui-sidebar-edge":``,":data-target":()=>this.props.target,":data-action":()=>this.props.action,"@pointerenter":e=>this.trigger(e),"@pointermove":e=>this.trigger(e),"@focus":e=>this.trigger(e),"@click":e=>this.trigger(e)}]})},targetId(){return this.props.target||`ui-sidebar`},trigger(e){e?.preventDefault(),document.dispatchEvent(new CustomEvent(`ui:sidebar-open`,{bubbles:!0,detail:{id:this.targetId(),action:this.props.action,trigger:this.$el}}))}}),Qx=e=>{e.data(`UiSidebar`,()=>Yx()),e.data(`UiSidebarEdge`,()=>Zx()),e.data(`UiSidebarToggle`,()=>Xx())},$x=mh,eS=Ch,tS=xh,nS={name:V,value:V.default(`0`),defaultValue:V,min:H.default(0),max:H.default(100),step:H.default(1),bigStep:H.default(10),minStepsBetween:H.default(0),range:U,orientation:W(tS,`horizontal`),size:W($x,`md`),variant:W(eS,`default`),disabled:U,required:U,invalid:U,label:V,description:V,descriptionTrailing:V,error:V,errors:V,badge:V,valueText:V,lowerLabel:V.default(`Minimum`),upperLabel:V.default(`Maximum`),lowerValueText:V,upperValueText:V,showValue:U,format:W([`number`,`percent`],`number`),fieldClass:V,rootClass:V,trackClass:V,rangeClass:V,thumbClass:V,tickClass:V,class:V};H.default(0);var rS=(e,t,n)=>{if(!Number.isFinite(n)||n<=0)return e;let r=Math.round((e-t)/n)*n+t,i=Math.max(0,`${n}`.split(`.`)[1]?.length??0);return Number(r.toFixed(i))},$=(e,t,n)=>Math.min(n,Math.max(t,e)),iS=e=>{let t=Math.min(e.min,e.max),n=Math.max(e.min,e.max),r=e.step>0?e.step:1;return{min:t,max:n,step:r,bigStep:e.bigStep>0?e.bigStep:r*10}},aS=(e,t)=>{let n=Number(e);return Number.isFinite(n)?n:t},oS=(e,t)=>{let{min:n,max:r,step:i}=iS(e),a=(e.value||e.defaultValue||``).split(`,`).map(e=>e.trim()),o=t.lowerInput??t.singleInput,s=t.upperInput,c=(e.range,o?.value||a[0]||`${n}`),l=e.range?s?.value||a[1]||`${r}`:c,u=rS($(aS(c,n),n,r),n,i),d=rS($(aS(l,r),n,r),n,i);if(!e.range)return{lower:u,upper:u};u>d&&([u,d]=[d,u]);let f=Math.max(0,e.minStepsBetween)*i;return d-u<f&&(d=$(rS(u+f,n,i),n,r),d-u<f&&(u=$(rS(d-f,n,i),n,r))),{lower:u,upper:d}},sS=(e,t,n)=>n<=t?0:$((e-t)/(n-t)*100,0,100),cS=(e,t)=>{let n=t=>e.format===`percent`?`${Math.round(t)}%`:String(t);return e.range?`${n(t.lower)} - ${n(t.upper)}`:n(t.lower)},lS=(e,t,n)=>{let{min:r,max:i,step:a}=iS(n),o=e.getBoundingClientRect();return rS($(r+$(n.orientation===`vertical`?1-(t.clientY-o.top)/Math.max(o.height,1):(t.clientX-o.left)/Math.max(o.width,1),0,1)*(i-r),r,i),r,a)},uS=(e,t)=>Math.abs(e-t.lower)<=Math.abs(e-t.upper)?`lower`:`upper`,dS=(e,t,n)=>{e&&(q.setPresence({el:e,attr:`data-focus`,present:t}),q.setPresence({el:e,attr:`data-invalid`,present:n}))},fS=({input:e,props:t,value:n,min:r,max:i,label:a,valueText:o,nativeRequired:s})=>{e&&(e.min=String(r),e.max=String(i),e.step=String(t.step>0?t.step:1),q.syncNativeControl({input:e,state:{name:t.range?``:t.name,value:String(n),disabled:t.disabled,required:t.required,nativeRequired:s,invalid:t.invalid}}),e.setAttribute(`aria-valuemin`,String(r)),e.setAttribute(`aria-valuemax`,String(i)),e.setAttribute(`aria-valuenow`,String(n)),o?e.setAttribute(`aria-valuetext`,o):e.removeAttribute(`aria-valuetext`),a&&e.setAttribute(`aria-label`,a),t.orientation===`vertical`?e.setAttribute(`aria-orientation`,`vertical`):e.removeAttribute(`aria-orientation`))},pS=(e,t,n)=>{let{min:r,max:i}=iS(e),a=sS(n.lower,r,i),o=sS(n.upper,r,i),s=e.range?a:0,c=e.range?o:a;t.root.style.setProperty(`--ui-slider-lower-percent`,`${a}%`),t.root.style.setProperty(`--ui-slider-upper-percent`,`${o}%`),e.orientation===`vertical`?(t.range&&(t.range.style.bottom=`${s}%`,t.range.style.height=`${Math.max(0,c-s)}%`,t.range.style.left=``,t.range.style.width=``),t.singleThumb&&(t.singleThumb.style.bottom=`${a}%`),t.lowerThumb&&(t.lowerThumb.style.bottom=`${a}%`),t.upperThumb&&(t.upperThumb.style.bottom=`${o}%`)):(t.range&&(t.range.style.left=`${s}%`,t.range.style.width=`${Math.max(0,c-s)}%`,t.range.style.bottom=``,t.range.style.height=``),t.singleThumb&&(t.singleThumb.style.left=`${a}%`),t.lowerThumb&&(t.lowerThumb.style.left=`${a}%`),t.upperThumb&&(t.upperThumb.style.left=`${o}%`)),t.ticks.forEach(t=>{let n=sS(aS(t.dataset.value??``,r),r,i);e.orientation===`vertical`?(t.style.bottom=`${n}%`,t.style.left=``):(t.style.left=`${n}%`,t.style.bottom=``)})},mS=(e,t,n,r)=>{let{min:i,max:a,step:o}=iS(e),s=e.range?Math.max(0,e.minStepsBetween)*o:0,c=rS($(n.lower,i,a),i,o),l=rS($(n.upper,i,a),i,o);e.range?(c>l&&([c,l]=[l,c]),l-c<s&&(r?.dataset.thumb===`lower`?c=$(rS(l-s,i,o),i,a):l=$(rS(c+s,i,o),i,a))):l=c,fS({input:t.singleInput,props:e,value:c,min:i,max:a,label:e.label,valueText:e.valueText,nativeRequired:e.required}),fS({input:t.lowerInput,props:e,value:c,min:i,max:e.range?l:a,label:e.lowerLabel,valueText:e.lowerValueText,nativeRequired:!1}),fS({input:t.upperInput,props:e,value:l,min:e.range?c:i,max:a,label:e.upperLabel,valueText:e.upperValueText,nativeRequired:!1});let u={lower:c,upper:l};return pS(e,t,u),t.value&&(t.value.textContent=cS(e,u)),q.syncControlPresence({el:t.root,state:e}),t.track&&q.syncControlPresence({el:t.track,state:{disabled:e.disabled,invalid:e.invalid}}),dS(t.singleThumb,t.singleInput===document.activeElement,e.invalid),dS(t.lowerThumb,t.lowerInput===document.activeElement,e.invalid),dS(t.upperThumb,t.upperInput===document.activeElement,e.invalid),u},hS=()=>({props:null,listeners:[],hiddenInputsKey:``,draggingThumb:null,init(){this.props=B({el:this.$el,schema:nS});let e=this.elements();[e.singleInput,e.lowerInput,e.upperInput].forEach(e=>{e&&(q.addListener({target:e,event:`input`,handler:e=>this.syncFromInput(e),cleanup:this.listeners}),q.addListener({target:e,event:`change`,handler:e=>this.commitFromInput(e),cleanup:this.listeners}),q.addListener({target:e,event:`keydown`,handler:e=>{e instanceof KeyboardEvent&&this.handleKeydown(e)},cleanup:this.listeners}),q.addListener({target:e,event:`focus`,handler:()=>this.sync(),cleanup:this.listeners}),q.addListener({target:e,event:`blur`,handler:()=>this.sync(),cleanup:this.listeners}))}),q.addListener({target:e.root,event:`pointerdown`,handler:e=>{e instanceof PointerEvent&&this.handlePointerDown(e)},cleanup:this.listeners}),q.addListener({target:e.root,event:`pointermove`,handler:e=>{e instanceof PointerEvent&&this.handlePointerMove(e)},cleanup:this.listeners}),q.addListener({target:e.root,event:`pointerup`,handler:e=>{e instanceof PointerEvent&&this.handlePointerUp(e)},cleanup:this.listeners}),q.addListener({target:e.root,event:`pointercancel`,handler:e=>{e instanceof PointerEvent&&this.handlePointerUp(e)},cleanup:this.listeners}),this.sync()},destroy(){this.props.disconnect(),this.listeners.forEach(e=>e()),this.listeners=[]},elements(){let e=this.$el,t=e.querySelector(`[data-ui-slider-root]`);if(!t)throw Error(`Slider requires a root element.`);return{root:t,track:t.querySelector(`[data-ui-slider-track]`),range:t.querySelector(`[data-ui-slider-range]`),lowerInput:t.querySelector(`[data-ui-slider-input][data-thumb="lower"]`),upperInput:t.querySelector(`[data-ui-slider-input][data-thumb="upper"]`),singleInput:t.querySelector(`[data-ui-slider-input][data-thumb="single"]`),lowerThumb:t.querySelector(`[data-ui-slider-thumb][data-thumb="lower"]`),upperThumb:t.querySelector(`[data-ui-slider-thumb][data-thumb="upper"]`),singleThumb:t.querySelector(`[data-ui-slider-thumb][data-thumb="single"]`),value:e.querySelector(`[data-ui-slider-value]`),hiddenInputs:e.querySelector(`[data-ui-slider-hidden-inputs]`),ticks:Array.from(e.querySelectorAll(`[data-ui-slider-tick]`))}},sync(){let e=this.elements(),t=mS(this.props,e,oS(this.props,e));this.props.range&&e.hiddenInputs?this.hiddenInputsKey=q.syncRepeatedHiddenInputs({container:e.hiddenInputs,currentKey:this.hiddenInputsKey,state:{name:this.props.name,values:[String(t.lower),String(t.upper)],required:this.props.required,marker:`data-ui-slider-hidden-input`}}):e.hiddenInputs&&(this.hiddenInputsKey=q.syncRepeatedHiddenInputs({container:e.hiddenInputs,currentKey:this.hiddenInputsKey,state:{name:``,values:[],marker:`data-ui-slider-hidden-input`}}))},syncFromInput(e){let t=e.target instanceof HTMLInputElement?e.target:null,n=this.elements(),r=oS(this.props,n);t?.dataset.thumb===`upper`?r.upper=aS(t.value,r.upper):r.lower=aS(t?.value??``,r.lower),mS(this.props,n,r,t),this.sync()},commitFromInput(e){this.syncFromInput(e)},handleKeydown(e){if(!(e.target instanceof HTMLInputElement)||![`PageUp`,`PageDown`].includes(e.key)&&!(e.shiftKey&&e.key.startsWith(`Arrow`)))return;e.preventDefault();let t=e.target,n=[`PageDown`,`ArrowDown`,`ArrowLeft`].includes(e.key)?-1:1,{bigStep:r}=iS(this.props);t.value=String(aS(t.value,this.props.min)+n*r),t.dispatchEvent(new Event(`input`,{bubbles:!0})),t.dispatchEvent(new Event(`change`,{bubbles:!0}))},handlePointerDown(e){if(this.props.disabled)return;let t=this.elements(),n=lS(t.root,e,this.props),r=oS(this.props,t);this.draggingThumb=this.props.range?uS(n,r):`single`,this.draggingThumb===`upper`?r.upper=n:r.lower=n;let i=this.draggingThumb===`upper`?t.upperInput:this.props.range?t.lowerInput:t.singleInput;i?.focus(),mS(this.props,t,r,i),this.sync(),t.root.setPointerCapture?.(e.pointerId),e.preventDefault()},handlePointerMove(e){if(!this.draggingThumb||this.props.disabled)return;let t=this.elements(),n=oS(this.props,t),r=lS(t.root,e,this.props);this.draggingThumb===`upper`?n.upper=r:n.lower=r;let i=this.draggingThumb===`upper`?t.upperInput:this.props.range?t.lowerInput:t.singleInput;mS(this.props,t,n,i),i?.dispatchEvent(new Event(`input`,{bubbles:!0}))},handlePointerUp(e){if(!this.draggingThumb)return;let t=this.elements();(this.draggingThumb===`upper`?t.upperInput:this.props.range?t.lowerInput:t.singleInput)?.dispatchEvent(new Event(`change`,{bubbles:!0})),t.root.releasePointerCapture?.(e.pointerId),this.draggingThumb=null}}),gS=e=>{e.data(`UiSlider`,()=>hS())},_S=[`trailing`,`leading`],vS=mh,yS=Ch,bS={value:V.default(`on`),name:V,label:V,description:V,checked:U,disabled:U,required:U,invalid:U,placement:W(_S,`trailing`),variant:W(yS,`default`),size:W(vS,`md`),inputClass:V,trackClass:V,thumbClass:V,contentClass:V,labelClass:V,descriptionClass:V,class:V};({...bS});var xS=e=>{let t=e.querySelector(`[data-ui-switch-input]`);return t?{root:e,input:t,track:e.querySelector(`[data-ui-switch-track]`),thumb:e.querySelector(`[data-ui-switch-thumb]`),disabled:e.hasAttribute(`data-disabled`)||t.disabled,required:e.hasAttribute(`data-required`)||t.required,invalid:e.hasAttribute(`data-invalid`)||t.getAttribute(`aria-invalid`)===`true`}:null},SS=(e,t={})=>{let n=t.disabled??e.disabled,r=t.required??e.required,i=t.invalid??e.invalid,a=e.input.checked,o=a?`checked`:`unchecked`;q.syncNativeControl({input:e.input,state:{disabled:n,required:r,invalid:i}}),e.input.setAttribute(`role`,`switch`),e.input.setAttribute(`aria-checked`,a?`true`:`false`),q.setAttribute({el:e.root,attr:`data-state`,value:o}),q.setPresence({el:e.root,attr:`data-checked`,present:a}),q.syncControlPresence({el:e.root,state:{disabled:n,required:r,invalid:i}}),q.setAttribute({el:e.input,attr:`data-state`,value:o}),q.setPresence({el:e.input,attr:`data-checked`,present:a}),e.track&&(q.setAttribute({el:e.track,attr:`data-state`,value:o}),q.setPresence({el:e.track,attr:`data-checked`,present:a}),q.syncControlPresence({el:e.track,state:{disabled:n,invalid:i}})),e.thumb&&(q.setAttribute({el:e.thumb,attr:`data-state`,value:o}),q.setPresence({el:e.thumb,attr:`data-checked`,present:a}),q.setPresence({el:e.thumb,attr:`data-disabled`,present:n}))},CS=()=>({props:null,listeners:[],init(){this.props=B({el:this.$el,schema:bS});let e=this.input();q.addListener({target:e,event:`change`,handler:()=>this.sync(),cleanup:this.listeners}),q.addListener({target:e,event:`keydown`,handler:e=>{e instanceof KeyboardEvent&&this.toggleFromEnter(e)},cleanup:this.listeners}),this.sync()},destroy(){this.props.disconnect(),this.listeners.forEach(e=>e()),this.listeners=[]},input(){let e=this.$el.querySelector(`[data-ui-switch-input]`);if(!e)throw Error(`Switch requires a native checkbox input.`);return e},item(){let e=xS(this.$el);if(!e)throw Error(`Switch requires a native checkbox input.`);return e},sync(){let e=this.item();this.props.name&&(e.input.name=this.props.name),this.props.value&&(e.input.value=this.props.value),SS(e,{disabled:this.props.disabled||e.disabled,required:this.props.required||e.required,invalid:this.props.invalid||e.invalid})},toggleFromEnter(e){if(e.key!==`Enter`)return;let t=this.input();t.disabled||(e.preventDefault(),t.checked=!t.checked,t.dispatchEvent(new Event(`input`,{bubbles:!0})),t.dispatchEvent(new Event(`change`,{bubbles:!0})))}}),wS=e=>{e.data(`UiSwitch`,()=>CS())},TS=[`manual`,`automatic`],ES=xh;[...ES];var DS={id:V.default(`ui-tabs`),defaultValue:V,value:V,activation:W(TS,`manual`),orientation:W(ES,`horizontal`),loop:U.default(!0),panels:V,class:V},OS=G({definition:{component:`ui.tabs`,parts:{root:{base:`grid min-w-0 gap-3`,variants:{orientation:{horizontal:``,vertical:`md:grid-cols-[max-content_minmax(0,1fr)] md:items-start`}},defaults:{orientation:`horizontal`}},list:{base:`flex min-w-0 items-center`,variants:{variant:{subtle:`gap-1`,line:`gap-4 border-b border-border`,segmented:`gap-0.5 rounded-3 bg-base-a2 p-0.5 shadow-inset`,pills:`gap-1`},orientation:{horizontal:`flex-row`,vertical:`flex-col items-stretch`},size:{sm:``,md:``},scrollable:{true:`overflow-x-auto`,false:``}},compounds:[{when:{variant:`line`,orientation:`vertical`},class:`gap-1 border-b-0 border-l border-border`},{when:{variant:`segmented`,orientation:`vertical`},class:`w-full`}],defaults:{variant:`line`,orientation:`horizontal`,size:`md`,scrollable:!1}},tab:{base:[`group/tabs-tab relative inline-flex min-w-0 shrink-0 select-none items-center gap-2 whitespace-nowrap`,`text-sm font-normal text-foreground outline-none`,`focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2 focus-visible:ring-offset-app`,`data-disabled:pointer-events-none data-disabled:opacity-50`,`ui-selected:text-foreground`],variants:{variant:{subtle:`rounded-2 px-2 hover:bg-base-a2 ui-selected:font-medium`,line:[`-mb-px rounded-none border-x-0 border-b-2 border-t-0 border-transparent px-0`,`ui-selected:border-foreground ui-selected:font-medium`],segmented:[`rounded-2 px-3 hover:bg-base-a2`,`ui-selected:bg-surface ui-selected:font-medium ui-selected:shadow-border`],pills:[`rounded-full bg-surface px-3 shadow-border hover:bg-base-a2`,`ui-selected:bg-base-a3 ui-selected:font-medium ui-selected:shadow-border-hover`]},size:{sm:`h-control-sm text-xs`,md:`h-control-md text-sm`},orientation:{horizontal:`justify-center`,vertical:`w-full justify-start`},selectedIcon:{true:``,false:``}},compounds:[{when:{variant:`line`,orientation:`vertical`},class:`-ml-px mb-0 border-b-0 border-l-2 px-2`},{when:{variant:`subtle`,selectedIcon:!0},class:`ps-2`}],defaults:{variant:`line`,size:`md`,orientation:`horizontal`,selectedIcon:!1}},tabLabel:{base:`min-w-0`},tabIcon:{base:`size-icon shrink-0 fill-current text-icon`},tabSelectedIcon:{base:`size-icon shrink-0 fill-current text-icon`},panels:{base:`min-w-0`},panel:{base:`min-w-0 text-sm text-foreground outline-none focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2 focus-visible:ring-offset-app`},panelInner:{base:`min-w-0`}}}}),kS=`ui-tabs`,AS=e=>e?`active`:`inactive`,jS=e=>e instanceof HTMLButtonElement||e instanceof HTMLAnchorElement,MS=e=>Array.from(new Set(e)),NS=e=>e.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,`-`).replace(/^-+|-+$/g,``)||`tab`,PS=(e,t)=>`${e}-tab-${NS(t)}`,FS=(e,t)=>`${e}-panel-${NS(t)}`,IS=e=>q.asBool({value:e}),LS=()=>({props:null,activeValue:``,collection:null,cleanup:[],init(){this.props=B({el:this.$el,schema:DS}),this.activeValue=this.initialValue(),this.setupEvents(),this.syncAll()},destroy(){this.props.disconnect(),this.teardown()},get root(){return q.props({inputs:[q.resolveStyle({part:OS.parts.root,props:this.props,className:this.props.class}),{"data-ui-tabs":``,":data-orientation":()=>this.props.orientation,":data-activation":()=>this.props.activation}]})},owner(){return this.$el.id||this.props.id||this.$el.dataset.owner||kS},lists(){return Array.from(this.$el.querySelectorAll(`[data-ui-tabs-list]`))},primaryList(){return this.lists()[0]??null},listVariant(){let e=this.primaryList()?.dataset.variant;return e===`subtle`||e===`segmented`||e===`pills`?e:`line`},listSize(){return this.primaryList()?.dataset.size===`sm`?`sm`:`md`},listOrientation(e){let t=(e??this.primaryList())?.dataset.orientation;return t===`vertical`||t===`horizontal`?t:this.props.orientation},tabs(){return Array.from(this.$el.querySelectorAll(`[data-ui-tabs-tab]`)).map((e,t)=>jS(e)?(e.dataset.value||(e.dataset.value=`tab-${t+1}`),{tab:e,value:e.dataset.value,isDisabled:IS(e.dataset.disabled)||e.hasAttribute(`disabled`),panel:this.panelForValue(e.dataset.value)}):null).filter(e=>e!==null)},panels(){let e=`[data-ui-tabs-panel][data-ui-tabs-owner="${this.owner()}"]`,t=Array.from(this.$el.querySelectorAll(`[data-ui-tabs-panel]`));if(this.props.panels){let e=document.querySelector(this.props.panels);e&&t.push(...Array.from(e.querySelectorAll(`[data-ui-tabs-panel]`)))}return t.push(...Array.from(document.querySelectorAll(e))),MS(t)},panelForValue(e){return this.panels().find(t=>t.dataset.value===e)??null},initialValue(){if(this.props.value)return this.props.value;if(this.props.defaultValue)return this.props.defaultValue;let e=this.tabs().find(e=>IS(e.tab.dataset.selected)||e.tab.getAttribute(`aria-selected`)===`true`);return e?e.value:this.panels().find(e=>IS(e.dataset.selected))?.dataset.value||this.fallbackValue()},fallbackValue(){return this.tabs().find(e=>!e.isDisabled)?.value??``},setActiveValue(e,t){if(!e||this.activeValue===e){this.syncAll();return}this.activeValue=e,this.syncAll(),this.dispatchChange(),t&&this.dispatchActivate(t,this.panelForValue(e))},syncAll(){this.activeValue||=this.fallbackValue(),this.syncRoot(),this.lists().forEach(e=>this.syncList(e)),this.tabs().forEach(e=>this.syncTab(e)),this.panels().forEach(e=>this.syncPanel(e))},syncRoot(){!this.$el.id&&this.props.id&&(this.$el.id=this.props.id),this.$el.dataset.orientation=this.props.orientation,this.$el.dataset.activation=this.props.activation,this.$el.dataset.value=this.activeValue},syncList(e){let t=this.listOrientation(e);e.setAttribute(`role`,`tablist`),e.dataset.orientation=t,e.className=q.resolveStyle({part:OS.parts.list,props:{variant:e.dataset.variant||`line`,size:e.dataset.size||`md`,orientation:t,scrollable:IS(e.dataset.scrollable)},className:e.dataset.class??``}),t===`vertical`?e.setAttribute(`aria-orientation`,`vertical`):e.removeAttribute(`aria-orientation`)},syncTab(e){let t=e.value===this.activeValue,n=e.tab.getAttribute(`data-active`)===`true`||document.activeElement===e.tab,r=AS(t),i=e.tab.dataset.uiTabsOwner||e.tab.dataset.owner||this.owner(),a=e.panel?.id||FS(i,e.value),o=this.listOrientation(e.tab.closest(`[data-ui-tabs-list]`)),s=e.tab.closest(`[data-ui-tabs-list]`)?.dataset.variant||this.listVariant(),c=e.tab.closest(`[data-ui-tabs-list]`)?.dataset.size||this.listSize(),l=e.tab.querySelector(`[data-ui-tabs-tab-selected-icon]`);if(e.tab.id||=PS(i,e.value),e.tab.dataset.state=r,e.tab.dataset.orientation=o,e.tab.dataset.variant=s,e.tab.dataset.size=c,e.tab.setAttribute(`role`,`tab`),e.tab.setAttribute(`aria-selected`,t?`true`:`false`),e.tab.setAttribute(`aria-controls`,a),e.tab.tabIndex=t||n?0:-1,e.tab.className=q.resolveStyle({part:OS.parts.tab,props:{variant:s,size:c,orientation:o,selectedIcon:!!l},className:e.tab.dataset.class??``}),q.setPresence({el:e.tab,attr:`data-selected`,present:t}),l&&(l.style.visibility=t?`visible`:`hidden`),e.isDisabled){e.tab.setAttribute(`data-disabled`,``),e.tab.setAttribute(`aria-disabled`,`true`),e.tab.tabIndex=-1,e.tab instanceof HTMLButtonElement&&(e.tab.disabled=!0);return}e.tab.removeAttribute(`data-disabled`),e.tab.removeAttribute(`aria-disabled`),e.tab instanceof HTMLButtonElement&&(e.tab.disabled=!1)},syncPanel(e){let t=e.dataset.value||``,n=t===this.activeValue,r=e.dataset.uiTabsOwner||e.dataset.owner||this.owner(),i=PS(r,t),a=FS(r,t);t&&!e.id&&(e.id=a),!e.getAttribute(`data-ui-key`)&&t&&e.setAttribute(`data-ui-key`,e.id||a),e.dataset.state=AS(n),e.dataset.orientation=this.props.orientation,e.setAttribute(`role`,`tabpanel`),e.setAttribute(`aria-labelledby`,i),e.hasAttribute(`tabindex`)||(e.tabIndex=0),e.hidden=!n,e.className=q.resolveStyle({part:OS.parts.panel,props:this.props,className:e.dataset.class??``}),q.setPresence({el:e,attr:`data-selected`,present:n})},setupEvents(){q.addListener({target:this.$el,event:`click`,handler:e=>this.handleClick(e),cleanup:this.cleanup}),q.addListener({target:this.$el,event:`focusin`,handler:e=>this.handleFocus(e),cleanup:this.cleanup}),q.addListener({target:this.$el,event:`keydown`,handler:e=>{e instanceof KeyboardEvent&&this.handleKeydown(e)},cleanup:this.cleanup})},teardown(){this.cleanup.forEach(e=>e()),this.cleanup=[]},tabFromEvent(e){let t=(e.target instanceof Element?e.target:null)?.closest(`[data-ui-tabs-tab]`)??null;return!jS(t)||!this.$el.contains(t)?null:t},itemFromTab(e){return this.tabs().find(t=>t.tab===e)??null},collectionNav(){return this.collection||=q.createCollectionNavigation({root:()=>this.$el,itemSelector:`[data-ui-tabs-tab]`,isDisabled:e=>IS(e.dataset.disabled)||e.hasAttribute(`disabled`),loop:()=>this.props.loop}),this.collection},handleClick(e){let t=this.tabFromEvent(e);if(!t)return;let n=this.itemFromTab(t);if(n){if(n.isDisabled){e.preventDefault();return}this.setActiveValue(n.value,t)}},handleFocus(e){let t=this.tabFromEvent(e);if(t)if(this.collectionNav().activateItem({el:t}),this.props.activation===`automatic`){let e=this.itemFromTab(t);e&&!e.isDisabled&&this.setActiveValue(e.value,t)}else this.syncAll()},handleKeydown(e){let t=this.tabFromEvent(e);if(!t)return;if(e.key===`Enter`||e.key===` `){e.preventDefault();let n=this.itemFromTab(t);n&&!n.isDisabled&&this.setActiveValue(n.value,t);return}let n=this.listOrientation(t.closest(`[data-ui-tabs-list]`));if(e.key===`Home`){e.preventDefault(),this.focusFirst();return}if(e.key===`End`){e.preventDefault(),this.focusLast();return}if(n===`vertical`){if(e.key===`ArrowDown`){e.preventDefault(),this.focusNext();return}e.key===`ArrowUp`&&(e.preventDefault(),this.focusPrevious());return}if(e.key===`ArrowRight`){e.preventDefault(),q.isRtl({el:this.$el})?this.focusPrevious():this.focusNext();return}e.key===`ArrowLeft`&&(e.preventDefault(),q.isRtl({el:this.$el})?this.focusNext():this.focusPrevious())},focusNext(){this.collectionNav().focusNext(),this.activateFocused()},focusPrevious(){this.collectionNav().focusPrevious(),this.activateFocused()},focusFirst(){this.collectionNav().focusFirst(),this.activateFocused()},focusLast(){this.collectionNav().focusLast(),this.activateFocused()},activateFocused(){if(this.props.activation!==`automatic`)return;let e=document.activeElement;if(!jS(e))return;let t=this.itemFromTab(e);t&&!t.isDisabled&&this.setActiveValue(t.value,e)},dispatchChange(){q.dispatch({el:this.$el,name:`ui:change`,detail:{value:this.activeValue}})},dispatchActivate(e,t){q.dispatch({el:e,name:`ui:tabs:activate`,detail:{value:this.activeValue,panelId:t?.id??``}})}}),RS=e=>{e.data(`UiTabs`,()=>LS())},zS=[`info`,`success`,`warning`,`danger`,`debug`],BS=[`default`,`info`,`success`,`warning`,`danger`,`debug`],VS=[`top-right`,`top-left`,`top-center`,`bottom-right`,`bottom-left`,`bottom-center`],HS={level:W(zS,`info`),variant:W(BS,`default`),title:V,duration:H.default(5e3).min(0),dismissible:U.default(!0),class:V,contentClass:V,closeClass:V},US={id:V.default(`ui-toast-root`),position:W(VS,`top-right`),duration:H.default(5e3).min(0),includeMessages:U.default(!0),class:V},WS=G({definition:{component:`ui.toast`,parts:{root:{base:[`pointer-events-auto relative grid w-full min-w-0 gap-3 overflow-hidden rounded-4 bg-toast p-3 text-foreground shadow-popover outline-none`,`data-[state=closed]:pointer-events-none data-[state=closed]:opacity-0`],variants:{variant:{default:`grid-cols-[1fr_auto]`,info:`grid-cols-[auto_1fr_auto]`,success:`grid-cols-[auto_1fr_auto]`,warning:`grid-cols-[auto_1fr_auto]`,danger:`grid-cols-[auto_1fr_auto]`,debug:`grid-cols-[auto_1fr_auto]`},level:{info:``,success:``,warning:``,danger:``,debug:``}},defaults:{variant:`default`,level:`info`}},marker:{base:`mt-1 size-2 shrink-0 rounded-full`,variants:{variant:{default:`hidden`,info:`bg-accent-solid`,success:`bg-success-solid`,warning:`bg-warning-solid`,danger:`bg-danger-solid`,debug:`bg-base-9`}},defaults:{variant:`default`}},content:{base:`grid min-w-0 gap-0.5`},title:{base:`min-w-0`},description:{base:`min-w-0`},close:{base:[`-mr-1 -mt-1 inline-flex size-control-md shrink-0 items-center justify-center rounded-2 text-icon outline-none`,`hover:bg-base-a2 focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2 focus-visible:ring-offset-app`]},closeIcon:{base:`size-icon fill-current`},outlet:{base:[`pointer-events-none fixed z-toast flex w-[min(24rem,calc(100vw-2rem))] flex-col gap-2`],variants:{position:{"top-right":`right-4 top-4 justify-items-end`,"top-left":`left-4 top-4 justify-items-start`,"top-center":`left-1/2 top-4 -translate-x-1/2 justify-items-center`,"bottom-right":`bottom-4 right-4 justify-items-end`,"bottom-left":`bottom-4 left-4 justify-items-start`,"bottom-center":`bottom-4 left-1/2 -translate-x-1/2 justify-items-center`}},defaults:{position:`top-right`}}}}}),GS=e=>e===`info`||e===`success`||e===`warning`||e===`danger`||e===`debug`,KS=e=>e==="default"||e===`info`||e===`success`||e===`warning`||e===`danger`||e===`debug`,qS=(e,t)=>{let n=typeof e==`number`?e:Number(e);return Number.isFinite(n)&&n>=0?n:t},JS=e=>Math.min(e,3),YS=new WeakMap,XS=e=>{let t=Array.from(e.querySelectorAll(`:scope > [data-ui-toast]`));e.dataset.stack=t.length>1?`collapsed`:`single`;let n=window.getComputedStyle(e),r=Number.parseFloat(n.rowGap||n.gap||`0`)||0,i=t.map(e=>Math.ceil(e.scrollHeight||e.getBoundingClientRect().height)),a=i[0]??0,o=Number.parseFloat(n.getPropertyValue(`--ui-toast-stack-peek`))||8,s=e.dataset.position?.startsWith(`bottom`)?-1:1,c=JS(Math.max(0,t.length-1)),l=i.reduce((e,t)=>e+t,0)+Math.max(0,t.length-1)*r,u=a+c*o;e.style.setProperty(`--ui-toast-front-height`,`${a}px`),e.style.setProperty(`--ui-toast-stack-height`,`${u}px`),e.style.setProperty(`--ui-toast-stack-expanded-height`,`${l}px`),t.forEach((e,n)=>{let r=JS(n),i=Math.max(.91,1-r*.03),a=Math.max(.72,1-r*.08);e.dataset.stackIndex=String(n),e.style.setProperty(`--ui-toast-stack-index`,String(n)),e.style.setProperty(`--ui-toast-stack-depth`,String(r)),e.style.setProperty(`--ui-toast-stack-direction`,String(s)),e.style.setProperty(`--ui-toast-stack-offset`,`${r*o*s}px`),e.style.setProperty(`--ui-toast-stack-scale`,String(i)),e.style.setProperty(`--ui-toast-stack-opacity`,String(a)),e.style.zIndex=String(t.length-n)})},ZS=e=>{let t=e.parentElement instanceof HTMLElement?e.parentElement:null;e.dataset.state=`closed`,e.remove(),t?.matches(`[data-ui-toast-outlet]`)&&XS(t)},QS=e=>{YS.get(e)?.cancel();let t=q.motion.animatePresence(e,`enter`,`toast`);YS.set(e,t),t.finished.finally(()=>{YS.get(e)===t&&YS.delete(e)})},$S=e=>{if(!e.isConnected)return;e.dataset.state=`closed`,YS.get(e)?.cancel();let t=q.motion.animatePresence(e,`exit`,`toast`);YS.set(e,t),t.finished.finally(()=>{YS.get(e)===t&&(YS.delete(e),ZS(e))})},eC=e=>{let t=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);t.setAttribute(`viewBox`,`0 0 32 32`),t.setAttribute(`aria-hidden`,`true`),t.setAttribute(`data-ui-toast-close-icon`,``),t.setAttribute(`class`,e);let n=document.createElementNS(`http://www.w3.org/2000/svg`,`polygon`);return n.setAttribute(`points`,`17.4141 16 24 9.4141 22.5859 8 16 14.5859 9.4143 8 8 9.4141 14.5859 16 8 22.5859 9.4143 24 16 17.4141 22.5859 24 24 22.5859 17.4141 16`),t.append(n),t},tC=()=>({props:null,cleanup:[],timer:null,init(){this.props=B({el:this.$el,schema:HS});let e=this.$el,t=e.parentElement instanceof HTMLElement&&e.parentElement.matches(`[data-ui-toast-outlet]`)?e.parentElement:null;e.dataset.state=`open`,e.setAttribute(`data-ui-motion-owner`,`component`),t&&XS(t),QS(e),this.props.dismissible&&q.addListener({target:e,event:`click`,handler:e=>{let t=e.target;t instanceof Element&&t.closest(`[data-ui-toast-close]`)&&this.dismiss()},cleanup:this.cleanup}),this.props.duration>0&&(this.timer=window.setTimeout(()=>this.dismiss(),this.props.duration))},destroy(){this.props.disconnect(),this.cleanup.forEach(e=>e()),this.cleanup=[],this.timer!==null&&window.clearTimeout(this.timer),YS.get(this.$el)?.cancel()},dismiss(){let e=this.$el;this.timer!==null&&window.clearTimeout(this.timer),q.dispatch({el:e,name:`ui:dismiss`}),$S(e)}}),nC=(e,t)=>{let n=GS(e.level)?e.level:`info`,r=KS(e.variant)?e.variant:GS(e.level)?e.level:`default`,i=typeof e.title==`string`?e.title:``,a=typeof e.message==`string`?e.message:``,o=qS(e.duration,t),s=typeof e.dismissible==`boolean`?e.dismissible:!0,c=n===`danger`||n===`warning`,l=document.createElement(`div`);l.dataset.uiToast=``,l.dataset.level=n,l.dataset.variant=r,l.dataset.duration=String(o),l.dataset.dismissible=String(s),l.dataset.state=`open`,l.setAttribute(`role`,c?`alert`:`status`),l.setAttribute(`aria-live`,c?`assertive`:`polite`),l.setAttribute(`aria-atomic`,`true`),l.className=q.resolveStyle({part:WS.parts.root,props:{level:n,variant:r}});let u=document.createElement(`span`);u.dataset.uiToastMarker=``,u.setAttribute(`aria-hidden`,`true`),u.className=q.resolveStyle({part:WS.parts.marker,props:{variant:r}}),l.append(u);let d=document.createElement(`div`);if(d.dataset.uiToastContent=``,d.className=q.resolveStyle({part:WS.parts.content}),i){let e=document.createElement(`strong`);e.dataset.uiToastTitle=``,e.className=`${q.resolveStyle({part:WS.parts.title})} text-sm font-medium text-foreground`,e.textContent=i,d.append(e)}let f=document.createElement(`div`);if(f.dataset.uiToastDescription=``,f.className=`${q.resolveStyle({part:WS.parts.description})} text-sm text-foreground-muted`,f.textContent=a,d.append(f),l.append(d),s){let e=document.createElement(`button`);e.type=`button`,e.dataset.uiToastClose=``,e.setAttribute(`aria-label`,`Dismiss notification`),e.className=q.resolveStyle({part:WS.parts.close}),e.append(eC(q.resolveStyle({part:WS.parts.closeIcon}))),e.addEventListener(`click`,()=>$S(l)),l.append(e)}return o>0&&window.setTimeout(()=>$S(l),o),l},rC=()=>({props:null,cleanup:[],init(){this.props=B({el:this.$el,schema:US});let e=this.$el;XS(e),q.addListener({target:e,event:`pointerover`,handler:()=>{e.dataset.stackExpanded=`true`},cleanup:this.cleanup}),q.addListener({target:e,event:`pointerout`,handler:t=>{let n=`relatedTarget`in t?t.relatedTarget:null;(!(n instanceof Node)||!e.contains(n))&&delete e.dataset.stackExpanded},cleanup:this.cleanup}),q.addListener({target:e,event:`focusin`,handler:()=>{e.dataset.stackExpanded=`true`},cleanup:this.cleanup}),q.addListener({target:e,event:`focusout`,handler:()=>{window.requestAnimationFrame(()=>{e.contains(document.activeElement)||delete e.dataset.stackExpanded})},cleanup:this.cleanup}),q.addListener({target:document,event:`ui:toast`,handler:e=>{let t=e instanceof CustomEvent?e.detail:{};this.add(t)},cleanup:this.cleanup})},destroy(){this.props.disconnect(),this.cleanup.forEach(e=>e()),this.cleanup=[]},add(e){if(!(typeof e.message==`string`&&e.message))return;let t=this.$el,n=nC(e,this.props.duration);n.setAttribute(`data-ui-motion-owner`,`component`),t.append(n),XS(t),QS(n)}}),iC=e=>{e.data(`UiToast`,()=>tC()),e.data(`UiToastOutlet`,()=>rC())},aC={bool:U,className:Wl,create:au,createResizable:Wf,cx:Gl,defineManifest:qf,defineProps:B,defineStyles:G,json:Eu,motion:Xs,number:H,oneOf:W,props:uu,propsFromSchema:Jf,resolveStyle:K,string:V},oC=e=>{if(e.ajax)return;let t={},n=document.querySelector(`meta[name="csrf-token"]`);n&&(t.headers={"X-CSRFToken":n.content}),e.plugin(he),e.plugin(te.configure(t))},sC=e=>{Tu(e.reactive),oC(e),tc(e),lh(e),nu(),ug(),qh(e),Sg(e),jg(e),Cy(e),Ay(e),Fy(e),ub(e),gb(e),Ib(e),Gb(e),ox(e),kx(e),Qx(e),gS(e),Gf(e),Zm(e),wS(e),RS(e),iC(e)};return e.bool=U,e.className=Wl,e.create=au,e.createResizable=Wf,e.cx=Gl,e.default=sC,e.trellisUi=sC,e.defineManifest=qf,e.defineProps=B,e.defineStyles=G,e.json=Eu,e.motion=Xs,e.number=H,e.oneOf=W,e.props=uu,e.propsFromSchema=Jf,e.resolveStyle=K,e.string=V,e.ui=aC,e})({});
|
|
10
|
+
`,d(t+1);break;default:n+=i;break}c=i}return{messages:t,leftoverData:e.substring(l)}}function pm(e){if(e.startsWith(`data:`))return{data:e.substring(5).trim()};if(e.startsWith(`id:`))return{id:e.substring(3).trim()};if(e.startsWith(`event:`))return{event:e.substring(6).trim()};if(e.startsWith(`retry:`)){let t=Number(e.substring(6).trim());if(!Number.isNaN(t))return Number.isInteger(t)?{retry:t}:{retry:Math.round(t)}}return{}}async function mm(e,t,n){let r=t.getReader(),i;for(;!e.signal.aborted&&!(i=await r.read()).done;)n(i.value)}function hm(e){return e instanceof DOMException&&e.name===`AbortError`}async function gm(e,t){if(typeof t.onResponse==`function`&&await t.onResponse(e),!e.response.ok)return;let n=e.response.headers.get(`Content-Type`);if(typeof n!=`string`||!n.includes(`text/event-stream`)){let r=Error(`Expected server to response with Content-Type: '${_m}'. Got '${n}'`);throw e.error=r,typeof t.onResponseError==`function`&&await t.onResponseError(e),r}}var _m,vm,ym,bm,xm,Sm=n((()=>{lm(),_m=`text/event-stream`,vm=`last-event-id`,ym=class{url;lastEventId;options;retryCount=0;retryInterval=0;maxRetryCount;maxRetryInterval;fetch;timeoutDurationMs;timeout;constructor(e,t={}){this.url=e,this.options=t,this.maxRetryCount=t.maxRetryCount,this.maxRetryInterval=t.maxRetryInterval??3e4,this.fetch=Xp({fetch:t.fetch})??cm,this.timeoutDurationMs=t.timeout}async _handleRetry(e,t){if(this.retryCount++,typeof this.maxRetryCount==`number`&&this.retryCount>=this.maxRetryCount){e._emitEvent({type:`error`,reason:`max retry count reached`});return}this.retryInterval===0?this.retryInterval=2:this.retryInterval>0&&(this.retryInterval*=2,this.retryInterval>=this.maxRetryInterval&&(this.retryInterval=this.maxRetryInterval)),await dm(this.retryInterval),e._abortController.abort(),e._abortController=new AbortController,await this._handleConnection(e,t)}async _handleConnection(e,t){let n,r=e._abortController.signal;if(typeof this.options.headers==`function`){let e=this.options.headers();n=`then`in e&&typeof e.then==`function`?new Headers(await e.then(e=>e)):new Headers(e)}else n=new Headers(this.options.headers??{});typeof n.get(`accept`)!=`string`&&n.set(`accept`,_m),typeof this.lastEventId==`string`&&n.set(vm,this.lastEventId);let i,a={...this.options,method:this.options.method??`get`,responseType:`stream`,headers:n,signal:r,retry:!1,onRequest:n=>{if(!(e.signal.aborted||r.aborted)&&!hm(n.error))return t.onRequest?.(n)},onRequestError:async n=>{if(!(e.signal.aborted||r.aborted)&&!hm(n.error))return t.onRequestError?.(n)},onResponse:async e=>(i=e,gm(e,t)),onResponseError:async e=>{if(!r.aborted&&!hm(e.error))throw e.error===void 0&&(e.error=new Zp(`${e.response.status} ${e.response.statusText}`)),await t.onResponseError?.(e),e.error}};try{this.timeoutDurationMs&&(this.timeout=setTimeout(()=>{e._emitEvent({type:`error`,reason:`Timeout of ${this.timeoutDurationMs}ms exceeded`})},this.timeoutDurationMs));let n=await this.fetch.raw(this.url,a);clearTimeout(this.timeout),this.timeout=void 0,this.retryCount=0,this.retryInterval=0;let r=new TextDecoder,o=``,s=n.body;if(!s){let e=Error(`Expected response body to contain ReadableStream`);throw i.response=n,i.error=e,await t.onResponseError?.(i),e}await mm(e,s,e=>{let n=fm(o+r.decode(e,{stream:!0}));o=n.leftoverData??``;for(let e of n.messages)typeof e.id==`string`&&e.id.length>0&&(this.lastEventId=e.id),t.onMessage(e)})}catch(n){return r.aborted||e.signal.aborted||hm(n)?void 0:this._handleRetry(e,t)}if(!(e.signal.aborted||r.aborted)){if(this.options.retryStrategy===`on-error`){e._emitEvent({type:`end-of-stream`,reason:`Stream has ended`});return}return this._handleRetry(e,t)}}listen(e){let t=new bm(new AbortController,n=>{if(n===void 0){this._handleConnection(t,e);return}this._handleConnection(t,{...e,...n})});return this._handleConnection(t,e),t}},bm=class{didAbort=!1;_abortController;_connect;constructor(e,t){this._abortController=e??new AbortController,this._connect=t}abort(e){this._emitEvent({type:`manual`,reason:e})}reconnect(e){this.didAbort=!1,this._abortController.abort(),this._abortController=new AbortController,this._connect?.(e)}_abortHook;_emitEvent(e){this.didAbort||(this.didAbort=!0,this._abortHook?.(e),this._abortController.abort(e.reason))}onAbort(e){this._abortHook=e}get signal(){return this._abortController.signal}},xm=[`get`,`head`,`post`,`put`,`delete`,`connect`,`options`,`trace`,`patch`]})),Cm=!1,wm=!1,Tm=`__trellisUi`,Em=(e,...t)=>{typeof console<`u`&&console.warn(e,...t)},Dm=e=>{let t=document.createElement(`template`);return t.innerHTML=e,t},Om=e=>Array.from(Dm(e).content.children).filter(e=>e instanceof HTMLElement),km=(e,t)=>{t.forEach(t=>e.initTree(t))},Am=(e,t)=>t||e.getAttribute(`x-merge`)||`replace`,jm=e=>{if(e.selector)return document.querySelector(e.selector);if(!e.target)return null;let t=e.target.startsWith(`#`)?e.target.slice(1):e.target;return document.getElementById(t)},Mm=(e,t,n)=>{let r=Am(t,n.mode);if(r===`remove`){t.remove();return}if(!n.html){Em(`x-ui-stream: received patch with no html`);return}if(r===`morph`||r===`outer`){if(typeof e.morph==`function`){e.morph(t,n.html,{key(e){return e.getAttribute(`data-ui-key`)||e.id||null}});return}Em(`x-ui-stream: morph mode requires @alpinejs/morph; falling back to replace`)}if(r===`replace`||r===`morph`||r===`outer`){let[r]=Om(n.html);if(!r){Em(`x-ui-stream: replace mode produced no element`);return}t.replaceWith(r),e.initTree(r);return}if(r===`update`){let r=Om(n.html);t.innerHTML=n.html,km(e,Array.from(t.children).filter(e=>e instanceof HTMLElement)),r.length===0&&n.html.trim()&&e.initTree(t);return}let i=Dm(n.html),a=Array.from(i.content.children).filter(e=>e instanceof HTMLElement);if(r===`append`){t.append(i.content),km(e,a);return}if(r===`prepend`){t.prepend(i.content),km(e,a);return}if(r===`before`){t.before(i.content),km(e,a);return}r===`after`&&(t.after(i.content),km(e,a))},Nm=(e,t)=>{let n=jm(t);if(n){Mm(e,n,t);return}if(t.selector||t.target){Em(`x-ui-stream: target not found`,t.selector??t.target);return}if(!t.html){Em(`x-ui-stream: received patch with no html`);return}Om(t.html).forEach(n=>{if(!n.id){Em(`x-ui-stream: top-level element has no id, skipping`,n);return}let r=document.getElementById(n.id);r&&Mm(e,r,{...t,html:n.outerHTML})})},Pm=(e,t)=>{let n=Array.isArray(t)?t:[t];Js(e,n,{scope:`target`,update:()=>{n.forEach(t=>Nm(e,t))}})},Fm=(e,t)=>{Nm(e,t)},Im=e=>{document.dispatchEvent(new CustomEvent(e.event,{detail:e.detail??{},bubbles:!0,composed:!0}))},Lm=e=>typeof e==`object`&&!!e,Rm=e=>({...Lm(e)?e:{},[Tm]:!0}),zm=e=>Lm(e)&&e[Tm]===!0,Bm=()=>{zm(window.history.state)||window.history.replaceState(Rm(window.history.state),``,window.location.href)},Vm=e=>{zm(e.state)&&window.location.reload()},Hm=e=>{if(!(e instanceof Element))return!1;let t=e._ajax_target;return!!(t&&Object.values(t).some(e=>e?.history===`push`))},Um=e=>{Hm(e.target)&&Bm()},Wm=()=>{wm||=(window.addEventListener(`popstate`,Vm),!0)},Gm=e=>{let t=e.mode??`push`;if(t===`assign`){window.location.assign(e.url);return}Wm(),Bm();let n=Rm(window.history.state);if(t===`replace`){window.history.replaceState(n,``,e.url);return}window.history.pushState(n,``,e.url)},Km=(e,t)=>{if(t.type===`patch`){let{type:n,...r}=t;Pm(e,r);return}if(t.type===`dispatch`){let{type:e,...n}=t;Im(n);return}if(t.type===`location`){Gm(t);return}Em(`x-ui-stream: unknown UI effect`,t)},qm=(e,t)=>{(Array.isArray(t)?t:[t]).forEach(t=>Km(e,t))},Jm=e=>typeof e==`object`&&!!e&&Array.isArray(e.events),Ym=e=>{let t=e instanceof CustomEvent?e.detail:null,n=t?.headers;if(!n)return null;let r=n.get(`X-Trellis-UI-Events`);if(r)try{let e=JSON.parse(r);return Array.isArray(e)?e:null}catch{return Em(`x-ui-stream: received invalid UI effect header`,r),null}if(n.get(`X-Trellis-UI-Response`)!==`events`)return null;try{let e=JSON.parse(t?.raw??`{}`);return Jm(e)?e.events??[]:null}catch{return Em(`x-ui-stream: received invalid UI effect response`,t?.raw),null}},Xm=e=>{try{return JSON.parse(e.data)}catch{return Em(`x-ui-stream: received invalid JSON`,e.data),null}},Zm=async(e,t)=>{let{EventSourcePlus:n}=await Promise.resolve().then(()=>(Sm(),um));return new n(t).listen({onMessage(t){if(t.event===`trellis-ui-patch`){let n=Xm(t);n&&Pm(e,n);return}if(t.event===`trellis-ui-event`){let e=Xm(t);e&&Im(e);return}if(t.event===`trellis-ui-effects`){let n=Xm(t);n&&qm(e,n)}}})},Qm=e=>{typeof e.directive==`function`&&(Wm(),e.directive(`ui-stream`,(t,{expression:n},{cleanup:r})=>{if(!n)return;let i=null,a=!1;Zm(e,n).then(e=>{if(a){e.abort();return}i=e}),r(()=>{a=!0,i?.abort()})}),Cm||=(document.addEventListener(`ajax:success`,t=>{Um(t);let n=Ym(t);n&&qm(e,n)}),!0))},$m=[`light`,`dark`,`system`],eh=e=>typeof e==`string`&&$m.includes(e),th=e=>eh(e)?e:`system`,nh=()=>document.documentElement.dataset.themeStorageKey||`trellis-ui-theme`,rh=()=>th(document.documentElement.dataset.theme),ih=()=>{try{return th(window.localStorage.getItem(nh())||rh())}catch{return rh()}},ah=e=>{try{window.localStorage.setItem(nh(),e)}catch{}},oh=()=>window.matchMedia(`(prefers-color-scheme: dark)`).matches,sh=e=>e===`dark`||e===`system`&&oh(),ch=e=>{let t=sh(e),n=t?`dark`:`light`,r=document.documentElement;return r.classList.toggle(`dark`,t),r.dataset.theme=e,r.dataset.resolvedTheme=n,r.dispatchEvent(new CustomEvent(`ui:theme-change`,{detail:{mode:e,resolved:n,dark:t,on:t},bubbles:!0})),{mode:e,resolved:n,dark:t,on:t}},lh=()=>{let e=ch(ih());return{mode:e.mode,resolved:e.resolved,dark:e.dark,on:e.on,set(e){let t=th(e);ah(t);let n=ch(t);this.mode=n.mode,this.resolved=n.resolved,this.dark=n.dark,this.on=n.on},toggle(){this.set(this.dark?`light`:`dark`)}}},uh=e=>{if(typeof e.store!=`function`)return;let t=e.store(`theme`)??lh();e.store(`theme`,t),window.matchMedia(`(prefers-color-scheme: dark)`).addEventListener(`change`,()=>{if(t.mode!==`system`)return;let e=ch(`system`);t.mode=e.mode,t.resolved=e.resolved,t.dark=e.dark,t.on=e.on})},dh=0,fh=null,ph=()=>{if(dh===0){let e=document.documentElement,t=document.body,n=Math.max(0,window.innerWidth-e.clientWidth);fh={bodyOverflow:t.style.overflow,bodyPaddingRight:t.style.paddingRight,rootOverflow:e.style.overflow},e.style.overflow=`hidden`,t.style.overflow=`hidden`,n>0&&(t.style.paddingRight=`${n}px`),e.setAttribute(`data-ui-scroll-locked`,``)}dh+=1},mh=()=>{if(dh===0||(--dh,dh>0))return;let e=document.documentElement,t=document.body;t.style.overflow=fh?.bodyOverflow??``,t.style.paddingRight=fh?.bodyPaddingRight??``,e.style.overflow=fh?.rootOverflow??``,e.removeAttribute(`data-ui-scroll-locked`),fh=null},K={createAnchoredPopover:Hl,createCollectionNavigation:Yl,create:ou,addDismissableLayer:Lu,addListener:ju,asBool:ku,dispatch:Au,dispatchNativeControlChange:Hu,isRtl:Fu,removeAttribute:Pu,setAttribute:Nu,setPresence:Mu,syncControlPresence:Ru,syncNativeControl:zu,syncRepeatedHiddenInputs:Vu,getPathValue:Ku,normalizeOptionText:Uu,parseItemData:Gu,splitControlValues:Wu,createResizable:Gf,mergeBindings:du,propsFromSchema:Yf,resolveStyle:G,className:Gl,cx:Kl,motion:Ys,applyStreamPatch:Fm,applyStreamPatches:Pm,applyUiEffect:Km,applyUiEffects:qm,connectStream:Zm,dispatchStreamEvent:Im,applyThemeMode:ch,createThemeStore:lh,lockDocumentScroll:ph,registerConfirm:ru,registerResizable:Kf,registerStream:Qm,registerThemeStore:uh,unregisterConfirm:iu,unlockDocumentScroll:mh},hh=[`xs`,`sm`,`md`,`lg`,`xlg`],gh=[`outline`,`filled`],_h=[`outline`,`solid`,`mini`,`micro`],vh=[`button`,`submit`,`reset`],yh=[`start`,`center`,`end`],bh=[`bottom`,`top`,`left`,`right`],xh=[`top`,`right`,`bottom`,`left`],Sh=[`vertical`,`horizontal`],Ch=[`leading`,`trailing`,`center`,`top-leading`,`top-trailing`,`bottom-leading`,`bottom-trailing`],wh=[`default`],Th=[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`],Eh={inherit:`text-inherit`,muted:`text-foreground-muted`,subtle:`text-foreground-subtle`,accent:`text-accent-text`,danger:`text-danger-text`};Eh.muted,Eh.subtle,Eh.accent,Eh.danger;var Dh=[`none`,`xs`,`sm`,`md`,`lg`,`full`],Oh=[`solid`,`alpha`],kh={none:`bg-transparent text-inherit`,app:`bg-app text-foreground`,chrome:`bg-chrome text-foreground`,subtle:`bg-surface-subtle text-foreground`,panel:`bg-surface-panel text-foreground`,raised:`bg-surface-raised text-foreground`,overlay:`bg-surface-overlay text-foreground`,accent:`bg-surface-accent text-surface-accent-fg`,inverse:`bg-surface-inverse text-surface-inverse-fg`},Ah={solid:``,alpha:``},jh={xs:{none:``,xs:`rounded-1`,sm:`rounded-1`,md:`rounded-2`,lg:`rounded-3`,full:`rounded-full`},sm:{none:``,xs:`rounded-1`,sm:`rounded-2`,md:`rounded-2`,lg:`rounded-3`,full:`rounded-full`},md:{none:``,xs:`rounded-1`,sm:`rounded-2`,md:`rounded-3`,lg:`rounded-4`,full:`rounded-full`},lg:{none:``,xs:`rounded-2`,sm:`rounded-3`,md:`rounded-4`,lg:`rounded-5`,full:`rounded-full`},xlg:{none:``,xs:`rounded-2`,sm:`rounded-3`,md:`rounded-4`,lg:`rounded-5`,full:`rounded-full`}},Mh=(e=>hh.flatMap(t=>Dh.map(n=>({when:{size:t,radius:n},class:e[t][n]}))))(jh),Nh=[`flex w-full min-w-0 items-center gap-control text-control-fg outline-none`,`data-disabled:cursor-not-allowed data-disabled:opacity-50`],Ph=[`data-invalid:focus-within:shadow-danger-focus data-invalid:data-[state=open]:shadow-danger-focus`],Fh={xs:`min-h-control-xs px-1.5 text-xs`,sm:`min-h-control-sm px-2 text-xs`,md:`min-h-control-md px-3 text-sm`,lg:`min-h-control-lg px-3 text-sm`,xlg:`min-h-control-xlg px-4 text-sm`},Ih={outline:`bg-control shadow-control`,filled:`bg-control-hover shadow-none hover:bg-control-active`},Lh=[`border-0 bg-transparent p-0 text-inherit text-control-fg outline-none`,`placeholder:text-control-placeholder disabled:cursor-not-allowed`],Rh=[`inline-flex size-control-xs shrink-0 items-center justify-center rounded-2 border-0 bg-transparent`,`text-icon outline-none hover:bg-control-hover hover:text-control-fg`,`focus-visible:ring-2 focus-visible:ring-focus`],zh=[`w-full bg-control text-control-fg shadow-control outline-none`,`disabled:cursor-not-allowed disabled:opacity-50`],Bh=[`absolute left-0 top-0 z-popover m-0 grid`,`rounded-3 bg-popover text-popover-fg shadow-popover outline-none`],Vh=[`ui-interactive:hover:bg-interactive-hover`,`ui-interactive:ui-active:bg-interactive-active`,`ui-interactive:ui-selected:bg-interactive-selected`,`ui-interactive:ui-selected:hover:bg-interactive-selected-hover`];[...Vh];var Hh=[`flex h-menu-item w-full cursor-default select-none items-center gap-2 rounded-2 px-menu-item-x`,`text-left text-sm font-normal text-menu-item-fg outline-none`,Vh,`data-disabled:pointer-events-none data-disabled:opacity-50`],Uh=`size-icon shrink-0 fill-current text-current opacity-70`,Wh=`ml-auto size-icon shrink-0 fill-current text-current opacity-0 data-selected:opacity-100`,Gh=[`single`,`multiple`],Kh=Sh,qh=[`trailing`,`leading`];[...qh];var Jh=Th;[...Jh];var Yh={mode:U(Gh,`single`),collapsible:H,disabled:H,orientation:U(Kh,`vertical`),defaultValue:B,defaultValues:B,loop:H.default(!0),iconPosition:U(qh,`trailing`),headingAs:U(Jh,`h3`),class:B},Xh=W({definition:{component:`ui.accordion`,parts:{root:{base:`grid w-full min-w-0 gap-0`,variants:{orientation:{vertical:``,horizontal:`gap-2 md:grid-flow-col md:auto-cols-fr`}},defaults:{orientation:`vertical`}},item:{base:`min-w-0 border-b border-border last:border-b-0 data-disabled:opacity-50`},heading:{base:`block text-foreground`},trigger:{base:[`flex min-h-control-xlg w-full min-w-0 items-center gap-2 rounded-2 border border-transparent px-3 py-2`,`text-left text-sm font-medium text-foreground outline-none`,`focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2 focus-visible:ring-offset-app`,`data-disabled:pointer-events-none data-disabled:opacity-50`]},triggerLabel:{base:`min-w-0 flex-1`},icon:{base:`size-icon shrink-0 fill-current text-icon`},content:{base:`overflow-hidden text-sm text-foreground-muted`},contentInner:{base:`min-w-0 px-3 pb-3 pt-1`}}}}),Zh=e=>e.split(`,`).map(e=>e.trim()).filter(Boolean),Qh=e=>e?`open`:`closed`,$h=e=>e instanceof HTMLButtonElement,eg=()=>({props:null,openValues:new Set,collection:null,cleanup:[],init(){this.props=z({el:this.$el,schema:Yh}),this.openValues=new Set(this.initialValues()),this.setupTriggers(),this.syncAll()},destroy(){this.props.disconnect(),this.teardown()},get root(){return K.mergeBindings({inputs:[K.resolveStyle({part:Xh.parts.root,props:this.props,className:this.props.class}),{"data-ui-accordion":``,":data-orientation":()=>this.props.orientation,":data-disabled":()=>this.props.disabled?``:void 0}]})},items(){return Array.from(this.$el.querySelectorAll(`[data-ui-accordion-item]`)).map((e,t)=>{let n=e.querySelector(`[data-ui-accordion-trigger]`),r=e.querySelector(`[data-ui-accordion-content]`);return!$h(n)||!r?null:(e.dataset.value||(e.dataset.value=`item-${t+1}`),{item:e,heading:e.querySelector(`[data-ui-accordion-heading]`),trigger:n,content:r,value:e.dataset.value,isDisabled:this.props.disabled||K.asBool({value:e.dataset.disabled})})}).filter(e=>e!==null)},itemFromTrigger(e){return this.items().find(t=>t.trigger===e)??null},initialValues(){return this.props.mode===`multiple`&&this.props.defaultValues?this.normalizeValues(Zh(this.props.defaultValues)):this.props.mode===`single`&&this.props.defaultValue?this.normalizeValues([this.props.defaultValue]):this.normalizeValues(this.items().filter(e=>K.asBool({value:e.item.dataset.open})||e.item.dataset.state===`open`).map(e=>e.value))},normalizeValues(e){let t=Array.from(new Set(e.filter(Boolean)));return this.props.mode===`single`?t.slice(0,1):t},isItemOpen(e){return this.openValues.has(e.value)},isItemDisabled(e){return e.isDisabled},canCollapseOpenItem(e){return this.props.mode===`multiple`||this.props.collapsible||!this.isItemOpen(e)},toggleItem(e,t){if(t?.preventDefault(),this.isItemDisabled(e)||!this.canCollapseOpenItem(e))return;if(this.props.mode===`single`){this.setOpenValues(this.isItemOpen(e)?[]:[e.value]);return}let n=new Set(this.openValues);n.has(e.value)?n.delete(e.value):n.add(e.value),this.setOpenValues(Array.from(n))},setOpenValues(e){this.openValues=new Set(this.normalizeValues(e)),this.syncAll(),this.dispatchChange()},syncAll(){this.syncRoot(),this.items().forEach(e=>this.syncItem(e))},syncRoot(){this.$el.dataset.orientation=this.props.orientation,this.$el.dataset.iconPosition=this.props.iconPosition,this.$el.dataset.mode=this.props.mode,this.props.disabled?this.$el.setAttribute(`data-disabled`,``):this.$el.removeAttribute(`data-disabled`)},syncItem(e){let t=this.isItemOpen(e),n=Qh(t),r=this.isItemDisabled(e),i=t&&!this.canCollapseOpenItem(e);if(e.item.dataset.state=n,e.item.dataset.orientation=this.props.orientation,e.item.className=K.resolveStyle({part:Xh.parts.item,props:this.props,className:e.item.dataset.class??``}),e.heading?.setAttribute(`data-state`,n),e.heading?.setAttribute(`data-orientation`,this.props.orientation),e.trigger.id||=this.$id(`accordion-trigger-${e.value}`),e.content.id||=this.$id(`accordion-content-${e.value}`),e.trigger.type=`button`,e.trigger.dataset.state=n,e.trigger.dataset.orientation=this.props.orientation,e.trigger.className=K.resolveStyle({part:Xh.parts.trigger,props:this.props,className:e.trigger.dataset.class??``}),e.trigger.setAttribute(`aria-expanded`,t?`true`:`false`),e.trigger.setAttribute(`aria-controls`,e.content.id),e.content.dataset.state=n,e.content.dataset.orientation=this.props.orientation,e.content.setAttribute(`aria-labelledby`,e.trigger.id),this.syncContent(e.content,t),r){e.item.setAttribute(`data-disabled`,``),e.heading?.setAttribute(`data-disabled`,``),e.trigger.setAttribute(`data-disabled`,``),e.trigger.setAttribute(`aria-disabled`,`true`),e.trigger.disabled=!0,e.content.setAttribute(`data-disabled`,``);return}e.item.removeAttribute(`data-disabled`),e.heading?.removeAttribute(`data-disabled`),e.trigger.removeAttribute(`data-disabled`),e.trigger.disabled=!1,e.content.removeAttribute(`data-disabled`),i?e.trigger.setAttribute(`aria-disabled`,`true`):e.trigger.removeAttribute(`aria-disabled`)},syncContent(e,t){e.hidden=!t},setupTriggers(){this.items().forEach(e=>{K.addListener({target:e.trigger,event:`click`,handler:t=>this.toggleItem(e,t),cleanup:this.cleanup}),K.addListener({target:e.trigger,event:`keydown`,handler:t=>{t instanceof KeyboardEvent&&this.handleTriggerKeydown(e.trigger,t)},cleanup:this.cleanup}),K.addListener({target:e.trigger,event:`focus`,handler:()=>this.collectionNav().activateItem({el:e.trigger}),cleanup:this.cleanup})})},teardown(){this.cleanup.forEach(e=>e()),this.cleanup=[]},collectionNav(){return this.collection||=K.createCollectionNavigation({root:()=>this.$el,itemSelector:`[data-ui-accordion-trigger]`,isDisabled:e=>K.asBool({value:e.dataset.disabled})||e.hasAttribute(`disabled`),loop:()=>this.props.loop}),this.collection},handleTriggerKeydown(e,t){let n=this.itemFromTrigger(e);if(!n)return;if(t.key===`Enter`||t.key===` `){this.toggleItem(n,t);return}let r=this.props.orientation;if(t.key===`Home`){t.preventDefault(),this.focusFirst();return}if(t.key===`End`){t.preventDefault(),this.focusLast();return}if(r===`vertical`){if(t.key===`ArrowDown`){t.preventDefault(),this.focusNext();return}t.key===`ArrowUp`&&(t.preventDefault(),this.focusPrevious());return}if(t.key===`ArrowRight`){t.preventDefault(),K.isRtl({el:this.$el})?this.focusPrevious():this.focusNext();return}t.key===`ArrowLeft`&&(t.preventDefault(),K.isRtl({el:this.$el})?this.focusNext():this.focusPrevious())},focusNext(){this.collectionNav().focusNext()},focusPrevious(){this.collectionNav().focusPrevious()},focusFirst(){this.collectionNav().focusFirst()},focusLast(){this.collectionNav().focusLast()},dispatchChange(){let e=Array.from(this.openValues),t={value:this.props.mode===`single`?e[0]??``:``,values:e};K.dispatch({el:this.$el,name:`ui:change`,detail:t})}}),tg=e=>{e.data(`UiAccordion`,()=>eg())};W({definition:{component:`ui.button`,parts:{root:{base:[`relative inline-flex min-w-0 shrink-0 select-none items-center gap-2 whitespace-nowrap font-normal outline-none`,`focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2 focus-visible:ring-offset-app`],variants:{align:{start:`justify-start`,center:`justify-center`,end:`justify-end`},size:{xs:`h-control-xs text-xs`,sm:`h-control-sm text-xs`,md:`h-control-md text-sm`,lg:`h-control-lg text-sm`,xlg:`h-control-xlg text-sm`},padded:{true:``,false:``},variant:{ghost:`bg-transparent shadow-none`,soft:`shadow-none`,surface:`shadow-border hover:shadow-border-hover`,outline:`bg-transparent shadow-none ring-1 ring-inset`,solid:`shadow-none`,link:`bg-transparent px-0 shadow-none`},color:{neutral:``,accent:``,danger:``},insetLeft:{true:``,false:``},insetRight:{true:``,false:``},insetTop:{true:`-mt-1`,false:``},insetBottom:{true:`-mb-1`,false:``}},compounds:[{when:{padded:!0,size:`xs`},class:`px-2`},{when:{padded:!0,size:`sm`},class:`px-2`},{when:{padded:!0,size:`md`},class:`px-3`},{when:{padded:!0,size:`lg`},class:`px-3`},{when:{padded:!0,size:`xlg`},class:`px-4`},{when:{padded:!1,size:`xs`},class:`w-control-xs px-0`},{when:{padded:!1,size:`sm`},class:`w-control-sm px-0`},{when:{padded:!1,size:`md`},class:`w-control-md px-0`},{when:{padded:!1,size:`lg`},class:`w-control-lg px-0`},{when:{padded:!1,size:`xlg`},class:`w-control-xlg px-0`},...Mh,{when:{insetLeft:!0,size:`xs`},class:`-ml-2`},{when:{insetLeft:!0,size:`sm`},class:`-ml-2`},{when:{insetLeft:!0,size:`md`},class:`-ml-3`},{when:{insetLeft:!0,size:`lg`},class:`-ml-3`},{when:{insetLeft:!0,size:`xlg`},class:`-ml-4`},{when:{insetRight:!0,size:`xs`},class:`-mr-2`},{when:{insetRight:!0,size:`sm`},class:`-mr-2`},{when:{insetRight:!0,size:`md`},class:`-mr-3`},{when:{insetRight:!0,size:`lg`},class:`-mr-3`},{when:{insetRight:!0,size:`xlg`},class:`-mr-4`},{when:{variant:`ghost`,color:`neutral`},class:`text-foreground`},{when:{variant:`ghost`,color:`accent`},class:`text-accent-text`},{when:{variant:`ghost`,color:`danger`},class:`text-danger-text`},{when:{variant:`soft`,color:`neutral`},class:`bg-base-a2 text-foreground`},{when:{variant:`soft`,color:`accent`},class:`bg-accent-surface text-accent-text`},{when:{variant:`soft`,color:`danger`},class:`bg-danger-surface text-danger-text`},{when:{variant:`surface`,color:`neutral`},class:`bg-control text-foreground`},{when:{variant:`surface`,color:`accent`},class:`bg-control text-accent-text`},{when:{variant:`surface`,color:`danger`},class:`bg-control text-danger-text`},{when:{variant:`outline`,color:`neutral`},class:`text-foreground ring-border-interactive`},{when:{variant:`outline`,color:`accent`},class:`text-accent-text ring-accent-border`},{when:{variant:`outline`,color:`danger`},class:`text-danger-text ring-danger-border`},{when:{variant:`solid`,color:`neutral`},class:`bg-base-12 text-base-1 shadow-1`},{when:{variant:`solid`,color:`accent`},class:`bg-accent-solid text-accent-contrast shadow-1`},{when:{variant:`solid`,color:`danger`},class:`bg-danger-solid text-danger-contrast shadow-1`},{when:{variant:`link`,color:`neutral`},class:`text-foreground hover:text-foreground`},{when:{variant:`link`,color:`accent`},class:`text-accent-text hover:text-accent-12`},{when:{variant:`link`,color:`danger`},class:`text-danger-text hover:text-danger-12`}],defaults:{align:`center`,size:`md`,radius:`md`,padded:!0,variant:`surface`,color:`neutral`,insetLeft:!1,insetRight:!1,insetTop:!1,insetBottom:!1}},group:{base:`inline-flex items-center isolate`},content:{base:`flex min-w-0 flex-1 items-center gap-2`,variants:{align:{start:`justify-start`,center:`justify-center`,end:`justify-end`}},defaults:{align:`center`}},label:{base:`min-w-0`},loadingIndicator:{base:`pointer-events-none absolute inset-0 flex items-center justify-center`},icon:{base:`size-icon shrink-0 fill-current text-current`,variants:{position:{leading:``,trailing:`ml-auto`}},defaults:{position:`leading`}}}}});var ng=`[data-ui-button]:not([data-ui-loading-mode="false"])`,rg=[`data-on`,`data-bind`,`data-ref`,`data-show`,`data-action`,`data-request`,`data-ui-request`,`wire:`],ig=[`ui:request-complete`,`ui:loading-complete`],ag=null,og=e=>e instanceof HTMLButtonElement||e instanceof HTMLAnchorElement,sg=e=>{if(!(e instanceof Element))return null;let t=e.closest(ng);return og(t)?t:null},cg=e=>e.getAttributeNames().some(e=>rg.some(t=>e.startsWith(t))),lg=e=>e instanceof HTMLButtonElement&&e.type===`submit`,ug=e=>e instanceof HTMLButtonElement&&(e.dataset.uiConfirm!==void 0||e.form?.dataset.uiConfirm!==void 0),dg=(e,t)=>t?.dataset.uiConfirm!==void 0||e?.dataset.uiConfirm!==void 0,fg=e=>e.dataset.uiLoadingMode===`true`||lg(e)||cg(e),pg=e=>e.dataset.uiSubmitting===`true`||e.getAttribute(`aria-disabled`)===`true`||e.hasAttribute(`disabled`),mg=e=>e.dataset.uiSubmitting===`true`||e.hasAttribute(`disabled`),hg=e=>{e.dataset.uiSubmitting=`true`,e.setAttribute(`data-ui-loading`,``),e.setAttribute(`aria-disabled`,`true`),e.setAttribute(`aria-busy`,`true`),e.dispatchEvent(new CustomEvent(`ui:loading-start`,{bubbles:!0})),e instanceof HTMLButtonElement?e.disabled=!0:e.tabIndex=-1},gg=e=>{e.dataset.initialLoading!==`true`&&(delete e.dataset.uiSubmitting,e.removeAttribute(`data-ui-loading`),e.removeAttribute(`aria-busy`),e.dataset.initialDisabled!==`true`&&(e.removeAttribute(`aria-disabled`),e instanceof HTMLButtonElement?e.disabled=!1:e.removeAttribute(`tabindex`),e.dispatchEvent(new CustomEvent(`ui:loading-end`,{bubbles:!0}))))},_g=(e,t)=>{window.setTimeout(()=>{!e.isConnected||mg(e)||hg(e)},0)},vg=e=>{let t=sg(e.target);if(!(!t||!fg(t))){if(pg(t)){e.preventDefault(),e.stopImmediatePropagation();return}t instanceof HTMLButtonElement&&t.form&&!t.form.checkValidity()||ug(t)||_g(t,e)}},yg=e=>{let t=e,n=t.submitter instanceof HTMLElement?t.submitter:null,r=og(n)?n:null,i=e.target instanceof HTMLFormElement?e.target:null,a=r?r.matches(ng)?r:null:i?.querySelector(ng)??null;e.defaultPrevented&&dg(i,n)||!a||!lg(a)||_g(a,e)},bg=()=>{document.querySelectorAll(`[data-ui-button][data-ui-submitting="true"]`).forEach(e=>gg(e))},xg=()=>{ag||=(document.addEventListener(`click`,vg,!0),document.addEventListener(`submit`,yg,!0),ig.forEach(e=>document.addEventListener(e,bg)),()=>{document.removeEventListener(`click`,vg,!0),document.removeEventListener(`submit`,yg,!0),ig.forEach(e=>document.removeEventListener(e,bg)),ag=null})},Sg=Sh,Cg=wh,wg=Ch,Tg=hh,Eg=wh,Dg={value:B.default(`on`),name:B,label:B,description:B,checked:H,indeterminate:H,disabled:H,required:H,invalid:H,indicator:H.default(!0),placement:U(wg,`leading`),icon:B,variant:U(Eg,`default`),size:U(Tg,`md`),inputClass:B,indicatorClass:B,indicatorIconClass:B,iconClass:B,contentClass:B,labelClass:B,descriptionClass:B,class:B};({...Dg});var Og={name:B,orientation:U(Sg,`vertical`),variant:U(Cg,`default`),indicator:H.default(!0),placement:U(wg,`leading`),disabled:H,required:H,invalid:H,class:B};U(Tg,`md`);var kg=e=>{let t=e.querySelector(`[data-ui-checkbox-input]`);return t?{root:e,input:t,indicator:e.querySelector(`[data-ui-checkbox-indicator]`),checkedIcon:e.querySelector(`[data-ui-checkbox-indicator-icon="checked"]`),indeterminateIcon:e.querySelector(`[data-ui-checkbox-indicator-icon="indeterminate"]`),name:e.dataset.name||t.name||``,disabled:e.hasAttribute(`data-disabled`)||t.disabled,required:e.hasAttribute(`data-required`)||t.required,invalid:e.hasAttribute(`data-invalid`)||t.getAttribute(`aria-invalid`)===`true`}:null},Ag=(e,t={})=>{let n=t.disabled??e.disabled,r=t.required??e.required,i=t.invalid??e.invalid,a=e.input.indeterminate||e.root.hasAttribute(`data-indeterminate`),o=e.input.checked&&!a,s=a?`indeterminate`:o?`checked`:`unchecked`;e.input.indeterminate=a,K.syncNativeControl({input:e.input,state:{disabled:n,required:r,invalid:i}}),a?e.input.setAttribute(`aria-checked`,`mixed`):e.input.removeAttribute(`aria-checked`),K.setAttribute({el:e.root,attr:`data-state`,value:s}),K.setPresence({el:e.root,attr:`data-checked`,present:o}),K.setPresence({el:e.root,attr:`data-indeterminate`,present:a}),K.syncControlPresence({el:e.root,state:{disabled:n,required:r,invalid:i}}),K.setPresence({el:e.input,attr:`data-checked`,present:o}),K.setPresence({el:e.input,attr:`data-indeterminate`,present:a}),e.indicator&&(K.setAttribute({el:e.indicator,attr:`data-state`,value:s}),K.setPresence({el:e.indicator,attr:`data-checked`,present:o}),K.setPresence({el:e.indicator,attr:`data-indeterminate`,present:a}),K.setPresence({el:e.indicator,attr:`data-invalid`,present:i})),e.checkedIcon&&(K.setPresence({el:e.checkedIcon,attr:`data-checked`,present:o}),K.removeAttribute({el:e.checkedIcon,attr:`data-indeterminate`})),e.indeterminateIcon&&(K.setPresence({el:e.indeterminateIcon,attr:`data-indeterminate`,present:a}),K.removeAttribute({el:e.indeterminateIcon,attr:`data-checked`}))},jg=()=>({props:null,listeners:[],init(){this.props=z({el:this.$el,schema:Dg});let e=this.input();(this.props.indeterminate||this.$el.hasAttribute(`data-indeterminate`))&&(e.indeterminate=!0),K.addListener({target:e,event:`change`,handler:()=>{e.indeterminate=!1,this.$el.removeAttribute(`data-indeterminate`),this.sync()},cleanup:this.listeners}),this.sync()},destroy(){this.props.disconnect(),this.listeners.forEach(e=>e()),this.listeners=[]},input(){let e=this.$el.querySelector(`[data-ui-checkbox-input]`);if(!e)throw Error(`Checkbox requires a native checkbox input.`);return e},item(){let e=kg(this.$el);if(!e)throw Error(`Checkbox requires a native checkbox input.`);return e},sync(){let e=this.item();this.props.name&&(e.input.name=this.props.name),this.props.value&&(e.input.value=this.props.value),Ag(e,{disabled:this.props.disabled||e.disabled,required:this.props.required||e.required,invalid:this.props.invalid||e.invalid})}}),Mg=()=>({props:null,listeners:[],observer:null,init(){this.props=z({el:this.$el,schema:Og}),K.addListener({target:this.$el,event:`change`,handler:e=>{let t=e.target;!(t instanceof HTMLInputElement)||t.type!==`checkbox`||(t.indeterminate=!1,t.closest(`[data-ui-checkbox]`)?.removeAttribute(`data-indeterminate`),this.sync())},cleanup:this.listeners}),this.observer=new MutationObserver(()=>this.sync()),this.observer.observe(this.$el,{childList:!0,subtree:!0}),this.sync()},destroy(){this.props.disconnect(),this.listeners.forEach(e=>e()),this.listeners=[],this.observer?.disconnect()},items(){return Array.from(this.$el.querySelectorAll(`[data-ui-checkbox]`)).map(kg).filter(e=>e!==null)},sync(){let e=this.$el;K.setAttribute({el:e,attr:`data-orientation`,value:this.props.orientation}),K.setAttribute({el:e,attr:`data-variant`,value:this.props.variant}),K.syncControlPresence({el:e,state:this.props}),this.items().forEach(e=>this.syncItem(e))},syncItem(e){this.props.name&&!e.name&&(e.input.name=this.props.name),Ag(e,{disabled:this.props.disabled||e.disabled,required:this.props.required||e.required,invalid:this.props.invalid||e.invalid})}}),Ng=e=>{e.data(`UiCheckbox`,()=>jg()),e.data(`UiCheckboxGroup`,()=>Mg())},Pg=hh,Fg=gh,Ig=Dh,Lg=bh,Rg=yh,zg=_h,Bg={name:B,value:B,values:B,placeholder:B,multiple:H,open:H,disabled:H,readonly:H,required:H,invalid:H,clearable:H,autoHighlight:H,filter:H.default(!0),path:B,loop:H.default(!0),size:U(Pg,`lg`),variant:U(Fg,`outline`),radius:U(Ig,`md`),side:U(Lg,`bottom`),align:U(Rg,`start`),offset:V.clamp(-100,100).default(0),gap:V.clamp(0,50).default(4),icon:B,iconTrailing:B.default(`chevron__down`),iconVariant:U(zg,`outline`),inputClass:B,listboxClass:B,chipClass:B,class:B};U(zg,`outline`);var Vg=W({definition:{component:`ui.combobox`,parts:{root:{base:`relative inline-grid w-full min-w-0`},control:{base:Nh,variants:{size:Fh,variant:Ih},defaults:{size:`lg`,variant:`outline`,radius:`md`},compounds:Mh},chips:{base:`-ml-1.5 flex min-w-0 flex-wrap items-center gap-1`},chip:{base:[`inline-flex h-control-sm max-w-48 min-w-0 items-center gap-1 rounded-2 border border-border bg-current/10 px-2`,`text-sm font-normal text-foreground`]},chipLabel:{base:`min-w-0 flex-1`},chipRemove:{base:[`-mr-1 inline-flex size-control-xs shrink-0 items-center justify-center rounded-2 border-0 bg-transparent`,`text-icon outline-none hover:bg-base-a3 hover:text-foreground`,`focus-visible:ring-2 focus-visible:ring-focus`]},input:{base:[`w-full min-w-16 flex-1`,Lh]},icon:{base:`size-icon shrink-0 fill-current text-icon`,variants:{position:{leading:``,trailing:``}},defaults:{position:`leading`}},clear:{base:Rh},listbox:{base:[Bh,`auto-rows-min content-start max-h-combobox-listbox min-w-48 gap-1 overflow-auto p-popover`]},option:{base:Hh},optionLabel:{base:`min-w-0 flex-1`},optionMeta:{base:`ml-auto text-menu-item-muted`},optionIcon:{base:Uh,variants:{position:{leading:``,trailing:`ml-auto`}},defaults:{position:`leading`}},optionIndicator:{base:Wh},group:{base:`grid auto-rows-min content-start gap-1`},label:{base:`px-menu-item-x py-1 text-menu-heading-fg`},empty:{base:`px-menu-item-x py-2 text-sm text-foreground-muted`},separatorRoot:{base:`-mx-popover my-popover h-px`},separatorRule:{base:`h-px w-full border-0 bg-menu-separator`}}}}),Hg=()=>({isOpen:!1,query:``,selectedValues:[],selectedLabels:[],activeValue:``,inputId:``,listboxId:``,props:null,popover:null,listboxMotion:null,listeners:[],observer:null,renderedChipsKey:``,renderedHiddenInputsKey:``,init(){this.props=z({el:this.$el,schema:Bg}),this.inputId=this.$id(`combobox-input`),this.listboxId=this.$id(`combobox-listbox`),this.isOpen=this.props.open;let e=this.options(),t=this.props.multiple?[...K.splitControlValues(this.props.values),...K.splitControlValues(this.props.value)]:K.splitControlValues(this.props.value).slice(0,1),n=e.filter(e=>K.asBool({value:e.el.dataset.selected})).map(e=>e.value);this.selectedValues=t.length>0?t:n,this.props.multiple||(this.selectedValues=this.selectedValues.slice(0,1)),this.selectedLabels=this.selectedValues.map(t=>e.find(e=>e.value===t)?.label??t),this.query=this.props.multiple?``:this.selectedLabels[0]??``,this.popover=K.createAnchoredPopover({reference:()=>this.control(),floating:()=>this.listbox(),position:()=>this.props.side,align:()=>this.props.align,gap:()=>this.props.gap,offset:()=>this.props.offset,matchReferenceWidth:!0}),this.listboxMotion=K.motion.createPresenceLifecycle({element:()=>this.listbox(),preset:`popover`}),this.setup(),this.sync(),this.isOpen&&this.mount()},destroy(){this.props.disconnect(),this.listboxMotion?.destroy(),this.listeners.forEach(e=>e()),this.listeners=[],this.observer?.disconnect(),this.unmount()},get root(){return K.mergeBindings({inputs:[G({part:Vg.parts.root,props:this.props,className:this.props.class}),{"data-ui-combobox":``,":data-state":()=>this.isOpen?`open`:`closed`,":data-disabled":()=>this.props.disabled?`true`:void 0,":data-invalid":()=>this.props.invalid?`true`:void 0}]})},control(){let e=this.$el.querySelector(`[data-ui-combobox-control]`);if(!e)throw Error(`Combobox requires a control element.`);return e},input(){let e=this.$el.querySelector(`[data-ui-combobox-input]`);if(!e)throw Error(`Combobox requires an input element.`);return e},listbox(){let e=this.$el.querySelector(`[data-ui-combobox-listbox]`);if(!e)throw Error(`Combobox requires a listbox element.`);return e},chipsEl(){return this.$el.querySelector(`[data-ui-combobox-chips]`)},hiddenInputsEl(){return this.$el.querySelector(`[data-ui-combobox-hidden-inputs]`)},options(){let e=K.normalizeOptionText(this.query);return Array.from(this.$el.querySelectorAll(`[data-ui-combobox-option]`)).map((t,n)=>{let r=this.resolveOptionLabel(t),i=this.optionValue(t,r),a=K.asBool({value:t.dataset.disabled}),o=this.selectedValues.includes(i),s=!this.props.filter||e===``||K.normalizeOptionText(`${r} ${t.dataset.suffix??``}`).includes(e);return{el:t,id:t.id||`${this.listboxId}-option-${n}`,value:i,label:r,disabled:a,selected:o,visible:s}})},enabledVisibleOptions(){return this.options().filter(e=>e.visible&&!e.disabled)},hasSelection(){return this.selectedValues.length>0},hasClearValue(){return this.query.length>0||this.hasSelection()},open(e){if(e?.preventDefault(),this.props.disabled)return;let t=this.isOpen;this.isOpen=!0,this.props.autoHighlight&&!this.activeValue&&this.setActive(this.enabledVisibleOptions()[0]??null),this.sync(),t||this.listboxMotion?.enter({before:()=>{let e=this.listbox();e.hidden=!1,e.showPopover?.(),this.mount()}}),K.dispatch({el:this.$el,name:`ui:open`})},close(e){e?.preventDefault();let t=this.isOpen;this.isOpen=!1,this.activeValue=``,!this.props.multiple&&this.hasSelection()&&(this.query=this.selectedLabels[0]??``),this.sync(),t&&this.listboxMotion?.exit({before:()=>{let e=this.listbox();e.dataset.state=`closed`,e.hidden=!1},after:()=>{this.isOpen||(this.listbox().hidePopover?.(),this.unmount(),this.syncListbox(),K.dispatch({el:this.$el,name:`ui:close`}))}})},toggle(e){if(e?.preventDefault(),!(this.props.readonly||this.props.disabled)){if(this.isOpen){this.close();return}this.open(),this.input().focus({preventScroll:!0})}},clear(e){e?.preventDefault(),!(this.props.disabled||this.props.readonly)&&(this.query=``,this.selectedValues=[],this.selectedLabels=[],this.activeValue=``,this.sync(),this.input().focus({preventScroll:!0}),K.dispatchNativeControlChange({container:this.hiddenInputsEl(),fallback:this.$el,marker:`data-ui-combobox-hidden-input`}),K.dispatch({el:this.$el,name:`ui:clear`}),K.dispatch({el:this.$el,name:`ui:change`,detail:{value:``,values:[],labels:[]}}))},removeValue(e){if(this.props.disabled||this.props.readonly)return;let t=this.options();this.selectedValues=this.selectedValues.filter(t=>t!==e),this.selectedLabels=this.selectedValues.map(e=>t.find(t=>t.value===e)?.label??e),this.sync(),K.dispatchNativeControlChange({container:this.hiddenInputsEl(),fallback:this.$el,marker:`data-ui-combobox-hidden-input`}),this.input().focus({preventScroll:!0}),K.dispatch({el:this.$el,name:`ui:change`,detail:{value:this.selectedValues[0]??``,values:[...this.selectedValues],labels:[...this.selectedLabels]}})},removeLastValue(e){!this.props.multiple||this.query!==``||this.selectedValues.length===0||(e?.preventDefault(),this.removeValue(this.selectedValues[this.selectedValues.length-1]))},selectOption(e,t){if(t?.preventDefault(),!(this.props.disabled||this.props.readonly||e.disabled)){if(this.props.multiple){this.selectedValues.includes(e.value)?this.selectedValues=this.selectedValues.filter(t=>t!==e.value):this.selectedValues=[...this.selectedValues,e.value];let t=this.options();this.selectedLabels=this.selectedValues.map(e=>t.find(t=>t.value===e)?.label??e),this.query=``,this.open()}else this.selectedValues=[e.value],this.selectedLabels=[e.label],this.query=e.label,this.input().focus({preventScroll:!0}),this.close();this.sync(),this.props.multiple&&this.input().focus({preventScroll:!0}),K.dispatchNativeControlChange({container:this.hiddenInputsEl(),fallback:this.$el,marker:`data-ui-combobox-hidden-input`}),K.dispatch({el:this.$el,name:`ui:change`,detail:{value:this.selectedValues[0]??``,values:[...this.selectedValues],label:this.selectedLabels[0]??``,labels:[...this.selectedLabels]}})}},setActive(e){(e?.value??``)!==this.activeValue&&(this.activeValue=e?.value??``,this.syncOptions(),this.syncInput())},moveActive(e){let t=this.enabledVisibleOptions();if(t.length===0)return;let n=t.findIndex(e=>e.value===this.activeValue),r=n+e;n<0&&(r=e>0?0:t.length-1),r>=t.length&&(r=this.props.loop?0:t.length-1),r<0&&(r=this.props.loop?t.length-1:0),this.setActive(t[r]??null)},focusFirst(){this.setActive(this.enabledVisibleOptions()[0]??null)},focusLast(){let e=this.enabledVisibleOptions();this.setActive(e[e.length-1]??null)},handleInput(e){if(this.props.readonly||this.props.disabled)return;let t=e.target;t instanceof HTMLInputElement&&(this.query=t.value,!this.props.multiple&&this.selectedLabels[0]!==this.query&&(this.selectedValues=[],this.selectedLabels=[]),this.open(),this.props.autoHighlight?this.focusFirst():this.setActive(null),this.sync())},handleKeydown(e){if(e.key===`ArrowDown`){e.preventDefault(),this.isOpen||this.open(),this.moveActive(1);return}if(e.key===`ArrowUp`){e.preventDefault(),this.isOpen||this.open(),this.moveActive(-1);return}if(this.isOpen&&e.key===`Home`){e.preventDefault(),this.focusFirst();return}if(this.isOpen&&e.key===`End`){e.preventDefault(),this.focusLast();return}if(e.key===`Enter`&&this.isOpen&&this.activeValue){let t=this.options().find(e=>e.value===this.activeValue);t&&this.selectOption(t,e);return}if((e.key===`Backspace`||e.key===`Delete`)&&this.props.multiple&&this.query===``){let t=this.input();t.selectionStart===0&&t.selectionEnd===0&&this.removeLastValue(e);return}e.key===`Escape`&&this.isOpen&&this.close(e)},handleFocusout(e){let t=e.relatedTarget;if(!(t instanceof Node)){this.close();return}this.$el.contains(t)||this.listbox().contains(t)||this.close()},sync(){this.syncControl(),this.syncInput(),this.syncListbox(),this.syncOptions(),this.syncHiddenInputs(),this.syncChips()},syncOptions(){let e=this.options(),t=this.$el.querySelector(`[data-ui-combobox-empty]`),n=e.some(e=>e.visible);e.forEach(e=>{e.el.id=e.id,e.el.hidden=!e.visible,e.el.setAttribute(`role`,`option`),e.el.setAttribute(`aria-selected`,e.selected?`true`:`false`),e.el.dataset.value=e.value,e.el.dataset.label=e.label,K.setPresence({el:e.el,attr:`data-selected`,present:e.selected,value:`true`}),K.setPresence({el:e.el,attr:`data-highlighted`,present:e.value===this.activeValue,value:`true`}),K.setPresence({el:e.el,attr:`data-disabled`,present:e.disabled,value:`true`}),e.el.querySelectorAll(`[data-ui-combobox-option-indicator]`).forEach(t=>{K.setPresence({el:t,attr:`data-selected`,present:e.selected,value:`true`})}),e.disabled?e.el.setAttribute(`aria-disabled`,`true`):e.el.removeAttribute(`aria-disabled`)}),t&&(t.hidden=n)},syncInput(){let e=this.input();e.id||=this.inputId,e.value!==this.query&&(e.value=this.query),e.setAttribute(`role`,`combobox`),e.setAttribute(`autocomplete`,`off`),e.setAttribute(`aria-autocomplete`,`list`),e.setAttribute(`aria-expanded`,this.isOpen?`true`:`false`),e.setAttribute(`aria-controls`,this.listboxId),K.syncNativeControl({input:e,state:{disabled:this.props.disabled,readonly:this.props.readonly,required:this.props.required,nativeRequired:this.props.required&&!this.props.multiple,invalid:this.props.invalid,ariaRequired:this.props.required}});let t=this.options().find(e=>e.value===this.activeValue);t?e.setAttribute(`aria-activedescendant`,t.id):e.removeAttribute(`aria-activedescendant`)},syncControl(){let e=this.control(),t=G({part:Vg.parts.control,props:this.props});e.setAttribute(`class`,t),e.setAttribute(`data-ui-control`,``),e.setAttribute(`data-ui-combobox-control`,``),e.dataset.state=this.isOpen?`open`:`closed`,e.dataset.variant=this.props.variant,K.syncControlPresence({el:e,state:{disabled:this.props.disabled,invalid:this.props.invalid},value:`true`})},syncListbox(){let e=this.listbox(),t=G({part:Vg.parts.listbox,props:this.props,className:this.props.listboxClass});e.id=this.listboxId,e.setAttribute(`class`,t),e.setAttribute(`role`,`listbox`),e.setAttribute(`tabindex`,`-1`),e.setAttribute(`popover`,`manual`),e.setAttribute(`data-ui-combobox-listbox`,``),e.dataset.state=this.isOpen?`open`:`closed`,e.hidden=!this.isOpen,this.props.multiple?e.setAttribute(`aria-multiselectable`,`true`):e.removeAttribute(`aria-multiselectable`)},syncHiddenInputs(){let e=this.hiddenInputsEl();e&&(this.renderedHiddenInputsKey=K.syncRepeatedHiddenInputs({container:e,state:{name:this.props.name,required:this.props.required,values:this.selectedValues,form:this.$el.dataset.form??``,marker:`data-ui-combobox-hidden-input`},currentKey:this.renderedHiddenInputsKey}))},syncChips(){let e=this.chipsEl();if(!e)return;let t=!this.props.multiple||this.selectedValues.length===0;e.hidden=t;let n=JSON.stringify({hidden:t,values:this.selectedValues,labels:this.selectedLabels,chipClass:this.props.chipClass});if(n===this.renderedChipsKey||(this.renderedChipsKey=n,e.replaceChildren(),e.hidden))return;let r=G({part:Vg.parts.chip,props:{},className:this.props.chipClass}),i=G({part:Vg.parts.chipLabel}),a=G({part:Vg.parts.chipRemove});this.selectedValues.forEach((t,n)=>{let o=this.selectedLabels[n]??t,s=document.createElement(`span`);s.className=r,s.setAttribute(`data-ui-combobox-chip`,``);let c=document.createElement(`span`);c.className=i,c.setAttribute(`data-ui-combobox-chip-label`,``),c.textContent=o,s.append(c);let l=document.createElement(`button`);l.type=`button`,l.className=a,l.setAttribute(`data-ui-combobox-chip-remove`,``),l.setAttribute(`aria-label`,`Remove ${o}`);let u=this.$el.querySelector(`[data-ui-combobox-chip-remove-icon]`);u?l.append(u.content.cloneNode(!0)):l.textContent=`x`,l.addEventListener(`click`,()=>this.removeValue(t)),s.append(l),e.append(s)})},syncPosition(){this.popover?.sync()},mount(){this.popover?.mount()},unmount(){this.popover?.unmount()},setup(){let e=this.input(),t=this.control(),n=this.listbox();K.addListener({target:e,event:`focus`,handler:()=>this.open(),cleanup:this.listeners}),K.addListener({target:e,event:`input`,handler:e=>this.handleInput(e),cleanup:this.listeners}),K.addListener({target:e,event:`keydown`,handler:e=>{e instanceof KeyboardEvent&&this.handleKeydown(e)},cleanup:this.listeners}),K.addListener({target:this.$el,event:`focusout`,handler:e=>{e instanceof FocusEvent&&this.handleFocusout(e)},cleanup:this.listeners}),K.addListener({target:t,event:`click`,handler:t=>{let n=t.target;n instanceof Element&&n.closest(`[data-ui-combobox-clear], [data-ui-combobox-toggle]`)||document.activeElement!==e&&e.focus({preventScroll:!0})},cleanup:this.listeners}),K.addListener({target:t,event:`click`,handler:e=>{let t=e.target;t instanceof Element&&(t.closest(`[data-ui-combobox-clear]`)&&this.clear(e),t.closest(`[data-ui-combobox-toggle]`)&&this.toggle(e))},cleanup:this.listeners}),K.addListener({target:n,event:`pointerdown`,handler:e=>{let t=e.target;t instanceof Element&&t.closest(`[data-ui-combobox-option]`)&&e.preventDefault()},cleanup:this.listeners}),K.addListener({target:n,event:`click`,handler:e=>{let t=e.target;if(!(t instanceof Element))return;let n=t.closest(`[data-ui-combobox-option]`),r=n?this.options().find(e=>e.el===n):void 0;r&&this.selectOption(r,e)},cleanup:this.listeners}),K.addListener({target:n,event:`pointermove`,handler:e=>{let t=e.target;if(!(t instanceof Element))return;let n=t.closest(`[data-ui-combobox-option]`),r=n?this.options().find(e=>e.el===n):void 0;r&&!r.disabled&&this.setActive(r)},cleanup:this.listeners}),K.addListener({target:n,event:`pointerleave`,handler:()=>{this.setActive(null)},cleanup:this.listeners}),this.listeners.push(K.addDismissableLayer({isEnabled:()=>this.isOpen,roots:()=>[this.$el,n],onDismiss:()=>this.close()})),this.observer=new MutationObserver(()=>{this.sync(),this.props.autoHighlight&&this.isOpen&&!this.activeValue&&this.focusFirst()}),this.observer.observe(n,{childList:!0,subtree:!0})},resolveOptionLabel(e){let t=K.parseItemData(e.dataset.item),n=K.getPathValue(t,this.props.path);return n==null?(e.querySelector(`[data-ui-combobox-option-label]`)?.textContent??e.textContent??``).trim():String(n)},optionValue(e,t){return e.dataset.value||t}}),Ug=e=>{e.data(`UiCombobox`,()=>Hg())},Wg=[`single`,`range`],Gg=[`enhanced`,`native`],Kg=[`popover`,`modal`,`native`],qg=[`select`,`confirm`],Jg=[`neutral`,`accent`],Yg=Dh,Xg=[`left`,`right`,`top`,`bottom`],Zg={name:B,value:B,startName:B,endName:B,mode:U(Wg,`single`),placeholder:B,min:B,max:B,today:B,openTo:B,forceOpenTo:H,months:V.clamp(0,12).default(0),firstDayOfWeek:V.clamp(-1,6).default(0),locale:B,showOutsideDays:H,showWeekNumbers:H,fixedWeeks:H.default(!0),selectableHeader:H,withToday:H,clearable:H,disabled:H,readonly:H,required:H,invalid:H,side:U(bh,`bottom`),align:U(yh,`start`),offset:V.clamp(-100,100).default(0),gap:V.clamp(0,50).default(4),mobile:U(Kg,`modal`),variant:U(Gg,`enhanced`),color:U(Jg,`neutral`),radius:U(Yg,`md`),close:U(qg,`select`),presets:Du.array([]),presetsPosition:U(Xg,`left`),preset:B,presetName:B,triggerClass:B,inputClass:B,popoverClass:B,calendarClass:B,presetsClass:B,presetClass:B,class:B,form:B};U(Xg,`left`);var Qg=W({definition:{component:`ui.date-picker`,parts:{root:{base:`relative inline-grid w-full min-w-0`},trigger:{base:[Nh,Ph,Fh.lg,Ih.outline,`text-left`],variants:{radius:jh.lg},defaults:{radius:`md`}},customTrigger:{base:[`inline-flex min-h-control-lg min-w-control-lg shrink-0 items-center justify-center gap-control bg-control px-2 text-sm text-control-fg shadow-control outline-none`,`hover:bg-control-hover hover:text-control-fg`,`focus-visible:ring-2 focus-visible:ring-focus`,`data-disabled:cursor-not-allowed data-disabled:opacity-50`],variants:{radius:jh.lg},defaults:{radius:`md`}},input:{base:[`min-w-0 flex-1 text-sm`,Lh]},icon:{base:`size-icon shrink-0 fill-current text-icon`},action:{base:Rh},popover:{base:[Bh,`max-h-lg overflow-hidden`]},panel:{base:`grid min-w-72 max-w-[calc(100vw-2rem)] gap-0 overflow-hidden`,variants:{hasPresets:{true:``,false:``},presetsPosition:{left:``,right:``,top:``,bottom:``}},compounds:[{when:{hasPresets:!0,presetsPosition:`left`},class:`sm:grid-cols-[minmax(9rem,11rem)_auto]`},{when:{hasPresets:!0,presetsPosition:`right`},class:`sm:grid-cols-[auto_minmax(9rem,11rem)]`}],defaults:{hasPresets:!1,presetsPosition:`left`}},calendarWrap:{base:`relative grid size-full place-items-center overflow-x-auto overflow-y-auto p-popover`},calendar:{base:`grid max-w-full gap-2 text-sm text-foreground`},presets:{base:[`grid content-start gap-1 border-popover-border p-popover`,`sm:data-[position=left]:border-r sm:data-[position=right]:border-l data-[position=top]:border-b data-[position=bottom]:border-t`]},preset:{base:Hh},footer:{base:`flex items-center justify-end gap-2 border-t border-popover-border p-popover`},nativeWrapper:{base:`relative w-full min-w-0`},native:{base:[zh,Fh.lg],variants:{radius:jh.lg},defaults:{radius:`md`}}}}}),$g=i({CalendarDate:()=>dy,CalendarMonth:()=>ay,CalendarMulti:()=>_y,CalendarRange:()=>gy,CalendarSelectMonth:()=>my,CalendarSelectYear:()=>py});function e_(e,t){let n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}function t_(e,t){let n,r=e=>{let{length:i}=e;for(let a=0;a<i;a++){let i=e[a];if(i&&Array.isArray(i))r(i);else{let e=typeof i;if(i==null||e===`function`||e===`boolean`)continue;e===`string`||e===`number`?(n??=``,n+=i):(n!=null&&(t(n),n=null),t(i))}}};r(e),n!=null&&t(n)}function n_(e,t,n,r,i){let{type:a,reflect:o,event:s,value:c,attr:l=cv(t)}=n?.name!=iv&&Z_(n)&&n!=av?n:{type:n},u=a?.name===iv&&a.map,d=c==null?null:a==Function||!J(c)?()=>c:c;Object.defineProperty(e,t,{configurable:!0,set(e){let n=this[t];d&&a!=Boolean&&e==null&&(e=d());let{error:r,value:i}=(u?dv:fv)(a,e);if(r&&i!=null)throw new nv(this,`The value defined for prop '${t}' must be of type '${a.name}'`,i);n!=i&&(this._props[t]=i??void 0,this.update(),s&&sv(this,s),this.updated.then(()=>{o&&(this._ignoreAttr=l,lv(this,a,l,this[t]),this._ignoreAttr=null)}))},get(){return this._props[t]}}),d&&(i[t]=d()),r[l]={prop:t,type:a}}function r_(e){let{styles:t}=e.constructor,{shadowRoot:n}=e;if(n&&t.length){let e=[];t_(t,t=>{t&&(t instanceof Element?n.appendChild(t.cloneNode(!0)):e.push(t))}),e.length&&(n.adoptedStyleSheets=e)}}function i_(e,t,n){return a_(this,e,t,n)}function a_(e,t,n=jv,r,i){let a;if(t&&t[n]&&t[n].vnode==e||e[Mv]!=Pv)return t;(e||!t)&&(i||=e.type==`svg`,a=e.type!=`host`&&(e.raw==1?(t&&e.clone?t[Nv]:t)!=e.type:e.raw==2?!(t instanceof e.type):t?t[Nv]||t.localName!=e.type:!t),a&&e.type!=null&&(e.raw==1&&e.clone?(r=!0,t=e.type.cloneNode(!0),t[Nv]=e.type):t=e.raw==1?e.type:e.raw==2?new e.type:i?document.createElementNS(`http://www.w3.org/2000/svg`,e.type):document.createElement(e.type,e.is?{is:e.is}:void 0)));let o=t[n]?t[n]:Ov,{vnode:s=Ov,cycle:c=0}=o,{fragment:l,handlers:u}=o,{children:d=kv,props:f=Ov}=s;if(u=a?{}:u||{},e.static&&!a)return t;if(e.shadow&&!t.shadowRoot&&t.attachShadow({mode:`open`,...e.shadow}),e.props!=f&&c_(t,f,e.props,u,i),e.children!==d){let a=e.shadow?t.shadowRoot:t;l=s_(e.children,l,a,n,!c&&r,i&&e.type==`foreignObject`?!1:i)}return t[n]={vnode:e,handlers:u,fragment:l,cycle:c+1},t}function o_(e,t){let n=new Av(``),r=new Av(``),i;if(e[t?`prepend`:`append`](n),t){let{lastElementChild:t}=e;for(;t;){let{previousElementSibling:e}=t;if($_(t,!0)&&!$_(e,!0)){i=t;break}t=e}}return i?i.before(r):e.append(r),{markStart:n,markEnd:r}}function s_(e,t,n,r,i,a){e=e==null?null:Q_(e)?e:[e];let o=t||o_(n,i),{markStart:s,markEnd:c,keyes:l}=o,u,d=l&&new Set,f=s;if(e&&t_(e,e=>{if(typeof e==`object`&&!e[Mv])return;let t=e[Mv]&&e.key,o=l&&t!=null&&l.get(t);f!=c&&f===o?d.delete(f):f=f==c?c:f.nextSibling;let s=l?o:f,p=s;if(e[Mv])p=a_(e,s,r,i,a);else{let t=e+``;!(p instanceof Text)||p instanceof Av?p=new Text(t):p.data!=t&&(p.data=t)}p!=f&&(l&&d.delete(p),!s||l?(n.insertBefore(p,f),l&&f!=c&&d.add(f)):s==c?n.insertBefore(p,c):(n.replaceChild(p,s),f=p)),t!=null&&(u||=new Map,u.set(t,p))}),f=f==c?c:f.nextSibling,t&&f!=c)for(;f!=c;){let e=f;f=f.nextSibling,e.remove()}return d&&d.forEach(e=>e.remove()),o.keyes=u,o}function c_(e,t,n,r,i){for(let a in t)!(a in n)&&l_(e,a,t[a],null,i,r);for(let a in n)l_(e,a,t[a],n[a],i,r)}function l_(e,t,n,r,i,a){if(t=t==`class`&&!i?`className`:t,n??=null,r??=null,t in e&&Tv[t]&&(n=e[t]),!(r===n||Dv[t]||t[0]==`_`))if(e.localName===`slot`&&t===`assignNode`&&`assign`in e)e.assign(r);else if(t[0]==`o`&&t[1]==`n`&&(J(r)||J(n)))u_(e,t.slice(2),r,a);else if(t==`ref`)r&&(J(r)?r(e):r.current=e);else if(t==`style`){let{style:t}=e;n||=``,r||=``;let i=Z_(n),a=Z_(r);if(i)for(let e in n)if(a)!(e in r)&&d_(t,e,null);else break;if(a)for(let e in r){let a=r[e];i&&n[e]===a||d_(t,e,a)}else t.cssText=r}else{let a=t[0]==`$`?t.slice(1):t;a===t&&(!i&&!Ev[t]&&t in e||J(r)||J(n))?e[t]=r??``:r==null?e.removeAttribute(a):e.setAttribute(a,Z_(r)?JSON.stringify(r):r)}}function u_(e,t,n,r){if(r.handleEvent||=t=>r[t.type].call(e,t),n){if(!r[t]){let i=n.capture||n.once||n.passive?Object.assign({},n):null;e.addEventListener(t,r,i)}r[t]=n}else r[t]&&(e.removeEventListener(t,r),delete r[t])}function d_(e,t,n){let r=`setProperty`;n??=(r=`removeProperty`,null),~t.indexOf(`-`)?e[r](t,n):e[t]=n}function f_(e,...t){let n=(e.raw||e).reduce((e,n,r)=>e+n+(t[r]||``),``);return Hv[n]=Hv[n]||p_(n)}function p_(e){if(Cv.sheet){let t=new CSSStyleSheet;return t.replaceSync(e),t}else{let t=document.createElement(`style`);return t.textContent=e,t}}function m_(){let e=new Date;return new $(e.getFullYear(),e.getMonth()+1,e.getDate())}function h_(e){let t=q(e);t.setUTCDate(t.getUTCDate()+3-(t.getUTCDay()+6)%7);let n=new Date(Date.UTC(t.getUTCFullYear(),0,4));return 1+Math.round(((t.getTime()-n.getTime())/Gv-3+(n.getUTCDay()+6)%7)/7)}function g_(e,t=0){let n=q(e),r=n.getUTCDay(),i=(r<t?7:0)+r-t;return n.setUTCDate(n.getUTCDate()-i),$.from(n)}function __(e,t=0){return g_(e,t).add({days:6})}function v_(e){return $.from(new Date(Date.UTC(e.year,e.month,0)))}function y_(e,t,n){return t&&$.compare(e,t)<0?t:n&&$.compare(e,n)>0?n:e}function b_(e,t=0){let n=g_(e.toPlainDate(),t),r=__(v_(e),t),i=[];for(;$.compare(n,r)<0;){let e=[];for(let t=0;t<7;t++)e.push(n),n=n.add(Kv);i.push(e)}return i}function q(e){return new Date(Date.UTC(e.year,e.month-1,e.day??1))}function x_(e,t){if(t)try{return e.from(t)}catch{}}function S_(e){let[t,n]=xv(e);return[Y(()=>x_($,t),[t]),e=>n(e?.toString())]}function C_(e){let[t=``,n]=xv(e);return[Y(()=>{let[e,n]=t.split(`/`),r=x_($,e),i=x_($,n);return r&&i?[r,i]:[]},[t]),e=>n(`${e[0]}/${e[1]}`)]}function w_(e){let[t=``,n]=xv(e);return[Y(()=>{let e=[];for(let n of t.trim().split(/\s+/)){let t=x_($,n);t&&e.push(t)}return e},[t]),e=>n(e.join(` `))]}function T_(e,t){return Y(()=>new Intl.DateTimeFormat(t,{timeZone:`UTC`,...e}),[t,e])}function E_(e,t,n){let r=T_(e,n);return Y(()=>{let e=[],n=new Date;for(var i=0;i<7;i++){let i=(n.getUTCDay()-t+7)%7;e[i]=r.format(n),n.setUTCDate(n.getUTCDate()+1)}return e},[t,r])}function D_({props:e,context:t}){let{offset:n}=e,{firstDayOfWeek:r,isDateDisallowed:i,min:a,max:o,today:s,page:c,locale:l,focusedDate:u,formatWeekday:d}=t,f=s??m_(),p=E_(ey,r,l),m=E_(Y(()=>({weekday:d}),[d]),r,l),h=T_(Qv,l),g=T_($v,l),_=Y(()=>c.start.add({months:n}),[c,n]),v=Y(()=>b_(_,r),[_,r]),y=X(`focusday`,ty),b=X(`selectday`,ty),x=X(`hoverday`,ty);function S(e){y(y_(e,a,o))}function C(e){let t;switch(e.key){case`ArrowRight`:t=u.add({days:Zv(e)?1:-1});break;case`ArrowLeft`:t=u.add({days:Zv(e)?-1:1});break;case`ArrowDown`:t=u.add({days:7});break;case`ArrowUp`:t=u.add({days:-7});break;case`PageUp`:t=u.add(e.shiftKey?{years:-1}:{months:-1});break;case`PageDown`:t=u.add(e.shiftKey?{years:1}:{months:1});break;case`Home`:t=g_(u,r);break;case`End`:t=__(u,r);break;default:return}S(t),e.preventDefault()}function w(e){let n=_.equals(e);if(!t.showOutsideDays&&!n)return;let r=e.equals(u),s=e.equals(f),c=q(e),l=i?.(c),d=!Xv(e,a,o),p=``,m;if(t.type===`range`){let[n,r]=t.value,i=n?.equals(e),a=r?.equals(e);m=n&&r&&Xv(e,n,r),p=`${i?`range-start`:``} ${a?`range-end`:``} ${m&&!i&&!a?`range-inner`:``}`}else m=t.type===`multi`?t.value.some(t=>t.equals(e)):t.value?.equals(e);return{part:`${`button day day-${c.getUTCDay()} ${n?m?`selected`:``:`outside`} ${l?`disallowed`:``} ${s?`today`:``} ${t.getDayParts?.(c)??``}`} ${p}`,tabindex:n&&r?0:-1,disabled:d,"aria-disabled":l?`true`:void 0,"aria-pressed":n&&m,"aria-current":s?`date`:void 0,"aria-label":h.format(c),onkeydown:C,onclick(){l||b(e),S(e)},onmouseover(){!l&&!d&&x(e)}}}return{weeks:v,yearMonth:_,daysLong:p,daysVisible:m,formatter:g,getDayProps:w}}function O_(e){return Z(`button`,{part:`button ${e.name} ${e.onclick?``:`disabled`}`,onclick:e.onclick,"aria-disabled":e.onclick?null:`true`,children:Z(`slot`,{name:e.name,children:e.children})})}function k_(e){let t=q(e.page.start),n=q(e.page.end);return Z(ry,{value:e,onselectday:e.onSelect,onfocusday:e.onFocus,onhoverday:e.onHover,children:Q(`div`,{role:`group`,"aria-labelledby":`h`,part:`container`,children:[Z(`div`,{id:`h`,class:`vh`,"aria-live":`polite`,"aria-atomic":`true`,children:e.formatVerbose.formatRange(t,n)}),Q(`div`,{part:`header`,children:[Z(O_,{name:`previous`,onclick:e.previous,children:`Previous`}),Z(`slot`,{part:`heading`,name:`heading`,children:Z(`div`,{"aria-hidden":`true`,children:e.format.formatRange(t,n)})}),Z(O_,{name:`next`,onclick:e.next,children:`Next`})]}),Z(`slot`,{part:`months`})]})})}function A_(e,t){return(t.year-e.year)*12+t.month-e.month}function j_({pageBy:e,focusedDate:t,months:n,max:r,min:i,goto:a}){let o=e===`single`?1:n,[s,c]=bv(()=>uy(t.toPlainYearMonth(),n)),l=e=>c(uy(s.start.add({months:e}),n)),u=e=>{let t=A_(s.start,e.toPlainYearMonth());return t>=0&&t<n};return _v(()=>{if(u(t))return;let e=A_(t.toPlainYearMonth(),s.start);a(t.add({months:e}))},[s.start]),_v(()=>{if(u(t))return;let e=A_(s.start,t.toPlainYearMonth());l(e===-1?-o:e===n?o:Math.floor(e/n)*n)},[t,o,n]),{page:s,previous:!i||!u(i)?()=>l(-o):void 0,next:!r||!u(r)?()=>l(o):void 0}}function M_({months:e,pageBy:t,locale:n,focusedDate:r,setFocusedDate:i}){let[a]=S_(`min`),[o]=S_(`max`),[s]=S_(`today`),c=X(`focusday`),l=X(`change`),u=Y(()=>y_(r??s??m_(),a,o),[r,s,a,o]);function d(e){i(e),c(q(e))}let{next:f,previous:p,page:m}=j_({pageBy:t,focusedDate:u,months:e,min:a,max:o,goto:d}),h=q_();function g(e){let t=e?.target??`day`;t===`day`?h.current.querySelectorAll(`calendar-month`).forEach(t=>t.focus(e)):h.current.shadowRoot.querySelector(`[part~='${t}']`).focus(e)}return{format:T_(cy,n),formatVerbose:T_(ly,n),page:m,focusedDate:u,dispatch:l,onFocus(e){e.stopPropagation(),d(e.detail),setTimeout(g)},min:a,max:o,today:s,next:f,previous:p,focus:g}}function N_(e){return Q(Fv,{children:[Z(`label`,{part:`label`,for:`s`,children:Z(`slot`,{name:`label`,children:e.label})}),Z(`select`,{id:`s`,part:`select`,onchange:e.onChange,children:e.options.map(e=>Z(`option`,{part:`option`,...e}))})]})}function P_(e,t){return Array.from({length:e},(e,n)=>t(n))}function F_(e){let{min:t,max:n,focusedDate:r}=Bv(ry),i=X(`focusday`,{bubbles:!0}),a=r.toPlainYearMonth(),o=a.year,s=Math.floor(e.maxYears/2),c=o-s,l=o+(e.maxYears-s-1),u=Math.max(c,t?.year??-1/0),d=P_(Math.min(l,n?.year??1/0)-u+1,e=>{let t=u+e;return{label:`${t}`,value:`${t}`,selected:t===a.year}});function f(e){let t=parseInt(e.currentTarget.value)-a.year;i(r.add({years:t}))}return{options:d,onChange:f}}function I_(e){let{min:t,max:n,focusedDate:r,locale:i}=Bv(ry),a=X(`focusday`,{bubbles:!0}),o=T_(Y(()=>({month:e.formatMonth}),[e.formatMonth]),i),s=Y(()=>{let e=[],t=new Date;t.setUTCDate(1);for(var n=0;n<12;n++){let n=(t.getUTCMonth()+12)%12;e[n]=o.format(t),t.setUTCMonth(t.getUTCMonth()+1)}return e},[o]),c=r.toPlainYearMonth(),l=s.map((e,r)=>{let i=r+1,a=c.add({months:i-c.month}),o=t!=null&&Yv.compare(a,t)<0||n!=null&&Yv.compare(a,n)>0;return{label:e,value:`${i}`,disabled:o,selected:i===c.month}});function u(e){let t=parseInt(e.currentTarget.value)-c.month;a(r.add({months:t}))}return{options:l,onChange:u}}var L_,R_,z_,B_,V_,H_,U_,W_,G_,K_,q_,J_,Y_,X_,J,Z_,Q_,$_,ev,tv,nv,rv,iv,av,ov,sv,cv,lv,uv,dv,fv,pv,mv,hv,gv,_v,vv,yv,bv,Y,xv,X,Sv,Cv,wv,Tv,Ev,Dv,Ov,kv,Av,jv,Mv,Nv,Pv,Fv,Iv,Lv,Rv,zv,Bv,Vv,Hv,Z,Q,Uv,Wv,Gv,Kv,qv,Jv,$,Yv,Xv,Zv,Qv,$v,ey,ty,ny,ry,iy,ay,oy,sy,cy,ly,uy,dy,fy,py,my,hy,gy,_y,vy=n((()=>{L_=class{#e;#t=new Set;constructor(e){this.#e=e}get current(){return this.#e}set current(e){this.#e!=e&&(this.#e=e,this.#t.forEach(t=>t(e)))}on(e){return this.#t.add(e),()=>this.#t.delete(e)}},R_=e=>new L_(e),z_=Symbol.for(`atomico.hooks`),globalThis[z_]=globalThis[z_]||{},B_=globalThis[z_],V_=Symbol.for(`Atomico.suspense`),H_=Symbol.for(`Atomico.effect`),U_=Symbol.for(`Atomico.layoutEffect`),W_=Symbol.for(`Atomico.insertionEffect`),G_=(e,t,n)=>{let{i:r,hooks:i}=B_.c,a=i[r]=i[r]||{};return a.value=e(a.value),a.effect=t,a.tag=n,B_.c.i++,i[r].value},K_=e=>G_((t=R_(e))=>t),q_=()=>G_((e=R_(B_.c.host))=>e),J_=()=>B_.c.update,Y_=(e,t,n=0)=>{let r={},i=!1,a=()=>i,o=(e,t)=>{for(let n in r){let i=r[n];i.effect&&i.tag===e&&(i.value=i.effect(i.value,t))}};return{load:a=>{B_.c={host:t,hooks:r,update:e,i:0,id:n};let o;try{i=!1,o=a()}catch(e){if(e!==V_)throw e;i=!0}finally{B_.c=null}return o},cleanEffects:e=>(o(W_,e),()=>(o(U_,e),()=>{o(H_,e)})),isSuspense:a}},X_=Symbol.for,J=e=>typeof e==`function`,Z_=e=>typeof e==`object`,{isArray:Q_}=Array,$_=(e,t)=>(t?e instanceof HTMLStyleElement:!0)&&`hydrate`in(e?.dataset||{}),ev=(e,t,n)=>(e.addEventListener(t,n),()=>e.removeEventListener(t,n)),tv=class{constructor(e,t,n){this.message=t,this.target=e,this.value=n}},nv=class extends tv{},rv=class extends tv{},iv=`Custom`,av=null,ov={true:1,"":1,1:1},sv=(e,{type:t,base:n=CustomEvent,...r})=>e.dispatchEvent(new n(t,r)),cv=e=>e.replace(/([A-Z])/g,`-$1`).toLowerCase(),lv=(e,t,n,r)=>r==null||t==Boolean&&!r?e.removeAttribute(n):e.setAttribute(n,t?.name===iv&&t?.serialize?t?.serialize(r):Z_(r)?JSON.stringify(r):t==Boolean?``:r),uv=(e,t)=>e==Boolean?!!ov[t]:e==Number?Number(t):e==String?t:e==Array||e==Object?JSON.parse(t):e.name==iv?t:new e(t),dv=({map:e},t)=>{try{return{value:e(t),error:!1}}catch{return{value:t,error:!0}}},fv=(e,t)=>e==null||t==null?{value:t,error:!1}:e!=String&&t===``?{value:void 0,error:!1}:e==Object||e==Array||e==Symbol?{value:t,error:{}.toString.call(t)!==`[object ${e.name}]`}:t instanceof e?{value:t,error:e==Number&&Number.isNaN(t.valueOf())}:e==String||e==Number||e==Boolean?{value:t,error:e==Number?typeof t==`number`?Number.isNaN(t):!0:e==String?typeof t!=`string`:typeof t!=`boolean`}:{value:t,error:!0},pv=0,mv=e=>(e?.dataset||{})?.hydrate||`c`+ pv++,hv=(e,t=HTMLElement)=>{let n={},r={},i=`prototype`in t&&t.prototype instanceof Element,a=i?t:`base`in t?t.base:HTMLElement,{props:o,styles:s}=i?e:t;class c extends a{constructor(){super(),this._setup(),this._render=()=>e({...this._props});for(let e in r)this[e]=r[e]}static get styles(){return[super.styles,s]}async _setup(){if(this._props)return;this._props={};let e,t;this.mounted=new Promise(n=>this.mount=()=>{n(),e!=this.parentNode&&(t==e?this.update():this.unmounted.then(this.update)),e=this.parentNode}),this.unmounted=new Promise(r=>this.unmount=()=>{r(),(e!=this.parentNode||!this.isConnected)&&(n.cleanEffects(!0)()(),t=this.parentNode,e=null)}),this.symbolId=this.symbolId||Symbol(),this.symbolIdParent=Symbol();let n=Y_(()=>this.update(),this,mv(this)),r,i=!0,a=$_(this);this.update=()=>(r||(r=!0,this.updated=(this.updated||this.mounted).then(()=>{try{let e=n.load(this._render),t=n.cleanEffects();return e&&e.render(this,this.symbolId,a),r=!1,i&&!n.isSuspense()&&(i=!1,!a&&r_(this)),t()}finally{r=!1}}).then(e=>{e&&e()})),this.updated),this.update()}connectedCallback(){this.mount(),super.connectedCallback&&super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback&&super.disconnectedCallback(),this.unmount()}attributeChangedCallback(e,t,r){if(n[e]){if(e===this._ignoreAttr||t===r)return;let{prop:i,type:a}=n[e];try{this[i]=uv(a,r)}catch{throw new rv(this,`The value defined as attr '${e}' cannot be parsed by type '${a.name}'`,r)}}else super.attributeChangedCallback(e,t,r)}static get props(){return{...super.props,...o}}static get observedAttributes(){let e=super.observedAttributes||[];for(let e in o)n_(this.prototype,e,o[e],n,r);return Object.keys(n).concat(e)}}return c},gv=e=>(t,n)=>{G_(([e,t]=[])=>((t||!t)&&(t&&e_(t,n)?e||=!0:(J(e)&&e(),e=null)),[e,n]),([e,n],r)=>r?(J(e)&&e(),[]):[e||t(),n],e)},_v=gv(H_),vv=gv(W_),yv=class extends Array{constructor(e,t){let n=!0,r=e=>{try{t(e,this,n)}finally{n=!1}};super(void 0,r,t),r(e)}},bv=e=>{let t=J_();return G_((n=new yv(e,(e,n,r)=>{e=J(e)?e(n[0]):e,e!==n[0]&&(n[0]=e,r||t())}))=>n)},Y=(e,t)=>{let[n]=G_(([n,r,i=0]=[])=>((!r||r&&!e_(r,t))&&(n=e()),[n,t,i]));return n},xv=e=>{let{current:t}=q_();if(!(e in t))throw new nv(t,`For useProp("${e}"), the prop does not exist on the host.`,e);return G_((n=new yv(t[e],(n,r)=>{n=J(n)?n(t[e]):n,t[e]=n}))=>(n[0]=t[e],n))},X=(e,t={})=>{let n=q_();return n[e]||(n[e]=(r=t.detail)=>sv(n.current,{type:e,...t,detail:r})),n[e]},Sv=X_(`atomico/options`),globalThis[Sv]=globalThis[Sv]||{sheet:!!document.adoptedStyleSheets},Cv=globalThis[Sv],wv=new Promise(e=>{Cv.ssr||(document.readyState===`loading`?ev(document,`DOMContentLoaded`,e):e())}),Tv={checked:1,value:1,selected:1},Ev={list:1,type:1,size:1,form:1,width:1,height:1,src:1,href:1,slot:1},Dv={shadowDom:1,staticNode:1,cloneNode:1,children:1,key:1},Ov={},kv=[],Av=class extends Text{},jv=X_(`atomico/id`),Mv=X_(`atomico/type`),Nv=X_(`atomico/ref`),Pv=X_(`atomico/vnode`),Fv=()=>{},Iv=(e,t,...n)=>{let r=t||Ov,{children:i}=r;if(i??=n.length?n:kv,e===Fv)return i;let a=e?e instanceof Node?1:e.prototype instanceof HTMLElement&&2:0;if(a===!1&&e instanceof Function)return e(i==kv?r:{children:i,...r});let o=Cv.render||i_;return{[Mv]:Pv,type:e,props:r,children:i,key:r.key,shadow:r.shadowDom,static:r.staticNode,raw:a,is:r.is,clone:r.cloneNode,render:o}},Lv=Iv(`host`,{style:`display: contents`}),Rv=`value`,zv=(e,t)=>{let n=q_(),r=K_();vv(()=>ev(n.current,`ConnectContext`,t=>{t.composedPath().at(0)!==t.currentTarget&&e===t.detail.id&&(t.stopPropagation(),t.detail.connect(r))}),[e]),r.current=t},Bv=e=>{let t=X(`ConnectContext`,{bubbles:!0,composed:!0}),[n,r]=bv(()=>{if(Cv.ssr)return;let n;return t({id:e,connect(e){n=e}}),n}),i=J_();return _v(()=>{wv.then(()=>t({id:e,connect:r}))},[e]),_v(()=>{if(n)return n.on(i)},[n]),n?.current||e[Rv]},Vv=e=>{let t=hv(({value:e})=>(zv(t,e),Lv),{props:{value:{type:Object,value:()=>e}}});return t[Rv]=e,t},Vv({dispatch(e,t){}}),Hv={},Z=(e,t,n)=>(t==null?t={key:n}:t.key=n,Iv(e,t)),Q=Z,Uv=f_`*,*:before,*:after{box-sizing:border-box}button{padding:0;touch-action:manipulation;cursor:pointer;user-select:none}`,Wv=f_`.vh{position:absolute;transform:scale(0)}`,Gv=864e5,Kv={days:1},qv=/^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[0-1])$/,Jv=(e,t)=>e.toString().padStart(t,`0`),$=class e{constructor(e,t,n){this.year=e,this.month=t,this.day=n}add(t){let n=q(this);if(`days`in t)return n.setUTCDate(this.day+t.days),e.from(n);let{year:r,month:i}=this;`months`in t?(i=this.month+t.months,n.setUTCMonth(i-1)):(r=this.year+t.years,n.setUTCFullYear(r));let a=e.from(q({year:r,month:i,day:1}));return y_(e.from(n),a,v_(a))}toString(){return`${Jv(this.year,4)}-${Jv(this.month,2)}-${Jv(this.day,2)}`}toPlainYearMonth(){return new Yv(this.year,this.month)}equals(t){return e.compare(this,t)===0}static compare(e,t){return e.year<t.year?-1:e.year>t.year?1:e.month<t.month?-1:e.month>t.month?1:e.day<t.day?-1:+(e.day>t.day)}static from(t){if(typeof t==`string`){let n=t.match(qv);if(!n)throw TypeError(t);let[,r,i,a]=n;return new e(parseInt(r,10),parseInt(i,10),parseInt(a,10))}return new e(t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate())}},Yv=class e{constructor(e,t){this.year=e,this.month=t}add(t){let n=q(this),r=(t.months??0)+(t.years??0)*12;return n.setUTCMonth(n.getUTCMonth()+r),new e(n.getUTCFullYear(),n.getUTCMonth()+1)}equals(e){return this.year===e.year&&this.month===e.month}toPlainDate(){return new $(this.year,this.month,1)}static compare(e,t){return e.year<t.year?-1:e.year>t.year?1:e.month<t.month?-1:+(e.month>t.month)}},Xv=(e,t,n)=>y_(e,t,n)===e,Zv=e=>e.target.matches(`:dir(ltr)`),Qv={month:`long`,day:`numeric`},$v={month:`long`},ey={weekday:`long`},ty={bubbles:!0},ny=m_(),ry=Vv({type:`date`,firstDayOfWeek:1,focusedDate:ny,page:{start:ny.toPlainYearMonth(),end:ny.toPlainYearMonth()}}),customElements.define(`calendar-ctx`,ry),iy=(e,t)=>(t+e)%7,ay=hv(e=>{let t=Bv(ry),n=K_(),r=D_({props:e,context:t});function i(){n.current.querySelector(`button[tabindex='0']`)?.focus()}return Q(`host`,{shadowDom:!0,focus:i,children:[Z(`div`,{id:`h`,part:`heading`,children:r.formatter.format(q(r.yearMonth))}),Q(`table`,{ref:n,"aria-labelledby":`h`,part:`table`,children:[Q(`colgroup`,{children:[t.showWeekNumbers&&Z(`col`,{part:`col-weeknumber`}),Z(`col`,{part:`col-1`}),Z(`col`,{part:`col-2`}),Z(`col`,{part:`col-3`}),Z(`col`,{part:`col-4`}),Z(`col`,{part:`col-5`}),Z(`col`,{part:`col-6`}),Z(`col`,{part:`col-7`})]}),Z(`thead`,{children:Q(`tr`,{part:`tr head`,children:[t.showWeekNumbers&&Z(`th`,{part:`th weeknumber`,children:Q(`slot`,{name:`weeknumber`,children:[Z(`span`,{class:`vh`,children:`Week`}),Z(`span`,{"aria-hidden":`true`,children:`#`})]})}),r.daysLong.map((e,n)=>Q(`th`,{part:`th day day-${iy(t.firstDayOfWeek,n)}`,scope:`col`,children:[Z(`span`,{class:`vh`,children:e}),Z(`span`,{"aria-hidden":`true`,children:r.daysVisible[n]})]}))]})}),Z(`tbody`,{children:r.weeks.map((e,n)=>Q(`tr`,{part:`tr week`,children:[t.showWeekNumbers&&Z(`th`,{class:`num`,part:`th weeknumber`,scope:`row`,children:h_(e[0])}),e.map((e,t)=>{let n=r.getDayProps(e);return Z(`td`,{part:`td`,children:n&&Z(`button`,{class:`num`,...n,children:e.day})},t)})]},n))})]})]})},{props:{offset:{type:Number,value:0}},styles:[Uv,Wv,f_`:host{--color-accent: black;--color-text-on-accent: white;display:flex;flex-direction:column;gap:.25rem;text-align:center;inline-size:fit-content}table{border-collapse:collapse;font-size:.875rem}th{inline-size:2.25rem;block-size:2.25rem}td{padding-inline:0}.num{font-variant-numeric:tabular-nums}button{color:inherit;font-size:inherit;background:transparent;border:0;block-size:2.25rem;inline-size:2.25rem}button:hover:where(:not(:disabled,[aria-disabled])){background:#0000000d}button:is([aria-pressed=true],:focus-visible){background:var(--color-accent);color:var(--color-text-on-accent)}button:focus-visible{outline:1px solid var(--color-text-on-accent);outline-offset:-2px}button:disabled,:host::part(outside),:host::part(disallowed){cursor:default;opacity:.5}`]}),customElements.define(`calendar-month`,ay),oy={value:{type:String,value:``},min:{type:String,value:``},max:{type:String,value:``},today:{type:String,value:``},isDateDisallowed:{type:Function,value:e=>!1},formatWeekday:{type:String,value:()=>`narrow`},getDayParts:{type:Function,value:e=>``},firstDayOfWeek:{type:Number,value:()=>1},showOutsideDays:{type:Boolean,value:!1},locale:{type:String,value:()=>{}},months:{type:Number,value:1},focusedDate:{type:String,value:()=>{}},pageBy:{type:String,value:()=>`months`},showWeekNumbers:{type:Boolean,value:!1}},sy=[Uv,Wv,f_`:host{display:block;inline-size:fit-content}:host::part(container){display:flex;flex-direction:column;gap:1em}:host::part(header){display:flex;align-items:center;justify-content:space-between}:host::part(heading){font-weight:700;font-size:1.25em}:host::part(button){display:flex;align-items:center;justify-content:center}:host::part(button disabled){cursor:default;opacity:.5}`],cy={year:`numeric`},ly={year:`numeric`,month:`long`},uy=(e,t)=>(e=t===12?new Yv(e.year,1):e,{start:e,end:e.add({months:t-1})}),dy=hv(e=>{let[t,n]=S_(`value`),[r=t,i]=S_(`focusedDate`),a=M_({...e,focusedDate:r,setFocusedDate:i});function o(e){n(e.detail),a.dispatch()}return Z(`host`,{shadowDom:!0,focus:a.focus,children:Z(k_,{...e,...a,type:`date`,value:t,onSelect:o})})},{props:oy,styles:sy}),customElements.define(`calendar-date`,dy),fy=[Uv,Wv],py=hv(e=>Z(`host`,{shadowDom:!0,children:Z(N_,{label:`Year`,...F_(e)})}),{props:{maxYears:{type:Number,value:20}},styles:fy}),customElements.define(`calendar-select-year`,py),my=hv(e=>Z(`host`,{shadowDom:!0,children:Z(N_,{label:`Month`,...I_(e)})}),{props:{formatMonth:{type:String,value:()=>`long`}},styles:fy}),customElements.define(`calendar-select-month`,my),hy=(e,t)=>$.compare(e,t)<0?[e,t]:[t,e],gy=hv(e=>{let[t,n]=C_(`value`),[r=t[0],i]=S_(`focusedDate`),a=M_({...e,focusedDate:r,setFocusedDate:i}),o=X(`rangestart`),s=X(`rangeend`),[c,l]=S_(`tentative`),[u,d]=bv();_v(()=>d(void 0),[c]);function f(e){a.onFocus(e),p(e)}function p(e){e.stopPropagation(),c&&d(e.detail)}function m(e){let t=e.detail;e.stopPropagation(),c?(n(hy(c,t)),l(void 0),s(q(t)),a.dispatch()):(l(t),o(q(t)))}let h=c?hy(c,u??c):t;return Z(`host`,{shadowDom:!0,focus:a.focus,children:Z(k_,{...e,...a,type:`range`,value:h,onFocus:f,onHover:p,onSelect:m})})},{props:{...oy,tentative:{type:String,value:``}},styles:sy}),customElements.define(`calendar-range`,gy),_y=hv(e=>{let[t,n]=w_(`value`),[r=t[0],i]=S_(`focusedDate`),a=M_({...e,focusedDate:r,setFocusedDate:i});function o(e){let r=[...t],i=t.findIndex(t=>t.equals(e.detail));i<0?r.push(e.detail):r.splice(i,1),n(r),a.dispatch()}return Z(`host`,{shadowDom:!0,focus:a.focus,children:Z(k_,{...e,...a,type:`multi`,value:t,onSelect:o})})},{props:oy,styles:sy}),customElements.define(`calendar-multi`,_y)})),yy=/^\d{4}-\d{2}-\d{2}$/,by=/^\d{4}-\d{2}-\d{2}\/\d{4}-\d{2}-\d{2}$/,xy=100,Sy=10,Cy=null,wy=()=>typeof customElements>`u`||customElements.get(`calendar-ctx`)?Promise.resolve():(Cy??=Promise.resolve().then(()=>(vy(),$g)).then(()=>void 0).catch(e=>{if(!customElements.get(`calendar-ctx`))throw e}),Cy),Ty=e=>{let[t=``,n=``]=e.split(`/`);return[t,n]},Ey=(e,t)=>e===``||(t?by.test(e):yy.test(e)),Dy=()=>new Date().getFullYear(),Oy=()=>`${Dy()-xy}-01-01`,ky=()=>`${Dy()+Sy}-12-31`,Ay=()=>new Date().toISOString().slice(0,10),jy=(e,t)=>{if(!e.match(yy))return``;let n=new Date(`${e}T00:00:00.000Z`);return new Intl.DateTimeFormat(t||void 0,{month:`long`,timeZone:`UTC`,year:`numeric`}).format(n)},My=e=>({value:e.dataset.value??``,label:e.dataset.label??e.textContent?.trim()??``,start:e.dataset.start??``,end:e.dataset.end??``,disabled:K.asBool({value:e.dataset.disabled})}),Ny=()=>({isOpen:!1,value:``,pendingValue:``,presetValue:``,triggerId:``,popoverId:``,liveMessage:``,props:null,popover:null,popoverMotion:null,listeners:[],hiddenInputsKey:``,presetInputKey:``,init(){this.props=z({el:this.$el,schema:Zg}),this.value=this.props.value,this.pendingValue=this.value,this.presetValue=this.props.preset,this.triggerId=this.$id(`date-picker-trigger`),this.popoverId=this.$id(`date-picker-popover`),this.popover=K.createAnchoredPopover({reference:()=>this.trigger(),floating:()=>this.popoverEl(),position:()=>this.props.side,align:()=>this.props.align,gap:()=>this.props.gap,offset:()=>this.props.offset,matchReferenceWidth:!1}),this.popoverMotion=K.motion.createPresenceLifecycle({element:()=>this.popoverEl(),preset:`popover`}),this.setup(),this.sync(),wy().then(()=>this.sync())},destroy(){this.props.disconnect(),this.popoverMotion?.destroy(),this.listeners.forEach(e=>e()),this.listeners=[],this.popover?.unmount()},get root(){return K.mergeBindings({inputs:[G({part:Qg.parts.root,props:this.props,className:this.props.class}),{"data-ui-date-picker":``,":data-state":()=>this.isOpen?`open`:`closed`,":data-color":()=>this.props.color,":data-disabled":()=>this.props.disabled?`true`:void 0,":data-invalid":()=>this.props.invalid?`true`:void 0}]})},trigger(){let e=this.$el.querySelector(`[data-ui-date-picker-trigger]`);if(!e)throw Error(`Date picker requires a trigger.`);return e},input(){let e=this.$el.querySelector(`[data-ui-date-picker-input]`);if(!e)throw Error(`Date picker requires an input.`);return e},toggleButton(){return this.$el.querySelector(`[data-ui-date-picker-toggle]`)},popoverEl(){let e=this.$el.querySelector(`[data-ui-date-picker-popover]`);if(!e)throw Error(`Date picker requires a popover.`);return e},calendar(){return this.$el.querySelector(`[data-ui-date-picker-calendar]`)},hiddenInputsEl(){return this.$el.querySelector(`[data-ui-date-picker-hidden-inputs]`)},presetInputsEl(){return this.$el.querySelector(`[data-ui-date-picker-preset-inputs]`)},presetItems(){let e=Array.from(this.$el.querySelectorAll(`[data-ui-date-picker-preset]`)).map(My).filter(e=>e.value&&e.start&&e.end);return e.length?e:this.props.presets},isRange(){return this.props.mode===`range`},closeMode(){return this.props.close===`confirm`?`confirm`:`select`},displayValue(){if(!this.value)return``;if(!this.isRange())return this.value;let[e,t]=Ty(this.value);return e&&t?`${e} to ${t}`:this.value},effectivePlaceholder(){return this.props.placeholder?this.props.placeholder:this.isRange()?`YYYY-MM-DD to YYYY-MM-DD`:`YYYY-MM-DD`},effectiveMonths(){return this.props.months>0?this.props.months:this.isRange()?2:1},open(e){if(e?.preventDefault(),this.props.disabled||this.props.readonly)return;let t=this.isOpen;this.isOpen=!0,this.pendingValue=this.value,this.sync(),t||this.popoverMotion?.enter({before:()=>{let e=this.popoverEl();e.hidden=!1,e.showPopover?.(),this.popover?.mount()}}),e instanceof KeyboardEvent&&wy().then(()=>{queueMicrotask(()=>this.calendar()?.focus({preventScroll:!0}))}),K.dispatch({el:this.$el,name:`ui:open`})},close(e){e?.preventDefault();let t=this.isOpen;this.isOpen=!1,this.pendingValue=this.value,this.sync(),this.trigger().focus({preventScroll:!0}),t&&this.popoverMotion?.exit({before:()=>{let e=this.popoverEl();e.dataset.state=`closed`,e.hidden=!1},after:()=>{if(this.isOpen)return;let e=this.popoverEl();e.hidePopover?.(),e.hidden=!0,this.popover?.unmount(),K.dispatch({el:this.$el,name:`ui:close`})}})},toggle(e){this.isOpen?this.close(e):this.open(e)},clear(e){e?.preventDefault(),!(this.props.disabled||this.props.readonly)&&(this.value=``,this.pendingValue=``,this.presetValue=``,this.liveMessage=`Date cleared`,this.sync(),K.dispatchNativeControlChange({container:this.hiddenInputsEl(),fallback:this.input(),marker:`data-ui-date-picker-hidden-input`}),K.dispatch({el:this.$el,name:`ui:clear`}))},cancel(e){e?.preventDefault(),this.close()},apply(e){e?.preventDefault(),this.commitValue(this.pendingValue),this.close()},commitValue(e){this.value=e,this.pendingValue=e,this.sync(),K.dispatchNativeControlChange({container:this.hiddenInputsEl(),fallback:this.input(),marker:`data-ui-date-picker-hidden-input`}),K.dispatch({el:this.$el,name:`ui:change`})},selectToday(e){e?.preventDefault();let t=this.props.today||new Date().toISOString().slice(0,10),n=this.isRange()?`${t}/${t}`:t;this.commitValue(n),this.close()},selectPreset(e,t){t?.preventDefault();let n=My(e);if(n.disabled)return;let r=this.isRange()?`${n.start}/${n.end}`:n.start;this.presetValue=n.value,this.commitValue(r),this.close()},handleInput(e){let t=e.target;if(!(t instanceof HTMLInputElement))return;let n=t.value.trim(),r=this.isRange()?n.replace(/\s+to\s+/i,`/`):n;Ey(r,this.isRange())&&r!==this.value&&this.commitValue(r)},handleKeydown(e){if((e.key===`ArrowDown`||e.key===`Enter`||e.key===` `)&&!this.isOpen){this.open(e);return}e.key===`Escape`&&this.isOpen&&this.close(e)},handleCalendarChange(e){let t=e.currentTarget;this.pendingValue=t.value,this.isRange()&&(this.liveMessage=this.pendingValue.includes(`/`)?`Range selected`:`Start date selected`),this.closeMode()===`select`&&(!this.isRange()||by.test(this.pendingValue))?(this.commitValue(this.pendingValue),this.close()):this.sync()},handleCalendarFocus(e){let t=e.detail;t instanceof Date&&this.syncCalendarHeading(t.toISOString().slice(0,10))},sync(){this.syncControl(),this.syncCalendar(),this.syncCalendarHeading(),this.syncTodayButton(),this.syncHiddenInputs(),this.syncPresetInput(),this.syncPresets(),this.syncPosition()},syncControl(){let e=this.trigger(),t=this.input(),n=this.popoverEl(),r=this.$el.querySelector(`[data-ui-date-picker-live]`);e.id=this.triggerId,n.id=this.popoverId,n.dataset.state=this.isOpen?`open`:`closed`,n.hidden=!this.isOpen,e.setAttribute(`data-state`,this.isOpen?`open`:`closed`),K.syncControlPresence({el:e,state:this.props,value:`true`});let i=this.toggleButton();i?(i.setAttribute(`aria-expanded`,this.isOpen?`true`:`false`),i.setAttribute(`aria-controls`,this.popoverId)):(e.setAttribute(`aria-haspopup`,`dialog`),e.setAttribute(`aria-expanded`,this.isOpen?`true`:`false`),e.setAttribute(`aria-controls`,this.popoverId)),e instanceof HTMLButtonElement&&(e.disabled=this.props.disabled),K.syncNativeControl({input:t,state:{name:this.isRange()?``:this.props.name,value:this.displayValue(),disabled:this.props.disabled,readonly:this.props.readonly,required:this.props.required,invalid:this.props.invalid}}),t.placeholder=this.effectivePlaceholder(),r&&(r.textContent=this.liveMessage)},syncCalendar(){let e=this.calendar();if(!e)return;e.setAttribute(`value`,this.pendingValue),this.isRange()&&!this.pendingValue&&e.setAttribute(`tentative`,``),e.setAttribute(`months`,String(this.effectiveMonths())),e.style.setProperty(`--ui-date-picker-month-columns`,String(this.effectiveMonths())),e.setAttribute(`format-weekday`,`short`),e.setAttribute(`min`,this.props.min||Oy()),e.setAttribute(`max`,this.props.max||ky()),this.props.today&&e.setAttribute(`today`,this.props.today);let t=this.props.forceOpenTo?this.props.openTo:this.value||this.props.openTo||this.props.today||Ay();e.setAttribute(`focused-date`,Ty(t)[0]),this.props.locale&&e.setAttribute(`locale`,this.props.locale),this.props.firstDayOfWeek>=0&&e.setAttribute(`first-day-of-week`,String(this.props.firstDayOfWeek));let n=!this.props.selectableHeader&&this.effectiveMonths()===1;K.setPresence({el:e,attr:`data-inline-heading`,present:n,value:`true`}),K.setPresence({el:e,attr:`data-hide-month-heading`,present:this.props.selectableHeader&&!this.isRange()||n,value:`true`}),K.setPresence({el:e,attr:`data-fixed-weeks`,present:this.props.fixedWeeks,value:`true`}),K.setPresence({el:e,attr:`show-outside-days`,present:this.props.showOutsideDays||this.props.fixedWeeks}),K.setPresence({el:e,attr:`show-week-numbers`,present:this.props.showWeekNumbers})},syncCalendarHeading(e){let t=this.$el.querySelector(`[data-ui-date-picker-calendar-heading]`);t&&(t.textContent=jy(e||Ty(this.value||this.props.openTo||this.props.today||Ay())[0],this.props.locale))},syncTodayButton(){let e=this.$el.querySelector(`[data-ui-date-picker-calendar-today]`),t=this.$el.querySelector(`[data-ui-date-picker-today-day]`);if(!e||!t)return;let n=this.props.today||Ay(),r=n.match(yy)?String(Number(n.slice(-2))):``;t.textContent=r,e.setAttribute(`aria-label`,r?`Go to today, ${n}`:`Go to today`)},syncHiddenInputs(){let e=this.hiddenInputsEl();if(!e)return;if(!this.isRange()){this.hiddenInputsKey=K.syncRepeatedHiddenInputs({container:e,currentKey:this.hiddenInputsKey,state:{name:``,values:[],form:this.props.form,marker:`data-ui-date-picker-hidden-input`}});return}let[t,n]=Ty(this.value);if(this.props.startName||this.props.endName){let r=JSON.stringify({startName:this.props.startName,endName:this.props.endName,start:t,end:n,form:this.props.form});if(r===this.hiddenInputsKey)return;e.replaceChildren(),[[this.props.startName,t],[this.props.endName,n]].forEach(([t,n])=>{if(!t)return;let r=document.createElement(`input`);r.type=`hidden`,r.name=t,r.value=n,r.setAttribute(`data-ui-date-picker-hidden-input`,``),this.props.form&&r.setAttribute(`form`,this.props.form),e.append(r)}),this.hiddenInputsKey=r;return}this.hiddenInputsKey=K.syncRepeatedHiddenInputs({container:e,currentKey:this.hiddenInputsKey,state:{name:this.props.name,values:this.value?[this.value]:[],required:this.props.required,form:this.props.form,marker:`data-ui-date-picker-hidden-input`}})},syncPresetInput(){let e=this.presetInputsEl();if(!e)return;let t=this.presetItems().find(e=>(this.isRange()?`${e.start}/${e.end}`:e.start)===this.value),n=this.presetItems().find(e=>e.value===`custom`),r=t?.value??(this.value&&n?`custom`:``);this.presetValue=r,this.presetInputKey=K.syncRepeatedHiddenInputs({container:e,currentKey:this.presetInputKey,state:{name:this.props.presetName,values:r?[r]:[],form:this.props.form,marker:`data-ui-date-picker-preset-input`}})},syncPresets(){let e=this.pendingValue||this.value;Array.from(this.$el.querySelectorAll(`[data-ui-date-picker-preset]`)).forEach(t=>{let n=My(t),r=this.isRange()?`${n.start}/${n.end}`:n.start;K.setPresence({el:t,attr:`data-selected`,present:r===e,value:`true`}),K.setPresence({el:t,attr:`data-disabled`,present:n.disabled??!1,value:`true`})})},syncPosition(){this.isOpen&&this.popover?.sync()},setup(){let e=this.trigger(),t=this.input(),n=this.popoverEl();K.addListener({target:e,event:`click`,handler:e=>{let t=e.target;if(t instanceof Element&&t.closest(`[data-ui-date-picker-clear]`)){this.clear(e);return}this.toggle(e)},cleanup:this.listeners}),K.addListener({target:e,event:`keydown`,handler:e=>this.handleKeydown(e),cleanup:this.listeners}),K.addListener({target:t,event:`input`,handler:e=>this.handleInput(e),cleanup:this.listeners}),K.addListener({target:n,event:`pointerdown`,handler:e=>e.stopPropagation(),cleanup:this.listeners}),K.addListener({target:n,event:`click`,handler:e=>{let t=e.target;if(!(t instanceof Element))return;let n=t.closest(`[data-ui-date-picker-preset]`);n&&this.selectPreset(n,e),t.closest(`[data-ui-date-picker-clear]`)&&this.clear(e),t.closest(`[data-ui-date-picker-cancel]`)&&this.cancel(e),t.closest(`[data-ui-date-picker-apply]`)&&this.apply(e),t.closest(`[data-ui-date-picker-today]`)&&this.selectToday(e)},cleanup:this.listeners});let r=this.calendar();r&&(K.addListener({target:r,event:`change`,handler:e=>this.handleCalendarChange(e),cleanup:this.listeners}),K.addListener({target:r,event:`focusday`,handler:e=>this.handleCalendarFocus(e),cleanup:this.listeners}),K.addListener({target:r,event:`rangestart`,handler:()=>{this.liveMessage=`Start date selected`},cleanup:this.listeners}),K.addListener({target:r,event:`rangeend`,handler:()=>{this.liveMessage=`Range selected`},cleanup:this.listeners})),this.listeners.push(K.addDismissableLayer({isEnabled:()=>this.isOpen,roots:()=>[this.$el,n],onDismiss:()=>this.close()}))}}),Py=e=>{e.data(`UiDatePicker`,()=>Ny())},Fy=W({definition:{component:`ui.menu`,parts:{menu:{base:[Bh,`auto-rows-min content-start min-w-48 gap-1 overflow-hidden p-popover`]},item:{base:[Hh],variants:{variant:{default:``,subtle:`bg-base-a2`,filled:`bg-base-a3`,ghost:`bg-transparent`},color:{neutral:``,accent:``,success:``,warning:``,danger:`text-menu-item-danger-fg ui-interactive:hover:bg-menu-item-danger-hover ui-interactive:ui-active:bg-menu-item-danger-hover`}},defaults:{variant:`default`,color:`neutral`}},itemLabel:{base:`min-w-0 flex-1`},itemMeta:{base:`ml-auto text-menu-item-muted`},itemIcon:{base:Uh,variants:{position:{leading:``,trailing:`ml-auto`}},defaults:{position:`leading`}},group:{base:`grid auto-rows-min content-start gap-1`},label:{base:`px-menu-item-x py-1 text-menu-heading-fg`},separatorRoot:{variants:{orientation:{vertical:`self-stretch self-center`,horizontal:`-mx-popover my-popover h-px`}},defaults:{orientation:`horizontal`}},separatorRule:{variants:{orientation:{vertical:`h-full w-px border-0 bg-menu-separator`,horizontal:`h-px w-full border-0 bg-menu-separator`}},defaults:{orientation:`horizontal`}}}}}),Iy=bh,Ly=yh,Ry={side:U(Iy,`bottom`),align:U(Ly,`start`),offset:V.clamp(-100,100).default(0),gap:V.clamp(0,50).default(4),open:H,disabled:H,class:B},zy=W({definition:{component:`ui.dropdown`,parts:{root:{base:`contents`}}}}),By=()=>({isOpen:!1,menuMotion:null,triggerId:``,menuId:``,props:null,collection:null,popover:null,triggerCleanup:[],menuCleanup:[],init(){this.props=z({el:this.$el,schema:Ry}),this.triggerId=this.$id(`dropdown-trigger`),this.menuId=this.$id(`dropdown-menu`),this.collection=K.createCollectionNavigation({root:()=>this.menuEl(),itemSelector:`[data-ui-menu-item]`,isDisabled:e=>K.asBool({value:e.dataset.disabled})||e.hasAttribute(`disabled`),loop:()=>K.asBool({value:this.menuEl().dataset.loop})}),this.popover=K.createAnchoredPopover({reference:()=>this.triggerEl(),floating:()=>this.menuEl(),position:()=>this.props.side,align:()=>this.props.align,gap:()=>this.props.gap,offset:()=>this.props.offset}),this.setupTrigger(),this.setupMenu(),this.menuMotion=K.motion.createPresenceLifecycle({element:()=>this.menuEl(),preset:`menu`}),this.$watch(`isOpen`,e=>{let t=this.menuEl();if(this.syncTriggerAttributes(),e){this.menuMotion?.enter({before:()=>{this.syncMenuAttributes(),t.showPopover(),this.mount()}}),queueMicrotask(()=>t.focus({preventScroll:!0})),K.dispatch({el:this.$el,name:`ui:open`});return}this.menuMotion?.exit({before:()=>{t.dataset.state=`closed`,t.hidden=!1},after:()=>this.finishClose()}),this.menuMotion||(t.dataset.state=`closed`,t.hidden=!1,this.finishClose())}),this.props.open&&queueMicrotask(()=>this.open())},destroy(){this.props.disconnect(),this.menuMotion?.destroy(),this.teardownTrigger(),this.teardownMenu(),this.unmount()},get root(){return K.mergeBindings({inputs:[G({part:zy.parts.root,props:this.props,className:this.props.class}),{"data-ui-dropdown":``,":data-state":()=>this.isOpen?`open`:`closed`,"@keydown.escape.stop":e=>this.close(e)}]})},menu(e){return K.mergeBindings({inputs:[G({part:Fy.parts.menu,props:{},className:e.dataset.class}),{id:this.menuId,popover:`manual`,role:`menu`,tabindex:`-1`,hidden:()=>!this.isOpen,"data-ui-menu":``,":data-state":()=>this.isOpen?`open`:`closed`}]})},menuItem(e){let t=e.dataset.variant||`default`,n=e.dataset.color||`neutral`,r=K.asBool({value:e.dataset.disabled}),i=e instanceof HTMLButtonElement?e.getAttribute(`type`)||e.dataset.type||`button`:void 0;return K.mergeBindings({inputs:[G({part:Fy.parts.item,props:{variant:t,color:n},className:e.dataset.class}),{role:`menuitem`,tabindex:r?`-1`:`0`,type:i,disabled:e.tagName===`BUTTON`&&r,"data-ui-menu-item":``,"data-variant":t,"data-color":n,"data-disabled":r?`true`:void 0,"aria-disabled":r?`true`:void 0}]})},open(e){e?.preventDefault(),!this.props.disabled&&(this.isOpen=!0)},close(e){e?.preventDefault(),this.isOpen=!1,this.clearActiveItem(),e?.type===`keydown`&&this.triggerEl().focus()},toggle(e){e?.preventDefault(),!this.props.disabled&&(this.isOpen=!this.isOpen)},triggerEl(){let e=Array.from(this.$el.children).find(e=>e instanceof HTMLElement&&!e.matches(`[data-ui-menu]`));if(!(e instanceof HTMLElement))throw Error(`Dropdown requires a trigger element before the menu.`);return e},menuEl(){let e=this.$el.querySelector(`[data-ui-menu]`);if(!(e instanceof HTMLElement))throw Error(`Dropdown requires a menu element.`);return e},allItemEls(){return this.collectionNav().allItems()},itemEls(){return this.collectionNav().items()},focusNext(){this.collectionNav().focusNext()},focusPrevious(){this.collectionNav().focusPrevious()},focusFirst(){this.collectionNav().focusFirst()},focusLast(){this.collectionNav().focusLast()},focusItem(e){this.collectionNav().focusItem({el:e})},activateItem(e){this.collectionNav().activateItem({el:e})},clearActiveItem(){this.collectionNav().clearActiveItem()},collectionNav(){return this.collection||=K.createCollectionNavigation({root:()=>this.menuEl(),itemSelector:`[data-ui-menu-item]`,isDisabled:e=>K.asBool({value:e.dataset.disabled})||e.hasAttribute(`disabled`),loop:()=>K.asBool({value:this.menuEl().dataset.loop})}),this.collection},mount(){this.popover?.mount()},unmount(){this.popover?.unmount()},syncFromPopover(e){this.isOpen=e.newState===`open`},syncPosition(){this.popover?.sync()},syncMenuAttributes(){let e=this.menuEl();e.hidden=!this.isOpen,e.dataset.state=this.isOpen?`open`:`closed`},syncTriggerAttributes(){let e=this.triggerEl();if(e.id||=this.triggerId,e.setAttribute(`data-ui-dropdown-trigger`,``),e.setAttribute(`aria-expanded`,this.isOpen?`true`:`false`),e.setAttribute(`aria-controls`,this.menuId),e.setAttribute(`data-state`,this.isOpen?`open`:`closed`),this.props.disabled){e.setAttribute(`aria-disabled`,`true`),e.setAttribute(`tabindex`,`-1`),e instanceof HTMLButtonElement&&(e.disabled=!0);return}e.removeAttribute(`aria-disabled`),e.hasAttribute(`tabindex`)||e.setAttribute(`tabindex`,`0`)},finishClose(){this.isOpen||(this.menuEl().hidePopover(),this.unmount(),this.syncMenuAttributes(),K.dispatch({el:this.$el,name:`ui:close`}))},setupTrigger(){let e=this.triggerEl();this.syncTriggerAttributes(),K.addListener({target:e,event:`click`,handler:e=>this.toggle(e),cleanup:this.triggerCleanup}),K.addListener({target:e,event:`keydown`,handler:e=>{if(e instanceof KeyboardEvent){if(e.key===`Enter`||e.key===` `){this.toggle(e);return}e.key===`ArrowDown`&&(e.preventDefault(),this.open(e),queueMicrotask(()=>this.focusFirst()))}},cleanup:this.triggerCleanup})},setupMenu(){let e=this.menuEl(),t=this.menu(e).class;typeof t==`string`&&e.setAttribute(`class`,t),e.id=this.menuId,e.setAttribute(`popover`,`manual`),e.setAttribute(`role`,`menu`),e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-ui-menu`,``),e.setAttribute(`data-ui-motion-owner`,`component`),this.syncMenuAttributes(),K.addListener({target:e,event:`toggle`,handler:e=>this.syncFromPopover(e),cleanup:this.menuCleanup}),this.menuCleanup.push(K.addDismissableLayer({isEnabled:()=>this.isOpen,roots:()=>[this.$el,e],onDismiss:e=>this.close(e)})),K.addListener({target:e,event:`keydown`,handler:e=>{e instanceof KeyboardEvent&&this.collectionNav().handleKeydown({event:e})},cleanup:this.menuCleanup}),this.allItemEls().forEach(e=>{let t=this.menuItem(e),n=t.class,r=t.disabled===!0;typeof n==`string`&&e.setAttribute(`class`,n),e.setAttribute(`role`,`menuitem`),e.setAttribute(`tabindex`,r?`-1`:`0`),e.setAttribute(`data-ui-menu-item`,``),e instanceof HTMLButtonElement&&!e.hasAttribute(`type`)&&e.setAttribute(`type`,e.dataset.type||`button`),r&&(e.setAttribute(`aria-disabled`,`true`),e instanceof HTMLButtonElement&&(e.disabled=!0)),K.addListener({target:e,event:`click`,handler:t=>this.selectItem(e,t),cleanup:this.menuCleanup}),K.addListener({target:e,event:`focus`,handler:()=>this.activateItem(e),cleanup:this.menuCleanup}),K.addListener({target:e,event:`pointerenter`,handler:()=>{K.asBool({value:e.dataset.disabled})||this.activateItem(e)},cleanup:this.menuCleanup})})},teardownTrigger(){this.triggerCleanup.forEach(e=>e()),this.triggerCleanup=[]},teardownMenu(){this.menuCleanup.forEach(e=>e()),this.menuCleanup=[]},selectItem(e,t){if(K.asBool({value:e.dataset.disabled})){t.preventDefault();return}let n=K.asBool({value:this.menuEl().dataset.keepOpen});(e.dataset.keepOpen===void 0||e.dataset.keepOpen===``?n:K.asBool({value:e.dataset.keepOpen}))||this.close()}}),Vy=e=>{e.data(`UiDropdown`,()=>By())},Hy=`input:not([type="hidden"]), textarea, select, button, [data-ui-control-target]`,Uy=(e,t)=>{let n=new Set((e??``).split(/\s+/).filter(Boolean));return n.add(t),Array.from(n).join(` `)},Wy=(e,t)=>(e.id||=`ui-${t}-${crypto.randomUUID()}`,e.id),Gy=()=>({observer:null,listeners:[],init(){this.sync(),this.observer=new MutationObserver(()=>this.sync()),this.observer.observe(this.$el,{childList:!0,subtree:!0})},destroy(){this.observer?.disconnect(),this.listeners.forEach(e=>e()),this.listeners=[]},sync(){let e=this.$el,t=Array.from(e.querySelectorAll(Hy)).filter(t=>!t.closest(`[data-ui-field], [data-ui-fieldset]`)||t.closest(`[data-ui-field], [data-ui-fieldset]`)===e)[0],n=e.querySelector(`:scope > [data-ui-field-label]`),r=e.querySelector(`:scope > [data-ui-fieldset-legend]`),i=Array.from(e.querySelectorAll(`:scope > [data-ui-field-description]`)),a=Array.from(e.querySelectorAll(`:scope > [data-ui-field-error]`)),o=[...i,...a].filter(e=>!e.hasAttribute(`hidden`)).map(e=>Wy(e,e.hasAttribute(`data-ui-field-error`)?`field-error`:`field-description`));if(t){let i=Wy(t,`control`);if(n&&!n.htmlFor&&(n.htmlFor=i),r){let e=Wy(r,`fieldset-legend`);K.setAttribute({el:t,attr:`aria-labelledby`,value:Uy(t.getAttribute(`aria-labelledby`),e)})}o.forEach(e=>{K.setAttribute({el:t,attr:`aria-describedby`,value:Uy(t.getAttribute(`aria-describedby`),e)})}),e.hasAttribute(`data-invalid`)&&!t.hasAttribute(`aria-invalid`)&&t.setAttribute(`aria-invalid`,`true`)}e.matches(`fieldset`)&&o.length>0&&o.forEach(t=>{K.setAttribute({el:e,attr:`aria-describedby`,value:Uy(e.getAttribute(`aria-describedby`),t)})})}}),Ky=e=>{e.data(`UiField`,Gy)};function qy(e){return e.source.types.includes(`Files`)}function Jy(e){return e.source.items.filter(function(e){return e.kind===`file`}).map(function(e){return e.getAsFile()}).filter(function(e){return e!=null})}function Yy(e){var t=e.dragEnter,n=t.type,r=t.relatedTarget;return n===`dragenter`?jd()?Nd({dragEnter:t}):r==null?!0:Ad()?Id(r):r instanceof HTMLIFrameElement:!1}function Xy(e){var t=e.type,n=e.value;return!(t===`application/vnd.pdnd`||t===`text/plain`&&n===`pdnd:android-fallback`)}function Zy(e){return Array.from(e.types).filter(function(t){return Xy({type:t,value:e.getData(t)})})}function Qy(e){return Array.from(e.items).filter(function(t){return t.kind===`file`||Xy({type:t.type,value:e.getData(t.type)})})}var $y=!1,eb=gf({typeKey:`external`,defaultDropEffect:`copy`,mount:function(e){return(0,td.bind)(window,{type:`dragenter`,listener:function(t){if(!$y&&t.dataTransfer&&e.canStart(t)&&Yy({dragEnter:t})){var n=Zy(t.dataTransfer);if(n.length){var r={types:n,items:[],getStringData:function(){return null}};e.start({event:t,dragType:{type:`external`,startedFrom:`external`,payload:r,getDropPayload:function(e){if(!e.dataTransfer)return r;var t=Qy(e.dataTransfer),i=e.dataTransfer.getData.bind(e.dataTransfer);return{types:n,items:t,getStringData:function(e){if(!n.includes(e))return null;var t=i(e);return Xy({type:e,value:t})?t:null}}}}})}}}})}});function tb(e){return eb.dropTarget(e)}function nb(e){return eb.monitor(e)}(function(){if(typeof window>`u`)return;eb.registerUsage();var e={type:`idle`},t=e;function n(){t.type===`dragging`&&($y=!1,t.cleanup(),t=e)}function r(){return(0,td.bindAll)(window,[{type:`dragend`,listener:n}].concat(kd(Rd({onDragEnd:n}))),{capture:!0})}(0,td.bind)(window,{type:`dragstart`,listener:function(){t.type===`idle`&&($y=!0,t={type:`dragging`,cleanup:r()})},options:{capture:!0}})})();var rb=[`stack`,`inline`],ib=[`auto`,`image`,`none`],ab=[`sm`,`md`,`lg`],ob={name:B,accept:B,capture:B,multiple:H,required:H,disabled:H,invalid:H,preview:U(ib,`auto`),layout:U(rb,`stack`),size:U(ab,`md`),heading:B.default(`Drop files here or browse`),text:B,browseLabel:B,empty:B,maxItems:V.min(0).default(0),clearable:H.default(!0),rootClass:B,dropzoneClass:B,listClass:B,itemClass:B,class:B};B.default(`Drop files here or browse`),B.default(`cloud__upload`),U(rb,`stack`),U(ab,`md`),B.default(`document__blank`),B.default(`Remove file`);var sb=W({definition:{component:`ui.file-upload`,parts:{root:{base:[`grid w-full min-w-0 gap-3`,`data-disabled:cursor-not-allowed`]},control:{base:`relative grid min-w-0 gap-3`},input:{base:`sr-only`},dropzone:{base:[`relative grid min-w-0 overflow-hidden rounded-4 bg-surface-panel text-foreground shadow-control outline-none`,`hover:bg-base-a2 data-dragging:bg-base-a3`,`data-disabled:pointer-events-none data-disabled:cursor-not-allowed data-disabled:bg-surface-panel data-disabled:hover:bg-surface-panel`],variants:{layout:{stack:`justify-items-center text-center`,inline:`grid-cols-[auto_minmax(0,1fr)_auto] items-center text-left`},size:{sm:`gap-2 p-3`,md:`gap-3 p-4`,lg:`gap-3 p-5`}},defaults:{layout:`stack`,size:`md`}},icon:{base:`size-icon-lg shrink-0 fill-current text-icon`},body:{base:`grid min-w-0 gap-1`},heading:{base:`text-sm font-medium text-foreground`},text:{base:`text-xs font-normal text-foreground-muted`},browse:{base:[`inline-flex min-w-0 items-center justify-center rounded-3 bg-base-a2 px-2 py-1 text-xs font-medium text-foreground`,`shadow-border`]},list:{base:`grid min-w-0 gap-2`},empty:{base:`text-xs text-foreground-muted`},item:{base:[`grid min-w-0 grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-3 rounded-3 bg-surface-panel px-3 py-2 shadow-border`,`hover:shadow-border-hover`,`data-invalid:shadow-danger-focus`]},preview:{base:`flex size-9 shrink-0 items-center justify-center overflow-hidden rounded-2 bg-base-a2 text-icon`},previewImage:{base:`size-full`},itemIcon:{base:`size-icon fill-current`},itemBody:{base:`grid min-w-0 gap-0.5`},itemName:{base:`truncate text-sm font-medium text-foreground`},itemMeta:{base:`truncate text-xs font-normal text-foreground-muted`},itemError:{base:`truncate text-xs font-normal text-danger-text`},remove:{base:[`relative z-20 inline-flex size-control-sm shrink-0 items-center justify-center rounded-3 border-0 bg-transparent`,`text-icon outline-none hover:bg-base-a2 hover:text-foreground`,`focus-visible:ring-2 focus-visible:ring-focus`]},removeIcon:{base:`size-icon-xs fill-current leading-none`},clear:{base:`sr-only`}}}}),cb=e=>{if(e===0)return`0 B`;let t=[`B`,`KB`,`MB`,`GB`],n=Math.min(Math.floor(Math.log(e)/Math.log(1024)),t.length-1),r=e/1024**n;return`${r>=10||n===0?Math.round(r):Number(r.toFixed(1))} ${t[n]}`},lb=(e,t)=>[t,e.name,e.size,e.lastModified].join(`:`),ub=e=>e.type.startsWith(`image/`),db=(e,t)=>t!==`none`&&(t===`image`||ub(e)),fb=e=>e?Array.from(e):[],pb=(e,t)=>{let n=t.split(`,`).map(e=>e.trim().toLowerCase()).filter(Boolean);if(n.length===0)return!0;let r=e.name.toLowerCase(),i=e.type.toLowerCase();return n.some(e=>e.startsWith(`.`)?r.endsWith(e):e.endsWith(`/*`)?i.startsWith(`${e.slice(0,-1)}`):e.includes(`/`)?i===e:!1)},mb=(e,t)=>e.filter(e=>pb(e,t)),hb=(e,t)=>e.maxItems>0&&t>=e.maxItems,gb=e=>{if(typeof DataTransfer>`u`)return null;let t=new DataTransfer;return e.forEach(e=>t.items.add(e)),t.files},_b=(e,t)=>{let n=gb(t);if(!n)return!1;try{return e.files=n,!0}catch{return!1}},vb=e=>{e.dispatchEvent(new Event(`input`,{bubbles:!0})),e.dispatchEvent(new Event(`change`,{bubbles:!0}))},yb=e=>{let t=`http://www.w3.org/2000/svg`,n=document.createElementNS(t,`svg`),r=document.createElementNS(t,`polygon`);return n.setAttribute(`viewBox`,`0 0 32 32`),n.setAttribute(`aria-hidden`,`true`),n.setAttribute(`class`,e),r.setAttribute(`points`,`17.4141 16 24 9.4141 22.5859 8 16 14.5859 9.4143 8 8 9.4141 14.5859 16 8 22.5859 9.4143 24 16 17.4141 22.5859 24 24 22.5859 17.4141 16`),n.append(r),n},bb=()=>({props:null,listeners:[],files:[],limitReached:!1,emptyInputChangeClears:!1,init(){this.props=z({el:this.$el,schema:ob});let e=this.input(),t=this.dropzone();K.addListener({target:e,event:`change`,handler:()=>this.syncFromInput(),cleanup:this.listeners}),K.addListener({target:e,event:`click`,handler:e=>{this.isInputUnavailable()&&(e.preventDefault(),e.stopPropagation())},cleanup:this.listeners}),K.addListener({target:e,event:`keydown`,handler:e=>{!(e instanceof KeyboardEvent)||!this.isInputUnavailable()||e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),e.stopPropagation())},cleanup:this.listeners}),K.addListener({target:this.$el,event:`click`,handler:e=>{let t=e.target;if(!(t instanceof Element))return;let n=t.closest(`[data-ui-file-upload-remove][data-file-index]`);if(n){e.preventDefault(),this.removePending(Number(n.dataset.fileIndex));return}let r=t.closest(`[data-ui-file-upload-remove][data-existing-file]`);r&&(e.preventDefault(),this.clearExisting(r))},cleanup:this.listeners}),t&&(this.listeners.push(tb({element:t,canDrop:({source:e})=>!this.isInputUnavailable()&&qy({source:e}),getDropEffect:()=>`copy`,onDragEnter:()=>this.setDragging(!0),onDragLeave:()=>this.setDragging(!1),onDrop:({source:e})=>{this.setDragging(!1),!(this.isInputUnavailable()||!qy({source:e}))&&this.addFiles(Jy({source:e}))}})),this.listeners.push(nb({canMonitor:({source:e})=>qy({source:e}),onDrop:()=>this.setDragging(!1)}))),this.syncFromInput(),this.sync()},destroy(){this.files.forEach(e=>{e.previewUrl&&URL.revokeObjectURL(e.previewUrl)}),this.props.disconnect(),this.listeners.forEach(e=>e()),this.listeners=[]},root(){return this.$el},input(){let e=this.$el.querySelector(`[data-ui-file-upload-input]`);if(!e)throw Error(`File upload requires a native file input.`);return e},dropzone(){return this.$el.querySelector(`[data-ui-file-upload-dropzone]`)},list(){return this.$el.querySelector(`[data-ui-file-upload-list]`)},isInputUnavailable(){return this.props.disabled||hb(this.props,fb(this.input().files).length)},sync(){let e=this.root(),t=this.dropzone(),n=!!e.querySelector(`[data-ui-file-upload-item][data-existing-file]:not([hidden])`),r=this.files.length>0||n,i=this.isInputUnavailable();this.syncInputAttributes(),this.syncFormEncoding(),K.syncControlPresence({el:e,state:this.props,value:`true`}),K.setPresence({el:e,attr:`data-empty`,present:!r,value:`true`}),K.setPresence({el:e,attr:`data-has-files`,present:r,value:`true`}),K.setPresence({el:e,attr:`data-multiple`,present:this.props.multiple,value:`true`}),K.setPresence({el:e,attr:`data-max-items-reached`,present:this.limitReached,value:`true`}),K.setPresence({el:e,attr:`data-has-existing-file`,present:n,value:`true`}),t&&(K.syncControlPresence({el:t,state:{disabled:i,invalid:this.props.invalid},value:`true`}),K.setPresence({el:t,attr:`data-multiple`,present:this.props.multiple,value:`true`}),K.setPresence({el:t,attr:`data-has-files`,present:r,value:`true`}),K.setPresence({el:t,attr:`data-max-items-reached`,present:this.limitReached,value:`true`}))},syncFormEncoding(){let e=this.input().form;e&&(e.enctype=`multipart/form-data`)},syncInputAttributes(){let e=this.input();K.syncNativeControl({input:e,state:{name:this.props.name,disabled:this.props.disabled,required:this.props.required,invalid:this.props.invalid}}),e.multiple=this.props.multiple,this.props.accept?e.accept=this.props.accept:e.removeAttribute(`accept`),this.props.capture?e.setAttribute(`capture`,this.props.capture):e.removeAttribute(`capture`),this.isInputUnavailable()&&!this.props.disabled?(e.setAttribute(`aria-disabled`,`true`),e.tabIndex=-1):this.props.disabled||(e.removeAttribute(`aria-disabled`),e.removeAttribute(`tabindex`))},syncFromInput(){let e=this.input(),t=fb(e.files),n=this.emptyInputChangeClears;if(this.emptyInputChangeClears=!1,t.length===0&&this.files.length>0&&!n){_b(e,this.files.map(({file:e})=>e)),this.sync();return}let r=mb(t,this.props.accept),i=this.props.multiple?this.props.maxItems:1,a=i>0?r.slice(0,i):r,o=t.length-r.length,s=r.length-a.length,c=o+s;this.limitReached=hb(this.props,a.length),c>0&&(_b(e,a),s>0&&K.dispatch({el:this.root(),name:`ui:file-upload-limit`,detail:{rejectedCount:s}})),this.files.forEach(e=>{e.previewUrl&&URL.revokeObjectURL(e.previewUrl)}),this.files=a.map((e,t)=>({id:lb(e,t),file:e,name:e.name,size:cb(e.size),type:e.type||`File`,previewUrl:db(e,this.props.preview)?URL.createObjectURL(e):``})),this.renderFiles(),this.sync(),K.dispatch({el:this.root(),name:`ui:file-upload-change`,detail:{files:this.files.map(({name:e,size:t,type:n})=>({name:e,size:t,type:n}))}})},addFiles(e){if(this.isInputUnavailable()||e.length===0)return;let t=this.input(),n=mb(e,this.props.accept),r=this.props.multiple?fb(t.files):[],i=this.props.maxItems>0?Math.max(this.props.maxItems-r.length,0):n.length,a=this.props.multiple?n.slice(0,i):n.slice(0,1),o=n.length-a.length,s=this.props.multiple?[...r,...a]:a;if(o>0&&K.dispatch({el:this.root(),name:`ui:file-upload-limit`,detail:{rejectedCount:o}}),this.props.maxItems>0?this.limitReached=hb(this.props,s.length):this.limitReached=!1,s.length===0){this.sync();return}if(!_b(t,s)){t.click();return}vb(t)},removePending(e){if(this.props.disabled||!Number.isInteger(e))return;let t=this.input(),n=fb(t.files).filter((t,n)=>n!==e);if(n.length===0){this.emptyInputChangeClears=!0,_b(t,[])||(t.value=``),vb(t);return}_b(t,n)||(t.value=``),vb(t)},clearExisting(e){if(this.props.disabled||!this.props.clearable)return;let t=this.root().querySelector(`[data-ui-file-upload-clear]`);t&&(t.checked=!0,t.dispatchEvent(new Event(`change`,{bubbles:!0})));let n=e.closest(`[data-ui-file-upload-item][data-existing-file]`);n&&(n.hidden=!0),this.sync()},renderFiles(){let e=this.list();if(!e)return;e.querySelectorAll(`[data-ui-file-upload-pending]`).forEach(e=>e.remove());let t=e.querySelector(`[data-ui-file-upload-empty]`);t&&(t.hidden=this.files.length>0||!!e.querySelector(`[data-existing-file]:not([hidden])`));let n=G({part:sb.parts.item,props:{},className:this.props.itemClass}),r=G({part:sb.parts.preview}),i=[`relative block overflow-hidden ui-image-outline`,G({part:sb.parts.previewImage})].filter(Boolean).join(` `),a=G({part:sb.parts.itemBody}),o=G({part:sb.parts.itemName}),s=G({part:sb.parts.itemMeta}),c=G({part:sb.parts.remove}),l=G({part:sb.parts.removeIcon});this.files.forEach((t,u)=>{let d=document.createElement(`li`);d.dataset.uiFileUploadItem=``,d.dataset.uiFileUploadPending=``,d.dataset.fileIndex=String(u),d.className=n;let f=document.createElement(`span`);if(f.dataset.uiFileUploadPreview=``,f.className=r,f.setAttribute(`aria-hidden`,`true`),t.previewUrl){let e=document.createElement(`span`);e.dataset.uiImage=``,e.className=i;let n=document.createElement(`img`);n.src=t.previewUrl,n.alt=``,n.loading=`lazy`,n.decoding=`async`,n.dataset.uiImageImg=``,n.className=`outline outline-1 -outline-offset-1 outline-black/10 dark:outline-white/10 block size-full object-cover`,e.append(n),f.append(e)}else f.textContent=t.name.slice(0,1).toUpperCase();let p=document.createElement(`span`);p.className=a;let m=document.createElement(`span`);m.dataset.uiFileUploadItemName=``,m.className=o,m.textContent=t.name;let h=document.createElement(`span`);h.dataset.uiFileUploadItemMeta=``,h.className=s,h.textContent=[t.size,t.type].filter(Boolean).join(` · `),p.append(m,h);let g=document.createElement(`button`);g.type=`button`,g.dataset.uiFileUploadRemove=``,g.dataset.fileIndex=String(u),g.className=c,g.setAttribute(`aria-label`,`Remove ${t.name}`),g.append(yb(l)),d.append(f,p,g),e.append(d)})},setDragging(e){let t=this.root(),n=this.dropzone();K.setPresence({el:t,attr:`data-dragging`,present:e,value:`true`}),n&&K.setPresence({el:n,attr:`data-dragging`,present:e,value:`true`})}}),xb=e=>{e.data(`UiFileUpload`,()=>bb())},Sb=hh,Cb=gh,wb=Dh,Tb=_h,Eb={type:B.default(`text`),name:B,value:B,placeholder:B,size:U(Sb,`lg`),variant:U(Cb,`outline`),radius:U(wb,`md`),disabled:H,readonly:H,required:H,invalid:H,icon:B,iconTrailing:B,iconVariant:U(Tb,`outline`),clearable:H,copyable:H,kbd:B,prefix:B,suffix:B,rootClass:B,controlClass:B,class:B};U(Sb,`lg`),U(Cb,`outline`),U(wb,`md`);var Db=()=>({props:null,listeners:[],copiedTimer:null,init(){this.props=z({el:this.$el,schema:Eb});let e=this.input();K.addListener({target:e,event:`input`,handler:()=>this.sync(),cleanup:this.listeners}),K.addListener({target:this.$el,event:`click`,handler:e=>{let t=e.target;t instanceof Element&&(t.closest(`[data-ui-input-clear]`)&&this.clear(e),t.closest(`[data-ui-input-copy]`)&&this.copy(e))},cleanup:this.listeners}),this.sync()},destroy(){this.props.disconnect(),this.listeners.forEach(e=>e()),this.listeners=[],this.copiedTimer!==null&&window.clearTimeout(this.copiedTimer)},input(){let e=this.$el.querySelector(`[data-ui-input]`);if(!e)throw Error(`Input requires a native input element.`);return e},root(){return this.$el},sync(){let e=this.input().value.length>0;this.$el.querySelectorAll(`[data-ui-input-clear]`).forEach(t=>{t.hidden=!e})},clear(e){e?.preventDefault();let t=this.input();t.disabled||t.readOnly||(t.value=``,t.dispatchEvent(new InputEvent(`input`,{bubbles:!0,inputType:`deleteContentBackward`})),t.dispatchEvent(new Event(`change`,{bubbles:!0})),t.focus({preventScroll:!0}),this.sync())},async copy(e){e?.preventDefault();let t=this.input();if(t.disabled)return;navigator.clipboard?.writeText&&await navigator.clipboard.writeText(t.value);let n=this.root();K.setPresence({el:n,attr:`data-copied`,present:!0,value:`true`}),this.$el.querySelectorAll(`[data-ui-input-copy]`).forEach(e=>{K.setPresence({el:e,attr:`data-copied`,present:!0,value:`true`})}),this.copiedTimer!==null&&window.clearTimeout(this.copiedTimer),this.copiedTimer=window.setTimeout(()=>{K.setPresence({el:n,attr:`data-copied`,present:!1,value:`true`}),this.$el.querySelectorAll(`[data-ui-input-copy]`).forEach(e=>{K.setPresence({el:e,attr:`data-copied`,present:!1,value:`true`})})},1200)}}),Ob=e=>{e.data(`UiInput`,()=>Db())},kb=[`modal`,`sheet`],Ab=xh,jb=[`sm`,`md`,`lg`,`xl`,`full`],Mb=[`overlay`,`panel`,`inverse`],Nb=Oh,Pb=Th,Fb={name:B,open:H,mode:U(kb,`modal`),side:U(Ab,`right`),size:U(jb,`md`),surface:U(Mb,`overlay`),tone:U(Nb,`solid`),dismissible:H.default(!0),closable:H.default(!0),disabled:H,autofocusTitle:H,label:B,descriptionId:B,panelClass:B,overlayClass:B,class:B},Ib={name:B,disabled:H,class:B};B.default(`ui-modal-root`),U(Pb,`h2`),B.default(`Close`);var Lb={overlay:kh.overlay,panel:kh.panel,inverse:kh.inverse},Rb=[`grid-rows-[auto_auto_minmax(0,1fr)_auto]`,`[&>[data-ui-modal-body]]:-mx-1 [&>[data-ui-modal-body]]:min-h-0 [&>[data-ui-modal-body]]:content-start`,`[&>[data-ui-modal-body]]:overflow-x-hidden [&>[data-ui-modal-body]]:overflow-y-auto [&>[data-ui-modal-body]]:px-1`,`[&>[data-ui-modal-footer]]:self-end`],zb=W({definition:{component:`ui.modal`,parts:{instance:{base:`contents`},root:{base:[`fixed inset-0 z-dialog m-0 h-auto max-h-none w-auto max-w-none overflow-visible border-0 bg-transparent p-0 text-foreground`,`backdrop:bg-transparent`]},viewport:{base:`fixed inset-0 z-dialog flex min-h-dvh`,variants:{mode:{modal:`items-center justify-center overflow-y-auto p-4`,sheet:``},side:{top:``,right:``,bottom:``,left:``}},compounds:[{when:{mode:`sheet`,side:`top`},class:`items-start justify-center`},{when:{mode:`sheet`,side:`right`},class:`items-center justify-end overflow-hidden`},{when:{mode:`sheet`,side:`bottom`},class:`items-end justify-center`},{when:{mode:`sheet`,side:`left`},class:`items-center justify-start overflow-hidden`}],defaults:{mode:`modal`,side:`right`}},overlay:{base:`fixed inset-0 bg-overlay transition-opacity duration-150 data-[state=closed]:opacity-0`},panel:{base:[`relative z-dialog grid w-full min-w-0 gap-4 overflow-auto p-5 shadow-modal outline-none`,`max-h-full`],variants:{surface:Lb,tone:Ah,mode:{modal:`rounded-4`,sheet:``},side:{top:``,right:``,bottom:``,left:``},size:{sm:`max-w-sm`,md:`max-w-lg`,lg:`max-w-2xl`,xl:`max-w-4xl`,full:`max-w-full`}},compounds:[{when:{mode:`sheet`,side:`right`},class:[`min-h-dvh max-w-lg`,Rb]},{when:{mode:`sheet`,side:`left`},class:[`min-h-dvh max-w-lg`,Rb]},{when:{mode:`sheet`,side:`top`},class:`max-w-full`},{when:{mode:`sheet`,side:`bottom`},class:`max-w-full`},{when:{surface:`overlay`,tone:`alpha`},class:`bg-surface-overlay-alpha`},{when:{surface:`panel`,tone:`alpha`},class:`bg-surface-panel-alpha`}],defaults:{surface:`overlay`,tone:`solid`,mode:`modal`,side:`right`,size:`md`}},trigger:{base:`contents`},outlet:{base:``},title:{base:`pr-8`},description:{base:`-mt-3 pr-8`},body:{base:`grid min-w-0 gap-3 text-sm text-foreground`},footer:{base:`flex min-w-0 items-center justify-end gap-2 pt-1`},close:{base:[`absolute right-3 top-3 inline-flex size-control-md items-center justify-center rounded-2 border border-transparent text-icon outline-none`,`hover:bg-base-a2 focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2 focus-visible:ring-offset-app`]},closeIcon:{base:`size-icon fill-current`}}}}),Bb=new Set,Vb=new Set,Hb=[`a[href]`,`area[href]`,`button:not([disabled])`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`,`[contenteditable="true"]`].join(`,`),Ub=e=>e?`open`:`closed`,Wb=e=>(e.side===`left`||e.side===`right`)&&e.mode===`sheet`?`sheet`:`modal`,Gb=e=>Array.from(Bb).find(t=>t.name===e)??null,Kb=e=>Array.from(Vb).filter(t=>t.name===e),qb=e=>{let t=e.detail;t?.name&&Gb(t.name)?.close(e)},Jb=e=>!e.hasAttribute(`disabled`)&&e.getAttribute(`aria-disabled`)!==`true`&&!e.hidden&&e.tabIndex!==-1,Yb=e=>e.matches(Hb)&&Jb(e)?e:e.querySelector(Hb)??e,Xb=(e,t)=>{let n=Ub(t);e.setAttribute(`data-state`,n),e.setAttribute(`aria-expanded`,t?`true`:`false`)},Zb=()=>({props:null,isOpen:!1,dialogId:``,activeTrigger:null,cleanup:[],localTriggerCleanup:[],isRegistered:!1,didShowModal:!1,hasScrollLock:!1,modalMotionRun:0,overlayMotion:null,panelMotion:null,get name(){return this.props?.name??``},init(){this.props=z({el:this.$el,schema:Fb}),this.isOpen=this.props.open,this.dialogId=this.dialogEl().id||this.$id(`modal${this.props.name?`-${this.props.name}`:``}`),this.register(),this.mountLocalTrigger(),this.setupDialog(),this.overlayMotion=K.motion.createPresenceLifecycle({element:()=>this.overlayEl(),preset:`fade`}),this.panelMotion=K.motion.createPresenceLifecycle({element:()=>this.panelEl(),preset:Wb(this.props)}),this.syncAll(),this.$watch(`isOpen`,e=>{e?this.applyOpenState():this.applyClosedState()}),this.isOpen&&queueMicrotask(()=>this.applyOpenState())},destroy(){this.props.disconnect(),this.overlayMotion?.destroy(),this.panelMotion?.destroy(),this.hasScrollLock&&=(mh(),!1),this.unregister(),this.teardownLocalTrigger(),this.teardown()},get root(){return K.mergeBindings({inputs:[K.resolveStyle({part:zb.parts.instance,props:{},className:``}),{"data-ui-modal-instance":``}]})},dialogEl(){let e=this.$el.querySelector(`[data-ui-modal]`);if(!(e instanceof HTMLDialogElement))throw Error(`Modal requires a dialog element.`);return e},viewportEl(){let e=this.$el.querySelector(`[data-ui-modal-viewport]`);if(!e)throw Error(`Modal requires a viewport element.`);return e},overlayEl(){let e=this.$el.querySelector(`[data-ui-modal-overlay]`);if(!e)throw Error(`Modal requires an overlay element.`);return e},panelEl(){let e=this.$el.querySelector(`[data-ui-modal-panel]`);if(!e)throw Error(`Modal requires a panel element.`);return e},titleEl(){return this.$el.querySelector(`[data-ui-modal-title]`)},descriptionEl(){return this.$el.querySelector(`[data-ui-modal-description]`)},closeEls(){return Array.from(this.$el.querySelectorAll(`[data-ui-modal-close]`))},localTriggerEl(){return Array.from(this.$el.children).find(e=>e instanceof HTMLElement&&e.matches(`[data-ui-modal-trigger]`))??null},triggerTarget(e){return Yb(e)},focusableEls(){return Array.from(this.panelEl().querySelectorAll(Hb)).filter(Jb)},firstAutofocusEl(){return this.panelEl().querySelector(`[autofocus]`)},mountLocalTrigger(){let e=this.dialogEl(),t=e.querySelector(`[data-ui-modal-trigger]`);!t||t.dataset.name||(this.$el.insertBefore(t,e),this.setupLocalTrigger(t))},setupLocalTrigger(e){let t=this.triggerTarget(e);this.teardownLocalTrigger(),this.syncExternalTrigger(t,this.props.disabled),K.addListener({target:t,event:`click`,handler:e=>this.openFrom(t),cleanup:this.localTriggerCleanup}),K.addListener({target:t,event:`keydown`,handler:e=>{e instanceof KeyboardEvent&&(t instanceof HTMLButtonElement||t instanceof HTMLAnchorElement||e.key!==`Enter`&&e.key!==` `||this.open(e))},cleanup:this.localTriggerCleanup})},setupDialog(){let e=this.dialogEl();K.addListener({target:e,event:`cancel`,handler:t=>{t.target===e&&(t.preventDefault(),this.cancel(`escape`,t))},cleanup:this.cleanup}),K.addListener({target:e,event:`close`,handler:()=>{this.isOpen&&this.close()},cleanup:this.cleanup}),K.addListener({target:e,event:`keydown`,handler:e=>{e instanceof KeyboardEvent&&this.handleKeydown(e)},cleanup:this.cleanup}),this.closeEls().forEach(e=>{K.addListener({target:e,event:`click`,handler:e=>this.close(e),cleanup:this.cleanup})}),this.cleanup.push(K.addDismissableLayer({isEnabled:()=>this.isOpen,roots:()=>[this.panelEl(),this.activeTrigger,this.localTriggerEl()],onDismiss:e=>this.cancel(`outside`,e)}))},register(){this.isRegistered||=(Bb.add(this),!0)},unregister(){Bb.delete(this),this.isRegistered=!1},open(e){if(e?.preventDefault(),this.props.disabled)return;let t=this.localTriggerEl();this.activeTrigger=t?this.triggerTarget(t):this.activeTrigger,this.isOpen=!0},openFrom(e){this.props.disabled||(this.activeTrigger=e,this.isOpen=!0)},close(e){e?.preventDefault(),this.isOpen=!1},cancel(e,t){if(!this.props.dismissible){t?.preventDefault();return}this.close(t),K.dispatch({el:this.dialogEl(),name:`ui:cancel`,detail:{reason:e}})},syncExternalTrigger(e,t){if(Xb(e,this.isOpen),e.setAttribute(`aria-controls`,this.dialogId),e.setAttribute(`data-ui-modal-trigger-target`,this.dialogId),e.setAttribute(`data-state`,Ub(this.isOpen)),t||this.props.disabled){e.setAttribute(`aria-disabled`,`true`),e.setAttribute(`data-disabled`,``),e instanceof HTMLButtonElement&&(e.disabled=!0),e.matches(Hb)||(e.tabIndex=-1);return}e.removeAttribute(`aria-disabled`),e.removeAttribute(`data-disabled`),e instanceof HTMLButtonElement&&(e.disabled=!1),e.matches(Hb)||(e.tabIndex=0)},syncAll(){this.syncDialog(),this.syncLocalTrigger(),this.syncNamedTriggers()},syncDialog(){let e=this.dialogEl(),t=this.viewportEl(),n=this.overlayEl(),r=this.panelEl(),i=this.titleEl(),a=this.descriptionEl(),o=Ub(this.isOpen);e.id=this.dialogId,e.setAttribute(`role`,`dialog`),e.setAttribute(`aria-modal`,`true`),e.setAttribute(`data-state`,o),e.dataset.mode=this.props.mode,e.dataset.side=this.props.side,e.dataset.size=this.props.size,e.dataset.surface=this.props.surface,e.dataset.tone=this.props.tone,e.className=K.resolveStyle({part:zb.parts.root,props:this.props,className:this.props.class}),t.setAttribute(`data-state`,o),t.dataset.mode=this.props.mode,t.dataset.side=this.props.side,t.className=K.resolveStyle({part:zb.parts.viewport,props:this.props}),n.setAttribute(`data-state`,o),n.className=K.resolveStyle({part:zb.parts.overlay,props:this.props,className:this.props.overlayClass}),r.id||=this.$id(`modal-panel${this.props.name?`-${this.props.name}`:``}`),r.setAttribute(`data-state`,o),r.dataset.mode=this.props.mode,r.dataset.side=this.props.side,r.dataset.size=this.props.size,r.dataset.surface=this.props.surface,r.dataset.tone=this.props.tone,r.tabIndex=-1,r.className=K.resolveStyle({part:zb.parts.panel,props:this.props,className:this.props.panelClass}),i?(i.id||=this.$id(`modal-title${this.props.name?`-${this.props.name}`:``}`),e.setAttribute(`aria-labelledby`,i.id),e.removeAttribute(`aria-label`),this.props.autofocusTitle&&(i.tabIndex=-1)):this.props.label&&(e.setAttribute(`aria-label`,this.props.label),e.removeAttribute(`aria-labelledby`)),a&&(a.id||=this.$id(`modal-description${this.props.name?`-${this.props.name}`:``}`)),this.props.descriptionId===`none`?e.removeAttribute(`aria-describedby`):this.props.descriptionId?e.setAttribute(`aria-describedby`,this.props.descriptionId):a&&e.setAttribute(`aria-describedby`,a.id)},syncLocalTrigger(){let e=this.localTriggerEl();e&&this.syncExternalTrigger(this.triggerTarget(e),this.props.disabled)},syncNamedTriggers(){this.props.name&&Kb(this.props.name).forEach(e=>e.sync())},applyOpenState(){this.modalMotionRun+=1;let e=this.dialogEl();typeof e.showModal==`function`?this.didShowModal||=(e.open&&e.removeAttribute(`open`),e.showModal(),!0):e.open||e.setAttribute(`open`,``),this.hasScrollLock||=(ph(),!0),this.syncAll(),this.overlayMotion?.enter(),this.panelMotion?.enter(),queueMicrotask(()=>this.focusInitial()),K.dispatch({el:e,name:`ui:open`})},applyClosedState(){let e=++this.modalMotionRun;this.syncAll();let t=this.overlayMotion?.exit(),n=this.panelMotion?.exit();Promise.allSettled([t?.finished??Promise.resolve(),n?.finished??Promise.resolve()]).then(()=>this.finishClosedState(e))},finishClosedState(e){if(e!==this.modalMotionRun||this.isOpen)return;let t=this.dialogEl();t.open&&t.close(),this.didShowModal=!1,this.hasScrollLock&&=(mh(),!1),this.restoreFocus(),K.dispatch({el:t,name:`ui:close`})},focusInitial(){let e=this.firstAutofocusEl();if(e&&Jb(e)){e.focus({preventScroll:!0});return}let t=this.titleEl();if(this.props.autofocusTitle&&t){t.focus({preventScroll:!0});return}let n=this.focusableEls()[0];if(n){n.focus({preventScroll:!0});return}this.panelEl().focus({preventScroll:!0})},restoreFocus(){!this.activeTrigger||!document.contains(this.activeTrigger)||this.activeTrigger.focus({preventScroll:!0})},handleKeydown(e){e.key===`Tab`&&this.trapFocus(e)},trapFocus(e){let t=this.focusableEls();if(t.length===0){e.preventDefault(),this.panelEl().focus({preventScroll:!0});return}let n=t[0],r=t[t.length-1];if(!(!n||!r)){if(e.shiftKey&&document.activeElement===n){e.preventDefault(),r.focus({preventScroll:!0});return}!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n.focus({preventScroll:!0}))}},teardownLocalTrigger(){this.localTriggerCleanup.forEach(e=>e()),this.localTriggerCleanup=[]},teardown(){this.cleanup.forEach(e=>e()),this.cleanup=[]}}),Qb=()=>({props:null,target:null,cleanup:[],get name(){return this.props?.name??``},init(){this.props=z({el:this.$el,schema:Ib}),this.target=this.targetEl(),Vb.add(this),this.sync(),K.addListener({target:this.target,event:`click`,handler:e=>this.open(e),cleanup:this.cleanup}),K.addListener({target:this.target,event:`keydown`,handler:e=>{e instanceof KeyboardEvent&&(this.target instanceof HTMLButtonElement||this.target instanceof HTMLAnchorElement||e.key!==`Enter`&&e.key!==` `||this.open(e))},cleanup:this.cleanup})},destroy(){this.props.disconnect(),Vb.delete(this),this.cleanup.forEach(e=>e()),this.cleanup=[]},get root(){return K.mergeBindings({inputs:[K.resolveStyle({part:zb.parts.trigger,props:{},className:this.props.class}),{"data-ui-modal-trigger":``,":data-name":()=>this.props.name||void 0,":data-disabled":()=>this.props.disabled?``:void 0}]})},sync(){let e=this.modal();if(e){e.syncExternalTrigger(this.target,this.props.disabled);return}Xb(this.target,!1),this.props.disabled?(this.target.setAttribute(`aria-disabled`,`true`),this.target.setAttribute(`data-disabled`,``)):(this.target.removeAttribute(`aria-disabled`),this.target.removeAttribute(`data-disabled`))},modal(){return this.props.name?Gb(this.props.name):null},open(e){e?.preventDefault(),!this.props.disabled&&this.modal()?.openFrom(this.target)},targetEl(){return Yb(this.$el)}}),$b=e=>{e.data(`UiModal`,()=>Zb()),e.data(`UiModalTrigger`,()=>Qb()),document.addEventListener(`ui:modal-close`,qb)},ex=Sh,tx=[`default`,`cards`,`pills`],nx=Ch,rx=hh,ix=[`default`,`cards`,`pills`],ax={name:B,value:B,orientation:U(ex,`vertical`),variant:U(tx,`default`),indicator:H.default(!0),placement:U(nx,`leading`),disabled:H,required:H,invalid:H,loop:H.default(!0),class:B};H.default(!0),U(nx,`leading`),U(ix,`default`),U(rx,`md`),U(rx,`md`);var ox=(e,t)=>t.value||e.dataset.value||e.textContent?.trim()||``,sx=()=>({props:null,value:``,listeners:[],observer:null,init(){this.props=z({el:this.$el,schema:ax});let e=this.items().find(e=>e.input.checked);this.value=this.props.value||e?.value||``,K.addListener({target:this.$el,event:`change`,handler:e=>{let t=e.target;if(!(t instanceof HTMLInputElement)||t.type!==`radio`)return;let n=this.items().find(e=>e.input===t);n&&this.select(n,e)},cleanup:this.listeners}),K.addListener({target:this.$el,event:`keydown`,handler:e=>{let t=e.target;if(!(t instanceof HTMLInputElement)||t.type!==`radio`)return;let n=this.items().find(e=>e.input===t);n&&e instanceof KeyboardEvent&&this.handleKeydown(n,e)},cleanup:this.listeners}),this.observer=new MutationObserver(()=>this.sync()),this.observer.observe(this.$el,{childList:!0,subtree:!0}),this.sync()},destroy(){this.props.disconnect(),this.listeners.forEach(e=>e()),this.listeners=[],this.observer?.disconnect()},items(){return Array.from(this.$el.querySelectorAll(`[data-ui-radio]`)).map(e=>{let t=e.querySelector(`[data-ui-radio-input]`);if(!t)return null;let n=this.props.disabled||e.hasAttribute(`data-disabled`);return{root:e,input:t,indicator:e.querySelector(`[data-ui-radio-indicator]`),dot:e.querySelector(`[data-ui-radio-indicator-dot]`),value:ox(e,t),disabled:n}}).filter(e=>e!==null)},enabledItems(){return this.items().filter(e=>!e.disabled)},select(e,t){e.disabled||(this.value=e.value,this.sync(),t?.type!==`change`&&(e.input.dispatchEvent(new Event(`input`,{bubbles:!0})),e.input.dispatchEvent(new Event(`change`,{bubbles:!0}))))},move(e,t){let n=this.enabledItems(),r=n.findIndex(t=>t.input===e.input);if(r<0)return;let i=r+t;if(i<0||i>=n.length){if(!this.props.loop)return;i=i<0?n.length-1:0}let a=n[i];a&&(this.select(a),a.input.focus({preventScroll:!0}))},sync(){let e=this.$el;K.setAttribute({el:e,attr:`data-orientation`,value:this.props.orientation}),K.setAttribute({el:e,attr:`data-variant`,value:this.props.variant}),K.setAttribute({el:e,attr:`data-placement`,value:this.props.placement}),K.setAttribute({el:e,attr:`aria-orientation`,value:this.props.orientation}),this.props.indicator?e.removeAttribute(`data-indicator`):K.setAttribute({el:e,attr:`data-indicator`,value:`false`}),K.syncControlPresence({el:e,state:this.props});let t=this.items();this.value||=t.find(e=>e.input.checked)?.value||``,t.forEach(e=>this.syncItem(e))},syncItem(e){let t=e.value===this.value,n=this.enabledItems()[0],r=t||!this.value&&n?.input===e.input;e.input.checked=t,K.syncNativeControl({input:e.input,state:{name:this.props.name,value:e.value,disabled:e.disabled,required:this.props.required||e.root.hasAttribute(`data-required`),invalid:this.props.invalid||e.root.hasAttribute(`data-invalid`)}}),e.input.tabIndex=e.disabled?-1:r?0:-1,K.setPresence({el:e.root,attr:`data-ui-interactive`,present:this.props.variant===`cards`||e.root.dataset.variant===`cards`,value:`surface`}),K.setAttribute({el:e.root,attr:`data-state`,value:t?`checked`:`unchecked`}),K.setPresence({el:e.root,attr:`data-checked`,present:t}),K.setPresence({el:e.root,attr:`data-disabled`,present:e.disabled}),K.setPresence({el:e.root,attr:`data-invalid`,present:this.props.invalid||e.root.hasAttribute(`data-invalid`)}),K.setPresence({el:e.input,attr:`data-checked`,present:t}),e.indicator&&K.setPresence({el:e.indicator,attr:`data-checked`,present:t}),e.dot&&K.setPresence({el:e.dot,attr:`data-checked`,present:t})},handleKeydown(e,t){if(t.key===` `||t.key===`Spacebar`){t.preventDefault(),this.select(e);return}[`ArrowUp`,`ArrowLeft`].includes(t.key)&&(t.preventDefault(),this.move(e,-1)),[`ArrowDown`,`ArrowRight`].includes(t.key)&&(t.preventDefault(),this.move(e,1))}}),cx=e=>{e.data(`UiRadioGroup`,()=>sx())},lx={orientation:U([`vertical`,`horizontal`,`both`],`vertical`),type:U([`hover`,`always`,`scroll`],`hover`),size:U([`sm`,`md`],`sm`),fill:H,hideNative:H.default(!0),disabled:H,class:B,viewportClass:B,scrollbarClass:B,thumbClass:B,cornerClass:B},ux=W({definition:{component:`ui.scroll-area`,parts:{root:{base:[`relative min-w-0 overflow-hidden text-foreground`,`data-disabled:opacity-60`],variants:{fill:{true:`flex min-h-0 flex-1 flex-col`,false:``},size:{sm:``,md:``}},defaults:{fill:!1,size:`sm`}},viewport:{base:[`min-h-0 min-w-0 outline-none`,`focus-visible:shadow-focus`],variants:{orientation:{vertical:`h-full w-full overflow-x-hidden overflow-y-auto`,horizontal:`h-full w-full overflow-x-auto overflow-y-hidden`,both:`size-full overflow-auto`},fill:{true:`flex-1`,false:``}},defaults:{orientation:`vertical`,fill:!1}},content:{base:`min-w-0`,variants:{orientation:{vertical:``,horizontal:`w-max min-w-full`,both:`min-w-full`}},defaults:{orientation:`vertical`}},scrollbar:{base:[`pointer-events-none absolute z-10 rounded-scrollbar-thumb opacity-0`,`data-visible:pointer-events-auto data-visible:opacity-100 data-disabled:pointer-events-none`],variants:{orientation:{vertical:`bottom-scrollbar-inset right-scrollbar-inset top-scrollbar-inset w-scrollbar`,horizontal:`bottom-scrollbar-inset left-scrollbar-inset right-scrollbar-inset h-scrollbar`}},defaults:{orientation:`vertical`}},thumb:{base:[`absolute rounded-scrollbar-thumb bg-scrollbar-thumb`,`hover:bg-scrollbar-thumb-hover data-dragging:bg-scrollbar-thumb-hover`],variants:{orientation:{vertical:`left-0 top-0 w-full`,horizontal:`left-0 top-0 h-full`}},defaults:{orientation:`vertical`}},corner:{base:[`pointer-events-none absolute bottom-scrollbar-inset right-scrollbar-inset z-10 size-scrollbar rounded-scrollbar-thumb`,`bg-transparent opacity-0`,`data-visible:opacity-100`]}}}}),dx=18,fx=1e3,px=null,mx=(e,t,n)=>Math.min(n,Math.max(t,e)),hx=(e,t)=>e===`both`||e===`horizontal`&&t===`x`||e===`vertical`&&t===`y`,gx=()=>{if(px)return px;let e=document.createElement(`div`),t=document.createElement(`div`);return e.dir=`rtl`,e.style.cssText=`position:absolute;left:-9999px;width:4px;height:1px;overflow:scroll;`,t.style.cssText=`width:8px;height:1px;`,e.append(t),document.body.append(e),e.scrollLeft=1,e.scrollLeft===0?px=`negative`:(e.scrollLeft=0,px=e.scrollLeft===0?`reverse`:`default`),e.remove(),px},_x=e=>{let t=Math.max(0,e.scrollWidth-e.clientWidth);if(!K.isRtl({el:e}))return e.scrollLeft;let n=gx();return n===`negative`?-e.scrollLeft:n===`reverse`?t-e.scrollLeft:e.scrollLeft},vx=(e,t)=>{let n=Math.max(0,e.scrollWidth-e.clientWidth),r=mx(t,0,n);if(!K.isRtl({el:e})){e.scrollLeft=r;return}let i=gx();i===`negative`?e.scrollLeft=-r:i===`reverse`?e.scrollLeft=n-r:e.scrollLeft=r},yx=e=>e.dataset.orientation===`horizontal`?`x`:`y`,bx=e=>e instanceof HTMLElement,xx=(e,t)=>{let n=e.querySelector(`:scope > ${t}`);return bx(n)?n:null},Sx=()=>({props:null,listeners:[],resizeObserver:null,mutationObserver:null,frame:0,positionFrame:0,fadeTimer:0,isHovered:!1,isFocused:!1,isScrolling:!1,dragging:null,overflowX:!1,overflowY:!1,verticalGeometry:null,horizontalGeometry:null,init(){this.props=z({el:this.$el,schema:lx});let e=this.elements();this.resizeObserver=new ResizeObserver(()=>this.scheduleSync()),this.resizeObserver.observe(e.viewport),e.content&&this.resizeObserver.observe(e.content),this.mutationObserver=new MutationObserver(()=>this.scheduleSync()),e.content&&this.mutationObserver.observe(e.content,{childList:!0,subtree:!0,characterData:!0}),K.addListener({target:e.viewport,event:`scroll`,handler:()=>this.onScroll(),cleanup:this.listeners,options:{passive:!0}}),K.addListener({target:this.$el,event:`pointerenter`,handler:()=>{this.isHovered=!0,this.sync()},cleanup:this.listeners}),K.addListener({target:this.$el,event:`pointerleave`,handler:()=>{this.isHovered=!1,this.updateVisibility(this.elements())},cleanup:this.listeners}),K.addListener({target:this.$el,event:`focusin`,handler:()=>{this.isFocused=!0,this.sync()},cleanup:this.listeners}),K.addListener({target:this.$el,event:`focusout`,handler:()=>{this.isFocused=this.$el.contains(document.activeElement),this.updateVisibility(this.elements())},cleanup:this.listeners}),K.addListener({target:document,event:`pointermove`,handler:e=>this.onPointerMove(e),cleanup:this.listeners}),K.addListener({target:document,event:`pointerup`,handler:e=>this.onPointerUp(e),cleanup:this.listeners}),K.addListener({target:document,event:`pointercancel`,handler:e=>this.onPointerUp(e),cleanup:this.listeners}),e.verticalThumb&&K.addListener({target:e.verticalThumb,event:`pointerdown`,handler:e=>{e.preventDefault(),this.onPointerDown(e,`y`)},cleanup:this.listeners}),e.horizontalThumb&&K.addListener({target:e.horizontalThumb,event:`pointerdown`,handler:e=>{e.preventDefault(),this.onPointerDown(e,`x`)},cleanup:this.listeners}),this.$watch(`props.orientation`,()=>this.scheduleSync()),this.$watch(`props.type`,()=>this.scheduleSync()),this.$watch(`props.hideNative`,()=>this.scheduleSync()),this.$watch(`props.disabled`,()=>this.scheduleSync()),this.scheduleSync()},destroy(){this.props.disconnect(),this.listeners.splice(0).forEach(e=>e()),this.resizeObserver?.disconnect(),this.mutationObserver?.disconnect(),this.clearFadeTimer(),this.frame&&cancelAnimationFrame(this.frame),this.positionFrame&&cancelAnimationFrame(this.positionFrame),this.frame=0,this.positionFrame=0,this.dragging=null},get root(){return K.mergeBindings({inputs:[G({part:ux.parts.root,props:{fill:this.props.fill,size:this.props.size},className:this.props.class}),{"data-ui-scroll-area":``,":data-orientation":()=>this.props.orientation,":data-type":()=>this.props.type,":data-size":()=>this.props.size,":data-fill":()=>this.props.fill?``:void 0,":data-disabled":()=>this.props.disabled?``:void 0}]})},viewport(e){return K.mergeBindings({inputs:[G({part:ux.parts.viewport,props:{orientation:this.props.orientation,fill:this.props.fill},className:e.dataset.class}),{tabindex:`0`,"data-ui-scroll-area-viewport":``,":data-orientation":()=>this.props.orientation,":data-hide-native":()=>this.props.hideNative?``:void 0}]})},scrollbar(e){let t=yx(e)===`x`?`horizontal`:`vertical`;return K.mergeBindings({inputs:[G({part:ux.parts.scrollbar,props:{orientation:t},className:e.dataset.class}),{"data-ui-scroll-area-scrollbar":``,"aria-hidden":`true`,":data-disabled":()=>this.props.disabled?``:void 0}]})},thumb(e){let t=yx(e),n=t===`x`?`horizontal`:`vertical`;return K.mergeBindings({inputs:[G({part:ux.parts.thumb,props:{orientation:n},className:e.dataset.class}),{"data-ui-scroll-area-thumb":``,"aria-hidden":`true`,"@pointerdown.prevent":e=>this.onPointerDown(e,t),":data-dragging":()=>this.dragging?.axis===t?``:void 0}]})},corner(e){return K.mergeBindings({inputs:[G({part:ux.parts.corner,className:e.dataset.class}),{"data-ui-scroll-area-corner":``,"aria-hidden":`true`}]})},elements(){let e=this.$el,t=xx(e,`[data-ui-scroll-area-viewport]`)??e;return{root:e,viewport:t,content:xx(t,`[data-ui-scroll-area-content]`),verticalScrollbar:xx(e,`[data-ui-scroll-area-scrollbar][data-orientation="vertical"]`),horizontalScrollbar:xx(e,`[data-ui-scroll-area-scrollbar][data-orientation="horizontal"]`),verticalThumb:xx(e,`[data-ui-scroll-area-scrollbar][data-orientation="vertical"] > [data-ui-scroll-area-thumb][data-orientation="vertical"]`),horizontalThumb:xx(e,`[data-ui-scroll-area-scrollbar][data-orientation="horizontal"] > [data-ui-scroll-area-thumb][data-orientation="horizontal"]`),corner:xx(e,`[data-ui-scroll-area-corner]`)}},scheduleSync(){this.frame||=requestAnimationFrame(()=>{this.frame=0,this.sync()})},schedulePositionSync(){this.positionFrame||=requestAnimationFrame(()=>{this.positionFrame=0,this.updateThumbPositions(this.elements())})},sync(){let e=this.elements(),{viewport:t}=e;this.overflowX=hx(this.props.orientation,`x`)&&t.scrollWidth>t.clientWidth+1,this.overflowY=hx(this.props.orientation,`y`)&&t.scrollHeight>t.clientHeight+1,K.setPresence({el:this.$el,attr:`data-overflow-x`,present:this.overflowX}),K.setPresence({el:this.$el,attr:`data-overflow-y`,present:this.overflowY}),K.setPresence({el:this.$el,attr:`data-scrolling`,present:this.isScrolling}),K.setPresence({el:this.$el,attr:`data-dragging`,present:this.dragging!==null}),K.setPresence({el:this.$el,attr:`data-disabled`,present:this.props.disabled}),K.setAttribute({el:t,attr:`data-orientation`,value:this.props.orientation}),K.setPresence({el:t,attr:`data-hide-native`,present:this.props.hideNative}),this.updateGeometry(e),this.updateVisibility(e)},updateGeometry(e){let{viewport:t}=e,n=(e,n,r,i)=>{if(!n||!r||!i)return r&&(r.style.width=``,r.style.height=``,r.style.transform=``),null;let a=e===`y`?n.clientHeight:n.clientWidth,o=e===`y`?t.clientHeight:t.clientWidth,s=e===`y`?t.scrollHeight:t.scrollWidth,c=Math.max(1,s-o),l=Math.min(a,Math.max(dx,o/s*a)),u=Math.max(0,a-l);return e===`y`?(r.style.height=`${l}px`,r.style.width=``):(r.style.width=`${l}px`,r.style.height=``),{trackLength:a,thumbLength:l,maxOffset:u,maxScroll:c}};this.verticalGeometry=n(`y`,e.verticalScrollbar,e.verticalThumb,this.overflowY),this.horizontalGeometry=n(`x`,e.horizontalScrollbar,e.horizontalThumb,this.overflowX),this.updateThumbPositions(e)},updateThumbPositions(e){let{viewport:t}=e;if(e.verticalThumb&&this.verticalGeometry){let{maxOffset:n,maxScroll:r}=this.verticalGeometry,i=n*mx(t.scrollTop/r,0,1);e.verticalThumb.style.transform=`translate3d(0, ${i}px, 0)`}if(e.horizontalThumb&&this.horizontalGeometry){let{maxOffset:n,maxScroll:r}=this.horizontalGeometry,i=n*mx(_x(t)/r,0,1);e.horizontalThumb.style.transform=`translate3d(${i}px, 0, 0)`}},updateVisibility(e){let t=this.isHovered||this.isFocused||this.isScrolling||this.dragging!==null,n=e=>e?this.props.type===`always`?!0:this.props.type===`scroll`?this.isScrolling||this.dragging!==null:t:!1,r=n(this.overflowY),i=n(this.overflowX);[e.verticalScrollbar,e.verticalThumb].forEach(e=>{e&&K.setPresence({el:e,attr:`data-visible`,present:r})}),[e.horizontalScrollbar,e.horizontalThumb].forEach(e=>{e&&K.setPresence({el:e,attr:`data-visible`,present:i})}),[e.verticalScrollbar,e.horizontalScrollbar].forEach(e=>{e&&K.setPresence({el:e,attr:`data-disabled`,present:this.props.disabled})}),[e.verticalThumb,e.horizontalThumb].forEach(e=>{e&&K.setPresence({el:e,attr:`data-dragging`,present:this.dragging?.axis===yx(e)})}),e.corner&&K.setPresence({el:e.corner,attr:`data-visible`,present:r&&i})},startFadeTimer(){this.clearFadeTimer(),this.fadeTimer=window.setTimeout(()=>{this.isScrolling=!1,K.setPresence({el:this.$el,attr:`data-scrolling`,present:!1}),this.updateVisibility(this.elements())},fx)},clearFadeTimer(){this.fadeTimer&&=(window.clearTimeout(this.fadeTimer),0)},onScroll(){let e=this.isScrolling;this.isScrolling=!0,e||(K.setPresence({el:this.$el,attr:`data-scrolling`,present:!0}),this.updateVisibility(this.elements())),this.overflowY&&!this.verticalGeometry||this.overflowX&&!this.horizontalGeometry?this.scheduleSync():this.schedulePositionSync(),this.startFadeTimer()},onPointerDown(e,t){if(this.props.disabled)return;let n=this.elements(),r=n.viewport,i=t===`y`?n.verticalScrollbar:n.horizontalScrollbar,a=t===`y`?n.verticalThumb:n.horizontalThumb,o=t===`y`?this.overflowY:this.overflowX;if(!i||!a||!o)return;let s=t===`y`?i.clientHeight:i.clientWidth,c=t===`y`?a.offsetHeight:a.offsetWidth,l=t===`y`?Math.max(0,r.scrollHeight-r.clientHeight):Math.max(0,r.scrollWidth-r.clientWidth),u=t===`y`?r.scrollTop:_x(r);this.dragging={axis:t,pointerId:e.pointerId,startPointer:t===`y`?e.clientY:e.clientX,startScroll:u,trackLength:s,thumbLength:c,maxScroll:l};try{a.setPointerCapture?.(e.pointerId)}catch{}this.isScrolling=!0,this.clearFadeTimer(),this.sync()},onPointerMove(e){if(!this.dragging||this.dragging.pointerId!==e.pointerId)return;e.preventDefault();let t=this.elements().viewport,n=(this.dragging.axis===`y`?e.clientY:e.clientX)-this.dragging.startPointer,r=Math.max(1,this.dragging.trackLength-this.dragging.thumbLength),i=this.dragging.startScroll+n/r*this.dragging.maxScroll;this.dragging.axis===`y`?t.scrollTop=mx(i,0,this.dragging.maxScroll):vx(t,i),this.schedulePositionSync()},onPointerUp(e){if(!this.dragging||this.dragging.pointerId!==e.pointerId)return;let t=this.elements(),n=this.dragging.axis===`y`?t.verticalThumb:t.horizontalThumb;try{n?.releasePointerCapture?.(e.pointerId)}catch{}this.dragging=null,this.startFadeTimer(),this.sync()}}),Cx=e=>{e.data(`UiScrollArea`,()=>Sx())},wx=W({definition:{component:`ui.badge`,parts:{root:{base:[`inline-flex min-w-0 shrink-0 select-none items-center justify-center gap-1 whitespace-nowrap font-medium outline-none`,`focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2 focus-visible:ring-offset-app`,`data-disabled:pointer-events-none data-disabled:opacity-50`],variants:{variant:{soft:`bg-current/10 text-foreground-muted`,surface:`bg-surface-panel text-foreground shadow-border`,outline:`border border-border bg-transparent text-foreground-muted`,solid:`bg-base-12 text-base-1 shadow-1`},color:{neutral:``,accent:``,success:``,warning:``,danger:``},size:{xs:`min-h-control-xs px-1.5 text-xs`,sm:`min-h-control-sm px-2 text-xs`,md:`min-h-control-md px-2.5 text-sm`,lg:`min-h-control-lg px-3 text-sm`,xlg:`min-h-control-xlg px-4 text-sm`},insetLeft:{true:``,false:``},insetRight:{true:``,false:``},insetTop:{true:`-mt-1`,false:``},insetBottom:{true:`-mb-1`,false:``}},compounds:[{when:{variant:`soft`,color:`accent`},class:`text-accent-text`},{when:{variant:`soft`,color:`success`},class:`text-success-text`},{when:{variant:`soft`,color:`warning`},class:`text-warning-text`},{when:{variant:`soft`,color:`danger`},class:`text-danger-text`},{when:{variant:`surface`,color:`accent`},class:`border border-accent-border bg-surface-panel text-accent-text shadow-none`},{when:{variant:`surface`,color:`success`},class:`border border-success-border bg-surface-panel text-success-text shadow-none`},{when:{variant:`surface`,color:`warning`},class:`border border-warning-border bg-surface-panel text-warning-text shadow-none`},{when:{variant:`surface`,color:`danger`},class:`border border-danger-border bg-surface-panel text-danger-text shadow-none`},{when:{variant:`outline`,color:`accent`},class:`border border-accent-border bg-transparent text-accent-text`},{when:{variant:`outline`,color:`success`},class:`border border-success-border bg-transparent text-success-text`},{when:{variant:`outline`,color:`warning`},class:`border border-warning-border bg-transparent text-warning-text`},{when:{variant:`outline`,color:`danger`},class:`border border-danger-border bg-transparent text-danger-text`},{when:{variant:`solid`,color:`accent`},class:`bg-accent-solid text-accent-contrast shadow-1`},{when:{variant:`solid`,color:`success`},class:`bg-success-solid text-success-contrast shadow-1`},{when:{variant:`solid`,color:`warning`},class:`bg-warning-solid text-warning-contrast shadow-1`},{when:{variant:`solid`,color:`danger`},class:`bg-danger-solid text-danger-contrast shadow-1`},...Mh,{when:{insetLeft:!0,size:`xs`},class:`-ml-1.5`},{when:{insetLeft:!0,size:`sm`},class:`-ml-2`},{when:{insetLeft:!0,size:`md`},class:`-ml-2.5`},{when:{insetRight:!0,size:`xs`},class:`-mr-1.5`},{when:{insetRight:!0,size:`sm`},class:`-mr-2`},{when:{insetRight:!0,size:`md`},class:`-mr-2.5`}],defaults:{variant:`soft`,color:`neutral`,size:`sm`,radius:`sm`,insetLeft:!1,insetRight:!1,insetTop:!1,insetBottom:!1}},label:{base:`contents`},icon:{base:`shrink-0 fill-current text-current`,variants:{size:{xs:`size-icon-xs`,sm:`size-icon-xs`,md:`size-icon-sm`,lg:`size-icon-sm`,xlg:`size-icon`},position:{leading:``,trailing:``}},defaults:{size:`sm`,position:`leading`}},close:{base:[`-mr-1 inline-flex shrink-0 items-center justify-center rounded-full text-current outline-none`,`hover:bg-current/10 focus-visible:bg-current/10`,`focus-visible:ring-1 focus-visible:ring-current data-disabled:pointer-events-none data-disabled:opacity-50`],variants:{size:{xs:`size-4`,sm:`size-4`,md:`size-5`,lg:`size-5`,xlg:`size-6`}},defaults:{size:`sm`}},closeIcon:{base:`size-icon-xs shrink-0 fill-current text-current`}}}}),Tx=[`soft`,`surface`,`outline`,`solid`],Ex=[`neutral`,`accent`,`success`,`warning`,`danger`],Dx=hh,Ox=[`span`,`button`],kx=vh,Ax=_h,jx=Dh;U(Tx,`soft`),U(Ex,`neutral`),U(Dx,`sm`),U(jx,`sm`),U(Ox,`span`),U(kx,`button`),U(Ax,`mini`),U(kx,`button`),B.default(`close`),U(Ax,`mini`),U(Dx,`sm`),B.default(`Remove`);var Mx=[`listbox`,`combobox`,`pillbox`,`native`],Nx=gh,Px=hh,Fx=Dh,Ix=bh,Lx=yh,Rx=_h,zx={name:B,value:B,values:B,placeholder:B,mode:U(Mx,`listbox`),multiple:H,searchable:H,filter:H.default(!0),clearable:H,clear:U([`stay`,`close`],`stay`),suffix:B.default(`selected`),mark:U([`check`,`checkbox`,`none`],`check`),open:H,disabled:H,readonly:H,required:H,invalid:H,autoHighlight:H.default(!0),loop:H.default(!0),path:B,size:U(Px,`lg`),variant:U(Nx,`outline`),radius:U(Fx,`md`),side:U(Ix,`bottom`),align:U(Lx,`start`),offset:V.clamp(-100,100).default(0),gap:V.clamp(0,50).default(4),empty:B.default(`No results found.`),searchPlaceholder:B.default(`Search...`),searchIcon:B.default(`search`),icon:B,iconTrailing:B.default(`chevron__down`),iconVariant:U(Rx,`outline`),buttonClass:B,inputClass:B,searchClass:B,listboxClass:B,optionClass:B,chipVariant:U(Tx,`soft`),chipColor:U(Ex,`neutral`),chipClass:B,class:B};U(Rx,`outline`),V.clamp(0,100).default(0);var Bx=W({definition:{component:`ui.select`,parts:{root:{base:`relative inline-grid w-full min-w-0`},control:{base:[Nh,Ph],variants:{size:Fh,variant:Ih,mode:{listbox:``,combobox:``,pillbox:`flex-wrap gap-1 py-0.5`,native:``},empty:{true:``,false:``}},compounds:[{when:{mode:`pillbox`,empty:!1},class:`!pl-1.5`},...Mh],defaults:{size:`lg`,variant:`outline`,radius:`md`,mode:`listbox`,empty:!1}},button:{base:[`flex min-w-0 flex-1 items-center gap-2 border-0 bg-transparent p-0 text-left text-inherit outline-none`,`disabled:cursor-not-allowed`]},value:{base:`min-w-0 flex-1`},placeholder:{base:`min-w-0 flex-1 text-foreground`},input:{base:[`w-full min-w-16 flex-1`,Lh]},search:{base:[`flex min-h-control-xlg shrink-0 items-center gap-2 border-b border-popover-border px-3`,`text-sm text-foreground`]},searchInput:{base:[`min-w-0 flex-1 text-sm`,Lh]},chips:{base:`flex min-w-0 flex-wrap items-center gap-1`},chip:{base:[`max-w-64`]},chipLabel:{base:`block min-w-0 flex-1 truncate`},chipRemove:{base:``},icon:{base:`size-icon shrink-0 fill-current text-icon`,variants:{position:{leading:``,trailing:``}},defaults:{position:`leading`}},action:{base:Rh},popover:{base:[Bh,`overflow-hidden`]},viewport:{base:`grid auto-rows-min content-start max-h-combobox-listbox gap-1 overflow-x-hidden overflow-y-auto p-popover`},option:{base:[Hh,`[&:has([data-ui-select-option-label]>*+*)]:h-auto`,`[&:has([data-ui-select-option-label]>*+*)]:items-start`,`[&:has([data-ui-select-option-label]>*+*)]:py-2`]},optionLabel:{base:`min-w-0 flex-1 truncate`},optionMeta:{base:`ml-auto text-menu-item-muted`},optionIcon:{base:Uh,variants:{position:{leading:``,trailing:`ml-auto`}},defaults:{position:`leading`}},optionIndicator:{base:Wh},optionCheckbox:{base:[`ml-auto inline-flex size-icon-sm shrink-0 items-center justify-center rounded-1 border border-border bg-surface-panel text-accent-contrast`,`data-selected:border-accent-solid data-selected:bg-accent-solid`]},group:{base:`grid auto-rows-min content-start gap-1`},label:{base:`px-menu-item-x py-1 text-menu-heading-fg`},empty:{base:`px-menu-item-x py-2 text-sm text-foreground-muted`},separatorRoot:{base:`-mx-popover my-popover h-px`},separatorRule:{base:`h-px w-full border-0 bg-menu-separator`},nativeWrapper:{base:`relative w-full min-w-0`},native:{base:[zh,`appearance-none pe-10`],variants:{size:Fh},compounds:Mh,defaults:{size:`lg`,radius:`md`}},nativeIcon:{base:`pointer-events-none absolute right-3 top-1/2 size-icon -translate-y-1/2 fill-current text-icon`}}}}),Vx=`[data-ui-select-option], [data-ui-select-option-create]`,Hx=`template[data-ui-select-option-selected-template]`,Ux=new WeakSet,Wx=(e,t)=>e.composedPath().some(e=>e instanceof Element&&e.matches(t)),Gx=e=>{if(!(e instanceof Element)){e.childNodes.forEach(e=>Gx(e));return}Array.from(e.attributes).forEach(t=>{let n=t.name;(n===`id`||n===`role`||n===`tabindex`||n.startsWith(`aria-selected`)||n.startsWith(`aria-disabled`)||n.startsWith(`data-ui-select-option`)||n.startsWith(`data-selected`)||n.startsWith(`data-highlighted`)||n.startsWith(`data-disabled`)||n.startsWith(`x-`)||n.startsWith(`@`)||n.startsWith(`:`)||n.startsWith(`on`))&&e.removeAttribute(n)}),e.childNodes.forEach(e=>Gx(e)),e.setAttribute(`x-ignore`,`true`)},Kx=e=>{let t=document.createDocumentFragment();return Array.from(e).forEach(e=>{if(e instanceof HTMLTemplateElement&&e.matches(Hx))return;let n=e.cloneNode(!0);Gx(n),t.append(n)}),t},qx=()=>({isOpen:!1,search:``,selectedValues:[],selectedLabels:[],activeValue:``,inputSearching:!1,buttonId:``,inputId:``,listboxId:``,props:null,popover:null,popoverMotion:null,listeners:[],observer:null,renderedChipsKey:``,renderedHiddenInputsKey:``,init(){this.props=z({el:this.$el,schema:zx}),this.buttonId=this.$id(`select-button`),this.inputId=this.$id(`select-input`),this.listboxId=this.$id(`select-listbox`),this.isOpen=this.props.open&&!this.props.disabled&&!this.props.readonly;let e=this.options(),t=this.props.multiple?[...K.splitControlValues(this.props.values),...K.splitControlValues(this.props.value)]:K.splitControlValues(this.props.value).slice(0,1),n=e.filter(e=>K.asBool({value:e.el.dataset.selected})).map(e=>e.value);this.selectedValues=t.length>0?t:n,this.props.multiple||(this.selectedValues=this.selectedValues.slice(0,1)),this.selectedLabels=this.selectedValues.map(t=>e.find(e=>e.value===t)?.selectedLabel??t),this.popover=K.createAnchoredPopover({reference:()=>this.control(),floating:()=>this.popoverEl(),position:()=>this.props.side,align:()=>this.props.align,gap:()=>this.props.gap,offset:()=>this.props.offset,matchReferenceWidth:!0}),this.popoverMotion=K.motion.createPresenceLifecycle({element:()=>this.popoverEl(),preset:`popover`}),this.setup(),this.sync(),this.isOpen&&this.mount()},destroy(){this.props.disconnect(),this.popoverMotion?.destroy(),this.listeners.forEach(e=>e()),this.listeners=[],this.observer?.disconnect(),this.unmount()},get root(){return K.mergeBindings({inputs:[G({part:Bx.parts.root,props:this.props,className:this.props.class}),{"data-ui-select":``,":data-state":()=>this.isOpen?`open`:`closed`,":data-disabled":()=>this.props.disabled?`true`:void 0,":data-invalid":()=>this.props.invalid?`true`:void 0}]})},control(){let e=this.$el.querySelector(`[data-ui-select-control]`);if(!e)throw Error(`Select requires a control element.`);return e},trigger(){let e=this.$el.querySelector(`[data-ui-select-trigger], [data-ui-select-button], [data-ui-select-input]`);if(!e)throw Error(`Select requires a trigger element.`);return e},input(){return this.$el.querySelector(`[data-ui-select-input]`)},searchInput(){return this.$el.querySelector(`[data-ui-select-search-input]`)},popoverEl(){let e=this.$el.querySelector(`[data-ui-select-popover]`);if(!e)throw Error(`Select requires a popover element.`);return e},listbox(){let e=this.$el.querySelector(`[data-ui-select-listbox]`);if(!e)throw Error(`Select requires a listbox element.`);return e},chipsEl(){return this.$el.querySelector(`[data-ui-select-chips]`)},hiddenInputsEl(){return this.$el.querySelector(`[data-ui-select-hidden-inputs]`)},options(){let e=K.normalizeOptionText(this.search),t=Array.from(this.$el.querySelectorAll(Vx)).map((t,n)=>{let r=this.resolveOptionLabel(t),i=this.optionValue(t,r),a=this.resolveSelectedLabel(t,r),o=K.asBool({value:t.dataset.disabled}),s=this.selectedValues.includes(i),c=t.hasAttribute(`data-ui-select-option-create`),l=!this.props.filter||e===``||K.normalizeOptionText(`${r} ${t.dataset.suffix??``}`).includes(e),u=e!==``&&K.normalizeOptionText(r)===e,d=Number(t.dataset.minLength??`0`),f=c?e.length>=d&&!u:l;return{el:t,id:t.id||`${this.listboxId}-option-${n}`,value:i,label:r,selectedLabel:a,disabled:o,selected:s,visible:f,create:c}}),n=t.some(t=>!t.create&&K.normalizeOptionText(t.label)===e);return t.map(e=>e.create&&n?{...e,visible:!1}:e)},enabledVisibleOptions(){return this.options().filter(e=>e.visible&&!e.disabled)},hasSelection(){return this.selectedValues.length>0},hasClearValue(){return this.search.length>0||this.hasSelection()},isPillbox(){return this.props.mode===`pillbox`&&this.props.multiple},controlLayoutMode(){return this.isPillbox()?`pillbox`:this.props.mode===`combobox`?`combobox`:`listbox`},selectedSummary(){return!this.hasSelection()||this.isPillbox()?``:this.props.multiple&&this.selectedValues.length>1?`${this.selectedValues.length} ${this.props.suffix}`:this.selectedLabels[0]??this.selectedValues[0]??``},openSelect(e){if(e?.preventDefault(),this.props.disabled||this.props.readonly)return;let t=this.isOpen;this.isOpen=!0,this.props.autoHighlight&&!this.activeValue&&this.setActive(this.enabledVisibleOptions()[0]??null),this.sync(),t||this.popoverMotion?.enter({before:()=>{let e=this.popoverEl();e.hidden=!1,e.showPopover?.(),this.mount()}});let n=this.searchInput();this.props.searchable&&n&&n.focus({preventScroll:!0}),K.dispatch({el:this.$el,name:`ui:open`})},closeSelect(e){e?.preventDefault();let t=this.isOpen;this.isOpen=!1,this.activeValue=``,this.search=``,this.inputSearching=!1,this.sync(),t&&this.popoverMotion?.exit({before:()=>{let e=this.popoverEl();e.dataset.state=`closed`,e.hidden=!1},after:()=>{this.isOpen||(this.popoverEl().hidePopover?.(),this.unmount(),this.syncListbox(),K.dispatch({el:this.$el,name:`ui:close`}))}})},toggle(e){if(e?.preventDefault(),this.isOpen){this.closeSelect();return}this.openSelect()},clear(e){e?.preventDefault(),e?.stopPropagation(),!(this.props.disabled||this.props.readonly)&&(this.search=``,this.inputSearching=!1,this.selectedValues=[],this.selectedLabels=[],this.activeValue=``,this.props.clear===`close`?this.closeSelect(e):this.sync(),K.dispatchNativeControlChange({container:this.hiddenInputsEl(),fallback:this.$el,marker:`data-ui-select-hidden-input`}),K.dispatch({el:this.$el,name:`ui:clear`}),K.dispatch({el:this.$el,name:`ui:change`,detail:{value:``,values:[],labels:[]}}))},select(e,t){let n=typeof e==`string`?this.options().find(t=>t.value===e):e;n&&this.selectOption(n,t)},deselect(e,t){if(t?.preventDefault(),this.props.disabled||this.props.readonly)return;let n=this.options();n.find(t=>t.value===e)?.disabled||(this.selectedValues=this.selectedValues.filter(t=>t!==e),this.selectedLabels=this.selectedValues.map(e=>n.find(t=>t.value===e)?.selectedLabel??e),this.sync(),K.dispatchNativeControlChange({container:this.hiddenInputsEl(),fallback:this.$el,marker:`data-ui-select-hidden-input`}),K.dispatch({el:this.$el,name:`ui:change`,detail:{value:this.selectedValues[0]??``,values:[...this.selectedValues],labels:[...this.selectedLabels]}}))},removeLastValue(e){if(!this.isPillbox()||this.search!==``||this.selectedValues.length===0)return;let t=this.options(),n=[...this.selectedValues].reverse().find(e=>!t.find(t=>t.value===e)?.disabled);n&&(e?.preventDefault(),this.deselect(n,e))},setSearch(e){this.props.disabled||this.props.readonly||(this.search=e,this.isOpen||=!0,this.props.autoHighlight&&this.focusFirst(),this.sync(),K.dispatch({el:this.$el,name:`ui:search`,detail:{search:this.search}}))},refreshOptions(){this.syncOptions(),this.syncTrigger()},selectOption(e,t){if(t?.preventDefault(),this.props.disabled||this.props.readonly||e.disabled)return;let n=this.isOpen;if(e.create){K.dispatch({el:this.$el,name:`ui:create`,detail:{search:this.search,value:e.value||this.search}}),this.closeSelect();return}if(this.props.multiple){this.selectedValues.includes(e.value)?this.selectedValues=this.selectedValues.filter(t=>t!==e.value):this.selectedValues=[...this.selectedValues,e.value];let t=this.options();this.selectedLabels=this.selectedValues.map(e=>t.find(t=>t.value===e)?.selectedLabel??e),this.search=``,this.inputSearching=!1,this.isOpen=!0}else this.selectedValues=[e.value],this.selectedLabels=[e.selectedLabel],this.search=``,this.inputSearching=!1,this.isOpen=!1;this.sync(),n&&!this.isOpen&&this.popoverMotion?.exit({before:()=>{let e=this.popoverEl();e.dataset.state=`closed`,e.hidden=!1},after:()=>{this.isOpen||(this.popoverEl().hidePopover?.(),this.unmount(),this.syncListbox(),K.dispatch({el:this.$el,name:`ui:close`}))}}),K.dispatchNativeControlChange({container:this.hiddenInputsEl(),fallback:this.$el,marker:`data-ui-select-hidden-input`}),K.dispatch({el:this.$el,name:`ui:change`,detail:{value:this.selectedValues[0]??``,values:[...this.selectedValues],label:this.selectedLabels[0]??``,labels:[...this.selectedLabels],option:e.el}})},setActive(e){(e?.value??``)!==this.activeValue&&(this.activeValue=e?.value??``,this.syncOptions(),this.syncInputs(),K.dispatch({el:this.$el,name:`ui:highlight`,detail:{value:this.activeValue,option:e?.el??null}}))},moveActive(e){let t=this.enabledVisibleOptions();if(t.length===0)return;let n=t.findIndex(e=>e.value===this.activeValue),r=n+e;n<0&&(r=e>0?0:t.length-1),r>=t.length&&(r=this.props.loop?0:t.length-1),r<0&&(r=this.props.loop?t.length-1:0),this.setActive(t[r]??null)},focusFirst(){this.setActive(this.enabledVisibleOptions()[0]??null)},focusLast(){let e=this.enabledVisibleOptions();this.setActive(e[e.length-1]??null)},handleSearchInput(e){let t=e.target;t instanceof HTMLInputElement&&this.setSearch(t.value)},handleInput(e){let t=e.target;t instanceof HTMLInputElement&&(this.inputSearching=!0,this.setSearch(t.value))},handleKeydown(e){if(e.key===`ArrowDown`){e.preventDefault(),this.isOpen||this.openSelect(),this.moveActive(1);return}if(e.key===`ArrowUp`){e.preventDefault(),this.isOpen||this.openSelect(),this.moveActive(-1);return}if(this.isOpen&&e.key===`Home`){e.preventDefault(),this.focusFirst();return}if(this.isOpen&&e.key===`End`){e.preventDefault(),this.focusLast();return}if((e.key===`Enter`||e.key===` `)&&this.isOpen&&this.activeValue){let t=this.options().find(e=>e.value===this.activeValue);t&&this.selectOption(t,e);return}if((e.key===`Backspace`||e.key===`Delete`)&&this.isPillbox()&&this.search===``){let t=this.input();(!t||t.selectionStart===0&&t.selectionEnd===0)&&this.removeLastValue(e);return}e.key===`Escape`&&this.isOpen&&(this.closeSelect(e),this.trigger().focus({preventScroll:!0}))},handleFocusout(e){let t=e.relatedTarget;if(!(t instanceof Node)){this.closeSelect();return}this.$el.contains(t)||this.popoverEl().contains(t)||this.closeSelect()},sync(){this.syncRoot(),this.syncControl(),this.syncTrigger(),this.syncInputs(),this.syncListbox(),this.syncOptions(),this.syncChips(),this.syncHiddenInputs()},syncRoot(){this.$el.dataset.state=this.isOpen?`open`:`closed`,K.syncControlPresence({el:this.$el,state:{disabled:this.props.disabled,required:this.props.required,invalid:this.props.invalid},value:`true`})},syncControl(){let e=this.control();e.setAttribute(`class`,G({part:Bx.parts.control,props:{...this.props,mode:this.controlLayoutMode(),empty:this.isPillbox()&&!this.hasSelection()}})),e.dataset.state=this.isOpen?`open`:`closed`,e.dataset.mode=this.controlLayoutMode(),K.setPresence({el:e,attr:`data-ui-select-pillbox-control`,present:this.isPillbox(),value:``}),K.setPresence({el:e,attr:`data-empty`,present:this.isPillbox()&&!this.hasSelection(),value:`true`}),K.syncControlPresence({el:e,state:{disabled:this.props.disabled,invalid:this.props.invalid},value:`true`})},syncTrigger(){let e=this.trigger();e.id||=this.buttonId,e.dataset.state=this.isOpen?`open`:`closed`,e.setAttribute(`aria-haspopup`,`listbox`),e.setAttribute(`aria-expanded`,this.isOpen?`true`:`false`),e.setAttribute(`aria-controls`,this.listboxId),this.props.invalid?e.setAttribute(`aria-invalid`,`true`):e.removeAttribute(`aria-invalid`),this.props.disabled?e.setAttribute(`disabled`,``):e.removeAttribute(`disabled`);let t=this.selectedSummary(),n=this.$el.querySelector(`[data-ui-select-button-value]`),r=this.$el.querySelector(`[data-ui-select-button-placeholder]`);if(n){n.replaceChildren();let e=(!this.props.multiple||this.selectedValues.length===1)&&t?this.selectedOption():null;e?n.append(this.selectedContent(e)):n.textContent=t,n.hidden=t===``}r&&(r.hidden=t!==``),this.$el.querySelectorAll(`[data-ui-select-clear], [data-ui-select-button-clear], [data-ui-select-search-clear]`).forEach(e=>{e.hidden=this.props.disabled||!this.props.clearable||!this.hasClearValue(),e instanceof HTMLButtonElement&&(e.disabled=this.props.disabled)})},syncInputs(){let e=this.input();if(e){e.id||=this.inputId;let t=this.selectedSummary();e.className=G({part:Bx.parts.input,className:this.props.inputClass}),this.isPillbox()?(e.value=this.search,e.placeholder=this.hasSelection()?``:this.props.placeholder):(e.value=this.isOpen&&this.inputSearching?this.search:t,e.placeholder=this.props.placeholder),e.setAttribute(`role`,`combobox`),e.setAttribute(`autocomplete`,`off`),e.setAttribute(`aria-autocomplete`,`list`),e.setAttribute(`aria-expanded`,this.isOpen?`true`:`false`),e.setAttribute(`aria-controls`,this.listboxId),K.syncNativeControl({input:e,state:{disabled:this.props.disabled,readonly:this.props.readonly,required:this.props.required,nativeRequired:!1,invalid:this.props.invalid,ariaRequired:this.props.required}})}let t=this.searchInput();t&&(t.value=this.search,t.disabled=this.props.disabled);let n=this.options().find(e=>e.value===this.activeValue)?.id??``;[e,t].forEach(e=>{e&&(n?e.setAttribute(`aria-activedescendant`,n):e.removeAttribute(`aria-activedescendant`))})},syncListbox(){let e=this.popoverEl(),t=this.listbox();e.id=`${this.listboxId}-popover`,e.setAttribute(`class`,G({part:Bx.parts.popover,props:this.props,className:this.props.listboxClass})),e.setAttribute(`popover`,`manual`),e.dataset.state=this.isOpen?`open`:`closed`,e.hidden=!this.isOpen,t.id=this.listboxId,t.setAttribute(`role`,`listbox`),t.setAttribute(`tabindex`,`-1`),t.setAttribute(`aria-labelledby`,this.trigger().id),this.props.multiple?t.setAttribute(`aria-multiselectable`,`true`):t.removeAttribute(`aria-multiselectable`)},syncOptions(){let e=this.options(),t=this.$el.querySelector(`[data-ui-select-option-empty]`),n=e.some(e=>e.visible&&!e.create);e.forEach(e=>{e.el.id=e.id,e.el.hidden=!e.visible,e.el.setAttribute(`role`,`option`),e.el.setAttribute(`aria-selected`,e.selected?`true`:`false`),e.el.dataset.value=e.value,e.el.dataset.label=e.label,K.setPresence({el:e.el,attr:`data-selected`,present:e.selected,value:`true`}),K.setPresence({el:e.el,attr:`data-highlighted`,present:e.value===this.activeValue,value:`true`}),K.setPresence({el:e.el,attr:`data-disabled`,present:e.disabled,value:`true`}),e.el.querySelectorAll(`[data-ui-select-option-indicator]`).forEach(t=>{K.setPresence({el:t,attr:`data-selected`,present:e.selected,value:`true`})}),e.disabled?e.el.setAttribute(`aria-disabled`,`true`):e.el.removeAttribute(`aria-disabled`)}),t&&(t.hidden=n)},syncChips(){let e=this.chipsEl();if(!e)return;let t=!this.isPillbox()||this.selectedValues.length===0;e.hidden=t;let n=this.options(),r=this.selectedValues.map((e,t)=>{let r=n.find(t=>t.value===e);return{value:e,label:this.selectedLabels[t]??r?.selectedLabel??e,disabled:r?.disabled??!1}}),i=JSON.stringify({hidden:t,chips:r,disabled:this.props.disabled,readonly:this.props.readonly,chipVariant:this.props.chipVariant,chipColor:this.props.chipColor,chipClass:this.props.chipClass});if(i===this.renderedChipsKey||(this.renderedChipsKey=i,e.replaceChildren(),e.hidden))return;let a=G({part:wx.parts.root,props:{variant:this.props.chipVariant,color:this.props.chipColor,size:`sm`,radius:`sm`},className:G({part:Bx.parts.chip,props:{},className:this.props.chipClass})}),o=G({part:Bx.parts.chipLabel}),s=G({part:wx.parts.close,props:{size:`sm`},className:G({part:Bx.parts.chipRemove})});r.forEach(t=>{let n=document.createElement(`span`);n.className=a,n.setAttribute(`data-ui-badge`,``),n.setAttribute(`data-ui-select-chip`,``),n.dataset.variant=this.props.chipVariant,n.dataset.color=this.props.chipColor,n.dataset.size=`sm`,n.dataset.radius=`sm`,n.dataset.value=t.value,K.setPresence({el:n,attr:`data-disabled`,present:t.disabled,value:`true`});let r=document.createElement(`span`);r.className=o,r.setAttribute(`data-ui-badge-label`,``),r.setAttribute(`data-ui-select-chip-label`,``),r.textContent=t.label,n.append(r);let i=document.createElement(`button`);i.type=`button`,i.className=s,i.setAttribute(`data-ui-badge-close`,``),i.setAttribute(`data-ui-select-chip-remove`,``),i.setAttribute(`aria-label`,`Remove ${t.label}`),i.disabled=this.props.disabled||this.props.readonly||t.disabled,K.setPresence({el:i,attr:`data-disabled`,present:i.disabled,value:`true`}),i.disabled&&i.setAttribute(`aria-disabled`,`true`);let c=this.$el.querySelector(`[data-ui-select-chip-remove-icon]`);c?(i.append(c.content.cloneNode(!0)),i.querySelectorAll(`[aria-hidden="true"]`).forEach(e=>{e.setAttribute(`data-ui-badge-close-icon`,``)})):i.textContent=`x`,i.addEventListener(`click`,e=>this.deselect(t.value,e)),n.append(i),e.append(n)})},syncHiddenInputs(){let e=this.hiddenInputsEl();e&&(this.renderedHiddenInputsKey=K.syncRepeatedHiddenInputs({container:e,state:{name:this.props.name,required:this.props.required,values:this.selectedValues,form:this.$el.dataset.form??``,marker:`data-ui-select-hidden-input`},currentKey:this.renderedHiddenInputsKey}))},mount(){this.popover?.mount()},unmount(){this.popover?.unmount()},setup(){let e=this.control(),t=this.trigger(),n=this.popoverEl(),r=this.listbox(),i=this.input(),a=this.searchInput();K.addListener({target:t,event:`click`,handler:e=>{Ux.add(e);let n=e.target;if(n instanceof Element&&n.closest(`[data-ui-select-clear], [data-ui-select-button-clear]`)){this.clear(e);return}if(!(n instanceof Element&&n.closest(`[data-ui-select-chip-remove]`))){if(this.trigger().focus({preventScroll:!0}),t instanceof HTMLInputElement){this.isOpen||this.openSelect(e);return}this.toggle(e)}},cleanup:this.listeners}),K.addListener({target:t,event:`keydown`,handler:e=>{e instanceof KeyboardEvent&&this.handleKeydown(e)},cleanup:this.listeners}),K.addListener({target:e,event:`pointerdown`,handler:e=>{let t=e.target;t instanceof Element&&t.closest(`[data-ui-select-icon="trailing"]`)&&e.preventDefault()},cleanup:this.listeners}),K.addListener({target:e,event:`click`,handler:e=>{let n=e.target;if(!(n instanceof Element))return;if(n.closest(`[data-ui-select-clear], [data-ui-select-button-clear]`)){this.clear(e);return}if(n.closest(`[data-ui-select-chip-remove]`))return;if(Wx(e,`[data-ui-select-trigger]`)){if(Ux.has(e))return;if(this.trigger().focus({preventScroll:!0}),t instanceof HTMLInputElement){this.isOpen||this.openSelect(e);return}this.toggle(e);return}if(n.closest(`[data-ui-select-icon="trailing"]`)){let t=this.isOpen;this.trigger().focus({preventScroll:!0}),t?this.closeSelect(e):this.openSelect(e);return}if(this.isPillbox()){this.trigger().focus({preventScroll:!0}),this.isOpen||this.openSelect(e);return}let r=this.isOpen;this.trigger().focus({preventScroll:!0}),r?this.closeSelect(e):this.openSelect(e)},cleanup:this.listeners}),i&&(K.addListener({target:i,event:`focus`,handler:()=>this.openSelect(),cleanup:this.listeners}),K.addListener({target:i,event:`input`,handler:e=>this.handleInput(e),cleanup:this.listeners})),a&&(K.addListener({target:a,event:`input`,handler:e=>this.handleSearchInput(e),cleanup:this.listeners}),K.addListener({target:a,event:`keydown`,handler:e=>{e instanceof KeyboardEvent&&this.handleKeydown(e)},cleanup:this.listeners})),K.addListener({target:this.$el,event:`focusout`,handler:e=>{e instanceof FocusEvent&&this.handleFocusout(e)},cleanup:this.listeners}),K.addListener({target:n,event:`pointerdown`,handler:e=>{let t=e.target;t instanceof Element&&t.closest(Vx)&&e.preventDefault()},cleanup:this.listeners}),K.addListener({target:n,event:`click`,handler:e=>{let t=e.target;if(!(t instanceof Element))return;if(t.closest(`[data-ui-select-search-clear]`)){this.setSearch(``);return}let n=t.closest(Vx),r=n?this.options().find(e=>e.el===n):void 0;r&&this.selectOption(r,e)},cleanup:this.listeners}),K.addListener({target:n,event:`pointermove`,handler:e=>{let t=e.target;if(!(t instanceof Element))return;let n=t.closest(Vx),r=n?this.options().find(e=>e.el===n):void 0;r&&!r.disabled&&this.setActive(r)},cleanup:this.listeners}),K.addListener({target:n,event:`pointerleave`,handler:()=>{this.setActive(null)},cleanup:this.listeners}),this.listeners.push(K.addDismissableLayer({isEnabled:()=>this.isOpen,roots:()=>[this.$el,n],onDismiss:()=>this.closeSelect()})),this.observer=new MutationObserver(()=>{this.sync(),this.props.autoHighlight&&this.isOpen&&!this.activeValue&&this.focusFirst()}),this.observer.observe(r,{childList:!0,subtree:!0})},selectedOption(){let e=this.selectedValues[0]??``;return e?this.options().find(t=>t.value===e)??null:null},selectedContent(e){let t=e.el.querySelector(Hx);if(t)return Kx(t.content.childNodes);let n=e.el.querySelector(`[data-ui-select-option-selected-content]`)??e.el.querySelector(`[data-ui-select-option-label]`);if(n)return Kx(n.childNodes);let r=document.createDocumentFragment();return r.append(document.createTextNode(e.selectedLabel)),r},resolveOptionLabel(e){let t=e.dataset.label||e.getAttribute(`aria-label`)||``;if(t)return t;let n=e.dataset.textValue??``;if(n)return n;let r=K.parseItemData(e.dataset.item),i=K.getPathValue(r,this.props.path);return i==null?(e.querySelector(`[data-ui-select-option-label]`)?.textContent??e.textContent??``).trim():String(i)},resolveSelectedLabel(e,t){return e.dataset.selectedLabel||t},optionValue(e,t){return e.dataset.value||t}}),Jx=e=>{e.data(`UiSelect`,()=>qx())},Yx=[`left`,`right`],Xx=[`none`,`mobile`,`desktop`,`both`],Zx=[`toggle`,`open`,`close`,`stash`,`expand`],Qx=[`a`,`button`],$x=[`ghost`,`surface`],eS=[`neutral`,`accent`],tS={id:B.default(`ui-sidebar`),side:U(Yx,`left`),sticky:H.default(!0),collapse:U(Xx,`mobile`),open:H,stashed:H,persist:H.default(!0),width:B.default(`16rem`),minWidth:B.default(`12rem`),maxWidth:B.default(`28rem`),mobile:B.default(`18rem`),breakpoint:B.default(`lg`),edgeReveal:H.default(!0),resizable:H,class:B};U(Qx,`a`),U($x,`ghost`),U(eS,`neutral`),H.default(!0);var nS={target:B,icon:B.default(`side_panel`),label:B.default(`Toggle sidebar`),action:U(Zx,`toggle`),class:B},rS=W({definition:{component:`ui.sidebar`,parts:{root:{base:[`fixed inset-y-0 z-dialog flex min-h-0 w-[var(--ui-sidebar-mobile-width)] flex-col overflow-hidden`,`border-base-a3 bg-chrome text-foreground shadow-2 outline-none`,`data-[mobile-state=closed]:-translate-x-full data-[mobile-state=open]:translate-x-0`,`lg:top-0 lg:z-auto lg:w-[var(--ui-sidebar-width)] lg:translate-x-0 lg:data-[mobile-state=closed]:translate-x-0 lg:data-[mobile-state=open]:translate-x-0 lg:shadow-none`,`lg:data-[desktop-state=stashed]:data-[drawer-state=closed]:data-[sidebar-exiting=false]:hidden`,`lg:data-[desktop-state=stashed]:data-[drawer-state=open]:fixed lg:data-[desktop-state=stashed]:data-[drawer-state=open]:inset-y-2`,`lg:data-[desktop-state=stashed]:data-[drawer-state=open]:z-dialog lg:data-[desktop-state=stashed]:data-[drawer-state=open]:h-auto lg:data-[desktop-state=stashed]:data-[drawer-state=open]:rounded-4 lg:data-[desktop-state=stashed]:data-[drawer-state=open]:border lg:data-[desktop-state=stashed]:data-[drawer-state=open]:shadow-2`,`[grid-area:sidebar]`],variants:{side:{left:`left-0 border-r lg:left-auto lg:data-[desktop-state=stashed]:data-[drawer-state=open]:left-2`,right:`right-0 border-l data-[mobile-state=closed]:translate-x-full data-[mobile-state=open]:translate-x-0 lg:right-auto lg:data-[desktop-state=stashed]:data-[drawer-state=open]:right-2`},sticky:{true:`lg:sticky lg:h-screen`,false:`lg:relative lg:h-auto lg:data-[sticky=false]:relative lg:data-[sticky=False]:relative lg:data-[sticky=false]:h-auto lg:data-[sticky=False]:h-auto`}},defaults:{side:`left`,sticky:!0}},header:{base:`flex min-h-control-xlg shrink-0 items-center gap-2 px-3 py-2`},content:{base:[`min-h-0 flex-1 overflow-hidden`]},contentInner:{base:[`grid min-w-0 content-start gap-1 px-2 py-2`,`[&>[data-ui-separator]]:-mx-2 [&>[data-ui-separator]]:w-auto`]},footer:{base:`grid shrink-0 gap-1 px-2 py-2`},nav:{base:`grid gap-1`},item:{base:[`group/sidebar-item flex h-control-md w-full min-w-0 select-none items-center gap-2 rounded-3 px-2`,`border border-transparent text-left text-sm font-medium text-foreground outline-none`,`cursor-default`,Vh,`focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2 focus-visible:ring-offset-app`,`data-disabled:pointer-events-none data-disabled:opacity-50`],variants:{variant:{ghost:``,surface:`data-current:border-transparent data-current:shadow-none`},color:{neutral:`[--color-interactive-selected:var(--color-base-a3)] [--color-interactive-selected-hover:var(--color-base-a4)]`,accent:`[--color-interactive-selected:var(--color-accent-surface)] [--color-interactive-selected-hover:var(--color-accent-surface-hover)]`},withActions:{true:`pr-9`,false:``}},defaults:{variant:`ghost`,color:`neutral`,withActions:!1}},itemRow:{base:`group/sidebar-item-row relative min-w-0`},itemIcon:{base:`size-icon-xs shrink-0 fill-current text-icon`,variants:{position:{leading:``,trailing:`ml-auto`}},defaults:{position:`leading`}},itemLabel:{base:`min-w-0 flex-1`},itemBadge:{base:`ml-auto shrink-0 rounded-2 bg-base-a3 px-1.5 py-0.5 text-xs text-foreground-muted`},itemActions:{base:`absolute right-1 top-1/2 z-10 flex -translate-y-1/2 items-center gap-1`},group:{base:`relative grid gap-1`},groupSummary:{base:[`block h-control-md cursor-default select-none list-none rounded-3 text-xs font-medium text-foreground-muted outline-none`,`hover:bg-base-a2 hover:text-foreground focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2 focus-visible:ring-offset-app`,`[&::-webkit-details-marker]:hidden`],variants:{hasActions:{true:``,false:``}},defaults:{hasActions:!1}},groupSummaryInner:{base:`flex h-full min-w-0 items-center gap-2 px-2`},groupHeading:{base:`flex min-h-control-md min-w-0 select-none items-center gap-2 px-2 py-1 cursor-default`},groupIcon:{base:`size-icon-xs shrink-0 fill-current text-icon group-open/sidebar-group:rotate-90`},groupLabel:{base:`min-w-0 flex-1`},groupHeadingLabel:{base:`min-w-0 flex-1`},groupActions:{base:`ml-auto flex shrink-0 items-center gap-1`},groupContent:{base:`grid gap-1`},toggle:{base:[`inline-flex h-control-md w-control-md shrink-0 items-center justify-center rounded-3 text-foreground-muted outline-none`,`hover:bg-base-a2 hover:text-foreground focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2 focus-visible:ring-offset-app`]},toggleIcon:{base:`size-icon fill-current text-current`},edge:{base:[`fixed inset-y-0 z-30 hidden w-2 bg-transparent outline-none lg:block`,`focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2 focus-visible:ring-offset-app`,`data-[state=hidden]:hidden`],variants:{side:{left:`left-0`,right:`right-0`}},defaults:{side:`left`}},resizeHandle:{base:[`absolute inset-y-0 z-10 hidden w-3 cursor-col-resize touch-none border-transparent outline-none lg:block`,`hover:border-border-interactive`,`focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2 focus-visible:ring-offset-app`,`data-disabled:hidden`],variants:{side:{left:`right-0 border-r`,right:`left-0 border-l`}},defaults:{side:`left`}}}}}),iS={target:nS.target,action:nS.action,class:nS.class},aS={target:nS.target,action:nS.action,class:nS.class},oS=new Set,sS={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},cS=(e,t)=>!t?.id||t.id===e.id,lS=e=>{let t=sS[e];return t?`(min-width: ${t}px)`:/^\d+$/.test(e)?`(min-width: ${e}px)`:/^\d+(\.\d+)?(px|rem|em)$/.test(e)?`(min-width: ${e})`:`(min-width: ${sS.lg}px)`},uS=e=>e instanceof CustomEvent&&typeof e.detail==`object`&&e.detail!==null?e.detail:{},dS=e=>e.target instanceof Element&&e.target.hasAttribute(`data-ui-sidebar`),fS=(e,t)=>{if(dS(e))return;let n=uS(e);oS.forEach(e=>{cS(e,n)&&e.perform(n.action??t,n.trigger??null)})},pS=(()=>{let e=!1;return()=>{e||typeof document>`u`||(document.addEventListener(`ui:sidebar-open`,e=>fS(e,`open`)),document.addEventListener(`ui:sidebar-close`,e=>fS(e,`close`)),document.addEventListener(`ui:sidebar-toggle`,e=>fS(e,`toggle`)),e=!0)}})(),mS=()=>({props:null,mobileOpen:!1,desktopStashed:!1,desktopDrawerOpen:!1,drawerExiting:!1,sidebarExiting:!1,sidebarExitFreezeCleanup:null,drawerMotionRun:0,drawerMotionPhase:null,desktopMode:!1,renderedExpanded:!1,renderedDrawerOpen:!1,lastPointer:null,activeTrigger:null,currentWidth:`16rem`,cleanup:[],drawerMotion:null,backdropMotion:null,hasScrollLock:!1,mediaQuery:null,get id(){return this.$el.id||this.props.id||`ui-sidebar`},init(){pS(),this.props=z({el:this.$el,schema:tS});let e=this.storedStashed();this.currentWidth=this.props.width,this.mobileOpen=this.props.open,this.desktopStashed=e??this.props.stashed,this.mediaQuery=window.matchMedia(lS(this.props.breakpoint)),this.desktopMode=this.isDesktop(),this.drawerMotion=K.motion.createPresenceLifecycle({element:()=>this.$el,preset:`sidebar`}),this.backdropMotion=K.motion.createPresenceLifecycle({element:()=>this.backdropEl(),preset:`fade`}),oS.add(this),K.addListener({target:this.mediaQuery,event:`change`,handler:()=>this.handleBreakpointChange(),cleanup:this.cleanup}),K.addListener({target:document,event:`keydown`,handler:e=>{e instanceof KeyboardEvent&&e.key===`Escape`&&this.hasOpenDrawer()&&this.close()},cleanup:this.cleanup}),K.addListener({target:document,event:`pointermove`,handler:e=>this.handlePointerMove(e),cleanup:this.cleanup}),K.addListener({target:document,event:`mousemove`,handler:e=>this.handlePointerMove(e),cleanup:this.cleanup});let t=this.backdropEl();t&&(K.addListener({target:t,event:`pointerenter`,handler:e=>this.closeTemporaryDrawer(null,e),cleanup:this.cleanup}),K.addListener({target:t,event:`mouseenter`,handler:e=>this.closeTemporaryDrawer(null,e),cleanup:this.cleanup}),K.addListener({target:t,event:`pointermove`,handler:e=>this.closeTemporaryDrawer(null,e),cleanup:this.cleanup}),K.addListener({target:t,event:`mousemove`,handler:e=>this.closeTemporaryDrawer(null,e),cleanup:this.cleanup})),K.addListener({target:this.$el,event:`ui:resize`,handler:e=>this.handleResize(e),cleanup:this.cleanup}),K.addListener({target:this.$el,event:`ui:resize-end`,handler:e=>this.handleResize(e),cleanup:this.cleanup}),this.cleanup.push(K.addDismissableLayer({isEnabled:()=>this.hasOpenDrawer(),roots:()=>[this.$el,this.activeTrigger],onDismiss:()=>this.close()})),this.setupGroups(),this.syncAll()},destroy(){this.props.disconnect(),this.drawerMotion?.destroy(),this.backdropMotion?.destroy(),this.clearSidebarExitFreeze(),oS.delete(this),this.cleanup.forEach(e=>e()),this.cleanup=[],this.hasScrollLock&&=(mh(),!1)},get root(){return K.mergeBindings({inputs:[K.resolveStyle({part:rS.parts.root,props:this.props,className:this.props.class}),{"data-ui-sidebar":``,"@pointerleave":e=>this.closeTemporaryDrawer(null,e),"@mouseleave":e=>this.closeTemporaryDrawer(null,e)}]})},isDesktop(){return this.mediaQuery?.matches??!1},isMobileCollapsible(){return this.props.collapse===`mobile`||this.props.collapse===`both`},isDesktopCollapsible(){return this.props.collapse===`desktop`||this.props.collapse===`both`},hasOpenDrawer(){return this.isDesktop()?this.desktopStashed&&this.desktopDrawerOpen:this.mobileOpen},isExpanded(){return this.isDesktop()?!this.desktopStashed||this.desktopDrawerOpen:this.mobileOpen},perform(e,t){if(e===`expand`){this.activeTrigger=t??this.activeTrigger;let e=this.hasOpenDrawer();if(this.drawerExiting=!1,this.sidebarExiting=!1,this.clearSidebarExitFreeze(),this.drawerMotionRun+=1,this.isDesktop()&&this.isDesktopCollapsible()){let t=this.desktopStashed;this.desktopStashed=!1,this.desktopDrawerOpen=!1,this.syncAll(),t&&!e&&this.drawerMotion?.enter({before:()=>{this.$el.hidden=!1}})}else !this.isDesktop()&&this.isMobileCollapsible()&&(this.mobileOpen=!0),this.syncAll();!e&&this.hasOpenDrawer()&&this.animateDrawerEnter(),K.dispatch({el:this.$el,name:`ui:sidebar-open`,detail:{id:this.id}});return}if(e===`open`){this.open(t);return}if(e===`close`||e===`stash`){this.close(t);return}this.toggle(t)},open(e){this.activeTrigger=e??this.activeTrigger;let t=this.hasOpenDrawer();this.drawerExiting=!1,this.sidebarExiting=!1,this.clearSidebarExitFreeze(),this.drawerMotionRun+=1,this.isDesktop()?this.isDesktopCollapsible()&&(this.desktopStashed?this.desktopDrawerOpen=!0:this.desktopStashed=!1):this.isMobileCollapsible()&&(this.mobileOpen=!0),this.syncAll(),!t&&this.hasOpenDrawer()&&this.animateDrawerEnter(),K.dispatch({el:this.$el,name:`ui:sidebar-open`,detail:{id:this.id}})},close(e){this.activeTrigger=e??this.activeTrigger;let t=this.hasOpenDrawer(),n=this.isDesktop()&&this.isDesktopCollapsible()&&!this.desktopStashed&&!this.desktopDrawerOpen,r=document.activeElement,i=r instanceof HTMLElement&&this.$el.contains(r),a=i?this.focusRestoreTarget(e):null;i&&this.moveFocusBeforeHide(a);let o=n&&!t?this.freezeSidebarForExit():null,s=++this.drawerMotionRun;this.drawerExiting=t,this.sidebarExiting=n&&!t,this.isDesktop()?this.isDesktopCollapsible()&&(this.desktopDrawerOpen=!1,this.desktopStashed=!0):this.mobileOpen=!1,this.syncAll(),t?this.animateDrawerExit(s):this.sidebarExiting&&this.animateSidebarExit(s,o),K.dispatch({el:this.$el,name:`ui:sidebar-close`,detail:{id:this.id}}),i&&a&&document.contains(a)&&a.focus({preventScroll:!0})},closeTemporaryDrawer(e,t){t instanceof MouseEvent&&(this.lastPointer={clientX:t.clientX,clientY:t.clientY},this.pointerWithinRevealArea(t))||this.drawerMotionPhase===`enter`&&!t||this.isDesktop()&&this.desktopStashed&&this.desktopDrawerOpen&&this.close(e)},handlePointerMove(e){if(!(!(e instanceof MouseEvent)||!this.isDesktop())){if(this.lastPointer={clientX:e.clientX,clientY:e.clientY},!this.hasOpenDrawer()){this.props.edgeReveal&&this.isDesktopCollapsible()&&this.desktopStashed&&!this.desktopDrawerOpen&&this.pointerWithinEdge(e)&&this.open();return}if(!this.pointerWithinRevealArea(e)){if(this.drawerMotionPhase===`enter`){this.closeTemporaryDrawer(null,e);return}this.closeTemporaryDrawer()}}},pointerWithinEdge(e){return this.edgeEls().some(t=>{if(t.hidden)return!1;let n=t.getBoundingClientRect();return e.clientX>=n.left&&e.clientX<=n.right&&e.clientY>=n.top&&e.clientY<=n.bottom})},pointerWithinRevealArea(e){return this.pointerWithinDrawer(e)},pointerWithinDrawer(e){let t=this.$el.getBoundingClientRect(),n=e.clientY>=t.top&&e.clientY<=t.bottom;return n&&e.clientX>=t.left&&e.clientX<=t.right?!0:this.props.side===`right`?n&&e.clientX>=t.right&&e.clientX<=window.innerWidth:n&&e.clientX>=0&&e.clientX<=t.left},toggle(e){if(this.isDesktop()&&this.isDesktopCollapsible()){if(this.desktopDrawerOpen||!this.desktopStashed){this.close(e);return}this.perform(`expand`,e);return}this.isExpanded()?this.close(e):this.open(e)},handleBreakpointChange(){let e=this.renderedExpanded,t=this.renderedDrawerOpen,n=e?this.freezeSidebarForExit():null,r=++this.drawerMotionRun;this.desktopMode=this.isDesktop(),this.drawerExiting=!1,this.sidebarExiting=!1,this.drawerMotionPhase=null;let i=this.isExpanded();if(e&&!i){this.drawerExiting=t,this.sidebarExiting=!0,this.syncAll(),this.animateSidebarExit(r,n,t);return}this.clearSidebarExitFreeze(n),this.syncAll(),!e&&i&&this.animateSidebarEnter(r)},syncAll(){this.syncRoot(),this.syncApp(),this.syncBackdrop(),this.syncEdge(),this.syncToggles(),this.persistStashed()},syncRoot(){let e=this.isExpanded(),t=this.isDesktop(),n=this.mobileOpen?`open`:`closed`,r=this.desktopStashed?`stashed`:`expanded`,i=this.hasOpenDrawer()?`open`:`closed`,a=e?`open`:`closed`,o=this.hasOpenDrawer()||this.drawerExiting,s=this.sidebarExiting;this.$el.dataset.state=a,this.$el.dataset.mobileState=n,this.$el.dataset.desktopState=r,this.$el.dataset.drawerState=i,this.$el.dataset.sidebarExiting=this.sidebarExiting?`true`:`false`,this.$el.dataset.side=this.props.side,this.$el.dataset.collapse=this.props.collapse,this.$el.hidden=t&&this.desktopStashed&&!this.desktopDrawerOpen&&!this.drawerExiting&&!s,K.setPresence({el:this.$el,attr:`data-resize-disabled`,present:this.props.resizable&&(!t||this.desktopStashed||this.desktopDrawerOpen),value:`true`}),e?(this.$el.removeAttribute(`inert`),this.$el.removeAttribute(`aria-hidden`)):(this.$el.setAttribute(`inert`,``),this.$el.setAttribute(`aria-hidden`,`true`)),o&&!this.hasScrollLock?(ph(),this.hasScrollLock=!0):!o&&this.hasScrollLock&&(mh(),this.hasScrollLock=!1),this.renderedExpanded=e,this.renderedDrawerOpen=this.hasOpenDrawer()},syncBackdrop(){let e=this.backdropEl();if(!e)return;let t=this.hasOpenDrawer();e.hidden=!(t||this.drawerExiting),e.dataset.state=t?`open`:`closed`,e.dataset.sidebarState=this.isDesktop()&&this.desktopStashed?`stashed`:`expanded`},syncApp(){let e=this.appEl();e&&(e.style.setProperty(`--ui-app-sidebar-width`,this.currentWidth),e.dataset.sidebarState=this.isDesktop()&&this.desktopStashed?`stashed`:`expanded`,e.dataset.sidebarSide=this.props.side)},handleResize(e){let t=(e instanceof CustomEvent?e.detail:void 0)?.width;Number.isFinite(t)&&(this.currentWidth=`${Math.round(t)}px`,this.$el.style.setProperty(`--ui-sidebar-width`,this.currentWidth),this.syncApp())},syncEdge(){let e=this.props.edgeReveal&&this.isDesktop()&&this.isDesktopCollapsible()&&this.desktopStashed&&!this.desktopDrawerOpen;this.edgeEls().forEach(t=>{t.hidden=!e,t.dataset.state=e?`visible`:`hidden`,t.dataset.side=this.props.side,t.setAttribute(`aria-controls`,this.id),t.setAttribute(`aria-expanded`,this.isExpanded()?`true`:`false`)})},syncToggles(){let e=this.isExpanded();Array.from(document.querySelectorAll(`[data-ui-sidebar-toggle]`)).filter(e=>!e.dataset.target||e.dataset.target===this.id).forEach(t=>{t.setAttribute(`aria-controls`,this.id),t.setAttribute(`aria-expanded`,e?`true`:`false`),t.dataset.state=e?`open`:`closed`}),this.syncStateIcons()},syncStateIcons(){let e=this.isExpanded();Array.from(document.querySelectorAll(`[data-ui-sidebar-state-icon]`)).filter(e=>!e.dataset.target||e.dataset.target===this.id).forEach(t=>{t.dataset.state=e?`open`:`closed`})},animateDrawerEnter(){let e=this.drawerMotionRun;this.drawerMotionPhase=`enter`,(this.drawerMotion?.enter({before:()=>{this.$el.hidden=!1},after:()=>{e!==this.drawerMotionRun||!this.hasOpenDrawer()||(this.drawerMotionPhase=null,this.isDesktop()&&this.desktopStashed&&this.lastPointer&&!this.pointerWithinDrawer(this.lastPointer)&&this.closeTemporaryDrawer())}})?.finished??Promise.resolve()).finally(()=>{e!==this.drawerMotionRun||this.drawerMotionPhase!==`enter`||(this.drawerMotionPhase=null,this.hasOpenDrawer()&&this.isDesktop()&&this.desktopStashed&&this.lastPointer&&!this.pointerWithinDrawer(this.lastPointer)&&this.closeTemporaryDrawer())}),this.backdropMotion?.enter({before:()=>{let e=this.backdropEl();e&&(e.hidden=!1)}})},animateDrawerExit(e){this.animateSidebarExit(e,null,!0)},animateSidebarEnter(e){this.drawerMotionPhase=`enter`,(this.drawerMotion?.enter({before:()=>{this.$el.hidden=!1},after:()=>{e!==this.drawerMotionRun||this.drawerMotionPhase!==`enter`||(this.drawerMotionPhase=null)}})?.finished??Promise.resolve()).finally(()=>{e!==this.drawerMotionRun||this.drawerMotionPhase!==`enter`||(this.drawerMotionPhase=null)})},animateSidebarExit(e,t=null,n=!1){this.drawerMotionPhase=`exit`;let r=this.drawerMotion?.exit({before:()=>{this.$el.hidden=!1}}),i=n?this.backdropMotion?.exit({before:()=>{let e=this.backdropEl();e&&(e.hidden=!1)}}):null;Promise.allSettled([r?.finished??Promise.resolve(),i?.finished??Promise.resolve()]).then(()=>this.finishSidebarExit(e,t))},finishSidebarExit(e,t=null){if(e!==this.drawerMotionRun||this.hasOpenDrawer()){this.clearSidebarExitFreeze(t);return}this.drawerExiting=!1,this.sidebarExiting=!1,this.drawerMotionPhase=null,this.clearSidebarExitFreeze(t),this.syncRoot(),this.syncBackdrop()},freezeSidebarForExit(){this.clearSidebarExitFreeze();let e=this.$el.getBoundingClientRect();if(e.width<=0||e.height<=0)return null;let t={position:this.$el.style.position,top:this.$el.style.top,right:this.$el.style.right,bottom:this.$el.style.bottom,left:this.$el.style.left,width:this.$el.style.width,height:this.$el.style.height,zIndex:this.$el.style.zIndex,transform:this.$el.style.transform,pointerEvents:this.$el.style.pointerEvents};this.$el.dataset.sidebarFrozen=`true`,this.$el.style.position=`fixed`,this.$el.style.top=`${e.top}px`,this.$el.style.right=`auto`,this.$el.style.bottom=`auto`,this.$el.style.left=`${e.left}px`,this.$el.style.width=`${e.width}px`,this.$el.style.height=`${e.height}px`,this.$el.style.zIndex=`var(--z-dialog, 60)`,this.$el.style.transform=`translateX(0)`,this.$el.style.pointerEvents=`none`;let n=()=>{this.$el.style.position=t.position,this.$el.style.top=t.top,this.$el.style.right=t.right,this.$el.style.bottom=t.bottom,this.$el.style.left=t.left,this.$el.style.width=t.width,this.$el.style.height=t.height,this.$el.style.zIndex=t.zIndex,this.$el.style.transform=t.transform,this.$el.style.pointerEvents=t.pointerEvents,delete this.$el.dataset.sidebarFrozen};return this.sidebarExitFreezeCleanup=n,n},clearSidebarExitFreeze(e=null){let t=e??this.sidebarExitFreezeCleanup;t&&(t(),(!e||e===this.sidebarExitFreezeCleanup)&&(this.sidebarExitFreezeCleanup=null))},setupGroups(){Array.from(this.$el.querySelectorAll(`details[data-ui-sidebar-group]`)).forEach(e=>{Array.from(e.querySelectorAll(`[data-ui-sidebar-group-actions]`)).forEach(e=>{K.addListener({target:e,event:`click`,handler:e=>e.stopPropagation(),cleanup:this.cleanup}),K.addListener({target:e,event:`keydown`,handler:e=>e.stopPropagation(),cleanup:this.cleanup})}),K.addListener({target:e,event:`toggle`,handler:()=>{let t=e.open;e.dataset.state=t?`open`:`closed`,K.dispatch({el:e,name:`ui:sidebar-group-change`,detail:{open:t}})},cleanup:this.cleanup})})},backdropEl(){return this.appEl()?.querySelector(`[data-ui-app-backdrop]`)??null},appEl(){return this.$el.closest(`[data-ui-app]`)},edgeEls(){return Array.from(document.querySelectorAll(`[data-ui-sidebar-edge]`)).filter(e=>!e.dataset.target||e.dataset.target===this.id)},focusRestoreTarget(e){return e&&document.contains(e)&&!this.$el.contains(e)?e:Array.from(document.querySelectorAll(`[data-ui-sidebar-toggle]`)).find(t=>t!==e&&!this.$el.contains(t)&&(!t.dataset.target||t.dataset.target===this.id)&&!t.hasAttribute(`disabled`)&&!t.hidden)??null},moveFocusBeforeHide(e){let t=document.activeElement;if(!(!(t instanceof HTMLElement)||!this.$el.contains(t))){if(e&&document.contains(e)){e.focus({preventScroll:!0});return}t.blur()}},storageKey(){return`trellis-ui-sidebar:${this.id}:stashed`},storedStashed(){if(!this.props.persist)return null;try{let e=window.localStorage.getItem(this.storageKey());return e===null?null:e===`true`}catch{return null}},persistStashed(){if(!(!this.props.persist||!this.isDesktopCollapsible()))try{window.localStorage.setItem(this.storageKey(),this.desktopStashed?`true`:`false`)}catch{}}}),hS=()=>({props:null,init(){this.props=z({el:this.$el,schema:iS})},destroy(){this.props.disconnect()},get root(){return K.mergeBindings({inputs:[K.resolveStyle({part:rS.parts.toggle,props:{},className:this.props.class}),{"data-ui-sidebar-toggle":``,":data-target":()=>this.props.target,":data-action":()=>this.props.action,"@click":e=>this.trigger(e)}]})},targetId(){return this.props.target||`ui-sidebar`},trigger(e){e?.preventDefault(),document.dispatchEvent(new CustomEvent(`ui:sidebar-toggle`,{bubbles:!0,detail:{id:this.targetId(),action:this.props.action,trigger:this.$el}}))}}),gS=()=>({props:null,init(){this.props=z({el:this.$el,schema:aS})},destroy(){this.props.disconnect()},get root(){return K.mergeBindings({inputs:[K.resolveStyle({part:rS.parts.edge,props:{side:this.$el.dataset.side||`left`},className:this.props.class}),{"data-ui-sidebar-edge":``,":data-target":()=>this.props.target,":data-action":()=>this.props.action,"@pointerenter":e=>this.trigger(e),"@pointermove":e=>this.trigger(e),"@focus":e=>this.trigger(e),"@click":e=>this.trigger(e)}]})},targetId(){return this.props.target||`ui-sidebar`},trigger(e){e?.preventDefault(),document.dispatchEvent(new CustomEvent(`ui:sidebar-open`,{bubbles:!0,detail:{id:this.targetId(),action:this.props.action,trigger:this.$el}}))}}),_S=e=>{e.data(`UiSidebar`,()=>mS()),e.data(`UiSidebarEdge`,()=>gS()),e.data(`UiSidebarToggle`,()=>hS())},vS=hh,yS=wh,bS=Sh,xS={name:B,value:B.default(`0`),defaultValue:B,min:V.default(0),max:V.default(100),step:V.default(1),bigStep:V.default(10),minStepsBetween:V.default(0),range:H,orientation:U(bS,`horizontal`),size:U(vS,`md`),variant:U(yS,`default`),disabled:H,required:H,invalid:H,label:B,description:B,descriptionTrailing:B,error:B,errors:B,badge:B,valueText:B,lowerLabel:B.default(`Minimum`),upperLabel:B.default(`Maximum`),lowerValueText:B,upperValueText:B,showValue:H,format:U([`number`,`percent`],`number`),fieldClass:B,rootClass:B,trackClass:B,rangeClass:B,thumbClass:B,tickClass:B,class:B};V.default(0);var SS=(e,t,n)=>{if(!Number.isFinite(n)||n<=0)return e;let r=Math.round((e-t)/n)*n+t,i=Math.max(0,`${n}`.split(`.`)[1]?.length??0);return Number(r.toFixed(i))},CS=(e,t,n)=>Math.min(n,Math.max(t,e)),wS=e=>{let t=Math.min(e.min,e.max),n=Math.max(e.min,e.max),r=e.step>0?e.step:1;return{min:t,max:n,step:r,bigStep:e.bigStep>0?e.bigStep:r*10}},TS=(e,t)=>{let n=Number(e);return Number.isFinite(n)?n:t},ES=(e,t)=>{let{min:n,max:r,step:i}=wS(e),a=(e.value||e.defaultValue||``).split(`,`).map(e=>e.trim()),o=t.lowerInput??t.singleInput,s=t.upperInput,c=(e.range,o?.value||a[0]||`${n}`),l=e.range?s?.value||a[1]||`${r}`:c,u=SS(CS(TS(c,n),n,r),n,i),d=SS(CS(TS(l,r),n,r),n,i);if(!e.range)return{lower:u,upper:u};u>d&&([u,d]=[d,u]);let f=Math.max(0,e.minStepsBetween)*i;return d-u<f&&(d=CS(SS(u+f,n,i),n,r),d-u<f&&(u=CS(SS(d-f,n,i),n,r))),{lower:u,upper:d}},DS=(e,t,n)=>n<=t?0:CS((e-t)/(n-t)*100,0,100),OS=(e,t)=>{let n=t=>e.format===`percent`?`${Math.round(t)}%`:String(t);return e.range?`${n(t.lower)} - ${n(t.upper)}`:n(t.lower)},kS=(e,t,n)=>{let{min:r,max:i,step:a}=wS(n),o=e.getBoundingClientRect();return SS(CS(r+CS(n.orientation===`vertical`?1-(t.clientY-o.top)/Math.max(o.height,1):(t.clientX-o.left)/Math.max(o.width,1),0,1)*(i-r),r,i),r,a)},AS=(e,t)=>Math.abs(e-t.lower)<=Math.abs(e-t.upper)?`lower`:`upper`,jS=(e,t,n)=>{e&&(K.setPresence({el:e,attr:`data-focus`,present:t}),K.setPresence({el:e,attr:`data-invalid`,present:n}))},MS=({input:e,props:t,value:n,min:r,max:i,label:a,valueText:o,nativeRequired:s})=>{e&&(e.min=String(r),e.max=String(i),e.step=String(t.step>0?t.step:1),K.syncNativeControl({input:e,state:{name:t.range?``:t.name,value:String(n),disabled:t.disabled,required:t.required,nativeRequired:s,invalid:t.invalid}}),e.setAttribute(`aria-valuemin`,String(r)),e.setAttribute(`aria-valuemax`,String(i)),e.setAttribute(`aria-valuenow`,String(n)),o?e.setAttribute(`aria-valuetext`,o):e.removeAttribute(`aria-valuetext`),a&&e.setAttribute(`aria-label`,a),t.orientation===`vertical`?e.setAttribute(`aria-orientation`,`vertical`):e.removeAttribute(`aria-orientation`))},NS=(e,t,n)=>{let{min:r,max:i}=wS(e),a=DS(n.lower,r,i),o=DS(n.upper,r,i),s=e.range?a:0,c=e.range?o:a;t.root.style.setProperty(`--ui-slider-lower-percent`,`${a}%`),t.root.style.setProperty(`--ui-slider-upper-percent`,`${o}%`),e.orientation===`vertical`?(t.range&&(t.range.style.bottom=`${s}%`,t.range.style.height=`${Math.max(0,c-s)}%`,t.range.style.left=``,t.range.style.width=``),t.singleThumb&&(t.singleThumb.style.bottom=`${a}%`),t.lowerThumb&&(t.lowerThumb.style.bottom=`${a}%`),t.upperThumb&&(t.upperThumb.style.bottom=`${o}%`)):(t.range&&(t.range.style.left=`${s}%`,t.range.style.width=`${Math.max(0,c-s)}%`,t.range.style.bottom=``,t.range.style.height=``),t.singleThumb&&(t.singleThumb.style.left=`${a}%`),t.lowerThumb&&(t.lowerThumb.style.left=`${a}%`),t.upperThumb&&(t.upperThumb.style.left=`${o}%`)),t.ticks.forEach(t=>{let n=DS(TS(t.dataset.value??``,r),r,i);e.orientation===`vertical`?(t.style.bottom=`${n}%`,t.style.left=``):(t.style.left=`${n}%`,t.style.bottom=``)})},PS=(e,t,n,r)=>{let{min:i,max:a,step:o}=wS(e),s=e.range?Math.max(0,e.minStepsBetween)*o:0,c=SS(CS(n.lower,i,a),i,o),l=SS(CS(n.upper,i,a),i,o);e.range?(c>l&&([c,l]=[l,c]),l-c<s&&(r?.dataset.thumb===`lower`?c=CS(SS(l-s,i,o),i,a):l=CS(SS(c+s,i,o),i,a))):l=c,MS({input:t.singleInput,props:e,value:c,min:i,max:a,label:e.label,valueText:e.valueText,nativeRequired:e.required}),MS({input:t.lowerInput,props:e,value:c,min:i,max:e.range?l:a,label:e.lowerLabel,valueText:e.lowerValueText,nativeRequired:!1}),MS({input:t.upperInput,props:e,value:l,min:e.range?c:i,max:a,label:e.upperLabel,valueText:e.upperValueText,nativeRequired:!1});let u={lower:c,upper:l};return NS(e,t,u),t.value&&(t.value.textContent=OS(e,u)),K.syncControlPresence({el:t.root,state:e}),t.track&&K.syncControlPresence({el:t.track,state:{disabled:e.disabled,invalid:e.invalid}}),jS(t.singleThumb,t.singleInput===document.activeElement,e.invalid),jS(t.lowerThumb,t.lowerInput===document.activeElement,e.invalid),jS(t.upperThumb,t.upperInput===document.activeElement,e.invalid),u},FS=()=>({props:null,listeners:[],hiddenInputsKey:``,draggingThumb:null,init(){this.props=z({el:this.$el,schema:xS});let e=this.elements();[e.singleInput,e.lowerInput,e.upperInput].forEach(e=>{e&&(K.addListener({target:e,event:`input`,handler:e=>this.syncFromInput(e),cleanup:this.listeners}),K.addListener({target:e,event:`change`,handler:e=>this.commitFromInput(e),cleanup:this.listeners}),K.addListener({target:e,event:`keydown`,handler:e=>{e instanceof KeyboardEvent&&this.handleKeydown(e)},cleanup:this.listeners}),K.addListener({target:e,event:`focus`,handler:()=>this.sync(),cleanup:this.listeners}),K.addListener({target:e,event:`blur`,handler:()=>this.sync(),cleanup:this.listeners}))}),K.addListener({target:e.root,event:`pointerdown`,handler:e=>{e instanceof PointerEvent&&this.handlePointerDown(e)},cleanup:this.listeners}),K.addListener({target:e.root,event:`pointermove`,handler:e=>{e instanceof PointerEvent&&this.handlePointerMove(e)},cleanup:this.listeners}),K.addListener({target:e.root,event:`pointerup`,handler:e=>{e instanceof PointerEvent&&this.handlePointerUp(e)},cleanup:this.listeners}),K.addListener({target:e.root,event:`pointercancel`,handler:e=>{e instanceof PointerEvent&&this.handlePointerUp(e)},cleanup:this.listeners}),this.sync()},destroy(){this.props.disconnect(),this.listeners.forEach(e=>e()),this.listeners=[]},elements(){let e=this.$el,t=e.querySelector(`[data-ui-slider-root]`);if(!t)throw Error(`Slider requires a root element.`);return{root:t,track:t.querySelector(`[data-ui-slider-track]`),range:t.querySelector(`[data-ui-slider-range]`),lowerInput:t.querySelector(`[data-ui-slider-input][data-thumb="lower"]`),upperInput:t.querySelector(`[data-ui-slider-input][data-thumb="upper"]`),singleInput:t.querySelector(`[data-ui-slider-input][data-thumb="single"]`),lowerThumb:t.querySelector(`[data-ui-slider-thumb][data-thumb="lower"]`),upperThumb:t.querySelector(`[data-ui-slider-thumb][data-thumb="upper"]`),singleThumb:t.querySelector(`[data-ui-slider-thumb][data-thumb="single"]`),value:e.querySelector(`[data-ui-slider-value]`),hiddenInputs:e.querySelector(`[data-ui-slider-hidden-inputs]`),ticks:Array.from(e.querySelectorAll(`[data-ui-slider-tick]`))}},sync(){let e=this.elements(),t=PS(this.props,e,ES(this.props,e));this.props.range&&e.hiddenInputs?this.hiddenInputsKey=K.syncRepeatedHiddenInputs({container:e.hiddenInputs,currentKey:this.hiddenInputsKey,state:{name:this.props.name,values:[String(t.lower),String(t.upper)],required:this.props.required,marker:`data-ui-slider-hidden-input`}}):e.hiddenInputs&&(this.hiddenInputsKey=K.syncRepeatedHiddenInputs({container:e.hiddenInputs,currentKey:this.hiddenInputsKey,state:{name:``,values:[],marker:`data-ui-slider-hidden-input`}}))},syncFromInput(e){let t=e.target instanceof HTMLInputElement?e.target:null,n=this.elements(),r=ES(this.props,n);t?.dataset.thumb===`upper`?r.upper=TS(t.value,r.upper):r.lower=TS(t?.value??``,r.lower),PS(this.props,n,r,t),this.sync()},commitFromInput(e){this.syncFromInput(e)},handleKeydown(e){if(!(e.target instanceof HTMLInputElement)||![`PageUp`,`PageDown`].includes(e.key)&&!(e.shiftKey&&e.key.startsWith(`Arrow`)))return;e.preventDefault();let t=e.target,n=[`PageDown`,`ArrowDown`,`ArrowLeft`].includes(e.key)?-1:1,{bigStep:r}=wS(this.props);t.value=String(TS(t.value,this.props.min)+n*r),t.dispatchEvent(new Event(`input`,{bubbles:!0})),t.dispatchEvent(new Event(`change`,{bubbles:!0}))},handlePointerDown(e){if(this.props.disabled)return;let t=this.elements(),n=kS(t.root,e,this.props),r=ES(this.props,t);this.draggingThumb=this.props.range?AS(n,r):`single`,this.draggingThumb===`upper`?r.upper=n:r.lower=n;let i=this.draggingThumb===`upper`?t.upperInput:this.props.range?t.lowerInput:t.singleInput;i?.focus(),PS(this.props,t,r,i),this.sync(),t.root.setPointerCapture?.(e.pointerId),e.preventDefault()},handlePointerMove(e){if(!this.draggingThumb||this.props.disabled)return;let t=this.elements(),n=ES(this.props,t),r=kS(t.root,e,this.props);this.draggingThumb===`upper`?n.upper=r:n.lower=r;let i=this.draggingThumb===`upper`?t.upperInput:this.props.range?t.lowerInput:t.singleInput;PS(this.props,t,n,i),i?.dispatchEvent(new Event(`input`,{bubbles:!0}))},handlePointerUp(e){if(!this.draggingThumb)return;let t=this.elements();(this.draggingThumb===`upper`?t.upperInput:this.props.range?t.lowerInput:t.singleInput)?.dispatchEvent(new Event(`change`,{bubbles:!0})),t.root.releasePointerCapture?.(e.pointerId),this.draggingThumb=null}}),IS=e=>{e.data(`UiSlider`,()=>FS())},LS=[`trailing`,`leading`],RS=hh,zS=wh,BS={value:B.default(`on`),name:B,label:B,description:B,checked:H,disabled:H,required:H,invalid:H,placement:U(LS,`trailing`),variant:U(zS,`default`),size:U(RS,`md`),inputClass:B,trackClass:B,thumbClass:B,contentClass:B,labelClass:B,descriptionClass:B,class:B};({...BS});var VS=e=>{let t=e.querySelector(`[data-ui-switch-input]`);return t?{root:e,input:t,track:e.querySelector(`[data-ui-switch-track]`),thumb:e.querySelector(`[data-ui-switch-thumb]`),disabled:e.hasAttribute(`data-disabled`)||t.disabled,required:e.hasAttribute(`data-required`)||t.required,invalid:e.hasAttribute(`data-invalid`)||t.getAttribute(`aria-invalid`)===`true`}:null},HS=(e,t={})=>{let n=t.disabled??e.disabled,r=t.required??e.required,i=t.invalid??e.invalid,a=e.input.checked,o=a?`checked`:`unchecked`;K.syncNativeControl({input:e.input,state:{disabled:n,required:r,invalid:i}}),e.input.setAttribute(`role`,`switch`),e.input.setAttribute(`aria-checked`,a?`true`:`false`),K.setAttribute({el:e.root,attr:`data-state`,value:o}),K.setPresence({el:e.root,attr:`data-checked`,present:a}),K.syncControlPresence({el:e.root,state:{disabled:n,required:r,invalid:i}}),K.setAttribute({el:e.input,attr:`data-state`,value:o}),K.setPresence({el:e.input,attr:`data-checked`,present:a}),e.track&&(K.setAttribute({el:e.track,attr:`data-state`,value:o}),K.setPresence({el:e.track,attr:`data-checked`,present:a}),K.syncControlPresence({el:e.track,state:{disabled:n,invalid:i}})),e.thumb&&(K.setAttribute({el:e.thumb,attr:`data-state`,value:o}),K.setPresence({el:e.thumb,attr:`data-checked`,present:a}),K.setPresence({el:e.thumb,attr:`data-disabled`,present:n}))},US=()=>({props:null,listeners:[],init(){this.props=z({el:this.$el,schema:BS});let e=this.input();K.addListener({target:e,event:`change`,handler:()=>this.sync(),cleanup:this.listeners}),K.addListener({target:e,event:`keydown`,handler:e=>{e instanceof KeyboardEvent&&this.toggleFromEnter(e)},cleanup:this.listeners}),this.sync()},destroy(){this.props.disconnect(),this.listeners.forEach(e=>e()),this.listeners=[]},input(){let e=this.$el.querySelector(`[data-ui-switch-input]`);if(!e)throw Error(`Switch requires a native checkbox input.`);return e},item(){let e=VS(this.$el);if(!e)throw Error(`Switch requires a native checkbox input.`);return e},sync(){let e=this.item();this.props.name&&(e.input.name=this.props.name),this.props.value&&(e.input.value=this.props.value),HS(e,{disabled:this.props.disabled||e.disabled,required:this.props.required||e.required,invalid:this.props.invalid||e.invalid})},toggleFromEnter(e){if(e.key!==`Enter`)return;let t=this.input();t.disabled||(e.preventDefault(),t.checked=!t.checked,t.dispatchEvent(new Event(`input`,{bubbles:!0})),t.dispatchEvent(new Event(`change`,{bubbles:!0})))}}),WS=e=>{e.data(`UiSwitch`,()=>US())},GS=[`manual`,`automatic`],KS=Sh;[...KS];var qS={id:B.default(`ui-tabs`),defaultValue:B,value:B,activation:U(GS,`manual`),orientation:U(KS,`horizontal`),loop:H.default(!0),panels:B,class:B},JS=W({definition:{component:`ui.tabs`,parts:{root:{base:`grid min-w-0 gap-3`,variants:{orientation:{horizontal:``,vertical:`md:grid-cols-[max-content_minmax(0,1fr)] md:items-start`}},defaults:{orientation:`horizontal`}},list:{base:`flex min-w-0 items-center`,variants:{variant:{subtle:`gap-1`,line:`gap-4 border-b border-border`,segmented:`gap-0.5 rounded-3 bg-base-a2 p-0.5 shadow-inset`,pills:`gap-1`},orientation:{horizontal:`flex-row`,vertical:`flex-col items-stretch`},size:{sm:``,md:``},scrollable:{true:`overflow-x-auto`,false:``}},compounds:[{when:{variant:`line`,orientation:`vertical`},class:`gap-1 border-b-0 border-l border-border`},{when:{variant:`segmented`,orientation:`vertical`},class:`w-full`}],defaults:{variant:`line`,orientation:`horizontal`,size:`md`,scrollable:!1}},tab:{base:[`group/tabs-tab relative inline-flex min-w-0 shrink-0 select-none items-center gap-2 whitespace-nowrap`,`text-sm font-normal text-foreground outline-none`,`focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2 focus-visible:ring-offset-app`,`data-disabled:pointer-events-none data-disabled:opacity-50`,`ui-selected:text-foreground`],variants:{variant:{subtle:`rounded-2 px-2 hover:bg-base-a2 ui-selected:font-medium`,line:[`-mb-px rounded-none border-x-0 border-b-2 border-t-0 border-transparent px-0`,`ui-selected:border-foreground ui-selected:font-medium`],segmented:[`rounded-2 px-3 hover:bg-base-a2`,`ui-selected:bg-surface-panel ui-selected:font-medium ui-selected:shadow-border`],pills:[`rounded-full bg-surface-panel px-3 shadow-border hover:bg-base-a2`,`ui-selected:bg-base-a3 ui-selected:font-medium ui-selected:shadow-border-hover`]},size:{sm:`h-control-sm text-xs`,md:`h-control-md text-sm`},orientation:{horizontal:`justify-center`,vertical:`w-full justify-start`},selectedIcon:{true:``,false:``}},compounds:[{when:{variant:`line`,orientation:`vertical`},class:`-ml-px mb-0 border-b-0 border-l-2 px-2`},{when:{variant:`subtle`,selectedIcon:!0},class:`ps-2`}],defaults:{variant:`line`,size:`md`,orientation:`horizontal`,selectedIcon:!1}},tabLabel:{base:`min-w-0`},tabIcon:{base:`size-icon shrink-0 fill-current text-icon`},tabSelectedIcon:{base:`size-icon shrink-0 fill-current text-icon`},panels:{base:`min-w-0`},panel:{base:`min-w-0 text-sm text-foreground outline-none focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2 focus-visible:ring-offset-app`},panelInner:{base:`min-w-0`}}}}),YS=`ui-tabs`,XS=e=>e?`active`:`inactive`,ZS=e=>e instanceof HTMLButtonElement||e instanceof HTMLAnchorElement,QS=e=>Array.from(new Set(e)),$S=e=>e.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,`-`).replace(/^-+|-+$/g,``)||`tab`,eC=(e,t)=>`${e}-tab-${$S(t)}`,tC=(e,t)=>`${e}-panel-${$S(t)}`,nC=e=>K.asBool({value:e}),rC=()=>({props:null,activeValue:``,collection:null,cleanup:[],init(){this.props=z({el:this.$el,schema:qS}),this.activeValue=this.initialValue(),this.setupEvents(),this.syncAll()},destroy(){this.props.disconnect(),this.teardown()},get root(){return K.mergeBindings({inputs:[K.resolveStyle({part:JS.parts.root,props:this.props,className:this.props.class}),{"data-ui-tabs":``,":data-orientation":()=>this.props.orientation,":data-activation":()=>this.props.activation}]})},owner(){return this.$el.id||this.props.id||this.$el.dataset.owner||YS},ownsElement(e){return e.closest(`[data-ui-tabs]`)===this.$el},lists(){return Array.from(this.$el.querySelectorAll(`[data-ui-tabs-list]`)).filter(e=>this.ownsElement(e))},primaryList(){return this.lists()[0]??null},listVariant(){let e=this.primaryList()?.dataset.variant;return e===`subtle`||e===`segmented`||e===`pills`?e:`line`},listSize(){return this.primaryList()?.dataset.size===`sm`?`sm`:`md`},listOrientation(e){let t=(e??this.primaryList())?.dataset.orientation;return t===`vertical`||t===`horizontal`?t:this.props.orientation},tabs(){return Array.from(this.$el.querySelectorAll(`[data-ui-tabs-tab]`)).filter(e=>this.ownsElement(e)).map((e,t)=>ZS(e)?(e.dataset.value||(e.dataset.value=`tab-${t+1}`),{tab:e,value:e.dataset.value,isDisabled:nC(e.dataset.disabled)||e.hasAttribute(`disabled`),panel:this.panelForValue(e.dataset.value)}):null).filter(e=>e!==null)},panels(){let e=this.owner(),t=`[data-ui-tabs-panel][data-ui-tabs-owner="${e}"]`,n=t=>{let n=t.closest(`[data-ui-tabs]`);return(!n||n===this.$el)&&(t.dataset.uiTabsOwner===e||t.dataset.owner===e)},r=Array.from(this.$el.querySelectorAll(`[data-ui-tabs-panel]`)).filter(e=>this.ownsElement(e));if(this.props.panels){let e=document.querySelector(this.props.panels);e&&r.push(...Array.from(e.querySelectorAll(`[data-ui-tabs-panel]`)).filter(n))}return r.push(...Array.from(document.querySelectorAll(t)).filter(n)),QS(r)},panelForValue(e){return this.panels().find(t=>t.dataset.value===e)??null},initialValue(){if(this.props.value)return this.props.value;if(this.props.defaultValue)return this.props.defaultValue;let e=this.tabs().find(e=>nC(e.tab.dataset.selected)||e.tab.getAttribute(`aria-selected`)===`true`);return e?e.value:this.panels().find(e=>nC(e.dataset.selected))?.dataset.value||this.fallbackValue()},fallbackValue(){return this.tabs().find(e=>!e.isDisabled)?.value??``},setActiveValue(e,t){if(!e||this.activeValue===e){this.syncAll();return}this.activeValue=e,this.syncAll(),this.dispatchChange(),t&&this.dispatchActivate(t,this.panelForValue(e))},syncAll(){this.activeValue||=this.fallbackValue(),this.syncRoot(),this.lists().forEach(e=>this.syncList(e)),this.tabs().forEach(e=>this.syncTab(e)),this.panels().forEach(e=>this.syncPanel(e))},syncRoot(){!this.$el.id&&this.props.id&&(this.$el.id=this.props.id),this.$el.dataset.orientation=this.props.orientation,this.$el.dataset.activation=this.props.activation,this.$el.dataset.value=this.activeValue},syncList(e){let t=this.listOrientation(e);e.setAttribute(`role`,`tablist`),e.dataset.orientation=t,e.className=K.resolveStyle({part:JS.parts.list,props:{variant:e.dataset.variant||`line`,size:e.dataset.size||`md`,orientation:t,scrollable:nC(e.dataset.scrollable)},className:e.dataset.class??``}),t===`vertical`?e.setAttribute(`aria-orientation`,`vertical`):e.removeAttribute(`aria-orientation`)},syncTab(e){let t=e.value===this.activeValue,n=e.tab.getAttribute(`data-active`)===`true`||document.activeElement===e.tab,r=XS(t),i=e.tab.dataset.uiTabsOwner||e.tab.dataset.owner||this.owner(),a=e.panel?.id||tC(i,e.value),o=this.listOrientation(e.tab.closest(`[data-ui-tabs-list]`)),s=e.tab.closest(`[data-ui-tabs-list]`)?.dataset.variant||this.listVariant(),c=e.tab.closest(`[data-ui-tabs-list]`)?.dataset.size||this.listSize(),l=e.tab.querySelector(`[data-ui-tabs-tab-selected-icon]`);if(e.tab.id||=eC(i,e.value),e.tab.dataset.state=r,e.tab.dataset.orientation=o,e.tab.dataset.variant=s,e.tab.dataset.size=c,e.tab.setAttribute(`role`,`tab`),e.tab.setAttribute(`aria-selected`,t?`true`:`false`),e.tab.setAttribute(`aria-controls`,a),e.tab.tabIndex=t||n?0:-1,e.tab.className=K.resolveStyle({part:JS.parts.tab,props:{variant:s,size:c,orientation:o,selectedIcon:!!l},className:e.tab.dataset.class??``}),K.setPresence({el:e.tab,attr:`data-selected`,present:t}),l&&(l.style.visibility=t?`visible`:`hidden`),e.isDisabled){e.tab.setAttribute(`data-disabled`,``),e.tab.setAttribute(`aria-disabled`,`true`),e.tab.tabIndex=-1,e.tab instanceof HTMLButtonElement&&(e.tab.disabled=!0);return}e.tab.removeAttribute(`data-disabled`),e.tab.removeAttribute(`aria-disabled`),e.tab instanceof HTMLButtonElement&&(e.tab.disabled=!1)},syncPanel(e){let t=e.dataset.value||``,n=t===this.activeValue,r=e.dataset.uiTabsOwner||e.dataset.owner||this.owner(),i=eC(r,t),a=tC(r,t);t&&!e.id&&(e.id=a),!e.getAttribute(`data-ui-key`)&&t&&e.setAttribute(`data-ui-key`,e.id||a),e.dataset.state=XS(n),e.dataset.orientation=this.props.orientation,e.setAttribute(`role`,`tabpanel`),e.setAttribute(`aria-labelledby`,i),e.hasAttribute(`tabindex`)||(e.tabIndex=0),e.hidden=!n,e.className=K.resolveStyle({part:JS.parts.panel,props:this.props,className:e.dataset.class??``}),K.setPresence({el:e,attr:`data-selected`,present:n})},setupEvents(){K.addListener({target:this.$el,event:`click`,handler:e=>this.handleClick(e),cleanup:this.cleanup}),K.addListener({target:this.$el,event:`focusin`,handler:e=>this.handleFocus(e),cleanup:this.cleanup}),K.addListener({target:this.$el,event:`keydown`,handler:e=>{e instanceof KeyboardEvent&&this.handleKeydown(e)},cleanup:this.cleanup})},teardown(){this.cleanup.forEach(e=>e()),this.cleanup=[]},tabFromEvent(e){let t=(e.target instanceof Element?e.target:null)?.closest(`[data-ui-tabs-tab]`)??null;return!ZS(t)||!this.ownsElement(t)?null:t},itemFromTab(e){return this.tabs().find(t=>t.tab===e)??null},collectionNav(){return this.collection||=K.createCollectionNavigation({root:()=>this.$el,itemSelector:`[data-ui-tabs-tab]`,isDisabled:e=>!this.ownsElement(e)||nC(e.dataset.disabled)||e.hasAttribute(`disabled`),loop:()=>this.props.loop}),this.collection},handleClick(e){let t=this.tabFromEvent(e);if(!t)return;let n=this.itemFromTab(t);if(n){if(n.isDisabled){e.preventDefault();return}this.setActiveValue(n.value,t)}},handleFocus(e){let t=this.tabFromEvent(e);if(t)if(this.collectionNav().activateItem({el:t}),this.props.activation===`automatic`){let e=this.itemFromTab(t);e&&!e.isDisabled&&this.setActiveValue(e.value,t)}else this.syncAll()},handleKeydown(e){let t=this.tabFromEvent(e);if(!t)return;if(e.key===`Enter`||e.key===` `){e.preventDefault();let n=this.itemFromTab(t);n&&!n.isDisabled&&this.setActiveValue(n.value,t);return}let n=this.listOrientation(t.closest(`[data-ui-tabs-list]`));if(e.key===`Home`){e.preventDefault(),this.focusFirst();return}if(e.key===`End`){e.preventDefault(),this.focusLast();return}if(n===`vertical`){if(e.key===`ArrowDown`){e.preventDefault(),this.focusNext();return}e.key===`ArrowUp`&&(e.preventDefault(),this.focusPrevious());return}if(e.key===`ArrowRight`){e.preventDefault(),K.isRtl({el:this.$el})?this.focusPrevious():this.focusNext();return}e.key===`ArrowLeft`&&(e.preventDefault(),K.isRtl({el:this.$el})?this.focusNext():this.focusPrevious())},focusNext(){this.collectionNav().focusNext(),this.activateFocused()},focusPrevious(){this.collectionNav().focusPrevious(),this.activateFocused()},focusFirst(){this.collectionNav().focusFirst(),this.activateFocused()},focusLast(){this.collectionNav().focusLast(),this.activateFocused()},activateFocused(){if(this.props.activation!==`automatic`)return;let e=document.activeElement;if(!ZS(e))return;let t=this.itemFromTab(e);t&&!t.isDisabled&&this.setActiveValue(t.value,e)},dispatchChange(){K.dispatch({el:this.$el,name:`ui:change`,detail:{value:this.activeValue}})},dispatchActivate(e,t){K.dispatch({el:e,name:`ui:tabs:activate`,detail:{value:this.activeValue,panelId:t?.id??``}})}}),iC=e=>{e.data(`UiTabs`,()=>rC())},aC=[`info`,`success`,`warning`,`danger`,`debug`],oC=[`auto`,`neutral`,`accent`,`success`,`warning`,`danger`],sC=[`default`,`soft`,`surface`,`solid`,`outline`],cC=[`top-right`,`top-left`,`top-center`,`bottom-right`,`bottom-left`,`bottom-center`],lC={level:U(aC,`info`),color:U(oC,`auto`),variant:U(sC,`default`),title:B,description:B,duration:V.default(5e3).min(0),dismissible:H.default(!0),class:B,contentClass:B,closeClass:B},uC={id:B.default(`ui-toast-root`),position:U(cC,`top-right`),duration:V.default(5e3).min(0),includeMessages:H.default(!0),class:B},dC=W({definition:{component:`ui.toast`,parts:{root:{base:[`group/toast pointer-events-auto relative grid w-full min-w-0 items-center gap-x-3 gap-y-1 overflow-hidden rounded-4 border px-3 py-2.5 text-foreground outline-none`,`data-[state=closed]:pointer-events-none data-[state=closed]:opacity-0`],variants:{variant:{default:`border-transparent bg-toast shadow-popover`,soft:`border-transparent bg-base-a2 shadow-popover`,surface:`border-border bg-toast text-foreground shadow-popover`,solid:`border-transparent bg-base-12 text-base-1 shadow-popover`,outline:`border-border bg-transparent shadow-none`},color:{neutral:``,accent:``,success:``,warning:``,danger:``},hasMarker:{true:`grid-cols-[auto_minmax(0,1fr)_auto]`,false:`grid-cols-[minmax(0,1fr)_auto]`},hasDescription:{true:``,false:``}},compounds:[{when:{variant:`soft`,color:`accent`},class:`bg-accent-surface text-accent-text shadow-popover`},{when:{variant:`soft`,color:`success`},class:`bg-success-surface text-success-text shadow-popover`},{when:{variant:`soft`,color:`warning`},class:`bg-warning-surface text-warning-text shadow-popover`},{when:{variant:`soft`,color:`danger`},class:`bg-danger-surface text-danger-text shadow-popover`},{when:{variant:`surface`,color:`accent`},class:`border-accent-border bg-toast text-foreground shadow-popover`},{when:{variant:`surface`,color:`success`},class:`border-success-border bg-toast text-foreground shadow-popover`},{when:{variant:`surface`,color:`warning`},class:`border-warning-border bg-toast text-foreground shadow-popover`},{when:{variant:`surface`,color:`danger`},class:`border-danger-border bg-toast text-foreground shadow-popover`},{when:{variant:`outline`,color:`accent`},class:`border-accent-border text-accent-text shadow-none`},{when:{variant:`outline`,color:`success`},class:`border-success-border text-success-text shadow-none`},{when:{variant:`outline`,color:`warning`},class:`border-warning-border text-warning-text shadow-none`},{when:{variant:`outline`,color:`danger`},class:`border-danger-border text-danger-text shadow-none`},{when:{variant:`solid`,color:`accent`},class:`border-transparent bg-accent-solid text-accent-contrast shadow-popover`},{when:{variant:`solid`,color:`success`},class:`border-transparent bg-success-solid text-success-contrast shadow-popover`},{when:{variant:`solid`,color:`warning`},class:`border-transparent bg-warning-solid text-warning-contrast shadow-popover`},{when:{variant:`solid`,color:`danger`},class:`border-transparent bg-danger-solid text-danger-contrast shadow-popover`}],defaults:{variant:`default`,color:`neutral`,hasMarker:!1,hasDescription:!1}},marker:{base:`size-2 self-center rounded-full`,variants:{color:{neutral:`hidden`,accent:`bg-accent-solid`,success:`bg-success-solid`,warning:`bg-warning-solid`,danger:`bg-danger-solid`},variant:{default:`hidden`,soft:``,surface:``,solid:`hidden`,outline:``}},defaults:{color:`neutral`,variant:`default`}},content:{base:`grid min-w-0 gap-0.5 self-center`},title:{base:`min-w-0`,variants:{variant:{default:``,soft:`text-current`,surface:``,solid:`text-current`,outline:`text-current`}},defaults:{variant:`default`}},description:{base:`min-w-0`,variants:{variant:{default:``,soft:`text-current opacity-80`,surface:``,solid:`text-current opacity-80`,outline:`text-current opacity-80`}},defaults:{variant:`default`}},close:{base:[`-mr-1 inline-flex size-control-md shrink-0 items-center justify-center self-center rounded-2 text-icon outline-none`,`hover:bg-base-a2 focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2 focus-visible:ring-offset-app`],variants:{variant:{default:``,soft:`text-current hover:bg-current/10 focus-visible:ring-current focus-visible:ring-offset-transparent`,surface:``,solid:`text-current hover:bg-current/10 focus-visible:ring-current focus-visible:ring-offset-transparent`,outline:`text-current hover:bg-current/10 focus-visible:ring-current focus-visible:ring-offset-transparent`}},defaults:{variant:`default`}},closeIcon:{base:`size-icon fill-current`},outlet:{base:[`pointer-events-none fixed z-toast flex w-[min(24rem,calc(100vw-2rem))] flex-col gap-2`],variants:{position:{"top-right":`right-4 top-4 justify-items-end`,"top-left":`left-4 top-4 justify-items-start`,"top-center":`left-1/2 top-4 -translate-x-1/2 justify-items-center`,"bottom-right":`bottom-4 right-4 justify-items-end`,"bottom-left":`bottom-4 left-4 justify-items-start`,"bottom-center":`bottom-4 left-1/2 -translate-x-1/2 justify-items-center`}},defaults:{position:`top-right`}}}}}),fC=e=>e===`info`||e===`success`||e===`warning`||e===`danger`||e===`debug`,pC=e=>e===`auto`||e===`neutral`||e===`accent`||e===`success`||e===`warning`||e===`danger`,mC=e=>e==="default"||e===`soft`||e===`surface`||e===`solid`||e===`outline`,hC=e=>e===`info`?`accent`:e===`success`||e===`warning`||e===`danger`?e:`neutral`,gC=(e,t)=>pC(e)&&e!==`auto`?e:hC(t),_C=(e,t)=>{let n=typeof e==`number`?e:Number(e);return Number.isFinite(n)&&n>=0?n:t},vC=e=>Math.min(e,3),yC=new WeakMap,bC=e=>{let t=Array.from(e.querySelectorAll(`:scope > [data-ui-toast]`));e.dataset.stack=t.length>1?`collapsed`:`single`;let n=window.getComputedStyle(e),r=Number.parseFloat(n.rowGap||n.gap||`0`)||0,i=t.map(e=>Math.ceil(e.scrollHeight||e.getBoundingClientRect().height)),a=i[0]??0,o=Number.parseFloat(n.getPropertyValue(`--ui-toast-stack-peek`))||8,s=e.dataset.position?.startsWith(`bottom`)?-1:1,c=vC(Math.max(0,t.length-1)),l=i.reduce((e,t)=>e+t,0)+Math.max(0,t.length-1)*r,u=a+c*o;e.style.setProperty(`--ui-toast-front-height`,`${a}px`),e.style.setProperty(`--ui-toast-stack-height`,`${u}px`),e.style.setProperty(`--ui-toast-stack-expanded-height`,`${l}px`),t.forEach((e,n)=>{let r=vC(n),i=Math.max(.91,1-r*.03),a=Math.max(.72,1-r*.08);e.dataset.state!==`closed`&&(e.style.removeProperty(`opacity`),e.style.removeProperty(`transform`)),e.dataset.stackIndex=String(n),e.style.setProperty(`--ui-toast-stack-index`,String(n)),e.style.setProperty(`--ui-toast-stack-depth`,String(r)),e.style.setProperty(`--ui-toast-stack-direction`,String(s)),e.style.setProperty(`--ui-toast-stack-offset`,`${r*o*s}px`),e.style.setProperty(`--ui-toast-stack-scale`,String(i)),e.style.setProperty(`--ui-toast-stack-opacity`,String(a)),e.style.zIndex=String(t.length-n)})},xC=e=>{let t=e.parentElement instanceof HTMLElement?e.parentElement:null;e.dataset.state=`closed`,e.remove(),t?.matches(`[data-ui-toast-outlet]`)&&bC(t)},SC=e=>{yC.get(e)?.cancel();let t=K.motion.animatePresence(e,`enter`,`toast`);yC.set(e,t),t.finished.finally(()=>{if(yC.get(e)!==t)return;yC.delete(e),e.style.removeProperty(`opacity`),e.style.removeProperty(`transform`);let n=e.parentElement instanceof HTMLElement&&e.parentElement.matches(`[data-ui-toast-outlet]`)?e.parentElement:null;n&&bC(n)})},CC=e=>{if(!e.isConnected)return;e.dataset.state=`closed`,yC.get(e)?.cancel();let t=K.motion.animatePresence(e,`exit`,`toast`);yC.set(e,t),t.finished.finally(()=>{yC.get(e)===t&&(yC.delete(e),xC(e))})},wC=e=>{let t=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);t.setAttribute(`viewBox`,`0 0 32 32`),t.setAttribute(`aria-hidden`,`true`),t.setAttribute(`data-ui-toast-close-icon`,``),t.setAttribute(`class`,e);let n=document.createElementNS(`http://www.w3.org/2000/svg`,`polygon`);return n.setAttribute(`points`,`17.4141 16 24 9.4141 22.5859 8 16 14.5859 9.4143 8 8 9.4141 14.5859 16 8 22.5859 9.4143 24 16 17.4141 22.5859 24 24 22.5859 17.4141 16`),t.append(n),t},TC=()=>({props:null,cleanup:[],timer:null,init(){this.props=z({el:this.$el,schema:lC});let e=this.$el,t=e.parentElement instanceof HTMLElement&&e.parentElement.matches(`[data-ui-toast-outlet]`)?e.parentElement:null;e.dataset.state=`open`,e.setAttribute(`data-ui-motion-owner`,`component`),t&&bC(t),SC(e),this.props.dismissible&&K.addListener({target:e,event:`click`,handler:e=>{let t=e.target;t instanceof Element&&t.closest(`[data-ui-toast-close]`)&&this.dismiss()},cleanup:this.cleanup}),this.props.duration>0&&(this.timer=window.setTimeout(()=>this.dismiss(),this.props.duration))},destroy(){this.props.disconnect(),this.cleanup.forEach(e=>e()),this.cleanup=[],this.timer!==null&&window.clearTimeout(this.timer),yC.get(this.$el)?.cancel()},dismiss(){let e=this.$el;this.timer!==null&&window.clearTimeout(this.timer),K.dispatch({el:e,name:`ui:dismiss`}),CC(e)}}),EC=(e,t)=>{let n=fC(e.level)?e.level:`info`,r=gC(e.color,n),i=mC(e.variant)?e.variant:`default`,a=typeof e.title==`string`?e.title:``,o=typeof e.description==`string`?e.description:``,s=o.trim().length>0,c=r!==`neutral`&&i!==`solid`&&i!=="default",l=_C(e.duration,t),u=typeof e.dismissible==`boolean`?e.dismissible:!0,d=n===`danger`||n===`warning`,f=document.createElement(`div`);f.dataset.uiToast=``,f.dataset.level=n,f.dataset.color=r,f.dataset.variant=i,f.dataset.duration=String(l),f.dataset.dismissible=String(u),f.dataset.description=String(s),f.dataset.state=`open`,f.setAttribute(`role`,d?`alert`:`status`),f.setAttribute(`aria-live`,d?`assertive`:`polite`),f.setAttribute(`aria-atomic`,`true`),f.className=K.resolveStyle({part:dC.parts.root,props:{variant:i,color:r,hasDescription:s,hasMarker:c}});let p=document.createElement(`span`);p.dataset.uiToastMarker=``,p.setAttribute(`aria-hidden`,`true`),p.className=K.resolveStyle({part:dC.parts.marker,props:{variant:i,color:r}}),f.append(p);let m=document.createElement(`div`);if(m.dataset.uiToastContent=``,m.className=K.resolveStyle({part:dC.parts.content}),a){let e=document.createElement(`strong`);e.dataset.uiToastTitle=``,e.className=`text-sm font-medium text-foreground ${K.resolveStyle({part:dC.parts.title,props:{variant:i}})}`,e.textContent=a,m.append(e)}if(s){let e=document.createElement(`div`);e.dataset.uiToastDescription=``,e.className=`text-sm text-foreground-muted ${K.resolveStyle({part:dC.parts.description,props:{variant:i}})}`,e.textContent=o,m.append(e)}if(f.append(m),u){let e=document.createElement(`button`);e.type=`button`,e.dataset.uiToastClose=``,e.setAttribute(`aria-label`,`Dismiss notification`),e.className=K.resolveStyle({part:dC.parts.close,props:{variant:i}}),e.append(wC(K.resolveStyle({part:dC.parts.closeIcon}))),e.addEventListener(`click`,()=>CC(f)),f.append(e)}return l>0&&window.setTimeout(()=>CC(f),l),f},DC=()=>({props:null,cleanup:[],init(){this.props=z({el:this.$el,schema:uC});let e=this.$el;bC(e),K.addListener({target:e,event:`pointerover`,handler:()=>{e.dataset.stackExpanded=`true`},cleanup:this.cleanup}),K.addListener({target:e,event:`pointerout`,handler:t=>{let n=`relatedTarget`in t?t.relatedTarget:null;(!(n instanceof Node)||!e.contains(n))&&delete e.dataset.stackExpanded},cleanup:this.cleanup}),K.addListener({target:e,event:`focusin`,handler:()=>{e.dataset.stackExpanded=`true`},cleanup:this.cleanup}),K.addListener({target:e,event:`focusout`,handler:()=>{window.requestAnimationFrame(()=>{e.contains(document.activeElement)||delete e.dataset.stackExpanded})},cleanup:this.cleanup}),K.addListener({target:document,event:`ui:toast`,handler:e=>{let t=e instanceof CustomEvent?e.detail:{};this.add(t)},cleanup:this.cleanup})},destroy(){this.props.disconnect(),this.cleanup.forEach(e=>e()),this.cleanup=[]},add(e){let t=typeof e.title==`string`?e.title:``,n=typeof e.description==`string`?e.description:``;if(!t.trim()&&!n.trim())return;let r=this.$el,i=EC(e,this.props.duration);i.setAttribute(`data-ui-motion-owner`,`component`),r.append(i),bC(r),SC(i)}}),OC=e=>{e.data(`UiToast`,()=>TC()),e.data(`UiToastOutlet`,()=>DC())},kC={bool:H,className:Gl,create:ou,createResizable:Gf,cx:Kl,defineManifest:Jf,defineProps:z,defineStyles:W,json:Du,mergeBindings:du,motion:Ys,number:V,oneOf:U,propsFromSchema:Yf,resolveStyle:G,string:B},AC=e=>{if(e.ajax)return;let t={},n=document.querySelector(`meta[name="csrf-token"]`);n&&(t.headers={"X-CSRFToken":n.content}),e.plugin(he),e.plugin(te.configure(t))},jC=e=>{Eu(e.reactive),AC(e),ec(e),uh(e),ru(),xg(),tg(e),Ng(e),Ug(e),Py(e),Vy(e),Ky(e),xb(e),Ob(e),$b(e),cx(e),Cx(e),Jx(e),_S(e),IS(e),Kf(e),Qm(e),WS(e),iC(e),OC(e)};return e.bool=H,e.className=Gl,e.create=ou,e.createResizable=Gf,e.cx=Kl,e.default=jC,e.trellisUi=jC,e.defineManifest=Jf,e.defineProps=z,e.defineStyles=W,e.json=Du,e.mergeBindings=du,e.motion=Ys,e.number=V,e.oneOf=U,e.propsFromSchema=Yf,e.resolveStyle=G,e.string=B,e.ui=kC,e})({});
|