@hot-updater/console 0.12.6 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,585 +0,0 @@
1
- var Td=Object.defineProperty;var ia=e=>{throw TypeError(e)};var Dd=(e,t,n)=>t in e?Td(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var le=(e,t,n)=>Dd(e,typeof t!="symbol"?t+"":t,n),So=(e,t,n)=>t.has(e)||ia("Cannot "+n);var x=(e,t,n)=>(So(e,t,"read from private field"),n?n.call(e):t.get(e)),Y=(e,t,n)=>t.has(e)?ia("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),U=(e,t,n,r)=>(So(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),ie=(e,t,n)=>(So(e,t,"access private method"),n);var Fr=(e,t,n,r)=>({set _(o){U(e,t,o,n)},get _(){return x(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 s of o)if(s.type==="childList")for(const i of s.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();const J={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return aa(this.context.count)},getNextContextId(){return aa(this.context.count++)}};function aa(e){const t=String(e),n=t.length-1;return J.context.id+(n?String.fromCharCode(96+n):"")+t}function nr(e){J.context=e}const Ld=(e,t)=>e===t,nt=Symbol("solid-proxy"),ru=typeof Proxy=="function",is=Symbol("solid-track"),Hr={equals:Ld};let ou=lu;const rt=1,ur=2,su={owned:null,cleanups:null,context:null,owner:null},xo={};var oe=null;let G=null,_d=null,de=null,Le=null,Te=null,to=0;function an(e,t){const n=de,r=oe,o=e.length===0,s=t===void 0?r:t,i=o?su:{owned:null,cleanups:null,context:s?s.context:null,owner:s},a=o?e:()=>e(()=>Fe(()=>zt(i)));oe=i,de=null;try{return Ge(a,!0)}finally{de=n,oe=r}}function z(e,t){t=t?Object.assign({},Hr,t):Hr;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(G&&G.running&&G.sources.has(n)?o=o(n.tValue):o=o(n.value)),au(n,o));return[iu.bind(n),r]}function Rt(e,t,n){const r=oo(e,t,!0,rt);zn(r)}function Ke(e,t,n){const r=oo(e,t,!1,rt);zn(r)}function q(e,t,n){ou=Bd;const r=oo(e,t,!1,rt),o=ln&&we(ln);o&&(r.suspense=o),(!n||!n.render)&&(r.user=!0),Te?Te.push(r):zn(r)}function N(e,t,n){n=n?Object.assign({},Hr,n):Hr;const r=oo(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,zn(r),iu.bind(r)}function kd(e){return e&&typeof e=="object"&&"then"in e}function Vd(e,t,n){let r,o,s;arguments.length===2&&typeof t=="object"||arguments.length===1?(r=!0,o=e,s=t):(r=e,o=t,s={});let i=null,a=xo,l=null,u=!1,c=!1,d="initialValue"in s,f=typeof r=="function"&&N(r);const h=new Set,[g,p]=(s.storage||z)(s.initialValue),[m,w]=z(void 0),[y,v]=z(void 0,{equals:!1}),[b,C]=z(d?"ready":"unresolved");J.context&&(l=J.getNextContextId(),s.ssrLoadFrom==="initial"?a=s.initialValue:J.load&&J.has(l)&&(a=J.load(l)));function O(k,V,j,re){return i===k&&(i=null,re!==void 0&&(d=!0),(k===a||V===a)&&s.onHydrated&&queueMicrotask(()=>s.onHydrated(re,{value:V})),a=xo,G&&k&&u?(G.promises.delete(k),u=!1,Ge(()=>{G.running=!0,D(V,j)},!1)):D(V,j)),V}function D(k,V){Ge(()=>{V===void 0&&p(()=>k),C(V!==void 0?"errored":d?"ready":"unresolved"),w(V);for(const j of h.keys())j.decrement();h.clear()},!1)}function _(){const k=ln&&we(ln),V=g(),j=m();if(j!==void 0&&!i)throw j;return de&&!de.user&&k&&Rt(()=>{y(),i&&(k.resolved&&G&&u?G.promises.add(i):h.has(k)||(k.increment(),h.add(k)))}),V}function T(k=!0){if(k!==!1&&c)return;c=!1;const V=f?f():r;if(u=G&&G.running,V==null||V===!1){O(i,Fe(g));return}G&&i&&G.promises.delete(i);const j=a!==xo?a:Fe(()=>o(V,{value:g(),refetching:k}));return kd(j)?(i=j,"value"in j?(j.status==="success"?O(i,j.value,void 0,V):O(i,void 0,ls(j.value),V),j):(c=!0,queueMicrotask(()=>c=!1),Ge(()=>{C(d?"refreshing":"pending"),v()},!1),j.then(re=>O(j,re,void 0,V),re=>O(j,void 0,ls(re),V)))):(O(i,j,void 0,V),j)}return Object.defineProperties(_,{state:{get:()=>b()},error:{get:()=>m()},loading:{get(){const k=b();return k==="pending"||k==="refreshing"}},latest:{get(){if(!d)return _();const k=m();if(k&&!i)throw k;return g()}}}),f?Rt(()=>T(!1)):T(!1),[_,{refetch:T,mutate:p}]}function no(e){return Ge(e,!1)}function Fe(e){if(de===null)return e();const t=de;de=null;try{return e()}finally{de=t}}function Me(e,t,n){const r=Array.isArray(e);let o,s=n&&n.defer;return i=>{let a;if(r){a=Array(e.length);for(let u=0;u<e.length;u++)a[u]=e[u]()}else a=e();if(s)return s=!1,i;const l=Fe(()=>t(a,o,i));return o=a,l}}function Cr(e){q(()=>Fe(e))}function W(e){return oe===null||(oe.cleanups===null?oe.cleanups=[e]:oe.cleanups.push(e)),e}function as(){return de}function cr(){return oe}function Xs(e,t){const n=oe,r=de;oe=e,de=null;try{return Ge(t,!0)}catch(o){Qs(o)}finally{oe=n,de=r}}function Nd(e){if(G&&G.running)return e(),G.done;const t=de,n=oe;return Promise.resolve().then(()=>{de=t,oe=n;let r;return ln&&(r=G||(G={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),Ge(e,!1),de=oe=null,r?r.done:void 0})}const[Rb,la]=z(!1);function Kd(e){Te.push.apply(Te,e),e.length=0}function Se(e,t){const n=Symbol("context");return{id:n,Provider:Gd(n),defaultValue:e}}function we(e){let t;return oe&&oe.context&&(t=oe.context[e.id])!==void 0?t:e.defaultValue}function ro(e){const t=N(e),n=N(()=>us(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}let ln;function jd(){return ln||(ln=Se())}function iu(){const e=G&&G.running;if(this.sources&&(e?this.tState:this.state))if((e?this.tState:this.state)===rt)zn(this);else{const t=Le;Le=null,Ge(()=>qr(this),!1),Le=t}if(de){const t=this.observers?this.observers.length:0;de.sources?(de.sources.push(this),de.sourceSlots.push(t)):(de.sources=[this],de.sourceSlots=[t]),this.observers?(this.observers.push(de),this.observerSlots.push(de.sources.length-1)):(this.observers=[de],this.observerSlots=[de.sources.length-1])}return e&&G.sources.has(this)?this.tValue:this.value}function au(e,t,n){let r=G&&G.running&&G.sources.has(e)?e.tValue:e.value;if(!e.comparator||!e.comparator(r,t)){if(G){const o=G.running;(o||!n&&G.sources.has(e))&&(G.sources.add(e),e.tValue=t),o||(e.value=t)}else e.value=t;e.observers&&e.observers.length&&Ge(()=>{for(let o=0;o<e.observers.length;o+=1){const s=e.observers[o],i=G&&G.running;i&&G.disposed.has(s)||((i?!s.tState:!s.state)&&(s.pure?Le.push(s):Te.push(s),s.observers&&uu(s)),i?s.tState=rt:s.state=rt)}if(Le.length>1e6)throw Le=[],new Error},!1)}return t}function zn(e){if(!e.fn)return;zt(e);const t=to;ua(e,G&&G.running&&G.sources.has(e)?e.tValue:e.value,t),G&&!G.running&&G.sources.has(e)&&queueMicrotask(()=>{Ge(()=>{G&&(G.running=!0),de=oe=e,ua(e,e.tValue,t),de=oe=null},!1)})}function ua(e,t,n){let r;const o=oe,s=de;de=oe=e;try{r=e.fn(t)}catch(i){return e.pure&&(G&&G.running?(e.tState=rt,e.tOwned&&e.tOwned.forEach(zt),e.tOwned=void 0):(e.state=rt,e.owned&&e.owned.forEach(zt),e.owned=null)),e.updatedAt=n+1,Qs(i)}finally{de=s,oe=o}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?au(e,r,!0):G&&G.running&&e.pure?(G.sources.add(e),e.tValue=r):e.value=r,e.updatedAt=n)}function oo(e,t,n,r=rt,o){const s={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:oe,context:oe?oe.context:null,pure:n};return G&&G.running&&(s.state=0,s.tState=r),oe===null||oe!==su&&(G&&G.running&&oe.pure?oe.tOwned?oe.tOwned.push(s):oe.tOwned=[s]:oe.owned?oe.owned.push(s):oe.owned=[s]),s}function Ur(e){const t=G&&G.running;if((t?e.tState:e.state)===0)return;if((t?e.tState:e.state)===ur)return qr(e);if(e.suspense&&Fe(e.suspense.inFallback))return e.suspense.effects.push(e);const n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<to);){if(t&&G.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,s=n[r+1];for(;(o=o.owner)&&o!==s;)if(G.disposed.has(o))return}if((t?e.tState:e.state)===rt)zn(e);else if((t?e.tState:e.state)===ur){const o=Le;Le=null,Ge(()=>qr(e,n[0]),!1),Le=o}}}function Ge(e,t){if(Le)return e();let n=!1;t||(Le=[]),Te?n=!0:Te=[],to++;try{const r=e();return zd(n),r}catch(r){n||(Te=null),Le=null,Qs(r)}}function zd(e){if(Le&&(lu(Le),Le=null),e)return;let t;if(G){if(!G.promises.size&&!G.queue.size){const r=G.sources,o=G.disposed;Te.push.apply(Te,G.effects),t=G.resolve;for(const s of Te)"tState"in s&&(s.state=s.tState),delete s.tState;G=null,Ge(()=>{for(const s of o)zt(s);for(const s of r){if(s.value=s.tValue,s.owned)for(let i=0,a=s.owned.length;i<a;i++)zt(s.owned[i]);s.tOwned&&(s.owned=s.tOwned),delete s.tValue,delete s.tOwned,s.tState=0}la(!1)},!1)}else if(G.running){G.running=!1,G.effects.push.apply(G.effects,Te),Te=null,la(!0);return}}const n=Te;Te=null,n.length&&Ge(()=>ou(n),!1),t&&t()}function lu(e){for(let t=0;t<e.length;t++)Ur(e[t])}function Bd(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:Ur(r)}if(J.context){if(J.count){J.effects||(J.effects=[]),J.effects.push(...e.slice(0,n));return}nr()}for(J.effects&&(J.done||!J.count)&&(e=[...J.effects,...e],n+=J.effects.length,delete J.effects),t=0;t<n;t++)Ur(e[t])}function qr(e,t){const n=G&&G.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 s=n?o.tState:o.state;s===rt?o!==t&&(!o.updatedAt||o.updatedAt<to)&&Ur(o):s===ur&&qr(o,t)}}}function uu(e){const t=G&&G.running;for(let n=0;n<e.observers.length;n+=1){const r=e.observers[n];(t?!r.tState:!r.state)&&(t?r.tState=ur:r.state=ur,r.pure?Le.push(r):Te.push(r),r.observers&&uu(r))}}function zt(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 s=o.pop(),i=n.observerSlots.pop();r<o.length&&(s.sourceSlots[i]=r,o[r]=s,n.observerSlots[r]=i)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)zt(e.tOwned[t]);delete e.tOwned}if(G&&G.running&&e.pure)cu(e,!0);else if(e.owned){for(t=e.owned.length-1;t>=0;t--)zt(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}G&&G.running?e.tState=0:e.state=0}function cu(e,t){if(t||(e.tState=0,G.disposed.add(e)),e.owned)for(let n=0;n<e.owned.length;n++)cu(e.owned[n])}function ls(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function Qs(e,t=oe){throw ls(e)}function us(e){if(typeof e=="function"&&!e.length)return us(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=us(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function Gd(e,t){return function(r){let o;return Ke(()=>o=Fe(()=>(oe.context={...oe.context,[e]:r.value},ro(()=>r.children))),void 0),o}}const Hd=Symbol("fallback");function ca(e){for(let t=0;t<e.length;t++)e[t]()}function Ud(e,t,n={}){let r=[],o=[],s=[],i=0,a=t.length>1?[]:null;return W(()=>ca(s)),()=>{let l=e()||[],u=l.length,c,d;return l[is],Fe(()=>{let h,g,p,m,w,y,v,b,C;if(u===0)i!==0&&(ca(s),s=[],r=[],o=[],i=0,a&&(a=[])),n.fallback&&(r=[Hd],o[0]=an(O=>(s[0]=O,n.fallback())),i=1);else if(i===0){for(o=new Array(u),d=0;d<u;d++)r[d]=l[d],o[d]=an(f);i=u}else{for(p=new Array(u),m=new Array(u),a&&(w=new Array(u)),y=0,v=Math.min(i,u);y<v&&r[y]===l[y];y++);for(v=i-1,b=u-1;v>=y&&b>=y&&r[v]===l[b];v--,b--)p[b]=o[v],m[b]=s[v],a&&(w[b]=a[v]);for(h=new Map,g=new Array(b+1),d=b;d>=y;d--)C=l[d],c=h.get(C),g[d]=c===void 0?-1:c,h.set(C,d);for(c=y;c<=v;c++)C=r[c],d=h.get(C),d!==void 0&&d!==-1?(p[d]=o[c],m[d]=s[c],a&&(w[d]=a[c]),d=g[d],h.set(C,d)):s[c]();for(d=y;d<u;d++)d in p?(o[d]=p[d],s[d]=m[d],a&&(a[d]=w[d],a[d](d))):o[d]=an(f);o=o.slice(0,i=u),r=l.slice(0)}return o});function f(h){if(s[d]=h,a){const[g,p]=z(d);return a[d]=p,t(l[d],g)}return t(l[d])}}}function S(e,t){return Fe(()=>e(t||{}))}function $r(){return!0}const cs={get(e,t,n){return t===nt?n:e.get(t)},has(e,t){return t===nt?!0:e.has(t)},set:$r,deleteProperty:$r,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:$r,deleteProperty:$r}},ownKeys(e){return e.keys()}};function Co(e){return(e=typeof e=="function"?e():e)?e:{}}function qd(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function A(...e){let t=!1;for(let i=0;i<e.length;i++){const a=e[i];t=t||!!a&&nt in a,e[i]=typeof a=="function"?(t=!0,N(a)):a}if(ru&&t)return new Proxy({get(i){for(let a=e.length-1;a>=0;a--){const l=Co(e[a])[i];if(l!==void 0)return l}},has(i){for(let a=e.length-1;a>=0;a--)if(i in Co(e[a]))return!0;return!1},keys(){const i=[];for(let a=0;a<e.length;a++)i.push(...Object.keys(Co(e[a])));return[...new Set(i)]}},cs);const n={},r=Object.create(null);for(let i=e.length-1;i>=0;i--){const a=e[i];if(!a)continue;const l=Object.getOwnPropertyNames(a);for(let u=l.length-1;u>=0;u--){const c=l[u];if(c==="__proto__"||c==="constructor")continue;const d=Object.getOwnPropertyDescriptor(a,c);if(!r[c])r[c]=d.get?{enumerable:!0,configurable:!0,get:qd.bind(n[c]=[d.get.bind(a)])}:d.value!==void 0?d:void 0;else{const f=n[c];f&&(d.get?f.push(d.get.bind(a)):d.value!==void 0&&f.push(()=>d.value))}}}const o={},s=Object.keys(r);for(let i=s.length-1;i>=0;i--){const a=s[i],l=r[a];l&&l.get?Object.defineProperty(o,a,l):o[a]=l?l.value:void 0}return o}function K(e,...t){if(ru&&nt in e){const o=new Set(t.length>1?t.flat():t[0]),s=t.map(i=>new Proxy({get(a){return i.includes(a)?e[a]:void 0},has(a){return i.includes(a)&&a in e},keys(){return i.filter(a=>a in e)}},cs));return s.push(new Proxy({get(i){return o.has(i)?void 0:e[i]},has(i){return o.has(i)?!1:i in e},keys(){return Object.keys(e).filter(i=>!o.has(i))}},cs)),s}const n={},r=t.map(()=>({}));for(const o of Object.getOwnPropertyNames(e)){const s=Object.getOwnPropertyDescriptor(e,o),i=!s.get&&!s.set&&s.enumerable&&s.writable&&s.configurable;let a=!1,l=0;for(const u of t)u.includes(o)&&(a=!0,i?r[l][o]=s.value:Object.defineProperty(r[l],o,s)),++l;a||(i?n[o]=s.value:Object.defineProperty(n,o,s))}return[...r,n]}let Wd=0;function Re(){return J.context?J.getNextContextId():`cl-${Wd++}`}const Xd=e=>`Stale read from <${e}>.`;function Kt(e){const t="fallback"in e&&{fallback:()=>e.fallback};return N(Ud(()=>e.each,e.children,t||void 0))}function Ce(e){const t=e.keyed,n=N(()=>e.when,void 0,{equals:(r,o)=>t?r===o:!r==!o});return N(()=>{const r=n();if(r){const o=e.children;return typeof o=="function"&&o.length>0?Fe(()=>o(t?r:()=>{if(!Fe(n))throw Xd("Show");return e.when})):o}return e.fallback},void 0,void 0)}const Qd=Se();function du(e){let t=0,n,r,o,s,i;const[a,l]=z(!1),u=jd(),c={increment:()=>{++t===1&&l(!0)},decrement:()=>{--t===0&&l(!1)},inFallback:a,effects:[],resolved:!1},d=cr();if(J.context&&J.load){const g=J.getContextId();let p=J.load(g);if(p&&(typeof p!="object"||p.status!=="success"?o=p:J.gather(g)),o&&o!=="$$f"){const[m,w]=z(void 0,{equals:!1});s=m,o.then(()=>{if(J.done)return w();J.gather(g),nr(r),w(),nr()},y=>{i=y,w()})}}const f=we(Qd);f&&(n=f.register(c.inFallback));let h;return W(()=>h&&h()),S(u.Provider,{value:c,get children(){return N(()=>{if(i)throw i;if(r=J.context,s)return s(),s=void 0;r&&o==="$$f"&&nr();const g=N(()=>e.children);return N(p=>{const m=c.inFallback(),{showContent:w=!0,showFallback:y=!0}=n?n():{};if((!m||o&&o!=="$$f")&&w)return c.resolved=!0,h&&h(),h=r=o=void 0,Kd(c.effects),g();if(y)return h?p:an(v=>(h=v,r&&(nr({id:r.id+"F",count:0}),r=void 0),e.fallback),d)})})}})}const Yd=["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"],Zd=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...Yd]),Jd=new Set(["innerHTML","textContent","innerText","children"]),ef=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),tf=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 nf(e,t){const n=tf[e];return typeof n=="object"?n[t]?n.$:void 0:n}const rf=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),of=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"]),sf={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function af(e,t,n){let r=n.length,o=t.length,s=r,i=0,a=0,l=t[o-1].nextSibling,u=null;for(;i<o||a<s;){if(t[i]===n[a]){i++,a++;continue}for(;t[o-1]===n[s-1];)o--,s--;if(o===i){const c=s<r?a?n[a-1].nextSibling:n[s-a]:l;for(;a<s;)e.insertBefore(n[a++],c)}else if(s===a)for(;i<o;)(!u||!u.has(t[i]))&&t[i].remove(),i++;else if(t[i]===n[s-1]&&n[a]===t[o-1]){const c=t[--o].nextSibling;e.insertBefore(n[a++],t[i++].nextSibling),e.insertBefore(n[--s],c),t[o]=n[s]}else{if(!u){u=new Map;let d=a;for(;d<s;)u.set(n[d],d++)}const c=u.get(t[i]);if(c!=null)if(a<c&&c<s){let d=i,f=1,h;for(;++d<o&&d<s&&!((h=u.get(t[d]))==null||h!==c+f);)f++;if(f>c-a){const g=t[i];for(;a<c;)e.insertBefore(n[a++],g)}else e.replaceChild(n[a++],t[i++])}else i++;else t[i++].remove()}}}const da="_$DX_DELEGATE";function lf(e,t,n,r={}){let o;return an(s=>{o=s,t===document?e():fe(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{o(),t.textContent=""}}function he(e,t,n){let r;const o=()=>{const i=document.createElement("template");return i.innerHTML=e,i.content.firstChild},s=()=>(r||(r=o())).cloneNode(!0);return s.cloneNode=s,s}function Ys(e,t=window.document){const n=t[da]||(t[da]=new Set);for(let r=0,o=e.length;r<o;r++){const s=e[r];n.has(s)||(n.add(s),t.addEventListener(s,vf))}}function un(e,t,n){hn(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function uf(e,t,n,r){hn(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function cf(e,t,n){hn(e)||(n?e.setAttribute(t,""):e.removeAttribute(t))}function fu(e,t){hn(e)||(t==null?e.removeAttribute("class"):e.className=t)}function df(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]=s=>o.call(e,n[1],s))}else e.addEventListener(t,n,typeof n!="function"&&n)}function ff(e,t,n={}){const r=Object.keys(t||{}),o=Object.keys(n);let s,i;for(s=0,i=o.length;s<i;s++){const a=o[s];!a||a==="undefined"||t[a]||(fa(e,a,!1),delete n[a])}for(s=0,i=r.length;s<i;s++){const a=r[s],l=!!t[a];!a||a==="undefined"||n[a]===l||!l||(fa(e,a,!0),n[a]=l)}return n}function hf(e,t,n){if(!t)return n?un(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,s;for(s in n)t[s]==null&&r.removeProperty(s),delete n[s];for(s in t)o=t[s],o!==n[s]&&(r.setProperty(s,o),n[s]=o);return n}function ot(e,t={},n,r){const o={};return r||Ke(()=>o.children=dr(e,t.children,o.children)),Ke(()=>typeof t.ref=="function"&&gf(t.ref,e)),Ke(()=>pf(e,t,n,!0,o,!0)),o}function gf(e,t,n){return Fe(()=>e(t,n))}function fe(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return dr(e,t,r,n);Ke(o=>dr(e,t(),o,n),r)}function pf(e,t,n,r,o={},s=!1){t||(t={});for(const i in o)if(!(i in t)){if(i==="children")continue;o[i]=ha(e,i,null,o[i],n,s,t)}for(const i in t){if(i==="children")continue;const a=t[i];o[i]=ha(e,i,a,o[i],n,s,t)}}function mf(e){let t,n;return!hn()||!(t=J.registry.get(n=wf()))?e():(J.completed&&J.completed.add(t),J.registry.delete(n),t)}function hn(e){return!!J.context&&!J.done&&(!e||e.isConnected)}function yf(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function fa(e,t,n){const r=t.trim().split(/\s+/);for(let o=0,s=r.length;o<s;o++)e.classList.toggle(r[o],n)}function ha(e,t,n,r,o,s,i){let a,l,u,c,d;if(t==="style")return hf(e,n,r);if(t==="classList")return ff(e,n,r);if(n===r)return r;if(t==="ref")s||n(e);else if(t.slice(0,3)==="on:"){const f=t.slice(3);r&&e.removeEventListener(f,r,typeof r!="function"&&r),n&&e.addEventListener(f,n,typeof n!="function"&&n)}else if(t.slice(0,10)==="oncapture:"){const f=t.slice(10);r&&e.removeEventListener(f,r,!0),n&&e.addEventListener(f,n,!0)}else if(t.slice(0,2)==="on"){const f=t.slice(2).toLowerCase(),h=rf.has(f);if(!h&&r){const g=Array.isArray(r)?r[0]:r;e.removeEventListener(f,g)}(h||n)&&(df(e,f,n,h),h&&Ys([f]))}else if(t.slice(0,5)==="attr:")un(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")cf(e,t.slice(5),n);else if((d=t.slice(0,5)==="prop:")||(u=Jd.has(t))||!o&&((c=nf(t,e.tagName))||(l=Zd.has(t)))||(a=e.nodeName.includes("-")||"is"in i)){if(d)t=t.slice(5),l=!0;else if(hn(e))return n;t==="class"||t==="className"?fu(e,n):a&&!l&&!u?e[yf(t)]=n:e[c||t]=n}else{const f=o&&t.indexOf(":")>-1&&sf[t.split(":")[0]];f?uf(e,f,t,n):un(e,ef[t]||t,n)}return n}function vf(e){if(J.registry&&J.events&&J.events.find(([l,u])=>u===e))return;let t=e.target;const n=`$$${e.type}`,r=e.target,o=e.currentTarget,s=l=>Object.defineProperty(e,"target",{configurable:!0,value:l}),i=()=>{const l=t[n];if(l&&!t.disabled){const u=t[`${n}Data`];if(u!==void 0?l.call(t,u,e):l.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&s(t.host),!0},a=()=>{for(;i()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),J.registry&&!J.done&&(J.done=_$HY.done=!0),e.composedPath){const l=e.composedPath();s(l[0]);for(let u=0;u<l.length-2&&(t=l[u],!!i());u++){if(t._$host){t=t._$host,a();break}if(t.parentNode===o)break}}else a();s(r)}function dr(e,t,n,r,o){const s=hn(e);if(s){!n&&(n=[...e.childNodes]);let l=[];for(let u=0;u<n.length;u++){const c=n[u];c.nodeType===8&&c.data.slice(0,2)==="!$"?c.remove():l.push(c)}n=l}for(;typeof n=="function";)n=n();if(t===n)return n;const i=typeof t,a=r!==void 0;if(e=a&&n[0]&&n[0].parentNode||e,i==="string"||i==="number"){if(s||i==="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=vn(e,n,r,l)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||i==="boolean"){if(s)return n;n=vn(e,n,r)}else{if(i==="function")return Ke(()=>{let l=t();for(;typeof l=="function";)l=l();n=dr(e,l,n,r)}),()=>n;if(Array.isArray(t)){const l=[],u=n&&Array.isArray(n);if(ds(l,t,n,o))return Ke(()=>n=dr(e,l,n,r,!0)),()=>n;if(s){if(!l.length)return n;if(r===void 0)return n=[...e.childNodes];let c=l[0];if(c.parentNode!==e)return n;const d=[c];for(;(c=c.nextSibling)!==r;)d.push(c);return n=d}if(l.length===0){if(n=vn(e,n,r),a)return n}else u?n.length===0?ga(e,l,r):af(e,n,l):(n&&vn(e),ga(e,l));n=l}else if(t.nodeType){if(s&&t.parentNode)return n=a?[t]:t;if(Array.isArray(n)){if(a)return n=vn(e,n,r,t);vn(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function ds(e,t,n,r){let o=!1;for(let s=0,i=t.length;s<i;s++){let a=t[s],l=n&&n[e.length],u;if(!(a==null||a===!0||a===!1))if((u=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))o=ds(e,a,l)||o;else if(u==="function")if(r){for(;typeof a=="function";)a=a();o=ds(e,Array.isArray(a)?a:[a],Array.isArray(l)?l:[l])||o}else e.push(a),o=!0;else{const c=String(a);l&&l.nodeType===3&&l.data===c?e.push(l):e.push(document.createTextNode(c))}}return o}function ga(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function vn(e,t,n,r){if(n===void 0)return e.textContent="";const o=r||document.createTextNode("");if(t.length){let s=!1;for(let i=t.length-1;i>=0;i--){const a=t[i];if(o!==a){const l=a.parentNode===e;!s&&!i?l?e.replaceChild(o,a):e.insertBefore(o,n):l&&a.remove()}else s=!0}}else e.insertBefore(o,n);return[o]}function wf(){return J.getNextContextId()}const bf=!1,Sf="http://www.w3.org/2000/svg";function hu(e,t=!1){return t?document.createElementNS(Sf,e):document.createElement(e)}function gu(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,o=cr();let s,i=!!J.context;return q(()=>{i&&(cr().user=i=!1),s||(s=Xs(o,()=>N(()=>e.children)));const a=r();if(a instanceof HTMLHeadElement){const[l,u]=z(!1),c=()=>u(!0);an(d=>fe(a,()=>l()?d():s(),null)),W(c)}else{const l=hu(e.isSVG?"g":"div",e.isSVG),u=t&&l.attachShadow?l.attachShadow({mode:"open"}):l;Object.defineProperty(l,"_$host",{get(){return n.parentNode},configurable:!0}),fe(u,s),a.appendChild(l),e.ref&&e.ref(l),W(()=>a.removeChild(l))}},void 0,{render:!i}),n}function pu(e){const[t,n]=K(e,["component"]),r=N(()=>t.component);return N(()=>{const o=r();switch(typeof o){case"function":return Fe(()=>o(n));case"string":const s=of.has(o),i=J.context?mf():hu(o,s);return ot(i,n,s),i}})}const mu=Se(),xf=["title","meta"],pa=[],ma=["name","http-equiv","content","charset","media"].concat(["property"]),ya=(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 Cf(){if(!J.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(xf.indexOf(n.tag)!==-1){const s=n.tag==="title"?pa:ma,i=ya(n,s);e.has(i)||e.set(i,[]);let a=e.get(i),l=a.length;a=[...a,n],e.set(i,a);let u=t(n);n.ref=u,ot(u,n.props);let c=null;for(var r=l-1;r>=0;r--)if(a[r]!=null){c=a[r];break}return u.parentNode!=document.head&&document.head.appendChild(u),c&&c.ref&&c.ref.parentNode&&document.head.removeChild(c.ref),l}let o=t(n);return n.ref=o,ot(o,n.props),o.parentNode!=document.head&&document.head.appendChild(o),-1},removeTag(n,r){const o=n.tag==="title"?pa:ma,s=ya(n,o);if(n.ref){const i=e.get(s);if(i){if(n.ref.parentNode){n.ref.parentNode.removeChild(n.ref);for(let a=r-1;a>=0;a--)i[a]!=null&&document.head.appendChild(i[a].ref)}i[r]=null,e.set(s,i)}else n.ref.parentNode&&n.ref.parentNode.removeChild(n.ref)}}}}const Ef=e=>{const t=Cf();return S(mu.Provider,{value:t,get children(){return e.children}})},Rf=(e,t,n)=>(Pf({tag:e,props:t,setting:n,id:Re(),get name(){return t.name||t.property}}),null);function Pf(e){const t=we(mu);if(!t)throw new Error("<MetaProvider /> should be in the tree");Ke(()=>{const n=t.addTag(e);W(()=>t.removeTag(e,n))})}const If=e=>Rf("title",e,{escape:!0,close:!0});function yu(){let e=new Set;function t(o){return e.add(o),()=>e.delete(o)}let n=!1;function r(o,s){if(n)return!(n=!1);const i={to:o,options:s,defaultPrevented:!1,preventDefault:()=>i.defaultPrevented=!0};for(const a of e)a.listener({...i,from:a.location,retry:l=>{l&&(n=!0),a.navigate(o,{...s,resolve:!1})}});return!i.defaultPrevented}return{subscribe:t,confirm:r}}let fs;function Zs(){(!window.history.state||window.history.state._depth==null)&&window.history.replaceState({...window.history.state,_depth:window.history.length-1},""),fs=window.history.state._depth}Zs();function Mf(e){return{...e,_depth:window.history.state&&window.history.state._depth}}function Ff(e,t){let n=!1;return()=>{const r=fs;Zs();const o=r==null?null:fs-r;if(n){n=!1;return}o&&t(o)?(n=!0,window.history.go(-o)):e()}}const $f=/^(?:[a-z0-9]+:)?\/\//i,Af=/^\/+|(\/)\/+$/g,vu="http://sr";function ar(e,t=!1){const n=e.replace(Af,"$1");return n?t||/^[?#]/.test(n)?n:"/"+n:""}function Br(e,t,n){if($f.test(t))return;const r=ar(e),o=n&&ar(n);let s="";return!o||t.startsWith("/")?s=r:o.toLowerCase().indexOf(r.toLowerCase())!==0?s=r+o:s=o,(s||"/")+ar(t,!s)}function Of(e,t){if(e==null)throw new Error(t);return e}function Tf(e,t){return ar(e).replace(/\/*(\*.*)?$/g,"")+ar(t)}function wu(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 Df(e,t,n){const[r,o]=e.split("/*",2),s=r.split("/").filter(Boolean),i=s.length;return a=>{const l=a.split("/").filter(Boolean),u=l.length-i;if(u<0||u>0&&o===void 0&&!t)return null;const c={path:i?"":"/",params:{}},d=f=>n===void 0?void 0:n[f];for(let f=0;f<i;f++){const h=s[f],g=h[0]===":",p=g?l[f]:l[f].toLowerCase(),m=g?h.slice(1):h.toLowerCase();if(g&&Eo(p,d(m)))c.params[m]=p;else if(g||!Eo(p,m))return null;c.path+=`/${p}`}if(o){const f=u?l.slice(-u).join("/"):"";if(Eo(f,d(o)))c.params[o]=f;else return null}return c}}function Eo(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 Lf(e){const[t,n]=e.pattern.split("/*",2),r=t.split("/").filter(Boolean);return r.reduce((o,s)=>o+(s.startsWith(":")?2:3),r.length-(n===void 0?0:1))}function bu(e){const t=new Map,n=cr();return new Proxy({},{get(r,o){return t.has(o)||Xs(n,()=>t.set(o,N(()=>e()[o]))),t.get(o)()},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}},ownKeys(){return Reflect.ownKeys(e())}})}function Su(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 Su(r).reduce((s,i)=>[...s,...o.map(a=>a+i)],[])}const _f=100,xu=Se(),Cu=Se(),Eu=()=>Of(we(xu),"<A> and 'use' router primitives can be only used inside a Route."),kf=()=>Eu().navigatorFactory(),Vf=()=>Eu().params;function Nf(e,t=""){const{component:n,preload:r,load:o,children:s,info:i}=e,a=!s||Array.isArray(s)&&!s.length,l={key:e,component:n,preload:r||o,info:i};return Ru(e.path).reduce((u,c)=>{for(const d of Su(c)){const f=Tf(t,d);let h=a?f:f.split("/*",1)[0];h=h.split("/").map(g=>g.startsWith(":")||g.startsWith("*")?g:encodeURIComponent(g)).join("/"),u.push({...l,originalPath:c,pattern:h,matcher:Df(h,!a,e.matchFilters)})}return u},[])}function Kf(e,t=0){return{routes:e,score:Lf(e[e.length-1])*1e4-t,matcher(n){const r=[];for(let o=e.length-1;o>=0;o--){const s=e[o],i=s.matcher(n);if(!i)return null;r.unshift({...i,route:s})}return r}}}function Ru(e){return Array.isArray(e)?e:[e]}function Pu(e,t="",n=[],r=[]){const o=Ru(e);for(let s=0,i=o.length;s<i;s++){const a=o[s];if(a&&typeof a=="object"){a.hasOwnProperty("path")||(a.path="");const l=Nf(a,t);for(const u of l){n.push(u);const c=Array.isArray(a.children)&&a.children.length===0;if(a.children&&!c)Pu(a.children,u.pattern,n,r);else{const d=Kf([...n],r.length);r.push(d)}n.pop()}}}return n.length?r:r.sort((s,i)=>i.score-s.score)}function Ro(e,t){for(let n=0,r=e.length;n<r;n++){const o=e[n].matcher(t);if(o)return o}return[]}function jf(e,t,n){const r=new URL(vu),o=N(c=>{const d=e();try{return new URL(d,r)}catch{return console.error(`Invalid path ${d}`),c}},r,{equals:(c,d)=>c.href===d.href}),s=N(()=>o().pathname),i=N(()=>o().search,!0),a=N(()=>o().hash),l=()=>"",u=Me(i,()=>wu(o()));return{get pathname(){return s()},get search(){return i()},get hash(){return a()},get state(){return t()},get key(){return l()},query:n?n(u):bu(u)}}let Yt;function zf(){return Yt}function Bf(e,t,n,r={}){const{signal:[o,s],utils:i={}}=e,a=i.parsePath||(P=>P),l=i.renderPath||(P=>P),u=i.beforeLeave||yu(),c=Br("",r.base||"");if(c===void 0)throw new Error(`${c} is not a valid base path`);c&&!o().value&&s({value:c,replace:!0,scroll:!1});const[d,f]=z(!1);let h;const g=(P,R)=>{R.value===p()&&R.state===w()||(h===void 0&&f(!0),Yt=P,h=R,Nd(()=>{h===R&&(m(h.value),y(h.state),C[1]([]))}).finally(()=>{h===R&&no(()=>{Yt=void 0,P==="navigate"&&j(h),f(!1),h=void 0})}))},[p,m]=z(o().value),[w,y]=z(o().state),v=jf(p,w,i.queryWrapper),b=[],C=z([]),O=N(()=>typeof r.transformUrl=="function"?Ro(t(),r.transformUrl(v.pathname)):Ro(t(),v.pathname)),D=()=>{const P=O(),R={};for(let E=0;E<P.length;E++)Object.assign(R,P[E].params);return R},_=i.paramsWrapper?i.paramsWrapper(D,t):bu(D),T={pattern:c,path:()=>c,outlet:()=>null,resolvePath(P){return Br(c,P)}};return Ke(Me(o,P=>g("native",P),{defer:!0})),{base:T,location:v,params:_,isRouting:d,renderPath:l,parsePath:a,navigatorFactory:V,matches:O,beforeLeave:u,preloadRoute:re,singleFlight:r.singleFlight===void 0?!0:r.singleFlight,submissions:C};function k(P,R,E){Fe(()=>{if(typeof R=="number"){R&&(i.go?i.go(R):console.warn("Router integration does not support relative routing"));return}const I=!R||R[0]==="?",{replace:M,resolve:F,scroll:L,state:B}={replace:!1,resolve:!I,scroll:!0,...E},H=F?P.resolvePath(R):Br(I&&v.pathname||"",R);if(H===void 0)throw new Error(`Path '${R}' is not a routable path`);if(b.length>=_f)throw new Error("Too many redirects");const Z=p();(H!==Z||B!==w())&&(bf||u.confirm(H,E)&&(b.push({value:Z,replace:M,scroll:L,state:w()}),g("navigate",{value:H,state:B})))})}function V(P){return P=P||we(Cu)||T,(R,E)=>k(P,R,E)}function j(P){const R=b[0];R&&(s({...P,replace:R.replace,scroll:R.scroll}),b.length=0)}function re(P,R){const E=Ro(t(),P.pathname),I=Yt;Yt="preload";for(let M in E){const{route:F,params:L}=E[M];F.component&&F.component.preload&&F.component.preload();const{preload:B}=F;R&&B&&Xs(n(),()=>B({params:L,location:{pathname:P.pathname,search:P.search,hash:P.hash,query:wu(P),state:null,key:""},intent:"preload"}))}Yt=I}}function Gf(e,t,n,r){const{base:o,location:s,params:i}=e,{pattern:a,component:l,preload:u}=r().route,c=N(()=>r().path);l&&l.preload&&l.preload();const d=u?u({params:i,location:s,intent:Yt||"initial"}):void 0;return{parent:t,pattern:a,path:c,outlet:()=>l?S(l,{params:i,location:s,data:d,get children(){return n()}}):n(),resolvePath(h){return Br(o.path(),h,c())}}}const Hf=e=>t=>{const{base:n}=t,r=ro(()=>t.children),o=N(()=>Pu(r(),t.base||""));let s;const i=Bf(e,o,()=>s,{base:n,singleFlight:t.singleFlight,transformUrl:t.transformUrl});return e.create&&e.create(i),S(xu.Provider,{value:i,get children(){return S(Uf,{routerState:i,get root(){return t.root},get preload(){return t.rootPreload||t.rootLoad},get children(){return[N(()=>(s=cr())&&null),S(qf,{routerState:i,get branches(){return o()}})]}})}})};function Uf(e){const t=e.routerState.location,n=e.routerState.params,r=N(()=>e.preload&&Fe(()=>{e.preload({params:n,location:t,intent:zf()||"initial"})}));return S(Ce,{get when(){return e.root},keyed:!0,get fallback(){return e.children},children:o=>S(o,{params:n,location:t,get data(){return r()},get children(){return e.children}})})}function qf(e){const t=[];let n;const r=N(Me(e.routerState.matches,(o,s,i)=>{let a=s&&o.length===s.length;const l=[];for(let u=0,c=o.length;u<c;u++){const d=s&&s[u],f=o[u];i&&d&&f.route.key===d.route.key?l[u]=i[u]:(a=!1,t[u]&&t[u](),an(h=>{t[u]=h,l[u]=Gf(e.routerState,l[u-1]||e.routerState.base,va(()=>r()[u+1]),()=>e.routerState.matches()[u])}))}return t.splice(o.length).forEach(u=>u()),i&&a?i:(n=l[0],l)}));return va(()=>r()&&n)()}const va=e=>()=>S(Ce,{get when(){return e()},keyed:!0,children:t=>S(Cu.Provider,{value:t,get children(){return t.outlet()}})}),wa=e=>{const t=ro(()=>e.children);return A(e,{get children(){return t()}})};function Wf([e,t],n,r){return[e,o=>t(r(o))]}function Xf(e){let t=!1;const n=o=>typeof o=="string"?{value:o}:o,r=Wf(z(n(e.get()),{equals:(o,s)=>o.value===s.value&&o.state===s.state}),void 0,o=>(!t&&e.set(o),J.registry&&!J.done&&(J.done=!0),o));return e.init&&W(e.init((o=e.get())=>{t=!0,r[1](n(o)),t=!1})),Hf({signal:r,create:e.create,utils:e.utils})}function Qf(e,t,n){return e.addEventListener(t,n),()=>e.removeEventListener(t,n)}function Yf(e,t){const n=e&&document.getElementById(e);n?n.scrollIntoView():t&&window.scrollTo(0,0)}const Zf=new Map;function Jf(e=!0,t=!1,n="/_server",r){return o=>{const s=o.base.path(),i=o.navigatorFactory(o.base);let a,l;function u(p){return p.namespaceURI==="http://www.w3.org/2000/svg"}function c(p){if(p.defaultPrevented||p.button!==0||p.metaKey||p.altKey||p.ctrlKey||p.shiftKey)return;const m=p.composedPath().find(O=>O instanceof Node&&O.nodeName.toUpperCase()==="A");if(!m||t&&!m.hasAttribute("link"))return;const w=u(m),y=w?m.href.baseVal:m.href;if((w?m.target.baseVal:m.target)||!y&&!m.hasAttribute("state"))return;const b=(m.getAttribute("rel")||"").split(/\s+/);if(m.hasAttribute("download")||b&&b.includes("external"))return;const C=w?new URL(y,document.baseURI):new URL(y);if(!(C.origin!==window.location.origin||s&&C.pathname&&!C.pathname.toLowerCase().startsWith(s.toLowerCase())))return[m,C]}function d(p){const m=c(p);if(!m)return;const[w,y]=m,v=o.parsePath(y.pathname+y.search+y.hash),b=w.getAttribute("state");p.preventDefault(),i(v,{resolve:!1,replace:w.hasAttribute("replace"),scroll:!w.hasAttribute("noscroll"),state:b?JSON.parse(b):void 0})}function f(p){const m=c(p);if(!m)return;const[w,y]=m;r&&(y.pathname=r(y.pathname)),o.preloadRoute(y,w.getAttribute("preload")!=="false")}function h(p){clearTimeout(a);const m=c(p);if(!m)return l=null;const[w,y]=m;l!==w&&(r&&(y.pathname=r(y.pathname)),a=setTimeout(()=>{o.preloadRoute(y,w.getAttribute("preload")!=="false"),l=w},20))}function g(p){if(p.defaultPrevented)return;let m=p.submitter&&p.submitter.hasAttribute("formaction")?p.submitter.getAttribute("formaction"):p.target.getAttribute("action");if(!m)return;if(!m.startsWith("https://action/")){const y=new URL(m,vu);if(m=o.parsePath(y.pathname+y.search),!m.startsWith(n))return}if(p.target.method.toUpperCase()!=="POST")throw new Error("Only POST forms are supported for Actions");const w=Zf.get(m);if(w){p.preventDefault();const y=new FormData(p.target,p.submitter);w.call({r:o,f:p.target},p.target.enctype==="multipart/form-data"?y:new URLSearchParams(y))}}Ys(["click","submit"]),document.addEventListener("click",d),e&&(document.addEventListener("mousemove",h,{passive:!0}),document.addEventListener("focusin",f,{passive:!0}),document.addEventListener("touchstart",f,{passive:!0})),document.addEventListener("submit",g),W(()=>{document.removeEventListener("click",d),e&&(document.removeEventListener("mousemove",h),document.removeEventListener("focusin",f),document.removeEventListener("touchstart",f)),document.removeEventListener("submit",g)})}}function eh(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=yu();return Xf({get:t,set({value:r,replace:o,scroll:s,state:i}){o?window.history.replaceState(Mf(i),"",r):window.history.pushState(i,"",r),Yf(decodeURIComponent(window.location.hash.slice(1)),s),Zs()},init:r=>Qf(window,"popstate",Ff(r,o=>{if(o&&o<0)return!n.confirm(o);{const s=t();return!n.confirm(s.value,{state:s.state})}})),create:Jf(e.preload,e.explicitLinks,e.actionBase,e.transformUrl),utils:{go:r=>window.history.go(r),beforeLeave:n}})(e)}const hs=Symbol("store-raw"),Cn=Symbol("store-node"),xt=Symbol("store-has"),Iu=Symbol("store-self");function Mu(e){let t=e[nt];if(!t&&(Object.defineProperty(e,nt,{value:t=new Proxy(e,rh)}),!Array.isArray(e))){const n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let o=0,s=n.length;o<s;o++){const i=n[o];r[i].get&&Object.defineProperty(e,i,{enumerable:r[i].enumerable,get:r[i].get.bind(t)})}}return t}function Bt(e){let t;return e!=null&&typeof e=="object"&&(e[nt]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function cn(e,t=new Set){let n,r,o,s;if(n=e!=null&&e[hs])return n;if(!Bt(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let i=0,a=e.length;i<a;i++)o=e[i],(r=cn(o,t))!==o&&(e[i]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);const i=Object.keys(e),a=Object.getOwnPropertyDescriptors(e);for(let l=0,u=i.length;l<u;l++)s=i[l],!a[s].get&&(o=e[s],(r=cn(o,t))!==o&&(e[s]=r))}return e}function Wr(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function fr(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 th(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===nt||t===Cn||(delete n.value,delete n.writable,n.get=()=>e[nt][t]),n}function Fu(e){as()&&fr(Wr(e,Cn),Iu)()}function nh(e){return Fu(e),Reflect.ownKeys(e)}const rh={get(e,t,n){if(t===hs)return e;if(t===nt)return n;if(t===is)return Fu(e),n;const r=Wr(e,Cn),o=r[t];let s=o?o():e[t];if(t===Cn||t===xt||t==="__proto__")return s;if(!o){const i=Object.getOwnPropertyDescriptor(e,t);as()&&(typeof s!="function"||e.hasOwnProperty(t))&&!(i&&i.get)&&(s=fr(r,t,s)())}return Bt(s)?Mu(s):s},has(e,t){return t===hs||t===nt||t===is||t===Cn||t===xt||t==="__proto__"?!0:(as()&&fr(Wr(e,xt),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:nh,getOwnPropertyDescriptor:th};function Xe(e,t,n,r=!1){if(!r&&e[t]===n)return;const o=e[t],s=e.length;n===void 0?(delete e[t],e[xt]&&e[xt][t]&&o!==void 0&&e[xt][t].$()):(e[t]=n,e[xt]&&e[xt][t]&&o===void 0&&e[xt][t].$());let i=Wr(e,Cn),a;if((a=fr(i,t,o))&&a.$(()=>n),Array.isArray(e)&&e.length!==s){for(let l=e.length;l<s;l++)(a=i[l])&&a.$();(a=fr(i,"length",s))&&a.$(e.length)}(a=i[Iu])&&a.$()}function $u(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const o=n[r];Xe(e,o,t[o])}}function oh(e,t){if(typeof t=="function"&&(t=t(e)),t=cn(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&&Xe(e,n,o)}Xe(e,"length",r)}else $u(e,t)}function rr(e,t,n=[]){let r,o=e;if(t.length>1){r=t.shift();const i=typeof r,a=Array.isArray(e);if(Array.isArray(r)){for(let l=0;l<r.length;l++)rr(e,[r[l]].concat(t),n);return}else if(a&&i==="function"){for(let l=0;l<e.length;l++)r(e[l],l)&&rr(e,[l].concat(t),n);return}else if(a&&i==="object"){const{from:l=0,to:u=e.length-1,by:c=1}=r;for(let d=l;d<=u;d+=c)rr(e,[d].concat(t),n);return}else if(t.length>1){rr(e[r],t,[r].concat(n));return}o=e[r],n=[r].concat(n)}let s=t[0];typeof s=="function"&&(s=s(o,n),s===o)||r===void 0&&s==null||(s=cn(s),r===void 0||Bt(o)&&Bt(s)&&!Array.isArray(s)?$u(o,s):Xe(e,r,s))}function Js(...[e,t]){const n=cn(e||{}),r=Array.isArray(n),o=Mu(n);function s(...i){no(()=>{r&&i.length===1?oh(n,i[0]):rr(n,i)})}return[o,s]}const gs=Symbol("store-root");function bn(e,t,n,r,o){const s=t[n];if(e===s)return;const i=Array.isArray(e);if(n!==gs&&(!Bt(e)||!Bt(s)||i!==Array.isArray(s)||o&&e[o]!==s[o])){Xe(t,n,e);return}if(i){if(e.length&&s.length&&(!r||o&&e[0]&&e[0][o]!=null)){let u,c,d,f,h,g,p,m;for(d=0,f=Math.min(s.length,e.length);d<f&&(s[d]===e[d]||o&&s[d]&&e[d]&&s[d][o]===e[d][o]);d++)bn(e[d],s,d,r,o);const w=new Array(e.length),y=new Map;for(f=s.length-1,h=e.length-1;f>=d&&h>=d&&(s[f]===e[h]||o&&s[d]&&e[d]&&s[f][o]===e[h][o]);f--,h--)w[h]=s[f];if(d>h||d>f){for(c=d;c<=h;c++)Xe(s,c,e[c]);for(;c<e.length;c++)Xe(s,c,w[c]),bn(e[c],s,c,r,o);s.length>e.length&&Xe(s,"length",e.length);return}for(p=new Array(h+1),c=h;c>=d;c--)g=e[c],m=o&&g?g[o]:g,u=y.get(m),p[c]=u===void 0?-1:u,y.set(m,c);for(u=d;u<=f;u++)g=s[u],m=o&&g?g[o]:g,c=y.get(m),c!==void 0&&c!==-1&&(w[c]=s[u],c=p[c],y.set(m,c));for(c=d;c<e.length;c++)c in w?(Xe(s,c,w[c]),bn(e[c],s,c,r,o)):Xe(s,c,e[c])}else for(let u=0,c=e.length;u<c;u++)bn(e[u],s,u,r,o);s.length>e.length&&Xe(s,"length",e.length);return}const a=Object.keys(e);for(let u=0,c=a.length;u<c;u++)bn(e[a[u]],s,a[u],r,o);const l=Object.keys(s);for(let u=0,c=l.length;u<c;u++)e[l[u]]===void 0&&Xe(s,l[u],void 0)}function Au(e,t={}){const{merge:n,key:r="id"}=t,o=cn(e);return s=>{if(!Bt(s)||!Bt(o))return o;const i=bn(o,{[gs]:s},gs,n,r);return i===void 0?s:i}}const Ou="/assets/logo-BYNFyja1.png";var sh=he('<div class="fixed inset-0 flex items-center justify-center bg-white"><div class="w-32 h-32 md:w-48 md:h-48 relative"><img alt="Hot Updater Console"class="w-full h-full object-contain">');const ih=()=>(()=>{var e=sh(),t=e.firstChild,n=t.firstChild;return un(n,"src",Ou),e})();var ah=he('<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 lh({children:e}){return(()=>{var t=ah(),n=t.firstChild,r=n.firstChild;return un(r,"src",Ou),fe(t,e,null),t})()}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(){}},Kn=typeof window>"u"||"Deno"in globalThis;function Qe(){}function uh(e,t){return typeof e=="function"?e(t):e}function ps(e){return typeof e=="number"&&e>=0&&e!==1/0}function Tu(e,t){return Math.max(e+(t||0)-Date.now(),0)}function En(e,t){return typeof e=="function"?e(t):e}function et(e,t){return typeof e=="function"?e(t):e}function ba(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:s,queryKey:i,stale:a}=e;if(i){if(r){if(t.queryHash!==ei(i,t.options))return!1}else if(!gr(t.queryKey,i))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||s&&!s(t))}function Sa(e,t){const{exact:n,status:r,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(hr(t.options.mutationKey)!==hr(s))return!1}else if(!gr(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function ei(e,t){return((t==null?void 0:t.queryKeyHashFn)||hr)(e)}function hr(e){return JSON.stringify(e,(t,n)=>ys(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function gr(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!gr(e[n],t[n])):!1}function Du(e,t){if(e===t)return e;const n=xa(e)&&xa(t);if(n||ys(e)&&ys(t)){const r=n?e:Object.keys(e),o=r.length,s=n?t:Object.keys(t),i=s.length,a=n?[]:{};let l=0;for(let u=0;u<i;u++){const c=n?u:s[u];(!n&&r.includes(c)||n)&&e[c]===void 0&&t[c]===void 0?(a[c]=void 0,l++):(a[c]=Du(e[c],t[c]),a[c]===e[c]&&e[c]!==void 0&&l++)}return o===i&&l===o?e:a}return t}function ms(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 xa(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ys(e){if(!Ca(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Ca(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Ca(e){return Object.prototype.toString.call(e)==="[object Object]"}function ch(e){return new Promise(t=>{setTimeout(t,e)})}function vs(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Du(e,t):t}function dh(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function fh(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var ti=Symbol();function Lu(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===ti?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Zt,Tt,In,Wl,hh=(Wl=class extends Er{constructor(){super();Y(this,Zt);Y(this,Tt);Y(this,In);U(this,In,t=>{if(!Kn&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){x(this,Tt)||this.setEventListener(x(this,In))}onUnsubscribe(){var t;this.hasListeners()||((t=x(this,Tt))==null||t.call(this),U(this,Tt,void 0))}setEventListener(t){var n;U(this,In,t),(n=x(this,Tt))==null||n.call(this),U(this,Tt,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){x(this,Zt)!==t&&(U(this,Zt,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof x(this,Zt)=="boolean"?x(this,Zt):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Zt=new WeakMap,Tt=new WeakMap,In=new WeakMap,Wl),ni=new hh,Mn,Dt,Fn,Xl,gh=(Xl=class extends Er{constructor(){super();Y(this,Mn,!0);Y(this,Dt);Y(this,Fn);U(this,Fn,t=>{if(!Kn&&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(){x(this,Dt)||this.setEventListener(x(this,Fn))}onUnsubscribe(){var t;this.hasListeners()||((t=x(this,Dt))==null||t.call(this),U(this,Dt,void 0))}setEventListener(t){var n;U(this,Fn,t),(n=x(this,Dt))==null||n.call(this),U(this,Dt,t(this.setOnline.bind(this)))}setOnline(t){x(this,Mn)!==t&&(U(this,Mn,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return x(this,Mn)}},Mn=new WeakMap,Dt=new WeakMap,Fn=new WeakMap,Xl),Xr=new gh;function ws(){let e,t;const n=new Promise((o,s)=>{e=o,t=s});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 ph(e){return Math.min(1e3*2**e,3e4)}function _u(e){return(e??"online")==="online"?Xr.isOnline():!0}var ku=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Po(e){return e instanceof ku}function Vu(e){let t=!1,n=0,r=!1,o;const s=ws(),i=p=>{var m;r||(f(new ku(p)),(m=e.abort)==null||m.call(e))},a=()=>{t=!0},l=()=>{t=!1},u=()=>ni.isFocused()&&(e.networkMode==="always"||Xr.isOnline())&&e.canRun(),c=()=>_u(e.networkMode)&&e.canRun(),d=p=>{var m;r||(r=!0,(m=e.onSuccess)==null||m.call(e,p),o==null||o(),s.resolve(p))},f=p=>{var m;r||(r=!0,(m=e.onError)==null||m.call(e,p),o==null||o(),s.reject(p))},h=()=>new Promise(p=>{var m;o=w=>{(r||u())&&p(w)},(m=e.onPause)==null||m.call(e)}).then(()=>{var p;o=void 0,r||(p=e.onContinue)==null||p.call(e)}),g=()=>{if(r)return;let p;const m=n===0?e.initialPromise:void 0;try{p=m??e.fn()}catch(w){p=Promise.reject(w)}Promise.resolve(p).then(d).catch(w=>{var O;if(r)return;const y=e.retry??(Kn?0:3),v=e.retryDelay??ph,b=typeof v=="function"?v(n,w):v,C=y===!0||typeof y=="number"&&n<y||typeof y=="function"&&y(n,w);if(t||!C){f(w);return}n++,(O=e.onFail)==null||O.call(e,n,w),ch(b).then(()=>u()?void 0:h()).then(()=>{t?f(w):g()})})};return{promise:s,cancel:i,continue:()=>(o==null||o(),s),cancelRetry:a,continueRetry:l,canStart:c,start:()=>(c()?g():h().then(g),s)}}function mh(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=a=>setTimeout(a,0);const s=a=>{t?e.push(a):o(()=>{n(a)})},i=()=>{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||i()}return l},batchCalls:a=>(...l)=>{s(()=>{a(...l)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var De=mh(),Jt,Ql,Nu=(Ql=class{constructor(){Y(this,Jt)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ps(this.gcTime)&&U(this,Jt,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Kn?1/0:5*60*1e3))}clearGcTimeout(){x(this,Jt)&&(clearTimeout(x(this,Jt)),U(this,Jt,void 0))}},Jt=new WeakMap,Ql),$n,An,We,en,Ae,wr,tn,Ze,bt,Yl,yh=(Yl=class extends Nu{constructor(t){super();Y(this,Ze);Y(this,$n);Y(this,An);Y(this,We);Y(this,en);Y(this,Ae);Y(this,wr);Y(this,tn);U(this,tn,!1),U(this,wr,t.defaultOptions),this.setOptions(t.options),this.observers=[],U(this,en,t.client),U(this,We,x(this,en).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,U(this,$n,vh(this.options)),this.state=t.state??x(this,$n),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=x(this,Ae))==null?void 0:t.promise}setOptions(t){this.options={...x(this,wr),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&x(this,We).remove(this)}setData(t,n){const r=vs(this.state.data,t,this.options);return ie(this,Ze,bt).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){ie(this,Ze,bt).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=x(this,Ae))==null?void 0:r.promise;return(o=x(this,Ae))==null||o.cancel(t),n?n.then(Qe).catch(Qe):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(x(this,$n))}isActive(){return this.observers.some(t=>et(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ti||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!Tu(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=x(this,Ae))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=x(this,Ae))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),x(this,We).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(x(this,Ae)&&(x(this,tn)?x(this,Ae).cancel({revert:!0}):x(this,Ae).cancelRetry()),this.scheduleGc()),x(this,We).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ie(this,Ze,bt).call(this,{type:"invalidate"})}fetch(t,n){var l,u,c;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(x(this,Ae))return x(this,Ae).continueRetry(),x(this,Ae).promise}if(t&&this.setOptions(t),!this.options.queryFn){const d=this.observers.find(f=>f.options.queryFn);d&&this.setOptions(d.options)}const r=new AbortController,o=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(U(this,tn,!0),r.signal)})},s=()=>{const d=Lu(this.options,n),f={client:x(this,en),queryKey:this.queryKey,meta:this.meta};return o(f),U(this,tn,!1),this.options.persister?this.options.persister(d,f,this):d(f)},i={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:x(this,en),state:this.state,fetchFn:s};o(i),(l=this.options.behavior)==null||l.onFetch(i,this),U(this,An,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=i.fetchOptions)==null?void 0:u.meta))&&ie(this,Ze,bt).call(this,{type:"fetch",meta:(c=i.fetchOptions)==null?void 0:c.meta});const a=d=>{var f,h,g,p;Po(d)&&d.silent||ie(this,Ze,bt).call(this,{type:"error",error:d}),Po(d)||((h=(f=x(this,We).config).onError)==null||h.call(f,d,this),(p=(g=x(this,We).config).onSettled)==null||p.call(g,this.state.data,d,this)),this.scheduleGc()};return U(this,Ae,Vu({initialPromise:n==null?void 0:n.initialPromise,fn:i.fetchFn,abort:r.abort.bind(r),onSuccess:d=>{var f,h,g,p;if(d===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(d)}catch(m){a(m);return}(h=(f=x(this,We).config).onSuccess)==null||h.call(f,d,this),(p=(g=x(this,We).config).onSettled)==null||p.call(g,d,this.state.error,this),this.scheduleGc()},onError:a,onFail:(d,f)=>{ie(this,Ze,bt).call(this,{type:"failed",failureCount:d,error:f})},onPause:()=>{ie(this,Ze,bt).call(this,{type:"pause"})},onContinue:()=>{ie(this,Ze,bt).call(this,{type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0})),x(this,Ae).start()}},$n=new WeakMap,An=new WeakMap,We=new WeakMap,en=new WeakMap,Ae=new WeakMap,wr=new WeakMap,tn=new WeakMap,Ze=new WeakSet,bt=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,...Ku(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 Po(o)&&o.revert&&x(this,An)?{...x(this,An),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),De.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),x(this,We).notify({query:this,type:"updated",action:t})})},Yl);function Ku(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:_u(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function vh(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 lt,Zl,wh=(Zl=class extends Er{constructor(t={}){super();Y(this,lt);this.config=t,U(this,lt,new Map)}build(t,n,r){const o=n.queryKey,s=n.queryHash??ei(o,n);let i=this.get(s);return i||(i=new yh({client:t,queryKey:o,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(i)),i}add(t){x(this,lt).has(t.queryHash)||(x(this,lt).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=x(this,lt).get(t.queryHash);n&&(t.destroy(),n===t&&x(this,lt).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){De.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return x(this,lt).get(t)}getAll(){return[...x(this,lt).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>ba(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>ba(t,r)):n}notify(t){De.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){De.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){De.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},lt=new WeakMap,Zl),ut,_e,nn,ct,Ot,Jl,bh=(Jl=class extends Nu{constructor(t){super();Y(this,ct);Y(this,ut);Y(this,_e);Y(this,nn);this.mutationId=t.mutationId,U(this,_e,t.mutationCache),U(this,ut,[]),this.state=t.state||Sh(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){x(this,ut).includes(t)||(x(this,ut).push(t),this.clearGcTimeout(),x(this,_e).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){U(this,ut,x(this,ut).filter(n=>n!==t)),this.scheduleGc(),x(this,_e).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){x(this,ut).length||(this.state.status==="pending"?this.scheduleGc():x(this,_e).remove(this))}continue(){var t;return((t=x(this,nn))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,s,i,a,l,u,c,d,f,h,g,p,m,w,y,v,b,C,O,D;U(this,nn,Vu({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(_,T)=>{ie(this,ct,Ot).call(this,{type:"failed",failureCount:_,error:T})},onPause:()=>{ie(this,ct,Ot).call(this,{type:"pause"})},onContinue:()=>{ie(this,ct,Ot).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>x(this,_e).canRun(this)}));const n=this.state.status==="pending",r=!x(this,nn).canStart();try{if(!n){ie(this,ct,Ot).call(this,{type:"pending",variables:t,isPaused:r}),await((s=(o=x(this,_e).config).onMutate)==null?void 0:s.call(o,t,this));const T=await((a=(i=this.options).onMutate)==null?void 0:a.call(i,t));T!==this.state.context&&ie(this,ct,Ot).call(this,{type:"pending",context:T,variables:t,isPaused:r})}const _=await x(this,nn).start();return await((u=(l=x(this,_e).config).onSuccess)==null?void 0:u.call(l,_,t,this.state.context,this)),await((d=(c=this.options).onSuccess)==null?void 0:d.call(c,_,t,this.state.context)),await((h=(f=x(this,_e).config).onSettled)==null?void 0:h.call(f,_,null,this.state.variables,this.state.context,this)),await((p=(g=this.options).onSettled)==null?void 0:p.call(g,_,null,t,this.state.context)),ie(this,ct,Ot).call(this,{type:"success",data:_}),_}catch(_){try{throw await((w=(m=x(this,_e).config).onError)==null?void 0:w.call(m,_,t,this.state.context,this)),await((v=(y=this.options).onError)==null?void 0:v.call(y,_,t,this.state.context)),await((C=(b=x(this,_e).config).onSettled)==null?void 0:C.call(b,void 0,_,this.state.variables,this.state.context,this)),await((D=(O=this.options).onSettled)==null?void 0:D.call(O,void 0,_,t,this.state.context)),_}finally{ie(this,ct,Ot).call(this,{type:"error",error:_})}}finally{x(this,_e).runNext(this)}}},ut=new WeakMap,_e=new WeakMap,nn=new WeakMap,ct=new WeakSet,Ot=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),De.batch(()=>{x(this,ut).forEach(r=>{r.onMutationUpdate(t)}),x(this,_e).notify({mutation:this,type:"updated",action:t})})},Jl);function Sh(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Et,Je,br,eu,xh=(eu=class extends Er{constructor(t={}){super();Y(this,Et);Y(this,Je);Y(this,br);this.config=t,U(this,Et,new Set),U(this,Je,new Map),U(this,br,0)}build(t,n,r){const o=new bh({mutationCache:this,mutationId:++Fr(this,br)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){x(this,Et).add(t);const n=Ar(t);if(typeof n=="string"){const r=x(this,Je).get(n);r?r.push(t):x(this,Je).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(x(this,Et).delete(t)){const n=Ar(t);if(typeof n=="string"){const r=x(this,Je).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&x(this,Je).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Ar(t);if(typeof n=="string"){const r=x(this,Je).get(n),o=r==null?void 0:r.find(s=>s.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=Ar(t);if(typeof n=="string"){const o=(r=x(this,Je).get(n))==null?void 0:r.find(s=>s!==t&&s.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){De.batch(()=>{x(this,Et).forEach(t=>{this.notify({type:"removed",mutation:t})}),x(this,Et).clear(),x(this,Je).clear()})}getAll(){return Array.from(x(this,Et))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Sa(n,r))}findAll(t={}){return this.getAll().filter(n=>Sa(t,n))}notify(t){De.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return De.batch(()=>Promise.all(t.map(n=>n.continue().catch(Qe))))}},Et=new WeakMap,Je=new WeakMap,br=new WeakMap,eu);function Ar(e){var t;return(t=e.options.scope)==null?void 0:t.id}function Ea(e){return{onFetch:(t,n)=>{var c,d,f,h,g;const r=t.options,o=(f=(d=(c=t.fetchOptions)==null?void 0:c.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,s=((h=t.state.data)==null?void 0:h.pages)||[],i=((g=t.state.data)==null?void 0:g.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let p=!1;const m=v=>{Object.defineProperty(v,"signal",{enumerable:!0,get:()=>(t.signal.aborted?p=!0:t.signal.addEventListener("abort",()=>{p=!0}),t.signal)})},w=Lu(t.options,t.fetchOptions),y=async(v,b,C)=>{if(p)return Promise.reject();if(b==null&&v.pages.length)return Promise.resolve(v);const O={client:t.client,queryKey:t.queryKey,pageParam:b,direction:C?"backward":"forward",meta:t.options.meta};m(O);const D=await w(O),{maxPages:_}=t.options,T=C?fh:dh;return{pages:T(v.pages,D,_),pageParams:T(v.pageParams,b,_)}};if(o&&s.length){const v=o==="backward",b=v?Ch:Ra,C={pages:s,pageParams:i},O=b(r,C);a=await y(C,O,v)}else{const v=e??s.length;do{const b=l===0?i[0]??r.initialPageParam:Ra(r,a);if(l>0&&b==null)break;a=await y(a,b),l++}while(l<v)}return a};t.options.persister?t.fetchFn=()=>{var p,m;return(m=(p=t.options).persister)==null?void 0:m.call(p,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function Ra(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 Ch(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 xe,Lt,_t,On,Tn,kt,Dn,Ln,tu,Eh=(tu=class{constructor(t={}){Y(this,xe);Y(this,Lt);Y(this,_t);Y(this,On);Y(this,Tn);Y(this,kt);Y(this,Dn);Y(this,Ln);U(this,xe,t.queryCache||new wh),U(this,Lt,t.mutationCache||new xh),U(this,_t,t.defaultOptions||{}),U(this,On,new Map),U(this,Tn,new Map),U(this,kt,0)}mount(){Fr(this,kt)._++,x(this,kt)===1&&(U(this,Dn,ni.subscribe(async t=>{t&&(await this.resumePausedMutations(),x(this,xe).onFocus())})),U(this,Ln,Xr.subscribe(async t=>{t&&(await this.resumePausedMutations(),x(this,xe).onOnline())})))}unmount(){var t,n;Fr(this,kt)._--,x(this,kt)===0&&((t=x(this,Dn))==null||t.call(this),U(this,Dn,void 0),(n=x(this,Ln))==null||n.call(this),U(this,Ln,void 0))}isFetching(t){return x(this,xe).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return x(this,Lt).findAll({...t,status:"pending"}).length}getQueryData(t){var r;const n=this.defaultQueryOptions({queryKey:t});return(r=x(this,xe).get(n.queryHash))==null?void 0:r.state.data}ensureQueryData(t){const n=this.defaultQueryOptions(t),r=x(this,xe).build(this,n),o=r.state.data;return o===void 0?this.fetchQuery(t):(t.revalidateIfStale&&r.isStaleByTime(En(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(o))}getQueriesData(t){return x(this,xe).findAll(t).map(({queryKey:n,state:r})=>{const o=r.data;return[n,o]})}setQueryData(t,n,r){const o=this.defaultQueryOptions({queryKey:t}),s=x(this,xe).get(o.queryHash),i=s==null?void 0:s.state.data,a=uh(n,i);if(a!==void 0)return x(this,xe).build(this,o).setData(a,{...r,manual:!0})}setQueriesData(t,n,r){return De.batch(()=>x(this,xe).findAll(t).map(({queryKey:o})=>[o,this.setQueryData(o,n,r)]))}getQueryState(t){var r;const n=this.defaultQueryOptions({queryKey:t});return(r=x(this,xe).get(n.queryHash))==null?void 0:r.state}removeQueries(t){const n=x(this,xe);De.batch(()=>{n.findAll(t).forEach(r=>{n.remove(r)})})}resetQueries(t,n){const r=x(this,xe),o={type:"active",...t};return De.batch(()=>(r.findAll(t).forEach(s=>{s.reset()}),this.refetchQueries(o,n)))}cancelQueries(t,n={}){const r={revert:!0,...n},o=De.batch(()=>x(this,xe).findAll(t).map(s=>s.cancel(r)));return Promise.all(o).then(Qe).catch(Qe)}invalidateQueries(t,n={}){return De.batch(()=>{if(x(this,xe).findAll(t).forEach(o=>{o.invalidate()}),(t==null?void 0:t.refetchType)==="none")return Promise.resolve();const r={...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"};return this.refetchQueries(r,n)})}refetchQueries(t,n={}){const r={...n,cancelRefetch:n.cancelRefetch??!0},o=De.batch(()=>x(this,xe).findAll(t).filter(s=>!s.isDisabled()).map(s=>{let i=s.fetch(void 0,r);return r.throwOnError||(i=i.catch(Qe)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(o).then(Qe)}fetchQuery(t){const n=this.defaultQueryOptions(t);n.retry===void 0&&(n.retry=!1);const r=x(this,xe).build(this,n);return r.isStaleByTime(En(n.staleTime,r))?r.fetch(n):Promise.resolve(r.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Qe).catch(Qe)}fetchInfiniteQuery(t){return t.behavior=Ea(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Qe).catch(Qe)}ensureInfiniteQueryData(t){return t.behavior=Ea(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Xr.isOnline()?x(this,Lt).resumePausedMutations():Promise.resolve()}getQueryCache(){return x(this,xe)}getMutationCache(){return x(this,Lt)}getDefaultOptions(){return x(this,_t)}setDefaultOptions(t){U(this,_t,t)}setQueryDefaults(t,n){x(this,On).set(hr(t),{queryKey:t,defaultOptions:n})}getQueryDefaults(t){const n=[...x(this,On).values()],r={};return n.forEach(o=>{gr(t,o.queryKey)&&Object.assign(r,o.defaultOptions)}),r}setMutationDefaults(t,n){x(this,Tn).set(hr(t),{mutationKey:t,defaultOptions:n})}getMutationDefaults(t){const n=[...x(this,Tn).values()];let r={};return n.forEach(o=>{gr(t,o.mutationKey)&&(r={...r,...o.defaultOptions})}),r}defaultQueryOptions(t){if(t._defaulted)return t;const n={...x(this,_t).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return n.queryHash||(n.queryHash=ei(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===ti&&(n.enabled=!1),n}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...x(this,_t).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){x(this,xe).clear(),x(this,Lt).clear()}},xe=new WeakMap,Lt=new WeakMap,_t=new WeakMap,On=new WeakMap,Tn=new WeakMap,kt=new WeakMap,Dn=new WeakMap,Ln=new WeakMap,tu),Ve,ae,Sr,ke,rn,_n,Vt,dt,xr,kn,Vn,on,sn,Nt,Nn,ge,or,bs,Ss,xs,Cs,Es,Rs,Ps,ju,nu,Rh=(nu=class extends Er{constructor(t,n){super();Y(this,ge);Y(this,Ve);Y(this,ae);Y(this,Sr);Y(this,ke);Y(this,rn);Y(this,_n);Y(this,Vt);Y(this,dt);Y(this,xr);Y(this,kn);Y(this,Vn);Y(this,on);Y(this,sn);Y(this,Nt);Y(this,Nn,new Set);this.options=n,U(this,Ve,t),U(this,dt,null),U(this,Vt,ws()),this.options.experimental_prefetchInRender||x(this,Vt).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&&(x(this,ae).addObserver(this),Pa(x(this,ae),this.options)?ie(this,ge,or).call(this):this.updateResult(),ie(this,ge,Cs).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Is(x(this,ae),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Is(x(this,ae),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ie(this,ge,Es).call(this),ie(this,ge,Rs).call(this),x(this,ae).removeObserver(this)}setOptions(t,n){const r=this.options,o=x(this,ae);if(this.options=x(this,Ve).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof et(this.options.enabled,x(this,ae))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ie(this,ge,Ps).call(this),x(this,ae).setOptions(this.options),r._defaulted&&!ms(this.options,r)&&x(this,Ve).getQueryCache().notify({type:"observerOptionsUpdated",query:x(this,ae),observer:this});const s=this.hasListeners();s&&Ia(x(this,ae),o,this.options,r)&&ie(this,ge,or).call(this),this.updateResult(n),s&&(x(this,ae)!==o||et(this.options.enabled,x(this,ae))!==et(r.enabled,x(this,ae))||En(this.options.staleTime,x(this,ae))!==En(r.staleTime,x(this,ae)))&&ie(this,ge,bs).call(this);const i=ie(this,ge,Ss).call(this);s&&(x(this,ae)!==o||et(this.options.enabled,x(this,ae))!==et(r.enabled,x(this,ae))||i!==x(this,Nt))&&ie(this,ge,xs).call(this,i)}getOptimisticResult(t){const n=x(this,Ve).getQueryCache().build(x(this,Ve),t),r=this.createResult(n,t);return Ih(this,r)&&(U(this,ke,r),U(this,_n,this.options),U(this,rn,x(this,ae).state)),r}getCurrentResult(){return x(this,ke)}trackResult(t,n){const r={};return Object.keys(t).forEach(o=>{Object.defineProperty(r,o,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(o),n==null||n(o),t[o])})}),r}trackProp(t){x(this,Nn).add(t)}getCurrentQuery(){return x(this,ae)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=x(this,Ve).defaultQueryOptions(t),r=x(this,Ve).getQueryCache().build(x(this,Ve),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return ie(this,ge,or).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),x(this,ke)))}createResult(t,n){var _;const r=x(this,ae),o=this.options,s=x(this,ke),i=x(this,rn),a=x(this,_n),u=t!==r?t.state:x(this,Sr),{state:c}=t;let d={...c},f=!1,h;if(n._optimisticResults){const T=this.hasListeners(),k=!T&&Pa(t,n),V=T&&Ia(t,r,n,o);(k||V)&&(d={...d,...Ku(c.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:g,errorUpdatedAt:p,status:m}=d;if(n.select&&d.data!==void 0)if(s&&d.data===(i==null?void 0:i.data)&&n.select===x(this,xr))h=x(this,kn);else try{U(this,xr,n.select),h=n.select(d.data),h=vs(s==null?void 0:s.data,h,n),U(this,kn,h),U(this,dt,null)}catch(T){U(this,dt,T)}else h=d.data;if(n.placeholderData!==void 0&&h===void 0&&m==="pending"){let T;if(s!=null&&s.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))T=s.data;else if(T=typeof n.placeholderData=="function"?n.placeholderData((_=x(this,Vn))==null?void 0:_.state.data,x(this,Vn)):n.placeholderData,n.select&&T!==void 0)try{T=n.select(T),U(this,dt,null)}catch(k){U(this,dt,k)}T!==void 0&&(m="success",h=vs(s==null?void 0:s.data,T,n),f=!0)}x(this,dt)&&(g=x(this,dt),h=x(this,kn),p=Date.now(),m="error");const w=d.fetchStatus==="fetching",y=m==="pending",v=m==="error",b=y&&w,C=h!==void 0,D={status:m,fetchStatus:d.fetchStatus,isPending:y,isSuccess:m==="success",isError:v,isInitialLoading:b,isLoading:b,data:h,dataUpdatedAt:d.dataUpdatedAt,error:g,errorUpdatedAt:p,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>u.dataUpdateCount||d.errorUpdateCount>u.errorUpdateCount,isFetching:w,isRefetching:w&&!y,isLoadingError:v&&!C,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:v&&C,isStale:ri(t,n),refetch:this.refetch,promise:x(this,Vt)};if(this.options.experimental_prefetchInRender){const T=j=>{D.status==="error"?j.reject(D.error):D.data!==void 0&&j.resolve(D.data)},k=()=>{const j=U(this,Vt,D.promise=ws());T(j)},V=x(this,Vt);switch(V.status){case"pending":t.queryHash===r.queryHash&&T(V);break;case"fulfilled":(D.status==="error"||D.data!==V.value)&&k();break;case"rejected":(D.status!=="error"||D.error!==V.reason)&&k();break}}return D}updateResult(t){const n=x(this,ke),r=this.createResult(x(this,ae),this.options);if(U(this,rn,x(this,ae).state),U(this,_n,this.options),x(this,rn).data!==void 0&&U(this,Vn,x(this,ae)),ms(r,n))return;U(this,ke,r);const o={},s=()=>{if(!n)return!0;const{notifyOnChangeProps:i}=this.options,a=typeof i=="function"?i():i;if(a==="all"||!a&&!x(this,Nn).size)return!0;const l=new Set(a??x(this,Nn));return this.options.throwOnError&&l.add("error"),Object.keys(x(this,ke)).some(u=>{const c=u;return x(this,ke)[c]!==n[c]&&l.has(c)})};(t==null?void 0:t.listeners)!==!1&&s()&&(o.listeners=!0),ie(this,ge,ju).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ie(this,ge,Cs).call(this)}},Ve=new WeakMap,ae=new WeakMap,Sr=new WeakMap,ke=new WeakMap,rn=new WeakMap,_n=new WeakMap,Vt=new WeakMap,dt=new WeakMap,xr=new WeakMap,kn=new WeakMap,Vn=new WeakMap,on=new WeakMap,sn=new WeakMap,Nt=new WeakMap,Nn=new WeakMap,ge=new WeakSet,or=function(t){ie(this,ge,Ps).call(this);let n=x(this,ae).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Qe)),n},bs=function(){ie(this,ge,Es).call(this);const t=En(this.options.staleTime,x(this,ae));if(Kn||x(this,ke).isStale||!ps(t))return;const r=Tu(x(this,ke).dataUpdatedAt,t)+1;U(this,on,setTimeout(()=>{x(this,ke).isStale||this.updateResult()},r))},Ss=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(x(this,ae)):this.options.refetchInterval)??!1},xs=function(t){ie(this,ge,Rs).call(this),U(this,Nt,t),!(Kn||et(this.options.enabled,x(this,ae))===!1||!ps(x(this,Nt))||x(this,Nt)===0)&&U(this,sn,setInterval(()=>{(this.options.refetchIntervalInBackground||ni.isFocused())&&ie(this,ge,or).call(this)},x(this,Nt)))},Cs=function(){ie(this,ge,bs).call(this),ie(this,ge,xs).call(this,ie(this,ge,Ss).call(this))},Es=function(){x(this,on)&&(clearTimeout(x(this,on)),U(this,on,void 0))},Rs=function(){x(this,sn)&&(clearInterval(x(this,sn)),U(this,sn,void 0))},Ps=function(){const t=x(this,Ve).getQueryCache().build(x(this,Ve),this.options);if(t===x(this,ae))return;const n=x(this,ae);U(this,ae,t),U(this,Sr,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},ju=function(t){De.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(x(this,ke))}),x(this,Ve).getQueryCache().notify({query:x(this,ae),type:"observerResultsUpdated"})})},nu);function Ph(e,t){return et(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Pa(e,t){return Ph(e,t)||e.state.data!==void 0&&Is(e,t,t.refetchOnMount)}function Is(e,t,n){if(et(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&ri(e,t)}return!1}function Ia(e,t,n,r){return(e!==t||et(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&ri(e,n)}function ri(e,t){return et(t.enabled,e)!==!1&&e.isStaleByTime(En(t.staleTime,e))}function Ih(e,t){return!ms(e.getCurrentResult(),t)}function Mh(e){return e}function Fh(e,t,n){var l;if(typeof t!="object"||t===null)return;const r=e.getMutationCache(),o=e.getQueryCache(),s=((l=e.getDefaultOptions().hydrate)==null?void 0:l.deserializeData)??Mh,i=t.mutations||[],a=t.queries||[];i.forEach(({state:u,...c})=>{var d,f;r.build(e,{...(d=e.getDefaultOptions().hydrate)==null?void 0:d.mutations,...(f=n==null?void 0:n.defaultOptions)==null?void 0:f.mutations,...c},u)}),a.forEach(({queryKey:u,state:c,queryHash:d,meta:f,promise:h})=>{var m,w;let g=o.get(d);const p=c.data===void 0?c.data:s(c.data);if(g){if(g.state.dataUpdatedAt<c.dataUpdatedAt){const{fetchStatus:y,...v}=c;g.setState({...v,data:p})}}else g=o.build(e,{...(m=e.getDefaultOptions().hydrate)==null?void 0:m.queries,...(w=n==null?void 0:n.defaultOptions)==null?void 0:w.queries,queryKey:u,queryHash:d,meta:f},{...c,data:p,fetchStatus:"idle"});if(h){const y=Promise.resolve(h).then(s);g.fetch(void 0,{initialPromise:y})}})}var $h=class extends Eh{constructor(e={}){super(e)}},zu=Se(void 0),Bu=e=>{const t=we(zu);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t()},Ah=e=>(Ke(t=>(t==null||t(),e.client.mount(),e.client.unmount.bind(e.client))),W(()=>e.client.unmount()),S(zu.Provider,{value:()=>e.client,get children(){return e.children}}));function Oh(e,t){return typeof e=="function"?e(...t):!!e}var Gu=Se(()=>!1),Th=()=>we(Gu);Gu.Provider;function Dh(e,t,n,r){if(n===!1)return t;if(typeof n=="function"){const i=n(e.data,t.data);return{...t,data:i}}let o=t.data;if(e.data===void 0)try{o=structuredClone(o)}catch{}const s=Au(o,{key:n})(e.data);return{...t,data:s}}var Lh=(e,t)=>t;function _h(e,t,n){const r=N(()=>Bu()),o=Th(),s=N(()=>{const b=r().defaultQueryOptions(e());return b._optimisticResults=o()?"isRestoring":"optimistic",b.structuralSharing=!1,b}),i=s(),[a,l]=z(new t(r(),s()));let u=a().getOptimisticResult(s());const[c,d]=Js(u),f=()=>a().subscribe(C=>{u=C,queueMicrotask(()=>{p&&y()})});function h(b){const C=a().options,O=C.reconcile;d(D=>Dh(D,b,O===void 0?!1:O,C.queryHash))}function g(){return[()=>c,b=>{const C=cn(c);if(typeof b=="function"&&(b=b(C)),b!=null&&b.hydrationData){const{hydrationData:O,...D}=b;b=D}h(b)}]}let p=null,m=null;const[w,{refetch:y}]=Vd(()=>{const b=a();return new Promise((C,O)=>{if(m=C,!p&&!o()&&(p=f()),b.updateResult(),u.isError&&!u.isFetching&&!o()&&Oh(b.options.throwOnError,[u.error,b.getCurrentQuery()]))return h(u),O(u.error);if(!u.isLoading)return m=null,C(Lh(b.getCurrentQuery(),u));h(u)})},{storage:g,get deferStream(){return e().deferStream},onHydrated(b,C){if(C.value&&"hydrationData"in C.value&&Fh(r(),{queries:[{...C.value.hydrationData}]}),p)return;const O={...i};(i.staleTime||!i.initialData)&&C.value&&(O.refetchOnMount=!1),a().setOptions(O),h(a().getOptimisticResult(O)),p=f()}});Rt(Me(r,b=>{p&&p();const C=new t(b,s());p=f(),l(C)},{defer:!0})),Rt(Me(o,b=>{b||y()},{defer:!0})),W(()=>{p&&(p(),p=null),m&&(m(u),m=null)}),Rt(Me([a,s],([b,C])=>{b.setOptions(C),h(b.getOptimisticResult(C)),y()},{defer:!0}));const v={get(b,C){var O,D;return C==="data"?c.data!==void 0?(O=w.latest)==null?void 0:O.data:(D=w())==null?void 0:D.data:Reflect.get(b,C)}};return new Proxy(c,v)}function oi(e,t){return _h(N(()=>e()),Rh)}function kh(e){return(...t)=>{for(const n of e)n&&n(...t)}}var $=e=>typeof e=="function"&&!e.length?e():e,Ma=e=>Array.isArray(e)?e:e?[e]:[];function Vh(e,...t){return typeof e=="function"?e(...t):e}var Nh=W;function Kh(e,t,n,r){return e.addEventListener(t,n,r),Nh(e.removeEventListener.bind(e,t,n,r))}function jh(e,t,n,r){const o=()=>{Ma($(e)).forEach(s=>{s&&Ma($(t)).forEach(i=>Kh(s,i,n,r))})};typeof e=="function"?q(o):Ke(o)}var zh=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function Fa(e){const t={};let n;for(;n=zh.exec(e);)t[n[1]]=n[2];return t}function gn(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=Fa(e)}else typeof t=="string"&&(t=Fa(t));return{...e,...t}}function be(...e){return kh(e)}function Bh(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function Ms(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Gh(e){return typeof e=="number"}function Sn(e){return Object.prototype.toString.call(e)==="[object String]"}function Hu(e){return typeof e=="function"}function Wt(e){return t=>`${e()}-${t}`}function Ne(e,t){return e?e===t||e.contains(t):!1}function sr(e,t=!1){const{activeElement:n}=ht(e);if(!(n!=null&&n.nodeName))return null;if(Uu(n)&&n.contentDocument)return sr(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const o=ht(n).getElementById(r);if(o)return o}}return n}function Hh(e){return ht(e).defaultView||window}function ht(e){return e?e.ownerDocument||e:document}function Uu(e){return e.tagName==="IFRAME"}var si=(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))(si||{});function ii(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 so(){return ii(/^Mac/i)}function Uh(){return ii(/^iPhone/i)}function qh(){return ii(/^iPad/i)||so()&&navigator.maxTouchPoints>1}function Wh(){return Uh()||qh()}function Xh(){return so()||Wh()}function ce(e,t){return t&&(Hu(t)?t(e):t[0](t[1],e)),e==null?void 0:e.defaultPrevented}function ve(e){return t=>{for(const n of e)ce(t,n)}}function Qh(e){return so()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function Ie(e){if(e)if(Yh())e.focus({preventScroll:!0});else{const t=Zh(e);e.focus(),Jh(t)}}var Or=null;function Yh(){if(Or==null){Or=!1;try{document.createElement("div").focus({get preventScroll(){return Or=!0,!0}})}catch{}}return Or}function Zh(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 Jh(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var qu=["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'])"],eg=[...qu,'[tabindex]:not([tabindex="-1"]):not([disabled])'],ai=`${qu.join(":not([hidden]),")},[tabindex]:not([disabled]):not([hidden])`,tg=eg.join(':not([hidden]):not([tabindex="-1"]),');function Wu(e,t){const r=Array.from(e.querySelectorAll(ai)).filter($a);return t&&$a(e)&&r.unshift(e),r.forEach((o,s)=>{if(Uu(o)&&o.contentDocument){const i=o.contentDocument.body,a=Wu(i,!1);r.splice(s,1,...a)}}),r}function $a(e){return Xu(e)&&!ng(e)}function Xu(e){return e.matches(ai)&&li(e)}function ng(e){return Number.parseInt(e.getAttribute("tabindex")||"0",10)<0}function li(e,t){return e.nodeName!=="#comment"&&rg(e)&&og(e,t)&&(!e.parentElement||li(e.parentElement,e))}function rg(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:s,visibility:i}=o(e);r=s!=="none"&&i!=="hidden"&&i!=="collapse"}return r}function og(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function sg(e,t,n){const r=t!=null&&t.tabbable?tg:ai,o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(s){var i;return(i=t==null?void 0:t.from)!=null&&i.contains(s)?NodeFilter.FILTER_REJECT:s.matches(r)&&li(s)&&(!(t!=null&&t.accept)||t.accept(s))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t!=null&&t.from&&(o.currentNode=t.from),o}function Aa(e){let t=e;for(;t&&!ig(t);)t=t.parentElement;return t||document.scrollingElement||document.documentElement}function ig(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function ag(){}function lg(e,t){const[n,r]=e;let o=!1;const s=t.length;for(let i=s,a=0,l=i-1;a<i;l=a++){const[u,c]=t[a],[d,f]=t[l],[,h]=t[l===0?i-1:l-1]||[0,0],g=(c-f)*(n-u)-(u-d)*(r-c);if(f<c){if(r>=f&&r<c){if(g===0)return!0;g>0&&(r===f?r>h&&(o=!o):o=!o)}}else if(c<f){if(r>c&&r<=f){if(g===0)return!0;g<0&&(r===f?r<h&&(o=!o):o=!o)}}else if(r===c&&(n>=d&&n<=u||n>=u&&n<=d))return!0}return o}function ee(e,t){return A(e,t)}var Qn=new Map,Oa=new Set;function Ta(){if(typeof window>"u")return;const e=n=>{if(!n.target)return;let r=Qn.get(n.target);r||(r=new Set,Qn.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=Qn.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),Qn.delete(n.target)),Qn.size===0)){for(const o of Oa)o();Oa.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document<"u"&&(document.readyState!=="loading"?Ta():document.addEventListener("DOMContentLoaded",Ta));function Fs(e,t){const n=Da(e,t,"left"),r=Da(e,t,"top"),o=t.offsetWidth,s=t.offsetHeight;let i=e.scrollLeft,a=e.scrollTop;const l=i+e.offsetWidth,u=a+e.offsetHeight;n<=i?i=n:n+o>l&&(i+=n+o-l),r<=a?a=r:r+s>u&&(a+=r+s-u),e.scrollLeft=i,e.scrollTop=a}function Da(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 ug(e,t){var n,r;if(document.contains(e)){const o=document.scrollingElement||document.documentElement;if(window.getComputedStyle(o).overflow==="hidden"){let i=Aa(e);for(;e&&i&&e!==o&&i!==o;)Fs(i,e),e=i,i=Aa(e)}else{const{left:i,top:a}=e.getBoundingClientRect();(n=e==null?void 0:e.scrollIntoView)==null||n.call(e,{block:"nearest"});const{left:l,top:u}=e.getBoundingClientRect();(Math.abs(i-l)>1||Math.abs(a-u)>1)&&((r=e.scrollIntoView)==null||r.call(e,{block:"nearest"}))}}}var Qu={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"},Qr="data-kb-top-layer",Yu,$s=!1,Pt=[];function pr(e){return Pt.findIndex(t=>t.node===e)}function cg(e){return Pt[pr(e)]}function dg(e){return Pt[Pt.length-1].node===e}function Zu(){return Pt.filter(e=>e.isPointerBlocking)}function fg(){return[...Zu()].slice(-1)[0]}function ui(){return Zu().length>0}function Ju(e){var n;const t=pr((n=fg())==null?void 0:n.node);return pr(e)<t}function hg(e){Pt.push(e)}function gg(e){const t=pr(e);t<0||Pt.splice(t,1)}function pg(){for(const{node:e}of Pt)e.style.pointerEvents=Ju(e)?"none":"auto"}function mg(e){if(ui()&&!$s){const t=ht(e);Yu=document.body.style.pointerEvents,t.body.style.pointerEvents="none",$s=!0}}function yg(e){if(ui())return;const t=ht(e);t.body.style.pointerEvents=Yu,t.body.style.length===0&&t.body.removeAttribute("style"),$s=!1}var ze={layers:Pt,isTopMostLayer:dg,hasPointerBlockingLayer:ui,isBelowPointerBlockingLayer:Ju,addLayer:hg,removeLayer:gg,indexOf:pr,find:cg,assignPointerEventToLayers:pg,disableBodyPointerEvents:mg,restoreBodyPointerEvents:yg},Io="focusScope.autoFocusOnMount",Mo="focusScope.autoFocusOnUnmount",La={bubbles:!1,cancelable:!0},_a={stack:[],active(){return this.stack[0]},add(e){var t;e!==this.active()&&((t=this.active())==null||t.pause()),this.stack=Ms(this.stack,e),this.stack.unshift(e)},remove(e){var t;this.stack=Ms(this.stack,e),(t=this.active())==null||t.resume()}};function ec(e,t){const[n,r]=z(!1),o={pause(){r(!0)},resume(){r(!1)}};let s=null;const i=g=>{var p;return(p=e.onMountAutoFocus)==null?void 0:p.call(e,g)},a=g=>{var p;return(p=e.onUnmountAutoFocus)==null?void 0:p.call(e,g)},l=()=>ht(t()),u=()=>{const g=l().createElement("span");return g.setAttribute("data-focus-trap",""),g.tabIndex=0,Object.assign(g.style,Qu),g},c=()=>{const g=t();return g?Wu(g,!0).filter(p=>!p.hasAttribute("data-focus-trap")):[]},d=()=>{const g=c();return g.length>0?g[0]:null},f=()=>{const g=c();return g.length>0?g[g.length-1]:null},h=()=>{const g=t();if(!g)return!1;const p=sr(g);return!p||Ne(g,p)?!1:Xu(p)};q(()=>{const g=t();if(!g)return;_a.add(o);const p=sr(g);if(!Ne(g,p)){const w=new CustomEvent(Io,La);g.addEventListener(Io,i),g.dispatchEvent(w),w.defaultPrevented||setTimeout(()=>{Ie(d()),sr(g)===p&&Ie(g)},0)}W(()=>{g.removeEventListener(Io,i),setTimeout(()=>{const w=new CustomEvent(Mo,La);h()&&w.preventDefault(),g.addEventListener(Mo,a),g.dispatchEvent(w),w.defaultPrevented||Ie(p??l().body),g.removeEventListener(Mo,a),_a.remove(o)},0)})}),q(()=>{const g=t();if(!g||!$(e.trapFocus)||n())return;const p=w=>{const y=w.target;y!=null&&y.closest(`[${Qr}]`)||(Ne(g,y)?s=y:Ie(s))},m=w=>{const v=w.relatedTarget??sr(g);v!=null&&v.closest(`[${Qr}]`)||Ne(g,v)||Ie(s)};l().addEventListener("focusin",p),l().addEventListener("focusout",m),W(()=>{l().removeEventListener("focusin",p),l().removeEventListener("focusout",m)})}),q(()=>{const g=t();if(!g||!$(e.trapFocus)||n())return;const p=u();g.insertAdjacentElement("afterbegin",p);const m=u();g.insertAdjacentElement("beforeend",m);function w(v){const b=d(),C=f();v.relatedTarget===b?Ie(C):Ie(b)}p.addEventListener("focusin",w),m.addEventListener("focusin",w);const y=new MutationObserver(v=>{for(const b of v)b.previousSibling===m&&(m.remove(),g.insertAdjacentElement("beforeend",m)),b.nextSibling===p&&(p.remove(),g.insertAdjacentElement("afterbegin",p))});y.observe(g,{childList:!0,subtree:!1}),W(()=>{p.removeEventListener("focusin",w),m.removeEventListener("focusin",w),p.remove(),m.remove(),y.disconnect()})})}var vg="data-live-announcer";function tc(e){q(()=>{$(e.isDisabled)||W(wg($(e.targets),$(e.root)))})}var Yn=new WeakMap,qe=[];function wg(e,t=document.body){const n=new Set(e),r=new Set,o=l=>{for(const f of l.querySelectorAll(`[${vg}], [${Qr}]`))n.add(f);const u=f=>{if(n.has(f)||f.parentElement&&r.has(f.parentElement)&&f.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(const h of n)if(f.contains(h))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},c=document.createTreeWalker(l,NodeFilter.SHOW_ELEMENT,{acceptNode:u}),d=u(l);if(d===NodeFilter.FILTER_ACCEPT&&s(l),d!==NodeFilter.FILTER_REJECT){let f=c.nextNode();for(;f!=null;)s(f),f=c.nextNode()}},s=l=>{const u=Yn.get(l)??0;l.getAttribute("aria-hidden")==="true"&&u===0||(u===0&&l.setAttribute("aria-hidden","true"),r.add(l),Yn.set(l,u+1))};qe.length&&qe[qe.length-1].disconnect(),o(t);const i=new MutationObserver(l=>{for(const u of l)if(!(u.type!=="childList"||u.addedNodes.length===0)&&![...n,...r].some(c=>c.contains(u.target))){for(const c of u.removedNodes)c instanceof Element&&(n.delete(c),r.delete(c));for(const c of u.addedNodes)(c instanceof HTMLElement||c instanceof SVGElement)&&(c.dataset.liveAnnouncer==="true"||c.dataset.reactAriaTopLayer==="true")?n.add(c):c instanceof Element&&o(c)}});i.observe(t,{childList:!0,subtree:!0});const a={observe(){i.observe(t,{childList:!0,subtree:!0})},disconnect(){i.disconnect()}};return qe.push(a),()=>{i.disconnect();for(const l of r){const u=Yn.get(l);if(u==null)return;u===1?(l.removeAttribute("aria-hidden"),Yn.delete(l)):Yn.set(l,u-1)}a===qe[qe.length-1]?(qe.pop(),qe.length&&qe[qe.length-1].observe()):qe.splice(qe.indexOf(a),1)}}function bg(e){const t=n=>{var r;n.key===si.Escape&&((r=e.onEscapeKeyDown)==null||r.call(e,n))};q(()=>{var r;if($(e.isDisabled))return;const n=((r=e.ownerDocument)==null?void 0:r.call(e))??ht();n.addEventListener("keydown",t),W(()=>{n.removeEventListener("keydown",t)})})}var ka="interactOutside.pointerDownOutside",Va="interactOutside.focusOutside";function nc(e,t){let n,r=ag;const o=()=>ht(t()),s=d=>{var f;return(f=e.onPointerDownOutside)==null?void 0:f.call(e,d)},i=d=>{var f;return(f=e.onFocusOutside)==null?void 0:f.call(e,d)},a=d=>{var f;return(f=e.onInteractOutside)==null?void 0:f.call(e,d)},l=d=>{var h;const f=d.target;return!(f instanceof HTMLElement)||f.closest(`[${Qr}]`)||!Ne(o(),f)||Ne(t(),f)?!1:!((h=e.shouldExcludeElement)!=null&&h.call(e,f))},u=d=>{function f(){const h=t(),g=d.target;if(!h||!g||!l(d))return;const p=ve([s,a]);g.addEventListener(ka,p,{once:!0});const m=new CustomEvent(ka,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:d.button===2||Qh(d)&&d.button===0}});g.dispatchEvent(m)}d.pointerType==="touch"?(o().removeEventListener("click",f),r=f,o().addEventListener("click",f,{once:!0})):f()},c=d=>{const f=t(),h=d.target;if(!f||!h||!l(d))return;const g=ve([i,a]);h.addEventListener(Va,g,{once:!0});const p=new CustomEvent(Va,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:!1}});h.dispatchEvent(p)};q(()=>{$(e.isDisabled)||(n=window.setTimeout(()=>{o().addEventListener("pointerdown",u,!0)},0),o().addEventListener("focusin",c,!0),W(()=>{window.clearTimeout(n),o().removeEventListener("click",r),o().removeEventListener("pointerdown",u,!0),o().removeEventListener("focusin",c,!0)}))})}function me(e){const[t,n]=K(e,["as"]);if(!t.as)throw new Error("[kobalte]: Polymorphic is missing the required `as` prop.");return S(pu,A(n,{get component(){return t.as}}))}var rc=Se();function Sg(){return we(rc)}function ci(e){let t;const n=Sg(),[r,o]=K(e,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),s=new Set([]),i=d=>{s.add(d);const f=n==null?void 0:n.registerNestedLayer(d);return()=>{s.delete(d),f==null||f()}};nc({shouldExcludeElement:d=>{var f;return t?((f=r.excludedElements)==null?void 0:f.some(h=>Ne(h(),d)))||[...s].some(h=>Ne(h,d)):!1},onPointerDownOutside:d=>{var f,h,g;!t||ze.isBelowPointerBlockingLayer(t)||!r.bypassTopMostLayerCheck&&!ze.isTopMostLayer(t)||((f=r.onPointerDownOutside)==null||f.call(r,d),(h=r.onInteractOutside)==null||h.call(r,d),d.defaultPrevented||(g=r.onDismiss)==null||g.call(r))},onFocusOutside:d=>{var f,h,g;(f=r.onFocusOutside)==null||f.call(r,d),(h=r.onInteractOutside)==null||h.call(r,d),d.defaultPrevented||(g=r.onDismiss)==null||g.call(r)}},()=>t),bg({ownerDocument:()=>ht(t),onEscapeKeyDown:d=>{var f;!t||!ze.isTopMostLayer(t)||((f=r.onEscapeKeyDown)==null||f.call(r,d),!d.defaultPrevented&&r.onDismiss&&(d.preventDefault(),r.onDismiss()))}}),Cr(()=>{if(!t)return;ze.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const d=n==null?void 0:n.registerNestedLayer(t);ze.assignPointerEventToLayers(),ze.disableBodyPointerEvents(t),W(()=>{t&&(ze.removeLayer(t),d==null||d(),ze.assignPointerEventToLayers(),ze.restoreBodyPointerEvents(t))})}),q(Me([()=>t,()=>r.disableOutsidePointerEvents],([d,f])=>{if(!d)return;const h=ze.find(d);h&&h.isPointerBlocking!==f&&(h.isPointerBlocking=f,ze.assignPointerEventToLayers()),f&&ze.disableBodyPointerEvents(d),W(()=>{ze.restoreBodyPointerEvents(d)})},{defer:!0}));const c={registerNestedLayer:i};return S(rc.Provider,{value:c,get children(){return S(me,A({as:"div",ref(d){var f=be(h=>t=h,r.ref);typeof f=="function"&&f(d)}},o))}})}function gt(e){var i;const[t,n]=z((i=e.defaultValue)==null?void 0:i.call(e)),r=N(()=>{var a;return((a=e.value)==null?void 0:a.call(e))!==void 0}),o=N(()=>{var a;return r()?(a=e.value)==null?void 0:a.call(e):t()});return[o,a=>{Fe(()=>{var u;const l=Vh(a,o());return Object.is(l,o())||(r()||n(l),(u=e.onChange)==null||u.call(e,l)),l})}]}function oc(e){const[t,n]=gt(e);return[()=>t()??!1,n]}function xg(e){const[t,n]=gt(e);return[()=>t()??[],n]}function di(e={}){const[t,n]=oc({value:()=>$(e.open),defaultValue:()=>!!$(e.defaultOpen),onChange:i=>{var a;return(a=e.onOpenChange)==null?void 0:a.call(e,i)}}),r=()=>{n(!0)},o=()=>{n(!1)};return{isOpen:t,setIsOpen:n,open:r,close:o,toggle:()=>{t()?o():r()}}}function io(e,t){const[n,r]=z(Na(t==null?void 0:t()));return q(()=>{var o;r(((o=e())==null?void 0:o.tagName.toLowerCase())||Na(t==null?void 0:t()))}),n}function Na(e){return Sn(e)?e:void 0}var Cg=Object.defineProperty,pn=(e,t)=>{for(var n in t)Cg(e,n,{get:t[n],enumerable:!0})},Eg={};pn(Eg,{Button:()=>Ig,Root:()=>It});var Rg=["button","color","file","image","reset","submit"];function Pg(e){const t=e.tagName.toLowerCase();return t==="button"?!0:t==="input"&&e.type?Rg.indexOf(e.type)!==-1:!1}function It(e){let t;const n=ee({type:"button"},e),[r,o]=K(n,["ref","type","disabled"]),s=io(()=>t,()=>"button"),i=N(()=>{const u=s();return u==null?!1:Pg({tagName:u,type:r.type})}),a=N(()=>s()==="input"),l=N(()=>s()==="a"&&(t==null?void 0:t.getAttribute("href"))!=null);return S(me,A({as:"button",ref(u){var c=be(d=>t=d,r.ref);typeof c=="function"&&c(u)},get type(){return i()||a()?r.type:void 0},get role(){return!i()&&!l()?"button":void 0},get tabIndex(){return!i()&&!l()&&!r.disabled?0:void 0},get disabled(){return i()||a()?r.disabled:void 0},get"aria-disabled"(){return!i()&&!a()&&r.disabled?!0:void 0},get"data-disabled"(){return r.disabled?"":void 0}},o))}var Ig=It;function Ye(e){return t=>(e(t),()=>e(void 0))}var Oe=e=>typeof e=="function"?e():e,As=(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},Tr=new Map,Mg=e=>{q(()=>{const t=Oe(e.style)??{},n=Oe(e.properties)??[],r={};for(const s in t)r[s]=e.element.style[s];const o=Tr.get(e.key);o?o.activeCount++:Tr.set(e.key,{activeCount:1,originalStyles:r,properties:n.map(s=>s.key)}),Object.assign(e.element.style,e.style);for(const s of n)e.element.style.setProperty(s.key,s.value);W(()=>{var i;const s=Tr.get(e.key);if(s){if(s.activeCount!==1){s.activeCount--;return}Tr.delete(e.key);for(const[a,l]of Object.entries(s.originalStyles))e.element.style[a]=l;for(const a of s.properties)e.element.style.removeProperty(a);e.element.style.length===0&&e.element.removeAttribute("style"),(i=e.cleanup)==null||i.call(e)}})})},Ka=Mg,Fg=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},$g=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},Ag=(e,t,n)=>{const r=t==="x"&&window.getComputedStyle(e).direction==="rtl"?-1:1;let o=e,s=0,i=0,a=!1;do{const[l,u,c]=Fg(o,t),d=c-l-r*u;(u!==0||d!==0)&&$g(o,t)&&(s+=d,i+=u),o===(n??document.documentElement)?a=!0:o=o._$host??o.parentElement}while(o&&!a);return[s,i]},[ja,za]=z([]),Og=e=>ja().indexOf(e)===ja().length-1,Tg=e=>{const t=A({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",restoreScrollPosition:!0,allowPinchZoom:!1},e),n=Re();let r=[0,0],o=null,s=null;q(()=>{Oe(t.enabled)&&(za(u=>[...u,n]),W(()=>{za(u=>u.filter(c=>c!==n))}))}),q(()=>{if(!Oe(t.enabled)||!Oe(t.hideScrollbar))return;const{body:u}=document,c=window.innerWidth-u.offsetWidth;if(Oe(t.preventScrollbarShift)){const d={overflow:"hidden"},f=[];c>0&&(Oe(t.preventScrollbarShiftMode)==="padding"?d.paddingRight=`calc(${window.getComputedStyle(u).paddingRight} + ${c}px)`:d.marginRight=`calc(${window.getComputedStyle(u).marginRight} + ${c}px)`,f.push({key:"--scrollbar-width",value:`${c}px`}));const h=window.scrollY,g=window.scrollX;Ka({key:"prevent-scroll",element:u,style:d,properties:f,cleanup:()=>{Oe(t.restoreScrollPosition)&&c>0&&window.scrollTo(g,h)}})}else Ka({key:"prevent-scroll",element:u,style:{overflow:"hidden"}})}),q(()=>{!Og(n)||!Oe(t.enabled)||(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",i,{passive:!1}),document.addEventListener("touchmove",l,{passive:!1}),W(()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",i),document.removeEventListener("touchmove",l)}))});const i=u=>{r=Ba(u),o=null,s=null},a=u=>{const c=u.target,d=Oe(t.element),f=Dg(u),h=Math.abs(f[0])>Math.abs(f[1])?"x":"y",g=h==="x"?f[0]:f[1],p=Ga(c,h,g,d);let m;d&&As(d,c)?m=!p:m=!0,m&&u.cancelable&&u.preventDefault()},l=u=>{const c=Oe(t.element),d=u.target;let f;if(u.touches.length===2)f=!Oe(t.allowPinchZoom);else{if(o==null||s===null){const h=Ba(u).map((p,m)=>r[m]-p),g=Math.abs(h[0])>Math.abs(h[1])?"x":"y";o=g,s=g==="x"?h[0]:h[1]}if(d.type==="range")f=!1;else{const h=Ga(d,o,s,c);c&&As(c,d)?f=!h:f=!0}}f&&u.cancelable&&u.preventDefault()}},Dg=e=>[e.deltaX,e.deltaY],Ba=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],Ga=(e,t,n,r)=>{const o=r!==null&&As(r,e),[s,i]=Ag(e,t,o?r:void 0);return!(n>0&&Math.abs(s)<=1||n<0&&Math.abs(i)<1)},Lg=Tg,sc=Lg,_g=e=>{const t=N(()=>{const i=Oe(e.element);if(i)return getComputedStyle(i)}),n=()=>{var i;return((i=t())==null?void 0:i.animationName)??"none"},[r,o]=z(Oe(e.show)?"present":"hidden");let s="none";return q(i=>{const a=Oe(e.show);return Fe(()=>{var c;if(i===a)return a;const l=s,u=n();a?o("present"):u==="none"||((c=t())==null?void 0:c.display)==="none"?o("hidden"):o(i===!0&&l!==u?"hiding":"hidden")}),a}),q(()=>{const i=Oe(e.element);if(!i)return;const a=u=>{u.target===i&&(s=n())},l=u=>{const d=n().includes(u.animationName);u.target===i&&d&&r()==="hiding"&&o("hidden")};i.addEventListener("animationstart",a),i.addEventListener("animationcancel",l),i.addEventListener("animationend",l),W(()=>{i.removeEventListener("animationstart",a),i.removeEventListener("animationcancel",l),i.removeEventListener("animationend",l)})}),{present:()=>r()==="present"||r()==="hiding",state:r,setState:o}},kg=_g,Yr=kg,Vg={};pn(Vg,{CloseButton:()=>fi,Content:()=>hi,Description:()=>gi,Dialog:()=>Ng,Overlay:()=>pi,Portal:()=>mi,Root:()=>yi,Title:()=>vi,Trigger:()=>ac});var ic=Se();function mn(){const e=we(ic);if(e===void 0)throw new Error("[kobalte]: `useDialogContext` must be used within a `Dialog` component");return e}function fi(e){const t=mn(),[n,r]=K(e,["aria-label","onClick"]);return S(It,A({get"aria-label"(){return n["aria-label"]||t.translations().dismiss},onClick:s=>{ce(s,n.onClick),t.close()}},r))}function hi(e){let t;const n=mn(),r=ee({id:n.generateId("content")},e),[o,s]=K(r,["ref","onOpenAutoFocus","onCloseAutoFocus","onPointerDownOutside","onFocusOutside","onInteractOutside"]);let i=!1,a=!1;const l=f=>{var h;(h=o.onPointerDownOutside)==null||h.call(o,f),n.modal()&&f.detail.isContextMenu&&f.preventDefault()},u=f=>{var h;(h=o.onFocusOutside)==null||h.call(o,f),n.modal()&&f.preventDefault()},c=f=>{var h;(h=o.onInteractOutside)==null||h.call(o,f),!n.modal()&&(f.defaultPrevented||(i=!0,f.detail.originalEvent.type==="pointerdown"&&(a=!0)),Ne(n.triggerRef(),f.target)&&f.preventDefault(),f.detail.originalEvent.type==="focusin"&&a&&f.preventDefault())},d=f=>{var h;(h=o.onCloseAutoFocus)==null||h.call(o,f),n.modal()?(f.preventDefault(),Ie(n.triggerRef())):(f.defaultPrevented||(i||Ie(n.triggerRef()),f.preventDefault()),i=!1,a=!1)};return tc({isDisabled:()=>!(n.isOpen()&&n.modal()),targets:()=>t?[t]:[]}),sc({element:()=>t??null,enabled:()=>n.contentPresent()&&n.preventScroll()}),ec({trapFocus:()=>n.isOpen()&&n.modal(),onMountAutoFocus:o.onOpenAutoFocus,onUnmountAutoFocus:d},()=>t),q(()=>W(n.registerContentId(s.id))),S(Ce,{get when(){return n.contentPresent()},get children(){return S(ci,A({ref(f){var h=be(g=>{n.setContentRef(g),t=g},o.ref);typeof h=="function"&&h(f)},role:"dialog",tabIndex:-1,get disableOutsidePointerEvents(){return N(()=>!!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:u,onInteractOutside:c,get onDismiss(){return n.close}},s))}})}function gi(e){const t=mn(),n=ee({id:t.generateId("description")},e),[r,o]=K(n,["id"]);return q(()=>W(t.registerDescriptionId(r.id))),S(me,A({as:"p",get id(){return r.id}},o))}function pi(e){const t=mn(),[n,r]=K(e,["ref","style","onPointerDown"]),o=s=>{ce(s,n.onPointerDown),s.target===s.currentTarget&&s.preventDefault()};return S(Ce,{get when(){return t.overlayPresent()},get children(){return S(me,A({as:"div",ref(s){var i=be(t.setOverlayRef,n.ref);typeof i=="function"&&i(s)},get style(){return gn({"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 mi(e){const t=mn();return S(Ce,{get when(){return t.contentPresent()||t.overlayPresent()},get children(){return S(gu,e)}})}var Ha={dismiss:"Dismiss"};function yi(e){const t=`dialog-${Re()}`,n=ee({id:t,modal:!0,translations:Ha},e),[r,o]=z(),[s,i]=z(),[a,l]=z(),[u,c]=z(),[d,f]=z(),[h,g]=z(),p=di({open:()=>n.open,defaultOpen:()=>n.defaultOpen,onOpenChange:b=>{var C;return(C=n.onOpenChange)==null?void 0:C.call(n,b)}}),m=()=>n.forceMount||p.isOpen(),{present:w}=Yr({show:m,element:()=>u()??null}),{present:y}=Yr({show:m,element:()=>d()??null}),v={translations:()=>n.translations??Ha,isOpen:p.isOpen,modal:()=>n.modal??!0,preventScroll:()=>n.preventScroll??v.modal(),contentId:r,titleId:s,descriptionId:a,triggerRef:h,overlayRef:u,setOverlayRef:c,contentRef:d,setContentRef:f,overlayPresent:w,contentPresent:y,close:p.close,toggle:p.toggle,setTriggerRef:g,generateId:Wt(()=>n.id),registerContentId:Ye(o),registerTitleId:Ye(i),registerDescriptionId:Ye(l)};return S(ic.Provider,{value:v,get children(){return n.children}})}function vi(e){const t=mn(),n=ee({id:t.generateId("title")},e),[r,o]=K(n,["id"]);return q(()=>W(t.registerTitleId(r.id))),S(me,A({as:"h2",get id(){return r.id}},o))}function ac(e){const t=mn(),[n,r]=K(e,["ref","onClick"]);return S(It,A({ref(s){var i=be(t.setTriggerRef,n.ref);typeof i=="function"&&i(s)},"aria-haspopup":"dialog",get"aria-expanded"(){return t.isOpen()},get"aria-controls"(){return N(()=>!!t.isOpen())()?t.contentId():void 0},get"data-expanded"(){return t.isOpen()?"":void 0},get"data-closed"(){return t.isOpen()?void 0:""},onClick:s=>{ce(s,n.onClick),t.toggle()}},r))}var Ng=Object.assign(yi,{CloseButton:fi,Content:hi,Description:gi,Overlay:pi,Portal:mi,Title:vi,Trigger:ac});function lc(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=lc(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function Kg(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=lc(e))&&(r&&(r+=" "),r+=t);return r}const Ua=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,qa=Kg,ao=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return qa(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(u=>{const c=n==null?void 0:n[u],d=s==null?void 0:s[u];if(c===null)return null;const f=Ua(c)||Ua(d);return o[u][f]}),a=n&&Object.entries(n).reduce((u,c)=>{let[d,f]=c;return f===void 0||(u[d]=f),u},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,c)=>{let{class:d,className:f,...h}=c;return Object.entries(h).every(g=>{let[p,m]=g;return Array.isArray(m)?m.includes({...s,...a}[p]):{...s,...a}[p]===m})?[...u,d,f]:u},[]);return qa(e,i,l,n==null?void 0:n.class,n==null?void 0:n.className)};function uc(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=uc(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function jg(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=uc(e))&&(r&&(r+=" "),r+=t);return r}const wi="-",zg=e=>{const t=Gg(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const a=i.split(wi);return a[0]===""&&a.length!==1&&a.shift(),cc(a,t)||Bg(i)},getConflictingClassGroupIds:(i,a)=>{const l=n[i]||[];return a&&r[i]?[...l,...r[i]]:l}}},cc=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?cc(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(wi);return(i=t.validators.find(({validator:a})=>a(s)))==null?void 0:i.classGroupId},Wa=/^\[(.+)\]$/,Bg=e=>{if(Wa.test(e)){const t=Wa.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Gg=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Ug(Object.entries(e.classGroups),n).forEach(([s,i])=>{Os(i,r,s,t)}),r},Os=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:Xa(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(Hg(o)){Os(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{Os(i,Xa(t,s),n,r)})})},Xa=(e,t)=>{let n=e;return t.split(wi).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Hg=e=>e.isThemeGetter,Ug=(e,t)=>t?e.map(([n,r])=>{const o=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([i,a])=>[t+i,a])):s);return[n,o]}):e,qg=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(s,i)=>{n.set(s,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let i=n.get(s);if(i!==void 0)return i;if((i=r.get(s))!==void 0)return o(s,i),i},set(s,i){n.has(s)?n.set(s,i):o(s,i)}}},dc="!",Wg=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],s=t.length,i=a=>{const l=[];let u=0,c=0,d;for(let m=0;m<a.length;m++){let w=a[m];if(u===0){if(w===o&&(r||a.slice(m,m+s)===t)){l.push(a.slice(c,m)),c=m+s;continue}if(w==="/"){d=m;continue}}w==="["?u++:w==="]"&&u--}const f=l.length===0?a:a.substring(c),h=f.startsWith(dc),g=h?f.substring(1):f,p=d&&d>c?d-c:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:g,maybePostfixModifierPosition:p}};return n?a=>n({className:a,parseClassName:i}):i},Xg=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},Qg=e=>({cache:qg(e.cacheSize),parseClassName:Wg(e),...zg(e)}),Yg=/\s+/,Zg=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,s=[],i=e.trim().split(Yg);let a="";for(let l=i.length-1;l>=0;l-=1){const u=i[l],{modifiers:c,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:h}=n(u);let g=!!h,p=r(g?f.substring(0,h):f);if(!p){if(!g){a=u+(a.length>0?" "+a:a);continue}if(p=r(f),!p){a=u+(a.length>0?" "+a:a);continue}g=!1}const m=Xg(c).join(":"),w=d?m+dc:m,y=w+p;if(s.includes(y))continue;s.push(y);const v=o(p,g);for(let b=0;b<v.length;++b){const C=v[b];s.push(w+C)}a=u+(a.length>0?" "+a:a)}return a};function Jg(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=fc(t))&&(r&&(r+=" "),r+=n);return r}const fc=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=fc(e[r]))&&(n&&(n+=" "),n+=t);return n};function ep(e,...t){let n,r,o,s=i;function i(l){const u=t.reduce((c,d)=>d(c),e());return n=Qg(u),r=n.cache.get,o=n.cache.set,s=a,a(l)}function a(l){const u=r(l);if(u)return u;const c=Zg(l,n);return o(l,c),c}return function(){return s(Jg.apply(null,arguments))}}const ye=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},hc=/^\[(?:([a-z-]+):)?(.+)\]$/i,tp=/^\d+\/\d+$/,np=new Set(["px","full","screen"]),rp=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,op=/\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$/,sp=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,ip=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ap=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,wt=e=>Rn(e)||np.has(e)||tp.test(e),$t=e=>Bn(e,"length",pp),Rn=e=>!!e&&!Number.isNaN(Number(e)),Fo=e=>Bn(e,"number",Rn),Zn=e=>!!e&&Number.isInteger(Number(e)),lp=e=>e.endsWith("%")&&Rn(e.slice(0,-1)),ne=e=>hc.test(e),At=e=>rp.test(e),up=new Set(["length","size","percentage"]),cp=e=>Bn(e,up,gc),dp=e=>Bn(e,"position",gc),fp=new Set(["image","url"]),hp=e=>Bn(e,fp,yp),gp=e=>Bn(e,"",mp),Jn=()=>!0,Bn=(e,t,n)=>{const r=hc.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},pp=e=>op.test(e)&&!sp.test(e),gc=()=>!1,mp=e=>ip.test(e),yp=e=>ap.test(e),vp=()=>{const e=ye("colors"),t=ye("spacing"),n=ye("blur"),r=ye("brightness"),o=ye("borderColor"),s=ye("borderRadius"),i=ye("borderSpacing"),a=ye("borderWidth"),l=ye("contrast"),u=ye("grayscale"),c=ye("hueRotate"),d=ye("invert"),f=ye("gap"),h=ye("gradientColorStops"),g=ye("gradientColorStopPositions"),p=ye("inset"),m=ye("margin"),w=ye("opacity"),y=ye("padding"),v=ye("saturate"),b=ye("scale"),C=ye("sepia"),O=ye("skew"),D=ye("space"),_=ye("translate"),T=()=>["auto","contain","none"],k=()=>["auto","hidden","clip","visible","scroll"],V=()=>["auto",ne,t],j=()=>[ne,t],re=()=>["",wt,$t],P=()=>["auto",Rn,ne],R=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],E=()=>["solid","dashed","dotted","double","none"],I=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],M=()=>["start","end","center","between","around","evenly","stretch"],F=()=>["","0",ne],L=()=>["auto","avoid","all","avoid-page","page","left","right","column"],B=()=>[Rn,ne];return{cacheSize:500,separator:":",theme:{colors:[Jn],spacing:[wt,$t],blur:["none","",At,ne],brightness:B(),borderColor:[e],borderRadius:["none","","full",At,ne],borderSpacing:j(),borderWidth:re(),contrast:B(),grayscale:F(),hueRotate:B(),invert:F(),gap:j(),gradientColorStops:[e],gradientColorStopPositions:[lp,$t],inset:V(),margin:V(),opacity:B(),padding:j(),saturate:B(),scale:B(),sepia:F(),skew:B(),space:j(),translate:j()},classGroups:{aspect:[{aspect:["auto","square","video",ne]}],container:["container"],columns:[{columns:[At]}],"break-after":[{"break-after":L()}],"break-before":[{"break-before":L()}],"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:[...R(),ne]}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Zn,ne]}],basis:[{basis:V()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ne]}],grow:[{grow:F()}],shrink:[{shrink:F()}],order:[{order:["first","last","none",Zn,ne]}],"grid-cols":[{"grid-cols":[Jn]}],"col-start-end":[{col:["auto",{span:["full",Zn,ne]},ne]}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":[Jn]}],"row-start-end":[{row:["auto",{span:[Zn,ne]},ne]}],"row-start":[{"row-start":P()}],"row-end":[{"row-end":P()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ne]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ne]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...M()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...M(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...M(),"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:[m]}],mx:[{mx:[m]}],my:[{my:[m]}],ms:[{ms:[m]}],me:[{me:[m]}],mt:[{mt:[m]}],mr:[{mr:[m]}],mb:[{mb:[m]}],ml:[{ml:[m]}],"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",ne,t]}],"min-w":[{"min-w":[ne,t,"min","max","fit"]}],"max-w":[{"max-w":[ne,t,"none","full","min","max","fit","prose",{screen:[At]},At]}],h:[{h:[ne,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ne,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ne,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ne,t,"auto","min","max","fit"]}],"font-size":[{text:["base",At,$t]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Fo]}],"font-family":[{font:[Jn]}],"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",ne]}],"line-clamp":[{"line-clamp":["none",Rn,Fo]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",wt,ne]}],"list-image":[{"list-image":["none",ne]}],"list-style-type":[{list:["none","disc","decimal",ne]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...E(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",wt,$t]}],"underline-offset":[{"underline-offset":["auto",wt,ne]}],"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:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ne]}],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",ne]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...R(),dp]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",cp]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},hp]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"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":[w]}],"border-style":[{border:[...E(),"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":[w]}],"divide-style":[{divide:E()}],"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:["",...E()]}],"outline-offset":[{"outline-offset":[wt,ne]}],"outline-w":[{outline:[wt,$t]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[wt,$t]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",At,gp]}],"shadow-color":[{shadow:[Jn]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":[...I(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":I()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",At,ne]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[d]}],saturate:[{saturate:[v]}],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":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[v]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ne]}],duration:[{duration:B()}],ease:[{ease:["linear","in","out","in-out",ne]}],delay:[{delay:B()}],animate:[{animate:["none","spin","ping","pulse","bounce",ne]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[Zn,ne]}],"translate-x":[{"translate-x":[_]}],"translate-y":[{"translate-y":[_]}],"skew-x":[{"skew-x":[O]}],"skew-y":[{"skew-y":[O]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ne]}],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",ne]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"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",ne]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[wt,$t,Fo]}],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"]}}},wp=ep(vp);function pe(...e){return wp(jg(e))}const bp=e=>new Promise(t=>setTimeout(t,e));var pc=he("<div>"),Sp=he('<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">'),xp=he("<span class=sr-only>Close");const Cp=yi,Ep=ao("fixed inset-0 z-50 flex",{variants:{position:{top:"items-start",bottom:"items-end",left:"justify-start",right:"justify-end"}},defaultVariants:{position:"right"}}),Rp=e=>{const[t,n]=K(e,["position","children"]);return S(mi,A(n,{get children(){var r=pc();return fe(r,()=>t.children),Ke(()=>fu(r,Ep({position:t.position}))),r}}))},Pp=e=>{const[t,n]=K(e,["class"]);return S(pi,A({get class(){return pe("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))},Ip=ao("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"}}),Mp=e=>{const[t,n]=K(e,["position","class","children"]);return S(Rp,{get position(){return t.position},get children(){return[S(Pp,{}),S(hi,A({get class(){return pe(Ip({position:t.position}),t.class,"max-h-screen overflow-y-auto")}},n,{get children(){return[N(()=>t.children),S(fi,{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[Sp(),xp()]}})]}}))]}})},Fp=e=>{const[t,n]=K(e,["class"]);return(()=>{var r=pc();return ot(r,A({get class(){return pe("flex flex-col space-y-2 text-center sm:text-left",t.class)}},n),!1,!1),r})()},$p=e=>{const[t,n]=K(e,["class"]);return S(vi,A({get class(){return pe("text-lg font-semibold text-foreground",t.class)}},n))},Ap=e=>{const[t,n]=K(e,["class"]);return S(gi,A({get class(){return pe("text-sm text-muted-foreground",t.class)}},n))};var Op=(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},Tp=(e,t,n)=>(t=encodeURIComponent(t),Op(e,t,n)),Dp=(e,t)=>(e=e.replace(/\/+$/,""),e=e+"/",t=t.replace(/^\/+/,""),e+t),Ts=(e,t)=>{for(const[n,r]of Object.entries(t)){const o=new RegExp("/:"+n+"(?:{[^/]+})?\\??");e=e.replace(o,r?`/${r}`:"")}return e},Lp=(e,t)=>{switch(t){case"ws":return e.replace(/^http/,"ws");case"http":return e.replace(/^ws/,"http")}},_p=e=>/^https?:\/\/[^\/]+?\/index$/.test(e)?e.replace(/\/index$/,"/"):e.replace(/\/index$/,"");function Dr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function mc(e,t){if(!Dr(e)&&!Dr(t))return t;const n={...e};for(const r in t){const o=t[r];Dr(n[r])&&Dr(o)?n[r]=mc(n[r],o):n[r]=o}return n}var yc=(e,t)=>new Proxy(()=>{},{get(r,o){if(!(typeof o!="string"||o==="then"))return yc(e,[...t,o])},apply(r,o,s){return e({path:t,args:s})}}),kp=class{constructor(e,t){le(this,"url");le(this,"method");le(this,"queryParams");le(this,"pathParams",{});le(this,"rBody");le(this,"cType");le(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 u of l)this.queryParams.append(a,u);else this.queryParams.set(a,l)}if(e.form){const a=new FormData;for(const[l,u]of Object.entries(e.form))if(Array.isArray(u))for(const c of u)a.append(l,c);else a.append(l,u);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,u]of Object.entries(e.cookie))a.push(Tp(l,u,{path:"/"}));r.Cookie=a.join(",")}this.cType&&(r["Content-Type"]=this.cType);const o=new Headers(r);let s=this.url;s=_p(s),s=Ts(s,this.pathParams),this.queryParams&&(s=s+"?"+this.queryParams.toString()),n=this.method.toUpperCase();const i=!(n==="GET"||n==="HEAD");return((t==null?void 0:t.fetch)||fetch)(s,{body:i?this.rBody:void 0,method:n,headers:o,...t==null?void 0:t.init})});this.url=e,this.method=t}},Vp=(e,t)=>yc(function n(r){var u;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 s="";if(/^\$/.test(o[o.length-1])){const c=o.pop();c&&(s=c.replace(/^\$/,""))}const i=o.join("/"),a=Dp(e,i);if(s==="url")return r.args[0]&&r.args[0].param?new URL(Ts(a,r.args[0].param)):new URL(a);if(s==="ws"){const c=Lp(r.args[0]&&r.args[0].param?Ts(a,r.args[0].param):a,"ws"),d=new URL(c),f=(u=r.args[0])==null?void 0:u.query;return f&&Object.entries(f).forEach(([g,p])=>{Array.isArray(p)?p.forEach(m=>d.searchParams.append(g,m)):d.searchParams.set(g,p)}),((...g)=>(t==null?void 0:t.webSocket)!==void 0&&typeof t.webSocket=="function"?t.webSocket(...g):new WebSocket(...g))(d.toString())}const l=new kp(a,s);if(s){t??(t={});const c=mc(t,{...r.args[1]??{}});return l.fetch(r.args[0],c)}return l},[]);const lo=Vp("/rpc"),Np=()=>oi(()=>({queryKey:["getBundles"],queryFn:()=>lo.getBundles.$get().then(e=>e.json()),staleTime:Number.POSITIVE_INFINITY})),Kp=()=>oi(()=>({queryKey:["getConfig"],queryFn:()=>lo.getConfig.$get().then(e=>e.json()),staleTime:Number.POSITIVE_INFINITY})),jp=e=>oi(()=>({queryKey:["getBundle",e],queryFn:()=>lo.getBundleById.$get({query:{bundleId:e}}).then(t=>t.json()),staleTime:Number.POSITIVE_INFINITY})),zp=e=>{const t=e.split("-").join("").slice(0,12);return Number.parseInt(t,16)};function vc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Gr={exports:{}},Bp=Gr.exports,Qa;function Gp(){return Qa||(Qa=1,function(e,t){(function(n,r){e.exports=r()})(Bp,function(){var n=1e3,r=6e4,o=36e5,s="millisecond",i="second",a="minute",l="hour",u="day",c="week",d="month",f="quarter",h="year",g="date",p="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,w=/\[([^\]]+)]|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(P){var R=["th","st","nd","rd"],E=P%100;return"["+P+(R[(E-20)%10]||R[E]||R[0])+"]"}},v=function(P,R,E){var I=String(P);return!I||I.length>=R?P:""+Array(R+1-I.length).join(E)+P},b={s:v,z:function(P){var R=-P.utcOffset(),E=Math.abs(R),I=Math.floor(E/60),M=E%60;return(R<=0?"+":"-")+v(I,2,"0")+":"+v(M,2,"0")},m:function P(R,E){if(R.date()<E.date())return-P(E,R);var I=12*(E.year()-R.year())+(E.month()-R.month()),M=R.clone().add(I,d),F=E-M<0,L=R.clone().add(I+(F?-1:1),d);return+(-(I+(E-M)/(F?M-L:L-M))||0)},a:function(P){return P<0?Math.ceil(P)||0:Math.floor(P)},p:function(P){return{M:d,y:h,w:c,d:u,D:g,h:l,m:a,s:i,ms:s,Q:f}[P]||String(P||"").toLowerCase().replace(/s$/,"")},u:function(P){return P===void 0}},C="en",O={};O[C]=y;var D="$isDayjsObject",_=function(P){return P instanceof j||!(!P||!P[D])},T=function P(R,E,I){var M;if(!R)return C;if(typeof R=="string"){var F=R.toLowerCase();O[F]&&(M=F),E&&(O[F]=E,M=F);var L=R.split("-");if(!M&&L.length>1)return P(L[0])}else{var B=R.name;O[B]=R,M=B}return!I&&M&&(C=M),M||!I&&C},k=function(P,R){if(_(P))return P.clone();var E=typeof R=="object"?R:{};return E.date=P,E.args=arguments,new j(E)},V=b;V.l=T,V.i=_,V.w=function(P,R){return k(P,{locale:R.$L,utc:R.$u,x:R.$x,$offset:R.$offset})};var j=function(){function P(E){this.$L=T(E.locale,null,!0),this.parse(E),this.$x=this.$x||E.x||{},this[D]=!0}var R=P.prototype;return R.parse=function(E){this.$d=function(I){var M=I.date,F=I.utc;if(M===null)return new Date(NaN);if(V.u(M))return new Date;if(M instanceof Date)return new Date(M);if(typeof M=="string"&&!/Z$/i.test(M)){var L=M.match(m);if(L){var B=L[2]-1||0,H=(L[7]||"0").substring(0,3);return F?new Date(Date.UTC(L[1],B,L[3]||1,L[4]||0,L[5]||0,L[6]||0,H)):new Date(L[1],B,L[3]||1,L[4]||0,L[5]||0,L[6]||0,H)}}return new Date(M)}(E),this.init()},R.init=function(){var E=this.$d;this.$y=E.getFullYear(),this.$M=E.getMonth(),this.$D=E.getDate(),this.$W=E.getDay(),this.$H=E.getHours(),this.$m=E.getMinutes(),this.$s=E.getSeconds(),this.$ms=E.getMilliseconds()},R.$utils=function(){return V},R.isValid=function(){return this.$d.toString()!==p},R.isSame=function(E,I){var M=k(E);return this.startOf(I)<=M&&M<=this.endOf(I)},R.isAfter=function(E,I){return k(E)<this.startOf(I)},R.isBefore=function(E,I){return this.endOf(I)<k(E)},R.$g=function(E,I,M){return V.u(E)?this[I]:this.set(M,E)},R.unix=function(){return Math.floor(this.valueOf()/1e3)},R.valueOf=function(){return this.$d.getTime()},R.startOf=function(E,I){var M=this,F=!!V.u(I)||I,L=V.p(E),B=function(Pe,Ee){var Ft=V.w(M.$u?Date.UTC(M.$y,Ee,Pe):new Date(M.$y,Ee,Pe),M);return F?Ft:Ft.endOf(u)},H=function(Pe,Ee){return V.w(M.toDate()[Pe].apply(M.toDate("s"),(F?[0,0,0,0]:[23,59,59,999]).slice(Ee)),M)},Z=this.$W,ue=this.$M,se=this.$D,je="set"+(this.$u?"UTC":"");switch(L){case h:return F?B(1,0):B(31,11);case d:return F?B(1,ue):B(0,ue+1);case c:var vt=this.$locale().weekStart||0,te=(Z<vt?Z+7:Z)-vt;return B(F?se-te:se+(6-te),ue);case u:case g:return H(je+"Hours",0);case l:return H(je+"Minutes",1);case a:return H(je+"Seconds",2);case i:return H(je+"Milliseconds",3);default:return this.clone()}},R.endOf=function(E){return this.startOf(E,!1)},R.$set=function(E,I){var M,F=V.p(E),L="set"+(this.$u?"UTC":""),B=(M={},M[u]=L+"Date",M[g]=L+"Date",M[d]=L+"Month",M[h]=L+"FullYear",M[l]=L+"Hours",M[a]=L+"Minutes",M[i]=L+"Seconds",M[s]=L+"Milliseconds",M)[F],H=F===u?this.$D+(I-this.$W):I;if(F===d||F===h){var Z=this.clone().set(g,1);Z.$d[B](H),Z.init(),this.$d=Z.set(g,Math.min(this.$D,Z.daysInMonth())).$d}else B&&this.$d[B](H);return this.init(),this},R.set=function(E,I){return this.clone().$set(E,I)},R.get=function(E){return this[V.p(E)]()},R.add=function(E,I){var M,F=this;E=Number(E);var L=V.p(I),B=function(ue){var se=k(F);return V.w(se.date(se.date()+Math.round(ue*E)),F)};if(L===d)return this.set(d,this.$M+E);if(L===h)return this.set(h,this.$y+E);if(L===u)return B(1);if(L===c)return B(7);var H=(M={},M[a]=r,M[l]=o,M[i]=n,M)[L]||1,Z=this.$d.getTime()+E*H;return V.w(Z,this)},R.subtract=function(E,I){return this.add(-1*E,I)},R.format=function(E){var I=this,M=this.$locale();if(!this.isValid())return M.invalidDate||p;var F=E||"YYYY-MM-DDTHH:mm:ssZ",L=V.z(this),B=this.$H,H=this.$m,Z=this.$M,ue=M.weekdays,se=M.months,je=M.meridiem,vt=function(Ee,Ft,Xn,Mr){return Ee&&(Ee[Ft]||Ee(I,F))||Xn[Ft].slice(0,Mr)},te=function(Ee){return V.s(B%12||12,Ee,"0")},Pe=je||function(Ee,Ft,Xn){var Mr=Ee<12?"AM":"PM";return Xn?Mr.toLowerCase():Mr};return F.replace(w,function(Ee,Ft){return Ft||function(Xn){switch(Xn){case"YY":return String(I.$y).slice(-2);case"YYYY":return V.s(I.$y,4,"0");case"M":return Z+1;case"MM":return V.s(Z+1,2,"0");case"MMM":return vt(M.monthsShort,Z,se,3);case"MMMM":return vt(se,Z);case"D":return I.$D;case"DD":return V.s(I.$D,2,"0");case"d":return String(I.$W);case"dd":return vt(M.weekdaysMin,I.$W,ue,2);case"ddd":return vt(M.weekdaysShort,I.$W,ue,3);case"dddd":return ue[I.$W];case"H":return String(B);case"HH":return V.s(B,2,"0");case"h":return te(1);case"hh":return te(2);case"a":return Pe(B,H,!0);case"A":return Pe(B,H,!1);case"m":return String(H);case"mm":return V.s(H,2,"0");case"s":return String(I.$s);case"ss":return V.s(I.$s,2,"0");case"SSS":return V.s(I.$ms,3,"0");case"Z":return L}return null}(Ee)||L.replace(":","")})},R.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},R.diff=function(E,I,M){var F,L=this,B=V.p(I),H=k(E),Z=(H.utcOffset()-this.utcOffset())*r,ue=this-H,se=function(){return V.m(L,H)};switch(B){case h:F=se()/12;break;case d:F=se();break;case f:F=se()/3;break;case c:F=(ue-Z)/6048e5;break;case u:F=(ue-Z)/864e5;break;case l:F=ue/o;break;case a:F=ue/r;break;case i:F=ue/n;break;default:F=ue}return M?F:V.a(F)},R.daysInMonth=function(){return this.endOf(d).$D},R.$locale=function(){return O[this.$L]},R.locale=function(E,I){if(!E)return this.$L;var M=this.clone(),F=T(E,I,!0);return F&&(M.$L=F),M},R.clone=function(){return V.w(this.$d,this)},R.toDate=function(){return new Date(this.valueOf())},R.toJSON=function(){return this.isValid()?this.toISOString():null},R.toISOString=function(){return this.$d.toISOString()},R.toString=function(){return this.$d.toUTCString()},P}(),re=j.prototype;return k.prototype=re,[["$ms",s],["$s",i],["$m",a],["$H",l],["$W",u],["$M",d],["$y",h],["$D",g]].forEach(function(P){re[P[1]]=function(R){return this.$g(R,P[0],P[1])}}),k.extend=function(P,R){return P.$i||(P(R,j,k),P.$i=!0),k},k.locale=T,k.isDayjs=_,k.unix=function(P){return k(1e3*P)},k.en=O[C],k.Ls=O,k.p={},k})}(Gr)),Gr.exports}var Hp=Gp();const Up=vc(Hp);/**
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 qp={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=qp,Wp=he("<svg>"),Xp=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Qp=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),Yp=e=>{const[t,n]=K(e,["color","size","strokeWidth","children","class","name","iconNode","absoluteStrokeWidth"]);return(()=>{var r=Wp();return ot(r,A(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 N(()=>!!t.absoluteStrokeWidth)()?Number(t.strokeWidth??wn["stroke-width"])*24/Number(t.size):Number(t.strokeWidth??wn["stroke-width"])},get class(){return Qp("lucide","lucide-icon",t.name!=null?`lucide-${Xp(t==null?void 0:t.name)}`:void 0,t.class!=null?t.class:"")}},n),!0,!0),fe(r,S(Kt,{get each(){return t.iconNode},children:([o,s])=>S(pu,A({component:o},s))})),r})()},bi=Yp,Zp=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Jp=e=>S(bi,A(e,{name:"Check",iconNode:Zp})),Ya=Jp,em=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],tm=e=>S(bi,A(e,{name:"LoaderCircle",iconNode:em})),nm=tm,rm=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],om=e=>S(bi,A(e,{name:"X",iconNode:rm})),Za=om,Lr=he('<div class="flex flex-row items-center">');const sm=[{accessorKey:"id",header:"ID",cell:e=>e.getValue()},{accessorKey:"platform",header:"Platform",cell:e=>{switch(e.getValue()){case"ios":return"iOS";case"android":return"Android"}}},{accessorKey:"targetAppVersion",header:"Target App Version",cell:e=>e.getValue()},{accessorKey:"enabled",header:"Enabled",cell:e=>e.getValue()?(()=>{var t=Lr();return fe(t,S(Ya,{})),t})():(()=>{var t=Lr();return fe(t,S(Za,{})),t})()},{accessorKey:"shouldForceUpdate",header:"Force Update",cell:e=>e.getValue()?(()=>{var t=Lr();return fe(t,S(Ya,{})),t})():(()=>{var t=Lr();return fe(t,S(Za,{})),t})()},{accessorKey:"message",header:"Message",cell:e=>e.getValue()},{accessorKey:"id",header:"Created At",cell:e=>Up(zp(String(e.getValue()))).format("YYYY-MM-DD HH:mm:ss")}];function im(e){const[t,n]=z(0),[r,o]=z(0);q(()=>{const a=e();if(!a)return;i(a);const l=new ResizeObserver(s);l.observe(a),W(()=>{l.disconnect()})});const s=a=>{for(const l of a)l.target===e()&&i(l.target)},i=a=>{o(a.offsetWidth),n(a.offsetHeight)};return{width:r,height:t}}var am=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),lm=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function um(e){if(Intl.Locale){const n=new Intl.Locale(e).maximize().script??"";return am.has(n)}const t=e.split("-")[0];return lm.has(t)}function cm(e){return um(e)?"rtl":"ltr"}function wc(){let e=typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction:cm(e)}}var Ds=wc(),ir=new Set;function Ja(){Ds=wc();for(const e of ir)e(Ds)}function dm(){const[e,t]=z(Ds),n=N(()=>e());return Cr(()=>{ir.size===0&&window.addEventListener("languagechange",Ja),ir.add(t),W(()=>{ir.delete(t),ir.size===0&&window.removeEventListener("languagechange",Ja)})}),{locale:()=>n().locale,direction:()=>n().direction}}var fm=Se();function Xt(){const e=dm();return we(fm)||e}var $o=new Map;function hm(e){const{locale:t}=Xt(),n=N(()=>t()+Object.entries(e).sort((r,o)=>r[0]<o[0]?-1:1).join());return N(()=>{const r=n();let o;return $o.has(r)&&(o=$o.get(r)),o||(o=new Intl.Collator(t(),e),$o.set(r,o)),o})}const gm=["top","right","bottom","left"],Gt=Math.min,Be=Math.max,Zr=Math.round,_r=Math.floor,ft=e=>({x:e,y:e}),pm={left:"right",right:"left",bottom:"top",top:"bottom"},mm={start:"end",end:"start"};function Ls(e,t,n){return Be(e,Gt(t,n))}function yn(e,t){return typeof e=="function"?e(t):e}function Ht(e){return e.split("-")[0]}function Gn(e){return e.split("-")[1]}function bc(e){return e==="x"?"y":"x"}function Si(e){return e==="y"?"height":"width"}function dn(e){return["top","bottom"].includes(Ht(e))?"y":"x"}function xi(e){return bc(dn(e))}function ym(e,t,n){n===void 0&&(n=!1);const r=Gn(e),o=xi(e),s=Si(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Jr(i)),[i,Jr(i)]}function vm(e){const t=Jr(e);return[_s(e),t,_s(t)]}function _s(e){return e.replace(/start|end/g,t=>mm[t])}function wm(e,t,n){const r=["left","right"],o=["right","left"],s=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?s:i;default:return[]}}function bm(e,t,n,r){const o=Gn(e);let s=wm(Ht(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(_s)))),s}function Jr(e){return e.replace(/left|right|bottom|top/g,t=>pm[t])}function Sm(e){return{top:0,right:0,bottom:0,left:0,...e}}function Sc(e){return typeof e!="number"?Sm(e):{top:e,right:e,bottom:e,left:e}}function eo(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 el(e,t,n){let{reference:r,floating:o}=e;const s=dn(t),i=xi(t),a=Si(i),l=Ht(t),u=s==="y",c=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let h;switch(l){case"top":h={x:c,y:r.y-o.height};break;case"bottom":h={x:c,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(Gn(t)){case"start":h[i]-=f*(n&&u?-1:1);break;case"end":h[i]+=f*(n&&u?-1:1);break}return h}const xm=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:d}=el(u,r,l),f=r,h={},g=0;for(let p=0;p<a.length;p++){const{name:m,fn:w}=a[p],{x:y,y:v,data:b,reset:C}=await w({x:c,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:h,rects:u,platform:i,elements:{reference:e,floating:t}});c=y??c,d=v??d,h={...h,[m]:{...h[m],...b}},C&&g<=50&&(g++,typeof C=="object"&&(C.placement&&(f=C.placement),C.rects&&(u=C.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:c,y:d}=el(u,f,l)),p=-1)}return{x:c,y:d,placement:f,strategy:o,middlewareData:h}};async function mr(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=yn(t,e),g=Sc(h),m=a[f?d==="floating"?"reference":"floating":d],w=eo(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(m)))==null||n?m:m.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),y=d==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,v=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),b=await(s.isElement==null?void 0:s.isElement(v))?await(s.getScale==null?void 0:s.getScale(v))||{x:1,y:1}:{x:1,y:1},C=eo(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:v,strategy:l}):y);return{top:(w.top-C.top+g.top)/b.y,bottom:(C.bottom-w.bottom+g.bottom)/b.y,left:(w.left-C.left+g.left)/b.x,right:(C.right-w.right+g.right)/b.x}}const Cm=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:l}=t,{element:u,padding:c=0}=yn(e,t)||{};if(u==null)return{};const d=Sc(c),f={x:n,y:r},h=xi(o),g=Si(h),p=await i.getDimensions(u),m=h==="y",w=m?"top":"left",y=m?"bottom":"right",v=m?"clientHeight":"clientWidth",b=s.reference[g]+s.reference[h]-f[h]-s.floating[g],C=f[h]-s.reference[h],O=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let D=O?O[v]:0;(!D||!await(i.isElement==null?void 0:i.isElement(O)))&&(D=a.floating[v]||s.floating[g]);const _=b/2-C/2,T=D/2-p[g]/2-1,k=Gt(d[w],T),V=Gt(d[y],T),j=k,re=D-p[g]-V,P=D/2-p[g]/2+_,R=Ls(j,P,re),E=!l.arrow&&Gn(o)!=null&&P!==R&&s.reference[g]/2-(P<j?k:V)-p[g]/2<0,I=E?P<j?P-j:P-re:0;return{[h]:f[h]+I,data:{[h]:R,centerOffset:P-R-I,...E&&{alignmentOffset:I}},reset:E}}}),Em=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:l,elements:u}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:p=!0,...m}=yn(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const w=Ht(o),y=dn(a),v=Ht(a)===a,b=await(l.isRTL==null?void 0:l.isRTL(u.floating)),C=f||(v||!p?[Jr(a)]:vm(a)),O=g!=="none";!f&&O&&C.push(...bm(a,p,g,b));const D=[a,...C],_=await mr(t,m),T=[];let k=((r=s.flip)==null?void 0:r.overflows)||[];if(c&&T.push(_[w]),d){const P=ym(o,i,b);T.push(_[P[0]],_[P[1]])}if(k=[...k,{placement:o,overflows:T}],!T.every(P=>P<=0)){var V,j;const P=(((V=s.flip)==null?void 0:V.index)||0)+1,R=D[P];if(R)return{data:{index:P,overflows:k},reset:{placement:R}};let E=(j=k.filter(I=>I.overflows[0]<=0).sort((I,M)=>I.overflows[1]-M.overflows[1])[0])==null?void 0:j.placement;if(!E)switch(h){case"bestFit":{var re;const I=(re=k.filter(M=>{if(O){const F=dn(M.placement);return F===y||F==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(F=>F>0).reduce((F,L)=>F+L,0)]).sort((M,F)=>M[1]-F[1])[0])==null?void 0:re[0];I&&(E=I);break}case"initialPlacement":E=a;break}if(o!==E)return{reset:{placement:E}}}return{}}}};function tl(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function nl(e){return gm.some(t=>e[t]>=0)}const Rm=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=yn(e,t);switch(r){case"referenceHidden":{const s=await mr(t,{...o,elementContext:"reference"}),i=tl(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:nl(i)}}}case"escaped":{const s=await mr(t,{...o,altBoundary:!0}),i=tl(s,n.floating);return{data:{escapedOffsets:i,escaped:nl(i)}}}default:return{}}}}};async function Pm(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Ht(n),a=Gn(n),l=dn(n)==="y",u=["left","top"].includes(i)?-1:1,c=s&&l?-1:1,d=yn(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof g=="number"&&(h=a==="end"?g*-1:g),l?{x:h*c,y:f*u}:{x:f*u,y:h*c}}const Im=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,l=await Pm(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:i}}}}},Mm=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:m=>{let{x:w,y}=m;return{x:w,y}}},...l}=yn(e,t),u={x:n,y:r},c=await mr(t,l),d=dn(Ht(o)),f=bc(d);let h=u[f],g=u[d];if(s){const m=f==="y"?"top":"left",w=f==="y"?"bottom":"right",y=h+c[m],v=h-c[w];h=Ls(y,h,v)}if(i){const m=d==="y"?"top":"left",w=d==="y"?"bottom":"right",y=g+c[m],v=g-c[w];g=Ls(y,g,v)}const p=a.fn({...t,[f]:h,[d]:g});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[f]:s,[d]:i}}}}}},Fm=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:l=()=>{},...u}=yn(e,t),c=await mr(t,u),d=Ht(o),f=Gn(o),h=dn(o)==="y",{width:g,height:p}=s.floating;let m,w;d==="top"||d==="bottom"?(m=d,w=f===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(w=d,m=f==="end"?"top":"bottom");const y=p-c.top-c.bottom,v=g-c.left-c.right,b=Gt(p-c[m],y),C=Gt(g-c[w],v),O=!t.middlewareData.shift;let D=b,_=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(_=v),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(D=y),O&&!f){const k=Be(c.left,0),V=Be(c.right,0),j=Be(c.top,0),re=Be(c.bottom,0);h?_=g-2*(k!==0||V!==0?k+V:Be(c.left,c.right)):D=p-2*(j!==0||re!==0?j+re:Be(c.top,c.bottom))}await l({...t,availableWidth:_,availableHeight:D});const T=await i.getDimensions(a.floating);return g!==T.width||p!==T.height?{reset:{rects:!0}}:{}}}};function uo(){return typeof window<"u"}function Hn(e){return xc(e)?(e.nodeName||"").toLowerCase():"#document"}function He(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function mt(e){var t;return(t=(xc(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function xc(e){return uo()?e instanceof Node||e instanceof He(e).Node:!1}function st(e){return uo()?e instanceof Element||e instanceof He(e).Element:!1}function pt(e){return uo()?e instanceof HTMLElement||e instanceof He(e).HTMLElement:!1}function rl(e){return!uo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof He(e).ShadowRoot}function Rr(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=it(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function $m(e){return["table","td","th"].includes(Hn(e))}function co(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Ci(e){const t=Ei(),n=st(e)?it(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 Am(e){let t=Ut(e);for(;pt(t)&&!jn(t);){if(Ci(t))return t;if(co(t))return null;t=Ut(t)}return null}function Ei(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function jn(e){return["html","body","#document"].includes(Hn(e))}function it(e){return He(e).getComputedStyle(e)}function fo(e){return st(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ut(e){if(Hn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||rl(e)&&e.host||mt(e);return rl(t)?t.host:t}function Cc(e){const t=Ut(e);return jn(t)?e.ownerDocument?e.ownerDocument.body:e.body:pt(t)&&Rr(t)?t:Cc(t)}function yr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Cc(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=He(o);if(s){const a=ks(i);return t.concat(i,i.visualViewport||[],Rr(o)?o:[],a&&n?yr(a):[])}return t.concat(o,yr(o,[],n))}function ks(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ec(e){const t=it(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=pt(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=Zr(n)!==s||Zr(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Ri(e){return st(e)?e:e.contextElement}function Pn(e){const t=Ri(e);if(!pt(t))return ft(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Ec(t);let i=(s?Zr(n.width):n.width)/r,a=(s?Zr(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const Om=ft(0);function Rc(e){const t=He(e);return!Ei()||!t.visualViewport?Om:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Tm(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==He(e)?!1:t}function fn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Ri(e);let i=ft(1);t&&(r?st(r)&&(i=Pn(r)):i=Pn(e));const a=Tm(s,n,r)?Rc(s):ft(0);let l=(o.left+a.x)/i.x,u=(o.top+a.y)/i.y,c=o.width/i.x,d=o.height/i.y;if(s){const f=He(s),h=r&&st(r)?He(r):r;let g=f,p=ks(g);for(;p&&r&&h!==g;){const m=Pn(p),w=p.getBoundingClientRect(),y=it(p),v=w.left+(p.clientLeft+parseFloat(y.paddingLeft))*m.x,b=w.top+(p.clientTop+parseFloat(y.paddingTop))*m.y;l*=m.x,u*=m.y,c*=m.x,d*=m.y,l+=v,u+=b,g=He(p),p=ks(g)}}return eo({width:c,height:d,x:l,y:u})}function Pi(e,t){const n=fo(e).scrollLeft;return t?t.left+n:fn(mt(e)).left+n}function Pc(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:Pi(e,r)),s=r.top+t.scrollTop;return{x:o,y:s}}function Dm(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=mt(r),a=t?co(t.floating):!1;if(r===i||a&&s)return n;let l={scrollLeft:0,scrollTop:0},u=ft(1);const c=ft(0),d=pt(r);if((d||!d&&!s)&&((Hn(r)!=="body"||Rr(i))&&(l=fo(r)),pt(r))){const h=fn(r);u=Pn(r),c.x=h.x+r.clientLeft,c.y=h.y+r.clientTop}const f=i&&!d&&!s?Pc(i,l,!0):ft(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+f.x,y:n.y*u.y-l.scrollTop*u.y+c.y+f.y}}function Lm(e){return Array.from(e.getClientRects())}function _m(e){const t=mt(e),n=fo(e),r=e.ownerDocument.body,o=Be(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Be(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Pi(e);const a=-n.scrollTop;return it(r).direction==="rtl"&&(i+=Be(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}function km(e,t){const n=He(e),r=mt(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,l=0;if(o){s=o.width,i=o.height;const u=Ei();(!u||u&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:s,height:i,x:a,y:l}}function Vm(e,t){const n=fn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=pt(e)?Pn(e):ft(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,l=o*s.x,u=r*s.y;return{width:i,height:a,x:l,y:u}}function ol(e,t,n){let r;if(t==="viewport")r=km(e,n);else if(t==="document")r=_m(mt(e));else if(st(t))r=Vm(t,n);else{const o=Rc(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return eo(r)}function Ic(e,t){const n=Ut(e);return n===t||!st(n)||jn(n)?!1:it(n).position==="fixed"||Ic(n,t)}function Nm(e,t){const n=t.get(e);if(n)return n;let r=yr(e,[],!1).filter(a=>st(a)&&Hn(a)!=="body"),o=null;const s=it(e).position==="fixed";let i=s?Ut(e):e;for(;st(i)&&!jn(i);){const a=it(i),l=Ci(i);!l&&a.position==="fixed"&&(o=null),(s?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Rr(i)&&!l&&Ic(e,i))?r=r.filter(c=>c!==i):o=a,i=Ut(i)}return t.set(e,r),r}function Km(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?co(t)?[]:Nm(t,this._c):[].concat(n),r],a=i[0],l=i.reduce((u,c)=>{const d=ol(t,c,o);return u.top=Be(d.top,u.top),u.right=Gt(d.right,u.right),u.bottom=Gt(d.bottom,u.bottom),u.left=Be(d.left,u.left),u},ol(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function jm(e){const{width:t,height:n}=Ec(e);return{width:t,height:n}}function zm(e,t,n){const r=pt(t),o=mt(t),s=n==="fixed",i=fn(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=ft(0);if(r||!r&&!s)if((Hn(t)!=="body"||Rr(o))&&(a=fo(t)),r){const f=fn(t,!0,s,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else o&&(l.x=Pi(o));const u=o&&!r&&!s?Pc(o,a):ft(0),c=i.left+a.scrollLeft-l.x-u.x,d=i.top+a.scrollTop-l.y-u.y;return{x:c,y:d,width:i.width,height:i.height}}function Ao(e){return it(e).position==="static"}function sl(e,t){if(!pt(e)||it(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return mt(e)===n&&(n=n.ownerDocument.body),n}function Mc(e,t){const n=He(e);if(co(e))return n;if(!pt(e)){let o=Ut(e);for(;o&&!jn(o);){if(st(o)&&!Ao(o))return o;o=Ut(o)}return n}let r=sl(e,t);for(;r&&$m(r)&&Ao(r);)r=sl(r,t);return r&&jn(r)&&Ao(r)&&!Ci(r)?n:r||Am(e)||n}const Bm=async function(e){const t=this.getOffsetParent||Mc,n=this.getDimensions,r=await n(e.floating);return{reference:zm(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Gm(e){return it(e).direction==="rtl"}const Fc={convertOffsetParentRelativeRectToViewportRelativeRect:Dm,getDocumentElement:mt,getClippingRect:Km,getOffsetParent:Mc,getElementRects:Bm,getClientRects:Lm,getDimensions:jm,getScale:Pn,isElement:st,isRTL:Gm};function Hm(e,t){let n=null,r;const o=mt(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const{left:u,top:c,width:d,height:f}=e.getBoundingClientRect();if(a||t(),!d||!f)return;const h=_r(c),g=_r(o.clientWidth-(u+d)),p=_r(o.clientHeight-(c+f)),m=_r(u),y={rootMargin:-h+"px "+-g+"px "+-p+"px "+-m+"px",threshold:Be(0,Gt(1,l))||1};let v=!0;function b(C){const O=C[0].intersectionRatio;if(O!==l){if(!v)return i();O?i(!1,O):r=setTimeout(()=>{i(!1,1e-7)},1e3)}v=!1}try{n=new IntersectionObserver(b,{...y,root:o.ownerDocument})}catch{n=new IntersectionObserver(b,y)}n.observe(e)}return i(!0),s}function Um(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=Ri(e),c=o||s?[...u?yr(u):[],...yr(t)]:[];c.forEach(w=>{o&&w.addEventListener("scroll",n,{passive:!0}),s&&w.addEventListener("resize",n)});const d=u&&a?Hm(u,n):null;let f=-1,h=null;i&&(h=new ResizeObserver(w=>{let[y]=w;y&&y.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var v;(v=h)==null||v.observe(t)})),n()}),u&&!l&&h.observe(u),h.observe(t));let g,p=l?fn(e):null;l&&m();function m(){const w=fn(e);p&&(w.x!==p.x||w.y!==p.y||w.width!==p.width||w.height!==p.height)&&n(),p=w,g=requestAnimationFrame(m)}return n(),()=>{var w;c.forEach(y=>{o&&y.removeEventListener("scroll",n),s&&y.removeEventListener("resize",n)}),d==null||d(),(w=h)==null||w.disconnect(),h=null,l&&cancelAnimationFrame(g)}}const qm=Im,Wm=Mm,Xm=Em,Qm=Fm,Ym=Rm,Zm=Cm,Jm=(e,t,n)=>{const r=new Map,o={platform:Fc,...n},s={...o.platform,_c:r};return xm(e,t,{...o,platform:s})};var ey=he('<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>'),Ii=Se();function Mi(){const e=we(Ii);if(e===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}var Vs=30,il=Vs/2,ty={top:180,right:-90,bottom:0,left:90};function $c(e){const t=Mi(),n=ee({size:Vs},e),[r,o]=K(n,["ref","style","size"]),s=()=>t.currentPlacement().split("-")[0],i=ny(t.contentRef),a=()=>{var f;return((f=i())==null?void 0:f.getPropertyValue("background-color"))||"none"},l=()=>{var f;return((f=i())==null?void 0:f.getPropertyValue(`border-${s()}-color`))||"none"},u=()=>{var f;return((f=i())==null?void 0:f.getPropertyValue(`border-${s()}-width`))||"0px"},c=()=>Number.parseInt(u())*2*(Vs/r.size),d=()=>`rotate(${ty[s()]} ${il} ${il}) translate(0 2)`;return S(me,A({as:"div",ref(f){var h=be(t.setArrowRef,r.ref);typeof h=="function"&&h(f)},"aria-hidden":"true",get style(){return gn({position:"absolute","font-size":`${r.size}px`,width:"1em",height:"1em","pointer-events":"none",fill:a(),stroke:l(),"stroke-width":c()},r.style)}},o,{get children(){var f=ey(),h=f.firstChild,g=h.firstChild;return g.nextSibling,Ke(()=>un(h,"transform",d())),f}}))}function ny(e){const[t,n]=z();return q(()=>{const r=e();r&&n(Hh(r).getComputedStyle(r))}),t}function ry(e){const t=Mi(),[n,r]=K(e,["ref","style"]);return S(me,A({as:"div",ref(o){var s=be(t.setPositionerRef,n.ref);typeof s=="function"&&s(o)},"data-popper-positioner":"",get style(){return gn({position:"absolute",top:0,left:0,"min-width":"max-content"},n.style)}},r))}function al(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 s={x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:n+o,left:t};return{...s,toJSON:()=>s}}function oy(e,t){return{contextElement:e,getBoundingClientRect:()=>{const r=t(e);return r?al(r):e?e.getBoundingClientRect():al()}}}function sy(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}var iy={top:"bottom",right:"left",bottom:"top",left:"right"};function ay(e,t){const[n,r]=e.split("-"),o=iy[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 ly(e){const t=ee({getAnchorRect:f=>f==null?void 0:f.getBoundingClientRect(),placement:"bottom",gutter:0,shift:0,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,hideWhenDetached:!1,detachedPadding:0,arrowPadding:4,overflowPadding:8},e),[n,r]=z(),[o,s]=z(),[i,a]=z(t.placement),l=()=>{var f;return oy((f=t.anchorRef)==null?void 0:f.call(t),t.getAnchorRect)},{direction:u}=Xt();async function c(){var O,D;const f=l(),h=n(),g=o();if(!f||!h)return;const p=((g==null?void 0:g.clientHeight)||0)/2,m=typeof t.gutter=="number"?t.gutter+p:t.gutter??p;h.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),f.getBoundingClientRect();const w=[qm(({placement:_})=>{const T=!!_.split("-")[1];return{mainAxis:m,crossAxis:T?void 0:t.shift,alignmentAxis:t.shift}})];if(t.flip!==!1){const _=typeof t.flip=="string"?t.flip.split(" "):void 0;if(_!==void 0&&!_.every(sy))throw new Error("`flip` expects a spaced-delimited list of placements");w.push(Xm({padding:t.overflowPadding,fallbackPlacements:_}))}(t.slide||t.overlap)&&w.push(Wm({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),w.push(Qm({padding:t.overflowPadding,apply({availableWidth:_,availableHeight:T,rects:k}){const V=Math.round(k.reference.width);_=Math.floor(_),T=Math.floor(T),h.style.setProperty("--kb-popper-anchor-width",`${V}px`),h.style.setProperty("--kb-popper-content-available-width",`${_}px`),h.style.setProperty("--kb-popper-content-available-height",`${T}px`),t.sameWidth&&(h.style.width=`${V}px`),t.fitViewport&&(h.style.maxWidth=`${_}px`,h.style.maxHeight=`${T}px`)}})),t.hideWhenDetached&&w.push(Ym({padding:t.detachedPadding})),g&&w.push(Zm({element:g,padding:t.arrowPadding}));const y=await Jm(f,h,{placement:t.placement,strategy:"absolute",middleware:w,platform:{...Fc,isRTL:()=>u()==="rtl"}});if(a(y.placement),(O=t.onCurrentPlacementChange)==null||O.call(t,y.placement),!h)return;h.style.setProperty("--kb-popper-content-transform-origin",ay(y.placement,u()));const v=Math.round(y.x),b=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(${v}px, ${b}px, 0)`,visibility:C}),g&&y.middlewareData.arrow){const{x:_,y:T}=y.middlewareData.arrow,k=y.placement.split("-")[0];Object.assign(g.style,{left:_!=null?`${_}px`:"",top:T!=null?`${T}px`:"",[k]:"100%"})}}q(()=>{const f=l(),h=n();if(!f||!h)return;const g=Um(f,h,c,{elementResize:typeof ResizeObserver=="function"});W(g)}),q(()=>{var g;const f=n(),h=(g=t.contentRef)==null?void 0:g.call(t);!f||!h||queueMicrotask(()=>{f.style.zIndex=getComputedStyle(h).zIndex})});const d={currentPlacement:i,contentRef:()=>{var f;return(f=t.contentRef)==null?void 0:f.call(t)},setPositionerRef:r,setArrowRef:s};return S(Ii.Provider,{value:d,get children(){return t.children}})}var ho=Object.assign(ly,{Arrow:$c,Context:Ii,usePopperContext:Mi,Positioner:ry}),Ac=Se();function Oc(){return we(Ac)}function uy(){const e=Oc();if(e===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}function Tc(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function cy(e,t){var o;const n=t.ref();if(!n)return-1;let r=e.length;if(!r)return-1;for(;r--;){const s=(o=e[r])==null?void 0:o.ref();if(s&&Tc(s,n))return r+1}return 0}function dy(e){const t=e.map((r,o)=>[o,r]);let n=!1;return t.sort(([r,o],[s,i])=>{const a=o.ref(),l=i.ref();return a===l||!a||!l?0:Tc(a,l)?(r>s&&(n=!0),-1):(r<s&&(n=!0),1)}),n?t.map(([r,o])=>o):e}function Dc(e,t){const n=dy(e);e!==n&&t(n)}function fy(e){var o,s;const t=e[0],n=(o=e[e.length-1])==null?void 0:o.ref();let r=(s=t==null?void 0:t.ref())==null?void 0:s.parentElement;for(;r;){if(n&&r.contains(n))return r;r=r.parentElement}return ht(r).body}function hy(e,t){q(()=>{const n=setTimeout(()=>{Dc(e(),t)});W(()=>clearTimeout(n))})}function gy(e,t){if(typeof IntersectionObserver!="function"){hy(e,t);return}let n=[];q(()=>{const r=()=>{const i=!!n.length;n=e(),i&&Dc(e(),t)},o=fy(e()),s=new IntersectionObserver(r,{root:o});for(const i of e()){const a=i.ref();a&&s.observe(a)}W(()=>s.disconnect())})}function py(e={}){const[t,n]=xg({value:()=>$(e.items),onChange:s=>{var i;return(i=e.onItemsChange)==null?void 0:i.call(e,s)}});gy(t,n);const r=s=>(n(i=>{const a=cy(i,s);return Bh(i,s,a)}),()=>{n(i=>{const a=i.filter(l=>l.ref()!==s.ref());return i.length===a.length?i:a})});return{DomCollectionProvider:s=>S(Ac.Provider,{value:{registerItem:r},get children(){return s.children}})}}function my(e){const t=uy(),n=ee({shouldRegisterItem:!0},e);q(()=>{if(!n.shouldRegisterItem)return;const r=t.registerItem(n.getItem());W(r)})}function Lc(e){let t=e.startIndex??0;const n=e.startLevel??0,r=[],o=l=>{if(l==null)return"";const u=e.getKey??"key",c=Sn(u)?l[u]:u(l);return c!=null?String(c):""},s=l=>{if(l==null)return"";const u=e.getTextValue??"textValue",c=Sn(u)?l[u]:u(l);return c!=null?String(c):""},i=l=>{if(l==null)return!1;const u=e.getDisabled??"disabled";return(Sn(u)?l[u]:u(l))??!1},a=l=>{var u;if(l!=null)return Sn(e.getSectionChildren)?l[e.getSectionChildren]:(u=e.getSectionChildren)==null?void 0:u.call(e,l)};for(const l of e.dataSource){if(Sn(l)||Gh(l)){r.push({type:"item",rawValue:l,key:String(l),textValue:String(l),disabled:i(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 u=a(l)??[];if(u.length>0){const c=Lc({dataSource:u,getKey:e.getKey,getTextValue:e.getTextValue,getDisabled:e.getDisabled,getSectionChildren:e.getSectionChildren,startIndex:t,startLevel:n+1});r.push(...c),t+=c.length}}else r.push({type:"item",rawValue:l,key:o(l),textValue:s(l),disabled:i(l),level:n,index:t}),t++}return r}function yy(e,t=[]){return N(()=>{const n=Lc({dataSource:$(e.dataSource),getKey:$(e.getKey),getTextValue:$(e.getTextValue),getDisabled:$(e.getDisabled),getSectionChildren:$(e.getSectionChildren)});for(let r=0;r<t.length;r++)t[r]();return e.factory(n)})}var Ct=class _c extends Set{constructor(n,r,o){super(n);le(this,"anchorKey");le(this,"currentKey");n instanceof _c?(this.anchorKey=r||n.anchorKey,this.currentKey=o||n.currentKey):(this.anchorKey=r,this.currentKey=o)}};function vy(e){const[t,n]=gt(e);return[()=>t()??new Ct,n]}function kc(e){return Xh()?e.altKey:e.ctrlKey}function xn(e){return so()?e.metaKey:e.ctrlKey}function ll(e){return new Ct(e)}function wy(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function by(e){const t=ee({selectionMode:"none",selectionBehavior:"toggle"},e),[n,r]=z(!1),[o,s]=z(),i=N(()=>{const p=$(t.selectedKeys);return p!=null?ll(p):p}),a=N(()=>{const p=$(t.defaultSelectedKeys);return p!=null?ll(p):new Ct}),[l,u]=vy({value:i,defaultValue:a,onChange:p=>{var m;return(m=t.onSelectionChange)==null?void 0:m.call(t,p)}}),[c,d]=z($(t.selectionBehavior)),f=()=>$(t.selectionMode),h=()=>$(t.disallowEmptySelection)??!1,g=p=>{($(t.allowDuplicateSelectionEvents)||!wy(p,l()))&&u(p)};return q(()=>{const p=l();$(t.selectionBehavior)==="replace"&&c()==="toggle"&&typeof p=="object"&&p.size===0&&d("replace")}),q(()=>{d($(t.selectionBehavior)??"toggle")}),{selectionMode:f,disallowEmptySelection:h,selectionBehavior:c,setSelectionBehavior:d,isFocused:n,setFocused:r,focusedKey:o,setFocusedKey:s,selectedKeys:l,setSelectedKeys:g}}function Sy(e){const[t,n]=z(""),[r,o]=z(-1);return{typeSelectHandlers:{onKeyDown:i=>{var f;if($(e.isDisabled))return;const a=$(e.keyboardDelegate),l=$(e.selectionManager);if(!a.getKeyForSearch)return;const u=xy(i.key);if(!u||i.ctrlKey||i.metaKey)return;u===" "&&t().trim().length>0&&(i.preventDefault(),i.stopPropagation());let c=n(h=>h+u),d=a.getKeyForSearch(c,l.focusedKey())??a.getKeyForSearch(c);d==null&&Cy(c)&&(c=c[0],d=a.getKeyForSearch(c,l.focusedKey())??a.getKeyForSearch(c)),d!=null&&(l.setFocusedKey(d),(f=e.onTypeSelect)==null||f.call(e,d)),clearTimeout(r()),o(window.setTimeout(()=>n(""),500))}}}}function xy(e){return e.length===1||!/^[A-Z]/i.test(e)?e:""}function Cy(e){return e.split("").every(t=>t===e[0])}function Ey(e,t,n){const o=A({selectOnFocus:()=>$(e.selectionManager).selectionBehavior()==="replace"},e),s=()=>t(),{direction:i}=Xt();let a={top:0,left:0};jh(()=>$(o.isVirtualized)?void 0:s(),"scroll",()=>{const m=s();m&&(a={top:m.scrollTop,left:m.scrollLeft})});const{typeSelectHandlers:l}=Sy({isDisabled:()=>$(o.disallowTypeAhead),keyboardDelegate:()=>$(o.keyboardDelegate),selectionManager:()=>$(o.selectionManager)}),u=()=>$(o.orientation)??"vertical",c=m=>{var _,T,k,V,j,re,P,R;ce(m,l.onKeyDown),m.altKey&&m.key==="Tab"&&m.preventDefault();const w=t();if(!(w!=null&&w.contains(m.target)))return;const y=$(o.selectionManager),v=$(o.selectOnFocus),b=E=>{E!=null&&(y.setFocusedKey(E),m.shiftKey&&y.selectionMode()==="multiple"?y.extendSelection(E):v&&!kc(m)&&y.replaceSelection(E))},C=$(o.keyboardDelegate),O=$(o.shouldFocusWrap),D=y.focusedKey();switch(m.key){case(u()==="vertical"?"ArrowDown":"ArrowRight"):{if(C.getKeyBelow){m.preventDefault();let E;D!=null?E=C.getKeyBelow(D):E=(_=C.getFirstKey)==null?void 0:_.call(C),E==null&&O&&(E=(T=C.getFirstKey)==null?void 0:T.call(C,D)),b(E)}break}case(u()==="vertical"?"ArrowUp":"ArrowLeft"):{if(C.getKeyAbove){m.preventDefault();let E;D!=null?E=C.getKeyAbove(D):E=(k=C.getLastKey)==null?void 0:k.call(C),E==null&&O&&(E=(V=C.getLastKey)==null?void 0:V.call(C,D)),b(E)}break}case(u()==="vertical"?"ArrowLeft":"ArrowUp"):{if(C.getKeyLeftOf){m.preventDefault();const E=i()==="rtl";let I;D!=null?I=C.getKeyLeftOf(D):I=E?(j=C.getFirstKey)==null?void 0:j.call(C):(re=C.getLastKey)==null?void 0:re.call(C),b(I)}break}case(u()==="vertical"?"ArrowRight":"ArrowDown"):{if(C.getKeyRightOf){m.preventDefault();const E=i()==="rtl";let I;D!=null?I=C.getKeyRightOf(D):I=E?(P=C.getLastKey)==null?void 0:P.call(C):(R=C.getFirstKey)==null?void 0:R.call(C),b(I)}break}case"Home":if(C.getFirstKey){m.preventDefault();const E=C.getFirstKey(D,xn(m));E!=null&&(y.setFocusedKey(E),xn(m)&&m.shiftKey&&y.selectionMode()==="multiple"?y.extendSelection(E):v&&y.replaceSelection(E))}break;case"End":if(C.getLastKey){m.preventDefault();const E=C.getLastKey(D,xn(m));E!=null&&(y.setFocusedKey(E),xn(m)&&m.shiftKey&&y.selectionMode()==="multiple"?y.extendSelection(E):v&&y.replaceSelection(E))}break;case"PageDown":if(C.getKeyPageBelow&&D!=null){m.preventDefault();const E=C.getKeyPageBelow(D);b(E)}break;case"PageUp":if(C.getKeyPageAbove&&D!=null){m.preventDefault();const E=C.getKeyPageAbove(D);b(E)}break;case"a":xn(m)&&y.selectionMode()==="multiple"&&$(o.disallowSelectAll)!==!0&&(m.preventDefault(),y.selectAll());break;case"Escape":m.defaultPrevented||(m.preventDefault(),$(o.disallowEmptySelection)||y.clearSelection());break;case"Tab":if(!$(o.allowsTabNavigation)){if(m.shiftKey)w.focus();else{const E=sg(w,{tabbable:!0});let I,M;do M=E.lastChild(),M&&(I=M);while(M);I&&!I.contains(document.activeElement)&&Ie(I)}break}}},d=m=>{var b,C;const w=$(o.selectionManager),y=$(o.keyboardDelegate),v=$(o.selectOnFocus);if(w.isFocused()){m.currentTarget.contains(m.target)||w.setFocused(!1);return}if(m.currentTarget.contains(m.target)){if(w.setFocused(!0),w.focusedKey()==null){const O=_=>{_!=null&&(w.setFocusedKey(_),v&&w.replaceSelection(_))},D=m.relatedTarget;D&&m.currentTarget.compareDocumentPosition(D)&Node.DOCUMENT_POSITION_FOLLOWING?O(w.lastSelectedKey()??((b=y.getLastKey)==null?void 0:b.call(y))):O(w.firstSelectedKey()??((C=y.getFirstKey)==null?void 0:C.call(y)))}else if(!$(o.isVirtualized)){const O=s();if(O){O.scrollTop=a.top,O.scrollLeft=a.left;const D=O.querySelector(`[data-key="${w.focusedKey()}"]`);D&&(Ie(D),Fs(O,D))}}}},f=m=>{const w=$(o.selectionManager);m.currentTarget.contains(m.relatedTarget)||w.setFocused(!1)},h=m=>{s()===m.target&&m.preventDefault()},g=()=>{var O,D;const m=$(o.autoFocus);if(!m)return;const w=$(o.selectionManager),y=$(o.keyboardDelegate);let v;m==="first"&&(v=(O=y.getFirstKey)==null?void 0:O.call(y)),m==="last"&&(v=(D=y.getLastKey)==null?void 0:D.call(y));const b=w.selectedKeys();b.size&&(v=b.values().next().value),w.setFocused(!0),w.setFocusedKey(v);const C=t();C&&v==null&&!$(o.shouldUseVirtualFocus)&&Ie(C)};return Cr(()=>{o.deferAutoFocus?setTimeout(g,0):g()}),q(Me([s,()=>$(o.isVirtualized),()=>$(o.selectionManager).focusedKey()],m=>{var b;const[w,y,v]=m;if(y)v&&((b=o.scrollToKey)==null||b.call(o,v));else if(v&&w){const C=w.querySelector(`[data-key="${v}"]`);C&&Fs(w,C)}})),{tabIndex:N(()=>{if(!$(o.shouldUseVirtualFocus))return $(o.selectionManager).focusedKey()==null?0:-1}),onKeyDown:c,onMouseDown:h,onFocusIn:d,onFocusOut:f}}function Vc(e,t){const n=()=>$(e.selectionManager),r=()=>$(e.key),o=()=>$(e.shouldUseVirtualFocus),s=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"||xn(y)||"pointerType"in y&&y.pointerType==="touch"?n().toggleSelection(r()):n().replaceSelection(r()))},i=()=>n().isSelected(r()),a=()=>$(e.disabled)||n().isDisabled(r()),l=()=>!a()&&n().canSelectItem(r());let u=null;const c=y=>{l()&&(u=y.pointerType,y.pointerType==="mouse"&&y.button===0&&!$(e.shouldSelectOnPressUp)&&s(y))},d=y=>{l()&&y.pointerType==="mouse"&&y.button===0&&$(e.shouldSelectOnPressUp)&&$(e.allowsDifferentPressOrigin)&&s(y)},f=y=>{l()&&($(e.shouldSelectOnPressUp)&&!$(e.allowsDifferentPressOrigin)||u!=="mouse")&&s(y)},h=y=>{!l()||!["Enter"," "].includes(y.key)||(kc(y)?n().toggleSelection(r()):s(y))},g=y=>{a()&&y.preventDefault()},p=y=>{const v=t();o()||a()||!v||y.target===v&&n().setFocusedKey(r())},m=N(()=>{if(!(o()||a()))return r()===n().focusedKey()?0:-1}),w=N(()=>$(e.virtualized)?void 0:r());return q(Me([t,r,o,()=>n().focusedKey(),()=>n().isFocused()],([y,v,b,C,O])=>{y&&v===C&&O&&!b&&document.activeElement!==y&&(e.focus?e.focus():Ie(y))})),{isSelected:i,isDisabled:a,allowsSelection:l,tabIndex:m,dataKey:w,onPointerDown:c,onPointerUp:d,onClick:f,onKeyDown:h,onMouseDown:g,onFocus:p}}var Ry=class{constructor(e,t){le(this,"collection");le(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 Ct(n,r,t);for(const s of this.getKeyRange(r,n.currentKey||t))o.delete(s);for(const s of this.getKeyRange(t,r))this.canSelectItem(s)&&o.add(s);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 Ct(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 Ct([t],t,t):new Ct;this.state.setSelectedKeys(n)}setSelectedKeys(e){if(this.selectionMode()==="none")return;const t=new Ct;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 Ct)}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}},ul=class{constructor(e){le(this,"keyMap",new Map);le(this,"iterable");le(this,"firstKey");le(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 Py(e){const t=by(e),r=yy({dataSource:()=>$(e.dataSource),getKey:()=>$(e.getKey),getTextValue:()=>$(e.getTextValue),getDisabled:()=>$(e.getDisabled),getSectionChildren:()=>$(e.getSectionChildren),factory:s=>e.filter?new ul(e.filter(s)):new ul(s)},[()=>e.filter]),o=new Ry(r,t);return Rt(()=>{const s=t.focusedKey();s!=null&&!r().getItem(s)&&t.setFocusedKey(void 0)}),{collection:r,selectionManager:()=>o}}var Iy=class{constructor(e,t,n){le(this,"collection");le(this,"ref");le(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 s;const t=(s=this.ref)==null?void 0:s.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 s;const t=(s=this.ref)==null?void 0:s.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 s=this.collection().getItem(r);if(s){const i=s.textValue.slice(0,e.length);if(s.textValue&&n.compare(i,e)===0)return r}r=this.getKeyBelow(r)}}};function My(e,t,n){const r=hm({usage:"search",sensitivity:"base"}),o=N(()=>{const s=$(e.keyboardDelegate);return s||new Iy(e.collection,t,r)});return Ey({selectionManager:()=>$(e.selectionManager),keyboardDelegate:o,autoFocus:()=>$(e.autoFocus),deferAutoFocus:()=>$(e.deferAutoFocus),shouldFocusWrap:()=>$(e.shouldFocusWrap),disallowEmptySelection:()=>$(e.disallowEmptySelection),selectOnFocus:()=>$(e.selectOnFocus),disallowTypeAhead:()=>$(e.disallowTypeAhead),shouldUseVirtualFocus:()=>$(e.shouldUseVirtualFocus),allowsTabNavigation:()=>$(e.allowsTabNavigation),isVirtualized:()=>$(e.isVirtualized),scrollToKey:s=>{var i;return(i=$(e.scrollToKey))==null?void 0:i(s)},orientation:()=>$(e.orientation)},t)}function Nc(e={}){const[t,n]=oc({value:()=>$(e.isSelected),defaultValue:()=>!!$(e.defaultIsSelected),onChange:s=>{var i;return(i=e.onSelectedChange)==null?void 0:i.call(e,s)}});return{isSelected:t,setIsSelected:s=>{!$(e.isReadOnly)&&!$(e.isDisabled)&&n(s)},toggle:()=>{!$(e.isReadOnly)&&!$(e.isDisabled)&&n(!t())}}}var Kc=Se();function go(){return we(Kc)}function Mt(){const e=go();if(e===void 0)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}var jc=Se();function Fi(){const e=we(jc);if(e===void 0)throw new Error("[kobalte]: `useMenuItemContext` must be used within a `Menu.Item` component");return e}var zc=Se();function yt(){const e=we(zc);if(e===void 0)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}function $i(e){let t;const n=yt(),r=Mt(),o=ee({id:n.generateId(`item-${Re()}`)},e),[s,i]=K(o,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,l]=z(),[u,c]=z(),[d,f]=z(),h=()=>r.listState().selectionManager(),g=()=>i.id,p=()=>h().focusedKey()===g(),m=()=>{var T;(T=s.onSelect)==null||T.call(s),s.closeOnSelect&&setTimeout(()=>{r.close(!0)})};my({getItem:()=>{var T;return{ref:()=>t,type:"item",key:g(),textValue:s.textValue??((T=d())==null?void 0:T.textContent)??(t==null?void 0:t.textContent)??"",disabled:s.disabled??!1}}});const w=Vc({key:g,selectionManager:h,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>s.disabled},()=>t),y=T=>{ce(T,s.onPointerMove),T.pointerType==="mouse"&&(s.disabled?r.onItemLeave(T):(r.onItemEnter(T),T.defaultPrevented||(Ie(T.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(g()))))},v=T=>{ce(T,s.onPointerLeave),T.pointerType==="mouse"&&r.onItemLeave(T)},b=T=>{ce(T,s.onPointerUp),!s.disabled&&T.button===0&&m()},C=T=>{if(ce(T,s.onKeyDown),!T.repeat&&!s.disabled)switch(T.key){case"Enter":case" ":m();break}},O=N(()=>{if(s.indeterminate)return"mixed";if(s.checked!=null)return s.checked}),D=N(()=>({"data-indeterminate":s.indeterminate?"":void 0,"data-checked":s.checked&&!s.indeterminate?"":void 0,"data-disabled":s.disabled?"":void 0,"data-highlighted":p()?"":void 0})),_={isChecked:()=>s.checked,dataset:D,setLabelRef:f,generateId:Wt(()=>i.id),registerLabel:Ye(l),registerDescription:Ye(c)};return S(jc.Provider,{value:_,get children(){return S(me,A({as:"div",ref(T){var k=be(V=>t=V,s.ref);typeof k=="function"&&k(T)},get tabIndex(){return w.tabIndex()},get"aria-checked"(){return O()},get"aria-disabled"(){return s.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return u()},get"data-key"(){return w.dataKey()},get onPointerDown(){return ve([s.onPointerDown,w.onPointerDown])},get onPointerUp(){return ve([b,w.onPointerUp])},get onClick(){return ve([s.onClick,w.onClick])},get onKeyDown(){return ve([C,w.onKeyDown])},get onMouseDown(){return ve([s.onMouseDown,w.onMouseDown])},get onFocus(){return ve([s.onFocus,w.onFocus])},onPointerMove:y,onPointerLeave:v},D,i))}})}function Fy(e){const t=ee({closeOnSelect:!1},e),[n,r]=K(t,["checked","defaultChecked","onChange","onSelect"]),o=Nc({isSelected:()=>n.checked,defaultIsSelected:()=>n.defaultChecked,onSelectedChange:i=>{var a;return(a=n.onChange)==null?void 0:a.call(n,i)},isDisabled:()=>r.disabled});return S($i,A({role:"menuitemcheckbox",get checked(){return o.isSelected()},onSelect:()=>{var i;(i=n.onSelect)==null||i.call(n),o.toggle()}},r))}var Bc=Se();function Pr(){return we(Bc)}function Un(){const e=Pr();if(e===void 0)throw new Error("[kobalte]: `useMenubarContext` must be used within a `Menubar` component");return e}var vr={next:(e,t)=>e==="ltr"?t==="horizontal"?"ArrowRight":"ArrowDown":t==="horizontal"?"ArrowLeft":"ArrowUp",previous:(e,t)=>vr.next(e==="ltr"?"rtl":"ltr",t)},cl={first:e=>e==="horizontal"?"ArrowDown":"ArrowRight",last:e=>e==="horizontal"?"ArrowUp":"ArrowLeft"};function dl(e){const t=yt(),n=Mt(),r=Pr(),{direction:o}=Xt(),s=ee({id:t.generateId("trigger")},e),[i,a]=K(s,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let l=()=>t.value();r!==void 0&&(l=()=>t.value()??i.id,r.lastValue()===void 0&&r.setLastValue(l));const u=io(()=>n.triggerRef(),()=>"button"),c=N(()=>{var w;return u()==="a"&&((w=n.triggerRef())==null?void 0:w.getAttribute("href"))!=null});q(Me(()=>r==null?void 0:r.value(),w=>{var y;c()&&w===l()&&((y=n.triggerRef())==null||y.focus())}));const d=()=>{r!==void 0?n.isOpen()?r.value()===l()&&r.closeMenu():(r.autoFocusMenu()||r.setAutoFocusMenu(!0),n.open(!1)):n.toggle(!0)},f=w=>{ce(w,i.onPointerDown),w.currentTarget.dataset.pointerType=w.pointerType,!i.disabled&&w.pointerType!=="touch"&&w.button===0&&d()},h=w=>{ce(w,i.onClick),i.disabled||w.currentTarget.dataset.pointerType==="touch"&&d()},g=w=>{if(ce(w,i.onKeyDown),!i.disabled){if(c())switch(w.key){case"Enter":case" ":return}switch(w.key){case"Enter":case" ":case cl.first(t.orientation()):w.stopPropagation(),w.preventDefault(),ug(w.currentTarget),n.open("first"),r==null||r.setAutoFocusMenu(!0),r==null||r.setValue(l);break;case cl.last(t.orientation()):w.stopPropagation(),w.preventDefault(),n.open("last");break;case vr.next(o(),t.orientation()):if(r===void 0)break;w.stopPropagation(),w.preventDefault(),r.nextMenu();break;case vr.previous(o(),t.orientation()):if(r===void 0)break;w.stopPropagation(),w.preventDefault(),r.previousMenu();break}}},p=w=>{var y;ce(w,i.onMouseOver),((y=n.triggerRef())==null?void 0:y.dataset.pointerType)!=="touch"&&!i.disabled&&r!==void 0&&r.value()!==void 0&&r.setValue(l)},m=w=>{ce(w,i.onFocus),r!==void 0&&w.currentTarget.dataset.pointerType!=="touch"&&r.setValue(l)};return q(()=>W(n.registerTriggerId(i.id))),S(It,A({ref(w){var y=be(n.setTriggerRef,i.ref);typeof y=="function"&&y(w)},get"data-kb-menu-value-trigger"(){return t.value()},get id(){return i.id},get disabled(){return i.disabled},"aria-haspopup":"true",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return N(()=>!!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:f,onMouseOver:p,onClick:h,onKeyDown:g,onFocus:m,role:r!==void 0?"menuitem":void 0},()=>n.dataset(),a))}var Gc=Se();function Ai(){return we(Gc)}function Ir(){const e=Ai();if(e===void 0)throw new Error("[kobalte]: `useNavigationMenuContext` must be used within a `NavigationMenu` component");return e}function Hc(e){let t;const n=yt(),r=Mt(),o=Pr(),s=Ai(),{direction:i}=Xt(),a=ee({id:n.generateId(`content-${Re()}`)},e),[l,u]=K(a,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let c=0;const d=()=>r.parentMenuContext()==null&&o===void 0&&n.isModal(),f=My({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);ec({trapFocus:()=>d()&&r.isOpen(),onMountAutoFocus:v=>{var b;o===void 0&&((b=l.onOpenAutoFocus)==null||b.call(l,v))},onUnmountAutoFocus:l.onCloseAutoFocus},()=>t);const h=v=>{if(Ne(v.currentTarget,v.target)&&(v.key==="Tab"&&r.isOpen()&&v.preventDefault(),o!==void 0&&v.currentTarget.getAttribute("aria-haspopup")!=="true"))switch(v.key){case vr.next(i(),n.orientation()):v.stopPropagation(),v.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.nextMenu();break;case vr.previous(i(),n.orientation()):if(v.currentTarget.hasAttribute("data-closed"))break;v.stopPropagation(),v.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.previousMenu();break}},g=v=>{var b;(b=l.onEscapeKeyDown)==null||b.call(l,v),o==null||o.setAutoFocusMenu(!1),r.close(!0)},p=v=>{var b;(b=l.onFocusOutside)==null||b.call(l,v),n.isModal()&&v.preventDefault()},m=v=>{var b,C;ce(v,l.onPointerEnter),r.isOpen()&&((b=r.parentMenuContext())==null||b.listState().selectionManager().setFocused(!1),(C=r.parentMenuContext())==null||C.listState().selectionManager().setFocusedKey(void 0))},w=v=>{if(ce(v,l.onPointerMove),v.pointerType!=="mouse")return;const b=v.target,C=c!==v.clientX;Ne(v.currentTarget,b)&&C&&(r.setPointerDir(v.clientX>c?"right":"left"),c=v.clientX)};q(()=>W(r.registerContentId(l.id))),W(()=>r.setContentRef(void 0));const y={ref:be(v=>{r.setContentRef(v),t=v},l.ref),role:"menu",get id(){return l.id},get tabIndex(){return f.tabIndex()},get"aria-labelledby"(){return r.triggerId()},onKeyDown:ve([l.onKeyDown,f.onKeyDown,h]),onMouseDown:ve([l.onMouseDown,f.onMouseDown]),onFocusIn:ve([l.onFocusIn,f.onFocusIn]),onFocusOut:ve([l.onFocusOut,f.onFocusOut]),onPointerEnter:m,onPointerMove:w,get"data-orientation"(){return n.orientation()}};return S(Ce,{get when(){return r.contentPresent()},get children(){return S(Ce,{get when(){return s===void 0||r.parentMenuContext()!=null},get fallback(){return S(me,A({as:"div"},()=>r.dataset(),y,u))},get children(){return S(ho.Positioner,{get children(){return S(ci,A({get disableOutsidePointerEvents(){return N(()=>!!d())()&&r.isOpen()},get excludedElements(){return[r.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return gn({"--kb-menu-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},l.style)},onEscapeKeyDown:g,onFocusOutside:p,get onDismiss(){return r.close}},()=>r.dataset(),y,u))}})}})}})}function $y(e){let t;const n=yt(),r=Mt(),[o,s]=K(e,["ref"]);return sc({element:()=>t??null,enabled:()=>r.contentPresent()&&n.preventScroll()}),S(Hc,A({ref(i){var a=be(l=>{t=l},o.ref);typeof a=="function"&&a(i)}},s))}var Uc=Se();function Ay(){const e=we(Uc);if(e===void 0)throw new Error("[kobalte]: `useMenuGroupContext` must be used within a `Menu.Group` component");return e}function qc(e){const t=yt(),n=ee({id:t.generateId(`group-${Re()}`)},e),[r,o]=z(),s={generateId:Wt(()=>n.id),registerLabelId:Ye(o)};return S(Uc.Provider,{value:s,get children(){return S(me,A({as:"div",role:"group",get"aria-labelledby"(){return r()}},n))}})}function Oy(e){const t=Ay(),n=ee({id:t.generateId("label")},e),[r,o]=K(n,["id"]);return q(()=>W(t.registerLabelId(r.id))),S(me,A({as:"span",get id(){return r.id},"aria-hidden":"true"},o))}function Wc(e){const t=Mt(),n=ee({children:"▼"},e);return S(me,A({as:"span","aria-hidden":"true"},()=>t.dataset(),n))}function Ty(e){return S($i,A({role:"menuitem",closeOnSelect:!0},e))}function Dy(e){const t=Fi(),n=ee({id:t.generateId("description")},e),[r,o]=K(n,["id"]);return q(()=>W(t.registerDescription(r.id))),S(me,A({as:"div",get id(){return r.id}},()=>t.dataset(),o))}function Ly(e){const t=Fi(),n=ee({id:t.generateId("indicator")},e),[r,o]=K(n,["forceMount"]);return S(Ce,{get when(){return r.forceMount||t.isChecked()},get children(){return S(me,A({as:"div"},()=>t.dataset(),o))}})}function _y(e){const t=Fi(),n=ee({id:t.generateId("label")},e),[r,o]=K(n,["ref","id"]);return q(()=>W(t.registerLabel(r.id))),S(me,A({as:"div",ref(s){var i=be(t.setLabelRef,r.ref);typeof i=="function"&&i(s)},get id(){return r.id}},()=>t.dataset(),o))}function ky(e){const t=Mt();return S(Ce,{get when(){return t.contentPresent()},get children(){return S(gu,e)}})}var Xc=Se();function Vy(){const e=we(Xc);if(e===void 0)throw new Error("[kobalte]: `useMenuRadioGroupContext` must be used within a `Menu.RadioGroup` component");return e}function Ny(e){const n=yt().generateId(`radiogroup-${Re()}`),r=ee({id:n},e),[o,s]=K(r,["value","defaultValue","onChange","disabled"]),[i,a]=gt({value:()=>o.value,defaultValue:()=>o.defaultValue,onChange:u=>{var c;return(c=o.onChange)==null?void 0:c.call(o,u)}}),l={isDisabled:()=>o.disabled,isSelectedValue:u=>u===i(),setSelectedValue:a};return S(Xc.Provider,{value:l,get children(){return S(qc,s)}})}function Ky(e){const t=Vy(),n=ee({closeOnSelect:!1},e),[r,o]=K(n,["value","onSelect"]);return S($i,A({role:"menuitemradio",get checked(){return t.isSelectedValue(r.value)},onSelect:()=>{var i;(i=r.onSelect)==null||i.call(r),t.setSelectedValue(r.value)}},o))}function jy(e,t,n){const r=e.split("-")[0],o=n.getBoundingClientRect(),s=[],i=t.clientX,a=t.clientY;switch(r){case"top":s.push([i,a+5]),s.push([o.left,o.bottom]),s.push([o.left,o.top]),s.push([o.right,o.top]),s.push([o.right,o.bottom]);break;case"right":s.push([i-5,a]),s.push([o.left,o.top]),s.push([o.right,o.top]),s.push([o.right,o.bottom]),s.push([o.left,o.bottom]);break;case"bottom":s.push([i,a-5]),s.push([o.right,o.top]),s.push([o.right,o.bottom]),s.push([o.left,o.bottom]),s.push([o.left,o.top]);break;case"left":s.push([i+5,a]),s.push([o.right,o.bottom]),s.push([o.left,o.bottom]),s.push([o.left,o.top]),s.push([o.right,o.top]);break}return s}function zy(e,t){return t?lg([e.clientX,e.clientY],t):!1}function Qc(e){const t=yt(),n=Oc(),r=go(),o=Pr(),s=Ai(),i=ee({placement:t.orientation()==="horizontal"?"bottom-start":"right-start"},e),[a,l]=K(i,["open","defaultOpen","onOpenChange"]);let u=0,c=null,d="right";const[f,h]=z(),[g,p]=z(),[m,w]=z(),[y,v]=z(),[b,C]=z(!0),[O,D]=z(l.placement),[_,T]=z([]),[k,V]=z([]),{DomCollectionProvider:j}=py({items:k,onItemsChange:V}),re=di({open:()=>a.open,defaultOpen:()=>a.defaultOpen,onOpenChange:te=>{var Pe;return(Pe=a.onOpenChange)==null?void 0:Pe.call(a,te)}}),{present:P}=Yr({show:()=>t.forceMount()||re.isOpen(),element:()=>y()??null}),R=Py({selectionMode:"none",dataSource:k}),E=te=>{C(te),re.open()},I=(te=!1)=>{re.close(),te&&r&&r.close(!0)},M=te=>{C(te),re.toggle()},F=()=>{const te=y();te&&(Ie(te),R.selectionManager().setFocused(!0),R.selectionManager().setFocusedKey(void 0))},L=()=>{s!=null?setTimeout(()=>F()):F()},B=te=>{T(Ee=>[...Ee,te]);const Pe=r==null?void 0:r.registerNestedMenu(te);return()=>{T(Ee=>Ms(Ee,te)),Pe==null||Pe()}},H=te=>d===(c==null?void 0:c.side)&&zy(te,c==null?void 0:c.area),Z=te=>{H(te)&&te.preventDefault()},ue=te=>{H(te)||L()},se=te=>{H(te)&&te.preventDefault()};tc({isDisabled:()=>!(r==null&&re.isOpen()&&t.isModal()),targets:()=>[y(),..._()].filter(Boolean)}),q(()=>{const te=y();if(!te||!r)return;const Pe=r.registerNestedMenu(te);W(()=>{Pe()})}),q(()=>{r===void 0&&(o==null||o.registerMenu(t.value(),[y(),..._()]))}),q(()=>{var te;r!==void 0||o===void 0||(o.value()===t.value()?((te=m())==null||te.focus(),o.autoFocusMenu()&&E(!0)):I())}),q(()=>{r!==void 0||o===void 0||re.isOpen()&&o.setValue(t.value())}),W(()=>{r===void 0&&(o==null||o.unregisterMenu(t.value()))});const vt={dataset:N(()=>({"data-expanded":re.isOpen()?"":void 0,"data-closed":re.isOpen()?void 0:""})),isOpen:re.isOpen,contentPresent:P,nestedMenus:_,currentPlacement:O,pointerGraceTimeoutId:()=>u,autoFocus:b,listState:()=>R,parentMenuContext:()=>r,triggerRef:m,contentRef:y,triggerId:f,contentId:g,setTriggerRef:w,setContentRef:v,open:E,close:I,toggle:M,focusContent:L,onItemEnter:Z,onItemLeave:ue,onTriggerLeave:se,setPointerDir:te=>d=te,setPointerGraceTimeoutId:te=>u=te,setPointerGraceIntent:te=>c=te,registerNestedMenu:B,registerItemToParentDomCollection:n==null?void 0:n.registerItem,registerTriggerId:Ye(h),registerContentId:Ye(p)};return S(j,{get children(){return S(Kc.Provider,{value:vt,get children(){return S(Ce,{when:s===void 0,get fallback(){return l.children},get children(){return S(ho,A({anchorRef:m,contentRef:y,onCurrentPlacementChange:D},l))}})}})}})}function By(e){const{direction:t}=Xt();return S(Qc,A({get placement(){return t()==="rtl"?"left-start":"right-start"},flip:!0},e))}var Gy={close:(e,t)=>e==="ltr"?[t==="horizontal"?"ArrowLeft":"ArrowUp"]:[t==="horizontal"?"ArrowRight":"ArrowDown"]};function Hy(e){const t=Mt(),n=yt(),[r,o]=K(e,["onFocusOutside","onKeyDown"]),{direction:s}=Xt();return S(Hc,A({onOpenAutoFocus:c=>{c.preventDefault()},onCloseAutoFocus:c=>{c.preventDefault()},onFocusOutside:c=>{var f;(f=r.onFocusOutside)==null||f.call(r,c);const d=c.target;Ne(t.triggerRef(),d)||t.close()},onKeyDown:c=>{ce(c,r.onKeyDown);const d=Ne(c.currentTarget,c.target),f=Gy.close(s(),n.orientation()).includes(c.key),h=t.parentMenuContext()!=null;d&&f&&h&&(t.close(),Ie(t.triggerRef()))}},o))}var fl=["Enter"," "],Uy={open:(e,t)=>e==="ltr"?[...fl,t==="horizontal"?"ArrowRight":"ArrowDown"]:[...fl,t==="horizontal"?"ArrowLeft":"ArrowUp"]};function qy(e){let t;const n=yt(),r=Mt(),o=ee({id:n.generateId(`sub-trigger-${Re()}`)},e),[s,i]=K(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:u}=Xt(),c=()=>s.id,d=()=>{const v=r.parentMenuContext();if(v==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");return v.listState().selectionManager()},f=()=>r.listState().collection(),h=()=>d().focusedKey()===c(),g=Vc({key:c,selectionManager:d,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>s.disabled},()=>t),p=v=>{ce(v,s.onClick),!r.isOpen()&&!s.disabled&&r.open(!0)},m=v=>{var C;if(ce(v,s.onPointerMove),v.pointerType!=="mouse")return;const b=r.parentMenuContext();if(b==null||b.onItemEnter(v),!v.defaultPrevented){if(s.disabled){b==null||b.onItemLeave(v);return}!r.isOpen()&&!a&&((C=r.parentMenuContext())==null||C.setPointerGraceIntent(null),a=window.setTimeout(()=>{r.open(!1),l()},100)),b==null||b.onItemEnter(v),v.defaultPrevented||(r.listState().selectionManager().isFocused()&&(r.listState().selectionManager().setFocused(!1),r.listState().selectionManager().setFocusedKey(void 0)),Ie(v.currentTarget),b==null||b.listState().selectionManager().setFocused(!0),b==null||b.listState().selectionManager().setFocusedKey(c()))}},w=v=>{if(ce(v,s.onPointerLeave),v.pointerType!=="mouse")return;l();const b=r.parentMenuContext(),C=r.contentRef();if(C){b==null||b.setPointerGraceIntent({area:jy(r.currentPlacement(),v,C),side:r.currentPlacement().split("-")[0]}),window.clearTimeout(b==null?void 0:b.pointerGraceTimeoutId());const O=window.setTimeout(()=>{b==null||b.setPointerGraceIntent(null)},300);b==null||b.setPointerGraceTimeoutId(O)}else{if(b==null||b.onTriggerLeave(v),v.defaultPrevented)return;b==null||b.setPointerGraceIntent(null)}b==null||b.onItemLeave(v)},y=v=>{ce(v,s.onKeyDown),!v.repeat&&(s.disabled||Uy.open(u(),n.orientation()).includes(v.key)&&(v.stopPropagation(),v.preventDefault(),d().setFocused(!1),d().setFocusedKey(void 0),r.isOpen()||r.open("first"),r.focusContent(),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(f().getFirstKey())))};return q(()=>{if(r.registerItemToParentDomCollection==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");const v=r.registerItemToParentDomCollection({ref:()=>t,type:"item",key:c(),textValue:s.textValue??(t==null?void 0:t.textContent)??"",disabled:s.disabled??!1});W(v)}),q(Me(()=>{var v;return(v=r.parentMenuContext())==null?void 0:v.pointerGraceTimeoutId()},v=>{W(()=>{var b;window.clearTimeout(v),(b=r.parentMenuContext())==null||b.setPointerGraceIntent(null)})})),q(()=>W(r.registerTriggerId(s.id))),W(()=>{l()}),S(me,A({as:"div",ref(v){var b=be(C=>{r.setTriggerRef(C),t=C},s.ref);typeof b=="function"&&b(v)},get id(){return s.id},role:"menuitem",get tabIndex(){return g.tabIndex()},"aria-haspopup":"true",get"aria-expanded"(){return r.isOpen()},get"aria-controls"(){return N(()=>!!r.isOpen())()?r.contentId():void 0},get"aria-disabled"(){return s.disabled},get"data-key"(){return g.dataKey()},get"data-highlighted"(){return h()?"":void 0},get"data-disabled"(){return s.disabled?"":void 0},get onPointerDown(){return ve([s.onPointerDown,g.onPointerDown])},get onPointerUp(){return ve([s.onPointerUp,g.onPointerUp])},get onClick(){return ve([p,g.onClick])},get onKeyDown(){return ve([y,g.onKeyDown])},get onMouseDown(){return ve([s.onMouseDown,g.onMouseDown])},get onFocus(){return ve([s.onFocus,g.onFocus])},onPointerMove:m,onPointerLeave:w},()=>r.dataset(),i))}function Wy(e){const t=Pr(),n=`menu-${Re()}`,r=ee({id:n,modal:!0},e),[o,s]=K(r,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value","orientation"]),i=di({open:()=>o.open,defaultOpen:()=>o.defaultOpen,onOpenChange:l=>{var u;return(u=o.onOpenChange)==null?void 0:u.call(o,l)}}),a={isModal:()=>o.modal??!0,preventScroll:()=>o.preventScroll??a.isModal(),forceMount:()=>o.forceMount??!1,generateId:Wt(()=>o.id),value:()=>o.value,orientation:()=>o.orientation??(t==null?void 0:t.orientation())??"horizontal"};return S(zc.Provider,{value:a,get children(){return S(Qc,A({get open(){return i.isOpen()},get onOpenChange(){return i.setIsOpen}},s))}})}function Yc(e){const t=Un(),n=ee({modal:!1},e),[r,o]=K(n,["value"]),s=Re(),i=t.generateId(`menubar-menu-${s}`),a=ee({id:i},o);return S(Wy,A({get value(){return r.value??s}},a))}function Xy(e){let t;const n=`menubar-${Re()}`,r=ee({id:n,loop:!0,orientation:"horizontal"},e),[o,s]=K(r,["ref","value","defaultValue","onValueChange","loop","focusOnAlt","autoFocusMenu","onAutoFocusMenuChange","orientation"]),[i,a]=gt({value:()=>o.value,defaultValue:()=>o.defaultValue,onChange:y=>{var v;return(v=o.onValueChange)==null?void 0:v.call(o,y)}}),[l,u]=z(),[c,d]=z(new Map),[f,h]=gt({value:()=>o.autoFocusMenu,defaultValue:()=>!1,onChange:o.onAutoFocusMenuChange}),g=()=>{var y;return i()&&f()&&!((y=i())!=null&&y.includes("link-trigger-"))},m={dataset:N(()=>({"data-expanded":g()?"":void 0,"data-closed":g()?void 0:""})),value:i,setValue:a,lastValue:l,setLastValue:u,menus:()=>new Set([...c().keys()]),menuRefs:()=>[...c().values()].flat(),menuRefMap:()=>c(),registerMenu:(y,v)=>{d(b=>{const C=new Map;return b.forEach((O,D)=>C.set(D,O)),C.set(y,v),C})},unregisterMenu:y=>{d(v=>{v.delete(y);const b=new Map;return v.forEach((C,O)=>b.set(O,C)),b})},nextMenu:()=>{const y=[...c().keys()];if(i()==null){a(y[0]);return}const v=y.indexOf(i());if(v===y.length-1){o.loop&&a(y[0]);return}a(y[v+1])},previousMenu:()=>{const y=[...c().keys()];if(i()==null){a(y[0]);return}const v=y.indexOf(i());if(v===0){o.loop&&a(y[y.length-1]);return}a(y[v-1])},closeMenu:()=>{h(!1),a(void 0)},autoFocusMenu:()=>f(),setAutoFocusMenu:h,generateId:Wt(()=>s.id),orientation:()=>o.orientation};q(()=>{i()==null&&h(!1)}),nc({onInteractOutside:()=>{m.closeMenu(),setTimeout(()=>m.closeMenu())},shouldExcludeElement:y=>[t,...c().values()].flat().some(v=>Ne(v,y))},()=>t);const w=y=>{y.key==="Alt"&&(y.preventDefault(),y.stopPropagation(),m.value()===void 0?m.nextMenu():m.closeMenu())};return q(()=>{o.focusOnAlt?window.addEventListener("keydown",w):window.removeEventListener("keydown",w),W(()=>{window.removeEventListener("keydown",w)})}),q(()=>{i()!=null&&u(i())}),S(Bc.Provider,{value:m,get children(){return S(me,A({as:"div",ref(y){var v=be(b=>t=b,o.ref);typeof v=="function"&&v(y)},role:"menubar",get"data-orientation"(){return o.orientation},get"aria-orientation"(){return o.orientation}},s))}})}function Qy(e){const t=Un();if(go()===void 0&&Object.hasOwn(e,"href")){const r=t.generateId("link-trigger-")+Re();return S(Yc,{value:r,get children(){return S(dl,e)}})}return dl(e)}var Yy={};pn(Yy,{Root:()=>Oi,Separator:()=>Zy});function Oi(e){let t;const n=ee({orientation:"horizontal"},e),[r,o]=K(n,["ref","orientation"]),s=io(()=>t,()=>"hr");return S(me,A({as:"hr",ref(i){var a=be(l=>t=l,r.ref);typeof a=="function"&&a(i)},get role(){return s()!=="hr"?"separator":void 0},get"aria-orientation"(){return r.orientation==="vertical"?"vertical":void 0},get"data-orientation"(){return r.orientation}},o))}var Zy=Oi,Zc=he("<li role=presentation>"),Jy=he("<nav>");function ev(e){let t;const n=Un(),r=ee({size:15},e),[o,s]=K(r,["ref"]),[i,a]=z(0),l=()=>n.orientation()==="horizontal";return q(Me(n.value,u=>{setTimeout(()=>{if(!u||u.includes("link-trigger-"))return;const c=document.querySelector(`[data-kb-menu-value-trigger="${u}"]`);if(!c||!t)return;const d=c.getBoundingClientRect()[l()?"x":"y"]+c.getBoundingClientRect()[l()?"width":"height"]/2,f=window.getComputedStyle(t),h=t.getBoundingClientRect()[l()?"x":"y"]+t.getBoundingClientRect()[l()?"width":"height"]/2-Number.parseFloat(f.transform.split(",")[l()?4:5]);a(d-h)})})),S($c,A({ref(u){var c=be(d=>t=d,o.ref);typeof c=="function"&&c(u)},get style(){return{transform:`translate${l()?"X":"Y"}(${i()}px)`,color:"red"}}},s))}function Jc(e){const t=Ir(),n=Un(),r=yt(),[o,s]=z(),[i,a]=K(e,["onPointerEnter","onPointerLeave"]),l=c=>{ce(c,i.onPointerEnter),t.cancelLeaveTimer()},u=c=>{ce(c,i.onPointerLeave),t.startLeaveTimer()};return q(Me(n.value,c=>{no(()=>{if(!c||c.includes("link-trigger-")){t.setPreviousMenu(void 0);return}if(c===r.value()){if(t.previousMenu()!=null){const g=[...n.menus()],p=g.indexOf(t.previousMenu()),m=g.indexOf(c);p<m?s("from-end"):s("from-start")}else s(void 0);t.setPreviousMenu(c);return}const d=[...n.menus()],f=d.indexOf(t.previousMenu()),h=d.indexOf(c);f>h?s("to-end"):s("to-start")})})),S($y,A({as:"ul",onPointerEnter:l,onPointerLeave:u,onInteractOutside:()=>{t.setAutoFocusMenu(!1)},get"data-motion"(){return o()}},a))}function ed(e){return(()=>{var t=Zc();return fe(t,S(Ty,A({as:"a"},e))),t})()}function td(e){const t=Un(),n=Ir(),[r,o]=K(e,["value"]),s=Re(),i=t.generateId(`navigation-menu-menu-${s}`),a=ee({id:i},o),l=()=>r.value??s,[u,c]=z(!1),d=()=>{var f,h;t.value()!==l()&&c(!1),(f=n.viewportRef())==null||f.removeEventListener("animationend",d),(h=n.viewportRef())==null||h.removeEventListener("animationcancel",d)};return q(Me(t.value,f=>{if(f===l())c(!0);else{const h=n.viewportRef();if(!h||["","none"].includes(window.getComputedStyle(h).animationName)){c(!1);return}h.addEventListener("animationend",d)}})),S(Yc,A({get forceMount(){return u()},get value(){return l()}},a))}function nd(e){const t=Ir(),n=Mt(),[r,o]=K(e,["ref"]);return S(Ce,{get when(){return t.viewportPresent()},get children(){return S(ky,A({ref(s){var i=be(a=>{a&&a.setAttribute("role","presentation")},r.ref);typeof i=="function"&&i(s)},get mount(){return N(()=>n.parentMenuContext()==null)()?t.viewportRef():void 0}},o))}})}function rd(e){const t=ee({delayDuration:200,skipDelayDuration:300},e),[n,r,o]=K(t,["ref","delayDuration","skipDelayDuration","autoFocusMenu","onAutoFocusMenuChange","defaultValue","value","onValueChange","forceMount"],["getAnchorRect","placement","gutter","shift","flip","slide","overlap","sameWidth","fitViewport","hideWhenDetached","detachedPadding","arrowPadding","overflowPadding"]),[s,i]=gt({value:()=>n.value,defaultValue:()=>n.defaultValue,onChange:T=>{var k;return(k=n.onValueChange)==null?void 0:k.call(n,T)}}),[a,l]=gt({value:()=>n.autoFocusMenu,defaultValue:()=>!1,onChange:n.onAutoFocusMenuChange}),[u,c]=z(),[d,f]=z(),[h,g]=z(r.placement??o.orientation==="vertical"?"right":"bottom");q(()=>{g(o.orientation==="vertical"?"right":"bottom")});let p;const[m,w]=z(),[y,v]=z(!1),[b,C]=z(!1);q(()=>{s()&&!s().includes("link-trigger-")&&a()?no(()=>{C(!0),v(!0)}):(C(!1),v(!1))});const O=N(()=>({"data-expanded":b()?"":void 0,"data-closed":b()?void 0:""})),{present:D}=Yr({show:()=>n.forceMount||y()||b(),element:()=>u()??null});q(()=>{D()||_.setPreviousMenu(void 0)});const _={dataset:O,delayDuration:()=>n.delayDuration,skipDelayDuration:()=>n.skipDelayDuration,autoFocusMenu:a,setAutoFocusMenu:l,startLeaveTimer:()=>{p=window.setTimeout(()=>{_.setAutoFocusMenu(!1),i(void 0)},_.skipDelayDuration())},cancelLeaveTimer:()=>{p&&clearTimeout(p)},rootRef:d,setRootRef:f,viewportRef:u,setViewportRef:c,viewportPresent:D,currentPlacement:h,previousMenu:m,setPreviousMenu:w};return S(Gc.Provider,{value:_,get children(){return S(ho,A({anchorRef:d,contentRef:u,get placement(){return h()},onCurrentPlacementChange:g},r,{get children(){var T=Jy();return fe(T,S(Xy,A({as:"ul",ref(k){var V=be(_.setRootRef,n.ref);typeof V=="function"&&V(k)},get value(){return s()??null},onValueChange:i,get autoFocusMenu(){return a()},onAutoFocusMenuChange:l},o))),T}}))}})}function od(e){const t=Ir(),n=go(),[r,o]=K(e,["onPointerEnter","onPointerLeave","onClick"]);let s;const i=u=>{ce(u,r.onClick),s&&clearTimeout(s)},a=u=>{ce(u,r.onPointerEnter),u.pointerType!=="touch"&&(t.cancelLeaveTimer(),t.dataset()["data-expanded"]!==""&&(s=window.setTimeout(()=>{var c;(c=n==null?void 0:n.triggerRef())==null||c.focus(),setTimeout(()=>{t.setAutoFocusMenu(!0)})},t.delayDuration())))},l=u=>{ce(u,r.onPointerLeave),u.pointerType!=="touch"&&(t.startLeaveTimer(),s&&clearTimeout(s))};return(()=>{var u=Zc();return fe(u,S(Qy,A({onClick:i,onPointerEnter:a,onPointerLeave:l},o))),u})()}function sd(e){const t=Ir(),n=Un(),[r,o]=z(),[s,i]=K(e,["ref","style","onEscapeKeyDown"]),a=()=>{n.setAutoFocusMenu(!1),n.closeMenu()},l=f=>{a()},u=im(r);q(Me(()=>n.value()?n.menuRefMap().get(n.value()):void 0,f=>{f===void 0||f[0]===void 0||o(f[0])}));const c=N(f=>{if(!(r()===void 0||!t.viewportPresent()))return u.height()===0?f:u.height()}),d=N(f=>{if(!(r()===void 0||!t.viewportPresent()))return u.width()===0?f:u.width()});return S(Ce,{get when(){return t.viewportPresent()},get children(){return S(ho.Positioner,{role:"presentation",get children(){return S(ci,A({as:"li",ref(f){var h=be(t.setViewportRef,s.ref);typeof h=="function"&&h(f)},get excludedElements(){return[t.rootRef]},bypassTopMostLayerCheck:!0,get style(){return gn({"--kb-menu-content-transform-origin":"var(--kb-popper-content-transform-origin)","--kb-navigation-menu-viewport-height":c()?`${c()}px`:void 0,"--kb-navigation-menu-viewport-width":d()?`${d()}px`:void 0,position:"relative"},s.style)},get onEscapeKeyDown(){return ve([s.onEscapeKeyDown,l])},onDismiss:a,get"data-orientation"(){return n.orientation()}},()=>t.dataset(),i))}})}})}Object.assign(rd,{Arrow:ev,CheckboxItem:Fy,Content:Jc,Group:qc,GroupLabel:Oy,Icon:Wc,Item:ed,ItemDescription:Dy,ItemIndicator:Ly,ItemLabel:_y,Portal:nd,RadioGroup:Ny,RadioItem:Ky,Menu:td,Separator:Oi,Sub:By,SubContent:Hy,SubTrigger:qy,Trigger:od,Viewport:sd});var tv=he('<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 nv=td,rv=e=>{const[t,n]=K(e,["class","children"]);return S(rd,A({gutter:6,get class(){return pe("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[N(()=>t.children),S(iv,{})]}}))},ov=e=>{const[t,n]=K(e,["class"]);return S(od,A({get class(){return pe("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))},sv=()=>S(Wc,{"aria-hidden":"true",get children(){return tv()}}),iv=e=>{const[t,n]=K(e,["class"]);return S(sd,A({get class(){return pe("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))},av=e=>{const[t,n]=K(e,["class"]);return S(nd,{get children(){return S(Jc,A({get class(){return pe("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))}})},Oo=e=>{const[t,n]=K(e,["class"]);return S(ed,A({get class(){return pe("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))};/**
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 jt(e,t){return typeof e=="function"?e(t):e}function Ue(e,t){return n=>{t.setState(r=>({...r,[e]:jt(n,r[e])}))}}function po(e){return e instanceof Function}function lv(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function uv(e,t){const n=[],r=o=>{o.forEach(s=>{n.push(s);const i=t(s);i!=null&&i.length&&r(i)})};return r(e),n}function X(e,t,n){let r=[],o;return s=>{let i;n.key&&n.debug&&(i=Date.now());const a=e(s);if(!(a.length!==r.length||a.some((c,d)=>r[d]!==c)))return o;r=a;let u;if(n.key&&n.debug&&(u=Date.now()),o=t(...a),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const c=Math.round((Date.now()-i)*100)/100,d=Math.round((Date.now()-u)*100)/100,f=d/16,h=(g,p)=>{for(g=String(g);g.length<p;)g=" "+g;return g};console.info(`%c⏱ ${h(d,5)} /${h(c,5)} ms`,`
16
- font-size: .6rem;
17
- font-weight: bold;
18
- color: hsl(${Math.max(0,Math.min(120-120*f,120))}deg 100% 31%);`,n==null?void 0:n.key)}return o}}function Q(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 cv(e,t,n,r){const o=()=>{var i;return(i=s.getValue())!=null?i:e.options.renderFallbackValue},s={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:o,getContext:X(()=>[e,n,t,s],(i,a,l,u)=>({table:i,column:a,row:l,cell:u,getValue:u.getValue,renderValue:u.renderValue}),Q(e.options,"debugCells"))};return e._features.forEach(i=>{i.createCell==null||i.createCell(s,n,t,e)},{}),s}function dv(e,t,n,r){var o,s;const a={...e._getDefaultColumnDef(),...t},l=a.accessorKey;let u=(o=(s=a.id)!=null?s:l?typeof String.prototype.replaceAll=="function"?l.replaceAll(".","_"):l.replace(/\./g,"_"):void 0)!=null?o:typeof a.header=="string"?a.header:void 0,c;if(a.accessorFn?c=a.accessorFn:l&&(l.includes(".")?c=f=>{let h=f;for(const p of l.split(".")){var g;h=(g=h)==null?void 0:g[p]}return h}:c=f=>f[a.accessorKey]),!u)throw new Error;let d={id:`${String(u)}`,accessorFn:c,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:X(()=>[!0],()=>{var f;return[d,...(f=d.columns)==null?void 0:f.flatMap(h=>h.getFlatColumns())]},Q(e.options,"debugColumns")),getLeafColumns:X(()=>[e._getOrderColumnsFn()],f=>{var h;if((h=d.columns)!=null&&h.length){let g=d.columns.flatMap(p=>p.getLeafColumns());return f(g)}return[d]},Q(e.options,"debugColumns"))};for(const f of e._features)f.createColumn==null||f.createColumn(d,e);return d}const $e="debugHeaders";function hl(e,t,n){var r;let s={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 i=[],a=l=>{l.subHeaders&&l.subHeaders.length&&l.subHeaders.map(a),i.push(l)};return a(s),i},getContext:()=>({table:e,header:s,column:t})};return e._features.forEach(i=>{i.createHeader==null||i.createHeader(s,e)}),s}const fv={createTable:e=>{e.getHeaderGroups=X(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>{var s,i;const a=(s=r==null?void 0:r.map(d=>n.find(f=>f.id===d)).filter(Boolean))!=null?s:[],l=(i=o==null?void 0:o.map(d=>n.find(f=>f.id===d)).filter(Boolean))!=null?i:[],u=n.filter(d=>!(r!=null&&r.includes(d.id))&&!(o!=null&&o.includes(d.id)));return kr(t,[...a,...u,...l],e)},Q(e.options,$e)),e.getCenterHeaderGroups=X(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>(n=n.filter(s=>!(r!=null&&r.includes(s.id))&&!(o!=null&&o.includes(s.id))),kr(t,n,e,"center")),Q(e.options,$e)),e.getLeftHeaderGroups=X(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var o;const s=(o=r==null?void 0:r.map(i=>n.find(a=>a.id===i)).filter(Boolean))!=null?o:[];return kr(t,s,e,"left")},Q(e.options,$e)),e.getRightHeaderGroups=X(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var o;const s=(o=r==null?void 0:r.map(i=>n.find(a=>a.id===i)).filter(Boolean))!=null?o:[];return kr(t,s,e,"right")},Q(e.options,$e)),e.getFooterGroups=X(()=>[e.getHeaderGroups()],t=>[...t].reverse(),Q(e.options,$e)),e.getLeftFooterGroups=X(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),Q(e.options,$e)),e.getCenterFooterGroups=X(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),Q(e.options,$e)),e.getRightFooterGroups=X(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),Q(e.options,$e)),e.getFlatHeaders=X(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),Q(e.options,$e)),e.getLeftFlatHeaders=X(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),Q(e.options,$e)),e.getCenterFlatHeaders=X(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),Q(e.options,$e)),e.getRightFlatHeaders=X(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),Q(e.options,$e)),e.getCenterLeafHeaders=X(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Q(e.options,$e)),e.getLeftLeafHeaders=X(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Q(e.options,$e)),e.getRightLeafHeaders=X(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Q(e.options,$e)),e.getLeafHeaders=X(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var o,s,i,a,l,u;return[...(o=(s=t[0])==null?void 0:s.headers)!=null?o:[],...(i=(a=n[0])==null?void 0:a.headers)!=null?i:[],...(l=(u=r[0])==null?void 0:u.headers)!=null?l:[]].map(c=>c.getLeafHeaders()).flat()},Q(e.options,$e))}};function kr(e,t,n,r){var o,s;let i=0;const a=function(f,h){h===void 0&&(h=1),i=Math.max(i,h),f.filter(g=>g.getIsVisible()).forEach(g=>{var p;(p=g.columns)!=null&&p.length&&a(g.columns,h+1)},0)};a(e);let l=[];const u=(f,h)=>{const g={depth:h,id:[r,`${h}`].filter(Boolean).join("_"),headers:[]},p=[];f.forEach(m=>{const w=[...p].reverse()[0],y=m.column.depth===g.depth;let v,b=!1;if(y&&m.column.parent?v=m.column.parent:(v=m.column,b=!0),w&&(w==null?void 0:w.column)===v)w.subHeaders.push(m);else{const C=hl(n,v,{id:[r,h,v.id,m==null?void 0:m.id].filter(Boolean).join("_"),isPlaceholder:b,placeholderId:b?`${p.filter(O=>O.column===v).length}`:void 0,depth:h,index:p.length});C.subHeaders.push(m),p.push(C)}g.headers.push(m),m.headerGroup=g}),l.push(g),h>0&&u(p,h-1)},c=t.map((f,h)=>hl(n,f,{depth:i,index:h}));u(c,i-1),l.reverse();const d=f=>f.filter(g=>g.column.getIsVisible()).map(g=>{let p=0,m=0,w=[0];g.subHeaders&&g.subHeaders.length?(w=[],d(g.subHeaders).forEach(v=>{let{colSpan:b,rowSpan:C}=v;p+=b,w.push(C)})):p=1;const y=Math.min(...w);return m=m+y,g.colSpan=p,g.rowSpan=m,{colSpan:p,rowSpan:m}});return d((o=(s=l[0])==null?void 0:s.headers)!=null?o:[]),l}const Ti=(e,t,n,r,o,s,i)=>{let a={id:t,index:r,original:n,depth:o,parentId:i,_valuesCache:{},_uniqueValuesCache:{},getValue:l=>{if(a._valuesCache.hasOwnProperty(l))return a._valuesCache[l];const u=e.getColumn(l);if(u!=null&&u.accessorFn)return a._valuesCache[l]=u.accessorFn(a.original,r),a._valuesCache[l]},getUniqueValues:l=>{if(a._uniqueValuesCache.hasOwnProperty(l))return a._uniqueValuesCache[l];const u=e.getColumn(l);if(u!=null&&u.accessorFn)return u.columnDef.getUniqueValues?(a._uniqueValuesCache[l]=u.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[l]):(a._uniqueValuesCache[l]=[a.getValue(l)],a._uniqueValuesCache[l])},renderValue:l=>{var u;return(u=a.getValue(l))!=null?u:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>uv(a.subRows,l=>l.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let l=[],u=a;for(;;){const c=u.getParentRow();if(!c)break;l.push(c),u=c}return l.reverse()},getAllCells:X(()=>[e.getAllLeafColumns()],l=>l.map(u=>cv(e,a,u,u.id)),Q(e.options,"debugRows")),_getAllCellsByColumnId:X(()=>[a.getAllCells()],l=>l.reduce((u,c)=>(u[c.column.id]=c,u),{}),Q(e.options,"debugRows"))};for(let l=0;l<e._features.length;l++){const u=e._features[l];u==null||u.createRow==null||u.createRow(a,e)}return a},hv={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()}}},id=(e,t,n)=>{var r,o;const s=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(s))};id.autoRemove=e=>tt(e);const ad=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};ad.autoRemove=e=>tt(e);const ld=(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())};ld.autoRemove=e=>tt(e);const ud=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};ud.autoRemove=e=>tt(e)||!(e!=null&&e.length);const cd=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});cd.autoRemove=e=>tt(e)||!(e!=null&&e.length);const dd=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});dd.autoRemove=e=>tt(e)||!(e!=null&&e.length);const fd=(e,t,n)=>e.getValue(t)===n;fd.autoRemove=e=>tt(e);const hd=(e,t,n)=>e.getValue(t)==n;hd.autoRemove=e=>tt(e);const Di=(e,t,n)=>{let[r,o]=n;const s=e.getValue(t);return s>=r&&s<=o};Di.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,o=typeof n!="number"?parseFloat(n):n,s=t===null||Number.isNaN(r)?-1/0:r,i=n===null||Number.isNaN(o)?1/0:o;if(s>i){const a=s;s=i,i=a}return[s,i]};Di.autoRemove=e=>tt(e)||tt(e[0])&&tt(e[1]);const St={includesString:id,includesStringSensitive:ad,equalsString:ld,arrIncludes:ud,arrIncludesAll:cd,arrIncludesSome:dd,equals:fd,weakEquals:hd,inNumberRange:Di};function tt(e){return e==null||e===""}const gv={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Ue("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"?St.includesString:typeof r=="number"?St.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?St.equals:Array.isArray(r)?St.arrIncludes:St.weakEquals},e.getFilterFn=()=>{var n,r;return po(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:St[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(),s=r==null?void 0:r.find(c=>c.id===e.id),i=jt(n,s?s.value:void 0);if(gl(o,i,e)){var a;return(a=r==null?void 0:r.filter(c=>c.id!==e.id))!=null?a:[]}const l={id:e.id,value:i};if(s){var u;return(u=r==null?void 0:r.map(c=>c.id===e.id?l:c))!=null?u:[]}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 s;return(s=jt(t,o))==null?void 0:s.filter(i=>{const a=n.find(l=>l.id===i.id);if(a){const l=a.getFilterFn();if(gl(l,i.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 gl(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const pv=(e,t,n)=>n.reduce((r,o)=>{const s=o.getValue(e);return r+(typeof s=="number"?s:0)},0),mv=(e,t,n)=>{let r;return n.forEach(o=>{const s=o.getValue(e);s!=null&&(r>s||r===void 0&&s>=s)&&(r=s)}),r},yv=(e,t,n)=>{let r;return n.forEach(o=>{const s=o.getValue(e);s!=null&&(r<s||r===void 0&&s>=s)&&(r=s)}),r},vv=(e,t,n)=>{let r,o;return n.forEach(s=>{const i=s.getValue(e);i!=null&&(r===void 0?i>=i&&(r=o=i):(r>i&&(r=i),o<i&&(o=i)))}),[r,o]},wv=(e,t)=>{let n=0,r=0;if(t.forEach(o=>{let s=o.getValue(e);s!=null&&(s=+s)>=s&&(++n,r+=s)}),n)return r/n},bv=(e,t)=>{if(!t.length)return;const n=t.map(s=>s.getValue(e));if(!lv(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),o=n.sort((s,i)=>s-i);return n.length%2!==0?o[r]:(o[r-1]+o[r])/2},Sv=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),xv=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,Cv=(e,t)=>t.length,To={sum:pv,min:mv,max:yv,extent:vv,mean:wv,median:bv,unique:Sv,uniqueCount:xv,count:Cv},Ev={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:Ue("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 To.sum;if(Object.prototype.toString.call(r)==="[object Date]")return To.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return po(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:To[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 Rv(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(s=>!t.includes(s.id));return n==="remove"?r:[...t.map(s=>e.find(i=>i.id===s)).filter(Boolean),...r]}const Pv={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Ue("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=X(n=>[lr(t,n)],n=>n.findIndex(r=>r.id===e.id),Q(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=lr(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=lr(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=X(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>o=>{let s=[];if(!(t!=null&&t.length))s=o;else{const i=[...t],a=[...o];for(;a.length&&i.length;){const l=i.shift(),u=a.findIndex(c=>c.id===l);u>-1&&s.push(a.splice(u,1)[0])}s=[...s,...a]}return Rv(s,n,r)},Q(e.options,"debugTable"))}},Do=()=>({left:[],right:[]}),Iv={getInitialState:e=>({columnPinning:Do(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Ue("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(o=>o.id).filter(Boolean);t.setColumnPinning(o=>{var s,i;if(n==="right"){var a,l;return{left:((a=o==null?void 0:o.left)!=null?a:[]).filter(d=>!(r!=null&&r.includes(d))),right:[...((l=o==null?void 0:o.right)!=null?l:[]).filter(d=>!(r!=null&&r.includes(d))),...r]}}if(n==="left"){var u,c;return{left:[...((u=o==null?void 0:o.left)!=null?u:[]).filter(d=>!(r!=null&&r.includes(d))),...r],right:((c=o==null?void 0:o.right)!=null?c:[]).filter(d=>!(r!=null&&r.includes(d)))}}return{left:((s=o==null?void 0:o.left)!=null?s:[]).filter(d=>!(r!=null&&r.includes(d))),right:((i=o==null?void 0:o.right)!=null?i:[]).filter(d=>!(r!=null&&r.includes(d)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var o,s,i;return((o=r.columnDef.enablePinning)!=null?o:!0)&&((s=(i=t.options.enableColumnPinning)!=null?i:t.options.enablePinning)!=null?s:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(a=>a.id),{left:r,right:o}=t.getState().columnPinning,s=n.some(a=>r==null?void 0:r.includes(a)),i=n.some(a=>o==null?void 0:o.includes(a));return s?"left":i?"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=X(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,o)=>{const s=[...r??[],...o??[]];return n.filter(i=>!s.includes(i.column.id))},Q(t.options,"debugRows")),e.getLeftVisibleCells=X(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(s=>n.find(i=>i.column.id===s)).filter(Boolean).map(s=>({...s,position:"left"})),Q(t.options,"debugRows")),e.getRightVisibleCells=X(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(s=>n.find(i=>i.column.id===s)).filter(Boolean).map(s=>({...s,position:"right"})),Q(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?Do():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:Do())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var o,s;return!!((o=r.left)!=null&&o.length||(s=r.right)!=null&&s.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=X(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),Q(e.options,"debugColumns")),e.getRightLeafColumns=X(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),Q(e.options,"debugColumns")),e.getCenterLeafColumns=X(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const o=[...n??[],...r??[]];return t.filter(s=>!o.includes(s.id))},Q(e.options,"debugColumns"))}},Vr={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Lo=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),Mv={getDefaultColumnDef:()=>Vr,getInitialState:e=>({columnSizing:{},columnSizingInfo:Lo(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Ue("columnSizing",e),onColumnSizingInfoChange:Ue("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,o;const s=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Vr.minSize,(r=s??e.columnDef.size)!=null?r:Vr.size),(o=e.columnDef.maxSize)!=null?o:Vr.maxSize)},e.getStart=X(n=>[n,lr(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((o,s)=>o+s.getSize(),0),Q(t.options,"debugColumns")),e.getAfter=X(n=>[n,lr(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((o,s)=>o+s.getSize(),0),Q(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 s;n+=(s=o.column.getSize())!=null?s: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 s=>{if(!r||!o||(s.persist==null||s.persist(),_o(s)&&s.touches&&s.touches.length>1))return;const i=e.getSize(),a=e?e.getLeafHeaders().map(w=>[w.column.id,w.column.getSize()]):[[r.id,r.getSize()]],l=_o(s)?Math.round(s.touches[0].clientX):s.clientX,u={},c=(w,y)=>{typeof y=="number"&&(t.setColumnSizingInfo(v=>{var b,C;const O=t.options.columnResizeDirection==="rtl"?-1:1,D=(y-((b=v==null?void 0:v.startOffset)!=null?b:0))*O,_=Math.max(D/((C=v==null?void 0:v.startSize)!=null?C:0),-.999999);return v.columnSizingStart.forEach(T=>{let[k,V]=T;u[k]=Math.round(Math.max(V+V*_,0)*100)/100}),{...v,deltaOffset:D,deltaPercentage:_}}),(t.options.columnResizeMode==="onChange"||w==="end")&&t.setColumnSizing(v=>({...v,...u})))},d=w=>c("move",w),f=w=>{c("end",w),t.setColumnSizingInfo(y=>({...y,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},h=n||typeof document<"u"?document:null,g={moveHandler:w=>d(w.clientX),upHandler:w=>{h==null||h.removeEventListener("mousemove",g.moveHandler),h==null||h.removeEventListener("mouseup",g.upHandler),f(w.clientX)}},p={moveHandler:w=>(w.cancelable&&(w.preventDefault(),w.stopPropagation()),d(w.touches[0].clientX),!1),upHandler:w=>{var y;h==null||h.removeEventListener("touchmove",p.moveHandler),h==null||h.removeEventListener("touchend",p.upHandler),w.cancelable&&(w.preventDefault(),w.stopPropagation()),f((y=w.touches[0])==null?void 0:y.clientX)}},m=Fv()?{passive:!1}:!1;_o(s)?(h==null||h.addEventListener("touchmove",p.moveHandler,m),h==null||h.addEventListener("touchend",p.upHandler,m)):(h==null||h.addEventListener("mousemove",g.moveHandler,m),h==null||h.addEventListener("mouseup",g.upHandler,m)),t.setColumnSizingInfo(w=>({...w,startOffset:l,startSize:i,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?Lo():(n=e.initialState.columnSizingInfo)!=null?n:Lo())},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 Nr=null;function Fv(){if(typeof Nr=="boolean")return Nr;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 Nr=e,Nr}function _o(e){return e.type==="touchstart"}const $v={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Ue("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(s=>s.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=X(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),Q(t.options,"debugRows")),e.getVisibleCells=X(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],Q(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>X(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(s=>s.getIsVisible==null?void 0:s.getIsVisible()),Q(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,s)=>({...o,[s.id]:n||!(s.getCanHide!=null&&s.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 lr(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const Av={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()}}},Ov={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Ue("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,s;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((s=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?s:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>St.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return po(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:St[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},Tv={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Ue("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,s;e.setExpanded(r?{}:(o=(s=e.initialState)==null?void 0:s.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(s=>{const i=s.split(".");r=Math.max(r,i.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 s=r===!0?!0:!!(r!=null&&r[e.id]);let i={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(a=>{i[a]=!0}):i=r,n=(o=n)!=null?o:!s,!s&&n)return{...i,[e.id]:!0};if(s&&!n){const{[e.id]:a,...l}=i;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()}}}},Ns=0,Ks=10,ko=()=>({pageIndex:Ns,pageSize:Ks}),Dv={getInitialState:e=>({...e,pagination:{...ko(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Ue("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=s=>jt(r,s);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?ko():(o=e.initialState.pagination)!=null?o:ko())},e.setPageIndex=r=>{e.setPagination(o=>{let s=jt(r,o.pageIndex);const i=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return s=Math.max(0,Math.min(s,i)),{...o,pageIndex:s}})},e.resetPageIndex=r=>{var o,s;e.setPageIndex(r?Ns:(o=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageIndex)!=null?o:Ns)},e.resetPageSize=r=>{var o,s;e.setPageSize(r?Ks:(o=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageSize)!=null?o:Ks)},e.setPageSize=r=>{e.setPagination(o=>{const s=Math.max(1,jt(r,o.pageSize)),i=o.pageSize*o.pageIndex,a=Math.floor(i/s);return{...o,pageIndex:a,pageSize:s}})},e.setPageCount=r=>e.setPagination(o=>{var s;let i=jt(r,(s=e.options.pageCount)!=null?s:-1);return typeof i=="number"&&(i=Math.max(-1,i)),{...o,pageCount:i}}),e.getPageOptions=X(()=>[e.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((s,i)=>i)),o},Q(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}}},Vo=()=>({top:[],bottom:[]}),Lv={getInitialState:e=>({rowPinning:Vo(),...e}),getDefaultOptions:e=>({onRowPinningChange:Ue("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,o)=>{const s=r?e.getLeafRows().map(l=>{let{id:u}=l;return u}):[],i=o?e.getParentRows().map(l=>{let{id:u}=l;return u}):[],a=new Set([...i,e.id,...s]);t.setRowPinning(l=>{var u,c;if(n==="bottom"){var d,f;return{top:((d=l==null?void 0:l.top)!=null?d:[]).filter(p=>!(a!=null&&a.has(p))),bottom:[...((f=l==null?void 0:l.bottom)!=null?f:[]).filter(p=>!(a!=null&&a.has(p))),...Array.from(a)]}}if(n==="top"){var h,g;return{top:[...((h=l==null?void 0:l.top)!=null?h:[]).filter(p=>!(a!=null&&a.has(p))),...Array.from(a)],bottom:((g=l==null?void 0:l.bottom)!=null?g:[]).filter(p=>!(a!=null&&a.has(p)))}}return{top:((u=l==null?void 0:l.top)!=null?u:[]).filter(p=>!(a!=null&&a.has(p))),bottom:((c=l==null?void 0:l.bottom)!=null?c:[]).filter(p=>!(a!=null&&a.has(p)))}})},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,s=n.some(a=>r==null?void 0:r.includes(a)),i=n.some(a=>o==null?void 0:o.includes(a));return s?"top":i?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();if(!o)return-1;const s=(n=o==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(i=>{let{id:a}=i;return a});return(r=s==null?void 0:s.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?Vo():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:Vo())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var o,s;return!!((o=r.top)!=null&&o.length||(s=r.bottom)!=null&&s.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(n??[]).map(i=>{const a=e.getRow(i,!0);return a.getIsAllParentsExpanded()?a:null}):(n??[]).map(i=>t.find(a=>a.id===i))).filter(Boolean).map(i=>({...i,position:r}))},e.getTopRows=X(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),Q(e.options,"debugRows")),e.getBottomRows=X(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),Q(e.options,"debugRows")),e.getCenterRows=X(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const o=new Set([...n??[],...r??[]]);return t.filter(s=>!o.has(s.id))},Q(e.options,"debugRows"))}},_v={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Ue("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(s=>{s.getCanSelect()&&(r[s.id]=!0)}):o.forEach(s=>{delete r[s.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach(s=>{js(o,s.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=X(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?No(e,n):{rows:[],flatRows:[],rowsById:{}},Q(e.options,"debugTable")),e.getFilteredSelectedRowModel=X(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?No(e,n):{rows:[],flatRows:[],rowsById:{}},Q(e.options,"debugTable")),e.getGroupedSelectedRowModel=X(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?No(e,n):{rows:[],flatRows:[],rowsById:{}},Q(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(s=>{var i;if(n=typeof n<"u"?n:!o,e.getCanSelect()&&o===n)return s;const a={...s};return js(a,e.id,n,(i=r==null?void 0:r.selectChildren)!=null?i:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return Li(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return zs(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return zs(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)}}}},js=(e,t,n,r,o)=>{var s;const i=o.getRow(t,!0);n?(i.getCanMultiSelect()||Object.keys(e).forEach(a=>delete e[a]),i.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(s=i.subRows)!=null&&s.length&&i.getCanSelectSubRows()&&i.subRows.forEach(a=>js(e,a.id,n,r,o))};function No(e,t){const n=e.getState().rowSelection,r=[],o={},s=function(i,a){return i.map(l=>{var u;const c=Li(l,n);if(c&&(r.push(l),o[l.id]=l),(u=l.subRows)!=null&&u.length&&(l={...l,subRows:s(l.subRows)}),c)return l}).filter(Boolean)};return{rows:s(t.rows),flatRows:r,rowsById:o}}function Li(e,t){var n;return(n=t[e.id])!=null?n:!1}function zs(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let o=!0,s=!1;return e.subRows.forEach(i=>{if(!(s&&!o)&&(i.getCanSelect()&&(Li(i,t)?s=!0:o=!1),i.subRows&&i.subRows.length)){const a=zs(i,t);a==="all"?s=!0:(a==="some"&&(s=!0),o=!1)}}),o?"all":s?"some":!1}const Bs=/([0-9]+)/gm,kv=(e,t,n)=>gd(qt(e.getValue(n)).toLowerCase(),qt(t.getValue(n)).toLowerCase()),Vv=(e,t,n)=>gd(qt(e.getValue(n)),qt(t.getValue(n))),Nv=(e,t,n)=>_i(qt(e.getValue(n)).toLowerCase(),qt(t.getValue(n)).toLowerCase()),Kv=(e,t,n)=>_i(qt(e.getValue(n)),qt(t.getValue(n))),jv=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},zv=(e,t,n)=>_i(e.getValue(n),t.getValue(n));function _i(e,t){return e===t?0:e>t?1:-1}function qt(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function gd(e,t){const n=e.split(Bs).filter(Boolean),r=t.split(Bs).filter(Boolean);for(;n.length&&r.length;){const o=n.shift(),s=r.shift(),i=parseInt(o,10),a=parseInt(s,10),l=[i,a].sort();if(isNaN(l[0])){if(o>s)return 1;if(s>o)return-1;continue}if(isNaN(l[1]))return isNaN(i)?-1:1;if(i>a)return 1;if(a>i)return-1}return n.length-r.length}const er={alphanumeric:kv,alphanumericCaseSensitive:Vv,text:Nv,textCaseSensitive:Kv,datetime:jv,basic:zv},Bv={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Ue("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 s=o==null?void 0:o.getValue(e.id);if(Object.prototype.toString.call(s)==="[object Date]")return er.datetime;if(typeof s=="string"&&(r=!0,s.split(Bs).length>1))return er.alphanumeric}return r?er.text:er.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 po(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:er[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const o=e.getNextSortingOrder(),s=typeof n<"u"&&n!==null;t.setSorting(i=>{const a=i==null?void 0:i.find(h=>h.id===e.id),l=i==null?void 0:i.findIndex(h=>h.id===e.id);let u=[],c,d=s?n:o==="desc";if(i!=null&&i.length&&e.getCanMultiSort()&&r?a?c="toggle":c="add":i!=null&&i.length&&l!==i.length-1?c="replace":a?c="toggle":c="replace",c==="toggle"&&(s||o||(c="remove")),c==="add"){var f;u=[...i,{id:e.id,desc:d}],u.splice(0,u.length-((f=t.options.maxMultiSortColCount)!=null?f:Number.MAX_SAFE_INTEGER))}else c==="toggle"?u=i.map(h=>h.id===e.id?{...h,desc:d}:h):c==="remove"?u=i.filter(h=>h.id!==e.id):u=[{id:e.id,desc:d}];return u})},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 s=e.getFirstSortDir(),i=e.getIsSorted();return i?i!==s&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(o=t.options.enableMultiRemove)!=null)||o)?!1:i==="desc"?"asc":"desc":s},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())}},Gv=[fv,$v,Pv,Iv,hv,gv,Av,Ov,Bv,Ev,Tv,Dv,Lv,_v,Mv];function Hv(e){var t,n;const r=[...Gv,...(t=e._features)!=null?t:[]];let o={_features:r};const s=o._features.reduce((f,h)=>Object.assign(f,h.getDefaultOptions==null?void 0:h.getDefaultOptions(o)),{}),i=f=>o.options.mergeOptions?o.options.mergeOptions(s,f):{...s,...f};let l={...{},...(n=e.initialState)!=null?n:{}};o._features.forEach(f=>{var h;l=(h=f.getInitialState==null?void 0:f.getInitialState(l))!=null?h:l});const u=[];let c=!1;const d={_features:r,options:{...s,...e},initialState:l,_queue:f=>{u.push(f),c||(c=!0,Promise.resolve().then(()=>{for(;u.length;)u.shift()();c=!1}).catch(h=>setTimeout(()=>{throw h})))},reset:()=>{o.setState(o.initialState)},setOptions:f=>{const h=jt(f,o.options);o.options=i(h)},getState:()=>o.options.state,setState:f=>{o.options.onStateChange==null||o.options.onStateChange(f)},_getRowId:(f,h,g)=>{var p;return(p=o.options.getRowId==null?void 0:o.options.getRowId(f,h,g))!=null?p:`${g?[g.id,h].join("."):h}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(f,h)=>{let g=(h?o.getPrePaginationRowModel():o.getRowModel()).rowsById[f];if(!g&&(g=o.getCoreRowModel().rowsById[f],!g))throw new Error;return g},_getDefaultColumnDef:X(()=>[o.options.defaultColumn],f=>{var h;return f=(h=f)!=null?h:{},{header:g=>{const p=g.header.column.columnDef;return p.accessorKey?p.accessorKey:p.accessorFn?p.id:null},cell:g=>{var p,m;return(p=(m=g.renderValue())==null||m.toString==null?void 0:m.toString())!=null?p:null},...o._features.reduce((g,p)=>Object.assign(g,p.getDefaultColumnDef==null?void 0:p.getDefaultColumnDef()),{}),...f}},Q(e,"debugColumns")),_getColumnDefs:()=>o.options.columns,getAllColumns:X(()=>[o._getColumnDefs()],f=>{const h=function(g,p,m){return m===void 0&&(m=0),g.map(w=>{const y=dv(o,w,m,p),v=w;return y.columns=v.columns?h(v.columns,y,m+1):[],y})};return h(f)},Q(e,"debugColumns")),getAllFlatColumns:X(()=>[o.getAllColumns()],f=>f.flatMap(h=>h.getFlatColumns()),Q(e,"debugColumns")),_getAllFlatColumnsById:X(()=>[o.getAllFlatColumns()],f=>f.reduce((h,g)=>(h[g.id]=g,h),{}),Q(e,"debugColumns")),getAllLeafColumns:X(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(f,h)=>{let g=f.flatMap(p=>p.getLeafColumns());return h(g)},Q(e,"debugColumns")),getColumn:f=>o._getAllFlatColumnsById()[f]};Object.assign(o,d);for(let f=0;f<o._features.length;f++){const h=o._features[f];h==null||h.createTable==null||h.createTable(o)}return o}function Uv(){return e=>X(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,s,i){s===void 0&&(s=0);const a=[];for(let u=0;u<o.length;u++){const c=Ti(e,e._getRowId(o[u],u,i),o[u],u,s,void 0,i==null?void 0:i.id);if(n.flatRows.push(c),n.rowsById[c.id]=c,a.push(c),e.options.getSubRows){var l;c.originalSubRows=e.options.getSubRows(o[u],u),(l=c.originalSubRows)!=null&&l.length&&(c.subRows=r(c.originalSubRows,s+1,c))}}return a};return n.rows=r(t),n},Q(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function qv(e){const t=[],n=r=>{var o;t.push(r),(o=r.subRows)!=null&&o.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function Wv(e,t,n){return n.options.filterFromLeafRows?Xv(e,t,n):Qv(e,t,n)}function Xv(e,t,n){var r;const o=[],s={},i=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,a=function(l,u){u===void 0&&(u=0);const c=[];for(let f=0;f<l.length;f++){var d;let h=l[f];const g=Ti(n,h.id,h.original,h.index,h.depth,void 0,h.parentId);if(g.columnFilters=h.columnFilters,(d=h.subRows)!=null&&d.length&&u<i){if(g.subRows=a(h.subRows,u+1),h=g,t(h)&&!g.subRows.length){c.push(h),s[h.id]=h,o.push(h);continue}if(t(h)||g.subRows.length){c.push(h),s[h.id]=h,o.push(h);continue}}else h=g,t(h)&&(c.push(h),s[h.id]=h,o.push(h))}return c};return{rows:a(e),flatRows:o,rowsById:s}}function Qv(e,t,n){var r;const o=[],s={},i=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,a=function(l,u){u===void 0&&(u=0);const c=[];for(let f=0;f<l.length;f++){let h=l[f];if(t(h)){var d;if((d=h.subRows)!=null&&d.length&&u<i){const p=Ti(n,h.id,h.original,h.index,h.depth,void 0,h.parentId);p.subRows=a(h.subRows,u+1),h=p}c.push(h),o.push(h),s[h.id]=h}}return c};return{rows:a(e),flatRows:o,rowsById:s}}function Yv(){return e=>X(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let f=0;f<t.flatRows.length;f++)t.flatRows[f].columnFilters={},t.flatRows[f].columnFiltersMeta={};return t}const o=[],s=[];(n??[]).forEach(f=>{var h;const g=e.getColumn(f.id);if(!g)return;const p=g.getFilterFn();p&&o.push({id:f.id,filterFn:p,resolvedValue:(h=p.resolveFilterValue==null?void 0:p.resolveFilterValue(f.value))!=null?h:f.value})});const i=(n??[]).map(f=>f.id),a=e.getGlobalFilterFn(),l=e.getAllLeafColumns().filter(f=>f.getCanGlobalFilter());r&&a&&l.length&&(i.push("__global__"),l.forEach(f=>{var h;s.push({id:f.id,filterFn:a,resolvedValue:(h=a.resolveFilterValue==null?void 0:a.resolveFilterValue(r))!=null?h:r})}));let u,c;for(let f=0;f<t.flatRows.length;f++){const h=t.flatRows[f];if(h.columnFilters={},o.length)for(let g=0;g<o.length;g++){u=o[g];const p=u.id;h.columnFilters[p]=u.filterFn(h,p,u.resolvedValue,m=>{h.columnFiltersMeta[p]=m})}if(s.length){for(let g=0;g<s.length;g++){c=s[g];const p=c.id;if(c.filterFn(h,p,c.resolvedValue,m=>{h.columnFiltersMeta[p]=m})){h.columnFilters.__global__=!0;break}}h.columnFilters.__global__!==!0&&(h.columnFilters.__global__=!1)}}const d=f=>{for(let h=0;h<i.length;h++)if(f.columnFilters[i[h]]===!1)return!1;return!0};return Wv(t.rows,d,e)},Q(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function Zv(e){return t=>X(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:o,pageIndex:s}=n;let{rows:i,flatRows:a,rowsById:l}=r;const u=o*s,c=u+o;i=i.slice(u,c);let d;t.options.paginateExpandedRows?d={rows:i,flatRows:a,rowsById:l}:d=qv({rows:i,flatRows:a,rowsById:l}),d.flatRows=[];const f=h=>{d.flatRows.push(h),h.subRows.length&&h.subRows.forEach(f)};return d.rows.forEach(f),d},Q(t.options,"debugTable"))}/**
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 pl(e,t){return e?typeof e=="function"?S(e,t):e:null}function Jv(e){const t=A({state:{},onStateChange:()=>{},renderFallbackValue:null,mergeOptions:(s,i)=>A(s,i)},e),n=Hv(t),[r,o]=Js(n.initialState);return Rt(()=>{n.setOptions(s=>A(s,e,{state:A(r,e.state||{}),onStateChange:i=>{o(i),e.onStateChange==null||e.onStateChange(i)}}))}),n}var mo=he("<li>"),ew=he("<ul>"),tw={};pn(tw,{Ellipsis:()=>ki,Item:()=>Vi,Items:()=>Ni,Next:()=>Ki,Pagination:()=>nw,Previous:()=>ji,Root:()=>zi});function ki(e){return(()=>{var t=mo();return fe(t,S(me,A({as:"div"},e))),t})()}var pd=Se();function yo(){const e=we(pd);if(e===void 0)throw new Error("[kobalte]: `usePaginationContext` must be used within a `Pagination` component");return e}function Vi(e){const t=yo(),[n,r]=K(e,["page","onClick"]),o=()=>t.page()===n.page,s=()=>{t.setPage(n.page)};return(()=>{var i=mo();return fe(i,S(It,A({get"aria-current"(){return o()?"page":void 0},get"data-current"(){return o()?"":void 0},get onClick(){return ve([n.onClick,s])}},r))),i})()}function Ni(e){const t=yo(),n=N(()=>{const{count:r,siblingCount:o,page:s,fixedItems:i,showFirst:a,showLast:l}=t,u=r()<2*o()+(i()?6:4);if(u)return{renderItemsDirectly:u};const c=a()&&s()-1>o(),d=l()&&r()-s()>o();let f=s()-(a()?2:1)>o(),h=r()-s()-(l()?1:0)>o(),g=Math.min(s()-1,o()),p=Math.min(r()-s(),o());if(i()!==!1){const m=g,w=p;g+=Math.max(o()-w,0),p+=Math.max(o()-m,0),c||p++,d||g++,i()===!0&&(f||p++,h||g++),s()-g-(a()?2:1)===1&&(f=!1,g++),r()-s()-p-(l()?1:0)===1&&(h=!1,p++)}return{showFirst:c,showLast:d,showFirstEllipsis:f,showLastEllipsis:h,previousSiblingCount:g,nextSiblingCount:p,renderItemsDirectly:u}});return S(Ce,{get when(){return n().renderItemsDirectly},get fallback(){return[S(Ce,{get when(){return n().showFirst},get children(){return t.renderItem(1)}}),S(Ce,{get when(){return n().showFirstEllipsis},get children(){return t.renderEllipsis()}}),S(Kt,{get each(){return[...Array(n().previousSiblingCount).keys()].reverse()},children:r=>N(()=>t.renderItem(t.page()-(r+1)))}),N(()=>t.renderItem(t.page())),S(Kt,{get each(){return[...Array(n().nextSiblingCount).keys()]},children:r=>N(()=>t.renderItem(t.page()+(r+1)))}),S(Ce,{get when(){return n().showLastEllipsis},get children(){return t.renderEllipsis()}}),S(Ce,{get when(){return n().showLast},get children(){return t.renderItem(t.count())}})]},get children(){return S(Kt,{get each(){return[...Array(t.count()).keys()]},children:r=>N(()=>t.renderItem(r+1))})}})}function Ki(e){const t=yo(),[n,r]=K(e,["onClick"]),o=()=>{t.setPage(t.page()+1)},s=()=>t.page()===t.count();return(()=>{var i=mo();return fe(i,S(It,A({get tabIndex(){return s()||t.page()===t.count()?-1:void 0},get disabled(){return s()},get"aria-disabled"(){return s()||void 0},get"data-disabled"(){return s()?"":void 0},get onClick(){return ve([n.onClick,o])}},r))),i})()}function ji(e){const t=yo(),[n,r]=K(e,["onClick"]),o=()=>{t.setPage(t.page()-1)},s=()=>t.page()===1;return(()=>{var i=mo();return fe(i,S(It,A({get tabIndex(){return s()||t.page()===1?-1:void 0},get disabled(){return s()},get"aria-disabled"(){return s()||void 0},get"data-disabled"(){return s()?"":void 0},get onClick(){return ve([n.onClick,o])}},r))),i})()}function zi(e){const t=`pagination-${Re()}`,n=ee({id:t},e),[r,o]=K(n,["page","defaultPage","onPageChange","count","siblingCount","showFirst","showLast","fixedItems","itemComponent","ellipsisComponent","disabled","children"]),s=gt({defaultValue:()=>r.defaultPage??1,onChange:r.onPageChange,value:()=>r.page}),i={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(s[0]()??1,r.count),setPage:s[1]};return S(pd.Provider,{value:i,get children(){return S(me,A({as:"nav",get"data-disabled"(){return r.disabled?"":void 0}},o,{get children(){var a=ew();return fe(a,()=>r.children),a}}))}})}var nw=Object.assign(zi,{Ellipsis:ki,Item:Vi,Items:Ni,Next:Ki,Previous:ji});const vo=ao("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"}}),ml=e=>{const[t,n]=K(e,["variant","size","class"]);return S(It,A({get class(){return pe(vo({variant:t.variant,size:t.size}),t.class)}},n))};var rw=he('<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>'),ow=he("<span class=sr-only>More pages"),sw=he('<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">'),iw=he("<span>Previous"),aw=he("<span>Next"),lw=he('<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 uw=Ni,cw=e=>{const[t,n]=K(e,["class"]);return S(zi,A({get class(){return pe("[&>*]:flex [&>*]:flex-row [&>*]:items-center [&>*]:gap-1",t.class)}},n))},dw=e=>{const[t,n]=K(e,["class"]);return S(Vi,A({get class(){return pe(vo({variant:"ghost"}),"size-10 data-[current]:border",t.class)}},n))},fw=e=>{const[t,n]=K(e,["class"]);return S(ki,A({get class(){return pe("flex size-10 items-center justify-center",t.class)}},n,{get children(){return[rw(),ow()]}}))},hw=e=>{const[t,n]=K(e,["class","children"]);return S(ji,A({get class(){return pe(vo({variant:"ghost"}),"gap-1 pl-2.5",t.class)}},n,{get children(){return t.children??[sw(),iw()]}}))},gw=e=>{const[t,n]=K(e,["class","children"]);return S(Ki,A({get class(){return pe(vo({variant:"ghost"}),"gap-1 pl-2.5",t.class)}},n,{get children(){return t.children??[aw(),lw()]}}))};var pw=he('<div class="relative w-full overflow-auto"><table>'),mw=he("<thead>"),yw=he("<tbody>"),vw=he("<tr>"),ww=he("<th>"),bw=he("<td>");const Sw=e=>{const[t,n]=K(e,["class"]);return(()=>{var r=pw(),o=r.firstChild;return ot(o,A({get class(){return pe("w-full caption-bottom text-sm",t.class)}},n),!1,!1),r})()},xw=e=>{const[t,n]=K(e,["class"]);return(()=>{var r=mw();return ot(r,A({get class(){return pe("[&_tr]:border-b",t.class)}},n),!1,!1),r})()},Cw=e=>{const[t,n]=K(e,["class"]);return(()=>{var r=yw();return ot(r,A({get class(){return pe("[&_tr:last-child]:border-0",t.class)}},n),!1,!1),r})()},Ko=e=>{const[t,n]=K(e,["class"]);return(()=>{var r=vw();return ot(r,A({get class(){return pe("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",t.class)}},n),!1,!1),r})()},Ew=e=>{const[t,n]=K(e,["class"]);return(()=>{var r=ww();return ot(r,A({get class(){return pe("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",t.class)}},n),!1,!1),r})()},yl=e=>{const[t,n]=K(e,["class"]);return(()=>{var r=bw();return ot(r,A({get class(){return pe("p-4 align-middle [&:has([role=checkbox])]:pr-0",t.class)}},n),!1,!1),r})()};var Rw=he('<div><div class="flex flex-row justify-end p-3"></div><div class="border rounded-md">');const Pw=20;function Iw(e){const[t]=K(e,["columns","data","onRowClick"]),[n,r]=z(null),[o,s]=z({pageIndex:0,pageSize:Pw}),i=Jv({get data(){return t.data()||[]},columns:t.columns,getCoreRowModel:Uv(),getPaginationRowModel:Zv(),getFilteredRowModel:Yv(),state:{get pagination(){return o()},get globalFilter(){return n()}},onPaginationChange:s,globalFilterFn:(l,u,c)=>c?l.original.platform.toLowerCase()===c:!0,manualPagination:!1}),a=l=>()=>{t.onRowClick(l.original)};return(()=>{var l=Rw(),u=l.firstChild,c=u.nextSibling;return fe(u,S(rv,{get children(){return S(nv,{get children(){return[S(ov,{get children(){return[N(()=>N(()=>!!n())()?n():"All"),S(sv,{})]}}),S(av,{get children(){return[S(Oo,{onClick:()=>r(null),children:"All"}),S(Oo,{onClick:()=>r("ios"),children:"iOS"}),S(Oo,{onClick:()=>r("android"),children:"Android"})]}})]}})}})),fe(c,S(Sw,{get children(){return[S(xw,{get children(){return S(Kt,{get each(){return i.getHeaderGroups()},children:d=>S(Ko,{get children(){return S(Kt,{get each(){return d.headers},children:f=>S(Ew,{get children(){return N(()=>!!f.isPlaceholder)()?null:pl(f.column.columnDef.header,f.getContext())}})})}})})}}),S(Cw,{get children(){return N(()=>{var d;return!!((d=i.getRowModel().rows)!=null&&d.length)})()?S(Kt,{get each(){return i.getRowModel().rows},children:d=>S(Ko,{get"data-state"(){return d.getIsSelected()&&"selected"},class:"cursor-pointer",get onClick(){return a(d)},get children(){return S(Kt,{get each(){return d.getVisibleCells()},children:f=>S(yl,{get children(){return pl(f.column.columnDef.cell,f.getContext())}})})}})}):S(Ko,{get children(){return S(yl,{get colSpan(){return t.columns.length},class:"h-24 text-center",children:"No results."})}})}})]}})),fe(l,S(cw,{class:"mt-2.5 w-full [&>ul]:justify-center",itemComponent:d=>S(dw,{get page(){return d.page},onClick:()=>i.setPageIndex(d.page-1),get children(){return d.page}}),ellipsisComponent:()=>S(fw,{}),get count(){var d;return Math.ceil((((d=t.data())==null?void 0:d.length)??0)/o().pageSize)},get children(){return[S(hw,{onClick:()=>i.previousPage(),get disabled(){return!i.getCanPreviousPage()}}),S(uw,{}),S(gw,{onClick:()=>i.nextPage(),get disabled(){return!i.getCanNextPage()}})]}}),null),l})()}var Mw={};pn(Mw,{Root:()=>Bi,Skeleton:()=>Fw});function Bi(e){const t=`skeleton-${Re()}`,n=ee({visible:!0,animate:!0,id:t},e),[r,o]=K(n,["style","radius","animate","height","width","visible","circle"]);return S(me,A({as:"div",role:"group",get"data-animate"(){return r.animate||void 0},get"data-visible"(){return r.visible||void 0},get style(){return gn({"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 Fw=Bi;const $w=e=>{const[t,n]=K(e,["class"]);return S(Bi,A({get class(){return pe("bg-primary/10 data-[animate='true']:animate-pulse",t.class)}},n))};var md=["id","name","validationState","required","disabled","readOnly"];function yd(e){const t=`form-control-${Re()}`,n=ee({id:t},e),[r,o]=z(),[s,i]=z(),[a,l]=z(),[u,c]=z(),d=(p,m,w)=>{const y=w!=null||r()!=null;return[w,r(),y&&m!=null?p:void 0].filter(Boolean).join(" ")||void 0},f=p=>[a(),u(),p].filter(Boolean).join(" ")||void 0,h=N(()=>({"data-valid":$(n.validationState)==="valid"?"":void 0,"data-invalid":$(n.validationState)==="invalid"?"":void 0,"data-required":$(n.required)?"":void 0,"data-disabled":$(n.disabled)?"":void 0,"data-readonly":$(n.readOnly)?"":void 0}));return{formControlContext:{name:()=>$(n.name)??$(n.id),dataset:h,validationState:()=>$(n.validationState),isRequired:()=>$(n.required),isDisabled:()=>$(n.disabled),isReadOnly:()=>$(n.readOnly),labelId:r,fieldId:s,descriptionId:a,errorMessageId:u,getAriaLabelledBy:d,getAriaDescribedBy:f,generateId:Wt(()=>$(n.id)),registerLabel:Ye(o),registerField:Ye(i),registerDescription:Ye(l),registerErrorMessage:Ye(c)}}}var Gi=Se();function Qt(){const e=we(Gi);if(e===void 0)throw new Error("[kobalte]: `useFormControlContext` must be used within a `FormControlContext.Provider` component");return e}function Hi(e){const t=Qt(),n=ee({id:t.generateId("description")},e);return q(()=>W(t.registerDescription(n.id))),S(me,A({as:"div"},()=>t.dataset(),n))}function Ui(e){const t=Qt(),n=ee({id:t.generateId("error-message")},e),[r,o]=K(n,["forceMount"]),s=()=>t.validationState()==="invalid";return q(()=>{s()&&W(t.registerErrorMessage(o.id))}),S(Ce,{get when(){return r.forceMount||s()},get children(){return S(me,A({as:"div"},()=>t.dataset(),o))}})}function wo(e){let t;const n=Qt(),r=ee({id:n.generateId("label")},e),[o,s]=K(r,["ref"]),i=io(()=>t,()=>"label");return q(()=>W(n.registerLabel(s.id))),S(me,A({as:"label",ref(a){var l=be(u=>t=u,o.ref);typeof l=="function"&&l(a)},get for(){return N(()=>i()==="label")()?n.fieldId():void 0}},()=>n.dataset(),s))}var vd=["id","aria-label","aria-labelledby","aria-describedby"];function wd(e){const t=Qt(),n=ee({id:t.generateId("field")},e);return q(()=>W(t.registerField($(n.id)))),{fieldProps:{id:()=>$(n.id),ariaLabel:()=>$(n["aria-label"]),ariaLabelledBy:()=>t.getAriaLabelledBy($(n.id),$(n["aria-label"]),$(n["aria-labelledby"])),ariaDescribedBy:()=>t.getAriaDescribedBy($(n["aria-describedby"]))}}}function bd(e,t){q(Me(e,n=>{if(n==null)return;const r=Aw(n);r!=null&&(r.addEventListener("reset",t,{passive:!0}),W(()=>{r.removeEventListener("reset",t)}))}))}function Aw(e){return Ow(e)?e.form:e.closest("form")}function Ow(e){return e.matches("textarea, input, select, button")}var Tw={};pn(Tw,{Control:()=>qi,Description:()=>xd,ErrorMessage:()=>Cd,Input:()=>Wi,Label:()=>Xi,Root:()=>Qi,Switch:()=>Lw,Thumb:()=>Yi});var Sd=Se();function qn(){const e=we(Sd);if(e===void 0)throw new Error("[kobalte]: `useSwitchContext` must be used within a `Switch` component");return e}function qi(e){const t=Qt(),n=qn(),r=ee({id:n.generateId("control")},e),[o,s]=K(r,["onClick","onKeyDown"]);return S(me,A({as:"div",onClick:l=>{var u;ce(l,o.onClick),n.toggle(),(u=n.inputRef())==null||u.focus()},onKeyDown:l=>{var u;ce(l,o.onKeyDown),l.key===si.Space&&(n.toggle(),(u=n.inputRef())==null||u.focus())}},()=>t.dataset(),()=>n.dataset(),s))}function xd(e){const t=qn();return S(Hi,A(()=>t.dataset(),e))}function Cd(e){const t=qn();return S(Ui,A(()=>t.dataset(),e))}function Wi(e){const t=Qt(),n=qn(),r=ee({id:n.generateId("input")},e),[o,s,i]=K(r,["ref","style","onChange","onFocus","onBlur"],vd),{fieldProps:a}=wd(s);return S(me,A({as:"input",ref(d){var f=be(n.setInputRef,o.ref);typeof f=="function"&&f(d)},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 gn({...Qu},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:d=>{ce(d,o.onChange),d.stopPropagation();const f=d.target;n.setIsChecked(f.checked),f.checked=n.checked()},onFocus:d=>{ce(d,o.onFocus),n.setIsFocused(!0)},onBlur:d=>{ce(d,o.onBlur),n.setIsFocused(!1)}},()=>t.dataset(),()=>n.dataset(),i))}function Xi(e){const t=qn();return S(wo,A(()=>t.dataset(),e))}function Qi(e){let t;const n=`switch-${Re()}`,r=ee({value:"on",id:n},e),[o,s,i]=K(r,["ref","children","value","checked","defaultChecked","onChange","onPointerDown"],md),[a,l]=z(),[u,c]=z(!1),{formControlContext:d}=yd(s),f=Nc({isSelected:()=>o.checked,defaultIsSelected:()=>o.defaultChecked,onSelectedChange:m=>{var w;return(w=o.onChange)==null?void 0:w.call(o,m)},isDisabled:()=>d.isDisabled(),isReadOnly:()=>d.isReadOnly()});bd(()=>t,()=>f.setIsSelected(o.defaultChecked??!1));const h=m=>{ce(m,o.onPointerDown),u()&&m.preventDefault()},g=N(()=>({"data-checked":f.isSelected()?"":void 0})),p={value:()=>o.value,dataset:g,checked:()=>f.isSelected(),inputRef:a,generateId:Wt(()=>$(s.id)),toggle:()=>f.toggle(),setIsChecked:m=>f.setIsSelected(m),setIsFocused:c,setInputRef:l};return S(Gi.Provider,{value:d,get children(){return S(Sd.Provider,{value:p,get children(){return S(me,A({as:"div",ref(m){var w=be(y=>t=y,o.ref);typeof w=="function"&&w(m)},role:"group",get id(){return $(s.id)},onPointerDown:h},()=>d.dataset(),g,i,{get children(){return S(Dw,{state:p,get children(){return o.children}})}}))}})}})}function Dw(e){const t=ro(()=>{const n=e.children;return Hu(n)?n(e.state):n});return N(t)}function Yi(e){const t=Qt(),n=qn(),r=ee({id:n.generateId("thumb")},e);return S(me,A({as:"div"},()=>t.dataset(),()=>n.dataset(),r))}var Lw=Object.assign(Qi,{Control:qi,Description:xd,ErrorMessage:Cd,Input:Wi,Label:Xi,Thumb:Yi});const vl=Qi,wl=e=>{const[t,n]=K(e,["class","children"]);return[S(Wi,{get class(){return pe("[&: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)}}),S(qi,A({get class(){return pe("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}}))]},bl=e=>{const[t,n]=K(e,["class"]);return S(Yi,A({get class(){return pe("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))},Sl=e=>{const[t,n]=K(e,["class"]);return S(Xi,A({get class(){return pe("text-sm font-medium leading-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-70",t.class)}},n))};var _w={};pn(_w,{Description:()=>Hi,ErrorMessage:()=>Ui,Input:()=>Zi,Label:()=>wo,Root:()=>Ji,TextArea:()=>Id,TextField:()=>Vw});var Ed=Se();function Rd(){const e=we(Ed);if(e===void 0)throw new Error("[kobalte]: `useTextFieldContext` must be used within a `TextField` component");return e}function Zi(e){return S(Pd,A({type:"text"},e))}function Pd(e){const t=Qt(),n=Rd(),r=ee({id:n.generateId("input")},e),[o,s,i]=K(r,["onInput"],vd),{fieldProps:a}=wd(s);return S(me,A({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 ve([o.onInput,n.onInput])}},()=>t.dataset(),i))}function Ji(e){let t;const n=`textfield-${Re()}`,r=ee({id:n},e),[o,s,i]=K(r,["ref","value","defaultValue","onChange"],md),a=o.value,[l,u]=gt({value:()=>a===void 0?void 0:o.value??"",defaultValue:()=>o.defaultValue,onChange:h=>{var g;return(g=o.onChange)==null?void 0:g.call(o,h)}}),{formControlContext:c}=yd(s);bd(()=>t,()=>u(o.defaultValue??""));const d=h=>{if(c.isReadOnly()||c.isDisabled())return;const g=h.target;u(g.value),g.value=l()??""},f={value:l,generateId:Wt(()=>$(s.id)),onInput:d};return S(Gi.Provider,{value:c,get children(){return S(Ed.Provider,{value:f,get children(){return S(me,A({as:"div",ref(h){var g=be(p=>t=p,o.ref);typeof g=="function"&&g(h)},role:"group",get id(){return $(s.id)}},()=>c.dataset(),i))}})}})}function Id(e){let t;const n=Rd(),r=ee({id:n.generateId("textarea")},e),[o,s]=K(r,["ref","autoResize","submitOnEnter","onKeyPress"]);q(Me([()=>t,()=>o.autoResize,()=>n.value()],([a,l])=>{!a||!l||kw(a)}));const i=a=>{t&&o.submitOnEnter&&a.key==="Enter"&&!a.shiftKey&&t.form&&(t.form.requestSubmit(),a.preventDefault())};return S(Pd,A({as:"textarea",get"aria-multiline"(){return o.submitOnEnter?"false":void 0},get onKeyPress(){return ve([o.onKeyPress,i])},ref(a){var l=be(u=>t=u,o.ref);typeof l=="function"&&l(a)}},s))}function kw(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 Vw=Object.assign(Ji,{Description:Hi,ErrorMessage:Ui,Input:Zi,Label:wo,TextArea:Id});const xl=Ji,Cl=e=>{const[t,n]=K(e,["type","class"]);return S(Zi,A({get type(){return t.type},get class(){return pe("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:cursor-not-allowed disabled:opacity-50",t.class)}},n))},Nw=ao("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",{variants:{variant:{label:"data-[invalid]:text-destructive",description:"text-destructive",error:"font-normal text-red-500"}},defaultVariants:{variant:"label"}}),El=e=>{const[t,n]=K(e,["class"]);return S(wo,A({get class(){return pe(Nw(),t.class)}},n))};class Md{constructor(t,n){this.listeners=new Set,this._batching=!1,this._flushing=0,this.subscribe=r=>{var o,s;this.listeners.add(r);const i=(s=(o=this.options)==null?void 0:o.onSubscribe)==null?void 0:s.call(o,r,this);return()=>{this.listeners.delete(r),i==null||i()}},this.setState=r=>{var o,s,i;const a=this.state;this.state=(o=this.options)!=null&&o.updateFn?this.options.updateFn(a)(r):r(a),(i=(s=this.options)==null?void 0:s.onUpdate)==null||i.call(s),this._flush()},this._flush=()=>{if(this._batching)return;const r=++this._flushing;this.listeners.forEach(o=>{this._flushing===r&&o()})},this.batch=r=>{if(this._batching)return r();this._batching=!0,r(),this._batching=!1,this._flush()},this.state=t,this.options=n}}function ea(e,t){return typeof e=="function"?e(t):e}function Fd(e,t){return ta(t).reduce((r,o)=>{if(r===null)return null;if(typeof r<"u")return r[o]},e)}function jo(e,t,n){const r=ta(t);function o(s){if(!r.length)return ea(n,s);const i=r.shift();if(typeof i=="string")return typeof s=="object"?(s===null&&(s={}),{...s,[i]:o(s[i])}):{[i]:o()};if(Array.isArray(s)&&i!==void 0){const a=s.slice(0,i);return[...a.length?a:new Array(i),o(s[i]),...s.slice(i+1)]}return[...new Array(i),o()]}return o(e)}function Kw(e,t){const n=ta(t);function r(o){if(!o)return;if(n.length===1){const i=n[0];if(Array.isArray(o)&&typeof i=="number")return o.filter((u,c)=>c!==i);const{[i]:a,...l}=o;return l}const s=n.shift();if(typeof s=="string"&&typeof o=="object")return{...o,[s]:r(o[s])};if(typeof s=="number"&&Array.isArray(o)){if(s>=o.length)return o;const i=o.slice(0,s);return[...i.length?i:new Array(s),r(o[s]),...o.slice(s+1)]}throw new Error("It seems we have created an infinite loop in deleteBy. ")}return r(e)}const jw=/^(\d*)$/gm,zw=/\.(\d*)\./gm,Bw=/^(\d*)\./gm,Gw=/\.(\d*$)/gm,Hw=/\.{2,}/gm,Gs="__int__",Kr=`${Gs}$1`;function ta(e){if(Array.isArray(e))return[...e];if(typeof e!="string")throw new Error("Path must be a string.");return e.replaceAll("[",".").replaceAll("]","").replace(jw,Kr).replace(zw,`.${Kr}.`).replace(Bw,`${Kr}.`).replace(Gw,`.${Kr}`).replace(Hw,".").split(".").map(t=>t.indexOf(Gs)===0?parseInt(t.substring(Gs.length),10):t)}function Uw(e){return!(Array.isArray(e)&&e.length===0)}function Hs(e,t){const{asyncDebounceMs:n}=t,{onChangeAsync:r,onBlurAsync:o,onSubmitAsync:s,onBlurAsyncDebounceMs:i,onChangeAsyncDebounceMs:a}=t.validators||{},l=n??0,u={cause:"change",validate:r,debounceMs:a??l},c={cause:"blur",validate:o,debounceMs:i??l},d={cause:"submit",validate:s,debounceMs:0},f=h=>({...h,debounceMs:0});switch(e){case"submit":return[f(u),f(c),d];case"blur":return[c];case"change":return[u];case"server":default:return[]}}function Us(e,t){const{onChange:n,onBlur:r,onSubmit:o}=t.validators||{},s={cause:"change",validate:n},i={cause:"blur",validate:r},a={cause:"submit",validate:o},l={cause:"server",validate:()=>{}};switch(e){case"submit":return[s,i,a,l];case"server":return[l];case"blur":return[i,l];case"change":default:return[s,l]}}function zo(e){return{values:e.values??{},errors:e.errors??[],errorMap:e.errorMap??{},fieldMeta:e.fieldMeta??{},canSubmit:e.canSubmit??!0,isFieldsValid:e.isFieldsValid??!1,isFieldsValidating:e.isFieldsValidating??!1,isFormValid:e.isFormValid??!1,isFormValidating:e.isFormValidating??!1,isSubmitted:e.isSubmitted??!1,isSubmitting:e.isSubmitting??!1,isTouched:e.isTouched??!1,isBlurred:e.isBlurred??!1,isPristine:e.isPristine??!0,isDirty:e.isDirty??!1,isValid:e.isValid??!1,isValidating:e.isValidating??!1,submissionAttempts:e.submissionAttempts??0,validationMetaMap:e.validationMetaMap??{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0}}}const qw=e=>typeof e=="object";class Ww{constructor(t){var n;this.options={},this.fieldInfo={},this.prevTransformArray=[],this.mount=()=>{const{onMount:r}=this.options.validators||{};if(!r)return;const o=this.runValidator({validate:r,value:{value:this.state.values,formApi:this,validationSource:"form"},type:"validate"});o&&this.store.setState(s=>({...s,errorMap:{...s.errorMap,onMount:o}}))},this.update=r=>{if(!r)return;const o=this.options;this.options=r,this.store.batch(()=>{const s=r.defaultValues&&r.defaultValues!==o.defaultValues&&!this.state.isTouched,i=r.defaultState!==o.defaultState&&!this.state.isTouched;this.store.setState(()=>zo(Object.assign({},this.state,i?r.defaultState:{},s?{values:r.defaultValues}:{})))})},this.reset=()=>{const{fieldMeta:r}=this.state,o=this.resetFieldMeta(r);this.store.setState(()=>{var s;return zo({...this.options.defaultState,values:this.options.defaultValues??((s=this.options.defaultState)==null?void 0:s.values),fieldMeta:o})})},this.validateAllFields=async r=>{const o=[];return this.store.batch(()=>{Object.values(this.fieldInfo).forEach(i=>{if(!i.instance)return;const a=i.instance;o.push(Promise.resolve().then(()=>a.validate(r))),i.instance.state.meta.isTouched||i.instance.setMeta(l=>({...l,isTouched:!0})),i.instance.state.meta.isBlurred||i.instance.setMeta(l=>({...l,isBlurred:!0}))})}),(await Promise.all(o)).flat()},this.validateArrayFieldsStartingFrom=async(r,o,s)=>{const i=this.getFieldValue(r),a=Array.isArray(i)?Math.max(i.length-1,0):null,l=[`${r}[${o}]`];for(let f=o+1;f<=(a??0);f++)l.push(`${r}[${f}]`);const u=Object.keys(this.fieldInfo).filter(f=>l.some(h=>f.startsWith(h))),c=[];return this.store.batch(()=>{u.forEach(f=>{c.push(Promise.resolve().then(()=>this.validateField(f,s)))})}),(await Promise.all(c)).flat()},this.validateField=(r,o)=>{var s;const i=(s=this.fieldInfo[r])==null?void 0:s.instance;return i?(i.state.meta.isTouched||i.setMeta(a=>({...a,isTouched:!0})),i.state.meta.isBlurred||i.setMeta(a=>({...a,isBlurred:!0})),i.validate(o)):[]},this.validateSync=r=>{const o=Us(r,this.options);let s=!1;const i={};this.store.batch(()=>{for(const l of o){if(!l.validate)continue;const u=this.runValidator({validate:l.validate,value:{value:this.state.values,formApi:this,validationSource:"form"},type:"validate"}),{formError:c,fieldErrors:d}=qs(u),f=jr(l.cause);if(d)for(const[h,g]of Object.entries(d)){const m={...i[h]||{},[f]:g};i[h]=m;const w=this.getFieldMeta(h);w&&w.errorMap[f]!==g&&this.setFieldMeta(h,y=>({...y,errorMap:{...y.errorMap,[f]:g}}))}this.state.errorMap[f]!==c&&this.store.setState(h=>({...h,errorMap:{...h.errorMap,[f]:c}})),(c||d)&&(s=!0)}});const a=jr("submit");return this.state.errorMap[a]&&r!=="submit"&&!s&&this.store.setState(l=>({...l,errorMap:{...l.errorMap,[a]:void 0}})),{hasErrored:s,fieldsErrorMap:i}},this.validateAsync=async r=>{const o=Hs(r,this.options);this.state.isFormValidating||this.store.setState(u=>({...u,isFormValidating:!0}));const s=[];let i;for(const u of o){if(!u.validate)continue;const c=jr(u.cause),d=this.state.validationMetaMap[c];d==null||d.lastAbortController.abort();const f=new AbortController;this.state.validationMetaMap[c]={lastAbortController:f},s.push(new Promise(async h=>{let g;try{g=await new Promise((y,v)=>{setTimeout(async()=>{if(f.signal.aborted)return y(void 0);try{y(await this.runValidator({validate:u.validate,value:{value:this.state.values,formApi:this,validationSource:"form",signal:f.signal},type:"validateAsync"}))}catch(b){v(b)}},u.debounceMs)})}catch(y){g=y}const{formError:p,fieldErrors:m}=qs(g);m&&(i=i?{...i,...m}:m);const w=jr(u.cause);if(i)for(const[y,v]of Object.entries(i)){const b=this.getFieldMeta(y);b&&b.errorMap[w]!==v&&this.setFieldMeta(y,C=>({...C,errorMap:{...C.errorMap,[w]:v}}))}this.store.setState(y=>({...y,errorMap:{...y.errorMap,[w]:p}})),h(i?{fieldErrors:i,errorMapKey:w}:void 0)}))}let a=[];const l={};if(s.length){a=await Promise.all(s);for(const u of a)if(u!=null&&u.fieldErrors){const{errorMapKey:c}=u;for(const[d,f]of Object.entries(u.fieldErrors)){const g={...l[d]||{},[c]:f};l[d]=g}}}return this.store.setState(u=>({...u,isFormValidating:!1})),l},this.validate=r=>{const{hasErrored:o,fieldsErrorMap:s}=this.validateSync(r);return o&&!this.options.asyncAlways?s:this.validateAsync(r)},this.handleSubmit=async()=>{var r,o,s,i,a,l;if(this.store.setState(c=>({...c,isSubmitted:!1,submissionAttempts:c.submissionAttempts+1})),!this.state.canSubmit)return;this.store.setState(c=>({...c,isSubmitting:!0}));const u=()=>{this.store.setState(c=>({...c,isSubmitting:!1}))};if(await this.validateAllFields("submit"),!this.state.isFieldsValid){u(),(o=(r=this.options).onSubmitInvalid)==null||o.call(r,{value:this.state.values,formApi:this});return}if(await this.validate("submit"),!this.state.isValid){u(),(i=(s=this.options).onSubmitInvalid)==null||i.call(s,{value:this.state.values,formApi:this});return}try{await((l=(a=this.options).onSubmit)==null?void 0:l.call(a,{value:this.state.values,formApi:this})),this.store.batch(()=>{this.store.setState(c=>({...c,isSubmitted:!0})),u()})}catch(c){throw u(),c}},this.getFieldValue=r=>Fd(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.store.setState(s=>({...s,fieldMeta:{...s.fieldMeta,[r]:ea(o,s.fieldMeta[r])}}))},this.resetFieldMeta=r=>Object.keys(r).reduce((o,s)=>{const i=s;return o[i]={isValidating:!1,isTouched:!1,isBlurred:!1,isDirty:!1,isPristine:!0,errors:[],errorMap:{}},o},{}),this.setFieldValue=(r,o,s)=>{const i=(s==null?void 0:s.dontUpdateMeta)??!1;this.store.batch(()=>{i||this.setFieldMeta(r,a=>({...a,isTouched:!0,isBlurred:!0,isDirty:!0})),this.store.setState(a=>({...a,values:jo(a.values,r,o)}))})},this.deleteField=r=>{this.store.setState(o=>{const s={...o};return s.values=Kw(s.values,r),delete s.fieldMeta[r],s}),delete this.fieldInfo[r]},this.pushFieldValue=(r,o,s)=>{this.setFieldValue(r,i=>[...Array.isArray(i)?i:[],o],s),this.validateField(r,"change")},this.insertFieldValue=async(r,o,s,i)=>{this.setFieldValue(r,a=>[...a.slice(0,o),s,...a.slice(o)],i),await this.validateField(r,"change")},this.replaceFieldValue=async(r,o,s,i)=>{this.setFieldValue(r,a=>a.map((l,u)=>u===o?s:l),i),await this.validateField(r,"change"),await this.validateArrayFieldsStartingFrom(r,o,"change")},this.removeFieldValue=async(r,o,s)=>{const i=this.getFieldValue(r),a=Array.isArray(i)?Math.max(i.length-1,0):null;if(this.setFieldValue(r,l=>l.filter((u,c)=>c!==o),s),a!==null){const l=`${r}[${a}]`;Object.keys(this.fieldInfo).filter(c=>c.startsWith(l)).forEach(c=>this.deleteField(c))}await this.validateField(r,"change"),await this.validateArrayFieldsStartingFrom(r,o,"change")},this.swapFieldValues=(r,o,s,i)=>{this.setFieldValue(r,a=>{const l=a[o],u=a[s];return jo(jo(a,`${o}`,u),`${s}`,l)},i),this.validateField(r,"change"),this.validateField(`${r}[${o}]`,"change"),this.validateField(`${r}[${s}]`,"change")},this.moveFieldValues=(r,o,s,i)=>{this.setFieldValue(r,a=>(a.splice(s,0,a.splice(o,1)[0]),a),i),this.validateField(r,"change"),this.validateField(`${r}[${o}]`,"change"),this.validateField(`${r}[${s}]`,"change")},this.store=new Md(zo({...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),isFormValid:!0}),{onUpdate:()=>{var r,o;let{state:s}=this.store;const i=Object.values(s.fieldMeta),a=i.some(v=>v==null?void 0:v.isValidating),l=!i.some(v=>(v==null?void 0:v.errorMap)&&Uw(Object.values(v.errorMap).filter(Boolean))),u=i.some(v=>v==null?void 0:v.isTouched),c=i.some(v=>v==null?void 0:v.isBlurred),d=i.some(v=>v==null?void 0:v.isDirty),f=!d,h=a||s.isFormValidating;s.errors=Object.values(s.errorMap).reduce((v,b)=>b===void 0?v:typeof b=="string"?(v.push(b),v):(b&&qw(b)&&v.push(b.form),v),[]);const g=s.errors.length===0,p=l&&g,m=s.submissionAttempts===0&&!u||!h&&!s.isSubmitting&&p;s={...s,isFieldsValidating:a,isFieldsValid:l,isFormValid:g,isValid:p,canSubmit:m,isTouched:u,isBlurred:c,isPristine:f,isDirty:d},this.state=s,this.store.state=this.state;const w=((r=this.options.transform)==null?void 0:r.deps)??[];(w.length!==this.prevTransformArray.length||w.some((v,b)=>v!==this.prevTransformArray[b]))&&((o=this.options.transform)==null||o.fn(this),this.store.state=this.state,this.prevTransformArray=w)}}),this.state=this.store.state,this.update(t||{})}runValidator(t){const n=this.options.validatorAdapter;return n&&typeof t.validate!="function"?n()[t.type](t.value,t.validate):t.validate(t.value)}setErrorMap(t){this.store.setState(n=>({...n,errorMap:{...n.errorMap,...t}}))}}function qs(e){if(e){if(typeof e=="object"){const t=qs(e.form).formError,n=e.fields;return{formError:t,fieldErrors:n}}return typeof e!="string"?{formError:"Invalid Form Values"}:{formError:e}}return{formError:void 0}}function jr(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 Xw{constructor(t){this.options={},this.mount=()=>{const n=this.getInfo();n.instance=this;const r=this.form.store.subscribe(()=>{this.store.batch(()=>{const s=this.getValue(),i=this.getMeta();s!==this.state.value&&this.store.setState(a=>({...a,value:s})),i!==this.state.meta&&this.store.setState(a=>({...a,meta:i}))})});this.update(this.options);const{onMount:o}=this.options.validators||{};if(o){const s=this.runValidator({validate:o,value:{value:this.state.value,fieldApi:this,validationSource:"field"},type:"validate"});s&&this.setMeta(i=>({...i,errorMap:{...i==null?void 0:i.errorMap,onMount:s}}))}return()=>{r()}},this.update=n=>{if(this.state.value===void 0){const r=Fd(n.form.options.defaultValues,n.name);n.defaultValue!==void 0?this.setValue(n.defaultValue,{dontUpdateMeta:!0}):r!==void 0&&this.setValue(r,{dontUpdateMeta:!0})}this._getMeta()===void 0&&this.setMeta(this.state.meta),this.options=n},this.getValue=()=>this.form.getFieldValue(this.name),this.setValue=(n,r)=>{this.form.setFieldValue(this.name,n,r),this.validate("change")},this._getMeta=()=>this.form.getFieldMeta(this.name),this.getMeta=()=>this._getMeta()??{isValidating:!1,isTouched:!1,isBlurred:!1,isDirty:!1,isPristine:!0,errors:[],errorMap:{},...this.options.defaultMeta},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.insertValue=(n,r,o)=>this.form.insertFieldValue(this.name,n,r,o),this.replaceValue=(n,r,o)=>this.form.replaceFieldValue(this.name,n,r,o),this.removeValue=(n,r)=>this.form.removeFieldValue(this.name,n,r),this.swapValues=(n,r,o)=>this.form.swapFieldValues(this.name,n,r,o),this.moveValue=(n,r,o)=>this.form.moveFieldValues(this.name,n,r,o),this.getLinkedFields=n=>{const r=Object.values(this.form.fieldInfo),o=[];for(const s of r){if(!s.instance)continue;const{onChangeListenTo:i,onBlurListenTo:a}=s.instance.options.validators||{};n==="change"&&(i!=null&&i.includes(this.name))&&o.push(s.instance),n==="blur"&&(a!=null&&a.includes(this.name))&&o.push(s.instance)}return o},this.validateSync=(n,r)=>{const o=Us(n,this.options),i=this.getLinkedFields(n).reduce((u,c)=>{const d=Us(n,c.options);return d.forEach(f=>{f.field=c}),u.concat(d)},[]);let a=!1;this.form.store.batch(()=>{const u=(c,d)=>{const f=tr(d.cause),h=d.validate?Rl(c.runValidator({validate:d.validate,value:{value:c.getValue(),validationSource:"field",fieldApi:c},type:"validate"})):r[f];c.state.meta.errorMap[f]!==h&&c.setMeta(g=>({...g,errorMap:{...g.errorMap,[tr(d.cause)]:h||r[f]}})),(h||r[f])&&(a=!0)};for(const c of o)u(this,c);for(const c of i)c.validate&&u(c.field,c)});const l=tr("submit");return this.state.meta.errorMap[l]&&n!=="submit"&&!a&&this.setMeta(u=>({...u,errorMap:{...u.errorMap,[l]:void 0}})),{hasErrored:a}},this.validateAsync=async(n,r)=>{const o=Hs(n,this.options),s=await r,i=this.getLinkedFields(n),a=i.reduce((f,h)=>{const g=Hs(n,h.options);return g.forEach(p=>{p.field=h}),f.concat(g)},[]);this.state.meta.isValidating||this.setMeta(f=>({...f,isValidating:!0}));for(const f of i)f.setMeta(h=>({...h,isValidating:!0}));const l=[],u=[],c=(f,h,g)=>{const p=tr(h.cause),m=f.getInfo().validationMetaMap[p];m==null||m.lastAbortController.abort();const w=new AbortController;this.getInfo().validationMetaMap[p]={lastAbortController:w},g.push(new Promise(async y=>{var v;let b;try{b=await new Promise((_,T)=>{this.timeoutIds[h.cause]&&clearTimeout(this.timeoutIds[h.cause]),this.timeoutIds[h.cause]=setTimeout(async()=>{if(w.signal.aborted)return _(void 0);try{_(await this.runValidator({validate:h.validate,value:{value:f.getValue(),fieldApi:f,signal:w.signal,validationSource:"field"},type:"validateAsync"}))}catch(k){T(k)}},h.debounceMs)})}catch(_){b=_}if(w.signal.aborted)return y(void 0);const C=Rl(b),O=(v=s[this.name])==null?void 0:v[p],D=C||O;f.setMeta(_=>({..._,errorMap:{..._==null?void 0:_.errorMap,[p]:D}})),y(D)}))};for(const f of o)f.validate&&c(this,f,l);for(const f of a)f.validate&&c(f.field,f,u);let d=[];(l.length||u.length)&&(d=await Promise.all(l),await Promise.all(u)),this.setMeta(f=>({...f,isValidating:!1}));for(const f of i)f.setMeta(h=>({...h,isValidating:!1}));return d.filter(Boolean)},this.validate=n=>{var r;if(!this.state.meta.isTouched)return[];let o={},s=Promise.resolve({});try{const a=this.form.validate(n);if(a instanceof Promise)s=a;else{const l=a[this.name];l&&(o=l)}}catch{}const{hasErrored:i}=this.validateSync(n,o);return i&&!this.options.asyncAlways?((r=this.getInfo().validationMetaMap[tr(n)])==null||r.lastAbortController.abort(),this.state.meta.errors):this.validateAsync(n,s)},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.form=t.form,this.name=t.name,this.timeoutIds={},t.defaultValue!==void 0&&this.form.setFieldValue(this.name,t.defaultValue,{dontUpdateMeta:!0}),this.store=new Md({value:this.getValue(),meta:this._getMeta()??{isValidating:!1,isTouched:!1,isBlurred:!1,isDirty:!1,isPristine:!0,errors:[],errorMap:{},...t.defaultMeta}},{onUpdate:()=>{const n=this.store.state;n.meta.errors=Object.values(n.meta.errorMap).filter(r=>r!==void 0),n.meta.isPristine=!n.meta.isDirty,this.prevState=n,this.state=n}}),this.state=this.store.state,this.prevState=this.state,this.options=t}runValidator(t){const n=[this.form.options.validatorAdapter,this.options.validatorAdapter];for(const r of n)if(r&&typeof t.validate!="function")return r()[t.type](t.value,t.validate);return t.validate(t.value)}setErrorMap(t){this.setMeta(n=>({...n,errorMap:{...n.errorMap,...t}}))}}function Rl(e){if(e)return typeof e!="string"?"Invalid Form Values":e}function tr(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 Pl(e,t=n=>n){const[n,r]=Js({value:t(e.state)}),o=e.subscribe(()=>{const s=t(e.state);r("value",Au(s))});return W(()=>{o()}),()=>n.value}function Qw(e){const[t,n]=z(!1),r=N(()=>[t(),e]),o=e.store.subscribe(()=>n(s=>!s));return W(o),()=>r()[1]}function $d(e){const t=e(),n=new Xw(t),r=n;return r.Field=Ad,Rt(()=>n.update(e())),Cr(()=>W(n.mount())),Qw(r)}function Ad(e){const t=$d(()=>{const{children:n,...r}=e;return r});return N(()=>S(()=>e.children(t),{}))}function Yw(e){const t=e==null?void 0:e(),n=new Ww(t),r=n;return r.Field=o=>S(Ad,A(o,{form:n})),r.createField=o=>$d(()=>({...o(),form:n})),r.useStore=o=>Pl(n.store,o),r.Subscribe=o=>ea(o.children,Pl(n.store,o.selector)),Cr(n.mount),Rt(()=>n.update(e==null?void 0:e())),r}var Bo,Il;function Zw(){if(Il)return Bo;Il=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 s=this.map.keys().next().value;this.delete(s)}this.map.set(n,r)}return this}}return Bo=e,Bo}var Go,Ml;function na(){if(Ml)return Go;Ml=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return Go=r=>r?typeof r!="object"?e:r:t,Go}var zr={exports:{}},Ho,Fl;function ra(){if(Fl)return Ho;Fl=1;const e="2.0.0",t=256,n=Number.MAX_SAFE_INTEGER||9007199254740991,r=16,o=t-6;return Ho={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},Ho}var Uo,$l;function bo(){if($l)return Uo;$l=1;var e={};return Uo=typeof process=="object"&&e&&e.NODE_DEBUG&&/\bsemver\b/i.test(e.NODE_DEBUG)?(...n)=>console.error("SEMVER",...n):()=>{},Uo}var Al;function oa(){return Al||(Al=1,function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:o}=ra(),s=bo();t=e.exports={};const i=t.re=[],a=t.safeRe=[],l=t.src=[],u=t.t={};let c=0;const d="[a-zA-Z0-9-]",f=[["\\s",1],["\\d",o],[d,r]],h=p=>{for(const[m,w]of f)p=p.split(`${m}*`).join(`${m}{0,${w}}`).split(`${m}+`).join(`${m}{1,${w}}`);return p},g=(p,m,w)=>{const y=h(m),v=c++;s(p,v,m),u[p]=v,l[v]=m,i[v]=new RegExp(m,w?"g":void 0),a[v]=new RegExp(y,w?"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.NUMERICIDENTIFIER]}|${l[u.NONNUMERICIDENTIFIER]})`),g("PRERELEASEIDENTIFIERLOOSE",`(?:${l[u.NUMERICIDENTIFIERLOOSE]}|${l[u.NONNUMERICIDENTIFIER]})`),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*$")}(zr,zr.exports)),zr.exports}var qo,Ol;function Jw(){if(Ol)return qo;Ol=1;const e=/^[0-9]+$/,t=(r,o)=>{const s=e.test(r),i=e.test(o);return s&&i&&(r=+r,o=+o),r===o?0:s&&!i?-1:i&&!s?1:r<o?-1:1};return qo={compareIdentifiers:t,rcompareIdentifiers:(r,o)=>t(o,r)},qo}var Wo,Tl;function sa(){if(Tl)return Wo;Tl=1;const e=bo(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:n}=ra(),{safeRe:r,t:o}=oa(),s=na(),{compareIdentifiers:i}=Jw();class a{constructor(u,c){if(c=s(c),u instanceof a){if(u.loose===!!c.loose&&u.includePrerelease===!!c.includePrerelease)return u;u=u.version}else if(typeof u!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof u}".`);if(u.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",u,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;const d=u.trim().match(c.loose?r[o.LOOSE]:r[o.FULL]);if(!d)throw new TypeError(`Invalid Version: ${u}`);if(this.raw=u,this.major=+d[1],this.minor=+d[2],this.patch=+d[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");d[4]?this.prerelease=d[4].split(".").map(f=>{if(/^[0-9]+$/.test(f)){const h=+f;if(h>=0&&h<n)return h}return f}):this.prerelease=[],this.build=d[5]?d[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(u){if(e("SemVer.compare",this.version,this.options,u),!(u instanceof a)){if(typeof u=="string"&&u===this.version)return 0;u=new a(u,this.options)}return u.version===this.version?0:this.compareMain(u)||this.comparePre(u)}compareMain(u){return u instanceof a||(u=new a(u,this.options)),i(this.major,u.major)||i(this.minor,u.minor)||i(this.patch,u.patch)}comparePre(u){if(u instanceof a||(u=new a(u,this.options)),this.prerelease.length&&!u.prerelease.length)return-1;if(!this.prerelease.length&&u.prerelease.length)return 1;if(!this.prerelease.length&&!u.prerelease.length)return 0;let c=0;do{const d=this.prerelease[c],f=u.prerelease[c];if(e("prerelease compare",c,d,f),d===void 0&&f===void 0)return 0;if(f===void 0)return 1;if(d===void 0)return-1;if(d===f)continue;return i(d,f)}while(++c)}compareBuild(u){u instanceof a||(u=new a(u,this.options));let c=0;do{const d=this.build[c],f=u.build[c];if(e("build compare",c,d,f),d===void 0&&f===void 0)return 0;if(f===void 0)return 1;if(d===void 0)return-1;if(d===f)continue;return i(d,f)}while(++c)}inc(u,c,d){switch(u){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",c,d);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",c,d);break;case"prepatch":this.prerelease.length=0,this.inc("patch",c,d),this.inc("pre",c,d);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",c,d),this.inc("pre",c,d);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 f=Number(d)?1:0;if(!c&&d===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[f];else{let h=this.prerelease.length;for(;--h>=0;)typeof this.prerelease[h]=="number"&&(this.prerelease[h]++,h=-2);if(h===-1){if(c===this.prerelease.join(".")&&d===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(f)}}if(c){let h=[c,f];d===!1&&(h=[c]),i(this.prerelease[0],c)===0?isNaN(this.prerelease[1])&&(this.prerelease=h):this.prerelease=h}break}default:throw new Error(`invalid increment argument: ${u}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return Wo=a,Wo}var Xo,Dl;function Wn(){if(Dl)return Xo;Dl=1;const e=sa();return Xo=(n,r,o)=>new e(n,o).compare(new e(r,o)),Xo}var Qo,Ll;function eb(){if(Ll)return Qo;Ll=1;const e=Wn();return Qo=(n,r,o)=>e(n,r,o)===0,Qo}var Yo,_l;function tb(){if(_l)return Yo;_l=1;const e=Wn();return Yo=(n,r,o)=>e(n,r,o)!==0,Yo}var Zo,kl;function nb(){if(kl)return Zo;kl=1;const e=Wn();return Zo=(n,r,o)=>e(n,r,o)>0,Zo}var Jo,Vl;function rb(){if(Vl)return Jo;Vl=1;const e=Wn();return Jo=(n,r,o)=>e(n,r,o)>=0,Jo}var es,Nl;function ob(){if(Nl)return es;Nl=1;const e=Wn();return es=(n,r,o)=>e(n,r,o)<0,es}var ts,Kl;function sb(){if(Kl)return ts;Kl=1;const e=Wn();return ts=(n,r,o)=>e(n,r,o)<=0,ts}var ns,jl;function ib(){if(jl)return ns;jl=1;const e=eb(),t=tb(),n=nb(),r=rb(),o=ob(),s=sb();return ns=(a,l,u,c)=>{switch(l){case"===":return typeof a=="object"&&(a=a.version),typeof u=="object"&&(u=u.version),a===u;case"!==":return typeof a=="object"&&(a=a.version),typeof u=="object"&&(u=u.version),a!==u;case"":case"=":case"==":return e(a,u,c);case"!=":return t(a,u,c);case">":return n(a,u,c);case">=":return r(a,u,c);case"<":return o(a,u,c);case"<=":return s(a,u,c);default:throw new TypeError(`Invalid operator: ${l}`)}},ns}var rs,zl;function ab(){if(zl)return rs;zl=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(c,d){if(d=n(d),c instanceof t){if(c.loose===!!d.loose)return c;c=c.value}c=c.trim().split(/\s+/).join(" "),i("comparator",c,d),this.options=d,this.loose=!!d.loose,this.parse(c),this.semver===e?this.value="":this.value=this.operator+this.semver.version,i("comp",this)}parse(c){const d=this.options.loose?r[o.COMPARATORLOOSE]:r[o.COMPARATOR],f=c.match(d);if(!f)throw new TypeError(`Invalid comparator: ${c}`);this.operator=f[1]!==void 0?f[1]:"",this.operator==="="&&(this.operator=""),f[2]?this.semver=new a(f[2],this.options.loose):this.semver=e}toString(){return this.value}test(c){if(i("Comparator.test",c,this.options.loose),this.semver===e||c===e)return!0;if(typeof c=="string")try{c=new a(c,this.options)}catch{return!1}return s(c,this.operator,this.semver,this.options)}intersects(c,d){if(!(c instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new l(c.value,d).test(this.value):c.operator===""?c.value===""?!0:new l(this.value,d).test(c.semver):(d=n(d),d.includePrerelease&&(this.value==="<0.0.0-0"||c.value==="<0.0.0-0")||!d.includePrerelease&&(this.value.startsWith("<0.0.0")||c.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&c.operator.startsWith(">")||this.operator.startsWith("<")&&c.operator.startsWith("<")||this.semver.version===c.semver.version&&this.operator.includes("=")&&c.operator.includes("=")||s(this.semver,"<",c.semver,d)&&this.operator.startsWith(">")&&c.operator.startsWith("<")||s(this.semver,">",c.semver,d)&&this.operator.startsWith("<")&&c.operator.startsWith(">")))}}rs=t;const n=na(),{safeRe:r,t:o}=oa(),s=ib(),i=bo(),a=sa(),l=Od();return rs}var os,Bl;function Od(){if(Bl)return os;Bl=1;const e=/\s+/g;class t{constructor(R,E){if(E=o(E),R instanceof t)return R.loose===!!E.loose&&R.includePrerelease===!!E.includePrerelease?R:new t(R.raw,E);if(R instanceof s)return this.raw=R.value,this.set=[[R]],this.formatted=void 0,this;if(this.options=E,this.loose=!!E.loose,this.includePrerelease=!!E.includePrerelease,this.raw=R.trim().replace(e," "),this.set=this.raw.split("||").map(I=>this.parseRange(I.trim())).filter(I=>I.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const I=this.set[0];if(this.set=this.set.filter(M=>!p(M[0])),this.set.length===0)this.set=[I];else if(this.set.length>1){for(const M of this.set)if(M.length===1&&m(M[0])){this.set=[M];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let R=0;R<this.set.length;R++){R>0&&(this.formatted+="||");const E=this.set[R];for(let I=0;I<E.length;I++)I>0&&(this.formatted+=" "),this.formatted+=E[I].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(R){const I=((this.options.includePrerelease&&h)|(this.options.loose&&g))+":"+R,M=r.get(I);if(M)return M;const F=this.options.loose,L=F?l[u.HYPHENRANGELOOSE]:l[u.HYPHENRANGE];R=R.replace(L,j(this.options.includePrerelease)),i("hyphen replace",R),R=R.replace(l[u.COMPARATORTRIM],c),i("comparator trim",R),R=R.replace(l[u.TILDETRIM],d),i("tilde trim",R),R=R.replace(l[u.CARETTRIM],f),i("caret trim",R);let B=R.split(" ").map(se=>y(se,this.options)).join(" ").split(/\s+/).map(se=>V(se,this.options));F&&(B=B.filter(se=>(i("loose invalid filter",se,this.options),!!se.match(l[u.COMPARATORLOOSE])))),i("range list",B);const H=new Map,Z=B.map(se=>new s(se,this.options));for(const se of Z){if(p(se))return[se];H.set(se.value,se)}H.size>1&&H.has("")&&H.delete("");const ue=[...H.values()];return r.set(I,ue),ue}intersects(R,E){if(!(R instanceof t))throw new TypeError("a Range is required");return this.set.some(I=>w(I,E)&&R.set.some(M=>w(M,E)&&I.every(F=>M.every(L=>F.intersects(L,E)))))}test(R){if(!R)return!1;if(typeof R=="string")try{R=new a(R,this.options)}catch{return!1}for(let E=0;E<this.set.length;E++)if(re(this.set[E],R,this.options))return!0;return!1}}os=t;const n=Zw(),r=new n,o=na(),s=ab(),i=bo(),a=sa(),{safeRe:l,t:u,comparatorTrimReplace:c,tildeTrimReplace:d,caretTrimReplace:f}=oa(),{FLAG_INCLUDE_PRERELEASE:h,FLAG_LOOSE:g}=ra(),p=P=>P.value==="<0.0.0-0",m=P=>P.value==="",w=(P,R)=>{let E=!0;const I=P.slice();let M=I.pop();for(;E&&I.length;)E=I.every(F=>M.intersects(F,R)),M=I.pop();return E},y=(P,R)=>(i("comp",P,R),P=O(P,R),i("caret",P),P=b(P,R),i("tildes",P),P=_(P,R),i("xrange",P),P=k(P,R),i("stars",P),P),v=P=>!P||P.toLowerCase()==="x"||P==="*",b=(P,R)=>P.trim().split(/\s+/).map(E=>C(E,R)).join(" "),C=(P,R)=>{const E=R.loose?l[u.TILDELOOSE]:l[u.TILDE];return P.replace(E,(I,M,F,L,B)=>{i("tilde",P,I,M,F,L,B);let H;return v(M)?H="":v(F)?H=`>=${M}.0.0 <${+M+1}.0.0-0`:v(L)?H=`>=${M}.${F}.0 <${M}.${+F+1}.0-0`:B?(i("replaceTilde pr",B),H=`>=${M}.${F}.${L}-${B} <${M}.${+F+1}.0-0`):H=`>=${M}.${F}.${L} <${M}.${+F+1}.0-0`,i("tilde return",H),H})},O=(P,R)=>P.trim().split(/\s+/).map(E=>D(E,R)).join(" "),D=(P,R)=>{i("caret",P,R);const E=R.loose?l[u.CARETLOOSE]:l[u.CARET],I=R.includePrerelease?"-0":"";return P.replace(E,(M,F,L,B,H)=>{i("caret",P,M,F,L,B,H);let Z;return v(F)?Z="":v(L)?Z=`>=${F}.0.0${I} <${+F+1}.0.0-0`:v(B)?F==="0"?Z=`>=${F}.${L}.0${I} <${F}.${+L+1}.0-0`:Z=`>=${F}.${L}.0${I} <${+F+1}.0.0-0`:H?(i("replaceCaret pr",H),F==="0"?L==="0"?Z=`>=${F}.${L}.${B}-${H} <${F}.${L}.${+B+1}-0`:Z=`>=${F}.${L}.${B}-${H} <${F}.${+L+1}.0-0`:Z=`>=${F}.${L}.${B}-${H} <${+F+1}.0.0-0`):(i("no pr"),F==="0"?L==="0"?Z=`>=${F}.${L}.${B}${I} <${F}.${L}.${+B+1}-0`:Z=`>=${F}.${L}.${B}${I} <${F}.${+L+1}.0-0`:Z=`>=${F}.${L}.${B} <${+F+1}.0.0-0`),i("caret return",Z),Z})},_=(P,R)=>(i("replaceXRanges",P,R),P.split(/\s+/).map(E=>T(E,R)).join(" ")),T=(P,R)=>{P=P.trim();const E=R.loose?l[u.XRANGELOOSE]:l[u.XRANGE];return P.replace(E,(I,M,F,L,B,H)=>{i("xRange",P,I,M,F,L,B,H);const Z=v(F),ue=Z||v(L),se=ue||v(B),je=se;return M==="="&&je&&(M=""),H=R.includePrerelease?"-0":"",Z?M===">"||M==="<"?I="<0.0.0-0":I="*":M&&je?(ue&&(L=0),B=0,M===">"?(M=">=",ue?(F=+F+1,L=0,B=0):(L=+L+1,B=0)):M==="<="&&(M="<",ue?F=+F+1:L=+L+1),M==="<"&&(H="-0"),I=`${M+F}.${L}.${B}${H}`):ue?I=`>=${F}.0.0${H} <${+F+1}.0.0-0`:se&&(I=`>=${F}.${L}.0${H} <${F}.${+L+1}.0-0`),i("xRange return",I),I})},k=(P,R)=>(i("replaceStars",P,R),P.trim().replace(l[u.STAR],"")),V=(P,R)=>(i("replaceGTE0",P,R),P.trim().replace(l[R.includePrerelease?u.GTE0PRE:u.GTE0],"")),j=P=>(R,E,I,M,F,L,B,H,Z,ue,se,je)=>(v(I)?E="":v(M)?E=`>=${I}.0.0${P?"-0":""}`:v(F)?E=`>=${I}.${M}.0${P?"-0":""}`:L?E=`>=${E}`:E=`>=${E}${P?"-0":""}`,v(Z)?H="":v(ue)?H=`<${+Z+1}.0.0-0`:v(se)?H=`<${Z}.${+ue+1}.0-0`:je?H=`<=${Z}.${ue}.${se}-${je}`:P?H=`<${Z}.${ue}.${+se+1}-0`:H=`<=${H}`,`${E} ${H}`.trim()),re=(P,R,E)=>{for(let I=0;I<P.length;I++)if(!P[I].test(R))return!1;if(R.prerelease.length&&!E.includePrerelease){for(let I=0;I<P.length;I++)if(i(P[I].semver),P[I].semver!==s.ANY&&P[I].semver.prerelease.length>0){const M=P[I].semver;if(M.major===R.major&&M.minor===R.minor&&M.patch===R.patch)return!0}return!1}return!0};return os}var ss,Gl;function lb(){if(Gl)return ss;Gl=1;const e=Od();return ss=(n,r)=>{try{return new e(n,r).range||"*"}catch{return null}},ss}var ub=lb();const Hl=vc(ub);function cb(e,{insertAt:t}={}){if(typeof document>"u")return;const n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}cb(`:where(html[dir=ltr]),
28
- :where([data-sonner-toaster][dir=ltr]) {
29
- --toast-icon-margin-start: -3px;
30
- --toast-icon-margin-end: 4px;
31
- --toast-svg-margin-start: -1px;
32
- --toast-svg-margin-end: 0px;
33
- --toast-button-margin-start: auto;
34
- --toast-button-margin-end: 0;
35
- --toast-close-button-start: 0;
36
- --toast-close-button-end: unset;
37
- --toast-close-button-transform: translate(-35%, -35%);
38
- }
39
- :where(html[dir=rtl]),
40
- :where([data-sonner-toaster][dir=rtl]) {
41
- --toast-icon-margin-start: 4px;
42
- --toast-icon-margin-end: -3px;
43
- --toast-svg-margin-start: 0px;
44
- --toast-svg-margin-end: -1px;
45
- --toast-button-margin-start: 0;
46
- --toast-button-margin-end: auto;
47
- --toast-close-button-start: unset;
48
- --toast-close-button-end: 0;
49
- --toast-close-button-transform: translate(35%, -35%);
50
- }
51
- :where([data-sonner-toaster]) {
52
- position: fixed;
53
- width: var(--width);
54
- font-family:
55
- ui-sans-serif,
56
- system-ui,
57
- -apple-system,
58
- BlinkMacSystemFont,
59
- Segoe UI,
60
- Roboto,
61
- Helvetica Neue,
62
- Arial,
63
- Noto Sans,
64
- sans-serif,
65
- Apple Color Emoji,
66
- Segoe UI Emoji,
67
- Segoe UI Symbol,
68
- Noto Color Emoji;
69
- --gray1: hsl(0, 0%, 99%);
70
- --gray2: hsl(0, 0%, 97.3%);
71
- --gray3: hsl(0, 0%, 95.1%);
72
- --gray4: hsl(0, 0%, 93%);
73
- --gray5: hsl(0, 0%, 90.9%);
74
- --gray6: hsl(0, 0%, 88.7%);
75
- --gray7: hsl(0, 0%, 85.8%);
76
- --gray8: hsl(0, 0%, 78%);
77
- --gray9: hsl(0, 0%, 56.1%);
78
- --gray10: hsl(0, 0%, 52.3%);
79
- --gray11: hsl(0, 0%, 43.5%);
80
- --gray12: hsl(0, 0%, 9%);
81
- --border-radius: 8px;
82
- box-sizing: border-box;
83
- padding: 0;
84
- margin: 0;
85
- list-style: none;
86
- outline: none;
87
- z-index: 999999999;
88
- }
89
- :where([data-sonner-toaster][data-x-position=right]) {
90
- right: max(var(--offset), env(safe-area-inset-right));
91
- }
92
- :where([data-sonner-toaster][data-x-position=left]) {
93
- left: max(var(--offset), env(safe-area-inset-left));
94
- }
95
- :where([data-sonner-toaster][data-x-position=center]) {
96
- left: 50%;
97
- transform: translateX(-50%);
98
- }
99
- :where([data-sonner-toaster][data-y-position=top]) {
100
- top: max(var(--offset), env(safe-area-inset-top));
101
- }
102
- :where([data-sonner-toaster][data-y-position=bottom]) {
103
- bottom: max(var(--offset), env(safe-area-inset-bottom));
104
- }
105
- :where([data-sonner-toast]) {
106
- --y: translateY(100%);
107
- --lift-amount: calc(var(--lift) * var(--gap));
108
- z-index: var(--z-index);
109
- position: absolute;
110
- opacity: 0;
111
- transform: var(--y);
112
- filter: blur(0);
113
- touch-action: none;
114
- transition:
115
- transform 400ms,
116
- opacity 400ms,
117
- height 400ms,
118
- box-shadow 200ms;
119
- box-sizing: border-box;
120
- outline: none;
121
- overflow-wrap: anywhere;
122
- }
123
- :where([data-sonner-toast][data-styled=true]) {
124
- padding: 16px;
125
- background: var(--normal-bg);
126
- border: 1px solid var(--normal-border);
127
- color: var(--normal-text);
128
- border-radius: var(--border-radius);
129
- box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1);
130
- width: var(--width);
131
- font-size: 13px;
132
- display: flex;
133
- align-items: center;
134
- gap: 6px;
135
- }
136
- :where([data-sonner-toast]:focus-visible) {
137
- box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1), 0 0 0 2px rgba(0, 0, 0, 0.2);
138
- }
139
- :where([data-sonner-toast][data-y-position=top]) {
140
- top: 0;
141
- --y: translateY(-100%);
142
- --lift: 1;
143
- --lift-amount: calc(1 * var(--gap));
144
- }
145
- :where([data-sonner-toast][data-y-position=bottom]) {
146
- bottom: 0;
147
- --y: translateY(100%);
148
- --lift: -1;
149
- --lift-amount: calc(var(--lift) * var(--gap));
150
- }
151
- :where([data-sonner-toast]) :where([data-description]) {
152
- font-weight: 400;
153
- line-height: 1.4;
154
- color: inherit;
155
- }
156
- :where([data-sonner-toast]) :where([data-title]) {
157
- font-weight: 500;
158
- line-height: 1.5;
159
- color: inherit;
160
- }
161
- :where([data-sonner-toast]) :where([data-icon]) {
162
- display: flex;
163
- height: 16px;
164
- width: 16px;
165
- position: relative;
166
- justify-content: flex-start;
167
- align-items: center;
168
- flex-shrink: 0;
169
- margin-left: var(--toast-icon-margin-start);
170
- margin-right: var(--toast-icon-margin-end);
171
- }
172
- :where([data-sonner-toast][data-promise=true]) :where([data-icon]) > svg {
173
- opacity: 0;
174
- transform: scale(0.8);
175
- transform-origin: center;
176
- animation: sonner-fade-in 300ms ease forwards;
177
- }
178
- :where([data-sonner-toast]) :where([data-icon]) > * {
179
- flex-shrink: 0;
180
- }
181
- :where([data-sonner-toast]) :where([data-icon]) svg {
182
- margin-left: var(--toast-svg-margin-start);
183
- margin-right: var(--toast-svg-margin-end);
184
- }
185
- :where([data-sonner-toast]) :where([data-content]) {
186
- display: flex;
187
- flex-direction: column;
188
- gap: 2px;
189
- }
190
- [data-sonner-toast][data-styled=true] [data-button] {
191
- border-radius: 4px;
192
- padding-left: 8px;
193
- padding-right: 8px;
194
- height: 24px;
195
- font-size: 12px;
196
- color: var(--normal-bg);
197
- background: var(--normal-text);
198
- margin-left: var(--toast-button-margin-start);
199
- margin-right: var(--toast-button-margin-end);
200
- border: none;
201
- cursor: pointer;
202
- outline: none;
203
- display: flex;
204
- align-items: center;
205
- flex-shrink: 0;
206
- transition: opacity 400ms, box-shadow 200ms;
207
- }
208
- :where([data-sonner-toast]) :where([data-button]):focus-visible {
209
- box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.4);
210
- }
211
- :where([data-sonner-toast]) :where([data-button]):first-of-type {
212
- margin-left: var(--toast-button-margin-start);
213
- margin-right: var(--toast-button-margin-end);
214
- }
215
- :where([data-sonner-toast]) :where([data-cancel]) {
216
- color: var(--normal-text);
217
- background: rgba(0, 0, 0, 0.08);
218
- }
219
- :where([data-sonner-toast][data-theme=dark]) :where([data-cancel]) {
220
- background: rgba(255, 255, 255, 0.3);
221
- }
222
- :where([data-sonner-toast]) :where([data-close-button]) {
223
- position: absolute;
224
- left: var(--toast-close-button-start);
225
- right: var(--toast-close-button-end);
226
- top: 0;
227
- height: 20px;
228
- width: 20px;
229
- display: flex;
230
- justify-content: center;
231
- align-items: center;
232
- padding: 0;
233
- background: var(--gray1);
234
- color: var(--gray12);
235
- border: 1px solid var(--gray4);
236
- transform: var(--toast-close-button-transform);
237
- border-radius: 50%;
238
- cursor: pointer;
239
- z-index: 1;
240
- transition:
241
- opacity 100ms,
242
- background 200ms,
243
- border-color 200ms;
244
- }
245
- :where([data-sonner-toast]) :where([data-close-button]):focus-visible {
246
- box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1), 0 0 0 2px rgba(0, 0, 0, 0.2);
247
- }
248
- :where([data-sonner-toast]) :where([data-disabled=true]) {
249
- cursor: not-allowed;
250
- }
251
- :where([data-sonner-toast]):hover :where([data-close-button]):hover {
252
- background: var(--gray2);
253
- border-color: var(--gray5);
254
- }
255
- :where([data-sonner-toast][data-swiping=true])::before {
256
- content: "";
257
- position: absolute;
258
- left: 0;
259
- right: 0;
260
- height: 100%;
261
- z-index: -1;
262
- }
263
- :where([data-sonner-toast][data-y-position=top][data-swiping=true])::before {
264
- bottom: 50%;
265
- transform: scaleY(3) translateY(50%);
266
- }
267
- :where([data-sonner-toast][data-y-position=bottom][data-swiping=true])::before {
268
- top: 50%;
269
- transform: scaleY(3) translateY(-50%);
270
- }
271
- :where([data-sonner-toast][data-swiping=false][data-removed=true])::before {
272
- content: "";
273
- position: absolute;
274
- inset: 0;
275
- transform: scaleY(2);
276
- }
277
- :where([data-sonner-toast])::after {
278
- content: "";
279
- position: absolute;
280
- left: 0;
281
- height: calc(var(--gap) + 1px);
282
- bottom: 100%;
283
- width: 100%;
284
- }
285
- :where([data-sonner-toast][data-mounted=true]) {
286
- --y: translateY(0);
287
- opacity: 1;
288
- }
289
- :where([data-sonner-toast][data-expanded=false][data-front=false]) {
290
- --scale: var(--toasts-before) * 0.05 + 1;
291
- --y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));
292
- height: var(--front-toast-height);
293
- }
294
- :where([data-sonner-toast]) > * {
295
- transition: opacity 400ms;
296
- }
297
- :where([data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]) > * {
298
- opacity: 0;
299
- }
300
- :where([data-sonner-toast][data-visible=false]) {
301
- opacity: 0;
302
- pointer-events: none;
303
- }
304
- :where([data-sonner-toast][data-mounted=true][data-expanded=true]) {
305
- --y: translateY(calc(var(--lift) * var(--offset)));
306
- height: var(--initial-height);
307
- }
308
- :where([data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]) {
309
- --y: translateY(calc(var(--lift) * -100%));
310
- opacity: 0;
311
- }
312
- :where([data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]) {
313
- --y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));
314
- opacity: 0;
315
- }
316
- :where([data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]) {
317
- --y: translateY(40%);
318
- opacity: 0;
319
- transition: transform 500ms, opacity 200ms;
320
- }
321
- :where([data-sonner-toast][data-removed=true][data-front=false])::before {
322
- height: calc(var(--initial-height) + 20%);
323
- }
324
- [data-sonner-toast][data-swiping=true] {
325
- transform: var(--y) translateY(var(--swipe-amount, 0px));
326
- transition: none;
327
- }
328
- [data-sonner-toast][data-swipe-out=true][data-y-position=bottom],
329
- [data-sonner-toast][data-swipe-out=true][data-y-position=top] {
330
- animation: swipe-out 200ms ease-out forwards;
331
- }
332
- @keyframes swipe-out {
333
- from {
334
- transform: translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));
335
- opacity: 1;
336
- }
337
- to {
338
- transform: translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));
339
- opacity: 0;
340
- }
341
- }
342
- @media (max-width: 600px) {
343
- [data-sonner-toaster] {
344
- position: fixed;
345
- --mobile-offset: 16px;
346
- right: var(--mobile-offset);
347
- left: var(--mobile-offset);
348
- width: 100%;
349
- }
350
- [data-sonner-toaster] [data-sonner-toast] {
351
- left: 0;
352
- right: 0;
353
- width: calc(100% - var(--mobile-offset) * 2);
354
- }
355
- [data-sonner-toaster][data-x-position=left] {
356
- left: var(--mobile-offset);
357
- }
358
- [data-sonner-toaster][data-y-position=bottom] {
359
- bottom: 20px;
360
- }
361
- [data-sonner-toaster][data-y-position=top] {
362
- top: 20px;
363
- }
364
- [data-sonner-toaster][data-x-position=center] {
365
- left: var(--mobile-offset);
366
- right: var(--mobile-offset);
367
- transform: none;
368
- }
369
- }
370
- [data-sonner-toaster][data-theme=light] {
371
- --normal-bg: #fff;
372
- --normal-border: var(--gray4);
373
- --normal-text: var(--gray12);
374
- --success-bg: hsl(143, 85%, 96%);
375
- --success-border: hsl(145, 92%, 91%);
376
- --success-text: hsl(140, 100%, 27%);
377
- --info-bg: hsl(208, 100%, 97%);
378
- --info-border: hsl(221, 91%, 91%);
379
- --info-text: hsl(210, 92%, 45%);
380
- --warning-bg: hsl(49, 100%, 97%);
381
- --warning-border: hsl(49, 91%, 91%);
382
- --warning-text: hsl(31, 92%, 45%);
383
- --error-bg: hsl(359, 100%, 97%);
384
- --error-border: hsl(359, 100%, 94%);
385
- --error-text: hsl(360, 100%, 45%);
386
- }
387
- [data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true] {
388
- --normal-bg: #000;
389
- --normal-border: hsl(0, 0%, 20%);
390
- --normal-text: var(--gray1);
391
- }
392
- [data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true] {
393
- --normal-bg: #fff;
394
- --normal-border: var(--gray3);
395
- --normal-text: var(--gray12);
396
- }
397
- [data-sonner-toaster][data-theme=dark] {
398
- --normal-bg: #000;
399
- --normal-border: hsl(0, 0%, 20%);
400
- --normal-text: var(--gray1);
401
- --success-bg: hsl(150, 100%, 6%);
402
- --success-border: hsl(147, 100%, 12%);
403
- --success-text: hsl(150, 86%, 65%);
404
- --info-bg: hsl(215, 100%, 6%);
405
- --info-border: hsl(223, 100%, 12%);
406
- --info-text: hsl(216, 87%, 65%);
407
- --warning-bg: hsl(64, 100%, 6%);
408
- --warning-border: hsl(60, 100%, 12%);
409
- --warning-text: hsl(46, 87%, 65%);
410
- --error-bg: hsl(358, 76%, 10%);
411
- --error-border: hsl(357, 89%, 16%);
412
- --error-text: hsl(358, 100%, 81%);
413
- }
414
- [data-rich-colors=true] [data-sonner-toast][data-type=success] {
415
- background: var(--success-bg);
416
- border-color: var(--success-border);
417
- color: var(--success-text);
418
- }
419
- [data-rich-colors=true] [data-sonner-toast][data-type=success] [data-close-button] {
420
- background: var(--success-bg);
421
- border-color: var(--success-border);
422
- color: var(--success-text);
423
- }
424
- [data-rich-colors=true] [data-sonner-toast][data-type=info] {
425
- background: var(--info-bg);
426
- border-color: var(--info-border);
427
- color: var(--info-text);
428
- }
429
- [data-rich-colors=true] [data-sonner-toast][data-type=info] [data-close-button] {
430
- background: var(--info-bg);
431
- border-color: var(--info-border);
432
- color: var(--info-text);
433
- }
434
- [data-rich-colors=true] [data-sonner-toast][data-type=warning] {
435
- background: var(--warning-bg);
436
- border-color: var(--warning-border);
437
- color: var(--warning-text);
438
- }
439
- [data-rich-colors=true] [data-sonner-toast][data-type=warning] [data-close-button] {
440
- background: var(--warning-bg);
441
- border-color: var(--warning-border);
442
- color: var(--warning-text);
443
- }
444
- [data-rich-colors=true] [data-sonner-toast][data-type=error] {
445
- background: var(--error-bg);
446
- border-color: var(--error-border);
447
- color: var(--error-text);
448
- }
449
- [data-rich-colors=true] [data-sonner-toast][data-type=error] [data-close-button] {
450
- background: var(--error-bg);
451
- border-color: var(--error-border);
452
- color: var(--error-text);
453
- }
454
- .sonner-loading-wrapper {
455
- --size: 16px;
456
- height: var(--size);
457
- width: var(--size);
458
- position: absolute;
459
- inset: 0;
460
- z-index: 10;
461
- }
462
- .sonner-loading-wrapper[data-visible=false] {
463
- transform-origin: center;
464
- animation: sonner-fade-out 0.2s ease forwards;
465
- }
466
- .sonner-spinner {
467
- position: relative;
468
- top: 50%;
469
- left: 50%;
470
- height: var(--size);
471
- width: var(--size);
472
- }
473
- .sonner-loading-bar {
474
- animation: sonner-spin 1.2s linear infinite;
475
- background: var(--gray11);
476
- border-radius: 6px;
477
- height: 8%;
478
- left: -10%;
479
- position: absolute;
480
- top: -3.9%;
481
- width: 24%;
482
- }
483
- .sonner-loading-bar:nth-child(1) {
484
- animation-delay: -1.2s;
485
- transform: rotate(0.0001deg) translate(146%);
486
- }
487
- .sonner-loading-bar:nth-child(2) {
488
- animation-delay: -1.1s;
489
- transform: rotate(30deg) translate(146%);
490
- }
491
- .sonner-loading-bar:nth-child(3) {
492
- animation-delay: -1s;
493
- transform: rotate(60deg) translate(146%);
494
- }
495
- .sonner-loading-bar:nth-child(4) {
496
- animation-delay: -0.9s;
497
- transform: rotate(90deg) translate(146%);
498
- }
499
- .sonner-loading-bar:nth-child(5) {
500
- animation-delay: -0.8s;
501
- transform: rotate(120deg) translate(146%);
502
- }
503
- .sonner-loading-bar:nth-child(6) {
504
- animation-delay: -0.7s;
505
- transform: rotate(150deg) translate(146%);
506
- }
507
- .sonner-loading-bar:nth-child(7) {
508
- animation-delay: -0.6s;
509
- transform: rotate(180deg) translate(146%);
510
- }
511
- .sonner-loading-bar:nth-child(8) {
512
- animation-delay: -0.5s;
513
- transform: rotate(210deg) translate(146%);
514
- }
515
- .sonner-loading-bar:nth-child(9) {
516
- animation-delay: -0.4s;
517
- transform: rotate(240deg) translate(146%);
518
- }
519
- .sonner-loading-bar:nth-child(10) {
520
- animation-delay: -0.3s;
521
- transform: rotate(270deg) translate(146%);
522
- }
523
- .sonner-loading-bar:nth-child(11) {
524
- animation-delay: -0.2s;
525
- transform: rotate(300deg) translate(146%);
526
- }
527
- .sonner-loading-bar:nth-child(12) {
528
- animation-delay: -0.1s;
529
- transform: rotate(330deg) translate(146%);
530
- }
531
- @keyframes sonner-fade-in {
532
- 0% {
533
- opacity: 0;
534
- transform: scale(0.8);
535
- }
536
- 100% {
537
- opacity: 1;
538
- transform: scale(1);
539
- }
540
- }
541
- @keyframes sonner-fade-out {
542
- 0% {
543
- opacity: 1;
544
- transform: scale(1);
545
- }
546
- 100% {
547
- opacity: 0;
548
- transform: scale(0.8);
549
- }
550
- }
551
- @keyframes sonner-spin {
552
- 0% {
553
- opacity: 1;
554
- }
555
- 100% {
556
- opacity: 0.15;
557
- }
558
- }
559
- @media (prefers-reduced-motion) {
560
- [data-sonner-toast],
561
- [data-sonner-toast] > *,
562
- .sonner-loading-bar {
563
- transition: none !important;
564
- animation: none !important;
565
- }
566
- }
567
- .sonner-loader {
568
- position: absolute;
569
- top: 50%;
570
- left: 50%;
571
- transform: translate(-50%, -50%);
572
- transform-origin: center;
573
- transition: opacity 200ms, transform 200ms;
574
- }
575
- .sonner-loader[data-visible=false] {
576
- opacity: 0;
577
- transform: scale(0.8) translate(-50%, -50%);
578
- }
579
- `);Array(12).fill(0);var Ws=0,db=class{constructor(){le(this,"subscribers");le(this,"toasts");le(this,"subscribe",e=>(this.subscribers.push(e),()=>{const t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}));le(this,"publish",e=>{this.subscribers.forEach(t=>t(e))});le(this,"addToast",e=>{this.publish(e),this.toasts=[...this.toasts,e]});le(this,"create",e=>{var s;const{message:t,...n}=e,r=typeof(e==null?void 0:e.id)=="number"||e.id&&((s=e.id)==null?void 0:s.length)>0?e.id:Ws++;return this.toasts.find(i=>i.id===r)?this.toasts=this.toasts.map(i=>i.id===r?(this.publish({...i,...e,id:r,title:t}),{...i,...e,id:r,title:t}):i):this.addToast({title:t,...n,id:r}),r});le(this,"dismiss",e=>(e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e));le(this,"message",(e,t)=>this.create({...t,message:e}));le(this,"error",(e,t)=>this.create({...t,message:e,type:"error"}));le(this,"success",(e,t)=>this.create({...t,type:"success",message:e}));le(this,"info",(e,t)=>this.create({...t,type:"info",message:e}));le(this,"warning",(e,t)=>this.create({...t,type:"warning",message:e}));le(this,"promise",(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading}));const r=e instanceof Promise?e:e();let o=n!==void 0;return r.then(s=>{if(s&&typeof s.ok=="boolean"&&!s.ok){o=!1;const i=typeof t.error=="function"?t.error(`HTTP error! status: ${s.status}`):t.error;this.create({id:n,type:"error",message:i})}else if(t.success!==void 0){o=!1;const i=typeof t.success=="function"?t.success(s):t.success;this.create({id:n,type:"success",message:i})}}).catch(s=>{if(t.error!==void 0){o=!1;const i=typeof t.error=="function"?t.error(s):t.error;this.create({id:n,type:"error",message:i})}}).finally(()=>{var s;o&&(this.dismiss(n),n=void 0),(s=t.finally)==null||s.call(t)}),n});le(this,"loading",(e,t)=>this.create({...t,type:"loading",message:e}));le(this,"custom",(e,t)=>{const n=(t==null?void 0:t.id)||Ws++;return this.publish({jsx:e(n),id:n,...t}),n});this.subscribers=[],this.toasts=[]}},at=new db;function fb(e,t){const n=(t==null?void 0:t.id)||Ws++;return at.addToast({title:e,...t,id:n}),n}var hb=fb,gb=Object.assign(hb,{success:at.success,info:at.info,warning:at.warning,error:at.error,custom:at.custom,message:at.message,promise:at.promise,dismiss:at.dismiss,loading:at.loading});/*!
580
- * Original code by Emil Kowalski
581
- * MIT Licensed, Copyright 2023 Emil Kowalski, see https://github.com/emilkowalski/sonner/blob/main/LICENSE.md for details
582
- *
583
- * Credits:
584
- * https://github.com/emilkowalski/sonner/blob/main/src/index.tsx
585
- */Ys(["pointerdown","pointerup","pointermove","click","mousemove"]);var pb=he('<form class="flex flex-col gap-3"><div></div><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="flex justify-end">'),mb=he('<em class="text-xs text-red-500">'),yb=he('<em class="text-xs text-muted-foreground">'),vb=he('<a target=_blank rel=noreferrer class="text-xs text-muted-foreground">Commit Hash: '),wb=he('<p class="text-xs text-muted-foreground">Commit Hash: ');const bb=({bundleId:e,onClose:t})=>{const n=jp(e);return S(Mp,{class:"flex flex-col h-full",get children(){return[S(Fp,{class:"mb-4",get children(){return S($p,{get children(){return["Edit ",e]}})}}),S(Ce,{get when(){return n.data},get fallback(){return N(()=>!!n.isFetched)()?S(Ap,{get children(){return["No update bundle found for bundle id ",e]}}):S($w,{height:374,radius:10})},children:r=>S(Sb,{get bundle(){return r()},onEditSuccess:t})})]}})},Sb=({bundle:e,onEditSuccess:t})=>{const n=Bu(),r=Kp(),[o,s]=z(!1),i=N(()=>{var c,d;return((d=(c=r.data)==null?void 0:c.console)==null?void 0:d.gitUrl)??null}),a=N(()=>e.gitCommitHash),l=Yw(()=>({defaultValues:{message:e.message,targetAppVersion:e.targetAppVersion,enabled:e.enabled,shouldForceUpdate:e.shouldForceUpdate},onSubmit:async({value:c})=>{s(!0);try{await lo.updateBundle.$post({json:{targetBundleId:e.id,bundle:c}})}catch(d){d instanceof Error&&gb(d.message)}finally{s(!1),n.invalidateQueries({queryKey:["getBundle",e.id]}),n.invalidateQueries({queryKey:["getBundles"]}),t()}}})),u=l.useStore(c=>c.isValid);return(()=>{var c=pb(),d=c.firstChild,f=d.nextSibling,h=f.nextSibling,g=h.firstChild,p=h.nextSibling,m=p.firstChild,w=p.nextSibling;return c.addEventListener("submit",y=>{y.preventDefault(),y.stopPropagation(),l.handleSubmit()}),fe(d,S(xl,{class:"grid w-full max-w-sm items-center gap-1.5",get children(){return[S(El,{for:"message",children:"Message"}),S(l.Field,{name:"message",children:y=>S(Cl,{type:"text",id:"message",placeholder:"Message",get name(){return y().name},get value(){return y().state.value??""},get onBlur(){return y().handleBlur},onInput:v=>y().handleChange(v.currentTarget.value)})})]}})),fe(f,S(xl,{class:"grid w-full max-w-sm items-center gap-1.5",get children(){return[S(El,{for:"targetAppVersion",children:"Target App Version"}),S(l.Field,{name:"targetAppVersion",validators:{onChange:({value:y})=>{if((y==null?void 0:y.length)===0||!Hl(y))return"Invalid target app version"}},children:y=>[S(Cl,{type:"text",id:"targetAppVersion",get class(){return pe(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:v=>y().handleChange(v.currentTarget.value)}),N(()=>N(()=>y().state.meta.errors.length>0)()?(()=>{var v=mb();return fe(v,()=>y().state.meta.errors.join(", ")),v})():(()=>{var v=yb();return fe(v,()=>Hl(y().state.value)),v})())]})]}})),fe(g,S(l.Field,{name:"enabled",children:y=>S(vl,{class:"flex items-center space-x-2",get checked(){return y().state.value},get name(){return y().name},onChange:v=>y().handleChange(v),get children(){return[S(wl,{get children(){return S(bl,{})}}),S(Sl,{children:"Enabled"})]}})})),fe(m,S(l.Field,{name:"shouldForceUpdate",children:y=>S(vl,{class:"flex items-center space-x-2",get checked(){return y().state.value},get name(){return y().name},onChange:v=>y().handleChange(v),get children(){return[S(wl,{get children(){return S(bl,{})}}),S(Sl,{children:"Force Update"})]}})})),fe(c,S(Ce,{get when(){return!o()},get fallback(){return S(ml,{type:"submit",class:"mt-4",disabled:!0,get children(){return S(nm,{class:"animate-spin"})}})},get children(){return S(ml,{type:"submit",class:"mt-4",get disabled(){return!u()},children:"Save"})}}),w),fe(w,S(Ce,{get when(){return a()},children:y=>i()?(()=>{var v=vb();return v.firstChild,fe(v,()=>y().slice(0,8),null),Ke(()=>un(v,"href",`${i()}/commit/${y}`)),v})():(()=>{var v=wb();return v.firstChild,fe(v,()=>y().slice(0,8),null),v})()})),c})()};function Ul(){const e=Vf(),t=kf(),n=e.bundleId,r=Np(),[o,s]=z(n);q(()=>{if(!o()){t("/",{replace:!0});return}t(`/${o()}`,{replace:!0})}),q(()=>{a()||bp(500).then(()=>s(null))});const i=N(()=>r.data||[]),[a,l]=z(!0),u=()=>{l(!1)};return S(Cp,{get open(){return a()},onOpenChange:l,get children(){return[S(Iw,{columns:sm,data:i,onRowClick:c=>{s(c.id)}}),S(Ce,{get when(){return o()},get children(){return S(du,{get children(){return S(bb,{get bundleId(){return o()},onClose:u})}})}})]}})}const xb=new $h;function Cb(){return S(Ah,{client:xb,get children(){return S(eh,{root:e=>S(Ef,{get children(){return[S(If,{children:"HotUpdater Console"}),S(du,{get fallback(){return S(ih,{})},get children(){return S(lh,{get children(){return e.children}})}})]}}),get children(){return[S(wa,{path:"/",component:Ul}),S(wa,{path:"/:bundleId",component:Ul})]}})}})}const ql=document.getElementById("root");ql&&lf(()=>S(Cb,{}),ql);