@commandkit/devtools 0.0.0-dev.20250807022245 → 0.0.0-dev.20250808022237

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": "0.0.0-dev.20250807022245",
4
+ "version": "0.0.0-dev.20250808022237",
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.0.0-dev.20250807022245",
14
- "tsconfig": "0.0.0-dev.20250807022245"
13
+ "commandkit": "1.0.0-dev.20250808022237",
14
+ "tsconfig": "0.0.0-dev.20250808022237"
15
15
  },
16
16
  "files": [
17
17
  "dist",
@@ -1,20 +1,20 @@
1
- import{i as x,r as j,u as g,a as v,j as e,B as i,k as f,C as b}from"./index-BFw8ZaDZ.js";/**
2
- * @license lucide-react v0.536.0 - ISC
1
+ import{i as x,r as j,u as g,a as v,j as e,B as i,k as f,C as b}from"./index-BUBIVOZB.js";/**
2
+ * @license lucide-react v0.537.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 y=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],w=x("chevron-down",y);/**
7
- * @license lucide-react v0.536.0 - ISC
7
+ * @license lucide-react v0.537.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 C=[["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"}]],k=x("command",C);/**
12
- * @license lucide-react v0.536.0 - ISC
12
+ * @license lucide-react v0.537.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 M=[["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"}]],N=x("folder-tree",M);/**
17
- * @license lucide-react v0.536.0 - ISC
17
+ * @license lucide-react v0.537.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-BFw8ZaDZ.js";const j=function(){const i=x(),{data:n,isLoading:m,isError:l}=p({queryKey:["events"],queryFn:async()=>await i.events.fetch()}),r=o.useMemo(()=>crypto.randomUUID(),[]),d=o.useMemo(()=>{if(!n)return[];const s={};return n.forEach(a=>{const t=a.namespace||r;s[t]||(s[t]=[]),s[t].push(a)}),Object.entries(s).map(([a,t])=>({namespace:a,events:t}))},[n,r]);return m||!n?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===r?"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{j as component};
1
+ import{u as x,a as p,r as o,j as e,L as u,B as c}from"./index-BUBIVOZB.js";const j=function(){const i=x(),{data:n,isLoading:m,isError:l}=p({queryKey:["events"],queryFn:async()=>await i.events.fetch()}),r=o.useMemo(()=>crypto.randomUUID(),[]),d=o.useMemo(()=>{if(!n)return[];const s={};return n.forEach(a=>{const t=a.namespace||r;s[t]||(s[t]=[]),s[t].push(a)}),Object.entries(s).map(([a,t])=>({namespace:a,events:t}))},[n,r]);return m||!n?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===r?"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{j as component};
@@ -1 +1 @@
1
- import{u as i,a as o,j as e,L as c,B as d}from"./index-BFw8ZaDZ.js";const m=function(){const r=i(),{data:t,isLoading:a,isError:n}=o({queryKey:["feature-flags"],queryFn:async()=>await r.getFeatureFlags()});return a||!t?e.jsx(c,{}):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(d,{variant:"outline",className:"text-sm text-gray-500 mt-2 font-mono",children:"identify"})]},s.key))})]})};export{m as component};
1
+ import{u as i,a as o,j as e,L as c,B as d}from"./index-BUBIVOZB.js";const m=function(){const r=i(),{data:t,isLoading:a,isError:n}=o({queryKey:["feature-flags"],queryFn:async()=>await r.getFeatureFlags()});return a||!t?e.jsx(c,{}):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(d,{variant:"outline",className:"text-sm text-gray-500 mt-2 font-mono",children:"identify"})]},s.key))})]})};export{m as component};
@@ -1 +1 @@
1
- import{u as c,a as d,j as e,L as i,C as o,b as l,A as m,c as x,d as h,e as j,f as p,h as u}from"./index-BFw8ZaDZ.js";const y=function(){const a=c(),{data:r,isLoading:n,isError:t}=d({queryKey:["guilds"],queryFn:async()=>await a.guilds.fetch()});return n||!r?e.jsx(i,{}):t?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(o,{className:"border py-4 rounded",children:[e.jsx(l,{children:e.jsxs(m,{className:"h-12 w-12 rounded-lg",children:[e.jsx(x,{src:s.iconURL,alt:s.name}),e.jsx(h,{className:"rounded-lg",children:s.nameAcronym})]})}),e.jsxs(j,{children:[e.jsx(p,{children:s.name}),e.jsx(u,{children:s.description||`${s.name} server`})]})]},s.id))]})};export{y as component};
1
+ import{u as c,a as d,j as e,L as i,C as o,b as l,A as m,c as x,d as h,e as j,f as p,h as u}from"./index-BUBIVOZB.js";const y=function(){const a=c(),{data:r,isLoading:n,isError:t}=d({queryKey:["guilds"],queryFn:async()=>await a.guilds.fetch()});return n||!r?e.jsx(i,{}):t?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(o,{className:"border py-4 rounded",children:[e.jsx(l,{children:e.jsxs(m,{className:"h-12 w-12 rounded-lg",children:[e.jsx(x,{src:s.iconURL,alt:s.name}),e.jsx(h,{className:"rounded-lg",children:s.nameAcronym})]})}),e.jsxs(j,{children:[e.jsx(p,{children:s.name}),e.jsx(u,{children:s.description||`${s.name} server`})]})]},s.id))]})};export{y as component};
@@ -64,62 +64,62 @@ Error generating stack: `+r.message+`
64
64
  * LICENSE file in the root directory of this source tree.
65
65
  */var Fv;function hE(){if(Fv)return Vf;Fv=1;var e=$s(),a=S0();function i(p,v){return p===v&&(p!==0||1/p===1/v)||p!==p&&v!==v}var s=typeof Object.is=="function"?Object.is:i,l=a.useSyncExternalStore,c=e.useRef,f=e.useEffect,h=e.useMemo,m=e.useDebugValue;return Vf.useSyncExternalStoreWithSelector=function(p,v,g,b,w){var x=c(null);if(x.current===null){var S={hasValue:!1,value:null};x.current=S}else S=x.current;x=h(function(){function C(X){if(!L){if(L=!0,N=X,X=b(X),w!==void 0&&S.hasValue){var k=S.value;if(w(k,X))return U=k}return U=X}if(k=U,s(N,X))return k;var q=b(X);return w!==void 0&&w(k,q)?(N=X,k):(N=X,U=q)}var L=!1,N,U,z=g===void 0?null:g;return[function(){return C(v())},z===null?void 0:function(){return C(z())}]},[v,g,b,w]);var T=l(p,x[0],x[1]);return f(function(){S.hasValue=!0,S.value=T},[T]),m(T),T},Vf}var Yv;function mE(){return Yv||(Yv=1,qf.exports=hE()),qf.exports}var pE=mE();function gE(e,a=i=>i){return pE.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,a,vE)}function vE(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 i=Object.keys(e);if(i.length!==Object.keys(a).length)return!1;for(let s=0;s<i.length;s++)if(!Object.prototype.hasOwnProperty.call(a,i[s])||!Object.is(e[i[s]],a[i[s]]))return!1;return!0}const Yf=R.createContext(null);function x0(){return typeof document>"u"?Yf:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=Yf,Yf)}function fn(e){const a=R.useContext(x0());return e?.warn,a}function Ue(e){const a=fn({warn:e?.router===void 0}),i=e?.router||a,s=R.useRef(void 0);return gE(i.__store,l=>{if(e?.select){if(e.structuralSharing??i.options.defaultStructuralSharing){const c=rn(s.current,e.select(l));return s.current=c,c}return e.select(l)}return l})}const ou=R.createContext(void 0),yE=R.createContext(void 0);function un(e){const a=R.useContext(e.from?yE:ou);return Ue({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 Qd(e){return un({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:a=>e.select?e.select(a.loaderData):a.loaderData})}function Kd(e){const{select:a,...i}=e;return un({...i,select:s=>a?a(s.loaderDeps):s.loaderDeps})}function Xd(e){return un({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:a=>e.select?e.select(a.params):a.params})}function $d(e){return un({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:a=>e.select?e.select(a.search):a.search})}function Zd(e){const{navigate:a,state:i}=fn(),s=un({strict:!1,select:l=>l.index});return R.useCallback(l=>{const c=l.from??e?.from??i.matches[s].fullPath;return a({...l,from:c})},[e?.from,a])}var lu=h0();const w0=f0(lu),Rl=typeof window<"u"?R.useLayoutEffect:R.useEffect;function Qf(e){const a=R.useRef({value:e,prev:null}),i=a.current.value;return e!==i&&(a.current={value:e,prev:i}),a.current.prev}function bE(e,a,i={},s={}){R.useEffect(()=>{if(!e.current||s.disabled||typeof IntersectionObserver!="function")return;const l=new IntersectionObserver(([c])=>{a(c)},i);return l.observe(e.current),()=>{l.disconnect()}},[a,i,s.disabled,e])}function SE(e){const a=R.useRef(null);return R.useImperativeHandle(e,()=>a.current,[]),a}function xE(e,a){const i=fn(),[s,l]=R.useState(!1),c=R.useRef(!1),f=SE(a),{activeProps:h,inactiveProps:m,activeOptions:p,to:v,preload:g,preloadDelay:b,hashScrollIntoView:w,replace:x,startTransition:S,resetScroll:T,viewTransition:C,children:L,target:N,disabled:U,style:z,className:X,onClick:k,onFocus:q,onMouseEnter:et,onMouseLeave:I,onTouchStart:st,ignoreBlocker:rt,params:ut,search:pt,hash:ct,state:M,mask:F,reloadDocument:B,unsafeRelative:ot,from:A,_fromLocation:K,...at}=e,Y=R.useMemo(()=>{try{return new URL(v),"external"}catch{}return"internal"},[v]),J=Ue({select:_t=>_t.location.search,structuralSharing:!0}),it=un({strict:!1,select:_t=>e.from??_t.fullPath}),nt=R.useMemo(()=>i.buildLocation({...e,from:it}),[i,J,e._fromLocation,it,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ft=Y==="external",lt=e.reloadDocument||ft?!1:g??i.options.defaultPreload,St=b??i.options.defaultPreloadDelay??0,Dt=Ue({select:_t=>{if(ft)return!1;if(p?.exact){if(!ww(_t.location.pathname,nt.pathname,i.basepath))return!1}else{const Yt=Fl(_t.location.pathname,i.basepath),Xe=Fl(nt.pathname,i.basepath);if(!(Yt.startsWith(Xe)&&(Yt.length===Xe.length||Yt[Xe.length]==="/")))return!1}return(p?.includeSearch??!0)&&!bi(_t.location.search,nt.search,{partial:!p?.exact,ignoreUndefined:!p?.explicitUndefined})?!1:p?.includeHash?_t.location.hash===nt.hash:!0}}),Lt=R.useCallback(()=>{i.preloadRoute({...e,from:it}).catch(_t=>{console.warn(_t),console.warn(sE)})},[i,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]),zt=R.useCallback(_t=>{_t?.isIntersecting&&Lt()},[Lt]);if(bE(f,zt,TE,{disabled:!!U||lt!=="viewport"}),R.useEffect(()=>{c.current||!U&&lt==="render"&&(Lt(),c.current=!0)},[U,Lt,lt]),ft)return{...at,ref:f,type:Y,href:v,...L&&{children:L},...N&&{target:N},...U&&{disabled:U},...z&&{style:z},...X&&{className:X},...k&&{onClick:k},...q&&{onFocus:q},...et&&{onMouseEnter:et},...I&&{onMouseLeave:I},...st&&{onTouchStart:st}};const ve=_t=>{if(!U&&!CE(_t)&&!_t.defaultPrevented&&(!N||N==="_self")&&_t.button===0){_t.preventDefault(),lu.flushSync(()=>{l(!0)});const Yt=i.subscribe("onResolved",()=>{Yt(),l(!1)});i.navigate({...e,from:it,replace:x,resetScroll:T,hashScrollIntoView:w,startTransition:S,viewTransition:C,ignoreBlocker:rt})}},wn=_t=>{U||lt&&Lt()},Bi=wn,Er=_t=>{if(!(U||!lt))if(!St)Lt();else{const Yt=_t.target;if(Us.has(Yt))return;const Xe=setTimeout(()=>{Us.delete(Yt),Lt()},St);Us.set(Yt,Xe)}},fe=_t=>{if(U||!lt||!St)return;const Yt=_t.target,Xe=Us.get(Yt);Xe&&(clearTimeout(Xe),Us.delete(Yt))},Bn=Dt?cr(h,{})??wE:Kf,ye=Dt?Kf:cr(m,{})??Kf,qa=[X,Bn.className,ye.className].filter(Boolean).join(" "),kn=(z||Bn.style||ye.style)&&{...z,...Bn.style,...ye.style};return{...at,...Bn,...ye,href:U?void 0:nt.maskedLocation?i.history.createHref(nt.maskedLocation.href):i.history.createHref(nt.href),ref:f,onClick:Bs([k,ve]),onFocus:Bs([q,wn]),onMouseEnter:Bs([et,Er]),onMouseLeave:Bs([I,fe]),onTouchStart:Bs([st,Bi]),disabled:!!U,target:N,...kn&&{style:kn},...qa&&{className:qa},...U&&EE,...Dt&&RE,...s&&_E}}const Kf={},wE={className:"active"},EE={role:"link","aria-disabled":!0},RE={"data-status":"active","aria-current":"page"},_E={"data-transitioning":"transitioning"},Us=new WeakMap,TE={rootMargin:"100px"},Bs=e=>a=>{e.filter(Boolean).forEach(i=>{a.defaultPrevented||i(a)})},Ci=R.forwardRef((e,a)=>{const{_asChild:i,...s}=e,{type:l,ref:c,...f}=xE(s,a),h=typeof s.children=="function"?s.children({isActive:f["data-status"]==="active"}):s.children;return i===void 0&&delete f.disabled,R.createElement(i||"a",{...f,ref:c},h)});function CE(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}let AE=class extends b0{constructor(a){super(a),this.useMatch=i=>un({select:i?.select,from:this.id,structuralSharing:i?.structuralSharing}),this.useRouteContext=i=>un({...i,from:this.id,select:s=>i?.select?i.select(s.context):s.context}),this.useSearch=i=>$d({select:i?.select,structuralSharing:i?.structuralSharing,from:this.id}),this.useParams=i=>Xd({select:i?.select,structuralSharing:i?.structuralSharing,from:this.id}),this.useLoaderDeps=i=>Kd({...i,from:this.id}),this.useLoaderData=i=>Qd({...i,from:this.id}),this.useNavigate=()=>Zd({from:this.fullPath}),this.Link=tt.forwardRef((i,s)=>_.jsx(Ci,{ref:s,from:this.fullPath,...i})),this.$$typeof=Symbol.for("react.memo")}};function OE(e){return new AE(e)}class ME extends oE{constructor(a){super(a),this.useMatch=i=>un({select:i?.select,from:this.id,structuralSharing:i?.structuralSharing}),this.useRouteContext=i=>un({...i,from:this.id,select:s=>i?.select?i.select(s.context):s.context}),this.useSearch=i=>$d({select:i?.select,structuralSharing:i?.structuralSharing,from:this.id}),this.useParams=i=>Xd({select:i?.select,structuralSharing:i?.structuralSharing,from:this.id}),this.useLoaderDeps=i=>Kd({...i,from:this.id}),this.useLoaderData=i=>Qd({...i,from:this.id}),this.useNavigate=()=>Zd({from:this.fullPath}),this.Link=tt.forwardRef((i,s)=>_.jsx(Ci,{ref:s,from:this.fullPath,...i})),this.$$typeof=Symbol.for("react.memo")}}function DE(e){return new ME(e)}function Ba(e){return typeof e=="object"?new Qv(e,{silent:!0}).createRoute(e):new Qv(e,{silent:!0}).createRoute}class Qv{constructor(a,i){this.path=a,this.createRoute=s=>{this.silent;const l=OE(s);return l.isRoot=!1,l},this.silent=i?.silent}}class Kv{constructor(a){this.useMatch=i=>un({select:i?.select,from:this.options.id,structuralSharing:i?.structuralSharing}),this.useRouteContext=i=>un({from:this.options.id,select:s=>i?.select?i.select(s.context):s.context}),this.useSearch=i=>$d({select:i?.select,structuralSharing:i?.structuralSharing,from:this.options.id}),this.useParams=i=>Xd({select:i?.select,structuralSharing:i?.structuralSharing,from:this.options.id}),this.useLoaderDeps=i=>Kd({...i,from:this.options.id}),this.useLoaderData=i=>Qd({...i,from:this.options.id}),this.useNavigate=()=>{const i=fn();return Zd({from:i.routesById[this.options.id].fullPath})},this.options=a,this.$$typeof=Symbol.for("react.memo")}}function Xv(e){return typeof e=="object"?new Kv(e):a=>new Kv({id:e,...a})}function Ai(e,a){let i,s,l,c;const f=()=>(i||(i=e().then(m=>{i=void 0,s=m[a]}).catch(m=>{if(l=m,xw(l)&&l instanceof Error&&typeof window<"u"&&typeof sessionStorage<"u"){const p=`tanstack_router_reload:${l.message}`;sessionStorage.getItem(p)||(sessionStorage.setItem(p,"1"),c=!0)}})),i),h=function(p){if(c)throw window.location.reload(),new Promise(()=>{});if(l)throw l;if(!s)throw f();return R.createElement(s,p)};return h.preload=f,h}function NE(){const e=fn(),a=R.useRef({router:e,mounted:!1}),[i,s]=R.useState(!1),{hasPendingMatches:l,isLoading:c}=Ue({select:g=>({isLoading:g.isLoading,hasPendingMatches:g.matches.some(b=>b.status==="pending")}),structuralSharing:!0}),f=Qf(c),h=c||i||l,m=Qf(h),p=c||l,v=Qf(p);return e.startTransition=g=>{s(!0),R.startTransition(()=>{g(),s(!1)})},R.useEffect(()=>{const g=e.history.subscribe(e.load),b=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Ei(e.latestLocation.href)!==Ei(b.href)&&e.commitLocation({...b,replace:!0}),()=>{g()}},[e,e.history]),Rl(()=>{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(b){console.error(b)}})()},[e]),Rl(()=>{f&&!c&&e.emit({type:"onLoad",...fr(e.state)})},[f,e,c]),Rl(()=>{v&&!p&&e.emit({type:"onBeforeRouteMount",...fr(e.state)})},[p,v,e]),Rl(()=>{m&&!h&&(e.emit({type:"onResolved",...fr(e.state)}),e.__store.setState(g=>({...g,status:"idle",resolvedLocation:g.location})),Pw(e))},[h,m,e]),null}function LE(e){const a=Ue({select:i=>`not-found-${i.location.pathname}-${i.status}`});return _.jsx(Yd,{getResetKey:()=>a,onCatch:(i,s)=>{var l;if(sn(i))(l=e.onCatch)==null||l.call(e,i,s);else throw i},errorComponent:({error:i})=>{var s;if(sn(i))return(s=e.fallback)==null?void 0:s.call(e,i);throw i},children:e.children})}function jE(){return _.jsx("p",{children:"Not Found"})}function gi(e){return _.jsx(_.Fragment,{children:e.children})}function E0(e,a,i){return a.options.notFoundComponent?_.jsx(a.options.notFoundComponent,{data:i}):e.options.defaultNotFoundComponent?_.jsx(e.options.defaultNotFoundComponent,{data:i}):_.jsx(jE,{})}function zE({children:e}){return typeof document<"u"?null:_.jsx("script",{className:"$tsr",dangerouslySetInnerHTML:{__html:[e].filter(Boolean).join(`
66
66
  `)}})}function UE(){const e=fn(),i=(e.options.getScrollRestorationKey||yd)(e.latestLocation),s=i!==yd(e.latestLocation)?i:void 0;if(!e.isScrollRestoring||!e.isServer)return null;const l={storageKey:Ql,shouldScrollRestoration:!0};return s&&(l.key=s),_.jsx(zE,{children:`(${v0.toString()})(${JSON.stringify(l)})`})}const R0=R.memo(function({matchId:a}){var i,s;const l=fn(),c=Ue({select:N=>{const U=N.matches.find(z=>z.id===a);return ia(U),Gl(U,["routeId","ssr","_displayPending"])},structuralSharing:!0}),f=l.routesById[c.routeId],h=f.options.pendingComponent??l.options.defaultPendingComponent,m=h?_.jsx(h,{}):null,p=f.options.errorComponent??l.options.defaultErrorComponent,v=f.options.onCatch??l.options.defaultOnCatch,g=f.isRoot?f.options.notFoundComponent??((i=l.options.notFoundRoute)==null?void 0:i.options.component):f.options.notFoundComponent,b=c.ssr===!1||c.ssr==="data-only",w=(!f.isRoot||f.options.wrapInSuspense||b)&&(f.options.wrapInSuspense??h??(((s=f.options.errorComponent)==null?void 0:s.preload)||b))?R.Suspense:gi,x=p?Yd:gi,S=g?LE:gi,T=Ue({select:N=>N.loadedAt}),C=Ue({select:N=>{var U;const z=N.matches.findIndex(X=>X.id===a);return(U=N.matches[z-1])==null?void 0:U.routeId}}),L=f.isRoot?f.options.shellComponent??gi:gi;return _.jsxs(L,{children:[_.jsx(ou.Provider,{value:a,children:_.jsx(w,{fallback:m,children:_.jsx(x,{getResetKey:()=>T,errorComponent:p||su,onCatch:(N,U)=>{if(sn(N))throw N;v?.(N,U)},children:_.jsx(S,{fallback:N=>{if(!g||N.routeId&&N.routeId!==c.routeId||!N.routeId&&!f.isRoot)throw N;return R.createElement(g,N)},children:b||c._displayPending?_.jsx(uE,{fallback:m,children:_.jsx($v,{matchId:a})}):_.jsx($v,{matchId:a})})})})}),C===on&&l.options.scrollRestoration?_.jsxs(_.Fragment,{children:[_.jsx(BE,{}),_.jsx(UE,{})]}):null]})});function BE(){const e=fn(),a=R.useRef(void 0);return _.jsx("script",{suppressHydrationWarning:!0,ref:i=>{i&&(a.current===void 0||a.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...fr(e.state)}),a.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const $v=R.memo(function({matchId:a}){var i,s,l,c,f;const h=fn(),{match:m,key:p,routeId:v}=Ue({select:w=>{const x=w.matches.findIndex(U=>U.id===a),S=w.matches[x],T=S.routeId,C=h.routesById[T].options.remountDeps??h.options.defaultRemountDeps,L=C?.({routeId:T,loaderDeps:S.loaderDeps,params:S._strictParams,search:S._strictSearch});return{key:L?JSON.stringify(L):void 0,routeId:T,match:Gl(S,["id","status","error","_forcePending","_displayPending"])}},structuralSharing:!0}),g=h.routesById[v],b=R.useMemo(()=>{const w=g.options.component??h.options.defaultComponent;return w?_.jsx(w,{},p):_.jsx(_0,{})},[p,g.options.component,h.options.defaultComponent]);if(m._displayPending)throw(i=h.getMatch(m.id))==null?void 0:i.displayPendingPromise;if(m._forcePending)throw(s=h.getMatch(m.id))==null?void 0:s.minPendingPromise;if(m.status==="pending"){const w=g.options.pendingMinMs??h.options.defaultPendingMinMs;if(w&&!((l=h.getMatch(m.id))!=null&&l.minPendingPromise)&&!h.isServer){const x=pi();Promise.resolve().then(()=>{h.updateMatch(m.id,S=>({...S,minPendingPromise:x}))}),setTimeout(()=>{x.resolve(),h.updateMatch(m.id,S=>({...S,minPendingPromise:void 0}))},w)}throw(c=h.getMatch(m.id))==null?void 0:c.loadPromise}if(m.status==="notFound")return ia(sn(m.error)),E0(h,g,m.error);if(m.status==="redirected")throw ia(Nn(m.error)),(f=h.getMatch(m.id))==null?void 0:f.loadPromise;if(m.status==="error"){if(h.isServer){const w=(g.options.errorComponent??h.options.defaultErrorComponent)||su;return _.jsx(w,{error:m.error,reset:void 0,info:{componentStack:""}})}throw m.error}return b}),_0=R.memo(function(){const a=fn(),i=R.useContext(ou),s=Ue({select:p=>{var v;return(v=p.matches.find(g=>g.id===i))==null?void 0:v.routeId}}),l=a.routesById[s],c=Ue({select:p=>{const g=p.matches.find(b=>b.id===i);return ia(g),g.globalNotFound}}),f=Ue({select:p=>{var v;const g=p.matches,b=g.findIndex(w=>w.id===i);return(v=g[b+1])==null?void 0:v.id}}),h=a.options.defaultPendingComponent?_.jsx(a.options.defaultPendingComponent,{}):null;if(c)return E0(a,l,void 0);if(!f)return null;const m=_.jsx(R0,{matchId:f});return i===on?_.jsx(R.Suspense,{fallback:h,children:m}):m});function kE(){const e=fn(),a=e.options.defaultPendingComponent?_.jsx(e.options.defaultPendingComponent,{}):null,i=e.isServer||typeof document<"u"&&e.ssr?gi:R.Suspense,s=_.jsxs(i,{fallback:a,children:[!e.isServer&&_.jsx(NE,{}),_.jsx(PE,{})]});return e.options.InnerWrap?_.jsx(e.options.InnerWrap,{children:s}):s}function PE(){const e=fn(),a=Ue({select:l=>{var c;return(c=l.matches[0])==null?void 0:c.id}}),i=Ue({select:l=>l.loadedAt}),s=a?_.jsx(R0,{matchId:a}):null;return _.jsx(ou.Provider,{value:a,children:e.options.disableGlobalCatchBoundary?s:_.jsx(Yd,{getResetKey:()=>i,errorComponent:su,onCatch:l=>{l.message||l.toString()},children:s})})}const HE=e=>new qE(e);class qE extends Xw{constructor(a){super(a)}}typeof globalThis<"u"?(globalThis.createFileRoute=Ba,globalThis.createLazyFileRoute=Xv):typeof window<"u"&&(window.createFileRoute=Ba,window.createFileRoute=Xv);function VE({router:e,children:a,...i}){Object.keys(i).length>0&&e.update({...e.options,...i,context:{...e.options.context,...i.context}});const s=x0(),l=_.jsx(s.Provider,{value:e,children:a});return e.options.Wrap?_.jsx(e.options.Wrap,{children:l}):l}function GE({router:e,...a}){return _.jsx(VE,{router:e,...a,children:_.jsx(kE,{})})}/**
67
- * @license lucide-react v0.536.0 - ISC
67
+ * @license lucide-react v0.537.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 FE=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),YE=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,i,s)=>s?s.toUpperCase():i.toLowerCase()),Zv=e=>{const a=YE(e);return a.charAt(0).toUpperCase()+a.slice(1)},T0=(...e)=>e.filter((a,i,s)=>!!a&&a.trim()!==""&&s.indexOf(a)===i).join(" ").trim(),QE=e=>{for(const a in e)if(a.startsWith("aria-")||a==="role"||a==="title")return!0};/**
72
- * @license lucide-react v0.536.0 - ISC
72
+ * @license lucide-react v0.537.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 KE={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.536.0 - ISC
77
+ * @license lucide-react v0.537.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 XE=R.forwardRef(({color:e="currentColor",size:a=24,strokeWidth:i=2,absoluteStrokeWidth:s,className:l="",children:c,iconNode:f,...h},m)=>R.createElement("svg",{ref:m,...KE,width:a,height:a,stroke:e,strokeWidth:s?Number(i)*24/Number(a):i,className:T0("lucide",l),...!c&&!QE(h)&&{"aria-hidden":"true"},...h},[...f.map(([p,v])=>R.createElement(p,v)),...Array.isArray(c)?c:[c]]));/**
82
- * @license lucide-react v0.536.0 - ISC
82
+ * @license lucide-react v0.537.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 Ha=(e,a)=>{const i=R.forwardRef(({className:s,...l},c)=>R.createElement(XE,{ref:c,iconNode:a,className:T0(`lucide-${FE(Zv(e))}`,`lucide-${e}`,s),...l}));return i.displayName=Zv(e),i};/**
87
- * @license lucide-react v0.536.0 - ISC
87
+ * @license lucide-react v0.537.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 $E=[["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"}]],Iv=Ha("bell",$E);/**
92
- * @license lucide-react v0.536.0 - ISC
92
+ * @license lucide-react v0.537.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 ZE=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],IE=Ha("chevron-right",ZE);/**
97
- * @license lucide-react v0.536.0 - ISC
97
+ * @license lucide-react v0.537.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 WE=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],JE=Ha("panel-left",WE);/**
102
- * @license lucide-react v0.536.0 - ISC
102
+ * @license lucide-react v0.537.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 tR=[["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"}]],eR=Ha("plug",tR);/**
107
- * @license lucide-react v0.536.0 - ISC
107
+ * @license lucide-react v0.537.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 nR=[["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"}]],aR=Ha("scan-eye",nR);/**
112
- * @license lucide-react v0.536.0 - ISC
112
+ * @license lucide-react v0.537.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"}]],Wv=Ha("square-terminal",rR);/**
117
- * @license lucide-react v0.536.0 - ISC
117
+ * @license lucide-react v0.537.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 iR=[["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"}]],sR=Ha("wrench",iR);/**
122
- * @license lucide-react v0.536.0 - ISC
122
+ * @license lucide-react v0.537.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,...i){const s=new this(a);return i.forEach(l=>s.set(l)),s}static accessor(a){const s=(this[Uy]=this[Uy]={accessors:{}}).accessors,l=this.prototype;function c(f){const h=Ps(f);s[h]||(wO(l,f),s[h]=!0)}return Q.isArray(a)?a.forEach(c):c(a),this}};ke.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Q.reduceDescriptors(ke.prototype,({value:e},a)=>{let i=a[0].toUpperCase()+a.slice(1);return{get:()=>e,set(s){this[i]=s}}});Q.freezeMethods(ke);function od(e,a){const i=this||so,s=a||i,l=ke.from(s.headers);let c=s.data;return Q.forEach(e,function(h){c=h.call(i,c,l.normalize(),a?a.status:void 0)}),l.normalize(),c}function E1(e){return!!(e&&e.__CANCEL__)}function ji(e,a,i){wt.call(this,e??"canceled",wt.ERR_CANCELED,a,i),this.name="CanceledError"}Q.inherits(ji,wt,{__CANCEL__:!0});function R1(e,a,i){const s=i.config.validateStatus;!i.status||!s||s(i.status)?e(i):a(new wt("Request failed with status code "+i.status,[wt.ERR_BAD_REQUEST,wt.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i))}function EO(e){const a=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return a&&a[1]||""}function RO(e,a){e=e||10;const i=new Array(e),s=new Array(e);let l=0,c=0,f;return a=a!==void 0?a:1e3,function(m){const p=Date.now(),v=s[c];f||(f=p),i[l]=m,s[l]=p;let g=c,b=0;for(;g!==l;)b+=i[g++],g=g%e;if(l=(l+1)%e,l===c&&(c=(c+1)%e),p-f<a)return;const w=v&&p-v;return w?Math.round(b*1e3/w):void 0}}function _O(e,a){let i=0,s=1e3/a,l,c;const f=(p,v=Date.now())=>{i=v,l=null,c&&(clearTimeout(c),c=null),e(...p)};return[(...p)=>{const v=Date.now(),g=v-i;g>=s?f(p,v):(l=p,c||(c=setTimeout(()=>{c=null,f(l)},s-g)))},()=>l&&f(l)]}const nu=(e,a,i=3)=>{let s=0;const l=RO(50,250);return _O(c=>{const f=c.loaded,h=c.lengthComputable?c.total:void 0,m=f-s,p=l(m),v=f<=h;s=f;const g={loaded:f,total:h,progress:h?f/h:void 0,bytes:m,rate:p||void 0,estimated:p&&h&&v?(h-f)/p:void 0,event:c,lengthComputable:h!=null,[a?"download":"upload"]:!0};e(g)},i)},By=(e,a)=>{const i=e!=null;return[s=>a[0]({lengthComputable:i,total:e,loaded:s}),a[1]]},ky=e=>(...a)=>Q.asap(()=>e(...a)),TO=Te.hasStandardBrowserEnv?((e,a)=>i=>(i=new URL(i,Te.origin),e.protocol===i.protocol&&e.host===i.host&&(a||e.port===i.port)))(new URL(Te.origin),Te.navigator&&/(msie|trident)/i.test(Te.navigator.userAgent)):()=>!0,CO=Te.hasStandardBrowserEnv?{write(e,a,i,s,l,c){const f=[e+"="+encodeURIComponent(a)];Q.isNumber(i)&&f.push("expires="+new Date(i).toGMTString()),Q.isString(s)&&f.push("path="+s),Q.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 AO(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function OO(e,a){return a?e.replace(/\/?\/$/,"")+"/"+a.replace(/^\/+/,""):e}function _1(e,a,i){let s=!AO(a);return e&&(s||i==!1)?OO(e,a):a}const Py=e=>e instanceof ke?{...e}:e;function yr(e,a){a=a||{};const i={};function s(p,v,g,b){return Q.isPlainObject(p)&&Q.isPlainObject(v)?Q.merge.call({caseless:b},p,v):Q.isPlainObject(v)?Q.merge({},v):Q.isArray(v)?v.slice():v}function l(p,v,g,b){if(Q.isUndefined(v)){if(!Q.isUndefined(p))return s(void 0,p,g,b)}else return s(p,v,g,b)}function c(p,v){if(!Q.isUndefined(v))return s(void 0,v)}function f(p,v){if(Q.isUndefined(v)){if(!Q.isUndefined(p))return s(void 0,p)}else return s(void 0,v)}function h(p,v,g){if(g in a)return s(p,v);if(g in e)return s(void 0,p)}const m={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:(p,v,g)=>l(Py(p),Py(v),g,!0)};return Q.forEach(Object.keys({...e,...a}),function(v){const g=m[v]||l,b=g(e[v],a[v],v);Q.isUndefined(b)&&g!==h||(i[v]=b)}),i}const T1=e=>{const a=yr({},e);let{data:i,withXSRFToken:s,xsrfHeaderName:l,xsrfCookieName:c,headers:f,auth:h}=a;a.headers=f=ke.from(f),a.url=S1(_1(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 m;if(Q.isFormData(i)){if(Te.hasStandardBrowserEnv||Te.hasStandardBrowserWebWorkerEnv)f.setContentType(void 0);else if((m=f.getContentType())!==!1){const[p,...v]=m?m.split(";").map(g=>g.trim()).filter(Boolean):[];f.setContentType([p||"multipart/form-data",...v].join("; "))}}if(Te.hasStandardBrowserEnv&&(s&&Q.isFunction(s)&&(s=s(a)),s||s!==!1&&TO(a.url))){const p=l&&c&&CO.read(c);p&&f.set(l,p)}return a},MO=typeof XMLHttpRequest<"u",DO=MO&&function(e){return new Promise(function(i,s){const l=T1(e);let c=l.data;const f=ke.from(l.headers).normalize();let{responseType:h,onUploadProgress:m,onDownloadProgress:p}=l,v,g,b,w,x;function S(){w&&w(),x&&x(),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 N=ke.from("getAllResponseHeaders"in T&&T.getAllResponseHeaders()),z={data:!h||h==="text"||h==="json"?T.responseText:T.response,status:T.status,statusText:T.statusText,headers:N,config:e,request:T};R1(function(k){i(k),S()},function(k){s(k),S()},z),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 wt("Request aborted",wt.ECONNABORTED,e,T)),T=null)},T.onerror=function(){s(new wt("Network Error",wt.ERR_NETWORK,e,T)),T=null},T.ontimeout=function(){let U=l.timeout?"timeout of "+l.timeout+"ms exceeded":"timeout exceeded";const z=l.transitional||x1;l.timeoutErrorMessage&&(U=l.timeoutErrorMessage),s(new wt(U,z.clarifyTimeoutError?wt.ETIMEDOUT:wt.ECONNABORTED,e,T)),T=null},c===void 0&&f.setContentType(null),"setRequestHeader"in T&&Q.forEach(f.toJSON(),function(U,z){T.setRequestHeader(z,U)}),Q.isUndefined(l.withCredentials)||(T.withCredentials=!!l.withCredentials),h&&h!=="json"&&(T.responseType=l.responseType),p&&([b,x]=nu(p,!0),T.addEventListener("progress",b)),m&&T.upload&&([g,w]=nu(m),T.upload.addEventListener("progress",g),T.upload.addEventListener("loadend",w)),(l.cancelToken||l.signal)&&(v=N=>{T&&(s(!N||N.type?new ji(null,e,T):N),T.abort(),T=null)},l.cancelToken&&l.cancelToken.subscribe(v),l.signal&&(l.signal.aborted?v():l.signal.addEventListener("abort",v)));const L=EO(l.url);if(L&&Te.protocols.indexOf(L)===-1){s(new wt("Unsupported protocol "+L+":",wt.ERR_BAD_REQUEST,e));return}T.send(c||null)})},NO=(e,a)=>{const{length:i}=e=e?e.filter(Boolean):[];if(a||i){let s=new AbortController,l;const c=function(p){if(!l){l=!0,h();const v=p instanceof Error?p:this.reason;s.abort(v instanceof wt?v:new ji(v instanceof Error?v.message:v))}};let f=a&&setTimeout(()=>{f=null,c(new wt(`timeout ${a} of ms exceeded`,wt.ETIMEDOUT))},a);const h=()=>{e&&(f&&clearTimeout(f),f=null,e.forEach(p=>{p.unsubscribe?p.unsubscribe(c):p.removeEventListener("abort",c)}),e=null)};e.forEach(p=>p.addEventListener("abort",c));const{signal:m}=s;return m.unsubscribe=()=>Q.asap(h),m}},LO=function*(e,a){let i=e.byteLength;if(i<a){yield e;return}let s=0,l;for(;s<i;)l=s+a,yield e.slice(s,l),s=l},jO=async function*(e,a){for await(const i of zO(e))yield*LO(i,a)},zO=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const a=e.getReader();try{for(;;){const{done:i,value:s}=await a.read();if(i)break;yield s}}finally{await a.cancel()}},Hy=(e,a,i,s)=>{const l=jO(e,a);let c=0,f,h=m=>{f||(f=!0,s&&s(m))};return new ReadableStream({async pull(m){try{const{done:p,value:v}=await l.next();if(p){h(),m.close();return}let g=v.byteLength;if(i){let b=c+=g;i(b)}m.enqueue(new Uint8Array(v))}catch(p){throw h(p),p}},cancel(m){return h(m),l.return()}},{highWaterMark:2})},xu=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",C1=xu&&typeof ReadableStream=="function",UO=xu&&(typeof TextEncoder=="function"?(e=>a=>e.encode(a))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),A1=(e,...a)=>{try{return!!e(...a)}catch{return!1}},BO=C1&&A1(()=>{let e=!1;const a=new Request(Te.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!a}),qy=64*1024,Ld=C1&&A1(()=>Q.isReadableStream(new Response("").body)),au={stream:Ld&&(e=>e.body)};xu&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(a=>{!au[a]&&(au[a]=Q.isFunction(e[a])?i=>i[a]():(i,s)=>{throw new wt(`Response type '${a}' is not supported`,wt.ERR_NOT_SUPPORT,s)})})})(new Response);const kO=async e=>{if(e==null)return 0;if(Q.isBlob(e))return e.size;if(Q.isSpecCompliantForm(e))return(await new Request(Te.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(Q.isArrayBufferView(e)||Q.isArrayBuffer(e))return e.byteLength;if(Q.isURLSearchParams(e)&&(e=e+""),Q.isString(e))return(await UO(e)).byteLength},PO=async(e,a)=>{const i=Q.toFiniteNumber(e.getContentLength());return i??kO(a)},HO=xu&&(async e=>{let{url:a,method:i,data:s,signal:l,cancelToken:c,timeout:f,onDownloadProgress:h,onUploadProgress:m,responseType:p,headers:v,withCredentials:g="same-origin",fetchOptions:b}=T1(e);p=p?(p+"").toLowerCase():"text";let w=NO([l,c&&c.toAbortSignal()],f),x;const S=w&&w.unsubscribe&&(()=>{w.unsubscribe()});let T;try{if(m&&BO&&i!=="get"&&i!=="head"&&(T=await PO(v,s))!==0){let z=new Request(a,{method:"POST",body:s,duplex:"half"}),X;if(Q.isFormData(s)&&(X=z.headers.get("content-type"))&&v.setContentType(X),z.body){const[k,q]=By(T,nu(ky(m)));s=Hy(z.body,qy,k,q)}}Q.isString(g)||(g=g?"include":"omit");const C="credentials"in Request.prototype;x=new Request(a,{...b,signal:w,method:i.toUpperCase(),headers:v.normalize().toJSON(),body:s,duplex:"half",credentials:C?g:void 0});let L=await fetch(x,b);const N=Ld&&(p==="stream"||p==="response");if(Ld&&(h||N&&S)){const z={};["status","statusText","headers"].forEach(et=>{z[et]=L[et]});const X=Q.toFiniteNumber(L.headers.get("content-length")),[k,q]=h&&By(X,nu(ky(h),!0))||[];L=new Response(Hy(L.body,qy,k,()=>{q&&q(),S&&S()}),z)}p=p||"text";let U=await au[Q.findKey(au,p)||"text"](L,e);return!N&&S&&S(),await new Promise((z,X)=>{R1(z,X,{data:U,headers:ke.from(L.headers),status:L.status,statusText:L.statusText,config:e,request:x})})}catch(C){throw S&&S(),C&&C.name==="TypeError"&&/Load failed|fetch/i.test(C.message)?Object.assign(new wt("Network Error",wt.ERR_NETWORK,e,x),{cause:C.cause||C}):wt.from(C,C&&C.code,e,x)}}),jd={http:eO,xhr:DO,fetch:HO};Q.forEach(jd,(e,a)=>{if(e){try{Object.defineProperty(e,"name",{value:a})}catch{}Object.defineProperty(e,"adapterName",{value:a})}});const Vy=e=>`- ${e}`,qO=e=>Q.isFunction(e)||e===null||e===!1,O1={getAdapter:e=>{e=Q.isArray(e)?e:[e];const{length:a}=e;let i,s;const l={};for(let c=0;c<a;c++){i=e[c];let f;if(s=i,!qO(i)&&(s=jd[(f=String(i)).toLowerCase()],s===void 0))throw new wt(`Unknown adapter '${f}'`);if(s)break;l[f||"#"+c]=s}if(!s){const c=Object.entries(l).map(([h,m])=>`adapter ${h} `+(m===!1?"is not supported by the environment":"is not available in the build"));let f=a?c.length>1?`since :
173
173
  `+c.map(Vy).join(`
174
174
  `):" "+Vy(c[0]):"as no adapter specified";throw new wt("There is no suitable adapter to dispatch the request "+f,"ERR_NOT_SUPPORT")}return s},adapters:jd};function ld(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ji(null,e)}function Gy(e){return ld(e),e.headers=ke.from(e.headers),e.data=od.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),O1.getAdapter(e.adapter||so.adapter)(e).then(function(s){return ld(e),s.data=od.call(e,e.transformResponse,s),s.headers=ke.from(s.headers),s},function(s){return E1(s)||(ld(e),s&&s.response&&(s.response.data=od.call(e,e.transformResponse,s.response),s.response.headers=ke.from(s.response.headers))),Promise.reject(s)})}const M1="1.11.0",wu={};["object","boolean","number","function","string","symbol"].forEach((e,a)=>{wu[e]=function(s){return typeof s===e||"a"+(a<1?"n ":" ")+e}});const Fy={};wu.transitional=function(a,i,s){function l(c,f){return"[Axios v"+M1+"] Transitional option '"+c+"'"+f+(s?". "+s:"")}return(c,f,h)=>{if(a===!1)throw new wt(l(f," has been removed"+(i?" in "+i:"")),wt.ERR_DEPRECATED);return i&&!Fy[f]&&(Fy[f]=!0,console.warn(l(f," has been deprecated since v"+i+" and will be removed in the near future"))),a?a(c,f,h):!0}};wu.spelling=function(a){return(i,s)=>(console.warn(`${s} is likely a misspelling of ${a}`),!0)};function VO(e,a,i){if(typeof e!="object")throw new wt("options must be an object",wt.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],m=h===void 0||f(h,c,e);if(m!==!0)throw new wt("option "+c+" must be "+m,wt.ERR_BAD_OPTION_VALUE);continue}if(i!==!0)throw new wt("Unknown option "+c,wt.ERR_BAD_OPTION)}}const ql={assertOptions:VO,validators:wu},Mn=ql.validators;let dr=class{constructor(a){this.defaults=a||{},this.interceptors={request:new zy,response:new zy}}async request(a,i){try{return await this._request(a,i)}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,i){typeof a=="string"?(i=i||{},i.url=a):i=a||{},i=yr(this.defaults,i);const{transitional:s,paramsSerializer:l,headers:c}=i;s!==void 0&&ql.assertOptions(s,{silentJSONParsing:Mn.transitional(Mn.boolean),forcedJSONParsing:Mn.transitional(Mn.boolean),clarifyTimeoutError:Mn.transitional(Mn.boolean)},!1),l!=null&&(Q.isFunction(l)?i.paramsSerializer={serialize:l}:ql.assertOptions(l,{encode:Mn.function,serialize:Mn.function},!0)),i.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?i.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:i.allowAbsoluteUrls=!0),ql.assertOptions(i,{baseUrl:Mn.spelling("baseURL"),withXsrfToken:Mn.spelling("withXSRFToken")},!0),i.method=(i.method||this.defaults.method||"get").toLowerCase();let f=c&&Q.merge(c.common,c[i.method]);c&&Q.forEach(["delete","get","head","post","put","patch","common"],x=>{delete c[x]}),i.headers=ke.concat(f,c);const h=[];let m=!0;this.interceptors.request.forEach(function(S){typeof S.runWhen=="function"&&S.runWhen(i)===!1||(m=m&&S.synchronous,h.unshift(S.fulfilled,S.rejected))});const p=[];this.interceptors.response.forEach(function(S){p.push(S.fulfilled,S.rejected)});let v,g=0,b;if(!m){const x=[Gy.bind(this),void 0];for(x.unshift(...h),x.push(...p),b=x.length,v=Promise.resolve(i);g<b;)v=v.then(x[g++],x[g++]);return v}b=h.length;let w=i;for(g=0;g<b;){const x=h[g++],S=h[g++];try{w=x(w)}catch(T){S.call(this,T);break}}try{v=Gy.call(this,w)}catch(x){return Promise.reject(x)}for(g=0,b=p.length;g<b;)v=v.then(p[g++],p[g++]);return v}getUri(a){a=yr(this.defaults,a);const i=_1(a.baseURL,a.url,a.allowAbsoluteUrls);return S1(i,a.params,a.paramsSerializer)}};Q.forEach(["delete","get","head","options"],function(a){dr.prototype[a]=function(i,s){return this.request(yr(s||{},{method:a,url:i,data:(s||{}).data}))}});Q.forEach(["post","put","patch"],function(a){function i(s){return function(c,f,h){return this.request(yr(h||{},{method:a,headers:s?{"Content-Type":"multipart/form-data"}:{},url:c,data:f}))}}dr.prototype[a]=i(),dr.prototype[a+"Form"]=i(!0)});let GO=class D1{constructor(a){if(typeof a!="function")throw new TypeError("executor must be a function.");let i;this.promise=new Promise(function(c){i=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 ji(c,f,h),i(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 i=this._listeners.indexOf(a);i!==-1&&this._listeners.splice(i,1)}toAbortSignal(){const a=new AbortController,i=s=>{a.abort(s)};return this.subscribe(i),a.signal.unsubscribe=()=>this.unsubscribe(i),a.signal}static source(){let a;return{token:new D1(function(l){a=l}),cancel:a}}};function FO(e){return function(i){return e.apply(null,i)}}function YO(e){return Q.isObject(e)&&e.isAxiosError===!0}const zd={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(zd).forEach(([e,a])=>{zd[a]=e});function N1(e){const a=new dr(e),i=l1(dr.prototype.request,a);return Q.extend(i,dr.prototype,a,{allOwnKeys:!0}),Q.extend(i,a,null,{allOwnKeys:!0}),i.create=function(l){return N1(yr(e,l))},i}const ne=N1(so);ne.Axios=dr;ne.CanceledError=ji;ne.CancelToken=GO;ne.isCancel=E1;ne.VERSION=M1;ne.toFormData=Su;ne.AxiosError=wt;ne.Cancel=ne.CanceledError;ne.all=function(a){return Promise.all(a)};ne.spread=FO;ne.isAxiosError=YO;ne.mergeConfig=yr;ne.AxiosHeaders=ke;ne.formToJSON=e=>w1(Q.isHTMLForm(e)?new FormData(e):e);ne.getAdapter=O1.getAdapter;ne.HttpStatusCode=zd;ne.default=ne;const{Axios:h3,AxiosError:m3,CanceledError:p3,isCancel:g3,CancelToken:v3,VERSION:y3,all:b3,Cancel:S3,isAxiosError:x3,spread:w3,toFormData:E3,AxiosHeaders:R3,HttpStatusCode:_3,formToJSON:T3,getAdapter:C3,mergeConfig:A3}=ne,Ch=ne.create({baseURL:"/api"});Ch.interceptors.request.use(e=>{const a=localStorage.getItem("access_token");return a&&(e.headers.Authorization=`Bearer ${a}`),e});Ch.interceptors.response.use(e=>e,e=>(e.response.status===401&&(localStorage.removeItem("access_token"),window.location.href="/"),Promise.reject(e)));class Yy{constructor(a,i){this.client=a,this.data=i}}class QO{constructor(a){this.client=a}async fetch(){const{data:a}=await this.client.api.get("/events");return a.events}}class KO{constructor(a){this.client=a}async fetch(){const{data:a}=await this.client.api.get("/guilds");return a.guilds}}class XO{constructor(a){this.client=a}async fetch(){const{data:a}=await this.client.api.get("/plugins");return a.plugins}}class $O{api=Ch;guilds=new KO(this);plugins=new XO(this);events=new QO(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:i}=await this.api.get("/auth/@me");return this._user=new Yy(this,i),this._user}async getFeatureFlags(){const{data:a}=await this.api.get("/feature-flags");return a}async login(a,i){const{data:s}=await this.api.post("/auth/login",{username:a,password:i});return s.accessToken&&localStorage.setItem("access_token",s.accessToken),this._user=new Yy(this,s.user),s}}const L1=R.createContext(null);function ZO({children:e}){const[a,i]=R.useState(()=>new $O);return _.jsx(L1.Provider,{value:{client:a,setClient:i},children:e})}function Ah(){const e=R.use(L1);if(!e)throw new Error("useClient must be used within a ClientProvider");return e.client}const ud={navMain:[{title:"Commands",url:"/commands",icon:Wv,isActive:!1},{title:"Events",url:"/events",icon:Iv,isActive:!1},{title:"Plugins",url:"/plugins",icon:eR,isActive:!1},{title:"Guilds",url:"/guilds",icon:ey,isActive:!1},{title:"Feature Flags",url:"/feature-flags",icon:aR,isActive:!1}],navSecondary:[{title:"GitHub",url:"https://github.com/underctrl-io/commandkit",icon:gR},{title:"Discord",url:"https://ctrl.lol/discord",icon:ey}],projects:[{name:"Commands",url:"#",icon:Wv},{name:"Middlewares",url:"#",icon:sR},{name:"Events",url:"#",icon:Iv}]};function IO({...e}){const a=Ah();return _.jsxs(YC,{className:"top-(--header-height) h-[calc(100svh-var(--header-height))]!",...e,children:[_.jsx(KC,{children:_.jsx(to,{children:_.jsx(eo,{children:_.jsx(no,{size:"lg",asChild:!0,children:_.jsxs(Ci,{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($C,{children:[_.jsx(WC,{items:ud.navMain}),_.jsx(JC,{projects:ud.projects}),_.jsx(tA,{items:ud.navSecondary,className:"mt-auto"})]}),_.jsx(XC,{children:_.jsx(pA,{user:{avatar:a.user.data.displayAvatarURL,name:a.user.data.globalName||a.user?.data.username,username:a.user.data.username}})})]})}function WO({className:e,...a}){return _.jsx("div",{"data-slot":"card",className:Rt("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...a})}function JO({className:e,...a}){return _.jsx("div",{"data-slot":"card-header",className:Rt("@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 tM({className:e,...a}){return _.jsx("div",{"data-slot":"card-title",className:Rt("leading-none font-semibold",e),...a})}function eM({className:e,...a}){return _.jsx("div",{"data-slot":"card-description",className:Rt("text-muted-foreground text-sm",e),...a})}function nM({className:e,...a}){return _.jsx("div",{"data-slot":"card-content",className:Rt("px-6",e),...a})}function O3({className:e,...a}){return _.jsx("div",{"data-slot":"card-footer",className:Rt("flex items-center px-6 [.border-t]:pt-6",e),...a})}var aM="Label",j1=R.forwardRef((e,a)=>_.jsx(Zt.label,{...e,ref:a,onMouseDown:i=>{i.target.closest("button, input, select, textarea")||(e.onMouseDown?.(i),!i.defaultPrevented&&i.detail>1&&i.preventDefault())}}));j1.displayName=aM;var rM=j1;function Qy({className:e,...a}){return _.jsx(rM,{"data-slot":"label",className:Rt("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 Ky=e=>{let a;const i=new Set,s=(p,v)=>{const g=typeof p=="function"?p(a):p;if(!Object.is(g,a)){const b=a;a=v??(typeof g!="object"||g===null)?g:Object.assign({},a,g),i.forEach(w=>w(a,b))}},l=()=>a,h={setState:s,getState:l,getInitialState:()=>m,subscribe:p=>(i.add(p),()=>i.delete(p))},m=a=e(s,l,h);return h},iM=e=>e?Ky(e):Ky,sM=e=>e;function oM(e,a=sM){const i=tt.useSyncExternalStore(e.subscribe,tt.useCallback(()=>a(e.getState()),[e,a]),tt.useCallback(()=>a(e.getInitialState()),[e,a]));return tt.useDebugValue(i),i}const Xy=e=>{const a=iM(e),i=s=>oM(a,s);return Object.assign(i,a),i},lM=e=>e?Xy(e):Xy,z1=lM(e=>({authenticated:!1,setAuthenticated:a=>e({authenticated:a})}));function uM(e){if(typeof document>"u")return;let a=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",a.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}const cM=e=>{switch(e){case"success":return hM;case"info":return pM;case"warning":return mM;case"error":return gM;default:return null}},fM=Array(12).fill(0),dM=({visible:e,className:a})=>tt.createElement("div",{className:["sonner-loading-wrapper",a].filter(Boolean).join(" "),"data-visible":e},tt.createElement("div",{className:"sonner-spinner"},fM.map((i,s)=>tt.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),hM=tt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},tt.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"})),mM=tt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},tt.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"})),pM=tt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},tt.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"})),gM=tt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},tt.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"})),vM=tt.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"},tt.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),tt.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),yM=()=>{const[e,a]=tt.useState(document.hidden);return tt.useEffect(()=>{const i=()=>{a(document.hidden)};return document.addEventListener("visibilitychange",i),()=>window.removeEventListener("visibilitychange",i)},[]),e};let Ud=1;class bM{constructor(){this.subscribe=a=>(this.subscribers.push(a),()=>{const i=this.subscribers.indexOf(a);this.subscribers.splice(i,1)}),this.publish=a=>{this.subscribers.forEach(i=>i(a))},this.addToast=a=>{this.publish(a),this.toasts=[...this.toasts,a]},this.create=a=>{var i;const{message:s,...l}=a,c=typeof a?.id=="number"||((i=a.id)==null?void 0:i.length)>0?a.id:Ud++,f=this.toasts.find(m=>m.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(m=>m.id===c?(this.publish({...m,...a,id:c,title:s}),{...m,...a,id:c,dismissible:h,title:s}):m):this.addToast({title:s,...l,dismissible:h,id:c}),c},this.dismiss=a=>(a?(this.dismissedToasts.add(a),requestAnimationFrame(()=>this.subscribers.forEach(i=>i({id:a,dismiss:!0})))):this.toasts.forEach(i=>{this.subscribers.forEach(s=>s({id:i.id,dismiss:!0}))}),a),this.message=(a,i)=>this.create({...i,message:a}),this.error=(a,i)=>this.create({...i,message:a,type:"error"}),this.success=(a,i)=>this.create({...i,type:"success",message:a}),this.info=(a,i)=>this.create({...i,type:"info",message:a}),this.warning=(a,i)=>this.create({...i,type:"warning",message:a}),this.loading=(a,i)=>this.create({...i,type:"loading",message:a}),this.promise=(a,i)=>{if(!i)return;let s;i.loading!==void 0&&(s=this.create({...i,promise:a,type:"loading",message:i.loading,description:typeof i.description!="function"?i.description:void 0}));const l=Promise.resolve(a instanceof Function?a():a);let c=s!==void 0,f;const h=l.then(async p=>{if(f=["resolve",p],tt.isValidElement(p))c=!1,this.create({id:s,type:"default",message:p});else if(xM(p)&&!p.ok){c=!1;const g=typeof i.error=="function"?await i.error(`HTTP error! status: ${p.status}`):i.error,b=typeof i.description=="function"?await i.description(`HTTP error! status: ${p.status}`):i.description,x=typeof g=="object"&&!tt.isValidElement(g)?g:{message:g};this.create({id:s,type:"error",description:b,...x})}else if(p instanceof Error){c=!1;const g=typeof i.error=="function"?await i.error(p):i.error,b=typeof i.description=="function"?await i.description(p):i.description,x=typeof g=="object"&&!tt.isValidElement(g)?g:{message:g};this.create({id:s,type:"error",description:b,...x})}else if(i.success!==void 0){c=!1;const g=typeof i.success=="function"?await i.success(p):i.success,b=typeof i.description=="function"?await i.description(p):i.description,x=typeof g=="object"&&!tt.isValidElement(g)?g:{message:g};this.create({id:s,type:"success",description:b,...x})}}).catch(async p=>{if(f=["reject",p],i.error!==void 0){c=!1;const v=typeof i.error=="function"?await i.error(p):i.error,g=typeof i.description=="function"?await i.description(p):i.description,w=typeof v=="object"&&!tt.isValidElement(v)?v:{message:v};this.create({id:s,type:"error",description:g,...w})}}).finally(()=>{c&&(this.dismiss(s),s=void 0),i.finally==null||i.finally.call(i)}),m=()=>new Promise((p,v)=>h.then(()=>f[0]==="reject"?v(f[1]):p(f[1])).catch(v));return typeof s!="string"&&typeof s!="number"?{unwrap:m}:Object.assign(s,{unwrap:m})},this.custom=(a,i)=>{const s=i?.id||Ud++;return this.create({jsx:a(s),id:s,...i}),s},this.getActiveToasts=()=>this.toasts.filter(a=>!this.dismissedToasts.has(a.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const ze=new bM,SM=(e,a)=>{const i=a?.id||Ud++;return ze.addToast({title:e,...a,id:i}),i},xM=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",wM=SM,EM=()=>ze.toasts,RM=()=>ze.getActiveToasts(),$y=Object.assign(wM,{success:ze.success,info:ze.info,warning:ze.warning,error:ze.error,custom:ze.custom,message:ze.message,promise:ze.promise,dismiss:ze.dismiss,loading:ze.loading},{getHistory:EM,getToasts:RM});uM("[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 Ll(e){return e.label!==void 0}const _M=3,TM="24px",CM="16px",Zy=4e3,AM=356,OM=14,MM=45,DM=200;function Dn(...e){return e.filter(Boolean).join(" ")}function NM(e){const[a,i]=e.split("-"),s=[];return a&&s.push(a),i&&s.push(i),s}const LM=e=>{var a,i,s,l,c,f,h,m,p;const{invert:v,toast:g,unstyled:b,interacting:w,setHeights:x,visibleToasts:S,heights:T,index:C,toasts:L,expanded:N,removeToast:U,defaultRichColors:z,closeButton:X,style:k,cancelButtonStyle:q,actionButtonStyle:et,className:I="",descriptionClassName:st="",duration:rt,position:ut,gap:pt,expandByDefault:ct,classNames:M,icons:F,closeButtonAriaLabel:B="Close toast"}=e,[ot,A]=tt.useState(null),[K,at]=tt.useState(null),[Y,J]=tt.useState(!1),[it,nt]=tt.useState(!1),[ft,lt]=tt.useState(!1),[St,Dt]=tt.useState(!1),[Lt,zt]=tt.useState(!1),[ve,wn]=tt.useState(0),[Bi,Er]=tt.useState(0),fe=tt.useRef(g.duration||rt||Zy),Bn=tt.useRef(null),ye=tt.useRef(null),qa=C===0,kn=C+1<=S,_t=g.type,Yt=g.dismissible!==!1,Xe=g.className||"",oo=g.descriptionClassName||"",En=tt.useMemo(()=>T.findIndex(xt=>xt.toastId===g.id)||0,[T,g.id]),Ce=tt.useMemo(()=>{var xt;return(xt=g.closeButton)!=null?xt:X},[g.closeButton,X]),hn=tt.useMemo(()=>g.duration||rt||Zy,[g.duration,rt]),be=tt.useRef(0),la=tt.useRef(0),lo=tt.useRef(0),ua=tt.useRef(null),[Rr,_r]=ut.split("-"),Rn=tt.useMemo(()=>T.reduce((xt,It,ae)=>ae>=En?xt:xt+It.height,0),[T,En]),Va=yM(),Ga=g.invert||v,ki=_t==="loading";la.current=tt.useMemo(()=>En*pt+Rn,[En,Rn]),tt.useEffect(()=>{fe.current=hn},[hn]),tt.useEffect(()=>{J(!0)},[]),tt.useEffect(()=>{const xt=ye.current;if(xt){const It=xt.getBoundingClientRect().height;return Er(It),x(ae=>[{toastId:g.id,height:It,position:g.position},...ae]),()=>x(ae=>ae.filter(Se=>Se.toastId!==g.id))}},[x,g.id]),tt.useLayoutEffect(()=>{if(!Y)return;const xt=ye.current,It=xt.style.height;xt.style.height="auto";const ae=xt.getBoundingClientRect().height;xt.style.height=It,Er(ae),x(Se=>Se.find(se=>se.toastId===g.id)?Se.map(se=>se.toastId===g.id?{...se,height:ae}:se):[{toastId:g.id,height:ae,position:g.position},...Se])},[Y,g.title,g.description,x,g.id,g.jsx,g.action,g.cancel]);const mn=tt.useCallback(()=>{nt(!0),wn(la.current),x(xt=>xt.filter(It=>It.toastId!==g.id)),setTimeout(()=>{U(g)},DM)},[g,U,x,la]);tt.useEffect(()=>{if(g.promise&&_t==="loading"||g.duration===1/0||g.type==="loading")return;let xt;return N||w||Va?(()=>{if(lo.current<be.current){const Se=new Date().getTime()-be.current;fe.current=fe.current-Se}lo.current=new Date().getTime()})():(()=>{fe.current!==1/0&&(be.current=new Date().getTime(),xt=setTimeout(()=>{g.onAutoClose==null||g.onAutoClose.call(g,g),mn()},fe.current))})(),()=>clearTimeout(xt)},[N,w,g,_t,Va,mn]),tt.useEffect(()=>{g.delete&&(mn(),g.onDismiss==null||g.onDismiss.call(g,g))},[mn,g.delete]);function uo(){var xt;if(F?.loading){var It;return tt.createElement("div",{className:Dn(M?.loader,g==null||(It=g.classNames)==null?void 0:It.loader,"sonner-loader"),"data-visible":_t==="loading"},F.loading)}return tt.createElement(dM,{className:Dn(M?.loader,g==null||(xt=g.classNames)==null?void 0:xt.loader),visible:_t==="loading"})}const Pi=g.icon||F?.[_t]||cM(_t);var ca,co;return tt.createElement("li",{tabIndex:0,ref:ye,className:Dn(I,Xe,M?.toast,g==null||(a=g.classNames)==null?void 0:a.toast,M?.default,M?.[_t],g==null||(i=g.classNames)==null?void 0:i[_t]),"data-sonner-toast":"","data-rich-colors":(ca=g.richColors)!=null?ca:z,"data-styled":!(g.jsx||g.unstyled||b),"data-mounted":Y,"data-promise":!!g.promise,"data-swiped":Lt,"data-removed":it,"data-visible":kn,"data-y-position":Rr,"data-x-position":_r,"data-index":C,"data-front":qa,"data-swiping":ft,"data-dismissible":Yt,"data-type":_t,"data-invert":Ga,"data-swipe-out":St,"data-swipe-direction":K,"data-expanded":!!(N||ct&&Y),"data-testid":g.testId,style:{"--index":C,"--toasts-before":C,"--z-index":L.length-C,"--offset":`${it?ve:la.current}px`,"--initial-height":ct?"auto":`${Bi}px`,...k,...g.style},onDragEnd:()=>{lt(!1),A(null),ua.current=null},onPointerDown:xt=>{xt.button!==2&&(ki||!Yt||(Bn.current=new Date,wn(la.current),xt.target.setPointerCapture(xt.pointerId),xt.target.tagName!=="BUTTON"&&(lt(!0),ua.current={x:xt.clientX,y:xt.clientY})))},onPointerUp:()=>{var xt,It,ae;if(St||!Yt)return;ua.current=null;const Se=Number(((xt=ye.current)==null?void 0:xt.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Fa=Number(((It=ye.current)==null?void 0:It.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),se=new Date().getTime()-((ae=Bn.current)==null?void 0:ae.getTime()),Wt=ot==="x"?Se:Fa,Jt=Math.abs(Wt)/se;if(Math.abs(Wt)>=MM||Jt>.11){wn(la.current),g.onDismiss==null||g.onDismiss.call(g,g),at(ot==="x"?Se>0?"right":"left":Fa>0?"down":"up"),mn(),Dt(!0);return}else{var Gt,de;(Gt=ye.current)==null||Gt.style.setProperty("--swipe-amount-x","0px"),(de=ye.current)==null||de.style.setProperty("--swipe-amount-y","0px")}zt(!1),lt(!1),A(null)},onPointerMove:xt=>{var It,ae,Se;if(!ua.current||!Yt||((It=window.getSelection())==null?void 0:It.toString().length)>0)return;const se=xt.clientY-ua.current.y,Wt=xt.clientX-ua.current.x;var Jt;const Gt=(Jt=e.swipeDirections)!=null?Jt:NM(ut);!ot&&(Math.abs(Wt)>1||Math.abs(se)>1)&&A(Math.abs(Wt)>Math.abs(se)?"x":"y");let de={x:0,y:0};const Tr=Pn=>1/(1.5+Math.abs(Pn)/20);if(ot==="y"){if(Gt.includes("top")||Gt.includes("bottom"))if(Gt.includes("top")&&se<0||Gt.includes("bottom")&&se>0)de.y=se;else{const Pn=se*Tr(se);de.y=Math.abs(Pn)<Math.abs(se)?Pn:se}}else if(ot==="x"&&(Gt.includes("left")||Gt.includes("right")))if(Gt.includes("left")&&Wt<0||Gt.includes("right")&&Wt>0)de.x=Wt;else{const Pn=Wt*Tr(Wt);de.x=Math.abs(Pn)<Math.abs(Wt)?Pn:Wt}(Math.abs(de.x)>0||Math.abs(de.y)>0)&&zt(!0),(ae=ye.current)==null||ae.style.setProperty("--swipe-amount-x",`${de.x}px`),(Se=ye.current)==null||Se.style.setProperty("--swipe-amount-y",`${de.y}px`)}},Ce&&!g.jsx&&_t!=="loading"?tt.createElement("button",{"aria-label":B,"data-disabled":ki,"data-close-button":!0,onClick:ki||!Yt?()=>{}:()=>{mn(),g.onDismiss==null||g.onDismiss.call(g,g)},className:Dn(M?.closeButton,g==null||(s=g.classNames)==null?void 0:s.closeButton)},(co=F?.close)!=null?co:vM):null,(_t||g.icon||g.promise)&&g.icon!==null&&(F?.[_t]!==null||g.icon)?tt.createElement("div",{"data-icon":"",className:Dn(M?.icon,g==null||(l=g.classNames)==null?void 0:l.icon)},g.promise||g.type==="loading"&&!g.icon?g.icon||uo():null,g.type!=="loading"?Pi:null):null,tt.createElement("div",{"data-content":"",className:Dn(M?.content,g==null||(c=g.classNames)==null?void 0:c.content)},tt.createElement("div",{"data-title":"",className:Dn(M?.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?tt.createElement("div",{"data-description":"",className:Dn(st,oo,M?.description,g==null||(h=g.classNames)==null?void 0:h.description)},typeof g.description=="function"?g.description():g.description):null),tt.isValidElement(g.cancel)?g.cancel:g.cancel&&Ll(g.cancel)?tt.createElement("button",{"data-button":!0,"data-cancel":!0,style:g.cancelButtonStyle||q,onClick:xt=>{Ll(g.cancel)&&Yt&&(g.cancel.onClick==null||g.cancel.onClick.call(g.cancel,xt),mn())},className:Dn(M?.cancelButton,g==null||(m=g.classNames)==null?void 0:m.cancelButton)},g.cancel.label):null,tt.isValidElement(g.action)?g.action:g.action&&Ll(g.action)?tt.createElement("button",{"data-button":!0,"data-action":!0,style:g.actionButtonStyle||et,onClick:xt=>{Ll(g.action)&&(g.action.onClick==null||g.action.onClick.call(g.action,xt),!xt.defaultPrevented&&mn())},className:Dn(M?.actionButton,g==null||(p=g.classNames)==null?void 0:p.actionButton)},g.action.label):null)};function Iy(){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 jM(e,a){const i={};return[e,a].forEach((s,l)=>{const c=l===1,f=c?"--mobile-offset":"--offset",h=c?CM:TM;function m(p){["top","right","bottom","left"].forEach(v=>{i[`${f}-${v}`]=typeof p=="number"?`${p}px`:p})}typeof s=="number"||typeof s=="string"?m(s):typeof s=="object"?["top","right","bottom","left"].forEach(p=>{s[p]===void 0?i[`${f}-${p}`]=h:i[`${f}-${p}`]=typeof s[p]=="number"?`${s[p]}px`:s[p]}):m(h)}),i}const zM=tt.forwardRef(function(a,i){const{id:s,invert:l,position:c="bottom-right",hotkey:f=["altKey","KeyT"],expand:h,closeButton:m,className:p,offset:v,mobileOffset:g,theme:b="light",richColors:w,duration:x,style:S,visibleToasts:T=_M,toastOptions:C,dir:L=Iy(),gap:N=OM,icons:U,containerAriaLabel:z="Notifications"}=a,[X,k]=tt.useState([]),q=tt.useMemo(()=>s?X.filter(Y=>Y.toasterId===s):X.filter(Y=>!Y.toasterId),[X,s]),et=tt.useMemo(()=>Array.from(new Set([c].concat(q.filter(Y=>Y.position).map(Y=>Y.position)))),[q,c]),[I,st]=tt.useState([]),[rt,ut]=tt.useState(!1),[pt,ct]=tt.useState(!1),[M,F]=tt.useState(b!=="system"?b:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),B=tt.useRef(null),ot=f.join("+").replace(/Key/g,"").replace(/Digit/g,""),A=tt.useRef(null),K=tt.useRef(!1),at=tt.useCallback(Y=>{k(J=>{var it;return(it=J.find(nt=>nt.id===Y.id))!=null&&it.delete||ze.dismiss(Y.id),J.filter(({id:nt})=>nt!==Y.id)})},[]);return tt.useEffect(()=>ze.subscribe(Y=>{if(Y.dismiss){requestAnimationFrame(()=>{k(J=>J.map(it=>it.id===Y.id?{...it,delete:!0}:it))});return}setTimeout(()=>{w0.flushSync(()=>{k(J=>{const it=J.findIndex(nt=>nt.id===Y.id);return it!==-1?[...J.slice(0,it),{...J[it],...Y},...J.slice(it+1)]:[Y,...J]})})})}),[X]),tt.useEffect(()=>{if(b!=="system"){F(b);return}if(b==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?F("dark"):F("light")),typeof window>"u")return;const Y=window.matchMedia("(prefers-color-scheme: dark)");try{Y.addEventListener("change",({matches:J})=>{F(J?"dark":"light")})}catch{Y.addListener(({matches:it})=>{try{F(it?"dark":"light")}catch(nt){console.error(nt)}})}},[b]),tt.useEffect(()=>{X.length<=1&&ut(!1)},[X]),tt.useEffect(()=>{const Y=J=>{var it;if(f.every(lt=>J[lt]||J.code===lt)){var ft;ut(!0),(ft=B.current)==null||ft.focus()}J.code==="Escape"&&(document.activeElement===B.current||(it=B.current)!=null&&it.contains(document.activeElement))&&ut(!1)};return document.addEventListener("keydown",Y),()=>document.removeEventListener("keydown",Y)},[f]),tt.useEffect(()=>{if(B.current)return()=>{A.current&&(A.current.focus({preventScroll:!0}),A.current=null,K.current=!1)}},[B.current]),tt.createElement("section",{ref:i,"aria-label":`${z} ${ot}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},et.map((Y,J)=>{var it;const[nt,ft]=Y.split("-");return q.length?tt.createElement("ol",{key:Y,dir:L==="auto"?Iy():L,tabIndex:-1,ref:B,className:p,"data-sonner-toaster":!0,"data-sonner-theme":M,"data-y-position":nt,"data-x-position":ft,style:{"--front-toast-height":`${((it=I[0])==null?void 0:it.height)||0}px`,"--width":`${AM}px`,"--gap":`${N}px`,...S,...jM(v,g)},onBlur:lt=>{K.current&&!lt.currentTarget.contains(lt.relatedTarget)&&(K.current=!1,A.current&&(A.current.focus({preventScroll:!0}),A.current=null))},onFocus:lt=>{lt.target instanceof HTMLElement&&lt.target.dataset.dismissible==="false"||K.current||(K.current=!0,A.current=lt.relatedTarget)},onMouseEnter:()=>ut(!0),onMouseMove:()=>ut(!0),onMouseLeave:()=>{pt||ut(!1)},onDragEnd:()=>ut(!1),onPointerDown:lt=>{lt.target instanceof HTMLElement&&lt.target.dataset.dismissible==="false"||ct(!0)},onPointerUp:()=>ct(!1)},q.filter(lt=>!lt.position&&J===0||lt.position===Y).map((lt,St)=>{var Dt,Lt;return tt.createElement(LM,{key:lt.id,icons:U,index:St,toast:lt,defaultRichColors:w,duration:(Dt=C?.duration)!=null?Dt:x,className:C?.className,descriptionClassName:C?.descriptionClassName,invert:l,visibleToasts:T,closeButton:(Lt=C?.closeButton)!=null?Lt:m,interacting:pt,position:Y,style:C?.style,unstyled:C?.unstyled,classNames:C?.classNames,cancelButtonStyle:C?.cancelButtonStyle,actionButtonStyle:C?.actionButtonStyle,closeButtonAriaLabel:C?.closeButtonAriaLabel,removeToast:at,toasts:q.filter(zt=>zt.position==lt.position),heights:I.filter(zt=>zt.position==lt.position),setHeights:st,expandByDefault:h,gap:N,expanded:rt,swipeDirections:a.swipeDirections})})):null}))});var zi=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(){}},br=typeof window>"u"||"Deno"in globalThis;function Oe(){}function UM(e,a){return typeof e=="function"?e(a):e}function Bd(e){return typeof e=="number"&&e>=0&&e!==1/0}function U1(e,a){return Math.max(e+(a||0)-Date.now(),0)}function Ua(e,a){return typeof e=="function"?e(a):e}function ln(e,a){return typeof e=="function"?e(a):e}function Wy(e,a){const{type:i="all",exact:s,fetchStatus:l,predicate:c,queryKey:f,stale:h}=e;if(f){if(s){if(a.queryHash!==Oh(f,a.options))return!1}else if(!Xs(a.queryKey,f))return!1}if(i!=="all"){const m=a.isActive();if(i==="active"&&!m||i==="inactive"&&m)return!1}return!(typeof h=="boolean"&&a.isStale()!==h||l&&l!==a.state.fetchStatus||c&&!c(a))}function Jy(e,a){const{exact:i,status:s,predicate:l,mutationKey:c}=e;if(c){if(!a.options.mutationKey)return!1;if(i){if(Sr(a.options.mutationKey)!==Sr(c))return!1}else if(!Xs(a.options.mutationKey,c))return!1}return!(s&&a.state.status!==s||l&&!l(a))}function Oh(e,a){return(a?.queryKeyHashFn||Sr)(e)}function Sr(e){return JSON.stringify(e,(a,i)=>kd(i)?Object.keys(i).sort().reduce((s,l)=>(s[l]=i[l],s),{}):i)}function Xs(e,a){return e===a?!0:typeof e!=typeof a?!1:e&&a&&typeof e=="object"&&typeof a=="object"?Object.keys(a).every(i=>Xs(e[i],a[i])):!1}function B1(e,a){if(e===a)return e;const i=t0(e)&&t0(a);if(i||kd(e)&&kd(a)){const s=i?e:Object.keys(e),l=s.length,c=i?a:Object.keys(a),f=c.length,h=i?[]:{},m=new Set(s);let p=0;for(let v=0;v<f;v++){const g=i?v:c[v];(!i&&m.has(g)||i)&&e[g]===void 0&&a[g]===void 0?(h[g]=void 0,p++):(h[g]=B1(e[g],a[g]),h[g]===e[g]&&e[g]!==void 0&&p++)}return l===f&&p===l?e:h}return a}function ru(e,a){if(!a||Object.keys(e).length!==Object.keys(a).length)return!1;for(const i in e)if(e[i]!==a[i])return!1;return!0}function t0(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function kd(e){if(!e0(e))return!1;const a=e.constructor;if(a===void 0)return!0;const i=a.prototype;return!(!e0(i)||!i.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function e0(e){return Object.prototype.toString.call(e)==="[object Object]"}function BM(e){return new Promise(a=>{setTimeout(a,e)})}function Pd(e,a,i){return typeof i.structuralSharing=="function"?i.structuralSharing(e,a):i.structuralSharing!==!1?B1(e,a):a}function kM(e,a,i=0){const s=[...e,a];return i&&s.length>i?s.slice(1):s}function PM(e,a,i=0){const s=[a,...e];return i&&s.length>i?s.slice(0,-1):s}var Mh=Symbol();function k1(e,a){return!e.queryFn&&a?.initialPromise?()=>a.initialPromise:!e.queryFn||e.queryFn===Mh?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function P1(e,a){return typeof e=="function"?e(...a):!!e}var HM=class extends zi{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!br&&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"}},Dh=new HM,qM=class extends zi{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!br&&window.addEventListener){const a=()=>e(!0),i=()=>e(!1);return window.addEventListener("online",a,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",a),window.removeEventListener("offline",i)}}}}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(i=>{i(e)}))}isOnline(){return this.#e}},iu=new qM;function Hd(){let e,a;const i=new Promise((l,c)=>{e=l,a=c});i.status="pending",i.catch(()=>{});function s(l){Object.assign(i,l),delete i.resolve,delete i.reject}return i.resolve=l=>{s({status:"fulfilled",value:l}),e(l)},i.reject=l=>{s({status:"rejected",reason:l}),a(l)},i}function VM(e){return Math.min(1e3*2**e,3e4)}function H1(e){return(e??"online")==="online"?iu.isOnline():!0}var q1=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function cd(e){return e instanceof q1}function V1(e){let a=!1,i=0,s=!1,l;const c=Hd(),f=S=>{s||(b(new q1(S)),e.abort?.())},h=()=>{a=!0},m=()=>{a=!1},p=()=>Dh.isFocused()&&(e.networkMode==="always"||iu.isOnline())&&e.canRun(),v=()=>H1(e.networkMode)&&e.canRun(),g=S=>{s||(s=!0,e.onSuccess?.(S),l?.(),c.resolve(S))},b=S=>{s||(s=!0,e.onError?.(S),l?.(),c.reject(S))},w=()=>new Promise(S=>{l=T=>{(s||p())&&S(T)},e.onPause?.()}).then(()=>{l=void 0,s||e.onContinue?.()}),x=()=>{if(s)return;let S;const T=i===0?e.initialPromise:void 0;try{S=T??e.fn()}catch(C){S=Promise.reject(C)}Promise.resolve(S).then(g).catch(C=>{if(s)return;const L=e.retry??(br?0:3),N=e.retryDelay??VM,U=typeof N=="function"?N(i,C):N,z=L===!0||typeof L=="number"&&i<L||typeof L=="function"&&L(i,C);if(a||!z){b(C);return}i++,e.onFail?.(i,C),BM(U).then(()=>p()?void 0:w()).then(()=>{a?b(C):x()})})};return{promise:c,cancel:f,continue:()=>(l?.(),c),cancelRetry:h,continueRetry:m,canStart:v,start:()=>(v()?x():w().then(x),c)}}var GM=e=>setTimeout(e,0);function FM(){let e=[],a=0,i=h=>{h()},s=h=>{h()},l=GM;const c=h=>{a?e.push(h):l(()=>{i(h)})},f=()=>{const h=e;e=[],h.length&&l(()=>{s(()=>{h.forEach(m=>{i(m)})})})};return{batch:h=>{let m;a++;try{m=h()}finally{a--,a||f()}return m},batchCalls:h=>(...m)=>{c(()=>{h(...m)})},schedule:c,setNotifyFunction:h=>{i=h},setBatchNotifyFunction:h=>{s=h},setScheduler:h=>{l=h}}}var ce=FM(),G1=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Bd(this.gcTime)&&(this.#e=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(br?1/0:300*1e3))}clearGcTimeout(){this.#e&&(clearTimeout(this.#e),this.#e=void 0)}},YM=class extends G1{#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=QM(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 i=Pd(this.state.data,e,this.options);return this.#i({data:i,type:"success",dataUpdatedAt:a?.updatedAt,manual:a?.manual}),i}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(Oe).catch(Oe):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>ln(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Mh||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Ua(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:!U1(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"})}fetch(e,a){if(this.state.fetchStatus!=="idle"){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 m=this.observers.find(p=>p.options.queryFn);m&&this.setOptions(m.options)}const i=new AbortController,s=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(this.#o=!0,i.signal)})},l=()=>{const m=k1(this.options,a),v=(()=>{const g={client:this.#a,queryKey:this.queryKey,meta:this.meta};return s(g),g})();return this.#o=!1,this.options.persister?this.options.persister(m,v,this):m(v)},f=(()=>{const m={fetchOptions:a,options:this.options,queryKey:this.queryKey,client:this.#a,state:this.state,fetchFn:l};return s(m),m})();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});const h=m=>{cd(m)&&m.silent||this.#i({type:"error",error:m}),cd(m)||(this.#n.config.onError?.(m,this),this.#n.config.onSettled?.(this.state.data,m,this)),this.scheduleGc()};return this.#r=V1({initialPromise:a?.initialPromise,fn:f.fetchFn,abort:i.abort.bind(i),onSuccess:m=>{if(m===void 0){h(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(m)}catch(p){h(p);return}this.#n.config.onSuccess?.(m,this),this.#n.config.onSettled?.(m,this.state.error,this),this.scheduleGc()},onError:h,onFail:(m,p)=>{this.#i({type:"failed",failureCount:m,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}),this.#r.start()}#i(e){const a=i=>{switch(e.type){case"failed":return{...i,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,...F1(i.data,this.options),fetchMeta:e.meta??null};case"success":return this.#t=void 0,{...i,data:e.data,dataUpdateCount:i.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=e.error;return cd(s)&&s.revert&&this.#t?{...this.#t,fetchStatus:"idle"}:{...i,error:s,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...e.state}}};this.state=a(this.state),ce.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function F1(e,a){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:H1(a.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function QM(e){const a=typeof e.initialData=="function"?e.initialData():e.initialData,i=a!==void 0,s=i?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:a,dataUpdateCount:0,dataUpdatedAt:i?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}var KM=class extends zi{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,a,i){const s=a.queryKey,l=a.queryHash??Oh(s,a);let c=this.get(l);return c||(c=new YM({client:e,queryKey:s,queryHash:l,options:e.defaultQueryOptions(a),state:i,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(){ce.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(i=>Wy(a,i))}findAll(e={}){const a=this.getAll();return Object.keys(e).length>0?a.filter(i=>Wy(e,i)):a}notify(e){ce.batch(()=>{this.listeners.forEach(a=>{a(e)})})}onFocus(){ce.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ce.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},XM=class extends G1{#e;#t;#n;constructor(e){super(),this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#e=[],this.state=e.state||Y1(),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=V1({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 i=this.state.status==="pending",s=!this.#n.canStart();try{if(i)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=i=>{switch(e.type){case"failed":return{...i,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,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{...i,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:e.error,failureCount:i.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=a(this.state),ce.batch(()=>{this.#e.forEach(i=>{i.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function Y1(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var $M=class extends zi{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,a,i){const s=new XM({mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(a),state:i});return this.add(s),s}add(e){this.#e.add(e);const a=jl(e);if(typeof a=="string"){const i=this.#t.get(a);i?i.push(e):this.#t.set(a,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const a=jl(e);if(typeof a=="string"){const i=this.#t.get(a);if(i)if(i.length>1){const s=i.indexOf(e);s!==-1&&i.splice(s,1)}else i[0]===e&&this.#t.delete(a)}}this.notify({type:"removed",mutation:e})}canRun(e){const a=jl(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=jl(e);return typeof a=="string"?this.#t.get(a)?.find(s=>s!==e&&s.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){ce.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(i=>Jy(a,i))}findAll(e={}){return this.getAll().filter(a=>Jy(e,a))}notify(e){ce.batch(()=>{this.listeners.forEach(a=>{a(e)})})}resumePausedMutations(){const e=this.getAll().filter(a=>a.state.isPaused);return ce.batch(()=>Promise.all(e.map(a=>a.continue().catch(Oe))))}};function jl(e){return e.options.scope?.id}function n0(e){return{onFetch:(a,i)=>{const s=a.options,l=a.fetchOptions?.meta?.fetchMore?.direction,c=a.state.data?.pages||[],f=a.state.data?.pageParams||[];let h={pages:[],pageParams:[]},m=0;const p=async()=>{let v=!1;const g=x=>{Object.defineProperty(x,"signal",{enumerable:!0,get:()=>(a.signal.aborted?v=!0:a.signal.addEventListener("abort",()=>{v=!0}),a.signal)})},b=k1(a.options,a.fetchOptions),w=async(x,S,T)=>{if(v)return Promise.reject();if(S==null&&x.pages.length)return Promise.resolve(x);const L=(()=>{const X={client:a.client,queryKey:a.queryKey,pageParam:S,direction:T?"backward":"forward",meta:a.options.meta};return g(X),X})(),N=await b(L),{maxPages:U}=a.options,z=T?PM:kM;return{pages:z(x.pages,N,U),pageParams:z(x.pageParams,S,U)}};if(l&&c.length){const x=l==="backward",S=x?ZM:a0,T={pages:c,pageParams:f},C=S(s,T);h=await w(T,C,x)}else{const x=e??c.length;do{const S=m===0?f[0]??s.initialPageParam:a0(s,h);if(m>0&&S==null)break;h=await w(h,S),m++}while(m<x)}return h};a.options.persister?a.fetchFn=()=>a.options.persister?.(p,{client:a.client,queryKey:a.queryKey,meta:a.options.meta,signal:a.signal},i):a.fetchFn=p}}}function a0(e,{pages:a,pageParams:i}){const s=a.length-1;return a.length>0?e.getNextPageParam(a[s],a,i[s],i):void 0}function ZM(e,{pages:a,pageParams:i}){return a.length>0?e.getPreviousPageParam?.(a[0],a,i[0],i):void 0}var IM=class{#e;#t;#n;#a;#r;#s;#o;#i;constructor(e={}){this.#e=e.queryCache||new KM,this.#t=e.mutationCache||new $M,this.#n=e.defaultOptions||{},this.#a=new Map,this.#r=new Map,this.#s=0}mount(){this.#s++,this.#s===1&&(this.#o=Dh.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=iu.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),i=this.#e.build(this,a),s=i.state.data;return s===void 0?this.fetchQuery(e):(e.revalidateIfStale&&i.isStaleByTime(Ua(a.staleTime,i))&&this.prefetchQuery(a),Promise.resolve(s))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:a,state:i})=>{const s=i.data;return[a,s]})}setQueryData(e,a,i){const s=this.defaultQueryOptions({queryKey:e}),c=this.#e.get(s.queryHash)?.state.data,f=UM(a,c);if(f!==void 0)return this.#e.build(this,s).setData(f,{...i,manual:!0})}setQueriesData(e,a,i){return ce.batch(()=>this.#e.findAll(e).map(({queryKey:s})=>[s,this.setQueryData(s,a,i)]))}getQueryState(e){const a=this.defaultQueryOptions({queryKey:e});return this.#e.get(a.queryHash)?.state}removeQueries(e){const a=this.#e;ce.batch(()=>{a.findAll(e).forEach(i=>{a.remove(i)})})}resetQueries(e,a){const i=this.#e;return ce.batch(()=>(i.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...e},a)))}cancelQueries(e,a={}){const i={revert:!0,...a},s=ce.batch(()=>this.#e.findAll(e).map(l=>l.cancel(i)));return Promise.all(s).then(Oe).catch(Oe)}invalidateQueries(e,a={}){return ce.batch(()=>(this.#e.findAll(e).forEach(i=>{i.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},a)))}refetchQueries(e,a={}){const i={...a,cancelRefetch:a.cancelRefetch??!0},s=ce.batch(()=>this.#e.findAll(e).filter(l=>!l.isDisabled()&&!l.isStatic()).map(l=>{let c=l.fetch(void 0,i);return i.throwOnError||(c=c.catch(Oe)),l.state.fetchStatus==="paused"?Promise.resolve():c}));return Promise.all(s).then(Oe)}fetchQuery(e){const a=this.defaultQueryOptions(e);a.retry===void 0&&(a.retry=!1);const i=this.#e.build(this,a);return i.isStaleByTime(Ua(a.staleTime,i))?i.fetch(a):Promise.resolve(i.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Oe).catch(Oe)}fetchInfiniteQuery(e){return e.behavior=n0(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Oe).catch(Oe)}ensureInfiniteQueryData(e){return e.behavior=n0(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return iu.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(Sr(e),{queryKey:e,defaultOptions:a})}getQueryDefaults(e){const a=[...this.#a.values()],i={};return a.forEach(s=>{Xs(e,s.queryKey)&&Object.assign(i,s.defaultOptions)}),i}setMutationDefaults(e,a){this.#r.set(Sr(e),{mutationKey:e,defaultOptions:a})}getMutationDefaults(e){const a=[...this.#r.values()],i={};return a.forEach(s=>{Xs(e,s.mutationKey)&&Object.assign(i,s.defaultOptions)}),i}defaultQueryOptions(e){if(e._defaulted)return e;const a={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return a.queryHash||(a.queryHash=Oh(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===Mh&&(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()}},WM=class extends zi{constructor(e,a){super(),this.options=a,this.#e=e,this.#i=null,this.#o=Hd(),this.options.experimental_prefetchInRender||this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(a)}#e;#t=void 0;#n=void 0;#a=void 0;#r;#s;#o;#i;#p;#d;#h;#u;#c;#l;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),r0(this.#t,this.options)?this.#f():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return qd(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return qd(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,i=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 ln(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&&!ru(this.options,a)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const s=this.hasListeners();s&&i0(this.#t,i,this.options,a)&&this.#f(),this.updateResult(),s&&(this.#t!==i||ln(this.options.enabled,this.#t)!==ln(a.enabled,this.#t)||Ua(this.options.staleTime,this.#t)!==Ua(a.staleTime,this.#t))&&this.#g();const l=this.#v();s&&(this.#t!==i||ln(this.options.enabled,this.#t)!==ln(a.enabled,this.#t)||l!==this.#l)&&this.#y(l)}getOptimisticResult(e){const a=this.#e.getQueryCache().build(this.#e,e),i=this.createResult(a,e);return t4(this,i)&&(this.#a=i,this.#s=this.options,this.#r=this.#t.state),i}getCurrentResult(){return this.#a}trackResult(e,a){return new Proxy(e,{get:(i,s)=>(this.trackProp(s),a?.(s),Reflect.get(i,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),i=this.#e.getQueryCache().build(this.#e,a);return i.fetch().then(()=>this.createResult(i,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(Oe)),a}#g(){this.#S();const e=Ua(this.options.staleTime,this.#t);if(br||this.#a.isStale||!Bd(e))return;const i=U1(this.#a.dataUpdatedAt,e)+1;this.#u=setTimeout(()=>{this.#a.isStale||this.updateResult()},i)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(e){this.#x(),this.#l=e,!(br||ln(this.options.enabled,this.#t)===!1||!Bd(this.#l)||this.#l===0)&&(this.#c=setInterval(()=>{(this.options.refetchIntervalInBackground||Dh.isFocused())&&this.#f()},this.#l))}#b(){this.#g(),this.#y(this.#v())}#S(){this.#u&&(clearTimeout(this.#u),this.#u=void 0)}#x(){this.#c&&(clearInterval(this.#c),this.#c=void 0)}createResult(e,a){const i=this.#t,s=this.options,l=this.#a,c=this.#r,f=this.#s,m=e!==i?e.state:this.#n,{state:p}=e;let v={...p},g=!1,b;if(a._optimisticResults){const q=this.hasListeners(),et=!q&&r0(e,a),I=q&&i0(e,i,a,s);(et||I)&&(v={...v,...F1(p.data,e.options)}),a._optimisticResults==="isRestoring"&&(v.fetchStatus="idle")}let{error:w,errorUpdatedAt:x,status:S}=v;b=v.data;let T=!1;if(a.placeholderData!==void 0&&b===void 0&&S==="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&&(S="success",b=Pd(l?.data,q,a),g=!0)}if(a.select&&b!==void 0&&!T)if(l&&b===c?.data&&a.select===this.#p)b=this.#d;else try{this.#p=a.select,b=a.select(b),b=Pd(l?.data,b,a),this.#d=b,this.#i=null}catch(q){this.#i=q}this.#i&&(w=this.#i,b=this.#d,x=Date.now(),S="error");const C=v.fetchStatus==="fetching",L=S==="pending",N=S==="error",U=L&&C,z=b!==void 0,k={status:S,fetchStatus:v.fetchStatus,isPending:L,isSuccess:S==="success",isError:N,isInitialLoading:U,isLoading:U,data:b,dataUpdatedAt:v.dataUpdatedAt,error:w,errorUpdatedAt:x,failureCount:v.fetchFailureCount,failureReason:v.fetchFailureReason,errorUpdateCount:v.errorUpdateCount,isFetched:v.dataUpdateCount>0||v.errorUpdateCount>0,isFetchedAfterMount:v.dataUpdateCount>m.dataUpdateCount||v.errorUpdateCount>m.errorUpdateCount,isFetching:C,isRefetching:C&&!L,isLoadingError:N&&!z,isPaused:v.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:N&&z,isStale:Nh(e,a),refetch:this.refetch,promise:this.#o,isEnabled:ln(a.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const q=st=>{k.status==="error"?st.reject(k.error):k.data!==void 0&&st.resolve(k.data)},et=()=>{const st=this.#o=k.promise=Hd();q(st)},I=this.#o;switch(I.status){case"pending":e.queryHash===i.queryHash&&q(I);break;case"fulfilled":(k.status==="error"||k.data!==I.value)&&et();break;case"rejected":(k.status!=="error"||k.error!==I.reason)&&et();break}}return k}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),ru(a,e))return;this.#a=a;const i=()=>{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:i()})}#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){ce.batch(()=>{e.listeners&&this.listeners.forEach(a=>{a(this.#a)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function JM(e,a){return ln(a.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&a.retryOnMount===!1)}function r0(e,a){return JM(e,a)||e.state.data!==void 0&&qd(e,a,a.refetchOnMount)}function qd(e,a,i){if(ln(a.enabled,e)!==!1&&Ua(a.staleTime,e)!=="static"){const s=typeof i=="function"?i(e):i;return s==="always"||s!==!1&&Nh(e,a)}return!1}function i0(e,a,i,s){return(e!==a||ln(s.enabled,e)===!1)&&(!i.suspense||e.state.status!=="error")&&Nh(e,i)}function Nh(e,a){return ln(a.enabled,e)!==!1&&e.isStaleByTime(Ua(a.staleTime,e))}function t4(e,a){return!ru(e.getCurrentResult(),a)}var e4=class extends zi{#e;#t=void 0;#n;#a;constructor(a,i){super(),this.#e=a,this.setOptions(i),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(a){const i=this.options;this.options=this.#e.defaultMutationOptions(a),ru(this.options,i)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),i?.mutationKey&&this.options.mutationKey&&Sr(i.mutationKey)!==Sr(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,i){return this.#a=i,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??Y1();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){ce.batch(()=>{if(this.#a&&this.hasListeners()){const i=this.#t.variables,s=this.#t.context;a?.type==="success"?(this.#a.onSuccess?.(a.data,i,s),this.#a.onSettled?.(a.data,null,i,s)):a?.type==="error"&&(this.#a.onError?.(a.error,i,s),this.#a.onSettled?.(void 0,a.error,i,s))}this.listeners.forEach(i=>{i(this.#t)})})}},Q1=R.createContext(void 0),K1=e=>{const a=R.useContext(Q1);if(!a)throw new Error("No QueryClient set, use QueryClientProvider to set one");return a},n4=({client:e,children:a})=>(R.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),_.jsx(Q1.Provider,{value:e,children:a})),X1=R.createContext(!1),a4=()=>R.useContext(X1);X1.Provider;function r4(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var i4=R.createContext(r4()),s4=()=>R.useContext(i4),o4=(e,a)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(a.isReset()||(e.retryOnMount=!1))},l4=e=>{R.useEffect(()=>{e.clearReset()},[e])},u4=({result:e,errorResetBoundary:a,throwOnError:i,query:s,suspense:l})=>e.isError&&!a.isReset()&&!e.isFetching&&s&&(l&&e.data===void 0||P1(i,[e.error,s])),c4=e=>{if(e.suspense){const a=s=>s==="static"?s:Math.max(s??1e3,1e3),i=e.staleTime;e.staleTime=typeof i=="function"?(...s)=>a(i(...s)):a(i),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},f4=(e,a)=>e.isLoading&&e.isFetching&&!a,d4=(e,a)=>e?.suspense&&a.isPending,s0=(e,a,i)=>a.fetchOptimistic(e).catch(()=>{i.clearReset()});function h4(e,a,i){const s=a4(),l=s4(),c=K1(),f=c.defaultQueryOptions(e);c.getDefaultOptions().queries?._experimental_beforeQuery?.(f),f._optimisticResults=s?"isRestoring":"optimistic",c4(f),o4(f,l),l4(l);const h=!c.getQueryCache().get(f.queryHash),[m]=R.useState(()=>new a(c,f)),p=m.getOptimisticResult(f),v=!s&&e.subscribed!==!1;if(R.useSyncExternalStore(R.useCallback(g=>{const b=v?m.subscribe(ce.batchCalls(g)):Oe;return m.updateResult(),b},[m,v]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),R.useEffect(()=>{m.setOptions(f)},[f,m]),d4(f,p))throw s0(f,m,l);if(u4({result:p,errorResetBoundary:l,throwOnError:f.throwOnError,query:c.getQueryCache().get(f.queryHash),suspense:f.suspense}))throw p.error;return c.getDefaultOptions().queries?._experimental_afterQuery?.(f,p),f.experimental_prefetchInRender&&!br&&f4(p,s)&&(h?s0(f,m,l):c.getQueryCache().get(f.queryHash)?.promise)?.catch(Oe).finally(()=>{m.updateResult()}),f.notifyOnChangeProps?p:m.trackResult(p)}function m4(e,a){return h4(e,WM)}function p4(e,a){const i=K1(),[s]=R.useState(()=>new e4(i,e));R.useEffect(()=>{s.setOptions(e)},[s,e]);const l=R.useSyncExternalStore(R.useCallback(f=>s.subscribe(ce.batchCalls(f)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),c=R.useCallback((f,h)=>{s.mutate(f,h).catch(Oe)},[s]);if(l.error&&P1(s.options.throwOnError,[l.error]))throw l.error;return{...l,mutate:c,mutateAsync:l.mutate}}function g4(){return _.jsx("div",{className:"h-screen grid place-items-center",children:_.jsx(O0,{className:"size-8 animate-spin"})})}function v4({className:e,...a}){const{setAuthenticated:i}=z1(),[s,l]=R.useState(""),[c,f]=R.useState(""),h=Ah(),{isPending:m,mutate:p}=p4({mutationFn:async()=>h.login(s,c),onError(){$y.error("Invalid credentials",{description:"The credentials you provided are invalid."})},onSuccess(){$y.success("Login successful",{description:"You have successfully logged in."}),i(!0)}});return m?_.jsx(g4,{}):_.jsx("div",{className:Rt("flex flex-col gap-6 w-[20%]",e),...a,children:_.jsxs(WO,{children:[_.jsxs(JO,{children:[_.jsx(tM,{className:"text-2xl",children:"Login"}),_.jsx(eM,{children:"Enter your credentials below to proceed"})]}),_.jsx(nM,{children:_.jsxs("div",{className:"flex flex-col gap-6",children:[_.jsxs("div",{className:"grid gap-2",children:[_.jsx(Qy,{htmlFor:"username",children:"Username"}),_.jsx(uy,{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(Qy,{htmlFor:"password",children:"Password"})}),_.jsx(uy,{id:"password",type:"password",required:!0,value:c,onChange:v=>f(v.target.value)})]}),_.jsx(Q0,{type:"button",className:"w-full",onClick:()=>{p()},children:"Login"})]})})]})})}function y4({children:e}){const{authenticated:a,setAuthenticated:i}=z1(),s=Ah(),{isLoading:l,isError:c}=m4({queryKey:[],enabled:!a,queryFn:async()=>{const f=await s.fetchMe();return i(!!f),f},refetchOnWindowFocus:!0});return l?_.jsx("div",{className:"h-screen grid place-items-center",children:_.jsx(O0,{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(v4,{})})}function b4({...e}){return _.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function S4({className:e,...a}){return _.jsx("ol",{"data-slot":"breadcrumb-list",className:Rt("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",e),...a})}function fd({className:e,...a}){return _.jsx("li",{"data-slot":"breadcrumb-item",className:Rt("inline-flex items-center gap-1.5",e),...a})}function o0({asChild:e,className:a,...i}){const s=e?Is:"a";return _.jsx(s,{"data-slot":"breadcrumb-link",className:Rt("hover:text-foreground transition-colors",a),...i})}function x4({className:e,...a}){return _.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:Rt("text-foreground font-normal",e),...a})}function l0({children:e,className:a,...i}){return _.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:Rt("[&>svg]:size-3.5",a),...i,children:e??_.jsx(IE,{})})}function w4(){const{toggleSidebar:e}=xh();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(Q0,{className:"h-8 w-8",variant:"ghost",size:"icon",onClick:e,children:_.jsx(JE,{})}),_.jsx(C2,{orientation:"vertical",className:"mr-2 h-4"}),_.jsx(b4,{className:"hidden sm:block",children:_.jsxs(S4,{children:[_.jsx(fd,{children:_.jsx(o0,{href:"#",children:"/"})}),_.jsx(l0,{}),_.jsx(fd,{children:_.jsx(x4,{children:"CommandKit"})}),_.jsx(l0,{}),_.jsx(fd,{children:_.jsx(o0,{href:"#",children:"DevTools"})})]})})]})})}var E4=(e,a,i,s,l,c,f,h)=>{let m=document.documentElement,p=["light","dark"];function v(w){(Array.isArray(e)?e:[e]).forEach(x=>{let S=x==="class",T=S&&c?l.map(C=>c[C]||C):l;S?(m.classList.remove(...T),m.classList.add(c&&c[w]?c[w]:w)):m.setAttribute(x,w)}),g(w)}function g(w){h&&p.includes(w)&&(m.style.colorScheme=w)}function b(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(s)v(s);else try{let w=localStorage.getItem(a)||i,x=f&&w==="system"?b():w;v(x)}catch{}},u0=["light","dark"],$1="(prefers-color-scheme: dark)",R4=typeof window>"u",Lh=R.createContext(void 0),_4={setTheme:e=>{},themes:[]},T4=()=>{var e;return(e=R.useContext(Lh))!=null?e:_4},C4=e=>R.useContext(Lh)?R.createElement(R.Fragment,null,e.children):R.createElement(O4,{...e}),A4=["light","dark"],O4=({forcedTheme:e,disableTransitionOnChange:a=!1,enableSystem:i=!0,enableColorScheme:s=!0,storageKey:l="theme",themes:c=A4,defaultTheme:f=i?"system":"light",attribute:h="data-theme",value:m,children:p,nonce:v,scriptProps:g})=>{let[b,w]=R.useState(()=>D4(l,f)),[x,S]=R.useState(()=>b==="system"?dd():b),T=m?Object.values(m):c,C=R.useCallback(z=>{let X=z;if(!X)return;z==="system"&&i&&(X=dd());let k=m?m[X]:X,q=a?N4(v):null,et=document.documentElement,I=st=>{st==="class"?(et.classList.remove(...T),k&&et.classList.add(k)):st.startsWith("data-")&&(k?et.setAttribute(st,k):et.removeAttribute(st))};if(Array.isArray(h)?h.forEach(I):I(h),s){let st=u0.includes(f)?f:null,rt=u0.includes(X)?X:st;et.style.colorScheme=rt}q?.()},[v]),L=R.useCallback(z=>{let X=typeof z=="function"?z(b):z;w(X);try{localStorage.setItem(l,X)}catch{}},[b]),N=R.useCallback(z=>{let X=dd(z);S(X),b==="system"&&i&&!e&&C("system")},[b,e]);R.useEffect(()=>{let z=window.matchMedia($1);return z.addListener(N),N(z),()=>z.removeListener(N)},[N]),R.useEffect(()=>{let z=X=>{X.key===l&&(X.newValue?w(X.newValue):L(f))};return window.addEventListener("storage",z),()=>window.removeEventListener("storage",z)},[L]),R.useEffect(()=>{C(e??b)},[e,b]);let U=R.useMemo(()=>({theme:b,setTheme:L,forcedTheme:e,resolvedTheme:b==="system"?x:b,themes:i?[...c,"system"]:c,systemTheme:i?x:void 0}),[b,L,e,x,i,c]);return R.createElement(Lh.Provider,{value:U},R.createElement(M4,{forcedTheme:e,storageKey:l,attribute:h,enableSystem:i,enableColorScheme:s,defaultTheme:f,value:m,themes:c,nonce:v,scriptProps:g}),p)},M4=R.memo(({forcedTheme:e,storageKey:a,attribute:i,enableSystem:s,enableColorScheme:l,defaultTheme:c,value:f,themes:h,nonce:m,scriptProps:p})=>{let v=JSON.stringify([i,a,c,e,h,f,s,l]).slice(1,-1);return R.createElement("script",{...p,suppressHydrationWarning:!0,nonce:typeof window>"u"?m:"",dangerouslySetInnerHTML:{__html:`(${E4.toString()})(${v})`}})}),D4=(e,a)=>{if(R4)return;let i;try{i=localStorage.getItem(e)||void 0}catch{}return i||a},N4=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)}},dd=e=>(e||(e=window.matchMedia($1)),e.matches?"dark":"light");const L4=({...e})=>{const{theme:a="system"}=T4();return _.jsx(zM,{theme:a,className:"toaster group",style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)"},...e})},wr=DE({head:()=>({meta:[{charSet:"utf-8"},{name:"viewport",content:"width=device-width, initial-scale=1"},{title:"CommandKit DevTools"}]}),component:j4});function j4(){return _.jsxs(C4,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!1,children:[_.jsx(L4,{}),_.jsx(ZO,{children:_.jsx(y4,{children:_.jsx("div",{className:"[--header-height:calc(theme(spacing.14))]",children:_.jsxs(FC,{className:"flex flex-col",children:[_.jsx(w4,{}),_.jsxs("div",{className:"flex flex-1",children:[_.jsx(IO,{}),_.jsx(QC,{children:_.jsx(_0,{})})]})]})})})})]})}const z4="modulepreload",U4=function(e){return"/"+e},c0={},Ui=function(a,i,s){let l=Promise.resolve();if(i&&i.length>0){let m=function(p){return Promise.all(p.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=m(i.map(p=>{if(p=U4(p),p in c0)return;c0[p]=!0;const v=p.endsWith(".css"),g=v?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${g}`))return;const b=document.createElement("link");if(b.rel=v?"stylesheet":z4,v||(b.as="script"),b.crossOrigin="",b.href=p,h&&b.setAttribute("nonce",h),document.head.appendChild(b),v)return new Promise((w,x)=>{b.addEventListener("load",w),b.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${p}`)))})}))}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)})},B4=()=>Ui(()=>import("./plugins-DT45gTWl.js"),[]),k4=Ba("/plugins")({component:Ai(B4,"component")}),P4=()=>Ui(()=>import("./guilds-36nKiYJZ.js"),[]),H4=Ba("/guilds")({component:Ai(P4,"component")}),q4=()=>Ui(()=>import("./feature-flags-DDB2O1Pe.js"),[]),V4=Ba("/feature-flags")({component:Ai(q4,"component")}),G4=()=>Ui(()=>import("./events--AdoPUVW.js"),[]),F4=Ba("/events")({component:Ai(G4,"component")}),Y4=()=>Ui(()=>import("./commands-BfzkZgf_.js"),[]),Q4=Ba("/commands")({component:Ai(Y4,"component")}),K4=()=>Ui(()=>import("./index-CJaaHZxS.js"),[]),X4=Ba("/")({component:Ai(K4,"component")}),$4=k4.update({id:"/plugins",path:"/plugins",getParentRoute:()=>wr}),Z4=H4.update({id:"/guilds",path:"/guilds",getParentRoute:()=>wr}),I4=V4.update({id:"/feature-flags",path:"/feature-flags",getParentRoute:()=>wr}),W4=F4.update({id:"/events",path:"/events",getParentRoute:()=>wr}),J4=Q4.update({id:"/commands",path:"/commands",getParentRoute:()=>wr}),t3=X4.update({id:"/",path:"/",getParentRoute:()=>wr}),e3={IndexRoute:t3,CommandsRoute:J4,EventsRoute:W4,FeatureFlagsRoute:I4,GuildsRoute:Z4,PluginsRoute:$4},n3=wr._addFileChildren(e3)._addFileTypes(),a3=HE({routeTree:n3,defaultPreload:"intent",defaultStaleTime:5e3,scrollRestoration:!0,defaultViewTransition:!0}),r3=new IM;hw.createRoot(document.getElementById("root")).render(_.jsx(R.StrictMode,{children:_.jsx(n4,{client:r3,children:_.jsx(GE,{router:a3})})}));export{cA as A,mA as B,WO as C,g4 as L,m4 as a,JO as b,fA as c,dA as d,nM as e,tM as f,f0 as g,eM as h,Ha as i,_ as j,IE as k,O3 as l,Ci as m,Q0 as n,R as r,Ah as u};
175
+ `+c):s.stack=c}catch{}}throw s}}_request(a,i){typeof a=="string"?(i=i||{},i.url=a):i=a||{},i=yr(this.defaults,i);const{transitional:s,paramsSerializer:l,headers:c}=i;s!==void 0&&ql.assertOptions(s,{silentJSONParsing:Mn.transitional(Mn.boolean),forcedJSONParsing:Mn.transitional(Mn.boolean),clarifyTimeoutError:Mn.transitional(Mn.boolean)},!1),l!=null&&(Q.isFunction(l)?i.paramsSerializer={serialize:l}:ql.assertOptions(l,{encode:Mn.function,serialize:Mn.function},!0)),i.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?i.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:i.allowAbsoluteUrls=!0),ql.assertOptions(i,{baseUrl:Mn.spelling("baseURL"),withXsrfToken:Mn.spelling("withXSRFToken")},!0),i.method=(i.method||this.defaults.method||"get").toLowerCase();let f=c&&Q.merge(c.common,c[i.method]);c&&Q.forEach(["delete","get","head","post","put","patch","common"],x=>{delete c[x]}),i.headers=ke.concat(f,c);const h=[];let m=!0;this.interceptors.request.forEach(function(S){typeof S.runWhen=="function"&&S.runWhen(i)===!1||(m=m&&S.synchronous,h.unshift(S.fulfilled,S.rejected))});const p=[];this.interceptors.response.forEach(function(S){p.push(S.fulfilled,S.rejected)});let v,g=0,b;if(!m){const x=[Gy.bind(this),void 0];for(x.unshift(...h),x.push(...p),b=x.length,v=Promise.resolve(i);g<b;)v=v.then(x[g++],x[g++]);return v}b=h.length;let w=i;for(g=0;g<b;){const x=h[g++],S=h[g++];try{w=x(w)}catch(T){S.call(this,T);break}}try{v=Gy.call(this,w)}catch(x){return Promise.reject(x)}for(g=0,b=p.length;g<b;)v=v.then(p[g++],p[g++]);return v}getUri(a){a=yr(this.defaults,a);const i=_1(a.baseURL,a.url,a.allowAbsoluteUrls);return S1(i,a.params,a.paramsSerializer)}};Q.forEach(["delete","get","head","options"],function(a){dr.prototype[a]=function(i,s){return this.request(yr(s||{},{method:a,url:i,data:(s||{}).data}))}});Q.forEach(["post","put","patch"],function(a){function i(s){return function(c,f,h){return this.request(yr(h||{},{method:a,headers:s?{"Content-Type":"multipart/form-data"}:{},url:c,data:f}))}}dr.prototype[a]=i(),dr.prototype[a+"Form"]=i(!0)});let GO=class D1{constructor(a){if(typeof a!="function")throw new TypeError("executor must be a function.");let i;this.promise=new Promise(function(c){i=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 ji(c,f,h),i(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 i=this._listeners.indexOf(a);i!==-1&&this._listeners.splice(i,1)}toAbortSignal(){const a=new AbortController,i=s=>{a.abort(s)};return this.subscribe(i),a.signal.unsubscribe=()=>this.unsubscribe(i),a.signal}static source(){let a;return{token:new D1(function(l){a=l}),cancel:a}}};function FO(e){return function(i){return e.apply(null,i)}}function YO(e){return Q.isObject(e)&&e.isAxiosError===!0}const zd={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(zd).forEach(([e,a])=>{zd[a]=e});function N1(e){const a=new dr(e),i=l1(dr.prototype.request,a);return Q.extend(i,dr.prototype,a,{allOwnKeys:!0}),Q.extend(i,a,null,{allOwnKeys:!0}),i.create=function(l){return N1(yr(e,l))},i}const ne=N1(so);ne.Axios=dr;ne.CanceledError=ji;ne.CancelToken=GO;ne.isCancel=E1;ne.VERSION=M1;ne.toFormData=Su;ne.AxiosError=wt;ne.Cancel=ne.CanceledError;ne.all=function(a){return Promise.all(a)};ne.spread=FO;ne.isAxiosError=YO;ne.mergeConfig=yr;ne.AxiosHeaders=ke;ne.formToJSON=e=>w1(Q.isHTMLForm(e)?new FormData(e):e);ne.getAdapter=O1.getAdapter;ne.HttpStatusCode=zd;ne.default=ne;const{Axios:h3,AxiosError:m3,CanceledError:p3,isCancel:g3,CancelToken:v3,VERSION:y3,all:b3,Cancel:S3,isAxiosError:x3,spread:w3,toFormData:E3,AxiosHeaders:R3,HttpStatusCode:_3,formToJSON:T3,getAdapter:C3,mergeConfig:A3}=ne,Ch=ne.create({baseURL:"/api"});Ch.interceptors.request.use(e=>{const a=localStorage.getItem("access_token");return a&&(e.headers.Authorization=`Bearer ${a}`),e});Ch.interceptors.response.use(e=>e,e=>(e.response.status===401&&(localStorage.removeItem("access_token"),window.location.href="/"),Promise.reject(e)));class Yy{constructor(a,i){this.client=a,this.data=i}}class QO{constructor(a){this.client=a}async fetch(){const{data:a}=await this.client.api.get("/events");return a.events}}class KO{constructor(a){this.client=a}async fetch(){const{data:a}=await this.client.api.get("/guilds");return a.guilds}}class XO{constructor(a){this.client=a}async fetch(){const{data:a}=await this.client.api.get("/plugins");return a.plugins}}class $O{api=Ch;guilds=new KO(this);plugins=new XO(this);events=new QO(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:i}=await this.api.get("/auth/@me");return this._user=new Yy(this,i),this._user}async getFeatureFlags(){const{data:a}=await this.api.get("/feature-flags");return a}async login(a,i){const{data:s}=await this.api.post("/auth/login",{username:a,password:i});return s.accessToken&&localStorage.setItem("access_token",s.accessToken),this._user=new Yy(this,s.user),s}}const L1=R.createContext(null);function ZO({children:e}){const[a,i]=R.useState(()=>new $O);return _.jsx(L1.Provider,{value:{client:a,setClient:i},children:e})}function Ah(){const e=R.use(L1);if(!e)throw new Error("useClient must be used within a ClientProvider");return e.client}const ud={navMain:[{title:"Commands",url:"/commands",icon:Wv,isActive:!1},{title:"Events",url:"/events",icon:Iv,isActive:!1},{title:"Plugins",url:"/plugins",icon:eR,isActive:!1},{title:"Guilds",url:"/guilds",icon:ey,isActive:!1},{title:"Feature Flags",url:"/feature-flags",icon:aR,isActive:!1}],navSecondary:[{title:"GitHub",url:"https://github.com/underctrl-io/commandkit",icon:gR},{title:"Discord",url:"https://ctrl.lol/discord",icon:ey}],projects:[{name:"Commands",url:"#",icon:Wv},{name:"Middlewares",url:"#",icon:sR},{name:"Events",url:"#",icon:Iv}]};function IO({...e}){const a=Ah();return _.jsxs(YC,{className:"top-(--header-height) h-[calc(100svh-var(--header-height))]!",...e,children:[_.jsx(KC,{children:_.jsx(to,{children:_.jsx(eo,{children:_.jsx(no,{size:"lg",asChild:!0,children:_.jsxs(Ci,{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($C,{children:[_.jsx(WC,{items:ud.navMain}),_.jsx(JC,{projects:ud.projects}),_.jsx(tA,{items:ud.navSecondary,className:"mt-auto"})]}),_.jsx(XC,{children:_.jsx(pA,{user:{avatar:a.user.data.displayAvatarURL,name:a.user.data.globalName||a.user?.data.username,username:a.user.data.username}})})]})}function WO({className:e,...a}){return _.jsx("div",{"data-slot":"card",className:Rt("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...a})}function JO({className:e,...a}){return _.jsx("div",{"data-slot":"card-header",className:Rt("@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 tM({className:e,...a}){return _.jsx("div",{"data-slot":"card-title",className:Rt("leading-none font-semibold",e),...a})}function eM({className:e,...a}){return _.jsx("div",{"data-slot":"card-description",className:Rt("text-muted-foreground text-sm",e),...a})}function nM({className:e,...a}){return _.jsx("div",{"data-slot":"card-content",className:Rt("px-6",e),...a})}function O3({className:e,...a}){return _.jsx("div",{"data-slot":"card-footer",className:Rt("flex items-center px-6 [.border-t]:pt-6",e),...a})}var aM="Label",j1=R.forwardRef((e,a)=>_.jsx(Zt.label,{...e,ref:a,onMouseDown:i=>{i.target.closest("button, input, select, textarea")||(e.onMouseDown?.(i),!i.defaultPrevented&&i.detail>1&&i.preventDefault())}}));j1.displayName=aM;var rM=j1;function Qy({className:e,...a}){return _.jsx(rM,{"data-slot":"label",className:Rt("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 Ky=e=>{let a;const i=new Set,s=(p,v)=>{const g=typeof p=="function"?p(a):p;if(!Object.is(g,a)){const b=a;a=v??(typeof g!="object"||g===null)?g:Object.assign({},a,g),i.forEach(w=>w(a,b))}},l=()=>a,h={setState:s,getState:l,getInitialState:()=>m,subscribe:p=>(i.add(p),()=>i.delete(p))},m=a=e(s,l,h);return h},iM=e=>e?Ky(e):Ky,sM=e=>e;function oM(e,a=sM){const i=tt.useSyncExternalStore(e.subscribe,tt.useCallback(()=>a(e.getState()),[e,a]),tt.useCallback(()=>a(e.getInitialState()),[e,a]));return tt.useDebugValue(i),i}const Xy=e=>{const a=iM(e),i=s=>oM(a,s);return Object.assign(i,a),i},lM=e=>e?Xy(e):Xy,z1=lM(e=>({authenticated:!1,setAuthenticated:a=>e({authenticated:a})}));function uM(e){if(typeof document>"u")return;let a=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",a.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}const cM=e=>{switch(e){case"success":return hM;case"info":return pM;case"warning":return mM;case"error":return gM;default:return null}},fM=Array(12).fill(0),dM=({visible:e,className:a})=>tt.createElement("div",{className:["sonner-loading-wrapper",a].filter(Boolean).join(" "),"data-visible":e},tt.createElement("div",{className:"sonner-spinner"},fM.map((i,s)=>tt.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),hM=tt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},tt.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"})),mM=tt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},tt.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"})),pM=tt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},tt.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"})),gM=tt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},tt.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"})),vM=tt.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"},tt.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),tt.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),yM=()=>{const[e,a]=tt.useState(document.hidden);return tt.useEffect(()=>{const i=()=>{a(document.hidden)};return document.addEventListener("visibilitychange",i),()=>window.removeEventListener("visibilitychange",i)},[]),e};let Ud=1;class bM{constructor(){this.subscribe=a=>(this.subscribers.push(a),()=>{const i=this.subscribers.indexOf(a);this.subscribers.splice(i,1)}),this.publish=a=>{this.subscribers.forEach(i=>i(a))},this.addToast=a=>{this.publish(a),this.toasts=[...this.toasts,a]},this.create=a=>{var i;const{message:s,...l}=a,c=typeof a?.id=="number"||((i=a.id)==null?void 0:i.length)>0?a.id:Ud++,f=this.toasts.find(m=>m.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(m=>m.id===c?(this.publish({...m,...a,id:c,title:s}),{...m,...a,id:c,dismissible:h,title:s}):m):this.addToast({title:s,...l,dismissible:h,id:c}),c},this.dismiss=a=>(a?(this.dismissedToasts.add(a),requestAnimationFrame(()=>this.subscribers.forEach(i=>i({id:a,dismiss:!0})))):this.toasts.forEach(i=>{this.subscribers.forEach(s=>s({id:i.id,dismiss:!0}))}),a),this.message=(a,i)=>this.create({...i,message:a}),this.error=(a,i)=>this.create({...i,message:a,type:"error"}),this.success=(a,i)=>this.create({...i,type:"success",message:a}),this.info=(a,i)=>this.create({...i,type:"info",message:a}),this.warning=(a,i)=>this.create({...i,type:"warning",message:a}),this.loading=(a,i)=>this.create({...i,type:"loading",message:a}),this.promise=(a,i)=>{if(!i)return;let s;i.loading!==void 0&&(s=this.create({...i,promise:a,type:"loading",message:i.loading,description:typeof i.description!="function"?i.description:void 0}));const l=Promise.resolve(a instanceof Function?a():a);let c=s!==void 0,f;const h=l.then(async p=>{if(f=["resolve",p],tt.isValidElement(p))c=!1,this.create({id:s,type:"default",message:p});else if(xM(p)&&!p.ok){c=!1;const g=typeof i.error=="function"?await i.error(`HTTP error! status: ${p.status}`):i.error,b=typeof i.description=="function"?await i.description(`HTTP error! status: ${p.status}`):i.description,x=typeof g=="object"&&!tt.isValidElement(g)?g:{message:g};this.create({id:s,type:"error",description:b,...x})}else if(p instanceof Error){c=!1;const g=typeof i.error=="function"?await i.error(p):i.error,b=typeof i.description=="function"?await i.description(p):i.description,x=typeof g=="object"&&!tt.isValidElement(g)?g:{message:g};this.create({id:s,type:"error",description:b,...x})}else if(i.success!==void 0){c=!1;const g=typeof i.success=="function"?await i.success(p):i.success,b=typeof i.description=="function"?await i.description(p):i.description,x=typeof g=="object"&&!tt.isValidElement(g)?g:{message:g};this.create({id:s,type:"success",description:b,...x})}}).catch(async p=>{if(f=["reject",p],i.error!==void 0){c=!1;const v=typeof i.error=="function"?await i.error(p):i.error,g=typeof i.description=="function"?await i.description(p):i.description,w=typeof v=="object"&&!tt.isValidElement(v)?v:{message:v};this.create({id:s,type:"error",description:g,...w})}}).finally(()=>{c&&(this.dismiss(s),s=void 0),i.finally==null||i.finally.call(i)}),m=()=>new Promise((p,v)=>h.then(()=>f[0]==="reject"?v(f[1]):p(f[1])).catch(v));return typeof s!="string"&&typeof s!="number"?{unwrap:m}:Object.assign(s,{unwrap:m})},this.custom=(a,i)=>{const s=i?.id||Ud++;return this.create({jsx:a(s),id:s,...i}),s},this.getActiveToasts=()=>this.toasts.filter(a=>!this.dismissedToasts.has(a.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const ze=new bM,SM=(e,a)=>{const i=a?.id||Ud++;return ze.addToast({title:e,...a,id:i}),i},xM=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",wM=SM,EM=()=>ze.toasts,RM=()=>ze.getActiveToasts(),$y=Object.assign(wM,{success:ze.success,info:ze.info,warning:ze.warning,error:ze.error,custom:ze.custom,message:ze.message,promise:ze.promise,dismiss:ze.dismiss,loading:ze.loading},{getHistory:EM,getToasts:RM});uM("[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 Ll(e){return e.label!==void 0}const _M=3,TM="24px",CM="16px",Zy=4e3,AM=356,OM=14,MM=45,DM=200;function Dn(...e){return e.filter(Boolean).join(" ")}function NM(e){const[a,i]=e.split("-"),s=[];return a&&s.push(a),i&&s.push(i),s}const LM=e=>{var a,i,s,l,c,f,h,m,p;const{invert:v,toast:g,unstyled:b,interacting:w,setHeights:x,visibleToasts:S,heights:T,index:C,toasts:L,expanded:N,removeToast:U,defaultRichColors:z,closeButton:X,style:k,cancelButtonStyle:q,actionButtonStyle:et,className:I="",descriptionClassName:st="",duration:rt,position:ut,gap:pt,expandByDefault:ct,classNames:M,icons:F,closeButtonAriaLabel:B="Close toast"}=e,[ot,A]=tt.useState(null),[K,at]=tt.useState(null),[Y,J]=tt.useState(!1),[it,nt]=tt.useState(!1),[ft,lt]=tt.useState(!1),[St,Dt]=tt.useState(!1),[Lt,zt]=tt.useState(!1),[ve,wn]=tt.useState(0),[Bi,Er]=tt.useState(0),fe=tt.useRef(g.duration||rt||Zy),Bn=tt.useRef(null),ye=tt.useRef(null),qa=C===0,kn=C+1<=S,_t=g.type,Yt=g.dismissible!==!1,Xe=g.className||"",oo=g.descriptionClassName||"",En=tt.useMemo(()=>T.findIndex(xt=>xt.toastId===g.id)||0,[T,g.id]),Ce=tt.useMemo(()=>{var xt;return(xt=g.closeButton)!=null?xt:X},[g.closeButton,X]),hn=tt.useMemo(()=>g.duration||rt||Zy,[g.duration,rt]),be=tt.useRef(0),la=tt.useRef(0),lo=tt.useRef(0),ua=tt.useRef(null),[Rr,_r]=ut.split("-"),Rn=tt.useMemo(()=>T.reduce((xt,It,ae)=>ae>=En?xt:xt+It.height,0),[T,En]),Va=yM(),Ga=g.invert||v,ki=_t==="loading";la.current=tt.useMemo(()=>En*pt+Rn,[En,Rn]),tt.useEffect(()=>{fe.current=hn},[hn]),tt.useEffect(()=>{J(!0)},[]),tt.useEffect(()=>{const xt=ye.current;if(xt){const It=xt.getBoundingClientRect().height;return Er(It),x(ae=>[{toastId:g.id,height:It,position:g.position},...ae]),()=>x(ae=>ae.filter(Se=>Se.toastId!==g.id))}},[x,g.id]),tt.useLayoutEffect(()=>{if(!Y)return;const xt=ye.current,It=xt.style.height;xt.style.height="auto";const ae=xt.getBoundingClientRect().height;xt.style.height=It,Er(ae),x(Se=>Se.find(se=>se.toastId===g.id)?Se.map(se=>se.toastId===g.id?{...se,height:ae}:se):[{toastId:g.id,height:ae,position:g.position},...Se])},[Y,g.title,g.description,x,g.id,g.jsx,g.action,g.cancel]);const mn=tt.useCallback(()=>{nt(!0),wn(la.current),x(xt=>xt.filter(It=>It.toastId!==g.id)),setTimeout(()=>{U(g)},DM)},[g,U,x,la]);tt.useEffect(()=>{if(g.promise&&_t==="loading"||g.duration===1/0||g.type==="loading")return;let xt;return N||w||Va?(()=>{if(lo.current<be.current){const Se=new Date().getTime()-be.current;fe.current=fe.current-Se}lo.current=new Date().getTime()})():(()=>{fe.current!==1/0&&(be.current=new Date().getTime(),xt=setTimeout(()=>{g.onAutoClose==null||g.onAutoClose.call(g,g),mn()},fe.current))})(),()=>clearTimeout(xt)},[N,w,g,_t,Va,mn]),tt.useEffect(()=>{g.delete&&(mn(),g.onDismiss==null||g.onDismiss.call(g,g))},[mn,g.delete]);function uo(){var xt;if(F?.loading){var It;return tt.createElement("div",{className:Dn(M?.loader,g==null||(It=g.classNames)==null?void 0:It.loader,"sonner-loader"),"data-visible":_t==="loading"},F.loading)}return tt.createElement(dM,{className:Dn(M?.loader,g==null||(xt=g.classNames)==null?void 0:xt.loader),visible:_t==="loading"})}const Pi=g.icon||F?.[_t]||cM(_t);var ca,co;return tt.createElement("li",{tabIndex:0,ref:ye,className:Dn(I,Xe,M?.toast,g==null||(a=g.classNames)==null?void 0:a.toast,M?.default,M?.[_t],g==null||(i=g.classNames)==null?void 0:i[_t]),"data-sonner-toast":"","data-rich-colors":(ca=g.richColors)!=null?ca:z,"data-styled":!(g.jsx||g.unstyled||b),"data-mounted":Y,"data-promise":!!g.promise,"data-swiped":Lt,"data-removed":it,"data-visible":kn,"data-y-position":Rr,"data-x-position":_r,"data-index":C,"data-front":qa,"data-swiping":ft,"data-dismissible":Yt,"data-type":_t,"data-invert":Ga,"data-swipe-out":St,"data-swipe-direction":K,"data-expanded":!!(N||ct&&Y),"data-testid":g.testId,style:{"--index":C,"--toasts-before":C,"--z-index":L.length-C,"--offset":`${it?ve:la.current}px`,"--initial-height":ct?"auto":`${Bi}px`,...k,...g.style},onDragEnd:()=>{lt(!1),A(null),ua.current=null},onPointerDown:xt=>{xt.button!==2&&(ki||!Yt||(Bn.current=new Date,wn(la.current),xt.target.setPointerCapture(xt.pointerId),xt.target.tagName!=="BUTTON"&&(lt(!0),ua.current={x:xt.clientX,y:xt.clientY})))},onPointerUp:()=>{var xt,It,ae;if(St||!Yt)return;ua.current=null;const Se=Number(((xt=ye.current)==null?void 0:xt.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Fa=Number(((It=ye.current)==null?void 0:It.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),se=new Date().getTime()-((ae=Bn.current)==null?void 0:ae.getTime()),Wt=ot==="x"?Se:Fa,Jt=Math.abs(Wt)/se;if(Math.abs(Wt)>=MM||Jt>.11){wn(la.current),g.onDismiss==null||g.onDismiss.call(g,g),at(ot==="x"?Se>0?"right":"left":Fa>0?"down":"up"),mn(),Dt(!0);return}else{var Gt,de;(Gt=ye.current)==null||Gt.style.setProperty("--swipe-amount-x","0px"),(de=ye.current)==null||de.style.setProperty("--swipe-amount-y","0px")}zt(!1),lt(!1),A(null)},onPointerMove:xt=>{var It,ae,Se;if(!ua.current||!Yt||((It=window.getSelection())==null?void 0:It.toString().length)>0)return;const se=xt.clientY-ua.current.y,Wt=xt.clientX-ua.current.x;var Jt;const Gt=(Jt=e.swipeDirections)!=null?Jt:NM(ut);!ot&&(Math.abs(Wt)>1||Math.abs(se)>1)&&A(Math.abs(Wt)>Math.abs(se)?"x":"y");let de={x:0,y:0};const Tr=Pn=>1/(1.5+Math.abs(Pn)/20);if(ot==="y"){if(Gt.includes("top")||Gt.includes("bottom"))if(Gt.includes("top")&&se<0||Gt.includes("bottom")&&se>0)de.y=se;else{const Pn=se*Tr(se);de.y=Math.abs(Pn)<Math.abs(se)?Pn:se}}else if(ot==="x"&&(Gt.includes("left")||Gt.includes("right")))if(Gt.includes("left")&&Wt<0||Gt.includes("right")&&Wt>0)de.x=Wt;else{const Pn=Wt*Tr(Wt);de.x=Math.abs(Pn)<Math.abs(Wt)?Pn:Wt}(Math.abs(de.x)>0||Math.abs(de.y)>0)&&zt(!0),(ae=ye.current)==null||ae.style.setProperty("--swipe-amount-x",`${de.x}px`),(Se=ye.current)==null||Se.style.setProperty("--swipe-amount-y",`${de.y}px`)}},Ce&&!g.jsx&&_t!=="loading"?tt.createElement("button",{"aria-label":B,"data-disabled":ki,"data-close-button":!0,onClick:ki||!Yt?()=>{}:()=>{mn(),g.onDismiss==null||g.onDismiss.call(g,g)},className:Dn(M?.closeButton,g==null||(s=g.classNames)==null?void 0:s.closeButton)},(co=F?.close)!=null?co:vM):null,(_t||g.icon||g.promise)&&g.icon!==null&&(F?.[_t]!==null||g.icon)?tt.createElement("div",{"data-icon":"",className:Dn(M?.icon,g==null||(l=g.classNames)==null?void 0:l.icon)},g.promise||g.type==="loading"&&!g.icon?g.icon||uo():null,g.type!=="loading"?Pi:null):null,tt.createElement("div",{"data-content":"",className:Dn(M?.content,g==null||(c=g.classNames)==null?void 0:c.content)},tt.createElement("div",{"data-title":"",className:Dn(M?.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?tt.createElement("div",{"data-description":"",className:Dn(st,oo,M?.description,g==null||(h=g.classNames)==null?void 0:h.description)},typeof g.description=="function"?g.description():g.description):null),tt.isValidElement(g.cancel)?g.cancel:g.cancel&&Ll(g.cancel)?tt.createElement("button",{"data-button":!0,"data-cancel":!0,style:g.cancelButtonStyle||q,onClick:xt=>{Ll(g.cancel)&&Yt&&(g.cancel.onClick==null||g.cancel.onClick.call(g.cancel,xt),mn())},className:Dn(M?.cancelButton,g==null||(m=g.classNames)==null?void 0:m.cancelButton)},g.cancel.label):null,tt.isValidElement(g.action)?g.action:g.action&&Ll(g.action)?tt.createElement("button",{"data-button":!0,"data-action":!0,style:g.actionButtonStyle||et,onClick:xt=>{Ll(g.action)&&(g.action.onClick==null||g.action.onClick.call(g.action,xt),!xt.defaultPrevented&&mn())},className:Dn(M?.actionButton,g==null||(p=g.classNames)==null?void 0:p.actionButton)},g.action.label):null)};function Iy(){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 jM(e,a){const i={};return[e,a].forEach((s,l)=>{const c=l===1,f=c?"--mobile-offset":"--offset",h=c?CM:TM;function m(p){["top","right","bottom","left"].forEach(v=>{i[`${f}-${v}`]=typeof p=="number"?`${p}px`:p})}typeof s=="number"||typeof s=="string"?m(s):typeof s=="object"?["top","right","bottom","left"].forEach(p=>{s[p]===void 0?i[`${f}-${p}`]=h:i[`${f}-${p}`]=typeof s[p]=="number"?`${s[p]}px`:s[p]}):m(h)}),i}const zM=tt.forwardRef(function(a,i){const{id:s,invert:l,position:c="bottom-right",hotkey:f=["altKey","KeyT"],expand:h,closeButton:m,className:p,offset:v,mobileOffset:g,theme:b="light",richColors:w,duration:x,style:S,visibleToasts:T=_M,toastOptions:C,dir:L=Iy(),gap:N=OM,icons:U,containerAriaLabel:z="Notifications"}=a,[X,k]=tt.useState([]),q=tt.useMemo(()=>s?X.filter(Y=>Y.toasterId===s):X.filter(Y=>!Y.toasterId),[X,s]),et=tt.useMemo(()=>Array.from(new Set([c].concat(q.filter(Y=>Y.position).map(Y=>Y.position)))),[q,c]),[I,st]=tt.useState([]),[rt,ut]=tt.useState(!1),[pt,ct]=tt.useState(!1),[M,F]=tt.useState(b!=="system"?b:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),B=tt.useRef(null),ot=f.join("+").replace(/Key/g,"").replace(/Digit/g,""),A=tt.useRef(null),K=tt.useRef(!1),at=tt.useCallback(Y=>{k(J=>{var it;return(it=J.find(nt=>nt.id===Y.id))!=null&&it.delete||ze.dismiss(Y.id),J.filter(({id:nt})=>nt!==Y.id)})},[]);return tt.useEffect(()=>ze.subscribe(Y=>{if(Y.dismiss){requestAnimationFrame(()=>{k(J=>J.map(it=>it.id===Y.id?{...it,delete:!0}:it))});return}setTimeout(()=>{w0.flushSync(()=>{k(J=>{const it=J.findIndex(nt=>nt.id===Y.id);return it!==-1?[...J.slice(0,it),{...J[it],...Y},...J.slice(it+1)]:[Y,...J]})})})}),[X]),tt.useEffect(()=>{if(b!=="system"){F(b);return}if(b==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?F("dark"):F("light")),typeof window>"u")return;const Y=window.matchMedia("(prefers-color-scheme: dark)");try{Y.addEventListener("change",({matches:J})=>{F(J?"dark":"light")})}catch{Y.addListener(({matches:it})=>{try{F(it?"dark":"light")}catch(nt){console.error(nt)}})}},[b]),tt.useEffect(()=>{X.length<=1&&ut(!1)},[X]),tt.useEffect(()=>{const Y=J=>{var it;if(f.every(lt=>J[lt]||J.code===lt)){var ft;ut(!0),(ft=B.current)==null||ft.focus()}J.code==="Escape"&&(document.activeElement===B.current||(it=B.current)!=null&&it.contains(document.activeElement))&&ut(!1)};return document.addEventListener("keydown",Y),()=>document.removeEventListener("keydown",Y)},[f]),tt.useEffect(()=>{if(B.current)return()=>{A.current&&(A.current.focus({preventScroll:!0}),A.current=null,K.current=!1)}},[B.current]),tt.createElement("section",{ref:i,"aria-label":`${z} ${ot}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},et.map((Y,J)=>{var it;const[nt,ft]=Y.split("-");return q.length?tt.createElement("ol",{key:Y,dir:L==="auto"?Iy():L,tabIndex:-1,ref:B,className:p,"data-sonner-toaster":!0,"data-sonner-theme":M,"data-y-position":nt,"data-x-position":ft,style:{"--front-toast-height":`${((it=I[0])==null?void 0:it.height)||0}px`,"--width":`${AM}px`,"--gap":`${N}px`,...S,...jM(v,g)},onBlur:lt=>{K.current&&!lt.currentTarget.contains(lt.relatedTarget)&&(K.current=!1,A.current&&(A.current.focus({preventScroll:!0}),A.current=null))},onFocus:lt=>{lt.target instanceof HTMLElement&&lt.target.dataset.dismissible==="false"||K.current||(K.current=!0,A.current=lt.relatedTarget)},onMouseEnter:()=>ut(!0),onMouseMove:()=>ut(!0),onMouseLeave:()=>{pt||ut(!1)},onDragEnd:()=>ut(!1),onPointerDown:lt=>{lt.target instanceof HTMLElement&&lt.target.dataset.dismissible==="false"||ct(!0)},onPointerUp:()=>ct(!1)},q.filter(lt=>!lt.position&&J===0||lt.position===Y).map((lt,St)=>{var Dt,Lt;return tt.createElement(LM,{key:lt.id,icons:U,index:St,toast:lt,defaultRichColors:w,duration:(Dt=C?.duration)!=null?Dt:x,className:C?.className,descriptionClassName:C?.descriptionClassName,invert:l,visibleToasts:T,closeButton:(Lt=C?.closeButton)!=null?Lt:m,interacting:pt,position:Y,style:C?.style,unstyled:C?.unstyled,classNames:C?.classNames,cancelButtonStyle:C?.cancelButtonStyle,actionButtonStyle:C?.actionButtonStyle,closeButtonAriaLabel:C?.closeButtonAriaLabel,removeToast:at,toasts:q.filter(zt=>zt.position==lt.position),heights:I.filter(zt=>zt.position==lt.position),setHeights:st,expandByDefault:h,gap:N,expanded:rt,swipeDirections:a.swipeDirections})})):null}))});var zi=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(){}},br=typeof window>"u"||"Deno"in globalThis;function Oe(){}function UM(e,a){return typeof e=="function"?e(a):e}function Bd(e){return typeof e=="number"&&e>=0&&e!==1/0}function U1(e,a){return Math.max(e+(a||0)-Date.now(),0)}function Ua(e,a){return typeof e=="function"?e(a):e}function ln(e,a){return typeof e=="function"?e(a):e}function Wy(e,a){const{type:i="all",exact:s,fetchStatus:l,predicate:c,queryKey:f,stale:h}=e;if(f){if(s){if(a.queryHash!==Oh(f,a.options))return!1}else if(!Xs(a.queryKey,f))return!1}if(i!=="all"){const m=a.isActive();if(i==="active"&&!m||i==="inactive"&&m)return!1}return!(typeof h=="boolean"&&a.isStale()!==h||l&&l!==a.state.fetchStatus||c&&!c(a))}function Jy(e,a){const{exact:i,status:s,predicate:l,mutationKey:c}=e;if(c){if(!a.options.mutationKey)return!1;if(i){if(Sr(a.options.mutationKey)!==Sr(c))return!1}else if(!Xs(a.options.mutationKey,c))return!1}return!(s&&a.state.status!==s||l&&!l(a))}function Oh(e,a){return(a?.queryKeyHashFn||Sr)(e)}function Sr(e){return JSON.stringify(e,(a,i)=>kd(i)?Object.keys(i).sort().reduce((s,l)=>(s[l]=i[l],s),{}):i)}function Xs(e,a){return e===a?!0:typeof e!=typeof a?!1:e&&a&&typeof e=="object"&&typeof a=="object"?Object.keys(a).every(i=>Xs(e[i],a[i])):!1}function B1(e,a){if(e===a)return e;const i=t0(e)&&t0(a);if(i||kd(e)&&kd(a)){const s=i?e:Object.keys(e),l=s.length,c=i?a:Object.keys(a),f=c.length,h=i?[]:{},m=new Set(s);let p=0;for(let v=0;v<f;v++){const g=i?v:c[v];(!i&&m.has(g)||i)&&e[g]===void 0&&a[g]===void 0?(h[g]=void 0,p++):(h[g]=B1(e[g],a[g]),h[g]===e[g]&&e[g]!==void 0&&p++)}return l===f&&p===l?e:h}return a}function ru(e,a){if(!a||Object.keys(e).length!==Object.keys(a).length)return!1;for(const i in e)if(e[i]!==a[i])return!1;return!0}function t0(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function kd(e){if(!e0(e))return!1;const a=e.constructor;if(a===void 0)return!0;const i=a.prototype;return!(!e0(i)||!i.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function e0(e){return Object.prototype.toString.call(e)==="[object Object]"}function BM(e){return new Promise(a=>{setTimeout(a,e)})}function Pd(e,a,i){return typeof i.structuralSharing=="function"?i.structuralSharing(e,a):i.structuralSharing!==!1?B1(e,a):a}function kM(e,a,i=0){const s=[...e,a];return i&&s.length>i?s.slice(1):s}function PM(e,a,i=0){const s=[a,...e];return i&&s.length>i?s.slice(0,-1):s}var Mh=Symbol();function k1(e,a){return!e.queryFn&&a?.initialPromise?()=>a.initialPromise:!e.queryFn||e.queryFn===Mh?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function P1(e,a){return typeof e=="function"?e(...a):!!e}var HM=class extends zi{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!br&&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"}},Dh=new HM,qM=class extends zi{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!br&&window.addEventListener){const a=()=>e(!0),i=()=>e(!1);return window.addEventListener("online",a,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",a),window.removeEventListener("offline",i)}}}}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(i=>{i(e)}))}isOnline(){return this.#e}},iu=new qM;function Hd(){let e,a;const i=new Promise((l,c)=>{e=l,a=c});i.status="pending",i.catch(()=>{});function s(l){Object.assign(i,l),delete i.resolve,delete i.reject}return i.resolve=l=>{s({status:"fulfilled",value:l}),e(l)},i.reject=l=>{s({status:"rejected",reason:l}),a(l)},i}function VM(e){return Math.min(1e3*2**e,3e4)}function H1(e){return(e??"online")==="online"?iu.isOnline():!0}var q1=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function cd(e){return e instanceof q1}function V1(e){let a=!1,i=0,s=!1,l;const c=Hd(),f=S=>{s||(b(new q1(S)),e.abort?.())},h=()=>{a=!0},m=()=>{a=!1},p=()=>Dh.isFocused()&&(e.networkMode==="always"||iu.isOnline())&&e.canRun(),v=()=>H1(e.networkMode)&&e.canRun(),g=S=>{s||(s=!0,e.onSuccess?.(S),l?.(),c.resolve(S))},b=S=>{s||(s=!0,e.onError?.(S),l?.(),c.reject(S))},w=()=>new Promise(S=>{l=T=>{(s||p())&&S(T)},e.onPause?.()}).then(()=>{l=void 0,s||e.onContinue?.()}),x=()=>{if(s)return;let S;const T=i===0?e.initialPromise:void 0;try{S=T??e.fn()}catch(C){S=Promise.reject(C)}Promise.resolve(S).then(g).catch(C=>{if(s)return;const L=e.retry??(br?0:3),N=e.retryDelay??VM,U=typeof N=="function"?N(i,C):N,z=L===!0||typeof L=="number"&&i<L||typeof L=="function"&&L(i,C);if(a||!z){b(C);return}i++,e.onFail?.(i,C),BM(U).then(()=>p()?void 0:w()).then(()=>{a?b(C):x()})})};return{promise:c,cancel:f,continue:()=>(l?.(),c),cancelRetry:h,continueRetry:m,canStart:v,start:()=>(v()?x():w().then(x),c)}}var GM=e=>setTimeout(e,0);function FM(){let e=[],a=0,i=h=>{h()},s=h=>{h()},l=GM;const c=h=>{a?e.push(h):l(()=>{i(h)})},f=()=>{const h=e;e=[],h.length&&l(()=>{s(()=>{h.forEach(m=>{i(m)})})})};return{batch:h=>{let m;a++;try{m=h()}finally{a--,a||f()}return m},batchCalls:h=>(...m)=>{c(()=>{h(...m)})},schedule:c,setNotifyFunction:h=>{i=h},setBatchNotifyFunction:h=>{s=h},setScheduler:h=>{l=h}}}var ce=FM(),G1=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Bd(this.gcTime)&&(this.#e=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(br?1/0:300*1e3))}clearGcTimeout(){this.#e&&(clearTimeout(this.#e),this.#e=void 0)}},YM=class extends G1{#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=QM(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 i=Pd(this.state.data,e,this.options);return this.#i({data:i,type:"success",dataUpdatedAt:a?.updatedAt,manual:a?.manual}),i}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(Oe).catch(Oe):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>ln(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Mh||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Ua(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:!U1(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"})}fetch(e,a){if(this.state.fetchStatus!=="idle"){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 m=this.observers.find(p=>p.options.queryFn);m&&this.setOptions(m.options)}const i=new AbortController,s=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(this.#o=!0,i.signal)})},l=()=>{const m=k1(this.options,a),v=(()=>{const g={client:this.#a,queryKey:this.queryKey,meta:this.meta};return s(g),g})();return this.#o=!1,this.options.persister?this.options.persister(m,v,this):m(v)},f=(()=>{const m={fetchOptions:a,options:this.options,queryKey:this.queryKey,client:this.#a,state:this.state,fetchFn:l};return s(m),m})();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});const h=m=>{cd(m)&&m.silent||this.#i({type:"error",error:m}),cd(m)||(this.#n.config.onError?.(m,this),this.#n.config.onSettled?.(this.state.data,m,this)),this.scheduleGc()};return this.#r=V1({initialPromise:a?.initialPromise,fn:f.fetchFn,abort:i.abort.bind(i),onSuccess:m=>{if(m===void 0){h(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(m)}catch(p){h(p);return}this.#n.config.onSuccess?.(m,this),this.#n.config.onSettled?.(m,this.state.error,this),this.scheduleGc()},onError:h,onFail:(m,p)=>{this.#i({type:"failed",failureCount:m,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}),this.#r.start()}#i(e){const a=i=>{switch(e.type){case"failed":return{...i,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,...F1(i.data,this.options),fetchMeta:e.meta??null};case"success":return this.#t=void 0,{...i,data:e.data,dataUpdateCount:i.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=e.error;return cd(s)&&s.revert&&this.#t?{...this.#t,fetchStatus:"idle"}:{...i,error:s,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...e.state}}};this.state=a(this.state),ce.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function F1(e,a){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:H1(a.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function QM(e){const a=typeof e.initialData=="function"?e.initialData():e.initialData,i=a!==void 0,s=i?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:a,dataUpdateCount:0,dataUpdatedAt:i?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}var KM=class extends zi{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,a,i){const s=a.queryKey,l=a.queryHash??Oh(s,a);let c=this.get(l);return c||(c=new YM({client:e,queryKey:s,queryHash:l,options:e.defaultQueryOptions(a),state:i,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(){ce.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(i=>Wy(a,i))}findAll(e={}){const a=this.getAll();return Object.keys(e).length>0?a.filter(i=>Wy(e,i)):a}notify(e){ce.batch(()=>{this.listeners.forEach(a=>{a(e)})})}onFocus(){ce.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ce.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},XM=class extends G1{#e;#t;#n;constructor(e){super(),this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#e=[],this.state=e.state||Y1(),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=V1({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 i=this.state.status==="pending",s=!this.#n.canStart();try{if(i)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=i=>{switch(e.type){case"failed":return{...i,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,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{...i,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:e.error,failureCount:i.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=a(this.state),ce.batch(()=>{this.#e.forEach(i=>{i.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function Y1(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var $M=class extends zi{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,a,i){const s=new XM({mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(a),state:i});return this.add(s),s}add(e){this.#e.add(e);const a=jl(e);if(typeof a=="string"){const i=this.#t.get(a);i?i.push(e):this.#t.set(a,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const a=jl(e);if(typeof a=="string"){const i=this.#t.get(a);if(i)if(i.length>1){const s=i.indexOf(e);s!==-1&&i.splice(s,1)}else i[0]===e&&this.#t.delete(a)}}this.notify({type:"removed",mutation:e})}canRun(e){const a=jl(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=jl(e);return typeof a=="string"?this.#t.get(a)?.find(s=>s!==e&&s.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){ce.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(i=>Jy(a,i))}findAll(e={}){return this.getAll().filter(a=>Jy(e,a))}notify(e){ce.batch(()=>{this.listeners.forEach(a=>{a(e)})})}resumePausedMutations(){const e=this.getAll().filter(a=>a.state.isPaused);return ce.batch(()=>Promise.all(e.map(a=>a.continue().catch(Oe))))}};function jl(e){return e.options.scope?.id}function n0(e){return{onFetch:(a,i)=>{const s=a.options,l=a.fetchOptions?.meta?.fetchMore?.direction,c=a.state.data?.pages||[],f=a.state.data?.pageParams||[];let h={pages:[],pageParams:[]},m=0;const p=async()=>{let v=!1;const g=x=>{Object.defineProperty(x,"signal",{enumerable:!0,get:()=>(a.signal.aborted?v=!0:a.signal.addEventListener("abort",()=>{v=!0}),a.signal)})},b=k1(a.options,a.fetchOptions),w=async(x,S,T)=>{if(v)return Promise.reject();if(S==null&&x.pages.length)return Promise.resolve(x);const L=(()=>{const X={client:a.client,queryKey:a.queryKey,pageParam:S,direction:T?"backward":"forward",meta:a.options.meta};return g(X),X})(),N=await b(L),{maxPages:U}=a.options,z=T?PM:kM;return{pages:z(x.pages,N,U),pageParams:z(x.pageParams,S,U)}};if(l&&c.length){const x=l==="backward",S=x?ZM:a0,T={pages:c,pageParams:f},C=S(s,T);h=await w(T,C,x)}else{const x=e??c.length;do{const S=m===0?f[0]??s.initialPageParam:a0(s,h);if(m>0&&S==null)break;h=await w(h,S),m++}while(m<x)}return h};a.options.persister?a.fetchFn=()=>a.options.persister?.(p,{client:a.client,queryKey:a.queryKey,meta:a.options.meta,signal:a.signal},i):a.fetchFn=p}}}function a0(e,{pages:a,pageParams:i}){const s=a.length-1;return a.length>0?e.getNextPageParam(a[s],a,i[s],i):void 0}function ZM(e,{pages:a,pageParams:i}){return a.length>0?e.getPreviousPageParam?.(a[0],a,i[0],i):void 0}var IM=class{#e;#t;#n;#a;#r;#s;#o;#i;constructor(e={}){this.#e=e.queryCache||new KM,this.#t=e.mutationCache||new $M,this.#n=e.defaultOptions||{},this.#a=new Map,this.#r=new Map,this.#s=0}mount(){this.#s++,this.#s===1&&(this.#o=Dh.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=iu.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),i=this.#e.build(this,a),s=i.state.data;return s===void 0?this.fetchQuery(e):(e.revalidateIfStale&&i.isStaleByTime(Ua(a.staleTime,i))&&this.prefetchQuery(a),Promise.resolve(s))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:a,state:i})=>{const s=i.data;return[a,s]})}setQueryData(e,a,i){const s=this.defaultQueryOptions({queryKey:e}),c=this.#e.get(s.queryHash)?.state.data,f=UM(a,c);if(f!==void 0)return this.#e.build(this,s).setData(f,{...i,manual:!0})}setQueriesData(e,a,i){return ce.batch(()=>this.#e.findAll(e).map(({queryKey:s})=>[s,this.setQueryData(s,a,i)]))}getQueryState(e){const a=this.defaultQueryOptions({queryKey:e});return this.#e.get(a.queryHash)?.state}removeQueries(e){const a=this.#e;ce.batch(()=>{a.findAll(e).forEach(i=>{a.remove(i)})})}resetQueries(e,a){const i=this.#e;return ce.batch(()=>(i.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...e},a)))}cancelQueries(e,a={}){const i={revert:!0,...a},s=ce.batch(()=>this.#e.findAll(e).map(l=>l.cancel(i)));return Promise.all(s).then(Oe).catch(Oe)}invalidateQueries(e,a={}){return ce.batch(()=>(this.#e.findAll(e).forEach(i=>{i.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},a)))}refetchQueries(e,a={}){const i={...a,cancelRefetch:a.cancelRefetch??!0},s=ce.batch(()=>this.#e.findAll(e).filter(l=>!l.isDisabled()&&!l.isStatic()).map(l=>{let c=l.fetch(void 0,i);return i.throwOnError||(c=c.catch(Oe)),l.state.fetchStatus==="paused"?Promise.resolve():c}));return Promise.all(s).then(Oe)}fetchQuery(e){const a=this.defaultQueryOptions(e);a.retry===void 0&&(a.retry=!1);const i=this.#e.build(this,a);return i.isStaleByTime(Ua(a.staleTime,i))?i.fetch(a):Promise.resolve(i.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Oe).catch(Oe)}fetchInfiniteQuery(e){return e.behavior=n0(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Oe).catch(Oe)}ensureInfiniteQueryData(e){return e.behavior=n0(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return iu.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(Sr(e),{queryKey:e,defaultOptions:a})}getQueryDefaults(e){const a=[...this.#a.values()],i={};return a.forEach(s=>{Xs(e,s.queryKey)&&Object.assign(i,s.defaultOptions)}),i}setMutationDefaults(e,a){this.#r.set(Sr(e),{mutationKey:e,defaultOptions:a})}getMutationDefaults(e){const a=[...this.#r.values()],i={};return a.forEach(s=>{Xs(e,s.mutationKey)&&Object.assign(i,s.defaultOptions)}),i}defaultQueryOptions(e){if(e._defaulted)return e;const a={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return a.queryHash||(a.queryHash=Oh(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===Mh&&(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()}},WM=class extends zi{constructor(e,a){super(),this.options=a,this.#e=e,this.#i=null,this.#o=Hd(),this.options.experimental_prefetchInRender||this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(a)}#e;#t=void 0;#n=void 0;#a=void 0;#r;#s;#o;#i;#p;#d;#h;#u;#c;#l;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),r0(this.#t,this.options)?this.#f():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return qd(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return qd(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,i=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 ln(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&&!ru(this.options,a)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const s=this.hasListeners();s&&i0(this.#t,i,this.options,a)&&this.#f(),this.updateResult(),s&&(this.#t!==i||ln(this.options.enabled,this.#t)!==ln(a.enabled,this.#t)||Ua(this.options.staleTime,this.#t)!==Ua(a.staleTime,this.#t))&&this.#g();const l=this.#v();s&&(this.#t!==i||ln(this.options.enabled,this.#t)!==ln(a.enabled,this.#t)||l!==this.#l)&&this.#y(l)}getOptimisticResult(e){const a=this.#e.getQueryCache().build(this.#e,e),i=this.createResult(a,e);return t4(this,i)&&(this.#a=i,this.#s=this.options,this.#r=this.#t.state),i}getCurrentResult(){return this.#a}trackResult(e,a){return new Proxy(e,{get:(i,s)=>(this.trackProp(s),a?.(s),Reflect.get(i,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),i=this.#e.getQueryCache().build(this.#e,a);return i.fetch().then(()=>this.createResult(i,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(Oe)),a}#g(){this.#S();const e=Ua(this.options.staleTime,this.#t);if(br||this.#a.isStale||!Bd(e))return;const i=U1(this.#a.dataUpdatedAt,e)+1;this.#u=setTimeout(()=>{this.#a.isStale||this.updateResult()},i)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(e){this.#x(),this.#l=e,!(br||ln(this.options.enabled,this.#t)===!1||!Bd(this.#l)||this.#l===0)&&(this.#c=setInterval(()=>{(this.options.refetchIntervalInBackground||Dh.isFocused())&&this.#f()},this.#l))}#b(){this.#g(),this.#y(this.#v())}#S(){this.#u&&(clearTimeout(this.#u),this.#u=void 0)}#x(){this.#c&&(clearInterval(this.#c),this.#c=void 0)}createResult(e,a){const i=this.#t,s=this.options,l=this.#a,c=this.#r,f=this.#s,m=e!==i?e.state:this.#n,{state:p}=e;let v={...p},g=!1,b;if(a._optimisticResults){const q=this.hasListeners(),et=!q&&r0(e,a),I=q&&i0(e,i,a,s);(et||I)&&(v={...v,...F1(p.data,e.options)}),a._optimisticResults==="isRestoring"&&(v.fetchStatus="idle")}let{error:w,errorUpdatedAt:x,status:S}=v;b=v.data;let T=!1;if(a.placeholderData!==void 0&&b===void 0&&S==="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&&(S="success",b=Pd(l?.data,q,a),g=!0)}if(a.select&&b!==void 0&&!T)if(l&&b===c?.data&&a.select===this.#p)b=this.#d;else try{this.#p=a.select,b=a.select(b),b=Pd(l?.data,b,a),this.#d=b,this.#i=null}catch(q){this.#i=q}this.#i&&(w=this.#i,b=this.#d,x=Date.now(),S="error");const C=v.fetchStatus==="fetching",L=S==="pending",N=S==="error",U=L&&C,z=b!==void 0,k={status:S,fetchStatus:v.fetchStatus,isPending:L,isSuccess:S==="success",isError:N,isInitialLoading:U,isLoading:U,data:b,dataUpdatedAt:v.dataUpdatedAt,error:w,errorUpdatedAt:x,failureCount:v.fetchFailureCount,failureReason:v.fetchFailureReason,errorUpdateCount:v.errorUpdateCount,isFetched:v.dataUpdateCount>0||v.errorUpdateCount>0,isFetchedAfterMount:v.dataUpdateCount>m.dataUpdateCount||v.errorUpdateCount>m.errorUpdateCount,isFetching:C,isRefetching:C&&!L,isLoadingError:N&&!z,isPaused:v.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:N&&z,isStale:Nh(e,a),refetch:this.refetch,promise:this.#o,isEnabled:ln(a.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const q=st=>{k.status==="error"?st.reject(k.error):k.data!==void 0&&st.resolve(k.data)},et=()=>{const st=this.#o=k.promise=Hd();q(st)},I=this.#o;switch(I.status){case"pending":e.queryHash===i.queryHash&&q(I);break;case"fulfilled":(k.status==="error"||k.data!==I.value)&&et();break;case"rejected":(k.status!=="error"||k.error!==I.reason)&&et();break}}return k}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),ru(a,e))return;this.#a=a;const i=()=>{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:i()})}#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){ce.batch(()=>{e.listeners&&this.listeners.forEach(a=>{a(this.#a)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function JM(e,a){return ln(a.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&a.retryOnMount===!1)}function r0(e,a){return JM(e,a)||e.state.data!==void 0&&qd(e,a,a.refetchOnMount)}function qd(e,a,i){if(ln(a.enabled,e)!==!1&&Ua(a.staleTime,e)!=="static"){const s=typeof i=="function"?i(e):i;return s==="always"||s!==!1&&Nh(e,a)}return!1}function i0(e,a,i,s){return(e!==a||ln(s.enabled,e)===!1)&&(!i.suspense||e.state.status!=="error")&&Nh(e,i)}function Nh(e,a){return ln(a.enabled,e)!==!1&&e.isStaleByTime(Ua(a.staleTime,e))}function t4(e,a){return!ru(e.getCurrentResult(),a)}var e4=class extends zi{#e;#t=void 0;#n;#a;constructor(a,i){super(),this.#e=a,this.setOptions(i),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(a){const i=this.options;this.options=this.#e.defaultMutationOptions(a),ru(this.options,i)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),i?.mutationKey&&this.options.mutationKey&&Sr(i.mutationKey)!==Sr(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,i){return this.#a=i,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??Y1();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){ce.batch(()=>{if(this.#a&&this.hasListeners()){const i=this.#t.variables,s=this.#t.context;a?.type==="success"?(this.#a.onSuccess?.(a.data,i,s),this.#a.onSettled?.(a.data,null,i,s)):a?.type==="error"&&(this.#a.onError?.(a.error,i,s),this.#a.onSettled?.(void 0,a.error,i,s))}this.listeners.forEach(i=>{i(this.#t)})})}},Q1=R.createContext(void 0),K1=e=>{const a=R.useContext(Q1);if(!a)throw new Error("No QueryClient set, use QueryClientProvider to set one");return a},n4=({client:e,children:a})=>(R.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),_.jsx(Q1.Provider,{value:e,children:a})),X1=R.createContext(!1),a4=()=>R.useContext(X1);X1.Provider;function r4(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var i4=R.createContext(r4()),s4=()=>R.useContext(i4),o4=(e,a)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(a.isReset()||(e.retryOnMount=!1))},l4=e=>{R.useEffect(()=>{e.clearReset()},[e])},u4=({result:e,errorResetBoundary:a,throwOnError:i,query:s,suspense:l})=>e.isError&&!a.isReset()&&!e.isFetching&&s&&(l&&e.data===void 0||P1(i,[e.error,s])),c4=e=>{if(e.suspense){const a=s=>s==="static"?s:Math.max(s??1e3,1e3),i=e.staleTime;e.staleTime=typeof i=="function"?(...s)=>a(i(...s)):a(i),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},f4=(e,a)=>e.isLoading&&e.isFetching&&!a,d4=(e,a)=>e?.suspense&&a.isPending,s0=(e,a,i)=>a.fetchOptimistic(e).catch(()=>{i.clearReset()});function h4(e,a,i){const s=a4(),l=s4(),c=K1(),f=c.defaultQueryOptions(e);c.getDefaultOptions().queries?._experimental_beforeQuery?.(f),f._optimisticResults=s?"isRestoring":"optimistic",c4(f),o4(f,l),l4(l);const h=!c.getQueryCache().get(f.queryHash),[m]=R.useState(()=>new a(c,f)),p=m.getOptimisticResult(f),v=!s&&e.subscribed!==!1;if(R.useSyncExternalStore(R.useCallback(g=>{const b=v?m.subscribe(ce.batchCalls(g)):Oe;return m.updateResult(),b},[m,v]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),R.useEffect(()=>{m.setOptions(f)},[f,m]),d4(f,p))throw s0(f,m,l);if(u4({result:p,errorResetBoundary:l,throwOnError:f.throwOnError,query:c.getQueryCache().get(f.queryHash),suspense:f.suspense}))throw p.error;return c.getDefaultOptions().queries?._experimental_afterQuery?.(f,p),f.experimental_prefetchInRender&&!br&&f4(p,s)&&(h?s0(f,m,l):c.getQueryCache().get(f.queryHash)?.promise)?.catch(Oe).finally(()=>{m.updateResult()}),f.notifyOnChangeProps?p:m.trackResult(p)}function m4(e,a){return h4(e,WM)}function p4(e,a){const i=K1(),[s]=R.useState(()=>new e4(i,e));R.useEffect(()=>{s.setOptions(e)},[s,e]);const l=R.useSyncExternalStore(R.useCallback(f=>s.subscribe(ce.batchCalls(f)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),c=R.useCallback((f,h)=>{s.mutate(f,h).catch(Oe)},[s]);if(l.error&&P1(s.options.throwOnError,[l.error]))throw l.error;return{...l,mutate:c,mutateAsync:l.mutate}}function g4(){return _.jsx("div",{className:"h-screen grid place-items-center",children:_.jsx(O0,{className:"size-8 animate-spin"})})}function v4({className:e,...a}){const{setAuthenticated:i}=z1(),[s,l]=R.useState(""),[c,f]=R.useState(""),h=Ah(),{isPending:m,mutate:p}=p4({mutationFn:async()=>h.login(s,c),onError(){$y.error("Invalid credentials",{description:"The credentials you provided are invalid."})},onSuccess(){$y.success("Login successful",{description:"You have successfully logged in."}),i(!0)}});return m?_.jsx(g4,{}):_.jsx("div",{className:Rt("flex flex-col gap-6 w-[20%]",e),...a,children:_.jsxs(WO,{children:[_.jsxs(JO,{children:[_.jsx(tM,{className:"text-2xl",children:"Login"}),_.jsx(eM,{children:"Enter your credentials below to proceed"})]}),_.jsx(nM,{children:_.jsxs("div",{className:"flex flex-col gap-6",children:[_.jsxs("div",{className:"grid gap-2",children:[_.jsx(Qy,{htmlFor:"username",children:"Username"}),_.jsx(uy,{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(Qy,{htmlFor:"password",children:"Password"})}),_.jsx(uy,{id:"password",type:"password",required:!0,value:c,onChange:v=>f(v.target.value)})]}),_.jsx(Q0,{type:"button",className:"w-full",onClick:()=>{p()},children:"Login"})]})})]})})}function y4({children:e}){const{authenticated:a,setAuthenticated:i}=z1(),s=Ah(),{isLoading:l,isError:c}=m4({queryKey:[],enabled:!a,queryFn:async()=>{const f=await s.fetchMe();return i(!!f),f},refetchOnWindowFocus:!0});return l?_.jsx("div",{className:"h-screen grid place-items-center",children:_.jsx(O0,{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(v4,{})})}function b4({...e}){return _.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function S4({className:e,...a}){return _.jsx("ol",{"data-slot":"breadcrumb-list",className:Rt("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",e),...a})}function fd({className:e,...a}){return _.jsx("li",{"data-slot":"breadcrumb-item",className:Rt("inline-flex items-center gap-1.5",e),...a})}function o0({asChild:e,className:a,...i}){const s=e?Is:"a";return _.jsx(s,{"data-slot":"breadcrumb-link",className:Rt("hover:text-foreground transition-colors",a),...i})}function x4({className:e,...a}){return _.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:Rt("text-foreground font-normal",e),...a})}function l0({children:e,className:a,...i}){return _.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:Rt("[&>svg]:size-3.5",a),...i,children:e??_.jsx(IE,{})})}function w4(){const{toggleSidebar:e}=xh();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(Q0,{className:"h-8 w-8",variant:"ghost",size:"icon",onClick:e,children:_.jsx(JE,{})}),_.jsx(C2,{orientation:"vertical",className:"mr-2 h-4"}),_.jsx(b4,{className:"hidden sm:block",children:_.jsxs(S4,{children:[_.jsx(fd,{children:_.jsx(o0,{href:"#",children:"/"})}),_.jsx(l0,{}),_.jsx(fd,{children:_.jsx(x4,{children:"CommandKit"})}),_.jsx(l0,{}),_.jsx(fd,{children:_.jsx(o0,{href:"#",children:"DevTools"})})]})})]})})}var E4=(e,a,i,s,l,c,f,h)=>{let m=document.documentElement,p=["light","dark"];function v(w){(Array.isArray(e)?e:[e]).forEach(x=>{let S=x==="class",T=S&&c?l.map(C=>c[C]||C):l;S?(m.classList.remove(...T),m.classList.add(c&&c[w]?c[w]:w)):m.setAttribute(x,w)}),g(w)}function g(w){h&&p.includes(w)&&(m.style.colorScheme=w)}function b(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(s)v(s);else try{let w=localStorage.getItem(a)||i,x=f&&w==="system"?b():w;v(x)}catch{}},u0=["light","dark"],$1="(prefers-color-scheme: dark)",R4=typeof window>"u",Lh=R.createContext(void 0),_4={setTheme:e=>{},themes:[]},T4=()=>{var e;return(e=R.useContext(Lh))!=null?e:_4},C4=e=>R.useContext(Lh)?R.createElement(R.Fragment,null,e.children):R.createElement(O4,{...e}),A4=["light","dark"],O4=({forcedTheme:e,disableTransitionOnChange:a=!1,enableSystem:i=!0,enableColorScheme:s=!0,storageKey:l="theme",themes:c=A4,defaultTheme:f=i?"system":"light",attribute:h="data-theme",value:m,children:p,nonce:v,scriptProps:g})=>{let[b,w]=R.useState(()=>D4(l,f)),[x,S]=R.useState(()=>b==="system"?dd():b),T=m?Object.values(m):c,C=R.useCallback(z=>{let X=z;if(!X)return;z==="system"&&i&&(X=dd());let k=m?m[X]:X,q=a?N4(v):null,et=document.documentElement,I=st=>{st==="class"?(et.classList.remove(...T),k&&et.classList.add(k)):st.startsWith("data-")&&(k?et.setAttribute(st,k):et.removeAttribute(st))};if(Array.isArray(h)?h.forEach(I):I(h),s){let st=u0.includes(f)?f:null,rt=u0.includes(X)?X:st;et.style.colorScheme=rt}q?.()},[v]),L=R.useCallback(z=>{let X=typeof z=="function"?z(b):z;w(X);try{localStorage.setItem(l,X)}catch{}},[b]),N=R.useCallback(z=>{let X=dd(z);S(X),b==="system"&&i&&!e&&C("system")},[b,e]);R.useEffect(()=>{let z=window.matchMedia($1);return z.addListener(N),N(z),()=>z.removeListener(N)},[N]),R.useEffect(()=>{let z=X=>{X.key===l&&(X.newValue?w(X.newValue):L(f))};return window.addEventListener("storage",z),()=>window.removeEventListener("storage",z)},[L]),R.useEffect(()=>{C(e??b)},[e,b]);let U=R.useMemo(()=>({theme:b,setTheme:L,forcedTheme:e,resolvedTheme:b==="system"?x:b,themes:i?[...c,"system"]:c,systemTheme:i?x:void 0}),[b,L,e,x,i,c]);return R.createElement(Lh.Provider,{value:U},R.createElement(M4,{forcedTheme:e,storageKey:l,attribute:h,enableSystem:i,enableColorScheme:s,defaultTheme:f,value:m,themes:c,nonce:v,scriptProps:g}),p)},M4=R.memo(({forcedTheme:e,storageKey:a,attribute:i,enableSystem:s,enableColorScheme:l,defaultTheme:c,value:f,themes:h,nonce:m,scriptProps:p})=>{let v=JSON.stringify([i,a,c,e,h,f,s,l]).slice(1,-1);return R.createElement("script",{...p,suppressHydrationWarning:!0,nonce:typeof window>"u"?m:"",dangerouslySetInnerHTML:{__html:`(${E4.toString()})(${v})`}})}),D4=(e,a)=>{if(R4)return;let i;try{i=localStorage.getItem(e)||void 0}catch{}return i||a},N4=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)}},dd=e=>(e||(e=window.matchMedia($1)),e.matches?"dark":"light");const L4=({...e})=>{const{theme:a="system"}=T4();return _.jsx(zM,{theme:a,className:"toaster group",style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)"},...e})},wr=DE({head:()=>({meta:[{charSet:"utf-8"},{name:"viewport",content:"width=device-width, initial-scale=1"},{title:"CommandKit DevTools"}]}),component:j4});function j4(){return _.jsxs(C4,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!1,children:[_.jsx(L4,{}),_.jsx(ZO,{children:_.jsx(y4,{children:_.jsx("div",{className:"[--header-height:calc(theme(spacing.14))]",children:_.jsxs(FC,{className:"flex flex-col",children:[_.jsx(w4,{}),_.jsxs("div",{className:"flex flex-1",children:[_.jsx(IO,{}),_.jsx(QC,{children:_.jsx(_0,{})})]})]})})})})]})}const z4="modulepreload",U4=function(e){return"/"+e},c0={},Ui=function(a,i,s){let l=Promise.resolve();if(i&&i.length>0){let m=function(p){return Promise.all(p.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=m(i.map(p=>{if(p=U4(p),p in c0)return;c0[p]=!0;const v=p.endsWith(".css"),g=v?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${g}`))return;const b=document.createElement("link");if(b.rel=v?"stylesheet":z4,v||(b.as="script"),b.crossOrigin="",b.href=p,h&&b.setAttribute("nonce",h),document.head.appendChild(b),v)return new Promise((w,x)=>{b.addEventListener("load",w),b.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${p}`)))})}))}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)})},B4=()=>Ui(()=>import("./plugins-D_xHXlOo.js"),[]),k4=Ba("/plugins")({component:Ai(B4,"component")}),P4=()=>Ui(()=>import("./guilds-C58GdUMa.js"),[]),H4=Ba("/guilds")({component:Ai(P4,"component")}),q4=()=>Ui(()=>import("./feature-flags-C--Nz1ES.js"),[]),V4=Ba("/feature-flags")({component:Ai(q4,"component")}),G4=()=>Ui(()=>import("./events-CiJuGyT_.js"),[]),F4=Ba("/events")({component:Ai(G4,"component")}),Y4=()=>Ui(()=>import("./commands-asOQ7lSa.js"),[]),Q4=Ba("/commands")({component:Ai(Y4,"component")}),K4=()=>Ui(()=>import("./index-CpXa_vsK.js"),[]),X4=Ba("/")({component:Ai(K4,"component")}),$4=k4.update({id:"/plugins",path:"/plugins",getParentRoute:()=>wr}),Z4=H4.update({id:"/guilds",path:"/guilds",getParentRoute:()=>wr}),I4=V4.update({id:"/feature-flags",path:"/feature-flags",getParentRoute:()=>wr}),W4=F4.update({id:"/events",path:"/events",getParentRoute:()=>wr}),J4=Q4.update({id:"/commands",path:"/commands",getParentRoute:()=>wr}),t3=X4.update({id:"/",path:"/",getParentRoute:()=>wr}),e3={IndexRoute:t3,CommandsRoute:J4,EventsRoute:W4,FeatureFlagsRoute:I4,GuildsRoute:Z4,PluginsRoute:$4},n3=wr._addFileChildren(e3)._addFileTypes(),a3=HE({routeTree:n3,defaultPreload:"intent",defaultStaleTime:5e3,scrollRestoration:!0,defaultViewTransition:!0}),r3=new IM;hw.createRoot(document.getElementById("root")).render(_.jsx(R.StrictMode,{children:_.jsx(n4,{client:r3,children:_.jsx(GE,{router:a3})})}));export{cA as A,mA as B,WO as C,g4 as L,m4 as a,JO as b,fA as c,dA as d,nM as e,tM as f,f0 as g,eM as h,Ha as i,_ as j,IE as k,O3 as l,Ci as m,Q0 as n,R as r,Ah as u};
@@ -1,20 +1,20 @@
1
- import{i as c,u as h,j as e,B as s,C as a,b as t,f as r,e as n,l as x,h as m,m as l,n as i}from"./index-BFw8ZaDZ.js";/**
2
- * @license lucide-react v0.536.0 - ISC
1
+ import{i as c,u as h,j as e,B as s,C as a,b as t,f as r,e as n,l as x,h as m,m as l,n as i}from"./index-BUBIVOZB.js";/**
2
+ * @license lucide-react v0.537.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.536.0 - ISC
7
+ * @license lucide-react v0.537.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.536.0 - ISC
12
+ * @license lucide-react v0.537.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.536.0 - ISC
17
+ * @license lucide-react v0.537.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{g as X,u as tt,a as et,j as y,L as nt,B as rt}from"./index-BFw8ZaDZ.js";var U={exports:{}},st=U.exports,V;function it(){return V||(V=1,function(L,C){(function(_,D){L.exports=D()})(st,function(){var _=1e3,D=6e4,A=36e5,g="millisecond",O="second",b="minute",j="hour",p="day",W="week",m="month",J="quarter",v="year",Y="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 n=["th","st","nd","rd"],t=s%100;return"["+s+(n[(t-20)%10]||n[t]||n[0])+"]"}},q=function(s,n,t){var r=String(s);return!r||r.length>=n?s:""+Array(n+1-r.length).join(t)+s},G={s:q,z:function(s){var n=-s.utcOffset(),t=Math.abs(n),r=Math.floor(t/60),e=t%60;return(n<=0?"+":"-")+q(r,2,"0")+":"+q(e,2,"0")},m:function s(n,t){if(n.date()<t.date())return-s(t,n);var r=12*(t.year()-n.year())+(t.month()-n.month()),e=n.clone().add(r,m),i=t-e<0,a=n.clone().add(r+(i?-1:1),m);return+(-(r+(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:v,w:W,d:p,D:Y,h:j,m:b,s:O,ms:g,Q:J}[s]||String(s||"").toLowerCase().replace(/s$/,"")},u:function(s){return s===void 0}},H="en",x={};x[H]=K;var z="$isDayjsObject",R=function(s){return s instanceof E||!(!s||!s[z])},F=function s(n,t,r){var e;if(!n)return H;if(typeof n=="string"){var i=n.toLowerCase();x[i]&&(e=i),t&&(x[i]=t,e=i);var a=n.split("-");if(!e&&a.length>1)return s(a[0])}else{var o=n.name;x[o]=n,e=o}return!r&&e&&(H=e),e||!r&&H},f=function(s,n){if(R(s))return s.clone();var t=typeof n=="object"?n:{};return t.date=s,t.args=arguments,new E(t)},u=G;u.l=F,u.i=R,u.w=function(s,n){return f(s,{locale:n.$L,utc:n.$u,x:n.$x,$offset:n.$offset})};var E=function(){function s(t){this.$L=F(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[z]=!0}var n=s.prototype;return n.parse=function(t){this.$d=function(r){var e=r.date,i=r.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()},n.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()},n.$utils=function(){return u},n.isValid=function(){return this.$d.toString()!==Z},n.isSame=function(t,r){var e=f(t);return this.startOf(r)<=e&&e<=this.endOf(r)},n.isAfter=function(t,r){return f(t)<this.startOf(r)},n.isBefore=function(t,r){return this.endOf(r)<f(t)},n.$g=function(t,r,e){return u.u(t)?this[r]:this.set(e,t)},n.unix=function(){return Math.floor(this.valueOf()/1e3)},n.valueOf=function(){return this.$d.getTime()},n.startOf=function(t,r){var e=this,i=!!u.u(r)||r,a=u.p(t),o=function(w,l){var M=u.w(e.$u?Date.UTC(e.$y,l,w):new Date(e.$y,l,w),e);return i?M:M.endOf(p)},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,k="set"+(this.$u?"UTC":"");switch(a){case v:return i?o(1,0):o(31,11);case m:return i?o(1,h):o(0,h+1);case W:var S=this.$locale().weekStart||0,N=(d<S?d+7:d)-S;return o(i?$-N:$+(6-N),h);case p:case Y:return c(k+"Hours",0);case j:return c(k+"Minutes",1);case b:return c(k+"Seconds",2);case O:return c(k+"Milliseconds",3);default:return this.clone()}},n.endOf=function(t){return this.startOf(t,!1)},n.$set=function(t,r){var e,i=u.p(t),a="set"+(this.$u?"UTC":""),o=(e={},e[p]=a+"Date",e[Y]=a+"Date",e[m]=a+"Month",e[v]=a+"FullYear",e[j]=a+"Hours",e[b]=a+"Minutes",e[O]=a+"Seconds",e[g]=a+"Milliseconds",e)[i],c=i===p?this.$D+(r-this.$W):r;if(i===m||i===v){var d=this.clone().set(Y,1);d.$d[o](c),d.init(),this.$d=d.set(Y,Math.min(this.$D,d.daysInMonth())).$d}else o&&this.$d[o](c);return this.init(),this},n.set=function(t,r){return this.clone().$set(t,r)},n.get=function(t){return this[u.p(t)]()},n.add=function(t,r){var e,i=this;t=Number(t);var a=u.p(r),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===v)return this.set(v,this.$y+t);if(a===p)return o(1);if(a===W)return o(7);var c=(e={},e[b]=D,e[j]=A,e[O]=_,e)[a]||1,d=this.$d.getTime()+t*c;return u.w(d,this)},n.subtract=function(t,r){return this.add(-1*t,r)},n.format=function(t){var r=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,k=e.meridiem,S=function(l,M,T,I){return l&&(l[M]||l(r,i))||T[M].slice(0,I)},N=function(l){return u.s(o%12||12,l,"0")},w=k||function(l,M,T){var I=l<12?"AM":"PM";return T?I.toLowerCase():I};return i.replace(Q,function(l,M){return M||function(T){switch(T){case"YY":return String(r.$y).slice(-2);case"YYYY":return u.s(r.$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 r.$D;case"DD":return u.s(r.$D,2,"0");case"d":return String(r.$W);case"dd":return S(e.weekdaysMin,r.$W,h,2);case"ddd":return S(e.weekdaysShort,r.$W,h,3);case"dddd":return h[r.$W];case"H":return String(o);case"HH":return u.s(o,2,"0");case"h":return N(1);case"hh":return N(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(r.$s);case"ss":return u.s(r.$s,2,"0");case"SSS":return u.s(r.$ms,3,"0");case"Z":return a}return null}(l)||a.replace(":","")})},n.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},n.diff=function(t,r,e){var i,a=this,o=u.p(r),c=f(t),d=(c.utcOffset()-this.utcOffset())*D,h=this-c,$=function(){return u.m(a,c)};switch(o){case v:i=$()/12;break;case m:i=$();break;case J:i=$()/3;break;case W:i=(h-d)/6048e5;break;case p:i=(h-d)/864e5;break;case j:i=h/A;break;case b:i=h/D;break;case O:i=h/_;break;default:i=h}return e?i:u.a(i)},n.daysInMonth=function(){return this.endOf(m).$D},n.$locale=function(){return x[this.$L]},n.locale=function(t,r){if(!t)return this.$L;var e=this.clone(),i=F(t,r,!0);return i&&(e.$L=i),e},n.clone=function(){return u.w(this.$d,this)},n.toDate=function(){return new Date(this.valueOf())},n.toJSON=function(){return this.isValid()?this.toISOString():null},n.toISOString=function(){return this.$d.toISOString()},n.toString=function(){return this.$d.toUTCString()},s}(),B=E.prototype;return f.prototype=B,[["$ms",g],["$s",O],["$m",b],["$H",j],["$W",p],["$M",m],["$y",v],["$D",Y]].forEach(function(s){B[s[1]]=function(n){return this.$g(n,s[0],s[1])}}),f.extend=function(s,n){return s.$i||(s(n,E,f),s.$i=!0),f},f.locale=F,f.isDayjs=R,f.unix=function(s){return f(1e3*s)},f.en=x[H],f.Ls=x,f.p={},f})}(U)),U.exports}var at=it();const ut=X(at),ot="YYYY-MM-DD HH:mm:ss";function ct(L,C=ot){return ut(L).format(C)}const dt=function(){const C=tt(),{data:_,isLoading:D,isError:A}=et({queryKey:["plugins"],queryFn:async()=>await C.plugins.fetch()});return D||!_?y.jsx(nt,{}):A?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:_.map(g=>y.jsxs("div",{className:"border p-4 rounded",children:[y.jsx("h2",{className:"text-lg font-semibold",children:g.name}),y.jsx(rt,{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 nt,B as rt}from"./index-BUBIVOZB.js";var U={exports:{}},st=U.exports,V;function it(){return V||(V=1,function(L,C){(function(_,D){L.exports=D()})(st,function(){var _=1e3,D=6e4,A=36e5,g="millisecond",O="second",b="minute",j="hour",p="day",W="week",m="month",J="quarter",v="year",Y="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 n=["th","st","nd","rd"],t=s%100;return"["+s+(n[(t-20)%10]||n[t]||n[0])+"]"}},q=function(s,n,t){var r=String(s);return!r||r.length>=n?s:""+Array(n+1-r.length).join(t)+s},G={s:q,z:function(s){var n=-s.utcOffset(),t=Math.abs(n),r=Math.floor(t/60),e=t%60;return(n<=0?"+":"-")+q(r,2,"0")+":"+q(e,2,"0")},m:function s(n,t){if(n.date()<t.date())return-s(t,n);var r=12*(t.year()-n.year())+(t.month()-n.month()),e=n.clone().add(r,m),i=t-e<0,a=n.clone().add(r+(i?-1:1),m);return+(-(r+(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:v,w:W,d:p,D:Y,h:j,m:b,s:O,ms:g,Q:J}[s]||String(s||"").toLowerCase().replace(/s$/,"")},u:function(s){return s===void 0}},H="en",x={};x[H]=K;var z="$isDayjsObject",R=function(s){return s instanceof E||!(!s||!s[z])},F=function s(n,t,r){var e;if(!n)return H;if(typeof n=="string"){var i=n.toLowerCase();x[i]&&(e=i),t&&(x[i]=t,e=i);var a=n.split("-");if(!e&&a.length>1)return s(a[0])}else{var o=n.name;x[o]=n,e=o}return!r&&e&&(H=e),e||!r&&H},f=function(s,n){if(R(s))return s.clone();var t=typeof n=="object"?n:{};return t.date=s,t.args=arguments,new E(t)},u=G;u.l=F,u.i=R,u.w=function(s,n){return f(s,{locale:n.$L,utc:n.$u,x:n.$x,$offset:n.$offset})};var E=function(){function s(t){this.$L=F(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[z]=!0}var n=s.prototype;return n.parse=function(t){this.$d=function(r){var e=r.date,i=r.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()},n.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()},n.$utils=function(){return u},n.isValid=function(){return this.$d.toString()!==Z},n.isSame=function(t,r){var e=f(t);return this.startOf(r)<=e&&e<=this.endOf(r)},n.isAfter=function(t,r){return f(t)<this.startOf(r)},n.isBefore=function(t,r){return this.endOf(r)<f(t)},n.$g=function(t,r,e){return u.u(t)?this[r]:this.set(e,t)},n.unix=function(){return Math.floor(this.valueOf()/1e3)},n.valueOf=function(){return this.$d.getTime()},n.startOf=function(t,r){var e=this,i=!!u.u(r)||r,a=u.p(t),o=function(w,l){var M=u.w(e.$u?Date.UTC(e.$y,l,w):new Date(e.$y,l,w),e);return i?M:M.endOf(p)},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,k="set"+(this.$u?"UTC":"");switch(a){case v:return i?o(1,0):o(31,11);case m:return i?o(1,h):o(0,h+1);case W:var S=this.$locale().weekStart||0,N=(d<S?d+7:d)-S;return o(i?$-N:$+(6-N),h);case p:case Y:return c(k+"Hours",0);case j:return c(k+"Minutes",1);case b:return c(k+"Seconds",2);case O:return c(k+"Milliseconds",3);default:return this.clone()}},n.endOf=function(t){return this.startOf(t,!1)},n.$set=function(t,r){var e,i=u.p(t),a="set"+(this.$u?"UTC":""),o=(e={},e[p]=a+"Date",e[Y]=a+"Date",e[m]=a+"Month",e[v]=a+"FullYear",e[j]=a+"Hours",e[b]=a+"Minutes",e[O]=a+"Seconds",e[g]=a+"Milliseconds",e)[i],c=i===p?this.$D+(r-this.$W):r;if(i===m||i===v){var d=this.clone().set(Y,1);d.$d[o](c),d.init(),this.$d=d.set(Y,Math.min(this.$D,d.daysInMonth())).$d}else o&&this.$d[o](c);return this.init(),this},n.set=function(t,r){return this.clone().$set(t,r)},n.get=function(t){return this[u.p(t)]()},n.add=function(t,r){var e,i=this;t=Number(t);var a=u.p(r),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===v)return this.set(v,this.$y+t);if(a===p)return o(1);if(a===W)return o(7);var c=(e={},e[b]=D,e[j]=A,e[O]=_,e)[a]||1,d=this.$d.getTime()+t*c;return u.w(d,this)},n.subtract=function(t,r){return this.add(-1*t,r)},n.format=function(t){var r=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,k=e.meridiem,S=function(l,M,T,I){return l&&(l[M]||l(r,i))||T[M].slice(0,I)},N=function(l){return u.s(o%12||12,l,"0")},w=k||function(l,M,T){var I=l<12?"AM":"PM";return T?I.toLowerCase():I};return i.replace(Q,function(l,M){return M||function(T){switch(T){case"YY":return String(r.$y).slice(-2);case"YYYY":return u.s(r.$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 r.$D;case"DD":return u.s(r.$D,2,"0");case"d":return String(r.$W);case"dd":return S(e.weekdaysMin,r.$W,h,2);case"ddd":return S(e.weekdaysShort,r.$W,h,3);case"dddd":return h[r.$W];case"H":return String(o);case"HH":return u.s(o,2,"0");case"h":return N(1);case"hh":return N(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(r.$s);case"ss":return u.s(r.$s,2,"0");case"SSS":return u.s(r.$ms,3,"0");case"Z":return a}return null}(l)||a.replace(":","")})},n.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},n.diff=function(t,r,e){var i,a=this,o=u.p(r),c=f(t),d=(c.utcOffset()-this.utcOffset())*D,h=this-c,$=function(){return u.m(a,c)};switch(o){case v:i=$()/12;break;case m:i=$();break;case J:i=$()/3;break;case W:i=(h-d)/6048e5;break;case p:i=(h-d)/864e5;break;case j:i=h/A;break;case b:i=h/D;break;case O:i=h/_;break;default:i=h}return e?i:u.a(i)},n.daysInMonth=function(){return this.endOf(m).$D},n.$locale=function(){return x[this.$L]},n.locale=function(t,r){if(!t)return this.$L;var e=this.clone(),i=F(t,r,!0);return i&&(e.$L=i),e},n.clone=function(){return u.w(this.$d,this)},n.toDate=function(){return new Date(this.valueOf())},n.toJSON=function(){return this.isValid()?this.toISOString():null},n.toISOString=function(){return this.$d.toISOString()},n.toString=function(){return this.$d.toUTCString()},s}(),B=E.prototype;return f.prototype=B,[["$ms",g],["$s",O],["$m",b],["$H",j],["$W",p],["$M",m],["$y",v],["$D",Y]].forEach(function(s){B[s[1]]=function(n){return this.$g(n,s[0],s[1])}}),f.extend=function(s,n){return s.$i||(s(n,E,f),s.$i=!0),f},f.locale=F,f.isDayjs=R,f.unix=function(s){return f(1e3*s)},f.en=x[H],f.Ls=x,f.p={},f})}(U)),U.exports}var at=it();const ut=X(at),ot="YYYY-MM-DD HH:mm:ss";function ct(L,C=ot){return ut(L).format(C)}const dt=function(){const C=tt(),{data:_,isLoading:D,isError:A}=et({queryKey:["plugins"],queryFn:async()=>await C.plugins.fetch()});return D||!_?y.jsx(nt,{}):A?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:_.map(g=>y.jsxs("div",{className:"border p-4 rounded",children:[y.jsx("h2",{className:"text-lg font-semibold",children:g.name}),y.jsx(rt,{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-BFw8ZaDZ.js"></script>
14
+ <script type="module" crossorigin src="/assets/index-BUBIVOZB.js"></script>
15
15
  <link rel="stylesheet" crossorigin href="/assets/index-BGwstrSk.css">
16
16
  </head>
17
17
  <body>