@hot-updater/console 0.20.11 → 0.20.13

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.
@@ -0,0 +1,27 @@
1
+ var vg=Object.defineProperty;var su=e=>{throw TypeError(e)};var yg=(e,t,n)=>t in e?vg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Re=(e,t,n)=>yg(e,typeof t!="symbol"?t+"":t,n),Vi=(e,t,n)=>t.has(e)||su("Cannot "+n);var E=(e,t,n)=>(Vi(e,t,"read from private field"),n?n.call(e):t.get(e)),re=(e,t,n)=>t.has(e)?su("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),X=(e,t,n,r)=>(Vi(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),ge=(e,t,n)=>(Vi(e,t,"access private method"),n);var Do=(e,t,n,r)=>({set _(o){X(e,t,o,n)},get _(){return E(e,t,r)}});(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();const ue={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return au(this.context.count)},getNextContextId(){return au(this.context.count++)}};function au(e){const t=String(e),n=t.length-1;return ue.context.id+(n?String.fromCharCode(96+n):"")+t}function Hr(e){ue.context=e}const wg=(e,t)=>e===t,vt=Symbol("solid-proxy"),pd=typeof Proxy=="function",ai=Symbol("solid-track"),li={equals:wg};let md=bd;const yt=1,to=2,vd={owned:null,cleanups:null,context:null,owner:null},Ni={};var pe=null;let Q=null,bg=null,be=null,je=null,Be=null,wi=0;function Kt(e,t){const n=be,r=pe,o=e.length===0,i=t===void 0?r:t,s=o?vd:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?e:()=>e(()=>Ae(()=>hn(s)));pe=s,be=null;try{return nt(a,!0)}finally{be=n,pe=r}}function z(e,t){t=t?Object.assign({},li,t):li;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(Q&&Q.running&&Q.sources.has(n)?o=o(n.tValue):o=o(n.value)),wd(n,o));return[yd.bind(n),r]}function pt(e,t,n){const r=Si(e,t,!0,yt);Cr(r)}function Ve(e,t,n){const r=Si(e,t,!1,yt);Cr(r)}function j(e,t,n){md=Pg;const r=Si(e,t,!1,yt),o=Dn&&xe(Dn);o&&(r.suspense=o),(!n||!n.render)&&(r.user=!0),Be?Be.push(r):Cr(r)}function L(e,t,n){n=n?Object.assign({},li,n):li;const r=Si(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,Cr(r),yd.bind(r)}function Sg(e){return e&&typeof e=="object"&&"then"in e}function xg(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={});let s=null,a=Ni,l=null,c=!1,u=!1,f="initialValue"in i,d=typeof r=="function"&&L(r);const h=new Set,[p,g]=(i.storage||z)(i.initialValue),[v,m]=z(void 0),[y,b]=z(void 0,{equals:!1}),[S,C]=z(f?"ready":"unresolved");ue.context&&(l=ue.getNextContextId(),i.ssrLoadFrom==="initial"?a=i.initialValue:ue.load&&ue.has(l)&&(a=ue.load(l)));function R(k,N,B,ne){return s===k&&(s=null,ne!==void 0&&(f=!0),(k===a||N===a)&&i.onHydrated&&queueMicrotask(()=>i.onHydrated(ne,{value:N})),a=Ni,Q&&k&&c?(Q.promises.delete(k),c=!1,nt(()=>{Q.running=!0,D(N,B)},!1)):D(N,B)),N}function D(k,N){nt(()=>{N===void 0&&g(()=>k),C(N!==void 0?"errored":f?"ready":"unresolved"),m(N);for(const B of h.keys())B.decrement();h.clear()},!1)}function V(){const k=Dn&&xe(Dn),N=p(),B=v();if(B!==void 0&&!s)throw B;return be&&!be.user&&k&&pt(()=>{y(),s&&(k.resolved&&Q&&c?Q.promises.add(s):h.has(k)||(k.increment(),h.add(k)))}),N}function $(k=!0){if(k!==!1&&u)return;u=!1;const N=d?d():r;if(c=Q&&Q.running,N==null||N===!1){R(s,Ae(p));return}Q&&s&&Q.promises.delete(s);const B=a!==Ni?a:Ae(()=>o(N,{value:p(),refetching:k}));return Sg(B)?(s=B,"value"in B?(B.status==="success"?R(s,B.value,void 0,N):R(s,void 0,Rs(B.value),N),B):(u=!0,queueMicrotask(()=>u=!1),nt(()=>{C(f?"refreshing":"pending"),b()},!1),B.then(ne=>R(B,ne,void 0,N),ne=>R(B,void 0,Rs(ne),N)))):(R(s,B,void 0,N),B)}return Object.defineProperties(V,{state:{get:()=>S()},error:{get:()=>v()},loading:{get(){const k=S();return k==="pending"||k==="refreshing"}},latest:{get(){if(!f)return V();const k=v();if(k&&!s)throw k;return p()}}}),d?pt(()=>$(!1)):$(!1),[V,{refetch:$,mutate:g}]}function bi(e){return nt(e,!1)}function Ae(e){if(be===null)return e();const t=be;be=null;try{return e()}finally{be=t}}function Ee(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)return i=!1,s;const l=Ae(()=>t(a,o,s));return o=a,l}}function Sr(e){j(()=>Ae(e))}function Y(e){return pe===null||(pe.cleanups===null?pe.cleanups=[e]:pe.cleanups.push(e)),e}function Ps(){return be}function no(){return pe}function Sa(e,t){const n=pe,r=be;pe=e,be=null;try{return nt(t,!0)}catch(o){xa(o)}finally{pe=n,be=r}}function Cg(e){if(Q&&Q.running)return e(),Q.done;const t=be,n=pe;return Promise.resolve().then(()=>{be=t,pe=n;let r;return Dn&&(r=Q||(Q={sources:new Set,effects:[],promises:new Set,disposed:new Set,queue:new Set,running:!0}),r.done||(r.done=new Promise(o=>r.resolve=o)),r.running=!0),nt(e,!1),be=pe=null,r?r.done:void 0})}const[DC,lu]=z(!1);function Eg(e){Be.push.apply(Be,e),e.length=0}function Ce(e,t){const n=Symbol("context");return{id:n,Provider:Rg(n),defaultValue:e}}function xe(e){let t;return pe&&pe.context&&(t=pe.context[e.id])!==void 0?t:e.defaultValue}function xr(e){const t=L(e),n=L(()=>Os(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}let Dn;function Mg(){return Dn||(Dn=Ce())}function yd(){const e=Q&&Q.running;if(this.sources&&(e?this.tState:this.state))if((e?this.tState:this.state)===yt)Cr(this);else{const t=je;je=null,nt(()=>ci(this),!1),je=t}if(be){const t=this.observers?this.observers.length:0;be.sources?(be.sources.push(this),be.sourceSlots.push(t)):(be.sources=[this],be.sourceSlots=[t]),this.observers?(this.observers.push(be),this.observerSlots.push(be.sources.length-1)):(this.observers=[be],this.observerSlots=[be.sources.length-1])}return e&&Q.sources.has(this)?this.tValue:this.value}function wd(e,t,n){let r=Q&&Q.running&&Q.sources.has(e)?e.tValue:e.value;if(!e.comparator||!e.comparator(r,t)){if(Q){const o=Q.running;(o||!n&&Q.sources.has(e))&&(Q.sources.add(e),e.tValue=t),o||(e.value=t)}else 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=Q&&Q.running;s&&Q.disposed.has(i)||((s?!i.tState:!i.state)&&(i.pure?je.push(i):Be.push(i),i.observers&&Sd(i)),s?i.tState=yt:i.state=yt)}if(je.length>1e6)throw je=[],new Error},!1)}return t}function Cr(e){if(!e.fn)return;hn(e);const t=wi;uu(e,Q&&Q.running&&Q.sources.has(e)?e.tValue:e.value,t),Q&&!Q.running&&Q.sources.has(e)&&queueMicrotask(()=>{nt(()=>{Q&&(Q.running=!0),be=pe=e,uu(e,e.tValue,t),be=pe=null},!1)})}function uu(e,t,n){let r;const o=pe,i=be;be=pe=e;try{r=e.fn(t)}catch(s){return e.pure&&(Q&&Q.running?(e.tState=yt,e.tOwned&&e.tOwned.forEach(hn),e.tOwned=void 0):(e.state=yt,e.owned&&e.owned.forEach(hn),e.owned=null)),e.updatedAt=n+1,xa(s)}finally{be=i,pe=o}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?wd(e,r,!0):Q&&Q.running&&e.pure?(Q.sources.add(e),e.tValue=r):e.value=r,e.updatedAt=n)}function Si(e,t,n,r=yt,o){const i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:pe,context:pe?pe.context:null,pure:n};return Q&&Q.running&&(i.state=0,i.tState=r),pe===null||pe!==vd&&(Q&&Q.running&&pe.pure?pe.tOwned?pe.tOwned.push(i):pe.tOwned=[i]:pe.owned?pe.owned.push(i):pe.owned=[i]),i}function ui(e){const t=Q&&Q.running;if((t?e.tState:e.state)===0)return;if((t?e.tState:e.state)===to)return ci(e);if(e.suspense&&Ae(e.suspense.inFallback))return e.suspense.effects.push(e);const n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<wi);){if(t&&Q.disposed.has(e))return;(t?e.tState:e.state)&&n.push(e)}for(let r=n.length-1;r>=0;r--){if(e=n[r],t){let o=e,i=n[r+1];for(;(o=o.owner)&&o!==i;)if(Q.disposed.has(o))return}if((t?e.tState:e.state)===yt)Cr(e);else if((t?e.tState:e.state)===to){const o=je;je=null,nt(()=>ci(e,n[0]),!1),je=o}}}function nt(e,t){if(je)return e();let n=!1;t||(je=[]),Be?n=!0:Be=[],wi++;try{const r=e();return Ig(n),r}catch(r){n||(Be=null),je=null,xa(r)}}function Ig(e){if(je&&(bd(je),je=null),e)return;let t;if(Q){if(!Q.promises.size&&!Q.queue.size){const r=Q.sources,o=Q.disposed;Be.push.apply(Be,Q.effects),t=Q.resolve;for(const i of Be)"tState"in i&&(i.state=i.tState),delete i.tState;Q=null,nt(()=>{for(const i of o)hn(i);for(const i of r){if(i.value=i.tValue,i.owned)for(let s=0,a=i.owned.length;s<a;s++)hn(i.owned[s]);i.tOwned&&(i.owned=i.tOwned),delete i.tValue,delete i.tOwned,i.tState=0}lu(!1)},!1)}else if(Q.running){Q.running=!1,Q.effects.push.apply(Q.effects,Be),Be=null,lu(!0);return}}const n=Be;Be=null,n.length&&nt(()=>md(n),!1),t&&t()}function bd(e){for(let t=0;t<e.length;t++)ui(e[t])}function Pg(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:ui(r)}if(ue.context){if(ue.count){ue.effects||(ue.effects=[]),ue.effects.push(...e.slice(0,n));return}Hr()}for(ue.effects&&(ue.done||!ue.count)&&(e=[...ue.effects,...e],n+=ue.effects.length,delete ue.effects),t=0;t<n;t++)ui(e[t])}function ci(e,t){const n=Q&&Q.running;n?e.tState=0:e.state=0;for(let r=0;r<e.sources.length;r+=1){const o=e.sources[r];if(o.sources){const i=n?o.tState:o.state;i===yt?o!==t&&(!o.updatedAt||o.updatedAt<wi)&&ui(o):i===to&&ci(o,t)}}}function Sd(e){const t=Q&&Q.running;for(let n=0;n<e.observers.length;n+=1){const r=e.observers[n];(t?!r.tState:!r.state)&&(t?r.tState=to:r.state=to,r.pure?je.push(r):Be.push(r),r.observers&&Sd(r))}}function hn(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.tOwned){for(t=e.tOwned.length-1;t>=0;t--)hn(e.tOwned[t]);delete e.tOwned}if(Q&&Q.running&&e.pure)xd(e,!0);else if(e.owned){for(t=e.owned.length-1;t>=0;t--)hn(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}Q&&Q.running?e.tState=0:e.state=0}function xd(e,t){if(t||(e.tState=0,Q.disposed.add(e)),e.owned)for(let n=0;n<e.owned.length;n++)xd(e.owned[n])}function Rs(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function xa(e,t=pe){throw Rs(e)}function Os(e){if(typeof e=="function"&&!e.length)return Os(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=Os(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function Rg(e,t){return function(r){let o;return Ve(()=>o=Ae(()=>(pe.context={...pe.context,[e]:r.value},xr(()=>r.children))),void 0),o}}const Og=Symbol("fallback");function cu(e){for(let t=0;t<e.length;t++)e[t]()}function Fg(e,t,n={}){let r=[],o=[],i=[],s=0,a=t.length>1?[]:null;return Y(()=>cu(i)),()=>{let l=e()||[],c=l.length,u,f;return l[ai],Ae(()=>{let h,p,g,v,m,y,b,S,C;if(c===0)s!==0&&(cu(i),i=[],r=[],o=[],s=0,a&&(a=[])),n.fallback&&(r=[Og],o[0]=Kt(R=>(i[0]=R,n.fallback())),s=1);else if(s===0){for(o=new Array(c),f=0;f<c;f++)r[f]=l[f],o[f]=Kt(d);s=c}else{for(g=new Array(c),v=new Array(c),a&&(m=new Array(c)),y=0,b=Math.min(s,c);y<b&&r[y]===l[y];y++);for(b=s-1,S=c-1;b>=y&&S>=y&&r[b]===l[S];b--,S--)g[S]=o[b],v[S]=i[b],a&&(m[S]=a[b]);for(h=new Map,p=new Array(S+1),f=S;f>=y;f--)C=l[f],u=h.get(C),p[f]=u===void 0?-1:u,h.set(C,f);for(u=y;u<=b;u++)C=r[u],f=h.get(C),f!==void 0&&f!==-1?(g[f]=o[u],v[f]=i[u],a&&(m[f]=a[u]),f=p[f],h.set(C,f)):i[u]();for(f=y;f<c;f++)f in g?(o[f]=g[f],i[f]=v[f],a&&(a[f]=m[f],a[f](f))):o[f]=Kt(d);o=o.slice(0,s=c),r=l.slice(0)}return o});function d(h){if(i[f]=h,a){const[p,g]=z(f);return a[f]=g,t(l[f],p)}return t(l[f])}}}function w(e,t){return Ae(()=>e(t||{}))}function Lo(){return!0}const Fs={get(e,t,n){return t===vt?n:e.get(t)},has(e,t){return t===vt?!0:e.has(t)},set:Lo,deleteProperty:Lo,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:Lo,deleteProperty:Lo}},ownKeys(e){return e.keys()}};function Ki(e){return(e=typeof e=="function"?e():e)?e:{}}function $g(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function F(...e){let t=!1;for(let s=0;s<e.length;s++){const a=e[s];t=t||!!a&&vt in a,e[s]=typeof a=="function"?(t=!0,L(a)):a}if(pd&&t)return new Proxy({get(s){for(let a=e.length-1;a>=0;a--){const l=Ki(e[a])[s];if(l!==void 0)return l}},has(s){for(let a=e.length-1;a>=0;a--)if(s in Ki(e[a]))return!0;return!1},keys(){const s=[];for(let a=0;a<e.length;a++)s.push(...Object.keys(Ki(e[a])));return[...new Set(s)]}},Fs);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 f=Object.getOwnPropertyDescriptor(a,u);if(!r[u])r[u]=f.get?{enumerable:!0,configurable:!0,get:$g.bind(n[u]=[f.get.bind(a)])}:f.value!==void 0?f:void 0;else{const d=n[u];d&&(f.get?d.push(f.get.bind(a)):f.value!==void 0&&d.push(()=>f.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 _(e,...t){if(pd&&vt 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)}},Fs));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))}},Fs)),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]}let Ag=0;function Ie(){return ue.context?ue.getNextContextId():`cl-${Ag++}`}const Cd=e=>`Stale read from <${e}>.`;function et(e){const t="fallback"in e&&{fallback:()=>e.fallback};return L(Fg(()=>e.each,e.children,t||void 0))}function de(e){const t=e.keyed,n=L(()=>e.when,void 0,{equals:(r,o)=>t?r===o:!r==!o});return L(()=>{const r=n();if(r){const o=e.children;return typeof o=="function"&&o.length>0?Ae(()=>o(t?r:()=>{if(!Ae(n))throw Cd("Show");return e.when})):o}return e.fallback},void 0,void 0)}function Tg(e){let t=!1;const n=(i,s)=>(t?i[1]===s[1]:!i[1]==!s[1])&&i[2]===s[2],r=xr(()=>e.children),o=L(()=>{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 L(()=>{const[i,s,a]=o();if(i<0)return e.fallback;const l=a.children;return typeof l=="function"&&l.length>0?Ae(()=>l(t?s:()=>{if(Ae(o)[0]!==i)throw Cd("Match");return a.when})):l},void 0,void 0)}function du(e){return e}const Dg=Ce();function Lg(e){let t=0,n,r,o,i,s;const[a,l]=z(!1),c=Mg(),u={increment:()=>{++t===1&&l(!0)},decrement:()=>{--t===0&&l(!1)},inFallback:a,effects:[],resolved:!1},f=no();if(ue.context&&ue.load){const p=ue.getContextId();let g=ue.load(p);if(g&&(typeof g!="object"||g.status!=="success"?o=g:ue.gather(p)),o&&o!=="$$f"){const[v,m]=z(void 0,{equals:!1});i=v,o.then(()=>{if(ue.done)return m();ue.gather(p),Hr(r),m(),Hr()},y=>{s=y,m()})}}const d=xe(Dg);d&&(n=d.register(u.inFallback));let h;return Y(()=>h&&h()),w(c.Provider,{value:u,get children(){return L(()=>{if(s)throw s;if(r=ue.context,i)return i(),i=void 0;r&&o==="$$f"&&Hr();const p=L(()=>e.children);return L(g=>{const v=u.inFallback(),{showContent:m=!0,showFallback:y=!0}=n?n():{};if((!v||o&&o!=="$$f")&&m)return u.resolved=!0,h&&h(),h=r=o=void 0,Eg(u.effects),p();if(y)return h?g:Kt(b=>(h=b,r&&(Hr({id:r.id+"F",count:0}),r=void 0),e.fallback),f)})})}})}const _g=["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"],kg=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",..._g]),Vg=new Set(["innerHTML","textContent","innerText","children"]),Ng=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),Kg=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 zg(e,t){const n=Kg[e];return typeof n=="object"?n[t]?n.$:void 0:n}const Bg=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),jg=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","feDropShadow","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"]),Ug={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function Hg(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 f=a;for(;f<i;)c.set(n[f],f++)}const u=c.get(t[s]);if(u!=null)if(a<u&&u<i){let f=s,d=1,h;for(;++f<o&&f<i&&!((h=c.get(t[f]))==null||h!==u+d);)d++;if(d>u-a){const p=t[s];for(;a<u;)e.insertBefore(n[a++],p)}else e.replaceChild(n[a++],t[s++])}else s++;else t[s++].remove()}}}const fu="_$DX_DELEGATE";function Gg(e,t,n,r={}){let o;return Kt(i=>{o=i,t===document?e():W(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{o(),t.textContent=""}}function te(e,t,n){let r;const o=()=>{const s=document.createElement("template");return s.innerHTML=e,s.content.firstChild},i=()=>(r||(r=o())).cloneNode(!0);return i.cloneNode=i,i}function Ed(e,t=window.document){const n=t[fu]||(t[fu]=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,ep))}}function Ln(e,t,n){Bn(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function qg(e,t,n,r){Bn(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function Wg(e,t,n){Bn(e)||(n?e.setAttribute(t,""):e.removeAttribute(t))}function Md(e,t){Bn(e)||(t==null?e.removeAttribute("class"):e.className=t)}function Qg(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,typeof n!="function"&&n)}function Xg(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]||(hu(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||(hu(e,a,!0),n[a]=l)}return n}function Id(e,t,n){if(!t)return n?Ln(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 qe(e,t={},n,r){const o={};return r||Ve(()=>o.children=ro(e,t.children,o.children)),Ve(()=>typeof t.ref=="function"&&Pd(t.ref,e)),Ve(()=>Yg(e,t,n,!0,o,!0)),o}function Pd(e,t,n){return Ae(()=>e(t,n))}function W(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return ro(e,t,r,n);Ve(o=>ro(e,t(),o,n),r)}function Yg(e,t,n,r,o={},i=!1){t||(t={});for(const s in o)if(!(s in t)){if(s==="children")continue;o[s]=gu(e,s,null,o[s],n,i,t)}for(const s in t){if(s==="children")continue;const a=t[s];o[s]=gu(e,s,a,o[s],n,i,t)}}function Jg(e){let t,n;return!Bn()||!(t=ue.registry.get(n=tp()))?e():(ue.completed&&ue.completed.add(t),ue.registry.delete(n),t)}function Bn(e){return!!ue.context&&!ue.done&&(!e||e.isConnected)}function Zg(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function hu(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 gu(e,t,n,r,o,i,s){let a,l,c,u,f;if(t==="style")return Id(e,n,r);if(t==="classList")return Xg(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,typeof r!="function"&&r),n&&e.addEventListener(d,n,typeof n!="function"&&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(),h=Bg.has(d);if(!h&&r){const p=Array.isArray(r)?r[0]:r;e.removeEventListener(d,p)}(h||n)&&(Qg(e,d,n,h),h&&Ed([d]))}else if(t.slice(0,5)==="attr:")Ln(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")Wg(e,t.slice(5),n);else if((f=t.slice(0,5)==="prop:")||(c=Vg.has(t))||!o&&((u=zg(t,e.tagName))||(l=kg.has(t)))||(a=e.nodeName.includes("-")||"is"in s)){if(f)t=t.slice(5),l=!0;else if(Bn(e))return n;t==="class"||t==="className"?Md(e,n):a&&!l&&!c?e[Zg(t)]=n:e[u||t]=n}else{const d=o&&t.indexOf(":")>-1&&Ug[t.split(":")[0]];d?qg(e,d,t,n):Ln(e,Ng[t]||t,n)}return n}function ep(e){if(ue.registry&&ue.events&&ue.events.find(([l,c])=>c===e))return;let t=e.target;const n=`$$${e.type}`,r=e.target,o=e.currentTarget,i=l=>Object.defineProperty(e,"target",{configurable:!0,value:l}),s=()=>{const l=t[n];if(l&&!t.disabled){const c=t[`${n}Data`];if(c!==void 0?l.call(t,c,e):l.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&i(t.host),!0},a=()=>{for(;s()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),ue.registry&&!ue.done&&(ue.done=_$HY.done=!0),e.composedPath){const l=e.composedPath();i(l[0]);for(let c=0;c<l.length-2&&(t=l[c],!!s());c++){if(t._$host){t=t._$host,a();break}if(t.parentNode===o)break}}else a();i(r)}function ro(e,t,n,r,o){const i=Bn(e);if(i){!n&&(n=[...e.childNodes]);let l=[];for(let c=0;c<n.length;c++){const u=n[c];u.nodeType===8&&u.data.slice(0,2)==="!$"?u.remove():l.push(u)}n=l}for(;typeof n=="function";)n=n();if(t===n)return n;const s=typeof t,a=r!==void 0;if(e=a&&n[0]&&n[0].parentNode||e,s==="string"||s==="number"){if(i||s==="number"&&(t=t.toString(),t===n))return n;if(a){let l=n[0];l&&l.nodeType===3?l.data!==t&&(l.data=t):l=document.createTextNode(t),n=qn(e,n,r,l)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||s==="boolean"){if(i)return n;n=qn(e,n,r)}else{if(s==="function")return Ve(()=>{let l=t();for(;typeof l=="function";)l=l();n=ro(e,l,n,r)}),()=>n;if(Array.isArray(t)){const l=[],c=n&&Array.isArray(n);if($s(l,t,n,o))return Ve(()=>n=ro(e,l,n,r,!0)),()=>n;if(i){if(!l.length)return n;if(r===void 0)return n=[...e.childNodes];let u=l[0];if(u.parentNode!==e)return n;const f=[u];for(;(u=u.nextSibling)!==r;)f.push(u);return n=f}if(l.length===0){if(n=qn(e,n,r),a)return n}else c?n.length===0?pu(e,l,r):Hg(e,n,l):(n&&qn(e),pu(e,l));n=l}else if(t.nodeType){if(i&&t.parentNode)return n=a?[t]:t;if(Array.isArray(n)){if(a)return n=qn(e,n,r,t);qn(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function $s(e,t,n,r){let o=!1;for(let i=0,s=t.length;i<s;i++){let a=t[i],l=n&&n[e.length],c;if(!(a==null||a===!0||a===!1))if((c=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))o=$s(e,a,l)||o;else if(c==="function")if(r){for(;typeof a=="function";)a=a();o=$s(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 pu(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function qn(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 tp(){return ue.getNextContextId()}const Rd=!1,np="http://www.w3.org/2000/svg";function Od(e,t=!1){return t?document.createElementNS(np,e):document.createElement(e)}function mo(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,o=no();let i,s=!!ue.context;return j(()=>{s&&(no().user=s=!1),i||(i=Sa(o,()=>L(()=>e.children)));const a=r();if(a instanceof HTMLHeadElement){const[l,c]=z(!1),u=()=>c(!0);Kt(f=>W(a,()=>l()?f():i(),null)),Y(u)}else{const l=Od(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}),W(c,i),a.appendChild(l),e.ref&&e.ref(l),Y(()=>a.removeChild(l))}},void 0,{render:!s}),n}function Fd(e){const[t,n]=_(e,["component"]),r=L(()=>t.component);return L(()=>{const o=r();switch(typeof o){case"function":return Ae(()=>o(n));case"string":const i=jg.has(o),s=ue.context?Jg():Od(o,i);return qe(s,n,i),s}})}const $d=Ce(),rp=["title","meta"],mu=[],vu=["name","http-equiv","content","charset","media"].concat(["property"]),yu=(e,t)=>{const n=Object.fromEntries(Object.entries(e.props).filter(([r])=>t.includes(r)).sort());return(Object.hasOwn(n,"name")||Object.hasOwn(n,"property"))&&(n.name=n.name||n.property,delete n.property),e.tag+JSON.stringify(n)};function op(){if(!ue.context){const n=document.head.querySelectorAll("[data-sm]");Array.prototype.forEach.call(n,r=>r.parentNode.removeChild(r))}const e=new Map;function t(n){if(n.ref)return n.ref;let r=document.querySelector(`[data-sm="${n.id}"]`);return r?(r.tagName.toLowerCase()!==n.tag&&(r.parentNode&&r.parentNode.removeChild(r),r=document.createElement(n.tag)),r.removeAttribute("data-sm")):r=document.createElement(n.tag),r}return{addTag(n){if(rp.indexOf(n.tag)!==-1){const i=n.tag==="title"?mu:vu,s=yu(n,i);e.has(s)||e.set(s,[]);let a=e.get(s),l=a.length;a=[...a,n],e.set(s,a);let c=t(n);n.ref=c,qe(c,n.props);let u=null;for(var r=l-1;r>=0;r--)if(a[r]!=null){u=a[r];break}return c.parentNode!=document.head&&document.head.appendChild(c),u&&u.ref&&u.ref.parentNode&&document.head.removeChild(u.ref),l}let o=t(n);return n.ref=o,qe(o,n.props),o.parentNode!=document.head&&document.head.appendChild(o),-1},removeTag(n,r){const o=n.tag==="title"?mu:vu,i=yu(n,o);if(n.ref){const s=e.get(i);if(s){if(n.ref.parentNode){n.ref.parentNode.removeChild(n.ref);for(let a=r-1;a>=0;a--)s[a]!=null&&document.head.appendChild(s[a].ref)}s[r]=null,e.set(i,s)}else n.ref.parentNode&&n.ref.parentNode.removeChild(n.ref)}}}}const ip=e=>{const t=op();return w($d.Provider,{value:t,get children(){return e.children}})},sp=(e,t,n)=>(ap({tag:e,props:t,setting:n,id:Ie(),get name(){return t.name||t.property}}),null);function ap(e){const t=xe($d);if(!t)throw new Error("<MetaProvider /> should be in the tree");Ve(()=>{const n=t.addTag(e);Y(()=>t.removeTag(e,n))})}const lp=e=>sp("title",e,{escape:!0,close:!0});function Ad(){let e=new Set;function t(o){return e.add(o),()=>e.delete(o)}let n=!1;function r(o,i){if(n)return!(n=!1);const s={to:o,options:i,defaultPrevented:!1,preventDefault:()=>s.defaultPrevented=!0};for(const a of e)a.listener({...s,from:a.location,retry:l=>{l&&(n=!0),a.navigate(o,{...i,resolve:!1})}});return!s.defaultPrevented}return{subscribe:t,confirm:r}}let As;function Ca(){(!window.history.state||window.history.state._depth==null)&&window.history.replaceState({...window.history.state,_depth:window.history.length-1},""),As=window.history.state._depth}Ca();function up(e){return{...e,_depth:window.history.state&&window.history.state._depth}}function cp(e,t){let n=!1;return()=>{const r=As;Ca();const o=r==null?null:As-r;if(n){n=!1;return}o&&t(o)?(n=!0,window.history.go(-o)):e()}}const dp=/^(?:[a-z0-9]+:)?\/\//i,fp=/^\/+|(\/)\/+$/g,Td="http://sr";function Jr(e,t=!1){const n=e.replace(fp,"$1");return n?t||/^[?#]/.test(n)?n:"/"+n:""}function Zo(e,t,n){if(dp.test(t))return;const r=Jr(e),o=n&&Jr(n);let i="";return!o||t.startsWith("/")?i=r:o.toLowerCase().indexOf(r.toLowerCase())!==0?i=r+o:i=o,(i||"/")+Jr(t,!i)}function hp(e,t){if(e==null)throw new Error(t);return e}function gp(e,t){return Jr(e).replace(/\/*(\*.*)?$/g,"")+Jr(t)}function Dd(e){const t={};return e.searchParams.forEach((n,r)=>{r in t?Array.isArray(t[r])?t[r].push(n):t[r]=[t[r],n]:t[r]=n}),t}function pp(e,t,n){const[r,o]=e.split("/*",2),i=r.split("/").filter(Boolean),s=i.length;return a=>{const l=a.split("/").filter(Boolean),c=l.length-s;if(c<0||c>0&&o===void 0&&!t)return null;const u={path:s?"":"/",params:{}},f=d=>n===void 0?void 0:n[d];for(let d=0;d<s;d++){const h=i[d],p=h[0]===":",g=p?l[d]:l[d].toLowerCase(),v=p?h.slice(1):h.toLowerCase();if(p&&zi(g,f(v)))u.params[v]=g;else if(p||!zi(g,v))return null;u.path+=`/${g}`}if(o){const d=c?l.slice(-c).join("/"):"";if(zi(d,f(o)))u.params[o]=d;else return null}return u}}function zi(e,t){const n=r=>r===e;return t===void 0?!0:typeof t=="string"?n(t):typeof t=="function"?t(e):Array.isArray(t)?t.some(n):t instanceof RegExp?t.test(e):!1}function mp(e){const[t,n]=e.pattern.split("/*",2),r=t.split("/").filter(Boolean);return r.reduce((o,i)=>o+(i.startsWith(":")?2:3),r.length-(n===void 0?0:1))}function Ld(e){const t=new Map,n=no();return new Proxy({},{get(r,o){return t.has(o)||Sa(n,()=>t.set(o,L(()=>e()[o]))),t.get(o)()},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}},ownKeys(){return Reflect.ownKeys(e())}})}function vp(e,t){const n=new URLSearchParams(e);Object.entries(t).forEach(([o,i])=>{i==null||i===""||i instanceof Array&&!i.length?n.delete(o):i instanceof Array?(n.delete(o),i.forEach(s=>{n.append(o,String(s))})):n.set(o,String(i))});const r=n.toString();return r?`?${r}`:""}function _d(e){let t=/(\/?\:[^\/]+)\?/.exec(e);if(!t)return[e];let n=e.slice(0,t.index),r=e.slice(t.index+t[0].length);const o=[n,n+=t[1]];for(;t=/^(\/\:[^\/]+)\?/.exec(r);)o.push(n+=t[1]),r=r.slice(t[0].length);return _d(r).reduce((i,s)=>[...i,...o.map(a=>a+s)],[])}const yp=100,kd=Ce(),Vd=Ce(),Nd=()=>hp(xe(kd),"<A> and 'use' router primitives can be only used inside a Route."),wp=()=>Nd().navigatorFactory(),bp=()=>Nd().location,Kd=()=>{const e=bp(),t=wp(),n=(r,o)=>{const i=Ae(()=>vp(e.search,r)+e.hash);t(i,{scroll:!1,resolve:!1,...o})};return[e.query,n]};function Sp(e,t=""){const{component:n,preload:r,load:o,children:i,info:s}=e,a=!i||Array.isArray(i)&&!i.length,l={key:e,component:n,preload:r||o,info:s};return zd(e.path).reduce((c,u)=>{for(const f of _d(u)){const d=gp(t,f);let h=a?d:d.split("/*",1)[0];h=h.split("/").map(p=>p.startsWith(":")||p.startsWith("*")?p:encodeURIComponent(p)).join("/"),c.push({...l,originalPath:u,pattern:h,matcher:pp(h,!a,e.matchFilters)})}return c},[])}function xp(e,t=0){return{routes:e,score:mp(e[e.length-1])*1e4-t,matcher(n){const r=[];for(let o=e.length-1;o>=0;o--){const i=e[o],s=i.matcher(n);if(!s)return null;r.unshift({...s,route:i})}return r}}}function zd(e){return Array.isArray(e)?e:[e]}function Bd(e,t="",n=[],r=[]){const o=zd(e);for(let i=0,s=o.length;i<s;i++){const a=o[i];if(a&&typeof a=="object"){a.hasOwnProperty("path")||(a.path="");const l=Sp(a,t);for(const c of l){n.push(c);const u=Array.isArray(a.children)&&a.children.length===0;if(a.children&&!u)Bd(a.children,c.pattern,n,r);else{const f=xp([...n],r.length);r.push(f)}n.pop()}}}return n.length?r:r.sort((i,s)=>s.score-i.score)}function Bi(e,t){for(let n=0,r=e.length;n<r;n++){const o=e[n].matcher(t);if(o)return o}return[]}function Cp(e,t,n){const r=new URL(Td),o=L(u=>{const f=e();try{return new URL(f,r)}catch{return console.error(`Invalid path ${f}`),u}},r,{equals:(u,f)=>u.href===f.href}),i=L(()=>o().pathname),s=L(()=>o().search,!0),a=L(()=>o().hash),l=()=>"",c=Ee(s,()=>Dd(o()));return{get pathname(){return i()},get search(){return s()},get hash(){return a()},get state(){return t()},get key(){return l()},query:n?n(c):Ld(c)}}let Mn;function Ep(){return Mn}function Mp(e,t,n,r={}){const{signal:[o,i],utils:s={}}=e,a=s.parsePath||(I=>I),l=s.renderPath||(I=>I),c=s.beforeLeave||Ad(),u=Zo("",r.base||"");if(u===void 0)throw new Error(`${u} is not a valid base path`);u&&!o().value&&i({value:u,replace:!0,scroll:!1});const[f,d]=z(!1);let h;const p=(I,M)=>{M.value===g()&&M.state===m()||(h===void 0&&d(!0),Mn=I,h=M,Cg(()=>{h===M&&(v(h.value),y(h.state),C[1]([]))}).finally(()=>{h===M&&bi(()=>{Mn=void 0,I==="navigate"&&B(h),d(!1),h=void 0})}))},[g,v]=z(o().value),[m,y]=z(o().state),b=Cp(g,m,s.queryWrapper),S=[],C=z([]),R=L(()=>typeof r.transformUrl=="function"?Bi(t(),r.transformUrl(b.pathname)):Bi(t(),b.pathname)),D=()=>{const I=R(),M={};for(let x=0;x<I.length;x++)Object.assign(M,I[x].params);return M},V=s.paramsWrapper?s.paramsWrapper(D,t):Ld(D),$={pattern:u,path:()=>u,outlet:()=>null,resolvePath(I){return Zo(u,I)}};return Ve(Ee(o,I=>p("native",I),{defer:!0})),{base:$,location:b,params:V,isRouting:f,renderPath:l,parsePath:a,navigatorFactory:N,matches:R,beforeLeave:c,preloadRoute:ne,singleFlight:r.singleFlight===void 0?!0:r.singleFlight,submissions:C};function k(I,M,x){Ae(()=>{if(typeof M=="number"){M&&(s.go?s.go(M):console.warn("Router integration does not support relative routing"));return}const O=!M||M[0]==="?",{replace:P,resolve:A,scroll:K,state:H}={replace:!1,resolve:!O,scroll:!0,...x},q=A?I.resolvePath(M):Zo(O&&b.pathname||"",M);if(q===void 0)throw new Error(`Path '${M}' is not a routable path`);if(S.length>=yp)throw new Error("Too many redirects");const oe=g();(q!==oe||H!==m())&&(Rd||c.confirm(q,x)&&(S.push({value:oe,replace:P,scroll:K,state:m()}),p("navigate",{value:q,state:H})))})}function N(I){return I=I||xe(Vd)||$,(M,x)=>k(I,M,x)}function B(I){const M=S[0];M&&(i({...I,replace:M.replace,scroll:M.scroll}),S.length=0)}function ne(I,M){const x=Bi(t(),I.pathname),O=Mn;Mn="preload";for(let P in x){const{route:A,params:K}=x[P];A.component&&A.component.preload&&A.component.preload();const{preload:H}=A;M&&H&&Sa(n(),()=>H({params:K,location:{pathname:I.pathname,search:I.search,hash:I.hash,query:Dd(I),state:null,key:""},intent:"preload"}))}Mn=O}}function Ip(e,t,n,r){const{base:o,location:i,params:s}=e,{pattern:a,component:l,preload:c}=r().route,u=L(()=>r().path);l&&l.preload&&l.preload();const f=c?c({params:s,location:i,intent:Mn||"initial"}):void 0;return{parent:t,pattern:a,path:u,outlet:()=>l?w(l,{params:s,location:i,data:f,get children(){return n()}}):n(),resolvePath(h){return Zo(o.path(),h,u())}}}const Pp=e=>t=>{const{base:n}=t,r=xr(()=>t.children),o=L(()=>Bd(r(),t.base||""));let i;const s=Mp(e,o,()=>i,{base:n,singleFlight:t.singleFlight,transformUrl:t.transformUrl});return e.create&&e.create(s),w(kd.Provider,{value:s,get children(){return w(Rp,{routerState:s,get root(){return t.root},get preload(){return t.rootPreload||t.rootLoad},get children(){return[L(()=>(i=no())&&null),w(Op,{routerState:s,get branches(){return o()}})]}})}})};function Rp(e){const t=e.routerState.location,n=e.routerState.params,r=L(()=>e.preload&&Ae(()=>{e.preload({params:n,location:t,intent:Ep()||"initial"})}));return w(de,{get when(){return e.root},keyed:!0,get fallback(){return e.children},children:o=>w(o,{params:n,location:t,get data(){return r()},get children(){return e.children}})})}function Op(e){const t=[];let n;const r=L(Ee(e.routerState.matches,(o,i,s)=>{let a=i&&o.length===i.length;const l=[];for(let c=0,u=o.length;c<u;c++){const f=i&&i[c],d=o[c];s&&f&&d.route.key===f.route.key?l[c]=s[c]:(a=!1,t[c]&&t[c](),Kt(h=>{t[c]=h,l[c]=Ip(e.routerState,l[c-1]||e.routerState.base,wu(()=>r()[c+1]),()=>e.routerState.matches()[c])}))}return t.splice(o.length).forEach(c=>c()),s&&a?s:(n=l[0],l)}));return wu(()=>r()&&n)()}const wu=e=>()=>w(de,{get when(){return e()},keyed:!0,children:t=>w(Vd.Provider,{value:t,get children(){return t.outlet()}})}),Fp=e=>{const t=xr(()=>e.children);return F(e,{get children(){return t()}})};function $p([e,t],n,r){return[e,r?o=>t(r(o)):t]}function Ap(e){let t=!1;const n=o=>typeof o=="string"?{value:o}:o,r=$p(z(n(e.get()),{equals:(o,i)=>o.value===i.value&&o.state===i.state}),void 0,o=>(!t&&e.set(o),ue.registry&&!ue.done&&(ue.done=!0),o));return e.init&&Y(e.init((o=e.get())=>{t=!0,r[1](n(o)),t=!1})),Pp({signal:r,create:e.create,utils:e.utils})}function Tp(e,t,n){return e.addEventListener(t,n),()=>e.removeEventListener(t,n)}function Dp(e,t){const n=e&&document.getElementById(e);n?n.scrollIntoView():t&&window.scrollTo(0,0)}const Lp=new Map;function _p(e=!0,t=!1,n="/_server",r){return o=>{const i=o.base.path(),s=o.navigatorFactory(o.base);let a,l;function c(g){return g.namespaceURI==="http://www.w3.org/2000/svg"}function u(g){if(g.defaultPrevented||g.button!==0||g.metaKey||g.altKey||g.ctrlKey||g.shiftKey)return;const v=g.composedPath().find(R=>R instanceof Node&&R.nodeName.toUpperCase()==="A");if(!v||t&&!v.hasAttribute("link"))return;const m=c(v),y=m?v.href.baseVal:v.href;if((m?v.target.baseVal:v.target)||!y&&!v.hasAttribute("state"))return;const S=(v.getAttribute("rel")||"").split(/\s+/);if(v.hasAttribute("download")||S&&S.includes("external"))return;const C=m?new URL(y,document.baseURI):new URL(y);if(!(C.origin!==window.location.origin||i&&C.pathname&&!C.pathname.toLowerCase().startsWith(i.toLowerCase())))return[v,C]}function f(g){const v=u(g);if(!v)return;const[m,y]=v,b=o.parsePath(y.pathname+y.search+y.hash),S=m.getAttribute("state");g.preventDefault(),s(b,{resolve:!1,replace:m.hasAttribute("replace"),scroll:!m.hasAttribute("noscroll"),state:S?JSON.parse(S):void 0})}function d(g){const v=u(g);if(!v)return;const[m,y]=v;r&&(y.pathname=r(y.pathname)),o.preloadRoute(y,m.getAttribute("preload")!=="false")}function h(g){clearTimeout(a);const v=u(g);if(!v)return l=null;const[m,y]=v;l!==m&&(r&&(y.pathname=r(y.pathname)),a=setTimeout(()=>{o.preloadRoute(y,m.getAttribute("preload")!=="false"),l=m},20))}function p(g){if(g.defaultPrevented)return;let v=g.submitter&&g.submitter.hasAttribute("formaction")?g.submitter.getAttribute("formaction"):g.target.getAttribute("action");if(!v)return;if(!v.startsWith("https://action/")){const y=new URL(v,Td);if(v=o.parsePath(y.pathname+y.search),!v.startsWith(n))return}if(g.target.method.toUpperCase()!=="POST")throw new Error("Only POST forms are supported for Actions");const m=Lp.get(v);if(m){g.preventDefault();const y=new FormData(g.target,g.submitter);m.call({r:o,f:g.target},g.target.enctype==="multipart/form-data"?y:new URLSearchParams(y))}}Ed(["click","submit"]),document.addEventListener("click",f),e&&(document.addEventListener("mousemove",h,{passive:!0}),document.addEventListener("focusin",d,{passive:!0}),document.addEventListener("touchstart",d,{passive:!0})),document.addEventListener("submit",p),Y(()=>{document.removeEventListener("click",f),e&&(document.removeEventListener("mousemove",h),document.removeEventListener("focusin",d),document.removeEventListener("touchstart",d)),document.removeEventListener("submit",p)})}}function kp(e){const t=()=>{const r=window.location.pathname.replace(/^\/+/,"/")+window.location.search,o=window.history.state&&window.history.state._depth&&Object.keys(window.history.state).length===1?void 0:window.history.state;return{value:r+window.location.hash,state:o}},n=Ad();return Ap({get:t,set({value:r,replace:o,scroll:i,state:s}){o?window.history.replaceState(up(s),"",r):window.history.pushState(s,"",r),Dp(decodeURIComponent(window.location.hash.slice(1)),i),Ca()},init:r=>Tp(window,"popstate",cp(r,o=>{if(o&&o<0)return!n.confirm(o);{const i=t();return!n.confirm(i.value,{state:i.state})}})),create:_p(e.preload,e.explicitLinks,e.actionBase,e.transformUrl),utils:{go:r=>window.history.go(r),beforeLeave:n}})(e)}const Ts=Symbol("store-raw"),tr=Symbol("store-node"),kt=Symbol("store-has"),jd=Symbol("store-self");function Ud(e){let t=e[vt];if(!t&&(Object.defineProperty(e,vt,{value:t=new Proxy(e,Kp)}),!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 gn(e){let t;return e!=null&&typeof e=="object"&&(e[vt]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function _n(e,t=new Set){let n,r,o,i;if(n=e!=null&&e[Ts])return n;if(!gn(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=_n(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=_n(o,t))!==o&&(e[i]=r))}return e}function di(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function oo(e,t,n){if(e[t])return e[t];const[r,o]=z(n,{equals:!1,internal:!0});return r.$=o,e[t]=r}function Vp(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===vt||t===tr||(delete n.value,delete n.writable,n.get=()=>e[vt][t]),n}function Hd(e){Ps()&&oo(di(e,tr),jd)()}function Np(e){return Hd(e),Reflect.ownKeys(e)}const Kp={get(e,t,n){if(t===Ts)return e;if(t===vt)return n;if(t===ai)return Hd(e),n;const r=di(e,tr),o=r[t];let i=o?o():e[t];if(t===tr||t===kt||t==="__proto__")return i;if(!o){const s=Object.getOwnPropertyDescriptor(e,t);Ps()&&(typeof i!="function"||e.hasOwnProperty(t))&&!(s&&s.get)&&(i=oo(r,t,i)())}return gn(i)?Ud(i):i},has(e,t){return t===Ts||t===vt||t===ai||t===tr||t===kt||t==="__proto__"?!0:(Ps()&&oo(di(e,kt),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:Np,getOwnPropertyDescriptor:Vp};function ut(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[kt]&&e[kt][t]&&o!==void 0&&e[kt][t].$()):(e[t]=n,e[kt]&&e[kt][t]&&o===void 0&&e[kt][t].$());let s=di(e,tr),a;if((a=oo(s,t,o))&&a.$(()=>n),Array.isArray(e)&&e.length!==i){for(let l=e.length;l<i;l++)(a=s[l])&&a.$();(a=oo(s,"length",i))&&a.$(e.length)}(a=s[jd])&&a.$()}function Gd(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const o=n[r];ut(e,o,t[o])}}function zp(e,t){if(typeof t=="function"&&(t=t(e)),t=_n(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&&ut(e,n,o)}ut(e,"length",r)}else Gd(e,t)}function Gr(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++)Gr(e,[r[l]].concat(t),n);return}else if(a&&s==="function"){for(let l=0;l<e.length;l++)r(e[l],l)&&Gr(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 f=l;f<=c;f+=u)Gr(e,[f].concat(t),n);return}else if(t.length>1){Gr(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=_n(i),r===void 0||gn(o)&&gn(i)&&!Array.isArray(i)?Gd(o,i):ut(e,r,i))}function vo(...[e,t]){const n=_n(e||{}),r=Array.isArray(n),o=Ud(n);function i(...s){bi(()=>{r&&s.length===1?zp(n,s[0]):Gr(n,s)})}return[o,i]}const Ds=Symbol("store-root");function Yn(e,t,n,r,o){const i=t[n];if(e===i)return;const s=Array.isArray(e);if(n!==Ds&&(!gn(e)||!gn(i)||s!==Array.isArray(i)||o&&e[o]!==i[o])){ut(t,n,e);return}if(s){if(e.length&&i.length&&(!r||o&&e[0]&&e[0][o]!=null)){let c,u,f,d,h,p,g,v;for(f=0,d=Math.min(i.length,e.length);f<d&&(i[f]===e[f]||o&&i[f]&&e[f]&&i[f][o]===e[f][o]);f++)Yn(e[f],i,f,r,o);const m=new Array(e.length),y=new Map;for(d=i.length-1,h=e.length-1;d>=f&&h>=f&&(i[d]===e[h]||o&&i[f]&&e[f]&&i[d][o]===e[h][o]);d--,h--)m[h]=i[d];if(f>h||f>d){for(u=f;u<=h;u++)ut(i,u,e[u]);for(;u<e.length;u++)ut(i,u,m[u]),Yn(e[u],i,u,r,o);i.length>e.length&&ut(i,"length",e.length);return}for(g=new Array(h+1),u=h;u>=f;u--)p=e[u],v=o&&p?p[o]:p,c=y.get(v),g[u]=c===void 0?-1:c,y.set(v,u);for(c=f;c<=d;c++)p=i[c],v=o&&p?p[o]:p,u=y.get(v),u!==void 0&&u!==-1&&(m[u]=i[c],u=g[u],y.set(v,u));for(u=f;u<e.length;u++)u in m?(ut(i,u,m[u]),Yn(e[u],i,u,r,o)):ut(i,u,e[u])}else for(let c=0,u=e.length;c<u;c++)Yn(e[c],i,c,r,o);i.length>e.length&&ut(i,"length",e.length);return}const a=Object.keys(e);for(let c=0,u=a.length;c<u;c++)Yn(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&&ut(i,l[c],void 0)}function qd(e,t={}){const{merge:n,key:r="id"}=t,o=_n(e);return i=>{if(!gn(i)||!gn(o))return o;const s=Yn(o,{[Ds]:i},Ds,n,r);return s===void 0?i:s}}var Er=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},wr=typeof window>"u"||"Deno"in globalThis;function Ge(){}function Bp(e,t){return typeof e=="function"?e(t):e}function Ls(e){return typeof e=="number"&&e>=0&&e!==1/0}function Wd(e,t){return Math.max(e+(t||0)-Date.now(),0)}function dn(e,t){return typeof e=="function"?e(t):e}function gt(e,t){return typeof e=="function"?e(t):e}function bu(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==Ea(s,t.options))return!1}else if(!io(t.queryKey,s))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||i&&!i(t))}function Su(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(kn(t.options.mutationKey)!==kn(i))return!1}else if(!io(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Ea(e,t){return((t==null?void 0:t.queryKeyHashFn)||kn)(e)}function kn(e){return JSON.stringify(e,(t,n)=>_s(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function io(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>io(e[n],t[n])):!1}function Qd(e,t){if(e===t)return e;const n=xu(e)&&xu(t);if(n||_s(e)&&_s(t)){const r=n?e:Object.keys(e),o=r.length,i=n?t:Object.keys(t),s=i.length,a=n?[]:{},l=new Set(r);let c=0;for(let u=0;u<s;u++){const f=n?u:i[u];(!n&&l.has(f)||n)&&e[f]===void 0&&t[f]===void 0?(a[f]=void 0,c++):(a[f]=Qd(e[f],t[f]),a[f]===e[f]&&e[f]!==void 0&&c++)}return o===s&&c===o?e:a}return t}function fi(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function xu(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function _s(e){if(!Cu(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Cu(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Cu(e){return Object.prototype.toString.call(e)==="[object Object]"}function jp(e){return new Promise(t=>{setTimeout(t,e)})}function ks(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Qd(e,t):t}function Up(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Hp(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Ma=Symbol();function Xd(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Ma?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Yd(e,t){return typeof e=="function"?e(...t):!!e}var In,Jt,sr,id,Gp=(id=class extends Er{constructor(){super();re(this,In);re(this,Jt);re(this,sr);X(this,sr,t=>{if(!wr&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){E(this,Jt)||this.setEventListener(E(this,sr))}onUnsubscribe(){var t;this.hasListeners()||((t=E(this,Jt))==null||t.call(this),X(this,Jt,void 0))}setEventListener(t){var n;X(this,sr,t),(n=E(this,Jt))==null||n.call(this),X(this,Jt,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){E(this,In)!==t&&(X(this,In,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof E(this,In)=="boolean"?E(this,In):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},In=new WeakMap,Jt=new WeakMap,sr=new WeakMap,id),Ia=new Gp,ar,Zt,lr,sd,qp=(sd=class extends Er{constructor(){super();re(this,ar,!0);re(this,Zt);re(this,lr);X(this,lr,t=>{if(!wr&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){E(this,Zt)||this.setEventListener(E(this,lr))}onUnsubscribe(){var t;this.hasListeners()||((t=E(this,Zt))==null||t.call(this),X(this,Zt,void 0))}setEventListener(t){var n;X(this,lr,t),(n=E(this,Zt))==null||n.call(this),X(this,Zt,t(this.setOnline.bind(this)))}setOnline(t){E(this,ar)!==t&&(X(this,ar,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return E(this,ar)}},ar=new WeakMap,Zt=new WeakMap,lr=new WeakMap,sd),hi=new qp;function Vs(){let e,t;const n=new Promise((o,i)=>{e=o,t=i});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}function Wp(e){var n;let t;if((n=e.then(r=>(t=r,r),Ge))==null||n.catch(Ge),t!==void 0)return{data:t}}function Qp(e){return Math.min(1e3*2**e,3e4)}function Jd(e){return(e??"online")==="online"?hi.isOnline():!0}var Zd=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function ji(e){return e instanceof Zd}function ef(e){let t=!1,n=0,r=!1,o;const i=Vs(),s=g=>{var v;r||(d(new Zd(g)),(v=e.abort)==null||v.call(e))},a=()=>{t=!0},l=()=>{t=!1},c=()=>Ia.isFocused()&&(e.networkMode==="always"||hi.isOnline())&&e.canRun(),u=()=>Jd(e.networkMode)&&e.canRun(),f=g=>{var v;r||(r=!0,(v=e.onSuccess)==null||v.call(e,g),o==null||o(),i.resolve(g))},d=g=>{var v;r||(r=!0,(v=e.onError)==null||v.call(e,g),o==null||o(),i.reject(g))},h=()=>new Promise(g=>{var v;o=m=>{(r||c())&&g(m)},(v=e.onPause)==null||v.call(e)}).then(()=>{var g;o=void 0,r||(g=e.onContinue)==null||g.call(e)}),p=()=>{if(r)return;let g;const v=n===0?e.initialPromise:void 0;try{g=v??e.fn()}catch(m){g=Promise.reject(m)}Promise.resolve(g).then(f).catch(m=>{var R;if(r)return;const y=e.retry??(wr?0:3),b=e.retryDelay??Qp,S=typeof b=="function"?b(n,m):b,C=y===!0||typeof y=="number"&&n<y||typeof y=="function"&&y(n,m);if(t||!C){d(m);return}n++,(R=e.onFail)==null||R.call(e,n,m),jp(S).then(()=>c()?void 0:h()).then(()=>{t?d(m):p()})})};return{promise:i,cancel:s,continue:()=>(o==null||o(),i),cancelRetry:a,continueRetry:l,canStart:u,start:()=>(u()?p():h().then(p),i)}}var Xp=e=>setTimeout(e,0);function Yp(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=Xp;const i=a=>{t?e.push(a):o(()=>{n(a)})},s=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||s()}return l},batchCalls:a=>(...l)=>{i(()=>{a(...l)})},schedule:i,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var ke=Yp(),Pn,ad,tf=(ad=class{constructor(){re(this,Pn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ls(this.gcTime)&&X(this,Pn,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(wr?1/0:5*60*1e3))}clearGcTimeout(){E(this,Pn)&&(clearTimeout(E(this,Pn)),X(this,Pn,void 0))}},Pn=new WeakMap,ad),ur,cr,lt,Rn,Ke,fo,On,ft,Lt,ld,Jp=(ld=class extends tf{constructor(t){super();re(this,ft);re(this,ur);re(this,cr);re(this,lt);re(this,Rn);re(this,Ke);re(this,fo);re(this,On);X(this,On,!1),X(this,fo,t.defaultOptions),this.setOptions(t.options),this.observers=[],X(this,Rn,t.client),X(this,lt,E(this,Rn).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,X(this,ur,Zp(this.options)),this.state=t.state??E(this,ur),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=E(this,Ke))==null?void 0:t.promise}setOptions(t){this.options={...E(this,fo),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&E(this,lt).remove(this)}setData(t,n){const r=ks(this.state.data,t,this.options);return ge(this,ft,Lt).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){ge(this,ft,Lt).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=E(this,Ke))==null?void 0:r.promise;return(o=E(this,Ke))==null||o.cancel(t),n?n.then(Ge).catch(Ge):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(E(this,ur))}isActive(){return this.observers.some(t=>gt(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ma||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>dn(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Wd(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=E(this,Ke))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=E(this,Ke))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),E(this,lt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(E(this,Ke)&&(E(this,On)?E(this,Ke).cancel({revert:!0}):E(this,Ke).cancelRetry()),this.scheduleGc()),E(this,lt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ge(this,ft,Lt).call(this,{type:"invalidate"})}fetch(t,n){var c,u,f;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(E(this,Ke))return E(this,Ke).continueRetry(),E(this,Ke).promise}if(t&&this.setOptions(t),!this.options.queryFn){const d=this.observers.find(h=>h.options.queryFn);d&&this.setOptions(d.options)}const r=new AbortController,o=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(X(this,On,!0),r.signal)})},i=()=>{const d=Xd(this.options,n),p=(()=>{const g={client:E(this,Rn),queryKey:this.queryKey,meta:this.meta};return o(g),g})();return X(this,On,!1),this.options.persister?this.options.persister(d,p,this):d(p)},a=(()=>{const d={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:E(this,Rn),state:this.state,fetchFn:i};return o(d),d})();(c=this.options.behavior)==null||c.onFetch(a,this),X(this,cr,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=a.fetchOptions)==null?void 0:u.meta))&&ge(this,ft,Lt).call(this,{type:"fetch",meta:(f=a.fetchOptions)==null?void 0:f.meta});const l=d=>{var h,p,g,v;ji(d)&&d.silent||ge(this,ft,Lt).call(this,{type:"error",error:d}),ji(d)||((p=(h=E(this,lt).config).onError)==null||p.call(h,d,this),(v=(g=E(this,lt).config).onSettled)==null||v.call(g,this.state.data,d,this)),this.scheduleGc()};return X(this,Ke,ef({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:d=>{var h,p,g,v;if(d===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(d)}catch(m){l(m);return}(p=(h=E(this,lt).config).onSuccess)==null||p.call(h,d,this),(v=(g=E(this,lt).config).onSettled)==null||v.call(g,d,this.state.error,this),this.scheduleGc()},onError:l,onFail:(d,h)=>{ge(this,ft,Lt).call(this,{type:"failed",failureCount:d,error:h})},onPause:()=>{ge(this,ft,Lt).call(this,{type:"pause"})},onContinue:()=>{ge(this,ft,Lt).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),E(this,Ke).start()}},ur=new WeakMap,cr=new WeakMap,lt=new WeakMap,Rn=new WeakMap,Ke=new WeakMap,fo=new WeakMap,On=new WeakMap,ft=new WeakSet,Lt=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...nf(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return ji(o)&&o.revert&&E(this,cr)?{...E(this,cr),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),ke.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),E(this,lt).notify({query:this,type:"updated",action:t})})},ld);function nf(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Jd(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Zp(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Mt,ud,em=(ud=class extends Er{constructor(t={}){super();re(this,Mt);this.config=t,X(this,Mt,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??Ea(o,n);let s=this.get(i);return s||(s=new Jp({client:t,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){E(this,Mt).has(t.queryHash)||(E(this,Mt).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=E(this,Mt).get(t.queryHash);n&&(t.destroy(),n===t&&E(this,Mt).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){ke.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return E(this,Mt).get(t)}getAll(){return[...E(this,Mt).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>bu(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>bu(t,r)):n}notify(t){ke.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){ke.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){ke.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Mt=new WeakMap,ud),It,Ue,Fn,Pt,Xt,cd,tm=(cd=class extends tf{constructor(t){super();re(this,Pt);re(this,It);re(this,Ue);re(this,Fn);this.mutationId=t.mutationId,X(this,Ue,t.mutationCache),X(this,It,[]),this.state=t.state||rf(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){E(this,It).includes(t)||(E(this,It).push(t),this.clearGcTimeout(),E(this,Ue).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){X(this,It,E(this,It).filter(n=>n!==t)),this.scheduleGc(),E(this,Ue).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){E(this,It).length||(this.state.status==="pending"?this.scheduleGc():E(this,Ue).remove(this))}continue(){var t;return((t=E(this,Fn))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,s,a,l,c,u,f,d,h,p,g,v,m,y,b,S,C,R,D,V;const n=()=>{ge(this,Pt,Xt).call(this,{type:"continue"})};X(this,Fn,ef({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:($,k)=>{ge(this,Pt,Xt).call(this,{type:"failed",failureCount:$,error:k})},onPause:()=>{ge(this,Pt,Xt).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>E(this,Ue).canRun(this)}));const r=this.state.status==="pending",o=!E(this,Fn).canStart();try{if(r)n();else{ge(this,Pt,Xt).call(this,{type:"pending",variables:t,isPaused:o}),await((s=(i=E(this,Ue).config).onMutate)==null?void 0:s.call(i,t,this));const k=await((l=(a=this.options).onMutate)==null?void 0:l.call(a,t));k!==this.state.context&&ge(this,Pt,Xt).call(this,{type:"pending",context:k,variables:t,isPaused:o})}const $=await E(this,Fn).start();return await((u=(c=E(this,Ue).config).onSuccess)==null?void 0:u.call(c,$,t,this.state.context,this)),await((d=(f=this.options).onSuccess)==null?void 0:d.call(f,$,t,this.state.context)),await((p=(h=E(this,Ue).config).onSettled)==null?void 0:p.call(h,$,null,this.state.variables,this.state.context,this)),await((v=(g=this.options).onSettled)==null?void 0:v.call(g,$,null,t,this.state.context)),ge(this,Pt,Xt).call(this,{type:"success",data:$}),$}catch($){try{throw await((y=(m=E(this,Ue).config).onError)==null?void 0:y.call(m,$,t,this.state.context,this)),await((S=(b=this.options).onError)==null?void 0:S.call(b,$,t,this.state.context)),await((R=(C=E(this,Ue).config).onSettled)==null?void 0:R.call(C,void 0,$,this.state.variables,this.state.context,this)),await((V=(D=this.options).onSettled)==null?void 0:V.call(D,void 0,$,t,this.state.context)),$}finally{ge(this,Pt,Xt).call(this,{type:"error",error:$})}}finally{E(this,Ue).runNext(this)}}},It=new WeakMap,Ue=new WeakMap,Fn=new WeakMap,Pt=new WeakSet,Xt=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),ke.batch(()=>{E(this,It).forEach(r=>{r.onMutationUpdate(t)}),E(this,Ue).notify({mutation:this,type:"updated",action:t})})},cd);function rf(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Vt,ht,ho,dd,nm=(dd=class extends Er{constructor(t={}){super();re(this,Vt);re(this,ht);re(this,ho);this.config=t,X(this,Vt,new Set),X(this,ht,new Map),X(this,ho,0)}build(t,n,r){const o=new tm({mutationCache:this,mutationId:++Do(this,ho)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){E(this,Vt).add(t);const n=_o(t);if(typeof n=="string"){const r=E(this,ht).get(n);r?r.push(t):E(this,ht).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(E(this,Vt).delete(t)){const n=_o(t);if(typeof n=="string"){const r=E(this,ht).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&E(this,ht).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=_o(t);if(typeof n=="string"){const r=E(this,ht).get(n),o=r==null?void 0:r.find(i=>i.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=_o(t);if(typeof n=="string"){const o=(r=E(this,ht).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){ke.batch(()=>{E(this,Vt).forEach(t=>{this.notify({type:"removed",mutation:t})}),E(this,Vt).clear(),E(this,ht).clear()})}getAll(){return Array.from(E(this,Vt))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Su(n,r))}findAll(t={}){return this.getAll().filter(n=>Su(t,n))}notify(t){ke.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return ke.batch(()=>Promise.all(t.map(n=>n.continue().catch(Ge))))}},Vt=new WeakMap,ht=new WeakMap,ho=new WeakMap,dd);function _o(e){var t;return(t=e.options.scope)==null?void 0:t.id}function Eu(e){return{onFetch:(t,n)=>{var u,f,d,h,p;const r=t.options,o=(d=(f=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:f.fetchMore)==null?void 0:d.direction,i=((h=t.state.data)==null?void 0:h.pages)||[],s=((p=t.state.data)==null?void 0:p.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let g=!1;const v=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(t.signal.aborted?g=!0:t.signal.addEventListener("abort",()=>{g=!0}),t.signal)})},m=Xd(t.options,t.fetchOptions),y=async(b,S,C)=>{if(g)return Promise.reject();if(S==null&&b.pages.length)return Promise.resolve(b);const D=(()=>{const N={client:t.client,queryKey:t.queryKey,pageParam:S,direction:C?"backward":"forward",meta:t.options.meta};return v(N),N})(),V=await m(D),{maxPages:$}=t.options,k=C?Hp:Up;return{pages:k(b.pages,V,$),pageParams:k(b.pageParams,S,$)}};if(o&&i.length){const b=o==="backward",S=b?rm:Mu,C={pages:i,pageParams:s},R=S(r,C);a=await y(C,R,b)}else{const b=e??i.length;do{const S=l===0?s[0]??r.initialPageParam:Mu(r,a);if(l>0&&S==null)break;a=await y(a,S),l++}while(l<b)}return a};t.options.persister?t.fetchFn=()=>{var g,v;return(v=(g=t.options).persister)==null?void 0:v.call(g,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function Mu(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function rm(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Oe,en,tn,dr,fr,nn,hr,gr,fd,om=(fd=class{constructor(t={}){re(this,Oe);re(this,en);re(this,tn);re(this,dr);re(this,fr);re(this,nn);re(this,hr);re(this,gr);X(this,Oe,t.queryCache||new em),X(this,en,t.mutationCache||new nm),X(this,tn,t.defaultOptions||{}),X(this,dr,new Map),X(this,fr,new Map),X(this,nn,0)}mount(){Do(this,nn)._++,E(this,nn)===1&&(X(this,hr,Ia.subscribe(async t=>{t&&(await this.resumePausedMutations(),E(this,Oe).onFocus())})),X(this,gr,hi.subscribe(async t=>{t&&(await this.resumePausedMutations(),E(this,Oe).onOnline())})))}unmount(){var t,n;Do(this,nn)._--,E(this,nn)===0&&((t=E(this,hr))==null||t.call(this),X(this,hr,void 0),(n=E(this,gr))==null||n.call(this),X(this,gr,void 0))}isFetching(t){return E(this,Oe).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return E(this,en).findAll({...t,status:"pending"}).length}getQueryData(t){var r;const n=this.defaultQueryOptions({queryKey:t});return(r=E(this,Oe).get(n.queryHash))==null?void 0:r.state.data}ensureQueryData(t){const n=this.defaultQueryOptions(t),r=E(this,Oe).build(this,n),o=r.state.data;return o===void 0?this.fetchQuery(t):(t.revalidateIfStale&&r.isStaleByTime(dn(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(o))}getQueriesData(t){return E(this,Oe).findAll(t).map(({queryKey:n,state:r})=>{const o=r.data;return[n,o]})}setQueryData(t,n,r){const o=this.defaultQueryOptions({queryKey:t}),i=E(this,Oe).get(o.queryHash),s=i==null?void 0:i.state.data,a=Bp(n,s);if(a!==void 0)return E(this,Oe).build(this,o).setData(a,{...r,manual:!0})}setQueriesData(t,n,r){return ke.batch(()=>E(this,Oe).findAll(t).map(({queryKey:o})=>[o,this.setQueryData(o,n,r)]))}getQueryState(t){var r;const n=this.defaultQueryOptions({queryKey:t});return(r=E(this,Oe).get(n.queryHash))==null?void 0:r.state}removeQueries(t){const n=E(this,Oe);ke.batch(()=>{n.findAll(t).forEach(r=>{n.remove(r)})})}resetQueries(t,n){const r=E(this,Oe);return ke.batch(()=>(r.findAll(t).forEach(o=>{o.reset()}),this.refetchQueries({type:"active",...t},n)))}cancelQueries(t,n={}){const r={revert:!0,...n},o=ke.batch(()=>E(this,Oe).findAll(t).map(i=>i.cancel(r)));return Promise.all(o).then(Ge).catch(Ge)}invalidateQueries(t,n={}){return ke.batch(()=>(E(this,Oe).findAll(t).forEach(r=>{r.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},n)))}refetchQueries(t,n={}){const r={...n,cancelRefetch:n.cancelRefetch??!0},o=ke.batch(()=>E(this,Oe).findAll(t).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let s=i.fetch(void 0,r);return r.throwOnError||(s=s.catch(Ge)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(o).then(Ge)}fetchQuery(t){const n=this.defaultQueryOptions(t);n.retry===void 0&&(n.retry=!1);const r=E(this,Oe).build(this,n);return r.isStaleByTime(dn(n.staleTime,r))?r.fetch(n):Promise.resolve(r.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Ge).catch(Ge)}fetchInfiniteQuery(t){return t.behavior=Eu(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Ge).catch(Ge)}ensureInfiniteQueryData(t){return t.behavior=Eu(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return hi.isOnline()?E(this,en).resumePausedMutations():Promise.resolve()}getQueryCache(){return E(this,Oe)}getMutationCache(){return E(this,en)}getDefaultOptions(){return E(this,tn)}setDefaultOptions(t){X(this,tn,t)}setQueryDefaults(t,n){E(this,dr).set(kn(t),{queryKey:t,defaultOptions:n})}getQueryDefaults(t){const n=[...E(this,dr).values()],r={};return n.forEach(o=>{io(t,o.queryKey)&&Object.assign(r,o.defaultOptions)}),r}setMutationDefaults(t,n){E(this,fr).set(kn(t),{mutationKey:t,defaultOptions:n})}getMutationDefaults(t){const n=[...E(this,fr).values()],r={};return n.forEach(o=>{io(t,o.mutationKey)&&Object.assign(r,o.defaultOptions)}),r}defaultQueryOptions(t){if(t._defaulted)return t;const n={...E(this,tn).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return n.queryHash||(n.queryHash=Ea(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===Ma&&(n.enabled=!1),n}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...E(this,tn).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){E(this,Oe).clear(),E(this,en).clear()}},Oe=new WeakMap,en=new WeakMap,tn=new WeakMap,dr=new WeakMap,fr=new WeakMap,nn=new WeakMap,hr=new WeakMap,gr=new WeakMap,fd),Qe,ve,go,He,$n,pr,rn,on,po,mr,vr,An,Tn,sn,yr,Se,qr,Ns,Ks,zs,Bs,js,Us,Hs,of,hd,im=(hd=class extends Er{constructor(t,n){super();re(this,Se);re(this,Qe);re(this,ve);re(this,go);re(this,He);re(this,$n);re(this,pr);re(this,rn);re(this,on);re(this,po);re(this,mr);re(this,vr);re(this,An);re(this,Tn);re(this,sn);re(this,yr,new Set);this.options=n,X(this,Qe,t),X(this,on,null),X(this,rn,Vs()),this.options.experimental_prefetchInRender||E(this,rn).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(E(this,ve).addObserver(this),Iu(E(this,ve),this.options)?ge(this,Se,qr).call(this):this.updateResult(),ge(this,Se,Bs).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Gs(E(this,ve),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Gs(E(this,ve),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ge(this,Se,js).call(this),ge(this,Se,Us).call(this),E(this,ve).removeObserver(this)}setOptions(t){const n=this.options,r=E(this,ve);if(this.options=E(this,Qe).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof gt(this.options.enabled,E(this,ve))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ge(this,Se,Hs).call(this),E(this,ve).setOptions(this.options),n._defaulted&&!fi(this.options,n)&&E(this,Qe).getQueryCache().notify({type:"observerOptionsUpdated",query:E(this,ve),observer:this});const o=this.hasListeners();o&&Pu(E(this,ve),r,this.options,n)&&ge(this,Se,qr).call(this),this.updateResult(),o&&(E(this,ve)!==r||gt(this.options.enabled,E(this,ve))!==gt(n.enabled,E(this,ve))||dn(this.options.staleTime,E(this,ve))!==dn(n.staleTime,E(this,ve)))&&ge(this,Se,Ns).call(this);const i=ge(this,Se,Ks).call(this);o&&(E(this,ve)!==r||gt(this.options.enabled,E(this,ve))!==gt(n.enabled,E(this,ve))||i!==E(this,sn))&&ge(this,Se,zs).call(this,i)}getOptimisticResult(t){const n=E(this,Qe).getQueryCache().build(E(this,Qe),t),r=this.createResult(n,t);return am(this,r)&&(X(this,He,r),X(this,pr,this.options),X(this,$n,E(this,ve).state)),r}getCurrentResult(){return E(this,He)}trackResult(t,n){return new Proxy(t,{get:(r,o)=>(this.trackProp(o),n==null||n(o),Reflect.get(r,o))})}trackProp(t){E(this,yr).add(t)}getCurrentQuery(){return E(this,ve)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=E(this,Qe).defaultQueryOptions(t),r=E(this,Qe).getQueryCache().build(E(this,Qe),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return ge(this,Se,qr).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),E(this,He)))}createResult(t,n){var $;const r=E(this,ve),o=this.options,i=E(this,He),s=E(this,$n),a=E(this,pr),c=t!==r?t.state:E(this,go),{state:u}=t;let f={...u},d=!1,h;if(n._optimisticResults){const k=this.hasListeners(),N=!k&&Iu(t,n),B=k&&Pu(t,r,n,o);(N||B)&&(f={...f,...nf(u.data,t.options)}),n._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:p,errorUpdatedAt:g,status:v}=f;h=f.data;let m=!1;if(n.placeholderData!==void 0&&h===void 0&&v==="pending"){let k;i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData)?(k=i.data,m=!0):k=typeof n.placeholderData=="function"?n.placeholderData(($=E(this,vr))==null?void 0:$.state.data,E(this,vr)):n.placeholderData,k!==void 0&&(v="success",h=ks(i==null?void 0:i.data,k,n),d=!0)}if(n.select&&h!==void 0&&!m)if(i&&h===(s==null?void 0:s.data)&&n.select===E(this,po))h=E(this,mr);else try{X(this,po,n.select),h=n.select(h),h=ks(i==null?void 0:i.data,h,n),X(this,mr,h),X(this,on,null)}catch(k){X(this,on,k)}E(this,on)&&(p=E(this,on),h=E(this,mr),g=Date.now(),v="error");const y=f.fetchStatus==="fetching",b=v==="pending",S=v==="error",C=b&&y,R=h!==void 0,V={status:v,fetchStatus:f.fetchStatus,isPending:b,isSuccess:v==="success",isError:S,isInitialLoading:C,isLoading:C,data:h,dataUpdatedAt:f.dataUpdatedAt,error:p,errorUpdatedAt:g,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>c.dataUpdateCount||f.errorUpdateCount>c.errorUpdateCount,isFetching:y,isRefetching:y&&!b,isLoadingError:S&&!R,isPaused:f.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:S&&R,isStale:Pa(t,n),refetch:this.refetch,promise:E(this,rn)};if(this.options.experimental_prefetchInRender){const k=ne=>{V.status==="error"?ne.reject(V.error):V.data!==void 0&&ne.resolve(V.data)},N=()=>{const ne=X(this,rn,V.promise=Vs());k(ne)},B=E(this,rn);switch(B.status){case"pending":t.queryHash===r.queryHash&&k(B);break;case"fulfilled":(V.status==="error"||V.data!==B.value)&&N();break;case"rejected":(V.status!=="error"||V.error!==B.reason)&&N();break}}return V}updateResult(){const t=E(this,He),n=this.createResult(E(this,ve),this.options);if(X(this,$n,E(this,ve).state),X(this,pr,this.options),E(this,$n).data!==void 0&&X(this,vr,E(this,ve)),fi(n,t))return;X(this,He,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,i=typeof o=="function"?o():o;if(i==="all"||!i&&!E(this,yr).size)return!0;const s=new Set(i??E(this,yr));return this.options.throwOnError&&s.add("error"),Object.keys(E(this,He)).some(a=>{const l=a;return E(this,He)[l]!==t[l]&&s.has(l)})};ge(this,Se,of).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ge(this,Se,Bs).call(this)}},Qe=new WeakMap,ve=new WeakMap,go=new WeakMap,He=new WeakMap,$n=new WeakMap,pr=new WeakMap,rn=new WeakMap,on=new WeakMap,po=new WeakMap,mr=new WeakMap,vr=new WeakMap,An=new WeakMap,Tn=new WeakMap,sn=new WeakMap,yr=new WeakMap,Se=new WeakSet,qr=function(t){ge(this,Se,Hs).call(this);let n=E(this,ve).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Ge)),n},Ns=function(){ge(this,Se,js).call(this);const t=dn(this.options.staleTime,E(this,ve));if(wr||E(this,He).isStale||!Ls(t))return;const r=Wd(E(this,He).dataUpdatedAt,t)+1;X(this,An,setTimeout(()=>{E(this,He).isStale||this.updateResult()},r))},Ks=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(E(this,ve)):this.options.refetchInterval)??!1},zs=function(t){ge(this,Se,Us).call(this),X(this,sn,t),!(wr||gt(this.options.enabled,E(this,ve))===!1||!Ls(E(this,sn))||E(this,sn)===0)&&X(this,Tn,setInterval(()=>{(this.options.refetchIntervalInBackground||Ia.isFocused())&&ge(this,Se,qr).call(this)},E(this,sn)))},Bs=function(){ge(this,Se,Ns).call(this),ge(this,Se,zs).call(this,ge(this,Se,Ks).call(this))},js=function(){E(this,An)&&(clearTimeout(E(this,An)),X(this,An,void 0))},Us=function(){E(this,Tn)&&(clearInterval(E(this,Tn)),X(this,Tn,void 0))},Hs=function(){const t=E(this,Qe).getQueryCache().build(E(this,Qe),this.options);if(t===E(this,ve))return;const n=E(this,ve);X(this,ve,t),X(this,go,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},of=function(t){ke.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(E(this,He))}),E(this,Qe).getQueryCache().notify({query:E(this,ve),type:"observerResultsUpdated"})})},hd);function sm(e,t){return gt(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Iu(e,t){return sm(e,t)||e.state.data!==void 0&&Gs(e,t,t.refetchOnMount)}function Gs(e,t,n){if(gt(t.enabled,e)!==!1&&dn(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Pa(e,t)}return!1}function Pu(e,t,n,r){return(e!==t||gt(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Pa(e,n)}function Pa(e,t){return gt(t.enabled,e)!==!1&&e.isStaleByTime(dn(t.staleTime,e))}function am(e,t){return!fi(e.getCurrentResult(),t)}var an,ln,Xe,Nt,Bt,ei,qs,gd,lm=(gd=class extends Er{constructor(n,r){super();re(this,Bt);re(this,an);re(this,ln);re(this,Xe);re(this,Nt);X(this,an,n),this.setOptions(r),this.bindMethods(),ge(this,Bt,ei).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var o;const r=this.options;this.options=E(this,an).defaultMutationOptions(n),fi(this.options,r)||E(this,an).getMutationCache().notify({type:"observerOptionsUpdated",mutation:E(this,Xe),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&kn(r.mutationKey)!==kn(this.options.mutationKey)?this.reset():((o=E(this,Xe))==null?void 0:o.state.status)==="pending"&&E(this,Xe).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=E(this,Xe))==null||n.removeObserver(this)}onMutationUpdate(n){ge(this,Bt,ei).call(this),ge(this,Bt,qs).call(this,n)}getCurrentResult(){return E(this,ln)}reset(){var n;(n=E(this,Xe))==null||n.removeObserver(this),X(this,Xe,void 0),ge(this,Bt,ei).call(this),ge(this,Bt,qs).call(this)}mutate(n,r){var o;return X(this,Nt,r),(o=E(this,Xe))==null||o.removeObserver(this),X(this,Xe,E(this,an).getMutationCache().build(E(this,an),this.options)),E(this,Xe).addObserver(this),E(this,Xe).execute(n)}},an=new WeakMap,ln=new WeakMap,Xe=new WeakMap,Nt=new WeakMap,Bt=new WeakSet,ei=function(){var r;const n=((r=E(this,Xe))==null?void 0:r.state)??rf();X(this,ln,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},qs=function(n){ke.batch(()=>{var r,o,i,s,a,l,c,u;if(E(this,Nt)&&this.hasListeners()){const f=E(this,ln).variables,d=E(this,ln).context;(n==null?void 0:n.type)==="success"?((o=(r=E(this,Nt)).onSuccess)==null||o.call(r,n.data,f,d),(s=(i=E(this,Nt)).onSettled)==null||s.call(i,n.data,null,f,d)):(n==null?void 0:n.type)==="error"&&((l=(a=E(this,Nt)).onError)==null||l.call(a,n.error,f,d),(u=(c=E(this,Nt)).onSettled)==null||u.call(c,void 0,n.error,f,d))}this.listeners.forEach(f=>{f(E(this,ln))})})},gd);function um(e){return e}function cm(e,t,n){var l;if(typeof t!="object"||t===null)return;const r=e.getMutationCache(),o=e.getQueryCache(),i=((l=e.getDefaultOptions().hydrate)==null?void 0:l.deserializeData)??um,s=t.mutations||[],a=t.queries||[];s.forEach(({state:c,...u})=>{var f,d;r.build(e,{...(f=e.getDefaultOptions().hydrate)==null?void 0:f.mutations,...(d=n==null?void 0:n.defaultOptions)==null?void 0:d.mutations,...u},c)}),a.forEach(({queryKey:c,state:u,queryHash:f,meta:d,promise:h,dehydratedAt:p})=>{var C,R;const g=h?Wp(h):void 0,v=u.data===void 0?g==null?void 0:g.data:u.data,m=v===void 0?v:i(v);let y=o.get(f);const b=(y==null?void 0:y.state.status)==="pending",S=(y==null?void 0:y.state.fetchStatus)==="fetching";if(y){const D=g&&p!==void 0&&p>y.state.dataUpdatedAt;if(u.dataUpdatedAt>y.state.dataUpdatedAt||D){const{fetchStatus:V,...$}=u;y.setState({...$,data:m})}}else y=o.build(e,{...(C=e.getDefaultOptions().hydrate)==null?void 0:C.queries,...(R=n==null?void 0:n.defaultOptions)==null?void 0:R.queries,queryKey:c,queryHash:f,meta:d},{...u,data:m,fetchStatus:"idle",status:m!==void 0?"success":u.status});h&&!b&&!S&&(p===void 0||p>y.state.dataUpdatedAt)&&y.fetch(void 0,{initialPromise:Promise.resolve(h).then(i)})})}var sf=Ce(void 0),yo=e=>{if(e)return e;const t=xe(sf);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t()},dm=e=>(Ve(t=>(t==null||t(),e.client.mount(),e.client.unmount.bind(e.client))),Y(()=>e.client.unmount()),w(sf.Provider,{value:()=>e.client,get children(){return e.children}})),af=Ce(()=>!1),fm=()=>xe(af);af.Provider;function hm(e,t,n,r){if(n===!1)return t;if(typeof n=="function"){const s=n(e.data,t.data);return{...t,data:s}}let o=t.data;if(e.data===void 0)try{o=structuredClone(o)}catch{}const i=qd(o,{key:n})(e.data);return{...t,data:i}}var gm=(e,t)=>t;function pm(e,t,n){const r=L(()=>yo(n==null?void 0:n())),o=fm(),i=L(()=>{const S=r().defaultQueryOptions(e());return S._optimisticResults=o()?"isRestoring":"optimistic",S.structuralSharing=!1,S}),s=i(),[a,l]=z(new t(r(),i()));let c=a().getOptimisticResult(i());const[u,f]=vo(c),d=()=>a().subscribe(C=>{c=C,queueMicrotask(()=>{g&&y()})});function h(S){const C=a().options,R=C.reconcile;f(D=>hm(D,S,R===void 0?!1:R,C.queryHash))}function p(){return[()=>u,S=>{const C=_n(u);if(typeof S=="function"&&(S=S(C)),S!=null&&S.hydrationData){const{hydrationData:R,...D}=S;S=D}h(S)}]}let g=null,v=null;const[m,{refetch:y}]=xg(()=>{const S=a();return new Promise((C,R)=>{if(v=C,!g&&!o()&&(g=d()),S.updateResult(),c.isError&&!c.isFetching&&!o()&&Yd(S.options.throwOnError,[c.error,S.getCurrentQuery()]))return h(c),R(c.error);if(!c.isLoading)return v=null,C(gm(S.getCurrentQuery(),c));h(c)})},{storage:p,get deferStream(){return e().deferStream},onHydrated(S,C){if(C.value&&"hydrationData"in C.value&&cm(r(),{queries:[{...C.value.hydrationData}]}),g)return;const R={...s};(s.staleTime||!s.initialData)&&C.value&&(R.refetchOnMount=!1),a().setOptions(R),h(a().getOptimisticResult(R)),g=d()}});pt(Ee(r,S=>{g&&g();const C=new t(S,i());g=d(),l(C)},{defer:!0})),pt(Ee(o,S=>{S||y()},{defer:!0})),Y(()=>{g&&(g(),g=null),v&&(v(c),v=null)}),pt(Ee([a,i],([S,C])=>{S.setOptions(C),h(S.getOptimisticResult(C)),y()},{defer:!0}));const b={get(S,C){var R,D;return C==="data"?u.data!==void 0?(R=m.latest)==null?void 0:R.data:(D=m())==null?void 0:D.data:Reflect.get(S,C)}};return new Proxy(u,b)}function xi(e,t){return pm(L(()=>e()),im,t)}function mm(e,t){const n=L(()=>yo(t==null?void 0:t())),r=new lm(n(),e()),o=(l,c)=>{r.mutate(l,c).catch(Ge)},[i,s]=vo({...r.getCurrentResult(),mutate:o,mutateAsync:r.getCurrentResult().mutate});pt(()=>{r.setOptions(e())}),pt(Ee(()=>i.status,()=>{if(i.isError&&Yd(r.options.throwOnError,[i.error]))throw i.error}));const a=r.subscribe(l=>{s({...l,mutate:o,mutateAsync:l.mutate})});return Y(a),i}var vm=class extends om{constructor(e={}){super(e)}};const ym="/assets/logo-BYNFyja1.png";var wm=te('<main class="w-full space-y-2.5"><div class="flex flex-row items-center gap-1"><img alt="Hot Updater Console"class="w-12 h-12"><a href=https://github.com/gronxb/hot-updater target=_blank class="text-2xl font-light"rel=noreferrer>Hot Updater Console');function bm({children:e}){return(()=>{var t=wm(),n=t.firstChild,r=n.firstChild;return Ln(r,"src",ym),W(t,e,null),t})()}function Sm(e){return(...t)=>{for(const n of e)n&&n(...t)}}var T=e=>typeof e=="function"&&!e.length?e():e,Ru=e=>Array.isArray(e)?e:e?[e]:[];function xm(e,...t){return typeof e=="function"?e(...t):e}var Cm=Y;function Em(e,t,n,r){return e.addEventListener(t,n,r),Cm(e.removeEventListener.bind(e,t,n,r))}function Mm(e,t,n,r){const o=()=>{Ru(T(e)).forEach(i=>{i&&Ru(T(t)).forEach(s=>Em(i,s,n,r))})};typeof e=="function"?j(o):Ve(o)}var Ui=Symbol("fallback");function Ou(e){for(const t of e)t.dispose()}function Im(e,t,n,r={}){const o=new Map;return Y(()=>Ou(o.values())),()=>{const s=e()||[];return s[ai],Ae(()=>{var u,f;if(!s.length)return Ou(o.values()),o.clear(),r.fallback?[Kt(h=>(o.set(Ui,{dispose:h}),r.fallback()))]:[];const a=new Array(s.length),l=o.get(Ui);if(!o.size||l){l==null||l.dispose(),o.delete(Ui);for(let d=0;d<s.length;d++){const h=s[d],p=t(h,d);i(a,h,d,p)}return a}const c=new Set(o.keys());for(let d=0;d<s.length;d++){const h=s[d],p=t(h,d);c.delete(p);const g=o.get(p);g?(a[d]=g.mapped,(u=g.setIndex)==null||u.call(g,d),g.setItem(()=>h)):i(a,h,d,p)}for(const d of c)(f=o.get(d))==null||f.dispose(),o.delete(d);return a})};function i(s,a,l,c){Kt(u=>{const[f,d]=z(a),h={setItem:d,dispose:u};if(n.length>1){const[p,g]=z(l);h.setIndex=g,h.mapped=n(f,p)}else h.mapped=n(f);o.set(c,h),s[l]=h.mapped})}}function Pm(e){const{by:t}=e;return L(Im(()=>e.each,typeof t=="function"?t:n=>n[t],e.children,"fallback"in e?{fallback:()=>e.fallback}:void 0))}var Rm=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function Fu(e){const t={};let n;for(;n=Rm.exec(e);)t[n[1]]=n[2];return t}function ct(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=Fu(e)}else typeof t=="string"&&(t=Fu(t));return{...e,...t}}function me(...e){return Sm(e)}function Om(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function Ws(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Fm(e){return typeof e=="number"}function Jn(e){return Object.prototype.toString.call(e)==="[object String]"}function un(e){return typeof e=="function"}function Ye(e){return t=>`${e()}-${t}`}function $e(e,t){return e?e===t||e.contains(t):!1}function Wr(e,t=!1){const{activeElement:n}=We(e);if(!(n!=null&&n.nodeName))return null;if(lf(n)&&n.contentDocument)return Wr(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const o=We(n).getElementById(r);if(o)return o}}return n}function Ra(e){return We(e).defaultView||window}function We(e){return e?e.ownerDocument||e:document}function lf(e){return e.tagName==="IFRAME"}var Oa=(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))(Oa||{});function uf(e){var t;return typeof window>"u"||window.navigator==null?!1:((t=window.navigator.userAgentData)==null?void 0:t.brands.some(n=>e.test(n.brand)))||e.test(window.navigator.userAgent)}function Fa(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)==null?void 0:t.platform)||window.navigator.platform):!1}function wo(){return Fa(/^Mac/i)}function $m(){return Fa(/^iPhone/i)}function Am(){return Fa(/^iPad/i)||wo()&&navigator.maxTouchPoints>1}function Tm(){return $m()||Am()}function ti(){return wo()||Tm()}function Dm(){return uf(/AppleWebKit/i)&&!Lm()}function Lm(){return uf(/Chrome/i)}function ee(e,t){return t&&(un(t)?t(e):t[0](t[1],e)),e==null?void 0:e.defaultPrevented}function ye(e){return t=>{for(const n of e)ee(t,n)}}function _m(e){return wo()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function Fe(e){if(e)if(km())e.focus({preventScroll:!0});else{const t=Vm(e);e.focus(),Nm(t)}}var ko=null;function km(){if(ko==null){ko=!1;try{document.createElement("div").focus({get preventScroll(){return ko=!0,!0}})}catch{}}return ko}function Vm(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 Nm(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var cf=["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'])"],Km=[...cf,'[tabindex]:not([tabindex="-1"]):not([disabled])'],$a=`${cf.join(":not([hidden]),")},[tabindex]:not([disabled]):not([hidden])`,zm=Km.join(':not([hidden]):not([tabindex="-1"]),');function df(e,t){const r=Array.from(e.querySelectorAll($a)).filter($u);return t&&$u(e)&&r.unshift(e),r.forEach((o,i)=>{if(lf(o)&&o.contentDocument){const s=o.contentDocument.body,a=df(s,!1);r.splice(i,1,...a)}}),r}function $u(e){return ff(e)&&!Bm(e)}function ff(e){return e.matches($a)&&Aa(e)}function Bm(e){return Number.parseInt(e.getAttribute("tabindex")||"0",10)<0}function Aa(e,t){return e.nodeName!=="#comment"&&jm(e)&&Um(e,t)&&(!e.parentElement||Aa(e.parentElement,e))}function jm(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 Um(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function Hm(e,t,n){const r=t!=null&&t.tabbable?zm:$a,o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(i){var s;return(s=t==null?void 0:t.from)!=null&&s.contains(i)?NodeFilter.FILTER_REJECT:i.matches(r)&&Aa(i)&&(!(t!=null&&t.accept)||t.accept(i))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t!=null&&t.from&&(o.currentNode=t.from),o}function Au(e){let t=e;for(;t&&!Gm(t);)t=t.parentElement;return t||document.scrollingElement||document.documentElement}function Gm(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function qm(){}function Wm(e){return[e.clientX,e.clientY]}function hf(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],[f,d]=t[l],[,h]=t[l===0?s-1:l-1]||[0,0],p=(u-d)*(n-c)-(c-f)*(r-u);if(d<u){if(r>=d&&r<u){if(p===0)return!0;p>0&&(r===d?r>h&&(o=!o):o=!o)}}else if(u<d){if(r>u&&r<=d){if(p===0)return!0;p<0&&(r===d?r<h&&(o=!o):o=!o)}}else if(r===u&&(n>=f&&n<=c||n>=c&&n<=f))return!0}return o}function Z(e,t){return F(e,t)}var Vr=new Map,Tu=new Set;function Du(){if(typeof window>"u")return;const e=n=>{if(!n.target)return;let r=Vr.get(n.target);r||(r=new Set,Vr.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=Vr.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),Vr.delete(n.target)),Vr.size===0)){for(const o of Tu)o();Tu.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document<"u"&&(document.readyState!=="loading"?Du():document.addEventListener("DOMContentLoaded",Du));function Qs(e,t){const n=Lu(e,t,"left"),r=Lu(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 Lu(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 Qm(e,t){var n,r;if(document.contains(e)){const o=document.scrollingElement||document.documentElement;if(window.getComputedStyle(o).overflow==="hidden"){let s=Au(e);for(;e&&s&&e!==o&&s!==o;)Qs(s,e),e=s,s=Au(e)}else{const{left:s,top:a}=e.getBoundingClientRect();(n=e==null?void 0:e.scrollIntoView)==null||n.call(e,{block:"nearest"});const{left:l,top:c}=e.getBoundingClientRect();(Math.abs(s-l)>1||Math.abs(a-c)>1)&&((r=e.scrollIntoView)==null||r.call(e,{block:"nearest"}))}}}var Ci={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"},so="data-kb-top-layer",gf,Xs=!1,jt=[];function ao(e){return jt.findIndex(t=>t.node===e)}function Xm(e){return jt[ao(e)]}function Ym(e){return jt[jt.length-1].node===e}function pf(){return jt.filter(e=>e.isPointerBlocking)}function Jm(){return[...pf()].slice(-1)[0]}function Ta(){return pf().length>0}function mf(e){var n;const t=ao((n=Jm())==null?void 0:n.node);return ao(e)<t}function Zm(e){jt.push(e)}function ev(e){const t=ao(e);t<0||jt.splice(t,1)}function tv(){for(const{node:e}of jt)e.style.pointerEvents=mf(e)?"none":"auto"}function nv(e){if(Ta()&&!Xs){const t=We(e);gf=document.body.style.pointerEvents,t.body.style.pointerEvents="none",Xs=!0}}function rv(e){if(Ta())return;const t=We(e);t.body.style.pointerEvents=gf,t.body.style.length===0&&t.body.removeAttribute("style"),Xs=!1}var Ze={layers:jt,isTopMostLayer:Ym,hasPointerBlockingLayer:Ta,isBelowPointerBlockingLayer:mf,addLayer:Zm,removeLayer:ev,indexOf:ao,find:Xm,assignPointerEventToLayers:tv,disableBodyPointerEvents:nv,restoreBodyPointerEvents:rv};function Ei(e,t){const[n,r]=z(_u(t==null?void 0:t()));return j(()=>{var o;r(((o=e())==null?void 0:o.tagName.toLowerCase())||_u(t==null?void 0:t()))}),n}function _u(e){return Jn(e)?e:void 0}function le(e){const[t,n]=_(e,["as"]);if(!t.as)throw new Error("[kobalte]: Polymorphic is missing the required `as` prop.");return w(Fd,F(n,{get component(){return t.as}}))}var ov=Object.defineProperty,dt=(e,t)=>{for(var n in t)ov(e,n,{get:t[n],enumerable:!0})},iv={};dt(iv,{Button:()=>lv,Root:()=>xt});var sv=["button","color","file","image","reset","submit"];function av(e){const t=e.tagName.toLowerCase();return t==="button"?!0:t==="input"&&e.type?sv.indexOf(e.type)!==-1:!1}function xt(e){let t;const n=Z({type:"button"},e),[r,o]=_(n,["ref","type","disabled"]),i=Ei(()=>t,()=>"button"),s=L(()=>{const c=i();return c==null?!1:av({tagName:c,type:r.type})}),a=L(()=>i()==="input"),l=L(()=>i()==="a"&&(t==null?void 0:t.getAttribute("href"))!=null);return w(le,F({as:"button",ref(c){var u=me(f=>t=f,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))}var lv=xt;function _e(e){return t=>(e(t),()=>e(void 0))}var ze=e=>typeof e=="function"?e():e,uv=e=>{const t=L(()=>{const s=ze(e.element);if(s)return getComputedStyle(s)}),n=()=>{var s;return((s=t())==null?void 0:s.animationName)??"none"},[r,o]=z(ze(e.show)?"present":"hidden");let i="none";return j(s=>{const a=ze(e.show);return Ae(()=>{var u;if(s===a)return a;const l=i,c=n();a?o("present"):c==="none"||((u=t())==null?void 0:u.display)==="none"?o("hidden"):o(s===!0&&l!==c?"hiding":"hidden")}),a}),j(()=>{const s=ze(e.element);if(!s)return;const a=c=>{c.target===s&&(i=n())},l=c=>{const f=n().includes(c.animationName);c.target===s&&f&&r()==="hiding"&&o("hidden")};s.addEventListener("animationstart",a),s.addEventListener("animationcancel",l),s.addEventListener("animationend",l),Y(()=>{s.removeEventListener("animationstart",a),s.removeEventListener("animationcancel",l),s.removeEventListener("animationend",l)})}),{present:()=>r()==="present"||r()==="hiding",state:r,setState:o}},cv=uv,Vn=cv,dv={};dt(dv,{CloseButton:()=>Da,Description:()=>La,List:()=>ka,ProgressFill:()=>wf,ProgressTrack:()=>bf,Region:()=>Na,Root:()=>Ka,Title:()=>za,Toast:()=>Rv,toaster:()=>Ba,useToastContext:()=>bo});var vf=Ce();function bo(){const e=xe(vf);if(e===void 0)throw new Error("[kobalte]: `useToastContext` must be used within a `Toast.Root` component");return e}function Da(e){const t=bo(),[n,r]=_(e,["aria-label","onClick"]);return w(xt,F({get"aria-label"(){return n["aria-label"]||t.translations().close},onClick:i=>{ee(i,n.onClick),t.close()}},r))}function La(e){const t=bo(),n=Z({id:t.generateId("description")},e),[r,o]=_(n,["id"]);return j(()=>Y(t.registerDescriptionId(r.id))),w(le,F({as:"div",get id(){return r.id}},o))}var yf=Ce();function _a(){const e=xe(yf);if(e===void 0)throw new Error("[kobalte]: `useToastRegionContext` must be used within a `Toast.Region` component");return e}function ka(e){let t;const n=_a(),[r,o]=_(e,["ref","onFocusIn","onFocusOut","onPointerMove","onPointerLeave"]),i=c=>{ee(c,r.onFocusIn),n.pauseOnInteraction()&&!n.isPaused()&&n.pauseAllTimer()},s=c=>{ee(c,r.onFocusOut),$e(t,c.relatedTarget)||n.resumeAllTimer()},a=c=>{ee(c,r.onPointerMove),n.pauseOnInteraction()&&!n.isPaused()&&n.pauseAllTimer()},l=c=>{ee(c,r.onPointerLeave),$e(t,We(t).activeElement)||n.resumeAllTimer()};return j(Ee([()=>t,()=>n.hotkey()],([c,u])=>{if(!c)return;const f=We(c),d=h=>{u.every(g=>h[g]||h.code===g)&&Fe(c)};f.addEventListener("keydown",d),Y(()=>f.removeEventListener("keydown",d))})),j(()=>{if(!n.pauseOnPageIdle())return;const c=Ra(t);c.addEventListener("blur",n.pauseAllTimer),c.addEventListener("focus",n.resumeAllTimer),Y(()=>{c.removeEventListener("blur",n.pauseAllTimer),c.removeEventListener("focus",n.resumeAllTimer)})}),w(le,F({as:"ol",ref(c){var u=me(f=>t=f,r.ref);typeof u=="function"&&u(c)},tabIndex:-1,onFocusIn:i,onFocusOut:s,onPointerMove:a,onPointerLeave:l},o,{get children(){return w(et,{get each(){return n.toasts()},children:c=>c.toastComponent({get toastId(){return c.id}})})}}))}function wf(e){const t=_a(),n=bo(),[r,o]=_(e,["style"]),[i,s]=z(100);let a=0;return j(()=>{if(t.isPaused()||n.isPersistent())return;const l=setInterval(()=>{const c=new Date().getTime()-n.closeTimerStartTime()+a,u=Math.trunc(100-c/n.duration()*100);s(u<0?0:u)});Y(()=>{a+=new Date().getTime()-n.closeTimerStartTime(),clearInterval(l)})}),w(le,F({as:"div",get style(){return ct({"--kb-toast-progress-fill-width":`${i()}%`},r.style)}},o))}function bf(e){return w(le,F({as:"div","aria-hidden":"true",role:"presentation"},e))}var[Va,So]=vo({toasts:[]});function fv(e){So("toasts",t=>[...t,e])}function hv(e){return Va.toasts.find(t=>t.id===e)}function gv(e,t){const n=Va.toasts.findIndex(r=>r.id===e);n!==-1&&So("toasts",r=>[...r.slice(0,n),t,...r.slice(n+1)])}function pv(e){So("toasts",t=>t.id===e,"dismiss",!0)}function mv(e){So("toasts",t=>t.filter(n=>n.id!==e))}function vv(){So("toasts",[])}var Nn={toasts:()=>Va.toasts,add:fv,get:hv,update:gv,dismiss:pv,remove:mv,clear:vv},ku="{hotkey}",yv={close:"Close"},wv={notifications:e=>`Notifications (${e})`};function Na(e){const t=Z({id:`toast-region-${Ie()}`,hotkey:["altKey","KeyT"],duration:5e3,limit:3,swipeDirection:"right",swipeThreshold:50,pauseOnInteraction:!0,pauseOnPageIdle:!0,topLayer:!0,translations:wv},e),[n,r]=_(t,["translations","style","hotkey","duration","limit","swipeDirection","swipeThreshold","pauseOnInteraction","pauseOnPageIdle","topLayer","aria-label","regionId"]),o=L(()=>Nn.toasts().filter(d=>d.region===n.regionId&&d.dismiss===!1).slice(0,n.limit)),[i,s]=z(!1),a=()=>o().length>0,l=()=>n.hotkey.join("+").replace(/Key/g,"").replace(/Digit/g,""),c=()=>(n["aria-label"]||n.translations.notifications(ku)).replace(ku,l()),u=()=>({[so]:n.topLayer?"":void 0}),f={isPaused:i,toasts:o,hotkey:()=>n.hotkey,duration:()=>n.duration,swipeDirection:()=>n.swipeDirection,swipeThreshold:()=>n.swipeThreshold,pauseOnInteraction:()=>n.pauseOnInteraction,pauseOnPageIdle:()=>n.pauseOnPageIdle,pauseAllTimer:()=>s(!0),resumeAllTimer:()=>s(!1),generateId:Ye(()=>r.id)};return w(yf.Provider,{value:f,get children(){return w(le,F({as:"div",role:"region",tabIndex:-1,get"aria-label"(){return c()},get style(){return ct({"pointer-events":a()?n.topLayer?"auto":void 0:"none"},n.style)}},u,r))}})}var bv="toast.swipeStart",Sv="toast.swipeMove",xv="toast.swipeCancel",Cv="toast.swipeEnd";function Ka(e){const t=_a(),n=Z({id:`toast-${Ie()}`,priority:"high",translations:yv},e),[r,o]=_(n,["ref","translations","toastId","style","priority","duration","persistent","onPause","onResume","onSwipeStart","onSwipeMove","onSwipeCancel","onSwipeEnd","onEscapeKeyDown","onKeyDown","onPointerDown","onPointerMove","onPointerUp"]),[i,s]=z(!0),[a,l]=z(),[c,u]=z(),[f,d]=z(!0),[h,p]=z(),{present:g}=Vn({show:i,element:()=>h()??null}),v=L(()=>r.duration||t.duration());let m,y=0,b=v(),S=null,C=null;const R=()=>{s(!1),d(!0)},D=()=>{Nn.remove(r.toastId)},V=x=>{!x||r.persistent||(window.clearTimeout(m),y=new Date().getTime(),m=window.setTimeout(R,x))},$=()=>{var x;V(b),(x=r.onResume)==null||x.call(r)},k=()=>{var O;const x=new Date().getTime()-y;b=b-x,window.clearTimeout(m),(O=r.onPause)==null||O.call(r)},N=x=>{var O;ee(x,r.onKeyDown),x.key==="Escape"&&((O=r.onEscapeKeyDown)==null||O.call(r,x),x.defaultPrevented||R())},B=x=>{ee(x,r.onPointerDown),x.button===0&&(S={x:x.clientX,y:x.clientY})},ne=x=>{if(ee(x,r.onPointerMove),!S)return;const O=x.clientX-S.x,P=x.clientY-S.y,A=!!C,K=["left","right"].includes(t.swipeDirection()),H=["left","up"].includes(t.swipeDirection())?Math.min:Math.max,q=K?H(0,O):0,oe=K?0:H(0,P),J=x.pointerType==="touch"?10:2,fe={x:q,y:oe},Le={originalEvent:x,delta:fe};if(A){C=fe,Vo(Sv,r.onSwipeMove,Le);const{x:Je,y:ie}=fe;x.currentTarget.setAttribute("data-swipe","move"),x.currentTarget.style.setProperty("--kb-toast-swipe-move-x",`${Je}px`),x.currentTarget.style.setProperty("--kb-toast-swipe-move-y",`${ie}px`)}else Vu(fe,t.swipeDirection(),J)?(C=fe,Vo(bv,r.onSwipeStart,Le),x.currentTarget.setAttribute("data-swipe","start"),x.target.setPointerCapture(x.pointerId)):(Math.abs(O)>J||Math.abs(P)>J)&&(S=null)},I=x=>{ee(x,r.onPointerUp);const O=C,P=x.target;if(P.hasPointerCapture(x.pointerId)&&P.releasePointerCapture(x.pointerId),C=null,S=null,O){const A=x.currentTarget,K={originalEvent:x,delta:O};if(Vu(O,t.swipeDirection(),t.swipeThreshold())){Vo(Cv,r.onSwipeEnd,K);const{x:H,y:q}=O;x.currentTarget.setAttribute("data-swipe","end"),x.currentTarget.style.removeProperty("--kb-toast-swipe-move-x"),x.currentTarget.style.removeProperty("--kb-toast-swipe-move-y"),x.currentTarget.style.setProperty("--kb-toast-swipe-end-x",`${H}px`),x.currentTarget.style.setProperty("--kb-toast-swipe-end-y",`${q}px`),R()}else Vo(xv,r.onSwipeCancel,K),x.currentTarget.setAttribute("data-swipe","cancel"),x.currentTarget.style.removeProperty("--kb-toast-swipe-move-x"),x.currentTarget.style.removeProperty("--kb-toast-swipe-move-y"),x.currentTarget.style.removeProperty("--kb-toast-swipe-end-x"),x.currentTarget.style.removeProperty("--kb-toast-swipe-end-y");A.addEventListener("click",H=>H.preventDefault(),{once:!0})}};Sr(()=>{t.toasts().find(x=>x.id===r.toastId&&x.update)&&d(!1)}),j(Ee(()=>t.isPaused(),x=>{x?k():$()},{defer:!0})),j(Ee([i,v],([x,O])=>{x&&!t.isPaused()&&V(O)})),j(Ee(()=>{var x;return(x=Nn.get(r.toastId))==null?void 0:x.dismiss},x=>x&&R())),j(Ee(()=>g(),x=>!x&&D()));const M={translations:()=>r.translations,close:R,duration:v,isPersistent:()=>r.persistent??!1,closeTimerStartTime:()=>y,generateId:Ye(()=>o.id),registerTitleId:_e(l),registerDescriptionId:_e(u)};return w(de,{get when(){return g()},get children(){return w(vf.Provider,{value:M,get children(){return w(le,F({as:"li",ref(x){var O=me(p,r.ref);typeof O=="function"&&O(x)},role:"status",tabIndex:0,get style(){return ct({animation:f()?void 0:"none","user-select":"none","touch-action":"none"},r.style)},get"aria-live"(){return r.priority==="high"?"assertive":"polite"},"aria-atomic":"true",get"aria-labelledby"(){return a()},get"aria-describedby"(){return c()},get"data-opened"(){return i()?"":void 0},get"data-closed"(){return i()?void 0:""},get"data-swipe-direction"(){return t.swipeDirection()},onKeyDown:N,onPointerDown:B,onPointerMove:ne,onPointerUp:I},o))}})}})}function Vu(e,t,n=0){const r=Math.abs(e.x),o=Math.abs(e.y),i=r>o;return t==="left"||t==="right"?i&&r>n:!i&&o>n}function Vo(e,t,n){const r=n.originalEvent.currentTarget,o=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),r.dispatchEvent(o)}function za(e){const t=bo(),n=Z({id:t.generateId("title")},e),[r,o]=_(n,["id"]);return j(()=>Y(t.registerTitleId(r.id))),w(le,F({as:"div",get id(){return r.id}},o))}var Ev=0;function Sf(e,t){const n=Ev++;return Nn.add({id:n,toastComponent:e,dismiss:!1,update:!1,region:t==null?void 0:t.region}),n}function Ys(e,t){Nn.update(e,{id:e,toastComponent:t,dismiss:!1,update:!0})}function Mv(e,t,n){const r=Sf(o=>t({get toastId(){return o.toastId},state:"pending"}),n);return(un(e)?e():e).then(o=>Ys(r,i=>t({get toastId(){return i.toastId},state:"fulfilled",data:o}))).catch(o=>Ys(r,i=>t({get toastId(){return i.toastId},state:"rejected",error:o}))),r}function Iv(e){return Nn.dismiss(e),e}function Pv(){Nn.clear()}var Ba={show:Sf,update:Ys,promise:Mv,dismiss:Iv,clear:Pv},Rv=Object.assign(Ka,{CloseButton:Da,Description:La,List:ka,ProgressFill:wf,ProgressTrack:bf,Region:Na,Title:za,toaster:Ba});function xf(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=xf(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function Ov(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=xf(e))&&(r&&(r+=" "),r+=t);return r}const Nu=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,Ku=Ov,Mr=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Ku(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(c=>{const u=n==null?void 0:n[c],f=i==null?void 0:i[c];if(u===null)return null;const d=Nu(u)||Nu(f);return o[c][d]}),a=n&&Object.entries(n).reduce((c,u)=>{let[f,d]=u;return d===void 0||(c[f]=d),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:f,className:d,...h}=u;return Object.entries(h).every(p=>{let[g,v]=p;return Array.isArray(v)?v.includes({...i,...a}[g]):{...i,...a}[g]===v})?[...c,f,d]:c},[]);return Ku(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)};function Cf(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=Cf(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Fv(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Cf(e))&&(r&&(r+=" "),r+=t);return r}const ja="-",$v=e=>{const t=Tv(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const a=s.split(ja);return a[0]===""&&a.length!==1&&a.shift(),Ef(a,t)||Av(s)},getConflictingClassGroupIds:(s,a)=>{const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}}},Ef=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Ef(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(ja);return(s=t.validators.find(({validator:a})=>a(i)))==null?void 0:s.classGroupId},zu=/^\[(.+)\]$/,Av=e=>{if(zu.test(e)){const t=zu.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Tv=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Lv(Object.entries(e.classGroups),n).forEach(([i,s])=>{Js(s,r,i,t)}),r},Js=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:Bu(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(Dv(o)){Js(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{Js(s,Bu(t,i),n,r)})})},Bu=(e,t)=>{let n=e;return t.split(ja).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Dv=e=>e.isThemeGetter,Lv=(e,t)=>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,_v=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const 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)}}},Mf="!",kv=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],i=t.length,s=a=>{const l=[];let c=0,u=0,f;for(let v=0;v<a.length;v++){let m=a[v];if(c===0){if(m===o&&(r||a.slice(v,v+i)===t)){l.push(a.slice(u,v)),u=v+i;continue}if(m==="/"){f=v;continue}}m==="["?c++:m==="]"&&c--}const d=l.length===0?a:a.substring(u),h=d.startsWith(Mf),p=h?d.substring(1):d,g=f&&f>u?f-u:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:p,maybePostfixModifierPosition:g}};return n?a=>n({className:a,parseClassName:s}):s},Vv=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},Nv=e=>({cache:_v(e.cacheSize),parseClassName:kv(e),...$v(e)}),Kv=/\s+/,zv=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=[],s=e.trim().split(Kv);let a="";for(let l=s.length-1;l>=0;l-=1){const c=s[l],{modifiers:u,hasImportantModifier:f,baseClassName:d,maybePostfixModifierPosition:h}=n(c);let p=!!h,g=r(p?d.substring(0,h):d);if(!g){if(!p){a=c+(a.length>0?" "+a:a);continue}if(g=r(d),!g){a=c+(a.length>0?" "+a:a);continue}p=!1}const v=Vv(u).join(":"),m=f?v+Mf:v,y=m+g;if(i.includes(y))continue;i.push(y);const b=o(g,p);for(let S=0;S<b.length;++S){const C=b[S];i.push(m+C)}a=c+(a.length>0?" "+a:a)}return a};function Bv(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=If(t))&&(r&&(r+=" "),r+=n);return r}const If=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=If(e[r]))&&(n&&(n+=" "),n+=t);return n};function jv(e,...t){let n,r,o,i=s;function s(l){const c=t.reduce((u,f)=>f(u),e());return n=Nv(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=zv(l,n);return o(l,u),u}return function(){return i(Bv.apply(null,arguments))}}const Me=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Pf=/^\[(?:([a-z-]+):)?(.+)\]$/i,Uv=/^\d+\/\d+$/,Hv=new Set(["px","full","screen"]),Gv=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,qv=/\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$/,Wv=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Qv=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Xv=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Tt=e=>nr(e)||Hv.has(e)||Uv.test(e),Wt=e=>Ir(e,"length",oy),nr=e=>!!e&&!Number.isNaN(Number(e)),Hi=e=>Ir(e,"number",nr),Nr=e=>!!e&&Number.isInteger(Number(e)),Yv=e=>e.endsWith("%")&&nr(e.slice(0,-1)),he=e=>Pf.test(e),Qt=e=>Gv.test(e),Jv=new Set(["length","size","percentage"]),Zv=e=>Ir(e,Jv,Rf),ey=e=>Ir(e,"position",Rf),ty=new Set(["image","url"]),ny=e=>Ir(e,ty,sy),ry=e=>Ir(e,"",iy),Kr=()=>!0,Ir=(e,t,n)=>{const r=Pf.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},oy=e=>qv.test(e)&&!Wv.test(e),Rf=()=>!1,iy=e=>Qv.test(e),sy=e=>Xv.test(e),ay=()=>{const e=Me("colors"),t=Me("spacing"),n=Me("blur"),r=Me("brightness"),o=Me("borderColor"),i=Me("borderRadius"),s=Me("borderSpacing"),a=Me("borderWidth"),l=Me("contrast"),c=Me("grayscale"),u=Me("hueRotate"),f=Me("invert"),d=Me("gap"),h=Me("gradientColorStops"),p=Me("gradientColorStopPositions"),g=Me("inset"),v=Me("margin"),m=Me("opacity"),y=Me("padding"),b=Me("saturate"),S=Me("scale"),C=Me("sepia"),R=Me("skew"),D=Me("space"),V=Me("translate"),$=()=>["auto","contain","none"],k=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto",he,t],B=()=>[he,t],ne=()=>["",Tt,Wt],I=()=>["auto",nr,he],M=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],x=()=>["solid","dashed","dotted","double","none"],O=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],P=()=>["start","end","center","between","around","evenly","stretch"],A=()=>["","0",he],K=()=>["auto","avoid","all","avoid-page","page","left","right","column"],H=()=>[nr,he];return{cacheSize:500,separator:":",theme:{colors:[Kr],spacing:[Tt,Wt],blur:["none","",Qt,he],brightness:H(),borderColor:[e],borderRadius:["none","","full",Qt,he],borderSpacing:B(),borderWidth:ne(),contrast:H(),grayscale:A(),hueRotate:H(),invert:A(),gap:B(),gradientColorStops:[e],gradientColorStopPositions:[Yv,Wt],inset:N(),margin:N(),opacity:H(),padding:B(),saturate:H(),scale:H(),sepia:A(),skew:H(),space:B(),translate:B()},classGroups:{aspect:[{aspect:["auto","square","video",he]}],container:["container"],columns:[{columns:[Qt]}],"break-after":[{"break-after":K()}],"break-before":[{"break-before":K()}],"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:[...M(),he]}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:$()}],"overscroll-x":[{"overscroll-x":$()}],"overscroll-y":[{"overscroll-y":$()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Nr,he]}],basis:[{basis:N()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",he]}],grow:[{grow:A()}],shrink:[{shrink:A()}],order:[{order:["first","last","none",Nr,he]}],"grid-cols":[{"grid-cols":[Kr]}],"col-start-end":[{col:["auto",{span:["full",Nr,he]},he]}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":[Kr]}],"row-start-end":[{row:["auto",{span:[Nr,he]},he]}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",he]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",he]}],gap:[{gap:[d]}],"gap-x":[{"gap-x":[d]}],"gap-y":[{"gap-y":[d]}],"justify-content":[{justify:["normal",...P()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...P(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...P(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[D]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[D]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",he,t]}],"min-w":[{"min-w":[he,t,"min","max","fit"]}],"max-w":[{"max-w":[he,t,"none","full","min","max","fit","prose",{screen:[Qt]},Qt]}],h:[{h:[he,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[he,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[he,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[he,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Qt,Wt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Hi]}],"font-family":[{font:[Kr]}],"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",he]}],"line-clamp":[{"line-clamp":["none",nr,Hi]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Tt,he]}],"list-image":[{"list-image":["none",he]}],"list-style-type":[{list:["none","disc","decimal",he]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[m]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[m]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...x(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Tt,Wt]}],"underline-offset":[{"underline-offset":["auto",Tt,he]}],"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:B()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",he]}],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",he]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[m]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...M(),ey]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Zv]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},ny]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[p]}],"gradient-via-pos":[{via:[p]}],"gradient-to-pos":[{to:[p]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],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":[m]}],"border-style":[{border:[...x(),"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":[m]}],"divide-style":[{divide:x()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[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:["",...x()]}],"outline-offset":[{"outline-offset":[Tt,he]}],"outline-w":[{outline:[Tt,Wt]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[m]}],"ring-offset-w":[{"ring-offset":[Tt,Wt]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Qt,ry]}],"shadow-color":[{shadow:[Kr]}],opacity:[{opacity:[m]}],"mix-blend":[{"mix-blend":[...O(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":O()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Qt,he]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[f]}],saturate:[{saturate:[b]}],sepia:[{sepia:[C]}],"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":[f]}],"backdrop-opacity":[{"backdrop-opacity":[m]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"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",he]}],duration:[{duration:H()}],ease:[{ease:["linear","in","out","in-out",he]}],delay:[{delay:H()}],animate:[{animate:["none","spin","ping","pulse","bounce",he]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[Nr,he]}],"translate-x":[{"translate-x":[V]}],"translate-y":[{"translate-y":[V]}],"skew-x":[{"skew-x":[R]}],"skew-y":[{"skew-y":[R]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",he]}],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",he]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":B()}],"scroll-mx":[{"scroll-mx":B()}],"scroll-my":[{"scroll-my":B()}],"scroll-ms":[{"scroll-ms":B()}],"scroll-me":[{"scroll-me":B()}],"scroll-mt":[{"scroll-mt":B()}],"scroll-mr":[{"scroll-mr":B()}],"scroll-mb":[{"scroll-mb":B()}],"scroll-ml":[{"scroll-ml":B()}],"scroll-p":[{"scroll-p":B()}],"scroll-px":[{"scroll-px":B()}],"scroll-py":[{"scroll-py":B()}],"scroll-ps":[{"scroll-ps":B()}],"scroll-pe":[{"scroll-pe":B()}],"scroll-pt":[{"scroll-pt":B()}],"scroll-pr":[{"scroll-pr":B()}],"scroll-pb":[{"scroll-pb":B()}],"scroll-pl":[{"scroll-pl":B()}],"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",he]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Tt,Wt,Hi]}],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-s","border-color-e","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"]}}},ly=jv(ay);function ce(...e){return ly(Fv(e))}var uy=te('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round class=size-4><path d="M18 6l-12 12"></path><path d="M6 6l12 12">'),cy=te('<div class="grid gap-1">');const dy=Mr("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--kb-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--kb-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[opened]:animate-in data-[closed]:animate-out data-[swipe=end]:animate-out data-[closed]:fade-out-80 data-[closed]:slide-out-to-right-full data-[opened]:slide-in-from-top-full data-[opened]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground",success:"success border-success-foreground bg-success text-success-foreground",warning:"warning border-warning-foreground bg-warning text-warning-foreground",error:"error border-error-foreground bg-error text-error-foreground"}},defaultVariants:{variant:"default"}}),fy=e=>{const[t,n]=_(e,["class"]);return w(mo,{get children(){return w(Na,{get children(){return w(ka,F({get class(){return ce("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse gap-2 p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",t.class)}},n))}})}})},hy=e=>{const[t,n]=_(e,["class","variant"]);return w(Ka,F({get class(){return ce(dy({variant:t.variant}),t.class)}},n))},gy=e=>{const[t,n]=_(e,["class"]);return w(Da,F({get class(){return ce("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-destructive-foreground group-[.error]:text-error-foreground group-[.success]:text-success-foreground group-[.warning]:text-warning-foreground",t.class)}},n,{get children(){return uy()}}))},py=e=>{const[t,n]=_(e,["class"]);return w(za,F({get class(){return ce("text-sm font-semibold",t.class)}},n))},my=e=>{const[t,n]=_(e,["class"]);return w(La,F({get class(){return ce("text-sm opacity-90",t.class)}},n))};function Yt(e){Ba.show(t=>w(hy,{get toastId(){return t.toastId},get variant(){return e.variant},get duration(){return e.duration},get children(){return[(()=>{var n=cy();return W(n,(()=>{var r=L(()=>!!e.title);return()=>r()&&w(py,{get children(){return e.title}})})(),null),W(n,(()=>{var r=L(()=>!!e.description);return()=>r()&&w(my,{get children(){return e.description}})})(),null),n})(),w(gy,{})]}}))}var Gi="focusScope.autoFocusOnMount",qi="focusScope.autoFocusOnUnmount",ju={bubbles:!1,cancelable:!0},Uu={stack:[],active(){return this.stack[0]},add(e){var t;e!==this.active()&&((t=this.active())==null||t.pause()),this.stack=Ws(this.stack,e),this.stack.unshift(e)},remove(e){var t;this.stack=Ws(this.stack,e),(t=this.active())==null||t.resume()}};function Ua(e,t){const[n,r]=z(!1),o={pause(){r(!0)},resume(){r(!1)}};let i=null;const s=p=>{var g;return(g=e.onMountAutoFocus)==null?void 0:g.call(e,p)},a=p=>{var g;return(g=e.onUnmountAutoFocus)==null?void 0:g.call(e,p)},l=()=>We(t()),c=()=>{const p=l().createElement("span");return p.setAttribute("data-focus-trap",""),p.tabIndex=0,Object.assign(p.style,Ci),p},u=()=>{const p=t();return p?df(p,!0).filter(g=>!g.hasAttribute("data-focus-trap")):[]},f=()=>{const p=u();return p.length>0?p[0]:null},d=()=>{const p=u();return p.length>0?p[p.length-1]:null},h=()=>{const p=t();if(!p)return!1;const g=Wr(p);return!g||$e(p,g)?!1:ff(g)};j(()=>{const p=t();if(!p)return;Uu.add(o);const g=Wr(p);if(!$e(p,g)){const m=new CustomEvent(Gi,ju);p.addEventListener(Gi,s),p.dispatchEvent(m),m.defaultPrevented||setTimeout(()=>{Fe(f()),Wr(p)===g&&Fe(p)},0)}Y(()=>{p.removeEventListener(Gi,s),setTimeout(()=>{const m=new CustomEvent(qi,ju);h()&&m.preventDefault(),p.addEventListener(qi,a),p.dispatchEvent(m),m.defaultPrevented||Fe(g??l().body),p.removeEventListener(qi,a),Uu.remove(o)},0)})}),j(()=>{const p=t();if(!p||!T(e.trapFocus)||n())return;const g=m=>{const y=m.target;y!=null&&y.closest(`[${so}]`)||($e(p,y)?i=y:Fe(i))},v=m=>{const b=m.relatedTarget??Wr(p);b!=null&&b.closest(`[${so}]`)||$e(p,b)||Fe(i)};l().addEventListener("focusin",g),l().addEventListener("focusout",v),Y(()=>{l().removeEventListener("focusin",g),l().removeEventListener("focusout",v)})}),j(()=>{const p=t();if(!p||!T(e.trapFocus)||n())return;const g=c();p.insertAdjacentElement("afterbegin",g);const v=c();p.insertAdjacentElement("beforeend",v);function m(b){const S=f(),C=d();b.relatedTarget===S?Fe(C):Fe(S)}g.addEventListener("focusin",m),v.addEventListener("focusin",m);const y=new MutationObserver(b=>{for(const S of b)S.previousSibling===v&&(v.remove(),p.insertAdjacentElement("beforeend",v)),S.nextSibling===g&&(g.remove(),p.insertAdjacentElement("afterbegin",g))});y.observe(p,{childList:!0,subtree:!1}),Y(()=>{g.removeEventListener("focusin",m),v.removeEventListener("focusin",m),g.remove(),v.remove(),y.disconnect()})})}var Of=7e3,Wi=null,vy="data-live-announcer";function Qi(e,t="assertive",n=Of){Wi||(Wi=new yy),Wi.announce(e,t,n)}var yy=class{constructor(){Re(this,"node");Re(this,"assertiveLog");Re(this,"politeLog");this.node=document.createElement("div"),this.node.dataset.liveAnnouncer="true",Object.assign(this.node.style,Ci),this.assertiveLog=this.createLog("assertive"),this.node.appendChild(this.assertiveLog),this.politeLog=this.createLog("polite"),this.node.appendChild(this.politeLog),document.body.prepend(this.node)}createLog(e){const t=document.createElement("div");return t.setAttribute("role","log"),t.setAttribute("aria-live",e),t.setAttribute("aria-relevant","additions"),t}destroy(){this.node&&(document.body.removeChild(this.node),this.node=null)}announce(e,t="assertive",n=Of){if(!this.node)return;const r=document.createElement("div");r.textContent=e,t==="assertive"?this.assertiveLog.appendChild(r):this.politeLog.appendChild(r),e!==""&&setTimeout(()=>{r.remove()},n)}clear(e){this.node&&((!e||e==="assertive")&&(this.assertiveLog.innerHTML=""),(!e||e==="polite")&&(this.politeLog.innerHTML=""))}};function Ha(e){j(()=>{T(e.isDisabled)||Y(wy(T(e.targets),T(e.root)))})}var zr=new WeakMap,at=[];function wy(e,t=document.body){const n=new Set(e),r=new Set,o=l=>{for(const d of l.querySelectorAll(`[${vy}], [${so}]`))n.add(d);const c=d=>{if(n.has(d)||d.parentElement&&r.has(d.parentElement)&&d.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(const h of n)if(d.contains(h))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},u=document.createTreeWalker(l,NodeFilter.SHOW_ELEMENT,{acceptNode:c}),f=c(l);if(f===NodeFilter.FILTER_ACCEPT&&i(l),f!==NodeFilter.FILTER_REJECT){let d=u.nextNode();for(;d!=null;)i(d),d=u.nextNode()}},i=l=>{const c=zr.get(l)??0;l.getAttribute("aria-hidden")==="true"&&c===0||(c===0&&l.setAttribute("aria-hidden","true"),r.add(l),zr.set(l,c+1))};at.length&&at[at.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 at.push(a),()=>{s.disconnect();for(const l of r){const c=zr.get(l);if(c==null)return;c===1?(l.removeAttribute("aria-hidden"),zr.delete(l)):zr.set(l,c-1)}a===at[at.length-1]?(at.pop(),at.length&&at[at.length-1].observe()):at.splice(at.indexOf(a),1)}}var Hu="interactOutside.pointerDownOutside",Gu="interactOutside.focusOutside";function Ff(e,t){let n,r=qm;const o=()=>We(t()),i=f=>{var d;return(d=e.onPointerDownOutside)==null?void 0:d.call(e,f)},s=f=>{var d;return(d=e.onFocusOutside)==null?void 0:d.call(e,f)},a=f=>{var d;return(d=e.onInteractOutside)==null?void 0:d.call(e,f)},l=f=>{var h;const d=f.target;return!(d instanceof HTMLElement)||d.closest(`[${so}]`)||!$e(o(),d)||$e(t(),d)?!1:!((h=e.shouldExcludeElement)!=null&&h.call(e,d))},c=f=>{function d(){const h=t(),p=f.target;if(!h||!p||!l(f))return;const g=ye([i,a]);p.addEventListener(Hu,g,{once:!0});const v=new CustomEvent(Hu,{bubbles:!1,cancelable:!0,detail:{originalEvent:f,isContextMenu:f.button===2||_m(f)&&f.button===0}});p.dispatchEvent(v)}f.pointerType==="touch"?(o().removeEventListener("click",d),r=d,o().addEventListener("click",d,{once:!0})):d()},u=f=>{const d=t(),h=f.target;if(!d||!h||!l(f))return;const p=ye([s,a]);h.addEventListener(Gu,p,{once:!0});const g=new CustomEvent(Gu,{bubbles:!1,cancelable:!0,detail:{originalEvent:f,isContextMenu:!1}});h.dispatchEvent(g)};j(()=>{T(e.isDisabled)||(n=window.setTimeout(()=>{o().addEventListener("pointerdown",c,!0)},0),o().addEventListener("focusin",u,!0),Y(()=>{window.clearTimeout(n),o().removeEventListener("click",r),o().removeEventListener("pointerdown",c,!0),o().removeEventListener("focusin",u,!0)}))})}function by(e){const t=n=>{var r;n.key===Oa.Escape&&((r=e.onEscapeKeyDown)==null||r.call(e,n))};j(()=>{var r;if(T(e.isDisabled))return;const n=((r=e.ownerDocument)==null?void 0:r.call(e))??We();n.addEventListener("keydown",t),Y(()=>{n.removeEventListener("keydown",t)})})}var $f=Ce();function Sy(){return xe($f)}function xo(e){let t;const n=Sy(),[r,o]=_(e,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),i=new Set([]),s=f=>{i.add(f);const d=n==null?void 0:n.registerNestedLayer(f);return()=>{i.delete(f),d==null||d()}};Ff({shouldExcludeElement:f=>{var d;return t?((d=r.excludedElements)==null?void 0:d.some(h=>$e(h(),f)))||[...i].some(h=>$e(h,f)):!1},onPointerDownOutside:f=>{var d,h,p;!t||Ze.isBelowPointerBlockingLayer(t)||!r.bypassTopMostLayerCheck&&!Ze.isTopMostLayer(t)||((d=r.onPointerDownOutside)==null||d.call(r,f),(h=r.onInteractOutside)==null||h.call(r,f),f.defaultPrevented||(p=r.onDismiss)==null||p.call(r))},onFocusOutside:f=>{var d,h,p;(d=r.onFocusOutside)==null||d.call(r,f),(h=r.onInteractOutside)==null||h.call(r,f),f.defaultPrevented||(p=r.onDismiss)==null||p.call(r)}},()=>t),by({ownerDocument:()=>We(t),onEscapeKeyDown:f=>{var d;!t||!Ze.isTopMostLayer(t)||((d=r.onEscapeKeyDown)==null||d.call(r,f),!f.defaultPrevented&&r.onDismiss&&(f.preventDefault(),r.onDismiss()))}}),Sr(()=>{if(!t)return;Ze.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const f=n==null?void 0:n.registerNestedLayer(t);Ze.assignPointerEventToLayers(),Ze.disableBodyPointerEvents(t),Y(()=>{t&&(Ze.removeLayer(t),f==null||f(),Ze.assignPointerEventToLayers(),Ze.restoreBodyPointerEvents(t))})}),j(Ee([()=>t,()=>r.disableOutsidePointerEvents],([f,d])=>{if(!f)return;const h=Ze.find(f);h&&h.isPointerBlocking!==d&&(h.isPointerBlocking=d,Ze.assignPointerEventToLayers()),d&&Ze.disableBodyPointerEvents(f),Y(()=>{Ze.restoreBodyPointerEvents(f)})},{defer:!0}));const u={registerNestedLayer:s};return w($f.Provider,{value:u,get children(){return w(le,F({as:"div",ref(f){var d=me(h=>t=h,r.ref);typeof d=="function"&&d(f)}},o))}})}function wt(e){var s;const[t,n]=z((s=e.defaultValue)==null?void 0:s.call(e)),r=L(()=>{var a;return((a=e.value)==null?void 0:a.call(e))!==void 0}),o=L(()=>{var a;return r()?(a=e.value)==null?void 0:a.call(e):t()});return[o,a=>{Ae(()=>{var c;const l=xm(a,o());return Object.is(l,o())||(r()||n(l),(c=e.onChange)==null||c.call(e,l)),l})}]}function Af(e){const[t,n]=wt(e);return[()=>t()??!1,n]}function xy(e){const[t,n]=wt(e);return[()=>t()??[],n]}function Co(e={}){const[t,n]=Af({value:()=>T(e.open),defaultValue:()=>!!T(e.defaultOpen),onChange:s=>{var a;return(a=e.onOpenChange)==null?void 0:a.call(e,s)}}),r=()=>{n(!0)},o=()=>{n(!1)};return{isOpen:t,setIsOpen:n,open:r,close:o,toggle:()=>{t()?o():r()}}}var Zs=(e,t)=>{if(e.contains(t))return!0;let n=t;for(;n;){if(n===e)return!0;n=n._$host??n.parentElement}return!1},No=new Map,Cy=e=>{j(()=>{const t=ze(e.style)??{},n=ze(e.properties)??[],r={};for(const i in t)r[i]=e.element.style[i];const o=No.get(e.key);o?o.activeCount++:No.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);Y(()=>{var s;const i=No.get(e.key);if(i){if(i.activeCount!==1){i.activeCount--;return}No.delete(e.key);for(const[a,l]of Object.entries(i.originalStyles))e.element.style[a]=l;for(const a of i.properties)e.element.style.removeProperty(a);e.element.style.length===0&&e.element.removeAttribute("style"),(s=e.cleanup)==null||s.call(e)}})})},qu=Cy,Ey=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},My=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},Iy=(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]=Ey(o,t),f=u-l-r*c;(c!==0||f!==0)&&My(o,t)&&(i+=f,s+=c),o===(n??document.documentElement)?a=!0:o=o._$host??o.parentElement}while(o&&!a);return[i,s]},[Wu,Qu]=z([]),Py=e=>Wu().indexOf(e)===Wu().length-1,Ry=e=>{const t=F({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",restoreScrollPosition:!0,allowPinchZoom:!1},e),n=Ie();let r=[0,0],o=null,i=null;j(()=>{ze(t.enabled)&&(Qu(c=>[...c,n]),Y(()=>{Qu(c=>c.filter(u=>u!==n))}))}),j(()=>{if(!ze(t.enabled)||!ze(t.hideScrollbar))return;const{body:c}=document,u=window.innerWidth-c.offsetWidth;if(ze(t.preventScrollbarShift)){const f={overflow:"hidden"},d=[];u>0&&(ze(t.preventScrollbarShiftMode)==="padding"?f.paddingRight=`calc(${window.getComputedStyle(c).paddingRight} + ${u}px)`:f.marginRight=`calc(${window.getComputedStyle(c).marginRight} + ${u}px)`,d.push({key:"--scrollbar-width",value:`${u}px`}));const h=window.scrollY,p=window.scrollX;qu({key:"prevent-scroll",element:c,style:f,properties:d,cleanup:()=>{ze(t.restoreScrollPosition)&&u>0&&window.scrollTo(p,h)}})}else qu({key:"prevent-scroll",element:c,style:{overflow:"hidden"}})}),j(()=>{!Py(n)||!ze(t.enabled)||(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",s,{passive:!1}),document.addEventListener("touchmove",l,{passive:!1}),Y(()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",s),document.removeEventListener("touchmove",l)}))});const s=c=>{r=Xu(c),o=null,i=null},a=c=>{const u=c.target,f=ze(t.element),d=Oy(c),h=Math.abs(d[0])>Math.abs(d[1])?"x":"y",p=h==="x"?d[0]:d[1],g=Yu(u,h,p,f);let v;f&&Zs(f,u)?v=!g:v=!0,v&&c.cancelable&&c.preventDefault()},l=c=>{const u=ze(t.element),f=c.target;let d;if(c.touches.length===2)d=!ze(t.allowPinchZoom);else{if(o==null||i===null){const h=Xu(c).map((g,v)=>r[v]-g),p=Math.abs(h[0])>Math.abs(h[1])?"x":"y";o=p,i=p==="x"?h[0]:h[1]}if(f.type==="range")d=!1;else{const h=Yu(f,o,i,u);u&&Zs(u,f)?d=!h:d=!0}}d&&c.cancelable&&c.preventDefault()}},Oy=e=>[e.deltaX,e.deltaY],Xu=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],Yu=(e,t,n,r)=>{const o=r!==null&&Zs(r,e),[i,s]=Iy(e,t,o?r:void 0);return!(n>0&&Math.abs(i)<=1||n<0&&Math.abs(s)<1)},Fy=Ry,Ga=Fy,$y={};dt($y,{CloseButton:()=>Sn,Content:()=>Mi,Description:()=>Pr,Dialog:()=>Ay,Overlay:()=>Rr,Portal:()=>Or,Root:()=>Fr,Title:()=>$r,Trigger:()=>Eo,useDialogContext:()=>bn});var Tf=Ce();function bn(){const e=xe(Tf);if(e===void 0)throw new Error("[kobalte]: `useDialogContext` must be used within a `Dialog` component");return e}function Sn(e){const t=bn(),[n,r]=_(e,["aria-label","onClick"]);return w(xt,F({get"aria-label"(){return n["aria-label"]||t.translations().dismiss},onClick:i=>{ee(i,n.onClick),t.close()}},r))}function Mi(e){let t;const n=bn(),r=Z({id:n.generateId("content")},e),[o,i]=_(r,["ref","onOpenAutoFocus","onCloseAutoFocus","onPointerDownOutside","onFocusOutside","onInteractOutside"]);let s=!1,a=!1;const l=d=>{var h;(h=o.onPointerDownOutside)==null||h.call(o,d),n.modal()&&d.detail.isContextMenu&&d.preventDefault()},c=d=>{var h;(h=o.onFocusOutside)==null||h.call(o,d),n.modal()&&d.preventDefault()},u=d=>{var h;(h=o.onInteractOutside)==null||h.call(o,d),!n.modal()&&(d.defaultPrevented||(s=!0,d.detail.originalEvent.type==="pointerdown"&&(a=!0)),$e(n.triggerRef(),d.target)&&d.preventDefault(),d.detail.originalEvent.type==="focusin"&&a&&d.preventDefault())},f=d=>{var h;(h=o.onCloseAutoFocus)==null||h.call(o,d),n.modal()?(d.preventDefault(),Fe(n.triggerRef())):(d.defaultPrevented||(s||Fe(n.triggerRef()),d.preventDefault()),s=!1,a=!1)};return Ha({isDisabled:()=>!(n.isOpen()&&n.modal()),targets:()=>t?[t]:[]}),Ga({element:()=>t??null,enabled:()=>n.contentPresent()&&n.preventScroll()}),Ua({trapFocus:()=>n.isOpen()&&n.modal(),onMountAutoFocus:o.onOpenAutoFocus,onUnmountAutoFocus:f},()=>t),j(()=>Y(n.registerContentId(i.id))),w(de,{get when(){return n.contentPresent()},get children(){return w(xo,F({ref(d){var h=me(p=>{n.setContentRef(p),t=p},o.ref);typeof h=="function"&&h(d)},role:"dialog",tabIndex:-1,get disableOutsidePointerEvents(){return L(()=>!!n.modal())()&&n.isOpen()},get excludedElements(){return[n.triggerRef]},get"aria-labelledby"(){return n.titleId()},get"aria-describedby"(){return n.descriptionId()},get"data-expanded"(){return n.isOpen()?"":void 0},get"data-closed"(){return n.isOpen()?void 0:""},onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,get onDismiss(){return n.close}},i))}})}function Pr(e){const t=bn(),n=Z({id:t.generateId("description")},e),[r,o]=_(n,["id"]);return j(()=>Y(t.registerDescriptionId(r.id))),w(le,F({as:"p",get id(){return r.id}},o))}function Rr(e){const t=bn(),[n,r]=_(e,["ref","style","onPointerDown"]),o=i=>{ee(i,n.onPointerDown),i.target===i.currentTarget&&i.preventDefault()};return w(de,{get when(){return t.overlayPresent()},get children(){return w(le,F({as:"div",ref(i){var s=me(t.setOverlayRef,n.ref);typeof s=="function"&&s(i)},get style(){return ct({"pointer-events":"auto"},n.style)},get"data-expanded"(){return t.isOpen()?"":void 0},get"data-closed"(){return t.isOpen()?void 0:""},onPointerDown:o},r))}})}function Or(e){const t=bn();return w(de,{get when(){return t.contentPresent()||t.overlayPresent()},get children(){return w(mo,e)}})}var Ju={dismiss:"Dismiss"};function Fr(e){const t=`dialog-${Ie()}`,n=Z({id:t,modal:!0,translations:Ju},e),[r,o]=z(),[i,s]=z(),[a,l]=z(),[c,u]=z(),[f,d]=z(),[h,p]=z(),g=Co({open:()=>n.open,defaultOpen:()=>n.defaultOpen,onOpenChange:S=>{var C;return(C=n.onOpenChange)==null?void 0:C.call(n,S)}}),v=()=>n.forceMount||g.isOpen(),{present:m}=Vn({show:v,element:()=>c()??null}),{present:y}=Vn({show:v,element:()=>f()??null}),b={translations:()=>n.translations??Ju,isOpen:g.isOpen,modal:()=>n.modal??!0,preventScroll:()=>n.preventScroll??b.modal(),contentId:r,titleId:i,descriptionId:a,triggerRef:h,overlayRef:c,setOverlayRef:u,contentRef:f,setContentRef:d,overlayPresent:m,contentPresent:y,close:g.close,toggle:g.toggle,setTriggerRef:p,generateId:Ye(()=>n.id),registerContentId:_e(o),registerTitleId:_e(s),registerDescriptionId:_e(l)};return w(Tf.Provider,{value:b,get children(){return n.children}})}function $r(e){const t=bn(),n=Z({id:t.generateId("title")},e),[r,o]=_(n,["id"]);return j(()=>Y(t.registerTitleId(r.id))),w(le,F({as:"h2",get id(){return r.id}},o))}function Eo(e){const t=bn(),[n,r]=_(e,["ref","onClick"]);return w(xt,F({ref(i){var s=me(t.setTriggerRef,n.ref);typeof s=="function"&&s(i)},"aria-haspopup":"dialog",get"aria-expanded"(){return t.isOpen()},get"aria-controls"(){return L(()=>!!t.isOpen())()?t.contentId():void 0},get"data-expanded"(){return t.isOpen()?"":void 0},get"data-closed"(){return t.isOpen()?void 0:""},onClick:i=>{ee(i,n.onClick),t.toggle()}},r))}var Ay=Object.assign(Fr,{CloseButton:Sn,Content:Mi,Description:Pr,Overlay:Rr,Portal:Or,Title:$r,Trigger:Eo}),Df=te("<div>"),Ty=te('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round class=size-4><path d="M18 6l-12 12"></path><path d="M6 6l12 12">'),Dy=te("<span class=sr-only>Close");const Ly=Fr,_y=Mr("fixed inset-0 z-50 flex",{variants:{position:{top:"items-start",bottom:"items-end",left:"justify-start",right:"justify-end"}},defaultVariants:{position:"right"}}),ky=e=>{const[t,n]=_(e,["position","children"]);return w(Or,F(n,{get children(){var r=Df();return W(r,()=>t.children),Ve(()=>Md(r,_y({position:t.position}))),r}}))},Vy=e=>{const[t,n]=_(e,["class"]);return w(Rr,F({get class(){return ce("fixed inset-0 z-50 bg-black/80 data-[expanded=]:animate-in data-[closed=]:animate-out data-[closed=]:fade-out-0 data-[expanded=]:fade-in-0",t.class)}},n))},Ny=Mr("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[closed=]:duration-300 data-[expanded=]:duration-500 data-[expanded=]:animate-in data-[closed=]:animate-out",{variants:{position:{top:"inset-x-0 top-0 border-b data-[closed=]:slide-out-to-top data-[expanded=]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[closed=]:slide-out-to-bottom data-[expanded=]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[closed=]:slide-out-to-left data-[expanded]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[closed=]:slide-out-to-right data-[expanded=]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{position:"right"}}),Ky=e=>{const[t,n]=_(e,["position","class","children"]);return w(ky,{get position(){return t.position},get children(){return[w(Vy,{}),w(Mi,F({get class(){return ce(Ny({position:t.position}),t.class,"max-h-screen overflow-y-auto")}},n,{get children(){return[L(()=>t.children),w(Sn,{class:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",get children(){return[Ty(),Dy()]}})]}}))]}})},zy=e=>{const[t,n]=_(e,["class"]);return(()=>{var r=Df();return qe(r,F({get class(){return ce("flex flex-col space-y-2 text-center sm:text-left",t.class)}},n),!1,!1),r})()},By=e=>{const[t,n]=_(e,["class"]);return w($r,F({get class(){return ce("text-lg font-semibold text-foreground",t.class)}},n))},jy=e=>{const[t,n]=_(e,["class"]);return w(Pr,F({get class(){return ce("text-sm text-muted-foreground",t.class)}},n))},Lf=()=>{const[e,t]=Kd(),n=L(()=>(e==null?void 0:e.bundleId)??null),r=L(()=>(e==null?void 0:e.channel)??null),o=L(()=>(e==null?void 0:e.platform)??null);return{bundleIdFilter:n,channelFilter:r,platformFilter:o,setBundleIdFilter:i=>{t({bundleId:i??void 0})},setChannelFilter:i=>{t({channel:i??void 0})},setPlatformFilter:i=>{t({platform:i??void 0})}}};function _f(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ni={exports:{}},Uy=ni.exports,Zu;function Hy(){return Zu||(Zu=1,function(e,t){(function(n,r){e.exports=r()})(Uy,function(){var n=1e3,r=6e4,o=36e5,i="millisecond",s="second",a="minute",l="hour",c="day",u="week",f="month",d="quarter",h="year",p="date",g="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,y={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(I){var M=["th","st","nd","rd"],x=I%100;return"["+I+(M[(x-20)%10]||M[x]||M[0])+"]"}},b=function(I,M,x){var O=String(I);return!O||O.length>=M?I:""+Array(M+1-O.length).join(x)+I},S={s:b,z:function(I){var M=-I.utcOffset(),x=Math.abs(M),O=Math.floor(x/60),P=x%60;return(M<=0?"+":"-")+b(O,2,"0")+":"+b(P,2,"0")},m:function I(M,x){if(M.date()<x.date())return-I(x,M);var O=12*(x.year()-M.year())+(x.month()-M.month()),P=M.clone().add(O,f),A=x-P<0,K=M.clone().add(O+(A?-1:1),f);return+(-(O+(x-P)/(A?P-K:K-P))||0)},a:function(I){return I<0?Math.ceil(I)||0:Math.floor(I)},p:function(I){return{M:f,y:h,w:u,d:c,D:p,h:l,m:a,s,ms:i,Q:d}[I]||String(I||"").toLowerCase().replace(/s$/,"")},u:function(I){return I===void 0}},C="en",R={};R[C]=y;var D="$isDayjsObject",V=function(I){return I instanceof B||!(!I||!I[D])},$=function I(M,x,O){var P;if(!M)return C;if(typeof M=="string"){var A=M.toLowerCase();R[A]&&(P=A),x&&(R[A]=x,P=A);var K=M.split("-");if(!P&&K.length>1)return I(K[0])}else{var H=M.name;R[H]=M,P=H}return!O&&P&&(C=P),P||!O&&C},k=function(I,M){if(V(I))return I.clone();var x=typeof M=="object"?M:{};return x.date=I,x.args=arguments,new B(x)},N=S;N.l=$,N.i=V,N.w=function(I,M){return k(I,{locale:M.$L,utc:M.$u,x:M.$x,$offset:M.$offset})};var B=function(){function I(x){this.$L=$(x.locale,null,!0),this.parse(x),this.$x=this.$x||x.x||{},this[D]=!0}var M=I.prototype;return M.parse=function(x){this.$d=function(O){var P=O.date,A=O.utc;if(P===null)return new Date(NaN);if(N.u(P))return new Date;if(P instanceof Date)return new Date(P);if(typeof P=="string"&&!/Z$/i.test(P)){var K=P.match(v);if(K){var H=K[2]-1||0,q=(K[7]||"0").substring(0,3);return A?new Date(Date.UTC(K[1],H,K[3]||1,K[4]||0,K[5]||0,K[6]||0,q)):new Date(K[1],H,K[3]||1,K[4]||0,K[5]||0,K[6]||0,q)}}return new Date(P)}(x),this.init()},M.init=function(){var x=this.$d;this.$y=x.getFullYear(),this.$M=x.getMonth(),this.$D=x.getDate(),this.$W=x.getDay(),this.$H=x.getHours(),this.$m=x.getMinutes(),this.$s=x.getSeconds(),this.$ms=x.getMilliseconds()},M.$utils=function(){return N},M.isValid=function(){return this.$d.toString()!==g},M.isSame=function(x,O){var P=k(x);return this.startOf(O)<=P&&P<=this.endOf(O)},M.isAfter=function(x,O){return k(x)<this.startOf(O)},M.isBefore=function(x,O){return this.endOf(O)<k(x)},M.$g=function(x,O,P){return N.u(x)?this[O]:this.set(P,x)},M.unix=function(){return Math.floor(this.valueOf()/1e3)},M.valueOf=function(){return this.$d.getTime()},M.startOf=function(x,O){var P=this,A=!!N.u(O)||O,K=N.p(x),H=function(Pe,Te){var st=N.w(P.$u?Date.UTC(P.$y,Te,Pe):new Date(P.$y,Te,Pe),P);return A?st:st.endOf(c)},q=function(Pe,Te){return N.w(P.toDate()[Pe].apply(P.toDate("s"),(A?[0,0,0,0]:[23,59,59,999]).slice(Te)),P)},oe=this.$W,J=this.$M,fe=this.$D,Le="set"+(this.$u?"UTC":"");switch(K){case h:return A?H(1,0):H(31,11);case f:return A?H(1,J):H(0,J+1);case u:var Je=this.$locale().weekStart||0,ie=(oe<Je?oe+7:oe)-Je;return H(A?fe-ie:fe+(6-ie),J);case c:case p:return q(Le+"Hours",0);case l:return q(Le+"Minutes",1);case a:return q(Le+"Seconds",2);case s:return q(Le+"Milliseconds",3);default:return this.clone()}},M.endOf=function(x){return this.startOf(x,!1)},M.$set=function(x,O){var P,A=N.p(x),K="set"+(this.$u?"UTC":""),H=(P={},P[c]=K+"Date",P[p]=K+"Date",P[f]=K+"Month",P[h]=K+"FullYear",P[l]=K+"Hours",P[a]=K+"Minutes",P[s]=K+"Seconds",P[i]=K+"Milliseconds",P)[A],q=A===c?this.$D+(O-this.$W):O;if(A===f||A===h){var oe=this.clone().set(p,1);oe.$d[H](q),oe.init(),this.$d=oe.set(p,Math.min(this.$D,oe.daysInMonth())).$d}else H&&this.$d[H](q);return this.init(),this},M.set=function(x,O){return this.clone().$set(x,O)},M.get=function(x){return this[N.p(x)]()},M.add=function(x,O){var P,A=this;x=Number(x);var K=N.p(O),H=function(J){var fe=k(A);return N.w(fe.date(fe.date()+Math.round(J*x)),A)};if(K===f)return this.set(f,this.$M+x);if(K===h)return this.set(h,this.$y+x);if(K===c)return H(1);if(K===u)return H(7);var q=(P={},P[a]=r,P[l]=o,P[s]=n,P)[K]||1,oe=this.$d.getTime()+x*q;return N.w(oe,this)},M.subtract=function(x,O){return this.add(-1*x,O)},M.format=function(x){var O=this,P=this.$locale();if(!this.isValid())return P.invalidDate||g;var A=x||"YYYY-MM-DDTHH:mm:ssZ",K=N.z(this),H=this.$H,q=this.$m,oe=this.$M,J=P.weekdays,fe=P.months,Le=P.meridiem,Je=function(Te,st,Gt,Gn){return Te&&(Te[st]||Te(O,A))||Gt[st].slice(0,Gn)},ie=function(Te){return N.s(H%12||12,Te,"0")},Pe=Le||function(Te,st,Gt){var Gn=Te<12?"AM":"PM";return Gt?Gn.toLowerCase():Gn};return A.replace(m,function(Te,st){return st||function(Gt){switch(Gt){case"YY":return String(O.$y).slice(-2);case"YYYY":return N.s(O.$y,4,"0");case"M":return oe+1;case"MM":return N.s(oe+1,2,"0");case"MMM":return Je(P.monthsShort,oe,fe,3);case"MMMM":return Je(fe,oe);case"D":return O.$D;case"DD":return N.s(O.$D,2,"0");case"d":return String(O.$W);case"dd":return Je(P.weekdaysMin,O.$W,J,2);case"ddd":return Je(P.weekdaysShort,O.$W,J,3);case"dddd":return J[O.$W];case"H":return String(H);case"HH":return N.s(H,2,"0");case"h":return ie(1);case"hh":return ie(2);case"a":return Pe(H,q,!0);case"A":return Pe(H,q,!1);case"m":return String(q);case"mm":return N.s(q,2,"0");case"s":return String(O.$s);case"ss":return N.s(O.$s,2,"0");case"SSS":return N.s(O.$ms,3,"0");case"Z":return K}return null}(Te)||K.replace(":","")})},M.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},M.diff=function(x,O,P){var A,K=this,H=N.p(O),q=k(x),oe=(q.utcOffset()-this.utcOffset())*r,J=this-q,fe=function(){return N.m(K,q)};switch(H){case h:A=fe()/12;break;case f:A=fe();break;case d:A=fe()/3;break;case u:A=(J-oe)/6048e5;break;case c:A=(J-oe)/864e5;break;case l:A=J/o;break;case a:A=J/r;break;case s:A=J/n;break;default:A=J}return P?A:N.a(A)},M.daysInMonth=function(){return this.endOf(f).$D},M.$locale=function(){return R[this.$L]},M.locale=function(x,O){if(!x)return this.$L;var P=this.clone(),A=$(x,O,!0);return A&&(P.$L=A),P},M.clone=function(){return N.w(this.$d,this)},M.toDate=function(){return new Date(this.valueOf())},M.toJSON=function(){return this.isValid()?this.toISOString():null},M.toISOString=function(){return this.$d.toISOString()},M.toString=function(){return this.$d.toUTCString()},I}(),ne=B.prototype;return k.prototype=ne,[["$ms",i],["$s",s],["$m",a],["$H",l],["$W",c],["$M",f],["$y",h],["$D",p]].forEach(function(I){ne[I[1]]=function(M){return this.$g(M,I[0],I[1])}}),k.extend=function(I,M){return I.$i||(I(M,B,k),I.$i=!0),k},k.locale=$,k.isDayjs=V,k.unix=function(I){return k(1e3*I)},k.en=R[C],k.Ls=R,k.p={},k})}(ni)),ni.exports}var Gy=Hy();const qy=_f(Gy);/**
2
+ * @license lucide-solid v0.454.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */var Wy={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"},Wn=Wy,Qy=te("<svg>"),Xy=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Yy=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),Jy=e=>{const[t,n]=_(e,["color","size","strokeWidth","children","class","name","iconNode","absoluteStrokeWidth"]);return(()=>{var r=Qy();return qe(r,F(Wn,{get width(){return t.size??Wn.width},get height(){return t.size??Wn.height},get stroke(){return t.color??Wn.stroke},get"stroke-width"(){return L(()=>!!t.absoluteStrokeWidth)()?Number(t.strokeWidth??Wn["stroke-width"])*24/Number(t.size):Number(t.strokeWidth??Wn["stroke-width"])},get class(){return Yy("lucide","lucide-icon",t.name!=null?`lucide-${Xy(t==null?void 0:t.name)}`:void 0,t.class!=null?t.class:"")}},n),!0,!0),W(r,w(et,{get each(){return t.iconNode},children:([o,i])=>w(Fd,F({component:o},i))})),r})()},jn=Jy,Zy=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ew=e=>w(jn,F(e,{name:"Check",iconNode:Zy})),ec=ew,tw=[["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M2 12a10 10 0 0 1 18-6",key:"ydlgp0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}],["path",{d:"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2",key:"1tidbn"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2v2",key:"1fr1j5"}]],nw=e=>w(jn,F(e,{name:"Fingerprint",iconNode:tw})),rw=nw,ow=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],iw=e=>w(jn,F(e,{name:"Hash",iconNode:ow})),tc=iw,sw=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],aw=e=>w(jn,F(e,{name:"LoaderCircle",iconNode:sw})),lw=aw,uw=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7",key:"yx3hmr"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],cw=e=>w(jn,F(e,{name:"Package",iconNode:uw})),dw=cw,fw=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],hw=e=>w(jn,F(e,{name:"Trash2",iconNode:fw})),nc=hw,gw=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],pw=e=>w(jn,F(e,{name:"X",iconNode:gw})),rc=pw,mw=te("<svg stroke-width=0>");function kf(e,t){const n=F(e.a,t),[r,o]=_(n,["src"]),[i,s]=z(""),a=L(()=>t.title?`${e.c}<title>${t.title}</title>`:e.c);return j(()=>s(a())),Y(()=>{s("")}),(()=>{var l=mw();return qe(l,F({get stroke(){var c;return(c=e.a)==null?void 0:c.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),W(l,()=>Rd),l})()}function Vf(e){return kf({a:{viewBox:"0 0 1024 1024"},c:'<path d="M270.1 741.7c0 23.4 19.1 42.5 42.6 42.5h48.7v120.4c0 30.5 24.5 55.4 54.6 55.4 30.2 0 54.6-24.8 54.6-55.4V784.1h85v120.4c0 30.5 24.5 55.4 54.6 55.4 30.2 0 54.6-24.8 54.6-55.4V784.1h48.7c23.5 0 42.6-19.1 42.6-42.5V346.4h-486v395.3zm357.1-600.1 44.9-65c2.6-3.8 2-8.9-1.5-11.4-3.5-2.4-8.5-1.2-11.1 2.6l-46.6 67.6c-30.7-12.1-64.9-18.8-100.8-18.8-35.9 0-70.1 6.7-100.8 18.8l-46.6-67.5c-2.6-3.8-7.6-5.1-11.1-2.6-3.5 2.4-4.1 7.4-1.5 11.4l44.9 65c-71.4 33.2-121.4 96.1-127.8 169.6h486c-6.6-73.6-56.7-136.5-128-169.7zM409.5 244.1a26.9 26.9 0 1 1 26.9-26.9 26.97 26.97 0 0 1-26.9 26.9zm208.4 0a26.9 26.9 0 1 1 26.9-26.9 26.97 26.97 0 0 1-26.9 26.9zm223.4 100.7c-30.2 0-54.6 24.8-54.6 55.4v216.4c0 30.5 24.5 55.4 54.6 55.4 30.2 0 54.6-24.8 54.6-55.4V400.1c.1-30.6-24.3-55.3-54.6-55.3zm-658.6 0c-30.2 0-54.6 24.8-54.6 55.4v216.4c0 30.5 24.5 55.4 54.6 55.4 30.2 0 54.6-24.8 54.6-55.4V400.1c0-30.6-24.5-55.3-54.6-55.3z"/>'},e)}function Nf(e){return kf({a:{viewBox:"0 0 1024 1024"},c:'<path d="M747.4 535.7c-.4-68.2 30.5-119.6 92.9-157.5-34.9-50-87.7-77.5-157.3-82.8-65.9-5.2-138 38.4-164.4 38.4-27.9 0-91.7-36.6-141.9-36.6C273.1 298.8 163 379.8 163 544.6c0 48.7 8.9 99 26.7 150.8 23.8 68.2 109.6 235.3 199.1 232.6 46.8-1.1 79.9-33.2 140.8-33.2 59.1 0 89.7 33.2 141.9 33.2 90.3-1.3 167.9-153.2 190.5-221.6-121.1-57.1-114.6-167.2-114.6-170.7zm-105.1-305c50.7-60.2 46.1-115 44.6-134.7-44.8 2.6-96.6 30.5-126.1 64.8-32.5 36.8-51.6 82.3-47.5 133.6 48.4 3.7 92.6-21.2 129-63.7z"/>'},e)}var vw=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),yw=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function ww(e){if(Intl.Locale){const n=new Intl.Locale(e).maximize().script??"";return vw.has(n)}const t=e.split("-")[0];return yw.has(t)}function bw(e){return ww(e)?"rtl":"ltr"}function Kf(){let e=typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction:bw(e)}}var ea=Kf(),Qr=new Set;function oc(){ea=Kf();for(const e of Qr)e(ea)}function Sw(){const[e,t]=z(ea),n=L(()=>e());return Sr(()=>{Qr.size===0&&window.addEventListener("languagechange",oc),Qr.add(t),Y(()=>{Qr.delete(t),Qr.size===0&&window.removeEventListener("languagechange",oc)})}),{locale:()=>n().locale,direction:()=>n().direction}}var xw=Ce();function xn(){const e=Sw();return xe(xw)||e}var Xi=new Map;function zf(e){const{locale:t}=xn(),n=L(()=>t()+(e?Object.entries(e).sort((r,o)=>r[0]<o[0]?-1:1).join():""));return L(()=>{const r=n();let o;return Xi.has(r)&&(o=Xi.get(r)),o||(o=new Intl.Collator(t(),e),Xi.set(r,o)),o})}function Cw(e){const t=zf({usage:"search",...e});return{startsWith:(i,s)=>{if(s.length===0)return!0;const a=i.normalize("NFC"),l=s.normalize("NFC");return t().compare(a.slice(0,l.length),l)===0},endsWith:(i,s)=>{if(s.length===0)return!0;const a=i.normalize("NFC"),l=s.normalize("NFC");return t().compare(a.slice(-l.length),l)===0},contains:(i,s)=>{if(s.length===0)return!0;const a=i.normalize("NFC"),l=s.normalize("NFC");let c=0;const u=s.length;for(;c+u<=a.length;c++){const f=a.slice(c,c+u);if(t().compare(l,f)===0)return!0}return!1}}}const Ew=["top","right","bottom","left"],pn=Math.min,tt=Math.max,gi=Math.round,Ko=Math.floor,Ot=e=>({x:e,y:e}),Mw={left:"right",right:"left",bottom:"top",top:"bottom"},Iw={start:"end",end:"start"};function ta(e,t,n){return tt(e,pn(t,n))}function Un(e,t){return typeof e=="function"?e(t):e}function mn(e){return e.split("-")[0]}function Ar(e){return e.split("-")[1]}function Bf(e){return e==="x"?"y":"x"}function qa(e){return e==="y"?"height":"width"}function Kn(e){return["top","bottom"].includes(mn(e))?"y":"x"}function Wa(e){return Bf(Kn(e))}function Pw(e,t,n){n===void 0&&(n=!1);const r=Ar(e),o=Wa(e),i=qa(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=pi(s)),[s,pi(s)]}function Rw(e){const t=pi(e);return[na(e),t,na(t)]}function na(e){return e.replace(/start|end/g,t=>Iw[t])}function Ow(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 Fw(e,t,n,r){const o=Ar(e);let i=Ow(mn(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(na)))),i}function pi(e){return e.replace(/left|right|bottom|top/g,t=>Mw[t])}function $w(e){return{top:0,right:0,bottom:0,left:0,...e}}function jf(e){return typeof e!="number"?$w(e):{top:e,right:e,bottom:e,left:e}}function mi(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function ic(e,t,n){let{reference:r,floating:o}=e;const i=Kn(t),s=Wa(t),a=qa(s),l=mn(t),c=i==="y",u=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[a]/2-o[a]/2;let h;switch(l){case"top":h={x:u,y:r.y-o.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-o.width,y:f};break;default:h={x:r.x,y:r.y}}switch(Ar(t)){case"start":h[s]-=d*(n&&c?-1:1);break;case"end":h[s]+=d*(n&&c?-1:1);break}return h}const Aw=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:f}=ic(c,r,l),d=r,h={},p=0;for(let g=0;g<a.length;g++){const{name:v,fn:m}=a[g],{x:y,y:b,data:S,reset:C}=await m({x:u,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:h,rects:c,platform:s,elements:{reference:e,floating:t}});u=y??u,f=b??f,h={...h,[v]:{...h[v],...S}},C&&p<=50&&(p++,typeof C=="object"&&(C.placement&&(d=C.placement),C.rects&&(c=C.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:u,y:f}=ic(c,d,l)),g=-1)}return{x:u,y:f,placement:d,strategy:o,middlewareData:h}};async function lo(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:f="floating",altBoundary:d=!1,padding:h=0}=Un(t,e),p=jf(h),v=a[d?f==="floating"?"reference":"floating":f],m=mi(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(v)))==null||n?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),y=f==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,b=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),S=await(i.isElement==null?void 0:i.isElement(b))?await(i.getScale==null?void 0:i.getScale(b))||{x:1,y:1}:{x:1,y:1},C=mi(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:b,strategy:l}):y);return{top:(m.top-C.top+p.top)/S.y,bottom:(C.bottom-m.bottom+p.bottom)/S.y,left:(m.left-C.left+p.left)/S.x,right:(C.right-m.right+p.right)/S.x}}const Tw=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}=Un(e,t)||{};if(c==null)return{};const f=jf(u),d={x:n,y:r},h=Wa(o),p=qa(h),g=await s.getDimensions(c),v=h==="y",m=v?"top":"left",y=v?"bottom":"right",b=v?"clientHeight":"clientWidth",S=i.reference[p]+i.reference[h]-d[h]-i.floating[p],C=d[h]-i.reference[h],R=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let D=R?R[b]:0;(!D||!await(s.isElement==null?void 0:s.isElement(R)))&&(D=a.floating[b]||i.floating[p]);const V=S/2-C/2,$=D/2-g[p]/2-1,k=pn(f[m],$),N=pn(f[y],$),B=k,ne=D-g[p]-N,I=D/2-g[p]/2+V,M=ta(B,I,ne),x=!l.arrow&&Ar(o)!=null&&I!==M&&i.reference[p]/2-(I<B?k:N)-g[p]/2<0,O=x?I<B?I-B:I-ne:0;return{[h]:d[h]+O,data:{[h]:M,centerOffset:I-M-O,...x&&{alignmentOffset:O}},reset:x}}}),Dw=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:f=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=!0,...v}=Un(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const m=mn(o),y=Kn(a),b=mn(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(c.floating)),C=d||(b||!g?[pi(a)]:Rw(a)),R=p!=="none";!d&&R&&C.push(...Fw(a,g,p,S));const D=[a,...C],V=await lo(t,v),$=[];let k=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&$.push(V[m]),f){const I=Pw(o,s,S);$.push(V[I[0]],V[I[1]])}if(k=[...k,{placement:o,overflows:$}],!$.every(I=>I<=0)){var N,B;const I=(((N=i.flip)==null?void 0:N.index)||0)+1,M=D[I];if(M)return{data:{index:I,overflows:k},reset:{placement:M}};let x=(B=k.filter(O=>O.overflows[0]<=0).sort((O,P)=>O.overflows[1]-P.overflows[1])[0])==null?void 0:B.placement;if(!x)switch(h){case"bestFit":{var ne;const O=(ne=k.filter(P=>{if(R){const A=Kn(P.placement);return A===y||A==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(A=>A>0).reduce((A,K)=>A+K,0)]).sort((P,A)=>P[1]-A[1])[0])==null?void 0:ne[0];O&&(x=O);break}case"initialPlacement":x=a;break}if(o!==x)return{reset:{placement:x}}}return{}}}};function sc(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ac(e){return Ew.some(t=>e[t]>=0)}const Lw=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Un(e,t);switch(r){case"referenceHidden":{const i=await lo(t,{...o,elementContext:"reference"}),s=sc(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:ac(s)}}}case"escaped":{const i=await lo(t,{...o,altBoundary:!0}),s=sc(i,n.floating);return{data:{escapedOffsets:s,escaped:ac(s)}}}default:return{}}}}};async function _w(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=mn(n),a=Ar(n),l=Kn(n)==="y",c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,f=Un(t,e);let{mainAxis:d,crossAxis:h,alignmentAxis:p}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof p=="number"&&(h=a==="end"?p*-1:p),l?{x:h*u,y:d*c}:{x:d*c,y:h*u}}const kw=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 _w(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}}}}},Vw=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:v=>{let{x:m,y}=v;return{x:m,y}}},...l}=Un(e,t),c={x:n,y:r},u=await lo(t,l),f=Kn(mn(o)),d=Bf(f);let h=c[d],p=c[f];if(i){const v=d==="y"?"top":"left",m=d==="y"?"bottom":"right",y=h+u[v],b=h-u[m];h=ta(y,h,b)}if(s){const v=f==="y"?"top":"left",m=f==="y"?"bottom":"right",y=p+u[v],b=p-u[m];p=ta(y,p,b)}const g=a.fn({...t,[d]:h,[f]:p});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[d]:i,[f]:s}}}}}},Nw=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=Un(e,t),u=await lo(t,c),f=mn(o),d=Ar(o),h=Kn(o)==="y",{width:p,height:g}=i.floating;let v,m;f==="top"||f==="bottom"?(v=f,m=d===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(m=f,v=d==="end"?"top":"bottom");const y=g-u.top-u.bottom,b=p-u.left-u.right,S=pn(g-u[v],y),C=pn(p-u[m],b),R=!t.middlewareData.shift;let D=S,V=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(V=b),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(D=y),R&&!d){const k=tt(u.left,0),N=tt(u.right,0),B=tt(u.top,0),ne=tt(u.bottom,0);h?V=p-2*(k!==0||N!==0?k+N:tt(u.left,u.right)):D=g-2*(B!==0||ne!==0?B+ne:tt(u.top,u.bottom))}await l({...t,availableWidth:V,availableHeight:D});const $=await s.getDimensions(a.floating);return p!==$.width||g!==$.height?{reset:{rects:!0}}:{}}}};function Ii(){return typeof window<"u"}function Tr(e){return Uf(e)?(e.nodeName||"").toLowerCase():"#document"}function rt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function $t(e){var t;return(t=(Uf(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Uf(e){return Ii()?e instanceof Node||e instanceof rt(e).Node:!1}function bt(e){return Ii()?e instanceof Element||e instanceof rt(e).Element:!1}function Ft(e){return Ii()?e instanceof HTMLElement||e instanceof rt(e).HTMLElement:!1}function lc(e){return!Ii()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof rt(e).ShadowRoot}function Mo(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=St(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Kw(e){return["table","td","th"].includes(Tr(e))}function Pi(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Qa(e){const t=Xa(),n=bt(e)?St(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 zw(e){let t=vn(e);for(;Ft(t)&&!br(t);){if(Qa(t))return t;if(Pi(t))return null;t=vn(t)}return null}function Xa(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function br(e){return["html","body","#document"].includes(Tr(e))}function St(e){return rt(e).getComputedStyle(e)}function Ri(e){return bt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function vn(e){if(Tr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||lc(e)&&e.host||$t(e);return lc(t)?t.host:t}function Hf(e){const t=vn(e);return br(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ft(t)&&Mo(t)?t:Hf(t)}function uo(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Hf(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=rt(o);if(i){const a=ra(s);return t.concat(s,s.visualViewport||[],Mo(o)?o:[],a&&n?uo(a):[])}return t.concat(o,uo(o,[],n))}function ra(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Gf(e){const t=St(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ft(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=gi(n)!==i||gi(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Ya(e){return bt(e)?e:e.contextElement}function rr(e){const t=Ya(e);if(!Ft(t))return Ot(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Gf(t);let s=(i?gi(n.width):n.width)/r,a=(i?gi(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Bw=Ot(0);function qf(e){const t=rt(e);return!Xa()||!t.visualViewport?Bw:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function jw(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==rt(e)?!1:t}function zn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Ya(e);let s=Ot(1);t&&(r?bt(r)&&(s=rr(r)):s=rr(e));const a=jw(i,n,r)?qf(i):Ot(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,f=o.height/s.y;if(i){const d=rt(i),h=r&&bt(r)?rt(r):r;let p=d,g=ra(p);for(;g&&r&&h!==p;){const v=rr(g),m=g.getBoundingClientRect(),y=St(g),b=m.left+(g.clientLeft+parseFloat(y.paddingLeft))*v.x,S=m.top+(g.clientTop+parseFloat(y.paddingTop))*v.y;l*=v.x,c*=v.y,u*=v.x,f*=v.y,l+=b,c+=S,p=rt(g),g=ra(p)}}return mi({width:u,height:f,x:l,y:c})}function Ja(e,t){const n=Ri(e).scrollLeft;return t?t.left+n:zn($t(e)).left+n}function Wf(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:Ja(e,r)),i=r.top+t.scrollTop;return{x:o,y:i}}function Uw(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=$t(r),a=t?Pi(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=Ot(1);const u=Ot(0),f=Ft(r);if((f||!f&&!i)&&((Tr(r)!=="body"||Mo(s))&&(l=Ri(r)),Ft(r))){const h=zn(r);c=rr(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}const d=s&&!f&&!i?Wf(s,l,!0):Ot(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+d.x,y:n.y*c.y-l.scrollTop*c.y+u.y+d.y}}function Hw(e){return Array.from(e.getClientRects())}function Gw(e){const t=$t(e),n=Ri(e),r=e.ownerDocument.body,o=tt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=tt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Ja(e);const a=-n.scrollTop;return St(r).direction==="rtl"&&(s+=tt(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function qw(e,t){const n=rt(e),r=$t(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=Xa();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}function Ww(e,t){const n=zn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Ft(e)?rr(e):Ot(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 uc(e,t,n){let r;if(t==="viewport")r=qw(e,n);else if(t==="document")r=Gw($t(e));else if(bt(t))r=Ww(t,n);else{const o=qf(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return mi(r)}function Qf(e,t){const n=vn(e);return n===t||!bt(n)||br(n)?!1:St(n).position==="fixed"||Qf(n,t)}function Qw(e,t){const n=t.get(e);if(n)return n;let r=uo(e,[],!1).filter(a=>bt(a)&&Tr(a)!=="body"),o=null;const i=St(e).position==="fixed";let s=i?vn(e):e;for(;bt(s)&&!br(s);){const a=St(s),l=Qa(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Mo(s)&&!l&&Qf(e,s))?r=r.filter(u=>u!==s):o=a,s=vn(s)}return t.set(e,r),r}function Xw(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?Pi(t)?[]:Qw(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const f=uc(t,u,o);return c.top=tt(f.top,c.top),c.right=pn(f.right,c.right),c.bottom=pn(f.bottom,c.bottom),c.left=tt(f.left,c.left),c},uc(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Yw(e){const{width:t,height:n}=Gf(e);return{width:t,height:n}}function Jw(e,t,n){const r=Ft(t),o=$t(t),i=n==="fixed",s=zn(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=Ot(0);if(r||!r&&!i)if((Tr(t)!=="body"||Mo(o))&&(a=Ri(t)),r){const d=zn(t,!0,i,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else o&&(l.x=Ja(o));const c=o&&!r&&!i?Wf(o,a):Ot(0),u=s.left+a.scrollLeft-l.x-c.x,f=s.top+a.scrollTop-l.y-c.y;return{x:u,y:f,width:s.width,height:s.height}}function Yi(e){return St(e).position==="static"}function cc(e,t){if(!Ft(e)||St(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return $t(e)===n&&(n=n.ownerDocument.body),n}function Xf(e,t){const n=rt(e);if(Pi(e))return n;if(!Ft(e)){let o=vn(e);for(;o&&!br(o);){if(bt(o)&&!Yi(o))return o;o=vn(o)}return n}let r=cc(e,t);for(;r&&Kw(r)&&Yi(r);)r=cc(r,t);return r&&br(r)&&Yi(r)&&!Qa(r)?n:r||zw(e)||n}const Zw=async function(e){const t=this.getOffsetParent||Xf,n=this.getDimensions,r=await n(e.floating);return{reference:Jw(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function eb(e){return St(e).direction==="rtl"}const Yf={convertOffsetParentRelativeRectToViewportRelativeRect:Uw,getDocumentElement:$t,getClippingRect:Xw,getOffsetParent:Xf,getElementRects:Zw,getClientRects:Hw,getDimensions:Yw,getScale:rr,isElement:bt,isRTL:eb};function tb(e,t){let n=null,r;const o=$t(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:f,height:d}=e.getBoundingClientRect();if(a||t(),!f||!d)return;const h=Ko(u),p=Ko(o.clientWidth-(c+f)),g=Ko(o.clientHeight-(u+d)),v=Ko(c),y={rootMargin:-h+"px "+-p+"px "+-g+"px "+-v+"px",threshold:tt(0,pn(1,l))||1};let b=!0;function S(C){const R=C[0].intersectionRatio;if(R!==l){if(!b)return s();R?s(!1,R):r=setTimeout(()=>{s(!1,1e-7)},1e3)}b=!1}try{n=new IntersectionObserver(S,{...y,root:o.ownerDocument})}catch{n=new IntersectionObserver(S,y)}n.observe(e)}return s(!0),i}function nb(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=Ya(e),u=o||i?[...c?uo(c):[],...uo(t)]:[];u.forEach(m=>{o&&m.addEventListener("scroll",n,{passive:!0}),i&&m.addEventListener("resize",n)});const f=c&&a?tb(c,n):null;let d=-1,h=null;s&&(h=new ResizeObserver(m=>{let[y]=m;y&&y.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var b;(b=h)==null||b.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let p,g=l?zn(e):null;l&&v();function v(){const m=zn(e);g&&(m.x!==g.x||m.y!==g.y||m.width!==g.width||m.height!==g.height)&&n(),g=m,p=requestAnimationFrame(v)}return n(),()=>{var m;u.forEach(y=>{o&&y.removeEventListener("scroll",n),i&&y.removeEventListener("resize",n)}),f==null||f(),(m=h)==null||m.disconnect(),h=null,l&&cancelAnimationFrame(p)}}const rb=kw,ob=Vw,ib=Dw,sb=Nw,ab=Lw,lb=Tw,ub=(e,t,n)=>{const r=new Map,o={platform:Yf,...n},i={...o.platform,_c:r};return Aw(e,t,{...o,platform:i})};var cb=te('<svg display=block viewBox="0 0 30 30"style=transform:scale(1.02)><g><path fill=none d=M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z></path><path stroke=none d=M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z>'),Za=Ce();function el(){const e=xe(Za);if(e===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}var oa=30,dc=oa/2,db={top:180,right:-90,bottom:0,left:90};function Dr(e){const t=el(),n=Z({size:oa},e),[r,o]=_(n,["ref","style","size"]),i=()=>t.currentPlacement().split("-")[0],s=fb(t.contentRef),a=()=>{var d;return((d=s())==null?void 0:d.getPropertyValue("background-color"))||"none"},l=()=>{var d;return((d=s())==null?void 0:d.getPropertyValue(`border-${i()}-color`))||"none"},c=()=>{var d;return((d=s())==null?void 0:d.getPropertyValue(`border-${i()}-width`))||"0px"},u=()=>Number.parseInt(c())*2*(oa/r.size),f=()=>`rotate(${db[i()]} ${dc} ${dc}) translate(0 2)`;return w(le,F({as:"div",ref(d){var h=me(t.setArrowRef,r.ref);typeof h=="function"&&h(d)},"aria-hidden":"true",get style(){return ct({position:"absolute","font-size":`${r.size}px`,width:"1em",height:"1em","pointer-events":"none",fill:a(),stroke:l(),"stroke-width":u()},r.style)}},o,{get children(){var d=cb(),h=d.firstChild,p=h.firstChild;return p.nextSibling,Ve(()=>Ln(h,"transform",f())),d}}))}function fb(e){const[t,n]=z();return j(()=>{const r=e();r&&n(Ra(r).getComputedStyle(r))}),t}function hb(e){const t=el(),[n,r]=_(e,["ref","style"]);return w(le,F({as:"div",ref(o){var i=me(t.setPositionerRef,n.ref);typeof i=="function"&&i(o)},"data-popper-positioner":"",get style(){return ct({position:"absolute",top:0,left:0,"min-width":"max-content"},n.style)}},r))}function fc(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 gb(e,t){return{contextElement:e,getBoundingClientRect:()=>{const r=t(e);return r?fc(r):e?e.getBoundingClientRect():fc()}}}function pb(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}var mb={top:"bottom",right:"left",bottom:"top",left:"right"};function vb(e,t){const[n,r]=e.split("-"),o=mb[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 yb(e){const t=Z({getAnchorRect:d=>d==null?void 0:d.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]=z(),[o,i]=z(),[s,a]=z(t.placement),l=()=>{var d;return gb((d=t.anchorRef)==null?void 0:d.call(t),t.getAnchorRect)},{direction:c}=xn();async function u(){var R,D;const d=l(),h=n(),p=o();if(!d||!h)return;const g=((p==null?void 0:p.clientHeight)||0)/2,v=typeof t.gutter=="number"?t.gutter+g:t.gutter??g;h.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),d.getBoundingClientRect();const m=[rb(({placement:V})=>{const $=!!V.split("-")[1];return{mainAxis:v,crossAxis:$?void 0:t.shift,alignmentAxis:t.shift}})];if(t.flip!==!1){const V=typeof t.flip=="string"?t.flip.split(" "):void 0;if(V!==void 0&&!V.every(pb))throw new Error("`flip` expects a spaced-delimited list of placements");m.push(ib({padding:t.overflowPadding,fallbackPlacements:V}))}(t.slide||t.overlap)&&m.push(ob({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),m.push(sb({padding:t.overflowPadding,apply({availableWidth:V,availableHeight:$,rects:k}){const N=Math.round(k.reference.width);V=Math.floor(V),$=Math.floor($),h.style.setProperty("--kb-popper-anchor-width",`${N}px`),h.style.setProperty("--kb-popper-content-available-width",`${V}px`),h.style.setProperty("--kb-popper-content-available-height",`${$}px`),t.sameWidth&&(h.style.width=`${N}px`),t.fitViewport&&(h.style.maxWidth=`${V}px`,h.style.maxHeight=`${$}px`)}})),t.hideWhenDetached&&m.push(ab({padding:t.detachedPadding})),p&&m.push(lb({element:p,padding:t.arrowPadding}));const y=await ub(d,h,{placement:t.placement,strategy:"absolute",middleware:m,platform:{...Yf,isRTL:()=>c()==="rtl"}});if(a(y.placement),(R=t.onCurrentPlacementChange)==null||R.call(t,y.placement),!h)return;h.style.setProperty("--kb-popper-content-transform-origin",vb(y.placement,c()));const b=Math.round(y.x),S=Math.round(y.y);let C;if(t.hideWhenDetached&&(C=(D=y.middlewareData.hide)!=null&&D.referenceHidden?"hidden":"visible"),Object.assign(h.style,{top:"0",left:"0",transform:`translate3d(${b}px, ${S}px, 0)`,visibility:C}),p&&y.middlewareData.arrow){const{x:V,y:$}=y.middlewareData.arrow,k=y.placement.split("-")[0];Object.assign(p.style,{left:V!=null?`${V}px`:"",top:$!=null?`${$}px`:"",[k]:"100%"})}}j(()=>{const d=l(),h=n();if(!d||!h)return;const p=nb(d,h,u,{elementResize:typeof ResizeObserver=="function"});Y(p)}),j(()=>{var p;const d=n(),h=(p=t.contentRef)==null?void 0:p.call(t);!d||!h||queueMicrotask(()=>{d.style.zIndex=getComputedStyle(h).zIndex})});const f={currentPlacement:s,contentRef:()=>{var d;return(d=t.contentRef)==null?void 0:d.call(t)},setPositionerRef:r,setArrowRef:i};return w(Za.Provider,{value:f,get children(){return t.children}})}var Cn=Object.assign(yb,{Arrow:Dr,Context:Za,usePopperContext:el,Positioner:hb}),wb={};dt(wb,{Arrow:()=>Dr,Content:()=>tl,Portal:()=>nl,Root:()=>rl,Tooltip:()=>xb,Trigger:()=>ol,useTooltipContext:()=>Oi});var Jf=Ce();function Oi(){const e=xe(Jf);if(e===void 0)throw new Error("[kobalte]: `useTooltipContext` must be used within a `Tooltip` component");return e}function tl(e){const t=Oi(),n=Z({id:t.generateId("content")},e),[r,o]=_(n,["ref","style"]);return j(()=>Y(t.registerContentId(o.id))),w(de,{get when(){return t.contentPresent()},get children(){return w(Cn.Positioner,{get children(){return w(xo,F({ref(i){var s=me(a=>{t.setContentRef(a)},r.ref);typeof s=="function"&&s(i)},role:"tooltip",disableOutsidePointerEvents:!1,get style(){return ct({"--kb-tooltip-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},r.style)},onFocusOutside:i=>i.preventDefault(),onDismiss:()=>t.hideTooltip(!0)},()=>t.dataset(),o))}})}})}function nl(e){const t=Oi();return w(de,{get when(){return t.contentPresent()},get children(){return w(mo,e)}})}function bb(e,t,n){const r=e.split("-")[0],o=t.getBoundingClientRect(),i=n.getBoundingClientRect(),s=[],a=o.left+o.width/2,l=o.top+o.height/2;switch(r){case"top":s.push([o.left,l]),s.push([i.left,i.bottom]),s.push([i.left,i.top]),s.push([i.right,i.top]),s.push([i.right,i.bottom]),s.push([o.right,l]);break;case"right":s.push([a,o.top]),s.push([i.left,i.top]),s.push([i.right,i.top]),s.push([i.right,i.bottom]),s.push([i.left,i.bottom]),s.push([a,o.bottom]);break;case"bottom":s.push([o.left,l]),s.push([i.left,i.top]),s.push([i.left,i.bottom]),s.push([i.right,i.bottom]),s.push([i.right,i.top]),s.push([o.right,l]);break;case"left":s.push([a,o.top]),s.push([i.right,i.top]),s.push([i.left,i.top]),s.push([i.left,i.bottom]),s.push([i.right,i.bottom]),s.push([a,o.bottom]);break}return s}var En={},Sb=0,Qn=!1,Dt,Br,Xn;function rl(e){const t=`tooltip-${Ie()}`,n=`${++Sb}`,r=Z({id:t,openDelay:700,closeDelay:300,skipDelayDuration:300},e),[o,i]=_(r,["id","open","defaultOpen","onOpenChange","disabled","triggerOnFocusOnly","openDelay","closeDelay","skipDelayDuration","ignoreSafeArea","forceMount"]);let s;const[a,l]=z(),[c,u]=z(),[f,d]=z(),[h,p]=z(i.placement),g=Co({open:()=>o.open,defaultOpen:()=>o.defaultOpen,onOpenChange:I=>{var M;return(M=o.onOpenChange)==null?void 0:M.call(o,I)}}),{present:v}=Vn({show:()=>o.forceMount||g.isOpen(),element:()=>f()??null}),m=()=>{En[n]=b},y=()=>{for(const I in En)I!==n&&(En[I](!0),delete En[I])},b=(I=!1)=>{I||o.closeDelay&&o.closeDelay<=0?(window.clearTimeout(s),s=void 0,g.close()):s||(s=window.setTimeout(()=>{s=void 0,g.close()},o.closeDelay)),window.clearTimeout(Dt),Dt=void 0,o.skipDelayDuration&&o.skipDelayDuration>=0&&(Xn=window.setTimeout(()=>{window.clearTimeout(Xn),Xn=void 0},o.skipDelayDuration)),Qn&&(window.clearTimeout(Br),Br=window.setTimeout(()=>{delete En[n],Br=void 0,Qn=!1},o.closeDelay))},S=()=>{clearTimeout(s),s=void 0,y(),m(),Qn=!0,g.open(),window.clearTimeout(Dt),Dt=void 0,window.clearTimeout(Br),Br=void 0,window.clearTimeout(Xn),Xn=void 0},C=()=>{y(),m(),!g.isOpen()&&!Dt&&!Qn?Dt=window.setTimeout(()=>{Dt=void 0,Qn=!0,S()},o.openDelay):g.isOpen()||S()},R=(I=!1)=>{!I&&o.openDelay&&o.openDelay>0&&!s&&!Xn?C():S()},D=()=>{window.clearTimeout(Dt),Dt=void 0,Qn=!1},V=()=>{window.clearTimeout(s),s=void 0},$=I=>$e(c(),I)||$e(f(),I),k=I=>{const M=c(),x=f();if(!(!M||!x))return bb(I,M,x)},N=I=>{const M=I.target;if($(M)){V();return}if(!o.ignoreSafeArea){const x=k(h());if(x&&hf(Wm(I),x)){V();return}}s||b()};j(()=>{if(!g.isOpen())return;const I=We();I.addEventListener("pointermove",N,!0),Y(()=>{I.removeEventListener("pointermove",N,!0)})}),j(()=>{const I=c();if(!I||!g.isOpen())return;const M=O=>{const P=O.target;$e(P,I)&&b(!0)},x=Ra();x.addEventListener("scroll",M,{capture:!0}),Y(()=>{x.removeEventListener("scroll",M,{capture:!0})})}),Y(()=>{clearTimeout(s),En[n]&&delete En[n]});const ne={dataset:L(()=>({"data-expanded":g.isOpen()?"":void 0,"data-closed":g.isOpen()?void 0:""})),isOpen:g.isOpen,isDisabled:()=>o.disabled??!1,triggerOnFocusOnly:()=>o.triggerOnFocusOnly??!1,contentId:a,contentPresent:v,openTooltip:R,hideTooltip:b,cancelOpening:D,generateId:Ye(()=>r.id),registerContentId:_e(l),isTargetOnTooltip:$,setTriggerRef:u,setContentRef:d};return w(Jf.Provider,{value:ne,get children(){return w(Cn,F({anchorRef:c,contentRef:f,onCurrentPlacementChange:p},i))}})}function ol(e){let t;const n=Oi(),[r,o]=_(e,["ref","onPointerEnter","onPointerLeave","onPointerDown","onClick","onFocus","onBlur"]);let i=!1,s=!1,a=!1;const l=()=>{i=!1},c=()=>{!n.isOpen()&&(s||a)&&n.openTooltip(a)},u=m=>{n.isOpen()&&!s&&!a&&n.hideTooltip(m)},f=m=>{ee(m,r.onPointerEnter),!(m.pointerType==="touch"||n.triggerOnFocusOnly()||n.isDisabled()||m.defaultPrevented)&&(s=!0,c())},d=m=>{ee(m,r.onPointerLeave),m.pointerType!=="touch"&&(s=!1,a=!1,n.isOpen()?u():n.cancelOpening())},h=m=>{ee(m,r.onPointerDown),i=!0,We(t).addEventListener("pointerup",l,{once:!0})},p=m=>{ee(m,r.onClick),s=!1,a=!1,u(!0)},g=m=>{ee(m,r.onFocus),!(n.isDisabled()||m.defaultPrevented||i)&&(a=!0,c())},v=m=>{ee(m,r.onBlur);const y=m.relatedTarget;n.isTargetOnTooltip(y)||(s=!1,a=!1,u(!0))};return Y(()=>{We(t).removeEventListener("pointerup",l)}),w(le,F({as:"button",ref(m){var y=me(b=>{n.setTriggerRef(b),t=b},r.ref);typeof y=="function"&&y(m)},get"aria-describedby"(){return L(()=>!!n.isOpen())()?n.contentId():void 0},onPointerEnter:f,onPointerLeave:d,onPointerDown:h,onClick:p,onFocus:g,onBlur:v},()=>n.dataset(),o))}var xb=Object.assign(rl,{Arrow:Dr,Content:tl,Portal:nl,Trigger:ol});const hc=ol,gc=e=>w(rl,F({gutter:4},e)),pc=e=>{const[t,n]=_(e,["class"]);return w(nl,{get children(){return w(tl,F({get class(){return ce("z-50 origin-[var(--kb-popover-content-transform-origin)] overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95",t.class)}},n))}})},Cb=e=>{const t=e.split("-").join("").slice(0,12);return Number.parseInt(t,16)},Eb=e=>{const n=e.split("-").join("").slice(0,12),r=new Uint8Array(10);crypto.getRandomValues(r);const o=Array.from(r).map(f=>f.toString(16).padStart(2,"0")).join(""),i=o.slice(0,3),s=o.slice(3,19),a=`7${i}`,c=(128|parseInt(s.slice(0,2),16)&63).toString(16).padStart(2,"0");return[n.slice(0,8),n.slice(8,12),a,c+s.slice(2,4),s.slice(4,16)].join("-")};var mc=te("<p>"),Mb=te('<div class="flex flex-row items-center">iOS'),Ib=te('<div class="flex flex-row items-center">Android'),jr=te('<div class="flex flex-row items-center">'),Pb=te('<span class="ml-2 text-muted-foreground">(<!>)');const Rb=[{accessorKey:"id",header:"ID",cell:e=>w(gc,{openDelay:0,closeDelay:0,get children(){return[w(hc,{get children(){return e.row.original.id.slice(-12)}}),w(pc,{get children(){var t=mc();return W(t,()=>e.row.original.id),t}})]}})},{accessorKey:"channel",header:"Channel",cell:e=>e.getValue()},{accessorKey:"platform",header:"Platform",cell:e=>{switch(e.getValue()){case"ios":return(()=>{var t=Mb(),n=t.firstChild;return W(t,w(Nf,{class:"mr-2",size:16}),n),t})();case"android":return(()=>{var t=Ib(),n=t.firstChild;return W(t,w(Vf,{class:"mr-2",size:16,color:"#3DDC84"}),n),t})()}}},{header:"Target",cell:e=>e.row.original.targetAppVersion?(()=>{var t=jr();return W(t,w(dw,{class:"mr-2",size:16}),null),W(t,()=>e.row.original.targetAppVersion,null),t})():e.row.original.fingerprintHash?w(gc,{openDelay:0,closeDelay:0,get children(){return[w(hc,{class:"flex flex-row items-center",get children(){return[w(rw,{class:"mr-2",size:16}),L(()=>e.row.original.fingerprintHash.slice(0,8)),w(de,{get when(){var t;return(t=e.row.original.metadata)==null?void 0:t.app_version},get children(){var t=Pb(),n=t.firstChild,r=n.nextSibling;return r.nextSibling,W(t,()=>{var o;return(o=e.row.original.metadata)==null?void 0:o.app_version},r),t}})]}}),w(pc,{get children(){var t=mc();return W(t,()=>e.row.original.fingerprintHash),t}})]}}):"N/A"},{accessorKey:"enabled",header:"Enabled",cell:e=>e.getValue()?(()=>{var t=jr();return W(t,w(ec,{class:"text-green-500"})),t})():(()=>{var t=jr();return W(t,w(rc,{class:"text-red-500"})),t})()},{accessorKey:"shouldForceUpdate",header:"Force Update",cell:e=>e.getValue()?(()=>{var t=jr();return W(t,w(ec,{class:"text-green-500"})),t})():(()=>{var t=jr();return W(t,w(rc,{class:"text-red-500"})),t})()},{accessorKey:"message",header:"Message",cell:e=>e.getValue()},{accessorKey:"id",header:"Created At",cell:e=>qy(Cb(String(e.getValue()))).format("YYYY-MM-DD HH:mm:ss")}];/**
7
+ * table-core
8
+ *
9
+ * Copyright (c) TanStack
10
+ *
11
+ * This source code is licensed under the MIT license found in the
12
+ * LICENSE.md file in the root directory of this source tree.
13
+ *
14
+ * @license MIT
15
+ */function cn(e,t){return typeof e=="function"?e(t):e}function ot(e,t){return n=>{t.setState(r=>({...r,[e]:cn(n,r[e])}))}}function Fi(e){return e instanceof Function}function Ob(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function Fb(e,t){const n=[],r=o=>{o.forEach(i=>{n.push(i);const s=t(i);s!=null&&s.length&&r(s)})};return r(e),n}function se(e,t,n){let r=[],o;return i=>{let s;n.key&&n.debug&&(s=Date.now());const a=e(i);if(!(a.length!==r.length||a.some((u,f)=>r[f]!==u)))return o;r=a;let c;if(n.key&&n.debug&&(c=Date.now()),o=t(...a),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const u=Math.round((Date.now()-s)*100)/100,f=Math.round((Date.now()-c)*100)/100,d=f/16,h=(p,g)=>{for(p=String(p);p.length<g;)p=" "+p;return p};console.info(`%c⏱ ${h(f,5)} /${h(u,5)} ms`,`
16
+ font-size: .6rem;
17
+ font-weight: bold;
18
+ color: hsl(${Math.max(0,Math.min(120-120*d,120))}deg 100% 31%);`,n==null?void 0:n.key)}return o}}function ae(e,t,n,r){return{debug:()=>{var o;return(o=e==null?void 0:e.debugAll)!=null?o:e[t]},key:!1,onChange:r}}function $b(e,t,n,r){const o=()=>{var s;return(s=i.getValue())!=null?s:e.options.renderFallbackValue},i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:o,getContext:se(()=>[e,n,t,i],(s,a,l,c)=>({table:s,column:a,row:l,cell:c,getValue:c.getValue,renderValue:c.renderValue}),ae(e.options,"debugCells"))};return e._features.forEach(s=>{s.createCell==null||s.createCell(i,n,t,e)},{}),i}function Ab(e,t,n,r){var o,i;const a={...e._getDefaultColumnDef(),...t},l=a.accessorKey;let c=(o=(i=a.id)!=null?i:l?typeof String.prototype.replaceAll=="function"?l.replaceAll(".","_"):l.replace(/\./g,"_"):void 0)!=null?o:typeof a.header=="string"?a.header:void 0,u;if(a.accessorFn?u=a.accessorFn:l&&(l.includes(".")?u=d=>{let h=d;for(const g of l.split(".")){var p;h=(p=h)==null?void 0:p[g]}return h}:u=d=>d[a.accessorKey]),!c)throw new Error;let f={id:`${String(c)}`,accessorFn:u,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:se(()=>[!0],()=>{var d;return[f,...(d=f.columns)==null?void 0:d.flatMap(h=>h.getFlatColumns())]},ae(e.options,"debugColumns")),getLeafColumns:se(()=>[e._getOrderColumnsFn()],d=>{var h;if((h=f.columns)!=null&&h.length){let p=f.columns.flatMap(g=>g.getLeafColumns());return d(p)}return[f]},ae(e.options,"debugColumns"))};for(const d of e._features)d.createColumn==null||d.createColumn(f,e);return f}const Ne="debugHeaders";function vc(e,t,n){var r;let i={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const s=[],a=l=>{l.subHeaders&&l.subHeaders.length&&l.subHeaders.map(a),s.push(l)};return a(i),s},getContext:()=>({table:e,header:i,column:t})};return e._features.forEach(s=>{s.createHeader==null||s.createHeader(i,e)}),i}const Tb={createTable:e=>{e.getHeaderGroups=se(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>{var i,s;const a=(i=r==null?void 0:r.map(f=>n.find(d=>d.id===f)).filter(Boolean))!=null?i:[],l=(s=o==null?void 0:o.map(f=>n.find(d=>d.id===f)).filter(Boolean))!=null?s:[],c=n.filter(f=>!(r!=null&&r.includes(f.id))&&!(o!=null&&o.includes(f.id)));return zo(t,[...a,...c,...l],e)},ae(e.options,Ne)),e.getCenterHeaderGroups=se(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>(n=n.filter(i=>!(r!=null&&r.includes(i.id))&&!(o!=null&&o.includes(i.id))),zo(t,n,e,"center")),ae(e.options,Ne)),e.getLeftHeaderGroups=se(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var o;const i=(o=r==null?void 0:r.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?o:[];return zo(t,i,e,"left")},ae(e.options,Ne)),e.getRightHeaderGroups=se(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var o;const i=(o=r==null?void 0:r.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?o:[];return zo(t,i,e,"right")},ae(e.options,Ne)),e.getFooterGroups=se(()=>[e.getHeaderGroups()],t=>[...t].reverse(),ae(e.options,Ne)),e.getLeftFooterGroups=se(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),ae(e.options,Ne)),e.getCenterFooterGroups=se(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),ae(e.options,Ne)),e.getRightFooterGroups=se(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),ae(e.options,Ne)),e.getFlatHeaders=se(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),ae(e.options,Ne)),e.getLeftFlatHeaders=se(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),ae(e.options,Ne)),e.getCenterFlatHeaders=se(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),ae(e.options,Ne)),e.getRightFlatHeaders=se(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),ae(e.options,Ne)),e.getCenterLeafHeaders=se(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ae(e.options,Ne)),e.getLeftLeafHeaders=se(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ae(e.options,Ne)),e.getRightLeafHeaders=se(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ae(e.options,Ne)),e.getLeafHeaders=se(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var o,i,s,a,l,c;return[...(o=(i=t[0])==null?void 0:i.headers)!=null?o:[],...(s=(a=n[0])==null?void 0:a.headers)!=null?s:[],...(l=(c=r[0])==null?void 0:c.headers)!=null?l:[]].map(u=>u.getLeafHeaders()).flat()},ae(e.options,Ne))}};function zo(e,t,n,r){var o,i;let s=0;const a=function(d,h){h===void 0&&(h=1),s=Math.max(s,h),d.filter(p=>p.getIsVisible()).forEach(p=>{var g;(g=p.columns)!=null&&g.length&&a(p.columns,h+1)},0)};a(e);let l=[];const c=(d,h)=>{const p={depth:h,id:[r,`${h}`].filter(Boolean).join("_"),headers:[]},g=[];d.forEach(v=>{const m=[...g].reverse()[0],y=v.column.depth===p.depth;let b,S=!1;if(y&&v.column.parent?b=v.column.parent:(b=v.column,S=!0),m&&(m==null?void 0:m.column)===b)m.subHeaders.push(v);else{const C=vc(n,b,{id:[r,h,b.id,v==null?void 0:v.id].filter(Boolean).join("_"),isPlaceholder:S,placeholderId:S?`${g.filter(R=>R.column===b).length}`:void 0,depth:h,index:g.length});C.subHeaders.push(v),g.push(C)}p.headers.push(v),v.headerGroup=p}),l.push(p),h>0&&c(g,h-1)},u=t.map((d,h)=>vc(n,d,{depth:s,index:h}));c(u,s-1),l.reverse();const f=d=>d.filter(p=>p.column.getIsVisible()).map(p=>{let g=0,v=0,m=[0];p.subHeaders&&p.subHeaders.length?(m=[],f(p.subHeaders).forEach(b=>{let{colSpan:S,rowSpan:C}=b;g+=S,m.push(C)})):g=1;const y=Math.min(...m);return v=v+y,p.colSpan=g,p.rowSpan=v,{colSpan:g,rowSpan:v}});return f((o=(i=l[0])==null?void 0:i.headers)!=null?o:[]),l}const il=(e,t,n,r,o,i,s)=>{let a={id:t,index:r,original:n,depth:o,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:l=>{if(a._valuesCache.hasOwnProperty(l))return a._valuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return a._valuesCache[l]=c.accessorFn(a.original,r),a._valuesCache[l]},getUniqueValues:l=>{if(a._uniqueValuesCache.hasOwnProperty(l))return a._uniqueValuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return c.columnDef.getUniqueValues?(a._uniqueValuesCache[l]=c.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[l]):(a._uniqueValuesCache[l]=[a.getValue(l)],a._uniqueValuesCache[l])},renderValue:l=>{var c;return(c=a.getValue(l))!=null?c:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>Fb(a.subRows,l=>l.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let l=[],c=a;for(;;){const u=c.getParentRow();if(!u)break;l.push(u),c=u}return l.reverse()},getAllCells:se(()=>[e.getAllLeafColumns()],l=>l.map(c=>$b(e,a,c,c.id)),ae(e.options,"debugRows")),_getAllCellsByColumnId:se(()=>[a.getAllCells()],l=>l.reduce((c,u)=>(c[u.column.id]=u,c),{}),ae(e.options,"debugRows"))};for(let l=0;l<e._features.length;l++){const c=e._features[l];c==null||c.createRow==null||c.createRow(a,e)}return a},Db={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},Zf=(e,t,n)=>{var r,o;const i=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((o=e.getValue(t))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(i))};Zf.autoRemove=e=>mt(e);const eh=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};eh.autoRemove=e=>mt(e);const th=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===(n==null?void 0:n.toLowerCase())};th.autoRemove=e=>mt(e);const nh=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};nh.autoRemove=e=>mt(e);const rh=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});rh.autoRemove=e=>mt(e)||!(e!=null&&e.length);const oh=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});oh.autoRemove=e=>mt(e)||!(e!=null&&e.length);const ih=(e,t,n)=>e.getValue(t)===n;ih.autoRemove=e=>mt(e);const sh=(e,t,n)=>e.getValue(t)==n;sh.autoRemove=e=>mt(e);const sl=(e,t,n)=>{let[r,o]=n;const i=e.getValue(t);return i>=r&&i<=o};sl.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,o=typeof n!="number"?parseFloat(n):n,i=t===null||Number.isNaN(r)?-1/0:r,s=n===null||Number.isNaN(o)?1/0:o;if(i>s){const a=i;i=s,s=a}return[i,s]};sl.autoRemove=e=>mt(e)||mt(e[0])&&mt(e[1]);const _t={includesString:Zf,includesStringSensitive:eh,equalsString:th,arrIncludes:nh,arrIncludesAll:rh,arrIncludesSome:oh,equals:ih,weakEquals:sh,inNumberRange:sl};function mt(e){return e==null||e===""}const Lb={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:ot("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);return typeof r=="string"?_t.includesString:typeof r=="number"?_t.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?_t.equals:Array.isArray(r)?_t.arrIncludes:_t.weakEquals},e.getFilterFn=()=>{var n,r;return Fi(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:_t[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,o;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const o=e.getFilterFn(),i=r==null?void 0:r.find(u=>u.id===e.id),s=cn(n,i?i.value:void 0);if(yc(o,s,e)){var a;return(a=r==null?void 0:r.filter(u=>u.id!==e.id))!=null?a:[]}const l={id:e.id,value:s};if(i){var c;return(c=r==null?void 0:r.map(u=>u.id===e.id?l:u))!=null?c:[]}return r!=null&&r.length?[...r,l]:[l]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=o=>{var i;return(i=cn(t,o))==null?void 0:i.filter(s=>{const a=n.find(l=>l.id===s.id);if(a){const l=a.getFilterFn();if(yc(l,s.value,a))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function yc(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const _b=(e,t,n)=>n.reduce((r,o)=>{const i=o.getValue(e);return r+(typeof i=="number"?i:0)},0),kb=(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}),r},Vb=(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r<i||r===void 0&&i>=i)&&(r=i)}),r},Nb=(e,t,n)=>{let r,o;return n.forEach(i=>{const s=i.getValue(e);s!=null&&(r===void 0?s>=s&&(r=o=s):(r>s&&(r=s),o<s&&(o=s)))}),[r,o]},Kb=(e,t)=>{let n=0,r=0;if(t.forEach(o=>{let i=o.getValue(e);i!=null&&(i=+i)>=i&&(++n,r+=i)}),n)return r/n},zb=(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!Ob(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),o=n.sort((i,s)=>i-s);return n.length%2!==0?o[r]:(o[r-1]+o[r])/2},Bb=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),jb=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,Ub=(e,t)=>t.length,Ji={sum:_b,min:kb,max:Vb,extent:Nb,mean:Kb,median:zb,unique:Bb,uniqueCount:jb,count:Ub},Hb={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:ot("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);if(typeof r=="number")return Ji.sum;if(Object.prototype.toString.call(r)==="[object Date]")return Ji.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return Fi(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:Ji[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var o;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((o=n.subRows)!=null&&o.length)}}};function Gb(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(i=>!t.includes(i.id));return n==="remove"?r:[...t.map(i=>e.find(s=>s.id===i)).filter(Boolean),...r]}const qb={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:ot("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=se(n=>[Zr(t,n)],n=>n.findIndex(r=>r.id===e.id),ae(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=Zr(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=Zr(t,n);return((r=o[o.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=se(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>o=>{let i=[];if(!(t!=null&&t.length))i=o;else{const s=[...t],a=[...o];for(;a.length&&s.length;){const l=s.shift(),c=a.findIndex(u=>u.id===l);c>-1&&i.push(a.splice(c,1)[0])}i=[...i,...a]}return Gb(i,n,r)},ae(e.options,"debugTable"))}},Zi=()=>({left:[],right:[]}),Wb={getInitialState:e=>({columnPinning:Zi(),...e}),getDefaultOptions:e=>({onColumnPinningChange:ot("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(o=>o.id).filter(Boolean);t.setColumnPinning(o=>{var i,s;if(n==="right"){var a,l;return{left:((a=o==null?void 0:o.left)!=null?a:[]).filter(f=>!(r!=null&&r.includes(f))),right:[...((l=o==null?void 0:o.right)!=null?l:[]).filter(f=>!(r!=null&&r.includes(f))),...r]}}if(n==="left"){var c,u;return{left:[...((c=o==null?void 0:o.left)!=null?c:[]).filter(f=>!(r!=null&&r.includes(f))),...r],right:((u=o==null?void 0:o.right)!=null?u:[]).filter(f=>!(r!=null&&r.includes(f)))}}return{left:((i=o==null?void 0:o.left)!=null?i:[]).filter(f=>!(r!=null&&r.includes(f))),right:((s=o==null?void 0:o.right)!=null?s:[]).filter(f=>!(r!=null&&r.includes(f)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var o,i,s;return((o=r.columnDef.enablePinning)!=null?o:!0)&&((i=(s=t.options.enableColumnPinning)!=null?s:t.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(a=>a.id),{left:r,right:o}=t.getState().columnPinning,i=n.some(a=>r==null?void 0:r.includes(a)),s=n.some(a=>o==null?void 0:o.includes(a));return i?"left":s?"right":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();return o?(n=(r=t.getState().columnPinning)==null||(r=r[o])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=se(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,o)=>{const i=[...r??[],...o??[]];return n.filter(s=>!i.includes(s.column.id))},ae(t.options,"debugRows")),e.getLeftVisibleCells=se(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),ae(t.options,"debugRows")),e.getRightVisibleCells=se(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),ae(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?Zi():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:Zi())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var o,i;return!!((o=r.left)!=null&&o.length||(i=r.right)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=se(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),ae(e.options,"debugColumns")),e.getRightLeafColumns=se(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),ae(e.options,"debugColumns")),e.getCenterLeafColumns=se(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const o=[...n??[],...r??[]];return t.filter(i=>!o.includes(i.id))},ae(e.options,"debugColumns"))}};function Qb(e){return e||(typeof document<"u"?document:null)}const Bo={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},es=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),Xb={getDefaultColumnDef:()=>Bo,getInitialState:e=>({columnSizing:{},columnSizingInfo:es(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:ot("columnSizing",e),onColumnSizingInfoChange:ot("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,o;const i=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Bo.minSize,(r=i??e.columnDef.size)!=null?r:Bo.size),(o=e.columnDef.maxSize)!=null?o:Bo.maxSize)},e.getStart=se(n=>[n,Zr(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((o,i)=>o+i.getSize(),0),ae(t.options,"debugColumns")),e.getAfter=se(n=>[n,Zr(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((o,i)=>o+i.getSize(),0),ae(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...o}=n;return o})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=o=>{if(o.subHeaders.length)o.subHeaders.forEach(r);else{var i;n+=(i=o.column.getSize())!=null?i:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),o=r==null?void 0:r.getCanResize();return i=>{if(!r||!o||(i.persist==null||i.persist(),ts(i)&&i.touches&&i.touches.length>1))return;const s=e.getSize(),a=e?e.getLeafHeaders().map(m=>[m.column.id,m.column.getSize()]):[[r.id,r.getSize()]],l=ts(i)?Math.round(i.touches[0].clientX):i.clientX,c={},u=(m,y)=>{typeof y=="number"&&(t.setColumnSizingInfo(b=>{var S,C;const R=t.options.columnResizeDirection==="rtl"?-1:1,D=(y-((S=b==null?void 0:b.startOffset)!=null?S:0))*R,V=Math.max(D/((C=b==null?void 0:b.startSize)!=null?C:0),-.999999);return b.columnSizingStart.forEach($=>{let[k,N]=$;c[k]=Math.round(Math.max(N+N*V,0)*100)/100}),{...b,deltaOffset:D,deltaPercentage:V}}),(t.options.columnResizeMode==="onChange"||m==="end")&&t.setColumnSizing(b=>({...b,...c})))},f=m=>u("move",m),d=m=>{u("end",m),t.setColumnSizingInfo(y=>({...y,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},h=Qb(n),p={moveHandler:m=>f(m.clientX),upHandler:m=>{h==null||h.removeEventListener("mousemove",p.moveHandler),h==null||h.removeEventListener("mouseup",p.upHandler),d(m.clientX)}},g={moveHandler:m=>(m.cancelable&&(m.preventDefault(),m.stopPropagation()),f(m.touches[0].clientX),!1),upHandler:m=>{var y;h==null||h.removeEventListener("touchmove",g.moveHandler),h==null||h.removeEventListener("touchend",g.upHandler),m.cancelable&&(m.preventDefault(),m.stopPropagation()),d((y=m.touches[0])==null?void 0:y.clientX)}},v=Yb()?{passive:!1}:!1;ts(i)?(h==null||h.addEventListener("touchmove",g.moveHandler,v),h==null||h.addEventListener("touchend",g.upHandler,v)):(h==null||h.addEventListener("mousemove",p.moveHandler,v),h==null||h.addEventListener("mouseup",p.upHandler,v)),t.setColumnSizingInfo(m=>({...m,startOffset:l,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?es():(n=e.initialState.columnSizingInfo)!=null?n:es())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0}}};let jo=null;function Yb(){if(typeof jo=="boolean")return jo;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return jo=e,jo}function ts(e){return e.type==="touchstart"}const Jb={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:ot("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const o=e.columns;return(n=o.length?o.some(i=>i.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=se(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),ae(t.options,"debugRows")),e.getVisibleCells=se(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],ae(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>se(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),ae(e.options,"debugColumns"));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((o,i)=>({...o,[i.id]:n||!(i.getCanHide!=null&&i.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function Zr(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const Zb={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},e0={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:ot("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,o,i;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((i=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>_t.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return Fi(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:_t[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},t0={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:ot("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var o,i;e.setExpanded(r?{}:(o=(i=e.initialState)==null?void 0:i.expanded)!=null?o:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(o=>!o.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(i=>{const s=i.split(".");r=Math.max(r,s.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var o;const i=r===!0?!0:!!(r!=null&&r[e.id]);let s={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(a=>{s[a]=!0}):s=r,n=(o=n)!=null?o:!i,!i&&n)return{...s,[e.id]:!0};if(i&&!n){const{[e.id]:a,...l}=s;return l}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r!=null&&r[e.id])},e.getCanExpand=()=>{var n,r,o;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((o=e.subRows)!=null&&o.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},ia=0,sa=10,ns=()=>({pageIndex:ia,pageSize:sa}),n0={getInitialState:e=>({...e,pagination:{...ns(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:ot("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const o=i=>cn(r,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?ns():(o=e.initialState.pagination)!=null?o:ns())},e.setPageIndex=r=>{e.setPagination(o=>{let i=cn(r,o.pageIndex);const s=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,s)),{...o,pageIndex:i}})},e.resetPageIndex=r=>{var o,i;e.setPageIndex(r?ia:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?o:ia)},e.resetPageSize=r=>{var o,i;e.setPageSize(r?sa:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?o:sa)},e.setPageSize=r=>{e.setPagination(o=>{const i=Math.max(1,cn(r,o.pageSize)),s=o.pageSize*o.pageIndex,a=Math.floor(s/i);return{...o,pageIndex:a,pageSize:i}})},e.setPageCount=r=>e.setPagination(o=>{var i;let s=cn(r,(i=e.options.pageCount)!=null?i:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...o,pageCount:s}}),e.getPageOptions=se(()=>[e.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((i,s)=>s)),o},ae(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,o=e.getPageCount();return o===-1?!0:o===0?!1:r<o-1},e.previousPage=()=>e.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},rs=()=>({top:[],bottom:[]}),r0={getInitialState:e=>({rowPinning:rs(),...e}),getDefaultOptions:e=>({onRowPinningChange:ot("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,o)=>{const i=r?e.getLeafRows().map(l=>{let{id:c}=l;return c}):[],s=o?e.getParentRows().map(l=>{let{id:c}=l;return c}):[],a=new Set([...s,e.id,...i]);t.setRowPinning(l=>{var c,u;if(n==="bottom"){var f,d;return{top:((f=l==null?void 0:l.top)!=null?f:[]).filter(g=>!(a!=null&&a.has(g))),bottom:[...((d=l==null?void 0:l.bottom)!=null?d:[]).filter(g=>!(a!=null&&a.has(g))),...Array.from(a)]}}if(n==="top"){var h,p;return{top:[...((h=l==null?void 0:l.top)!=null?h:[]).filter(g=>!(a!=null&&a.has(g))),...Array.from(a)],bottom:((p=l==null?void 0:l.bottom)!=null?p:[]).filter(g=>!(a!=null&&a.has(g)))}}return{top:((c=l==null?void 0:l.top)!=null?c:[]).filter(g=>!(a!=null&&a.has(g))),bottom:((u=l==null?void 0:l.bottom)!=null?u:[]).filter(g=>!(a!=null&&a.has(g)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:o}=t.options;return typeof r=="function"?r(e):(n=r??o)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:o}=t.getState().rowPinning,i=n.some(a=>r==null?void 0:r.includes(a)),s=n.some(a=>o==null?void 0:o.includes(a));return i?"top":s?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();if(!o)return-1;const i=(n=o==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(s=>{let{id:a}=s;return a});return(r=i==null?void 0:i.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?rs():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:rs())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var o,i;return!!((o=r.top)!=null&&o.length||(i=r.bottom)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(n??[]).map(s=>{const a=e.getRow(s,!0);return a.getIsAllParentsExpanded()?a:null}):(n??[]).map(s=>t.find(a=>a.id===s))).filter(Boolean).map(s=>({...s,position:r}))},e.getTopRows=se(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),ae(e.options,"debugRows")),e.getBottomRows=se(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),ae(e.options,"debugRows")),e.getCenterRows=se(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const o=new Set([...n??[],...r??[]]);return t.filter(i=>!o.has(i.id))},ae(e.options,"debugRows"))}},o0={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:ot("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach(i=>{i.getCanSelect()&&(r[i.id]=!0)}):o.forEach(i=>{delete r[i.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach(i=>{aa(o,i.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=se(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?os(e,n):{rows:[],flatRows:[],rowsById:{}},ae(e.options,"debugTable")),e.getFilteredSelectedRowModel=se(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?os(e,n):{rows:[],flatRows:[],rowsById:{}},ae(e.options,"debugTable")),e.getGroupedSelectedRowModel=se(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?os(e,n):{rows:[],flatRows:[],rowsById:{}},ae(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(o=>o.getCanSelect()&&!n[o.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(o=>!n[o.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const o=e.getIsSelected();t.setRowSelection(i=>{var s;if(n=typeof n<"u"?n:!o,e.getCanSelect()&&o===n)return i;const a={...i};return aa(a,e.id,n,(s=r==null?void 0:r.selectChildren)!=null?s:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return al(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return la(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return la(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var o;n&&e.toggleSelected((o=r.target)==null?void 0:o.checked)}}}},aa=(e,t,n,r,o)=>{var i;const s=o.getRow(t,!0);n?(s.getCanMultiSelect()||Object.keys(e).forEach(a=>delete e[a]),s.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(i=s.subRows)!=null&&i.length&&s.getCanSelectSubRows()&&s.subRows.forEach(a=>aa(e,a.id,n,r,o))};function os(e,t){const n=e.getState().rowSelection,r=[],o={},i=function(s,a){return s.map(l=>{var c;const u=al(l,n);if(u&&(r.push(l),o[l.id]=l),(c=l.subRows)!=null&&c.length&&(l={...l,subRows:i(l.subRows)}),u)return l}).filter(Boolean)};return{rows:i(t.rows),flatRows:r,rowsById:o}}function al(e,t){var n;return(n=t[e.id])!=null?n:!1}function la(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let o=!0,i=!1;return e.subRows.forEach(s=>{if(!(i&&!o)&&(s.getCanSelect()&&(al(s,t)?i=!0:o=!1),s.subRows&&s.subRows.length)){const a=la(s,t);a==="all"?i=!0:(a==="some"&&(i=!0),o=!1)}}),o?"all":i?"some":!1}const ua=/([0-9]+)/gm,i0=(e,t,n)=>ah(yn(e.getValue(n)).toLowerCase(),yn(t.getValue(n)).toLowerCase()),s0=(e,t,n)=>ah(yn(e.getValue(n)),yn(t.getValue(n))),a0=(e,t,n)=>ll(yn(e.getValue(n)).toLowerCase(),yn(t.getValue(n)).toLowerCase()),l0=(e,t,n)=>ll(yn(e.getValue(n)),yn(t.getValue(n))),u0=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},c0=(e,t,n)=>ll(e.getValue(n),t.getValue(n));function ll(e,t){return e===t?0:e>t?1:-1}function yn(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function ah(e,t){const n=e.split(ua).filter(Boolean),r=t.split(ua).filter(Boolean);for(;n.length&&r.length;){const o=n.shift(),i=r.shift(),s=parseInt(o,10),a=parseInt(i,10),l=[s,a].sort();if(isNaN(l[0])){if(o>i)return 1;if(i>o)return-1;continue}if(isNaN(l[1]))return isNaN(s)?-1:1;if(s>a)return 1;if(a>s)return-1}return n.length-r.length}const Ur={alphanumeric:i0,alphanumericCaseSensitive:s0,text:a0,textCaseSensitive:l0,datetime:u0,basic:c0},d0={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:ot("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const o of n){const i=o==null?void 0:o.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return Ur.datetime;if(typeof i=="string"&&(r=!0,i.split(ua).length>1))return Ur.alphanumeric}return r?Ur.text:Ur.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return Fi(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:Ur[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const o=e.getNextSortingOrder(),i=typeof n<"u"&&n!==null;t.setSorting(s=>{const a=s==null?void 0:s.find(h=>h.id===e.id),l=s==null?void 0:s.findIndex(h=>h.id===e.id);let c=[],u,f=i?n:o==="desc";if(s!=null&&s.length&&e.getCanMultiSort()&&r?a?u="toggle":u="add":s!=null&&s.length&&l!==s.length-1?u="replace":a?u="toggle":u="replace",u==="toggle"&&(i||o||(u="remove")),u==="add"){var d;c=[...s,{id:e.id,desc:f}],c.splice(0,c.length-((d=t.options.maxMultiSortColCount)!=null?d:Number.MAX_SAFE_INTEGER))}else u==="toggle"?c=s.map(h=>h.id===e.id?{...h,desc:f}:h):u==="remove"?c=s.filter(h=>h.id!==e.id):c=[{id:e.id,desc:f}];return c})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,o;const i=e.getFirstSortDir(),s=e.getIsSorted();return s?s!==i&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(o=t.options.enableMultiRemove)!=null)||o)?!1:s==="desc"?"asc":"desc":i},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(o=>o.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},f0=[Tb,Jb,qb,Wb,Db,Lb,Zb,e0,d0,Hb,t0,n0,r0,o0,Xb];function h0(e){var t,n;const r=[...f0,...(t=e._features)!=null?t:[]];let o={_features:r};const i=o._features.reduce((d,h)=>Object.assign(d,h.getDefaultOptions==null?void 0:h.getDefaultOptions(o)),{}),s=d=>o.options.mergeOptions?o.options.mergeOptions(i,d):{...i,...d};let l={...{},...(n=e.initialState)!=null?n:{}};o._features.forEach(d=>{var h;l=(h=d.getInitialState==null?void 0:d.getInitialState(l))!=null?h:l});const c=[];let u=!1;const f={_features:r,options:{...i,...e},initialState:l,_queue:d=>{c.push(d),u||(u=!0,Promise.resolve().then(()=>{for(;c.length;)c.shift()();u=!1}).catch(h=>setTimeout(()=>{throw h})))},reset:()=>{o.setState(o.initialState)},setOptions:d=>{const h=cn(d,o.options);o.options=s(h)},getState:()=>o.options.state,setState:d=>{o.options.onStateChange==null||o.options.onStateChange(d)},_getRowId:(d,h,p)=>{var g;return(g=o.options.getRowId==null?void 0:o.options.getRowId(d,h,p))!=null?g:`${p?[p.id,h].join("."):h}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(d,h)=>{let p=(h?o.getPrePaginationRowModel():o.getRowModel()).rowsById[d];if(!p&&(p=o.getCoreRowModel().rowsById[d],!p))throw new Error;return p},_getDefaultColumnDef:se(()=>[o.options.defaultColumn],d=>{var h;return d=(h=d)!=null?h:{},{header:p=>{const g=p.header.column.columnDef;return g.accessorKey?g.accessorKey:g.accessorFn?g.id:null},cell:p=>{var g,v;return(g=(v=p.renderValue())==null||v.toString==null?void 0:v.toString())!=null?g:null},...o._features.reduce((p,g)=>Object.assign(p,g.getDefaultColumnDef==null?void 0:g.getDefaultColumnDef()),{}),...d}},ae(e,"debugColumns")),_getColumnDefs:()=>o.options.columns,getAllColumns:se(()=>[o._getColumnDefs()],d=>{const h=function(p,g,v){return v===void 0&&(v=0),p.map(m=>{const y=Ab(o,m,v,g),b=m;return y.columns=b.columns?h(b.columns,y,v+1):[],y})};return h(d)},ae(e,"debugColumns")),getAllFlatColumns:se(()=>[o.getAllColumns()],d=>d.flatMap(h=>h.getFlatColumns()),ae(e,"debugColumns")),_getAllFlatColumnsById:se(()=>[o.getAllFlatColumns()],d=>d.reduce((h,p)=>(h[p.id]=p,h),{}),ae(e,"debugColumns")),getAllLeafColumns:se(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(d,h)=>{let p=d.flatMap(g=>g.getLeafColumns());return h(p)},ae(e,"debugColumns")),getColumn:d=>o._getAllFlatColumnsById()[d]};Object.assign(o,f);for(let d=0;d<o._features.length;d++){const h=o._features[d];h==null||h.createTable==null||h.createTable(o)}return o}function g0(){return e=>se(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,i,s){i===void 0&&(i=0);const a=[];for(let c=0;c<o.length;c++){const u=il(e,e._getRowId(o[c],c,s),o[c],c,i,void 0,s==null?void 0:s.id);if(n.flatRows.push(u),n.rowsById[u.id]=u,a.push(u),e.options.getSubRows){var l;u.originalSubRows=e.options.getSubRows(o[c],c),(l=u.originalSubRows)!=null&&l.length&&(u.subRows=r(u.originalSubRows,i+1,u))}}return a};return n.rows=r(t),n},ae(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function p0(e,t,n){return n.options.filterFromLeafRows?m0(e,t,n):v0(e,t,n)}function m0(e,t,n){var r;const o=[],i={},s=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,a=function(l,c){c===void 0&&(c=0);const u=[];for(let d=0;d<l.length;d++){var f;let h=l[d];const p=il(n,h.id,h.original,h.index,h.depth,void 0,h.parentId);if(p.columnFilters=h.columnFilters,(f=h.subRows)!=null&&f.length&&c<s){if(p.subRows=a(h.subRows,c+1),h=p,t(h)&&!p.subRows.length){u.push(h),i[h.id]=h,o.push(h);continue}if(t(h)||p.subRows.length){u.push(h),i[h.id]=h,o.push(h);continue}}else h=p,t(h)&&(u.push(h),i[h.id]=h,o.push(h))}return u};return{rows:a(e),flatRows:o,rowsById:i}}function v0(e,t,n){var r;const o=[],i={},s=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,a=function(l,c){c===void 0&&(c=0);const u=[];for(let d=0;d<l.length;d++){let h=l[d];if(t(h)){var f;if((f=h.subRows)!=null&&f.length&&c<s){const g=il(n,h.id,h.original,h.index,h.depth,void 0,h.parentId);g.subRows=a(h.subRows,c+1),h=g}u.push(h),o.push(h),i[h.id]=h}}return u};return{rows:a(e),flatRows:o,rowsById:i}}function y0(){return e=>se(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let d=0;d<t.flatRows.length;d++)t.flatRows[d].columnFilters={},t.flatRows[d].columnFiltersMeta={};return t}const o=[],i=[];(n??[]).forEach(d=>{var h;const p=e.getColumn(d.id);if(!p)return;const g=p.getFilterFn();g&&o.push({id:d.id,filterFn:g,resolvedValue:(h=g.resolveFilterValue==null?void 0:g.resolveFilterValue(d.value))!=null?h:d.value})});const s=(n??[]).map(d=>d.id),a=e.getGlobalFilterFn(),l=e.getAllLeafColumns().filter(d=>d.getCanGlobalFilter());r&&a&&l.length&&(s.push("__global__"),l.forEach(d=>{var h;i.push({id:d.id,filterFn:a,resolvedValue:(h=a.resolveFilterValue==null?void 0:a.resolveFilterValue(r))!=null?h:r})}));let c,u;for(let d=0;d<t.flatRows.length;d++){const h=t.flatRows[d];if(h.columnFilters={},o.length)for(let p=0;p<o.length;p++){c=o[p];const g=c.id;h.columnFilters[g]=c.filterFn(h,g,c.resolvedValue,v=>{h.columnFiltersMeta[g]=v})}if(i.length){for(let p=0;p<i.length;p++){u=i[p];const g=u.id;if(u.filterFn(h,g,u.resolvedValue,v=>{h.columnFiltersMeta[g]=v})){h.columnFilters.__global__=!0;break}}h.columnFilters.__global__!==!0&&(h.columnFilters.__global__=!1)}}const f=d=>{for(let h=0;h<s.length;h++)if(d.columnFilters[s[h]]===!1)return!1;return!0};return p0(t.rows,f,e)},ae(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}/**
19
+ * solid-table
20
+ *
21
+ * Copyright (c) TanStack
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE.md file in the root directory of this source tree.
25
+ *
26
+ * @license MIT
27
+ */function wc(e,t){return e?typeof e=="function"?w(e,t):e:null}function w0(e){const t=F({state:{},onStateChange:()=>{},renderFallbackValue:null,mergeOptions:(i,s)=>F(i,s)},e),n=h0(t),[r,o]=vo(n.initialState);return pt(()=>{n.setOptions(i=>F(i,e,{state:F(r,e.state||{}),onStateChange:s=>{o(s),e.onStateChange==null||e.onStateChange(s)}}))}),n}function b0(e){const[t,n]=z(0),[r,o]=z(0);j(()=>{const a=e();if(!a)return;s(a);const l=new ResizeObserver(i);l.observe(a),Y(()=>{l.disconnect()})});const i=a=>{for(const l of a)l.target===e()&&s(l.target)},s=a=>{o(a.offsetWidth),n(a.offsetHeight)};return{width:r,height:t}}function lh(e){let t=e.startIndex??0;const n=e.startLevel??0,r=[],o=l=>{if(l==null)return"";const c=e.getKey??"key",u=Jn(c)?l[c]:c(l);return u!=null?String(u):""},i=l=>{if(l==null)return"";const c=e.getTextValue??"textValue",u=Jn(c)?l[c]:c(l);return u!=null?String(u):""},s=l=>{if(l==null)return!1;const c=e.getDisabled??"disabled";return(Jn(c)?l[c]:c(l))??!1},a=l=>{var c;if(l!=null)return Jn(e.getSectionChildren)?l[e.getSectionChildren]:(c=e.getSectionChildren)==null?void 0:c.call(e,l)};for(const l of e.dataSource){if(Jn(l)||Fm(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=lh({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}function S0(e,t=[]){return L(()=>{const n=lh({dataSource:T(e.dataSource),getKey:T(e.getKey),getTextValue:T(e.getTextValue),getDisabled:T(e.getDisabled),getSectionChildren:T(e.getSectionChildren)});for(let r=0;r<t.length;r++)t[r]();return e.factory(n)})}var Rt=class uh extends Set{constructor(n,r,o){super(n);Re(this,"anchorKey");Re(this,"currentKey");n instanceof uh?(this.anchorKey=r||n.anchorKey,this.currentKey=o||n.currentKey):(this.anchorKey=r,this.currentKey=o)}};function x0(e){const[t,n]=wt(e);return[()=>t()??new Rt,n]}function ch(e){return ti()?e.altKey:e.ctrlKey}function Zn(e){return wo()?e.metaKey:e.ctrlKey}function bc(e){return new Rt(e)}function dh(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function C0(e){const t=Z({selectionMode:"none",selectionBehavior:"toggle"},e),[n,r]=z(!1),[o,i]=z(),s=L(()=>{const g=T(t.selectedKeys);return g!=null?bc(g):g}),a=L(()=>{const g=T(t.defaultSelectedKeys);return g!=null?bc(g):new Rt}),[l,c]=x0({value:s,defaultValue:a,onChange:g=>{var v;return(v=t.onSelectionChange)==null?void 0:v.call(t,g)}}),[u,f]=z(T(t.selectionBehavior)),d=()=>T(t.selectionMode),h=()=>T(t.disallowEmptySelection)??!1,p=g=>{(T(t.allowDuplicateSelectionEvents)||!dh(g,l()))&&c(g)};return j(()=>{const g=l();T(t.selectionBehavior)==="replace"&&u()==="toggle"&&typeof g=="object"&&g.size===0&&f("replace")}),j(()=>{f(T(t.selectionBehavior)??"toggle")}),{selectionMode:d,disallowEmptySelection:h,selectionBehavior:u,setSelectionBehavior:f,isFocused:n,setFocused:r,focusedKey:o,setFocusedKey:i,selectedKeys:l,setSelectedKeys:p}}function E0(e){const[t,n]=z(""),[r,o]=z(-1);return{typeSelectHandlers:{onKeyDown:s=>{var d;if(T(e.isDisabled))return;const a=T(e.keyboardDelegate),l=T(e.selectionManager);if(!a.getKeyForSearch)return;const c=M0(s.key);if(!c||s.ctrlKey||s.metaKey)return;c===" "&&t().trim().length>0&&(s.preventDefault(),s.stopPropagation());let u=n(h=>h+c),f=a.getKeyForSearch(u,l.focusedKey())??a.getKeyForSearch(u);f==null&&I0(u)&&(u=u[0],f=a.getKeyForSearch(u,l.focusedKey())??a.getKeyForSearch(u)),f!=null&&(l.setFocusedKey(f),(d=e.onTypeSelect)==null||d.call(e,f)),clearTimeout(r()),o(window.setTimeout(()=>n(""),500))}}}}function M0(e){return e.length===1||!/^[A-Z]/i.test(e)?e:""}function I0(e){return e.split("").every(t=>t===e[0])}function fh(e,t,n){const o=F({selectOnFocus:()=>T(e.selectionManager).selectionBehavior()==="replace"},e),i=()=>(n==null?void 0:n())??t(),{direction:s}=xn();let a={top:0,left:0};Mm(()=>T(o.isVirtualized)?void 0:i(),"scroll",()=>{const v=i();v&&(a={top:v.scrollTop,left:v.scrollLeft})});const{typeSelectHandlers:l}=E0({isDisabled:()=>T(o.disallowTypeAhead),keyboardDelegate:()=>T(o.keyboardDelegate),selectionManager:()=>T(o.selectionManager)}),c=()=>T(o.orientation)??"vertical",u=v=>{var V,$,k,N,B,ne,I,M;ee(v,l.onKeyDown),v.altKey&&v.key==="Tab"&&v.preventDefault();const m=t();if(!(m!=null&&m.contains(v.target)))return;const y=T(o.selectionManager),b=T(o.selectOnFocus),S=x=>{x!=null&&(y.setFocusedKey(x),v.shiftKey&&y.selectionMode()==="multiple"?y.extendSelection(x):b&&!ch(v)&&y.replaceSelection(x))},C=T(o.keyboardDelegate),R=T(o.shouldFocusWrap),D=y.focusedKey();switch(v.key){case(c()==="vertical"?"ArrowDown":"ArrowRight"):{if(C.getKeyBelow){v.preventDefault();let x;D!=null?x=C.getKeyBelow(D):x=(V=C.getFirstKey)==null?void 0:V.call(C),x==null&&R&&(x=($=C.getFirstKey)==null?void 0:$.call(C,D)),S(x)}break}case(c()==="vertical"?"ArrowUp":"ArrowLeft"):{if(C.getKeyAbove){v.preventDefault();let x;D!=null?x=C.getKeyAbove(D):x=(k=C.getLastKey)==null?void 0:k.call(C),x==null&&R&&(x=(N=C.getLastKey)==null?void 0:N.call(C,D)),S(x)}break}case(c()==="vertical"?"ArrowLeft":"ArrowUp"):{if(C.getKeyLeftOf){v.preventDefault();const x=s()==="rtl";let O;D!=null?O=C.getKeyLeftOf(D):O=x?(B=C.getFirstKey)==null?void 0:B.call(C):(ne=C.getLastKey)==null?void 0:ne.call(C),S(O)}break}case(c()==="vertical"?"ArrowRight":"ArrowDown"):{if(C.getKeyRightOf){v.preventDefault();const x=s()==="rtl";let O;D!=null?O=C.getKeyRightOf(D):O=x?(I=C.getLastKey)==null?void 0:I.call(C):(M=C.getFirstKey)==null?void 0:M.call(C),S(O)}break}case"Home":if(C.getFirstKey){v.preventDefault();const x=C.getFirstKey(D,Zn(v));x!=null&&(y.setFocusedKey(x),Zn(v)&&v.shiftKey&&y.selectionMode()==="multiple"?y.extendSelection(x):b&&y.replaceSelection(x))}break;case"End":if(C.getLastKey){v.preventDefault();const x=C.getLastKey(D,Zn(v));x!=null&&(y.setFocusedKey(x),Zn(v)&&v.shiftKey&&y.selectionMode()==="multiple"?y.extendSelection(x):b&&y.replaceSelection(x))}break;case"PageDown":if(C.getKeyPageBelow&&D!=null){v.preventDefault();const x=C.getKeyPageBelow(D);S(x)}break;case"PageUp":if(C.getKeyPageAbove&&D!=null){v.preventDefault();const x=C.getKeyPageAbove(D);S(x)}break;case"a":Zn(v)&&y.selectionMode()==="multiple"&&T(o.disallowSelectAll)!==!0&&(v.preventDefault(),y.selectAll());break;case"Escape":v.defaultPrevented||(v.preventDefault(),T(o.disallowEmptySelection)||y.clearSelection());break;case"Tab":if(!T(o.allowsTabNavigation)){if(v.shiftKey)m.focus();else{const x=Hm(m,{tabbable:!0});let O,P;do P=x.lastChild(),P&&(O=P);while(P);O&&!O.contains(document.activeElement)&&Fe(O)}break}}},f=v=>{var S,C;const m=T(o.selectionManager),y=T(o.keyboardDelegate),b=T(o.selectOnFocus);if(m.isFocused()){v.currentTarget.contains(v.target)||m.setFocused(!1);return}if(v.currentTarget.contains(v.target)){if(m.setFocused(!0),m.focusedKey()==null){const R=V=>{V!=null&&(m.setFocusedKey(V),b&&m.replaceSelection(V))},D=v.relatedTarget;D&&v.currentTarget.compareDocumentPosition(D)&Node.DOCUMENT_POSITION_FOLLOWING?R(m.lastSelectedKey()??((S=y.getLastKey)==null?void 0:S.call(y))):R(m.firstSelectedKey()??((C=y.getFirstKey)==null?void 0:C.call(y)))}else if(!T(o.isVirtualized)){const R=i();if(R){R.scrollTop=a.top,R.scrollLeft=a.left;const D=R.querySelector(`[data-key="${m.focusedKey()}"]`);D&&(Fe(D),Qs(R,D))}}}},d=v=>{const m=T(o.selectionManager);v.currentTarget.contains(v.relatedTarget)||m.setFocused(!1)},h=v=>{i()===v.target&&v.preventDefault()},p=()=>{var R,D;const v=T(o.autoFocus);if(!v)return;const m=T(o.selectionManager),y=T(o.keyboardDelegate);let b;v==="first"&&(b=(R=y.getFirstKey)==null?void 0:R.call(y)),v==="last"&&(b=(D=y.getLastKey)==null?void 0:D.call(y));const S=m.selectedKeys();S.size&&(b=S.values().next().value),m.setFocused(!0),m.setFocusedKey(b);const C=t();C&&b==null&&!T(o.shouldUseVirtualFocus)&&Fe(C)};return Sr(()=>{o.deferAutoFocus?setTimeout(p,0):p()}),j(Ee([i,()=>T(o.isVirtualized),()=>T(o.selectionManager).focusedKey()],v=>{var S;const[m,y,b]=v;if(y)b&&((S=o.scrollToKey)==null||S.call(o,b));else if(b&&m){const C=m.querySelector(`[data-key="${b}"]`);C&&Qs(m,C)}})),{tabIndex:L(()=>{if(!T(o.shouldUseVirtualFocus))return T(o.selectionManager).focusedKey()==null?0:-1}),onKeyDown:u,onMouseDown:h,onFocusIn:f,onFocusOut:d}}function ul(e,t){const n=()=>T(e.selectionManager),r=()=>T(e.key),o=()=>T(e.shouldUseVirtualFocus),i=y=>{n().selectionMode()!=="none"&&(n().selectionMode()==="single"?n().isSelected(r())&&!n().disallowEmptySelection()?n().toggleSelection(r()):n().replaceSelection(r()):y!=null&&y.shiftKey?n().extendSelection(r()):n().selectionBehavior()==="toggle"||Zn(y)||"pointerType"in y&&y.pointerType==="touch"?n().toggleSelection(r()):n().replaceSelection(r()))},s=()=>n().isSelected(r()),a=()=>T(e.disabled)||n().isDisabled(r()),l=()=>!a()&&n().canSelectItem(r());let c=null;const u=y=>{l()&&(c=y.pointerType,y.pointerType==="mouse"&&y.button===0&&!T(e.shouldSelectOnPressUp)&&i(y))},f=y=>{l()&&y.pointerType==="mouse"&&y.button===0&&T(e.shouldSelectOnPressUp)&&T(e.allowsDifferentPressOrigin)&&i(y)},d=y=>{l()&&(T(e.shouldSelectOnPressUp)&&!T(e.allowsDifferentPressOrigin)||c!=="mouse")&&i(y)},h=y=>{!l()||!["Enter"," "].includes(y.key)||(ch(y)?n().toggleSelection(r()):i(y))},p=y=>{a()&&y.preventDefault()},g=y=>{const b=t();o()||a()||!b||y.target===b&&n().setFocusedKey(r())},v=L(()=>{if(!(o()||a()))return r()===n().focusedKey()?0:-1}),m=L(()=>T(e.virtualized)?void 0:r());return j(Ee([t,r,o,()=>n().focusedKey(),()=>n().isFocused()],([y,b,S,C,R])=>{y&&b===C&&R&&!S&&document.activeElement!==y&&(e.focus?e.focus():Fe(y))})),{isSelected:s,isDisabled:a,allowsSelection:l,tabIndex:v,dataKey:m,onPointerDown:u,onPointerUp:f,onClick:d,onKeyDown:h,onMouseDown:p,onFocus:g}}var P0=class{constructor(e,t){Re(this,"collection");Re(this,"state");this.collection=e,this.state=t}selectionMode(){return this.state.selectionMode()}disallowEmptySelection(){return this.state.disallowEmptySelection()}selectionBehavior(){return this.state.selectionBehavior()}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}isFocused(){return this.state.isFocused()}setFocused(e){this.state.setFocused(e)}focusedKey(){return this.state.focusedKey()}setFocusedKey(e){(e==null||this.collection().getItem(e))&&this.state.setFocusedKey(e)}selectedKeys(){return this.state.selectedKeys()}isSelected(e){if(this.state.selectionMode()==="none")return!1;const t=this.getKey(e);return t==null?!1:this.state.selectedKeys().has(t)}isEmpty(){return this.state.selectedKeys().size===0}isSelectAll(){if(this.isEmpty())return!1;const e=this.state.selectedKeys();return this.getAllSelectableKeys().every(t=>e.has(t))}firstSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t),r=(n==null?void 0:n.index)!=null&&(e==null?void 0:e.index)!=null&&n.index<e.index;(!e||r)&&(e=n)}return e==null?void 0:e.key}lastSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t),r=(n==null?void 0:n.index)!=null&&(e==null?void 0:e.index)!=null&&n.index>e.index;(!e||r)&&(e=n)}return e==null?void 0:e.key}extendSelection(e){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"){this.replaceSelection(e);return}const t=this.getKey(e);if(t==null)return;const n=this.state.selectedKeys(),r=n.anchorKey||t,o=new Rt(n,r,t);for(const i of this.getKeyRange(r,n.currentKey||t))o.delete(i);for(const i of this.getKeyRange(t,r))this.canSelectItem(i)&&o.add(i);this.state.setSelectedKeys(o)}getKeyRange(e,t){const n=this.collection().getItem(e),r=this.collection().getItem(t);return n&&r?n.index!=null&&r.index!=null&&n.index<=r.index?this.getKeyRangeInternal(e,t):this.getKeyRangeInternal(t,e):[]}getKeyRangeInternal(e,t){const n=[];let r=e;for(;r!=null;){const o=this.collection().getItem(r);if(o&&o.type==="item"&&n.push(r),r===t)return n;r=this.collection().getKeyAfter(r)}return[]}getKey(e){const t=this.collection().getItem(e);return t?!t||t.type!=="item"?null:t.key:e}toggleSelection(e){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"&&!this.isSelected(e)){this.replaceSelection(e);return}const t=this.getKey(e);if(t==null)return;const n=new Rt(this.state.selectedKeys());n.has(t)?n.delete(t):this.canSelectItem(t)&&(n.add(t),n.anchorKey=t,n.currentKey=t),!(this.disallowEmptySelection()&&n.size===0)&&this.state.setSelectedKeys(n)}replaceSelection(e){if(this.selectionMode()==="none")return;const t=this.getKey(e);if(t==null)return;const n=this.canSelectItem(t)?new Rt([t],t,t):new Rt;this.state.setSelectedKeys(n)}setSelectedKeys(e){if(this.selectionMode()==="none")return;const t=new Rt;for(const n of e){const r=this.getKey(n);if(r!=null&&(t.add(r),this.selectionMode()==="single"))break}this.state.setSelectedKeys(t)}selectAll(){this.selectionMode()==="multiple"&&this.state.setSelectedKeys(new Set(this.getAllSelectableKeys()))}clearSelection(){const e=this.state.selectedKeys();!this.disallowEmptySelection()&&e.size>0&&this.state.setSelectedKeys(new Rt)}toggleSelectAll(){this.isSelectAll()?this.clearSelection():this.selectAll()}select(e,t){this.selectionMode()!=="none"&&(this.selectionMode()==="single"?this.isSelected(e)&&!this.disallowEmptySelection()?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior()==="toggle"||t&&t.pointerType==="touch"?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys())return!0;const t=this.selectedKeys();if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;for(const n of t)if(!e.has(n))return!1;return!0}canSelectItem(e){if(this.state.selectionMode()==="none")return!1;const t=this.collection().getItem(e);return t!=null&&!t.disabled}isDisabled(e){const t=this.collection().getItem(e);return!t||t.disabled}getAllSelectableKeys(){const e=[];return(n=>{for(;n!=null;){if(this.canSelectItem(n)){const r=this.collection().getItem(n);if(!r)continue;r.type==="item"&&e.push(n)}n=this.collection().getKeyAfter(n)}})(this.collection().getFirstKey()),e}},Sc=class{constructor(e){Re(this,"keyMap",new Map);Re(this,"iterable");Re(this,"firstKey");Re(this,"lastKey");this.iterable=e;for(const r of e)this.keyMap.set(r.key,r);if(this.keyMap.size===0)return;let t,n=0;for(const[r,o]of this.keyMap)t?(t.nextKey=r,o.prevKey=t.key):(this.firstKey=r,o.prevKey=void 0),o.type==="item"&&(o.index=n++),t=o,t.nextKey=void 0;this.lastKey=t.key}*[Symbol.iterator](){yield*this.iterable}getSize(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){var t;return(t=this.keyMap.get(e))==null?void 0:t.prevKey}getKeyAfter(e){var t;return(t=this.keyMap.get(e))==null?void 0:t.nextKey}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){return this.keyMap.get(e)}at(e){const t=[...this.getKeys()];return this.getItem(t[e])}};function cl(e){const t=C0(e),r=S0({dataSource:()=>T(e.dataSource),getKey:()=>T(e.getKey),getTextValue:()=>T(e.getTextValue),getDisabled:()=>T(e.getDisabled),getSectionChildren:()=>T(e.getSectionChildren),factory:i=>e.filter?new Sc(e.filter(i)):new Sc(i)},[()=>e.filter]),o=new P0(r,t);return pt(()=>{const i=t.focusedKey();i!=null&&!r().getItem(i)&&t.setFocusedKey(void 0)}),{collection:r,selectionManager:()=>o}}var hh=class{constructor(e,t,n){Re(this,"collection");Re(this,"ref");Re(this,"collator");this.collection=e,this.ref=t,this.collator=n}getKeyBelow(e){let t=this.collection().getKeyAfter(e);for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyAfter(t)}}getKeyAbove(e){let t=this.collection().getKeyBefore(e);for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyBefore(t)}}getFirstKey(){let e=this.collection().getFirstKey();for(;e!=null;){const t=this.collection().getItem(e);if(t&&t.type==="item"&&!t.disabled)return e;e=this.collection().getKeyAfter(e)}}getLastKey(){let e=this.collection().getLastKey();for(;e!=null;){const t=this.collection().getItem(e);if(t&&t.type==="item"&&!t.disabled)return e;e=this.collection().getKeyBefore(e)}}getItem(e){var t,n;return((n=(t=this.ref)==null?void 0:t.call(this))==null?void 0:n.querySelector(`[data-key="${e}"]`))??null}getKeyPageAbove(e){var i;const t=(i=this.ref)==null?void 0:i.call(this);let n=this.getItem(e);if(!t||!n)return;const r=Math.max(0,n.offsetTop+n.offsetHeight-t.offsetHeight);let o=e;for(;o&&n&&n.offsetTop>r;)o=this.getKeyAbove(o),n=o!=null?this.getItem(o):null;return o}getKeyPageBelow(e){var i;const t=(i=this.ref)==null?void 0:i.call(this);let n=this.getItem(e);if(!t||!n)return;const r=Math.min(t.scrollHeight,n.offsetTop-n.offsetHeight+t.offsetHeight);let o=e;for(;o&&n&&n.offsetTop<r;)o=this.getKeyBelow(o),n=o!=null?this.getItem(o):null;return o}getKeyForSearch(e,t){var o;const n=(o=this.collator)==null?void 0:o.call(this);if(!n)return;let r=t!=null?this.getKeyBelow(t):this.getFirstKey();for(;r!=null;){const i=this.collection().getItem(r);if(i){const s=i.textValue.slice(0,e.length);if(i.textValue&&n.compare(s,e)===0)return r}r=this.getKeyBelow(r)}}};function gh(e,t,n){const r=zf({usage:"search",sensitivity:"base"}),o=L(()=>{const i=T(e.keyboardDelegate);return i||new hh(e.collection,t,r)});return fh({selectionManager:()=>T(e.selectionManager),keyboardDelegate:o,autoFocus:()=>T(e.autoFocus),deferAutoFocus:()=>T(e.deferAutoFocus),shouldFocusWrap:()=>T(e.shouldFocusWrap),disallowEmptySelection:()=>T(e.disallowEmptySelection),selectOnFocus:()=>T(e.selectOnFocus),disallowTypeAhead:()=>T(e.disallowTypeAhead),shouldUseVirtualFocus:()=>T(e.shouldUseVirtualFocus),allowsTabNavigation:()=>T(e.allowsTabNavigation),isVirtualized:()=>T(e.isVirtualized),scrollToKey:i=>{var s;return(s=T(e.scrollToKey))==null?void 0:s(i)},orientation:()=>T(e.orientation)},t,n)}var ph=Ce();function mh(){return xe(ph)}function R0(){const e=mh();if(e===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}function vh(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function O0(e,t){var o;const n=t.ref();if(!n)return-1;let r=e.length;if(!r)return-1;for(;r--;){const i=(o=e[r])==null?void 0:o.ref();if(i&&vh(i,n))return r+1}return 0}function F0(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:vh(a,l)?(r>i&&(n=!0),-1):(r<i&&(n=!0),1)}),n?t.map(([r,o])=>o):e}function yh(e,t){const n=F0(e);e!==n&&t(n)}function $0(e){var o,i;const t=e[0],n=(o=e[e.length-1])==null?void 0:o.ref();let r=(i=t==null?void 0:t.ref())==null?void 0:i.parentElement;for(;r;){if(n&&r.contains(n))return r;r=r.parentElement}return We(r).body}function A0(e,t){j(()=>{const n=setTimeout(()=>{yh(e(),t)});Y(()=>clearTimeout(n))})}function T0(e,t){if(typeof IntersectionObserver!="function"){A0(e,t);return}let n=[];j(()=>{const r=()=>{const s=!!n.length;n=e(),s&&yh(e(),t)},o=$0(e()),i=new IntersectionObserver(r,{root:o});for(const s of e()){const a=s.ref();a&&i.observe(a)}Y(()=>i.disconnect())})}function D0(e={}){const[t,n]=xy({value:()=>T(e.items),onChange:i=>{var s;return(s=e.onItemsChange)==null?void 0:s.call(e,i)}});T0(t,n);const r=i=>(n(s=>{const a=O0(s,i);return Om(s,i,a)}),()=>{n(s=>{const a=s.filter(l=>l.ref()!==i.ref());return s.length===a.length?s:a})});return{DomCollectionProvider:i=>w(ph.Provider,{value:{registerItem:r},get children(){return i.children}})}}function L0(e){const t=R0(),n=Z({shouldRegisterItem:!0},e);j(()=>{if(!n.shouldRegisterItem)return;const r=t.registerItem(n.getItem());Y(r)})}function wh(e={}){const[t,n]=Af({value:()=>T(e.isSelected),defaultValue:()=>!!T(e.defaultIsSelected),onChange:i=>{var s;return(s=e.onSelectedChange)==null?void 0:s.call(e,i)}});return{isSelected:t,setIsSelected:i=>{!T(e.isReadOnly)&&!T(e.isDisabled)&&n(i)},toggle:()=>{!T(e.isReadOnly)&&!T(e.isDisabled)&&n(!t())}}}var bh=Ce();function Io(){return xe(bh)}function Lr(){const e=Io();if(e===void 0)throw new Error("[kobalte]: `useMenubarContext` must be used within a `Menubar` component");return e}var Sh=Ce();function dl(){return xe(Sh)}function Po(){const e=dl();if(e===void 0)throw new Error("[kobalte]: `useNavigationMenuContext` must be used within a `NavigationMenu` component");return e}var xh=Ce();function $i(){return xe(xh)}function Ut(){const e=$i();if(e===void 0)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}var Ch=Ce();function fl(){const e=xe(Ch);if(e===void 0)throw new Error("[kobalte]: `useMenuItemContext` must be used within a `Menu.Item` component");return e}var Eh=Ce();function At(){const e=xe(Eh);if(e===void 0)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}function hl(e){let t;const n=At(),r=Ut(),o=Z({id:n.generateId(`item-${Ie()}`)},e),[i,s]=_(o,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,l]=z(),[c,u]=z(),[f,d]=z(),h=()=>r.listState().selectionManager(),p=()=>s.id,g=()=>h().focusedKey()===p(),v=()=>{var $;($=i.onSelect)==null||$.call(i),i.closeOnSelect&&setTimeout(()=>{r.close(!0)})};L0({getItem:()=>{var $;return{ref:()=>t,type:"item",key:p(),textValue:i.textValue??(($=f())==null?void 0:$.textContent)??(t==null?void 0:t.textContent)??"",disabled:i.disabled??!1}}});const m=ul({key:p,selectionManager:h,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},()=>t),y=$=>{ee($,i.onPointerMove),$.pointerType==="mouse"&&(i.disabled?r.onItemLeave($):(r.onItemEnter($),$.defaultPrevented||(Fe($.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(p()))))},b=$=>{ee($,i.onPointerLeave),$.pointerType==="mouse"&&r.onItemLeave($)},S=$=>{ee($,i.onPointerUp),!i.disabled&&$.button===0&&v()},C=$=>{if(ee($,i.onKeyDown),!$.repeat&&!i.disabled)switch($.key){case"Enter":case" ":v();break}},R=L(()=>{if(i.indeterminate)return"mixed";if(i.checked!=null)return i.checked}),D=L(()=>({"data-indeterminate":i.indeterminate?"":void 0,"data-checked":i.checked&&!i.indeterminate?"":void 0,"data-disabled":i.disabled?"":void 0,"data-highlighted":g()?"":void 0})),V={isChecked:()=>i.checked,dataset:D,setLabelRef:d,generateId:Ye(()=>s.id),registerLabel:_e(l),registerDescription:_e(u)};return w(Ch.Provider,{value:V,get children(){return w(le,F({as:"div",ref($){var k=me(N=>t=N,i.ref);typeof k=="function"&&k($)},get tabIndex(){return m.tabIndex()},get"aria-checked"(){return R()},get"aria-disabled"(){return i.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return c()},get"data-key"(){return m.dataKey()},get onPointerDown(){return ye([i.onPointerDown,m.onPointerDown])},get onPointerUp(){return ye([S,m.onPointerUp])},get onClick(){return ye([i.onClick,m.onClick])},get onKeyDown(){return ye([C,m.onKeyDown])},get onMouseDown(){return ye([i.onMouseDown,m.onMouseDown])},get onFocus(){return ye([i.onFocus,m.onFocus])},onPointerMove:y,onPointerLeave:b},D,s))}})}function _0(e){const t=Z({closeOnSelect:!1},e),[n,r]=_(t,["checked","defaultChecked","onChange","onSelect"]),o=wh({isSelected:()=>n.checked,defaultIsSelected:()=>n.defaultChecked,onSelectedChange:s=>{var a;return(a=n.onChange)==null?void 0:a.call(n,s)},isDisabled:()=>r.disabled});return w(hl,F({role:"menuitemcheckbox",get checked(){return o.isSelected()},onSelect:()=>{var s;(s=n.onSelect)==null||s.call(n),o.toggle()}},r))}var co={next:(e,t)=>e==="ltr"?t==="horizontal"?"ArrowRight":"ArrowDown":t==="horizontal"?"ArrowLeft":"ArrowUp",previous:(e,t)=>co.next(e==="ltr"?"rtl":"ltr",t)},xc={first:e=>e==="horizontal"?"ArrowDown":"ArrowRight",last:e=>e==="horizontal"?"ArrowUp":"ArrowLeft"};function Cc(e){const t=At(),n=Ut(),r=Io(),{direction:o}=xn(),i=Z({id:t.generateId("trigger")},e),[s,a]=_(i,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let l=()=>t.value();r!==void 0&&(l=()=>t.value()??s.id,r.lastValue()===void 0&&r.setLastValue(l));const c=Ei(()=>n.triggerRef(),()=>"button"),u=L(()=>{var m;return c()==="a"&&((m=n.triggerRef())==null?void 0:m.getAttribute("href"))!=null});j(Ee(()=>r==null?void 0:r.value(),m=>{var y;u()&&m===l()&&((y=n.triggerRef())==null||y.focus())}));const f=()=>{r!==void 0?n.isOpen()?r.value()===l()&&r.closeMenu():(r.autoFocusMenu()||r.setAutoFocusMenu(!0),n.open(!1)):n.toggle(!0)},d=m=>{ee(m,s.onPointerDown),m.currentTarget.dataset.pointerType=m.pointerType,!s.disabled&&m.pointerType!=="touch"&&m.button===0&&f()},h=m=>{ee(m,s.onClick),s.disabled||m.currentTarget.dataset.pointerType==="touch"&&f()},p=m=>{if(ee(m,s.onKeyDown),!s.disabled){if(u())switch(m.key){case"Enter":case" ":return}switch(m.key){case"Enter":case" ":case xc.first(t.orientation()):m.stopPropagation(),m.preventDefault(),Qm(m.currentTarget),n.open("first"),r==null||r.setAutoFocusMenu(!0),r==null||r.setValue(l);break;case xc.last(t.orientation()):m.stopPropagation(),m.preventDefault(),n.open("last");break;case co.next(o(),t.orientation()):if(r===void 0)break;m.stopPropagation(),m.preventDefault(),r.nextMenu();break;case co.previous(o(),t.orientation()):if(r===void 0)break;m.stopPropagation(),m.preventDefault(),r.previousMenu();break}}},g=m=>{var y;ee(m,s.onMouseOver),((y=n.triggerRef())==null?void 0:y.dataset.pointerType)!=="touch"&&!s.disabled&&r!==void 0&&r.value()!==void 0&&r.setValue(l)},v=m=>{ee(m,s.onFocus),r!==void 0&&m.currentTarget.dataset.pointerType!=="touch"&&r.setValue(l)};return j(()=>Y(n.registerTriggerId(s.id))),w(xt,F({ref(m){var y=me(n.setTriggerRef,s.ref);typeof y=="function"&&y(m)},get"data-kb-menu-value-trigger"(){return t.value()},get id(){return s.id},get disabled(){return s.disabled},"aria-haspopup":"true",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return L(()=>!!n.isOpen())()?n.contentId():void 0},get"data-highlighted"(){return l()!==void 0&&(r==null?void 0:r.value())===l()?!0:void 0},get tabIndex(){return r!==void 0?r.value()===l()||r.lastValue()===l()?0:-1:void 0},onPointerDown:d,onMouseOver:g,onClick:h,onKeyDown:p,onFocus:v,role:r!==void 0?"menuitem":void 0},()=>n.dataset(),a))}function Mh(e){let t;const n=At(),r=Ut(),o=Io(),i=dl(),{direction:s}=xn(),a=Z({id:n.generateId(`content-${Ie()}`)},e),[l,c]=_(a,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let u=0;const f=()=>r.parentMenuContext()==null&&o===void 0&&n.isModal(),d=gh({selectionManager:r.listState().selectionManager,collection:r.listState().collection,autoFocus:r.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!r.listState().selectionManager().isFocused(),orientation:()=>n.orientation()==="horizontal"?"vertical":"horizontal"},()=>t);Ua({trapFocus:()=>f()&&r.isOpen(),onMountAutoFocus:b=>{var S;o===void 0&&((S=l.onOpenAutoFocus)==null||S.call(l,b))},onUnmountAutoFocus:l.onCloseAutoFocus},()=>t);const h=b=>{if($e(b.currentTarget,b.target)&&(b.key==="Tab"&&r.isOpen()&&b.preventDefault(),o!==void 0&&b.currentTarget.getAttribute("aria-haspopup")!=="true"))switch(b.key){case co.next(s(),n.orientation()):b.stopPropagation(),b.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.nextMenu();break;case co.previous(s(),n.orientation()):if(b.currentTarget.hasAttribute("data-closed"))break;b.stopPropagation(),b.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.previousMenu();break}},p=b=>{var S;(S=l.onEscapeKeyDown)==null||S.call(l,b),o==null||o.setAutoFocusMenu(!1),r.close(!0)},g=b=>{var S;(S=l.onFocusOutside)==null||S.call(l,b),n.isModal()&&b.preventDefault()},v=b=>{var S,C;ee(b,l.onPointerEnter),r.isOpen()&&((S=r.parentMenuContext())==null||S.listState().selectionManager().setFocused(!1),(C=r.parentMenuContext())==null||C.listState().selectionManager().setFocusedKey(void 0))},m=b=>{if(ee(b,l.onPointerMove),b.pointerType!=="mouse")return;const S=b.target,C=u!==b.clientX;$e(b.currentTarget,S)&&C&&(r.setPointerDir(b.clientX>u?"right":"left"),u=b.clientX)};j(()=>Y(r.registerContentId(l.id))),Y(()=>r.setContentRef(void 0));const y={ref:me(b=>{r.setContentRef(b),t=b},l.ref),role:"menu",get id(){return l.id},get tabIndex(){return d.tabIndex()},get"aria-labelledby"(){return r.triggerId()},onKeyDown:ye([l.onKeyDown,d.onKeyDown,h]),onMouseDown:ye([l.onMouseDown,d.onMouseDown]),onFocusIn:ye([l.onFocusIn,d.onFocusIn]),onFocusOut:ye([l.onFocusOut,d.onFocusOut]),onPointerEnter:v,onPointerMove:m,get"data-orientation"(){return n.orientation()}};return w(de,{get when(){return r.contentPresent()},get children(){return w(de,{get when(){return i===void 0||r.parentMenuContext()!=null},get fallback(){return w(le,F({as:"div"},()=>r.dataset(),y,c))},get children(){return w(Cn.Positioner,{get children(){return w(xo,F({get disableOutsidePointerEvents(){return L(()=>!!f())()&&r.isOpen()},get excludedElements(){return[r.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return ct({"--kb-menu-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},l.style)},onEscapeKeyDown:p,onFocusOutside:g,get onDismiss(){return r.close}},()=>r.dataset(),y,c))}})}})}})}function k0(e){let t;const n=At(),r=Ut(),[o,i]=_(e,["ref"]);return Ga({element:()=>t??null,enabled:()=>r.contentPresent()&&n.preventScroll()}),w(Mh,F({ref(s){var a=me(l=>{t=l},o.ref);typeof a=="function"&&a(s)}},i))}var Ih=Ce();function V0(){const e=xe(Ih);if(e===void 0)throw new Error("[kobalte]: `useMenuGroupContext` must be used within a `Menu.Group` component");return e}function Ph(e){const t=At(),n=Z({id:t.generateId(`group-${Ie()}`)},e),[r,o]=z(),i={generateId:Ye(()=>n.id),registerLabelId:_e(o)};return w(Ih.Provider,{value:i,get children(){return w(le,F({as:"div",role:"group",get"aria-labelledby"(){return r()}},n))}})}function N0(e){const t=V0(),n=Z({id:t.generateId("label")},e),[r,o]=_(n,["id"]);return j(()=>Y(t.registerLabelId(r.id))),w(le,F({as:"span",get id(){return r.id},"aria-hidden":"true"},o))}function Rh(e){const t=Ut(),n=Z({children:"▼"},e);return w(le,F({as:"span","aria-hidden":"true"},()=>t.dataset(),n))}function K0(e){return w(hl,F({role:"menuitem",closeOnSelect:!0},e))}function z0(e){const t=fl(),n=Z({id:t.generateId("description")},e),[r,o]=_(n,["id"]);return j(()=>Y(t.registerDescription(r.id))),w(le,F({as:"div",get id(){return r.id}},()=>t.dataset(),o))}function B0(e){const t=fl(),n=Z({id:t.generateId("indicator")},e),[r,o]=_(n,["forceMount"]);return w(de,{get when(){return r.forceMount||t.isChecked()},get children(){return w(le,F({as:"div"},()=>t.dataset(),o))}})}function j0(e){const t=fl(),n=Z({id:t.generateId("label")},e),[r,o]=_(n,["ref","id"]);return j(()=>Y(t.registerLabel(r.id))),w(le,F({as:"div",ref(i){var s=me(t.setLabelRef,r.ref);typeof s=="function"&&s(i)},get id(){return r.id}},()=>t.dataset(),o))}function U0(e){const t=Ut();return w(de,{get when(){return t.contentPresent()},get children(){return w(mo,e)}})}var Oh=Ce();function H0(){const e=xe(Oh);if(e===void 0)throw new Error("[kobalte]: `useMenuRadioGroupContext` must be used within a `Menu.RadioGroup` component");return e}function G0(e){const n=At().generateId(`radiogroup-${Ie()}`),r=Z({id:n},e),[o,i]=_(r,["value","defaultValue","onChange","disabled"]),[s,a]=wt({value:()=>o.value,defaultValue:()=>o.defaultValue,onChange:c=>{var u;return(u=o.onChange)==null?void 0:u.call(o,c)}}),l={isDisabled:()=>o.disabled,isSelectedValue:c=>c===s(),setSelectedValue:c=>a(c)};return w(Oh.Provider,{value:l,get children(){return w(Ph,i)}})}function q0(e){const t=H0(),n=Z({closeOnSelect:!1},e),[r,o]=_(n,["value","onSelect"]);return w(hl,F({role:"menuitemradio",get checked(){return t.isSelectedValue(r.value)},onSelect:()=>{var s;(s=r.onSelect)==null||s.call(r),t.setSelectedValue(r.value)}},o))}function W0(e,t,n){const r=e.split("-")[0],o=n.getBoundingClientRect(),i=[],s=t.clientX,a=t.clientY;switch(r){case"top":i.push([s,a+5]),i.push([o.left,o.bottom]),i.push([o.left,o.top]),i.push([o.right,o.top]),i.push([o.right,o.bottom]);break;case"right":i.push([s-5,a]),i.push([o.left,o.top]),i.push([o.right,o.top]),i.push([o.right,o.bottom]),i.push([o.left,o.bottom]);break;case"bottom":i.push([s,a-5]),i.push([o.right,o.top]),i.push([o.right,o.bottom]),i.push([o.left,o.bottom]),i.push([o.left,o.top]);break;case"left":i.push([s+5,a]),i.push([o.right,o.bottom]),i.push([o.left,o.bottom]),i.push([o.left,o.top]),i.push([o.right,o.top]);break}return i}function Q0(e,t){return t?hf([e.clientX,e.clientY],t):!1}function Fh(e){const t=At(),n=mh(),r=$i(),o=Io(),i=dl(),s=Z({placement:t.orientation()==="horizontal"?"bottom-start":"right-start"},e),[a,l]=_(s,["open","defaultOpen","onOpenChange"]);let c=0,u=null,f="right";const[d,h]=z(),[p,g]=z(),[v,m]=z(),[y,b]=z(),[S,C]=z(!0),[R,D]=z(l.placement),[V,$]=z([]),[k,N]=z([]),{DomCollectionProvider:B}=D0({items:k,onItemsChange:N}),ne=Co({open:()=>a.open,defaultOpen:()=>a.defaultOpen,onOpenChange:ie=>{var Pe;return(Pe=a.onOpenChange)==null?void 0:Pe.call(a,ie)}}),{present:I}=Vn({show:()=>t.forceMount()||ne.isOpen(),element:()=>y()??null}),M=cl({selectionMode:"none",dataSource:k}),x=ie=>{C(ie),ne.open()},O=(ie=!1)=>{ne.close(),ie&&r&&r.close(!0)},P=ie=>{C(ie),ne.toggle()},A=()=>{const ie=y();ie&&(Fe(ie),M.selectionManager().setFocused(!0),M.selectionManager().setFocusedKey(void 0))},K=()=>{i!=null?setTimeout(()=>A()):A()},H=ie=>{$(Te=>[...Te,ie]);const Pe=r==null?void 0:r.registerNestedMenu(ie);return()=>{$(Te=>Ws(Te,ie)),Pe==null||Pe()}},q=ie=>f===(u==null?void 0:u.side)&&Q0(ie,u==null?void 0:u.area),oe=ie=>{q(ie)&&ie.preventDefault()},J=ie=>{q(ie)||K()},fe=ie=>{q(ie)&&ie.preventDefault()};Ha({isDisabled:()=>!(r==null&&ne.isOpen()&&t.isModal()),targets:()=>[y(),...V()].filter(Boolean)}),j(()=>{const ie=y();if(!ie||!r)return;const Pe=r.registerNestedMenu(ie);Y(()=>{Pe()})}),j(()=>{r===void 0&&(o==null||o.registerMenu(t.value(),[y(),...V()]))}),j(()=>{var ie;r!==void 0||o===void 0||(o.value()===t.value()?((ie=v())==null||ie.focus(),o.autoFocusMenu()&&x(!0)):O())}),j(()=>{r!==void 0||o===void 0||ne.isOpen()&&o.setValue(t.value())}),Y(()=>{r===void 0&&(o==null||o.unregisterMenu(t.value()))});const Je={dataset:L(()=>({"data-expanded":ne.isOpen()?"":void 0,"data-closed":ne.isOpen()?void 0:""})),isOpen:ne.isOpen,contentPresent:I,nestedMenus:V,currentPlacement:R,pointerGraceTimeoutId:()=>c,autoFocus:S,listState:()=>M,parentMenuContext:()=>r,triggerRef:v,contentRef:y,triggerId:d,contentId:p,setTriggerRef:m,setContentRef:b,open:x,close:O,toggle:P,focusContent:K,onItemEnter:oe,onItemLeave:J,onTriggerLeave:fe,setPointerDir:ie=>f=ie,setPointerGraceTimeoutId:ie=>c=ie,setPointerGraceIntent:ie=>u=ie,registerNestedMenu:H,registerItemToParentDomCollection:n==null?void 0:n.registerItem,registerTriggerId:_e(h),registerContentId:_e(g)};return w(B,{get children(){return w(xh.Provider,{value:Je,get children(){return w(de,{when:i===void 0,get fallback(){return l.children},get children(){return w(Cn,F({anchorRef:v,contentRef:y,onCurrentPlacementChange:D},l))}})}})}})}function X0(e){const{direction:t}=xn();return w(Fh,F({get placement(){return t()==="rtl"?"left-start":"right-start"},flip:!0},e))}var Y0={close:(e,t)=>e==="ltr"?[t==="horizontal"?"ArrowLeft":"ArrowUp"]:[t==="horizontal"?"ArrowRight":"ArrowDown"]};function J0(e){const t=Ut(),n=At(),[r,o]=_(e,["onFocusOutside","onKeyDown"]),{direction:i}=xn();return w(Mh,F({onOpenAutoFocus:u=>{u.preventDefault()},onCloseAutoFocus:u=>{u.preventDefault()},onFocusOutside:u=>{var d;(d=r.onFocusOutside)==null||d.call(r,u);const f=u.target;$e(t.triggerRef(),f)||t.close()},onKeyDown:u=>{ee(u,r.onKeyDown);const f=$e(u.currentTarget,u.target),d=Y0.close(i(),n.orientation()).includes(u.key),h=t.parentMenuContext()!=null;f&&d&&h&&(t.close(),Fe(t.triggerRef()))}},o))}var Ec=["Enter"," "],Z0={open:(e,t)=>e==="ltr"?[...Ec,t==="horizontal"?"ArrowRight":"ArrowDown"]:[...Ec,t==="horizontal"?"ArrowLeft":"ArrowUp"]};function eS(e){let t;const n=At(),r=Ut(),o=Z({id:n.generateId(`sub-trigger-${Ie()}`)},e),[i,s]=_(o,["ref","id","textValue","disabled","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]);let a=null;const l=()=>{a&&window.clearTimeout(a),a=null},{direction:c}=xn(),u=()=>i.id,f=()=>{const b=r.parentMenuContext();if(b==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");return b.listState().selectionManager()},d=()=>r.listState().collection(),h=()=>f().focusedKey()===u(),p=ul({key:u,selectionManager:f,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},()=>t),g=b=>{ee(b,i.onClick),!r.isOpen()&&!i.disabled&&r.open(!0)},v=b=>{var C;if(ee(b,i.onPointerMove),b.pointerType!=="mouse")return;const S=r.parentMenuContext();if(S==null||S.onItemEnter(b),!b.defaultPrevented){if(i.disabled){S==null||S.onItemLeave(b);return}!r.isOpen()&&!a&&((C=r.parentMenuContext())==null||C.setPointerGraceIntent(null),a=window.setTimeout(()=>{r.open(!1),l()},100)),S==null||S.onItemEnter(b),b.defaultPrevented||(r.listState().selectionManager().isFocused()&&(r.listState().selectionManager().setFocused(!1),r.listState().selectionManager().setFocusedKey(void 0)),Fe(b.currentTarget),S==null||S.listState().selectionManager().setFocused(!0),S==null||S.listState().selectionManager().setFocusedKey(u()))}},m=b=>{if(ee(b,i.onPointerLeave),b.pointerType!=="mouse")return;l();const S=r.parentMenuContext(),C=r.contentRef();if(C){S==null||S.setPointerGraceIntent({area:W0(r.currentPlacement(),b,C),side:r.currentPlacement().split("-")[0]}),window.clearTimeout(S==null?void 0:S.pointerGraceTimeoutId());const R=window.setTimeout(()=>{S==null||S.setPointerGraceIntent(null)},300);S==null||S.setPointerGraceTimeoutId(R)}else{if(S==null||S.onTriggerLeave(b),b.defaultPrevented)return;S==null||S.setPointerGraceIntent(null)}S==null||S.onItemLeave(b)},y=b=>{ee(b,i.onKeyDown),!b.repeat&&(i.disabled||Z0.open(c(),n.orientation()).includes(b.key)&&(b.stopPropagation(),b.preventDefault(),f().setFocused(!1),f().setFocusedKey(void 0),r.isOpen()||r.open("first"),r.focusContent(),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(d().getFirstKey())))};return j(()=>{if(r.registerItemToParentDomCollection==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");const b=r.registerItemToParentDomCollection({ref:()=>t,type:"item",key:u(),textValue:i.textValue??(t==null?void 0:t.textContent)??"",disabled:i.disabled??!1});Y(b)}),j(Ee(()=>{var b;return(b=r.parentMenuContext())==null?void 0:b.pointerGraceTimeoutId()},b=>{Y(()=>{var S;window.clearTimeout(b),(S=r.parentMenuContext())==null||S.setPointerGraceIntent(null)})})),j(()=>Y(r.registerTriggerId(i.id))),Y(()=>{l()}),w(le,F({as:"div",ref(b){var S=me(C=>{r.setTriggerRef(C),t=C},i.ref);typeof S=="function"&&S(b)},get id(){return i.id},role:"menuitem",get tabIndex(){return p.tabIndex()},"aria-haspopup":"true",get"aria-expanded"(){return r.isOpen()},get"aria-controls"(){return L(()=>!!r.isOpen())()?r.contentId():void 0},get"aria-disabled"(){return i.disabled},get"data-key"(){return p.dataKey()},get"data-highlighted"(){return h()?"":void 0},get"data-disabled"(){return i.disabled?"":void 0},get onPointerDown(){return ye([i.onPointerDown,p.onPointerDown])},get onPointerUp(){return ye([i.onPointerUp,p.onPointerUp])},get onClick(){return ye([g,p.onClick])},get onKeyDown(){return ye([y,p.onKeyDown])},get onMouseDown(){return ye([i.onMouseDown,p.onMouseDown])},get onFocus(){return ye([i.onFocus,p.onFocus])},onPointerMove:v,onPointerLeave:m},()=>r.dataset(),s))}function tS(e){const t=Io(),n=`menu-${Ie()}`,r=Z({id:n,modal:!0},e),[o,i]=_(r,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value","orientation"]),s=Co({open:()=>o.open,defaultOpen:()=>o.defaultOpen,onOpenChange:l=>{var c;return(c=o.onOpenChange)==null?void 0:c.call(o,l)}}),a={isModal:()=>o.modal??!0,preventScroll:()=>o.preventScroll??a.isModal(),forceMount:()=>o.forceMount??!1,generateId:Ye(()=>o.id),value:()=>o.value,orientation:()=>o.orientation??(t==null?void 0:t.orientation())??"horizontal"};return w(Eh.Provider,{value:a,get children(){return w(Fh,F({get open(){return s.isOpen()},get onOpenChange(){return s.setIsOpen}},i))}})}function $h(e){const t=Lr(),n=Z({modal:!1},e),[r,o]=_(n,["value"]),i=Ie(),s=t.generateId(`menubar-menu-${i}`),a=Z({id:s},o);return w(tS,F({get value(){return r.value??i}},a))}function nS(e){let t;const n=`menubar-${Ie()}`,r=Z({id:n,loop:!0,orientation:"horizontal"},e),[o,i]=_(r,["ref","value","defaultValue","onValueChange","loop","focusOnAlt","autoFocusMenu","onAutoFocusMenuChange","orientation"]),[s,a]=wt({value:()=>o.value,defaultValue:()=>o.defaultValue,onChange:y=>{var b;return(b=o.onValueChange)==null?void 0:b.call(o,y)}}),[l,c]=z(),[u,f]=z(new Map),[d,h]=wt({value:()=>o.autoFocusMenu,defaultValue:()=>!1,onChange:o.onAutoFocusMenuChange}),p=()=>{var y;return s()&&d()&&!((y=s())!=null&&y.includes("link-trigger-"))},v={dataset:L(()=>({"data-expanded":p()?"":void 0,"data-closed":p()?void 0:""})),value:s,setValue:a,lastValue:l,setLastValue:c,menus:()=>new Set([...u().keys()]),menuRefs:()=>[...u().values()].flat(),menuRefMap:()=>u(),registerMenu:(y,b)=>{f(S=>{const C=new Map;return S.forEach((R,D)=>C.set(D,R)),C.set(y,b),C})},unregisterMenu:y=>{f(b=>{b.delete(y);const S=new Map;return b.forEach((C,R)=>S.set(R,C)),S})},nextMenu:()=>{const y=[...u().keys()];if(s()==null){a(y[0]);return}const b=y.indexOf(s());if(b===y.length-1){o.loop&&a(y[0]);return}a(y[b+1])},previousMenu:()=>{const y=[...u().keys()];if(s()==null){a(y[0]);return}const b=y.indexOf(s());if(b===0){o.loop&&a(y[y.length-1]);return}a(y[b-1])},closeMenu:()=>{h(!1),a(void 0)},autoFocusMenu:()=>d(),setAutoFocusMenu:h,generateId:Ye(()=>i.id),orientation:()=>o.orientation};j(()=>{s()==null&&h(!1)}),Ff({onInteractOutside:()=>{v.closeMenu(),setTimeout(()=>v.closeMenu())},shouldExcludeElement:y=>[t,...u().values()].flat().some(b=>$e(b,y))},()=>t);const m=y=>{y.key==="Alt"&&(y.preventDefault(),y.stopPropagation(),v.value()===void 0?v.nextMenu():v.closeMenu())};return j(()=>{o.focusOnAlt?window.addEventListener("keydown",m):window.removeEventListener("keydown",m),Y(()=>{window.removeEventListener("keydown",m)})}),j(()=>{s()!=null&&c(s())}),w(bh.Provider,{value:v,get children(){return w(le,F({as:"div",ref(y){var b=me(S=>t=S,o.ref);typeof b=="function"&&b(y)},role:"menubar",get"data-orientation"(){return o.orientation},get"aria-orientation"(){return o.orientation}},i))}})}function rS(e){const t=Lr();if($i()===void 0&&Object.hasOwn(e,"href")){const r=t.generateId("link-trigger-")+Ie();return w($h,{value:r,get children(){return w(Cc,e)}})}return Cc(e)}var oS={};dt(oS,{Root:()=>gl,Separator:()=>iS});function gl(e){let t;const n=Z({orientation:"horizontal"},e),[r,o]=_(n,["ref","orientation"]),i=Ei(()=>t,()=>"hr");return w(le,F({as:"hr",ref(s){var a=me(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))}var iS=gl,Ah=te("<li role=presentation>"),sS=te("<nav>");function aS(e){let t;const n=Lr(),r=Z({size:15},e),[o,i]=_(r,["ref"]),[s,a]=z(0),l=()=>n.orientation()==="horizontal";return j(Ee(n.value,c=>{setTimeout(()=>{if(!c||c.includes("link-trigger-"))return;const u=document.querySelector(`[data-kb-menu-value-trigger="${c}"]`);if(!u||!t)return;const f=u.getBoundingClientRect()[l()?"x":"y"]+u.getBoundingClientRect()[l()?"width":"height"]/2,d=window.getComputedStyle(t),h=t.getBoundingClientRect()[l()?"x":"y"]+t.getBoundingClientRect()[l()?"width":"height"]/2-Number.parseFloat(d.transform.split(",")[l()?4:5]);a(f-h)})})),w(Dr,F({ref(c){var u=me(f=>t=f,o.ref);typeof u=="function"&&u(c)},get style(){return{transform:`translate${l()?"X":"Y"}(${s()}px)`,color:"red"}}},i))}function Th(e){const t=Po(),n=Lr(),r=At(),[o,i]=z(),[s,a]=_(e,["onPointerEnter","onPointerLeave"]),l=u=>{ee(u,s.onPointerEnter),t.cancelLeaveTimer()},c=u=>{ee(u,s.onPointerLeave),t.startLeaveTimer()};return j(Ee(n.value,u=>{bi(()=>{if(!u||u.includes("link-trigger-")){t.setPreviousMenu(void 0);return}if(u===r.value()){if(t.previousMenu()!=null){const p=[...n.menus()],g=p.indexOf(t.previousMenu()),v=p.indexOf(u);g<v?i("from-end"):i("from-start")}else i(void 0);t.setPreviousMenu(u);return}const f=[...n.menus()],d=f.indexOf(t.previousMenu()),h=f.indexOf(u);d>h?i("to-end"):i("to-start")})})),w(k0,F({as:"ul",onPointerEnter:l,onPointerLeave:c,onInteractOutside:()=>{t.setAutoFocusMenu(!1)},get"data-motion"(){return o()}},a))}function Dh(e){return(()=>{var t=Ah();return W(t,w(K0,F({as:"a"},e))),t})()}function Lh(e){const t=Lr(),n=Po(),[r,o]=_(e,["value"]),i=Ie(),s=t.generateId(`navigation-menu-menu-${i}`),a=Z({id:s},o),l=()=>r.value??i,[c,u]=z(!1),f=()=>{var d,h;t.value()!==l()&&u(!1),(d=n.viewportRef())==null||d.removeEventListener("animationend",f),(h=n.viewportRef())==null||h.removeEventListener("animationcancel",f)};return j(Ee(t.value,d=>{if(d===l())u(!0);else{const h=n.viewportRef();if(!h||["","none"].includes(window.getComputedStyle(h).animationName)){u(!1);return}h.addEventListener("animationend",f)}})),w($h,F({get forceMount(){return c()},get value(){return l()}},a))}function _h(e){const t=Po(),n=Ut(),[r,o]=_(e,["ref"]);return w(de,{get when(){return t.viewportPresent()},get children(){return w(U0,F({ref(i){var s=me(a=>{a&&a.setAttribute("role","presentation")},r.ref);typeof s=="function"&&s(i)},get mount(){return L(()=>n.parentMenuContext()==null)()?t.viewportRef():void 0}},o))}})}function kh(e){const t=Z({delayDuration:200,skipDelayDuration:300},e),[n,r,o]=_(t,["ref","delayDuration","skipDelayDuration","autoFocusMenu","onAutoFocusMenuChange","defaultValue","value","onValueChange","forceMount"],["getAnchorRect","placement","gutter","shift","flip","slide","overlap","sameWidth","fitViewport","hideWhenDetached","detachedPadding","arrowPadding","overflowPadding"]),[i,s]=wt({value:()=>n.value,defaultValue:()=>n.defaultValue,onChange:$=>{var k;return(k=n.onValueChange)==null?void 0:k.call(n,$)}}),[a,l]=wt({value:()=>n.autoFocusMenu,defaultValue:()=>!1,onChange:n.onAutoFocusMenuChange}),[c,u]=z(),[f,d]=z(),[h,p]=z(r.placement??o.orientation==="vertical"?"right":"bottom");j(()=>{p(o.orientation==="vertical"?"right":"bottom")});let g;const[v,m]=z(),[y,b]=z(!1),[S,C]=z(!1);j(()=>{i()&&!i().includes("link-trigger-")&&a()?bi(()=>{C(!0),b(!0)}):(C(!1),b(!1))});const R=L(()=>({"data-expanded":S()?"":void 0,"data-closed":S()?void 0:""})),{present:D}=Vn({show:()=>n.forceMount||y()||S(),element:()=>c()??null});j(()=>{D()||V.setPreviousMenu(void 0)});const V={dataset:R,delayDuration:()=>n.delayDuration,skipDelayDuration:()=>n.skipDelayDuration,autoFocusMenu:a,setAutoFocusMenu:l,startLeaveTimer:()=>{g=window.setTimeout(()=>{V.setAutoFocusMenu(!1),s(void 0)},V.skipDelayDuration())},cancelLeaveTimer:()=>{g&&clearTimeout(g)},rootRef:f,setRootRef:d,viewportRef:c,setViewportRef:u,viewportPresent:D,currentPlacement:h,previousMenu:v,setPreviousMenu:m};return w(Sh.Provider,{value:V,get children(){return w(Cn,F({anchorRef:f,contentRef:c,get placement(){return h()},onCurrentPlacementChange:p},r,{get children(){var $=sS();return W($,w(nS,F({as:"ul",ref(k){var N=me(V.setRootRef,n.ref);typeof N=="function"&&N(k)},get value(){return i()??null},onValueChange:s,get autoFocusMenu(){return a()},onAutoFocusMenuChange:l},o))),$}}))}})}function Vh(e){const t=Po(),n=$i(),[r,o]=_(e,["onPointerEnter","onPointerLeave","onClick"]);let i;const s=c=>{ee(c,r.onClick),i&&clearTimeout(i)},a=c=>{ee(c,r.onPointerEnter),c.pointerType!=="touch"&&(t.cancelLeaveTimer(),t.dataset()["data-expanded"]!==""&&(i=window.setTimeout(()=>{var u;(u=n==null?void 0:n.triggerRef())==null||u.focus(),setTimeout(()=>{t.setAutoFocusMenu(!0)})},t.delayDuration())))},l=c=>{ee(c,r.onPointerLeave),c.pointerType!=="touch"&&(t.startLeaveTimer(),i&&clearTimeout(i))};return(()=>{var c=Ah();return W(c,w(rS,F({onClick:s,onPointerEnter:a,onPointerLeave:l},o))),c})()}function Nh(e){const t=Po(),n=Lr(),[r,o]=z(),[i,s]=_(e,["ref","style","onEscapeKeyDown"]),a=()=>{n.setAutoFocusMenu(!1),n.closeMenu()},l=d=>{a()},c=b0(r);j(Ee(()=>n.value()?n.menuRefMap().get(n.value()):void 0,d=>{d===void 0||d[0]===void 0||o(d[0])}));const u=L(d=>{if(!(r()===void 0||!t.viewportPresent()))return c.height()===0?d:c.height()}),f=L(d=>{if(!(r()===void 0||!t.viewportPresent()))return c.width()===0?d:c.width()});return w(de,{get when(){return t.viewportPresent()},get children(){return w(Cn.Positioner,{role:"presentation",get children(){return w(xo,F({as:"li",ref(d){var h=me(t.setViewportRef,i.ref);typeof h=="function"&&h(d)},get excludedElements(){return[t.rootRef]},bypassTopMostLayerCheck:!0,get style(){return ct({"--kb-menu-content-transform-origin":"var(--kb-popper-content-transform-origin)","--kb-navigation-menu-viewport-height":u()?`${u()}px`:void 0,"--kb-navigation-menu-viewport-width":f()?`${f()}px`:void 0,position:"relative"},i.style)},get onEscapeKeyDown(){return ye([i.onEscapeKeyDown,l])},onDismiss:a,get"data-orientation"(){return n.orientation()}},()=>t.dataset(),s))}})}})}Object.assign(kh,{Arrow:aS,CheckboxItem:_0,Content:Th,Group:Ph,GroupLabel:N0,Icon:Rh,Item:Dh,ItemDescription:z0,ItemIndicator:B0,ItemLabel:j0,Portal:_h,RadioGroup:G0,RadioItem:q0,Menu:Lh,Separator:gl,Sub:X0,SubContent:J0,SubTrigger:eS,Trigger:Vh,Viewport:Nh});var lS=te('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round class="relative top-px ml-1 size-3 transition duration-200 group-data-[expanded]/trigger:rotate-180 group-data-[orientation=vertical]/menu:-rotate-90 group-data-[orientation=vertical]/menu:group-data-[expanded]/trigger:rotate-90"><path d="M6 9l6 6l6 -6">');const Mc=Lh,Ic=e=>{const[t,n]=_(e,["class","children"]);return w(kh,F({gutter:6,get class(){return ce("group/menu flex w-max flex-1 list-none items-center justify-center data-[orientation=vertical]:flex-col [&>li]:w-full",t.class)}},n,{get children(){return[L(()=>t.children),w(uS,{})]}}))},Pc=e=>{const[t,n]=_(e,["class"]);return w(Vh,F({get class(){return ce("group/trigger inline-flex h-10 w-full items-center justify-center whitespace-nowrap rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[expanded]:bg-accent/50",t.class)}},n))},Rc=()=>w(Rh,{"aria-hidden":"true",get children(){return lS()}}),uS=e=>{const[t,n]=_(e,["class"]);return w(Nh,F({get class(){return ce("pointer-events-none z-[1000] flex h-[var(--kb-navigation-menu-viewport-height)] w-[var(--kb-navigation-menu-viewport-width)] origin-[var(--kb-menu-content-transform-origin)] items-center justify-center overflow-x-clip overflow-y-visible rounded-md border bg-popover opacity-0 shadow-lg data-[expanded]:pointer-events-auto data-[orientation=vertical]:overflow-y-clip data-[orientation=vertical]:overflow-x-visible data-[expanded]:rounded-md","animate-content-hide transition-[width,height] duration-200 ease-in data-[expanded]:animate-content-show data-[expanded]:opacity-100 data-[expanded]:ease-out",t.class)}},n))},Oc=e=>{const[t,n]=_(e,["class"]);return w(_h,{get children(){return w(Th,F({get class(){return ce("pointer-events-none absolute left-0 top-0 box-border p-1 focus:outline-none data-[expanded]:pointer-events-auto","data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out","data-[orientation=horizontal]:data-[motion=from-start]:slide-in-from-left-52 data-[orientation=horizontal]:data-[motion=to-end]:slide-out-to-right-52","data-[orientation=horizontal]:data-[motion=from-end]:slide-in-from-right-52 data-[orientation=horizontal]:data-[motion=to-start]:slide-out-to-left-52","data-[orientation=vertical]:data-[motion=from-start]:slide-in-from-top-52 data-[orientation=vertical]:data-[motion=to-end]:slide-out-to-bottom-52","data-[orientation=vertical]:data-[motion=from-end]:slide-in-from-bottom-52 data-[orientation=vertical]:data-[motion=to-start]:slide-out-to-bottom-52",t.class)}},n))}})},Fc=e=>{const[t,n]=_(e,["class"]);return w(Dh,F({get class(){return ce("text-sm block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground",t.class)}},n))};var Ai=te("<li>"),cS=te("<ul>"),dS={};dt(dS,{Ellipsis:()=>pl,Item:()=>ml,Items:()=>vl,Next:()=>yl,Pagination:()=>fS,Previous:()=>wl,Root:()=>bl,usePaginationContext:()=>Ro});function pl(e){return(()=>{var t=Ai();return W(t,w(le,F({as:"div"},e))),t})()}var Kh=Ce();function Ro(){const e=xe(Kh);if(e===void 0)throw new Error("[kobalte]: `usePaginationContext` must be used within a `Pagination` component");return e}function ml(e){const t=Ro(),[n,r]=_(e,["page","onClick"]),o=()=>t.page()===n.page,i=()=>{t.setPage(n.page)};return(()=>{var s=Ai();return W(s,w(xt,F({get"aria-current"(){return o()?"page":void 0},get"data-current"(){return o()?"":void 0},get onClick(){return ye([n.onClick,i])}},r))),s})()}function vl(e){const t=Ro(),n=L(()=>{const{count:r,siblingCount:o,page:i,fixedItems:s,showFirst:a,showLast:l}=t,c=r()<2*o()+(s()?6:4);if(c)return{renderItemsDirectly:c};const u=a()&&i()-1>o(),f=l()&&r()-i()>o();let d=i()-(a()?2:1)>o(),h=r()-i()-(l()?1:0)>o(),p=Math.min(i()-1,o()),g=Math.min(r()-i(),o());if(s()!==!1){const v=p,m=g;p+=Math.max(o()-m,0),g+=Math.max(o()-v,0),u||g++,f||p++,s()===!0&&(d||g++,h||p++),i()-p-(a()?2:1)===1&&(d=!1,p++),r()-i()-g-(l()?1:0)===1&&(h=!1,g++)}return{showFirst:u,showLast:f,showFirstEllipsis:d,showLastEllipsis:h,previousSiblingCount:p,nextSiblingCount:g,renderItemsDirectly:c}});return w(de,{get when(){return n().renderItemsDirectly},get fallback(){return[w(de,{get when(){return n().showFirst},get children(){return t.renderItem(1)}}),w(de,{get when(){return n().showFirstEllipsis},get children(){return t.renderEllipsis()}}),w(et,{get each(){return[...Array(n().previousSiblingCount).keys()].reverse()},children:r=>L(()=>t.renderItem(t.page()-(r+1)))}),L(()=>t.renderItem(t.page())),w(et,{get each(){return[...Array(n().nextSiblingCount).keys()]},children:r=>L(()=>t.renderItem(t.page()+(r+1)))}),w(de,{get when(){return n().showLastEllipsis},get children(){return t.renderEllipsis()}}),w(de,{get when(){return n().showLast},get children(){return t.renderItem(t.count())}})]},get children(){return w(et,{get each(){return[...Array(t.count()).keys()]},children:r=>L(()=>t.renderItem(r+1))})}})}function yl(e){const t=Ro(),[n,r]=_(e,["onClick"]),o=()=>{t.setPage(t.page()+1)},i=()=>t.page()===t.count();return(()=>{var s=Ai();return W(s,w(xt,F({get tabIndex(){return i()||t.page()===t.count()?-1:void 0},get disabled(){return i()},get"aria-disabled"(){return i()||void 0},get"data-disabled"(){return i()?"":void 0},get onClick(){return ye([n.onClick,o])}},r))),s})()}function wl(e){const t=Ro(),[n,r]=_(e,["onClick"]),o=()=>{t.setPage(t.page()-1)},i=()=>t.page()===1;return(()=>{var s=Ai();return W(s,w(xt,F({get tabIndex(){return i()||t.page()===1?-1:void 0},get disabled(){return i()},get"aria-disabled"(){return i()||void 0},get"data-disabled"(){return i()?"":void 0},get onClick(){return ye([n.onClick,o])}},r))),s})()}function bl(e){const t=`pagination-${Ie()}`,n=Z({id:t},e),[r,o]=_(n,["page","defaultPage","onPageChange","count","siblingCount","showFirst","showLast","fixedItems","itemComponent","ellipsisComponent","disabled","children"]),i=wt({defaultValue:()=>r.defaultPage??1,onChange:r.onPageChange,value:()=>r.page}),s={count:()=>r.count,siblingCount:()=>r.siblingCount??1,showFirst:()=>r.showFirst??!0,showLast:()=>r.showLast??!0,fixedItems:()=>r.fixedItems??!1,isDisabled:()=>r.disabled??!1,renderItem:a=>r.itemComponent({page:a}),renderEllipsis:r.ellipsisComponent,page:()=>Math.min(i[0]()??1,r.count),setPage:i[1]};return w(Kh.Provider,{value:s,get children(){return w(le,F({as:"nav",get"data-disabled"(){return r.disabled?"":void 0}},o,{get children(){var a=cS();return W(a,()=>r.children),a}}))}})}var fS=Object.assign(bl,{Ellipsis:pl,Item:ml,Items:vl,Next:yl,Previous:wl});const Ti=Mr("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"}}),fn=e=>{const[t,n]=_(e,["variant","size","class"]);return w(xt,F({get class(){return ce(Ti({variant:t.variant,size:t.size}),t.class)}},n))};var hS=te('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round class=size-4><circle cx=12 cy=12 r=1></circle><circle cx=19 cy=12 r=1></circle><circle cx=5 cy=12 r=1>'),gS=te("<span class=sr-only>More pages"),pS=te('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round class=size-4><path d="M15 6l-6 6l6 6">'),mS=te("<span>Previous"),vS=te("<span>Next"),yS=te('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round class=size-4><path d="M9 6l6 6l-6 6">');const wS=vl,bS=e=>{const[t,n]=_(e,["class"]);return w(bl,F({get class(){return ce("[&>*]:flex [&>*]:flex-row [&>*]:items-center [&>*]:gap-1",t.class)}},n))},SS=e=>{const[t,n]=_(e,["class"]);return w(ml,F({get class(){return ce(Ti({variant:"ghost"}),"size-10 data-[current]:border",t.class)}},n))},xS=e=>{const[t,n]=_(e,["class"]);return w(pl,F({get class(){return ce("flex size-10 items-center justify-center",t.class)}},n,{get children(){return[hS(),gS()]}}))},CS=e=>{const[t,n]=_(e,["class","children"]);return w(wl,F({get class(){return ce(Ti({variant:"ghost"}),"gap-1 pl-2.5",t.class)}},n,{get children(){return t.children??[pS(),mS()]}}))},ES=e=>{const[t,n]=_(e,["class","children"]);return w(yl,F({get class(){return ce(Ti({variant:"ghost"}),"gap-1 pl-2.5",t.class)}},n,{get children(){return t.children??[vS(),yS()]}}))};var MS=te('<div class="relative w-full overflow-auto"><table>'),IS=te("<thead>"),PS=te("<tbody>"),RS=te("<tr>"),OS=te("<th>"),FS=te("<td>");const $S=e=>{const[t,n]=_(e,["class"]);return(()=>{var r=MS(),o=r.firstChild;return qe(o,F({get class(){return ce("w-full caption-bottom text-sm",t.class)}},n),!1,!1),r})()},AS=e=>{const[t,n]=_(e,["class"]);return(()=>{var r=IS();return qe(r,F({get class(){return ce("[&_tr]:border-b",t.class)}},n),!1,!1),r})()},TS=e=>{const[t,n]=_(e,["class"]);return(()=>{var r=PS();return qe(r,F({get class(){return ce(t.class)}},n),!1,!1),r})()},is=e=>{const[t,n]=_(e,["class"]);return(()=>{var r=RS();return qe(r,F({get class(){return ce("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",t.class)}},n),!1,!1),r})()},DS=e=>{const[t,n]=_(e,["class"]);return(()=>{var r=OS();return qe(r,F({get class(){return ce("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",t.class)}},n),!1,!1),r})()},$c=e=>{const[t,n]=_(e,["class"]);return(()=>{var r=FS();return qe(r,F({get class(){return ce("p-4 align-middle [&:has([role=checkbox])]:pr-0",t.class)}},n),!1,!1),r})()};var LS=(e,t,n={})=>{let r=`${e}=${t}`;if(e.startsWith("__Secure-")&&!n.secure)throw new Error("__Secure- Cookie must have Secure attributes");if(e.startsWith("__Host-")){if(!n.secure)throw new Error("__Host- Cookie must have Secure attributes");if(n.path!=="/")throw new Error('__Host- Cookie must have Path attributes with "/"');if(n.domain)throw new Error("__Host- Cookie must not have Domain attributes")}if(n&&typeof n.maxAge=="number"&&n.maxAge>=0){if(n.maxAge>3456e4)throw new Error("Cookies Max-Age SHOULD NOT be greater than 400 days (34560000 seconds) in duration.");r+=`; Max-Age=${Math.floor(n.maxAge)}`}if(n.domain&&n.prefix!=="host"&&(r+=`; Domain=${n.domain}`),n.path&&(r+=`; Path=${n.path}`),n.expires){if(n.expires.getTime()-Date.now()>3456e7)throw new Error("Cookies Expires SHOULD NOT be greater than 400 days (34560000 seconds) in the future.");r+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(r+="; HttpOnly"),n.secure&&(r+="; Secure"),n.sameSite&&(r+=`; SameSite=${n.sameSite.charAt(0).toUpperCase()+n.sameSite.slice(1)}`),n.partitioned){if(!n.secure)throw new Error("Partitioned Cookie must have Secure attributes");r+="; Partitioned"}return r},_S=(e,t,n)=>(t=encodeURIComponent(t),LS(e,t,n)),kS=(e,t)=>(e=e.replace(/\/+$/,""),e=e+"/",t=t.replace(/^\/+/,""),e+t),ca=(e,t)=>{for(const[n,r]of Object.entries(t)){const o=new RegExp("/:"+n+"(?:{[^/]+})?\\??");e=e.replace(o,r?`/${r}`:"")}return e},VS=(e,t)=>{switch(t){case"ws":return e.replace(/^http/,"ws");case"http":return e.replace(/^ws/,"http")}},NS=e=>/^https?:\/\/[^\/]+?\/index$/.test(e)?e.replace(/\/index$/,"/"):e.replace(/\/index$/,"");function Uo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function zh(e,t){if(!Uo(e)&&!Uo(t))return t;const n={...e};for(const r in t){const o=t[r];Uo(n[r])&&Uo(o)?n[r]=zh(n[r],o):n[r]=o}return n}var Bh=(e,t)=>new Proxy(()=>{},{get(r,o){if(!(typeof o!="string"||o==="then"))return Bh(e,[...t,o])},apply(r,o,i){return e({path:t,args:i})}}),KS=class{constructor(e,t){Re(this,"url");Re(this,"method");Re(this,"queryParams");Re(this,"pathParams",{});Re(this,"rBody");Re(this,"cType");Re(this,"fetch",async(e,t)=>{if(e){if(e.query){for(const[a,l]of Object.entries(e.query))if(l!==void 0)if(this.queryParams||(this.queryParams=new URLSearchParams),Array.isArray(l))for(const c of l)this.queryParams.append(a,c);else this.queryParams.set(a,l)}if(e.form){const a=new FormData;for(const[l,c]of Object.entries(e.form))if(Array.isArray(c))for(const u of c)a.append(l,u);else a.append(l,c);this.rBody=a}e.json&&(this.rBody=JSON.stringify(e.json),this.cType="application/json"),e.param&&(this.pathParams=e.param)}let n=this.method.toUpperCase();const r={...(e==null?void 0:e.header)??{},...typeof(t==null?void 0:t.headers)=="function"?await t.headers():t!=null&&t.headers?t.headers:{}};if(e!=null&&e.cookie){const a=[];for(const[l,c]of Object.entries(e.cookie))a.push(_S(l,c,{path:"/"}));r.Cookie=a.join(",")}this.cType&&(r["Content-Type"]=this.cType);const o=new Headers(r??void 0);let i=this.url;i=NS(i),i=ca(i,this.pathParams),this.queryParams&&(i=i+"?"+this.queryParams.toString()),n=this.method.toUpperCase();const s=!(n==="GET"||n==="HEAD");return((t==null?void 0:t.fetch)||fetch)(i,{body:s?this.rBody:void 0,method:n,headers:o,...t==null?void 0:t.init})});this.url=e,this.method=t}},zS=(e,t)=>Bh(function n(r){var c;const o=[...r.path];if(o[o.length-1]==="toString")return o[o.length-2]==="name"?o[o.length-3]||"":n.toString();if(o[o.length-1]==="valueOf")return o[o.length-2]==="name"?o[o.length-3]||"":n;let i="";if(/^\$/.test(o[o.length-1])){const u=o.pop();u&&(i=u.replace(/^\$/,""))}const s=o.join("/"),a=kS(e,s);if(i==="url")return r.args[0]&&r.args[0].param?new URL(ca(a,r.args[0].param)):new URL(a);if(i==="ws"){const u=VS(r.args[0]&&r.args[0].param?ca(a,r.args[0].param):a,"ws"),f=new URL(u),d=(c=r.args[0])==null?void 0:c.query;return d&&Object.entries(d).forEach(([p,g])=>{Array.isArray(g)?g.forEach(v=>f.searchParams.append(p,v)):f.searchParams.set(p,g)}),((...p)=>(t==null?void 0:t.webSocket)!==void 0&&typeof t.webSocket=="function"?t.webSocket(...p):new WebSocket(...p))(f.toString())}const l=new KS(a,i);if(i){t??(t={});const u=zh(t,{...r.args[1]??{}});return l.fetch(r.args[0],u)}return l},[]);const wn=zS("/rpc"),ss="production",BS=e=>xi(()=>({queryKey:["bundles",e()],queryFn:async()=>(await wn.bundles.$get({query:e()})).json(),placeholderData:t=>t,staleTime:Number.POSITIVE_INFINITY})),jS=e=>xi(()=>({queryKey:["bundle",e],queryFn:()=>wn.bundles[":bundleId"].$get({param:{bundleId:e}}).then(t=>t.json()),placeholderData:t=>t,staleTime:Number.POSITIVE_INFINITY})),US=()=>xi(()=>({queryKey:["config"],queryFn:()=>wn.config.$get().then(e=>e.json()),staleTime:Number.POSITIVE_INFINITY,retryOnMount:!1})),jh=()=>xi(()=>({queryKey:["channels"],queryFn:()=>wn.channels.$get().then(e=>e.json()),staleTime:Number.POSITIVE_INFINITY,retryOnMount:!1,select:e=>!e||e.length===0?null:e.includes(ss)?[ss,...e.filter(t=>t!==ss)]:e})),HS=()=>{const e=yo();return mm(()=>({mutationFn:async t=>{const n=await wn.bundles[":bundleId"].$delete({param:{bundleId:t}});if(!n.ok)throw new Error(`Failed to delete bundle: ${n.status}`);return n.json()},onSuccess:()=>{e.invalidateQueries({queryKey:["bundles"]})}}))};var GS=te('<div class="transition-opacity duration-300"><div class="flex flex-row justify-end p-3"><div class="flex items-center gap-4"><div class="text-sm text-muted-foreground">Platform:</div><div class="text-sm text-muted-foreground">Channel:</div></div></div><div class="border rounded-md">'),qS=te('<div class="mt-2 text-sm text-muted-foreground text-center">Showing <!> to <!> of <!> results');const WS=20,[Ct,Ho]=z({pageIndex:0,pageSize:WS});function QS(e){var g;const[t]=_(e,["columns","onRowClick"]),{channelFilter:n,platformFilter:r,setPlatformFilter:o,setChannelFilter:i}=Lf(),s=L(()=>({channel:n()??void 0,platform:r()??void 0,limit:Ct().pageSize.toString(),offset:(Ct().pageIndex*Ct().pageSize).toString()})),a=BS(s),l=L(()=>a.data??{data:[],pagination:null}),c=L(()=>l().data??[]),u=L(()=>l().pagination),f=w0({get data(){return c()},columns:t.columns,getCoreRowModel:g0(),getFilteredRowModel:y0(),state:{get pagination(){return Ct()},get globalFilter(){return r()}},onPaginationChange:Ho,globalFilterFn:(v,m,y)=>y?v.original.platform.toLowerCase()===y:!0,manualPagination:!0,pageCount:((g=u())==null?void 0:g.totalPages)??0}),d=v=>()=>{t.onRowClick(v.original)},h=jh();j(()=>{h.isFetched&&h.data&&n()===null&&i(h.data[0])});const p=v=>{Ho(m=>({...m,pageIndex:v}))};return(()=>{var v=GS(),m=v.firstChild,y=m.firstChild,b=y.firstChild,S=b.nextSibling,C=m.nextSibling;return W(y,w(Ic,{get children(){return w(Mc,{get children(){return[w(Pc,{class:"w-[100px]",get children(){return[L(()=>L(()=>!!r())()?r():"All"),w(Rc,{})]}}),w(Oc,{get children(){return w(et,{each:[{label:"All",value:null},{label:"iOS",value:"ios"},{label:"Android",value:"android"}],children:R=>w(Fc,{get classList(){return{"bg-primary text-primary-foreground":R.value===r()}},onClick:()=>{o(R.value),Ho(D=>({...D,pageIndex:0}))},get children(){return R.label}})})}})]}})}}),S),W(y,w(Ic,{get children(){return w(Mc,{get children(){return[w(Pc,{class:"w-[100px]",get children(){return[L(()=>n()),w(Rc,{})]}}),w(Oc,{get children(){return w(et,{get each(){return h.data},children:R=>w(Fc,{get classList(){return{"bg-primary text-primary-foreground":R===n()}},onClick:()=>{i(R),Ho(D=>({...D,pageIndex:0}))},children:R})})}})]}})}}),null),W(C,w($S,{get children(){return[w(AS,{get children(){return w(et,{get each(){return f.getHeaderGroups()},children:R=>w(is,{get children(){return w(et,{get each(){return R.headers},children:D=>w(DS,{get children(){return L(()=>!!D.isPlaceholder)()?null:wc(D.column.columnDef.header,D.getContext())}})})}})})}}),w(TS,{get children(){return L(()=>!!(a.isFetched&&c().length===0))()?w(is,{get children(){return w($c,{get colSpan(){return t.columns.length},class:"h-full text-center",children:"No results."})}}):w(et,{get each(){return f.getRowModel().rows},children:R=>w(is,{get"data-state"(){return R.getIsSelected()&&"selected"},class:"cursor-pointer",get onClick(){return d(R)},get children(){return w(et,{get each(){return R.getVisibleCells()},children:D=>w($c,{get children(){return wc(D.column.columnDef.cell,D.getContext())}})})}})})}})]}})),W(v,w(bS,{class:"mt-2.5 w-full [&>ul]:justify-center",itemComponent:R=>w(SS,{get page(){return R.page},onClick:()=>p(R.page-1),get children(){return R.page}}),ellipsisComponent:()=>w(xS,{}),get count(){var R;return((R=u())==null?void 0:R.totalPages)??1},get children(){return[w(CS,{onClick:()=>p(Ct().pageIndex-1),get disabled(){var R;return!((R=u())!=null&&R.hasPreviousPage)}}),w(wS,{}),w(ES,{onClick:()=>p(Ct().pageIndex+1),get disabled(){var R;return!((R=u())!=null&&R.hasNextPage)}})]}}),null),W(v,(()=>{var R=L(()=>!!u());return()=>R()&&(()=>{var D=qS(),V=D.firstChild,$=V.nextSibling,k=$.nextSibling,N=k.nextSibling,B=N.nextSibling,ne=B.nextSibling;return ne.nextSibling,W(D,()=>Ct().pageIndex*Ct().pageSize+1,$),W(D,()=>Math.min((Ct().pageIndex+1)*Ct().pageSize,u().total),N),W(D,()=>u().total,ne),D})()})(),null),Ve(R=>{var D=!!a.isFetching,V=!!a.isFetching;return D!==R.e&&v.classList.toggle("opacity-50",R.e=D),V!==R.t&&C.classList.toggle("min-h-[400px]",R.t=V),R},{e:void 0,t:void 0}),v})()}var XS={};dt(XS,{Root:()=>Sl,Skeleton:()=>YS});function Sl(e){const t=`skeleton-${Ie()}`,n=Z({visible:!0,animate:!0,id:t},e),[r,o]=_(n,["style","radius","animate","height","width","visible","circle"]);return w(le,F({as:"div",role:"group",get"data-animate"(){return r.animate||void 0},get"data-visible"(){return r.visible||void 0},get style(){return ct({"border-radius":r.circle?"9999px":r.radius?`${r.radius}px`:void 0,width:r.circle?`${r.height}px`:r.width?`${r.width}px`:"100%",height:r.height?`${r.height}px`:"auto"},r.style)}},o))}var YS=Sl;const JS=e=>{const[t,n]=_(e,["class"]);return w(Sl,F({get class(){return ce("bg-primary/10 data-[animate='true']:animate-pulse",t.class)}},n))};var ZS={};dt(ZS,{AlertDialog:()=>ex,CloseButton:()=>Sn,Content:()=>xl,Description:()=>Pr,Overlay:()=>Rr,Portal:()=>Or,Root:()=>Fr,Title:()=>$r,Trigger:()=>Eo});function xl(e){return w(Mi,F({role:"alertdialog"},e))}var ex=Object.assign(Fr,{CloseButton:Sn,Content:xl,Description:Pr,Overlay:Rr,Portal:Or,Title:$r,Trigger:Eo}),tx=te('<svg xmlns=http://www.w3.org/2000/svg width=24 height=24 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round class=size-4><title>Close dialog</title><path d="M18 6l-12 12"></path><path d="M6 6l12 12">'),nx=te("<span class=sr-only>Close");const Uh=Fr,Hh=Eo,rx=Or,Cl=e=>{const[t,n]=_(e,["class"]);return w(Rr,F({get class(){return ce("fixed inset-0 z-50 backdrop-blur-sm data-[expanded]:animate-in data-[closed]:animate-out data-[closed]:fade-out-0 data-[expanded]:fade-in-0",t.class)}},n))},Gh=e=>{const[t,n]=_(e,["class","children"]);return w(rx,{get children(){return[w(Cl,{}),w(xl,F({get class(){return ce("fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border bg-background p-6 shadow-lg duration-200 data-[expanded]:animate-in data-[closed]:animate-out data-[closed]:fade-out-0 data-[expanded]:fade-in-0 data-[closed]:zoom-out-95 data-[expanded]:zoom-in-95 data-[closed]:slide-out-to-left-1/2 data-[closed]:slide-out-to-top-[48%] data-[expanded]:slide-in-from-left-1/2 data-[expanded]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",t.class)}},n,{get children(){return[L(()=>t.children),w(Sn,{class:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[expanded]:bg-accent data-[expanded]:text-muted-foreground",get children(){return[tx(),nx()]}})]}}))]}})},qh=e=>{const[t,n]=_(e,["class"]);return w($r,F({get class(){return ce("text-lg font-semibold",t.class)}},n))},Wh=e=>{const[t,n]=_(e,["class"]);return w(Pr,F({get class(){return ce("text-sm text-muted-foreground",t.class)}},n))};var ox=te('<div class="h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent">'),ix=te('<div class="flex gap-2 justify-end mt-4">');const sx=({bundleId:e,onDeleteSuccess:t})=>{const n=HS(),r=()=>{n.mutate(e,{onSuccess:()=>{t()},onError:o=>{console.error("Failed to delete bundle:",o),Yt({title:"Error",description:"Failed to delete bundle. Please try again.",variant:"error"})}})};return w(Uh,{get children(){return[w(Hh,{as:fn,variant:"destructive",size:"sm",class:"gap-2 flex-1",get children(){return[w(nc,{class:"h-4 w-4"}),"Delete Bundle"]}}),w(Cl,{}),w(Gh,{get children(){return[w(qh,{children:"Delete Bundle"}),w(Wh,{children:"Are you sure you want to delete this bundle storage? This action cannot be undone."}),(()=>{var o=ix();return W(o,w(Sn,{as:fn,variant:"outline",size:"sm",children:"Cancel"}),null),W(o,w(fn,{variant:"destructive",size:"sm",onClick:r,get disabled(){return n.isPending},class:"gap-2",get children(){return[w(de,{get when(){return n.isPending},get fallback(){return w(nc,{class:"h-4 w-4"})},get children(){return ox()}}),L(()=>n.isPending?"Deleting...":"Delete")]}}),null),o})()]}})]}})},or=new WeakMap,ri=new WeakMap,vi={current:[]};let as=!1,eo=0;const Xr=new Set,Go=new Map;function Qh(e){const t=Array.from(e).sort((n,r)=>n instanceof zt&&n.options.deps.includes(r)?1:r instanceof zt&&r.options.deps.includes(n)?-1:0);for(const n of t){if(vi.current.includes(n))continue;vi.current.push(n),n.recompute();const r=ri.get(n);if(r)for(const o of r){const i=or.get(o);i&&Qh(i)}}}function ax(e){e.listeners.forEach(t=>t({prevVal:e.prevState,currentVal:e.state}))}function lx(e){e.listeners.forEach(t=>t({prevVal:e.prevState,currentVal:e.state}))}function Xh(e){if(eo>0&&!Go.has(e)&&Go.set(e,e.prevState),Xr.add(e),!(eo>0)&&!as)try{for(as=!0;Xr.size>0;){const t=Array.from(Xr);Xr.clear();for(const n of t){const r=Go.get(n)??n.prevState;n.prevState=r,ax(n)}for(const n of t){const r=or.get(n);r&&(vi.current.push(n),Qh(r))}for(const n of t){const r=or.get(n);if(r)for(const o of r)lx(o)}}}finally{as=!1,vi.current=[],Go.clear()}}function Et(e){eo++;try{e()}finally{if(eo--,eo===0){const t=Array.from(Xr)[0];t&&Xh(t)}}}function ux(e){return typeof e=="function"}class da{constructor(t,n){this.listeners=new Set,this.subscribe=r=>{var o,i;this.listeners.add(r);const s=(i=(o=this.options)==null?void 0:o.onSubscribe)==null?void 0:i.call(o,r,this);return()=>{this.listeners.delete(r),s==null||s()}},this.prevState=t,this.state=t,this.options=n}setState(t){var n,r,o;this.prevState=this.state,(n=this.options)!=null&&n.updateFn?this.state=this.options.updateFn(this.prevState)(t):ux(t)?this.state=t(this.prevState):this.state=t,(o=(r=this.options)==null?void 0:r.onUpdate)==null||o.call(r),Xh(this)}}class zt{constructor(t){this.listeners=new Set,this._subscriptions=[],this.lastSeenDepValues=[],this.getDepVals=()=>{const n=[],r=[];for(const o of this.options.deps)n.push(o.prevState),r.push(o.state);return this.lastSeenDepValues=r,{prevDepVals:n,currDepVals:r,prevVal:this.prevState??void 0}},this.recompute=()=>{var n,r;this.prevState=this.state;const{prevDepVals:o,currDepVals:i,prevVal:s}=this.getDepVals();this.state=this.options.fn({prevDepVals:o,currDepVals:i,prevVal:s}),(r=(n=this.options).onUpdate)==null||r.call(n)},this.checkIfRecalculationNeededDeeply=()=>{for(const i of this.options.deps)i instanceof zt&&i.checkIfRecalculationNeededDeeply();let n=!1;const r=this.lastSeenDepValues,{currDepVals:o}=this.getDepVals();for(let i=0;i<o.length;i++)if(o[i]!==r[i]){n=!0;break}n&&this.recompute()},this.mount=()=>(this.registerOnGraph(),this.checkIfRecalculationNeededDeeply(),()=>{this.unregisterFromGraph();for(const n of this._subscriptions)n()}),this.subscribe=n=>{var r,o;this.listeners.add(n);const i=(o=(r=this.options).onSubscribe)==null?void 0:o.call(r,n,this);return()=>{this.listeners.delete(n),i==null||i()}},this.options=t,this.state=t.fn({prevDepVals:void 0,prevVal:void 0,currDepVals:this.getDepVals().currDepVals})}registerOnGraph(t=this.options.deps){for(const n of t)if(n instanceof zt)n.registerOnGraph(),this.registerOnGraph(n.options.deps);else if(n instanceof da){let r=or.get(n);r||(r=new Set,or.set(n,r)),r.add(this);let o=ri.get(this);o||(o=new Set,ri.set(this,o)),o.add(n)}}unregisterFromGraph(t=this.options.deps){for(const n of t)if(n instanceof zt)this.unregisterFromGraph(n.options.deps);else if(n instanceof da){const r=or.get(n);r&&r.delete(this);const o=ri.get(this);o&&o.delete(n)}}}function El(e,t){return typeof e=="function"?e(t):e}function Yr(e,t){return Ml(t).reduce((r,o)=>{if(r===null)return null;if(typeof r<"u")return r[o]},e)}function qo(e,t,n){const r=Ml(t);function o(i){if(!r.length)return El(n,i);const s=r.shift();if(typeof s=="string"||typeof s=="number"&&!Array.isArray(i))return typeof i=="object"?(i===null&&(i={}),{...i,[s]:o(i[s])}):{[s]:o()};if(Array.isArray(i)&&typeof s=="number"){const a=i.slice(0,s);return[...a.length?a:new Array(s),o(i[s]),...i.slice(s+1)]}return[...new Array(s),o()]}return o(e)}function cx(e,t){const n=Ml(t);function r(o){if(!o)return;if(n.length===1){const s=n[0];if(Array.isArray(o)&&typeof s=="number")return o.filter((c,u)=>u!==s);const{[s]:a,...l}=o;return l}const i=n.shift();if(typeof i=="string"&&typeof o=="object")return{...o,[i]:r(o[i])};if(typeof i=="number"&&Array.isArray(o)){if(i>=o.length)return o;const s=o.slice(0,i);return[...s.length?s:new Array(i),r(o[i]),...o.slice(i+1)]}throw new Error("It seems we have created an infinite loop in deleteBy. ")}return r(e)}const dx=/^(\d+)$/gm,fx=/\.(\d+)(?=\.)/gm,hx=/^(\d+)\./gm,gx=/\.(\d+$)/gm,px=/\.{2,}/gm,fa="__int__",Wo=`${fa}$1`;function Ml(e){if(Array.isArray(e))return[...e];if(typeof e!="string")throw new Error("Path must be a string.");return e.replace(/(^\[)|]/gm,"").replace(/\[/g,".").replace(dx,Wo).replace(fx,`.${Wo}.`).replace(hx,`${Wo}.`).replace(gx,`.${Wo}`).replace(px,".").split(".").map(t=>t.indexOf(fa)===0?parseInt(t.substring(fa.length),10):t)}function mx(e){return!(Array.isArray(e)&&e.length===0)}function ha(e,t){const{asyncDebounceMs:n}=t,{onChangeAsync:r,onBlurAsync:o,onSubmitAsync:i,onBlurAsyncDebounceMs:s,onChangeAsyncDebounceMs:a}=t.validators||{},l=n??0,c={cause:"change",validate:r,debounceMs:a??l},u={cause:"blur",validate:o,debounceMs:s??l},f={cause:"submit",validate:i,debounceMs:0},d=h=>({...h,debounceMs:0});switch(e){case"submit":return[d(c),d(u),f];case"blur":return[u];case"change":return[c];case"server":default:return[]}}function ga(e,t){const{onChange:n,onBlur:r,onSubmit:o,onMount:i}=t.validators||{},s={cause:"change",validate:n},a={cause:"blur",validate:r},l={cause:"submit",validate:o},c={cause:"mount",validate:i},u={cause:"server",validate:()=>{}};switch(e){case"mount":return[c];case"submit":return[s,a,l,u];case"server":return[u];case"blur":return[a,u];case"change":default:return[s,u]}}const pa=e=>!!e&&typeof e=="object"&&"fields"in e;function er(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[o,i]of e)if(!t.has(o)||!Object.is(i,t.get(o)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const o of e)if(!t.has(o))return!1;return!0}const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n)if(!r.includes(o)||!er(e[o],t[o]))return!1;return!0}const Ac=({newFormValidatorError:e,isPreviousErrorFromFormValidator:t,previousErrorValue:n})=>e?{newErrorValue:e,newSource:"form"}:t?{newErrorValue:void 0,newSource:void 0}:n?{newErrorValue:n,newSource:"field"}:{newErrorValue:void 0,newSource:void 0},Tc=({formLevelError:e,fieldLevelError:t})=>t?{newErrorValue:t,newSource:"field"}:e?{newErrorValue:e,newSource:"form"}:{newErrorValue:void 0,newSource:void 0};function vx(e){const t=new Map;for(const n of e){const r=[...n.path??[]].map(o=>{const i=typeof o=="object"?o.key:o;return typeof i=="number"?`[${i}]`:i}).join(".").replace(/\.\[/g,"[");t.set(r,(t.get(r)??[]).concat(n))}return Object.fromEntries(t)}const Dc=e=>{const t=vx(e);return{form:t,fields:t}},ir={validate({value:e,validationSource:t},n){const r=n["~standard"].validate(e);if(r instanceof Promise)throw new Error("async function passed to sync validator");if(r.issues)return t==="field"?r.issues:Dc(r.issues)},async validateAsync({value:e,validationSource:t},n){const r=await n["~standard"].validate(e);if(r.issues)return t==="field"?r.issues:Dc(r.issues)}},Yh=e=>!!e&&"~standard"in e,yi={isValidating:!1,isTouched:!1,isBlurred:!1,isDirty:!1,isPristine:!0,isValid:!0,isDefaultValue:!0,errors:[],errorMap:{},errorSourceMap:{}};function Qo(e){function t(f,d,h,p){const g=r(f,d,h,p);({insert:()=>a(g,f,d),remove:()=>l(g),swap:()=>p!==void 0&&u(g,f,d,p),move:()=>p!==void 0&&c(g,f,d,p)})[h]()}function n(f,d){return`${f}[${d}]`}function r(f,d,h,p){const g=[n(f,d)];if(h==="swap")g.push(n(f,p));else if(h==="move"){const[v,m]=[Math.min(d,p),Math.max(d,p)];for(let y=v;y<=m;y++)g.push(n(f,y))}else{const v=e.getFieldValue(f),m=Array.isArray(v)?v.length:0;for(let y=d+1;y<m;y++)g.push(n(f,y))}return Object.keys(e.fieldInfo).filter(v=>g.some(m=>v.startsWith(m)))}function o(f,d){return f.replace(/\[(\d+)\]/,(h,p)=>{const g=parseInt(p,10);return`[${d==="up"?g+1:Math.max(0,g-1)}]`})}function i(f,d){(d==="up"?f:[...f].reverse()).forEach(p=>{const g=o(p.toString(),d),v=e.getFieldMeta(g);v?e.setFieldMeta(p,v):e.setFieldMeta(p,s())})}const s=()=>yi,a=(f,d,h)=>{i(f,"down"),f.forEach(p=>{p.toString().startsWith(n(d,h))&&e.setFieldMeta(p,s())})},l=f=>{i(f,"up")},c=(f,d,h,p)=>{const g=new Map(Object.keys(e.fieldInfo).filter(v=>v.startsWith(n(d,h))).map(v=>[v,e.getFieldMeta(v)]));i(f,h<p?"up":"down"),Object.keys(e.fieldInfo).filter(v=>v.startsWith(n(d,p))).forEach(v=>{const m=v.replace(n(d,p),n(d,h)),y=g.get(m);y&&e.setFieldMeta(v,y)})},u=(f,d,h,p)=>{f.forEach(g=>{if(!g.toString().startsWith(n(d,h)))return;const v=g.toString().replace(n(d,h),n(d,p)),[m,y]=[e.getFieldMeta(g),e.getFieldMeta(v)];m&&e.setFieldMeta(v,m),y&&e.setFieldMeta(g,y)})};return{handleArrayFieldMetaShift:t}}function ls(e){return{values:e.values??{},errorMap:e.errorMap??{},fieldMetaBase:e.fieldMetaBase??{},isSubmitted:e.isSubmitted??!1,isSubmitting:e.isSubmitting??!1,isValidating:e.isValidating??!1,submissionAttempts:e.submissionAttempts??0,isSubmitSuccessful:e.isSubmitSuccessful??!1,validationMetaMap:e.validationMetaMap??{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0}}}class yx{constructor(t){var n;this.options={},this.fieldInfo={},this.prevTransformArray=[],this.mount=()=>{var r,o;const i=this.fieldMetaDerived.mount(),s=this.store.mount(),a=()=>{i(),s()};(o=(r=this.options.listeners)==null?void 0:r.onMount)==null||o.call(r,{formApi:this});const{onMount:l}=this.options.validators||{};return l&&this.validateSync("mount"),a},this.update=r=>{var o,i;if(!r)return;const s=this.options;this.options=r;const a=!!((i=(o=r.transform)==null?void 0:o.deps)!=null&&i.some((u,f)=>u!==this.prevTransformArray[f])),l=r.defaultValues&&!er(r.defaultValues,s.defaultValues)&&!this.state.isTouched,c=!er(r.defaultState,s.defaultState)&&!this.state.isTouched;!l&&!c&&!a||Et(()=>{this.baseStore.setState(()=>ls(Object.assign({},this.state,c?r.defaultState:{},l?{values:r.defaultValues}:{},a?{_force_re_eval:!this.state._force_re_eval}:{})))})},this.reset=(r,o)=>{const{fieldMeta:i}=this.state,s=this.resetFieldMeta(i);r&&!(o!=null&&o.keepDefaultValues)&&(this.options={...this.options,defaultValues:r}),this.baseStore.setState(()=>{var a;return ls({...this.options.defaultState,values:r??this.options.defaultValues??((a=this.options.defaultState)==null?void 0:a.values),fieldMetaBase:s})})},this.validateAllFields=async r=>{const o=[];return Et(()=>{Object.values(this.fieldInfo).forEach(s=>{if(!s.instance)return;const a=s.instance;o.push(Promise.resolve().then(()=>a.validate(r,{skipFormValidation:!0}))),s.instance.state.meta.isTouched||s.instance.setMeta(l=>({...l,isTouched:!0}))})}),(await Promise.all(o)).flat()},this.validateArrayFieldsStartingFrom=async(r,o,i)=>{const s=this.getFieldValue(r),a=Array.isArray(s)?Math.max(s.length-1,0):null,l=[`${r}[${o}]`];for(let d=o+1;d<=(a??0);d++)l.push(`${r}[${d}]`);const c=Object.keys(this.fieldInfo).filter(d=>l.some(h=>d.startsWith(h))),u=[];return Et(()=>{c.forEach(d=>{u.push(Promise.resolve().then(()=>this.validateField(d,i)))})}),(await Promise.all(u)).flat()},this.validateField=(r,o)=>{var i;const s=(i=this.fieldInfo[r])==null?void 0:i.instance;return s?(s.state.meta.isTouched||s.setMeta(a=>({...a,isTouched:!0})),s.validate(o)):[]},this.validateSync=r=>{const o=ga(r,this.options);let i=!1;const s={};return Et(()=>{var a,l;for(const u of o){if(!u.validate)continue;const f=this.runValidator({validate:u.validate,value:{value:this.state.values,formApi:this,validationSource:"form"},type:"validate"}),{formError:d,fieldErrors:h}=oi(f),p=Xo(u.cause);for(const g of Object.keys(this.state.fieldMeta)){const v=this.getFieldMeta(g);if(!v)continue;const{errorMap:m,errorSourceMap:y}=v,b=h==null?void 0:h[g],{newErrorValue:S,newSource:C}=Ac({newFormValidatorError:b,isPreviousErrorFromFormValidator:(y==null?void 0:y[p])==="form",previousErrorValue:m==null?void 0:m[p]});C==="form"&&(s[g]={...s[g],[p]:b}),(m==null?void 0:m[p])!==S&&this.setFieldMeta(g,R=>({...R,errorMap:{...R.errorMap,[p]:S},errorSourceMap:{...R.errorSourceMap,[p]:C}}))}((a=this.state.errorMap)==null?void 0:a[p])!==d&&this.baseStore.setState(g=>({...g,errorMap:{...g.errorMap,[p]:d}})),(d||h)&&(i=!0)}const c=Xo("submit");(l=this.state.errorMap)!=null&&l[c]&&r!=="submit"&&!i&&this.baseStore.setState(u=>({...u,errorMap:{...u.errorMap,[c]:void 0}}))}),{hasErrored:i,fieldsErrorMap:s}},this.validateAsync=async r=>{const o=ha(r,this.options);this.state.isFormValidating||this.baseStore.setState(c=>({...c,isFormValidating:!0}));const i=[];let s;for(const c of o){if(!c.validate)continue;const u=Xo(c.cause),f=this.state.validationMetaMap[u];f==null||f.lastAbortController.abort();const d=new AbortController;this.state.validationMetaMap[u]={lastAbortController:d},i.push(new Promise(async h=>{let p;try{p=await new Promise((y,b)=>{setTimeout(async()=>{if(d.signal.aborted)return y(void 0);try{y(await this.runValidator({validate:c.validate,value:{value:this.state.values,formApi:this,validationSource:"form",signal:d.signal},type:"validateAsync"}))}catch(S){b(S)}},c.debounceMs)})}catch(y){p=y}const{formError:g,fieldErrors:v}=oi(p);v&&(s=s?{...s,...v}:v);const m=Xo(c.cause);for(const y of Object.keys(this.state.fieldMeta)){const b=this.getFieldMeta(y);if(!b)continue;const{errorMap:S,errorSourceMap:C}=b,R=s==null?void 0:s[y],{newErrorValue:D,newSource:V}=Ac({newFormValidatorError:R,isPreviousErrorFromFormValidator:(C==null?void 0:C[m])==="form",previousErrorValue:S==null?void 0:S[m]});(S==null?void 0:S[m])!==D&&this.setFieldMeta(y,$=>({...$,errorMap:{...$.errorMap,[m]:D},errorSourceMap:{...$.errorSourceMap,[m]:V}}))}this.baseStore.setState(y=>({...y,errorMap:{...y.errorMap,[m]:g}})),h(s?{fieldErrors:s,errorMapKey:m}:void 0)}))}let a=[];const l={};if(i.length){a=await Promise.all(i);for(const c of a)if(c!=null&&c.fieldErrors){const{errorMapKey:u}=c;for(const[f,d]of Object.entries(c.fieldErrors)){const p={...l[f]||{},[u]:d};l[f]=p}}}return this.baseStore.setState(c=>({...c,isFormValidating:!1})),l},this.validate=r=>{const{hasErrored:o,fieldsErrorMap:i}=this.validateSync(r);return o&&!this.options.asyncAlways?i:this.validateAsync(r)},this.getFieldValue=r=>Yr(this.state.values,r),this.getFieldMeta=r=>this.state.fieldMeta[r],this.getFieldInfo=r=>{var o;return(o=this.fieldInfo)[r]||(o[r]={instance:null,validationMetaMap:{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0}})},this.setFieldMeta=(r,o)=>{this.baseStore.setState(i=>({...i,fieldMetaBase:{...i.fieldMetaBase,[r]:El(o,i.fieldMetaBase[r])}}))},this.resetFieldMeta=r=>Object.keys(r).reduce((o,i)=>{const s=i;return o[s]=yi,o},{}),this.setFieldValue=(r,o,i)=>{const s=(i==null?void 0:i.dontUpdateMeta)??!1;Et(()=>{s||this.setFieldMeta(r,a=>({...a,isTouched:!0,isDirty:!0,errorMap:{...a==null?void 0:a.errorMap,onMount:void 0}})),this.baseStore.setState(a=>({...a,values:qo(a.values,r,o)}))})},this.deleteField=r=>{const i=[...Object.keys(this.fieldInfo).filter(s=>{const a=r.toString();return s!==a&&s.startsWith(a)}),r];this.baseStore.setState(s=>{const a={...s};return i.forEach(l=>{a.values=cx(a.values,l),delete this.fieldInfo[l],delete a.fieldMetaBase[l]}),a})},this.pushFieldValue=(r,o,i)=>{this.setFieldValue(r,s=>[...Array.isArray(s)?s:[],o],i),this.validateField(r,"change")},this.insertFieldValue=async(r,o,i,s)=>{this.setFieldValue(r,a=>[...a.slice(0,o),i,...a.slice(o)],s),await this.validateField(r,"change"),Qo(this).handleArrayFieldMetaShift(r,o,"insert"),await this.validateArrayFieldsStartingFrom(r,o,"change")},this.replaceFieldValue=async(r,o,i,s)=>{this.setFieldValue(r,a=>a.map((l,c)=>c===o?i:l),s),await this.validateField(r,"change"),await this.validateArrayFieldsStartingFrom(r,o,"change")},this.removeFieldValue=async(r,o,i)=>{const s=this.getFieldValue(r),a=Array.isArray(s)?Math.max(s.length-1,0):null;if(this.setFieldValue(r,l=>l.filter((c,u)=>u!==o),i),Qo(this).handleArrayFieldMetaShift(r,o,"remove"),a!==null){const l=`${r}[${a}]`;this.deleteField(l)}await this.validateField(r,"change"),await this.validateArrayFieldsStartingFrom(r,o,"change")},this.swapFieldValues=(r,o,i,s)=>{this.setFieldValue(r,a=>{const l=a[o],c=a[i];return qo(qo(a,`${o}`,c),`${i}`,l)},s),Qo(this).handleArrayFieldMetaShift(r,o,"swap",i),this.validateField(r,"change"),this.validateField(`${r}[${o}]`,"change"),this.validateField(`${r}[${i}]`,"change")},this.moveFieldValues=(r,o,i,s)=>{this.setFieldValue(r,a=>{const l=[...a];return l.splice(i,0,l.splice(o,1)[0]),l},s),Qo(this).handleArrayFieldMetaShift(r,o,"move",i),this.validateField(r,"change"),this.validateField(`${r}[${o}]`,"change"),this.validateField(`${r}[${i}]`,"change")},this.clearFieldValues=(r,o)=>{const i=this.getFieldValue(r),s=Array.isArray(i)?Math.max(i.length-1,0):null;if(this.setFieldValue(r,[],o),s!==null)for(let a=0;a<=s;a++){const l=`${r}[${a}]`;this.deleteField(l)}this.validateField(r,"change")},this.resetField=r=>{this.baseStore.setState(o=>({...o,fieldMetaBase:{...o.fieldMetaBase,[r]:yi},values:this.options.defaultValues?qo(o.values,r,Yr(this.options.defaultValues,r)):o.values}))},this.getAllErrors=()=>({form:{errors:this.state.errors,errorMap:this.state.errorMap},fields:Object.entries(this.state.fieldMeta).reduce((r,[o,i])=>(Object.keys(i).length&&i.errors.length&&(r[o]={errors:i.errors,errorMap:i.errorMap}),r),{})}),this.parseValuesWithSchema=r=>ir.validate({value:this.state.values,validationSource:"form"},r),this.parseValuesWithSchemaAsync=r=>ir.validateAsync({value:this.state.values,validationSource:"form"},r),this.baseStore=new da(ls({...t==null?void 0:t.defaultState,values:(t==null?void 0:t.defaultValues)??((n=t==null?void 0:t.defaultState)==null?void 0:n.values)})),this.fieldMetaDerived=new zt({deps:[this.baseStore],fn:({prevDepVals:r,currDepVals:o,prevVal:i})=>{var s,a,l;const c=i,u=r==null?void 0:r[0],f=o[0];let d=0;const h={};for(const p of Object.keys(f.fieldMetaBase)){const g=f.fieldMetaBase[p],v=u==null?void 0:u.fieldMetaBase[p],m=c==null?void 0:c[p],y=Yr(f.values,p);let b=m==null?void 0:m.errors;if(!v||g.errorMap!==v.errorMap){b=Object.values(g.errorMap??{}).filter(V=>V!==void 0);const D=(s=this.getFieldInfo(p))==null?void 0:s.instance;D&&!D.options.disableErrorFlat&&(b=b==null?void 0:b.flat(1))}const S=!mx(b??[]),C=!g.isDirty,R=er(y,Yr(this.options.defaultValues,p))||er(y,(l=(a=this.getFieldInfo(p))==null?void 0:a.instance)==null?void 0:l.options.defaultValue);if(m&&m.isPristine===C&&m.isValid===S&&m.isDefaultValue===R&&m.errors===b&&g===v){h[p]=m,d++;continue}h[p]={...g,errors:b,isPristine:C,isValid:S,isDefaultValue:R}}return Object.keys(f.fieldMetaBase).length&&c&&d===Object.keys(f.fieldMetaBase).length?c:h}}),this.store=new zt({deps:[this.baseStore,this.fieldMetaDerived],fn:({prevDepVals:r,currDepVals:o,prevVal:i})=>{var s,a,l,c;const u=i,f=r==null?void 0:r[0],d=o[0],h=o[1],p=Object.values(h).filter(Boolean),g=p.some(P=>P.isValidating),v=p.every(P=>P.isValid),m=p.some(P=>P.isTouched),y=p.some(P=>P.isBlurred),b=p.every(P=>P.isDefaultValue),S=m&&((s=d.errorMap)==null?void 0:s.onMount),C=p.some(P=>P.isDirty),R=!C,D=!!((a=d.errorMap)!=null&&a.onMount||p.some(P=>{var A;return(A=P==null?void 0:P.errorMap)==null?void 0:A.onMount})),V=!!g;let $=(u==null?void 0:u.errors)??[];(!f||d.errorMap!==f.errorMap)&&($=Object.values(d.errorMap).reduce((P,A)=>A===void 0?P:A&&pa(A)?(P.push(A.form),P):(P.push(A),P),[]));const k=$.length===0,N=v&&k,B=this.options.canSubmitWhenInvalid??!1,ne=d.submissionAttempts===0&&!m&&!D||!V&&!d.isSubmitting&&N||B;let I=d.errorMap;if(S&&($=$.filter(P=>P!==d.errorMap.onMount),I=Object.assign(I,{onMount:void 0})),u&&f&&u.errorMap===I&&u.fieldMeta===this.fieldMetaDerived.state&&u.errors===$&&u.isFieldsValidating===g&&u.isFieldsValid===v&&u.isFormValid===k&&u.isValid===N&&u.canSubmit===ne&&u.isTouched===m&&u.isBlurred===y&&u.isPristine===R&&u.isDefaultValue===b&&u.isDirty===C&&er(f,d))return u;let M={...d,errorMap:I,fieldMeta:this.fieldMetaDerived.state,errors:$,isFieldsValidating:g,isFieldsValid:v,isFormValid:k,isValid:N,canSubmit:ne,isTouched:m,isBlurred:y,isPristine:R,isDefaultValue:b,isDirty:C};const x=((l=this.options.transform)==null?void 0:l.deps)??[];if(x.length!==this.prevTransformArray.length||x.some((P,A)=>P!==this.prevTransformArray[A])){const P=Object.assign({},this,{state:M});(c=this.options.transform)==null||c.fn(P),M=P.state,this.prevTransformArray=x}return M}}),this.handleSubmit=this.handleSubmit.bind(this),this.update(t||{})}get state(){return this.store.state}runValidator(t){return Yh(t.validate)?ir[t.type](t.value,t.validate):t.validate(t.value)}async handleSubmit(t){var n,r,o,i,s,a,l,c;if(this.baseStore.setState(f=>({...f,isSubmitted:!1,submissionAttempts:f.submissionAttempts+1,isSubmitSuccessful:!1})),Et(()=>{Object.values(this.fieldInfo).forEach(f=>{f.instance&&(f.instance.state.meta.isTouched||f.instance.setMeta(d=>({...d,isTouched:!0})))})}),!this.state.canSubmit)return;this.baseStore.setState(f=>({...f,isSubmitting:!0}));const u=()=>{this.baseStore.setState(f=>({...f,isSubmitting:!1}))};if(await this.validateAllFields("submit"),!this.state.isFieldsValid){u(),(r=(n=this.options).onSubmitInvalid)==null||r.call(n,{value:this.state.values,formApi:this});return}if(await this.validate("submit"),!this.state.isValid){u(),(i=(o=this.options).onSubmitInvalid)==null||i.call(o,{value:this.state.values,formApi:this});return}Et(()=>{Object.values(this.fieldInfo).forEach(f=>{var d,h,p;(p=(h=(d=f.instance)==null?void 0:d.options.listeners)==null?void 0:h.onSubmit)==null||p.call(h,{value:f.instance.state.value,fieldApi:f.instance})})}),(a=(s=this.options.listeners)==null?void 0:s.onSubmit)==null||a.call(s,{formApi:this});try{await((c=(l=this.options).onSubmit)==null?void 0:c.call(l,{value:this.state.values,formApi:this,meta:t??this.options.onSubmitMeta})),Et(()=>{this.baseStore.setState(f=>({...f,isSubmitted:!0,isSubmitSuccessful:!0})),u()})}catch(f){throw this.baseStore.setState(d=>({...d,isSubmitSuccessful:!1})),u(),f}}setErrorMap(t){Et(()=>{Object.entries(t).forEach(([n,r])=>{const o=n;if(pa(r)){const{formError:i,fieldErrors:s}=oi(r);for(const a of Object.keys(this.fieldInfo))this.getFieldMeta(a)&&this.setFieldMeta(a,c=>({...c,errorMap:{...c.errorMap,[o]:s==null?void 0:s[a]},errorSourceMap:{...c.errorSourceMap,[o]:"form"}}));this.baseStore.setState(a=>({...a,errorMap:{...a.errorMap,[o]:i}}))}else this.baseStore.setState(i=>({...i,errorMap:{...i.errorMap,[o]:r}}))})})}}function oi(e){if(e){if(pa(e)){const t=oi(e.form).formError,n=e.fields;return{formError:t,fieldErrors:n}}return{formError:e}}return{formError:void 0}}function Xo(e){switch(e){case"submit":return"onSubmit";case"blur":return"onBlur";case"mount":return"onMount";case"server":return"onServer";case"change":default:return"onChange"}}class wx{constructor(t){this.options={},this.mount=()=>{var n,r;const o=this.store.mount();this.options.defaultValue!==void 0&&this.form.setFieldValue(this.name,this.options.defaultValue,{dontUpdateMeta:!0});const i=this.getInfo();i.instance=this,this.update(this.options);const{onMount:s}=this.options.validators||{};if(s){const a=this.runValidator({validate:s,value:{value:this.state.value,fieldApi:this,validationSource:"field"},type:"validate"});a&&this.setMeta(l=>({...l,errorMap:{...l==null?void 0:l.errorMap,onMount:a},errorSourceMap:{...l==null?void 0:l.errorSourceMap,onMount:"field"}}))}return(r=(n=this.options.listeners)==null?void 0:n.onMount)==null||r.call(n,{value:this.state.value,fieldApi:this}),o},this.update=n=>{this.options=n;const r=this.name!==n.name;if(this.name=n.name,this.state.value===void 0){const o=Yr(n.form.options.defaultValues,n.name),i=n.defaultValue??o;r?this.setValue(s=>s||i,{dontUpdateMeta:!0}):i!==void 0&&this.setValue(i,{dontUpdateMeta:!0})}this.form.getFieldMeta(this.name)===void 0&&this.setMeta(this.state.meta)},this.getValue=()=>this.form.getFieldValue(this.name),this.setValue=(n,r)=>{this.form.setFieldValue(this.name,n,r),this.triggerOnChangeListener(),this.validate("change")},this.getMeta=()=>this.store.state.meta,this.setMeta=n=>this.form.setFieldMeta(this.name,n),this.getInfo=()=>this.form.getFieldInfo(this.name),this.pushValue=(n,r)=>{this.form.pushFieldValue(this.name,n,r),this.triggerOnChangeListener()},this.insertValue=(n,r,o)=>{this.form.insertFieldValue(this.name,n,r,o),this.triggerOnChangeListener()},this.replaceValue=(n,r,o)=>{this.form.replaceFieldValue(this.name,n,r,o),this.triggerOnChangeListener()},this.removeValue=(n,r)=>{this.form.removeFieldValue(this.name,n,r),this.triggerOnChangeListener()},this.swapValues=(n,r,o)=>{this.form.swapFieldValues(this.name,n,r,o),this.triggerOnChangeListener()},this.moveValue=(n,r,o)=>{this.form.moveFieldValues(this.name,n,r,o),this.triggerOnChangeListener()},this.clearValues=n=>{this.form.clearFieldValues(this.name,n),this.triggerOnChangeListener()},this.getLinkedFields=n=>{const r=Object.values(this.form.fieldInfo),o=[];for(const i of r){if(!i.instance)continue;const{onChangeListenTo:s,onBlurListenTo:a}=i.instance.options.validators||{};n==="change"&&(s!=null&&s.includes(this.name))&&o.push(i.instance),n==="blur"&&(a!=null&&a.includes(this.name))&&o.push(i.instance)}return o},this.validateSync=(n,r)=>{var o;const i=ga(n,this.options),a=this.getLinkedFields(n).reduce((u,f)=>{const d=ga(n,f.options);return d.forEach(h=>{h.field=f}),u.concat(d)},[]);let l=!1;Et(()=>{const u=(f,d)=>{var h;const p=Yo(d.cause),g=d.validate?Lc(f.runValidator({validate:d.validate,value:{value:f.store.state.value,validationSource:"field",fieldApi:f},type:"validate"})):void 0,v=r[p],{newErrorValue:m,newSource:y}=Tc({formLevelError:v,fieldLevelError:g});((h=f.state.meta.errorMap)==null?void 0:h[p])!==m&&f.setMeta(b=>({...b,errorMap:{...b.errorMap,[p]:m},errorSourceMap:{...b.errorSourceMap,[p]:y}})),m&&(l=!0)};for(const f of i)u(this,f);for(const f of a)f.validate&&u(f.field,f)});const c=Yo("submit");return(o=this.state.meta.errorMap)!=null&&o[c]&&n!=="submit"&&!l&&this.setMeta(u=>({...u,errorMap:{...u.errorMap,[c]:void 0},errorSourceMap:{...u.errorSourceMap,[c]:void 0}})),{hasErrored:l}},this.validateAsync=async(n,r)=>{const o=ha(n,this.options),i=await r,s=this.getLinkedFields(n),a=s.reduce((d,h)=>{const p=ha(n,h.options);return p.forEach(g=>{g.field=h}),d.concat(p)},[]);this.state.meta.isValidating||this.setMeta(d=>({...d,isValidating:!0}));for(const d of s)d.setMeta(h=>({...h,isValidating:!0}));const l=[],c=[],u=(d,h,p)=>{const g=Yo(h.cause),v=d.getInfo().validationMetaMap[g];v==null||v.lastAbortController.abort();const m=new AbortController;this.getInfo().validationMetaMap[g]={lastAbortController:m},p.push(new Promise(async y=>{var b;let S;try{S=await new Promise(($,k)=>{this.timeoutIds.validations[h.cause]&&clearTimeout(this.timeoutIds.validations[h.cause]),this.timeoutIds.validations[h.cause]=setTimeout(async()=>{if(m.signal.aborted)return $(void 0);try{$(await this.runValidator({validate:h.validate,value:{value:d.store.state.value,fieldApi:d,signal:m.signal,validationSource:"field"},type:"validateAsync"}))}catch(N){k(N)}},h.debounceMs)})}catch($){S=$}if(m.signal.aborted)return y(void 0);const C=Lc(S),R=(b=i[this.name])==null?void 0:b[g],{newErrorValue:D,newSource:V}=Tc({formLevelError:R,fieldLevelError:C});d.setMeta($=>({...$,errorMap:{...$==null?void 0:$.errorMap,[g]:D},errorSourceMap:{...$.errorSourceMap,[g]:V}})),y(D)}))};for(const d of o)d.validate&&u(this,d,l);for(const d of a)d.validate&&u(d.field,d,c);let f=[];(l.length||c.length)&&(f=await Promise.all(l),await Promise.all(c)),this.setMeta(d=>({...d,isValidating:!1}));for(const d of s)d.setMeta(h=>({...h,isValidating:!1}));return f.filter(Boolean)},this.validate=(n,r)=>{var o;if(!this.state.meta.isTouched)return[];const{fieldsErrorMap:i}=r!=null&&r.skipFormValidation?{fieldsErrorMap:{}}:this.form.validateSync(n),{hasErrored:s}=this.validateSync(n,i[this.name]??{});if(s&&!this.options.asyncAlways)return(o=this.getInfo().validationMetaMap[Yo(n)])==null||o.lastAbortController.abort(),this.state.meta.errors;const a=r!=null&&r.skipFormValidation?Promise.resolve({}):this.form.validateAsync(n);return this.validateAsync(n,a)},this.handleChange=n=>{this.setValue(n)},this.handleBlur=()=>{this.state.meta.isTouched||(this.setMeta(r=>({...r,isTouched:!0})),this.validate("change")),this.state.meta.isBlurred||this.setMeta(r=>({...r,isBlurred:!0})),this.validate("blur"),this.triggerOnBlurListener()},this.parseValueWithSchema=n=>ir.validate({value:this.state.value,validationSource:"field"},n),this.parseValueWithSchemaAsync=n=>ir.validateAsync({value:this.state.value,validationSource:"field"},n),this.form=t.form,this.name=t.name,this.timeoutIds={validations:{},listeners:{},formListeners:{}},this.store=new zt({deps:[this.form.store],fn:()=>{const n=this.form.getFieldValue(this.name),r=this.form.getFieldMeta(this.name)??{...yi,...t.defaultMeta};return{value:n,meta:r}}}),this.options=t}get state(){return this.store.state}runValidator(t){return Yh(t.validate)?ir[t.type](t.value,t.validate):t.validate(t.value)}setErrorMap(t){this.setMeta(n=>({...n,errorMap:{...n.errorMap,...t}}))}triggerOnBlurListener(){var t,n,r,o,i,s;const a=(t=this.form.options.listeners)==null?void 0:t.onBlurDebounceMs;a&&a>0?(this.timeoutIds.formListeners.blur&&clearTimeout(this.timeoutIds.formListeners.blur),this.timeoutIds.formListeners.blur=setTimeout(()=>{var c,u;(u=(c=this.form.options.listeners)==null?void 0:c.onBlur)==null||u.call(c,{formApi:this.form,fieldApi:this})},a)):(r=(n=this.form.options.listeners)==null?void 0:n.onBlur)==null||r.call(n,{formApi:this.form,fieldApi:this});const l=(o=this.options.listeners)==null?void 0:o.onBlurDebounceMs;l&&l>0?(this.timeoutIds.listeners.blur&&clearTimeout(this.timeoutIds.listeners.blur),this.timeoutIds.listeners.blur=setTimeout(()=>{var c,u;(u=(c=this.options.listeners)==null?void 0:c.onBlur)==null||u.call(c,{value:this.state.value,fieldApi:this})},l)):(s=(i=this.options.listeners)==null?void 0:i.onBlur)==null||s.call(i,{value:this.state.value,fieldApi:this})}triggerOnChangeListener(){var t,n,r,o,i,s;const a=(t=this.form.options.listeners)==null?void 0:t.onChangeDebounceMs;a&&a>0?(this.timeoutIds.formListeners.blur&&clearTimeout(this.timeoutIds.formListeners.blur),this.timeoutIds.formListeners.blur=setTimeout(()=>{var c,u;(u=(c=this.form.options.listeners)==null?void 0:c.onChange)==null||u.call(c,{formApi:this.form,fieldApi:this})},a)):(r=(n=this.form.options.listeners)==null?void 0:n.onChange)==null||r.call(n,{formApi:this.form,fieldApi:this});const l=(o=this.options.listeners)==null?void 0:o.onChangeDebounceMs;l&&l>0?(this.timeoutIds.listeners.change&&clearTimeout(this.timeoutIds.listeners.change),this.timeoutIds.listeners.change=setTimeout(()=>{var c,u;(u=(c=this.options.listeners)==null?void 0:c.onChange)==null||u.call(c,{value:this.state.value,fieldApi:this})},l)):(s=(i=this.options.listeners)==null?void 0:i.onChange)==null||s.call(i,{value:this.state.value,fieldApi:this})}}function Lc(e){if(e)return e}function Yo(e){switch(e){case"submit":return"onSubmit";case"blur":return"onBlur";case"mount":return"onMount";case"server":return"onServer";case"change":default:return"onChange"}}function _c(e,t=n=>n){const[n,r]=vo({value:t(e.state)}),o=e.subscribe(()=>{const i=t(e.state);r("value",qd(i))});return Y(()=>{o()}),()=>n.value}function bx(e){const[t,n]=z(e,{equals:!1}),r=e.store.subscribe(()=>n(e));return Y(r),t}function Jh(e){const t=e(),n=new wx(t),r=n;r.Field=Zh;let o=!1;return Sr(()=>{const i=n.mount();o=!0,Y(()=>{i(),o=!1})}),pt(()=>{o&&n.update(e())}),bx(r)}function Zh(e){const t=Jh(()=>{const{children:n,...r}=e;return r});return L(()=>w(()=>e.children(t),{}))}function Sx(e){const t=e==null?void 0:e(),n=new yx(t),r=n;return r.Field=o=>w(Zh,F(o,{form:n})),r.createField=o=>Jh(()=>({...o(),form:n})),r.useStore=o=>_c(n.store,o),r.Subscribe=o=>El(o.children,_c(n.store,o.selector)),Sr(n.mount),pt(()=>n.update(e==null?void 0:e())),r}var us,kc;function xx(){if(kc)return us;kc=1;class e{constructor(){this.max=1e3,this.map=new Map}get(n){const r=this.map.get(n);if(r!==void 0)return this.map.delete(n),this.map.set(n,r),r}delete(n){return this.map.delete(n)}set(n,r){if(!this.delete(n)&&r!==void 0){if(this.map.size>=this.max){const i=this.map.keys().next().value;this.delete(i)}this.map.set(n,r)}return this}}return us=e,us}var cs,Vc;function Il(){if(Vc)return cs;Vc=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return cs=r=>r?typeof r!="object"?e:r:t,cs}var Jo={exports:{}},ds,Nc;function Pl(){if(Nc)return ds;Nc=1;const e="2.0.0",t=256,n=Number.MAX_SAFE_INTEGER||9007199254740991,r=16,o=t-6;return ds={MAX_LENGTH:t,MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:o,MAX_SAFE_INTEGER:n,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},ds}var fs,Kc;function Di(){if(Kc)return fs;Kc=1;var e={};return fs=typeof process=="object"&&e&&e.NODE_DEBUG&&/\bsemver\b/i.test(e.NODE_DEBUG)?(...n)=>console.error("SEMVER",...n):()=>{},fs}var zc;function Rl(){return zc||(zc=1,function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:o}=Pl(),i=Di();t=e.exports={};const s=t.re=[],a=t.safeRe=[],l=t.src=[],c=t.safeSrc=[],u=t.t={};let f=0;const d="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",o],[d,r]],p=v=>{for(const[m,y]of h)v=v.split(`${m}*`).join(`${m}{0,${y}}`).split(`${m}+`).join(`${m}{1,${y}}`);return v},g=(v,m,y)=>{const b=p(m),S=f++;i(v,S,m),u[v]=S,l[S]=m,c[S]=b,s[S]=new RegExp(m,y?"g":void 0),a[S]=new RegExp(b,y?"g":void 0)};g("NUMERICIDENTIFIER","0|[1-9]\\d*"),g("NUMERICIDENTIFIERLOOSE","\\d+"),g("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${d}*`),g("MAINVERSION",`(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})`),g("MAINVERSIONLOOSE",`(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})`),g("PRERELEASEIDENTIFIER",`(?:${l[u.NONNUMERICIDENTIFIER]}|${l[u.NUMERICIDENTIFIER]})`),g("PRERELEASEIDENTIFIERLOOSE",`(?:${l[u.NONNUMERICIDENTIFIER]}|${l[u.NUMERICIDENTIFIERLOOSE]})`),g("PRERELEASE",`(?:-(${l[u.PRERELEASEIDENTIFIER]}(?:\\.${l[u.PRERELEASEIDENTIFIER]})*))`),g("PRERELEASELOOSE",`(?:-?(${l[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[u.PRERELEASEIDENTIFIERLOOSE]})*))`),g("BUILDIDENTIFIER",`${d}+`),g("BUILD",`(?:\\+(${l[u.BUILDIDENTIFIER]}(?:\\.${l[u.BUILDIDENTIFIER]})*))`),g("FULLPLAIN",`v?${l[u.MAINVERSION]}${l[u.PRERELEASE]}?${l[u.BUILD]}?`),g("FULL",`^${l[u.FULLPLAIN]}$`),g("LOOSEPLAIN",`[v=\\s]*${l[u.MAINVERSIONLOOSE]}${l[u.PRERELEASELOOSE]}?${l[u.BUILD]}?`),g("LOOSE",`^${l[u.LOOSEPLAIN]}$`),g("GTLT","((?:<|>)?=?)"),g("XRANGEIDENTIFIERLOOSE",`${l[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),g("XRANGEIDENTIFIER",`${l[u.NUMERICIDENTIFIER]}|x|X|\\*`),g("XRANGEPLAIN",`[v=\\s]*(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:${l[u.PRERELEASE]})?${l[u.BUILD]}?)?)?`),g("XRANGEPLAINLOOSE",`[v=\\s]*(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:${l[u.PRERELEASELOOSE]})?${l[u.BUILD]}?)?)?`),g("XRANGE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAIN]}$`),g("XRANGELOOSE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAINLOOSE]}$`),g("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),g("COERCE",`${l[u.COERCEPLAIN]}(?:$|[^\\d])`),g("COERCEFULL",l[u.COERCEPLAIN]+`(?:${l[u.PRERELEASE]})?(?:${l[u.BUILD]})?(?:$|[^\\d])`),g("COERCERTL",l[u.COERCE],!0),g("COERCERTLFULL",l[u.COERCEFULL],!0),g("LONETILDE","(?:~>?)"),g("TILDETRIM",`(\\s*)${l[u.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",g("TILDE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAIN]}$`),g("TILDELOOSE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAINLOOSE]}$`),g("LONECARET","(?:\\^)"),g("CARETTRIM",`(\\s*)${l[u.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",g("CARET",`^${l[u.LONECARET]}${l[u.XRANGEPLAIN]}$`),g("CARETLOOSE",`^${l[u.LONECARET]}${l[u.XRANGEPLAINLOOSE]}$`),g("COMPARATORLOOSE",`^${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]})$|^$`),g("COMPARATOR",`^${l[u.GTLT]}\\s*(${l[u.FULLPLAIN]})$|^$`),g("COMPARATORTRIM",`(\\s*)${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]}|${l[u.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",g("HYPHENRANGE",`^\\s*(${l[u.XRANGEPLAIN]})\\s+-\\s+(${l[u.XRANGEPLAIN]})\\s*$`),g("HYPHENRANGELOOSE",`^\\s*(${l[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[u.XRANGEPLAINLOOSE]})\\s*$`),g("STAR","(<|>)?=?\\s*\\*"),g("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),g("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(Jo,Jo.exports)),Jo.exports}var hs,Bc;function Cx(){if(Bc)return hs;Bc=1;const e=/^[0-9]+$/,t=(r,o)=>{const i=e.test(r),s=e.test(o);return i&&s&&(r=+r,o=+o),r===o?0:i&&!s?-1:s&&!i?1:r<o?-1:1};return hs={compareIdentifiers:t,rcompareIdentifiers:(r,o)=>t(o,r)},hs}var gs,jc;function Ol(){if(jc)return gs;jc=1;const e=Di(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:n}=Pl(),{safeRe:r,t:o}=Rl(),i=Il(),{compareIdentifiers:s}=Cx();class a{constructor(c,u){if(u=i(u),c instanceof a){if(c.loose===!!u.loose&&c.includePrerelease===!!u.includePrerelease)return c;c=c.version}else if(typeof c!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof c}".`);if(c.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",c,u),this.options=u,this.loose=!!u.loose,this.includePrerelease=!!u.includePrerelease;const f=c.trim().match(u.loose?r[o.LOOSE]:r[o.FULL]);if(!f)throw new TypeError(`Invalid Version: ${c}`);if(this.raw=c,this.major=+f[1],this.minor=+f[2],this.patch=+f[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");f[4]?this.prerelease=f[4].split(".").map(d=>{if(/^[0-9]+$/.test(d)){const h=+d;if(h>=0&&h<n)return h}return d}):this.prerelease=[],this.build=f[5]?f[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(c){if(e("SemVer.compare",this.version,this.options,c),!(c instanceof a)){if(typeof c=="string"&&c===this.version)return 0;c=new a(c,this.options)}return c.version===this.version?0:this.compareMain(c)||this.comparePre(c)}compareMain(c){return c instanceof a||(c=new a(c,this.options)),s(this.major,c.major)||s(this.minor,c.minor)||s(this.patch,c.patch)}comparePre(c){if(c instanceof a||(c=new a(c,this.options)),this.prerelease.length&&!c.prerelease.length)return-1;if(!this.prerelease.length&&c.prerelease.length)return 1;if(!this.prerelease.length&&!c.prerelease.length)return 0;let u=0;do{const f=this.prerelease[u],d=c.prerelease[u];if(e("prerelease compare",u,f,d),f===void 0&&d===void 0)return 0;if(d===void 0)return 1;if(f===void 0)return-1;if(f===d)continue;return s(f,d)}while(++u)}compareBuild(c){c instanceof a||(c=new a(c,this.options));let u=0;do{const f=this.build[u],d=c.build[u];if(e("build compare",u,f,d),f===void 0&&d===void 0)return 0;if(d===void 0)return 1;if(f===void 0)return-1;if(f===d)continue;return s(f,d)}while(++u)}inc(c,u,f){if(c.startsWith("pre")){if(!u&&f===!1)throw new Error("invalid increment argument: identifier is empty");if(u){const d=`-${u}`.match(this.options.loose?r[o.PRERELEASELOOSE]:r[o.PRERELEASE]);if(!d||d[1]!==u)throw new Error(`invalid identifier: ${u}`)}}switch(c){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",u,f);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",u,f);break;case"prepatch":this.prerelease.length=0,this.inc("patch",u,f),this.inc("pre",u,f);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",u,f),this.inc("pre",u,f);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const d=Number(f)?1:0;if(this.prerelease.length===0)this.prerelease=[d];else{let h=this.prerelease.length;for(;--h>=0;)typeof this.prerelease[h]=="number"&&(this.prerelease[h]++,h=-2);if(h===-1){if(u===this.prerelease.join(".")&&f===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(d)}}if(u){let h=[u,d];f===!1&&(h=[u]),s(this.prerelease[0],u)===0?isNaN(this.prerelease[1])&&(this.prerelease=h):this.prerelease=h}break}default:throw new Error(`invalid increment argument: ${c}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return gs=a,gs}var ps,Uc;function _r(){if(Uc)return ps;Uc=1;const e=Ol();return ps=(n,r,o)=>new e(n,o).compare(new e(r,o)),ps}var ms,Hc;function Ex(){if(Hc)return ms;Hc=1;const e=_r();return ms=(n,r,o)=>e(n,r,o)===0,ms}var vs,Gc;function Mx(){if(Gc)return vs;Gc=1;const e=_r();return vs=(n,r,o)=>e(n,r,o)!==0,vs}var ys,qc;function Ix(){if(qc)return ys;qc=1;const e=_r();return ys=(n,r,o)=>e(n,r,o)>0,ys}var ws,Wc;function Px(){if(Wc)return ws;Wc=1;const e=_r();return ws=(n,r,o)=>e(n,r,o)>=0,ws}var bs,Qc;function Rx(){if(Qc)return bs;Qc=1;const e=_r();return bs=(n,r,o)=>e(n,r,o)<0,bs}var Ss,Xc;function Ox(){if(Xc)return Ss;Xc=1;const e=_r();return Ss=(n,r,o)=>e(n,r,o)<=0,Ss}var xs,Yc;function Fx(){if(Yc)return xs;Yc=1;const e=Ex(),t=Mx(),n=Ix(),r=Px(),o=Rx(),i=Ox();return xs=(a,l,c,u)=>{switch(l){case"===":return typeof a=="object"&&(a=a.version),typeof c=="object"&&(c=c.version),a===c;case"!==":return typeof a=="object"&&(a=a.version),typeof c=="object"&&(c=c.version),a!==c;case"":case"=":case"==":return e(a,c,u);case"!=":return t(a,c,u);case">":return n(a,c,u);case">=":return r(a,c,u);case"<":return o(a,c,u);case"<=":return i(a,c,u);default:throw new TypeError(`Invalid operator: ${l}`)}},xs}var Cs,Jc;function $x(){if(Jc)return Cs;Jc=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(u,f){if(f=n(f),u instanceof t){if(u.loose===!!f.loose)return u;u=u.value}u=u.trim().split(/\s+/).join(" "),s("comparator",u,f),this.options=f,this.loose=!!f.loose,this.parse(u),this.semver===e?this.value="":this.value=this.operator+this.semver.version,s("comp",this)}parse(u){const f=this.options.loose?r[o.COMPARATORLOOSE]:r[o.COMPARATOR],d=u.match(f);if(!d)throw new TypeError(`Invalid comparator: ${u}`);this.operator=d[1]!==void 0?d[1]:"",this.operator==="="&&(this.operator=""),d[2]?this.semver=new a(d[2],this.options.loose):this.semver=e}toString(){return this.value}test(u){if(s("Comparator.test",u,this.options.loose),this.semver===e||u===e)return!0;if(typeof u=="string")try{u=new a(u,this.options)}catch{return!1}return i(u,this.operator,this.semver,this.options)}intersects(u,f){if(!(u instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new l(u.value,f).test(this.value):u.operator===""?u.value===""?!0:new l(this.value,f).test(u.semver):(f=n(f),f.includePrerelease&&(this.value==="<0.0.0-0"||u.value==="<0.0.0-0")||!f.includePrerelease&&(this.value.startsWith("<0.0.0")||u.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&u.operator.startsWith(">")||this.operator.startsWith("<")&&u.operator.startsWith("<")||this.semver.version===u.semver.version&&this.operator.includes("=")&&u.operator.includes("=")||i(this.semver,"<",u.semver,f)&&this.operator.startsWith(">")&&u.operator.startsWith("<")||i(this.semver,">",u.semver,f)&&this.operator.startsWith("<")&&u.operator.startsWith(">")))}}Cs=t;const n=Il(),{safeRe:r,t:o}=Rl(),i=Fx(),s=Di(),a=Ol(),l=eg();return Cs}var Es,Zc;function eg(){if(Zc)return Es;Zc=1;const e=/\s+/g;class t{constructor(M,x){if(x=o(x),M instanceof t)return M.loose===!!x.loose&&M.includePrerelease===!!x.includePrerelease?M:new t(M.raw,x);if(M instanceof i)return this.raw=M.value,this.set=[[M]],this.formatted=void 0,this;if(this.options=x,this.loose=!!x.loose,this.includePrerelease=!!x.includePrerelease,this.raw=M.trim().replace(e," "),this.set=this.raw.split("||").map(O=>this.parseRange(O.trim())).filter(O=>O.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const O=this.set[0];if(this.set=this.set.filter(P=>!g(P[0])),this.set.length===0)this.set=[O];else if(this.set.length>1){for(const P of this.set)if(P.length===1&&v(P[0])){this.set=[P];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let M=0;M<this.set.length;M++){M>0&&(this.formatted+="||");const x=this.set[M];for(let O=0;O<x.length;O++)O>0&&(this.formatted+=" "),this.formatted+=x[O].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(M){const O=((this.options.includePrerelease&&h)|(this.options.loose&&p))+":"+M,P=r.get(O);if(P)return P;const A=this.options.loose,K=A?l[c.HYPHENRANGELOOSE]:l[c.HYPHENRANGE];M=M.replace(K,B(this.options.includePrerelease)),s("hyphen replace",M),M=M.replace(l[c.COMPARATORTRIM],u),s("comparator trim",M),M=M.replace(l[c.TILDETRIM],f),s("tilde trim",M),M=M.replace(l[c.CARETTRIM],d),s("caret trim",M);let H=M.split(" ").map(fe=>y(fe,this.options)).join(" ").split(/\s+/).map(fe=>N(fe,this.options));A&&(H=H.filter(fe=>(s("loose invalid filter",fe,this.options),!!fe.match(l[c.COMPARATORLOOSE])))),s("range list",H);const q=new Map,oe=H.map(fe=>new i(fe,this.options));for(const fe of oe){if(g(fe))return[fe];q.set(fe.value,fe)}q.size>1&&q.has("")&&q.delete("");const J=[...q.values()];return r.set(O,J),J}intersects(M,x){if(!(M instanceof t))throw new TypeError("a Range is required");return this.set.some(O=>m(O,x)&&M.set.some(P=>m(P,x)&&O.every(A=>P.every(K=>A.intersects(K,x)))))}test(M){if(!M)return!1;if(typeof M=="string")try{M=new a(M,this.options)}catch{return!1}for(let x=0;x<this.set.length;x++)if(ne(this.set[x],M,this.options))return!0;return!1}}Es=t;const n=xx(),r=new n,o=Il(),i=$x(),s=Di(),a=Ol(),{safeRe:l,t:c,comparatorTrimReplace:u,tildeTrimReplace:f,caretTrimReplace:d}=Rl(),{FLAG_INCLUDE_PRERELEASE:h,FLAG_LOOSE:p}=Pl(),g=I=>I.value==="<0.0.0-0",v=I=>I.value==="",m=(I,M)=>{let x=!0;const O=I.slice();let P=O.pop();for(;x&&O.length;)x=O.every(A=>P.intersects(A,M)),P=O.pop();return x},y=(I,M)=>(s("comp",I,M),I=R(I,M),s("caret",I),I=S(I,M),s("tildes",I),I=V(I,M),s("xrange",I),I=k(I,M),s("stars",I),I),b=I=>!I||I.toLowerCase()==="x"||I==="*",S=(I,M)=>I.trim().split(/\s+/).map(x=>C(x,M)).join(" "),C=(I,M)=>{const x=M.loose?l[c.TILDELOOSE]:l[c.TILDE];return I.replace(x,(O,P,A,K,H)=>{s("tilde",I,O,P,A,K,H);let q;return b(P)?q="":b(A)?q=`>=${P}.0.0 <${+P+1}.0.0-0`:b(K)?q=`>=${P}.${A}.0 <${P}.${+A+1}.0-0`:H?(s("replaceTilde pr",H),q=`>=${P}.${A}.${K}-${H} <${P}.${+A+1}.0-0`):q=`>=${P}.${A}.${K} <${P}.${+A+1}.0-0`,s("tilde return",q),q})},R=(I,M)=>I.trim().split(/\s+/).map(x=>D(x,M)).join(" "),D=(I,M)=>{s("caret",I,M);const x=M.loose?l[c.CARETLOOSE]:l[c.CARET],O=M.includePrerelease?"-0":"";return I.replace(x,(P,A,K,H,q)=>{s("caret",I,P,A,K,H,q);let oe;return b(A)?oe="":b(K)?oe=`>=${A}.0.0${O} <${+A+1}.0.0-0`:b(H)?A==="0"?oe=`>=${A}.${K}.0${O} <${A}.${+K+1}.0-0`:oe=`>=${A}.${K}.0${O} <${+A+1}.0.0-0`:q?(s("replaceCaret pr",q),A==="0"?K==="0"?oe=`>=${A}.${K}.${H}-${q} <${A}.${K}.${+H+1}-0`:oe=`>=${A}.${K}.${H}-${q} <${A}.${+K+1}.0-0`:oe=`>=${A}.${K}.${H}-${q} <${+A+1}.0.0-0`):(s("no pr"),A==="0"?K==="0"?oe=`>=${A}.${K}.${H}${O} <${A}.${K}.${+H+1}-0`:oe=`>=${A}.${K}.${H}${O} <${A}.${+K+1}.0-0`:oe=`>=${A}.${K}.${H} <${+A+1}.0.0-0`),s("caret return",oe),oe})},V=(I,M)=>(s("replaceXRanges",I,M),I.split(/\s+/).map(x=>$(x,M)).join(" ")),$=(I,M)=>{I=I.trim();const x=M.loose?l[c.XRANGELOOSE]:l[c.XRANGE];return I.replace(x,(O,P,A,K,H,q)=>{s("xRange",I,O,P,A,K,H,q);const oe=b(A),J=oe||b(K),fe=J||b(H),Le=fe;return P==="="&&Le&&(P=""),q=M.includePrerelease?"-0":"",oe?P===">"||P==="<"?O="<0.0.0-0":O="*":P&&Le?(J&&(K=0),H=0,P===">"?(P=">=",J?(A=+A+1,K=0,H=0):(K=+K+1,H=0)):P==="<="&&(P="<",J?A=+A+1:K=+K+1),P==="<"&&(q="-0"),O=`${P+A}.${K}.${H}${q}`):J?O=`>=${A}.0.0${q} <${+A+1}.0.0-0`:fe&&(O=`>=${A}.${K}.0${q} <${A}.${+K+1}.0-0`),s("xRange return",O),O})},k=(I,M)=>(s("replaceStars",I,M),I.trim().replace(l[c.STAR],"")),N=(I,M)=>(s("replaceGTE0",I,M),I.trim().replace(l[M.includePrerelease?c.GTE0PRE:c.GTE0],"")),B=I=>(M,x,O,P,A,K,H,q,oe,J,fe,Le)=>(b(O)?x="":b(P)?x=`>=${O}.0.0${I?"-0":""}`:b(A)?x=`>=${O}.${P}.0${I?"-0":""}`:K?x=`>=${x}`:x=`>=${x}${I?"-0":""}`,b(oe)?q="":b(J)?q=`<${+oe+1}.0.0-0`:b(fe)?q=`<${oe}.${+J+1}.0-0`:Le?q=`<=${oe}.${J}.${fe}-${Le}`:I?q=`<${oe}.${J}.${+fe+1}-0`:q=`<=${q}`,`${x} ${q}`.trim()),ne=(I,M,x)=>{for(let O=0;O<I.length;O++)if(!I[O].test(M))return!1;if(M.prerelease.length&&!x.includePrerelease){for(let O=0;O<I.length;O++)if(s(I[O].semver),I[O].semver!==i.ANY&&I[O].semver.prerelease.length>0){const P=I[O].semver;if(P.major===M.major&&P.minor===M.minor&&P.patch===M.patch)return!0}return!1}return!0};return Es}var Ms,ed;function Ax(){if(ed)return Ms;ed=1;const e=eg();return Ms=(n,r)=>{try{return new e(n,r).range||"*"}catch{return null}},Ms}var Tx=Ax();const td=_f(Tx);var Fl=["id","name","validationState","required","disabled","readOnly"];function $l(e){const t=`form-control-${Ie()}`,n=Z({id:t},e),[r,o]=z(),[i,s]=z(),[a,l]=z(),[c,u]=z(),f=(g,v,m)=>{const y=m!=null||r()!=null;return[m,r(),y&&v!=null?g:void 0].filter(Boolean).join(" ")||void 0},d=g=>[a(),c(),g].filter(Boolean).join(" ")||void 0,h=L(()=>({"data-valid":T(n.validationState)==="valid"?"":void 0,"data-invalid":T(n.validationState)==="invalid"?"":void 0,"data-required":T(n.required)?"":void 0,"data-disabled":T(n.disabled)?"":void 0,"data-readonly":T(n.readOnly)?"":void 0}));return{formControlContext:{name:()=>T(n.name)??T(n.id),dataset:h,validationState:()=>T(n.validationState),isRequired:()=>T(n.required),isDisabled:()=>T(n.disabled),isReadOnly:()=>T(n.readOnly),labelId:r,fieldId:i,descriptionId:a,errorMessageId:c,getAriaLabelledBy:f,getAriaDescribedBy:d,generateId:Ye(()=>T(n.id)),registerLabel:_e(o),registerField:_e(s),registerDescription:_e(l),registerErrorMessage:_e(u)}}}var Li=Ce();function it(){const e=xe(Li);if(e===void 0)throw new Error("[kobalte]: `useFormControlContext` must be used within a `FormControlContext.Provider` component");return e}function Oo(e){const t=it(),n=Z({id:t.generateId("description")},e);return j(()=>Y(t.registerDescription(n.id))),w(le,F({as:"div"},()=>t.dataset(),n))}var Al=["id","aria-label","aria-labelledby","aria-describedby"];function Tl(e){const t=it(),n=Z({id:t.generateId("field")},e);return j(()=>Y(t.registerField(T(n.id)))),{fieldProps:{id:()=>T(n.id),ariaLabel:()=>T(n["aria-label"]),ariaLabelledBy:()=>t.getAriaLabelledBy(T(n.id),T(n["aria-label"]),T(n["aria-labelledby"])),ariaDescribedBy:()=>t.getAriaDescribedBy(T(n["aria-describedby"]))}}}function kr(e){let t;const n=it(),r=Z({id:n.generateId("label")},e),[o,i]=_(r,["ref"]),s=Ei(()=>t,()=>"label");return j(()=>Y(n.registerLabel(i.id))),w(le,F({as:"label",ref(a){var l=me(c=>t=c,o.ref);typeof l=="function"&&l(a)},get for(){return L(()=>s()==="label")()?n.fieldId():void 0}},()=>n.dataset(),i))}function Dl(e,t){j(Ee(e,n=>{if(n==null)return;const r=Dx(n);r!=null&&(r.addEventListener("reset",t,{passive:!0}),Y(()=>{r.removeEventListener("reset",t)}))}))}function Dx(e){return Lx(e)?e.form:e.closest("form")}function Lx(e){return e.matches("textarea, input, select, button")}function Fo(e){const t=it(),n=Z({id:t.generateId("error-message")},e),[r,o]=_(n,["forceMount"]),i=()=>t.validationState()==="invalid";return j(()=>{i()&&Y(t.registerErrorMessage(o.id))}),w(de,{get when(){return r.forceMount||i()},get children(){return w(le,F({as:"div"},()=>t.dataset(),o))}})}var _x={};dt(_x,{Control:()=>Ll,Description:()=>ng,ErrorMessage:()=>rg,Input:()=>_l,Label:()=>kl,Root:()=>Vl,Switch:()=>Vx,Thumb:()=>Nl,useSwitchContext:()=>Hn});var tg=Ce();function Hn(){const e=xe(tg);if(e===void 0)throw new Error("[kobalte]: `useSwitchContext` must be used within a `Switch` component");return e}function Ll(e){const t=it(),n=Hn(),r=Z({id:n.generateId("control")},e),[o,i]=_(r,["onClick","onKeyDown"]);return w(le,F({as:"div",onClick:l=>{var c;ee(l,o.onClick),n.toggle(),(c=n.inputRef())==null||c.focus()},onKeyDown:l=>{var c;ee(l,o.onKeyDown),l.key===Oa.Space&&(n.toggle(),(c=n.inputRef())==null||c.focus())}},()=>t.dataset(),()=>n.dataset(),i))}function ng(e){const t=Hn();return w(Oo,F(()=>t.dataset(),e))}function rg(e){const t=Hn();return w(Fo,F(()=>t.dataset(),e))}function _l(e){const t=it(),n=Hn(),r=Z({id:n.generateId("input")},e),[o,i,s]=_(r,["ref","style","onChange","onFocus","onBlur"],Al),{fieldProps:a}=Tl(i);return w(le,F({as:"input",ref(f){var d=me(n.setInputRef,o.ref);typeof d=="function"&&d(f)},type:"checkbox",role:"switch",get id(){return a.id()},get name(){return t.name()},get value(){return n.value()},get checked(){return n.checked()},get required(){return t.isRequired()},get disabled(){return t.isDisabled()},get readonly(){return t.isReadOnly()},get style(){return ct({...Ci},o.style)},get"aria-checked"(){return n.checked()},get"aria-label"(){return a.ariaLabel()},get"aria-labelledby"(){return a.ariaLabelledBy()},get"aria-describedby"(){return a.ariaDescribedBy()},get"aria-invalid"(){return t.validationState()==="invalid"||void 0},get"aria-required"(){return t.isRequired()||void 0},get"aria-disabled"(){return t.isDisabled()||void 0},get"aria-readonly"(){return t.isReadOnly()||void 0},onChange:f=>{ee(f,o.onChange),f.stopPropagation();const d=f.target;n.setIsChecked(d.checked),d.checked=n.checked()},onFocus:f=>{ee(f,o.onFocus),n.setIsFocused(!0)},onBlur:f=>{ee(f,o.onBlur),n.setIsFocused(!1)}},()=>t.dataset(),()=>n.dataset(),s))}function kl(e){const t=Hn();return w(kr,F(()=>t.dataset(),e))}function Vl(e){let t;const n=`switch-${Ie()}`,r=Z({value:"on",id:n},e),[o,i,s]=_(r,["ref","children","value","checked","defaultChecked","onChange","onPointerDown"],Fl),[a,l]=z(),[c,u]=z(!1),{formControlContext:f}=$l(i),d=wh({isSelected:()=>o.checked,defaultIsSelected:()=>o.defaultChecked,onSelectedChange:v=>{var m;return(m=o.onChange)==null?void 0:m.call(o,v)},isDisabled:()=>f.isDisabled(),isReadOnly:()=>f.isReadOnly()});Dl(()=>t,()=>d.setIsSelected(o.defaultChecked??!1));const h=v=>{ee(v,o.onPointerDown),c()&&v.preventDefault()},p=L(()=>({"data-checked":d.isSelected()?"":void 0})),g={value:()=>o.value,dataset:p,checked:()=>d.isSelected(),inputRef:a,generateId:Ye(()=>T(i.id)),toggle:()=>d.toggle(),setIsChecked:v=>d.setIsSelected(v),setIsFocused:u,setInputRef:l};return w(Li.Provider,{value:f,get children(){return w(tg.Provider,{value:g,get children(){return w(le,F({as:"div",ref(v){var m=me(y=>t=y,o.ref);typeof m=="function"&&m(v)},role:"group",get id(){return T(i.id)},onPointerDown:h},()=>f.dataset(),p,s,{get children(){return w(kx,{state:g,get children(){return o.children}})}}))}})}})}function kx(e){const t=xr(()=>{const n=e.children;return un(n)?n(e.state):n});return L(t)}function Nl(e){const t=it(),n=Hn(),r=Z({id:n.generateId("thumb")},e);return w(le,F({as:"div"},()=>t.dataset(),()=>n.dataset(),r))}var Vx=Object.assign(Vl,{Control:Ll,Description:ng,ErrorMessage:rg,Input:_l,Label:kl,Thumb:Nl});const ma=Vl,va=e=>{const[t,n]=_(e,["class","children"]);return[w(_l,{get class(){return ce("[&:focus-visible+div]:outline-none [&:focus-visible+div]:ring-2 [&:focus-visible+div]:ring-ring [&:focus-visible+div]:ring-offset-2 [&:focus-visible+div]:ring-offset-background",t.class)}}),w(Ll,F({get class(){return ce("inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent bg-input transition-[color,background-color,box-shadow] data-[disabled]:cursor-not-allowed data-[checked]:bg-primary data-[disabled]:opacity-50",t.class)}},n,{get children(){return t.children}}))]},ya=e=>{const[t,n]=_(e,["class"]);return w(Nl,F({get class(){return ce("pointer-events-none block size-5 translate-x-0 rounded-full bg-background shadow-lg ring-0 transition-transform data-[checked]:translate-x-5",t.class)}},n))},wa=e=>{const[t,n]=_(e,["class"]);return w(kl,F({get class(){return ce("text-sm font-medium leading-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-70",t.class)}},n))};var Nx={};dt(Nx,{Description:()=>Oo,ErrorMessage:()=>Fo,Input:()=>zl,Label:()=>kr,Root:()=>Bl,TextArea:()=>sg,TextField:()=>zx,useTextFieldContext:()=>Kl});var og=Ce();function Kl(){const e=xe(og);if(e===void 0)throw new Error("[kobalte]: `useTextFieldContext` must be used within a `TextField` component");return e}function zl(e){return w(ig,F({type:"text"},e))}function ig(e){const t=it(),n=Kl(),r=Z({id:n.generateId("input")},e),[o,i,s]=_(r,["onInput"],Al),{fieldProps:a}=Tl(i);return w(le,F({as:"input",get id(){return a.id()},get name(){return t.name()},get value(){return n.value()},get required(){return t.isRequired()},get disabled(){return t.isDisabled()},get readonly(){return t.isReadOnly()},get"aria-label"(){return a.ariaLabel()},get"aria-labelledby"(){return a.ariaLabelledBy()},get"aria-describedby"(){return a.ariaDescribedBy()},get"aria-invalid"(){return t.validationState()==="invalid"||void 0},get"aria-required"(){return t.isRequired()||void 0},get"aria-disabled"(){return t.isDisabled()||void 0},get"aria-readonly"(){return t.isReadOnly()||void 0},get onInput(){return ye([o.onInput,n.onInput])}},()=>t.dataset(),s))}function Bl(e){let t;const n=`textfield-${Ie()}`,r=Z({id:n},e),[o,i,s]=_(r,["ref","value","defaultValue","onChange"],Fl),a=o.value,[l,c]=wt({value:()=>a===void 0?void 0:o.value??"",defaultValue:()=>o.defaultValue,onChange:h=>{var p;return(p=o.onChange)==null?void 0:p.call(o,h)}}),{formControlContext:u}=$l(i);Dl(()=>t,()=>c(o.defaultValue??""));const f=h=>{if(u.isReadOnly()||u.isDisabled())return;const p=h.target;c(p.value),p.value=l()??""},d={value:l,generateId:Ye(()=>T(i.id)),onInput:f};return w(Li.Provider,{value:u,get children(){return w(og.Provider,{value:d,get children(){return w(le,F({as:"div",ref(h){var p=me(g=>t=g,o.ref);typeof p=="function"&&p(h)},role:"group",get id(){return T(i.id)}},()=>u.dataset(),s))}})}})}function sg(e){let t;const n=Kl(),r=Z({id:n.generateId("textarea")},e),[o,i]=_(r,["ref","autoResize","submitOnEnter","onKeyPress"]);j(Ee([()=>t,()=>o.autoResize,()=>n.value()],([a,l])=>{!a||!l||Kx(a)}));const s=a=>{t&&o.submitOnEnter&&a.key==="Enter"&&!a.shiftKey&&t.form&&(t.form.requestSubmit(),a.preventDefault())};return w(ig,F({as:"textarea",get"aria-multiline"(){return o.submitOnEnter?"false":void 0},get onKeyPress(){return ye([o.onKeyPress,s])},ref(a){var l=me(c=>t=c,o.ref);typeof l=="function"&&l(a)}},i))}function Kx(e){const t=e.style.alignSelf,n=e.style.overflow;"MozAppearance"in e.style||(e.style.overflow="hidden"),e.style.alignSelf="start",e.style.height="auto",e.style.height=`${e.scrollHeight+(e.offsetHeight-e.clientHeight)}px`,e.style.overflow=n,e.style.alignSelf=t}var zx=Object.assign(Bl,{Description:Oo,ErrorMessage:Fo,Input:zl,Label:kr,TextArea:sg});const ii=Bl,Is=e=>{const[t,n]=_(e,["type","class"]);return w(zl,F({get type(){return t.type},get class(){return ce("flex h-10 w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-50",t.class)}},n))},Bx=Mr("text-sm font-medium leading-none peer-disabled:opacity-70",{variants:{variant:{label:"data-[invalid]:text-destructive",description:"text-destructive",error:"font-normal text-red-500"}},defaultVariants:{variant:"label"}}),si=e=>{const[t,n]=_(e,["class"]);return w(kr,F({get class(){return ce(Bx(),t.class)}},n))};var nd=te("<div>"),jx=te('<div class="text-sm text-muted-foreground flex flex-row items-center">Platform: <p class="ml-2 flex flex-row items-center"> iOS'),Ux=te('<div class="text-sm text-muted-foreground flex flex-row items-center">Platform: <p class="ml-2 flex flex-row items-center"> Android'),Hx=te('<div class="text-sm text-muted-foreground flex flex-row items-center">Channel: <p class=ml-2>'),Gx=te('<form class="flex flex-col gap-3 flex-1"><div></div><div><div class="flex items-center space-x-2"></div><p class="text-xs text-muted-foreground mt-[2px]">When disabled, this update will not be available to your users.</p></div><div><div class="flex items-center space-x-2"></div><p class="text-xs text-muted-foreground mt-[2px]">When enabled, this update will require users to update before continuing to use the application.</p></div><div class="mt-2 space-y-1"><h3 class="text-md text-bold font-medium">Metadata'),qx=te('<em class="text-xs text-red-500">'),Wx=te('<em class="text-xs text-muted-foreground">'),Qx=te('<div class="text-sm text-muted-foreground flex flex-row items-center">App Version: <p class=ml-2>'),Xx=te('<div class="text-sm text-muted-foreground flex flex-row items-center">Commit Hash: '),Yx=te("<a target=_blank rel=noreferrer class=ml-2>"),Jx=te("<p class=ml-2>");const Zx=({bundle:e,onEditSuccess:t})=>{const n=yo(),r=US(),[o,i]=z(!1),s=L(()=>{var u,f;return((f=(u=r.data)==null?void 0:u.console)==null?void 0:f.gitUrl)??null}),a=L(()=>e.gitCommitHash),l=Sx(()=>({defaultValues:{message:e.message,targetAppVersion:e.targetAppVersion,enabled:e.enabled,shouldForceUpdate:e.shouldForceUpdate},onSubmit:async({value:u})=>{i(!0);try{const f=await wn.bundles[":bundleId"].$patch({param:{bundleId:e.id},json:u});if(f.status!==200){const d=await f.json();Yt({title:"Error",description:d.error,variant:"error"})}}catch(f){f instanceof Error&&Yt({title:"Error",description:f.message,variant:"error"})}finally{i(!1),n.invalidateQueries({queryKey:["bundle",e.id]}),n.invalidateQueries({queryKey:["bundles"]}),n.invalidateQueries({queryKey:["channels"]}),t()}}})),c=l.useStore(u=>u.isValid);return(()=>{var u=Gx(),f=u.firstChild,d=f.nextSibling,h=d.firstChild,p=d.nextSibling,g=p.firstChild,v=p.nextSibling;return v.firstChild,u.addEventListener("submit",m=>{m.preventDefault(),m.stopPropagation(),l.handleSubmit()}),W(f,w(ii,{class:"grid w-full max-w-sm items-center gap-1.5",get children(){return[w(si,{for:"message",children:"Message"}),w(l.Field,{name:"message",children:m=>w(Is,{type:"text",id:"message",placeholder:"Message",get name(){return m().name},get value(){return m().state.value??""},get onBlur(){return m().handleBlur},onInput:y=>m().handleChange(y.currentTarget.value)})})]}})),W(u,w(de,{get when(){return e.targetAppVersion},get children(){var m=nd();return W(m,w(ii,{class:"grid w-full max-w-sm items-center gap-1.5",get children(){return[w(si,{for:"targetAppVersion",children:"Target App Version"}),w(l.Field,{name:"targetAppVersion",validators:{onChange:({value:y})=>{if((y==null?void 0:y.length)===0||!td(y))return"Invalid target app version"}},children:y=>[w(Is,{type:"text",id:"targetAppVersion",get class(){return ce(y().state.meta.errors.length>0&&"border-red-500 focus-visible:ring-red-500")},placeholder:"Target App Version",get name(){return y().name},get value(){return y().state.value??""},get onBlur(){return y().handleBlur},onInput:b=>y().handleChange(b.currentTarget.value)}),L(()=>L(()=>y().state.meta.errors.length>0)()?(()=>{var b=qx();return W(b,()=>y().state.meta.errors.join(", ")),b})():(()=>{var b=Wx();return W(b,()=>td(y().state.value)),b})())]})]}})),m}}),d),W(u,w(de,{get when(){return e.fingerprintHash},get children(){var m=nd();return W(m,w(ii,{class:"grid w-full max-w-sm items-center gap-1.5",get children(){return[w(si,{for:"fingerprintHash",children:"Fingerprint Hash"}),w(Is,{type:"text",id:"fingerprintHash",get value(){return e.fingerprintHash??""},disabled:!0})]}})),m}}),d),W(h,w(l.Field,{name:"enabled",children:m=>w(ma,{class:"flex items-center space-x-2",get checked(){return m().state.value},get name(){return m().name},onChange:y=>m().handleChange(y),get children(){return[w(va,{get children(){return w(ya,{})}}),w(wa,{children:"Enabled"})]}})})),W(g,w(l.Field,{name:"shouldForceUpdate",children:m=>w(ma,{class:"flex items-center space-x-2",get checked(){return m().state.value},get name(){return m().name},onChange:y=>m().handleChange(y),get children(){return[w(va,{get children(){return w(ya,{})}}),w(wa,{children:"Force Update"})]}})})),W(u,w(de,{get when(){return!o()},get fallback(){return w(fn,{type:"submit",class:"mt-4",disabled:!0,get children(){return w(lw,{class:"animate-spin"})}})},get children(){return w(fn,{type:"submit",class:"mt-4",get disabled(){return!c()},children:"Save"})}}),v),W(v,w(de,{get when(){return e.platform==="ios"},get children(){var m=jx(),y=m.firstChild,b=y.nextSibling,S=b.firstChild;return W(b,w(Nf,{class:"inline-block"}),S),m}}),null),W(v,w(de,{get when(){return e.platform==="android"},get children(){var m=Ux(),y=m.firstChild,b=y.nextSibling,S=b.firstChild;return W(b,w(Vf,{class:"inline-block"}),S),m}}),null),W(v,w(de,{get when(){var m;return(m=e.metadata)==null?void 0:m.app_version},children:m=>(()=>{var y=Qx(),b=y.firstChild,S=b.nextSibling;return W(S,m),y})()}),null),W(v,w(de,{get when(){return e.channel},get children(){var m=Hx(),y=m.firstChild,b=y.nextSibling;return W(b,()=>e.channel),m}}),null),W(v,w(de,{get when(){return a()},children:m=>(()=>{var y=Xx();return y.firstChild,W(y,(()=>{var b=L(()=>!!s());return()=>b()?(()=>{var S=Yx();return W(S,()=>m().slice(0,8)),Ve(()=>Ln(S,"href",`${s()}/commit/${m}`)),S})():(()=>{var S=Jx();return W(S,()=>m().slice(0,8)),S})()})(),null),y})()}),null),u})()};var ag=te("<div>");const eC=Mr("rounded-md border-l-4 p-2 pl-4",{variants:{variant:{default:"border-info-foreground bg-info text-info-foreground",success:"border-success-foreground bg-success text-success-foreground",warning:"border-warning-foreground bg-warning text-warning-foreground",error:"border-error-foreground bg-error text-error-foreground"}},defaultVariants:{variant:"default"}}),tC=e=>{const[t,n]=_(e,["class","variant"]);return(()=>{var r=ag();return qe(r,F({get class(){return ce(eC({variant:t.variant}),t.class)}},n),!1,!1),r})()},nC=e=>{const[t,n]=_(e,["class"]);return(()=>{var r=ag();return qe(r,F({get class(){return ce("mt-2",t.class)}},n),!1,!1),r})()};var rC=te("<option>"),oC=te("<div aria-hidden=true><input type=text><select tabindex=-1><option>");function iC(e){let t;const[n,r]=_(e,["ref","onChange","collection","selectionManager","isOpen","isMultiple","isVirtualized","focusTrigger"]),o=it(),[i,s]=z(!1),a=l=>{const c=n.collection.getItem(l);return w(de,{get when(){return(c==null?void 0:c.type)==="item"},get children(){var u=rC();return u.value=l,W(u,()=>c==null?void 0:c.textValue),Ve(()=>u.selected=n.selectionManager.isSelected(l)),u}})};return j(Ee(()=>n.selectionManager.selectedKeys(),(l,c)=>{c&&dh(l,c)||(s(!0),t==null||t.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0})),t==null||t.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0})))},{defer:!0})),(()=>{var l=oC(),c=l.firstChild,u=c.nextSibling;u.firstChild,c.addEventListener("focus",()=>n.focusTrigger()),c.style.setProperty("font-size","16px"),u.addEventListener("change",d=>{ee(d,n.onChange),i()||n.selectionManager.setSelectedKeys(new Set([d.target.value])),s(!1)});var f=me(d=>t=d,n.ref);return typeof f=="function"&&Pd(f,u),qe(u,F({get multiple(){return n.isMultiple},get name(){return o.name()},get required(){return o.isRequired()},get disabled(){return o.isDisabled()},get size(){return n.collection.getSize()},get value(){return n.selectionManager.firstSelectedKey()??""}},r),!1,!0),W(u,w(de,{get when(){return n.isVirtualized},get fallback(){return w(et,{get each(){return[...n.collection.getKeys()]},children:a})},get children(){return w(et,{get each(){return[...n.selectionManager.selectedKeys()]},children:a})}}),null),Ve(d=>{var h=Ci,p=n.selectionManager.isFocused()||n.isOpen?-1:0,g=o.isRequired(),v=o.isDisabled(),m=o.isReadOnly();return d.e=Id(l,h,d.e),p!==d.t&&Ln(c,"tabindex",d.t=p),g!==d.a&&(c.required=d.a=g),v!==d.o&&(c.disabled=d.o=v),m!==d.i&&(c.readOnly=d.i=m),d},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),l})()}var rd=new WeakMap;function ba(e){let t=rd.get(e);if(t!=null)return t;t=0;for(const n of e)n.type==="item"&&t++;return rd.set(e,t),t}var sC={};dt(sC,{Item:()=>$o,ItemDescription:()=>_i,ItemIndicator:()=>Ao,ItemLabel:()=>To,Listbox:()=>aC,Root:()=>Ul,Section:()=>ki,useListboxContext:()=>ug});var lg=Ce();function ug(){const e=xe(lg);if(e===void 0)throw new Error("[kobalte]: `useListboxContext` must be used within a `Listbox` component");return e}var cg=Ce();function jl(){const e=xe(cg);if(e===void 0)throw new Error("[kobalte]: `useListboxItemContext` must be used within a `Listbox.Item` component");return e}function $o(e){let t;const n=ug(),r=`${n.generateId("item")}-${Ie()}`,o=Z({id:r},e),[i,s]=_(o,["ref","item","aria-label","aria-labelledby","aria-describedby","onPointerMove","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,l]=z(),[c,u]=z(),f=()=>n.listState().selectionManager(),d=()=>f().focusedKey()===i.item.key,h=ul({key:()=>i.item.key,selectionManager:f,shouldSelectOnPressUp:n.shouldSelectOnPressUp,allowsDifferentPressOrigin:()=>n.shouldSelectOnPressUp()&&n.shouldFocusOnHover(),shouldUseVirtualFocus:n.shouldUseVirtualFocus,disabled:()=>i.item.disabled},()=>t),p=()=>{if(f().selectionMode()!=="none")return h.isSelected()},g=L(()=>!(wo()&&Dm())),v=()=>g()?i["aria-label"]:void 0,m=()=>g()?a():void 0,y=()=>g()?c():void 0,b=()=>{var $;if(!n.isVirtualized())return;const V=($=n.listState().collection().getItem(i.item.key))==null?void 0:$.index;return V!=null?V+1:void 0},S=()=>{if(n.isVirtualized())return ba(n.listState().collection())},C=V=>{ee(V,i.onPointerMove),V.pointerType==="mouse"&&!h.isDisabled()&&n.shouldFocusOnHover()&&(Fe(V.currentTarget),f().setFocused(!0),f().setFocusedKey(i.item.key))},R=L(()=>({"data-disabled":h.isDisabled()?"":void 0,"data-selected":h.isSelected()?"":void 0,"data-highlighted":d()?"":void 0})),D={isSelected:h.isSelected,dataset:R,generateId:Ye(()=>s.id),registerLabelId:_e(l),registerDescriptionId:_e(u)};return w(cg.Provider,{value:D,get children(){return w(le,F({as:"li",ref(V){var $=me(k=>t=k,i.ref);typeof $=="function"&&$(V)},role:"option",get tabIndex(){return h.tabIndex()},get"aria-disabled"(){return h.isDisabled()},get"aria-selected"(){return p()},get"aria-label"(){return v()},get"aria-labelledby"(){return m()},get"aria-describedby"(){return y()},get"aria-posinset"(){return b()},get"aria-setsize"(){return S()},get"data-key"(){return h.dataKey()},get onPointerDown(){return ye([i.onPointerDown,h.onPointerDown])},get onPointerUp(){return ye([i.onPointerUp,h.onPointerUp])},get onClick(){return ye([i.onClick,h.onClick])},get onKeyDown(){return ye([i.onKeyDown,h.onKeyDown])},get onMouseDown(){return ye([i.onMouseDown,h.onMouseDown])},get onFocus(){return ye([i.onFocus,h.onFocus])},onPointerMove:C},R,s))}})}function _i(e){const t=jl(),n=Z({id:t.generateId("description")},e);return j(()=>Y(t.registerDescriptionId(n.id))),w(le,F({as:"div"},()=>t.dataset(),n))}function Ao(e){const t=jl(),n=Z({id:t.generateId("indicator")},e),[r,o]=_(n,["forceMount"]);return w(de,{get when(){return r.forceMount||t.isSelected()},get children(){return w(le,F({as:"div","aria-hidden":"true"},()=>t.dataset(),o))}})}function To(e){const t=jl(),n=Z({id:t.generateId("label")},e);return j(()=>Y(t.registerLabelId(n.id))),w(le,F({as:"div"},()=>t.dataset(),n))}function Ul(e){let t;const n=`listbox-${Ie()}`,r=Z({id:n,selectionMode:"single",virtualized:!1},e),[o,i]=_(r,["ref","children","renderItem","renderSection","value","defaultValue","onChange","options","optionValue","optionTextValue","optionDisabled","optionGroupChildren","state","keyboardDelegate","autoFocus","selectionMode","shouldFocusWrap","shouldUseVirtualFocus","shouldSelectOnPressUp","shouldFocusOnHover","allowDuplicateSelectionEvents","disallowEmptySelection","selectionBehavior","selectOnFocus","disallowTypeAhead","allowsTabNavigation","virtualized","scrollToItem","scrollRef","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]),s=L(()=>o.state?o.state:cl({selectedKeys:()=>o.value,defaultSelectedKeys:()=>o.defaultValue,onSelectionChange:o.onChange,allowDuplicateSelectionEvents:()=>T(o.allowDuplicateSelectionEvents),disallowEmptySelection:()=>T(o.disallowEmptySelection),selectionBehavior:()=>T(o.selectionBehavior),selectionMode:()=>T(o.selectionMode),dataSource:()=>o.options??[],getKey:()=>o.optionValue,getTextValue:()=>o.optionTextValue,getDisabled:()=>o.optionDisabled,getSectionChildren:()=>o.optionGroupChildren})),a=gh({selectionManager:()=>s().selectionManager(),collection:()=>s().collection(),autoFocus:()=>T(o.autoFocus),shouldFocusWrap:()=>T(o.shouldFocusWrap),keyboardDelegate:()=>o.keyboardDelegate,disallowEmptySelection:()=>T(o.disallowEmptySelection),selectOnFocus:()=>T(o.selectOnFocus),disallowTypeAhead:()=>T(o.disallowTypeAhead),shouldUseVirtualFocus:()=>T(o.shouldUseVirtualFocus),allowsTabNavigation:()=>T(o.allowsTabNavigation),isVirtualized:()=>o.virtualized,scrollToKey:()=>o.scrollToItem},()=>t,()=>{var c;return(c=o.scrollRef)==null?void 0:c.call(o)}),l={listState:s,generateId:Ye(()=>i.id),shouldUseVirtualFocus:()=>r.shouldUseVirtualFocus,shouldSelectOnPressUp:()=>r.shouldSelectOnPressUp,shouldFocusOnHover:()=>r.shouldFocusOnHover,isVirtualized:()=>o.virtualized};return w(lg.Provider,{value:l,get children(){return w(le,F({as:"ul",ref(c){var u=me(f=>t=f,o.ref);typeof u=="function"&&u(c)},role:"listbox",get tabIndex(){return a.tabIndex()},get"aria-multiselectable"(){return s().selectionManager().selectionMode()==="multiple"?!0:void 0},get onKeyDown(){return ye([o.onKeyDown,a.onKeyDown])},get onMouseDown(){return ye([o.onMouseDown,a.onMouseDown])},get onFocusIn(){return ye([o.onFocusIn,a.onFocusIn])},get onFocusOut(){return ye([o.onFocusOut,a.onFocusOut])}},i,{get children(){return w(de,{get when(){return!o.virtualized},get fallback(){var c;return(c=o.children)==null?void 0:c.call(o,s().collection)},get children(){return w(Pm,{get each(){return[...s().collection()]},by:"key",children:c=>w(Tg,{get children(){return[w(du,{get when(){return c().type==="section"},get children(){var u;return(u=o.renderSection)==null?void 0:u.call(o,c())}}),w(du,{get when(){return c().type==="item"},get children(){var u;return(u=o.renderItem)==null?void 0:u.call(o,c())}})]}})})}})}}))}})}function ki(e){return w(le,F({as:"li",role:"presentation"},e))}var aC=Object.assign(Ul,{Item:$o,ItemDescription:_i,ItemIndicator:Ao,ItemLabel:To,Section:ki}),dg=Ce();function Ht(){const e=xe(dg);if(e===void 0)throw new Error("[kobalte]: `useComboboxContext` must be used within a `Combobox` component");return e}function Hl(e){let t;const n=Ht(),[r,o]=_(e,["ref","style","onCloseAutoFocus","onFocusOutside"]),i=()=>{n.resetInputValue(n.listState().selectionManager().selectedKeys()),n.close(),setTimeout(()=>{n.close()})},s=a=>{var l;(l=r.onFocusOutside)==null||l.call(r,a),n.isOpen()&&n.isModal()&&a.preventDefault()};return Ha({isDisabled:()=>!(n.isOpen()&&n.isModal()),targets:()=>{const a=[];t&&a.push(t);const l=n.controlRef();return l&&a.push(l),a}}),Ga({element:()=>t??null,enabled:()=>n.contentPresent()&&n.preventScroll()}),Ua({trapFocus:()=>n.isOpen()&&n.isModal(),onMountAutoFocus:a=>{a.preventDefault()},onUnmountAutoFocus:a=>{var l;(l=r.onCloseAutoFocus)==null||l.call(r,a),a.defaultPrevented||(Fe(n.inputRef()),a.preventDefault())}},()=>t),w(de,{get when(){return n.contentPresent()},get children(){return w(Cn.Positioner,{get children(){return w(xo,F({ref(a){var l=me(c=>{n.setContentRef(c),t=c},r.ref);typeof l=="function"&&l(a)},get disableOutsidePointerEvents(){return L(()=>!!n.isModal())()&&n.isOpen()},get excludedElements(){return[n.controlRef]},get style(){return ct({"--kb-combobox-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},r.style)},onFocusOutside:s,onDismiss:i},()=>n.dataset(),o))}})}})}function Gl(e){let t;const n=it(),r=Ht(),o=Z({id:r.generateId("input")},e),[i,s,a]=_(o,["ref","disabled","onClick","onInput","onKeyDown","onFocus","onBlur","onTouchEnd"],Al),l=()=>r.listState().collection(),c=()=>r.listState().selectionManager(),u=()=>i.disabled||r.isDisabled()||n.isDisabled(),{fieldProps:f}=Tl(s),d=b=>{ee(b,i.onClick),r.triggerMode()==="focus"&&!r.isOpen()&&r.open(!1,"focus")},h=b=>{if(ee(b,i.onInput),n.isReadOnly()||u())return;const S=b.target;r.setInputValue(S.value),S.value=r.inputValue()??"",r.isOpen()?l().getSize()<=0&&!r.allowsEmptyCollection()&&r.close():(l().getSize()>0||r.allowsEmptyCollection())&&r.open(!1,"input")},p=b=>{if(ee(b,i.onKeyDown),!(n.isReadOnly()||u()))switch(r.isOpen()&&ee(b,r.onInputKeyDown),b.key){case"Enter":if(r.isOpen()){b.preventDefault();const S=c().focusedKey();S!=null&&c().select(S)}break;case"Tab":r.isOpen()&&(r.close(),r.resetInputValue(r.listState().selectionManager().selectedKeys()));break;case"Escape":r.isOpen()?(r.close(),r.resetInputValue(r.listState().selectionManager().selectedKeys())):r.setInputValue("");break;case"ArrowDown":r.isOpen()||r.open(b.altKey?!1:"first","manual");break;case"ArrowUp":r.isOpen()?b.altKey&&(r.close(),r.resetInputValue(r.listState().selectionManager().selectedKeys())):r.open("last","manual");break;case"ArrowLeft":case"ArrowRight":c().setFocusedKey(void 0);break;case"Backspace":if(r.removeOnBackspace()&&c().selectionMode()==="multiple"&&r.inputValue()===""){const S=[...c().selectedKeys()].pop()??"";c().toggleSelection(S)}break}},g=b=>{ee(b,i.onFocus),!r.isInputFocused()&&r.setIsInputFocused(!0)},v=b=>{ee(b,i.onBlur),!($e(r.controlRef(),b.relatedTarget)||$e(r.contentRef(),b.relatedTarget))&&r.setIsInputFocused(!1)};let m=0;return w(le,F({as:"input",ref(b){var S=me(C=>{r.setInputRef(C),t=C},i.ref);typeof S=="function"&&S(b)},get id(){return f.id()},get value(){return r.inputValue()},get required(){return n.isRequired()},get disabled(){return n.isDisabled()},get readonly(){return n.isReadOnly()},get placeholder(){return r.placeholder()},type:"text",role:"combobox",autoComplete:"off",autoCorrect:"off",spellCheck:"false","aria-haspopup":"listbox","aria-autocomplete":"list",get"aria-expanded"(){return r.isOpen()},get"aria-controls"(){return L(()=>!!r.isOpen())()?r.listboxId():void 0},get"aria-activedescendant"(){return r.activeDescendant()},get"aria-label"(){return f.ariaLabel()},get"aria-labelledby"(){return f.ariaLabelledBy()},get"aria-describedby"(){return f.ariaDescribedBy()},get"aria-invalid"(){return n.validationState()==="invalid"||void 0},get"aria-required"(){return n.isRequired()||void 0},get"aria-disabled"(){return n.isDisabled()||void 0},get"aria-readonly"(){return n.isReadOnly()||void 0},onClick:d,onInput:h,onKeyDown:p,onFocus:g,onBlur:v,onTouchEnd:b=>{if(ee(b,i.onTouchEnd),!t||n.isReadOnly()||u())return;if(b.timeStamp-m<500){b.preventDefault(),t.focus();return}const S=b.target.getBoundingClientRect(),C=b.changedTouches[0],R=Math.ceil(S.left+.5*S.width),D=Math.ceil(S.top+.5*S.height);C.clientX===R&&C.clientY===D&&(b.preventDefault(),t.focus(),r.toggle(!1,"manual"),m=b.timeStamp)}},()=>r.dataset(),()=>n.dataset(),a))}function ql(e){const t=it(),n=Ht(),r=Z({id:n.generateId("listbox")},e),[o,i]=_(r,["ref"]),s=()=>t.getAriaLabelledBy(i.id,n.listboxAriaLabel(),void 0);return j(()=>Y(n.registerListboxId(i.id))),w(Ul,F({ref(a){var l=me(n.setListboxRef,o.ref);typeof l=="function"&&l(a)},get state(){return n.listState()},get autoFocus(){return n.autoFocus()},shouldUseVirtualFocus:!0,shouldSelectOnPressUp:!0,shouldFocusOnHover:!0,get"aria-label"(){return n.listboxAriaLabel()},get"aria-labelledby"(){return s()},get renderItem(){return n.renderItem},get renderSection(){return n.renderSection},get virtualized(){return n.isVirtualized()}},i))}function Wl(e){const t=Ht();return w(de,{get when(){return t.contentPresent()},get children(){return w(mo,e)}})}function Ql(e){const t=it(),n=Ht(),[r,o]=_(e,["ref","children"]),i=()=>n.listState().selectionManager();return w(le,F({as:"div",ref(s){var a=me(n.setControlRef,r.ref);typeof a=="function"&&a(s)}},()=>n.dataset(),()=>t.dataset(),o,{get children(){return w(lC,{state:{selectedOptions:()=>n.selectedOptions(),remove:s=>n.removeOptionFromSelection(s),clear:()=>i().clearSelection()},get children(){return r.children}})}}))}function lC(e){const t=xr(()=>{const n=e.children;return un(n)?n(e.state):n});return L(t)}function fg(e){const t=Ht();return w(iC,F({get collection(){return t.listState().collection()},get selectionManager(){return t.listState().selectionManager()},get isOpen(){return t.isOpen()},get isMultiple(){return t.isMultiple()},get isVirtualized(){return t.isVirtualized()},focusTrigger:()=>{var n;return(n=t.inputRef())==null?void 0:n.focus()}},e))}function Xl(e){const t=Ht(),n=Z({children:"▼"},e);return w(le,F({as:"span","aria-hidden":"true"},()=>t.dataset(),n))}var uC={focusAnnouncement:(e,t)=>`${e}${t?", selected":""}`,countAnnouncement:e=>{switch(e){case 1:return"one option available"}},selectedAnnouncement:e=>`${e}, selected`,triggerLabel:"Show suggestions",listboxLabel:"Suggestions"};function cC(e){const t=`combobox-${Ie()}`,n=Cw({sensitivity:"base"}),r=Z({id:t,selectionMode:"single",allowsEmptyCollection:!1,disallowEmptySelection:!1,allowDuplicateSelectionEvents:!0,closeOnSelection:e.selectionMode==="single",removeOnBackspace:!0,gutter:8,sameWidth:!0,modal:!1,defaultFilter:"contains",triggerMode:"input",translations:uC},e),[o,i,s,a]=_(r,["noResetInputOnBlur","translations","itemComponent","sectionComponent","open","defaultOpen","onOpenChange","onInputChange","value","defaultValue","onChange","triggerMode","placeholder","options","optionValue","optionTextValue","optionLabel","optionDisabled","optionGroupChildren","keyboardDelegate","allowDuplicateSelectionEvents","disallowEmptySelection","defaultFilter","shouldFocusWrap","allowsEmptyCollection","closeOnSelection","removeOnBackspace","selectionBehavior","selectionMode","virtualized","modal","preventScroll","forceMount"],["getAnchorRect","placement","gutter","shift","flip","slide","overlap","sameWidth","fitViewport","hideWhenDetached","detachedPadding","arrowPadding","overflowPadding"],Fl),[l,c]=z(),[u,f]=z(),[d,h]=z(),[p,g]=z(),[v,m]=z(),[y,b]=z(),[S,C]=z(!1),[R,D]=z(!1),[V,$]=z(!1),[k,N]=z(o.options),B=Co({open:()=>o.open,defaultOpen:()=>o.defaultOpen,onOpenChange:U=>{var G;return(G=o.onOpenChange)==null?void 0:G.call(o,U,q)}}),[ne,I]=wt({defaultValue:()=>"",onChange:U=>{var G;(G=o.onInputChange)==null||G.call(o,U),U===""&&o.selectionMode==="single"&&!J.selectionManager().isEmpty()&&o.value===void 0&&J.selectionManager().setSelectedKeys([]),J.selectionManager().setFocusedKey(void 0)}}),M=U=>{const G=o.optionValue;return G==null?String(U):String(un(G)?G(U):U[G])},x=U=>{const G=o.optionLabel;return G==null?String(U):String(un(G)?G(U):U[G])},O=U=>{const G=o.optionTextValue;return G==null?String(U):String(un(G)?G(U):U[G])},P=L(()=>{const U=o.optionGroupChildren;return U==null?o.options:o.options.flatMap(G=>G[U]??G)}),A=U=>{var De;const G=ne()??"";if(un(o.defaultFilter))return(De=o.defaultFilter)==null?void 0:De.call(o,U,G);const we=O(U);switch(o.defaultFilter){case"startsWith":return n.startsWith(we,G);case"endsWith":return n.endsWith(we,G);case"contains":return n.contains(we,G)}},K=L(()=>{const U=o.optionGroupChildren;if(U==null)return o.options.filter(A);const G=[];for(const we of o.options){const De=we[U].filter(A);De.length!==0&&G.push({...we,[U]:De})}return G}),H=L(()=>B.isOpen()?V()?o.options:K():k());let q="focus";const oe=U=>[...U].map(G=>P().find(we=>M(we)===G)).filter(G=>G!=null),J=cl({selectedKeys:()=>o.value!=null?o.value.map(M):o.value,defaultSelectedKeys:()=>o.defaultValue!=null?o.defaultValue.map(M):o.defaultValue,onSelectionChange:U=>{var we;(we=o.onChange)==null||we.call(o,oe(U)),o.closeOnSelection&&B.isOpen()&&U.size>0&&(Pe(),setTimeout(Pe));const G=d();G&&(G.setSelectionRange(G.value.length,G.value.length),Fe(G))},allowDuplicateSelectionEvents:()=>T(o.allowDuplicateSelectionEvents),disallowEmptySelection:()=>o.disallowEmptySelection,selectionBehavior:()=>T(o.selectionBehavior),selectionMode:()=>o.selectionMode,dataSource:H,getKey:()=>o.optionValue,getTextValue:()=>o.optionTextValue,getDisabled:()=>o.optionDisabled,getSectionChildren:()=>o.optionGroupChildren}),fe=L(()=>oe(J.selectionManager().selectedKeys())),Le=U=>{J.selectionManager().toggleSelection(M(U))},{present:Je}=Vn({show:()=>o.forceMount||B.isOpen(),element:()=>v()??null}),ie=(U,G)=>{if(o.triggerMode==="manual"&&G!=="manual"||!($(G==="manual")?o.options.length>0:K().length>0)&&!o.allowsEmptyCollection)return;q=G,C(U),B.open();let qt=J.selectionManager().firstSelectedKey();qt==null&&(U==="first"?qt=J.collection().getFirstKey():U==="last"&&(qt=J.collection().getLastKey())),J.selectionManager().setFocused(!0),J.selectionManager().setFocusedKey(qt)},Pe=()=>{B.close(),J.selectionManager().setFocused(!1),J.selectionManager().setFocusedKey(void 0)},Te=(U,G)=>{B.isOpen()?Pe():ie(U,G)},{formControlContext:st}=$l(s);Dl(d,()=>{const U=o.defaultValue?[...o.defaultValue].map(M):new Rt;J.selectionManager().setSelectedKeys(U)});const Gt=L(()=>{const U=T(o.keyboardDelegate);return U||new hh(J.collection,y,void 0)}),Gn=fh({selectionManager:()=>J.selectionManager(),keyboardDelegate:Gt,disallowTypeAhead:!0,disallowEmptySelection:!0,shouldFocusWrap:()=>o.shouldFocusWrap,isVirtualized:!0},d),hg=U=>{U&&o.triggerMode==="focus"&&ie(!1,"focus"),D(U),J.selectionManager().setFocused(U)},gg=L(()=>{var G,we;const U=J.selectionManager().focusedKey();if(U)return(we=(G=y())==null?void 0:G.querySelector(`[data-key="${U}"]`))==null?void 0:we.id}),Zl=U=>{if(o.selectionMode==="single"){const G=[...U][0],we=P().find(De=>M(De)===G);if(o.noResetInputOnBlur&&!we)return;I(we?x(we):"")}else{if(o.noResetInputOnBlur)return;I("")}},pg=U=>{var G;return(G=o.itemComponent)==null?void 0:G.call(o,{item:U})},mg=U=>{var G;return(G=o.sectionComponent)==null?void 0:G.call(o,{section:U})};j(Ee([K,V],(U,G)=>{if(B.isOpen()&&G!=null){const we=G[0],De=G[1];N(De?o.options:we)}else{const we=U[0],De=U[1];N(De?o.options:we)}})),j(Ee(ne,()=>{V()&&$(!1)})),j(Ee(()=>J.selectionManager().selectedKeys(),Zl));let eu="";j(()=>{var we;const U=J.selectionManager().focusedKey()??"",G=J.collection().getItem(U);if(ti()&&G!=null&&U!==eu){const De=J.selectionManager().isSelected(U),qt=((we=o.translations)==null?void 0:we.focusAnnouncement((G==null?void 0:G.textValue)||"",De))??"";Qi(qt)}U&&(eu=U)});let tu=ba(J.collection()),nu=B.isOpen();j(()=>{var De;const U=ba(J.collection()),G=B.isOpen(),we=G!==nu&&(J.selectionManager().focusedKey()==null||ti());if(G&&(we||U!==tu)){const qt=((De=o.translations)==null?void 0:De.countAnnouncement(U))??"";Qi(qt)}tu=U,nu=G});let ru="";j(()=>{var we;const U=[...J.selectionManager().selectedKeys()].pop()??"",G=J.collection().getItem(U);if(ti()&&R()&&G&&U!==ru){const De=((we=o.translations)==null?void 0:we.selectedAnnouncement((G==null?void 0:G.textValue)||""))??"";Qi(De)}U&&(ru=U)});const ou=L(()=>({"data-expanded":B.isOpen()?"":void 0,"data-closed":B.isOpen()?void 0:""})),iu={dataset:ou,isOpen:B.isOpen,isDisabled:()=>st.isDisabled()??!1,isMultiple:()=>T(o.selectionMode)==="multiple",isVirtualized:()=>o.virtualized??!1,isModal:()=>o.modal??!1,preventScroll:()=>o.preventScroll??iu.isModal(),allowsEmptyCollection:()=>o.allowsEmptyCollection??!1,shouldFocusWrap:()=>o.shouldFocusWrap??!1,removeOnBackspace:()=>o.removeOnBackspace??!0,selectedOptions:fe,isInputFocused:R,contentPresent:Je,autoFocus:S,inputValue:ne,triggerMode:()=>o.triggerMode,activeDescendant:gg,controlRef:u,inputRef:d,triggerRef:p,contentRef:v,listState:()=>J,keyboardDelegate:Gt,listboxId:l,triggerAriaLabel:()=>{var U;return(U=o.translations)==null?void 0:U.triggerLabel},listboxAriaLabel:()=>{var U;return(U=o.translations)==null?void 0:U.listboxLabel},setIsInputFocused:hg,resetInputValue:Zl,setInputValue:I,setControlRef:f,setInputRef:h,setTriggerRef:g,setContentRef:m,setListboxRef:b,open:ie,close:Pe,toggle:Te,placeholder:()=>o.placeholder,renderItem:pg,renderSection:mg,removeOptionFromSelection:Le,onInputKeyDown:U=>Gn.onKeyDown(U),generateId:Ye(()=>T(s.id)),registerListboxId:_e(c)};return w(Li.Provider,{value:st,get children(){return w(dg.Provider,{value:iu,get children(){return w(Cn,F({anchorRef:u,contentRef:v},i,{get children(){return w(le,F({as:"div",role:"group",get id(){return T(s.id)}},()=>st.dataset(),ou,a))}}))}})}})}var dC={};dt(dC,{Arrow:()=>Dr,Combobox:()=>fC,Content:()=>Hl,Control:()=>Ql,Description:()=>Oo,ErrorMessage:()=>Fo,HiddenSelect:()=>fg,Icon:()=>Xl,Input:()=>Gl,Item:()=>$o,ItemDescription:()=>_i,ItemIndicator:()=>Ao,ItemLabel:()=>To,Label:()=>kr,Listbox:()=>ql,Portal:()=>Wl,Root:()=>Yl,Section:()=>ki,Trigger:()=>Jl,useComboboxContext:()=>Ht});function Yl(e){const[t,n]=_(e,["value","defaultValue","onChange","multiple"]),r=L(()=>t.value!=null?t.multiple?t.value:[t.value]:t.value),o=L(()=>t.defaultValue!=null?t.multiple?t.defaultValue:[t.defaultValue]:t.defaultValue);return w(cC,F({get value(){return r()},get defaultValue(){return o()},onChange:s=>{var a,l;t.multiple?(a=t.onChange)==null||a.call(t,s??[]):(l=t.onChange)==null||l.call(t,s[0]??null)},get selectionMode(){return t.multiple?"multiple":"single"}},n))}function Jl(e){const t=it(),n=Ht(),r=Z({id:n.generateId("trigger")},e),[o,i]=_(r,["ref","disabled","onPointerDown","onClick","aria-labelledby"]),s=()=>o.disabled||n.isDisabled()||t.isDisabled()||t.isReadOnly(),a=u=>{ee(u,o.onPointerDown),u.currentTarget.dataset.pointerType=u.pointerType,!s()&&u.pointerType!=="touch"&&u.button===0&&(u.preventDefault(),n.toggle(!1,"manual"))},l=u=>{var f;ee(u,o.onClick),s()||(u.currentTarget.dataset.pointerType==="touch"&&n.toggle(!1,"manual"),(f=n.inputRef())==null||f.focus())},c=()=>t.getAriaLabelledBy(i.id,n.triggerAriaLabel(),o["aria-labelledby"]);return w(xt,F({ref(u){var f=me(n.setTriggerRef,o.ref);typeof f=="function"&&f(u)},get disabled(){return s()},tabIndex:-1,"aria-haspopup":"listbox",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return L(()=>!!n.isOpen())()?n.listboxId():void 0},get"aria-label"(){return n.triggerAriaLabel()},get"aria-labelledby"(){return c()},onPointerDown:a,onClick:l},()=>n.dataset(),i))}var fC=Object.assign(Yl,{Arrow:Dr,Content:Hl,Control:Ql,Description:Oo,ErrorMessage:Fo,HiddenSelect:fg,Icon:Xl,Input:Gl,Item:$o,ItemDescription:_i,ItemIndicator:Ao,ItemLabel:To,Label:kr,Listbox:ql,Portal:Wl,Section:ki,Trigger:Jl}),hC=te('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round class=size-4><path d="M5 12l5 5l10 -10">'),gC=te('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round class=size-4><path d="M8 9l4 -4l4 4"></path><path d="M16 15l-4 4l-4 -4">');const pC=Yl,mC=To,vC=e=>{const[t,n]=_(e,["class"]);return w($o,F({get class(){return ce("relative flex cursor-default select-none items-center justify-between rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled]:pointer-events-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:opacity-50",t.class)}},n))},yC=e=>{const[t,n]=_(e,["children"]);return w(Ao,F(n,{get children(){return w(de,{get when(){return t.children},get fallback(){return hC()},children:r=>r()})}}))},wC=e=>{const[t,n]=_(e,["class"]);return w(Ql,F({get class(){return ce("flex h-10 items-center rounded-md border px-3",t.class)}},n))},bC=e=>{const[t,n]=_(e,["class"]);return w(Gl,F({get class(){return ce("flex size-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",t.class)}},n))},SC=e=>{const[t,n]=_(e,["class","children"]);return w(Jl,F({get class(){return ce("size-4 opacity-50",t.class)}},n,{get children(){return w(Xl,{get children(){return w(de,{get when(){return t.children},get fallback(){return gC()},children:r=>r()})}})}}))},xC=e=>{const[t,n]=_(e,["class"]);return w(Wl,{get children(){return w(Hl,F({get class(){return ce("z-50 min-w-32 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md animate-in fade-in-80",t.class)}},n,{get children(){return w(ql,{class:"m-0 p-1"})}}))}})};var CC=te('<div class="flex items-center justify-between"><div class=space-y-0.5><div class="text-sm text-muted-foreground">'),EC=te('<div class="mt-4 space-y-4">'),MC=te('<div class="h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent">'),IC=te('<div class="flex gap-2 justify-end mt-4">');const PC=({bundle:e})=>{const t=yo(),n=jh(),[,r]=Kd(),[o,i]=z(!1),[s,a]=z(e.channel),[l,c]=z(!1),[u,f]=z(!1),d=async()=>{i(!0);try{if(u()){const h={...e,id:Eb(e.id),channel:s()},p=await wn.bundles.$post({json:h});if(p.status!==200){const g=await p.json();"error"in g&&Yt({title:"Error",description:g.error,variant:"error"});return}Yt({title:"Success",description:`Created new bundle ${h.id} in ${s()}`,variant:"success"}),r({bundleId:void 0,channel:s()})}else{const h=await wn.bundles[":bundleId"].$patch({param:{bundleId:e.id},json:{channel:s()}});if(h.status!==200){const p=await h.json();Yt({title:"Error",description:p.error,variant:"error"});return}Yt({title:"Success",description:`Moved bundle ${e.id} to ${s()}`,variant:"success"}),r({bundleId:e.id,channel:s()})}t.invalidateQueries({queryKey:["bundle",e.id]}),t.invalidateQueries({queryKey:["bundles"]}),t.invalidateQueries({queryKey:["channels"]}),setTimeout(()=>c(!1),100)}catch(h){h instanceof Error&&Yt({title:"Error",description:h.message,variant:"error"})}finally{i(!1)}};return w(Uh,{get open(){return l()},onOpenChange:c,get children(){return[w(Hh,{as:fn,variant:"outline",size:"sm",class:"gap-2 flex-1",get children(){return[w(tc,{class:"h-4 w-4"}),"Promote Channel"]}}),w(Cl,{}),w(Gh,{get children(){return[w(qh,{children:"Promote Channel"}),w(Wh,{children:"Select or enter a new channel for this bundle. Choose whether to copy the bundle (keeps it in the original channel) or move it (removes from the original channel)."}),(()=>{var h=EC();return W(h,w(ma,{get checked(){return u()},onChange:f,get children(){var p=CC(),g=p.firstChild,v=g.firstChild;return W(g,w(wa,{class:"text-base",get children(){return u()?"Copy bundle":"Move bundle"}}),v),W(v,()=>u()?"Keep original + create copy in target channel":"Move to target channel (removes from current)"),W(p,w(va,{get children(){return w(ya,{})}}),null),p}}),null),W(h,w(de,{get when(){return u()},get children(){return w(tC,{variant:"default",get children(){return w(nC,{class:"mt-0 text-sm",children:"The copied bundle will have a new database ID that differs from the bundle ID inside the JavaScript bundle."})}})}}),null),W(h,w(ii,{class:"grid w-full items-center gap-1.5",get children(){return[w(si,{for:"channel",children:"Channel"}),w(pC,{get defaultValue(){return s()},get options(){return n.data??[]},onChange:p=>p&&a(p),onInputChange:p=>{a(p)},placeholder:"Enter or select a channel...",itemComponent:p=>w(vC,{get item(){return p.item},get children(){return[w(mC,{get children(){return p.item.rawValue}}),w(yC,{})]}}),get children(){return[w(wC,{"aria-label":"Channel",get children(){return[w(bC,{}),w(SC,{})]}}),w(xC,{})]}})]}}),null),h})(),(()=>{var h=IC();return W(h,w(Sn,{as:fn,variant:"outline",size:"sm",children:"Cancel"}),null),W(h,w(fn,{variant:"default",size:"sm",onClick:d,get disabled(){return o()||!s()},class:"gap-2",get children(){return[w(de,{get when(){return o()},get fallback(){return w(tc,{class:"h-4 w-4"})},get children(){return MC()}}),L(()=>L(()=>!!o())()?u()?"Copying...":"Moving...":u()?"Copy":"Move")]}}),null),h})()]}})]}})};var RC=te('<div class="mt-auto gap-3 pt-4 flex justify-between">');const OC=({bundleId:e,onClose:t})=>{const n=jS(e);return w(Ky,{class:"flex flex-col h-full",get children(){return[w(zy,{class:"mb-4",get children(){return w(By,{get children(){return["Edit ",e]}})}}),w(de,{get when(){return n.data},get fallback(){return L(()=>!!n.isFetched)()?w(jy,{get children(){return["No update bundle found for bundle id ",e]}}):w(JS,{height:374,radius:10})},children:r=>w(Zx,{get bundle(){return r()},onEditSuccess:t})}),(()=>{var r=RC();return W(r,w(de,{get when(){return n.data},children:o=>w(PC,{get bundle(){return o()}})}),null),W(r,w(sx,{bundleId:e,onDeleteSuccess:t}),null),r})()]}})};function FC(){const{bundleIdFilter:e,setBundleIdFilter:t}=Lf(),n=L(()=>e()!==null),r=()=>{t(null)};return w(Ly,{get open(){return n()},onOpenChange:o=>{o||t(null)},get children(){return[w(QS,{columns:Rb,onRowClick:o=>{t(o.id)}}),w(de,{get when(){return e()},get children(){return w(Lg,{get children(){return w(OC,{get bundleId(){return e()},onClose:r})}})}})]}})}const $C=new vm;function AC(){return w(dm,{client:$C,get children(){return[w(kp,{root:e=>w(ip,{get children(){return[w(lp,{children:"HotUpdater Console"}),w(bm,{get children(){return e.children}})]}}),get children(){return w(Fp,{path:"/",component:FC})}}),w(fy,{})]}})}const od=document.getElementById("root");od&&Gg(()=>w(AC,{}),od);