@commandkit/devtools 1.2.0-dev.20251125020117 → 1.2.0-dev.20260114150514

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.
@@ -639,8 +639,8 @@ attach them to the start of each source file to most effectively state
639
639
  the exclusion of warranty; and each file should have at least the
640
640
  "copyright" line and a pointer to where the full notice is found.
641
641
 
642
- <one line to give the program's name and a brief idea of what it does.>
643
- Copyright (C) <year> <name of author>
642
+ CommandKit is a discord.js metaframework
643
+ Copyright (C) 2026 Neplex
644
644
 
645
645
  This program is free software: you can redistribute it and/or modify
646
646
  it under the terms of the GNU General Public License as published by
@@ -661,7 +661,7 @@ mail.
661
661
  If the program does terminal interaction, make it output a short
662
662
  notice like this when it starts in an interactive mode:
663
663
 
664
- <program> Copyright (C) <year> <name of author>
664
+ CommandKit Copyright (C) 2026 Neplex
665
665
  This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
666
666
  This is free software, and you are welcome to redistribute it
667
667
  under certain conditions; type `show c' for details.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@commandkit/devtools",
3
3
  "description": "CommandKit devtools",
4
- "version": "1.2.0-dev.20251125020117",
4
+ "version": "1.2.0-dev.20260114150514",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "license": "GPL-3.0-only",
@@ -10,9 +10,9 @@
10
10
  "@types/cors": "^2.8.18",
11
11
  "@types/express": "^5.0.1",
12
12
  "discord.js": "^14.24.0",
13
- "typescript": "^5.8.3",
14
- "commandkit": "1.2.0-dev.20251125020117",
15
- "tsconfig": "0.0.0-dev.20251125020117"
13
+ "typescript": "^5.9.3",
14
+ "commandkit": "1.2.0-dev.20260114150514",
15
+ "tsconfig": "0.0.0-dev.20260114150514"
16
16
  },
17
17
  "files": [
18
18
  "dist",
@@ -1,4 +1,4 @@
1
- import{i,r as p,u as N,a as g,j as e,B as c,k as v,C as f}from"./index-IZ8meTaT.js";/**
1
+ import{i,r as p,u as N,a as g,j as e,B as c,k as v,C as f}from"./index-BozYQe_u.js";/**
2
2
  * @license lucide-react v0.545.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{u as x,a as p,r as o,j as e,L as u,B as c}from"./index-IZ8meTaT.js";function f(){const i=x(),{data:r,isLoading:m,isError:l}=p({queryKey:["events"],queryFn:async()=>await i.events.fetch()}),n=o.useMemo(()=>crypto.randomUUID(),[]),d=o.useMemo(()=>{if(!r)return[];const s={};return r.forEach(a=>{const t=a.namespace||n;s[t]||(s[t]=[]),s[t].push(a)}),Object.entries(s).map(([a,t])=>({namespace:a,events:t}))},[r,n]);return m||!r?e.jsx(u,{}):l?e.jsx("div",{className:"h-screen grid place-items-center",children:e.jsx("h1",{className:"text-2xl text-red-500",children:"An error occurred while fetching events data."})}):e.jsx("div",{className:"p-4",children:d.map(s=>e.jsxs("div",{className:"mb-6",children:[e.jsx("h1",{className:"text-2xl font-bold capitalize",children:s.namespace===n?"Default":s.namespace}),e.jsx("div",{className:"grid grid-cols-3 gap-4 py-4",children:s.events.map(a=>e.jsxs("div",{className:"border p-4 rounded",children:[e.jsx("h2",{className:"text-lg font-semibold",children:a.name}),e.jsx("p",{className:"text-muted-foreground text-xs mt-2 font-medium font-mono break-all",children:a.metadata.path}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs(c,{variant:"outline",className:"text-xs text-gray-500 mt-2 font-mono",children:["Namespace: ",a.namespace||"discord.js"]}),e.jsxs(c,{variant:"outline",className:"text-xs text-gray-500 mt-2 font-mono break-all",children:["Once: ",a.onceListeners]}),e.jsxs(c,{variant:"outline",className:"text-xs text-gray-500 mt-2 font-mono break-all",children:["Regular: ",a.regularListeners]})]})]},`${a.name}-${s.namespace}`))})]},s.namespace))})}export{f as component};
1
+ import{u as x,a as p,r as o,j as e,L as u,B as c}from"./index-BozYQe_u.js";function f(){const i=x(),{data:r,isLoading:m,isError:l}=p({queryKey:["events"],queryFn:async()=>await i.events.fetch()}),n=o.useMemo(()=>crypto.randomUUID(),[]),d=o.useMemo(()=>{if(!r)return[];const s={};return r.forEach(a=>{const t=a.namespace||n;s[t]||(s[t]=[]),s[t].push(a)}),Object.entries(s).map(([a,t])=>({namespace:a,events:t}))},[r,n]);return m||!r?e.jsx(u,{}):l?e.jsx("div",{className:"h-screen grid place-items-center",children:e.jsx("h1",{className:"text-2xl text-red-500",children:"An error occurred while fetching events data."})}):e.jsx("div",{className:"p-4",children:d.map(s=>e.jsxs("div",{className:"mb-6",children:[e.jsx("h1",{className:"text-2xl font-bold capitalize",children:s.namespace===n?"Default":s.namespace}),e.jsx("div",{className:"grid grid-cols-3 gap-4 py-4",children:s.events.map(a=>e.jsxs("div",{className:"border p-4 rounded",children:[e.jsx("h2",{className:"text-lg font-semibold",children:a.name}),e.jsx("p",{className:"text-muted-foreground text-xs mt-2 font-medium font-mono break-all",children:a.metadata.path}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs(c,{variant:"outline",className:"text-xs text-gray-500 mt-2 font-mono",children:["Namespace: ",a.namespace||"discord.js"]}),e.jsxs(c,{variant:"outline",className:"text-xs text-gray-500 mt-2 font-mono break-all",children:["Once: ",a.onceListeners]}),e.jsxs(c,{variant:"outline",className:"text-xs text-gray-500 mt-2 font-mono break-all",children:["Regular: ",a.regularListeners]})]})]},`${a.name}-${s.namespace}`))})]},s.namespace))})}export{f as component};
@@ -1 +1 @@
1
- import{u as i,a as d,j as e,L as o,B as c}from"./index-IZ8meTaT.js";function u(){const r=i(),{data:t,isLoading:a,isError:n}=d({queryKey:["feature-flags"],queryFn:async()=>await r.getFeatureFlags()});return a||!t?e.jsx(o,{}):n?e.jsx("div",{className:"h-screen grid place-items-center",children:e.jsx("h1",{className:"text-2xl text-red-500",children:"An error occurred while fetching plugins data."})}):e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold ",children:"Feature Flags"}),e.jsx("p",{className:"text-muted-foreground",children:"The below is a list of active feature flags in your project"})]}),e.jsx("div",{className:"grid grid-cols-3 gap-4 py-4",children:t.flags.map(s=>e.jsxs("div",{className:"border p-4 rounded",children:[e.jsx("h2",{className:"text-lg font-semibold",children:s.key}),e.jsx("p",{className:"text-muted-foreground text-xs mt-2 font-medium",children:s.description||`${s.key} feature flag`}),s.hasIdentify&&e.jsx(c,{variant:"outline",className:"text-sm text-gray-500 mt-2 font-mono",children:"identify"})]},s.key))})]})}export{u as component};
1
+ import{u as i,a as d,j as e,L as o,B as c}from"./index-BozYQe_u.js";function u(){const r=i(),{data:t,isLoading:a,isError:n}=d({queryKey:["feature-flags"],queryFn:async()=>await r.getFeatureFlags()});return a||!t?e.jsx(o,{}):n?e.jsx("div",{className:"h-screen grid place-items-center",children:e.jsx("h1",{className:"text-2xl text-red-500",children:"An error occurred while fetching plugins data."})}):e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold ",children:"Feature Flags"}),e.jsx("p",{className:"text-muted-foreground",children:"The below is a list of active feature flags in your project"})]}),e.jsx("div",{className:"grid grid-cols-3 gap-4 py-4",children:t.flags.map(s=>e.jsxs("div",{className:"border p-4 rounded",children:[e.jsx("h2",{className:"text-lg font-semibold",children:s.key}),e.jsx("p",{className:"text-muted-foreground text-xs mt-2 font-medium",children:s.description||`${s.key} feature flag`}),s.hasIdentify&&e.jsx(c,{variant:"outline",className:"text-sm text-gray-500 mt-2 font-mono",children:"identify"})]},s.key))})]})}export{u as component};
@@ -1 +1 @@
1
- import{u as t,a as d,j as e,L as i,C as l,b as o,A as x,c as m,d as h,e as j,f as u,h as p}from"./index-IZ8meTaT.js";function f(){const a=t(),{data:r,isLoading:n,isError:c}=d({queryKey:["guilds"],queryFn:async()=>await a.guilds.fetch()});return n||!r?e.jsx(i,{}):c?e.jsx("div",{className:"h-screen grid place-items-center",children:e.jsx("h1",{className:"text-2xl text-red-500",children:"An error occurred while fetching guilds data."})}):e.jsxs("div",{className:"grid grid-cols-3 gap-4 p-4",children:[e.jsx("h1",{className:"text-2xl font-bold col-span-3",children:"Guilds"}),r.map(s=>e.jsxs(l,{className:"border py-4 rounded",children:[e.jsx(o,{children:e.jsxs(x,{className:"h-12 w-12 rounded-lg",children:[e.jsx(m,{src:s.iconURL,alt:s.name}),e.jsx(h,{className:"rounded-lg",children:s.nameAcronym})]})}),e.jsxs(j,{children:[e.jsx(u,{children:s.name}),e.jsx(p,{children:s.description||`${s.name} server`})]})]},s.id))]})}export{f as component};
1
+ import{u as t,a as d,j as e,L as i,C as l,b as o,A as x,c as m,d as h,e as j,f as u,h as p}from"./index-BozYQe_u.js";function f(){const a=t(),{data:r,isLoading:n,isError:c}=d({queryKey:["guilds"],queryFn:async()=>await a.guilds.fetch()});return n||!r?e.jsx(i,{}):c?e.jsx("div",{className:"h-screen grid place-items-center",children:e.jsx("h1",{className:"text-2xl text-red-500",children:"An error occurred while fetching guilds data."})}):e.jsxs("div",{className:"grid grid-cols-3 gap-4 p-4",children:[e.jsx("h1",{className:"text-2xl font-bold col-span-3",children:"Guilds"}),r.map(s=>e.jsxs(l,{className:"border py-4 rounded",children:[e.jsx(o,{children:e.jsxs(x,{className:"h-12 w-12 rounded-lg",children:[e.jsx(m,{src:s.iconURL,alt:s.name}),e.jsx(h,{className:"rounded-lg",children:s.nameAcronym})]})}),e.jsxs(j,{children:[e.jsx(u,{children:s.name}),e.jsx(p,{children:s.description||`${s.name} server`})]})]},s.id))]})}export{f as component};
@@ -1,4 +1,4 @@
1
- import{i as c,u as h,j as e,B as s,C as a,b as r,f as t,e as l,l as x,h as m,m as n,n as i}from"./index-IZ8meTaT.js";/**
1
+ import{i as c,u as h,j as e,B as s,C as a,b as r,f as t,e as l,l as x,h as m,m as n,n as i}from"./index-BozYQe_u.js";/**
2
2
  * @license lucide-react v0.545.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -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 o=new this(a);return i.forEach(l=>o.set(l)),o}static accessor(a){const o=(this[o0]=this[o0]={accessors:{}}).accessors,l=this.prototype;function u(d){const h=Zo(d);o[h]||(wM(l,d),o[h]=!0)}return G.isArray(a)?a.forEach(u):u(a),this}};Ve.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);G.reduceDescriptors(Ve.prototype,({value:e},a)=>{let i=a[0].toUpperCase()+a.slice(1);return{get:()=>e,set(o){this[i]=o}}});G.freezeMethods(Ve);function Rd(e,a){const i=this||ys,o=a||i,l=Ve.from(o.headers);let u=o.data;return G.forEach(e,function(h){u=h.call(i,u,l.normalize(),a?a.status:void 0)}),l.normalize(),u}function r1(e){return!!(e&&e.__CANCEL__)}function $i(e,a,i){wt.call(this,e??"canceled",wt.ERR_CANCELED,a,i),this.name="CanceledError"}G.inherits($i,wt,{__CANCEL__:!0});function i1(e,a,i){const o=i.config.validateStatus;!i.status||!o||o(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 EM(e){const a=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return a&&a[1]||""}function RM(e,a){e=e||10;const i=new Array(e),o=new Array(e);let l=0,u=0,d;return a=a!==void 0?a:1e3,function(p){const m=Date.now(),g=o[u];d||(d=m),i[l]=p,o[l]=m;let v=u,b=0;for(;v!==l;)b+=i[v++],v=v%e;if(l=(l+1)%e,l===u&&(u=(u+1)%e),m-d<a)return;const x=g&&m-g;return x?Math.round(b*1e3/x):void 0}}function _M(e,a){let i=0,o=1e3/a,l,u;const d=(m,g=Date.now())=>{i=g,l=null,u&&(clearTimeout(u),u=null),e(...m)};return[(...m)=>{const g=Date.now(),v=g-i;v>=o?d(m,g):(l=m,u||(u=setTimeout(()=>{u=null,d(l)},o-v)))},()=>l&&d(l)]}const vu=(e,a,i=3)=>{let o=0;const l=RM(50,250);return _M(u=>{const d=u.loaded,h=u.lengthComputable?u.total:void 0,p=d-o,m=l(p),g=d<=h;o=d;const v={loaded:d,total:h,progress:h?d/h:void 0,bytes:p,rate:m||void 0,estimated:m&&h&&g?(h-d)/m:void 0,event:u,lengthComputable:h!=null,[a?"download":"upload"]:!0};e(v)},i)},s0=(e,a)=>{const i=e!=null;return[o=>a[0]({lengthComputable:i,total:e,loaded:o}),a[1]]},l0=e=>(...a)=>G.asap(()=>e(...a)),CM=Ee.hasStandardBrowserEnv?((e,a)=>i=>(i=new URL(i,Ee.origin),e.protocol===i.protocol&&e.host===i.host&&(a||e.port===i.port)))(new URL(Ee.origin),Ee.navigator&&/(msie|trident)/i.test(Ee.navigator.userAgent)):()=>!0,TM=Ee.hasStandardBrowserEnv?{write(e,a,i,o,l,u){const d=[e+"="+encodeURIComponent(a)];G.isNumber(i)&&d.push("expires="+new Date(i).toGMTString()),G.isString(o)&&d.push("path="+o),G.isString(l)&&d.push("domain="+l),u===!0&&d.push("secure"),document.cookie=d.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 AM(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function OM(e,a){return a?e.replace(/\/?\/$/,"")+"/"+a.replace(/^\/+/,""):e}function o1(e,a,i){let o=!AM(a);return e&&(o||i==!1)?OM(e,a):a}const u0=e=>e instanceof Ve?{...e}:e;function zr(e,a){a=a||{};const i={};function o(m,g,v,b){return G.isPlainObject(m)&&G.isPlainObject(g)?G.merge.call({caseless:b},m,g):G.isPlainObject(g)?G.merge({},g):G.isArray(g)?g.slice():g}function l(m,g,v,b){if(G.isUndefined(g)){if(!G.isUndefined(m))return o(void 0,m,v,b)}else return o(m,g,v,b)}function u(m,g){if(!G.isUndefined(g))return o(void 0,g)}function d(m,g){if(G.isUndefined(g)){if(!G.isUndefined(m))return o(void 0,m)}else return o(void 0,g)}function h(m,g,v){if(v in a)return o(m,g);if(v in e)return o(void 0,m)}const p={url:u,method:u,data:u,baseURL:d,transformRequest:d,transformResponse:d,paramsSerializer:d,timeout:d,timeoutMessage:d,withCredentials:d,withXSRFToken:d,adapter:d,responseType:d,xsrfCookieName:d,xsrfHeaderName:d,onUploadProgress:d,onDownloadProgress:d,decompress:d,maxContentLength:d,maxBodyLength:d,beforeRedirect:d,transport:d,httpAgent:d,httpsAgent:d,cancelToken:d,socketPath:d,responseEncoding:d,validateStatus:h,headers:(m,g,v)=>l(u0(m),u0(g),v,!0)};return G.forEach(Object.keys({...e,...a}),function(g){const v=p[g]||l,b=v(e[g],a[g],g);G.isUndefined(b)&&v!==h||(i[g]=b)}),i}const s1=e=>{const a=zr({},e);let{data:i,withXSRFToken:o,xsrfHeaderName:l,xsrfCookieName:u,headers:d,auth:h}=a;if(a.headers=d=Ve.from(d),a.url=e1(o1(a.baseURL,a.url,a.allowAbsoluteUrls),e.params,e.paramsSerializer),h&&d.set("Authorization","Basic "+btoa((h.username||"")+":"+(h.password?unescape(encodeURIComponent(h.password)):""))),G.isFormData(i)){if(Ee.hasStandardBrowserEnv||Ee.hasStandardBrowserWebWorkerEnv)d.setContentType(void 0);else if(G.isFunction(i.getHeaders)){const p=i.getHeaders(),m=["content-type","content-length"];Object.entries(p).forEach(([g,v])=>{m.includes(g.toLowerCase())&&d.set(g,v)})}}if(Ee.hasStandardBrowserEnv&&(o&&G.isFunction(o)&&(o=o(a)),o||o!==!1&&CM(a.url))){const p=l&&u&&TM.read(u);p&&d.set(l,p)}return a},MM=typeof XMLHttpRequest<"u",NM=MM&&function(e){return new Promise(function(i,o){const l=s1(e);let u=l.data;const d=Ve.from(l.headers).normalize();let{responseType:h,onUploadProgress:p,onDownloadProgress:m}=l,g,v,b,x,S;function w(){x&&x(),S&&S(),l.cancelToken&&l.cancelToken.unsubscribe(g),l.signal&&l.signal.removeEventListener("abort",g)}let C=new XMLHttpRequest;C.open(l.method.toUpperCase(),l.url,!0),C.timeout=l.timeout;function T(){if(!C)return;const D=Ve.from("getAllResponseHeaders"in C&&C.getAllResponseHeaders()),B={data:!h||h==="text"||h==="json"?C.responseText:C.response,status:C.status,statusText:C.statusText,headers:D,config:e,request:C};i1(function(j){i(j),w()},function(j){o(j),w()},B),C=null}"onloadend"in C?C.onloadend=T:C.onreadystatechange=function(){!C||C.readyState!==4||C.status===0&&!(C.responseURL&&C.responseURL.indexOf("file:")===0)||setTimeout(T)},C.onabort=function(){C&&(o(new wt("Request aborted",wt.ECONNABORTED,e,C)),C=null)},C.onerror=function(U){const B=U&&U.message?U.message:"Network Error",K=new wt(B,wt.ERR_NETWORK,e,C);K.event=U||null,o(K),C=null},C.ontimeout=function(){let U=l.timeout?"timeout of "+l.timeout+"ms exceeded":"timeout exceeded";const B=l.transitional||n1;l.timeoutErrorMessage&&(U=l.timeoutErrorMessage),o(new wt(U,B.clarifyTimeoutError?wt.ETIMEDOUT:wt.ECONNABORTED,e,C)),C=null},u===void 0&&d.setContentType(null),"setRequestHeader"in C&&G.forEach(d.toJSON(),function(U,B){C.setRequestHeader(B,U)}),G.isUndefined(l.withCredentials)||(C.withCredentials=!!l.withCredentials),h&&h!=="json"&&(C.responseType=l.responseType),m&&([b,S]=vu(m,!0),C.addEventListener("progress",b)),p&&C.upload&&([v,x]=vu(p),C.upload.addEventListener("progress",v),C.upload.addEventListener("loadend",x)),(l.cancelToken||l.signal)&&(g=D=>{C&&(o(!D||D.type?new $i(null,e,C):D),C.abort(),C=null)},l.cancelToken&&l.cancelToken.subscribe(g),l.signal&&(l.signal.aborted?g():l.signal.addEventListener("abort",g)));const z=EM(l.url);if(z&&Ee.protocols.indexOf(z)===-1){o(new wt("Unsupported protocol "+z+":",wt.ERR_BAD_REQUEST,e));return}C.send(u||null)})},DM=(e,a)=>{const{length:i}=e=e?e.filter(Boolean):[];if(a||i){let o=new AbortController,l;const u=function(m){if(!l){l=!0,h();const g=m instanceof Error?m:this.reason;o.abort(g instanceof wt?g:new $i(g instanceof Error?g.message:g))}};let d=a&&setTimeout(()=>{d=null,u(new wt(`timeout ${a} of ms exceeded`,wt.ETIMEDOUT))},a);const h=()=>{e&&(d&&clearTimeout(d),d=null,e.forEach(m=>{m.unsubscribe?m.unsubscribe(u):m.removeEventListener("abort",u)}),e=null)};e.forEach(m=>m.addEventListener("abort",u));const{signal:p}=o;return p.unsubscribe=()=>G.asap(h),p}},zM=function*(e,a){let i=e.byteLength;if(i<a){yield e;return}let o=0,l;for(;o<i;)l=o+a,yield e.slice(o,l),o=l},LM=async function*(e,a){for await(const i of jM(e))yield*zM(i,a)},jM=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const a=e.getReader();try{for(;;){const{done:i,value:o}=await a.read();if(i)break;yield o}}finally{await a.cancel()}},c0=(e,a,i,o)=>{const l=LM(e,a);let u=0,d,h=p=>{d||(d=!0,o&&o(p))};return new ReadableStream({async pull(p){try{const{done:m,value:g}=await l.next();if(m){h(),p.close();return}let v=g.byteLength;if(i){let b=u+=v;i(b)}p.enqueue(new Uint8Array(g))}catch(m){throw h(m),m}},cancel(p){return h(p),l.return()}},{highWaterMark:2})},f0=64*1024,{isFunction:Ql}=G,UM=(({Request:e,Response:a})=>({Request:e,Response:a}))(G.global),{ReadableStream:d0,TextEncoder:h0}=G.global,m0=(e,...a)=>{try{return!!e(...a)}catch{return!1}},BM=e=>{e=G.merge.call({skipUndefined:!0},UM,e);const{fetch:a,Request:i,Response:o}=e,l=a?Ql(a):typeof fetch=="function",u=Ql(i),d=Ql(o);if(!l)return!1;const h=l&&Ql(d0),p=l&&(typeof h0=="function"?(S=>w=>S.encode(w))(new h0):async S=>new Uint8Array(await new i(S).arrayBuffer())),m=u&&h&&m0(()=>{let S=!1;const w=new i(Ee.origin,{body:new d0,method:"POST",get duplex(){return S=!0,"half"}}).headers.has("Content-Type");return S&&!w}),g=d&&h&&m0(()=>G.isReadableStream(new o("").body)),v={stream:g&&(S=>S.body)};l&&["text","arrayBuffer","blob","formData","stream"].forEach(S=>{!v[S]&&(v[S]=(w,C)=>{let T=w&&w[S];if(T)return T.call(w);throw new wt(`Response type '${S}' is not supported`,wt.ERR_NOT_SUPPORT,C)})});const b=async S=>{if(S==null)return 0;if(G.isBlob(S))return S.size;if(G.isSpecCompliantForm(S))return(await new i(Ee.origin,{method:"POST",body:S}).arrayBuffer()).byteLength;if(G.isArrayBufferView(S)||G.isArrayBuffer(S))return S.byteLength;if(G.isURLSearchParams(S)&&(S=S+""),G.isString(S))return(await p(S)).byteLength},x=async(S,w)=>{const C=G.toFiniteNumber(S.getContentLength());return C??b(w)};return async S=>{let{url:w,method:C,data:T,signal:z,cancelToken:D,timeout:U,onDownloadProgress:B,onUploadProgress:K,responseType:j,headers:V,withCredentials:et="same-origin",fetchOptions:J}=s1(S),at=a||fetch;j=j?(j+"").toLowerCase():"text";let rt=DM([z,D&&D.toAbortSignal()],U),ht=null;const st=rt&&rt.unsubscribe&&(()=>{rt.unsubscribe()});let yt;try{if(K&&m&&C!=="get"&&C!=="head"&&(yt=await x(V,T))!==0){let O=new i(w,{method:"POST",body:T,duplex:"half"}),Y;if(G.isFormData(T)&&(Y=O.headers.get("content-type"))&&V.setContentType(Y),O.body){const[Q,W]=s0(yt,vu(l0(K)));T=c0(O.body,f0,Q,W)}}G.isString(et)||(et=et?"include":"omit");const M=u&&"credentials"in i.prototype,X={...J,signal:rt,method:C.toUpperCase(),headers:V.normalize().toJSON(),body:T,duplex:"half",credentials:M?et:void 0};ht=u&&new i(w,X);let H=await(u?at(ht,J):at(w,X));const ft=g&&(j==="stream"||j==="response");if(g&&(B||ft&&st)){const O={};["status","statusText","headers"].forEach(nt=>{O[nt]=H[nt]});const Y=G.toFiniteNumber(H.headers.get("content-length")),[Q,W]=B&&s0(Y,vu(l0(B),!0))||[];H=new o(c0(H.body,f0,Q,()=>{W&&W(),st&&st()}),O)}j=j||"text";let mt=await v[G.findKey(v,j)||"text"](H,S);return!ft&&st&&st(),await new Promise((O,Y)=>{i1(O,Y,{data:mt,headers:Ve.from(H.headers),status:H.status,statusText:H.statusText,config:S,request:ht})})}catch(M){throw st&&st(),M&&M.name==="TypeError"&&/Load failed|fetch/i.test(M.message)?Object.assign(new wt("Network Error",wt.ERR_NETWORK,S,ht),{cause:M.cause||M}):wt.from(M,M&&M.code,S,ht)}}},kM=new Map,l1=e=>{let a=e?e.env:{};const{fetch:i,Request:o,Response:l}=a,u=[o,l,i];let d=u.length,h=d,p,m,g=kM;for(;h--;)p=u[h],m=g.get(p),m===void 0&&g.set(p,m=h?new Map:BM(a)),g=m;return m};l1();const $d={http:eM,xhr:NM,fetch:{get:l1}};G.forEach($d,(e,a)=>{if(e){try{Object.defineProperty(e,"name",{value:a})}catch{}Object.defineProperty(e,"adapterName",{value:a})}});const p0=e=>`- ${e}`,PM=e=>G.isFunction(e)||e===null||e===!1,u1={getAdapter:(e,a)=>{e=G.isArray(e)?e:[e];const{length:i}=e;let o,l;const u={};for(let d=0;d<i;d++){o=e[d];let h;if(l=o,!PM(o)&&(l=$d[(h=String(o)).toLowerCase()],l===void 0))throw new wt(`Unknown adapter '${h}'`);if(l&&(G.isFunction(l)||(l=l.get(a))))break;u[h||"#"+d]=l}if(!l){const d=Object.entries(u).map(([p,m])=>`adapter ${p} `+(m===!1?"is not supported by the environment":"is not available in the build"));let h=i?d.length>1?`since :
173
173
  `+d.map(p0).join(`
174
174
  `):" "+p0(d[0]):"as no adapter specified";throw new wt("There is no suitable adapter to dispatch the request "+h,"ERR_NOT_SUPPORT")}return l},adapters:$d};function _d(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new $i(null,e)}function v0(e){return _d(e),e.headers=Ve.from(e.headers),e.data=Rd.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),u1.getAdapter(e.adapter||ys.adapter,e)(e).then(function(o){return _d(e),o.data=Rd.call(e,e.transformResponse,o),o.headers=Ve.from(o.headers),o},function(o){return r1(o)||(_d(e),o&&o.response&&(o.response.data=Rd.call(e,e.transformResponse,o.response),o.response.headers=Ve.from(o.response.headers))),Promise.reject(o)})}const c1="1.12.2",ju={};["object","boolean","number","function","string","symbol"].forEach((e,a)=>{ju[e]=function(o){return typeof o===e||"a"+(a<1?"n ":" ")+e}});const g0={};ju.transitional=function(a,i,o){function l(u,d){return"[Axios v"+c1+"] Transitional option '"+u+"'"+d+(o?". "+o:"")}return(u,d,h)=>{if(a===!1)throw new wt(l(d," has been removed"+(i?" in "+i:"")),wt.ERR_DEPRECATED);return i&&!g0[d]&&(g0[d]=!0,console.warn(l(d," has been deprecated since v"+i+" and will be removed in the near future"))),a?a(u,d,h):!0}};ju.spelling=function(a){return(i,o)=>(console.warn(`${o} is likely a misspelling of ${a}`),!0)};function HM(e,a,i){if(typeof e!="object")throw new wt("options must be an object",wt.ERR_BAD_OPTION_VALUE);const o=Object.keys(e);let l=o.length;for(;l-- >0;){const u=o[l],d=a[u];if(d){const h=e[u],p=h===void 0||d(h,u,e);if(p!==!0)throw new wt("option "+u+" must be "+p,wt.ERR_BAD_OPTION_VALUE);continue}if(i!==!0)throw new wt("Unknown option "+u,wt.ERR_BAD_OPTION)}}const nu={assertOptions:HM,validators:ju},zn=nu.validators;let Tr=class{constructor(a){this.defaults=a||{},this.interceptors={request:new i0,response:new i0}}async request(a,i){try{return await this._request(a,i)}catch(o){if(o instanceof Error){let l={};Error.captureStackTrace?Error.captureStackTrace(l):l=new Error;const u=l.stack?l.stack.replace(/^.+\n/,""):"";try{o.stack?u&&!String(o.stack).endsWith(u.replace(/^.+\n.+\n/,""))&&(o.stack+=`
175
- `+u):o.stack=u}catch{}}throw o}}_request(a,i){typeof a=="string"?(i=i||{},i.url=a):i=a||{},i=zr(this.defaults,i);const{transitional:o,paramsSerializer:l,headers:u}=i;o!==void 0&&nu.assertOptions(o,{silentJSONParsing:zn.transitional(zn.boolean),forcedJSONParsing:zn.transitional(zn.boolean),clarifyTimeoutError:zn.transitional(zn.boolean)},!1),l!=null&&(G.isFunction(l)?i.paramsSerializer={serialize:l}:nu.assertOptions(l,{encode:zn.function,serialize:zn.function},!0)),i.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?i.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:i.allowAbsoluteUrls=!0),nu.assertOptions(i,{baseUrl:zn.spelling("baseURL"),withXsrfToken:zn.spelling("withXSRFToken")},!0),i.method=(i.method||this.defaults.method||"get").toLowerCase();let d=u&&G.merge(u.common,u[i.method]);u&&G.forEach(["delete","get","head","post","put","patch","common"],S=>{delete u[S]}),i.headers=Ve.concat(d,u);const h=[];let p=!0;this.interceptors.request.forEach(function(w){typeof w.runWhen=="function"&&w.runWhen(i)===!1||(p=p&&w.synchronous,h.unshift(w.fulfilled,w.rejected))});const m=[];this.interceptors.response.forEach(function(w){m.push(w.fulfilled,w.rejected)});let g,v=0,b;if(!p){const S=[v0.bind(this),void 0];for(S.unshift(...h),S.push(...m),b=S.length,g=Promise.resolve(i);v<b;)g=g.then(S[v++],S[v++]);return g}b=h.length;let x=i;for(;v<b;){const S=h[v++],w=h[v++];try{x=S(x)}catch(C){w.call(this,C);break}}try{g=v0.call(this,x)}catch(S){return Promise.reject(S)}for(v=0,b=m.length;v<b;)g=g.then(m[v++],m[v++]);return g}getUri(a){a=zr(this.defaults,a);const i=o1(a.baseURL,a.url,a.allowAbsoluteUrls);return e1(i,a.params,a.paramsSerializer)}};G.forEach(["delete","get","head","options"],function(a){Tr.prototype[a]=function(i,o){return this.request(zr(o||{},{method:a,url:i,data:(o||{}).data}))}});G.forEach(["post","put","patch"],function(a){function i(o){return function(u,d,h){return this.request(zr(h||{},{method:a,headers:o?{"Content-Type":"multipart/form-data"}:{},url:u,data:d}))}}Tr.prototype[a]=i(),Tr.prototype[a+"Form"]=i(!0)});let qM=class f1{constructor(a){if(typeof a!="function")throw new TypeError("executor must be a function.");let i;this.promise=new Promise(function(u){i=u});const o=this;this.promise.then(l=>{if(!o._listeners)return;let u=o._listeners.length;for(;u-- >0;)o._listeners[u](l);o._listeners=null}),this.promise.then=l=>{let u;const d=new Promise(h=>{o.subscribe(h),u=h}).then(l);return d.cancel=function(){o.unsubscribe(u)},d},a(function(u,d,h){o.reason||(o.reason=new $i(u,d,h),i(o.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=o=>{a.abort(o)};return this.subscribe(i),a.signal.unsubscribe=()=>this.unsubscribe(i),a.signal}static source(){let a;return{token:new f1(function(l){a=l}),cancel:a}}};function VM(e){return function(i){return e.apply(null,i)}}function GM(e){return G.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 d1(e){const a=new Tr(e),i=GS(Tr.prototype.request,a);return G.extend(i,Tr.prototype,a,{allOwnKeys:!0}),G.extend(i,a,null,{allOwnKeys:!0}),i.create=function(l){return d1(zr(e,l))},i}const ne=d1(ys);ne.Axios=Tr;ne.CanceledError=$i;ne.CancelToken=qM;ne.isCancel=r1;ne.VERSION=c1;ne.toFormData=Lu;ne.AxiosError=wt;ne.Cancel=ne.CanceledError;ne.all=function(a){return Promise.all(a)};ne.spread=VM;ne.isAxiosError=GM;ne.mergeConfig=zr;ne.AxiosHeaders=Ve;ne.formToJSON=e=>a1(G.isHTMLForm(e)?new FormData(e):e);ne.getAdapter=u1.getAdapter;ne.HttpStatusCode=Zd;ne.default=ne;const{Axios:cN,AxiosError:fN,CanceledError:dN,isCancel:hN,CancelToken:mN,VERSION:pN,all:vN,Cancel:gN,isAxiosError:yN,spread:bN,toFormData:SN,AxiosHeaders:xN,HttpStatusCode:wN,formToJSON:EN,getAdapter:RN,mergeConfig:_N}=ne,Gh=ne.create({baseURL:"/api"});Gh.interceptors.request.use(e=>{const a=localStorage.getItem("access_token");return a&&(e.headers.Authorization=`Bearer ${a}`),e});Gh.interceptors.response.use(e=>e,e=>(e.response.status===401&&(localStorage.removeItem("access_token"),window.location.href="/"),Promise.reject(e)));class y0{constructor(a,i){this.client=a,this.data=i}}class FM{constructor(a){this.client=a}async fetch(){const{data:a}=await this.client.api.get("/events");return a.events}}class YM{constructor(a){this.client=a}async fetch(){const{data:a}=await this.client.api.get("/guilds");return a.guilds}}class QM{constructor(a){this.client=a}async fetch(){const{data:a}=await this.client.api.get("/plugins");return a.plugins}}class KM{api=Gh;guilds=new YM(this);plugins=new QM(this);events=new FM(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 y0(this,i),this._user}async getFeatureFlags(){const{data:a}=await this.api.get("/feature-flags");return a}async login(a,i){const{data:o}=await this.api.post("/auth/login",{username:a,password:i});return o.accessToken&&localStorage.setItem("access_token",o.accessToken),this._user=new y0(this,o.user),o}}const h1=R.createContext(null);function XM({children:e}){const[a,i]=R.useState(()=>new KM);return _.jsx(h1.Provider,{value:{client:a,setClient:i},children:e})}function Fh(){const e=R.use(h1);if(!e)throw new Error("useClient must be used within a ClientProvider");return e.client}const Cd={navMain:[{title:"Commands",url:"/commands",icon:Sy,isActive:!1},{title:"Events",url:"/events",icon:by,isActive:!1},{title:"Plugins",url:"/plugins",icon:VR,isActive:!1},{title:"Guilds",url:"/guilds",icon:Ey,isActive:!1},{title:"Feature Flags",url:"/feature-flags",icon:FR,isActive:!1}],navSecondary:[{title:"GitHub",url:"https://github.com/underctrl-io/commandkit",icon:a2},{title:"Discord",url:"https://ctrl.lol/discord",icon:Ey}],projects:[{name:"Commands",url:"#",icon:Sy},{name:"Middlewares",url:"#",icon:KR},{name:"Events",url:"#",icon:by}]};function $M({...e}){const a=Fh();return _.jsxs(YA,{className:"top-(--header-height) h-[calc(100svh-var(--header-height))]!",...e,children:[_.jsx(KA,{children:_.jsx(ds,{children:_.jsx(hs,{children:_.jsx(ms,{size:"lg",asChild:!0,children:_.jsxs(Vi,{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($A,{children:[_.jsx(JA,{items:Cd.navMain}),_.jsx(WA,{projects:Cd.projects}),_.jsx(tO,{items:Cd.navSecondary,className:"mt-auto"})]}),_.jsx(XA,{children:_.jsx(pO,{user:{avatar:a.user.data.displayAvatarURL,name:a.user.data.globalName||a.user?.data.username,username:a.user.data.username}})})]})}function ZM({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 IM({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 JM({className:e,...a}){return _.jsx("div",{"data-slot":"card-title",className:Rt("leading-none font-semibold",e),...a})}function WM({className:e,...a}){return _.jsx("div",{"data-slot":"card-description",className:Rt("text-muted-foreground text-sm",e),...a})}function t4({className:e,...a}){return _.jsx("div",{"data-slot":"card-content",className:Rt("px-6",e),...a})}function CN({className:e,...a}){return _.jsx("div",{"data-slot":"card-footer",className:Rt("flex items-center px-6 [.border-t]:pt-6",e),...a})}var e4="Label",m1=R.forwardRef((e,a)=>_.jsx(Jt.label,{...e,ref:a,onMouseDown:i=>{i.target.closest("button, input, select, textarea")||(e.onMouseDown?.(i),!i.defaultPrevented&&i.detail>1&&i.preventDefault())}}));m1.displayName=e4;var n4=m1;function b0({className:e,...a}){return _.jsx(n4,{"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 S0=e=>{let a;const i=new Set,o=(m,g)=>{const v=typeof m=="function"?m(a):m;if(!Object.is(v,a)){const b=a;a=g??(typeof v!="object"||v===null)?v:Object.assign({},a,v),i.forEach(x=>x(a,b))}},l=()=>a,h={setState:o,getState:l,getInitialState:()=>p,subscribe:m=>(i.add(m),()=>i.delete(m))},p=a=e(o,l,h);return h},a4=(e=>e?S0(e):S0),r4=e=>e;function i4(e,a=r4){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 x0=e=>{const a=a4(e),i=o=>i4(a,o);return Object.assign(i,a),i},o4=(e=>e?x0(e):x0),p1=o4(e=>({authenticated:!1,setAuthenticated:a=>e({authenticated:a})}));function s4(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 l4=e=>{switch(e){case"success":return f4;case"info":return h4;case"warning":return d4;case"error":return m4;default:return null}},u4=Array(12).fill(0),c4=({visible:e,className:a})=>tt.createElement("div",{className:["sonner-loading-wrapper",a].filter(Boolean).join(" "),"data-visible":e},tt.createElement("div",{className:"sonner-spinner"},u4.map((i,o)=>tt.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${o}`})))),f4=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"})),d4=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"})),h4=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"})),m4=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"})),p4=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"})),v4=()=>{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 Id=1;class g4{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:o,...l}=a,u=typeof a?.id=="number"||((i=a.id)==null?void 0:i.length)>0?a.id:Id++,d=this.toasts.find(p=>p.id===u),h=a.dismissible===void 0?!0:a.dismissible;return this.dismissedToasts.has(u)&&this.dismissedToasts.delete(u),d?this.toasts=this.toasts.map(p=>p.id===u?(this.publish({...p,...a,id:u,title:o}),{...p,...a,id:u,dismissible:h,title:o}):p):this.addToast({title:o,...l,dismissible:h,id:u}),u},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(o=>o({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 o;i.loading!==void 0&&(o=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 u=o!==void 0,d;const h=l.then(async m=>{if(d=["resolve",m],tt.isValidElement(m))u=!1,this.create({id:o,type:"default",message:m});else if(b4(m)&&!m.ok){u=!1;const v=typeof i.error=="function"?await i.error(`HTTP error! status: ${m.status}`):i.error,b=typeof i.description=="function"?await i.description(`HTTP error! status: ${m.status}`):i.description,S=typeof v=="object"&&!tt.isValidElement(v)?v:{message:v};this.create({id:o,type:"error",description:b,...S})}else if(m instanceof Error){u=!1;const v=typeof i.error=="function"?await i.error(m):i.error,b=typeof i.description=="function"?await i.description(m):i.description,S=typeof v=="object"&&!tt.isValidElement(v)?v:{message:v};this.create({id:o,type:"error",description:b,...S})}else if(i.success!==void 0){u=!1;const v=typeof i.success=="function"?await i.success(m):i.success,b=typeof i.description=="function"?await i.description(m):i.description,S=typeof v=="object"&&!tt.isValidElement(v)?v:{message:v};this.create({id:o,type:"success",description:b,...S})}}).catch(async m=>{if(d=["reject",m],i.error!==void 0){u=!1;const g=typeof i.error=="function"?await i.error(m):i.error,v=typeof i.description=="function"?await i.description(m):i.description,x=typeof g=="object"&&!tt.isValidElement(g)?g:{message:g};this.create({id:o,type:"error",description:v,...x})}}).finally(()=>{u&&(this.dismiss(o),o=void 0),i.finally==null||i.finally.call(i)}),p=()=>new Promise((m,g)=>h.then(()=>d[0]==="reject"?g(d[1]):m(d[1])).catch(g));return typeof o!="string"&&typeof o!="number"?{unwrap:p}:Object.assign(o,{unwrap:p})},this.custom=(a,i)=>{const o=i?.id||Id++;return this.create({jsx:a(o),id:o,...i}),o},this.getActiveToasts=()=>this.toasts.filter(a=>!this.dismissedToasts.has(a.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Pe=new g4,y4=(e,a)=>{const i=a?.id||Id++;return Pe.addToast({title:e,...a,id:i}),i},b4=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",S4=y4,x4=()=>Pe.toasts,w4=()=>Pe.getActiveToasts(),w0=Object.assign(S4,{success:Pe.success,info:Pe.info,warning:Pe.warning,error:Pe.error,custom:Pe.custom,message:Pe.message,promise:Pe.promise,dismiss:Pe.dismiss,loading:Pe.loading},{getHistory:x4,getToasts:w4});s4("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Kl(e){return e.label!==void 0}const E4=3,R4="24px",_4="16px",E0=4e3,C4=356,T4=14,A4=45,O4=200;function Ln(...e){return e.filter(Boolean).join(" ")}function M4(e){const[a,i]=e.split("-"),o=[];return a&&o.push(a),i&&o.push(i),o}const N4=e=>{var a,i,o,l,u,d,h,p,m;const{invert:g,toast:v,unstyled:b,interacting:x,setHeights:S,visibleToasts:w,heights:C,index:T,toasts:z,expanded:D,removeToast:U,defaultRichColors:B,closeButton:K,style:j,cancelButtonStyle:V,actionButtonStyle:et,className:J="",descriptionClassName:at="",duration:rt,position:ht,gap:st,expandByDefault:yt,classNames:M,icons:X,closeButtonAriaLabel:H="Close toast"}=e,[ft,mt]=tt.useState(null),[O,Y]=tt.useState(null),[Q,W]=tt.useState(!1),[nt,ct]=tt.useState(!1),[it,vt]=tt.useState(!1),[_t,Wt]=tt.useState(!1),[Kt,se]=tt.useState(!1),[vn,Ae]=tt.useState(0),[Wa,ma]=tt.useState(0),Vn=tt.useRef(v.duration||rt||E0),Cn=tt.useRef(null),fe=tt.useRef(null),pa=T===0,va=T+1<=w,Ct=v.type,Xt=v.dismissible!==!1,Ft=v.className||"",bs=v.descriptionClassName||"",tr=tt.useMemo(()=>C.findIndex(bt=>bt.toastId===v.id)||0,[C,v.id]),Ss=tt.useMemo(()=>{var bt;return(bt=v.closeButton)!=null?bt:K},[v.closeButton,K]),er=tt.useMemo(()=>v.duration||rt||E0,[v.duration,rt]),Ji=tt.useRef(0),Gn=tt.useRef(0),xs=tt.useRef(0),ga=tt.useRef(null),[nr,Re]=ht.split("-"),gn=tt.useMemo(()=>C.reduce((bt,Yt,de)=>de>=tr?bt:bt+Yt.height,0),[C,tr]),Se=v4(),Uu=v.invert||g,Wi=Ct==="loading";Gn.current=tt.useMemo(()=>tr*st+gn,[tr,gn]),tt.useEffect(()=>{Vn.current=er},[er]),tt.useEffect(()=>{W(!0)},[]),tt.useEffect(()=>{const bt=fe.current;if(bt){const Yt=bt.getBoundingClientRect().height;return ma(Yt),S(de=>[{toastId:v.id,height:Yt,position:v.position},...de]),()=>S(de=>de.filter(xe=>xe.toastId!==v.id))}},[S,v.id]),tt.useLayoutEffect(()=>{if(!Q)return;const bt=fe.current,Yt=bt.style.height;bt.style.height="auto";const de=bt.getBoundingClientRect().height;bt.style.height=Yt,ma(de),S(xe=>xe.find($t=>$t.toastId===v.id)?xe.map($t=>$t.toastId===v.id?{...$t,height:de}:$t):[{toastId:v.id,height:de,position:v.position},...xe])},[Q,v.title,v.description,S,v.id,v.jsx,v.action,v.cancel]);const Tn=tt.useCallback(()=>{ct(!0),Ae(Gn.current),S(bt=>bt.filter(Yt=>Yt.toastId!==v.id)),setTimeout(()=>{U(v)},O4)},[v,U,S,Gn]);tt.useEffect(()=>{if(v.promise&&Ct==="loading"||v.duration===1/0||v.type==="loading")return;let bt;return D||x||Se?(()=>{if(xs.current<Ji.current){const xe=new Date().getTime()-Ji.current;Vn.current=Vn.current-xe}xs.current=new Date().getTime()})():(()=>{Vn.current!==1/0&&(Ji.current=new Date().getTime(),bt=setTimeout(()=>{v.onAutoClose==null||v.onAutoClose.call(v,v),Tn()},Vn.current))})(),()=>clearTimeout(bt)},[D,x,v,Ct,Se,Tn]),tt.useEffect(()=>{v.delete&&(Tn(),v.onDismiss==null||v.onDismiss.call(v,v))},[Tn,v.delete]);function kr(){var bt;if(X?.loading){var Yt;return tt.createElement("div",{className:Ln(M?.loader,v==null||(Yt=v.classNames)==null?void 0:Yt.loader,"sonner-loader"),"data-visible":Ct==="loading"},X.loading)}return tt.createElement(c4,{className:Ln(M?.loader,v==null||(bt=v.classNames)==null?void 0:bt.loader),visible:Ct==="loading"})}const Pr=v.icon||X?.[Ct]||l4(Ct);var ar,An;return tt.createElement("li",{tabIndex:0,ref:fe,className:Ln(J,Ft,M?.toast,v==null||(a=v.classNames)==null?void 0:a.toast,M?.default,M?.[Ct],v==null||(i=v.classNames)==null?void 0:i[Ct]),"data-sonner-toast":"","data-rich-colors":(ar=v.richColors)!=null?ar:B,"data-styled":!(v.jsx||v.unstyled||b),"data-mounted":Q,"data-promise":!!v.promise,"data-swiped":Kt,"data-removed":nt,"data-visible":va,"data-y-position":nr,"data-x-position":Re,"data-index":T,"data-front":pa,"data-swiping":it,"data-dismissible":Xt,"data-type":Ct,"data-invert":Uu,"data-swipe-out":_t,"data-swipe-direction":O,"data-expanded":!!(D||yt&&Q),"data-testid":v.testId,style:{"--index":T,"--toasts-before":T,"--z-index":z.length-T,"--offset":`${nt?vn:Gn.current}px`,"--initial-height":yt?"auto":`${Wa}px`,...j,...v.style},onDragEnd:()=>{vt(!1),mt(null),ga.current=null},onPointerDown:bt=>{bt.button!==2&&(Wi||!Xt||(Cn.current=new Date,Ae(Gn.current),bt.target.setPointerCapture(bt.pointerId),bt.target.tagName!=="BUTTON"&&(vt(!0),ga.current={x:bt.clientX,y:bt.clientY})))},onPointerUp:()=>{var bt,Yt,de;if(_t||!Xt)return;ga.current=null;const xe=Number(((bt=fe.current)==null?void 0:bt.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ya=Number(((Yt=fe.current)==null?void 0:Yt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),$t=new Date().getTime()-((de=Cn.current)==null?void 0:de.getTime()),Oe=ft==="x"?xe:ya,rr=Math.abs(Oe)/$t;if(Math.abs(Oe)>=A4||rr>.11){Ae(Gn.current),v.onDismiss==null||v.onDismiss.call(v,v),Y(ft==="x"?xe>0?"right":"left":ya>0?"down":"up"),Tn(),Wt(!0);return}else{var Me,Ne;(Me=fe.current)==null||Me.style.setProperty("--swipe-amount-x","0px"),(Ne=fe.current)==null||Ne.style.setProperty("--swipe-amount-y","0px")}se(!1),vt(!1),mt(null)},onPointerMove:bt=>{var Yt,de,xe;if(!ga.current||!Xt||((Yt=window.getSelection())==null?void 0:Yt.toString().length)>0)return;const $t=bt.clientY-ga.current.y,Oe=bt.clientX-ga.current.x;var rr;const Me=(rr=e.swipeDirections)!=null?rr:M4(ht);!ft&&(Math.abs(Oe)>1||Math.abs($t)>1)&&mt(Math.abs(Oe)>Math.abs($t)?"x":"y");let Ne={x:0,y:0};const Hr=yn=>1/(1.5+Math.abs(yn)/20);if(ft==="y"){if(Me.includes("top")||Me.includes("bottom"))if(Me.includes("top")&&$t<0||Me.includes("bottom")&&$t>0)Ne.y=$t;else{const yn=$t*Hr($t);Ne.y=Math.abs(yn)<Math.abs($t)?yn:$t}}else if(ft==="x"&&(Me.includes("left")||Me.includes("right")))if(Me.includes("left")&&Oe<0||Me.includes("right")&&Oe>0)Ne.x=Oe;else{const yn=Oe*Hr(Oe);Ne.x=Math.abs(yn)<Math.abs(Oe)?yn:Oe}(Math.abs(Ne.x)>0||Math.abs(Ne.y)>0)&&se(!0),(de=fe.current)==null||de.style.setProperty("--swipe-amount-x",`${Ne.x}px`),(xe=fe.current)==null||xe.style.setProperty("--swipe-amount-y",`${Ne.y}px`)}},Ss&&!v.jsx&&Ct!=="loading"?tt.createElement("button",{"aria-label":H,"data-disabled":Wi,"data-close-button":!0,onClick:Wi||!Xt?()=>{}:()=>{Tn(),v.onDismiss==null||v.onDismiss.call(v,v)},className:Ln(M?.closeButton,v==null||(o=v.classNames)==null?void 0:o.closeButton)},(An=X?.close)!=null?An:p4):null,(Ct||v.icon||v.promise)&&v.icon!==null&&(X?.[Ct]!==null||v.icon)?tt.createElement("div",{"data-icon":"",className:Ln(M?.icon,v==null||(l=v.classNames)==null?void 0:l.icon)},v.promise||v.type==="loading"&&!v.icon?v.icon||kr():null,v.type!=="loading"?Pr:null):null,tt.createElement("div",{"data-content":"",className:Ln(M?.content,v==null||(u=v.classNames)==null?void 0:u.content)},tt.createElement("div",{"data-title":"",className:Ln(M?.title,v==null||(d=v.classNames)==null?void 0:d.title)},v.jsx?v.jsx:typeof v.title=="function"?v.title():v.title),v.description?tt.createElement("div",{"data-description":"",className:Ln(at,bs,M?.description,v==null||(h=v.classNames)==null?void 0:h.description)},typeof v.description=="function"?v.description():v.description):null),tt.isValidElement(v.cancel)?v.cancel:v.cancel&&Kl(v.cancel)?tt.createElement("button",{"data-button":!0,"data-cancel":!0,style:v.cancelButtonStyle||V,onClick:bt=>{Kl(v.cancel)&&Xt&&(v.cancel.onClick==null||v.cancel.onClick.call(v.cancel,bt),Tn())},className:Ln(M?.cancelButton,v==null||(p=v.classNames)==null?void 0:p.cancelButton)},v.cancel.label):null,tt.isValidElement(v.action)?v.action:v.action&&Kl(v.action)?tt.createElement("button",{"data-button":!0,"data-action":!0,style:v.actionButtonStyle||et,onClick:bt=>{Kl(v.action)&&(v.action.onClick==null||v.action.onClick.call(v.action,bt),!bt.defaultPrevented&&Tn())},className:Ln(M?.actionButton,v==null||(m=v.classNames)==null?void 0:m.actionButton)},v.action.label):null)};function R0(){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 D4(e,a){const i={};return[e,a].forEach((o,l)=>{const u=l===1,d=u?"--mobile-offset":"--offset",h=u?_4:R4;function p(m){["top","right","bottom","left"].forEach(g=>{i[`${d}-${g}`]=typeof m=="number"?`${m}px`:m})}typeof o=="number"||typeof o=="string"?p(o):typeof o=="object"?["top","right","bottom","left"].forEach(m=>{o[m]===void 0?i[`${d}-${m}`]=h:i[`${d}-${m}`]=typeof o[m]=="number"?`${o[m]}px`:o[m]}):p(h)}),i}const z4=tt.forwardRef(function(a,i){const{id:o,invert:l,position:u="bottom-right",hotkey:d=["altKey","KeyT"],expand:h,closeButton:p,className:m,offset:g,mobileOffset:v,theme:b="light",richColors:x,duration:S,style:w,visibleToasts:C=E4,toastOptions:T,dir:z=R0(),gap:D=T4,icons:U,containerAriaLabel:B="Notifications"}=a,[K,j]=tt.useState([]),V=tt.useMemo(()=>o?K.filter(Q=>Q.toasterId===o):K.filter(Q=>!Q.toasterId),[K,o]),et=tt.useMemo(()=>Array.from(new Set([u].concat(V.filter(Q=>Q.position).map(Q=>Q.position)))),[V,u]),[J,at]=tt.useState([]),[rt,ht]=tt.useState(!1),[st,yt]=tt.useState(!1),[M,X]=tt.useState(b!=="system"?b:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),H=tt.useRef(null),ft=d.join("+").replace(/Key/g,"").replace(/Digit/g,""),mt=tt.useRef(null),O=tt.useRef(!1),Y=tt.useCallback(Q=>{j(W=>{var nt;return(nt=W.find(ct=>ct.id===Q.id))!=null&&nt.delete||Pe.dismiss(Q.id),W.filter(({id:ct})=>ct!==Q.id)})},[]);return tt.useEffect(()=>Pe.subscribe(Q=>{if(Q.dismiss){requestAnimationFrame(()=>{j(W=>W.map(nt=>nt.id===Q.id?{...nt,delete:!0}:nt))});return}setTimeout(()=>{nb.flushSync(()=>{j(W=>{const nt=W.findIndex(ct=>ct.id===Q.id);return nt!==-1?[...W.slice(0,nt),{...W[nt],...Q},...W.slice(nt+1)]:[Q,...W]})})})}),[K]),tt.useEffect(()=>{if(b!=="system"){X(b);return}if(b==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?X("dark"):X("light")),typeof window>"u")return;const Q=window.matchMedia("(prefers-color-scheme: dark)");try{Q.addEventListener("change",({matches:W})=>{X(W?"dark":"light")})}catch{Q.addListener(({matches:nt})=>{try{X(nt?"dark":"light")}catch(ct){console.error(ct)}})}},[b]),tt.useEffect(()=>{K.length<=1&&ht(!1)},[K]),tt.useEffect(()=>{const Q=W=>{var nt;if(d.every(vt=>W[vt]||W.code===vt)){var it;ht(!0),(it=H.current)==null||it.focus()}W.code==="Escape"&&(document.activeElement===H.current||(nt=H.current)!=null&&nt.contains(document.activeElement))&&ht(!1)};return document.addEventListener("keydown",Q),()=>document.removeEventListener("keydown",Q)},[d]),tt.useEffect(()=>{if(H.current)return()=>{mt.current&&(mt.current.focus({preventScroll:!0}),mt.current=null,O.current=!1)}},[H.current]),tt.createElement("section",{ref:i,"aria-label":`${B} ${ft}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},et.map((Q,W)=>{var nt;const[ct,it]=Q.split("-");return V.length?tt.createElement("ol",{key:Q,dir:z==="auto"?R0():z,tabIndex:-1,ref:H,className:m,"data-sonner-toaster":!0,"data-sonner-theme":M,"data-y-position":ct,"data-x-position":it,style:{"--front-toast-height":`${((nt=J[0])==null?void 0:nt.height)||0}px`,"--width":`${C4}px`,"--gap":`${D}px`,...w,...D4(g,v)},onBlur:vt=>{O.current&&!vt.currentTarget.contains(vt.relatedTarget)&&(O.current=!1,mt.current&&(mt.current.focus({preventScroll:!0}),mt.current=null))},onFocus:vt=>{vt.target instanceof HTMLElement&&vt.target.dataset.dismissible==="false"||O.current||(O.current=!0,mt.current=vt.relatedTarget)},onMouseEnter:()=>ht(!0),onMouseMove:()=>ht(!0),onMouseLeave:()=>{st||ht(!1)},onDragEnd:()=>ht(!1),onPointerDown:vt=>{vt.target instanceof HTMLElement&&vt.target.dataset.dismissible==="false"||yt(!0)},onPointerUp:()=>yt(!1)},V.filter(vt=>!vt.position&&W===0||vt.position===Q).map((vt,_t)=>{var Wt,Kt;return tt.createElement(N4,{key:vt.id,icons:U,index:_t,toast:vt,defaultRichColors:x,duration:(Wt=T?.duration)!=null?Wt:S,className:T?.className,descriptionClassName:T?.descriptionClassName,invert:l,visibleToasts:C,closeButton:(Kt=T?.closeButton)!=null?Kt:p,interacting:st,position:Q,style:T?.style,unstyled:T?.unstyled,classNames:T?.classNames,cancelButtonStyle:T?.cancelButtonStyle,actionButtonStyle:T?.actionButtonStyle,closeButtonAriaLabel:T?.closeButtonAriaLabel,removeToast:Y,toasts:V.filter(se=>se.position==vt.position),heights:J.filter(se=>se.position==vt.position),setHeights:at,expandByDefault:h,gap:D,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(){}},L4={setTimeout:(e,a)=>setTimeout(e,a),clearTimeout:e=>clearTimeout(e),setInterval:(e,a)=>setInterval(e,a),clearInterval:e=>clearInterval(e)},j4=class{#t=L4;#e=!1;setTimeoutProvider(e){this.#t=e}setTimeout(e,a){return this.#t.setTimeout(e,a)}clearTimeout(e){this.#t.clearTimeout(e)}setInterval(e,a){return this.#t.setInterval(e,a)}clearInterval(e){this.#t.clearInterval(e)}},Rr=new j4;function U4(e){setTimeout(e,0)}var Lr=typeof window>"u"||"Deno"in globalThis;function Ce(){}function B4(e,a){return typeof e=="function"?e(a):e}function Jd(e){return typeof e=="number"&&e>=0&&e!==1/0}function v1(e,a){return Math.max(e+(a||0)-Date.now(),0)}function Xa(e,a){return typeof e=="function"?e(a):e}function fn(e,a){return typeof e=="function"?e(a):e}function _0(e,a){const{type:i="all",exact:o,fetchStatus:l,predicate:u,queryKey:d,stale:h}=e;if(d){if(o){if(a.queryHash!==Yh(d,a.options))return!1}else if(!os(a.queryKey,d))return!1}if(i!=="all"){const p=a.isActive();if(i==="active"&&!p||i==="inactive"&&p)return!1}return!(typeof h=="boolean"&&a.isStale()!==h||l&&l!==a.state.fetchStatus||u&&!u(a))}function C0(e,a){const{exact:i,status:o,predicate:l,mutationKey:u}=e;if(u){if(!a.options.mutationKey)return!1;if(i){if(jr(a.options.mutationKey)!==jr(u))return!1}else if(!os(a.options.mutationKey,u))return!1}return!(o&&a.state.status!==o||l&&!l(a))}function Yh(e,a){return(a?.queryKeyHashFn||jr)(e)}function jr(e){return JSON.stringify(e,(a,i)=>Wd(i)?Object.keys(i).sort().reduce((o,l)=>(o[l]=i[l],o),{}):i)}function os(e,a){return e===a?!0:typeof e!=typeof a?!1:e&&a&&typeof e=="object"&&typeof a=="object"?Object.keys(a).every(i=>os(e[i],a[i])):!1}var k4=Object.prototype.hasOwnProperty;function g1(e,a){if(e===a)return e;const i=T0(e)&&T0(a);if(!i&&!(Wd(e)&&Wd(a)))return a;const l=(i?e:Object.keys(e)).length,u=i?a:Object.keys(a),d=u.length,h=i?new Array(d):{};let p=0;for(let m=0;m<d;m++){const g=i?m:u[m],v=e[g],b=a[g];if(v===b){h[g]=v,(i?m<l:k4.call(e,g))&&p++;continue}if(v===null||b===null||typeof v!="object"||typeof b!="object"){h[g]=b;continue}const x=g1(v,b);h[g]=x,x===v&&p++}return l===d&&p===l?e:h}function gu(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 Wd(e){if(!A0(e))return!1;const a=e.constructor;if(a===void 0)return!0;const i=a.prototype;return!(!A0(i)||!i.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function A0(e){return Object.prototype.toString.call(e)==="[object Object]"}function P4(e){return new Promise(a=>{Rr.setTimeout(a,e)})}function th(e,a,i){return typeof i.structuralSharing=="function"?i.structuralSharing(e,a):i.structuralSharing!==!1?g1(e,a):a}function H4(e,a,i=0){const o=[...e,a];return i&&o.length>i?o.slice(1):o}function q4(e,a,i=0){const o=[a,...e];return i&&o.length>i?o.slice(0,-1):o}var Qh=Symbol();function y1(e,a){return!e.queryFn&&a?.initialPromise?()=>a.initialPromise:!e.queryFn||e.queryFn===Qh?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function b1(e,a){return typeof e=="function"?e(...a):!!e}var V4=class extends Zi{#t;#e;#n;constructor(){super(),this.#n=e=>{if(!Lr&&window.addEventListener){const a=()=>e();return window.addEventListener("visibilitychange",a,!1),()=>{window.removeEventListener("visibilitychange",a)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()})}setFocused(e){this.#t!==e&&(this.#t=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(a=>{a(e)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},Kh=new V4;function eh(){let e,a;const i=new Promise((l,u)=>{e=l,a=u});i.status="pending",i.catch(()=>{});function o(l){Object.assign(i,l),delete i.resolve,delete i.reject}return i.resolve=l=>{o({status:"fulfilled",value:l}),e(l)},i.reject=l=>{o({status:"rejected",reason:l}),a(l)},i}var G4=U4;function F4(){let e=[],a=0,i=h=>{h()},o=h=>{h()},l=G4;const u=h=>{a?e.push(h):l(()=>{i(h)})},d=()=>{const h=e;e=[],h.length&&l(()=>{o(()=>{h.forEach(p=>{i(p)})})})};return{batch:h=>{let p;a++;try{p=h()}finally{a--,a||d()}return p},batchCalls:h=>(...p)=>{u(()=>{h(...p)})},schedule:u,setNotifyFunction:h=>{i=h},setBatchNotifyFunction:h=>{o=h},setScheduler:h=>{l=h}}}var ce=F4(),Y4=class extends Zi{#t=!0;#e;#n;constructor(){super(),this.#n=e=>{if(!Lr&&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.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(this.setOnline.bind(this))}setOnline(e){this.#t!==e&&(this.#t=e,this.listeners.forEach(i=>{i(e)}))}isOnline(){return this.#t}},yu=new Y4;function Q4(e){return Math.min(1e3*2**e,3e4)}function S1(e){return(e??"online")==="online"?yu.isOnline():!0}var nh=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function x1(e){let a=!1,i=0,o;const l=eh(),u=()=>l.status!=="pending",d=w=>{if(!u()){const C=new nh(w);b(C),e.onCancel?.(C)}},h=()=>{a=!0},p=()=>{a=!1},m=()=>Kh.isFocused()&&(e.networkMode==="always"||yu.isOnline())&&e.canRun(),g=()=>S1(e.networkMode)&&e.canRun(),v=w=>{u()||(o?.(),l.resolve(w))},b=w=>{u()||(o?.(),l.reject(w))},x=()=>new Promise(w=>{o=C=>{(u()||m())&&w(C)},e.onPause?.()}).then(()=>{o=void 0,u()||e.onContinue?.()}),S=()=>{if(u())return;let w;const C=i===0?e.initialPromise:void 0;try{w=C??e.fn()}catch(T){w=Promise.reject(T)}Promise.resolve(w).then(v).catch(T=>{if(u())return;const z=e.retry??(Lr?0:3),D=e.retryDelay??Q4,U=typeof D=="function"?D(i,T):D,B=z===!0||typeof z=="number"&&i<z||typeof z=="function"&&z(i,T);if(a||!B){b(T);return}i++,e.onFail?.(i,T),P4(U).then(()=>m()?void 0:x()).then(()=>{a?b(T):S()})})};return{promise:l,status:()=>l.status,cancel:d,continue:()=>(o?.(),l),cancelRetry:h,continueRetry:p,canStart:g,start:()=>(g()?S():x().then(S),l)}}var w1=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Jd(this.gcTime)&&(this.#t=Rr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Lr?1/0:300*1e3))}clearGcTimeout(){this.#t&&(Rr.clearTimeout(this.#t),this.#t=void 0)}},K4=class extends w1{#t;#e;#n;#r;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=O0(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const a=O0(this.options);a.data!==void 0&&(this.setData(a.data,{updatedAt:a.dataUpdatedAt,manual:!0}),this.#t=a)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,a){const i=th(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.#a?.promise;return this.#a?.cancel(e),a?a.then(Ce).catch(Ce):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(e=>fn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Qh||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Xa(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:!v1(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(a=>a.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(a=>a.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.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.#a&&(this.#s?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}async fetch(e,a){if(this.state.fetchStatus!=="idle"&&this.#a?.status()!=="rejected"){if(this.state.data!==void 0&&a?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){const h=this.observers.find(p=>p.options.queryFn);h&&this.setOptions(h.options)}const i=new AbortController,o=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(this.#s=!0,i.signal)})},l=()=>{const h=y1(this.options,a),m=(()=>{const g={client:this.#r,queryKey:this.queryKey,meta:this.meta};return o(g),g})();return this.#s=!1,this.options.persister?this.options.persister(h,m,this):h(m)},d=(()=>{const h={fetchOptions:a,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:l};return o(h),h})();this.options.behavior?.onFetch(d,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==d.fetchOptions?.meta)&&this.#i({type:"fetch",meta:d.fetchOptions?.meta}),this.#a=x1({initialPromise:a?.initialPromise,fn:d.fetchFn,onCancel:h=>{h instanceof nh&&h.revert&&this.setState({...this.#e,fetchStatus:"idle"}),i.abort()},onFail:(h,p)=>{this.#i({type:"failed",failureCount:h,error:p})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:d.options.retry,retryDelay:d.options.retryDelay,networkMode:d.options.networkMode,canRun:()=>!0});try{const h=await this.#a.start();if(h===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(h),this.#n.config.onSuccess?.(h,this),this.#n.config.onSettled?.(h,this.state.error,this),h}catch(h){if(h instanceof nh){if(h.silent)return this.#a.promise;if(h.revert){if(this.state.data===void 0)throw h;return this.state.data}}throw this.#i({type:"error",error:h}),this.#n.config.onError?.(h,this),this.#n.config.onSettled?.(this.state.data,h,this),h}finally{this.scheduleGc()}}#i(e){const a=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,...E1(i.data,this.options),fetchMeta:e.meta??null};case"success":const o={...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}};return this.#e=e.manual?o:void 0,o;case"error":const l=e.error;return{...i,error:l,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:l,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 E1(e,a){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:S1(a.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function O0(e){const a=typeof e.initialData=="function"?e.initialData():e.initialData,i=a!==void 0,o=i?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:a,dataUpdateCount:0,dataUpdatedAt:i?o??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}var X4=class extends Zi{constructor(e,a){super(),this.options=a,this.#t=e,this.#i=null,this.#s=eh(),this.bindMethods(),this.setOptions(a)}#t;#e=void 0;#n=void 0;#r=void 0;#a;#o;#s;#i;#p;#d;#h;#u;#c;#l;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),M0(this.#e,this.options)?this.#f():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ah(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ah(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#S(),this.#x(),this.#e.removeObserver(this)}setOptions(e){const a=this.options,i=this.#e;if(this.options=this.#t.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof fn(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#e.setOptions(this.options),a._defaulted&&!gu(this.options,a)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const o=this.hasListeners();o&&N0(this.#e,i,this.options,a)&&this.#f(),this.updateResult(),o&&(this.#e!==i||fn(this.options.enabled,this.#e)!==fn(a.enabled,this.#e)||Xa(this.options.staleTime,this.#e)!==Xa(a.staleTime,this.#e))&&this.#v();const l=this.#g();o&&(this.#e!==i||fn(this.options.enabled,this.#e)!==fn(a.enabled,this.#e)||l!==this.#l)&&this.#y(l)}getOptimisticResult(e){const a=this.#t.getQueryCache().build(this.#t,e),i=this.createResult(a,e);return Z4(this,i)&&(this.#r=i,this.#o=this.options,this.#a=this.#e.state),i}getCurrentResult(){return this.#r}trackResult(e,a){return new Proxy(e,{get:(i,o)=>(this.trackProp(o),a?.(o),o==="promise"&&!this.options.experimental_prefetchInRender&&this.#s.status==="pending"&&this.#s.reject(new Error("experimental_prefetchInRender feature flag is not enabled")),Reflect.get(i,o))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#e}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const a=this.#t.defaultQueryOptions(e),i=this.#t.getQueryCache().build(this.#t,a);return i.fetch().then(()=>this.createResult(i,a))}fetch(e){return this.#f({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#f(e){this.#w();let a=this.#e.fetch(this.options,e);return e?.throwOnError||(a=a.catch(Ce)),a}#v(){this.#S();const e=Xa(this.options.staleTime,this.#e);if(Lr||this.#r.isStale||!Jd(e))return;const i=v1(this.#r.dataUpdatedAt,e)+1;this.#u=Rr.setTimeout(()=>{this.#r.isStale||this.updateResult()},i)}#g(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#y(e){this.#x(),this.#l=e,!(Lr||fn(this.options.enabled,this.#e)===!1||!Jd(this.#l)||this.#l===0)&&(this.#c=Rr.setInterval(()=>{(this.options.refetchIntervalInBackground||Kh.isFocused())&&this.#f()},this.#l))}#b(){this.#v(),this.#y(this.#g())}#S(){this.#u&&(Rr.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#c&&(Rr.clearInterval(this.#c),this.#c=void 0)}createResult(e,a){const i=this.#e,o=this.options,l=this.#r,u=this.#a,d=this.#o,p=e!==i?e.state:this.#n,{state:m}=e;let g={...m},v=!1,b;if(a._optimisticResults){const V=this.hasListeners(),et=!V&&M0(e,a),J=V&&N0(e,i,a,o);(et||J)&&(g={...g,...E1(m.data,e.options)}),a._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:x,errorUpdatedAt:S,status:w}=g;b=g.data;let C=!1;if(a.placeholderData!==void 0&&b===void 0&&w==="pending"){let V;l?.isPlaceholderData&&a.placeholderData===d?.placeholderData?(V=l.data,C=!0):V=typeof a.placeholderData=="function"?a.placeholderData(this.#h?.state.data,this.#h):a.placeholderData,V!==void 0&&(w="success",b=th(l?.data,V,a),v=!0)}if(a.select&&b!==void 0&&!C)if(l&&b===u?.data&&a.select===this.#p)b=this.#d;else try{this.#p=a.select,b=a.select(b),b=th(l?.data,b,a),this.#d=b,this.#i=null}catch(V){this.#i=V}this.#i&&(x=this.#i,b=this.#d,S=Date.now(),w="error");const T=g.fetchStatus==="fetching",z=w==="pending",D=w==="error",U=z&&T,B=b!==void 0,j={status:w,fetchStatus:g.fetchStatus,isPending:z,isSuccess:w==="success",isError:D,isInitialLoading:U,isLoading:U,data:b,dataUpdatedAt:g.dataUpdatedAt,error:x,errorUpdatedAt:S,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:g.dataUpdateCount>0||g.errorUpdateCount>0,isFetchedAfterMount:g.dataUpdateCount>p.dataUpdateCount||g.errorUpdateCount>p.errorUpdateCount,isFetching:T,isRefetching:T&&!z,isLoadingError:D&&!B,isPaused:g.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:D&&B,isStale:Xh(e,a),refetch:this.refetch,promise:this.#s,isEnabled:fn(a.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const V=at=>{j.status==="error"?at.reject(j.error):j.data!==void 0&&at.resolve(j.data)},et=()=>{const at=this.#s=j.promise=eh();V(at)},J=this.#s;switch(J.status){case"pending":e.queryHash===i.queryHash&&V(J);break;case"fulfilled":(j.status==="error"||j.data!==J.value)&&et();break;case"rejected":(j.status!=="error"||j.error!==J.reason)&&et();break}}return j}updateResult(){const e=this.#r,a=this.createResult(this.#e,this.options);if(this.#a=this.#e.state,this.#o=this.options,this.#a.data!==void 0&&(this.#h=this.#e),gu(a,e))return;this.#r=a;const i=()=>{if(!e)return!0;const{notifyOnChangeProps:o}=this.options,l=typeof o=="function"?o():o;if(l==="all"||!l&&!this.#m.size)return!0;const u=new Set(l??this.#m);return this.options.throwOnError&&u.add("error"),Object.keys(this.#r).some(d=>{const h=d;return this.#r[h]!==e[h]&&u.has(h)})};this.#E({listeners:i()})}#w(){const e=this.#t.getQueryCache().build(this.#t,this.options);if(e===this.#e)return;const a=this.#e;this.#e=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.#r)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function $4(e,a){return fn(a.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&a.retryOnMount===!1)}function M0(e,a){return $4(e,a)||e.state.data!==void 0&&ah(e,a,a.refetchOnMount)}function ah(e,a,i){if(fn(a.enabled,e)!==!1&&Xa(a.staleTime,e)!=="static"){const o=typeof i=="function"?i(e):i;return o==="always"||o!==!1&&Xh(e,a)}return!1}function N0(e,a,i,o){return(e!==a||fn(o.enabled,e)===!1)&&(!i.suspense||e.state.status!=="error")&&Xh(e,i)}function Xh(e,a){return fn(a.enabled,e)!==!1&&e.isStaleByTime(Xa(a.staleTime,e))}function Z4(e,a){return!gu(e.getCurrentResult(),a)}function D0(e){return{onFetch:(a,i)=>{const o=a.options,l=a.fetchOptions?.meta?.fetchMore?.direction,u=a.state.data?.pages||[],d=a.state.data?.pageParams||[];let h={pages:[],pageParams:[]},p=0;const m=async()=>{let g=!1;const v=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(a.signal.aborted?g=!0:a.signal.addEventListener("abort",()=>{g=!0}),a.signal)})},b=y1(a.options,a.fetchOptions),x=async(S,w,C)=>{if(g)return Promise.reject();if(w==null&&S.pages.length)return Promise.resolve(S);const z=(()=>{const K={client:a.client,queryKey:a.queryKey,pageParam:w,direction:C?"backward":"forward",meta:a.options.meta};return v(K),K})(),D=await b(z),{maxPages:U}=a.options,B=C?q4:H4;return{pages:B(S.pages,D,U),pageParams:B(S.pageParams,w,U)}};if(l&&u.length){const S=l==="backward",w=S?I4:z0,C={pages:u,pageParams:d},T=w(o,C);h=await x(C,T,S)}else{const S=e??u.length;do{const w=p===0?d[0]??o.initialPageParam:z0(o,h);if(p>0&&w==null)break;h=await x(h,w),p++}while(p<S)}return h};a.options.persister?a.fetchFn=()=>a.options.persister?.(m,{client:a.client,queryKey:a.queryKey,meta:a.options.meta,signal:a.signal},i):a.fetchFn=m}}}function z0(e,{pages:a,pageParams:i}){const o=a.length-1;return a.length>0?e.getNextPageParam(a[o],a,i[o],i):void 0}function I4(e,{pages:a,pageParams:i}){return a.length>0?e.getPreviousPageParam?.(a[0],a,i[0],i):void 0}var J4=class extends w1{#t;#e;#n;#r;constructor(e){super(),this.#t=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#e=[],this.state=e.state||R1(),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.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(a=>a!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){const a=()=>{this.#a({type:"continue"})},i={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=x1({fn:()=>this.options.mutationFn?this.options.mutationFn(e,i):Promise.reject(new Error("No mutationFn found")),onFail:(u,d)=>{this.#a({type:"failed",failureCount:u,error:d})},onPause:()=>{this.#a({type:"pause"})},onContinue:a,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const o=this.state.status==="pending",l=!this.#r.canStart();try{if(o)a();else{this.#a({type:"pending",variables:e,isPaused:l}),await this.#n.config.onMutate?.(e,this,i);const d=await this.options.onMutate?.(e,i);d!==this.state.context&&this.#a({type:"pending",context:d,variables:e,isPaused:l})}const u=await this.#r.start();return await this.#n.config.onSuccess?.(u,e,this.state.context,this,i),await this.options.onSuccess?.(u,e,this.state.context,i),await this.#n.config.onSettled?.(u,null,this.state.variables,this.state.context,this,i),await this.options.onSettled?.(u,null,e,this.state.context,i),this.#a({type:"success",data:u}),u}catch(u){try{throw await this.#n.config.onError?.(u,e,this.state.context,this,i),await this.options.onError?.(u,e,this.state.context,i),await this.#n.config.onSettled?.(void 0,u,this.state.variables,this.state.context,this,i),await this.options.onSettled?.(void 0,u,e,this.state.context,i),u}finally{this.#a({type:"error",error:u})}}finally{this.#n.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.#n.notify({mutation:this,type:"updated",action:e})})}};function R1(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var W4=class extends Zi{constructor(e={}){super(),this.config=e,this.#t=new Set,this.#e=new Map,this.#n=0}#t;#e;#n;build(e,a,i){const o=new J4({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(a),state:i});return this.add(o),o}add(e){this.#t.add(e);const a=Xl(e);if(typeof a=="string"){const i=this.#e.get(a);i?i.push(e):this.#e.set(a,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#t.delete(e)){const a=Xl(e);if(typeof a=="string"){const i=this.#e.get(a);if(i)if(i.length>1){const o=i.indexOf(e);o!==-1&&i.splice(o,1)}else i[0]===e&&this.#e.delete(a)}}this.notify({type:"removed",mutation:e})}canRun(e){const a=Xl(e);if(typeof a=="string"){const o=this.#e.get(a)?.find(l=>l.state.status==="pending");return!o||o===e}else return!0}runNext(e){const a=Xl(e);return typeof a=="string"?this.#e.get(a)?.find(o=>o!==e&&o.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){ce.batch(()=>{this.#t.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#t.clear(),this.#e.clear()})}getAll(){return Array.from(this.#t)}find(e){const a={exact:!0,...e};return this.getAll().find(i=>C0(a,i))}findAll(e={}){return this.getAll().filter(a=>C0(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(Ce))))}};function Xl(e){return e.options.scope?.id}var t3=class extends Zi{#t;#e=void 0;#n;#r;constructor(a,i){super(),this.#t=a,this.setOptions(i),this.bindMethods(),this.#a()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(a){const i=this.options;this.options=this.#t.defaultMutationOptions(a),gu(this.options,i)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),i?.mutationKey&&this.options.mutationKey&&jr(i.mutationKey)!==jr(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.#a(),this.#o(a)}getCurrentResult(){return this.#e}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#a(),this.#o()}mutate(a,i){return this.#r=i,this.#n?.removeObserver(this),this.#n=this.#t.getMutationCache().build(this.#t,this.options),this.#n.addObserver(this),this.#n.execute(a)}#a(){const a=this.#n?.state??R1();this.#e={...a,isPending:a.status==="pending",isSuccess:a.status==="success",isError:a.status==="error",isIdle:a.status==="idle",mutate:this.mutate,reset:this.reset}}#o(a){ce.batch(()=>{if(this.#r&&this.hasListeners()){const i=this.#e.variables,o=this.#e.context,l={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};a?.type==="success"?(this.#r.onSuccess?.(a.data,i,o,l),this.#r.onSettled?.(a.data,null,i,o,l)):a?.type==="error"&&(this.#r.onError?.(a.error,i,o,l),this.#r.onSettled?.(void 0,a.error,i,o,l))}this.listeners.forEach(i=>{i(this.#e)})})}},e3=class extends Zi{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,a,i){const o=a.queryKey,l=a.queryHash??Yh(o,a);let u=this.get(l);return u||(u=new K4({client:e,queryKey:o,queryHash:l,options:e.defaultQueryOptions(a),state:i,defaultOptions:e.getQueryDefaults(o)}),this.add(u)),u}add(e){this.#t.has(e.queryHash)||(this.#t.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const a=this.#t.get(e.queryHash);a&&(e.destroy(),a===e&&this.#t.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){ce.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#t.get(e)}getAll(){return[...this.#t.values()]}find(e){const a={exact:!0,...e};return this.getAll().find(i=>_0(a,i))}findAll(e={}){const a=this.getAll();return Object.keys(e).length>0?a.filter(i=>_0(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()})})}},n3=class{#t;#e;#n;#r;#a;#o;#s;#i;constructor(e={}){this.#t=e.queryCache||new e3,this.#e=e.mutationCache||new W4,this.#n=e.defaultOptions||{},this.#r=new Map,this.#a=new Map,this.#o=0}mount(){this.#o++,this.#o===1&&(this.#s=Kh.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#i=yu.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#o--,this.#o===0&&(this.#s?.(),this.#s=void 0,this.#i?.(),this.#i=void 0)}isFetching(e){return this.#t.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#e.findAll({...e,status:"pending"}).length}getQueryData(e){const a=this.defaultQueryOptions({queryKey:e});return this.#t.get(a.queryHash)?.state.data}ensureQueryData(e){const a=this.defaultQueryOptions(e),i=this.#t.build(this,a),o=i.state.data;return o===void 0?this.fetchQuery(e):(e.revalidateIfStale&&i.isStaleByTime(Xa(a.staleTime,i))&&this.prefetchQuery(a),Promise.resolve(o))}getQueriesData(e){return this.#t.findAll(e).map(({queryKey:a,state:i})=>{const o=i.data;return[a,o]})}setQueryData(e,a,i){const o=this.defaultQueryOptions({queryKey:e}),u=this.#t.get(o.queryHash)?.state.data,d=B4(a,u);if(d!==void 0)return this.#t.build(this,o).setData(d,{...i,manual:!0})}setQueriesData(e,a,i){return ce.batch(()=>this.#t.findAll(e).map(({queryKey:o})=>[o,this.setQueryData(o,a,i)]))}getQueryState(e){const a=this.defaultQueryOptions({queryKey:e});return this.#t.get(a.queryHash)?.state}removeQueries(e){const a=this.#t;ce.batch(()=>{a.findAll(e).forEach(i=>{a.remove(i)})})}resetQueries(e,a){const i=this.#t;return ce.batch(()=>(i.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries({type:"active",...e},a)))}cancelQueries(e,a={}){const i={revert:!0,...a},o=ce.batch(()=>this.#t.findAll(e).map(l=>l.cancel(i)));return Promise.all(o).then(Ce).catch(Ce)}invalidateQueries(e,a={}){return ce.batch(()=>(this.#t.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},o=ce.batch(()=>this.#t.findAll(e).filter(l=>!l.isDisabled()&&!l.isStatic()).map(l=>{let u=l.fetch(void 0,i);return i.throwOnError||(u=u.catch(Ce)),l.state.fetchStatus==="paused"?Promise.resolve():u}));return Promise.all(o).then(Ce)}fetchQuery(e){const a=this.defaultQueryOptions(e);a.retry===void 0&&(a.retry=!1);const i=this.#t.build(this,a);return i.isStaleByTime(Xa(a.staleTime,i))?i.fetch(a):Promise.resolve(i.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ce).catch(Ce)}fetchInfiniteQuery(e){return e.behavior=D0(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ce).catch(Ce)}ensureInfiniteQueryData(e){return e.behavior=D0(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return yu.isOnline()?this.#e.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#t}getMutationCache(){return this.#e}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,a){this.#r.set(jr(e),{queryKey:e,defaultOptions:a})}getQueryDefaults(e){const a=[...this.#r.values()],i={};return a.forEach(o=>{os(e,o.queryKey)&&Object.assign(i,o.defaultOptions)}),i}setMutationDefaults(e,a){this.#a.set(jr(e),{mutationKey:e,defaultOptions:a})}getMutationDefaults(e){const a=[...this.#a.values()],i={};return a.forEach(o=>{os(e,o.mutationKey)&&Object.assign(i,o.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=Yh(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===Qh&&(a.enabled=!1),a}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#t.clear(),this.#e.clear()}},_1=R.createContext(void 0),C1=e=>{const a=R.useContext(_1);if(!a)throw new Error("No QueryClient set, use QueryClientProvider to set one");return a},a3=({client:e,children:a})=>(R.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),_.jsx(_1.Provider,{value:e,children:a})),T1=R.createContext(!1),r3=()=>R.useContext(T1);T1.Provider;function i3(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var o3=R.createContext(i3()),s3=()=>R.useContext(o3),l3=(e,a)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(a.isReset()||(e.retryOnMount=!1))},u3=e=>{R.useEffect(()=>{e.clearReset()},[e])},c3=({result:e,errorResetBoundary:a,throwOnError:i,query:o,suspense:l})=>e.isError&&!a.isReset()&&!e.isFetching&&o&&(l&&e.data===void 0||b1(i,[e.error,o])),f3=e=>{if(e.suspense){const i=l=>l==="static"?l:Math.max(l??1e3,1e3),o=e.staleTime;e.staleTime=typeof o=="function"?(...l)=>i(o(...l)):i(o),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},d3=(e,a)=>e.isLoading&&e.isFetching&&!a,h3=(e,a)=>e?.suspense&&a.isPending,L0=(e,a,i)=>a.fetchOptimistic(e).catch(()=>{i.clearReset()});function m3(e,a,i){const o=r3(),l=s3(),u=C1(),d=u.defaultQueryOptions(e);u.getDefaultOptions().queries?._experimental_beforeQuery?.(d),d._optimisticResults=o?"isRestoring":"optimistic",f3(d),l3(d,l),u3(l);const h=!u.getQueryCache().get(d.queryHash),[p]=R.useState(()=>new a(u,d)),m=p.getOptimisticResult(d),g=!o&&e.subscribed!==!1;if(R.useSyncExternalStore(R.useCallback(v=>{const b=g?p.subscribe(ce.batchCalls(v)):Ce;return p.updateResult(),b},[p,g]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),R.useEffect(()=>{p.setOptions(d)},[d,p]),h3(d,m))throw L0(d,p,l);if(c3({result:m,errorResetBoundary:l,throwOnError:d.throwOnError,query:u.getQueryCache().get(d.queryHash),suspense:d.suspense}))throw m.error;return u.getDefaultOptions().queries?._experimental_afterQuery?.(d,m),d.experimental_prefetchInRender&&!Lr&&d3(m,o)&&(h?L0(d,p,l):u.getQueryCache().get(d.queryHash)?.promise)?.catch(Ce).finally(()=>{p.updateResult()}),d.notifyOnChangeProps?m:p.trackResult(m)}function p3(e,a){return m3(e,X4)}function v3(e,a){const i=C1(),[o]=R.useState(()=>new t3(i,e));R.useEffect(()=>{o.setOptions(e)},[o,e]);const l=R.useSyncExternalStore(R.useCallback(d=>o.subscribe(ce.batchCalls(d)),[o]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),u=R.useCallback((d,h)=>{o.mutate(d,h).catch(Ce)},[o]);if(l.error&&b1(o.options.throwOnError,[l.error]))throw l.error;return{...l,mutate:u,mutateAsync:l.mutate}}function g3(){return _.jsx("div",{className:"h-screen grid place-items-center",children:_.jsx(ub,{className:"size-8 animate-spin"})})}function y3({className:e,...a}){const{setAuthenticated:i}=p1(),[o,l]=R.useState(""),[u,d]=R.useState(""),h=Fh(),{isPending:p,mutate:m}=v3({mutationFn:async()=>h.login(o,u),onError(){w0.error("Invalid credentials",{description:"The credentials you provided are invalid."})},onSuccess(){w0.success("Login successful",{description:"You have successfully logged in."}),i(!0)}});return p?_.jsx(g3,{}):_.jsx("div",{className:Rt("flex flex-col gap-6 w-[20%]",e),...a,children:_.jsxs(ZM,{children:[_.jsxs(IM,{children:[_.jsx(JM,{className:"text-2xl",children:"Login"}),_.jsx(WM,{children:"Enter your credentials below to proceed"})]}),_.jsx(t4,{children:_.jsxs("div",{className:"flex flex-col gap-6",children:[_.jsxs("div",{className:"grid gap-2",children:[_.jsx(b0,{htmlFor:"username",children:"Username"}),_.jsx(Ny,{id:"username",type:"username",placeholder:"Enter your username",required:!0,value:o,onChange:g=>l(g.target.value)})]}),_.jsxs("div",{className:"grid gap-2",children:[_.jsx("div",{className:"flex items-center",children:_.jsx(b0,{htmlFor:"password",children:"Password"})}),_.jsx(Ny,{id:"password",type:"password",required:!0,value:u,onChange:g=>d(g.target.value)})]}),_.jsx(Cb,{type:"button",className:"w-full",onClick:()=>{m()},children:"Login"})]})})]})})}function b3({children:e}){const{authenticated:a,setAuthenticated:i}=p1(),o=Fh(),{isLoading:l,isError:u}=p3({queryKey:[],enabled:!a,queryFn:async()=>{const d=await o.fetchMe();return i(!!d),d},refetchOnWindowFocus:!0});return l?_.jsx("div",{className:"h-screen grid place-items-center",children:_.jsx(ub,{className:"size-8 animate-spin"})}):u?_.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(y3,{})})}function S3({...e}){return _.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function x3({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 Td({className:e,...a}){return _.jsx("li",{"data-slot":"breadcrumb-item",className:Rt("inline-flex items-center gap-1.5",e),...a})}function j0({asChild:e,className:a,...i}){const o=e?us:"a";return _.jsx(o,{"data-slot":"breadcrumb-link",className:Rt("hover:text-foreground transition-colors",a),...i})}function w3({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 U0({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(kR,{})})}function E3(){const{toggleSidebar:e}=Bh();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(Cb,{className:"h-8 w-8",variant:"ghost",size:"icon",onClick:e,children:_.jsx(HR,{})}),_.jsx(m_,{orientation:"vertical",className:"mr-2 h-4"}),_.jsx(S3,{className:"hidden sm:block",children:_.jsxs(x3,{children:[_.jsx(Td,{children:_.jsx(j0,{href:"#",children:"/"})}),_.jsx(U0,{}),_.jsx(Td,{children:_.jsx(w3,{children:"CommandKit"})}),_.jsx(U0,{}),_.jsx(Td,{children:_.jsx(j0,{href:"#",children:"DevTools"})})]})})]})})}var R3=(e,a,i,o,l,u,d,h)=>{let p=document.documentElement,m=["light","dark"];function g(x){(Array.isArray(e)?e:[e]).forEach(S=>{let w=S==="class",C=w&&u?l.map(T=>u[T]||T):l;w?(p.classList.remove(...C),p.classList.add(u&&u[x]?u[x]:x)):p.setAttribute(S,x)}),v(x)}function v(x){h&&m.includes(x)&&(p.style.colorScheme=x)}function b(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(o)g(o);else try{let x=localStorage.getItem(a)||i,S=d&&x==="system"?b():x;g(S)}catch{}},B0=["light","dark"],A1="(prefers-color-scheme: dark)",_3=typeof window>"u",$h=R.createContext(void 0),C3={setTheme:e=>{},themes:[]},T3=()=>{var e;return(e=R.useContext($h))!=null?e:C3},A3=e=>R.useContext($h)?R.createElement(R.Fragment,null,e.children):R.createElement(M3,{...e}),O3=["light","dark"],M3=({forcedTheme:e,disableTransitionOnChange:a=!1,enableSystem:i=!0,enableColorScheme:o=!0,storageKey:l="theme",themes:u=O3,defaultTheme:d=i?"system":"light",attribute:h="data-theme",value:p,children:m,nonce:g,scriptProps:v})=>{let[b,x]=R.useState(()=>D3(l,d)),[S,w]=R.useState(()=>b==="system"?Ad():b),C=p?Object.values(p):u,T=R.useCallback(B=>{let K=B;if(!K)return;B==="system"&&i&&(K=Ad());let j=p?p[K]:K,V=a?z3(g):null,et=document.documentElement,J=at=>{at==="class"?(et.classList.remove(...C),j&&et.classList.add(j)):at.startsWith("data-")&&(j?et.setAttribute(at,j):et.removeAttribute(at))};if(Array.isArray(h)?h.forEach(J):J(h),o){let at=B0.includes(d)?d:null,rt=B0.includes(K)?K:at;et.style.colorScheme=rt}V?.()},[g]),z=R.useCallback(B=>{let K=typeof B=="function"?B(b):B;x(K);try{localStorage.setItem(l,K)}catch{}},[b]),D=R.useCallback(B=>{let K=Ad(B);w(K),b==="system"&&i&&!e&&T("system")},[b,e]);R.useEffect(()=>{let B=window.matchMedia(A1);return B.addListener(D),D(B),()=>B.removeListener(D)},[D]),R.useEffect(()=>{let B=K=>{K.key===l&&(K.newValue?x(K.newValue):z(d))};return window.addEventListener("storage",B),()=>window.removeEventListener("storage",B)},[z]),R.useEffect(()=>{T(e??b)},[e,b]);let U=R.useMemo(()=>({theme:b,setTheme:z,forcedTheme:e,resolvedTheme:b==="system"?S:b,themes:i?[...u,"system"]:u,systemTheme:i?S:void 0}),[b,z,e,S,i,u]);return R.createElement($h.Provider,{value:U},R.createElement(N3,{forcedTheme:e,storageKey:l,attribute:h,enableSystem:i,enableColorScheme:o,defaultTheme:d,value:p,themes:u,nonce:g,scriptProps:v}),m)},N3=R.memo(({forcedTheme:e,storageKey:a,attribute:i,enableSystem:o,enableColorScheme:l,defaultTheme:u,value:d,themes:h,nonce:p,scriptProps:m})=>{let g=JSON.stringify([i,a,u,e,h,d,o,l]).slice(1,-1);return R.createElement("script",{...m,suppressHydrationWarning:!0,nonce:typeof window>"u"?p:"",dangerouslySetInnerHTML:{__html:`(${R3.toString()})(${g})`}})}),D3=(e,a)=>{if(_3)return;let i;try{i=localStorage.getItem(e)||void 0}catch{}return i||a},z3=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)}},Ad=e=>(e||(e=window.matchMedia(A1)),e.matches?"dark":"light");const L3=({...e})=>{const{theme:a="system"}=T3();return _.jsx(z4,{theme:a,className:"toaster group",style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)"},...e})},Br=yR({head:()=>({meta:[{charSet:"utf-8"},{name:"viewport",content:"width=device-width, initial-scale=1"},{title:"CommandKit DevTools"}]}),component:j3});function j3(){return _.jsxs(A3,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!1,children:[_.jsx(L3,{}),_.jsx(XM,{children:_.jsx(b3,{children:_.jsx("div",{className:"[--header-height:calc(theme(spacing.14))]",children:_.jsxs(FA,{className:"flex flex-col",children:[_.jsx(E3,{}),_.jsxs("div",{className:"flex flex-1",children:[_.jsx($M,{}),_.jsx(QA,{children:_.jsx(ib,{})})]})]})})})})]})}const U3="modulepreload",B3=function(e){return"/"+e},k0={},Ii=function(a,i,o){let l=Promise.resolve();if(i&&i.length>0){let p=function(m){return Promise.all(m.map(g=>Promise.resolve(g).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),h=d?.nonce||d?.getAttribute("nonce");l=p(i.map(m=>{if(m=B3(m),m in k0)return;k0[m]=!0;const g=m.endsWith(".css"),v=g?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${v}`))return;const b=document.createElement("link");if(b.rel=g?"stylesheet":U3,g||(b.as="script"),b.crossOrigin="",b.href=m,h&&b.setAttribute("nonce",h),document.head.appendChild(b),g)return new Promise((x,S)=>{b.addEventListener("load",x),b.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${m}`)))})}))}function u(d){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=d,window.dispatchEvent(h),!h.defaultPrevented)throw d}return l.then(d=>{for(const h of d||[])h.status==="rejected"&&u(h.reason);return a().catch(u)})},k3=()=>Ii(()=>import("./plugins-BumS8uEj.js"),[]),P3=$a("/plugins")({component:Gi(k3,"component")}),H3=()=>Ii(()=>import("./guilds-B_AKWH1U.js"),[]),q3=$a("/guilds")({component:Gi(H3,"component")}),V3=()=>Ii(()=>import("./feature-flags-BWvj0CZO.js"),[]),G3=$a("/feature-flags")({component:Gi(V3,"component")}),F3=()=>Ii(()=>import("./events-Cuzh7n3v.js"),[]),Y3=$a("/events")({component:Gi(F3,"component")}),Q3=()=>Ii(()=>import("./commands-53RQU20s.js"),[]),K3=$a("/commands")({component:Gi(Q3,"component")}),X3=()=>Ii(()=>import("./index-BbA1XI_K.js"),[]),$3=$a("/")({component:Gi(X3,"component")}),Z3=P3.update({id:"/plugins",path:"/plugins",getParentRoute:()=>Br}),I3=q3.update({id:"/guilds",path:"/guilds",getParentRoute:()=>Br}),J3=G3.update({id:"/feature-flags",path:"/feature-flags",getParentRoute:()=>Br}),W3=Y3.update({id:"/events",path:"/events",getParentRoute:()=>Br}),tN=K3.update({id:"/commands",path:"/commands",getParentRoute:()=>Br}),eN=$3.update({id:"/",path:"/",getParentRoute:()=>Br}),nN={IndexRoute:eN,CommandsRoute:tN,EventsRoute:W3,FeatureFlagsRoute:J3,GuildsRoute:I3,PluginsRoute:Z3},aN=Br._addFileChildren(nN)._addFileTypes(),rN=TR({routeTree:aN,defaultPreload:"intent",defaultStaleTime:5e3,scrollRestoration:!0,defaultViewTransition:!0}),iN=new n3;$w.createRoot(document.getElementById("root")).render(_.jsx(R.StrictMode,{children:_.jsx(a3,{client:iN,children:_.jsx(MR,{router:rN})})}));export{cO as A,mO as B,ZM as C,g3 as L,p3 as a,IM as b,fO as c,dO as d,t4 as e,JM as f,P0 as g,WM as h,Ja as i,_ as j,kR as k,CN as l,Vi as m,Cb as n,R as r,Fh as u};
175
+ `+u):o.stack=u}catch{}}throw o}}_request(a,i){typeof a=="string"?(i=i||{},i.url=a):i=a||{},i=zr(this.defaults,i);const{transitional:o,paramsSerializer:l,headers:u}=i;o!==void 0&&nu.assertOptions(o,{silentJSONParsing:zn.transitional(zn.boolean),forcedJSONParsing:zn.transitional(zn.boolean),clarifyTimeoutError:zn.transitional(zn.boolean)},!1),l!=null&&(G.isFunction(l)?i.paramsSerializer={serialize:l}:nu.assertOptions(l,{encode:zn.function,serialize:zn.function},!0)),i.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?i.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:i.allowAbsoluteUrls=!0),nu.assertOptions(i,{baseUrl:zn.spelling("baseURL"),withXsrfToken:zn.spelling("withXSRFToken")},!0),i.method=(i.method||this.defaults.method||"get").toLowerCase();let d=u&&G.merge(u.common,u[i.method]);u&&G.forEach(["delete","get","head","post","put","patch","common"],S=>{delete u[S]}),i.headers=Ve.concat(d,u);const h=[];let p=!0;this.interceptors.request.forEach(function(w){typeof w.runWhen=="function"&&w.runWhen(i)===!1||(p=p&&w.synchronous,h.unshift(w.fulfilled,w.rejected))});const m=[];this.interceptors.response.forEach(function(w){m.push(w.fulfilled,w.rejected)});let g,v=0,b;if(!p){const S=[v0.bind(this),void 0];for(S.unshift(...h),S.push(...m),b=S.length,g=Promise.resolve(i);v<b;)g=g.then(S[v++],S[v++]);return g}b=h.length;let x=i;for(;v<b;){const S=h[v++],w=h[v++];try{x=S(x)}catch(C){w.call(this,C);break}}try{g=v0.call(this,x)}catch(S){return Promise.reject(S)}for(v=0,b=m.length;v<b;)g=g.then(m[v++],m[v++]);return g}getUri(a){a=zr(this.defaults,a);const i=o1(a.baseURL,a.url,a.allowAbsoluteUrls);return e1(i,a.params,a.paramsSerializer)}};G.forEach(["delete","get","head","options"],function(a){Tr.prototype[a]=function(i,o){return this.request(zr(o||{},{method:a,url:i,data:(o||{}).data}))}});G.forEach(["post","put","patch"],function(a){function i(o){return function(u,d,h){return this.request(zr(h||{},{method:a,headers:o?{"Content-Type":"multipart/form-data"}:{},url:u,data:d}))}}Tr.prototype[a]=i(),Tr.prototype[a+"Form"]=i(!0)});let qM=class f1{constructor(a){if(typeof a!="function")throw new TypeError("executor must be a function.");let i;this.promise=new Promise(function(u){i=u});const o=this;this.promise.then(l=>{if(!o._listeners)return;let u=o._listeners.length;for(;u-- >0;)o._listeners[u](l);o._listeners=null}),this.promise.then=l=>{let u;const d=new Promise(h=>{o.subscribe(h),u=h}).then(l);return d.cancel=function(){o.unsubscribe(u)},d},a(function(u,d,h){o.reason||(o.reason=new $i(u,d,h),i(o.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=o=>{a.abort(o)};return this.subscribe(i),a.signal.unsubscribe=()=>this.unsubscribe(i),a.signal}static source(){let a;return{token:new f1(function(l){a=l}),cancel:a}}};function VM(e){return function(i){return e.apply(null,i)}}function GM(e){return G.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 d1(e){const a=new Tr(e),i=GS(Tr.prototype.request,a);return G.extend(i,Tr.prototype,a,{allOwnKeys:!0}),G.extend(i,a,null,{allOwnKeys:!0}),i.create=function(l){return d1(zr(e,l))},i}const ne=d1(ys);ne.Axios=Tr;ne.CanceledError=$i;ne.CancelToken=qM;ne.isCancel=r1;ne.VERSION=c1;ne.toFormData=Lu;ne.AxiosError=wt;ne.Cancel=ne.CanceledError;ne.all=function(a){return Promise.all(a)};ne.spread=VM;ne.isAxiosError=GM;ne.mergeConfig=zr;ne.AxiosHeaders=Ve;ne.formToJSON=e=>a1(G.isHTMLForm(e)?new FormData(e):e);ne.getAdapter=u1.getAdapter;ne.HttpStatusCode=Zd;ne.default=ne;const{Axios:cN,AxiosError:fN,CanceledError:dN,isCancel:hN,CancelToken:mN,VERSION:pN,all:vN,Cancel:gN,isAxiosError:yN,spread:bN,toFormData:SN,AxiosHeaders:xN,HttpStatusCode:wN,formToJSON:EN,getAdapter:RN,mergeConfig:_N}=ne,Gh=ne.create({baseURL:"/api"});Gh.interceptors.request.use(e=>{const a=localStorage.getItem("access_token");return a&&(e.headers.Authorization=`Bearer ${a}`),e});Gh.interceptors.response.use(e=>e,e=>(e.response.status===401&&(localStorage.removeItem("access_token"),window.location.href="/"),Promise.reject(e)));class y0{constructor(a,i){this.client=a,this.data=i}}class FM{constructor(a){this.client=a}async fetch(){const{data:a}=await this.client.api.get("/events");return a.events}}class YM{constructor(a){this.client=a}async fetch(){const{data:a}=await this.client.api.get("/guilds");return a.guilds}}class QM{constructor(a){this.client=a}async fetch(){const{data:a}=await this.client.api.get("/plugins");return a.plugins}}class KM{api=Gh;guilds=new YM(this);plugins=new QM(this);events=new FM(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 y0(this,i),this._user}async getFeatureFlags(){const{data:a}=await this.api.get("/feature-flags");return a}async login(a,i){const{data:o}=await this.api.post("/auth/login",{username:a,password:i});return o.accessToken&&localStorage.setItem("access_token",o.accessToken),this._user=new y0(this,o.user),o}}const h1=R.createContext(null);function XM({children:e}){const[a,i]=R.useState(()=>new KM);return _.jsx(h1.Provider,{value:{client:a,setClient:i},children:e})}function Fh(){const e=R.use(h1);if(!e)throw new Error("useClient must be used within a ClientProvider");return e.client}const Cd={navMain:[{title:"Commands",url:"/commands",icon:Sy,isActive:!1},{title:"Events",url:"/events",icon:by,isActive:!1},{title:"Plugins",url:"/plugins",icon:VR,isActive:!1},{title:"Guilds",url:"/guilds",icon:Ey,isActive:!1},{title:"Feature Flags",url:"/feature-flags",icon:FR,isActive:!1}],navSecondary:[{title:"GitHub",url:"https://github.com/neplextech/commandkit",icon:a2},{title:"Discord",url:"https://neplextech.com/discord",icon:Ey}],projects:[{name:"Commands",url:"#",icon:Sy},{name:"Middlewares",url:"#",icon:KR},{name:"Events",url:"#",icon:by}]};function $M({...e}){const a=Fh();return _.jsxs(YA,{className:"top-(--header-height) h-[calc(100svh-var(--header-height))]!",...e,children:[_.jsx(KA,{children:_.jsx(ds,{children:_.jsx(hs,{children:_.jsx(ms,{size:"lg",asChild:!0,children:_.jsxs(Vi,{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($A,{children:[_.jsx(JA,{items:Cd.navMain}),_.jsx(WA,{projects:Cd.projects}),_.jsx(tO,{items:Cd.navSecondary,className:"mt-auto"})]}),_.jsx(XA,{children:_.jsx(pO,{user:{avatar:a.user.data.displayAvatarURL,name:a.user.data.globalName||a.user?.data.username,username:a.user.data.username}})})]})}function ZM({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 IM({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 JM({className:e,...a}){return _.jsx("div",{"data-slot":"card-title",className:Rt("leading-none font-semibold",e),...a})}function WM({className:e,...a}){return _.jsx("div",{"data-slot":"card-description",className:Rt("text-muted-foreground text-sm",e),...a})}function t4({className:e,...a}){return _.jsx("div",{"data-slot":"card-content",className:Rt("px-6",e),...a})}function CN({className:e,...a}){return _.jsx("div",{"data-slot":"card-footer",className:Rt("flex items-center px-6 [.border-t]:pt-6",e),...a})}var e4="Label",m1=R.forwardRef((e,a)=>_.jsx(Jt.label,{...e,ref:a,onMouseDown:i=>{i.target.closest("button, input, select, textarea")||(e.onMouseDown?.(i),!i.defaultPrevented&&i.detail>1&&i.preventDefault())}}));m1.displayName=e4;var n4=m1;function b0({className:e,...a}){return _.jsx(n4,{"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 S0=e=>{let a;const i=new Set,o=(m,g)=>{const v=typeof m=="function"?m(a):m;if(!Object.is(v,a)){const b=a;a=g??(typeof v!="object"||v===null)?v:Object.assign({},a,v),i.forEach(x=>x(a,b))}},l=()=>a,h={setState:o,getState:l,getInitialState:()=>p,subscribe:m=>(i.add(m),()=>i.delete(m))},p=a=e(o,l,h);return h},a4=(e=>e?S0(e):S0),r4=e=>e;function i4(e,a=r4){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 x0=e=>{const a=a4(e),i=o=>i4(a,o);return Object.assign(i,a),i},o4=(e=>e?x0(e):x0),p1=o4(e=>({authenticated:!1,setAuthenticated:a=>e({authenticated:a})}));function s4(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 l4=e=>{switch(e){case"success":return f4;case"info":return h4;case"warning":return d4;case"error":return m4;default:return null}},u4=Array(12).fill(0),c4=({visible:e,className:a})=>tt.createElement("div",{className:["sonner-loading-wrapper",a].filter(Boolean).join(" "),"data-visible":e},tt.createElement("div",{className:"sonner-spinner"},u4.map((i,o)=>tt.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${o}`})))),f4=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"})),d4=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"})),h4=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"})),m4=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"})),p4=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"})),v4=()=>{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 Id=1;class g4{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:o,...l}=a,u=typeof a?.id=="number"||((i=a.id)==null?void 0:i.length)>0?a.id:Id++,d=this.toasts.find(p=>p.id===u),h=a.dismissible===void 0?!0:a.dismissible;return this.dismissedToasts.has(u)&&this.dismissedToasts.delete(u),d?this.toasts=this.toasts.map(p=>p.id===u?(this.publish({...p,...a,id:u,title:o}),{...p,...a,id:u,dismissible:h,title:o}):p):this.addToast({title:o,...l,dismissible:h,id:u}),u},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(o=>o({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 o;i.loading!==void 0&&(o=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 u=o!==void 0,d;const h=l.then(async m=>{if(d=["resolve",m],tt.isValidElement(m))u=!1,this.create({id:o,type:"default",message:m});else if(b4(m)&&!m.ok){u=!1;const v=typeof i.error=="function"?await i.error(`HTTP error! status: ${m.status}`):i.error,b=typeof i.description=="function"?await i.description(`HTTP error! status: ${m.status}`):i.description,S=typeof v=="object"&&!tt.isValidElement(v)?v:{message:v};this.create({id:o,type:"error",description:b,...S})}else if(m instanceof Error){u=!1;const v=typeof i.error=="function"?await i.error(m):i.error,b=typeof i.description=="function"?await i.description(m):i.description,S=typeof v=="object"&&!tt.isValidElement(v)?v:{message:v};this.create({id:o,type:"error",description:b,...S})}else if(i.success!==void 0){u=!1;const v=typeof i.success=="function"?await i.success(m):i.success,b=typeof i.description=="function"?await i.description(m):i.description,S=typeof v=="object"&&!tt.isValidElement(v)?v:{message:v};this.create({id:o,type:"success",description:b,...S})}}).catch(async m=>{if(d=["reject",m],i.error!==void 0){u=!1;const g=typeof i.error=="function"?await i.error(m):i.error,v=typeof i.description=="function"?await i.description(m):i.description,x=typeof g=="object"&&!tt.isValidElement(g)?g:{message:g};this.create({id:o,type:"error",description:v,...x})}}).finally(()=>{u&&(this.dismiss(o),o=void 0),i.finally==null||i.finally.call(i)}),p=()=>new Promise((m,g)=>h.then(()=>d[0]==="reject"?g(d[1]):m(d[1])).catch(g));return typeof o!="string"&&typeof o!="number"?{unwrap:p}:Object.assign(o,{unwrap:p})},this.custom=(a,i)=>{const o=i?.id||Id++;return this.create({jsx:a(o),id:o,...i}),o},this.getActiveToasts=()=>this.toasts.filter(a=>!this.dismissedToasts.has(a.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Pe=new g4,y4=(e,a)=>{const i=a?.id||Id++;return Pe.addToast({title:e,...a,id:i}),i},b4=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",S4=y4,x4=()=>Pe.toasts,w4=()=>Pe.getActiveToasts(),w0=Object.assign(S4,{success:Pe.success,info:Pe.info,warning:Pe.warning,error:Pe.error,custom:Pe.custom,message:Pe.message,promise:Pe.promise,dismiss:Pe.dismiss,loading:Pe.loading},{getHistory:x4,getToasts:w4});s4("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Kl(e){return e.label!==void 0}const E4=3,R4="24px",_4="16px",E0=4e3,C4=356,T4=14,A4=45,O4=200;function Ln(...e){return e.filter(Boolean).join(" ")}function M4(e){const[a,i]=e.split("-"),o=[];return a&&o.push(a),i&&o.push(i),o}const N4=e=>{var a,i,o,l,u,d,h,p,m;const{invert:g,toast:v,unstyled:b,interacting:x,setHeights:S,visibleToasts:w,heights:C,index:T,toasts:z,expanded:D,removeToast:U,defaultRichColors:B,closeButton:K,style:j,cancelButtonStyle:V,actionButtonStyle:et,className:J="",descriptionClassName:at="",duration:rt,position:ht,gap:st,expandByDefault:yt,classNames:M,icons:X,closeButtonAriaLabel:H="Close toast"}=e,[ft,mt]=tt.useState(null),[O,Y]=tt.useState(null),[Q,W]=tt.useState(!1),[nt,ct]=tt.useState(!1),[it,vt]=tt.useState(!1),[_t,Wt]=tt.useState(!1),[Kt,se]=tt.useState(!1),[vn,Ae]=tt.useState(0),[Wa,ma]=tt.useState(0),Vn=tt.useRef(v.duration||rt||E0),Cn=tt.useRef(null),fe=tt.useRef(null),pa=T===0,va=T+1<=w,Ct=v.type,Xt=v.dismissible!==!1,Ft=v.className||"",bs=v.descriptionClassName||"",tr=tt.useMemo(()=>C.findIndex(bt=>bt.toastId===v.id)||0,[C,v.id]),Ss=tt.useMemo(()=>{var bt;return(bt=v.closeButton)!=null?bt:K},[v.closeButton,K]),er=tt.useMemo(()=>v.duration||rt||E0,[v.duration,rt]),Ji=tt.useRef(0),Gn=tt.useRef(0),xs=tt.useRef(0),ga=tt.useRef(null),[nr,Re]=ht.split("-"),gn=tt.useMemo(()=>C.reduce((bt,Yt,de)=>de>=tr?bt:bt+Yt.height,0),[C,tr]),Se=v4(),Uu=v.invert||g,Wi=Ct==="loading";Gn.current=tt.useMemo(()=>tr*st+gn,[tr,gn]),tt.useEffect(()=>{Vn.current=er},[er]),tt.useEffect(()=>{W(!0)},[]),tt.useEffect(()=>{const bt=fe.current;if(bt){const Yt=bt.getBoundingClientRect().height;return ma(Yt),S(de=>[{toastId:v.id,height:Yt,position:v.position},...de]),()=>S(de=>de.filter(xe=>xe.toastId!==v.id))}},[S,v.id]),tt.useLayoutEffect(()=>{if(!Q)return;const bt=fe.current,Yt=bt.style.height;bt.style.height="auto";const de=bt.getBoundingClientRect().height;bt.style.height=Yt,ma(de),S(xe=>xe.find($t=>$t.toastId===v.id)?xe.map($t=>$t.toastId===v.id?{...$t,height:de}:$t):[{toastId:v.id,height:de,position:v.position},...xe])},[Q,v.title,v.description,S,v.id,v.jsx,v.action,v.cancel]);const Tn=tt.useCallback(()=>{ct(!0),Ae(Gn.current),S(bt=>bt.filter(Yt=>Yt.toastId!==v.id)),setTimeout(()=>{U(v)},O4)},[v,U,S,Gn]);tt.useEffect(()=>{if(v.promise&&Ct==="loading"||v.duration===1/0||v.type==="loading")return;let bt;return D||x||Se?(()=>{if(xs.current<Ji.current){const xe=new Date().getTime()-Ji.current;Vn.current=Vn.current-xe}xs.current=new Date().getTime()})():(()=>{Vn.current!==1/0&&(Ji.current=new Date().getTime(),bt=setTimeout(()=>{v.onAutoClose==null||v.onAutoClose.call(v,v),Tn()},Vn.current))})(),()=>clearTimeout(bt)},[D,x,v,Ct,Se,Tn]),tt.useEffect(()=>{v.delete&&(Tn(),v.onDismiss==null||v.onDismiss.call(v,v))},[Tn,v.delete]);function kr(){var bt;if(X?.loading){var Yt;return tt.createElement("div",{className:Ln(M?.loader,v==null||(Yt=v.classNames)==null?void 0:Yt.loader,"sonner-loader"),"data-visible":Ct==="loading"},X.loading)}return tt.createElement(c4,{className:Ln(M?.loader,v==null||(bt=v.classNames)==null?void 0:bt.loader),visible:Ct==="loading"})}const Pr=v.icon||X?.[Ct]||l4(Ct);var ar,An;return tt.createElement("li",{tabIndex:0,ref:fe,className:Ln(J,Ft,M?.toast,v==null||(a=v.classNames)==null?void 0:a.toast,M?.default,M?.[Ct],v==null||(i=v.classNames)==null?void 0:i[Ct]),"data-sonner-toast":"","data-rich-colors":(ar=v.richColors)!=null?ar:B,"data-styled":!(v.jsx||v.unstyled||b),"data-mounted":Q,"data-promise":!!v.promise,"data-swiped":Kt,"data-removed":nt,"data-visible":va,"data-y-position":nr,"data-x-position":Re,"data-index":T,"data-front":pa,"data-swiping":it,"data-dismissible":Xt,"data-type":Ct,"data-invert":Uu,"data-swipe-out":_t,"data-swipe-direction":O,"data-expanded":!!(D||yt&&Q),"data-testid":v.testId,style:{"--index":T,"--toasts-before":T,"--z-index":z.length-T,"--offset":`${nt?vn:Gn.current}px`,"--initial-height":yt?"auto":`${Wa}px`,...j,...v.style},onDragEnd:()=>{vt(!1),mt(null),ga.current=null},onPointerDown:bt=>{bt.button!==2&&(Wi||!Xt||(Cn.current=new Date,Ae(Gn.current),bt.target.setPointerCapture(bt.pointerId),bt.target.tagName!=="BUTTON"&&(vt(!0),ga.current={x:bt.clientX,y:bt.clientY})))},onPointerUp:()=>{var bt,Yt,de;if(_t||!Xt)return;ga.current=null;const xe=Number(((bt=fe.current)==null?void 0:bt.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ya=Number(((Yt=fe.current)==null?void 0:Yt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),$t=new Date().getTime()-((de=Cn.current)==null?void 0:de.getTime()),Oe=ft==="x"?xe:ya,rr=Math.abs(Oe)/$t;if(Math.abs(Oe)>=A4||rr>.11){Ae(Gn.current),v.onDismiss==null||v.onDismiss.call(v,v),Y(ft==="x"?xe>0?"right":"left":ya>0?"down":"up"),Tn(),Wt(!0);return}else{var Me,Ne;(Me=fe.current)==null||Me.style.setProperty("--swipe-amount-x","0px"),(Ne=fe.current)==null||Ne.style.setProperty("--swipe-amount-y","0px")}se(!1),vt(!1),mt(null)},onPointerMove:bt=>{var Yt,de,xe;if(!ga.current||!Xt||((Yt=window.getSelection())==null?void 0:Yt.toString().length)>0)return;const $t=bt.clientY-ga.current.y,Oe=bt.clientX-ga.current.x;var rr;const Me=(rr=e.swipeDirections)!=null?rr:M4(ht);!ft&&(Math.abs(Oe)>1||Math.abs($t)>1)&&mt(Math.abs(Oe)>Math.abs($t)?"x":"y");let Ne={x:0,y:0};const Hr=yn=>1/(1.5+Math.abs(yn)/20);if(ft==="y"){if(Me.includes("top")||Me.includes("bottom"))if(Me.includes("top")&&$t<0||Me.includes("bottom")&&$t>0)Ne.y=$t;else{const yn=$t*Hr($t);Ne.y=Math.abs(yn)<Math.abs($t)?yn:$t}}else if(ft==="x"&&(Me.includes("left")||Me.includes("right")))if(Me.includes("left")&&Oe<0||Me.includes("right")&&Oe>0)Ne.x=Oe;else{const yn=Oe*Hr(Oe);Ne.x=Math.abs(yn)<Math.abs(Oe)?yn:Oe}(Math.abs(Ne.x)>0||Math.abs(Ne.y)>0)&&se(!0),(de=fe.current)==null||de.style.setProperty("--swipe-amount-x",`${Ne.x}px`),(xe=fe.current)==null||xe.style.setProperty("--swipe-amount-y",`${Ne.y}px`)}},Ss&&!v.jsx&&Ct!=="loading"?tt.createElement("button",{"aria-label":H,"data-disabled":Wi,"data-close-button":!0,onClick:Wi||!Xt?()=>{}:()=>{Tn(),v.onDismiss==null||v.onDismiss.call(v,v)},className:Ln(M?.closeButton,v==null||(o=v.classNames)==null?void 0:o.closeButton)},(An=X?.close)!=null?An:p4):null,(Ct||v.icon||v.promise)&&v.icon!==null&&(X?.[Ct]!==null||v.icon)?tt.createElement("div",{"data-icon":"",className:Ln(M?.icon,v==null||(l=v.classNames)==null?void 0:l.icon)},v.promise||v.type==="loading"&&!v.icon?v.icon||kr():null,v.type!=="loading"?Pr:null):null,tt.createElement("div",{"data-content":"",className:Ln(M?.content,v==null||(u=v.classNames)==null?void 0:u.content)},tt.createElement("div",{"data-title":"",className:Ln(M?.title,v==null||(d=v.classNames)==null?void 0:d.title)},v.jsx?v.jsx:typeof v.title=="function"?v.title():v.title),v.description?tt.createElement("div",{"data-description":"",className:Ln(at,bs,M?.description,v==null||(h=v.classNames)==null?void 0:h.description)},typeof v.description=="function"?v.description():v.description):null),tt.isValidElement(v.cancel)?v.cancel:v.cancel&&Kl(v.cancel)?tt.createElement("button",{"data-button":!0,"data-cancel":!0,style:v.cancelButtonStyle||V,onClick:bt=>{Kl(v.cancel)&&Xt&&(v.cancel.onClick==null||v.cancel.onClick.call(v.cancel,bt),Tn())},className:Ln(M?.cancelButton,v==null||(p=v.classNames)==null?void 0:p.cancelButton)},v.cancel.label):null,tt.isValidElement(v.action)?v.action:v.action&&Kl(v.action)?tt.createElement("button",{"data-button":!0,"data-action":!0,style:v.actionButtonStyle||et,onClick:bt=>{Kl(v.action)&&(v.action.onClick==null||v.action.onClick.call(v.action,bt),!bt.defaultPrevented&&Tn())},className:Ln(M?.actionButton,v==null||(m=v.classNames)==null?void 0:m.actionButton)},v.action.label):null)};function R0(){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 D4(e,a){const i={};return[e,a].forEach((o,l)=>{const u=l===1,d=u?"--mobile-offset":"--offset",h=u?_4:R4;function p(m){["top","right","bottom","left"].forEach(g=>{i[`${d}-${g}`]=typeof m=="number"?`${m}px`:m})}typeof o=="number"||typeof o=="string"?p(o):typeof o=="object"?["top","right","bottom","left"].forEach(m=>{o[m]===void 0?i[`${d}-${m}`]=h:i[`${d}-${m}`]=typeof o[m]=="number"?`${o[m]}px`:o[m]}):p(h)}),i}const z4=tt.forwardRef(function(a,i){const{id:o,invert:l,position:u="bottom-right",hotkey:d=["altKey","KeyT"],expand:h,closeButton:p,className:m,offset:g,mobileOffset:v,theme:b="light",richColors:x,duration:S,style:w,visibleToasts:C=E4,toastOptions:T,dir:z=R0(),gap:D=T4,icons:U,containerAriaLabel:B="Notifications"}=a,[K,j]=tt.useState([]),V=tt.useMemo(()=>o?K.filter(Q=>Q.toasterId===o):K.filter(Q=>!Q.toasterId),[K,o]),et=tt.useMemo(()=>Array.from(new Set([u].concat(V.filter(Q=>Q.position).map(Q=>Q.position)))),[V,u]),[J,at]=tt.useState([]),[rt,ht]=tt.useState(!1),[st,yt]=tt.useState(!1),[M,X]=tt.useState(b!=="system"?b:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),H=tt.useRef(null),ft=d.join("+").replace(/Key/g,"").replace(/Digit/g,""),mt=tt.useRef(null),O=tt.useRef(!1),Y=tt.useCallback(Q=>{j(W=>{var nt;return(nt=W.find(ct=>ct.id===Q.id))!=null&&nt.delete||Pe.dismiss(Q.id),W.filter(({id:ct})=>ct!==Q.id)})},[]);return tt.useEffect(()=>Pe.subscribe(Q=>{if(Q.dismiss){requestAnimationFrame(()=>{j(W=>W.map(nt=>nt.id===Q.id?{...nt,delete:!0}:nt))});return}setTimeout(()=>{nb.flushSync(()=>{j(W=>{const nt=W.findIndex(ct=>ct.id===Q.id);return nt!==-1?[...W.slice(0,nt),{...W[nt],...Q},...W.slice(nt+1)]:[Q,...W]})})})}),[K]),tt.useEffect(()=>{if(b!=="system"){X(b);return}if(b==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?X("dark"):X("light")),typeof window>"u")return;const Q=window.matchMedia("(prefers-color-scheme: dark)");try{Q.addEventListener("change",({matches:W})=>{X(W?"dark":"light")})}catch{Q.addListener(({matches:nt})=>{try{X(nt?"dark":"light")}catch(ct){console.error(ct)}})}},[b]),tt.useEffect(()=>{K.length<=1&&ht(!1)},[K]),tt.useEffect(()=>{const Q=W=>{var nt;if(d.every(vt=>W[vt]||W.code===vt)){var it;ht(!0),(it=H.current)==null||it.focus()}W.code==="Escape"&&(document.activeElement===H.current||(nt=H.current)!=null&&nt.contains(document.activeElement))&&ht(!1)};return document.addEventListener("keydown",Q),()=>document.removeEventListener("keydown",Q)},[d]),tt.useEffect(()=>{if(H.current)return()=>{mt.current&&(mt.current.focus({preventScroll:!0}),mt.current=null,O.current=!1)}},[H.current]),tt.createElement("section",{ref:i,"aria-label":`${B} ${ft}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},et.map((Q,W)=>{var nt;const[ct,it]=Q.split("-");return V.length?tt.createElement("ol",{key:Q,dir:z==="auto"?R0():z,tabIndex:-1,ref:H,className:m,"data-sonner-toaster":!0,"data-sonner-theme":M,"data-y-position":ct,"data-x-position":it,style:{"--front-toast-height":`${((nt=J[0])==null?void 0:nt.height)||0}px`,"--width":`${C4}px`,"--gap":`${D}px`,...w,...D4(g,v)},onBlur:vt=>{O.current&&!vt.currentTarget.contains(vt.relatedTarget)&&(O.current=!1,mt.current&&(mt.current.focus({preventScroll:!0}),mt.current=null))},onFocus:vt=>{vt.target instanceof HTMLElement&&vt.target.dataset.dismissible==="false"||O.current||(O.current=!0,mt.current=vt.relatedTarget)},onMouseEnter:()=>ht(!0),onMouseMove:()=>ht(!0),onMouseLeave:()=>{st||ht(!1)},onDragEnd:()=>ht(!1),onPointerDown:vt=>{vt.target instanceof HTMLElement&&vt.target.dataset.dismissible==="false"||yt(!0)},onPointerUp:()=>yt(!1)},V.filter(vt=>!vt.position&&W===0||vt.position===Q).map((vt,_t)=>{var Wt,Kt;return tt.createElement(N4,{key:vt.id,icons:U,index:_t,toast:vt,defaultRichColors:x,duration:(Wt=T?.duration)!=null?Wt:S,className:T?.className,descriptionClassName:T?.descriptionClassName,invert:l,visibleToasts:C,closeButton:(Kt=T?.closeButton)!=null?Kt:p,interacting:st,position:Q,style:T?.style,unstyled:T?.unstyled,classNames:T?.classNames,cancelButtonStyle:T?.cancelButtonStyle,actionButtonStyle:T?.actionButtonStyle,closeButtonAriaLabel:T?.closeButtonAriaLabel,removeToast:Y,toasts:V.filter(se=>se.position==vt.position),heights:J.filter(se=>se.position==vt.position),setHeights:at,expandByDefault:h,gap:D,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(){}},L4={setTimeout:(e,a)=>setTimeout(e,a),clearTimeout:e=>clearTimeout(e),setInterval:(e,a)=>setInterval(e,a),clearInterval:e=>clearInterval(e)},j4=class{#t=L4;#e=!1;setTimeoutProvider(e){this.#t=e}setTimeout(e,a){return this.#t.setTimeout(e,a)}clearTimeout(e){this.#t.clearTimeout(e)}setInterval(e,a){return this.#t.setInterval(e,a)}clearInterval(e){this.#t.clearInterval(e)}},Rr=new j4;function U4(e){setTimeout(e,0)}var Lr=typeof window>"u"||"Deno"in globalThis;function Ce(){}function B4(e,a){return typeof e=="function"?e(a):e}function Jd(e){return typeof e=="number"&&e>=0&&e!==1/0}function v1(e,a){return Math.max(e+(a||0)-Date.now(),0)}function Xa(e,a){return typeof e=="function"?e(a):e}function fn(e,a){return typeof e=="function"?e(a):e}function _0(e,a){const{type:i="all",exact:o,fetchStatus:l,predicate:u,queryKey:d,stale:h}=e;if(d){if(o){if(a.queryHash!==Yh(d,a.options))return!1}else if(!os(a.queryKey,d))return!1}if(i!=="all"){const p=a.isActive();if(i==="active"&&!p||i==="inactive"&&p)return!1}return!(typeof h=="boolean"&&a.isStale()!==h||l&&l!==a.state.fetchStatus||u&&!u(a))}function C0(e,a){const{exact:i,status:o,predicate:l,mutationKey:u}=e;if(u){if(!a.options.mutationKey)return!1;if(i){if(jr(a.options.mutationKey)!==jr(u))return!1}else if(!os(a.options.mutationKey,u))return!1}return!(o&&a.state.status!==o||l&&!l(a))}function Yh(e,a){return(a?.queryKeyHashFn||jr)(e)}function jr(e){return JSON.stringify(e,(a,i)=>Wd(i)?Object.keys(i).sort().reduce((o,l)=>(o[l]=i[l],o),{}):i)}function os(e,a){return e===a?!0:typeof e!=typeof a?!1:e&&a&&typeof e=="object"&&typeof a=="object"?Object.keys(a).every(i=>os(e[i],a[i])):!1}var k4=Object.prototype.hasOwnProperty;function g1(e,a){if(e===a)return e;const i=T0(e)&&T0(a);if(!i&&!(Wd(e)&&Wd(a)))return a;const l=(i?e:Object.keys(e)).length,u=i?a:Object.keys(a),d=u.length,h=i?new Array(d):{};let p=0;for(let m=0;m<d;m++){const g=i?m:u[m],v=e[g],b=a[g];if(v===b){h[g]=v,(i?m<l:k4.call(e,g))&&p++;continue}if(v===null||b===null||typeof v!="object"||typeof b!="object"){h[g]=b;continue}const x=g1(v,b);h[g]=x,x===v&&p++}return l===d&&p===l?e:h}function gu(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 Wd(e){if(!A0(e))return!1;const a=e.constructor;if(a===void 0)return!0;const i=a.prototype;return!(!A0(i)||!i.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function A0(e){return Object.prototype.toString.call(e)==="[object Object]"}function P4(e){return new Promise(a=>{Rr.setTimeout(a,e)})}function th(e,a,i){return typeof i.structuralSharing=="function"?i.structuralSharing(e,a):i.structuralSharing!==!1?g1(e,a):a}function H4(e,a,i=0){const o=[...e,a];return i&&o.length>i?o.slice(1):o}function q4(e,a,i=0){const o=[a,...e];return i&&o.length>i?o.slice(0,-1):o}var Qh=Symbol();function y1(e,a){return!e.queryFn&&a?.initialPromise?()=>a.initialPromise:!e.queryFn||e.queryFn===Qh?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function b1(e,a){return typeof e=="function"?e(...a):!!e}var V4=class extends Zi{#t;#e;#n;constructor(){super(),this.#n=e=>{if(!Lr&&window.addEventListener){const a=()=>e();return window.addEventListener("visibilitychange",a,!1),()=>{window.removeEventListener("visibilitychange",a)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()})}setFocused(e){this.#t!==e&&(this.#t=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(a=>{a(e)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},Kh=new V4;function eh(){let e,a;const i=new Promise((l,u)=>{e=l,a=u});i.status="pending",i.catch(()=>{});function o(l){Object.assign(i,l),delete i.resolve,delete i.reject}return i.resolve=l=>{o({status:"fulfilled",value:l}),e(l)},i.reject=l=>{o({status:"rejected",reason:l}),a(l)},i}var G4=U4;function F4(){let e=[],a=0,i=h=>{h()},o=h=>{h()},l=G4;const u=h=>{a?e.push(h):l(()=>{i(h)})},d=()=>{const h=e;e=[],h.length&&l(()=>{o(()=>{h.forEach(p=>{i(p)})})})};return{batch:h=>{let p;a++;try{p=h()}finally{a--,a||d()}return p},batchCalls:h=>(...p)=>{u(()=>{h(...p)})},schedule:u,setNotifyFunction:h=>{i=h},setBatchNotifyFunction:h=>{o=h},setScheduler:h=>{l=h}}}var ce=F4(),Y4=class extends Zi{#t=!0;#e;#n;constructor(){super(),this.#n=e=>{if(!Lr&&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.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(this.setOnline.bind(this))}setOnline(e){this.#t!==e&&(this.#t=e,this.listeners.forEach(i=>{i(e)}))}isOnline(){return this.#t}},yu=new Y4;function Q4(e){return Math.min(1e3*2**e,3e4)}function S1(e){return(e??"online")==="online"?yu.isOnline():!0}var nh=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function x1(e){let a=!1,i=0,o;const l=eh(),u=()=>l.status!=="pending",d=w=>{if(!u()){const C=new nh(w);b(C),e.onCancel?.(C)}},h=()=>{a=!0},p=()=>{a=!1},m=()=>Kh.isFocused()&&(e.networkMode==="always"||yu.isOnline())&&e.canRun(),g=()=>S1(e.networkMode)&&e.canRun(),v=w=>{u()||(o?.(),l.resolve(w))},b=w=>{u()||(o?.(),l.reject(w))},x=()=>new Promise(w=>{o=C=>{(u()||m())&&w(C)},e.onPause?.()}).then(()=>{o=void 0,u()||e.onContinue?.()}),S=()=>{if(u())return;let w;const C=i===0?e.initialPromise:void 0;try{w=C??e.fn()}catch(T){w=Promise.reject(T)}Promise.resolve(w).then(v).catch(T=>{if(u())return;const z=e.retry??(Lr?0:3),D=e.retryDelay??Q4,U=typeof D=="function"?D(i,T):D,B=z===!0||typeof z=="number"&&i<z||typeof z=="function"&&z(i,T);if(a||!B){b(T);return}i++,e.onFail?.(i,T),P4(U).then(()=>m()?void 0:x()).then(()=>{a?b(T):S()})})};return{promise:l,status:()=>l.status,cancel:d,continue:()=>(o?.(),l),cancelRetry:h,continueRetry:p,canStart:g,start:()=>(g()?S():x().then(S),l)}}var w1=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Jd(this.gcTime)&&(this.#t=Rr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Lr?1/0:300*1e3))}clearGcTimeout(){this.#t&&(Rr.clearTimeout(this.#t),this.#t=void 0)}},K4=class extends w1{#t;#e;#n;#r;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=O0(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const a=O0(this.options);a.data!==void 0&&(this.setData(a.data,{updatedAt:a.dataUpdatedAt,manual:!0}),this.#t=a)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,a){const i=th(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.#a?.promise;return this.#a?.cancel(e),a?a.then(Ce).catch(Ce):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(e=>fn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Qh||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Xa(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:!v1(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(a=>a.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(a=>a.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.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.#a&&(this.#s?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}async fetch(e,a){if(this.state.fetchStatus!=="idle"&&this.#a?.status()!=="rejected"){if(this.state.data!==void 0&&a?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){const h=this.observers.find(p=>p.options.queryFn);h&&this.setOptions(h.options)}const i=new AbortController,o=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(this.#s=!0,i.signal)})},l=()=>{const h=y1(this.options,a),m=(()=>{const g={client:this.#r,queryKey:this.queryKey,meta:this.meta};return o(g),g})();return this.#s=!1,this.options.persister?this.options.persister(h,m,this):h(m)},d=(()=>{const h={fetchOptions:a,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:l};return o(h),h})();this.options.behavior?.onFetch(d,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==d.fetchOptions?.meta)&&this.#i({type:"fetch",meta:d.fetchOptions?.meta}),this.#a=x1({initialPromise:a?.initialPromise,fn:d.fetchFn,onCancel:h=>{h instanceof nh&&h.revert&&this.setState({...this.#e,fetchStatus:"idle"}),i.abort()},onFail:(h,p)=>{this.#i({type:"failed",failureCount:h,error:p})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:d.options.retry,retryDelay:d.options.retryDelay,networkMode:d.options.networkMode,canRun:()=>!0});try{const h=await this.#a.start();if(h===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(h),this.#n.config.onSuccess?.(h,this),this.#n.config.onSettled?.(h,this.state.error,this),h}catch(h){if(h instanceof nh){if(h.silent)return this.#a.promise;if(h.revert){if(this.state.data===void 0)throw h;return this.state.data}}throw this.#i({type:"error",error:h}),this.#n.config.onError?.(h,this),this.#n.config.onSettled?.(this.state.data,h,this),h}finally{this.scheduleGc()}}#i(e){const a=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,...E1(i.data,this.options),fetchMeta:e.meta??null};case"success":const o={...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}};return this.#e=e.manual?o:void 0,o;case"error":const l=e.error;return{...i,error:l,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:l,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 E1(e,a){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:S1(a.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function O0(e){const a=typeof e.initialData=="function"?e.initialData():e.initialData,i=a!==void 0,o=i?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:a,dataUpdateCount:0,dataUpdatedAt:i?o??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}var X4=class extends Zi{constructor(e,a){super(),this.options=a,this.#t=e,this.#i=null,this.#s=eh(),this.bindMethods(),this.setOptions(a)}#t;#e=void 0;#n=void 0;#r=void 0;#a;#o;#s;#i;#p;#d;#h;#u;#c;#l;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),M0(this.#e,this.options)?this.#f():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ah(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ah(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#S(),this.#x(),this.#e.removeObserver(this)}setOptions(e){const a=this.options,i=this.#e;if(this.options=this.#t.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof fn(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#e.setOptions(this.options),a._defaulted&&!gu(this.options,a)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const o=this.hasListeners();o&&N0(this.#e,i,this.options,a)&&this.#f(),this.updateResult(),o&&(this.#e!==i||fn(this.options.enabled,this.#e)!==fn(a.enabled,this.#e)||Xa(this.options.staleTime,this.#e)!==Xa(a.staleTime,this.#e))&&this.#v();const l=this.#g();o&&(this.#e!==i||fn(this.options.enabled,this.#e)!==fn(a.enabled,this.#e)||l!==this.#l)&&this.#y(l)}getOptimisticResult(e){const a=this.#t.getQueryCache().build(this.#t,e),i=this.createResult(a,e);return Z4(this,i)&&(this.#r=i,this.#o=this.options,this.#a=this.#e.state),i}getCurrentResult(){return this.#r}trackResult(e,a){return new Proxy(e,{get:(i,o)=>(this.trackProp(o),a?.(o),o==="promise"&&!this.options.experimental_prefetchInRender&&this.#s.status==="pending"&&this.#s.reject(new Error("experimental_prefetchInRender feature flag is not enabled")),Reflect.get(i,o))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#e}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const a=this.#t.defaultQueryOptions(e),i=this.#t.getQueryCache().build(this.#t,a);return i.fetch().then(()=>this.createResult(i,a))}fetch(e){return this.#f({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#f(e){this.#w();let a=this.#e.fetch(this.options,e);return e?.throwOnError||(a=a.catch(Ce)),a}#v(){this.#S();const e=Xa(this.options.staleTime,this.#e);if(Lr||this.#r.isStale||!Jd(e))return;const i=v1(this.#r.dataUpdatedAt,e)+1;this.#u=Rr.setTimeout(()=>{this.#r.isStale||this.updateResult()},i)}#g(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#y(e){this.#x(),this.#l=e,!(Lr||fn(this.options.enabled,this.#e)===!1||!Jd(this.#l)||this.#l===0)&&(this.#c=Rr.setInterval(()=>{(this.options.refetchIntervalInBackground||Kh.isFocused())&&this.#f()},this.#l))}#b(){this.#v(),this.#y(this.#g())}#S(){this.#u&&(Rr.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#c&&(Rr.clearInterval(this.#c),this.#c=void 0)}createResult(e,a){const i=this.#e,o=this.options,l=this.#r,u=this.#a,d=this.#o,p=e!==i?e.state:this.#n,{state:m}=e;let g={...m},v=!1,b;if(a._optimisticResults){const V=this.hasListeners(),et=!V&&M0(e,a),J=V&&N0(e,i,a,o);(et||J)&&(g={...g,...E1(m.data,e.options)}),a._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:x,errorUpdatedAt:S,status:w}=g;b=g.data;let C=!1;if(a.placeholderData!==void 0&&b===void 0&&w==="pending"){let V;l?.isPlaceholderData&&a.placeholderData===d?.placeholderData?(V=l.data,C=!0):V=typeof a.placeholderData=="function"?a.placeholderData(this.#h?.state.data,this.#h):a.placeholderData,V!==void 0&&(w="success",b=th(l?.data,V,a),v=!0)}if(a.select&&b!==void 0&&!C)if(l&&b===u?.data&&a.select===this.#p)b=this.#d;else try{this.#p=a.select,b=a.select(b),b=th(l?.data,b,a),this.#d=b,this.#i=null}catch(V){this.#i=V}this.#i&&(x=this.#i,b=this.#d,S=Date.now(),w="error");const T=g.fetchStatus==="fetching",z=w==="pending",D=w==="error",U=z&&T,B=b!==void 0,j={status:w,fetchStatus:g.fetchStatus,isPending:z,isSuccess:w==="success",isError:D,isInitialLoading:U,isLoading:U,data:b,dataUpdatedAt:g.dataUpdatedAt,error:x,errorUpdatedAt:S,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:g.dataUpdateCount>0||g.errorUpdateCount>0,isFetchedAfterMount:g.dataUpdateCount>p.dataUpdateCount||g.errorUpdateCount>p.errorUpdateCount,isFetching:T,isRefetching:T&&!z,isLoadingError:D&&!B,isPaused:g.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:D&&B,isStale:Xh(e,a),refetch:this.refetch,promise:this.#s,isEnabled:fn(a.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const V=at=>{j.status==="error"?at.reject(j.error):j.data!==void 0&&at.resolve(j.data)},et=()=>{const at=this.#s=j.promise=eh();V(at)},J=this.#s;switch(J.status){case"pending":e.queryHash===i.queryHash&&V(J);break;case"fulfilled":(j.status==="error"||j.data!==J.value)&&et();break;case"rejected":(j.status!=="error"||j.error!==J.reason)&&et();break}}return j}updateResult(){const e=this.#r,a=this.createResult(this.#e,this.options);if(this.#a=this.#e.state,this.#o=this.options,this.#a.data!==void 0&&(this.#h=this.#e),gu(a,e))return;this.#r=a;const i=()=>{if(!e)return!0;const{notifyOnChangeProps:o}=this.options,l=typeof o=="function"?o():o;if(l==="all"||!l&&!this.#m.size)return!0;const u=new Set(l??this.#m);return this.options.throwOnError&&u.add("error"),Object.keys(this.#r).some(d=>{const h=d;return this.#r[h]!==e[h]&&u.has(h)})};this.#E({listeners:i()})}#w(){const e=this.#t.getQueryCache().build(this.#t,this.options);if(e===this.#e)return;const a=this.#e;this.#e=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.#r)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function $4(e,a){return fn(a.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&a.retryOnMount===!1)}function M0(e,a){return $4(e,a)||e.state.data!==void 0&&ah(e,a,a.refetchOnMount)}function ah(e,a,i){if(fn(a.enabled,e)!==!1&&Xa(a.staleTime,e)!=="static"){const o=typeof i=="function"?i(e):i;return o==="always"||o!==!1&&Xh(e,a)}return!1}function N0(e,a,i,o){return(e!==a||fn(o.enabled,e)===!1)&&(!i.suspense||e.state.status!=="error")&&Xh(e,i)}function Xh(e,a){return fn(a.enabled,e)!==!1&&e.isStaleByTime(Xa(a.staleTime,e))}function Z4(e,a){return!gu(e.getCurrentResult(),a)}function D0(e){return{onFetch:(a,i)=>{const o=a.options,l=a.fetchOptions?.meta?.fetchMore?.direction,u=a.state.data?.pages||[],d=a.state.data?.pageParams||[];let h={pages:[],pageParams:[]},p=0;const m=async()=>{let g=!1;const v=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(a.signal.aborted?g=!0:a.signal.addEventListener("abort",()=>{g=!0}),a.signal)})},b=y1(a.options,a.fetchOptions),x=async(S,w,C)=>{if(g)return Promise.reject();if(w==null&&S.pages.length)return Promise.resolve(S);const z=(()=>{const K={client:a.client,queryKey:a.queryKey,pageParam:w,direction:C?"backward":"forward",meta:a.options.meta};return v(K),K})(),D=await b(z),{maxPages:U}=a.options,B=C?q4:H4;return{pages:B(S.pages,D,U),pageParams:B(S.pageParams,w,U)}};if(l&&u.length){const S=l==="backward",w=S?I4:z0,C={pages:u,pageParams:d},T=w(o,C);h=await x(C,T,S)}else{const S=e??u.length;do{const w=p===0?d[0]??o.initialPageParam:z0(o,h);if(p>0&&w==null)break;h=await x(h,w),p++}while(p<S)}return h};a.options.persister?a.fetchFn=()=>a.options.persister?.(m,{client:a.client,queryKey:a.queryKey,meta:a.options.meta,signal:a.signal},i):a.fetchFn=m}}}function z0(e,{pages:a,pageParams:i}){const o=a.length-1;return a.length>0?e.getNextPageParam(a[o],a,i[o],i):void 0}function I4(e,{pages:a,pageParams:i}){return a.length>0?e.getPreviousPageParam?.(a[0],a,i[0],i):void 0}var J4=class extends w1{#t;#e;#n;#r;constructor(e){super(),this.#t=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#e=[],this.state=e.state||R1(),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.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(a=>a!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){const a=()=>{this.#a({type:"continue"})},i={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=x1({fn:()=>this.options.mutationFn?this.options.mutationFn(e,i):Promise.reject(new Error("No mutationFn found")),onFail:(u,d)=>{this.#a({type:"failed",failureCount:u,error:d})},onPause:()=>{this.#a({type:"pause"})},onContinue:a,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const o=this.state.status==="pending",l=!this.#r.canStart();try{if(o)a();else{this.#a({type:"pending",variables:e,isPaused:l}),await this.#n.config.onMutate?.(e,this,i);const d=await this.options.onMutate?.(e,i);d!==this.state.context&&this.#a({type:"pending",context:d,variables:e,isPaused:l})}const u=await this.#r.start();return await this.#n.config.onSuccess?.(u,e,this.state.context,this,i),await this.options.onSuccess?.(u,e,this.state.context,i),await this.#n.config.onSettled?.(u,null,this.state.variables,this.state.context,this,i),await this.options.onSettled?.(u,null,e,this.state.context,i),this.#a({type:"success",data:u}),u}catch(u){try{throw await this.#n.config.onError?.(u,e,this.state.context,this,i),await this.options.onError?.(u,e,this.state.context,i),await this.#n.config.onSettled?.(void 0,u,this.state.variables,this.state.context,this,i),await this.options.onSettled?.(void 0,u,e,this.state.context,i),u}finally{this.#a({type:"error",error:u})}}finally{this.#n.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.#n.notify({mutation:this,type:"updated",action:e})})}};function R1(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var W4=class extends Zi{constructor(e={}){super(),this.config=e,this.#t=new Set,this.#e=new Map,this.#n=0}#t;#e;#n;build(e,a,i){const o=new J4({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(a),state:i});return this.add(o),o}add(e){this.#t.add(e);const a=Xl(e);if(typeof a=="string"){const i=this.#e.get(a);i?i.push(e):this.#e.set(a,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#t.delete(e)){const a=Xl(e);if(typeof a=="string"){const i=this.#e.get(a);if(i)if(i.length>1){const o=i.indexOf(e);o!==-1&&i.splice(o,1)}else i[0]===e&&this.#e.delete(a)}}this.notify({type:"removed",mutation:e})}canRun(e){const a=Xl(e);if(typeof a=="string"){const o=this.#e.get(a)?.find(l=>l.state.status==="pending");return!o||o===e}else return!0}runNext(e){const a=Xl(e);return typeof a=="string"?this.#e.get(a)?.find(o=>o!==e&&o.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){ce.batch(()=>{this.#t.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#t.clear(),this.#e.clear()})}getAll(){return Array.from(this.#t)}find(e){const a={exact:!0,...e};return this.getAll().find(i=>C0(a,i))}findAll(e={}){return this.getAll().filter(a=>C0(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(Ce))))}};function Xl(e){return e.options.scope?.id}var t3=class extends Zi{#t;#e=void 0;#n;#r;constructor(a,i){super(),this.#t=a,this.setOptions(i),this.bindMethods(),this.#a()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(a){const i=this.options;this.options=this.#t.defaultMutationOptions(a),gu(this.options,i)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),i?.mutationKey&&this.options.mutationKey&&jr(i.mutationKey)!==jr(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.#a(),this.#o(a)}getCurrentResult(){return this.#e}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#a(),this.#o()}mutate(a,i){return this.#r=i,this.#n?.removeObserver(this),this.#n=this.#t.getMutationCache().build(this.#t,this.options),this.#n.addObserver(this),this.#n.execute(a)}#a(){const a=this.#n?.state??R1();this.#e={...a,isPending:a.status==="pending",isSuccess:a.status==="success",isError:a.status==="error",isIdle:a.status==="idle",mutate:this.mutate,reset:this.reset}}#o(a){ce.batch(()=>{if(this.#r&&this.hasListeners()){const i=this.#e.variables,o=this.#e.context,l={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};a?.type==="success"?(this.#r.onSuccess?.(a.data,i,o,l),this.#r.onSettled?.(a.data,null,i,o,l)):a?.type==="error"&&(this.#r.onError?.(a.error,i,o,l),this.#r.onSettled?.(void 0,a.error,i,o,l))}this.listeners.forEach(i=>{i(this.#e)})})}},e3=class extends Zi{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,a,i){const o=a.queryKey,l=a.queryHash??Yh(o,a);let u=this.get(l);return u||(u=new K4({client:e,queryKey:o,queryHash:l,options:e.defaultQueryOptions(a),state:i,defaultOptions:e.getQueryDefaults(o)}),this.add(u)),u}add(e){this.#t.has(e.queryHash)||(this.#t.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const a=this.#t.get(e.queryHash);a&&(e.destroy(),a===e&&this.#t.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){ce.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#t.get(e)}getAll(){return[...this.#t.values()]}find(e){const a={exact:!0,...e};return this.getAll().find(i=>_0(a,i))}findAll(e={}){const a=this.getAll();return Object.keys(e).length>0?a.filter(i=>_0(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()})})}},n3=class{#t;#e;#n;#r;#a;#o;#s;#i;constructor(e={}){this.#t=e.queryCache||new e3,this.#e=e.mutationCache||new W4,this.#n=e.defaultOptions||{},this.#r=new Map,this.#a=new Map,this.#o=0}mount(){this.#o++,this.#o===1&&(this.#s=Kh.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#i=yu.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#o--,this.#o===0&&(this.#s?.(),this.#s=void 0,this.#i?.(),this.#i=void 0)}isFetching(e){return this.#t.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#e.findAll({...e,status:"pending"}).length}getQueryData(e){const a=this.defaultQueryOptions({queryKey:e});return this.#t.get(a.queryHash)?.state.data}ensureQueryData(e){const a=this.defaultQueryOptions(e),i=this.#t.build(this,a),o=i.state.data;return o===void 0?this.fetchQuery(e):(e.revalidateIfStale&&i.isStaleByTime(Xa(a.staleTime,i))&&this.prefetchQuery(a),Promise.resolve(o))}getQueriesData(e){return this.#t.findAll(e).map(({queryKey:a,state:i})=>{const o=i.data;return[a,o]})}setQueryData(e,a,i){const o=this.defaultQueryOptions({queryKey:e}),u=this.#t.get(o.queryHash)?.state.data,d=B4(a,u);if(d!==void 0)return this.#t.build(this,o).setData(d,{...i,manual:!0})}setQueriesData(e,a,i){return ce.batch(()=>this.#t.findAll(e).map(({queryKey:o})=>[o,this.setQueryData(o,a,i)]))}getQueryState(e){const a=this.defaultQueryOptions({queryKey:e});return this.#t.get(a.queryHash)?.state}removeQueries(e){const a=this.#t;ce.batch(()=>{a.findAll(e).forEach(i=>{a.remove(i)})})}resetQueries(e,a){const i=this.#t;return ce.batch(()=>(i.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries({type:"active",...e},a)))}cancelQueries(e,a={}){const i={revert:!0,...a},o=ce.batch(()=>this.#t.findAll(e).map(l=>l.cancel(i)));return Promise.all(o).then(Ce).catch(Ce)}invalidateQueries(e,a={}){return ce.batch(()=>(this.#t.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},o=ce.batch(()=>this.#t.findAll(e).filter(l=>!l.isDisabled()&&!l.isStatic()).map(l=>{let u=l.fetch(void 0,i);return i.throwOnError||(u=u.catch(Ce)),l.state.fetchStatus==="paused"?Promise.resolve():u}));return Promise.all(o).then(Ce)}fetchQuery(e){const a=this.defaultQueryOptions(e);a.retry===void 0&&(a.retry=!1);const i=this.#t.build(this,a);return i.isStaleByTime(Xa(a.staleTime,i))?i.fetch(a):Promise.resolve(i.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ce).catch(Ce)}fetchInfiniteQuery(e){return e.behavior=D0(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ce).catch(Ce)}ensureInfiniteQueryData(e){return e.behavior=D0(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return yu.isOnline()?this.#e.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#t}getMutationCache(){return this.#e}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,a){this.#r.set(jr(e),{queryKey:e,defaultOptions:a})}getQueryDefaults(e){const a=[...this.#r.values()],i={};return a.forEach(o=>{os(e,o.queryKey)&&Object.assign(i,o.defaultOptions)}),i}setMutationDefaults(e,a){this.#a.set(jr(e),{mutationKey:e,defaultOptions:a})}getMutationDefaults(e){const a=[...this.#a.values()],i={};return a.forEach(o=>{os(e,o.mutationKey)&&Object.assign(i,o.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=Yh(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===Qh&&(a.enabled=!1),a}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#t.clear(),this.#e.clear()}},_1=R.createContext(void 0),C1=e=>{const a=R.useContext(_1);if(!a)throw new Error("No QueryClient set, use QueryClientProvider to set one");return a},a3=({client:e,children:a})=>(R.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),_.jsx(_1.Provider,{value:e,children:a})),T1=R.createContext(!1),r3=()=>R.useContext(T1);T1.Provider;function i3(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var o3=R.createContext(i3()),s3=()=>R.useContext(o3),l3=(e,a)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(a.isReset()||(e.retryOnMount=!1))},u3=e=>{R.useEffect(()=>{e.clearReset()},[e])},c3=({result:e,errorResetBoundary:a,throwOnError:i,query:o,suspense:l})=>e.isError&&!a.isReset()&&!e.isFetching&&o&&(l&&e.data===void 0||b1(i,[e.error,o])),f3=e=>{if(e.suspense){const i=l=>l==="static"?l:Math.max(l??1e3,1e3),o=e.staleTime;e.staleTime=typeof o=="function"?(...l)=>i(o(...l)):i(o),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},d3=(e,a)=>e.isLoading&&e.isFetching&&!a,h3=(e,a)=>e?.suspense&&a.isPending,L0=(e,a,i)=>a.fetchOptimistic(e).catch(()=>{i.clearReset()});function m3(e,a,i){const o=r3(),l=s3(),u=C1(),d=u.defaultQueryOptions(e);u.getDefaultOptions().queries?._experimental_beforeQuery?.(d),d._optimisticResults=o?"isRestoring":"optimistic",f3(d),l3(d,l),u3(l);const h=!u.getQueryCache().get(d.queryHash),[p]=R.useState(()=>new a(u,d)),m=p.getOptimisticResult(d),g=!o&&e.subscribed!==!1;if(R.useSyncExternalStore(R.useCallback(v=>{const b=g?p.subscribe(ce.batchCalls(v)):Ce;return p.updateResult(),b},[p,g]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),R.useEffect(()=>{p.setOptions(d)},[d,p]),h3(d,m))throw L0(d,p,l);if(c3({result:m,errorResetBoundary:l,throwOnError:d.throwOnError,query:u.getQueryCache().get(d.queryHash),suspense:d.suspense}))throw m.error;return u.getDefaultOptions().queries?._experimental_afterQuery?.(d,m),d.experimental_prefetchInRender&&!Lr&&d3(m,o)&&(h?L0(d,p,l):u.getQueryCache().get(d.queryHash)?.promise)?.catch(Ce).finally(()=>{p.updateResult()}),d.notifyOnChangeProps?m:p.trackResult(m)}function p3(e,a){return m3(e,X4)}function v3(e,a){const i=C1(),[o]=R.useState(()=>new t3(i,e));R.useEffect(()=>{o.setOptions(e)},[o,e]);const l=R.useSyncExternalStore(R.useCallback(d=>o.subscribe(ce.batchCalls(d)),[o]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),u=R.useCallback((d,h)=>{o.mutate(d,h).catch(Ce)},[o]);if(l.error&&b1(o.options.throwOnError,[l.error]))throw l.error;return{...l,mutate:u,mutateAsync:l.mutate}}function g3(){return _.jsx("div",{className:"h-screen grid place-items-center",children:_.jsx(ub,{className:"size-8 animate-spin"})})}function y3({className:e,...a}){const{setAuthenticated:i}=p1(),[o,l]=R.useState(""),[u,d]=R.useState(""),h=Fh(),{isPending:p,mutate:m}=v3({mutationFn:async()=>h.login(o,u),onError(){w0.error("Invalid credentials",{description:"The credentials you provided are invalid."})},onSuccess(){w0.success("Login successful",{description:"You have successfully logged in."}),i(!0)}});return p?_.jsx(g3,{}):_.jsx("div",{className:Rt("flex flex-col gap-6 w-[20%]",e),...a,children:_.jsxs(ZM,{children:[_.jsxs(IM,{children:[_.jsx(JM,{className:"text-2xl",children:"Login"}),_.jsx(WM,{children:"Enter your credentials below to proceed"})]}),_.jsx(t4,{children:_.jsxs("div",{className:"flex flex-col gap-6",children:[_.jsxs("div",{className:"grid gap-2",children:[_.jsx(b0,{htmlFor:"username",children:"Username"}),_.jsx(Ny,{id:"username",type:"username",placeholder:"Enter your username",required:!0,value:o,onChange:g=>l(g.target.value)})]}),_.jsxs("div",{className:"grid gap-2",children:[_.jsx("div",{className:"flex items-center",children:_.jsx(b0,{htmlFor:"password",children:"Password"})}),_.jsx(Ny,{id:"password",type:"password",required:!0,value:u,onChange:g=>d(g.target.value)})]}),_.jsx(Cb,{type:"button",className:"w-full",onClick:()=>{m()},children:"Login"})]})})]})})}function b3({children:e}){const{authenticated:a,setAuthenticated:i}=p1(),o=Fh(),{isLoading:l,isError:u}=p3({queryKey:[],enabled:!a,queryFn:async()=>{const d=await o.fetchMe();return i(!!d),d},refetchOnWindowFocus:!0});return l?_.jsx("div",{className:"h-screen grid place-items-center",children:_.jsx(ub,{className:"size-8 animate-spin"})}):u?_.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(y3,{})})}function S3({...e}){return _.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function x3({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 Td({className:e,...a}){return _.jsx("li",{"data-slot":"breadcrumb-item",className:Rt("inline-flex items-center gap-1.5",e),...a})}function j0({asChild:e,className:a,...i}){const o=e?us:"a";return _.jsx(o,{"data-slot":"breadcrumb-link",className:Rt("hover:text-foreground transition-colors",a),...i})}function w3({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 U0({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(kR,{})})}function E3(){const{toggleSidebar:e}=Bh();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(Cb,{className:"h-8 w-8",variant:"ghost",size:"icon",onClick:e,children:_.jsx(HR,{})}),_.jsx(m_,{orientation:"vertical",className:"mr-2 h-4"}),_.jsx(S3,{className:"hidden sm:block",children:_.jsxs(x3,{children:[_.jsx(Td,{children:_.jsx(j0,{href:"#",children:"/"})}),_.jsx(U0,{}),_.jsx(Td,{children:_.jsx(w3,{children:"CommandKit"})}),_.jsx(U0,{}),_.jsx(Td,{children:_.jsx(j0,{href:"#",children:"DevTools"})})]})})]})})}var R3=(e,a,i,o,l,u,d,h)=>{let p=document.documentElement,m=["light","dark"];function g(x){(Array.isArray(e)?e:[e]).forEach(S=>{let w=S==="class",C=w&&u?l.map(T=>u[T]||T):l;w?(p.classList.remove(...C),p.classList.add(u&&u[x]?u[x]:x)):p.setAttribute(S,x)}),v(x)}function v(x){h&&m.includes(x)&&(p.style.colorScheme=x)}function b(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(o)g(o);else try{let x=localStorage.getItem(a)||i,S=d&&x==="system"?b():x;g(S)}catch{}},B0=["light","dark"],A1="(prefers-color-scheme: dark)",_3=typeof window>"u",$h=R.createContext(void 0),C3={setTheme:e=>{},themes:[]},T3=()=>{var e;return(e=R.useContext($h))!=null?e:C3},A3=e=>R.useContext($h)?R.createElement(R.Fragment,null,e.children):R.createElement(M3,{...e}),O3=["light","dark"],M3=({forcedTheme:e,disableTransitionOnChange:a=!1,enableSystem:i=!0,enableColorScheme:o=!0,storageKey:l="theme",themes:u=O3,defaultTheme:d=i?"system":"light",attribute:h="data-theme",value:p,children:m,nonce:g,scriptProps:v})=>{let[b,x]=R.useState(()=>D3(l,d)),[S,w]=R.useState(()=>b==="system"?Ad():b),C=p?Object.values(p):u,T=R.useCallback(B=>{let K=B;if(!K)return;B==="system"&&i&&(K=Ad());let j=p?p[K]:K,V=a?z3(g):null,et=document.documentElement,J=at=>{at==="class"?(et.classList.remove(...C),j&&et.classList.add(j)):at.startsWith("data-")&&(j?et.setAttribute(at,j):et.removeAttribute(at))};if(Array.isArray(h)?h.forEach(J):J(h),o){let at=B0.includes(d)?d:null,rt=B0.includes(K)?K:at;et.style.colorScheme=rt}V?.()},[g]),z=R.useCallback(B=>{let K=typeof B=="function"?B(b):B;x(K);try{localStorage.setItem(l,K)}catch{}},[b]),D=R.useCallback(B=>{let K=Ad(B);w(K),b==="system"&&i&&!e&&T("system")},[b,e]);R.useEffect(()=>{let B=window.matchMedia(A1);return B.addListener(D),D(B),()=>B.removeListener(D)},[D]),R.useEffect(()=>{let B=K=>{K.key===l&&(K.newValue?x(K.newValue):z(d))};return window.addEventListener("storage",B),()=>window.removeEventListener("storage",B)},[z]),R.useEffect(()=>{T(e??b)},[e,b]);let U=R.useMemo(()=>({theme:b,setTheme:z,forcedTheme:e,resolvedTheme:b==="system"?S:b,themes:i?[...u,"system"]:u,systemTheme:i?S:void 0}),[b,z,e,S,i,u]);return R.createElement($h.Provider,{value:U},R.createElement(N3,{forcedTheme:e,storageKey:l,attribute:h,enableSystem:i,enableColorScheme:o,defaultTheme:d,value:p,themes:u,nonce:g,scriptProps:v}),m)},N3=R.memo(({forcedTheme:e,storageKey:a,attribute:i,enableSystem:o,enableColorScheme:l,defaultTheme:u,value:d,themes:h,nonce:p,scriptProps:m})=>{let g=JSON.stringify([i,a,u,e,h,d,o,l]).slice(1,-1);return R.createElement("script",{...m,suppressHydrationWarning:!0,nonce:typeof window>"u"?p:"",dangerouslySetInnerHTML:{__html:`(${R3.toString()})(${g})`}})}),D3=(e,a)=>{if(_3)return;let i;try{i=localStorage.getItem(e)||void 0}catch{}return i||a},z3=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)}},Ad=e=>(e||(e=window.matchMedia(A1)),e.matches?"dark":"light");const L3=({...e})=>{const{theme:a="system"}=T3();return _.jsx(z4,{theme:a,className:"toaster group",style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)"},...e})},Br=yR({head:()=>({meta:[{charSet:"utf-8"},{name:"viewport",content:"width=device-width, initial-scale=1"},{title:"CommandKit DevTools"}]}),component:j3});function j3(){return _.jsxs(A3,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!1,children:[_.jsx(L3,{}),_.jsx(XM,{children:_.jsx(b3,{children:_.jsx("div",{className:"[--header-height:calc(theme(spacing.14))]",children:_.jsxs(FA,{className:"flex flex-col",children:[_.jsx(E3,{}),_.jsxs("div",{className:"flex flex-1",children:[_.jsx($M,{}),_.jsx(QA,{children:_.jsx(ib,{})})]})]})})})})]})}const U3="modulepreload",B3=function(e){return"/"+e},k0={},Ii=function(a,i,o){let l=Promise.resolve();if(i&&i.length>0){let p=function(m){return Promise.all(m.map(g=>Promise.resolve(g).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),h=d?.nonce||d?.getAttribute("nonce");l=p(i.map(m=>{if(m=B3(m),m in k0)return;k0[m]=!0;const g=m.endsWith(".css"),v=g?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${v}`))return;const b=document.createElement("link");if(b.rel=g?"stylesheet":U3,g||(b.as="script"),b.crossOrigin="",b.href=m,h&&b.setAttribute("nonce",h),document.head.appendChild(b),g)return new Promise((x,S)=>{b.addEventListener("load",x),b.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${m}`)))})}))}function u(d){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=d,window.dispatchEvent(h),!h.defaultPrevented)throw d}return l.then(d=>{for(const h of d||[])h.status==="rejected"&&u(h.reason);return a().catch(u)})},k3=()=>Ii(()=>import("./plugins-DuiXuXAP.js"),[]),P3=$a("/plugins")({component:Gi(k3,"component")}),H3=()=>Ii(()=>import("./guilds-4Gzs0Pyx.js"),[]),q3=$a("/guilds")({component:Gi(H3,"component")}),V3=()=>Ii(()=>import("./feature-flags-CIHLAAwR.js"),[]),G3=$a("/feature-flags")({component:Gi(V3,"component")}),F3=()=>Ii(()=>import("./events-BB_EVuWS.js"),[]),Y3=$a("/events")({component:Gi(F3,"component")}),Q3=()=>Ii(()=>import("./commands-C4IhTcJR.js"),[]),K3=$a("/commands")({component:Gi(Q3,"component")}),X3=()=>Ii(()=>import("./index-BkfJb3Nf.js"),[]),$3=$a("/")({component:Gi(X3,"component")}),Z3=P3.update({id:"/plugins",path:"/plugins",getParentRoute:()=>Br}),I3=q3.update({id:"/guilds",path:"/guilds",getParentRoute:()=>Br}),J3=G3.update({id:"/feature-flags",path:"/feature-flags",getParentRoute:()=>Br}),W3=Y3.update({id:"/events",path:"/events",getParentRoute:()=>Br}),tN=K3.update({id:"/commands",path:"/commands",getParentRoute:()=>Br}),eN=$3.update({id:"/",path:"/",getParentRoute:()=>Br}),nN={IndexRoute:eN,CommandsRoute:tN,EventsRoute:W3,FeatureFlagsRoute:J3,GuildsRoute:I3,PluginsRoute:Z3},aN=Br._addFileChildren(nN)._addFileTypes(),rN=TR({routeTree:aN,defaultPreload:"intent",defaultStaleTime:5e3,scrollRestoration:!0,defaultViewTransition:!0}),iN=new n3;$w.createRoot(document.getElementById("root")).render(_.jsx(R.StrictMode,{children:_.jsx(a3,{client:iN,children:_.jsx(MR,{router:rN})})}));export{cO as A,mO as B,ZM as C,g3 as L,p3 as a,IM as b,fO as c,dO as d,t4 as e,JM as f,P0 as g,WM as h,Ja as i,_ as j,kR as k,CN as l,Vi as m,Cb as n,R as r,Fh as u};
@@ -1 +1 @@
1
- import{g as X,u as tt,a as et,j as y,L as rt,B as nt}from"./index-IZ8meTaT.js";var I={exports:{}},st=I.exports,V;function it(){return V||(V=1,(function(k,H){(function(N,D){k.exports=D()})(st,(function(){var N=1e3,D=6e4,g=36e5,U="millisecond",_="second",O="minute",b="hour",v="day",C="week",m="month",J="quarter",M="year",j="date",Z="Invalid Date",P=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,Q=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,K={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(s){var r=["th","st","nd","rd"],t=s%100;return"["+s+(r[(t-20)%10]||r[t]||r[0])+"]"}},q=function(s,r,t){var n=String(s);return!n||n.length>=r?s:""+Array(r+1-n.length).join(t)+s},G={s:q,z:function(s){var r=-s.utcOffset(),t=Math.abs(r),n=Math.floor(t/60),e=t%60;return(r<=0?"+":"-")+q(n,2,"0")+":"+q(e,2,"0")},m:function s(r,t){if(r.date()<t.date())return-s(t,r);var n=12*(t.year()-r.year())+(t.month()-r.month()),e=r.clone().add(n,m),i=t-e<0,a=r.clone().add(n+(i?-1:1),m);return+(-(n+(t-e)/(i?e-a:a-e))||0)},a:function(s){return s<0?Math.ceil(s)||0:Math.floor(s)},p:function(s){return{M:m,y:M,w:C,d:v,D:j,h:b,m:O,s:_,ms:U,Q:J}[s]||String(s||"").toLowerCase().replace(/s$/,"")},u:function(s){return s===void 0}},T="en",x={};x[T]=K;var z="$isDayjsObject",R=function(s){return s instanceof F||!(!s||!s[z])},W=function s(r,t,n){var e;if(!r)return T;if(typeof r=="string"){var i=r.toLowerCase();x[i]&&(e=i),t&&(x[i]=t,e=i);var a=r.split("-");if(!e&&a.length>1)return s(a[0])}else{var o=r.name;x[o]=r,e=o}return!n&&e&&(T=e),e||!n&&T},f=function(s,r){if(R(s))return s.clone();var t=typeof r=="object"?r:{};return t.date=s,t.args=arguments,new F(t)},u=G;u.l=W,u.i=R,u.w=function(s,r){return f(s,{locale:r.$L,utc:r.$u,x:r.$x,$offset:r.$offset})};var F=(function(){function s(t){this.$L=W(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[z]=!0}var r=s.prototype;return r.parse=function(t){this.$d=(function(n){var e=n.date,i=n.utc;if(e===null)return new Date(NaN);if(u.u(e))return new Date;if(e instanceof Date)return new Date(e);if(typeof e=="string"&&!/Z$/i.test(e)){var a=e.match(P);if(a){var o=a[2]-1||0,c=(a[7]||"0").substring(0,3);return i?new Date(Date.UTC(a[1],o,a[3]||1,a[4]||0,a[5]||0,a[6]||0,c)):new Date(a[1],o,a[3]||1,a[4]||0,a[5]||0,a[6]||0,c)}}return new Date(e)})(t),this.init()},r.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},r.$utils=function(){return u},r.isValid=function(){return this.$d.toString()!==Z},r.isSame=function(t,n){var e=f(t);return this.startOf(n)<=e&&e<=this.endOf(n)},r.isAfter=function(t,n){return f(t)<this.startOf(n)},r.isBefore=function(t,n){return this.endOf(n)<f(t)},r.$g=function(t,n,e){return u.u(t)?this[n]:this.set(e,t)},r.unix=function(){return Math.floor(this.valueOf()/1e3)},r.valueOf=function(){return this.$d.getTime()},r.startOf=function(t,n){var e=this,i=!!u.u(n)||n,a=u.p(t),o=function(w,l){var p=u.w(e.$u?Date.UTC(e.$y,l,w):new Date(e.$y,l,w),e);return i?p:p.endOf(v)},c=function(w,l){return u.w(e.toDate()[w].apply(e.toDate("s"),(i?[0,0,0,0]:[23,59,59,999]).slice(l)),e)},d=this.$W,h=this.$M,$=this.$D,Y="set"+(this.$u?"UTC":"");switch(a){case M:return i?o(1,0):o(31,11);case m:return i?o(1,h):o(0,h+1);case C:var S=this.$locale().weekStart||0,L=(d<S?d+7:d)-S;return o(i?$-L:$+(6-L),h);case v:case j:return c(Y+"Hours",0);case b:return c(Y+"Minutes",1);case O:return c(Y+"Seconds",2);case _:return c(Y+"Milliseconds",3);default:return this.clone()}},r.endOf=function(t){return this.startOf(t,!1)},r.$set=function(t,n){var e,i=u.p(t),a="set"+(this.$u?"UTC":""),o=(e={},e[v]=a+"Date",e[j]=a+"Date",e[m]=a+"Month",e[M]=a+"FullYear",e[b]=a+"Hours",e[O]=a+"Minutes",e[_]=a+"Seconds",e[U]=a+"Milliseconds",e)[i],c=i===v?this.$D+(n-this.$W):n;if(i===m||i===M){var d=this.clone().set(j,1);d.$d[o](c),d.init(),this.$d=d.set(j,Math.min(this.$D,d.daysInMonth())).$d}else o&&this.$d[o](c);return this.init(),this},r.set=function(t,n){return this.clone().$set(t,n)},r.get=function(t){return this[u.p(t)]()},r.add=function(t,n){var e,i=this;t=Number(t);var a=u.p(n),o=function(h){var $=f(i);return u.w($.date($.date()+Math.round(h*t)),i)};if(a===m)return this.set(m,this.$M+t);if(a===M)return this.set(M,this.$y+t);if(a===v)return o(1);if(a===C)return o(7);var c=(e={},e[O]=D,e[b]=g,e[_]=N,e)[a]||1,d=this.$d.getTime()+t*c;return u.w(d,this)},r.subtract=function(t,n){return this.add(-1*t,n)},r.format=function(t){var n=this,e=this.$locale();if(!this.isValid())return e.invalidDate||Z;var i=t||"YYYY-MM-DDTHH:mm:ssZ",a=u.z(this),o=this.$H,c=this.$m,d=this.$M,h=e.weekdays,$=e.months,Y=e.meridiem,S=function(l,p,A,E){return l&&(l[p]||l(n,i))||A[p].slice(0,E)},L=function(l){return u.s(o%12||12,l,"0")},w=Y||function(l,p,A){var E=l<12?"AM":"PM";return A?E.toLowerCase():E};return i.replace(Q,(function(l,p){return p||(function(A){switch(A){case"YY":return String(n.$y).slice(-2);case"YYYY":return u.s(n.$y,4,"0");case"M":return d+1;case"MM":return u.s(d+1,2,"0");case"MMM":return S(e.monthsShort,d,$,3);case"MMMM":return S($,d);case"D":return n.$D;case"DD":return u.s(n.$D,2,"0");case"d":return String(n.$W);case"dd":return S(e.weekdaysMin,n.$W,h,2);case"ddd":return S(e.weekdaysShort,n.$W,h,3);case"dddd":return h[n.$W];case"H":return String(o);case"HH":return u.s(o,2,"0");case"h":return L(1);case"hh":return L(2);case"a":return w(o,c,!0);case"A":return w(o,c,!1);case"m":return String(c);case"mm":return u.s(c,2,"0");case"s":return String(n.$s);case"ss":return u.s(n.$s,2,"0");case"SSS":return u.s(n.$ms,3,"0");case"Z":return a}return null})(l)||a.replace(":","")}))},r.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},r.diff=function(t,n,e){var i,a=this,o=u.p(n),c=f(t),d=(c.utcOffset()-this.utcOffset())*D,h=this-c,$=function(){return u.m(a,c)};switch(o){case M:i=$()/12;break;case m:i=$();break;case J:i=$()/3;break;case C:i=(h-d)/6048e5;break;case v:i=(h-d)/864e5;break;case b:i=h/g;break;case O:i=h/D;break;case _:i=h/N;break;default:i=h}return e?i:u.a(i)},r.daysInMonth=function(){return this.endOf(m).$D},r.$locale=function(){return x[this.$L]},r.locale=function(t,n){if(!t)return this.$L;var e=this.clone(),i=W(t,n,!0);return i&&(e.$L=i),e},r.clone=function(){return u.w(this.$d,this)},r.toDate=function(){return new Date(this.valueOf())},r.toJSON=function(){return this.isValid()?this.toISOString():null},r.toISOString=function(){return this.$d.toISOString()},r.toString=function(){return this.$d.toUTCString()},s})(),B=F.prototype;return f.prototype=B,[["$ms",U],["$s",_],["$m",O],["$H",b],["$W",v],["$M",m],["$y",M],["$D",j]].forEach((function(s){B[s[1]]=function(r){return this.$g(r,s[0],s[1])}})),f.extend=function(s,r){return s.$i||(s(r,F,f),s.$i=!0),f},f.locale=W,f.isDayjs=R,f.unix=function(s){return f(1e3*s)},f.en=x[T],f.Ls=x,f.p={},f}))})(I)),I.exports}var at=it();const ut=X(at),ot="YYYY-MM-DD HH:mm:ss";function ct(k,H=ot){return ut(k).format(H)}function dt(){const k=tt(),{data:H,isLoading:N,isError:D}=et({queryKey:["plugins"],queryFn:async()=>await k.plugins.fetch()});return N||!H?y.jsx(rt,{}):D?y.jsx("div",{className:"h-screen grid place-items-center",children:y.jsx("h1",{className:"text-2xl text-red-500",children:"An error occurred while fetching plugins data."})}):y.jsxs("div",{className:"p-4",children:[y.jsx("h1",{className:"text-2xl font-bold mb-6",children:"Plugins"}),y.jsx("div",{className:"grid grid-cols-3 gap-4 py-4",children:H.map(g=>y.jsxs("div",{className:"border p-4 rounded",children:[y.jsx("h2",{className:"text-lg font-semibold",children:g.name}),y.jsx(nt,{variant:"outline",className:"text-sm text-gray-500 mt-2 font-mono",children:g.id}),y.jsxs("p",{className:"text-muted-foreground text-xs mt-2 font-medium",children:["Registered at ",ct(g.loadedAt)]})]},g.id))})]})}export{dt as component};
1
+ import{g as X,u as tt,a as et,j as y,L as rt,B as nt}from"./index-BozYQe_u.js";var I={exports:{}},st=I.exports,V;function it(){return V||(V=1,(function(k,H){(function(N,D){k.exports=D()})(st,(function(){var N=1e3,D=6e4,g=36e5,U="millisecond",_="second",O="minute",b="hour",v="day",C="week",m="month",J="quarter",M="year",j="date",Z="Invalid Date",P=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,Q=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,K={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(s){var r=["th","st","nd","rd"],t=s%100;return"["+s+(r[(t-20)%10]||r[t]||r[0])+"]"}},q=function(s,r,t){var n=String(s);return!n||n.length>=r?s:""+Array(r+1-n.length).join(t)+s},G={s:q,z:function(s){var r=-s.utcOffset(),t=Math.abs(r),n=Math.floor(t/60),e=t%60;return(r<=0?"+":"-")+q(n,2,"0")+":"+q(e,2,"0")},m:function s(r,t){if(r.date()<t.date())return-s(t,r);var n=12*(t.year()-r.year())+(t.month()-r.month()),e=r.clone().add(n,m),i=t-e<0,a=r.clone().add(n+(i?-1:1),m);return+(-(n+(t-e)/(i?e-a:a-e))||0)},a:function(s){return s<0?Math.ceil(s)||0:Math.floor(s)},p:function(s){return{M:m,y:M,w:C,d:v,D:j,h:b,m:O,s:_,ms:U,Q:J}[s]||String(s||"").toLowerCase().replace(/s$/,"")},u:function(s){return s===void 0}},T="en",x={};x[T]=K;var z="$isDayjsObject",R=function(s){return s instanceof F||!(!s||!s[z])},W=function s(r,t,n){var e;if(!r)return T;if(typeof r=="string"){var i=r.toLowerCase();x[i]&&(e=i),t&&(x[i]=t,e=i);var a=r.split("-");if(!e&&a.length>1)return s(a[0])}else{var o=r.name;x[o]=r,e=o}return!n&&e&&(T=e),e||!n&&T},f=function(s,r){if(R(s))return s.clone();var t=typeof r=="object"?r:{};return t.date=s,t.args=arguments,new F(t)},u=G;u.l=W,u.i=R,u.w=function(s,r){return f(s,{locale:r.$L,utc:r.$u,x:r.$x,$offset:r.$offset})};var F=(function(){function s(t){this.$L=W(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[z]=!0}var r=s.prototype;return r.parse=function(t){this.$d=(function(n){var e=n.date,i=n.utc;if(e===null)return new Date(NaN);if(u.u(e))return new Date;if(e instanceof Date)return new Date(e);if(typeof e=="string"&&!/Z$/i.test(e)){var a=e.match(P);if(a){var o=a[2]-1||0,c=(a[7]||"0").substring(0,3);return i?new Date(Date.UTC(a[1],o,a[3]||1,a[4]||0,a[5]||0,a[6]||0,c)):new Date(a[1],o,a[3]||1,a[4]||0,a[5]||0,a[6]||0,c)}}return new Date(e)})(t),this.init()},r.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},r.$utils=function(){return u},r.isValid=function(){return this.$d.toString()!==Z},r.isSame=function(t,n){var e=f(t);return this.startOf(n)<=e&&e<=this.endOf(n)},r.isAfter=function(t,n){return f(t)<this.startOf(n)},r.isBefore=function(t,n){return this.endOf(n)<f(t)},r.$g=function(t,n,e){return u.u(t)?this[n]:this.set(e,t)},r.unix=function(){return Math.floor(this.valueOf()/1e3)},r.valueOf=function(){return this.$d.getTime()},r.startOf=function(t,n){var e=this,i=!!u.u(n)||n,a=u.p(t),o=function(w,l){var p=u.w(e.$u?Date.UTC(e.$y,l,w):new Date(e.$y,l,w),e);return i?p:p.endOf(v)},c=function(w,l){return u.w(e.toDate()[w].apply(e.toDate("s"),(i?[0,0,0,0]:[23,59,59,999]).slice(l)),e)},d=this.$W,h=this.$M,$=this.$D,Y="set"+(this.$u?"UTC":"");switch(a){case M:return i?o(1,0):o(31,11);case m:return i?o(1,h):o(0,h+1);case C:var S=this.$locale().weekStart||0,L=(d<S?d+7:d)-S;return o(i?$-L:$+(6-L),h);case v:case j:return c(Y+"Hours",0);case b:return c(Y+"Minutes",1);case O:return c(Y+"Seconds",2);case _:return c(Y+"Milliseconds",3);default:return this.clone()}},r.endOf=function(t){return this.startOf(t,!1)},r.$set=function(t,n){var e,i=u.p(t),a="set"+(this.$u?"UTC":""),o=(e={},e[v]=a+"Date",e[j]=a+"Date",e[m]=a+"Month",e[M]=a+"FullYear",e[b]=a+"Hours",e[O]=a+"Minutes",e[_]=a+"Seconds",e[U]=a+"Milliseconds",e)[i],c=i===v?this.$D+(n-this.$W):n;if(i===m||i===M){var d=this.clone().set(j,1);d.$d[o](c),d.init(),this.$d=d.set(j,Math.min(this.$D,d.daysInMonth())).$d}else o&&this.$d[o](c);return this.init(),this},r.set=function(t,n){return this.clone().$set(t,n)},r.get=function(t){return this[u.p(t)]()},r.add=function(t,n){var e,i=this;t=Number(t);var a=u.p(n),o=function(h){var $=f(i);return u.w($.date($.date()+Math.round(h*t)),i)};if(a===m)return this.set(m,this.$M+t);if(a===M)return this.set(M,this.$y+t);if(a===v)return o(1);if(a===C)return o(7);var c=(e={},e[O]=D,e[b]=g,e[_]=N,e)[a]||1,d=this.$d.getTime()+t*c;return u.w(d,this)},r.subtract=function(t,n){return this.add(-1*t,n)},r.format=function(t){var n=this,e=this.$locale();if(!this.isValid())return e.invalidDate||Z;var i=t||"YYYY-MM-DDTHH:mm:ssZ",a=u.z(this),o=this.$H,c=this.$m,d=this.$M,h=e.weekdays,$=e.months,Y=e.meridiem,S=function(l,p,A,E){return l&&(l[p]||l(n,i))||A[p].slice(0,E)},L=function(l){return u.s(o%12||12,l,"0")},w=Y||function(l,p,A){var E=l<12?"AM":"PM";return A?E.toLowerCase():E};return i.replace(Q,(function(l,p){return p||(function(A){switch(A){case"YY":return String(n.$y).slice(-2);case"YYYY":return u.s(n.$y,4,"0");case"M":return d+1;case"MM":return u.s(d+1,2,"0");case"MMM":return S(e.monthsShort,d,$,3);case"MMMM":return S($,d);case"D":return n.$D;case"DD":return u.s(n.$D,2,"0");case"d":return String(n.$W);case"dd":return S(e.weekdaysMin,n.$W,h,2);case"ddd":return S(e.weekdaysShort,n.$W,h,3);case"dddd":return h[n.$W];case"H":return String(o);case"HH":return u.s(o,2,"0");case"h":return L(1);case"hh":return L(2);case"a":return w(o,c,!0);case"A":return w(o,c,!1);case"m":return String(c);case"mm":return u.s(c,2,"0");case"s":return String(n.$s);case"ss":return u.s(n.$s,2,"0");case"SSS":return u.s(n.$ms,3,"0");case"Z":return a}return null})(l)||a.replace(":","")}))},r.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},r.diff=function(t,n,e){var i,a=this,o=u.p(n),c=f(t),d=(c.utcOffset()-this.utcOffset())*D,h=this-c,$=function(){return u.m(a,c)};switch(o){case M:i=$()/12;break;case m:i=$();break;case J:i=$()/3;break;case C:i=(h-d)/6048e5;break;case v:i=(h-d)/864e5;break;case b:i=h/g;break;case O:i=h/D;break;case _:i=h/N;break;default:i=h}return e?i:u.a(i)},r.daysInMonth=function(){return this.endOf(m).$D},r.$locale=function(){return x[this.$L]},r.locale=function(t,n){if(!t)return this.$L;var e=this.clone(),i=W(t,n,!0);return i&&(e.$L=i),e},r.clone=function(){return u.w(this.$d,this)},r.toDate=function(){return new Date(this.valueOf())},r.toJSON=function(){return this.isValid()?this.toISOString():null},r.toISOString=function(){return this.$d.toISOString()},r.toString=function(){return this.$d.toUTCString()},s})(),B=F.prototype;return f.prototype=B,[["$ms",U],["$s",_],["$m",O],["$H",b],["$W",v],["$M",m],["$y",M],["$D",j]].forEach((function(s){B[s[1]]=function(r){return this.$g(r,s[0],s[1])}})),f.extend=function(s,r){return s.$i||(s(r,F,f),s.$i=!0),f},f.locale=W,f.isDayjs=R,f.unix=function(s){return f(1e3*s)},f.en=x[T],f.Ls=x,f.p={},f}))})(I)),I.exports}var at=it();const ut=X(at),ot="YYYY-MM-DD HH:mm:ss";function ct(k,H=ot){return ut(k).format(H)}function dt(){const k=tt(),{data:H,isLoading:N,isError:D}=et({queryKey:["plugins"],queryFn:async()=>await k.plugins.fetch()});return N||!H?y.jsx(rt,{}):D?y.jsx("div",{className:"h-screen grid place-items-center",children:y.jsx("h1",{className:"text-2xl text-red-500",children:"An error occurred while fetching plugins data."})}):y.jsxs("div",{className:"p-4",children:[y.jsx("h1",{className:"text-2xl font-bold mb-6",children:"Plugins"}),y.jsx("div",{className:"grid grid-cols-3 gap-4 py-4",children:H.map(g=>y.jsxs("div",{className:"border p-4 rounded",children:[y.jsx("h2",{className:"text-lg font-semibold",children:g.name}),y.jsx(nt,{variant:"outline",className:"text-sm text-gray-500 mt-2 font-mono",children:g.id}),y.jsxs("p",{className:"text-muted-foreground text-xs mt-2 font-medium",children:["Registered at ",ct(g.loadedAt)]})]},g.id))})]})}export{dt as component};
package/ui/index.html CHANGED
@@ -11,7 +11,7 @@
11
11
  <style>
12
12
  @import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap');
13
13
  </style>
14
- <script type="module" crossorigin src="/assets/index-IZ8meTaT.js"></script>
14
+ <script type="module" crossorigin src="/assets/index-BozYQe_u.js"></script>
15
15
  <link rel="stylesheet" crossorigin href="/assets/index-Dqabizwh.css">
16
16
  </head>
17
17
  <body>