import{r as b,R as G,a as Q0,b as J0,c as lC,d as W0,e as nd,u as np,L as Fh,N as eu,O as ew,f as cC,g as uC,h as dC,i as kn,B as fC}from"./react-B75e6Si-.js";(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const u of o)if(u.type==="childList")for(const d of u.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&s(d)}).observe(document,{childList:!0,subtree:!0});function r(o){const u={};return o.integrity&&(u.integrity=o.integrity),o.referrerPolicy&&(u.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?u.credentials="include":o.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function s(o){if(o.ep)return;o.ep=!0;const u=r(o);fetch(o.href,u)}})();var Zh={exports:{}},sl={};var Gb;function hC(){if(Gb)return sl;Gb=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function r(s,o,u){var d=null;if(u!==void 0&&(d=""+u),o.key!==void 0&&(d=""+o.key),"key"in o){u={};for(var m in o)m!=="key"&&(u[m]=o[m])}else u=o;return o=u.ref,{$$typeof:e,type:s,key:d,ref:o!==void 0?o:null,props:u}}return sl.Fragment=n,sl.jsx=r,sl.jsxs=r,sl}var Xb;function mC(){return Xb||(Xb=1,Zh.exports=hC()),Zh.exports}var c=mC(),pC=(e,n,r,s,o,u,d,m)=>{let p=document.documentElement,g=["light","dark"];function x(E){(Array.isArray(e)?e:[e]).forEach(A=>{let S=A==="class",T=S&&u?o.map(z=>u[z]||z):o;S?(p.classList.remove(...T),p.classList.add(u&&u[E]?u[E]:E)):p.setAttribute(A,E)}),v(E)}function v(E){m&&g.includes(E)&&(p.style.colorScheme=E)}function w(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(s)x(s);else try{let E=localStorage.getItem(n)||r,A=d&&E==="system"?w():E;x(A)}catch{}},Yb=["light","dark"],tw="(prefers-color-scheme: dark)",gC=typeof window>"u",ap=b.createContext(void 0),vC={setTheme:e=>{},themes:[]},yC=()=>{var e;return(e=b.useContext(ap))!=null?e:vC},bC=e=>b.useContext(ap)?b.createElement(b.Fragment,null,e.children):b.createElement(wC,{...e}),xC=["light","dark"],wC=({forcedTheme:e,disableTransitionOnChange:n=!1,enableSystem:r=!0,enableColorScheme:s=!0,storageKey:o="theme",themes:u=xC,defaultTheme:d=r?"system":"light",attribute:m="data-theme",value:p,children:g,nonce:x,scriptProps:v})=>{let[w,E]=b.useState(()=>_C(o,d)),[A,S]=b.useState(()=>w==="system"?$h():w),T=p?Object.values(p):u,z=b.useCallback(N=>{let B=N;if(!B)return;N==="system"&&r&&(B=$h());let H=p?p[B]:B,$=n?EC(x):null,ue=document.documentElement,ye=ge=>{ge==="class"?(ue.classList.remove(...T),H&&ue.classList.add(H)):ge.startsWith("data-")&&(H?ue.setAttribute(ge,H):ue.removeAttribute(ge))};if(Array.isArray(m)?m.forEach(ye):ye(m),s){let ge=Yb.includes(d)?d:null,re=Yb.includes(B)?B:ge;ue.style.colorScheme=re}$?.()},[x]),R=b.useCallback(N=>{let B=typeof N=="function"?N(w):N;E(B);try{localStorage.setItem(o,B)}catch{}},[w]),O=b.useCallback(N=>{let B=$h(N);S(B),w==="system"&&r&&!e&&z("system")},[w,e]);b.useEffect(()=>{let N=window.matchMedia(tw);return N.addListener(O),O(N),()=>N.removeListener(O)},[O]),b.useEffect(()=>{let N=B=>{B.key===o&&(B.newValue?E(B.newValue):R(d))};return window.addEventListener("storage",N),()=>window.removeEventListener("storage",N)},[R]),b.useEffect(()=>{z(e??w)},[e,w]);let j=b.useMemo(()=>({theme:w,setTheme:R,forcedTheme:e,resolvedTheme:w==="system"?A:w,themes:r?[...u,"system"]:u,systemTheme:r?A:void 0}),[w,R,e,A,r,u]);return b.createElement(ap.Provider,{value:j},b.createElement(SC,{forcedTheme:e,storageKey:o,attribute:m,enableSystem:r,enableColorScheme:s,defaultTheme:d,value:p,themes:u,nonce:x,scriptProps:v}),g)},SC=b.memo(({forcedTheme:e,storageKey:n,attribute:r,enableSystem:s,enableColorScheme:o,defaultTheme:u,value:d,themes:m,nonce:p,scriptProps:g})=>{let x=JSON.stringify([r,n,u,e,m,d,s,o]).slice(1,-1);return b.createElement("script",{...g,suppressHydrationWarning:!0,nonce:typeof window>"u"?p:"",dangerouslySetInnerHTML:{__html:`(${pC.toString()})(${x})`}})}),_C=(e,n)=>{if(gC)return;let r;try{r=localStorage.getItem(e)||void 0}catch{}return r||n},EC=e=>{let n=document.createElement("style");return e&&n.setAttribute("nonce",e),n.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(n),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(n)},1)}},$h=e=>(e||(e=window.matchMedia(tw)),e.matches?"dark":"light");function CC({children:e,defaultTheme:n="system",storageKey:r="vite-ui-theme"}){return c.jsx(bC,{attribute:"class",defaultTheme:n,enableSystem:!0,storageKey:r,disableTransitionOnChange:!0,children:e})}var ao=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(){}},jC={setTimeout:(e,n)=>setTimeout(e,n),clearTimeout:e=>clearTimeout(e),setInterval:(e,n)=>setInterval(e,n),clearInterval:e=>clearInterval(e)},AC=class{#e=jC;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,n){return this.#e.setTimeout(e,n)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,n){return this.#e.setInterval(e,n)}clearInterval(e){this.#e.clearInterval(e)}},Di=new AC;function OC(e){setTimeout(e,0)}var ki=typeof window>"u"||"Deno"in globalThis;function xn(){}function TC(e,n){return typeof e=="function"?e(n):e}function wm(e){return typeof e=="number"&&e>=0&&e!==1/0}function nw(e,n){return Math.max(e+(n||0)-Date.now(),0)}function Wr(e,n){return typeof e=="function"?e(n):e}function ma(e,n){return typeof e=="function"?e(n):e}function Qb(e,n){const{type:r="all",exact:s,fetchStatus:o,predicate:u,queryKey:d,stale:m}=e;if(d){if(s){if(n.queryHash!==rp(d,n.options))return!1}else if(!jl(n.queryKey,d))return!1}if(r!=="all"){const p=n.isActive();if(r==="active"&&!p||r==="inactive"&&p)return!1}return!(typeof m=="boolean"&&n.isStale()!==m||o&&o!==n.state.fetchStatus||u&&!u(n))}function Jb(e,n){const{exact:r,status:s,predicate:o,mutationKey:u}=e;if(u){if(!n.options.mutationKey)return!1;if(r){if(Li(n.options.mutationKey)!==Li(u))return!1}else if(!jl(n.options.mutationKey,u))return!1}return!(s&&n.state.status!==s||o&&!o(n))}function rp(e,n){return(n?.queryKeyHashFn||Li)(e)}function Li(e){return JSON.stringify(e,(n,r)=>Sm(r)?Object.keys(r).sort().reduce((s,o)=>(s[o]=r[o],s),{}):r)}function jl(e,n){return e===n?!0:typeof e!=typeof n?!1:e&&n&&typeof e=="object"&&typeof n=="object"?Object.keys(n).every(r=>jl(e[r],n[r])):!1}var RC=Object.prototype.hasOwnProperty;function aw(e,n){if(e===n)return e;const r=Wb(e)&&Wb(n);if(!r&&!(Sm(e)&&Sm(n)))return n;const o=(r?e:Object.keys(e)).length,u=r?n:Object.keys(n),d=u.length,m=r?new Array(d):{};let p=0;for(let g=0;g{Di.setTimeout(n,e)})}function _m(e,n,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,n):r.structuralSharing!==!1?aw(e,n):n}function DC(e,n,r=0){const s=[...e,n];return r&&s.length>r?s.slice(1):s}function zC(e,n,r=0){const s=[n,...e];return r&&s.length>r?s.slice(0,-1):s}var ip=Symbol();function rw(e,n){return!e.queryFn&&n?.initialPromise?()=>n.initialPromise:!e.queryFn||e.queryFn===ip?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function iw(e,n){return typeof e=="function"?e(...n):!!e}var MC=class extends ao{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!ki&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},sp=new MC;function Em(){let e,n;const r=new Promise((o,u)=>{e=o,n=u});r.status="pending",r.catch(()=>{});function s(o){Object.assign(r,o),delete r.resolve,delete r.reject}return r.resolve=o=>{s({status:"fulfilled",value:o}),e(o)},r.reject=o=>{s({status:"rejected",reason:o}),n(o)},r}var kC=OC;function LC(){let e=[],n=0,r=m=>{m()},s=m=>{m()},o=kC;const u=m=>{n?e.push(m):o(()=>{r(m)})},d=()=>{const m=e;e=[],m.length&&o(()=>{s(()=>{m.forEach(p=>{r(p)})})})};return{batch:m=>{let p;n++;try{p=m()}finally{n--,n||d()}return p},batchCalls:m=>(...p)=>{u(()=>{m(...p)})},schedule:u,setNotifyFunction:m=>{r=m},setBatchNotifyFunction:m=>{s=m},setScheduler:m=>{o=m}}}var Wt=LC(),UC=class extends ao{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!ki&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(r=>{r(e)}))}isOnline(){return this.#e}},qu=new UC;function KC(e){return Math.min(1e3*2**e,3e4)}function sw(e){return(e??"online")==="online"?qu.isOnline():!0}var Cm=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function ow(e){let n=!1,r=0,s;const o=Em(),u=()=>o.status!=="pending",d=S=>{if(!u()){const T=new Cm(S);w(T),e.onCancel?.(T)}},m=()=>{n=!0},p=()=>{n=!1},g=()=>sp.isFocused()&&(e.networkMode==="always"||qu.isOnline())&&e.canRun(),x=()=>sw(e.networkMode)&&e.canRun(),v=S=>{u()||(s?.(),o.resolve(S))},w=S=>{u()||(s?.(),o.reject(S))},E=()=>new Promise(S=>{s=T=>{(u()||g())&&S(T)},e.onPause?.()}).then(()=>{s=void 0,u()||e.onContinue?.()}),A=()=>{if(u())return;let S;const T=r===0?e.initialPromise:void 0;try{S=T??e.fn()}catch(z){S=Promise.reject(z)}Promise.resolve(S).then(v).catch(z=>{if(u())return;const R=e.retry??(ki?0:3),O=e.retryDelay??KC,j=typeof O=="function"?O(r,z):O,N=R===!0||typeof R=="number"&&rg()?void 0:E()).then(()=>{n?w(z):A()})})};return{promise:o,status:()=>o.status,cancel:d,continue:()=>(s?.(),o),cancelRetry:m,continueRetry:p,canStart:x,start:()=>(x()?A():E().then(A),o)}}var lw=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),wm(this.gcTime)&&(this.#e=Di.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ki?1/0:300*1e3))}clearGcTimeout(){this.#e&&(Di.clearTimeout(this.#e),this.#e=void 0)}},qC=class extends lw{#e;#t;#n;#r;#a;#s;#o;constructor(e){super(),this.#o=!1,this.#s=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.#e=nx(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#s,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=nx(this.options);n.data!==void 0&&(this.setState(tx(n.data,n.dataUpdatedAt)),this.#e=n)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,n){const r=_m(this.state.data,e,this.options);return this.#i({data:r,type:"success",dataUpdatedAt:n?.updatedAt,manual:n?.manual}),r}setState(e,n){this.#i({type:"setState",state:e,setStateOptions:n})}cancel(e){const n=this.#a?.promise;return this.#a?.cancel(e),n?n.then(xn).catch(xn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>ma(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ip||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Wr(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:!nw(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(n=>n.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(n=>n.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(n=>n!==e),this.observers.length||(this.#a&&(this.#o?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,n){if(this.state.fetchStatus!=="idle"&&this.#a?.status()!=="rejected"){if(this.state.data!==void 0&&n?.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 m=this.observers.find(p=>p.options.queryFn);m&&this.setOptions(m.options)}const r=new AbortController,s=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(this.#o=!0,r.signal)})},o=()=>{const m=rw(this.options,n),g=(()=>{const x={client:this.#r,queryKey:this.queryKey,meta:this.meta};return s(x),x})();return this.#o=!1,this.options.persister?this.options.persister(m,g,this):m(g)},d=(()=>{const m={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:o};return s(m),m})();this.options.behavior?.onFetch(d,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==d.fetchOptions?.meta)&&this.#i({type:"fetch",meta:d.fetchOptions?.meta}),this.#a=ow({initialPromise:n?.initialPromise,fn:d.fetchFn,onCancel:m=>{m instanceof Cm&&m.revert&&this.setState({...this.#t,fetchStatus:"idle"}),r.abort()},onFail:(m,p)=>{this.#i({type:"failed",failureCount:m,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 m=await this.#a.start();if(m===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(m),this.#n.config.onSuccess?.(m,this),this.#n.config.onSettled?.(m,this.state.error,this),m}catch(m){if(m instanceof Cm){if(m.silent)return this.#a.promise;if(m.revert){if(this.state.data===void 0)throw m;return this.state.data}}throw this.#i({type:"error",error:m}),this.#n.config.onError?.(m,this),this.#n.config.onSettled?.(this.state.data,m,this),m}finally{this.scheduleGc()}}#i(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...cw(r.data,this.options),fetchMeta:e.meta??null};case"success":const s={...r,...tx(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?s:void 0,s;case"error":const o=e.error;return{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),Wt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function cw(e,n){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:sw(n.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function tx(e,n){return{data:e,dataUpdatedAt:n??Date.now(),error:null,isInvalidated:!1,status:"success"}}function nx(e){const n=typeof e.initialData=="function"?e.initialData():e.initialData,r=n!==void 0,s=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:n,dataUpdateCount:0,dataUpdatedAt:r?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var PC=class extends ao{constructor(e,n){super(),this.options=n,this.#e=e,this.#i=null,this.#o=Em(),this.bindMethods(),this.setOptions(n)}#e;#t=void 0;#n=void 0;#r=void 0;#a;#s;#o;#i;#p;#f;#h;#c;#u;#l;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),ax(this.#t,this.options)?this.#d():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return jm(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return jm(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#w(),this.#t.removeObserver(this)}setOptions(e){const n=this.options,r=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ma(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#S(),this.#t.setOptions(this.options),n._defaulted&&!Ku(this.options,n)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const s=this.hasListeners();s&&rx(this.#t,r,this.options,n)&&this.#d(),this.updateResult(),s&&(this.#t!==r||ma(this.options.enabled,this.#t)!==ma(n.enabled,this.#t)||Wr(this.options.staleTime,this.#t)!==Wr(n.staleTime,this.#t))&&this.#g();const o=this.#v();s&&(this.#t!==r||ma(this.options.enabled,this.#t)!==ma(n.enabled,this.#t)||o!==this.#l)&&this.#y(o)}getOptimisticResult(e){const n=this.#e.getQueryCache().build(this.#e,e),r=this.createResult(n,e);return HC(this,r)&&(this.#r=r,this.#s=this.options,this.#a=this.#t.state),r}getCurrentResult(){return this.#r}trackResult(e,n){return new Proxy(e,{get:(r,s)=>(this.trackProp(s),n?.(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,s))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=this.#e.defaultQueryOptions(e),r=this.#e.getQueryCache().build(this.#e,n);return r.fetch().then(()=>this.createResult(r,n))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#d(e){this.#S();let n=this.#t.fetch(this.options,e);return e?.throwOnError||(n=n.catch(xn)),n}#g(){this.#x();const e=Wr(this.options.staleTime,this.#t);if(ki||this.#r.isStale||!wm(e))return;const r=nw(this.#r.dataUpdatedAt,e)+1;this.#c=Di.setTimeout(()=>{this.#r.isStale||this.updateResult()},r)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(e){this.#w(),this.#l=e,!(ki||ma(this.options.enabled,this.#t)===!1||!wm(this.#l)||this.#l===0)&&(this.#u=Di.setInterval(()=>{(this.options.refetchIntervalInBackground||sp.isFocused())&&this.#d()},this.#l))}#b(){this.#g(),this.#y(this.#v())}#x(){this.#c&&(Di.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#u&&(Di.clearInterval(this.#u),this.#u=void 0)}createResult(e,n){const r=this.#t,s=this.options,o=this.#r,u=this.#a,d=this.#s,p=e!==r?e.state:this.#n,{state:g}=e;let x={...g},v=!1,w;if(n._optimisticResults){const $=this.hasListeners(),ue=!$&&ax(e,n),ye=$&&rx(e,r,n,s);(ue||ye)&&(x={...x,...cw(g.data,e.options)}),n._optimisticResults==="isRestoring"&&(x.fetchStatus="idle")}let{error:E,errorUpdatedAt:A,status:S}=x;w=x.data;let T=!1;if(n.placeholderData!==void 0&&w===void 0&&S==="pending"){let $;o?.isPlaceholderData&&n.placeholderData===d?.placeholderData?($=o.data,T=!0):$=typeof n.placeholderData=="function"?n.placeholderData(this.#h?.state.data,this.#h):n.placeholderData,$!==void 0&&(S="success",w=_m(o?.data,$,n),v=!0)}if(n.select&&w!==void 0&&!T)if(o&&w===u?.data&&n.select===this.#p)w=this.#f;else try{this.#p=n.select,w=n.select(w),w=_m(o?.data,w,n),this.#f=w,this.#i=null}catch($){this.#i=$}this.#i&&(E=this.#i,w=this.#f,A=Date.now(),S="error");const z=x.fetchStatus==="fetching",R=S==="pending",O=S==="error",j=R&&z,N=w!==void 0,H={status:S,fetchStatus:x.fetchStatus,isPending:R,isSuccess:S==="success",isError:O,isInitialLoading:j,isLoading:j,data:w,dataUpdatedAt:x.dataUpdatedAt,error:E,errorUpdatedAt:A,failureCount:x.fetchFailureCount,failureReason:x.fetchFailureReason,errorUpdateCount:x.errorUpdateCount,isFetched:x.dataUpdateCount>0||x.errorUpdateCount>0,isFetchedAfterMount:x.dataUpdateCount>p.dataUpdateCount||x.errorUpdateCount>p.errorUpdateCount,isFetching:z,isRefetching:z&&!R,isLoadingError:O&&!N,isPaused:x.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:O&&N,isStale:op(e,n),refetch:this.refetch,promise:this.#o,isEnabled:ma(n.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const $=ge=>{H.status==="error"?ge.reject(H.error):H.data!==void 0&&ge.resolve(H.data)},ue=()=>{const ge=this.#o=H.promise=Em();$(ge)},ye=this.#o;switch(ye.status){case"pending":e.queryHash===r.queryHash&&$(ye);break;case"fulfilled":(H.status==="error"||H.data!==ye.value)&&ue();break;case"rejected":(H.status!=="error"||H.error!==ye.reason)&&ue();break}}return H}updateResult(){const e=this.#r,n=this.createResult(this.#t,this.options);if(this.#a=this.#t.state,this.#s=this.options,this.#a.data!==void 0&&(this.#h=this.#t),Ku(n,e))return;this.#r=n;const r=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,o=typeof s=="function"?s():s;if(o==="all"||!o&&!this.#m.size)return!0;const u=new Set(o??this.#m);return this.options.throwOnError&&u.add("error"),Object.keys(this.#r).some(d=>{const m=d;return this.#r[m]!==e[m]&&u.has(m)})};this.#_({listeners:r()})}#S(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const n=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(n?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#_(e){Wt.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function IC(e,n){return ma(n.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&n.retryOnMount===!1)}function ax(e,n){return IC(e,n)||e.state.data!==void 0&&jm(e,n,n.refetchOnMount)}function jm(e,n,r){if(ma(n.enabled,e)!==!1&&Wr(n.staleTime,e)!=="static"){const s=typeof r=="function"?r(e):r;return s==="always"||s!==!1&&op(e,n)}return!1}function rx(e,n,r,s){return(e!==n||ma(s.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&op(e,r)}function op(e,n){return ma(n.enabled,e)!==!1&&e.isStaleByTime(Wr(n.staleTime,e))}function HC(e,n){return!Ku(e.getCurrentResult(),n)}function ix(e){return{onFetch:(n,r)=>{const s=n.options,o=n.fetchOptions?.meta?.fetchMore?.direction,u=n.state.data?.pages||[],d=n.state.data?.pageParams||[];let m={pages:[],pageParams:[]},p=0;const g=async()=>{let x=!1;const v=A=>{Object.defineProperty(A,"signal",{enumerable:!0,get:()=>(n.signal.aborted?x=!0:n.signal.addEventListener("abort",()=>{x=!0}),n.signal)})},w=rw(n.options,n.fetchOptions),E=async(A,S,T)=>{if(x)return Promise.reject();if(S==null&&A.pages.length)return Promise.resolve(A);const R=(()=>{const B={client:n.client,queryKey:n.queryKey,pageParam:S,direction:T?"backward":"forward",meta:n.options.meta};return v(B),B})(),O=await w(R),{maxPages:j}=n.options,N=T?zC:DC;return{pages:N(A.pages,O,j),pageParams:N(A.pageParams,S,j)}};if(o&&u.length){const A=o==="backward",S=A?VC:sx,T={pages:u,pageParams:d},z=S(s,T);m=await E(T,z,A)}else{const A=e??u.length;do{const S=p===0?d[0]??s.initialPageParam:sx(s,m);if(p>0&&S==null)break;m=await E(m,S),p++}while(pn.options.persister?.(g,{client:n.client,queryKey:n.queryKey,meta:n.options.meta,signal:n.signal},r):n.fetchFn=g}}}function sx(e,{pages:n,pageParams:r}){const s=n.length-1;return n.length>0?e.getNextPageParam(n[s],n,r[s],r):void 0}function VC(e,{pages:n,pageParams:r}){return n.length>0?e.getPreviousPageParam?.(n[0],n,r[0],r):void 0}var BC=class extends lw{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||uw(),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.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(n=>n!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.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 n=()=>{this.#a({type:"continue"})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=ow({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(u,d)=>{this.#a({type:"failed",failureCount:u,error:d})},onPause:()=>{this.#a({type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const s=this.state.status==="pending",o=!this.#r.canStart();try{if(s)n();else{this.#a({type:"pending",variables:e,isPaused:o}),await this.#n.config.onMutate?.(e,this,r);const d=await this.options.onMutate?.(e,r);d!==this.state.context&&this.#a({type:"pending",context:d,variables:e,isPaused:o})}const u=await this.#r.start();return await this.#n.config.onSuccess?.(u,e,this.state.context,this,r),await this.options.onSuccess?.(u,e,this.state.context,r),await this.#n.config.onSettled?.(u,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(u,null,e,this.state.context,r),this.#a({type:"success",data:u}),u}catch(u){try{throw await this.#n.config.onError?.(u,e,this.state.context,this,r),await this.options.onError?.(u,e,this.state.context,r),await this.#n.config.onSettled?.(void 0,u,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(void 0,u,e,this.state.context,r),u}finally{this.#a({type:"error",error:u})}}finally{this.#n.runNext(this)}}#a(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Wt.batch(()=>{this.#t.forEach(r=>{r.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function uw(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var FC=class extends ao{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,n,r){const s=new BC({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(n),state:r});return this.add(s),s}add(e){this.#e.add(e);const n=tu(e);if(typeof n=="string"){const r=this.#t.get(n);r?r.push(e):this.#t.set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const n=tu(e);if(typeof n=="string"){const r=this.#t.get(n);if(r)if(r.length>1){const s=r.indexOf(e);s!==-1&&r.splice(s,1)}else r[0]===e&&this.#t.delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=tu(e);if(typeof n=="string"){const s=this.#t.get(n)?.find(o=>o.state.status==="pending");return!s||s===e}else return!0}runNext(e){const n=tu(e);return typeof n=="string"?this.#t.get(n)?.find(s=>s!==e&&s.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Wt.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const n={exact:!0,...e};return this.getAll().find(r=>Jb(n,r))}findAll(e={}){return this.getAll().filter(n=>Jb(e,n))}notify(e){Wt.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Wt.batch(()=>Promise.all(e.map(n=>n.continue().catch(xn))))}};function tu(e){return e.options.scope?.id}var ZC=class extends ao{#e;#t=void 0;#n;#r;constructor(n,r){super(),this.#e=n,this.setOptions(r),this.bindMethods(),this.#a()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){const r=this.options;this.options=this.#e.defaultMutationOptions(n),Ku(this.options,r)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),r?.mutationKey&&this.options.mutationKey&&Li(r.mutationKey)!==Li(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(n){this.#a(),this.#s(n)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#a(),this.#s()}mutate(n,r){return this.#r=r,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(n)}#a(){const n=this.#n?.state??uw();this.#t={...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset}}#s(n){Wt.batch(()=>{if(this.#r&&this.hasListeners()){const r=this.#t.variables,s=this.#t.context,o={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};n?.type==="success"?(this.#r.onSuccess?.(n.data,r,s,o),this.#r.onSettled?.(n.data,null,r,s,o)):n?.type==="error"&&(this.#r.onError?.(n.error,r,s,o),this.#r.onSettled?.(void 0,n.error,r,s,o))}this.listeners.forEach(r=>{r(this.#t)})})}},$C=class extends ao{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,n,r){const s=n.queryKey,o=n.queryHash??rp(s,n);let u=this.get(o);return u||(u=new qC({client:e,queryKey:s,queryHash:o,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(u)),u}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=this.#e.get(e.queryHash);n&&(e.destroy(),n===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Wt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>Qb(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>Qb(e,r)):n}notify(e){Wt.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Wt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Wt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},GC=class{#e;#t;#n;#r;#a;#s;#o;#i;constructor(e={}){this.#e=e.queryCache||new $C,this.#t=e.mutationCache||new FC,this.#n=e.defaultOptions||{},this.#r=new Map,this.#a=new Map,this.#s=0}mount(){this.#s++,this.#s===1&&(this.#o=sp.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=qu.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#s--,this.#s===0&&(this.#o?.(),this.#o=void 0,this.#i?.(),this.#i=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const n=this.defaultQueryOptions({queryKey:e});return this.#e.get(n.queryHash)?.state.data}ensureQueryData(e){const n=this.defaultQueryOptions(e),r=this.#e.build(this,n),s=r.state.data;return s===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Wr(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(s))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:n,state:r})=>{const s=r.data;return[n,s]})}setQueryData(e,n,r){const s=this.defaultQueryOptions({queryKey:e}),u=this.#e.get(s.queryHash)?.state.data,d=TC(n,u);if(d!==void 0)return this.#e.build(this,s).setData(d,{...r,manual:!0})}setQueriesData(e,n,r){return Wt.batch(()=>this.#e.findAll(e).map(({queryKey:s})=>[s,this.setQueryData(s,n,r)]))}getQueryState(e){const n=this.defaultQueryOptions({queryKey:e});return this.#e.get(n.queryHash)?.state}removeQueries(e){const n=this.#e;Wt.batch(()=>{n.findAll(e).forEach(r=>{n.remove(r)})})}resetQueries(e,n){const r=this.#e;return Wt.batch(()=>(r.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...e},n)))}cancelQueries(e,n={}){const r={revert:!0,...n},s=Wt.batch(()=>this.#e.findAll(e).map(o=>o.cancel(r)));return Promise.all(s).then(xn).catch(xn)}invalidateQueries(e,n={}){return Wt.batch(()=>(this.#e.findAll(e).forEach(r=>{r.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},n)))}refetchQueries(e,n={}){const r={...n,cancelRefetch:n.cancelRefetch??!0},s=Wt.batch(()=>this.#e.findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let u=o.fetch(void 0,r);return r.throwOnError||(u=u.catch(xn)),o.state.fetchStatus==="paused"?Promise.resolve():u}));return Promise.all(s).then(xn)}fetchQuery(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const r=this.#e.build(this,n);return r.isStaleByTime(Wr(n.staleTime,r))?r.fetch(n):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(xn).catch(xn)}fetchInfiniteQuery(e){return e.behavior=ix(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(xn).catch(xn)}ensureInfiniteQueryData(e){return e.behavior=ix(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return qu.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,n){this.#r.set(Li(e),{queryKey:e,defaultOptions:n})}getQueryDefaults(e){const n=[...this.#r.values()],r={};return n.forEach(s=>{jl(e,s.queryKey)&&Object.assign(r,s.defaultOptions)}),r}setMutationDefaults(e,n){this.#a.set(Li(e),{mutationKey:e,defaultOptions:n})}getMutationDefaults(e){const n=[...this.#a.values()],r={};return n.forEach(s=>{jl(e,s.mutationKey)&&Object.assign(r,s.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const n={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return n.queryHash||(n.queryHash=rp(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===ip&&(n.enabled=!1),n}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},dw=b.createContext(void 0),pa=e=>{const n=b.useContext(dw);if(!n)throw new Error("No QueryClient set, use QueryClientProvider to set one");return n},XC=({client:e,children:n})=>(b.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),c.jsx(dw.Provider,{value:e,children:n})),fw=b.createContext(!1),YC=()=>b.useContext(fw);fw.Provider;function QC(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var JC=b.createContext(QC()),WC=()=>b.useContext(JC),ej=(e,n)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(n.isReset()||(e.retryOnMount=!1))},tj=e=>{b.useEffect(()=>{e.clearReset()},[e])},nj=({result:e,errorResetBoundary:n,throwOnError:r,query:s,suspense:o})=>e.isError&&!n.isReset()&&!e.isFetching&&s&&(o&&e.data===void 0||iw(r,[e.error,s])),aj=e=>{if(e.suspense){const r=o=>o==="static"?o:Math.max(o??1e3,1e3),s=e.staleTime;e.staleTime=typeof s=="function"?(...o)=>r(s(...o)):r(s),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},rj=(e,n)=>e.isLoading&&e.isFetching&&!n,ij=(e,n)=>e?.suspense&&n.isPending,ox=(e,n,r)=>n.fetchOptimistic(e).catch(()=>{r.clearReset()});function sj(e,n,r){const s=YC(),o=WC(),u=pa(),d=u.defaultQueryOptions(e);u.getDefaultOptions().queries?._experimental_beforeQuery?.(d),d._optimisticResults=s?"isRestoring":"optimistic",aj(d),ej(d,o),tj(o);const m=!u.getQueryCache().get(d.queryHash),[p]=b.useState(()=>new n(u,d)),g=p.getOptimisticResult(d),x=!s&&e.subscribed!==!1;if(b.useSyncExternalStore(b.useCallback(v=>{const w=x?p.subscribe(Wt.batchCalls(v)):xn;return p.updateResult(),w},[p,x]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),b.useEffect(()=>{p.setOptions(d)},[d,p]),ij(d,g))throw ox(d,p,o);if(nj({result:g,errorResetBoundary:o,throwOnError:d.throwOnError,query:u.getQueryCache().get(d.queryHash),suspense:d.suspense}))throw g.error;return u.getDefaultOptions().queries?._experimental_afterQuery?.(d,g),d.experimental_prefetchInRender&&!ki&&rj(g,s)&&(m?ox(d,p,o):u.getQueryCache().get(d.queryHash)?.promise)?.catch(xn).finally(()=>{p.updateResult()}),d.notifyOnChangeProps?g:p.trackResult(g)}function Pn(e,n){return sj(e,PC)}function mt(e,n){const r=pa(),[s]=b.useState(()=>new ZC(r,e));b.useEffect(()=>{s.setOptions(e)},[s,e]);const o=b.useSyncExternalStore(b.useCallback(d=>s.subscribe(Wt.batchCalls(d)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),u=b.useCallback((d,m)=>{s.mutate(d,m).catch(xn)},[s]);if(o.error&&iw(s.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:u,mutateAsync:o.mutate}}const oj=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),lj=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,r,s)=>s?s.toUpperCase():r.toLowerCase()),lx=e=>{const n=lj(e);return n.charAt(0).toUpperCase()+n.slice(1)},hw=(...e)=>e.filter((n,r,s)=>!!n&&n.trim()!==""&&s.indexOf(n)===r).join(" ").trim(),cj=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0};var uj={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const dj=b.forwardRef(({color:e="currentColor",size:n=24,strokeWidth:r=2,absoluteStrokeWidth:s,className:o="",children:u,iconNode:d,...m},p)=>b.createElement("svg",{ref:p,...uj,width:n,height:n,stroke:e,strokeWidth:s?Number(r)*24/Number(n):r,className:hw("lucide",o),...!u&&!cj(m)&&{"aria-hidden":"true"},...m},[...d.map(([g,x])=>b.createElement(g,x)),...Array.isArray(u)?u:[u]]));const ut=(e,n)=>{const r=b.forwardRef(({className:s,...o},u)=>b.createElement(dj,{ref:u,iconNode:n,className:hw(`lucide-${oj(lx(e))}`,`lucide-${e}`,s),...o}));return r.displayName=lx(e),r};const fj=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],hj=ut("boxes",fj);const mj=[["path",{d:"M10 12h4",key:"a56b0p"}],["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M14 21v-3a2 2 0 0 0-4 0v3",key:"1rgiei"}],["path",{d:"M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2",key:"secmi2"}],["path",{d:"M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16",key:"16ra0t"}]],mw=ut("building-2",mj);const pj=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],pw=ut("check",pj);const gj=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],gw=ut("chevron-down",gj);const vj=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],yj=ut("chevron-right",vj);const bj=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],xj=ut("chevron-up",bj);const wj=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],Sj=ut("chevrons-up-down",wj);const _j=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Ej=ut("circle-check",_j);const Cj=[["path",{d:"M22 2 2 22",key:"y4kqgn"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],lp=ut("circle-slash-2",Cj);const jj=[["path",{d:"M15.536 11.293a1 1 0 0 0 0 1.414l2.376 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z",key:"1uwlt4"}],["path",{d:"M2.297 11.293a1 1 0 0 0 0 1.414l2.377 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414L6.088 8.916a1 1 0 0 0-1.414 0z",key:"10291m"}],["path",{d:"M8.916 17.912a1 1 0 0 0 0 1.415l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.415l-2.377-2.376a1 1 0 0 0-1.414 0z",key:"1tqoq1"}],["path",{d:"M8.916 4.674a1 1 0 0 0 0 1.414l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z",key:"1x6lto"}]],Aj=ut("component",jj);const Oj=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],Tj=ut("download",Oj);const Rj=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Nj=ut("eye",Rj);const Dj=[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v6",key:"rc0qvx"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["circle",{cx:"4",cy:"16",r:"2",key:"1ehqvc"}],["path",{d:"m10 10-4.5 4.5",key:"7fwrp6"}],["path",{d:"m9 11 1 1",key:"wa6s5q"}]],zj=ut("file-key-2",Dj);const Mj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],kj=ut("info",Mj);const Lj=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],Uj=ut("key-round",Lj);const Kj=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Qs=ut("loader-circle",Kj);const qj=[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Pj=ut("octagon-x",qj);const Ij=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],Hj=ut("panel-left",Ij);const Vj=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],cp=ut("pencil",Vj);const Bj=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ro=ut("plus",Bj);const Fj=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Zj=ut("refresh-cw",Fj);const $j=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],io=ut("search",$j);const Gj=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],Xj=ut("server",Gj);const Yj=[["path",{d:"M3 3h.01",key:"159qn6"}],["path",{d:"M7 5h.01",key:"1hq22a"}],["path",{d:"M11 7h.01",key:"1osv80"}],["path",{d:"M3 7h.01",key:"1xzrh3"}],["path",{d:"M7 9h.01",key:"19b3jx"}],["path",{d:"M3 11h.01",key:"1eifu7"}],["rect",{width:"4",height:"4",x:"15",y:"5",key:"mri9e4"}],["path",{d:"m19 9 2 2v10c0 .6-.4 1-1 1h-6c-.6 0-1-.4-1-1V11l2-2",key:"aib6hk"}],["path",{d:"m13 14 8-2",key:"1d7bmk"}],["path",{d:"m13 19 8-2",key:"1y2vml"}]],Qj=ut("spray-can",Yj);const Jj=[["path",{d:"M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z",key:"16rjxf"}],["path",{d:"M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193",key:"178nd4"}],["circle",{cx:"10.5",cy:"6.5",r:".5",fill:"currentColor",key:"12ikhr"}]],ad=ut("tags",Jj);const Wj=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],eA=ut("trash-2",Wj);const tA=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],nA=ut("triangle-alert",tA);const aA=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],rA=ut("user-round",aA);const iA=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],vw=ut("users",iA);const sA=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],up=ut("x",sA);function oA(e){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}const lA=e=>{switch(e){case"success":return dA;case"info":return hA;case"warning":return fA;case"error":return mA;default:return null}},cA=Array(12).fill(0),uA=({visible:e,className:n})=>G.createElement("div",{className:["sonner-loading-wrapper",n].filter(Boolean).join(" "),"data-visible":e},G.createElement("div",{className:"sonner-spinner"},cA.map((r,s)=>G.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),dA=G.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},G.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"})),fA=G.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},G.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"})),hA=G.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},G.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"})),mA=G.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},G.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"})),pA=G.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"},G.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),G.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),gA=()=>{const[e,n]=G.useState(document.hidden);return G.useEffect(()=>{const r=()=>{n(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e};let Am=1;class vA{constructor(){this.subscribe=n=>(this.subscribers.push(n),()=>{const r=this.subscribers.indexOf(n);this.subscribers.splice(r,1)}),this.publish=n=>{this.subscribers.forEach(r=>r(n))},this.addToast=n=>{this.publish(n),this.toasts=[...this.toasts,n]},this.create=n=>{var r;const{message:s,...o}=n,u=typeof n?.id=="number"||((r=n.id)==null?void 0:r.length)>0?n.id:Am++,d=this.toasts.find(p=>p.id===u),m=n.dismissible===void 0?!0:n.dismissible;return this.dismissedToasts.has(u)&&this.dismissedToasts.delete(u),d?this.toasts=this.toasts.map(p=>p.id===u?(this.publish({...p,...n,id:u,title:s}),{...p,...n,id:u,dismissible:m,title:s}):p):this.addToast({title:s,...o,dismissible:m,id:u}),u},this.dismiss=n=>(n?(this.dismissedToasts.add(n),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:n,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(s=>s({id:r.id,dismiss:!0}))}),n),this.message=(n,r)=>this.create({...r,message:n}),this.error=(n,r)=>this.create({...r,message:n,type:"error"}),this.success=(n,r)=>this.create({...r,type:"success",message:n}),this.info=(n,r)=>this.create({...r,type:"info",message:n}),this.warning=(n,r)=>this.create({...r,type:"warning",message:n}),this.loading=(n,r)=>this.create({...r,type:"loading",message:n}),this.promise=(n,r)=>{if(!r)return;let s;r.loading!==void 0&&(s=this.create({...r,promise:n,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const o=Promise.resolve(n instanceof Function?n():n);let u=s!==void 0,d;const m=o.then(async g=>{if(d=["resolve",g],G.isValidElement(g))u=!1,this.create({id:s,type:"default",message:g});else if(bA(g)&&!g.ok){u=!1;const v=typeof r.error=="function"?await r.error(`HTTP error! status: ${g.status}`):r.error,w=typeof r.description=="function"?await r.description(`HTTP error! status: ${g.status}`):r.description,A=typeof v=="object"&&!G.isValidElement(v)?v:{message:v};this.create({id:s,type:"error",description:w,...A})}else if(g instanceof Error){u=!1;const v=typeof r.error=="function"?await r.error(g):r.error,w=typeof r.description=="function"?await r.description(g):r.description,A=typeof v=="object"&&!G.isValidElement(v)?v:{message:v};this.create({id:s,type:"error",description:w,...A})}else if(r.success!==void 0){u=!1;const v=typeof r.success=="function"?await r.success(g):r.success,w=typeof r.description=="function"?await r.description(g):r.description,A=typeof v=="object"&&!G.isValidElement(v)?v:{message:v};this.create({id:s,type:"success",description:w,...A})}}).catch(async g=>{if(d=["reject",g],r.error!==void 0){u=!1;const x=typeof r.error=="function"?await r.error(g):r.error,v=typeof r.description=="function"?await r.description(g):r.description,E=typeof x=="object"&&!G.isValidElement(x)?x:{message:x};this.create({id:s,type:"error",description:v,...E})}}).finally(()=>{u&&(this.dismiss(s),s=void 0),r.finally==null||r.finally.call(r)}),p=()=>new Promise((g,x)=>m.then(()=>d[0]==="reject"?x(d[1]):g(d[1])).catch(x));return typeof s!="string"&&typeof s!="number"?{unwrap:p}:Object.assign(s,{unwrap:p})},this.custom=(n,r)=>{const s=r?.id||Am++;return this.create({jsx:n(s),id:s,...r}),s},this.getActiveToasts=()=>this.toasts.filter(n=>!this.dismissedToasts.has(n.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Un=new vA,yA=(e,n)=>{const r=n?.id||Am++;return Un.addToast({title:e,...n,id:r}),r},bA=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",xA=yA,wA=()=>Un.toasts,SA=()=>Un.getActiveToasts(),Ae=Object.assign(xA,{success:Un.success,info:Un.info,warning:Un.warning,error:Un.error,custom:Un.custom,message:Un.message,promise:Un.promise,dismiss:Un.dismiss,loading:Un.loading},{getHistory:wA,getToasts:SA});oA("[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 nu(e){return e.label!==void 0}const _A=3,EA="24px",CA="16px",cx=4e3,jA=356,AA=14,OA=45,TA=200;function qa(...e){return e.filter(Boolean).join(" ")}function RA(e){const[n,r]=e.split("-"),s=[];return n&&s.push(n),r&&s.push(r),s}const NA=e=>{var n,r,s,o,u,d,m,p,g;const{invert:x,toast:v,unstyled:w,interacting:E,setHeights:A,visibleToasts:S,heights:T,index:z,toasts:R,expanded:O,removeToast:j,defaultRichColors:N,closeButton:B,style:H,cancelButtonStyle:$,actionButtonStyle:ue,className:ye="",descriptionClassName:ge="",duration:re,position:le,gap:he,expandByDefault:ve,classNames:C,icons:L,closeButtonAriaLabel:K="Close toast"}=e,[de,xe]=G.useState(null),[ze,Y]=G.useState(null),[X,ae]=G.useState(!1),[ne,_e]=G.useState(!1),[te,pe]=G.useState(!1),[Te,Me]=G.useState(!1),[Ge,Xe]=G.useState(!1),[$t,Ot]=G.useState(0),[na,aa]=G.useState(0),Hn=G.useRef(v.duration||re||cx),Xi=G.useRef(null),fn=G.useRef(null),M=z===0,I=z+1<=S,Z=v.type,fe=v.dismissible!==!1,ie=v.className||"",se=v.descriptionClassName||"",Ee=G.useMemo(()=>T.findIndex(ke=>ke.toastId===v.id)||0,[T,v.id]),at=G.useMemo(()=>{var ke;return(ke=v.closeButton)!=null?ke:B},[v.closeButton,B]),rt=G.useMemo(()=>v.duration||re||cx,[v.duration,re]),nn=G.useRef(0),En=G.useRef(0),Vn=G.useRef(0),Da=G.useRef(null),[ya,Gt]=le.split("-"),Bn=G.useMemo(()=>T.reduce((ke,_t,an)=>an>=Ee?ke:ke+_t.height,0),[T,Ee]),Xt=gA(),go=v.invert||x,Cr=Z==="loading";En.current=G.useMemo(()=>Ee*he+Bn,[Ee,Bn]),G.useEffect(()=>{Hn.current=rt},[rt]),G.useEffect(()=>{ae(!0)},[]),G.useEffect(()=>{const ke=fn.current;if(ke){const _t=ke.getBoundingClientRect().height;return aa(_t),A(an=>[{toastId:v.id,height:_t,position:v.position},...an]),()=>A(an=>an.filter(hn=>hn.toastId!==v.id))}},[A,v.id]),G.useLayoutEffect(()=>{if(!X)return;const ke=fn.current,_t=ke.style.height;ke.style.height="auto";const an=ke.getBoundingClientRect().height;ke.style.height=_t,aa(an),A(hn=>hn.find(jt=>jt.toastId===v.id)?hn.map(jt=>jt.toastId===v.id?{...jt,height:an}:jt):[{toastId:v.id,height:an,position:v.position},...hn])},[X,v.title,v.description,A,v.id,v.jsx,v.action,v.cancel]);const za=G.useCallback(()=>{_e(!0),Ot(En.current),A(ke=>ke.filter(_t=>_t.toastId!==v.id)),setTimeout(()=>{j(v)},TA)},[v,j,A,En]);G.useEffect(()=>{if(v.promise&&Z==="loading"||v.duration===1/0||v.type==="loading")return;let ke;return O||E||Xt?(()=>{if(Vn.current{Hn.current!==1/0&&(nn.current=new Date().getTime(),ke=setTimeout(()=>{v.onAutoClose==null||v.onAutoClose.call(v,v),za()},Hn.current))})(),()=>clearTimeout(ke)},[O,E,v,Z,Xt,za]),G.useEffect(()=>{v.delete&&(za(),v.onDismiss==null||v.onDismiss.call(v,v))},[za,v.delete]);function Yi(){var ke;if(L?.loading){var _t;return G.createElement("div",{className:qa(C?.loader,v==null||(_t=v.classNames)==null?void 0:_t.loader,"sonner-loader"),"data-visible":Z==="loading"},L.loading)}return G.createElement(uA,{className:qa(C?.loader,v==null||(ke=v.classNames)==null?void 0:ke.loader),visible:Z==="loading"})}const Qi=v.icon||L?.[Z]||lA(Z);var di,Ma;return G.createElement("li",{tabIndex:0,ref:fn,className:qa(ye,ie,C?.toast,v==null||(n=v.classNames)==null?void 0:n.toast,C?.default,C?.[Z],v==null||(r=v.classNames)==null?void 0:r[Z]),"data-sonner-toast":"","data-rich-colors":(di=v.richColors)!=null?di:N,"data-styled":!(v.jsx||v.unstyled||w),"data-mounted":X,"data-promise":!!v.promise,"data-swiped":Ge,"data-removed":ne,"data-visible":I,"data-y-position":ya,"data-x-position":Gt,"data-index":z,"data-front":M,"data-swiping":te,"data-dismissible":fe,"data-type":Z,"data-invert":go,"data-swipe-out":Te,"data-swipe-direction":ze,"data-expanded":!!(O||ve&&X),"data-testid":v.testId,style:{"--index":z,"--toasts-before":z,"--z-index":R.length-z,"--offset":`${ne?$t:En.current}px`,"--initial-height":ve?"auto":`${na}px`,...H,...v.style},onDragEnd:()=>{pe(!1),xe(null),Da.current=null},onPointerDown:ke=>{ke.button!==2&&(Cr||!fe||(Xi.current=new Date,Ot(En.current),ke.target.setPointerCapture(ke.pointerId),ke.target.tagName!=="BUTTON"&&(pe(!0),Da.current={x:ke.clientX,y:ke.clientY})))},onPointerUp:()=>{var ke,_t,an;if(Te||!fe)return;Da.current=null;const hn=Number(((ke=fn.current)==null?void 0:ke.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),jr=Number(((_t=fn.current)==null?void 0:_t.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),jt=new Date().getTime()-((an=Xi.current)==null?void 0:an.getTime()),Cn=de==="x"?hn:jr,fi=Math.abs(Cn)/jt;if(Math.abs(Cn)>=OA||fi>.11){Ot(En.current),v.onDismiss==null||v.onDismiss.call(v,v),Y(de==="x"?hn>0?"right":"left":jr>0?"down":"up"),za(),Me(!0);return}else{var jn,An;(jn=fn.current)==null||jn.style.setProperty("--swipe-amount-x","0px"),(An=fn.current)==null||An.style.setProperty("--swipe-amount-y","0px")}Xe(!1),pe(!1),xe(null)},onPointerMove:ke=>{var _t,an,hn;if(!Da.current||!fe||((_t=window.getSelection())==null?void 0:_t.toString().length)>0)return;const jt=ke.clientY-Da.current.y,Cn=ke.clientX-Da.current.x;var fi;const jn=(fi=e.swipeDirections)!=null?fi:RA(le);!de&&(Math.abs(Cn)>1||Math.abs(jt)>1)&&xe(Math.abs(Cn)>Math.abs(jt)?"x":"y");let An={x:0,y:0};const Ji=ba=>1/(1.5+Math.abs(ba)/20);if(de==="y"){if(jn.includes("top")||jn.includes("bottom"))if(jn.includes("top")&&jt<0||jn.includes("bottom")&&jt>0)An.y=jt;else{const ba=jt*Ji(jt);An.y=Math.abs(ba)0)An.x=Cn;else{const ba=Cn*Ji(Cn);An.x=Math.abs(ba)0||Math.abs(An.y)>0)&&Xe(!0),(an=fn.current)==null||an.style.setProperty("--swipe-amount-x",`${An.x}px`),(hn=fn.current)==null||hn.style.setProperty("--swipe-amount-y",`${An.y}px`)}},at&&!v.jsx&&Z!=="loading"?G.createElement("button",{"aria-label":K,"data-disabled":Cr,"data-close-button":!0,onClick:Cr||!fe?()=>{}:()=>{za(),v.onDismiss==null||v.onDismiss.call(v,v)},className:qa(C?.closeButton,v==null||(s=v.classNames)==null?void 0:s.closeButton)},(Ma=L?.close)!=null?Ma:pA):null,(Z||v.icon||v.promise)&&v.icon!==null&&(L?.[Z]!==null||v.icon)?G.createElement("div",{"data-icon":"",className:qa(C?.icon,v==null||(o=v.classNames)==null?void 0:o.icon)},v.promise||v.type==="loading"&&!v.icon?v.icon||Yi():null,v.type!=="loading"?Qi:null):null,G.createElement("div",{"data-content":"",className:qa(C?.content,v==null||(u=v.classNames)==null?void 0:u.content)},G.createElement("div",{"data-title":"",className:qa(C?.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?G.createElement("div",{"data-description":"",className:qa(ge,se,C?.description,v==null||(m=v.classNames)==null?void 0:m.description)},typeof v.description=="function"?v.description():v.description):null),G.isValidElement(v.cancel)?v.cancel:v.cancel&&nu(v.cancel)?G.createElement("button",{"data-button":!0,"data-cancel":!0,style:v.cancelButtonStyle||$,onClick:ke=>{nu(v.cancel)&&fe&&(v.cancel.onClick==null||v.cancel.onClick.call(v.cancel,ke),za())},className:qa(C?.cancelButton,v==null||(p=v.classNames)==null?void 0:p.cancelButton)},v.cancel.label):null,G.isValidElement(v.action)?v.action:v.action&&nu(v.action)?G.createElement("button",{"data-button":!0,"data-action":!0,style:v.actionButtonStyle||ue,onClick:ke=>{nu(v.action)&&(v.action.onClick==null||v.action.onClick.call(v.action,ke),!ke.defaultPrevented&&za())},className:qa(C?.actionButton,v==null||(g=v.classNames)==null?void 0:g.actionButton)},v.action.label):null)};function ux(){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 DA(e,n){const r={};return[e,n].forEach((s,o)=>{const u=o===1,d=u?"--mobile-offset":"--offset",m=u?CA:EA;function p(g){["top","right","bottom","left"].forEach(x=>{r[`${d}-${x}`]=typeof g=="number"?`${g}px`:g})}typeof s=="number"||typeof s=="string"?p(s):typeof s=="object"?["top","right","bottom","left"].forEach(g=>{s[g]===void 0?r[`${d}-${g}`]=m:r[`${d}-${g}`]=typeof s[g]=="number"?`${s[g]}px`:s[g]}):p(m)}),r}const zA=G.forwardRef(function(n,r){const{id:s,invert:o,position:u="bottom-right",hotkey:d=["altKey","KeyT"],expand:m,closeButton:p,className:g,offset:x,mobileOffset:v,theme:w="light",richColors:E,duration:A,style:S,visibleToasts:T=_A,toastOptions:z,dir:R=ux(),gap:O=AA,icons:j,containerAriaLabel:N="Notifications"}=n,[B,H]=G.useState([]),$=G.useMemo(()=>s?B.filter(X=>X.toasterId===s):B.filter(X=>!X.toasterId),[B,s]),ue=G.useMemo(()=>Array.from(new Set([u].concat($.filter(X=>X.position).map(X=>X.position)))),[$,u]),[ye,ge]=G.useState([]),[re,le]=G.useState(!1),[he,ve]=G.useState(!1),[C,L]=G.useState(w!=="system"?w:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),K=G.useRef(null),de=d.join("+").replace(/Key/g,"").replace(/Digit/g,""),xe=G.useRef(null),ze=G.useRef(!1),Y=G.useCallback(X=>{H(ae=>{var ne;return(ne=ae.find(_e=>_e.id===X.id))!=null&&ne.delete||Un.dismiss(X.id),ae.filter(({id:_e})=>_e!==X.id)})},[]);return G.useEffect(()=>Un.subscribe(X=>{if(X.dismiss){requestAnimationFrame(()=>{H(ae=>ae.map(ne=>ne.id===X.id?{...ne,delete:!0}:ne))});return}setTimeout(()=>{Q0.flushSync(()=>{H(ae=>{const ne=ae.findIndex(_e=>_e.id===X.id);return ne!==-1?[...ae.slice(0,ne),{...ae[ne],...X},...ae.slice(ne+1)]:[X,...ae]})})})}),[B]),G.useEffect(()=>{if(w!=="system"){L(w);return}if(w==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?L("dark"):L("light")),typeof window>"u")return;const X=window.matchMedia("(prefers-color-scheme: dark)");try{X.addEventListener("change",({matches:ae})=>{L(ae?"dark":"light")})}catch{X.addListener(({matches:ne})=>{try{L(ne?"dark":"light")}catch(_e){console.error(_e)}})}},[w]),G.useEffect(()=>{B.length<=1&&le(!1)},[B]),G.useEffect(()=>{const X=ae=>{var ne;if(d.every(pe=>ae[pe]||ae.code===pe)){var te;le(!0),(te=K.current)==null||te.focus()}ae.code==="Escape"&&(document.activeElement===K.current||(ne=K.current)!=null&&ne.contains(document.activeElement))&&le(!1)};return document.addEventListener("keydown",X),()=>document.removeEventListener("keydown",X)},[d]),G.useEffect(()=>{if(K.current)return()=>{xe.current&&(xe.current.focus({preventScroll:!0}),xe.current=null,ze.current=!1)}},[K.current]),G.createElement("section",{ref:r,"aria-label":`${N} ${de}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},ue.map((X,ae)=>{var ne;const[_e,te]=X.split("-");return $.length?G.createElement("ol",{key:X,dir:R==="auto"?ux():R,tabIndex:-1,ref:K,className:g,"data-sonner-toaster":!0,"data-sonner-theme":C,"data-y-position":_e,"data-x-position":te,style:{"--front-toast-height":`${((ne=ye[0])==null?void 0:ne.height)||0}px`,"--width":`${jA}px`,"--gap":`${O}px`,...S,...DA(x,v)},onBlur:pe=>{ze.current&&!pe.currentTarget.contains(pe.relatedTarget)&&(ze.current=!1,xe.current&&(xe.current.focus({preventScroll:!0}),xe.current=null))},onFocus:pe=>{pe.target instanceof HTMLElement&&pe.target.dataset.dismissible==="false"||ze.current||(ze.current=!0,xe.current=pe.relatedTarget)},onMouseEnter:()=>le(!0),onMouseMove:()=>le(!0),onMouseLeave:()=>{he||le(!1)},onDragEnd:()=>le(!1),onPointerDown:pe=>{pe.target instanceof HTMLElement&&pe.target.dataset.dismissible==="false"||ve(!0)},onPointerUp:()=>ve(!1)},$.filter(pe=>!pe.position&&ae===0||pe.position===X).map((pe,Te)=>{var Me,Ge;return G.createElement(NA,{key:pe.id,icons:j,index:Te,toast:pe,defaultRichColors:E,duration:(Me=z?.duration)!=null?Me:A,className:z?.className,descriptionClassName:z?.descriptionClassName,invert:o,visibleToasts:T,closeButton:(Ge=z?.closeButton)!=null?Ge:p,interacting:he,position:X,style:z?.style,unstyled:z?.unstyled,classNames:z?.classNames,cancelButtonStyle:z?.cancelButtonStyle,actionButtonStyle:z?.actionButtonStyle,closeButtonAriaLabel:z?.closeButtonAriaLabel,removeToast:Y,toasts:$.filter(Xe=>Xe.position==pe.position),heights:ye.filter(Xe=>Xe.position==pe.position),setHeights:ge,expandByDefault:m,gap:O,expanded:re,swipeDirections:n.swipeDirections})})):null}))}),MA=({...e})=>{const{theme:n="system"}=yC();return c.jsx(zA,{theme:n,className:"toaster group",icons:{success:c.jsx(Ej,{className:"size-4"}),info:c.jsx(kj,{className:"size-4"}),warning:c.jsx(nA,{className:"size-4"}),error:c.jsx(Pj,{className:"size-4"}),loading:c.jsx(Qs,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},...e})},kA=new GC,LA=({children:e})=>c.jsx(XC,{client:kA,children:c.jsxs(CC,{defaultTheme:"system",storageKey:"dragon-theme",children:[e,c.jsx(MA,{richColors:!0,expand:!0,position:"top-center"})]})});var Gh={exports:{}},ol={},Xh={exports:{}},Yh={};var dx;function UA(){return dx||(dx=1,(function(e){function n(C,L){var K=C.length;C.push(L);e:for(;0>>1,xe=C[de];if(0>>1;deo(X,K))aeo(ne,X)?(C[de]=ne,C[ae]=K,de=ae):(C[de]=X,C[Y]=K,de=Y);else if(aeo(ne,K))C[de]=ne,C[ae]=K,de=ae;else break e}}return L}function o(C,L){var K=C.sortIndex-L.sortIndex;return K!==0?K:C.id-L.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var d=Date,m=d.now();e.unstable_now=function(){return d.now()-m}}var p=[],g=[],x=1,v=null,w=3,E=!1,A=!1,S=!1,T=!1,z=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function j(C){for(var L=r(g);L!==null;){if(L.callback===null)s(g);else if(L.startTime<=C)s(g),L.sortIndex=L.expirationTime,n(p,L);else break;L=r(g)}}function N(C){if(S=!1,j(C),!A)if(r(p)!==null)A=!0,B||(B=!0,re());else{var L=r(g);L!==null&&ve(N,L.startTime-C)}}var B=!1,H=-1,$=5,ue=-1;function ye(){return T?!0:!(e.unstable_now()-ue<$)}function ge(){if(T=!1,B){var C=e.unstable_now();ue=C;var L=!0;try{e:{A=!1,S&&(S=!1,R(H),H=-1),E=!0;var K=w;try{t:{for(j(C),v=r(p);v!==null&&!(v.expirationTime>C&&ye());){var de=v.callback;if(typeof de=="function"){v.callback=null,w=v.priorityLevel;var xe=de(v.expirationTime<=C);if(C=e.unstable_now(),typeof xe=="function"){v.callback=xe,j(C),L=!0;break t}v===r(p)&&s(p),j(C)}else s(p);v=r(p)}if(v!==null)L=!0;else{var ze=r(g);ze!==null&&ve(N,ze.startTime-C),L=!1}}break e}finally{v=null,w=K,E=!1}L=void 0}}finally{L?re():B=!1}}}var re;if(typeof O=="function")re=function(){O(ge)};else if(typeof MessageChannel<"u"){var le=new MessageChannel,he=le.port2;le.port1.onmessage=ge,re=function(){he.postMessage(null)}}else re=function(){z(ge,0)};function ve(C,L){H=z(function(){C(e.unstable_now())},L)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(C){C.callback=null},e.unstable_forceFrameRate=function(C){0>C||125de?(C.sortIndex=K,n(g,C),r(p)===null&&C===r(g)&&(S?(R(H),H=-1):S=!0,ve(N,K-de))):(C.sortIndex=xe,n(p,C),A||E||(A=!0,B||(B=!0,re()))),C},e.unstable_shouldYield=ye,e.unstable_wrapCallback=function(C){var L=w;return function(){var K=w;w=L;try{return C.apply(this,arguments)}finally{w=K}}}})(Yh)),Yh}var fx;function KA(){return fx||(fx=1,Xh.exports=UA()),Xh.exports}var hx;function qA(){if(hx)return ol;hx=1;var e=KA(),n=J0(),r=lC();function s(t){var a="https://react.dev/errors/"+t;if(1xe||(t.current=de[xe],de[xe]=null,xe--)}function X(t,a){xe++,de[xe]=t.current,t.current=a}var ae=ze(null),ne=ze(null),_e=ze(null),te=ze(null);function pe(t,a){switch(X(_e,a),X(ne,t),X(ae,null),a.nodeType){case 9:case 11:t=(t=a.documentElement)&&(t=t.namespaceURI)?vb(t):0;break;default:if(t=a.tagName,a=a.namespaceURI)a=vb(a),t=yb(a,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}Y(ae),X(ae,t)}function Te(){Y(ae),Y(ne),Y(_e)}function Me(t){t.memoizedState!==null&&X(te,t);var a=ae.current,i=yb(a,t.type);a!==i&&(X(ne,t),X(ae,i))}function Ge(t){ne.current===t&&(Y(ae),Y(ne)),te.current===t&&(Y(te),nl._currentValue=K)}var Xe,$t;function Ot(t){if(Xe===void 0)try{throw Error()}catch(i){var a=i.stack.trim().match(/\n( *(at )?)/);Xe=a&&a[1]||"",$t=-1)":-1f||D[l]!==P[f]){var Q=` `+D[l].replace(" at new "," at ");return t.displayName&&Q.includes("")&&(Q=Q.replace("",t.displayName)),Q}while(1<=l&&0<=f);break}}}finally{na=!1,Error.prepareStackTrace=i}return(i=t?t.displayName||t.name:"")?Ot(i):""}function Hn(t,a){switch(t.tag){case 26:case 27:case 5:return Ot(t.type);case 16:return Ot("Lazy");case 13:return t.child!==a&&a!==null?Ot("Suspense Fallback"):Ot("Suspense");case 19:return Ot("SuspenseList");case 0:case 15:return aa(t.type,!1);case 11:return aa(t.type.render,!1);case 1:return aa(t.type,!0);case 31:return Ot("Activity");default:return""}}function Xi(t){try{var a="",i=null;do a+=Hn(t,i),i=t,t=t.return;while(t);return a}catch(l){return` Error generating stack: `+l.message+` `+l.stack}}var fn=Object.prototype.hasOwnProperty,M=e.unstable_scheduleCallback,I=e.unstable_cancelCallback,Z=e.unstable_shouldYield,fe=e.unstable_requestPaint,ie=e.unstable_now,se=e.unstable_getCurrentPriorityLevel,Ee=e.unstable_ImmediatePriority,at=e.unstable_UserBlockingPriority,rt=e.unstable_NormalPriority,nn=e.unstable_LowPriority,En=e.unstable_IdlePriority,Vn=e.log,Da=e.unstable_setDisableYieldValue,ya=null,Gt=null;function Bn(t){if(typeof Vn=="function"&&Da(t),Gt&&typeof Gt.setStrictMode=="function")try{Gt.setStrictMode(ya,t)}catch{}}var Xt=Math.clz32?Math.clz32:za,go=Math.log,Cr=Math.LN2;function za(t){return t>>>=0,t===0?32:31-(go(t)/Cr|0)|0}var Yi=256,Qi=262144,di=4194304;function Ma(t){var a=t&42;if(a!==0)return a;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function ke(t,a,i){var l=t.pendingLanes;if(l===0)return 0;var f=0,h=t.suspendedLanes,y=t.pingedLanes;t=t.warmLanes;var _=l&134217727;return _!==0?(l=_&~h,l!==0?f=Ma(l):(y&=_,y!==0?f=Ma(y):i||(i=_&~t,i!==0&&(f=Ma(i))))):(_=l&~h,_!==0?f=Ma(_):y!==0?f=Ma(y):i||(i=l&~t,i!==0&&(f=Ma(i)))),f===0?0:a!==0&&a!==f&&(a&h)===0&&(h=f&-f,i=a&-a,h>=i||h===32&&(i&4194048)!==0)?a:f}function _t(t,a){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&a)===0}function an(t,a){switch(t){case 1:case 2:case 4:case 8:case 64:return a+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function hn(){var t=di;return di<<=1,(di&62914560)===0&&(di=4194304),t}function jr(t){for(var a=[],i=0;31>i;i++)a.push(t);return a}function jt(t,a){t.pendingLanes|=a,a!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Cn(t,a,i,l,f,h){var y=t.pendingLanes;t.pendingLanes=i,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=i,t.entangledLanes&=i,t.errorRecoveryDisabledLanes&=i,t.shellSuspendCounter=0;var _=t.entanglements,D=t.expirationTimes,P=t.hiddenUpdates;for(i=y&~i;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var nE=/[\n"\\]/g;function ia(t){return t.replace(nE,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function Kd(t,a,i,l,f,h,y,_){t.name="",y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?t.type=y:t.removeAttribute("type"),a!=null?y==="number"?(a===0&&t.value===""||t.value!=a)&&(t.value=""+ra(a)):t.value!==""+ra(a)&&(t.value=""+ra(a)):y!=="submit"&&y!=="reset"||t.removeAttribute("value"),a!=null?qd(t,y,ra(a)):i!=null?qd(t,y,ra(i)):l!=null&&t.removeAttribute("value"),f==null&&h!=null&&(t.defaultChecked=!!h),f!=null&&(t.checked=f&&typeof f!="function"&&typeof f!="symbol"),_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?t.name=""+ra(_):t.removeAttribute("name")}function dg(t,a,i,l,f,h,y,_){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(t.type=h),a!=null||i!=null){if(!(h!=="submit"&&h!=="reset"||a!=null)){Ud(t);return}i=i!=null?""+ra(i):"",a=a!=null?""+ra(a):i,_||a===t.value||(t.value=a),t.defaultValue=a}l=l??f,l=typeof l!="function"&&typeof l!="symbol"&&!!l,t.checked=_?t.checked:!!l,t.defaultChecked=!!l,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(t.name=y),Ud(t)}function qd(t,a,i){a==="number"&&Bl(t.ownerDocument)===t||t.defaultValue===""+i||(t.defaultValue=""+i)}function rs(t,a,i,l){if(t=t.options,a){a={};for(var f=0;f"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Bd=!1;if(tr)try{var xo={};Object.defineProperty(xo,"passive",{get:function(){Bd=!0}}),window.addEventListener("test",xo,xo),window.removeEventListener("test",xo,xo)}catch{Bd=!1}var Or=null,Fd=null,Zl=null;function yg(){if(Zl)return Zl;var t,a=Fd,i=a.length,l,f="value"in Or?Or.value:Or.textContent,h=f.length;for(t=0;t=_o),Eg=" ",Cg=!1;function jg(t,a){switch(t){case"keyup":return RE.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ag(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ls=!1;function DE(t,a){switch(t){case"compositionend":return Ag(a);case"keypress":return a.which!==32?null:(Cg=!0,Eg);case"textInput":return t=a.data,t===Eg&&Cg?null:t;default:return null}}function zE(t,a){if(ls)return t==="compositionend"||!Yd&&jg(t,a)?(t=yg(),Zl=Fd=Or=null,ls=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1=a)return{node:i,offset:a-t};t=l}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=kg(i)}}function Ug(t,a){return t&&a?t===a?!0:t&&t.nodeType===3?!1:a&&a.nodeType===3?Ug(t,a.parentNode):"contains"in t?t.contains(a):t.compareDocumentPosition?!!(t.compareDocumentPosition(a)&16):!1:!1}function Kg(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var a=Bl(t.document);a instanceof t.HTMLIFrameElement;){try{var i=typeof a.contentWindow.location.href=="string"}catch{i=!1}if(i)t=a.contentWindow;else break;a=Bl(t.document)}return a}function Wd(t){var a=t&&t.nodeName&&t.nodeName.toLowerCase();return a&&(a==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||a==="textarea"||t.contentEditable==="true")}var IE=tr&&"documentMode"in document&&11>=document.documentMode,cs=null,ef=null,Ao=null,tf=!1;function qg(t,a,i){var l=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;tf||cs==null||cs!==Bl(l)||(l=cs,"selectionStart"in l&&Wd(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Ao&&jo(Ao,l)||(Ao=l,l=qc(ef,"onSelect"),0>=y,f-=y,ka=1<<32-Xt(a)+f|i<Ze?(tt=Ce,Ce=null):tt=Ce.sibling;var st=V(U,Ce,q[Ze],J);if(st===null){Ce===null&&(Ce=tt);break}t&&Ce&&st.alternate===null&&a(U,Ce),k=h(st,k,Ze),it===null?Oe=st:it.sibling=st,it=st,Ce=tt}if(Ze===q.length)return i(U,Ce),nt&&ar(U,Ze),Oe;if(Ce===null){for(;ZeZe?(tt=Ce,Ce=null):tt=Ce.sibling;var Yr=V(U,Ce,st.value,J);if(Yr===null){Ce===null&&(Ce=tt);break}t&&Ce&&Yr.alternate===null&&a(U,Ce),k=h(Yr,k,Ze),it===null?Oe=Yr:it.sibling=Yr,it=Yr,Ce=tt}if(st.done)return i(U,Ce),nt&&ar(U,Ze),Oe;if(Ce===null){for(;!st.done;Ze++,st=q.next())st=W(U,st.value,J),st!==null&&(k=h(st,k,Ze),it===null?Oe=st:it.sibling=st,it=st);return nt&&ar(U,Ze),Oe}for(Ce=l(Ce);!st.done;Ze++,st=q.next())st=F(Ce,U,Ze,st.value,J),st!==null&&(t&&st.alternate!==null&&Ce.delete(st.key===null?Ze:st.key),k=h(st,k,Ze),it===null?Oe=st:it.sibling=st,it=st);return t&&Ce.forEach(function(oC){return a(U,oC)}),nt&&ar(U,Ze),Oe}function vt(U,k,q,J){if(typeof q=="object"&&q!==null&&q.type===S&&q.key===null&&(q=q.props.children),typeof q=="object"&&q!==null){switch(q.$$typeof){case E:e:{for(var Oe=q.key;k!==null;){if(k.key===Oe){if(Oe=q.type,Oe===S){if(k.tag===7){i(U,k.sibling),J=f(k,q.props.children),J.return=U,U=J;break e}}else if(k.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===$&&_i(Oe)===k.type){i(U,k.sibling),J=f(k,q.props),zo(J,q),J.return=U,U=J;break e}i(U,k);break}else a(U,k);k=k.sibling}q.type===S?(J=yi(q.props.children,U.mode,J,q.key),J.return=U,U=J):(J=nc(q.type,q.key,q.props,null,U.mode,J),zo(J,q),J.return=U,U=J)}return y(U);case A:e:{for(Oe=q.key;k!==null;){if(k.key===Oe)if(k.tag===4&&k.stateNode.containerInfo===q.containerInfo&&k.stateNode.implementation===q.implementation){i(U,k.sibling),J=f(k,q.children||[]),J.return=U,U=J;break e}else{i(U,k);break}else a(U,k);k=k.sibling}J=cf(q,U.mode,J),J.return=U,U=J}return y(U);case $:return q=_i(q),vt(U,k,q,J)}if(ve(q))return be(U,k,q,J);if(re(q)){if(Oe=re(q),typeof Oe!="function")throw Error(s(150));return q=Oe.call(q),Ne(U,k,q,J)}if(typeof q.then=="function")return vt(U,k,cc(q),J);if(q.$$typeof===O)return vt(U,k,ic(U,q),J);uc(U,q)}return typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint"?(q=""+q,k!==null&&k.tag===6?(i(U,k.sibling),J=f(k,q),J.return=U,U=J):(i(U,k),J=lf(q,U.mode,J),J.return=U,U=J),y(U)):i(U,k)}return function(U,k,q,J){try{Do=0;var Oe=vt(U,k,q,J);return xs=null,Oe}catch(Ce){if(Ce===bs||Ce===oc)throw Ce;var it=Zn(29,Ce,null,U.mode);return it.lanes=J,it.return=U,it}finally{}}}var Ci=lv(!0),cv=lv(!1),zr=!1;function wf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Sf(t,a){t=t.updateQueue,a.updateQueue===t&&(a.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Mr(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function kr(t,a,i){var l=t.updateQueue;if(l===null)return null;if(l=l.shared,(lt&2)!==0){var f=l.pending;return f===null?a.next=a:(a.next=f.next,f.next=a),l.pending=a,a=tc(t),Zg(t,null,i),a}return ec(t,l,a,i),tc(t)}function Mo(t,a,i){if(a=a.updateQueue,a!==null&&(a=a.shared,(i&4194048)!==0)){var l=a.lanes;l&=t.pendingLanes,i|=l,a.lanes=i,jn(t,i)}}function _f(t,a){var i=t.updateQueue,l=t.alternate;if(l!==null&&(l=l.updateQueue,i===l)){var f=null,h=null;if(i=i.firstBaseUpdate,i!==null){do{var y={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};h===null?f=h=y:h=h.next=y,i=i.next}while(i!==null);h===null?f=h=a:h=h.next=a}else f=h=a;i={baseState:l.baseState,firstBaseUpdate:f,lastBaseUpdate:h,shared:l.shared,callbacks:l.callbacks},t.updateQueue=i;return}t=i.lastBaseUpdate,t===null?i.firstBaseUpdate=a:t.next=a,i.lastBaseUpdate=a}var Ef=!1;function ko(){if(Ef){var t=ys;if(t!==null)throw t}}function Lo(t,a,i,l){Ef=!1;var f=t.updateQueue;zr=!1;var h=f.firstBaseUpdate,y=f.lastBaseUpdate,_=f.shared.pending;if(_!==null){f.shared.pending=null;var D=_,P=D.next;D.next=null,y===null?h=P:y.next=P,y=D;var Q=t.alternate;Q!==null&&(Q=Q.updateQueue,_=Q.lastBaseUpdate,_!==y&&(_===null?Q.firstBaseUpdate=P:_.next=P,Q.lastBaseUpdate=D))}if(h!==null){var W=f.baseState;y=0,Q=P=D=null,_=h;do{var V=_.lane&-536870913,F=V!==_.lane;if(F?(et&V)===V:(l&V)===V){V!==0&&V===vs&&(Ef=!0),Q!==null&&(Q=Q.next={lane:0,tag:_.tag,payload:_.payload,callback:null,next:null});e:{var be=t,Ne=_;V=a;var vt=i;switch(Ne.tag){case 1:if(be=Ne.payload,typeof be=="function"){W=be.call(vt,W,V);break e}W=be;break e;case 3:be.flags=be.flags&-65537|128;case 0:if(be=Ne.payload,V=typeof be=="function"?be.call(vt,W,V):be,V==null)break e;W=v({},W,V);break e;case 2:zr=!0}}V=_.callback,V!==null&&(t.flags|=64,F&&(t.flags|=8192),F=f.callbacks,F===null?f.callbacks=[V]:F.push(V))}else F={lane:V,tag:_.tag,payload:_.payload,callback:_.callback,next:null},Q===null?(P=Q=F,D=W):Q=Q.next=F,y|=V;if(_=_.next,_===null){if(_=f.shared.pending,_===null)break;F=_,_=F.next,F.next=null,f.lastBaseUpdate=F,f.shared.pending=null}}while(!0);Q===null&&(D=W),f.baseState=D,f.firstBaseUpdate=P,f.lastBaseUpdate=Q,h===null&&(f.shared.lanes=0),Pr|=y,t.lanes=y,t.memoizedState=W}}function uv(t,a){if(typeof t!="function")throw Error(s(191,t));t.call(a)}function dv(t,a){var i=t.callbacks;if(i!==null)for(t.callbacks=null,t=0;th?h:8;var y=C.T,_={};C.T=_,Vf(t,!1,a,i);try{var D=f(),P=C.S;if(P!==null&&P(_,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var Q=YE(D,l);qo(t,a,Q,Qn(t))}else qo(t,a,l,Qn(t))}catch(W){qo(t,a,{then:function(){},status:"rejected",reason:W},Qn())}finally{L.p=h,y!==null&&_.types!==null&&(y.types=_.types),C.T=y}}function n2(){}function If(t,a,i,l){if(t.tag!==5)throw Error(s(476));var f=Vv(t).queue;Hv(t,f,a,K,i===null?n2:function(){return Bv(t),i(l)})}function Vv(t){var a=t.memoizedState;if(a!==null)return a;a={memoizedState:K,baseState:K,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:or,lastRenderedState:K},next:null};var i={};return a.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:or,lastRenderedState:i},next:null},t.memoizedState=a,t=t.alternate,t!==null&&(t.memoizedState=a),a}function Bv(t){var a=Vv(t);a.next===null&&(a=t.alternate.memoizedState),qo(t,a.next.queue,{},Qn())}function Hf(){return cn(nl)}function Fv(){return zt().memoizedState}function Zv(){return zt().memoizedState}function a2(t){for(var a=t.return;a!==null;){switch(a.tag){case 24:case 3:var i=Qn();t=Mr(i);var l=kr(a,t,i);l!==null&&(Mn(l,a,i),Mo(l,a,i)),a={cache:vf()},t.payload=a;return}a=a.return}}function r2(t,a,i){var l=Qn();i={lane:l,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},xc(t)?Gv(a,i):(i=sf(t,a,i,l),i!==null&&(Mn(i,t,l),Xv(i,a,l)))}function $v(t,a,i){var l=Qn();qo(t,a,i,l)}function qo(t,a,i,l){var f={lane:l,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(xc(t))Gv(a,f);else{var h=t.alternate;if(t.lanes===0&&(h===null||h.lanes===0)&&(h=a.lastRenderedReducer,h!==null))try{var y=a.lastRenderedState,_=h(y,i);if(f.hasEagerState=!0,f.eagerState=_,Fn(_,y))return ec(t,a,f,0),yt===null&&Wl(),!1}catch{}finally{}if(i=sf(t,a,f,l),i!==null)return Mn(i,t,l),Xv(i,a,l),!0}return!1}function Vf(t,a,i,l){if(l={lane:2,revertLane:wh(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},xc(t)){if(a)throw Error(s(479))}else a=sf(t,i,l,2),a!==null&&Mn(a,t,2)}function xc(t){var a=t.alternate;return t===Ve||a!==null&&a===Ve}function Gv(t,a){Ss=hc=!0;var i=t.pending;i===null?a.next=a:(a.next=i.next,i.next=a),t.pending=a}function Xv(t,a,i){if((i&4194048)!==0){var l=a.lanes;l&=t.pendingLanes,i|=l,a.lanes=i,jn(t,i)}}var Po={readContext:cn,use:gc,useCallback:Tt,useContext:Tt,useEffect:Tt,useImperativeHandle:Tt,useLayoutEffect:Tt,useInsertionEffect:Tt,useMemo:Tt,useReducer:Tt,useRef:Tt,useState:Tt,useDebugValue:Tt,useDeferredValue:Tt,useTransition:Tt,useSyncExternalStore:Tt,useId:Tt,useHostTransitionStatus:Tt,useFormState:Tt,useActionState:Tt,useOptimistic:Tt,useMemoCache:Tt,useCacheRefresh:Tt};Po.useEffectEvent=Tt;var Yv={readContext:cn,use:gc,useCallback:function(t,a){return bn().memoizedState=[t,a===void 0?null:a],t},useContext:cn,useEffect:zv,useImperativeHandle:function(t,a,i){i=i!=null?i.concat([t]):null,yc(4194308,4,Uv.bind(null,a,t),i)},useLayoutEffect:function(t,a){return yc(4194308,4,t,a)},useInsertionEffect:function(t,a){yc(4,2,t,a)},useMemo:function(t,a){var i=bn();a=a===void 0?null:a;var l=t();if(ji){Bn(!0);try{t()}finally{Bn(!1)}}return i.memoizedState=[l,a],l},useReducer:function(t,a,i){var l=bn();if(i!==void 0){var f=i(a);if(ji){Bn(!0);try{i(a)}finally{Bn(!1)}}}else f=a;return l.memoizedState=l.baseState=f,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:f},l.queue=t,t=t.dispatch=r2.bind(null,Ve,t),[l.memoizedState,t]},useRef:function(t){var a=bn();return t={current:t},a.memoizedState=t},useState:function(t){t=Lf(t);var a=t.queue,i=$v.bind(null,Ve,a);return a.dispatch=i,[t.memoizedState,i]},useDebugValue:qf,useDeferredValue:function(t,a){var i=bn();return Pf(i,t,a)},useTransition:function(){var t=Lf(!1);return t=Hv.bind(null,Ve,t.queue,!0,!1),bn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,a,i){var l=Ve,f=bn();if(nt){if(i===void 0)throw Error(s(407));i=i()}else{if(i=a(),yt===null)throw Error(s(349));(et&127)!==0||vv(l,a,i)}f.memoizedState=i;var h={value:i,getSnapshot:a};return f.queue=h,zv(bv.bind(null,l,h,t),[t]),l.flags|=2048,Es(9,{destroy:void 0},yv.bind(null,l,h,i,a),null),i},useId:function(){var t=bn(),a=yt.identifierPrefix;if(nt){var i=La,l=ka;i=(l&~(1<<32-Xt(l)-1)).toString(32)+i,a="_"+a+"R_"+i,i=mc++,0<\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof l.is=="string"?y.createElement("select",{is:l.is}):y.createElement("select"),l.multiple?h.multiple=!0:l.size&&(h.size=l.size);break;default:h=typeof l.is=="string"?y.createElement(f,{is:l.is}):y.createElement(f)}}h[on]=a,h[On]=l;e:for(y=a.child;y!==null;){if(y.tag===5||y.tag===6)h.appendChild(y.stateNode);else if(y.tag!==4&&y.tag!==27&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===a)break e;for(;y.sibling===null;){if(y.return===null||y.return===a)break e;y=y.return}y.sibling.return=y.return,y=y.sibling}a.stateNode=h;e:switch(dn(h,f,l),f){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&cr(a)}}return St(a),ah(a,a.type,t===null?null:t.memoizedProps,a.pendingProps,i),null;case 6:if(t&&a.stateNode!=null)t.memoizedProps!==l&&cr(a);else{if(typeof l!="string"&&a.stateNode===null)throw Error(s(166));if(t=_e.current,ps(a)){if(t=a.stateNode,i=a.memoizedProps,l=null,f=ln,f!==null)switch(f.tag){case 27:case 5:l=f.memoizedProps}t[on]=a,t=!!(t.nodeValue===i||l!==null&&l.suppressHydrationWarning===!0||pb(t.nodeValue,i)),t||Nr(a,!0)}else t=Pc(t).createTextNode(l),t[on]=a,a.stateNode=t}return St(a),null;case 31:if(i=a.memoizedState,t===null||t.memoizedState!==null){if(l=ps(a),i!==null){if(t===null){if(!l)throw Error(s(318));if(t=a.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(557));t[on]=a}else bi(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;St(a),t=!1}else i=hf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=i),t=!0;if(!t)return a.flags&256?(Gn(a),a):(Gn(a),null);if((a.flags&128)!==0)throw Error(s(558))}return St(a),null;case 13:if(l=a.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(f=ps(a),l!==null&&l.dehydrated!==null){if(t===null){if(!f)throw Error(s(318));if(f=a.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(s(317));f[on]=a}else bi(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;St(a),f=!1}else f=hf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=f),f=!0;if(!f)return a.flags&256?(Gn(a),a):(Gn(a),null)}return Gn(a),(a.flags&128)!==0?(a.lanes=i,a):(i=l!==null,t=t!==null&&t.memoizedState!==null,i&&(l=a.child,f=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(f=l.alternate.memoizedState.cachePool.pool),h=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(h=l.memoizedState.cachePool.pool),h!==f&&(l.flags|=2048)),i!==t&&i&&(a.child.flags|=8192),Cc(a,a.updateQueue),St(a),null);case 4:return Te(),t===null&&Ch(a.stateNode.containerInfo),St(a),null;case 10:return ir(a.type),St(a),null;case 19:if(Y(Dt),l=a.memoizedState,l===null)return St(a),null;if(f=(a.flags&128)!==0,h=l.rendering,h===null)if(f)Ho(l,!1);else{if(Rt!==0||t!==null&&(t.flags&128)!==0)for(t=a.child;t!==null;){if(h=fc(t),h!==null){for(a.flags|=128,Ho(l,!1),t=h.updateQueue,a.updateQueue=t,Cc(a,t),a.subtreeFlags=0,t=i,i=a.child;i!==null;)$g(i,t),i=i.sibling;return X(Dt,Dt.current&1|2),nt&&ar(a,l.treeForkCount),a.child}t=t.sibling}l.tail!==null&&ie()>Rc&&(a.flags|=128,f=!0,Ho(l,!1),a.lanes=4194304)}else{if(!f)if(t=fc(h),t!==null){if(a.flags|=128,f=!0,t=t.updateQueue,a.updateQueue=t,Cc(a,t),Ho(l,!0),l.tail===null&&l.tailMode==="hidden"&&!h.alternate&&!nt)return St(a),null}else 2*ie()-l.renderingStartTime>Rc&&i!==536870912&&(a.flags|=128,f=!0,Ho(l,!1),a.lanes=4194304);l.isBackwards?(h.sibling=a.child,a.child=h):(t=l.last,t!==null?t.sibling=h:a.child=h,l.last=h)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=ie(),t.sibling=null,i=Dt.current,X(Dt,f?i&1|2:i&1),nt&&ar(a,l.treeForkCount),t):(St(a),null);case 22:case 23:return Gn(a),jf(),l=a.memoizedState!==null,t!==null?t.memoizedState!==null!==l&&(a.flags|=8192):l&&(a.flags|=8192),l?(i&536870912)!==0&&(a.flags&128)===0&&(St(a),a.subtreeFlags&6&&(a.flags|=8192)):St(a),i=a.updateQueue,i!==null&&Cc(a,i.retryQueue),i=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),l=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(l=a.memoizedState.cachePool.pool),l!==i&&(a.flags|=2048),t!==null&&Y(Si),null;case 24:return i=null,t!==null&&(i=t.memoizedState.cache),a.memoizedState.cache!==i&&(a.flags|=2048),ir(qt),St(a),null;case 25:return null;case 30:return null}throw Error(s(156,a.tag))}function c2(t,a){switch(df(a),a.tag){case 1:return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 3:return ir(qt),Te(),t=a.flags,(t&65536)!==0&&(t&128)===0?(a.flags=t&-65537|128,a):null;case 26:case 27:case 5:return Ge(a),null;case 31:if(a.memoizedState!==null){if(Gn(a),a.alternate===null)throw Error(s(340));bi()}return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 13:if(Gn(a),t=a.memoizedState,t!==null&&t.dehydrated!==null){if(a.alternate===null)throw Error(s(340));bi()}return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 19:return Y(Dt),null;case 4:return Te(),null;case 10:return ir(a.type),null;case 22:case 23:return Gn(a),jf(),t!==null&&Y(Si),t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 24:return ir(qt),null;case 25:return null;default:return null}}function xy(t,a){switch(df(a),a.tag){case 3:ir(qt),Te();break;case 26:case 27:case 5:Ge(a);break;case 4:Te();break;case 31:a.memoizedState!==null&&Gn(a);break;case 13:Gn(a);break;case 19:Y(Dt);break;case 10:ir(a.type);break;case 22:case 23:Gn(a),jf(),t!==null&&Y(Si);break;case 24:ir(qt)}}function Vo(t,a){try{var i=a.updateQueue,l=i!==null?i.lastEffect:null;if(l!==null){var f=l.next;i=f;do{if((i.tag&t)===t){l=void 0;var h=i.create,y=i.inst;l=h(),y.destroy=l}i=i.next}while(i!==f)}}catch(_){ft(a,a.return,_)}}function Kr(t,a,i){try{var l=a.updateQueue,f=l!==null?l.lastEffect:null;if(f!==null){var h=f.next;l=h;do{if((l.tag&t)===t){var y=l.inst,_=y.destroy;if(_!==void 0){y.destroy=void 0,f=a;var D=i,P=_;try{P()}catch(Q){ft(f,D,Q)}}}l=l.next}while(l!==h)}}catch(Q){ft(a,a.return,Q)}}function wy(t){var a=t.updateQueue;if(a!==null){var i=t.stateNode;try{dv(a,i)}catch(l){ft(t,t.return,l)}}}function Sy(t,a,i){i.props=Ai(t.type,t.memoizedProps),i.state=t.memoizedState;try{i.componentWillUnmount()}catch(l){ft(t,a,l)}}function Bo(t,a){try{var i=t.ref;if(i!==null){switch(t.tag){case 26:case 27:case 5:var l=t.stateNode;break;case 30:l=t.stateNode;break;default:l=t.stateNode}typeof i=="function"?t.refCleanup=i(l):i.current=l}}catch(f){ft(t,a,f)}}function Ua(t,a){var i=t.ref,l=t.refCleanup;if(i!==null)if(typeof l=="function")try{l()}catch(f){ft(t,a,f)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(f){ft(t,a,f)}else i.current=null}function _y(t){var a=t.type,i=t.memoizedProps,l=t.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":i.autoFocus&&l.focus();break e;case"img":i.src?l.src=i.src:i.srcSet&&(l.srcset=i.srcSet)}}catch(f){ft(t,t.return,f)}}function rh(t,a,i){try{var l=t.stateNode;N2(l,t.type,i,a),l[On]=a}catch(f){ft(t,t.return,f)}}function Ey(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Fr(t.type)||t.tag===4}function ih(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Ey(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Fr(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function sh(t,a,i){var l=t.tag;if(l===5||l===6)t=t.stateNode,a?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(t,a):(a=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,a.appendChild(t),i=i._reactRootContainer,i!=null||a.onclick!==null||(a.onclick=er));else if(l!==4&&(l===27&&Fr(t.type)&&(i=t.stateNode,a=null),t=t.child,t!==null))for(sh(t,a,i),t=t.sibling;t!==null;)sh(t,a,i),t=t.sibling}function jc(t,a,i){var l=t.tag;if(l===5||l===6)t=t.stateNode,a?i.insertBefore(t,a):i.appendChild(t);else if(l!==4&&(l===27&&Fr(t.type)&&(i=t.stateNode),t=t.child,t!==null))for(jc(t,a,i),t=t.sibling;t!==null;)jc(t,a,i),t=t.sibling}function Cy(t){var a=t.stateNode,i=t.memoizedProps;try{for(var l=t.type,f=a.attributes;f.length;)a.removeAttributeNode(f[0]);dn(a,l,i),a[on]=t,a[On]=i}catch(h){ft(t,t.return,h)}}var ur=!1,Ht=!1,oh=!1,jy=typeof WeakSet=="function"?WeakSet:Set,sn=null;function u2(t,a){if(t=t.containerInfo,Oh=$c,t=Kg(t),Wd(t)){if("selectionStart"in t)var i={start:t.selectionStart,end:t.selectionEnd};else e:{i=(i=t.ownerDocument)&&i.defaultView||window;var l=i.getSelection&&i.getSelection();if(l&&l.rangeCount!==0){i=l.anchorNode;var f=l.anchorOffset,h=l.focusNode;l=l.focusOffset;try{i.nodeType,h.nodeType}catch{i=null;break e}var y=0,_=-1,D=-1,P=0,Q=0,W=t,V=null;t:for(;;){for(var F;W!==i||f!==0&&W.nodeType!==3||(_=y+f),W!==h||l!==0&&W.nodeType!==3||(D=y+l),W.nodeType===3&&(y+=W.nodeValue.length),(F=W.firstChild)!==null;)V=W,W=F;for(;;){if(W===t)break t;if(V===i&&++P===f&&(_=y),V===h&&++Q===l&&(D=y),(F=W.nextSibling)!==null)break;W=V,V=W.parentNode}W=F}i=_===-1||D===-1?null:{start:_,end:D}}else i=null}i=i||{start:0,end:0}}else i=null;for(Th={focusedElem:t,selectionRange:i},$c=!1,sn=a;sn!==null;)if(a=sn,t=a.child,(a.subtreeFlags&1028)!==0&&t!==null)t.return=a,sn=t;else for(;sn!==null;){switch(a=sn,h=a.alternate,t=a.flags,a.tag){case 0:if((t&4)!==0&&(t=a.updateQueue,t=t!==null?t.events:null,t!==null))for(i=0;i title"))),dn(h,l,i),h[on]=t,rn(h),l=h;break e;case"link":var y=Db("link","href",f).get(l+(i.href||""));if(y){for(var _=0;_vt&&(y=vt,vt=Ne,Ne=y);var U=Lg(_,Ne),k=Lg(_,vt);if(U&&k&&(F.rangeCount!==1||F.anchorNode!==U.node||F.anchorOffset!==U.offset||F.focusNode!==k.node||F.focusOffset!==k.offset)){var q=W.createRange();q.setStart(U.node,U.offset),F.removeAllRanges(),Ne>vt?(F.addRange(q),F.extend(k.node,k.offset)):(q.setEnd(k.node,k.offset),F.addRange(q))}}}}for(W=[],F=_;F=F.parentNode;)F.nodeType===1&&W.push({element:F,left:F.scrollLeft,top:F.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_i?32:i,C.T=null,i=mh,mh=null;var h=Hr,y=pr;if(Yt=0,Ts=Hr=null,pr=0,(lt&6)!==0)throw Error(s(331));var _=lt;if(lt|=4,Uy(h.current),My(h,h.current,y,i),lt=_,Yo(0,!1),Gt&&typeof Gt.onPostCommitFiberRoot=="function")try{Gt.onPostCommitFiberRoot(ya,h)}catch{}return!0}finally{L.p=f,C.T=l,tb(t,a)}}function ab(t,a,i){a=oa(i,a),a=$f(t.stateNode,a,2),t=kr(t,a,2),t!==null&&(jt(t,2),Ka(t))}function ft(t,a,i){if(t.tag===3)ab(t,t,i);else for(;a!==null;){if(a.tag===3){ab(a,t,i);break}else if(a.tag===1){var l=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Ir===null||!Ir.has(l))){t=oa(i,t),i=ry(2),l=kr(a,i,2),l!==null&&(iy(i,l,a,t),jt(l,2),Ka(l));break}}a=a.return}}function yh(t,a,i){var l=t.pingCache;if(l===null){l=t.pingCache=new h2;var f=new Set;l.set(a,f)}else f=l.get(a),f===void 0&&(f=new Set,l.set(a,f));f.has(i)||(uh=!0,f.add(i),t=y2.bind(null,t,a,i),a.then(t,t))}function y2(t,a,i){var l=t.pingCache;l!==null&&l.delete(a),t.pingedLanes|=t.suspendedLanes&i,t.warmLanes&=~i,yt===t&&(et&i)===i&&(Rt===4||Rt===3&&(et&62914560)===et&&300>ie()-Tc?(lt&2)===0&&Rs(t,0):dh|=i,Os===et&&(Os=0)),Ka(t)}function rb(t,a){a===0&&(a=hn()),t=vi(t,a),t!==null&&(jt(t,a),Ka(t))}function b2(t){var a=t.memoizedState,i=0;a!==null&&(i=a.retryLane),rb(t,i)}function x2(t,a){var i=0;switch(t.tag){case 31:case 13:var l=t.stateNode,f=t.memoizedState;f!==null&&(i=f.retryLane);break;case 19:l=t.stateNode;break;case 22:l=t.stateNode._retryCache;break;default:throw Error(s(314))}l!==null&&l.delete(a),rb(t,i)}function w2(t,a){return M(t,a)}var Lc=null,Ds=null,bh=!1,Uc=!1,xh=!1,Br=0;function Ka(t){t!==Ds&&t.next===null&&(Ds===null?Lc=Ds=t:Ds=Ds.next=t),Uc=!0,bh||(bh=!0,_2())}function Yo(t,a){if(!xh&&Uc){xh=!0;do for(var i=!1,l=Lc;l!==null;){if(t!==0){var f=l.pendingLanes;if(f===0)var h=0;else{var y=l.suspendedLanes,_=l.pingedLanes;h=(1<<31-Xt(42|t)+1)-1,h&=f&~(y&~_),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(i=!0,lb(l,h))}else h=et,h=ke(l,l===yt?h:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(h&3)===0||_t(l,h)||(i=!0,lb(l,h));l=l.next}while(i);xh=!1}}function S2(){ib()}function ib(){Uc=bh=!1;var t=0;Br!==0&&z2()&&(t=Br);for(var a=ie(),i=null,l=Lc;l!==null;){var f=l.next,h=sb(l,a);h===0?(l.next=null,i===null?Lc=f:i.next=f,f===null&&(Ds=i)):(i=l,(t!==0||(h&3)!==0)&&(Uc=!0)),l=f}Yt!==0&&Yt!==5||Yo(t),Br!==0&&(Br=0)}function sb(t,a){for(var i=t.suspendedLanes,l=t.pingedLanes,f=t.expirationTimes,h=t.pendingLanes&-62914561;0_)break;var Q=D.transferSize,W=D.initiatorType;Q&&gb(W)&&(D=D.responseEnd,y+=Q*(D<_?1:(_-P)/(D-P)))}if(--l,a+=8*(h+y)/(f.duration/1e3),t++,10"u"?null:document;function Ob(t,a,i){var l=zs;if(l&&typeof a=="string"&&a){var f=ia(a);f='link[rel="'+t+'"][href="'+f+'"]',typeof i=="string"&&(f+='[crossorigin="'+i+'"]'),Ab.has(f)||(Ab.add(f),t={rel:t,crossOrigin:i,href:a},l.querySelector(f)===null&&(a=l.createElement("link"),dn(a,"link",t),rn(a),l.head.appendChild(a)))}}function H2(t){gr.D(t),Ob("dns-prefetch",t,null)}function V2(t,a){gr.C(t,a),Ob("preconnect",t,a)}function B2(t,a,i){gr.L(t,a,i);var l=zs;if(l&&t&&a){var f='link[rel="preload"][as="'+ia(a)+'"]';a==="image"&&i&&i.imageSrcSet?(f+='[imagesrcset="'+ia(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(f+='[imagesizes="'+ia(i.imageSizes)+'"]')):f+='[href="'+ia(t)+'"]';var h=f;switch(a){case"style":h=Ms(t);break;case"script":h=ks(t)}ha.has(h)||(t=v({rel:"preload",href:a==="image"&&i&&i.imageSrcSet?void 0:t,as:a},i),ha.set(h,t),l.querySelector(f)!==null||a==="style"&&l.querySelector(el(h))||a==="script"&&l.querySelector(tl(h))||(a=l.createElement("link"),dn(a,"link",t),rn(a),l.head.appendChild(a)))}}function F2(t,a){gr.m(t,a);var i=zs;if(i&&t){var l=a&&typeof a.as=="string"?a.as:"script",f='link[rel="modulepreload"][as="'+ia(l)+'"][href="'+ia(t)+'"]',h=f;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=ks(t)}if(!ha.has(h)&&(t=v({rel:"modulepreload",href:t},a),ha.set(h,t),i.querySelector(f)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(tl(h)))return}l=i.createElement("link"),dn(l,"link",t),rn(l),i.head.appendChild(l)}}}function Z2(t,a,i){gr.S(t,a,i);var l=zs;if(l&&t){var f=ns(l).hoistableStyles,h=Ms(t);a=a||"default";var y=f.get(h);if(!y){var _={loading:0,preload:null};if(y=l.querySelector(el(h)))_.loading=5;else{t=v({rel:"stylesheet",href:t,"data-precedence":a},i),(i=ha.get(h))&&Lh(t,i);var D=y=l.createElement("link");rn(D),dn(D,"link",t),D._p=new Promise(function(P,Q){D.onload=P,D.onerror=Q}),D.addEventListener("load",function(){_.loading|=1}),D.addEventListener("error",function(){_.loading|=2}),_.loading|=4,Hc(y,a,l)}y={type:"stylesheet",instance:y,count:1,state:_},f.set(h,y)}}}function $2(t,a){gr.X(t,a);var i=zs;if(i&&t){var l=ns(i).hoistableScripts,f=ks(t),h=l.get(f);h||(h=i.querySelector(tl(f)),h||(t=v({src:t,async:!0},a),(a=ha.get(f))&&Uh(t,a),h=i.createElement("script"),rn(h),dn(h,"link",t),i.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},l.set(f,h))}}function G2(t,a){gr.M(t,a);var i=zs;if(i&&t){var l=ns(i).hoistableScripts,f=ks(t),h=l.get(f);h||(h=i.querySelector(tl(f)),h||(t=v({src:t,async:!0,type:"module"},a),(a=ha.get(f))&&Uh(t,a),h=i.createElement("script"),rn(h),dn(h,"link",t),i.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},l.set(f,h))}}function Tb(t,a,i,l){var f=(f=_e.current)?Ic(f):null;if(!f)throw Error(s(446));switch(t){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(a=Ms(i.href),i=ns(f).hoistableStyles,l=i.get(a),l||(l={type:"style",instance:null,count:0,state:null},i.set(a,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){t=Ms(i.href);var h=ns(f).hoistableStyles,y=h.get(t);if(y||(f=f.ownerDocument||f,y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(t,y),(h=f.querySelector(el(t)))&&!h._p&&(y.instance=h,y.state.loading=5),ha.has(t)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},ha.set(t,i),h||X2(f,t,i,y.state))),a&&l===null)throw Error(s(528,""));return y}if(a&&l!==null)throw Error(s(529,""));return null;case"script":return a=i.async,i=i.src,typeof i=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=ks(i),i=ns(f).hoistableScripts,l=i.get(a),l||(l={type:"script",instance:null,count:0,state:null},i.set(a,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,t))}}function Ms(t){return'href="'+ia(t)+'"'}function el(t){return'link[rel="stylesheet"]['+t+"]"}function Rb(t){return v({},t,{"data-precedence":t.precedence,precedence:null})}function X2(t,a,i,l){t.querySelector('link[rel="preload"][as="style"]['+a+"]")?l.loading=1:(a=t.createElement("link"),l.preload=a,a.addEventListener("load",function(){return l.loading|=1}),a.addEventListener("error",function(){return l.loading|=2}),dn(a,"link",i),rn(a),t.head.appendChild(a))}function ks(t){return'[src="'+ia(t)+'"]'}function tl(t){return"script[async]"+t}function Nb(t,a,i){if(a.count++,a.instance===null)switch(a.type){case"style":var l=t.querySelector('style[data-href~="'+ia(i.href)+'"]');if(l)return a.instance=l,rn(l),l;var f=v({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return l=(t.ownerDocument||t).createElement("style"),rn(l),dn(l,"style",f),Hc(l,i.precedence,t),a.instance=l;case"stylesheet":f=Ms(i.href);var h=t.querySelector(el(f));if(h)return a.state.loading|=4,a.instance=h,rn(h),h;l=Rb(i),(f=ha.get(f))&&Lh(l,f),h=(t.ownerDocument||t).createElement("link"),rn(h);var y=h;return y._p=new Promise(function(_,D){y.onload=_,y.onerror=D}),dn(h,"link",l),a.state.loading|=4,Hc(h,i.precedence,t),a.instance=h;case"script":return h=ks(i.src),(f=t.querySelector(tl(h)))?(a.instance=f,rn(f),f):(l=i,(f=ha.get(h))&&(l=v({},i),Uh(l,f)),t=t.ownerDocument||t,f=t.createElement("script"),rn(f),dn(f,"link",l),t.head.appendChild(f),a.instance=f);case"void":return null;default:throw Error(s(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(l=a.instance,a.state.loading|=4,Hc(l,i.precedence,t));return a.instance}function Hc(t,a,i){for(var l=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=l.length?l[l.length-1]:null,h=f,y=0;y title"):null)}function Y2(t,a,i){if(i===1||a.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;switch(a.rel){case"stylesheet":return t=a.disabled,typeof a.precedence=="string"&&t==null;default:return!0}case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function Mb(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function Q2(t,a,i,l){if(i.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var f=Ms(l.href),h=a.querySelector(el(f));if(h){a=h._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(t.count++,t=Bc.bind(t),a.then(t,t)),i.state.loading|=4,i.instance=h,rn(h);return}h=a.ownerDocument||a,l=Rb(l),(f=ha.get(f))&&Lh(l,f),h=h.createElement("link"),rn(h);var y=h;y._p=new Promise(function(_,D){y.onload=_,y.onerror=D}),dn(h,"link",l),i.instance=h}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(i,a),(a=i.state.preload)&&(i.state.loading&3)===0&&(t.count++,i=Bc.bind(t),a.addEventListener("load",i),a.addEventListener("error",i))}}var Kh=0;function J2(t,a){return t.stylesheets&&t.count===0&&Zc(t,t.stylesheets),0Kh?50:800)+a);return t.unsuspend=i,function(){t.unsuspend=null,clearTimeout(l),clearTimeout(f)}}:null}function Bc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Zc(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Fc=null;function Zc(t,a){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Fc=new Map,a.forEach(W2,t),Fc=null,Bc.call(t))}function W2(t,a){if(!(a.state.loading&4)){var i=Fc.get(t);if(i)var l=i.get(null);else{i=new Map,Fc.set(t,i);for(var f=t.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Gh.exports=qA(),Gh.exports}var IA=PA();const Pu="autoglue.tokens",Om="autoglue.auth-change";let Pa=Tm();function Tm(){try{const e=localStorage.getItem(Pu);return e?JSON.parse(e):null}catch{return null}}function HA(e){e?localStorage.setItem(Pu,JSON.stringify(e)):localStorage.removeItem(Pu)}function VA(e){window.dispatchEvent(new CustomEvent(Om,{detail:e}))}const yn={get(){return Pa},set(e){Pa=e,HA(e),VA(e)},reload(){return Pa=Tm(),Pa},isAuthed(){return!!Pa?.access_token},getAccessToken(){return Pa?.access_token??null},isExpired(e=Math.floor(Date.now()/1e3)){const n=px(Pa?.access_token);return n!==null?e>=n:!0},willExpireSoon(e=60,n=Math.floor(Date.now()/1e3)){const r=px(Pa?.access_token);return r!==null?r-n<=e:!0},logout(){yn.set(null)},subscribe(e){const n=s=>e(s.detail??null),r=s=>{s.key===Pu&&(Pa=Tm(),e(Pa))};return window.addEventListener(Om,n),window.addEventListener("storage",r),()=>{window.removeEventListener(Om,n),window.removeEventListener("storage",r)}}};function px(e){if(!e)return null;const n=e.split(".");if(n.length<2)return null;try{const r=JSON.parse(atob(BA(n[1])));return(typeof r?.exp=="number"?r.exp:null)??null}catch{return null}}function BA(e){return e.replace(/-/g,"+").replace(/_/g,"/")+"==".slice((2-e.length*3%4)%4)}const Rm="autoglue.org";let au=localStorage.getItem(Rm);const Va={get(){return au},set(e){au=e,localStorage.setItem(Rm,e),window.dispatchEvent(new CustomEvent("autoglue:org-change",{detail:e}))},subscribe(e){const n=s=>e(s.detail??null),r=s=>{s.key===Rm&&(au=s.newValue,e(au))};return window.addEventListener("autoglue:org-change",n),window.addEventListener("storage",r),()=>{window.removeEventListener("autoglue:org-change",n),window.removeEventListener("storage",r)}}},FA="http://localhost:8080/api/v1".replace(/\/+$/,"");class yw{constructor(n={}){this.configuration=n}set config(n){this.configuration=n}get basePath(){return this.configuration.basePath!=null?this.configuration.basePath:FA}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||bw}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){const n=this.configuration.apiKey;if(n)return typeof n=="function"?n:()=>n}get accessToken(){const n=this.configuration.accessToken;if(n)return typeof n=="function"?n:async()=>n}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}}const ZA=new yw;class ga{constructor(n=ZA){this.configuration=n,this.middleware=n.middleware}static jsonRegex=new RegExp("^(:?application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(:?;.*)?$","i");middleware;withMiddleware(...n){const r=this.clone();return r.middleware=r.middleware.concat(...n),r}withPreMiddleware(...n){const r=n.map(s=>({pre:s}));return this.withMiddleware(...r)}withPostMiddleware(...n){const r=n.map(s=>({post:s}));return this.withMiddleware(...r)}isJsonMime(n){return n?ga.jsonRegex.test(n):!1}async request(n,r){const{url:s,init:o}=await this.createFetchParams(n,r),u=await this.fetchApi(s,o);if(u&&u.status>=200&&u.status<300)return u;throw new XA(u,"Response returned an error code")}async createFetchParams(n,r){let s=this.configuration.basePath+n.path;n.query!==void 0&&Object.keys(n.query).length!==0&&(s+="?"+this.configuration.queryParamsStringify(n.query));const o=Object.assign({},this.configuration.headers,n.headers);Object.keys(o).forEach(x=>o[x]===void 0?delete o[x]:{});const u=typeof r=="function"?r:async()=>r,d={method:n.method,headers:o,body:n.body,credentials:this.configuration.credentials},m={...d,...await u({init:d,context:n})};let p;GA(m.body)||m.body instanceof URLSearchParams||$A(m.body)?p=m.body:this.isJsonMime(o["Content-Type"])?p=JSON.stringify(m.body):p=m.body;const g={...m,body:p};return{url:s,init:g}}fetchApi=async(n,r)=>{let s={url:n,init:r};for(const u of this.middleware)u.pre&&(s=await u.pre({fetch:this.fetchApi,...s})||s);let o;try{o=await(this.configuration.fetchApi||fetch)(s.url,s.init)}catch(u){for(const d of this.middleware)d.onError&&(o=await d.onError({fetch:this.fetchApi,url:s.url,init:s.init,error:u,response:o?o.clone():void 0})||o);if(o===void 0)throw u instanceof Error?new YA(u,"The request failed and the interceptors did not return an alternative response"):u}for(const u of this.middleware)u.post&&(o=await u.post({fetch:this.fetchApi,url:s.url,init:s.init,response:o.clone()})||o);return o};clone(){const n=this.constructor,r=new n(this.configuration);return r.middleware=this.middleware.slice(),r}}function $A(e){return typeof Blob<"u"&&e instanceof Blob}function GA(e){return typeof FormData<"u"&&e instanceof FormData}class XA extends Error{constructor(n,r){super(r),this.response=n}name="ResponseError"}class YA extends Error{constructor(n,r){super(r),this.cause=n}name="FetchError"}class De extends Error{constructor(n,r){super(r),this.field=n}name="RequiredError"}function bw(e,n=""){return Object.keys(e).map(r=>xw(r,e[r],n)).filter(r=>r.length>0).join("&")}function xw(e,n,r=""){const s=r+(r.length?`[${e}]`:e);if(n instanceof Array){const o=n.map(u=>encodeURIComponent(String(u))).join(`&${encodeURIComponent(s)}=`);return`${encodeURIComponent(s)}=${o}`}if(n instanceof Set){const o=Array.from(n);return xw(e,o,r)}return n instanceof Date?`${encodeURIComponent(s)}=${encodeURIComponent(n.toISOString())}`:n instanceof Object?bw(n,s):`${encodeURIComponent(s)}=${encodeURIComponent(String(n))}`}class Le{constructor(n,r=s=>s){this.raw=n,this.transformer=r}async value(){return this.transformer(await this.raw.json())}}class _l{constructor(n){this.raw=n}async value(){}}class Js{constructor(n){this.raw=n}async value(){return await this.raw.text()}}function ru(e){return QA(e)}function QA(e,n){return e==null?e:{created_at:e.created_at==null?void 0:e.created_at,id:e.id==null?void 0:e.id,key:e.key==null?void 0:e.key,organization_id:e.organization_id==null?void 0:e.organization_id,updated_at:e.updated_at==null?void 0:e.updated_at,value:e.value==null?void 0:e.value}}function JA(e){return WA(e)}function WA(e,n){return e==null?e:{auth_url:e.auth_url==null?void 0:e.auth_url}}function eO(e){return tO(e,!1)}function tO(e,n=!1){return e==null?e:{key:e.key,value:e.value}}function nO(e){return aO(e,!1)}function aO(e,n=!1){return e==null?e:{key:e.key,value:e.value}}function rO(e){return iO(e,!1)}function iO(e,n=!1){return e==null?e:{bits:e.bits,comment:e.comment,name:e.name,type:e.type}}function sO(e){return oO(e,!1)}function oO(e,n=!1){return e==null?e:{hostname:e.hostname,private_ip_address:e.private_ip_address,public_ip_address:e.public_ip_address,role:e.role,ssh_key_id:e.ssh_key_id,ssh_user:e.ssh_user,status:e.status}}function lO(e){return cO(e,!1)}function cO(e,n=!1){return e==null?e:{effect:e.effect,key:e.key,value:e.value}}function uO(e){return dO(e)}function dO(e,n){return e==null?e:{alg:e.alg==null?void 0:e.alg,e:e.e==null?void 0:e.e,kid:e.kid==null?void 0:e.kid,kty:e.kty==null?void 0:e.kty,n:e.n==null?void 0:e.n,use:e.use==null?void 0:e.use,x:e.x==null?void 0:e.x}}function fO(e){return hO(e)}function hO(e,n){return e==null?e:{keys:e.keys==null?void 0:e.keys.map(uO)}}function mO(e){return pO(e)}function pO(e,n){return e}function Du(e){return gO(e)}function gO(e,n){return e==null?e:{attempts:e.attempts==null?void 0:e.attempts,created_at:e.created_at==null?void 0:e.created_at,id:e.id==null?void 0:e.id,last_error:e.last_error==null?void 0:e.last_error,max_attempts:e.max_attempts==null?void 0:e.max_attempts,payload:e.payload==null?void 0:e.payload,queue:e.queue==null?void 0:e.queue,run_at:e.run_at==null?void 0:e.run_at,status:e.status==null?void 0:mO(e.status),type:e.type==null?void 0:e.type,updated_at:e.updated_at==null?void 0:e.updated_at}}function iu(e){return vO(e)}function vO(e,n){return e==null?e:{created_at:e.created_at==null?void 0:e.created_at,id:e.id==null?void 0:e.id,key:e.key==null?void 0:e.key,organization_id:e.organization_id==null?void 0:e.organization_id,updated_at:e.updated_at==null?void 0:e.updated_at,value:e.value==null?void 0:e.value}}function yO(e){return bO(e,!1)}function bO(e,n=!1){return e==null?e:{refresh_token:e.refresh_token}}function xO(e){return wO(e)}function wO(e,n){return e==null?e:{items:e.items==null?void 0:e.items.map(Du),page:e.page==null?void 0:e.page,page_size:e.page_size==null?void 0:e.page_size,total:e.total==null?void 0:e.total}}function SO(e){return _O(e)}function _O(e,n){return e==null?e:{failed:e.failed==null?void 0:e.failed,name:e.name==null?void 0:e.name,pending:e.pending==null?void 0:e.pending,running:e.running==null?void 0:e.running,scheduled:e.scheduled==null?void 0:e.scheduled}}function EO(e){return CO(e,!1)}function CO(e,n=!1){return e==null?e:{refresh_token:e.refresh_token}}function su(e){return jO(e)}function jO(e,n){return e==null?e:{created_at:e.created_at==null?void 0:e.created_at,hostname:e.hostname==null?void 0:e.hostname,id:e.id==null?void 0:e.id,organization_id:e.organization_id==null?void 0:e.organization_id,private_ip_address:e.private_ip_address==null?void 0:e.private_ip_address,public_ip_address:e.public_ip_address==null?void 0:e.public_ip_address,role:e.role==null?void 0:e.role,ssh_key_id:e.ssh_key_id==null?void 0:e.ssh_key_id,ssh_user:e.ssh_user==null?void 0:e.ssh_user,status:e.status==null?void 0:e.status,updated_at:e.updated_at==null?void 0:e.updated_at}}function gx(e){return AO(e)}function AO(e,n){return e==null?e:{created_at:e.created_at==null?void 0:e.created_at,fingerprint:e.fingerprint==null?void 0:e.fingerprint,id:e.id==null?void 0:e.id,name:e.name==null?void 0:e.name,organization_id:e.organization_id==null?void 0:e.organization_id,public_key:e.public_key==null?void 0:e.public_key,updated_at:e.updated_at==null?void 0:e.updated_at}}function OO(e){return TO(e)}function TO(e,n){return e==null?e:{created_at:e.created_at==null?void 0:e.created_at,fingerprint:e.fingerprint==null?void 0:e.fingerprint,id:e.id==null?void 0:e.id,name:e.name==null?void 0:e.name,organization_id:e.organization_id==null?void 0:e.organization_id,private_key:e.private_key==null?void 0:e.private_key,public_key:e.public_key==null?void 0:e.public_key,updated_at:e.updated_at==null?void 0:e.updated_at}}function ou(e){return RO(e)}function RO(e,n){return e==null?e:{created_at:e.created_at==null?void 0:e.created_at,effect:e.effect==null?void 0:e.effect,id:e.id==null?void 0:e.id,key:e.key==null?void 0:e.key,organization_id:e.organization_id==null?void 0:e.organization_id,updated_at:e.updated_at==null?void 0:e.updated_at,value:e.value==null?void 0:e.value}}function vx(e){return NO(e)}function NO(e,n){return e==null?e:{access_token:e.access_token==null?void 0:e.access_token,expires_in:e.expires_in==null?void 0:e.expires_in,refresh_token:e.refresh_token==null?void 0:e.refresh_token,token_type:e.token_type==null?void 0:e.token_type}}function DO(e){return zO(e,!1)}function zO(e,n=!1){return e==null?e:{key:e.key,value:e.value}}function MO(e){return kO(e,!1)}function kO(e,n=!1){return e==null?e:{key:e.key,value:e.value}}function LO(e){return UO(e,!1)}function UO(e,n=!1){return e==null?e:{hostname:e.hostname,private_ip_address:e.private_ip_address,public_ip_address:e.public_ip_address,role:e.role,ssh_key_id:e.ssh_key_id,ssh_user:e.ssh_user,status:e.status}}function KO(e){return qO(e,!1)}function qO(e,n=!1){return e==null?e:{effect:e.effect,key:e.key,value:e.value}}function PO(e){return IO(e,!1)}function IO(e,n=!1){return e==null?e:{expires_in_hours:e.expires_in_hours,name:e.name}}function ww(e){return HO(e)}function HO(e,n){return e==null?e:{avatar_url:e.avatar_url==null?void 0:e.avatar_url,created_at:e.created_at==null?void 0:new Date(e.created_at),display_name:e.display_name==null?void 0:e.display_name,id:e.id==null?void 0:e.id,is_admin:e.is_admin==null?void 0:e.is_admin,is_disabled:e.is_disabled==null?void 0:e.is_disabled,primary_email:e.primary_email==null?void 0:e.primary_email,updated_at:e.updated_at==null?void 0:new Date(e.updated_at)}}function VO(e){return BO(e)}function BO(e,n){return e==null?e:{created_at:e.created_at==null?void 0:new Date(e.created_at),email:e.email==null?void 0:e.email,id:e.id==null?void 0:e.id,is_primary:e.is_primary==null?void 0:e.is_primary,is_verified:e.is_verified==null?void 0:e.is_verified,updated_at:e.updated_at==null?void 0:new Date(e.updated_at),user:e.user==null?void 0:ww(e.user),user_id:e.user_id==null?void 0:e.user_id}}function xl(e){return FO(e)}function FO(e,n){return e==null?e:{created_at:e.created_at==null?void 0:new Date(e.created_at),domain:e.domain==null?void 0:e.domain,id:e.id==null?void 0:e.id,name:e.name==null?void 0:e.name,updated_at:e.updated_at==null?void 0:new Date(e.updated_at)}}function ZO(e){return $O(e)}function $O(e,n){return e==null?e:{avatar_url:e.avatar_url==null?void 0:e.avatar_url,created_at:e.created_at==null?void 0:new Date(e.created_at),display_name:e.display_name==null?void 0:e.display_name,emails:e.emails==null?void 0:e.emails.map(VO),id:e.id==null?void 0:e.id,is_admin:e.is_admin==null?void 0:e.is_admin,is_disabled:e.is_disabled==null?void 0:e.is_disabled,organizations:e.organizations==null?void 0:e.organizations.map(xl),primary_email:e.primary_email==null?void 0:e.primary_email,updated_at:e.updated_at==null?void 0:new Date(e.updated_at)}}function yx(e){return GO(e)}function GO(e,n){return e==null?e:{email:e.email==null?void 0:e.email,role:e.role==null?void 0:e.role,user_id:e.user_id==null?void 0:e.user_id}}function XO(e){return YO(e,!1)}function YO(e,n=!1){return e==null?e:{role:e.role,user_id:e.user_id}}function QO(e){return JO(e,!1)}function JO(e,n=!1){return e==null?e:{domain:e.domain,name:e.name}}function WO(e){return eT(e,!1)}function eT(e,n=!1){return e==null?e:{expires_in_hours:e.expires_in_hours,name:e.name}}function tT(e){return nT(e)}function nT(e,n){return e==null?e:{created_at:e.created_at==null?void 0:e.created_at,expires_at:e.expires_at==null?void 0:e.expires_at,id:e.id==null?void 0:e.id,name:e.name==null?void 0:e.name,org_key:e.org_key==null?void 0:e.org_key,org_secret:e.org_secret==null?void 0:e.org_secret,scope:e.scope==null?void 0:e.scope}}function aT(e){return rT(e,!1)}function rT(e,n=!1){return e==null?e:{domain:e.domain,name:e.name}}function iT(e){return sT(e,!1)}function sT(e,n=!1){return e==null?e:{display_name:e.display_name}}function bx(e){return oT(e)}function oT(e,n){return e==null?e:{created_at:e.created_at==null?void 0:e.created_at,expires_at:e.expires_at==null?void 0:e.expires_at,id:e.id==null?void 0:e.id,last_used_at:e.last_used_at==null?void 0:e.last_used_at,name:e.name==null?void 0:e.name,plain:e.plain==null?void 0:e.plain,scope:e.scope==null?void 0:e.scope}}function lT(e){return cT(e)}function cT(e,n){return e==null?e:{created_at:e.created_at==null?void 0:new Date(e.created_at),expires_at:e.expires_at==null?void 0:new Date(e.expires_at),id:e.id==null?void 0:e.id,last_used_at:e.last_used_at==null?void 0:new Date(e.last_used_at),name:e.name==null?void 0:e.name,org_id:e.org_id==null?void 0:e.org_id,prefix:e.prefix==null?void 0:e.prefix,revoked:e.revoked==null?void 0:e.revoked,scope:e.scope==null?void 0:e.scope,updated_at:e.updated_at==null?void 0:new Date(e.updated_at),user_id:e.user_id==null?void 0:e.user_id}}class uT extends ga{async createAnnotationRaw(n,r){if(n.body==null)throw new De("body",'Required parameter "body" was null or undefined when calling createAnnotation().');const s={},o={};o["Content-Type"]="application/json",n.xOrgID!=null&&(o["X-Org-ID"]=String(n.xOrgID)),this.configuration&&this.configuration.apiKey&&(o["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(o["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));const d=await this.request({path:"/annotations",method:"POST",headers:o,query:s,body:eO(n.body)},r);return new Le(d,m=>ru(m))}async createAnnotation(n,r){return await(await this.createAnnotationRaw(n,r)).value()}async deleteAnnotationRaw(n,r){if(n.id==null)throw new De("id",'Required parameter "id" was null or undefined when calling deleteAnnotation().');const s={},o={};n.xOrgID!=null&&(o["X-Org-ID"]=String(n.xOrgID)),this.configuration&&this.configuration.apiKey&&(o["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(o["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));let u="/annotations/{id}";u=u.replace("{id}",encodeURIComponent(String(n.id)));const d=await this.request({path:u,method:"DELETE",headers:o,query:s},r);return this.isJsonMime(d.headers.get("content-type"))?new Le(d):new Js(d)}async deleteAnnotation(n,r){return await(await this.deleteAnnotationRaw(n,r)).value()}async getAnnotationRaw(n,r){if(n.id==null)throw new De("id",'Required parameter "id" was null or undefined when calling getAnnotation().');const s={},o={};n.xOrgID!=null&&(o["X-Org-ID"]=String(n.xOrgID)),this.configuration&&this.configuration.apiKey&&(o["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(o["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));let u="/annotations/{id}";u=u.replace("{id}",encodeURIComponent(String(n.id)));const d=await this.request({path:u,method:"GET",headers:o,query:s},r);return new Le(d,m=>ru(m))}async getAnnotation(n,r){return await(await this.getAnnotationRaw(n,r)).value()}async listAnnotationsRaw(n,r){const s={};n.key!=null&&(s.key=n.key),n.value!=null&&(s.value=n.value),n.q!=null&&(s.q=n.q);const o={};n.xOrgID!=null&&(o["X-Org-ID"]=String(n.xOrgID)),this.configuration&&this.configuration.apiKey&&(o["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(o["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));const d=await this.request({path:"/annotations",method:"GET",headers:o,query:s},r);return new Le(d,m=>m.map(ru))}async listAnnotations(n={},r){return await(await this.listAnnotationsRaw(n,r)).value()}async updateAnnotationRaw(n,r){if(n.id==null)throw new De("id",'Required parameter "id" was null or undefined when calling updateAnnotation().');if(n.body==null)throw new De("body",'Required parameter "body" was null or undefined when calling updateAnnotation().');const s={},o={};o["Content-Type"]="application/json",n.xOrgID!=null&&(o["X-Org-ID"]=String(n.xOrgID)),this.configuration&&this.configuration.apiKey&&(o["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(o["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));let u="/annotations/{id}";u=u.replace("{id}",encodeURIComponent(String(n.id)));const d=await this.request({path:u,method:"PATCH",headers:o,query:s,body:DO(n.body)},r);return new Le(d,m=>ru(m))}async updateAnnotation(n,r){return await(await this.updateAnnotationRaw(n,r)).value()}}class dT extends ga{async adminCancelArcherJobRaw(n,r){if(n.id==null)throw new De("id",'Required parameter "id" was null or undefined when calling adminCancelArcherJob().');const s={},o={};this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));let u="/admin/archer/jobs/{id}/cancel";u=u.replace("{id}",encodeURIComponent(String(n.id)));const d=await this.request({path:u,method:"POST",headers:o,query:s},r);return new Le(d,m=>Du(m))}async adminCancelArcherJob(n,r){return await(await this.adminCancelArcherJobRaw(n,r)).value()}async adminEnqueueArcherJobRaw(n,r){if(n.body==null)throw new De("body",'Required parameter "body" was null or undefined when calling adminEnqueueArcherJob().');const s={},o={};o["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));const d=await this.request({path:"/admin/archer/jobs",method:"POST",headers:o,query:s,body:n.body},r);return new Le(d,m=>Du(m))}async adminEnqueueArcherJob(n,r){return await(await this.adminEnqueueArcherJobRaw(n,r)).value()}async adminListArcherJobsRaw(n,r){const s={};n.status!=null&&(s.status=n.status),n.queue!=null&&(s.queue=n.queue),n.q!=null&&(s.q=n.q),n.page!=null&&(s.page=n.page),n.pageSize!=null&&(s.page_size=n.pageSize);const o={};this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));const d=await this.request({path:"/admin/archer/jobs",method:"GET",headers:o,query:s},r);return new Le(d,m=>xO(m))}async adminListArcherJobs(n={},r){return await(await this.adminListArcherJobsRaw(n,r)).value()}async adminListArcherQueuesRaw(n){const r={},s={};this.configuration&&this.configuration.apiKey&&(s.Authorization=await this.configuration.apiKey("Authorization"));const u=await this.request({path:"/admin/archer/queues",method:"GET",headers:s,query:r},n);return new Le(u,d=>d.map(SO))}async adminListArcherQueues(n){return await(await this.adminListArcherQueuesRaw(n)).value()}async adminRetryArcherJobRaw(n,r){if(n.id==null)throw new De("id",'Required parameter "id" was null or undefined when calling adminRetryArcherJob().');const s={},o={};this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));let u="/admin/archer/jobs/{id}/retry";u=u.replace("{id}",encodeURIComponent(String(n.id)));const d=await this.request({path:u,method:"POST",headers:o,query:s},r);return new Le(d,m=>Du(m))}async adminRetryArcherJob(n,r){return await(await this.adminRetryArcherJobRaw(n,r)).value()}}class fT extends ga{async authCallbackRaw(n,r){if(n.provider==null)throw new De("provider",'Required parameter "provider" was null or undefined when calling authCallback().');const s={},o={};let u="/auth/{provider}/callback";u=u.replace("{provider}",encodeURIComponent(String(n.provider)));const d=await this.request({path:u,method:"GET",headers:o,query:s},r);return new Le(d,m=>vx(m))}async authCallback(n,r){return await(await this.authCallbackRaw(n,r)).value()}async authStartRaw(n,r){if(n.provider==null)throw new De("provider",'Required parameter "provider" was null or undefined when calling authStart().');const s={},o={};let u="/auth/{provider}/start";u=u.replace("{provider}",encodeURIComponent(String(n.provider)));const d=await this.request({path:u,method:"POST",headers:o,query:s},r);return new Le(d,m=>JA(m))}async authStart(n,r){return await(await this.authStartRaw(n,r)).value()}async getJWKSRaw(n){const r={},s={},u=await this.request({path:"/.well-known/jwks.json",method:"GET",headers:s,query:r},n);return new Le(u,d=>fO(d))}async getJWKS(n){return await(await this.getJWKSRaw(n)).value()}async logoutRaw(n,r){if(n.body==null)throw new De("body",'Required parameter "body" was null or undefined when calling logout().');const s={},o={};o["Content-Type"]="application/json";const d=await this.request({path:"/auth/logout",method:"POST",headers:o,query:s,body:yO(n.body)},r);return new _l(d)}async logout(n,r){await this.logoutRaw(n,r)}async refreshRaw(n,r){if(n.body==null)throw new De("body",'Required parameter "body" was null or undefined when calling refresh().');const s={},o={};o["Content-Type"]="application/json";const d=await this.request({path:"/auth/refresh",method:"POST",headers:o,query:s,body:EO(n.body)},r);return new Le(d,m=>vx(m))}async refresh(n,r){return await(await this.refreshRaw(n,r)).value()}}class hT extends ga{async createLabelRaw(n,r){if(n.body==null)throw new De("body",'Required parameter "body" was null or undefined when calling createLabel().');const s={},o={};o["Content-Type"]="application/json",n.xOrgID!=null&&(o["X-Org-ID"]=String(n.xOrgID)),this.configuration&&this.configuration.apiKey&&(o["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(o["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));const d=await this.request({path:"/labels",method:"POST",headers:o,query:s,body:nO(n.body)},r);return new Le(d,m=>iu(m))}async createLabel(n,r){return await(await this.createLabelRaw(n,r)).value()}async deleteLabelRaw(n,r){if(n.id==null)throw new De("id",'Required parameter "id" was null or undefined when calling deleteLabel().');const s={},o={};n.xOrgID!=null&&(o["X-Org-ID"]=String(n.xOrgID)),this.configuration&&this.configuration.apiKey&&(o["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(o["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));let u="/labels/{id}";u=u.replace("{id}",encodeURIComponent(String(n.id)));const d=await this.request({path:u,method:"DELETE",headers:o,query:s},r);return this.isJsonMime(d.headers.get("content-type"))?new Le(d):new Js(d)}async deleteLabel(n,r){return await(await this.deleteLabelRaw(n,r)).value()}async getLabelRaw(n,r){if(n.id==null)throw new De("id",'Required parameter "id" was null or undefined when calling getLabel().');const s={},o={};n.xOrgID!=null&&(o["X-Org-ID"]=String(n.xOrgID)),this.configuration&&this.configuration.apiKey&&(o["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(o["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));let u="/labels/{id}";u=u.replace("{id}",encodeURIComponent(String(n.id)));const d=await this.request({path:u,method:"GET",headers:o,query:s},r);return new Le(d,m=>iu(m))}async getLabel(n,r){return await(await this.getLabelRaw(n,r)).value()}async listLabelsRaw(n,r){const s={};n.key!=null&&(s.key=n.key),n.value!=null&&(s.value=n.value),n.q!=null&&(s.q=n.q);const o={};n.xOrgID!=null&&(o["X-Org-ID"]=String(n.xOrgID)),this.configuration&&this.configuration.apiKey&&(o["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(o["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));const d=await this.request({path:"/labels",method:"GET",headers:o,query:s},r);return new Le(d,m=>m.map(iu))}async listLabels(n={},r){return await(await this.listLabelsRaw(n,r)).value()}async updateLabelRaw(n,r){if(n.id==null)throw new De("id",'Required parameter "id" was null or undefined when calling updateLabel().');if(n.body==null)throw new De("body",'Required parameter "body" was null or undefined when calling updateLabel().');const s={},o={};o["Content-Type"]="application/json",n.xOrgID!=null&&(o["X-Org-ID"]=String(n.xOrgID)),this.configuration&&this.configuration.apiKey&&(o["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(o["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));let u="/labels/{id}";u=u.replace("{id}",encodeURIComponent(String(n.id)));const d=await this.request({path:u,method:"PATCH",headers:o,query:s,body:MO(n.body)},r);return new Le(d,m=>iu(m))}async updateLabel(n,r){return await(await this.updateLabelRaw(n,r)).value()}}class mT extends ga{async getMeRaw(n){const r={},s={};this.configuration&&this.configuration.apiKey&&(s["X-API-KEY"]=await this.configuration.apiKey("X-API-KEY")),this.configuration&&this.configuration.apiKey&&(s.Authorization=await this.configuration.apiKey("Authorization"));const u=await this.request({path:"/me",method:"GET",headers:s,query:r},n);return new Le(u,d=>ZO(d))}async getMe(n){return await(await this.getMeRaw(n)).value()}async updateMeRaw(n,r){if(n.body==null)throw new De("body",'Required parameter "body" was null or undefined when calling updateMe().');const s={},o={};o["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(o["X-API-KEY"]=await this.configuration.apiKey("X-API-KEY")),this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));const d=await this.request({path:"/me",method:"PATCH",headers:o,query:s,body:iT(n.body)},r);return new Le(d,m=>ww(m))}async updateMe(n,r){return await(await this.updateMeRaw(n,r)).value()}}class pT extends ga{async createUserAPIKeyRaw(n,r){if(n.body==null)throw new De("body",'Required parameter "body" was null or undefined when calling createUserAPIKey().');const s={},o={};o["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(o["X-API-KEY"]=await this.configuration.apiKey("X-API-KEY")),this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));const d=await this.request({path:"/me/api-keys",method:"POST",headers:o,query:s,body:PO(n.body)},r);return new Le(d,m=>bx(m))}async createUserAPIKey(n,r){return await(await this.createUserAPIKeyRaw(n,r)).value()}async deleteUserAPIKeyRaw(n,r){if(n.id==null)throw new De("id",'Required parameter "id" was null or undefined when calling deleteUserAPIKey().');const s={},o={};this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));let u="/me/api-keys/{id}";u=u.replace("{id}",encodeURIComponent(String(n.id)));const d=await this.request({path:u,method:"DELETE",headers:o,query:s},r);return new _l(d)}async deleteUserAPIKey(n,r){await this.deleteUserAPIKeyRaw(n,r)}async listUserAPIKeysRaw(n){const r={},s={};this.configuration&&this.configuration.apiKey&&(s["X-API-KEY"]=await this.configuration.apiKey("X-API-KEY")),this.configuration&&this.configuration.apiKey&&(s.Authorization=await this.configuration.apiKey("Authorization"));const u=await this.request({path:"/me/api-keys",method:"GET",headers:s,query:r},n);return new Le(u,d=>d.map(bx))}async listUserAPIKeys(n){return await(await this.listUserAPIKeysRaw(n)).value()}}class gT extends ga{async addOrUpdateMemberRaw(n,r){if(n.id==null)throw new De("id",'Required parameter "id" was null or undefined when calling addOrUpdateMember().');if(n.body==null)throw new De("body",'Required parameter "body" was null or undefined when calling addOrUpdateMember().');const s={},o={};o["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));let u="/orgs/{id}/members";u=u.replace("{id}",encodeURIComponent(String(n.id)));const d=await this.request({path:u,method:"POST",headers:o,query:s,body:XO(n.body)},r);return new Le(d,m=>yx(m))}async addOrUpdateMember(n,r){return await(await this.addOrUpdateMemberRaw(n,r)).value()}async createOrgRaw(n,r){if(n.body==null)throw new De("body",'Required parameter "body" was null or undefined when calling createOrg().');const s={},o={};o["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));const d=await this.request({path:"/orgs",method:"POST",headers:o,query:s,body:QO(n.body)},r);return new Le(d,m=>xl(m))}async createOrg(n,r){return await(await this.createOrgRaw(n,r)).value()}async createOrgKeyRaw(n,r){if(n.id==null)throw new De("id",'Required parameter "id" was null or undefined when calling createOrgKey().');if(n.body==null)throw new De("body",'Required parameter "body" was null or undefined when calling createOrgKey().');const s={},o={};o["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));let u="/orgs/{id}/api-keys";u=u.replace("{id}",encodeURIComponent(String(n.id)));const d=await this.request({path:u,method:"POST",headers:o,query:s,body:WO(n.body)},r);return new Le(d,m=>tT(m))}async createOrgKey(n,r){return await(await this.createOrgKeyRaw(n,r)).value()}async deleteOrgRaw(n,r){if(n.id==null)throw new De("id",'Required parameter "id" was null or undefined when calling deleteOrg().');const s={},o={};this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));let u="/orgs/{id}";u=u.replace("{id}",encodeURIComponent(String(n.id)));const d=await this.request({path:u,method:"DELETE",headers:o,query:s},r);return new _l(d)}async deleteOrg(n,r){await this.deleteOrgRaw(n,r)}async deleteOrgKeyRaw(n,r){if(n.id==null)throw new De("id",'Required parameter "id" was null or undefined when calling deleteOrgKey().');if(n.keyId==null)throw new De("keyId",'Required parameter "keyId" was null or undefined when calling deleteOrgKey().');const s={},o={};this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));let u="/orgs/{id}/api-keys/{key_id}";u=u.replace("{id}",encodeURIComponent(String(n.id))),u=u.replace("{key_id}",encodeURIComponent(String(n.keyId)));const d=await this.request({path:u,method:"DELETE",headers:o,query:s},r);return new _l(d)}async deleteOrgKey(n,r){await this.deleteOrgKeyRaw(n,r)}async getOrgRaw(n,r){if(n.id==null)throw new De("id",'Required parameter "id" was null or undefined when calling getOrg().');const s={},o={};this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));let u="/orgs/{id}";u=u.replace("{id}",encodeURIComponent(String(n.id)));const d=await this.request({path:u,method:"GET",headers:o,query:s},r);return new Le(d,m=>xl(m))}async getOrg(n,r){return await(await this.getOrgRaw(n,r)).value()}async listMembersRaw(n,r){if(n.id==null)throw new De("id",'Required parameter "id" was null or undefined when calling listMembers().');const s={},o={};this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));let u="/orgs/{id}/members";u=u.replace("{id}",encodeURIComponent(String(n.id)));const d=await this.request({path:u,method:"GET",headers:o,query:s},r);return new Le(d,m=>m.map(yx))}async listMembers(n,r){return await(await this.listMembersRaw(n,r)).value()}async listMyOrgsRaw(n){const r={},s={};this.configuration&&this.configuration.apiKey&&(s.Authorization=await this.configuration.apiKey("Authorization"));const u=await this.request({path:"/orgs",method:"GET",headers:s,query:r},n);return new Le(u,d=>d.map(xl))}async listMyOrgs(n){return await(await this.listMyOrgsRaw(n)).value()}async listOrgKeysRaw(n,r){if(n.id==null)throw new De("id",'Required parameter "id" was null or undefined when calling listOrgKeys().');const s={},o={};this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));let u="/orgs/{id}/api-keys";u=u.replace("{id}",encodeURIComponent(String(n.id)));const d=await this.request({path:u,method:"GET",headers:o,query:s},r);return new Le(d,m=>m.map(lT))}async listOrgKeys(n,r){return await(await this.listOrgKeysRaw(n,r)).value()}async removeMemberRaw(n,r){if(n.id==null)throw new De("id",'Required parameter "id" was null or undefined when calling removeMember().');if(n.userId==null)throw new De("userId",'Required parameter "userId" was null or undefined when calling removeMember().');const s={},o={};this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));let u="/orgs/{id}/members/{user_id}";u=u.replace("{id}",encodeURIComponent(String(n.id))),u=u.replace("{user_id}",encodeURIComponent(String(n.userId)));const d=await this.request({path:u,method:"DELETE",headers:o,query:s},r);return new _l(d)}async removeMember(n,r){await this.removeMemberRaw(n,r)}async updateOrgRaw(n,r){if(n.id==null)throw new De("id",'Required parameter "id" was null or undefined when calling updateOrg().');if(n.body==null)throw new De("body",'Required parameter "body" was null or undefined when calling updateOrg().');const s={},o={};o["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));let u="/orgs/{id}";u=u.replace("{id}",encodeURIComponent(String(n.id)));const d=await this.request({path:u,method:"PATCH",headers:o,query:s,body:aT(n.body)},r);return new Le(d,m=>xl(m))}async updateOrg(n,r){return await(await this.updateOrgRaw(n,r)).value()}}class vT extends ga{async createServerRaw(n,r){if(n.body==null)throw new De("body",'Required parameter "body" was null or undefined when calling createServer().');const s={},o={};o["Content-Type"]="application/json",n.xOrgID!=null&&(o["X-Org-ID"]=String(n.xOrgID)),this.configuration&&this.configuration.apiKey&&(o["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(o["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));const d=await this.request({path:"/servers",method:"POST",headers:o,query:s,body:sO(n.body)},r);return new Le(d,m=>su(m))}async createServer(n,r){return await(await this.createServerRaw(n,r)).value()}async deleteServerRaw(n,r){if(n.id==null)throw new De("id",'Required parameter "id" was null or undefined when calling deleteServer().');const s={},o={};n.xOrgID!=null&&(o["X-Org-ID"]=String(n.xOrgID)),this.configuration&&this.configuration.apiKey&&(o["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(o["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));let u="/servers/{id}";u=u.replace("{id}",encodeURIComponent(String(n.id)));const d=await this.request({path:u,method:"DELETE",headers:o,query:s},r);return this.isJsonMime(d.headers.get("content-type"))?new Le(d):new Js(d)}async deleteServer(n,r){return await(await this.deleteServerRaw(n,r)).value()}async getServerRaw(n,r){if(n.id==null)throw new De("id",'Required parameter "id" was null or undefined when calling getServer().');const s={},o={};n.xOrgID!=null&&(o["X-Org-ID"]=String(n.xOrgID)),this.configuration&&this.configuration.apiKey&&(o["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(o["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));let u="/servers/{id}";u=u.replace("{id}",encodeURIComponent(String(n.id)));const d=await this.request({path:u,method:"GET",headers:o,query:s},r);return new Le(d,m=>su(m))}async getServer(n,r){return await(await this.getServerRaw(n,r)).value()}async listServersRaw(n,r){const s={};n.status!=null&&(s.status=n.status),n.role!=null&&(s.role=n.role);const o={};n.xOrgID!=null&&(o["X-Org-ID"]=String(n.xOrgID)),this.configuration&&this.configuration.apiKey&&(o["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(o["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));const d=await this.request({path:"/servers",method:"GET",headers:o,query:s},r);return new Le(d,m=>m.map(su))}async listServers(n={},r){return await(await this.listServersRaw(n,r)).value()}async updateServerRaw(n,r){if(n.id==null)throw new De("id",'Required parameter "id" was null or undefined when calling updateServer().');if(n.body==null)throw new De("body",'Required parameter "body" was null or undefined when calling updateServer().');const s={},o={};o["Content-Type"]="application/json",n.xOrgID!=null&&(o["X-Org-ID"]=String(n.xOrgID)),this.configuration&&this.configuration.apiKey&&(o["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(o["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));let u="/servers/{id}";u=u.replace("{id}",encodeURIComponent(String(n.id)));const d=await this.request({path:u,method:"PATCH",headers:o,query:s,body:LO(n.body)},r);return new Le(d,m=>su(m))}async updateServer(n,r){return await(await this.updateServerRaw(n,r)).value()}}class yT extends ga{async createSSHKeyRaw(n,r){if(n.body==null)throw new De("body",'Required parameter "body" was null or undefined when calling createSSHKey().');const s={},o={};o["Content-Type"]="application/json",n.xOrgID!=null&&(o["X-Org-ID"]=String(n.xOrgID)),this.configuration&&this.configuration.apiKey&&(o["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(o["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));const d=await this.request({path:"/ssh",method:"POST",headers:o,query:s,body:rO(n.body)},r);return new Le(d,m=>gx(m))}async createSSHKey(n,r){return await(await this.createSSHKeyRaw(n,r)).value()}async deleteSSHKeyRaw(n,r){if(n.id==null)throw new De("id",'Required parameter "id" was null or undefined when calling deleteSSHKey().');const s={},o={};n.xOrgID!=null&&(o["X-Org-ID"]=String(n.xOrgID)),this.configuration&&this.configuration.apiKey&&(o["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(o["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));let u="/ssh/{id}";u=u.replace("{id}",encodeURIComponent(String(n.id)));const d=await this.request({path:u,method:"DELETE",headers:o,query:s},r);return this.isJsonMime(d.headers.get("content-type"))?new Le(d):new Js(d)}async deleteSSHKey(n,r){return await(await this.deleteSSHKeyRaw(n,r)).value()}async downloadSSHKeyRaw(n,r){if(n.xOrgID==null)throw new De("xOrgID",'Required parameter "xOrgID" was null or undefined when calling downloadSSHKey().');if(n.id==null)throw new De("id",'Required parameter "id" was null or undefined when calling downloadSSHKey().');if(n.part==null)throw new De("part",'Required parameter "part" was null or undefined when calling downloadSSHKey().');const s={};n.part!=null&&(s.part=n.part);const o={};n.xOrgID!=null&&(o["X-Org-ID"]=String(n.xOrgID)),this.configuration&&this.configuration.apiKey&&(o["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(o["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));let u="/ssh/{id}/download";u=u.replace("{id}",encodeURIComponent(String(n.id)));const d=await this.request({path:u,method:"GET",headers:o,query:s},r);return this.isJsonMime(d.headers.get("content-type"))?new Le(d):new Js(d)}async downloadSSHKey(n,r){return await(await this.downloadSSHKeyRaw(n,r)).value()}async getSSHKeyRaw(n,r){if(n.id==null)throw new De("id",'Required parameter "id" was null or undefined when calling getSSHKey().');const s={};n.reveal!=null&&(s.reveal=n.reveal);const o={};n.xOrgID!=null&&(o["X-Org-ID"]=String(n.xOrgID)),this.configuration&&this.configuration.apiKey&&(o["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(o["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));let u="/ssh/{id}";u=u.replace("{id}",encodeURIComponent(String(n.id)));const d=await this.request({path:u,method:"GET",headers:o,query:s},r);return new Le(d,m=>OO(m))}async getSSHKey(n,r){return await(await this.getSSHKeyRaw(n,r)).value()}async listPublicSshKeysRaw(n,r){const s={},o={};n.xOrgID!=null&&(o["X-Org-ID"]=String(n.xOrgID)),this.configuration&&this.configuration.apiKey&&(o["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(o["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));const d=await this.request({path:"/ssh",method:"GET",headers:o,query:s},r);return new Le(d,m=>m.map(gx))}async listPublicSshKeys(n={},r){return await(await this.listPublicSshKeysRaw(n,r)).value()}}class bT extends ga{async createTaintRaw(n,r){if(n.body==null)throw new De("body",'Required parameter "body" was null or undefined when calling createTaint().');const s={},o={};o["Content-Type"]="application/json",n.xOrgID!=null&&(o["X-Org-ID"]=String(n.xOrgID)),this.configuration&&this.configuration.apiKey&&(o["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(o["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));const d=await this.request({path:"/taints",method:"POST",headers:o,query:s,body:lO(n.body)},r);return new Le(d,m=>ou(m))}async createTaint(n,r){return await(await this.createTaintRaw(n,r)).value()}async deleteTaintRaw(n,r){if(n.id==null)throw new De("id",'Required parameter "id" was null or undefined when calling deleteTaint().');const s={},o={};n.xOrgID!=null&&(o["X-Org-ID"]=String(n.xOrgID)),this.configuration&&this.configuration.apiKey&&(o["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(o["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));let u="/taints/{id}";u=u.replace("{id}",encodeURIComponent(String(n.id)));const d=await this.request({path:u,method:"DELETE",headers:o,query:s},r);return this.isJsonMime(d.headers.get("content-type"))?new Le(d):new Js(d)}async deleteTaint(n,r){return await(await this.deleteTaintRaw(n,r)).value()}async getTaintRaw(n,r){if(n.id==null)throw new De("id",'Required parameter "id" was null or undefined when calling getTaint().');const s={},o={};n.xOrgID!=null&&(o["X-Org-ID"]=String(n.xOrgID)),this.configuration&&this.configuration.apiKey&&(o["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(o["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));let u="/taints/{id}";u=u.replace("{id}",encodeURIComponent(String(n.id)));const d=await this.request({path:u,method:"GET",headers:o,query:s},r);return new Le(d,m=>ou(m))}async getTaint(n,r){return await(await this.getTaintRaw(n,r)).value()}async listTaintsRaw(n,r){const s={};n.key!=null&&(s.key=n.key),n.value!=null&&(s.value=n.value),n.q!=null&&(s.q=n.q);const o={};n.xOrgID!=null&&(o["X-Org-ID"]=String(n.xOrgID)),this.configuration&&this.configuration.apiKey&&(o["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(o["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));const d=await this.request({path:"/taints",method:"GET",headers:o,query:s},r);return new Le(d,m=>m.map(ou))}async listTaints(n={},r){return await(await this.listTaintsRaw(n,r)).value()}async updateTaintRaw(n,r){if(n.id==null)throw new De("id",'Required parameter "id" was null or undefined when calling updateTaint().');if(n.body==null)throw new De("body",'Required parameter "body" was null or undefined when calling updateTaint().');const s={},o={};o["Content-Type"]="application/json",n.xOrgID!=null&&(o["X-Org-ID"]=String(n.xOrgID)),this.configuration&&this.configuration.apiKey&&(o["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(o["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));let u="/taints/{id}";u=u.replace("{id}",encodeURIComponent(String(n.id)));const d=await this.request({path:u,method:"PATCH",headers:o,query:s,body:KO(n.body)},r);return new Le(d,m=>ou(m))}async updateTaint(n,r){return await(await this.updateTaintRaw(n,r)).value()}}const dp="/api/v1";function xT(){return new yw({basePath:dp,accessToken:async()=>yn.getAccessToken()??"",middleware:[{async pre(e){const n=new Headers(e.init?.headers??{});e.init?.body!=null&&!(e.init.body instanceof FormData)&&!(e.init.body instanceof Blob)&&!n.has("Content-Type")&&n.set("Content-Type","application/json");const s=yn.getAccessToken();s&&n.set("Authorization",`Bearer ${s}`);const o=Va.get();return o&&n.set("X-Org-ID",o),{...e,init:{...e.init,headers:n}}},async post(e){return e.response}}]})}function Qa(e){return new e(xT())}function wT(){return Qa(fT)}function ST(){return Qa(mT)}function _T(){return Qa(pT)}function rd(){return Qa(gT)}function ET(){return Qa(yT)}function CT(){return Qa(vT)}function jT(){return Qa(bT)}function AT(){return Qa(hT)}function OT(){return Qa(uT)}function TT(){return Qa(dT)}let lu=null;async function RT(){const e=yn.get();if(!e?.refresh_token)return!1;try{const n=await fetch(`${dp}/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refresh_token:e.refresh_token})});if(!n.ok)return!1;const r=await n.json();return yn.set(r),!0}catch{return!1}}async function xx(){return lu||(lu=RT().finally(()=>{lu=null})),lu}function NT(e){return e?.status===401||e?.cause?.status===401||e?.response?.status===401||e instanceof Response&&e.status===401}async function $e(e){yn.willExpireSoon?.(30)&&await xx();try{return await e()}catch(n){if(!NT(n)||!await xx())throw n;return await e()}}const wx=ST(),Qh=_T(),Ni={getMe:()=>$e(async()=>await wx.getMe()),updateMe:e=>$e(async()=>await wx.updateMe({body:e})),listKeys:()=>$e(async()=>await Qh.listUserAPIKeys()),createKey:e=>$e(async()=>await Qh.createUserAPIKey({body:e})),deleteKey:e=>$e(async()=>(await Qh.deleteUserAPIKey({id:e}),!0))};var Sw={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Sx=G.createContext&&G.createContext(Sw),DT=["attr","size","title"];function zT(e,n){if(e==null)return{};var r=MT(e,n),s,o;if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(r[s]=e[s])}return r}function MT(e,n){if(e==null)return{};var r={};for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){if(n.indexOf(s)>=0)continue;r[s]=e[s]}return r}function Iu(){return Iu=Object.assign?Object.assign.bind():function(e){for(var n=1;nG.createElement(n.tag,Hu({key:r},n.attr),_w(n.child)))}function Ew(e){return n=>G.createElement(KT,Iu({attr:Hu({},e.attr)},n),_w(e.child))}function KT(e){var n=r=>{var{attr:s,size:o,title:u}=e,d=zT(e,DT),m=o||r.size||"1em",p;return r.className&&(p=r.className),e.className&&(p=(p?p+" ":"")+e.className),G.createElement("svg",Iu({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,s,d,{className:p,style:Hu(Hu({color:e.color||r.color},r.style),e.style),height:m,width:m,xmlns:"http://www.w3.org/2000/svg"}),u&&G.createElement("title",null,u),e.children)};return Sx!==void 0?G.createElement(Sx.Consumer,null,r=>n(r)):n(Sw)}function qT(e){return Ew({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M888 680h-54V540H546v-92h238c8.8 0 16-7.2 16-16V168c0-8.8-7.2-16-16-16H240c-8.8 0-16 7.2-16 16v264c0 8.8 7.2 16 16 16h238v92H190v140h-54c-4.4 0-8 3.6-8 8v176c0 4.4 3.6 8 8 8h176c4.4 0 8-3.6 8-8V688c0-4.4-3.6-8-8-8h-54v-72h220v72h-54c-4.4 0-8 3.6-8 8v176c0 4.4 3.6 8 8 8h176c4.4 0 8-3.6 8-8V688c0-4.4-3.6-8-8-8h-54v-72h220v72h-54c-4.4 0-8 3.6-8 8v176c0 4.4 3.6 8 8 8h176c4.4 0 8-3.6 8-8V688c0-4.4-3.6-8-8-8zM256 805.3c0 1.5-1.2 2.7-2.7 2.7h-58.7c-1.5 0-2.7-1.2-2.7-2.7v-58.7c0-1.5 1.2-2.7 2.7-2.7h58.7c1.5 0 2.7 1.2 2.7 2.7v58.7zm288 0c0 1.5-1.2 2.7-2.7 2.7h-58.7c-1.5 0-2.7-1.2-2.7-2.7v-58.7c0-1.5 1.2-2.7 2.7-2.7h58.7c1.5 0 2.7 1.2 2.7 2.7v58.7zM288 384V216h448v168H288zm544 421.3c0 1.5-1.2 2.7-2.7 2.7h-58.7c-1.5 0-2.7-1.2-2.7-2.7v-58.7c0-1.5 1.2-2.7 2.7-2.7h58.7c1.5 0 2.7 1.2 2.7 2.7v58.7zM360 300a40 40 0 1 0 80 0 40 40 0 1 0-80 0z"},child:[]}]})(e)}function PT(e){return Ew({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",strokeWidth:"2",d:"M3,6 L21,6 L3,6 Z M10,2 L10,4 M14,2 L14,4 M16,12 C18.3736719,13.1826446 20,15.6506255 20,19 L20,23 L4,23 L4,19 C4,15.6457258 5.6310898,13.1754259 8,12 M12,16.5 L12,23 M12,13 C15.3137085,13 18,10.3137085 18,7 C18,3.6862915 15.3137085,1 12,1 C8.6862915,1 6,3.6862915 6,7 C6,10.3137085 8.6862915,13 12,13 Z M8,12 C8,14.209139 9.790861,16 12,16 L12,16 C14.209139,16 16,14.209139 16,12"},child:[]}]})(e)}const IT=[{to:"/clusters",label:"Clusters",icon:qT},{to:"/node-pools",label:"Node Pools",icon:hj},{to:"/annotations",label:"Annotations",icon:Aj},{to:"/labels",label:"Labels",icon:ad},{to:"/taints",label:"Taints",icon:Qj},{to:"/servers",label:"Servers",icon:Xj},{to:"/ssh",label:"SSH Keys",icon:zj}],HT=[{to:"/org/members",label:"Members",icon:vw},{to:"/org/api-keys",label:"Org API Keys",icon:Uj},{to:"/org/settings",label:"Org Settings",icon:mw}],VT=[{to:"/me",label:"Profile",icon:rA}],BT=[{to:"/admin/users",label:"Users Admin",icon:vw},{to:"/admin/jobs",label:"Jobs Admin",icon:PT}];function Cw(e){var n,r,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(n=0;n{const n=$T(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:d=>{const m=d.split(fp);return m[0]===""&&m.length!==1&&m.shift(),Aw(m,n)||ZT(d)},getConflictingClassGroupIds:(d,m)=>{const p=r[d]||[];return m&&s[d]?[...p,...s[d]]:p}}},Aw=(e,n)=>{if(e.length===0)return n.classGroupId;const r=e[0],s=n.nextPart.get(r),o=s?Aw(e.slice(1),s):void 0;if(o)return o;if(n.validators.length===0)return;const u=e.join(fp);return n.validators.find(({validator:d})=>d(u))?.classGroupId},Ex=/^\[(.+)\]$/,ZT=e=>{if(Ex.test(e)){const n=Ex.exec(e)[1],r=n?.substring(0,n.indexOf(":"));if(r)return"arbitrary.."+r}},$T=e=>{const{theme:n,classGroups:r}=e,s={nextPart:new Map,validators:[]};for(const o in r)Nm(r[o],s,o,n);return s},Nm=(e,n,r,s)=>{e.forEach(o=>{if(typeof o=="string"){const u=o===""?n:Cx(n,o);u.classGroupId=r;return}if(typeof o=="function"){if(GT(o)){Nm(o(s),n,r,s);return}n.validators.push({validator:o,classGroupId:r});return}Object.entries(o).forEach(([u,d])=>{Nm(d,Cx(n,u),r,s)})})},Cx=(e,n)=>{let r=e;return n.split(fp).forEach(s=>{r.nextPart.has(s)||r.nextPart.set(s,{nextPart:new Map,validators:[]}),r=r.nextPart.get(s)}),r},GT=e=>e.isThemeGetter,XT=e=>{if(e<1)return{get:()=>{},set:()=>{}};let n=0,r=new Map,s=new Map;const o=(u,d)=>{r.set(u,d),n++,n>e&&(n=0,s=r,r=new Map)};return{get(u){let d=r.get(u);if(d!==void 0)return d;if((d=s.get(u))!==void 0)return o(u,d),d},set(u,d){r.has(u)?r.set(u,d):o(u,d)}}},Dm="!",zm=":",YT=zm.length,QT=e=>{const{prefix:n,experimentalParseClassName:r}=e;let s=o=>{const u=[];let d=0,m=0,p=0,g;for(let A=0;Ap?g-p:void 0;return{modifiers:u,hasImportantModifier:w,baseClassName:v,maybePostfixModifierPosition:E}};if(n){const o=n+zm,u=s;s=d=>d.startsWith(o)?u(d.substring(o.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:d,maybePostfixModifierPosition:void 0}}if(r){const o=s;s=u=>r({className:u,parseClassName:o})}return s},JT=e=>e.endsWith(Dm)?e.substring(0,e.length-1):e.startsWith(Dm)?e.substring(1):e,WT=e=>{const n=Object.fromEntries(e.orderSensitiveModifiers.map(s=>[s,!0]));return s=>{if(s.length<=1)return s;const o=[];let u=[];return s.forEach(d=>{d[0]==="["||n[d]?(o.push(...u.sort(),d),u=[]):u.push(d)}),o.push(...u.sort()),o}},eR=e=>({cache:XT(e.cacheSize),parseClassName:QT(e),sortModifiers:WT(e),...FT(e)}),tR=/\s+/,nR=(e,n)=>{const{parseClassName:r,getClassGroupId:s,getConflictingClassGroupIds:o,sortModifiers:u}=n,d=[],m=e.trim().split(tR);let p="";for(let g=m.length-1;g>=0;g-=1){const x=m[g],{isExternal:v,modifiers:w,hasImportantModifier:E,baseClassName:A,maybePostfixModifierPosition:S}=r(x);if(v){p=x+(p.length>0?" "+p:p);continue}let T=!!S,z=s(T?A.substring(0,S):A);if(!z){if(!T){p=x+(p.length>0?" "+p:p);continue}if(z=s(A),!z){p=x+(p.length>0?" "+p:p);continue}T=!1}const R=u(w).join(":"),O=E?R+Dm:R,j=O+z;if(d.includes(j))continue;d.push(j);const N=o(z,T);for(let B=0;B0?" "+p:p)}return p};function aR(){let e=0,n,r,s="";for(;e{if(typeof e=="string")return e;let n,r="";for(let s=0;sv(x),e());return r=eR(g),s=r.cache.get,o=r.cache.set,u=m,m(p)}function m(p){const g=s(p);if(g)return g;const x=nR(p,r);return o(p,x),x}return function(){return u(aR.apply(null,arguments))}}const Qt=e=>{const n=r=>r[e]||[];return n.isThemeGetter=!0,n},Tw=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Rw=/^\((?:(\w[\w-]*):)?(.+)\)$/i,iR=/^\d+\/\d+$/,sR=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,oR=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,lR=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,cR=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,uR=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Us=e=>iR.test(e),Ye=e=>!!e&&!Number.isNaN(Number(e)),Qr=e=>!!e&&Number.isInteger(Number(e)),Jh=e=>e.endsWith("%")&&Ye(e.slice(0,-1)),vr=e=>sR.test(e),dR=()=>!0,fR=e=>oR.test(e)&&!lR.test(e),Nw=()=>!1,hR=e=>cR.test(e),mR=e=>uR.test(e),pR=e=>!we(e)&&!Se(e),gR=e=>so(e,Mw,Nw),we=e=>Tw.test(e),Ri=e=>so(e,kw,fR),Wh=e=>so(e,wR,Ye),jx=e=>so(e,Dw,Nw),vR=e=>so(e,zw,mR),cu=e=>so(e,Lw,hR),Se=e=>Rw.test(e),ll=e=>oo(e,kw),yR=e=>oo(e,SR),Ax=e=>oo(e,Dw),bR=e=>oo(e,Mw),xR=e=>oo(e,zw),uu=e=>oo(e,Lw,!0),so=(e,n,r)=>{const s=Tw.exec(e);return s?s[1]?n(s[1]):r(s[2]):!1},oo=(e,n,r=!1)=>{const s=Rw.exec(e);return s?s[1]?n(s[1]):r:!1},Dw=e=>e==="position"||e==="percentage",zw=e=>e==="image"||e==="url",Mw=e=>e==="length"||e==="size"||e==="bg-size",kw=e=>e==="length",wR=e=>e==="number",SR=e=>e==="family-name",Lw=e=>e==="shadow",_R=()=>{const e=Qt("color"),n=Qt("font"),r=Qt("text"),s=Qt("font-weight"),o=Qt("tracking"),u=Qt("leading"),d=Qt("breakpoint"),m=Qt("container"),p=Qt("spacing"),g=Qt("radius"),x=Qt("shadow"),v=Qt("inset-shadow"),w=Qt("text-shadow"),E=Qt("drop-shadow"),A=Qt("blur"),S=Qt("perspective"),T=Qt("aspect"),z=Qt("ease"),R=Qt("animate"),O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],j=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],N=()=>[...j(),Se,we],B=()=>["auto","hidden","clip","visible","scroll"],H=()=>["auto","contain","none"],$=()=>[Se,we,p],ue=()=>[Us,"full","auto",...$()],ye=()=>[Qr,"none","subgrid",Se,we],ge=()=>["auto",{span:["full",Qr,Se,we]},Qr,Se,we],re=()=>[Qr,"auto",Se,we],le=()=>["auto","min","max","fr",Se,we],he=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ve=()=>["start","end","center","stretch","center-safe","end-safe"],C=()=>["auto",...$()],L=()=>[Us,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...$()],K=()=>[e,Se,we],de=()=>[...j(),Ax,jx,{position:[Se,we]}],xe=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ze=()=>["auto","cover","contain",bR,gR,{size:[Se,we]}],Y=()=>[Jh,ll,Ri],X=()=>["","none","full",g,Se,we],ae=()=>["",Ye,ll,Ri],ne=()=>["solid","dashed","dotted","double"],_e=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],te=()=>[Ye,Jh,Ax,jx],pe=()=>["","none",A,Se,we],Te=()=>["none",Ye,Se,we],Me=()=>["none",Ye,Se,we],Ge=()=>[Ye,Se,we],Xe=()=>[Us,"full",...$()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[vr],breakpoint:[vr],color:[dR],container:[vr],"drop-shadow":[vr],ease:["in","out","in-out"],font:[pR],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[vr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[vr],shadow:[vr],spacing:["px",Ye],text:[vr],"text-shadow":[vr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Us,we,Se,T]}],container:["container"],columns:[{columns:[Ye,we,Se,m]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:N()}],overflow:[{overflow:B()}],"overflow-x":[{"overflow-x":B()}],"overflow-y":[{"overflow-y":B()}],overscroll:[{overscroll:H()}],"overscroll-x":[{"overscroll-x":H()}],"overscroll-y":[{"overscroll-y":H()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:ue()}],"inset-x":[{"inset-x":ue()}],"inset-y":[{"inset-y":ue()}],start:[{start:ue()}],end:[{end:ue()}],top:[{top:ue()}],right:[{right:ue()}],bottom:[{bottom:ue()}],left:[{left:ue()}],visibility:["visible","invisible","collapse"],z:[{z:[Qr,"auto",Se,we]}],basis:[{basis:[Us,"full","auto",m,...$()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ye,Us,"auto","initial","none",we]}],grow:[{grow:["",Ye,Se,we]}],shrink:[{shrink:["",Ye,Se,we]}],order:[{order:[Qr,"first","last","none",Se,we]}],"grid-cols":[{"grid-cols":ye()}],"col-start-end":[{col:ge()}],"col-start":[{"col-start":re()}],"col-end":[{"col-end":re()}],"grid-rows":[{"grid-rows":ye()}],"row-start-end":[{row:ge()}],"row-start":[{"row-start":re()}],"row-end":[{"row-end":re()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":le()}],"auto-rows":[{"auto-rows":le()}],gap:[{gap:$()}],"gap-x":[{"gap-x":$()}],"gap-y":[{"gap-y":$()}],"justify-content":[{justify:[...he(),"normal"]}],"justify-items":[{"justify-items":[...ve(),"normal"]}],"justify-self":[{"justify-self":["auto",...ve()]}],"align-content":[{content:["normal",...he()]}],"align-items":[{items:[...ve(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ve(),{baseline:["","last"]}]}],"place-content":[{"place-content":he()}],"place-items":[{"place-items":[...ve(),"baseline"]}],"place-self":[{"place-self":["auto",...ve()]}],p:[{p:$()}],px:[{px:$()}],py:[{py:$()}],ps:[{ps:$()}],pe:[{pe:$()}],pt:[{pt:$()}],pr:[{pr:$()}],pb:[{pb:$()}],pl:[{pl:$()}],m:[{m:C()}],mx:[{mx:C()}],my:[{my:C()}],ms:[{ms:C()}],me:[{me:C()}],mt:[{mt:C()}],mr:[{mr:C()}],mb:[{mb:C()}],ml:[{ml:C()}],"space-x":[{"space-x":$()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":$()}],"space-y-reverse":["space-y-reverse"],size:[{size:L()}],w:[{w:[m,"screen",...L()]}],"min-w":[{"min-w":[m,"screen","none",...L()]}],"max-w":[{"max-w":[m,"screen","none","prose",{screen:[d]},...L()]}],h:[{h:["screen","lh",...L()]}],"min-h":[{"min-h":["screen","lh","none",...L()]}],"max-h":[{"max-h":["screen","lh",...L()]}],"font-size":[{text:["base",r,ll,Ri]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,Se,Wh]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Jh,we]}],"font-family":[{font:[yR,we,n]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,Se,we]}],"line-clamp":[{"line-clamp":[Ye,"none",Se,Wh]}],leading:[{leading:[u,...$()]}],"list-image":[{"list-image":["none",Se,we]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Se,we]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:K()}],"text-color":[{text:K()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ne(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ye,"from-font","auto",Se,Ri]}],"text-decoration-color":[{decoration:K()}],"underline-offset":[{"underline-offset":[Ye,"auto",Se,we]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:$()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Se,we]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Se,we]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:de()}],"bg-repeat":[{bg:xe()}],"bg-size":[{bg:ze()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Qr,Se,we],radial:["",Se,we],conic:[Qr,Se,we]},xR,vR]}],"bg-color":[{bg:K()}],"gradient-from-pos":[{from:Y()}],"gradient-via-pos":[{via:Y()}],"gradient-to-pos":[{to:Y()}],"gradient-from":[{from:K()}],"gradient-via":[{via:K()}],"gradient-to":[{to:K()}],rounded:[{rounded:X()}],"rounded-s":[{"rounded-s":X()}],"rounded-e":[{"rounded-e":X()}],"rounded-t":[{"rounded-t":X()}],"rounded-r":[{"rounded-r":X()}],"rounded-b":[{"rounded-b":X()}],"rounded-l":[{"rounded-l":X()}],"rounded-ss":[{"rounded-ss":X()}],"rounded-se":[{"rounded-se":X()}],"rounded-ee":[{"rounded-ee":X()}],"rounded-es":[{"rounded-es":X()}],"rounded-tl":[{"rounded-tl":X()}],"rounded-tr":[{"rounded-tr":X()}],"rounded-br":[{"rounded-br":X()}],"rounded-bl":[{"rounded-bl":X()}],"border-w":[{border:ae()}],"border-w-x":[{"border-x":ae()}],"border-w-y":[{"border-y":ae()}],"border-w-s":[{"border-s":ae()}],"border-w-e":[{"border-e":ae()}],"border-w-t":[{"border-t":ae()}],"border-w-r":[{"border-r":ae()}],"border-w-b":[{"border-b":ae()}],"border-w-l":[{"border-l":ae()}],"divide-x":[{"divide-x":ae()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ae()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ne(),"hidden","none"]}],"divide-style":[{divide:[...ne(),"hidden","none"]}],"border-color":[{border:K()}],"border-color-x":[{"border-x":K()}],"border-color-y":[{"border-y":K()}],"border-color-s":[{"border-s":K()}],"border-color-e":[{"border-e":K()}],"border-color-t":[{"border-t":K()}],"border-color-r":[{"border-r":K()}],"border-color-b":[{"border-b":K()}],"border-color-l":[{"border-l":K()}],"divide-color":[{divide:K()}],"outline-style":[{outline:[...ne(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ye,Se,we]}],"outline-w":[{outline:["",Ye,ll,Ri]}],"outline-color":[{outline:K()}],shadow:[{shadow:["","none",x,uu,cu]}],"shadow-color":[{shadow:K()}],"inset-shadow":[{"inset-shadow":["none",v,uu,cu]}],"inset-shadow-color":[{"inset-shadow":K()}],"ring-w":[{ring:ae()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:K()}],"ring-offset-w":[{"ring-offset":[Ye,Ri]}],"ring-offset-color":[{"ring-offset":K()}],"inset-ring-w":[{"inset-ring":ae()}],"inset-ring-color":[{"inset-ring":K()}],"text-shadow":[{"text-shadow":["none",w,uu,cu]}],"text-shadow-color":[{"text-shadow":K()}],opacity:[{opacity:[Ye,Se,we]}],"mix-blend":[{"mix-blend":[..._e(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":_e()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ye]}],"mask-image-linear-from-pos":[{"mask-linear-from":te()}],"mask-image-linear-to-pos":[{"mask-linear-to":te()}],"mask-image-linear-from-color":[{"mask-linear-from":K()}],"mask-image-linear-to-color":[{"mask-linear-to":K()}],"mask-image-t-from-pos":[{"mask-t-from":te()}],"mask-image-t-to-pos":[{"mask-t-to":te()}],"mask-image-t-from-color":[{"mask-t-from":K()}],"mask-image-t-to-color":[{"mask-t-to":K()}],"mask-image-r-from-pos":[{"mask-r-from":te()}],"mask-image-r-to-pos":[{"mask-r-to":te()}],"mask-image-r-from-color":[{"mask-r-from":K()}],"mask-image-r-to-color":[{"mask-r-to":K()}],"mask-image-b-from-pos":[{"mask-b-from":te()}],"mask-image-b-to-pos":[{"mask-b-to":te()}],"mask-image-b-from-color":[{"mask-b-from":K()}],"mask-image-b-to-color":[{"mask-b-to":K()}],"mask-image-l-from-pos":[{"mask-l-from":te()}],"mask-image-l-to-pos":[{"mask-l-to":te()}],"mask-image-l-from-color":[{"mask-l-from":K()}],"mask-image-l-to-color":[{"mask-l-to":K()}],"mask-image-x-from-pos":[{"mask-x-from":te()}],"mask-image-x-to-pos":[{"mask-x-to":te()}],"mask-image-x-from-color":[{"mask-x-from":K()}],"mask-image-x-to-color":[{"mask-x-to":K()}],"mask-image-y-from-pos":[{"mask-y-from":te()}],"mask-image-y-to-pos":[{"mask-y-to":te()}],"mask-image-y-from-color":[{"mask-y-from":K()}],"mask-image-y-to-color":[{"mask-y-to":K()}],"mask-image-radial":[{"mask-radial":[Se,we]}],"mask-image-radial-from-pos":[{"mask-radial-from":te()}],"mask-image-radial-to-pos":[{"mask-radial-to":te()}],"mask-image-radial-from-color":[{"mask-radial-from":K()}],"mask-image-radial-to-color":[{"mask-radial-to":K()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":j()}],"mask-image-conic-pos":[{"mask-conic":[Ye]}],"mask-image-conic-from-pos":[{"mask-conic-from":te()}],"mask-image-conic-to-pos":[{"mask-conic-to":te()}],"mask-image-conic-from-color":[{"mask-conic-from":K()}],"mask-image-conic-to-color":[{"mask-conic-to":K()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:de()}],"mask-repeat":[{mask:xe()}],"mask-size":[{mask:ze()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Se,we]}],filter:[{filter:["","none",Se,we]}],blur:[{blur:pe()}],brightness:[{brightness:[Ye,Se,we]}],contrast:[{contrast:[Ye,Se,we]}],"drop-shadow":[{"drop-shadow":["","none",E,uu,cu]}],"drop-shadow-color":[{"drop-shadow":K()}],grayscale:[{grayscale:["",Ye,Se,we]}],"hue-rotate":[{"hue-rotate":[Ye,Se,we]}],invert:[{invert:["",Ye,Se,we]}],saturate:[{saturate:[Ye,Se,we]}],sepia:[{sepia:["",Ye,Se,we]}],"backdrop-filter":[{"backdrop-filter":["","none",Se,we]}],"backdrop-blur":[{"backdrop-blur":pe()}],"backdrop-brightness":[{"backdrop-brightness":[Ye,Se,we]}],"backdrop-contrast":[{"backdrop-contrast":[Ye,Se,we]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ye,Se,we]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ye,Se,we]}],"backdrop-invert":[{"backdrop-invert":["",Ye,Se,we]}],"backdrop-opacity":[{"backdrop-opacity":[Ye,Se,we]}],"backdrop-saturate":[{"backdrop-saturate":[Ye,Se,we]}],"backdrop-sepia":[{"backdrop-sepia":["",Ye,Se,we]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":$()}],"border-spacing-x":[{"border-spacing-x":$()}],"border-spacing-y":[{"border-spacing-y":$()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Se,we]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ye,"initial",Se,we]}],ease:[{ease:["linear","initial",z,Se,we]}],delay:[{delay:[Ye,Se,we]}],animate:[{animate:["none",R,Se,we]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,Se,we]}],"perspective-origin":[{"perspective-origin":N()}],rotate:[{rotate:Te()}],"rotate-x":[{"rotate-x":Te()}],"rotate-y":[{"rotate-y":Te()}],"rotate-z":[{"rotate-z":Te()}],scale:[{scale:Me()}],"scale-x":[{"scale-x":Me()}],"scale-y":[{"scale-y":Me()}],"scale-z":[{"scale-z":Me()}],"scale-3d":["scale-3d"],skew:[{skew:Ge()}],"skew-x":[{"skew-x":Ge()}],"skew-y":[{"skew-y":Ge()}],transform:[{transform:[Se,we,"","none","gpu","cpu"]}],"transform-origin":[{origin:N()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Xe()}],"translate-x":[{"translate-x":Xe()}],"translate-y":[{"translate-y":Xe()}],"translate-z":[{"translate-z":Xe()}],"translate-none":["translate-none"],accent:[{accent:K()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:K()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Se,we]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":$()}],"scroll-mx":[{"scroll-mx":$()}],"scroll-my":[{"scroll-my":$()}],"scroll-ms":[{"scroll-ms":$()}],"scroll-me":[{"scroll-me":$()}],"scroll-mt":[{"scroll-mt":$()}],"scroll-mr":[{"scroll-mr":$()}],"scroll-mb":[{"scroll-mb":$()}],"scroll-ml":[{"scroll-ml":$()}],"scroll-p":[{"scroll-p":$()}],"scroll-px":[{"scroll-px":$()}],"scroll-py":[{"scroll-py":$()}],"scroll-ps":[{"scroll-ps":$()}],"scroll-pe":[{"scroll-pe":$()}],"scroll-pt":[{"scroll-pt":$()}],"scroll-pr":[{"scroll-pr":$()}],"scroll-pb":[{"scroll-pb":$()}],"scroll-pl":[{"scroll-pl":$()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Se,we]}],fill:[{fill:["none",...K()]}],"stroke-w":[{stroke:[Ye,ll,Ri,Wh]}],stroke:[{stroke:["none",...K()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},ER=rR(_R);function oe(...e){return ER(jw(e))}function Mi(e,n=24){return!e||e.length<=n*2+3?e:`${e.slice(0,n)}…${e.slice(-n)}`}function Ox(e,n){if(typeof e=="function")return e(n);e!=null&&(e.current=n)}function Ui(...e){return n=>{let r=!1;const s=e.map(o=>{const u=Ox(o,n);return!r&&typeof u=="function"&&(r=!0),u});if(r)return()=>{for(let o=0;o{const{children:u,...d}=s,m=b.Children.toArray(u),p=m.find(jR);if(p){const g=p.props.children,x=m.map(v=>v===p?b.Children.count(g)>1?b.Children.only(null):b.isValidElement(g)?g.props.children:null:v);return c.jsx(n,{...d,ref:o,children:b.isValidElement(g)?b.cloneElement(g,void 0,x):null})}return c.jsx(n,{...d,ref:o,children:u})});return r.displayName=`${e}.Slot`,r}var lo=Ki("Slot");function CR(e){const n=b.forwardRef((r,s)=>{const{children:o,...u}=r;if(b.isValidElement(o)){const d=OR(o),m=AR(u,o.props);return o.type!==b.Fragment&&(m.ref=s?Ui(s,d):d),b.cloneElement(o,m)}return b.Children.count(o)>1?b.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var Uw=Symbol("radix.slottable");function Kw(e){const n=({children:r})=>c.jsx(c.Fragment,{children:r});return n.displayName=`${e}.Slottable`,n.__radixId=Uw,n}function jR(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Uw}function AR(e,n){const r={...n};for(const s in n){const o=e[s],u=n[s];/^on[A-Z]/.test(s)?o&&u?r[s]=(...m)=>{const p=u(...m);return o(...m),p}:o&&(r[s]=o):s==="style"?r[s]={...o,...u}:s==="className"&&(r[s]=[o,u].filter(Boolean).join(" "))}return{...e,...r}}function OR(e){let n=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=n&&"isReactWarning"in n&&n.isReactWarning;return r?e.ref:(n=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=n&&"isReactWarning"in n&&n.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}const Tx=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Rx=jw,hp=(e,n)=>r=>{var s;if(n?.variants==null)return Rx(e,r?.class,r?.className);const{variants:o,defaultVariants:u}=n,d=Object.keys(o).map(g=>{const x=r?.[g],v=u?.[g];if(x===null)return null;const w=Tx(x)||Tx(v);return o[g][w]}),m=r&&Object.entries(r).reduce((g,x)=>{let[v,w]=x;return w===void 0||(g[v]=w),g},{}),p=n==null||(s=n.compoundVariants)===null||s===void 0?void 0:s.reduce((g,x)=>{let{class:v,className:w,...E}=x;return Object.entries(E).every(A=>{let[S,T]=A;return Array.isArray(T)?T.includes({...u,...m}[S]):{...u,...m}[S]===T})?[...g,v,w]:g},[]);return Rx(e,d,p,r?.class,r?.className)},mp=hp("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function ce({className:e,variant:n,size:r,asChild:s=!1,...o}){const u=s?lo:"button";return c.jsx(u,{"data-slot":"button",className:oe(mp({variant:n,size:r,className:e})),...o})}var Nx=1,TR=.9,RR=.8,NR=.17,em=.1,tm=.999,DR=.9999,zR=.99,MR=/[\\\/_+.#"@\[\(\{&]/,kR=/[\\\/_+.#"@\[\(\{&]/g,LR=/[\s-]/,qw=/[\s-]/g;function Mm(e,n,r,s,o,u,d){if(u===n.length)return o===e.length?Nx:zR;var m=`${o},${u}`;if(d[m]!==void 0)return d[m];for(var p=s.charAt(u),g=r.indexOf(p,o),x=0,v,w,E,A;g>=0;)v=Mm(e,n,r,s,g+1,u+1,d),v>x&&(g===o?v*=Nx:MR.test(e.charAt(g-1))?(v*=RR,E=e.slice(o,g-1).match(kR),E&&o>0&&(v*=Math.pow(tm,E.length))):LR.test(e.charAt(g-1))?(v*=TR,A=e.slice(o,g-1).match(qw),A&&o>0&&(v*=Math.pow(tm,A.length))):(v*=NR,o>0&&(v*=Math.pow(tm,g-o))),e.charAt(g)!==n.charAt(u)&&(v*=DR)),(vv&&(v=w*em)),v>x&&(x=v),g=r.indexOf(p,g+1);return d[m]=x,x}function Dx(e){return e.toLowerCase().replace(qw," ")}function UR(e,n,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,Mm(e,n,Dx(e),Dx(n),0,0,{})}function We(e,n,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e?.(o),r===!1||!o.defaultPrevented)return n?.(o)}}function KR(e,n){const r=b.createContext(n),s=u=>{const{children:d,...m}=u,p=b.useMemo(()=>m,Object.values(m));return c.jsx(r.Provider,{value:p,children:d})};s.displayName=e+"Provider";function o(u){const d=b.useContext(r);if(d)return d;if(n!==void 0)return n;throw new Error(`\`${u}\` must be used within \`${e}\``)}return[s,o]}function ii(e,n=[]){let r=[];function s(u,d){const m=b.createContext(d),p=r.length;r=[...r,d];const g=v=>{const{scope:w,children:E,...A}=v,S=w?.[e]?.[p]||m,T=b.useMemo(()=>A,Object.values(A));return c.jsx(S.Provider,{value:T,children:E})};g.displayName=u+"Provider";function x(v,w){const E=w?.[e]?.[p]||m,A=b.useContext(E);if(A)return A;if(d!==void 0)return d;throw new Error(`\`${v}\` must be used within \`${u}\``)}return[g,x]}const o=()=>{const u=r.map(d=>b.createContext(d));return function(m){const p=m?.[e]||u;return b.useMemo(()=>({[`__scope${e}`]:{...m,[e]:p}}),[m,p])}};return o.scopeName=e,[s,qR(o,...n)]}function qR(...e){const n=e[0];if(e.length===1)return n;const r=()=>{const s=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(u){const d=s.reduce((m,{useScope:p,scopeName:g})=>{const v=p(u)[`__scope${g}`];return{...m,...v}},{});return b.useMemo(()=>({[`__scope${n.scopeName}`]:d}),[d])}};return r.scopeName=n.scopeName,r}var tn=globalThis?.document?b.useLayoutEffect:()=>{},PR=W0[" useId ".trim().toString()]||(()=>{}),IR=0;function qn(e){const[n,r]=b.useState(PR());return tn(()=>{r(s=>s??String(IR++))},[e]),e||(n?`radix-${n}`:"")}var HR=W0[" useInsertionEffect ".trim().toString()]||tn;function Al({prop:e,defaultProp:n,onChange:r=()=>{},caller:s}){const[o,u,d]=VR({defaultProp:n,onChange:r}),m=e!==void 0,p=m?e:o;{const x=b.useRef(e!==void 0);b.useEffect(()=>{const v=x.current;v!==m&&console.warn(`${s} is changing from ${v?"controlled":"uncontrolled"} to ${m?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),x.current=m},[m,s])}const g=b.useCallback(x=>{if(m){const v=BR(x)?x(e):x;v!==e&&d.current?.(v)}else u(x)},[m,e,u,d]);return[p,g]}function VR({defaultProp:e,onChange:n}){const[r,s]=b.useState(e),o=b.useRef(r),u=b.useRef(n);return HR(()=>{u.current=n},[n]),b.useEffect(()=>{o.current!==r&&(u.current?.(r),o.current=r)},[r,o]),[r,s,u]}function BR(e){return typeof e=="function"}var FR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Fe=FR.reduce((e,n)=>{const r=Ki(`Primitive.${n}`),s=b.forwardRef((o,u)=>{const{asChild:d,...m}=o,p=d?r:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(p,{...m,ref:u})});return s.displayName=`Primitive.${n}`,{...e,[n]:s}},{});function ZR(e,n){e&&nd.flushSync(()=>e.dispatchEvent(n))}function ei(e){const n=b.useRef(e);return b.useEffect(()=>{n.current=e}),b.useMemo(()=>(...r)=>n.current?.(...r),[])}function $R(e,n=globalThis?.document){const r=ei(e);b.useEffect(()=>{const s=o=>{o.key==="Escape"&&r(o)};return n.addEventListener("keydown",s,{capture:!0}),()=>n.removeEventListener("keydown",s,{capture:!0})},[r,n])}var GR="DismissableLayer",km="dismissableLayer.update",XR="dismissableLayer.pointerDownOutside",YR="dismissableLayer.focusOutside",zx,Pw=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),zl=b.forwardRef((e,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:u,onInteractOutside:d,onDismiss:m,...p}=e,g=b.useContext(Pw),[x,v]=b.useState(null),w=x?.ownerDocument??globalThis?.document,[,E]=b.useState({}),A=bt(n,H=>v(H)),S=Array.from(g.layers),[T]=[...g.layersWithOutsidePointerEventsDisabled].slice(-1),z=S.indexOf(T),R=x?S.indexOf(x):-1,O=g.layersWithOutsidePointerEventsDisabled.size>0,j=R>=z,N=WR(H=>{const $=H.target,ue=[...g.branches].some(ye=>ye.contains($));!j||ue||(o?.(H),d?.(H),H.defaultPrevented||m?.())},w),B=eN(H=>{const $=H.target;[...g.branches].some(ye=>ye.contains($))||(u?.(H),d?.(H),H.defaultPrevented||m?.())},w);return $R(H=>{R===g.layers.size-1&&(s?.(H),!H.defaultPrevented&&m&&(H.preventDefault(),m()))},w),b.useEffect(()=>{if(x)return r&&(g.layersWithOutsidePointerEventsDisabled.size===0&&(zx=w.body.style.pointerEvents,w.body.style.pointerEvents="none"),g.layersWithOutsidePointerEventsDisabled.add(x)),g.layers.add(x),Mx(),()=>{r&&g.layersWithOutsidePointerEventsDisabled.size===1&&(w.body.style.pointerEvents=zx)}},[x,w,r,g]),b.useEffect(()=>()=>{x&&(g.layers.delete(x),g.layersWithOutsidePointerEventsDisabled.delete(x),Mx())},[x,g]),b.useEffect(()=>{const H=()=>E({});return document.addEventListener(km,H),()=>document.removeEventListener(km,H)},[]),c.jsx(Fe.div,{...p,ref:A,style:{pointerEvents:O?j?"auto":"none":void 0,...e.style},onFocusCapture:We(e.onFocusCapture,B.onFocusCapture),onBlurCapture:We(e.onBlurCapture,B.onBlurCapture),onPointerDownCapture:We(e.onPointerDownCapture,N.onPointerDownCapture)})});zl.displayName=GR;var QR="DismissableLayerBranch",JR=b.forwardRef((e,n)=>{const r=b.useContext(Pw),s=b.useRef(null),o=bt(n,s);return b.useEffect(()=>{const u=s.current;if(u)return r.branches.add(u),()=>{r.branches.delete(u)}},[r.branches]),c.jsx(Fe.div,{...e,ref:o})});JR.displayName=QR;function WR(e,n=globalThis?.document){const r=ei(e),s=b.useRef(!1),o=b.useRef(()=>{});return b.useEffect(()=>{const u=m=>{if(m.target&&!s.current){let p=function(){Iw(XR,r,g,{discrete:!0})};const g={originalEvent:m};m.pointerType==="touch"?(n.removeEventListener("click",o.current),o.current=p,n.addEventListener("click",o.current,{once:!0})):p()}else n.removeEventListener("click",o.current);s.current=!1},d=window.setTimeout(()=>{n.addEventListener("pointerdown",u)},0);return()=>{window.clearTimeout(d),n.removeEventListener("pointerdown",u),n.removeEventListener("click",o.current)}},[n,r]),{onPointerDownCapture:()=>s.current=!0}}function eN(e,n=globalThis?.document){const r=ei(e),s=b.useRef(!1);return b.useEffect(()=>{const o=u=>{u.target&&!s.current&&Iw(YR,r,{originalEvent:u},{discrete:!1})};return n.addEventListener("focusin",o),()=>n.removeEventListener("focusin",o)},[n,r]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function Mx(){const e=new CustomEvent(km);document.dispatchEvent(e)}function Iw(e,n,r,{discrete:s}){const o=r.originalEvent.target,u=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});n&&o.addEventListener(e,n,{once:!0}),s?ZR(o,u):o.dispatchEvent(u)}var nm="focusScope.autoFocusOnMount",am="focusScope.autoFocusOnUnmount",kx={bubbles:!1,cancelable:!0},tN="FocusScope",id=b.forwardRef((e,n)=>{const{loop:r=!1,trapped:s=!1,onMountAutoFocus:o,onUnmountAutoFocus:u,...d}=e,[m,p]=b.useState(null),g=ei(o),x=ei(u),v=b.useRef(null),w=bt(n,S=>p(S)),E=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(s){let S=function(O){if(E.paused||!m)return;const j=O.target;m.contains(j)?v.current=j:Jr(v.current,{select:!0})},T=function(O){if(E.paused||!m)return;const j=O.relatedTarget;j!==null&&(m.contains(j)||Jr(v.current,{select:!0}))},z=function(O){if(document.activeElement===document.body)for(const N of O)N.removedNodes.length>0&&Jr(m)};document.addEventListener("focusin",S),document.addEventListener("focusout",T);const R=new MutationObserver(z);return m&&R.observe(m,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",T),R.disconnect()}}},[s,m,E.paused]),b.useEffect(()=>{if(m){Ux.add(E);const S=document.activeElement;if(!m.contains(S)){const z=new CustomEvent(nm,kx);m.addEventListener(nm,g),m.dispatchEvent(z),z.defaultPrevented||(nN(oN(Hw(m)),{select:!0}),document.activeElement===S&&Jr(m))}return()=>{m.removeEventListener(nm,g),setTimeout(()=>{const z=new CustomEvent(am,kx);m.addEventListener(am,x),m.dispatchEvent(z),z.defaultPrevented||Jr(S??document.body,{select:!0}),m.removeEventListener(am,x),Ux.remove(E)},0)}}},[m,g,x,E]);const A=b.useCallback(S=>{if(!r&&!s||E.paused)return;const T=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,z=document.activeElement;if(T&&z){const R=S.currentTarget,[O,j]=aN(R);O&&j?!S.shiftKey&&z===j?(S.preventDefault(),r&&Jr(O,{select:!0})):S.shiftKey&&z===O&&(S.preventDefault(),r&&Jr(j,{select:!0})):z===R&&S.preventDefault()}},[r,s,E.paused]);return c.jsx(Fe.div,{tabIndex:-1,...d,ref:w,onKeyDown:A})});id.displayName=tN;function nN(e,{select:n=!1}={}){const r=document.activeElement;for(const s of e)if(Jr(s,{select:n}),document.activeElement!==r)return}function aN(e){const n=Hw(e),r=Lx(n,e),s=Lx(n.reverse(),e);return[r,s]}function Hw(e){const n=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const o=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||o?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)n.push(r.currentNode);return n}function Lx(e,n){for(const r of e)if(!rN(r,{upTo:n}))return r}function rN(e,{upTo:n}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(n!==void 0&&e===n)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function iN(e){return e instanceof HTMLInputElement&&"select"in e}function Jr(e,{select:n=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&iN(e)&&n&&e.select()}}var Ux=sN();function sN(){let e=[];return{add(n){const r=e[0];n!==r&&r?.pause(),e=Kx(e,n),e.unshift(n)},remove(n){e=Kx(e,n),e[0]?.resume()}}}function Kx(e,n){const r=[...e],s=r.indexOf(n);return s!==-1&&r.splice(s,1),r}function oN(e){return e.filter(n=>n.tagName!=="A")}var lN="Portal",Ml=b.forwardRef((e,n)=>{const{container:r,...s}=e,[o,u]=b.useState(!1);tn(()=>u(!0),[]);const d=r||o&&globalThis?.document?.body;return d?Q0.createPortal(c.jsx(Fe.div,{...s,ref:n}),d):null});Ml.displayName=lN;function cN(e,n){return b.useReducer((r,s)=>n[r][s]??r,e)}var si=e=>{const{present:n,children:r}=e,s=uN(n),o=typeof r=="function"?r({present:s.isPresent}):b.Children.only(r),u=bt(s.ref,dN(o));return typeof r=="function"||s.isPresent?b.cloneElement(o,{ref:u}):null};si.displayName="Presence";function uN(e){const[n,r]=b.useState(),s=b.useRef(null),o=b.useRef(e),u=b.useRef("none"),d=e?"mounted":"unmounted",[m,p]=cN(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const g=du(s.current);u.current=m==="mounted"?g:"none"},[m]),tn(()=>{const g=s.current,x=o.current;if(x!==e){const w=u.current,E=du(g);e?p("MOUNT"):E==="none"||g?.display==="none"?p("UNMOUNT"):p(x&&w!==E?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,p]),tn(()=>{if(n){let g;const x=n.ownerDocument.defaultView??window,v=E=>{const S=du(s.current).includes(CSS.escape(E.animationName));if(E.target===n&&S&&(p("ANIMATION_END"),!o.current)){const T=n.style.animationFillMode;n.style.animationFillMode="forwards",g=x.setTimeout(()=>{n.style.animationFillMode==="forwards"&&(n.style.animationFillMode=T)})}},w=E=>{E.target===n&&(u.current=du(s.current))};return n.addEventListener("animationstart",w),n.addEventListener("animationcancel",v),n.addEventListener("animationend",v),()=>{x.clearTimeout(g),n.removeEventListener("animationstart",w),n.removeEventListener("animationcancel",v),n.removeEventListener("animationend",v)}}else p("ANIMATION_END")},[n,p]),{isPresent:["mounted","unmountSuspended"].includes(m),ref:b.useCallback(g=>{s.current=g?getComputedStyle(g):null,r(g)},[])}}function du(e){return e?.animationName||"none"}function dN(e){let n=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=n&&"isReactWarning"in n&&n.isReactWarning;return r?e.ref:(n=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=n&&"isReactWarning"in n&&n.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var rm=0;function pp(){b.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??qx()),document.body.insertAdjacentElement("beforeend",e[1]??qx()),rm++,()=>{rm===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(n=>n.remove()),rm--}},[])}function qx(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ia=function(){return Ia=Object.assign||function(n){for(var r,s=1,o=arguments.length;s"u")return ON;var n=TN(e),r=document.documentElement.clientWidth,s=window.innerWidth;return{left:n[0],top:n[1],right:n[2],gap:Math.max(0,s-r+n[2]-n[0])}},NN=Zw(),$s="data-scroll-locked",DN=function(e,n,r,s){var o=e.left,u=e.top,d=e.right,m=e.gap;return r===void 0&&(r="margin"),` .`.concat(hN,` { overflow: hidden `).concat(s,`; padding-right: `).concat(m,"px ").concat(s,`; } body[`).concat($s,`] { overflow: hidden `).concat(s,`; overscroll-behavior: contain; `).concat([n&&"position: relative ".concat(s,";"),r==="margin"&&` padding-left: `.concat(o,`px; padding-top: `).concat(u,`px; padding-right: `).concat(d,`px; margin-left:0; margin-top:0; margin-right: `).concat(m,"px ").concat(s,`; `),r==="padding"&&"padding-right: ".concat(m,"px ").concat(s,";")].filter(Boolean).join(""),` } .`).concat(zu,` { right: `).concat(m,"px ").concat(s,`; } .`).concat(Mu,` { margin-right: `).concat(m,"px ").concat(s,`; } .`).concat(zu," .").concat(zu,` { right: 0 `).concat(s,`; } .`).concat(Mu," .").concat(Mu,` { margin-right: 0 `).concat(s,`; } body[`).concat($s,`] { `).concat(mN,": ").concat(m,`px; } `)},Ix=function(){var e=parseInt(document.body.getAttribute($s)||"0",10);return isFinite(e)?e:0},zN=function(){b.useEffect(function(){return document.body.setAttribute($s,(Ix()+1).toString()),function(){var e=Ix()-1;e<=0?document.body.removeAttribute($s):document.body.setAttribute($s,e.toString())}},[])},MN=function(e){var n=e.noRelative,r=e.noImportant,s=e.gapMode,o=s===void 0?"margin":s;zN();var u=b.useMemo(function(){return RN(o)},[o]);return b.createElement(NN,{styles:DN(u,!n,o,r?"":"!important")})},Lm=!1;if(typeof window<"u")try{var fu=Object.defineProperty({},"passive",{get:function(){return Lm=!0,!0}});window.addEventListener("test",fu,fu),window.removeEventListener("test",fu,fu)}catch{Lm=!1}var Ks=Lm?{passive:!1}:!1,kN=function(e){return e.tagName==="TEXTAREA"},$w=function(e,n){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[n]!=="hidden"&&!(r.overflowY===r.overflowX&&!kN(e)&&r[n]==="visible")},LN=function(e){return $w(e,"overflowY")},UN=function(e){return $w(e,"overflowX")},Hx=function(e,n){var r=n.ownerDocument,s=n;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var o=Gw(e,s);if(o){var u=Xw(e,s),d=u[1],m=u[2];if(d>m)return!0}s=s.parentNode}while(s&&s!==r.body);return!1},KN=function(e){var n=e.scrollTop,r=e.scrollHeight,s=e.clientHeight;return[n,r,s]},qN=function(e){var n=e.scrollLeft,r=e.scrollWidth,s=e.clientWidth;return[n,r,s]},Gw=function(e,n){return e==="v"?LN(n):UN(n)},Xw=function(e,n){return e==="v"?KN(n):qN(n)},PN=function(e,n){return e==="h"&&n==="rtl"?-1:1},IN=function(e,n,r,s,o){var u=PN(e,window.getComputedStyle(n).direction),d=u*s,m=r.target,p=n.contains(m),g=!1,x=d>0,v=0,w=0;do{if(!m)break;var E=Xw(e,m),A=E[0],S=E[1],T=E[2],z=S-T-u*A;(A||z)&&Gw(e,m)&&(v+=z,w+=A);var R=m.parentNode;m=R&&R.nodeType===Node.DOCUMENT_FRAGMENT_NODE?R.host:R}while(!p&&m!==document.body||p&&(n.contains(m)||n===m));return(x&&Math.abs(v)<1||!x&&Math.abs(w)<1)&&(g=!0),g},hu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Vx=function(e){return[e.deltaX,e.deltaY]},Bx=function(e){return e&&"current"in e?e.current:e},HN=function(e,n){return e[0]===n[0]&&e[1]===n[1]},VN=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} `)},BN=0,qs=[];function FN(e){var n=b.useRef([]),r=b.useRef([0,0]),s=b.useRef(),o=b.useState(BN++)[0],u=b.useState(Zw)[0],d=b.useRef(e);b.useEffect(function(){d.current=e},[e]),b.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var S=fN([e.lockRef.current],(e.shards||[]).map(Bx),!0).filter(Boolean);return S.forEach(function(T){return T.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),S.forEach(function(T){return T.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var m=b.useCallback(function(S,T){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!d.current.allowPinchZoom;var z=hu(S),R=r.current,O="deltaX"in S?S.deltaX:R[0]-z[0],j="deltaY"in S?S.deltaY:R[1]-z[1],N,B=S.target,H=Math.abs(O)>Math.abs(j)?"h":"v";if("touches"in S&&H==="h"&&B.type==="range")return!1;var $=Hx(H,B);if(!$)return!0;if($?N=H:(N=H==="v"?"h":"v",$=Hx(H,B)),!$)return!1;if(!s.current&&"changedTouches"in S&&(O||j)&&(s.current=N),!N)return!0;var ue=s.current||N;return IN(ue,T,S,ue==="h"?O:j)},[]),p=b.useCallback(function(S){var T=S;if(!(!qs.length||qs[qs.length-1]!==u)){var z="deltaY"in T?Vx(T):hu(T),R=n.current.filter(function(N){return N.name===T.type&&(N.target===T.target||T.target===N.shadowParent)&&HN(N.delta,z)})[0];if(R&&R.should){T.cancelable&&T.preventDefault();return}if(!R){var O=(d.current.shards||[]).map(Bx).filter(Boolean).filter(function(N){return N.contains(T.target)}),j=O.length>0?m(T,O[0]):!d.current.noIsolation;j&&T.cancelable&&T.preventDefault()}}},[]),g=b.useCallback(function(S,T,z,R){var O={name:S,delta:T,target:z,should:R,shadowParent:ZN(z)};n.current.push(O),setTimeout(function(){n.current=n.current.filter(function(j){return j!==O})},1)},[]),x=b.useCallback(function(S){r.current=hu(S),s.current=void 0},[]),v=b.useCallback(function(S){g(S.type,Vx(S),S.target,m(S,e.lockRef.current))},[]),w=b.useCallback(function(S){g(S.type,hu(S),S.target,m(S,e.lockRef.current))},[]);b.useEffect(function(){return qs.push(u),e.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:w}),document.addEventListener("wheel",p,Ks),document.addEventListener("touchmove",p,Ks),document.addEventListener("touchstart",x,Ks),function(){qs=qs.filter(function(S){return S!==u}),document.removeEventListener("wheel",p,Ks),document.removeEventListener("touchmove",p,Ks),document.removeEventListener("touchstart",x,Ks)}},[]);var E=e.removeScrollBar,A=e.inert;return b.createElement(b.Fragment,null,A?b.createElement(u,{styles:VN(o)}):null,E?b.createElement(MN,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function ZN(e){for(var n=null;e!==null;)e instanceof ShadowRoot&&(n=e.host,e=e.host),e=e.parentNode;return n}const $N=wN(Fw,FN);var od=b.forwardRef(function(e,n){return b.createElement(sd,Ia({},e,{ref:n,sideCar:$N}))});od.classNames=sd.classNames;var GN=function(e){if(typeof document>"u")return null;var n=Array.isArray(e)?e[0]:e;return n.ownerDocument.body},Ps=new WeakMap,mu=new WeakMap,pu={},lm=0,Yw=function(e){return e&&(e.host||Yw(e.parentNode))},XN=function(e,n){return n.map(function(r){if(e.contains(r))return r;var s=Yw(r);return s&&e.contains(s)?s:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},YN=function(e,n,r,s){var o=XN(n,Array.isArray(e)?e:[e]);pu[r]||(pu[r]=new WeakMap);var u=pu[r],d=[],m=new Set,p=new Set(o),g=function(v){!v||m.has(v)||(m.add(v),g(v.parentNode))};o.forEach(g);var x=function(v){!v||p.has(v)||Array.prototype.forEach.call(v.children,function(w){if(m.has(w))x(w);else try{var E=w.getAttribute(s),A=E!==null&&E!=="false",S=(Ps.get(w)||0)+1,T=(u.get(w)||0)+1;Ps.set(w,S),u.set(w,T),d.push(w),S===1&&A&&mu.set(w,!0),T===1&&w.setAttribute(r,"true"),A||w.setAttribute(s,"true")}catch(z){console.error("aria-hidden: cannot operate on ",w,z)}})};return x(n),m.clear(),lm++,function(){d.forEach(function(v){var w=Ps.get(v)-1,E=u.get(v)-1;Ps.set(v,w),u.set(v,E),w||(mu.has(v)||v.removeAttribute(s),mu.delete(v)),E||v.removeAttribute(r)}),lm--,lm||(Ps=new WeakMap,Ps=new WeakMap,mu=new WeakMap,pu={})}},gp=function(e,n,r){r===void 0&&(r="data-aria-hidden");var s=Array.from(Array.isArray(e)?e:[e]),o=GN(e);return o?(s.push.apply(s,Array.from(o.querySelectorAll("[aria-live], script"))),YN(s,o,r,"aria-hidden")):function(){return null}},ld="Dialog",[Qw,Jw]=ii(ld),[QN,Ra]=Qw(ld),Ww=e=>{const{__scopeDialog:n,children:r,open:s,defaultOpen:o,onOpenChange:u,modal:d=!0}=e,m=b.useRef(null),p=b.useRef(null),[g,x]=Al({prop:s,defaultProp:o??!1,onChange:u,caller:ld});return c.jsx(QN,{scope:n,triggerRef:m,contentRef:p,contentId:qn(),titleId:qn(),descriptionId:qn(),open:g,onOpenChange:x,onOpenToggle:b.useCallback(()=>x(v=>!v),[x]),modal:d,children:r})};Ww.displayName=ld;var eS="DialogTrigger",tS=b.forwardRef((e,n)=>{const{__scopeDialog:r,...s}=e,o=Ra(eS,r),u=bt(n,o.triggerRef);return c.jsx(Fe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":bp(o.open),...s,ref:u,onClick:We(e.onClick,o.onOpenToggle)})});tS.displayName=eS;var vp="DialogPortal",[JN,nS]=Qw(vp,{forceMount:void 0}),aS=e=>{const{__scopeDialog:n,forceMount:r,children:s,container:o}=e,u=Ra(vp,n);return c.jsx(JN,{scope:n,forceMount:r,children:b.Children.map(s,d=>c.jsx(si,{present:r||u.open,children:c.jsx(Ml,{asChild:!0,container:o,children:d})}))})};aS.displayName=vp;var Vu="DialogOverlay",rS=b.forwardRef((e,n)=>{const r=nS(Vu,e.__scopeDialog),{forceMount:s=r.forceMount,...o}=e,u=Ra(Vu,e.__scopeDialog);return u.modal?c.jsx(si,{present:s||u.open,children:c.jsx(eD,{...o,ref:n})}):null});rS.displayName=Vu;var WN=Ki("DialogOverlay.RemoveScroll"),eD=b.forwardRef((e,n)=>{const{__scopeDialog:r,...s}=e,o=Ra(Vu,r);return c.jsx(od,{as:WN,allowPinchZoom:!0,shards:[o.contentRef],children:c.jsx(Fe.div,{"data-state":bp(o.open),...s,ref:n,style:{pointerEvents:"auto",...s.style}})})}),qi="DialogContent",iS=b.forwardRef((e,n)=>{const r=nS(qi,e.__scopeDialog),{forceMount:s=r.forceMount,...o}=e,u=Ra(qi,e.__scopeDialog);return c.jsx(si,{present:s||u.open,children:u.modal?c.jsx(tD,{...o,ref:n}):c.jsx(nD,{...o,ref:n})})});iS.displayName=qi;var tD=b.forwardRef((e,n)=>{const r=Ra(qi,e.__scopeDialog),s=b.useRef(null),o=bt(n,r.contentRef,s);return b.useEffect(()=>{const u=s.current;if(u)return gp(u)},[]),c.jsx(sS,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:We(e.onCloseAutoFocus,u=>{u.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:We(e.onPointerDownOutside,u=>{const d=u.detail.originalEvent,m=d.button===0&&d.ctrlKey===!0;(d.button===2||m)&&u.preventDefault()}),onFocusOutside:We(e.onFocusOutside,u=>u.preventDefault())})}),nD=b.forwardRef((e,n)=>{const r=Ra(qi,e.__scopeDialog),s=b.useRef(!1),o=b.useRef(!1);return c.jsx(sS,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:u=>{e.onCloseAutoFocus?.(u),u.defaultPrevented||(s.current||r.triggerRef.current?.focus(),u.preventDefault()),s.current=!1,o.current=!1},onInteractOutside:u=>{e.onInteractOutside?.(u),u.defaultPrevented||(s.current=!0,u.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const d=u.target;r.triggerRef.current?.contains(d)&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&o.current&&u.preventDefault()}})}),sS=b.forwardRef((e,n)=>{const{__scopeDialog:r,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:u,...d}=e,m=Ra(qi,r),p=b.useRef(null),g=bt(n,p);return pp(),c.jsxs(c.Fragment,{children:[c.jsx(id,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:o,onUnmountAutoFocus:u,children:c.jsx(zl,{role:"dialog",id:m.contentId,"aria-describedby":m.descriptionId,"aria-labelledby":m.titleId,"data-state":bp(m.open),...d,ref:g,onDismiss:()=>m.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(rD,{titleId:m.titleId}),c.jsx(sD,{contentRef:p,descriptionId:m.descriptionId})]})]})}),yp="DialogTitle",oS=b.forwardRef((e,n)=>{const{__scopeDialog:r,...s}=e,o=Ra(yp,r);return c.jsx(Fe.h2,{id:o.titleId,...s,ref:n})});oS.displayName=yp;var lS="DialogDescription",cS=b.forwardRef((e,n)=>{const{__scopeDialog:r,...s}=e,o=Ra(lS,r);return c.jsx(Fe.p,{id:o.descriptionId,...s,ref:n})});cS.displayName=lS;var uS="DialogClose",dS=b.forwardRef((e,n)=>{const{__scopeDialog:r,...s}=e,o=Ra(uS,r);return c.jsx(Fe.button,{type:"button",...s,ref:n,onClick:We(e.onClick,()=>o.onOpenChange(!1))})});dS.displayName=uS;function bp(e){return e?"open":"closed"}var fS="DialogTitleWarning",[aD,hS]=KR(fS,{contentName:qi,titleName:yp,docsSlug:"dialog"}),rD=({titleId:e})=>{const n=hS(fS),r=`\`${n.contentName}\` requires a \`${n.titleName}\` for the component to be accessible for screen reader users. If you want to hide the \`${n.titleName}\`, you can wrap it with our VisuallyHidden component. For more information, see https://radix-ui.com/primitives/docs/components/${n.docsSlug}`;return b.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},iD="DialogDescriptionWarning",sD=({contentRef:e,descriptionId:n})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${hS(iD).contentName}}.`;return b.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");n&&o&&(document.getElementById(n)||console.warn(s))},[s,e,n]),null},cd=Ww,mS=tS,ud=aS,dd=rS,fd=iS,xp=oS,wp=cS,kl=dS,cl='[cmdk-group=""]',cm='[cmdk-group-items=""]',oD='[cmdk-group-heading=""]',pS='[cmdk-item=""]',Fx=`${pS}:not([aria-disabled="true"])`,Um="cmdk-item-select",Hs="data-value",lD=(e,n,r)=>UR(e,n,r),gS=b.createContext(void 0),Ll=()=>b.useContext(gS),vS=b.createContext(void 0),Sp=()=>b.useContext(vS),yS=b.createContext(void 0),bS=b.forwardRef((e,n)=>{let r=Vs(()=>{var Y,X;return{search:"",value:(X=(Y=e.value)!=null?Y:e.defaultValue)!=null?X:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),s=Vs(()=>new Set),o=Vs(()=>new Map),u=Vs(()=>new Map),d=Vs(()=>new Set),m=xS(e),{label:p,children:g,value:x,onValueChange:v,filter:w,shouldFilter:E,loop:A,disablePointerSelection:S=!1,vimBindings:T=!0,...z}=e,R=qn(),O=qn(),j=qn(),N=b.useRef(null),B=bD();Pi(()=>{if(x!==void 0){let Y=x.trim();r.current.value=Y,H.emit()}},[x]),Pi(()=>{B(6,le)},[]);let H=b.useMemo(()=>({subscribe:Y=>(d.current.add(Y),()=>d.current.delete(Y)),snapshot:()=>r.current,setState:(Y,X,ae)=>{var ne,_e,te,pe;if(!Object.is(r.current[Y],X)){if(r.current[Y]=X,Y==="search")re(),ye(),B(1,ge);else if(Y==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let Te=document.getElementById(j);Te?Te.focus():(ne=document.getElementById(R))==null||ne.focus()}if(B(7,()=>{var Te;r.current.selectedItemId=(Te=he())==null?void 0:Te.id,H.emit()}),ae||B(5,le),((_e=m.current)==null?void 0:_e.value)!==void 0){let Te=X??"";(pe=(te=m.current).onValueChange)==null||pe.call(te,Te);return}}H.emit()}},emit:()=>{d.current.forEach(Y=>Y())}}),[]),$=b.useMemo(()=>({value:(Y,X,ae)=>{var ne;X!==((ne=u.current.get(Y))==null?void 0:ne.value)&&(u.current.set(Y,{value:X,keywords:ae}),r.current.filtered.items.set(Y,ue(X,ae)),B(2,()=>{ye(),H.emit()}))},item:(Y,X)=>(s.current.add(Y),X&&(o.current.has(X)?o.current.get(X).add(Y):o.current.set(X,new Set([Y]))),B(3,()=>{re(),ye(),r.current.value||ge(),H.emit()}),()=>{u.current.delete(Y),s.current.delete(Y),r.current.filtered.items.delete(Y);let ae=he();B(4,()=>{re(),ae?.getAttribute("id")===Y&&ge(),H.emit()})}),group:Y=>(o.current.has(Y)||o.current.set(Y,new Set),()=>{u.current.delete(Y),o.current.delete(Y)}),filter:()=>m.current.shouldFilter,label:p||e["aria-label"],getDisablePointerSelection:()=>m.current.disablePointerSelection,listId:R,inputId:j,labelId:O,listInnerRef:N}),[]);function ue(Y,X){var ae,ne;let _e=(ne=(ae=m.current)==null?void 0:ae.filter)!=null?ne:lD;return Y?_e(Y,r.current.search,X):0}function ye(){if(!r.current.search||m.current.shouldFilter===!1)return;let Y=r.current.filtered.items,X=[];r.current.filtered.groups.forEach(ne=>{let _e=o.current.get(ne),te=0;_e.forEach(pe=>{let Te=Y.get(pe);te=Math.max(Te,te)}),X.push([ne,te])});let ae=N.current;ve().sort((ne,_e)=>{var te,pe;let Te=ne.getAttribute("id"),Me=_e.getAttribute("id");return((te=Y.get(Me))!=null?te:0)-((pe=Y.get(Te))!=null?pe:0)}).forEach(ne=>{let _e=ne.closest(cm);_e?_e.appendChild(ne.parentElement===_e?ne:ne.closest(`${cm} > *`)):ae.appendChild(ne.parentElement===ae?ne:ne.closest(`${cm} > *`))}),X.sort((ne,_e)=>_e[1]-ne[1]).forEach(ne=>{var _e;let te=(_e=N.current)==null?void 0:_e.querySelector(`${cl}[${Hs}="${encodeURIComponent(ne[0])}"]`);te?.parentElement.appendChild(te)})}function ge(){let Y=ve().find(ae=>ae.getAttribute("aria-disabled")!=="true"),X=Y?.getAttribute(Hs);H.setState("value",X||void 0)}function re(){var Y,X,ae,ne;if(!r.current.search||m.current.shouldFilter===!1){r.current.filtered.count=s.current.size;return}r.current.filtered.groups=new Set;let _e=0;for(let te of s.current){let pe=(X=(Y=u.current.get(te))==null?void 0:Y.value)!=null?X:"",Te=(ne=(ae=u.current.get(te))==null?void 0:ae.keywords)!=null?ne:[],Me=ue(pe,Te);r.current.filtered.items.set(te,Me),Me>0&&_e++}for(let[te,pe]of o.current)for(let Te of pe)if(r.current.filtered.items.get(Te)>0){r.current.filtered.groups.add(te);break}r.current.filtered.count=_e}function le(){var Y,X,ae;let ne=he();ne&&(((Y=ne.parentElement)==null?void 0:Y.firstChild)===ne&&((ae=(X=ne.closest(cl))==null?void 0:X.querySelector(oD))==null||ae.scrollIntoView({block:"nearest"})),ne.scrollIntoView({block:"nearest"}))}function he(){var Y;return(Y=N.current)==null?void 0:Y.querySelector(`${pS}[aria-selected="true"]`)}function ve(){var Y;return Array.from(((Y=N.current)==null?void 0:Y.querySelectorAll(Fx))||[])}function C(Y){let X=ve()[Y];X&&H.setState("value",X.getAttribute(Hs))}function L(Y){var X;let ae=he(),ne=ve(),_e=ne.findIndex(pe=>pe===ae),te=ne[_e+Y];(X=m.current)!=null&&X.loop&&(te=_e+Y<0?ne[ne.length-1]:_e+Y===ne.length?ne[0]:ne[_e+Y]),te&&H.setState("value",te.getAttribute(Hs))}function K(Y){let X=he(),ae=X?.closest(cl),ne;for(;ae&&!ne;)ae=Y>0?vD(ae,cl):yD(ae,cl),ne=ae?.querySelector(Fx);ne?H.setState("value",ne.getAttribute(Hs)):L(Y)}let de=()=>C(ve().length-1),xe=Y=>{Y.preventDefault(),Y.metaKey?de():Y.altKey?K(1):L(1)},ze=Y=>{Y.preventDefault(),Y.metaKey?C(0):Y.altKey?K(-1):L(-1)};return b.createElement(Fe.div,{ref:n,tabIndex:-1,...z,"cmdk-root":"",onKeyDown:Y=>{var X;(X=z.onKeyDown)==null||X.call(z,Y);let ae=Y.nativeEvent.isComposing||Y.keyCode===229;if(!(Y.defaultPrevented||ae))switch(Y.key){case"n":case"j":{T&&Y.ctrlKey&&xe(Y);break}case"ArrowDown":{xe(Y);break}case"p":case"k":{T&&Y.ctrlKey&&ze(Y);break}case"ArrowUp":{ze(Y);break}case"Home":{Y.preventDefault(),C(0);break}case"End":{Y.preventDefault(),de();break}case"Enter":{Y.preventDefault();let ne=he();if(ne){let _e=new Event(Um);ne.dispatchEvent(_e)}}}}},b.createElement("label",{"cmdk-label":"",htmlFor:$.inputId,id:$.labelId,style:wD},p),hd(e,Y=>b.createElement(vS.Provider,{value:H},b.createElement(gS.Provider,{value:$},Y))))}),cD=b.forwardRef((e,n)=>{var r,s;let o=qn(),u=b.useRef(null),d=b.useContext(yS),m=Ll(),p=xS(e),g=(s=(r=p.current)==null?void 0:r.forceMount)!=null?s:d?.forceMount;Pi(()=>{if(!g)return m.item(o,d?.id)},[g]);let x=wS(o,u,[e.value,e.children,u],e.keywords),v=Sp(),w=ti(B=>B.value&&B.value===x.current),E=ti(B=>g||m.filter()===!1?!0:B.search?B.filtered.items.get(o)>0:!0);b.useEffect(()=>{let B=u.current;if(!(!B||e.disabled))return B.addEventListener(Um,A),()=>B.removeEventListener(Um,A)},[E,e.onSelect,e.disabled]);function A(){var B,H;S(),(H=(B=p.current).onSelect)==null||H.call(B,x.current)}function S(){v.setState("value",x.current,!0)}if(!E)return null;let{disabled:T,value:z,onSelect:R,forceMount:O,keywords:j,...N}=e;return b.createElement(Fe.div,{ref:Ui(u,n),...N,id:o,"cmdk-item":"",role:"option","aria-disabled":!!T,"aria-selected":!!w,"data-disabled":!!T,"data-selected":!!w,onPointerMove:T||m.getDisablePointerSelection()?void 0:S,onClick:T?void 0:A},e.children)}),uD=b.forwardRef((e,n)=>{let{heading:r,children:s,forceMount:o,...u}=e,d=qn(),m=b.useRef(null),p=b.useRef(null),g=qn(),x=Ll(),v=ti(E=>o||x.filter()===!1?!0:E.search?E.filtered.groups.has(d):!0);Pi(()=>x.group(d),[]),wS(d,m,[e.value,e.heading,p]);let w=b.useMemo(()=>({id:d,forceMount:o}),[o]);return b.createElement(Fe.div,{ref:Ui(m,n),...u,"cmdk-group":"",role:"presentation",hidden:v?void 0:!0},r&&b.createElement("div",{ref:p,"cmdk-group-heading":"","aria-hidden":!0,id:g},r),hd(e,E=>b.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?g:void 0},b.createElement(yS.Provider,{value:w},E))))}),dD=b.forwardRef((e,n)=>{let{alwaysRender:r,...s}=e,o=b.useRef(null),u=ti(d=>!d.search);return!r&&!u?null:b.createElement(Fe.div,{ref:Ui(o,n),...s,"cmdk-separator":"",role:"separator"})}),fD=b.forwardRef((e,n)=>{let{onValueChange:r,...s}=e,o=e.value!=null,u=Sp(),d=ti(g=>g.search),m=ti(g=>g.selectedItemId),p=Ll();return b.useEffect(()=>{e.value!=null&&u.setState("search",e.value)},[e.value]),b.createElement(Fe.input,{ref:n,...s,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":p.listId,"aria-labelledby":p.labelId,"aria-activedescendant":m,id:p.inputId,type:"text",value:o?e.value:d,onChange:g=>{o||u.setState("search",g.target.value),r?.(g.target.value)}})}),hD=b.forwardRef((e,n)=>{let{children:r,label:s="Suggestions",...o}=e,u=b.useRef(null),d=b.useRef(null),m=ti(g=>g.selectedItemId),p=Ll();return b.useEffect(()=>{if(d.current&&u.current){let g=d.current,x=u.current,v,w=new ResizeObserver(()=>{v=requestAnimationFrame(()=>{let E=g.offsetHeight;x.style.setProperty("--cmdk-list-height",E.toFixed(1)+"px")})});return w.observe(g),()=>{cancelAnimationFrame(v),w.unobserve(g)}}},[]),b.createElement(Fe.div,{ref:Ui(u,n),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":m,"aria-label":s,id:p.listId},hd(e,g=>b.createElement("div",{ref:Ui(d,p.listInnerRef),"cmdk-list-sizer":""},g)))}),mD=b.forwardRef((e,n)=>{let{open:r,onOpenChange:s,overlayClassName:o,contentClassName:u,container:d,...m}=e;return b.createElement(cd,{open:r,onOpenChange:s},b.createElement(ud,{container:d},b.createElement(dd,{"cmdk-overlay":"",className:o}),b.createElement(fd,{"aria-label":e.label,"cmdk-dialog":"",className:u},b.createElement(bS,{ref:n,...m}))))}),pD=b.forwardRef((e,n)=>ti(r=>r.filtered.count===0)?b.createElement(Fe.div,{ref:n,...e,"cmdk-empty":"",role:"presentation"}):null),gD=b.forwardRef((e,n)=>{let{progress:r,children:s,label:o="Loading...",...u}=e;return b.createElement(Fe.div,{ref:n,...u,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},hd(e,d=>b.createElement("div",{"aria-hidden":!0},d)))}),co=Object.assign(bS,{List:hD,Item:cD,Input:fD,Group:uD,Separator:dD,Dialog:mD,Empty:pD,Loading:gD});function vD(e,n){let r=e.nextElementSibling;for(;r;){if(r.matches(n))return r;r=r.nextElementSibling}}function yD(e,n){let r=e.previousElementSibling;for(;r;){if(r.matches(n))return r;r=r.previousElementSibling}}function xS(e){let n=b.useRef(e);return Pi(()=>{n.current=e}),n}var Pi=typeof window>"u"?b.useEffect:b.useLayoutEffect;function Vs(e){let n=b.useRef();return n.current===void 0&&(n.current=e()),n}function ti(e){let n=Sp(),r=()=>e(n.snapshot());return b.useSyncExternalStore(n.subscribe,r,r)}function wS(e,n,r,s=[]){let o=b.useRef(),u=Ll();return Pi(()=>{var d;let m=(()=>{var g;for(let x of r){if(typeof x=="string")return x.trim();if(typeof x=="object"&&"current"in x)return x.current?(g=x.current.textContent)==null?void 0:g.trim():o.current}})(),p=s.map(g=>g.trim());u.value(e,m,p),(d=n.current)==null||d.setAttribute(Hs,m),o.current=m}),o}var bD=()=>{let[e,n]=b.useState(),r=Vs(()=>new Map);return Pi(()=>{r.current.forEach(s=>s()),r.current=new Map},[e]),(s,o)=>{r.current.set(s,o),n({})}};function xD(e){let n=e.type;return typeof n=="function"?n(e.props):"render"in n?n.render(e.props):e}function hd({asChild:e,children:n},r){return e&&b.isValidElement(n)?b.cloneElement(xD(n),{ref:n.ref},r(n.props.children)):r(n)}var wD={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function Mt({...e}){return c.jsx(cd,{"data-slot":"dialog",...e})}function wr({...e}){return c.jsx(mS,{"data-slot":"dialog-trigger",...e})}function SD({...e}){return c.jsx(ud,{"data-slot":"dialog-portal",...e})}function Bu({...e}){return c.jsx(kl,{"data-slot":"dialog-close",...e})}function _D({className:e,...n}){return c.jsx(dd,{"data-slot":"dialog-overlay",className:oe("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...n})}function kt({className:e,children:n,showCloseButton:r=!0,...s}){return c.jsxs(SD,{"data-slot":"dialog-portal",children:[c.jsx(_D,{}),c.jsxs(fd,{"data-slot":"dialog-content",className:oe("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...s,children:[n,r&&c.jsxs(kl,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[c.jsx(up,{}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Lt({className:e,...n}){return c.jsx("div",{"data-slot":"dialog-header",className:oe("flex flex-col gap-2 text-center sm:text-left",e),...n})}function en({className:e,...n}){return c.jsx("div",{"data-slot":"dialog-footer",className:oe("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...n})}function Ut({className:e,...n}){return c.jsx(xp,{"data-slot":"dialog-title",className:oe("text-lg leading-none font-semibold",e),...n})}function um({className:e,...n}){return c.jsx(wp,{"data-slot":"dialog-description",className:oe("text-muted-foreground text-sm",e),...n})}function ED({className:e,...n}){return c.jsx(co,{"data-slot":"command",className:oe("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...n})}function CD({className:e,...n}){return c.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[c.jsx(io,{className:"size-4 shrink-0 opacity-50"}),c.jsx(co.Input,{"data-slot":"command-input",className:oe("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...n})]})}function jD({className:e,...n}){return c.jsx(co.List,{"data-slot":"command-list",className:oe("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...n})}function AD({...e}){return c.jsx(co.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function OD({className:e,...n}){return c.jsx(co.Group,{"data-slot":"command-group",className:oe("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...n})}function TD({className:e,...n}){return c.jsx(co.Item,{"data-slot":"command-item",className:oe("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...n})}const RD=["top","right","bottom","left"],ni=Math.min,Wn=Math.max,Fu=Math.round,gu=Math.floor,Ba=e=>({x:e,y:e}),ND={left:"right",right:"left",bottom:"top",top:"bottom"},DD={start:"end",end:"start"};function Km(e,n,r){return Wn(e,ni(n,r))}function Sr(e,n){return typeof e=="function"?e(n):e}function _r(e){return e.split("-")[0]}function uo(e){return e.split("-")[1]}function _p(e){return e==="x"?"y":"x"}function Ep(e){return e==="y"?"height":"width"}const zD=new Set(["top","bottom"]);function Ha(e){return zD.has(_r(e))?"y":"x"}function Cp(e){return _p(Ha(e))}function MD(e,n,r){r===void 0&&(r=!1);const s=uo(e),o=Cp(e),u=Ep(o);let d=o==="x"?s===(r?"end":"start")?"right":"left":s==="start"?"bottom":"top";return n.reference[u]>n.floating[u]&&(d=Zu(d)),[d,Zu(d)]}function kD(e){const n=Zu(e);return[qm(e),n,qm(n)]}function qm(e){return e.replace(/start|end/g,n=>DD[n])}const Zx=["left","right"],$x=["right","left"],LD=["top","bottom"],UD=["bottom","top"];function KD(e,n,r){switch(e){case"top":case"bottom":return r?n?$x:Zx:n?Zx:$x;case"left":case"right":return n?LD:UD;default:return[]}}function qD(e,n,r,s){const o=uo(e);let u=KD(_r(e),r==="start",s);return o&&(u=u.map(d=>d+"-"+o),n&&(u=u.concat(u.map(qm)))),u}function Zu(e){return e.replace(/left|right|bottom|top/g,n=>ND[n])}function PD(e){return{top:0,right:0,bottom:0,left:0,...e}}function SS(e){return typeof e!="number"?PD(e):{top:e,right:e,bottom:e,left:e}}function $u(e){const{x:n,y:r,width:s,height:o}=e;return{width:s,height:o,top:r,left:n,right:n+s,bottom:r+o,x:n,y:r}}function Gx(e,n,r){let{reference:s,floating:o}=e;const u=Ha(n),d=Cp(n),m=Ep(d),p=_r(n),g=u==="y",x=s.x+s.width/2-o.width/2,v=s.y+s.height/2-o.height/2,w=s[m]/2-o[m]/2;let E;switch(p){case"top":E={x,y:s.y-o.height};break;case"bottom":E={x,y:s.y+s.height};break;case"right":E={x:s.x+s.width,y:v};break;case"left":E={x:s.x-o.width,y:v};break;default:E={x:s.x,y:s.y}}switch(uo(n)){case"start":E[d]-=w*(r&&g?-1:1);break;case"end":E[d]+=w*(r&&g?-1:1);break}return E}const ID=async(e,n,r)=>{const{placement:s="bottom",strategy:o="absolute",middleware:u=[],platform:d}=r,m=u.filter(Boolean),p=await(d.isRTL==null?void 0:d.isRTL(n));let g=await d.getElementRects({reference:e,floating:n,strategy:o}),{x,y:v}=Gx(g,s,p),w=s,E={},A=0;for(let S=0;S({name:"arrow",options:e,async fn(n){const{x:r,y:s,placement:o,rects:u,platform:d,elements:m,middlewareData:p}=n,{element:g,padding:x=0}=Sr(e,n)||{};if(g==null)return{};const v=SS(x),w={x:r,y:s},E=Cp(o),A=Ep(E),S=await d.getDimensions(g),T=E==="y",z=T?"top":"left",R=T?"bottom":"right",O=T?"clientHeight":"clientWidth",j=u.reference[A]+u.reference[E]-w[E]-u.floating[A],N=w[E]-u.reference[E],B=await(d.getOffsetParent==null?void 0:d.getOffsetParent(g));let H=B?B[O]:0;(!H||!await(d.isElement==null?void 0:d.isElement(B)))&&(H=m.floating[O]||u.floating[A]);const $=j/2-N/2,ue=H/2-S[A]/2-1,ye=ni(v[z],ue),ge=ni(v[R],ue),re=ye,le=H-S[A]-ge,he=H/2-S[A]/2+$,ve=Km(re,he,le),C=!p.arrow&&uo(o)!=null&&he!==ve&&u.reference[A]/2-(hehe<=0)){var ge,re;const he=(((ge=u.flip)==null?void 0:ge.index)||0)+1,ve=H[he];if(ve&&(!(v==="alignment"?R!==Ha(ve):!1)||ye.every(K=>Ha(K.placement)===R?K.overflows[0]>0:!0)))return{data:{index:he,overflows:ye},reset:{placement:ve}};let C=(re=ye.filter(L=>L.overflows[0]<=0).sort((L,K)=>L.overflows[1]-K.overflows[1])[0])==null?void 0:re.placement;if(!C)switch(E){case"bestFit":{var le;const L=(le=ye.filter(K=>{if(B){const de=Ha(K.placement);return de===R||de==="y"}return!0}).map(K=>[K.placement,K.overflows.filter(de=>de>0).reduce((de,xe)=>de+xe,0)]).sort((K,de)=>K[1]-de[1])[0])==null?void 0:le[0];L&&(C=L);break}case"initialPlacement":C=m;break}if(o!==C)return{reset:{placement:C}}}return{}}}};function Xx(e,n){return{top:e.top-n.height,right:e.right-n.width,bottom:e.bottom-n.height,left:e.left-n.width}}function Yx(e){return RD.some(n=>e[n]>=0)}const BD=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(n){const{rects:r}=n,{strategy:s="referenceHidden",...o}=Sr(e,n);switch(s){case"referenceHidden":{const u=await Ol(n,{...o,elementContext:"reference"}),d=Xx(u,r.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:Yx(d)}}}case"escaped":{const u=await Ol(n,{...o,altBoundary:!0}),d=Xx(u,r.floating);return{data:{escapedOffsets:d,escaped:Yx(d)}}}default:return{}}}}},_S=new Set(["left","top"]);async function FD(e,n){const{placement:r,platform:s,elements:o}=e,u=await(s.isRTL==null?void 0:s.isRTL(o.floating)),d=_r(r),m=uo(r),p=Ha(r)==="y",g=_S.has(d)?-1:1,x=u&&p?-1:1,v=Sr(n,e);let{mainAxis:w,crossAxis:E,alignmentAxis:A}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return m&&typeof A=="number"&&(E=m==="end"?A*-1:A),p?{x:E*x,y:w*g}:{x:w*g,y:E*x}}const ZD=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(n){var r,s;const{x:o,y:u,placement:d,middlewareData:m}=n,p=await FD(n,e);return d===((r=m.offset)==null?void 0:r.placement)&&(s=m.arrow)!=null&&s.alignmentOffset?{}:{x:o+p.x,y:u+p.y,data:{...p,placement:d}}}}},$D=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(n){const{x:r,y:s,placement:o}=n,{mainAxis:u=!0,crossAxis:d=!1,limiter:m={fn:T=>{let{x:z,y:R}=T;return{x:z,y:R}}},...p}=Sr(e,n),g={x:r,y:s},x=await Ol(n,p),v=Ha(_r(o)),w=_p(v);let E=g[w],A=g[v];if(u){const T=w==="y"?"top":"left",z=w==="y"?"bottom":"right",R=E+x[T],O=E-x[z];E=Km(R,E,O)}if(d){const T=v==="y"?"top":"left",z=v==="y"?"bottom":"right",R=A+x[T],O=A-x[z];A=Km(R,A,O)}const S=m.fn({...n,[w]:E,[v]:A});return{...S,data:{x:S.x-r,y:S.y-s,enabled:{[w]:u,[v]:d}}}}}},GD=function(e){return e===void 0&&(e={}),{options:e,fn(n){const{x:r,y:s,placement:o,rects:u,middlewareData:d}=n,{offset:m=0,mainAxis:p=!0,crossAxis:g=!0}=Sr(e,n),x={x:r,y:s},v=Ha(o),w=_p(v);let E=x[w],A=x[v];const S=Sr(m,n),T=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(p){const O=w==="y"?"height":"width",j=u.reference[w]-u.floating[O]+T.mainAxis,N=u.reference[w]+u.reference[O]-T.mainAxis;EN&&(E=N)}if(g){var z,R;const O=w==="y"?"width":"height",j=_S.has(_r(o)),N=u.reference[v]-u.floating[O]+(j&&((z=d.offset)==null?void 0:z[v])||0)+(j?0:T.crossAxis),B=u.reference[v]+u.reference[O]+(j?0:((R=d.offset)==null?void 0:R[v])||0)-(j?T.crossAxis:0);AB&&(A=B)}return{[w]:E,[v]:A}}}},XD=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(n){var r,s;const{placement:o,rects:u,platform:d,elements:m}=n,{apply:p=()=>{},...g}=Sr(e,n),x=await Ol(n,g),v=_r(o),w=uo(o),E=Ha(o)==="y",{width:A,height:S}=u.floating;let T,z;v==="top"||v==="bottom"?(T=v,z=w===(await(d.isRTL==null?void 0:d.isRTL(m.floating))?"start":"end")?"left":"right"):(z=v,T=w==="end"?"top":"bottom");const R=S-x.top-x.bottom,O=A-x.left-x.right,j=ni(S-x[T],R),N=ni(A-x[z],O),B=!n.middlewareData.shift;let H=j,$=N;if((r=n.middlewareData.shift)!=null&&r.enabled.x&&($=O),(s=n.middlewareData.shift)!=null&&s.enabled.y&&(H=R),B&&!w){const ye=Wn(x.left,0),ge=Wn(x.right,0),re=Wn(x.top,0),le=Wn(x.bottom,0);E?$=A-2*(ye!==0||ge!==0?ye+ge:Wn(x.left,x.right)):H=S-2*(re!==0||le!==0?re+le:Wn(x.top,x.bottom))}await p({...n,availableWidth:$,availableHeight:H});const ue=await d.getDimensions(m.floating);return A!==ue.width||S!==ue.height?{reset:{rects:!0}}:{}}}};function md(){return typeof window<"u"}function fo(e){return ES(e)?(e.nodeName||"").toLowerCase():"#document"}function ta(e){var n;return(e==null||(n=e.ownerDocument)==null?void 0:n.defaultView)||window}function Ja(e){var n;return(n=(ES(e)?e.ownerDocument:e.document)||window.document)==null?void 0:n.documentElement}function ES(e){return md()?e instanceof Node||e instanceof ta(e).Node:!1}function Oa(e){return md()?e instanceof Element||e instanceof ta(e).Element:!1}function Fa(e){return md()?e instanceof HTMLElement||e instanceof ta(e).HTMLElement:!1}function Qx(e){return!md()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ta(e).ShadowRoot}const YD=new Set(["inline","contents"]);function Ul(e){const{overflow:n,overflowX:r,overflowY:s,display:o}=Ta(e);return/auto|scroll|overlay|hidden|clip/.test(n+s+r)&&!YD.has(o)}const QD=new Set(["table","td","th"]);function JD(e){return QD.has(fo(e))}const WD=[":popover-open",":modal"];function pd(e){return WD.some(n=>{try{return e.matches(n)}catch{return!1}})}const ez=["transform","translate","scale","rotate","perspective"],tz=["transform","translate","scale","rotate","perspective","filter"],nz=["paint","layout","strict","content"];function jp(e){const n=Ap(),r=Oa(e)?Ta(e):e;return ez.some(s=>r[s]?r[s]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!n&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!n&&(r.filter?r.filter!=="none":!1)||tz.some(s=>(r.willChange||"").includes(s))||nz.some(s=>(r.contain||"").includes(s))}function az(e){let n=ai(e);for(;Fa(n)&&!Ws(n);){if(jp(n))return n;if(pd(n))return null;n=ai(n)}return null}function Ap(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const rz=new Set(["html","body","#document"]);function Ws(e){return rz.has(fo(e))}function Ta(e){return ta(e).getComputedStyle(e)}function gd(e){return Oa(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ai(e){if(fo(e)==="html")return e;const n=e.assignedSlot||e.parentNode||Qx(e)&&e.host||Ja(e);return Qx(n)?n.host:n}function CS(e){const n=ai(e);return Ws(n)?e.ownerDocument?e.ownerDocument.body:e.body:Fa(n)&&Ul(n)?n:CS(n)}function Tl(e,n,r){var s;n===void 0&&(n=[]),r===void 0&&(r=!0);const o=CS(e),u=o===((s=e.ownerDocument)==null?void 0:s.body),d=ta(o);if(u){const m=Pm(d);return n.concat(d,d.visualViewport||[],Ul(o)?o:[],m&&r?Tl(m):[])}return n.concat(o,Tl(o,[],r))}function Pm(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function jS(e){const n=Ta(e);let r=parseFloat(n.width)||0,s=parseFloat(n.height)||0;const o=Fa(e),u=o?e.offsetWidth:r,d=o?e.offsetHeight:s,m=Fu(r)!==u||Fu(s)!==d;return m&&(r=u,s=d),{width:r,height:s,$:m}}function Op(e){return Oa(e)?e:e.contextElement}function Gs(e){const n=Op(e);if(!Fa(n))return Ba(1);const r=n.getBoundingClientRect(),{width:s,height:o,$:u}=jS(n);let d=(u?Fu(r.width):r.width)/s,m=(u?Fu(r.height):r.height)/o;return(!d||!Number.isFinite(d))&&(d=1),(!m||!Number.isFinite(m))&&(m=1),{x:d,y:m}}const iz=Ba(0);function AS(e){const n=ta(e);return!Ap()||!n.visualViewport?iz:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function sz(e,n,r){return n===void 0&&(n=!1),!r||n&&r!==ta(e)?!1:n}function Ii(e,n,r,s){n===void 0&&(n=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),u=Op(e);let d=Ba(1);n&&(s?Oa(s)&&(d=Gs(s)):d=Gs(e));const m=sz(u,r,s)?AS(u):Ba(0);let p=(o.left+m.x)/d.x,g=(o.top+m.y)/d.y,x=o.width/d.x,v=o.height/d.y;if(u){const w=ta(u),E=s&&Oa(s)?ta(s):s;let A=w,S=Pm(A);for(;S&&s&&E!==A;){const T=Gs(S),z=S.getBoundingClientRect(),R=Ta(S),O=z.left+(S.clientLeft+parseFloat(R.paddingLeft))*T.x,j=z.top+(S.clientTop+parseFloat(R.paddingTop))*T.y;p*=T.x,g*=T.y,x*=T.x,v*=T.y,p+=O,g+=j,A=ta(S),S=Pm(A)}}return $u({width:x,height:v,x:p,y:g})}function vd(e,n){const r=gd(e).scrollLeft;return n?n.left+r:Ii(Ja(e)).left+r}function OS(e,n){const r=e.getBoundingClientRect(),s=r.left+n.scrollLeft-vd(e,r),o=r.top+n.scrollTop;return{x:s,y:o}}function oz(e){let{elements:n,rect:r,offsetParent:s,strategy:o}=e;const u=o==="fixed",d=Ja(s),m=n?pd(n.floating):!1;if(s===d||m&&u)return r;let p={scrollLeft:0,scrollTop:0},g=Ba(1);const x=Ba(0),v=Fa(s);if((v||!v&&!u)&&((fo(s)!=="body"||Ul(d))&&(p=gd(s)),Fa(s))){const E=Ii(s);g=Gs(s),x.x=E.x+s.clientLeft,x.y=E.y+s.clientTop}const w=d&&!v&&!u?OS(d,p):Ba(0);return{width:r.width*g.x,height:r.height*g.y,x:r.x*g.x-p.scrollLeft*g.x+x.x+w.x,y:r.y*g.y-p.scrollTop*g.y+x.y+w.y}}function lz(e){return Array.from(e.getClientRects())}function cz(e){const n=Ja(e),r=gd(e),s=e.ownerDocument.body,o=Wn(n.scrollWidth,n.clientWidth,s.scrollWidth,s.clientWidth),u=Wn(n.scrollHeight,n.clientHeight,s.scrollHeight,s.clientHeight);let d=-r.scrollLeft+vd(e);const m=-r.scrollTop;return Ta(s).direction==="rtl"&&(d+=Wn(n.clientWidth,s.clientWidth)-o),{width:o,height:u,x:d,y:m}}const Jx=25;function uz(e,n){const r=ta(e),s=Ja(e),o=r.visualViewport;let u=s.clientWidth,d=s.clientHeight,m=0,p=0;if(o){u=o.width,d=o.height;const x=Ap();(!x||x&&n==="fixed")&&(m=o.offsetLeft,p=o.offsetTop)}const g=vd(s);if(g<=0){const x=s.ownerDocument,v=x.body,w=getComputedStyle(v),E=x.compatMode==="CSS1Compat"&&parseFloat(w.marginLeft)+parseFloat(w.marginRight)||0,A=Math.abs(s.clientWidth-v.clientWidth-E);A<=Jx&&(u-=A)}else g<=Jx&&(u+=g);return{width:u,height:d,x:m,y:p}}const dz=new Set(["absolute","fixed"]);function fz(e,n){const r=Ii(e,!0,n==="fixed"),s=r.top+e.clientTop,o=r.left+e.clientLeft,u=Fa(e)?Gs(e):Ba(1),d=e.clientWidth*u.x,m=e.clientHeight*u.y,p=o*u.x,g=s*u.y;return{width:d,height:m,x:p,y:g}}function Wx(e,n,r){let s;if(n==="viewport")s=uz(e,r);else if(n==="document")s=cz(Ja(e));else if(Oa(n))s=fz(n,r);else{const o=AS(e);s={x:n.x-o.x,y:n.y-o.y,width:n.width,height:n.height}}return $u(s)}function TS(e,n){const r=ai(e);return r===n||!Oa(r)||Ws(r)?!1:Ta(r).position==="fixed"||TS(r,n)}function hz(e,n){const r=n.get(e);if(r)return r;let s=Tl(e,[],!1).filter(m=>Oa(m)&&fo(m)!=="body"),o=null;const u=Ta(e).position==="fixed";let d=u?ai(e):e;for(;Oa(d)&&!Ws(d);){const m=Ta(d),p=jp(d);!p&&m.position==="fixed"&&(o=null),(u?!p&&!o:!p&&m.position==="static"&&!!o&&dz.has(o.position)||Ul(d)&&!p&&TS(e,d))?s=s.filter(x=>x!==d):o=m,d=ai(d)}return n.set(e,s),s}function mz(e){let{element:n,boundary:r,rootBoundary:s,strategy:o}=e;const d=[...r==="clippingAncestors"?pd(n)?[]:hz(n,this._c):[].concat(r),s],m=d[0],p=d.reduce((g,x)=>{const v=Wx(n,x,o);return g.top=Wn(v.top,g.top),g.right=ni(v.right,g.right),g.bottom=ni(v.bottom,g.bottom),g.left=Wn(v.left,g.left),g},Wx(n,m,o));return{width:p.right-p.left,height:p.bottom-p.top,x:p.left,y:p.top}}function pz(e){const{width:n,height:r}=jS(e);return{width:n,height:r}}function gz(e,n,r){const s=Fa(n),o=Ja(n),u=r==="fixed",d=Ii(e,!0,u,n);let m={scrollLeft:0,scrollTop:0};const p=Ba(0);function g(){p.x=vd(o)}if(s||!s&&!u)if((fo(n)!=="body"||Ul(o))&&(m=gd(n)),s){const E=Ii(n,!0,u,n);p.x=E.x+n.clientLeft,p.y=E.y+n.clientTop}else o&&g();u&&!s&&o&&g();const x=o&&!s&&!u?OS(o,m):Ba(0),v=d.left+m.scrollLeft-p.x-x.x,w=d.top+m.scrollTop-p.y-x.y;return{x:v,y:w,width:d.width,height:d.height}}function dm(e){return Ta(e).position==="static"}function e0(e,n){if(!Fa(e)||Ta(e).position==="fixed")return null;if(n)return n(e);let r=e.offsetParent;return Ja(e)===r&&(r=r.ownerDocument.body),r}function RS(e,n){const r=ta(e);if(pd(e))return r;if(!Fa(e)){let o=ai(e);for(;o&&!Ws(o);){if(Oa(o)&&!dm(o))return o;o=ai(o)}return r}let s=e0(e,n);for(;s&&JD(s)&&dm(s);)s=e0(s,n);return s&&Ws(s)&&dm(s)&&!jp(s)?r:s||az(e)||r}const vz=async function(e){const n=this.getOffsetParent||RS,r=this.getDimensions,s=await r(e.floating);return{reference:gz(e.reference,await n(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function yz(e){return Ta(e).direction==="rtl"}const bz={convertOffsetParentRelativeRectToViewportRelativeRect:oz,getDocumentElement:Ja,getClippingRect:mz,getOffsetParent:RS,getElementRects:vz,getClientRects:lz,getDimensions:pz,getScale:Gs,isElement:Oa,isRTL:yz};function NS(e,n){return e.x===n.x&&e.y===n.y&&e.width===n.width&&e.height===n.height}function xz(e,n){let r=null,s;const o=Ja(e);function u(){var m;clearTimeout(s),(m=r)==null||m.disconnect(),r=null}function d(m,p){m===void 0&&(m=!1),p===void 0&&(p=1),u();const g=e.getBoundingClientRect(),{left:x,top:v,width:w,height:E}=g;if(m||n(),!w||!E)return;const A=gu(v),S=gu(o.clientWidth-(x+w)),T=gu(o.clientHeight-(v+E)),z=gu(x),O={rootMargin:-A+"px "+-S+"px "+-T+"px "+-z+"px",threshold:Wn(0,ni(1,p))||1};let j=!0;function N(B){const H=B[0].intersectionRatio;if(H!==p){if(!j)return d();H?d(!1,H):s=setTimeout(()=>{d(!1,1e-7)},1e3)}H===1&&!NS(g,e.getBoundingClientRect())&&d(),j=!1}try{r=new IntersectionObserver(N,{...O,root:o.ownerDocument})}catch{r=new IntersectionObserver(N,O)}r.observe(e)}return d(!0),u}function wz(e,n,r,s){s===void 0&&(s={});const{ancestorScroll:o=!0,ancestorResize:u=!0,elementResize:d=typeof ResizeObserver=="function",layoutShift:m=typeof IntersectionObserver=="function",animationFrame:p=!1}=s,g=Op(e),x=o||u?[...g?Tl(g):[],...Tl(n)]:[];x.forEach(z=>{o&&z.addEventListener("scroll",r,{passive:!0}),u&&z.addEventListener("resize",r)});const v=g&&m?xz(g,r):null;let w=-1,E=null;d&&(E=new ResizeObserver(z=>{let[R]=z;R&&R.target===g&&E&&(E.unobserve(n),cancelAnimationFrame(w),w=requestAnimationFrame(()=>{var O;(O=E)==null||O.observe(n)})),r()}),g&&!p&&E.observe(g),E.observe(n));let A,S=p?Ii(e):null;p&&T();function T(){const z=Ii(e);S&&!NS(S,z)&&r(),S=z,A=requestAnimationFrame(T)}return r(),()=>{var z;x.forEach(R=>{o&&R.removeEventListener("scroll",r),u&&R.removeEventListener("resize",r)}),v?.(),(z=E)==null||z.disconnect(),E=null,p&&cancelAnimationFrame(A)}}const Sz=ZD,_z=$D,Ez=VD,Cz=XD,jz=BD,t0=HD,Az=GD,Oz=(e,n,r)=>{const s=new Map,o={platform:bz,...r},u={...o.platform,_c:s};return ID(e,n,{...o,platform:u})};var Tz=typeof document<"u",Rz=function(){},ku=Tz?b.useLayoutEffect:Rz;function Gu(e,n){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(typeof e=="function"&&e.toString()===n.toString())return!0;let r,s,o;if(e&&n&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==n.length)return!1;for(s=r;s--!==0;)if(!Gu(e[s],n[s]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(n).length)return!1;for(s=r;s--!==0;)if(!{}.hasOwnProperty.call(n,o[s]))return!1;for(s=r;s--!==0;){const u=o[s];if(!(u==="_owner"&&e.$$typeof)&&!Gu(e[u],n[u]))return!1}return!0}return e!==e&&n!==n}function DS(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function n0(e,n){const r=DS(e);return Math.round(n*r)/r}function fm(e){const n=b.useRef(e);return ku(()=>{n.current=e}),n}function Nz(e){e===void 0&&(e={});const{placement:n="bottom",strategy:r="absolute",middleware:s=[],platform:o,elements:{reference:u,floating:d}={},transform:m=!0,whileElementsMounted:p,open:g}=e,[x,v]=b.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[w,E]=b.useState(s);Gu(w,s)||E(s);const[A,S]=b.useState(null),[T,z]=b.useState(null),R=b.useCallback(K=>{K!==B.current&&(B.current=K,S(K))},[]),O=b.useCallback(K=>{K!==H.current&&(H.current=K,z(K))},[]),j=u||A,N=d||T,B=b.useRef(null),H=b.useRef(null),$=b.useRef(x),ue=p!=null,ye=fm(p),ge=fm(o),re=fm(g),le=b.useCallback(()=>{if(!B.current||!H.current)return;const K={placement:n,strategy:r,middleware:w};ge.current&&(K.platform=ge.current),Oz(B.current,H.current,K).then(de=>{const xe={...de,isPositioned:re.current!==!1};he.current&&!Gu($.current,xe)&&($.current=xe,nd.flushSync(()=>{v(xe)}))})},[w,n,r,ge,re]);ku(()=>{g===!1&&$.current.isPositioned&&($.current.isPositioned=!1,v(K=>({...K,isPositioned:!1})))},[g]);const he=b.useRef(!1);ku(()=>(he.current=!0,()=>{he.current=!1}),[]),ku(()=>{if(j&&(B.current=j),N&&(H.current=N),j&&N){if(ye.current)return ye.current(j,N,le);le()}},[j,N,le,ye,ue]);const ve=b.useMemo(()=>({reference:B,floating:H,setReference:R,setFloating:O}),[R,O]),C=b.useMemo(()=>({reference:j,floating:N}),[j,N]),L=b.useMemo(()=>{const K={position:r,left:0,top:0};if(!C.floating)return K;const de=n0(C.floating,x.x),xe=n0(C.floating,x.y);return m?{...K,transform:"translate("+de+"px, "+xe+"px)",...DS(C.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:de,top:xe}},[r,m,C.floating,x.x,x.y]);return b.useMemo(()=>({...x,update:le,refs:ve,elements:C,floatingStyles:L}),[x,le,ve,C,L])}const Dz=e=>{function n(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:s,padding:o}=typeof e=="function"?e(r):e;return s&&n(s)?s.current!=null?t0({element:s.current,padding:o}).fn(r):{}:s?t0({element:s,padding:o}).fn(r):{}}}},zz=(e,n)=>({...Sz(e),options:[e,n]}),Mz=(e,n)=>({..._z(e),options:[e,n]}),kz=(e,n)=>({...Az(e),options:[e,n]}),Lz=(e,n)=>({...Ez(e),options:[e,n]}),Uz=(e,n)=>({...Cz(e),options:[e,n]}),Kz=(e,n)=>({...jz(e),options:[e,n]}),qz=(e,n)=>({...Dz(e),options:[e,n]});var Pz="Arrow",zS=b.forwardRef((e,n)=>{const{children:r,width:s=10,height:o=5,...u}=e;return c.jsx(Fe.svg,{...u,ref:n,width:s,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});zS.displayName=Pz;var Iz=zS;function Hz(e){const[n,r]=b.useState(void 0);return tn(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const s=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const u=o[0];let d,m;if("borderBoxSize"in u){const p=u.borderBoxSize,g=Array.isArray(p)?p[0]:p;d=g.inlineSize,m=g.blockSize}else d=e.offsetWidth,m=e.offsetHeight;r({width:d,height:m})});return s.observe(e,{box:"border-box"}),()=>s.unobserve(e)}else r(void 0)},[e]),n}var Tp="Popper",[MS,ho]=ii(Tp),[Vz,kS]=MS(Tp),LS=e=>{const{__scopePopper:n,children:r}=e,[s,o]=b.useState(null);return c.jsx(Vz,{scope:n,anchor:s,onAnchorChange:o,children:r})};LS.displayName=Tp;var US="PopperAnchor",KS=b.forwardRef((e,n)=>{const{__scopePopper:r,virtualRef:s,...o}=e,u=kS(US,r),d=b.useRef(null),m=bt(n,d),p=b.useRef(null);return b.useEffect(()=>{const g=p.current;p.current=s?.current||d.current,g!==p.current&&u.onAnchorChange(p.current)}),s?null:c.jsx(Fe.div,{...o,ref:m})});KS.displayName=US;var Rp="PopperContent",[Bz,Fz]=MS(Rp),qS=b.forwardRef((e,n)=>{const{__scopePopper:r,side:s="bottom",sideOffset:o=0,align:u="center",alignOffset:d=0,arrowPadding:m=0,avoidCollisions:p=!0,collisionBoundary:g=[],collisionPadding:x=0,sticky:v="partial",hideWhenDetached:w=!1,updatePositionStrategy:E="optimized",onPlaced:A,...S}=e,T=kS(Rp,r),[z,R]=b.useState(null),O=bt(n,te=>R(te)),[j,N]=b.useState(null),B=Hz(j),H=B?.width??0,$=B?.height??0,ue=s+(u!=="center"?"-"+u:""),ye=typeof x=="number"?x:{top:0,right:0,bottom:0,left:0,...x},ge=Array.isArray(g)?g:[g],re=ge.length>0,le={padding:ye,boundary:ge.filter($z),altBoundary:re},{refs:he,floatingStyles:ve,placement:C,isPositioned:L,middlewareData:K}=Nz({strategy:"fixed",placement:ue,whileElementsMounted:(...te)=>wz(...te,{animationFrame:E==="always"}),elements:{reference:T.anchor},middleware:[zz({mainAxis:o+$,alignmentAxis:d}),p&&Mz({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?kz():void 0,...le}),p&&Lz({...le}),Uz({...le,apply:({elements:te,rects:pe,availableWidth:Te,availableHeight:Me})=>{const{width:Ge,height:Xe}=pe.reference,$t=te.floating.style;$t.setProperty("--radix-popper-available-width",`${Te}px`),$t.setProperty("--radix-popper-available-height",`${Me}px`),$t.setProperty("--radix-popper-anchor-width",`${Ge}px`),$t.setProperty("--radix-popper-anchor-height",`${Xe}px`)}}),j&&qz({element:j,padding:m}),Gz({arrowWidth:H,arrowHeight:$}),w&&Kz({strategy:"referenceHidden",...le})]}),[de,xe]=HS(C),ze=ei(A);tn(()=>{L&&ze?.()},[L,ze]);const Y=K.arrow?.x,X=K.arrow?.y,ae=K.arrow?.centerOffset!==0,[ne,_e]=b.useState();return tn(()=>{z&&_e(window.getComputedStyle(z).zIndex)},[z]),c.jsx("div",{ref:he.setFloating,"data-radix-popper-content-wrapper":"",style:{...ve,transform:L?ve.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ne,"--radix-popper-transform-origin":[K.transformOrigin?.x,K.transformOrigin?.y].join(" "),...K.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(Bz,{scope:r,placedSide:de,onArrowChange:N,arrowX:Y,arrowY:X,shouldHideArrow:ae,children:c.jsx(Fe.div,{"data-side":de,"data-align":xe,...S,ref:O,style:{...S.style,animation:L?void 0:"none"}})})})});qS.displayName=Rp;var PS="PopperArrow",Zz={top:"bottom",right:"left",bottom:"top",left:"right"},IS=b.forwardRef(function(n,r){const{__scopePopper:s,...o}=n,u=Fz(PS,s),d=Zz[u.placedSide];return c.jsx("span",{ref:u.onArrowChange,style:{position:"absolute",left:u.arrowX,top:u.arrowY,[d]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[u.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[u.placedSide],visibility:u.shouldHideArrow?"hidden":void 0},children:c.jsx(Iz,{...o,ref:r,style:{...o.style,display:"block"}})})});IS.displayName=PS;function $z(e){return e!==null}var Gz=e=>({name:"transformOrigin",options:e,fn(n){const{placement:r,rects:s,middlewareData:o}=n,d=o.arrow?.centerOffset!==0,m=d?0:e.arrowWidth,p=d?0:e.arrowHeight,[g,x]=HS(r),v={start:"0%",center:"50%",end:"100%"}[x],w=(o.arrow?.x??0)+m/2,E=(o.arrow?.y??0)+p/2;let A="",S="";return g==="bottom"?(A=d?v:`${w}px`,S=`${-p}px`):g==="top"?(A=d?v:`${w}px`,S=`${s.floating.height+p}px`):g==="right"?(A=`${-p}px`,S=d?v:`${E}px`):g==="left"&&(A=`${s.floating.width+p}px`,S=d?v:`${E}px`),{data:{x:A,y:S}}}});function HS(e){const[n,r="center"]=e.split("-");return[n,r]}var Np=LS,yd=KS,Dp=qS,zp=IS,bd="Popover",[VS]=ii(bd,[ho]),Kl=ho(),[Xz,oi]=VS(bd),BS=e=>{const{__scopePopover:n,children:r,open:s,defaultOpen:o,onOpenChange:u,modal:d=!1}=e,m=Kl(n),p=b.useRef(null),[g,x]=b.useState(!1),[v,w]=Al({prop:s,defaultProp:o??!1,onChange:u,caller:bd});return c.jsx(Np,{...m,children:c.jsx(Xz,{scope:n,contentId:qn(),triggerRef:p,open:v,onOpenChange:w,onOpenToggle:b.useCallback(()=>w(E=>!E),[w]),hasCustomAnchor:g,onCustomAnchorAdd:b.useCallback(()=>x(!0),[]),onCustomAnchorRemove:b.useCallback(()=>x(!1),[]),modal:d,children:r})})};BS.displayName=bd;var FS="PopoverAnchor",Yz=b.forwardRef((e,n)=>{const{__scopePopover:r,...s}=e,o=oi(FS,r),u=Kl(r),{onCustomAnchorAdd:d,onCustomAnchorRemove:m}=o;return b.useEffect(()=>(d(),()=>m()),[d,m]),c.jsx(yd,{...u,...s,ref:n})});Yz.displayName=FS;var ZS="PopoverTrigger",$S=b.forwardRef((e,n)=>{const{__scopePopover:r,...s}=e,o=oi(ZS,r),u=Kl(r),d=bt(n,o.triggerRef),m=c.jsx(Fe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":JS(o.open),...s,ref:d,onClick:We(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?m:c.jsx(yd,{asChild:!0,...u,children:m})});$S.displayName=ZS;var Mp="PopoverPortal",[Qz,Jz]=VS(Mp,{forceMount:void 0}),GS=e=>{const{__scopePopover:n,forceMount:r,children:s,container:o}=e,u=oi(Mp,n);return c.jsx(Qz,{scope:n,forceMount:r,children:c.jsx(si,{present:r||u.open,children:c.jsx(Ml,{asChild:!0,container:o,children:s})})})};GS.displayName=Mp;var eo="PopoverContent",XS=b.forwardRef((e,n)=>{const r=Jz(eo,e.__scopePopover),{forceMount:s=r.forceMount,...o}=e,u=oi(eo,e.__scopePopover);return c.jsx(si,{present:s||u.open,children:u.modal?c.jsx(eM,{...o,ref:n}):c.jsx(tM,{...o,ref:n})})});XS.displayName=eo;var Wz=Ki("PopoverContent.RemoveScroll"),eM=b.forwardRef((e,n)=>{const r=oi(eo,e.__scopePopover),s=b.useRef(null),o=bt(n,s),u=b.useRef(!1);return b.useEffect(()=>{const d=s.current;if(d)return gp(d)},[]),c.jsx(od,{as:Wz,allowPinchZoom:!0,children:c.jsx(YS,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:We(e.onCloseAutoFocus,d=>{d.preventDefault(),u.current||r.triggerRef.current?.focus()}),onPointerDownOutside:We(e.onPointerDownOutside,d=>{const m=d.detail.originalEvent,p=m.button===0&&m.ctrlKey===!0,g=m.button===2||p;u.current=g},{checkForDefaultPrevented:!1}),onFocusOutside:We(e.onFocusOutside,d=>d.preventDefault(),{checkForDefaultPrevented:!1})})})}),tM=b.forwardRef((e,n)=>{const r=oi(eo,e.__scopePopover),s=b.useRef(!1),o=b.useRef(!1);return c.jsx(YS,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:u=>{e.onCloseAutoFocus?.(u),u.defaultPrevented||(s.current||r.triggerRef.current?.focus(),u.preventDefault()),s.current=!1,o.current=!1},onInteractOutside:u=>{e.onInteractOutside?.(u),u.defaultPrevented||(s.current=!0,u.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const d=u.target;r.triggerRef.current?.contains(d)&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&o.current&&u.preventDefault()}})}),YS=b.forwardRef((e,n)=>{const{__scopePopover:r,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:u,disableOutsidePointerEvents:d,onEscapeKeyDown:m,onPointerDownOutside:p,onFocusOutside:g,onInteractOutside:x,...v}=e,w=oi(eo,r),E=Kl(r);return pp(),c.jsx(id,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:o,onUnmountAutoFocus:u,children:c.jsx(zl,{asChild:!0,disableOutsidePointerEvents:d,onInteractOutside:x,onEscapeKeyDown:m,onPointerDownOutside:p,onFocusOutside:g,onDismiss:()=>w.onOpenChange(!1),children:c.jsx(Dp,{"data-state":JS(w.open),role:"dialog",id:w.contentId,...E,...v,ref:n,style:{...v.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),QS="PopoverClose",nM=b.forwardRef((e,n)=>{const{__scopePopover:r,...s}=e,o=oi(QS,r);return c.jsx(Fe.button,{type:"button",...s,ref:n,onClick:We(e.onClick,()=>o.onOpenChange(!1))})});nM.displayName=QS;var aM="PopoverArrow",rM=b.forwardRef((e,n)=>{const{__scopePopover:r,...s}=e,o=Kl(r);return c.jsx(zp,{...o,...s,ref:n})});rM.displayName=aM;function JS(e){return e?"open":"closed"}var iM=BS,sM=$S,oM=GS,lM=XS;function cM({...e}){return c.jsx(iM,{"data-slot":"popover",...e})}function uM({...e}){return c.jsx(sM,{"data-slot":"popover-trigger",...e})}function dM({className:e,align:n="center",sideOffset:r=4,...s}){return c.jsx(oM,{children:c.jsx(lM,{"data-slot":"popover-content",align:n,sideOffset:r,className:oe("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...s})})}const fM=({orgs:e})=>{const[n,r]=b.useState(!1),[s,o]=b.useState(Va.get()??"");b.useEffect(()=>Va.subscribe(d=>o(d??"")),[]);const u=e.find(d=>d.id===s);return c.jsxs(cM,{open:n,onOpenChange:r,children:[c.jsx(uM,{asChild:!0,children:c.jsxs(ce,{variant:"ghost",className:"h-9 w-full justify-between px-2","aria-label":"Switch organization",children:[c.jsxs("span",{className:"flex items-center gap-2 truncate",children:[c.jsx(mw,{className:"h-4 w-4"}),c.jsx("span",{className:"truncate",children:u?.name??"Select org"})]}),c.jsx(Sj,{className:"ml-2 h-4 w-4 opacity-50"})]})}),c.jsx(dM,{className:"w-[280px] p-0",align:"start",children:c.jsxs(ED,{children:[c.jsx(CD,{placeholder:"Search orgs..."}),c.jsxs(jD,{children:[c.jsx(AD,{children:"No orgs found."}),c.jsx(OD,{heading:"Organizations",children:e.map(d=>c.jsxs(TD,{value:d.id,onSelect:m=>{Va.set(m),r(!1)},children:[c.jsx(pw,{className:oe("mr-2 h-4 w-4",s===d.id?"opacity-100":"opacity-0")}),c.jsx("span",{className:"truncate",children:d.name})]},d.id))})]})]})})]})};function hM(){return Pn({queryKey:["me"],queryFn:()=>Ni.getMe(),staleTime:300*1e3})}var hm={exports:{}},mm={};var a0;function mM(){if(a0)return mm;a0=1;var e=J0();function n(v,w){return v===w&&(v!==0||1/v===1/w)||v!==v&&w!==w}var r=typeof Object.is=="function"?Object.is:n,s=e.useState,o=e.useEffect,u=e.useLayoutEffect,d=e.useDebugValue;function m(v,w){var E=w(),A=s({inst:{value:E,getSnapshot:w}}),S=A[0].inst,T=A[1];return u(function(){S.value=E,S.getSnapshot=w,p(S)&&T({inst:S})},[v,E,w]),o(function(){return p(S)&&T({inst:S}),v(function(){p(S)&&T({inst:S})})},[v]),d(E),E}function p(v){var w=v.getSnapshot;v=v.value;try{var E=w();return!r(v,E)}catch{return!0}}function g(v,w){return w()}var x=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?g:m;return mm.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:x,mm}var r0;function pM(){return r0||(r0=1,hm.exports=mM()),hm.exports}var gM=pM();function vM(){return gM.useSyncExternalStore(yM,()=>!0,()=>!1)}function yM(){return()=>{}}var kp="Avatar",[bM]=ii(kp),[xM,WS]=bM(kp),e1=b.forwardRef((e,n)=>{const{__scopeAvatar:r,...s}=e,[o,u]=b.useState("idle");return c.jsx(xM,{scope:r,imageLoadingStatus:o,onImageLoadingStatusChange:u,children:c.jsx(Fe.span,{...s,ref:n})})});e1.displayName=kp;var t1="AvatarImage",wM=b.forwardRef((e,n)=>{const{__scopeAvatar:r,src:s,onLoadingStatusChange:o=()=>{},...u}=e,d=WS(t1,r),m=SM(s,u),p=ei(g=>{o(g),d.onImageLoadingStatusChange(g)});return tn(()=>{m!=="idle"&&p(m)},[m,p]),m==="loaded"?c.jsx(Fe.img,{...u,ref:n,src:s}):null});wM.displayName=t1;var n1="AvatarFallback",a1=b.forwardRef((e,n)=>{const{__scopeAvatar:r,delayMs:s,...o}=e,u=WS(n1,r),[d,m]=b.useState(s===void 0);return b.useEffect(()=>{if(s!==void 0){const p=window.setTimeout(()=>m(!0),s);return()=>window.clearTimeout(p)}},[s]),d&&u.imageLoadingStatus!=="loaded"?c.jsx(Fe.span,{...o,ref:n}):null});a1.displayName=n1;function i0(e,n){return e?n?(e.src!==n&&(e.src=n),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function SM(e,{referrerPolicy:n,crossOrigin:r}){const s=vM(),o=b.useRef(null),u=s?(o.current||(o.current=new window.Image),o.current):null,[d,m]=b.useState(()=>i0(u,e));return tn(()=>{m(i0(u,e))},[u,e]),tn(()=>{const p=v=>()=>{m(v)};if(!u)return;const g=p("loaded"),x=p("error");return u.addEventListener("load",g),u.addEventListener("error",x),n&&(u.referrerPolicy=n),typeof r=="string"&&(u.crossOrigin=r),()=>{u.removeEventListener("load",g),u.removeEventListener("error",x)}},[u,r,n]),d}var _M=e1,EM=a1;function CM({className:e,...n}){return c.jsx(_M,{"data-slot":"avatar",className:oe("relative flex size-8 shrink-0 overflow-hidden rounded-full",e),...n})}function jM({className:e,...n}){return c.jsx(EM,{"data-slot":"avatar-fallback",className:oe("bg-muted flex size-full items-center justify-center rounded-full",e),...n})}function AM({...e}){return c.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function OM({className:e,...n}){return c.jsx("ol",{"data-slot":"breadcrumb-list",className:oe("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",e),...n})}function s0({className:e,...n}){return c.jsx("li",{"data-slot":"breadcrumb-item",className:oe("inline-flex items-center gap-1.5",e),...n})}function o0({asChild:e,className:n,...r}){const s=e?lo:"a";return c.jsx(s,{"data-slot":"breadcrumb-link",className:oe("hover:text-foreground transition-colors",n),...r})}function TM({className:e,...n}){return c.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:oe("text-foreground font-normal",e),...n})}function RM({children:e,className:n,...r}){return c.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:oe("[&>svg]:size-3.5",n),...r,children:e??c.jsx(yj,{})})}const pm=768;function NM(){const[e,n]=b.useState(void 0);return b.useEffect(()=>{const r=window.matchMedia(`(max-width: ${pm-1}px)`),s=()=>{n(window.innerWidthr.removeEventListener("change",s)},[]),!!e}function Ke({className:e,type:n,...r}){return c.jsx("input",{type:n,"data-slot":"input",className:oe("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...r})}var DM="Separator",l0="horizontal",zM=["horizontal","vertical"],r1=b.forwardRef((e,n)=>{const{decorative:r,orientation:s=l0,...o}=e,u=MM(s)?s:l0,m=r?{role:"none"}:{"aria-orientation":u==="vertical"?u:void 0,role:"separator"};return c.jsx(Fe.div,{"data-orientation":u,...m,...o,ref:n})});r1.displayName=DM;function MM(e){return zM.includes(e)}var kM=r1;function LM({className:e,orientation:n="horizontal",decorative:r=!0,...s}){return c.jsx(kM,{"data-slot":"separator",decorative:r,orientation:n,className:oe("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...s})}function UM({...e}){return c.jsx(cd,{"data-slot":"sheet",...e})}function KM({...e}){return c.jsx(ud,{"data-slot":"sheet-portal",...e})}function qM({className:e,...n}){return c.jsx(dd,{"data-slot":"sheet-overlay",className:oe("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...n})}function PM({className:e,children:n,side:r="right",...s}){return c.jsxs(KM,{children:[c.jsx(qM,{}),c.jsxs(fd,{"data-slot":"sheet-content",className:oe("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",r==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",r==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",r==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",r==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",e),...s,children:[n,c.jsxs(kl,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[c.jsx(up,{className:"size-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function IM({className:e,...n}){return c.jsx("div",{"data-slot":"sheet-header",className:oe("flex flex-col gap-1.5 p-4",e),...n})}function HM({className:e,...n}){return c.jsx(xp,{"data-slot":"sheet-title",className:oe("text-foreground font-semibold",e),...n})}function VM({className:e,...n}){return c.jsx(wp,{"data-slot":"sheet-description",className:oe("text-muted-foreground text-sm",e),...n})}var i1=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),BM="VisuallyHidden",s1=b.forwardRef((e,n)=>c.jsx(Fe.span,{...e,ref:n,style:{...i1,...e.style}}));s1.displayName=BM;var FM=s1,[xd]=ii("Tooltip",[ho]),wd=ho(),o1="TooltipProvider",ZM=700,Im="tooltip.open",[$M,Lp]=xd(o1),l1=e=>{const{__scopeTooltip:n,delayDuration:r=ZM,skipDelayDuration:s=300,disableHoverableContent:o=!1,children:u}=e,d=b.useRef(!0),m=b.useRef(!1),p=b.useRef(0);return b.useEffect(()=>{const g=p.current;return()=>window.clearTimeout(g)},[]),c.jsx($M,{scope:n,isOpenDelayedRef:d,delayDuration:r,onOpen:b.useCallback(()=>{window.clearTimeout(p.current),d.current=!1},[]),onClose:b.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>d.current=!0,s)},[s]),isPointerInTransitRef:m,onPointerInTransitChange:b.useCallback(g=>{m.current=g},[]),disableHoverableContent:o,children:u})};l1.displayName=o1;var Rl="Tooltip",[GM,ql]=xd(Rl),c1=e=>{const{__scopeTooltip:n,children:r,open:s,defaultOpen:o,onOpenChange:u,disableHoverableContent:d,delayDuration:m}=e,p=Lp(Rl,e.__scopeTooltip),g=wd(n),[x,v]=b.useState(null),w=qn(),E=b.useRef(0),A=d??p.disableHoverableContent,S=m??p.delayDuration,T=b.useRef(!1),[z,R]=Al({prop:s,defaultProp:o??!1,onChange:H=>{H?(p.onOpen(),document.dispatchEvent(new CustomEvent(Im))):p.onClose(),u?.(H)},caller:Rl}),O=b.useMemo(()=>z?T.current?"delayed-open":"instant-open":"closed",[z]),j=b.useCallback(()=>{window.clearTimeout(E.current),E.current=0,T.current=!1,R(!0)},[R]),N=b.useCallback(()=>{window.clearTimeout(E.current),E.current=0,R(!1)},[R]),B=b.useCallback(()=>{window.clearTimeout(E.current),E.current=window.setTimeout(()=>{T.current=!0,R(!0),E.current=0},S)},[S,R]);return b.useEffect(()=>()=>{E.current&&(window.clearTimeout(E.current),E.current=0)},[]),c.jsx(Np,{...g,children:c.jsx(GM,{scope:n,contentId:w,open:z,stateAttribute:O,trigger:x,onTriggerChange:v,onTriggerEnter:b.useCallback(()=>{p.isOpenDelayedRef.current?B():j()},[p.isOpenDelayedRef,B,j]),onTriggerLeave:b.useCallback(()=>{A?N():(window.clearTimeout(E.current),E.current=0)},[N,A]),onOpen:j,onClose:N,disableHoverableContent:A,children:r})})};c1.displayName=Rl;var Hm="TooltipTrigger",u1=b.forwardRef((e,n)=>{const{__scopeTooltip:r,...s}=e,o=ql(Hm,r),u=Lp(Hm,r),d=wd(r),m=b.useRef(null),p=bt(n,m,o.onTriggerChange),g=b.useRef(!1),x=b.useRef(!1),v=b.useCallback(()=>g.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),c.jsx(yd,{asChild:!0,...d,children:c.jsx(Fe.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...s,ref:p,onPointerMove:We(e.onPointerMove,w=>{w.pointerType!=="touch"&&!x.current&&!u.isPointerInTransitRef.current&&(o.onTriggerEnter(),x.current=!0)}),onPointerLeave:We(e.onPointerLeave,()=>{o.onTriggerLeave(),x.current=!1}),onPointerDown:We(e.onPointerDown,()=>{o.open&&o.onClose(),g.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:We(e.onFocus,()=>{g.current||o.onOpen()}),onBlur:We(e.onBlur,o.onClose),onClick:We(e.onClick,o.onClose)})})});u1.displayName=Hm;var Up="TooltipPortal",[XM,YM]=xd(Up,{forceMount:void 0}),d1=e=>{const{__scopeTooltip:n,forceMount:r,children:s,container:o}=e,u=ql(Up,n);return c.jsx(XM,{scope:n,forceMount:r,children:c.jsx(si,{present:r||u.open,children:c.jsx(Ml,{asChild:!0,container:o,children:s})})})};d1.displayName=Up;var to="TooltipContent",f1=b.forwardRef((e,n)=>{const r=YM(to,e.__scopeTooltip),{forceMount:s=r.forceMount,side:o="top",...u}=e,d=ql(to,e.__scopeTooltip);return c.jsx(si,{present:s||d.open,children:d.disableHoverableContent?c.jsx(h1,{side:o,...u,ref:n}):c.jsx(QM,{side:o,...u,ref:n})})}),QM=b.forwardRef((e,n)=>{const r=ql(to,e.__scopeTooltip),s=Lp(to,e.__scopeTooltip),o=b.useRef(null),u=bt(n,o),[d,m]=b.useState(null),{trigger:p,onClose:g}=r,x=o.current,{onPointerInTransitChange:v}=s,w=b.useCallback(()=>{m(null),v(!1)},[v]),E=b.useCallback((A,S)=>{const T=A.currentTarget,z={x:A.clientX,y:A.clientY},R=t4(z,T.getBoundingClientRect()),O=n4(z,R),j=a4(S.getBoundingClientRect()),N=i4([...O,...j]);m(N),v(!0)},[v]);return b.useEffect(()=>()=>w(),[w]),b.useEffect(()=>{if(p&&x){const A=T=>E(T,x),S=T=>E(T,p);return p.addEventListener("pointerleave",A),x.addEventListener("pointerleave",S),()=>{p.removeEventListener("pointerleave",A),x.removeEventListener("pointerleave",S)}}},[p,x,E,w]),b.useEffect(()=>{if(d){const A=S=>{const T=S.target,z={x:S.clientX,y:S.clientY},R=p?.contains(T)||x?.contains(T),O=!r4(z,d);R?w():O&&(w(),g())};return document.addEventListener("pointermove",A),()=>document.removeEventListener("pointermove",A)}},[p,x,d,g,w]),c.jsx(h1,{...e,ref:u})}),[JM,WM]=xd(Rl,{isInside:!1}),e4=Kw("TooltipContent"),h1=b.forwardRef((e,n)=>{const{__scopeTooltip:r,children:s,"aria-label":o,onEscapeKeyDown:u,onPointerDownOutside:d,...m}=e,p=ql(to,r),g=wd(r),{onClose:x}=p;return b.useEffect(()=>(document.addEventListener(Im,x),()=>document.removeEventListener(Im,x)),[x]),b.useEffect(()=>{if(p.trigger){const v=w=>{w.target?.contains(p.trigger)&&x()};return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[p.trigger,x]),c.jsx(zl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:v=>v.preventDefault(),onDismiss:x,children:c.jsxs(Dp,{"data-state":p.stateAttribute,...g,...m,ref:n,style:{...m.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[c.jsx(e4,{children:s}),c.jsx(JM,{scope:r,isInside:!0,children:c.jsx(FM,{id:p.contentId,role:"tooltip",children:o||s})})]})})});f1.displayName=to;var m1="TooltipArrow",p1=b.forwardRef((e,n)=>{const{__scopeTooltip:r,...s}=e,o=wd(r);return WM(m1,r).isInside?null:c.jsx(zp,{...o,...s,ref:n})});p1.displayName=m1;function t4(e,n){const r=Math.abs(n.top-e.y),s=Math.abs(n.bottom-e.y),o=Math.abs(n.right-e.x),u=Math.abs(n.left-e.x);switch(Math.min(r,s,o,u)){case u:return"left";case o:return"right";case r:return"top";case s:return"bottom";default:throw new Error("unreachable")}}function n4(e,n,r=5){const s=[];switch(n){case"top":s.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":s.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":s.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":s.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return s}function a4(e){const{top:n,right:r,bottom:s,left:o}=e;return[{x:o,y:n},{x:r,y:n},{x:r,y:s},{x:o,y:s}]}function r4(e,n){const{x:r,y:s}=e;let o=!1;for(let u=0,d=n.length-1;us!=w>s&&r<(v-g)*(s-x)/(w-x)+g&&(o=!o)}return o}function i4(e){const n=e.slice();return n.sort((r,s)=>r.xs.x?1:r.ys.y?1:0),s4(n)}function s4(e){if(e.length<=1)return e.slice();const n=[];for(let s=0;s=2;){const u=n[n.length-1],d=n[n.length-2];if((u.x-d.x)*(o.y-d.y)>=(u.y-d.y)*(o.x-d.x))n.pop();else break}n.push(o)}n.pop();const r=[];for(let s=e.length-1;s>=0;s--){const o=e[s];for(;r.length>=2;){const u=r[r.length-1],d=r[r.length-2];if((u.x-d.x)*(o.y-d.y)>=(u.y-d.y)*(o.x-d.x))r.pop();else break}r.push(o)}return r.pop(),n.length===1&&r.length===1&&n[0].x===r[0].x&&n[0].y===r[0].y?n:n.concat(r)}var o4=l1,l4=c1,c4=u1,u4=d1,d4=f1,f4=p1;function Sd({delayDuration:e=0,...n}){return c.jsx(o4,{"data-slot":"tooltip-provider",delayDuration:e,...n})}function g1({...e}){return c.jsx(Sd,{children:c.jsx(l4,{"data-slot":"tooltip",...e})})}function v1({...e}){return c.jsx(c4,{"data-slot":"tooltip-trigger",...e})}function y1({className:e,sideOffset:n=0,children:r,...s}){return c.jsx(u4,{children:c.jsxs(d4,{"data-slot":"tooltip-content",sideOffset:n,className:oe("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...s,children:[r,c.jsx(f4,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const h4="sidebar_state",m4=3600*24*7,p4="16rem",g4="18rem",v4="3rem",y4="b",b1=b.createContext(null);function Kp(){const e=b.useContext(b1);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function b4({defaultOpen:e=!0,open:n,onOpenChange:r,className:s,style:o,children:u,...d}){const m=NM(),[p,g]=b.useState(!1),[x,v]=b.useState(e),w=n??x,E=b.useCallback(z=>{const R=typeof z=="function"?z(w):z;r?r(R):v(R),document.cookie=`${h4}=${R}; path=/; max-age=${m4}`},[r,w]),A=b.useCallback(()=>m?g(z=>!z):E(z=>!z),[m,E,g]);b.useEffect(()=>{const z=R=>{R.key===y4&&(R.metaKey||R.ctrlKey)&&(R.preventDefault(),A())};return window.addEventListener("keydown",z),()=>window.removeEventListener("keydown",z)},[A]);const S=w?"expanded":"collapsed",T=b.useMemo(()=>({state:S,open:w,setOpen:E,isMobile:m,openMobile:p,setOpenMobile:g,toggleSidebar:A}),[S,w,E,m,p,g,A]);return c.jsx(b1.Provider,{value:T,children:c.jsx(Sd,{delayDuration:0,children:c.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":p4,"--sidebar-width-icon":v4,...o},className:oe("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",s),...d,children:u})})})}function x4({side:e="left",variant:n="sidebar",collapsible:r="offcanvas",className:s,children:o,...u}){const{isMobile:d,state:m,openMobile:p,setOpenMobile:g}=Kp();return r==="none"?c.jsx("div",{"data-slot":"sidebar",className:oe("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",s),...u,children:o}):d?c.jsx(UM,{open:p,onOpenChange:g,...u,children:c.jsxs(PM,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":g4},side:e,children:[c.jsxs(IM,{className:"sr-only",children:[c.jsx(HM,{children:"Sidebar"}),c.jsx(VM,{children:"Displays the mobile sidebar."})]}),c.jsx("div",{className:"flex h-full w-full flex-col",children:o})]})}):c.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":m,"data-collapsible":m==="collapsed"?r:"","data-variant":n,"data-side":e,"data-slot":"sidebar",children:[c.jsx("div",{"data-slot":"sidebar-gap",className:oe("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",n==="floating"||n==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),c.jsx("div",{"data-slot":"sidebar-container",className:oe("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",n==="floating"||n==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",s),...u,children:c.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:o})})]})}function w4({className:e,onClick:n,...r}){const{toggleSidebar:s}=Kp();return c.jsxs(ce,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:oe("size-7",e),onClick:o=>{n?.(o),s()},...r,children:[c.jsx(Hj,{}),c.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function S4({className:e,...n}){return c.jsx("main",{"data-slot":"sidebar-inset",className:oe("bg-background relative flex w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",e),...n})}function _4({className:e,...n}){return c.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:oe("flex flex-col gap-2 p-2",e),...n})}function E4({className:e,...n}){return c.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:oe("flex flex-col gap-2 p-2",e),...n})}function C4({className:e,...n}){return c.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:oe("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...n})}function vu({className:e,...n}){return c.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:oe("relative flex w-full min-w-0 flex-col p-2",e),...n})}function yu({className:e,asChild:n=!1,...r}){const s=n?lo:"div";return c.jsx(s,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:oe("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...r})}function bu({className:e,...n}){return c.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:oe("w-full text-sm",e),...n})}function xu({className:e,...n}){return c.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:oe("flex w-full min-w-0 flex-col gap-1",e),...n})}function wu({className:e,...n}){return c.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:oe("group/menu-item relative",e),...n})}const j4=hp("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Su({asChild:e=!1,isActive:n=!1,variant:r="default",size:s="default",tooltip:o,className:u,...d}){const m=e?lo:"button",{isMobile:p,state:g}=Kp(),x=c.jsx(m,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":s,"data-active":n,className:oe(j4({variant:r,size:s}),u),...d});return o?(typeof o=="string"&&(o={children:o}),c.jsxs(g1,{children:[c.jsx(v1,{asChild:!0,children:x}),c.jsx(y1,{side:"right",align:"center",hidden:g!=="collapsed"||p,...o})]})):x}const A4=()=>{const e=np(),{data:n,isLoading:r}=hM(),s=b.useMemo(()=>{const u=e.pathname.split("/").filter(Boolean),d=[];let m="";for(const p of u)m+=`/${p}`,d.push({to:m,label:p});return d},[e.pathname]),o=b.useMemo(()=>{if(!n)return"U";const d=(n.display_name||n.primary_email||"").trim().split(/\s+/);return d.length>=2?(d[0][0]+d[1][0]).toUpperCase():d.length===1&&d[0]?d[0][0].toUpperCase():"U"},[n]);return c.jsxs("div",{className:"flex h-12 items-center gap-2 border-b px-3",children:[c.jsx(w4,{}),c.jsx("div",{className:"flex-1",children:c.jsx(AM,{children:c.jsxs(OM,{children:[c.jsx(s0,{children:c.jsx(o0,{asChild:!0,children:c.jsx(Fh,{to:"/",children:"Home"})})}),s.map((u,d)=>c.jsxs("span",{className:"flex items-center",children:[c.jsx(RM,{}),c.jsx(s0,{children:d===s.length-1?c.jsx(TM,{className:"capitalize",children:u.label}):c.jsx(o0,{asChild:!0,children:c.jsx(Fh,{to:u.to,className:"capitalize",children:u.label})})})]},u.to))]})})}),c.jsx(ce,{variant:"ghost",size:"sm",asChild:!0,children:c.jsx(Fh,{to:"/me",children:r?"…":n?.display_name||"Profile"})}),c.jsx(CM,{className:"h-7 w-7",children:c.jsx(jM,{children:o})})]})};async function O4(){const e=yn.get();if(!e?.refresh_token){yn.logout();return}try{const n={refresh_token:e.refresh_token};await wT().logout({body:n})}catch(n){console.warn("Logout API failed; clearing local state anyway",n)}finally{yn.logout()}}function T4(){return{logout:b.useCallback(()=>O4(),[])}}const R4=()=>{const[e,n]=b.useState([]),{logout:r}=T4();return b.useEffect(()=>{let s=!0;return(async()=>{try{const u=((await Ni.getMe()).organizations??[]).map(d=>({id:d.id,name:d.name??d.id}));if(!s)return;n(u),!Va.get()&&u.length>0&&Va.set(u[0].id)}catch{}})(),()=>{s=!1}},[]),c.jsxs(b4,{defaultOpen:!0,children:[c.jsxs(x4,{collapsible:"icon",variant:"floating",children:[c.jsx(_4,{children:c.jsx("div",{className:"px-2 py-2",children:c.jsx(fM,{orgs:e})})}),c.jsxs(C4,{children:[c.jsxs(vu,{children:[c.jsx(yu,{children:"Navigation"}),c.jsx(bu,{children:c.jsx(xu,{children:IT.map(s=>c.jsx(wu,{children:c.jsx(Su,{asChild:!0,tooltip:s.label,children:c.jsxs(eu,{to:s.to,className:({isActive:o})=>oe("flex items-center gap-2",o&&"text-primary"),children:[c.jsx(s.icon,{className:"h-4 w-4"}),c.jsx("span",{children:s.label})]})})},s.to))})})]}),c.jsxs(vu,{children:[c.jsx(yu,{children:"Organization"}),c.jsx(bu,{children:c.jsx(xu,{children:HT.map(s=>c.jsx(wu,{children:c.jsx(Su,{asChild:!0,tooltip:s.label,children:c.jsxs(eu,{to:s.to,className:({isActive:o})=>oe("flex items-center gap-2",o&&"text-primary"),children:[c.jsx(s.icon,{className:"h-4 w-4"}),c.jsx("span",{children:s.label})]})})},s.to))})})]}),c.jsxs(vu,{children:[c.jsx(yu,{children:"User"}),c.jsx(bu,{children:c.jsx(xu,{children:VT.map(s=>c.jsx(wu,{children:c.jsx(Su,{asChild:!0,tooltip:s.label,children:c.jsxs(eu,{to:s.to,className:({isActive:o})=>oe("flex items-center gap-2",o&&"text-primary"),children:[c.jsx(s.icon,{className:"h-4 w-4"}),c.jsx("span",{children:s.label})]})})},s.to))})})]}),c.jsxs(vu,{children:[c.jsx(yu,{children:"Admin"}),c.jsx(bu,{children:c.jsx(xu,{children:BT.map(s=>c.jsx(wu,{children:c.jsx(Su,{asChild:!0,tooltip:s.label,children:c.jsxs(eu,{to:s.to,className:({isActive:o})=>oe("flex items-center gap-2",o&&"text-primary"),children:[c.jsx(s.icon,{className:"h-4 w-4"}),c.jsx("span",{children:s.label})]})})},s.to))})})]})]}),c.jsx(E4,{children:c.jsx("div",{className:"px-2 py-2",children:c.jsx(ce,{variant:"ghost",size:"sm",className:"w-full",onClick:()=>void r(),children:"Sign out"})})})]}),c.jsxs(S4,{className:"min-h-screen",children:[c.jsx(A4,{}),c.jsx("main",{className:"p-4",children:c.jsx(ew,{})})]})]})},N4=()=>{const e=b.useSyncExternalStore(n=>yn.subscribe(n),()=>yn.get(),()=>yn.get());return{tokens:e,authed:!!e?.access_token,isExpired:yn.isExpired(),willExpireSoon:yn.willExpireSoon()}},D4=()=>{const{authed:e}=N4(),n=np();return e?c.jsx(ew,{}):c.jsx(cC,{to:`/login?to=${encodeURIComponent(n.pathname+n.search)}`,replace:!0})},ul=OT(),_u={listAnnotations:()=>$e(async()=>await ul.listAnnotations()),createAnnotation:e=>$e(async()=>await ul.createAnnotation({body:e})),getAnnotation:e=>$e(async()=>await ul.getAnnotation({id:e})),deleteAnnotation:e=>$e(async()=>{await ul.deleteAnnotation({id:e})}),updateAnnotation:(e,n)=>$e(async()=>await ul.updateAnnotation({id:e,body:n}))},dl=AT(),Eu={listLabels:()=>$e(async()=>await dl.listLabels()),createLabel:e=>$e(async()=>await dl.createLabel({body:e})),getLabel:e=>$e(async()=>await dl.getLabel({id:e})),deleteLabel:e=>$e(async()=>{await dl.deleteLabel({id:e})}),updateLabel:(e,n)=>$e(async()=>await dl.updateLabel({id:e,body:n}))};var Pl=e=>e.type==="checkbox",zi=e=>e instanceof Date,Kn=e=>e==null;const x1=e=>typeof e=="object";var Ft=e=>!Kn(e)&&!Array.isArray(e)&&x1(e)&&!zi(e),w1=e=>Ft(e)&&e.target?Pl(e.target)?e.target.checked:e.target.value:e,z4=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,S1=(e,n)=>e.has(z4(n)),M4=e=>{const n=e.constructor&&e.constructor.prototype;return Ft(n)&&n.hasOwnProperty("isPrototypeOf")},qp=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Jt(e){let n;const r=Array.isArray(e),s=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)n=new Date(e);else if(!(qp&&(e instanceof Blob||s))&&(r||Ft(e)))if(n=r?[]:Object.create(Object.getPrototypeOf(e)),!r&&!M4(e))n=e;else for(const o in e)e.hasOwnProperty(o)&&(n[o]=Jt(e[o]));else return e;return n}var _d=e=>/^\w*$/.test(e),Nt=e=>e===void 0,Pp=e=>Array.isArray(e)?e.filter(Boolean):[],Ip=e=>Pp(e.replace(/["|']|\]/g,"").split(/\.|\[/)),me=(e,n,r)=>{if(!n||!Ft(e))return r;const s=(_d(n)?[n]:Ip(n)).reduce((o,u)=>Kn(o)?o:o[u],e);return Nt(s)||s===e?Nt(e[n])?r:e[n]:s},Jn=e=>typeof e=="boolean",ht=(e,n,r)=>{let s=-1;const o=_d(n)?[n]:Ip(n),u=o.length,d=u-1;for(;++sG.useContext(Hp),k4=e=>{const{children:n,...r}=e;return G.createElement(Hp.Provider,{value:r},n)};var _1=(e,n,r,s=!0)=>{const o={defaultValues:n._defaultValues};for(const u in e)Object.defineProperty(o,u,{get:()=>{const d=u;return n._proxyFormState[d]!==Ea.all&&(n._proxyFormState[d]=!s||Ea.all),r&&(r[d]=!0),e[d]}});return o};const Vp=typeof window<"u"?G.useLayoutEffect:G.useEffect;function E1(e){const n=Ed(),{control:r=n.control,disabled:s,name:o,exact:u}=e||{},[d,m]=G.useState(r._formState),p=G.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Vp(()=>r._subscribe({name:o,formState:p.current,exact:u,callback:g=>{!s&&m({...r._formState,...g})}}),[o,s,u]),G.useEffect(()=>{p.current.isValid&&r._setValid(!0)},[r]),G.useMemo(()=>_1(d,r,p.current,!1),[d,r])}var ea=e=>typeof e=="string",C1=(e,n,r,s,o)=>ea(e)?(s&&n.watch.add(e),me(r,e,o)):Array.isArray(e)?e.map(u=>(s&&n.watch.add(u),me(r,u))):(s&&(n.watchAll=!0),r),Vm=e=>Kn(e)||!x1(e);function br(e,n,r=new WeakSet){if(Vm(e)||Vm(n))return e===n;if(zi(e)&&zi(n))return e.getTime()===n.getTime();const s=Object.keys(e),o=Object.keys(n);if(s.length!==o.length)return!1;if(r.has(e)||r.has(n))return!0;r.add(e),r.add(n);for(const u of s){const d=e[u];if(!o.includes(u))return!1;if(u!=="ref"){const m=n[u];if(zi(d)&&zi(m)||Ft(d)&&Ft(m)||Array.isArray(d)&&Array.isArray(m)?!br(d,m,r):d!==m)return!1}}return!0}function L4(e){const n=Ed(),{control:r=n.control,name:s,defaultValue:o,disabled:u,exact:d,compute:m}=e||{},p=G.useRef(o),g=G.useRef(m),x=G.useRef(void 0);g.current=m;const v=G.useMemo(()=>r._getWatch(s,p.current),[r,s]),[w,E]=G.useState(g.current?g.current(v):v);return Vp(()=>r._subscribe({name:s,formState:{values:!0},exact:d,callback:A=>{if(!u){const S=C1(s,r._names,A.values||r._formValues,!1,p.current);if(g.current){const T=g.current(S);br(T,x.current)||(E(T),x.current=T)}else E(S)}}}),[r,u,s,d]),G.useEffect(()=>r._removeUnmounted()),w}function U4(e){const n=Ed(),{name:r,disabled:s,control:o=n.control,shouldUnregister:u,defaultValue:d}=e,m=S1(o._names.array,r),p=G.useMemo(()=>me(o._formValues,r,me(o._defaultValues,r,d)),[o,r,d]),g=L4({control:o,name:r,defaultValue:p,exact:!0}),x=E1({control:o,name:r,exact:!0}),v=G.useRef(e),w=G.useRef(void 0),E=G.useRef(o.register(r,{...e.rules,value:g,...Jn(e.disabled)?{disabled:e.disabled}:{}}));v.current=e;const A=G.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!me(x.errors,r)},isDirty:{enumerable:!0,get:()=>!!me(x.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!me(x.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!me(x.validatingFields,r)},error:{enumerable:!0,get:()=>me(x.errors,r)}}),[x,r]),S=G.useCallback(O=>E.current.onChange({target:{value:w1(O),name:r},type:Xu.CHANGE}),[r]),T=G.useCallback(()=>E.current.onBlur({target:{value:me(o._formValues,r),name:r},type:Xu.BLUR}),[r,o._formValues]),z=G.useCallback(O=>{const j=me(o._fields,r);j&&O&&(j._f.ref={focus:()=>O.focus&&O.focus(),select:()=>O.select&&O.select(),setCustomValidity:N=>O.setCustomValidity(N),reportValidity:()=>O.reportValidity()})},[o._fields,r]),R=G.useMemo(()=>({name:r,value:g,...Jn(s)||x.disabled?{disabled:x.disabled||s}:{},onChange:S,onBlur:T,ref:z}),[r,s,x.disabled,S,T,z,g]);return G.useEffect(()=>{const O=o._options.shouldUnregister||u,j=w.current;j&&j!==r&&!m&&o.unregister(j),o.register(r,{...v.current.rules,...Jn(v.current.disabled)?{disabled:v.current.disabled}:{}});const N=(B,H)=>{const $=me(o._fields,B);$&&$._f&&($._f.mount=H)};if(N(r,!0),O){const B=Jt(me(o._options.defaultValues,r,v.current.defaultValue));ht(o._defaultValues,r,B),Nt(me(o._formValues,r))&&ht(o._formValues,r,B)}return!m&&o.register(r),w.current=r,()=>{(m?O&&!o._state.action:O)?o.unregister(r):N(r,!1)}},[r,o,m,u]),G.useEffect(()=>{o._setDisabledField({disabled:s,name:r})},[s,r,o]),G.useMemo(()=>({field:R,formState:x,fieldState:A}),[R,x,A])}const K4=e=>e.render(U4(e));var Bp=(e,n,r,s,o)=>n?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[s]:o||!0}}:{},El=e=>Array.isArray(e)?e:[e],c0=()=>{let e=[];return{get observers(){return e},next:o=>{for(const u of e)u.next&&u.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(u=>u!==o)}}),unsubscribe:()=>{e=[]}}};function j1(e,n){const r={};for(const s in e)if(e.hasOwnProperty(s)){const o=e[s],u=n[s];if(o&&Ft(o)&&u){const d=j1(o,u);Ft(d)&&(r[s]=d)}else e[s]&&(r[s]=u)}return r}var Ln=e=>Ft(e)&&!Object.keys(e).length,Fp=e=>e.type==="file",Ca=e=>typeof e=="function",Yu=e=>{if(!qp)return!1;const n=e?e.ownerDocument:0;return e instanceof(n&&n.defaultView?n.defaultView.HTMLElement:HTMLElement)},A1=e=>e.type==="select-multiple",Zp=e=>e.type==="radio",q4=e=>Zp(e)||Pl(e),gm=e=>Yu(e)&&e.isConnected;function P4(e,n){const r=n.slice(0,-1).length;let s=0;for(;s{for(const n in e)if(Ca(e[n]))return!0;return!1};function O1(e){return Array.isArray(e)||Ft(e)&&!H4(e)}function Bm(e,n={}){for(const r in e)O1(e[r])?(n[r]=Array.isArray(e[r])?[]:{},Bm(e[r],n[r])):Nt(e[r])||(n[r]=!0);return n}function Bs(e,n,r){r||(r=Bm(n));for(const s in e)O1(e[s])?Nt(n)||Vm(r[s])?r[s]=Bm(e[s],Array.isArray(e[s])?[]:{}):Bs(e[s],Kn(n)?{}:n[s],r[s]):r[s]=!br(e[s],n[s]);return r}const u0={value:!1,isValid:!1},d0={value:!0,isValid:!0};var T1=e=>{if(Array.isArray(e)){if(e.length>1){const n=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:n,isValid:!!n.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Nt(e[0].attributes.value)?Nt(e[0].value)||e[0].value===""?d0:{value:e[0].value,isValid:!0}:d0:u0}return u0},R1=(e,{valueAsNumber:n,valueAsDate:r,setValueAs:s})=>Nt(e)?e:n?e===""?NaN:e&&+e:r&&ea(e)?new Date(e):s?s(e):e;const f0={isValid:!1,value:null};var N1=e=>Array.isArray(e)?e.reduce((n,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:n,f0):f0;function h0(e){const n=e.ref;return Fp(n)?n.files:Zp(n)?N1(e.refs).value:A1(n)?[...n.selectedOptions].map(({value:r})=>r):Pl(n)?T1(e.refs).value:R1(Nt(n.value)?e.ref.value:n.value,e)}var V4=(e,n,r,s)=>{const o={};for(const u of e){const d=me(n,u);d&&ht(o,u,d._f)}return{criteriaMode:r,names:[...e],fields:o,shouldUseNativeValidation:s}},Qu=e=>e instanceof RegExp,fl=e=>Nt(e)?e:Qu(e)?e.source:Ft(e)?Qu(e.value)?e.value.source:e.value:e,m0=e=>({isOnSubmit:!e||e===Ea.onSubmit,isOnBlur:e===Ea.onBlur,isOnChange:e===Ea.onChange,isOnAll:e===Ea.all,isOnTouch:e===Ea.onTouched});const p0="AsyncFunction";var B4=e=>!!e&&!!e.validate&&!!(Ca(e.validate)&&e.validate.constructor.name===p0||Ft(e.validate)&&Object.values(e.validate).find(n=>n.constructor.name===p0)),F4=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),g0=(e,n,r)=>!r&&(n.watchAll||n.watch.has(e)||[...n.watch].some(s=>e.startsWith(s)&&/^\.\w+/.test(e.slice(s.length))));const Cl=(e,n,r,s)=>{for(const o of r||Object.keys(e)){const u=me(e,o);if(u){const{_f:d,...m}=u;if(d){if(d.refs&&d.refs[0]&&n(d.refs[0],o)&&!s)return!0;if(d.ref&&n(d.ref,d.name)&&!s)return!0;if(Cl(m,n))break}else if(Ft(m)&&Cl(m,n))break}}};function v0(e,n,r){const s=me(e,r);if(s||_d(r))return{error:s,name:r};const o=r.split(".");for(;o.length;){const u=o.join("."),d=me(n,u),m=me(e,u);if(d&&!Array.isArray(d)&&r!==u)return{name:r};if(m&&m.type)return{name:u,error:m};if(m&&m.root&&m.root.type)return{name:`${u}.root`,error:m.root};o.pop()}return{name:r}}var Z4=(e,n,r,s)=>{r(e);const{name:o,...u}=e;return Ln(u)||Object.keys(u).length>=Object.keys(n).length||Object.keys(u).find(d=>n[d]===(!s||Ea.all))},$4=(e,n,r)=>!e||!n||e===n||El(e).some(s=>s&&(r?s===n:s.startsWith(n)||n.startsWith(s))),G4=(e,n,r,s,o)=>o.isOnAll?!1:!r&&o.isOnTouch?!(n||e):(r?s.isOnBlur:o.isOnBlur)?!e:(r?s.isOnChange:o.isOnChange)?e:!0,X4=(e,n)=>!Pp(me(e,n)).length&&Vt(e,n),Y4=(e,n,r)=>{const s=El(me(e,r));return ht(s,"root",n[r]),ht(e,r,s),e};function y0(e,n,r="validate"){if(ea(e)||Array.isArray(e)&&e.every(ea)||Jn(e)&&!e)return{type:r,message:ea(e)?e:"",ref:n}}var Is=e=>Ft(e)&&!Qu(e)?e:{value:e,message:""},b0=async(e,n,r,s,o,u)=>{const{ref:d,refs:m,required:p,maxLength:g,minLength:x,min:v,max:w,pattern:E,validate:A,name:S,valueAsNumber:T,mount:z}=e._f,R=me(r,S);if(!z||n.has(S))return{};const O=m?m[0]:d,j=re=>{o&&O.reportValidity&&(O.setCustomValidity(Jn(re)?"":re||""),O.reportValidity())},N={},B=Zp(d),H=Pl(d),$=B||H,ue=(T||Fp(d))&&Nt(d.value)&&Nt(R)||Yu(d)&&d.value===""||R===""||Array.isArray(R)&&!R.length,ye=Bp.bind(null,S,s,N),ge=(re,le,he,ve=yr.maxLength,C=yr.minLength)=>{const L=re?le:he;N[S]={type:re?ve:C,message:L,ref:d,...ye(re?ve:C,L)}};if(u?!Array.isArray(R)||!R.length:p&&(!$&&(ue||Kn(R))||Jn(R)&&!R||H&&!T1(m).isValid||B&&!N1(m).isValid)){const{value:re,message:le}=ea(p)?{value:!!p,message:p}:Is(p);if(re&&(N[S]={type:yr.required,message:le,ref:O,...ye(yr.required,le)},!s))return j(le),N}if(!ue&&(!Kn(v)||!Kn(w))){let re,le;const he=Is(w),ve=Is(v);if(!Kn(R)&&!isNaN(R)){const C=d.valueAsNumber||R&&+R;Kn(he.value)||(re=C>he.value),Kn(ve.value)||(le=Cnew Date(new Date().toDateString()+" "+xe),K=d.type=="time",de=d.type=="week";ea(he.value)&&R&&(re=K?L(R)>L(he.value):de?R>he.value:C>new Date(he.value)),ea(ve.value)&&R&&(le=K?L(R)+re.value,ve=!Kn(le.value)&&R.length<+le.value;if((he||ve)&&(ge(he,re.message,le.message),!s))return j(N[S].message),N}if(E&&!ue&&ea(R)){const{value:re,message:le}=Is(E);if(Qu(re)&&!R.match(re)&&(N[S]={type:yr.pattern,message:le,ref:d,...ye(yr.pattern,le)},!s))return j(le),N}if(A){if(Ca(A)){const re=await A(R,r),le=y0(re,O);if(le&&(N[S]={...le,...ye(yr.validate,le.message)},!s))return j(le.message),N}else if(Ft(A)){let re={};for(const le in A){if(!Ln(re)&&!s)break;const he=y0(await A[le](R,r),O,le);he&&(re={...he,...ye(le,he.message)},j(he.message),s&&(N[S]=re))}if(!Ln(re)&&(N[S]={ref:O,...re},!s))return N}}return j(!0),N};const Q4={mode:Ea.onSubmit,reValidateMode:Ea.onChange,shouldFocusError:!0};function J4(e={}){let n={...Q4,...e},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:Ca(n.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:n.errors||{},disabled:n.disabled||!1},s={},o=Ft(n.defaultValues)||Ft(n.values)?Jt(n.defaultValues||n.values)||{}:{},u=n.shouldUnregister?{}:Jt(o),d={action:!1,mount:!1,watch:!1},m={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},p,g=0;const x={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let v={...x};const w={array:c0(),state:c0()},E=n.criteriaMode===Ea.all,A=M=>I=>{clearTimeout(g),g=setTimeout(M,I)},S=async M=>{if(!n.disabled&&(x.isValid||v.isValid||M)){const I=n.resolver?Ln((await H()).errors):await ue(s,!0);I!==r.isValid&&w.state.next({isValid:I})}},T=(M,I)=>{!n.disabled&&(x.isValidating||x.validatingFields||v.isValidating||v.validatingFields)&&((M||Array.from(m.mount)).forEach(Z=>{Z&&(I?ht(r.validatingFields,Z,I):Vt(r.validatingFields,Z))}),w.state.next({validatingFields:r.validatingFields,isValidating:!Ln(r.validatingFields)}))},z=(M,I=[],Z,fe,ie=!0,se=!0)=>{if(fe&&Z&&!n.disabled){if(d.action=!0,se&&Array.isArray(me(s,M))){const Ee=Z(me(s,M),fe.argA,fe.argB);ie&&ht(s,M,Ee)}if(se&&Array.isArray(me(r.errors,M))){const Ee=Z(me(r.errors,M),fe.argA,fe.argB);ie&&ht(r.errors,M,Ee),X4(r.errors,M)}if((x.touchedFields||v.touchedFields)&&se&&Array.isArray(me(r.touchedFields,M))){const Ee=Z(me(r.touchedFields,M),fe.argA,fe.argB);ie&&ht(r.touchedFields,M,Ee)}(x.dirtyFields||v.dirtyFields)&&(r.dirtyFields=Bs(o,u)),w.state.next({name:M,isDirty:ge(M,I),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else ht(u,M,I)},R=(M,I)=>{ht(r.errors,M,I),w.state.next({errors:r.errors})},O=M=>{r.errors=M,w.state.next({errors:r.errors,isValid:!1})},j=(M,I,Z,fe)=>{const ie=me(s,M);if(ie){const se=me(u,M,Nt(Z)?me(o,M):Z);Nt(se)||fe&&fe.defaultChecked||I?ht(u,M,I?se:h0(ie._f)):he(M,se),d.mount&&S()}},N=(M,I,Z,fe,ie)=>{let se=!1,Ee=!1;const at={name:M};if(!n.disabled){if(!Z||fe){(x.isDirty||v.isDirty)&&(Ee=r.isDirty,r.isDirty=at.isDirty=ge(),se=Ee!==at.isDirty);const rt=br(me(o,M),I);Ee=!!me(r.dirtyFields,M),rt?Vt(r.dirtyFields,M):ht(r.dirtyFields,M,!0),at.dirtyFields=r.dirtyFields,se=se||(x.dirtyFields||v.dirtyFields)&&Ee!==!rt}if(Z){const rt=me(r.touchedFields,M);rt||(ht(r.touchedFields,M,Z),at.touchedFields=r.touchedFields,se=se||(x.touchedFields||v.touchedFields)&&rt!==Z)}se&&ie&&w.state.next(at)}return se?at:{}},B=(M,I,Z,fe)=>{const ie=me(r.errors,M),se=(x.isValid||v.isValid)&&Jn(I)&&r.isValid!==I;if(n.delayError&&Z?(p=A(()=>R(M,Z)),p(n.delayError)):(clearTimeout(g),p=null,Z?ht(r.errors,M,Z):Vt(r.errors,M)),(Z?!br(ie,Z):ie)||!Ln(fe)||se){const Ee={...fe,...se&&Jn(I)?{isValid:I}:{},errors:r.errors,name:M};r={...r,...Ee},w.state.next(Ee)}},H=async M=>{T(M,!0);const I=await n.resolver(u,n.context,V4(M||m.mount,s,n.criteriaMode,n.shouldUseNativeValidation));return T(M),I},$=async M=>{const{errors:I}=await H(M);if(M)for(const Z of M){const fe=me(I,Z);fe?ht(r.errors,Z,fe):Vt(r.errors,Z)}else r.errors=I;return I},ue=async(M,I,Z={valid:!0})=>{for(const fe in M){const ie=M[fe];if(ie){const{_f:se,...Ee}=ie;if(se){const at=m.array.has(se.name),rt=ie._f&&B4(ie._f);rt&&x.validatingFields&&T([se.name],!0);const nn=await b0(ie,m.disabled,u,E,n.shouldUseNativeValidation&&!I,at);if(rt&&x.validatingFields&&T([se.name]),nn[se.name]&&(Z.valid=!1,I))break;!I&&(me(nn,se.name)?at?Y4(r.errors,nn,se.name):ht(r.errors,se.name,nn[se.name]):Vt(r.errors,se.name))}!Ln(Ee)&&await ue(Ee,I,Z)}}return Z.valid},ye=()=>{for(const M of m.unMount){const I=me(s,M);I&&(I._f.refs?I._f.refs.every(Z=>!gm(Z)):!gm(I._f.ref))&&te(M)}m.unMount=new Set},ge=(M,I)=>!n.disabled&&(M&&I&&ht(u,M,I),!br(xe(),o)),re=(M,I,Z)=>C1(M,m,{...d.mount?u:Nt(I)?o:ea(M)?{[M]:I}:I},Z,I),le=M=>Pp(me(d.mount?u:o,M,n.shouldUnregister?me(o,M,[]):[])),he=(M,I,Z={})=>{const fe=me(s,M);let ie=I;if(fe){const se=fe._f;se&&(!se.disabled&&ht(u,M,R1(I,se)),ie=Yu(se.ref)&&Kn(I)?"":I,A1(se.ref)?[...se.ref.options].forEach(Ee=>Ee.selected=ie.includes(Ee.value)):se.refs?Pl(se.ref)?se.refs.forEach(Ee=>{(!Ee.defaultChecked||!Ee.disabled)&&(Array.isArray(ie)?Ee.checked=!!ie.find(at=>at===Ee.value):Ee.checked=ie===Ee.value||!!ie)}):se.refs.forEach(Ee=>Ee.checked=Ee.value===ie):Fp(se.ref)?se.ref.value="":(se.ref.value=ie,se.ref.type||w.state.next({name:M,values:Jt(u)})))}(Z.shouldDirty||Z.shouldTouch)&&N(M,ie,Z.shouldTouch,Z.shouldDirty,!0),Z.shouldValidate&&de(M)},ve=(M,I,Z)=>{for(const fe in I){if(!I.hasOwnProperty(fe))return;const ie=I[fe],se=M+"."+fe,Ee=me(s,se);(m.array.has(M)||Ft(ie)||Ee&&!Ee._f)&&!zi(ie)?ve(se,ie,Z):he(se,ie,Z)}},C=(M,I,Z={})=>{const fe=me(s,M),ie=m.array.has(M),se=Jt(I);ht(u,M,se),ie?(w.array.next({name:M,values:Jt(u)}),(x.isDirty||x.dirtyFields||v.isDirty||v.dirtyFields)&&Z.shouldDirty&&w.state.next({name:M,dirtyFields:Bs(o,u),isDirty:ge(M,se)})):fe&&!fe._f&&!Kn(se)?ve(M,se,Z):he(M,se,Z),g0(M,m)&&w.state.next({...r,name:M}),w.state.next({name:d.mount?M:void 0,values:Jt(u)})},L=async M=>{d.mount=!0;const I=M.target;let Z=I.name,fe=!0;const ie=me(s,Z),se=rt=>{fe=Number.isNaN(rt)||zi(rt)&&isNaN(rt.getTime())||br(rt,me(u,Z,rt))},Ee=m0(n.mode),at=m0(n.reValidateMode);if(ie){let rt,nn;const En=I.type?h0(ie._f):w1(M),Vn=M.type===Xu.BLUR||M.type===Xu.FOCUS_OUT,Da=!F4(ie._f)&&!n.resolver&&!me(r.errors,Z)&&!ie._f.deps||G4(Vn,me(r.touchedFields,Z),r.isSubmitted,at,Ee),ya=g0(Z,m,Vn);ht(u,Z,En),Vn?(!I||!I.readOnly)&&(ie._f.onBlur&&ie._f.onBlur(M),p&&p(0)):ie._f.onChange&&ie._f.onChange(M);const Gt=N(Z,En,Vn),Bn=!Ln(Gt)||ya;if(!Vn&&w.state.next({name:Z,type:M.type,values:Jt(u)}),Da)return(x.isValid||v.isValid)&&(n.mode==="onBlur"?Vn&&S():Vn||S()),Bn&&w.state.next({name:Z,...ya?{}:Gt});if(!Vn&&ya&&w.state.next({...r}),n.resolver){const{errors:Xt}=await H([Z]);if(se(En),fe){const go=v0(r.errors,s,Z),Cr=v0(Xt,s,go.name||Z);rt=Cr.error,Z=Cr.name,nn=Ln(Xt)}}else T([Z],!0),rt=(await b0(ie,m.disabled,u,E,n.shouldUseNativeValidation))[Z],T([Z]),se(En),fe&&(rt?nn=!1:(x.isValid||v.isValid)&&(nn=await ue(s,!0)));fe&&(ie._f.deps&&(!Array.isArray(ie._f.deps)||ie._f.deps.length>0)&&de(ie._f.deps),B(Z,nn,rt,Gt))}},K=(M,I)=>{if(me(r.errors,I)&&M.focus)return M.focus(),1},de=async(M,I={})=>{let Z,fe;const ie=El(M);if(n.resolver){const se=await $(Nt(M)?M:ie);Z=Ln(se),fe=M?!ie.some(Ee=>me(se,Ee)):Z}else M?(fe=(await Promise.all(ie.map(async se=>{const Ee=me(s,se);return await ue(Ee&&Ee._f?{[se]:Ee}:Ee)}))).every(Boolean),!(!fe&&!r.isValid)&&S()):fe=Z=await ue(s);return w.state.next({...!ea(M)||(x.isValid||v.isValid)&&Z!==r.isValid?{}:{name:M},...n.resolver||!M?{isValid:Z}:{},errors:r.errors}),I.shouldFocus&&!fe&&Cl(s,K,M?ie:m.mount),fe},xe=(M,I)=>{let Z={...d.mount?u:o};return I&&(Z=j1(I.dirtyFields?r.dirtyFields:r.touchedFields,Z)),Nt(M)?Z:ea(M)?me(Z,M):M.map(fe=>me(Z,fe))},ze=(M,I)=>({invalid:!!me((I||r).errors,M),isDirty:!!me((I||r).dirtyFields,M),error:me((I||r).errors,M),isValidating:!!me(r.validatingFields,M),isTouched:!!me((I||r).touchedFields,M)}),Y=M=>{M&&El(M).forEach(I=>Vt(r.errors,I)),w.state.next({errors:M?r.errors:{}})},X=(M,I,Z)=>{const fe=(me(s,M,{_f:{}})._f||{}).ref,ie=me(r.errors,M)||{},{ref:se,message:Ee,type:at,...rt}=ie;ht(r.errors,M,{...rt,...I,ref:fe}),w.state.next({name:M,errors:r.errors,isValid:!1}),Z&&Z.shouldFocus&&fe&&fe.focus&&fe.focus()},ae=(M,I)=>Ca(M)?w.state.subscribe({next:Z=>"values"in Z&&M(re(void 0,I),Z)}):re(M,I,!0),ne=M=>w.state.subscribe({next:I=>{$4(M.name,I.name,M.exact)&&Z4(I,M.formState||x,Hn,M.reRenderRoot)&&M.callback({values:{...u},...r,...I,defaultValues:o})}}).unsubscribe,_e=M=>(d.mount=!0,v={...v,...M.formState},ne({...M,formState:v})),te=(M,I={})=>{for(const Z of M?El(M):m.mount)m.mount.delete(Z),m.array.delete(Z),I.keepValue||(Vt(s,Z),Vt(u,Z)),!I.keepError&&Vt(r.errors,Z),!I.keepDirty&&Vt(r.dirtyFields,Z),!I.keepTouched&&Vt(r.touchedFields,Z),!I.keepIsValidating&&Vt(r.validatingFields,Z),!n.shouldUnregister&&!I.keepDefaultValue&&Vt(o,Z);w.state.next({values:Jt(u)}),w.state.next({...r,...I.keepDirty?{isDirty:ge()}:{}}),!I.keepIsValid&&S()},pe=({disabled:M,name:I})=>{(Jn(M)&&d.mount||M||m.disabled.has(I))&&(M?m.disabled.add(I):m.disabled.delete(I))},Te=(M,I={})=>{let Z=me(s,M);const fe=Jn(I.disabled)||Jn(n.disabled);return ht(s,M,{...Z||{},_f:{...Z&&Z._f?Z._f:{ref:{name:M}},name:M,mount:!0,...I}}),m.mount.add(M),Z?pe({disabled:Jn(I.disabled)?I.disabled:n.disabled,name:M}):j(M,!0,I.value),{...fe?{disabled:I.disabled||n.disabled}:{},...n.progressive?{required:!!I.required,min:fl(I.min),max:fl(I.max),minLength:fl(I.minLength),maxLength:fl(I.maxLength),pattern:fl(I.pattern)}:{},name:M,onChange:L,onBlur:L,ref:ie=>{if(ie){Te(M,I),Z=me(s,M);const se=Nt(ie.value)&&ie.querySelectorAll&&ie.querySelectorAll("input,select,textarea")[0]||ie,Ee=q4(se),at=Z._f.refs||[];if(Ee?at.find(rt=>rt===se):se===Z._f.ref)return;ht(s,M,{_f:{...Z._f,...Ee?{refs:[...at.filter(gm),se,...Array.isArray(me(o,M))?[{}]:[]],ref:{type:se.type,name:M}}:{ref:se}}}),j(M,!1,void 0,se)}else Z=me(s,M,{}),Z._f&&(Z._f.mount=!1),(n.shouldUnregister||I.shouldUnregister)&&!(S1(m.array,M)&&d.action)&&m.unMount.add(M)}}},Me=()=>n.shouldFocusError&&Cl(s,K,m.mount),Ge=M=>{Jn(M)&&(w.state.next({disabled:M}),Cl(s,(I,Z)=>{const fe=me(s,Z);fe&&(I.disabled=fe._f.disabled||M,Array.isArray(fe._f.refs)&&fe._f.refs.forEach(ie=>{ie.disabled=fe._f.disabled||M}))},0,!1))},Xe=(M,I)=>async Z=>{let fe;Z&&(Z.preventDefault&&Z.preventDefault(),Z.persist&&Z.persist());let ie=Jt(u);if(w.state.next({isSubmitting:!0}),n.resolver){const{errors:se,values:Ee}=await H();r.errors=se,ie=Jt(Ee)}else await ue(s);if(m.disabled.size)for(const se of m.disabled)Vt(ie,se);if(Vt(r.errors,"root"),Ln(r.errors)){w.state.next({errors:{}});try{await M(ie,Z)}catch(se){fe=se}}else I&&await I({...r.errors},Z),Me(),setTimeout(Me);if(w.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Ln(r.errors)&&!fe,submitCount:r.submitCount+1,errors:r.errors}),fe)throw fe},$t=(M,I={})=>{me(s,M)&&(Nt(I.defaultValue)?C(M,Jt(me(o,M))):(C(M,I.defaultValue),ht(o,M,Jt(I.defaultValue))),I.keepTouched||Vt(r.touchedFields,M),I.keepDirty||(Vt(r.dirtyFields,M),r.isDirty=I.defaultValue?ge(M,Jt(me(o,M))):ge()),I.keepError||(Vt(r.errors,M),x.isValid&&S()),w.state.next({...r}))},Ot=(M,I={})=>{const Z=M?Jt(M):o,fe=Jt(Z),ie=Ln(M),se=ie?o:fe;if(I.keepDefaultValues||(o=Z),!I.keepValues){if(I.keepDirtyValues){const Ee=new Set([...m.mount,...Object.keys(Bs(o,u))]);for(const at of Array.from(Ee))me(r.dirtyFields,at)?ht(se,at,me(u,at)):C(at,me(se,at))}else{if(qp&&Nt(M))for(const Ee of m.mount){const at=me(s,Ee);if(at&&at._f){const rt=Array.isArray(at._f.refs)?at._f.refs[0]:at._f.ref;if(Yu(rt)){const nn=rt.closest("form");if(nn){nn.reset();break}}}}if(I.keepFieldsRef)for(const Ee of m.mount)C(Ee,me(se,Ee));else s={}}u=n.shouldUnregister?I.keepDefaultValues?Jt(o):{}:Jt(se),w.array.next({values:{...se}}),w.state.next({values:{...se}})}m={mount:I.keepDirtyValues?m.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},d.mount=!x.isValid||!!I.keepIsValid||!!I.keepDirtyValues,d.watch=!!n.shouldUnregister,w.state.next({submitCount:I.keepSubmitCount?r.submitCount:0,isDirty:ie?!1:I.keepDirty?r.isDirty:!!(I.keepDefaultValues&&!br(M,o)),isSubmitted:I.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:ie?{}:I.keepDirtyValues?I.keepDefaultValues&&u?Bs(o,u):r.dirtyFields:I.keepDefaultValues&&M?Bs(o,M):I.keepDirty?r.dirtyFields:{},touchedFields:I.keepTouched?r.touchedFields:{},errors:I.keepErrors?r.errors:{},isSubmitSuccessful:I.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:o})},na=(M,I)=>Ot(Ca(M)?M(u):M,I),aa=(M,I={})=>{const Z=me(s,M),fe=Z&&Z._f;if(fe){const ie=fe.refs?fe.refs[0]:fe.ref;ie.focus&&(ie.focus(),I.shouldSelect&&Ca(ie.select)&&ie.select())}},Hn=M=>{r={...r,...M}},fn={control:{register:Te,unregister:te,getFieldState:ze,handleSubmit:Xe,setError:X,_subscribe:ne,_runSchema:H,_focusError:Me,_getWatch:re,_getDirty:ge,_setValid:S,_setFieldArray:z,_setDisabledField:pe,_setErrors:O,_getFieldArray:le,_reset:Ot,_resetDefaultValues:()=>Ca(n.defaultValues)&&n.defaultValues().then(M=>{na(M,n.resetOptions),w.state.next({isLoading:!1})}),_removeUnmounted:ye,_disableForm:Ge,_subjects:w,_proxyFormState:x,get _fields(){return s},get _formValues(){return u},get _state(){return d},set _state(M){d=M},get _defaultValues(){return o},get _names(){return m},set _names(M){m=M},get _formState(){return r},get _options(){return n},set _options(M){n={...n,...M}}},subscribe:_e,trigger:de,register:Te,handleSubmit:Xe,watch:ae,setValue:C,getValues:xe,reset:na,resetField:$t,clearErrors:Y,unregister:te,setError:X,setFocus:aa,getFieldState:ze};return{...fn,formControl:fn}}function wn(e={}){const n=G.useRef(void 0),r=G.useRef(void 0),[s,o]=G.useState({isDirty:!1,isValidating:!1,isLoading:Ca(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:Ca(e.defaultValues)?void 0:e.defaultValues});if(!n.current)if(e.formControl)n.current={...e.formControl,formState:s},e.defaultValues&&!Ca(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:d,...m}=J4(e);n.current={...m,formState:s}}const u=n.current.control;return u._options=e,Vp(()=>{const d=u._subscribe({formState:u._proxyFormState,callback:()=>o({...u._formState}),reRenderRoot:!0});return o(m=>({...m,isReady:!0})),u._formState.isReady=!0,d},[u]),G.useEffect(()=>u._disableForm(e.disabled),[u,e.disabled]),G.useEffect(()=>{e.mode&&(u._options.mode=e.mode),e.reValidateMode&&(u._options.reValidateMode=e.reValidateMode)},[u,e.mode,e.reValidateMode]),G.useEffect(()=>{e.errors&&(u._setErrors(e.errors),u._focusError())},[u,e.errors]),G.useEffect(()=>{e.shouldUnregister&&u._subjects.state.next({values:u._getWatch()})},[u,e.shouldUnregister]),G.useEffect(()=>{if(u._proxyFormState.isDirty){const d=u._getDirty();d!==s.isDirty&&u._subjects.state.next({isDirty:d})}},[u,s.isDirty]),G.useEffect(()=>{e.values&&!br(e.values,r.current)?(u._reset(e.values,{keepFieldsRef:!0,...u._options.resetOptions}),r.current=e.values,o(d=>({...d}))):u._resetDefaultValues()},[u,e.values]),G.useEffect(()=>{u._state.mount||(u._setValid(),u._state.mount=!0),u._state.watch&&(u._state.watch=!1,u._subjects.state.next({...u._formState})),u._removeUnmounted()}),n.current.formState=_1(s,u),n.current}const x0=(e,n,r)=>{if(e&&"reportValidity"in e){const s=me(r,n);e.setCustomValidity(s&&s.message||""),e.reportValidity()}},Fm=(e,n)=>{for(const r in n.fields){const s=n.fields[r];s&&s.ref&&"reportValidity"in s.ref?x0(s.ref,r,e):s&&s.refs&&s.refs.forEach(o=>x0(o,r,e))}},w0=(e,n)=>{n.shouldUseNativeValidation&&Fm(e,n);const r={};for(const s in e){const o=me(n.fields,s),u=Object.assign(e[s]||{},{ref:o&&o.ref});if(W4(n.names||Object.keys(e),s)){const d=Object.assign({},me(r,s));ht(d,"root",u),ht(r,s,d)}else ht(r,s,u)}return r},W4=(e,n)=>{const r=S0(n);return e.some(s=>S0(s).match(`^${r}\\.\\d+`))};function S0(e){return e.replace(/\]|\[/g,"")}function ee(e,n,r){function s(m,p){var g;Object.defineProperty(m,"_zod",{value:m._zod??{},enumerable:!1}),(g=m._zod).traits??(g.traits=new Set),m._zod.traits.add(e),n(m,p);for(const x in d.prototype)x in m||Object.defineProperty(m,x,{value:d.prototype[x].bind(m)});m._zod.constr=d,m._zod.def=p}const o=r?.Parent??Object;class u extends o{}Object.defineProperty(u,"name",{value:e});function d(m){var p;const g=r?.Parent?new u:this;s(g,m),(p=g._zod).deferred??(p.deferred=[]);for(const x of g._zod.deferred)x();return g}return Object.defineProperty(d,"init",{value:s}),Object.defineProperty(d,Symbol.hasInstance,{value:m=>r?.Parent&&m instanceof r.Parent?!0:m?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}class Xs extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class D1 extends Error{constructor(n){super(`Encountered unidirectional transform during encode: ${n}`),this.name="ZodEncodeError"}}const z1={};function Hi(e){return z1}function ek(e){const n=Object.values(e).filter(s=>typeof s=="number");return Object.entries(e).filter(([s,o])=>n.indexOf(+s)===-1).map(([s,o])=>o)}function Zm(e,n){return typeof n=="bigint"?n.toString():n}function $p(e){return{get value(){{const n=e();return Object.defineProperty(this,"value",{value:n}),n}}}}function Gp(e){return e==null}function Xp(e){const n=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(n,r)}function tk(e,n){const r=(e.toString().split(".")[1]||"").length,s=n.toString();let o=(s.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(s)){const p=s.match(/\d?e-(\d?)/);p?.[1]&&(o=Number.parseInt(p[1]))}const u=r>o?r:o,d=Number.parseInt(e.toFixed(u).replace(".","")),m=Number.parseInt(n.toFixed(u).replace(".",""));return d%m/10**u}const _0=Symbol("evaluating");function xt(e,n,r){let s;Object.defineProperty(e,n,{get(){if(s!==_0)return s===void 0&&(s=_0,s=r()),s},set(o){Object.defineProperty(e,n,{value:o})},configurable:!0})}function $i(e,n,r){Object.defineProperty(e,n,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Gi(...e){const n={};for(const r of e){const s=Object.getOwnPropertyDescriptors(r);Object.assign(n,s)}return Object.defineProperties({},n)}function E0(e){return JSON.stringify(e)}const M1="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ju(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const nk=$p(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Nl(e){if(Ju(e)===!1)return!1;const n=e.constructor;if(n===void 0)return!0;const r=n.prototype;return!(Ju(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function k1(e){return Nl(e)?{...e}:Array.isArray(e)?[...e]:e}const ak=new Set(["string","number","symbol"]);function no(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function li(e,n,r){const s=new e._zod.constr(n??e._zod.def);return(!n||r?.parent)&&(s._zod.parent=e),s}function Re(e){const n=e;if(!n)return{};if(typeof n=="string")return{error:()=>n};if(n?.message!==void 0){if(n?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");n.error=n.message}return delete n.message,typeof n.error=="string"?{...n,error:()=>n.error}:n}function rk(e){return Object.keys(e).filter(n=>e[n]._zod.optin==="optional"&&e[n]._zod.optout==="optional")}const ik={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function sk(e,n){const r=e._zod.def,s=Gi(e._zod.def,{get shape(){const o={};for(const u in n){if(!(u in r.shape))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(o[u]=r.shape[u])}return $i(this,"shape",o),o},checks:[]});return li(e,s)}function ok(e,n){const r=e._zod.def,s=Gi(e._zod.def,{get shape(){const o={...e._zod.def.shape};for(const u in n){if(!(u in r.shape))throw new Error(`Unrecognized key: "${u}"`);n[u]&&delete o[u]}return $i(this,"shape",o),o},checks:[]});return li(e,s)}function lk(e,n){if(!Nl(n))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const o=Gi(e._zod.def,{get shape(){const u={...e._zod.def.shape,...n};return $i(this,"shape",u),u},checks:[]});return li(e,o)}function ck(e,n){if(!Nl(n))throw new Error("Invalid input to safeExtend: expected a plain object");const r={...e._zod.def,get shape(){const s={...e._zod.def.shape,...n};return $i(this,"shape",s),s},checks:e._zod.def.checks};return li(e,r)}function uk(e,n){const r=Gi(e._zod.def,{get shape(){const s={...e._zod.def.shape,...n._zod.def.shape};return $i(this,"shape",s),s},get catchall(){return n._zod.def.catchall},checks:[]});return li(e,r)}function dk(e,n,r){const s=Gi(n._zod.def,{get shape(){const o=n._zod.def.shape,u={...o};if(r)for(const d in r){if(!(d in o))throw new Error(`Unrecognized key: "${d}"`);r[d]&&(u[d]=e?new e({type:"optional",innerType:o[d]}):o[d])}else for(const d in o)u[d]=e?new e({type:"optional",innerType:o[d]}):o[d];return $i(this,"shape",u),u},checks:[]});return li(n,s)}function fk(e,n,r){const s=Gi(n._zod.def,{get shape(){const o=n._zod.def.shape,u={...o};if(r)for(const d in r){if(!(d in u))throw new Error(`Unrecognized key: "${d}"`);r[d]&&(u[d]=new e({type:"nonoptional",innerType:o[d]}))}else for(const d in o)u[d]=new e({type:"nonoptional",innerType:o[d]});return $i(this,"shape",u),u},checks:[]});return li(n,s)}function Zs(e,n=0){if(e.aborted===!0)return!0;for(let r=n;r{var s;return(s=r).path??(s.path=[]),r.path.unshift(e),r})}function Cu(e){return typeof e=="string"?e:e?.message}function Vi(e,n,r){const s={...e,path:e.path??[]};if(!e.message){const o=Cu(e.inst?._zod.def?.error?.(e))??Cu(n?.error?.(e))??Cu(r.customError?.(e))??Cu(r.localeError?.(e))??"Invalid input";s.message=o}return delete s.inst,delete s.continue,n?.reportInput||delete s.input,s}function Yp(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Dl(...e){const[n,r,s]=e;return typeof n=="string"?{message:n,code:"custom",input:r,inst:s}:{...n}}const U1=(e,n)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:n,enumerable:!1}),e.message=JSON.stringify(n,Zm,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Qp=ee("$ZodError",U1),Cd=ee("$ZodError",U1,{Parent:Error});function hk(e,n=r=>r.message){const r={},s=[];for(const o of e.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(n(o))):s.push(n(o));return{formErrors:s,fieldErrors:r}}function mk(e,n=r=>r.message){const r={_errors:[]},s=o=>{for(const u of o.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(d=>s({issues:d}));else if(u.code==="invalid_key")s({issues:u.issues});else if(u.code==="invalid_element")s({issues:u.issues});else if(u.path.length===0)r._errors.push(n(u));else{let d=r,m=0;for(;m(n,r,s,o)=>{const u=s?Object.assign(s,{async:!1}):{async:!1},d=n._zod.run({value:r,issues:[]},u);if(d instanceof Promise)throw new Xs;if(d.issues.length){const m=new(o?.Err??e)(d.issues.map(p=>Vi(p,u,Hi())));throw M1(m,o?.callee),m}return d.value},pk=jd(Cd),Ad=e=>async(n,r,s,o)=>{const u=s?Object.assign(s,{async:!0}):{async:!0};let d=n._zod.run({value:r,issues:[]},u);if(d instanceof Promise&&(d=await d),d.issues.length){const m=new(o?.Err??e)(d.issues.map(p=>Vi(p,u,Hi())));throw M1(m,o?.callee),m}return d.value},gk=Ad(Cd),Od=e=>(n,r,s)=>{const o=s?{...s,async:!1}:{async:!1},u=n._zod.run({value:r,issues:[]},o);if(u instanceof Promise)throw new Xs;return u.issues.length?{success:!1,error:new(e??Qp)(u.issues.map(d=>Vi(d,o,Hi())))}:{success:!0,data:u.value}},vk=Od(Cd),Td=e=>async(n,r,s)=>{const o=s?Object.assign(s,{async:!0}):{async:!0};let u=n._zod.run({value:r,issues:[]},o);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(d=>Vi(d,o,Hi())))}:{success:!0,data:u.value}},yk=Td(Cd),bk=e=>(n,r,s)=>{const o=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return jd(e)(n,r,o)},xk=e=>(n,r,s)=>jd(e)(n,r,s),wk=e=>async(n,r,s)=>{const o=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return Ad(e)(n,r,o)},Sk=e=>async(n,r,s)=>Ad(e)(n,r,s),_k=e=>(n,r,s)=>{const o=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return Od(e)(n,r,o)},Ek=e=>(n,r,s)=>Od(e)(n,r,s),Ck=e=>async(n,r,s)=>{const o=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return Td(e)(n,r,o)},jk=e=>async(n,r,s)=>Td(e)(n,r,s),Ak=/^[cC][^\s-]{8,}$/,Ok=/^[0-9a-z]+$/,Tk=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Rk=/^[0-9a-vA-V]{20}$/,Nk=/^[A-Za-z0-9]{27}$/,Dk=/^[a-zA-Z0-9_-]{21}$/,zk=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Mk=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,C0=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,kk=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Lk="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Uk(){return new RegExp(Lk,"u")}const Kk=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,qk=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Pk=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Ik=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Hk=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,K1=/^[A-Za-z0-9_-]*$/,Vk=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Bk=/^\+(?:[0-9]){6,14}[0-9]$/,q1="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Fk=new RegExp(`^${q1}$`);function P1(e){const n="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${n}`:e.precision===0?`${n}:[0-5]\\d`:`${n}:[0-5]\\d\\.\\d{${e.precision}}`:`${n}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Zk(e){return new RegExp(`^${P1(e)}$`)}function $k(e){const n=P1({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const s=`${n}(?:${r.join("|")})`;return new RegExp(`^${q1}T(?:${s})$`)}const Gk=e=>{const n=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${n}$`)},Xk=/^-?\d+$/,Yk=/^-?\d+(?:\.\d+)?/,Qk=/^[^A-Z]*$/,Jk=/^[^a-z]*$/,In=ee("$ZodCheck",(e,n)=>{var r;e._zod??(e._zod={}),e._zod.def=n,(r=e._zod).onattach??(r.onattach=[])}),I1={number:"number",bigint:"bigint",object:"date"},H1=ee("$ZodCheckLessThan",(e,n)=>{In.init(e,n);const r=I1[typeof n.value];e._zod.onattach.push(s=>{const o=s._zod.bag,u=(n.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;n.value{(n.inclusive?s.value<=n.value:s.value{In.init(e,n);const r=I1[typeof n.value];e._zod.onattach.push(s=>{const o=s._zod.bag,u=(n.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;n.value>u&&(n.inclusive?o.minimum=n.value:o.exclusiveMinimum=n.value)}),e._zod.check=s=>{(n.inclusive?s.value>=n.value:s.value>n.value)||s.issues.push({origin:r,code:"too_small",minimum:n.value,input:s.value,inclusive:n.inclusive,inst:e,continue:!n.abort})}}),Wk=ee("$ZodCheckMultipleOf",(e,n)=>{In.init(e,n),e._zod.onattach.push(r=>{var s;(s=r._zod.bag).multipleOf??(s.multipleOf=n.value)}),e._zod.check=r=>{if(typeof r.value!=typeof n.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%n.value===BigInt(0):tk(r.value,n.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:n.value,input:r.value,inst:e,continue:!n.abort})}}),e3=ee("$ZodCheckNumberFormat",(e,n)=>{In.init(e,n),n.format=n.format||"float64";const r=n.format?.includes("int"),s=r?"int":"number",[o,u]=ik[n.format];e._zod.onattach.push(d=>{const m=d._zod.bag;m.format=n.format,m.minimum=o,m.maximum=u,r&&(m.pattern=Xk)}),e._zod.check=d=>{const m=d.value;if(r){if(!Number.isInteger(m)){d.issues.push({expected:s,format:n.format,code:"invalid_type",continue:!1,input:m,inst:e});return}if(!Number.isSafeInteger(m)){m>0?d.issues.push({input:m,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:s,continue:!n.abort}):d.issues.push({input:m,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:s,continue:!n.abort});return}}mu&&d.issues.push({origin:"number",input:m,code:"too_big",maximum:u,inst:e})}}),t3=ee("$ZodCheckMaxLength",(e,n)=>{var r;In.init(e,n),(r=e._zod.def).when??(r.when=s=>{const o=s.value;return!Gp(o)&&o.length!==void 0}),e._zod.onattach.push(s=>{const o=s._zod.bag.maximum??Number.POSITIVE_INFINITY;n.maximum{const o=s.value;if(o.length<=n.maximum)return;const d=Yp(o);s.issues.push({origin:d,code:"too_big",maximum:n.maximum,inclusive:!0,input:o,inst:e,continue:!n.abort})}}),n3=ee("$ZodCheckMinLength",(e,n)=>{var r;In.init(e,n),(r=e._zod.def).when??(r.when=s=>{const o=s.value;return!Gp(o)&&o.length!==void 0}),e._zod.onattach.push(s=>{const o=s._zod.bag.minimum??Number.NEGATIVE_INFINITY;n.minimum>o&&(s._zod.bag.minimum=n.minimum)}),e._zod.check=s=>{const o=s.value;if(o.length>=n.minimum)return;const d=Yp(o);s.issues.push({origin:d,code:"too_small",minimum:n.minimum,inclusive:!0,input:o,inst:e,continue:!n.abort})}}),a3=ee("$ZodCheckLengthEquals",(e,n)=>{var r;In.init(e,n),(r=e._zod.def).when??(r.when=s=>{const o=s.value;return!Gp(o)&&o.length!==void 0}),e._zod.onattach.push(s=>{const o=s._zod.bag;o.minimum=n.length,o.maximum=n.length,o.length=n.length}),e._zod.check=s=>{const o=s.value,u=o.length;if(u===n.length)return;const d=Yp(o),m=u>n.length;s.issues.push({origin:d,...m?{code:"too_big",maximum:n.length}:{code:"too_small",minimum:n.length},inclusive:!0,exact:!0,input:s.value,inst:e,continue:!n.abort})}}),Rd=ee("$ZodCheckStringFormat",(e,n)=>{var r,s;In.init(e,n),e._zod.onattach.push(o=>{const u=o._zod.bag;u.format=n.format,n.pattern&&(u.patterns??(u.patterns=new Set),u.patterns.add(n.pattern))}),n.pattern?(r=e._zod).check??(r.check=o=>{n.pattern.lastIndex=0,!n.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:n.format,input:o.value,...n.pattern?{pattern:n.pattern.toString()}:{},inst:e,continue:!n.abort})}):(s=e._zod).check??(s.check=()=>{})}),r3=ee("$ZodCheckRegex",(e,n)=>{Rd.init(e,n),e._zod.check=r=>{n.pattern.lastIndex=0,!n.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:n.pattern.toString(),inst:e,continue:!n.abort})}}),i3=ee("$ZodCheckLowerCase",(e,n)=>{n.pattern??(n.pattern=Qk),Rd.init(e,n)}),s3=ee("$ZodCheckUpperCase",(e,n)=>{n.pattern??(n.pattern=Jk),Rd.init(e,n)}),o3=ee("$ZodCheckIncludes",(e,n)=>{In.init(e,n);const r=no(n.includes),s=new RegExp(typeof n.position=="number"?`^.{${n.position}}${r}`:r);n.pattern=s,e._zod.onattach.push(o=>{const u=o._zod.bag;u.patterns??(u.patterns=new Set),u.patterns.add(s)}),e._zod.check=o=>{o.value.includes(n.includes,n.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:n.includes,input:o.value,inst:e,continue:!n.abort})}}),l3=ee("$ZodCheckStartsWith",(e,n)=>{In.init(e,n);const r=new RegExp(`^${no(n.prefix)}.*`);n.pattern??(n.pattern=r),e._zod.onattach.push(s=>{const o=s._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=s=>{s.value.startsWith(n.prefix)||s.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:n.prefix,input:s.value,inst:e,continue:!n.abort})}}),c3=ee("$ZodCheckEndsWith",(e,n)=>{In.init(e,n);const r=new RegExp(`.*${no(n.suffix)}$`);n.pattern??(n.pattern=r),e._zod.onattach.push(s=>{const o=s._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=s=>{s.value.endsWith(n.suffix)||s.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:n.suffix,input:s.value,inst:e,continue:!n.abort})}}),u3=ee("$ZodCheckOverwrite",(e,n)=>{In.init(e,n),e._zod.check=r=>{r.value=n.tx(r.value)}});class d3{constructor(n=[]){this.content=[],this.indent=0,this&&(this.args=n)}indented(n){this.indent+=1,n(this),this.indent-=1}write(n){if(typeof n=="function"){n(this,{execution:"sync"}),n(this,{execution:"async"});return}const s=n.split(` `).filter(d=>d),o=Math.min(...s.map(d=>d.length-d.trimStart().length)),u=s.map(d=>d.slice(o)).map(d=>" ".repeat(this.indent*2)+d);for(const d of u)this.content.push(d)}compile(){const n=Function,r=this?.args,o=[...(this?.content??[""]).map(u=>` ${u}`)];return new n(...r,o.join(` `))}}const f3={major:4,minor:1,patch:12},Kt=ee("$ZodType",(e,n)=>{var r;e??(e={}),e._zod.def=n,e._zod.bag=e._zod.bag||{},e._zod.version=f3;const s=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&s.unshift(e);for(const o of s)for(const u of o._zod.onattach)u(e);if(s.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(d,m,p)=>{let g=Zs(d),x;for(const v of m){if(v._zod.def.when){if(!v._zod.def.when(d))continue}else if(g)continue;const w=d.issues.length,E=v._zod.check(d);if(E instanceof Promise&&p?.async===!1)throw new Xs;if(x||E instanceof Promise)x=(x??Promise.resolve()).then(async()=>{await E,d.issues.length!==w&&(g||(g=Zs(d,w)))});else{if(d.issues.length===w)continue;g||(g=Zs(d,w))}}return x?x.then(()=>d):d},u=(d,m,p)=>{if(Zs(d))return d.aborted=!0,d;const g=o(m,s,p);if(g instanceof Promise){if(p.async===!1)throw new Xs;return g.then(x=>e._zod.parse(x,p))}return e._zod.parse(g,p)};e._zod.run=(d,m)=>{if(m.skipChecks)return e._zod.parse(d,m);if(m.direction==="backward"){const g=e._zod.parse({value:d.value,issues:[]},{...m,skipChecks:!0});return g instanceof Promise?g.then(x=>u(x,d,m)):u(g,d,m)}const p=e._zod.parse(d,m);if(p instanceof Promise){if(m.async===!1)throw new Xs;return p.then(g=>o(g,s,m))}return o(p,s,m)}}e["~standard"]={validate:o=>{try{const u=vk(e,o);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return yk(e,o).then(d=>d.success?{value:d.data}:{issues:d.error?.issues})}},vendor:"zod",version:1}}),Jp=ee("$ZodString",(e,n)=>{Kt.init(e,n),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Gk(e._zod.bag),e._zod.parse=(r,s)=>{if(n.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),Ct=ee("$ZodStringFormat",(e,n)=>{Rd.init(e,n),Jp.init(e,n)}),h3=ee("$ZodGUID",(e,n)=>{n.pattern??(n.pattern=Mk),Ct.init(e,n)}),m3=ee("$ZodUUID",(e,n)=>{if(n.version){const s={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[n.version];if(s===void 0)throw new Error(`Invalid UUID version: "${n.version}"`);n.pattern??(n.pattern=C0(s))}else n.pattern??(n.pattern=C0());Ct.init(e,n)}),p3=ee("$ZodEmail",(e,n)=>{n.pattern??(n.pattern=kk),Ct.init(e,n)}),g3=ee("$ZodURL",(e,n)=>{Ct.init(e,n),e._zod.check=r=>{try{const s=r.value.trim(),o=new URL(s);n.hostname&&(n.hostname.lastIndex=0,n.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:Vk.source,input:r.value,inst:e,continue:!n.abort})),n.protocol&&(n.protocol.lastIndex=0,n.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:n.protocol.source,input:r.value,inst:e,continue:!n.abort})),n.normalize?r.value=o.href:r.value=s;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!n.abort})}}}),v3=ee("$ZodEmoji",(e,n)=>{n.pattern??(n.pattern=Uk()),Ct.init(e,n)}),y3=ee("$ZodNanoID",(e,n)=>{n.pattern??(n.pattern=Dk),Ct.init(e,n)}),b3=ee("$ZodCUID",(e,n)=>{n.pattern??(n.pattern=Ak),Ct.init(e,n)}),x3=ee("$ZodCUID2",(e,n)=>{n.pattern??(n.pattern=Ok),Ct.init(e,n)}),w3=ee("$ZodULID",(e,n)=>{n.pattern??(n.pattern=Tk),Ct.init(e,n)}),S3=ee("$ZodXID",(e,n)=>{n.pattern??(n.pattern=Rk),Ct.init(e,n)}),_3=ee("$ZodKSUID",(e,n)=>{n.pattern??(n.pattern=Nk),Ct.init(e,n)}),E3=ee("$ZodISODateTime",(e,n)=>{n.pattern??(n.pattern=$k(n)),Ct.init(e,n)}),C3=ee("$ZodISODate",(e,n)=>{n.pattern??(n.pattern=Fk),Ct.init(e,n)}),j3=ee("$ZodISOTime",(e,n)=>{n.pattern??(n.pattern=Zk(n)),Ct.init(e,n)}),A3=ee("$ZodISODuration",(e,n)=>{n.pattern??(n.pattern=zk),Ct.init(e,n)}),O3=ee("$ZodIPv4",(e,n)=>{n.pattern??(n.pattern=Kk),Ct.init(e,n),e._zod.onattach.push(r=>{const s=r._zod.bag;s.format="ipv4"})}),T3=ee("$ZodIPv6",(e,n)=>{n.pattern??(n.pattern=qk),Ct.init(e,n),e._zod.onattach.push(r=>{const s=r._zod.bag;s.format="ipv6"}),e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!n.abort})}}}),R3=ee("$ZodCIDRv4",(e,n)=>{n.pattern??(n.pattern=Pk),Ct.init(e,n)}),N3=ee("$ZodCIDRv6",(e,n)=>{n.pattern??(n.pattern=Ik),Ct.init(e,n),e._zod.check=r=>{const s=r.value.split("/");try{if(s.length!==2)throw new Error;const[o,u]=s;if(!u)throw new Error;const d=Number(u);if(`${d}`!==u)throw new Error;if(d<0||d>128)throw new Error;new URL(`http://[${o}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!n.abort})}}});function B1(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const D3=ee("$ZodBase64",(e,n)=>{n.pattern??(n.pattern=Hk),Ct.init(e,n),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),e._zod.check=r=>{B1(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!n.abort})}});function z3(e){if(!K1.test(e))return!1;const n=e.replace(/[-_]/g,s=>s==="-"?"+":"/"),r=n.padEnd(Math.ceil(n.length/4)*4,"=");return B1(r)}const M3=ee("$ZodBase64URL",(e,n)=>{n.pattern??(n.pattern=K1),Ct.init(e,n),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),e._zod.check=r=>{z3(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!n.abort})}}),k3=ee("$ZodE164",(e,n)=>{n.pattern??(n.pattern=Bk),Ct.init(e,n)});function L3(e,n=null){try{const r=e.split(".");if(r.length!==3)return!1;const[s]=r;if(!s)return!1;const o=JSON.parse(atob(s));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||n&&(!("alg"in o)||o.alg!==n))}catch{return!1}}const U3=ee("$ZodJWT",(e,n)=>{Ct.init(e,n),e._zod.check=r=>{L3(r.value,n.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!n.abort})}}),F1=ee("$ZodNumber",(e,n)=>{Kt.init(e,n),e._zod.pattern=e._zod.bag.pattern??Yk,e._zod.parse=(r,s)=>{if(n.coerce)try{r.value=Number(r.value)}catch{}const o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;const u=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...u?{received:u}:{}}),r}}),K3=ee("$ZodNumber",(e,n)=>{e3.init(e,n),F1.init(e,n)}),q3=ee("$ZodUnknown",(e,n)=>{Kt.init(e,n),e._zod.parse=r=>r}),P3=ee("$ZodNever",(e,n)=>{Kt.init(e,n),e._zod.parse=(r,s)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function j0(e,n,r){e.issues.length&&n.issues.push(...L1(r,e.issues)),n.value[r]=e.value}const I3=ee("$ZodArray",(e,n)=>{Kt.init(e,n),e._zod.parse=(r,s)=>{const o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);const u=[];for(let d=0;dj0(g,r,d))):j0(p,r,d)}return u.length?Promise.all(u).then(()=>r):r}});function Wu(e,n,r,s){e.issues.length&&n.issues.push(...L1(r,e.issues)),e.value===void 0?r in s&&(n.value[r]=void 0):n.value[r]=e.value}function Z1(e){const n=Object.keys(e.shape);for(const s of n)if(!e.shape?.[s]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${s}": expected a Zod schema`);const r=rk(e.shape);return{...e,keys:n,keySet:new Set(n),numKeys:n.length,optionalKeys:new Set(r)}}function $1(e,n,r,s,o,u){const d=[],m=o.keySet,p=o.catchall._zod,g=p.def.type;for(const x of Object.keys(n)){if(m.has(x))continue;if(g==="never"){d.push(x);continue}const v=p.run({value:n[x],issues:[]},s);v instanceof Promise?e.push(v.then(w=>Wu(w,r,x,n))):Wu(v,r,x,n)}return d.length&&r.issues.push({code:"unrecognized_keys",keys:d,input:n,inst:u}),e.length?Promise.all(e).then(()=>r):r}const H3=ee("$ZodObject",(e,n)=>{if(Kt.init(e,n),!Object.getOwnPropertyDescriptor(n,"shape")?.get){const m=n.shape;Object.defineProperty(n,"shape",{get:()=>{const p={...m};return Object.defineProperty(n,"shape",{value:p}),p}})}const s=$p(()=>Z1(n));xt(e._zod,"propValues",()=>{const m=n.shape,p={};for(const g in m){const x=m[g]._zod;if(x.values){p[g]??(p[g]=new Set);for(const v of x.values)p[g].add(v)}}return p});const o=Ju,u=n.catchall;let d;e._zod.parse=(m,p)=>{d??(d=s.value);const g=m.value;if(!o(g))return m.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),m;m.value={};const x=[],v=d.shape;for(const w of d.keys){const A=v[w]._zod.run({value:g[w],issues:[]},p);A instanceof Promise?x.push(A.then(S=>Wu(S,m,w,g))):Wu(A,m,w,g)}return u?$1(x,g,m,p,s.value,e):x.length?Promise.all(x).then(()=>m):m}}),V3=ee("$ZodObjectJIT",(e,n)=>{H3.init(e,n);const r=e._zod.parse,s=$p(()=>Z1(n)),o=w=>{const E=new d3(["shape","payload","ctx"]),A=s.value,S=O=>{const j=E0(O);return`shape[${j}]._zod.run({ value: input[${j}], issues: [] }, ctx)`};E.write("const input = payload.value;");const T=Object.create(null);let z=0;for(const O of A.keys)T[O]=`key_${z++}`;E.write("const newResult = {};");for(const O of A.keys){const j=T[O],N=E0(O);E.write(`const ${j} = ${S(O)};`),E.write(` if (${j}.issues.length) { payload.issues = payload.issues.concat(${j}.issues.map(iss => ({ ...iss, path: iss.path ? [${N}, ...iss.path] : [${N}] }))); } if (${j}.value === undefined) { if (${N} in input) { newResult[${N}] = undefined; } } else { newResult[${N}] = ${j}.value; } `)}E.write("payload.value = newResult;"),E.write("return payload;");const R=E.compile();return(O,j)=>R(w,O,j)};let u;const d=Ju,m=!z1.jitless,g=m&&nk.value,x=n.catchall;let v;e._zod.parse=(w,E)=>{v??(v=s.value);const A=w.value;return d(A)?m&&g&&E?.async===!1&&E.jitless!==!0?(u||(u=o(n.shape)),w=u(w,E),x?$1([],A,w,E,v,e):w):r(w,E):(w.issues.push({expected:"object",code:"invalid_type",input:A,inst:e}),w)}});function A0(e,n,r,s){for(const u of e)if(u.issues.length===0)return n.value=u.value,n;const o=e.filter(u=>!Zs(u));return o.length===1?(n.value=o[0].value,o[0]):(n.issues.push({code:"invalid_union",input:n.value,inst:r,errors:e.map(u=>u.issues.map(d=>Vi(d,s,Hi())))}),n)}const B3=ee("$ZodUnion",(e,n)=>{Kt.init(e,n),xt(e._zod,"optin",()=>n.options.some(o=>o._zod.optin==="optional")?"optional":void 0),xt(e._zod,"optout",()=>n.options.some(o=>o._zod.optout==="optional")?"optional":void 0),xt(e._zod,"values",()=>{if(n.options.every(o=>o._zod.values))return new Set(n.options.flatMap(o=>Array.from(o._zod.values)))}),xt(e._zod,"pattern",()=>{if(n.options.every(o=>o._zod.pattern)){const o=n.options.map(u=>u._zod.pattern);return new RegExp(`^(${o.map(u=>Xp(u.source)).join("|")})$`)}});const r=n.options.length===1,s=n.options[0]._zod.run;e._zod.parse=(o,u)=>{if(r)return s(o,u);let d=!1;const m=[];for(const p of n.options){const g=p._zod.run({value:o.value,issues:[]},u);if(g instanceof Promise)m.push(g),d=!0;else{if(g.issues.length===0)return g;m.push(g)}}return d?Promise.all(m).then(p=>A0(p,o,e,u)):A0(m,o,e,u)}}),F3=ee("$ZodIntersection",(e,n)=>{Kt.init(e,n),e._zod.parse=(r,s)=>{const o=r.value,u=n.left._zod.run({value:o,issues:[]},s),d=n.right._zod.run({value:o,issues:[]},s);return u instanceof Promise||d instanceof Promise?Promise.all([u,d]).then(([p,g])=>O0(r,p,g)):O0(r,u,d)}});function $m(e,n){if(e===n)return{valid:!0,data:e};if(e instanceof Date&&n instanceof Date&&+e==+n)return{valid:!0,data:e};if(Nl(e)&&Nl(n)){const r=Object.keys(n),s=Object.keys(e).filter(u=>r.indexOf(u)!==-1),o={...e,...n};for(const u of s){const d=$m(e[u],n[u]);if(!d.valid)return{valid:!1,mergeErrorPath:[u,...d.mergeErrorPath]};o[u]=d.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let s=0;s{Kt.init(e,n);const r=ek(n.entries),s=new Set(r);e._zod.values=s,e._zod.pattern=new RegExp(`^(${r.filter(o=>ak.has(typeof o)).map(o=>typeof o=="string"?no(o):o.toString()).join("|")})$`),e._zod.parse=(o,u)=>{const d=o.value;return s.has(d)||o.issues.push({code:"invalid_value",values:r,input:d,inst:e}),o}}),$3=ee("$ZodLiteral",(e,n)=>{if(Kt.init(e,n),n.values.length===0)throw new Error("Cannot create literal schema with no valid values");e._zod.values=new Set(n.values),e._zod.pattern=new RegExp(`^(${n.values.map(r=>typeof r=="string"?no(r):r?no(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,s)=>{const o=r.value;return e._zod.values.has(o)||r.issues.push({code:"invalid_value",values:n.values,input:o,inst:e}),r}}),G3=ee("$ZodTransform",(e,n)=>{Kt.init(e,n),e._zod.parse=(r,s)=>{if(s.direction==="backward")throw new D1(e.constructor.name);const o=n.transform(r.value,r);if(s.async)return(o instanceof Promise?o:Promise.resolve(o)).then(d=>(r.value=d,r));if(o instanceof Promise)throw new Xs;return r.value=o,r}});function T0(e,n){return e.issues.length&&n===void 0?{issues:[],value:void 0}:e}const X3=ee("$ZodOptional",(e,n)=>{Kt.init(e,n),e._zod.optin="optional",e._zod.optout="optional",xt(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,void 0]):void 0),xt(e._zod,"pattern",()=>{const r=n.innerType._zod.pattern;return r?new RegExp(`^(${Xp(r.source)})?$`):void 0}),e._zod.parse=(r,s)=>{if(n.innerType._zod.optin==="optional"){const o=n.innerType._zod.run(r,s);return o instanceof Promise?o.then(u=>T0(u,r.value)):T0(o,r.value)}return r.value===void 0?r:n.innerType._zod.run(r,s)}}),Y3=ee("$ZodNullable",(e,n)=>{Kt.init(e,n),xt(e._zod,"optin",()=>n.innerType._zod.optin),xt(e._zod,"optout",()=>n.innerType._zod.optout),xt(e._zod,"pattern",()=>{const r=n.innerType._zod.pattern;return r?new RegExp(`^(${Xp(r.source)}|null)$`):void 0}),xt(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,null]):void 0),e._zod.parse=(r,s)=>r.value===null?r:n.innerType._zod.run(r,s)}),Q3=ee("$ZodDefault",(e,n)=>{Kt.init(e,n),e._zod.optin="optional",xt(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(r,s)=>{if(s.direction==="backward")return n.innerType._zod.run(r,s);if(r.value===void 0)return r.value=n.defaultValue,r;const o=n.innerType._zod.run(r,s);return o instanceof Promise?o.then(u=>R0(u,n)):R0(o,n)}});function R0(e,n){return e.value===void 0&&(e.value=n.defaultValue),e}const J3=ee("$ZodPrefault",(e,n)=>{Kt.init(e,n),e._zod.optin="optional",xt(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(r,s)=>(s.direction==="backward"||r.value===void 0&&(r.value=n.defaultValue),n.innerType._zod.run(r,s))}),W3=ee("$ZodNonOptional",(e,n)=>{Kt.init(e,n),xt(e._zod,"values",()=>{const r=n.innerType._zod.values;return r?new Set([...r].filter(s=>s!==void 0)):void 0}),e._zod.parse=(r,s)=>{const o=n.innerType._zod.run(r,s);return o instanceof Promise?o.then(u=>N0(u,e)):N0(o,e)}});function N0(e,n){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:n}),e}const e5=ee("$ZodCatch",(e,n)=>{Kt.init(e,n),xt(e._zod,"optin",()=>n.innerType._zod.optin),xt(e._zod,"optout",()=>n.innerType._zod.optout),xt(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(r,s)=>{if(s.direction==="backward")return n.innerType._zod.run(r,s);const o=n.innerType._zod.run(r,s);return o instanceof Promise?o.then(u=>(r.value=u.value,u.issues.length&&(r.value=n.catchValue({...r,error:{issues:u.issues.map(d=>Vi(d,s,Hi()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=n.catchValue({...r,error:{issues:o.issues.map(u=>Vi(u,s,Hi()))},input:r.value}),r.issues=[]),r)}}),t5=ee("$ZodPipe",(e,n)=>{Kt.init(e,n),xt(e._zod,"values",()=>n.in._zod.values),xt(e._zod,"optin",()=>n.in._zod.optin),xt(e._zod,"optout",()=>n.out._zod.optout),xt(e._zod,"propValues",()=>n.in._zod.propValues),e._zod.parse=(r,s)=>{if(s.direction==="backward"){const u=n.out._zod.run(r,s);return u instanceof Promise?u.then(d=>ju(d,n.in,s)):ju(u,n.in,s)}const o=n.in._zod.run(r,s);return o instanceof Promise?o.then(u=>ju(u,n.out,s)):ju(o,n.out,s)}});function ju(e,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:e.value,issues:e.issues},r)}const n5=ee("$ZodReadonly",(e,n)=>{Kt.init(e,n),xt(e._zod,"propValues",()=>n.innerType._zod.propValues),xt(e._zod,"values",()=>n.innerType._zod.values),xt(e._zod,"optin",()=>n.innerType._zod.optin),xt(e._zod,"optout",()=>n.innerType._zod.optout),e._zod.parse=(r,s)=>{if(s.direction==="backward")return n.innerType._zod.run(r,s);const o=n.innerType._zod.run(r,s);return o instanceof Promise?o.then(D0):D0(o)}});function D0(e){return e.value=Object.freeze(e.value),e}const a5=ee("$ZodCustom",(e,n)=>{In.init(e,n),Kt.init(e,n),e._zod.parse=(r,s)=>r,e._zod.check=r=>{const s=r.value,o=n.fn(s);if(o instanceof Promise)return o.then(u=>z0(u,r,s,e));z0(o,r,s,e)}});function z0(e,n,r,s){if(!e){const o={code:"custom",input:r,inst:s,path:[...s._zod.def.path??[]],continue:!s._zod.def.abort};s._zod.def.params&&(o.params=s._zod.def.params),n.issues.push(Dl(o))}}class r5{constructor(){this._map=new WeakMap,this._idmap=new Map}add(n,...r){const s=r[0];if(this._map.set(n,s),s&&typeof s=="object"&&"id"in s){if(this._idmap.has(s.id))throw new Error(`ID ${s.id} already exists in the registry`);this._idmap.set(s.id,n)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(n){const r=this._map.get(n);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(n),this}get(n){const r=n._zod.parent;if(r){const s={...this.get(r)??{}};delete s.id;const o={...s,...this._map.get(n)};return Object.keys(o).length?o:void 0}return this._map.get(n)}has(n){return this._map.has(n)}}function i5(){return new r5}const Au=i5();function s5(e,n){return new e({type:"string",...Re(n)})}function o5(e,n){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Re(n)})}function M0(e,n){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Re(n)})}function G1(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Re(n)})}function l5(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Re(n)})}function c5(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Re(n)})}function u5(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Re(n)})}function d5(e,n){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Re(n)})}function f5(e,n){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Re(n)})}function h5(e,n){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Re(n)})}function m5(e,n){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Re(n)})}function p5(e,n){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Re(n)})}function g5(e,n){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Re(n)})}function v5(e,n){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Re(n)})}function y5(e,n){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Re(n)})}function b5(e,n){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Re(n)})}function x5(e,n){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Re(n)})}function w5(e,n){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Re(n)})}function S5(e,n){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Re(n)})}function _5(e,n){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Re(n)})}function E5(e,n){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Re(n)})}function C5(e,n){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Re(n)})}function j5(e,n){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Re(n)})}function A5(e,n){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Re(n)})}function O5(e,n){return new e({type:"string",format:"date",check:"string_format",...Re(n)})}function T5(e,n){return new e({type:"string",format:"time",check:"string_format",precision:null,...Re(n)})}function R5(e,n){return new e({type:"string",format:"duration",check:"string_format",...Re(n)})}function N5(e,n){return new e({type:"number",checks:[],...Re(n)})}function D5(e,n){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Re(n)})}function z5(e){return new e({type:"unknown"})}function M5(e,n){return new e({type:"never",...Re(n)})}function k0(e,n){return new H1({check:"less_than",...Re(n),value:e,inclusive:!1})}function vm(e,n){return new H1({check:"less_than",...Re(n),value:e,inclusive:!0})}function L0(e,n){return new V1({check:"greater_than",...Re(n),value:e,inclusive:!1})}function ym(e,n){return new V1({check:"greater_than",...Re(n),value:e,inclusive:!0})}function U0(e,n){return new Wk({check:"multiple_of",...Re(n),value:e})}function X1(e,n){return new t3({check:"max_length",...Re(n),maximum:e})}function ed(e,n){return new n3({check:"min_length",...Re(n),minimum:e})}function Y1(e,n){return new a3({check:"length_equals",...Re(n),length:e})}function k5(e,n){return new r3({check:"string_format",format:"regex",...Re(n),pattern:e})}function L5(e){return new i3({check:"string_format",format:"lowercase",...Re(e)})}function U5(e){return new s3({check:"string_format",format:"uppercase",...Re(e)})}function K5(e,n){return new o3({check:"string_format",format:"includes",...Re(n),includes:e})}function q5(e,n){return new l3({check:"string_format",format:"starts_with",...Re(n),prefix:e})}function P5(e,n){return new c3({check:"string_format",format:"ends_with",...Re(n),suffix:e})}function Il(e){return new u3({check:"overwrite",tx:e})}function I5(e){return Il(n=>n.normalize(e))}function H5(){return Il(e=>e.trim())}function V5(){return Il(e=>e.toLowerCase())}function B5(){return Il(e=>e.toUpperCase())}function F5(e,n,r){return new e({type:"array",element:n,...Re(r)})}function Z5(e,n,r){return new e({type:"custom",check:"custom",fn:n,...Re(r)})}function $5(e){const n=G5(r=>(r.addIssue=s=>{if(typeof s=="string")r.issues.push(Dl(s,r.value,n._zod.def));else{const o=s;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=n),o.continue??(o.continue=!n._zod.def.abort),r.issues.push(Dl(o))}},e(r.value,r)));return n}function G5(e,n){const r=new In({check:"custom",...Re(n)});return r._zod.check=e,r}function K0(e,n){try{var r=e()}catch(s){return n(s)}return r&&r.then?r.then(void 0,n):r}function X5(e,n){for(var r={};e.length;){var s=e[0],o=s.code,u=s.message,d=s.path.join(".");if(!r[d])if("unionErrors"in s){var m=s.unionErrors[0].errors[0];r[d]={message:m.message,type:m.code}}else r[d]={message:u,type:o};if("unionErrors"in s&&s.unionErrors.forEach(function(x){return x.errors.forEach(function(v){return e.push(v)})}),n){var p=r[d].types,g=p&&p[s.code];r[d]=Bp(d,n,r,o,g?[].concat(g,s.message):s.message)}e.shift()}return r}function Y5(e,n){for(var r={};e.length;){var s=e[0],o=s.code,u=s.message,d=s.path.join(".");if(!r[d])if(s.code==="invalid_union"&&s.errors.length>0){var m=s.errors[0][0];r[d]={message:m.message,type:m.code}}else r[d]={message:u,type:o};if(s.code==="invalid_union"&&s.errors.forEach(function(x){return x.forEach(function(v){return e.push(v)})}),n){var p=r[d].types,g=p&&p[s.code];r[d]=Bp(d,n,r,o,g?[].concat(g,s.message):s.message)}e.shift()}return r}function Sn(e,n,r){if(r===void 0&&(r={}),(function(s){return"_def"in s&&typeof s._def=="object"&&"typeName"in s._def})(e))return function(s,o,u){try{return Promise.resolve(K0(function(){return Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](s,n)).then(function(d){return u.shouldUseNativeValidation&&Fm({},u),{errors:{},values:r.raw?Object.assign({},s):d}})},function(d){if((function(m){return Array.isArray(m?.issues)})(d))return{values:{},errors:w0(X5(d.errors,!u.shouldUseNativeValidation&&u.criteriaMode==="all"),u)};throw d}))}catch(d){return Promise.reject(d)}};if((function(s){return"_zod"in s&&typeof s._zod=="object"})(e))return function(s,o,u){try{return Promise.resolve(K0(function(){return Promise.resolve((r.mode==="sync"?pk:gk)(e,s,n)).then(function(d){return u.shouldUseNativeValidation&&Fm({},u),{errors:{},values:r.raw?Object.assign({},s):d}})},function(d){if((function(m){return m instanceof Qp})(d))return{values:{},errors:w0(Y5(d.issues,!u.shouldUseNativeValidation&&u.criteriaMode==="all"),u)};throw d}))}catch(d){return Promise.reject(d)}};throw new Error("Invalid input: not a Zod schema")}const Q5=ee("ZodISODateTime",(e,n)=>{E3.init(e,n),At.init(e,n)});function J5(e){return A5(Q5,e)}const W5=ee("ZodISODate",(e,n)=>{C3.init(e,n),At.init(e,n)});function e6(e){return O5(W5,e)}const t6=ee("ZodISOTime",(e,n)=>{j3.init(e,n),At.init(e,n)});function n6(e){return T5(t6,e)}const a6=ee("ZodISODuration",(e,n)=>{A3.init(e,n),At.init(e,n)});function r6(e){return R5(a6,e)}const i6=(e,n)=>{Qp.init(e,n),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>mk(e,r)},flatten:{value:r=>hk(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Zm,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Zm,2)}},isEmpty:{get(){return e.issues.length===0}}})},va=ee("ZodError",i6,{Parent:Error}),s6=jd(va),o6=Ad(va),l6=Od(va),c6=Td(va),u6=bk(va),d6=xk(va),f6=wk(va),h6=Sk(va),m6=_k(va),p6=Ek(va),g6=Ck(va),v6=jk(va),Zt=ee("ZodType",(e,n)=>(Kt.init(e,n),e.def=n,e.type=n.type,Object.defineProperty(e,"_def",{value:n}),e.check=(...r)=>e.clone(Gi(n,{checks:[...n.checks??[],...r.map(s=>typeof s=="function"?{_zod:{check:s,def:{check:"custom"},onattach:[]}}:s)]})),e.clone=(r,s)=>li(e,r,s),e.brand=()=>e,e.register=((r,s)=>(r.add(e,s),e)),e.parse=(r,s)=>s6(e,r,s,{callee:e.parse}),e.safeParse=(r,s)=>l6(e,r,s),e.parseAsync=async(r,s)=>o6(e,r,s,{callee:e.parseAsync}),e.safeParseAsync=async(r,s)=>c6(e,r,s),e.spa=e.safeParseAsync,e.encode=(r,s)=>u6(e,r,s),e.decode=(r,s)=>d6(e,r,s),e.encodeAsync=async(r,s)=>f6(e,r,s),e.decodeAsync=async(r,s)=>h6(e,r,s),e.safeEncode=(r,s)=>m6(e,r,s),e.safeDecode=(r,s)=>p6(e,r,s),e.safeEncodeAsync=async(r,s)=>g6(e,r,s),e.safeDecodeAsync=async(r,s)=>v6(e,r,s),e.refine=(r,s)=>e.check(c8(r,s)),e.superRefine=r=>e.check(u8(r)),e.overwrite=r=>e.check(Il(r)),e.optional=()=>H0(e),e.nullable=()=>V0(e),e.nullish=()=>H0(V0(e)),e.nonoptional=r=>n8(e,r),e.array=()=>H6(e),e.or=r=>F6([e,r]),e.and=r=>$6(e,r),e.transform=r=>B0(e,Y6(r)),e.default=r=>W6(e,r),e.prefault=r=>t8(e,r),e.catch=r=>r8(e,r),e.pipe=r=>B0(e,r),e.readonly=()=>o8(e),e.describe=r=>{const s=e.clone();return Au.add(s,{description:r}),s},Object.defineProperty(e,"description",{get(){return Au.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return Au.get(e);const s=e.clone();return Au.add(s,r[0]),s},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Q1=ee("_ZodString",(e,n)=>{Jp.init(e,n),Zt.init(e,n);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...s)=>e.check(k5(...s)),e.includes=(...s)=>e.check(K5(...s)),e.startsWith=(...s)=>e.check(q5(...s)),e.endsWith=(...s)=>e.check(P5(...s)),e.min=(...s)=>e.check(ed(...s)),e.max=(...s)=>e.check(X1(...s)),e.length=(...s)=>e.check(Y1(...s)),e.nonempty=(...s)=>e.check(ed(1,...s)),e.lowercase=s=>e.check(L5(s)),e.uppercase=s=>e.check(U5(s)),e.trim=()=>e.check(H5()),e.normalize=(...s)=>e.check(I5(...s)),e.toLowerCase=()=>e.check(V5()),e.toUpperCase=()=>e.check(B5())}),y6=ee("ZodString",(e,n)=>{Jp.init(e,n),Q1.init(e,n),e.email=r=>e.check(o5(b6,r)),e.url=r=>e.check(d5(w6,r)),e.jwt=r=>e.check(j5(L6,r)),e.emoji=r=>e.check(f5(S6,r)),e.guid=r=>e.check(M0(q0,r)),e.uuid=r=>e.check(G1(wl,r)),e.uuidv4=r=>e.check(l5(wl,r)),e.uuidv6=r=>e.check(c5(wl,r)),e.uuidv7=r=>e.check(u5(wl,r)),e.nanoid=r=>e.check(h5(_6,r)),e.guid=r=>e.check(M0(q0,r)),e.cuid=r=>e.check(m5(E6,r)),e.cuid2=r=>e.check(p5(C6,r)),e.ulid=r=>e.check(g5(j6,r)),e.base64=r=>e.check(_5(z6,r)),e.base64url=r=>e.check(E5(M6,r)),e.xid=r=>e.check(v5(A6,r)),e.ksuid=r=>e.check(y5(O6,r)),e.ipv4=r=>e.check(b5(T6,r)),e.ipv6=r=>e.check(x5(R6,r)),e.cidrv4=r=>e.check(w5(N6,r)),e.cidrv6=r=>e.check(S5(D6,r)),e.e164=r=>e.check(C5(k6,r)),e.datetime=r=>e.check(J5(r)),e.date=r=>e.check(e6(r)),e.time=r=>e.check(n6(r)),e.duration=r=>e.check(r6(r))});function Bt(e){return s5(y6,e)}const At=ee("ZodStringFormat",(e,n)=>{Ct.init(e,n),Q1.init(e,n)}),b6=ee("ZodEmail",(e,n)=>{p3.init(e,n),At.init(e,n)}),q0=ee("ZodGUID",(e,n)=>{h3.init(e,n),At.init(e,n)}),wl=ee("ZodUUID",(e,n)=>{m3.init(e,n),At.init(e,n)});function x6(e){return G1(wl,e)}const w6=ee("ZodURL",(e,n)=>{g3.init(e,n),At.init(e,n)}),S6=ee("ZodEmoji",(e,n)=>{v3.init(e,n),At.init(e,n)}),_6=ee("ZodNanoID",(e,n)=>{y3.init(e,n),At.init(e,n)}),E6=ee("ZodCUID",(e,n)=>{b3.init(e,n),At.init(e,n)}),C6=ee("ZodCUID2",(e,n)=>{x3.init(e,n),At.init(e,n)}),j6=ee("ZodULID",(e,n)=>{w3.init(e,n),At.init(e,n)}),A6=ee("ZodXID",(e,n)=>{S3.init(e,n),At.init(e,n)}),O6=ee("ZodKSUID",(e,n)=>{_3.init(e,n),At.init(e,n)}),T6=ee("ZodIPv4",(e,n)=>{O3.init(e,n),At.init(e,n)}),R6=ee("ZodIPv6",(e,n)=>{T3.init(e,n),At.init(e,n)}),N6=ee("ZodCIDRv4",(e,n)=>{R3.init(e,n),At.init(e,n)}),D6=ee("ZodCIDRv6",(e,n)=>{N3.init(e,n),At.init(e,n)}),z6=ee("ZodBase64",(e,n)=>{D3.init(e,n),At.init(e,n)}),M6=ee("ZodBase64URL",(e,n)=>{M3.init(e,n),At.init(e,n)}),k6=ee("ZodE164",(e,n)=>{k3.init(e,n),At.init(e,n)}),L6=ee("ZodJWT",(e,n)=>{U3.init(e,n),At.init(e,n)}),J1=ee("ZodNumber",(e,n)=>{F1.init(e,n),Zt.init(e,n),e.gt=(s,o)=>e.check(L0(s,o)),e.gte=(s,o)=>e.check(ym(s,o)),e.min=(s,o)=>e.check(ym(s,o)),e.lt=(s,o)=>e.check(k0(s,o)),e.lte=(s,o)=>e.check(vm(s,o)),e.max=(s,o)=>e.check(vm(s,o)),e.int=s=>e.check(P0(s)),e.safe=s=>e.check(P0(s)),e.positive=s=>e.check(L0(0,s)),e.nonnegative=s=>e.check(ym(0,s)),e.negative=s=>e.check(k0(0,s)),e.nonpositive=s=>e.check(vm(0,s)),e.multipleOf=(s,o)=>e.check(U0(s,o)),e.step=(s,o)=>e.check(U0(s,o)),e.finite=()=>e;const r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function W1(e){return N5(J1,e)}const U6=ee("ZodNumberFormat",(e,n)=>{K3.init(e,n),J1.init(e,n)});function P0(e){return D5(U6,e)}const K6=ee("ZodUnknown",(e,n)=>{q3.init(e,n),Zt.init(e,n)});function I0(){return z5(K6)}const q6=ee("ZodNever",(e,n)=>{P3.init(e,n),Zt.init(e,n)});function P6(e){return M5(q6,e)}const I6=ee("ZodArray",(e,n)=>{I3.init(e,n),Zt.init(e,n),e.element=n.element,e.min=(r,s)=>e.check(ed(r,s)),e.nonempty=r=>e.check(ed(1,r)),e.max=(r,s)=>e.check(X1(r,s)),e.length=(r,s)=>e.check(Y1(r,s)),e.unwrap=()=>e.element});function H6(e,n){return F5(I6,e,n)}const V6=ee("ZodObject",(e,n)=>{V3.init(e,n),Zt.init(e,n),xt(e,"shape",()=>n.shape),e.keyof=()=>Bi(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:I0()}),e.loose=()=>e.clone({...e._zod.def,catchall:I0()}),e.strict=()=>e.clone({...e._zod.def,catchall:P6()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>lk(e,r),e.safeExtend=r=>ck(e,r),e.merge=r=>uk(e,r),e.pick=r=>sk(e,r),e.omit=r=>ok(e,r),e.partial=(...r)=>dk(t_,e,r[0]),e.required=(...r)=>fk(n_,e,r[0])});function Na(e,n){const r={type:"object",shape:e??{},...Re(n)};return new V6(r)}const B6=ee("ZodUnion",(e,n)=>{B3.init(e,n),Zt.init(e,n),e.options=n.options});function F6(e,n){return new B6({type:"union",options:e,...Re(n)})}const Z6=ee("ZodIntersection",(e,n)=>{F3.init(e,n),Zt.init(e,n)});function $6(e,n){return new Z6({type:"intersection",left:e,right:n})}const Gm=ee("ZodEnum",(e,n)=>{Z3.init(e,n),Zt.init(e,n),e.enum=n.entries,e.options=Object.values(n.entries);const r=new Set(Object.keys(n.entries));e.extract=(s,o)=>{const u={};for(const d of s)if(r.has(d))u[d]=n.entries[d];else throw new Error(`Key ${d} not found in enum`);return new Gm({...n,checks:[],...Re(o),entries:u})},e.exclude=(s,o)=>{const u={...n.entries};for(const d of s)if(r.has(d))delete u[d];else throw new Error(`Key ${d} not found in enum`);return new Gm({...n,checks:[],...Re(o),entries:u})}});function Bi(e,n){const r=Array.isArray(e)?Object.fromEntries(e.map(s=>[s,s])):e;return new Gm({type:"enum",entries:r,...Re(n)})}const G6=ee("ZodLiteral",(e,n)=>{$3.init(e,n),Zt.init(e,n),e.values=new Set(n.values),Object.defineProperty(e,"value",{get(){if(n.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return n.values[0]}})});function e_(e,n){return new G6({type:"literal",values:Array.isArray(e)?e:[e],...Re(n)})}const X6=ee("ZodTransform",(e,n)=>{G3.init(e,n),Zt.init(e,n),e._zod.parse=(r,s)=>{if(s.direction==="backward")throw new D1(e.constructor.name);r.addIssue=u=>{if(typeof u=="string")r.issues.push(Dl(u,r.value,n));else{const d=u;d.fatal&&(d.continue=!1),d.code??(d.code="custom"),d.input??(d.input=r.value),d.inst??(d.inst=e),r.issues.push(Dl(d))}};const o=n.transform(r.value,r);return o instanceof Promise?o.then(u=>(r.value=u,r)):(r.value=o,r)}});function Y6(e){return new X6({type:"transform",transform:e})}const t_=ee("ZodOptional",(e,n)=>{X3.init(e,n),Zt.init(e,n),e.unwrap=()=>e._zod.def.innerType});function H0(e){return new t_({type:"optional",innerType:e})}const Q6=ee("ZodNullable",(e,n)=>{Y3.init(e,n),Zt.init(e,n),e.unwrap=()=>e._zod.def.innerType});function V0(e){return new Q6({type:"nullable",innerType:e})}const J6=ee("ZodDefault",(e,n)=>{Q3.init(e,n),Zt.init(e,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function W6(e,n){return new J6({type:"default",innerType:e,get defaultValue(){return typeof n=="function"?n():k1(n)}})}const e8=ee("ZodPrefault",(e,n)=>{J3.init(e,n),Zt.init(e,n),e.unwrap=()=>e._zod.def.innerType});function t8(e,n){return new e8({type:"prefault",innerType:e,get defaultValue(){return typeof n=="function"?n():k1(n)}})}const n_=ee("ZodNonOptional",(e,n)=>{W3.init(e,n),Zt.init(e,n),e.unwrap=()=>e._zod.def.innerType});function n8(e,n){return new n_({type:"nonoptional",innerType:e,...Re(n)})}const a8=ee("ZodCatch",(e,n)=>{e5.init(e,n),Zt.init(e,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function r8(e,n){return new a8({type:"catch",innerType:e,catchValue:typeof n=="function"?n:()=>n})}const i8=ee("ZodPipe",(e,n)=>{t5.init(e,n),Zt.init(e,n),e.in=n.in,e.out=n.out});function B0(e,n){return new i8({type:"pipe",in:e,out:n})}const s8=ee("ZodReadonly",(e,n)=>{n5.init(e,n),Zt.init(e,n),e.unwrap=()=>e._zod.def.innerType});function o8(e){return new s8({type:"readonly",innerType:e})}const l8=ee("ZodCustom",(e,n)=>{a5.init(e,n),Zt.init(e,n)});function c8(e,n={}){return Z5(l8,e,n)}function u8(e){return $5(e)}const d8=hp("inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function mo({className:e,variant:n,asChild:r=!1,...s}){const o=r?lo:"span";return c.jsx(o,{"data-slot":"badge",className:oe(d8({variant:n}),e),...s})}var f8="Label",a_=b.forwardRef((e,n)=>c.jsx(Fe.label,{...e,ref:n,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(e.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));a_.displayName=f8;var h8=a_;function xr({className:e,...n}){return c.jsx(h8,{"data-slot":"label",className:oe("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),...n})}const _n=k4,r_=b.createContext({}),qe=({...e})=>c.jsx(r_.Provider,{value:{name:e.name},children:c.jsx(K4,{...e})}),Wp=()=>{const e=b.useContext(r_),n=b.useContext(i_),{getFieldState:r}=Ed(),s=E1({name:e.name}),o=r(e.name,s);if(!e)throw new Error("useFormField should be used within ");const{id:u}=n;return{id:u,name:e.name,formItemId:`${u}-form-item`,formDescriptionId:`${u}-form-item-description`,formMessageId:`${u}-form-item-message`,...o}},i_=b.createContext({});function Pe({className:e,...n}){const r=b.useId();return c.jsx(i_.Provider,{value:{id:r},children:c.jsx("div",{"data-slot":"form-item",className:oe("grid gap-2",e),...n})})}function Ie({className:e,...n}){const{error:r,formItemId:s}=Wp();return c.jsx(xr,{"data-slot":"form-label","data-error":!!r,className:oe("data-[error=true]:text-destructive",e),htmlFor:s,...n})}function Be({...e}){const{error:n,formItemId:r,formDescriptionId:s,formMessageId:o}=Wp();return c.jsx(lo,{"data-slot":"form-control",id:r,"aria-describedby":n?`${s} ${o}`:`${s}`,"aria-invalid":!!n,...e})}function He({className:e,...n}){const{error:r,formMessageId:s}=Wp(),o=r?String(r?.message??""):n.children;return o?c.jsx("p",{"data-slot":"form-message",id:s,className:oe("text-destructive text-sm",e),...n,children:o}):null}function Za({className:e,...n}){return c.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:c.jsx("table",{"data-slot":"table",className:oe("w-full caption-bottom text-sm",e),...n})})}function $a({className:e,...n}){return c.jsx("thead",{"data-slot":"table-header",className:oe("[&_tr]:border-b",e),...n})}function Ga({className:e,...n}){return c.jsx("tbody",{"data-slot":"table-body",className:oe("[&_tr:last-child]:border-0",e),...n})}function ot({className:e,...n}){return c.jsx("tr",{"data-slot":"table-row",className:oe("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...n})}function Ue({className:e,...n}){return c.jsx("th",{"data-slot":"table-head",className:oe("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...n})}function je({className:e,...n}){return c.jsx("td",{"data-slot":"table-cell",className:oe("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...n})}function m8({className:e,...n}){return c.jsx("caption",{"data-slot":"table-caption",className:oe("text-muted-foreground mt-4 text-sm",e),...n})}const s_=Na({key:Bt().trim().min(1,"Key is required").max(120,"Max 120 chars"),value:Bt().trim().optional()}),p8=s_.partial();function g8({t:e}){const n=`${e.key}${e.value?`=${e.value}`:""}`;return c.jsxs(mo,{variant:"secondary",className:"font-mono text-xs",children:[c.jsx(ad,{className:"mr-1 h-3 w-3"}),n]})}const v8=()=>{const[e,n]=b.useState(""),[r,s]=b.useState(!1),[o,u]=b.useState(!1),[d,m]=b.useState(null),[p,g]=b.useState(null),x=pa(),v=Pn({queryKey:["annotations"],queryFn:()=>_u.listAnnotations()}),w=wn({resolver:Sn(s_),defaultValues:{key:"",value:""}}),E=mt({mutationFn:j=>_u.createAnnotation(j),onSuccess:async()=>{await x.invalidateQueries({queryKey:["annotations"]}),w.reset(),s(!1),Ae.success("Annotation Created Successfully.")},onError:j=>{Ae.error(j.message??"There was an error while creating Annotation")}}),A=j=>{E.mutate(j)},S=wn({resolver:Sn(p8),defaultValues:{}}),T=mt({mutationFn:({id:j,values:N})=>_u.updateAnnotation(j,N),onSuccess:async()=>{await x.invalidateQueries({queryKey:["annotations"]}),S.reset(),u(!1),Ae.success("Annotation Updated Successfully.")},onError:j=>{Ae.error(j.message??"There was an error while updating Annotation")}}),z=j=>{g(j.id),S.reset({key:j.key,value:j.value}),u(!0)},R=mt({mutationFn:j=>_u.deleteAnnotation(j),onSuccess:async()=>{await x.invalidateQueries({queryKey:["annotations"]}),m(null),Ae.success("Annotation Deleted Successfully.")},onError:j=>{Ae.error(j.message??"There was an error while deleting Annotation")}}),O=b.useMemo(()=>{const j=v.data??[],N=e.trim().toLowerCase();return N?j.filter(B=>B.key?.toLowerCase().includes(N)||B.value?.toLowerCase().includes(N)):j},[e,v.data]);return v.isLoading?c.jsx("div",{className:"p-6",children:"Loading annotations…"}):v.error?c.jsxs("div",{className:"p-6 text-red-500",children:["Error loading annotations.",c.jsx("pre",{children:JSON.stringify(v,null,2)})]}):c.jsxs("div",{className:"space-y-4 p-6",children:[c.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[c.jsx("h1",{className:"mb-4 text-2xl font-bold",children:"Annotations"}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsxs("div",{className:"relative",children:[c.jsx(io,{className:"absolute top-2.5 left-2 h-4 w-4 opacity-60"}),c.jsx(Ke,{value:e,onChange:j=>n(j.target.value),placeholder:"Search annotations",className:"w-64 pl-8"})]}),c.jsxs(Mt,{open:r,onOpenChange:s,children:[c.jsx(wr,{asChild:!0,children:c.jsxs(ce,{onClick:()=>s(!0),children:[c.jsx(ro,{className:"mr-2 h-4 w-4"}),"Create Annotation"]})}),c.jsxs(kt,{className:"sm:max-w-lg",children:[c.jsx(Lt,{children:c.jsx(Ut,{children:"Create Label"})}),c.jsx(_n,{...w,children:c.jsxs("form",{className:"space-y-4",onSubmit:w.handleSubmit(A),children:[c.jsx(qe,{control:w.control,name:"key",render:({field:j})=>c.jsxs(Pe,{children:[c.jsx(Ie,{children:"Key"}),c.jsx(Be,{children:c.jsx(Ke,{placeholder:"environment",...j})}),c.jsx(He,{})]})}),c.jsx(qe,{control:w.control,name:"value",render:({field:j})=>c.jsxs(Pe,{children:[c.jsx(Ie,{children:"Value"}),c.jsx(Be,{children:c.jsx(Ke,{placeholder:"dev",...j})}),c.jsx(He,{})]})}),c.jsxs(en,{className:"gap-2",children:[c.jsx(ce,{type:"button",variant:"outline",onClick:()=>s(!1),children:"Cancel"}),c.jsx(ce,{type:"submit",disabled:w.formState.isSubmitting,children:w.formState.isSubmitting?"Creating…":"Create"})]})]})})]})]})]})]}),c.jsx("div",{className:"bg-background overflow-hidden rounded-2xl border shadow-sm",children:c.jsx("div",{className:"overflow-x-auto",children:c.jsxs(Za,{children:[c.jsx($a,{children:c.jsxs(ot,{children:[c.jsx(Ue,{children:"Key"}),c.jsx(Ue,{children:"Value"}),c.jsx(Ue,{children:"Annotation"}),c.jsx(Ue,{className:"w-[180px] text-right",children:"Actions"})]})}),c.jsxs(Ga,{children:[O.map(j=>c.jsxs(ot,{children:[c.jsx(je,{children:j.key}),c.jsx(je,{children:j.value}),c.jsx(je,{children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(g8,{t:j}),c.jsx("code",{className:"text-muted-foreground text-xs",children:Mi(j.id,6)})]})}),c.jsx(je,{children:c.jsxs("div",{className:"flex justify-end gap-2",children:[c.jsxs(ce,{variant:"outline",size:"sm",onClick:()=>z(j),children:[c.jsx(cp,{className:"mr-2 h-4 w-4"})," Edit"]}),c.jsx(ce,{variant:"destructive",size:"sm",onClick:()=>m(j.id),disabled:R.isPending&&d===j.id,children:R.isPending&&d===j.id?"Deleting…":"Delete"})]})})]},j.id)),O.length===0&&c.jsx(ot,{children:c.jsxs(je,{colSpan:4,className:"text-muted-foreground py-10 text-center",children:[c.jsx(lp,{className:"mx-auto mb-2 h-6 w-6 opacity-60"}),"No labels match your search."]})})]})]})})}),c.jsx(Mt,{open:o,onOpenChange:u,children:c.jsxs(kt,{className:"sm:max-w-lg",children:[c.jsx(Lt,{children:c.jsx(Ut,{children:"Edit Annotation"})}),c.jsx(_n,{...S,children:c.jsxs("form",{className:"space-y-4",onSubmit:S.handleSubmit(j=>{p&&T.mutate({id:p,values:j})}),children:[c.jsx(qe,{control:S.control,name:"key",render:({field:j})=>c.jsxs(Pe,{children:[c.jsx(Ie,{children:"Key"}),c.jsx(Be,{children:c.jsx(Ke,{placeholder:"dedicated",...j})}),c.jsx(He,{})]})}),c.jsx(qe,{control:S.control,name:"value",render:({field:j})=>c.jsxs(Pe,{children:[c.jsx(Ie,{children:"Value (optional)"}),c.jsx(Be,{children:c.jsx(Ke,{placeholder:"gpu",...j})}),c.jsx(He,{})]})}),c.jsxs(en,{className:"gap-2",children:[c.jsx(ce,{type:"button",variant:"outline",onClick:()=>u(!1),children:"Cancel"}),c.jsx(ce,{type:"submit",disabled:T.isPending,children:T.isPending?"Saving…":"Save changes"})]})]})})]})}),c.jsx(Mt,{open:!!d,onOpenChange:j=>!j&&m(null),children:c.jsxs(kt,{className:"sm:max-w-md",children:[c.jsx(Lt,{children:c.jsx(Ut,{children:"Delete annotation"})}),c.jsx("p",{className:"text-muted-foreground text-sm",children:"This action cannot be undone. Are you sure you want to delete this annotation?"}),c.jsxs(en,{className:"gap-2",children:[c.jsx(ce,{variant:"outline",onClick:()=>m(null),children:"Cancel"}),c.jsx(ce,{variant:"destructive",onClick:()=>d&&R.mutate(d),disabled:R.isPending,children:R.isPending?"Deleting…":"Delete"})]})]})})]})};function ja({className:e,...n}){return c.jsx("div",{"data-slot":"card",className:oe("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...n})}function Xa({className:e,...n}){return c.jsx("div",{"data-slot":"card-header",className:oe("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...n})}function Ya({className:e,...n}){return c.jsx("div",{"data-slot":"card-title",className:oe("leading-none font-semibold",e),...n})}function Xm({className:e,...n}){return c.jsx("div",{"data-slot":"card-description",className:oe("text-muted-foreground text-sm",e),...n})}function Aa({className:e,...n}){return c.jsx("div",{"data-slot":"card-content",className:oe("px-6",e),...n})}function y8(e,n="gsot-auth",r=520,s=640){const o=window.top.outerHeight/2+window.top.screenY-s/2,u=window.top.outerWidth/2+window.top.screenX-r/2;return window.open(e,n,`toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=${r},height=${s},top=${o},left=${u}`)}async function b8(e){const n=new URLSearchParams({mode:"spa",origin:window.location.origin}),r=await fetch(`${dp}/auth/${e}/start?`+n,{method:"POST"});if(!r.ok)throw new Error("Failed to start auth");return(await r.json()).auth_url}const F0=()=>{const e=uC(),n=np(),r=b.useMemo(()=>{const o=new URLSearchParams(n.search).get("to")||"/me";try{const u=new URL(o,window.location.origin);return u.origin===window.location.origin?u.pathname+u.search:"/me"}catch{return"/me"}},[n.search]);b.useEffect(()=>{yn.get()?.access_token&&e(r,{replace:!0})},[e,r]),b.useEffect(()=>{const o=u=>{if(!(typeof u.data=="object"&&u.data?.type==="autoglue:auth"))return;const m=u.data.payload;yn.set(m),e(r,{replace:!0})};return window.addEventListener("message",o),()=>window.removeEventListener("message",o)},[e,r]);const s=async o=>{const u=await b8(o);y8(u)||alert("Please allow popups to sign in.")};return c.jsx("div",{className:"mx-auto flex items-center justify-center p-4",children:c.jsxs(ja,{className:"w-full max-w-md",children:[c.jsxs(Xa,{children:[c.jsx(Ya,{className:"text-lg md:text-xl",children:"Sign In"}),c.jsx(Xm,{className:"text-xs md:text-sm",children:"Continue with a provider below to access your account."})]}),c.jsx(Aa,{children:c.jsx("div",{className:"grid gap-4",children:c.jsx("div",{className:oe("flex w-full items-center gap-2","flex-col justify-between"),children:c.jsxs(ce,{variant:"outline",className:"w-full gap-2",onClick:()=>s("google"),children:[c.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"0.98em",height:"1em",viewBox:"0 0 256 262","aria-hidden":"true",focusable:"false",children:[c.jsx("path",{fill:"#4285F4",d:"M255.878 133.451c0-10.734-.871-18.567-2.756-26.69H130.55v48.448h71.947c-1.45 12.04-9.283 30.172-26.69 42.356l-.244 1.622l38.755 30.023l2.685.268c24.659-22.774 38.875-56.282 38.875-96.027"}),c.jsx("path",{fill:"#34A853",d:"M130.55 261.1c35.248 0 64.839-11.605 86.453-31.622l-41.196-31.913c-11.024 7.688-25.82 13.055-45.257 13.055c-34.523 0-63.824-22.773-74.269-54.25l-1.531.13l-40.298 31.187l-.527 1.465C35.393 231.798 79.49 261.1 130.55 261.1"}),c.jsx("path",{fill:"#FBBC05",d:"M56.281 156.37c-2.756-8.123-4.351-16.827-4.351-25.82c0-8.994 1.595-17.697 4.206-25.82l-.073-1.73L15.26 71.312l-1.335.635C5.077 89.644 0 109.517 0 130.55s5.077 40.905 13.925 58.602z"}),c.jsx("path",{fill:"#EB4335",d:"M130.55 50.479c24.514 0 41.05 10.589 50.479 19.438l36.844-35.974C195.245 12.91 165.798 0 130.55 0C79.49 0 35.393 29.301 13.925 71.947l42.211 32.783c10.59-31.477 39.891-54.251 74.414-54.251"})]}),"Sign in with Google"]})})})})]})})},hl=TT(),ml={listJobs:(e={})=>$e(async()=>await hl.adminListArcherJobs(e)),enqueue:e=>$e(async()=>await hl.adminEnqueueArcherJob({body:e})),retryJob:e=>$e(async()=>await hl.adminRetryArcherJob({id:e})),cancelJob:e=>$e(async()=>await hl.adminCancelArcherJob({id:e})),listQueues:()=>$e(async()=>await hl.adminListArcherQueues())};function Z0(e,[n,r]){return Math.min(r,Math.max(n,e))}function x8(e){const n=e+"CollectionProvider",[r,s]=ii(n),[o,u]=r(n,{collectionRef:{current:null},itemMap:new Map}),d=S=>{const{scope:T,children:z}=S,R=G.useRef(null),O=G.useRef(new Map).current;return c.jsx(o,{scope:T,itemMap:O,collectionRef:R,children:z})};d.displayName=n;const m=e+"CollectionSlot",p=Ki(m),g=G.forwardRef((S,T)=>{const{scope:z,children:R}=S,O=u(m,z),j=bt(T,O.collectionRef);return c.jsx(p,{ref:j,children:R})});g.displayName=m;const x=e+"CollectionItemSlot",v="data-radix-collection-item",w=Ki(x),E=G.forwardRef((S,T)=>{const{scope:z,children:R,...O}=S,j=G.useRef(null),N=bt(T,j),B=u(x,z);return G.useEffect(()=>(B.itemMap.set(j,{ref:j,...O}),()=>void B.itemMap.delete(j))),c.jsx(w,{[v]:"",ref:N,children:R})});E.displayName=x;function A(S){const T=u(e+"CollectionConsumer",S);return G.useCallback(()=>{const R=T.collectionRef.current;if(!R)return[];const O=Array.from(R.querySelectorAll(`[${v}]`));return Array.from(T.itemMap.values()).sort((B,H)=>O.indexOf(B.ref.current)-O.indexOf(H.ref.current))},[T.collectionRef,T.itemMap])}return[{Provider:d,Slot:g,ItemSlot:E},A,s]}var w8=b.createContext(void 0);function S8(e){const n=b.useContext(w8);return e||n||"ltr"}function _8(e){const n=b.useRef({value:e,previous:e});return b.useMemo(()=>(n.current.value!==e&&(n.current.previous=n.current.value,n.current.value=e),n.current.previous),[e])}var E8=[" ","Enter","ArrowUp","ArrowDown"],C8=[" ","Enter"],Fi="Select",[Nd,Dd,j8]=x8(Fi),[po]=ii(Fi,[j8,ho]),zd=ho(),[A8,ci]=po(Fi),[O8,T8]=po(Fi),o_=e=>{const{__scopeSelect:n,children:r,open:s,defaultOpen:o,onOpenChange:u,value:d,defaultValue:m,onValueChange:p,dir:g,name:x,autoComplete:v,disabled:w,required:E,form:A}=e,S=zd(n),[T,z]=b.useState(null),[R,O]=b.useState(null),[j,N]=b.useState(!1),B=S8(g),[H,$]=Al({prop:s,defaultProp:o??!1,onChange:u,caller:Fi}),[ue,ye]=Al({prop:d,defaultProp:m,onChange:p,caller:Fi}),ge=b.useRef(null),re=T?A||!!T.closest("form"):!0,[le,he]=b.useState(new Set),ve=Array.from(le).map(C=>C.props.value).join(";");return c.jsx(Np,{...S,children:c.jsxs(A8,{required:E,scope:n,trigger:T,onTriggerChange:z,valueNode:R,onValueNodeChange:O,valueNodeHasChildren:j,onValueNodeHasChildrenChange:N,contentId:qn(),value:ue,onValueChange:ye,open:H,onOpenChange:$,dir:B,triggerPointerDownPosRef:ge,disabled:w,children:[c.jsx(Nd.Provider,{scope:n,children:c.jsx(O8,{scope:e.__scopeSelect,onNativeOptionAdd:b.useCallback(C=>{he(L=>new Set(L).add(C))},[]),onNativeOptionRemove:b.useCallback(C=>{he(L=>{const K=new Set(L);return K.delete(C),K})},[]),children:r})}),re?c.jsxs(T_,{"aria-hidden":!0,required:E,tabIndex:-1,name:x,autoComplete:v,value:ue,onChange:C=>ye(C.target.value),disabled:w,form:A,children:[ue===void 0?c.jsx("option",{value:""}):null,Array.from(le)]},ve):null]})})};o_.displayName=Fi;var l_="SelectTrigger",c_=b.forwardRef((e,n)=>{const{__scopeSelect:r,disabled:s=!1,...o}=e,u=zd(r),d=ci(l_,r),m=d.disabled||s,p=bt(n,d.onTriggerChange),g=Dd(r),x=b.useRef("touch"),[v,w,E]=N_(S=>{const T=g().filter(O=>!O.disabled),z=T.find(O=>O.value===d.value),R=D_(T,S,z);R!==void 0&&d.onValueChange(R.value)}),A=S=>{m||(d.onOpenChange(!0),E()),S&&(d.triggerPointerDownPosRef.current={x:Math.round(S.pageX),y:Math.round(S.pageY)})};return c.jsx(yd,{asChild:!0,...u,children:c.jsx(Fe.button,{type:"button",role:"combobox","aria-controls":d.contentId,"aria-expanded":d.open,"aria-required":d.required,"aria-autocomplete":"none",dir:d.dir,"data-state":d.open?"open":"closed",disabled:m,"data-disabled":m?"":void 0,"data-placeholder":R_(d.value)?"":void 0,...o,ref:p,onClick:We(o.onClick,S=>{S.currentTarget.focus(),x.current!=="mouse"&&A(S)}),onPointerDown:We(o.onPointerDown,S=>{x.current=S.pointerType;const T=S.target;T.hasPointerCapture(S.pointerId)&&T.releasePointerCapture(S.pointerId),S.button===0&&S.ctrlKey===!1&&S.pointerType==="mouse"&&(A(S),S.preventDefault())}),onKeyDown:We(o.onKeyDown,S=>{const T=v.current!=="";!(S.ctrlKey||S.altKey||S.metaKey)&&S.key.length===1&&w(S.key),!(T&&S.key===" ")&&E8.includes(S.key)&&(A(),S.preventDefault())})})})});c_.displayName=l_;var u_="SelectValue",d_=b.forwardRef((e,n)=>{const{__scopeSelect:r,className:s,style:o,children:u,placeholder:d="",...m}=e,p=ci(u_,r),{onValueNodeHasChildrenChange:g}=p,x=u!==void 0,v=bt(n,p.onValueNodeChange);return tn(()=>{g(x)},[g,x]),c.jsx(Fe.span,{...m,ref:v,style:{pointerEvents:"none"},children:R_(p.value)?c.jsx(c.Fragment,{children:d}):u})});d_.displayName=u_;var R8="SelectIcon",f_=b.forwardRef((e,n)=>{const{__scopeSelect:r,children:s,...o}=e;return c.jsx(Fe.span,{"aria-hidden":!0,...o,ref:n,children:s||"▼"})});f_.displayName=R8;var N8="SelectPortal",h_=e=>c.jsx(Ml,{asChild:!0,...e});h_.displayName=N8;var Zi="SelectContent",m_=b.forwardRef((e,n)=>{const r=ci(Zi,e.__scopeSelect),[s,o]=b.useState();if(tn(()=>{o(new DocumentFragment)},[]),!r.open){const u=s;return u?nd.createPortal(c.jsx(p_,{scope:e.__scopeSelect,children:c.jsx(Nd.Slot,{scope:e.__scopeSelect,children:c.jsx("div",{children:e.children})})}),u):null}return c.jsx(g_,{...e,ref:n})});m_.displayName=Zi;var _a=10,[p_,ui]=po(Zi),D8="SelectContentImpl",z8=Ki("SelectContent.RemoveScroll"),g_=b.forwardRef((e,n)=>{const{__scopeSelect:r,position:s="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:u,onPointerDownOutside:d,side:m,sideOffset:p,align:g,alignOffset:x,arrowPadding:v,collisionBoundary:w,collisionPadding:E,sticky:A,hideWhenDetached:S,avoidCollisions:T,...z}=e,R=ci(Zi,r),[O,j]=b.useState(null),[N,B]=b.useState(null),H=bt(n,te=>j(te)),[$,ue]=b.useState(null),[ye,ge]=b.useState(null),re=Dd(r),[le,he]=b.useState(!1),ve=b.useRef(!1);b.useEffect(()=>{if(O)return gp(O)},[O]),pp();const C=b.useCallback(te=>{const[pe,...Te]=re().map(Xe=>Xe.ref.current),[Me]=Te.slice(-1),Ge=document.activeElement;for(const Xe of te)if(Xe===Ge||(Xe?.scrollIntoView({block:"nearest"}),Xe===pe&&N&&(N.scrollTop=0),Xe===Me&&N&&(N.scrollTop=N.scrollHeight),Xe?.focus(),document.activeElement!==Ge))return},[re,N]),L=b.useCallback(()=>C([$,O]),[C,$,O]);b.useEffect(()=>{le&&L()},[le,L]);const{onOpenChange:K,triggerPointerDownPosRef:de}=R;b.useEffect(()=>{if(O){let te={x:0,y:0};const pe=Me=>{te={x:Math.abs(Math.round(Me.pageX)-(de.current?.x??0)),y:Math.abs(Math.round(Me.pageY)-(de.current?.y??0))}},Te=Me=>{te.x<=10&&te.y<=10?Me.preventDefault():O.contains(Me.target)||K(!1),document.removeEventListener("pointermove",pe),de.current=null};return de.current!==null&&(document.addEventListener("pointermove",pe),document.addEventListener("pointerup",Te,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",pe),document.removeEventListener("pointerup",Te,{capture:!0})}}},[O,K,de]),b.useEffect(()=>{const te=()=>K(!1);return window.addEventListener("blur",te),window.addEventListener("resize",te),()=>{window.removeEventListener("blur",te),window.removeEventListener("resize",te)}},[K]);const[xe,ze]=N_(te=>{const pe=re().filter(Ge=>!Ge.disabled),Te=pe.find(Ge=>Ge.ref.current===document.activeElement),Me=D_(pe,te,Te);Me&&setTimeout(()=>Me.ref.current.focus())}),Y=b.useCallback((te,pe,Te)=>{const Me=!ve.current&&!Te;(R.value!==void 0&&R.value===pe||Me)&&(ue(te),Me&&(ve.current=!0))},[R.value]),X=b.useCallback(()=>O?.focus(),[O]),ae=b.useCallback((te,pe,Te)=>{const Me=!ve.current&&!Te;(R.value!==void 0&&R.value===pe||Me)&&ge(te)},[R.value]),ne=s==="popper"?Ym:v_,_e=ne===Ym?{side:m,sideOffset:p,align:g,alignOffset:x,arrowPadding:v,collisionBoundary:w,collisionPadding:E,sticky:A,hideWhenDetached:S,avoidCollisions:T}:{};return c.jsx(p_,{scope:r,content:O,viewport:N,onViewportChange:B,itemRefCallback:Y,selectedItem:$,onItemLeave:X,itemTextRefCallback:ae,focusSelectedItem:L,selectedItemText:ye,position:s,isPositioned:le,searchRef:xe,children:c.jsx(od,{as:z8,allowPinchZoom:!0,children:c.jsx(id,{asChild:!0,trapped:R.open,onMountAutoFocus:te=>{te.preventDefault()},onUnmountAutoFocus:We(o,te=>{R.trigger?.focus({preventScroll:!0}),te.preventDefault()}),children:c.jsx(zl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:te=>te.preventDefault(),onDismiss:()=>R.onOpenChange(!1),children:c.jsx(ne,{role:"listbox",id:R.contentId,"data-state":R.open?"open":"closed",dir:R.dir,onContextMenu:te=>te.preventDefault(),...z,..._e,onPlaced:()=>he(!0),ref:H,style:{display:"flex",flexDirection:"column",outline:"none",...z.style},onKeyDown:We(z.onKeyDown,te=>{const pe=te.ctrlKey||te.altKey||te.metaKey;if(te.key==="Tab"&&te.preventDefault(),!pe&&te.key.length===1&&ze(te.key),["ArrowUp","ArrowDown","Home","End"].includes(te.key)){let Me=re().filter(Ge=>!Ge.disabled).map(Ge=>Ge.ref.current);if(["ArrowUp","End"].includes(te.key)&&(Me=Me.slice().reverse()),["ArrowUp","ArrowDown"].includes(te.key)){const Ge=te.target,Xe=Me.indexOf(Ge);Me=Me.slice(Xe+1)}setTimeout(()=>C(Me)),te.preventDefault()}})})})})})})});g_.displayName=D8;var M8="SelectItemAlignedPosition",v_=b.forwardRef((e,n)=>{const{__scopeSelect:r,onPlaced:s,...o}=e,u=ci(Zi,r),d=ui(Zi,r),[m,p]=b.useState(null),[g,x]=b.useState(null),v=bt(n,H=>x(H)),w=Dd(r),E=b.useRef(!1),A=b.useRef(!0),{viewport:S,selectedItem:T,selectedItemText:z,focusSelectedItem:R}=d,O=b.useCallback(()=>{if(u.trigger&&u.valueNode&&m&&g&&S&&T&&z){const H=u.trigger.getBoundingClientRect(),$=g.getBoundingClientRect(),ue=u.valueNode.getBoundingClientRect(),ye=z.getBoundingClientRect();if(u.dir!=="rtl"){const Ge=ye.left-$.left,Xe=ue.left-Ge,$t=H.left-Xe,Ot=H.width+$t,na=Math.max(Ot,$.width),aa=window.innerWidth-_a,Hn=Z0(Xe,[_a,Math.max(_a,aa-na)]);m.style.minWidth=Ot+"px",m.style.left=Hn+"px"}else{const Ge=$.right-ye.right,Xe=window.innerWidth-ue.right-Ge,$t=window.innerWidth-H.right-Xe,Ot=H.width+$t,na=Math.max(Ot,$.width),aa=window.innerWidth-_a,Hn=Z0(Xe,[_a,Math.max(_a,aa-na)]);m.style.minWidth=Ot+"px",m.style.right=Hn+"px"}const ge=w(),re=window.innerHeight-_a*2,le=S.scrollHeight,he=window.getComputedStyle(g),ve=parseInt(he.borderTopWidth,10),C=parseInt(he.paddingTop,10),L=parseInt(he.borderBottomWidth,10),K=parseInt(he.paddingBottom,10),de=ve+C+le+K+L,xe=Math.min(T.offsetHeight*5,de),ze=window.getComputedStyle(S),Y=parseInt(ze.paddingTop,10),X=parseInt(ze.paddingBottom,10),ae=H.top+H.height/2-_a,ne=re-ae,_e=T.offsetHeight/2,te=T.offsetTop+_e,pe=ve+C+te,Te=de-pe;if(pe<=ae){const Ge=ge.length>0&&T===ge[ge.length-1].ref.current;m.style.bottom="0px";const Xe=g.clientHeight-S.offsetTop-S.offsetHeight,$t=Math.max(ne,_e+(Ge?X:0)+Xe+L),Ot=pe+$t;m.style.height=Ot+"px"}else{const Ge=ge.length>0&&T===ge[0].ref.current;m.style.top="0px";const $t=Math.max(ae,ve+S.offsetTop+(Ge?Y:0)+_e)+Te;m.style.height=$t+"px",S.scrollTop=pe-ae+S.offsetTop}m.style.margin=`${_a}px 0`,m.style.minHeight=xe+"px",m.style.maxHeight=re+"px",s?.(),requestAnimationFrame(()=>E.current=!0)}},[w,u.trigger,u.valueNode,m,g,S,T,z,u.dir,s]);tn(()=>O(),[O]);const[j,N]=b.useState();tn(()=>{g&&N(window.getComputedStyle(g).zIndex)},[g]);const B=b.useCallback(H=>{H&&A.current===!0&&(O(),R?.(),A.current=!1)},[O,R]);return c.jsx(L8,{scope:r,contentWrapper:m,shouldExpandOnScrollRef:E,onScrollButtonChange:B,children:c.jsx("div",{ref:p,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:j},children:c.jsx(Fe.div,{...o,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});v_.displayName=M8;var k8="SelectPopperPosition",Ym=b.forwardRef((e,n)=>{const{__scopeSelect:r,align:s="start",collisionPadding:o=_a,...u}=e,d=zd(r);return c.jsx(Dp,{...d,...u,ref:n,align:s,collisionPadding:o,style:{boxSizing:"border-box",...u.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Ym.displayName=k8;var[L8,eg]=po(Zi,{}),Qm="SelectViewport",y_=b.forwardRef((e,n)=>{const{__scopeSelect:r,nonce:s,...o}=e,u=ui(Qm,r),d=eg(Qm,r),m=bt(n,u.onViewportChange),p=b.useRef(0);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),c.jsx(Nd.Slot,{scope:r,children:c.jsx(Fe.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:m,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:We(o.onScroll,g=>{const x=g.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:w}=d;if(w?.current&&v){const E=Math.abs(p.current-x.scrollTop);if(E>0){const A=window.innerHeight-_a*2,S=parseFloat(v.style.minHeight),T=parseFloat(v.style.height),z=Math.max(S,T);if(z0?j:0,v.style.justifyContent="flex-end")}}}p.current=x.scrollTop})})})]})});y_.displayName=Qm;var b_="SelectGroup",[U8,K8]=po(b_),q8=b.forwardRef((e,n)=>{const{__scopeSelect:r,...s}=e,o=qn();return c.jsx(U8,{scope:r,id:o,children:c.jsx(Fe.div,{role:"group","aria-labelledby":o,...s,ref:n})})});q8.displayName=b_;var x_="SelectLabel",P8=b.forwardRef((e,n)=>{const{__scopeSelect:r,...s}=e,o=K8(x_,r);return c.jsx(Fe.div,{id:o.id,...s,ref:n})});P8.displayName=x_;var td="SelectItem",[I8,w_]=po(td),S_=b.forwardRef((e,n)=>{const{__scopeSelect:r,value:s,disabled:o=!1,textValue:u,...d}=e,m=ci(td,r),p=ui(td,r),g=m.value===s,[x,v]=b.useState(u??""),[w,E]=b.useState(!1),A=bt(n,R=>p.itemRefCallback?.(R,s,o)),S=qn(),T=b.useRef("touch"),z=()=>{o||(m.onValueChange(s),m.onOpenChange(!1))};if(s==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return c.jsx(I8,{scope:r,value:s,disabled:o,textId:S,isSelected:g,onItemTextChange:b.useCallback(R=>{v(O=>O||(R?.textContent??"").trim())},[]),children:c.jsx(Nd.ItemSlot,{scope:r,value:s,disabled:o,textValue:x,children:c.jsx(Fe.div,{role:"option","aria-labelledby":S,"data-highlighted":w?"":void 0,"aria-selected":g&&w,"data-state":g?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...d,ref:A,onFocus:We(d.onFocus,()=>E(!0)),onBlur:We(d.onBlur,()=>E(!1)),onClick:We(d.onClick,()=>{T.current!=="mouse"&&z()}),onPointerUp:We(d.onPointerUp,()=>{T.current==="mouse"&&z()}),onPointerDown:We(d.onPointerDown,R=>{T.current=R.pointerType}),onPointerMove:We(d.onPointerMove,R=>{T.current=R.pointerType,o?p.onItemLeave?.():T.current==="mouse"&&R.currentTarget.focus({preventScroll:!0})}),onPointerLeave:We(d.onPointerLeave,R=>{R.currentTarget===document.activeElement&&p.onItemLeave?.()}),onKeyDown:We(d.onKeyDown,R=>{p.searchRef?.current!==""&&R.key===" "||(C8.includes(R.key)&&z(),R.key===" "&&R.preventDefault())})})})})});S_.displayName=td;var Sl="SelectItemText",__=b.forwardRef((e,n)=>{const{__scopeSelect:r,className:s,style:o,...u}=e,d=ci(Sl,r),m=ui(Sl,r),p=w_(Sl,r),g=T8(Sl,r),[x,v]=b.useState(null),w=bt(n,z=>v(z),p.onItemTextChange,z=>m.itemTextRefCallback?.(z,p.value,p.disabled)),E=x?.textContent,A=b.useMemo(()=>c.jsx("option",{value:p.value,disabled:p.disabled,children:E},p.value),[p.disabled,p.value,E]),{onNativeOptionAdd:S,onNativeOptionRemove:T}=g;return tn(()=>(S(A),()=>T(A)),[S,T,A]),c.jsxs(c.Fragment,{children:[c.jsx(Fe.span,{id:p.textId,...u,ref:w}),p.isSelected&&d.valueNode&&!d.valueNodeHasChildren?nd.createPortal(u.children,d.valueNode):null]})});__.displayName=Sl;var E_="SelectItemIndicator",C_=b.forwardRef((e,n)=>{const{__scopeSelect:r,...s}=e;return w_(E_,r).isSelected?c.jsx(Fe.span,{"aria-hidden":!0,...s,ref:n}):null});C_.displayName=E_;var Jm="SelectScrollUpButton",j_=b.forwardRef((e,n)=>{const r=ui(Jm,e.__scopeSelect),s=eg(Jm,e.__scopeSelect),[o,u]=b.useState(!1),d=bt(n,s.onScrollButtonChange);return tn(()=>{if(r.viewport&&r.isPositioned){let m=function(){const g=p.scrollTop>0;u(g)};const p=r.viewport;return m(),p.addEventListener("scroll",m),()=>p.removeEventListener("scroll",m)}},[r.viewport,r.isPositioned]),o?c.jsx(O_,{...e,ref:d,onAutoScroll:()=>{const{viewport:m,selectedItem:p}=r;m&&p&&(m.scrollTop=m.scrollTop-p.offsetHeight)}}):null});j_.displayName=Jm;var Wm="SelectScrollDownButton",A_=b.forwardRef((e,n)=>{const r=ui(Wm,e.__scopeSelect),s=eg(Wm,e.__scopeSelect),[o,u]=b.useState(!1),d=bt(n,s.onScrollButtonChange);return tn(()=>{if(r.viewport&&r.isPositioned){let m=function(){const g=p.scrollHeight-p.clientHeight,x=Math.ceil(p.scrollTop)p.removeEventListener("scroll",m)}},[r.viewport,r.isPositioned]),o?c.jsx(O_,{...e,ref:d,onAutoScroll:()=>{const{viewport:m,selectedItem:p}=r;m&&p&&(m.scrollTop=m.scrollTop+p.offsetHeight)}}):null});A_.displayName=Wm;var O_=b.forwardRef((e,n)=>{const{__scopeSelect:r,onAutoScroll:s,...o}=e,u=ui("SelectScrollButton",r),d=b.useRef(null),m=Dd(r),p=b.useCallback(()=>{d.current!==null&&(window.clearInterval(d.current),d.current=null)},[]);return b.useEffect(()=>()=>p(),[p]),tn(()=>{m().find(x=>x.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[m]),c.jsx(Fe.div,{"aria-hidden":!0,...o,ref:n,style:{flexShrink:0,...o.style},onPointerDown:We(o.onPointerDown,()=>{d.current===null&&(d.current=window.setInterval(s,50))}),onPointerMove:We(o.onPointerMove,()=>{u.onItemLeave?.(),d.current===null&&(d.current=window.setInterval(s,50))}),onPointerLeave:We(o.onPointerLeave,()=>{p()})})}),H8="SelectSeparator",V8=b.forwardRef((e,n)=>{const{__scopeSelect:r,...s}=e;return c.jsx(Fe.div,{"aria-hidden":!0,...s,ref:n})});V8.displayName=H8;var ep="SelectArrow",B8=b.forwardRef((e,n)=>{const{__scopeSelect:r,...s}=e,o=zd(r),u=ci(ep,r),d=ui(ep,r);return u.open&&d.position==="popper"?c.jsx(zp,{...o,...s,ref:n}):null});B8.displayName=ep;var F8="SelectBubbleInput",T_=b.forwardRef(({__scopeSelect:e,value:n,...r},s)=>{const o=b.useRef(null),u=bt(s,o),d=_8(n);return b.useEffect(()=>{const m=o.current;if(!m)return;const p=window.HTMLSelectElement.prototype,x=Object.getOwnPropertyDescriptor(p,"value").set;if(d!==n&&x){const v=new Event("change",{bubbles:!0});x.call(m,n),m.dispatchEvent(v)}},[d,n]),c.jsx(Fe.select,{...r,style:{...i1,...r.style},ref:u,defaultValue:n})});T_.displayName=F8;function R_(e){return e===""||e===void 0}function N_(e){const n=ei(e),r=b.useRef(""),s=b.useRef(0),o=b.useCallback(d=>{const m=r.current+d;n(m),(function p(g){r.current=g,window.clearTimeout(s.current),g!==""&&(s.current=window.setTimeout(()=>p(""),1e3))})(m)},[n]),u=b.useCallback(()=>{r.current="",window.clearTimeout(s.current)},[]);return b.useEffect(()=>()=>window.clearTimeout(s.current),[]),[r,o,u]}function D_(e,n,r){const o=n.length>1&&Array.from(n).every(g=>g===n[0])?n[0]:n,u=r?e.indexOf(r):-1;let d=Z8(e,Math.max(u,0));o.length===1&&(d=d.filter(g=>g!==r));const p=d.find(g=>g.textValue.toLowerCase().startsWith(o.toLowerCase()));return p!==r?p:void 0}function Z8(e,n){return e.map((r,s)=>e[(n+s)%e.length])}var $8=o_,G8=c_,X8=d_,Y8=f_,Q8=h_,J8=m_,W8=y_,e7=S_,t7=__,n7=C_,a7=j_,r7=A_;function mn({...e}){return c.jsx($8,{"data-slot":"select",...e})}function pn({...e}){return c.jsx(X8,{"data-slot":"select-value",...e})}function gn({className:e,size:n="default",children:r,...s}){return c.jsxs(G8,{"data-slot":"select-trigger","data-size":n,className:oe("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...s,children:[r,c.jsx(Y8,{asChild:!0,children:c.jsx(gw,{className:"size-4 opacity-50"})})]})}function vn({className:e,children:n,position:r="popper",align:s="center",...o}){return c.jsx(Q8,{children:c.jsxs(J8,{"data-slot":"select-content",className:oe("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,align:s,...o,children:[c.jsx(i7,{}),c.jsx(W8,{className:oe("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:n}),c.jsx(s7,{})]})})}function ct({className:e,children:n,...r}){return c.jsxs(e7,{"data-slot":"select-item",className:oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...r,children:[c.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:c.jsx(n7,{children:c.jsx(pw,{className:"size-4"})})}),c.jsx(t7,{children:n})]})}function i7({className:e,...n}){return c.jsx(a7,{"data-slot":"select-scroll-up-button",className:oe("flex cursor-default items-center justify-center py-1",e),...n,children:c.jsx(xj,{className:"size-4"})})}function s7({className:e,...n}){return c.jsx(r7,{"data-slot":"select-scroll-down-button",className:oe("flex cursor-default items-center justify-center py-1",e),...n,children:c.jsx(gw,{className:"size-4"})})}function z_({className:e,...n}){return c.jsx("textarea",{"data-slot":"textarea",className:oe("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...n})}const o7=["queued","running","succeeded","failed","canceled","retrying","scheduled"],l7={queued:"bg-amber-100 text-amber-800",running:"bg-sky-100 text-sky-800",succeeded:"bg-emerald-100 text-emerald-800",failed:"bg-red-100 text-red-800",canceled:"bg-zinc-200 text-zinc-700",retrying:"bg-orange-100 text-orange-800",scheduled:"bg-violet-100 text-violet-800"};function $0(e){if(!e)return"—";const n=new Date(e);return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(n)}function c7(e,n=300){const[r,s]=b.useState(e);return b.useEffect(()=>{const o=setTimeout(()=>s(e),n);return()=>clearTimeout(o)},[e,n]),r}const u7=()=>{const e=pa(),[n,r]=b.useState(""),[s,o]=b.useState(""),[u,d]=b.useState(""),m=c7(u,300),[p,g]=b.useState(1),[x,v]=b.useState(25),E=Pn({queryKey:["archer","jobs",{status:n,queue:s,q:m,page:p,pageSize:x}],queryFn:()=>ml.listJobs({status:n,queue:s||void 0,q:m||void 0,page:p,pageSize:x}),placeholderData:N=>N,staleTime:1e4}),A=Pn({queryKey:["archer","queues"],queryFn:()=>ml.listQueues(),staleTime:3e4}),S=mt({mutationFn:N=>ml.enqueue(N),onSuccess:()=>e.invalidateQueries({queryKey:["archer","jobs"]})}),T=mt({mutationFn:N=>ml.retryJob(N),onSuccess:()=>e.invalidateQueries({queryKey:["archer","jobs"]})}),z=mt({mutationFn:N=>ml.cancelJob(N),onSuccess:()=>e.invalidateQueries({queryKey:["archer","jobs"]})}),R=E.isFetching,O=E.data,j=O?Math.max(1,Math.ceil(O.total/O.pageSize)):1;return c.jsxs("div",{className:"container mx-auto space-y-6 p-6",children:[c.jsxs("div",{className:"flex items-start justify-between gap-4",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-semibold",children:"Archer Jobs"}),c.jsx("p",{className:"text-muted-foreground text-sm",children:"Inspect, enqueue, retry and cancel background jobs."})]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(f7,{onSubmit:N=>S.mutateAsync(N),submitting:S.isPending}),c.jsxs(ce,{variant:"secondary",onClick:()=>e.invalidateQueries({queryKey:["archer","jobs"]}),disabled:R,children:[R?c.jsx(Qs,{className:"mr-2 h-4 w-4 animate-spin"}):c.jsx(Zj,{className:"mr-2 h-4 w-4"}),"Refresh"]})]})]}),c.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:A.data?.map(N=>c.jsxs(ja,{children:[c.jsx(Xa,{children:c.jsx(Ya,{className:"text-base",children:N.name})}),c.jsxs(Aa,{className:"grid grid-cols-2 gap-2 text-sm",children:[c.jsx(Ou,{label:"Pending",value:N.pending}),c.jsx(Ou,{label:"Running",value:N.running}),c.jsx(Ou,{label:"Failed",value:N.failed}),c.jsx(Ou,{label:"Scheduled",value:N.scheduled})]})]},N.name))}),c.jsxs(ja,{children:[c.jsx(Xa,{children:c.jsx(Ya,{children:"Filters"})}),c.jsxs(Aa,{className:"grid gap-3 md:grid-cols-4",children:[c.jsxs("div",{className:"col-span-2 flex items-center gap-2",children:[c.jsx(Ke,{placeholder:"Search id, queue, error, payload…",value:u,onChange:N=>{d(N.target.value),g(1)},onKeyDown:N=>N.key==="Enter"&&e.invalidateQueries({queryKey:["archer","jobs"]})}),u&&c.jsx(ce,{variant:"ghost",size:"icon",onClick:()=>d(""),children:c.jsx(up,{className:"h-4 w-4"})}),c.jsxs(ce,{onClick:()=>e.invalidateQueries({queryKey:["archer","jobs"]}),children:[c.jsx(io,{className:"mr-2 h-4 w-4"})," Search"]})]}),c.jsxs(mn,{value:n||"all",onValueChange:N=>{r(N==="all"?"":N),g(1)},children:[c.jsx(gn,{children:c.jsx(pn,{placeholder:"All statuses"})}),c.jsxs(vn,{children:[c.jsx(ct,{value:"all",children:"All statuses"}),o7.map(N=>c.jsx(ct,{value:N,children:N},N))]})]}),c.jsx(Ke,{placeholder:"Queue (optional)",value:s,onChange:N=>{o(N.target.value),g(1)}}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(xr,{className:"whitespace-nowrap",children:"Page size"}),c.jsxs(mn,{value:String(x),onValueChange:N=>{v(Number(N)),g(1)},children:[c.jsx(gn,{className:"w-[120px]",children:c.jsx(pn,{})}),c.jsx(vn,{children:[10,25,50,100].map(N=>c.jsx(ct,{value:String(N),children:N},N))})]})]})]})]}),c.jsx(ja,{children:c.jsxs(Aa,{className:"p-0",children:[c.jsxs(Za,{children:[c.jsx($a,{children:c.jsxs(ot,{children:[c.jsx(Ue,{children:"ID"}),c.jsx(Ue,{children:"Queue"}),c.jsx(Ue,{children:"Status"}),c.jsx(Ue,{children:"Attempts"}),c.jsx(Ue,{children:"Run At"}),c.jsx(Ue,{children:"Updated"}),c.jsx(Ue,{className:"pr-4 text-right",children:"Actions"})]})}),c.jsxs(Ga,{children:[E.isLoading&&c.jsx(ot,{children:c.jsx(je,{colSpan:7,className:"text-muted-foreground py-8 text-center",children:"Loading…"})}),E.isError&&c.jsx(ot,{children:c.jsx(je,{colSpan:7,className:"py-8 text-center text-red-600",children:"Failed to load jobs"})}),!E.isLoading&&O&&O.items.length===0&&c.jsx(ot,{children:c.jsx(je,{colSpan:7,className:"text-muted-foreground py-8 text-center",children:"No jobs match your filters."})}),O?.items.map(N=>c.jsxs(ot,{children:[c.jsx(je,{children:c.jsx("code",{className:"text-xs",children:N.id})}),c.jsx(je,{children:c.jsx(mo,{variant:"secondary",children:N.queue})}),c.jsx(je,{children:c.jsx("span",{className:oe("rounded-md px-2 py-0.5 text-xs",l7[N.status]),children:N.status})}),c.jsx(je,{children:N.maxAttempts?`${N.attempts}/${N.maxAttempts}`:N.attempts}),c.jsx(je,{children:$0(N.runAt)}),c.jsx(je,{children:$0(N.updatedAt??N.createdAt)}),c.jsx(je,{className:"text-right",children:c.jsxs("div",{className:"flex justify-end gap-2",children:[(N.status==="failed"||N.status==="canceled")&&c.jsx(ce,{size:"sm",variant:"outline",disabled:T.isPending,onClick:()=>T.mutate(N.id),children:"Retry"}),(N.status==="queued"||N.status==="running"||N.status==="scheduled")&&c.jsx(ce,{size:"sm",variant:"outline",disabled:z.isPending,onClick:()=>z.mutate(N.id),children:"Cancel"}),c.jsx(d7,{job:N})]})})]},N.id))]})]}),c.jsxs("div",{className:"flex items-center justify-between border-t p-3 text-sm",children:[c.jsxs("div",{children:["Page ",p," of ",j," • ",O?.total??0," total"]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(ce,{variant:"outline",disabled:p<=1||E.isFetching,onClick:()=>g(N=>Math.max(1,N-1)),children:"Prev"}),c.jsx(ce,{variant:"outline",disabled:p>=j||E.isFetching,onClick:()=>g(N=>N+1),children:"Next"})]})]})]})})]})};function Ou({label:e,value:n}){return c.jsxs("div",{className:"bg-muted/30 rounded-lg border p-3",children:[c.jsx("div",{className:"text-muted-foreground text-xs",children:e}),c.jsx("div",{className:"text-lg font-semibold",children:n})]})}function d7({job:e}){return c.jsxs(Mt,{children:[c.jsx(wr,{asChild:!0,children:c.jsx(ce,{size:"sm",variant:"ghost",children:"Details"})}),c.jsxs(kt,{className:"max-w-2xl",children:[c.jsx(Lt,{children:c.jsxs(Ut,{children:["Job ",e.id]})}),c.jsxs("div",{className:"grid gap-3",children:[e.lastError&&c.jsxs(ja,{children:[c.jsx(Xa,{children:c.jsx(Ya,{className:"text-sm",children:"Last error"})}),c.jsx(Aa,{children:c.jsx("pre",{className:"overflow-auto text-xs whitespace-pre-wrap",children:e.lastError})})]}),c.jsxs(ja,{children:[c.jsx(Xa,{children:c.jsx(Ya,{className:"text-sm",children:"Payload"})}),c.jsx(Aa,{children:c.jsx("pre",{className:"overflow-auto text-xs whitespace-pre-wrap",children:JSON.stringify(e.payload,null,2)})})]})]}),c.jsx(en,{children:c.jsx(Bu,{asChild:!0,children:c.jsx(ce,{variant:"secondary",children:"Close"})})})]})]})}function f7({onSubmit:e,submitting:n}){const[r,s]=b.useState(!1),[o,u]=b.useState(""),[d,m]=b.useState(""),[p,g]=b.useState("{}"),[x,v]=b.useState(""),w=o&&d&&!n;async function E(){const A=p?JSON.parse(p):void 0;await e({queue:o,type:d,payload:A,run_at:x||void 0}),s(!1),u(""),m(""),g("{}"),v("")}return c.jsxs(Mt,{open:r,onOpenChange:s,children:[c.jsx(wr,{asChild:!0,children:c.jsxs(ce,{children:[c.jsx(ro,{className:"mr-2 h-4 w-4"})," Enqueue"]})}),c.jsxs(kt,{children:[c.jsx(Lt,{children:c.jsx(Ut,{children:"Enqueue Job"})}),c.jsxs("div",{className:"grid gap-3",children:[c.jsxs("div",{className:"grid gap-2",children:[c.jsx(xr,{children:"Queue"}),c.jsx(Ke,{value:o,onChange:A=>u(A.target.value),placeholder:"e.g. bootstrap_bastion"})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx(xr,{children:"Type"}),c.jsx(Ke,{value:d,onChange:A=>m(A.target.value),placeholder:"e.g. bootstrap_bastion"})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx(xr,{children:"Payload (JSON)"}),c.jsx(z_,{value:p,onChange:A=>g(A.target.value),className:"min-h-[120px] font-mono text-xs"})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx(xr,{children:"Run at (optional)"}),c.jsx(Ke,{type:"datetime-local",value:x,onChange:A=>v(A.target.value)})]})]}),c.jsxs(en,{children:[c.jsx(Bu,{asChild:!0,children:c.jsx(ce,{variant:"secondary",children:"Cancel"})}),c.jsxs(ce,{onClick:E,disabled:!w,children:[n?c.jsx(Qs,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Enqueue"]})]})]})]})}const M_=Na({key:Bt().trim().min(1,"Key is required").max(120,"Max 120 chars"),value:Bt().trim().optional()}),h7=M_.partial();function m7({t:e}){const n=`${e.key}${e.value?`=${e.value}`:""}`;return c.jsxs(mo,{variant:"secondary",className:"font-mono text-xs",children:[c.jsx(ad,{className:"mr-1 h-3 w-3"}),n]})}const p7=()=>{const[e,n]=b.useState(""),[r,s]=b.useState(!1),[o,u]=b.useState(!1),[d,m]=b.useState(null),[p,g]=b.useState(null),x=pa(),v=Pn({queryKey:["labels"],queryFn:()=>Eu.listLabels()}),w=wn({resolver:Sn(M_),defaultValues:{key:"",value:""}}),E=mt({mutationFn:j=>Eu.createLabel(j),onSuccess:async()=>{await x.invalidateQueries({queryKey:["labels"]}),w.reset(),s(!1),Ae.success("Label Created Successfully.")},onError:j=>{Ae.error(j.message??"There was an error while creating Label")}}),A=j=>{E.mutate(j)},S=wn({resolver:Sn(h7),defaultValues:{}}),T=mt({mutationFn:({id:j,values:N})=>Eu.updateLabel(j,N),onSuccess:async()=>{await x.invalidateQueries({queryKey:["labels"]}),S.reset(),u(!1),Ae.success("Label Updated Successfully.")},onError:j=>{Ae.error(j.message??"There was an error while updating Label")}}),z=j=>{g(j.id),S.reset({key:j.key,value:j.value}),u(!0)},R=mt({mutationFn:j=>Eu.deleteLabel(j),onSuccess:async()=>{await x.invalidateQueries({queryKey:["labels"]}),m(null),Ae.success("Label Deleted Successfully.")},onError:j=>{Ae.error(j.message??"There was an error while deleting Label")}}),O=b.useMemo(()=>{const j=v.data??[],N=e.trim().toLowerCase();return N?j.filter(B=>B.key?.toLowerCase().includes(N)||B.value?.toLowerCase().includes(N)):j},[e,v.data]);return v.isLoading?c.jsx("div",{className:"p-6",children:"Loading labels…"}):v.error?c.jsx("div",{className:"p-6 text-red-500",children:"Error loading labels."}):c.jsxs("div",{className:"space-y-4 p-6",children:[c.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[c.jsx("h1",{className:"mb-4 text-2xl font-bold",children:"Labels"}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsxs("div",{className:"relative",children:[c.jsx(io,{className:"absolute top-2.5 left-2 h-4 w-4 opacity-60"}),c.jsx(Ke,{value:e,onChange:j=>n(j.target.value),placeholder:"Search labels",className:"w-64 pl-8"})]}),c.jsxs(Mt,{open:r,onOpenChange:s,children:[c.jsx(wr,{asChild:!0,children:c.jsxs(ce,{onClick:()=>s(!0),children:[c.jsx(ro,{className:"mr-2 h-4 w-4"}),"Create Label"]})}),c.jsxs(kt,{className:"sm:max-w-lg",children:[c.jsx(Lt,{children:c.jsx(Ut,{children:"Create Label"})}),c.jsx(_n,{...w,children:c.jsxs("form",{className:"space-y-4",onSubmit:w.handleSubmit(A),children:[c.jsx(qe,{control:w.control,name:"key",render:({field:j})=>c.jsxs(Pe,{children:[c.jsx(Ie,{children:"Key"}),c.jsx(Be,{children:c.jsx(Ke,{placeholder:"environment",...j})}),c.jsx(He,{})]})}),c.jsx(qe,{control:w.control,name:"value",render:({field:j})=>c.jsxs(Pe,{children:[c.jsx(Ie,{children:"Value"}),c.jsx(Be,{children:c.jsx(Ke,{placeholder:"dev",...j})}),c.jsx(He,{})]})}),c.jsxs(en,{className:"gap-2",children:[c.jsx(ce,{type:"button",variant:"outline",onClick:()=>s(!1),children:"Cancel"}),c.jsx(ce,{type:"submit",disabled:w.formState.isSubmitting,children:w.formState.isSubmitting?"Creating…":"Create"})]})]})})]})]})]})]}),c.jsx("div",{className:"bg-background overflow-hidden rounded-2xl border shadow-sm",children:c.jsx("div",{className:"overflow-x-auto",children:c.jsxs(Za,{children:[c.jsx($a,{children:c.jsxs(ot,{children:[c.jsx(Ue,{children:"Key"}),c.jsx(Ue,{children:"Value"}),c.jsx(Ue,{children:"Label"}),c.jsx(Ue,{className:"w-[180px] text-right",children:"Actions"})]})}),c.jsxs(Ga,{children:[O.map(j=>c.jsxs(ot,{children:[c.jsx(je,{children:j.key}),c.jsx(je,{children:j.value}),c.jsx(je,{children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(m7,{t:j}),c.jsx("code",{className:"text-muted-foreground text-xs",children:Mi(j.id,6)})]})}),c.jsx(je,{children:c.jsxs("div",{className:"flex justify-end gap-2",children:[c.jsxs(ce,{variant:"outline",size:"sm",onClick:()=>z(j),children:[c.jsx(cp,{className:"mr-2 h-4 w-4"})," Edit"]}),c.jsx(ce,{variant:"destructive",size:"sm",onClick:()=>m(j.id),disabled:R.isPending&&d===j.id,children:R.isPending&&d===j.id?"Deleting…":"Delete"})]})})]},j.id)),O.length===0&&c.jsx(ot,{children:c.jsxs(je,{colSpan:4,className:"text-muted-foreground py-10 text-center",children:[c.jsx(lp,{className:"mx-auto mb-2 h-6 w-6 opacity-60"}),"No labels match your search."]})})]})]})})}),c.jsx(Mt,{open:o,onOpenChange:u,children:c.jsxs(kt,{className:"sm:max-w-lg",children:[c.jsx(Lt,{children:c.jsx(Ut,{children:"Edit Label"})}),c.jsx(_n,{...S,children:c.jsxs("form",{className:"space-y-4",onSubmit:S.handleSubmit(j=>{p&&T.mutate({id:p,values:j})}),children:[c.jsx(qe,{control:S.control,name:"key",render:({field:j})=>c.jsxs(Pe,{children:[c.jsx(Ie,{children:"Key"}),c.jsx(Be,{children:c.jsx(Ke,{placeholder:"dedicated",...j})}),c.jsx(He,{})]})}),c.jsx(qe,{control:S.control,name:"value",render:({field:j})=>c.jsxs(Pe,{children:[c.jsx(Ie,{children:"Value (optional)"}),c.jsx(Be,{children:c.jsx(Ke,{placeholder:"gpu",...j})}),c.jsx(He,{})]})}),c.jsxs(en,{className:"gap-2",children:[c.jsx(ce,{type:"button",variant:"outline",onClick:()=>u(!1),children:"Cancel"}),c.jsx(ce,{type:"submit",disabled:T.isPending,children:T.isPending?"Saving…":"Save changes"})]})]})})]})}),c.jsx(Mt,{open:!!d,onOpenChange:j=>!j&&m(null),children:c.jsxs(kt,{className:"sm:max-w-md",children:[c.jsx(Lt,{children:c.jsx(Ut,{children:"Delete label"})}),c.jsx("p",{className:"text-muted-foreground text-sm",children:"This action cannot be undone. Are you sure you want to delete this label?"}),c.jsxs(en,{className:"gap-2",children:[c.jsx(ce,{variant:"outline",onClick:()=>m(null),children:"Cancel"}),c.jsx(ce,{variant:"destructive",onClick:()=>d&&R.mutate(d),disabled:R.isPending,children:R.isPending?"Deleting…":"Delete"})]})]})})]})};var k_="AlertDialog",[g7]=ii(k_,[Jw]),Er=Jw(),L_=e=>{const{__scopeAlertDialog:n,...r}=e,s=Er(n);return c.jsx(cd,{...s,...r,modal:!0})};L_.displayName=k_;var v7="AlertDialogTrigger",U_=b.forwardRef((e,n)=>{const{__scopeAlertDialog:r,...s}=e,o=Er(r);return c.jsx(mS,{...o,...s,ref:n})});U_.displayName=v7;var y7="AlertDialogPortal",K_=e=>{const{__scopeAlertDialog:n,...r}=e,s=Er(n);return c.jsx(ud,{...s,...r})};K_.displayName=y7;var b7="AlertDialogOverlay",q_=b.forwardRef((e,n)=>{const{__scopeAlertDialog:r,...s}=e,o=Er(r);return c.jsx(dd,{...o,...s,ref:n})});q_.displayName=b7;var Ys="AlertDialogContent",[x7,w7]=g7(Ys),S7=Kw("AlertDialogContent"),P_=b.forwardRef((e,n)=>{const{__scopeAlertDialog:r,children:s,...o}=e,u=Er(r),d=b.useRef(null),m=bt(n,d),p=b.useRef(null);return c.jsx(aD,{contentName:Ys,titleName:I_,docsSlug:"alert-dialog",children:c.jsx(x7,{scope:r,cancelRef:p,children:c.jsxs(fd,{role:"alertdialog",...u,...o,ref:m,onOpenAutoFocus:We(o.onOpenAutoFocus,g=>{g.preventDefault(),p.current?.focus({preventScroll:!0})}),onPointerDownOutside:g=>g.preventDefault(),onInteractOutside:g=>g.preventDefault(),children:[c.jsx(S7,{children:s}),c.jsx(E7,{contentRef:d})]})})})});P_.displayName=Ys;var I_="AlertDialogTitle",H_=b.forwardRef((e,n)=>{const{__scopeAlertDialog:r,...s}=e,o=Er(r);return c.jsx(xp,{...o,...s,ref:n})});H_.displayName=I_;var V_="AlertDialogDescription",B_=b.forwardRef((e,n)=>{const{__scopeAlertDialog:r,...s}=e,o=Er(r);return c.jsx(wp,{...o,...s,ref:n})});B_.displayName=V_;var _7="AlertDialogAction",F_=b.forwardRef((e,n)=>{const{__scopeAlertDialog:r,...s}=e,o=Er(r);return c.jsx(kl,{...o,...s,ref:n})});F_.displayName=_7;var Z_="AlertDialogCancel",$_=b.forwardRef((e,n)=>{const{__scopeAlertDialog:r,...s}=e,{cancelRef:o}=w7(Z_,r),u=Er(r),d=bt(n,o);return c.jsx(kl,{...u,...s,ref:d})});$_.displayName=Z_;var E7=({contentRef:e})=>{const n=`\`${Ys}\` requires a description for the component to be accessible for screen reader users. You can add a description to the \`${Ys}\` by passing a \`${V_}\` component as a child, which also benefits sighted users by adding visible context to the dialog. Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Ys}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return b.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(n)},[n,e]),null},C7=L_,j7=U_,A7=K_,O7=q_,T7=P_,R7=F_,N7=$_,D7=H_,z7=B_;function M7({...e}){return c.jsx(C7,{"data-slot":"alert-dialog",...e})}function k7({...e}){return c.jsx(j7,{"data-slot":"alert-dialog-trigger",...e})}function L7({...e}){return c.jsx(A7,{"data-slot":"alert-dialog-portal",...e})}function U7({className:e,...n}){return c.jsx(O7,{"data-slot":"alert-dialog-overlay",className:oe("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...n})}function K7({className:e,...n}){return c.jsxs(L7,{children:[c.jsx(U7,{}),c.jsx(T7,{"data-slot":"alert-dialog-content",className:oe("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...n})]})}function q7({className:e,...n}){return c.jsx("div",{"data-slot":"alert-dialog-header",className:oe("flex flex-col gap-2 text-center sm:text-left",e),...n})}function P7({className:e,...n}){return c.jsx("div",{"data-slot":"alert-dialog-footer",className:oe("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...n})}function I7({className:e,...n}){return c.jsx(D7,{"data-slot":"alert-dialog-title",className:oe("text-lg font-semibold",e),...n})}function H7({className:e,...n}){return c.jsx(z7,{"data-slot":"alert-dialog-description",className:oe("text-muted-foreground text-sm",e),...n})}function V7({className:e,...n}){return c.jsx(R7,{className:oe(mp(),e),...n})}function B7({className:e,...n}){return c.jsx(N7,{className:oe(mp({variant:"outline"}),e),...n})}const F7=rd(),Z7={create:e=>$e(async()=>F7.createOrg({body:e}))},$7=Na({display_name:Bt().min(2,"Too short").max(100,"Too long")}),G7=Na({name:Bt().min(2,"Too short").max(100,"Too long"),expires_in_hours:W1().min(1).max(43800)}),X7=Na({name:Bt().min(2,"Too short").max(100,"Too long"),domain:Bt().trim().toLowerCase().optional().or(e_("")).refine(e=>!e||/^[a-z0-9.-]+\.[a-z]{2,}$/i.test(e),"Invalid domain (e.g. example.com)")}),Y7=()=>{const e=pa(),n=Pn({queryKey:["me"],queryFn:()=>Ni.getMe()}),r=wn({resolver:Sn($7),defaultValues:{display_name:""},values:n.data?{display_name:n.data.display_name??""}:void 0}),s=mt({mutationFn:O=>Ni.updateMe(O),onSuccess:()=>{e.invalidateQueries({queryKey:["me"]}),Ae.success("Profile updated")},onError:O=>Ae.error(O?.message??"Update failed")}),o=Pn({queryKey:["me","api-keys"],queryFn:()=>Ni.listKeys()}),[u,d]=b.useState(!1),[m,p]=b.useState(null),g=wn({resolver:Sn(G7),defaultValues:{name:"",expires_in_hours:720}}),x=mt({mutationFn:O=>Ni.createKey({name:O.name,expires_in_hours:O.expires_in_hours}),onSuccess:O=>{p(O),d(!1),e.invalidateQueries({queryKey:["me","api-keys"]}),Ae.success("API key created")},onError:O=>Ae.error(O?.message??"Failed to create key")}),[v,w]=b.useState(null),E=mt({mutationFn:O=>Ni.deleteKey(O),onSuccess:()=>{e.invalidateQueries({queryKey:["me","api-keys"]}),w(null),Ae.success("Key deleted")},onError:O=>Ae.error(O?.message??"Failed to delete key")}),A=b.useMemo(()=>n.data?.emails?.find(O=>O.is_primary)?.email??n.data?.primary_email??"",[n.data]),[S,T]=b.useState(!1),z=wn({resolver:Sn(X7),defaultValues:{name:"",domain:""}}),R=mt({mutationFn:O=>Z7.create({name:O.name.trim(),domain:O.domain?.trim()?O.domain.trim().toLowerCase():void 0}),onSuccess:()=>{T(!1),z.reset(),e.invalidateQueries({queryKey:["me"]}),Ae.success("Organization created")},onError:O=>Ae.error(O?.message??"Failed to create organization")});return n.isLoading?c.jsx("div",{className:"p-6",children:"Loading…"}):n.error?c.jsx("div",{className:"text-destructive p-6",children:"Failed to load profile"}):c.jsxs("div",{className:"space-y-6 p-6",children:[c.jsxs(ja,{children:[c.jsxs(Xa,{children:[c.jsx(Ya,{children:"Profile"}),c.jsx(Xm,{children:"Manage your personal information."})]}),c.jsx(Aa,{children:c.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx(xr,{children:"Email"}),c.jsx("div",{className:"text-muted-foreground mt-1 text-sm",children:A||"—"})]}),c.jsxs("div",{children:[c.jsx(xr,{children:"ID"}),c.jsx("div",{className:"text-muted-foreground mt-1 text-sm",children:n.data?.id||"—"}),c.jsx("div",{className:"text-muted-foreground mt-1 text-sm",children:"Share this ID with the organization owner of the Organization to join"})]}),c.jsx(_n,{...r,children:c.jsxs("form",{className:"space-y-4",onSubmit:r.handleSubmit(O=>s.mutate(O)),children:[c.jsx(qe,{control:r.control,name:"display_name",render:({field:O})=>c.jsxs(Pe,{children:[c.jsx(Ie,{children:"Display name"}),c.jsx(Be,{children:c.jsx(Ke,{placeholder:"Your name",...O})}),c.jsx(He,{})]})}),c.jsx(ce,{type:"submit",disabled:s.isPending,children:"Save"})]})})]}),c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx(xr,{children:"Organizations"}),c.jsxs(Mt,{open:S,onOpenChange:T,children:[c.jsx(wr,{asChild:!0,children:c.jsx(ce,{size:"sm",children:"New Organization"})}),c.jsxs(kt,{children:[c.jsxs(Lt,{children:[c.jsx(Ut,{children:"Create organization"}),c.jsx(um,{children:"Give it a name, and optionally assign your company domain."})]}),c.jsx(_n,{...z,children:c.jsxs("form",{className:"space-y-4",onSubmit:z.handleSubmit(O=>R.mutate(O)),children:[c.jsx(qe,{control:z.control,name:"name",render:({field:O})=>c.jsxs(Pe,{children:[c.jsx(Ie,{children:"Name"}),c.jsx(Be,{children:c.jsx(Ke,{placeholder:"Acme Inc.",...O})}),c.jsx(He,{})]})}),c.jsx(qe,{control:z.control,name:"domain",render:({field:O})=>c.jsxs(Pe,{children:[c.jsx(Ie,{children:"Domain (optional)"}),c.jsx(Be,{children:c.jsx(Ke,{placeholder:"acme.com",...O})}),c.jsx(He,{})]})}),c.jsxs(en,{children:[c.jsx(Bu,{asChild:!0,children:c.jsx(ce,{type:"button",variant:"outline",children:"Cancel"})}),c.jsx(ce,{type:"submit",disabled:R.isPending,children:"Create"})]})]})})]})]})]}),c.jsx("div",{className:"rounded-md border",children:c.jsxs(Za,{children:[c.jsx($a,{children:c.jsxs(ot,{children:[c.jsx(Ue,{children:"Name"}),c.jsx(Ue,{children:"Domain"})]})}),c.jsxs(Ga,{children:[n.data?.organizations?.map(O=>c.jsxs(ot,{children:[c.jsx(je,{children:O.name}),c.jsx(je,{children:O.domain??"—"})]},O.id)),(!n.data?.organizations||n.data.organizations.length===0)&&c.jsx(ot,{children:c.jsx(je,{colSpan:2,className:"text-muted-foreground",children:"No organizations"})})]})]})})]})]})})]}),c.jsx(LM,{}),c.jsxs(ja,{children:[c.jsxs(Xa,{className:"flex flex-row items-center justify-between space-y-0",children:[c.jsxs("div",{children:[c.jsx(Ya,{children:"User API Keys"}),c.jsx(Xm,{children:"Personal keys for API access."})]}),c.jsxs(Mt,{open:u,onOpenChange:d,children:[c.jsx(wr,{asChild:!0,children:c.jsx(ce,{children:"New Key"})}),c.jsxs(kt,{children:[c.jsxs(Lt,{children:[c.jsx(Ut,{children:"Create API Key"}),c.jsx(um,{children:"Give it a label and expiry."})]}),c.jsx(_n,{...g,children:c.jsxs("form",{className:"space-y-4",onSubmit:g.handleSubmit(O=>x.mutate(O)),children:[c.jsx(qe,{control:g.control,name:"name",render:({field:O})=>c.jsxs(Pe,{children:[c.jsx(Ie,{children:"Label"}),c.jsx(Be,{children:c.jsx(Ke,{placeholder:"CI script, local dev, ...",...O})}),c.jsx(He,{})]})}),c.jsx(qe,{control:g.control,name:"expires_in_hours",render:({field:O})=>c.jsxs(Pe,{children:[c.jsx(Ie,{children:"Expires in hours"}),c.jsx(Be,{children:c.jsx(Ke,{type:"number",inputMode:"numeric",placeholder:"e.g. 720",...O})}),c.jsx(He,{})]})}),c.jsxs(en,{children:[c.jsx(Bu,{asChild:!0,children:c.jsx(ce,{type:"button",variant:"outline",children:"Cancel"})}),c.jsx(ce,{type:"submit",disabled:x.isPending,children:"Create"})]})]})})]})]})]}),c.jsx(Aa,{children:c.jsx("div",{className:"overflow-x-auto rounded-md border",children:c.jsxs(Za,{className:"text-sm",children:[c.jsx(m8,{children:"Your user-scoped API keys."}),c.jsx($a,{children:c.jsxs(ot,{children:[c.jsx(Ue,{children:"Label"}),c.jsx(Ue,{children:"Created"}),c.jsx(Ue,{children:"Expires"}),c.jsx(Ue,{children:"Last used"}),c.jsx(Ue,{className:"w-24"})]})}),c.jsxs(Ga,{children:[o.data?.map(O=>c.jsxs(ot,{children:[c.jsx(je,{children:O.name??"—"}),c.jsx(je,{children:new Date(O.created_at).toLocaleString()}),c.jsx(je,{children:O.expires_at?new Date(O.expires_at).toLocaleString():"—"}),c.jsx(je,{children:O.last_used_at?new Date(O.last_used_at).toLocaleString():"—"}),c.jsx(je,{className:"text-right",children:c.jsxs(M7,{open:v===O.id,onOpenChange:j=>!j&&w(null),children:[c.jsx(k7,{asChild:!0,children:c.jsx(ce,{variant:"destructive",size:"sm",onClick:()=>w(O.id),children:"Delete"})}),c.jsxs(K7,{children:[c.jsxs(q7,{children:[c.jsx(I7,{children:"Delete this key?"}),c.jsx(H7,{children:"This action cannot be undone. Requests using this key will stop working."})]}),c.jsxs(P7,{children:[c.jsx(B7,{children:"Cancel"}),c.jsx(V7,{onClick:()=>E.mutate(O.id),children:"Delete"})]})]})]})})]},O.id)),(!o.data||o.data.length===0)&&c.jsx(ot,{children:c.jsx(je,{colSpan:5,className:"text-muted-foreground",children:"No API keys yet."})})]})]})})})]}),c.jsx(Mt,{open:!!m,onOpenChange:O=>!O&&p(null),children:c.jsxs(kt,{children:[c.jsxs(Lt,{children:[c.jsx(Ut,{children:"Copy your new API key"}),c.jsx(um,{children:"This is only shown once. Store it securely."})]}),c.jsx("div",{className:"rounded-md border p-3 font-mono text-sm break-all",children:m?.plain??"—"}),c.jsxs("div",{className:"flex justify-end gap-2",children:[c.jsx(ce,{variant:"outline",onClick:()=>{const O=m?.plain;O&&(navigator.clipboard.writeText(O),Ae.success("Copied"))},children:"Copy"}),c.jsx(ce,{onClick:()=>p(null),children:"Done"})]})]})})]})},Q7=Na({name:Bt(),expires_in_hours:W1().min(1).max(43800)}),J7=()=>{const e=rd(),n=pa(),r=Va.get(),s=Pn({enabled:!!r,queryKey:["org:keys",r],queryFn:()=>$e(()=>e.listOrgKeys({id:r}))}),o=wn({resolver:Sn(Q7),defaultValues:{name:"",expires_in_hours:720}}),[u,d]=b.useState(null),m=mt({mutationFn:g=>e.createOrgKey({id:r,body:g}),onSuccess:g=>{n.invalidateQueries({queryKey:["org:keys",r]}),d({key:g.org_key,secret:g.org_secret}),Ae.success("Key created"),o.reset({name:"",expires_in_hours:void 0})},onError:g=>Ae.error(g?.message??"Failed to create key")}),p=mt({mutationFn:g=>e.deleteOrgKey({id:r,keyId:g}),onSuccess:()=>{n.invalidateQueries({queryKey:["org:keys",r]}),Ae.success("Key deleted")},onError:g=>Ae.error(g?.message??"Failed to delete key")});return r?s.isLoading?c.jsx("p",{children:"Loading..."}):s.error?c.jsx("p",{className:"text-destructive",children:"Failed to load keys."}):c.jsxs(ja,{children:[c.jsx(Xa,{children:c.jsx(Ya,{children:"Org API Keys"})}),c.jsxs(Aa,{className:"space-y-6",children:[c.jsx(_n,{...o,children:c.jsxs("form",{onSubmit:o.handleSubmit(g=>m.mutate(g)),className:"grid grid-cols-1 items-end gap-3 md:grid-cols-12",children:[c.jsx("div",{className:"md:col-span-6",children:c.jsx(qe,{control:o.control,name:"name",render:({field:g})=>c.jsxs(Pe,{children:[c.jsx(Ie,{children:"Name"}),c.jsx(Be,{children:c.jsx(Ke,{placeholder:"automation-bot",...g})}),c.jsx(He,{})]})})}),c.jsx("div",{className:"md:col-span-4",children:c.jsx(qe,{control:o.control,name:"expires_in_hours",render:({field:g})=>c.jsxs(Pe,{children:[c.jsx(Ie,{children:"Expires In (hours)"}),c.jsx(Be,{children:c.jsx(Ke,{placeholder:"e.g. 720",...g})}),c.jsx(He,{})]})})}),c.jsx("div",{className:"md:col-span-2",children:c.jsx(ce,{type:"submit",className:"w-full",disabled:m.isPending,children:"Create"})})]})}),c.jsx("div",{className:"overflow-x-auto rounded-md border",children:c.jsxs(Za,{children:[c.jsx($a,{children:c.jsxs(ot,{children:[c.jsx(Ue,{children:"Name"}),c.jsx(Ue,{children:"Scope"}),c.jsx(Ue,{children:"Created"}),c.jsx(Ue,{children:"Expires"}),c.jsx(Ue,{className:"w-28"})]})}),c.jsxs(Ga,{children:[s.data?.map(g=>c.jsxs(ot,{children:[c.jsx(je,{children:g.name??"-"}),c.jsx(je,{children:g.scope}),c.jsx(je,{children:new Date(g.created_at).toLocaleString()}),c.jsx(je,{children:g.expires_at?new Date(g.expires_at).toLocaleString():"-"}),c.jsx(je,{className:"text-right",children:c.jsx(ce,{variant:"destructive",size:"sm",onClick:()=>p.mutate(g.id),children:"Delete"})})]},g.id)),s.data?.length===0&&c.jsx(ot,{children:c.jsx(je,{colSpan:5,className:"text-muted-foreground p-4",children:"No keys."})})]})]})}),c.jsx(Mt,{open:!!u,onOpenChange:g=>!g&&d(null),children:c.jsxs(kt,{children:[c.jsx(Lt,{children:c.jsx(Ut,{children:"Copy your credentials"})}),c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{children:[c.jsx("div",{className:"text-muted-foreground mb-1 text-xs",children:"Org Key"}),c.jsx(Ke,{readOnly:!0,value:u?.key??"",onFocus:g=>g.currentTarget.select()})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-muted-foreground mb-1 text-xs",children:"Org Secret"}),c.jsx(Ke,{readOnly:!0,value:u?.secret??"",onFocus:g=>g.currentTarget.select()})]}),c.jsx("p",{className:"text-muted-foreground text-xs",children:"This secret is shown once. Store it securely."})]}),c.jsx(en,{children:c.jsx(ce,{onClick:()=>d(null),children:"Done"})})]})})]})]}):c.jsx("p",{className:"text-muted-foreground",children:"Pick an organization."})},W7=Na({user_id:x6("Invalid UUID"),role:Bi(["owner","admin","member"])}),eL=()=>{const e=rd(),n=pa(),r=Va.get(),[s,o]=b.useState(null),u=Pn({enabled:!!r,queryKey:["org:members",r],queryFn:()=>$e(()=>e.listMembers({id:r}))}),d=b.useMemo(()=>(u.data??[]).filter(w=>w.role==="owner").length,[u.data]),m=wn({resolver:Sn(W7),defaultValues:{user_id:"",role:"member"}}),p=mt({mutationFn:w=>e.addOrUpdateMember({id:r,body:w}),onSuccess:()=>{Ae.success("Member added/updated"),n.invalidateQueries({queryKey:["org:members",r]}),m.reset({user_id:"",role:"member"})},onError:w=>Ae.error(w?.message??"Failed")}),g=mt({mutationFn:w=>e.removeMember({id:r,userId:w}),onSuccess:()=>{Ae.success("Member removed"),n.invalidateQueries({queryKey:["org:members",r]})},onError:w=>Ae.error(w?.message??"Failed")}),x=mt({mutationFn:({userId:w,role:E})=>e.addOrUpdateMember({id:r,body:{user_id:w,role:E}}),onMutate:async({userId:w,role:E})=>{o(w),await n.cancelQueries({queryKey:["org:members",r]});const A=n.getQueryData(["org:members",r]);return n.setQueryData(["org:members",r],(S=[])=>S.map(T=>T.user_id===w?{...T,role:E}:T)),{prev:A}},onError:(w,E,A)=>{A?.prev&&n.setQueryData(["org:members",r],A.prev),Ae.error(w?.message??"Failed to update role")},onSuccess:()=>{Ae.success("Role updated")},onSettled:()=>{o(null),n.invalidateQueries({queryKey:["org:members",r]})}}),v=w=>!(w.role==="owner"&&d<=1);return r?u.isLoading?c.jsx("p",{children:"Loading..."}):u.error?c.jsx("p",{className:"text-destructive",children:"Failed to load members."}):c.jsxs(ja,{children:[c.jsx(Xa,{children:c.jsx(Ya,{children:"Members"})}),c.jsxs(Aa,{className:"space-y-6",children:[c.jsx(_n,{...m,children:c.jsxs("form",{className:"grid grid-cols-1 items-end gap-3 md:grid-cols-12",onSubmit:m.handleSubmit(w=>p.mutate(w)),children:[c.jsx("div",{className:"md:col-span-6",children:c.jsx(qe,{control:m.control,name:"user_id",render:({field:w})=>c.jsxs(Pe,{children:[c.jsx(Ie,{children:"User ID"}),c.jsx(Be,{children:c.jsx(Ke,{placeholder:"UUID",...w})}),c.jsx(He,{})]})})}),c.jsx("div",{className:"md:col-span-4",children:c.jsx(qe,{control:m.control,name:"role",render:({field:w})=>c.jsxs(Pe,{children:[c.jsx(Ie,{children:"Role"}),c.jsxs(mn,{onValueChange:w.onChange,value:w.value,children:[c.jsx(gn,{children:c.jsx(pn,{placeholder:"Select role"})}),c.jsxs(vn,{children:[c.jsx(ct,{value:"member",children:"member"}),c.jsx(ct,{value:"admin",children:"admin"}),c.jsx(ct,{value:"owner",children:"owner"})]})]}),c.jsx(He,{})]})})}),c.jsx("div",{className:"md:col-span-2",children:c.jsx(ce,{type:"submit",className:"w-full",disabled:p.isPending,children:"Save"})})]})}),c.jsx("div",{className:"overflow-x-auto rounded-md border",children:c.jsxs(Za,{children:[c.jsx($a,{children:c.jsxs(ot,{children:[c.jsx(Ue,{children:"Id"}),c.jsx(Ue,{children:"User"}),c.jsx(Ue,{children:"Role"}),c.jsx(Ue,{className:"w-28"})]})}),c.jsxs(Ga,{children:[u.data?.map(w=>{const E=s===w.user_id;return c.jsxs(ot,{className:"align-middle",children:[c.jsx(je,{className:"font-mono text-xs",children:w.user_id}),c.jsx(je,{children:w.email}),c.jsx(je,{className:"capitalize",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs(mn,{value:w.role,onValueChange:A=>{if(w.role!==A){if(w.role==="owner"&&A!=="owner"&&!v(w)){Ae.error("You cannot demote the last owner.");return}x.mutate({userId:w.user_id,role:A})}},disabled:E,children:[c.jsx(gn,{className:"h-8 w-[140px]",children:c.jsx(pn,{})}),c.jsxs(vn,{children:[c.jsx(ct,{value:"member",children:"member"}),c.jsx(ct,{value:"admin",children:"admin"}),c.jsx(ct,{value:"owner",children:"owner"})]})]}),E&&c.jsx(Qs,{className:"h-4 w-4 animate-spin"})]})}),c.jsx(je,{className:"text-right",children:c.jsx(ce,{variant:"destructive",size:"sm",onClick:()=>g.mutate(w.user_id),disabled:w.role==="owner"&&d<=1,title:w.role==="owner"&&d<=1?"Cannot remove the last owner":"",children:"Remove"})})]},w.user_id)}),u.data?.length===0&&c.jsx(ot,{children:c.jsx(je,{colSpan:3,className:"text-muted-foreground p-4",children:"No members."})})]})]})})]})]}):c.jsx("p",{className:"text-muted-foreground",children:"Pick an organization."})},tL=Na({name:Bt().min(1,"Required"),domain:Bt().optional()}),nL=()=>{const e=rd(),n=pa(),r=Va.get(),s=Pn({enabled:!!r,queryKey:["org",r],queryFn:()=>$e(()=>e.getOrg({id:r}))}),o=wn({resolver:Sn(tL),defaultValues:{name:"",domain:""}});b.useEffect(()=>{s.data&&o.reset({name:s.data.name??"",domain:s.data.domain??""})},[s.data]);const u=mt({mutationFn:p=>e.updateOrg({id:r,body:p}),onSuccess:()=>{n.invalidateQueries({queryKey:["org",r]}),Ae.success("Organization updated")},onError:p=>Ae.error(p?.message??"Update failed")}),d=mt({mutationFn:()=>e.deleteOrg({id:r}),onSuccess:()=>{Ae.success("Organization deleted"),Va.set(""),n.invalidateQueries({queryKey:["orgs:mine"]})},onError:p=>Ae.error(p?.message??"Delete failed")});if(!r)return c.jsx("p",{className:"text-muted-foreground",children:"Pick an organization."});if(s.isLoading)return c.jsx("p",{children:"Loading..."});if(s.error)return c.jsx("p",{className:"text-destructive",children:"Failed to load."});const m=p=>{const g={};p.name!==s.data?.name&&(g.name=p.name);const x=p.domain?.trim()||void 0;(x??null)!==(s.data?.domain??null)&&(g.domain=x),Object.keys(g).length!==0&&u.mutate(g)};return c.jsxs(ja,{children:[c.jsx(Xa,{children:c.jsx(Ya,{children:"Organization Settings"})}),c.jsx(Aa,{className:"space-y-6",children:c.jsx(_n,{...o,children:c.jsxs("form",{className:"space-y-4",onSubmit:o.handleSubmit(m),children:[c.jsx(qe,{control:o.control,name:"name",render:({field:p})=>c.jsxs(Pe,{children:[c.jsx(Ie,{children:"Name"}),c.jsx(Be,{children:c.jsx(Ke,{...p})}),c.jsx(He,{})]})}),c.jsx(qe,{control:o.control,name:"domain",render:({field:p})=>c.jsxs(Pe,{children:[c.jsx(Ie,{children:"Domain (optional)"}),c.jsx(Be,{children:c.jsx(Ke,{placeholder:"acme.com",...p})}),c.jsx(He,{})]})}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(ce,{type:"submit",disabled:u.isPending,children:"Save"}),c.jsx(ce,{type:"button",variant:"destructive",onClick:()=>d.mutate(),disabled:d.isPending,children:"Delete Org"})]})]})})})]})},pl=CT(),Tu={listServers:()=>$e(async()=>await pl.listServers()),createServer:e=>$e(async()=>await pl.createServer({body:e})),getServer:e=>$e(async()=>await pl.getServer({id:e})),updateServer:(e,n)=>$e(async()=>await pl.updateServer({id:e,body:n})),deleteServer:e=>$e(async()=>{await pl.deleteServer({id:e})})},gl=ET(),Fs={listSshKeys:()=>$e(async()=>await gl.listPublicSshKeys()),createSshKey:e=>$e(async()=>await gl.createSSHKey({body:e})),getSshKeyById:e=>$e(async()=>await gl.getSSHKey({id:e})),revealSshKeyById:e=>$e(async()=>await gl.getSSHKey({id:e,reveal:!0})),deleteSshKey:e=>$e(async()=>{await gl.deleteSSHKey({id:e})}),downloadJson:(e,n)=>$e(async()=>{const r=new URL(`/api/v1/ssh/${e}/download`,window.location.origin);r.searchParams.set("part",n),r.searchParams.set("mode","json");const s=await fetch(r.toString());if(!s.ok)throw new Error(`Download failed: ${s.statusText}`);return await s.json()}),downloadBlob:(e,n)=>$e(async()=>{const r=new URL(`/api/v1/ssh/${e}/download`,window.location.origin);r.searchParams.set("part",n);const s=await fetch(r.toString());if(!s.ok)throw new Error(`Download failed: ${s.statusText}`);const o=s.headers.get("Content-Disposition")||"",d=/filename="([^"]+)"/i.exec(o)?.[1]??"ssh-key-download",m=await s.blob();return{filename:d,blob:m}})},Ru=43200,G0=1440,X0=Symbol.for("constructDateFrom");function tg(e,n){return typeof e=="function"?e(n):e&&typeof e=="object"&&X0 in e?e[X0](n):e instanceof Date?new e.constructor(n):new Date(n)}function ri(e,n){return tg(e,e)}let aL={};function rL(){return aL}function Y0(e){const n=ri(e),r=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return r.setUTCFullYear(n.getFullYear()),+e-+r}function ng(e,...n){const r=tg.bind(null,e||n.find(s=>typeof s=="object"));return n.map(r)}function Lu(e,n){const r=+ri(e)-+ri(n);return r<0?-1:r>0?1:r}function iL(e){return tg(e,Date.now())}function sL(e,n,r){const[s,o]=ng(r?.in,e,n),u=s.getFullYear()-o.getFullYear(),d=s.getMonth()-o.getMonth();return u*12+d}function oL(e){return n=>{const s=(e?Math[e]:Math.trunc)(n);return s===0?0:s}}function lL(e,n){return+ri(e)-+ri(n)}function cL(e,n){const r=ri(e);return r.setHours(23,59,59,999),r}function uL(e,n){const r=ri(e),s=r.getMonth();return r.setFullYear(r.getFullYear(),s+1,0),r.setHours(23,59,59,999),r}function dL(e,n){const r=ri(e);return+cL(r)==+uL(r)}function fL(e,n,r){const[s,o,u]=ng(r?.in,e,e,n),d=Lu(o,u),m=Math.abs(sL(o,u));if(m<1)return 0;o.getMonth()===1&&o.getDate()>27&&o.setDate(30),o.setMonth(o.getMonth()-d*m);let p=Lu(o,u)===-d;dL(s)&&m===1&&Lu(s,u)===1&&(p=!1);const g=d*(m-+p);return g===0?0:g}function hL(e,n,r){const s=lL(e,n)/1e3;return oL(r?.roundingMethod)(s)}const mL={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},pL=(e,n,r)=>{let s;const o=mL[e];return typeof o=="string"?s=o:n===1?s=o.one:s=o.other.replace("{{count}}",n.toString()),r?.addSuffix?r.comparison&&r.comparison>0?"in "+s:s+" ago":s};function bm(e){return(n={})=>{const r=n.width?String(n.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const gL={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},vL={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},yL={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},bL={date:bm({formats:gL,defaultWidth:"full"}),time:bm({formats:vL,defaultWidth:"full"}),dateTime:bm({formats:yL,defaultWidth:"full"})},xL={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},wL=(e,n,r,s)=>xL[e];function vl(e){return(n,r)=>{const s=r?.context?String(r.context):"standalone";let o;if(s==="formatting"&&e.formattingValues){const d=e.defaultFormattingWidth||e.defaultWidth,m=r?.width?String(r.width):d;o=e.formattingValues[m]||e.formattingValues[d]}else{const d=e.defaultWidth,m=r?.width?String(r.width):e.defaultWidth;o=e.values[m]||e.values[d]}const u=e.argumentCallback?e.argumentCallback(n):n;return o[u]}}const SL={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},_L={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},EL={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},CL={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},jL={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},AL={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},OL=(e,n)=>{const r=Number(e),s=r%100;if(s>20||s<10)switch(s%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},TL={ordinalNumber:OL,era:vl({values:SL,defaultWidth:"wide"}),quarter:vl({values:_L,defaultWidth:"wide",argumentCallback:e=>e-1}),month:vl({values:EL,defaultWidth:"wide"}),day:vl({values:CL,defaultWidth:"wide"}),dayPeriod:vl({values:jL,defaultWidth:"wide",formattingValues:AL,defaultFormattingWidth:"wide"})};function yl(e){return(n,r={})=>{const s=r.width,o=s&&e.matchPatterns[s]||e.matchPatterns[e.defaultMatchWidth],u=n.match(o);if(!u)return null;const d=u[0],m=s&&e.parsePatterns[s]||e.parsePatterns[e.defaultParseWidth],p=Array.isArray(m)?NL(m,v=>v.test(d)):RL(m,v=>v.test(d));let g;g=e.valueCallback?e.valueCallback(p):p,g=r.valueCallback?r.valueCallback(g):g;const x=n.slice(d.length);return{value:g,rest:x}}}function RL(e,n){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&n(e[r]))return r}function NL(e,n){for(let r=0;r{const s=n.match(e.matchPattern);if(!s)return null;const o=s[0],u=n.match(e.parsePattern);if(!u)return null;let d=e.valueCallback?e.valueCallback(u[0]):u[0];d=r.valueCallback?r.valueCallback(d):d;const m=n.slice(o.length);return{value:d,rest:m}}}const zL=/^(\d+)(th|st|nd|rd)?/i,ML=/\d+/i,kL={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},LL={any:[/^b/i,/^(a|c)/i]},UL={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},KL={any:[/1/i,/2/i,/3/i,/4/i]},qL={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},PL={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},IL={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},HL={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},VL={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},BL={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},FL={ordinalNumber:DL({matchPattern:zL,parsePattern:ML,valueCallback:e=>parseInt(e,10)}),era:yl({matchPatterns:kL,defaultMatchWidth:"wide",parsePatterns:LL,defaultParseWidth:"any"}),quarter:yl({matchPatterns:UL,defaultMatchWidth:"wide",parsePatterns:KL,defaultParseWidth:"any",valueCallback:e=>e+1}),month:yl({matchPatterns:qL,defaultMatchWidth:"wide",parsePatterns:PL,defaultParseWidth:"any"}),day:yl({matchPatterns:IL,defaultMatchWidth:"wide",parsePatterns:HL,defaultParseWidth:"any"}),dayPeriod:yl({matchPatterns:VL,defaultMatchWidth:"any",parsePatterns:BL,defaultParseWidth:"any"})},ZL={code:"en-US",formatDistance:pL,formatLong:bL,formatRelative:wL,localize:TL,match:FL,options:{weekStartsOn:0,firstWeekContainsDate:1}};function $L(e,n,r){const s=rL(),o=r?.locale??s.locale??ZL,u=2520,d=Lu(e,n);if(isNaN(d))throw new RangeError("Invalid time value");const m=Object.assign({},r,{addSuffix:r?.addSuffix,comparison:d}),[p,g]=ng(r?.in,...d>0?[n,e]:[e,n]),x=hL(g,p),v=(Y0(g)-Y0(p))/1e3,w=Math.round((x-v)/60);let E;if(w<2)return r?.includeSeconds?x<5?o.formatDistance("lessThanXSeconds",5,m):x<10?o.formatDistance("lessThanXSeconds",10,m):x<20?o.formatDistance("lessThanXSeconds",20,m):x<40?o.formatDistance("halfAMinute",0,m):x<60?o.formatDistance("lessThanXMinutes",1,m):o.formatDistance("xMinutes",1,m):w===0?o.formatDistance("lessThanXMinutes",1,m):o.formatDistance("xMinutes",w,m);if(w<45)return o.formatDistance("xMinutes",w,m);if(w<90)return o.formatDistance("aboutXHours",1,m);if(we.role!=="bastion"||e.public_ip_address&&e.public_ip_address.trim()!=="",{message:"Public IP required for bastion",path:["public_ip_address"]}),XL=X_.partial();function YL({status:e}){const n=e==="ready"?"default":e==="provisioning"?"secondary":e==="failed"?"destructive":"outline";return c.jsx(mo,{variant:n,className:"capitalize",children:e})}const QL=()=>{const[e,n]=b.useState(""),[r,s]=b.useState(!1),[o,u]=b.useState(!1),[d,m]=b.useState(null),[p,g]=b.useState(""),[x,v]=b.useState(""),[w,E]=b.useState(null),A=pa(),S=Pn({queryKey:["servers"],queryFn:()=>Tu.listServers()}),T=Pn({queryKey:["ssh_keys"],queryFn:()=>Fs.listSshKeys()}),z=b.useMemo(()=>{const C=new Map;for(const L of T.data??[]){const K=L.name?L.name:"Unnamed key",de=L.fingerprint?Mi(L.fingerprint,8):"";C.set(L.id,de?`${K} — ${de}`:K)}return C},[T.data]),R=wn({resolver:Sn(X_),defaultValues:{hostname:"",private_ip_address:"",public_ip_address:"",role:"worker",ssh_key_id:"",ssh_user:"",status:"pending"},mode:"onChange"}),O=R.watch("role")==="bastion",j=R.watch("public_ip_address")?.trim()??"",N=O&&j==="",B=mt({mutationFn:C=>Tu.createServer(C),onSuccess:async()=>{await A.invalidateQueries({queryKey:["servers"]}),R.reset(),s(!1),Ae.success("Server created successfully")},onError:C=>{Ae.error(C?.message??"Failed to create server")}}),H=wn({resolver:Sn(XL),defaultValues:{},mode:"onChange"}),$=H.watch("role")==="bastion",ue=H.watch("public_ip_address")?.trim()??"",ye=$&&ue==="",ge=mt({mutationFn:({id:C,values:L})=>Tu.updateServer(C,L),onSuccess:async()=>{await A.invalidateQueries({queryKey:["servers"]}),u(!1),E(null),Ae.success("Server updated successfully")},onError:C=>{Ae.error(C?.message??"Failed to update server")}}),re=mt({mutationFn:C=>Tu.deleteServer(C),onSuccess:async()=>{await A.invalidateQueries({queryKey:["servers"]}),m(null),Ae.success("Server deleted successfully")},onError:C=>{Ae.error(C?.message??"Failed to delete server")}}),le=b.useMemo(()=>{const C=S.data??[],L=e.trim().toLowerCase(),K=L?C.filter(ze=>ze.hostname?.toLowerCase().includes(L)||ze.public_ip_address?.toLowerCase().includes(L)||ze.private_ip_address?.toLowerCase().includes(L)||ze.role?.toLowerCase().includes(L)||ze.ssh_user?.toLowerCase().includes(L)):C,de=x?K.filter(ze=>ze.role===x):K;return p?de.filter(ze=>ze.status===p):de},[e,x,p,S.data]),he=C=>{B.mutate(C)},ve=C=>{E(C.id),H.reset({hostname:C.hostname??"",public_ip_address:C.public_ip_address??"",private_ip_address:C.private_ip_address??"",role:C.role??"worker",ssh_key_id:C.ssh_key_id??"",ssh_user:C.ssh_user??"",status:C.status??"pending"}),u(!0)};return T.data?.length===0?c.jsx("div",{className:"p-6",children:"Please create an SSH key for your organization first."}):S.isLoading?c.jsx("div",{className:"p-6",children:"Loading servers…"}):S.error?c.jsx("div",{className:"p-6 text-red-500",children:"Error loading servers."}):c.jsxs(Sd,{children:[c.jsxs("div",{className:"space-y-4 p-6",children:[c.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[c.jsx("h1",{className:"mb-4 text-2xl font-bold",children:"Servers"}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsxs("div",{className:"relative",children:[c.jsx(io,{className:"absolute top-2.5 left-2 h-4 w-4 opacity-60"}),c.jsx(Ke,{value:e,onChange:C=>n(C.target.value),placeholder:"Search hostname, Public IP, Private IP, role, user…",className:"w-64 pl-8"})]}),c.jsxs(mn,{value:x||"all",onValueChange:C=>v(C==="all"?"":C),children:[c.jsx(gn,{className:"w-36",children:c.jsx(pn,{placeholder:"Role (all)"})}),c.jsxs(vn,{children:[c.jsx(ct,{value:"all",children:"All roles"}),G_.map(C=>c.jsx(ct,{value:C,children:C},C))]})]}),c.jsxs(mn,{value:p||"all",onValueChange:C=>g(C==="all"?"":C),children:[c.jsx(gn,{className:"w-40",children:c.jsx(pn,{placeholder:"Status (all)"})}),c.jsxs(vn,{children:[c.jsx(ct,{value:"all",children:"All statuses"})," ",Uu.map(C=>c.jsx(ct,{value:C,children:C},C))]})]}),c.jsxs(Mt,{open:r,onOpenChange:s,children:[c.jsx(wr,{asChild:!0,children:c.jsxs(ce,{onClick:()=>s(!0),children:[c.jsx(ro,{className:"mr-2 h-4 w-4"}),"Create Server"]})}),c.jsxs(kt,{className:"sm:max-w-lg",children:[c.jsx(Lt,{children:c.jsx(Ut,{children:"Create server"})}),c.jsx(_n,{...R,children:c.jsxs("form",{className:"space-y-4",onSubmit:R.handleSubmit(he),children:[c.jsx(qe,{control:R.control,name:"hostname",render:({field:C})=>c.jsxs(Pe,{children:[c.jsx(Ie,{children:"Hostname"}),c.jsx(Be,{children:c.jsx(Ke,{placeholder:"worker-01",...C})}),c.jsx(He,{})]})}),c.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[c.jsx(qe,{control:R.control,name:"public_ip_address",render:({field:C})=>c.jsxs(Pe,{children:[c.jsxs(Ie,{className:"flex items-center justify-between",children:[c.jsx("span",{children:"Public IP Address"}),c.jsx("span",{className:oe("rounded-full px-2 py-0.5 text-xs",O?"bg-amber-100 text-amber-900":"bg-muted text-muted-foreground"),children:O?"Required for bastion":"Optional"})]}),c.jsx(Be,{children:c.jsx(Ke,{placeholder:O?"Required for bastion (e.g. 34.12.56.78)":"34.12.56.78","aria-required":O,"aria-invalid":N||!!R.formState.errors.public_ip_address,required:O,...C,className:oe(N&&"border-destructive focus-visible:ring-destructive")})}),O&&c.jsxs("div",{className:"rounded-md border border-amber-200 bg-amber-50 p-2 text-xs text-amber-900",children:["Bastion nodes must have a"," ",c.jsx("span",{className:"font-medium",children:"Public IP"}),"."]}),c.jsx(He,{})]})}),c.jsx(qe,{control:R.control,name:"private_ip_address",render:({field:C})=>c.jsxs(Pe,{children:[c.jsx(Ie,{children:"Private IP Address"}),c.jsx(Be,{children:c.jsx(Ke,{placeholder:"192.168.10.1",...C})}),c.jsx(He,{})]})})]}),c.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[c.jsx(qe,{control:R.control,name:"role",render:({field:C})=>c.jsxs(Pe,{children:[c.jsx(Ie,{children:"Role"}),c.jsxs(mn,{onValueChange:L=>R.setValue("role",L,{shouldDirty:!0,shouldValidate:!0}),value:C.value,children:[c.jsx(Be,{children:c.jsx(gn,{children:c.jsx(pn,{placeholder:"Select role"})})}),c.jsxs(vn,{children:[c.jsx(ct,{value:"master",children:"master"}),c.jsx(ct,{value:"worker",children:"worker"}),c.jsx(ct,{value:"bastion",children:"bastion — requires Public IP"})]})]}),c.jsx(He,{})]})}),c.jsx(qe,{control:R.control,name:"ssh_user",render:({field:C})=>c.jsxs(Pe,{children:[c.jsx(Ie,{children:"SSH user"}),c.jsx(Be,{children:c.jsx(Ke,{placeholder:"ubuntu",...C})}),c.jsx(He,{})]})})]}),c.jsx(qe,{control:R.control,name:"ssh_key_id",render:({field:C})=>c.jsxs(Pe,{children:[c.jsx(Ie,{children:"SSH key"}),c.jsxs(mn,{onValueChange:C.onChange,value:C.value,children:[c.jsx(Be,{children:c.jsx(gn,{children:c.jsx(pn,{placeholder:T.data?.length?"Select SSH key":"No SSH keys found"})})}),c.jsx(vn,{children:T.data.map(L=>c.jsxs(ct,{value:L.id,children:[L.name?L.name:"Unnamed key"," —"," ",Mi(L.fingerprint,8)]},L.id))})]}),c.jsx(He,{})]})}),c.jsx(qe,{control:R.control,name:"status",render:({field:C})=>c.jsxs(Pe,{children:[c.jsx(Ie,{children:"Initial status"}),c.jsxs(mn,{onValueChange:C.onChange,value:C.value,children:[c.jsx(Be,{children:c.jsx(gn,{children:c.jsx(pn,{placeholder:"pending"})})}),c.jsx(vn,{children:Uu.map(L=>c.jsx(ct,{value:L,children:L},L))})]}),c.jsx(He,{})]})}),c.jsxs(en,{className:"gap-2",children:[c.jsx(ce,{type:"button",variant:"outline",onClick:()=>s(!1),children:"Cancel"}),c.jsx(ce,{type:"submit",disabled:B.isPending||R.formState.isSubmitting||!R.formState.isValid,children:B.isPending?"Creating…":"Create"})]})]})})]})]})]})]}),c.jsx("div",{className:"bg-background overflow-hidden rounded-2xl border shadow-sm",children:c.jsx("div",{className:"overflow-x-auto",children:c.jsxs(Za,{children:[c.jsx($a,{children:c.jsxs(ot,{children:[c.jsx(Ue,{children:"Hostname"}),c.jsx(Ue,{children:"IP address"}),c.jsx(Ue,{children:"Role"}),c.jsx(Ue,{children:"SSH user"}),c.jsx(Ue,{children:"SSH key"}),c.jsx(Ue,{children:"Status"}),c.jsx(Ue,{children:"Created"}),c.jsx(Ue,{className:"w-[220px] text-right",children:"Actions"})]})}),c.jsx(Ga,{children:le.length===0?c.jsx(ot,{children:c.jsx(je,{colSpan:8,className:"text-muted-foreground py-10 text-center text-sm",children:"No servers found."})}):le.map(C=>c.jsxs(ot,{children:[c.jsx(je,{className:"font-medium",children:C.hostname}),c.jsx(je,{children:c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:oe("tabular-nums",!C.public_ip_address&&"text-muted-foreground"),children:C.public_ip_address||"—"}),c.jsx("span",{className:"text-muted-foreground tabular-nums",children:C.private_ip_address})]})}),c.jsx(je,{className:"capitalize",children:c.jsx("span",{className:oe(C.role==="bastion"&&"rounded bg-amber-50 px-2 py-0.5 dark:bg-amber-900"),children:C.role})}),c.jsx(je,{className:"tabular-nums",children:C.ssh_user}),c.jsx(je,{className:"truncate",children:z.get(C.ssh_key_id)??"—"}),c.jsx(je,{children:c.jsx(YL,{status:C.status??"pending"})}),c.jsx(je,{title:C.created_at,children:C.created_at?`${GL(new Date(C.created_at),{addSuffix:!0})}`:"—"}),c.jsx(je,{className:"text-right",children:c.jsxs("div",{className:"flex justify-end gap-2",children:[c.jsx(ce,{variant:"outline",size:"sm",onClick:()=>ve(C),children:"Edit"}),c.jsx(ce,{variant:"destructive",size:"sm",onClick:()=>m(C.id),disabled:re.isPending&&d===C.id,children:re.isPending&&d===C.id?"Deleting…":"Delete"})]})})]},C.id))})]})})})]}),c.jsx(Mt,{open:o,onOpenChange:u,children:c.jsxs(kt,{className:"sm:max-w-lg",children:[c.jsx(Lt,{children:c.jsx(Ut,{children:"Edit server"})}),c.jsx(_n,{...H,children:c.jsxs("form",{className:"space-y-4",onSubmit:H.handleSubmit(C=>{w&&ge.mutate({id:w,values:C})}),children:[c.jsx(qe,{control:H.control,name:"hostname",render:({field:C})=>c.jsxs(Pe,{children:[c.jsx(Ie,{children:"Hostname"}),c.jsx(Be,{children:c.jsx(Ke,{placeholder:"worker-01",...C})}),c.jsx(He,{})]})}),c.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[c.jsx(qe,{control:H.control,name:"public_ip_address",render:({field:C})=>c.jsxs(Pe,{children:[c.jsxs(Ie,{className:"flex items-center justify-between",children:[c.jsx("span",{children:"Public IP Address"}),c.jsx("span",{className:oe("rounded-full px-2 py-0.5 text-xs",$?"bg-amber-100 text-amber-900":"bg-muted text-muted-foreground"),children:$?"Required for bastion":"Optional"})]}),c.jsx(Be,{children:c.jsx(Ke,{placeholder:$?"Required for bastion (e.g. 34.12.56.78)":"34.12.56.78","aria-required":$,"aria-invalid":ye||!!H.formState.errors.public_ip_address,required:$,...C,className:oe(ye&&"border-destructive focus-visible:ring-destructive")})}),$&&c.jsxs("div",{className:"rounded-md border border-amber-200 bg-amber-50 p-2 text-xs text-amber-900",children:["Bastion nodes must have a ",c.jsx("span",{className:"font-medium",children:"Public IP"}),"."]}),c.jsx(He,{})]})}),c.jsx(qe,{control:H.control,name:"private_ip_address",render:({field:C})=>c.jsxs(Pe,{children:[c.jsx(Ie,{children:"Private IP Address"}),c.jsx(Be,{children:c.jsx(Ke,{placeholder:"192.168.10.1",...C})}),c.jsx(He,{})]})})]}),c.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[c.jsx(qe,{control:H.control,name:"role",render:({field:C})=>c.jsxs(Pe,{children:[c.jsx(Ie,{children:"Role"}),c.jsxs(mn,{onValueChange:L=>H.setValue("role",L,{shouldDirty:!0,shouldValidate:!0}),value:C.value,children:[c.jsx(Be,{children:c.jsx(gn,{children:c.jsx(pn,{placeholder:"Select role"})})}),c.jsxs(vn,{children:[c.jsx(ct,{value:"master",children:"master"}),c.jsx(ct,{value:"worker",children:"worker"}),c.jsx(ct,{value:"bastion",children:"bastion — requires Public IP"})]})]}),c.jsx(He,{})]})}),c.jsx(qe,{control:H.control,name:"ssh_user",render:({field:C})=>c.jsxs(Pe,{children:[c.jsx(Ie,{children:"SSH user"}),c.jsx(Be,{children:c.jsx(Ke,{placeholder:"ubuntu",...C})}),c.jsx(He,{})]})})]}),c.jsx(qe,{control:H.control,name:"ssh_key_id",render:({field:C})=>c.jsxs(Pe,{children:[c.jsx(Ie,{children:"SSH key"}),c.jsxs(mn,{onValueChange:C.onChange,value:C.value,children:[c.jsx(Be,{children:c.jsx(gn,{children:c.jsx(pn,{placeholder:"Select SSH key"})})}),c.jsx(vn,{children:T.data.map(L=>c.jsxs(ct,{value:L.id,children:[L.name?L.name:"Unnamed key"," — ",Mi(L.fingerprint,8)]},L.id))})]}),c.jsx(He,{})]})}),c.jsx(qe,{control:H.control,name:"status",render:({field:C})=>c.jsxs(Pe,{children:[c.jsx(Ie,{children:"Status"}),c.jsxs(mn,{onValueChange:C.onChange,value:C.value,children:[c.jsx(Be,{children:c.jsx(gn,{children:c.jsx(pn,{placeholder:"pending"})})}),c.jsx(vn,{children:Uu.map(L=>c.jsx(ct,{value:L,children:L},L))})]}),c.jsx(He,{})]})}),c.jsxs(en,{className:"gap-2",children:[c.jsx(ce,{type:"button",variant:"outline",onClick:()=>u(!1),children:"Cancel"}),c.jsx(ce,{type:"submit",disabled:ge.isPending,children:ge.isPending?"Saving…":"Save changes"})]})]})})]})}),c.jsx(Mt,{open:!!d,onOpenChange:C=>!C&&m(null),children:c.jsxs(kt,{className:"sm:max-w-md",children:[c.jsx(Lt,{children:c.jsx(Ut,{children:"Delete server"})}),c.jsx("p",{className:"text-muted-foreground text-sm",children:"This action cannot be undone. Are you sure you want to delete this server?"}),c.jsxs(en,{className:"gap-2",children:[c.jsx(ce,{variant:"outline",onClick:()=>m(null),children:"Cancel"}),c.jsx(ce,{variant:"destructive",onClick:()=>d&&re.mutate(d),disabled:re.isPending,children:re.isPending?"Deleting…":"Delete"})]})]})})]})},JL=Na({name:Bt().trim().min(1,"Name is required").max(100,"Max 100 characters"),comment:Bt().trim().min(1,"Comment is required").max(100,"Max 100 characters"),bits:Bi(["2048","3072","4096"]).optional(),type:Bi(["rsa","ed25519"]).optional()});function WL(e,n){const r=URL.createObjectURL(e),s=document.createElement("a");s.href=r,s.download=n,document.body.appendChild(s),s.click(),s.remove(),URL.revokeObjectURL(r)}function xm(e,n="Copied"){navigator.clipboard.writeText(e).then(()=>Ae.success(n)).catch(()=>Ae.error("Copy failed"))}function e9(e){return e?.split(/\s+/)?.[0]??"ssh-key"}const t9=()=>{const[e,n]=b.useState(""),[r,s]=b.useState(!1),[o,u]=b.useState(null),[d,m]=b.useState(null),p=pa(),g=Pn({queryKey:["ssh"],queryFn:()=>Fs.listSshKeys()}),x=wn({resolver:Sn(JL),defaultValues:{name:"",comment:"",type:"rsa",bits:"4096"}}),v=mt({mutationFn:async S=>{const T={name:S.name,comment:S.comment,bits:S.type==="rsa"&&S.bits?Number(S.bits):void 0,type:S.type};return await Fs.createSshKey(T)},onSuccess:()=>{p.invalidateQueries({queryKey:["ssh"]}),s(!1),x.reset({name:"",comment:"",type:"rsa",bits:"4096"}),Ae.success("SSH Key created")},onError:S=>Ae.error(S?.message??"SSH Key creation failed")}),w=mt({mutationFn:S=>Fs.revealSshKeyById(S),onSuccess:S=>u(S),onError:S=>Ae.error(S?.message??"Failed to reveal key")}),E=mt({mutationFn:S=>Fs.deleteSshKey(S),onSuccess:async()=>{await p.invalidateQueries({queryKey:["ssh"]}),m(null),Ae.success("SSH Key deleted")},onError:S=>Ae.error(S?.message??"Delete failed")}),A=b.useMemo(()=>{const S=e.trim().toLowerCase();return S?(g.data??[]).filter(T=>T.name?.toLowerCase().includes(S)||T.fingerprint?.toLowerCase().includes(S)||T.public_key?.toLowerCase().includes(S)):g.data??[]},[e,g.data]);return g.isLoading?c.jsx("div",{className:"p-6",children:"Loading SSH Keys…"}):g.error?c.jsx("div",{className:"p-6 text-red-500",children:"Error Loading SSH Keys"}):c.jsx(Sd,{children:c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between gap-3",children:[c.jsx("h1",{className:"text-2xl font-bold",children:"SSH Keys"}),c.jsx("div",{className:"w-full max-w-sm",children:c.jsx(Ke,{value:e,onChange:S=>n(S.target.value),placeholder:"Search by name, fingerprint or key"})}),c.jsxs(Mt,{open:r,onOpenChange:s,children:[c.jsx(wr,{asChild:!0,children:c.jsxs(ce,{onClick:()=>s(!0),children:[c.jsx(ro,{className:"mr-2 h-4 w-4"}),"Create New Keypair"]})}),c.jsxs(kt,{className:"sm:max-w-lg",children:[c.jsx(Lt,{children:c.jsx(Ut,{children:"Create SSH Keypair"})}),c.jsx(_n,{...x,children:c.jsxs("form",{onSubmit:x.handleSubmit(S=>v.mutate(S)),className:"space-y-4",children:[c.jsx(qe,{control:x.control,name:"name",render:({field:S})=>c.jsxs(Pe,{children:[c.jsx(Ie,{children:"Name"}),c.jsx(Be,{children:c.jsx(Ke,{placeholder:"e.g., CI deploy key",...S})}),c.jsx(He,{})]})}),c.jsx(qe,{control:x.control,name:"comment",render:({field:S})=>c.jsxs(Pe,{children:[c.jsx(Ie,{children:"Comment"}),c.jsx(Be,{children:c.jsx(Ke,{placeholder:"e.g., deploy@autoglue",...S})}),c.jsx(He,{})]})}),c.jsx(qe,{control:x.control,name:"type",render:({field:S})=>c.jsxs(Pe,{children:[c.jsx(Ie,{children:"Type"}),c.jsx(Be,{children:c.jsxs(mn,{value:S.value,onValueChange:T=>{S.onChange(T),T==="ed25519"?x.setValue("bits",void 0):x.setValue("bits","4096")},children:[c.jsx(gn,{className:"w-[180px]",children:c.jsx(pn,{placeholder:"Select a ssh key type"})}),c.jsxs(vn,{children:[c.jsx(ct,{value:"rsa",children:"RSA"}),c.jsx(ct,{value:"ed25519",children:"ED25519"})]})]})}),c.jsx(He,{})]})}),c.jsx(qe,{control:x.control,name:"bits",render:({field:S})=>c.jsxs(Pe,{children:[c.jsx(Ie,{children:"Key size"}),c.jsx(Be,{children:c.jsxs(mn,{value:S.value,disabled:x.watch("type")==="ed25519",onValueChange:S.onChange,children:[c.jsx(gn,{className:"w-[180px]",children:c.jsx(pn,{placeholder:"RSA only"})}),c.jsxs(vn,{children:[c.jsx(ct,{value:"2048",children:"2048"}),c.jsx(ct,{value:"3072",children:"3072"}),c.jsx(ct,{value:"4096",children:"4096"})]})]})}),c.jsx(He,{})]})}),c.jsxs(en,{className:"gap-2",children:[c.jsx(ce,{type:"button",variant:"outline",onClick:()=>s(!1),disabled:v.isPending,children:"Cancel"}),c.jsx(ce,{type:"submit",disabled:v.isPending,children:v.isPending?c.jsxs(c.Fragment,{children:[c.jsx(Qs,{className:"mr-2 h-4 w-4 animate-spin"}),"Creating…"]}):"Create"})]})]})})]})]})]}),c.jsx("div",{className:"bg-background overflow-hidden rounded-2xl border shadow-sm",children:c.jsx("div",{className:"overflow-x-auto",children:c.jsxs(Za,{children:[c.jsx($a,{children:c.jsxs(ot,{children:[c.jsx(Ue,{children:"Name"}),c.jsx(Ue,{className:"min-w-[360px]",children:"Public Key"}),c.jsx(Ue,{children:"Fingerprint"}),c.jsx(Ue,{children:"Created"}),c.jsx(Ue,{className:"w-[160px] text-right",children:"Actions"})]})}),c.jsxs(Ga,{children:[A.map(S=>{const T=e9(S.public_key),z=Mi(S.public_key,18);return c.jsxs(ot,{children:[c.jsx(je,{className:"font-medium",children:S.name||"—"}),c.jsx(je,{className:"max-w-[560px] truncate",children:c.jsxs("div",{className:"flex items-start gap-2",children:[c.jsx(mo,{variant:"secondary",className:"whitespace-nowrap",children:T}),c.jsxs(g1,{children:[c.jsx(v1,{asChild:!0,children:c.jsx("span",{className:"font-mono text-xs",children:z})}),c.jsx(y1,{className:"max-w-[70vw]",children:c.jsx("div",{className:"max-w-full",children:c.jsx("p",{className:"font-mono text-xs break-all",children:S.public_key})})})]})]})}),c.jsx(je,{className:"font-mono text-xs",children:S.fingerprint}),c.jsx(je,{children:S.created_at?new Date(S.created_at).toLocaleString(void 0,{year:"numeric",month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit"}):"—"}),c.jsxs(je,{className:"space-x-2 text-right",children:[c.jsx(ce,{size:"sm",variant:"ghost",onClick:()=>xm(S.public_key??"","Public key copied"),children:"Copy Pub"}),c.jsx(ce,{size:"sm",variant:"ghost",onClick:()=>xm(S.fingerprint??"","Fingerprint copied"),children:"Copy FP"}),c.jsxs(ce,{size:"sm",variant:"outline",onClick:()=>w.mutate(S.id),children:[c.jsx(Nj,{className:"mr-1 h-4 w-4"}),"Reveal"]}),c.jsxs(ce,{size:"sm",variant:"outline",onClick:async()=>{try{const{filename:R,blob:O}=await Fs.downloadBlob(S.id,"both");WL(O,R)}catch(R){Ae.error(R?.message??"Download failed")}},children:[c.jsx(Tj,{className:"mr-1 h-4 w-4"}),"Download"]}),c.jsxs(ce,{size:"sm",variant:"destructive",onClick:()=>m(S.id),children:[c.jsx(eA,{className:"mr-1 h-4 w-4"}),"Delete"]})]})]},S.id)}),A.length===0&&c.jsx(ot,{children:c.jsx(je,{colSpan:5,className:"text-muted-foreground py-10 text-center",children:"No SSH Keys"})})]})]})})}),c.jsx(Mt,{open:!!o,onOpenChange:S=>!S&&u(null),children:c.jsxs(kt,{className:"sm:max-w-2xl",children:[c.jsx(Lt,{children:c.jsx(Ut,{children:"Private Key (read-only)"})}),c.jsx("div",{className:"space-y-3",children:c.jsxs("div",{className:"text-sm",children:[c.jsx("div",{className:"font-medium",children:o?.name??"SSH key"}),c.jsx("div",{className:"text-muted-foreground font-mono text-xs",children:o?.fingerprint}),c.jsx(z_,{readOnly:!0,className:"h-64 w-full rounded-md border p-3 font-mono text-xs",value:o?.private_key??""}),c.jsx("div",{className:"flex justify-end",children:c.jsx(ce,{onClick:()=>o?.private_key&&xm(o.private_key,"Private key copied"),children:"Copy"})})]})})]})}),c.jsx(Mt,{open:!!d,onOpenChange:S=>!S&&m(null),children:c.jsxs(kt,{className:"sm:max-w-md",children:[c.jsx(Lt,{children:c.jsx(Ut,{children:"Delete SSH Key"})}),c.jsx("p",{className:"text-muted-foreground text-sm",children:"This will permanently delete the keypair. This action cannot be undone."}),c.jsxs(en,{className:"gap-2",children:[c.jsx(ce,{variant:"outline",onClick:()=>m(null),children:"Cancel"}),c.jsx(ce,{variant:"destructive",onClick:()=>d&&E.mutate(d),disabled:E.isPending,children:E.isPending?c.jsxs(c.Fragment,{children:[c.jsx(Qs,{className:"mr-2 h-4 w-4 animate-spin"}),"Deleting…"]}):"Delete"})]})]})})]})})},bl=jT(),Nu={listTaints:()=>$e(async()=>await bl.listTaints()),createTaint:e=>$e(async()=>await bl.createTaint({body:e})),getTaint:e=>$e(async()=>await bl.getTaint({id:e})),deleteTaint:e=>$e(async()=>{await bl.deleteTaint({id:e})}),updateTaint:(e,n)=>$e(async()=>await bl.updateTaint({id:e,body:n}))},tp=["NoSchedule","PreferNoSchedule","NoExecute"],Y_=Na({key:Bt().trim().min(1,"Key is required").max(120,"Max 120 chars"),value:Bt().trim().optional(),effect:Bi(tp)}),n9=Y_.partial();function a9({t:e}){const n=`${e.key}${e.value?`=${e.value}`:""}${e.effect?`:${e.effect}`:""}`;return c.jsxs(mo,{variant:"secondary",className:"font-mono text-xs",children:[c.jsx(ad,{className:"mr-1 h-3 w-3"}),n]})}const r9=()=>{const[e,n]=b.useState(""),[r,s]=b.useState(!1),[o,u]=b.useState(!1),[d,m]=b.useState(null),[p,g]=b.useState(null),x=pa(),v=Pn({queryKey:["taints"],queryFn:()=>Nu.listTaints()}),w=wn({resolver:Sn(Y_),defaultValues:{key:"",value:"",effect:void 0}}),E=mt({mutationFn:j=>Nu.createTaint(j),onSuccess:async()=>{await x.invalidateQueries({queryKey:["taints"]}),w.reset(),s(!1),Ae.success("Taint Created Successfully.")},onError:j=>{Ae.error(j.message??"There was an error while creating Taint")}}),A=j=>{E.mutate(j)},S=wn({resolver:Sn(n9),defaultValues:{}}),T=mt({mutationFn:({id:j,values:N})=>Nu.updateTaint(j,N),onSuccess:async()=>{await x.invalidateQueries({queryKey:["taints"]}),S.reset(),u(!1),Ae.success("Taint Updated Successfully.")},onError:j=>{Ae.error(j.message??"There was an error while updating Taint")}}),z=j=>{g(j.id),S.reset({key:j.key,value:j.value,effect:j.effect}),u(!0)},R=mt({mutationFn:j=>Nu.deleteTaint(j),onSuccess:async()=>{await x.invalidateQueries({queryKey:["taints"]}),m(null),Ae.success("Taint Deleted Successfully.")},onError:j=>{Ae.error(j.message??"There was an error while deleting Taint")}}),O=b.useMemo(()=>{const j=v.data??[],N=e.trim().toLowerCase();return N?j.filter(B=>B.key?.toLowerCase().includes(N)||B.value?.toLowerCase().includes(N)||B.effect?.toLowerCase().includes(N)):j},[e,v.data]);return v.isLoading?c.jsx("div",{className:"p-6",children:"Loading taints…"}):v.error?c.jsx("div",{className:"p-6 text-red-500",children:"Error loading taints."}):c.jsxs("div",{className:"space-y-4 p-6",children:[c.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[c.jsx("h1",{className:"mb-4 text-2xl font-bold",children:"Taints"}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsxs("div",{className:"relative",children:[c.jsx(io,{className:"absolute top-2.5 left-2 h-4 w-4 opacity-60"}),c.jsx(Ke,{value:e,onChange:j=>n(j.target.value),placeholder:"Search taints",className:"w-64 pl-8"})]}),c.jsxs(Mt,{open:r,onOpenChange:s,children:[c.jsx(wr,{asChild:!0,children:c.jsxs(ce,{onClick:()=>s(!0),children:[c.jsx(ro,{className:"mr-2 h-4 w-4"})," Create Taint"]})}),c.jsxs(kt,{className:"sm:max-w-lg",children:[c.jsx(Lt,{children:c.jsx(Ut,{children:"Create taint"})}),c.jsx(_n,{...w,children:c.jsxs("form",{className:"space-y-4",onSubmit:w.handleSubmit(A),children:[c.jsx(qe,{control:w.control,name:"key",render:({field:j})=>c.jsxs(Pe,{children:[c.jsx(Ie,{children:"Key"}),c.jsx(Be,{children:c.jsx(Ke,{placeholder:"dedicated",...j})}),c.jsx(He,{})]})}),c.jsx(qe,{control:w.control,name:"value",render:({field:j})=>c.jsxs(Pe,{children:[c.jsx(Ie,{children:"Value (optional)"}),c.jsx(Be,{children:c.jsx(Ke,{placeholder:"gpu",...j})}),c.jsx(He,{})]})}),c.jsx(qe,{control:w.control,name:"effect",render:({field:j})=>c.jsxs(Pe,{children:[c.jsx(Ie,{children:"Effect"}),c.jsxs(mn,{onValueChange:j.onChange,value:j.value,children:[c.jsx(Be,{children:c.jsx(gn,{children:c.jsx(pn,{placeholder:"Select effect"})})}),c.jsx(vn,{children:tp.map(N=>c.jsx(ct,{value:N,children:N},N))})]}),c.jsx(He,{})]})}),c.jsxs(en,{className:"gap-2",children:[c.jsx(ce,{type:"button",variant:"outline",onClick:()=>s(!1),children:"Cancel"}),c.jsx(ce,{type:"submit",disabled:w.formState.isSubmitting,children:w.formState.isSubmitting?"Creating…":"Create"})]})]})})]})]})]})]}),c.jsx("div",{className:"bg-background overflow-hidden rounded-2xl border shadow-sm",children:c.jsx("div",{className:"overflow-x-auto",children:c.jsxs(Za,{children:[c.jsx($a,{children:c.jsxs(ot,{children:[c.jsx(Ue,{children:"Taint"}),c.jsx(Ue,{className:"w-[180px] text-right",children:"Actions"})]})}),c.jsxs(Ga,{children:[O.map(j=>c.jsxs(ot,{children:[c.jsx(je,{children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(a9,{t:j}),c.jsx("code",{className:"text-muted-foreground text-xs",children:Mi(j.id,6)})]})}),c.jsx(je,{children:c.jsxs("div",{className:"flex justify-end gap-2",children:[c.jsxs(ce,{variant:"outline",size:"sm",onClick:()=>z(j),children:[c.jsx(cp,{className:"mr-2 h-4 w-4"})," Edit"]}),c.jsx(ce,{variant:"destructive",size:"sm",onClick:()=>m(j.id),disabled:R.isPending&&d===j.id,children:R.isPending&&d===j.id?"Deleting…":"Delete"})]})})]},j.id)),O.length===0&&c.jsx(ot,{children:c.jsxs(je,{colSpan:3,className:"text-muted-foreground py-10 text-center",children:[c.jsx(lp,{className:"mx-auto mb-2 h-6 w-6 opacity-60"}),"No taints match your search."]})})]})]})})}),c.jsx(Mt,{open:o,onOpenChange:u,children:c.jsxs(kt,{className:"sm:max-w-lg",children:[c.jsx(Lt,{children:c.jsx(Ut,{children:"Edit taint"})}),c.jsx(_n,{...S,children:c.jsxs("form",{className:"space-y-4",onSubmit:S.handleSubmit(j=>{p&&T.mutate({id:p,values:j})}),children:[c.jsx(qe,{control:S.control,name:"key",render:({field:j})=>c.jsxs(Pe,{children:[c.jsx(Ie,{children:"Key"}),c.jsx(Be,{children:c.jsx(Ke,{placeholder:"dedicated",...j})}),c.jsx(He,{})]})}),c.jsx(qe,{control:S.control,name:"value",render:({field:j})=>c.jsxs(Pe,{children:[c.jsx(Ie,{children:"Value (optional)"}),c.jsx(Be,{children:c.jsx(Ke,{placeholder:"gpu",...j})}),c.jsx(He,{})]})}),c.jsx(qe,{control:S.control,name:"effect",render:({field:j})=>c.jsxs(Pe,{children:[c.jsx(Ie,{children:"Effect"}),c.jsxs(mn,{onValueChange:j.onChange,value:j.value,children:[c.jsx(Be,{children:c.jsx(gn,{children:c.jsx(pn,{placeholder:"Select effect"})})}),c.jsx(vn,{children:tp.map(N=>c.jsx(ct,{value:N,children:N},N))})]}),c.jsx(He,{})]})}),c.jsxs(en,{className:"gap-2",children:[c.jsx(ce,{type:"button",variant:"outline",onClick:()=>u(!1),children:"Cancel"}),c.jsx(ce,{type:"submit",disabled:T.isPending,children:T.isPending?"Saving…":"Save changes"})]})]})})]})}),c.jsx(Mt,{open:!!d,onOpenChange:j=>!j&&m(null),children:c.jsxs(kt,{className:"sm:max-w-md",children:[c.jsx(Lt,{children:c.jsx(Ut,{children:"Delete taint"})}),c.jsx("p",{className:"text-muted-foreground text-sm",children:"This action cannot be undone. Are you sure you want to delete this taint?"}),c.jsxs(en,{className:"gap-2",children:[c.jsx(ce,{variant:"outline",onClick:()=>m(null),children:"Cancel"}),c.jsx(ce,{variant:"destructive",onClick:()=>d&&R.mutate(d),disabled:R.isPending,children:R.isPending?"Deleting…":"Delete"})]})]})})]})};function i9(){return c.jsxs(dC,{children:[c.jsx(kn,{path:"/login",element:c.jsx(F0,{})}),c.jsx(kn,{element:c.jsx(D4,{}),children:c.jsxs(kn,{element:c.jsx(R4,{}),children:[c.jsx(kn,{path:"/me",element:c.jsx(Y7,{})}),c.jsx(kn,{path:"/org/settings",element:c.jsx(nL,{})}),c.jsx(kn,{path:"/org/members",element:c.jsx(eL,{})}),c.jsx(kn,{path:"/org/api-keys",element:c.jsx(J7,{})}),c.jsx(kn,{path:"/ssh",element:c.jsx(t9,{})}),c.jsx(kn,{path:"/servers",element:c.jsx(QL,{})}),c.jsx(kn,{path:"/taints",element:c.jsx(r9,{})}),c.jsx(kn,{path:"/labels",element:c.jsx(p7,{})}),c.jsx(kn,{path:"/annotations",element:c.jsx(v8,{})}),c.jsx(kn,{path:"/admin/jobs",element:c.jsx(u7,{})})]})}),c.jsx(kn,{path:"*",element:c.jsx(F0,{})})]})}IA.createRoot(document.getElementById("root")).render(c.jsx(b.StrictMode,{children:c.jsx(fC,{children:c.jsx(LA,{children:c.jsx(i9,{})})})})); //# sourceMappingURL=index-DbPirwVN.js.map