@smarttalks.ai/widget 0.0.1 → 0.1.0

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.
Files changed (3) hide show
  1. package/lib/index.js +2764 -2736
  2. package/lib/index.umd.cjs +28 -28
  3. package/package.json +1 -1
package/lib/index.umd.cjs CHANGED
@@ -1,10 +1,10 @@
1
- (function(fr){typeof define=="function"&&define.amd?define(fr):fr()})(function(){"use strict";function fr(e){return Object.keys(e).reduce((n,r)=>{const o=e[r];return n[r]=Object.assign({},o),Es(o.value)&&!Iu(o.value)&&!Array.isArray(o.value)&&(n[r].value=Object.assign({},o.value)),Array.isArray(o.value)&&(n[r].value=o.value.slice(0)),n},{})}function Tu(e){return e?Object.keys(e).reduce((n,r)=>{const o=e[r];return n[r]=Es(o)&&"value"in o?o:{value:o},n[r].attribute||(n[r].attribute=Mu(r)),n[r].parse="parse"in n[r]?n[r].parse:typeof n[r].value!="string",n},{}):{}}function $u(e){return Object.keys(e).reduce((n,r)=>(n[r]=e[r].value,n),{})}function Au(e,t){const n=fr(t);return Object.keys(t).forEach(o=>{const i=n[o],s=e.getAttribute(i.attribute),a=e[o];s&&(i.value=i.parse?xs(s):s),a!=null&&(i.value=Array.isArray(a)?a.slice(0):a),i.reflect&&Ss(e,i.attribute,i.value,!!i.parse),Object.defineProperty(e,o,{get(){return i.value},set(l){const c=i.value;i.value=l,i.reflect&&Ss(this,i.attribute,i.value,!!i.parse);for(let u=0,d=this.__propertyChangedCallbacks.length;u<d;u++)this.__propertyChangedCallbacks[u](o,l,c)},enumerable:!0,configurable:!0})}),n}function xs(e){if(e)try{return JSON.parse(e)}catch{return e}}function Ss(e,t,n,r){if(n==null||n===!1)return e.removeAttribute(t);let o=r?JSON.stringify(n):n;e.__updating[t]=!0,o==="true"&&(o=""),e.setAttribute(t,o),Promise.resolve().then(()=>delete e.__updating[t])}function Mu(e){return e.replace(/\.?([A-Z]+)/g,(t,n)=>"-"+n.toLowerCase()).replace("_","-").replace(/^-/,"")}function Es(e){return e!=null&&(typeof e=="object"||typeof e=="function")}function Iu(e){return Object.prototype.toString.call(e)==="[object Function]"}function Lu(e){return typeof e=="function"&&e.toString().indexOf("class")===0}let xo;function Ru(e,t){const n=Object.keys(t);return class extends e{static get observedAttributes(){return n.map(o=>t[o].attribute)}constructor(){super(),this.__initialized=!1,this.__released=!1,this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props={}}connectedCallback(){if(this.__initialized)return;this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props=Au(this,t);const o=$u(this.props),i=this.Component,s=xo;try{xo=this,this.__initialized=!0,Lu(i)?new i(o,{element:this}):i(o,{element:this})}finally{xo=s}}async disconnectedCallback(){if(await Promise.resolve(),this.isConnected)return;this.__propertyChangedCallbacks.length=0;let o=null;for(;o=this.__releaseCallbacks.pop();)o(this);delete this.__initialized,this.__released=!0}attributeChangedCallback(o,i,s){if(this.__initialized&&!this.__updating[o]&&(o=this.lookupProp(o),o in t)){if(s==null&&!this[o])return;this[o]=t[o].parse?xs(s):s}}lookupProp(o){if(t)return n.find(i=>o===i||o===t[i].attribute)}get renderRoot(){return this.shadowRoot||this.attachShadow({mode:"open"})}addReleaseCallback(o){this.__releaseCallbacks.push(o)}addPropertyChangedCallback(o){this.__propertyChangedCallbacks.push(o)}}}function Nu(e,t={},n={}){const{BaseElement:r=HTMLElement,extension:o,customElements:i=window.customElements}=n;return s=>{if(!e)throw new Error("tag is required to register a Component");let a=i.get(e);return a?(a.prototype.Component=s,a):(a=Ru(r,Tu(t)),a.prototype.Component=s,a.prototype.registeredTag=e,i.define(e,a,o),a)}}const Y={context:void 0,registry:void 0};function Rn(e){Y.context=e}const Fu=(e,t)=>e===t,Ie=Symbol("solid-proxy"),gr=Symbol("solid-track"),hr={equals:Fu};let Ps=$s;const et=1,pr=2,Cs={owned:null,cleanups:null,context:null,owner:null},So={};var ee=null;let Eo=null,_u=null,oe=null,he=null,tt=null,mr=0;function ze(e,t){const n=oe,r=ee,o=e.length===0,i=t===void 0?r:t,s=o?Cs:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?e:()=>e(()=>Q(()=>wr(s)));ee=s,oe=null;try{return nt(a,!0)}finally{oe=n,ee=r}}function L(e,t){t=t?Object.assign({},hr,t):hr;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(o=o(n.value)),Ts(n,o));return[ks.bind(n),r]}function Po(e,t,n){const r=yr(e,t,!0,et);qt(r)}function ue(e,t,n){const r=yr(e,t,!1,et);qt(r)}function V(e,t,n){Ps=Uu;const r=yr(e,t,!1,et);(!n||!n.render)&&(r.user=!0),tt?tt.push(r):qt(r)}function A(e,t,n){n=n?Object.assign({},hr,n):hr;const r=yr(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,qt(r),ks.bind(r)}function Vu(e){return e&&typeof e=="object"&&"then"in e}function Os(e,t,n){let r,o,i;arguments.length===2&&typeof t=="object"||arguments.length===1?(r=!0,o=e,i=t||{}):(r=e,o=t,i=n||{});let s=null,a=So,l=null,c=!1,u="initialValue"in i,d=typeof r=="function"&&A(r);const f=new Set,[m,g]=(i.storage||L)(i.initialValue),[p,y]=L(void 0),[v,b]=L(void 0,{equals:!1}),[w,x]=L(u?"ready":"unresolved");if(Y.context){l=`${Y.context.id}${Y.context.count++}`;let P;i.ssrLoadFrom==="initial"?a=i.initialValue:Y.load&&(P=Y.load(l))&&(a=P)}function T(P,M,$,R){return s===P&&(s=null,R!==void 0&&(u=!0),(P===a||M===a)&&i.onHydrated&&queueMicrotask(()=>i.onHydrated(R,{value:M})),a=So,O(M,$)),M}function O(P,M){nt(()=>{M===void 0&&g(()=>P),x(M!==void 0?"errored":u?"ready":"unresolved"),y(M);for(const $ of f.keys())$.decrement();f.clear()},!1)}function k(){const P=zu,M=m(),$=p();if($!==void 0&&!s)throw $;return oe&&!oe.user&&P&&Po(()=>{v(),s&&(P.resolved||f.has(P)||(P.increment(),f.add(P)))}),M}function j(P=!0){if(P!==!1&&c)return;c=!1;const M=d?d():r;if(M==null||M===!1){T(s,Q(m));return}const $=a!==So?a:Q(()=>o(M,{value:m(),refetching:P}));return Vu($)?(s=$,"value"in $?($.status==="success"?T(s,$.value,void 0,M):T(s,void 0,void 0,M),$):(c=!0,queueMicrotask(()=>c=!1),nt(()=>{x(u?"refreshing":"pending"),b()},!1),$.then(R=>T($,R,void 0,M),R=>T($,void 0,Ms(R),M)))):(T(s,$,void 0,M),$)}return Object.defineProperties(k,{state:{get:()=>w()},error:{get:()=>p()},loading:{get(){const P=w();return P==="pending"||P==="refreshing"}},latest:{get(){if(!u)return k();const P=p();if(P&&!s)throw P;return m()}}}),d?Po(()=>j(!1)):j(!1),[k,{refetch:j,mutate:g}]}function Be(e){return nt(e,!1)}function Q(e){if(oe===null)return e();const t=oe;oe=null;try{return e()}finally{oe=t}}function Nt(e,t,n){const r=Array.isArray(e);let o,i=n&&n.defer;return s=>{let a;if(r){a=Array(e.length);for(let c=0;c<e.length;c++)a[c]=e[c]()}else a=e();if(i){i=!1;return}const l=Q(()=>t(a,o,s));return o=a,l}}function Ft(e){V(()=>Q(e))}function Z(e){return ee===null||(ee.cleanups===null?ee.cleanups=[e]:ee.cleanups.push(e)),e}function Co(){return oe}function Ds(){return ee}function Ku(e,t){const n=ee,r=oe;ee=e,oe=null;try{return nt(t,!0)}catch(o){Do(o)}finally{ee=n,oe=r}}function ye(e,t){const n=Symbol("context");return{id:n,Provider:Wu(n),defaultValue:e}}function ve(e){return ee&&ee.context&&ee.context[e.id]!==void 0?ee.context[e.id]:e.defaultValue}function Oo(e){const t=A(e),n=A(()=>ko(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}let zu;function ks(){if(this.sources&&this.state)if(this.state===et)qt(this);else{const e=he;he=null,nt(()=>br(this),!1),he=e}if(oe){const e=this.observers?this.observers.length:0;oe.sources?(oe.sources.push(this),oe.sourceSlots.push(e)):(oe.sources=[this],oe.sourceSlots=[e]),this.observers?(this.observers.push(oe),this.observerSlots.push(oe.sources.length-1)):(this.observers=[oe],this.observerSlots=[oe.sources.length-1])}return this.value}function Ts(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&nt(()=>{for(let o=0;o<e.observers.length;o+=1){const i=e.observers[o],s=Eo&&Eo.running;s&&Eo.disposed.has(i),(s?!i.tState:!i.state)&&(i.pure?he.push(i):tt.push(i),i.observers&&As(i)),s||(i.state=et)}if(he.length>1e6)throw he=[],new Error},!1)),t}function qt(e){if(!e.fn)return;wr(e);const t=mr;Bu(e,e.value,t)}function Bu(e,t,n){let r;const o=ee,i=oe;oe=ee=e;try{r=e.fn(t)}catch(s){return e.pure&&(e.state=et,e.owned&&e.owned.forEach(wr),e.owned=null),e.updatedAt=n+1,Do(s)}finally{oe=i,ee=o}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?Ts(e,r):e.value=r,e.updatedAt=n)}function yr(e,t,n,r=et,o){const i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:ee,context:ee?ee.context:null,pure:n};return ee===null||ee!==Cs&&(ee.owned?ee.owned.push(i):ee.owned=[i]),i}function vr(e){if(e.state===0)return;if(e.state===pr)return br(e);if(e.suspense&&Q(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<mr);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===et)qt(e);else if(e.state===pr){const r=he;he=null,nt(()=>br(e,t[0]),!1),he=r}}function nt(e,t){if(he)return e();let n=!1;t||(he=[]),tt?n=!0:tt=[],mr++;try{const r=e();return ju(n),r}catch(r){n||(tt=null),he=null,Do(r)}}function ju(e){if(he&&($s(he),he=null),e)return;const t=tt;tt=null,t.length&&nt(()=>Ps(t),!1)}function $s(e){for(let t=0;t<e.length;t++)vr(e[t])}function Uu(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:vr(r)}if(Y.context){if(Y.count){Y.effects||(Y.effects=[]),Y.effects.push(...e.slice(0,n));return}else Y.effects&&(e=[...Y.effects,...e],n+=Y.effects.length,delete Y.effects);Rn()}for(t=0;t<n;t++)vr(e[t])}function br(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){const r=e.sources[n];if(r.sources){const o=r.state;o===et?r!==t&&(!r.updatedAt||r.updatedAt<mr)&&vr(r):o===pr&&br(r,t)}}}function As(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=pr,n.pure?he.push(n):tt.push(n),n.observers&&As(n))}}function wr(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),r=e.sourceSlots.pop(),o=n.observers;if(o&&o.length){const i=o.pop(),s=n.observerSlots.pop();r<o.length&&(i.sourceSlots[s]=r,o[r]=i,n.observerSlots[r]=s)}}if(e.owned){for(t=e.owned.length-1;t>=0;t--)wr(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function Ms(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function Do(e,t=ee){throw Ms(e)}function ko(e){if(typeof e=="function"&&!e.length)return ko(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=ko(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function Wu(e,t){return function(r){let o;return ue(()=>o=Q(()=>(ee.context={...ee.context,[e]:r.value},Oo(()=>r.children))),void 0),o}}const To=Symbol("fallback");function xr(e){for(let t=0;t<e.length;t++)e[t]()}function Hu(e,t,n={}){let r=[],o=[],i=[],s=0,a=t.length>1?[]:null;return Z(()=>xr(i)),()=>{let l=e()||[],c,u;return l[gr],Q(()=>{let f=l.length,m,g,p,y,v,b,w,x,T;if(f===0)s!==0&&(xr(i),i=[],r=[],o=[],s=0,a&&(a=[])),n.fallback&&(r=[To],o[0]=ze(O=>(i[0]=O,n.fallback())),s=1);else if(s===0){for(o=new Array(f),u=0;u<f;u++)r[u]=l[u],o[u]=ze(d);s=f}else{for(p=new Array(f),y=new Array(f),a&&(v=new Array(f)),b=0,w=Math.min(s,f);b<w&&r[b]===l[b];b++);for(w=s-1,x=f-1;w>=b&&x>=b&&r[w]===l[x];w--,x--)p[x]=o[w],y[x]=i[w],a&&(v[x]=a[w]);for(m=new Map,g=new Array(x+1),u=x;u>=b;u--)T=l[u],c=m.get(T),g[u]=c===void 0?-1:c,m.set(T,u);for(c=b;c<=w;c++)T=r[c],u=m.get(T),u!==void 0&&u!==-1?(p[u]=o[c],y[u]=i[c],a&&(v[u]=a[c]),u=g[u],m.set(T,u)):i[c]();for(u=b;u<f;u++)u in p?(o[u]=p[u],i[u]=y[u],a&&(a[u]=v[u],a[u](u))):o[u]=ze(d);o=o.slice(0,s=f),r=l.slice(0)}return o});function d(f){if(i[u]=f,a){const[m,g]=L(u);return a[u]=g,t(l[u],m)}return t(l[u])}}}function Yu(e,t,n={}){let r=[],o=[],i=[],s=[],a=0,l;return Z(()=>xr(i)),()=>{const c=e()||[];return c[gr],Q(()=>{if(c.length===0)return a!==0&&(xr(i),i=[],r=[],o=[],a=0,s=[]),n.fallback&&(r=[To],o[0]=ze(d=>(i[0]=d,n.fallback())),a=1),o;for(r[0]===To&&(i[0](),i=[],r=[],o=[],a=0),l=0;l<c.length;l++)l<r.length&&r[l]!==c[l]?s[l](()=>c[l]):l>=r.length&&(o[l]=ze(u));for(;l<r.length;l++)i[l]();return a=s.length=i.length=c.length,r=c.slice(0),o=o.slice(0,a)});function u(d){i[l]=d;const[f,m]=L(c[l]);return s[l]=m,t(f,l)}}}function h(e,t){return Q(()=>e(t||{}))}function Sr(){return!0}const $o={get(e,t,n){return t===Ie?n:e.get(t)},has(e,t){return t===Ie?!0:e.has(t)},set:Sr,deleteProperty:Sr,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:Sr,deleteProperty:Sr}},ownKeys(e){return e.keys()}};function Ao(e){return(e=typeof e=="function"?e():e)?e:{}}function Gu(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function I(...e){let t=!1;for(let s=0;s<e.length;s++){const a=e[s];t=t||!!a&&Ie in a,e[s]=typeof a=="function"?(t=!0,A(a)):a}if(t)return new Proxy({get(s){for(let a=e.length-1;a>=0;a--){const l=Ao(e[a])[s];if(l!==void 0)return l}},has(s){for(let a=e.length-1;a>=0;a--)if(s in Ao(e[a]))return!0;return!1},keys(){const s=[];for(let a=0;a<e.length;a++)s.push(...Object.keys(Ao(e[a])));return[...new Set(s)]}},$o);const n={},r=Object.create(null);for(let s=e.length-1;s>=0;s--){const a=e[s];if(!a)continue;const l=Object.getOwnPropertyNames(a);for(let c=l.length-1;c>=0;c--){const u=l[c];if(u==="__proto__"||u==="constructor")continue;const d=Object.getOwnPropertyDescriptor(a,u);if(!r[u])r[u]=d.get?{enumerable:!0,configurable:!0,get:Gu.bind(n[u]=[d.get.bind(a)])}:d.value!==void 0?d:void 0;else{const f=n[u];f&&(d.get?f.push(d.get.bind(a)):d.value!==void 0&&f.push(()=>d.value))}}}const o={},i=Object.keys(r);for(let s=i.length-1;s>=0;s--){const a=i[s],l=r[a];l&&l.get?Object.defineProperty(o,a,l):o[a]=l?l.value:void 0}return o}function U(e,...t){if(Ie in e){const o=new Set(t.length>1?t.flat():t[0]),i=t.map(s=>new Proxy({get(a){return s.includes(a)?e[a]:void 0},has(a){return s.includes(a)&&a in e},keys(){return s.filter(a=>a in e)}},$o));return i.push(new Proxy({get(s){return o.has(s)?void 0:e[s]},has(s){return o.has(s)?!1:s in e},keys(){return Object.keys(e).filter(s=>!o.has(s))}},$o)),i}const n={},r=t.map(()=>({}));for(const o of Object.getOwnPropertyNames(e)){const i=Object.getOwnPropertyDescriptor(e,o),s=!i.get&&!i.set&&i.enumerable&&i.writable&&i.configurable;let a=!1,l=0;for(const c of t)c.includes(o)&&(a=!0,s?r[l][o]=i.value:Object.defineProperty(r[l],o,i)),++l;a||(s?n[o]=i.value:Object.defineProperty(n,o,i))}return[...r,n]}function qu(e){let t,n;const r=o=>{const i=Y.context;if(i){const[a,l]=L();Y.count||(Y.count=0),Y.count++,(n||(n=e())).then(c=>{Rn(i),Y.count--,l(()=>c.default),Rn()}),t=a}else if(!t){const[a]=Os(()=>(n||(n=e())).then(l=>l.default));t=a}let s;return A(()=>(s=t())&&Q(()=>{if(!i)return s(o);const a=Y.context;Rn(i);const l=s(o);return Rn(a),l}))};return r.preload=()=>n||((n=e()).then(o=>t=()=>o.default),n),r}let Zu=0;function Le(){const e=Y.context;return e?`${e.id}${e.count++}`:`cl-${Zu++}`}const Is=e=>`Stale read from <${e}>.`;function Zt(e){const t="fallback"in e&&{fallback:()=>e.fallback};return A(Hu(()=>e.each,e.children,t||void 0))}function _t(e){const t="fallback"in e&&{fallback:()=>e.fallback};return A(Yu(()=>e.each,e.children,t||void 0))}function ie(e){const t=e.keyed,n=A(()=>e.when,void 0,{equals:(r,o)=>t?r===o:!r==!o});return A(()=>{const r=n();if(r){const o=e.children;return typeof o=="function"&&o.length>0?Q(()=>o(t?r:()=>{if(!Q(n))throw Is("Show");return e.when})):o}return e.fallback},void 0,void 0)}function Ls(e){let t=!1;const n=(i,s)=>(t?i[1]===s[1]:!i[1]==!s[1])&&i[2]===s[2],r=Oo(()=>e.children),o=A(()=>{let i=r();Array.isArray(i)||(i=[i]);for(let s=0;s<i.length;s++){const a=i[s].when;if(a)return t=!!i[s].keyed,[s,a,i[s]]}return[-1]},void 0,{equals:n});return A(()=>{const[i,s,a]=o();if(i<0)return e.fallback;const l=a.children;return typeof l=="function"&&l.length>0?Q(()=>l(t?s:()=>{if(Q(o)[0]!==i)throw Is("Match");return a.when})):l},void 0,void 0)}function Nn(e){return e}const Xu=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],Ju=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...Xu]),Qu=new Set(["innerHTML","textContent","innerText","children"]),ed=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),td=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});function nd(e,t){const n=td[e];return typeof n=="object"?n[t]?n.$:void 0:n}const rd=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),od=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),id={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function sd(e,t,n){let r=n.length,o=t.length,i=r,s=0,a=0,l=t[o-1].nextSibling,c=null;for(;s<o||a<i;){if(t[s]===n[a]){s++,a++;continue}for(;t[o-1]===n[i-1];)o--,i--;if(o===s){const u=i<r?a?n[a-1].nextSibling:n[i-a]:l;for(;a<i;)e.insertBefore(n[a++],u)}else if(i===a)for(;s<o;)(!c||!c.has(t[s]))&&t[s].remove(),s++;else if(t[s]===n[i-1]&&n[a]===t[o-1]){const u=t[--o].nextSibling;e.insertBefore(n[a++],t[s++].nextSibling),e.insertBefore(n[--i],u),t[o]=n[i]}else{if(!c){c=new Map;let d=a;for(;d<i;)c.set(n[d],d++)}const u=c.get(t[s]);if(u!=null)if(a<u&&u<i){let d=s,f=1,m;for(;++d<o&&d<i&&!((m=c.get(t[d]))==null||m!==u+f);)f++;if(f>u-a){const g=t[s];for(;a<u;)e.insertBefore(n[a++],g)}else e.replaceChild(n[a++],t[s++])}else s++;else t[s++].remove()}}}const Rs="_$DX_DELEGATE";function B(e,t,n){let r;const o=()=>{const s=document.createElement("template");return s.innerHTML=e,n?s.content.firstChild.firstChild:s.content.firstChild},i=t?()=>Q(()=>document.importNode(r||(r=o()),!0)):()=>(r||(r=o())).cloneNode(!0);return i.cloneNode=i,i}function ad(e,t=window.document){const n=t[Rs]||(t[Rs]=new Set);for(let r=0,o=e.length;r<o;r++){const i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,hd))}}function we(e,t,n){Y.context||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function ld(e,t,n,r){Y.context||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function xt(e,t){Y.context||(t==null?e.removeAttribute("class"):e.className=t)}function cd(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const o=n[0];e.addEventListener(t,n[0]=i=>o.call(e,n[1],i))}else e.addEventListener(t,n)}function ud(e,t,n={}){const r=Object.keys(t||{}),o=Object.keys(n);let i,s;for(i=0,s=o.length;i<s;i++){const a=o[i];!a||a==="undefined"||t[a]||(_s(e,a,!1),delete n[a])}for(i=0,s=r.length;i<s;i++){const a=r[i],l=!!t[a];!a||a==="undefined"||n[a]===l||!l||(_s(e,a,!0),n[a]=l)}return n}function Ns(e,t,n){if(!t)return n?we(e,"style"):t;const r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let o,i;for(i in n)t[i]==null&&r.removeProperty(i),delete n[i];for(i in t)o=t[i],o!==n[i]&&(r.setProperty(i,o),n[i]=o);return n}function Xt(e,t={},n,r){const o={};return r||ue(()=>o.children=Jt(e,t.children,o.children)),ue(()=>t.ref&&t.ref(e)),ue(()=>dd(e,t,n,!0,o,!0)),o}function Fs(e,t,n){return Q(()=>e(t,n))}function F(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return Jt(e,t,r,n);ue(o=>Jt(e,t(),o,n),r)}function dd(e,t,n,r,o={},i=!1){t||(t={});for(const s in o)if(!(s in t)){if(s==="children")continue;o[s]=Vs(e,s,null,o[s],n,i)}for(const s in t){if(s==="children"){r||Jt(e,t.children);continue}const a=t[s];o[s]=Vs(e,s,a,o[s],n,i)}}function fd(e){let t,n;return!Y.context||!(t=Y.registry.get(n=pd()))?e():(Y.completed&&Y.completed.add(t),Y.registry.delete(n),t)}function gd(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function _s(e,t,n){const r=t.trim().split(/\s+/);for(let o=0,i=r.length;o<i;o++)e.classList.toggle(r[o],n)}function Vs(e,t,n,r,o,i){let s,a,l,c,u;if(t==="style")return Ns(e,n,r);if(t==="classList")return ud(e,n,r);if(n===r)return r;if(t==="ref")i||n(e);else if(t.slice(0,3)==="on:"){const d=t.slice(3);r&&e.removeEventListener(d,r),n&&e.addEventListener(d,n)}else if(t.slice(0,10)==="oncapture:"){const d=t.slice(10);r&&e.removeEventListener(d,r,!0),n&&e.addEventListener(d,n,!0)}else if(t.slice(0,2)==="on"){const d=t.slice(2).toLowerCase(),f=rd.has(d);if(!f&&r){const m=Array.isArray(r)?r[0]:r;e.removeEventListener(d,m)}(f||n)&&(cd(e,d,n,f),f&&ad([d]))}else if(t.slice(0,5)==="attr:")we(e,t.slice(5),n);else if((u=t.slice(0,5)==="prop:")||(l=Qu.has(t))||!o&&((c=nd(t,e.tagName))||(a=Ju.has(t)))||(s=e.nodeName.includes("-"))){if(u)t=t.slice(5),a=!0;else if(Y.context)return n;t==="class"||t==="className"?xt(e,n):s&&!a&&!l?e[gd(t)]=n:e[c||t]=n}else{const d=o&&t.indexOf(":")>-1&&id[t.split(":")[0]];d?ld(e,d,t,n):we(e,ed[t]||t,n)}return n}function hd(e){const t=`$$${e.type}`;let n=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==n&&Object.defineProperty(e,"target",{configurable:!0,value:n}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return n||document}}),Y.registry&&!Y.done&&(Y.done=_$HY.done=!0);n;){const r=n[t];if(r&&!n.disabled){const o=n[`${t}Data`];if(o!==void 0?r.call(n,o,e):r.call(n,e),e.cancelBubble)return}n=n._$host||n.parentNode||n.host}}function Jt(e,t,n,r,o){if(Y.context){!n&&(n=[...e.childNodes]);let a=[];for(let l=0;l<n.length;l++){const c=n[l];c.nodeType===8&&c.data.slice(0,2)==="!$"?c.remove():a.push(c)}n=a}for(;typeof n=="function";)n=n();if(t===n)return n;const i=typeof t,s=r!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,i==="string"||i==="number"){if(Y.context)return n;if(i==="number"&&(t=t.toString()),s){let a=n[0];a&&a.nodeType===3?a.data!==t&&(a.data=t):a=document.createTextNode(t),n=Qt(e,n,r,a)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||i==="boolean"){if(Y.context)return n;n=Qt(e,n,r)}else{if(i==="function")return ue(()=>{let a=t();for(;typeof a=="function";)a=a();n=Jt(e,a,n,r)}),()=>n;if(Array.isArray(t)){const a=[],l=n&&Array.isArray(n);if(Mo(a,t,n,o))return ue(()=>n=Jt(e,a,n,r,!0)),()=>n;if(Y.context){if(!a.length)return n;if(r===void 0)return[...e.childNodes];let c=a[0],u=[c];for(;(c=c.nextSibling)!==r;)u.push(c);return n=u}if(a.length===0){if(n=Qt(e,n,r),s)return n}else l?n.length===0?Ks(e,a,r):sd(e,n,a):(n&&Qt(e),Ks(e,a));n=a}else if(t.nodeType){if(Y.context&&t.parentNode)return n=s?[t]:t;if(Array.isArray(n)){if(s)return n=Qt(e,n,r,t);Qt(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function Mo(e,t,n,r){let o=!1;for(let i=0,s=t.length;i<s;i++){let a=t[i],l=n&&n[i],c;if(!(a==null||a===!0||a===!1))if((c=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))o=Mo(e,a,l)||o;else if(c==="function")if(r){for(;typeof a=="function";)a=a();o=Mo(e,Array.isArray(a)?a:[a],Array.isArray(l)?l:[l])||o}else e.push(a),o=!0;else{const u=String(a);l&&l.nodeType===3&&l.data===u?e.push(l):e.push(document.createTextNode(u))}}return o}function Ks(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function Qt(e,t,n,r){if(n===void 0)return e.textContent="";const o=r||document.createTextNode("");if(t.length){let i=!1;for(let s=t.length-1;s>=0;s--){const a=t[s];if(o!==a){const l=a.parentNode===e;!i&&!s?l?e.replaceChild(o,a):e.insertBefore(o,n):l&&a.remove()}else i=!0}}else e.insertBefore(o,n);return[o]}function pd(){const e=Y.context;return`${e.id}${e.count++}`}const md=!1,yd="http://www.w3.org/2000/svg";function zs(e,t=!1){return t?document.createElementNS(yd,e):document.createElement(e)}function Io(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,o=Ds();let i,s=!!Y.context;return V(()=>{s&&(Ds().user=s=!1),i||(i=Ku(o,()=>A(()=>e.children)));const a=r();if(a instanceof HTMLHeadElement){const[l,c]=L(!1),u=()=>c(!0);ze(d=>F(a,()=>l()?d():i(),null)),Z(u)}else{const l=zs(e.isSVG?"g":"div",e.isSVG),c=t&&l.attachShadow?l.attachShadow({mode:"open"}):l;Object.defineProperty(l,"_$host",{get(){return n.parentNode},configurable:!0}),F(c,i),a.appendChild(l),e.ref&&e.ref(l),Z(()=>a.removeChild(l))}},void 0,{render:!s}),n}function Fn(e){const[t,n]=U(e,["component"]),r=A(()=>t.component);return A(()=>{const o=r();switch(typeof o){case"function":return Q(()=>o(n));case"string":const i=od.has(o),s=Y.context?fd():zs(o,i);return Xt(s,n,i),s}})}function vd(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const[o,i]=L(e[t[r]]);Object.defineProperty(n,t[r],{get:o,set(s){i(()=>s)}})}return n}function bd(e){if(e.assignedSlot&&e.assignedSlot._$owner)return e.assignedSlot._$owner;let t=e.parentNode;for(;t&&!t._$owner&&!(t.assignedSlot&&t.assignedSlot._$owner);)t=t.parentNode;return t&&t.assignedSlot?t.assignedSlot._$owner:e._$owner}function wd(e){return(t,n)=>{const{element:r}=n;return ze(o=>{const i=vd(t);r.addPropertyChangedCallback((a,l)=>i[a]=l),r.addReleaseCallback(()=>{r.renderRoot.textContent="",o()});const s=e(i,n);return F(r.renderRoot,s)},bd(r))}}function xd(e,t,n){return arguments.length===2&&(n=t,t={}),Nu(e,t)(wd(n))}const Sd='*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Inter,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground));font-feature-settings:"rlig" 1,"calt" 1}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.inset-x-0{left:0;right:0}.-top-2{top:-.5rem}.bottom-0{bottom:0}.bottom-5{bottom:1.25rem}.left-2{left:.5rem}.left-5{left:1.25rem}.left-9{left:2.25rem}.right-5{right:1.25rem}.right-9{right:2.25rem}.z-50{z-index:50}.m-0{margin:0}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-\\[-1rem\\]{margin-left:-1rem;margin-right:-1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.ml-1{margin-left:.25rem}.ml-auto{margin-left:auto}.mt-0{margin-top:0}.mt-2{margin-top:.5rem}.mt-24{margin-top:6rem}.mt-4{margin-top:1rem}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.size-10{width:2.5rem;height:2.5rem}.size-12{width:3rem;height:3rem}.size-2{width:.5rem;height:.5rem}.size-3{width:.75rem;height:.75rem}.size-3\\.5{width:.875rem;height:.875rem}.size-4{width:1rem;height:1rem}.size-8{width:2rem;height:2rem}.size-full{width:100%;height:100%}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-2{height:.5rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\\[85vh\\]{height:85vh}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-\\[80\\%\\]{max-height:80%}.max-h-full{max-height:100%}.min-h-16{min-height:4rem}.w-11\\/12{width:91.666667%}.w-4{width:1rem}.w-5{width:1.25rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-\\[100px\\]{width:100px}.w-\\[90vw\\]{width:90vw}.w-\\[98\\%\\]{width:98%}.w-\\[calc\\(var\\(--reference-width\\)-\\(0\\.75rem\\*2\\)\\)\\]{width:calc(var(--reference-width) - (.75rem * 2))}.w-full{width:100%}.min-w-\\[8rem\\]{min-width:8rem}.max-w-64{max-width:16rem}.max-w-full{max-width:100%}.flex-1{flex:1 1 0%}.flex-none{flex:none}.flex-grow{flex-grow:1}.border-collapse{border-collapse:collapse}.origin-\\[var\\(--kb-menu-content-transform-origin\\)\\]{transform-origin:var(--kb-menu-content-transform-origin)}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce{animation:bounce 1s infinite}@keyframes content-hide{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.96)}}.animate-content-hide{animation:content-hide .2s ease-out}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize{resize:both}.snap-x{scroll-snap-type:x var(--tw-scroll-snap-strictness)}.snap-center{scroll-snap-align:center}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.flex-col{flex-direction:column}.place-content-center{place-content:center}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0px}.gap-0\\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\\.5{gap:.375rem}.gap-2{gap:.5rem}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.25rem * var(--tw-space-x-reverse));margin-left:calc(.25rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.place-self-start{place-self:start}.place-self-end{place-self:end}.place-self-center{place-self:center}.self-start{align-self:flex-start}.self-end{align-self:flex-end}.self-center{align-self:center}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.scroll-smooth{scroll-behavior:smooth}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.text-nowrap{text-wrap:nowrap}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:calc(var(--radius) + 4px)}.rounded-l-xl{border-top-left-radius:calc(var(--radius) + 4px);border-bottom-left-radius:calc(var(--radius) + 4px)}.rounded-r-xl{border-top-right-radius:calc(var(--radius) + 4px);border-bottom-right-radius:calc(var(--radius) + 4px)}.rounded-t-\\[10px\\]{border-top-left-radius:10px;border-top-right-radius:10px}.rounded-tl-xl{border-top-left-radius:calc(var(--radius) + 4px)}.rounded-tr-xl{border-top-right-radius:calc(var(--radius) + 4px)}.border{border-width:1px}.border-input{border-color:hsl(var(--input))}.border-primary{border-color:hsl(var(--primary))}.bg-background{background-color:hsl(var(--background))}.bg-black\\/50{background-color:#00000080}.bg-destructive{background-color:hsl(var(--destructive))}.bg-muted{background-color:hsl(var(--muted))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-slate-200{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity))}.bg-slate-200\\/40{background-color:#e2e8f066}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.fill-current{fill:currentColor}.object-contain{-o-object-fit:contain;object-fit:contain}.p-0{padding:0}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.px-0{padding-left:0;padding-right:0}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0{padding-top:0;padding-bottom:0}.py-0\\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.pb-2{padding-bottom:.5rem}.pl-3{padding-left:.75rem}.pl-8{padding-left:2rem}.pr-1{padding-right:.25rem}.pr-2{padding-right:.5rem}.pt-1{padding-top:.25rem}.text-center{text-align:center}.text-\\[0\\.8rem\\]{font-size:.8rem}.text-\\[10px\\]{font-size:10px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-light{font-weight:300}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.italic{font-style:italic}.leading-none{line-height:1}.tracking-tight{letter-spacing:-.025em}.tracking-widest{letter-spacing:.1em}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{color:hsl(var(--foreground))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-primary\\/40{--tw-shadow-color: hsl(var(--primary) / .4);--tw-shadow: var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.delay-150{transition-delay:.15s}.delay-300{transition-delay:.3s}.duration-300{transition-duration:.3s}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.fade-in-80{--tw-enter-opacity: .8}.duration-300{animation-duration:.3s}.delay-150{animation-delay:.15s}.delay-300{animation-delay:.3s}#smarttalks-widget{--card: 0 0% 100%;--card-foreground: 240 10% 3.9%;--popover: 0 0% 100%;--popover-foreground: 240 10% 3.9%;--secondary: 240 4.8% 95.9%;--secondary-foreground: 240 5.9% 10%;--muted: 240 4.8% 95.9%;--muted-foreground: 240 3.8% 46.1%;--accent: 240 4.8% 95.9%;--accent-foreground: 240 5.9% 10%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 0 0% 98%;--border: 240 5.9% 90%;--input: 240 5.9% 90%;--ring: 346.8 77.2% 49.8%;--radius: .5rem}@media (max-width: 640px){.container{padding-left:1rem;padding-right:1rem}}::-webkit-scrollbar{width:.5rem;height:.4rem}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{border-radius:var(--radius);--tw-bg-opacity: 1;background-color:rgb(203 213 225 / var(--tw-bg-opacity))}::-webkit-scrollbar-thumb:hover{--tw-bg-opacity: 1;background-color:rgb(148 163 184 / var(--tw-bg-opacity))}.file\\:border-0::file-selector-button{border-width:0px}.file\\:bg-transparent::file-selector-button{background-color:transparent}.file\\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\\:font-medium::file-selector-button{font-weight:500}.placeholder\\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.after\\:absolute:after{content:var(--tw-content);position:absolute}.after\\:inset-x-0:after{content:var(--tw-content);left:0;right:0}.after\\:top-full:after{content:var(--tw-content);top:100%}.after\\:h-\\[50\\%\\]:after{content:var(--tw-content);height:50%}.after\\:bg-inherit:after{content:var(--tw-content);background-color:inherit}.hover\\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\\:bg-accent\\/10:hover{background-color:hsl(var(--accent) / .1)}.hover\\:bg-destructive\\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\\:bg-primary:hover{background-color:hsl(var(--primary))}.hover\\:bg-primary\\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\\:bg-secondary\\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\\:bg-slate-200:hover{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity))}.hover\\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\\:text-primary-foreground:hover{color:hsl(var(--primary-foreground))}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-100:hover{opacity:1}.hover\\:shadow-primary:hover{--tw-shadow-color: hsl(var(--primary));--tw-shadow: var(--tw-shadow-colored)}.hover\\:brightness-50:hover{--tw-brightness: brightness(.5);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.hover\\:brightness-75:hover{--tw-brightness: brightness(.75);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.focus\\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-\\[1\\.5px\\]:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1.5px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-primary:focus-visible{--tw-ring-color: hsl(var(--primary))}.focus-visible\\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}.has-\\[\\[data-range-end\\]\\]\\:rounded-r-md:has([data-range-end]){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.has-\\[\\[data-range-start\\]\\]\\:rounded-l-md:has([data-range-start]){border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.has-\\[\\[data-in-range\\]\\]\\:bg-accent:has([data-in-range]){background-color:hsl(var(--accent))}.has-\\[\\[data-outside-range\\]\\[data-in-range\\]\\]\\:bg-accent\\/50:has([data-outside-range][data-in-range]){background-color:hsl(var(--accent) / .5)}.has-\\[\\[data-in-range\\]\\]\\:first-of-type\\:rounded-l-md:first-of-type:has([data-in-range]){border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.has-\\[\\[data-in-range\\]\\]\\:last-of-type\\:rounded-r-md:last-of-type:has([data-in-range]){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.data-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}@keyframes content-show{0%{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}.data-\\[expanded\\]\\:animate-content-show[data-expanded]{animation:content-show .2s ease-out}.data-\\[selected\\]\\:bg-primary[data-selected]{background-color:hsl(var(--primary))}.data-\\[state\\=open\\]\\:bg-accent[data-state=open],.data-\\[today\\]\\:bg-accent[data-today]{background-color:hsl(var(--accent))}.data-\\[disabled\\]\\:text-muted-foreground[data-disabled],.data-\\[outside-range\\]\\:text-muted-foreground[data-outside-range]{color:hsl(var(--muted-foreground))}.data-\\[selected\\]\\:text-primary-foreground[data-selected]{color:hsl(var(--primary-foreground))}.data-\\[today\\]\\:text-accent-foreground[data-today]{color:hsl(var(--accent-foreground))}.data-\\[disabled\\]\\:opacity-50[data-disabled],.data-\\[outside-range\\]\\:opacity-50[data-outside-range]{opacity:.5}.data-\\[selected\\]\\:opacity-100[data-selected]{opacity:1}.data-\\[transitioning\\]\\:transition-colors[data-transitioning]{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.data-\\[transitioning\\]\\:transition-transform[data-transitioning]{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.data-\\[transitioning\\]\\:duration-300[data-transitioning]{transition-duration:.3s}.data-\\[state\\=open\\]\\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\\[state\\=closed\\]\\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\\[state\\=closed\\]\\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\\[state\\=open\\]\\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\\[state\\=closed\\]\\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\\[state\\=open\\]\\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\\[transitioning\\]\\:duration-300[data-transitioning]{animation-duration:.3s}.data-\\[selected\\]\\:hover\\:bg-primary:hover[data-selected]{background-color:hsl(var(--primary))}.data-\\[selected\\]\\:hover\\:text-primary-foreground:hover[data-selected]{color:hsl(var(--primary-foreground))}@media (min-width: 640px){.sm\\:text-left{text-align:left}}@media (min-width: 768px){.md\\:h-\\[min\\(100vh\\,500px\\)\\]{height:min(100vh,500px)}.md\\:max-h-\\[90\\%\\]{max-height:90%}.md\\:w-\\[min\\(100vw\\,400px\\)\\]{width:min(100vw,400px)}.md\\:max-w-\\[90\\%\\]{max-width:90%}.md\\:select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.md\\:text-lg{font-size:1.125rem;line-height:1.75rem}.md\\:text-sm{font-size:.875rem;line-height:1.25rem}}.\\[\\&\\:is\\(\\[data-outside-range\\]\\[data-in-range\\]\\)\\]\\:bg-accent\\/50:is([data-outside-range][data-in-range]){background-color:hsl(var(--accent) / .5)}.\\[\\&\\:is\\(\\[data-outside-range\\]\\[data-in-range\\]\\)\\]\\:text-muted-foreground:is([data-outside-range][data-in-range]){color:hsl(var(--muted-foreground))}.\\[\\&\\:is\\(\\[data-outside-range\\]\\[data-in-range\\]\\)\\]\\:opacity-30:is([data-outside-range][data-in-range]){opacity:.3}.\\[\\&\\:is\\(\\[data-today\\]\\[data-selected\\]\\)\\]\\:bg-primary:is([data-today][data-selected]){background-color:hsl(var(--primary))}.\\[\\&\\:is\\(\\[data-today\\]\\[data-selected\\]\\)\\]\\:text-primary-foreground:is([data-today][data-selected]){color:hsl(var(--primary-foreground))}',[Bs,Lo]=L(!1),js=[],Ed=e=>js.push(e),Us=()=>{js.forEach(e=>e())},Pd=()=>{Lo(!Bs()),Us()},Cd=()=>{Lo(!1)},Od=()=>{Lo(!0),Us()},Ws=()=>({bubble:Bs,show:Od,hide:Cd,toggle:Pd,onOpen:Ed}),Ro=Symbol("store-raw"),en=Symbol("store-node"),rt=Symbol("store-has"),Hs=Symbol("store-self");function Ys(e){let t=e[Ie];if(!t&&(Object.defineProperty(e,Ie,{value:t=new Proxy(e,Td)}),!Array.isArray(e))){const n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let o=0,i=n.length;o<i;o++){const s=n[o];r[s].get&&Object.defineProperty(e,s,{enumerable:r[s].enumerable,get:r[s].get.bind(t)})}}return t}function St(e){let t;return e!=null&&typeof e=="object"&&(e[Ie]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function tn(e,t=new Set){let n,r,o,i;if(n=e!=null&&e[Ro])return n;if(!St(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let s=0,a=e.length;s<a;s++)o=e[s],(r=tn(o,t))!==o&&(e[s]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);const s=Object.keys(e),a=Object.getOwnPropertyDescriptors(e);for(let l=0,c=s.length;l<c;l++)i=s[l],!a[i].get&&(o=e[i],(r=tn(o,t))!==o&&(e[i]=r))}return e}function Er(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function _n(e,t,n){if(e[t])return e[t];const[r,o]=L(n,{equals:!1,internal:!0});return r.$=o,e[t]=r}function Dd(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===Ie||t===en||(delete n.value,delete n.writable,n.get=()=>e[Ie][t]),n}function Gs(e){Co()&&_n(Er(e,en),Hs)()}function kd(e){return Gs(e),Reflect.ownKeys(e)}const Td={get(e,t,n){if(t===Ro)return e;if(t===Ie)return n;if(t===gr)return Gs(e),n;const r=Er(e,en),o=r[t];let i=o?o():e[t];if(t===en||t===rt||t==="__proto__")return i;if(!o){const s=Object.getOwnPropertyDescriptor(e,t);Co()&&(typeof i!="function"||e.hasOwnProperty(t))&&!(s&&s.get)&&(i=_n(r,t,i)())}return St(i)?Ys(i):i},has(e,t){return t===Ro||t===Ie||t===gr||t===en||t===rt||t==="__proto__"?!0:(Co()&&_n(Er(e,rt),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:kd,getOwnPropertyDescriptor:Dd};function Re(e,t,n,r=!1){if(!r&&e[t]===n)return;const o=e[t],i=e.length;n===void 0?(delete e[t],e[rt]&&e[rt][t]&&o!==void 0&&e[rt][t].$()):(e[t]=n,e[rt]&&e[rt][t]&&o===void 0&&e[rt][t].$());let s=Er(e,en),a;if((a=_n(s,t,o))&&a.$(()=>n),Array.isArray(e)&&e.length!==i){for(let l=e.length;l<i;l++)(a=s[l])&&a.$();(a=_n(s,"length",i))&&a.$(e.length)}(a=s[Hs])&&a.$()}function qs(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const o=n[r];Re(e,o,t[o])}}function $d(e,t){if(typeof t=="function"&&(t=t(e)),t=tn(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){const o=t[n];e[n]!==o&&Re(e,n,o)}Re(e,"length",r)}else qs(e,t)}function Vn(e,t,n=[]){let r,o=e;if(t.length>1){r=t.shift();const s=typeof r,a=Array.isArray(e);if(Array.isArray(r)){for(let l=0;l<r.length;l++)Vn(e,[r[l]].concat(t),n);return}else if(a&&s==="function"){for(let l=0;l<e.length;l++)r(e[l],l)&&Vn(e,[l].concat(t),n);return}else if(a&&s==="object"){const{from:l=0,to:c=e.length-1,by:u=1}=r;for(let d=l;d<=c;d+=u)Vn(e,[d].concat(t),n);return}else if(t.length>1){Vn(e[r],t,[r].concat(n));return}o=e[r],n=[r].concat(n)}let i=t[0];typeof i=="function"&&(i=i(o,n),i===o)||r===void 0&&i==null||(i=tn(i),r===void 0||St(o)&&St(i)&&!Array.isArray(i)?qs(o,i):Re(e,r,i))}function Zs(...[e,t]){const n=tn(e||{}),r=Array.isArray(n),o=Ys(n);function i(...s){Be(()=>{r&&s.length===1?$d(n,s[0]):Vn(n,s)})}return[o,i]}const No=Symbol("store-root");function nn(e,t,n,r,o){const i=t[n];if(e===i)return;const s=Array.isArray(e);if(n!==No&&(!St(e)||!St(i)||s!==Array.isArray(i)||o&&e[o]!==i[o])){Re(t,n,e);return}if(s){if(e.length&&i.length&&(!r||o&&e[0]&&e[0][o]!=null)){let c,u,d,f,m,g,p,y;for(d=0,f=Math.min(i.length,e.length);d<f&&(i[d]===e[d]||o&&i[d]&&e[d]&&i[d][o]===e[d][o]);d++)nn(e[d],i,d,r,o);const v=new Array(e.length),b=new Map;for(f=i.length-1,m=e.length-1;f>=d&&m>=d&&(i[f]===e[m]||o&&i[d]&&e[d]&&i[f][o]===e[m][o]);f--,m--)v[m]=i[f];if(d>m||d>f){for(u=d;u<=m;u++)Re(i,u,e[u]);for(;u<e.length;u++)Re(i,u,v[u]),nn(e[u],i,u,r,o);i.length>e.length&&Re(i,"length",e.length);return}for(p=new Array(m+1),u=m;u>=d;u--)g=e[u],y=o&&g?g[o]:g,c=b.get(y),p[u]=c===void 0?-1:c,b.set(y,u);for(c=d;c<=f;c++)g=i[c],y=o&&g?g[o]:g,u=b.get(y),u!==void 0&&u!==-1&&(v[u]=i[c],u=p[u],b.set(y,u));for(u=d;u<e.length;u++)u in v?(Re(i,u,v[u]),nn(e[u],i,u,r,o)):Re(i,u,e[u])}else for(let c=0,u=e.length;c<u;c++)nn(e[c],i,c,r,o);i.length>e.length&&Re(i,"length",e.length);return}const a=Object.keys(e);for(let c=0,u=a.length;c<u;c++)nn(e[a[c]],i,a[c],r,o);const l=Object.keys(i);for(let c=0,u=l.length;c<u;c++)e[l[c]]===void 0&&Re(i,l[c],void 0)}function Ad(e,t={}){const{merge:n,key:r="id"}=t,o=tn(e);return i=>{if(!St(i)||!St(o))return o;const s=nn(o,{[No]:i},No,n,r);return s===void 0?i:s}}function Xs(e,t,n=0){localStorage.setItem(e,JSON.stringify({value:t,ttl:new Date().getTime()+n}))}function Js(e){const t=localStorage.getItem(e);if(!t)return null;const n=JSON.parse(t),r=new Date;return n.ttl!==0&&r.getTime()>n.ttl?(localStorage.removeItem(e),null):n.value}function Qs(e,t,n){return ze(()=>{const r=Js(e),[o,i]=Zs(r?JSON.parse(r):t);return V(()=>Xs(e,JSON.stringify(o),n)),[o,i]})}function Md(e,t,n){return ze(()=>{const r=Js(e),[o,i]=L(r?JSON.parse(r):t);return V(()=>Xs(e,JSON.stringify(o()),n)),[o,i]})}Md("lang","en");function ea(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=ea(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Id(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=ea(e))&&(r&&(r+=" "),r+=t);return r}const Fo="-";function Ld(e){const t=Nd(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function o(s){const a=s.split(Fo);return a[0]===""&&a.length!==1&&a.shift(),ta(a,t)||Rd(s)}function i(s,a){const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}return{getClassGroupId:o,getConflictingClassGroupIds:i}}function ta(e,t){if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?ta(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(Fo);return t.validators.find(({validator:s})=>s(i))?.classGroupId}const na=/^\[(.+)\]$/;function Rd(e){if(na.test(e)){const t=na.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function Nd(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return _d(Object.entries(e.classGroups),n).forEach(([i,s])=>{_o(s,r,i,t)}),r}function _o(e,t,n,r){e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:ra(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(Fd(o)){_o(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{_o(s,ra(t,i),n,r)})})}function ra(e,t){let n=e;return t.split(Fo).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function Fd(e){return e.isThemeGetter}function _d(e,t){return t?e.map(([n,r])=>{const o=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,a])=>[t+s,a])):i);return[n,o]}):e}function Vd(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;function o(i,s){n.set(i,s),t++,t>e&&(t=0,r=n,n=new Map)}return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=r.get(i))!==void 0)return o(i,s),s},set(i,s){n.has(i)?n.set(i,s):o(i,s)}}}const oa="!";function Kd(e){const t=e.separator,n=t.length===1,r=t[0],o=t.length;return function(s){const a=[];let l=0,c=0,u;for(let p=0;p<s.length;p++){let y=s[p];if(l===0){if(y===r&&(n||s.slice(p,p+o)===t)){a.push(s.slice(c,p)),c=p+o;continue}if(y==="/"){u=p;continue}}y==="["?l++:y==="]"&&l--}const d=a.length===0?s:s.substring(c),f=d.startsWith(oa),m=f?d.substring(1):d,g=u&&u>c?u-c:void 0;return{modifiers:a,hasImportantModifier:f,baseClassName:m,maybePostfixModifierPosition:g}}}function zd(e){if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t}function Bd(e){return{cache:Vd(e.cacheSize),splitModifiers:Kd(e),...Ld(e)}}const jd=/\s+/;function Ud(e,t){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=new Set;return e.trim().split(jd).map(s=>{const{modifiers:a,hasImportantModifier:l,baseClassName:c,maybePostfixModifierPosition:u}=n(s);let d=r(u?c.substring(0,u):c),f=!!u;if(!d){if(!u)return{isTailwindClass:!1,originalClassName:s};if(d=r(c),!d)return{isTailwindClass:!1,originalClassName:s};f=!1}const m=zd(a).join(":");return{isTailwindClass:!0,modifierId:l?m+oa:m,classGroupId:d,originalClassName:s,hasPostfixModifier:f}}).reverse().filter(s=>{if(!s.isTailwindClass)return!0;const{modifierId:a,classGroupId:l,hasPostfixModifier:c}=s,u=a+l;return i.has(u)?!1:(i.add(u),o(l,c).forEach(d=>i.add(a+d)),!0)}).reverse().map(s=>s.originalClassName).join(" ")}function Wd(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=ia(t))&&(r&&(r+=" "),r+=n);return r}function ia(e){if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=ia(e[r]))&&(n&&(n+=" "),n+=t);return n}function Hd(e,...t){let n,r,o,i=s;function s(l){const c=t.reduce((u,d)=>d(u),e());return n=Bd(c),r=n.cache.get,o=n.cache.set,i=a,a(l)}function a(l){const c=r(l);if(c)return c;const u=Ud(l,n);return o(l,u),u}return function(){return i(Wd.apply(null,arguments))}}function ae(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const sa=/^\[(?:([a-z-]+):)?(.+)\]$/i,Yd=/^\d+\/\d+$/,Gd=new Set(["px","full","screen"]),qd=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Zd=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Xd=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Jd=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Qd=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function ot(e){return Vt(e)||Gd.has(e)||Yd.test(e)}function Et(e){return rn(e,"length",lf)}function Vt(e){return!!e&&!Number.isNaN(Number(e))}function Pr(e){return rn(e,"number",Vt)}function Kn(e){return!!e&&Number.isInteger(Number(e))}function ef(e){return e.endsWith("%")&&Vt(e.slice(0,-1))}function q(e){return sa.test(e)}function Pt(e){return qd.test(e)}const tf=new Set(["length","size","percentage"]);function nf(e){return rn(e,tf,aa)}function rf(e){return rn(e,"position",aa)}const of=new Set(["image","url"]);function sf(e){return rn(e,of,uf)}function af(e){return rn(e,"",cf)}function zn(){return!0}function rn(e,t,n){const r=sa.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function lf(e){return Zd.test(e)&&!Xd.test(e)}function aa(){return!1}function cf(e){return Jd.test(e)}function uf(e){return Qd.test(e)}function df(){const e=ae("colors"),t=ae("spacing"),n=ae("blur"),r=ae("brightness"),o=ae("borderColor"),i=ae("borderRadius"),s=ae("borderSpacing"),a=ae("borderWidth"),l=ae("contrast"),c=ae("grayscale"),u=ae("hueRotate"),d=ae("invert"),f=ae("gap"),m=ae("gradientColorStops"),g=ae("gradientColorStopPositions"),p=ae("inset"),y=ae("margin"),v=ae("opacity"),b=ae("padding"),w=ae("saturate"),x=ae("scale"),T=ae("sepia"),O=ae("skew"),k=ae("space"),j=ae("translate"),P=()=>["auto","contain","none"],M=()=>["auto","hidden","clip","visible","scroll"],$=()=>["auto",q,t],R=()=>[q,t],se=()=>["",ot,Et],J=()=>["auto",Vt,q],re=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],N=()=>["solid","dashed","dotted","double","none"],X=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],ge=()=>["start","end","center","between","around","evenly","stretch"],E=()=>["","0",q],S=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>[Vt,Pr],W=()=>[Vt,q];return{cacheSize:500,separator:":",theme:{colors:[zn],spacing:[ot,Et],blur:["none","",Pt,q],brightness:C(),borderColor:[e],borderRadius:["none","","full",Pt,q],borderSpacing:R(),borderWidth:se(),contrast:C(),grayscale:E(),hueRotate:W(),invert:E(),gap:R(),gradientColorStops:[e],gradientColorStopPositions:[ef,Et],inset:$(),margin:$(),opacity:C(),padding:R(),saturate:C(),scale:C(),sepia:E(),skew:W(),space:R(),translate:R()},classGroups:{aspect:[{aspect:["auto","square","video",q]}],container:["container"],columns:[{columns:[Pt]}],"break-after":[{"break-after":S()}],"break-before":[{"break-before":S()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...re(),q]}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Kn,q]}],basis:[{basis:$()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",q]}],grow:[{grow:E()}],shrink:[{shrink:E()}],order:[{order:["first","last","none",Kn,q]}],"grid-cols":[{"grid-cols":[zn]}],"col-start-end":[{col:["auto",{span:["full",Kn,q]},q]}],"col-start":[{"col-start":J()}],"col-end":[{"col-end":J()}],"grid-rows":[{"grid-rows":[zn]}],"row-start-end":[{row:["auto",{span:[Kn,q]},q]}],"row-start":[{"row-start":J()}],"row-end":[{"row-end":J()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",q]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",q]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...ge()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ge(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ge(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[k]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[k]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",q,t]}],"min-w":[{"min-w":[q,t,"min","max","fit"]}],"max-w":[{"max-w":[q,t,"none","full","min","max","fit","prose",{screen:[Pt]},Pt]}],h:[{h:[q,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[q,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[q,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[q,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Pt,Et]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Pr]}],"font-family":[{font:[zn]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",q]}],"line-clamp":[{"line-clamp":["none",Vt,Pr]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ot,q]}],"list-image":[{"list-image":["none",q]}],"list-style-type":[{list:["none","disc","decimal",q]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...N(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ot,Et]}],"underline-offset":[{"underline-offset":["auto",ot,q]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",q]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",q]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...re(),rf]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",nf]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},sf]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...N(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:N()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...N()]}],"outline-offset":[{"outline-offset":[ot,q]}],"outline-w":[{outline:[ot,Et]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:se()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[ot,Et]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Pt,af]}],"shadow-color":[{shadow:[zn]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":X()}],"bg-blend":[{"bg-blend":X()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Pt,q]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[w]}],sepia:[{sepia:[T]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[T]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",q]}],duration:[{duration:W()}],ease:[{ease:["linear","in","out","in-out",q]}],delay:[{delay:W()}],animate:[{animate:["none","spin","ping","pulse","bounce",q]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[Kn,q]}],"translate-x":[{"translate-x":[j]}],"translate-y":[{"translate-y":[j]}],"skew-x":[{"skew-x":[O]}],"skew-y":[{"skew-y":[O]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",q]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",q]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",q]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ot,Et,Pr]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const ff=Hd(df);function le(...e){return ff(Id(e))}function gf(e){try{if(!e)return;const t=document.querySelector(":root");if(!t)throw new Error("could not find root layer");console.log("loading theme for",e.title),e.style.primary&&t.style.setProperty("--primary",Cr(e.style.primary)),e.style.primaryForeground&&t.style.setProperty("--primary-foreground",Cr(e.style.primaryForeground)),e.style.background&&t.style.setProperty("--background",Cr(e.style.background)),e.style.foreground&&t.style.setProperty("--foreground",Cr(e.style.foreground))}catch(t){console.error("failed to load widget theme",t)}}function Cr(e){let t=0,n=0,r=0;e.length==4?(t="0x"+e[1]+e[1],n="0x"+e[2]+e[2],r="0x"+e[3]+e[3]):e.length==7&&(t="0x"+e[1]+e[2],n="0x"+e[3]+e[4],r="0x"+e[5]+e[6]),t/=255,n/=255,r/=255;let o=Math.min(t,n,r),i=Math.max(t,n,r),s=i-o,a=0,l=0,c=0;return s==0?a=0:i==t?a=(n-r)/s%6:i==n?a=(r-t)/s+2:a=(t-n)/s+4,a=Math.round(a*60),a<0&&(a+=360),c=(i+o)/2,l=s==0?0:s/(1-Math.abs(2*c-1)),l=+(l*100).toFixed(1),c=+(c*100).toFixed(1),a+","+l+"%,"+c+"%"}function hf(e){if(e.includes("<a")||e.includes("</a>")||e.includes('href="')||e.includes('target="_blank"'))return e;const t=/(https?\:\/\/)(www\.)?[^\s]+\.[^\s\<]+/g;return e.replace(t,n=>{let r=n;return n.includes("<br>")?n:(r.startsWith("http")||(r="http://"+n),`<a class="underline" href="${r}" target="_blank">${n}</a>`)})}function pf(e){return e&&e.replace(/\n/gm,"<br>").replace(/(?:\*)([^*]*)(?:\*)/gm,"<strong>$1</strong>").replace(/(?:_)([^_]*)(?:_)/gm,"<i>$1</i>").replace(/(?:~)([^~]*)(?:~)/gm,"<strike>$1</strike>").replace(/(?:```)([^```]*)(?:```)/gm,"<tt>$1</tt>")}function Bn(){const e=document.querySelector("smarttalks-widget");let t;if(e?t=e.shadowRoot?.getElementById("smarttalks-widget"):t=document.getElementById("smarttalks-widget"),!t)throw new Error("could not find widget element");return t}const Vo="https://voyager.guide121.dev";function mf(e){return{type:"chat",_id:e._id,accountId:e.accountId,fullscreen:e.settings.fullScreen,mode:"standard",dismissable:e.settings.closeButton,avatar:e.settings.avatar,title:e.settings.title,subtitle:e.settings.subtitle,balloonMessage:e.settings.balloonMessage,openDelay:e.settings.automatedOpen?2e3:0,chat:{flowId:e.typeId},style:{width:+e.settings.style.width.replace("px",""),height:+e.settings.style.height.replace("px",""),position:"right",primary:e.settings.style.headerBackground,primaryForeground:e.settings.style.color,background:"#FAFAFA",foreground:"#000000"},showSettings:!1}}function yf(e){return{type:"form",_id:e._id,accountId:e.accountId,fullscreen:e.settings.fullScreen,mode:"static",dismissable:e.settings.closeButton,avatar:e.settings.avatar,title:e.settings.title,subtitle:e.settings.subtitle,balloonMessage:e.settings.balloonMessage,openDelay:e.settings.automatedOpen?2e3:0,form:{formId:e.typeId},style:{width:+e.settings.style.width.replace("px",""),height:+e.settings.style.height.replace("px",""),position:"right",primary:e.settings.style.headerBackground,primaryForeground:e.settings.style.color,background:"#FAFAFA",foreground:"#000000"}}}const vf=async e=>{const t=e.split("?"),n=t[0],r=t[1]?.split("&")??[];if(!n)return;console.log("fetching widget:",n);const o=`${Vo}/v1/webhooks/widget/${n}`,i=await(await fetch(o)).json();return i.type==="flow"?mf(i):i.type==="entity"?yf(i):(i.type==="chat"&&r.includes("showSettings")&&(i.showSettings=!0),i)},[bf,wf]=L(""),[on]=ze(()=>Os(bf,vf)),xf=()=>{if(on()?.type==="chat")return on()},Sf=()=>{if(on()?.type==="form")return on()};ze(()=>V(()=>gf(on())));const Pe=()=>({setWidgetId:wf,widget:on,chatWidget:xf,formWidget:Sf});function la(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=la(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function Ef(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=la(e))&&(r&&(r+=" "),r+=t);return r}const ca=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,ua=Ef,Pf=(e,t)=>n=>{var r;if(t?.variants==null)return ua(e,n?.class,n?.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(c=>{const u=n?.[c],d=i?.[c];if(u===null)return null;const f=ca(u)||ca(d);return o[c][f]}),a=n&&Object.entries(n).reduce((c,u)=>{let[d,f]=u;return f===void 0||(c[d]=f),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:d,className:f,...m}=u;return Object.entries(m).every(g=>{let[p,y]=g;return Array.isArray(y)?y.includes({...i,...a}[p]):{...i,...a}[p]===y})?[...c,d,f]:c},[]);return ua(e,s,l,n?.class,n?.className)};var Cf=B("<button>");const jn=Pf("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"size-10"}},defaultVariants:{variant:"default",size:"default"}}),Ce=e=>{const[,t]=U(e,["variant","size","class"]);return(()=>{var n=Cf();return Xt(n,I({get class(){return le(jn({variant:e.variant,size:e.size}),e.class)}},t),!1,!1),n})()};var Of=B('<img alt="widget logo">');const da=e=>{const[,t]=U(e,["class","src"]);return(()=>{var n=Of();return Xt(n,I({get src(){return e.src??"/src/assets/izi.jpeg"},get class(){return le("size-12 bg-transparent rounded-full",e.class)}},t),!1,!1),n})()};var Df=B('<div class="flex space-x-4"><div class="flex flex-col"><span class="font-bold md:text-lg"></span><span class="text-xs md:text-sm truncate">');const kf=()=>{const{chatWidget:e}=Pe();return(()=>{var t=Df(),n=t.firstChild,r=n.firstChild,o=r.nextSibling;return F(t,h(da,{get src(){return e()?.avatar}}),n),F(r,()=>e()?.title??"Izi"),F(o,()=>e()?.subtitle??"SmartTalks.ai"),t})()};var Tf=B("<svg stroke-width=0>");function pe(e,t){const n=I(e.a,t),[r,o]=U(n,["src"]),[i,s]=L(""),a=A(()=>t.title?`${e.c}<title>${t.title}</title>`:e.c);return V(()=>s(a())),Z(()=>{s("")}),(()=>{var l=Tf();return Xt(l,I({get stroke(){return e.a?.stroke},get color(){return t.color||"currentColor"},get fill(){return t.color||"currentColor"},get style(){return{...t.style,overflow:"visible"}}},o,{get height(){return t.size||"1em"},get width(){return t.size||"1em"},xmlns:"http://www.w3.org/2000/svg",get innerHTML(){return i()}}),!0,!0),F(l,()=>md),l})()}function $f(e){return pe({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path fill-rule="evenodd" d="M12.75 8a4.5 4.5 0 0 1-8.61 1.834l-1.391.565A6.001 6.001 0 0 0 14.25 8 6 6 0 0 0 3.5 4.334V2.5H2v4l.75.75h3.5v-1.5H4.352A4.5 4.5 0 0 1 12.75 8z" clip-rule="evenodd"/>'},e)}function Af(e){return pe({a:{fill:"currentColor",viewBox:"0 0 24 24"},c:'<path d="m3.463 12.86-.005-.07.005.07zm7.264.69-3.034-3.049 1.014-1.014 3.209 3.225 3.163-3.163 1.014 1.014-3.034 3.034 3.034 3.05-1.014 1.014-3.209-3.225L8.707 17.6l-1.014-1.014 3.034-3.034z"/><path fill-rule="evenodd" d="M16.933 5.003V6h1.345l2.843-2.842 1.014 1.014-2.692 2.691.033.085a13.75 13.75 0 0 1 .885 4.912c0 .335-.011.667-.034.995l-.005.075h3.54v1.434h-3.72l-.01.058c-.303 1.653-.891 3.16-1.692 4.429l-.06.094 3.423 3.44-1.017 1.012-3.274-3.29-.099.11c-1.479 1.654-3.395 2.646-5.483 2.646-2.12 0-4.063-1.023-5.552-2.723l-.098-.113-3.209 3.208-1.014-1.014 3.366-3.365-.059-.095c-.772-1.25-1.34-2.725-1.636-4.34l-.01-.057H0V12.93h3.538l-.005-.075a14.23 14.23 0 0 1-.034-.995c0-1.743.31-3.39.863-4.854l.032-.084-2.762-2.776L2.65 3.135 5.5 6h1.427v-.997a5.003 5.003 0 0 1 10.006 0zm-8.572 0V6H15.5v-.997a3.569 3.569 0 0 0-7.138 0zm9.8 2.522-.034-.09H5.733l-.034.09a12.328 12.328 0 0 0-.766 4.335c0 2.76.862 5.201 2.184 6.92 1.32 1.716 3.036 2.649 4.813 2.649 1.777 0 3.492-.933 4.813-2.65 1.322-1.718 2.184-4.16 2.184-6.919 0-1.574-.28-3.044-.766-4.335z" clip-rule="evenodd"/>'},e)}function Mf(e){return pe({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path fill-rule="evenodd" d="M7.444 13.832a1 1 0 1 0 1.111-1.663 1 1 0 0 0-1.11 1.662zM8 9a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm0-5a1 1 0 1 1 0-2 1 1 0 0 1 0 2z" clip-rule="evenodd"/>'},e)}function If(e){return pe({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path fill-rule="evenodd" d="M13.917 7A6.002 6.002 0 0 0 2.083 7H1.071a7.002 7.002 0 0 1 13.858 0h-1.012z" clip-rule="evenodd"/>'},e)}function Lf(e){return pe({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="m1 1.91.78-.41L15 7.449v.95L1.78 14.33 1 13.91 2.583 8 1 1.91ZM3.612 8.5 2.33 13.13 13.5 7.9 2.33 2.839l1.282 4.6L9 7.5v1H3.612Z"/>'},e)}function Rf(e){return(...t)=>{for(const n of e)n&&n(...t)}}var D=e=>typeof e=="function"&&!e.length?e():e,fa=e=>Array.isArray(e)?e:e?[e]:[];function Nf(e,...t){return typeof e=="function"?e(...t):e}var Ff=Z;function _f(e,t,n,r){return e.addEventListener(t,n,r),Ff(e.removeEventListener.bind(e,t,n,r))}function Vf(e,t,n,r){const o=()=>{fa(D(e)).forEach(i=>{i&&fa(D(t)).forEach(s=>_f(i,s,n,r))})};typeof e=="function"?V(o):ue(o)}var Kf={equals:!1};function zf(e){return(...t)=>{for(const n of e)n&&n(...t)}}function Bf(e){return(...t)=>{for(let n=e.length-1;n>=0;n--){const r=e[n];r&&r(...t)}}}var Ko=e=>typeof e=="function"&&!e.length?e():e;function Or(){return!0}var jf={get(e,t,n){return t===Ie?n:e.get(t)},has(e,t){return e.has(t)},set:Or,deleteProperty:Or,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:Or,deleteProperty:Or}},ownKeys(e){return e.keys()}},Uf=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function ga(e){const t={};let n;for(;n=Uf.exec(e);)t[n[1]]=n[2];return t}function Wf(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=ga(e)}else typeof t=="string"&&(t=ga(t));return{...e,...t}}var zo=(e,t,n)=>{let r;for(const o of e){const i=Ko(o)[t];r?i&&(r=n(r,i)):r=i}return r};function Hf(...e){const t=Array.isArray(e[0]),n=t?e[0]:e;if(n.length===1)return n[0];const r=t&&e[1]?.reverseEventHandlers?Bf:zf,o={};for(const s of n){const a=Ko(s);for(const l in a)if(l[0]==="o"&&l[1]==="n"&&l[2]){const c=a[l],u=l.toLowerCase(),d=typeof c=="function"?c:Array.isArray(c)?c.length===1?c[0]:c[0].bind(void 0,c[1]):void 0;d?o[u]?o[u].push(d):o[u]=[d]:delete o[u]}}const i=I(...n);return new Proxy({get(s){if(typeof s!="string")return Reflect.get(i,s);if(s==="style")return zo(n,"style",Wf);if(s==="ref"){const a=[];for(const l of n){const c=Ko(l)[s];typeof c=="function"&&a.push(c)}return r(a)}if(s[0]==="o"&&s[1]==="n"&&s[2]){const a=o[s.toLowerCase()];return a?r(a):Reflect.get(i,s)}return s==="class"||s==="className"?zo(n,s,(a,l)=>`${a} ${l}`):s==="classList"?zo(n,s,(a,l)=>({...a,...l})):Reflect.get(i,s)},has(s){return Reflect.has(i,s)},keys(){return Object.keys(i)}},jf)}function Ct(...e){return Rf(e)}function Yf(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function Bo(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Gf(e){return typeof e=="number"}function qf(e){return Array.isArray(e)}function sn(e){return Object.prototype.toString.call(e)==="[object String]"}function Zf(e){return typeof e=="function"}function ha(e){return t=>`${e()}-${t}`}function Ze(e,t){return e?e===t||e.contains(t):!1}function Un(e,t=!1){const{activeElement:n}=it(e);if(!n?.nodeName)return null;if(pa(n)&&n.contentDocument)return Un(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const o=it(n).getElementById(r);if(o)return o}}return n}function it(e){return e?e.ownerDocument||e:document}function pa(e){return e.tagName==="IFRAME"}var ma=(e=>(e.Escape="Escape",e.Enter="Enter",e.Tab="Tab",e.Space=" ",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.ArrowUp="ArrowUp",e.End="End",e.Home="Home",e.PageDown="PageDown",e.PageUp="PageUp",e))(ma||{});function jo(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.userAgentData?.platform||window.navigator.platform):!1}function Dr(){return jo(/^Mac/i)}function Xf(){return jo(/^iPhone/i)}function Jf(){return jo(/^iPad/i)||Dr()&&navigator.maxTouchPoints>1}function Qf(){return Xf()||Jf()}function eg(){return Dr()||Qf()}function Oe(e,t){return t&&(Zf(t)?t(e):t[0](t[1],e)),e?.defaultPrevented}function Ne(e){return t=>{for(const n of e)Oe(t,n)}}function tg(e){return Dr()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function xe(e){if(e)if(ng())e.focus({preventScroll:!0});else{const t=rg(e);e.focus(),og(t)}}var kr=null;function ng(){if(kr==null){kr=!1;try{document.createElement("div").focus({get preventScroll(){return kr=!0,!0}})}catch{}}return kr}function rg(e){let t=e.parentNode;const n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function og(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var ya=["input:not([type='hidden']):not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","[tabindex]","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]:not([contenteditable='false'])"],ig=[...ya,'[tabindex]:not([tabindex="-1"]):not([disabled])'],Uo=ya.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])",sg=ig.join(':not([hidden]):not([tabindex="-1"]),');function va(e,t){const r=Array.from(e.querySelectorAll(Uo)).filter(ba);return t&&ba(e)&&r.unshift(e),r.forEach((o,i)=>{if(pa(o)&&o.contentDocument){const s=o.contentDocument.body,a=va(s,!1);r.splice(i,1,...a)}}),r}function ba(e){return wa(e)&&!ag(e)}function wa(e){return e.matches(Uo)&&Wo(e)}function ag(e){return parseInt(e.getAttribute("tabindex")||"0",10)<0}function Wo(e,t){return e.nodeName!=="#comment"&&lg(e)&&cg(e,t)&&(!e.parentElement||Wo(e.parentElement,e))}function lg(e){if(!(e instanceof HTMLElement)&&!(e instanceof SVGElement))return!1;const{display:t,visibility:n}=e.style;let r=t!=="none"&&n!=="hidden"&&n!=="collapse";if(r){if(!e.ownerDocument.defaultView)return r;const{getComputedStyle:o}=e.ownerDocument.defaultView,{display:i,visibility:s}=o(e);r=i!=="none"&&s!=="hidden"&&s!=="collapse"}return r}function cg(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function ug(e,t){return t.some(n=>n.contains(e))}function dg(e,t,n){const r=t?.tabbable?sg:Uo,o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(i){return t?.from?.contains(i)?NodeFilter.FILTER_REJECT:i.matches(r)&&Wo(i)&&(!n||ug(i,n))&&(!t?.accept||t.accept(i))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t?.from&&(o.currentNode=t.from),o}function xa(e){for(;e&&!fg(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}function fg(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function gg(){}function hg(e,t){const[n,r]=e;let o=!1;const i=t.length;for(let s=i,a=0,l=s-1;a<s;l=a++){const[c,u]=t[a],[d,f]=t[l],[,m]=t[l===0?s-1:l-1]||[0,0],g=(u-f)*(n-c)-(c-d)*(r-u);if(f<u){if(r>=f&&r<u){if(g===0)return!0;g>0&&(r===f?r>m&&(o=!o):o=!o)}}else if(u<f){if(r>u&&r<=f){if(g===0)return!0;g<0&&(r===f?r<m&&(o=!o):o=!o)}}else if(r==u&&(n>=d&&n<=c||n>=c&&n<=d))return!0}return o}function De(e,t){return I(e,t)}var Wn=new Map,Sa=new Set;function Ea(){if(typeof window>"u")return;const e=n=>{if(!n.target)return;let r=Wn.get(n.target);r||(r=new Set,Wn.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=Wn.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),Wn.delete(n.target)),Wn.size===0)){for(const o of Sa)o();Sa.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document<"u"&&(document.readyState!=="loading"?Ea():document.addEventListener("DOMContentLoaded",Ea));function Ho(e,t){const n=Pa(e,t,"left"),r=Pa(e,t,"top"),o=t.offsetWidth,i=t.offsetHeight;let s=e.scrollLeft,a=e.scrollTop;const l=s+e.offsetWidth,c=a+e.offsetHeight;n<=s?s=n:n+o>l&&(s+=n+o-l),r<=a?a=r:r+i>c&&(a+=r+i-c),e.scrollLeft=s,e.scrollTop=a}function Pa(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let o=0;for(;t.offsetParent&&(o+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){o-=e[r];break}t=t.offsetParent}return o}function pg(e,t){if(document.contains(e)){const n=document.scrollingElement||document.documentElement;if(window.getComputedStyle(n).overflow==="hidden"){let o=xa(e);for(;e&&o&&e!==n&&o!==n;)Ho(o,e),e=o,o=xa(e)}else{const{left:o,top:i}=e.getBoundingClientRect();e?.scrollIntoView?.({block:"nearest"});const{left:s,top:a}=e.getBoundingClientRect();(Math.abs(o-s)>1||Math.abs(i-a)>1)&&(t?.containingElement?.scrollIntoView?.({block:"center",inline:"center"}),e.scrollIntoView?.({block:"nearest"}))}}}var mg={border:"0",clip:"rect(0 0 0 0)","clip-path":"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:"0",position:"absolute",width:"1px","white-space":"nowrap"};function Yo(e){let t=e.startIndex??0;const n=e.startLevel??0,r=[],o=l=>{if(l==null)return"";const c=e.getKey??"key",u=sn(c)?l[c]:c(l);return u!=null?String(u):""},i=l=>{if(l==null)return"";const c=e.getTextValue??"textValue",u=sn(c)?l[c]:c(l);return u!=null?String(u):""},s=l=>{if(l==null)return!1;const c=e.getDisabled??"disabled";return(sn(c)?l[c]:c(l))??!1},a=l=>{if(l!=null)return sn(e.getSectionChildren)?l[e.getSectionChildren]:e.getSectionChildren?.(l)};for(const l of e.dataSource){if(sn(l)||Gf(l)){r.push({type:"item",rawValue:l,key:String(l),textValue:String(l),disabled:s(l),level:n,index:t}),t++;continue}if(a(l)!=null){r.push({type:"section",rawValue:l,key:"",textValue:"",disabled:!1,level:n,index:t}),t++;const c=a(l)??[];if(c.length>0){const u=Yo({dataSource:c,getKey:e.getKey,getTextValue:e.getTextValue,getDisabled:e.getDisabled,getSectionChildren:e.getSectionChildren,startIndex:t,startLevel:n+1});r.push(...u),t+=u.length}}else r.push({type:"item",rawValue:l,key:o(l),textValue:i(l),disabled:s(l),level:n,index:t}),t++}return r}/*!
1
+ (function(dr){typeof define=="function"&&define.amd?define(dr):dr()})(function(){"use strict";function dr(e){return Object.keys(e).reduce((n,r)=>{const o=e[r];return n[r]=Object.assign({},o),xs(o.value)&&!Ru(o.value)&&!Array.isArray(o.value)&&(n[r].value=Object.assign({},o.value)),Array.isArray(o.value)&&(n[r].value=o.value.slice(0)),n},{})}function Au(e){return e?Object.keys(e).reduce((n,r)=>{const o=e[r];return n[r]=xs(o)&&"value"in o?o:{value:o},n[r].attribute||(n[r].attribute=Lu(r)),n[r].parse="parse"in n[r]?n[r].parse:typeof n[r].value!="string",n},{}):{}}function Mu(e){return Object.keys(e).reduce((n,r)=>(n[r]=e[r].value,n),{})}function Iu(e,t){const n=dr(t);return Object.keys(t).forEach(o=>{const i=n[o],s=e.getAttribute(i.attribute),a=e[o];s&&(i.value=i.parse?bs(s):s),a!=null&&(i.value=Array.isArray(a)?a.slice(0):a),i.reflect&&ws(e,i.attribute,i.value,!!i.parse),Object.defineProperty(e,o,{get(){return i.value},set(l){const c=i.value;i.value=l,i.reflect&&ws(this,i.attribute,i.value,!!i.parse);for(let u=0,d=this.__propertyChangedCallbacks.length;u<d;u++)this.__propertyChangedCallbacks[u](o,l,c)},enumerable:!0,configurable:!0})}),n}function bs(e){if(e)try{return JSON.parse(e)}catch{return e}}function ws(e,t,n,r){if(n==null||n===!1)return e.removeAttribute(t);let o=r?JSON.stringify(n):n;e.__updating[t]=!0,o==="true"&&(o=""),e.setAttribute(t,o),Promise.resolve().then(()=>delete e.__updating[t])}function Lu(e){return e.replace(/\.?([A-Z]+)/g,(t,n)=>"-"+n.toLowerCase()).replace("_","-").replace(/^-/,"")}function xs(e){return e!=null&&(typeof e=="object"||typeof e=="function")}function Ru(e){return Object.prototype.toString.call(e)==="[object Function]"}function Nu(e){return typeof e=="function"&&e.toString().indexOf("class")===0}let wo;function Fu(e,t){const n=Object.keys(t);return class extends e{static get observedAttributes(){return n.map(o=>t[o].attribute)}constructor(){super(),this.__initialized=!1,this.__released=!1,this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props={}}connectedCallback(){if(this.__initialized)return;this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props=Iu(this,t);const o=Mu(this.props),i=this.Component,s=wo;try{wo=this,this.__initialized=!0,Nu(i)?new i(o,{element:this}):i(o,{element:this})}finally{wo=s}}async disconnectedCallback(){if(await Promise.resolve(),this.isConnected)return;this.__propertyChangedCallbacks.length=0;let o=null;for(;o=this.__releaseCallbacks.pop();)o(this);delete this.__initialized,this.__released=!0}attributeChangedCallback(o,i,s){if(this.__initialized&&!this.__updating[o]&&(o=this.lookupProp(o),o in t)){if(s==null&&!this[o])return;this[o]=t[o].parse?bs(s):s}}lookupProp(o){if(t)return n.find(i=>o===i||o===t[i].attribute)}get renderRoot(){return this.shadowRoot||this.attachShadow({mode:"open"})}addReleaseCallback(o){this.__releaseCallbacks.push(o)}addPropertyChangedCallback(o){this.__propertyChangedCallbacks.push(o)}}}function _u(e,t={},n={}){const{BaseElement:r=HTMLElement,extension:o,customElements:i=window.customElements}=n;return s=>{if(!e)throw new Error("tag is required to register a Component");let a=i.get(e);return a?(a.prototype.Component=s,a):(a=Fu(r,Au(t)),a.prototype.Component=s,a.prototype.registeredTag=e,i.define(e,a,o),a)}}const Y={context:void 0,registry:void 0};function Ln(e){Y.context=e}const Vu=(e,t)=>e===t,Ie=Symbol("solid-proxy"),fr=Symbol("solid-track"),gr={equals:Vu};let Ss=ks;const et=1,hr=2,Es={owned:null,cleanups:null,context:null,owner:null},xo={};var ee=null;let So=null,Ku=null,oe=null,pe=null,tt=null,pr=0;function ze(e,t){const n=oe,r=ee,o=e.length===0,i=t===void 0?r:t,s=o?Es:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?e:()=>e(()=>Q(()=>br(s)));ee=s,oe=null;try{return nt(a,!0)}finally{oe=n,ee=r}}function L(e,t){t=t?Object.assign({},gr,t):gr;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(o=o(n.value)),Ds(n,o));return[Os.bind(n),r]}function Eo(e,t,n){const r=mr(e,t,!0,et);qt(r)}function ue(e,t,n){const r=mr(e,t,!1,et);qt(r)}function V(e,t,n){Ss=Hu;const r=mr(e,t,!1,et);(!n||!n.render)&&(r.user=!0),tt?tt.push(r):qt(r)}function A(e,t,n){n=n?Object.assign({},gr,n):gr;const r=mr(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,qt(r),Os.bind(r)}function zu(e){return e&&typeof e=="object"&&"then"in e}function Ps(e,t,n){let r,o,i;arguments.length===2&&typeof t=="object"||arguments.length===1?(r=!0,o=e,i=t||{}):(r=e,o=t,i=n||{});let s=null,a=xo,l=null,c=!1,u="initialValue"in i,d=typeof r=="function"&&A(r);const f=new Set,[m,g]=(i.storage||L)(i.initialValue),[p,y]=L(void 0),[v,b]=L(void 0,{equals:!1}),[w,x]=L(u?"ready":"unresolved");if(Y.context){l=`${Y.context.id}${Y.context.count++}`;let P;i.ssrLoadFrom==="initial"?a=i.initialValue:Y.load&&(P=Y.load(l))&&(a=P)}function T(P,M,$,R){return s===P&&(s=null,R!==void 0&&(u=!0),(P===a||M===a)&&i.onHydrated&&queueMicrotask(()=>i.onHydrated(R,{value:M})),a=xo,O(M,$)),M}function O(P,M){nt(()=>{M===void 0&&g(()=>P),x(M!==void 0?"errored":u?"ready":"unresolved"),y(M);for(const $ of f.keys())$.decrement();f.clear()},!1)}function k(){const P=ju,M=m(),$=p();if($!==void 0&&!s)throw $;return oe&&!oe.user&&P&&Eo(()=>{v(),s&&(P.resolved||f.has(P)||(P.increment(),f.add(P)))}),M}function j(P=!0){if(P!==!1&&c)return;c=!1;const M=d?d():r;if(M==null||M===!1){T(s,Q(m));return}const $=a!==xo?a:Q(()=>o(M,{value:m(),refetching:P}));return zu($)?(s=$,"value"in $?($.status==="success"?T(s,$.value,void 0,M):T(s,void 0,void 0,M),$):(c=!0,queueMicrotask(()=>c=!1),nt(()=>{x(u?"refreshing":"pending"),b()},!1),$.then(R=>T($,R,void 0,M),R=>T($,void 0,$s(R),M)))):(T(s,$,void 0,M),$)}return Object.defineProperties(k,{state:{get:()=>w()},error:{get:()=>p()},loading:{get(){const P=w();return P==="pending"||P==="refreshing"}},latest:{get(){if(!u)return k();const P=p();if(P&&!s)throw P;return m()}}}),d?Eo(()=>j(!1)):j(!1),[k,{refetch:j,mutate:g}]}function Be(e){return nt(e,!1)}function Q(e){if(oe===null)return e();const t=oe;oe=null;try{return e()}finally{oe=t}}function Nt(e,t,n){const r=Array.isArray(e);let o,i=n&&n.defer;return s=>{let a;if(r){a=Array(e.length);for(let c=0;c<e.length;c++)a[c]=e[c]()}else a=e();if(i){i=!1;return}const l=Q(()=>t(a,o,s));return o=a,l}}function Ft(e){V(()=>Q(e))}function Z(e){return ee===null||(ee.cleanups===null?ee.cleanups=[e]:ee.cleanups.push(e)),e}function Po(){return oe}function Cs(){return ee}function Bu(e,t){const n=ee,r=oe;ee=e,oe=null;try{return nt(t,!0)}catch(o){Oo(o)}finally{ee=n,oe=r}}function ve(e,t){const n=Symbol("context");return{id:n,Provider:Yu(n),defaultValue:e}}function be(e){return ee&&ee.context&&ee.context[e.id]!==void 0?ee.context[e.id]:e.defaultValue}function Co(e){const t=A(e),n=A(()=>Do(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}let ju;function Os(){if(this.sources&&this.state)if(this.state===et)qt(this);else{const e=pe;pe=null,nt(()=>vr(this),!1),pe=e}if(oe){const e=this.observers?this.observers.length:0;oe.sources?(oe.sources.push(this),oe.sourceSlots.push(e)):(oe.sources=[this],oe.sourceSlots=[e]),this.observers?(this.observers.push(oe),this.observerSlots.push(oe.sources.length-1)):(this.observers=[oe],this.observerSlots=[oe.sources.length-1])}return this.value}function Ds(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&nt(()=>{for(let o=0;o<e.observers.length;o+=1){const i=e.observers[o],s=So&&So.running;s&&So.disposed.has(i),(s?!i.tState:!i.state)&&(i.pure?pe.push(i):tt.push(i),i.observers&&Ts(i)),s||(i.state=et)}if(pe.length>1e6)throw pe=[],new Error},!1)),t}function qt(e){if(!e.fn)return;br(e);const t=pr;Uu(e,e.value,t)}function Uu(e,t,n){let r;const o=ee,i=oe;oe=ee=e;try{r=e.fn(t)}catch(s){return e.pure&&(e.state=et,e.owned&&e.owned.forEach(br),e.owned=null),e.updatedAt=n+1,Oo(s)}finally{oe=i,ee=o}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?Ds(e,r):e.value=r,e.updatedAt=n)}function mr(e,t,n,r=et,o){const i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:ee,context:ee?ee.context:null,pure:n};return ee===null||ee!==Es&&(ee.owned?ee.owned.push(i):ee.owned=[i]),i}function yr(e){if(e.state===0)return;if(e.state===hr)return vr(e);if(e.suspense&&Q(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<pr);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===et)qt(e);else if(e.state===hr){const r=pe;pe=null,nt(()=>vr(e,t[0]),!1),pe=r}}function nt(e,t){if(pe)return e();let n=!1;t||(pe=[]),tt?n=!0:tt=[],pr++;try{const r=e();return Wu(n),r}catch(r){n||(tt=null),pe=null,Oo(r)}}function Wu(e){if(pe&&(ks(pe),pe=null),e)return;const t=tt;tt=null,t.length&&nt(()=>Ss(t),!1)}function ks(e){for(let t=0;t<e.length;t++)yr(e[t])}function Hu(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:yr(r)}if(Y.context){if(Y.count){Y.effects||(Y.effects=[]),Y.effects.push(...e.slice(0,n));return}else Y.effects&&(e=[...Y.effects,...e],n+=Y.effects.length,delete Y.effects);Ln()}for(t=0;t<n;t++)yr(e[t])}function vr(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){const r=e.sources[n];if(r.sources){const o=r.state;o===et?r!==t&&(!r.updatedAt||r.updatedAt<pr)&&yr(r):o===hr&&vr(r,t)}}}function Ts(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=hr,n.pure?pe.push(n):tt.push(n),n.observers&&Ts(n))}}function br(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),r=e.sourceSlots.pop(),o=n.observers;if(o&&o.length){const i=o.pop(),s=n.observerSlots.pop();r<o.length&&(i.sourceSlots[s]=r,o[r]=i,n.observerSlots[r]=s)}}if(e.owned){for(t=e.owned.length-1;t>=0;t--)br(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function $s(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function Oo(e,t=ee){throw $s(e)}function Do(e){if(typeof e=="function"&&!e.length)return Do(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=Do(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function Yu(e,t){return function(r){let o;return ue(()=>o=Q(()=>(ee.context={...ee.context,[e]:r.value},Co(()=>r.children))),void 0),o}}const ko=Symbol("fallback");function wr(e){for(let t=0;t<e.length;t++)e[t]()}function Gu(e,t,n={}){let r=[],o=[],i=[],s=0,a=t.length>1?[]:null;return Z(()=>wr(i)),()=>{let l=e()||[],c,u;return l[fr],Q(()=>{let f=l.length,m,g,p,y,v,b,w,x,T;if(f===0)s!==0&&(wr(i),i=[],r=[],o=[],s=0,a&&(a=[])),n.fallback&&(r=[ko],o[0]=ze(O=>(i[0]=O,n.fallback())),s=1);else if(s===0){for(o=new Array(f),u=0;u<f;u++)r[u]=l[u],o[u]=ze(d);s=f}else{for(p=new Array(f),y=new Array(f),a&&(v=new Array(f)),b=0,w=Math.min(s,f);b<w&&r[b]===l[b];b++);for(w=s-1,x=f-1;w>=b&&x>=b&&r[w]===l[x];w--,x--)p[x]=o[w],y[x]=i[w],a&&(v[x]=a[w]);for(m=new Map,g=new Array(x+1),u=x;u>=b;u--)T=l[u],c=m.get(T),g[u]=c===void 0?-1:c,m.set(T,u);for(c=b;c<=w;c++)T=r[c],u=m.get(T),u!==void 0&&u!==-1?(p[u]=o[c],y[u]=i[c],a&&(v[u]=a[c]),u=g[u],m.set(T,u)):i[c]();for(u=b;u<f;u++)u in p?(o[u]=p[u],i[u]=y[u],a&&(a[u]=v[u],a[u](u))):o[u]=ze(d);o=o.slice(0,s=f),r=l.slice(0)}return o});function d(f){if(i[u]=f,a){const[m,g]=L(u);return a[u]=g,t(l[u],m)}return t(l[u])}}}function qu(e,t,n={}){let r=[],o=[],i=[],s=[],a=0,l;return Z(()=>wr(i)),()=>{const c=e()||[];return c[fr],Q(()=>{if(c.length===0)return a!==0&&(wr(i),i=[],r=[],o=[],a=0,s=[]),n.fallback&&(r=[ko],o[0]=ze(d=>(i[0]=d,n.fallback())),a=1),o;for(r[0]===ko&&(i[0](),i=[],r=[],o=[],a=0),l=0;l<c.length;l++)l<r.length&&r[l]!==c[l]?s[l](()=>c[l]):l>=r.length&&(o[l]=ze(u));for(;l<r.length;l++)i[l]();return a=s.length=i.length=c.length,r=c.slice(0),o=o.slice(0,a)});function u(d){i[l]=d;const[f,m]=L(c[l]);return s[l]=m,t(f,l)}}}function h(e,t){return Q(()=>e(t||{}))}function xr(){return!0}const To={get(e,t,n){return t===Ie?n:e.get(t)},has(e,t){return t===Ie?!0:e.has(t)},set:xr,deleteProperty:xr,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:xr,deleteProperty:xr}},ownKeys(e){return e.keys()}};function $o(e){return(e=typeof e=="function"?e():e)?e:{}}function Zu(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function I(...e){let t=!1;for(let s=0;s<e.length;s++){const a=e[s];t=t||!!a&&Ie in a,e[s]=typeof a=="function"?(t=!0,A(a)):a}if(t)return new Proxy({get(s){for(let a=e.length-1;a>=0;a--){const l=$o(e[a])[s];if(l!==void 0)return l}},has(s){for(let a=e.length-1;a>=0;a--)if(s in $o(e[a]))return!0;return!1},keys(){const s=[];for(let a=0;a<e.length;a++)s.push(...Object.keys($o(e[a])));return[...new Set(s)]}},To);const n={},r=Object.create(null);for(let s=e.length-1;s>=0;s--){const a=e[s];if(!a)continue;const l=Object.getOwnPropertyNames(a);for(let c=l.length-1;c>=0;c--){const u=l[c];if(u==="__proto__"||u==="constructor")continue;const d=Object.getOwnPropertyDescriptor(a,u);if(!r[u])r[u]=d.get?{enumerable:!0,configurable:!0,get:Zu.bind(n[u]=[d.get.bind(a)])}:d.value!==void 0?d:void 0;else{const f=n[u];f&&(d.get?f.push(d.get.bind(a)):d.value!==void 0&&f.push(()=>d.value))}}}const o={},i=Object.keys(r);for(let s=i.length-1;s>=0;s--){const a=i[s],l=r[a];l&&l.get?Object.defineProperty(o,a,l):o[a]=l?l.value:void 0}return o}function U(e,...t){if(Ie in e){const o=new Set(t.length>1?t.flat():t[0]),i=t.map(s=>new Proxy({get(a){return s.includes(a)?e[a]:void 0},has(a){return s.includes(a)&&a in e},keys(){return s.filter(a=>a in e)}},To));return i.push(new Proxy({get(s){return o.has(s)?void 0:e[s]},has(s){return o.has(s)?!1:s in e},keys(){return Object.keys(e).filter(s=>!o.has(s))}},To)),i}const n={},r=t.map(()=>({}));for(const o of Object.getOwnPropertyNames(e)){const i=Object.getOwnPropertyDescriptor(e,o),s=!i.get&&!i.set&&i.enumerable&&i.writable&&i.configurable;let a=!1,l=0;for(const c of t)c.includes(o)&&(a=!0,s?r[l][o]=i.value:Object.defineProperty(r[l],o,i)),++l;a||(s?n[o]=i.value:Object.defineProperty(n,o,i))}return[...r,n]}function Xu(e){let t,n;const r=o=>{const i=Y.context;if(i){const[a,l]=L();Y.count||(Y.count=0),Y.count++,(n||(n=e())).then(c=>{Ln(i),Y.count--,l(()=>c.default),Ln()}),t=a}else if(!t){const[a]=Ps(()=>(n||(n=e())).then(l=>l.default));t=a}let s;return A(()=>(s=t())&&Q(()=>{if(!i)return s(o);const a=Y.context;Ln(i);const l=s(o);return Ln(a),l}))};return r.preload=()=>n||((n=e()).then(o=>t=()=>o.default),n),r}let Ju=0;function Le(){const e=Y.context;return e?`${e.id}${e.count++}`:`cl-${Ju++}`}const As=e=>`Stale read from <${e}>.`;function Zt(e){const t="fallback"in e&&{fallback:()=>e.fallback};return A(Gu(()=>e.each,e.children,t||void 0))}function _t(e){const t="fallback"in e&&{fallback:()=>e.fallback};return A(qu(()=>e.each,e.children,t||void 0))}function ie(e){const t=e.keyed,n=A(()=>e.when,void 0,{equals:(r,o)=>t?r===o:!r==!o});return A(()=>{const r=n();if(r){const o=e.children;return typeof o=="function"&&o.length>0?Q(()=>o(t?r:()=>{if(!Q(n))throw As("Show");return e.when})):o}return e.fallback},void 0,void 0)}function Ms(e){let t=!1;const n=(i,s)=>(t?i[1]===s[1]:!i[1]==!s[1])&&i[2]===s[2],r=Co(()=>e.children),o=A(()=>{let i=r();Array.isArray(i)||(i=[i]);for(let s=0;s<i.length;s++){const a=i[s].when;if(a)return t=!!i[s].keyed,[s,a,i[s]]}return[-1]},void 0,{equals:n});return A(()=>{const[i,s,a]=o();if(i<0)return e.fallback;const l=a.children;return typeof l=="function"&&l.length>0?Q(()=>l(t?s:()=>{if(Q(o)[0]!==i)throw As("Match");return a.when})):l},void 0,void 0)}function Rn(e){return e}const Qu=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],ed=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...Qu]),td=new Set(["innerHTML","textContent","innerText","children"]),nd=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),rd=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});function od(e,t){const n=rd[e];return typeof n=="object"?n[t]?n.$:void 0:n}const id=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),sd=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),ad={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function ld(e,t,n){let r=n.length,o=t.length,i=r,s=0,a=0,l=t[o-1].nextSibling,c=null;for(;s<o||a<i;){if(t[s]===n[a]){s++,a++;continue}for(;t[o-1]===n[i-1];)o--,i--;if(o===s){const u=i<r?a?n[a-1].nextSibling:n[i-a]:l;for(;a<i;)e.insertBefore(n[a++],u)}else if(i===a)for(;s<o;)(!c||!c.has(t[s]))&&t[s].remove(),s++;else if(t[s]===n[i-1]&&n[a]===t[o-1]){const u=t[--o].nextSibling;e.insertBefore(n[a++],t[s++].nextSibling),e.insertBefore(n[--i],u),t[o]=n[i]}else{if(!c){c=new Map;let d=a;for(;d<i;)c.set(n[d],d++)}const u=c.get(t[s]);if(u!=null)if(a<u&&u<i){let d=s,f=1,m;for(;++d<o&&d<i&&!((m=c.get(t[d]))==null||m!==u+f);)f++;if(f>u-a){const g=t[s];for(;a<u;)e.insertBefore(n[a++],g)}else e.replaceChild(n[a++],t[s++])}else s++;else t[s++].remove()}}}const Is="_$DX_DELEGATE";function B(e,t,n){let r;const o=()=>{const s=document.createElement("template");return s.innerHTML=e,n?s.content.firstChild.firstChild:s.content.firstChild},i=t?()=>Q(()=>document.importNode(r||(r=o()),!0)):()=>(r||(r=o())).cloneNode(!0);return i.cloneNode=i,i}function cd(e,t=window.document){const n=t[Is]||(t[Is]=new Set);for(let r=0,o=e.length;r<o;r++){const i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,md))}}function xe(e,t,n){Y.context||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function ud(e,t,n,r){Y.context||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function xt(e,t){Y.context||(t==null?e.removeAttribute("class"):e.className=t)}function dd(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const o=n[0];e.addEventListener(t,n[0]=i=>o.call(e,n[1],i))}else e.addEventListener(t,n)}function fd(e,t,n={}){const r=Object.keys(t||{}),o=Object.keys(n);let i,s;for(i=0,s=o.length;i<s;i++){const a=o[i];!a||a==="undefined"||t[a]||(Ns(e,a,!1),delete n[a])}for(i=0,s=r.length;i<s;i++){const a=r[i],l=!!t[a];!a||a==="undefined"||n[a]===l||!l||(Ns(e,a,!0),n[a]=l)}return n}function Ls(e,t,n){if(!t)return n?xe(e,"style"):t;const r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let o,i;for(i in n)t[i]==null&&r.removeProperty(i),delete n[i];for(i in t)o=t[i],o!==n[i]&&(r.setProperty(i,o),n[i]=o);return n}function Xt(e,t={},n,r){const o={};return r||ue(()=>o.children=Jt(e,t.children,o.children)),ue(()=>t.ref&&t.ref(e)),ue(()=>gd(e,t,n,!0,o,!0)),o}function Rs(e,t,n){return Q(()=>e(t,n))}function F(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return Jt(e,t,r,n);ue(o=>Jt(e,t(),o,n),r)}function gd(e,t,n,r,o={},i=!1){t||(t={});for(const s in o)if(!(s in t)){if(s==="children")continue;o[s]=Fs(e,s,null,o[s],n,i)}for(const s in t){if(s==="children"){r||Jt(e,t.children);continue}const a=t[s];o[s]=Fs(e,s,a,o[s],n,i)}}function hd(e){let t,n;return!Y.context||!(t=Y.registry.get(n=yd()))?e():(Y.completed&&Y.completed.add(t),Y.registry.delete(n),t)}function pd(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Ns(e,t,n){const r=t.trim().split(/\s+/);for(let o=0,i=r.length;o<i;o++)e.classList.toggle(r[o],n)}function Fs(e,t,n,r,o,i){let s,a,l,c,u;if(t==="style")return Ls(e,n,r);if(t==="classList")return fd(e,n,r);if(n===r)return r;if(t==="ref")i||n(e);else if(t.slice(0,3)==="on:"){const d=t.slice(3);r&&e.removeEventListener(d,r),n&&e.addEventListener(d,n)}else if(t.slice(0,10)==="oncapture:"){const d=t.slice(10);r&&e.removeEventListener(d,r,!0),n&&e.addEventListener(d,n,!0)}else if(t.slice(0,2)==="on"){const d=t.slice(2).toLowerCase(),f=id.has(d);if(!f&&r){const m=Array.isArray(r)?r[0]:r;e.removeEventListener(d,m)}(f||n)&&(dd(e,d,n,f),f&&cd([d]))}else if(t.slice(0,5)==="attr:")xe(e,t.slice(5),n);else if((u=t.slice(0,5)==="prop:")||(l=td.has(t))||!o&&((c=od(t,e.tagName))||(a=ed.has(t)))||(s=e.nodeName.includes("-"))){if(u)t=t.slice(5),a=!0;else if(Y.context)return n;t==="class"||t==="className"?xt(e,n):s&&!a&&!l?e[pd(t)]=n:e[c||t]=n}else{const d=o&&t.indexOf(":")>-1&&ad[t.split(":")[0]];d?ud(e,d,t,n):xe(e,nd[t]||t,n)}return n}function md(e){const t=`$$${e.type}`;let n=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==n&&Object.defineProperty(e,"target",{configurable:!0,value:n}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return n||document}}),Y.registry&&!Y.done&&(Y.done=_$HY.done=!0);n;){const r=n[t];if(r&&!n.disabled){const o=n[`${t}Data`];if(o!==void 0?r.call(n,o,e):r.call(n,e),e.cancelBubble)return}n=n._$host||n.parentNode||n.host}}function Jt(e,t,n,r,o){if(Y.context){!n&&(n=[...e.childNodes]);let a=[];for(let l=0;l<n.length;l++){const c=n[l];c.nodeType===8&&c.data.slice(0,2)==="!$"?c.remove():a.push(c)}n=a}for(;typeof n=="function";)n=n();if(t===n)return n;const i=typeof t,s=r!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,i==="string"||i==="number"){if(Y.context)return n;if(i==="number"&&(t=t.toString()),s){let a=n[0];a&&a.nodeType===3?a.data!==t&&(a.data=t):a=document.createTextNode(t),n=Qt(e,n,r,a)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||i==="boolean"){if(Y.context)return n;n=Qt(e,n,r)}else{if(i==="function")return ue(()=>{let a=t();for(;typeof a=="function";)a=a();n=Jt(e,a,n,r)}),()=>n;if(Array.isArray(t)){const a=[],l=n&&Array.isArray(n);if(Ao(a,t,n,o))return ue(()=>n=Jt(e,a,n,r,!0)),()=>n;if(Y.context){if(!a.length)return n;if(r===void 0)return[...e.childNodes];let c=a[0],u=[c];for(;(c=c.nextSibling)!==r;)u.push(c);return n=u}if(a.length===0){if(n=Qt(e,n,r),s)return n}else l?n.length===0?_s(e,a,r):ld(e,n,a):(n&&Qt(e),_s(e,a));n=a}else if(t.nodeType){if(Y.context&&t.parentNode)return n=s?[t]:t;if(Array.isArray(n)){if(s)return n=Qt(e,n,r,t);Qt(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function Ao(e,t,n,r){let o=!1;for(let i=0,s=t.length;i<s;i++){let a=t[i],l=n&&n[i],c;if(!(a==null||a===!0||a===!1))if((c=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))o=Ao(e,a,l)||o;else if(c==="function")if(r){for(;typeof a=="function";)a=a();o=Ao(e,Array.isArray(a)?a:[a],Array.isArray(l)?l:[l])||o}else e.push(a),o=!0;else{const u=String(a);l&&l.nodeType===3&&l.data===u?e.push(l):e.push(document.createTextNode(u))}}return o}function _s(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function Qt(e,t,n,r){if(n===void 0)return e.textContent="";const o=r||document.createTextNode("");if(t.length){let i=!1;for(let s=t.length-1;s>=0;s--){const a=t[s];if(o!==a){const l=a.parentNode===e;!i&&!s?l?e.replaceChild(o,a):e.insertBefore(o,n):l&&a.remove()}else i=!0}}else e.insertBefore(o,n);return[o]}function yd(){const e=Y.context;return`${e.id}${e.count++}`}const vd=!1,bd="http://www.w3.org/2000/svg";function Vs(e,t=!1){return t?document.createElementNS(bd,e):document.createElement(e)}function Mo(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,o=Cs();let i,s=!!Y.context;return V(()=>{s&&(Cs().user=s=!1),i||(i=Bu(o,()=>A(()=>e.children)));const a=r();if(a instanceof HTMLHeadElement){const[l,c]=L(!1),u=()=>c(!0);ze(d=>F(a,()=>l()?d():i(),null)),Z(u)}else{const l=Vs(e.isSVG?"g":"div",e.isSVG),c=t&&l.attachShadow?l.attachShadow({mode:"open"}):l;Object.defineProperty(l,"_$host",{get(){return n.parentNode},configurable:!0}),F(c,i),a.appendChild(l),e.ref&&e.ref(l),Z(()=>a.removeChild(l))}},void 0,{render:!s}),n}function Nn(e){const[t,n]=U(e,["component"]),r=A(()=>t.component);return A(()=>{const o=r();switch(typeof o){case"function":return Q(()=>o(n));case"string":const i=sd.has(o),s=Y.context?hd():Vs(o,i);return Xt(s,n,i),s}})}function wd(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const[o,i]=L(e[t[r]]);Object.defineProperty(n,t[r],{get:o,set(s){i(()=>s)}})}return n}function xd(e){if(e.assignedSlot&&e.assignedSlot._$owner)return e.assignedSlot._$owner;let t=e.parentNode;for(;t&&!t._$owner&&!(t.assignedSlot&&t.assignedSlot._$owner);)t=t.parentNode;return t&&t.assignedSlot?t.assignedSlot._$owner:e._$owner}function Sd(e){return(t,n)=>{const{element:r}=n;return ze(o=>{const i=wd(t);r.addPropertyChangedCallback((a,l)=>i[a]=l),r.addReleaseCallback(()=>{r.renderRoot.textContent="",o()});const s=e(i,n);return F(r.renderRoot,s)},xd(r))}}function Ed(e,t,n){return arguments.length===2&&(n=t,t={}),_u(e,t)(Sd(n))}const Pd='*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Inter,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground));font-feature-settings:"rlig" 1,"calt" 1}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.inset-x-0{left:0;right:0}.-top-2{top:-.5rem}.bottom-0{bottom:0}.bottom-5{bottom:1.25rem}.left-2{left:.5rem}.left-5{left:1.25rem}.left-9{left:2.25rem}.right-5{right:1.25rem}.right-9{right:2.25rem}.z-50{z-index:50}.m-0{margin:0}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-\\[-1rem\\]{margin-left:-1rem;margin-right:-1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.ml-1{margin-left:.25rem}.ml-auto{margin-left:auto}.mt-0{margin-top:0}.mt-2{margin-top:.5rem}.mt-24{margin-top:6rem}.mt-4{margin-top:1rem}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.size-10{width:2.5rem;height:2.5rem}.size-12{width:3rem;height:3rem}.size-2{width:.5rem;height:.5rem}.size-3{width:.75rem;height:.75rem}.size-3\\.5{width:.875rem;height:.875rem}.size-4{width:1rem;height:1rem}.size-8{width:2rem;height:2rem}.size-full{width:100%;height:100%}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-2{height:.5rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\\[85vh\\]{height:85vh}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-\\[80\\%\\]{max-height:80%}.max-h-full{max-height:100%}.min-h-16{min-height:4rem}.w-11\\/12{width:91.666667%}.w-4{width:1rem}.w-5{width:1.25rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-\\[100px\\]{width:100px}.w-\\[90vw\\]{width:90vw}.w-\\[98\\%\\]{width:98%}.w-\\[calc\\(var\\(--reference-width\\)-\\(0\\.75rem\\*2\\)\\)\\]{width:calc(var(--reference-width) - (.75rem * 2))}.w-full{width:100%}.min-w-\\[8rem\\]{min-width:8rem}.max-w-64{max-width:16rem}.max-w-full{max-width:100%}.flex-1{flex:1 1 0%}.flex-none{flex:none}.flex-grow{flex-grow:1}.border-collapse{border-collapse:collapse}.origin-\\[var\\(--kb-menu-content-transform-origin\\)\\]{transform-origin:var(--kb-menu-content-transform-origin)}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce{animation:bounce 1s infinite}@keyframes content-hide{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.96)}}.animate-content-hide{animation:content-hide .2s ease-out}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize{resize:both}.snap-x{scroll-snap-type:x var(--tw-scroll-snap-strictness)}.snap-center{scroll-snap-align:center}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.flex-col{flex-direction:column}.place-content-center{place-content:center}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0px}.gap-0\\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\\.5{gap:.375rem}.gap-2{gap:.5rem}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.25rem * var(--tw-space-x-reverse));margin-left:calc(.25rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.place-self-start{place-self:start}.place-self-end{place-self:end}.place-self-center{place-self:center}.self-start{align-self:flex-start}.self-end{align-self:flex-end}.self-center{align-self:center}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.scroll-smooth{scroll-behavior:smooth}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.text-nowrap{text-wrap:nowrap}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:calc(var(--radius) + 4px)}.rounded-l-xl{border-top-left-radius:calc(var(--radius) + 4px);border-bottom-left-radius:calc(var(--radius) + 4px)}.rounded-r-xl{border-top-right-radius:calc(var(--radius) + 4px);border-bottom-right-radius:calc(var(--radius) + 4px)}.rounded-t-\\[10px\\]{border-top-left-radius:10px;border-top-right-radius:10px}.rounded-tl-xl{border-top-left-radius:calc(var(--radius) + 4px)}.rounded-tr-xl{border-top-right-radius:calc(var(--radius) + 4px)}.border{border-width:1px}.border-input{border-color:hsl(var(--input))}.border-primary{border-color:hsl(var(--primary))}.bg-background{background-color:hsl(var(--background))}.bg-black\\/50{background-color:#00000080}.bg-destructive{background-color:hsl(var(--destructive))}.bg-muted{background-color:hsl(var(--muted))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-slate-200{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity))}.bg-slate-200\\/40{background-color:#e2e8f066}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.fill-current{fill:currentColor}.object-contain{-o-object-fit:contain;object-fit:contain}.p-0{padding:0}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.px-0{padding-left:0;padding-right:0}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0{padding-top:0;padding-bottom:0}.py-0\\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.pb-2{padding-bottom:.5rem}.pl-3{padding-left:.75rem}.pl-8{padding-left:2rem}.pr-1{padding-right:.25rem}.pr-2{padding-right:.5rem}.pt-1{padding-top:.25rem}.text-center{text-align:center}.text-\\[0\\.8rem\\]{font-size:.8rem}.text-\\[10px\\]{font-size:10px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-light{font-weight:300}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.italic{font-style:italic}.leading-none{line-height:1}.tracking-tight{letter-spacing:-.025em}.tracking-widest{letter-spacing:.1em}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{color:hsl(var(--foreground))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-primary\\/40{--tw-shadow-color: hsl(var(--primary) / .4);--tw-shadow: var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.delay-150{transition-delay:.15s}.delay-300{transition-delay:.3s}.duration-300{transition-duration:.3s}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.fade-in-80{--tw-enter-opacity: .8}.duration-300{animation-duration:.3s}.delay-150{animation-delay:.15s}.delay-300{animation-delay:.3s}#smarttalks-widget{--card: 0 0% 100%;--card-foreground: 240 10% 3.9%;--popover: 0 0% 100%;--popover-foreground: 240 10% 3.9%;--secondary: 240 4.8% 95.9%;--secondary-foreground: 240 5.9% 10%;--muted: 240 4.8% 95.9%;--muted-foreground: 240 3.8% 46.1%;--accent: 240 4.8% 95.9%;--accent-foreground: 240 5.9% 10%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 0 0% 98%;--border: 240 5.9% 90%;--input: 240 5.9% 90%;--ring: 346.8 77.2% 49.8%;--radius: .5rem}@media (max-width: 640px){.container{padding-left:1rem;padding-right:1rem}}::-webkit-scrollbar{width:.5rem;height:.4rem}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{border-radius:var(--radius);--tw-bg-opacity: 1;background-color:rgb(203 213 225 / var(--tw-bg-opacity))}::-webkit-scrollbar-thumb:hover{--tw-bg-opacity: 1;background-color:rgb(148 163 184 / var(--tw-bg-opacity))}.file\\:border-0::file-selector-button{border-width:0px}.file\\:bg-transparent::file-selector-button{background-color:transparent}.file\\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\\:font-medium::file-selector-button{font-weight:500}.placeholder\\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.after\\:absolute:after{content:var(--tw-content);position:absolute}.after\\:inset-x-0:after{content:var(--tw-content);left:0;right:0}.after\\:top-full:after{content:var(--tw-content);top:100%}.after\\:h-\\[50\\%\\]:after{content:var(--tw-content);height:50%}.after\\:bg-inherit:after{content:var(--tw-content);background-color:inherit}.hover\\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\\:bg-accent\\/10:hover{background-color:hsl(var(--accent) / .1)}.hover\\:bg-destructive\\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\\:bg-primary:hover{background-color:hsl(var(--primary))}.hover\\:bg-primary\\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\\:bg-secondary\\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\\:bg-slate-200:hover{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity))}.hover\\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\\:text-primary-foreground:hover{color:hsl(var(--primary-foreground))}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-100:hover{opacity:1}.hover\\:shadow-primary:hover{--tw-shadow-color: hsl(var(--primary));--tw-shadow: var(--tw-shadow-colored)}.hover\\:brightness-50:hover{--tw-brightness: brightness(.5);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.hover\\:brightness-75:hover{--tw-brightness: brightness(.75);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.focus\\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-\\[1\\.5px\\]:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1.5px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-primary:focus-visible{--tw-ring-color: hsl(var(--primary))}.focus-visible\\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}.has-\\[\\[data-range-end\\]\\]\\:rounded-r-md:has([data-range-end]){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.has-\\[\\[data-range-start\\]\\]\\:rounded-l-md:has([data-range-start]){border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.has-\\[\\[data-in-range\\]\\]\\:bg-accent:has([data-in-range]){background-color:hsl(var(--accent))}.has-\\[\\[data-outside-range\\]\\[data-in-range\\]\\]\\:bg-accent\\/50:has([data-outside-range][data-in-range]){background-color:hsl(var(--accent) / .5)}.has-\\[\\[data-in-range\\]\\]\\:first-of-type\\:rounded-l-md:first-of-type:has([data-in-range]){border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.has-\\[\\[data-in-range\\]\\]\\:last-of-type\\:rounded-r-md:last-of-type:has([data-in-range]){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.data-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}@keyframes content-show{0%{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}.data-\\[expanded\\]\\:animate-content-show[data-expanded]{animation:content-show .2s ease-out}.data-\\[selected\\]\\:bg-primary[data-selected]{background-color:hsl(var(--primary))}.data-\\[state\\=open\\]\\:bg-accent[data-state=open],.data-\\[today\\]\\:bg-accent[data-today]{background-color:hsl(var(--accent))}.data-\\[disabled\\]\\:text-muted-foreground[data-disabled],.data-\\[outside-range\\]\\:text-muted-foreground[data-outside-range]{color:hsl(var(--muted-foreground))}.data-\\[selected\\]\\:text-primary-foreground[data-selected]{color:hsl(var(--primary-foreground))}.data-\\[today\\]\\:text-accent-foreground[data-today]{color:hsl(var(--accent-foreground))}.data-\\[disabled\\]\\:opacity-50[data-disabled],.data-\\[outside-range\\]\\:opacity-50[data-outside-range]{opacity:.5}.data-\\[selected\\]\\:opacity-100[data-selected]{opacity:1}.data-\\[transitioning\\]\\:transition-colors[data-transitioning]{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.data-\\[transitioning\\]\\:transition-transform[data-transitioning]{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.data-\\[transitioning\\]\\:duration-300[data-transitioning]{transition-duration:.3s}.data-\\[state\\=open\\]\\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\\[state\\=closed\\]\\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\\[state\\=closed\\]\\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\\[state\\=open\\]\\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\\[state\\=closed\\]\\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\\[state\\=open\\]\\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\\[transitioning\\]\\:duration-300[data-transitioning]{animation-duration:.3s}.data-\\[selected\\]\\:hover\\:bg-primary:hover[data-selected]{background-color:hsl(var(--primary))}.data-\\[selected\\]\\:hover\\:text-primary-foreground:hover[data-selected]{color:hsl(var(--primary-foreground))}@media (min-width: 640px){.sm\\:text-left{text-align:left}}@media (min-width: 768px){.md\\:h-\\[min\\(100vh\\,500px\\)\\]{height:min(100vh,500px)}.md\\:max-h-\\[90\\%\\]{max-height:90%}.md\\:w-\\[min\\(100vw\\,400px\\)\\]{width:min(100vw,400px)}.md\\:max-w-\\[90\\%\\]{max-width:90%}.md\\:select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.md\\:text-lg{font-size:1.125rem;line-height:1.75rem}.md\\:text-sm{font-size:.875rem;line-height:1.25rem}}.\\[\\&\\:is\\(\\[data-outside-range\\]\\[data-in-range\\]\\)\\]\\:bg-accent\\/50:is([data-outside-range][data-in-range]){background-color:hsl(var(--accent) / .5)}.\\[\\&\\:is\\(\\[data-outside-range\\]\\[data-in-range\\]\\)\\]\\:text-muted-foreground:is([data-outside-range][data-in-range]){color:hsl(var(--muted-foreground))}.\\[\\&\\:is\\(\\[data-outside-range\\]\\[data-in-range\\]\\)\\]\\:opacity-30:is([data-outside-range][data-in-range]){opacity:.3}.\\[\\&\\:is\\(\\[data-today\\]\\[data-selected\\]\\)\\]\\:bg-primary:is([data-today][data-selected]){background-color:hsl(var(--primary))}.\\[\\&\\:is\\(\\[data-today\\]\\[data-selected\\]\\)\\]\\:text-primary-foreground:is([data-today][data-selected]){color:hsl(var(--primary-foreground))}',[Ks,Io]=L(!1),zs=[],Cd=e=>zs.push(e),Bs=()=>{zs.forEach(e=>e())},Od=()=>{Io(!Ks()),Bs()},Dd=()=>{Io(!1)},kd=()=>{Io(!0),Bs()},js=()=>({bubble:Ks,show:kd,hide:Dd,toggle:Od,onOpen:Cd}),Lo=Symbol("store-raw"),en=Symbol("store-node"),rt=Symbol("store-has"),Us=Symbol("store-self");function Ws(e){let t=e[Ie];if(!t&&(Object.defineProperty(e,Ie,{value:t=new Proxy(e,Ad)}),!Array.isArray(e))){const n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let o=0,i=n.length;o<i;o++){const s=n[o];r[s].get&&Object.defineProperty(e,s,{enumerable:r[s].enumerable,get:r[s].get.bind(t)})}}return t}function St(e){let t;return e!=null&&typeof e=="object"&&(e[Ie]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function tn(e,t=new Set){let n,r,o,i;if(n=e!=null&&e[Lo])return n;if(!St(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let s=0,a=e.length;s<a;s++)o=e[s],(r=tn(o,t))!==o&&(e[s]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);const s=Object.keys(e),a=Object.getOwnPropertyDescriptors(e);for(let l=0,c=s.length;l<c;l++)i=s[l],!a[i].get&&(o=e[i],(r=tn(o,t))!==o&&(e[i]=r))}return e}function Sr(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function Fn(e,t,n){if(e[t])return e[t];const[r,o]=L(n,{equals:!1,internal:!0});return r.$=o,e[t]=r}function Td(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===Ie||t===en||(delete n.value,delete n.writable,n.get=()=>e[Ie][t]),n}function Hs(e){Po()&&Fn(Sr(e,en),Us)()}function $d(e){return Hs(e),Reflect.ownKeys(e)}const Ad={get(e,t,n){if(t===Lo)return e;if(t===Ie)return n;if(t===fr)return Hs(e),n;const r=Sr(e,en),o=r[t];let i=o?o():e[t];if(t===en||t===rt||t==="__proto__")return i;if(!o){const s=Object.getOwnPropertyDescriptor(e,t);Po()&&(typeof i!="function"||e.hasOwnProperty(t))&&!(s&&s.get)&&(i=Fn(r,t,i)())}return St(i)?Ws(i):i},has(e,t){return t===Lo||t===Ie||t===fr||t===en||t===rt||t==="__proto__"?!0:(Po()&&Fn(Sr(e,rt),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:$d,getOwnPropertyDescriptor:Td};function Re(e,t,n,r=!1){if(!r&&e[t]===n)return;const o=e[t],i=e.length;n===void 0?(delete e[t],e[rt]&&e[rt][t]&&o!==void 0&&e[rt][t].$()):(e[t]=n,e[rt]&&e[rt][t]&&o===void 0&&e[rt][t].$());let s=Sr(e,en),a;if((a=Fn(s,t,o))&&a.$(()=>n),Array.isArray(e)&&e.length!==i){for(let l=e.length;l<i;l++)(a=s[l])&&a.$();(a=Fn(s,"length",i))&&a.$(e.length)}(a=s[Us])&&a.$()}function Ys(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const o=n[r];Re(e,o,t[o])}}function Md(e,t){if(typeof t=="function"&&(t=t(e)),t=tn(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){const o=t[n];e[n]!==o&&Re(e,n,o)}Re(e,"length",r)}else Ys(e,t)}function _n(e,t,n=[]){let r,o=e;if(t.length>1){r=t.shift();const s=typeof r,a=Array.isArray(e);if(Array.isArray(r)){for(let l=0;l<r.length;l++)_n(e,[r[l]].concat(t),n);return}else if(a&&s==="function"){for(let l=0;l<e.length;l++)r(e[l],l)&&_n(e,[l].concat(t),n);return}else if(a&&s==="object"){const{from:l=0,to:c=e.length-1,by:u=1}=r;for(let d=l;d<=c;d+=u)_n(e,[d].concat(t),n);return}else if(t.length>1){_n(e[r],t,[r].concat(n));return}o=e[r],n=[r].concat(n)}let i=t[0];typeof i=="function"&&(i=i(o,n),i===o)||r===void 0&&i==null||(i=tn(i),r===void 0||St(o)&&St(i)&&!Array.isArray(i)?Ys(o,i):Re(e,r,i))}function Gs(...[e,t]){const n=tn(e||{}),r=Array.isArray(n),o=Ws(n);function i(...s){Be(()=>{r&&s.length===1?Md(n,s[0]):_n(n,s)})}return[o,i]}const Ro=Symbol("store-root");function nn(e,t,n,r,o){const i=t[n];if(e===i)return;const s=Array.isArray(e);if(n!==Ro&&(!St(e)||!St(i)||s!==Array.isArray(i)||o&&e[o]!==i[o])){Re(t,n,e);return}if(s){if(e.length&&i.length&&(!r||o&&e[0]&&e[0][o]!=null)){let c,u,d,f,m,g,p,y;for(d=0,f=Math.min(i.length,e.length);d<f&&(i[d]===e[d]||o&&i[d]&&e[d]&&i[d][o]===e[d][o]);d++)nn(e[d],i,d,r,o);const v=new Array(e.length),b=new Map;for(f=i.length-1,m=e.length-1;f>=d&&m>=d&&(i[f]===e[m]||o&&i[d]&&e[d]&&i[f][o]===e[m][o]);f--,m--)v[m]=i[f];if(d>m||d>f){for(u=d;u<=m;u++)Re(i,u,e[u]);for(;u<e.length;u++)Re(i,u,v[u]),nn(e[u],i,u,r,o);i.length>e.length&&Re(i,"length",e.length);return}for(p=new Array(m+1),u=m;u>=d;u--)g=e[u],y=o&&g?g[o]:g,c=b.get(y),p[u]=c===void 0?-1:c,b.set(y,u);for(c=d;c<=f;c++)g=i[c],y=o&&g?g[o]:g,u=b.get(y),u!==void 0&&u!==-1&&(v[u]=i[c],u=p[u],b.set(y,u));for(u=d;u<e.length;u++)u in v?(Re(i,u,v[u]),nn(e[u],i,u,r,o)):Re(i,u,e[u])}else for(let c=0,u=e.length;c<u;c++)nn(e[c],i,c,r,o);i.length>e.length&&Re(i,"length",e.length);return}const a=Object.keys(e);for(let c=0,u=a.length;c<u;c++)nn(e[a[c]],i,a[c],r,o);const l=Object.keys(i);for(let c=0,u=l.length;c<u;c++)e[l[c]]===void 0&&Re(i,l[c],void 0)}function Id(e,t={}){const{merge:n,key:r="id"}=t,o=tn(e);return i=>{if(!St(i)||!St(o))return o;const s=nn(o,{[Ro]:i},Ro,n,r);return s===void 0?i:s}}function qs(e,t,n=0){localStorage.setItem(e,JSON.stringify({value:t,ttl:new Date().getTime()+n}))}function Zs(e){const t=localStorage.getItem(e);if(!t)return null;const n=JSON.parse(t),r=new Date;return n.ttl!==0&&r.getTime()>n.ttl?(localStorage.removeItem(e),null):n.value}function Xs(e,t,n){return ze(()=>{const r=Zs(e),[o,i]=Gs(r?JSON.parse(r):t);return V(()=>qs(e,JSON.stringify(o),n)),[o,i]})}function Ld(e,t,n){return ze(()=>{const r=Zs(e),[o,i]=L(r?JSON.parse(r):t);return V(()=>qs(e,JSON.stringify(o()),n)),[o,i]})}Ld("lang","en");function Js(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Js(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Rd(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Js(e))&&(r&&(r+=" "),r+=t);return r}const No="-";function Nd(e){const t=_d(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function o(s){const a=s.split(No);return a[0]===""&&a.length!==1&&a.shift(),Qs(a,t)||Fd(s)}function i(s,a){const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}return{getClassGroupId:o,getConflictingClassGroupIds:i}}function Qs(e,t){if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Qs(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(No);return t.validators.find(({validator:s})=>s(i))?.classGroupId}const ea=/^\[(.+)\]$/;function Fd(e){if(ea.test(e)){const t=ea.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function _d(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Kd(Object.entries(e.classGroups),n).forEach(([i,s])=>{Fo(s,r,i,t)}),r}function Fo(e,t,n,r){e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:ta(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(Vd(o)){Fo(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{Fo(s,ta(t,i),n,r)})})}function ta(e,t){let n=e;return t.split(No).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function Vd(e){return e.isThemeGetter}function Kd(e,t){return t?e.map(([n,r])=>{const o=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,a])=>[t+s,a])):i);return[n,o]}):e}function zd(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;function o(i,s){n.set(i,s),t++,t>e&&(t=0,r=n,n=new Map)}return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=r.get(i))!==void 0)return o(i,s),s},set(i,s){n.has(i)?n.set(i,s):o(i,s)}}}const na="!";function Bd(e){const t=e.separator,n=t.length===1,r=t[0],o=t.length;return function(s){const a=[];let l=0,c=0,u;for(let p=0;p<s.length;p++){let y=s[p];if(l===0){if(y===r&&(n||s.slice(p,p+o)===t)){a.push(s.slice(c,p)),c=p+o;continue}if(y==="/"){u=p;continue}}y==="["?l++:y==="]"&&l--}const d=a.length===0?s:s.substring(c),f=d.startsWith(na),m=f?d.substring(1):d,g=u&&u>c?u-c:void 0;return{modifiers:a,hasImportantModifier:f,baseClassName:m,maybePostfixModifierPosition:g}}}function jd(e){if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t}function Ud(e){return{cache:zd(e.cacheSize),splitModifiers:Bd(e),...Nd(e)}}const Wd=/\s+/;function Hd(e,t){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=new Set;return e.trim().split(Wd).map(s=>{const{modifiers:a,hasImportantModifier:l,baseClassName:c,maybePostfixModifierPosition:u}=n(s);let d=r(u?c.substring(0,u):c),f=!!u;if(!d){if(!u)return{isTailwindClass:!1,originalClassName:s};if(d=r(c),!d)return{isTailwindClass:!1,originalClassName:s};f=!1}const m=jd(a).join(":");return{isTailwindClass:!0,modifierId:l?m+na:m,classGroupId:d,originalClassName:s,hasPostfixModifier:f}}).reverse().filter(s=>{if(!s.isTailwindClass)return!0;const{modifierId:a,classGroupId:l,hasPostfixModifier:c}=s,u=a+l;return i.has(u)?!1:(i.add(u),o(l,c).forEach(d=>i.add(a+d)),!0)}).reverse().map(s=>s.originalClassName).join(" ")}function Yd(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=ra(t))&&(r&&(r+=" "),r+=n);return r}function ra(e){if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=ra(e[r]))&&(n&&(n+=" "),n+=t);return n}function Gd(e,...t){let n,r,o,i=s;function s(l){const c=t.reduce((u,d)=>d(u),e());return n=Ud(c),r=n.cache.get,o=n.cache.set,i=a,a(l)}function a(l){const c=r(l);if(c)return c;const u=Hd(l,n);return o(l,u),u}return function(){return i(Yd.apply(null,arguments))}}function ae(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const oa=/^\[(?:([a-z-]+):)?(.+)\]$/i,qd=/^\d+\/\d+$/,Zd=new Set(["px","full","screen"]),Xd=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Jd=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Qd=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,ef=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,tf=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function ot(e){return Vt(e)||Zd.has(e)||qd.test(e)}function Et(e){return rn(e,"length",uf)}function Vt(e){return!!e&&!Number.isNaN(Number(e))}function Er(e){return rn(e,"number",Vt)}function Vn(e){return!!e&&Number.isInteger(Number(e))}function nf(e){return e.endsWith("%")&&Vt(e.slice(0,-1))}function q(e){return oa.test(e)}function Pt(e){return Xd.test(e)}const rf=new Set(["length","size","percentage"]);function of(e){return rn(e,rf,ia)}function sf(e){return rn(e,"position",ia)}const af=new Set(["image","url"]);function lf(e){return rn(e,af,ff)}function cf(e){return rn(e,"",df)}function Kn(){return!0}function rn(e,t,n){const r=oa.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function uf(e){return Jd.test(e)&&!Qd.test(e)}function ia(){return!1}function df(e){return ef.test(e)}function ff(e){return tf.test(e)}function gf(){const e=ae("colors"),t=ae("spacing"),n=ae("blur"),r=ae("brightness"),o=ae("borderColor"),i=ae("borderRadius"),s=ae("borderSpacing"),a=ae("borderWidth"),l=ae("contrast"),c=ae("grayscale"),u=ae("hueRotate"),d=ae("invert"),f=ae("gap"),m=ae("gradientColorStops"),g=ae("gradientColorStopPositions"),p=ae("inset"),y=ae("margin"),v=ae("opacity"),b=ae("padding"),w=ae("saturate"),x=ae("scale"),T=ae("sepia"),O=ae("skew"),k=ae("space"),j=ae("translate"),P=()=>["auto","contain","none"],M=()=>["auto","hidden","clip","visible","scroll"],$=()=>["auto",q,t],R=()=>[q,t],se=()=>["",ot,Et],J=()=>["auto",Vt,q],re=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],N=()=>["solid","dashed","dotted","double","none"],X=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],he=()=>["start","end","center","between","around","evenly","stretch"],E=()=>["","0",q],S=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>[Vt,Er],W=()=>[Vt,q];return{cacheSize:500,separator:":",theme:{colors:[Kn],spacing:[ot,Et],blur:["none","",Pt,q],brightness:C(),borderColor:[e],borderRadius:["none","","full",Pt,q],borderSpacing:R(),borderWidth:se(),contrast:C(),grayscale:E(),hueRotate:W(),invert:E(),gap:R(),gradientColorStops:[e],gradientColorStopPositions:[nf,Et],inset:$(),margin:$(),opacity:C(),padding:R(),saturate:C(),scale:C(),sepia:E(),skew:W(),space:R(),translate:R()},classGroups:{aspect:[{aspect:["auto","square","video",q]}],container:["container"],columns:[{columns:[Pt]}],"break-after":[{"break-after":S()}],"break-before":[{"break-before":S()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...re(),q]}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Vn,q]}],basis:[{basis:$()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",q]}],grow:[{grow:E()}],shrink:[{shrink:E()}],order:[{order:["first","last","none",Vn,q]}],"grid-cols":[{"grid-cols":[Kn]}],"col-start-end":[{col:["auto",{span:["full",Vn,q]},q]}],"col-start":[{"col-start":J()}],"col-end":[{"col-end":J()}],"grid-rows":[{"grid-rows":[Kn]}],"row-start-end":[{row:["auto",{span:[Vn,q]},q]}],"row-start":[{"row-start":J()}],"row-end":[{"row-end":J()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",q]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",q]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...he()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...he(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...he(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[k]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[k]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",q,t]}],"min-w":[{"min-w":[q,t,"min","max","fit"]}],"max-w":[{"max-w":[q,t,"none","full","min","max","fit","prose",{screen:[Pt]},Pt]}],h:[{h:[q,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[q,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[q,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[q,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Pt,Et]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Er]}],"font-family":[{font:[Kn]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",q]}],"line-clamp":[{"line-clamp":["none",Vt,Er]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ot,q]}],"list-image":[{"list-image":["none",q]}],"list-style-type":[{list:["none","disc","decimal",q]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...N(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ot,Et]}],"underline-offset":[{"underline-offset":["auto",ot,q]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",q]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",q]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...re(),sf]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",of]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},lf]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...N(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:N()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...N()]}],"outline-offset":[{"outline-offset":[ot,q]}],"outline-w":[{outline:[ot,Et]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:se()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[ot,Et]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Pt,cf]}],"shadow-color":[{shadow:[Kn]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":X()}],"bg-blend":[{"bg-blend":X()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Pt,q]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[w]}],sepia:[{sepia:[T]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[T]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",q]}],duration:[{duration:W()}],ease:[{ease:["linear","in","out","in-out",q]}],delay:[{delay:W()}],animate:[{animate:["none","spin","ping","pulse","bounce",q]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[Vn,q]}],"translate-x":[{"translate-x":[j]}],"translate-y":[{"translate-y":[j]}],"skew-x":[{"skew-x":[O]}],"skew-y":[{"skew-y":[O]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",q]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",q]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",q]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ot,Et,Er]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const hf=Gd(gf);function le(...e){return hf(Rd(e))}function pf(e){try{if(!e)return;const t=document.querySelector(":root");if(!t)throw new Error("could not find root layer");console.log("loading theme for",e.title),e.style.primary&&t.style.setProperty("--primary",Pr(e.style.primary)),e.style.primaryForeground&&t.style.setProperty("--primary-foreground",Pr(e.style.primaryForeground)),e.style.background&&t.style.setProperty("--background",Pr(e.style.background)),e.style.foreground&&t.style.setProperty("--foreground",Pr(e.style.foreground))}catch(t){console.error("failed to load widget theme",t)}}function Pr(e){let t=0,n=0,r=0;e.length==4?(t="0x"+e[1]+e[1],n="0x"+e[2]+e[2],r="0x"+e[3]+e[3]):e.length==7&&(t="0x"+e[1]+e[2],n="0x"+e[3]+e[4],r="0x"+e[5]+e[6]),t/=255,n/=255,r/=255;let o=Math.min(t,n,r),i=Math.max(t,n,r),s=i-o,a=0,l=0,c=0;return s==0?a=0:i==t?a=(n-r)/s%6:i==n?a=(r-t)/s+2:a=(t-n)/s+4,a=Math.round(a*60),a<0&&(a+=360),c=(i+o)/2,l=s==0?0:s/(1-Math.abs(2*c-1)),l=+(l*100).toFixed(1),c=+(c*100).toFixed(1),a+","+l+"%,"+c+"%"}function mf(e){if(e.includes("<a")||e.includes("</a>")||e.includes('href="')||e.includes('target="_blank"'))return e;const t=/(https?\:\/\/)(www\.)?[^\s]+\.[^\s\<]+/g;return e.replace(t,n=>{let r=n;return n.includes("<br>")?n:(r.startsWith("http")||(r="http://"+n),`<a class="underline" href="${r}" target="_blank">${n}</a>`)})}function yf(e){return e&&e.replace(/\n/gm,"<br>").replace(/(?:\*)([^*]*)(?:\*)/gm,"<strong>$1</strong>").replace(/(?:_)([^_]*)(?:_)/gm,"<i>$1</i>").replace(/(?:~)([^~]*)(?:~)/gm,"<strike>$1</strike>").replace(/(?:```)([^```]*)(?:```)/gm,"<tt>$1</tt>")}function zn(){const e=document.querySelector("smarttalks-widget");let t;if(e?t=e.shadowRoot?.getElementById("smarttalks-widget"):t=document.getElementById("smarttalks-widget"),!t)throw new Error("could not find widget element");return t}const _o="https://voyager.guide121.dev";function vf(e){return{type:"chat",_id:e._id,accountId:e.accountId,fullscreen:e.settings.fullScreen,mode:"standard",dismissable:e.settings.closeButton,avatar:e.settings.avatar,title:e.settings.title,subtitle:e.settings.subtitle,balloonMessage:e.settings.balloonMessage,openDelay:e.settings.automatedOpen?2e3:0,chat:{flowId:e.typeId},style:{width:+e.settings.style.width.replace("px",""),height:+e.settings.style.height.replace("px",""),position:"right",primary:e.settings.style.headerBackground,primaryForeground:e.settings.style.color,background:"#FAFAFA",foreground:"#000000"},showSettings:!1}}function bf(e){return{type:"form",_id:e._id,accountId:e.accountId,fullscreen:e.settings.fullScreen,mode:"static",dismissable:e.settings.closeButton,avatar:e.settings.avatar,title:e.settings.title,subtitle:e.settings.subtitle,balloonMessage:e.settings.balloonMessage,openDelay:e.settings.automatedOpen?2e3:0,form:{formId:e.typeId},style:{width:+e.settings.style.width.replace("px",""),height:+e.settings.style.height.replace("px",""),position:"right",primary:e.settings.style.headerBackground,primaryForeground:e.settings.style.color,background:"#FAFAFA",foreground:"#000000"}}}const wf=async e=>{const t=e.split("?"),n=t[0],r=t[1]?.split("&")??[];if(!n)return;console.log("fetching widget:",n);const o=`${_o}/v1/webhooks/widget/${n}`,i=await(await fetch(o)).json();return i.type==="flow"?vf(i):i.type==="entity"?bf(i):(i.type==="chat"&&r.includes("showSettings")&&(i.showSettings=!0),i)},[sa,xf]=L(""),[on]=ze(()=>Ps(sa,wf)),Sf=()=>{if(on()?.type==="chat")return on()},Ef=()=>{if(on()?.type==="form")return on()};ze(()=>V(()=>pf(on())));const de=()=>({widgetId:sa,setWidgetId:xf,widget:on,chatWidget:Sf,formWidget:Ef});function aa(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=aa(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function Pf(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=aa(e))&&(r&&(r+=" "),r+=t);return r}const la=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,ca=Pf,Cf=(e,t)=>n=>{var r;if(t?.variants==null)return ca(e,n?.class,n?.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(c=>{const u=n?.[c],d=i?.[c];if(u===null)return null;const f=la(u)||la(d);return o[c][f]}),a=n&&Object.entries(n).reduce((c,u)=>{let[d,f]=u;return f===void 0||(c[d]=f),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:d,className:f,...m}=u;return Object.entries(m).every(g=>{let[p,y]=g;return Array.isArray(y)?y.includes({...i,...a}[p]):{...i,...a}[p]===y})?[...c,d,f]:c},[]);return ca(e,s,l,n?.class,n?.className)};var Of=B("<button>");const Bn=Cf("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"size-10"}},defaultVariants:{variant:"default",size:"default"}}),Ce=e=>{const[,t]=U(e,["variant","size","class"]);return(()=>{var n=Of();return Xt(n,I({get class(){return le(Bn({variant:e.variant,size:e.size}),e.class)}},t),!1,!1),n})()};var Df=B('<img alt="widget logo">');const ua=e=>{const[,t]=U(e,["class","src"]);return(()=>{var n=Df();return Xt(n,I({get src(){return e.src??"/src/assets/izi.jpeg"},get class(){return le("size-12 bg-transparent rounded-full",e.class)}},t),!1,!1),n})()};var kf=B('<div class="flex space-x-4"><div class="flex flex-col"><span class="font-bold md:text-lg"></span><span class="text-xs md:text-sm truncate">');const Tf=()=>{const{chatWidget:e}=de();return(()=>{var t=kf(),n=t.firstChild,r=n.firstChild,o=r.nextSibling;return F(t,h(ua,{get src(){return e()?.avatar}}),n),F(r,()=>e()?.title??"Izi"),F(o,()=>e()?.subtitle??"SmartTalks.ai"),t})()};var $f=B("<svg stroke-width=0>");function me(e,t){const n=I(e.a,t),[r,o]=U(n,["src"]),[i,s]=L(""),a=A(()=>t.title?`${e.c}<title>${t.title}</title>`:e.c);return V(()=>s(a())),Z(()=>{s("")}),(()=>{var l=$f();return Xt(l,I({get stroke(){return e.a?.stroke},get color(){return t.color||"currentColor"},get fill(){return t.color||"currentColor"},get style(){return{...t.style,overflow:"visible"}}},o,{get height(){return t.size||"1em"},get width(){return t.size||"1em"},xmlns:"http://www.w3.org/2000/svg",get innerHTML(){return i()}}),!0,!0),F(l,()=>vd),l})()}function Af(e){return me({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path fill-rule="evenodd" d="M12.75 8a4.5 4.5 0 0 1-8.61 1.834l-1.391.565A6.001 6.001 0 0 0 14.25 8 6 6 0 0 0 3.5 4.334V2.5H2v4l.75.75h3.5v-1.5H4.352A4.5 4.5 0 0 1 12.75 8z" clip-rule="evenodd"/>'},e)}function Mf(e){return me({a:{fill:"currentColor",viewBox:"0 0 24 24"},c:'<path d="m3.463 12.86-.005-.07.005.07zm7.264.69-3.034-3.049 1.014-1.014 3.209 3.225 3.163-3.163 1.014 1.014-3.034 3.034 3.034 3.05-1.014 1.014-3.209-3.225L8.707 17.6l-1.014-1.014 3.034-3.034z"/><path fill-rule="evenodd" d="M16.933 5.003V6h1.345l2.843-2.842 1.014 1.014-2.692 2.691.033.085a13.75 13.75 0 0 1 .885 4.912c0 .335-.011.667-.034.995l-.005.075h3.54v1.434h-3.72l-.01.058c-.303 1.653-.891 3.16-1.692 4.429l-.06.094 3.423 3.44-1.017 1.012-3.274-3.29-.099.11c-1.479 1.654-3.395 2.646-5.483 2.646-2.12 0-4.063-1.023-5.552-2.723l-.098-.113-3.209 3.208-1.014-1.014 3.366-3.365-.059-.095c-.772-1.25-1.34-2.725-1.636-4.34l-.01-.057H0V12.93h3.538l-.005-.075a14.23 14.23 0 0 1-.034-.995c0-1.743.31-3.39.863-4.854l.032-.084-2.762-2.776L2.65 3.135 5.5 6h1.427v-.997a5.003 5.003 0 0 1 10.006 0zm-8.572 0V6H15.5v-.997a3.569 3.569 0 0 0-7.138 0zm9.8 2.522-.034-.09H5.733l-.034.09a12.328 12.328 0 0 0-.766 4.335c0 2.76.862 5.201 2.184 6.92 1.32 1.716 3.036 2.649 4.813 2.649 1.777 0 3.492-.933 4.813-2.65 1.322-1.718 2.184-4.16 2.184-6.919 0-1.574-.28-3.044-.766-4.335z" clip-rule="evenodd"/>'},e)}function If(e){return me({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path fill-rule="evenodd" d="M7.444 13.832a1 1 0 1 0 1.111-1.663 1 1 0 0 0-1.11 1.662zM8 9a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm0-5a1 1 0 1 1 0-2 1 1 0 0 1 0 2z" clip-rule="evenodd"/>'},e)}function Lf(e){return me({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path fill-rule="evenodd" d="M13.917 7A6.002 6.002 0 0 0 2.083 7H1.071a7.002 7.002 0 0 1 13.858 0h-1.012z" clip-rule="evenodd"/>'},e)}function Rf(e){return me({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="m1 1.91.78-.41L15 7.449v.95L1.78 14.33 1 13.91 2.583 8 1 1.91ZM3.612 8.5 2.33 13.13 13.5 7.9 2.33 2.839l1.282 4.6L9 7.5v1H3.612Z"/>'},e)}function Nf(e){return(...t)=>{for(const n of e)n&&n(...t)}}var D=e=>typeof e=="function"&&!e.length?e():e,da=e=>Array.isArray(e)?e:e?[e]:[];function Ff(e,...t){return typeof e=="function"?e(...t):e}var _f=Z;function Vf(e,t,n,r){return e.addEventListener(t,n,r),_f(e.removeEventListener.bind(e,t,n,r))}function Kf(e,t,n,r){const o=()=>{da(D(e)).forEach(i=>{i&&da(D(t)).forEach(s=>Vf(i,s,n,r))})};typeof e=="function"?V(o):ue(o)}var zf={equals:!1};function Bf(e){return(...t)=>{for(const n of e)n&&n(...t)}}function jf(e){return(...t)=>{for(let n=e.length-1;n>=0;n--){const r=e[n];r&&r(...t)}}}var Vo=e=>typeof e=="function"&&!e.length?e():e;function Cr(){return!0}var Uf={get(e,t,n){return t===Ie?n:e.get(t)},has(e,t){return e.has(t)},set:Cr,deleteProperty:Cr,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:Cr,deleteProperty:Cr}},ownKeys(e){return e.keys()}},Wf=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function fa(e){const t={};let n;for(;n=Wf.exec(e);)t[n[1]]=n[2];return t}function Hf(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=fa(e)}else typeof t=="string"&&(t=fa(t));return{...e,...t}}var Ko=(e,t,n)=>{let r;for(const o of e){const i=Vo(o)[t];r?i&&(r=n(r,i)):r=i}return r};function Yf(...e){const t=Array.isArray(e[0]),n=t?e[0]:e;if(n.length===1)return n[0];const r=t&&e[1]?.reverseEventHandlers?jf:Bf,o={};for(const s of n){const a=Vo(s);for(const l in a)if(l[0]==="o"&&l[1]==="n"&&l[2]){const c=a[l],u=l.toLowerCase(),d=typeof c=="function"?c:Array.isArray(c)?c.length===1?c[0]:c[0].bind(void 0,c[1]):void 0;d?o[u]?o[u].push(d):o[u]=[d]:delete o[u]}}const i=I(...n);return new Proxy({get(s){if(typeof s!="string")return Reflect.get(i,s);if(s==="style")return Ko(n,"style",Hf);if(s==="ref"){const a=[];for(const l of n){const c=Vo(l)[s];typeof c=="function"&&a.push(c)}return r(a)}if(s[0]==="o"&&s[1]==="n"&&s[2]){const a=o[s.toLowerCase()];return a?r(a):Reflect.get(i,s)}return s==="class"||s==="className"?Ko(n,s,(a,l)=>`${a} ${l}`):s==="classList"?Ko(n,s,(a,l)=>({...a,...l})):Reflect.get(i,s)},has(s){return Reflect.has(i,s)},keys(){return Object.keys(i)}},Uf)}function Ct(...e){return Nf(e)}function Gf(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function zo(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function qf(e){return typeof e=="number"}function Zf(e){return Array.isArray(e)}function sn(e){return Object.prototype.toString.call(e)==="[object String]"}function Xf(e){return typeof e=="function"}function ga(e){return t=>`${e()}-${t}`}function Ze(e,t){return e?e===t||e.contains(t):!1}function jn(e,t=!1){const{activeElement:n}=it(e);if(!n?.nodeName)return null;if(ha(n)&&n.contentDocument)return jn(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const o=it(n).getElementById(r);if(o)return o}}return n}function it(e){return e?e.ownerDocument||e:document}function ha(e){return e.tagName==="IFRAME"}var pa=(e=>(e.Escape="Escape",e.Enter="Enter",e.Tab="Tab",e.Space=" ",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.ArrowUp="ArrowUp",e.End="End",e.Home="Home",e.PageDown="PageDown",e.PageUp="PageUp",e))(pa||{});function Bo(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.userAgentData?.platform||window.navigator.platform):!1}function Or(){return Bo(/^Mac/i)}function Jf(){return Bo(/^iPhone/i)}function Qf(){return Bo(/^iPad/i)||Or()&&navigator.maxTouchPoints>1}function eg(){return Jf()||Qf()}function tg(){return Or()||eg()}function Oe(e,t){return t&&(Xf(t)?t(e):t[0](t[1],e)),e?.defaultPrevented}function Ne(e){return t=>{for(const n of e)Oe(t,n)}}function ng(e){return Or()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function Se(e){if(e)if(rg())e.focus({preventScroll:!0});else{const t=og(e);e.focus(),ig(t)}}var Dr=null;function rg(){if(Dr==null){Dr=!1;try{document.createElement("div").focus({get preventScroll(){return Dr=!0,!0}})}catch{}}return Dr}function og(e){let t=e.parentNode;const n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function ig(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var ma=["input:not([type='hidden']):not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","[tabindex]","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]:not([contenteditable='false'])"],sg=[...ma,'[tabindex]:not([tabindex="-1"]):not([disabled])'],jo=ma.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])",ag=sg.join(':not([hidden]):not([tabindex="-1"]),');function ya(e,t){const r=Array.from(e.querySelectorAll(jo)).filter(va);return t&&va(e)&&r.unshift(e),r.forEach((o,i)=>{if(ha(o)&&o.contentDocument){const s=o.contentDocument.body,a=ya(s,!1);r.splice(i,1,...a)}}),r}function va(e){return ba(e)&&!lg(e)}function ba(e){return e.matches(jo)&&Uo(e)}function lg(e){return parseInt(e.getAttribute("tabindex")||"0",10)<0}function Uo(e,t){return e.nodeName!=="#comment"&&cg(e)&&ug(e,t)&&(!e.parentElement||Uo(e.parentElement,e))}function cg(e){if(!(e instanceof HTMLElement)&&!(e instanceof SVGElement))return!1;const{display:t,visibility:n}=e.style;let r=t!=="none"&&n!=="hidden"&&n!=="collapse";if(r){if(!e.ownerDocument.defaultView)return r;const{getComputedStyle:o}=e.ownerDocument.defaultView,{display:i,visibility:s}=o(e);r=i!=="none"&&s!=="hidden"&&s!=="collapse"}return r}function ug(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function dg(e,t){return t.some(n=>n.contains(e))}function fg(e,t,n){const r=t?.tabbable?ag:jo,o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(i){return t?.from?.contains(i)?NodeFilter.FILTER_REJECT:i.matches(r)&&Uo(i)&&(!n||dg(i,n))&&(!t?.accept||t.accept(i))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t?.from&&(o.currentNode=t.from),o}function wa(e){for(;e&&!gg(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}function gg(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function hg(){}function pg(e,t){const[n,r]=e;let o=!1;const i=t.length;for(let s=i,a=0,l=s-1;a<s;l=a++){const[c,u]=t[a],[d,f]=t[l],[,m]=t[l===0?s-1:l-1]||[0,0],g=(u-f)*(n-c)-(c-d)*(r-u);if(f<u){if(r>=f&&r<u){if(g===0)return!0;g>0&&(r===f?r>m&&(o=!o):o=!o)}}else if(u<f){if(r>u&&r<=f){if(g===0)return!0;g<0&&(r===f?r<m&&(o=!o):o=!o)}}else if(r==u&&(n>=d&&n<=c||n>=c&&n<=d))return!0}return o}function De(e,t){return I(e,t)}var Un=new Map,xa=new Set;function Sa(){if(typeof window>"u")return;const e=n=>{if(!n.target)return;let r=Un.get(n.target);r||(r=new Set,Un.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=Un.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),Un.delete(n.target)),Un.size===0)){for(const o of xa)o();xa.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document<"u"&&(document.readyState!=="loading"?Sa():document.addEventListener("DOMContentLoaded",Sa));function Wo(e,t){const n=Ea(e,t,"left"),r=Ea(e,t,"top"),o=t.offsetWidth,i=t.offsetHeight;let s=e.scrollLeft,a=e.scrollTop;const l=s+e.offsetWidth,c=a+e.offsetHeight;n<=s?s=n:n+o>l&&(s+=n+o-l),r<=a?a=r:r+i>c&&(a+=r+i-c),e.scrollLeft=s,e.scrollTop=a}function Ea(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let o=0;for(;t.offsetParent&&(o+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){o-=e[r];break}t=t.offsetParent}return o}function mg(e,t){if(document.contains(e)){const n=document.scrollingElement||document.documentElement;if(window.getComputedStyle(n).overflow==="hidden"){let o=wa(e);for(;e&&o&&e!==n&&o!==n;)Wo(o,e),e=o,o=wa(e)}else{const{left:o,top:i}=e.getBoundingClientRect();e?.scrollIntoView?.({block:"nearest"});const{left:s,top:a}=e.getBoundingClientRect();(Math.abs(o-s)>1||Math.abs(i-a)>1)&&(t?.containingElement?.scrollIntoView?.({block:"center",inline:"center"}),e.scrollIntoView?.({block:"nearest"}))}}}var yg={border:"0",clip:"rect(0 0 0 0)","clip-path":"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:"0",position:"absolute",width:"1px","white-space":"nowrap"};function Ho(e){let t=e.startIndex??0;const n=e.startLevel??0,r=[],o=l=>{if(l==null)return"";const c=e.getKey??"key",u=sn(c)?l[c]:c(l);return u!=null?String(u):""},i=l=>{if(l==null)return"";const c=e.getTextValue??"textValue",u=sn(c)?l[c]:c(l);return u!=null?String(u):""},s=l=>{if(l==null)return!1;const c=e.getDisabled??"disabled";return(sn(c)?l[c]:c(l))??!1},a=l=>{if(l!=null)return sn(e.getSectionChildren)?l[e.getSectionChildren]:e.getSectionChildren?.(l)};for(const l of e.dataSource){if(sn(l)||qf(l)){r.push({type:"item",rawValue:l,key:String(l),textValue:String(l),disabled:s(l),level:n,index:t}),t++;continue}if(a(l)!=null){r.push({type:"section",rawValue:l,key:"",textValue:"",disabled:!1,level:n,index:t}),t++;const c=a(l)??[];if(c.length>0){const u=Ho({dataSource:c,getKey:e.getKey,getTextValue:e.getTextValue,getDisabled:e.getDisabled,getSectionChildren:e.getSectionChildren,startIndex:t,startLevel:n+1});r.push(...u),t+=u.length}}else r.push({type:"item",rawValue:l,key:o(l),textValue:i(l),disabled:s(l),level:n,index:t}),t++}return r}/*!
2
2
  * Portions of this file are based on code from react-spectrum.
3
3
  * Apache License Version 2.0, Copyright 2020 Adobe.
4
4
  *
5
5
  * Credits to the React Spectrum team:
6
6
  * https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/collections/src/useCollection.ts
7
- */function yg(e,t=[]){const n=Yo({dataSource:D(e.dataSource),getKey:D(e.getKey),getTextValue:D(e.getTextValue),getDisabled:D(e.getDisabled),getSectionChildren:D(e.getSectionChildren)}),[r,o]=L(e.factory(n));return V(Nt([()=>D(e.dataSource),()=>D(e.getKey),()=>D(e.getTextValue),()=>D(e.getDisabled),()=>D(e.getSectionChildren),()=>e.factory,...t],([i,s,a,l,c,u])=>{const d=Yo({dataSource:i,getKey:s,getTextValue:a,getDisabled:l,getSectionChildren:c});o(()=>u(d))},{defer:!0})),r}function Go(e){const[t,n]=L(e.defaultValue?.()),r=A(()=>e.value?.()!==void 0),o=A(()=>r()?e.value?.():t());return[o,s=>{Q(()=>{const a=Nf(s,o());return Object.is(a,o())||(r()||n(a),e.onChange?.(a)),a})}]}function Ca(e){const[t,n]=Go(e);return[()=>t()??!1,n]}function vg(e){const[t,n]=Go(e);return[()=>t()??[],n]}function Oa(e={}){const[t,n]=Ca({value:()=>D(e.open),defaultValue:()=>!!D(e.defaultOpen),onChange:s=>e.onOpenChange?.(s)}),r=()=>{n(!0)},o=()=>{n(!1)};return{isOpen:t,setIsOpen:n,open:r,close:o,toggle:()=>{t()?o():r()}}}function bg(e){const t=n=>{n.key===ma.Escape&&e.onEscapeKeyDown?.(n)};V(()=>{if(D(e.isDisabled))return;const n=e.ownerDocument?.()??it();n.addEventListener("keydown",t),Z(()=>{n.removeEventListener("keydown",t)})})}/*!
7
+ */function vg(e,t=[]){const n=Ho({dataSource:D(e.dataSource),getKey:D(e.getKey),getTextValue:D(e.getTextValue),getDisabled:D(e.getDisabled),getSectionChildren:D(e.getSectionChildren)}),[r,o]=L(e.factory(n));return V(Nt([()=>D(e.dataSource),()=>D(e.getKey),()=>D(e.getTextValue),()=>D(e.getDisabled),()=>D(e.getSectionChildren),()=>e.factory,...t],([i,s,a,l,c,u])=>{const d=Ho({dataSource:i,getKey:s,getTextValue:a,getDisabled:l,getSectionChildren:c});o(()=>u(d))},{defer:!0})),r}function Yo(e){const[t,n]=L(e.defaultValue?.()),r=A(()=>e.value?.()!==void 0),o=A(()=>r()?e.value?.():t());return[o,s=>{Q(()=>{const a=Ff(s,o());return Object.is(a,o())||(r()||n(a),e.onChange?.(a)),a})}]}function Pa(e){const[t,n]=Yo(e);return[()=>t()??!1,n]}function bg(e){const[t,n]=Yo(e);return[()=>t()??[],n]}function Ca(e={}){const[t,n]=Pa({value:()=>D(e.open),defaultValue:()=>!!D(e.defaultOpen),onChange:s=>e.onOpenChange?.(s)}),r=()=>{n(!0)},o=()=>{n(!1)};return{isOpen:t,setIsOpen:n,open:r,close:o,toggle:()=>{t()?o():r()}}}function wg(e){const t=n=>{n.key===pa.Escape&&e.onEscapeKeyDown?.(n)};V(()=>{if(D(e.isDisabled))return;const n=e.ownerDocument?.()??it();n.addEventListener("keydown",t),Z(()=>{n.removeEventListener("keydown",t)})})}/*!
8
8
  * Portions of this file are based on code from radix-ui-primitives.
9
9
  * MIT Licensed, Copyright (c) 2022 WorkOS.
10
10
  *
@@ -16,7 +16,7 @@
16
16
  *
17
17
  * Credits to the Chakra UI team:
18
18
  * https://github.com/chakra-ui/zag/blob/d1dbf9e240803c9e3ed81ebef363739be4273de0/packages/utilities/dismissable/src/layer-stack.ts
19
- */const Tr="data-kb-top-layer";let Da,qo=!1;const st=[];function Hn(e){return st.findIndex(t=>t.node===e)}function wg(e){return st[Hn(e)]}function xg(e){return st[st.length-1].node===e}function ka(){return st.filter(e=>e.isPointerBlocking)}function Sg(){return[...ka()].slice(-1)[0]}function Zo(){return ka().length>0}function Ta(e){const t=Hn(Sg()?.node);return Hn(e)<t}function Eg(e){st.push(e)}function Pg(e){const t=Hn(e);t<0||st.splice(t,1)}function Cg(){for(const{node:e}of st)e.style.pointerEvents=Ta(e)?"none":"auto"}function Og(e){if(Zo()&&!qo){const t=it(e);Da=document.body.style.pointerEvents,t.body.style.pointerEvents="none",qo=!0}}function Dg(e){if(Zo())return;const t=it(e);t.body.style.pointerEvents=Da,t.body.style.length===0&&t.body.removeAttribute("style"),qo=!1}const ke={layers:st,isTopMostLayer:xg,hasPointerBlockingLayer:Zo,isBelowPointerBlockingLayer:Ta,addLayer:Eg,removeLayer:Pg,indexOf:Hn,find:wg,assignPointerEventToLayers:Cg,disableBodyPointerEvents:Og,restoreBodyPointerEvents:Dg};/*!
19
+ */const kr="data-kb-top-layer";let Oa,Go=!1;const st=[];function Wn(e){return st.findIndex(t=>t.node===e)}function xg(e){return st[Wn(e)]}function Sg(e){return st[st.length-1].node===e}function Da(){return st.filter(e=>e.isPointerBlocking)}function Eg(){return[...Da()].slice(-1)[0]}function qo(){return Da().length>0}function ka(e){const t=Wn(Eg()?.node);return Wn(e)<t}function Pg(e){st.push(e)}function Cg(e){const t=Wn(e);t<0||st.splice(t,1)}function Og(){for(const{node:e}of st)e.style.pointerEvents=ka(e)?"none":"auto"}function Dg(e){if(qo()&&!Go){const t=it(e);Oa=document.body.style.pointerEvents,t.body.style.pointerEvents="none",Go=!0}}function kg(e){if(qo())return;const t=it(e);t.body.style.pointerEvents=Oa,t.body.style.length===0&&t.body.removeAttribute("style"),Go=!1}const ke={layers:st,isTopMostLayer:Sg,hasPointerBlockingLayer:qo,isBelowPointerBlockingLayer:ka,addLayer:Pg,removeLayer:Cg,indexOf:Wn,find:xg,assignPointerEventToLayers:Og,disableBodyPointerEvents:Dg,restoreBodyPointerEvents:kg};/*!
20
20
  * Portions of this file are based on code from radix-ui-primitives.
21
21
  * MIT Licensed, Copyright (c) 2022 WorkOS.
22
22
  *
@@ -29,19 +29,19 @@
29
29
  * Credits to the Chakra UI team:
30
30
  * https://github.com/chakra-ui/zag/blob/d1dbf9e240803c9e3ed81ebef363739be4273de0/packages/utilities/focus-scope/src/focus-on-child-unmount.ts
31
31
  * https://github.com/chakra-ui/zag/blob/d1dbf9e240803c9e3ed81ebef363739be4273de0/packages/utilities/focus-scope/src/focus-containment.ts
32
- */const Xo="focusScope.autoFocusOnMount",Jo="focusScope.autoFocusOnUnmount",$a={bubbles:!1,cancelable:!0},Aa={stack:[],active(){return this.stack[0]},add(e){e!==this.active()&&this.active()?.pause(),this.stack=Bo(this.stack,e),this.stack.unshift(e)},remove(e){this.stack=Bo(this.stack,e),this.active()?.resume()}};function kg(e,t){const[n,r]=L(!1),o={pause(){r(!0)},resume(){r(!1)}};let i=null;const s=g=>e.onMountAutoFocus?.(g),a=g=>e.onUnmountAutoFocus?.(g),l=()=>it(t()),c=()=>{const g=l().createElement("span");return g.setAttribute("data-focus-trap",""),g.tabIndex=0,Object.assign(g.style,mg),g},u=()=>{const g=t();return g?va(g,!0).filter(p=>!p.hasAttribute("data-focus-trap")):[]},d=()=>{const g=u();return g.length>0?g[0]:null},f=()=>{const g=u();return g.length>0?g[g.length-1]:null},m=()=>{const g=t();if(!g)return!1;const p=Un(g);return!p||Ze(g,p)?!1:wa(p)};V(()=>{const g=t();if(!g)return;Aa.add(o);const p=Un(g);if(!Ze(g,p)){const v=new CustomEvent(Xo,$a);g.addEventListener(Xo,s),g.dispatchEvent(v),v.defaultPrevented||setTimeout(()=>{xe(d()),Un(g)===p&&xe(g)},0)}Z(()=>{g.removeEventListener(Xo,s),setTimeout(()=>{const v=new CustomEvent(Jo,$a);m()&&v.preventDefault(),g.addEventListener(Jo,a),g.dispatchEvent(v),v.defaultPrevented||xe(p??l().body),g.removeEventListener(Jo,a),Aa.remove(o)},0)})}),V(()=>{const g=t();if(!g||!D(e.trapFocus)||n())return;const p=v=>{const b=v.target;b?.closest(`[${Tr}]`)||(Ze(g,b)?i=b:xe(i))},y=v=>{const w=v.relatedTarget??Un(g);w?.closest(`[${Tr}]`)||Ze(g,w)||xe(i)};l().addEventListener("focusin",p),l().addEventListener("focusout",y),Z(()=>{l().removeEventListener("focusin",p),l().removeEventListener("focusout",y)})}),V(()=>{const g=t();if(!g||!D(e.trapFocus)||n())return;const p=c();g.insertAdjacentElement("afterbegin",p);const y=c();g.insertAdjacentElement("beforeend",y);function v(w){const x=d(),T=f();w.relatedTarget===x?xe(T):xe(x)}p.addEventListener("focusin",v),y.addEventListener("focusin",v);const b=new MutationObserver(w=>{for(const x of w)x.previousSibling===y&&(y.remove(),g.insertAdjacentElement("beforeend",y)),x.nextSibling===p&&(p.remove(),g.insertAdjacentElement("afterbegin",p))});b.observe(g,{childList:!0,subtree:!1}),Z(()=>{p.removeEventListener("focusin",v),y.removeEventListener("focusin",v),p.remove(),y.remove(),b.disconnect()})})}/*!
32
+ */const Zo="focusScope.autoFocusOnMount",Xo="focusScope.autoFocusOnUnmount",Ta={bubbles:!1,cancelable:!0},$a={stack:[],active(){return this.stack[0]},add(e){e!==this.active()&&this.active()?.pause(),this.stack=zo(this.stack,e),this.stack.unshift(e)},remove(e){this.stack=zo(this.stack,e),this.active()?.resume()}};function Tg(e,t){const[n,r]=L(!1),o={pause(){r(!0)},resume(){r(!1)}};let i=null;const s=g=>e.onMountAutoFocus?.(g),a=g=>e.onUnmountAutoFocus?.(g),l=()=>it(t()),c=()=>{const g=l().createElement("span");return g.setAttribute("data-focus-trap",""),g.tabIndex=0,Object.assign(g.style,yg),g},u=()=>{const g=t();return g?ya(g,!0).filter(p=>!p.hasAttribute("data-focus-trap")):[]},d=()=>{const g=u();return g.length>0?g[0]:null},f=()=>{const g=u();return g.length>0?g[g.length-1]:null},m=()=>{const g=t();if(!g)return!1;const p=jn(g);return!p||Ze(g,p)?!1:ba(p)};V(()=>{const g=t();if(!g)return;$a.add(o);const p=jn(g);if(!Ze(g,p)){const v=new CustomEvent(Zo,Ta);g.addEventListener(Zo,s),g.dispatchEvent(v),v.defaultPrevented||setTimeout(()=>{Se(d()),jn(g)===p&&Se(g)},0)}Z(()=>{g.removeEventListener(Zo,s),setTimeout(()=>{const v=new CustomEvent(Xo,Ta);m()&&v.preventDefault(),g.addEventListener(Xo,a),g.dispatchEvent(v),v.defaultPrevented||Se(p??l().body),g.removeEventListener(Xo,a),$a.remove(o)},0)})}),V(()=>{const g=t();if(!g||!D(e.trapFocus)||n())return;const p=v=>{const b=v.target;b?.closest(`[${kr}]`)||(Ze(g,b)?i=b:Se(i))},y=v=>{const w=v.relatedTarget??jn(g);w?.closest(`[${kr}]`)||Ze(g,w)||Se(i)};l().addEventListener("focusin",p),l().addEventListener("focusout",y),Z(()=>{l().removeEventListener("focusin",p),l().removeEventListener("focusout",y)})}),V(()=>{const g=t();if(!g||!D(e.trapFocus)||n())return;const p=c();g.insertAdjacentElement("afterbegin",p);const y=c();g.insertAdjacentElement("beforeend",y);function v(w){const x=d(),T=f();w.relatedTarget===x?Se(T):Se(x)}p.addEventListener("focusin",v),y.addEventListener("focusin",v);const b=new MutationObserver(w=>{for(const x of w)x.previousSibling===y&&(y.remove(),g.insertAdjacentElement("beforeend",y)),x.nextSibling===p&&(p.remove(),g.insertAdjacentElement("afterbegin",p))});b.observe(g,{childList:!0,subtree:!1}),Z(()=>{p.removeEventListener("focusin",v),y.removeEventListener("focusin",v),p.remove(),y.remove(),b.disconnect()})})}/*!
33
33
  * Portions of this file are based on code from react-spectrum.
34
34
  * Apache License Version 2.0, Copyright 2020 Adobe.
35
35
  *
36
36
  * Credits to the React Spectrum team:
37
37
  * https://github.com/adobe/react-spectrum/blob/15e101b74966bd5eb719c6529ce71ce57eaed430/packages/@react-aria/live-announcer/src/LiveAnnouncer.tsx
38
- */const Tg="data-live-announcer";/*!
38
+ */const $g="data-live-announcer";/*!
39
39
  * This file is based on code from react-spectrum.
40
40
  * Apache License Version 2.0, Copyright 2020 Adobe.
41
41
  *
42
42
  * Credits to the React Spectrum team:
43
43
  * https://github.com/adobe/react-spectrum/blob/810579b671791f1593108f62cdc1893de3a220e3/packages/@react-aria/overlays/src/ariaHideOutside.ts
44
- */function $g(e){V(()=>{D(e.isDisabled)||Z(Ag(D(e.targets),D(e.root)))})}const Yn=new WeakMap,Fe=[];function Ag(e,t=document.body){const n=new Set(e),r=new Set,o=l=>{for(const f of l.querySelectorAll(`[${Tg}], [${Tr}]`))n.add(f);const c=f=>{if(n.has(f)||f.parentElement&&r.has(f.parentElement)&&f.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(const m of n)if(f.contains(m))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},u=document.createTreeWalker(l,NodeFilter.SHOW_ELEMENT,{acceptNode:c}),d=c(l);if(d===NodeFilter.FILTER_ACCEPT&&i(l),d!==NodeFilter.FILTER_REJECT){let f=u.nextNode();for(;f!=null;)i(f),f=u.nextNode()}},i=l=>{const c=Yn.get(l)??0;l.getAttribute("aria-hidden")==="true"&&c===0||(c===0&&l.setAttribute("aria-hidden","true"),r.add(l),Yn.set(l,c+1))};Fe.length&&Fe[Fe.length-1].disconnect(),o(t);const s=new MutationObserver(l=>{for(const c of l)if(!(c.type!=="childList"||c.addedNodes.length===0)&&![...n,...r].some(u=>u.contains(c.target))){for(const u of c.removedNodes)u instanceof Element&&(n.delete(u),r.delete(u));for(const u of c.addedNodes)(u instanceof HTMLElement||u instanceof SVGElement)&&(u.dataset.liveAnnouncer==="true"||u.dataset.reactAriaTopLayer==="true")?n.add(u):u instanceof Element&&o(u)}});s.observe(t,{childList:!0,subtree:!0});const a={observe(){s.observe(t,{childList:!0,subtree:!0})},disconnect(){s.disconnect()}};return Fe.push(a),()=>{s.disconnect();for(const l of r){const c=Yn.get(l);if(c==null)return;c===1?(l.removeAttribute("aria-hidden"),Yn.delete(l)):Yn.set(l,c-1)}a===Fe[Fe.length-1]?(Fe.pop(),Fe.length&&Fe[Fe.length-1].observe()):Fe.splice(Fe.indexOf(a),1)}}/*!
44
+ */function Ag(e){V(()=>{D(e.isDisabled)||Z(Mg(D(e.targets),D(e.root)))})}const Hn=new WeakMap,Fe=[];function Mg(e,t=document.body){const n=new Set(e),r=new Set,o=l=>{for(const f of l.querySelectorAll(`[${$g}], [${kr}]`))n.add(f);const c=f=>{if(n.has(f)||f.parentElement&&r.has(f.parentElement)&&f.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(const m of n)if(f.contains(m))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},u=document.createTreeWalker(l,NodeFilter.SHOW_ELEMENT,{acceptNode:c}),d=c(l);if(d===NodeFilter.FILTER_ACCEPT&&i(l),d!==NodeFilter.FILTER_REJECT){let f=u.nextNode();for(;f!=null;)i(f),f=u.nextNode()}},i=l=>{const c=Hn.get(l)??0;l.getAttribute("aria-hidden")==="true"&&c===0||(c===0&&l.setAttribute("aria-hidden","true"),r.add(l),Hn.set(l,c+1))};Fe.length&&Fe[Fe.length-1].disconnect(),o(t);const s=new MutationObserver(l=>{for(const c of l)if(!(c.type!=="childList"||c.addedNodes.length===0)&&![...n,...r].some(u=>u.contains(c.target))){for(const u of c.removedNodes)u instanceof Element&&(n.delete(u),r.delete(u));for(const u of c.addedNodes)(u instanceof HTMLElement||u instanceof SVGElement)&&(u.dataset.liveAnnouncer==="true"||u.dataset.reactAriaTopLayer==="true")?n.add(u):u instanceof Element&&o(u)}});s.observe(t,{childList:!0,subtree:!0});const a={observe(){s.observe(t,{childList:!0,subtree:!0})},disconnect(){s.disconnect()}};return Fe.push(a),()=>{s.disconnect();for(const l of r){const c=Hn.get(l);if(c==null)return;c===1?(l.removeAttribute("aria-hidden"),Hn.delete(l)):Hn.set(l,c-1)}a===Fe[Fe.length-1]?(Fe.pop(),Fe.length&&Fe[Fe.length-1].observe()):Fe.splice(Fe.indexOf(a),1)}}/*!
45
45
  * Portions of this file are based on code from radix-ui-primitives.
46
46
  * MIT Licensed, Copyright (c) 2022 WorkOS.
47
47
  *
@@ -53,44 +53,44 @@
53
53
  *
54
54
  * Credits to the Chakra UI team:
55
55
  * https://github.com/chakra-ui/zag/blob/d1dbf9e240803c9e3ed81ebef363739be4273de0/packages/utilities/interact-outside/src/index.ts
56
- */const Ma="interactOutside.pointerDownOutside",Ia="interactOutside.focusOutside";function Mg(e,t){let n,r=gg;const o=()=>it(t()),i=d=>e.onPointerDownOutside?.(d),s=d=>e.onFocusOutside?.(d),a=d=>e.onInteractOutside?.(d),l=d=>{const f=d.target;return!(f instanceof HTMLElement)||f.closest(`[${Tr}]`)||!Ze(o(),f)||Ze(t(),f)?!1:!e.shouldExcludeElement?.(f)},c=d=>{function f(){const m=t(),g=d.target;if(!m||!g||!l(d))return;const p=Ne([i,a]);g.addEventListener(Ma,p,{once:!0});const y=new CustomEvent(Ma,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:d.button===2||tg(d)&&d.button===0}});g.dispatchEvent(y)}d.pointerType==="touch"?(o().removeEventListener("click",f),r=f,o().addEventListener("click",f,{once:!0})):f()},u=d=>{const f=t(),m=d.target;if(!f||!m||!l(d))return;const g=Ne([s,a]);m.addEventListener(Ia,g,{once:!0});const p=new CustomEvent(Ia,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:!1}});m.dispatchEvent(p)};V(()=>{D(e.isDisabled)||(n=window.setTimeout(()=>{o().addEventListener("pointerdown",c,!0)},0),o().addEventListener("focusin",u,!0),Z(()=>{window.clearTimeout(n),o().removeEventListener("click",r),o().removeEventListener("pointerdown",c,!0),o().removeEventListener("focusin",u,!0)}))})}/*!
56
+ */const Aa="interactOutside.pointerDownOutside",Ma="interactOutside.focusOutside";function Ig(e,t){let n,r=hg;const o=()=>it(t()),i=d=>e.onPointerDownOutside?.(d),s=d=>e.onFocusOutside?.(d),a=d=>e.onInteractOutside?.(d),l=d=>{const f=d.target;return!(f instanceof HTMLElement)||f.closest(`[${kr}]`)||!Ze(o(),f)||Ze(t(),f)?!1:!e.shouldExcludeElement?.(f)},c=d=>{function f(){const m=t(),g=d.target;if(!m||!g||!l(d))return;const p=Ne([i,a]);g.addEventListener(Aa,p,{once:!0});const y=new CustomEvent(Aa,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:d.button===2||ng(d)&&d.button===0}});g.dispatchEvent(y)}d.pointerType==="touch"?(o().removeEventListener("click",f),r=f,o().addEventListener("click",f,{once:!0})):f()},u=d=>{const f=t(),m=d.target;if(!f||!m||!l(d))return;const g=Ne([s,a]);m.addEventListener(Ma,g,{once:!0});const p=new CustomEvent(Ma,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:!1}});m.dispatchEvent(p)};V(()=>{D(e.isDisabled)||(n=window.setTimeout(()=>{o().addEventListener("pointerdown",c,!0)},0),o().addEventListener("focusin",u,!0),Z(()=>{window.clearTimeout(n),o().removeEventListener("click",r),o().removeEventListener("pointerdown",c,!0),o().removeEventListener("focusin",u,!0)}))})}/*!
57
57
  * Portions of this file are based on code from radix-ui-primitives.
58
58
  * MIT Licensed, Copyright (c) 2022 WorkOS.
59
59
  *
60
60
  * Credits to the Radix UI team:
61
61
  * https://github.com/radix-ui/primitives/blob/21a7c97dc8efa79fecca36428eec49f187294085/packages/react/presence/src/Presence.tsx
62
62
  * https://github.com/radix-ui/primitives/blob/21a7c97dc8efa79fecca36428eec49f187294085/packages/react/presence/src/useStateMachine.tsx
63
- */function Ig(e){const[t,n]=L();let r={},o=e(),i="none";const[s,a]=Lg(e()?"mounted":"unmounted",{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return V(Nt(s,l=>{const c=$r(r);i=l==="mounted"?c:"none"})),V(Nt(e,l=>{if(o===l)return;const c=$r(r);l?a("MOUNT"):r?.display==="none"?a("UNMOUNT"):a(o&&i!==c?"ANIMATION_OUT":"UNMOUNT"),o=l})),V(Nt(t,l=>{if(l){const c=d=>{const m=$r(r).includes(d.animationName);d.target===l&&m&&a("ANIMATION_END")},u=d=>{d.target===l&&(i=$r(r))};l.addEventListener("animationstart",u),l.addEventListener("animationcancel",c),l.addEventListener("animationend",c),Z(()=>{l.removeEventListener("animationstart",u),l.removeEventListener("animationcancel",c),l.removeEventListener("animationend",c)})}else a("ANIMATION_END")})),{isPresent:()=>["mounted","unmountSuspended"].includes(s()),setRef:l=>{l&&(r=getComputedStyle(l)),n(l)}}}function $r(e){return e?.animationName||"none"}function Lg(e,t){const n=(s,a)=>t[s][a]??s,[r,o]=L(e);return[r,s=>{o(a=>n(a,s))}]}function Ar(e){return t=>(e(t),()=>e(void 0))}/*!
63
+ */function Lg(e){const[t,n]=L();let r={},o=e(),i="none";const[s,a]=Rg(e()?"mounted":"unmounted",{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return V(Nt(s,l=>{const c=Tr(r);i=l==="mounted"?c:"none"})),V(Nt(e,l=>{if(o===l)return;const c=Tr(r);l?a("MOUNT"):r?.display==="none"?a("UNMOUNT"):a(o&&i!==c?"ANIMATION_OUT":"UNMOUNT"),o=l})),V(Nt(t,l=>{if(l){const c=d=>{const m=Tr(r).includes(d.animationName);d.target===l&&m&&a("ANIMATION_END")},u=d=>{d.target===l&&(i=Tr(r))};l.addEventListener("animationstart",u),l.addEventListener("animationcancel",c),l.addEventListener("animationend",c),Z(()=>{l.removeEventListener("animationstart",u),l.removeEventListener("animationcancel",c),l.removeEventListener("animationend",c)})}else a("ANIMATION_END")})),{isPresent:()=>["mounted","unmountSuspended"].includes(s()),setRef:l=>{l&&(r=getComputedStyle(l)),n(l)}}}function Tr(e){return e?.animationName||"none"}function Rg(e,t){const n=(s,a)=>t[s][a]??s,[r,o]=L(e);return[r,s=>{o(a=>n(a,s))}]}function $r(e){return t=>(e(t),()=>e(void 0))}/*!
64
64
  * Portions of this file are based on code from ariakit.
65
65
  * MIT Licensed, Copyright (c) Diego Haz.
66
66
  *
67
67
  * Credits to the ariakit team:
68
68
  * https://github.com/ariakit/ariakit/blob/8a13899ff807bbf39f3d89d2d5964042ba4d5287/packages/ariakit-react-utils/src/hooks.ts
69
- */function La(e,t){const[n,r]=L(Ra(t?.()));return V(()=>{r(e()?.tagName.toLowerCase()||Ra(t?.()))}),n}function Ra(e){return sn(e)?e:void 0}/*!
69
+ */function Ia(e,t){const[n,r]=L(La(t?.()));return V(()=>{r(e()?.tagName.toLowerCase()||La(t?.()))}),n}function La(e){return sn(e)?e:void 0}/*!
70
70
  * Portions of this file are based on code from react-spectrum.
71
71
  * Apache License Version 2.0, Copyright 2020 Adobe.
72
72
  *
73
73
  * Credits to the React Spectrum team:
74
74
  * https://github.com/adobe/react-spectrum/blob/a13802d8be6f83af1450e56f7a88527b10d9cadf/packages/@react-stately/toggle/src/useToggleState.ts
75
- */function Rg(e={}){const[t,n]=Ca({value:()=>D(e.isSelected),defaultValue:()=>!!D(e.defaultIsSelected),onChange:i=>e.onSelectedChange?.(i)});return{isSelected:t,setIsSelected:i=>{!D(e.isReadOnly)&&!D(e.isDisabled)&&n(i)},toggle:()=>{!D(e.isReadOnly)&&!D(e.isDisabled)&&n(!t())}}}function an(e){const[t,n]=U(e,["asChild","as","children"]);if(!t.asChild)return h(Fn,I({get component(){return t.as}},n,{get children(){return t.children}}));const r=Oo(()=>t.children);if(Na(r())){const o=Fa(n,r()?.props??{});return h(Fn,o)}if(qf(r())){const o=r().find(Na);if(o){const i=()=>h(Zt,{get each(){return r()},children:a=>h(ie,{when:a===o,fallback:a,get children(){return o.props.children}})}),s=Fa(n,o?.props??{});return h(Fn,I(s,{children:i}))}}throw new Error("[kobalte]: Component is expected to render `asChild` but no children `As` component was found.")}const Ng=Symbol("$$KobalteAsComponent");function Na(e){return e?.[Ng]===!0}function Fa(e,t){return Hf([e,t],{reverseEventHandlers:!0})}/*!
75
+ */function Ng(e={}){const[t,n]=Pa({value:()=>D(e.isSelected),defaultValue:()=>!!D(e.defaultIsSelected),onChange:i=>e.onSelectedChange?.(i)});return{isSelected:t,setIsSelected:i=>{!D(e.isReadOnly)&&!D(e.isDisabled)&&n(i)},toggle:()=>{!D(e.isReadOnly)&&!D(e.isDisabled)&&n(!t())}}}function an(e){const[t,n]=U(e,["asChild","as","children"]);if(!t.asChild)return h(Nn,I({get component(){return t.as}},n,{get children(){return t.children}}));const r=Co(()=>t.children);if(Ra(r())){const o=Na(n,r()?.props??{});return h(Nn,o)}if(Zf(r())){const o=r().find(Ra);if(o){const i=()=>h(Zt,{get each(){return r()},children:a=>h(ie,{when:a===o,fallback:a,get children(){return o.props.children}})}),s=Na(n,o?.props??{});return h(Nn,I(s,{children:i}))}}throw new Error("[kobalte]: Component is expected to render `asChild` but no children `As` component was found.")}const Fg=Symbol("$$KobalteAsComponent");function Ra(e){return e?.[Fg]===!0}function Na(e,t){return Yf([e,t],{reverseEventHandlers:!0})}/*!
76
76
  * Portions of this file are based on code from react-spectrum.
77
77
  * Apache License Version 2.0, Copyright 2020 Adobe.
78
78
  *
79
79
  * Credits to the React Spectrum team:
80
80
  * https://github.com/adobe/react-spectrum/blob/b35d5c02fe900badccd0cf1a8f23bb593419f238/packages/@react-aria/i18n/src/utils.ts
81
- */const Fg=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),_g=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function Vg(e){if(Intl.Locale){const n=new Intl.Locale(e).maximize().script??"";return Fg.has(n)}const t=e.split("-")[0];return _g.has(t)}function Kg(e){return Vg(e)?"rtl":"ltr"}/*!
81
+ */const _g=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),Vg=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function Kg(e){if(Intl.Locale){const n=new Intl.Locale(e).maximize().script??"";return _g.has(n)}const t=e.split("-")[0];return Vg.has(t)}function zg(e){return Kg(e)?"rtl":"ltr"}/*!
82
82
  * Portions of this file are based on code from react-spectrum.
83
83
  * Apache License Version 2.0, Copyright 2020 Adobe.
84
84
  *
85
85
  * Credits to the React Spectrum team:
86
86
  * https://github.com/adobe/react-spectrum/blob/b35d5c02fe900badccd0cf1a8f23bb593419f238/packages/@react-aria/i18n/src/useDefaultLocale.ts
87
- */function _a(){let e=typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction:Kg(e)}}let Qo=_a();const Gn=new Set;function Va(){Qo=_a();for(const e of Gn)e(Qo)}function zg(){const[e,t]=L(Qo),n=A(()=>e());return Ft(()=>{Gn.size===0&&window.addEventListener("languagechange",Va),Gn.add(t),Z(()=>{Gn.delete(t),Gn.size===0&&window.removeEventListener("languagechange",Va)})}),{locale:()=>n().locale,direction:()=>n().direction}}const Bg=ye();function ei(){const e=zg();return ve(Bg)||e}/*!
87
+ */function Fa(){let e=typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction:zg(e)}}let Jo=Fa();const Yn=new Set;function _a(){Jo=Fa();for(const e of Yn)e(Jo)}function Bg(){const[e,t]=L(Jo),n=A(()=>e());return Ft(()=>{Yn.size===0&&window.addEventListener("languagechange",_a),Yn.add(t),Z(()=>{Yn.delete(t),Yn.size===0&&window.removeEventListener("languagechange",_a)})}),{locale:()=>n().locale,direction:()=>n().direction}}const jg=ve();function Qo(){const e=Bg();return be(jg)||e}/*!
88
88
  * Portions of this file are based on code from react-spectrum.
89
89
  * Apache License Version 2.0, Copyright 2020 Adobe.
90
90
  *
91
91
  * Credits to the React Spectrum team:
92
92
  * https://github.com/adobe/react-spectrum/blob/b35d5c02fe900badccd0cf1a8f23bb593419f238/packages/@react-aria/i18n/src/useCollator.ts
93
- */const ti=new Map;function jg(e){const{locale:t}=ei(),n=A(()=>t()+(e?Object.entries(e).sort((r,o)=>r[0]<o[0]?-1:1).join():""));return A(()=>{const r=n();let o;return ti.has(r)&&(o=ti.get(r)),o||(o=new Intl.Collator(t(),e),ti.set(r,o)),o})}function Ug(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ni(e,t,n){Ug(e,t),t.set(e,n)}/*!
93
+ */const ei=new Map;function Ug(e){const{locale:t}=Qo(),n=A(()=>t()+(e?Object.entries(e).sort((r,o)=>r[0]<o[0]?-1:1).join():""));return A(()=>{const r=n();let o;return ei.has(r)&&(o=ei.get(r)),o||(o=new Intl.Collator(t(),e),ei.set(r,o)),o})}function Wg(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ti(e,t,n){Wg(e,t),t.set(e,n)}/*!
94
94
  * Portions of this file are based on code from react-spectrum.
95
95
  * Apache License Version 2.0, Copyright 2020 Adobe.
96
96
  *
@@ -98,79 +98,79 @@
98
98
  * https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/selection/src/Selection.ts
99
99
  * https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/selection/src/types.ts
100
100
  * https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-types/shared/src/selection.d.ts
101
- */class je extends Set{anchorKey;currentKey;constructor(t,n,r){super(t),t instanceof je?(this.anchorKey=n||t.anchorKey,this.currentKey=r||t.currentKey):(this.anchorKey=n,this.currentKey=r)}}function Wg(e){const[t,n]=Go(e);return[()=>t()??new je,n]}/*!
101
+ */class je extends Set{anchorKey;currentKey;constructor(t,n,r){super(t),t instanceof je?(this.anchorKey=n||t.anchorKey,this.currentKey=r||t.currentKey):(this.anchorKey=n,this.currentKey=r)}}function Hg(e){const[t,n]=Yo(e);return[()=>t()??new je,n]}/*!
102
102
  * Portions of this file are based on code from react-spectrum.
103
103
  * Apache License Version 2.0, Copyright 2020 Adobe.
104
104
  *
105
105
  * Credits to the React Spectrum team:
106
106
  * https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/selection/src/utils.ts
107
- */function Ka(e){return eg()?e.altKey:e.ctrlKey}function ln(e){return Dr()?e.metaKey:e.ctrlKey}function za(e){return new je(e)}function Hg(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}/*!
107
+ */function Va(e){return tg()?e.altKey:e.ctrlKey}function ln(e){return Or()?e.metaKey:e.ctrlKey}function Ka(e){return new je(e)}function Yg(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}/*!
108
108
  * Portions of this file are based on code from react-spectrum.
109
109
  * Apache License Version 2.0, Copyright 2020 Adobe.
110
110
  *
111
111
  * Credits to the React Spectrum team:
112
112
  * https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/selection/src/useMultipleSelectionState.ts
113
- */function Yg(e){const t=De({selectionMode:"none",selectionBehavior:"toggle"},e),[n,r]=L(!1),[o,i]=L(),s=A(()=>{const p=D(t.selectedKeys);return p!=null?za(p):p}),a=A(()=>{const p=D(t.defaultSelectedKeys);return p!=null?za(p):new je}),[l,c]=Wg({value:s,defaultValue:a,onChange:p=>t.onSelectionChange?.(p)}),[u,d]=L(D(t.selectionBehavior)),f=()=>D(t.selectionMode),m=()=>D(t.disallowEmptySelection)??!1,g=p=>{(D(t.allowDuplicateSelectionEvents)||!Hg(p,l()))&&c(p)};return V(()=>{const p=l();D(t.selectionBehavior)==="replace"&&u()==="toggle"&&typeof p=="object"&&p.size===0&&d("replace")}),V(()=>{d(D(t.selectionBehavior)??"toggle")}),{selectionMode:f,disallowEmptySelection:m,selectionBehavior:u,setSelectionBehavior:d,isFocused:n,setFocused:r,focusedKey:o,setFocusedKey:i,selectedKeys:l,setSelectedKeys:g}}/*!
113
+ */function Gg(e){const t=De({selectionMode:"none",selectionBehavior:"toggle"},e),[n,r]=L(!1),[o,i]=L(),s=A(()=>{const p=D(t.selectedKeys);return p!=null?Ka(p):p}),a=A(()=>{const p=D(t.defaultSelectedKeys);return p!=null?Ka(p):new je}),[l,c]=Hg({value:s,defaultValue:a,onChange:p=>t.onSelectionChange?.(p)}),[u,d]=L(D(t.selectionBehavior)),f=()=>D(t.selectionMode),m=()=>D(t.disallowEmptySelection)??!1,g=p=>{(D(t.allowDuplicateSelectionEvents)||!Yg(p,l()))&&c(p)};return V(()=>{const p=l();D(t.selectionBehavior)==="replace"&&u()==="toggle"&&typeof p=="object"&&p.size===0&&d("replace")}),V(()=>{d(D(t.selectionBehavior)??"toggle")}),{selectionMode:f,disallowEmptySelection:m,selectionBehavior:u,setSelectionBehavior:d,isFocused:n,setFocused:r,focusedKey:o,setFocusedKey:i,selectedKeys:l,setSelectedKeys:g}}/*!
114
114
  * Portions of this file are based on code from react-spectrum.
115
115
  * Apache License Version 2.0, Copyright 2020 Adobe.
116
116
  *
117
117
  * Credits to the React Spectrum team:
118
118
  * https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/selection/src/useTypeSelect.ts
119
- */function Gg(e){const[t,n]=L(""),[r,o]=L(-1);return{typeSelectHandlers:{onKeyDown:s=>{if(D(e.isDisabled))return;const a=D(e.keyboardDelegate),l=D(e.selectionManager);if(!a.getKeyForSearch)return;const c=qg(s.key);if(!c||s.ctrlKey||s.metaKey)return;c===" "&&t().trim().length>0&&(s.preventDefault(),s.stopPropagation());let u=n(f=>f+c),d=a.getKeyForSearch(u,l.focusedKey())??a.getKeyForSearch(u);d==null&&Zg(u)&&(u=u[0],d=a.getKeyForSearch(u,l.focusedKey())??a.getKeyForSearch(u)),d!=null&&(l.setFocusedKey(d),e.onTypeSelect?.(d)),clearTimeout(r()),o(window.setTimeout(()=>n(""),500))}}}}function qg(e){return e.length===1||!/^[A-Z]/i.test(e)?e:""}function Zg(e){return e.split("").every(t=>t===e[0])}/*!
119
+ */function qg(e){const[t,n]=L(""),[r,o]=L(-1);return{typeSelectHandlers:{onKeyDown:s=>{if(D(e.isDisabled))return;const a=D(e.keyboardDelegate),l=D(e.selectionManager);if(!a.getKeyForSearch)return;const c=Zg(s.key);if(!c||s.ctrlKey||s.metaKey)return;c===" "&&t().trim().length>0&&(s.preventDefault(),s.stopPropagation());let u=n(f=>f+c),d=a.getKeyForSearch(u,l.focusedKey())??a.getKeyForSearch(u);d==null&&Xg(u)&&(u=u[0],d=a.getKeyForSearch(u,l.focusedKey())??a.getKeyForSearch(u)),d!=null&&(l.setFocusedKey(d),e.onTypeSelect?.(d)),clearTimeout(r()),o(window.setTimeout(()=>n(""),500))}}}}function Zg(e){return e.length===1||!/^[A-Z]/i.test(e)?e:""}function Xg(e){return e.split("").every(t=>t===e[0])}/*!
120
120
  * Portions of this file are based on code from react-spectrum.
121
121
  * Apache License Version 2.0, Copyright 2020 Adobe.
122
122
  *
123
123
  * Credits to the React Spectrum team:
124
124
  * https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/selection/src/useSelectableCollection.ts
125
- */function Xg(e,t,n){const o=I({selectOnFocus:()=>D(e.selectionManager).selectionBehavior()==="replace"},e),i=()=>n?.()??t(),{direction:s}=ei();let a={top:0,left:0};Vf(()=>D(o.isVirtualized)?void 0:i(),"scroll",()=>{const p=i();p&&(a={top:p.scrollTop,left:p.scrollLeft})});const{typeSelectHandlers:l}=Gg({isDisabled:()=>D(o.disallowTypeAhead),keyboardDelegate:()=>D(o.keyboardDelegate),selectionManager:()=>D(o.selectionManager)}),c=p=>{Oe(p,l.onKeyDown),p.altKey&&p.key==="Tab"&&p.preventDefault();const y=t();if(!y?.contains(p.target))return;const v=D(o.selectionManager),b=D(o.selectOnFocus),w=k=>{k!=null&&(v.setFocusedKey(k),p.shiftKey&&v.selectionMode()==="multiple"?v.extendSelection(k):b&&!Ka(p)&&v.replaceSelection(k))},x=D(o.keyboardDelegate),T=D(o.shouldFocusWrap),O=v.focusedKey();switch(p.key){case"ArrowDown":{if(x.getKeyBelow){p.preventDefault();let k;O!=null?k=x.getKeyBelow(O):k=x.getFirstKey?.(),k==null&&T&&(k=x.getFirstKey?.(O)),w(k)}break}case"ArrowUp":{if(x.getKeyAbove){p.preventDefault();let k;O!=null?k=x.getKeyAbove(O):k=x.getLastKey?.(),k==null&&T&&(k=x.getLastKey?.(O)),w(k)}break}case"ArrowLeft":{if(x.getKeyLeftOf){p.preventDefault();const k=s()==="rtl";let j;O!=null?j=x.getKeyLeftOf(O):j=k?x.getFirstKey?.():x.getLastKey?.(),w(j)}break}case"ArrowRight":{if(x.getKeyRightOf){p.preventDefault();const k=s()==="rtl";let j;O!=null?j=x.getKeyRightOf(O):j=k?x.getLastKey?.():x.getFirstKey?.(),w(j)}break}case"Home":if(x.getFirstKey){p.preventDefault();const k=x.getFirstKey(O,ln(p));k!=null&&(v.setFocusedKey(k),ln(p)&&p.shiftKey&&v.selectionMode()==="multiple"?v.extendSelection(k):b&&v.replaceSelection(k))}break;case"End":if(x.getLastKey){p.preventDefault();const k=x.getLastKey(O,ln(p));k!=null&&(v.setFocusedKey(k),ln(p)&&p.shiftKey&&v.selectionMode()==="multiple"?v.extendSelection(k):b&&v.replaceSelection(k))}break;case"PageDown":if(x.getKeyPageBelow&&O!=null){p.preventDefault();const k=x.getKeyPageBelow(O);w(k)}break;case"PageUp":if(x.getKeyPageAbove&&O!=null){p.preventDefault();const k=x.getKeyPageAbove(O);w(k)}break;case"a":ln(p)&&v.selectionMode()==="multiple"&&D(o.disallowSelectAll)!==!0&&(p.preventDefault(),v.selectAll());break;case"Escape":p.defaultPrevented||(p.preventDefault(),D(o.disallowEmptySelection)||v.clearSelection());break;case"Tab":if(!D(o.allowsTabNavigation)){if(p.shiftKey)y.focus();else{const k=dg(y,{tabbable:!0});let j,P;do P=k.lastChild(),P&&(j=P);while(P);j&&!j.contains(document.activeElement)&&xe(j)}break}}},u=p=>{const y=D(o.selectionManager),v=D(o.keyboardDelegate),b=D(o.selectOnFocus);if(y.isFocused()){p.currentTarget.contains(p.target)||y.setFocused(!1);return}if(p.currentTarget.contains(p.target)){if(y.setFocused(!0),y.focusedKey()==null){const w=T=>{T!=null&&(y.setFocusedKey(T),b&&y.replaceSelection(T))},x=p.relatedTarget;x&&p.currentTarget.compareDocumentPosition(x)&Node.DOCUMENT_POSITION_FOLLOWING?w(y.lastSelectedKey()??v.getLastKey?.()):w(y.firstSelectedKey()??v.getFirstKey?.())}else if(!D(o.isVirtualized)){const w=i();if(w){w.scrollTop=a.top,w.scrollLeft=a.left;const x=w.querySelector(`[data-key="${y.focusedKey()}"]`);x&&(xe(x),Ho(w,x))}}}},d=p=>{const y=D(o.selectionManager);p.currentTarget.contains(p.relatedTarget)||y.setFocused(!1)},f=p=>{i()===p.target&&p.preventDefault()},m=()=>{const p=D(o.autoFocus);if(!p)return;const y=D(o.selectionManager),v=D(o.keyboardDelegate);let b;p==="first"&&(b=v.getFirstKey?.()),p==="last"&&(b=v.getLastKey?.());const w=y.selectedKeys();w.size&&(b=w.values().next().value),y.setFocused(!0),y.setFocusedKey(b);const x=t();x&&b==null&&!D(o.shouldUseVirtualFocus)&&xe(x)};return Ft(()=>{o.deferAutoFocus?setTimeout(m,0):m()}),V(Nt([i,()=>D(o.isVirtualized),()=>D(o.selectionManager).focusedKey()],p=>{const[y,v,b]=p;if(v)b&&o.scrollToKey?.(b);else if(b&&y){const w=y.querySelector(`[data-key="${b}"]`);w&&Ho(y,w)}})),{tabIndex:A(()=>{if(!D(o.shouldUseVirtualFocus))return D(o.selectionManager).focusedKey()==null?0:-1}),onKeyDown:c,onMouseDown:f,onFocusIn:u,onFocusOut:d}}/*!
125
+ */function Jg(e,t,n){const o=I({selectOnFocus:()=>D(e.selectionManager).selectionBehavior()==="replace"},e),i=()=>n?.()??t(),{direction:s}=Qo();let a={top:0,left:0};Kf(()=>D(o.isVirtualized)?void 0:i(),"scroll",()=>{const p=i();p&&(a={top:p.scrollTop,left:p.scrollLeft})});const{typeSelectHandlers:l}=qg({isDisabled:()=>D(o.disallowTypeAhead),keyboardDelegate:()=>D(o.keyboardDelegate),selectionManager:()=>D(o.selectionManager)}),c=p=>{Oe(p,l.onKeyDown),p.altKey&&p.key==="Tab"&&p.preventDefault();const y=t();if(!y?.contains(p.target))return;const v=D(o.selectionManager),b=D(o.selectOnFocus),w=k=>{k!=null&&(v.setFocusedKey(k),p.shiftKey&&v.selectionMode()==="multiple"?v.extendSelection(k):b&&!Va(p)&&v.replaceSelection(k))},x=D(o.keyboardDelegate),T=D(o.shouldFocusWrap),O=v.focusedKey();switch(p.key){case"ArrowDown":{if(x.getKeyBelow){p.preventDefault();let k;O!=null?k=x.getKeyBelow(O):k=x.getFirstKey?.(),k==null&&T&&(k=x.getFirstKey?.(O)),w(k)}break}case"ArrowUp":{if(x.getKeyAbove){p.preventDefault();let k;O!=null?k=x.getKeyAbove(O):k=x.getLastKey?.(),k==null&&T&&(k=x.getLastKey?.(O)),w(k)}break}case"ArrowLeft":{if(x.getKeyLeftOf){p.preventDefault();const k=s()==="rtl";let j;O!=null?j=x.getKeyLeftOf(O):j=k?x.getFirstKey?.():x.getLastKey?.(),w(j)}break}case"ArrowRight":{if(x.getKeyRightOf){p.preventDefault();const k=s()==="rtl";let j;O!=null?j=x.getKeyRightOf(O):j=k?x.getLastKey?.():x.getFirstKey?.(),w(j)}break}case"Home":if(x.getFirstKey){p.preventDefault();const k=x.getFirstKey(O,ln(p));k!=null&&(v.setFocusedKey(k),ln(p)&&p.shiftKey&&v.selectionMode()==="multiple"?v.extendSelection(k):b&&v.replaceSelection(k))}break;case"End":if(x.getLastKey){p.preventDefault();const k=x.getLastKey(O,ln(p));k!=null&&(v.setFocusedKey(k),ln(p)&&p.shiftKey&&v.selectionMode()==="multiple"?v.extendSelection(k):b&&v.replaceSelection(k))}break;case"PageDown":if(x.getKeyPageBelow&&O!=null){p.preventDefault();const k=x.getKeyPageBelow(O);w(k)}break;case"PageUp":if(x.getKeyPageAbove&&O!=null){p.preventDefault();const k=x.getKeyPageAbove(O);w(k)}break;case"a":ln(p)&&v.selectionMode()==="multiple"&&D(o.disallowSelectAll)!==!0&&(p.preventDefault(),v.selectAll());break;case"Escape":p.defaultPrevented||(p.preventDefault(),D(o.disallowEmptySelection)||v.clearSelection());break;case"Tab":if(!D(o.allowsTabNavigation)){if(p.shiftKey)y.focus();else{const k=fg(y,{tabbable:!0});let j,P;do P=k.lastChild(),P&&(j=P);while(P);j&&!j.contains(document.activeElement)&&Se(j)}break}}},u=p=>{const y=D(o.selectionManager),v=D(o.keyboardDelegate),b=D(o.selectOnFocus);if(y.isFocused()){p.currentTarget.contains(p.target)||y.setFocused(!1);return}if(p.currentTarget.contains(p.target)){if(y.setFocused(!0),y.focusedKey()==null){const w=T=>{T!=null&&(y.setFocusedKey(T),b&&y.replaceSelection(T))},x=p.relatedTarget;x&&p.currentTarget.compareDocumentPosition(x)&Node.DOCUMENT_POSITION_FOLLOWING?w(y.lastSelectedKey()??v.getLastKey?.()):w(y.firstSelectedKey()??v.getFirstKey?.())}else if(!D(o.isVirtualized)){const w=i();if(w){w.scrollTop=a.top,w.scrollLeft=a.left;const x=w.querySelector(`[data-key="${y.focusedKey()}"]`);x&&(Se(x),Wo(w,x))}}}},d=p=>{const y=D(o.selectionManager);p.currentTarget.contains(p.relatedTarget)||y.setFocused(!1)},f=p=>{i()===p.target&&p.preventDefault()},m=()=>{const p=D(o.autoFocus);if(!p)return;const y=D(o.selectionManager),v=D(o.keyboardDelegate);let b;p==="first"&&(b=v.getFirstKey?.()),p==="last"&&(b=v.getLastKey?.());const w=y.selectedKeys();w.size&&(b=w.values().next().value),y.setFocused(!0),y.setFocusedKey(b);const x=t();x&&b==null&&!D(o.shouldUseVirtualFocus)&&Se(x)};return Ft(()=>{o.deferAutoFocus?setTimeout(m,0):m()}),V(Nt([i,()=>D(o.isVirtualized),()=>D(o.selectionManager).focusedKey()],p=>{const[y,v,b]=p;if(v)b&&o.scrollToKey?.(b);else if(b&&y){const w=y.querySelector(`[data-key="${b}"]`);w&&Wo(y,w)}})),{tabIndex:A(()=>{if(!D(o.shouldUseVirtualFocus))return D(o.selectionManager).focusedKey()==null?0:-1}),onKeyDown:c,onMouseDown:f,onFocusIn:u,onFocusOut:d}}/*!
126
126
  * Portions of this file are based on code from react-spectrum.
127
127
  * Apache License Version 2.0, Copyright 2020 Adobe.
128
128
  *
129
129
  * Credits to the React Spectrum team:
130
130
  * https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/selection/src/useSelectableItem.ts
131
- */function Jg(e,t){const n=()=>D(e.selectionManager),r=()=>D(e.key),o=()=>D(e.shouldUseVirtualFocus),i=b=>{n().selectionMode()!=="none"&&(n().selectionMode()==="single"?n().isSelected(r())&&!n().disallowEmptySelection()?n().toggleSelection(r()):n().replaceSelection(r()):b?.shiftKey?n().extendSelection(r()):n().selectionBehavior()==="toggle"||ln(b)||"pointerType"in b&&b.pointerType==="touch"?n().toggleSelection(r()):n().replaceSelection(r()))},s=()=>n().isSelected(r()),a=()=>D(e.disabled)||n().isDisabled(r()),l=()=>!a()&&n().canSelectItem(r());let c=null;const u=b=>{l()&&(c=b.pointerType,b.pointerType==="mouse"&&b.button===0&&!D(e.shouldSelectOnPressUp)&&i(b))},d=b=>{l()&&b.pointerType==="mouse"&&b.button===0&&D(e.shouldSelectOnPressUp)&&D(e.allowsDifferentPressOrigin)&&i(b)},f=b=>{l()&&(D(e.shouldSelectOnPressUp)&&!D(e.allowsDifferentPressOrigin)||c!=="mouse")&&i(b)},m=b=>{!l()||!["Enter"," "].includes(b.key)||(Ka(b)?n().toggleSelection(r()):i(b))},g=b=>{a()&&b.preventDefault()},p=b=>{const w=t();o()||a()||!w||b.target===w&&n().setFocusedKey(r())},y=A(()=>{if(!(o()||a()))return r()===n().focusedKey()?0:-1}),v=A(()=>D(e.virtualized)?void 0:r());return V(Nt([t,r,o,()=>n().focusedKey(),()=>n().isFocused()],([b,w,x,T,O])=>{b&&w===T&&O&&!x&&document.activeElement!==b&&(e.focus?e.focus():xe(b))})),{isSelected:s,isDisabled:a,allowsSelection:l,tabIndex:y,dataKey:v,onPointerDown:u,onPointerUp:d,onClick:f,onKeyDown:m,onMouseDown:g,onFocus:p}}/*!
131
+ */function Qg(e,t){const n=()=>D(e.selectionManager),r=()=>D(e.key),o=()=>D(e.shouldUseVirtualFocus),i=b=>{n().selectionMode()!=="none"&&(n().selectionMode()==="single"?n().isSelected(r())&&!n().disallowEmptySelection()?n().toggleSelection(r()):n().replaceSelection(r()):b?.shiftKey?n().extendSelection(r()):n().selectionBehavior()==="toggle"||ln(b)||"pointerType"in b&&b.pointerType==="touch"?n().toggleSelection(r()):n().replaceSelection(r()))},s=()=>n().isSelected(r()),a=()=>D(e.disabled)||n().isDisabled(r()),l=()=>!a()&&n().canSelectItem(r());let c=null;const u=b=>{l()&&(c=b.pointerType,b.pointerType==="mouse"&&b.button===0&&!D(e.shouldSelectOnPressUp)&&i(b))},d=b=>{l()&&b.pointerType==="mouse"&&b.button===0&&D(e.shouldSelectOnPressUp)&&D(e.allowsDifferentPressOrigin)&&i(b)},f=b=>{l()&&(D(e.shouldSelectOnPressUp)&&!D(e.allowsDifferentPressOrigin)||c!=="mouse")&&i(b)},m=b=>{!l()||!["Enter"," "].includes(b.key)||(Va(b)?n().toggleSelection(r()):i(b))},g=b=>{a()&&b.preventDefault()},p=b=>{const w=t();o()||a()||!w||b.target===w&&n().setFocusedKey(r())},y=A(()=>{if(!(o()||a()))return r()===n().focusedKey()?0:-1}),v=A(()=>D(e.virtualized)?void 0:r());return V(Nt([t,r,o,()=>n().focusedKey(),()=>n().isFocused()],([b,w,x,T,O])=>{b&&w===T&&O&&!x&&document.activeElement!==b&&(e.focus?e.focus():Se(b))})),{isSelected:s,isDisabled:a,allowsSelection:l,tabIndex:y,dataKey:v,onPointerDown:u,onPointerUp:d,onClick:f,onKeyDown:m,onMouseDown:g,onFocus:p}}/*!
132
132
  * Portions of this file are based on code from react-spectrum.
133
133
  * Apache License Version 2.0, Copyright 2020 Adobe.
134
134
  *
135
135
  * Credits to the React Spectrum team:
136
136
  * https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/selection/src/SelectionManager.ts
137
- */class Qg{collection;state;constructor(t,n){this.collection=t,this.state=n}selectionMode(){return this.state.selectionMode()}disallowEmptySelection(){return this.state.disallowEmptySelection()}selectionBehavior(){return this.state.selectionBehavior()}setSelectionBehavior(t){this.state.setSelectionBehavior(t)}isFocused(){return this.state.isFocused()}setFocused(t){this.state.setFocused(t)}focusedKey(){return this.state.focusedKey()}setFocusedKey(t){(t==null||this.collection().getItem(t))&&this.state.setFocusedKey(t)}selectedKeys(){return this.state.selectedKeys()}isSelected(t){if(this.state.selectionMode()==="none")return!1;const n=this.getKey(t);return n==null?!1:this.state.selectedKeys().has(n)}isEmpty(){return this.state.selectedKeys().size===0}isSelectAll(){if(this.isEmpty())return!1;const t=this.state.selectedKeys();return this.getAllSelectableKeys().every(n=>t.has(n))}firstSelectedKey(){let t;for(const n of this.state.selectedKeys()){const r=this.collection().getItem(n),o=r?.index!=null&&t?.index!=null&&r.index<t.index;(!t||o)&&(t=r)}return t?.key}lastSelectedKey(){let t;for(const n of this.state.selectedKeys()){const r=this.collection().getItem(n),o=r?.index!=null&&t?.index!=null&&r.index>t.index;(!t||o)&&(t=r)}return t?.key}extendSelection(t){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"){this.replaceSelection(t);return}const n=this.getKey(t);if(n==null)return;const r=this.state.selectedKeys(),o=r.anchorKey||n,i=new je(r,o,n);for(const s of this.getKeyRange(o,r.currentKey||n))i.delete(s);for(const s of this.getKeyRange(n,o))this.canSelectItem(s)&&i.add(s);this.state.setSelectedKeys(i)}getKeyRange(t,n){const r=this.collection().getItem(t),o=this.collection().getItem(n);return r&&o?r.index!=null&&o.index!=null&&r.index<=o.index?this.getKeyRangeInternal(t,n):this.getKeyRangeInternal(n,t):[]}getKeyRangeInternal(t,n){const r=[];let o=t;for(;o!=null;){const i=this.collection().getItem(o);if(i&&i.type==="item"&&r.push(o),o===n)return r;o=this.collection().getKeyAfter(o)}return[]}getKey(t){const n=this.collection().getItem(t);return n?!n||n.type!=="item"?null:n.key:t}toggleSelection(t){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"&&!this.isSelected(t)){this.replaceSelection(t);return}const n=this.getKey(t);if(n==null)return;const r=new je(this.state.selectedKeys());r.has(n)?r.delete(n):this.canSelectItem(n)&&(r.add(n),r.anchorKey=n,r.currentKey=n),!(this.disallowEmptySelection()&&r.size===0)&&this.state.setSelectedKeys(r)}replaceSelection(t){if(this.selectionMode()==="none")return;const n=this.getKey(t);if(n==null)return;const r=this.canSelectItem(n)?new je([n],n,n):new je;this.state.setSelectedKeys(r)}setSelectedKeys(t){if(this.selectionMode()==="none")return;const n=new je;for(const r of t){const o=this.getKey(r);if(o!=null&&(n.add(o),this.selectionMode()==="single"))break}this.state.setSelectedKeys(n)}selectAll(){this.selectionMode()==="multiple"&&this.state.setSelectedKeys(new Set(this.getAllSelectableKeys()))}clearSelection(){const t=this.state.selectedKeys();!this.disallowEmptySelection()&&t.size>0&&this.state.setSelectedKeys(new je)}toggleSelectAll(){this.isSelectAll()?this.clearSelection():this.selectAll()}select(t,n){this.selectionMode()!=="none"&&(this.selectionMode()==="single"?this.isSelected(t)&&!this.disallowEmptySelection()?this.toggleSelection(t):this.replaceSelection(t):this.selectionBehavior()==="toggle"||n&&n.pointerType==="touch"?this.toggleSelection(t):this.replaceSelection(t))}isSelectionEqual(t){if(t===this.state.selectedKeys())return!0;const n=this.selectedKeys();if(t.size!==n.size)return!1;for(const r of t)if(!n.has(r))return!1;for(const r of n)if(!t.has(r))return!1;return!0}canSelectItem(t){if(this.state.selectionMode()==="none")return!1;const n=this.collection().getItem(t);return n!=null&&!n.disabled}isDisabled(t){const n=this.collection().getItem(t);return!n||n.disabled}getAllSelectableKeys(){const t=[];return(r=>{for(;r!=null;){if(this.canSelectItem(r)){const o=this.collection().getItem(r);if(!o)continue;o.type==="item"&&t.push(r)}r=this.collection().getKeyAfter(r)}})(this.collection().getFirstKey()),t}}/*!
137
+ */class eh{collection;state;constructor(t,n){this.collection=t,this.state=n}selectionMode(){return this.state.selectionMode()}disallowEmptySelection(){return this.state.disallowEmptySelection()}selectionBehavior(){return this.state.selectionBehavior()}setSelectionBehavior(t){this.state.setSelectionBehavior(t)}isFocused(){return this.state.isFocused()}setFocused(t){this.state.setFocused(t)}focusedKey(){return this.state.focusedKey()}setFocusedKey(t){(t==null||this.collection().getItem(t))&&this.state.setFocusedKey(t)}selectedKeys(){return this.state.selectedKeys()}isSelected(t){if(this.state.selectionMode()==="none")return!1;const n=this.getKey(t);return n==null?!1:this.state.selectedKeys().has(n)}isEmpty(){return this.state.selectedKeys().size===0}isSelectAll(){if(this.isEmpty())return!1;const t=this.state.selectedKeys();return this.getAllSelectableKeys().every(n=>t.has(n))}firstSelectedKey(){let t;for(const n of this.state.selectedKeys()){const r=this.collection().getItem(n),o=r?.index!=null&&t?.index!=null&&r.index<t.index;(!t||o)&&(t=r)}return t?.key}lastSelectedKey(){let t;for(const n of this.state.selectedKeys()){const r=this.collection().getItem(n),o=r?.index!=null&&t?.index!=null&&r.index>t.index;(!t||o)&&(t=r)}return t?.key}extendSelection(t){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"){this.replaceSelection(t);return}const n=this.getKey(t);if(n==null)return;const r=this.state.selectedKeys(),o=r.anchorKey||n,i=new je(r,o,n);for(const s of this.getKeyRange(o,r.currentKey||n))i.delete(s);for(const s of this.getKeyRange(n,o))this.canSelectItem(s)&&i.add(s);this.state.setSelectedKeys(i)}getKeyRange(t,n){const r=this.collection().getItem(t),o=this.collection().getItem(n);return r&&o?r.index!=null&&o.index!=null&&r.index<=o.index?this.getKeyRangeInternal(t,n):this.getKeyRangeInternal(n,t):[]}getKeyRangeInternal(t,n){const r=[];let o=t;for(;o!=null;){const i=this.collection().getItem(o);if(i&&i.type==="item"&&r.push(o),o===n)return r;o=this.collection().getKeyAfter(o)}return[]}getKey(t){const n=this.collection().getItem(t);return n?!n||n.type!=="item"?null:n.key:t}toggleSelection(t){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"&&!this.isSelected(t)){this.replaceSelection(t);return}const n=this.getKey(t);if(n==null)return;const r=new je(this.state.selectedKeys());r.has(n)?r.delete(n):this.canSelectItem(n)&&(r.add(n),r.anchorKey=n,r.currentKey=n),!(this.disallowEmptySelection()&&r.size===0)&&this.state.setSelectedKeys(r)}replaceSelection(t){if(this.selectionMode()==="none")return;const n=this.getKey(t);if(n==null)return;const r=this.canSelectItem(n)?new je([n],n,n):new je;this.state.setSelectedKeys(r)}setSelectedKeys(t){if(this.selectionMode()==="none")return;const n=new je;for(const r of t){const o=this.getKey(r);if(o!=null&&(n.add(o),this.selectionMode()==="single"))break}this.state.setSelectedKeys(n)}selectAll(){this.selectionMode()==="multiple"&&this.state.setSelectedKeys(new Set(this.getAllSelectableKeys()))}clearSelection(){const t=this.state.selectedKeys();!this.disallowEmptySelection()&&t.size>0&&this.state.setSelectedKeys(new je)}toggleSelectAll(){this.isSelectAll()?this.clearSelection():this.selectAll()}select(t,n){this.selectionMode()!=="none"&&(this.selectionMode()==="single"?this.isSelected(t)&&!this.disallowEmptySelection()?this.toggleSelection(t):this.replaceSelection(t):this.selectionBehavior()==="toggle"||n&&n.pointerType==="touch"?this.toggleSelection(t):this.replaceSelection(t))}isSelectionEqual(t){if(t===this.state.selectedKeys())return!0;const n=this.selectedKeys();if(t.size!==n.size)return!1;for(const r of t)if(!n.has(r))return!1;for(const r of n)if(!t.has(r))return!1;return!0}canSelectItem(t){if(this.state.selectionMode()==="none")return!1;const n=this.collection().getItem(t);return n!=null&&!n.disabled}isDisabled(t){const n=this.collection().getItem(t);return!n||n.disabled}getAllSelectableKeys(){const t=[];return(r=>{for(;r!=null;){if(this.canSelectItem(r)){const o=this.collection().getItem(r);if(!o)continue;o.type==="item"&&t.push(r)}r=this.collection().getKeyAfter(r)}})(this.collection().getFirstKey()),t}}/*!
138
138
  * Portions of this file are based on code from react-spectrum.
139
139
  * Apache License Version 2.0, Copyright 2020 Adobe.
140
140
  *
141
141
  * Credits to the React Spectrum team:
142
142
  * https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/list/src/ListCollection.ts
143
- */class Ba{keyMap=new Map;iterable;firstKey;lastKey;constructor(t){this.iterable=t;for(const o of t)this.keyMap.set(o.key,o);if(this.keyMap.size===0)return;let n,r=0;for(const[o,i]of this.keyMap)n?(n.nextKey=o,i.prevKey=n.key):(this.firstKey=o,i.prevKey=void 0),i.type==="item"&&(i.index=r++),n=i,n.nextKey=void 0;this.lastKey=n.key}*[Symbol.iterator](){yield*this.iterable}getSize(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(t){return this.keyMap.get(t)?.prevKey}getKeyAfter(t){return this.keyMap.get(t)?.nextKey}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(t){return this.keyMap.get(t)}at(t){const n=[...this.getKeys()];return this.getItem(n[t])}}/*!
143
+ */class za{keyMap=new Map;iterable;firstKey;lastKey;constructor(t){this.iterable=t;for(const o of t)this.keyMap.set(o.key,o);if(this.keyMap.size===0)return;let n,r=0;for(const[o,i]of this.keyMap)n?(n.nextKey=o,i.prevKey=n.key):(this.firstKey=o,i.prevKey=void 0),i.type==="item"&&(i.index=r++),n=i,n.nextKey=void 0;this.lastKey=n.key}*[Symbol.iterator](){yield*this.iterable}getSize(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(t){return this.keyMap.get(t)?.prevKey}getKeyAfter(t){return this.keyMap.get(t)?.nextKey}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(t){return this.keyMap.get(t)}at(t){const n=[...this.getKeys()];return this.getItem(n[t])}}/*!
144
144
  * Portions of this file are based on code from react-spectrum.
145
145
  * Apache License Version 2.0, Copyright 2020 Adobe.
146
146
  *
147
147
  * Credits to the React Spectrum team:
148
148
  * https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/list/src/useListState.ts
149
- */function eh(e){const t=Yg(e),r=yg({dataSource:()=>D(e.dataSource),getKey:()=>D(e.getKey),getTextValue:()=>D(e.getTextValue),getDisabled:()=>D(e.getDisabled),getSectionChildren:()=>D(e.getSectionChildren),factory:i=>e.filter?new Ba(e.filter(i)):new Ba(i)},[()=>e.filter]),o=new Qg(r,t);return Po(()=>{const i=t.focusedKey();i!=null&&!r().getItem(i)&&t.setFocusedKey(void 0)}),{collection:r,selectionManager:()=>o}}/*!
149
+ */function th(e){const t=Gg(e),r=vg({dataSource:()=>D(e.dataSource),getKey:()=>D(e.getKey),getTextValue:()=>D(e.getTextValue),getDisabled:()=>D(e.getDisabled),getSectionChildren:()=>D(e.getSectionChildren),factory:i=>e.filter?new za(e.filter(i)):new za(i)},[()=>e.filter]),o=new eh(r,t);return Eo(()=>{const i=t.focusedKey();i!=null&&!r().getItem(i)&&t.setFocusedKey(void 0)}),{collection:r,selectionManager:()=>o}}/*!
150
150
  * Portions of this file are based on code from react-spectrum.
151
151
  * Apache License Version 2.0, Copyright 2020 Adobe.
152
152
  *
153
153
  * Credits to the React Spectrum team:
154
154
  * https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/selection/src/ListKeyboardDelegate.ts
155
- */class th{collection;ref;collator;constructor(t,n,r){this.collection=t,this.ref=n,this.collator=r}getKeyBelow(t){let n=this.collection().getKeyAfter(t);for(;n!=null;){const r=this.collection().getItem(n);if(r&&r.type==="item"&&!r.disabled)return n;n=this.collection().getKeyAfter(n)}}getKeyAbove(t){let n=this.collection().getKeyBefore(t);for(;n!=null;){const r=this.collection().getItem(n);if(r&&r.type==="item"&&!r.disabled)return n;n=this.collection().getKeyBefore(n)}}getFirstKey(){let t=this.collection().getFirstKey();for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyAfter(t)}}getLastKey(){let t=this.collection().getLastKey();for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyBefore(t)}}getItem(t){return this.ref?.()?.querySelector(`[data-key="${t}"]`)??null}getKeyPageAbove(t){const n=this.ref?.();let r=this.getItem(t);if(!n||!r)return;const o=Math.max(0,r.offsetTop+r.offsetHeight-n.offsetHeight);let i=t;for(;i&&r&&r.offsetTop>o;)i=this.getKeyAbove(i),r=i!=null?this.getItem(i):null;return i}getKeyPageBelow(t){const n=this.ref?.();let r=this.getItem(t);if(!n||!r)return;const o=Math.min(n.scrollHeight,r.offsetTop-r.offsetHeight+n.offsetHeight);let i=t;for(;i&&r&&r.offsetTop<o;)i=this.getKeyBelow(i),r=i!=null?this.getItem(i):null;return i}getKeyForSearch(t,n){const r=this.collator?.();if(!r)return;let o=n!=null?this.getKeyBelow(n):this.getFirstKey();for(;o!=null;){const i=this.collection().getItem(o);if(i){const s=i.textValue.slice(0,t.length);if(i.textValue&&r.compare(s,t)===0)return o}o=this.getKeyBelow(o)}}}/*!
155
+ */class nh{collection;ref;collator;constructor(t,n,r){this.collection=t,this.ref=n,this.collator=r}getKeyBelow(t){let n=this.collection().getKeyAfter(t);for(;n!=null;){const r=this.collection().getItem(n);if(r&&r.type==="item"&&!r.disabled)return n;n=this.collection().getKeyAfter(n)}}getKeyAbove(t){let n=this.collection().getKeyBefore(t);for(;n!=null;){const r=this.collection().getItem(n);if(r&&r.type==="item"&&!r.disabled)return n;n=this.collection().getKeyBefore(n)}}getFirstKey(){let t=this.collection().getFirstKey();for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyAfter(t)}}getLastKey(){let t=this.collection().getLastKey();for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyBefore(t)}}getItem(t){return this.ref?.()?.querySelector(`[data-key="${t}"]`)??null}getKeyPageAbove(t){const n=this.ref?.();let r=this.getItem(t);if(!n||!r)return;const o=Math.max(0,r.offsetTop+r.offsetHeight-n.offsetHeight);let i=t;for(;i&&r&&r.offsetTop>o;)i=this.getKeyAbove(i),r=i!=null?this.getItem(i):null;return i}getKeyPageBelow(t){const n=this.ref?.();let r=this.getItem(t);if(!n||!r)return;const o=Math.min(n.scrollHeight,r.offsetTop-r.offsetHeight+n.offsetHeight);let i=t;for(;i&&r&&r.offsetTop<o;)i=this.getKeyBelow(i),r=i!=null?this.getItem(i):null;return i}getKeyForSearch(t,n){const r=this.collator?.();if(!r)return;let o=n!=null?this.getKeyBelow(n):this.getFirstKey();for(;o!=null;){const i=this.collection().getItem(o);if(i){const s=i.textValue.slice(0,t.length);if(i.textValue&&r.compare(s,t)===0)return o}o=this.getKeyBelow(o)}}}/*!
156
156
  * Portions of this file are based on code from react-spectrum.
157
157
  * Apache License Version 2.0, Copyright 2020 Adobe.
158
158
  *
159
159
  * Credits to the React Spectrum team:
160
160
  * https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/selection/src/useSelectableList.ts
161
- */function nh(e,t,n){const r=jg({usage:"search",sensitivity:"base"}),o=A(()=>{const i=D(e.keyboardDelegate);return i||new th(e.collection,t,r)});return Xg({selectionManager:()=>D(e.selectionManager),keyboardDelegate:o,autoFocus:()=>D(e.autoFocus),deferAutoFocus:()=>D(e.deferAutoFocus),shouldFocusWrap:()=>D(e.shouldFocusWrap),disallowEmptySelection:()=>D(e.disallowEmptySelection),selectOnFocus:()=>D(e.selectOnFocus),disallowTypeAhead:()=>D(e.disallowTypeAhead),shouldUseVirtualFocus:()=>D(e.shouldUseVirtualFocus),allowsTabNavigation:()=>D(e.allowsTabNavigation),isVirtualized:()=>D(e.isVirtualized),scrollToKey:i=>D(e.scrollToKey)?.(i)},t,n)}/*!
161
+ */function rh(e,t,n){const r=Ug({usage:"search",sensitivity:"base"}),o=A(()=>{const i=D(e.keyboardDelegate);return i||new nh(e.collection,t,r)});return Jg({selectionManager:()=>D(e.selectionManager),keyboardDelegate:o,autoFocus:()=>D(e.autoFocus),deferAutoFocus:()=>D(e.deferAutoFocus),shouldFocusWrap:()=>D(e.shouldFocusWrap),disallowEmptySelection:()=>D(e.disallowEmptySelection),selectOnFocus:()=>D(e.selectOnFocus),disallowTypeAhead:()=>D(e.disallowTypeAhead),shouldUseVirtualFocus:()=>D(e.shouldUseVirtualFocus),allowsTabNavigation:()=>D(e.allowsTabNavigation),isVirtualized:()=>D(e.isVirtualized),scrollToKey:i=>D(e.scrollToKey)?.(i)},t,n)}/*!
162
162
  * Portions of this file are based on code from ariakit
163
163
  * MIT Licensed, Copyright (c) Diego Haz.
164
164
  *
165
165
  * Credits to the ariakit team:
166
166
  * https://github.com/hope-ui/hope-ui/blob/54125b130195f37161dbeeea0c21dc3b198bc3ac/packages/core/src/button/is-button.ts
167
- */const rh=["button","color","file","image","reset","submit"];function oh(e){const t=e.tagName.toLowerCase();return t==="button"?!0:t==="input"&&e.type?rh.indexOf(e.type)!==-1:!1}function ih(e){let t;const n=De({type:"button"},e),[r,o]=U(n,["ref","type","disabled"]),i=La(()=>t,()=>"button"),s=A(()=>{const c=i();return c==null?!1:oh({tagName:c,type:r.type})}),a=A(()=>i()==="input"),l=A(()=>i()==="a"&&t?.getAttribute("href")!=null);return h(an,I({as:"button",ref(c){var u=Ct(d=>t=d,r.ref);typeof u=="function"&&u(c)},get type(){return s()||a()?r.type:void 0},get role(){return!s()&&!l()?"button":void 0},get tabIndex(){return!s()&&!l()&&!r.disabled?0:void 0},get disabled(){return s()||a()?r.disabled:void 0},get"aria-disabled"(){return!s()&&!a()&&r.disabled?!0:void 0},get"data-disabled"(){return r.disabled?"":void 0}},o))}const ja=ye();function Ua(){return ve(ja)}function sh(){const e=Ua();if(e===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}/*!
167
+ */const oh=["button","color","file","image","reset","submit"];function ih(e){const t=e.tagName.toLowerCase();return t==="button"?!0:t==="input"&&e.type?oh.indexOf(e.type)!==-1:!1}function sh(e){let t;const n=De({type:"button"},e),[r,o]=U(n,["ref","type","disabled"]),i=Ia(()=>t,()=>"button"),s=A(()=>{const c=i();return c==null?!1:ih({tagName:c,type:r.type})}),a=A(()=>i()==="input"),l=A(()=>i()==="a"&&t?.getAttribute("href")!=null);return h(an,I({as:"button",ref(c){var u=Ct(d=>t=d,r.ref);typeof u=="function"&&u(c)},get type(){return s()||a()?r.type:void 0},get role(){return!s()&&!l()?"button":void 0},get tabIndex(){return!s()&&!l()&&!r.disabled?0:void 0},get disabled(){return s()||a()?r.disabled:void 0},get"aria-disabled"(){return!s()&&!a()&&r.disabled?!0:void 0},get"data-disabled"(){return r.disabled?"":void 0}},o))}const Ba=ve();function ja(){return be(Ba)}function ah(){const e=ja();if(e===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}/*!
168
168
  * Portions of this file are based on code from ariakit.
169
169
  * MIT Licensed, Copyright (c) Diego Haz.
170
170
  *
171
171
  * Credits to the Ariakit team:
172
172
  * https://github.com/ariakit/ariakit/blob/da142672eddefa99365773ced72171facc06fdcb/packages/ariakit/src/collection/collection-state.ts
173
- */function Wa(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function ah(e,t){const n=t.ref();if(!n)return-1;let r=e.length;if(!r)return-1;for(;r--;){const o=e[r]?.ref();if(o&&Wa(o,n))return r+1}return 0}function lh(e){const t=e.map((r,o)=>[o,r]);let n=!1;return t.sort(([r,o],[i,s])=>{const a=o.ref(),l=s.ref();return a===l||!a||!l?0:Wa(a,l)?(r>i&&(n=!0),-1):(r<i&&(n=!0),1)}),n?t.map(([r,o])=>o):e}function Ha(e,t){const n=lh(e);e!==n&&t(n)}function ch(e){const t=e[0],n=e[e.length-1]?.ref();let r=t?.ref()?.parentElement;for(;r;){if(n&&r.contains(n))return r;r=r.parentElement}return it(r).body}function uh(e,t){V(()=>{const n=setTimeout(()=>{Ha(e(),t)});Z(()=>clearTimeout(n))})}function dh(e,t){if(typeof IntersectionObserver!="function"){uh(e,t);return}let n=[];V(()=>{const r=()=>{const s=!!n.length;n=e(),s&&Ha(e(),t)},o=ch(e()),i=new IntersectionObserver(r,{root:o});for(const s of e()){const a=s.ref();a&&i.observe(a)}Z(()=>i.disconnect())})}/*!
173
+ */function Ua(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function lh(e,t){const n=t.ref();if(!n)return-1;let r=e.length;if(!r)return-1;for(;r--;){const o=e[r]?.ref();if(o&&Ua(o,n))return r+1}return 0}function ch(e){const t=e.map((r,o)=>[o,r]);let n=!1;return t.sort(([r,o],[i,s])=>{const a=o.ref(),l=s.ref();return a===l||!a||!l?0:Ua(a,l)?(r>i&&(n=!0),-1):(r<i&&(n=!0),1)}),n?t.map(([r,o])=>o):e}function Wa(e,t){const n=ch(e);e!==n&&t(n)}function uh(e){const t=e[0],n=e[e.length-1]?.ref();let r=t?.ref()?.parentElement;for(;r;){if(n&&r.contains(n))return r;r=r.parentElement}return it(r).body}function dh(e,t){V(()=>{const n=setTimeout(()=>{Wa(e(),t)});Z(()=>clearTimeout(n))})}function fh(e,t){if(typeof IntersectionObserver!="function"){dh(e,t);return}let n=[];V(()=>{const r=()=>{const s=!!n.length;n=e(),s&&Wa(e(),t)},o=uh(e()),i=new IntersectionObserver(r,{root:o});for(const s of e()){const a=s.ref();a&&i.observe(a)}Z(()=>i.disconnect())})}/*!
174
174
  * Portions of this file are based on code from ariakit.
175
175
  * MIT Licensed, Copyright (c) Diego Haz.
176
176
  *
@@ -178,10 +178,10 @@
178
178
  * https://github.com/ariakit/ariakit/blob/da142672eddefa99365773ced72171facc06fdcb/packages/ariakit/src/collection/collection.tsx
179
179
  * https://github.com/ariakit/ariakit/blob/da142672eddefa99365773ced72171facc06fdcb/packages/ariakit/src/collection/collection-state.ts
180
180
  * https://github.com/ariakit/ariakit/blob/da142672eddefa99365773ced72171facc06fdcb/packages/ariakit/src/collection/collection-item.ts
181
- */function fh(e={}){const[t,n]=vg({value:()=>D(e.items),onChange:i=>e.onItemsChange?.(i)});dh(t,n);const r=i=>(n(s=>{const a=ah(s,i);return Yf(s,i,a)}),()=>{n(s=>{const a=s.filter(l=>l.ref()!==i.ref());return s.length===a.length?s:a})});return{DomCollectionProvider:i=>h(ja.Provider,{value:{registerItem:r},get children(){return i.children}})}}function gh(e){const t=sh(),n=De({shouldRegisterItem:!0},e);V(()=>{if(!n.shouldRegisterItem)return;const r=t.registerItem(n.getItem());Z(r)})}var z=e=>typeof e=="function"?e():e,cn=e=>requestAnimationFrame(()=>requestAnimationFrame(e)),Mr=new Map,hh=e=>{V(()=>{const t=z(e.style)??{},n=z(e.properties)??[],r={};for(const i in t)r[i]=e.element.style[i];const o=Mr.get(e.key);o?o.activeCount++:Mr.set(e.key,{activeCount:1,originalStyles:r,properties:n.map(i=>i.key)}),Object.assign(e.element.style,e.style);for(const i of n)e.element.style.setProperty(i.key,i.value);Z(()=>{const i=Mr.get(e.key);if(i){if(i.activeCount!==1){i.activeCount--;return}Mr.delete(e.key);for(const[s,a]of Object.entries(i.originalStyles))e.element.style[s]=a;for(const s of i.properties)e.element.style.removeProperty(s);e.element.style.length===0&&e.element.removeAttribute("style"),e.cleanup?.()}})})},ri=hh,ph=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},mh=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},Ya=(e,t,n)=>{const r=t==="x"&&window.getComputedStyle(e).direction==="rtl"?-1:1;let o=e,i=0,s=0,a=!1;do{const[l,c,u]=ph(o,t),d=u-l-r*c;(c!==0||d!==0)&&mh(o,t)&&(i+=d,s+=c),o===(n??document.documentElement)?a=!0:o=o.parentElement}while(o&&!a);return[i,s]},[Ga,qa]=L([]),yh=e=>Ga().indexOf(e)===Ga().length-1,vh=e=>{const t=I({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",allowPinchZoom:!1},e),n=Le();let r=[0,0],o=null,i=null;V(()=>{z(t.enabled)&&(qa(c=>[...c,n]),Z(()=>{qa(c=>c.filter(u=>u!==n))}))}),V(()=>{if(!z(t.enabled)||!z(t.hideScrollbar))return;const{body:c}=document,u=window.innerWidth-c.offsetWidth;if(ri({key:"prevent-scroll-overflow",element:c,style:{overflow:"hidden"}}),z(t.preventScrollbarShift)){const d={},f=[];u>0&&(z(t.preventScrollbarShiftMode)==="padding"?d.paddingRight=`calc(${window.getComputedStyle(c).paddingRight} + ${u}px)`:d.marginRight=`calc(${window.getComputedStyle(c).marginRight} + ${u}px)`,f.push({key:"--scrollbar-width",value:`${u}px`}));const m=window.scrollY,g=window.scrollX;ri({key:"prevent-scroll-scrollbar",element:c,style:d,properties:f,cleanup:()=>{u>0&&window.scrollTo(g,m)}})}}),V(()=>{!yh(n)||!z(t.enabled)||(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",s,{passive:!1}),document.addEventListener("touchmove",l,{passive:!1}),Z(()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",s),document.removeEventListener("touchmove",l)}))});const s=c=>{r=Za(c),o=null,i=null},a=c=>{const u=c.target,d=z(t.element),f=bh(c),m=Math.abs(f[0])>Math.abs(f[1])?"x":"y",g=m==="x"?f[0]:f[1],p=Xa(u,m,g,d);let y;d&&d.contains(u)?y=!p:y=p,y&&c.cancelable&&c.preventDefault()},l=c=>{const u=z(t.element),d=c.target;let f;if(c.touches.length===2)f=!z(t.allowPinchZoom);else{if(o==null||i===null){const m=Za(c).map((p,y)=>r[y]-p),g=Math.abs(m[0])>Math.abs(m[1])?"x":"y";o=g,i=g==="x"?m[0]:m[1]}if(d.type==="range")f=!1;else{const m=Xa(d,o,i,u);u&&u.contains(d)?f=!m:f=m}}f&&c.cancelable&&c.preventDefault()}},bh=e=>[e.deltaX,e.deltaY],Za=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],Xa=(e,t,n,r)=>{const o=r&&r.contains(e),[i,s]=Ya(e,t,o?r:void 0);return!(n>0&&Math.abs(i)<=1||n<0&&Math.abs(s)<1)},wh=vh,Ja=wh;const Qa=ye();function xh(){return ve(Qa)}function Sh(e){let t;const n=xh(),[r,o]=U(e,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),i=new Set([]),s=d=>{i.add(d);const f=n?.registerNestedLayer(d);return()=>{i.delete(d),f?.()}};Mg({shouldExcludeElement:d=>t?r.excludedElements?.some(f=>Ze(f(),d))||[...i].some(f=>Ze(f,d)):!1,onPointerDownOutside:d=>{!t||ke.isBelowPointerBlockingLayer(t)||!r.bypassTopMostLayerCheck&&!ke.isTopMostLayer(t)||(r.onPointerDownOutside?.(d),r.onInteractOutside?.(d),d.defaultPrevented||r.onDismiss?.())},onFocusOutside:d=>{r.onFocusOutside?.(d),r.onInteractOutside?.(d),d.defaultPrevented||r.onDismiss?.()}},()=>t),bg({ownerDocument:()=>it(t),onEscapeKeyDown:d=>{!t||!ke.isTopMostLayer(t)||(r.onEscapeKeyDown?.(d),!d.defaultPrevented&&r.onDismiss&&(d.preventDefault(),r.onDismiss()))}}),Ft(()=>{if(!t)return;ke.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const d=n?.registerNestedLayer(t);ke.assignPointerEventToLayers(),ke.disableBodyPointerEvents(t),Z(()=>{t&&(ke.removeLayer(t),d?.(),ke.assignPointerEventToLayers(),ke.restoreBodyPointerEvents(t))})}),V(Nt([()=>t,()=>r.disableOutsidePointerEvents],([d,f])=>{if(!d)return;const m=ke.find(d);m&&m.isPointerBlocking!==f&&(m.isPointerBlocking=f,ke.assignPointerEventToLayers()),f&&ke.disableBodyPointerEvents(d),Z(()=>{ke.restoreBodyPointerEvents(d)})},{defer:!0}));const u={registerNestedLayer:s};return h(Qa.Provider,{value:u,get children(){return h(an,I({as:"div",ref(d){var f=Ct(m=>t=m,r.ref);typeof f=="function"&&f(d)}},o))}})}const el=ye();function Eh(){const e=ve(el);if(e===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}function Ph(e){const t=Eh(),[n,r]=U(e,["ref","style"]);return h(an,I({as:"div",ref(o){var i=Ct(t.setPositionerRef,n.ref);typeof i=="function"&&i(o)},"data-popper-positioner":"",get style(){return{position:"absolute",top:0,left:0,"min-width":"max-content",...n.style}}},r))}const Ch=["top","right","bottom","left"],Ot=Math.min,Te=Math.max,Ir=Math.round,Lr=Math.floor,Dt=e=>({x:e,y:e}),Oh={left:"right",right:"left",bottom:"top",top:"bottom"},Dh={start:"end",end:"start"};function oi(e,t,n){return Te(e,Ot(t,n))}function at(e,t){return typeof e=="function"?e(t):e}function lt(e){return e.split("-")[0]}function un(e){return e.split("-")[1]}function ii(e){return e==="x"?"y":"x"}function si(e){return e==="y"?"height":"width"}function dn(e){return["top","bottom"].includes(lt(e))?"y":"x"}function ai(e){return ii(dn(e))}function kh(e,t,n){n===void 0&&(n=!1);const r=un(e),o=ai(e),i=si(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Rr(s)),[s,Rr(s)]}function Th(e){const t=Rr(e);return[li(e),t,li(t)]}function li(e){return e.replace(/start|end/g,t=>Dh[t])}function $h(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}function Ah(e,t,n,r){const o=un(e);let i=$h(lt(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(li)))),i}function Rr(e){return e.replace(/left|right|bottom|top/g,t=>Oh[t])}function Mh(e){return{top:0,right:0,bottom:0,left:0,...e}}function tl(e){return typeof e!="number"?Mh(e):{top:e,right:e,bottom:e,left:e}}function fn(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function nl(e,t,n){let{reference:r,floating:o}=e;const i=dn(t),s=ai(t),a=si(s),l=lt(t),c=i==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let m;switch(l){case"top":m={x:u,y:r.y-o.height};break;case"bottom":m={x:u,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:d};break;case"left":m={x:r.x-o.width,y:d};break;default:m={x:r.x,y:r.y}}switch(un(t)){case"start":m[s]-=f*(n&&c?-1:1);break;case"end":m[s]+=f*(n&&c?-1:1);break}return m}const rl=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=nl(c,r,l),f=r,m={},g=0;for(let p=0;p<a.length;p++){const{name:y,fn:v}=a[p],{x:b,y:w,data:x,reset:T}=await v({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:m,rects:c,platform:s,elements:{reference:e,floating:t}});u=b??u,d=w??d,m={...m,[y]:{...m[y],...x}},T&&g<=50&&(g++,typeof T=="object"&&(T.placement&&(f=T.placement),T.rects&&(c=T.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):T.rects),{x:u,y:d}=nl(c,f,l)),p=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:m}};async function qn(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:m=0}=at(t,e),g=tl(m),y=a[f?d==="floating"?"reference":"floating":d],v=fn(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(y)))==null||n?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),b=d==="floating"?{...s.floating,x:r,y:o}:s.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),x=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},T=fn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:w,strategy:l}):b);return{top:(v.top-T.top+g.top)/x.y,bottom:(T.bottom-v.bottom+g.bottom)/x.y,left:(v.left-T.left+g.left)/x.x,right:(T.right-v.right+g.right)/x.x}}const ol=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=at(e,t)||{};if(c==null)return{};const d=tl(u),f={x:n,y:r},m=ai(o),g=si(m),p=await s.getDimensions(c),y=m==="y",v=y?"top":"left",b=y?"bottom":"right",w=y?"clientHeight":"clientWidth",x=i.reference[g]+i.reference[m]-f[m]-i.floating[g],T=f[m]-i.reference[m],O=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let k=O?O[w]:0;(!k||!await(s.isElement==null?void 0:s.isElement(O)))&&(k=a.floating[w]||i.floating[g]);const j=x/2-T/2,P=k/2-p[g]/2-1,M=Ot(d[v],P),$=Ot(d[b],P),R=M,se=k-p[g]-$,J=k/2-p[g]/2+j,re=oi(R,J,se),N=!l.arrow&&un(o)!=null&&J!==re&&i.reference[g]/2-(J<R?M:$)-p[g]/2<0,X=N?J<R?J-R:J-se:0;return{[m]:f[m]+X,data:{[m]:re,centerOffset:J-re-X,...N&&{alignmentOffset:X}},reset:N}}}),il=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:p=!0,...y}=at(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const v=lt(o),b=lt(a)===a,w=await(l.isRTL==null?void 0:l.isRTL(c.floating)),x=f||(b||!p?[Rr(a)]:Th(a));!f&&g!=="none"&&x.push(...Ah(a,p,g,w));const T=[a,...x],O=await qn(t,y),k=[];let j=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&k.push(O[v]),d){const R=kh(o,s,w);k.push(O[R[0]],O[R[1]])}if(j=[...j,{placement:o,overflows:k}],!k.every(R=>R<=0)){var P,M;const R=(((P=i.flip)==null?void 0:P.index)||0)+1,se=T[R];if(se)return{data:{index:R,overflows:j},reset:{placement:se}};let J=(M=j.filter(re=>re.overflows[0]<=0).sort((re,N)=>re.overflows[1]-N.overflows[1])[0])==null?void 0:M.placement;if(!J)switch(m){case"bestFit":{var $;const re=($=j.map(N=>[N.placement,N.overflows.filter(X=>X>0).reduce((X,ge)=>X+ge,0)]).sort((N,X)=>N[1]-X[1])[0])==null?void 0:$[0];re&&(J=re);break}case"initialPlacement":J=a;break}if(o!==J)return{reset:{placement:J}}}return{}}}};function sl(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function al(e){return Ch.some(t=>e[t]>=0)}const Ih=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=at(e,t);switch(r){case"referenceHidden":{const i=await qn(t,{...o,elementContext:"reference"}),s=sl(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:al(s)}}}case"escaped":{const i=await qn(t,{...o,altBoundary:!0}),s=sl(i,n.floating);return{data:{escapedOffsets:s,escaped:al(s)}}}default:return{}}}}};async function Lh(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=lt(n),a=un(n),l=dn(n)==="y",c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=at(t,e);let{mainAxis:f,crossAxis:m,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&typeof g=="number"&&(m=a==="end"?g*-1:g),l?{x:m*u,y:f*c}:{x:f*c,y:m*u}}const ll=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await Lh(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},cl=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:y=>{let{x:v,y:b}=y;return{x:v,y:b}}},...l}=at(e,t),c={x:n,y:r},u=await qn(t,l),d=dn(lt(o)),f=ii(d);let m=c[f],g=c[d];if(i){const y=f==="y"?"top":"left",v=f==="y"?"bottom":"right",b=m+u[y],w=m-u[v];m=oi(b,m,w)}if(s){const y=d==="y"?"top":"left",v=d==="y"?"bottom":"right",b=g+u[y],w=g-u[v];g=oi(b,g,w)}const p=a.fn({...t,[f]:m,[d]:g});return{...p,data:{x:p.x-n,y:p.y-r}}}}},Rh=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=at(e,t),u={x:n,y:r},d=dn(o),f=ii(d);let m=u[f],g=u[d];const p=at(a,t),y=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){const w=f==="y"?"height":"width",x=i.reference[f]-i.floating[w]+y.mainAxis,T=i.reference[f]+i.reference[w]-y.mainAxis;m<x?m=x:m>T&&(m=T)}if(c){var v,b;const w=f==="y"?"width":"height",x=["top","left"].includes(lt(o)),T=i.reference[d]-i.floating[w]+(x&&((v=s.offset)==null?void 0:v[d])||0)+(x?0:y.crossAxis),O=i.reference[d]+i.reference[w]+(x?0:((b=s.offset)==null?void 0:b[d])||0)-(x?y.crossAxis:0);g<T?g=T:g>O&&(g=O)}return{[f]:m,[d]:g}}}},ul=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:s=()=>{},...a}=at(e,t),l=await qn(t,a),c=lt(n),u=un(n),d=dn(n)==="y",{width:f,height:m}=r.floating;let g,p;c==="top"||c==="bottom"?(g=c,p=u===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(p=c,g=u==="end"?"top":"bottom");const y=m-l[g],v=f-l[p],b=!t.middlewareData.shift;let w=y,x=v;if(d){const O=f-l.left-l.right;x=u||b?Ot(v,O):O}else{const O=m-l.top-l.bottom;w=u||b?Ot(y,O):O}if(b&&!u){const O=Te(l.left,0),k=Te(l.right,0),j=Te(l.top,0),P=Te(l.bottom,0);d?x=f-2*(O!==0||k!==0?O+k:Te(l.left,l.right)):w=m-2*(j!==0||P!==0?j+P:Te(l.top,l.bottom))}await s({...t,availableWidth:x,availableHeight:w});const T=await o.getDimensions(i.floating);return f!==T.width||m!==T.height?{reset:{rects:!0}}:{}}}};function kt(e){return dl(e)?(e.nodeName||"").toLowerCase():"#document"}function $e(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ct(e){var t;return(t=(dl(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function dl(e){return e instanceof Node||e instanceof $e(e).Node}function ut(e){return e instanceof Element||e instanceof $e(e).Element}function Xe(e){return e instanceof HTMLElement||e instanceof $e(e).HTMLElement}function fl(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof $e(e).ShadowRoot}function Zn(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=_e(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Nh(e){return["table","td","th"].includes(kt(e))}function ci(e){const t=ui(),n=_e(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Fh(e){let t=gn(e);for(;Xe(t)&&!Nr(t);){if(ci(t))return t;t=gn(t)}return null}function ui(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Nr(e){return["html","body","#document"].includes(kt(e))}function _e(e){return $e(e).getComputedStyle(e)}function Fr(e){return ut(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function gn(e){if(kt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||fl(e)&&e.host||ct(e);return fl(t)?t.host:t}function gl(e){const t=gn(e);return Nr(t)?e.ownerDocument?e.ownerDocument.body:e.body:Xe(t)&&Zn(t)?t:gl(t)}function Xn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=gl(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=$e(o);return i?t.concat(s,s.visualViewport||[],Zn(o)?o:[],s.frameElement&&n?Xn(s.frameElement):[]):t.concat(o,Xn(o,[],n))}function hl(e){const t=_e(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Xe(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Ir(n)!==i||Ir(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function di(e){return ut(e)?e:e.contextElement}function hn(e){const t=di(e);if(!Xe(t))return Dt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=hl(t);let s=(i?Ir(n.width):n.width)/r,a=(i?Ir(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const _h=Dt(0);function pl(e){const t=$e(e);return!ui()||!t.visualViewport?_h:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Vh(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==$e(e)?!1:t}function Kt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=di(e);let s=Dt(1);t&&(r?ut(r)&&(s=hn(r)):s=hn(e));const a=Vh(i,n,r)?pl(i):Dt(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const f=$e(i),m=r&&ut(r)?$e(r):r;let g=f,p=g.frameElement;for(;p&&r&&m!==g;){const y=hn(p),v=p.getBoundingClientRect(),b=_e(p),w=v.left+(p.clientLeft+parseFloat(b.paddingLeft))*y.x,x=v.top+(p.clientTop+parseFloat(b.paddingTop))*y.y;l*=y.x,c*=y.y,u*=y.x,d*=y.y,l+=w,c+=x,g=$e(p),p=g.frameElement}}return fn({width:u,height:d,x:l,y:c})}const Kh=[":popover-open",":modal"];function ml(e){return Kh.some(t=>{try{return e.matches(t)}catch{return!1}})}function zh(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=ct(r),a=t?ml(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=Dt(1);const u=Dt(0),d=Xe(r);if((d||!d&&!i)&&((kt(r)!=="body"||Zn(s))&&(l=Fr(r)),Xe(r))){const f=Kt(r);c=hn(r),u.x=f.x+r.clientLeft,u.y=f.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}}function Bh(e){return Array.from(e.getClientRects())}function yl(e){return Kt(ct(e)).left+Fr(e).scrollLeft}function jh(e){const t=ct(e),n=Fr(e),r=e.ownerDocument.body,o=Te(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Te(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+yl(e);const a=-n.scrollTop;return _e(r).direction==="rtl"&&(s+=Te(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function Uh(e,t){const n=$e(e),r=ct(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const c=ui();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}function Wh(e,t){const n=Kt(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Xe(e)?hn(e):Dt(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:s,height:a,x:l,y:c}}function vl(e,t,n){let r;if(t==="viewport")r=Uh(e,n);else if(t==="document")r=jh(ct(e));else if(ut(t))r=Wh(t,n);else{const o=pl(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return fn(r)}function bl(e,t){const n=gn(e);return n===t||!ut(n)||Nr(n)?!1:_e(n).position==="fixed"||bl(n,t)}function Hh(e,t){const n=t.get(e);if(n)return n;let r=Xn(e,[],!1).filter(a=>ut(a)&&kt(a)!=="body"),o=null;const i=_e(e).position==="fixed";let s=i?gn(e):e;for(;ut(s)&&!Nr(s);){const a=_e(s),l=ci(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Zn(s)&&!l&&bl(e,s))?r=r.filter(u=>u!==s):o=a,s=gn(s)}return t.set(e,r),r}function Yh(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?Hh(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const d=vl(t,u,o);return c.top=Te(d.top,c.top),c.right=Ot(d.right,c.right),c.bottom=Ot(d.bottom,c.bottom),c.left=Te(d.left,c.left),c},vl(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Gh(e){const{width:t,height:n}=hl(e);return{width:t,height:n}}function qh(e,t,n){const r=Xe(t),o=ct(t),i=n==="fixed",s=Kt(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=Dt(0);if(r||!r&&!i)if((kt(t)!=="body"||Zn(o))&&(a=Fr(t)),r){const d=Kt(t,!0,i,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else o&&(l.x=yl(o));const c=s.left+a.scrollLeft-l.x,u=s.top+a.scrollTop-l.y;return{x:c,y:u,width:s.width,height:s.height}}function wl(e,t){return!Xe(e)||_e(e).position==="fixed"?null:t?t(e):e.offsetParent}function xl(e,t){const n=$e(e);if(!Xe(e)||ml(e))return n;let r=wl(e,t);for(;r&&Nh(r)&&_e(r).position==="static";)r=wl(r,t);return r&&(kt(r)==="html"||kt(r)==="body"&&_e(r).position==="static"&&!ci(r))?n:r||Fh(e)||n}const Zh=async function(e){const t=this.getOffsetParent||xl,n=this.getDimensions;return{reference:qh(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,...await n(e.floating)}}};function Xh(e){return _e(e).direction==="rtl"}const Sl={convertOffsetParentRelativeRectToViewportRelativeRect:zh,getDocumentElement:ct,getClippingRect:Yh,getOffsetParent:xl,getElementRects:Zh,getClientRects:Bh,getDimensions:Gh,getScale:hn,isElement:ut,isRTL:Xh};function Jh(e,t){let n=null,r;const o=ct(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const{left:c,top:u,width:d,height:f}=e.getBoundingClientRect();if(a||t(),!d||!f)return;const m=Lr(u),g=Lr(o.clientWidth-(c+d)),p=Lr(o.clientHeight-(u+f)),y=Lr(c),b={rootMargin:-m+"px "+-g+"px "+-p+"px "+-y+"px",threshold:Te(0,Ot(1,l))||1};let w=!0;function x(T){const O=T[0].intersectionRatio;if(O!==l){if(!w)return s();O?s(!1,O):r=setTimeout(()=>{s(!1,1e-7)},100)}w=!1}try{n=new IntersectionObserver(x,{...b,root:o.ownerDocument})}catch{n=new IntersectionObserver(x,b)}n.observe(e)}return s(!0),i}function Qh(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=di(e),u=o||i?[...c?Xn(c):[],...Xn(t)]:[];u.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const d=c&&a?Jh(c,n):null;let f=-1,m=null;s&&(m=new ResizeObserver(v=>{let[b]=v;b&&b.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var w;(w=m)==null||w.observe(t)})),n()}),c&&!l&&m.observe(c),m.observe(t));let g,p=l?Kt(e):null;l&&y();function y(){const v=Kt(e);p&&(v.x!==p.x||v.y!==p.y||v.width!==p.width||v.height!==p.height)&&n(),p=v,g=requestAnimationFrame(y)}return n(),()=>{var v;u.forEach(b=>{o&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),d?.(),(v=m)==null||v.disconnect(),m=null,l&&cancelAnimationFrame(g)}}const ep=cl,tp=il,np=ul,rp=Ih,op=ol,ip=(e,t,n)=>{const r=new Map,o={platform:Sl,...n},i={...o.platform,_c:r};return rl(e,t,{...o,platform:i})};function El(e){const{x:t=0,y:n=0,width:r=0,height:o=0}=e??{};if(typeof DOMRect=="function")return new DOMRect(t,n,r,o);const i={x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:n+o,left:t};return{...i,toJSON:()=>i}}function sp(e,t){return{contextElement:e,getBoundingClientRect:()=>{const r=t(e);return r?El(r):e?e.getBoundingClientRect():El()}}}function ap(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}const lp={top:"bottom",right:"left",bottom:"top",left:"right"};function cp(e,t){const[n,r]=e.split("-"),o=lp[n];return r?n==="left"||n==="right"?`${o} ${r==="start"?"top":"bottom"}`:r==="start"?`${o} ${t==="rtl"?"right":"left"}`:`${o} ${t==="rtl"?"left":"right"}`:`${o} center`}function up(e){const t=De({getAnchorRect:f=>f?.getBoundingClientRect(),placement:"bottom",gutter:0,shift:0,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,hideWhenDetached:!1,detachedPadding:0,arrowPadding:4,overflowPadding:8},e),[n,r]=L(),[o,i]=L(),[s,a]=L(t.placement),l=()=>sp(t.anchorRef(),t.getAnchorRect),{direction:c}=ei();async function u(){const f=l(),m=n(),g=o();if(!f||!m)return;const p=(g?.clientHeight||0)/2,y=typeof t.gutter=="number"?t.gutter+p:t.gutter??p;m.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),f.getBoundingClientRect();const v=[ll(({placement:O})=>{const k=!!O.split("-")[1];return{mainAxis:y,crossAxis:k?void 0:t.shift,alignmentAxis:t.shift}})];if(t.flip!==!1){const O=typeof t.flip=="string"?t.flip.split(" "):void 0;if(O!==void 0&&!O.every(ap))throw new Error("`flip` expects a spaced-delimited list of placements");v.push(tp({padding:t.overflowPadding,fallbackPlacements:O}))}(t.slide||t.overlap)&&v.push(ep({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),v.push(np({padding:t.overflowPadding,apply({availableWidth:O,availableHeight:k,rects:j}){const P=Math.round(j.reference.width);O=Math.floor(O),k=Math.floor(k),m.style.setProperty("--kb-popper-anchor-width",`${P}px`),m.style.setProperty("--kb-popper-content-available-width",`${O}px`),m.style.setProperty("--kb-popper-content-available-height",`${k}px`),t.sameWidth&&(m.style.width=`${P}px`),t.fitViewport&&(m.style.maxWidth=`${O}px`,m.style.maxHeight=`${k}px`)}})),t.hideWhenDetached&&v.push(rp({padding:t.detachedPadding})),g&&v.push(op({element:g,padding:t.arrowPadding}));const b=await ip(f,m,{placement:t.placement,strategy:"absolute",middleware:v,platform:{...Sl,isRTL:()=>c()==="rtl"}});if(a(b.placement),t.onCurrentPlacementChange?.(b.placement),!m)return;m.style.setProperty("--kb-popper-content-transform-origin",cp(b.placement,c()));const w=Math.round(b.x),x=Math.round(b.y);let T;if(t.hideWhenDetached&&(T=b.middlewareData.hide?.referenceHidden?"hidden":"visible"),Object.assign(m.style,{top:"0",left:"0",transform:`translate3d(${w}px, ${x}px, 0)`,visibility:T}),g&&b.middlewareData.arrow){const{x:O,y:k}=b.middlewareData.arrow,j=b.placement.split("-")[0];Object.assign(g.style,{left:O!=null?`${O}px`:"",top:k!=null?`${k}px`:"",[j]:"100%"})}}V(()=>{const f=l(),m=n();if(!f||!m)return;const g=Qh(f,m,u,{elementResize:typeof ResizeObserver=="function"});Z(g)}),V(()=>{const f=n(),m=t.contentRef();!f||!m||queueMicrotask(()=>{f.style.zIndex=getComputedStyle(m).zIndex})});const d={currentPlacement:s,contentRef:()=>t.contentRef(),setPositionerRef:r,setArrowRef:i};return h(el.Provider,{value:d,get children(){return t.children}})}const Pl=ye();function Cl(){return ve(Pl)}function pn(){const e=Cl();if(e===void 0)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}const Ol=ye();function mn(){const e=ve(Ol);if(e===void 0)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}/*!
181
+ */function gh(e={}){const[t,n]=bg({value:()=>D(e.items),onChange:i=>e.onItemsChange?.(i)});fh(t,n);const r=i=>(n(s=>{const a=lh(s,i);return Gf(s,i,a)}),()=>{n(s=>{const a=s.filter(l=>l.ref()!==i.ref());return s.length===a.length?s:a})});return{DomCollectionProvider:i=>h(Ba.Provider,{value:{registerItem:r},get children(){return i.children}})}}function hh(e){const t=ah(),n=De({shouldRegisterItem:!0},e);V(()=>{if(!n.shouldRegisterItem)return;const r=t.registerItem(n.getItem());Z(r)})}var z=e=>typeof e=="function"?e():e,cn=e=>requestAnimationFrame(()=>requestAnimationFrame(e)),Ar=new Map,ph=e=>{V(()=>{const t=z(e.style)??{},n=z(e.properties)??[],r={};for(const i in t)r[i]=e.element.style[i];const o=Ar.get(e.key);o?o.activeCount++:Ar.set(e.key,{activeCount:1,originalStyles:r,properties:n.map(i=>i.key)}),Object.assign(e.element.style,e.style);for(const i of n)e.element.style.setProperty(i.key,i.value);Z(()=>{const i=Ar.get(e.key);if(i){if(i.activeCount!==1){i.activeCount--;return}Ar.delete(e.key);for(const[s,a]of Object.entries(i.originalStyles))e.element.style[s]=a;for(const s of i.properties)e.element.style.removeProperty(s);e.element.style.length===0&&e.element.removeAttribute("style"),e.cleanup?.()}})})},ni=ph,mh=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},yh=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},Ha=(e,t,n)=>{const r=t==="x"&&window.getComputedStyle(e).direction==="rtl"?-1:1;let o=e,i=0,s=0,a=!1;do{const[l,c,u]=mh(o,t),d=u-l-r*c;(c!==0||d!==0)&&yh(o,t)&&(i+=d,s+=c),o===(n??document.documentElement)?a=!0:o=o.parentElement}while(o&&!a);return[i,s]},[Ya,Ga]=L([]),vh=e=>Ya().indexOf(e)===Ya().length-1,bh=e=>{const t=I({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",allowPinchZoom:!1},e),n=Le();let r=[0,0],o=null,i=null;V(()=>{z(t.enabled)&&(Ga(c=>[...c,n]),Z(()=>{Ga(c=>c.filter(u=>u!==n))}))}),V(()=>{if(!z(t.enabled)||!z(t.hideScrollbar))return;const{body:c}=document,u=window.innerWidth-c.offsetWidth;if(ni({key:"prevent-scroll-overflow",element:c,style:{overflow:"hidden"}}),z(t.preventScrollbarShift)){const d={},f=[];u>0&&(z(t.preventScrollbarShiftMode)==="padding"?d.paddingRight=`calc(${window.getComputedStyle(c).paddingRight} + ${u}px)`:d.marginRight=`calc(${window.getComputedStyle(c).marginRight} + ${u}px)`,f.push({key:"--scrollbar-width",value:`${u}px`}));const m=window.scrollY,g=window.scrollX;ni({key:"prevent-scroll-scrollbar",element:c,style:d,properties:f,cleanup:()=>{u>0&&window.scrollTo(g,m)}})}}),V(()=>{!vh(n)||!z(t.enabled)||(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",s,{passive:!1}),document.addEventListener("touchmove",l,{passive:!1}),Z(()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",s),document.removeEventListener("touchmove",l)}))});const s=c=>{r=qa(c),o=null,i=null},a=c=>{const u=c.target,d=z(t.element),f=wh(c),m=Math.abs(f[0])>Math.abs(f[1])?"x":"y",g=m==="x"?f[0]:f[1],p=Za(u,m,g,d);let y;d&&d.contains(u)?y=!p:y=p,y&&c.cancelable&&c.preventDefault()},l=c=>{const u=z(t.element),d=c.target;let f;if(c.touches.length===2)f=!z(t.allowPinchZoom);else{if(o==null||i===null){const m=qa(c).map((p,y)=>r[y]-p),g=Math.abs(m[0])>Math.abs(m[1])?"x":"y";o=g,i=g==="x"?m[0]:m[1]}if(d.type==="range")f=!1;else{const m=Za(d,o,i,u);u&&u.contains(d)?f=!m:f=m}}f&&c.cancelable&&c.preventDefault()}},wh=e=>[e.deltaX,e.deltaY],qa=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],Za=(e,t,n,r)=>{const o=r&&r.contains(e),[i,s]=Ha(e,t,o?r:void 0);return!(n>0&&Math.abs(i)<=1||n<0&&Math.abs(s)<1)},xh=bh,Xa=xh;const Ja=ve();function Sh(){return be(Ja)}function Eh(e){let t;const n=Sh(),[r,o]=U(e,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),i=new Set([]),s=d=>{i.add(d);const f=n?.registerNestedLayer(d);return()=>{i.delete(d),f?.()}};Ig({shouldExcludeElement:d=>t?r.excludedElements?.some(f=>Ze(f(),d))||[...i].some(f=>Ze(f,d)):!1,onPointerDownOutside:d=>{!t||ke.isBelowPointerBlockingLayer(t)||!r.bypassTopMostLayerCheck&&!ke.isTopMostLayer(t)||(r.onPointerDownOutside?.(d),r.onInteractOutside?.(d),d.defaultPrevented||r.onDismiss?.())},onFocusOutside:d=>{r.onFocusOutside?.(d),r.onInteractOutside?.(d),d.defaultPrevented||r.onDismiss?.()}},()=>t),wg({ownerDocument:()=>it(t),onEscapeKeyDown:d=>{!t||!ke.isTopMostLayer(t)||(r.onEscapeKeyDown?.(d),!d.defaultPrevented&&r.onDismiss&&(d.preventDefault(),r.onDismiss()))}}),Ft(()=>{if(!t)return;ke.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const d=n?.registerNestedLayer(t);ke.assignPointerEventToLayers(),ke.disableBodyPointerEvents(t),Z(()=>{t&&(ke.removeLayer(t),d?.(),ke.assignPointerEventToLayers(),ke.restoreBodyPointerEvents(t))})}),V(Nt([()=>t,()=>r.disableOutsidePointerEvents],([d,f])=>{if(!d)return;const m=ke.find(d);m&&m.isPointerBlocking!==f&&(m.isPointerBlocking=f,ke.assignPointerEventToLayers()),f&&ke.disableBodyPointerEvents(d),Z(()=>{ke.restoreBodyPointerEvents(d)})},{defer:!0}));const u={registerNestedLayer:s};return h(Ja.Provider,{value:u,get children(){return h(an,I({as:"div",ref(d){var f=Ct(m=>t=m,r.ref);typeof f=="function"&&f(d)}},o))}})}const Qa=ve();function Ph(){const e=be(Qa);if(e===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}function Ch(e){const t=Ph(),[n,r]=U(e,["ref","style"]);return h(an,I({as:"div",ref(o){var i=Ct(t.setPositionerRef,n.ref);typeof i=="function"&&i(o)},"data-popper-positioner":"",get style(){return{position:"absolute",top:0,left:0,"min-width":"max-content",...n.style}}},r))}const Oh=["top","right","bottom","left"],Ot=Math.min,Te=Math.max,Mr=Math.round,Ir=Math.floor,Dt=e=>({x:e,y:e}),Dh={left:"right",right:"left",bottom:"top",top:"bottom"},kh={start:"end",end:"start"};function ri(e,t,n){return Te(e,Ot(t,n))}function at(e,t){return typeof e=="function"?e(t):e}function lt(e){return e.split("-")[0]}function un(e){return e.split("-")[1]}function oi(e){return e==="x"?"y":"x"}function ii(e){return e==="y"?"height":"width"}function dn(e){return["top","bottom"].includes(lt(e))?"y":"x"}function si(e){return oi(dn(e))}function Th(e,t,n){n===void 0&&(n=!1);const r=un(e),o=si(e),i=ii(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Lr(s)),[s,Lr(s)]}function $h(e){const t=Lr(e);return[ai(e),t,ai(t)]}function ai(e){return e.replace(/start|end/g,t=>kh[t])}function Ah(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}function Mh(e,t,n,r){const o=un(e);let i=Ah(lt(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(ai)))),i}function Lr(e){return e.replace(/left|right|bottom|top/g,t=>Dh[t])}function Ih(e){return{top:0,right:0,bottom:0,left:0,...e}}function el(e){return typeof e!="number"?Ih(e):{top:e,right:e,bottom:e,left:e}}function fn(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function tl(e,t,n){let{reference:r,floating:o}=e;const i=dn(t),s=si(t),a=ii(s),l=lt(t),c=i==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let m;switch(l){case"top":m={x:u,y:r.y-o.height};break;case"bottom":m={x:u,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:d};break;case"left":m={x:r.x-o.width,y:d};break;default:m={x:r.x,y:r.y}}switch(un(t)){case"start":m[s]-=f*(n&&c?-1:1);break;case"end":m[s]+=f*(n&&c?-1:1);break}return m}const nl=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=tl(c,r,l),f=r,m={},g=0;for(let p=0;p<a.length;p++){const{name:y,fn:v}=a[p],{x:b,y:w,data:x,reset:T}=await v({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:m,rects:c,platform:s,elements:{reference:e,floating:t}});u=b??u,d=w??d,m={...m,[y]:{...m[y],...x}},T&&g<=50&&(g++,typeof T=="object"&&(T.placement&&(f=T.placement),T.rects&&(c=T.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):T.rects),{x:u,y:d}=tl(c,f,l)),p=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:m}};async function Gn(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:m=0}=at(t,e),g=el(m),y=a[f?d==="floating"?"reference":"floating":d],v=fn(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(y)))==null||n?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),b=d==="floating"?{...s.floating,x:r,y:o}:s.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),x=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},T=fn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:w,strategy:l}):b);return{top:(v.top-T.top+g.top)/x.y,bottom:(T.bottom-v.bottom+g.bottom)/x.y,left:(v.left-T.left+g.left)/x.x,right:(T.right-v.right+g.right)/x.x}}const rl=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=at(e,t)||{};if(c==null)return{};const d=el(u),f={x:n,y:r},m=si(o),g=ii(m),p=await s.getDimensions(c),y=m==="y",v=y?"top":"left",b=y?"bottom":"right",w=y?"clientHeight":"clientWidth",x=i.reference[g]+i.reference[m]-f[m]-i.floating[g],T=f[m]-i.reference[m],O=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let k=O?O[w]:0;(!k||!await(s.isElement==null?void 0:s.isElement(O)))&&(k=a.floating[w]||i.floating[g]);const j=x/2-T/2,P=k/2-p[g]/2-1,M=Ot(d[v],P),$=Ot(d[b],P),R=M,se=k-p[g]-$,J=k/2-p[g]/2+j,re=ri(R,J,se),N=!l.arrow&&un(o)!=null&&J!==re&&i.reference[g]/2-(J<R?M:$)-p[g]/2<0,X=N?J<R?J-R:J-se:0;return{[m]:f[m]+X,data:{[m]:re,centerOffset:J-re-X,...N&&{alignmentOffset:X}},reset:N}}}),ol=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:p=!0,...y}=at(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const v=lt(o),b=lt(a)===a,w=await(l.isRTL==null?void 0:l.isRTL(c.floating)),x=f||(b||!p?[Lr(a)]:$h(a));!f&&g!=="none"&&x.push(...Mh(a,p,g,w));const T=[a,...x],O=await Gn(t,y),k=[];let j=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&k.push(O[v]),d){const R=Th(o,s,w);k.push(O[R[0]],O[R[1]])}if(j=[...j,{placement:o,overflows:k}],!k.every(R=>R<=0)){var P,M;const R=(((P=i.flip)==null?void 0:P.index)||0)+1,se=T[R];if(se)return{data:{index:R,overflows:j},reset:{placement:se}};let J=(M=j.filter(re=>re.overflows[0]<=0).sort((re,N)=>re.overflows[1]-N.overflows[1])[0])==null?void 0:M.placement;if(!J)switch(m){case"bestFit":{var $;const re=($=j.map(N=>[N.placement,N.overflows.filter(X=>X>0).reduce((X,he)=>X+he,0)]).sort((N,X)=>N[1]-X[1])[0])==null?void 0:$[0];re&&(J=re);break}case"initialPlacement":J=a;break}if(o!==J)return{reset:{placement:J}}}return{}}}};function il(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function sl(e){return Oh.some(t=>e[t]>=0)}const Lh=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=at(e,t);switch(r){case"referenceHidden":{const i=await Gn(t,{...o,elementContext:"reference"}),s=il(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:sl(s)}}}case"escaped":{const i=await Gn(t,{...o,altBoundary:!0}),s=il(i,n.floating);return{data:{escapedOffsets:s,escaped:sl(s)}}}default:return{}}}}};async function Rh(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=lt(n),a=un(n),l=dn(n)==="y",c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=at(t,e);let{mainAxis:f,crossAxis:m,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&typeof g=="number"&&(m=a==="end"?g*-1:g),l?{x:m*u,y:f*c}:{x:f*c,y:m*u}}const al=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await Rh(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},ll=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:y=>{let{x:v,y:b}=y;return{x:v,y:b}}},...l}=at(e,t),c={x:n,y:r},u=await Gn(t,l),d=dn(lt(o)),f=oi(d);let m=c[f],g=c[d];if(i){const y=f==="y"?"top":"left",v=f==="y"?"bottom":"right",b=m+u[y],w=m-u[v];m=ri(b,m,w)}if(s){const y=d==="y"?"top":"left",v=d==="y"?"bottom":"right",b=g+u[y],w=g-u[v];g=ri(b,g,w)}const p=a.fn({...t,[f]:m,[d]:g});return{...p,data:{x:p.x-n,y:p.y-r}}}}},Nh=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=at(e,t),u={x:n,y:r},d=dn(o),f=oi(d);let m=u[f],g=u[d];const p=at(a,t),y=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){const w=f==="y"?"height":"width",x=i.reference[f]-i.floating[w]+y.mainAxis,T=i.reference[f]+i.reference[w]-y.mainAxis;m<x?m=x:m>T&&(m=T)}if(c){var v,b;const w=f==="y"?"width":"height",x=["top","left"].includes(lt(o)),T=i.reference[d]-i.floating[w]+(x&&((v=s.offset)==null?void 0:v[d])||0)+(x?0:y.crossAxis),O=i.reference[d]+i.reference[w]+(x?0:((b=s.offset)==null?void 0:b[d])||0)-(x?y.crossAxis:0);g<T?g=T:g>O&&(g=O)}return{[f]:m,[d]:g}}}},cl=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:s=()=>{},...a}=at(e,t),l=await Gn(t,a),c=lt(n),u=un(n),d=dn(n)==="y",{width:f,height:m}=r.floating;let g,p;c==="top"||c==="bottom"?(g=c,p=u===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(p=c,g=u==="end"?"top":"bottom");const y=m-l[g],v=f-l[p],b=!t.middlewareData.shift;let w=y,x=v;if(d){const O=f-l.left-l.right;x=u||b?Ot(v,O):O}else{const O=m-l.top-l.bottom;w=u||b?Ot(y,O):O}if(b&&!u){const O=Te(l.left,0),k=Te(l.right,0),j=Te(l.top,0),P=Te(l.bottom,0);d?x=f-2*(O!==0||k!==0?O+k:Te(l.left,l.right)):w=m-2*(j!==0||P!==0?j+P:Te(l.top,l.bottom))}await s({...t,availableWidth:x,availableHeight:w});const T=await o.getDimensions(i.floating);return f!==T.width||m!==T.height?{reset:{rects:!0}}:{}}}};function kt(e){return ul(e)?(e.nodeName||"").toLowerCase():"#document"}function $e(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ct(e){var t;return(t=(ul(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ul(e){return e instanceof Node||e instanceof $e(e).Node}function ut(e){return e instanceof Element||e instanceof $e(e).Element}function Xe(e){return e instanceof HTMLElement||e instanceof $e(e).HTMLElement}function dl(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof $e(e).ShadowRoot}function qn(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=_e(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Fh(e){return["table","td","th"].includes(kt(e))}function li(e){const t=ci(),n=_e(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function _h(e){let t=gn(e);for(;Xe(t)&&!Rr(t);){if(li(t))return t;t=gn(t)}return null}function ci(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Rr(e){return["html","body","#document"].includes(kt(e))}function _e(e){return $e(e).getComputedStyle(e)}function Nr(e){return ut(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function gn(e){if(kt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||dl(e)&&e.host||ct(e);return dl(t)?t.host:t}function fl(e){const t=gn(e);return Rr(t)?e.ownerDocument?e.ownerDocument.body:e.body:Xe(t)&&qn(t)?t:fl(t)}function Zn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=fl(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=$e(o);return i?t.concat(s,s.visualViewport||[],qn(o)?o:[],s.frameElement&&n?Zn(s.frameElement):[]):t.concat(o,Zn(o,[],n))}function gl(e){const t=_e(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Xe(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Mr(n)!==i||Mr(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function ui(e){return ut(e)?e:e.contextElement}function hn(e){const t=ui(e);if(!Xe(t))return Dt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=gl(t);let s=(i?Mr(n.width):n.width)/r,a=(i?Mr(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Vh=Dt(0);function hl(e){const t=$e(e);return!ci()||!t.visualViewport?Vh:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Kh(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==$e(e)?!1:t}function Kt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=ui(e);let s=Dt(1);t&&(r?ut(r)&&(s=hn(r)):s=hn(e));const a=Kh(i,n,r)?hl(i):Dt(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const f=$e(i),m=r&&ut(r)?$e(r):r;let g=f,p=g.frameElement;for(;p&&r&&m!==g;){const y=hn(p),v=p.getBoundingClientRect(),b=_e(p),w=v.left+(p.clientLeft+parseFloat(b.paddingLeft))*y.x,x=v.top+(p.clientTop+parseFloat(b.paddingTop))*y.y;l*=y.x,c*=y.y,u*=y.x,d*=y.y,l+=w,c+=x,g=$e(p),p=g.frameElement}}return fn({width:u,height:d,x:l,y:c})}const zh=[":popover-open",":modal"];function pl(e){return zh.some(t=>{try{return e.matches(t)}catch{return!1}})}function Bh(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=ct(r),a=t?pl(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=Dt(1);const u=Dt(0),d=Xe(r);if((d||!d&&!i)&&((kt(r)!=="body"||qn(s))&&(l=Nr(r)),Xe(r))){const f=Kt(r);c=hn(r),u.x=f.x+r.clientLeft,u.y=f.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}}function jh(e){return Array.from(e.getClientRects())}function ml(e){return Kt(ct(e)).left+Nr(e).scrollLeft}function Uh(e){const t=ct(e),n=Nr(e),r=e.ownerDocument.body,o=Te(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Te(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+ml(e);const a=-n.scrollTop;return _e(r).direction==="rtl"&&(s+=Te(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function Wh(e,t){const n=$e(e),r=ct(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const c=ci();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}function Hh(e,t){const n=Kt(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Xe(e)?hn(e):Dt(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:s,height:a,x:l,y:c}}function yl(e,t,n){let r;if(t==="viewport")r=Wh(e,n);else if(t==="document")r=Uh(ct(e));else if(ut(t))r=Hh(t,n);else{const o=hl(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return fn(r)}function vl(e,t){const n=gn(e);return n===t||!ut(n)||Rr(n)?!1:_e(n).position==="fixed"||vl(n,t)}function Yh(e,t){const n=t.get(e);if(n)return n;let r=Zn(e,[],!1).filter(a=>ut(a)&&kt(a)!=="body"),o=null;const i=_e(e).position==="fixed";let s=i?gn(e):e;for(;ut(s)&&!Rr(s);){const a=_e(s),l=li(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||qn(s)&&!l&&vl(e,s))?r=r.filter(u=>u!==s):o=a,s=gn(s)}return t.set(e,r),r}function Gh(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?Yh(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const d=yl(t,u,o);return c.top=Te(d.top,c.top),c.right=Ot(d.right,c.right),c.bottom=Ot(d.bottom,c.bottom),c.left=Te(d.left,c.left),c},yl(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function qh(e){const{width:t,height:n}=gl(e);return{width:t,height:n}}function Zh(e,t,n){const r=Xe(t),o=ct(t),i=n==="fixed",s=Kt(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=Dt(0);if(r||!r&&!i)if((kt(t)!=="body"||qn(o))&&(a=Nr(t)),r){const d=Kt(t,!0,i,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else o&&(l.x=ml(o));const c=s.left+a.scrollLeft-l.x,u=s.top+a.scrollTop-l.y;return{x:c,y:u,width:s.width,height:s.height}}function bl(e,t){return!Xe(e)||_e(e).position==="fixed"?null:t?t(e):e.offsetParent}function wl(e,t){const n=$e(e);if(!Xe(e)||pl(e))return n;let r=bl(e,t);for(;r&&Fh(r)&&_e(r).position==="static";)r=bl(r,t);return r&&(kt(r)==="html"||kt(r)==="body"&&_e(r).position==="static"&&!li(r))?n:r||_h(e)||n}const Xh=async function(e){const t=this.getOffsetParent||wl,n=this.getDimensions;return{reference:Zh(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,...await n(e.floating)}}};function Jh(e){return _e(e).direction==="rtl"}const xl={convertOffsetParentRelativeRectToViewportRelativeRect:Bh,getDocumentElement:ct,getClippingRect:Gh,getOffsetParent:wl,getElementRects:Xh,getClientRects:jh,getDimensions:qh,getScale:hn,isElement:ut,isRTL:Jh};function Qh(e,t){let n=null,r;const o=ct(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const{left:c,top:u,width:d,height:f}=e.getBoundingClientRect();if(a||t(),!d||!f)return;const m=Ir(u),g=Ir(o.clientWidth-(c+d)),p=Ir(o.clientHeight-(u+f)),y=Ir(c),b={rootMargin:-m+"px "+-g+"px "+-p+"px "+-y+"px",threshold:Te(0,Ot(1,l))||1};let w=!0;function x(T){const O=T[0].intersectionRatio;if(O!==l){if(!w)return s();O?s(!1,O):r=setTimeout(()=>{s(!1,1e-7)},100)}w=!1}try{n=new IntersectionObserver(x,{...b,root:o.ownerDocument})}catch{n=new IntersectionObserver(x,b)}n.observe(e)}return s(!0),i}function ep(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=ui(e),u=o||i?[...c?Zn(c):[],...Zn(t)]:[];u.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const d=c&&a?Qh(c,n):null;let f=-1,m=null;s&&(m=new ResizeObserver(v=>{let[b]=v;b&&b.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var w;(w=m)==null||w.observe(t)})),n()}),c&&!l&&m.observe(c),m.observe(t));let g,p=l?Kt(e):null;l&&y();function y(){const v=Kt(e);p&&(v.x!==p.x||v.y!==p.y||v.width!==p.width||v.height!==p.height)&&n(),p=v,g=requestAnimationFrame(y)}return n(),()=>{var v;u.forEach(b=>{o&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),d?.(),(v=m)==null||v.disconnect(),m=null,l&&cancelAnimationFrame(g)}}const tp=ll,np=ol,rp=cl,op=Lh,ip=rl,sp=(e,t,n)=>{const r=new Map,o={platform:xl,...n},i={...o.platform,_c:r};return nl(e,t,{...o,platform:i})};function Sl(e){const{x:t=0,y:n=0,width:r=0,height:o=0}=e??{};if(typeof DOMRect=="function")return new DOMRect(t,n,r,o);const i={x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:n+o,left:t};return{...i,toJSON:()=>i}}function ap(e,t){return{contextElement:e,getBoundingClientRect:()=>{const r=t(e);return r?Sl(r):e?e.getBoundingClientRect():Sl()}}}function lp(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}const cp={top:"bottom",right:"left",bottom:"top",left:"right"};function up(e,t){const[n,r]=e.split("-"),o=cp[n];return r?n==="left"||n==="right"?`${o} ${r==="start"?"top":"bottom"}`:r==="start"?`${o} ${t==="rtl"?"right":"left"}`:`${o} ${t==="rtl"?"left":"right"}`:`${o} center`}function dp(e){const t=De({getAnchorRect:f=>f?.getBoundingClientRect(),placement:"bottom",gutter:0,shift:0,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,hideWhenDetached:!1,detachedPadding:0,arrowPadding:4,overflowPadding:8},e),[n,r]=L(),[o,i]=L(),[s,a]=L(t.placement),l=()=>ap(t.anchorRef(),t.getAnchorRect),{direction:c}=Qo();async function u(){const f=l(),m=n(),g=o();if(!f||!m)return;const p=(g?.clientHeight||0)/2,y=typeof t.gutter=="number"?t.gutter+p:t.gutter??p;m.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),f.getBoundingClientRect();const v=[al(({placement:O})=>{const k=!!O.split("-")[1];return{mainAxis:y,crossAxis:k?void 0:t.shift,alignmentAxis:t.shift}})];if(t.flip!==!1){const O=typeof t.flip=="string"?t.flip.split(" "):void 0;if(O!==void 0&&!O.every(lp))throw new Error("`flip` expects a spaced-delimited list of placements");v.push(np({padding:t.overflowPadding,fallbackPlacements:O}))}(t.slide||t.overlap)&&v.push(tp({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),v.push(rp({padding:t.overflowPadding,apply({availableWidth:O,availableHeight:k,rects:j}){const P=Math.round(j.reference.width);O=Math.floor(O),k=Math.floor(k),m.style.setProperty("--kb-popper-anchor-width",`${P}px`),m.style.setProperty("--kb-popper-content-available-width",`${O}px`),m.style.setProperty("--kb-popper-content-available-height",`${k}px`),t.sameWidth&&(m.style.width=`${P}px`),t.fitViewport&&(m.style.maxWidth=`${O}px`,m.style.maxHeight=`${k}px`)}})),t.hideWhenDetached&&v.push(op({padding:t.detachedPadding})),g&&v.push(ip({element:g,padding:t.arrowPadding}));const b=await sp(f,m,{placement:t.placement,strategy:"absolute",middleware:v,platform:{...xl,isRTL:()=>c()==="rtl"}});if(a(b.placement),t.onCurrentPlacementChange?.(b.placement),!m)return;m.style.setProperty("--kb-popper-content-transform-origin",up(b.placement,c()));const w=Math.round(b.x),x=Math.round(b.y);let T;if(t.hideWhenDetached&&(T=b.middlewareData.hide?.referenceHidden?"hidden":"visible"),Object.assign(m.style,{top:"0",left:"0",transform:`translate3d(${w}px, ${x}px, 0)`,visibility:T}),g&&b.middlewareData.arrow){const{x:O,y:k}=b.middlewareData.arrow,j=b.placement.split("-")[0];Object.assign(g.style,{left:O!=null?`${O}px`:"",top:k!=null?`${k}px`:"",[j]:"100%"})}}V(()=>{const f=l(),m=n();if(!f||!m)return;const g=ep(f,m,u,{elementResize:typeof ResizeObserver=="function"});Z(g)}),V(()=>{const f=n(),m=t.contentRef();!f||!m||queueMicrotask(()=>{f.style.zIndex=getComputedStyle(m).zIndex})});const d={currentPlacement:s,contentRef:()=>t.contentRef(),setPositionerRef:r,setArrowRef:i};return h(Qa.Provider,{value:d,get children(){return t.children}})}const El=ve();function Pl(){return be(El)}function pn(){const e=Pl();if(e===void 0)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}const Cl=ve();function mn(){const e=be(Cl);if(e===void 0)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}/*!
182
182
  * Portions of this file are based on code from radix-ui-primitives.
183
183
  * MIT Licensed, Copyright (c) 2022 WorkOS.
184
184
  *
185
185
  * Credits to the Radix UI team:
186
186
  * https://github.com/radix-ui/primitives/blob/81b25f4b40c54f72aeb106ca0e64e1e09655153e/packages/react/menu/src/Menu.tsx
187
- */function dp(e,t){return t?hg([e.clientX,e.clientY],t):!1}function fp(e){const t=mn(),n=Ua(),r=Cl(),o=De({placement:"bottom-start"},e),[i,s]=U(o,["open","defaultOpen","onOpenChange"]);let a=0,l=null,c="right";const[u,d]=L(),[f,m]=L(),[g,p]=L(),[y,v]=L(),[b,w]=L(!0),[x,T]=L(s.placement),[O,k]=L([]),[j,P]=L([]),{DomCollectionProvider:M}=fh({items:j,onItemsChange:P}),$=Oa({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:G=>i.onOpenChange?.(G)}),R=Ig(()=>t.forceMount()||$.isOpen()),se=eh({selectionMode:"none",dataSource:j}),J=G=>{w(G),$.open()},re=(G=!1)=>{$.close(),G&&r&&r.close(!0)},N=G=>{w(G),$.toggle()},X=()=>{const G=y();G&&(xe(G),se.selectionManager().setFocused(!0),se.selectionManager().setFocusedKey(void 0))},ge=G=>{k(dr=>[...dr,G]);const Ee=r?.registerNestedMenu(G);return()=>{k(dr=>Bo(dr,G)),Ee?.()}},E=G=>c===l?.side&&dp(G,l?.area),S=G=>{E(G)&&G.preventDefault()},C=G=>{E(G)||X()},W=G=>{E(G)&&G.preventDefault()};$g({isDisabled:()=>!(r==null&&$.isOpen()&&t.isModal()),targets:()=>[y(),...O()].filter(Boolean)}),V(()=>{const G=y();if(!G||!r)return;const Ee=r.registerNestedMenu(G);Z(()=>{Ee()})});const wt={dataset:A(()=>({"data-expanded":$.isOpen()?"":void 0,"data-closed":$.isOpen()?void 0:""})),isOpen:$.isOpen,contentPresence:R,nestedMenus:O,currentPlacement:x,pointerGraceTimeoutId:()=>a,autoFocus:b,listState:()=>se,parentMenuContext:()=>r,triggerRef:g,contentRef:y,triggerId:u,contentId:f,setTriggerRef:p,setContentRef:v,open:J,close:re,toggle:N,focusContent:X,onItemEnter:S,onItemLeave:C,onTriggerLeave:W,setPointerDir:G=>c=G,setPointerGraceTimeoutId:G=>a=G,setPointerGraceIntent:G=>l=G,registerNestedMenu:ge,registerItemToParentDomCollection:n?.registerItem,registerTriggerId:Ar(d),registerContentId:Ar(m)};return h(M,{get children(){return h(Pl.Provider,{value:wt,get children(){return h(up,I({anchorRef:g,contentRef:y,onCurrentPlacementChange:T},s))}})}})}const Dl=ye();function gp(){const e=ve(Dl);if(e===void 0)throw new Error("[kobalte]: `useMenuItemContext` must be used within a `Menu.Item` component");return e}function kl(e){let t;const n=mn(),r=pn(),o=De({id:n.generateId(`item-${Le()}`)},e),[i,s]=U(o,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,l]=L(),[c,u]=L(),[d,f]=L(),m=()=>r.listState().selectionManager(),g=()=>s.id,p=()=>m().focusedKey()===g(),y=()=>{i.onSelect?.(),i.closeOnSelect&&r.close(!0)};gh({getItem:()=>({ref:()=>t,type:"item",key:g(),textValue:i.textValue??d()?.textContent??t?.textContent??"",disabled:i.disabled??!1})});const v=Jg({key:g,selectionManager:m,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},()=>t),b=P=>{Oe(P,i.onPointerMove),P.pointerType==="mouse"&&(i.disabled?r.onItemLeave(P):(r.onItemEnter(P),P.defaultPrevented||(xe(P.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(g()))))},w=P=>{Oe(P,i.onPointerLeave),P.pointerType==="mouse"&&r.onItemLeave(P)},x=P=>{Oe(P,i.onPointerUp),!i.disabled&&P.button===0&&y()},T=P=>{if(Oe(P,i.onKeyDown),!P.repeat&&!i.disabled)switch(P.key){case"Enter":case" ":y();break}},O=A(()=>{if(i.indeterminate)return"mixed";if(i.checked!=null)return i.checked}),k=A(()=>({"data-indeterminate":i.indeterminate?"":void 0,"data-checked":i.checked&&!i.indeterminate?"":void 0,"data-disabled":i.disabled?"":void 0,"data-highlighted":p()?"":void 0})),j={isChecked:()=>i.checked,dataset:k,setLabelRef:f,generateId:ha(()=>s.id),registerLabel:Ar(l),registerDescription:Ar(u)};return h(Dl.Provider,{value:j,get children(){return h(an,I({as:"div",ref(P){var M=Ct($=>t=$,i.ref);typeof M=="function"&&M(P)},get tabIndex(){return v.tabIndex()},get"aria-checked"(){return O()},get"aria-disabled"(){return i.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return c()},get"data-key"(){return v.dataKey()},get onPointerDown(){return Ne([i.onPointerDown,v.onPointerDown])},get onPointerUp(){return Ne([x,v.onPointerUp])},get onClick(){return Ne([i.onClick,v.onClick])},get onKeyDown(){return Ne([T,v.onKeyDown])},get onMouseDown(){return Ne([i.onMouseDown,v.onMouseDown])},get onFocus(){return Ne([i.onFocus,v.onFocus])},onPointerMove:b,onPointerLeave:w},k,s))}})}function hp(e){const t=De({closeOnSelect:!1},e),[n,r]=U(t,["checked","defaultChecked","onChange","onSelect"]),o=Rg({isSelected:()=>n.checked,defaultIsSelected:()=>n.defaultChecked,onSelectedChange:s=>n.onChange?.(s),isDisabled:()=>r.disabled});return h(kl,I({role:"menuitemcheckbox",get checked(){return o.isSelected()},onSelect:()=>{n.onSelect?.(),o.toggle()}},r))}const pp=ye();function Tl(){return ve(pp)}function mp(e){let t;const n=mn(),r=pn(),o=Tl(),i=De({id:n.generateId(`content-${Le()}`)},e),[s,a]=U(i,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let l=0;const c=()=>r.parentMenuContext()==null&&o===void 0&&n.isModal(),u=nh({selectionManager:r.listState().selectionManager,collection:r.listState().collection,autoFocus:r.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!r.listState().selectionManager().isFocused()},()=>t);kg({trapFocus:()=>c()&&r.isOpen(),onMountAutoFocus:y=>{o===void 0&&s.onOpenAutoFocus?.(y)},onUnmountAutoFocus:s.onCloseAutoFocus},()=>t);const d=y=>{if(Ze(y.currentTarget,y.target)&&(y.key==="Tab"&&r.isOpen()&&y.preventDefault(),o!==void 0&&y.currentTarget.getAttribute("aria-haspopup")!=="true"))switch(y.key){case"ArrowRight":y.stopPropagation(),y.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.nextMenu();break;case"ArrowLeft":if(y.currentTarget.hasAttribute("data-closed"))break;y.stopPropagation(),y.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.previousMenu();break}},f=y=>{s.onEscapeKeyDown?.(y),o?.setAutoFocusMenu(!1),r.close(!0)},m=y=>{s.onFocusOutside?.(y),n.isModal()&&y.preventDefault()},g=y=>{Oe(y,s.onPointerEnter),r.isOpen()&&(r.parentMenuContext()?.listState().selectionManager().setFocused(!1),r.parentMenuContext()?.listState().selectionManager().setFocusedKey(void 0))},p=y=>{if(Oe(y,s.onPointerMove),y.pointerType!=="mouse")return;const v=y.target,b=l!==y.clientX;Ze(y.currentTarget,v)&&b&&(r.setPointerDir(y.clientX>l?"right":"left"),l=y.clientX)};return V(()=>Z(r.registerContentId(s.id))),h(ie,{get when(){return r.contentPresence.isPresent()},get children(){return h(Ph,{get children(){return h(Sh,I({ref(y){var v=Ct(b=>{r.setContentRef(b),r.contentPresence.setRef(b),t=b},s.ref);typeof v=="function"&&v(y)},role:"menu",get id(){return s.id},get tabIndex(){return u.tabIndex()},get disableOutsidePointerEvents(){return A(()=>!!c())()&&r.isOpen()},get excludedElements(){return[r.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return{"--kb-menu-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative",...s.style}},get"aria-labelledby"(){return r.triggerId()},onEscapeKeyDown:f,onFocusOutside:m,get onDismiss(){return r.close},get onKeyDown(){return Ne([s.onKeyDown,u.onKeyDown,d])},get onMouseDown(){return Ne([s.onMouseDown,u.onMouseDown])},get onFocusIn(){return Ne([s.onFocusIn,u.onFocusIn])},get onFocusOut(){return Ne([s.onFocusOut,u.onFocusOut])},onPointerEnter:g,onPointerMove:p},()=>r.dataset(),a))}})}})}function yp(e){let t;const n=mn(),r=pn(),[o,i]=U(e,["ref"]);return Ja({element:()=>t??null,enabled:()=>r.isOpen()&&n.preventScroll()}),h(mp,I({ref(s){var a=Ct(l=>{t=l},o.ref);typeof a=="function"&&a(s)}},i))}function vp(e){return h(kl,I({role:"menuitem",closeOnSelect:!0},e))}function bp(e){const t=gp(),n=De({id:t.generateId("indicator")},e),[r,o]=U(n,["forceMount"]);return h(ie,{get when(){return r.forceMount||t.isChecked()},get children(){return h(an,I({as:"div"},()=>t.dataset(),o))}})}function wp(e){const t=pn();return h(ie,{get when(){return t.contentPresence.isPresent()},get children(){return h(Io,e)}})}function xp(e){const t=`menu-${Le()}`,n=De({id:t,modal:!0},e),[r,o]=U(n,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value"]),i=Oa({open:()=>r.open,defaultOpen:()=>r.defaultOpen,onOpenChange:a=>r.onOpenChange?.(a)}),s={isModal:()=>r.modal??!0,preventScroll:()=>r.preventScroll??s.isModal(),forceMount:()=>r.forceMount??!1,generateId:ha(()=>r.id),value:()=>r.value};return h(Ol.Provider,{value:s,get children(){return h(fp,I({get open(){return i.isOpen()},get onOpenChange(){return i.setIsOpen}},o))}})}function Sp(e){const t=mn(),n=pn(),r=Tl(),o=De({id:t.generateId("trigger")},e),[i,s]=U(o,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let a;r!==void 0&&(a=t.value()??i.id,V(()=>{r.registerMenu(a,[n.contentRef(),...n.nestedMenus()])}),V(()=>{r.value()===a?(n.triggerRef()?.focus(),r.autoFocusMenu()&&n.open(!0)):n.close(!0)}),V(()=>{n.isOpen()&&r.setValue(a)}),Z(()=>{r.unregisterMenu(a)}),r.lastValue()===void 0&&r.setLastValue(a));const l=()=>{r?.setAutoFocusMenu(!0),r!==void 0?n.toggle(!1):n.toggle(!0),r!==void 0&&!n.isOpen()&&r.value()===a&&r.closeMenu()},c=g=>{Oe(g,i.onPointerDown),g.currentTarget.dataset.pointerType=g.pointerType,!i.disabled&&g.pointerType!=="touch"&&g.button===0&&l()},u=g=>{Oe(g,i.onClick),i.disabled||g.currentTarget.dataset.pointerType==="touch"&&l()},d=g=>{if(Oe(g,i.onKeyDown),!i.disabled)switch(g.key){case"Enter":case" ":case"ArrowDown":g.stopPropagation(),g.preventDefault(),pg(g.currentTarget),n.toggle("first");break;case"ArrowUp":g.stopPropagation(),g.preventDefault(),n.toggle("last");break;case"ArrowRight":if(r===void 0)break;g.stopPropagation(),g.preventDefault(),r.nextMenu();break;case"ArrowLeft":if(r===void 0)break;g.stopPropagation(),g.preventDefault(),r.previousMenu();break}},f=g=>{Oe(g,i.onMouseOver),!i.disabled&&r!==void 0&&r.value()!==void 0&&r.setValue(a)},m=g=>{Oe(g,i.onFocus),r!==void 0&&r.setValue(a)};return V(()=>Z(n.registerTriggerId(i.id))),h(ih,I({ref(g){var p=Ct(n.setTriggerRef,i.ref);typeof p=="function"&&p(g)},get id(){return i.id},get disabled(){return i.disabled},"aria-haspopup":"true",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return A(()=>!!n.isOpen())()?n.contentId():void 0},get"data-highlighted"(){return a!==void 0&&r?.value()===a?!0:void 0},get tabIndex(){return r!==void 0?r.value()===a||r.lastValue()===a?0:-1:void 0},onPointerDown:c,onMouseOver:f,onClick:u,onKeyDown:d,onFocus:m,role:r!==void 0?"menuitem":void 0},()=>n.dataset(),s))}function Ep(e){let t;const n=De({orientation:"horizontal"},e),[r,o]=U(n,["ref","orientation"]),i=La(()=>t,()=>"hr");return h(an,I({as:"hr",ref(s){var a=Ct(l=>t=l,r.ref);typeof a=="function"&&a(s)},get role(){return i()!=="hr"?"separator":void 0},get"aria-orientation"(){return r.orientation==="vertical"?"vertical":void 0},get"data-orientation"(){return r.orientation}},o))}function Pp(e){const t=mn(),n=pn(),[r,o]=U(e,["onCloseAutoFocus","onInteractOutside"]);let i=!1;return h(yp,I({onCloseAutoFocus:l=>{r.onCloseAutoFocus?.(l),i||xe(n.triggerRef()),i=!1,l.preventDefault()},onInteractOutside:l=>{r.onInteractOutside?.(l),(!t.isModal()||l.detail.isContextMenu)&&(i=!0)}},o))}function Cp(e){const t=`dropdownmenu-${Le()}`,n=De({id:t},e);return h(xp,n)}function Op(e){return pe({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-check",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M5 12l5 5l10 -10"/>'},e)}function Dp(e){return pe({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-chevron-left",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M15 6l-6 6l6 6"/>'},e)}function kp(e){return pe({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-chevron-right",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M9 6l6 6l-6 6"/>'},e)}function Tp(e){return pe({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-circle-check-filled",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-1.293 5.953a1 1 0 0 0 -1.32 -.083l-.094 .083l-3.293 3.292l-1.293 -1.292l-.094 -.083a1 1 0 0 0 -1.403 1.403l.083 .094l2 2l.094 .083a1 1 0 0 0 1.226 0l.094 -.083l4 -4l.083 -.094a1 1 0 0 0 -.083 -1.32z" stroke-width="0" fill="currentColor"/>'},e)}function $p(e){return pe({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-circle",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"/>'},e)}function Ap(e){return pe({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-download",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M14 3v4a1 1 0 0 0 1 1h4"/><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"/><path d="M12 17v-6"/><path d="M9.5 14.5l2.5 2.5l2.5 -2.5"/>'},e)}var Mp=B('<span class="absolute left-2 flex size-3.5 items-center justify-center">');const Ip=e=>h(Cp,I({gutter:4},e)),Lp=Sp,Rp=e=>{const[,t]=U(e,["class"]);return h(wp,{get mount(){return Bn()},get children(){return h(Pp,I({get class(){return le("z-50 min-w-[8rem] origin-[var(--kb-menu-content-transform-origin)] animate-content-hide overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[expanded]:animate-content-show",e.class)}},t))}})},Np=e=>{const[,t]=U(e,["class"]);return h(vp,I({get class(){return le("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e.class)}},t))},Fp=e=>{const[,t]=U(e,["class"]);return h(Ep,I({get class(){return le("-mx-1 my-1 h-px bg-muted",e.class)}},t))},_p=e=>{const[,t]=U(e,["class","children"]);return h(hp,I({get class(){return le("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e.class)}},t,{get children(){return[(()=>{var n=Mp();return F(n,h(bp,{get children(){return h(Op,{class:"size-4"})}})),n})(),A(()=>e.children)]}}))};function Vp(e){return e.type==="buttons"&&e.buttons.options.length>3?{list:{text:e.buttons.text,options:[{items:e.buttons.options}]},type:"list",origin:e.origin,createdAt:e.createdAt}:e}async function Kp(e,t){return await new Promise(n=>setTimeout(n,1e3)),{contactId:"mock",interactionId:"mock",messages:[{media:{type:"image",link:"https://62daaa4fd548ba68369ee934-secured.s3.amazonaws.com/1688647717709-Banner-tem-que-ir-turismo-de-aventura-1920x1077-123-milhas.jpg",text:"Look what a great image!"},type:"media",origin:"bot",createdAt:new Date().toString()}]}}async function zp(e,t,n,r,o){if(!n||!r)return await Kp();const i=`${Vo}/v1/webhooks/widget`,s={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({clientIdentifier:o,channelId:n,flowId:r,postback:t,type:"text",text:e})};return(await fetch(i,s)).json()}async function Bp(e,t,n){if(!e||!t||!n)return;const r=`${Vo}/v1/webhooks/widget/restart`,o={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({channelId:e,contactId:t,interactionId:n})};await fetch(r,o)}const $l=1e3*60*60*24,{chatWidget:_r}=Pe(),[fi,Al]=Qs(`messages-${_r()?._id}`,[],$l),[yn,Ml]=Qs(`conversation-${_r()?._id}`,{},$l),[jp,Il]=L(!1),[Up,Ll]=L(!1),Rl=[],Nl=()=>{Rl.forEach(e=>e())},Wp=e=>Rl.push(e),gi=e=>{const t=Vp(e);if(Al(fi.length,t),t.type==="media"){setTimeout(Nl,200);return}Nl()},Hp=(e,t)=>{const{chatWidget:n}=Pe();e.trim()&&(gi({text:e,type:"text",origin:"user",createdAt:new Date().toString()}),t&&console.log("postback:",t),Il(!0),zp(e,t,n()?._id,n()?.chat.flowId,yn.clientIdentifier).then(r=>{(r.contactId!==yn.contactId||r.interactionId!==yn.interactionId||r.clientIdentifier!==yn.clientIdentifier)&&Ml({contactId:r.contactId,interactionId:r.interactionId,clientIdentifier:r.clientIdentifier});for(const o of r.messages)gi(o)}).catch(console.error).finally(()=>Il(!1)))},Yp=()=>{const{chatWidget:e}=Pe();Ll(!0),Al([]),Bp(e()?._id,yn.contactId,yn.interactionId).finally(()=>{Ml({}),Ll(!1),Gp()})},Gp=()=>{if(fi.length===0&&_r()?.balloonMessage){const e=_r()?.balloonMessage;e&&gi({text:e,type:"text",origin:"bot",createdAt:new Date().toString()})}},Tt=()=>({messages:fi,pushMessage:Hp,clearMessages:Yp,onMessage:Wp,typing:jp,loading:Up});var qp=B("<span class=ml-1>Debug"),Zp=B("<span>Restart");const Xp=()=>{const{clearMessages:e}=Tt(),[t,n]=L(!1),[r,o]=L(!1);return h(Ip,{get open(){return r()},onOpenChange:o,get children(){return[h(Lp,{get children(){return h(Ce,{variant:"ghost",size:"icon",class:"hover:bg-accent/10 hover:text-primary-foreground",get children(){return h(Mf,{size:20})}})}}),h(Rp,{get children(){return[h(_p,{class:"flex items-center justify-start cursor-pointer",get checked(){return t()},onChange:n,get children(){return[h(Af,{size:14}),qp()]}}),h(Fp,{}),h(Np,{class:"flex space-x-2 items-center cursor-pointer",onSelect:e,get children(){return[h($f,{size:14}),Zp()]}})]}})]}})};function Jp(e){return pe({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M5.5 0a.5.5 0 0 1 .5.5v4A1.5 1.5 0 0 1 4.5 6h-4a.5.5 0 0 1 0-1h4a.5.5 0 0 0 .5-.5v-4a.5.5 0 0 1 .5-.5zm5 0a.5.5 0 0 1 .5.5v4a.5.5 0 0 0 .5.5h4a.5.5 0 0 1 0 1h-4A1.5 1.5 0 0 1 10 4.5v-4a.5.5 0 0 1 .5-.5zM0 10.5a.5.5 0 0 1 .5-.5h4A1.5 1.5 0 0 1 6 11.5v4a.5.5 0 0 1-1 0v-4a.5.5 0 0 0-.5-.5h-4a.5.5 0 0 1-.5-.5zm10 1a1.5 1.5 0 0 1 1.5-1.5h4a.5.5 0 0 1 0 1h-4a.5.5 0 0 0-.5.5v4a.5.5 0 0 1-1 0v-4z"/>'},e)}function Qp(e){return pe({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M1.5 1a.5.5 0 0 0-.5.5v4a.5.5 0 0 1-1 0v-4A1.5 1.5 0 0 1 1.5 0h4a.5.5 0 0 1 0 1h-4zM10 .5a.5.5 0 0 1 .5-.5h4A1.5 1.5 0 0 1 16 1.5v4a.5.5 0 0 1-1 0v-4a.5.5 0 0 0-.5-.5h-4a.5.5 0 0 1-.5-.5zM.5 10a.5.5 0 0 1 .5.5v4a.5.5 0 0 0 .5.5h4a.5.5 0 0 1 0 1h-4A1.5 1.5 0 0 1 0 14.5v-4a.5.5 0 0 1 .5-.5zm15 0a.5.5 0 0 1 .5.5v4a1.5 1.5 0 0 1-1.5 1.5h-4a.5.5 0 0 1 0-1h4a.5.5 0 0 0 .5-.5v-4a.5.5 0 0 1 .5-.5z"/>'},e)}function em(e){return pe({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8 2.146 2.854Z"/>'},e)}var tm=B('<header class="flex-none bg-primary text-primary-foreground p-3 flex items-center justify-between space-x-4"><div class="flex items-center gap-0.5">');const hi=()=>{const{chatWidget:e}=Pe(),[t,n]=L(!1),r=()=>{const i=Bn();i&&(t()?document.exitFullscreen():i.requestFullscreen(),n(!t()))};document.addEventListener("fullscreenchange",()=>{document.fullscreenElement||n(!1)});const o=()=>{if(e()?.mode==="popup"){const i=Bn();i&&(i.style.display="none")}};return(()=>{var i=tm(),s=i.firstChild;return F(i,h(kf,{}),s),F(s,h(Ce,{size:"icon",variant:"ghost",class:"hover:bg-accent/10 hover:text-primary-foreground",onClick:r,get children(){return h(ie,{get when(){return t()},get fallback(){return h(Qp,{size:16})},get children(){return h(Jp,{size:16})}})}}),null),F(s,h(ie,{get when(){return e()?.showSettings},get children(){return h(Xp,{})}}),null),F(s,h(ie,{get when(){return e()?.mode==="popup"},get children(){return h(Ce,{size:"icon",variant:"ghost",class:"hover:bg-accent/10 hover:text-primary-foreground",onClick:o,get children(){return h(em,{size:16})}})}}),null),i})()};var nm=B("<span>");const Fl=({createdAt:e,anchor:t="end"})=>(()=>{var n=nm();return xt(n,`${t==="end"?"self-end":"self-start"} pt-1 text-[10px] italic font-light text-slate-600`),F(n,()=>new Date(e).toLocaleString([],{hour:"2-digit",minute:"2-digit"})),n})();var rm=B('<div class="place-self-start py-1 flex flex-col"><div class="bg-white shadow-md py-2 px-4 rounded-r-xl rounded-tl-xl">');const om=({children:e,createdAt:t})=>(()=>{var n=rm(),r=n.firstChild;return F(r,e),F(n,h(Fl,{createdAt:t,anchor:"start"}),null),n})();var im=B("<span>");const zt=e=>{const[,t]=U(e,["class","children"]);let n=e.children?.toString();return n&&(n=hf(pf(n))),(()=>{var r=im();return r.innerHTML=n,Xt(r,I({get class(){return le("whitespace-pre-line",e.class)}},t),!1,!1),r})()};var sm=B('<div class="flex flex-col space-y-2"><div><div class="flex space-x-2 py-2 overflow-x-auto snap-x">');const am=({options:e,text:t})=>{let n;const{pushMessage:r}=Tt(),[o,i]=L(!1),s=(l=!0)=>{if(n){const c=n.clientWidth/2;n.scrollTo({left:n.scrollLeft+(l?c:-c),behavior:"smooth"})}},a=(l,c)=>{i(!0),r(l,c)};return(()=>{var l=sm(),c=l.firstChild,u=c.firstChild;F(l,h(zt,{get children(){return t?.trim()}}),c),F(c,h(ie,{get when(){return e.length>1},get children(){return h(Ce,{class:"p-1 text-slate-400",variant:"ghost",onClick:()=>s(!1),get children(){return h(Dp,{size:20})}})}}),u);var d=n;return typeof d=="function"?Fs(d,u):n=u,F(u,h(Zt,{each:e,children:f=>h(Ce,{variant:"outline",get disabled(){return o()},class:"px-2 py-0 snap-center text-nowrap",onClick:()=>a(f.label,f.value),get children(){return f.label?.trim()}})})),F(c,h(ie,{get when(){return e.length>1},get children(){return h(Ce,{class:"p-1 text-slate-400",variant:"ghost",onClick:()=>s(),get children(){return h(kp,{size:20})}})}}),null),ue(()=>xt(c,`flex items-center justify-center max-w-64 mx-[-1rem] ${o()&&"opacity-50"}`)),l})()};var lm=B('<div class="flex flex-col"><span>'),cm=B("<a target=_blank><img><span></span><span>");const um=({options:e,text:t})=>(()=>{var n=lm(),r=n.firstChild;return F(r,()=>t?.trim()),F(n,h(Zt,{each:e,children:o=>(()=>{var i=cm(),s=i.firstChild,a=s.nextSibling,l=a.nextSibling;return F(a,()=>o.title?.trim()),F(l,()=>o.description?.trim()),ue(c=>{var u=o.url,d=o.image;return u!==c.e&&we(i,"href",c.e=u),d!==c.t&&we(s,"src",c.t=d),c},{e:void 0,t:void 0}),i})()}),null),n})();var dm=B("<a target=_blank>");const fm=({url:e,text:t})=>(()=>{var n=dm();return we(n,"href",e),F(n,()=>t?.trim()),n})();var gm=e=>{const t=I({initialRegistered:!1},e),[n,r]=L(t.initialRegistered);return[A(()=>{if(n())return z(t.value)}),()=>{r(!0)},()=>{r(!1)}]},_l=gm,Jn=e=>typeof e=="function",hm=["button","color","file","image","reset","submit"],pm=(e,t)=>e==="button"?!0:e==="input"&&t?hm.indexOf(t)!==-1:!1;function mm(e){const[t,n]=L(e.initialValue),r=()=>e.value?.()!==void 0,o=()=>r()?e.value?.():t();return[o,s=>Q(()=>{let a;return Jn(s)?a=s(o()):a=s,Object.is(a,o())||(r()||n(a),e.onChange?.(a)),a})]}var pi=mm,Vr=new Map,Kr=(e,t)=>{if(Vr.has(e))return Vr.get(e);const n=ye(t);return Vr.set(e,n),n},mi=e=>{const t=Vr.get(e);if(t)return ve(t)},ym=e=>{const t=I({enabled:!0},e);V(()=>{z(t.enabled)&&(document.addEventListener("keydown",n),Z(()=>{document.removeEventListener("keydown",n)}))});const n=r=>{r.key==="Escape"&&t.onEscapeKeyDown(r)}},vm=ym,bm=e=>{const t=I({enabled:!0},e);V(()=>{const{body:n}=document;z(t.enabled)&&ri({key:"no-pointer-events",element:n,style:{pointerEvents:"none"}})})},wm=bm,xm=e=>{const t=I({enabled:!0,strategy:"pointerup"},e);V(()=>{if(!z(t.enabled))return;const r=z(t.strategy);document.addEventListener(r,n),Z(()=>{document.removeEventListener(r,n)})});const n=r=>{const o=z(t.element),i=z(t.ignore);o&&!o.contains(r.target)&&!(i&&i.contains(r.target))&&t.onPointer(r)}},Sm=xm,Em=e=>{const t=I({dismissOnEscapeKeyDown:!0,dismissOnOutsidePointer:!0,closeOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:!0},e);vm({enabled:t.dismissOnEscapeKeyDown,onEscapeKeyDown:n=>{t.onEscapeKeyDown?.(n),n.defaultPrevented||t.onDismiss("escapeKey")}}),Sm({enabled:t.dismissOnOutsidePointer,strategy:t.closeOnOutsidePointerStrategy,ignore:t.dismissOnOutsidePointerIgnore,onPointer:n=>{if(t.onOutsidePointer?.(n),!n.defaultPrevented){const r=n.button===0&&n.ctrlKey===!0;if(n.button===2||r)return;t.onDismiss("pointerOutside")}},element:t.element}),wm({enabled:t.noOutsidePointerEvents})},Pm=Em,yi=ye(),Cm=e=>A(()=>{if(ve(yi))return h(Vl,e);const r=Le(),[o,i]=L([r]),s=l=>{i(c=>[...c,l])},a=l=>{i(c=>c.filter(u=>u!==l))};return h(yi.Provider,{value:{layers:o,onLayerShow:s,onLayerDismiss:a},get children(){return h(Vl,e)}})}),Vl=e=>{const t=I({enabled:!0,dismissOnEscapeKeyDown:!0,dismissOnOutsidePointer:!0,dismissOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:!0},e),[n,r]=U(t,["enabled","children","dismissOnEscapeKeyDown","dismissOnOutsidePointer","dismissOnOutsidePointerStrategy","dismissOnOutsidePointerIgnore","noOutsidePointerEvents","onDismiss"]),o=ve(yi),i=Le();V(()=>{n.enabled?o.onLayerShow(i):o.onLayerDismiss(i)});const s=()=>o.layers()[o.layers().length-1]===i;Pm({dismissOnEscapeKeyDown:()=>z(n.dismissOnEscapeKeyDown)&&s()&&n.enabled,dismissOnOutsidePointer:()=>z(n.dismissOnOutsidePointer)&&s()&&n.enabled,dismissOnOutsidePointerStrategy:n.dismissOnOutsidePointerStrategy,dismissOnOutsidePointerIgnore:n.dismissOnOutsidePointerIgnore,noOutsidePointerEvents:()=>z(n.noOutsidePointerEvents)&&n.enabled,onDismiss:c=>{n.onDismiss(c)},...r});const a=A(()=>n.children),l=()=>{const c=a();return Jn(c)?c({get isLastLayer(){return s()}}):c};return Q(()=>l())},Om=Cm,Dm=()=>{const[e,t]=L(!1);return V(()=>t(!0)),e},km=Dm,Tm=(e,t)=>(e&&(Jn(e)?e(t):e[0](e[1],t)),t.defaultPrevented),vi=(...e)=>e.some(t=>!!t()),$m=e=>(...t)=>{for(const n of e)n&&n(...t)},zr=(...e)=>$m(e),me=e=>e?"":void 0,Am="div",Mm=e=>{const[t,n]=U(e,["as"]),r=A(()=>t.as??Am);return A(()=>{const i=r();switch(typeof i){case"function":return Q(()=>i(n));case"string":return h(Fn,I({component:i},n))}})},bi=Mm,Im=e=>{let t,n=!1;return()=>n?t:(n=!0,t=A(e))},Kl=Im,Lm=e=>A(()=>z(e.element)?.tagName.toLowerCase()||e.fallback),Rm=Lm,zl="button",Nm=e=>{const[t,n]=L(null),[r,o]=U(e,["as","ref","type"]),i=Rm({element:t,fallback:zl}),s=A(()=>pm(i(),r.type));return h(bi,I({get as(){return r.as??zl},ref(a){var l=zr(n,r.ref);typeof l=="function"&&l(a)},get type(){return s()?"button":void 0},get role(){return s()?void 0:"button"}},o))},Fm=Nm,_m='a[href]:not([tabindex="-1"]), button:not([tabindex="-1"]), input:not([tabindex="-1"]), textarea:not([tabindex="-1"]), select:not([tabindex="-1"]), details:not([tabindex="-1"]), [tabindex]:not([tabindex="-1"])',wi="focusTrap.initialFocus",xi="focusTrap.finalFocus",Bl={bubbles:!1,cancelable:!0},Vm=e=>{const t=I({enabled:!0,observeChanges:!0,restoreFocus:!0},e),[n,r]=L(null),o=A(()=>{const g=n();return g?g[0]??null:null}),i=A(()=>{const g=n();return g?g[g.length-1]??null:null});let s=null;const a=()=>{l(z(t.element)),(document.activeElement===null||document.activeElement===document.body)&&c(z(t.element))};V(()=>{const g=z(t.element);if(g&&z(t.enabled)){s=document.activeElement,Q(()=>{l(g),c(g)});const p=new MutationObserver(a);z(t.observeChanges)&&p.observe(g,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabindex"]}),Z(()=>{z(t.observeChanges)&&p.disconnect(),r(null),m(g)})}}),V(()=>{const g=n();g===null||g.length!==0||(document.addEventListener("keydown",f),Z(()=>{document.removeEventListener("keydown",f)}))}),V(()=>{const g=o();g&&(g.addEventListener("keydown",u),Z(()=>{g.removeEventListener("keydown",u)}))}),V(()=>{const g=i();g&&(g.addEventListener("keydown",d),Z(()=>{g.removeEventListener("keydown",d)}))});const l=g=>{r(Array.from(g.querySelectorAll(_m)))},c=g=>{const p=z(t.initialFocusElement)??o()??g,y=t.onInitialFocus;let v;y&&(v=new CustomEvent(wi,Bl),g.addEventListener(wi,y),g.dispatchEvent(v),g.removeEventListener(wi,y)),!v?.defaultPrevented&&cn(()=>p.focus())},u=g=>{g.key==="Tab"&&g.shiftKey&&(g.preventDefault(),i().focus())},d=g=>{g.key==="Tab"&&!g.shiftKey&&(g.preventDefault(),o().focus())},f=g=>{g.key==="Tab"&&g.preventDefault()},m=g=>{if(!z(t.restoreFocus))return;const y=z(t.finalFocusElement)??s;if(!y)return;let v;const b=t.onFinalFocus;b&&(v=new CustomEvent(xi,Bl),g.addEventListener(xi,b),g.dispatchEvent(v),g.removeEventListener(xi,b)),!v?.defaultPrevented&&cn(()=>y.focus())}},Km=Vm,zm=Km,Bm=e=>{const t=A(()=>{const s=z(e.element);if(s)return getComputedStyle(s)}),n=()=>t()?.animationName??"none",[r,o]=L(z(e.show)?"present":"hidden");let i="none";return V(s=>{const a=z(e.show);return Q(()=>{if(s===a)return a;const l=i,c=n();a?o("present"):c==="none"||t()?.display==="none"?o("hidden"):o(s&&l!==c?"hiding":"hidden")}),a}),V(()=>{const s=z(e.element);if(!s)return;const a=c=>{c.target===s&&(i=n())},l=c=>{const d=n().includes(c.animationName);c.target===s&&d&&r()==="hiding"&&o("hidden")};s.addEventListener("animationstart",a),s.addEventListener("animationcancel",l),s.addEventListener("animationend",l),Z(()=>{s.removeEventListener("animationstart",a),s.removeEventListener("animationcancel",l),s.removeEventListener("animationend",l)})}),{present:()=>r()==="present"||r()==="hiding",state:r}},jm=Bm,jl=jm,Um=ye(),Wm=e=>e?Kr(`dialog-${e}`):Um,Ul=ye(),Hm=e=>e?Kr(`dialog-internal-${e}`):Ul,vn=e=>{if(!e){const n=ve(Ul);if(!n)throw new Error("[corvu]: Dialog context not found. Make sure to wrap Dialog components in <Dialog.Root>");return n}const t=mi(`dialog-internal-${e}`);if(!t)throw new Error(`[corvu]: Dialog context with id "${e}" not found. Make sure to wrap Dialog components in <Dialog.Root contextId="${e}">`);return t},Ym="div",Gm=e=>{const[t,n]=U(e,["as","forceMount","contextId","children","ref","style","data-corvu-dialog-content"]),r=A(()=>vn(t.contextId)),o=()=>vi(r().open,()=>t.forceMount,r().contentPresent),i=A(s=>s||o(),!1);return h(ie,{get when(){return i()},get children(){return h(Om,{get element(){return r().contentRef},get enabled(){return r().open()||r().contentPresent()},onDismiss:()=>r().setOpen(!1),get dismissOnEscapeKeyDown(){return r().closeOnEscapeKeyDown},get dismissOnOutsidePointer(){return r().closeOnOutsidePointer},get dismissOnOutsidePointerStrategy(){return r().closeOnOutsidePointerStrategy},get dismissOnOutsidePointerIgnore(){return r().triggerRef},get noOutsidePointerEvents(){return r().noOutsidePointerEvents},get onEscapeKeyDown(){return r().onEscapeKeyDown},get onOutsidePointer(){return r().onOutsidePointer},children:s=>{const a=A(()=>t.children);return h(ie,{get when(){return o()},get children(){return h(bi,I({ref(l){var c=zr(r().setContentRef,t.ref);typeof c=="function"&&c(l)},get as(){return t.as??Ym},get role(){return r().role()},get id(){return r().dialogId()},get"aria-labelledby"(){return r().labelId()},get"aria-describedby"(){return r().descriptionId()},get"aria-modal"(){return r().modal()?"true":"false"},get"data-open"(){return me(r().open())},get"data-closed"(){return me(!r().open())},get"data-corvu-dialog-content"(){return t.hasOwnProperty("data-corvu-dialog-content")?t["data-corvu-dialog-content"]:""},tabIndex:"-1",get style(){return{"pointer-events":s.isLastLayer?"auto":void 0,...t.style}}},n,{get children(){return a()}}))}})}})}})},qm=Gm,Zm="div",Xm=e=>{const[t,n]=U(e,["as","forceMount","contextId","children","ref","style","data-corvu-dialog-overlay"]),r=A(()=>vn(t.contextId)),o=()=>vi(r().open,()=>t.forceMount,r().overlayPresent),i=A(s=>s||o(),!1);return h(ie,{get when(){return i()},get children(){return(()=>{const s=A(()=>t.children);return h(ie,{get when(){return o()},get children(){return h(bi,I({get as(){return t.as??Zm},ref(a){var l=zr(r().setOverlayRef,t.ref);typeof l=="function"&&l(a)},"aria-hidden":"true",get"data-open"(){return me(r().open())},get"data-closed"(){return me(!r().open())},get"data-corvu-dialog-overlay"(){return t.hasOwnProperty("data-corvu-dialog-overlay")?t["data-corvu-dialog-overlay"]:""},tabIndex:"-1",get style(){return{"pointer-events":"auto",...t.style}}},n,{get children(){return s()}}))}})})()}})},Jm=Xm,Qm=e=>{const[t,n]=U(e,["forceMount","contextId","children"]),r=A(()=>vn(t.contextId)),o=()=>vi(r().open,()=>t.forceMount,r().contentPresent,r().overlayPresent),i=km(),s=A(a=>a||o()&&i(),!1);return h(ie,{get when(){return s()},get children(){return(()=>{const a=A(()=>t.children);return h(ie,{get when(){return o()},get children(){return h(Io,I(n,{get children(){return a()}}))}})})()}})},ey=Qm,Si=!0,ty=e=>{const t=I({role:"dialog",initialOpen:!1,modal:!0,closeOnEscapeKeyDown:!0,closeOnOutsidePointer:()=>!!(e.modal??Si),closeOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:()=>!!(e.modal??Si),preventScroll:()=>!!(e.modal??Si),hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",allowPinchZoom:!0,trapFocus:!0,restoreFocus:!0,dialogId:Le()},e),[n,r]=pi({value:()=>t.open,initialValue:t.initialOpen,onChange:t.onOpenChange}),[o,i,s]=_l({value:()=>t.labelId??Le()}),[a,l,c]=_l({value:()=>t.descriptionId??Le()}),[u,d]=L(null),[f,m]=L(null),[g,p]=L(null),{present:y}=jl({show:n,element:f}),{present:v}=jl({show:n,element:g});zm({element:f,enabled:()=>n()&&t.trapFocus,initialFocusElement:()=>t.initialFocusEl??null,restoreFocus:()=>t.restoreFocus,finalFocusElement:()=>t.finalFocusEl??null,onFinalFocus:t.onFinalFocus,onInitialFocus:t.onInitialFocus}),Ja({element:f,enabled:()=>y()&&z(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>t.preventScrollbarShift,preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom});const b={get role(){return t.role},get open(){return n()},setOpen:r,get modal(){return t.modal},get closeOnEscapeKeyDown(){return t.closeOnEscapeKeyDown},get closeOnOutsidePointer(){return z(t.closeOnOutsidePointer)},get closeOnOutsidePointerStrategy(){return t.closeOnOutsidePointerStrategy},get noOutsidePointerEvents(){return z(t.noOutsidePointerEvents)},get preventScroll(){return z(t.preventScroll)},get hideScrollbar(){return t.hideScrollbar},get preventScrollbarShift(){return z(t.preventScrollbarShift)},get preventScrollbarShiftMode(){return t.preventScrollbarShiftMode},get allowPinchZoom(){return t.allowPinchZoom},get trapFocus(){return t.trapFocus},get restoreFocus(){return t.restoreFocus},get initialFocusEl(){return t.initialFocusEl},get finalFocusEl(){return t.finalFocusEl},get contentPresent(){return y()},get contentRef(){return f()},get overlayPresent(){return v()},get overlayRef(){return g()},get dialogId(){return t.dialogId},get labelId(){return o()},get descriptionId(){return a()}},w=Kl(()=>t.children),x=()=>{const O=w()();return Jn(O)?O(b):O};return A(()=>{const O=Wm(t.contextId),k=Hm(t.contextId);return h(O.Provider,{value:{role:()=>t.role,open:n,setOpen:r,modal:()=>t.modal,closeOnEscapeKeyDown:()=>t.closeOnEscapeKeyDown,closeOnOutsidePointer:()=>z(t.closeOnOutsidePointer),closeOnOutsidePointerStrategy:()=>t.closeOnOutsidePointerStrategy,noOutsidePointerEvents:()=>z(t.noOutsidePointerEvents),preventScroll:()=>z(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>z(t.preventScrollbarShift),preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom,trapFocus:()=>t.trapFocus,restoreFocus:()=>t.restoreFocus,initialFocusEl:()=>t.initialFocusEl,finalFocusEl:()=>t.finalFocusEl,contentPresent:y,contentRef:f,overlayPresent:v,overlayRef:g,dialogId:()=>t.dialogId,labelId:o,descriptionId:a},get children(){return h(k.Provider,{get value(){return{role:()=>t.role,open:n,setOpen:r,modal:()=>t.modal,closeOnEscapeKeyDown:()=>t.closeOnEscapeKeyDown,onEscapeKeyDown:t.onEscapeKeyDown,closeOnOutsidePointer:()=>z(t.closeOnOutsidePointer),closeOnOutsidePointerStrategy:()=>t.closeOnOutsidePointerStrategy,onOutsidePointer:t.onOutsidePointer,noOutsidePointerEvents:()=>z(t.noOutsidePointerEvents),preventScroll:()=>z(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>z(t.preventScrollbarShift),preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom,trapFocus:()=>t.trapFocus,restoreFocus:()=>t.restoreFocus,initialFocusEl:()=>t.initialFocusEl,finalFocusEl:()=>t.finalFocusEl,contentPresent:y,contentRef:f,overlayPresent:v,overlayRef:g,dialogId:()=>t.dialogId,labelId:o,registerLabelId:i,unregisterLabelId:s,descriptionId:a,registerDescriptionId:l,unregisterDescriptionId:c,setContentRef:m,setOverlayRef:p,triggerRef:u,setTriggerRef:d}},get children(){return Q(()=>x())}})}})})},ny=ty,ry="button",oy=e=>{const[t,n]=U(e,["as","contextId","ref","onClick","data-corvu-dialog-trigger"]),r=A(()=>vn(t.contextId));return h(Fm,I({ref(i){var s=zr(r().setTriggerRef,t.ref);typeof s=="function"&&s(i)},get as(){return t.as??ry},onClick:i=>{!Tm(t.onClick,i)&&r().setOpen(s=>!s)},"aria-haspopup":"dialog",get"aria-expanded"(){return r().open()?"true":"false"},get"aria-controls"(){return r().dialogId()},get"data-open"(){return me(r().open())},get"data-closed"(){return me(!r().open())},get"data-corvu-dialog-trigger"(){return t.hasOwnProperty("data-corvu-dialog-trigger")?t["data-corvu-dialog-trigger"]:""}},n))},iy=oy;function sy(e){const t=I({enabled:!0,dimension:"both"},e),[n,r]=L(!1),[o,i]=L(null);let s=null;V(()=>{const c=z(t.element),u=z(t.enabled);if(!c||!u)return;const d=new ResizeObserver(a);d.observe(c),c.addEventListener("transitionend",l),Z(()=>{d.disconnect(),c.removeEventListener("transitionend",l),l()})});const a=c=>{if(!n())for(const u of c){const d=u.target;if(d!==z(t.element))continue;const f=[d.offsetWidth,d.offsetHeight],m=z(t.dimension);m==="both"?s?s[0]!==f[0]&&s[1]!==f[1]&&(Be(()=>{i(s),r(!0)}),cn(()=>{i(f),parseFloat(getComputedStyle(u.target).transitionDuration)===0&&l()})):s=f:s?Br(m,s)!==Br(m,f)&&(Be(()=>{i(Br(m,s)),r(!0)}),cn(()=>{i(Br(m,f)),parseFloat(getComputedStyle(u.target).transitionDuration)===0&&l()})):s=f}},l=()=>{if(!n())return;const c=z(t.element);c?s=[c.offsetWidth,c.offsetHeight]:s=null,Be(()=>{r(!1),i(null)})};return{transitioning:n,transitionSize:o}}var Br=(e,t)=>{switch(e){case"width":return t[0];case"height":return t[1]}},ay=sy,ly=ay,cy=(e,t)=>e.length>0?()=>e(Q(t)):e;function uy(e,t){let n=0;const r=e.map((o,i)=>A(()=>(n=i,o()),void 0,Kf));return A(()=>r.map(o=>o())[n],void 0,t)}function Wl(e,t,n){let r=()=>t;const[o,i]=L(t),s=A(cy(e,()=>r()),t);return[r=uy([o,s],n),a=>i(()=>typeof a=="function"?a(Q(r)):a)]}var dy=e=>h(iy,I({"data-corvu-dialog-trigger":void 0,"data-corvu-drawer-trigger":""},e)),Hl=ye(),fy=e=>e?Kr(`drawer-${e}`):Hl,gy=e=>{if(!e){const n=ve(Hl);if(!n)throw new Error("[corvu]: Drawer context not found. Make sure to wrap Drawer components in <Drawer.Root>");return n}const t=mi(`drawer-${e}`);if(!t)throw new Error(`[corvu]: Drawer context with id "${e}" not found. Make sure to wrap Drawer components in <Drawer.Root contextId="${e}">`);return t},Yl=ye(),hy=e=>e?Kr(`drawer-internal-${e}`):Yl,Gl=e=>{if(!e){const n=ve(Yl);if(!n)throw new Error("[corvu]: Drawer context not found. Make sure to wrap Drawer components in <Drawer.Root>");return n}const t=mi(`drawer-internal-${e}`);if(!t)throw new Error(`[corvu]: Drawer context with id "${e}" not found. Make sure to wrap Drawer components in <Drawer.Root contextId="${e}">`);return t},ql=(e,t,n,r)=>{if(n===void 0||r===void 0)return{value:e,offset:jr(e,t)};const o=r[n-1]?jr(r[n-1],t):void 0,i=r[n]?jr(r[n],t):void 0;return{value:e,offset:jr(e,t),lowerBreakPoint:i,upperBreakPoint:o}},jr=(e,t)=>{if(typeof e=="number")return t-e*t;if(!e.endsWith("px"))throw new Error(`[corvu] Snap and break points must be a number or a string ending with 'px'. Got ${e}`);return t-parseInt(e,10)},py=(e,t,n,r)=>{const o=Zl("upper",e,r?n:t),i=Zl("lower",e,r?n:t);return o?i?i.upperBreakPoint===void 0||o.lowerBreakPoint===void 0?Math.abs(i.offset-n)<Math.abs(o.offset-n)?i:o:n<o.lowerBreakPoint?i:o:o:i},Zl=(e,t,n)=>t.reduce((r,o)=>e=="upper"&&o.offset>=n&&(!r||o.offset<r.offset)||e=="lower"&&o.offset<=n&&(!r||o.offset>r.offset)?o:r,void 0),my=(e,t)=>{let n=e,r=!1;do{if(n.hasAttribute("data-corvu-no-drag")||n.type==="range")return!1;n===(t??document.documentElement)?r=!0:n=n.parentElement}while(n&&!r);return!0},yy=void 0,vy=e=>{const t=I({initialOpen:!1,snapPoints:[0,1],breakPoints:[yy],defaultSnapPoint:1,side:"bottom",dampFunction:N=>6*Math.log(N+1),velocityFunction:(N,X)=>{const ge=N/X;return ge<1&&ge>-1?1:ge},velocityCacheReset:200,allowSkippingSnapPoints:!0,handleScrollableElements:!0,transitionResize:!1,closeOnOutsidePointer:!0,allowPinchZoom:!1},e),[n,r]=U(t,["snapPoints","breakPoints","defaultSnapPoint","activeSnapPoint","onActiveSnapPointChange","side","dampFunction","velocityFunction","velocityCacheReset","allowSkippingSnapPoints","handleScrollableElements","transitionResize","open","initialOpen","onOpenChange","closeOnOutsidePointer","contextId","children"]),[o,i]=pi({value:()=>n.open,initialValue:n.initialOpen,onChange:n.onOpenChange}),[s,a]=pi({value:()=>n.activeSnapPoint,initialValue:0,onChange:n.onActiveSnapPointChange}),[l,c]=L(),{transitioning:u,transitionSize:d}=ly({element:()=>l()?.contentRef()??null,enabled:()=>o()&&n.transitionResize,dimension:()=>{switch(n.side){case"top":case"bottom":return"height";case"left":case"right":return"width"}}}),[f,m]=L(!1),[g,p]=Wl(()=>u()?"resizing":null),y=A(()=>{const N=l()?.contentRef();if(N)return getComputedStyle(N)}),[v,b]=L(!1);V(()=>{const N=o();Q(()=>{v()!==N&&(N?(b(!0),cn(()=>{Be(()=>{p("opening"),a(n.defaultSnapPoint)}),parseFloat(y().transitionDuration)===0&&p(null)})):(Be(()=>{p("closing"),a(0)}),cn(()=>{parseFloat(y().transitionDuration)===0&&w()})))})});const w=()=>{Be(()=>{b(!1),p(null)})},[x,T]=L(0);V(()=>{const N=l()?.contentRef();if(!N)return;k(N);const X=new ResizeObserver(O);X.observe(N),Z(()=>{X.disconnect()})});const O=N=>{for(const X of N)X.target===l()?.contentRef()&&k(X.target)},k=N=>{const X=Q(()=>x());switch(n.side){case"top":case"bottom":if(X===N.offsetHeight)return;T(N.offsetHeight);break;case"left":case"right":if(X===N.offsetWidth)return;T(N.offsetWidth);break}},j=A(()=>ql(s(),x())),[P,M]=Wl(()=>j().offset),$=A(()=>x()?(x()-P())/x():0),R={get snapPoints(){return n.snapPoints},get breakPoints(){return n.breakPoints},get defaultSnapPoint(){return n.defaultSnapPoint},get activeSnapPoint(){return s()},setActiveSnapPoint:a,get side(){return n.side},get isDragging(){return f()},get isTransitioning(){return g()!==null},get transitionState(){return g()},get openPercentage(){return $()},get translate(){return P()},get velocityCacheReset(){return n.velocityCacheReset},get allowSkippingSnapPoints(){return n.allowSkippingSnapPoints},get handleScrollableElements(){return n.handleScrollableElements},get transitionResize(){return n.transitionResize}},se=Kl(()=>n.children),J=N=>{c(vn(n.contextId));const X=se()();if(Jn(X)){const ge=I(N,R);return X(ge)}return X};return A(()=>{const N=fy(n.contextId),X=hy(n.contextId);return Q(()=>h(N.Provider,{value:{snapPoints:()=>n.snapPoints,breakPoints:()=>n.breakPoints,defaultSnapPoint:()=>n.defaultSnapPoint,activeSnapPoint:s,setActiveSnapPoint:a,side:()=>n.side,isDragging:f,isTransitioning:()=>g()!==null,transitionState:g,openPercentage:$,translate:P,velocityCacheReset:()=>n.velocityCacheReset,allowSkippingSnapPoints:()=>n.allowSkippingSnapPoints,handleScrollableElements:()=>n.handleScrollableElements,transitionResize:()=>n.transitionResize},get children(){return h(X.Provider,{get value(){return{snapPoints:()=>n.snapPoints,breakPoints:()=>n.breakPoints,defaultSnapPoint:()=>n.defaultSnapPoint,activeSnapPoint:s,setActiveSnapPoint:a,side:()=>n.side,isDragging:f,isTransitioning:()=>g()!==null,transitionState:g,openPercentage:$,translate:P,velocityCacheReset:()=>n.velocityCacheReset,allowSkippingSnapPoints:()=>n.allowSkippingSnapPoints,handleScrollableElements:()=>n.handleScrollableElements,transitionResize:()=>n.transitionResize,dampFunction:n.dampFunction,velocityFunction:n.velocityFunction,setIsDragging:m,setTranslate:M,drawerSize:x,resolvedActiveSnapPoint:j,drawerStyles:y,setTransitionState:p,transitionSize:d,closeDrawer:w}},get children(){return h(ny,I({get open(){return v()},onOpenChange:i,get contextId(){return n.contextId},get closeOnOutsidePointer(){return!f()&&n.closeOnOutsidePointer}},r,{children:ge=>J(ge)}))}})}}))})},by=vy,wy=e=>{const[t,n]=U(e,["contextId","style"]);let r=!1,o=null,i=[0,0],s,a=0;const l=A(()=>Gl(t.contextId)),c=A(()=>vn(t.contextId)),u=A(()=>l().snapPoints().map((w,x)=>ql(w,l().drawerSize(),x,l().breakPoints()))),d=A(()=>{switch(l().side()){case"top":return`translate3d(0, ${-l().translate()}px, 0)`;case"bottom":return`translate3d(0, ${l().translate()}px, 0)`;case"right":return`translate3d(${l().translate()}px, 0, 0)`;case"left":return`translate3d(${-l().translate()}px, 0, 0)`}}),f=A(()=>{const w=l().transitionSize();if(w)switch(l().side()){case"top":case"bottom":return`${w}px`}}),m=A(()=>{const w=l().transitionSize();if(w)switch(l().side()){case"left":case"right":return`${w}px`}});V(()=>{c().open()&&(document.addEventListener("pointermove",p),document.addEventListener("touchmove",y),document.addEventListener("pointerup",b),document.addEventListener("touchend",b),Z(()=>{document.removeEventListener("pointermove",p),document.removeEventListener("touchmove",y),document.removeEventListener("pointerup",b),document.removeEventListener("touchend",b)}))});const g=w=>{my(w.target,c().contentRef())&&l().transitionState()!=="closing"&&(r=!0,l().handleScrollableElements()&&(i=[w.clientX,w.clientY]))},p=w=>{v(w.target,w.clientX,w.clientY)},y=w=>{w.touches[0]&&v(w.target,w.touches[0].clientX,w.touches[0].clientY)},v=(w,x,T)=>{if(!r)return;if(!l().isDragging()||o===null){const j=window.getSelection();if(j&&j.toString().length>0){b();return}if(l().handleScrollableElements()){const P=[x,T].map((re,N)=>i[N]-re),M=Math.abs(P[0])>Math.abs(P[1])?"x":"y",$=M==="x"?P[0]:P[1];if(Math.abs($)<.3)return;const R=c().contentRef(),[se,J]=Ya(w,M,R);if($>0&&Math.abs(se)>1||$<0&&Math.abs(J)>0){b();return}}switch(l().side()){case"top":case"bottom":o=T;break;case"right":case"left":o=x}s=new Date,a=l().translate(),Be(()=>{l().setIsDragging(!0),l().setTransitionState(null)})}let O;switch(l().side()){case"top":O=-(o-T);break;case"bottom":O=o-T;break;case"right":O=o-x;break;case"left":O=-(o-x);break}O-=l().resolvedActiveSnapPoint().offset,O>0&&(O=l().dampFunction(O));const k=new Date;k.getTime()-s.getTime()>l().velocityCacheReset()&&(s=k,a=l().translate()),l().setTranslate(-O)},b=()=>{if(r=!1,!l().isDragging())return;const w=new Date,x=l().velocityFunction(-(a-l().translate()),w.getTime()-s.getTime()||1),T=l().translate()*x,O=py(u(),l().translate(),T,l().allowSkippingSnapPoints());Be(()=>{l().setTransitionState("snapping"),l().setIsDragging(!1)}),Be(()=>{l().setActiveSnapPoint(O.value),O.offset===l().drawerSize()?c().setOpen(!1):(l().setTranslate(O.offset),parseFloat(l().drawerStyles().transitionDuration)===0&&l().setTransitionState(null))})};return h(qm,I({get contextId(){return t.contextId},get style(){return{transform:d(),"transition-duration":l().isDragging()?"0ms":void 0,height:f(),width:m(),...t.style}},onPointerDown:g,onTransitionEnd:()=>{Be(()=>{l().transitionState()==="closing"&&l().closeDrawer(),l().transitionState()!=="resizing"&&l().setTransitionState(null)})},get"data-transitioning"(){return me(l().isTransitioning())},get"data-opening"(){return me(l().transitionState()==="opening")},get"data-closing"(){return me(l().transitionState()==="closing")},get"data-snapping"(){return me(l().transitionState()==="snapping")},get"data-resizing"(){return me(l().transitionState()==="resizing")},"data-corvu-dialog-content":void 0,"data-corvu-drawer-content":""},n))},xy=wy,Sy=e=>{const[t,n]=U(e,["contextId"]),r=A(()=>Gl(t.contextId));return h(Jm,I({get contextId(){return t.contextId},get"data-transitioning"(){return me(r().isTransitioning())},get"data-opening"(){return me(r().transitionState()==="opening")},get"data-closing"(){return me(r().transitionState()==="closing")},get"data-snapping"(){return me(r().transitionState()==="snapping")},get"data-resizing"(){return me(r().transitionState()==="resizing")},"data-corvu-dialog-overlay":void 0,"data-corvu-drawer-overlay":""},n))},Ey=Sy,Py=B('<div class="mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted">');const Cy=by,Oy=dy,Dy=ey,ky=e=>{const[,t]=U(e,["class"]),n=gy();return h(Ey,I({get class(){return le("absolute inset-0 z-50 data-[transitioning]:transition-colors data-[transitioning]:duration-300",e.class)},get style(){return{"background-color":`rgb(0 0 0 / ${.6*n.openPercentage()})`}}},t))},Ty=e=>{const[,t]=U(e,["class","children"]);return h(Dy,{get mount(){return Bn()},get children(){return[h(ky,{}),h(xy,I({get class(){return le("absolute inset-x-0 bottom-0 z-50 mt-24 flex h-auto max-h-[80%] flex-col rounded-t-[10px] border bg-background after:top-full after:h-[50%] after:bg-inherit md:select-none transition-transform duration-300",e.class)}},t,{get children(){return[Py(),A(()=>e.children)]}}))]}})};var $y=B('<span class="font-semibold mt-2">'),Ay=B('<div class="flex py-4 pl-3 pr-1 flex-col w-full space-y-4 overflow-y-auto">'),My=B('<div class="flex flex-col space-y-2"><div>'),Iy=B('<div class="flex flex-col w-full space-y-1"><span class="font-semibold text-slate-700">'),Ly=B('<div class="flex flex-col items-start"><span class=text-slate-500>');const Ry=({options:e,text:t,title:n})=>{const{pushMessage:r}=Tt(),[o,i]=L(!1),[s,a]=L(!1),[l,c]=L(),u=(d,f)=>{a(!1),i(!0),r(d,f)};return(()=>{var d=My(),f=d.firstChild;return F(d,h(zt,{get children(){return t?.trim()}}),f),F(f,h(Cy,{get open(){return s()},onOpenChange:a,get children(){return[h(Oy,{as:Ce,variant:"outline",class:"w-full text-nowrap",get children(){return n?.trim()??"Select an option"}}),h(Ty,{class:"pb-2 px-2 flex flex-col items-center justify-center",get children(){return[(()=>{var m=$y();return F(m,()=>n?.trim()??"Select an option"),m})(),(()=>{var m=Ay();return F(m,h(Zt,{each:e,children:g=>(()=>{var p=Iy(),y=p.firstChild;return F(y,()=>g.label?.trim()??""),F(p,h(Zt,{get each(){return g.items},children:v=>h(Ce,{variant:"outline",get disabled(){return o()},get class(){return`py-6 flex justify-between hover:bg-slate-200 ${l()===v?"bg-slate-200":""}`},onClick:()=>c(v),get children(){return[(()=>{var b=Ly(),w=b.firstChild;return F(b,()=>v.label?.trim(),w),F(w,()=>v.description?.trim()),b})(),h(ie,{get when(){return l()===v},get fallback(){return h($p,{class:"size-4 text-slate-500"})},get children(){return h(Tp,{class:"size-4 text-slate-500"})}})]}})}),null),p})()})),m})(),h(Ce,{get disabled(){return o()||!l()},onClick:()=>u(l().label,l().value),class:"w-11/12 mt-4 hover:bg-primary shadow-sm hover:shadow-primary transition-shadow",children:"Send"})]}})]}})),ue(()=>xt(f,o()?"opacity-50":"")),d})()};var Ny=B("<audio controls preload=auto class=h-8><source type=audio/mpeg><source type=audio/ogg>Your browser does not support the audio element.");const Fy=e=>(()=>{var t=Ny(),n=t.firstChild,r=n.nextSibling;return ue(o=>{var i=e.link,s=e.link;return i!==o.e&&we(n,"src",o.e=i),s!==o.t&&we(r,"src",o.t=s),o},{e:void 0,t:void 0}),t})();var _y=B('<div class="flex flex-col space-y-2"><a class="self-center hover:brightness-75 transition-all duration-300 flex flex-col items-center justify-between bg-slate-200 rounded-md px-1 py-1 space-y-2 text-slate-700"target=_blank><span class="font-semibold text-sm">');const Vy=e=>(()=>{var t=_y(),n=t.firstChild,r=n.firstChild;return F(n,h(Ap,{class:"size-10"}),r),F(r,()=>e.filename?.trim()),F(t,h(zt,{get children(){return e.text?.trim()}}),null),ue(()=>we(n,"href",e.link)),t})();var Ky=B('<div class="flex flex-col space-y-2"><a class="object-contain hover:brightness-50 transition-all duration-300"target=_blank><img class="w-full h-auto rounded-md">');const zy=e=>(()=>{var t=Ky(),n=t.firstChild,r=n.firstChild;return F(t,h(zt,{get children(){return e.text?.trim()}}),null),ue(o=>{var i=e.link,s=e.link,a=e.text?.trim();return i!==o.e&&we(n,"href",o.e=i),s!==o.t&&we(r,"src",o.t=s),a!==o.a&&we(r,"alt",o.a=a),o},{e:void 0,t:void 0,a:void 0}),t})();var By=B('<div class="flex flex-col space-y-2"><video controls preload=auto class="size-full rounded-md"><source type=video/mp4><source type=video/ogg>Your browser does not support the video element.');const jy=e=>(()=>{var t=By(),n=t.firstChild,r=n.firstChild,o=r.nextSibling;return F(t,h(zt,{get children(){return e.text?.trim()}}),null),ue(i=>{var s=e.link,a=e.link;return s!==i.e&&we(r,"src",i.e=s),a!==i.t&&we(o,"src",i.t=a),i},{e:void 0,t:void 0}),t})();var Uy=B("<div>Media type not supported");const Xl=e=>e.type==="image"?h(zy,e):e.type==="audio"?h(Fy,e):e.type==="document"?h(Vy,e):e.type==="video"?h(jy,e):Uy(),Jl=({text:e})=>h(zt,{get children(){return e?.trim()}});function Wy(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function $t(e={}){const{strict:t=!0,hookName:n="useContext",providerName:r="Provider",errorMessage:o,defaultValue:i}=e,s=ye(i);function a(){const l=ve(s);if(!l&&t){const c=new Error(o??Wy(n,r));throw c.name="ContextError",Error.captureStackTrace?.(c,a),c}return l}return[s.Provider,a,s]}const Hy=Symbol(),Ql=Object.getPrototypeOf,Ei=new WeakMap,Yy=e=>e&&(Ei.has(e)?Ei.get(e):Ql(e)===Object.prototype||Ql(e)===Array.prototype),Gy=e=>Yy(e)&&e[Hy]||null,ec=(e,t=!0)=>{Ei.set(e,t)};function qy(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global}function tc(e,t){const n=qy();return n?(n[e]||(n[e]=t()),n[e]):t()}var Ur=()=>process.env.NODE_ENV!=="production",Pi=e=>typeof e=="object"&&e!==null,Bt=tc("__zag__proxyStateMap",()=>new WeakMap),Qn=tc("__zag__refSet",()=>new WeakSet),Zy=(e=Object.is,t=(c,u)=>new Proxy(c,u),n=c=>Pi(c)&&!Qn.has(c)&&(Array.isArray(c)||!(Symbol.iterator in c))&&!(c instanceof WeakMap)&&!(c instanceof WeakSet)&&!(c instanceof Error)&&!(c instanceof Number)&&!(c instanceof Date)&&!(c instanceof String)&&!(c instanceof RegExp)&&!(c instanceof ArrayBuffer),r=c=>{switch(c.status){case"fulfilled":return c.value;case"rejected":throw c.reason;default:throw c}},o=new WeakMap,i=(c,u,d=r)=>{const f=o.get(c);if(f?.[0]===u)return f[1];const m=Array.isArray(c)?[]:Object.create(Object.getPrototypeOf(c));return ec(m,!0),o.set(c,[u,m]),Reflect.ownKeys(c).forEach(g=>{const p=Reflect.get(c,g);Qn.has(p)?(ec(p,!1),m[g]=p):p instanceof Promise?Object.defineProperty(m,g,{get(){return d(p)}}):Bt.has(p)?m[g]=bn(p,d):m[g]=p}),Object.freeze(m)},s=new WeakMap,a=[1,1],l=c=>{if(!Pi(c))throw new Error("object required");const u=s.get(c);if(u)return u;let d=a[0];const f=new Set,m=(P,M=++a[0])=>{d!==M&&(d=M,f.forEach($=>$(P,M)))};let g=a[1];const p=(P=++a[1])=>(g!==P&&!f.size&&(g=P,v.forEach(([M])=>{const $=M[1](P);$>d&&(d=$)})),d),y=P=>(M,$)=>{const R=[...M];R[1]=[P,...R[1]],m(R,$)},v=new Map,b=(P,M)=>{if(Ur()&&v.has(P))throw new Error("prop listener already exists");if(f.size){const $=M[3](y(P));v.set(P,[M,$])}else v.set(P,[M])},w=P=>{const M=v.get(P);M&&(v.delete(P),M[1]?.())},x=P=>(f.add(P),f.size===1&&v.forEach(([$,R],se)=>{if(Ur()&&R)throw new Error("remove already exists");const J=$[3](y(se));v.set(se,[$,J])}),()=>{f.delete(P),f.size===0&&v.forEach(([$,R],se)=>{R&&(R(),v.set(se,[$]))})}),T=Array.isArray(c)?[]:Object.create(Object.getPrototypeOf(c)),k=t(T,{deleteProperty(P,M){const $=Reflect.get(P,M);w(M);const R=Reflect.deleteProperty(P,M);return R&&m(["delete",[M],$]),R},set(P,M,$,R){const se=Reflect.has(P,M),J=Reflect.get(P,M,R);if(se&&(e(J,$)||s.has($)&&e(J,s.get($))))return!0;w(M),Pi($)&&($=Gy($)||$);let re=$;if(!Object.getOwnPropertyDescriptor(P,M)?.set)if($ instanceof Promise)$.then(N=>{Object.assign($,{status:"fulfilled",value:N}),m(["resolve",[M],N])}).catch(N=>{Object.assign($,{status:"rejected",reason:N}),m(["reject",[M],N])});else{!Bt.has($)&&n($)&&(re=Ci($));const N=!Qn.has(re)&&Bt.get(re);N&&b(M,N)}return Reflect.set(P,M,re,R),m(["set",[M],$,J]),!0}});s.set(c,k);const j=[T,p,i,x];return Bt.set(k,j),Reflect.ownKeys(c).forEach(P=>{const M=Object.getOwnPropertyDescriptor(c,P);M.get||M.set?Object.defineProperty(T,P,M):k[P]=c[P]}),k})=>[l,Bt,Qn,e,t,n,r,o,i,s,a],[Xy]=Zy();function Ci(e={}){return Xy(e)}function nc(e,t,n){const r=Bt.get(e);Ur()&&!r&&console.warn("Please use proxy object");let o;const i=[],s=r[3];let a=!1;const c=s(u=>{if(i.push(u),n){t(i.splice(0));return}o||(o=Promise.resolve().then(()=>{o=void 0,a&&t(i.splice(0))}))});return a=!0,()=>{a=!1,c()}}function bn(e,t){const n=Bt.get(e);Ur()&&!n&&console.warn("Please use proxy object");const[r,o,i]=n;return i(r,o(),t)}function Wr(e){return Qn.add(e),e}function Jy(e,t){Object.keys(t).forEach(o=>{if(Object.getOwnPropertyDescriptor(e,o))throw new Error("object property already defined");const i=t[o],{get:s,set:a}=typeof i=="function"?{get:i}:i,l={};l.get=()=>s(bn(r)),a&&(l.set=c=>a(r,c)),Object.defineProperty(e,o,l)});const r=Ci(e);return r}function rc(e,t,n){typeof n.value=="object"&&(n.value=wn(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||t==="__proto__"?Object.defineProperty(e,t,n):e[t]=n.value}function wn(e){if(typeof e!="object")return e;var t=0,n,r,o,i=Object.prototype.toString.call(e);if(i==="[object Object]"?o=Object.create(e.__proto__||null):i==="[object Array]"?o=Array(e.length):i==="[object Set]"?(o=new Set,e.forEach(function(s){o.add(wn(s))})):i==="[object Map]"?(o=new Map,e.forEach(function(s,a){o.set(wn(a),wn(s))})):i==="[object Date]"?o=new Date(+e):i==="[object RegExp]"?o=new RegExp(e.source,e.flags):i==="[object DataView]"?o=new e.constructor(wn(e.buffer)):i==="[object ArrayBuffer]"?o=e.slice(0):i.slice(-6)==="Array]"&&(o=new e.constructor(e)),o){for(r=Object.getOwnPropertySymbols(e);t<r.length;t++)rc(o,r[t],Object.getOwnPropertyDescriptor(e,r[t]));for(t=0,r=Object.getOwnPropertyNames(e);t<r.length;t++)Object.hasOwnProperty.call(o,n=r[t])&&o[n]===e[n]||rc(o,n,Object.getOwnPropertyDescriptor(e,n))}return o||e}var Qy=Object.defineProperty,ev=(e,t,n)=>t in e?Qy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_=(e,t,n)=>ev(e,typeof t!="symbol"?t+"":t,n);function tv(e){for(;e.length>0;)e.pop();return e}var oc=(e,...t)=>(typeof e=="function"?e(...t):e)??void 0,dt=e=>e,nv=()=>{},rv=(...e)=>(...t)=>{e.forEach(function(n){n?.(...t)})},ic=(()=>{let e=0;return()=>(e++,e.toString(36))})(),ov=()=>process.env.NODE_ENV!=="production",Hr=e=>Array.isArray(e),er=e=>!(e==null||typeof e!="object"||Hr(e)),iv=e=>typeof e=="number"&&!Number.isNaN(e),Ae=e=>typeof e=="string",Yr=e=>typeof e=="function",sv=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);function Gr(e){if(!av(e)||e===void 0)return e;const t=Reflect.ownKeys(e).filter(r=>typeof r=="string"),n={};for(const r of t){const o=e[r];o!==void 0&&(n[r]=Gr(o))}return n}var av=e=>e&&typeof e=="object"&&e.constructor===Object;function Oi(...e){const t=e.length===1?e[0]:e[1];(e.length===2?e[0]:!0)&&process.env.NODE_ENV!=="production"&&console.warn(t)}function qr(...e){const t=e.length===1?e[0]:e[1];if((e.length===2?e[0]:!0)&&process.env.NODE_ENV!=="production")throw new Error(t)}function sc(e,...t){for(const n of t){const r=Gr(n);for(const o in r)er(n[o])?(e[o]||(e[o]={}),sc(e[o],n[o])):e[o]=n[o]}return e}function ac(e){return wn(e)}function Ue(e){return Ae(e)?{type:e}:e}function At(e){return e?Hr(e)?e.slice():[e]:[]}function lc(e){return er(e)&&e.predicate!=null}var lv=()=>!0;function Di(e,t,n,r){return o=>Ae(o)?!!e[o]?.(t,n,r):Yr(o)?o(t,n,r):o.predicate(e)(t,n,r)}function cv(...e){return{predicate:t=>(n,r,o)=>e.map(Di(t,n,r,o)).some(Boolean)}}function uv(...e){return{predicate:t=>(n,r,o)=>e.map(Di(t,n,r,o)).every(Boolean)}}function dv(e){return{predicate:t=>(n,r,o)=>!Di(t,n,r,o)(e)}}function fv(...e){return(t,n,r)=>r.state.matches(...e)}var gv={or:cv,and:uv,not:dv,stateIn:fv};function cc(e,t){return e=e??lv,(n,r,o)=>{if(Ae(e)){const i=t[e];return Yr(i)?i(n,r,o):i}return lc(e)?e.predicate(t)(n,r,o):e?.(n,r,o)}}function ki(e,t){return(n,r,o)=>lc(e)?e.predicate(t)(n,r,o):e}function hv(e){const t=e.computed??dt({}),n=e.context??dt({}),r=e.initial?e.states?.[e.initial]?.tags:[],o=Ci({value:e.initial??"",previousValue:"",event:dt({}),previousEvent:dt({}),context:Jy(n,t),done:!1,tags:r??[],hasTag(i){return this.tags.includes(i)},matches(...i){return i.includes(this.value)},can(i){return dt(this).nextEvents.includes(i)},get nextEvents(){const i=e.states?.[this.value]?.on??{},s=e?.on??{};return Object.keys({...i,...s})},get changed(){return this.event.value==="machine.init"||!this.previousValue?!1:this.value!==this.previousValue}});return dt(o)}function tr(e,t){return(n,r)=>{if(iv(e))return e;if(Yr(e))return e(n,r);if(Ae(e)){const o=Number.parseFloat(e);if(!Number.isNaN(o))return o;if(t){const i=t?.[e];return qr(i==null,`[@zag-js/core > determine-delay] Cannot determine delay for \`${e}\`. It doesn't exist in \`options.delays\``),Yr(i)?i(n,r):i}}}}function pv(e){return Ae(e)?{target:e}:e}function mv(e,t){return(n,r,o)=>At(e).map(pv).find(i=>cc(i.guard,t)(n,r,o)??i.target??i.actions)}var yv=class{constructor(e,t){_(this,"status","Not Started"),_(this,"state"),_(this,"initialState"),_(this,"initialContext"),_(this,"id"),_(this,"type","machine"),_(this,"activityEvents",new Map),_(this,"delayedEvents",new Map),_(this,"stateListeners",new Set),_(this,"doneListeners",new Set),_(this,"contextWatchers",new Set),_(this,"removeStateListener",nv),_(this,"parent"),_(this,"children",new Map),_(this,"guardMap"),_(this,"actionMap"),_(this,"delayMap"),_(this,"activityMap"),_(this,"sync"),_(this,"options"),_(this,"config"),_(this,"_created",()=>{const n=Ue("machine.created");this.executeActions(this.config?.created,n)}),_(this,"start",n=>{if(this.state.value="",this.state.tags=[],this.status==="Running")return this;this.status="Running",this.removeStateListener=nc(this.state,()=>{this.stateListeners.forEach(l=>{l(this.stateSnapshot)})},this.sync),this.setupContextWatchers(),this.executeActivities(Ue("machine.start"),At(this.config.activities),"machine.start"),this.executeActions(this.config.entry,Ue("machine.start"));const r=Ue("machine.init"),o=er(n)?n.value:n,i=er(n)?n.context:void 0;i&&this.setContext(i);const s={target:o??this.config.initial},a=this.getNextStateInfo(s,r);return this.initialState=a,this.performStateChangeEffects(this.state.value,a,r),this}),_(this,"setupContextWatchers",()=>{const{watch:n}=this.config;if(!n)return;let r=bn(this.state.context);const o=nc(this.state.context,()=>{const i=bn(this.state.context);for(const[s,a]of Object.entries(n))(this.options.compareFns?.[s]??Object.is)(r[s],i[s])||this.executeActions(a,this.state.event);r=i});this.contextWatchers.add(o)}),_(this,"stop",()=>{if(this.status!=="Stopped")return this.performExitEffects(this.state.value,Ue("machine.stop")),this.executeActions(this.config.exit,Ue("machine.stop")),this.setState(""),this.setEvent("machine.stop"),this.stopStateListeners(),this.stopChildren(),this.stopActivities(),this.stopDelayedEvents(),this.stopContextWatchers(),this.status="Stopped",this}),_(this,"stopStateListeners",()=>{this.removeStateListener(),this.stateListeners.clear()}),_(this,"stopContextWatchers",()=>{this.contextWatchers.forEach(n=>n()),this.contextWatchers.clear()}),_(this,"stopDelayedEvents",()=>{this.delayedEvents.forEach(n=>{n.forEach(r=>r())}),this.delayedEvents.clear()}),_(this,"stopActivities",n=>{n?(this.activityEvents.get(n)?.forEach(r=>r()),this.activityEvents.get(n)?.clear(),this.activityEvents.delete(n)):(this.activityEvents.forEach(r=>{r.forEach(o=>o()),r.clear()}),this.activityEvents.clear())}),_(this,"sendChild",(n,r)=>{const o=Ue(n),i=oc(r,this.contextSnapshot),s=this.children.get(i);s||qr(`[@zag-js/core] Cannot send '${o.type}' event to unknown child`),s.send(o)}),_(this,"stopChild",n=>{this.children.has(n)||qr(`[@zag-js/core > stop-child] Cannot stop unknown child ${n}`),this.children.get(n).stop(),this.children.delete(n)}),_(this,"removeChild",n=>{this.children.delete(n)}),_(this,"stopChildren",()=>{this.children.forEach(n=>n.stop()),this.children.clear()}),_(this,"setParent",n=>{this.parent=n}),_(this,"spawn",(n,r)=>{const o=oc(n);return r&&(o.id=r),o.type="machine.actor",o.setParent(this),this.children.set(o.id,dt(o)),o.onDone(()=>{this.removeChild(o.id)}).start(),dt(Wr(o))}),_(this,"stopActivity",n=>{if(!this.state.value)return;const r=this.activityEvents.get(this.state.value);r?.get(n)?.(),r?.delete(n)}),_(this,"addActivityCleanup",(n,r,o)=>{n&&(this.activityEvents.has(n)?this.activityEvents.get(n)?.set(r,o):this.activityEvents.set(n,new Map([[r,o]])))}),_(this,"setState",n=>{this.state.previousValue=this.state.value,this.state.value=n;const r=this.getStateNode(n);n==null?tv(this.state.tags):this.state.tags=At(r?.tags)}),_(this,"setContext",n=>{n&&sc(this.state.context,Gr(n))}),_(this,"setOptions",n=>{const r=Gr(n);this.actionMap={...this.actionMap,...r.actions},this.delayMap={...this.delayMap,...r.delays},this.activityMap={...this.activityMap,...r.activities},this.guardMap={...this.guardMap,...r.guards}}),_(this,"getStateNode",n=>{if(n)return this.config.states?.[n]}),_(this,"getNextStateInfo",(n,r)=>{const o=this.determineTransition(n,r),i=!o?.target,s=o?.target??this.state.value,a=this.state.value!==s,l=this.getStateNode(s),u={reenter:!i&&!a&&!o?.internal,transition:o,stateNode:l,target:s,changed:a};return this.log("NextState:",`[${r.type}]`,this.state.value,"---->",u.target),u}),_(this,"getAfterActions",(n,r)=>{let o;return{entry:()=>{o=globalThis.setTimeout(()=>{const i=this.getNextStateInfo(n,this.state.event);this.performStateChangeEffects(this.state.value,i,this.state.event)},r)},exit:()=>{globalThis.clearTimeout(o)}}}),_(this,"getDelayedEventActions",n=>{const r=this.getStateNode(n),o=this.state.event;if(!r||!r.after)return;const i=[],s=[];if(Hr(r.after)){const a=this.determineTransition(r.after,o);if(!a)return;if(!sv(a,"delay"))throw new Error(`[@zag-js/core > after] Delay is required for after transition: ${JSON.stringify(a)}`);const c=tr(a.delay,this.delayMap)(this.contextSnapshot,o),u=this.getAfterActions(a,c);return i.push(u.entry),s.push(u.exit),{entries:i,exits:s}}if(er(r.after))for(const a in r.after){const l=r.after[a],u=tr(a,this.delayMap)(this.contextSnapshot,o),d=this.getAfterActions(l,u);i.push(d.entry),s.push(d.exit)}return{entries:i,exits:s}}),_(this,"executeActions",(n,r)=>{const o=ki(n,this.guardMap)(this.contextSnapshot,r,this.guardMeta);for(const i of At(o)){const s=Ae(i)?this.actionMap?.[i]:i;Oi(Ae(i)&&!s,`[@zag-js/core > execute-actions] No implementation found for action: \`${i}\``),s?.(this.state.context,r,this.meta)}}),_(this,"executeActivities",(n,r,o)=>{for(const i of r){const s=Ae(i)?this.activityMap?.[i]:i;if(!s){Oi(`[@zag-js/core > execute-activity] No implementation found for activity: \`${i}\``);continue}const a=s(this.state.context,n,this.meta);if(a){const l=Ae(i)?i:i.name||ic();this.addActivityCleanup(o??this.state.value,l,a)}}}),_(this,"createEveryActivities",(n,r)=>{if(n)if(Hr(n)){const o=At(n).find(l=>{const c=l.delay,d=tr(c,this.delayMap)(this.contextSnapshot,this.state.event);return cc(l.guard,this.guardMap)(this.contextSnapshot,this.state.event,this.guardMeta)??d!=null});if(!o)return;const s=tr(o.delay,this.delayMap)(this.contextSnapshot,this.state.event);r(()=>{const l=globalThis.setInterval(()=>{this.executeActions(o.actions,this.state.event)},s);return()=>{globalThis.clearInterval(l)}})}else for(const o in n){const i=n?.[o],a=tr(o,this.delayMap)(this.contextSnapshot,this.state.event);r(()=>{const c=globalThis.setInterval(()=>{this.executeActions(i,this.state.event)},a);return()=>{globalThis.clearInterval(c)}})}}),_(this,"setEvent",n=>{this.state.previousEvent=this.state.event,this.state.event=Wr(Ue(n))}),_(this,"performExitEffects",(n,r)=>{const o=this.state.value;if(o==="")return;const i=n?this.getStateNode(n):void 0;this.stopActivities(o);const s=ki(i?.exit,this.guardMap)(this.contextSnapshot,r,this.guardMeta),a=At(s),l=this.delayedEvents.get(o);l&&a.push(...l),this.executeActions(a,r)}),_(this,"performEntryEffects",(n,r)=>{const o=this.getStateNode(n),i=At(o?.activities);this.createEveryActivities(o?.every,c=>{i.unshift(c)}),i.length>0&&this.executeActivities(r,i);const s=ki(o?.entry,this.guardMap)(this.contextSnapshot,r,this.guardMeta),a=At(s),l=this.getDelayedEventActions(n);o?.after&&l&&(this.delayedEvents.set(n,l?.exits),a.push(...l.entries)),this.executeActions(a,r),o?.type==="final"&&(this.state.done=!0,this.doneListeners.forEach(c=>{c(this.stateSnapshot)}),this.stop())}),_(this,"performTransitionEffects",(n,r)=>{const o=this.determineTransition(n,r);this.executeActions(o?.actions,r)}),_(this,"performStateChangeEffects",(n,r,o)=>{this.setEvent(o);const i=r.changed||r.reenter;i&&this.performExitEffects(n,o),this.performTransitionEffects(r.transition,o),this.setState(r.target),i&&this.performEntryEffects(r.target,o)}),_(this,"determineTransition",(n,r)=>mv(n,this.guardMap)?.(this.contextSnapshot,r,this.guardMeta)),_(this,"sendParent",n=>{this.parent||qr("[@zag-js/core > send-parent] Cannot send event to an unknown parent");const r=Ue(n);this.parent?.send(r)}),_(this,"log",(...n)=>{ov()&&this.options.debug&&console.log(...n)}),_(this,"send",n=>{const r=Ue(n);this.transition(this.state.value,r)}),_(this,"transition",(n,r)=>{const o=Ae(n)?this.getStateNode(n):n?.stateNode,i=Ue(r);if(!o&&!this.config.on){const l=this.status==="Stopped"?"[@zag-js/core > transition] Cannot transition a stopped machine":`[@zag-js/core > transition] State does not have a definition for \`state\`: ${n}, \`event\`: ${i.type}`;Oi(l);return}const s=o?.on?.[i.type]??this.config.on?.[i.type],a=this.getNextStateInfo(s,i);return this.performStateChangeEffects(this.state.value,a,i),a.stateNode}),_(this,"subscribe",n=>(this.stateListeners.add(n),this.status==="Running"&&n(this.stateSnapshot),()=>{this.stateListeners.delete(n)})),_(this,"onDone",n=>(this.doneListeners.add(n),this)),_(this,"onTransition",n=>(this.stateListeners.add(n),this.status==="Running"&&n(this.stateSnapshot),this)),this.config=ac(e),this.options=ac(t??{}),this.id=this.config.id??`machine-${ic()}`,this.guardMap=this.options?.guards??{},this.actionMap=this.options?.actions??{},this.delayMap=this.options?.delays??{},this.activityMap=this.options?.activities??{},this.sync=this.options?.sync??!1,this.state=hv(this.config),this.initialContext=bn(this.state.context)}get stateSnapshot(){return dt(bn(this.state))}getState(){return this.stateSnapshot}get contextSnapshot(){return this.stateSnapshot.context}get self(){const e=this;return{id:this.id,send:this.send.bind(this),sendParent:this.sendParent.bind(this),sendChild:this.sendChild.bind(this),stop:this.stop.bind(this),stopChild:this.stopChild.bind(this),spawn:this.spawn.bind(this),stopActivity:this.stopActivity.bind(this),get state(){return e.stateSnapshot},get initialContext(){return e.initialContext},get initialState(){return e.initialState?.target??""}}}get meta(){return{state:this.stateSnapshot,guards:this.guardMap,send:this.send.bind(this),self:this.self,initialContext:this.initialContext,initialState:this.initialState?.target??"",getState:()=>this.stateSnapshot,getAction:e=>this.actionMap[e],getGuard:e=>this.guardMap[e]}}get guardMeta(){return{state:this.stateSnapshot}}get[Symbol.toStringTag](){return"Machine"}getHydrationState(){const e=this.getState();return{value:e.value,tags:e.tags}}},uc=(e,t)=>new yv(e,t),vv=(...e)=>e.map(t=>t?.trim?.()).filter(Boolean).join(" "),bv=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,dc=e=>{const t={};let n;for(;n=bv.exec(e);)t[n[1]]=n[2];return t},wv=(e,t)=>{if(Ae(e)){if(Ae(t))return`${e};${t}`;e=dc(e)}else Ae(t)&&(t=dc(t));return Object.assign({},e??{},t??{})};function xv(...e){let t={};for(let n of e){for(let r in t){if(r.startsWith("on")&&typeof t[r]=="function"&&typeof n[r]=="function"){t[r]=rv(n[r],t[r]);continue}if(r==="className"||r==="class"){t[r]=vv(t[r],n[r]);continue}if(r==="style"){t[r]=wv(t[r],n[r]);continue}t[r]=n[r]!==void 0?n[r]:t[r]}for(let r in n)t[r]===void 0&&(t[r]=n[r])}return t}function Sv(e){return new Proxy({},{get(){return e}})}var jt=()=>e=>Array.from(new Set(e));function ce(...e){const t={};for(let n=0;n<e.length;n++){let r=e[n];if(typeof r=="function"&&(r=r()),r){const o=Object.getOwnPropertyDescriptors(r);for(const i in o)i in t||Object.defineProperty(t,i,{enumerable:!0,get(){let s={};if(i==="style"||i==="class"||i==="className"||i.startsWith("on")){for(let a=0;a<e.length;a++){let l=e[a];typeof l=="function"&&(l=l()),s=xv(s,{[i]:(l||{})[i]})}return s[i]}for(let a=e.length-1;a>=0;a--){let l,c=e[a];if(typeof c=="function"&&(c=c()),l=(c||{})[i],l!==void 0)return l}}})}}return t}var Ev=e=>Array.isArray(e),Pv=e=>!(e==null||typeof e!="object"||Ev(e)),Cv=e=>typeof e=="number"&&!Number.isNaN(e),fc=e=>typeof e=="string",gc={onFocus:"onFocusIn",onBlur:"onFocusOut",onDoubleClick:"onDblClick",onChange:"onInput",defaultChecked:"checked",defaultValue:"value",htmlFor:"for",className:"class"},Ov=e=>e.startsWith("--")?e:Iv(e);function Dv(e){return e in gc?gc[e]:e}var kv=Sv(e=>{const t={};for(const n in e){const r=e[n];if(!(n==="readOnly"&&r===!1)){if(n==="style"&&Pv(r)){t.style=Tv(r);continue}if(n==="children"){fc(r)&&(t.textContent=r);continue}t[Dv(n)]=r}}return t});function Tv(e){let t={};for(const n in e){const r=e[n];!fc(r)&&!Cv(r)||(t[Ov(n)]=r)}return t}var $v=/[A-Z]/g,Av=/^ms-/;function Mv(e){return"-"+e.toLowerCase()}var Ti={};function Iv(e){if(Ti.hasOwnProperty(e))return Ti[e];var t=e.replace($v,Mv);return Ti[e]=Av.test(t)?"-"+t:t}function Lv(e,t){const{actions:n,context:r}=t??{},[o,i]=Zs(e.getState());return Ft(()=>{const s=e.subscribe(a=>{i(Ad(a))});Z(()=>{s()})}),V(()=>{const s=typeof r=="function"?r():r;e.setContext(s)}),V(()=>{e.setOptions({actions:n})}),o}function Rv(e,t){const{state:n,context:r}=t??{},o=(()=>{const i=typeof e=="function"?e():e,s=typeof r=="function"?r():r;return s&&i.setContext(s),i._created(),i})();return Ft(()=>{o.start(n),Z(()=>{o.stop()})}),o}function hc(e,t){const n=Rv(e,t);return[Lv(n,t),n.send,n]}const xn=()=>(e,t)=>U(e,t);$t({hookName:"useRenderStrategyContext",providerName:"<RenderStrategyProvider />"});const Nv=e=>xn()(e,["lazyMount","unmountOnExit"]),$i=e=>n=>{const[r,o]=U(n,["asChild"]);if(r.asChild){const i=s=>{const[,a]=U(o,["ref"]);return ce(a,s)};return r.asChild(i)}return h(Fn,I({component:e},o))};function Fv(){const e=new Map;return new Proxy($i,{apply(t,n,r){return $i(r[0])},get(t,n){const r=n;return e.has(r)||e.set(r,$i(r)),e.get(r)}})}const de=Fv();var Zr=(e,t=[])=>({parts:(...n)=>{if(_v(t))return Zr(e,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>Zr(e,[...t,...n]),rename:n=>Zr(n,t),keys:()=>t,build:()=>[...new Set(t)].reduce((n,r)=>Object.assign(n,{[r]:{selector:[`&[data-scope="${Sn(e)}"][data-part="${Sn(r)}"]`,`& [data-scope="${Sn(e)}"][data-part="${Sn(r)}"]`].join(", "),attrs:{"data-scope":Sn(e),"data-part":Sn(r)}}}),{})}),Sn=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),_v=e=>e.length===0,te=e=>e?"":void 0,Se=e=>e?"true":void 0,Vv=1,Kv=9,zv=11,Xr=e=>typeof e=="object"&&e!==null,ft=e=>Xr(e)&&e.nodeType===Vv&&typeof e.nodeName=="string",pc=e=>Xr(e)&&e.nodeType===Kv,Bv=e=>Xr(e)&&e===e.window,jv=e=>Xr(e)&&e.nodeType!==void 0,Uv=e=>jv(e)&&e.nodeType===zv&&"host"in e;function Jr(e,t){return!e||!t||!ft(e)||!ft(t)?!1:e===t||e.contains(t)}function Qr(e){return pc(e)?e:Bv(e)?e.document:e?.ownerDocument??document}function Ai(e){return Uv(e)?Ai(e.host):pc(e)?e.defaultView??window:ft(e)?e.ownerDocument?.defaultView??window:window}var Wv=()=>typeof document<"u";function Hv(){return navigator.userAgentData?.platform??navigator.platform}var mc=e=>Wv()&&e.test(Hv()),Yv=()=>mc(/^Mac/),yc=()=>mc(/iP(hone|ad|od)|iOS/);function Gv(e){return e.composedPath?.()??e.nativeEvent?.composedPath?.()}function nr(e){return Gv(e)?.[0]??e.target}function qv(e){return e.nativeEvent?.isComposing??e.isComposing}var Zv=e=>typeof e=="object"&&e!==null&&e.nodeType===1;function Xv(e){return Zv(e)?e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0:!1}var Jv="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false']), details > summary:first-of-type";function vc(e){return!e||e.closest("[inert]")?!1:e.matches(Jv)&&Xv(e)}function Qv(e){const t=new Set;function n(r){const o=globalThis.requestAnimationFrame(r);t.add(()=>globalThis.cancelAnimationFrame(o))}return n(()=>n(e)),function(){t.forEach(o=>o())}}function Ve(e){const t=globalThis.requestAnimationFrame(e);return()=>{globalThis.cancelAnimationFrame(t)}}function eb(e,t){return Array.from(e?.querySelectorAll(t)??[])}function tb(e,t){return e?.querySelector(t)??null}function nb(e){const t={getRootNode:n=>n.getRootNode?.()??document,getDoc:n=>Qr(t.getRootNode(n)),getWin:n=>t.getDoc(n).defaultView??window,getActiveElement:n=>t.getRootNode(n).activeElement,isActiveElement:(n,r)=>r===t.getActiveElement(n),getById:(n,r)=>t.getRootNode(n).getElementById(r),setValue:(n,r)=>{if(n==null||r==null)return;const o=r.toString();n.value!==o&&(n.value=r.toString())}};return{...t,...e}}var Mi=new WeakMap;function rb(e,t,n){Mi.has(e)||Mi.set(e,new Map);const r=Mi.get(e),o=r.get(t);if(!o)return r.set(t,n()),()=>{r.get(t)?.(),r.delete(t)};const i=n(),s=()=>{i(),o(),r.delete(t)};return r.set(t,s),()=>{r.get(t)===s&&(i(),r.set(t,o))}}function ob(e,t){return e?rb(e,"style",()=>{const r=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=r}}):()=>{}}var ib=1e3/60;function sb(e,t){const n=e();if(ft(n)&&n.isConnected)return t(n),()=>{};{const r=setInterval(()=>{const o=e();ft(o)&&o.isConnected&&(t(o),clearInterval(r))},ib);return()=>clearInterval(r)}}function ab(e,t){const n=[];return e?.forEach(r=>{const o=sb(r,t);n.push(o)}),()=>{n.forEach(r=>r())}}var lb=e=>e[e.length-1],bc=(e,t)=>{const n=[];return e.reduce((r,o,i)=>(i%t===0?r.push([o]):lb(r)?.push(o),r),n)},wc=e=>e?.constructor.name==="Array",cb=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Ii(e[n],t[n]))return!1;return!0},Ii=(e,t)=>{if(Object.is(e,t))return!0;if(e==null&&t!=null||e!=null&&t==null)return!1;if(typeof e?.isEqual=="function"&&typeof t?.isEqual=="function")return e.isEqual(t);if(typeof e=="function"&&typeof t=="function")return e.toString()===t.toString();if(wc(e)&&wc(t))return cb(Array.from(e),Array.from(t));if(typeof e!="object"||typeof t!="object")return!1;const n=Object.keys(t??Object.create(null)),r=n.length;for(let o=0;o<r;o++)if(!Reflect.has(e,n[o]))return!1;for(let o=0;o<r;o++){const i=n[o];if(!Ii(e[i],t[i]))return!1}return!0},ub=(e,...t)=>(typeof e=="function"?e(...t):e)??void 0,db=()=>{},xc=(...e)=>(...t)=>{e.forEach(function(n){n?.(...t)})};function rr(e,t,...n){if(e in t){const o=t[e];return typeof o=="function"?o(...n):o}const r=new Error(`No matching key: ${JSON.stringify(e)} in ${JSON.stringify(Object.keys(t))}`);throw Error.captureStackTrace?.(r,rr),r}var fb=e=>typeof e=="function",gb=e=>e==null;function Li(e){if(!hb(e)||e===void 0)return e;const t=Reflect.ownKeys(e).filter(r=>typeof r=="string"),n={};for(const r of t){const o=e[r];o!==void 0&&(n[r]=Li(o))}return n}var hb=e=>e&&typeof e=="object"&&e.constructor===Object;function pb(...e){const t=e.length===1?e[0]:e[1];(e.length===2?e[0]:!0)&&process.env.NODE_ENV!=="production"&&console.warn(t)}const[f1,mb]=$t({hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:()=>({getRootNode:()=>document,getDocument:()=>document,getWindow:()=>window})}),[g1,yb]=$t({hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:()=>({dir:"ltr",locale:"en-US"})});var En="default",Ri="",eo=new WeakMap;function vb(e={}){const{target:t,doc:n}=e,r=n??document,o=r.documentElement;return yc()?(En==="default"&&(Ri=o.style.webkitUserSelect,o.style.webkitUserSelect="none"),En="disabled"):t&&(eo.set(t,t.style.userSelect),t.style.userSelect="none"),()=>Sc({target:t,doc:r})}function Sc(e={}){const{target:t,doc:n}=e,o=(n??document).documentElement;if(yc()){if(En!=="disabled")return;En="restoring",setTimeout(()=>{Qv(()=>{En==="restoring"&&(o.style.webkitUserSelect==="none"&&(o.style.webkitUserSelect=Ri||""),Ri="",En="default")})},300)}else if(t&&eo.has(t)){const i=eo.get(t);t.style.userSelect==="none"&&(t.style.userSelect=i??""),t.getAttribute("style")===""&&t.removeAttribute("style"),eo.delete(t)}}function bb(e={}){const{defer:t,target:n,...r}=e,o=t?Ve:s=>s(),i=[];return i.push(o(()=>{const s=typeof n=="function"?n():n;i.push(vb({...r,target:s}))})),()=>{i.forEach(s=>s?.())}}var Ni=(e,t,n,r)=>{const o=typeof e=="function"?e():e;return o?.addEventListener(t,n,r),()=>{o?.removeEventListener(t,n,r)}},wb=e=>e.button===2||Yv()&&e.ctrlKey&&e.button===0;function Ec(e,t,n){const o=(s=>{const a=requestAnimationFrame(s);return()=>cancelAnimationFrame(a)})(()=>{e.removeEventListener(t,i,!0),n()}),i=()=>{o(),n()};return e.addEventListener(t,i,{once:!0,capture:!0}),o}function Pc(e,t,n){if(!e)return;const r=e.ownerDocument.defaultView||window,o=new r.CustomEvent(t,n);return e.dispatchEvent(o)}var xb={Up:"ArrowUp",Down:"ArrowDown",Esc:"Escape"," ":"Space",",":"Comma",Left:"ArrowLeft",Right:"ArrowRight"},Cc={ArrowLeft:"ArrowRight",ArrowRight:"ArrowLeft"};function Sb(e,t={}){const{dir:n="ltr",orientation:r="horizontal"}=t;let{key:o}=e;return o=xb[o]??o,n==="rtl"&&r==="horizontal"&&o in Cc&&(o=Cc[o]),o}function Eb(e){return e.nativeEvent??e}const Pb=e=>xn()(e,["immediate","lazyMount","onExitComplete","present","unmountOnExit"]);function Cb(e,t,n){const r=e.matches("mounted","unmountSuspended");return{skip:!e.context.initial&&r,present:r,setNode(o){o&&t({type:"NODE.SET",node:o})},unmount(){t({type:"UNMOUNT"})}}}function to(e){return e?.animationName||"none"}function Ob(e){return uc({initial:e.present?"mounted":"unmounted",context:{node:null,styles:null,unmountAnimationName:null,prevAnimationName:null,present:!1,initial:!1,...e},exit:["clearInitial"],watch:{present:["setInitial","syncPresence"]},on:{"NODE.SET":{actions:["setNode","setStyles"]}},states:{mounted:{on:{UNMOUNT:{target:"unmounted",actions:["invokeOnExitComplete"]},"UNMOUNT.SUSPEND":"unmountSuspended"}},unmountSuspended:{activities:["trackAnimationEvents"],on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]},"ANIMATION.END":{target:"unmounted",actions:["invokeOnExitComplete"]},UNMOUNT:{target:"unmounted",actions:["invokeOnExitComplete"]}}},unmounted:{entry:["clearPrevAnimationName"],on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]}}}}},{actions:{setInitial(t){t.initial=!0},clearInitial(t){t.initial=!1},invokeOnExitComplete(t){t.onExitComplete?.()},setNode(t,n){t.node=Wr(n.node)},setStyles(t,n){const r=n.node.ownerDocument.defaultView||window;t.styles=Wr(r.getComputedStyle(n.node))},syncPresence(t,n,{send:r}){if(t.present){r({type:"MOUNT",src:"presence.changed"});return}const o=to(t.styles);(t.immediate?queueMicrotask:requestAnimationFrame)(()=>{t.unmountAnimationName=o,o==="none"||o===t.prevAnimationName||t.styles?.display==="none"||t.styles?.animationDuration==="0s"?r({type:"UNMOUNT",src:"presence.changed"}):r({type:"UNMOUNT.SUSPEND"})})},setPrevAnimationName(t){(t.immediate?queueMicrotask:requestAnimationFrame)(()=>{t.prevAnimationName=to(t.styles)})},clearPrevAnimationName(t){t.prevAnimationName=null}},activities:{trackAnimationEvents(t,n,{send:r}){const o=t.node;if(!o)return;const i=a=>{a.target===o&&(t.prevAnimationName=to(t.styles))},s=a=>{const l=to(t.styles);a.target===o&&l===t.unmountAnimationName&&r({type:"UNMOUNT",src:"animationend"})};return o.addEventListener("animationstart",i),o.addEventListener("animationcancel",s),o.addEventListener("animationend",s),()=>{o.removeEventListener("animationstart",i),o.removeEventListener("animationcancel",s),o.removeEventListener("animationend",s)}}}})}jt()(["onExitComplete","present","immediate"]);const Db=e=>{const[t,n]=Nv(e),[r,o]=L(!1),[i,s]=hc(Ob(n),{context:n}),a=A(()=>Cb(i,s));return V(()=>{a().present&&o(!0)}),A(()=>({unmounted:!a().present&&!r()&&t.lazyMount||t.unmountOnExit&&!a().present&&r(),present:a().present,presenceProps:{ref:a().setNode,hidden:!a().present,"data-state":n.present?"open":"closed"}}))},[kb,Oc]=$t({hookName:"usePresenceContext",providerName:"<PresenceProvider />"}),Fi=Math.min,Pn=Math.max,no=Math.round,ro=Math.floor,Mt=e=>({x:e,y:e});function Cn(e){return Dc(e)?(e.nodeName||"").toLowerCase():"#document"}function Me(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function gt(e){var t;return(t=(Dc(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Dc(e){return e instanceof Node||e instanceof Me(e).Node}function We(e){return e instanceof Element||e instanceof Me(e).Element}function Je(e){return e instanceof HTMLElement||e instanceof Me(e).HTMLElement}function kc(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Me(e).ShadowRoot}function or(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=He(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Tb(e){return["table","td","th"].includes(Cn(e))}function oo(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function _i(e){const t=Vi(),n=We(e)?He(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function $b(e){let t=It(e);for(;Je(t)&&!On(t);){if(_i(t))return t;if(oo(t))return null;t=It(t)}return null}function Vi(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function On(e){return["html","body","#document"].includes(Cn(e))}function He(e){return Me(e).getComputedStyle(e)}function io(e){return We(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function It(e){if(Cn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||kc(e)&&e.host||gt(e);return kc(t)?t.host:t}function Tc(e){const t=It(e);return On(t)?e.ownerDocument?e.ownerDocument.body:e.body:Je(t)&&or(t)?t:Tc(t)}function ir(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Tc(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=Me(o);return i?t.concat(s,s.visualViewport||[],or(o)?o:[],s.frameElement&&n?ir(s.frameElement):[]):t.concat(o,ir(o,[],n))}function $c(e){const t=He(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Je(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=no(n)!==i||no(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Ki(e){return We(e)?e:e.contextElement}function Dn(e){const t=Ki(e);if(!Je(t))return Mt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=$c(t);let s=(i?no(n.width):n.width)/r,a=(i?no(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Ab=Mt(0);function Ac(e){const t=Me(e);return!Vi()||!t.visualViewport?Ab:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Mb(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Me(e)?!1:t}function Ut(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Ki(e);let s=Mt(1);t&&(r?We(r)&&(s=Dn(r)):s=Dn(e));const a=Mb(i,n,r)?Ac(i):Mt(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const f=Me(i),m=r&&We(r)?Me(r):r;let g=f,p=g.frameElement;for(;p&&r&&m!==g;){const y=Dn(p),v=p.getBoundingClientRect(),b=He(p),w=v.left+(p.clientLeft+parseFloat(b.paddingLeft))*y.x,x=v.top+(p.clientTop+parseFloat(b.paddingTop))*y.y;l*=y.x,c*=y.y,u*=y.x,d*=y.y,l+=w,c+=x,g=Me(p),p=g.frameElement}}return fn({width:u,height:d,x:l,y:c})}function Ib(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=gt(r),a=t?oo(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=Mt(1);const u=Mt(0),d=Je(r);if((d||!d&&!i)&&((Cn(r)!=="body"||or(s))&&(l=io(r)),Je(r))){const f=Ut(r);c=Dn(r),u.x=f.x+r.clientLeft,u.y=f.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}}function Lb(e){return Array.from(e.getClientRects())}function Mc(e){return Ut(gt(e)).left+io(e).scrollLeft}function Rb(e){const t=gt(e),n=io(e),r=e.ownerDocument.body,o=Pn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Pn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Mc(e);const a=-n.scrollTop;return He(r).direction==="rtl"&&(s+=Pn(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function Nb(e,t){const n=Me(e),r=gt(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const c=Vi();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}function Fb(e,t){const n=Ut(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Je(e)?Dn(e):Mt(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:s,height:a,x:l,y:c}}function Ic(e,t,n){let r;if(t==="viewport")r=Nb(e,n);else if(t==="document")r=Rb(gt(e));else if(We(t))r=Fb(t,n);else{const o=Ac(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return fn(r)}function Lc(e,t){const n=It(e);return n===t||!We(n)||On(n)?!1:He(n).position==="fixed"||Lc(n,t)}function _b(e,t){const n=t.get(e);if(n)return n;let r=ir(e,[],!1).filter(a=>We(a)&&Cn(a)!=="body"),o=null;const i=He(e).position==="fixed";let s=i?It(e):e;for(;We(s)&&!On(s);){const a=He(s),l=_i(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||or(s)&&!l&&Lc(e,s))?r=r.filter(u=>u!==s):o=a,s=It(s)}return t.set(e,r),r}function Vb(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?oo(t)?[]:_b(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const d=Ic(t,u,o);return c.top=Pn(d.top,c.top),c.right=Fi(d.right,c.right),c.bottom=Fi(d.bottom,c.bottom),c.left=Pn(d.left,c.left),c},Ic(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Kb(e){const{width:t,height:n}=$c(e);return{width:t,height:n}}function zb(e,t,n){const r=Je(t),o=gt(t),i=n==="fixed",s=Ut(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=Mt(0);if(r||!r&&!i)if((Cn(t)!=="body"||or(o))&&(a=io(t)),r){const d=Ut(t,!0,i,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else o&&(l.x=Mc(o));const c=s.left+a.scrollLeft-l.x,u=s.top+a.scrollTop-l.y;return{x:c,y:u,width:s.width,height:s.height}}function zi(e){return He(e).position==="static"}function Rc(e,t){return!Je(e)||He(e).position==="fixed"?null:t?t(e):e.offsetParent}function Nc(e,t){const n=Me(e);if(oo(e))return n;if(!Je(e)){let o=It(e);for(;o&&!On(o);){if(We(o)&&!zi(o))return o;o=It(o)}return n}let r=Rc(e,t);for(;r&&Tb(r)&&zi(r);)r=Rc(r,t);return r&&On(r)&&zi(r)&&!_i(r)?n:r||$b(e)||n}const Bb=async function(e){const t=this.getOffsetParent||Nc,n=this.getDimensions,r=await n(e.floating);return{reference:zb(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function jb(e){return He(e).direction==="rtl"}const Ub={convertOffsetParentRelativeRectToViewportRelativeRect:Ib,getDocumentElement:gt,getClippingRect:Vb,getOffsetParent:Nc,getElementRects:Bb,getClientRects:Lb,getDimensions:Kb,getScale:Dn,isElement:We,isRTL:jb};function Wb(e,t){let n=null,r;const o=gt(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const{left:c,top:u,width:d,height:f}=e.getBoundingClientRect();if(a||t(),!d||!f)return;const m=ro(u),g=ro(o.clientWidth-(c+d)),p=ro(o.clientHeight-(u+f)),y=ro(c),b={rootMargin:-m+"px "+-g+"px "+-p+"px "+-y+"px",threshold:Pn(0,Fi(1,l))||1};let w=!0;function x(T){const O=T[0].intersectionRatio;if(O!==l){if(!w)return s();O?s(!1,O):r=setTimeout(()=>{s(!1,1e-7)},1e3)}w=!1}try{n=new IntersectionObserver(x,{...b,root:o.ownerDocument})}catch{n=new IntersectionObserver(x,b)}n.observe(e)}return s(!0),i}function Hb(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Ki(e),u=o||i?[...c?ir(c):[],...ir(t)]:[];u.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const d=c&&a?Wb(c,n):null;let f=-1,m=null;s&&(m=new ResizeObserver(v=>{let[b]=v;b&&b.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var w;(w=m)==null||w.observe(t)})),n()}),c&&!l&&m.observe(c),m.observe(t));let g,p=l?Ut(e):null;l&&y();function y(){const v=Ut(e);p&&(v.x!==p.x||v.y!==p.y||v.width!==p.width||v.height!==p.height)&&n(),p=v,g=requestAnimationFrame(y)}return n(),()=>{var v;u.forEach(b=>{o&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),d?.(),(v=m)==null||v.disconnect(),m=null,l&&cancelAnimationFrame(g)}}const Yb=ll,Gb=cl,qb=il,Zb=ul,Xb=ol,Jb=Rh,Qb=(e,t,n)=>{const r=new Map,o={platform:Ub,...n},i={...o.platform,_c:r};return rl(e,t,{...o,platform:i})};function Fc(e=0,t=0,n=0,r=0){if(typeof DOMRect=="function")return new DOMRect(e,t,n,r);const o={x:e,y:t,width:n,height:r,top:t,right:e+n,bottom:t+r,left:e};return{...o,toJSON:()=>o}}function ew(e){if(!e)return Fc();const{x:t,y:n,width:r,height:o}=e;return Fc(t,n,r,o)}function tw(e,t){return{contextElement:ft(e)?e:void 0,getBoundingClientRect:()=>{const n=e,r=t?.(n);return r||!n?ew(r):n.getBoundingClientRect()}}}var sr=e=>({variable:e,reference:`var(${e})`}),ht={arrowSize:sr("--arrow-size"),arrowSizeHalf:sr("--arrow-size-half"),arrowBg:sr("--arrow-background"),transformOrigin:sr("--transform-origin"),arrowOffset:sr("--arrow-offset")},nw=e=>({top:"bottom center","top-start":e?`${e.x}px bottom`:"left bottom","top-end":e?`${e.x}px bottom`:"right bottom",bottom:"top center","bottom-start":e?`${e.x}px top`:"top left","bottom-end":e?`${e.x}px top`:"top right",left:"right center","left-start":e?`right ${e.y}px`:"right top","left-end":e?`right ${e.y}px`:"right bottom",right:"left center","right-start":e?`left ${e.y}px`:"left top","right-end":e?`left ${e.y}px`:"left bottom"}),rw={name:"transformOrigin",fn({placement:e,elements:t,middlewareData:n}){const{arrow:r}=n,o=nw(r)[e],{floating:i}=t;return i.style.setProperty(ht.transformOrigin.variable,o),{data:{transformOrigin:o}}}},ow={name:"rects",fn({rects:e}){return{data:e}}},iw=e=>{if(e)return{name:"shiftArrow",fn({placement:t,middlewareData:n}){if(!n.arrow)return{};const{x:r,y:o}=n.arrow,i=t.split("-")[0];return Object.assign(e.style,{left:r!=null?`${r}px`:"",top:o!=null?`${o}px`:"",[i]:`calc(100% + ${ht.arrowOffset.reference})`}),{}}}};function sw(e){const[t,n]=e.split("-");return{side:t,align:n,hasAlign:n!=null}}var aw={strategy:"absolute",placement:"bottom",listeners:!0,gutter:8,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,overflowPadding:8,arrowPadding:4};function _c(e,t){const n=e.devicePixelRatio||1;return Math.round(t*n)/n}function Vc(e){return ub(e.boundary)}function lw(e,t){if(e)return Xb({element:e,padding:t.arrowPadding})}function cw(e,t){if(!gb(t.offset??t.gutter))return Yb(({placement:n})=>{const r=(e?.clientHeight||0)/2,o=t.offset?.mainAxis??t.gutter,i=typeof o=="number"?o+r:o??r,{hasAlign:s}=sw(n),a=s?void 0:t.shift,l=t.offset?.crossAxis??a;return Li({crossAxis:l,mainAxis:i,alignmentAxis:t.shift})})}function uw(e){if(e.flip)return qb({boundary:Vc(e),padding:e.overflowPadding,fallbackPlacements:e.flip===!0?void 0:e.flip})}function dw(e){if(!(!e.slide&&!e.overlap))return Gb({boundary:Vc(e),mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:Jb()})}function fw(e){return Zb({padding:e.overflowPadding,apply({elements:t,rects:n,availableHeight:r,availableWidth:o}){const i=t.floating,s=Math.round(n.reference.width);o=Math.floor(o),r=Math.floor(r),i.style.setProperty("--reference-width",`${s}px`),i.style.setProperty("--available-width",`${o}px`),i.style.setProperty("--available-height",`${r}px`)}})}function gw(e){return e?e===!0?{ancestorResize:!0,ancestorScroll:!0,elementResize:!0,layoutShift:!0}:e:{}}function hw(e,t,n={}){const r=tw(e,n.getAnchorRect);if(!t||!r)return;const o=Object.assign({},aw,n),i=t.querySelector("[data-part=arrow]"),s=[cw(i,o),uw(o),dw(o),lw(i,o),iw(i),rw,fw(o),ow],{placement:a,strategy:l,onComplete:c,onPositioned:u}=o,d=async()=>{if(!r||!t)return;const p=await Qb(r,t,{placement:a,middleware:s,strategy:l});c?.(p),u?.({placed:!0});const y=Ai(t),v=_c(y,p.x),b=_c(y,p.y);t.style.setProperty("--x",`${v}px`),t.style.setProperty("--y",`${b}px`);const w=t.firstElementChild;if(w){const x=y.getComputedStyle(w).zIndex;t.style.setProperty("--z-index",x)}},f=async()=>{n.updatePosition?(await n.updatePosition({updatePosition:d}),u?.({placed:!0})):await d()},m=gw(o.listeners),g=o.listeners?Hb(r,t,f,m):db;return f(),()=>{g?.(),u?.({placed:!1})}}function pw(e,t,n={}){const{defer:r,...o}=n,i=r?Ve:a=>a(),s=[];return s.push(i(()=>{const a=typeof e=="function"?e():e,l=typeof t=="function"?t():t;s.push(hw(a,l,o))})),()=>{s.forEach(a=>a?.())}}var mw={bottom:"rotate(45deg)",left:"rotate(135deg)",top:"rotate(225deg)",right:"rotate(315deg)"};function yw(e={}){const{placement:t,sameWidth:n,fitViewport:r,strategy:o="absolute"}=e;return{arrow:{position:"absolute",width:ht.arrowSize.reference,height:ht.arrowSize.reference,[ht.arrowSizeHalf.variable]:`calc(${ht.arrowSize.reference} / 2)`,[ht.arrowOffset.variable]:`calc(${ht.arrowSizeHalf.reference} * -1)`},arrowTip:{transform:t?mw[t.split("-")[0]]:void 0,background:ht.arrowBg.reference,top:"0",left:"0",width:"100%",height:"100%",position:"absolute",zIndex:"inherit"},floating:{position:o,isolation:"isolate",minWidth:n?void 0:"max-content",width:n?"var(--reference-width)":void 0,maxWidth:r?"var(--available-width)":void 0,maxHeight:r?"var(--available-height)":void 0,top:"0px",left:"0px",transform:t?"translate3d(var(--x), var(--y), 0)":"translate3d(0, -100vh, 0)",zIndex:"var(--z-index)"}}}function vw(e){const t={each(n){for(let r=0;r<e.frames?.length;r+=1){const o=e.frames[r];o&&n(o)}},queueBeforeEvent(n,r){const o=new Set;return t.each(i=>{try{o.add(Ec(i.document,n,r))}catch{}}),()=>{try{o.forEach(i=>i())}catch{}}},addEventListener(n,r,o){return t.each(i=>{try{i.document.addEventListener(n,r,o)}catch{}}),()=>{try{t.removeEventListener(n,r,o)}catch{}}},removeEventListener(n,r,o){t.each(i=>{try{i.document.removeEventListener(n,r,o)}catch{}})}};return t}var Kc="pointerdown.outside",zc="focus.outside";function bw(e){for(const t of e)if(ft(t)&&vc(t))return!0;return!1}var Bc=e=>"clientY"in e;function ww(e,t){if(!Bc(t)||!e)return!1;const n=e.getBoundingClientRect();return n.width===0||n.height===0?!1:n.top<=t.clientY&&t.clientY<=n.top+n.height&&n.left<=t.clientX&&t.clientX<=n.left+n.width}function xw(e){const t=nr(e);if(!t||!Bc(e))return!1;const r=t.scrollHeight>t.clientHeight&&e.clientX>t.clientWidth,i=t.scrollWidth>t.clientWidth&&e.clientY>t.clientHeight;return r||i}function Sw(e,t){const{exclude:n,onFocusOutside:r,onPointerDownOutside:o,onInteractOutside:i,defer:s}=t;if(!e)return;const a=Qr(e),l=Ai(e),c=vw(l);function u(y){const v=nr(y);return!ft(v)||Jr(e,v)||ww(e,y)||xw(y)?!1:!n?.(v)}const d=new Set;function f(y){function v(){const b=s?Ve:x=>x(),w=y.composedPath?.()??[y.target];b(()=>{if(!(!e||!u(y))){if(o||i){const x=xc(o,i);e.addEventListener(Kc,x,{once:!0})}Pc(e,Kc,{bubbles:!1,cancelable:!0,detail:{originalEvent:y,contextmenu:wb(y),focusable:bw(w)}})}})}y.pointerType==="touch"?(d.forEach(b=>b()),d.add(Ec(a,"pointerup",v)),d.add(c.queueBeforeEvent("pointerup",v))):v()}const m=new Set,g=setTimeout(()=>{m.add(c.addEventListener("pointerdown",f,!0)),m.add(Ni(a,"pointerdown",f,!0))},0);function p(y){(s?Ve:b=>b())(()=>{if(!(!e||!u(y))){if(r||i){const b=xc(r,i);e.addEventListener(zc,b,{once:!0})}Pc(e,zc,{bubbles:!1,cancelable:!0,detail:{originalEvent:y,contextmenu:!1,focusable:vc(nr(y))}})}})}return m.add(Ni(a,"focusin",p,!0)),m.add(c.addEventListener("focusin",p,!0)),()=>{clearTimeout(g),d.forEach(y=>y()),m.forEach(y=>y())}}function Ew(e,t){const{defer:n}=t,r=n?Ve:i=>i(),o=[];return o.push(r(()=>{const i=typeof e=="function"?e():e;o.push(Sw(i,t))})),()=>{o.forEach(i=>i?.())}}function Pw(e,t){const n=r=>{r.key==="Escape"&&(r.isComposing||t?.(r))};return Ni(Qr(e),"keydown",n,{capture:!0})}var Ye={layers:[],branches:[],count(){return this.layers.length},pointerBlockingLayers(){return this.layers.filter(e=>e.pointerBlocking)},topMostPointerBlockingLayer(){return[...this.pointerBlockingLayers()].slice(-1)[0]},hasPointerBlockingLayer(){return this.pointerBlockingLayers().length>0},isBelowPointerBlockingLayer(e){const t=this.indexOf(e),n=this.topMostPointerBlockingLayer()?this.indexOf(this.topMostPointerBlockingLayer()?.node):-1;return t<n},isTopMost(e){return this.layers[this.count()-1]?.node===e},getNestedLayers(e){return Array.from(this.layers).slice(this.indexOf(e)+1)},isInNestedLayer(e,t){return this.getNestedLayers(e).some(n=>Jr(n.node,t))},isInBranch(e){return Array.from(this.branches).some(t=>Jr(t,e))},add(e){const t=this.layers.push(e);e.node.style.setProperty("--layer-index",`${t}`)},addBranch(e){this.branches.push(e)},remove(e){const t=this.indexOf(e);t<0||(t<this.count()-1&&this.getNestedLayers(e).forEach(r=>r.dismiss()),this.layers.splice(t,1),e.style.removeProperty("--layer-index"))},removeBranch(e){const t=this.branches.indexOf(e);t>=0&&this.branches.splice(t,1)},indexOf(e){return this.layers.findIndex(t=>t.node===e)},dismiss(e){this.layers[this.indexOf(e)]?.dismiss()},clear(){this.remove(this.layers[0].node)}},jc;function Uc(){Ye.layers.forEach(({node:e})=>{e.style.pointerEvents=Ye.isBelowPointerBlockingLayer(e)?"none":"auto"})}function Cw(e){e.style.pointerEvents=""}function Ow(e,t){const n=Qr(e),r=[];if(Ye.hasPointerBlockingLayer()&&!n.body.hasAttribute("data-inert")&&(jc=document.body.style.pointerEvents,queueMicrotask(()=>{n.body.style.pointerEvents="none",n.body.setAttribute("data-inert","")})),t){const o=ab(t,i=>{r.push(ob(i,{pointerEvents:"auto"}))});r.push(o)}return()=>{Ye.hasPointerBlockingLayer()||(queueMicrotask(()=>{n.body.style.pointerEvents=jc,n.body.removeAttribute("data-inert"),n.body.style.length===0&&n.body.removeAttribute("style")}),r.forEach(o=>o()))}}function Dw(e,t){if(!e){pb("[@zag-js/dismissable] node is `null` or `undefined`");return}const{onDismiss:n,pointerBlocking:r,exclude:o,debug:i}=t,s={dismiss:n,node:e,pointerBlocking:r};Ye.add(s),Uc();function a(f){const m=nr(f.detail.originalEvent);Ye.isBelowPointerBlockingLayer(e)||Ye.isInBranch(m)||(t.onPointerDownOutside?.(f),t.onInteractOutside?.(f),!f.defaultPrevented&&(i&&console.log("onPointerDownOutside:",f.detail.originalEvent),n?.()))}function l(f){const m=nr(f.detail.originalEvent);Ye.isInBranch(m)||(t.onFocusOutside?.(f),t.onInteractOutside?.(f),!f.defaultPrevented&&(i&&console.log("onFocusOutside:",f.detail.originalEvent),n?.()))}function c(f){Ye.isTopMost(e)&&(t.onEscapeKeyDown?.(f),!f.defaultPrevented&&n&&(f.preventDefault(),n()))}function u(f){if(!e)return!1;const m=typeof o=="function"?o():o,g=Array.isArray(m)?m:[m],p=t.persistentElements?.map(y=>y()).filter(ft);return p&&g.push(...p),g.some(y=>Jr(y,f))||Ye.isInNestedLayer(e,f)}const d=[r?Ow(e,t.persistentElements):void 0,Pw(e,c),Ew(e,{exclude:u,onFocusOutside:l,onPointerDownOutside:a,defer:t.defer})];return()=>{Ye.remove(e),Uc(),Cw(e),d.forEach(f=>f?.())}}function kw(e,t){const{defer:n}=t,r=n?Ve:i=>i(),o=[];return o.push(r(()=>{const i=fb(e)?e():e;o.push(Dw(i,t))})),()=>{o.forEach(i=>i?.())}}const[Tw,fe]=$t({hookName:"useDatePickerContext",providerName:"<DatePickerProvider />"}),$w=e=>{const t=fe(),n=Oc(),r=ce(()=>t().getContentProps(),()=>n().presenceProps,e);return h(ie,{get when(){return!n().unmounted},get children(){return h(de.div,r)}})},Aw=e=>e.children(fe()),Mw=e=>{const t=fe(),n=ce(()=>t().getControlProps(),e);return h(de.div,n)},[Iw,Wt]=$t({hookName:"useDatePickerViewContext",providerName:"<DatePickerViewProvider />",strict:!1,defaultValue:{view:"day"}}),Lw=e=>{const t=fe(),n=Wt(),r=ce(()=>t().getNextTriggerProps(n),e);return h(de.button,r)},Rw=e=>{const t=fe(),n=Oc(),r=ce(()=>t().getPositionerProps(),e);return h(ie,{get when(){return!n().unmounted},get children(){return h(de.div,r)}})},Nw=e=>{const t=fe(),n=Wt(),r=ce(()=>t().getPrevTriggerProps(n),e);return h(de.button,r)},Fw=e=>{const t=fe(),n=ce(()=>t().getRangeTextProps(),e);return h(de.div,I(n,{get children(){return t().visibleRangeText.start}}))};function Bi(e,t){return e-t*Math.floor(e/t)}const Wc=1721426;function so(e,t,n,r){t=ji(e,t);let o=t-1,i=-2;return n<=2?i=0:ao(t)&&(i=-1),Wc-1+365*o+Math.floor(o/4)-Math.floor(o/100)+Math.floor(o/400)+Math.floor((367*n-362)/12+i+r)}function ao(e){return e%4===0&&(e%100!==0||e%400===0)}function ji(e,t){return e==="BC"?1-t:t}function _w(e){let t="AD";return e<=0&&(t="BC",e=1-e),[t,e]}const Vw={standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]};class kn{fromJulianDay(t){let n=t,r=n-Wc,o=Math.floor(r/146097),i=Bi(r,146097),s=Math.floor(i/36524),a=Bi(i,36524),l=Math.floor(a/1461),c=Bi(a,1461),u=Math.floor(c/365),d=o*400+s*100+l*4+u+(s!==4&&u!==4?1:0),[f,m]=_w(d),g=n-so(f,m,1,1),p=2;n<so(f,m,3,1)?p=0:ao(m)&&(p=1);let y=Math.floor(((g+p)*12+373)/367),v=n-so(f,m,y,1)+1;return new vt(f,m,y,v)}toJulianDay(t){return so(t.era,t.year,t.month,t.day)}getDaysInMonth(t){return Vw[ao(t.year)?"leapyear":"standard"][t.month-1]}getMonthsInYear(t){return 12}getDaysInYear(t){return ao(t.year)?366:365}getYearsInEra(t){return 9999}getEras(){return["BC","AD"]}isInverseEra(t){return t.era==="BC"}balanceDate(t){t.year<=0&&(t.era=t.era==="BC"?"AD":"BC",t.year=1-t.year)}constructor(){this.identifier="gregory"}}const Kw={"001":1,AD:1,AE:6,AF:6,AI:1,AL:1,AM:1,AN:1,AR:1,AT:1,AU:1,AX:1,AZ:1,BA:1,BE:1,BG:1,BH:6,BM:1,BN:1,BY:1,CH:1,CL:1,CM:1,CN:1,CR:1,CY:1,CZ:1,DE:1,DJ:6,DK:1,DZ:6,EC:1,EE:1,EG:6,ES:1,FI:1,FJ:1,FO:1,FR:1,GB:1,GE:1,GF:1,GP:1,GR:1,HR:1,HU:1,IE:1,IQ:6,IR:6,IS:1,IT:1,JO:6,KG:1,KW:6,KZ:1,LB:1,LI:1,LK:1,LT:1,LU:1,LV:1,LY:6,MC:1,MD:1,ME:1,MK:1,MN:1,MQ:1,MV:5,MY:1,NL:1,NO:1,NZ:1,OM:6,PL:1,QA:6,RE:1,RO:1,RS:1,RU:1,SD:6,SE:1,SI:1,SK:1,SM:1,SY:6,TJ:1,TM:1,TR:1,UA:1,UY:1,UZ:1,VA:1,VN:1,XK:1};function Tn(e,t){return t=Ge(t,e.calendar),e.era===t.era&&e.year===t.year&&e.month===t.month&&e.day===t.day}function zw(e,t){return e.calendar.identifier===t.calendar.identifier&&e.era===t.era&&e.year===t.year&&e.month===t.month&&e.day===t.day}function Bw(e,t){return Tn(e,co(t))}function lo(e,t){let n=e.calendar.toJulianDay(e),r=Math.ceil(n+1-Ww(t))%7;return r<0&&(r+=7),r}function Hc(e){return mt(Date.now(),e)}function co(e){return An(Hc(e))}function Yc(e,t){return e.calendar.toJulianDay(e)-t.calendar.toJulianDay(t)}function jw(e,t){return Gc(e)-Gc(t)}function Gc(e){return e.hour*36e5+e.minute*6e4+e.second*1e3+e.millisecond}let Ui=null;function Wi(){return Ui==null&&(Ui=new Intl.DateTimeFormat().resolvedOptions().timeZone),Ui}function Lt(e){return e.subtract({days:e.day-1})}function Hi(e){return e.add({days:e.calendar.getDaysInMonth(e)-e.day})}function Yi(e){return Lt(e.subtract({months:e.month-1}))}function Uw(e){return Hi(e.add({months:e.calendar.getMonthsInYear(e)-e.month}))}function uo(e,t){let n=lo(e,t);return e.subtract({days:n})}function qc(e,t){return uo(e,t).add({days:6})}const Zc=new Map;function Xc(e){if(Intl.Locale){let n=Zc.get(e);return n||(n=new Intl.Locale(e).maximize().region,n&&Zc.set(e,n)),n}let t=e.split("-")[1];return t==="u"?void 0:t}function Ww(e){let t=Xc(e);return t&&Kw[t]||0}function Hw(e,t){let n=e.calendar.getDaysInMonth(e);return Math.ceil((lo(Lt(e),t)+n)/7)}function Jc(e,t){return e&&t?e.compare(t)<=0?e:t:e||t}function Qc(e,t){return e&&t?e.compare(t)>=0?e:t:e||t}const Yw={AF:[4,5],AE:[5,6],BH:[5,6],DZ:[5,6],EG:[5,6],IL:[5,6],IQ:[5,6],IR:[5,5],JO:[5,6],KW:[5,6],LY:[5,6],OM:[5,6],QA:[5,6],SA:[5,6],SD:[5,6],SY:[5,6],YE:[5,6]};function Gw(e,t){let n=e.calendar.toJulianDay(e),r=Math.ceil(n+1)%7;r<0&&(r+=7);let o=Xc(t),[i,s]=Yw[o]||[6,0];return r===i||r===s}function $n(e){e=Ge(e,new kn);let t=ji(e.era,e.year);return eu(t,e.month,e.day,e.hour,e.minute,e.second,e.millisecond)}function eu(e,t,n,r,o,i,s){let a=new Date;return a.setUTCHours(r,o,i,s),a.setUTCFullYear(e,t-1,n),a.getTime()}function Gi(e,t){if(t==="UTC")return 0;if(e>0&&t===Wi())return new Date(e).getTimezoneOffset()*-6e4;let{year:n,month:r,day:o,hour:i,minute:s,second:a}=nu(e,t);return eu(n,r,o,i,s,a,0)-Math.floor(e/1e3)*1e3}const tu=new Map;function nu(e,t){let n=tu.get(t);n||(n=new Intl.DateTimeFormat("en-US",{timeZone:t,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),tu.set(t,n));let r=n.formatToParts(new Date(e)),o={};for(let i of r)i.type!=="literal"&&(o[i.type]=i.value);return{year:o.era==="BC"||o.era==="B"?-o.year+1:+o.year,month:+o.month,day:+o.day,hour:o.hour==="24"?0:+o.hour,minute:+o.minute,second:+o.second}}const ru=864e5;function qw(e,t,n,r){return(n===r?[n]:[n,r]).filter(i=>Zw(e,t,i))}function Zw(e,t,n){let r=nu(n,t);return e.year===r.year&&e.month===r.month&&e.day===r.day&&e.hour===r.hour&&e.minute===r.minute&&e.second===r.second}function pt(e,t,n="compatible"){let r=Ht(e);if(t==="UTC")return $n(r);if(t===Wi()&&n==="compatible"){r=Ge(r,new kn);let l=new Date,c=ji(r.era,r.year);return l.setFullYear(c,r.month-1,r.day),l.setHours(r.hour,r.minute,r.second,r.millisecond),l.getTime()}let o=$n(r),i=Gi(o-ru,t),s=Gi(o+ru,t),a=qw(r,t,o-i,o-s);if(a.length===1)return a[0];if(a.length>1)switch(n){case"compatible":case"earlier":return a[0];case"later":return a[a.length-1];case"reject":throw new RangeError("Multiple possible absolute times found")}switch(n){case"earlier":return Math.min(o-i,o-s);case"compatible":case"later":return Math.max(o-i,o-s);case"reject":throw new RangeError("No such absolute time found")}}function ou(e,t,n="compatible"){return new Date(pt(e,t,n))}function mt(e,t){let n=Gi(e,t),r=new Date(e+n),o=r.getUTCFullYear(),i=r.getUTCMonth()+1,s=r.getUTCDate(),a=r.getUTCHours(),l=r.getUTCMinutes(),c=r.getUTCSeconds(),u=r.getUTCMilliseconds();return new lr(o,i,s,t,n,a,l,c,u)}function An(e){return new vt(e.calendar,e.era,e.year,e.month,e.day)}function Ht(e,t){let n=0,r=0,o=0,i=0;if("timeZone"in e)({hour:n,minute:r,second:o,millisecond:i}=e);else if("hour"in e&&!t)return e;return t&&({hour:n,minute:r,second:o,millisecond:i}=t),new po(e.calendar,e.era,e.year,e.month,e.day,n,r,o,i)}function Ge(e,t){if(e.calendar.identifier===t.identifier)return e;let n=t.fromJulianDay(e.calendar.toJulianDay(e)),r=e.copy();return r.calendar=t,r.era=n.era,r.year=n.year,r.month=n.month,r.day=n.day,Yt(r),r}function Xw(e,t,n){if(e instanceof lr)return e.timeZone===t?e:Qw(e,t);let r=pt(e,t,n);return mt(r,t)}function Jw(e){let t=$n(e)-e.offset;return new Date(t)}function Qw(e,t){let n=$n(e)-e.offset;return Ge(mt(n,t),e.calendar)}const ar=36e5;function fo(e,t){let n=e.copy(),r="hour"in n?r0(n,t):0;qi(n,t.years||0),n.calendar.balanceYearMonth&&n.calendar.balanceYearMonth(n,e),n.month+=t.months||0,Zi(n),iu(n),n.day+=(t.weeks||0)*7,n.day+=t.days||0,n.day+=r,e0(n),n.calendar.balanceDate&&n.calendar.balanceDate(n),n.year<1&&(n.year=1,n.month=1,n.day=1);let o=n.calendar.getYearsInEra(n);if(n.year>o){var i,s;let l=(i=(s=n.calendar).isInverseEra)===null||i===void 0?void 0:i.call(s,n);n.year=o,n.month=l?1:n.calendar.getMonthsInYear(n),n.day=l?1:n.calendar.getDaysInMonth(n)}n.month<1&&(n.month=1,n.day=1);let a=n.calendar.getMonthsInYear(n);return n.month>a&&(n.month=a,n.day=n.calendar.getDaysInMonth(n)),n.day=Math.max(1,Math.min(n.calendar.getDaysInMonth(n),n.day)),n}function qi(e,t){var n,r;!((n=(r=e.calendar).isInverseEra)===null||n===void 0)&&n.call(r,e)&&(t=-t),e.year+=t}function Zi(e){for(;e.month<1;)qi(e,-1),e.month+=e.calendar.getMonthsInYear(e);let t=0;for(;e.month>(t=e.calendar.getMonthsInYear(e));)e.month-=t,qi(e,1)}function e0(e){for(;e.day<1;)e.month--,Zi(e),e.day+=e.calendar.getDaysInMonth(e);for(;e.day>e.calendar.getDaysInMonth(e);)e.day-=e.calendar.getDaysInMonth(e),e.month++,Zi(e)}function iu(e){e.month=Math.max(1,Math.min(e.calendar.getMonthsInYear(e),e.month)),e.day=Math.max(1,Math.min(e.calendar.getDaysInMonth(e),e.day))}function Yt(e){e.calendar.constrainDate&&e.calendar.constrainDate(e),e.year=Math.max(1,Math.min(e.calendar.getYearsInEra(e),e.year)),iu(e)}function su(e){let t={};for(let n in e)typeof e[n]=="number"&&(t[n]=-e[n]);return t}function au(e,t){return fo(e,su(t))}function Xi(e,t){let n=e.copy();return t.era!=null&&(n.era=t.era),t.year!=null&&(n.year=t.year),t.month!=null&&(n.month=t.month),t.day!=null&&(n.day=t.day),Yt(n),n}function go(e,t){let n=e.copy();return t.hour!=null&&(n.hour=t.hour),t.minute!=null&&(n.minute=t.minute),t.second!=null&&(n.second=t.second),t.millisecond!=null&&(n.millisecond=t.millisecond),n0(n),n}function t0(e){e.second+=Math.floor(e.millisecond/1e3),e.millisecond=ho(e.millisecond,1e3),e.minute+=Math.floor(e.second/60),e.second=ho(e.second,60),e.hour+=Math.floor(e.minute/60),e.minute=ho(e.minute,60);let t=Math.floor(e.hour/24);return e.hour=ho(e.hour,24),t}function n0(e){e.millisecond=Math.max(0,Math.min(e.millisecond,1e3)),e.second=Math.max(0,Math.min(e.second,59)),e.minute=Math.max(0,Math.min(e.minute,59)),e.hour=Math.max(0,Math.min(e.hour,23))}function ho(e,t){let n=e%t;return n<0&&(n+=t),n}function r0(e,t){return e.hour+=t.hours||0,e.minute+=t.minutes||0,e.second+=t.seconds||0,e.millisecond+=t.milliseconds||0,t0(e)}function Ji(e,t,n,r){let o=e.copy();switch(t){case"era":{let a=e.calendar.getEras(),l=a.indexOf(e.era);if(l<0)throw new Error("Invalid era: "+e.era);l=yt(l,n,0,a.length-1,r?.round),o.era=a[l],Yt(o);break}case"year":var i,s;!((i=(s=o.calendar).isInverseEra)===null||i===void 0)&&i.call(s,o)&&(n=-n),o.year=yt(e.year,n,-1/0,9999,r?.round),o.year===-1/0&&(o.year=1),o.calendar.balanceYearMonth&&o.calendar.balanceYearMonth(o,e);break;case"month":o.month=yt(e.month,n,1,e.calendar.getMonthsInYear(e),r?.round);break;case"day":o.day=yt(e.day,n,1,e.calendar.getDaysInMonth(e),r?.round);break;default:throw new Error("Unsupported field "+t)}return e.calendar.balanceDate&&e.calendar.balanceDate(o),Yt(o),o}function lu(e,t,n,r){let o=e.copy();switch(t){case"hour":{let i=e.hour,s=0,a=23;if(r?.hourCycle===12){let l=i>=12;s=l?12:0,a=l?23:11}o.hour=yt(i,n,s,a,r?.round);break}case"minute":o.minute=yt(e.minute,n,0,59,r?.round);break;case"second":o.second=yt(e.second,n,0,59,r?.round);break;case"millisecond":o.millisecond=yt(e.millisecond,n,0,999,r?.round);break;default:throw new Error("Unsupported field "+t)}return o}function yt(e,t,n,r,o=!1){if(o){e+=Math.sign(t),e<n&&(e=r);let i=Math.abs(t);t>0?e=Math.ceil(e/i)*i:e=Math.floor(e/i)*i,e>r&&(e=n)}else e+=t,e<n?e=r-(n-e-1):e>r&&(e=n+(e-r-1));return e}function cu(e,t){let n;if(t.years!=null&&t.years!==0||t.months!=null&&t.months!==0||t.weeks!=null&&t.weeks!==0||t.days!=null&&t.days!==0){let o=fo(Ht(e),{years:t.years,months:t.months,weeks:t.weeks,days:t.days});n=pt(o,e.timeZone)}else n=$n(e)-e.offset;n+=t.milliseconds||0,n+=(t.seconds||0)*1e3,n+=(t.minutes||0)*6e4,n+=(t.hours||0)*36e5;let r=mt(n,e.timeZone);return Ge(r,e.calendar)}function o0(e,t){return cu(e,su(t))}function i0(e,t,n,r){switch(t){case"hour":{let o=0,i=23;if(r?.hourCycle===12){let g=e.hour>=12;o=g?12:0,i=g?23:11}let s=Ht(e),a=Ge(go(s,{hour:o}),new kn),l=[pt(a,e.timeZone,"earlier"),pt(a,e.timeZone,"later")].filter(g=>mt(g,e.timeZone).day===a.day)[0],c=Ge(go(s,{hour:i}),new kn),u=[pt(c,e.timeZone,"earlier"),pt(c,e.timeZone,"later")].filter(g=>mt(g,e.timeZone).day===c.day).pop(),d=$n(e)-e.offset,f=Math.floor(d/ar),m=d%ar;return d=yt(f,n,Math.floor(l/ar),Math.floor(u/ar),r?.round)*ar+m,Ge(mt(d,e.timeZone),e.calendar)}case"minute":case"second":case"millisecond":return lu(e,t,n,r);case"era":case"year":case"month":case"day":{let o=Ji(Ht(e),t,n,r),i=pt(o,e.timeZone);return Ge(mt(i,e.timeZone),e.calendar)}default:throw new Error("Unsupported field "+t)}}function s0(e,t,n){let r=Ht(e),o=go(Xi(r,t),t);if(o.compare(r)===0)return e;let i=pt(o,e.timeZone,n);return Ge(mt(i,e.timeZone),e.calendar)}const a0=/^(\d{4})-(\d{2})-(\d{2})$/;function l0(e){let t=e.match(a0);if(!t)throw new Error("Invalid ISO 8601 date string: "+e);let n=new vt(Qi(t[1],0,9999),Qi(t[2],1,12),1);return n.day=Qi(t[3],0,n.calendar.getDaysInMonth(n)),n}function Qi(e,t,n){let r=Number(e);if(r<t||r>n)throw new RangeError(`Value out of range: ${t} <= ${r} <= ${n}`);return r}function c0(e){return`${String(e.hour).padStart(2,"0")}:${String(e.minute).padStart(2,"0")}:${String(e.second).padStart(2,"0")}${e.millisecond?String(e.millisecond/1e3).slice(1):""}`}function uu(e){let t=Ge(e,new kn);return`${String(t.year).padStart(4,"0")}-${String(t.month).padStart(2,"0")}-${String(t.day).padStart(2,"0")}`}function du(e){return`${uu(e)}T${c0(e)}`}function u0(e){let t=Math.sign(e)<0?"-":"+";e=Math.abs(e);let n=Math.floor(e/36e5),r=e%36e5/6e4;return`${t}${String(n).padStart(2,"0")}:${String(r).padStart(2,"0")}`}function d0(e){return`${du(e)}${u0(e.offset)}[${e.timeZone}]`}function es(e){let t=typeof e[0]=="object"?e.shift():new kn,n;if(typeof e[0]=="string")n=e.shift();else{let s=t.getEras();n=s[s.length-1]}let r=e.shift(),o=e.shift(),i=e.shift();return[t,n,r,o,i]}var f0=new WeakMap;class vt{copy(){return this.era?new vt(this.calendar,this.era,this.year,this.month,this.day):new vt(this.calendar,this.year,this.month,this.day)}add(t){return fo(this,t)}subtract(t){return au(this,t)}set(t){return Xi(this,t)}cycle(t,n,r){return Ji(this,t,n,r)}toDate(t){return ou(this,t)}toString(){return uu(this)}compare(t){return Yc(this,t)}constructor(...t){ni(this,f0,{writable:!0,value:void 0});let[n,r,o,i,s]=es(t);this.calendar=n,this.era=r,this.year=o,this.month=i,this.day=s,Yt(this)}}var g0=new WeakMap;class po{copy(){return this.era?new po(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new po(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(t){return fo(this,t)}subtract(t){return au(this,t)}set(t){return Xi(go(this,t),t)}cycle(t,n,r){switch(t){case"era":case"year":case"month":case"day":return Ji(this,t,n,r);default:return lu(this,t,n,r)}}toDate(t,n){return ou(this,t,n)}toString(){return du(this)}compare(t){let n=Yc(this,t);return n===0?jw(this,Ht(t)):n}constructor(...t){ni(this,g0,{writable:!0,value:void 0});let[n,r,o,i,s]=es(t);this.calendar=n,this.era=r,this.year=o,this.month=i,this.day=s,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,Yt(this)}}var h0=new WeakMap;class lr{copy(){return this.era?new lr(this.calendar,this.era,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond):new lr(this.calendar,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond)}add(t){return cu(this,t)}subtract(t){return o0(this,t)}set(t,n){return s0(this,t,n)}cycle(t,n,r){return i0(this,t,n,r)}toDate(){return Jw(this)}toString(){return d0(this)}toAbsoluteString(){return this.toDate().toISOString()}compare(t){return this.toDate().getTime()-Xw(t,this.timeZone).toDate().getTime()}constructor(...t){ni(this,h0,{writable:!0,value:void 0});let[n,r,o,i,s]=es(t),a=t.shift(),l=t.shift();this.calendar=n,this.era=r,this.year=o,this.month=i,this.day=s,this.timeZone=a,this.offset=l,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,Yt(this)}}let ts=new Map;class Qe{format(t){return this.formatter.format(t)}formatToParts(t){return this.formatter.formatToParts(t)}formatRange(t,n){if(typeof this.formatter.formatRange=="function")return this.formatter.formatRange(t,n);if(n<t)throw new RangeError("End date must be >= start date");return`${this.formatter.format(t)} – ${this.formatter.format(n)}`}formatRangeToParts(t,n){if(typeof this.formatter.formatRangeToParts=="function")return this.formatter.formatRangeToParts(t,n);if(n<t)throw new RangeError("End date must be >= start date");let r=this.formatter.formatToParts(t),o=this.formatter.formatToParts(n);return[...r.map(i=>({...i,source:"startRange"})),{type:"literal",value:" – ",source:"shared"},...o.map(i=>({...i,source:"endRange"}))]}resolvedOptions(){let t=this.formatter.resolvedOptions();return y0()&&(this.resolvedHourCycle||(this.resolvedHourCycle=v0(t.locale,this.options)),t.hourCycle=this.resolvedHourCycle,t.hour12=this.resolvedHourCycle==="h11"||this.resolvedHourCycle==="h12"),t.calendar==="ethiopic-amete-alem"&&(t.calendar="ethioaa"),t}constructor(t,n={}){this.formatter=fu(t,n),this.options=n}}const p0={true:{ja:"h11"},false:{}};function fu(e,t={}){if(typeof t.hour12=="boolean"&&m0()){t={...t};let o=p0[String(t.hour12)][e.split("-")[0]],i=t.hour12?"h12":"h23";t.hourCycle=o??i,delete t.hour12}let n=e+(t?Object.entries(t).sort((o,i)=>o[0]<i[0]?-1:1).join():"");if(ts.has(n))return ts.get(n);let r=new Intl.DateTimeFormat(e,t);return ts.set(n,r),r}let ns=null;function m0(){return ns==null&&(ns=new Intl.DateTimeFormat("en-US",{hour:"numeric",hour12:!1}).format(new Date(2020,2,3,0))==="24"),ns}let rs=null;function y0(){return rs==null&&(rs=new Intl.DateTimeFormat("fr",{hour:"numeric",hour12:!1}).resolvedOptions().hourCycle==="h12"),rs}function v0(e,t){if(!t.timeStyle&&!t.hour)return;e=e.replace(/(-u-)?-nu-[a-zA-Z0-9]+/,""),e+=(e.includes("-u-")?"":"-u")+"-nu-latn";let n=fu(e,{...t,timeZone:void 0}),r=parseInt(n.formatToParts(new Date(2020,2,3,0)).find(i=>i.type==="hour").value,10),o=parseInt(n.formatToParts(new Date(2020,2,3,23)).find(i=>i.type==="hour").value,10);if(r===0&&o===23)return"h23";if(r===24&&o===23)return"h24";if(r===0&&o===11)return"h11";if(r===12&&o===11)return"h12";throw new Error("Unexpected hour cycle result")}function b0(e,t,n,r,o){const i={};for(let a in t){const l=a,c=t[l];c!=null&&(i[l]=Math.floor(c/2),i[l]>0&&c%2===0&&i[l]--)}const s=Gt(e,t,n).subtract(i);return cr(e,s,t,n,r,o)}function Gt(e,t,n,r,o){let i=e;return t.years?i=Yi(e):t.months?i=Lt(e):t.weeks&&(i=uo(e,n)),cr(e,i,t,n,r,o)}function os(e,t,n,r,o){let i={...t};i.days?i.days--:i.weeks?i.weeks--:i.months?i.months--:i.years&&i.years--;let s=Gt(e,t,n).subtract(i);return cr(e,s,t,n,r,o)}function cr(e,t,n,r,o,i){return o&&e.compare(o)>=0&&(t=Qc(t,Gt(An(o),n,r))),i&&e.compare(i)<=0&&(t=Jc(t,os(An(i),n,r))),t}function bt(e,t,n){return t&&(e=Qc(e,An(t))),n&&(e=Jc(e,An(n))),e}function gu(e,t,n,r,o,i){switch(t){case"start":return Gt(e,n,r,o,i);case"end":return os(e,n,r,o,i);case"center":default:return b0(e,n,r,o,i)}}function w0(e,t){return Bw(e,t)}function qe(e,t){return t!=null&&Tn(e,t)}function Rt(e,t,n){return t!=null&&e.compare(t)<0||n!=null&&e.compare(n)>0}function x0(e,t,n,r,o){return is(e,t,n)||Rt(e,r,o)}function hu(e,t,n,r,o){return e?t?.(e,n)?!0:Rt(e,r,o):!1}function is(e,t,n){return e.compare(t)<0||e.compare(n)>0}function S0(e,t,n){const r=e.subtract({days:1});return Tn(r,e)||Rt(r,t,n)}function E0(e,t,n){const r=e.add({days:1});return Tn(r,e)||Rt(r,t,n)}function ss(e){let t={...e};for(let n in t)t[n]=1;return t}function pu(e,t){let n={...t};return n.days?n.days--:n.days=-1,e.add(n)}function P0(e,t,n,r,o){let i=n.formatRangeToParts(e.toDate(o),t.toDate(o)),s=-1;for(let c=0;c<i.length;c++){let u=i[c];if(u.source==="shared"&&u.type==="literal")s=c;else if(u.source==="endRange")break}let a="",l="";for(let c=0;c<i.length;c++)c<s?a+=i[c].value:c>s&&(l+=i[c].value);return r(a,l)}function mu(e){return e?.calendar.identifier==="gregory"&&e.era==="BC"?"short":void 0}function yu(e,t){const n=Ht(co(t));return new Qe(e,{weekday:"long",month:"long",year:"numeric",day:"numeric",era:mu(n),timeZone:t})}function C0(e,t,n,r){let o=e,i=t??e,s=yu(n,r);return Tn(o,i)?s.format(o.toDate(r)):P0(o,i,s,(a,l)=>`${a} – ${l}`,r)}function O0(e,t){const n=An(co(t));return new Qe(e,{month:"long",year:"numeric",era:mu(n),calendar:n?.calendar.identifier,timeZone:t})}function mo(e){const t=e-e%10-1,n=[];for(let r=0;r<12;r+=1){const o=t+r;n.push(o)}return n}function vu(e,t,n=0){const o=(lo(e,t)-n+7)%7;return e.subtract({days:o})}function bu(e,t,n,r){const o=t.add({weeks:e}),i=[];let s=vu(o,n,r);for(;i.length<7;){i.push(s);let a=s.add({days:1});if(Tn(s,a))break;s=a}return i}function D0(e,t,n){if(n==null)return Hw(e,t);const r=(lo(Lt(e),t)-n+7)%7;return Math.ceil((r+e.calendar.getDaysInMonth(e))/7)}function k0(e,t,n,r){const o=n??D0(e,t,r);return[...new Array(o).keys()].map(s=>bu(s,e,t,r))}function T0(e,t="long"){const n=new Date(2021,0,1),r=[];for(let o=0;o<12;o++)r.push(n.toLocaleString(e,{month:t})),n.setMonth(n.getMonth()+1);return r}function $0(e,t){const n=new Qe(e,{weekday:"long",timeZone:t}),r=new Qe(e,{weekday:"short",timeZone:t}),o=new Qe(e,{weekday:"narrow",timeZone:t});return i=>{const s=i instanceof Date?i:i.toDate(t);return{value:i,short:r.format(s),long:n.format(s),narrow:o.format(s)}}}function A0(e,t,n,r){const o=vu(e,r,t),i=[...new Array(7).keys()],s=$0(r,n);return i.map(a=>s(o.add({days:a})))}function Mn(e){return co(e??Wi())}function M0(e){return e.add({days:1})}function I0(e){return e.subtract({days:1})}function L0(e,t){return e.set({month:t})}function R0(e,t){return e.set({year:t})}function ur(e,t,n,r){return function(i){const{startDate:s,focusedDate:a}=i,l=pu(s,e);return Rt(a,n,r)?{startDate:s,focusedDate:bt(a,n,r),endDate:l}:a.compare(s)<0?{startDate:os(a,e,t,n,r),focusedDate:bt(a,n,r),endDate:l}:a.compare(l)>0?{startDate:Gt(a,e,t,n,r),endDate:l,focusedDate:bt(a,n,r)}:{startDate:s,endDate:l,focusedDate:bt(a,n,r)}}}function wu(e,t,n,r,o,i){const s=ur(n,r,o,i),a=t.add(n);return s({focusedDate:e.add(n),startDate:Gt(cr(e,a,n,r,o,i),n,r)})}function xu(e,t,n,r,o,i){const s=ur(n,r,o,i);let a=t.subtract(n);return s({focusedDate:e.subtract(n),startDate:Gt(cr(e,a,n,r,o,i),n,r)})}function N0(e,t,n,r,o,i,s){const a=ur(r,o,i,s);if(!n&&!r.days)return a({focusedDate:e.add(ss(r)),startDate:t});if(r.days)return wu(e,t,r,o,i,s);if(r.weeks)return a({focusedDate:e.add({months:1}),startDate:t});if(r.months||r.years)return a({focusedDate:e.add({years:1}),startDate:t})}function F0(e,t,n,r,o,i,s){const a=ur(r,o,i,s);if(!n&&!r.days)return a({focusedDate:e.subtract(ss(r)),startDate:t});if(r.days)return xu(e,t,r,o,i,s);if(r.weeks)return a({focusedDate:e.subtract({months:1}),startDate:t});if(r.months||r.years)return a({focusedDate:e.subtract({years:1}),startDate:t})}var _0=e=>e!=null&&e.length===4,V0=e=>e!=null&&parseFloat(e)<=12,K0=e=>e!=null&&parseFloat(e)<=31;function Su(e,t,n){const r=z0(t,n);let{year:o,month:i,day:s}=B0(r,e)??{};if(o!=null||i!=null||s!=null){const c=new Date;o||(o=c.getFullYear().toString()),i||(i=(c.getMonth()+1).toString()),s||(s=c.getDate().toString())}if(_0(o)&&V0(i)&&K0(s))return new vt(+o,+i,+s);const l=Date.parse(e);if(!isNaN(l)){const c=new Date(l);return new vt(c.getFullYear(),c.getMonth()+1,c.getDate())}}function z0(e,t){return new Qe(e,{day:"numeric",month:"numeric",year:"numeric",timeZone:t}).formatToParts(new Date(2e3,11,25)).map(({type:o,value:i})=>o==="literal"?`${i}?`:`((?!=<${o}>)\\d+)?`).join("")}function B0(e,t){const n=t.match(e);return e.toString().match(/<(.+?)>/g)?.map(r=>{const o=r.match(/<(.+)>/);return!o||o.length<=0?null:r.match(/<(.+)>/)?.[1]}).reduce((r,o,i)=>(o&&(n&&n.length>i?r[o]=n[i+1]:r[o]=null),r),{})}function Eu(e,t,n){const r=Hc(n);switch(e){case"thisWeek":return[uo(r,t),qc(r,t)];case"thisMonth":return[Lt(r),r];case"thisQuarter":return[Lt(r).add({months:-r.month%3}),r];case"thisYear":return[Yi(r),r];case"last3Days":return[r.add({days:-2}),r];case"last7Days":return[r.add({days:-6}),r];case"last14Days":return[r.add({days:-13}),r];case"last30Days":return[r.add({days:-29}),r];case"last90Days":return[r.add({days:-89}),r];case"lastMonth":return[Lt(r.add({months:-1})),Hi(r.add({months:-1}))];case"lastQuarter":return[Lt(r.add({months:-r.month%3-3})),Hi(r.add({months:-r.month%3-1}))];case"lastWeek":return[uo(r,t).add({weeks:-1}),qc(r,t).add({weeks:-1})];case"lastYear":return[Yi(r.add({years:-1})),Uw(r.add({years:-1}))];default:throw new Error(`Invalid date range preset: ${e}`)}}var yo="__live-region__";function j0(e={}){const{level:t="polite",document:n=document,root:r,delay:o=0}=e,i=n.defaultView??window,s=r??n.body;function a(c,u){n.getElementById(yo)?.remove(),u=u??o;const f=n.createElement("span");f.id=yo,f.dataset.liveAnnouncer="true";const m=t!=="assertive"?"status":"alert";f.setAttribute("aria-live",t),f.setAttribute("role",m),Object.assign(f.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}),s.appendChild(f),i.setTimeout(()=>{f.textContent=c},u)}function l(){n.getElementById(yo)?.remove()}return{announce:a,destroy:l,toJSON(){return yo}}}var Pu=Zr("date-picker").parts("root","label","clearTrigger","content","control","input","monthSelect","nextTrigger","positioner","prevTrigger","rangeText","table","tableBody","tableCell","tableCellTrigger","tableHead","tableHeader","tableRow","trigger","viewTrigger","viewControl","yearSelect","presetTrigger"),ne=Pu.build(),K=nb({getLabelId:(e,t)=>e.ids?.label?.(t)??`datepicker:${e.id}:label:${t}`,getRootId:e=>e.ids?.root??`datepicker:${e.id}`,getTableId:(e,t)=>e.ids?.table?.(t)??`datepicker:${e.id}:table:${t}`,getTableHeaderId:(e,t)=>e.ids?.tableHeader?.(t)??`datepicker:${e.id}:thead`,getTableBodyId:(e,t)=>e.ids?.tableBody?.(t)??`datepicker:${e.id}:tbody`,getTableRowId:(e,t)=>e.ids?.tableRow?.(t)??`datepicker:${e.id}:tr:${t}`,getContentId:e=>e.ids?.content??`datepicker:${e.id}:content`,getCellTriggerId:(e,t)=>e.ids?.cellTrigger?.(t)??`datepicker:${e.id}:cell-trigger:${t}`,getPrevTriggerId:(e,t)=>e.ids?.prevTrigger?.(t)??`datepicker:${e.id}:prev:${t}`,getNextTriggerId:(e,t)=>e.ids?.nextTrigger?.(t)??`datepicker:${e.id}:next:${t}`,getViewTriggerId:(e,t)=>e.ids?.viewTrigger?.(t)??`datepicker:${e.id}:view:${t}`,getClearTriggerId:e=>e.ids?.clearTrigger??`datepicker:${e.id}:clear`,getControlId:e=>e.ids?.control??`datepicker:${e.id}:control`,getInputId:(e,t)=>e.ids?.input?.(t)??`datepicker:${e.id}:input:${t}`,getTriggerId:e=>e.ids?.trigger??`datepicker:${e.id}:trigger`,getPositionerId:e=>e.ids?.positioner??`datepicker:${e.id}:positioner`,getMonthSelectId:e=>e.ids?.monthSelect??`datepicker:${e.id}:month-select`,getYearSelectId:e=>e.ids?.yearSelect??`datepicker:${e.id}:year-select`,getFocusedCell:(e,t=e.view)=>tb(K.getContentEl(e),`[data-part=table-cell-trigger][data-view=${t}][data-focus]:not([data-outside-range])`),getTriggerEl:e=>K.getById(e,K.getTriggerId(e)),getContentEl:e=>K.getById(e,K.getContentId(e)),getInputEls:e=>eb(K.getControlEl(e),"[data-part=input]"),getYearSelectEl:e=>K.getById(e,K.getYearSelectId(e)),getMonthSelectEl:e=>K.getById(e,K.getMonthSelectId(e)),getClearTriggerEl:e=>K.getById(e,K.getClearTriggerId(e)),getPositionerEl:e=>K.getById(e,K.getPositionerId(e)),getControlEl:e=>K.getById(e,K.getControlId(e))});function as(e){const[t,n]=e;return!t||!n||t.compare(n)<=0?e:[n,t]}function Cu(e,t){const[n,r]=t;return!n||!r?!1:n.compare(e)<=0&&r.compare(e)>=0}function ls(e){return e.sort((t,n)=>t.compare(n))}function U0(e){return rr(e,{year:"calendar decade",month:"calendar year",day:"calendar month"})}var W0={day:"dd",month:"mm",year:"yyyy"};function H0(e){return new Qe(e).formatToParts(new Date).map(t=>W0[t.type]??t.value).join("")}var Ou=(e,t)=>e?/\d/.test(e)||e===t||e.length!==1:!0,Y0=(e,t)=>e.split("").filter(n=>Ou(n,t)).join("");function G0(e){const r=new Intl.DateTimeFormat(e).formatToParts(new Date).find(o=>o.type==="literal");return r?r.value:"/"}var q0={dayCell(e){return e.unavailable?`Not available. ${e.formattedDate}`:e.selected?`Selected date. ${e.formattedDate}`:`Choose ${e.formattedDate}`},trigger(e){return e?"Close calendar":"Open calendar"},viewTrigger(e){return rr(e,{year:"Switch to month view",month:"Switch to day view",day:"Switch to year view"})},presetTrigger(e){return Array.isArray(e)?`select ${e[0].toString()} to ${e[1].toString()}`:`select ${e}`},prevTrigger(e){return rr(e,{year:"Switch to previous decade",month:"Switch to previous year",day:"Switch to previous month"})},nextTrigger(e){return rr(e,{year:"Switch to next decade",month:"Switch to next year",day:"Switch to next month"})},placeholder(){return{day:"dd",month:"mm",year:"yyyy"}},content:"calendar",monthSelect:"Select month",yearSelect:"Select year",clearTrigger:"Clear selected dates"},Du=e=>e.toString().split("T")[0];function Z0(e,t,n){const r=e.context.startValue,o=e.context.endValue,i=e.context.value,s=e.context.focusedValue,a=e.context.hoveredValue,l=a?as([i[0],a]):[],c=e.context.disabled,u=e.context.readOnly,d=e.context.isInteractive,f=e.context.min,m=e.context.max,g=e.context.locale,p=e.context.timeZone,y=e.context.startOfWeek,v=e.matches("focused"),b=e.matches("open"),w=e.context.selectionMode==="range",x=e.context.isDateUnavailable,T=e.context.currentPlacement,O=yw({...e.context.positioning,placement:T}),k=G0(g);function j(E=r){const S=e.context.fixedWeeks?6:void 0;return k0(E,g,S,y)}function P(E={}){const{format:S}=E;return T0(g,S).map((C,W)=>({label:C,value:W+1}))}function M(){return mo(s.year).map(E=>({label:E.toString(),value:E}))}function $(E){return hu(E,x,g,f,m)}function R(E){const S=L0(r??Mn(p),E);t({type:"FOCUS.SET",value:S})}function se(E){const S=R0(r??Mn(p),E);t({type:"FOCUS.SET",value:S})}function J(E){const{value:S,disabled:C}=E,W=s.set({year:S}),be={focused:s.year===E.value,selectable:!Rt(W,f,m),selected:!!i.find(wt=>wt.year===S),valueText:S.toString(),get disabled(){return C||!be.selectable}};return be}function re(E){const{value:S,disabled:C}=E,W=s.set({month:S}),be=O0(g,p),wt={focused:s.month===E.value,selectable:!Rt(W,f,m),selected:!!i.find(G=>G.month===S&&G.year===s.year),valueText:be.format(W.toDate(p)),get disabled(){return C||!wt.selectable}};return wt}const N=e.context.translations||q0;function X(E){const{value:S,disabled:C,visibleRange:W=e.context.visibleRange}=E,be=yu(g,p),wt=ss(e.context.visibleDuration),G=W.start.add(wt).subtract({days:1}),Ee={invalid:Rt(S,f,m),disabled:C||x0(S,W.start,G,f,m),selected:i.some(dr=>qe(S,dr)),unavailable:hu(S,x,g,f,m)&&!C,outsideRange:is(S,W.start,G),inRange:w&&(Cu(S,i)||Cu(S,l)),firstInRange:w&&qe(S,i[0]),lastInRange:w&&qe(S,i[1]),today:w0(S,p),weekend:Gw(S,g),formattedDate:be.format(S.toDate(p)),get focused(){return qe(S,s)&&!Ee.outsideRange},get ariaLabel(){return N.dayCell(Ee)},get selectable(){return!Ee.disabled&&!Ee.unavailable}};return Ee}function ge(E){const{view:S="day",id:C}=E;return[S,C].filter(Boolean).join(" ")}return{focused:v,open:b,view:e.context.view,getRangePresetValue(E){return Eu(E,g,p)},getDaysInWeek(E,S=r){return bu(E,S,g,y)},getOffset(E){const S=r.add(E);return{visibleRange:{start:S,end:o.add(E)},weeks:j(S)}},getMonthWeeks:j,isUnavailable:$,weeks:j(),weekDays:A0(Mn(p),y,p,g),visibleRangeText:e.context.visibleRangeText,value:i,valueAsDate:i.map(E=>E.toDate(p)),valueAsString:i.map(Du),focusedValue:s,focusedValueAsDate:s?.toDate(p),focusedValueAsString:Du(s),visibleRange:e.context.visibleRange,selectToday(){const E=bt(Mn(p),f,m);t({type:"VALUE.SET",value:E})},setValue(E){const S=E.map(C=>bt(C,f,m));t({type:"VALUE.SET",value:S})},clearValue(){t("VALUE.CLEAR")},setFocusedValue(E){t({type:"FOCUS.SET",value:E})},setOpen(E){E!==b&&t(E?"OPEN":"CLOSE")},focusMonth:R,focusYear:se,getYears:M,getMonths:P,getYearsGrid(E={}){const{columns:S=1}=E;return bc(M(),S)},getDecade(){const E=mo(s.year);return{start:E.at(0),end:E.at(-1)}},getMonthsGrid(E={}){const{columns:S=1,format:C}=E;return bc(P({format:C}),S)},format(E,S={month:"long",year:"numeric"}){return new Qe(g,S).format(E.toDate(p))},setView(E){t({type:"VIEW.SET",cell:E})},goToNext(){t({type:"GOTO.NEXT",view:e.context.view})},goToPrev(){t({type:"GOTO.PREV",view:e.context.view})},getRootProps(){return n.element({...ne.root.attrs,dir:e.context.dir,id:K.getRootId(e.context),"data-state":b?"open":"closed","data-disabled":te(c),"data-readonly":te(u)})},getLabelProps(E={}){const{index:S=0}=E;return n.label({...ne.label.attrs,id:K.getLabelId(e.context,S),dir:e.context.dir,htmlFor:K.getInputId(e.context,S),"data-state":b?"open":"closed","data-index":S,"data-disabled":te(c),"data-readonly":te(u)})},getControlProps(){return n.element({...ne.control.attrs,dir:e.context.dir,id:K.getControlId(e.context),"data-disabled":te(c)})},getRangeTextProps(){return n.element({...ne.rangeText.attrs,dir:e.context.dir})},getContentProps(){return n.element({...ne.content.attrs,hidden:!b,dir:e.context.dir,"data-state":b?"open":"closed","data-placement":T,id:K.getContentId(e.context),role:"application","aria-roledescription":"datepicker","aria-label":N.content})},getTableProps(E={}){const{view:S="day",columns:C=S==="day"?7:4}=E,W=ge(E);return n.element({...ne.table.attrs,role:"grid","data-columns":C,"aria-roledescription":U0(S),id:K.getTableId(e.context,W),"aria-readonly":Se(u),"aria-disabled":Se(c),"aria-multiselectable":Se(e.context.selectionMode!=="single"),"data-view":S,dir:e.context.dir,tabIndex:-1,onKeyDown(be){if(be.defaultPrevented)return;const G={Enter(){$(s)||t({type:"TABLE.ENTER",view:S,columns:C,focus:!0})},ArrowLeft(){t({type:"TABLE.ARROW_LEFT",view:S,columns:C,focus:!0})},ArrowRight(){t({type:"TABLE.ARROW_RIGHT",view:S,columns:C,focus:!0})},ArrowUp(){t({type:"TABLE.ARROW_UP",view:S,columns:C,focus:!0})},ArrowDown(){t({type:"TABLE.ARROW_DOWN",view:S,columns:C,focus:!0})},PageUp(Ee){t({type:"TABLE.PAGE_UP",larger:Ee.shiftKey,view:S,columns:C,focus:!0})},PageDown(Ee){t({type:"TABLE.PAGE_DOWN",larger:Ee.shiftKey,view:S,columns:C,focus:!0})},Home(){t({type:"TABLE.HOME",view:S,columns:C,focus:!0})},End(){t({type:"TABLE.END",view:S,columns:C,focus:!0})}}[Sb(be,e.context)];G&&(G(be),be.preventDefault(),be.stopPropagation())},onPointerLeave(){t({type:"TABLE.POINTER_LEAVE"})},onPointerDown(){t({type:"TABLE.POINTER_DOWN",view:S})},onPointerUp(){t({type:"TABLE.POINTER_UP",view:S})}})},getTableHeadProps(E={}){const{view:S="day"}=E;return n.element({...ne.tableHead.attrs,"aria-hidden":!0,dir:e.context.dir,"data-view":S,"data-disabled":te(c)})},getTableHeaderProps(E={}){const{view:S="day"}=E;return n.element({...ne.tableHeader.attrs,dir:e.context.dir,"data-view":S,"data-disabled":te(c)})},getTableBodyProps(E={}){const{view:S="day"}=E;return n.element({...ne.tableBody.attrs,"data-view":S,"data-disabled":te(c)})},getTableRowProps(E={}){const{view:S="day"}=E;return n.element({...ne.tableRow.attrs,"aria-disabled":Se(c),"data-disabled":te(c),"data-view":S})},getDayTableCellState:X,getDayTableCellProps(E){const{value:S}=E,C=X(E);return n.element({...ne.tableCell.attrs,role:"gridcell","aria-disabled":Se(!C.selectable),"aria-selected":C.selected||C.inRange,"aria-invalid":Se(C.invalid),"aria-current":C.today?"date":void 0,"data-value":S.toString()})},getDayTableCellTriggerProps(E){const{value:S}=E,C=X(E);return n.element({...ne.tableCellTrigger.attrs,id:K.getCellTriggerId(e.context,S.toString()),role:"button",dir:e.context.dir,tabIndex:C.focused?0:-1,"aria-label":C.ariaLabel,"aria-disabled":Se(!C.selectable),"aria-invalid":Se(C.invalid),"data-disabled":te(!C.selectable),"data-selected":te(C.selected),"data-value":S.toString(),"data-view":"day","data-today":te(C.today),"data-focus":te(C.focused),"data-unavailable":te(C.unavailable),"data-range-start":te(C.firstInRange),"data-range-end":te(C.lastInRange),"data-in-range":te(C.inRange),"data-outside-range":te(C.outsideRange),"data-weekend":te(C.weekend),onClick(W){W.defaultPrevented||C.selectable&&t({type:"CELL.CLICK",cell:"day",value:S})},onPointerMove(W){if(W.pointerType==="touch"||!C.selectable)return;const be=W.currentTarget.ownerDocument.activeElement!==W.currentTarget;a&&zw(S,a)||t({type:"CELL.POINTER_MOVE",cell:"day",value:S,focus:be})}})},getMonthTableCellState:re,getMonthTableCellProps(E){const{value:S,columns:C}=E,W=re(E);return n.element({...ne.tableCell.attrs,dir:e.context.dir,colSpan:C,role:"gridcell","aria-selected":Se(W.selected),"data-selected":te(W.selected),"aria-disabled":Se(!W.selectable),"data-value":S})},getMonthTableCellTriggerProps(E){const{value:S}=E,C=re(E);return n.element({...ne.tableCellTrigger.attrs,dir:e.context.dir,role:"button",id:K.getCellTriggerId(e.context,S.toString()),"data-selected":te(C.selected),"aria-disabled":Se(!C.selectable),"data-disabled":te(!C.selectable),"data-focus":te(C.focused),"aria-label":C.valueText,"data-view":"month","data-value":S,tabIndex:C.focused?0:-1,onClick(W){W.defaultPrevented||C.selectable&&t({type:"CELL.CLICK",cell:"month",value:S})}})},getYearTableCellState:J,getYearTableCellProps(E){const{value:S,columns:C}=E,W=J(E);return n.element({...ne.tableCell.attrs,dir:e.context.dir,colSpan:C,role:"gridcell","aria-selected":Se(W.selected),"data-selected":te(W.selected),"aria-disabled":Se(!W.selectable),"data-value":S})},getYearTableCellTriggerProps(E){const{value:S}=E,C=J(E);return n.element({...ne.tableCellTrigger.attrs,dir:e.context.dir,role:"button",id:K.getCellTriggerId(e.context,S.toString()),"data-selected":te(C.selected),"data-focus":te(C.focused),"aria-disabled":Se(!C.selectable),"data-disabled":te(!C.selectable),"aria-label":C.valueText,"data-value":S,"data-view":"year",tabIndex:C.focused?0:-1,onClick(W){W.defaultPrevented||C.selectable&&t({type:"CELL.CLICK",cell:"year",value:S})}})},getNextTriggerProps(E={}){const{view:S="day"}=E,C=c||!e.context.isNextVisibleRangeValid;return n.button({...ne.nextTrigger.attrs,dir:e.context.dir,id:K.getNextTriggerId(e.context,S),type:"button","aria-label":N.nextTrigger(S),disabled:C,"data-disabled":te(C),onClick(W){W.defaultPrevented||t({type:"GOTO.NEXT",view:S})}})},getPrevTriggerProps(E={}){const{view:S="day"}=E,C=c||!e.context.isPrevVisibleRangeValid;return n.button({...ne.prevTrigger.attrs,dir:e.context.dir,id:K.getPrevTriggerId(e.context,S),type:"button","aria-label":N.prevTrigger(S),disabled:C,"data-disabled":te(C),onClick(W){W.defaultPrevented||t({type:"GOTO.PREV",view:S})}})},getClearTriggerProps(){return n.button({...ne.clearTrigger.attrs,id:K.getClearTriggerId(e.context),dir:e.context.dir,type:"button","aria-label":N.clearTrigger,hidden:!e.context.value.length,onClick(E){E.defaultPrevented||t("VALUE.CLEAR")}})},getTriggerProps(){return n.button({...ne.trigger.attrs,id:K.getTriggerId(e.context),dir:e.context.dir,type:"button","data-placement":T,"aria-label":N.trigger(b),"aria-controls":K.getContentId(e.context),"data-state":b?"open":"closed","aria-haspopup":"grid",disabled:c,onClick(E){E.defaultPrevented||d&&t("TRIGGER.CLICK")}})},getViewTriggerProps(E={}){const{view:S="day"}=E;return n.button({...ne.viewTrigger.attrs,"data-view":S,dir:e.context.dir,id:K.getViewTriggerId(e.context,S),type:"button",disabled:c,"aria-label":N.viewTrigger(S),onClick(C){C.defaultPrevented||d&&t("VIEW.CHANGE")}})},getViewControlProps(E={}){const{view:S="day"}=E;return n.element({...ne.viewControl.attrs,"data-view":S,dir:e.context.dir})},getInputProps(E={}){const{index:S=0}=E;return n.input({...ne.input.attrs,id:K.getInputId(e.context,S),autoComplete:"off",autoCorrect:"off",spellCheck:"false",dir:e.context.dir,name:e.context.name,"data-index":S,"data-state":b?"open":"closed",readOnly:u,disabled:c,placeholder:H0(g),defaultValue:e.context.formattedValue[S],onBeforeInput(C){const{data:W}=Eb(C);Ou(W,k)||C.preventDefault()},onFocus(){t({type:"INPUT.FOCUS",index:S})},onBlur(C){t({type:"INPUT.BLUR",value:C.currentTarget.value,index:S})},onKeyDown(C){C.defaultPrevented||d&&(qv(C)||C.key==="Enter"&&($(e.context.focusedValue)||(t({type:"INPUT.ENTER",value:C.currentTarget.value,index:S}),C.preventDefault())))},onChange(C){const{value:W}=C.target;t({type:"INPUT.CHANGE",value:Y0(W,k),index:S})}})},getMonthSelectProps(){return n.select({...ne.monthSelect.attrs,id:K.getMonthSelectId(e.context),"aria-label":N.monthSelect,disabled:c,dir:e.context.dir,defaultValue:r.month,onChange(E){R(Number(E.currentTarget.value))}})},getYearSelectProps(){return n.select({...ne.yearSelect.attrs,id:K.getYearSelectId(e.context),disabled:c,"aria-label":N.yearSelect,dir:e.context.dir,defaultValue:r.year,onChange(E){se(Number(E.currentTarget.value))}})},getPositionerProps(){return n.element({id:K.getPositionerId(e.context),...ne.positioner.attrs,dir:e.context.dir,style:O.floating})},getPresetTriggerProps(E){const S=Array.isArray(E.value)?E.value:Eu(E.value,g,p),C=S.map(W=>W.toDate(p).toDateString());return n.button({...ne.presetTrigger.attrs,"aria-label":N.presetTrigger(C),type:"button",onClick(W){W.defaultPrevented||t({type:"PRESET.CLICK",value:S})}})}}}var{and:Ke}=gv,X0=e=>{const t=e.locale||"en-US",n=e.timeZone||"UTC",r=e.selectionMode||"single",o=e.numOfMonths||1,i=ls(e.value||[]).map(l=>bt(l,e.min,e.max));let s=i[0]||e.focusedValue||Mn(n);s=bt(s,e.min,e.max);const a=gu(s,"start",{months:o},t);return{locale:t,numOfMonths:o,focusedValue:s,startValue:a,timeZone:n,value:i,selectionMode:r,view:"day",activeIndex:0,hoveredValue:null,closeOnSelect:!0,disabled:!1,readOnly:!1,...e,positioning:{placement:"bottom",...e.positioning}}};function J0(e){const t=Li(e);return uc({id:"datepicker",initial:t.open?"open":"idle",context:X0(t),computed:{valueAsString:n=>n.value.map(r=>C0(r,null,n.locale,n.timeZone)),isInteractive:n=>!n.disabled&&!n.readOnly,visibleDuration:n=>({months:n.numOfMonths}),endValue:n=>pu(n.startValue,n.visibleDuration),visibleRange:n=>({start:n.startValue,end:n.endValue}),visibleRangeText(n){const r=new Qe(n.locale,{month:"long",year:"numeric",timeZone:n.timeZone}),o=r.format(n.startValue.toDate(n.timeZone)),i=r.format(n.endValue.toDate(n.timeZone)),s=n.selectionMode==="range"?`${o} - ${i}`:o;return{start:o,end:i,formatted:s}},isPrevVisibleRangeValid:n=>!S0(n.startValue,n.min,n.max),isNextVisibleRangeValid:n=>!E0(n.endValue,n.min,n.max),formattedValue(n){const r={timeZone:n.timeZone,day:"2-digit",month:"2-digit",year:"numeric"},o=new Qe(n.locale,r);return n.value.map(i=>n.format?.(i)??o.format(i.toDate(n.timeZone)))}},activities:["setupLiveRegion"],created:["setStartValue"],watch:{locale:["setStartValue"],focusedValue:["setStartValue","syncMonthSelectElement","syncYearSelectElement","focusActiveCellIfNeeded","setHoveredValueIfKeyboard"],value:["syncInputElement"],valueAsString:["announceValueText"],view:["focusActiveCell"],open:["toggleVisibility"]},on:{"VALUE.SET":{actions:["setDateValue","setFocusedDate"]},"VIEW.SET":{actions:["setView"]},"FOCUS.SET":{actions:["setFocusedDate"]},"VALUE.CLEAR":{actions:["clearDateValue","clearFocusedDate","focusFirstInputElement"]},"INPUT.CHANGE":{actions:["focusParsedDate"]},"INPUT.ENTER":{actions:["focusParsedDate","selectFocusedDate"]},"INPUT.FOCUS":{actions:["setActiveIndex"]},"INPUT.BLUR":{actions:["setActiveIndexToStart","selectParsedDate"]},"PRESET.CLICK":[{guard:"isOpenControlled",actions:["setDateValue","setFocusedDate","invokeOnClose"]},{target:"focused",actions:["setDateValue","setFocusedDate","focusInputElement"]}],"GOTO.NEXT":[{guard:"isYearView",actions:["focusNextDecade","announceVisibleRange"]},{guard:"isMonthView",actions:["focusNextYear","announceVisibleRange"]},{actions:["focusNextPage"]}],"GOTO.PREV":[{guard:"isYearView",actions:["focusPreviousDecade","announceVisibleRange"]},{guard:"isMonthView",actions:["focusPreviousYear","announceVisibleRange"]},{actions:["focusPreviousPage"]}]},states:{idle:{tags:"closed",on:{"CONTROLLED.OPEN":{target:"open",actions:["focusFirstSelectedDate","focusActiveCell"]},"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["focusFirstSelectedDate","focusActiveCell","invokeOnOpen"]}],OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["focusFirstSelectedDate","focusActiveCell","invokeOnOpen"]}]}},focused:{tags:"closed",on:{"CONTROLLED.OPEN":{target:"open",actions:["focusFirstSelectedDate","focusActiveCell"]},"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["focusFirstSelectedDate","focusActiveCell","invokeOnOpen"]}],OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["focusFirstSelectedDate","focusActiveCell","invokeOnOpen"]}]}},open:{tags:"open",activities:["trackDismissableElement","trackPositioning"],exit:["clearHoveredDate","resetView"],on:{"CONTROLLED.CLOSE":[{guard:Ke("shouldRestoreFocus","isInteractOutsideEvent"),target:"focused",actions:["focusTriggerElement"]},{guard:"shouldRestoreFocus",target:"focused",actions:["focusInputElement"]},{target:"idle"}],"CELL.CLICK":[{guard:"isMonthView",actions:["setFocusedMonth","setViewToDay"]},{guard:"isYearView",actions:["setFocusedYear","setViewToMonth"]},{guard:Ke("isRangePicker","hasSelectedRange"),actions:["setActiveIndexToStart","clearDateValue","setFocusedDate","setSelectedDate","setActiveIndexToEnd"]},{guard:Ke("isRangePicker","isSelectingEndDate","closeOnSelect","isOpenControlled"),actions:["setFocusedDate","setSelectedDate","setActiveIndexToStart","invokeOnClose","setRestoreFocus"]},{guard:Ke("isRangePicker","isSelectingEndDate","closeOnSelect"),target:"focused",actions:["setFocusedDate","setSelectedDate","setActiveIndexToStart","invokeOnClose","focusInputElement"]},{guard:Ke("isRangePicker","isSelectingEndDate"),actions:["setFocusedDate","setSelectedDate","setActiveIndexToStart","clearHoveredDate"]},{guard:"isRangePicker",actions:["setFocusedDate","setSelectedDate","setActiveIndexToEnd"]},{guard:"isMultiPicker",actions:["setFocusedDate","toggleSelectedDate"]},{guard:Ke("closeOnSelect","isOpenControlled"),actions:["setFocusedDate","setSelectedDate","invokeOnClose"]},{guard:"closeOnSelect",target:"focused",actions:["setFocusedDate","setSelectedDate","invokeOnClose","focusInputElement"]},{actions:["setFocusedDate","setSelectedDate"]}],"CELL.POINTER_MOVE":{guard:Ke("isRangePicker","isSelectingEndDate"),actions:["setHoveredDate","setFocusedDate"]},"TABLE.POINTER_LEAVE":{guard:"isRangePicker",actions:["clearHoveredDate"]},"TABLE.POINTER_DOWN":{actions:["disableTextSelection"]},"TABLE.POINTER_UP":{actions:["enableTextSelection"]},"TABLE.ESCAPE":[{guard:"isOpenControlled",actions:["focusFirstSelectedDate","invokeOnClose"]},{target:"focused",actions:["focusFirstSelectedDate","invokeOnClose","focusTriggerElement"]}],"TABLE.ENTER":[{guard:"isMonthView",actions:"setViewToDay"},{guard:"isYearView",actions:"setViewToMonth"},{guard:Ke("isRangePicker","hasSelectedRange"),actions:["setActiveIndexToStart","clearDateValue","setSelectedDate","setActiveIndexToEnd"]},{guard:Ke("isRangePicker","isSelectingEndDate","closeOnSelect","isOpenControlled"),actions:["setSelectedDate","setActiveIndexToStart","invokeOnClose"]},{guard:Ke("isRangePicker","isSelectingEndDate","closeOnSelect"),target:"focused",actions:["setSelectedDate","setActiveIndexToStart","invokeOnClose","focusInputElement"]},{guard:Ke("isRangePicker","isSelectingEndDate"),actions:["setSelectedDate","setActiveIndexToStart"]},{guard:"isRangePicker",actions:["setSelectedDate","setActiveIndexToEnd","focusNextDay"]},{guard:"isMultiPicker",actions:["toggleSelectedDate"]},{guard:Ke("closeOnSelect","isOpenControlled"),actions:["selectFocusedDate","invokeOnClose"]},{guard:"closeOnSelect",target:"focused",actions:["selectFocusedDate","invokeOnClose","focusInputElement"]},{actions:["selectFocusedDate"]}],"TABLE.ARROW_RIGHT":[{guard:"isMonthView",actions:"focusNextMonth"},{guard:"isYearView",actions:"focusNextYear"},{actions:["focusNextDay","setHoveredDate"]}],"TABLE.ARROW_LEFT":[{guard:"isMonthView",actions:"focusPreviousMonth"},{guard:"isYearView",actions:"focusPreviousYear"},{actions:["focusPreviousDay"]}],"TABLE.ARROW_UP":[{guard:"isMonthView",actions:"focusPreviousMonthColumn"},{guard:"isYearView",actions:"focusPreviousYearColumn"},{actions:["focusPreviousWeek"]}],"TABLE.ARROW_DOWN":[{guard:"isMonthView",actions:"focusNextMonthColumn"},{guard:"isYearView",actions:"focusNextYearColumn"},{actions:["focusNextWeek"]}],"TABLE.PAGE_UP":{actions:["focusPreviousSection"]},"TABLE.PAGE_DOWN":{actions:["focusNextSection"]},"TABLE.HOME":[{guard:"isMonthView",actions:["focusFirstMonth"]},{guard:"isYearView",actions:["focusFirstYear"]},{actions:["focusSectionStart"]}],"TABLE.END":[{guard:"isMonthView",actions:["focusLastMonth"]},{guard:"isYearView",actions:["focusLastYear"]},{actions:["focusSectionEnd"]}],"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"focused",actions:["invokeOnClose"]}],"VIEW.CHANGE":[{guard:"isDayView",actions:["setViewToMonth"]},{guard:"isMonthView",actions:["setViewToYear"]}],INTERACT_OUTSIDE:[{guard:"isOpenControlled",actions:["setActiveIndexToStart","invokeOnClose"]},{guard:"shouldRestoreFocus",target:"focused",actions:["setActiveIndexToStart","invokeOnClose","focusTriggerElement"]},{target:"idle",actions:["setActiveIndexToStart","invokeOnClose"]}],CLOSE:[{guard:"isOpenControlled",actions:["setActiveIndexToStart","invokeOnClose"]},{target:"idle",actions:["setActiveIndexToStart","invokeOnClose"]}]}}}},{guards:{isDayView:(n,r)=>(r.view||n.view)==="day",isMonthView:(n,r)=>(r.view||n.view)==="month",isYearView:(n,r)=>(r.view||n.view)==="year",isRangePicker:n=>n.selectionMode==="range",hasSelectedRange:n=>n.value.length===2,isMultiPicker:n=>n.selectionMode==="multiple",shouldRestoreFocus:n=>!!n.restoreFocus,isSelectingEndDate:n=>n.activeIndex===1,closeOnSelect:n=>!!n.closeOnSelect,isOpenControlled:n=>!!n["open.controlled"],isInteractOutsideEvent:(n,r)=>r.previousEvent?.type==="INTERACT_OUTSIDE"},activities:{trackPositioning(n){n.currentPlacement=n.positioning.placement;const r=K.getControlEl(n);return pw(r,()=>K.getPositionerEl(n),{...n.positioning,defer:!0,onComplete(i){n.currentPlacement=i.placement}})},setupLiveRegion(n){const r=K.getDoc(n);return n.announcer=j0({level:"assertive",document:r}),()=>n.announcer?.destroy?.()},trackDismissableElement(n,r,{send:o}){return kw(()=>K.getContentEl(n),{defer:!0,exclude:[...K.getInputEls(n),K.getTriggerEl(n),K.getClearTriggerEl(n)],onInteractOutside(s){n.restoreFocus=!s.detail.focusable},onDismiss(){o({type:"INTERACT_OUTSIDE"})},onEscapeKeyDown(s){s.preventDefault(),o({type:"TABLE.ESCAPE",src:"dismissable"})}})}},actions:{setViewToDay(n){H.view(n,"day")},setViewToMonth(n){H.view(n,"month")},setViewToYear(n){H.view(n,"year")},setView(n,r){H.view(n,r.cell)},setRestoreFocus(n){n.restoreFocus=!0},announceValueText(n){n.announcer?.announce(n.valueAsString.join(","),3e3)},announceVisibleRange(n){const{formatted:r}=n.visibleRangeText;n.announcer?.announce(r)},disableTextSelection(n){bb({target:K.getContentEl(n),doc:K.getDoc(n)})},enableTextSelection(n){Sc({doc:K.getDoc(n),target:K.getContentEl(n)})},focusFirstSelectedDate(n){n.value.length&&H.focusedValue(n,n.value[0])},syncInputElement(n){Ve(()=>{K.getInputEls(n).forEach((o,i)=>{K.setValue(o,n.formattedValue[i]||"")})})},setFocusedDate(n,r){const o=Array.isArray(r.value)?r.value[0]:r.value;H.focusedValue(n,o)},setFocusedMonth(n,r){H.focusedValue(n,n.focusedValue.set({month:r.value}))},focusNextMonth(n){H.focusedValue(n,n.focusedValue.add({months:1}))},focusPreviousMonth(n){H.focusedValue(n,n.focusedValue.subtract({months:1}))},setFocusedYear(n,r){H.focusedValue(n,n.focusedValue.set({year:r.value}))},setDateValue(n,r){if(!Array.isArray(r.value))return;const o=r.value.map(i=>bt(i,n.min,n.max));H.value(n,o)},clearDateValue(n){H.value(n,[])},setSelectedDate(n,r){const o=Array.from(n.value);o[n.activeIndex]=r.value??n.focusedValue,H.value(n,as(o))},toggleSelectedDate(n,r){const o=r.value??n.focusedValue,i=n.value.findIndex(s=>qe(s,o));if(i===-1){const s=[...n.value,o];H.value(n,ls(s))}else{const s=Array.from(n.value);s.splice(i,1),H.value(n,ls(s))}},setHoveredDate(n,r){n.hoveredValue=r.value},clearHoveredDate(n){n.hoveredValue=null},selectFocusedDate(n){const r=Array.from(n.value);r[n.activeIndex]=n.focusedValue.copy(),H.value(n,as(r))},setPreviousDate(n){H.focusedValue(n,I0(n.focusedValue))},setNextDate(n){H.focusedValue(n,M0(n.focusedValue))},focusPreviousDay(n){H.focusedValue(n,n.focusedValue.subtract({days:1}))},focusNextDay(n){H.focusedValue(n,n.focusedValue.add({days:1}))},focusPreviousWeek(n){H.focusedValue(n,n.focusedValue.subtract({weeks:1}))},focusNextWeek(n){H.focusedValue(n,n.focusedValue.add({weeks:1}))},focusNextPage(n){const r=wu(n.focusedValue,n.startValue,n.visibleDuration,n.locale,n.min,n.max);H.adjustedValue(n,r)},focusPreviousPage(n){const r=xu(n.focusedValue,n.startValue,n.visibleDuration,n.locale,n.min,n.max);H.adjustedValue(n,r)},focusSectionStart(n){H.focusedValue(n,n.startValue.copy())},focusSectionEnd(n){H.focusedValue(n,n.endValue.copy())},focusNextSection(n,r){const o=N0(n.focusedValue,n.startValue,r.larger,n.visibleDuration,n.locale,n.min,n.max);o&&H.adjustedValue(n,o)},focusPreviousSection(n,r){const o=F0(n.focusedValue,n.startValue,r.larger,n.visibleDuration,n.locale,n.min,n.max);o&&H.adjustedValue(n,o)},focusNextYear(n){H.focusedValue(n,n.focusedValue.add({years:1}))},focusPreviousYear(n){H.focusedValue(n,n.focusedValue.subtract({years:1}))},focusNextDecade(n){H.focusedValue(n,n.focusedValue.add({years:10}))},focusPreviousDecade(n){H.focusedValue(n,n.focusedValue.subtract({years:10}))},clearFocusedDate(n){H.focusedValue(n,Mn(n.timeZone))},focusPreviousMonthColumn(n,r){H.focusedValue(n,n.focusedValue.subtract({months:r.columns}))},focusNextMonthColumn(n,r){H.focusedValue(n,n.focusedValue.add({months:r.columns}))},focusPreviousYearColumn(n,r){H.focusedValue(n,n.focusedValue.subtract({years:r.columns}))},focusNextYearColumn(n,r){H.focusedValue(n,n.focusedValue.add({years:r.columns}))},focusFirstMonth(n){H.focusedValue(n,n.focusedValue.set({month:0}))},focusLastMonth(n){H.focusedValue(n,n.focusedValue.set({month:12}))},focusFirstYear(n){const r=mo(n.focusedValue.year);H.focusedValue(n,n.focusedValue.set({year:r.at(0)}))},focusLastYear(n){const r=mo(n.focusedValue.year);H.focusedValue(n,n.focusedValue.set({year:r.at(-1)}))},setActiveIndex(n,r){n.activeIndex=r.index},setActiveIndexToEnd(n){n.activeIndex=1},setActiveIndexToStart(n){n.activeIndex=0},focusActiveCell(n){Ve(()=>{K.getFocusedCell(n)?.focus({preventScroll:!0})})},focusActiveCellIfNeeded(n,r){r.focus&&Ve(()=>{K.getFocusedCell(n)?.focus({preventScroll:!0})})},setHoveredValueIfKeyboard(n,r){!r.type.startsWith("TABLE.ARROW")||n.selectionMode!=="range"||n.activeIndex===0||(n.hoveredValue=n.focusedValue.copy())},focusTriggerElement(n){Ve(()=>{K.getTriggerEl(n)?.focus({preventScroll:!0})})},focusFirstInputElement(n){Ve(()=>{K.getInputEls(n)[0]?.focus({preventScroll:!0})})},focusInputElement(n){Ve(()=>{const r=K.getInputEls(n),o=r.findLastIndex(a=>a.value!==""),i=Math.max(o,0),s=r[i];s?.focus({preventScroll:!0}),s?.setSelectionRange(s.value.length,s.value.length)})},syncMonthSelectElement(n){const r=K.getMonthSelectEl(n);r&&(r.value=n.startValue.month.toString())},syncYearSelectElement(n){const r=K.getYearSelectEl(n);r&&(r.value=n.startValue.year.toString())},focusParsedDate(n,r){if(r.index==null)return;const o=Su(r.value,n.locale,n.timeZone);o&&H.focusedValue(n,o)},selectParsedDate(n,r){if(r.index==null)return;const o=Su(r.value,n.locale,n.timeZone);if(!o)return;const i=Array.from(n.value);i[r.index]=o,H.value(n,i)},resetView(n,r,{initialContext:o}){H.view(n,o.view)},setStartValue(n){if(!is(n.focusedValue,n.startValue,n.endValue))return;const o=gu(n.focusedValue,"start",{months:n.numOfMonths},n.locale);n.startValue=o},invokeOnOpen(n){n.onOpenChange?.({open:!0})},invokeOnClose(n){n.onOpenChange?.({open:!1})},toggleVisibility(n,r,{send:o}){o({type:n.open?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:r})}},compareFns:{startValue:qe,endValue:qe,focusedValue:qe,value:ku}})}var vo={change(e){const t=Array.from(e.value),n=t.map(r=>r.toString());e.onValueChange?.({value:t,valueAsString:n,view:e.view})},focusChange(e){const t=Array.from(e.value),n=t.map(r=>r.toString());e.onFocusChange?.({focusedValue:e.focusedValue,value:t,valueAsString:n,view:e.view})},viewChange(e){e.onViewChange?.({view:e.view})}},ku=(e,t)=>e.length!==t.length?!1:e.every((n,r)=>qe(n,t[r])),H={value(e,t){ku(e.value,t)||(e.value=t,vo.change(e))},focusedValue(e,t){if(!t||qe(e.focusedValue,t))return;const r=ur(e.visibleDuration,e.locale,e.min,e.max)({focusedDate:t,startDate:e.startValue});e.startValue=r.startDate,e.focusedValue=r.focusedDate,vo.focusChange(e)},adjustedValue(e,t){e.startValue=t.startDate,!qe(e.focusedValue,t.focusedDate)&&(e.focusedValue=t.focusedDate,vo.focusChange(e))},view(e,t){Ii(e.view,t)||(e.view=t,vo.viewChange(e))}};function In(e){return Array.isArray(e)?e.map(t=>In(t)):e instanceof Date?new vt(e.getFullYear(),e.getMonth()+1,e.getDate()):l0(e)}jt()(["closeOnSelect","dir","disabled","fixedWeeks","focusedValue","format","getRootNode","id","ids","isDateUnavailable","isDateUnavailable","locale","max","min","modal","name","numOfMonths","onFocusChange","onOpenChange","onValueChange","onViewChange","open","open.controlled","positioning","readOnly","selectionMode","startOfWeek","timeZone","translations","value","view"]),jt()(["index"]),jt()(["value"]),jt()(["columns","id","view"]),jt()(["disabled","value","columns"]),jt()(["view"]);const Q0=e=>{const t=yb(),n=mb(),r=Le(),o=A(()=>({id:r,dir:t().dir,getRootNode:n().getRootNode,"open.controlled":e.open!==void 0,open:e.defaultOpen,...e,focusedValue:e.focusedValue?In(e.focusedValue):void 0,value:e.value?In(e.value):e.defaultValue?In(e.defaultValue):void 0,max:e.max?In(e.max):void 0,min:e.min?In(e.min):void 0})),[i,s]=hc(J0(o()),{context:o});return A(()=>Z0(i,s,kv))},ex=e=>{const[t,n]=Pb(e),[r,o]=xn()(n,["closeOnSelect","defaultOpen","defaultValue","disabled","fixedWeeks","focusedValue","format","id","ids","isDateUnavailable","isDateUnavailable","locale","max","min","modal","name","numOfMonths","onFocusChange","onOpenChange","onValueChange","onViewChange","open","positioning","readOnly","selectionMode","startOfWeek","timeZone","translations","value","view"]),i=Q0(r),s=Db(ce(t,()=>({present:i().open}))),a=ce(()=>i().getRootProps(),o);return h(Tw,{value:i,get children(){return h(kb,{value:s,get children(){return h(de.div,a)}})}})},[tx,bo]=$t({hookName:"useDatePickerTableContext",providerName:"<DatePickerTableProvider />"}),nx=e=>{const[{columns:t},n]=xn()(e,["columns"]),r=fe(),o=Wt(),i={columns:t,id:Le(),...o},s=ce(()=>r().getTableProps(i),n);return h(tx,{value:i,get children(){return h(de.table,s)}})},rx=e=>{const t=fe(),n=bo(),r=ce(()=>t().getTableBodyProps(n),e);return h(de.tbody,r)},[ox,ix]=$t({hookName:"useDatePickerTableCellContext",providerName:"<DatePickerTableCellProvider />"}),sx=e=>{const[t,n]=xn()(e,["disabled","value","visibleRange","columns"]),r=fe(),o=Wt(),i=A(()=>{const l={day:r().getDayTableCellProps,month:r().getMonthTableCellProps,year:r().getYearTableCellProps}[o.view];return l(t)}),s=ce(i,n);return h(ox,{value:t,get children(){return h(de.td,s)}})},ax=e=>{const t=fe(),n=ix(),r=Wt(),o=A(()=>{const a={day:t().getDayTableCellTriggerProps,month:t().getMonthTableCellTriggerProps,year:t().getYearTableCellTriggerProps}[r.view];return a(n)}),i=ce(o,e);return h(de.div,i)},lx=e=>{const t=fe(),n=bo(),r=ce(()=>t().getTableHeadProps(n),e);return h(de.thead,r)},cx=e=>{const t=fe(),n=bo(),r=ce(()=>t().getTableHeaderProps(n),e);return h(de.th,r)},ux=e=>{const t=fe(),n=bo(),r=ce(()=>t().getTableRowProps(n),e);return h(de.tr,r)},dx=e=>{const t=fe(),n=ce(()=>t().getTriggerProps(),e);return h(de.button,n)},fx=Pu.extendWith("view"),gx=e=>{const[t,n]=xn()(e,["view"]),r=fe(),o=ce(()=>fx.build().view.attrs,n);return h(Iw,{value:t,get children(){return h(de.div,I(o,{get hidden(){return r().view!==t.view}}))}})},hx=e=>{const t=fe(),n=Wt(),r=ce(()=>t().getViewControlProps(n),e);return h(de.div,r)},px=e=>{const t=fe(),n=Wt(),r=ce(()=>t().getViewTriggerProps(n),e);return h(de.button,r)};var mx=B('<svg xmlns=http://www.w3.org/2000/svg class="h-4 w-4"viewBox="0 0 24 24"><path fill=none stroke=currentColor stroke-linecap=round stroke-linejoin=round stroke-width=2 d="m15 6l-6 6l6 6"></path><title>Previous'),yx=B('<svg xmlns=http://www.w3.org/2000/svg class="h-4 w-4"viewBox="0 0 24 24"><path fill=none stroke=currentColor stroke-linecap=round stroke-linejoin=round stroke-width=2 d="m9 6l6 6l-6 6"></path><title>Next'),vx=B('<svg xmlns=http://www.w3.org/2000/svg class="mx-1 h-5 w-5"viewBox="0 0 24 24"><path fill=none stroke=currentColor stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M4 7a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm12-4v4M8 3v4m-4 4h16m-9 4h1m0 0v3"></path><title>Calendar');const bx=lx,cs=rx,us=Aw,wx=e=>h(ex,I({format:t=>{const n=new Date(Date.parse(t.toString())),r=new Date(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate());return new Intl.DateTimeFormat(e.locale||"pt-BR",{dateStyle:"long"}).format(r)}},e)),ds=e=>{const[t,n]=U(e,["class"]);return h(gx,I({get class(){return le("space-y-4",t.class)}},n))},fs=e=>{const[t,n]=U(e,["class","children"]);return h(hx,I({get class(){return le("flex items-center justify-between",t.class)}},n,{get children(){return[h(Nw,{get class(){return le(jn({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100")},get children(){return mx()}}),A(()=>t.children),h(Lw,{get class(){return le(jn({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100")},get children(){return yx()}})]}}))},gs=e=>{const[t,n]=U(e,["class"]);return h(Fw,I({get class(){return le("text-sm font-medium",t.class)}},n))},hs=e=>{const[t,n]=U(e,["class"]);return h(nx,I({get class(){return le("w-full border-collapse space-y-1",t.class)}},n))},wo=e=>{const[t,n]=U(e,["class"]);return h(ux,I({get class(){return le("mt-2 flex w-full",t.class)}},n))},xx=e=>{const[t,n]=U(e,["class"]);return h(cx,I({get class(){return le("w-8 flex-1 text-[0.8rem] font-normal text-muted-foreground",t.class)}},n))},ps=e=>{const[t,n]=U(e,["class"]);return h(sx,I({get class(){return le("flex-1 p-0 text-center text-sm","has-[[data-in-range]]:bg-accent has-[[data-in-range]]:first-of-type:rounded-l-md has-[[data-in-range]]:last-of-type:rounded-r-md","has-[[data-range-end]]:rounded-r-md has-[[data-range-start]]:rounded-l-md","has-[[data-outside-range][data-in-range]]:bg-accent/50",t.class)}},n))},ms=e=>{const[t,n]=U(e,["class"]);return h(ax,I({get class(){return le(jn({variant:"ghost"}),"size-8 w-full p-0 font-normal data-[selected]:opacity-100","data-[today]:bg-accent data-[today]:text-accent-foreground","[&:is([data-today][data-selected])]:bg-primary [&:is([data-today][data-selected])]:text-primary-foreground","data-[selected]:bg-primary data-[selected]:text-primary-foreground data-[selected]:hover:bg-primary data-[selected]:hover:text-primary-foreground","data-[disabled]:text-muted-foreground data-[disabled]:opacity-50","data-[outside-range]:text-muted-foreground data-[outside-range]:opacity-50","[&:is([data-outside-range][data-in-range])]:bg-accent/50 [&:is([data-outside-range][data-in-range])]:text-muted-foreground [&:is([data-outside-range][data-in-range])]:opacity-30",t.class)}},n))},ys=e=>{const[t,n]=U(e,["class"]);return h(px,I({get class(){return le(jn({variant:"ghost"}),"h-7",t.class)}},n))},Sx=e=>{const[t,n]=U(e,["class","children"]);return h(Io,{get mount(){return Bn()},get children(){return h(Rw,{get children(){return h($w,I({get class(){return le("rounded-md border bg-popover p-3 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",t.class)}},n,{get children(){return t.children}}))}})}})},Ex=()=>h(Mw,{get children(){return h(dx,{class:"transition-shadow focus-visible:outline-none focus-visible:ring-[1.5px] focus-visible:ring-ring",get children(){return h(Ce,{variant:"outline",get children(){return vx()}})}})}});var Px=B('<div class="flex flex-col space-y-2"><div>');const Cx=({text:e})=>{const[t,n]=L(!1);return(()=>{var r=Px(),o=r.firstChild;return F(r,h(zt,{get children(){return e?.trim()}}),o),F(o,h(wx,{onValueChange:i=>console.log(i),get children(){return[h(Ex,{}),h(Sx,{get children(){return[h(ds,{view:"day",get children(){return h(us,{children:i=>[h(fs,{get children(){return h(ys,{get children(){return h(gs,{})}})}}),h(hs,{get children(){return[h(bx,{get children(){return h(wo,{get children(){return h(_t,{get each(){return i().weekDays},children:s=>h(xx,{get children(){return s().short}})})}})}}),h(cs,{get children(){return h(_t,{get each(){return i().weeks},children:s=>h(wo,{get children(){return h(_t,{get each(){return s()},children:a=>h(ps,{get value(){return a()},get children(){return h(ms,{get children(){return a().day}})}})})}})})}})]}})]})}}),h(ds,{view:"month",class:"w-[calc(var(--reference-width)-(0.75rem*2))]",get children(){return h(us,{children:i=>[h(fs,{get children(){return h(ys,{get children(){return h(gs,{})}})}}),h(hs,{get children(){return h(cs,{get children(){return h(_t,{get each(){return i().getMonthsGrid({columns:4,format:"short"})},children:s=>h(wo,{get children(){return h(_t,{get each(){return s()},children:a=>h(ps,{get value(){return a().value},get children(){return h(ms,{get children(){return a().label}})}})})}})})}})}})]})}}),h(ds,{view:"year",class:"w-[calc(var(--reference-width)-(0.75rem*2))]",get children(){return h(us,{children:i=>[h(fs,{get children(){return h(ys,{get children(){return h(gs,{})}})}}),h(hs,{get children(){return h(cs,{get children(){return h(_t,{get each(){return i().getYearsGrid({columns:4})},children:s=>h(wo,{get children(){return h(_t,{get each(){return s()},children:a=>h(ps,{get value(){return a().value},get children(){return h(ms,{get children(){return a().label}})}})})}})})}})}})]})}})]}})]}})),ue(()=>xt(o,`datepicker-anchor flex items-center justify-center max-w-64 mx-[-1rem] ${t()&&"opacity-50"}`)),r})()};var Ox=B("<div>Unknown bot message type");const Dx=e=>h(om,{get createdAt(){return e.createdAt},get children(){return e.type==="text"?h(Jl,{get text(){return e.text}}):e.type==="buttons"?h(am,I(()=>e.buttons)):e.type==="list"?h(Ry,I(()=>e.list)):e.type==="media"?h(Xl,I(()=>e.media)):e.type==="link"?h(fm,I(()=>e.link)):e.type==="cards"?h(um,I(()=>e.cards)):e.type==="date"?h(Cx,{get text(){return e.text}}):Ox()}});var kx=B('<div class="place-self-center p-4"><span class="bg-slate-200/40 text-black font-semibold py-2 px-4 rounded-xl">');const Tx=e=>(()=>{var t=kx(),n=t.firstChild;return F(n,()=>e.text?.trim()),t})();var $x=B('<div class="place-self-end py-1 flex flex-col"><div class="bg-primary shadow-primary/40 shadow-md py-2 px-4 rounded-l-xl rounded-tr-xl text-primary-foreground">');const Ax=({children:e,createdAt:t})=>(()=>{var n=$x(),r=n.firstChild;return F(r,e),F(n,h(Fl,{createdAt:t,anchor:"end"}),null),n})();var Mx=B("<div>Unknown user message type");const Ix=e=>h(Ax,{get createdAt(){return e.createdAt},get children(){return e.type==="text"?h(Jl,{get text(){return e.text}}):e.type==="media"?h(Xl,I(()=>e.media)):Mx()}});var Lx=B("<div>Unknown message origin");const Rx=e=>e.origin==="bot"?h(Dx,e):e.origin==="user"?h(Ix,e):e.origin==="service"?h(Tx,e):Lx();function Nx(e){return pe({a:{viewBox:"0 0 512 512"},c:'<path d="m289.94 256 95-95A24 24 0 0 0 351 127l-95 95-95-95a24 24 0 0 0-34 34l95 95-95 95a24 24 0 1 0 34 34l95-95 95 95a24 24 0 0 0 34-34Z"/>'},e)}function Ln(e){return pe({a:{viewBox:"0 0 512 512"},c:'<path d="M256 464c-114.69 0-208-93.31-208-208S141.31 48 256 48s208 93.31 208 208-93.31 208-208 208Z"/>'},e)}var Fx=B('<div class="place-self-start py-1"><div class="animate-pulse bg-white flex space-x-1 shadow-md py-2 px-4 rounded-r-xl rounded-tl-xl text-slate-400">');const _x=()=>(()=>{var e=Fx(),t=e.firstChild;return F(t,h(Ln,{class:"size-2 animate-bounce"}),null),F(t,h(Ln,{class:"size-2 animate-bounce delay-150"}),null),F(t,h(Ln,{class:"size-2 animate-bounce delay-300"}),null),e})();var Vx=B('<main class="flex-grow p-4 overflow-y-auto flex flex-col items-center scroll-smooth relative">'),Kx=B("<div>No messages yet...");const vs=()=>{let e;const{messages:t,onMessage:n,typing:r}=Tt(),{onOpen:o}=Ws(),i=(s=100)=>{setTimeout(()=>{e?.scrollTo(0,e.scrollHeight)},s)};return Ft(()=>{i(200)}),n(i),o(()=>i(200)),(()=>{var s=Vx(),a=e;return typeof a=="function"?Fs(a,s):e=s,F(s,h(Zt,{each:t,get fallback(){return Kx()},children:l=>h(Rx,l)}),null),F(s,h(ie,{get when(){return r()},get children(){return h(_x,{})}}),null),s})()};var zx=B("<textarea>");const Bx=e=>{const[,t]=U(e,["class"]);return(()=>{var n=zx();return Xt(n,I({get class(){return le("flex w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e.class)}},t),!1,!1),n})()};var jx=B('<footer class="flex-none p-4 bg-white min-h-16 flex space-x-1">');const bs=()=>{const{pushMessage:e}=Tt(),[t,n]=L(""),r=()=>{e(t()),n("")},o=i=>{i.key==="Enter"&&!i.shiftKey&&r()};return(()=>{var i=jx();return F(i,h(Bx,{placeholder:"Type your message here...",get value(){return t()},onInput:s=>n(s.currentTarget.value),onkeyup:o,class:"focus-visible:ring-primary h-10",style:"resize: none;",autofocus:!0}),null),F(i,h(Ce,{variant:"outline",class:"p-2","aria-label":"Send",type:"button",onClick:r,get children(){return h(Lf,{size:24})}}),null),i})()};var Ux=B('<div id=smarttalks-widget class="rounded-md shadow-xl h-[85vh] w-[98%] md:h-[min(100vh,500px)] md:w-[min(100vw,400px)] overflow-hidden bg-background text-foreground flex flex-col relative">'),Wx=B("<span class=sr-only>Close"),Hx=B("<div>"),Yx=B("<span class=sr-only>Open"),Gx=B("<span>"),qx=B('<div class="animate-pulse flex p-1">');const Zx=({children:e,openIcon:t})=>{const{bubble:n,toggle:r,show:o}=Ws(),{chatWidget:i}=Pe(),[s,a]=L(!0);return setTimeout(()=>a(!1),2e3),i()?.openDelay&&setTimeout(()=>{o()},i()?.openDelay),(()=>{var l=Hx();return F(l,h(ie,{get when(){return n()},get children(){var c=Ux();return F(c,e),c}}),null),F(l,h(ie,{get when(){return n()},get fallback(){return h(Ce,{onclick:r,class:"rounded-full py-6 px-0 hover:shadow-primary shadow-md border border-primary transition-shadow duration-300","aria-label":"Open",type:"button",get children(){return[t,Yx(),h(ie,{get when(){return i()?.balloonMessage},get children(){var c=Gx();return F(c,h(ie,{get when(){return!s()},get fallback(){return(()=>{var u=qx();return F(u,h(Ln,{class:"size-2 animate-bounce"}),null),F(u,h(Ln,{class:"size-2 animate-bounce delay-150"}),null),F(u,h(Ln,{class:"size-2 animate-bounce delay-300"}),null),u})()},get children(){return i()?.balloonMessage}})),ue(()=>xt(c,"absolute -top-2 bg-primary text-primary-foreground px-1 py-0.5 pointer-events-none rounded truncate"+(i()?.style.position==="left"?" left-9":" right-9"))),c}})]}})},get children(){return h(Ce,{onclick:r,class:"rounded-full py-6 px-2 hover:bg-primary hover:shadow-primary shadow-md transition-shadow duration-300","aria-label":"Close",type:"button",get children(){return[h(Nx,{size:30}),Wx()]}})}}),null),ue(()=>xt(l,"max-h-full max-w-full md:max-h-[90%] md:max-w-[90%] fixed bottom-5 flex flex-col space-y-2"+(i()?.style.position==="left"?" left-5 items-start":" right-5 items-end"))),l})()};var Xx=B('<div id=smarttalks-widget class="h-screen w-full overflow-hidden bg-background text-foreground flex flex-col rounded-md">');const Jx=({children:e})=>{const{chatWidget:t}=Pe(),n={};return t()?.style.width&&(n.width=`min(100%, ${t()?.style.width}px)`),t()?.style.height&&(n.height=`min(100vh, ${t()?.style.height}px)`),(()=>{var r=Xx();return Ns(r,n),F(r,e),r})()};var Qx=B("<div id=smarttalks-widget>");const e1=({children:e})=>{const{chatWidget:t}=Pe();return(()=>{var n=Qx();return F(n,e),ue(()=>xt(n,"h-[85vh] w-[90vw] md:h-[min(100vh,500px)] md:w-[min(100vw,400px)] max-h-full max-w-full md:max-h-[90%] md:max-w-[90%] fixed bottom-5 rounded-md shadow-xl overflow-hidden bg-background text-foreground flex flex-col"+(t()?.style.position==="left"?" left-5":" right-5"))),n})()};var t1=B('<div class="absolute bg-black/50 text-white font-bold h-full w-full grid place-content-center z-50">');const ws=()=>(()=>{var e=t1();return F(e,h(If,{size:45,class:"animate-spin"})),e})(),n1=()=>{const{chatWidget:e}=Pe(),{loading:t}=Tt();return Ft(async()=>{await new Promise(n=>setTimeout(n,1e4)),e()?.openDelay&&await new Promise(n=>setTimeout(n,e()?.openDelay))}),h(Zx,{get openIcon(){return h(da,{get src(){return e()?.avatar}})},get children(){return[h(ie,{get when(){return t()},get children(){return h(ws,{})}}),h(hi,{}),h(vs,{}),h(bs,{})]}})},r1=()=>{const{loading:e}=Tt();return h(e1,{get children(){return[h(ie,{get when(){return e()},get children(){return h(ws,{})}}),h(hi,{}),h(vs,{}),h(bs,{})]}})},o1=()=>{const{loading:e}=Tt();return h(Jx,{get children(){return[h(ie,{get when(){return e()},get children(){return h(ws,{})}}),h(hi,{}),h(vs,{}),h(bs,{})]}})},i1=()=>{const{chatWidget:e}=Pe();console.log(e());const t=qu(async()=>(e()?.openDelay&&await new Promise(n=>setTimeout(n,e()?.openDelay)),{default:r1}));return h(Ls,{get children(){return[h(Nn,{get when(){return e()?.mode==="standard"},get children(){return h(n1,{})}}),h(Nn,{get when(){return e()?.mode==="popup"},get children(){return h(t,{})}}),h(Nn,{get when(){return e()?.mode==="static"},get children(){return h(o1,{})}})]}})};var s1=B("<div><div>Form");const a1=()=>{const{formWidget:e}=Pe();return(()=>{var t=s1();return t.firstChild,F(t,()=>e()?._id,null),t})()};function l1(){const{widget:e}=Pe();return h(Ls,{get children(){return[h(Nn,{get when(){return e()?.type==="chat"},get children(){return h(i1,{})}}),h(Nn,{get when(){return e()?.type==="form"},get children(){return h(a1,{})}})]}})}var c1=B("<style>"),u1=B("<div>");const d1=({id:e,settings:t})=>{const{setWidgetId:n}=Pe(),r=(e||"default")+"?"+(t?"&showSettings":"");return n(r),[(()=>{var o=c1();return F(o,Sd),o})(),(()=>{var o=u1();return F(o,h(l1,{})),o})()]};(()=>{typeof window>"u"||xd("smarttalks-widget",{id:"",settings:!1},d1)})()});
187
+ */function fp(e,t){return t?pg([e.clientX,e.clientY],t):!1}function gp(e){const t=mn(),n=ja(),r=Pl(),o=De({placement:"bottom-start"},e),[i,s]=U(o,["open","defaultOpen","onOpenChange"]);let a=0,l=null,c="right";const[u,d]=L(),[f,m]=L(),[g,p]=L(),[y,v]=L(),[b,w]=L(!0),[x,T]=L(s.placement),[O,k]=L([]),[j,P]=L([]),{DomCollectionProvider:M}=gh({items:j,onItemsChange:P}),$=Ca({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:G=>i.onOpenChange?.(G)}),R=Lg(()=>t.forceMount()||$.isOpen()),se=th({selectionMode:"none",dataSource:j}),J=G=>{w(G),$.open()},re=(G=!1)=>{$.close(),G&&r&&r.close(!0)},N=G=>{w(G),$.toggle()},X=()=>{const G=y();G&&(Se(G),se.selectionManager().setFocused(!0),se.selectionManager().setFocusedKey(void 0))},he=G=>{k(ur=>[...ur,G]);const Pe=r?.registerNestedMenu(G);return()=>{k(ur=>zo(ur,G)),Pe?.()}},E=G=>c===l?.side&&fp(G,l?.area),S=G=>{E(G)&&G.preventDefault()},C=G=>{E(G)||X()},W=G=>{E(G)&&G.preventDefault()};Ag({isDisabled:()=>!(r==null&&$.isOpen()&&t.isModal()),targets:()=>[y(),...O()].filter(Boolean)}),V(()=>{const G=y();if(!G||!r)return;const Pe=r.registerNestedMenu(G);Z(()=>{Pe()})});const wt={dataset:A(()=>({"data-expanded":$.isOpen()?"":void 0,"data-closed":$.isOpen()?void 0:""})),isOpen:$.isOpen,contentPresence:R,nestedMenus:O,currentPlacement:x,pointerGraceTimeoutId:()=>a,autoFocus:b,listState:()=>se,parentMenuContext:()=>r,triggerRef:g,contentRef:y,triggerId:u,contentId:f,setTriggerRef:p,setContentRef:v,open:J,close:re,toggle:N,focusContent:X,onItemEnter:S,onItemLeave:C,onTriggerLeave:W,setPointerDir:G=>c=G,setPointerGraceTimeoutId:G=>a=G,setPointerGraceIntent:G=>l=G,registerNestedMenu:he,registerItemToParentDomCollection:n?.registerItem,registerTriggerId:$r(d),registerContentId:$r(m)};return h(M,{get children(){return h(El.Provider,{value:wt,get children(){return h(dp,I({anchorRef:g,contentRef:y,onCurrentPlacementChange:T},s))}})}})}const Ol=ve();function hp(){const e=be(Ol);if(e===void 0)throw new Error("[kobalte]: `useMenuItemContext` must be used within a `Menu.Item` component");return e}function Dl(e){let t;const n=mn(),r=pn(),o=De({id:n.generateId(`item-${Le()}`)},e),[i,s]=U(o,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,l]=L(),[c,u]=L(),[d,f]=L(),m=()=>r.listState().selectionManager(),g=()=>s.id,p=()=>m().focusedKey()===g(),y=()=>{i.onSelect?.(),i.closeOnSelect&&r.close(!0)};hh({getItem:()=>({ref:()=>t,type:"item",key:g(),textValue:i.textValue??d()?.textContent??t?.textContent??"",disabled:i.disabled??!1})});const v=Qg({key:g,selectionManager:m,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},()=>t),b=P=>{Oe(P,i.onPointerMove),P.pointerType==="mouse"&&(i.disabled?r.onItemLeave(P):(r.onItemEnter(P),P.defaultPrevented||(Se(P.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(g()))))},w=P=>{Oe(P,i.onPointerLeave),P.pointerType==="mouse"&&r.onItemLeave(P)},x=P=>{Oe(P,i.onPointerUp),!i.disabled&&P.button===0&&y()},T=P=>{if(Oe(P,i.onKeyDown),!P.repeat&&!i.disabled)switch(P.key){case"Enter":case" ":y();break}},O=A(()=>{if(i.indeterminate)return"mixed";if(i.checked!=null)return i.checked}),k=A(()=>({"data-indeterminate":i.indeterminate?"":void 0,"data-checked":i.checked&&!i.indeterminate?"":void 0,"data-disabled":i.disabled?"":void 0,"data-highlighted":p()?"":void 0})),j={isChecked:()=>i.checked,dataset:k,setLabelRef:f,generateId:ga(()=>s.id),registerLabel:$r(l),registerDescription:$r(u)};return h(Ol.Provider,{value:j,get children(){return h(an,I({as:"div",ref(P){var M=Ct($=>t=$,i.ref);typeof M=="function"&&M(P)},get tabIndex(){return v.tabIndex()},get"aria-checked"(){return O()},get"aria-disabled"(){return i.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return c()},get"data-key"(){return v.dataKey()},get onPointerDown(){return Ne([i.onPointerDown,v.onPointerDown])},get onPointerUp(){return Ne([x,v.onPointerUp])},get onClick(){return Ne([i.onClick,v.onClick])},get onKeyDown(){return Ne([T,v.onKeyDown])},get onMouseDown(){return Ne([i.onMouseDown,v.onMouseDown])},get onFocus(){return Ne([i.onFocus,v.onFocus])},onPointerMove:b,onPointerLeave:w},k,s))}})}function pp(e){const t=De({closeOnSelect:!1},e),[n,r]=U(t,["checked","defaultChecked","onChange","onSelect"]),o=Ng({isSelected:()=>n.checked,defaultIsSelected:()=>n.defaultChecked,onSelectedChange:s=>n.onChange?.(s),isDisabled:()=>r.disabled});return h(Dl,I({role:"menuitemcheckbox",get checked(){return o.isSelected()},onSelect:()=>{n.onSelect?.(),o.toggle()}},r))}const mp=ve();function kl(){return be(mp)}function yp(e){let t;const n=mn(),r=pn(),o=kl(),i=De({id:n.generateId(`content-${Le()}`)},e),[s,a]=U(i,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let l=0;const c=()=>r.parentMenuContext()==null&&o===void 0&&n.isModal(),u=rh({selectionManager:r.listState().selectionManager,collection:r.listState().collection,autoFocus:r.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!r.listState().selectionManager().isFocused()},()=>t);Tg({trapFocus:()=>c()&&r.isOpen(),onMountAutoFocus:y=>{o===void 0&&s.onOpenAutoFocus?.(y)},onUnmountAutoFocus:s.onCloseAutoFocus},()=>t);const d=y=>{if(Ze(y.currentTarget,y.target)&&(y.key==="Tab"&&r.isOpen()&&y.preventDefault(),o!==void 0&&y.currentTarget.getAttribute("aria-haspopup")!=="true"))switch(y.key){case"ArrowRight":y.stopPropagation(),y.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.nextMenu();break;case"ArrowLeft":if(y.currentTarget.hasAttribute("data-closed"))break;y.stopPropagation(),y.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.previousMenu();break}},f=y=>{s.onEscapeKeyDown?.(y),o?.setAutoFocusMenu(!1),r.close(!0)},m=y=>{s.onFocusOutside?.(y),n.isModal()&&y.preventDefault()},g=y=>{Oe(y,s.onPointerEnter),r.isOpen()&&(r.parentMenuContext()?.listState().selectionManager().setFocused(!1),r.parentMenuContext()?.listState().selectionManager().setFocusedKey(void 0))},p=y=>{if(Oe(y,s.onPointerMove),y.pointerType!=="mouse")return;const v=y.target,b=l!==y.clientX;Ze(y.currentTarget,v)&&b&&(r.setPointerDir(y.clientX>l?"right":"left"),l=y.clientX)};return V(()=>Z(r.registerContentId(s.id))),h(ie,{get when(){return r.contentPresence.isPresent()},get children(){return h(Ch,{get children(){return h(Eh,I({ref(y){var v=Ct(b=>{r.setContentRef(b),r.contentPresence.setRef(b),t=b},s.ref);typeof v=="function"&&v(y)},role:"menu",get id(){return s.id},get tabIndex(){return u.tabIndex()},get disableOutsidePointerEvents(){return A(()=>!!c())()&&r.isOpen()},get excludedElements(){return[r.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return{"--kb-menu-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative",...s.style}},get"aria-labelledby"(){return r.triggerId()},onEscapeKeyDown:f,onFocusOutside:m,get onDismiss(){return r.close},get onKeyDown(){return Ne([s.onKeyDown,u.onKeyDown,d])},get onMouseDown(){return Ne([s.onMouseDown,u.onMouseDown])},get onFocusIn(){return Ne([s.onFocusIn,u.onFocusIn])},get onFocusOut(){return Ne([s.onFocusOut,u.onFocusOut])},onPointerEnter:g,onPointerMove:p},()=>r.dataset(),a))}})}})}function vp(e){let t;const n=mn(),r=pn(),[o,i]=U(e,["ref"]);return Xa({element:()=>t??null,enabled:()=>r.isOpen()&&n.preventScroll()}),h(yp,I({ref(s){var a=Ct(l=>{t=l},o.ref);typeof a=="function"&&a(s)}},i))}function bp(e){return h(Dl,I({role:"menuitem",closeOnSelect:!0},e))}function wp(e){const t=hp(),n=De({id:t.generateId("indicator")},e),[r,o]=U(n,["forceMount"]);return h(ie,{get when(){return r.forceMount||t.isChecked()},get children(){return h(an,I({as:"div"},()=>t.dataset(),o))}})}function xp(e){const t=pn();return h(ie,{get when(){return t.contentPresence.isPresent()},get children(){return h(Mo,e)}})}function Sp(e){const t=`menu-${Le()}`,n=De({id:t,modal:!0},e),[r,o]=U(n,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value"]),i=Ca({open:()=>r.open,defaultOpen:()=>r.defaultOpen,onOpenChange:a=>r.onOpenChange?.(a)}),s={isModal:()=>r.modal??!0,preventScroll:()=>r.preventScroll??s.isModal(),forceMount:()=>r.forceMount??!1,generateId:ga(()=>r.id),value:()=>r.value};return h(Cl.Provider,{value:s,get children(){return h(gp,I({get open(){return i.isOpen()},get onOpenChange(){return i.setIsOpen}},o))}})}function Ep(e){const t=mn(),n=pn(),r=kl(),o=De({id:t.generateId("trigger")},e),[i,s]=U(o,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let a;r!==void 0&&(a=t.value()??i.id,V(()=>{r.registerMenu(a,[n.contentRef(),...n.nestedMenus()])}),V(()=>{r.value()===a?(n.triggerRef()?.focus(),r.autoFocusMenu()&&n.open(!0)):n.close(!0)}),V(()=>{n.isOpen()&&r.setValue(a)}),Z(()=>{r.unregisterMenu(a)}),r.lastValue()===void 0&&r.setLastValue(a));const l=()=>{r?.setAutoFocusMenu(!0),r!==void 0?n.toggle(!1):n.toggle(!0),r!==void 0&&!n.isOpen()&&r.value()===a&&r.closeMenu()},c=g=>{Oe(g,i.onPointerDown),g.currentTarget.dataset.pointerType=g.pointerType,!i.disabled&&g.pointerType!=="touch"&&g.button===0&&l()},u=g=>{Oe(g,i.onClick),i.disabled||g.currentTarget.dataset.pointerType==="touch"&&l()},d=g=>{if(Oe(g,i.onKeyDown),!i.disabled)switch(g.key){case"Enter":case" ":case"ArrowDown":g.stopPropagation(),g.preventDefault(),mg(g.currentTarget),n.toggle("first");break;case"ArrowUp":g.stopPropagation(),g.preventDefault(),n.toggle("last");break;case"ArrowRight":if(r===void 0)break;g.stopPropagation(),g.preventDefault(),r.nextMenu();break;case"ArrowLeft":if(r===void 0)break;g.stopPropagation(),g.preventDefault(),r.previousMenu();break}},f=g=>{Oe(g,i.onMouseOver),!i.disabled&&r!==void 0&&r.value()!==void 0&&r.setValue(a)},m=g=>{Oe(g,i.onFocus),r!==void 0&&r.setValue(a)};return V(()=>Z(n.registerTriggerId(i.id))),h(sh,I({ref(g){var p=Ct(n.setTriggerRef,i.ref);typeof p=="function"&&p(g)},get id(){return i.id},get disabled(){return i.disabled},"aria-haspopup":"true",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return A(()=>!!n.isOpen())()?n.contentId():void 0},get"data-highlighted"(){return a!==void 0&&r?.value()===a?!0:void 0},get tabIndex(){return r!==void 0?r.value()===a||r.lastValue()===a?0:-1:void 0},onPointerDown:c,onMouseOver:f,onClick:u,onKeyDown:d,onFocus:m,role:r!==void 0?"menuitem":void 0},()=>n.dataset(),s))}function Pp(e){let t;const n=De({orientation:"horizontal"},e),[r,o]=U(n,["ref","orientation"]),i=Ia(()=>t,()=>"hr");return h(an,I({as:"hr",ref(s){var a=Ct(l=>t=l,r.ref);typeof a=="function"&&a(s)},get role(){return i()!=="hr"?"separator":void 0},get"aria-orientation"(){return r.orientation==="vertical"?"vertical":void 0},get"data-orientation"(){return r.orientation}},o))}function Cp(e){const t=mn(),n=pn(),[r,o]=U(e,["onCloseAutoFocus","onInteractOutside"]);let i=!1;return h(vp,I({onCloseAutoFocus:l=>{r.onCloseAutoFocus?.(l),i||Se(n.triggerRef()),i=!1,l.preventDefault()},onInteractOutside:l=>{r.onInteractOutside?.(l),(!t.isModal()||l.detail.isContextMenu)&&(i=!0)}},o))}function Op(e){const t=`dropdownmenu-${Le()}`,n=De({id:t},e);return h(Sp,n)}function Dp(e){return me({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-check",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M5 12l5 5l10 -10"/>'},e)}function kp(e){return me({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-chevron-left",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M15 6l-6 6l6 6"/>'},e)}function Tp(e){return me({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-chevron-right",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M9 6l6 6l-6 6"/>'},e)}function $p(e){return me({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-circle-check-filled",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-1.293 5.953a1 1 0 0 0 -1.32 -.083l-.094 .083l-3.293 3.292l-1.293 -1.292l-.094 -.083a1 1 0 0 0 -1.403 1.403l.083 .094l2 2l.094 .083a1 1 0 0 0 1.226 0l.094 -.083l4 -4l.083 -.094a1 1 0 0 0 -.083 -1.32z" stroke-width="0" fill="currentColor"/>'},e)}function Ap(e){return me({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-circle",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"/>'},e)}function Mp(e){return me({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-download",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M14 3v4a1 1 0 0 0 1 1h4"/><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"/><path d="M12 17v-6"/><path d="M9.5 14.5l2.5 2.5l2.5 -2.5"/>'},e)}var Ip=B('<span class="absolute left-2 flex size-3.5 items-center justify-center">');const Lp=e=>h(Op,I({gutter:4},e)),Rp=Ep,Np=e=>{const[,t]=U(e,["class"]);return h(xp,{get mount(){return zn()},get children(){return h(Cp,I({get class(){return le("z-50 min-w-[8rem] origin-[var(--kb-menu-content-transform-origin)] animate-content-hide overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[expanded]:animate-content-show",e.class)}},t))}})},Fp=e=>{const[,t]=U(e,["class"]);return h(bp,I({get class(){return le("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e.class)}},t))},_p=e=>{const[,t]=U(e,["class"]);return h(Pp,I({get class(){return le("-mx-1 my-1 h-px bg-muted",e.class)}},t))},Vp=e=>{const[,t]=U(e,["class","children"]);return h(pp,I({get class(){return le("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e.class)}},t,{get children(){return[(()=>{var n=Ip();return F(n,h(wp,{get children(){return h(Dp,{class:"size-4"})}})),n})(),A(()=>e.children)]}}))};function Kp(e){return e.type==="buttons"&&e.buttons.options.length>3?{list:{text:e.buttons.text,options:[{items:e.buttons.options}]},type:"list",origin:e.origin,createdAt:e.createdAt}:e}async function zp(e,t){return await new Promise(n=>setTimeout(n,1e3)),{contactId:"mock",interactionId:"mock",messages:[{media:{type:"image",link:"https://62daaa4fd548ba68369ee934-secured.s3.amazonaws.com/1688647717709-Banner-tem-que-ir-turismo-de-aventura-1920x1077-123-milhas.jpg",text:"Look what a great image!"},type:"media",origin:"bot",createdAt:new Date().toString()}]}}async function Bp(e,t,n,r,o){if(!n||!r)return await zp();const i=`${_o}/v1/webhooks/widget`,s={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({clientIdentifier:o,channelId:n,flowId:r,postback:t,type:"text",text:e})};return(await fetch(i,s)).json()}async function jp(e,t,n){if(!e||!t||!n)return;const r=`${_o}/v1/webhooks/widget/restart`,o={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({channelId:e,contactId:t,interactionId:n})};await fetch(r,o)}const Tl=1e3*60*60*24,[Fr,$l]=Xs("smarttalks-widget-messages",{},Tl),Al=()=>{const{widgetId:e}=de();return Fr[e()]??[]},Up=e=>{const{widgetId:t}=de();$l({...Fr,[t()]:[...Fr[t()]??[],e]})},Wp=()=>{const{widgetId:e}=de();$l({...Fr,[e()]:[]})},[Ml,Hp]=Xs("smarttalks-widget-conversationinfo",{},Tl),Il=()=>{const{widgetId:e}=de();return Ml[e()]??{}},Ll=e=>{const{widgetId:t}=de();Hp({...Ml,[t()]:e})},[Yp,Rl]=L(!1),[Gp,Nl]=L(!1),Fl=[],_l=()=>{Fl.forEach(e=>e())},qp=e=>Fl.push(e),di=e=>{const t=Kp(e);if(Up(t),t.type==="media"){setTimeout(_l,200);return}_l()},Zp=(e,t)=>{const{chatWidget:n}=de(),r=Il();e.trim()&&(di({text:e,type:"text",origin:"user",createdAt:new Date().toString()}),t&&console.log("postback:",t),Rl(!0),Bp(e,t,n()?._id,n()?.chat.flowId,r.clientIdentifier).then(o=>{(o.contactId!==r.contactId||o.interactionId!==r.interactionId||o.clientIdentifier!==r.clientIdentifier)&&Ll({contactId:o.contactId,interactionId:o.interactionId,clientIdentifier:o.clientIdentifier});for(const i of o.messages)di(i)}).catch(console.error).finally(()=>Rl(!1)))},Xp=()=>{const{chatWidget:e}=de(),t=Il();Nl(!0),Wp(),jp(e()?._id,t.contactId,t.interactionId).finally(()=>{Ll({}),Nl(!1),Jp()})},Jp=()=>{const{chatWidget:e}=de();if(Al().length===0&&e()?.balloonMessage){const n=e()?.balloonMessage;n&&di({text:n,type:"text",origin:"bot",createdAt:new Date().toString()})}},Tt=()=>({getMessages:Al,pushMessage:Zp,clearMessages:Xp,onMessage:qp,typing:Yp,loading:Gp});var Qp=B("<span class=ml-1>Debug"),em=B("<span>Restart");const tm=()=>{const{clearMessages:e}=Tt(),[t,n]=L(!1),[r,o]=L(!1);return h(Lp,{get open(){return r()},onOpenChange:o,get children(){return[h(Rp,{get children(){return h(Ce,{variant:"ghost",size:"icon",class:"hover:bg-accent/10 hover:text-primary-foreground",get children(){return h(If,{size:20})}})}}),h(Np,{get children(){return[h(Vp,{class:"flex items-center justify-start cursor-pointer",get checked(){return t()},onChange:n,get children(){return[h(Mf,{size:14}),Qp()]}}),h(_p,{}),h(Fp,{class:"flex space-x-2 items-center cursor-pointer",onSelect:e,get children(){return[h(Af,{size:14}),em()]}})]}})]}})};function nm(e){return me({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M5.5 0a.5.5 0 0 1 .5.5v4A1.5 1.5 0 0 1 4.5 6h-4a.5.5 0 0 1 0-1h4a.5.5 0 0 0 .5-.5v-4a.5.5 0 0 1 .5-.5zm5 0a.5.5 0 0 1 .5.5v4a.5.5 0 0 0 .5.5h4a.5.5 0 0 1 0 1h-4A1.5 1.5 0 0 1 10 4.5v-4a.5.5 0 0 1 .5-.5zM0 10.5a.5.5 0 0 1 .5-.5h4A1.5 1.5 0 0 1 6 11.5v4a.5.5 0 0 1-1 0v-4a.5.5 0 0 0-.5-.5h-4a.5.5 0 0 1-.5-.5zm10 1a1.5 1.5 0 0 1 1.5-1.5h4a.5.5 0 0 1 0 1h-4a.5.5 0 0 0-.5.5v4a.5.5 0 0 1-1 0v-4z"/>'},e)}function rm(e){return me({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M1.5 1a.5.5 0 0 0-.5.5v4a.5.5 0 0 1-1 0v-4A1.5 1.5 0 0 1 1.5 0h4a.5.5 0 0 1 0 1h-4zM10 .5a.5.5 0 0 1 .5-.5h4A1.5 1.5 0 0 1 16 1.5v4a.5.5 0 0 1-1 0v-4a.5.5 0 0 0-.5-.5h-4a.5.5 0 0 1-.5-.5zM.5 10a.5.5 0 0 1 .5.5v4a.5.5 0 0 0 .5.5h4a.5.5 0 0 1 0 1h-4A1.5 1.5 0 0 1 0 14.5v-4a.5.5 0 0 1 .5-.5zm15 0a.5.5 0 0 1 .5.5v4a1.5 1.5 0 0 1-1.5 1.5h-4a.5.5 0 0 1 0-1h4a.5.5 0 0 0 .5-.5v-4a.5.5 0 0 1 .5-.5z"/>'},e)}function om(e){return me({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8 2.146 2.854Z"/>'},e)}var im=B('<header class="flex-none bg-primary text-primary-foreground p-3 flex items-center justify-between space-x-4"><div class="flex items-center gap-0.5">');const fi=()=>{const{chatWidget:e}=de(),[t,n]=L(!1),r=()=>{const i=zn();i&&(t()?document.exitFullscreen():i.requestFullscreen(),n(!t()))};document.addEventListener("fullscreenchange",()=>{document.fullscreenElement||n(!1)});const o=()=>{if(e()?.mode==="popup"){const i=zn();i&&(i.style.display="none")}};return(()=>{var i=im(),s=i.firstChild;return F(i,h(Tf,{}),s),F(s,h(Ce,{size:"icon",variant:"ghost",class:"hover:bg-accent/10 hover:text-primary-foreground",onClick:r,get children(){return h(ie,{get when(){return t()},get fallback(){return h(rm,{size:16})},get children(){return h(nm,{size:16})}})}}),null),F(s,h(ie,{get when(){return e()?.showSettings},get children(){return h(tm,{})}}),null),F(s,h(ie,{get when(){return e()?.mode==="popup"},get children(){return h(Ce,{size:"icon",variant:"ghost",class:"hover:bg-accent/10 hover:text-primary-foreground",onClick:o,get children(){return h(om,{size:16})}})}}),null),i})()};var sm=B("<span>");const Vl=({createdAt:e,anchor:t="end"})=>(()=>{var n=sm();return xt(n,`${t==="end"?"self-end":"self-start"} pt-1 text-[10px] italic font-light text-slate-600`),F(n,()=>new Date(e).toLocaleString([],{hour:"2-digit",minute:"2-digit"})),n})();var am=B('<div class="place-self-start py-1 flex flex-col"><div class="bg-white shadow-md py-2 px-4 rounded-r-xl rounded-tl-xl">');const lm=({children:e,createdAt:t})=>(()=>{var n=am(),r=n.firstChild;return F(r,e),F(n,h(Vl,{createdAt:t,anchor:"start"}),null),n})();var cm=B("<span>");const zt=e=>{const[,t]=U(e,["class","children"]);let n=e.children?.toString();return n&&(n=mf(yf(n))),(()=>{var r=cm();return r.innerHTML=n,Xt(r,I({get class(){return le("whitespace-pre-line",e.class)}},t),!1,!1),r})()};var um=B('<div class="flex flex-col space-y-2"><div><div class="flex space-x-2 py-2 overflow-x-auto snap-x">');const dm=({options:e,text:t})=>{let n;const{pushMessage:r}=Tt(),[o,i]=L(!1),s=(l=!0)=>{if(n){const c=n.clientWidth/2;n.scrollTo({left:n.scrollLeft+(l?c:-c),behavior:"smooth"})}},a=(l,c)=>{i(!0),r(l,c)};return(()=>{var l=um(),c=l.firstChild,u=c.firstChild;F(l,h(zt,{get children(){return t?.trim()}}),c),F(c,h(ie,{get when(){return e.length>1},get children(){return h(Ce,{class:"p-1 text-slate-400",variant:"ghost",onClick:()=>s(!1),get children(){return h(kp,{size:20})}})}}),u);var d=n;return typeof d=="function"?Rs(d,u):n=u,F(u,h(Zt,{each:e,children:f=>h(Ce,{variant:"outline",get disabled(){return o()},class:"px-2 py-0 snap-center text-nowrap",onClick:()=>a(f.label,f.value),get children(){return f.label?.trim()}})})),F(c,h(ie,{get when(){return e.length>1},get children(){return h(Ce,{class:"p-1 text-slate-400",variant:"ghost",onClick:()=>s(),get children(){return h(Tp,{size:20})}})}}),null),ue(()=>xt(c,`flex items-center justify-center max-w-64 mx-[-1rem] ${o()&&"opacity-50"}`)),l})()};var fm=B('<div class="flex flex-col"><span>'),gm=B("<a target=_blank><img><span></span><span>");const hm=({options:e,text:t})=>(()=>{var n=fm(),r=n.firstChild;return F(r,()=>t?.trim()),F(n,h(Zt,{each:e,children:o=>(()=>{var i=gm(),s=i.firstChild,a=s.nextSibling,l=a.nextSibling;return F(a,()=>o.title?.trim()),F(l,()=>o.description?.trim()),ue(c=>{var u=o.url,d=o.image;return u!==c.e&&xe(i,"href",c.e=u),d!==c.t&&xe(s,"src",c.t=d),c},{e:void 0,t:void 0}),i})()}),null),n})();var pm=B("<a target=_blank>");const mm=({url:e,text:t})=>(()=>{var n=pm();return xe(n,"href",e),F(n,()=>t?.trim()),n})();var ym=e=>{const t=I({initialRegistered:!1},e),[n,r]=L(t.initialRegistered);return[A(()=>{if(n())return z(t.value)}),()=>{r(!0)},()=>{r(!1)}]},Kl=ym,Xn=e=>typeof e=="function",vm=["button","color","file","image","reset","submit"],bm=(e,t)=>e==="button"?!0:e==="input"&&t?vm.indexOf(t)!==-1:!1;function wm(e){const[t,n]=L(e.initialValue),r=()=>e.value?.()!==void 0,o=()=>r()?e.value?.():t();return[o,s=>Q(()=>{let a;return Xn(s)?a=s(o()):a=s,Object.is(a,o())||(r()||n(a),e.onChange?.(a)),a})]}var gi=wm,_r=new Map,Vr=(e,t)=>{if(_r.has(e))return _r.get(e);const n=ve(t);return _r.set(e,n),n},hi=e=>{const t=_r.get(e);if(t)return be(t)},xm=e=>{const t=I({enabled:!0},e);V(()=>{z(t.enabled)&&(document.addEventListener("keydown",n),Z(()=>{document.removeEventListener("keydown",n)}))});const n=r=>{r.key==="Escape"&&t.onEscapeKeyDown(r)}},Sm=xm,Em=e=>{const t=I({enabled:!0},e);V(()=>{const{body:n}=document;z(t.enabled)&&ni({key:"no-pointer-events",element:n,style:{pointerEvents:"none"}})})},Pm=Em,Cm=e=>{const t=I({enabled:!0,strategy:"pointerup"},e);V(()=>{if(!z(t.enabled))return;const r=z(t.strategy);document.addEventListener(r,n),Z(()=>{document.removeEventListener(r,n)})});const n=r=>{const o=z(t.element),i=z(t.ignore);o&&!o.contains(r.target)&&!(i&&i.contains(r.target))&&t.onPointer(r)}},Om=Cm,Dm=e=>{const t=I({dismissOnEscapeKeyDown:!0,dismissOnOutsidePointer:!0,closeOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:!0},e);Sm({enabled:t.dismissOnEscapeKeyDown,onEscapeKeyDown:n=>{t.onEscapeKeyDown?.(n),n.defaultPrevented||t.onDismiss("escapeKey")}}),Om({enabled:t.dismissOnOutsidePointer,strategy:t.closeOnOutsidePointerStrategy,ignore:t.dismissOnOutsidePointerIgnore,onPointer:n=>{if(t.onOutsidePointer?.(n),!n.defaultPrevented){const r=n.button===0&&n.ctrlKey===!0;if(n.button===2||r)return;t.onDismiss("pointerOutside")}},element:t.element}),Pm({enabled:t.noOutsidePointerEvents})},km=Dm,pi=ve(),Tm=e=>A(()=>{if(be(pi))return h(zl,e);const r=Le(),[o,i]=L([r]),s=l=>{i(c=>[...c,l])},a=l=>{i(c=>c.filter(u=>u!==l))};return h(pi.Provider,{value:{layers:o,onLayerShow:s,onLayerDismiss:a},get children(){return h(zl,e)}})}),zl=e=>{const t=I({enabled:!0,dismissOnEscapeKeyDown:!0,dismissOnOutsidePointer:!0,dismissOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:!0},e),[n,r]=U(t,["enabled","children","dismissOnEscapeKeyDown","dismissOnOutsidePointer","dismissOnOutsidePointerStrategy","dismissOnOutsidePointerIgnore","noOutsidePointerEvents","onDismiss"]),o=be(pi),i=Le();V(()=>{n.enabled?o.onLayerShow(i):o.onLayerDismiss(i)});const s=()=>o.layers()[o.layers().length-1]===i;km({dismissOnEscapeKeyDown:()=>z(n.dismissOnEscapeKeyDown)&&s()&&n.enabled,dismissOnOutsidePointer:()=>z(n.dismissOnOutsidePointer)&&s()&&n.enabled,dismissOnOutsidePointerStrategy:n.dismissOnOutsidePointerStrategy,dismissOnOutsidePointerIgnore:n.dismissOnOutsidePointerIgnore,noOutsidePointerEvents:()=>z(n.noOutsidePointerEvents)&&n.enabled,onDismiss:c=>{n.onDismiss(c)},...r});const a=A(()=>n.children),l=()=>{const c=a();return Xn(c)?c({get isLastLayer(){return s()}}):c};return Q(()=>l())},$m=Tm,Am=()=>{const[e,t]=L(!1);return V(()=>t(!0)),e},Mm=Am,Im=(e,t)=>(e&&(Xn(e)?e(t):e[0](e[1],t)),t.defaultPrevented),mi=(...e)=>e.some(t=>!!t()),Lm=e=>(...t)=>{for(const n of e)n&&n(...t)},Kr=(...e)=>Lm(e),ye=e=>e?"":void 0,Rm="div",Nm=e=>{const[t,n]=U(e,["as"]),r=A(()=>t.as??Rm);return A(()=>{const i=r();switch(typeof i){case"function":return Q(()=>i(n));case"string":return h(Nn,I({component:i},n))}})},yi=Nm,Fm=e=>{let t,n=!1;return()=>n?t:(n=!0,t=A(e))},Bl=Fm,_m=e=>A(()=>z(e.element)?.tagName.toLowerCase()||e.fallback),Vm=_m,jl="button",Km=e=>{const[t,n]=L(null),[r,o]=U(e,["as","ref","type"]),i=Vm({element:t,fallback:jl}),s=A(()=>bm(i(),r.type));return h(yi,I({get as(){return r.as??jl},ref(a){var l=Kr(n,r.ref);typeof l=="function"&&l(a)},get type(){return s()?"button":void 0},get role(){return s()?void 0:"button"}},o))},zm=Km,Bm='a[href]:not([tabindex="-1"]), button:not([tabindex="-1"]), input:not([tabindex="-1"]), textarea:not([tabindex="-1"]), select:not([tabindex="-1"]), details:not([tabindex="-1"]), [tabindex]:not([tabindex="-1"])',vi="focusTrap.initialFocus",bi="focusTrap.finalFocus",Ul={bubbles:!1,cancelable:!0},jm=e=>{const t=I({enabled:!0,observeChanges:!0,restoreFocus:!0},e),[n,r]=L(null),o=A(()=>{const g=n();return g?g[0]??null:null}),i=A(()=>{const g=n();return g?g[g.length-1]??null:null});let s=null;const a=()=>{l(z(t.element)),(document.activeElement===null||document.activeElement===document.body)&&c(z(t.element))};V(()=>{const g=z(t.element);if(g&&z(t.enabled)){s=document.activeElement,Q(()=>{l(g),c(g)});const p=new MutationObserver(a);z(t.observeChanges)&&p.observe(g,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabindex"]}),Z(()=>{z(t.observeChanges)&&p.disconnect(),r(null),m(g)})}}),V(()=>{const g=n();g===null||g.length!==0||(document.addEventListener("keydown",f),Z(()=>{document.removeEventListener("keydown",f)}))}),V(()=>{const g=o();g&&(g.addEventListener("keydown",u),Z(()=>{g.removeEventListener("keydown",u)}))}),V(()=>{const g=i();g&&(g.addEventListener("keydown",d),Z(()=>{g.removeEventListener("keydown",d)}))});const l=g=>{r(Array.from(g.querySelectorAll(Bm)))},c=g=>{const p=z(t.initialFocusElement)??o()??g,y=t.onInitialFocus;let v;y&&(v=new CustomEvent(vi,Ul),g.addEventListener(vi,y),g.dispatchEvent(v),g.removeEventListener(vi,y)),!v?.defaultPrevented&&cn(()=>p.focus())},u=g=>{g.key==="Tab"&&g.shiftKey&&(g.preventDefault(),i().focus())},d=g=>{g.key==="Tab"&&!g.shiftKey&&(g.preventDefault(),o().focus())},f=g=>{g.key==="Tab"&&g.preventDefault()},m=g=>{if(!z(t.restoreFocus))return;const y=z(t.finalFocusElement)??s;if(!y)return;let v;const b=t.onFinalFocus;b&&(v=new CustomEvent(bi,Ul),g.addEventListener(bi,b),g.dispatchEvent(v),g.removeEventListener(bi,b)),!v?.defaultPrevented&&cn(()=>y.focus())}},Um=jm,Wm=Um,Hm=e=>{const t=A(()=>{const s=z(e.element);if(s)return getComputedStyle(s)}),n=()=>t()?.animationName??"none",[r,o]=L(z(e.show)?"present":"hidden");let i="none";return V(s=>{const a=z(e.show);return Q(()=>{if(s===a)return a;const l=i,c=n();a?o("present"):c==="none"||t()?.display==="none"?o("hidden"):o(s&&l!==c?"hiding":"hidden")}),a}),V(()=>{const s=z(e.element);if(!s)return;const a=c=>{c.target===s&&(i=n())},l=c=>{const d=n().includes(c.animationName);c.target===s&&d&&r()==="hiding"&&o("hidden")};s.addEventListener("animationstart",a),s.addEventListener("animationcancel",l),s.addEventListener("animationend",l),Z(()=>{s.removeEventListener("animationstart",a),s.removeEventListener("animationcancel",l),s.removeEventListener("animationend",l)})}),{present:()=>r()==="present"||r()==="hiding",state:r}},Ym=Hm,Wl=Ym,Gm=ve(),qm=e=>e?Vr(`dialog-${e}`):Gm,Hl=ve(),Zm=e=>e?Vr(`dialog-internal-${e}`):Hl,yn=e=>{if(!e){const n=be(Hl);if(!n)throw new Error("[corvu]: Dialog context not found. Make sure to wrap Dialog components in <Dialog.Root>");return n}const t=hi(`dialog-internal-${e}`);if(!t)throw new Error(`[corvu]: Dialog context with id "${e}" not found. Make sure to wrap Dialog components in <Dialog.Root contextId="${e}">`);return t},Xm="div",Jm=e=>{const[t,n]=U(e,["as","forceMount","contextId","children","ref","style","data-corvu-dialog-content"]),r=A(()=>yn(t.contextId)),o=()=>mi(r().open,()=>t.forceMount,r().contentPresent),i=A(s=>s||o(),!1);return h(ie,{get when(){return i()},get children(){return h($m,{get element(){return r().contentRef},get enabled(){return r().open()||r().contentPresent()},onDismiss:()=>r().setOpen(!1),get dismissOnEscapeKeyDown(){return r().closeOnEscapeKeyDown},get dismissOnOutsidePointer(){return r().closeOnOutsidePointer},get dismissOnOutsidePointerStrategy(){return r().closeOnOutsidePointerStrategy},get dismissOnOutsidePointerIgnore(){return r().triggerRef},get noOutsidePointerEvents(){return r().noOutsidePointerEvents},get onEscapeKeyDown(){return r().onEscapeKeyDown},get onOutsidePointer(){return r().onOutsidePointer},children:s=>{const a=A(()=>t.children);return h(ie,{get when(){return o()},get children(){return h(yi,I({ref(l){var c=Kr(r().setContentRef,t.ref);typeof c=="function"&&c(l)},get as(){return t.as??Xm},get role(){return r().role()},get id(){return r().dialogId()},get"aria-labelledby"(){return r().labelId()},get"aria-describedby"(){return r().descriptionId()},get"aria-modal"(){return r().modal()?"true":"false"},get"data-open"(){return ye(r().open())},get"data-closed"(){return ye(!r().open())},get"data-corvu-dialog-content"(){return t.hasOwnProperty("data-corvu-dialog-content")?t["data-corvu-dialog-content"]:""},tabIndex:"-1",get style(){return{"pointer-events":s.isLastLayer?"auto":void 0,...t.style}}},n,{get children(){return a()}}))}})}})}})},Qm=Jm,ey="div",ty=e=>{const[t,n]=U(e,["as","forceMount","contextId","children","ref","style","data-corvu-dialog-overlay"]),r=A(()=>yn(t.contextId)),o=()=>mi(r().open,()=>t.forceMount,r().overlayPresent),i=A(s=>s||o(),!1);return h(ie,{get when(){return i()},get children(){return(()=>{const s=A(()=>t.children);return h(ie,{get when(){return o()},get children(){return h(yi,I({get as(){return t.as??ey},ref(a){var l=Kr(r().setOverlayRef,t.ref);typeof l=="function"&&l(a)},"aria-hidden":"true",get"data-open"(){return ye(r().open())},get"data-closed"(){return ye(!r().open())},get"data-corvu-dialog-overlay"(){return t.hasOwnProperty("data-corvu-dialog-overlay")?t["data-corvu-dialog-overlay"]:""},tabIndex:"-1",get style(){return{"pointer-events":"auto",...t.style}}},n,{get children(){return s()}}))}})})()}})},ny=ty,ry=e=>{const[t,n]=U(e,["forceMount","contextId","children"]),r=A(()=>yn(t.contextId)),o=()=>mi(r().open,()=>t.forceMount,r().contentPresent,r().overlayPresent),i=Mm(),s=A(a=>a||o()&&i(),!1);return h(ie,{get when(){return s()},get children(){return(()=>{const a=A(()=>t.children);return h(ie,{get when(){return o()},get children(){return h(Mo,I(n,{get children(){return a()}}))}})})()}})},oy=ry,wi=!0,iy=e=>{const t=I({role:"dialog",initialOpen:!1,modal:!0,closeOnEscapeKeyDown:!0,closeOnOutsidePointer:()=>!!(e.modal??wi),closeOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:()=>!!(e.modal??wi),preventScroll:()=>!!(e.modal??wi),hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",allowPinchZoom:!0,trapFocus:!0,restoreFocus:!0,dialogId:Le()},e),[n,r]=gi({value:()=>t.open,initialValue:t.initialOpen,onChange:t.onOpenChange}),[o,i,s]=Kl({value:()=>t.labelId??Le()}),[a,l,c]=Kl({value:()=>t.descriptionId??Le()}),[u,d]=L(null),[f,m]=L(null),[g,p]=L(null),{present:y}=Wl({show:n,element:f}),{present:v}=Wl({show:n,element:g});Wm({element:f,enabled:()=>n()&&t.trapFocus,initialFocusElement:()=>t.initialFocusEl??null,restoreFocus:()=>t.restoreFocus,finalFocusElement:()=>t.finalFocusEl??null,onFinalFocus:t.onFinalFocus,onInitialFocus:t.onInitialFocus}),Xa({element:f,enabled:()=>y()&&z(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>t.preventScrollbarShift,preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom});const b={get role(){return t.role},get open(){return n()},setOpen:r,get modal(){return t.modal},get closeOnEscapeKeyDown(){return t.closeOnEscapeKeyDown},get closeOnOutsidePointer(){return z(t.closeOnOutsidePointer)},get closeOnOutsidePointerStrategy(){return t.closeOnOutsidePointerStrategy},get noOutsidePointerEvents(){return z(t.noOutsidePointerEvents)},get preventScroll(){return z(t.preventScroll)},get hideScrollbar(){return t.hideScrollbar},get preventScrollbarShift(){return z(t.preventScrollbarShift)},get preventScrollbarShiftMode(){return t.preventScrollbarShiftMode},get allowPinchZoom(){return t.allowPinchZoom},get trapFocus(){return t.trapFocus},get restoreFocus(){return t.restoreFocus},get initialFocusEl(){return t.initialFocusEl},get finalFocusEl(){return t.finalFocusEl},get contentPresent(){return y()},get contentRef(){return f()},get overlayPresent(){return v()},get overlayRef(){return g()},get dialogId(){return t.dialogId},get labelId(){return o()},get descriptionId(){return a()}},w=Bl(()=>t.children),x=()=>{const O=w()();return Xn(O)?O(b):O};return A(()=>{const O=qm(t.contextId),k=Zm(t.contextId);return h(O.Provider,{value:{role:()=>t.role,open:n,setOpen:r,modal:()=>t.modal,closeOnEscapeKeyDown:()=>t.closeOnEscapeKeyDown,closeOnOutsidePointer:()=>z(t.closeOnOutsidePointer),closeOnOutsidePointerStrategy:()=>t.closeOnOutsidePointerStrategy,noOutsidePointerEvents:()=>z(t.noOutsidePointerEvents),preventScroll:()=>z(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>z(t.preventScrollbarShift),preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom,trapFocus:()=>t.trapFocus,restoreFocus:()=>t.restoreFocus,initialFocusEl:()=>t.initialFocusEl,finalFocusEl:()=>t.finalFocusEl,contentPresent:y,contentRef:f,overlayPresent:v,overlayRef:g,dialogId:()=>t.dialogId,labelId:o,descriptionId:a},get children(){return h(k.Provider,{get value(){return{role:()=>t.role,open:n,setOpen:r,modal:()=>t.modal,closeOnEscapeKeyDown:()=>t.closeOnEscapeKeyDown,onEscapeKeyDown:t.onEscapeKeyDown,closeOnOutsidePointer:()=>z(t.closeOnOutsidePointer),closeOnOutsidePointerStrategy:()=>t.closeOnOutsidePointerStrategy,onOutsidePointer:t.onOutsidePointer,noOutsidePointerEvents:()=>z(t.noOutsidePointerEvents),preventScroll:()=>z(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>z(t.preventScrollbarShift),preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom,trapFocus:()=>t.trapFocus,restoreFocus:()=>t.restoreFocus,initialFocusEl:()=>t.initialFocusEl,finalFocusEl:()=>t.finalFocusEl,contentPresent:y,contentRef:f,overlayPresent:v,overlayRef:g,dialogId:()=>t.dialogId,labelId:o,registerLabelId:i,unregisterLabelId:s,descriptionId:a,registerDescriptionId:l,unregisterDescriptionId:c,setContentRef:m,setOverlayRef:p,triggerRef:u,setTriggerRef:d}},get children(){return Q(()=>x())}})}})})},sy=iy,ay="button",ly=e=>{const[t,n]=U(e,["as","contextId","ref","onClick","data-corvu-dialog-trigger"]),r=A(()=>yn(t.contextId));return h(zm,I({ref(i){var s=Kr(r().setTriggerRef,t.ref);typeof s=="function"&&s(i)},get as(){return t.as??ay},onClick:i=>{!Im(t.onClick,i)&&r().setOpen(s=>!s)},"aria-haspopup":"dialog",get"aria-expanded"(){return r().open()?"true":"false"},get"aria-controls"(){return r().dialogId()},get"data-open"(){return ye(r().open())},get"data-closed"(){return ye(!r().open())},get"data-corvu-dialog-trigger"(){return t.hasOwnProperty("data-corvu-dialog-trigger")?t["data-corvu-dialog-trigger"]:""}},n))},cy=ly;function uy(e){const t=I({enabled:!0,dimension:"both"},e),[n,r]=L(!1),[o,i]=L(null);let s=null;V(()=>{const c=z(t.element),u=z(t.enabled);if(!c||!u)return;const d=new ResizeObserver(a);d.observe(c),c.addEventListener("transitionend",l),Z(()=>{d.disconnect(),c.removeEventListener("transitionend",l),l()})});const a=c=>{if(!n())for(const u of c){const d=u.target;if(d!==z(t.element))continue;const f=[d.offsetWidth,d.offsetHeight],m=z(t.dimension);m==="both"?s?s[0]!==f[0]&&s[1]!==f[1]&&(Be(()=>{i(s),r(!0)}),cn(()=>{i(f),parseFloat(getComputedStyle(u.target).transitionDuration)===0&&l()})):s=f:s?zr(m,s)!==zr(m,f)&&(Be(()=>{i(zr(m,s)),r(!0)}),cn(()=>{i(zr(m,f)),parseFloat(getComputedStyle(u.target).transitionDuration)===0&&l()})):s=f}},l=()=>{if(!n())return;const c=z(t.element);c?s=[c.offsetWidth,c.offsetHeight]:s=null,Be(()=>{r(!1),i(null)})};return{transitioning:n,transitionSize:o}}var zr=(e,t)=>{switch(e){case"width":return t[0];case"height":return t[1]}},dy=uy,fy=dy,gy=(e,t)=>e.length>0?()=>e(Q(t)):e;function hy(e,t){let n=0;const r=e.map((o,i)=>A(()=>(n=i,o()),void 0,zf));return A(()=>r.map(o=>o())[n],void 0,t)}function Yl(e,t,n){let r=()=>t;const[o,i]=L(t),s=A(gy(e,()=>r()),t);return[r=hy([o,s],n),a=>i(()=>typeof a=="function"?a(Q(r)):a)]}var py=e=>h(cy,I({"data-corvu-dialog-trigger":void 0,"data-corvu-drawer-trigger":""},e)),Gl=ve(),my=e=>e?Vr(`drawer-${e}`):Gl,yy=e=>{if(!e){const n=be(Gl);if(!n)throw new Error("[corvu]: Drawer context not found. Make sure to wrap Drawer components in <Drawer.Root>");return n}const t=hi(`drawer-${e}`);if(!t)throw new Error(`[corvu]: Drawer context with id "${e}" not found. Make sure to wrap Drawer components in <Drawer.Root contextId="${e}">`);return t},ql=ve(),vy=e=>e?Vr(`drawer-internal-${e}`):ql,Zl=e=>{if(!e){const n=be(ql);if(!n)throw new Error("[corvu]: Drawer context not found. Make sure to wrap Drawer components in <Drawer.Root>");return n}const t=hi(`drawer-internal-${e}`);if(!t)throw new Error(`[corvu]: Drawer context with id "${e}" not found. Make sure to wrap Drawer components in <Drawer.Root contextId="${e}">`);return t},Xl=(e,t,n,r)=>{if(n===void 0||r===void 0)return{value:e,offset:Br(e,t)};const o=r[n-1]?Br(r[n-1],t):void 0,i=r[n]?Br(r[n],t):void 0;return{value:e,offset:Br(e,t),lowerBreakPoint:i,upperBreakPoint:o}},Br=(e,t)=>{if(typeof e=="number")return t-e*t;if(!e.endsWith("px"))throw new Error(`[corvu] Snap and break points must be a number or a string ending with 'px'. Got ${e}`);return t-parseInt(e,10)},by=(e,t,n,r)=>{const o=Jl("upper",e,r?n:t),i=Jl("lower",e,r?n:t);return o?i?i.upperBreakPoint===void 0||o.lowerBreakPoint===void 0?Math.abs(i.offset-n)<Math.abs(o.offset-n)?i:o:n<o.lowerBreakPoint?i:o:o:i},Jl=(e,t,n)=>t.reduce((r,o)=>e=="upper"&&o.offset>=n&&(!r||o.offset<r.offset)||e=="lower"&&o.offset<=n&&(!r||o.offset>r.offset)?o:r,void 0),wy=(e,t)=>{let n=e,r=!1;do{if(n.hasAttribute("data-corvu-no-drag")||n.type==="range")return!1;n===(t??document.documentElement)?r=!0:n=n.parentElement}while(n&&!r);return!0},xy=void 0,Sy=e=>{const t=I({initialOpen:!1,snapPoints:[0,1],breakPoints:[xy],defaultSnapPoint:1,side:"bottom",dampFunction:N=>6*Math.log(N+1),velocityFunction:(N,X)=>{const he=N/X;return he<1&&he>-1?1:he},velocityCacheReset:200,allowSkippingSnapPoints:!0,handleScrollableElements:!0,transitionResize:!1,closeOnOutsidePointer:!0,allowPinchZoom:!1},e),[n,r]=U(t,["snapPoints","breakPoints","defaultSnapPoint","activeSnapPoint","onActiveSnapPointChange","side","dampFunction","velocityFunction","velocityCacheReset","allowSkippingSnapPoints","handleScrollableElements","transitionResize","open","initialOpen","onOpenChange","closeOnOutsidePointer","contextId","children"]),[o,i]=gi({value:()=>n.open,initialValue:n.initialOpen,onChange:n.onOpenChange}),[s,a]=gi({value:()=>n.activeSnapPoint,initialValue:0,onChange:n.onActiveSnapPointChange}),[l,c]=L(),{transitioning:u,transitionSize:d}=fy({element:()=>l()?.contentRef()??null,enabled:()=>o()&&n.transitionResize,dimension:()=>{switch(n.side){case"top":case"bottom":return"height";case"left":case"right":return"width"}}}),[f,m]=L(!1),[g,p]=Yl(()=>u()?"resizing":null),y=A(()=>{const N=l()?.contentRef();if(N)return getComputedStyle(N)}),[v,b]=L(!1);V(()=>{const N=o();Q(()=>{v()!==N&&(N?(b(!0),cn(()=>{Be(()=>{p("opening"),a(n.defaultSnapPoint)}),parseFloat(y().transitionDuration)===0&&p(null)})):(Be(()=>{p("closing"),a(0)}),cn(()=>{parseFloat(y().transitionDuration)===0&&w()})))})});const w=()=>{Be(()=>{b(!1),p(null)})},[x,T]=L(0);V(()=>{const N=l()?.contentRef();if(!N)return;k(N);const X=new ResizeObserver(O);X.observe(N),Z(()=>{X.disconnect()})});const O=N=>{for(const X of N)X.target===l()?.contentRef()&&k(X.target)},k=N=>{const X=Q(()=>x());switch(n.side){case"top":case"bottom":if(X===N.offsetHeight)return;T(N.offsetHeight);break;case"left":case"right":if(X===N.offsetWidth)return;T(N.offsetWidth);break}},j=A(()=>Xl(s(),x())),[P,M]=Yl(()=>j().offset),$=A(()=>x()?(x()-P())/x():0),R={get snapPoints(){return n.snapPoints},get breakPoints(){return n.breakPoints},get defaultSnapPoint(){return n.defaultSnapPoint},get activeSnapPoint(){return s()},setActiveSnapPoint:a,get side(){return n.side},get isDragging(){return f()},get isTransitioning(){return g()!==null},get transitionState(){return g()},get openPercentage(){return $()},get translate(){return P()},get velocityCacheReset(){return n.velocityCacheReset},get allowSkippingSnapPoints(){return n.allowSkippingSnapPoints},get handleScrollableElements(){return n.handleScrollableElements},get transitionResize(){return n.transitionResize}},se=Bl(()=>n.children),J=N=>{c(yn(n.contextId));const X=se()();if(Xn(X)){const he=I(N,R);return X(he)}return X};return A(()=>{const N=my(n.contextId),X=vy(n.contextId);return Q(()=>h(N.Provider,{value:{snapPoints:()=>n.snapPoints,breakPoints:()=>n.breakPoints,defaultSnapPoint:()=>n.defaultSnapPoint,activeSnapPoint:s,setActiveSnapPoint:a,side:()=>n.side,isDragging:f,isTransitioning:()=>g()!==null,transitionState:g,openPercentage:$,translate:P,velocityCacheReset:()=>n.velocityCacheReset,allowSkippingSnapPoints:()=>n.allowSkippingSnapPoints,handleScrollableElements:()=>n.handleScrollableElements,transitionResize:()=>n.transitionResize},get children(){return h(X.Provider,{get value(){return{snapPoints:()=>n.snapPoints,breakPoints:()=>n.breakPoints,defaultSnapPoint:()=>n.defaultSnapPoint,activeSnapPoint:s,setActiveSnapPoint:a,side:()=>n.side,isDragging:f,isTransitioning:()=>g()!==null,transitionState:g,openPercentage:$,translate:P,velocityCacheReset:()=>n.velocityCacheReset,allowSkippingSnapPoints:()=>n.allowSkippingSnapPoints,handleScrollableElements:()=>n.handleScrollableElements,transitionResize:()=>n.transitionResize,dampFunction:n.dampFunction,velocityFunction:n.velocityFunction,setIsDragging:m,setTranslate:M,drawerSize:x,resolvedActiveSnapPoint:j,drawerStyles:y,setTransitionState:p,transitionSize:d,closeDrawer:w}},get children(){return h(sy,I({get open(){return v()},onOpenChange:i,get contextId(){return n.contextId},get closeOnOutsidePointer(){return!f()&&n.closeOnOutsidePointer}},r,{children:he=>J(he)}))}})}}))})},Ey=Sy,Py=e=>{const[t,n]=U(e,["contextId","style"]);let r=!1,o=null,i=[0,0],s,a=0;const l=A(()=>Zl(t.contextId)),c=A(()=>yn(t.contextId)),u=A(()=>l().snapPoints().map((w,x)=>Xl(w,l().drawerSize(),x,l().breakPoints()))),d=A(()=>{switch(l().side()){case"top":return`translate3d(0, ${-l().translate()}px, 0)`;case"bottom":return`translate3d(0, ${l().translate()}px, 0)`;case"right":return`translate3d(${l().translate()}px, 0, 0)`;case"left":return`translate3d(${-l().translate()}px, 0, 0)`}}),f=A(()=>{const w=l().transitionSize();if(w)switch(l().side()){case"top":case"bottom":return`${w}px`}}),m=A(()=>{const w=l().transitionSize();if(w)switch(l().side()){case"left":case"right":return`${w}px`}});V(()=>{c().open()&&(document.addEventListener("pointermove",p),document.addEventListener("touchmove",y),document.addEventListener("pointerup",b),document.addEventListener("touchend",b),Z(()=>{document.removeEventListener("pointermove",p),document.removeEventListener("touchmove",y),document.removeEventListener("pointerup",b),document.removeEventListener("touchend",b)}))});const g=w=>{wy(w.target,c().contentRef())&&l().transitionState()!=="closing"&&(r=!0,l().handleScrollableElements()&&(i=[w.clientX,w.clientY]))},p=w=>{v(w.target,w.clientX,w.clientY)},y=w=>{w.touches[0]&&v(w.target,w.touches[0].clientX,w.touches[0].clientY)},v=(w,x,T)=>{if(!r)return;if(!l().isDragging()||o===null){const j=window.getSelection();if(j&&j.toString().length>0){b();return}if(l().handleScrollableElements()){const P=[x,T].map((re,N)=>i[N]-re),M=Math.abs(P[0])>Math.abs(P[1])?"x":"y",$=M==="x"?P[0]:P[1];if(Math.abs($)<.3)return;const R=c().contentRef(),[se,J]=Ha(w,M,R);if($>0&&Math.abs(se)>1||$<0&&Math.abs(J)>0){b();return}}switch(l().side()){case"top":case"bottom":o=T;break;case"right":case"left":o=x}s=new Date,a=l().translate(),Be(()=>{l().setIsDragging(!0),l().setTransitionState(null)})}let O;switch(l().side()){case"top":O=-(o-T);break;case"bottom":O=o-T;break;case"right":O=o-x;break;case"left":O=-(o-x);break}O-=l().resolvedActiveSnapPoint().offset,O>0&&(O=l().dampFunction(O));const k=new Date;k.getTime()-s.getTime()>l().velocityCacheReset()&&(s=k,a=l().translate()),l().setTranslate(-O)},b=()=>{if(r=!1,!l().isDragging())return;const w=new Date,x=l().velocityFunction(-(a-l().translate()),w.getTime()-s.getTime()||1),T=l().translate()*x,O=by(u(),l().translate(),T,l().allowSkippingSnapPoints());Be(()=>{l().setTransitionState("snapping"),l().setIsDragging(!1)}),Be(()=>{l().setActiveSnapPoint(O.value),O.offset===l().drawerSize()?c().setOpen(!1):(l().setTranslate(O.offset),parseFloat(l().drawerStyles().transitionDuration)===0&&l().setTransitionState(null))})};return h(Qm,I({get contextId(){return t.contextId},get style(){return{transform:d(),"transition-duration":l().isDragging()?"0ms":void 0,height:f(),width:m(),...t.style}},onPointerDown:g,onTransitionEnd:()=>{Be(()=>{l().transitionState()==="closing"&&l().closeDrawer(),l().transitionState()!=="resizing"&&l().setTransitionState(null)})},get"data-transitioning"(){return ye(l().isTransitioning())},get"data-opening"(){return ye(l().transitionState()==="opening")},get"data-closing"(){return ye(l().transitionState()==="closing")},get"data-snapping"(){return ye(l().transitionState()==="snapping")},get"data-resizing"(){return ye(l().transitionState()==="resizing")},"data-corvu-dialog-content":void 0,"data-corvu-drawer-content":""},n))},Cy=Py,Oy=e=>{const[t,n]=U(e,["contextId"]),r=A(()=>Zl(t.contextId));return h(ny,I({get contextId(){return t.contextId},get"data-transitioning"(){return ye(r().isTransitioning())},get"data-opening"(){return ye(r().transitionState()==="opening")},get"data-closing"(){return ye(r().transitionState()==="closing")},get"data-snapping"(){return ye(r().transitionState()==="snapping")},get"data-resizing"(){return ye(r().transitionState()==="resizing")},"data-corvu-dialog-overlay":void 0,"data-corvu-drawer-overlay":""},n))},Dy=Oy,ky=B('<div class="mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted">');const Ty=Ey,$y=py,Ay=oy,My=e=>{const[,t]=U(e,["class"]),n=yy();return h(Dy,I({get class(){return le("absolute inset-0 z-50 data-[transitioning]:transition-colors data-[transitioning]:duration-300",e.class)},get style(){return{"background-color":`rgb(0 0 0 / ${.6*n.openPercentage()})`}}},t))},Iy=e=>{const[,t]=U(e,["class","children"]);return h(Ay,{get mount(){return zn()},get children(){return[h(My,{}),h(Cy,I({get class(){return le("absolute inset-x-0 bottom-0 z-50 mt-24 flex h-auto max-h-[80%] flex-col rounded-t-[10px] border bg-background after:top-full after:h-[50%] after:bg-inherit md:select-none transition-transform duration-300",e.class)}},t,{get children(){return[ky(),A(()=>e.children)]}}))]}})};var Ly=B('<span class="font-semibold mt-2">'),Ry=B('<div class="flex py-4 pl-3 pr-1 flex-col w-full space-y-4 overflow-y-auto">'),Ny=B('<div class="flex flex-col space-y-2"><div>'),Fy=B('<div class="flex flex-col w-full space-y-1"><span class="font-semibold text-slate-700">'),_y=B('<div class="flex flex-col items-start"><span class=text-slate-500>');const Vy=({options:e,text:t,title:n})=>{const{pushMessage:r}=Tt(),[o,i]=L(!1),[s,a]=L(!1),[l,c]=L(),u=(d,f)=>{a(!1),i(!0),r(d,f)};return(()=>{var d=Ny(),f=d.firstChild;return F(d,h(zt,{get children(){return t?.trim()}}),f),F(f,h(Ty,{get open(){return s()},onOpenChange:a,get children(){return[h($y,{as:Ce,variant:"outline",class:"w-full text-nowrap",get children(){return n?.trim()??"Select an option"}}),h(Iy,{class:"pb-2 px-2 flex flex-col items-center justify-center",get children(){return[(()=>{var m=Ly();return F(m,()=>n?.trim()??"Select an option"),m})(),(()=>{var m=Ry();return F(m,h(Zt,{each:e,children:g=>(()=>{var p=Fy(),y=p.firstChild;return F(y,()=>g.label?.trim()??""),F(p,h(Zt,{get each(){return g.items},children:v=>h(Ce,{variant:"outline",get disabled(){return o()},get class(){return`py-6 flex justify-between hover:bg-slate-200 ${l()===v?"bg-slate-200":""}`},onClick:()=>c(v),get children(){return[(()=>{var b=_y(),w=b.firstChild;return F(b,()=>v.label?.trim(),w),F(w,()=>v.description?.trim()),b})(),h(ie,{get when(){return l()===v},get fallback(){return h(Ap,{class:"size-4 text-slate-500"})},get children(){return h($p,{class:"size-4 text-slate-500"})}})]}})}),null),p})()})),m})(),h(Ce,{get disabled(){return o()||!l()},onClick:()=>u(l().label,l().value),class:"w-11/12 mt-4 hover:bg-primary shadow-sm hover:shadow-primary transition-shadow",children:"Send"})]}})]}})),ue(()=>xt(f,o()?"opacity-50":"")),d})()};var Ky=B("<audio controls preload=auto class=h-8><source type=audio/mpeg><source type=audio/ogg>Your browser does not support the audio element.");const zy=e=>(()=>{var t=Ky(),n=t.firstChild,r=n.nextSibling;return ue(o=>{var i=e.link,s=e.link;return i!==o.e&&xe(n,"src",o.e=i),s!==o.t&&xe(r,"src",o.t=s),o},{e:void 0,t:void 0}),t})();var By=B('<div class="flex flex-col space-y-2"><a class="self-center hover:brightness-75 transition-all duration-300 flex flex-col items-center justify-between bg-slate-200 rounded-md px-1 py-1 space-y-2 text-slate-700"target=_blank><span class="font-semibold text-sm">');const jy=e=>(()=>{var t=By(),n=t.firstChild,r=n.firstChild;return F(n,h(Mp,{class:"size-10"}),r),F(r,()=>e.filename?.trim()),F(t,h(zt,{get children(){return e.text?.trim()}}),null),ue(()=>xe(n,"href",e.link)),t})();var Uy=B('<div class="flex flex-col space-y-2"><a class="object-contain hover:brightness-50 transition-all duration-300"target=_blank><img class="w-full h-auto rounded-md">');const Wy=e=>(()=>{var t=Uy(),n=t.firstChild,r=n.firstChild;return F(t,h(zt,{get children(){return e.text?.trim()}}),null),ue(o=>{var i=e.link,s=e.link,a=e.text?.trim();return i!==o.e&&xe(n,"href",o.e=i),s!==o.t&&xe(r,"src",o.t=s),a!==o.a&&xe(r,"alt",o.a=a),o},{e:void 0,t:void 0,a:void 0}),t})();var Hy=B('<div class="flex flex-col space-y-2"><video controls preload=auto class="size-full rounded-md"><source type=video/mp4><source type=video/ogg>Your browser does not support the video element.');const Yy=e=>(()=>{var t=Hy(),n=t.firstChild,r=n.firstChild,o=r.nextSibling;return F(t,h(zt,{get children(){return e.text?.trim()}}),null),ue(i=>{var s=e.link,a=e.link;return s!==i.e&&xe(r,"src",i.e=s),a!==i.t&&xe(o,"src",i.t=a),i},{e:void 0,t:void 0}),t})();var Gy=B("<div>Media type not supported");const Ql=e=>e.type==="image"?h(Wy,e):e.type==="audio"?h(zy,e):e.type==="document"?h(jy,e):e.type==="video"?h(Yy,e):Gy(),ec=({text:e})=>h(zt,{get children(){return e?.trim()}});function qy(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function $t(e={}){const{strict:t=!0,hookName:n="useContext",providerName:r="Provider",errorMessage:o,defaultValue:i}=e,s=ve(i);function a(){const l=be(s);if(!l&&t){const c=new Error(o??qy(n,r));throw c.name="ContextError",Error.captureStackTrace?.(c,a),c}return l}return[s.Provider,a,s]}const Zy=Symbol(),tc=Object.getPrototypeOf,xi=new WeakMap,Xy=e=>e&&(xi.has(e)?xi.get(e):tc(e)===Object.prototype||tc(e)===Array.prototype),Jy=e=>Xy(e)&&e[Zy]||null,nc=(e,t=!0)=>{xi.set(e,t)};function Qy(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global}function rc(e,t){const n=Qy();return n?(n[e]||(n[e]=t()),n[e]):t()}var jr=()=>process.env.NODE_ENV!=="production",Si=e=>typeof e=="object"&&e!==null,Bt=rc("__zag__proxyStateMap",()=>new WeakMap),Jn=rc("__zag__refSet",()=>new WeakSet),ev=(e=Object.is,t=(c,u)=>new Proxy(c,u),n=c=>Si(c)&&!Jn.has(c)&&(Array.isArray(c)||!(Symbol.iterator in c))&&!(c instanceof WeakMap)&&!(c instanceof WeakSet)&&!(c instanceof Error)&&!(c instanceof Number)&&!(c instanceof Date)&&!(c instanceof String)&&!(c instanceof RegExp)&&!(c instanceof ArrayBuffer),r=c=>{switch(c.status){case"fulfilled":return c.value;case"rejected":throw c.reason;default:throw c}},o=new WeakMap,i=(c,u,d=r)=>{const f=o.get(c);if(f?.[0]===u)return f[1];const m=Array.isArray(c)?[]:Object.create(Object.getPrototypeOf(c));return nc(m,!0),o.set(c,[u,m]),Reflect.ownKeys(c).forEach(g=>{const p=Reflect.get(c,g);Jn.has(p)?(nc(p,!1),m[g]=p):p instanceof Promise?Object.defineProperty(m,g,{get(){return d(p)}}):Bt.has(p)?m[g]=vn(p,d):m[g]=p}),Object.freeze(m)},s=new WeakMap,a=[1,1],l=c=>{if(!Si(c))throw new Error("object required");const u=s.get(c);if(u)return u;let d=a[0];const f=new Set,m=(P,M=++a[0])=>{d!==M&&(d=M,f.forEach($=>$(P,M)))};let g=a[1];const p=(P=++a[1])=>(g!==P&&!f.size&&(g=P,v.forEach(([M])=>{const $=M[1](P);$>d&&(d=$)})),d),y=P=>(M,$)=>{const R=[...M];R[1]=[P,...R[1]],m(R,$)},v=new Map,b=(P,M)=>{if(jr()&&v.has(P))throw new Error("prop listener already exists");if(f.size){const $=M[3](y(P));v.set(P,[M,$])}else v.set(P,[M])},w=P=>{const M=v.get(P);M&&(v.delete(P),M[1]?.())},x=P=>(f.add(P),f.size===1&&v.forEach(([$,R],se)=>{if(jr()&&R)throw new Error("remove already exists");const J=$[3](y(se));v.set(se,[$,J])}),()=>{f.delete(P),f.size===0&&v.forEach(([$,R],se)=>{R&&(R(),v.set(se,[$]))})}),T=Array.isArray(c)?[]:Object.create(Object.getPrototypeOf(c)),k=t(T,{deleteProperty(P,M){const $=Reflect.get(P,M);w(M);const R=Reflect.deleteProperty(P,M);return R&&m(["delete",[M],$]),R},set(P,M,$,R){const se=Reflect.has(P,M),J=Reflect.get(P,M,R);if(se&&(e(J,$)||s.has($)&&e(J,s.get($))))return!0;w(M),Si($)&&($=Jy($)||$);let re=$;if(!Object.getOwnPropertyDescriptor(P,M)?.set)if($ instanceof Promise)$.then(N=>{Object.assign($,{status:"fulfilled",value:N}),m(["resolve",[M],N])}).catch(N=>{Object.assign($,{status:"rejected",reason:N}),m(["reject",[M],N])});else{!Bt.has($)&&n($)&&(re=Ei($));const N=!Jn.has(re)&&Bt.get(re);N&&b(M,N)}return Reflect.set(P,M,re,R),m(["set",[M],$,J]),!0}});s.set(c,k);const j=[T,p,i,x];return Bt.set(k,j),Reflect.ownKeys(c).forEach(P=>{const M=Object.getOwnPropertyDescriptor(c,P);M.get||M.set?Object.defineProperty(T,P,M):k[P]=c[P]}),k})=>[l,Bt,Jn,e,t,n,r,o,i,s,a],[tv]=ev();function Ei(e={}){return tv(e)}function oc(e,t,n){const r=Bt.get(e);jr()&&!r&&console.warn("Please use proxy object");let o;const i=[],s=r[3];let a=!1;const c=s(u=>{if(i.push(u),n){t(i.splice(0));return}o||(o=Promise.resolve().then(()=>{o=void 0,a&&t(i.splice(0))}))});return a=!0,()=>{a=!1,c()}}function vn(e,t){const n=Bt.get(e);jr()&&!n&&console.warn("Please use proxy object");const[r,o,i]=n;return i(r,o(),t)}function Ur(e){return Jn.add(e),e}function nv(e,t){Object.keys(t).forEach(o=>{if(Object.getOwnPropertyDescriptor(e,o))throw new Error("object property already defined");const i=t[o],{get:s,set:a}=typeof i=="function"?{get:i}:i,l={};l.get=()=>s(vn(r)),a&&(l.set=c=>a(r,c)),Object.defineProperty(e,o,l)});const r=Ei(e);return r}function ic(e,t,n){typeof n.value=="object"&&(n.value=bn(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||t==="__proto__"?Object.defineProperty(e,t,n):e[t]=n.value}function bn(e){if(typeof e!="object")return e;var t=0,n,r,o,i=Object.prototype.toString.call(e);if(i==="[object Object]"?o=Object.create(e.__proto__||null):i==="[object Array]"?o=Array(e.length):i==="[object Set]"?(o=new Set,e.forEach(function(s){o.add(bn(s))})):i==="[object Map]"?(o=new Map,e.forEach(function(s,a){o.set(bn(a),bn(s))})):i==="[object Date]"?o=new Date(+e):i==="[object RegExp]"?o=new RegExp(e.source,e.flags):i==="[object DataView]"?o=new e.constructor(bn(e.buffer)):i==="[object ArrayBuffer]"?o=e.slice(0):i.slice(-6)==="Array]"&&(o=new e.constructor(e)),o){for(r=Object.getOwnPropertySymbols(e);t<r.length;t++)ic(o,r[t],Object.getOwnPropertyDescriptor(e,r[t]));for(t=0,r=Object.getOwnPropertyNames(e);t<r.length;t++)Object.hasOwnProperty.call(o,n=r[t])&&o[n]===e[n]||ic(o,n,Object.getOwnPropertyDescriptor(e,n))}return o||e}var rv=Object.defineProperty,ov=(e,t,n)=>t in e?rv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_=(e,t,n)=>ov(e,typeof t!="symbol"?t+"":t,n);function iv(e){for(;e.length>0;)e.pop();return e}var sc=(e,...t)=>(typeof e=="function"?e(...t):e)??void 0,dt=e=>e,sv=()=>{},av=(...e)=>(...t)=>{e.forEach(function(n){n?.(...t)})},ac=(()=>{let e=0;return()=>(e++,e.toString(36))})(),lv=()=>process.env.NODE_ENV!=="production",Wr=e=>Array.isArray(e),Qn=e=>!(e==null||typeof e!="object"||Wr(e)),cv=e=>typeof e=="number"&&!Number.isNaN(e),Ae=e=>typeof e=="string",Hr=e=>typeof e=="function",uv=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);function Yr(e){if(!dv(e)||e===void 0)return e;const t=Reflect.ownKeys(e).filter(r=>typeof r=="string"),n={};for(const r of t){const o=e[r];o!==void 0&&(n[r]=Yr(o))}return n}var dv=e=>e&&typeof e=="object"&&e.constructor===Object;function Pi(...e){const t=e.length===1?e[0]:e[1];(e.length===2?e[0]:!0)&&process.env.NODE_ENV!=="production"&&console.warn(t)}function Gr(...e){const t=e.length===1?e[0]:e[1];if((e.length===2?e[0]:!0)&&process.env.NODE_ENV!=="production")throw new Error(t)}function lc(e,...t){for(const n of t){const r=Yr(n);for(const o in r)Qn(n[o])?(e[o]||(e[o]={}),lc(e[o],n[o])):e[o]=n[o]}return e}function cc(e){return bn(e)}function Ue(e){return Ae(e)?{type:e}:e}function At(e){return e?Wr(e)?e.slice():[e]:[]}function uc(e){return Qn(e)&&e.predicate!=null}var fv=()=>!0;function Ci(e,t,n,r){return o=>Ae(o)?!!e[o]?.(t,n,r):Hr(o)?o(t,n,r):o.predicate(e)(t,n,r)}function gv(...e){return{predicate:t=>(n,r,o)=>e.map(Ci(t,n,r,o)).some(Boolean)}}function hv(...e){return{predicate:t=>(n,r,o)=>e.map(Ci(t,n,r,o)).every(Boolean)}}function pv(e){return{predicate:t=>(n,r,o)=>!Ci(t,n,r,o)(e)}}function mv(...e){return(t,n,r)=>r.state.matches(...e)}var yv={or:gv,and:hv,not:pv,stateIn:mv};function dc(e,t){return e=e??fv,(n,r,o)=>{if(Ae(e)){const i=t[e];return Hr(i)?i(n,r,o):i}return uc(e)?e.predicate(t)(n,r,o):e?.(n,r,o)}}function Oi(e,t){return(n,r,o)=>uc(e)?e.predicate(t)(n,r,o):e}function vv(e){const t=e.computed??dt({}),n=e.context??dt({}),r=e.initial?e.states?.[e.initial]?.tags:[],o=Ei({value:e.initial??"",previousValue:"",event:dt({}),previousEvent:dt({}),context:nv(n,t),done:!1,tags:r??[],hasTag(i){return this.tags.includes(i)},matches(...i){return i.includes(this.value)},can(i){return dt(this).nextEvents.includes(i)},get nextEvents(){const i=e.states?.[this.value]?.on??{},s=e?.on??{};return Object.keys({...i,...s})},get changed(){return this.event.value==="machine.init"||!this.previousValue?!1:this.value!==this.previousValue}});return dt(o)}function er(e,t){return(n,r)=>{if(cv(e))return e;if(Hr(e))return e(n,r);if(Ae(e)){const o=Number.parseFloat(e);if(!Number.isNaN(o))return o;if(t){const i=t?.[e];return Gr(i==null,`[@zag-js/core > determine-delay] Cannot determine delay for \`${e}\`. It doesn't exist in \`options.delays\``),Hr(i)?i(n,r):i}}}}function bv(e){return Ae(e)?{target:e}:e}function wv(e,t){return(n,r,o)=>At(e).map(bv).find(i=>dc(i.guard,t)(n,r,o)??i.target??i.actions)}var xv=class{constructor(e,t){_(this,"status","Not Started"),_(this,"state"),_(this,"initialState"),_(this,"initialContext"),_(this,"id"),_(this,"type","machine"),_(this,"activityEvents",new Map),_(this,"delayedEvents",new Map),_(this,"stateListeners",new Set),_(this,"doneListeners",new Set),_(this,"contextWatchers",new Set),_(this,"removeStateListener",sv),_(this,"parent"),_(this,"children",new Map),_(this,"guardMap"),_(this,"actionMap"),_(this,"delayMap"),_(this,"activityMap"),_(this,"sync"),_(this,"options"),_(this,"config"),_(this,"_created",()=>{const n=Ue("machine.created");this.executeActions(this.config?.created,n)}),_(this,"start",n=>{if(this.state.value="",this.state.tags=[],this.status==="Running")return this;this.status="Running",this.removeStateListener=oc(this.state,()=>{this.stateListeners.forEach(l=>{l(this.stateSnapshot)})},this.sync),this.setupContextWatchers(),this.executeActivities(Ue("machine.start"),At(this.config.activities),"machine.start"),this.executeActions(this.config.entry,Ue("machine.start"));const r=Ue("machine.init"),o=Qn(n)?n.value:n,i=Qn(n)?n.context:void 0;i&&this.setContext(i);const s={target:o??this.config.initial},a=this.getNextStateInfo(s,r);return this.initialState=a,this.performStateChangeEffects(this.state.value,a,r),this}),_(this,"setupContextWatchers",()=>{const{watch:n}=this.config;if(!n)return;let r=vn(this.state.context);const o=oc(this.state.context,()=>{const i=vn(this.state.context);for(const[s,a]of Object.entries(n))(this.options.compareFns?.[s]??Object.is)(r[s],i[s])||this.executeActions(a,this.state.event);r=i});this.contextWatchers.add(o)}),_(this,"stop",()=>{if(this.status!=="Stopped")return this.performExitEffects(this.state.value,Ue("machine.stop")),this.executeActions(this.config.exit,Ue("machine.stop")),this.setState(""),this.setEvent("machine.stop"),this.stopStateListeners(),this.stopChildren(),this.stopActivities(),this.stopDelayedEvents(),this.stopContextWatchers(),this.status="Stopped",this}),_(this,"stopStateListeners",()=>{this.removeStateListener(),this.stateListeners.clear()}),_(this,"stopContextWatchers",()=>{this.contextWatchers.forEach(n=>n()),this.contextWatchers.clear()}),_(this,"stopDelayedEvents",()=>{this.delayedEvents.forEach(n=>{n.forEach(r=>r())}),this.delayedEvents.clear()}),_(this,"stopActivities",n=>{n?(this.activityEvents.get(n)?.forEach(r=>r()),this.activityEvents.get(n)?.clear(),this.activityEvents.delete(n)):(this.activityEvents.forEach(r=>{r.forEach(o=>o()),r.clear()}),this.activityEvents.clear())}),_(this,"sendChild",(n,r)=>{const o=Ue(n),i=sc(r,this.contextSnapshot),s=this.children.get(i);s||Gr(`[@zag-js/core] Cannot send '${o.type}' event to unknown child`),s.send(o)}),_(this,"stopChild",n=>{this.children.has(n)||Gr(`[@zag-js/core > stop-child] Cannot stop unknown child ${n}`),this.children.get(n).stop(),this.children.delete(n)}),_(this,"removeChild",n=>{this.children.delete(n)}),_(this,"stopChildren",()=>{this.children.forEach(n=>n.stop()),this.children.clear()}),_(this,"setParent",n=>{this.parent=n}),_(this,"spawn",(n,r)=>{const o=sc(n);return r&&(o.id=r),o.type="machine.actor",o.setParent(this),this.children.set(o.id,dt(o)),o.onDone(()=>{this.removeChild(o.id)}).start(),dt(Ur(o))}),_(this,"stopActivity",n=>{if(!this.state.value)return;const r=this.activityEvents.get(this.state.value);r?.get(n)?.(),r?.delete(n)}),_(this,"addActivityCleanup",(n,r,o)=>{n&&(this.activityEvents.has(n)?this.activityEvents.get(n)?.set(r,o):this.activityEvents.set(n,new Map([[r,o]])))}),_(this,"setState",n=>{this.state.previousValue=this.state.value,this.state.value=n;const r=this.getStateNode(n);n==null?iv(this.state.tags):this.state.tags=At(r?.tags)}),_(this,"setContext",n=>{n&&lc(this.state.context,Yr(n))}),_(this,"setOptions",n=>{const r=Yr(n);this.actionMap={...this.actionMap,...r.actions},this.delayMap={...this.delayMap,...r.delays},this.activityMap={...this.activityMap,...r.activities},this.guardMap={...this.guardMap,...r.guards}}),_(this,"getStateNode",n=>{if(n)return this.config.states?.[n]}),_(this,"getNextStateInfo",(n,r)=>{const o=this.determineTransition(n,r),i=!o?.target,s=o?.target??this.state.value,a=this.state.value!==s,l=this.getStateNode(s),u={reenter:!i&&!a&&!o?.internal,transition:o,stateNode:l,target:s,changed:a};return this.log("NextState:",`[${r.type}]`,this.state.value,"---->",u.target),u}),_(this,"getAfterActions",(n,r)=>{let o;return{entry:()=>{o=globalThis.setTimeout(()=>{const i=this.getNextStateInfo(n,this.state.event);this.performStateChangeEffects(this.state.value,i,this.state.event)},r)},exit:()=>{globalThis.clearTimeout(o)}}}),_(this,"getDelayedEventActions",n=>{const r=this.getStateNode(n),o=this.state.event;if(!r||!r.after)return;const i=[],s=[];if(Wr(r.after)){const a=this.determineTransition(r.after,o);if(!a)return;if(!uv(a,"delay"))throw new Error(`[@zag-js/core > after] Delay is required for after transition: ${JSON.stringify(a)}`);const c=er(a.delay,this.delayMap)(this.contextSnapshot,o),u=this.getAfterActions(a,c);return i.push(u.entry),s.push(u.exit),{entries:i,exits:s}}if(Qn(r.after))for(const a in r.after){const l=r.after[a],u=er(a,this.delayMap)(this.contextSnapshot,o),d=this.getAfterActions(l,u);i.push(d.entry),s.push(d.exit)}return{entries:i,exits:s}}),_(this,"executeActions",(n,r)=>{const o=Oi(n,this.guardMap)(this.contextSnapshot,r,this.guardMeta);for(const i of At(o)){const s=Ae(i)?this.actionMap?.[i]:i;Pi(Ae(i)&&!s,`[@zag-js/core > execute-actions] No implementation found for action: \`${i}\``),s?.(this.state.context,r,this.meta)}}),_(this,"executeActivities",(n,r,o)=>{for(const i of r){const s=Ae(i)?this.activityMap?.[i]:i;if(!s){Pi(`[@zag-js/core > execute-activity] No implementation found for activity: \`${i}\``);continue}const a=s(this.state.context,n,this.meta);if(a){const l=Ae(i)?i:i.name||ac();this.addActivityCleanup(o??this.state.value,l,a)}}}),_(this,"createEveryActivities",(n,r)=>{if(n)if(Wr(n)){const o=At(n).find(l=>{const c=l.delay,d=er(c,this.delayMap)(this.contextSnapshot,this.state.event);return dc(l.guard,this.guardMap)(this.contextSnapshot,this.state.event,this.guardMeta)??d!=null});if(!o)return;const s=er(o.delay,this.delayMap)(this.contextSnapshot,this.state.event);r(()=>{const l=globalThis.setInterval(()=>{this.executeActions(o.actions,this.state.event)},s);return()=>{globalThis.clearInterval(l)}})}else for(const o in n){const i=n?.[o],a=er(o,this.delayMap)(this.contextSnapshot,this.state.event);r(()=>{const c=globalThis.setInterval(()=>{this.executeActions(i,this.state.event)},a);return()=>{globalThis.clearInterval(c)}})}}),_(this,"setEvent",n=>{this.state.previousEvent=this.state.event,this.state.event=Ur(Ue(n))}),_(this,"performExitEffects",(n,r)=>{const o=this.state.value;if(o==="")return;const i=n?this.getStateNode(n):void 0;this.stopActivities(o);const s=Oi(i?.exit,this.guardMap)(this.contextSnapshot,r,this.guardMeta),a=At(s),l=this.delayedEvents.get(o);l&&a.push(...l),this.executeActions(a,r)}),_(this,"performEntryEffects",(n,r)=>{const o=this.getStateNode(n),i=At(o?.activities);this.createEveryActivities(o?.every,c=>{i.unshift(c)}),i.length>0&&this.executeActivities(r,i);const s=Oi(o?.entry,this.guardMap)(this.contextSnapshot,r,this.guardMeta),a=At(s),l=this.getDelayedEventActions(n);o?.after&&l&&(this.delayedEvents.set(n,l?.exits),a.push(...l.entries)),this.executeActions(a,r),o?.type==="final"&&(this.state.done=!0,this.doneListeners.forEach(c=>{c(this.stateSnapshot)}),this.stop())}),_(this,"performTransitionEffects",(n,r)=>{const o=this.determineTransition(n,r);this.executeActions(o?.actions,r)}),_(this,"performStateChangeEffects",(n,r,o)=>{this.setEvent(o);const i=r.changed||r.reenter;i&&this.performExitEffects(n,o),this.performTransitionEffects(r.transition,o),this.setState(r.target),i&&this.performEntryEffects(r.target,o)}),_(this,"determineTransition",(n,r)=>wv(n,this.guardMap)?.(this.contextSnapshot,r,this.guardMeta)),_(this,"sendParent",n=>{this.parent||Gr("[@zag-js/core > send-parent] Cannot send event to an unknown parent");const r=Ue(n);this.parent?.send(r)}),_(this,"log",(...n)=>{lv()&&this.options.debug&&console.log(...n)}),_(this,"send",n=>{const r=Ue(n);this.transition(this.state.value,r)}),_(this,"transition",(n,r)=>{const o=Ae(n)?this.getStateNode(n):n?.stateNode,i=Ue(r);if(!o&&!this.config.on){const l=this.status==="Stopped"?"[@zag-js/core > transition] Cannot transition a stopped machine":`[@zag-js/core > transition] State does not have a definition for \`state\`: ${n}, \`event\`: ${i.type}`;Pi(l);return}const s=o?.on?.[i.type]??this.config.on?.[i.type],a=this.getNextStateInfo(s,i);return this.performStateChangeEffects(this.state.value,a,i),a.stateNode}),_(this,"subscribe",n=>(this.stateListeners.add(n),this.status==="Running"&&n(this.stateSnapshot),()=>{this.stateListeners.delete(n)})),_(this,"onDone",n=>(this.doneListeners.add(n),this)),_(this,"onTransition",n=>(this.stateListeners.add(n),this.status==="Running"&&n(this.stateSnapshot),this)),this.config=cc(e),this.options=cc(t??{}),this.id=this.config.id??`machine-${ac()}`,this.guardMap=this.options?.guards??{},this.actionMap=this.options?.actions??{},this.delayMap=this.options?.delays??{},this.activityMap=this.options?.activities??{},this.sync=this.options?.sync??!1,this.state=vv(this.config),this.initialContext=vn(this.state.context)}get stateSnapshot(){return dt(vn(this.state))}getState(){return this.stateSnapshot}get contextSnapshot(){return this.stateSnapshot.context}get self(){const e=this;return{id:this.id,send:this.send.bind(this),sendParent:this.sendParent.bind(this),sendChild:this.sendChild.bind(this),stop:this.stop.bind(this),stopChild:this.stopChild.bind(this),spawn:this.spawn.bind(this),stopActivity:this.stopActivity.bind(this),get state(){return e.stateSnapshot},get initialContext(){return e.initialContext},get initialState(){return e.initialState?.target??""}}}get meta(){return{state:this.stateSnapshot,guards:this.guardMap,send:this.send.bind(this),self:this.self,initialContext:this.initialContext,initialState:this.initialState?.target??"",getState:()=>this.stateSnapshot,getAction:e=>this.actionMap[e],getGuard:e=>this.guardMap[e]}}get guardMeta(){return{state:this.stateSnapshot}}get[Symbol.toStringTag](){return"Machine"}getHydrationState(){const e=this.getState();return{value:e.value,tags:e.tags}}},fc=(e,t)=>new xv(e,t),Sv=(...e)=>e.map(t=>t?.trim?.()).filter(Boolean).join(" "),Ev=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,gc=e=>{const t={};let n;for(;n=Ev.exec(e);)t[n[1]]=n[2];return t},Pv=(e,t)=>{if(Ae(e)){if(Ae(t))return`${e};${t}`;e=gc(e)}else Ae(t)&&(t=gc(t));return Object.assign({},e??{},t??{})};function Cv(...e){let t={};for(let n of e){for(let r in t){if(r.startsWith("on")&&typeof t[r]=="function"&&typeof n[r]=="function"){t[r]=av(n[r],t[r]);continue}if(r==="className"||r==="class"){t[r]=Sv(t[r],n[r]);continue}if(r==="style"){t[r]=Pv(t[r],n[r]);continue}t[r]=n[r]!==void 0?n[r]:t[r]}for(let r in n)t[r]===void 0&&(t[r]=n[r])}return t}function Ov(e){return new Proxy({},{get(){return e}})}var jt=()=>e=>Array.from(new Set(e));function ce(...e){const t={};for(let n=0;n<e.length;n++){let r=e[n];if(typeof r=="function"&&(r=r()),r){const o=Object.getOwnPropertyDescriptors(r);for(const i in o)i in t||Object.defineProperty(t,i,{enumerable:!0,get(){let s={};if(i==="style"||i==="class"||i==="className"||i.startsWith("on")){for(let a=0;a<e.length;a++){let l=e[a];typeof l=="function"&&(l=l()),s=Cv(s,{[i]:(l||{})[i]})}return s[i]}for(let a=e.length-1;a>=0;a--){let l,c=e[a];if(typeof c=="function"&&(c=c()),l=(c||{})[i],l!==void 0)return l}}})}}return t}var Dv=e=>Array.isArray(e),kv=e=>!(e==null||typeof e!="object"||Dv(e)),Tv=e=>typeof e=="number"&&!Number.isNaN(e),hc=e=>typeof e=="string",pc={onFocus:"onFocusIn",onBlur:"onFocusOut",onDoubleClick:"onDblClick",onChange:"onInput",defaultChecked:"checked",defaultValue:"value",htmlFor:"for",className:"class"},$v=e=>e.startsWith("--")?e:Fv(e);function Av(e){return e in pc?pc[e]:e}var Mv=Ov(e=>{const t={};for(const n in e){const r=e[n];if(!(n==="readOnly"&&r===!1)){if(n==="style"&&kv(r)){t.style=Iv(r);continue}if(n==="children"){hc(r)&&(t.textContent=r);continue}t[Av(n)]=r}}return t});function Iv(e){let t={};for(const n in e){const r=e[n];!hc(r)&&!Tv(r)||(t[$v(n)]=r)}return t}var Lv=/[A-Z]/g,Rv=/^ms-/;function Nv(e){return"-"+e.toLowerCase()}var Di={};function Fv(e){if(Di.hasOwnProperty(e))return Di[e];var t=e.replace(Lv,Nv);return Di[e]=Rv.test(t)?"-"+t:t}function _v(e,t){const{actions:n,context:r}=t??{},[o,i]=Gs(e.getState());return Ft(()=>{const s=e.subscribe(a=>{i(Id(a))});Z(()=>{s()})}),V(()=>{const s=typeof r=="function"?r():r;e.setContext(s)}),V(()=>{e.setOptions({actions:n})}),o}function Vv(e,t){const{state:n,context:r}=t??{},o=(()=>{const i=typeof e=="function"?e():e,s=typeof r=="function"?r():r;return s&&i.setContext(s),i._created(),i})();return Ft(()=>{o.start(n),Z(()=>{o.stop()})}),o}function mc(e,t){const n=Vv(e,t);return[_v(n,t),n.send,n]}const wn=()=>(e,t)=>U(e,t);$t({hookName:"useRenderStrategyContext",providerName:"<RenderStrategyProvider />"});const Kv=e=>wn()(e,["lazyMount","unmountOnExit"]),ki=e=>n=>{const[r,o]=U(n,["asChild"]);if(r.asChild){const i=s=>{const[,a]=U(o,["ref"]);return ce(a,s)};return r.asChild(i)}return h(Nn,I({component:e},o))};function zv(){const e=new Map;return new Proxy(ki,{apply(t,n,r){return ki(r[0])},get(t,n){const r=n;return e.has(r)||e.set(r,ki(r)),e.get(r)}})}const fe=zv();var qr=(e,t=[])=>({parts:(...n)=>{if(Bv(t))return qr(e,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>qr(e,[...t,...n]),rename:n=>qr(n,t),keys:()=>t,build:()=>[...new Set(t)].reduce((n,r)=>Object.assign(n,{[r]:{selector:[`&[data-scope="${xn(e)}"][data-part="${xn(r)}"]`,`& [data-scope="${xn(e)}"][data-part="${xn(r)}"]`].join(", "),attrs:{"data-scope":xn(e),"data-part":xn(r)}}}),{})}),xn=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),Bv=e=>e.length===0,te=e=>e?"":void 0,Ee=e=>e?"true":void 0,jv=1,Uv=9,Wv=11,Zr=e=>typeof e=="object"&&e!==null,ft=e=>Zr(e)&&e.nodeType===jv&&typeof e.nodeName=="string",yc=e=>Zr(e)&&e.nodeType===Uv,Hv=e=>Zr(e)&&e===e.window,Yv=e=>Zr(e)&&e.nodeType!==void 0,Gv=e=>Yv(e)&&e.nodeType===Wv&&"host"in e;function Xr(e,t){return!e||!t||!ft(e)||!ft(t)?!1:e===t||e.contains(t)}function Jr(e){return yc(e)?e:Hv(e)?e.document:e?.ownerDocument??document}function Ti(e){return Gv(e)?Ti(e.host):yc(e)?e.defaultView??window:ft(e)?e.ownerDocument?.defaultView??window:window}var qv=()=>typeof document<"u";function Zv(){return navigator.userAgentData?.platform??navigator.platform}var vc=e=>qv()&&e.test(Zv()),Xv=()=>vc(/^Mac/),bc=()=>vc(/iP(hone|ad|od)|iOS/);function Jv(e){return e.composedPath?.()??e.nativeEvent?.composedPath?.()}function tr(e){return Jv(e)?.[0]??e.target}function Qv(e){return e.nativeEvent?.isComposing??e.isComposing}var eb=e=>typeof e=="object"&&e!==null&&e.nodeType===1;function tb(e){return eb(e)?e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0:!1}var nb="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false']), details > summary:first-of-type";function wc(e){return!e||e.closest("[inert]")?!1:e.matches(nb)&&tb(e)}function rb(e){const t=new Set;function n(r){const o=globalThis.requestAnimationFrame(r);t.add(()=>globalThis.cancelAnimationFrame(o))}return n(()=>n(e)),function(){t.forEach(o=>o())}}function Ve(e){const t=globalThis.requestAnimationFrame(e);return()=>{globalThis.cancelAnimationFrame(t)}}function ob(e,t){return Array.from(e?.querySelectorAll(t)??[])}function ib(e,t){return e?.querySelector(t)??null}function sb(e){const t={getRootNode:n=>n.getRootNode?.()??document,getDoc:n=>Jr(t.getRootNode(n)),getWin:n=>t.getDoc(n).defaultView??window,getActiveElement:n=>t.getRootNode(n).activeElement,isActiveElement:(n,r)=>r===t.getActiveElement(n),getById:(n,r)=>t.getRootNode(n).getElementById(r),setValue:(n,r)=>{if(n==null||r==null)return;const o=r.toString();n.value!==o&&(n.value=r.toString())}};return{...t,...e}}var $i=new WeakMap;function ab(e,t,n){$i.has(e)||$i.set(e,new Map);const r=$i.get(e),o=r.get(t);if(!o)return r.set(t,n()),()=>{r.get(t)?.(),r.delete(t)};const i=n(),s=()=>{i(),o(),r.delete(t)};return r.set(t,s),()=>{r.get(t)===s&&(i(),r.set(t,o))}}function lb(e,t){return e?ab(e,"style",()=>{const r=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=r}}):()=>{}}var cb=1e3/60;function ub(e,t){const n=e();if(ft(n)&&n.isConnected)return t(n),()=>{};{const r=setInterval(()=>{const o=e();ft(o)&&o.isConnected&&(t(o),clearInterval(r))},cb);return()=>clearInterval(r)}}function db(e,t){const n=[];return e?.forEach(r=>{const o=ub(r,t);n.push(o)}),()=>{n.forEach(r=>r())}}var fb=e=>e[e.length-1],xc=(e,t)=>{const n=[];return e.reduce((r,o,i)=>(i%t===0?r.push([o]):fb(r)?.push(o),r),n)},Sc=e=>e?.constructor.name==="Array",gb=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Ai(e[n],t[n]))return!1;return!0},Ai=(e,t)=>{if(Object.is(e,t))return!0;if(e==null&&t!=null||e!=null&&t==null)return!1;if(typeof e?.isEqual=="function"&&typeof t?.isEqual=="function")return e.isEqual(t);if(typeof e=="function"&&typeof t=="function")return e.toString()===t.toString();if(Sc(e)&&Sc(t))return gb(Array.from(e),Array.from(t));if(typeof e!="object"||typeof t!="object")return!1;const n=Object.keys(t??Object.create(null)),r=n.length;for(let o=0;o<r;o++)if(!Reflect.has(e,n[o]))return!1;for(let o=0;o<r;o++){const i=n[o];if(!Ai(e[i],t[i]))return!1}return!0},hb=(e,...t)=>(typeof e=="function"?e(...t):e)??void 0,pb=()=>{},Ec=(...e)=>(...t)=>{e.forEach(function(n){n?.(...t)})};function nr(e,t,...n){if(e in t){const o=t[e];return typeof o=="function"?o(...n):o}const r=new Error(`No matching key: ${JSON.stringify(e)} in ${JSON.stringify(Object.keys(t))}`);throw Error.captureStackTrace?.(r,nr),r}var mb=e=>typeof e=="function",yb=e=>e==null;function Mi(e){if(!vb(e)||e===void 0)return e;const t=Reflect.ownKeys(e).filter(r=>typeof r=="string"),n={};for(const r of t){const o=e[r];o!==void 0&&(n[r]=Mi(o))}return n}var vb=e=>e&&typeof e=="object"&&e.constructor===Object;function bb(...e){const t=e.length===1?e[0]:e[1];(e.length===2?e[0]:!0)&&process.env.NODE_ENV!=="production"&&console.warn(t)}const[m1,wb]=$t({hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:()=>({getRootNode:()=>document,getDocument:()=>document,getWindow:()=>window})}),[y1,xb]=$t({hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:()=>({dir:"ltr",locale:"en-US"})});var Sn="default",Ii="",Qr=new WeakMap;function Sb(e={}){const{target:t,doc:n}=e,r=n??document,o=r.documentElement;return bc()?(Sn==="default"&&(Ii=o.style.webkitUserSelect,o.style.webkitUserSelect="none"),Sn="disabled"):t&&(Qr.set(t,t.style.userSelect),t.style.userSelect="none"),()=>Pc({target:t,doc:r})}function Pc(e={}){const{target:t,doc:n}=e,o=(n??document).documentElement;if(bc()){if(Sn!=="disabled")return;Sn="restoring",setTimeout(()=>{rb(()=>{Sn==="restoring"&&(o.style.webkitUserSelect==="none"&&(o.style.webkitUserSelect=Ii||""),Ii="",Sn="default")})},300)}else if(t&&Qr.has(t)){const i=Qr.get(t);t.style.userSelect==="none"&&(t.style.userSelect=i??""),t.getAttribute("style")===""&&t.removeAttribute("style"),Qr.delete(t)}}function Eb(e={}){const{defer:t,target:n,...r}=e,o=t?Ve:s=>s(),i=[];return i.push(o(()=>{const s=typeof n=="function"?n():n;i.push(Sb({...r,target:s}))})),()=>{i.forEach(s=>s?.())}}var Li=(e,t,n,r)=>{const o=typeof e=="function"?e():e;return o?.addEventListener(t,n,r),()=>{o?.removeEventListener(t,n,r)}},Pb=e=>e.button===2||Xv()&&e.ctrlKey&&e.button===0;function Cc(e,t,n){const o=(s=>{const a=requestAnimationFrame(s);return()=>cancelAnimationFrame(a)})(()=>{e.removeEventListener(t,i,!0),n()}),i=()=>{o(),n()};return e.addEventListener(t,i,{once:!0,capture:!0}),o}function Oc(e,t,n){if(!e)return;const r=e.ownerDocument.defaultView||window,o=new r.CustomEvent(t,n);return e.dispatchEvent(o)}var Cb={Up:"ArrowUp",Down:"ArrowDown",Esc:"Escape"," ":"Space",",":"Comma",Left:"ArrowLeft",Right:"ArrowRight"},Dc={ArrowLeft:"ArrowRight",ArrowRight:"ArrowLeft"};function Ob(e,t={}){const{dir:n="ltr",orientation:r="horizontal"}=t;let{key:o}=e;return o=Cb[o]??o,n==="rtl"&&r==="horizontal"&&o in Dc&&(o=Dc[o]),o}function Db(e){return e.nativeEvent??e}const kb=e=>wn()(e,["immediate","lazyMount","onExitComplete","present","unmountOnExit"]);function Tb(e,t,n){const r=e.matches("mounted","unmountSuspended");return{skip:!e.context.initial&&r,present:r,setNode(o){o&&t({type:"NODE.SET",node:o})},unmount(){t({type:"UNMOUNT"})}}}function eo(e){return e?.animationName||"none"}function $b(e){return fc({initial:e.present?"mounted":"unmounted",context:{node:null,styles:null,unmountAnimationName:null,prevAnimationName:null,present:!1,initial:!1,...e},exit:["clearInitial"],watch:{present:["setInitial","syncPresence"]},on:{"NODE.SET":{actions:["setNode","setStyles"]}},states:{mounted:{on:{UNMOUNT:{target:"unmounted",actions:["invokeOnExitComplete"]},"UNMOUNT.SUSPEND":"unmountSuspended"}},unmountSuspended:{activities:["trackAnimationEvents"],on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]},"ANIMATION.END":{target:"unmounted",actions:["invokeOnExitComplete"]},UNMOUNT:{target:"unmounted",actions:["invokeOnExitComplete"]}}},unmounted:{entry:["clearPrevAnimationName"],on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]}}}}},{actions:{setInitial(t){t.initial=!0},clearInitial(t){t.initial=!1},invokeOnExitComplete(t){t.onExitComplete?.()},setNode(t,n){t.node=Ur(n.node)},setStyles(t,n){const r=n.node.ownerDocument.defaultView||window;t.styles=Ur(r.getComputedStyle(n.node))},syncPresence(t,n,{send:r}){if(t.present){r({type:"MOUNT",src:"presence.changed"});return}const o=eo(t.styles);(t.immediate?queueMicrotask:requestAnimationFrame)(()=>{t.unmountAnimationName=o,o==="none"||o===t.prevAnimationName||t.styles?.display==="none"||t.styles?.animationDuration==="0s"?r({type:"UNMOUNT",src:"presence.changed"}):r({type:"UNMOUNT.SUSPEND"})})},setPrevAnimationName(t){(t.immediate?queueMicrotask:requestAnimationFrame)(()=>{t.prevAnimationName=eo(t.styles)})},clearPrevAnimationName(t){t.prevAnimationName=null}},activities:{trackAnimationEvents(t,n,{send:r}){const o=t.node;if(!o)return;const i=a=>{a.target===o&&(t.prevAnimationName=eo(t.styles))},s=a=>{const l=eo(t.styles);a.target===o&&l===t.unmountAnimationName&&r({type:"UNMOUNT",src:"animationend"})};return o.addEventListener("animationstart",i),o.addEventListener("animationcancel",s),o.addEventListener("animationend",s),()=>{o.removeEventListener("animationstart",i),o.removeEventListener("animationcancel",s),o.removeEventListener("animationend",s)}}}})}jt()(["onExitComplete","present","immediate"]);const Ab=e=>{const[t,n]=Kv(e),[r,o]=L(!1),[i,s]=mc($b(n),{context:n}),a=A(()=>Tb(i,s));return V(()=>{a().present&&o(!0)}),A(()=>({unmounted:!a().present&&!r()&&t.lazyMount||t.unmountOnExit&&!a().present&&r(),present:a().present,presenceProps:{ref:a().setNode,hidden:!a().present,"data-state":n.present?"open":"closed"}}))},[Mb,kc]=$t({hookName:"usePresenceContext",providerName:"<PresenceProvider />"}),Ri=Math.min,En=Math.max,to=Math.round,no=Math.floor,Mt=e=>({x:e,y:e});function Pn(e){return Tc(e)?(e.nodeName||"").toLowerCase():"#document"}function Me(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function gt(e){var t;return(t=(Tc(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Tc(e){return e instanceof Node||e instanceof Me(e).Node}function We(e){return e instanceof Element||e instanceof Me(e).Element}function Je(e){return e instanceof HTMLElement||e instanceof Me(e).HTMLElement}function $c(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Me(e).ShadowRoot}function rr(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=He(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Ib(e){return["table","td","th"].includes(Pn(e))}function ro(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Ni(e){const t=Fi(),n=We(e)?He(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Lb(e){let t=It(e);for(;Je(t)&&!Cn(t);){if(Ni(t))return t;if(ro(t))return null;t=It(t)}return null}function Fi(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Cn(e){return["html","body","#document"].includes(Pn(e))}function He(e){return Me(e).getComputedStyle(e)}function oo(e){return We(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function It(e){if(Pn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||$c(e)&&e.host||gt(e);return $c(t)?t.host:t}function Ac(e){const t=It(e);return Cn(t)?e.ownerDocument?e.ownerDocument.body:e.body:Je(t)&&rr(t)?t:Ac(t)}function or(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Ac(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=Me(o);return i?t.concat(s,s.visualViewport||[],rr(o)?o:[],s.frameElement&&n?or(s.frameElement):[]):t.concat(o,or(o,[],n))}function Mc(e){const t=He(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Je(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=to(n)!==i||to(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function _i(e){return We(e)?e:e.contextElement}function On(e){const t=_i(e);if(!Je(t))return Mt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Mc(t);let s=(i?to(n.width):n.width)/r,a=(i?to(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Rb=Mt(0);function Ic(e){const t=Me(e);return!Fi()||!t.visualViewport?Rb:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Nb(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Me(e)?!1:t}function Ut(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=_i(e);let s=Mt(1);t&&(r?We(r)&&(s=On(r)):s=On(e));const a=Nb(i,n,r)?Ic(i):Mt(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const f=Me(i),m=r&&We(r)?Me(r):r;let g=f,p=g.frameElement;for(;p&&r&&m!==g;){const y=On(p),v=p.getBoundingClientRect(),b=He(p),w=v.left+(p.clientLeft+parseFloat(b.paddingLeft))*y.x,x=v.top+(p.clientTop+parseFloat(b.paddingTop))*y.y;l*=y.x,c*=y.y,u*=y.x,d*=y.y,l+=w,c+=x,g=Me(p),p=g.frameElement}}return fn({width:u,height:d,x:l,y:c})}function Fb(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=gt(r),a=t?ro(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=Mt(1);const u=Mt(0),d=Je(r);if((d||!d&&!i)&&((Pn(r)!=="body"||rr(s))&&(l=oo(r)),Je(r))){const f=Ut(r);c=On(r),u.x=f.x+r.clientLeft,u.y=f.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}}function _b(e){return Array.from(e.getClientRects())}function Lc(e){return Ut(gt(e)).left+oo(e).scrollLeft}function Vb(e){const t=gt(e),n=oo(e),r=e.ownerDocument.body,o=En(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=En(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Lc(e);const a=-n.scrollTop;return He(r).direction==="rtl"&&(s+=En(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function Kb(e,t){const n=Me(e),r=gt(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const c=Fi();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}function zb(e,t){const n=Ut(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Je(e)?On(e):Mt(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:s,height:a,x:l,y:c}}function Rc(e,t,n){let r;if(t==="viewport")r=Kb(e,n);else if(t==="document")r=Vb(gt(e));else if(We(t))r=zb(t,n);else{const o=Ic(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return fn(r)}function Nc(e,t){const n=It(e);return n===t||!We(n)||Cn(n)?!1:He(n).position==="fixed"||Nc(n,t)}function Bb(e,t){const n=t.get(e);if(n)return n;let r=or(e,[],!1).filter(a=>We(a)&&Pn(a)!=="body"),o=null;const i=He(e).position==="fixed";let s=i?It(e):e;for(;We(s)&&!Cn(s);){const a=He(s),l=Ni(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||rr(s)&&!l&&Nc(e,s))?r=r.filter(u=>u!==s):o=a,s=It(s)}return t.set(e,r),r}function jb(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?ro(t)?[]:Bb(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const d=Rc(t,u,o);return c.top=En(d.top,c.top),c.right=Ri(d.right,c.right),c.bottom=Ri(d.bottom,c.bottom),c.left=En(d.left,c.left),c},Rc(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Ub(e){const{width:t,height:n}=Mc(e);return{width:t,height:n}}function Wb(e,t,n){const r=Je(t),o=gt(t),i=n==="fixed",s=Ut(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=Mt(0);if(r||!r&&!i)if((Pn(t)!=="body"||rr(o))&&(a=oo(t)),r){const d=Ut(t,!0,i,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else o&&(l.x=Lc(o));const c=s.left+a.scrollLeft-l.x,u=s.top+a.scrollTop-l.y;return{x:c,y:u,width:s.width,height:s.height}}function Vi(e){return He(e).position==="static"}function Fc(e,t){return!Je(e)||He(e).position==="fixed"?null:t?t(e):e.offsetParent}function _c(e,t){const n=Me(e);if(ro(e))return n;if(!Je(e)){let o=It(e);for(;o&&!Cn(o);){if(We(o)&&!Vi(o))return o;o=It(o)}return n}let r=Fc(e,t);for(;r&&Ib(r)&&Vi(r);)r=Fc(r,t);return r&&Cn(r)&&Vi(r)&&!Ni(r)?n:r||Lb(e)||n}const Hb=async function(e){const t=this.getOffsetParent||_c,n=this.getDimensions,r=await n(e.floating);return{reference:Wb(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Yb(e){return He(e).direction==="rtl"}const Gb={convertOffsetParentRelativeRectToViewportRelativeRect:Fb,getDocumentElement:gt,getClippingRect:jb,getOffsetParent:_c,getElementRects:Hb,getClientRects:_b,getDimensions:Ub,getScale:On,isElement:We,isRTL:Yb};function qb(e,t){let n=null,r;const o=gt(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const{left:c,top:u,width:d,height:f}=e.getBoundingClientRect();if(a||t(),!d||!f)return;const m=no(u),g=no(o.clientWidth-(c+d)),p=no(o.clientHeight-(u+f)),y=no(c),b={rootMargin:-m+"px "+-g+"px "+-p+"px "+-y+"px",threshold:En(0,Ri(1,l))||1};let w=!0;function x(T){const O=T[0].intersectionRatio;if(O!==l){if(!w)return s();O?s(!1,O):r=setTimeout(()=>{s(!1,1e-7)},1e3)}w=!1}try{n=new IntersectionObserver(x,{...b,root:o.ownerDocument})}catch{n=new IntersectionObserver(x,b)}n.observe(e)}return s(!0),i}function Zb(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=_i(e),u=o||i?[...c?or(c):[],...or(t)]:[];u.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const d=c&&a?qb(c,n):null;let f=-1,m=null;s&&(m=new ResizeObserver(v=>{let[b]=v;b&&b.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var w;(w=m)==null||w.observe(t)})),n()}),c&&!l&&m.observe(c),m.observe(t));let g,p=l?Ut(e):null;l&&y();function y(){const v=Ut(e);p&&(v.x!==p.x||v.y!==p.y||v.width!==p.width||v.height!==p.height)&&n(),p=v,g=requestAnimationFrame(y)}return n(),()=>{var v;u.forEach(b=>{o&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),d?.(),(v=m)==null||v.disconnect(),m=null,l&&cancelAnimationFrame(g)}}const Xb=al,Jb=ll,Qb=ol,ew=cl,tw=rl,nw=Nh,rw=(e,t,n)=>{const r=new Map,o={platform:Gb,...n},i={...o.platform,_c:r};return nl(e,t,{...o,platform:i})};function Vc(e=0,t=0,n=0,r=0){if(typeof DOMRect=="function")return new DOMRect(e,t,n,r);const o={x:e,y:t,width:n,height:r,top:t,right:e+n,bottom:t+r,left:e};return{...o,toJSON:()=>o}}function ow(e){if(!e)return Vc();const{x:t,y:n,width:r,height:o}=e;return Vc(t,n,r,o)}function iw(e,t){return{contextElement:ft(e)?e:void 0,getBoundingClientRect:()=>{const n=e,r=t?.(n);return r||!n?ow(r):n.getBoundingClientRect()}}}var ir=e=>({variable:e,reference:`var(${e})`}),ht={arrowSize:ir("--arrow-size"),arrowSizeHalf:ir("--arrow-size-half"),arrowBg:ir("--arrow-background"),transformOrigin:ir("--transform-origin"),arrowOffset:ir("--arrow-offset")},sw=e=>({top:"bottom center","top-start":e?`${e.x}px bottom`:"left bottom","top-end":e?`${e.x}px bottom`:"right bottom",bottom:"top center","bottom-start":e?`${e.x}px top`:"top left","bottom-end":e?`${e.x}px top`:"top right",left:"right center","left-start":e?`right ${e.y}px`:"right top","left-end":e?`right ${e.y}px`:"right bottom",right:"left center","right-start":e?`left ${e.y}px`:"left top","right-end":e?`left ${e.y}px`:"left bottom"}),aw={name:"transformOrigin",fn({placement:e,elements:t,middlewareData:n}){const{arrow:r}=n,o=sw(r)[e],{floating:i}=t;return i.style.setProperty(ht.transformOrigin.variable,o),{data:{transformOrigin:o}}}},lw={name:"rects",fn({rects:e}){return{data:e}}},cw=e=>{if(e)return{name:"shiftArrow",fn({placement:t,middlewareData:n}){if(!n.arrow)return{};const{x:r,y:o}=n.arrow,i=t.split("-")[0];return Object.assign(e.style,{left:r!=null?`${r}px`:"",top:o!=null?`${o}px`:"",[i]:`calc(100% + ${ht.arrowOffset.reference})`}),{}}}};function uw(e){const[t,n]=e.split("-");return{side:t,align:n,hasAlign:n!=null}}var dw={strategy:"absolute",placement:"bottom",listeners:!0,gutter:8,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,overflowPadding:8,arrowPadding:4};function Kc(e,t){const n=e.devicePixelRatio||1;return Math.round(t*n)/n}function zc(e){return hb(e.boundary)}function fw(e,t){if(e)return tw({element:e,padding:t.arrowPadding})}function gw(e,t){if(!yb(t.offset??t.gutter))return Xb(({placement:n})=>{const r=(e?.clientHeight||0)/2,o=t.offset?.mainAxis??t.gutter,i=typeof o=="number"?o+r:o??r,{hasAlign:s}=uw(n),a=s?void 0:t.shift,l=t.offset?.crossAxis??a;return Mi({crossAxis:l,mainAxis:i,alignmentAxis:t.shift})})}function hw(e){if(e.flip)return Qb({boundary:zc(e),padding:e.overflowPadding,fallbackPlacements:e.flip===!0?void 0:e.flip})}function pw(e){if(!(!e.slide&&!e.overlap))return Jb({boundary:zc(e),mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:nw()})}function mw(e){return ew({padding:e.overflowPadding,apply({elements:t,rects:n,availableHeight:r,availableWidth:o}){const i=t.floating,s=Math.round(n.reference.width);o=Math.floor(o),r=Math.floor(r),i.style.setProperty("--reference-width",`${s}px`),i.style.setProperty("--available-width",`${o}px`),i.style.setProperty("--available-height",`${r}px`)}})}function yw(e){return e?e===!0?{ancestorResize:!0,ancestorScroll:!0,elementResize:!0,layoutShift:!0}:e:{}}function vw(e,t,n={}){const r=iw(e,n.getAnchorRect);if(!t||!r)return;const o=Object.assign({},dw,n),i=t.querySelector("[data-part=arrow]"),s=[gw(i,o),hw(o),pw(o),fw(i,o),cw(i),aw,mw(o),lw],{placement:a,strategy:l,onComplete:c,onPositioned:u}=o,d=async()=>{if(!r||!t)return;const p=await rw(r,t,{placement:a,middleware:s,strategy:l});c?.(p),u?.({placed:!0});const y=Ti(t),v=Kc(y,p.x),b=Kc(y,p.y);t.style.setProperty("--x",`${v}px`),t.style.setProperty("--y",`${b}px`);const w=t.firstElementChild;if(w){const x=y.getComputedStyle(w).zIndex;t.style.setProperty("--z-index",x)}},f=async()=>{n.updatePosition?(await n.updatePosition({updatePosition:d}),u?.({placed:!0})):await d()},m=yw(o.listeners),g=o.listeners?Zb(r,t,f,m):pb;return f(),()=>{g?.(),u?.({placed:!1})}}function bw(e,t,n={}){const{defer:r,...o}=n,i=r?Ve:a=>a(),s=[];return s.push(i(()=>{const a=typeof e=="function"?e():e,l=typeof t=="function"?t():t;s.push(vw(a,l,o))})),()=>{s.forEach(a=>a?.())}}var ww={bottom:"rotate(45deg)",left:"rotate(135deg)",top:"rotate(225deg)",right:"rotate(315deg)"};function xw(e={}){const{placement:t,sameWidth:n,fitViewport:r,strategy:o="absolute"}=e;return{arrow:{position:"absolute",width:ht.arrowSize.reference,height:ht.arrowSize.reference,[ht.arrowSizeHalf.variable]:`calc(${ht.arrowSize.reference} / 2)`,[ht.arrowOffset.variable]:`calc(${ht.arrowSizeHalf.reference} * -1)`},arrowTip:{transform:t?ww[t.split("-")[0]]:void 0,background:ht.arrowBg.reference,top:"0",left:"0",width:"100%",height:"100%",position:"absolute",zIndex:"inherit"},floating:{position:o,isolation:"isolate",minWidth:n?void 0:"max-content",width:n?"var(--reference-width)":void 0,maxWidth:r?"var(--available-width)":void 0,maxHeight:r?"var(--available-height)":void 0,top:"0px",left:"0px",transform:t?"translate3d(var(--x), var(--y), 0)":"translate3d(0, -100vh, 0)",zIndex:"var(--z-index)"}}}function Sw(e){const t={each(n){for(let r=0;r<e.frames?.length;r+=1){const o=e.frames[r];o&&n(o)}},queueBeforeEvent(n,r){const o=new Set;return t.each(i=>{try{o.add(Cc(i.document,n,r))}catch{}}),()=>{try{o.forEach(i=>i())}catch{}}},addEventListener(n,r,o){return t.each(i=>{try{i.document.addEventListener(n,r,o)}catch{}}),()=>{try{t.removeEventListener(n,r,o)}catch{}}},removeEventListener(n,r,o){t.each(i=>{try{i.document.removeEventListener(n,r,o)}catch{}})}};return t}var Bc="pointerdown.outside",jc="focus.outside";function Ew(e){for(const t of e)if(ft(t)&&wc(t))return!0;return!1}var Uc=e=>"clientY"in e;function Pw(e,t){if(!Uc(t)||!e)return!1;const n=e.getBoundingClientRect();return n.width===0||n.height===0?!1:n.top<=t.clientY&&t.clientY<=n.top+n.height&&n.left<=t.clientX&&t.clientX<=n.left+n.width}function Cw(e){const t=tr(e);if(!t||!Uc(e))return!1;const r=t.scrollHeight>t.clientHeight&&e.clientX>t.clientWidth,i=t.scrollWidth>t.clientWidth&&e.clientY>t.clientHeight;return r||i}function Ow(e,t){const{exclude:n,onFocusOutside:r,onPointerDownOutside:o,onInteractOutside:i,defer:s}=t;if(!e)return;const a=Jr(e),l=Ti(e),c=Sw(l);function u(y){const v=tr(y);return!ft(v)||Xr(e,v)||Pw(e,y)||Cw(y)?!1:!n?.(v)}const d=new Set;function f(y){function v(){const b=s?Ve:x=>x(),w=y.composedPath?.()??[y.target];b(()=>{if(!(!e||!u(y))){if(o||i){const x=Ec(o,i);e.addEventListener(Bc,x,{once:!0})}Oc(e,Bc,{bubbles:!1,cancelable:!0,detail:{originalEvent:y,contextmenu:Pb(y),focusable:Ew(w)}})}})}y.pointerType==="touch"?(d.forEach(b=>b()),d.add(Cc(a,"pointerup",v)),d.add(c.queueBeforeEvent("pointerup",v))):v()}const m=new Set,g=setTimeout(()=>{m.add(c.addEventListener("pointerdown",f,!0)),m.add(Li(a,"pointerdown",f,!0))},0);function p(y){(s?Ve:b=>b())(()=>{if(!(!e||!u(y))){if(r||i){const b=Ec(r,i);e.addEventListener(jc,b,{once:!0})}Oc(e,jc,{bubbles:!1,cancelable:!0,detail:{originalEvent:y,contextmenu:!1,focusable:wc(tr(y))}})}})}return m.add(Li(a,"focusin",p,!0)),m.add(c.addEventListener("focusin",p,!0)),()=>{clearTimeout(g),d.forEach(y=>y()),m.forEach(y=>y())}}function Dw(e,t){const{defer:n}=t,r=n?Ve:i=>i(),o=[];return o.push(r(()=>{const i=typeof e=="function"?e():e;o.push(Ow(i,t))})),()=>{o.forEach(i=>i?.())}}function kw(e,t){const n=r=>{r.key==="Escape"&&(r.isComposing||t?.(r))};return Li(Jr(e),"keydown",n,{capture:!0})}var Ye={layers:[],branches:[],count(){return this.layers.length},pointerBlockingLayers(){return this.layers.filter(e=>e.pointerBlocking)},topMostPointerBlockingLayer(){return[...this.pointerBlockingLayers()].slice(-1)[0]},hasPointerBlockingLayer(){return this.pointerBlockingLayers().length>0},isBelowPointerBlockingLayer(e){const t=this.indexOf(e),n=this.topMostPointerBlockingLayer()?this.indexOf(this.topMostPointerBlockingLayer()?.node):-1;return t<n},isTopMost(e){return this.layers[this.count()-1]?.node===e},getNestedLayers(e){return Array.from(this.layers).slice(this.indexOf(e)+1)},isInNestedLayer(e,t){return this.getNestedLayers(e).some(n=>Xr(n.node,t))},isInBranch(e){return Array.from(this.branches).some(t=>Xr(t,e))},add(e){const t=this.layers.push(e);e.node.style.setProperty("--layer-index",`${t}`)},addBranch(e){this.branches.push(e)},remove(e){const t=this.indexOf(e);t<0||(t<this.count()-1&&this.getNestedLayers(e).forEach(r=>r.dismiss()),this.layers.splice(t,1),e.style.removeProperty("--layer-index"))},removeBranch(e){const t=this.branches.indexOf(e);t>=0&&this.branches.splice(t,1)},indexOf(e){return this.layers.findIndex(t=>t.node===e)},dismiss(e){this.layers[this.indexOf(e)]?.dismiss()},clear(){this.remove(this.layers[0].node)}},Wc;function Hc(){Ye.layers.forEach(({node:e})=>{e.style.pointerEvents=Ye.isBelowPointerBlockingLayer(e)?"none":"auto"})}function Tw(e){e.style.pointerEvents=""}function $w(e,t){const n=Jr(e),r=[];if(Ye.hasPointerBlockingLayer()&&!n.body.hasAttribute("data-inert")&&(Wc=document.body.style.pointerEvents,queueMicrotask(()=>{n.body.style.pointerEvents="none",n.body.setAttribute("data-inert","")})),t){const o=db(t,i=>{r.push(lb(i,{pointerEvents:"auto"}))});r.push(o)}return()=>{Ye.hasPointerBlockingLayer()||(queueMicrotask(()=>{n.body.style.pointerEvents=Wc,n.body.removeAttribute("data-inert"),n.body.style.length===0&&n.body.removeAttribute("style")}),r.forEach(o=>o()))}}function Aw(e,t){if(!e){bb("[@zag-js/dismissable] node is `null` or `undefined`");return}const{onDismiss:n,pointerBlocking:r,exclude:o,debug:i}=t,s={dismiss:n,node:e,pointerBlocking:r};Ye.add(s),Hc();function a(f){const m=tr(f.detail.originalEvent);Ye.isBelowPointerBlockingLayer(e)||Ye.isInBranch(m)||(t.onPointerDownOutside?.(f),t.onInteractOutside?.(f),!f.defaultPrevented&&(i&&console.log("onPointerDownOutside:",f.detail.originalEvent),n?.()))}function l(f){const m=tr(f.detail.originalEvent);Ye.isInBranch(m)||(t.onFocusOutside?.(f),t.onInteractOutside?.(f),!f.defaultPrevented&&(i&&console.log("onFocusOutside:",f.detail.originalEvent),n?.()))}function c(f){Ye.isTopMost(e)&&(t.onEscapeKeyDown?.(f),!f.defaultPrevented&&n&&(f.preventDefault(),n()))}function u(f){if(!e)return!1;const m=typeof o=="function"?o():o,g=Array.isArray(m)?m:[m],p=t.persistentElements?.map(y=>y()).filter(ft);return p&&g.push(...p),g.some(y=>Xr(y,f))||Ye.isInNestedLayer(e,f)}const d=[r?$w(e,t.persistentElements):void 0,kw(e,c),Dw(e,{exclude:u,onFocusOutside:l,onPointerDownOutside:a,defer:t.defer})];return()=>{Ye.remove(e),Hc(),Tw(e),d.forEach(f=>f?.())}}function Mw(e,t){const{defer:n}=t,r=n?Ve:i=>i(),o=[];return o.push(r(()=>{const i=mb(e)?e():e;o.push(Aw(i,t))})),()=>{o.forEach(i=>i?.())}}const[Iw,ge]=$t({hookName:"useDatePickerContext",providerName:"<DatePickerProvider />"}),Lw=e=>{const t=ge(),n=kc(),r=ce(()=>t().getContentProps(),()=>n().presenceProps,e);return h(ie,{get when(){return!n().unmounted},get children(){return h(fe.div,r)}})},Rw=e=>e.children(ge()),Nw=e=>{const t=ge(),n=ce(()=>t().getControlProps(),e);return h(fe.div,n)},[Fw,Wt]=$t({hookName:"useDatePickerViewContext",providerName:"<DatePickerViewProvider />",strict:!1,defaultValue:{view:"day"}}),_w=e=>{const t=ge(),n=Wt(),r=ce(()=>t().getNextTriggerProps(n),e);return h(fe.button,r)},Vw=e=>{const t=ge(),n=kc(),r=ce(()=>t().getPositionerProps(),e);return h(ie,{get when(){return!n().unmounted},get children(){return h(fe.div,r)}})},Kw=e=>{const t=ge(),n=Wt(),r=ce(()=>t().getPrevTriggerProps(n),e);return h(fe.button,r)},zw=e=>{const t=ge(),n=ce(()=>t().getRangeTextProps(),e);return h(fe.div,I(n,{get children(){return t().visibleRangeText.start}}))};function Ki(e,t){return e-t*Math.floor(e/t)}const Yc=1721426;function io(e,t,n,r){t=zi(e,t);let o=t-1,i=-2;return n<=2?i=0:so(t)&&(i=-1),Yc-1+365*o+Math.floor(o/4)-Math.floor(o/100)+Math.floor(o/400)+Math.floor((367*n-362)/12+i+r)}function so(e){return e%4===0&&(e%100!==0||e%400===0)}function zi(e,t){return e==="BC"?1-t:t}function Bw(e){let t="AD";return e<=0&&(t="BC",e=1-e),[t,e]}const jw={standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]};class Dn{fromJulianDay(t){let n=t,r=n-Yc,o=Math.floor(r/146097),i=Ki(r,146097),s=Math.floor(i/36524),a=Ki(i,36524),l=Math.floor(a/1461),c=Ki(a,1461),u=Math.floor(c/365),d=o*400+s*100+l*4+u+(s!==4&&u!==4?1:0),[f,m]=Bw(d),g=n-io(f,m,1,1),p=2;n<io(f,m,3,1)?p=0:so(m)&&(p=1);let y=Math.floor(((g+p)*12+373)/367),v=n-io(f,m,y,1)+1;return new vt(f,m,y,v)}toJulianDay(t){return io(t.era,t.year,t.month,t.day)}getDaysInMonth(t){return jw[so(t.year)?"leapyear":"standard"][t.month-1]}getMonthsInYear(t){return 12}getDaysInYear(t){return so(t.year)?366:365}getYearsInEra(t){return 9999}getEras(){return["BC","AD"]}isInverseEra(t){return t.era==="BC"}balanceDate(t){t.year<=0&&(t.era=t.era==="BC"?"AD":"BC",t.year=1-t.year)}constructor(){this.identifier="gregory"}}const Uw={"001":1,AD:1,AE:6,AF:6,AI:1,AL:1,AM:1,AN:1,AR:1,AT:1,AU:1,AX:1,AZ:1,BA:1,BE:1,BG:1,BH:6,BM:1,BN:1,BY:1,CH:1,CL:1,CM:1,CN:1,CR:1,CY:1,CZ:1,DE:1,DJ:6,DK:1,DZ:6,EC:1,EE:1,EG:6,ES:1,FI:1,FJ:1,FO:1,FR:1,GB:1,GE:1,GF:1,GP:1,GR:1,HR:1,HU:1,IE:1,IQ:6,IR:6,IS:1,IT:1,JO:6,KG:1,KW:6,KZ:1,LB:1,LI:1,LK:1,LT:1,LU:1,LV:1,LY:6,MC:1,MD:1,ME:1,MK:1,MN:1,MQ:1,MV:5,MY:1,NL:1,NO:1,NZ:1,OM:6,PL:1,QA:6,RE:1,RO:1,RS:1,RU:1,SD:6,SE:1,SI:1,SK:1,SM:1,SY:6,TJ:1,TM:1,TR:1,UA:1,UY:1,UZ:1,VA:1,VN:1,XK:1};function kn(e,t){return t=Ge(t,e.calendar),e.era===t.era&&e.year===t.year&&e.month===t.month&&e.day===t.day}function Ww(e,t){return e.calendar.identifier===t.calendar.identifier&&e.era===t.era&&e.year===t.year&&e.month===t.month&&e.day===t.day}function Hw(e,t){return kn(e,lo(t))}function ao(e,t){let n=e.calendar.toJulianDay(e),r=Math.ceil(n+1-qw(t))%7;return r<0&&(r+=7),r}function Gc(e){return mt(Date.now(),e)}function lo(e){return $n(Gc(e))}function qc(e,t){return e.calendar.toJulianDay(e)-t.calendar.toJulianDay(t)}function Yw(e,t){return Zc(e)-Zc(t)}function Zc(e){return e.hour*36e5+e.minute*6e4+e.second*1e3+e.millisecond}let Bi=null;function ji(){return Bi==null&&(Bi=new Intl.DateTimeFormat().resolvedOptions().timeZone),Bi}function Lt(e){return e.subtract({days:e.day-1})}function Ui(e){return e.add({days:e.calendar.getDaysInMonth(e)-e.day})}function Wi(e){return Lt(e.subtract({months:e.month-1}))}function Gw(e){return Ui(e.add({months:e.calendar.getMonthsInYear(e)-e.month}))}function co(e,t){let n=ao(e,t);return e.subtract({days:n})}function Xc(e,t){return co(e,t).add({days:6})}const Jc=new Map;function Qc(e){if(Intl.Locale){let n=Jc.get(e);return n||(n=new Intl.Locale(e).maximize().region,n&&Jc.set(e,n)),n}let t=e.split("-")[1];return t==="u"?void 0:t}function qw(e){let t=Qc(e);return t&&Uw[t]||0}function Zw(e,t){let n=e.calendar.getDaysInMonth(e);return Math.ceil((ao(Lt(e),t)+n)/7)}function eu(e,t){return e&&t?e.compare(t)<=0?e:t:e||t}function tu(e,t){return e&&t?e.compare(t)>=0?e:t:e||t}const Xw={AF:[4,5],AE:[5,6],BH:[5,6],DZ:[5,6],EG:[5,6],IL:[5,6],IQ:[5,6],IR:[5,5],JO:[5,6],KW:[5,6],LY:[5,6],OM:[5,6],QA:[5,6],SA:[5,6],SD:[5,6],SY:[5,6],YE:[5,6]};function Jw(e,t){let n=e.calendar.toJulianDay(e),r=Math.ceil(n+1)%7;r<0&&(r+=7);let o=Qc(t),[i,s]=Xw[o]||[6,0];return r===i||r===s}function Tn(e){e=Ge(e,new Dn);let t=zi(e.era,e.year);return nu(t,e.month,e.day,e.hour,e.minute,e.second,e.millisecond)}function nu(e,t,n,r,o,i,s){let a=new Date;return a.setUTCHours(r,o,i,s),a.setUTCFullYear(e,t-1,n),a.getTime()}function Hi(e,t){if(t==="UTC")return 0;if(e>0&&t===ji())return new Date(e).getTimezoneOffset()*-6e4;let{year:n,month:r,day:o,hour:i,minute:s,second:a}=ou(e,t);return nu(n,r,o,i,s,a,0)-Math.floor(e/1e3)*1e3}const ru=new Map;function ou(e,t){let n=ru.get(t);n||(n=new Intl.DateTimeFormat("en-US",{timeZone:t,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),ru.set(t,n));let r=n.formatToParts(new Date(e)),o={};for(let i of r)i.type!=="literal"&&(o[i.type]=i.value);return{year:o.era==="BC"||o.era==="B"?-o.year+1:+o.year,month:+o.month,day:+o.day,hour:o.hour==="24"?0:+o.hour,minute:+o.minute,second:+o.second}}const iu=864e5;function Qw(e,t,n,r){return(n===r?[n]:[n,r]).filter(i=>e0(e,t,i))}function e0(e,t,n){let r=ou(n,t);return e.year===r.year&&e.month===r.month&&e.day===r.day&&e.hour===r.hour&&e.minute===r.minute&&e.second===r.second}function pt(e,t,n="compatible"){let r=Ht(e);if(t==="UTC")return Tn(r);if(t===ji()&&n==="compatible"){r=Ge(r,new Dn);let l=new Date,c=zi(r.era,r.year);return l.setFullYear(c,r.month-1,r.day),l.setHours(r.hour,r.minute,r.second,r.millisecond),l.getTime()}let o=Tn(r),i=Hi(o-iu,t),s=Hi(o+iu,t),a=Qw(r,t,o-i,o-s);if(a.length===1)return a[0];if(a.length>1)switch(n){case"compatible":case"earlier":return a[0];case"later":return a[a.length-1];case"reject":throw new RangeError("Multiple possible absolute times found")}switch(n){case"earlier":return Math.min(o-i,o-s);case"compatible":case"later":return Math.max(o-i,o-s);case"reject":throw new RangeError("No such absolute time found")}}function su(e,t,n="compatible"){return new Date(pt(e,t,n))}function mt(e,t){let n=Hi(e,t),r=new Date(e+n),o=r.getUTCFullYear(),i=r.getUTCMonth()+1,s=r.getUTCDate(),a=r.getUTCHours(),l=r.getUTCMinutes(),c=r.getUTCSeconds(),u=r.getUTCMilliseconds();return new ar(o,i,s,t,n,a,l,c,u)}function $n(e){return new vt(e.calendar,e.era,e.year,e.month,e.day)}function Ht(e,t){let n=0,r=0,o=0,i=0;if("timeZone"in e)({hour:n,minute:r,second:o,millisecond:i}=e);else if("hour"in e&&!t)return e;return t&&({hour:n,minute:r,second:o,millisecond:i}=t),new ho(e.calendar,e.era,e.year,e.month,e.day,n,r,o,i)}function Ge(e,t){if(e.calendar.identifier===t.identifier)return e;let n=t.fromJulianDay(e.calendar.toJulianDay(e)),r=e.copy();return r.calendar=t,r.era=n.era,r.year=n.year,r.month=n.month,r.day=n.day,Yt(r),r}function t0(e,t,n){if(e instanceof ar)return e.timeZone===t?e:r0(e,t);let r=pt(e,t,n);return mt(r,t)}function n0(e){let t=Tn(e)-e.offset;return new Date(t)}function r0(e,t){let n=Tn(e)-e.offset;return Ge(mt(n,t),e.calendar)}const sr=36e5;function uo(e,t){let n=e.copy(),r="hour"in n?a0(n,t):0;Yi(n,t.years||0),n.calendar.balanceYearMonth&&n.calendar.balanceYearMonth(n,e),n.month+=t.months||0,Gi(n),au(n),n.day+=(t.weeks||0)*7,n.day+=t.days||0,n.day+=r,o0(n),n.calendar.balanceDate&&n.calendar.balanceDate(n),n.year<1&&(n.year=1,n.month=1,n.day=1);let o=n.calendar.getYearsInEra(n);if(n.year>o){var i,s;let l=(i=(s=n.calendar).isInverseEra)===null||i===void 0?void 0:i.call(s,n);n.year=o,n.month=l?1:n.calendar.getMonthsInYear(n),n.day=l?1:n.calendar.getDaysInMonth(n)}n.month<1&&(n.month=1,n.day=1);let a=n.calendar.getMonthsInYear(n);return n.month>a&&(n.month=a,n.day=n.calendar.getDaysInMonth(n)),n.day=Math.max(1,Math.min(n.calendar.getDaysInMonth(n),n.day)),n}function Yi(e,t){var n,r;!((n=(r=e.calendar).isInverseEra)===null||n===void 0)&&n.call(r,e)&&(t=-t),e.year+=t}function Gi(e){for(;e.month<1;)Yi(e,-1),e.month+=e.calendar.getMonthsInYear(e);let t=0;for(;e.month>(t=e.calendar.getMonthsInYear(e));)e.month-=t,Yi(e,1)}function o0(e){for(;e.day<1;)e.month--,Gi(e),e.day+=e.calendar.getDaysInMonth(e);for(;e.day>e.calendar.getDaysInMonth(e);)e.day-=e.calendar.getDaysInMonth(e),e.month++,Gi(e)}function au(e){e.month=Math.max(1,Math.min(e.calendar.getMonthsInYear(e),e.month)),e.day=Math.max(1,Math.min(e.calendar.getDaysInMonth(e),e.day))}function Yt(e){e.calendar.constrainDate&&e.calendar.constrainDate(e),e.year=Math.max(1,Math.min(e.calendar.getYearsInEra(e),e.year)),au(e)}function lu(e){let t={};for(let n in e)typeof e[n]=="number"&&(t[n]=-e[n]);return t}function cu(e,t){return uo(e,lu(t))}function qi(e,t){let n=e.copy();return t.era!=null&&(n.era=t.era),t.year!=null&&(n.year=t.year),t.month!=null&&(n.month=t.month),t.day!=null&&(n.day=t.day),Yt(n),n}function fo(e,t){let n=e.copy();return t.hour!=null&&(n.hour=t.hour),t.minute!=null&&(n.minute=t.minute),t.second!=null&&(n.second=t.second),t.millisecond!=null&&(n.millisecond=t.millisecond),s0(n),n}function i0(e){e.second+=Math.floor(e.millisecond/1e3),e.millisecond=go(e.millisecond,1e3),e.minute+=Math.floor(e.second/60),e.second=go(e.second,60),e.hour+=Math.floor(e.minute/60),e.minute=go(e.minute,60);let t=Math.floor(e.hour/24);return e.hour=go(e.hour,24),t}function s0(e){e.millisecond=Math.max(0,Math.min(e.millisecond,1e3)),e.second=Math.max(0,Math.min(e.second,59)),e.minute=Math.max(0,Math.min(e.minute,59)),e.hour=Math.max(0,Math.min(e.hour,23))}function go(e,t){let n=e%t;return n<0&&(n+=t),n}function a0(e,t){return e.hour+=t.hours||0,e.minute+=t.minutes||0,e.second+=t.seconds||0,e.millisecond+=t.milliseconds||0,i0(e)}function Zi(e,t,n,r){let o=e.copy();switch(t){case"era":{let a=e.calendar.getEras(),l=a.indexOf(e.era);if(l<0)throw new Error("Invalid era: "+e.era);l=yt(l,n,0,a.length-1,r?.round),o.era=a[l],Yt(o);break}case"year":var i,s;!((i=(s=o.calendar).isInverseEra)===null||i===void 0)&&i.call(s,o)&&(n=-n),o.year=yt(e.year,n,-1/0,9999,r?.round),o.year===-1/0&&(o.year=1),o.calendar.balanceYearMonth&&o.calendar.balanceYearMonth(o,e);break;case"month":o.month=yt(e.month,n,1,e.calendar.getMonthsInYear(e),r?.round);break;case"day":o.day=yt(e.day,n,1,e.calendar.getDaysInMonth(e),r?.round);break;default:throw new Error("Unsupported field "+t)}return e.calendar.balanceDate&&e.calendar.balanceDate(o),Yt(o),o}function uu(e,t,n,r){let o=e.copy();switch(t){case"hour":{let i=e.hour,s=0,a=23;if(r?.hourCycle===12){let l=i>=12;s=l?12:0,a=l?23:11}o.hour=yt(i,n,s,a,r?.round);break}case"minute":o.minute=yt(e.minute,n,0,59,r?.round);break;case"second":o.second=yt(e.second,n,0,59,r?.round);break;case"millisecond":o.millisecond=yt(e.millisecond,n,0,999,r?.round);break;default:throw new Error("Unsupported field "+t)}return o}function yt(e,t,n,r,o=!1){if(o){e+=Math.sign(t),e<n&&(e=r);let i=Math.abs(t);t>0?e=Math.ceil(e/i)*i:e=Math.floor(e/i)*i,e>r&&(e=n)}else e+=t,e<n?e=r-(n-e-1):e>r&&(e=n+(e-r-1));return e}function du(e,t){let n;if(t.years!=null&&t.years!==0||t.months!=null&&t.months!==0||t.weeks!=null&&t.weeks!==0||t.days!=null&&t.days!==0){let o=uo(Ht(e),{years:t.years,months:t.months,weeks:t.weeks,days:t.days});n=pt(o,e.timeZone)}else n=Tn(e)-e.offset;n+=t.milliseconds||0,n+=(t.seconds||0)*1e3,n+=(t.minutes||0)*6e4,n+=(t.hours||0)*36e5;let r=mt(n,e.timeZone);return Ge(r,e.calendar)}function l0(e,t){return du(e,lu(t))}function c0(e,t,n,r){switch(t){case"hour":{let o=0,i=23;if(r?.hourCycle===12){let g=e.hour>=12;o=g?12:0,i=g?23:11}let s=Ht(e),a=Ge(fo(s,{hour:o}),new Dn),l=[pt(a,e.timeZone,"earlier"),pt(a,e.timeZone,"later")].filter(g=>mt(g,e.timeZone).day===a.day)[0],c=Ge(fo(s,{hour:i}),new Dn),u=[pt(c,e.timeZone,"earlier"),pt(c,e.timeZone,"later")].filter(g=>mt(g,e.timeZone).day===c.day).pop(),d=Tn(e)-e.offset,f=Math.floor(d/sr),m=d%sr;return d=yt(f,n,Math.floor(l/sr),Math.floor(u/sr),r?.round)*sr+m,Ge(mt(d,e.timeZone),e.calendar)}case"minute":case"second":case"millisecond":return uu(e,t,n,r);case"era":case"year":case"month":case"day":{let o=Zi(Ht(e),t,n,r),i=pt(o,e.timeZone);return Ge(mt(i,e.timeZone),e.calendar)}default:throw new Error("Unsupported field "+t)}}function u0(e,t,n){let r=Ht(e),o=fo(qi(r,t),t);if(o.compare(r)===0)return e;let i=pt(o,e.timeZone,n);return Ge(mt(i,e.timeZone),e.calendar)}const d0=/^(\d{4})-(\d{2})-(\d{2})$/;function f0(e){let t=e.match(d0);if(!t)throw new Error("Invalid ISO 8601 date string: "+e);let n=new vt(Xi(t[1],0,9999),Xi(t[2],1,12),1);return n.day=Xi(t[3],0,n.calendar.getDaysInMonth(n)),n}function Xi(e,t,n){let r=Number(e);if(r<t||r>n)throw new RangeError(`Value out of range: ${t} <= ${r} <= ${n}`);return r}function g0(e){return`${String(e.hour).padStart(2,"0")}:${String(e.minute).padStart(2,"0")}:${String(e.second).padStart(2,"0")}${e.millisecond?String(e.millisecond/1e3).slice(1):""}`}function fu(e){let t=Ge(e,new Dn);return`${String(t.year).padStart(4,"0")}-${String(t.month).padStart(2,"0")}-${String(t.day).padStart(2,"0")}`}function gu(e){return`${fu(e)}T${g0(e)}`}function h0(e){let t=Math.sign(e)<0?"-":"+";e=Math.abs(e);let n=Math.floor(e/36e5),r=e%36e5/6e4;return`${t}${String(n).padStart(2,"0")}:${String(r).padStart(2,"0")}`}function p0(e){return`${gu(e)}${h0(e.offset)}[${e.timeZone}]`}function Ji(e){let t=typeof e[0]=="object"?e.shift():new Dn,n;if(typeof e[0]=="string")n=e.shift();else{let s=t.getEras();n=s[s.length-1]}let r=e.shift(),o=e.shift(),i=e.shift();return[t,n,r,o,i]}var m0=new WeakMap;class vt{copy(){return this.era?new vt(this.calendar,this.era,this.year,this.month,this.day):new vt(this.calendar,this.year,this.month,this.day)}add(t){return uo(this,t)}subtract(t){return cu(this,t)}set(t){return qi(this,t)}cycle(t,n,r){return Zi(this,t,n,r)}toDate(t){return su(this,t)}toString(){return fu(this)}compare(t){return qc(this,t)}constructor(...t){ti(this,m0,{writable:!0,value:void 0});let[n,r,o,i,s]=Ji(t);this.calendar=n,this.era=r,this.year=o,this.month=i,this.day=s,Yt(this)}}var y0=new WeakMap;class ho{copy(){return this.era?new ho(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new ho(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(t){return uo(this,t)}subtract(t){return cu(this,t)}set(t){return qi(fo(this,t),t)}cycle(t,n,r){switch(t){case"era":case"year":case"month":case"day":return Zi(this,t,n,r);default:return uu(this,t,n,r)}}toDate(t,n){return su(this,t,n)}toString(){return gu(this)}compare(t){let n=qc(this,t);return n===0?Yw(this,Ht(t)):n}constructor(...t){ti(this,y0,{writable:!0,value:void 0});let[n,r,o,i,s]=Ji(t);this.calendar=n,this.era=r,this.year=o,this.month=i,this.day=s,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,Yt(this)}}var v0=new WeakMap;class ar{copy(){return this.era?new ar(this.calendar,this.era,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond):new ar(this.calendar,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond)}add(t){return du(this,t)}subtract(t){return l0(this,t)}set(t,n){return u0(this,t,n)}cycle(t,n,r){return c0(this,t,n,r)}toDate(){return n0(this)}toString(){return p0(this)}toAbsoluteString(){return this.toDate().toISOString()}compare(t){return this.toDate().getTime()-t0(t,this.timeZone).toDate().getTime()}constructor(...t){ti(this,v0,{writable:!0,value:void 0});let[n,r,o,i,s]=Ji(t),a=t.shift(),l=t.shift();this.calendar=n,this.era=r,this.year=o,this.month=i,this.day=s,this.timeZone=a,this.offset=l,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,Yt(this)}}let Qi=new Map;class Qe{format(t){return this.formatter.format(t)}formatToParts(t){return this.formatter.formatToParts(t)}formatRange(t,n){if(typeof this.formatter.formatRange=="function")return this.formatter.formatRange(t,n);if(n<t)throw new RangeError("End date must be >= start date");return`${this.formatter.format(t)} – ${this.formatter.format(n)}`}formatRangeToParts(t,n){if(typeof this.formatter.formatRangeToParts=="function")return this.formatter.formatRangeToParts(t,n);if(n<t)throw new RangeError("End date must be >= start date");let r=this.formatter.formatToParts(t),o=this.formatter.formatToParts(n);return[...r.map(i=>({...i,source:"startRange"})),{type:"literal",value:" – ",source:"shared"},...o.map(i=>({...i,source:"endRange"}))]}resolvedOptions(){let t=this.formatter.resolvedOptions();return x0()&&(this.resolvedHourCycle||(this.resolvedHourCycle=S0(t.locale,this.options)),t.hourCycle=this.resolvedHourCycle,t.hour12=this.resolvedHourCycle==="h11"||this.resolvedHourCycle==="h12"),t.calendar==="ethiopic-amete-alem"&&(t.calendar="ethioaa"),t}constructor(t,n={}){this.formatter=hu(t,n),this.options=n}}const b0={true:{ja:"h11"},false:{}};function hu(e,t={}){if(typeof t.hour12=="boolean"&&w0()){t={...t};let o=b0[String(t.hour12)][e.split("-")[0]],i=t.hour12?"h12":"h23";t.hourCycle=o??i,delete t.hour12}let n=e+(t?Object.entries(t).sort((o,i)=>o[0]<i[0]?-1:1).join():"");if(Qi.has(n))return Qi.get(n);let r=new Intl.DateTimeFormat(e,t);return Qi.set(n,r),r}let es=null;function w0(){return es==null&&(es=new Intl.DateTimeFormat("en-US",{hour:"numeric",hour12:!1}).format(new Date(2020,2,3,0))==="24"),es}let ts=null;function x0(){return ts==null&&(ts=new Intl.DateTimeFormat("fr",{hour:"numeric",hour12:!1}).resolvedOptions().hourCycle==="h12"),ts}function S0(e,t){if(!t.timeStyle&&!t.hour)return;e=e.replace(/(-u-)?-nu-[a-zA-Z0-9]+/,""),e+=(e.includes("-u-")?"":"-u")+"-nu-latn";let n=hu(e,{...t,timeZone:void 0}),r=parseInt(n.formatToParts(new Date(2020,2,3,0)).find(i=>i.type==="hour").value,10),o=parseInt(n.formatToParts(new Date(2020,2,3,23)).find(i=>i.type==="hour").value,10);if(r===0&&o===23)return"h23";if(r===24&&o===23)return"h24";if(r===0&&o===11)return"h11";if(r===12&&o===11)return"h12";throw new Error("Unexpected hour cycle result")}function E0(e,t,n,r,o){const i={};for(let a in t){const l=a,c=t[l];c!=null&&(i[l]=Math.floor(c/2),i[l]>0&&c%2===0&&i[l]--)}const s=Gt(e,t,n).subtract(i);return lr(e,s,t,n,r,o)}function Gt(e,t,n,r,o){let i=e;return t.years?i=Wi(e):t.months?i=Lt(e):t.weeks&&(i=co(e,n)),lr(e,i,t,n,r,o)}function ns(e,t,n,r,o){let i={...t};i.days?i.days--:i.weeks?i.weeks--:i.months?i.months--:i.years&&i.years--;let s=Gt(e,t,n).subtract(i);return lr(e,s,t,n,r,o)}function lr(e,t,n,r,o,i){return o&&e.compare(o)>=0&&(t=tu(t,Gt($n(o),n,r))),i&&e.compare(i)<=0&&(t=eu(t,ns($n(i),n,r))),t}function bt(e,t,n){return t&&(e=tu(e,$n(t))),n&&(e=eu(e,$n(n))),e}function pu(e,t,n,r,o,i){switch(t){case"start":return Gt(e,n,r,o,i);case"end":return ns(e,n,r,o,i);case"center":default:return E0(e,n,r,o,i)}}function P0(e,t){return Hw(e,t)}function qe(e,t){return t!=null&&kn(e,t)}function Rt(e,t,n){return t!=null&&e.compare(t)<0||n!=null&&e.compare(n)>0}function C0(e,t,n,r,o){return rs(e,t,n)||Rt(e,r,o)}function mu(e,t,n,r,o){return e?t?.(e,n)?!0:Rt(e,r,o):!1}function rs(e,t,n){return e.compare(t)<0||e.compare(n)>0}function O0(e,t,n){const r=e.subtract({days:1});return kn(r,e)||Rt(r,t,n)}function D0(e,t,n){const r=e.add({days:1});return kn(r,e)||Rt(r,t,n)}function os(e){let t={...e};for(let n in t)t[n]=1;return t}function yu(e,t){let n={...t};return n.days?n.days--:n.days=-1,e.add(n)}function k0(e,t,n,r,o){let i=n.formatRangeToParts(e.toDate(o),t.toDate(o)),s=-1;for(let c=0;c<i.length;c++){let u=i[c];if(u.source==="shared"&&u.type==="literal")s=c;else if(u.source==="endRange")break}let a="",l="";for(let c=0;c<i.length;c++)c<s?a+=i[c].value:c>s&&(l+=i[c].value);return r(a,l)}function vu(e){return e?.calendar.identifier==="gregory"&&e.era==="BC"?"short":void 0}function bu(e,t){const n=Ht(lo(t));return new Qe(e,{weekday:"long",month:"long",year:"numeric",day:"numeric",era:vu(n),timeZone:t})}function T0(e,t,n,r){let o=e,i=t??e,s=bu(n,r);return kn(o,i)?s.format(o.toDate(r)):k0(o,i,s,(a,l)=>`${a} – ${l}`,r)}function $0(e,t){const n=$n(lo(t));return new Qe(e,{month:"long",year:"numeric",era:vu(n),calendar:n?.calendar.identifier,timeZone:t})}function po(e){const t=e-e%10-1,n=[];for(let r=0;r<12;r+=1){const o=t+r;n.push(o)}return n}function wu(e,t,n=0){const o=(ao(e,t)-n+7)%7;return e.subtract({days:o})}function xu(e,t,n,r){const o=t.add({weeks:e}),i=[];let s=wu(o,n,r);for(;i.length<7;){i.push(s);let a=s.add({days:1});if(kn(s,a))break;s=a}return i}function A0(e,t,n){if(n==null)return Zw(e,t);const r=(ao(Lt(e),t)-n+7)%7;return Math.ceil((r+e.calendar.getDaysInMonth(e))/7)}function M0(e,t,n,r){const o=n??A0(e,t,r);return[...new Array(o).keys()].map(s=>xu(s,e,t,r))}function I0(e,t="long"){const n=new Date(2021,0,1),r=[];for(let o=0;o<12;o++)r.push(n.toLocaleString(e,{month:t})),n.setMonth(n.getMonth()+1);return r}function L0(e,t){const n=new Qe(e,{weekday:"long",timeZone:t}),r=new Qe(e,{weekday:"short",timeZone:t}),o=new Qe(e,{weekday:"narrow",timeZone:t});return i=>{const s=i instanceof Date?i:i.toDate(t);return{value:i,short:r.format(s),long:n.format(s),narrow:o.format(s)}}}function R0(e,t,n,r){const o=wu(e,r,t),i=[...new Array(7).keys()],s=L0(r,n);return i.map(a=>s(o.add({days:a})))}function An(e){return lo(e??ji())}function N0(e){return e.add({days:1})}function F0(e){return e.subtract({days:1})}function _0(e,t){return e.set({month:t})}function V0(e,t){return e.set({year:t})}function cr(e,t,n,r){return function(i){const{startDate:s,focusedDate:a}=i,l=yu(s,e);return Rt(a,n,r)?{startDate:s,focusedDate:bt(a,n,r),endDate:l}:a.compare(s)<0?{startDate:ns(a,e,t,n,r),focusedDate:bt(a,n,r),endDate:l}:a.compare(l)>0?{startDate:Gt(a,e,t,n,r),endDate:l,focusedDate:bt(a,n,r)}:{startDate:s,endDate:l,focusedDate:bt(a,n,r)}}}function Su(e,t,n,r,o,i){const s=cr(n,r,o,i),a=t.add(n);return s({focusedDate:e.add(n),startDate:Gt(lr(e,a,n,r,o,i),n,r)})}function Eu(e,t,n,r,o,i){const s=cr(n,r,o,i);let a=t.subtract(n);return s({focusedDate:e.subtract(n),startDate:Gt(lr(e,a,n,r,o,i),n,r)})}function K0(e,t,n,r,o,i,s){const a=cr(r,o,i,s);if(!n&&!r.days)return a({focusedDate:e.add(os(r)),startDate:t});if(r.days)return Su(e,t,r,o,i,s);if(r.weeks)return a({focusedDate:e.add({months:1}),startDate:t});if(r.months||r.years)return a({focusedDate:e.add({years:1}),startDate:t})}function z0(e,t,n,r,o,i,s){const a=cr(r,o,i,s);if(!n&&!r.days)return a({focusedDate:e.subtract(os(r)),startDate:t});if(r.days)return Eu(e,t,r,o,i,s);if(r.weeks)return a({focusedDate:e.subtract({months:1}),startDate:t});if(r.months||r.years)return a({focusedDate:e.subtract({years:1}),startDate:t})}var B0=e=>e!=null&&e.length===4,j0=e=>e!=null&&parseFloat(e)<=12,U0=e=>e!=null&&parseFloat(e)<=31;function Pu(e,t,n){const r=W0(t,n);let{year:o,month:i,day:s}=H0(r,e)??{};if(o!=null||i!=null||s!=null){const c=new Date;o||(o=c.getFullYear().toString()),i||(i=(c.getMonth()+1).toString()),s||(s=c.getDate().toString())}if(B0(o)&&j0(i)&&U0(s))return new vt(+o,+i,+s);const l=Date.parse(e);if(!isNaN(l)){const c=new Date(l);return new vt(c.getFullYear(),c.getMonth()+1,c.getDate())}}function W0(e,t){return new Qe(e,{day:"numeric",month:"numeric",year:"numeric",timeZone:t}).formatToParts(new Date(2e3,11,25)).map(({type:o,value:i})=>o==="literal"?`${i}?`:`((?!=<${o}>)\\d+)?`).join("")}function H0(e,t){const n=t.match(e);return e.toString().match(/<(.+?)>/g)?.map(r=>{const o=r.match(/<(.+)>/);return!o||o.length<=0?null:r.match(/<(.+)>/)?.[1]}).reduce((r,o,i)=>(o&&(n&&n.length>i?r[o]=n[i+1]:r[o]=null),r),{})}function Cu(e,t,n){const r=Gc(n);switch(e){case"thisWeek":return[co(r,t),Xc(r,t)];case"thisMonth":return[Lt(r),r];case"thisQuarter":return[Lt(r).add({months:-r.month%3}),r];case"thisYear":return[Wi(r),r];case"last3Days":return[r.add({days:-2}),r];case"last7Days":return[r.add({days:-6}),r];case"last14Days":return[r.add({days:-13}),r];case"last30Days":return[r.add({days:-29}),r];case"last90Days":return[r.add({days:-89}),r];case"lastMonth":return[Lt(r.add({months:-1})),Ui(r.add({months:-1}))];case"lastQuarter":return[Lt(r.add({months:-r.month%3-3})),Ui(r.add({months:-r.month%3-1}))];case"lastWeek":return[co(r,t).add({weeks:-1}),Xc(r,t).add({weeks:-1})];case"lastYear":return[Wi(r.add({years:-1})),Gw(r.add({years:-1}))];default:throw new Error(`Invalid date range preset: ${e}`)}}var mo="__live-region__";function Y0(e={}){const{level:t="polite",document:n=document,root:r,delay:o=0}=e,i=n.defaultView??window,s=r??n.body;function a(c,u){n.getElementById(mo)?.remove(),u=u??o;const f=n.createElement("span");f.id=mo,f.dataset.liveAnnouncer="true";const m=t!=="assertive"?"status":"alert";f.setAttribute("aria-live",t),f.setAttribute("role",m),Object.assign(f.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}),s.appendChild(f),i.setTimeout(()=>{f.textContent=c},u)}function l(){n.getElementById(mo)?.remove()}return{announce:a,destroy:l,toJSON(){return mo}}}var Ou=qr("date-picker").parts("root","label","clearTrigger","content","control","input","monthSelect","nextTrigger","positioner","prevTrigger","rangeText","table","tableBody","tableCell","tableCellTrigger","tableHead","tableHeader","tableRow","trigger","viewTrigger","viewControl","yearSelect","presetTrigger"),ne=Ou.build(),K=sb({getLabelId:(e,t)=>e.ids?.label?.(t)??`datepicker:${e.id}:label:${t}`,getRootId:e=>e.ids?.root??`datepicker:${e.id}`,getTableId:(e,t)=>e.ids?.table?.(t)??`datepicker:${e.id}:table:${t}`,getTableHeaderId:(e,t)=>e.ids?.tableHeader?.(t)??`datepicker:${e.id}:thead`,getTableBodyId:(e,t)=>e.ids?.tableBody?.(t)??`datepicker:${e.id}:tbody`,getTableRowId:(e,t)=>e.ids?.tableRow?.(t)??`datepicker:${e.id}:tr:${t}`,getContentId:e=>e.ids?.content??`datepicker:${e.id}:content`,getCellTriggerId:(e,t)=>e.ids?.cellTrigger?.(t)??`datepicker:${e.id}:cell-trigger:${t}`,getPrevTriggerId:(e,t)=>e.ids?.prevTrigger?.(t)??`datepicker:${e.id}:prev:${t}`,getNextTriggerId:(e,t)=>e.ids?.nextTrigger?.(t)??`datepicker:${e.id}:next:${t}`,getViewTriggerId:(e,t)=>e.ids?.viewTrigger?.(t)??`datepicker:${e.id}:view:${t}`,getClearTriggerId:e=>e.ids?.clearTrigger??`datepicker:${e.id}:clear`,getControlId:e=>e.ids?.control??`datepicker:${e.id}:control`,getInputId:(e,t)=>e.ids?.input?.(t)??`datepicker:${e.id}:input:${t}`,getTriggerId:e=>e.ids?.trigger??`datepicker:${e.id}:trigger`,getPositionerId:e=>e.ids?.positioner??`datepicker:${e.id}:positioner`,getMonthSelectId:e=>e.ids?.monthSelect??`datepicker:${e.id}:month-select`,getYearSelectId:e=>e.ids?.yearSelect??`datepicker:${e.id}:year-select`,getFocusedCell:(e,t=e.view)=>ib(K.getContentEl(e),`[data-part=table-cell-trigger][data-view=${t}][data-focus]:not([data-outside-range])`),getTriggerEl:e=>K.getById(e,K.getTriggerId(e)),getContentEl:e=>K.getById(e,K.getContentId(e)),getInputEls:e=>ob(K.getControlEl(e),"[data-part=input]"),getYearSelectEl:e=>K.getById(e,K.getYearSelectId(e)),getMonthSelectEl:e=>K.getById(e,K.getMonthSelectId(e)),getClearTriggerEl:e=>K.getById(e,K.getClearTriggerId(e)),getPositionerEl:e=>K.getById(e,K.getPositionerId(e)),getControlEl:e=>K.getById(e,K.getControlId(e))});function is(e){const[t,n]=e;return!t||!n||t.compare(n)<=0?e:[n,t]}function Du(e,t){const[n,r]=t;return!n||!r?!1:n.compare(e)<=0&&r.compare(e)>=0}function ss(e){return e.sort((t,n)=>t.compare(n))}function G0(e){return nr(e,{year:"calendar decade",month:"calendar year",day:"calendar month"})}var q0={day:"dd",month:"mm",year:"yyyy"};function Z0(e){return new Qe(e).formatToParts(new Date).map(t=>q0[t.type]??t.value).join("")}var ku=(e,t)=>e?/\d/.test(e)||e===t||e.length!==1:!0,X0=(e,t)=>e.split("").filter(n=>ku(n,t)).join("");function J0(e){const r=new Intl.DateTimeFormat(e).formatToParts(new Date).find(o=>o.type==="literal");return r?r.value:"/"}var Q0={dayCell(e){return e.unavailable?`Not available. ${e.formattedDate}`:e.selected?`Selected date. ${e.formattedDate}`:`Choose ${e.formattedDate}`},trigger(e){return e?"Close calendar":"Open calendar"},viewTrigger(e){return nr(e,{year:"Switch to month view",month:"Switch to day view",day:"Switch to year view"})},presetTrigger(e){return Array.isArray(e)?`select ${e[0].toString()} to ${e[1].toString()}`:`select ${e}`},prevTrigger(e){return nr(e,{year:"Switch to previous decade",month:"Switch to previous year",day:"Switch to previous month"})},nextTrigger(e){return nr(e,{year:"Switch to next decade",month:"Switch to next year",day:"Switch to next month"})},placeholder(){return{day:"dd",month:"mm",year:"yyyy"}},content:"calendar",monthSelect:"Select month",yearSelect:"Select year",clearTrigger:"Clear selected dates"},Tu=e=>e.toString().split("T")[0];function ex(e,t,n){const r=e.context.startValue,o=e.context.endValue,i=e.context.value,s=e.context.focusedValue,a=e.context.hoveredValue,l=a?is([i[0],a]):[],c=e.context.disabled,u=e.context.readOnly,d=e.context.isInteractive,f=e.context.min,m=e.context.max,g=e.context.locale,p=e.context.timeZone,y=e.context.startOfWeek,v=e.matches("focused"),b=e.matches("open"),w=e.context.selectionMode==="range",x=e.context.isDateUnavailable,T=e.context.currentPlacement,O=xw({...e.context.positioning,placement:T}),k=J0(g);function j(E=r){const S=e.context.fixedWeeks?6:void 0;return M0(E,g,S,y)}function P(E={}){const{format:S}=E;return I0(g,S).map((C,W)=>({label:C,value:W+1}))}function M(){return po(s.year).map(E=>({label:E.toString(),value:E}))}function $(E){return mu(E,x,g,f,m)}function R(E){const S=_0(r??An(p),E);t({type:"FOCUS.SET",value:S})}function se(E){const S=V0(r??An(p),E);t({type:"FOCUS.SET",value:S})}function J(E){const{value:S,disabled:C}=E,W=s.set({year:S}),we={focused:s.year===E.value,selectable:!Rt(W,f,m),selected:!!i.find(wt=>wt.year===S),valueText:S.toString(),get disabled(){return C||!we.selectable}};return we}function re(E){const{value:S,disabled:C}=E,W=s.set({month:S}),we=$0(g,p),wt={focused:s.month===E.value,selectable:!Rt(W,f,m),selected:!!i.find(G=>G.month===S&&G.year===s.year),valueText:we.format(W.toDate(p)),get disabled(){return C||!wt.selectable}};return wt}const N=e.context.translations||Q0;function X(E){const{value:S,disabled:C,visibleRange:W=e.context.visibleRange}=E,we=bu(g,p),wt=os(e.context.visibleDuration),G=W.start.add(wt).subtract({days:1}),Pe={invalid:Rt(S,f,m),disabled:C||C0(S,W.start,G,f,m),selected:i.some(ur=>qe(S,ur)),unavailable:mu(S,x,g,f,m)&&!C,outsideRange:rs(S,W.start,G),inRange:w&&(Du(S,i)||Du(S,l)),firstInRange:w&&qe(S,i[0]),lastInRange:w&&qe(S,i[1]),today:P0(S,p),weekend:Jw(S,g),formattedDate:we.format(S.toDate(p)),get focused(){return qe(S,s)&&!Pe.outsideRange},get ariaLabel(){return N.dayCell(Pe)},get selectable(){return!Pe.disabled&&!Pe.unavailable}};return Pe}function he(E){const{view:S="day",id:C}=E;return[S,C].filter(Boolean).join(" ")}return{focused:v,open:b,view:e.context.view,getRangePresetValue(E){return Cu(E,g,p)},getDaysInWeek(E,S=r){return xu(E,S,g,y)},getOffset(E){const S=r.add(E);return{visibleRange:{start:S,end:o.add(E)},weeks:j(S)}},getMonthWeeks:j,isUnavailable:$,weeks:j(),weekDays:R0(An(p),y,p,g),visibleRangeText:e.context.visibleRangeText,value:i,valueAsDate:i.map(E=>E.toDate(p)),valueAsString:i.map(Tu),focusedValue:s,focusedValueAsDate:s?.toDate(p),focusedValueAsString:Tu(s),visibleRange:e.context.visibleRange,selectToday(){const E=bt(An(p),f,m);t({type:"VALUE.SET",value:E})},setValue(E){const S=E.map(C=>bt(C,f,m));t({type:"VALUE.SET",value:S})},clearValue(){t("VALUE.CLEAR")},setFocusedValue(E){t({type:"FOCUS.SET",value:E})},setOpen(E){E!==b&&t(E?"OPEN":"CLOSE")},focusMonth:R,focusYear:se,getYears:M,getMonths:P,getYearsGrid(E={}){const{columns:S=1}=E;return xc(M(),S)},getDecade(){const E=po(s.year);return{start:E.at(0),end:E.at(-1)}},getMonthsGrid(E={}){const{columns:S=1,format:C}=E;return xc(P({format:C}),S)},format(E,S={month:"long",year:"numeric"}){return new Qe(g,S).format(E.toDate(p))},setView(E){t({type:"VIEW.SET",cell:E})},goToNext(){t({type:"GOTO.NEXT",view:e.context.view})},goToPrev(){t({type:"GOTO.PREV",view:e.context.view})},getRootProps(){return n.element({...ne.root.attrs,dir:e.context.dir,id:K.getRootId(e.context),"data-state":b?"open":"closed","data-disabled":te(c),"data-readonly":te(u)})},getLabelProps(E={}){const{index:S=0}=E;return n.label({...ne.label.attrs,id:K.getLabelId(e.context,S),dir:e.context.dir,htmlFor:K.getInputId(e.context,S),"data-state":b?"open":"closed","data-index":S,"data-disabled":te(c),"data-readonly":te(u)})},getControlProps(){return n.element({...ne.control.attrs,dir:e.context.dir,id:K.getControlId(e.context),"data-disabled":te(c)})},getRangeTextProps(){return n.element({...ne.rangeText.attrs,dir:e.context.dir})},getContentProps(){return n.element({...ne.content.attrs,hidden:!b,dir:e.context.dir,"data-state":b?"open":"closed","data-placement":T,id:K.getContentId(e.context),role:"application","aria-roledescription":"datepicker","aria-label":N.content})},getTableProps(E={}){const{view:S="day",columns:C=S==="day"?7:4}=E,W=he(E);return n.element({...ne.table.attrs,role:"grid","data-columns":C,"aria-roledescription":G0(S),id:K.getTableId(e.context,W),"aria-readonly":Ee(u),"aria-disabled":Ee(c),"aria-multiselectable":Ee(e.context.selectionMode!=="single"),"data-view":S,dir:e.context.dir,tabIndex:-1,onKeyDown(we){if(we.defaultPrevented)return;const G={Enter(){$(s)||t({type:"TABLE.ENTER",view:S,columns:C,focus:!0})},ArrowLeft(){t({type:"TABLE.ARROW_LEFT",view:S,columns:C,focus:!0})},ArrowRight(){t({type:"TABLE.ARROW_RIGHT",view:S,columns:C,focus:!0})},ArrowUp(){t({type:"TABLE.ARROW_UP",view:S,columns:C,focus:!0})},ArrowDown(){t({type:"TABLE.ARROW_DOWN",view:S,columns:C,focus:!0})},PageUp(Pe){t({type:"TABLE.PAGE_UP",larger:Pe.shiftKey,view:S,columns:C,focus:!0})},PageDown(Pe){t({type:"TABLE.PAGE_DOWN",larger:Pe.shiftKey,view:S,columns:C,focus:!0})},Home(){t({type:"TABLE.HOME",view:S,columns:C,focus:!0})},End(){t({type:"TABLE.END",view:S,columns:C,focus:!0})}}[Ob(we,e.context)];G&&(G(we),we.preventDefault(),we.stopPropagation())},onPointerLeave(){t({type:"TABLE.POINTER_LEAVE"})},onPointerDown(){t({type:"TABLE.POINTER_DOWN",view:S})},onPointerUp(){t({type:"TABLE.POINTER_UP",view:S})}})},getTableHeadProps(E={}){const{view:S="day"}=E;return n.element({...ne.tableHead.attrs,"aria-hidden":!0,dir:e.context.dir,"data-view":S,"data-disabled":te(c)})},getTableHeaderProps(E={}){const{view:S="day"}=E;return n.element({...ne.tableHeader.attrs,dir:e.context.dir,"data-view":S,"data-disabled":te(c)})},getTableBodyProps(E={}){const{view:S="day"}=E;return n.element({...ne.tableBody.attrs,"data-view":S,"data-disabled":te(c)})},getTableRowProps(E={}){const{view:S="day"}=E;return n.element({...ne.tableRow.attrs,"aria-disabled":Ee(c),"data-disabled":te(c),"data-view":S})},getDayTableCellState:X,getDayTableCellProps(E){const{value:S}=E,C=X(E);return n.element({...ne.tableCell.attrs,role:"gridcell","aria-disabled":Ee(!C.selectable),"aria-selected":C.selected||C.inRange,"aria-invalid":Ee(C.invalid),"aria-current":C.today?"date":void 0,"data-value":S.toString()})},getDayTableCellTriggerProps(E){const{value:S}=E,C=X(E);return n.element({...ne.tableCellTrigger.attrs,id:K.getCellTriggerId(e.context,S.toString()),role:"button",dir:e.context.dir,tabIndex:C.focused?0:-1,"aria-label":C.ariaLabel,"aria-disabled":Ee(!C.selectable),"aria-invalid":Ee(C.invalid),"data-disabled":te(!C.selectable),"data-selected":te(C.selected),"data-value":S.toString(),"data-view":"day","data-today":te(C.today),"data-focus":te(C.focused),"data-unavailable":te(C.unavailable),"data-range-start":te(C.firstInRange),"data-range-end":te(C.lastInRange),"data-in-range":te(C.inRange),"data-outside-range":te(C.outsideRange),"data-weekend":te(C.weekend),onClick(W){W.defaultPrevented||C.selectable&&t({type:"CELL.CLICK",cell:"day",value:S})},onPointerMove(W){if(W.pointerType==="touch"||!C.selectable)return;const we=W.currentTarget.ownerDocument.activeElement!==W.currentTarget;a&&Ww(S,a)||t({type:"CELL.POINTER_MOVE",cell:"day",value:S,focus:we})}})},getMonthTableCellState:re,getMonthTableCellProps(E){const{value:S,columns:C}=E,W=re(E);return n.element({...ne.tableCell.attrs,dir:e.context.dir,colSpan:C,role:"gridcell","aria-selected":Ee(W.selected),"data-selected":te(W.selected),"aria-disabled":Ee(!W.selectable),"data-value":S})},getMonthTableCellTriggerProps(E){const{value:S}=E,C=re(E);return n.element({...ne.tableCellTrigger.attrs,dir:e.context.dir,role:"button",id:K.getCellTriggerId(e.context,S.toString()),"data-selected":te(C.selected),"aria-disabled":Ee(!C.selectable),"data-disabled":te(!C.selectable),"data-focus":te(C.focused),"aria-label":C.valueText,"data-view":"month","data-value":S,tabIndex:C.focused?0:-1,onClick(W){W.defaultPrevented||C.selectable&&t({type:"CELL.CLICK",cell:"month",value:S})}})},getYearTableCellState:J,getYearTableCellProps(E){const{value:S,columns:C}=E,W=J(E);return n.element({...ne.tableCell.attrs,dir:e.context.dir,colSpan:C,role:"gridcell","aria-selected":Ee(W.selected),"data-selected":te(W.selected),"aria-disabled":Ee(!W.selectable),"data-value":S})},getYearTableCellTriggerProps(E){const{value:S}=E,C=J(E);return n.element({...ne.tableCellTrigger.attrs,dir:e.context.dir,role:"button",id:K.getCellTriggerId(e.context,S.toString()),"data-selected":te(C.selected),"data-focus":te(C.focused),"aria-disabled":Ee(!C.selectable),"data-disabled":te(!C.selectable),"aria-label":C.valueText,"data-value":S,"data-view":"year",tabIndex:C.focused?0:-1,onClick(W){W.defaultPrevented||C.selectable&&t({type:"CELL.CLICK",cell:"year",value:S})}})},getNextTriggerProps(E={}){const{view:S="day"}=E,C=c||!e.context.isNextVisibleRangeValid;return n.button({...ne.nextTrigger.attrs,dir:e.context.dir,id:K.getNextTriggerId(e.context,S),type:"button","aria-label":N.nextTrigger(S),disabled:C,"data-disabled":te(C),onClick(W){W.defaultPrevented||t({type:"GOTO.NEXT",view:S})}})},getPrevTriggerProps(E={}){const{view:S="day"}=E,C=c||!e.context.isPrevVisibleRangeValid;return n.button({...ne.prevTrigger.attrs,dir:e.context.dir,id:K.getPrevTriggerId(e.context,S),type:"button","aria-label":N.prevTrigger(S),disabled:C,"data-disabled":te(C),onClick(W){W.defaultPrevented||t({type:"GOTO.PREV",view:S})}})},getClearTriggerProps(){return n.button({...ne.clearTrigger.attrs,id:K.getClearTriggerId(e.context),dir:e.context.dir,type:"button","aria-label":N.clearTrigger,hidden:!e.context.value.length,onClick(E){E.defaultPrevented||t("VALUE.CLEAR")}})},getTriggerProps(){return n.button({...ne.trigger.attrs,id:K.getTriggerId(e.context),dir:e.context.dir,type:"button","data-placement":T,"aria-label":N.trigger(b),"aria-controls":K.getContentId(e.context),"data-state":b?"open":"closed","aria-haspopup":"grid",disabled:c,onClick(E){E.defaultPrevented||d&&t("TRIGGER.CLICK")}})},getViewTriggerProps(E={}){const{view:S="day"}=E;return n.button({...ne.viewTrigger.attrs,"data-view":S,dir:e.context.dir,id:K.getViewTriggerId(e.context,S),type:"button",disabled:c,"aria-label":N.viewTrigger(S),onClick(C){C.defaultPrevented||d&&t("VIEW.CHANGE")}})},getViewControlProps(E={}){const{view:S="day"}=E;return n.element({...ne.viewControl.attrs,"data-view":S,dir:e.context.dir})},getInputProps(E={}){const{index:S=0}=E;return n.input({...ne.input.attrs,id:K.getInputId(e.context,S),autoComplete:"off",autoCorrect:"off",spellCheck:"false",dir:e.context.dir,name:e.context.name,"data-index":S,"data-state":b?"open":"closed",readOnly:u,disabled:c,placeholder:Z0(g),defaultValue:e.context.formattedValue[S],onBeforeInput(C){const{data:W}=Db(C);ku(W,k)||C.preventDefault()},onFocus(){t({type:"INPUT.FOCUS",index:S})},onBlur(C){t({type:"INPUT.BLUR",value:C.currentTarget.value,index:S})},onKeyDown(C){C.defaultPrevented||d&&(Qv(C)||C.key==="Enter"&&($(e.context.focusedValue)||(t({type:"INPUT.ENTER",value:C.currentTarget.value,index:S}),C.preventDefault())))},onChange(C){const{value:W}=C.target;t({type:"INPUT.CHANGE",value:X0(W,k),index:S})}})},getMonthSelectProps(){return n.select({...ne.monthSelect.attrs,id:K.getMonthSelectId(e.context),"aria-label":N.monthSelect,disabled:c,dir:e.context.dir,defaultValue:r.month,onChange(E){R(Number(E.currentTarget.value))}})},getYearSelectProps(){return n.select({...ne.yearSelect.attrs,id:K.getYearSelectId(e.context),disabled:c,"aria-label":N.yearSelect,dir:e.context.dir,defaultValue:r.year,onChange(E){se(Number(E.currentTarget.value))}})},getPositionerProps(){return n.element({id:K.getPositionerId(e.context),...ne.positioner.attrs,dir:e.context.dir,style:O.floating})},getPresetTriggerProps(E){const S=Array.isArray(E.value)?E.value:Cu(E.value,g,p),C=S.map(W=>W.toDate(p).toDateString());return n.button({...ne.presetTrigger.attrs,"aria-label":N.presetTrigger(C),type:"button",onClick(W){W.defaultPrevented||t({type:"PRESET.CLICK",value:S})}})}}}var{and:Ke}=yv,tx=e=>{const t=e.locale||"en-US",n=e.timeZone||"UTC",r=e.selectionMode||"single",o=e.numOfMonths||1,i=ss(e.value||[]).map(l=>bt(l,e.min,e.max));let s=i[0]||e.focusedValue||An(n);s=bt(s,e.min,e.max);const a=pu(s,"start",{months:o},t);return{locale:t,numOfMonths:o,focusedValue:s,startValue:a,timeZone:n,value:i,selectionMode:r,view:"day",activeIndex:0,hoveredValue:null,closeOnSelect:!0,disabled:!1,readOnly:!1,...e,positioning:{placement:"bottom",...e.positioning}}};function nx(e){const t=Mi(e);return fc({id:"datepicker",initial:t.open?"open":"idle",context:tx(t),computed:{valueAsString:n=>n.value.map(r=>T0(r,null,n.locale,n.timeZone)),isInteractive:n=>!n.disabled&&!n.readOnly,visibleDuration:n=>({months:n.numOfMonths}),endValue:n=>yu(n.startValue,n.visibleDuration),visibleRange:n=>({start:n.startValue,end:n.endValue}),visibleRangeText(n){const r=new Qe(n.locale,{month:"long",year:"numeric",timeZone:n.timeZone}),o=r.format(n.startValue.toDate(n.timeZone)),i=r.format(n.endValue.toDate(n.timeZone)),s=n.selectionMode==="range"?`${o} - ${i}`:o;return{start:o,end:i,formatted:s}},isPrevVisibleRangeValid:n=>!O0(n.startValue,n.min,n.max),isNextVisibleRangeValid:n=>!D0(n.endValue,n.min,n.max),formattedValue(n){const r={timeZone:n.timeZone,day:"2-digit",month:"2-digit",year:"numeric"},o=new Qe(n.locale,r);return n.value.map(i=>n.format?.(i)??o.format(i.toDate(n.timeZone)))}},activities:["setupLiveRegion"],created:["setStartValue"],watch:{locale:["setStartValue"],focusedValue:["setStartValue","syncMonthSelectElement","syncYearSelectElement","focusActiveCellIfNeeded","setHoveredValueIfKeyboard"],value:["syncInputElement"],valueAsString:["announceValueText"],view:["focusActiveCell"],open:["toggleVisibility"]},on:{"VALUE.SET":{actions:["setDateValue","setFocusedDate"]},"VIEW.SET":{actions:["setView"]},"FOCUS.SET":{actions:["setFocusedDate"]},"VALUE.CLEAR":{actions:["clearDateValue","clearFocusedDate","focusFirstInputElement"]},"INPUT.CHANGE":{actions:["focusParsedDate"]},"INPUT.ENTER":{actions:["focusParsedDate","selectFocusedDate"]},"INPUT.FOCUS":{actions:["setActiveIndex"]},"INPUT.BLUR":{actions:["setActiveIndexToStart","selectParsedDate"]},"PRESET.CLICK":[{guard:"isOpenControlled",actions:["setDateValue","setFocusedDate","invokeOnClose"]},{target:"focused",actions:["setDateValue","setFocusedDate","focusInputElement"]}],"GOTO.NEXT":[{guard:"isYearView",actions:["focusNextDecade","announceVisibleRange"]},{guard:"isMonthView",actions:["focusNextYear","announceVisibleRange"]},{actions:["focusNextPage"]}],"GOTO.PREV":[{guard:"isYearView",actions:["focusPreviousDecade","announceVisibleRange"]},{guard:"isMonthView",actions:["focusPreviousYear","announceVisibleRange"]},{actions:["focusPreviousPage"]}]},states:{idle:{tags:"closed",on:{"CONTROLLED.OPEN":{target:"open",actions:["focusFirstSelectedDate","focusActiveCell"]},"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["focusFirstSelectedDate","focusActiveCell","invokeOnOpen"]}],OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["focusFirstSelectedDate","focusActiveCell","invokeOnOpen"]}]}},focused:{tags:"closed",on:{"CONTROLLED.OPEN":{target:"open",actions:["focusFirstSelectedDate","focusActiveCell"]},"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["focusFirstSelectedDate","focusActiveCell","invokeOnOpen"]}],OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["focusFirstSelectedDate","focusActiveCell","invokeOnOpen"]}]}},open:{tags:"open",activities:["trackDismissableElement","trackPositioning"],exit:["clearHoveredDate","resetView"],on:{"CONTROLLED.CLOSE":[{guard:Ke("shouldRestoreFocus","isInteractOutsideEvent"),target:"focused",actions:["focusTriggerElement"]},{guard:"shouldRestoreFocus",target:"focused",actions:["focusInputElement"]},{target:"idle"}],"CELL.CLICK":[{guard:"isMonthView",actions:["setFocusedMonth","setViewToDay"]},{guard:"isYearView",actions:["setFocusedYear","setViewToMonth"]},{guard:Ke("isRangePicker","hasSelectedRange"),actions:["setActiveIndexToStart","clearDateValue","setFocusedDate","setSelectedDate","setActiveIndexToEnd"]},{guard:Ke("isRangePicker","isSelectingEndDate","closeOnSelect","isOpenControlled"),actions:["setFocusedDate","setSelectedDate","setActiveIndexToStart","invokeOnClose","setRestoreFocus"]},{guard:Ke("isRangePicker","isSelectingEndDate","closeOnSelect"),target:"focused",actions:["setFocusedDate","setSelectedDate","setActiveIndexToStart","invokeOnClose","focusInputElement"]},{guard:Ke("isRangePicker","isSelectingEndDate"),actions:["setFocusedDate","setSelectedDate","setActiveIndexToStart","clearHoveredDate"]},{guard:"isRangePicker",actions:["setFocusedDate","setSelectedDate","setActiveIndexToEnd"]},{guard:"isMultiPicker",actions:["setFocusedDate","toggleSelectedDate"]},{guard:Ke("closeOnSelect","isOpenControlled"),actions:["setFocusedDate","setSelectedDate","invokeOnClose"]},{guard:"closeOnSelect",target:"focused",actions:["setFocusedDate","setSelectedDate","invokeOnClose","focusInputElement"]},{actions:["setFocusedDate","setSelectedDate"]}],"CELL.POINTER_MOVE":{guard:Ke("isRangePicker","isSelectingEndDate"),actions:["setHoveredDate","setFocusedDate"]},"TABLE.POINTER_LEAVE":{guard:"isRangePicker",actions:["clearHoveredDate"]},"TABLE.POINTER_DOWN":{actions:["disableTextSelection"]},"TABLE.POINTER_UP":{actions:["enableTextSelection"]},"TABLE.ESCAPE":[{guard:"isOpenControlled",actions:["focusFirstSelectedDate","invokeOnClose"]},{target:"focused",actions:["focusFirstSelectedDate","invokeOnClose","focusTriggerElement"]}],"TABLE.ENTER":[{guard:"isMonthView",actions:"setViewToDay"},{guard:"isYearView",actions:"setViewToMonth"},{guard:Ke("isRangePicker","hasSelectedRange"),actions:["setActiveIndexToStart","clearDateValue","setSelectedDate","setActiveIndexToEnd"]},{guard:Ke("isRangePicker","isSelectingEndDate","closeOnSelect","isOpenControlled"),actions:["setSelectedDate","setActiveIndexToStart","invokeOnClose"]},{guard:Ke("isRangePicker","isSelectingEndDate","closeOnSelect"),target:"focused",actions:["setSelectedDate","setActiveIndexToStart","invokeOnClose","focusInputElement"]},{guard:Ke("isRangePicker","isSelectingEndDate"),actions:["setSelectedDate","setActiveIndexToStart"]},{guard:"isRangePicker",actions:["setSelectedDate","setActiveIndexToEnd","focusNextDay"]},{guard:"isMultiPicker",actions:["toggleSelectedDate"]},{guard:Ke("closeOnSelect","isOpenControlled"),actions:["selectFocusedDate","invokeOnClose"]},{guard:"closeOnSelect",target:"focused",actions:["selectFocusedDate","invokeOnClose","focusInputElement"]},{actions:["selectFocusedDate"]}],"TABLE.ARROW_RIGHT":[{guard:"isMonthView",actions:"focusNextMonth"},{guard:"isYearView",actions:"focusNextYear"},{actions:["focusNextDay","setHoveredDate"]}],"TABLE.ARROW_LEFT":[{guard:"isMonthView",actions:"focusPreviousMonth"},{guard:"isYearView",actions:"focusPreviousYear"},{actions:["focusPreviousDay"]}],"TABLE.ARROW_UP":[{guard:"isMonthView",actions:"focusPreviousMonthColumn"},{guard:"isYearView",actions:"focusPreviousYearColumn"},{actions:["focusPreviousWeek"]}],"TABLE.ARROW_DOWN":[{guard:"isMonthView",actions:"focusNextMonthColumn"},{guard:"isYearView",actions:"focusNextYearColumn"},{actions:["focusNextWeek"]}],"TABLE.PAGE_UP":{actions:["focusPreviousSection"]},"TABLE.PAGE_DOWN":{actions:["focusNextSection"]},"TABLE.HOME":[{guard:"isMonthView",actions:["focusFirstMonth"]},{guard:"isYearView",actions:["focusFirstYear"]},{actions:["focusSectionStart"]}],"TABLE.END":[{guard:"isMonthView",actions:["focusLastMonth"]},{guard:"isYearView",actions:["focusLastYear"]},{actions:["focusSectionEnd"]}],"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"focused",actions:["invokeOnClose"]}],"VIEW.CHANGE":[{guard:"isDayView",actions:["setViewToMonth"]},{guard:"isMonthView",actions:["setViewToYear"]}],INTERACT_OUTSIDE:[{guard:"isOpenControlled",actions:["setActiveIndexToStart","invokeOnClose"]},{guard:"shouldRestoreFocus",target:"focused",actions:["setActiveIndexToStart","invokeOnClose","focusTriggerElement"]},{target:"idle",actions:["setActiveIndexToStart","invokeOnClose"]}],CLOSE:[{guard:"isOpenControlled",actions:["setActiveIndexToStart","invokeOnClose"]},{target:"idle",actions:["setActiveIndexToStart","invokeOnClose"]}]}}}},{guards:{isDayView:(n,r)=>(r.view||n.view)==="day",isMonthView:(n,r)=>(r.view||n.view)==="month",isYearView:(n,r)=>(r.view||n.view)==="year",isRangePicker:n=>n.selectionMode==="range",hasSelectedRange:n=>n.value.length===2,isMultiPicker:n=>n.selectionMode==="multiple",shouldRestoreFocus:n=>!!n.restoreFocus,isSelectingEndDate:n=>n.activeIndex===1,closeOnSelect:n=>!!n.closeOnSelect,isOpenControlled:n=>!!n["open.controlled"],isInteractOutsideEvent:(n,r)=>r.previousEvent?.type==="INTERACT_OUTSIDE"},activities:{trackPositioning(n){n.currentPlacement=n.positioning.placement;const r=K.getControlEl(n);return bw(r,()=>K.getPositionerEl(n),{...n.positioning,defer:!0,onComplete(i){n.currentPlacement=i.placement}})},setupLiveRegion(n){const r=K.getDoc(n);return n.announcer=Y0({level:"assertive",document:r}),()=>n.announcer?.destroy?.()},trackDismissableElement(n,r,{send:o}){return Mw(()=>K.getContentEl(n),{defer:!0,exclude:[...K.getInputEls(n),K.getTriggerEl(n),K.getClearTriggerEl(n)],onInteractOutside(s){n.restoreFocus=!s.detail.focusable},onDismiss(){o({type:"INTERACT_OUTSIDE"})},onEscapeKeyDown(s){s.preventDefault(),o({type:"TABLE.ESCAPE",src:"dismissable"})}})}},actions:{setViewToDay(n){H.view(n,"day")},setViewToMonth(n){H.view(n,"month")},setViewToYear(n){H.view(n,"year")},setView(n,r){H.view(n,r.cell)},setRestoreFocus(n){n.restoreFocus=!0},announceValueText(n){n.announcer?.announce(n.valueAsString.join(","),3e3)},announceVisibleRange(n){const{formatted:r}=n.visibleRangeText;n.announcer?.announce(r)},disableTextSelection(n){Eb({target:K.getContentEl(n),doc:K.getDoc(n)})},enableTextSelection(n){Pc({doc:K.getDoc(n),target:K.getContentEl(n)})},focusFirstSelectedDate(n){n.value.length&&H.focusedValue(n,n.value[0])},syncInputElement(n){Ve(()=>{K.getInputEls(n).forEach((o,i)=>{K.setValue(o,n.formattedValue[i]||"")})})},setFocusedDate(n,r){const o=Array.isArray(r.value)?r.value[0]:r.value;H.focusedValue(n,o)},setFocusedMonth(n,r){H.focusedValue(n,n.focusedValue.set({month:r.value}))},focusNextMonth(n){H.focusedValue(n,n.focusedValue.add({months:1}))},focusPreviousMonth(n){H.focusedValue(n,n.focusedValue.subtract({months:1}))},setFocusedYear(n,r){H.focusedValue(n,n.focusedValue.set({year:r.value}))},setDateValue(n,r){if(!Array.isArray(r.value))return;const o=r.value.map(i=>bt(i,n.min,n.max));H.value(n,o)},clearDateValue(n){H.value(n,[])},setSelectedDate(n,r){const o=Array.from(n.value);o[n.activeIndex]=r.value??n.focusedValue,H.value(n,is(o))},toggleSelectedDate(n,r){const o=r.value??n.focusedValue,i=n.value.findIndex(s=>qe(s,o));if(i===-1){const s=[...n.value,o];H.value(n,ss(s))}else{const s=Array.from(n.value);s.splice(i,1),H.value(n,ss(s))}},setHoveredDate(n,r){n.hoveredValue=r.value},clearHoveredDate(n){n.hoveredValue=null},selectFocusedDate(n){const r=Array.from(n.value);r[n.activeIndex]=n.focusedValue.copy(),H.value(n,is(r))},setPreviousDate(n){H.focusedValue(n,F0(n.focusedValue))},setNextDate(n){H.focusedValue(n,N0(n.focusedValue))},focusPreviousDay(n){H.focusedValue(n,n.focusedValue.subtract({days:1}))},focusNextDay(n){H.focusedValue(n,n.focusedValue.add({days:1}))},focusPreviousWeek(n){H.focusedValue(n,n.focusedValue.subtract({weeks:1}))},focusNextWeek(n){H.focusedValue(n,n.focusedValue.add({weeks:1}))},focusNextPage(n){const r=Su(n.focusedValue,n.startValue,n.visibleDuration,n.locale,n.min,n.max);H.adjustedValue(n,r)},focusPreviousPage(n){const r=Eu(n.focusedValue,n.startValue,n.visibleDuration,n.locale,n.min,n.max);H.adjustedValue(n,r)},focusSectionStart(n){H.focusedValue(n,n.startValue.copy())},focusSectionEnd(n){H.focusedValue(n,n.endValue.copy())},focusNextSection(n,r){const o=K0(n.focusedValue,n.startValue,r.larger,n.visibleDuration,n.locale,n.min,n.max);o&&H.adjustedValue(n,o)},focusPreviousSection(n,r){const o=z0(n.focusedValue,n.startValue,r.larger,n.visibleDuration,n.locale,n.min,n.max);o&&H.adjustedValue(n,o)},focusNextYear(n){H.focusedValue(n,n.focusedValue.add({years:1}))},focusPreviousYear(n){H.focusedValue(n,n.focusedValue.subtract({years:1}))},focusNextDecade(n){H.focusedValue(n,n.focusedValue.add({years:10}))},focusPreviousDecade(n){H.focusedValue(n,n.focusedValue.subtract({years:10}))},clearFocusedDate(n){H.focusedValue(n,An(n.timeZone))},focusPreviousMonthColumn(n,r){H.focusedValue(n,n.focusedValue.subtract({months:r.columns}))},focusNextMonthColumn(n,r){H.focusedValue(n,n.focusedValue.add({months:r.columns}))},focusPreviousYearColumn(n,r){H.focusedValue(n,n.focusedValue.subtract({years:r.columns}))},focusNextYearColumn(n,r){H.focusedValue(n,n.focusedValue.add({years:r.columns}))},focusFirstMonth(n){H.focusedValue(n,n.focusedValue.set({month:0}))},focusLastMonth(n){H.focusedValue(n,n.focusedValue.set({month:12}))},focusFirstYear(n){const r=po(n.focusedValue.year);H.focusedValue(n,n.focusedValue.set({year:r.at(0)}))},focusLastYear(n){const r=po(n.focusedValue.year);H.focusedValue(n,n.focusedValue.set({year:r.at(-1)}))},setActiveIndex(n,r){n.activeIndex=r.index},setActiveIndexToEnd(n){n.activeIndex=1},setActiveIndexToStart(n){n.activeIndex=0},focusActiveCell(n){Ve(()=>{K.getFocusedCell(n)?.focus({preventScroll:!0})})},focusActiveCellIfNeeded(n,r){r.focus&&Ve(()=>{K.getFocusedCell(n)?.focus({preventScroll:!0})})},setHoveredValueIfKeyboard(n,r){!r.type.startsWith("TABLE.ARROW")||n.selectionMode!=="range"||n.activeIndex===0||(n.hoveredValue=n.focusedValue.copy())},focusTriggerElement(n){Ve(()=>{K.getTriggerEl(n)?.focus({preventScroll:!0})})},focusFirstInputElement(n){Ve(()=>{K.getInputEls(n)[0]?.focus({preventScroll:!0})})},focusInputElement(n){Ve(()=>{const r=K.getInputEls(n),o=r.findLastIndex(a=>a.value!==""),i=Math.max(o,0),s=r[i];s?.focus({preventScroll:!0}),s?.setSelectionRange(s.value.length,s.value.length)})},syncMonthSelectElement(n){const r=K.getMonthSelectEl(n);r&&(r.value=n.startValue.month.toString())},syncYearSelectElement(n){const r=K.getYearSelectEl(n);r&&(r.value=n.startValue.year.toString())},focusParsedDate(n,r){if(r.index==null)return;const o=Pu(r.value,n.locale,n.timeZone);o&&H.focusedValue(n,o)},selectParsedDate(n,r){if(r.index==null)return;const o=Pu(r.value,n.locale,n.timeZone);if(!o)return;const i=Array.from(n.value);i[r.index]=o,H.value(n,i)},resetView(n,r,{initialContext:o}){H.view(n,o.view)},setStartValue(n){if(!rs(n.focusedValue,n.startValue,n.endValue))return;const o=pu(n.focusedValue,"start",{months:n.numOfMonths},n.locale);n.startValue=o},invokeOnOpen(n){n.onOpenChange?.({open:!0})},invokeOnClose(n){n.onOpenChange?.({open:!1})},toggleVisibility(n,r,{send:o}){o({type:n.open?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:r})}},compareFns:{startValue:qe,endValue:qe,focusedValue:qe,value:$u}})}var yo={change(e){const t=Array.from(e.value),n=t.map(r=>r.toString());e.onValueChange?.({value:t,valueAsString:n,view:e.view})},focusChange(e){const t=Array.from(e.value),n=t.map(r=>r.toString());e.onFocusChange?.({focusedValue:e.focusedValue,value:t,valueAsString:n,view:e.view})},viewChange(e){e.onViewChange?.({view:e.view})}},$u=(e,t)=>e.length!==t.length?!1:e.every((n,r)=>qe(n,t[r])),H={value(e,t){$u(e.value,t)||(e.value=t,yo.change(e))},focusedValue(e,t){if(!t||qe(e.focusedValue,t))return;const r=cr(e.visibleDuration,e.locale,e.min,e.max)({focusedDate:t,startDate:e.startValue});e.startValue=r.startDate,e.focusedValue=r.focusedDate,yo.focusChange(e)},adjustedValue(e,t){e.startValue=t.startDate,!qe(e.focusedValue,t.focusedDate)&&(e.focusedValue=t.focusedDate,yo.focusChange(e))},view(e,t){Ai(e.view,t)||(e.view=t,yo.viewChange(e))}};function Mn(e){return Array.isArray(e)?e.map(t=>Mn(t)):e instanceof Date?new vt(e.getFullYear(),e.getMonth()+1,e.getDate()):f0(e)}jt()(["closeOnSelect","dir","disabled","fixedWeeks","focusedValue","format","getRootNode","id","ids","isDateUnavailable","isDateUnavailable","locale","max","min","modal","name","numOfMonths","onFocusChange","onOpenChange","onValueChange","onViewChange","open","open.controlled","positioning","readOnly","selectionMode","startOfWeek","timeZone","translations","value","view"]),jt()(["index"]),jt()(["value"]),jt()(["columns","id","view"]),jt()(["disabled","value","columns"]),jt()(["view"]);const rx=e=>{const t=xb(),n=wb(),r=Le(),o=A(()=>({id:r,dir:t().dir,getRootNode:n().getRootNode,"open.controlled":e.open!==void 0,open:e.defaultOpen,...e,focusedValue:e.focusedValue?Mn(e.focusedValue):void 0,value:e.value?Mn(e.value):e.defaultValue?Mn(e.defaultValue):void 0,max:e.max?Mn(e.max):void 0,min:e.min?Mn(e.min):void 0})),[i,s]=mc(nx(o()),{context:o});return A(()=>ex(i,s,Mv))},ox=e=>{const[t,n]=kb(e),[r,o]=wn()(n,["closeOnSelect","defaultOpen","defaultValue","disabled","fixedWeeks","focusedValue","format","id","ids","isDateUnavailable","isDateUnavailable","locale","max","min","modal","name","numOfMonths","onFocusChange","onOpenChange","onValueChange","onViewChange","open","positioning","readOnly","selectionMode","startOfWeek","timeZone","translations","value","view"]),i=rx(r),s=Ab(ce(t,()=>({present:i().open}))),a=ce(()=>i().getRootProps(),o);return h(Iw,{value:i,get children(){return h(Mb,{value:s,get children(){return h(fe.div,a)}})}})},[ix,vo]=$t({hookName:"useDatePickerTableContext",providerName:"<DatePickerTableProvider />"}),sx=e=>{const[{columns:t},n]=wn()(e,["columns"]),r=ge(),o=Wt(),i={columns:t,id:Le(),...o},s=ce(()=>r().getTableProps(i),n);return h(ix,{value:i,get children(){return h(fe.table,s)}})},ax=e=>{const t=ge(),n=vo(),r=ce(()=>t().getTableBodyProps(n),e);return h(fe.tbody,r)},[lx,cx]=$t({hookName:"useDatePickerTableCellContext",providerName:"<DatePickerTableCellProvider />"}),ux=e=>{const[t,n]=wn()(e,["disabled","value","visibleRange","columns"]),r=ge(),o=Wt(),i=A(()=>{const l={day:r().getDayTableCellProps,month:r().getMonthTableCellProps,year:r().getYearTableCellProps}[o.view];return l(t)}),s=ce(i,n);return h(lx,{value:t,get children(){return h(fe.td,s)}})},dx=e=>{const t=ge(),n=cx(),r=Wt(),o=A(()=>{const a={day:t().getDayTableCellTriggerProps,month:t().getMonthTableCellTriggerProps,year:t().getYearTableCellTriggerProps}[r.view];return a(n)}),i=ce(o,e);return h(fe.div,i)},fx=e=>{const t=ge(),n=vo(),r=ce(()=>t().getTableHeadProps(n),e);return h(fe.thead,r)},gx=e=>{const t=ge(),n=vo(),r=ce(()=>t().getTableHeaderProps(n),e);return h(fe.th,r)},hx=e=>{const t=ge(),n=vo(),r=ce(()=>t().getTableRowProps(n),e);return h(fe.tr,r)},px=e=>{const t=ge(),n=ce(()=>t().getTriggerProps(),e);return h(fe.button,n)},mx=Ou.extendWith("view"),yx=e=>{const[t,n]=wn()(e,["view"]),r=ge(),o=ce(()=>mx.build().view.attrs,n);return h(Fw,{value:t,get children(){return h(fe.div,I(o,{get hidden(){return r().view!==t.view}}))}})},vx=e=>{const t=ge(),n=Wt(),r=ce(()=>t().getViewControlProps(n),e);return h(fe.div,r)},bx=e=>{const t=ge(),n=Wt(),r=ce(()=>t().getViewTriggerProps(n),e);return h(fe.button,r)};var wx=B('<svg xmlns=http://www.w3.org/2000/svg class="h-4 w-4"viewBox="0 0 24 24"><path fill=none stroke=currentColor stroke-linecap=round stroke-linejoin=round stroke-width=2 d="m15 6l-6 6l6 6"></path><title>Previous'),xx=B('<svg xmlns=http://www.w3.org/2000/svg class="h-4 w-4"viewBox="0 0 24 24"><path fill=none stroke=currentColor stroke-linecap=round stroke-linejoin=round stroke-width=2 d="m9 6l6 6l-6 6"></path><title>Next'),Sx=B('<svg xmlns=http://www.w3.org/2000/svg class="mx-1 h-5 w-5"viewBox="0 0 24 24"><path fill=none stroke=currentColor stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M4 7a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm12-4v4M8 3v4m-4 4h16m-9 4h1m0 0v3"></path><title>Calendar');const Ex=fx,as=ax,ls=Rw,Px=e=>h(ox,I({format:t=>{const n=new Date(Date.parse(t.toString())),r=new Date(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate());return new Intl.DateTimeFormat(e.locale||"pt-BR",{dateStyle:"long"}).format(r)}},e)),cs=e=>{const[t,n]=U(e,["class"]);return h(yx,I({get class(){return le("space-y-4",t.class)}},n))},us=e=>{const[t,n]=U(e,["class","children"]);return h(vx,I({get class(){return le("flex items-center justify-between",t.class)}},n,{get children(){return[h(Kw,{get class(){return le(Bn({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100")},get children(){return wx()}}),A(()=>t.children),h(_w,{get class(){return le(Bn({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100")},get children(){return xx()}})]}}))},ds=e=>{const[t,n]=U(e,["class"]);return h(zw,I({get class(){return le("text-sm font-medium",t.class)}},n))},fs=e=>{const[t,n]=U(e,["class"]);return h(sx,I({get class(){return le("w-full border-collapse space-y-1",t.class)}},n))},bo=e=>{const[t,n]=U(e,["class"]);return h(hx,I({get class(){return le("mt-2 flex w-full",t.class)}},n))},Cx=e=>{const[t,n]=U(e,["class"]);return h(gx,I({get class(){return le("w-8 flex-1 text-[0.8rem] font-normal text-muted-foreground",t.class)}},n))},gs=e=>{const[t,n]=U(e,["class"]);return h(ux,I({get class(){return le("flex-1 p-0 text-center text-sm","has-[[data-in-range]]:bg-accent has-[[data-in-range]]:first-of-type:rounded-l-md has-[[data-in-range]]:last-of-type:rounded-r-md","has-[[data-range-end]]:rounded-r-md has-[[data-range-start]]:rounded-l-md","has-[[data-outside-range][data-in-range]]:bg-accent/50",t.class)}},n))},hs=e=>{const[t,n]=U(e,["class"]);return h(dx,I({get class(){return le(Bn({variant:"ghost"}),"size-8 w-full p-0 font-normal data-[selected]:opacity-100","data-[today]:bg-accent data-[today]:text-accent-foreground","[&:is([data-today][data-selected])]:bg-primary [&:is([data-today][data-selected])]:text-primary-foreground","data-[selected]:bg-primary data-[selected]:text-primary-foreground data-[selected]:hover:bg-primary data-[selected]:hover:text-primary-foreground","data-[disabled]:text-muted-foreground data-[disabled]:opacity-50","data-[outside-range]:text-muted-foreground data-[outside-range]:opacity-50","[&:is([data-outside-range][data-in-range])]:bg-accent/50 [&:is([data-outside-range][data-in-range])]:text-muted-foreground [&:is([data-outside-range][data-in-range])]:opacity-30",t.class)}},n))},ps=e=>{const[t,n]=U(e,["class"]);return h(bx,I({get class(){return le(Bn({variant:"ghost"}),"h-7",t.class)}},n))},Ox=e=>{const[t,n]=U(e,["class","children"]);return h(Mo,{get mount(){return zn()},get children(){return h(Vw,{get children(){return h(Lw,I({get class(){return le("rounded-md border bg-popover p-3 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",t.class)}},n,{get children(){return t.children}}))}})}})},Dx=()=>h(Nw,{get children(){return h(px,{class:"transition-shadow focus-visible:outline-none focus-visible:ring-[1.5px] focus-visible:ring-ring",get children(){return h(Ce,{variant:"outline",get children(){return Sx()}})}})}});var kx=B('<div class="flex flex-col space-y-2"><div>');const Tx=({text:e})=>{const[t,n]=L(!1);return(()=>{var r=kx(),o=r.firstChild;return F(r,h(zt,{get children(){return e?.trim()}}),o),F(o,h(Px,{onValueChange:i=>console.log(i),get children(){return[h(Dx,{}),h(Ox,{get children(){return[h(cs,{view:"day",get children(){return h(ls,{children:i=>[h(us,{get children(){return h(ps,{get children(){return h(ds,{})}})}}),h(fs,{get children(){return[h(Ex,{get children(){return h(bo,{get children(){return h(_t,{get each(){return i().weekDays},children:s=>h(Cx,{get children(){return s().short}})})}})}}),h(as,{get children(){return h(_t,{get each(){return i().weeks},children:s=>h(bo,{get children(){return h(_t,{get each(){return s()},children:a=>h(gs,{get value(){return a()},get children(){return h(hs,{get children(){return a().day}})}})})}})})}})]}})]})}}),h(cs,{view:"month",class:"w-[calc(var(--reference-width)-(0.75rem*2))]",get children(){return h(ls,{children:i=>[h(us,{get children(){return h(ps,{get children(){return h(ds,{})}})}}),h(fs,{get children(){return h(as,{get children(){return h(_t,{get each(){return i().getMonthsGrid({columns:4,format:"short"})},children:s=>h(bo,{get children(){return h(_t,{get each(){return s()},children:a=>h(gs,{get value(){return a().value},get children(){return h(hs,{get children(){return a().label}})}})})}})})}})}})]})}}),h(cs,{view:"year",class:"w-[calc(var(--reference-width)-(0.75rem*2))]",get children(){return h(ls,{children:i=>[h(us,{get children(){return h(ps,{get children(){return h(ds,{})}})}}),h(fs,{get children(){return h(as,{get children(){return h(_t,{get each(){return i().getYearsGrid({columns:4})},children:s=>h(bo,{get children(){return h(_t,{get each(){return s()},children:a=>h(gs,{get value(){return a().value},get children(){return h(hs,{get children(){return a().label}})}})})}})})}})}})]})}})]}})]}})),ue(()=>xt(o,`datepicker-anchor flex items-center justify-center max-w-64 mx-[-1rem] ${t()&&"opacity-50"}`)),r})()};var $x=B("<div>Unknown bot message type");const Ax=e=>h(lm,{get createdAt(){return e.createdAt},get children(){return e.type==="text"?h(ec,{get text(){return e.text}}):e.type==="buttons"?h(dm,I(()=>e.buttons)):e.type==="list"?h(Vy,I(()=>e.list)):e.type==="media"?h(Ql,I(()=>e.media)):e.type==="link"?h(mm,I(()=>e.link)):e.type==="cards"?h(hm,I(()=>e.cards)):e.type==="date"?h(Tx,{get text(){return e.text}}):$x()}});var Mx=B('<div class="place-self-center p-4"><span class="bg-slate-200/40 text-black font-semibold py-2 px-4 rounded-xl">');const Ix=e=>(()=>{var t=Mx(),n=t.firstChild;return F(n,()=>e.text?.trim()),t})();var Lx=B('<div class="place-self-end py-1 flex flex-col"><div class="bg-primary shadow-primary/40 shadow-md py-2 px-4 rounded-l-xl rounded-tr-xl text-primary-foreground">');const Rx=({children:e,createdAt:t})=>(()=>{var n=Lx(),r=n.firstChild;return F(r,e),F(n,h(Vl,{createdAt:t,anchor:"end"}),null),n})();var Nx=B("<div>Unknown user message type");const Fx=e=>h(Rx,{get createdAt(){return e.createdAt},get children(){return e.type==="text"?h(ec,{get text(){return e.text}}):e.type==="media"?h(Ql,I(()=>e.media)):Nx()}});var _x=B("<div>Unknown message origin");const Vx=e=>e.origin==="bot"?h(Ax,e):e.origin==="user"?h(Fx,e):e.origin==="service"?h(Ix,e):_x();function Kx(e){return me({a:{viewBox:"0 0 512 512"},c:'<path d="m289.94 256 95-95A24 24 0 0 0 351 127l-95 95-95-95a24 24 0 0 0-34 34l95 95-95 95a24 24 0 1 0 34 34l95-95 95 95a24 24 0 0 0 34-34Z"/>'},e)}function In(e){return me({a:{viewBox:"0 0 512 512"},c:'<path d="M256 464c-114.69 0-208-93.31-208-208S141.31 48 256 48s208 93.31 208 208-93.31 208-208 208Z"/>'},e)}var zx=B('<div class="place-self-start py-1"><div class="animate-pulse bg-white flex space-x-1 shadow-md py-2 px-4 rounded-r-xl rounded-tl-xl text-slate-400">');const Bx=()=>(()=>{var e=zx(),t=e.firstChild;return F(t,h(In,{class:"size-2 animate-bounce"}),null),F(t,h(In,{class:"size-2 animate-bounce delay-150"}),null),F(t,h(In,{class:"size-2 animate-bounce delay-300"}),null),e})();var jx=B('<main class="flex-grow p-4 overflow-y-auto flex flex-col items-center scroll-smooth relative">'),Ux=B("<div>No messages yet...");const ms=()=>{let e;const{getMessages:t,onMessage:n,typing:r}=Tt(),{onOpen:o}=js(),i=(s=100)=>{setTimeout(()=>{e?.scrollTo(0,e.scrollHeight)},s)};return Ft(()=>{i(200)}),n(i),o(()=>i(200)),(()=>{var s=jx(),a=e;return typeof a=="function"?Rs(a,s):e=s,F(s,h(Zt,{get each(){return t()},get fallback(){return Ux()},children:l=>h(Vx,l)}),null),F(s,h(ie,{get when(){return r()},get children(){return h(Bx,{})}}),null),s})()};var Wx=B("<textarea>");const Hx=e=>{const[,t]=U(e,["class"]);return(()=>{var n=Wx();return Xt(n,I({get class(){return le("flex w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e.class)}},t),!1,!1),n})()};var Yx=B('<footer class="flex-none p-4 bg-white min-h-16 flex space-x-1">');const ys=()=>{const{pushMessage:e}=Tt(),[t,n]=L(""),r=()=>{e(t()),n("")},o=i=>{i.key==="Enter"&&!i.shiftKey&&r()};return(()=>{var i=Yx();return F(i,h(Hx,{placeholder:"Type your message here...",get value(){return t()},onInput:s=>n(s.currentTarget.value),onkeyup:o,class:"focus-visible:ring-primary h-10",style:"resize: none;",autofocus:!0}),null),F(i,h(Ce,{variant:"outline",class:"p-2","aria-label":"Send",type:"button",onClick:r,get children(){return h(Rf,{size:24})}}),null),i})()};var Gx=B('<div id=smarttalks-widget class="rounded-md shadow-xl h-[85vh] w-[98%] md:h-[min(100vh,500px)] md:w-[min(100vw,400px)] overflow-hidden bg-background text-foreground flex flex-col relative">'),qx=B("<span class=sr-only>Close"),Zx=B("<div>"),Xx=B("<span class=sr-only>Open"),Jx=B("<span>"),Qx=B('<div class="animate-pulse flex p-1">');const e1=({children:e,openIcon:t})=>{const{bubble:n,toggle:r,show:o}=js(),{chatWidget:i}=de(),[s,a]=L(!0);return setTimeout(()=>a(!1),2e3),i()?.openDelay&&setTimeout(()=>{o()},i()?.openDelay),(()=>{var l=Zx();return F(l,h(ie,{get when(){return n()},get children(){var c=Gx();return F(c,e),c}}),null),F(l,h(ie,{get when(){return n()},get fallback(){return h(Ce,{onclick:r,class:"rounded-full py-6 px-0 hover:shadow-primary shadow-md border border-primary transition-shadow duration-300","aria-label":"Open",type:"button",get children(){return[t,Xx(),h(ie,{get when(){return i()?.balloonMessage},get children(){var c=Jx();return F(c,h(ie,{get when(){return!s()},get fallback(){return(()=>{var u=Qx();return F(u,h(In,{class:"size-2 animate-bounce"}),null),F(u,h(In,{class:"size-2 animate-bounce delay-150"}),null),F(u,h(In,{class:"size-2 animate-bounce delay-300"}),null),u})()},get children(){return i()?.balloonMessage}})),ue(()=>xt(c,"absolute -top-2 bg-primary text-primary-foreground px-1 py-0.5 pointer-events-none rounded truncate"+(i()?.style.position==="left"?" left-9":" right-9"))),c}})]}})},get children(){return h(Ce,{onclick:r,class:"rounded-full py-6 px-2 hover:bg-primary hover:shadow-primary shadow-md transition-shadow duration-300","aria-label":"Close",type:"button",get children(){return[h(Kx,{size:30}),qx()]}})}}),null),ue(()=>xt(l,"max-h-full max-w-full md:max-h-[90%] md:max-w-[90%] fixed bottom-5 flex flex-col space-y-2"+(i()?.style.position==="left"?" left-5 items-start":" right-5 items-end"))),l})()};var t1=B('<div id=smarttalks-widget class="h-screen w-full overflow-hidden bg-background text-foreground flex flex-col rounded-md">');const n1=({children:e})=>{const{chatWidget:t}=de(),n={};return t()?.style.width&&(n.width=`min(100%, ${t()?.style.width}px)`),t()?.style.height&&(n.height=`min(100vh, ${t()?.style.height}px)`),(()=>{var r=t1();return Ls(r,n),F(r,e),r})()};var r1=B("<div id=smarttalks-widget>");const o1=({children:e})=>{const{chatWidget:t}=de();return(()=>{var n=r1();return F(n,e),ue(()=>xt(n,"h-[85vh] w-[90vw] md:h-[min(100vh,500px)] md:w-[min(100vw,400px)] max-h-full max-w-full md:max-h-[90%] md:max-w-[90%] fixed bottom-5 rounded-md shadow-xl overflow-hidden bg-background text-foreground flex flex-col"+(t()?.style.position==="left"?" left-5":" right-5"))),n})()};var i1=B('<div class="absolute bg-black/50 text-white font-bold h-full w-full grid place-content-center z-50">');const vs=()=>(()=>{var e=i1();return F(e,h(Lf,{size:45,class:"animate-spin"})),e})(),s1=()=>{const{chatWidget:e}=de(),{loading:t}=Tt();return Ft(async()=>{await new Promise(n=>setTimeout(n,1e4)),e()?.openDelay&&await new Promise(n=>setTimeout(n,e()?.openDelay))}),h(e1,{get openIcon(){return h(ua,{get src(){return e()?.avatar}})},get children(){return[h(ie,{get when(){return t()},get children(){return h(vs,{})}}),h(fi,{}),h(ms,{}),h(ys,{})]}})},a1=()=>{const{loading:e}=Tt();return h(o1,{get children(){return[h(ie,{get when(){return e()},get children(){return h(vs,{})}}),h(fi,{}),h(ms,{}),h(ys,{})]}})},l1=()=>{const{loading:e}=Tt();return h(n1,{get children(){return[h(ie,{get when(){return e()},get children(){return h(vs,{})}}),h(fi,{}),h(ms,{}),h(ys,{})]}})},c1=()=>{const{chatWidget:e}=de();console.log(e());const t=Xu(async()=>(e()?.openDelay&&await new Promise(n=>setTimeout(n,e()?.openDelay)),{default:a1}));return h(Ms,{get children(){return[h(Rn,{get when(){return e()?.mode==="standard"},get children(){return h(s1,{})}}),h(Rn,{get when(){return e()?.mode==="popup"},get children(){return h(t,{})}}),h(Rn,{get when(){return e()?.mode==="static"},get children(){return h(l1,{})}})]}})};var u1=B("<div><div>Form");const d1=()=>{const{formWidget:e}=de();return(()=>{var t=u1();return t.firstChild,F(t,()=>e()?._id,null),t})()};function f1(){const{widget:e}=de();return h(Ms,{get children(){return[h(Rn,{get when(){return e()?.type==="chat"},get children(){return h(c1,{})}}),h(Rn,{get when(){return e()?.type==="form"},get children(){return h(d1,{})}})]}})}var g1=B("<style>"),h1=B("<div>");const p1=({id:e,settings:t})=>{const{setWidgetId:n}=de(),r=(e||"default")+"?"+(t?"&showSettings":"");return n(r),[(()=>{var o=g1();return F(o,Pd),o})(),(()=>{var o=h1();return F(o,h(f1,{})),o})()]};(()=>{typeof window>"u"||Ed("smarttalks-widget",{id:"",settings:!1},p1)})()});