@commandkit/devtools 1.2.0-dev.20250822125039 → 1.2.0-dev.20250823124655

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@commandkit/devtools",
3
3
  "description": "CommandKit devtools",
4
- "version": "1.2.0-dev.20250822125039",
4
+ "version": "1.2.0-dev.20250823124655",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "devDependencies": {
@@ -10,8 +10,8 @@
10
10
  "@types/express": "^5.0.1",
11
11
  "discord.js": "^14.21.0",
12
12
  "typescript": "^5.8.3",
13
- "commandkit": "1.2.0-dev.20250822125039",
14
- "tsconfig": "0.0.0-dev.20250822125039"
13
+ "tsconfig": "0.0.0-dev.20250823124655",
14
+ "commandkit": "1.2.0-dev.20250823124655"
15
15
  },
16
16
  "files": [
17
17
  "dist",
@@ -1,20 +1,20 @@
1
- import{i,r as p,u as N,a as g,j as e,B as c,k as v,C as f}from"./index-CCM7vRwa.js";/**
2
- * @license lucide-react v0.540.0 - ISC
1
+ import{i,r as p,u as N,a as g,j as e,B as c,k as v,C as f}from"./index-aesTD9GY.js";/**
2
+ * @license lucide-react v0.541.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
6
  */const b=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],y=i("chevron-down",b);/**
7
- * @license lucide-react v0.540.0 - ISC
7
+ * @license lucide-react v0.541.0 - ISC
8
8
  *
9
9
  * This source code is licensed under the ISC license.
10
10
  * See the LICENSE file in the root directory of this source tree.
11
11
  */const w=[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]],C=i("command",w);/**
12
- * @license lucide-react v0.540.0 - ISC
12
+ * @license lucide-react v0.541.0 - ISC
13
13
  *
14
14
  * This source code is licensed under the ISC license.
15
15
  * See the LICENSE file in the root directory of this source tree.
16
16
  */const k=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],j=i("folder-tree",k);/**
17
- * @license lucide-react v0.540.0 - ISC
17
+ * @license lucide-react v0.541.0 - ISC
18
18
  *
19
19
  * This source code is licensed under the ISC license.
20
20
  * See the LICENSE file in the root directory of this source tree.
@@ -1 +1 @@
1
- import{u as x,a as p,r as o,j as e,L as u,B as c}from"./index-CCM7vRwa.js";function f(){const i=x(),{data:r,isLoading:m,isError:l}=p({queryKey:["events"],queryFn:async()=>await i.events.fetch()}),n=o.useMemo(()=>crypto.randomUUID(),[]),d=o.useMemo(()=>{if(!r)return[];const s={};return r.forEach(a=>{const t=a.namespace||n;s[t]||(s[t]=[]),s[t].push(a)}),Object.entries(s).map(([a,t])=>({namespace:a,events:t}))},[r,n]);return m||!r?e.jsx(u,{}):l?e.jsx("div",{className:"h-screen grid place-items-center",children:e.jsx("h1",{className:"text-2xl text-red-500",children:"An error occurred while fetching events data."})}):e.jsx("div",{className:"p-4",children:d.map(s=>e.jsxs("div",{className:"mb-6",children:[e.jsx("h1",{className:"text-2xl font-bold capitalize",children:s.namespace===n?"Default":s.namespace}),e.jsx("div",{className:"grid grid-cols-3 gap-4 py-4",children:s.events.map(a=>e.jsxs("div",{className:"border p-4 rounded",children:[e.jsx("h2",{className:"text-lg font-semibold",children:a.name}),e.jsx("p",{className:"text-muted-foreground text-xs mt-2 font-medium font-mono break-all",children:a.metadata.path}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs(c,{variant:"outline",className:"text-xs text-gray-500 mt-2 font-mono",children:["Namespace: ",a.namespace||"discord.js"]}),e.jsxs(c,{variant:"outline",className:"text-xs text-gray-500 mt-2 font-mono break-all",children:["Once: ",a.onceListeners]}),e.jsxs(c,{variant:"outline",className:"text-xs text-gray-500 mt-2 font-mono break-all",children:["Regular: ",a.regularListeners]})]})]},`${a.name}-${s.namespace}`))})]},s.namespace))})}export{f as component};
1
+ import{u as x,a as p,r as o,j as e,L as u,B as c}from"./index-aesTD9GY.js";function f(){const i=x(),{data:r,isLoading:m,isError:l}=p({queryKey:["events"],queryFn:async()=>await i.events.fetch()}),n=o.useMemo(()=>crypto.randomUUID(),[]),d=o.useMemo(()=>{if(!r)return[];const s={};return r.forEach(a=>{const t=a.namespace||n;s[t]||(s[t]=[]),s[t].push(a)}),Object.entries(s).map(([a,t])=>({namespace:a,events:t}))},[r,n]);return m||!r?e.jsx(u,{}):l?e.jsx("div",{className:"h-screen grid place-items-center",children:e.jsx("h1",{className:"text-2xl text-red-500",children:"An error occurred while fetching events data."})}):e.jsx("div",{className:"p-4",children:d.map(s=>e.jsxs("div",{className:"mb-6",children:[e.jsx("h1",{className:"text-2xl font-bold capitalize",children:s.namespace===n?"Default":s.namespace}),e.jsx("div",{className:"grid grid-cols-3 gap-4 py-4",children:s.events.map(a=>e.jsxs("div",{className:"border p-4 rounded",children:[e.jsx("h2",{className:"text-lg font-semibold",children:a.name}),e.jsx("p",{className:"text-muted-foreground text-xs mt-2 font-medium font-mono break-all",children:a.metadata.path}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs(c,{variant:"outline",className:"text-xs text-gray-500 mt-2 font-mono",children:["Namespace: ",a.namespace||"discord.js"]}),e.jsxs(c,{variant:"outline",className:"text-xs text-gray-500 mt-2 font-mono break-all",children:["Once: ",a.onceListeners]}),e.jsxs(c,{variant:"outline",className:"text-xs text-gray-500 mt-2 font-mono break-all",children:["Regular: ",a.regularListeners]})]})]},`${a.name}-${s.namespace}`))})]},s.namespace))})}export{f as component};
@@ -1 +1 @@
1
- import{u as i,a as d,j as e,L as o,B as c}from"./index-CCM7vRwa.js";function u(){const r=i(),{data:t,isLoading:a,isError:n}=d({queryKey:["feature-flags"],queryFn:async()=>await r.getFeatureFlags()});return a||!t?e.jsx(o,{}):n?e.jsx("div",{className:"h-screen grid place-items-center",children:e.jsx("h1",{className:"text-2xl text-red-500",children:"An error occurred while fetching plugins data."})}):e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold ",children:"Feature Flags"}),e.jsx("p",{className:"text-muted-foreground",children:"The below is a list of active feature flags in your project"})]}),e.jsx("div",{className:"grid grid-cols-3 gap-4 py-4",children:t.flags.map(s=>e.jsxs("div",{className:"border p-4 rounded",children:[e.jsx("h2",{className:"text-lg font-semibold",children:s.key}),e.jsx("p",{className:"text-muted-foreground text-xs mt-2 font-medium",children:s.description||`${s.key} feature flag`}),s.hasIdentify&&e.jsx(c,{variant:"outline",className:"text-sm text-gray-500 mt-2 font-mono",children:"identify"})]},s.key))})]})}export{u as component};
1
+ import{u as i,a as d,j as e,L as o,B as c}from"./index-aesTD9GY.js";function u(){const r=i(),{data:t,isLoading:a,isError:n}=d({queryKey:["feature-flags"],queryFn:async()=>await r.getFeatureFlags()});return a||!t?e.jsx(o,{}):n?e.jsx("div",{className:"h-screen grid place-items-center",children:e.jsx("h1",{className:"text-2xl text-red-500",children:"An error occurred while fetching plugins data."})}):e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold ",children:"Feature Flags"}),e.jsx("p",{className:"text-muted-foreground",children:"The below is a list of active feature flags in your project"})]}),e.jsx("div",{className:"grid grid-cols-3 gap-4 py-4",children:t.flags.map(s=>e.jsxs("div",{className:"border p-4 rounded",children:[e.jsx("h2",{className:"text-lg font-semibold",children:s.key}),e.jsx("p",{className:"text-muted-foreground text-xs mt-2 font-medium",children:s.description||`${s.key} feature flag`}),s.hasIdentify&&e.jsx(c,{variant:"outline",className:"text-sm text-gray-500 mt-2 font-mono",children:"identify"})]},s.key))})]})}export{u as component};
@@ -1 +1 @@
1
- import{u as t,a as d,j as e,L as i,C as l,b as o,A as x,c as m,d as h,e as j,f as u,h as p}from"./index-CCM7vRwa.js";function f(){const a=t(),{data:r,isLoading:n,isError:c}=d({queryKey:["guilds"],queryFn:async()=>await a.guilds.fetch()});return n||!r?e.jsx(i,{}):c?e.jsx("div",{className:"h-screen grid place-items-center",children:e.jsx("h1",{className:"text-2xl text-red-500",children:"An error occurred while fetching guilds data."})}):e.jsxs("div",{className:"grid grid-cols-3 gap-4 p-4",children:[e.jsx("h1",{className:"text-2xl font-bold col-span-3",children:"Guilds"}),r.map(s=>e.jsxs(l,{className:"border py-4 rounded",children:[e.jsx(o,{children:e.jsxs(x,{className:"h-12 w-12 rounded-lg",children:[e.jsx(m,{src:s.iconURL,alt:s.name}),e.jsx(h,{className:"rounded-lg",children:s.nameAcronym})]})}),e.jsxs(j,{children:[e.jsx(u,{children:s.name}),e.jsx(p,{children:s.description||`${s.name} server`})]})]},s.id))]})}export{f as component};
1
+ import{u as t,a as d,j as e,L as i,C as l,b as o,A as x,c as m,d as h,e as j,f as u,h as p}from"./index-aesTD9GY.js";function f(){const a=t(),{data:r,isLoading:n,isError:c}=d({queryKey:["guilds"],queryFn:async()=>await a.guilds.fetch()});return n||!r?e.jsx(i,{}):c?e.jsx("div",{className:"h-screen grid place-items-center",children:e.jsx("h1",{className:"text-2xl text-red-500",children:"An error occurred while fetching guilds data."})}):e.jsxs("div",{className:"grid grid-cols-3 gap-4 p-4",children:[e.jsx("h1",{className:"text-2xl font-bold col-span-3",children:"Guilds"}),r.map(s=>e.jsxs(l,{className:"border py-4 rounded",children:[e.jsx(o,{children:e.jsxs(x,{className:"h-12 w-12 rounded-lg",children:[e.jsx(m,{src:s.iconURL,alt:s.name}),e.jsx(h,{className:"rounded-lg",children:s.nameAcronym})]})}),e.jsxs(j,{children:[e.jsx(u,{children:s.name}),e.jsx(p,{children:s.description||`${s.name} server`})]})]},s.id))]})}export{f as component};
@@ -1,20 +1,20 @@
1
- import{i as c,u as h,j as e,B as s,C as a,b as r,f as t,e as l,l as x,h as m,m as n,n as i}from"./index-CCM7vRwa.js";/**
2
- * @license lucide-react v0.540.0 - ISC
1
+ import{i as c,u as h,j as e,B as s,C as a,b as r,f as t,e as l,l as x,h as m,m as n,n as i}from"./index-aesTD9GY.js";/**
2
+ * @license lucide-react v0.541.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
6
  */const j=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],o=c("arrow-up-right",j);/**
7
- * @license lucide-react v0.540.0 - ISC
7
+ * @license lucide-react v0.541.0 - ISC
8
8
  *
9
9
  * This source code is licensed under the ISC license.
10
10
  * See the LICENSE file in the root directory of this source tree.
11
11
  */const u=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],p=c("message-square",u);/**
12
- * @license lucide-react v0.540.0 - ISC
12
+ * @license lucide-react v0.541.0 - ISC
13
13
  *
14
14
  * This source code is licensed under the ISC license.
15
15
  * See the LICENSE file in the root directory of this source tree.
16
16
  */const f=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],N=c("server",f);/**
17
- * @license lucide-react v0.540.0 - ISC
17
+ * @license lucide-react v0.541.0 - ISC
18
18
  *
19
19
  * This source code is licensed under the ISC license.
20
20
  * See the LICENSE file in the root directory of this source tree.
@@ -64,62 +64,62 @@ Error generating stack: `+i.message+`
64
64
  * LICENSE file in the root directory of this source tree.
65
65
  */var Zv;function LE(){if(Zv)return $f;Zv=1;var e=to(),a=j0();function r(m,v){return m===v&&(m!==0||1/m===1/v)||m!==m&&v!==v}var s=typeof Object.is=="function"?Object.is:r,l=a.useSyncExternalStore,c=e.useRef,f=e.useEffect,h=e.useMemo,p=e.useDebugValue;return $f.useSyncExternalStoreWithSelector=function(m,v,g,y,x){var S=c(null);if(S.current===null){var w={hasValue:!1,value:null};S.current=w}else w=S.current;S=h(function(){function C(F){if(!j){if(j=!0,L=F,F=y(F),x!==void 0&&w.hasValue){var G=w.value;if(x(G,F))return U=G}return U=F}if(G=U,s(L,F))return G;var q=y(F);return x!==void 0&&x(G,q)?(L=F,G):(L=F,U=q)}var j=!1,L,U,N=g===void 0?null:g;return[function(){return C(v())},N===null?void 0:function(){return C(N())}]},[v,g,y,x]);var T=l(m,S[0],S[1]);return f(function(){w.hasValue=!0,w.value=T},[T]),p(T),T},$f}var Iv;function jE(){return Iv||(Iv=1,Xf.exports=LE()),Xf.exports}var zE=jE();function PE(e,a=r=>r){return zE.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,a,UE)}function UE(e,a){if(Object.is(e,a))return!0;if(typeof e!="object"||e===null||typeof a!="object"||a===null)return!1;if(e instanceof Map&&a instanceof Map){if(e.size!==a.size)return!1;for(const[s,l]of e)if(!a.has(s)||!Object.is(l,a.get(s)))return!1;return!0}if(e instanceof Set&&a instanceof Set){if(e.size!==a.size)return!1;for(const s of e)if(!a.has(s))return!1;return!0}if(e instanceof Date&&a instanceof Date)return e.getTime()===a.getTime();const r=Object.keys(e);if(r.length!==Object.keys(a).length)return!1;for(let s=0;s<r.length;s++)if(!Object.prototype.hasOwnProperty.call(a,r[s])||!Object.is(e[r[s]],a[r[s]]))return!1;return!0}const Wf=R.createContext(null);function z0(){return typeof document>"u"?Wf:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=Wf,Wf)}function un(e){const a=R.useContext(z0());return e?.warn,a}function ze(e){const a=un({warn:e?.router===void 0}),r=e?.router||a,s=R.useRef(void 0);return PE(r.__store,l=>{if(e?.select){if(e.structuralSharing??r.options.defaultStructuralSharing){const c=rn(s.current,e.select(l));return s.current=c,c}return e.select(l)}return l})}const mc=R.createContext(void 0),BE=R.createContext(void 0);function ln(e){const a=R.useContext(e.from?BE:mc);return ze({select:s=>{const l=s.matches.find(c=>e.from?e.from===c.routeId:c.id===a);if(ia(!((e.shouldThrow??!0)&&!l),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),l!==void 0)return e.select?e.select(l):l},structuralSharing:e.structuralSharing})}function Wd(e){return ln({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:a=>e.select?e.select(a.loaderData):a.loaderData})}function Jd(e){const{select:a,...r}=e;return ln({...r,select:s=>a?a(s.loaderDeps):s.loaderDeps})}function th(e){return ln({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:a=>e.select?e.select(a.params):a.params})}function eh(e){return ln({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:a=>e.select?e.select(a.search):a.search})}function nh(e){const{navigate:a,state:r}=un(),s=ln({strict:!1,select:l=>l.index});return R.useCallback(l=>{const c=l.from??e?.from??r.matches[s].fullPath;return a({...l,from:c})},[e?.from,a])}var pc=x0();const P0=b0(pc),Ml=typeof window<"u"?R.useLayoutEffect:R.useEffect;function Jf(e){const a=R.useRef({value:e,prev:null}),r=a.current.value;return e!==r&&(a.current={value:e,prev:r}),a.current.prev}function kE(e,a,r={},s={}){R.useEffect(()=>{if(!e.current||s.disabled||typeof IntersectionObserver!="function")return;const l=new IntersectionObserver(([c])=>{a(c)},r);return l.observe(e.current),()=>{l.disconnect()}},[a,r,s.disabled,e])}function HE(e){const a=R.useRef(null);return R.useImperativeHandle(e,()=>a.current,[]),a}function qE(e,a){const r=un(),[s,l]=R.useState(!1),c=R.useRef(!1),f=HE(a),{activeProps:h,inactiveProps:p,activeOptions:m,to:v,preload:g,preloadDelay:y,hashScrollIntoView:x,replace:S,startTransition:w,resetScroll:T,viewTransition:C,children:j,target:L,disabled:U,style:N,className:F,onClick:G,onFocus:q,onMouseEnter:et,onMouseLeave:W,onTouchStart:at,ignoreBlocker:st,params:mt,search:ht,hash:yt,state:D,mask:K,reloadDocument:V,unsafeRelative:ft,from:O,_fromLocation:$,...nt}=e,Q=R.useMemo(()=>{try{return new URL(v),"external"}catch{}return"internal"},[v]),tt=ze({select:Rt=>Rt.location.search,structuralSharing:!0}),it=ln({strict:!1,select:Rt=>e.from??Rt.fullPath}),rt=R.useMemo(()=>r.buildLocation({...e,from:it}),[r,tt,e._fromLocation,it,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),vt=Q==="external",ut=e.reloadDocument||vt?!1:g??r.options.defaultPreload,kt=y??r.options.defaultPreloadDelay??0,re=ze({select:Rt=>{if(vt)return!1;if(m?.exact){if(!Uw(Rt.location.pathname,rt.pathname,r.basepath))return!1}else{const Vt=Zl(Rt.location.pathname,r.basepath),Xe=Zl(rt.pathname,r.basepath);if(!(Vt.startsWith(Xe)&&(Vt.length===Xe.length||Vt[Xe.length]==="/")))return!1}return(m?.includeSearch??!0)&&!Si(Rt.location.search,rt.search,{partial:!m?.exact,ignoreUndefined:!m?.explicitUndefined})?!1:m?.includeHash?Rt.location.hash===rt.hash:!0}}),Yt=R.useCallback(()=>{r.preloadRoute({...e,from:it}).catch(Rt=>{console.warn(Rt),console.warn(TE)})},[r,e.to,e._fromLocation,it,e.search,e.hash,e.params,e.state,e.mask,e.unsafeRelative,e.hashScrollIntoView,e.href,e.ignoreBlocker,e.reloadDocument,e.replace,e.resetScroll,e.viewTransition]),ie=R.useCallback(Rt=>{Rt?.isIntersecting&&Yt()},[Yt]);if(kE(f,ie,QE,{disabled:!!U||ut!=="viewport"}),R.useEffect(()=>{c.current||!U&&ut==="render"&&(Yt(),c.current=!0)},[U,Yt,ut]),vt)return{...nt,ref:f,type:Q,href:v,...j&&{children:j},...L&&{target:L},...U&&{disabled:U},...N&&{style:N},...F&&{className:F},...G&&{onClick:G},...q&&{onFocus:q},...et&&{onMouseEnter:et},...W&&{onMouseLeave:W},...at&&{onTouchStart:at}};const Ke=Rt=>{if(!U&&!KE(Rt)&&!Rt.defaultPrevented&&(!L||L==="_self")&&Rt.button===0){Rt.preventDefault(),pc.flushSync(()=>{l(!0)});const Vt=r.subscribe("onResolved",()=>{Vt(),l(!1)});r.navigate({...e,from:it,replace:S,resetScroll:T,hashScrollIntoView:x,startTransition:w,viewTransition:C,ignoreBlocker:st})}},xn=Rt=>{U||ut&&Yt()},ki=xn,_r=Rt=>{if(!(U||!ut))if(!kt)Yt();else{const Vt=Rt.target;if(ks.has(Vt))return;const Xe=setTimeout(()=>{ks.delete(Vt),Yt()},kt);ks.set(Vt,Xe)}},fe=Rt=>{if(U||!ut||!kt)return;const Vt=Rt.target,Xe=ks.get(Vt);Xe&&(clearTimeout(Xe),ks.delete(Vt))},Bn=re?dr(h,{})??VE:td,ve=re?td:dr(p,{})??td,Ga=[F,Bn.className,ve.className].filter(Boolean).join(" "),kn=(N||Bn.style||ve.style)&&{...N,...Bn.style,...ve.style};return{...nt,...Bn,...ve,href:U?void 0:rt.maskedLocation?r.history.createHref(rt.maskedLocation.href):r.history.createHref(rt.href),ref:f,onClick:Hs([G,Ke]),onFocus:Hs([q,xn]),onMouseEnter:Hs([et,_r]),onMouseLeave:Hs([W,fe]),onTouchStart:Hs([at,ki]),disabled:!!U,target:L,...kn&&{style:kn},...Ga&&{className:Ga},...U&&GE,...re&&YE,...s&&FE}}const td={},VE={className:"active"},GE={role:"link","aria-disabled":!0},YE={"data-status":"active","aria-current":"page"},FE={"data-transitioning":"transitioning"},ks=new WeakMap,QE={rootMargin:"100px"},Hs=e=>a=>{e.filter(Boolean).forEach(r=>{a.defaultPrevented||r(a)})},Oi=R.forwardRef((e,a)=>{const{_asChild:r,...s}=e,{type:l,ref:c,...f}=qE(s,a),h=typeof s.children=="function"?s.children({isActive:f["data-status"]==="active"}):s.children;return r===void 0&&delete f.disabled,R.createElement(r||"a",{...f,ref:c},h)});function KE(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}let XE=class extends L0{constructor(a){super(a),this.useMatch=r=>ln({select:r?.select,from:this.id,structuralSharing:r?.structuralSharing}),this.useRouteContext=r=>ln({...r,from:this.id,select:s=>r?.select?r.select(s.context):s.context}),this.useSearch=r=>eh({select:r?.select,structuralSharing:r?.structuralSharing,from:this.id}),this.useParams=r=>th({select:r?.select,structuralSharing:r?.structuralSharing,from:this.id}),this.useLoaderDeps=r=>Jd({...r,from:this.id}),this.useLoaderData=r=>Wd({...r,from:this.id}),this.useNavigate=()=>nh({from:this.fullPath}),this.Link=J.forwardRef((r,s)=>_.jsx(Oi,{ref:s,from:this.fullPath,...r})),this.$$typeof=Symbol.for("react.memo")}};function $E(e){return new XE(e)}class ZE extends CE{constructor(a){super(a),this.useMatch=r=>ln({select:r?.select,from:this.id,structuralSharing:r?.structuralSharing}),this.useRouteContext=r=>ln({...r,from:this.id,select:s=>r?.select?r.select(s.context):s.context}),this.useSearch=r=>eh({select:r?.select,structuralSharing:r?.structuralSharing,from:this.id}),this.useParams=r=>th({select:r?.select,structuralSharing:r?.structuralSharing,from:this.id}),this.useLoaderDeps=r=>Jd({...r,from:this.id}),this.useLoaderData=r=>Wd({...r,from:this.id}),this.useNavigate=()=>nh({from:this.fullPath}),this.Link=J.forwardRef((r,s)=>_.jsx(Oi,{ref:s,from:this.fullPath,...r})),this.$$typeof=Symbol.for("react.memo")}}function IE(e){return new ZE(e)}function ka(e){return typeof e=="object"?new Wv(e,{silent:!0}).createRoute(e):new Wv(e,{silent:!0}).createRoute}class Wv{constructor(a,r){this.path=a,this.createRoute=s=>{this.silent;const l=$E(s);return l.isRoot=!1,l},this.silent=r?.silent}}class Jv{constructor(a){this.useMatch=r=>ln({select:r?.select,from:this.options.id,structuralSharing:r?.structuralSharing}),this.useRouteContext=r=>ln({from:this.options.id,select:s=>r?.select?r.select(s.context):s.context}),this.useSearch=r=>eh({select:r?.select,structuralSharing:r?.structuralSharing,from:this.options.id}),this.useParams=r=>th({select:r?.select,structuralSharing:r?.structuralSharing,from:this.options.id}),this.useLoaderDeps=r=>Jd({...r,from:this.options.id}),this.useLoaderData=r=>Wd({...r,from:this.options.id}),this.useNavigate=()=>{const r=un();return nh({from:r.routesById[this.options.id].fullPath})},this.options=a,this.$$typeof=Symbol.for("react.memo")}}function ty(e){return typeof e=="object"?new Jv(e):a=>new Jv({id:e,...a})}function Mi(e,a){let r,s,l,c;const f=()=>(r||(r=e().then(p=>{r=void 0,s=p[a]}).catch(p=>{if(l=p,Pw(l)&&l instanceof Error&&typeof window<"u"&&typeof sessionStorage<"u"){const m=`tanstack_router_reload:${l.message}`;sessionStorage.getItem(m)||(sessionStorage.setItem(m,"1"),c=!0)}})),r),h=function(m){if(c)throw window.location.reload(),new Promise(()=>{});if(l)throw l;if(!s)throw f();return R.createElement(s,m)};return h.preload=f,h}function WE(){const e=un(),a=R.useRef({router:e,mounted:!1}),[r,s]=R.useState(!1),{hasPendingMatches:l,isLoading:c}=ze({select:g=>({isLoading:g.isLoading,hasPendingMatches:g.matches.some(y=>y.status==="pending")}),structuralSharing:!0}),f=Jf(c),h=c||r||l,p=Jf(h),m=c||l,v=Jf(m);return e.startTransition=g=>{s(!0),R.startTransition(()=>{g(),s(!1)})},R.useEffect(()=>{const g=e.history.subscribe(e.load),y=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return _i(e.latestLocation.href)!==_i(y.href)&&e.commitLocation({...y,replace:!0}),()=>{g()}},[e,e.history]),Ml(()=>{if(typeof window<"u"&&e.ssr||a.current.router===e&&a.current.mounted)return;a.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(y){console.error(y)}})()},[e]),Ml(()=>{f&&!c&&e.emit({type:"onLoad",...hr(e.state)})},[f,e,c]),Ml(()=>{v&&!m&&e.emit({type:"onBeforeRouteMount",...hr(e.state)})},[m,v,e]),Ml(()=>{p&&!h&&(e.emit({type:"onResolved",...hr(e.state)}),e.__store.setState(g=>({...g,status:"idle",resolvedLocation:g.location})),tE(e))},[h,p,e]),null}function JE(e){const a=ze({select:r=>`not-found-${r.location.pathname}-${r.status}`});return _.jsx(Id,{getResetKey:()=>a,onCatch:(r,s)=>{var l;if(zn(r))(l=e.onCatch)==null||l.call(e,r,s);else throw r},errorComponent:({error:r})=>{var s;if(zn(r))return(s=e.fallback)==null?void 0:s.call(e,r);throw r},children:e.children})}function tR(){return _.jsx("p",{children:"Not Found"})}function vi(e){return _.jsx(_.Fragment,{children:e.children})}function U0(e,a,r){return a.options.notFoundComponent?_.jsx(a.options.notFoundComponent,{data:r}):e.options.defaultNotFoundComponent?_.jsx(e.options.defaultNotFoundComponent,{data:r}):_.jsx(tR,{})}function eR({children:e}){return typeof document<"u"?null:_.jsx("script",{className:"$tsr",dangerouslySetInnerHTML:{__html:[e].filter(Boolean).join(`
66
66
  `)}})}function nR(){const e=un(),r=(e.options.getScrollRestorationKey||Rd)(e.latestLocation),s=r!==Rd(e.latestLocation)?r:void 0;if(!e.isScrollRestoring||!e.isServer)return null;const l={storageKey:Wl,shouldScrollRestoration:!0};return s&&(l.key=s),_.jsx(eR,{children:`(${_0.toString()})(${JSON.stringify(l)})`})}const B0=R.memo(function({matchId:a}){var r,s;const l=un(),c=ze({select:L=>{const U=L.matches.find(N=>N.id===a);return ia(U),{routeId:U.routeId,ssr:U.ssr,_displayPending:U._displayPending}},structuralSharing:!0}),f=l.routesById[c.routeId],h=f.options.pendingComponent??l.options.defaultPendingComponent,p=h?_.jsx(h,{}):null,m=f.options.errorComponent??l.options.defaultErrorComponent,v=f.options.onCatch??l.options.defaultOnCatch,g=f.isRoot?f.options.notFoundComponent??((r=l.options.notFoundRoute)==null?void 0:r.options.component):f.options.notFoundComponent,y=c.ssr===!1||c.ssr==="data-only",x=(!f.isRoot||f.options.wrapInSuspense||y)&&(f.options.wrapInSuspense??h??(((s=f.options.errorComponent)==null?void 0:s.preload)||y))?R.Suspense:vi,S=m?Id:vi,w=g?JE:vi,T=ze({select:L=>L.loadedAt}),C=ze({select:L=>{var U;const N=L.matches.findIndex(F=>F.id===a);return(U=L.matches[N-1])==null?void 0:U.routeId}}),j=f.isRoot?f.options.shellComponent??vi:vi;return _.jsxs(j,{children:[_.jsx(mc.Provider,{value:a,children:_.jsx(x,{fallback:p,children:_.jsx(S,{getResetKey:()=>T,errorComponent:m||hc,onCatch:(L,U)=>{if(zn(L))throw L;v?.(L,U)},children:_.jsx(w,{fallback:L=>{if(!g||L.routeId&&L.routeId!==c.routeId||!L.routeId&&!f.isRoot)throw L;return R.createElement(g,L)},children:y||c._displayPending?_.jsx(OE,{fallback:p,children:_.jsx(ey,{matchId:a})}):_.jsx(ey,{matchId:a})})})})}),C===sn&&l.options.scrollRestoration?_.jsxs(_.Fragment,{children:[_.jsx(aR,{}),_.jsx(nR,{})]}):null]})});function aR(){const e=un(),a=R.useRef(void 0);return _.jsx("script",{suppressHydrationWarning:!0,ref:r=>{r&&(a.current===void 0||a.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...hr(e.state)}),a.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const ey=R.memo(function({matchId:a}){var r,s,l,c;const f=un(),{match:h,key:p,routeId:m}=ze({select:y=>{const x=y.matches.find(j=>j.id===a),S=x.routeId,w=f.routesById[S].options.remountDeps??f.options.defaultRemountDeps,T=w?.({routeId:S,loaderDeps:x.loaderDeps,params:x._strictParams,search:x._strictSearch});return{key:T?JSON.stringify(T):void 0,routeId:S,match:{id:x.id,status:x.status,error:x.error,_forcePending:x._forcePending,_displayPending:x._displayPending}}},structuralSharing:!0}),v=f.routesById[m],g=R.useMemo(()=>{const y=v.options.component??f.options.defaultComponent;return y?_.jsx(y,{},p):_.jsx(k0,{})},[p,v.options.component,f.options.defaultComponent]);if(h._displayPending)throw(r=f.getMatch(h.id))==null?void 0:r._nonReactive.displayPendingPromise;if(h._forcePending)throw(s=f.getMatch(h.id))==null?void 0:s._nonReactive.minPendingPromise;if(h.status==="pending"){const y=v.options.pendingMinMs??f.options.defaultPendingMinMs;if(y){const x=f.getMatch(h.id);if(x&&!x._nonReactive.minPendingPromise&&!f.isServer){const S=Ei();x._nonReactive.minPendingPromise=S,setTimeout(()=>{S.resolve(),x._nonReactive.minPendingPromise=void 0},y)}}throw(l=f.getMatch(h.id))==null?void 0:l._nonReactive.loadPromise}if(h.status==="notFound")return ia(zn(h.error)),U0(f,v,h.error);if(h.status==="redirected")throw ia(Nn(h.error)),(c=f.getMatch(h.id))==null?void 0:c._nonReactive.loadPromise;if(h.status==="error"){if(f.isServer){const y=(v.options.errorComponent??f.options.defaultErrorComponent)||hc;return _.jsx(y,{error:h.error,reset:void 0,info:{componentStack:""}})}throw h.error}return g}),k0=R.memo(function(){const a=un(),r=R.useContext(mc),s=ze({select:m=>{var v;return(v=m.matches.find(g=>g.id===r))==null?void 0:v.routeId}}),l=a.routesById[s],c=ze({select:m=>{const g=m.matches.find(y=>y.id===r);return ia(g),g.globalNotFound}}),f=ze({select:m=>{var v;const g=m.matches,y=g.findIndex(x=>x.id===r);return(v=g[y+1])==null?void 0:v.id}}),h=a.options.defaultPendingComponent?_.jsx(a.options.defaultPendingComponent,{}):null;if(c)return U0(a,l,void 0);if(!f)return null;const p=_.jsx(B0,{matchId:f});return r===sn?_.jsx(R.Suspense,{fallback:h,children:p}):p});function rR(){const e=un(),a=e.options.defaultPendingComponent?_.jsx(e.options.defaultPendingComponent,{}):null,r=e.isServer||typeof document<"u"&&e.ssr?vi:R.Suspense,s=_.jsxs(r,{fallback:a,children:[!e.isServer&&_.jsx(WE,{}),_.jsx(iR,{})]});return e.options.InnerWrap?_.jsx(e.options.InnerWrap,{children:s}):s}function iR(){const e=un(),a=ze({select:l=>{var c;return(c=l.matches[0])==null?void 0:c.id}}),r=ze({select:l=>l.loadedAt}),s=a?_.jsx(B0,{matchId:a}):null;return _.jsx(mc.Provider,{value:a,children:e.options.disableGlobalCatchBoundary?s:_.jsx(Id,{getResetKey:()=>r,errorComponent:hc,onCatch:l=>{l.message||l.toString()},children:s})})}const sR=e=>new oR(e);class oR extends mE{constructor(a){super(a)}}typeof globalThis<"u"?(globalThis.createFileRoute=ka,globalThis.createLazyFileRoute=ty):typeof window<"u"&&(window.createFileRoute=ka,window.createLazyFileRoute=ty);function lR({router:e,children:a,...r}){Object.keys(r).length>0&&e.update({...e.options,...r,context:{...e.options.context,...r.context}});const s=z0(),l=_.jsx(s.Provider,{value:e,children:a});return e.options.Wrap?_.jsx(e.options.Wrap,{children:l}):l}function cR({router:e,...a}){return _.jsx(lR,{router:e,...a,children:_.jsx(rR,{})})}/**
67
- * @license lucide-react v0.540.0 - ISC
67
+ * @license lucide-react v0.541.0 - ISC
68
68
  *
69
69
  * This source code is licensed under the ISC license.
70
70
  * See the LICENSE file in the root directory of this source tree.
71
71
  */const uR=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),fR=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,r,s)=>s?s.toUpperCase():r.toLowerCase()),ny=e=>{const a=fR(e);return a.charAt(0).toUpperCase()+a.slice(1)},H0=(...e)=>e.filter((a,r,s)=>!!a&&a.trim()!==""&&s.indexOf(a)===r).join(" ").trim(),dR=e=>{for(const a in e)if(a.startsWith("aria-")||a==="role"||a==="title")return!0};/**
72
- * @license lucide-react v0.540.0 - ISC
72
+ * @license lucide-react v0.541.0 - ISC
73
73
  *
74
74
  * This source code is licensed under the ISC license.
75
75
  * See the LICENSE file in the root directory of this source tree.
76
76
  */var hR={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
77
- * @license lucide-react v0.540.0 - ISC
77
+ * @license lucide-react v0.541.0 - ISC
78
78
  *
79
79
  * This source code is licensed under the ISC license.
80
80
  * See the LICENSE file in the root directory of this source tree.
81
81
  */const mR=R.forwardRef(({color:e="currentColor",size:a=24,strokeWidth:r=2,absoluteStrokeWidth:s,className:l="",children:c,iconNode:f,...h},p)=>R.createElement("svg",{ref:p,...hR,width:a,height:a,stroke:e,strokeWidth:s?Number(r)*24/Number(a):r,className:H0("lucide",l),...!c&&!dR(h)&&{"aria-hidden":"true"},...h},[...f.map(([m,v])=>R.createElement(m,v)),...Array.isArray(c)?c:[c]]));/**
82
- * @license lucide-react v0.540.0 - ISC
82
+ * @license lucide-react v0.541.0 - ISC
83
83
  *
84
84
  * This source code is licensed under the ISC license.
85
85
  * See the LICENSE file in the root directory of this source tree.
86
86
  */const Va=(e,a)=>{const r=R.forwardRef(({className:s,...l},c)=>R.createElement(mR,{ref:c,iconNode:a,className:H0(`lucide-${uR(ny(e))}`,`lucide-${e}`,s),...l}));return r.displayName=ny(e),r};/**
87
- * @license lucide-react v0.540.0 - ISC
87
+ * @license lucide-react v0.541.0 - ISC
88
88
  *
89
89
  * This source code is licensed under the ISC license.
90
90
  * See the LICENSE file in the root directory of this source tree.
91
91
  */const pR=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],ay=Va("bell",pR);/**
92
- * @license lucide-react v0.540.0 - ISC
92
+ * @license lucide-react v0.541.0 - ISC
93
93
  *
94
94
  * This source code is licensed under the ISC license.
95
95
  * See the LICENSE file in the root directory of this source tree.
96
96
  */const gR=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],vR=Va("chevron-right",gR);/**
97
- * @license lucide-react v0.540.0 - ISC
97
+ * @license lucide-react v0.541.0 - ISC
98
98
  *
99
99
  * This source code is licensed under the ISC license.
100
100
  * See the LICENSE file in the root directory of this source tree.
101
101
  */const yR=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],bR=Va("panel-left",yR);/**
102
- * @license lucide-react v0.540.0 - ISC
102
+ * @license lucide-react v0.541.0 - ISC
103
103
  *
104
104
  * This source code is licensed under the ISC license.
105
105
  * See the LICENSE file in the root directory of this source tree.
106
106
  */const SR=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]],xR=Va("plug",SR);/**
107
- * @license lucide-react v0.540.0 - ISC
107
+ * @license lucide-react v0.541.0 - ISC
108
108
  *
109
109
  * This source code is licensed under the ISC license.
110
110
  * See the LICENSE file in the root directory of this source tree.
111
111
  */const wR=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["path",{d:"M18.944 12.33a1 1 0 0 0 0-.66 7.5 7.5 0 0 0-13.888 0 1 1 0 0 0 0 .66 7.5 7.5 0 0 0 13.888 0",key:"11ak4c"}]],ER=Va("scan-eye",wR);/**
112
- * @license lucide-react v0.540.0 - ISC
112
+ * @license lucide-react v0.541.0 - ISC
113
113
  *
114
114
  * This source code is licensed under the ISC license.
115
115
  * See the LICENSE file in the root directory of this source tree.
116
116
  */const RR=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],ry=Va("square-terminal",RR);/**
117
- * @license lucide-react v0.540.0 - ISC
117
+ * @license lucide-react v0.541.0 - ISC
118
118
  *
119
119
  * This source code is licensed under the ISC license.
120
120
  * See the LICENSE file in the root directory of this source tree.
121
121
  */const _R=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],TR=Va("wrench",_R);/**
122
- * @license lucide-react v0.540.0 - ISC
122
+ * @license lucide-react v0.541.0 - ISC
123
123
  *
124
124
  * This source code is licensed under the ISC license.
125
125
  * See the LICENSE file in the root directory of this source tree.
@@ -172,4 +172,4 @@ For more information, see https://radix-ui.com/primitives/docs/components/${a.do
172
172
  `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(a){return a instanceof this?a:new this(a)}static concat(a,...r){const s=new this(a);return r.forEach(l=>s.set(l)),s}static accessor(a){const s=(this[Yy]=this[Yy]={accessors:{}}).accessors,l=this.prototype;function c(f){const h=Vs(f);s[h]||(eM(l,f),s[h]=!0)}return Y.isArray(a)?a.forEach(c):c(a),this}};Ue.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Y.reduceDescriptors(Ue.prototype,({value:e},a)=>{let r=a[0].toUpperCase()+a.slice(1);return{get:()=>e,set(s){this[r]=s}}});Y.freezeMethods(Ue);function md(e,a){const r=this||fo,s=a||r,l=Ue.from(s.headers);let c=s.data;return Y.forEach(e,function(h){c=h.call(r,c,l.normalize(),a?a.status:void 0)}),l.normalize(),c}function B1(e){return!!(e&&e.__CANCEL__)}function Pi(e,a,r){xt.call(this,e??"canceled",xt.ERR_CANCELED,a,r),this.name="CanceledError"}Y.inherits(Pi,xt,{__CANCEL__:!0});function k1(e,a,r){const s=r.config.validateStatus;!r.status||!s||s(r.status)?e(r):a(new xt("Request failed with status code "+r.status,[xt.ERR_BAD_REQUEST,xt.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function nM(e){const a=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return a&&a[1]||""}function aM(e,a){e=e||10;const r=new Array(e),s=new Array(e);let l=0,c=0,f;return a=a!==void 0?a:1e3,function(p){const m=Date.now(),v=s[c];f||(f=m),r[l]=p,s[l]=m;let g=c,y=0;for(;g!==l;)y+=r[g++],g=g%e;if(l=(l+1)%e,l===c&&(c=(c+1)%e),m-f<a)return;const x=v&&m-v;return x?Math.round(y*1e3/x):void 0}}function rM(e,a){let r=0,s=1e3/a,l,c;const f=(m,v=Date.now())=>{r=v,l=null,c&&(clearTimeout(c),c=null),e(...m)};return[(...m)=>{const v=Date.now(),g=v-r;g>=s?f(m,v):(l=m,c||(c=setTimeout(()=>{c=null,f(l)},s-g)))},()=>l&&f(l)]}const lc=(e,a,r=3)=>{let s=0;const l=aM(50,250);return rM(c=>{const f=c.loaded,h=c.lengthComputable?c.total:void 0,p=f-s,m=l(p),v=f<=h;s=f;const g={loaded:f,total:h,progress:h?f/h:void 0,bytes:p,rate:m||void 0,estimated:m&&h&&v?(h-f)/m:void 0,event:c,lengthComputable:h!=null,[a?"download":"upload"]:!0};e(g)},r)},Fy=(e,a)=>{const r=e!=null;return[s=>a[0]({lengthComputable:r,total:e,loaded:s}),a[1]]},Qy=e=>(...a)=>Y.asap(()=>e(...a)),iM=_e.hasStandardBrowserEnv?((e,a)=>r=>(r=new URL(r,_e.origin),e.protocol===r.protocol&&e.host===r.host&&(a||e.port===r.port)))(new URL(_e.origin),_e.navigator&&/(msie|trident)/i.test(_e.navigator.userAgent)):()=>!0,sM=_e.hasStandardBrowserEnv?{write(e,a,r,s,l,c){const f=[e+"="+encodeURIComponent(a)];Y.isNumber(r)&&f.push("expires="+new Date(r).toGMTString()),Y.isString(s)&&f.push("path="+s),Y.isString(l)&&f.push("domain="+l),c===!0&&f.push("secure"),document.cookie=f.join("; ")},read(e){const a=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return a?decodeURIComponent(a[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function oM(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function lM(e,a){return a?e.replace(/\/?\/$/,"")+"/"+a.replace(/^\/+/,""):e}function H1(e,a,r){let s=!oM(a);return e&&(s||r==!1)?lM(e,a):a}const Ky=e=>e instanceof Ue?{...e}:e;function Sr(e,a){a=a||{};const r={};function s(m,v,g,y){return Y.isPlainObject(m)&&Y.isPlainObject(v)?Y.merge.call({caseless:y},m,v):Y.isPlainObject(v)?Y.merge({},v):Y.isArray(v)?v.slice():v}function l(m,v,g,y){if(Y.isUndefined(v)){if(!Y.isUndefined(m))return s(void 0,m,g,y)}else return s(m,v,g,y)}function c(m,v){if(!Y.isUndefined(v))return s(void 0,v)}function f(m,v){if(Y.isUndefined(v)){if(!Y.isUndefined(m))return s(void 0,m)}else return s(void 0,v)}function h(m,v,g){if(g in a)return s(m,v);if(g in e)return s(void 0,m)}const p={url:c,method:c,data:c,baseURL:f,transformRequest:f,transformResponse:f,paramsSerializer:f,timeout:f,timeoutMessage:f,withCredentials:f,withXSRFToken:f,adapter:f,responseType:f,xsrfCookieName:f,xsrfHeaderName:f,onUploadProgress:f,onDownloadProgress:f,decompress:f,maxContentLength:f,maxBodyLength:f,beforeRedirect:f,transport:f,httpAgent:f,httpsAgent:f,cancelToken:f,socketPath:f,responseEncoding:f,validateStatus:h,headers:(m,v,g)=>l(Ky(m),Ky(v),g,!0)};return Y.forEach(Object.keys({...e,...a}),function(v){const g=p[v]||l,y=g(e[v],a[v],v);Y.isUndefined(y)&&g!==h||(r[v]=y)}),r}const q1=e=>{const a=Sr({},e);let{data:r,withXSRFToken:s,xsrfHeaderName:l,xsrfCookieName:c,headers:f,auth:h}=a;a.headers=f=Ue.from(f),a.url=z1(H1(a.baseURL,a.url,a.allowAbsoluteUrls),e.params,e.paramsSerializer),h&&f.set("Authorization","Basic "+btoa((h.username||"")+":"+(h.password?unescape(encodeURIComponent(h.password)):"")));let p;if(Y.isFormData(r)){if(_e.hasStandardBrowserEnv||_e.hasStandardBrowserWebWorkerEnv)f.setContentType(void 0);else if((p=f.getContentType())!==!1){const[m,...v]=p?p.split(";").map(g=>g.trim()).filter(Boolean):[];f.setContentType([m||"multipart/form-data",...v].join("; "))}}if(_e.hasStandardBrowserEnv&&(s&&Y.isFunction(s)&&(s=s(a)),s||s!==!1&&iM(a.url))){const m=l&&c&&sM.read(c);m&&f.set(l,m)}return a},cM=typeof XMLHttpRequest<"u",uM=cM&&function(e){return new Promise(function(r,s){const l=q1(e);let c=l.data;const f=Ue.from(l.headers).normalize();let{responseType:h,onUploadProgress:p,onDownloadProgress:m}=l,v,g,y,x,S;function w(){x&&x(),S&&S(),l.cancelToken&&l.cancelToken.unsubscribe(v),l.signal&&l.signal.removeEventListener("abort",v)}let T=new XMLHttpRequest;T.open(l.method.toUpperCase(),l.url,!0),T.timeout=l.timeout;function C(){if(!T)return;const L=Ue.from("getAllResponseHeaders"in T&&T.getAllResponseHeaders()),N={data:!h||h==="text"||h==="json"?T.responseText:T.response,status:T.status,statusText:T.statusText,headers:L,config:e,request:T};k1(function(G){r(G),w()},function(G){s(G),w()},N),T=null}"onloadend"in T?T.onloadend=C:T.onreadystatechange=function(){!T||T.readyState!==4||T.status===0&&!(T.responseURL&&T.responseURL.indexOf("file:")===0)||setTimeout(C)},T.onabort=function(){T&&(s(new xt("Request aborted",xt.ECONNABORTED,e,T)),T=null)},T.onerror=function(){s(new xt("Network Error",xt.ERR_NETWORK,e,T)),T=null},T.ontimeout=function(){let U=l.timeout?"timeout of "+l.timeout+"ms exceeded":"timeout exceeded";const N=l.transitional||P1;l.timeoutErrorMessage&&(U=l.timeoutErrorMessage),s(new xt(U,N.clarifyTimeoutError?xt.ETIMEDOUT:xt.ECONNABORTED,e,T)),T=null},c===void 0&&f.setContentType(null),"setRequestHeader"in T&&Y.forEach(f.toJSON(),function(U,N){T.setRequestHeader(N,U)}),Y.isUndefined(l.withCredentials)||(T.withCredentials=!!l.withCredentials),h&&h!=="json"&&(T.responseType=l.responseType),m&&([y,S]=lc(m,!0),T.addEventListener("progress",y)),p&&T.upload&&([g,x]=lc(p),T.upload.addEventListener("progress",g),T.upload.addEventListener("loadend",x)),(l.cancelToken||l.signal)&&(v=L=>{T&&(s(!L||L.type?new Pi(null,e,T):L),T.abort(),T=null)},l.cancelToken&&l.cancelToken.subscribe(v),l.signal&&(l.signal.aborted?v():l.signal.addEventListener("abort",v)));const j=nM(l.url);if(j&&_e.protocols.indexOf(j)===-1){s(new xt("Unsupported protocol "+j+":",xt.ERR_BAD_REQUEST,e));return}T.send(c||null)})},fM=(e,a)=>{const{length:r}=e=e?e.filter(Boolean):[];if(a||r){let s=new AbortController,l;const c=function(m){if(!l){l=!0,h();const v=m instanceof Error?m:this.reason;s.abort(v instanceof xt?v:new Pi(v instanceof Error?v.message:v))}};let f=a&&setTimeout(()=>{f=null,c(new xt(`timeout ${a} of ms exceeded`,xt.ETIMEDOUT))},a);const h=()=>{e&&(f&&clearTimeout(f),f=null,e.forEach(m=>{m.unsubscribe?m.unsubscribe(c):m.removeEventListener("abort",c)}),e=null)};e.forEach(m=>m.addEventListener("abort",c));const{signal:p}=s;return p.unsubscribe=()=>Y.asap(h),p}},dM=function*(e,a){let r=e.byteLength;if(r<a){yield e;return}let s=0,l;for(;s<r;)l=s+a,yield e.slice(s,l),s=l},hM=async function*(e,a){for await(const r of mM(e))yield*dM(r,a)},mM=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const a=e.getReader();try{for(;;){const{done:r,value:s}=await a.read();if(r)break;yield s}}finally{await a.cancel()}},Xy=(e,a,r,s)=>{const l=hM(e,a);let c=0,f,h=p=>{f||(f=!0,s&&s(p))};return new ReadableStream({async pull(p){try{const{done:m,value:v}=await l.next();if(m){h(),p.close();return}let g=v.byteLength;if(r){let y=c+=g;r(y)}p.enqueue(new Uint8Array(v))}catch(m){throw h(m),m}},cancel(p){return h(p),l.return()}},{highWaterMark:2})},Ac=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",V1=Ac&&typeof ReadableStream=="function",pM=Ac&&(typeof TextEncoder=="function"?(e=>a=>e.encode(a))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),G1=(e,...a)=>{try{return!!e(...a)}catch{return!1}},gM=V1&&G1(()=>{let e=!1;const a=new Request(_e.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!a}),$y=64*1024,kd=V1&&G1(()=>Y.isReadableStream(new Response("").body)),cc={stream:kd&&(e=>e.body)};Ac&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(a=>{!cc[a]&&(cc[a]=Y.isFunction(e[a])?r=>r[a]():(r,s)=>{throw new xt(`Response type '${a}' is not supported`,xt.ERR_NOT_SUPPORT,s)})})})(new Response);const vM=async e=>{if(e==null)return 0;if(Y.isBlob(e))return e.size;if(Y.isSpecCompliantForm(e))return(await new Request(_e.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(Y.isArrayBufferView(e)||Y.isArrayBuffer(e))return e.byteLength;if(Y.isURLSearchParams(e)&&(e=e+""),Y.isString(e))return(await pM(e)).byteLength},yM=async(e,a)=>{const r=Y.toFiniteNumber(e.getContentLength());return r??vM(a)},bM=Ac&&(async e=>{let{url:a,method:r,data:s,signal:l,cancelToken:c,timeout:f,onDownloadProgress:h,onUploadProgress:p,responseType:m,headers:v,withCredentials:g="same-origin",fetchOptions:y}=q1(e);m=m?(m+"").toLowerCase():"text";let x=fM([l,c&&c.toAbortSignal()],f),S;const w=x&&x.unsubscribe&&(()=>{x.unsubscribe()});let T;try{if(p&&gM&&r!=="get"&&r!=="head"&&(T=await yM(v,s))!==0){let N=new Request(a,{method:"POST",body:s,duplex:"half"}),F;if(Y.isFormData(s)&&(F=N.headers.get("content-type"))&&v.setContentType(F),N.body){const[G,q]=Fy(T,lc(Qy(p)));s=Xy(N.body,$y,G,q)}}Y.isString(g)||(g=g?"include":"omit");const C="credentials"in Request.prototype;S=new Request(a,{...y,signal:x,method:r.toUpperCase(),headers:v.normalize().toJSON(),body:s,duplex:"half",credentials:C?g:void 0});let j=await fetch(S,y);const L=kd&&(m==="stream"||m==="response");if(kd&&(h||L&&w)){const N={};["status","statusText","headers"].forEach(et=>{N[et]=j[et]});const F=Y.toFiniteNumber(j.headers.get("content-length")),[G,q]=h&&Fy(F,lc(Qy(h),!0))||[];j=new Response(Xy(j.body,$y,G,()=>{q&&q(),w&&w()}),N)}m=m||"text";let U=await cc[Y.findKey(cc,m)||"text"](j,e);return!L&&w&&w(),await new Promise((N,F)=>{k1(N,F,{data:U,headers:Ue.from(j.headers),status:j.status,statusText:j.statusText,config:e,request:S})})}catch(C){throw w&&w(),C&&C.name==="TypeError"&&/Load failed|fetch/i.test(C.message)?Object.assign(new xt("Network Error",xt.ERR_NETWORK,e,S),{cause:C.cause||C}):xt.from(C,C&&C.code,e,S)}}),Hd={http:jO,xhr:uM,fetch:bM};Y.forEach(Hd,(e,a)=>{if(e){try{Object.defineProperty(e,"name",{value:a})}catch{}Object.defineProperty(e,"adapterName",{value:a})}});const Zy=e=>`- ${e}`,SM=e=>Y.isFunction(e)||e===null||e===!1,Y1={getAdapter:e=>{e=Y.isArray(e)?e:[e];const{length:a}=e;let r,s;const l={};for(let c=0;c<a;c++){r=e[c];let f;if(s=r,!SM(r)&&(s=Hd[(f=String(r)).toLowerCase()],s===void 0))throw new xt(`Unknown adapter '${f}'`);if(s)break;l[f||"#"+c]=s}if(!s){const c=Object.entries(l).map(([h,p])=>`adapter ${h} `+(p===!1?"is not supported by the environment":"is not available in the build"));let f=a?c.length>1?`since :
173
173
  `+c.map(Zy).join(`
174
174
  `):" "+Zy(c[0]):"as no adapter specified";throw new xt("There is no suitable adapter to dispatch the request "+f,"ERR_NOT_SUPPORT")}return s},adapters:Hd};function pd(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Pi(null,e)}function Iy(e){return pd(e),e.headers=Ue.from(e.headers),e.data=md.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Y1.getAdapter(e.adapter||fo.adapter)(e).then(function(s){return pd(e),s.data=md.call(e,e.transformResponse,s),s.headers=Ue.from(s.headers),s},function(s){return B1(s)||(pd(e),s&&s.response&&(s.response.data=md.call(e,e.transformResponse,s.response),s.response.headers=Ue.from(s.response.headers))),Promise.reject(s)})}const F1="1.11.0",Oc={};["object","boolean","number","function","string","symbol"].forEach((e,a)=>{Oc[e]=function(s){return typeof s===e||"a"+(a<1?"n ":" ")+e}});const Wy={};Oc.transitional=function(a,r,s){function l(c,f){return"[Axios v"+F1+"] Transitional option '"+c+"'"+f+(s?". "+s:"")}return(c,f,h)=>{if(a===!1)throw new xt(l(f," has been removed"+(r?" in "+r:"")),xt.ERR_DEPRECATED);return r&&!Wy[f]&&(Wy[f]=!0,console.warn(l(f," has been deprecated since v"+r+" and will be removed in the near future"))),a?a(c,f,h):!0}};Oc.spelling=function(a){return(r,s)=>(console.warn(`${s} is likely a misspelling of ${a}`),!0)};function xM(e,a,r){if(typeof e!="object")throw new xt("options must be an object",xt.ERR_BAD_OPTION_VALUE);const s=Object.keys(e);let l=s.length;for(;l-- >0;){const c=s[l],f=a[c];if(f){const h=e[c],p=h===void 0||f(h,c,e);if(p!==!0)throw new xt("option "+c+" must be "+p,xt.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new xt("Unknown option "+c,xt.ERR_BAD_OPTION)}}const Xl={assertOptions:xM,validators:Oc},On=Xl.validators;let mr=class{constructor(a){this.defaults=a||{},this.interceptors={request:new Gy,response:new Gy}}async request(a,r){try{return await this._request(a,r)}catch(s){if(s instanceof Error){let l={};Error.captureStackTrace?Error.captureStackTrace(l):l=new Error;const c=l.stack?l.stack.replace(/^.+\n/,""):"";try{s.stack?c&&!String(s.stack).endsWith(c.replace(/^.+\n.+\n/,""))&&(s.stack+=`
175
- `+c):s.stack=c}catch{}}throw s}}_request(a,r){typeof a=="string"?(r=r||{},r.url=a):r=a||{},r=Sr(this.defaults,r);const{transitional:s,paramsSerializer:l,headers:c}=r;s!==void 0&&Xl.assertOptions(s,{silentJSONParsing:On.transitional(On.boolean),forcedJSONParsing:On.transitional(On.boolean),clarifyTimeoutError:On.transitional(On.boolean)},!1),l!=null&&(Y.isFunction(l)?r.paramsSerializer={serialize:l}:Xl.assertOptions(l,{encode:On.function,serialize:On.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Xl.assertOptions(r,{baseUrl:On.spelling("baseURL"),withXsrfToken:On.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let f=c&&Y.merge(c.common,c[r.method]);c&&Y.forEach(["delete","get","head","post","put","patch","common"],S=>{delete c[S]}),r.headers=Ue.concat(f,c);const h=[];let p=!0;this.interceptors.request.forEach(function(w){typeof w.runWhen=="function"&&w.runWhen(r)===!1||(p=p&&w.synchronous,h.unshift(w.fulfilled,w.rejected))});const m=[];this.interceptors.response.forEach(function(w){m.push(w.fulfilled,w.rejected)});let v,g=0,y;if(!p){const S=[Iy.bind(this),void 0];for(S.unshift(...h),S.push(...m),y=S.length,v=Promise.resolve(r);g<y;)v=v.then(S[g++],S[g++]);return v}y=h.length;let x=r;for(g=0;g<y;){const S=h[g++],w=h[g++];try{x=S(x)}catch(T){w.call(this,T);break}}try{v=Iy.call(this,x)}catch(S){return Promise.reject(S)}for(g=0,y=m.length;g<y;)v=v.then(m[g++],m[g++]);return v}getUri(a){a=Sr(this.defaults,a);const r=H1(a.baseURL,a.url,a.allowAbsoluteUrls);return z1(r,a.params,a.paramsSerializer)}};Y.forEach(["delete","get","head","options"],function(a){mr.prototype[a]=function(r,s){return this.request(Sr(s||{},{method:a,url:r,data:(s||{}).data}))}});Y.forEach(["post","put","patch"],function(a){function r(s){return function(c,f,h){return this.request(Sr(h||{},{method:a,headers:s?{"Content-Type":"multipart/form-data"}:{},url:c,data:f}))}}mr.prototype[a]=r(),mr.prototype[a+"Form"]=r(!0)});let wM=class Q1{constructor(a){if(typeof a!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(c){r=c});const s=this;this.promise.then(l=>{if(!s._listeners)return;let c=s._listeners.length;for(;c-- >0;)s._listeners[c](l);s._listeners=null}),this.promise.then=l=>{let c;const f=new Promise(h=>{s.subscribe(h),c=h}).then(l);return f.cancel=function(){s.unsubscribe(c)},f},a(function(c,f,h){s.reason||(s.reason=new Pi(c,f,h),r(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(a){if(this.reason){a(this.reason);return}this._listeners?this._listeners.push(a):this._listeners=[a]}unsubscribe(a){if(!this._listeners)return;const r=this._listeners.indexOf(a);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const a=new AbortController,r=s=>{a.abort(s)};return this.subscribe(r),a.signal.unsubscribe=()=>this.unsubscribe(r),a.signal}static source(){let a;return{token:new Q1(function(l){a=l}),cancel:a}}};function EM(e){return function(r){return e.apply(null,r)}}function RM(e){return Y.isObject(e)&&e.isAxiosError===!0}const qd={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(qd).forEach(([e,a])=>{qd[a]=e});function K1(e){const a=new mr(e),r=E1(mr.prototype.request,a);return Y.extend(r,mr.prototype,a,{allOwnKeys:!0}),Y.extend(r,a,null,{allOwnKeys:!0}),r.create=function(l){return K1(Sr(e,l))},r}const te=K1(fo);te.Axios=mr;te.CanceledError=Pi;te.CancelToken=wM;te.isCancel=B1;te.VERSION=F1;te.toFormData=Cc;te.AxiosError=xt;te.Cancel=te.CanceledError;te.all=function(a){return Promise.all(a)};te.spread=EM;te.isAxiosError=RM;te.mergeConfig=Sr;te.AxiosHeaders=Ue;te.formToJSON=e=>U1(Y.isHTMLForm(e)?new FormData(e):e);te.getAdapter=Y1.getAdapter;te.HttpStatusCode=qd;te.default=te;const{Axios:Q3,AxiosError:K3,CanceledError:X3,isCancel:$3,CancelToken:Z3,VERSION:I3,all:W3,Cancel:J3,isAxiosError:tD,spread:eD,toFormData:nD,AxiosHeaders:aD,HttpStatusCode:rD,formToJSON:iD,getAdapter:sD,mergeConfig:oD}=te,Lh=te.create({baseURL:"/api"});Lh.interceptors.request.use(e=>{const a=localStorage.getItem("access_token");return a&&(e.headers.Authorization=`Bearer ${a}`),e});Lh.interceptors.response.use(e=>e,e=>(e.response.status===401&&(localStorage.removeItem("access_token"),window.location.href="/"),Promise.reject(e)));class Jy{constructor(a,r){this.client=a,this.data=r}}class _M{constructor(a){this.client=a}async fetch(){const{data:a}=await this.client.api.get("/events");return a.events}}class TM{constructor(a){this.client=a}async fetch(){const{data:a}=await this.client.api.get("/guilds");return a.guilds}}class CM{constructor(a){this.client=a}async fetch(){const{data:a}=await this.client.api.get("/plugins");return a.plugins}}class AM{api=Lh;guilds=new TM(this);plugins=new CM(this);events=new _M(this);_user=null;get user(){return this._user}isReady(){return this._user!==null}logout(){localStorage.removeItem("access_token"),this._user=null}async fetchMe(a=!1){if(this._user&&!a)return this._user;const{data:r}=await this.api.get("/auth/@me");return this._user=new Jy(this,r),this._user}async getFeatureFlags(){const{data:a}=await this.api.get("/feature-flags");return a}async login(a,r){const{data:s}=await this.api.post("/auth/login",{username:a,password:r});return s.accessToken&&localStorage.setItem("access_token",s.accessToken),this._user=new Jy(this,s.user),s}}const X1=R.createContext(null);function OM({children:e}){const[a,r]=R.useState(()=>new AM);return _.jsx(X1.Provider,{value:{client:a,setClient:r},children:e})}function jh(){const e=R.use(X1);if(!e)throw new Error("useClient must be used within a ClientProvider");return e.client}const gd={navMain:[{title:"Commands",url:"/commands",icon:ry,isActive:!1},{title:"Events",url:"/events",icon:ay,isActive:!1},{title:"Plugins",url:"/plugins",icon:xR,isActive:!1},{title:"Guilds",url:"/guilds",icon:oy,isActive:!1},{title:"Feature Flags",url:"/feature-flags",icon:ER,isActive:!1}],navSecondary:[{title:"GitHub",url:"https://github.com/underctrl-io/commandkit",icon:PR},{title:"Discord",url:"https://ctrl.lol/discord",icon:oy}],projects:[{name:"Commands",url:"#",icon:ry},{name:"Middlewares",url:"#",icon:TR},{name:"Events",url:"#",icon:ay}]};function MM({...e}){const a=jh();return _.jsxs(RA,{className:"top-(--header-height) h-[calc(100svh-var(--header-height))]!",...e,children:[_.jsx(TA,{children:_.jsx(io,{children:_.jsx(so,{children:_.jsx(oo,{size:"lg",asChild:!0,children:_.jsxs(Oi,{to:"/",children:[_.jsx("div",{className:"border-sidebar-primary border text-sidebar-primary-foreground flex aspect-square size-8 items-center justify-center rounded-lg",children:_.jsx("img",{src:"/logo.webp",alt:"Logo",className:"size-6"})}),_.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[_.jsx("span",{className:"truncate font-medium",children:"CommandKit"}),_.jsx("span",{className:"truncate text-xs",children:"DevTools"})]})]})})})})}),_.jsxs(AA,{children:[_.jsx(DA,{items:gd.navMain}),_.jsx(NA,{projects:gd.projects}),_.jsx(LA,{items:gd.navSecondary,className:"mt-auto"})]}),_.jsx(CA,{children:_.jsx(XA,{user:{avatar:a.user.data.displayAvatarURL,name:a.user.data.globalName||a.user?.data.username,username:a.user.data.username}})})]})}function DM({className:e,...a}){return _.jsx("div",{"data-slot":"card",className:Et("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...a})}function NM({className:e,...a}){return _.jsx("div",{"data-slot":"card-header",className:Et("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...a})}function LM({className:e,...a}){return _.jsx("div",{"data-slot":"card-title",className:Et("leading-none font-semibold",e),...a})}function jM({className:e,...a}){return _.jsx("div",{"data-slot":"card-description",className:Et("text-muted-foreground text-sm",e),...a})}function zM({className:e,...a}){return _.jsx("div",{"data-slot":"card-content",className:Et("px-6",e),...a})}function lD({className:e,...a}){return _.jsx("div",{"data-slot":"card-footer",className:Et("flex items-center px-6 [.border-t]:pt-6",e),...a})}var PM="Label",$1=R.forwardRef((e,a)=>_.jsx(Xt.label,{...e,ref:a,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(e.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));$1.displayName=PM;var UM=$1;function t0({className:e,...a}){return _.jsx(UM,{"data-slot":"label",className:Et("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...a})}const e0=e=>{let a;const r=new Set,s=(m,v)=>{const g=typeof m=="function"?m(a):m;if(!Object.is(g,a)){const y=a;a=v??(typeof g!="object"||g===null)?g:Object.assign({},a,g),r.forEach(x=>x(a,y))}},l=()=>a,h={setState:s,getState:l,getInitialState:()=>p,subscribe:m=>(r.add(m),()=>r.delete(m))},p=a=e(s,l,h);return h},BM=(e=>e?e0(e):e0),kM=e=>e;function HM(e,a=kM){const r=J.useSyncExternalStore(e.subscribe,J.useCallback(()=>a(e.getState()),[e,a]),J.useCallback(()=>a(e.getInitialState()),[e,a]));return J.useDebugValue(r),r}const n0=e=>{const a=BM(e),r=s=>HM(a,s);return Object.assign(r,a),r},qM=(e=>e?n0(e):n0),Z1=qM(e=>({authenticated:!1,setAuthenticated:a=>e({authenticated:a})}));function VM(e){if(typeof document>"u")return;let a=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",a.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}const GM=e=>{switch(e){case"success":return QM;case"info":return XM;case"warning":return KM;case"error":return $M;default:return null}},YM=Array(12).fill(0),FM=({visible:e,className:a})=>J.createElement("div",{className:["sonner-loading-wrapper",a].filter(Boolean).join(" "),"data-visible":e},J.createElement("div",{className:"sonner-spinner"},YM.map((r,s)=>J.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),QM=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},J.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),KM=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},J.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),XM=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},J.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),$M=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},J.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),ZM=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},J.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),J.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),IM=()=>{const[e,a]=J.useState(document.hidden);return J.useEffect(()=>{const r=()=>{a(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e};let Vd=1;class WM{constructor(){this.subscribe=a=>(this.subscribers.push(a),()=>{const r=this.subscribers.indexOf(a);this.subscribers.splice(r,1)}),this.publish=a=>{this.subscribers.forEach(r=>r(a))},this.addToast=a=>{this.publish(a),this.toasts=[...this.toasts,a]},this.create=a=>{var r;const{message:s,...l}=a,c=typeof a?.id=="number"||((r=a.id)==null?void 0:r.length)>0?a.id:Vd++,f=this.toasts.find(p=>p.id===c),h=a.dismissible===void 0?!0:a.dismissible;return this.dismissedToasts.has(c)&&this.dismissedToasts.delete(c),f?this.toasts=this.toasts.map(p=>p.id===c?(this.publish({...p,...a,id:c,title:s}),{...p,...a,id:c,dismissible:h,title:s}):p):this.addToast({title:s,...l,dismissible:h,id:c}),c},this.dismiss=a=>(a?(this.dismissedToasts.add(a),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:a,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(s=>s({id:r.id,dismiss:!0}))}),a),this.message=(a,r)=>this.create({...r,message:a}),this.error=(a,r)=>this.create({...r,message:a,type:"error"}),this.success=(a,r)=>this.create({...r,type:"success",message:a}),this.info=(a,r)=>this.create({...r,type:"info",message:a}),this.warning=(a,r)=>this.create({...r,type:"warning",message:a}),this.loading=(a,r)=>this.create({...r,type:"loading",message:a}),this.promise=(a,r)=>{if(!r)return;let s;r.loading!==void 0&&(s=this.create({...r,promise:a,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const l=Promise.resolve(a instanceof Function?a():a);let c=s!==void 0,f;const h=l.then(async m=>{if(f=["resolve",m],J.isValidElement(m))c=!1,this.create({id:s,type:"default",message:m});else if(t4(m)&&!m.ok){c=!1;const g=typeof r.error=="function"?await r.error(`HTTP error! status: ${m.status}`):r.error,y=typeof r.description=="function"?await r.description(`HTTP error! status: ${m.status}`):r.description,S=typeof g=="object"&&!J.isValidElement(g)?g:{message:g};this.create({id:s,type:"error",description:y,...S})}else if(m instanceof Error){c=!1;const g=typeof r.error=="function"?await r.error(m):r.error,y=typeof r.description=="function"?await r.description(m):r.description,S=typeof g=="object"&&!J.isValidElement(g)?g:{message:g};this.create({id:s,type:"error",description:y,...S})}else if(r.success!==void 0){c=!1;const g=typeof r.success=="function"?await r.success(m):r.success,y=typeof r.description=="function"?await r.description(m):r.description,S=typeof g=="object"&&!J.isValidElement(g)?g:{message:g};this.create({id:s,type:"success",description:y,...S})}}).catch(async m=>{if(f=["reject",m],r.error!==void 0){c=!1;const v=typeof r.error=="function"?await r.error(m):r.error,g=typeof r.description=="function"?await r.description(m):r.description,x=typeof v=="object"&&!J.isValidElement(v)?v:{message:v};this.create({id:s,type:"error",description:g,...x})}}).finally(()=>{c&&(this.dismiss(s),s=void 0),r.finally==null||r.finally.call(r)}),p=()=>new Promise((m,v)=>h.then(()=>f[0]==="reject"?v(f[1]):m(f[1])).catch(v));return typeof s!="string"&&typeof s!="number"?{unwrap:p}:Object.assign(s,{unwrap:p})},this.custom=(a,r)=>{const s=r?.id||Vd++;return this.create({jsx:a(s),id:s,...r}),s},this.getActiveToasts=()=>this.toasts.filter(a=>!this.dismissedToasts.has(a.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const je=new WM,JM=(e,a)=>{const r=a?.id||Vd++;return je.addToast({title:e,...a,id:r}),r},t4=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",e4=JM,n4=()=>je.toasts,a4=()=>je.getActiveToasts(),a0=Object.assign(e4,{success:je.success,info:je.info,warning:je.warning,error:je.error,custom:je.custom,message:je.message,promise:je.promise,dismiss:je.dismiss,loading:je.loading},{getHistory:n4,getToasts:a4});VM("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function kl(e){return e.label!==void 0}const r4=3,i4="24px",s4="16px",r0=4e3,o4=356,l4=14,c4=45,u4=200;function Mn(...e){return e.filter(Boolean).join(" ")}function f4(e){const[a,r]=e.split("-"),s=[];return a&&s.push(a),r&&s.push(r),s}const d4=e=>{var a,r,s,l,c,f,h,p,m;const{invert:v,toast:g,unstyled:y,interacting:x,setHeights:S,visibleToasts:w,heights:T,index:C,toasts:j,expanded:L,removeToast:U,defaultRichColors:N,closeButton:F,style:G,cancelButtonStyle:q,actionButtonStyle:et,className:W="",descriptionClassName:at="",duration:st,position:mt,gap:ht,expandByDefault:yt,classNames:D,icons:K,closeButtonAriaLabel:V="Close toast"}=e,[ft,O]=J.useState(null),[$,nt]=J.useState(null),[Q,tt]=J.useState(!1),[it,rt]=J.useState(!1),[vt,ut]=J.useState(!1),[kt,re]=J.useState(!1),[Yt,ie]=J.useState(!1),[Ke,xn]=J.useState(0),[ki,_r]=J.useState(0),fe=J.useRef(g.duration||st||r0),Bn=J.useRef(null),ve=J.useRef(null),Ga=C===0,kn=C+1<=w,Rt=g.type,Vt=g.dismissible!==!1,Xe=g.className||"",ho=g.descriptionClassName||"",wn=J.useMemo(()=>T.findIndex(St=>St.toastId===g.id)||0,[T,g.id]),Te=J.useMemo(()=>{var St;return(St=g.closeButton)!=null?St:F},[g.closeButton,F]),dn=J.useMemo(()=>g.duration||st||r0,[g.duration,st]),ye=J.useRef(0),la=J.useRef(0),mo=J.useRef(0),ca=J.useRef(null),[Tr,Cr]=mt.split("-"),En=J.useMemo(()=>T.reduce((St,$t,ee)=>ee>=wn?St:St+$t.height,0),[T,wn]),Ya=IM(),Fa=g.invert||v,Hi=Rt==="loading";la.current=J.useMemo(()=>wn*ht+En,[wn,En]),J.useEffect(()=>{fe.current=dn},[dn]),J.useEffect(()=>{tt(!0)},[]),J.useEffect(()=>{const St=ve.current;if(St){const $t=St.getBoundingClientRect().height;return _r($t),S(ee=>[{toastId:g.id,height:$t,position:g.position},...ee]),()=>S(ee=>ee.filter(be=>be.toastId!==g.id))}},[S,g.id]),J.useLayoutEffect(()=>{if(!Q)return;const St=ve.current,$t=St.style.height;St.style.height="auto";const ee=St.getBoundingClientRect().height;St.style.height=$t,_r(ee),S(be=>be.find(se=>se.toastId===g.id)?be.map(se=>se.toastId===g.id?{...se,height:ee}:se):[{toastId:g.id,height:ee,position:g.position},...be])},[Q,g.title,g.description,S,g.id,g.jsx,g.action,g.cancel]);const hn=J.useCallback(()=>{rt(!0),xn(la.current),S(St=>St.filter($t=>$t.toastId!==g.id)),setTimeout(()=>{U(g)},u4)},[g,U,S,la]);J.useEffect(()=>{if(g.promise&&Rt==="loading"||g.duration===1/0||g.type==="loading")return;let St;return L||x||Ya?(()=>{if(mo.current<ye.current){const be=new Date().getTime()-ye.current;fe.current=fe.current-be}mo.current=new Date().getTime()})():(()=>{fe.current!==1/0&&(ye.current=new Date().getTime(),St=setTimeout(()=>{g.onAutoClose==null||g.onAutoClose.call(g,g),hn()},fe.current))})(),()=>clearTimeout(St)},[L,x,g,Rt,Ya,hn]),J.useEffect(()=>{g.delete&&(hn(),g.onDismiss==null||g.onDismiss.call(g,g))},[hn,g.delete]);function po(){var St;if(K?.loading){var $t;return J.createElement("div",{className:Mn(D?.loader,g==null||($t=g.classNames)==null?void 0:$t.loader,"sonner-loader"),"data-visible":Rt==="loading"},K.loading)}return J.createElement(FM,{className:Mn(D?.loader,g==null||(St=g.classNames)==null?void 0:St.loader),visible:Rt==="loading"})}const qi=g.icon||K?.[Rt]||GM(Rt);var ua,go;return J.createElement("li",{tabIndex:0,ref:ve,className:Mn(W,Xe,D?.toast,g==null||(a=g.classNames)==null?void 0:a.toast,D?.default,D?.[Rt],g==null||(r=g.classNames)==null?void 0:r[Rt]),"data-sonner-toast":"","data-rich-colors":(ua=g.richColors)!=null?ua:N,"data-styled":!(g.jsx||g.unstyled||y),"data-mounted":Q,"data-promise":!!g.promise,"data-swiped":Yt,"data-removed":it,"data-visible":kn,"data-y-position":Tr,"data-x-position":Cr,"data-index":C,"data-front":Ga,"data-swiping":vt,"data-dismissible":Vt,"data-type":Rt,"data-invert":Fa,"data-swipe-out":kt,"data-swipe-direction":$,"data-expanded":!!(L||yt&&Q),"data-testid":g.testId,style:{"--index":C,"--toasts-before":C,"--z-index":j.length-C,"--offset":`${it?Ke:la.current}px`,"--initial-height":yt?"auto":`${ki}px`,...G,...g.style},onDragEnd:()=>{ut(!1),O(null),ca.current=null},onPointerDown:St=>{St.button!==2&&(Hi||!Vt||(Bn.current=new Date,xn(la.current),St.target.setPointerCapture(St.pointerId),St.target.tagName!=="BUTTON"&&(ut(!0),ca.current={x:St.clientX,y:St.clientY})))},onPointerUp:()=>{var St,$t,ee;if(kt||!Vt)return;ca.current=null;const be=Number(((St=ve.current)==null?void 0:St.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Qa=Number((($t=ve.current)==null?void 0:$t.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),se=new Date().getTime()-((ee=Bn.current)==null?void 0:ee.getTime()),Zt=ft==="x"?be:Qa,It=Math.abs(Zt)/se;if(Math.abs(Zt)>=c4||It>.11){xn(la.current),g.onDismiss==null||g.onDismiss.call(g,g),nt(ft==="x"?be>0?"right":"left":Qa>0?"down":"up"),hn(),re(!0);return}else{var Ht,de;(Ht=ve.current)==null||Ht.style.setProperty("--swipe-amount-x","0px"),(de=ve.current)==null||de.style.setProperty("--swipe-amount-y","0px")}ie(!1),ut(!1),O(null)},onPointerMove:St=>{var $t,ee,be;if(!ca.current||!Vt||(($t=window.getSelection())==null?void 0:$t.toString().length)>0)return;const se=St.clientY-ca.current.y,Zt=St.clientX-ca.current.x;var It;const Ht=(It=e.swipeDirections)!=null?It:f4(mt);!ft&&(Math.abs(Zt)>1||Math.abs(se)>1)&&O(Math.abs(Zt)>Math.abs(se)?"x":"y");let de={x:0,y:0};const Ar=Hn=>1/(1.5+Math.abs(Hn)/20);if(ft==="y"){if(Ht.includes("top")||Ht.includes("bottom"))if(Ht.includes("top")&&se<0||Ht.includes("bottom")&&se>0)de.y=se;else{const Hn=se*Ar(se);de.y=Math.abs(Hn)<Math.abs(se)?Hn:se}}else if(ft==="x"&&(Ht.includes("left")||Ht.includes("right")))if(Ht.includes("left")&&Zt<0||Ht.includes("right")&&Zt>0)de.x=Zt;else{const Hn=Zt*Ar(Zt);de.x=Math.abs(Hn)<Math.abs(Zt)?Hn:Zt}(Math.abs(de.x)>0||Math.abs(de.y)>0)&&ie(!0),(ee=ve.current)==null||ee.style.setProperty("--swipe-amount-x",`${de.x}px`),(be=ve.current)==null||be.style.setProperty("--swipe-amount-y",`${de.y}px`)}},Te&&!g.jsx&&Rt!=="loading"?J.createElement("button",{"aria-label":V,"data-disabled":Hi,"data-close-button":!0,onClick:Hi||!Vt?()=>{}:()=>{hn(),g.onDismiss==null||g.onDismiss.call(g,g)},className:Mn(D?.closeButton,g==null||(s=g.classNames)==null?void 0:s.closeButton)},(go=K?.close)!=null?go:ZM):null,(Rt||g.icon||g.promise)&&g.icon!==null&&(K?.[Rt]!==null||g.icon)?J.createElement("div",{"data-icon":"",className:Mn(D?.icon,g==null||(l=g.classNames)==null?void 0:l.icon)},g.promise||g.type==="loading"&&!g.icon?g.icon||po():null,g.type!=="loading"?qi:null):null,J.createElement("div",{"data-content":"",className:Mn(D?.content,g==null||(c=g.classNames)==null?void 0:c.content)},J.createElement("div",{"data-title":"",className:Mn(D?.title,g==null||(f=g.classNames)==null?void 0:f.title)},g.jsx?g.jsx:typeof g.title=="function"?g.title():g.title),g.description?J.createElement("div",{"data-description":"",className:Mn(at,ho,D?.description,g==null||(h=g.classNames)==null?void 0:h.description)},typeof g.description=="function"?g.description():g.description):null),J.isValidElement(g.cancel)?g.cancel:g.cancel&&kl(g.cancel)?J.createElement("button",{"data-button":!0,"data-cancel":!0,style:g.cancelButtonStyle||q,onClick:St=>{kl(g.cancel)&&Vt&&(g.cancel.onClick==null||g.cancel.onClick.call(g.cancel,St),hn())},className:Mn(D?.cancelButton,g==null||(p=g.classNames)==null?void 0:p.cancelButton)},g.cancel.label):null,J.isValidElement(g.action)?g.action:g.action&&kl(g.action)?J.createElement("button",{"data-button":!0,"data-action":!0,style:g.actionButtonStyle||et,onClick:St=>{kl(g.action)&&(g.action.onClick==null||g.action.onClick.call(g.action,St),!St.defaultPrevented&&hn())},className:Mn(D?.actionButton,g==null||(m=g.classNames)==null?void 0:m.actionButton)},g.action.label):null)};function i0(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function h4(e,a){const r={};return[e,a].forEach((s,l)=>{const c=l===1,f=c?"--mobile-offset":"--offset",h=c?s4:i4;function p(m){["top","right","bottom","left"].forEach(v=>{r[`${f}-${v}`]=typeof m=="number"?`${m}px`:m})}typeof s=="number"||typeof s=="string"?p(s):typeof s=="object"?["top","right","bottom","left"].forEach(m=>{s[m]===void 0?r[`${f}-${m}`]=h:r[`${f}-${m}`]=typeof s[m]=="number"?`${s[m]}px`:s[m]}):p(h)}),r}const m4=J.forwardRef(function(a,r){const{id:s,invert:l,position:c="bottom-right",hotkey:f=["altKey","KeyT"],expand:h,closeButton:p,className:m,offset:v,mobileOffset:g,theme:y="light",richColors:x,duration:S,style:w,visibleToasts:T=r4,toastOptions:C,dir:j=i0(),gap:L=l4,icons:U,containerAriaLabel:N="Notifications"}=a,[F,G]=J.useState([]),q=J.useMemo(()=>s?F.filter(Q=>Q.toasterId===s):F.filter(Q=>!Q.toasterId),[F,s]),et=J.useMemo(()=>Array.from(new Set([c].concat(q.filter(Q=>Q.position).map(Q=>Q.position)))),[q,c]),[W,at]=J.useState([]),[st,mt]=J.useState(!1),[ht,yt]=J.useState(!1),[D,K]=J.useState(y!=="system"?y:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),V=J.useRef(null),ft=f.join("+").replace(/Key/g,"").replace(/Digit/g,""),O=J.useRef(null),$=J.useRef(!1),nt=J.useCallback(Q=>{G(tt=>{var it;return(it=tt.find(rt=>rt.id===Q.id))!=null&&it.delete||je.dismiss(Q.id),tt.filter(({id:rt})=>rt!==Q.id)})},[]);return J.useEffect(()=>je.subscribe(Q=>{if(Q.dismiss){requestAnimationFrame(()=>{G(tt=>tt.map(it=>it.id===Q.id?{...it,delete:!0}:it))});return}setTimeout(()=>{P0.flushSync(()=>{G(tt=>{const it=tt.findIndex(rt=>rt.id===Q.id);return it!==-1?[...tt.slice(0,it),{...tt[it],...Q},...tt.slice(it+1)]:[Q,...tt]})})})}),[F]),J.useEffect(()=>{if(y!=="system"){K(y);return}if(y==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?K("dark"):K("light")),typeof window>"u")return;const Q=window.matchMedia("(prefers-color-scheme: dark)");try{Q.addEventListener("change",({matches:tt})=>{K(tt?"dark":"light")})}catch{Q.addListener(({matches:it})=>{try{K(it?"dark":"light")}catch(rt){console.error(rt)}})}},[y]),J.useEffect(()=>{F.length<=1&&mt(!1)},[F]),J.useEffect(()=>{const Q=tt=>{var it;if(f.every(ut=>tt[ut]||tt.code===ut)){var vt;mt(!0),(vt=V.current)==null||vt.focus()}tt.code==="Escape"&&(document.activeElement===V.current||(it=V.current)!=null&&it.contains(document.activeElement))&&mt(!1)};return document.addEventListener("keydown",Q),()=>document.removeEventListener("keydown",Q)},[f]),J.useEffect(()=>{if(V.current)return()=>{O.current&&(O.current.focus({preventScroll:!0}),O.current=null,$.current=!1)}},[V.current]),J.createElement("section",{ref:r,"aria-label":`${N} ${ft}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},et.map((Q,tt)=>{var it;const[rt,vt]=Q.split("-");return q.length?J.createElement("ol",{key:Q,dir:j==="auto"?i0():j,tabIndex:-1,ref:V,className:m,"data-sonner-toaster":!0,"data-sonner-theme":D,"data-y-position":rt,"data-x-position":vt,style:{"--front-toast-height":`${((it=W[0])==null?void 0:it.height)||0}px`,"--width":`${o4}px`,"--gap":`${L}px`,...w,...h4(v,g)},onBlur:ut=>{$.current&&!ut.currentTarget.contains(ut.relatedTarget)&&($.current=!1,O.current&&(O.current.focus({preventScroll:!0}),O.current=null))},onFocus:ut=>{ut.target instanceof HTMLElement&&ut.target.dataset.dismissible==="false"||$.current||($.current=!0,O.current=ut.relatedTarget)},onMouseEnter:()=>mt(!0),onMouseMove:()=>mt(!0),onMouseLeave:()=>{ht||mt(!1)},onDragEnd:()=>mt(!1),onPointerDown:ut=>{ut.target instanceof HTMLElement&&ut.target.dataset.dismissible==="false"||yt(!0)},onPointerUp:()=>yt(!1)},q.filter(ut=>!ut.position&&tt===0||ut.position===Q).map((ut,kt)=>{var re,Yt;return J.createElement(d4,{key:ut.id,icons:U,index:kt,toast:ut,defaultRichColors:x,duration:(re=C?.duration)!=null?re:S,className:C?.className,descriptionClassName:C?.descriptionClassName,invert:l,visibleToasts:T,closeButton:(Yt=C?.closeButton)!=null?Yt:p,interacting:ht,position:Q,style:C?.style,unstyled:C?.unstyled,classNames:C?.classNames,cancelButtonStyle:C?.cancelButtonStyle,actionButtonStyle:C?.actionButtonStyle,closeButtonAriaLabel:C?.closeButtonAriaLabel,removeToast:nt,toasts:q.filter(ie=>ie.position==ut.position),heights:W.filter(ie=>ie.position==ut.position),setHeights:at,expandByDefault:h,gap:L,expanded:st,swipeDirections:a.swipeDirections})})):null}))});var Ui=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(){}},xr=typeof window>"u"||"Deno"in globalThis;function Ae(){}function p4(e,a){return typeof e=="function"?e(a):e}function Gd(e){return typeof e=="number"&&e>=0&&e!==1/0}function I1(e,a){return Math.max(e+(a||0)-Date.now(),0)}function Ba(e,a){return typeof e=="function"?e(a):e}function on(e,a){return typeof e=="function"?e(a):e}function s0(e,a){const{type:r="all",exact:s,fetchStatus:l,predicate:c,queryKey:f,stale:h}=e;if(f){if(s){if(a.queryHash!==zh(f,a.options))return!1}else if(!Js(a.queryKey,f))return!1}if(r!=="all"){const p=a.isActive();if(r==="active"&&!p||r==="inactive"&&p)return!1}return!(typeof h=="boolean"&&a.isStale()!==h||l&&l!==a.state.fetchStatus||c&&!c(a))}function o0(e,a){const{exact:r,status:s,predicate:l,mutationKey:c}=e;if(c){if(!a.options.mutationKey)return!1;if(r){if(wr(a.options.mutationKey)!==wr(c))return!1}else if(!Js(a.options.mutationKey,c))return!1}return!(s&&a.state.status!==s||l&&!l(a))}function zh(e,a){return(a?.queryKeyHashFn||wr)(e)}function wr(e){return JSON.stringify(e,(a,r)=>Yd(r)?Object.keys(r).sort().reduce((s,l)=>(s[l]=r[l],s),{}):r)}function Js(e,a){return e===a?!0:typeof e!=typeof a?!1:e&&a&&typeof e=="object"&&typeof a=="object"?Object.keys(a).every(r=>Js(e[r],a[r])):!1}function W1(e,a){if(e===a)return e;const r=l0(e)&&l0(a);if(r||Yd(e)&&Yd(a)){const s=r?e:Object.keys(e),l=s.length,c=r?a:Object.keys(a),f=c.length,h=r?[]:{},p=new Set(s);let m=0;for(let v=0;v<f;v++){const g=r?v:c[v];(!r&&p.has(g)||r)&&e[g]===void 0&&a[g]===void 0?(h[g]=void 0,m++):(h[g]=W1(e[g],a[g]),h[g]===e[g]&&e[g]!==void 0&&m++)}return l===f&&m===l?e:h}return a}function uc(e,a){if(!a||Object.keys(e).length!==Object.keys(a).length)return!1;for(const r in e)if(e[r]!==a[r])return!1;return!0}function l0(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Yd(e){if(!c0(e))return!1;const a=e.constructor;if(a===void 0)return!0;const r=a.prototype;return!(!c0(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function c0(e){return Object.prototype.toString.call(e)==="[object Object]"}function g4(e){return new Promise(a=>{setTimeout(a,e)})}function Fd(e,a,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,a):r.structuralSharing!==!1?W1(e,a):a}function v4(e,a,r=0){const s=[...e,a];return r&&s.length>r?s.slice(1):s}function y4(e,a,r=0){const s=[a,...e];return r&&s.length>r?s.slice(0,-1):s}var Ph=Symbol();function J1(e,a){return!e.queryFn&&a?.initialPromise?()=>a.initialPromise:!e.queryFn||e.queryFn===Ph?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function tS(e,a){return typeof e=="function"?e(...a):!!e}var b4=class extends Ui{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!xr&&window.addEventListener){const a=()=>e();return window.addEventListener("visibilitychange",a,!1),()=>{window.removeEventListener("visibilitychange",a)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(a=>{a(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Uh=new b4,S4=class extends Ui{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!xr&&window.addEventListener){const a=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",a,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",a),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(r=>{r(e)}))}isOnline(){return this.#e}},fc=new S4;function Qd(){let e,a;const r=new Promise((l,c)=>{e=l,a=c});r.status="pending",r.catch(()=>{});function s(l){Object.assign(r,l),delete r.resolve,delete r.reject}return r.resolve=l=>{s({status:"fulfilled",value:l}),e(l)},r.reject=l=>{s({status:"rejected",reason:l}),a(l)},r}function x4(e){return Math.min(1e3*2**e,3e4)}function eS(e){return(e??"online")==="online"?fc.isOnline():!0}var nS=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function aS(e){let a=!1,r=0,s;const l=Qd(),c=()=>l.status!=="pending",f=w=>{c()||(y(new nS(w)),e.abort?.())},h=()=>{a=!0},p=()=>{a=!1},m=()=>Uh.isFocused()&&(e.networkMode==="always"||fc.isOnline())&&e.canRun(),v=()=>eS(e.networkMode)&&e.canRun(),g=w=>{c()||(s?.(),l.resolve(w))},y=w=>{c()||(s?.(),l.reject(w))},x=()=>new Promise(w=>{s=T=>{(c()||m())&&w(T)},e.onPause?.()}).then(()=>{s=void 0,c()||e.onContinue?.()}),S=()=>{if(c())return;let w;const T=r===0?e.initialPromise:void 0;try{w=T??e.fn()}catch(C){w=Promise.reject(C)}Promise.resolve(w).then(g).catch(C=>{if(c())return;const j=e.retry??(xr?0:3),L=e.retryDelay??x4,U=typeof L=="function"?L(r,C):L,N=j===!0||typeof j=="number"&&r<j||typeof j=="function"&&j(r,C);if(a||!N){y(C);return}r++,e.onFail?.(r,C),g4(U).then(()=>m()?void 0:x()).then(()=>{a?y(C):S()})})};return{promise:l,status:()=>l.status,cancel:f,continue:()=>(s?.(),l),cancelRetry:h,continueRetry:p,canStart:v,start:()=>(v()?S():x().then(S),l)}}var w4=e=>setTimeout(e,0);function E4(){let e=[],a=0,r=h=>{h()},s=h=>{h()},l=w4;const c=h=>{a?e.push(h):l(()=>{r(h)})},f=()=>{const h=e;e=[],h.length&&l(()=>{s(()=>{h.forEach(p=>{r(p)})})})};return{batch:h=>{let p;a++;try{p=h()}finally{a--,a||f()}return p},batchCalls:h=>(...p)=>{c(()=>{h(...p)})},schedule:c,setNotifyFunction:h=>{r=h},setBatchNotifyFunction:h=>{s=h},setScheduler:h=>{l=h}}}var ue=E4(),rS=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Gd(this.gcTime)&&(this.#e=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(xr?1/0:300*1e3))}clearGcTimeout(){this.#e&&(clearTimeout(this.#e),this.#e=void 0)}},R4=class extends rS{#e;#t;#n;#a;#r;#s;#o;constructor(e){super(),this.#o=!1,this.#s=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#a=e.client,this.#n=this.#a.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=_4(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){this.options={...this.#s,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,a){const r=Fd(this.state.data,e,this.options);return this.#i({data:r,type:"success",dataUpdatedAt:a?.updatedAt,manual:a?.manual}),r}setState(e,a){this.#i({type:"setState",state:e,setStateOptions:a})}cancel(e){const a=this.#r?.promise;return this.#r?.cancel(e),a?a.then(Ae).catch(Ae):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>on(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ph||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Ba(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!I1(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(a=>a.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(a=>a.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(a=>a!==e),this.observers.length||(this.#r&&(this.#o?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}async fetch(e,a){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&a?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const h=this.observers.find(p=>p.options.queryFn);h&&this.setOptions(h.options)}const r=new AbortController,s=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(this.#o=!0,r.signal)})},l=()=>{const h=J1(this.options,a),m=(()=>{const v={client:this.#a,queryKey:this.queryKey,meta:this.meta};return s(v),v})();return this.#o=!1,this.options.persister?this.options.persister(h,m,this):h(m)},f=(()=>{const h={fetchOptions:a,options:this.options,queryKey:this.queryKey,client:this.#a,state:this.state,fetchFn:l};return s(h),h})();this.options.behavior?.onFetch(f,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==f.fetchOptions?.meta)&&this.#i({type:"fetch",meta:f.fetchOptions?.meta}),this.#r=aS({initialPromise:a?.initialPromise,fn:f.fetchFn,abort:r.abort.bind(r),onFail:(h,p)=>{this.#i({type:"failed",failureCount:h,error:p})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.options.networkMode,canRun:()=>!0});try{const h=await this.#r.start();if(h===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(h),this.#n.config.onSuccess?.(h,this),this.#n.config.onSettled?.(h,this.state.error,this),h}catch(h){if(h instanceof nS){if(h.silent)return this.#r.promise;if(h.revert){if(this.setState({...this.#t,fetchStatus:"idle"}),this.state.data===void 0)throw h;return this.state.data}}throw this.#i({type:"error",error:h}),this.#n.config.onError?.(h,this),this.#n.config.onSettled?.(this.state.data,h,this),h}finally{this.scheduleGc()}}#i(e){const a=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...iS(r.data,this.options),fetchMeta:e.meta??null};case"success":const s={...r,data:e.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?s:void 0,s;case"error":const l=e.error;return{...r,error:l,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:l,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=a(this.state),ue.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function iS(e,a){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:eS(a.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function _4(e){const a=typeof e.initialData=="function"?e.initialData():e.initialData,r=a!==void 0,s=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:a,dataUpdateCount:0,dataUpdatedAt:r?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var T4=class extends Ui{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,a,r){const s=a.queryKey,l=a.queryHash??zh(s,a);let c=this.get(l);return c||(c=new R4({client:e,queryKey:s,queryHash:l,options:e.defaultQueryOptions(a),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(c)),c}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const a=this.#e.get(e.queryHash);a&&(e.destroy(),a===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){ue.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const a={exact:!0,...e};return this.getAll().find(r=>s0(a,r))}findAll(e={}){const a=this.getAll();return Object.keys(e).length>0?a.filter(r=>s0(e,r)):a}notify(e){ue.batch(()=>{this.listeners.forEach(a=>{a(e)})})}onFocus(){ue.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ue.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},C4=class extends rS{#e;#t;#n;constructor(e){super(),this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#e=[],this.state=e.state||sS(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#e.includes(e)||(this.#e.push(e),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(a=>a!==e),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#t.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(e){const a=()=>{this.#a({type:"continue"})};this.#n=aS({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(l,c)=>{this.#a({type:"failed",failureCount:l,error:c})},onPause:()=>{this.#a({type:"pause"})},onContinue:a,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});const r=this.state.status==="pending",s=!this.#n.canStart();try{if(r)a();else{this.#a({type:"pending",variables:e,isPaused:s}),await this.#t.config.onMutate?.(e,this);const c=await this.options.onMutate?.(e);c!==this.state.context&&this.#a({type:"pending",context:c,variables:e,isPaused:s})}const l=await this.#n.start();return await this.#t.config.onSuccess?.(l,e,this.state.context,this),await this.options.onSuccess?.(l,e,this.state.context),await this.#t.config.onSettled?.(l,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(l,null,e,this.state.context),this.#a({type:"success",data:l}),l}catch(l){try{throw await this.#t.config.onError?.(l,e,this.state.context,this),await this.options.onError?.(l,e,this.state.context),await this.#t.config.onSettled?.(void 0,l,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,l,e,this.state.context),l}finally{this.#a({type:"error",error:l})}}finally{this.#t.runNext(this)}}#a(e){const a=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=a(this.state),ue.batch(()=>{this.#e.forEach(r=>{r.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function sS(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var A4=class extends Ui{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,a,r){const s=new C4({mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(a),state:r});return this.add(s),s}add(e){this.#e.add(e);const a=Hl(e);if(typeof a=="string"){const r=this.#t.get(a);r?r.push(e):this.#t.set(a,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const a=Hl(e);if(typeof a=="string"){const r=this.#t.get(a);if(r)if(r.length>1){const s=r.indexOf(e);s!==-1&&r.splice(s,1)}else r[0]===e&&this.#t.delete(a)}}this.notify({type:"removed",mutation:e})}canRun(e){const a=Hl(e);if(typeof a=="string"){const s=this.#t.get(a)?.find(l=>l.state.status==="pending");return!s||s===e}else return!0}runNext(e){const a=Hl(e);return typeof a=="string"?this.#t.get(a)?.find(s=>s!==e&&s.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){ue.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const a={exact:!0,...e};return this.getAll().find(r=>o0(a,r))}findAll(e={}){return this.getAll().filter(a=>o0(e,a))}notify(e){ue.batch(()=>{this.listeners.forEach(a=>{a(e)})})}resumePausedMutations(){const e=this.getAll().filter(a=>a.state.isPaused);return ue.batch(()=>Promise.all(e.map(a=>a.continue().catch(Ae))))}};function Hl(e){return e.options.scope?.id}function u0(e){return{onFetch:(a,r)=>{const s=a.options,l=a.fetchOptions?.meta?.fetchMore?.direction,c=a.state.data?.pages||[],f=a.state.data?.pageParams||[];let h={pages:[],pageParams:[]},p=0;const m=async()=>{let v=!1;const g=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(a.signal.aborted?v=!0:a.signal.addEventListener("abort",()=>{v=!0}),a.signal)})},y=J1(a.options,a.fetchOptions),x=async(S,w,T)=>{if(v)return Promise.reject();if(w==null&&S.pages.length)return Promise.resolve(S);const j=(()=>{const F={client:a.client,queryKey:a.queryKey,pageParam:w,direction:T?"backward":"forward",meta:a.options.meta};return g(F),F})(),L=await y(j),{maxPages:U}=a.options,N=T?y4:v4;return{pages:N(S.pages,L,U),pageParams:N(S.pageParams,w,U)}};if(l&&c.length){const S=l==="backward",w=S?O4:f0,T={pages:c,pageParams:f},C=w(s,T);h=await x(T,C,S)}else{const S=e??c.length;do{const w=p===0?f[0]??s.initialPageParam:f0(s,h);if(p>0&&w==null)break;h=await x(h,w),p++}while(p<S)}return h};a.options.persister?a.fetchFn=()=>a.options.persister?.(m,{client:a.client,queryKey:a.queryKey,meta:a.options.meta,signal:a.signal},r):a.fetchFn=m}}}function f0(e,{pages:a,pageParams:r}){const s=a.length-1;return a.length>0?e.getNextPageParam(a[s],a,r[s],r):void 0}function O4(e,{pages:a,pageParams:r}){return a.length>0?e.getPreviousPageParam?.(a[0],a,r[0],r):void 0}var M4=class{#e;#t;#n;#a;#r;#s;#o;#i;constructor(e={}){this.#e=e.queryCache||new T4,this.#t=e.mutationCache||new A4,this.#n=e.defaultOptions||{},this.#a=new Map,this.#r=new Map,this.#s=0}mount(){this.#s++,this.#s===1&&(this.#o=Uh.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=fc.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#s--,this.#s===0&&(this.#o?.(),this.#o=void 0,this.#i?.(),this.#i=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const a=this.defaultQueryOptions({queryKey:e});return this.#e.get(a.queryHash)?.state.data}ensureQueryData(e){const a=this.defaultQueryOptions(e),r=this.#e.build(this,a),s=r.state.data;return s===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Ba(a.staleTime,r))&&this.prefetchQuery(a),Promise.resolve(s))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:a,state:r})=>{const s=r.data;return[a,s]})}setQueryData(e,a,r){const s=this.defaultQueryOptions({queryKey:e}),c=this.#e.get(s.queryHash)?.state.data,f=p4(a,c);if(f!==void 0)return this.#e.build(this,s).setData(f,{...r,manual:!0})}setQueriesData(e,a,r){return ue.batch(()=>this.#e.findAll(e).map(({queryKey:s})=>[s,this.setQueryData(s,a,r)]))}getQueryState(e){const a=this.defaultQueryOptions({queryKey:e});return this.#e.get(a.queryHash)?.state}removeQueries(e){const a=this.#e;ue.batch(()=>{a.findAll(e).forEach(r=>{a.remove(r)})})}resetQueries(e,a){const r=this.#e;return ue.batch(()=>(r.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...e},a)))}cancelQueries(e,a={}){const r={revert:!0,...a},s=ue.batch(()=>this.#e.findAll(e).map(l=>l.cancel(r)));return Promise.all(s).then(Ae).catch(Ae)}invalidateQueries(e,a={}){return ue.batch(()=>(this.#e.findAll(e).forEach(r=>{r.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},a)))}refetchQueries(e,a={}){const r={...a,cancelRefetch:a.cancelRefetch??!0},s=ue.batch(()=>this.#e.findAll(e).filter(l=>!l.isDisabled()&&!l.isStatic()).map(l=>{let c=l.fetch(void 0,r);return r.throwOnError||(c=c.catch(Ae)),l.state.fetchStatus==="paused"?Promise.resolve():c}));return Promise.all(s).then(Ae)}fetchQuery(e){const a=this.defaultQueryOptions(e);a.retry===void 0&&(a.retry=!1);const r=this.#e.build(this,a);return r.isStaleByTime(Ba(a.staleTime,r))?r.fetch(a):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ae).catch(Ae)}fetchInfiniteQuery(e){return e.behavior=u0(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ae).catch(Ae)}ensureInfiniteQueryData(e){return e.behavior=u0(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return fc.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,a){this.#a.set(wr(e),{queryKey:e,defaultOptions:a})}getQueryDefaults(e){const a=[...this.#a.values()],r={};return a.forEach(s=>{Js(e,s.queryKey)&&Object.assign(r,s.defaultOptions)}),r}setMutationDefaults(e,a){this.#r.set(wr(e),{mutationKey:e,defaultOptions:a})}getMutationDefaults(e){const a=[...this.#r.values()],r={};return a.forEach(s=>{Js(e,s.mutationKey)&&Object.assign(r,s.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const a={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return a.queryHash||(a.queryHash=zh(a.queryKey,a)),a.refetchOnReconnect===void 0&&(a.refetchOnReconnect=a.networkMode!=="always"),a.throwOnError===void 0&&(a.throwOnError=!!a.suspense),!a.networkMode&&a.persister&&(a.networkMode="offlineFirst"),a.queryFn===Ph&&(a.enabled=!1),a}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},D4=class extends Ui{constructor(e,a){super(),this.options=a,this.#e=e,this.#i=null,this.#o=Qd(),this.bindMethods(),this.setOptions(a)}#e;#t=void 0;#n=void 0;#a=void 0;#r;#s;#o;#i;#p;#d;#h;#c;#u;#l;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),d0(this.#t,this.options)?this.#f():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Kd(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Kd(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#S(),this.#x(),this.#t.removeObserver(this)}setOptions(e){const a=this.options,r=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof on(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#t.setOptions(this.options),a._defaulted&&!uc(this.options,a)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const s=this.hasListeners();s&&h0(this.#t,r,this.options,a)&&this.#f(),this.updateResult(),s&&(this.#t!==r||on(this.options.enabled,this.#t)!==on(a.enabled,this.#t)||Ba(this.options.staleTime,this.#t)!==Ba(a.staleTime,this.#t))&&this.#g();const l=this.#v();s&&(this.#t!==r||on(this.options.enabled,this.#t)!==on(a.enabled,this.#t)||l!==this.#l)&&this.#y(l)}getOptimisticResult(e){const a=this.#e.getQueryCache().build(this.#e,e),r=this.createResult(a,e);return L4(this,r)&&(this.#a=r,this.#s=this.options,this.#r=this.#t.state),r}getCurrentResult(){return this.#a}trackResult(e,a){return new Proxy(e,{get:(r,s)=>(this.trackProp(s),a?.(s),s==="promise"&&!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled")),Reflect.get(r,s))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const a=this.#e.defaultQueryOptions(e),r=this.#e.getQueryCache().build(this.#e,a);return r.fetch().then(()=>this.createResult(r,a))}fetch(e){return this.#f({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#a))}#f(e){this.#w();let a=this.#t.fetch(this.options,e);return e?.throwOnError||(a=a.catch(Ae)),a}#g(){this.#S();const e=Ba(this.options.staleTime,this.#t);if(xr||this.#a.isStale||!Gd(e))return;const r=I1(this.#a.dataUpdatedAt,e)+1;this.#c=setTimeout(()=>{this.#a.isStale||this.updateResult()},r)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(e){this.#x(),this.#l=e,!(xr||on(this.options.enabled,this.#t)===!1||!Gd(this.#l)||this.#l===0)&&(this.#u=setInterval(()=>{(this.options.refetchIntervalInBackground||Uh.isFocused())&&this.#f()},this.#l))}#b(){this.#g(),this.#y(this.#v())}#S(){this.#c&&(clearTimeout(this.#c),this.#c=void 0)}#x(){this.#u&&(clearInterval(this.#u),this.#u=void 0)}createResult(e,a){const r=this.#t,s=this.options,l=this.#a,c=this.#r,f=this.#s,p=e!==r?e.state:this.#n,{state:m}=e;let v={...m},g=!1,y;if(a._optimisticResults){const q=this.hasListeners(),et=!q&&d0(e,a),W=q&&h0(e,r,a,s);(et||W)&&(v={...v,...iS(m.data,e.options)}),a._optimisticResults==="isRestoring"&&(v.fetchStatus="idle")}let{error:x,errorUpdatedAt:S,status:w}=v;y=v.data;let T=!1;if(a.placeholderData!==void 0&&y===void 0&&w==="pending"){let q;l?.isPlaceholderData&&a.placeholderData===f?.placeholderData?(q=l.data,T=!0):q=typeof a.placeholderData=="function"?a.placeholderData(this.#h?.state.data,this.#h):a.placeholderData,q!==void 0&&(w="success",y=Fd(l?.data,q,a),g=!0)}if(a.select&&y!==void 0&&!T)if(l&&y===c?.data&&a.select===this.#p)y=this.#d;else try{this.#p=a.select,y=a.select(y),y=Fd(l?.data,y,a),this.#d=y,this.#i=null}catch(q){this.#i=q}this.#i&&(x=this.#i,y=this.#d,S=Date.now(),w="error");const C=v.fetchStatus==="fetching",j=w==="pending",L=w==="error",U=j&&C,N=y!==void 0,G={status:w,fetchStatus:v.fetchStatus,isPending:j,isSuccess:w==="success",isError:L,isInitialLoading:U,isLoading:U,data:y,dataUpdatedAt:v.dataUpdatedAt,error:x,errorUpdatedAt:S,failureCount:v.fetchFailureCount,failureReason:v.fetchFailureReason,errorUpdateCount:v.errorUpdateCount,isFetched:v.dataUpdateCount>0||v.errorUpdateCount>0,isFetchedAfterMount:v.dataUpdateCount>p.dataUpdateCount||v.errorUpdateCount>p.errorUpdateCount,isFetching:C,isRefetching:C&&!j,isLoadingError:L&&!N,isPaused:v.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:L&&N,isStale:Bh(e,a),refetch:this.refetch,promise:this.#o,isEnabled:on(a.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const q=at=>{G.status==="error"?at.reject(G.error):G.data!==void 0&&at.resolve(G.data)},et=()=>{const at=this.#o=G.promise=Qd();q(at)},W=this.#o;switch(W.status){case"pending":e.queryHash===r.queryHash&&q(W);break;case"fulfilled":(G.status==="error"||G.data!==W.value)&&et();break;case"rejected":(G.status!=="error"||G.error!==W.reason)&&et();break}}return G}updateResult(){const e=this.#a,a=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#s=this.options,this.#r.data!==void 0&&(this.#h=this.#t),uc(a,e))return;this.#a=a;const r=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,l=typeof s=="function"?s():s;if(l==="all"||!l&&!this.#m.size)return!0;const c=new Set(l??this.#m);return this.options.throwOnError&&c.add("error"),Object.keys(this.#a).some(f=>{const h=f;return this.#a[h]!==e[h]&&c.has(h)})};this.#E({listeners:r()})}#w(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const a=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(a?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#E(e){ue.batch(()=>{e.listeners&&this.listeners.forEach(a=>{a(this.#a)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function N4(e,a){return on(a.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&a.retryOnMount===!1)}function d0(e,a){return N4(e,a)||e.state.data!==void 0&&Kd(e,a,a.refetchOnMount)}function Kd(e,a,r){if(on(a.enabled,e)!==!1&&Ba(a.staleTime,e)!=="static"){const s=typeof r=="function"?r(e):r;return s==="always"||s!==!1&&Bh(e,a)}return!1}function h0(e,a,r,s){return(e!==a||on(s.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Bh(e,r)}function Bh(e,a){return on(a.enabled,e)!==!1&&e.isStaleByTime(Ba(a.staleTime,e))}function L4(e,a){return!uc(e.getCurrentResult(),a)}var j4=class extends Ui{#e;#t=void 0;#n;#a;constructor(a,r){super(),this.#e=a,this.setOptions(r),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(a){const r=this.options;this.options=this.#e.defaultMutationOptions(a),uc(this.options,r)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),r?.mutationKey&&this.options.mutationKey&&wr(r.mutationKey)!==wr(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(a){this.#r(),this.#s(a)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#r(),this.#s()}mutate(a,r){return this.#a=r,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(a)}#r(){const a=this.#n?.state??sS();this.#t={...a,isPending:a.status==="pending",isSuccess:a.status==="success",isError:a.status==="error",isIdle:a.status==="idle",mutate:this.mutate,reset:this.reset}}#s(a){ue.batch(()=>{if(this.#a&&this.hasListeners()){const r=this.#t.variables,s=this.#t.context;a?.type==="success"?(this.#a.onSuccess?.(a.data,r,s),this.#a.onSettled?.(a.data,null,r,s)):a?.type==="error"&&(this.#a.onError?.(a.error,r,s),this.#a.onSettled?.(void 0,a.error,r,s))}this.listeners.forEach(r=>{r(this.#t)})})}},oS=R.createContext(void 0),lS=e=>{const a=R.useContext(oS);if(!a)throw new Error("No QueryClient set, use QueryClientProvider to set one");return a},z4=({client:e,children:a})=>(R.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),_.jsx(oS.Provider,{value:e,children:a})),cS=R.createContext(!1),P4=()=>R.useContext(cS);cS.Provider;function U4(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var B4=R.createContext(U4()),k4=()=>R.useContext(B4),H4=(e,a)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(a.isReset()||(e.retryOnMount=!1))},q4=e=>{R.useEffect(()=>{e.clearReset()},[e])},V4=({result:e,errorResetBoundary:a,throwOnError:r,query:s,suspense:l})=>e.isError&&!a.isReset()&&!e.isFetching&&s&&(l&&e.data===void 0||tS(r,[e.error,s])),G4=e=>{if(e.suspense){const a=s=>s==="static"?s:Math.max(s??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...s)=>a(r(...s)):a(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Y4=(e,a)=>e.isLoading&&e.isFetching&&!a,F4=(e,a)=>e?.suspense&&a.isPending,m0=(e,a,r)=>a.fetchOptimistic(e).catch(()=>{r.clearReset()});function Q4(e,a,r){const s=P4(),l=k4(),c=lS(),f=c.defaultQueryOptions(e);c.getDefaultOptions().queries?._experimental_beforeQuery?.(f),f._optimisticResults=s?"isRestoring":"optimistic",G4(f),H4(f,l),q4(l);const h=!c.getQueryCache().get(f.queryHash),[p]=R.useState(()=>new a(c,f)),m=p.getOptimisticResult(f),v=!s&&e.subscribed!==!1;if(R.useSyncExternalStore(R.useCallback(g=>{const y=v?p.subscribe(ue.batchCalls(g)):Ae;return p.updateResult(),y},[p,v]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),R.useEffect(()=>{p.setOptions(f)},[f,p]),F4(f,m))throw m0(f,p,l);if(V4({result:m,errorResetBoundary:l,throwOnError:f.throwOnError,query:c.getQueryCache().get(f.queryHash),suspense:f.suspense}))throw m.error;return c.getDefaultOptions().queries?._experimental_afterQuery?.(f,m),f.experimental_prefetchInRender&&!xr&&Y4(m,s)&&(h?m0(f,p,l):c.getQueryCache().get(f.queryHash)?.promise)?.catch(Ae).finally(()=>{p.updateResult()}),f.notifyOnChangeProps?m:p.trackResult(m)}function K4(e,a){return Q4(e,D4)}function X4(e,a){const r=lS(),[s]=R.useState(()=>new j4(r,e));R.useEffect(()=>{s.setOptions(e)},[s,e]);const l=R.useSyncExternalStore(R.useCallback(f=>s.subscribe(ue.batchCalls(f)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),c=R.useCallback((f,h)=>{s.mutate(f,h).catch(Ae)},[s]);if(l.error&&tS(s.options.throwOnError,[l.error]))throw l.error;return{...l,mutate:c,mutateAsync:l.mutate}}function $4(){return _.jsx("div",{className:"h-screen grid place-items-center",children:_.jsx(G0,{className:"size-8 animate-spin"})})}function Z4({className:e,...a}){const{setAuthenticated:r}=Z1(),[s,l]=R.useState(""),[c,f]=R.useState(""),h=jh(),{isPending:p,mutate:m}=X4({mutationFn:async()=>h.login(s,c),onError(){a0.error("Invalid credentials",{description:"The credentials you provided are invalid."})},onSuccess(){a0.success("Login successful",{description:"You have successfully logged in."}),r(!0)}});return p?_.jsx($4,{}):_.jsx("div",{className:Et("flex flex-col gap-6 w-[20%]",e),...a,children:_.jsxs(DM,{children:[_.jsxs(NM,{children:[_.jsx(LM,{className:"text-2xl",children:"Login"}),_.jsx(jM,{children:"Enter your credentials below to proceed"})]}),_.jsx(zM,{children:_.jsxs("div",{className:"flex flex-col gap-6",children:[_.jsxs("div",{className:"grid gap-2",children:[_.jsx(t0,{htmlFor:"username",children:"Username"}),_.jsx(py,{id:"username",type:"username",placeholder:"Enter your username",required:!0,value:s,onChange:v=>l(v.target.value)})]}),_.jsxs("div",{className:"grid gap-2",children:[_.jsx("div",{className:"flex items-center",children:_.jsx(t0,{htmlFor:"password",children:"Password"})}),_.jsx(py,{id:"password",type:"password",required:!0,value:c,onChange:v=>f(v.target.value)})]}),_.jsx(sb,{type:"button",className:"w-full",onClick:()=>{m()},children:"Login"})]})})]})})}function I4({children:e}){const{authenticated:a,setAuthenticated:r}=Z1(),s=jh(),{isLoading:l,isError:c}=K4({queryKey:[],enabled:!a,queryFn:async()=>{const f=await s.fetchMe();return r(!!f),f},refetchOnWindowFocus:!0});return l?_.jsx("div",{className:"h-screen grid place-items-center",children:_.jsx(G0,{className:"size-8 animate-spin"})}):c?_.jsx("div",{className:"h-screen grid place-items-center",children:_.jsx("h1",{className:"text-2xl text-red-500",children:"An error occurred while fetching user data."})}):a?_.jsx(_.Fragment,{children:e}):_.jsx("div",{className:"h-screen grid place-items-center",children:_.jsx(Z4,{})})}function W4({...e}){return _.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function J4({className:e,...a}){return _.jsx("ol",{"data-slot":"breadcrumb-list",className:Et("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",e),...a})}function vd({className:e,...a}){return _.jsx("li",{"data-slot":"breadcrumb-item",className:Et("inline-flex items-center gap-1.5",e),...a})}function p0({asChild:e,className:a,...r}){const s=e?no:"a";return _.jsx(s,{"data-slot":"breadcrumb-link",className:Et("hover:text-foreground transition-colors",a),...r})}function t3({className:e,...a}){return _.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:Et("text-foreground font-normal",e),...a})}function g0({children:e,className:a,...r}){return _.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:Et("[&>svg]:size-3.5",a),...r,children:e??_.jsx(vR,{})})}function e3(){const{toggleSidebar:e}=Ch();return _.jsx("header",{className:"bg-background sticky top-0 z-50 flex w-full items-center border-b",children:_.jsxs("div",{className:"flex h-(--header-height) w-full items-center gap-2 px-4",children:[_.jsx(sb,{className:"h-8 w-8",variant:"ghost",size:"icon",onClick:e,children:_.jsx(bR,{})}),_.jsx(K_,{orientation:"vertical",className:"mr-2 h-4"}),_.jsx(W4,{className:"hidden sm:block",children:_.jsxs(J4,{children:[_.jsx(vd,{children:_.jsx(p0,{href:"#",children:"/"})}),_.jsx(g0,{}),_.jsx(vd,{children:_.jsx(t3,{children:"CommandKit"})}),_.jsx(g0,{}),_.jsx(vd,{children:_.jsx(p0,{href:"#",children:"DevTools"})})]})})]})})}var n3=(e,a,r,s,l,c,f,h)=>{let p=document.documentElement,m=["light","dark"];function v(x){(Array.isArray(e)?e:[e]).forEach(S=>{let w=S==="class",T=w&&c?l.map(C=>c[C]||C):l;w?(p.classList.remove(...T),p.classList.add(c&&c[x]?c[x]:x)):p.setAttribute(S,x)}),g(x)}function g(x){h&&m.includes(x)&&(p.style.colorScheme=x)}function y(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(s)v(s);else try{let x=localStorage.getItem(a)||r,S=f&&x==="system"?y():x;v(S)}catch{}},v0=["light","dark"],uS="(prefers-color-scheme: dark)",a3=typeof window>"u",kh=R.createContext(void 0),r3={setTheme:e=>{},themes:[]},i3=()=>{var e;return(e=R.useContext(kh))!=null?e:r3},s3=e=>R.useContext(kh)?R.createElement(R.Fragment,null,e.children):R.createElement(l3,{...e}),o3=["light","dark"],l3=({forcedTheme:e,disableTransitionOnChange:a=!1,enableSystem:r=!0,enableColorScheme:s=!0,storageKey:l="theme",themes:c=o3,defaultTheme:f=r?"system":"light",attribute:h="data-theme",value:p,children:m,nonce:v,scriptProps:g})=>{let[y,x]=R.useState(()=>u3(l,f)),[S,w]=R.useState(()=>y==="system"?yd():y),T=p?Object.values(p):c,C=R.useCallback(N=>{let F=N;if(!F)return;N==="system"&&r&&(F=yd());let G=p?p[F]:F,q=a?f3(v):null,et=document.documentElement,W=at=>{at==="class"?(et.classList.remove(...T),G&&et.classList.add(G)):at.startsWith("data-")&&(G?et.setAttribute(at,G):et.removeAttribute(at))};if(Array.isArray(h)?h.forEach(W):W(h),s){let at=v0.includes(f)?f:null,st=v0.includes(F)?F:at;et.style.colorScheme=st}q?.()},[v]),j=R.useCallback(N=>{let F=typeof N=="function"?N(y):N;x(F);try{localStorage.setItem(l,F)}catch{}},[y]),L=R.useCallback(N=>{let F=yd(N);w(F),y==="system"&&r&&!e&&C("system")},[y,e]);R.useEffect(()=>{let N=window.matchMedia(uS);return N.addListener(L),L(N),()=>N.removeListener(L)},[L]),R.useEffect(()=>{let N=F=>{F.key===l&&(F.newValue?x(F.newValue):j(f))};return window.addEventListener("storage",N),()=>window.removeEventListener("storage",N)},[j]),R.useEffect(()=>{C(e??y)},[e,y]);let U=R.useMemo(()=>({theme:y,setTheme:j,forcedTheme:e,resolvedTheme:y==="system"?S:y,themes:r?[...c,"system"]:c,systemTheme:r?S:void 0}),[y,j,e,S,r,c]);return R.createElement(kh.Provider,{value:U},R.createElement(c3,{forcedTheme:e,storageKey:l,attribute:h,enableSystem:r,enableColorScheme:s,defaultTheme:f,value:p,themes:c,nonce:v,scriptProps:g}),m)},c3=R.memo(({forcedTheme:e,storageKey:a,attribute:r,enableSystem:s,enableColorScheme:l,defaultTheme:c,value:f,themes:h,nonce:p,scriptProps:m})=>{let v=JSON.stringify([r,a,c,e,h,f,s,l]).slice(1,-1);return R.createElement("script",{...m,suppressHydrationWarning:!0,nonce:typeof window>"u"?p:"",dangerouslySetInnerHTML:{__html:`(${n3.toString()})(${v})`}})}),u3=(e,a)=>{if(a3)return;let r;try{r=localStorage.getItem(e)||void 0}catch{}return r||a},f3=e=>{let a=document.createElement("style");return e&&a.setAttribute("nonce",e),a.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(a),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(a)},1)}},yd=e=>(e||(e=window.matchMedia(uS)),e.matches?"dark":"light");const d3=({...e})=>{const{theme:a="system"}=i3();return _.jsx(m4,{theme:a,className:"toaster group",style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)"},...e})},Rr=IE({head:()=>({meta:[{charSet:"utf-8"},{name:"viewport",content:"width=device-width, initial-scale=1"},{title:"CommandKit DevTools"}]}),component:h3});function h3(){return _.jsxs(s3,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!1,children:[_.jsx(d3,{}),_.jsx(OM,{children:_.jsx(I4,{children:_.jsx("div",{className:"[--header-height:calc(theme(spacing.14))]",children:_.jsxs(EA,{className:"flex flex-col",children:[_.jsx(e3,{}),_.jsxs("div",{className:"flex flex-1",children:[_.jsx(MM,{}),_.jsx(_A,{children:_.jsx(k0,{})})]})]})})})})]})}const m3="modulepreload",p3=function(e){return"/"+e},y0={},Bi=function(a,r,s){let l=Promise.resolve();if(r&&r.length>0){let p=function(m){return Promise.all(m.map(v=>Promise.resolve(v).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const f=document.querySelector("meta[property=csp-nonce]"),h=f?.nonce||f?.getAttribute("nonce");l=p(r.map(m=>{if(m=p3(m),m in y0)return;y0[m]=!0;const v=m.endsWith(".css"),g=v?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${g}`))return;const y=document.createElement("link");if(y.rel=v?"stylesheet":m3,v||(y.as="script"),y.crossOrigin="",y.href=m,h&&y.setAttribute("nonce",h),document.head.appendChild(y),v)return new Promise((x,S)=>{y.addEventListener("load",x),y.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${m}`)))})}))}function c(f){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=f,window.dispatchEvent(h),!h.defaultPrevented)throw f}return l.then(f=>{for(const h of f||[])h.status==="rejected"&&c(h.reason);return a().catch(c)})},g3=()=>Bi(()=>import("./plugins-CGGKmV15.js"),[]),v3=ka("/plugins")({component:Mi(g3,"component")}),y3=()=>Bi(()=>import("./guilds-DAws6QJr.js"),[]),b3=ka("/guilds")({component:Mi(y3,"component")}),S3=()=>Bi(()=>import("./feature-flags-89kK-DU2.js"),[]),x3=ka("/feature-flags")({component:Mi(S3,"component")}),w3=()=>Bi(()=>import("./events--9SU6pGS.js"),[]),E3=ka("/events")({component:Mi(w3,"component")}),R3=()=>Bi(()=>import("./commands-8Pgfn73f.js"),[]),_3=ka("/commands")({component:Mi(R3,"component")}),T3=()=>Bi(()=>import("./index-CiMXQXsE.js"),[]),C3=ka("/")({component:Mi(T3,"component")}),A3=v3.update({id:"/plugins",path:"/plugins",getParentRoute:()=>Rr}),O3=b3.update({id:"/guilds",path:"/guilds",getParentRoute:()=>Rr}),M3=x3.update({id:"/feature-flags",path:"/feature-flags",getParentRoute:()=>Rr}),D3=E3.update({id:"/events",path:"/events",getParentRoute:()=>Rr}),N3=_3.update({id:"/commands",path:"/commands",getParentRoute:()=>Rr}),L3=C3.update({id:"/",path:"/",getParentRoute:()=>Rr}),j3={IndexRoute:L3,CommandsRoute:N3,EventsRoute:D3,FeatureFlagsRoute:M3,GuildsRoute:O3,PluginsRoute:A3},z3=Rr._addFileChildren(j3)._addFileTypes(),P3=sR({routeTree:z3,defaultPreload:"intent",defaultStaleTime:5e3,scrollRestoration:!0,defaultViewTransition:!0}),U3=new M4;Aw.createRoot(document.getElementById("root")).render(_.jsx(R.StrictMode,{children:_.jsx(z4,{client:U3,children:_.jsx(cR,{router:P3})})}));export{GA as A,KA as B,DM as C,$4 as L,K4 as a,NM as b,YA as c,FA as d,zM as e,LM as f,b0 as g,jM as h,Va as i,_ as j,vR as k,lD as l,Oi as m,sb as n,R as r,jh as u};
175
+ `+c):s.stack=c}catch{}}throw s}}_request(a,r){typeof a=="string"?(r=r||{},r.url=a):r=a||{},r=Sr(this.defaults,r);const{transitional:s,paramsSerializer:l,headers:c}=r;s!==void 0&&Xl.assertOptions(s,{silentJSONParsing:On.transitional(On.boolean),forcedJSONParsing:On.transitional(On.boolean),clarifyTimeoutError:On.transitional(On.boolean)},!1),l!=null&&(Y.isFunction(l)?r.paramsSerializer={serialize:l}:Xl.assertOptions(l,{encode:On.function,serialize:On.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Xl.assertOptions(r,{baseUrl:On.spelling("baseURL"),withXsrfToken:On.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let f=c&&Y.merge(c.common,c[r.method]);c&&Y.forEach(["delete","get","head","post","put","patch","common"],S=>{delete c[S]}),r.headers=Ue.concat(f,c);const h=[];let p=!0;this.interceptors.request.forEach(function(w){typeof w.runWhen=="function"&&w.runWhen(r)===!1||(p=p&&w.synchronous,h.unshift(w.fulfilled,w.rejected))});const m=[];this.interceptors.response.forEach(function(w){m.push(w.fulfilled,w.rejected)});let v,g=0,y;if(!p){const S=[Iy.bind(this),void 0];for(S.unshift(...h),S.push(...m),y=S.length,v=Promise.resolve(r);g<y;)v=v.then(S[g++],S[g++]);return v}y=h.length;let x=r;for(g=0;g<y;){const S=h[g++],w=h[g++];try{x=S(x)}catch(T){w.call(this,T);break}}try{v=Iy.call(this,x)}catch(S){return Promise.reject(S)}for(g=0,y=m.length;g<y;)v=v.then(m[g++],m[g++]);return v}getUri(a){a=Sr(this.defaults,a);const r=H1(a.baseURL,a.url,a.allowAbsoluteUrls);return z1(r,a.params,a.paramsSerializer)}};Y.forEach(["delete","get","head","options"],function(a){mr.prototype[a]=function(r,s){return this.request(Sr(s||{},{method:a,url:r,data:(s||{}).data}))}});Y.forEach(["post","put","patch"],function(a){function r(s){return function(c,f,h){return this.request(Sr(h||{},{method:a,headers:s?{"Content-Type":"multipart/form-data"}:{},url:c,data:f}))}}mr.prototype[a]=r(),mr.prototype[a+"Form"]=r(!0)});let wM=class Q1{constructor(a){if(typeof a!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(c){r=c});const s=this;this.promise.then(l=>{if(!s._listeners)return;let c=s._listeners.length;for(;c-- >0;)s._listeners[c](l);s._listeners=null}),this.promise.then=l=>{let c;const f=new Promise(h=>{s.subscribe(h),c=h}).then(l);return f.cancel=function(){s.unsubscribe(c)},f},a(function(c,f,h){s.reason||(s.reason=new Pi(c,f,h),r(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(a){if(this.reason){a(this.reason);return}this._listeners?this._listeners.push(a):this._listeners=[a]}unsubscribe(a){if(!this._listeners)return;const r=this._listeners.indexOf(a);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const a=new AbortController,r=s=>{a.abort(s)};return this.subscribe(r),a.signal.unsubscribe=()=>this.unsubscribe(r),a.signal}static source(){let a;return{token:new Q1(function(l){a=l}),cancel:a}}};function EM(e){return function(r){return e.apply(null,r)}}function RM(e){return Y.isObject(e)&&e.isAxiosError===!0}const qd={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(qd).forEach(([e,a])=>{qd[a]=e});function K1(e){const a=new mr(e),r=E1(mr.prototype.request,a);return Y.extend(r,mr.prototype,a,{allOwnKeys:!0}),Y.extend(r,a,null,{allOwnKeys:!0}),r.create=function(l){return K1(Sr(e,l))},r}const te=K1(fo);te.Axios=mr;te.CanceledError=Pi;te.CancelToken=wM;te.isCancel=B1;te.VERSION=F1;te.toFormData=Cc;te.AxiosError=xt;te.Cancel=te.CanceledError;te.all=function(a){return Promise.all(a)};te.spread=EM;te.isAxiosError=RM;te.mergeConfig=Sr;te.AxiosHeaders=Ue;te.formToJSON=e=>U1(Y.isHTMLForm(e)?new FormData(e):e);te.getAdapter=Y1.getAdapter;te.HttpStatusCode=qd;te.default=te;const{Axios:Q3,AxiosError:K3,CanceledError:X3,isCancel:$3,CancelToken:Z3,VERSION:I3,all:W3,Cancel:J3,isAxiosError:tD,spread:eD,toFormData:nD,AxiosHeaders:aD,HttpStatusCode:rD,formToJSON:iD,getAdapter:sD,mergeConfig:oD}=te,Lh=te.create({baseURL:"/api"});Lh.interceptors.request.use(e=>{const a=localStorage.getItem("access_token");return a&&(e.headers.Authorization=`Bearer ${a}`),e});Lh.interceptors.response.use(e=>e,e=>(e.response.status===401&&(localStorage.removeItem("access_token"),window.location.href="/"),Promise.reject(e)));class Jy{constructor(a,r){this.client=a,this.data=r}}class _M{constructor(a){this.client=a}async fetch(){const{data:a}=await this.client.api.get("/events");return a.events}}class TM{constructor(a){this.client=a}async fetch(){const{data:a}=await this.client.api.get("/guilds");return a.guilds}}class CM{constructor(a){this.client=a}async fetch(){const{data:a}=await this.client.api.get("/plugins");return a.plugins}}class AM{api=Lh;guilds=new TM(this);plugins=new CM(this);events=new _M(this);_user=null;get user(){return this._user}isReady(){return this._user!==null}logout(){localStorage.removeItem("access_token"),this._user=null}async fetchMe(a=!1){if(this._user&&!a)return this._user;const{data:r}=await this.api.get("/auth/@me");return this._user=new Jy(this,r),this._user}async getFeatureFlags(){const{data:a}=await this.api.get("/feature-flags");return a}async login(a,r){const{data:s}=await this.api.post("/auth/login",{username:a,password:r});return s.accessToken&&localStorage.setItem("access_token",s.accessToken),this._user=new Jy(this,s.user),s}}const X1=R.createContext(null);function OM({children:e}){const[a,r]=R.useState(()=>new AM);return _.jsx(X1.Provider,{value:{client:a,setClient:r},children:e})}function jh(){const e=R.use(X1);if(!e)throw new Error("useClient must be used within a ClientProvider");return e.client}const gd={navMain:[{title:"Commands",url:"/commands",icon:ry,isActive:!1},{title:"Events",url:"/events",icon:ay,isActive:!1},{title:"Plugins",url:"/plugins",icon:xR,isActive:!1},{title:"Guilds",url:"/guilds",icon:oy,isActive:!1},{title:"Feature Flags",url:"/feature-flags",icon:ER,isActive:!1}],navSecondary:[{title:"GitHub",url:"https://github.com/underctrl-io/commandkit",icon:PR},{title:"Discord",url:"https://ctrl.lol/discord",icon:oy}],projects:[{name:"Commands",url:"#",icon:ry},{name:"Middlewares",url:"#",icon:TR},{name:"Events",url:"#",icon:ay}]};function MM({...e}){const a=jh();return _.jsxs(RA,{className:"top-(--header-height) h-[calc(100svh-var(--header-height))]!",...e,children:[_.jsx(TA,{children:_.jsx(io,{children:_.jsx(so,{children:_.jsx(oo,{size:"lg",asChild:!0,children:_.jsxs(Oi,{to:"/",children:[_.jsx("div",{className:"border-sidebar-primary border text-sidebar-primary-foreground flex aspect-square size-8 items-center justify-center rounded-lg",children:_.jsx("img",{src:"/logo.webp",alt:"Logo",className:"size-6"})}),_.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[_.jsx("span",{className:"truncate font-medium",children:"CommandKit"}),_.jsx("span",{className:"truncate text-xs",children:"DevTools"})]})]})})})})}),_.jsxs(AA,{children:[_.jsx(DA,{items:gd.navMain}),_.jsx(NA,{projects:gd.projects}),_.jsx(LA,{items:gd.navSecondary,className:"mt-auto"})]}),_.jsx(CA,{children:_.jsx(XA,{user:{avatar:a.user.data.displayAvatarURL,name:a.user.data.globalName||a.user?.data.username,username:a.user.data.username}})})]})}function DM({className:e,...a}){return _.jsx("div",{"data-slot":"card",className:Et("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...a})}function NM({className:e,...a}){return _.jsx("div",{"data-slot":"card-header",className:Et("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...a})}function LM({className:e,...a}){return _.jsx("div",{"data-slot":"card-title",className:Et("leading-none font-semibold",e),...a})}function jM({className:e,...a}){return _.jsx("div",{"data-slot":"card-description",className:Et("text-muted-foreground text-sm",e),...a})}function zM({className:e,...a}){return _.jsx("div",{"data-slot":"card-content",className:Et("px-6",e),...a})}function lD({className:e,...a}){return _.jsx("div",{"data-slot":"card-footer",className:Et("flex items-center px-6 [.border-t]:pt-6",e),...a})}var PM="Label",$1=R.forwardRef((e,a)=>_.jsx(Xt.label,{...e,ref:a,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(e.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));$1.displayName=PM;var UM=$1;function t0({className:e,...a}){return _.jsx(UM,{"data-slot":"label",className:Et("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...a})}const e0=e=>{let a;const r=new Set,s=(m,v)=>{const g=typeof m=="function"?m(a):m;if(!Object.is(g,a)){const y=a;a=v??(typeof g!="object"||g===null)?g:Object.assign({},a,g),r.forEach(x=>x(a,y))}},l=()=>a,h={setState:s,getState:l,getInitialState:()=>p,subscribe:m=>(r.add(m),()=>r.delete(m))},p=a=e(s,l,h);return h},BM=(e=>e?e0(e):e0),kM=e=>e;function HM(e,a=kM){const r=J.useSyncExternalStore(e.subscribe,J.useCallback(()=>a(e.getState()),[e,a]),J.useCallback(()=>a(e.getInitialState()),[e,a]));return J.useDebugValue(r),r}const n0=e=>{const a=BM(e),r=s=>HM(a,s);return Object.assign(r,a),r},qM=(e=>e?n0(e):n0),Z1=qM(e=>({authenticated:!1,setAuthenticated:a=>e({authenticated:a})}));function VM(e){if(typeof document>"u")return;let a=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",a.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}const GM=e=>{switch(e){case"success":return QM;case"info":return XM;case"warning":return KM;case"error":return $M;default:return null}},YM=Array(12).fill(0),FM=({visible:e,className:a})=>J.createElement("div",{className:["sonner-loading-wrapper",a].filter(Boolean).join(" "),"data-visible":e},J.createElement("div",{className:"sonner-spinner"},YM.map((r,s)=>J.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),QM=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},J.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),KM=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},J.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),XM=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},J.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),$M=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},J.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),ZM=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},J.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),J.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),IM=()=>{const[e,a]=J.useState(document.hidden);return J.useEffect(()=>{const r=()=>{a(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e};let Vd=1;class WM{constructor(){this.subscribe=a=>(this.subscribers.push(a),()=>{const r=this.subscribers.indexOf(a);this.subscribers.splice(r,1)}),this.publish=a=>{this.subscribers.forEach(r=>r(a))},this.addToast=a=>{this.publish(a),this.toasts=[...this.toasts,a]},this.create=a=>{var r;const{message:s,...l}=a,c=typeof a?.id=="number"||((r=a.id)==null?void 0:r.length)>0?a.id:Vd++,f=this.toasts.find(p=>p.id===c),h=a.dismissible===void 0?!0:a.dismissible;return this.dismissedToasts.has(c)&&this.dismissedToasts.delete(c),f?this.toasts=this.toasts.map(p=>p.id===c?(this.publish({...p,...a,id:c,title:s}),{...p,...a,id:c,dismissible:h,title:s}):p):this.addToast({title:s,...l,dismissible:h,id:c}),c},this.dismiss=a=>(a?(this.dismissedToasts.add(a),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:a,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(s=>s({id:r.id,dismiss:!0}))}),a),this.message=(a,r)=>this.create({...r,message:a}),this.error=(a,r)=>this.create({...r,message:a,type:"error"}),this.success=(a,r)=>this.create({...r,type:"success",message:a}),this.info=(a,r)=>this.create({...r,type:"info",message:a}),this.warning=(a,r)=>this.create({...r,type:"warning",message:a}),this.loading=(a,r)=>this.create({...r,type:"loading",message:a}),this.promise=(a,r)=>{if(!r)return;let s;r.loading!==void 0&&(s=this.create({...r,promise:a,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const l=Promise.resolve(a instanceof Function?a():a);let c=s!==void 0,f;const h=l.then(async m=>{if(f=["resolve",m],J.isValidElement(m))c=!1,this.create({id:s,type:"default",message:m});else if(t4(m)&&!m.ok){c=!1;const g=typeof r.error=="function"?await r.error(`HTTP error! status: ${m.status}`):r.error,y=typeof r.description=="function"?await r.description(`HTTP error! status: ${m.status}`):r.description,S=typeof g=="object"&&!J.isValidElement(g)?g:{message:g};this.create({id:s,type:"error",description:y,...S})}else if(m instanceof Error){c=!1;const g=typeof r.error=="function"?await r.error(m):r.error,y=typeof r.description=="function"?await r.description(m):r.description,S=typeof g=="object"&&!J.isValidElement(g)?g:{message:g};this.create({id:s,type:"error",description:y,...S})}else if(r.success!==void 0){c=!1;const g=typeof r.success=="function"?await r.success(m):r.success,y=typeof r.description=="function"?await r.description(m):r.description,S=typeof g=="object"&&!J.isValidElement(g)?g:{message:g};this.create({id:s,type:"success",description:y,...S})}}).catch(async m=>{if(f=["reject",m],r.error!==void 0){c=!1;const v=typeof r.error=="function"?await r.error(m):r.error,g=typeof r.description=="function"?await r.description(m):r.description,x=typeof v=="object"&&!J.isValidElement(v)?v:{message:v};this.create({id:s,type:"error",description:g,...x})}}).finally(()=>{c&&(this.dismiss(s),s=void 0),r.finally==null||r.finally.call(r)}),p=()=>new Promise((m,v)=>h.then(()=>f[0]==="reject"?v(f[1]):m(f[1])).catch(v));return typeof s!="string"&&typeof s!="number"?{unwrap:p}:Object.assign(s,{unwrap:p})},this.custom=(a,r)=>{const s=r?.id||Vd++;return this.create({jsx:a(s),id:s,...r}),s},this.getActiveToasts=()=>this.toasts.filter(a=>!this.dismissedToasts.has(a.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const je=new WM,JM=(e,a)=>{const r=a?.id||Vd++;return je.addToast({title:e,...a,id:r}),r},t4=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",e4=JM,n4=()=>je.toasts,a4=()=>je.getActiveToasts(),a0=Object.assign(e4,{success:je.success,info:je.info,warning:je.warning,error:je.error,custom:je.custom,message:je.message,promise:je.promise,dismiss:je.dismiss,loading:je.loading},{getHistory:n4,getToasts:a4});VM("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function kl(e){return e.label!==void 0}const r4=3,i4="24px",s4="16px",r0=4e3,o4=356,l4=14,c4=45,u4=200;function Mn(...e){return e.filter(Boolean).join(" ")}function f4(e){const[a,r]=e.split("-"),s=[];return a&&s.push(a),r&&s.push(r),s}const d4=e=>{var a,r,s,l,c,f,h,p,m;const{invert:v,toast:g,unstyled:y,interacting:x,setHeights:S,visibleToasts:w,heights:T,index:C,toasts:j,expanded:L,removeToast:U,defaultRichColors:N,closeButton:F,style:G,cancelButtonStyle:q,actionButtonStyle:et,className:W="",descriptionClassName:at="",duration:st,position:mt,gap:ht,expandByDefault:yt,classNames:D,icons:K,closeButtonAriaLabel:V="Close toast"}=e,[ft,O]=J.useState(null),[$,nt]=J.useState(null),[Q,tt]=J.useState(!1),[it,rt]=J.useState(!1),[vt,ut]=J.useState(!1),[kt,re]=J.useState(!1),[Yt,ie]=J.useState(!1),[Ke,xn]=J.useState(0),[ki,_r]=J.useState(0),fe=J.useRef(g.duration||st||r0),Bn=J.useRef(null),ve=J.useRef(null),Ga=C===0,kn=C+1<=w,Rt=g.type,Vt=g.dismissible!==!1,Xe=g.className||"",ho=g.descriptionClassName||"",wn=J.useMemo(()=>T.findIndex(St=>St.toastId===g.id)||0,[T,g.id]),Te=J.useMemo(()=>{var St;return(St=g.closeButton)!=null?St:F},[g.closeButton,F]),dn=J.useMemo(()=>g.duration||st||r0,[g.duration,st]),ye=J.useRef(0),la=J.useRef(0),mo=J.useRef(0),ca=J.useRef(null),[Tr,Cr]=mt.split("-"),En=J.useMemo(()=>T.reduce((St,$t,ee)=>ee>=wn?St:St+$t.height,0),[T,wn]),Ya=IM(),Fa=g.invert||v,Hi=Rt==="loading";la.current=J.useMemo(()=>wn*ht+En,[wn,En]),J.useEffect(()=>{fe.current=dn},[dn]),J.useEffect(()=>{tt(!0)},[]),J.useEffect(()=>{const St=ve.current;if(St){const $t=St.getBoundingClientRect().height;return _r($t),S(ee=>[{toastId:g.id,height:$t,position:g.position},...ee]),()=>S(ee=>ee.filter(be=>be.toastId!==g.id))}},[S,g.id]),J.useLayoutEffect(()=>{if(!Q)return;const St=ve.current,$t=St.style.height;St.style.height="auto";const ee=St.getBoundingClientRect().height;St.style.height=$t,_r(ee),S(be=>be.find(se=>se.toastId===g.id)?be.map(se=>se.toastId===g.id?{...se,height:ee}:se):[{toastId:g.id,height:ee,position:g.position},...be])},[Q,g.title,g.description,S,g.id,g.jsx,g.action,g.cancel]);const hn=J.useCallback(()=>{rt(!0),xn(la.current),S(St=>St.filter($t=>$t.toastId!==g.id)),setTimeout(()=>{U(g)},u4)},[g,U,S,la]);J.useEffect(()=>{if(g.promise&&Rt==="loading"||g.duration===1/0||g.type==="loading")return;let St;return L||x||Ya?(()=>{if(mo.current<ye.current){const be=new Date().getTime()-ye.current;fe.current=fe.current-be}mo.current=new Date().getTime()})():(()=>{fe.current!==1/0&&(ye.current=new Date().getTime(),St=setTimeout(()=>{g.onAutoClose==null||g.onAutoClose.call(g,g),hn()},fe.current))})(),()=>clearTimeout(St)},[L,x,g,Rt,Ya,hn]),J.useEffect(()=>{g.delete&&(hn(),g.onDismiss==null||g.onDismiss.call(g,g))},[hn,g.delete]);function po(){var St;if(K?.loading){var $t;return J.createElement("div",{className:Mn(D?.loader,g==null||($t=g.classNames)==null?void 0:$t.loader,"sonner-loader"),"data-visible":Rt==="loading"},K.loading)}return J.createElement(FM,{className:Mn(D?.loader,g==null||(St=g.classNames)==null?void 0:St.loader),visible:Rt==="loading"})}const qi=g.icon||K?.[Rt]||GM(Rt);var ua,go;return J.createElement("li",{tabIndex:0,ref:ve,className:Mn(W,Xe,D?.toast,g==null||(a=g.classNames)==null?void 0:a.toast,D?.default,D?.[Rt],g==null||(r=g.classNames)==null?void 0:r[Rt]),"data-sonner-toast":"","data-rich-colors":(ua=g.richColors)!=null?ua:N,"data-styled":!(g.jsx||g.unstyled||y),"data-mounted":Q,"data-promise":!!g.promise,"data-swiped":Yt,"data-removed":it,"data-visible":kn,"data-y-position":Tr,"data-x-position":Cr,"data-index":C,"data-front":Ga,"data-swiping":vt,"data-dismissible":Vt,"data-type":Rt,"data-invert":Fa,"data-swipe-out":kt,"data-swipe-direction":$,"data-expanded":!!(L||yt&&Q),"data-testid":g.testId,style:{"--index":C,"--toasts-before":C,"--z-index":j.length-C,"--offset":`${it?Ke:la.current}px`,"--initial-height":yt?"auto":`${ki}px`,...G,...g.style},onDragEnd:()=>{ut(!1),O(null),ca.current=null},onPointerDown:St=>{St.button!==2&&(Hi||!Vt||(Bn.current=new Date,xn(la.current),St.target.setPointerCapture(St.pointerId),St.target.tagName!=="BUTTON"&&(ut(!0),ca.current={x:St.clientX,y:St.clientY})))},onPointerUp:()=>{var St,$t,ee;if(kt||!Vt)return;ca.current=null;const be=Number(((St=ve.current)==null?void 0:St.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Qa=Number((($t=ve.current)==null?void 0:$t.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),se=new Date().getTime()-((ee=Bn.current)==null?void 0:ee.getTime()),Zt=ft==="x"?be:Qa,It=Math.abs(Zt)/se;if(Math.abs(Zt)>=c4||It>.11){xn(la.current),g.onDismiss==null||g.onDismiss.call(g,g),nt(ft==="x"?be>0?"right":"left":Qa>0?"down":"up"),hn(),re(!0);return}else{var Ht,de;(Ht=ve.current)==null||Ht.style.setProperty("--swipe-amount-x","0px"),(de=ve.current)==null||de.style.setProperty("--swipe-amount-y","0px")}ie(!1),ut(!1),O(null)},onPointerMove:St=>{var $t,ee,be;if(!ca.current||!Vt||(($t=window.getSelection())==null?void 0:$t.toString().length)>0)return;const se=St.clientY-ca.current.y,Zt=St.clientX-ca.current.x;var It;const Ht=(It=e.swipeDirections)!=null?It:f4(mt);!ft&&(Math.abs(Zt)>1||Math.abs(se)>1)&&O(Math.abs(Zt)>Math.abs(se)?"x":"y");let de={x:0,y:0};const Ar=Hn=>1/(1.5+Math.abs(Hn)/20);if(ft==="y"){if(Ht.includes("top")||Ht.includes("bottom"))if(Ht.includes("top")&&se<0||Ht.includes("bottom")&&se>0)de.y=se;else{const Hn=se*Ar(se);de.y=Math.abs(Hn)<Math.abs(se)?Hn:se}}else if(ft==="x"&&(Ht.includes("left")||Ht.includes("right")))if(Ht.includes("left")&&Zt<0||Ht.includes("right")&&Zt>0)de.x=Zt;else{const Hn=Zt*Ar(Zt);de.x=Math.abs(Hn)<Math.abs(Zt)?Hn:Zt}(Math.abs(de.x)>0||Math.abs(de.y)>0)&&ie(!0),(ee=ve.current)==null||ee.style.setProperty("--swipe-amount-x",`${de.x}px`),(be=ve.current)==null||be.style.setProperty("--swipe-amount-y",`${de.y}px`)}},Te&&!g.jsx&&Rt!=="loading"?J.createElement("button",{"aria-label":V,"data-disabled":Hi,"data-close-button":!0,onClick:Hi||!Vt?()=>{}:()=>{hn(),g.onDismiss==null||g.onDismiss.call(g,g)},className:Mn(D?.closeButton,g==null||(s=g.classNames)==null?void 0:s.closeButton)},(go=K?.close)!=null?go:ZM):null,(Rt||g.icon||g.promise)&&g.icon!==null&&(K?.[Rt]!==null||g.icon)?J.createElement("div",{"data-icon":"",className:Mn(D?.icon,g==null||(l=g.classNames)==null?void 0:l.icon)},g.promise||g.type==="loading"&&!g.icon?g.icon||po():null,g.type!=="loading"?qi:null):null,J.createElement("div",{"data-content":"",className:Mn(D?.content,g==null||(c=g.classNames)==null?void 0:c.content)},J.createElement("div",{"data-title":"",className:Mn(D?.title,g==null||(f=g.classNames)==null?void 0:f.title)},g.jsx?g.jsx:typeof g.title=="function"?g.title():g.title),g.description?J.createElement("div",{"data-description":"",className:Mn(at,ho,D?.description,g==null||(h=g.classNames)==null?void 0:h.description)},typeof g.description=="function"?g.description():g.description):null),J.isValidElement(g.cancel)?g.cancel:g.cancel&&kl(g.cancel)?J.createElement("button",{"data-button":!0,"data-cancel":!0,style:g.cancelButtonStyle||q,onClick:St=>{kl(g.cancel)&&Vt&&(g.cancel.onClick==null||g.cancel.onClick.call(g.cancel,St),hn())},className:Mn(D?.cancelButton,g==null||(p=g.classNames)==null?void 0:p.cancelButton)},g.cancel.label):null,J.isValidElement(g.action)?g.action:g.action&&kl(g.action)?J.createElement("button",{"data-button":!0,"data-action":!0,style:g.actionButtonStyle||et,onClick:St=>{kl(g.action)&&(g.action.onClick==null||g.action.onClick.call(g.action,St),!St.defaultPrevented&&hn())},className:Mn(D?.actionButton,g==null||(m=g.classNames)==null?void 0:m.actionButton)},g.action.label):null)};function i0(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function h4(e,a){const r={};return[e,a].forEach((s,l)=>{const c=l===1,f=c?"--mobile-offset":"--offset",h=c?s4:i4;function p(m){["top","right","bottom","left"].forEach(v=>{r[`${f}-${v}`]=typeof m=="number"?`${m}px`:m})}typeof s=="number"||typeof s=="string"?p(s):typeof s=="object"?["top","right","bottom","left"].forEach(m=>{s[m]===void 0?r[`${f}-${m}`]=h:r[`${f}-${m}`]=typeof s[m]=="number"?`${s[m]}px`:s[m]}):p(h)}),r}const m4=J.forwardRef(function(a,r){const{id:s,invert:l,position:c="bottom-right",hotkey:f=["altKey","KeyT"],expand:h,closeButton:p,className:m,offset:v,mobileOffset:g,theme:y="light",richColors:x,duration:S,style:w,visibleToasts:T=r4,toastOptions:C,dir:j=i0(),gap:L=l4,icons:U,containerAriaLabel:N="Notifications"}=a,[F,G]=J.useState([]),q=J.useMemo(()=>s?F.filter(Q=>Q.toasterId===s):F.filter(Q=>!Q.toasterId),[F,s]),et=J.useMemo(()=>Array.from(new Set([c].concat(q.filter(Q=>Q.position).map(Q=>Q.position)))),[q,c]),[W,at]=J.useState([]),[st,mt]=J.useState(!1),[ht,yt]=J.useState(!1),[D,K]=J.useState(y!=="system"?y:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),V=J.useRef(null),ft=f.join("+").replace(/Key/g,"").replace(/Digit/g,""),O=J.useRef(null),$=J.useRef(!1),nt=J.useCallback(Q=>{G(tt=>{var it;return(it=tt.find(rt=>rt.id===Q.id))!=null&&it.delete||je.dismiss(Q.id),tt.filter(({id:rt})=>rt!==Q.id)})},[]);return J.useEffect(()=>je.subscribe(Q=>{if(Q.dismiss){requestAnimationFrame(()=>{G(tt=>tt.map(it=>it.id===Q.id?{...it,delete:!0}:it))});return}setTimeout(()=>{P0.flushSync(()=>{G(tt=>{const it=tt.findIndex(rt=>rt.id===Q.id);return it!==-1?[...tt.slice(0,it),{...tt[it],...Q},...tt.slice(it+1)]:[Q,...tt]})})})}),[F]),J.useEffect(()=>{if(y!=="system"){K(y);return}if(y==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?K("dark"):K("light")),typeof window>"u")return;const Q=window.matchMedia("(prefers-color-scheme: dark)");try{Q.addEventListener("change",({matches:tt})=>{K(tt?"dark":"light")})}catch{Q.addListener(({matches:it})=>{try{K(it?"dark":"light")}catch(rt){console.error(rt)}})}},[y]),J.useEffect(()=>{F.length<=1&&mt(!1)},[F]),J.useEffect(()=>{const Q=tt=>{var it;if(f.every(ut=>tt[ut]||tt.code===ut)){var vt;mt(!0),(vt=V.current)==null||vt.focus()}tt.code==="Escape"&&(document.activeElement===V.current||(it=V.current)!=null&&it.contains(document.activeElement))&&mt(!1)};return document.addEventListener("keydown",Q),()=>document.removeEventListener("keydown",Q)},[f]),J.useEffect(()=>{if(V.current)return()=>{O.current&&(O.current.focus({preventScroll:!0}),O.current=null,$.current=!1)}},[V.current]),J.createElement("section",{ref:r,"aria-label":`${N} ${ft}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},et.map((Q,tt)=>{var it;const[rt,vt]=Q.split("-");return q.length?J.createElement("ol",{key:Q,dir:j==="auto"?i0():j,tabIndex:-1,ref:V,className:m,"data-sonner-toaster":!0,"data-sonner-theme":D,"data-y-position":rt,"data-x-position":vt,style:{"--front-toast-height":`${((it=W[0])==null?void 0:it.height)||0}px`,"--width":`${o4}px`,"--gap":`${L}px`,...w,...h4(v,g)},onBlur:ut=>{$.current&&!ut.currentTarget.contains(ut.relatedTarget)&&($.current=!1,O.current&&(O.current.focus({preventScroll:!0}),O.current=null))},onFocus:ut=>{ut.target instanceof HTMLElement&&ut.target.dataset.dismissible==="false"||$.current||($.current=!0,O.current=ut.relatedTarget)},onMouseEnter:()=>mt(!0),onMouseMove:()=>mt(!0),onMouseLeave:()=>{ht||mt(!1)},onDragEnd:()=>mt(!1),onPointerDown:ut=>{ut.target instanceof HTMLElement&&ut.target.dataset.dismissible==="false"||yt(!0)},onPointerUp:()=>yt(!1)},q.filter(ut=>!ut.position&&tt===0||ut.position===Q).map((ut,kt)=>{var re,Yt;return J.createElement(d4,{key:ut.id,icons:U,index:kt,toast:ut,defaultRichColors:x,duration:(re=C?.duration)!=null?re:S,className:C?.className,descriptionClassName:C?.descriptionClassName,invert:l,visibleToasts:T,closeButton:(Yt=C?.closeButton)!=null?Yt:p,interacting:ht,position:Q,style:C?.style,unstyled:C?.unstyled,classNames:C?.classNames,cancelButtonStyle:C?.cancelButtonStyle,actionButtonStyle:C?.actionButtonStyle,closeButtonAriaLabel:C?.closeButtonAriaLabel,removeToast:nt,toasts:q.filter(ie=>ie.position==ut.position),heights:W.filter(ie=>ie.position==ut.position),setHeights:at,expandByDefault:h,gap:L,expanded:st,swipeDirections:a.swipeDirections})})):null}))});var Ui=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(){}},xr=typeof window>"u"||"Deno"in globalThis;function Ae(){}function p4(e,a){return typeof e=="function"?e(a):e}function Gd(e){return typeof e=="number"&&e>=0&&e!==1/0}function I1(e,a){return Math.max(e+(a||0)-Date.now(),0)}function Ba(e,a){return typeof e=="function"?e(a):e}function on(e,a){return typeof e=="function"?e(a):e}function s0(e,a){const{type:r="all",exact:s,fetchStatus:l,predicate:c,queryKey:f,stale:h}=e;if(f){if(s){if(a.queryHash!==zh(f,a.options))return!1}else if(!Js(a.queryKey,f))return!1}if(r!=="all"){const p=a.isActive();if(r==="active"&&!p||r==="inactive"&&p)return!1}return!(typeof h=="boolean"&&a.isStale()!==h||l&&l!==a.state.fetchStatus||c&&!c(a))}function o0(e,a){const{exact:r,status:s,predicate:l,mutationKey:c}=e;if(c){if(!a.options.mutationKey)return!1;if(r){if(wr(a.options.mutationKey)!==wr(c))return!1}else if(!Js(a.options.mutationKey,c))return!1}return!(s&&a.state.status!==s||l&&!l(a))}function zh(e,a){return(a?.queryKeyHashFn||wr)(e)}function wr(e){return JSON.stringify(e,(a,r)=>Yd(r)?Object.keys(r).sort().reduce((s,l)=>(s[l]=r[l],s),{}):r)}function Js(e,a){return e===a?!0:typeof e!=typeof a?!1:e&&a&&typeof e=="object"&&typeof a=="object"?Object.keys(a).every(r=>Js(e[r],a[r])):!1}function W1(e,a){if(e===a)return e;const r=l0(e)&&l0(a);if(r||Yd(e)&&Yd(a)){const s=r?e:Object.keys(e),l=s.length,c=r?a:Object.keys(a),f=c.length,h=r?[]:{},p=new Set(s);let m=0;for(let v=0;v<f;v++){const g=r?v:c[v];(!r&&p.has(g)||r)&&e[g]===void 0&&a[g]===void 0?(h[g]=void 0,m++):(h[g]=W1(e[g],a[g]),h[g]===e[g]&&e[g]!==void 0&&m++)}return l===f&&m===l?e:h}return a}function uc(e,a){if(!a||Object.keys(e).length!==Object.keys(a).length)return!1;for(const r in e)if(e[r]!==a[r])return!1;return!0}function l0(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Yd(e){if(!c0(e))return!1;const a=e.constructor;if(a===void 0)return!0;const r=a.prototype;return!(!c0(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function c0(e){return Object.prototype.toString.call(e)==="[object Object]"}function g4(e){return new Promise(a=>{setTimeout(a,e)})}function Fd(e,a,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,a):r.structuralSharing!==!1?W1(e,a):a}function v4(e,a,r=0){const s=[...e,a];return r&&s.length>r?s.slice(1):s}function y4(e,a,r=0){const s=[a,...e];return r&&s.length>r?s.slice(0,-1):s}var Ph=Symbol();function J1(e,a){return!e.queryFn&&a?.initialPromise?()=>a.initialPromise:!e.queryFn||e.queryFn===Ph?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function tS(e,a){return typeof e=="function"?e(...a):!!e}var b4=class extends Ui{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!xr&&window.addEventListener){const a=()=>e();return window.addEventListener("visibilitychange",a,!1),()=>{window.removeEventListener("visibilitychange",a)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(a=>{a(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Uh=new b4,S4=class extends Ui{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!xr&&window.addEventListener){const a=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",a,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",a),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(r=>{r(e)}))}isOnline(){return this.#e}},fc=new S4;function Qd(){let e,a;const r=new Promise((l,c)=>{e=l,a=c});r.status="pending",r.catch(()=>{});function s(l){Object.assign(r,l),delete r.resolve,delete r.reject}return r.resolve=l=>{s({status:"fulfilled",value:l}),e(l)},r.reject=l=>{s({status:"rejected",reason:l}),a(l)},r}function x4(e){return Math.min(1e3*2**e,3e4)}function eS(e){return(e??"online")==="online"?fc.isOnline():!0}var nS=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function aS(e){let a=!1,r=0,s;const l=Qd(),c=()=>l.status!=="pending",f=w=>{c()||(y(new nS(w)),e.abort?.())},h=()=>{a=!0},p=()=>{a=!1},m=()=>Uh.isFocused()&&(e.networkMode==="always"||fc.isOnline())&&e.canRun(),v=()=>eS(e.networkMode)&&e.canRun(),g=w=>{c()||(s?.(),l.resolve(w))},y=w=>{c()||(s?.(),l.reject(w))},x=()=>new Promise(w=>{s=T=>{(c()||m())&&w(T)},e.onPause?.()}).then(()=>{s=void 0,c()||e.onContinue?.()}),S=()=>{if(c())return;let w;const T=r===0?e.initialPromise:void 0;try{w=T??e.fn()}catch(C){w=Promise.reject(C)}Promise.resolve(w).then(g).catch(C=>{if(c())return;const j=e.retry??(xr?0:3),L=e.retryDelay??x4,U=typeof L=="function"?L(r,C):L,N=j===!0||typeof j=="number"&&r<j||typeof j=="function"&&j(r,C);if(a||!N){y(C);return}r++,e.onFail?.(r,C),g4(U).then(()=>m()?void 0:x()).then(()=>{a?y(C):S()})})};return{promise:l,status:()=>l.status,cancel:f,continue:()=>(s?.(),l),cancelRetry:h,continueRetry:p,canStart:v,start:()=>(v()?S():x().then(S),l)}}var w4=e=>setTimeout(e,0);function E4(){let e=[],a=0,r=h=>{h()},s=h=>{h()},l=w4;const c=h=>{a?e.push(h):l(()=>{r(h)})},f=()=>{const h=e;e=[],h.length&&l(()=>{s(()=>{h.forEach(p=>{r(p)})})})};return{batch:h=>{let p;a++;try{p=h()}finally{a--,a||f()}return p},batchCalls:h=>(...p)=>{c(()=>{h(...p)})},schedule:c,setNotifyFunction:h=>{r=h},setBatchNotifyFunction:h=>{s=h},setScheduler:h=>{l=h}}}var ue=E4(),rS=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Gd(this.gcTime)&&(this.#e=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(xr?1/0:300*1e3))}clearGcTimeout(){this.#e&&(clearTimeout(this.#e),this.#e=void 0)}},R4=class extends rS{#e;#t;#n;#a;#r;#s;#o;constructor(e){super(),this.#o=!1,this.#s=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#a=e.client,this.#n=this.#a.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=_4(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){this.options={...this.#s,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,a){const r=Fd(this.state.data,e,this.options);return this.#i({data:r,type:"success",dataUpdatedAt:a?.updatedAt,manual:a?.manual}),r}setState(e,a){this.#i({type:"setState",state:e,setStateOptions:a})}cancel(e){const a=this.#r?.promise;return this.#r?.cancel(e),a?a.then(Ae).catch(Ae):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>on(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ph||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Ba(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!I1(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(a=>a.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(a=>a.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(a=>a!==e),this.observers.length||(this.#r&&(this.#o?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}async fetch(e,a){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&a?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const h=this.observers.find(p=>p.options.queryFn);h&&this.setOptions(h.options)}const r=new AbortController,s=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(this.#o=!0,r.signal)})},l=()=>{const h=J1(this.options,a),m=(()=>{const v={client:this.#a,queryKey:this.queryKey,meta:this.meta};return s(v),v})();return this.#o=!1,this.options.persister?this.options.persister(h,m,this):h(m)},f=(()=>{const h={fetchOptions:a,options:this.options,queryKey:this.queryKey,client:this.#a,state:this.state,fetchFn:l};return s(h),h})();this.options.behavior?.onFetch(f,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==f.fetchOptions?.meta)&&this.#i({type:"fetch",meta:f.fetchOptions?.meta}),this.#r=aS({initialPromise:a?.initialPromise,fn:f.fetchFn,abort:r.abort.bind(r),onFail:(h,p)=>{this.#i({type:"failed",failureCount:h,error:p})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.options.networkMode,canRun:()=>!0});try{const h=await this.#r.start();if(h===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(h),this.#n.config.onSuccess?.(h,this),this.#n.config.onSettled?.(h,this.state.error,this),h}catch(h){if(h instanceof nS){if(h.silent)return this.#r.promise;if(h.revert){if(this.setState({...this.#t,fetchStatus:"idle"}),this.state.data===void 0)throw h;return this.state.data}}throw this.#i({type:"error",error:h}),this.#n.config.onError?.(h,this),this.#n.config.onSettled?.(this.state.data,h,this),h}finally{this.scheduleGc()}}#i(e){const a=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...iS(r.data,this.options),fetchMeta:e.meta??null};case"success":const s={...r,data:e.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?s:void 0,s;case"error":const l=e.error;return{...r,error:l,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:l,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=a(this.state),ue.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function iS(e,a){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:eS(a.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function _4(e){const a=typeof e.initialData=="function"?e.initialData():e.initialData,r=a!==void 0,s=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:a,dataUpdateCount:0,dataUpdatedAt:r?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var T4=class extends Ui{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,a,r){const s=a.queryKey,l=a.queryHash??zh(s,a);let c=this.get(l);return c||(c=new R4({client:e,queryKey:s,queryHash:l,options:e.defaultQueryOptions(a),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(c)),c}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const a=this.#e.get(e.queryHash);a&&(e.destroy(),a===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){ue.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const a={exact:!0,...e};return this.getAll().find(r=>s0(a,r))}findAll(e={}){const a=this.getAll();return Object.keys(e).length>0?a.filter(r=>s0(e,r)):a}notify(e){ue.batch(()=>{this.listeners.forEach(a=>{a(e)})})}onFocus(){ue.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ue.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},C4=class extends rS{#e;#t;#n;constructor(e){super(),this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#e=[],this.state=e.state||sS(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#e.includes(e)||(this.#e.push(e),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(a=>a!==e),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#t.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(e){const a=()=>{this.#a({type:"continue"})};this.#n=aS({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(l,c)=>{this.#a({type:"failed",failureCount:l,error:c})},onPause:()=>{this.#a({type:"pause"})},onContinue:a,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});const r=this.state.status==="pending",s=!this.#n.canStart();try{if(r)a();else{this.#a({type:"pending",variables:e,isPaused:s}),await this.#t.config.onMutate?.(e,this);const c=await this.options.onMutate?.(e);c!==this.state.context&&this.#a({type:"pending",context:c,variables:e,isPaused:s})}const l=await this.#n.start();return await this.#t.config.onSuccess?.(l,e,this.state.context,this),await this.options.onSuccess?.(l,e,this.state.context),await this.#t.config.onSettled?.(l,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(l,null,e,this.state.context),this.#a({type:"success",data:l}),l}catch(l){try{throw await this.#t.config.onError?.(l,e,this.state.context,this),await this.options.onError?.(l,e,this.state.context),await this.#t.config.onSettled?.(void 0,l,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,l,e,this.state.context),l}finally{this.#a({type:"error",error:l})}}finally{this.#t.runNext(this)}}#a(e){const a=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=a(this.state),ue.batch(()=>{this.#e.forEach(r=>{r.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function sS(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var A4=class extends Ui{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,a,r){const s=new C4({mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(a),state:r});return this.add(s),s}add(e){this.#e.add(e);const a=Hl(e);if(typeof a=="string"){const r=this.#t.get(a);r?r.push(e):this.#t.set(a,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const a=Hl(e);if(typeof a=="string"){const r=this.#t.get(a);if(r)if(r.length>1){const s=r.indexOf(e);s!==-1&&r.splice(s,1)}else r[0]===e&&this.#t.delete(a)}}this.notify({type:"removed",mutation:e})}canRun(e){const a=Hl(e);if(typeof a=="string"){const s=this.#t.get(a)?.find(l=>l.state.status==="pending");return!s||s===e}else return!0}runNext(e){const a=Hl(e);return typeof a=="string"?this.#t.get(a)?.find(s=>s!==e&&s.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){ue.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const a={exact:!0,...e};return this.getAll().find(r=>o0(a,r))}findAll(e={}){return this.getAll().filter(a=>o0(e,a))}notify(e){ue.batch(()=>{this.listeners.forEach(a=>{a(e)})})}resumePausedMutations(){const e=this.getAll().filter(a=>a.state.isPaused);return ue.batch(()=>Promise.all(e.map(a=>a.continue().catch(Ae))))}};function Hl(e){return e.options.scope?.id}function u0(e){return{onFetch:(a,r)=>{const s=a.options,l=a.fetchOptions?.meta?.fetchMore?.direction,c=a.state.data?.pages||[],f=a.state.data?.pageParams||[];let h={pages:[],pageParams:[]},p=0;const m=async()=>{let v=!1;const g=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(a.signal.aborted?v=!0:a.signal.addEventListener("abort",()=>{v=!0}),a.signal)})},y=J1(a.options,a.fetchOptions),x=async(S,w,T)=>{if(v)return Promise.reject();if(w==null&&S.pages.length)return Promise.resolve(S);const j=(()=>{const F={client:a.client,queryKey:a.queryKey,pageParam:w,direction:T?"backward":"forward",meta:a.options.meta};return g(F),F})(),L=await y(j),{maxPages:U}=a.options,N=T?y4:v4;return{pages:N(S.pages,L,U),pageParams:N(S.pageParams,w,U)}};if(l&&c.length){const S=l==="backward",w=S?O4:f0,T={pages:c,pageParams:f},C=w(s,T);h=await x(T,C,S)}else{const S=e??c.length;do{const w=p===0?f[0]??s.initialPageParam:f0(s,h);if(p>0&&w==null)break;h=await x(h,w),p++}while(p<S)}return h};a.options.persister?a.fetchFn=()=>a.options.persister?.(m,{client:a.client,queryKey:a.queryKey,meta:a.options.meta,signal:a.signal},r):a.fetchFn=m}}}function f0(e,{pages:a,pageParams:r}){const s=a.length-1;return a.length>0?e.getNextPageParam(a[s],a,r[s],r):void 0}function O4(e,{pages:a,pageParams:r}){return a.length>0?e.getPreviousPageParam?.(a[0],a,r[0],r):void 0}var M4=class{#e;#t;#n;#a;#r;#s;#o;#i;constructor(e={}){this.#e=e.queryCache||new T4,this.#t=e.mutationCache||new A4,this.#n=e.defaultOptions||{},this.#a=new Map,this.#r=new Map,this.#s=0}mount(){this.#s++,this.#s===1&&(this.#o=Uh.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=fc.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#s--,this.#s===0&&(this.#o?.(),this.#o=void 0,this.#i?.(),this.#i=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const a=this.defaultQueryOptions({queryKey:e});return this.#e.get(a.queryHash)?.state.data}ensureQueryData(e){const a=this.defaultQueryOptions(e),r=this.#e.build(this,a),s=r.state.data;return s===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Ba(a.staleTime,r))&&this.prefetchQuery(a),Promise.resolve(s))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:a,state:r})=>{const s=r.data;return[a,s]})}setQueryData(e,a,r){const s=this.defaultQueryOptions({queryKey:e}),c=this.#e.get(s.queryHash)?.state.data,f=p4(a,c);if(f!==void 0)return this.#e.build(this,s).setData(f,{...r,manual:!0})}setQueriesData(e,a,r){return ue.batch(()=>this.#e.findAll(e).map(({queryKey:s})=>[s,this.setQueryData(s,a,r)]))}getQueryState(e){const a=this.defaultQueryOptions({queryKey:e});return this.#e.get(a.queryHash)?.state}removeQueries(e){const a=this.#e;ue.batch(()=>{a.findAll(e).forEach(r=>{a.remove(r)})})}resetQueries(e,a){const r=this.#e;return ue.batch(()=>(r.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...e},a)))}cancelQueries(e,a={}){const r={revert:!0,...a},s=ue.batch(()=>this.#e.findAll(e).map(l=>l.cancel(r)));return Promise.all(s).then(Ae).catch(Ae)}invalidateQueries(e,a={}){return ue.batch(()=>(this.#e.findAll(e).forEach(r=>{r.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},a)))}refetchQueries(e,a={}){const r={...a,cancelRefetch:a.cancelRefetch??!0},s=ue.batch(()=>this.#e.findAll(e).filter(l=>!l.isDisabled()&&!l.isStatic()).map(l=>{let c=l.fetch(void 0,r);return r.throwOnError||(c=c.catch(Ae)),l.state.fetchStatus==="paused"?Promise.resolve():c}));return Promise.all(s).then(Ae)}fetchQuery(e){const a=this.defaultQueryOptions(e);a.retry===void 0&&(a.retry=!1);const r=this.#e.build(this,a);return r.isStaleByTime(Ba(a.staleTime,r))?r.fetch(a):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ae).catch(Ae)}fetchInfiniteQuery(e){return e.behavior=u0(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ae).catch(Ae)}ensureInfiniteQueryData(e){return e.behavior=u0(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return fc.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,a){this.#a.set(wr(e),{queryKey:e,defaultOptions:a})}getQueryDefaults(e){const a=[...this.#a.values()],r={};return a.forEach(s=>{Js(e,s.queryKey)&&Object.assign(r,s.defaultOptions)}),r}setMutationDefaults(e,a){this.#r.set(wr(e),{mutationKey:e,defaultOptions:a})}getMutationDefaults(e){const a=[...this.#r.values()],r={};return a.forEach(s=>{Js(e,s.mutationKey)&&Object.assign(r,s.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const a={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return a.queryHash||(a.queryHash=zh(a.queryKey,a)),a.refetchOnReconnect===void 0&&(a.refetchOnReconnect=a.networkMode!=="always"),a.throwOnError===void 0&&(a.throwOnError=!!a.suspense),!a.networkMode&&a.persister&&(a.networkMode="offlineFirst"),a.queryFn===Ph&&(a.enabled=!1),a}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},D4=class extends Ui{constructor(e,a){super(),this.options=a,this.#e=e,this.#i=null,this.#o=Qd(),this.bindMethods(),this.setOptions(a)}#e;#t=void 0;#n=void 0;#a=void 0;#r;#s;#o;#i;#p;#d;#h;#c;#u;#l;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),d0(this.#t,this.options)?this.#f():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Kd(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Kd(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#S(),this.#x(),this.#t.removeObserver(this)}setOptions(e){const a=this.options,r=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof on(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#t.setOptions(this.options),a._defaulted&&!uc(this.options,a)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const s=this.hasListeners();s&&h0(this.#t,r,this.options,a)&&this.#f(),this.updateResult(),s&&(this.#t!==r||on(this.options.enabled,this.#t)!==on(a.enabled,this.#t)||Ba(this.options.staleTime,this.#t)!==Ba(a.staleTime,this.#t))&&this.#g();const l=this.#v();s&&(this.#t!==r||on(this.options.enabled,this.#t)!==on(a.enabled,this.#t)||l!==this.#l)&&this.#y(l)}getOptimisticResult(e){const a=this.#e.getQueryCache().build(this.#e,e),r=this.createResult(a,e);return L4(this,r)&&(this.#a=r,this.#s=this.options,this.#r=this.#t.state),r}getCurrentResult(){return this.#a}trackResult(e,a){return new Proxy(e,{get:(r,s)=>(this.trackProp(s),a?.(s),s==="promise"&&!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled")),Reflect.get(r,s))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const a=this.#e.defaultQueryOptions(e),r=this.#e.getQueryCache().build(this.#e,a);return r.fetch().then(()=>this.createResult(r,a))}fetch(e){return this.#f({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#a))}#f(e){this.#w();let a=this.#t.fetch(this.options,e);return e?.throwOnError||(a=a.catch(Ae)),a}#g(){this.#S();const e=Ba(this.options.staleTime,this.#t);if(xr||this.#a.isStale||!Gd(e))return;const r=I1(this.#a.dataUpdatedAt,e)+1;this.#c=setTimeout(()=>{this.#a.isStale||this.updateResult()},r)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(e){this.#x(),this.#l=e,!(xr||on(this.options.enabled,this.#t)===!1||!Gd(this.#l)||this.#l===0)&&(this.#u=setInterval(()=>{(this.options.refetchIntervalInBackground||Uh.isFocused())&&this.#f()},this.#l))}#b(){this.#g(),this.#y(this.#v())}#S(){this.#c&&(clearTimeout(this.#c),this.#c=void 0)}#x(){this.#u&&(clearInterval(this.#u),this.#u=void 0)}createResult(e,a){const r=this.#t,s=this.options,l=this.#a,c=this.#r,f=this.#s,p=e!==r?e.state:this.#n,{state:m}=e;let v={...m},g=!1,y;if(a._optimisticResults){const q=this.hasListeners(),et=!q&&d0(e,a),W=q&&h0(e,r,a,s);(et||W)&&(v={...v,...iS(m.data,e.options)}),a._optimisticResults==="isRestoring"&&(v.fetchStatus="idle")}let{error:x,errorUpdatedAt:S,status:w}=v;y=v.data;let T=!1;if(a.placeholderData!==void 0&&y===void 0&&w==="pending"){let q;l?.isPlaceholderData&&a.placeholderData===f?.placeholderData?(q=l.data,T=!0):q=typeof a.placeholderData=="function"?a.placeholderData(this.#h?.state.data,this.#h):a.placeholderData,q!==void 0&&(w="success",y=Fd(l?.data,q,a),g=!0)}if(a.select&&y!==void 0&&!T)if(l&&y===c?.data&&a.select===this.#p)y=this.#d;else try{this.#p=a.select,y=a.select(y),y=Fd(l?.data,y,a),this.#d=y,this.#i=null}catch(q){this.#i=q}this.#i&&(x=this.#i,y=this.#d,S=Date.now(),w="error");const C=v.fetchStatus==="fetching",j=w==="pending",L=w==="error",U=j&&C,N=y!==void 0,G={status:w,fetchStatus:v.fetchStatus,isPending:j,isSuccess:w==="success",isError:L,isInitialLoading:U,isLoading:U,data:y,dataUpdatedAt:v.dataUpdatedAt,error:x,errorUpdatedAt:S,failureCount:v.fetchFailureCount,failureReason:v.fetchFailureReason,errorUpdateCount:v.errorUpdateCount,isFetched:v.dataUpdateCount>0||v.errorUpdateCount>0,isFetchedAfterMount:v.dataUpdateCount>p.dataUpdateCount||v.errorUpdateCount>p.errorUpdateCount,isFetching:C,isRefetching:C&&!j,isLoadingError:L&&!N,isPaused:v.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:L&&N,isStale:Bh(e,a),refetch:this.refetch,promise:this.#o,isEnabled:on(a.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const q=at=>{G.status==="error"?at.reject(G.error):G.data!==void 0&&at.resolve(G.data)},et=()=>{const at=this.#o=G.promise=Qd();q(at)},W=this.#o;switch(W.status){case"pending":e.queryHash===r.queryHash&&q(W);break;case"fulfilled":(G.status==="error"||G.data!==W.value)&&et();break;case"rejected":(G.status!=="error"||G.error!==W.reason)&&et();break}}return G}updateResult(){const e=this.#a,a=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#s=this.options,this.#r.data!==void 0&&(this.#h=this.#t),uc(a,e))return;this.#a=a;const r=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,l=typeof s=="function"?s():s;if(l==="all"||!l&&!this.#m.size)return!0;const c=new Set(l??this.#m);return this.options.throwOnError&&c.add("error"),Object.keys(this.#a).some(f=>{const h=f;return this.#a[h]!==e[h]&&c.has(h)})};this.#E({listeners:r()})}#w(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const a=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(a?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#E(e){ue.batch(()=>{e.listeners&&this.listeners.forEach(a=>{a(this.#a)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function N4(e,a){return on(a.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&a.retryOnMount===!1)}function d0(e,a){return N4(e,a)||e.state.data!==void 0&&Kd(e,a,a.refetchOnMount)}function Kd(e,a,r){if(on(a.enabled,e)!==!1&&Ba(a.staleTime,e)!=="static"){const s=typeof r=="function"?r(e):r;return s==="always"||s!==!1&&Bh(e,a)}return!1}function h0(e,a,r,s){return(e!==a||on(s.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Bh(e,r)}function Bh(e,a){return on(a.enabled,e)!==!1&&e.isStaleByTime(Ba(a.staleTime,e))}function L4(e,a){return!uc(e.getCurrentResult(),a)}var j4=class extends Ui{#e;#t=void 0;#n;#a;constructor(a,r){super(),this.#e=a,this.setOptions(r),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(a){const r=this.options;this.options=this.#e.defaultMutationOptions(a),uc(this.options,r)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),r?.mutationKey&&this.options.mutationKey&&wr(r.mutationKey)!==wr(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(a){this.#r(),this.#s(a)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#r(),this.#s()}mutate(a,r){return this.#a=r,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(a)}#r(){const a=this.#n?.state??sS();this.#t={...a,isPending:a.status==="pending",isSuccess:a.status==="success",isError:a.status==="error",isIdle:a.status==="idle",mutate:this.mutate,reset:this.reset}}#s(a){ue.batch(()=>{if(this.#a&&this.hasListeners()){const r=this.#t.variables,s=this.#t.context;a?.type==="success"?(this.#a.onSuccess?.(a.data,r,s),this.#a.onSettled?.(a.data,null,r,s)):a?.type==="error"&&(this.#a.onError?.(a.error,r,s),this.#a.onSettled?.(void 0,a.error,r,s))}this.listeners.forEach(r=>{r(this.#t)})})}},oS=R.createContext(void 0),lS=e=>{const a=R.useContext(oS);if(!a)throw new Error("No QueryClient set, use QueryClientProvider to set one");return a},z4=({client:e,children:a})=>(R.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),_.jsx(oS.Provider,{value:e,children:a})),cS=R.createContext(!1),P4=()=>R.useContext(cS);cS.Provider;function U4(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var B4=R.createContext(U4()),k4=()=>R.useContext(B4),H4=(e,a)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(a.isReset()||(e.retryOnMount=!1))},q4=e=>{R.useEffect(()=>{e.clearReset()},[e])},V4=({result:e,errorResetBoundary:a,throwOnError:r,query:s,suspense:l})=>e.isError&&!a.isReset()&&!e.isFetching&&s&&(l&&e.data===void 0||tS(r,[e.error,s])),G4=e=>{if(e.suspense){const a=s=>s==="static"?s:Math.max(s??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...s)=>a(r(...s)):a(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Y4=(e,a)=>e.isLoading&&e.isFetching&&!a,F4=(e,a)=>e?.suspense&&a.isPending,m0=(e,a,r)=>a.fetchOptimistic(e).catch(()=>{r.clearReset()});function Q4(e,a,r){const s=P4(),l=k4(),c=lS(),f=c.defaultQueryOptions(e);c.getDefaultOptions().queries?._experimental_beforeQuery?.(f),f._optimisticResults=s?"isRestoring":"optimistic",G4(f),H4(f,l),q4(l);const h=!c.getQueryCache().get(f.queryHash),[p]=R.useState(()=>new a(c,f)),m=p.getOptimisticResult(f),v=!s&&e.subscribed!==!1;if(R.useSyncExternalStore(R.useCallback(g=>{const y=v?p.subscribe(ue.batchCalls(g)):Ae;return p.updateResult(),y},[p,v]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),R.useEffect(()=>{p.setOptions(f)},[f,p]),F4(f,m))throw m0(f,p,l);if(V4({result:m,errorResetBoundary:l,throwOnError:f.throwOnError,query:c.getQueryCache().get(f.queryHash),suspense:f.suspense}))throw m.error;return c.getDefaultOptions().queries?._experimental_afterQuery?.(f,m),f.experimental_prefetchInRender&&!xr&&Y4(m,s)&&(h?m0(f,p,l):c.getQueryCache().get(f.queryHash)?.promise)?.catch(Ae).finally(()=>{p.updateResult()}),f.notifyOnChangeProps?m:p.trackResult(m)}function K4(e,a){return Q4(e,D4)}function X4(e,a){const r=lS(),[s]=R.useState(()=>new j4(r,e));R.useEffect(()=>{s.setOptions(e)},[s,e]);const l=R.useSyncExternalStore(R.useCallback(f=>s.subscribe(ue.batchCalls(f)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),c=R.useCallback((f,h)=>{s.mutate(f,h).catch(Ae)},[s]);if(l.error&&tS(s.options.throwOnError,[l.error]))throw l.error;return{...l,mutate:c,mutateAsync:l.mutate}}function $4(){return _.jsx("div",{className:"h-screen grid place-items-center",children:_.jsx(G0,{className:"size-8 animate-spin"})})}function Z4({className:e,...a}){const{setAuthenticated:r}=Z1(),[s,l]=R.useState(""),[c,f]=R.useState(""),h=jh(),{isPending:p,mutate:m}=X4({mutationFn:async()=>h.login(s,c),onError(){a0.error("Invalid credentials",{description:"The credentials you provided are invalid."})},onSuccess(){a0.success("Login successful",{description:"You have successfully logged in."}),r(!0)}});return p?_.jsx($4,{}):_.jsx("div",{className:Et("flex flex-col gap-6 w-[20%]",e),...a,children:_.jsxs(DM,{children:[_.jsxs(NM,{children:[_.jsx(LM,{className:"text-2xl",children:"Login"}),_.jsx(jM,{children:"Enter your credentials below to proceed"})]}),_.jsx(zM,{children:_.jsxs("div",{className:"flex flex-col gap-6",children:[_.jsxs("div",{className:"grid gap-2",children:[_.jsx(t0,{htmlFor:"username",children:"Username"}),_.jsx(py,{id:"username",type:"username",placeholder:"Enter your username",required:!0,value:s,onChange:v=>l(v.target.value)})]}),_.jsxs("div",{className:"grid gap-2",children:[_.jsx("div",{className:"flex items-center",children:_.jsx(t0,{htmlFor:"password",children:"Password"})}),_.jsx(py,{id:"password",type:"password",required:!0,value:c,onChange:v=>f(v.target.value)})]}),_.jsx(sb,{type:"button",className:"w-full",onClick:()=>{m()},children:"Login"})]})})]})})}function I4({children:e}){const{authenticated:a,setAuthenticated:r}=Z1(),s=jh(),{isLoading:l,isError:c}=K4({queryKey:[],enabled:!a,queryFn:async()=>{const f=await s.fetchMe();return r(!!f),f},refetchOnWindowFocus:!0});return l?_.jsx("div",{className:"h-screen grid place-items-center",children:_.jsx(G0,{className:"size-8 animate-spin"})}):c?_.jsx("div",{className:"h-screen grid place-items-center",children:_.jsx("h1",{className:"text-2xl text-red-500",children:"An error occurred while fetching user data."})}):a?_.jsx(_.Fragment,{children:e}):_.jsx("div",{className:"h-screen grid place-items-center",children:_.jsx(Z4,{})})}function W4({...e}){return _.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function J4({className:e,...a}){return _.jsx("ol",{"data-slot":"breadcrumb-list",className:Et("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",e),...a})}function vd({className:e,...a}){return _.jsx("li",{"data-slot":"breadcrumb-item",className:Et("inline-flex items-center gap-1.5",e),...a})}function p0({asChild:e,className:a,...r}){const s=e?no:"a";return _.jsx(s,{"data-slot":"breadcrumb-link",className:Et("hover:text-foreground transition-colors",a),...r})}function t3({className:e,...a}){return _.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:Et("text-foreground font-normal",e),...a})}function g0({children:e,className:a,...r}){return _.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:Et("[&>svg]:size-3.5",a),...r,children:e??_.jsx(vR,{})})}function e3(){const{toggleSidebar:e}=Ch();return _.jsx("header",{className:"bg-background sticky top-0 z-50 flex w-full items-center border-b",children:_.jsxs("div",{className:"flex h-(--header-height) w-full items-center gap-2 px-4",children:[_.jsx(sb,{className:"h-8 w-8",variant:"ghost",size:"icon",onClick:e,children:_.jsx(bR,{})}),_.jsx(K_,{orientation:"vertical",className:"mr-2 h-4"}),_.jsx(W4,{className:"hidden sm:block",children:_.jsxs(J4,{children:[_.jsx(vd,{children:_.jsx(p0,{href:"#",children:"/"})}),_.jsx(g0,{}),_.jsx(vd,{children:_.jsx(t3,{children:"CommandKit"})}),_.jsx(g0,{}),_.jsx(vd,{children:_.jsx(p0,{href:"#",children:"DevTools"})})]})})]})})}var n3=(e,a,r,s,l,c,f,h)=>{let p=document.documentElement,m=["light","dark"];function v(x){(Array.isArray(e)?e:[e]).forEach(S=>{let w=S==="class",T=w&&c?l.map(C=>c[C]||C):l;w?(p.classList.remove(...T),p.classList.add(c&&c[x]?c[x]:x)):p.setAttribute(S,x)}),g(x)}function g(x){h&&m.includes(x)&&(p.style.colorScheme=x)}function y(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(s)v(s);else try{let x=localStorage.getItem(a)||r,S=f&&x==="system"?y():x;v(S)}catch{}},v0=["light","dark"],uS="(prefers-color-scheme: dark)",a3=typeof window>"u",kh=R.createContext(void 0),r3={setTheme:e=>{},themes:[]},i3=()=>{var e;return(e=R.useContext(kh))!=null?e:r3},s3=e=>R.useContext(kh)?R.createElement(R.Fragment,null,e.children):R.createElement(l3,{...e}),o3=["light","dark"],l3=({forcedTheme:e,disableTransitionOnChange:a=!1,enableSystem:r=!0,enableColorScheme:s=!0,storageKey:l="theme",themes:c=o3,defaultTheme:f=r?"system":"light",attribute:h="data-theme",value:p,children:m,nonce:v,scriptProps:g})=>{let[y,x]=R.useState(()=>u3(l,f)),[S,w]=R.useState(()=>y==="system"?yd():y),T=p?Object.values(p):c,C=R.useCallback(N=>{let F=N;if(!F)return;N==="system"&&r&&(F=yd());let G=p?p[F]:F,q=a?f3(v):null,et=document.documentElement,W=at=>{at==="class"?(et.classList.remove(...T),G&&et.classList.add(G)):at.startsWith("data-")&&(G?et.setAttribute(at,G):et.removeAttribute(at))};if(Array.isArray(h)?h.forEach(W):W(h),s){let at=v0.includes(f)?f:null,st=v0.includes(F)?F:at;et.style.colorScheme=st}q?.()},[v]),j=R.useCallback(N=>{let F=typeof N=="function"?N(y):N;x(F);try{localStorage.setItem(l,F)}catch{}},[y]),L=R.useCallback(N=>{let F=yd(N);w(F),y==="system"&&r&&!e&&C("system")},[y,e]);R.useEffect(()=>{let N=window.matchMedia(uS);return N.addListener(L),L(N),()=>N.removeListener(L)},[L]),R.useEffect(()=>{let N=F=>{F.key===l&&(F.newValue?x(F.newValue):j(f))};return window.addEventListener("storage",N),()=>window.removeEventListener("storage",N)},[j]),R.useEffect(()=>{C(e??y)},[e,y]);let U=R.useMemo(()=>({theme:y,setTheme:j,forcedTheme:e,resolvedTheme:y==="system"?S:y,themes:r?[...c,"system"]:c,systemTheme:r?S:void 0}),[y,j,e,S,r,c]);return R.createElement(kh.Provider,{value:U},R.createElement(c3,{forcedTheme:e,storageKey:l,attribute:h,enableSystem:r,enableColorScheme:s,defaultTheme:f,value:p,themes:c,nonce:v,scriptProps:g}),m)},c3=R.memo(({forcedTheme:e,storageKey:a,attribute:r,enableSystem:s,enableColorScheme:l,defaultTheme:c,value:f,themes:h,nonce:p,scriptProps:m})=>{let v=JSON.stringify([r,a,c,e,h,f,s,l]).slice(1,-1);return R.createElement("script",{...m,suppressHydrationWarning:!0,nonce:typeof window>"u"?p:"",dangerouslySetInnerHTML:{__html:`(${n3.toString()})(${v})`}})}),u3=(e,a)=>{if(a3)return;let r;try{r=localStorage.getItem(e)||void 0}catch{}return r||a},f3=e=>{let a=document.createElement("style");return e&&a.setAttribute("nonce",e),a.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(a),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(a)},1)}},yd=e=>(e||(e=window.matchMedia(uS)),e.matches?"dark":"light");const d3=({...e})=>{const{theme:a="system"}=i3();return _.jsx(m4,{theme:a,className:"toaster group",style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)"},...e})},Rr=IE({head:()=>({meta:[{charSet:"utf-8"},{name:"viewport",content:"width=device-width, initial-scale=1"},{title:"CommandKit DevTools"}]}),component:h3});function h3(){return _.jsxs(s3,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!1,children:[_.jsx(d3,{}),_.jsx(OM,{children:_.jsx(I4,{children:_.jsx("div",{className:"[--header-height:calc(theme(spacing.14))]",children:_.jsxs(EA,{className:"flex flex-col",children:[_.jsx(e3,{}),_.jsxs("div",{className:"flex flex-1",children:[_.jsx(MM,{}),_.jsx(_A,{children:_.jsx(k0,{})})]})]})})})})]})}const m3="modulepreload",p3=function(e){return"/"+e},y0={},Bi=function(a,r,s){let l=Promise.resolve();if(r&&r.length>0){let p=function(m){return Promise.all(m.map(v=>Promise.resolve(v).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const f=document.querySelector("meta[property=csp-nonce]"),h=f?.nonce||f?.getAttribute("nonce");l=p(r.map(m=>{if(m=p3(m),m in y0)return;y0[m]=!0;const v=m.endsWith(".css"),g=v?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${g}`))return;const y=document.createElement("link");if(y.rel=v?"stylesheet":m3,v||(y.as="script"),y.crossOrigin="",y.href=m,h&&y.setAttribute("nonce",h),document.head.appendChild(y),v)return new Promise((x,S)=>{y.addEventListener("load",x),y.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${m}`)))})}))}function c(f){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=f,window.dispatchEvent(h),!h.defaultPrevented)throw f}return l.then(f=>{for(const h of f||[])h.status==="rejected"&&c(h.reason);return a().catch(c)})},g3=()=>Bi(()=>import("./plugins-5YH9BWD2.js"),[]),v3=ka("/plugins")({component:Mi(g3,"component")}),y3=()=>Bi(()=>import("./guilds-DhQ98C7s.js"),[]),b3=ka("/guilds")({component:Mi(y3,"component")}),S3=()=>Bi(()=>import("./feature-flags-CqYJDOJF.js"),[]),x3=ka("/feature-flags")({component:Mi(S3,"component")}),w3=()=>Bi(()=>import("./events-CDpCAB6h.js"),[]),E3=ka("/events")({component:Mi(w3,"component")}),R3=()=>Bi(()=>import("./commands-B_fcWHsj.js"),[]),_3=ka("/commands")({component:Mi(R3,"component")}),T3=()=>Bi(()=>import("./index-DXAz68TI.js"),[]),C3=ka("/")({component:Mi(T3,"component")}),A3=v3.update({id:"/plugins",path:"/plugins",getParentRoute:()=>Rr}),O3=b3.update({id:"/guilds",path:"/guilds",getParentRoute:()=>Rr}),M3=x3.update({id:"/feature-flags",path:"/feature-flags",getParentRoute:()=>Rr}),D3=E3.update({id:"/events",path:"/events",getParentRoute:()=>Rr}),N3=_3.update({id:"/commands",path:"/commands",getParentRoute:()=>Rr}),L3=C3.update({id:"/",path:"/",getParentRoute:()=>Rr}),j3={IndexRoute:L3,CommandsRoute:N3,EventsRoute:D3,FeatureFlagsRoute:M3,GuildsRoute:O3,PluginsRoute:A3},z3=Rr._addFileChildren(j3)._addFileTypes(),P3=sR({routeTree:z3,defaultPreload:"intent",defaultStaleTime:5e3,scrollRestoration:!0,defaultViewTransition:!0}),U3=new M4;Aw.createRoot(document.getElementById("root")).render(_.jsx(R.StrictMode,{children:_.jsx(z4,{client:U3,children:_.jsx(cR,{router:P3})})}));export{GA as A,KA as B,DM as C,$4 as L,K4 as a,NM as b,YA as c,FA as d,zM as e,LM as f,b0 as g,jM as h,Va as i,_ as j,vR as k,lD as l,Oi as m,sb as n,R as r,jh as u};
@@ -1 +1 @@
1
- import{g as X,u as tt,a as et,j as y,L as rt,B as nt}from"./index-CCM7vRwa.js";var I={exports:{}},st=I.exports,V;function it(){return V||(V=1,(function(k,H){(function(N,D){k.exports=D()})(st,(function(){var N=1e3,D=6e4,g=36e5,U="millisecond",_="second",O="minute",b="hour",v="day",C="week",m="month",J="quarter",M="year",j="date",Z="Invalid Date",P=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,Q=/\[([^\]]+)]|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,K={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(s){var r=["th","st","nd","rd"],t=s%100;return"["+s+(r[(t-20)%10]||r[t]||r[0])+"]"}},q=function(s,r,t){var n=String(s);return!n||n.length>=r?s:""+Array(r+1-n.length).join(t)+s},G={s:q,z:function(s){var r=-s.utcOffset(),t=Math.abs(r),n=Math.floor(t/60),e=t%60;return(r<=0?"+":"-")+q(n,2,"0")+":"+q(e,2,"0")},m:function s(r,t){if(r.date()<t.date())return-s(t,r);var n=12*(t.year()-r.year())+(t.month()-r.month()),e=r.clone().add(n,m),i=t-e<0,a=r.clone().add(n+(i?-1:1),m);return+(-(n+(t-e)/(i?e-a:a-e))||0)},a:function(s){return s<0?Math.ceil(s)||0:Math.floor(s)},p:function(s){return{M:m,y:M,w:C,d:v,D:j,h:b,m:O,s:_,ms:U,Q:J}[s]||String(s||"").toLowerCase().replace(/s$/,"")},u:function(s){return s===void 0}},T="en",x={};x[T]=K;var z="$isDayjsObject",R=function(s){return s instanceof F||!(!s||!s[z])},W=function s(r,t,n){var e;if(!r)return T;if(typeof r=="string"){var i=r.toLowerCase();x[i]&&(e=i),t&&(x[i]=t,e=i);var a=r.split("-");if(!e&&a.length>1)return s(a[0])}else{var o=r.name;x[o]=r,e=o}return!n&&e&&(T=e),e||!n&&T},f=function(s,r){if(R(s))return s.clone();var t=typeof r=="object"?r:{};return t.date=s,t.args=arguments,new F(t)},u=G;u.l=W,u.i=R,u.w=function(s,r){return f(s,{locale:r.$L,utc:r.$u,x:r.$x,$offset:r.$offset})};var F=(function(){function s(t){this.$L=W(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[z]=!0}var r=s.prototype;return r.parse=function(t){this.$d=(function(n){var e=n.date,i=n.utc;if(e===null)return new Date(NaN);if(u.u(e))return new Date;if(e instanceof Date)return new Date(e);if(typeof e=="string"&&!/Z$/i.test(e)){var a=e.match(P);if(a){var o=a[2]-1||0,c=(a[7]||"0").substring(0,3);return i?new Date(Date.UTC(a[1],o,a[3]||1,a[4]||0,a[5]||0,a[6]||0,c)):new Date(a[1],o,a[3]||1,a[4]||0,a[5]||0,a[6]||0,c)}}return new Date(e)})(t),this.init()},r.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},r.$utils=function(){return u},r.isValid=function(){return this.$d.toString()!==Z},r.isSame=function(t,n){var e=f(t);return this.startOf(n)<=e&&e<=this.endOf(n)},r.isAfter=function(t,n){return f(t)<this.startOf(n)},r.isBefore=function(t,n){return this.endOf(n)<f(t)},r.$g=function(t,n,e){return u.u(t)?this[n]:this.set(e,t)},r.unix=function(){return Math.floor(this.valueOf()/1e3)},r.valueOf=function(){return this.$d.getTime()},r.startOf=function(t,n){var e=this,i=!!u.u(n)||n,a=u.p(t),o=function(w,l){var p=u.w(e.$u?Date.UTC(e.$y,l,w):new Date(e.$y,l,w),e);return i?p:p.endOf(v)},c=function(w,l){return u.w(e.toDate()[w].apply(e.toDate("s"),(i?[0,0,0,0]:[23,59,59,999]).slice(l)),e)},d=this.$W,h=this.$M,$=this.$D,Y="set"+(this.$u?"UTC":"");switch(a){case M:return i?o(1,0):o(31,11);case m:return i?o(1,h):o(0,h+1);case C:var S=this.$locale().weekStart||0,L=(d<S?d+7:d)-S;return o(i?$-L:$+(6-L),h);case v:case j:return c(Y+"Hours",0);case b:return c(Y+"Minutes",1);case O:return c(Y+"Seconds",2);case _:return c(Y+"Milliseconds",3);default:return this.clone()}},r.endOf=function(t){return this.startOf(t,!1)},r.$set=function(t,n){var e,i=u.p(t),a="set"+(this.$u?"UTC":""),o=(e={},e[v]=a+"Date",e[j]=a+"Date",e[m]=a+"Month",e[M]=a+"FullYear",e[b]=a+"Hours",e[O]=a+"Minutes",e[_]=a+"Seconds",e[U]=a+"Milliseconds",e)[i],c=i===v?this.$D+(n-this.$W):n;if(i===m||i===M){var d=this.clone().set(j,1);d.$d[o](c),d.init(),this.$d=d.set(j,Math.min(this.$D,d.daysInMonth())).$d}else o&&this.$d[o](c);return this.init(),this},r.set=function(t,n){return this.clone().$set(t,n)},r.get=function(t){return this[u.p(t)]()},r.add=function(t,n){var e,i=this;t=Number(t);var a=u.p(n),o=function(h){var $=f(i);return u.w($.date($.date()+Math.round(h*t)),i)};if(a===m)return this.set(m,this.$M+t);if(a===M)return this.set(M,this.$y+t);if(a===v)return o(1);if(a===C)return o(7);var c=(e={},e[O]=D,e[b]=g,e[_]=N,e)[a]||1,d=this.$d.getTime()+t*c;return u.w(d,this)},r.subtract=function(t,n){return this.add(-1*t,n)},r.format=function(t){var n=this,e=this.$locale();if(!this.isValid())return e.invalidDate||Z;var i=t||"YYYY-MM-DDTHH:mm:ssZ",a=u.z(this),o=this.$H,c=this.$m,d=this.$M,h=e.weekdays,$=e.months,Y=e.meridiem,S=function(l,p,A,E){return l&&(l[p]||l(n,i))||A[p].slice(0,E)},L=function(l){return u.s(o%12||12,l,"0")},w=Y||function(l,p,A){var E=l<12?"AM":"PM";return A?E.toLowerCase():E};return i.replace(Q,(function(l,p){return p||(function(A){switch(A){case"YY":return String(n.$y).slice(-2);case"YYYY":return u.s(n.$y,4,"0");case"M":return d+1;case"MM":return u.s(d+1,2,"0");case"MMM":return S(e.monthsShort,d,$,3);case"MMMM":return S($,d);case"D":return n.$D;case"DD":return u.s(n.$D,2,"0");case"d":return String(n.$W);case"dd":return S(e.weekdaysMin,n.$W,h,2);case"ddd":return S(e.weekdaysShort,n.$W,h,3);case"dddd":return h[n.$W];case"H":return String(o);case"HH":return u.s(o,2,"0");case"h":return L(1);case"hh":return L(2);case"a":return w(o,c,!0);case"A":return w(o,c,!1);case"m":return String(c);case"mm":return u.s(c,2,"0");case"s":return String(n.$s);case"ss":return u.s(n.$s,2,"0");case"SSS":return u.s(n.$ms,3,"0");case"Z":return a}return null})(l)||a.replace(":","")}))},r.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},r.diff=function(t,n,e){var i,a=this,o=u.p(n),c=f(t),d=(c.utcOffset()-this.utcOffset())*D,h=this-c,$=function(){return u.m(a,c)};switch(o){case M:i=$()/12;break;case m:i=$();break;case J:i=$()/3;break;case C:i=(h-d)/6048e5;break;case v:i=(h-d)/864e5;break;case b:i=h/g;break;case O:i=h/D;break;case _:i=h/N;break;default:i=h}return e?i:u.a(i)},r.daysInMonth=function(){return this.endOf(m).$D},r.$locale=function(){return x[this.$L]},r.locale=function(t,n){if(!t)return this.$L;var e=this.clone(),i=W(t,n,!0);return i&&(e.$L=i),e},r.clone=function(){return u.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()},s})(),B=F.prototype;return f.prototype=B,[["$ms",U],["$s",_],["$m",O],["$H",b],["$W",v],["$M",m],["$y",M],["$D",j]].forEach((function(s){B[s[1]]=function(r){return this.$g(r,s[0],s[1])}})),f.extend=function(s,r){return s.$i||(s(r,F,f),s.$i=!0),f},f.locale=W,f.isDayjs=R,f.unix=function(s){return f(1e3*s)},f.en=x[T],f.Ls=x,f.p={},f}))})(I)),I.exports}var at=it();const ut=X(at),ot="YYYY-MM-DD HH:mm:ss";function ct(k,H=ot){return ut(k).format(H)}function dt(){const k=tt(),{data:H,isLoading:N,isError:D}=et({queryKey:["plugins"],queryFn:async()=>await k.plugins.fetch()});return N||!H?y.jsx(rt,{}):D?y.jsx("div",{className:"h-screen grid place-items-center",children:y.jsx("h1",{className:"text-2xl text-red-500",children:"An error occurred while fetching plugins data."})}):y.jsxs("div",{className:"p-4",children:[y.jsx("h1",{className:"text-2xl font-bold mb-6",children:"Plugins"}),y.jsx("div",{className:"grid grid-cols-3 gap-4 py-4",children:H.map(g=>y.jsxs("div",{className:"border p-4 rounded",children:[y.jsx("h2",{className:"text-lg font-semibold",children:g.name}),y.jsx(nt,{variant:"outline",className:"text-sm text-gray-500 mt-2 font-mono",children:g.id}),y.jsxs("p",{className:"text-muted-foreground text-xs mt-2 font-medium",children:["Registered at ",ct(g.loadedAt)]})]},g.id))})]})}export{dt as component};
1
+ import{g as X,u as tt,a as et,j as y,L as rt,B as nt}from"./index-aesTD9GY.js";var I={exports:{}},st=I.exports,V;function it(){return V||(V=1,(function(k,H){(function(N,D){k.exports=D()})(st,(function(){var N=1e3,D=6e4,g=36e5,U="millisecond",_="second",O="minute",b="hour",v="day",C="week",m="month",J="quarter",M="year",j="date",Z="Invalid Date",P=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,Q=/\[([^\]]+)]|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,K={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(s){var r=["th","st","nd","rd"],t=s%100;return"["+s+(r[(t-20)%10]||r[t]||r[0])+"]"}},q=function(s,r,t){var n=String(s);return!n||n.length>=r?s:""+Array(r+1-n.length).join(t)+s},G={s:q,z:function(s){var r=-s.utcOffset(),t=Math.abs(r),n=Math.floor(t/60),e=t%60;return(r<=0?"+":"-")+q(n,2,"0")+":"+q(e,2,"0")},m:function s(r,t){if(r.date()<t.date())return-s(t,r);var n=12*(t.year()-r.year())+(t.month()-r.month()),e=r.clone().add(n,m),i=t-e<0,a=r.clone().add(n+(i?-1:1),m);return+(-(n+(t-e)/(i?e-a:a-e))||0)},a:function(s){return s<0?Math.ceil(s)||0:Math.floor(s)},p:function(s){return{M:m,y:M,w:C,d:v,D:j,h:b,m:O,s:_,ms:U,Q:J}[s]||String(s||"").toLowerCase().replace(/s$/,"")},u:function(s){return s===void 0}},T="en",x={};x[T]=K;var z="$isDayjsObject",R=function(s){return s instanceof F||!(!s||!s[z])},W=function s(r,t,n){var e;if(!r)return T;if(typeof r=="string"){var i=r.toLowerCase();x[i]&&(e=i),t&&(x[i]=t,e=i);var a=r.split("-");if(!e&&a.length>1)return s(a[0])}else{var o=r.name;x[o]=r,e=o}return!n&&e&&(T=e),e||!n&&T},f=function(s,r){if(R(s))return s.clone();var t=typeof r=="object"?r:{};return t.date=s,t.args=arguments,new F(t)},u=G;u.l=W,u.i=R,u.w=function(s,r){return f(s,{locale:r.$L,utc:r.$u,x:r.$x,$offset:r.$offset})};var F=(function(){function s(t){this.$L=W(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[z]=!0}var r=s.prototype;return r.parse=function(t){this.$d=(function(n){var e=n.date,i=n.utc;if(e===null)return new Date(NaN);if(u.u(e))return new Date;if(e instanceof Date)return new Date(e);if(typeof e=="string"&&!/Z$/i.test(e)){var a=e.match(P);if(a){var o=a[2]-1||0,c=(a[7]||"0").substring(0,3);return i?new Date(Date.UTC(a[1],o,a[3]||1,a[4]||0,a[5]||0,a[6]||0,c)):new Date(a[1],o,a[3]||1,a[4]||0,a[5]||0,a[6]||0,c)}}return new Date(e)})(t),this.init()},r.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},r.$utils=function(){return u},r.isValid=function(){return this.$d.toString()!==Z},r.isSame=function(t,n){var e=f(t);return this.startOf(n)<=e&&e<=this.endOf(n)},r.isAfter=function(t,n){return f(t)<this.startOf(n)},r.isBefore=function(t,n){return this.endOf(n)<f(t)},r.$g=function(t,n,e){return u.u(t)?this[n]:this.set(e,t)},r.unix=function(){return Math.floor(this.valueOf()/1e3)},r.valueOf=function(){return this.$d.getTime()},r.startOf=function(t,n){var e=this,i=!!u.u(n)||n,a=u.p(t),o=function(w,l){var p=u.w(e.$u?Date.UTC(e.$y,l,w):new Date(e.$y,l,w),e);return i?p:p.endOf(v)},c=function(w,l){return u.w(e.toDate()[w].apply(e.toDate("s"),(i?[0,0,0,0]:[23,59,59,999]).slice(l)),e)},d=this.$W,h=this.$M,$=this.$D,Y="set"+(this.$u?"UTC":"");switch(a){case M:return i?o(1,0):o(31,11);case m:return i?o(1,h):o(0,h+1);case C:var S=this.$locale().weekStart||0,L=(d<S?d+7:d)-S;return o(i?$-L:$+(6-L),h);case v:case j:return c(Y+"Hours",0);case b:return c(Y+"Minutes",1);case O:return c(Y+"Seconds",2);case _:return c(Y+"Milliseconds",3);default:return this.clone()}},r.endOf=function(t){return this.startOf(t,!1)},r.$set=function(t,n){var e,i=u.p(t),a="set"+(this.$u?"UTC":""),o=(e={},e[v]=a+"Date",e[j]=a+"Date",e[m]=a+"Month",e[M]=a+"FullYear",e[b]=a+"Hours",e[O]=a+"Minutes",e[_]=a+"Seconds",e[U]=a+"Milliseconds",e)[i],c=i===v?this.$D+(n-this.$W):n;if(i===m||i===M){var d=this.clone().set(j,1);d.$d[o](c),d.init(),this.$d=d.set(j,Math.min(this.$D,d.daysInMonth())).$d}else o&&this.$d[o](c);return this.init(),this},r.set=function(t,n){return this.clone().$set(t,n)},r.get=function(t){return this[u.p(t)]()},r.add=function(t,n){var e,i=this;t=Number(t);var a=u.p(n),o=function(h){var $=f(i);return u.w($.date($.date()+Math.round(h*t)),i)};if(a===m)return this.set(m,this.$M+t);if(a===M)return this.set(M,this.$y+t);if(a===v)return o(1);if(a===C)return o(7);var c=(e={},e[O]=D,e[b]=g,e[_]=N,e)[a]||1,d=this.$d.getTime()+t*c;return u.w(d,this)},r.subtract=function(t,n){return this.add(-1*t,n)},r.format=function(t){var n=this,e=this.$locale();if(!this.isValid())return e.invalidDate||Z;var i=t||"YYYY-MM-DDTHH:mm:ssZ",a=u.z(this),o=this.$H,c=this.$m,d=this.$M,h=e.weekdays,$=e.months,Y=e.meridiem,S=function(l,p,A,E){return l&&(l[p]||l(n,i))||A[p].slice(0,E)},L=function(l){return u.s(o%12||12,l,"0")},w=Y||function(l,p,A){var E=l<12?"AM":"PM";return A?E.toLowerCase():E};return i.replace(Q,(function(l,p){return p||(function(A){switch(A){case"YY":return String(n.$y).slice(-2);case"YYYY":return u.s(n.$y,4,"0");case"M":return d+1;case"MM":return u.s(d+1,2,"0");case"MMM":return S(e.monthsShort,d,$,3);case"MMMM":return S($,d);case"D":return n.$D;case"DD":return u.s(n.$D,2,"0");case"d":return String(n.$W);case"dd":return S(e.weekdaysMin,n.$W,h,2);case"ddd":return S(e.weekdaysShort,n.$W,h,3);case"dddd":return h[n.$W];case"H":return String(o);case"HH":return u.s(o,2,"0");case"h":return L(1);case"hh":return L(2);case"a":return w(o,c,!0);case"A":return w(o,c,!1);case"m":return String(c);case"mm":return u.s(c,2,"0");case"s":return String(n.$s);case"ss":return u.s(n.$s,2,"0");case"SSS":return u.s(n.$ms,3,"0");case"Z":return a}return null})(l)||a.replace(":","")}))},r.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},r.diff=function(t,n,e){var i,a=this,o=u.p(n),c=f(t),d=(c.utcOffset()-this.utcOffset())*D,h=this-c,$=function(){return u.m(a,c)};switch(o){case M:i=$()/12;break;case m:i=$();break;case J:i=$()/3;break;case C:i=(h-d)/6048e5;break;case v:i=(h-d)/864e5;break;case b:i=h/g;break;case O:i=h/D;break;case _:i=h/N;break;default:i=h}return e?i:u.a(i)},r.daysInMonth=function(){return this.endOf(m).$D},r.$locale=function(){return x[this.$L]},r.locale=function(t,n){if(!t)return this.$L;var e=this.clone(),i=W(t,n,!0);return i&&(e.$L=i),e},r.clone=function(){return u.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()},s})(),B=F.prototype;return f.prototype=B,[["$ms",U],["$s",_],["$m",O],["$H",b],["$W",v],["$M",m],["$y",M],["$D",j]].forEach((function(s){B[s[1]]=function(r){return this.$g(r,s[0],s[1])}})),f.extend=function(s,r){return s.$i||(s(r,F,f),s.$i=!0),f},f.locale=W,f.isDayjs=R,f.unix=function(s){return f(1e3*s)},f.en=x[T],f.Ls=x,f.p={},f}))})(I)),I.exports}var at=it();const ut=X(at),ot="YYYY-MM-DD HH:mm:ss";function ct(k,H=ot){return ut(k).format(H)}function dt(){const k=tt(),{data:H,isLoading:N,isError:D}=et({queryKey:["plugins"],queryFn:async()=>await k.plugins.fetch()});return N||!H?y.jsx(rt,{}):D?y.jsx("div",{className:"h-screen grid place-items-center",children:y.jsx("h1",{className:"text-2xl text-red-500",children:"An error occurred while fetching plugins data."})}):y.jsxs("div",{className:"p-4",children:[y.jsx("h1",{className:"text-2xl font-bold mb-6",children:"Plugins"}),y.jsx("div",{className:"grid grid-cols-3 gap-4 py-4",children:H.map(g=>y.jsxs("div",{className:"border p-4 rounded",children:[y.jsx("h2",{className:"text-lg font-semibold",children:g.name}),y.jsx(nt,{variant:"outline",className:"text-sm text-gray-500 mt-2 font-mono",children:g.id}),y.jsxs("p",{className:"text-muted-foreground text-xs mt-2 font-medium",children:["Registered at ",ct(g.loadedAt)]})]},g.id))})]})}export{dt as component};
package/ui/index.html CHANGED
@@ -11,7 +11,7 @@
11
11
  <style>
12
12
  @import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap');
13
13
  </style>
14
- <script type="module" crossorigin src="/assets/index-CCM7vRwa.js"></script>
14
+ <script type="module" crossorigin src="/assets/index-aesTD9GY.js"></script>
15
15
  <link rel="stylesheet" crossorigin href="/assets/index-B_iMxRPI.css">
16
16
  </head>
17
17
  <body>