mirror of
https://github.com/GlueOps/autoglue.git
synced 2026-02-13 12:50:05 +01:00
80 lines
740 KiB
JavaScript
80 lines
740 KiB
JavaScript
import{r as m,R as Q,a as uS,b as dS,c as _N,d as eg,e as $d,u as tg,L as Kp,N as zu,O as fS,f as jN,g as CN,h as EN,i as Nn,B as RN}from"./react-B75e6Si-.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))i(l);new MutationObserver(l=>{for(const u of l)if(u.type==="childList")for(const d of u.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&i(d)}).observe(document,{childList:!0,subtree:!0});function a(l){const u={};return l.integrity&&(u.integrity=l.integrity),l.referrerPolicy&&(u.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?u.credentials="include":l.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function i(l){if(l.ep)return;l.ep=!0;const u=a(l);fetch(l.href,u)}})();var Ip={exports:{}},El={};var Jb;function NN(){if(Jb)return El;Jb=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function a(i,l,u){var d=null;if(u!==void 0&&(d=""+u),l.key!==void 0&&(d=""+l.key),"key"in l){u={};for(var f in l)f!=="key"&&(u[f]=l[f])}else u=l;return l=u.ref,{$$typeof:e,type:i,key:d,ref:l!==void 0?l:null,props:u}}return El.Fragment=t,El.jsx=a,El.jsxs=a,El}var Wb;function ON(){return Wb||(Wb=1,Ip.exports=NN()),Ip.exports}var o=ON(),AN=(e,t,a,i,l,u,d,f)=>{let g=document.documentElement,y=["light","dark"];function x(_){(Array.isArray(e)?e:[e]).forEach(R=>{let S=R==="class",A=S&&u?l.map(M=>u[M]||M):l;S?(g.classList.remove(...A),g.classList.add(u&&u[_]?u[_]:_)):g.setAttribute(R,_)}),v(_)}function v(_){f&&y.includes(_)&&(g.style.colorScheme=_)}function w(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(i)x(i);else try{let _=localStorage.getItem(t)||a,R=d&&_==="system"?w():_;x(R)}catch{}},ew=["light","dark"],hS="(prefers-color-scheme: dark)",TN=typeof window>"u",ng=m.createContext(void 0),DN={setTheme:e=>{},themes:[]},MN=()=>{var e;return(e=m.useContext(ng))!=null?e:DN},kN=e=>m.useContext(ng)?m.createElement(m.Fragment,null,e.children):m.createElement(PN,{...e}),zN=["light","dark"],PN=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:a=!0,enableColorScheme:i=!0,storageKey:l="theme",themes:u=zN,defaultTheme:d=a?"system":"light",attribute:f="data-theme",value:g,children:y,nonce:x,scriptProps:v})=>{let[w,_]=m.useState(()=>IN(l,d)),[R,S]=m.useState(()=>w==="system"?Lp():w),A=g?Object.values(g):u,M=m.useCallback(D=>{let I=D;if(!I)return;D==="system"&&a&&(I=Lp());let U=g?g[I]:I,F=t?LN(x):null,fe=document.documentElement,ge=he=>{he==="class"?(fe.classList.remove(...A),U&&fe.classList.add(U)):he.startsWith("data-")&&(U?fe.setAttribute(he,U):fe.removeAttribute(he))};if(Array.isArray(f)?f.forEach(ge):ge(f),i){let he=ew.includes(d)?d:null,ne=ew.includes(I)?I:he;fe.style.colorScheme=ne}F?.()},[x]),T=m.useCallback(D=>{let I=typeof D=="function"?D(w):D;_(I);try{localStorage.setItem(l,I)}catch{}},[w]),N=m.useCallback(D=>{let I=Lp(D);S(I),w==="system"&&a&&!e&&M("system")},[w,e]);m.useEffect(()=>{let D=window.matchMedia(hS);return D.addListener(N),N(D),()=>D.removeListener(N)},[N]),m.useEffect(()=>{let D=I=>{I.key===l&&(I.newValue?_(I.newValue):T(d))};return window.addEventListener("storage",D),()=>window.removeEventListener("storage",D)},[T]),m.useEffect(()=>{M(e??w)},[e,w]);let E=m.useMemo(()=>({theme:w,setTheme:T,forcedTheme:e,resolvedTheme:w==="system"?R:w,themes:a?[...u,"system"]:u,systemTheme:a?R:void 0}),[w,T,e,R,a,u]);return m.createElement(ng.Provider,{value:E},m.createElement(KN,{forcedTheme:e,storageKey:l,attribute:f,enableSystem:a,enableColorScheme:i,defaultTheme:d,value:g,themes:u,nonce:x,scriptProps:v}),y)},KN=m.memo(({forcedTheme:e,storageKey:t,attribute:a,enableSystem:i,enableColorScheme:l,defaultTheme:u,value:d,themes:f,nonce:g,scriptProps:y})=>{let x=JSON.stringify([a,t,u,e,f,d,i,l]).slice(1,-1);return m.createElement("script",{...y,suppressHydrationWarning:!0,nonce:typeof window>"u"?g:"",dangerouslySetInnerHTML:{__html:`(${AN.toString()})(${x})`}})}),IN=(e,t)=>{if(TN)return;let a;try{a=localStorage.getItem(e)||void 0}catch{}return a||t},LN=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.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(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},Lp=e=>(e||(e=window.matchMedia(hS)),e.matches?"dark":"light");function UN({children:e,defaultTheme:t="system",storageKey:a="vite-ui-theme"}){return o.jsx(kN,{attribute:"class",defaultTheme:t,enableSystem:!0,storageKey:a,disableTransitionOnChange:!0,children:e})}var Es=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(){}},qN={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},FN=class{#e=qN;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},Yi=new FN;function $N(e){setTimeout(e,0)}var Wi=typeof window>"u"||"Deno"in globalThis;function Dn(){}function VN(e,t){return typeof e=="function"?e(t):e}function mm(e){return typeof e=="number"&&e>=0&&e!==1/0}function pS(e,t){return Math.max(e+(t||0)-Date.now(),0)}function gi(e,t){return typeof e=="function"?e(t):e}function Ea(e,t){return typeof e=="function"?e(t):e}function tw(e,t){const{type:a="all",exact:i,fetchStatus:l,predicate:u,queryKey:d,stale:f}=e;if(d){if(i){if(t.queryHash!==ag(d,t.options))return!1}else if(!Wl(t.queryKey,d))return!1}if(a!=="all"){const g=t.isActive();if(a==="active"&&!g||a==="inactive"&&g)return!1}return!(typeof f=="boolean"&&t.isStale()!==f||l&&l!==t.state.fetchStatus||u&&!u(t))}function nw(e,t){const{exact:a,status:i,predicate:l,mutationKey:u}=e;if(u){if(!t.options.mutationKey)return!1;if(a){if(eo(t.options.mutationKey)!==eo(u))return!1}else if(!Wl(t.options.mutationKey,u))return!1}return!(i&&t.state.status!==i||l&&!l(t))}function ag(e,t){return(t?.queryKeyHashFn||eo)(e)}function eo(e){return JSON.stringify(e,(t,a)=>gm(a)?Object.keys(a).sort().reduce((i,l)=>(i[l]=a[l],i),{}):a)}function Wl(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(a=>Wl(e[a],t[a])):!1}var BN=Object.prototype.hasOwnProperty;function mS(e,t){if(e===t)return e;const a=aw(e)&&aw(t);if(!a&&!(gm(e)&&gm(t)))return t;const l=(a?e:Object.keys(e)).length,u=a?t:Object.keys(t),d=u.length,f=a?new Array(d):{};let g=0;for(let y=0;y<d;y++){const x=a?y:u[y],v=e[x],w=t[x];if(v===w){f[x]=v,(a?y<l:BN.call(e,x))&&g++;continue}if(v===null||w===null||typeof v!="object"||typeof w!="object"){f[x]=w;continue}const _=mS(v,w);f[x]=_,_===v&&g++}return l===d&&g===l?e:f}function md(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const a in e)if(e[a]!==t[a])return!1;return!0}function aw(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function gm(e){if(!rw(e))return!1;const t=e.constructor;if(t===void 0)return!0;const a=t.prototype;return!(!rw(a)||!a.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function rw(e){return Object.prototype.toString.call(e)==="[object Object]"}function GN(e){return new Promise(t=>{Yi.setTimeout(t,e)})}function ym(e,t,a){return typeof a.structuralSharing=="function"?a.structuralSharing(e,t):a.structuralSharing!==!1?mS(e,t):t}function HN(e,t,a=0){const i=[...e,t];return a&&i.length>a?i.slice(1):i}function XN(e,t,a=0){const i=[t,...e];return a&&i.length>a?i.slice(0,-1):i}var rg=Symbol();function gS(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===rg?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function yS(e,t){return typeof e=="function"?e(...t):!!e}var ZN=class extends Es{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!Wi&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}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(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},ig=new ZN;function vm(){let e,t;const a=new Promise((l,u)=>{e=l,t=u});a.status="pending",a.catch(()=>{});function i(l){Object.assign(a,l),delete a.resolve,delete a.reject}return a.resolve=l=>{i({status:"fulfilled",value:l}),e(l)},a.reject=l=>{i({status:"rejected",reason:l}),t(l)},a}var YN=$N;function QN(){let e=[],t=0,a=f=>{f()},i=f=>{f()},l=YN;const u=f=>{t?e.push(f):l(()=>{a(f)})},d=()=>{const f=e;e=[],f.length&&l(()=>{i(()=>{f.forEach(g=>{a(g)})})})};return{batch:f=>{let g;t++;try{g=f()}finally{t--,t||d()}return g},batchCalls:f=>(...g)=>{u(()=>{f(...g)})},schedule:u,setNotifyFunction:f=>{a=f},setBatchNotifyFunction:f=>{i=f},setScheduler:f=>{l=f}}}var cn=QN(),JN=class extends Es{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!Wi&&window.addEventListener){const t=()=>e(!0),a=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",a,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",a)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(a=>{a(e)}))}isOnline(){return this.#e}},gd=new JN;function WN(e){return Math.min(1e3*2**e,3e4)}function vS(e){return(e??"online")==="online"?gd.isOnline():!0}var xm=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function xS(e){let t=!1,a=0,i;const l=vm(),u=()=>l.status!=="pending",d=S=>{if(!u()){const A=new xm(S);w(A),e.onCancel?.(A)}},f=()=>{t=!0},g=()=>{t=!1},y=()=>ig.isFocused()&&(e.networkMode==="always"||gd.isOnline())&&e.canRun(),x=()=>vS(e.networkMode)&&e.canRun(),v=S=>{u()||(i?.(),l.resolve(S))},w=S=>{u()||(i?.(),l.reject(S))},_=()=>new Promise(S=>{i=A=>{(u()||y())&&S(A)},e.onPause?.()}).then(()=>{i=void 0,u()||e.onContinue?.()}),R=()=>{if(u())return;let S;const A=a===0?e.initialPromise:void 0;try{S=A??e.fn()}catch(M){S=Promise.reject(M)}Promise.resolve(S).then(v).catch(M=>{if(u())return;const T=e.retry??(Wi?0:3),N=e.retryDelay??WN,E=typeof N=="function"?N(a,M):N,D=T===!0||typeof T=="number"&&a<T||typeof T=="function"&&T(a,M);if(t||!D){w(M);return}a++,e.onFail?.(a,M),GN(E).then(()=>y()?void 0:_()).then(()=>{t?w(M):R()})})};return{promise:l,status:()=>l.status,cancel:d,continue:()=>(i?.(),l),cancelRetry:f,continueRetry:g,canStart:x,start:()=>(x()?R():_().then(R),l)}}var bS=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),mm(this.gcTime)&&(this.#e=Yi.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Wi?1/0:300*1e3))}clearGcTimeout(){this.#e&&(Yi.clearTimeout(this.#e),this.#e=void 0)}},eO=class extends bS{#e;#t;#n;#r;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=ow(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.#o,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=ow(this.options);t.data!==void 0&&(this.setState(iw(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const a=ym(this.state.data,e,this.options);return this.#i({data:a,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),a}setState(e,t){this.#i({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(Dn).catch(Dn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>Ea(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===rg||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>gi(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:!pS(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(t=>t.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(t=>t!==e),this.observers.length||(this.#a&&(this.#s?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#a?.status()!=="rejected"){if(this.state.data!==void 0&&t?.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 f=this.observers.find(g=>g.options.queryFn);f&&this.setOptions(f.options)}const a=new AbortController,i=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(this.#s=!0,a.signal)})},l=()=>{const f=gS(this.options,t),y=(()=>{const x={client:this.#r,queryKey:this.queryKey,meta:this.meta};return i(x),x})();return this.#s=!1,this.options.persister?this.options.persister(f,y,this):f(y)},d=(()=>{const f={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:l};return i(f),f})();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=xS({initialPromise:t?.initialPromise,fn:d.fetchFn,onCancel:f=>{f instanceof xm&&f.revert&&this.setState({...this.#t,fetchStatus:"idle"}),a.abort()},onFail:(f,g)=>{this.#i({type:"failed",failureCount:f,error:g})},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 f=await this.#a.start();if(f===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(f),this.#n.config.onSuccess?.(f,this),this.#n.config.onSettled?.(f,this.state.error,this),f}catch(f){if(f instanceof xm){if(f.silent)return this.#a.promise;if(f.revert){if(this.state.data===void 0)throw f;return this.state.data}}throw this.#i({type:"error",error:f}),this.#n.config.onError?.(f,this),this.#n.config.onSettled?.(this.state.data,f,this),f}finally{this.scheduleGc()}}#i(e){const t=a=>{switch(e.type){case"failed":return{...a,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...a,fetchStatus:"paused"};case"continue":return{...a,fetchStatus:"fetching"};case"fetch":return{...a,...wS(a.data,this.options),fetchMeta:e.meta??null};case"success":const i={...a,...iw(e.data,e.dataUpdatedAt),dataUpdateCount:a.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?i:void 0,i;case"error":const l=e.error;return{...a,error:l,errorUpdateCount:a.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:a.fetchFailureCount+1,fetchFailureReason:l,fetchStatus:"idle",status:"error"};case"invalidate":return{...a,isInvalidated:!0};case"setState":return{...a,...e.state}}};this.state=t(this.state),cn.batch(()=>{this.observers.forEach(a=>{a.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function wS(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:vS(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function iw(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function ow(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,a=t!==void 0,i=a?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:a?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:a?"success":"pending",fetchStatus:"idle"}}var tO=class extends Es{constructor(e,t){super(),this.options=t,this.#e=e,this.#i=null,this.#s=vm(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#a;#o;#s;#i;#m;#f;#h;#c;#u;#l;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),sw(this.#t,this.options)?this.#d():this.updateResult(),this.#x())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return bm(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return bm(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#w(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,a=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 Ea(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),t._defaulted&&!md(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const i=this.hasListeners();i&&lw(this.#t,a,this.options,t)&&this.#d(),this.updateResult(),i&&(this.#t!==a||Ea(this.options.enabled,this.#t)!==Ea(t.enabled,this.#t)||gi(this.options.staleTime,this.#t)!==gi(t.staleTime,this.#t))&&this.#g();const l=this.#y();i&&(this.#t!==a||Ea(this.options.enabled,this.#t)!==Ea(t.enabled,this.#t)||l!==this.#l)&&this.#v(l)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),a=this.createResult(t,e);return aO(this,a)&&(this.#r=a,this.#o=this.options,this.#a=this.#t.state),a}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(a,i)=>(this.trackProp(i),t?.(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#s.status==="pending"&&this.#s.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(a,i))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),a=this.#e.getQueryCache().build(this.#e,t);return a.fetch().then(()=>this.createResult(a,t))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#d(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Dn)),t}#g(){this.#b();const e=gi(this.options.staleTime,this.#t);if(Wi||this.#r.isStale||!mm(e))return;const a=pS(this.#r.dataUpdatedAt,e)+1;this.#c=Yi.setTimeout(()=>{this.#r.isStale||this.updateResult()},a)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#w(),this.#l=e,!(Wi||Ea(this.options.enabled,this.#t)===!1||!mm(this.#l)||this.#l===0)&&(this.#u=Yi.setInterval(()=>{(this.options.refetchIntervalInBackground||ig.isFocused())&&this.#d()},this.#l))}#x(){this.#g(),this.#v(this.#y())}#b(){this.#c&&(Yi.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#u&&(Yi.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const a=this.#t,i=this.options,l=this.#r,u=this.#a,d=this.#o,g=e!==a?e.state:this.#n,{state:y}=e;let x={...y},v=!1,w;if(t._optimisticResults){const F=this.hasListeners(),fe=!F&&sw(e,t),ge=F&&lw(e,a,t,i);(fe||ge)&&(x={...x,...wS(y.data,e.options)}),t._optimisticResults==="isRestoring"&&(x.fetchStatus="idle")}let{error:_,errorUpdatedAt:R,status:S}=x;w=x.data;let A=!1;if(t.placeholderData!==void 0&&w===void 0&&S==="pending"){let F;l?.isPlaceholderData&&t.placeholderData===d?.placeholderData?(F=l.data,A=!0):F=typeof t.placeholderData=="function"?t.placeholderData(this.#h?.state.data,this.#h):t.placeholderData,F!==void 0&&(S="success",w=ym(l?.data,F,t),v=!0)}if(t.select&&w!==void 0&&!A)if(l&&w===u?.data&&t.select===this.#m)w=this.#f;else try{this.#m=t.select,w=t.select(w),w=ym(l?.data,w,t),this.#f=w,this.#i=null}catch(F){this.#i=F}this.#i&&(_=this.#i,w=this.#f,R=Date.now(),S="error");const M=x.fetchStatus==="fetching",T=S==="pending",N=S==="error",E=T&&M,D=w!==void 0,U={status:S,fetchStatus:x.fetchStatus,isPending:T,isSuccess:S==="success",isError:N,isInitialLoading:E,isLoading:E,data:w,dataUpdatedAt:x.dataUpdatedAt,error:_,errorUpdatedAt:R,failureCount:x.fetchFailureCount,failureReason:x.fetchFailureReason,errorUpdateCount:x.errorUpdateCount,isFetched:x.dataUpdateCount>0||x.errorUpdateCount>0,isFetchedAfterMount:x.dataUpdateCount>g.dataUpdateCount||x.errorUpdateCount>g.errorUpdateCount,isFetching:M,isRefetching:M&&!T,isLoadingError:N&&!D,isPaused:x.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:N&&D,isStale:og(e,t),refetch:this.refetch,promise:this.#s,isEnabled:Ea(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const F=he=>{U.status==="error"?he.reject(U.error):U.data!==void 0&&he.resolve(U.data)},fe=()=>{const he=this.#s=U.promise=vm();F(he)},ge=this.#s;switch(ge.status){case"pending":e.queryHash===a.queryHash&&F(ge);break;case"fulfilled":(U.status==="error"||U.data!==ge.value)&&fe();break;case"rejected":(U.status!=="error"||U.error!==ge.reason)&&fe();break}}return U}updateResult(){const e=this.#r,t=this.createResult(this.#t,this.options);if(this.#a=this.#t.state,this.#o=this.options,this.#a.data!==void 0&&(this.#h=this.#t),md(t,e))return;this.#r=t;const a=()=>{if(!e)return!0;const{notifyOnChangeProps:i}=this.options,l=typeof i=="function"?i():i;if(l==="all"||!l&&!this.#p.size)return!0;const u=new Set(l??this.#p);return this.options.throwOnError&&u.add("error"),Object.keys(this.#r).some(d=>{const f=d;return this.#r[f]!==e[f]&&u.has(f)})};this.#_({listeners:a()})}#S(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#x()}#_(e){cn.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function nO(e,t){return Ea(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function sw(e,t){return nO(e,t)||e.state.data!==void 0&&bm(e,t,t.refetchOnMount)}function bm(e,t,a){if(Ea(t.enabled,e)!==!1&&gi(t.staleTime,e)!=="static"){const i=typeof a=="function"?a(e):a;return i==="always"||i!==!1&&og(e,t)}return!1}function lw(e,t,a,i){return(e!==t||Ea(i.enabled,e)===!1)&&(!a.suspense||e.state.status!=="error")&&og(e,a)}function og(e,t){return Ea(t.enabled,e)!==!1&&e.isStaleByTime(gi(t.staleTime,e))}function aO(e,t){return!md(e.getCurrentResult(),t)}function cw(e){return{onFetch:(t,a)=>{const i=t.options,l=t.fetchOptions?.meta?.fetchMore?.direction,u=t.state.data?.pages||[],d=t.state.data?.pageParams||[];let f={pages:[],pageParams:[]},g=0;const y=async()=>{let x=!1;const v=R=>{Object.defineProperty(R,"signal",{enumerable:!0,get:()=>(t.signal.aborted?x=!0:t.signal.addEventListener("abort",()=>{x=!0}),t.signal)})},w=gS(t.options,t.fetchOptions),_=async(R,S,A)=>{if(x)return Promise.reject();if(S==null&&R.pages.length)return Promise.resolve(R);const T=(()=>{const I={client:t.client,queryKey:t.queryKey,pageParam:S,direction:A?"backward":"forward",meta:t.options.meta};return v(I),I})(),N=await w(T),{maxPages:E}=t.options,D=A?XN:HN;return{pages:D(R.pages,N,E),pageParams:D(R.pageParams,S,E)}};if(l&&u.length){const R=l==="backward",S=R?rO:uw,A={pages:u,pageParams:d},M=S(i,A);f=await _(A,M,R)}else{const R=e??u.length;do{const S=g===0?d[0]??i.initialPageParam:uw(i,f);if(g>0&&S==null)break;f=await _(f,S),g++}while(g<R)}return f};t.options.persister?t.fetchFn=()=>t.options.persister?.(y,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},a):t.fetchFn=y}}}function uw(e,{pages:t,pageParams:a}){const i=t.length-1;return t.length>0?e.getNextPageParam(t[i],t,a[i],a):void 0}function rO(e,{pages:t,pageParams:a}){return t.length>0?e.getPreviousPageParam?.(t[0],t,a[0],a):void 0}var iO=class extends bS{#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||SS(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#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(t=>t!==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 t=()=>{this.#a({type:"continue"})},a={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=xS({fn:()=>this.options.mutationFn?this.options.mutationFn(e,a):Promise.reject(new Error("No mutationFn found")),onFail:(u,d)=>{this.#a({type:"failed",failureCount:u,error:d})},onPause:()=>{this.#a({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const i=this.state.status==="pending",l=!this.#r.canStart();try{if(i)t();else{this.#a({type:"pending",variables:e,isPaused:l}),await this.#n.config.onMutate?.(e,this,a);const d=await this.options.onMutate?.(e,a);d!==this.state.context&&this.#a({type:"pending",context:d,variables:e,isPaused:l})}const u=await this.#r.start();return await this.#n.config.onSuccess?.(u,e,this.state.context,this,a),await this.options.onSuccess?.(u,e,this.state.context,a),await this.#n.config.onSettled?.(u,null,this.state.variables,this.state.context,this,a),await this.options.onSettled?.(u,null,e,this.state.context,a),this.#a({type:"success",data:u}),u}catch(u){try{throw await this.#n.config.onError?.(u,e,this.state.context,this,a),await this.options.onError?.(u,e,this.state.context,a),await this.#n.config.onSettled?.(void 0,u,this.state.variables,this.state.context,this,a),await this.options.onSettled?.(void 0,u,e,this.state.context,a),u}finally{this.#a({type:"error",error:u})}}finally{this.#n.runNext(this)}}#a(e){const t=a=>{switch(e.type){case"failed":return{...a,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...a,isPaused:!0};case"continue":return{...a,isPaused:!1};case"pending":return{...a,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{...a,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...a,data:void 0,error:e.error,failureCount:a.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),cn.batch(()=>{this.#t.forEach(a=>{a.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function SS(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var oO=class extends Es{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,a){const i=new iO({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:a});return this.add(i),i}add(e){this.#e.add(e);const t=Pu(e);if(typeof t=="string"){const a=this.#t.get(t);a?a.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=Pu(e);if(typeof t=="string"){const a=this.#t.get(t);if(a)if(a.length>1){const i=a.indexOf(e);i!==-1&&a.splice(i,1)}else a[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Pu(e);if(typeof t=="string"){const i=this.#t.get(t)?.find(l=>l.state.status==="pending");return!i||i===e}else return!0}runNext(e){const t=Pu(e);return typeof t=="string"?this.#t.get(t)?.find(i=>i!==e&&i.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){cn.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 t={exact:!0,...e};return this.getAll().find(a=>nw(t,a))}findAll(e={}){return this.getAll().filter(t=>nw(e,t))}notify(e){cn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return cn.batch(()=>Promise.all(e.map(t=>t.continue().catch(Dn))))}};function Pu(e){return e.options.scope?.id}var sO=class extends Es{#e;#t=void 0;#n;#r;constructor(t,a){super(),this.#e=t,this.setOptions(a),this.bindMethods(),this.#a()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const a=this.options;this.options=this.#e.defaultMutationOptions(t),md(this.options,a)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),a?.mutationKey&&this.options.mutationKey&&eo(a.mutationKey)!==eo(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#a(),this.#o(t)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#a(),this.#o()}mutate(t,a){return this.#r=a,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(t)}#a(){const t=this.#n?.state??SS();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#o(t){cn.batch(()=>{if(this.#r&&this.hasListeners()){const a=this.#t.variables,i=this.#t.context,l={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};t?.type==="success"?(this.#r.onSuccess?.(t.data,a,i,l),this.#r.onSettled?.(t.data,null,a,i,l)):t?.type==="error"&&(this.#r.onError?.(t.error,a,i,l),this.#r.onSettled?.(void 0,t.error,a,i,l))}this.listeners.forEach(a=>{a(this.#t)})})}},lO=class extends Es{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,a){const i=t.queryKey,l=t.queryHash??ag(i,t);let u=this.get(l);return u||(u=new eO({client:e,queryKey:i,queryHash:l,options:e.defaultQueryOptions(t),state:a,defaultOptions:e.getQueryDefaults(i)}),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 t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){cn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(a=>tw(t,a))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(a=>tw(e,a)):t}notify(e){cn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){cn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){cn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},cO=class{#e;#t;#n;#r;#a;#o;#s;#i;constructor(e={}){this.#e=e.queryCache||new lO,this.#t=e.mutationCache||new oO,this.#n=e.defaultOptions||{},this.#r=new Map,this.#a=new Map,this.#o=0}mount(){this.#o++,this.#o===1&&(this.#s=ig.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=gd.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#o--,this.#o===0&&(this.#s?.(),this.#s=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 t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),a=this.#e.build(this,t),i=a.state.data;return i===void 0?this.fetchQuery(e):(e.revalidateIfStale&&a.isStaleByTime(gi(t.staleTime,a))&&this.prefetchQuery(t),Promise.resolve(i))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:a})=>{const i=a.data;return[t,i]})}setQueryData(e,t,a){const i=this.defaultQueryOptions({queryKey:e}),u=this.#e.get(i.queryHash)?.state.data,d=VN(t,u);if(d!==void 0)return this.#e.build(this,i).setData(d,{...a,manual:!0})}setQueriesData(e,t,a){return cn.batch(()=>this.#e.findAll(e).map(({queryKey:i})=>[i,this.setQueryData(i,t,a)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;cn.batch(()=>{t.findAll(e).forEach(a=>{t.remove(a)})})}resetQueries(e,t){const a=this.#e;return cn.batch(()=>(a.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const a={revert:!0,...t},i=cn.batch(()=>this.#e.findAll(e).map(l=>l.cancel(a)));return Promise.all(i).then(Dn).catch(Dn)}invalidateQueries(e,t={}){return cn.batch(()=>(this.#e.findAll(e).forEach(a=>{a.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const a={...t,cancelRefetch:t.cancelRefetch??!0},i=cn.batch(()=>this.#e.findAll(e).filter(l=>!l.isDisabled()&&!l.isStatic()).map(l=>{let u=l.fetch(void 0,a);return a.throwOnError||(u=u.catch(Dn)),l.state.fetchStatus==="paused"?Promise.resolve():u}));return Promise.all(i).then(Dn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const a=this.#e.build(this,t);return a.isStaleByTime(gi(t.staleTime,a))?a.fetch(t):Promise.resolve(a.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Dn).catch(Dn)}fetchInfiniteQuery(e){return e.behavior=cw(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Dn).catch(Dn)}ensureInfiniteQueryData(e){return e.behavior=cw(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return gd.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,t){this.#r.set(eo(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#r.values()],a={};return t.forEach(i=>{Wl(e,i.queryKey)&&Object.assign(a,i.defaultOptions)}),a}setMutationDefaults(e,t){this.#a.set(eo(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#a.values()],a={};return t.forEach(i=>{Wl(e,i.mutationKey)&&Object.assign(a,i.defaultOptions)}),a}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=ag(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===rg&&(t.enabled=!1),t}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()}},_S=m.createContext(void 0),Xn=e=>{const t=m.useContext(_S);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},uO=({client:e,children:t})=>(m.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),o.jsx(_S.Provider,{value:e,children:t})),jS=m.createContext(!1),dO=()=>m.useContext(jS);jS.Provider;function fO(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var hO=m.createContext(fO()),pO=()=>m.useContext(hO),mO=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},gO=e=>{m.useEffect(()=>{e.clearReset()},[e])},yO=({result:e,errorResetBoundary:t,throwOnError:a,query:i,suspense:l})=>e.isError&&!t.isReset()&&!e.isFetching&&i&&(l&&e.data===void 0||yS(a,[e.error,i])),vO=e=>{if(e.suspense){const a=l=>l==="static"?l:Math.max(l??1e3,1e3),i=e.staleTime;e.staleTime=typeof i=="function"?(...l)=>a(i(...l)):a(i),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},xO=(e,t)=>e.isLoading&&e.isFetching&&!t,bO=(e,t)=>e?.suspense&&t.isPending,dw=(e,t,a)=>t.fetchOptimistic(e).catch(()=>{a.clearReset()});function wO(e,t,a){const i=dO(),l=pO(),u=Xn(),d=u.defaultQueryOptions(e);u.getDefaultOptions().queries?._experimental_beforeQuery?.(d),d._optimisticResults=i?"isRestoring":"optimistic",vO(d),mO(d,l),gO(l);const f=!u.getQueryCache().get(d.queryHash),[g]=m.useState(()=>new t(u,d)),y=g.getOptimisticResult(d),x=!i&&e.subscribed!==!1;if(m.useSyncExternalStore(m.useCallback(v=>{const w=x?g.subscribe(cn.batchCalls(v)):Dn;return g.updateResult(),w},[g,x]),()=>g.getCurrentResult(),()=>g.getCurrentResult()),m.useEffect(()=>{g.setOptions(d)},[d,g]),bO(d,y))throw dw(d,g,l);if(yO({result:y,errorResetBoundary:l,throwOnError:d.throwOnError,query:u.getQueryCache().get(d.queryHash),suspense:d.suspense}))throw y.error;return u.getDefaultOptions().queries?._experimental_afterQuery?.(d,y),d.experimental_prefetchInRender&&!Wi&&xO(y,i)&&(f?dw(d,g,l):u.getQueryCache().get(d.queryHash)?.promise)?.catch(Dn).finally(()=>{g.updateResult()}),d.notifyOnChangeProps?y:g.trackResult(y)}function Zt(e,t){return wO(e,tO)}function lt(e,t){const a=Xn(),[i]=m.useState(()=>new sO(a,e));m.useEffect(()=>{i.setOptions(e)},[i,e]);const l=m.useSyncExternalStore(m.useCallback(d=>i.subscribe(cn.batchCalls(d)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),u=m.useCallback((d,f)=>{i.mutate(d,f).catch(Dn)},[i]);if(l.error&&yS(i.options.throwOnError,[l.error]))throw l.error;return{...l,mutate:u,mutateAsync:l.mutate}}const SO=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),_O=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,a,i)=>i?i.toUpperCase():a.toLowerCase()),fw=e=>{const t=_O(e);return t.charAt(0).toUpperCase()+t.slice(1)},CS=(...e)=>e.filter((t,a,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===a).join(" ").trim(),jO=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var CO={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 EO=m.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:i,className:l="",children:u,iconNode:d,...f},g)=>m.createElement("svg",{ref:g,...CO,width:t,height:t,stroke:e,strokeWidth:i?Number(a)*24/Number(t):a,className:CS("lucide",l),...!u&&!jO(f)&&{"aria-hidden":"true"},...f},[...d.map(([y,x])=>m.createElement(y,x)),...Array.isArray(u)?u:[u]]));const ct=(e,t)=>{const a=m.forwardRef(({className:i,...l},u)=>m.createElement(EO,{ref:u,iconNode:t,className:CS(`lucide-${SO(fw(e))}`,`lucide-${e}`,i),...l}));return a.displayName=fw(e),a};const RO=[["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"}]],NO=ct("boxes",RO);const OO=[["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"}]],ES=ct("building-2",OO);const AO=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],RS=ct("check",AO);const TO=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],NS=ct("chevron-down",TO);const DO=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],MO=ct("chevron-right",DO);const kO=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],zO=ct("chevron-up",kO);const PO=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],KO=ct("chevrons-up-down",PO);const IO=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],LO=ct("circle-check",IO);const UO=[["path",{d:"M22 2 2 22",key:"y4kqgn"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],sg=ct("circle-slash-2",UO);const qO=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]],FO=ct("clipboard",qO);const $O=[["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"}]],VO=ct("component",$O);const BO=[["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"}]],GO=ct("download",BO);const HO=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],OS=ct("ellipsis",HO);const XO=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],ZO=ct("external-link",XO);const YO=[["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"}]],wm=ct("eye",YO);const QO=[["path",{d:"M10.65 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v10.1",key:"1a2hbp"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m10 15 1 1",key:"1h4vmv"}],["path",{d:"m11 14-4.586 4.586",key:"maylof"}],["circle",{cx:"5",cy:"20",r:"2",key:"860zyv"}]],JO=ct("file-key",QO);const WO=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],e2=ct("git-commit-horizontal",WO);const t2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],AS=ct("info",t2);const n2=[["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"}]],a2=ct("key-round",n2);const r2=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],Ku=ct("link",r2);const i2=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],lr=ct("loader-circle",i2);const o2=[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]],s2=ct("lock-keyhole",o2);const l2=[["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"}]],c2=ct("octagon-x",l2);const u2=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],d2=ct("panel-left",u2);const f2=[["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"}]],sc=ct("pencil",f2);const h2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Si=ct("plus",h2);const p2=[["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"}]],m2=ct("refresh-cw",p2);const g2=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],dr=ct("search",g2);const y2=[["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"}]],TS=ct("server",y2);const v2=[["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"}]],x2=ct("spray-can",v2);const b2=[["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"}]],Vd=ct("tags",b2);const w2=[["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"}]],lg=ct("trash-2",w2);const S2=[["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"}]],Sm=ct("triangle-alert",S2);const _2=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],j2=ct("user-round",_2);const C2=[["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"}]],DS=ct("users",C2);const E2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],cg=ct("x",E2);function R2(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css",t.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}const N2=e=>{switch(e){case"success":return T2;case"info":return M2;case"warning":return D2;case"error":return k2;default:return null}},O2=Array(12).fill(0),A2=({visible:e,className:t})=>Q.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Q.createElement("div",{className:"sonner-spinner"},O2.map((a,i)=>Q.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${i}`})))),T2=Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Q.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"})),D2=Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Q.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"})),M2=Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Q.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"})),k2=Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Q.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"})),z2=Q.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"},Q.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Q.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),P2=()=>{const[e,t]=Q.useState(document.hidden);return Q.useEffect(()=>{const a=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",a),()=>window.removeEventListener("visibilitychange",a)},[]),e};let _m=1;class K2{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const a=this.subscribers.indexOf(t);this.subscribers.splice(a,1)}),this.publish=t=>{this.subscribers.forEach(a=>a(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var a;const{message:i,...l}=t,u=typeof t?.id=="number"||((a=t.id)==null?void 0:a.length)>0?t.id:_m++,d=this.toasts.find(g=>g.id===u),f=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(u)&&this.dismissedToasts.delete(u),d?this.toasts=this.toasts.map(g=>g.id===u?(this.publish({...g,...t,id:u,title:i}),{...g,...t,id:u,dismissible:f,title:i}):g):this.addToast({title:i,...l,dismissible:f,id:u}),u},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(a=>a({id:t,dismiss:!0})))):this.toasts.forEach(a=>{this.subscribers.forEach(i=>i({id:a.id,dismiss:!0}))}),t),this.message=(t,a)=>this.create({...a,message:t}),this.error=(t,a)=>this.create({...a,message:t,type:"error"}),this.success=(t,a)=>this.create({...a,type:"success",message:t}),this.info=(t,a)=>this.create({...a,type:"info",message:t}),this.warning=(t,a)=>this.create({...a,type:"warning",message:t}),this.loading=(t,a)=>this.create({...a,type:"loading",message:t}),this.promise=(t,a)=>{if(!a)return;let i;a.loading!==void 0&&(i=this.create({...a,promise:t,type:"loading",message:a.loading,description:typeof a.description!="function"?a.description:void 0}));const l=Promise.resolve(t instanceof Function?t():t);let u=i!==void 0,d;const f=l.then(async y=>{if(d=["resolve",y],Q.isValidElement(y))u=!1,this.create({id:i,type:"default",message:y});else if(L2(y)&&!y.ok){u=!1;const v=typeof a.error=="function"?await a.error(`HTTP error! status: ${y.status}`):a.error,w=typeof a.description=="function"?await a.description(`HTTP error! status: ${y.status}`):a.description,R=typeof v=="object"&&!Q.isValidElement(v)?v:{message:v};this.create({id:i,type:"error",description:w,...R})}else if(y instanceof Error){u=!1;const v=typeof a.error=="function"?await a.error(y):a.error,w=typeof a.description=="function"?await a.description(y):a.description,R=typeof v=="object"&&!Q.isValidElement(v)?v:{message:v};this.create({id:i,type:"error",description:w,...R})}else if(a.success!==void 0){u=!1;const v=typeof a.success=="function"?await a.success(y):a.success,w=typeof a.description=="function"?await a.description(y):a.description,R=typeof v=="object"&&!Q.isValidElement(v)?v:{message:v};this.create({id:i,type:"success",description:w,...R})}}).catch(async y=>{if(d=["reject",y],a.error!==void 0){u=!1;const x=typeof a.error=="function"?await a.error(y):a.error,v=typeof a.description=="function"?await a.description(y):a.description,_=typeof x=="object"&&!Q.isValidElement(x)?x:{message:x};this.create({id:i,type:"error",description:v,..._})}}).finally(()=>{u&&(this.dismiss(i),i=void 0),a.finally==null||a.finally.call(a)}),g=()=>new Promise((y,x)=>f.then(()=>d[0]==="reject"?x(d[1]):y(d[1])).catch(x));return typeof i!="string"&&typeof i!="number"?{unwrap:g}:Object.assign(i,{unwrap:g})},this.custom=(t,a)=>{const i=a?.id||_m++;return this.create({jsx:t(i),id:i,...a}),i},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Gn=new K2,I2=(e,t)=>{const a=t?.id||_m++;return Gn.addToast({title:e,...t,id:a}),a},L2=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",U2=I2,q2=()=>Gn.toasts,F2=()=>Gn.getActiveToasts(),xe=Object.assign(U2,{success:Gn.success,info:Gn.info,warning:Gn.warning,error:Gn.error,custom:Gn.custom,message:Gn.message,promise:Gn.promise,dismiss:Gn.dismiss,loading:Gn.loading},{getHistory:q2,getToasts:F2});R2("[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 Iu(e){return e.label!==void 0}const $2=3,V2="24px",B2="16px",hw=4e3,G2=356,H2=14,X2=45,Z2=200;function ir(...e){return e.filter(Boolean).join(" ")}function Y2(e){const[t,a]=e.split("-"),i=[];return t&&i.push(t),a&&i.push(a),i}const Q2=e=>{var t,a,i,l,u,d,f,g,y;const{invert:x,toast:v,unstyled:w,interacting:_,setHeights:R,visibleToasts:S,heights:A,index:M,toasts:T,expanded:N,removeToast:E,defaultRichColors:D,closeButton:I,style:U,cancelButtonStyle:F,actionButtonStyle:fe,className:ge="",descriptionClassName:he="",duration:ne,position:le,gap:ce,expandByDefault:ve,classNames:O,icons:j,closeButtonAriaLabel:z="Close toast"}=e,[J,me]=Q.useState(null),[Te,H]=Q.useState(null),[Y,oe]=Q.useState(!1),[se,we]=Q.useState(!1),[ee,Se]=Q.useState(!1),[De,He]=Q.useState(!1),[Qe,Ye]=Q.useState(!1),[Ft,G]=Q.useState(0),[Xe,qe]=Q.useState(0),Je=Q.useRef(v.duration||ne||hw),Qa=Q.useRef(null),En=Q.useRef(null),P=M===0,V=M+1<=S,Z=v.type,be=v.dismissible!==!1,ue=v.className||"",pe=v.descriptionClassName||"",Ie=Q.useMemo(()=>A.findIndex(Ze=>Ze.toastId===v.id)||0,[A,v.id]),ft=Q.useMemo(()=>{var Ze;return(Ze=v.closeButton)!=null?Ze:I},[v.closeButton,I]),ht=Q.useMemo(()=>v.duration||ne||hw,[v.duration,ne]),pn=Q.useRef(0),zn=Q.useRef(0),Qn=Q.useRef(0),Ja=Q.useRef(null),[Ta,an]=le.split("-"),Jn=Q.useMemo(()=>A.reduce((Ze,Kt,mn)=>mn>=Ie?Ze:Ze+Kt.height,0),[A,Ie]),rn=P2(),Ps=v.invert||x,qr=Z==="loading";zn.current=Q.useMemo(()=>Ie*ce+Jn,[Ie,Jn]),Q.useEffect(()=>{Je.current=ht},[ht]),Q.useEffect(()=>{oe(!0)},[]),Q.useEffect(()=>{const Ze=En.current;if(Ze){const Kt=Ze.getBoundingClientRect().height;return qe(Kt),R(mn=>[{toastId:v.id,height:Kt,position:v.position},...mn]),()=>R(mn=>mn.filter(Rn=>Rn.toastId!==v.id))}},[R,v.id]),Q.useLayoutEffect(()=>{if(!Y)return;const Ze=En.current,Kt=Ze.style.height;Ze.style.height="auto";const mn=Ze.getBoundingClientRect().height;Ze.style.height=Kt,qe(mn),R(Rn=>Rn.find(Ut=>Ut.toastId===v.id)?Rn.map(Ut=>Ut.toastId===v.id?{...Ut,height:mn}:Ut):[{toastId:v.id,height:mn,position:v.position},...Rn])},[Y,v.title,v.description,R,v.id,v.jsx,v.action,v.cancel]);const Wa=Q.useCallback(()=>{we(!0),G(zn.current),R(Ze=>Ze.filter(Kt=>Kt.toastId!==v.id)),setTimeout(()=>{E(v)},Z2)},[v,E,R,zn]);Q.useEffect(()=>{if(v.promise&&Z==="loading"||v.duration===1/0||v.type==="loading")return;let Ze;return N||_||rn?(()=>{if(Qn.current<pn.current){const Rn=new Date().getTime()-pn.current;Je.current=Je.current-Rn}Qn.current=new Date().getTime()})():(()=>{Je.current!==1/0&&(pn.current=new Date().getTime(),Ze=setTimeout(()=>{v.onAutoClose==null||v.onAutoClose.call(v,v),Wa()},Je.current))})(),()=>clearTimeout(Ze)},[N,_,v,Z,rn,Wa]),Q.useEffect(()=>{v.delete&&(Wa(),v.onDismiss==null||v.onDismiss.call(v,v))},[Wa,v.delete]);function ho(){var Ze;if(j?.loading){var Kt;return Q.createElement("div",{className:ir(O?.loader,v==null||(Kt=v.classNames)==null?void 0:Kt.loader,"sonner-loader"),"data-visible":Z==="loading"},j.loading)}return Q.createElement(A2,{className:ir(O?.loader,v==null||(Ze=v.classNames)==null?void 0:Ze.loader),visible:Z==="loading"})}const po=v.icon||j?.[Z]||N2(Z);var Oi,er;return Q.createElement("li",{tabIndex:0,ref:En,className:ir(ge,ue,O?.toast,v==null||(t=v.classNames)==null?void 0:t.toast,O?.default,O?.[Z],v==null||(a=v.classNames)==null?void 0:a[Z]),"data-sonner-toast":"","data-rich-colors":(Oi=v.richColors)!=null?Oi:D,"data-styled":!(v.jsx||v.unstyled||w),"data-mounted":Y,"data-promise":!!v.promise,"data-swiped":Qe,"data-removed":se,"data-visible":V,"data-y-position":Ta,"data-x-position":an,"data-index":M,"data-front":P,"data-swiping":ee,"data-dismissible":be,"data-type":Z,"data-invert":Ps,"data-swipe-out":De,"data-swipe-direction":Te,"data-expanded":!!(N||ve&&Y),"data-testid":v.testId,style:{"--index":M,"--toasts-before":M,"--z-index":T.length-M,"--offset":`${se?Ft:zn.current}px`,"--initial-height":ve?"auto":`${Xe}px`,...U,...v.style},onDragEnd:()=>{Se(!1),me(null),Ja.current=null},onPointerDown:Ze=>{Ze.button!==2&&(qr||!be||(Qa.current=new Date,G(zn.current),Ze.target.setPointerCapture(Ze.pointerId),Ze.target.tagName!=="BUTTON"&&(Se(!0),Ja.current={x:Ze.clientX,y:Ze.clientY})))},onPointerUp:()=>{var Ze,Kt,mn;if(De||!be)return;Ja.current=null;const Rn=Number(((Ze=En.current)==null?void 0:Ze.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Fr=Number(((Kt=En.current)==null?void 0:Kt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ut=new Date().getTime()-((mn=Qa.current)==null?void 0:mn.getTime()),Pn=J==="x"?Rn:Fr,Ai=Math.abs(Pn)/Ut;if(Math.abs(Pn)>=X2||Ai>.11){G(zn.current),v.onDismiss==null||v.onDismiss.call(v,v),H(J==="x"?Rn>0?"right":"left":Fr>0?"down":"up"),Wa(),He(!0);return}else{var Kn,In;(Kn=En.current)==null||Kn.style.setProperty("--swipe-amount-x","0px"),(In=En.current)==null||In.style.setProperty("--swipe-amount-y","0px")}Ye(!1),Se(!1),me(null)},onPointerMove:Ze=>{var Kt,mn,Rn;if(!Ja.current||!be||((Kt=window.getSelection())==null?void 0:Kt.toString().length)>0)return;const Ut=Ze.clientY-Ja.current.y,Pn=Ze.clientX-Ja.current.x;var Ai;const Kn=(Ai=e.swipeDirections)!=null?Ai:Y2(le);!J&&(Math.abs(Pn)>1||Math.abs(Ut)>1)&&me(Math.abs(Pn)>Math.abs(Ut)?"x":"y");let In={x:0,y:0};const mo=Da=>1/(1.5+Math.abs(Da)/20);if(J==="y"){if(Kn.includes("top")||Kn.includes("bottom"))if(Kn.includes("top")&&Ut<0||Kn.includes("bottom")&&Ut>0)In.y=Ut;else{const Da=Ut*mo(Ut);In.y=Math.abs(Da)<Math.abs(Ut)?Da:Ut}}else if(J==="x"&&(Kn.includes("left")||Kn.includes("right")))if(Kn.includes("left")&&Pn<0||Kn.includes("right")&&Pn>0)In.x=Pn;else{const Da=Pn*mo(Pn);In.x=Math.abs(Da)<Math.abs(Pn)?Da:Pn}(Math.abs(In.x)>0||Math.abs(In.y)>0)&&Ye(!0),(mn=En.current)==null||mn.style.setProperty("--swipe-amount-x",`${In.x}px`),(Rn=En.current)==null||Rn.style.setProperty("--swipe-amount-y",`${In.y}px`)}},ft&&!v.jsx&&Z!=="loading"?Q.createElement("button",{"aria-label":z,"data-disabled":qr,"data-close-button":!0,onClick:qr||!be?()=>{}:()=>{Wa(),v.onDismiss==null||v.onDismiss.call(v,v)},className:ir(O?.closeButton,v==null||(i=v.classNames)==null?void 0:i.closeButton)},(er=j?.close)!=null?er:z2):null,(Z||v.icon||v.promise)&&v.icon!==null&&(j?.[Z]!==null||v.icon)?Q.createElement("div",{"data-icon":"",className:ir(O?.icon,v==null||(l=v.classNames)==null?void 0:l.icon)},v.promise||v.type==="loading"&&!v.icon?v.icon||ho():null,v.type!=="loading"?po:null):null,Q.createElement("div",{"data-content":"",className:ir(O?.content,v==null||(u=v.classNames)==null?void 0:u.content)},Q.createElement("div",{"data-title":"",className:ir(O?.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?Q.createElement("div",{"data-description":"",className:ir(he,pe,O?.description,v==null||(f=v.classNames)==null?void 0:f.description)},typeof v.description=="function"?v.description():v.description):null),Q.isValidElement(v.cancel)?v.cancel:v.cancel&&Iu(v.cancel)?Q.createElement("button",{"data-button":!0,"data-cancel":!0,style:v.cancelButtonStyle||F,onClick:Ze=>{Iu(v.cancel)&&be&&(v.cancel.onClick==null||v.cancel.onClick.call(v.cancel,Ze),Wa())},className:ir(O?.cancelButton,v==null||(g=v.classNames)==null?void 0:g.cancelButton)},v.cancel.label):null,Q.isValidElement(v.action)?v.action:v.action&&Iu(v.action)?Q.createElement("button",{"data-button":!0,"data-action":!0,style:v.actionButtonStyle||fe,onClick:Ze=>{Iu(v.action)&&(v.action.onClick==null||v.action.onClick.call(v.action,Ze),!Ze.defaultPrevented&&Wa())},className:ir(O?.actionButton,v==null||(y=v.classNames)==null?void 0:y.actionButton)},v.action.label):null)};function pw(){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 J2(e,t){const a={};return[e,t].forEach((i,l)=>{const u=l===1,d=u?"--mobile-offset":"--offset",f=u?B2:V2;function g(y){["top","right","bottom","left"].forEach(x=>{a[`${d}-${x}`]=typeof y=="number"?`${y}px`:y})}typeof i=="number"||typeof i=="string"?g(i):typeof i=="object"?["top","right","bottom","left"].forEach(y=>{i[y]===void 0?a[`${d}-${y}`]=f:a[`${d}-${y}`]=typeof i[y]=="number"?`${i[y]}px`:i[y]}):g(f)}),a}const W2=Q.forwardRef(function(t,a){const{id:i,invert:l,position:u="bottom-right",hotkey:d=["altKey","KeyT"],expand:f,closeButton:g,className:y,offset:x,mobileOffset:v,theme:w="light",richColors:_,duration:R,style:S,visibleToasts:A=$2,toastOptions:M,dir:T=pw(),gap:N=H2,icons:E,containerAriaLabel:D="Notifications"}=t,[I,U]=Q.useState([]),F=Q.useMemo(()=>i?I.filter(Y=>Y.toasterId===i):I.filter(Y=>!Y.toasterId),[I,i]),fe=Q.useMemo(()=>Array.from(new Set([u].concat(F.filter(Y=>Y.position).map(Y=>Y.position)))),[F,u]),[ge,he]=Q.useState([]),[ne,le]=Q.useState(!1),[ce,ve]=Q.useState(!1),[O,j]=Q.useState(w!=="system"?w:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),z=Q.useRef(null),J=d.join("+").replace(/Key/g,"").replace(/Digit/g,""),me=Q.useRef(null),Te=Q.useRef(!1),H=Q.useCallback(Y=>{U(oe=>{var se;return(se=oe.find(we=>we.id===Y.id))!=null&&se.delete||Gn.dismiss(Y.id),oe.filter(({id:we})=>we!==Y.id)})},[]);return Q.useEffect(()=>Gn.subscribe(Y=>{if(Y.dismiss){requestAnimationFrame(()=>{U(oe=>oe.map(se=>se.id===Y.id?{...se,delete:!0}:se))});return}setTimeout(()=>{uS.flushSync(()=>{U(oe=>{const se=oe.findIndex(we=>we.id===Y.id);return se!==-1?[...oe.slice(0,se),{...oe[se],...Y},...oe.slice(se+1)]:[Y,...oe]})})})}),[I]),Q.useEffect(()=>{if(w!=="system"){j(w);return}if(w==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?j("dark"):j("light")),typeof window>"u")return;const Y=window.matchMedia("(prefers-color-scheme: dark)");try{Y.addEventListener("change",({matches:oe})=>{j(oe?"dark":"light")})}catch{Y.addListener(({matches:se})=>{try{j(se?"dark":"light")}catch(we){console.error(we)}})}},[w]),Q.useEffect(()=>{I.length<=1&&le(!1)},[I]),Q.useEffect(()=>{const Y=oe=>{var se;if(d.every(Se=>oe[Se]||oe.code===Se)){var ee;le(!0),(ee=z.current)==null||ee.focus()}oe.code==="Escape"&&(document.activeElement===z.current||(se=z.current)!=null&&se.contains(document.activeElement))&&le(!1)};return document.addEventListener("keydown",Y),()=>document.removeEventListener("keydown",Y)},[d]),Q.useEffect(()=>{if(z.current)return()=>{me.current&&(me.current.focus({preventScroll:!0}),me.current=null,Te.current=!1)}},[z.current]),Q.createElement("section",{ref:a,"aria-label":`${D} ${J}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},fe.map((Y,oe)=>{var se;const[we,ee]=Y.split("-");return F.length?Q.createElement("ol",{key:Y,dir:T==="auto"?pw():T,tabIndex:-1,ref:z,className:y,"data-sonner-toaster":!0,"data-sonner-theme":O,"data-y-position":we,"data-x-position":ee,style:{"--front-toast-height":`${((se=ge[0])==null?void 0:se.height)||0}px`,"--width":`${G2}px`,"--gap":`${N}px`,...S,...J2(x,v)},onBlur:Se=>{Te.current&&!Se.currentTarget.contains(Se.relatedTarget)&&(Te.current=!1,me.current&&(me.current.focus({preventScroll:!0}),me.current=null))},onFocus:Se=>{Se.target instanceof HTMLElement&&Se.target.dataset.dismissible==="false"||Te.current||(Te.current=!0,me.current=Se.relatedTarget)},onMouseEnter:()=>le(!0),onMouseMove:()=>le(!0),onMouseLeave:()=>{ce||le(!1)},onDragEnd:()=>le(!1),onPointerDown:Se=>{Se.target instanceof HTMLElement&&Se.target.dataset.dismissible==="false"||ve(!0)},onPointerUp:()=>ve(!1)},F.filter(Se=>!Se.position&&oe===0||Se.position===Y).map((Se,De)=>{var He,Qe;return Q.createElement(Q2,{key:Se.id,icons:E,index:De,toast:Se,defaultRichColors:_,duration:(He=M?.duration)!=null?He:R,className:M?.className,descriptionClassName:M?.descriptionClassName,invert:l,visibleToasts:A,closeButton:(Qe=M?.closeButton)!=null?Qe:g,interacting:ce,position:Y,style:M?.style,unstyled:M?.unstyled,classNames:M?.classNames,cancelButtonStyle:M?.cancelButtonStyle,actionButtonStyle:M?.actionButtonStyle,closeButtonAriaLabel:M?.closeButtonAriaLabel,removeToast:H,toasts:F.filter(Ye=>Ye.position==Se.position),heights:ge.filter(Ye=>Ye.position==Se.position),setHeights:he,expandByDefault:f,gap:N,expanded:ne,swipeDirections:t.swipeDirections})})):null}))}),eA=({...e})=>{const{theme:t="system"}=MN();return o.jsx(W2,{theme:t,className:"toaster group",icons:{success:o.jsx(LO,{className:"size-4"}),info:o.jsx(AS,{className:"size-4"}),warning:o.jsx(Sm,{className:"size-4"}),error:o.jsx(c2,{className:"size-4"}),loading:o.jsx(lr,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},...e})},tA=new cO,nA=({children:e})=>o.jsx(uO,{client:tA,children:o.jsxs(UN,{defaultTheme:"system",storageKey:"dragon-theme",children:[e,o.jsx(eA,{richColors:!0,expand:!0,position:"top-center"})]})});var Up={exports:{}},Rl={},qp={exports:{}},Fp={};var mw;function aA(){return mw||(mw=1,(function(e){function t(O,j){var z=O.length;O.push(j);e:for(;0<z;){var J=z-1>>>1,me=O[J];if(0<l(me,j))O[J]=j,O[z]=me,z=J;else break e}}function a(O){return O.length===0?null:O[0]}function i(O){if(O.length===0)return null;var j=O[0],z=O.pop();if(z!==j){O[0]=z;e:for(var J=0,me=O.length,Te=me>>>1;J<Te;){var H=2*(J+1)-1,Y=O[H],oe=H+1,se=O[oe];if(0>l(Y,z))oe<me&&0>l(se,Y)?(O[J]=se,O[oe]=z,J=oe):(O[J]=Y,O[H]=z,J=H);else if(oe<me&&0>l(se,z))O[J]=se,O[oe]=z,J=oe;else break e}}return j}function l(O,j){var z=O.sortIndex-j.sortIndex;return z!==0?z:O.id-j.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,f=d.now();e.unstable_now=function(){return d.now()-f}}var g=[],y=[],x=1,v=null,w=3,_=!1,R=!1,S=!1,A=!1,M=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function E(O){for(var j=a(y);j!==null;){if(j.callback===null)i(y);else if(j.startTime<=O)i(y),j.sortIndex=j.expirationTime,t(g,j);else break;j=a(y)}}function D(O){if(S=!1,E(O),!R)if(a(g)!==null)R=!0,I||(I=!0,ne());else{var j=a(y);j!==null&&ve(D,j.startTime-O)}}var I=!1,U=-1,F=5,fe=-1;function ge(){return A?!0:!(e.unstable_now()-fe<F)}function he(){if(A=!1,I){var O=e.unstable_now();fe=O;var j=!0;try{e:{R=!1,S&&(S=!1,T(U),U=-1),_=!0;var z=w;try{t:{for(E(O),v=a(g);v!==null&&!(v.expirationTime>O&&ge());){var J=v.callback;if(typeof J=="function"){v.callback=null,w=v.priorityLevel;var me=J(v.expirationTime<=O);if(O=e.unstable_now(),typeof me=="function"){v.callback=me,E(O),j=!0;break t}v===a(g)&&i(g),E(O)}else i(g);v=a(g)}if(v!==null)j=!0;else{var Te=a(y);Te!==null&&ve(D,Te.startTime-O),j=!1}}break e}finally{v=null,w=z,_=!1}j=void 0}}finally{j?ne():I=!1}}}var ne;if(typeof N=="function")ne=function(){N(he)};else if(typeof MessageChannel<"u"){var le=new MessageChannel,ce=le.port2;le.port1.onmessage=he,ne=function(){ce.postMessage(null)}}else ne=function(){M(he,0)};function ve(O,j){U=M(function(){O(e.unstable_now())},j)}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(O){O.callback=null},e.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<O?Math.floor(1e3/O):5},e.unstable_getCurrentPriorityLevel=function(){return w},e.unstable_next=function(O){switch(w){case 1:case 2:case 3:var j=3;break;default:j=w}var z=w;w=j;try{return O()}finally{w=z}},e.unstable_requestPaint=function(){A=!0},e.unstable_runWithPriority=function(O,j){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var z=w;w=O;try{return j()}finally{w=z}},e.unstable_scheduleCallback=function(O,j,z){var J=e.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?J+z:J):z=J,O){case 1:var me=-1;break;case 2:me=250;break;case 5:me=1073741823;break;case 4:me=1e4;break;default:me=5e3}return me=z+me,O={id:x++,callback:j,priorityLevel:O,startTime:z,expirationTime:me,sortIndex:-1},z>J?(O.sortIndex=z,t(y,O),a(g)===null&&O===a(y)&&(S?(T(U),U=-1):S=!0,ve(D,z-J))):(O.sortIndex=me,t(g,O),R||_||(R=!0,I||(I=!0,ne()))),O},e.unstable_shouldYield=ge,e.unstable_wrapCallback=function(O){var j=w;return function(){var z=w;w=j;try{return O.apply(this,arguments)}finally{w=z}}}})(Fp)),Fp}var gw;function rA(){return gw||(gw=1,qp.exports=aA()),qp.exports}var yw;function iA(){if(yw)return Rl;yw=1;var e=rA(),t=dS(),a=_N();function i(n){var r="https://react.dev/errors/"+n;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)r+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+n+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function u(n){var r=n,s=n;if(n.alternate)for(;r.return;)r=r.return;else{n=r;do r=n,(r.flags&4098)!==0&&(s=r.return),n=r.return;while(n)}return r.tag===3?s:null}function d(n){if(n.tag===13){var r=n.memoizedState;if(r===null&&(n=n.alternate,n!==null&&(r=n.memoizedState)),r!==null)return r.dehydrated}return null}function f(n){if(n.tag===31){var r=n.memoizedState;if(r===null&&(n=n.alternate,n!==null&&(r=n.memoizedState)),r!==null)return r.dehydrated}return null}function g(n){if(u(n)!==n)throw Error(i(188))}function y(n){var r=n.alternate;if(!r){if(r=u(n),r===null)throw Error(i(188));return r!==n?null:n}for(var s=n,c=r;;){var h=s.return;if(h===null)break;var p=h.alternate;if(p===null){if(c=h.return,c!==null){s=c;continue}break}if(h.child===p.child){for(p=h.child;p;){if(p===s)return g(h),n;if(p===c)return g(h),r;p=p.sibling}throw Error(i(188))}if(s.return!==c.return)s=h,c=p;else{for(var b=!1,C=h.child;C;){if(C===s){b=!0,s=h,c=p;break}if(C===c){b=!0,c=h,s=p;break}C=C.sibling}if(!b){for(C=p.child;C;){if(C===s){b=!0,s=p,c=h;break}if(C===c){b=!0,c=p,s=h;break}C=C.sibling}if(!b)throw Error(i(189))}}if(s.alternate!==c)throw Error(i(190))}if(s.tag!==3)throw Error(i(188));return s.stateNode.current===s?n:r}function x(n){var r=n.tag;if(r===5||r===26||r===27||r===6)return n;for(n=n.child;n!==null;){if(r=x(n),r!==null)return r;n=n.sibling}return null}var v=Object.assign,w=Symbol.for("react.element"),_=Symbol.for("react.transitional.element"),R=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),N=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),U=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),fe=Symbol.for("react.activity"),ge=Symbol.for("react.memo_cache_sentinel"),he=Symbol.iterator;function ne(n){return n===null||typeof n!="object"?null:(n=he&&n[he]||n["@@iterator"],typeof n=="function"?n:null)}var le=Symbol.for("react.client.reference");function ce(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===le?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case S:return"Fragment";case M:return"Profiler";case A:return"StrictMode";case D:return"Suspense";case I:return"SuspenseList";case fe:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case R:return"Portal";case N:return n.displayName||"Context";case T:return(n._context.displayName||"Context")+".Consumer";case E:var r=n.render;return n=n.displayName,n||(n=r.displayName||r.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case U:return r=n.displayName||null,r!==null?r:ce(n.type)||"Memo";case F:r=n._payload,n=n._init;try{return ce(n(r))}catch{}}return null}var ve=Array.isArray,O=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z={pending:!1,data:null,method:null,action:null},J=[],me=-1;function Te(n){return{current:n}}function H(n){0>me||(n.current=J[me],J[me]=null,me--)}function Y(n,r){me++,J[me]=n.current,n.current=r}var oe=Te(null),se=Te(null),we=Te(null),ee=Te(null);function Se(n,r){switch(Y(we,r),Y(se,n),Y(oe,null),r.nodeType){case 9:case 11:n=(n=r.documentElement)&&(n=n.namespaceURI)?wb(n):0;break;default:if(n=r.tagName,r=r.namespaceURI)r=wb(r),n=Sb(r,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}H(oe),Y(oe,n)}function De(){H(oe),H(se),H(we)}function He(n){n.memoizedState!==null&&Y(ee,n);var r=oe.current,s=Sb(r,n.type);r!==s&&(Y(se,n),Y(oe,s))}function Qe(n){se.current===n&&(H(oe),H(se)),ee.current===n&&(H(ee),Sl._currentValue=z)}var Ye,Ft;function G(n){if(Ye===void 0)try{throw Error()}catch(s){var r=s.stack.trim().match(/\n( *(at )?)/);Ye=r&&r[1]||"",Ft=-1<s.stack.indexOf(`
|
|
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
`+Ye+n+Ft}var Xe=!1;function qe(n,r){if(!n||Xe)return"";Xe=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(r){var ae=function(){throw Error()};if(Object.defineProperty(ae.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ae,[])}catch(X){var B=X}Reflect.construct(n,[],ae)}else{try{ae.call()}catch(X){B=X}n.call(ae.prototype)}}else{try{throw Error()}catch(X){B=X}(ae=n())&&typeof ae.catch=="function"&&ae.catch(function(){})}}catch(X){if(X&&B&&typeof X.stack=="string")return[X.stack,B.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var h=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");h&&h.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var p=c.DetermineComponentFrameRoot(),b=p[0],C=p[1];if(b&&C){var k=b.split(`
|
|
`),$=C.split(`
|
|
`);for(h=c=0;c<k.length&&!k[c].includes("DetermineComponentFrameRoot");)c++;for(;h<$.length&&!$[h].includes("DetermineComponentFrameRoot");)h++;if(c===k.length||h===$.length)for(c=k.length-1,h=$.length-1;1<=c&&0<=h&&k[c]!==$[h];)h--;for(;1<=c&&0<=h;c--,h--)if(k[c]!==$[h]){if(c!==1||h!==1)do if(c--,h--,0>h||k[c]!==$[h]){var W=`
|
|
`+k[c].replace(" at new "," at ");return n.displayName&&W.includes("<anonymous>")&&(W=W.replace("<anonymous>",n.displayName)),W}while(1<=c&&0<=h);break}}}finally{Xe=!1,Error.prepareStackTrace=s}return(s=n?n.displayName||n.name:"")?G(s):""}function Je(n,r){switch(n.tag){case 26:case 27:case 5:return G(n.type);case 16:return G("Lazy");case 13:return n.child!==r&&r!==null?G("Suspense Fallback"):G("Suspense");case 19:return G("SuspenseList");case 0:case 15:return qe(n.type,!1);case 11:return qe(n.type.render,!1);case 1:return qe(n.type,!0);case 31:return G("Activity");default:return""}}function Qa(n){try{var r="",s=null;do r+=Je(n,s),s=n,n=n.return;while(n);return r}catch(c){return`
|
|
Error generating stack: `+c.message+`
|
|
`+c.stack}}var En=Object.prototype.hasOwnProperty,P=e.unstable_scheduleCallback,V=e.unstable_cancelCallback,Z=e.unstable_shouldYield,be=e.unstable_requestPaint,ue=e.unstable_now,pe=e.unstable_getCurrentPriorityLevel,Ie=e.unstable_ImmediatePriority,ft=e.unstable_UserBlockingPriority,ht=e.unstable_NormalPriority,pn=e.unstable_LowPriority,zn=e.unstable_IdlePriority,Qn=e.log,Ja=e.unstable_setDisableYieldValue,Ta=null,an=null;function Jn(n){if(typeof Qn=="function"&&Ja(n),an&&typeof an.setStrictMode=="function")try{an.setStrictMode(Ta,n)}catch{}}var rn=Math.clz32?Math.clz32:Wa,Ps=Math.log,qr=Math.LN2;function Wa(n){return n>>>=0,n===0?32:31-(Ps(n)/qr|0)|0}var ho=256,po=262144,Oi=4194304;function er(n){var r=n&42;if(r!==0)return r;switch(n&-n){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 n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function Ze(n,r,s){var c=n.pendingLanes;if(c===0)return 0;var h=0,p=n.suspendedLanes,b=n.pingedLanes;n=n.warmLanes;var C=c&134217727;return C!==0?(c=C&~p,c!==0?h=er(c):(b&=C,b!==0?h=er(b):s||(s=C&~n,s!==0&&(h=er(s))))):(C=c&~p,C!==0?h=er(C):b!==0?h=er(b):s||(s=c&~n,s!==0&&(h=er(s)))),h===0?0:r!==0&&r!==h&&(r&p)===0&&(p=h&-h,s=r&-r,p>=s||p===32&&(s&4194048)!==0)?r:h}function Kt(n,r){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&r)===0}function mn(n,r){switch(n){case 1:case 2:case 4:case 8:case 64:return r+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 r+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 Rn(){var n=Oi;return Oi<<=1,(Oi&62914560)===0&&(Oi=4194304),n}function Fr(n){for(var r=[],s=0;31>s;s++)r.push(n);return r}function Ut(n,r){n.pendingLanes|=r,r!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function Pn(n,r,s,c,h,p){var b=n.pendingLanes;n.pendingLanes=s,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=s,n.entangledLanes&=s,n.errorRecoveryDisabledLanes&=s,n.shellSuspendCounter=0;var C=n.entanglements,k=n.expirationTimes,$=n.hiddenUpdates;for(s=b&~s;0<s;){var W=31-rn(s),ae=1<<W;C[W]=0,k[W]=-1;var B=$[W];if(B!==null)for($[W]=null,W=0;W<B.length;W++){var X=B[W];X!==null&&(X.lane&=-536870913)}s&=~ae}c!==0&&Ai(n,c,0),p!==0&&h===0&&n.tag!==0&&(n.suspendedLanes|=p&~(b&~r))}function Ai(n,r,s){n.pendingLanes|=r,n.suspendedLanes&=~r;var c=31-rn(r);n.entangledLanes|=r,n.entanglements[c]=n.entanglements[c]|1073741824|s&261930}function Kn(n,r){var s=n.entangledLanes|=r;for(n=n.entanglements;s;){var c=31-rn(s),h=1<<c;h&r|n[c]&r&&(n[c]|=r),s&=~h}}function In(n,r){var s=r&-r;return s=(s&42)!==0?1:mo(s),(s&(n.suspendedLanes|r))!==0?0:s}function mo(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=16;break;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:case 4194304:case 8388608:case 16777216:case 33554432:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function Da(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function Rf(){var n=j.p;return n!==0?n:(n=window.event,n===void 0?32:Bb(n.type))}function sy(n,r){var s=j.p;try{return j.p=n,r()}finally{j.p=s}}var $r=Math.random().toString(36).slice(2),vn="__reactFiber$"+$r,Ln="__reactProps$"+$r,go="__reactContainer$"+$r,Nf="__reactEvents$"+$r,fE="__reactListeners$"+$r,hE="__reactHandles$"+$r,ly="__reactResources$"+$r,Ks="__reactMarker$"+$r;function Of(n){delete n[vn],delete n[Ln],delete n[Nf],delete n[fE],delete n[hE]}function yo(n){var r=n[vn];if(r)return r;for(var s=n.parentNode;s;){if(r=s[go]||s[vn]){if(s=r.alternate,r.child!==null||s!==null&&s.child!==null)for(n=Ob(n);n!==null;){if(s=n[vn])return s;n=Ob(n)}return r}n=s,s=n.parentNode}return null}function vo(n){if(n=n[vn]||n[go]){var r=n.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return n}return null}function Is(n){var r=n.tag;if(r===5||r===26||r===27||r===6)return n.stateNode;throw Error(i(33))}function xo(n){var r=n[ly];return r||(r=n[ly]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function gn(n){n[Ks]=!0}var cy=new Set,uy={};function Ti(n,r){bo(n,r),bo(n+"Capture",r)}function bo(n,r){for(uy[n]=r,n=0;n<r.length;n++)cy.add(r[n])}var pE=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),dy={},fy={};function mE(n){return En.call(fy,n)?!0:En.call(dy,n)?!1:pE.test(n)?fy[n]=!0:(dy[n]=!0,!1)}function _c(n,r,s){if(mE(r))if(s===null)n.removeAttribute(r);else{switch(typeof s){case"undefined":case"function":case"symbol":n.removeAttribute(r);return;case"boolean":var c=r.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){n.removeAttribute(r);return}}n.setAttribute(r,""+s)}}function jc(n,r,s){if(s===null)n.removeAttribute(r);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(r);return}n.setAttribute(r,""+s)}}function gr(n,r,s,c){if(c===null)n.removeAttribute(s);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(s);return}n.setAttributeNS(r,s,""+c)}}function ma(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function hy(n){var r=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function gE(n,r,s){var c=Object.getOwnPropertyDescriptor(n.constructor.prototype,r);if(!n.hasOwnProperty(r)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var h=c.get,p=c.set;return Object.defineProperty(n,r,{configurable:!0,get:function(){return h.call(this)},set:function(b){s=""+b,p.call(this,b)}}),Object.defineProperty(n,r,{enumerable:c.enumerable}),{getValue:function(){return s},setValue:function(b){s=""+b},stopTracking:function(){n._valueTracker=null,delete n[r]}}}}function Af(n){if(!n._valueTracker){var r=hy(n)?"checked":"value";n._valueTracker=gE(n,r,""+n[r])}}function py(n){if(!n)return!1;var r=n._valueTracker;if(!r)return!0;var s=r.getValue(),c="";return n&&(c=hy(n)?n.checked?"true":"false":n.value),n=c,n!==s?(r.setValue(n),!0):!1}function Cc(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var yE=/[\n"\\]/g;function ga(n){return n.replace(yE,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function Tf(n,r,s,c,h,p,b,C){n.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?n.type=b:n.removeAttribute("type"),r!=null?b==="number"?(r===0&&n.value===""||n.value!=r)&&(n.value=""+ma(r)):n.value!==""+ma(r)&&(n.value=""+ma(r)):b!=="submit"&&b!=="reset"||n.removeAttribute("value"),r!=null?Df(n,b,ma(r)):s!=null?Df(n,b,ma(s)):c!=null&&n.removeAttribute("value"),h==null&&p!=null&&(n.defaultChecked=!!p),h!=null&&(n.checked=h&&typeof h!="function"&&typeof h!="symbol"),C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?n.name=""+ma(C):n.removeAttribute("name")}function my(n,r,s,c,h,p,b,C){if(p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(n.type=p),r!=null||s!=null){if(!(p!=="submit"&&p!=="reset"||r!=null)){Af(n);return}s=s!=null?""+ma(s):"",r=r!=null?""+ma(r):s,C||r===n.value||(n.value=r),n.defaultValue=r}c=c??h,c=typeof c!="function"&&typeof c!="symbol"&&!!c,n.checked=C?n.checked:!!c,n.defaultChecked=!!c,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(n.name=b),Af(n)}function Df(n,r,s){r==="number"&&Cc(n.ownerDocument)===n||n.defaultValue===""+s||(n.defaultValue=""+s)}function wo(n,r,s,c){if(n=n.options,r){r={};for(var h=0;h<s.length;h++)r["$"+s[h]]=!0;for(s=0;s<n.length;s++)h=r.hasOwnProperty("$"+n[s].value),n[s].selected!==h&&(n[s].selected=h),h&&c&&(n[s].defaultSelected=!0)}else{for(s=""+ma(s),r=null,h=0;h<n.length;h++){if(n[h].value===s){n[h].selected=!0,c&&(n[h].defaultSelected=!0);return}r!==null||n[h].disabled||(r=n[h])}r!==null&&(r.selected=!0)}}function gy(n,r,s){if(r!=null&&(r=""+ma(r),r!==n.value&&(n.value=r),s==null)){n.defaultValue!==r&&(n.defaultValue=r);return}n.defaultValue=s!=null?""+ma(s):""}function yy(n,r,s,c){if(r==null){if(c!=null){if(s!=null)throw Error(i(92));if(ve(c)){if(1<c.length)throw Error(i(93));c=c[0]}s=c}s==null&&(s=""),r=s}s=ma(r),n.defaultValue=s,c=n.textContent,c===s&&c!==""&&c!==null&&(n.value=c),Af(n)}function So(n,r){if(r){var s=n.firstChild;if(s&&s===n.lastChild&&s.nodeType===3){s.nodeValue=r;return}}n.textContent=r}var vE=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function vy(n,r,s){var c=r.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?c?n.setProperty(r,""):r==="float"?n.cssFloat="":n[r]="":c?n.setProperty(r,s):typeof s!="number"||s===0||vE.has(r)?r==="float"?n.cssFloat=s:n[r]=(""+s).trim():n[r]=s+"px"}function xy(n,r,s){if(r!=null&&typeof r!="object")throw Error(i(62));if(n=n.style,s!=null){for(var c in s)!s.hasOwnProperty(c)||r!=null&&r.hasOwnProperty(c)||(c.indexOf("--")===0?n.setProperty(c,""):c==="float"?n.cssFloat="":n[c]="");for(var h in r)c=r[h],r.hasOwnProperty(h)&&s[h]!==c&&vy(n,h,c)}else for(var p in r)r.hasOwnProperty(p)&&vy(n,p,r[p])}function Mf(n){if(n.indexOf("-")===-1)return!1;switch(n){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var xE=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),bE=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Ec(n){return bE.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function yr(){}var kf=null;function zf(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var _o=null,jo=null;function by(n){var r=vo(n);if(r&&(n=r.stateNode)){var s=n[Ln]||null;e:switch(n=r.stateNode,r.type){case"input":if(Tf(n,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),r=s.name,s.type==="radio"&&r!=null){for(s=n;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+ga(""+r)+'"][type="radio"]'),r=0;r<s.length;r++){var c=s[r];if(c!==n&&c.form===n.form){var h=c[Ln]||null;if(!h)throw Error(i(90));Tf(c,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name)}}for(r=0;r<s.length;r++)c=s[r],c.form===n.form&&py(c)}break e;case"textarea":gy(n,s.value,s.defaultValue);break e;case"select":r=s.value,r!=null&&wo(n,!!s.multiple,r,!1)}}}var Pf=!1;function wy(n,r,s){if(Pf)return n(r,s);Pf=!0;try{var c=n(r);return c}finally{if(Pf=!1,(_o!==null||jo!==null)&&(hu(),_o&&(r=_o,n=jo,jo=_o=null,by(r),n)))for(r=0;r<n.length;r++)by(n[r])}}function Ls(n,r){var s=n.stateNode;if(s===null)return null;var c=s[Ln]||null;if(c===null)return null;s=c[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(n=n.type,c=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!c;break e;default:n=!1}if(n)return null;if(s&&typeof s!="function")throw Error(i(231,r,typeof s));return s}var vr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Kf=!1;if(vr)try{var Us={};Object.defineProperty(Us,"passive",{get:function(){Kf=!0}}),window.addEventListener("test",Us,Us),window.removeEventListener("test",Us,Us)}catch{Kf=!1}var Vr=null,If=null,Rc=null;function Sy(){if(Rc)return Rc;var n,r=If,s=r.length,c,h="value"in Vr?Vr.value:Vr.textContent,p=h.length;for(n=0;n<s&&r[n]===h[n];n++);var b=s-n;for(c=1;c<=b&&r[s-c]===h[p-c];c++);return Rc=h.slice(n,1<c?1-c:void 0)}function Nc(n){var r=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&r===13&&(n=13)):n=r,n===10&&(n=13),32<=n||n===13?n:0}function Oc(){return!0}function _y(){return!1}function Un(n){function r(s,c,h,p,b){this._reactName=s,this._targetInst=h,this.type=c,this.nativeEvent=p,this.target=b,this.currentTarget=null;for(var C in n)n.hasOwnProperty(C)&&(s=n[C],this[C]=s?s(p):p[C]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?Oc:_y,this.isPropagationStopped=_y,this}return v(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=Oc)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Oc)},persist:function(){},isPersistent:Oc}),r}var Di={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ac=Un(Di),qs=v({},Di,{view:0,detail:0}),wE=Un(qs),Lf,Uf,Fs,Tc=v({},qs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ff,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==Fs&&(Fs&&n.type==="mousemove"?(Lf=n.screenX-Fs.screenX,Uf=n.screenY-Fs.screenY):Uf=Lf=0,Fs=n),Lf)},movementY:function(n){return"movementY"in n?n.movementY:Uf}}),jy=Un(Tc),SE=v({},Tc,{dataTransfer:0}),_E=Un(SE),jE=v({},qs,{relatedTarget:0}),qf=Un(jE),CE=v({},Di,{animationName:0,elapsedTime:0,pseudoElement:0}),EE=Un(CE),RE=v({},Di,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),NE=Un(RE),OE=v({},Di,{data:0}),Cy=Un(OE),AE={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},TE={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},DE={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ME(n){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(n):(n=DE[n])?!!r[n]:!1}function Ff(){return ME}var kE=v({},qs,{key:function(n){if(n.key){var r=AE[n.key]||n.key;if(r!=="Unidentified")return r}return n.type==="keypress"?(n=Nc(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?TE[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ff,charCode:function(n){return n.type==="keypress"?Nc(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?Nc(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),zE=Un(kE),PE=v({},Tc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ey=Un(PE),KE=v({},qs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ff}),IE=Un(KE),LE=v({},Di,{propertyName:0,elapsedTime:0,pseudoElement:0}),UE=Un(LE),qE=v({},Tc,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),FE=Un(qE),$E=v({},Di,{newState:0,oldState:0}),VE=Un($E),BE=[9,13,27,32],$f=vr&&"CompositionEvent"in window,$s=null;vr&&"documentMode"in document&&($s=document.documentMode);var GE=vr&&"TextEvent"in window&&!$s,Ry=vr&&(!$f||$s&&8<$s&&11>=$s),Ny=" ",Oy=!1;function Ay(n,r){switch(n){case"keyup":return BE.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ty(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Co=!1;function HE(n,r){switch(n){case"compositionend":return Ty(r);case"keypress":return r.which!==32?null:(Oy=!0,Ny);case"textInput":return n=r.data,n===Ny&&Oy?null:n;default:return null}}function XE(n,r){if(Co)return n==="compositionend"||!$f&&Ay(n,r)?(n=Sy(),Rc=If=Vr=null,Co=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return Ry&&r.locale!=="ko"?null:r.data;default:return null}}var ZE={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Dy(n){var r=n&&n.nodeName&&n.nodeName.toLowerCase();return r==="input"?!!ZE[n.type]:r==="textarea"}function My(n,r,s,c){_o?jo?jo.push(c):jo=[c]:_o=c,r=bu(r,"onChange"),0<r.length&&(s=new Ac("onChange","change",null,s,c),n.push({event:s,listeners:r}))}var Vs=null,Bs=null;function YE(n){mb(n,0)}function Dc(n){var r=Is(n);if(py(r))return n}function ky(n,r){if(n==="change")return r}var zy=!1;if(vr){var Vf;if(vr){var Bf="oninput"in document;if(!Bf){var Py=document.createElement("div");Py.setAttribute("oninput","return;"),Bf=typeof Py.oninput=="function"}Vf=Bf}else Vf=!1;zy=Vf&&(!document.documentMode||9<document.documentMode)}function Ky(){Vs&&(Vs.detachEvent("onpropertychange",Iy),Bs=Vs=null)}function Iy(n){if(n.propertyName==="value"&&Dc(Bs)){var r=[];My(r,Bs,n,zf(n)),wy(YE,r)}}function QE(n,r,s){n==="focusin"?(Ky(),Vs=r,Bs=s,Vs.attachEvent("onpropertychange",Iy)):n==="focusout"&&Ky()}function JE(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return Dc(Bs)}function WE(n,r){if(n==="click")return Dc(r)}function eR(n,r){if(n==="input"||n==="change")return Dc(r)}function tR(n,r){return n===r&&(n!==0||1/n===1/r)||n!==n&&r!==r}var Wn=typeof Object.is=="function"?Object.is:tR;function Gs(n,r){if(Wn(n,r))return!0;if(typeof n!="object"||n===null||typeof r!="object"||r===null)return!1;var s=Object.keys(n),c=Object.keys(r);if(s.length!==c.length)return!1;for(c=0;c<s.length;c++){var h=s[c];if(!En.call(r,h)||!Wn(n[h],r[h]))return!1}return!0}function Ly(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function Uy(n,r){var s=Ly(n);n=0;for(var c;s;){if(s.nodeType===3){if(c=n+s.textContent.length,n<=r&&c>=r)return{node:s,offset:r-n};n=c}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Ly(s)}}function qy(n,r){return n&&r?n===r?!0:n&&n.nodeType===3?!1:r&&r.nodeType===3?qy(n,r.parentNode):"contains"in n?n.contains(r):n.compareDocumentPosition?!!(n.compareDocumentPosition(r)&16):!1:!1}function Fy(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var r=Cc(n.document);r instanceof n.HTMLIFrameElement;){try{var s=typeof r.contentWindow.location.href=="string"}catch{s=!1}if(s)n=r.contentWindow;else break;r=Cc(n.document)}return r}function Gf(n){var r=n&&n.nodeName&&n.nodeName.toLowerCase();return r&&(r==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||r==="textarea"||n.contentEditable==="true")}var nR=vr&&"documentMode"in document&&11>=document.documentMode,Eo=null,Hf=null,Hs=null,Xf=!1;function $y(n,r,s){var c=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Xf||Eo==null||Eo!==Cc(c)||(c=Eo,"selectionStart"in c&&Gf(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),Hs&&Gs(Hs,c)||(Hs=c,c=bu(Hf,"onSelect"),0<c.length&&(r=new Ac("onSelect","select",null,r,s),n.push({event:r,listeners:c}),r.target=Eo)))}function Mi(n,r){var s={};return s[n.toLowerCase()]=r.toLowerCase(),s["Webkit"+n]="webkit"+r,s["Moz"+n]="moz"+r,s}var Ro={animationend:Mi("Animation","AnimationEnd"),animationiteration:Mi("Animation","AnimationIteration"),animationstart:Mi("Animation","AnimationStart"),transitionrun:Mi("Transition","TransitionRun"),transitionstart:Mi("Transition","TransitionStart"),transitioncancel:Mi("Transition","TransitionCancel"),transitionend:Mi("Transition","TransitionEnd")},Zf={},Vy={};vr&&(Vy=document.createElement("div").style,"AnimationEvent"in window||(delete Ro.animationend.animation,delete Ro.animationiteration.animation,delete Ro.animationstart.animation),"TransitionEvent"in window||delete Ro.transitionend.transition);function ki(n){if(Zf[n])return Zf[n];if(!Ro[n])return n;var r=Ro[n],s;for(s in r)if(r.hasOwnProperty(s)&&s in Vy)return Zf[n]=r[s];return n}var By=ki("animationend"),Gy=ki("animationiteration"),Hy=ki("animationstart"),aR=ki("transitionrun"),rR=ki("transitionstart"),iR=ki("transitioncancel"),Xy=ki("transitionend"),Zy=new Map,Yf="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Yf.push("scrollEnd");function Ma(n,r){Zy.set(n,r),Ti(r,[n])}var Mc=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},ya=[],No=0,Qf=0;function kc(){for(var n=No,r=Qf=No=0;r<n;){var s=ya[r];ya[r++]=null;var c=ya[r];ya[r++]=null;var h=ya[r];ya[r++]=null;var p=ya[r];if(ya[r++]=null,c!==null&&h!==null){var b=c.pending;b===null?h.next=h:(h.next=b.next,b.next=h),c.pending=h}p!==0&&Yy(s,h,p)}}function zc(n,r,s,c){ya[No++]=n,ya[No++]=r,ya[No++]=s,ya[No++]=c,Qf|=c,n.lanes|=c,n=n.alternate,n!==null&&(n.lanes|=c)}function Jf(n,r,s,c){return zc(n,r,s,c),Pc(n)}function zi(n,r){return zc(n,null,null,r),Pc(n)}function Yy(n,r,s){n.lanes|=s;var c=n.alternate;c!==null&&(c.lanes|=s);for(var h=!1,p=n.return;p!==null;)p.childLanes|=s,c=p.alternate,c!==null&&(c.childLanes|=s),p.tag===22&&(n=p.stateNode,n===null||n._visibility&1||(h=!0)),n=p,p=p.return;return n.tag===3?(p=n.stateNode,h&&r!==null&&(h=31-rn(s),n=p.hiddenUpdates,c=n[h],c===null?n[h]=[r]:c.push(r),r.lane=s|536870912),p):null}function Pc(n){if(50<ml)throw ml=0,sp=null,Error(i(185));for(var r=n.return;r!==null;)n=r,r=n.return;return n.tag===3?n.stateNode:null}var Oo={};function oR(n,r,s,c){this.tag=n,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ea(n,r,s,c){return new oR(n,r,s,c)}function Wf(n){return n=n.prototype,!(!n||!n.isReactComponent)}function xr(n,r){var s=n.alternate;return s===null?(s=ea(n.tag,r,n.key,n.mode),s.elementType=n.elementType,s.type=n.type,s.stateNode=n.stateNode,s.alternate=n,n.alternate=s):(s.pendingProps=r,s.type=n.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=n.flags&65011712,s.childLanes=n.childLanes,s.lanes=n.lanes,s.child=n.child,s.memoizedProps=n.memoizedProps,s.memoizedState=n.memoizedState,s.updateQueue=n.updateQueue,r=n.dependencies,s.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},s.sibling=n.sibling,s.index=n.index,s.ref=n.ref,s.refCleanup=n.refCleanup,s}function Qy(n,r){n.flags&=65011714;var s=n.alternate;return s===null?(n.childLanes=0,n.lanes=r,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=s.childLanes,n.lanes=s.lanes,n.child=s.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=s.memoizedProps,n.memoizedState=s.memoizedState,n.updateQueue=s.updateQueue,n.type=s.type,r=s.dependencies,n.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),n}function Kc(n,r,s,c,h,p){var b=0;if(c=n,typeof n=="function")Wf(n)&&(b=1);else if(typeof n=="string")b=dN(n,s,oe.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case fe:return n=ea(31,s,r,h),n.elementType=fe,n.lanes=p,n;case S:return Pi(s.children,h,p,r);case A:b=8,h|=24;break;case M:return n=ea(12,s,r,h|2),n.elementType=M,n.lanes=p,n;case D:return n=ea(13,s,r,h),n.elementType=D,n.lanes=p,n;case I:return n=ea(19,s,r,h),n.elementType=I,n.lanes=p,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case N:b=10;break e;case T:b=9;break e;case E:b=11;break e;case U:b=14;break e;case F:b=16,c=null;break e}b=29,s=Error(i(130,n===null?"null":typeof n,"")),c=null}return r=ea(b,s,r,h),r.elementType=n,r.type=c,r.lanes=p,r}function Pi(n,r,s,c){return n=ea(7,n,c,r),n.lanes=s,n}function eh(n,r,s){return n=ea(6,n,null,r),n.lanes=s,n}function Jy(n){var r=ea(18,null,null,0);return r.stateNode=n,r}function th(n,r,s){return r=ea(4,n.children!==null?n.children:[],n.key,r),r.lanes=s,r.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},r}var Wy=new WeakMap;function va(n,r){if(typeof n=="object"&&n!==null){var s=Wy.get(n);return s!==void 0?s:(r={value:n,source:r,stack:Qa(r)},Wy.set(n,r),r)}return{value:n,source:r,stack:Qa(r)}}var Ao=[],To=0,Ic=null,Xs=0,xa=[],ba=0,Br=null,tr=1,nr="";function br(n,r){Ao[To++]=Xs,Ao[To++]=Ic,Ic=n,Xs=r}function ev(n,r,s){xa[ba++]=tr,xa[ba++]=nr,xa[ba++]=Br,Br=n;var c=tr;n=nr;var h=32-rn(c)-1;c&=~(1<<h),s+=1;var p=32-rn(r)+h;if(30<p){var b=h-h%5;p=(c&(1<<b)-1).toString(32),c>>=b,h-=b,tr=1<<32-rn(r)+h|s<<h|c,nr=p+n}else tr=1<<p|s<<h|c,nr=n}function nh(n){n.return!==null&&(br(n,1),ev(n,1,0))}function ah(n){for(;n===Ic;)Ic=Ao[--To],Ao[To]=null,Xs=Ao[--To],Ao[To]=null;for(;n===Br;)Br=xa[--ba],xa[ba]=null,nr=xa[--ba],xa[ba]=null,tr=xa[--ba],xa[ba]=null}function tv(n,r){xa[ba++]=tr,xa[ba++]=nr,xa[ba++]=Br,tr=r.id,nr=r.overflow,Br=n}var xn=null,At=null,ut=!1,Gr=null,wa=!1,rh=Error(i(519));function Hr(n){var r=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Zs(va(r,n)),rh}function nv(n){var r=n.stateNode,s=n.type,c=n.memoizedProps;switch(r[vn]=n,r[Ln]=c,s){case"dialog":it("cancel",r),it("close",r);break;case"iframe":case"object":case"embed":it("load",r);break;case"video":case"audio":for(s=0;s<yl.length;s++)it(yl[s],r);break;case"source":it("error",r);break;case"img":case"image":case"link":it("error",r),it("load",r);break;case"details":it("toggle",r);break;case"input":it("invalid",r),my(r,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":it("invalid",r);break;case"textarea":it("invalid",r),yy(r,c.value,c.defaultValue,c.children)}s=c.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||r.textContent===""+s||c.suppressHydrationWarning===!0||xb(r.textContent,s)?(c.popover!=null&&(it("beforetoggle",r),it("toggle",r)),c.onScroll!=null&&it("scroll",r),c.onScrollEnd!=null&&it("scrollend",r),c.onClick!=null&&(r.onclick=yr),r=!0):r=!1,r||Hr(n,!0)}function av(n){for(xn=n.return;xn;)switch(xn.tag){case 5:case 31:case 13:wa=!1;return;case 27:case 3:wa=!0;return;default:xn=xn.return}}function Do(n){if(n!==xn)return!1;if(!ut)return av(n),ut=!0,!1;var r=n.tag,s;if((s=r!==3&&r!==27)&&((s=r===5)&&(s=n.type,s=!(s!=="form"&&s!=="button")||Sp(n.type,n.memoizedProps)),s=!s),s&&At&&Hr(n),av(n),r===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(i(317));At=Nb(n)}else if(r===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(i(317));At=Nb(n)}else r===27?(r=At,si(n.type)?(n=Rp,Rp=null,At=n):At=r):At=xn?_a(n.stateNode.nextSibling):null;return!0}function Ki(){At=xn=null,ut=!1}function ih(){var n=Gr;return n!==null&&(Vn===null?Vn=n:Vn.push.apply(Vn,n),Gr=null),n}function Zs(n){Gr===null?Gr=[n]:Gr.push(n)}var oh=Te(null),Ii=null,wr=null;function Xr(n,r,s){Y(oh,r._currentValue),r._currentValue=s}function Sr(n){n._currentValue=oh.current,H(oh)}function sh(n,r,s){for(;n!==null;){var c=n.alternate;if((n.childLanes&r)!==r?(n.childLanes|=r,c!==null&&(c.childLanes|=r)):c!==null&&(c.childLanes&r)!==r&&(c.childLanes|=r),n===s)break;n=n.return}}function lh(n,r,s,c){var h=n.child;for(h!==null&&(h.return=n);h!==null;){var p=h.dependencies;if(p!==null){var b=h.child;p=p.firstContext;e:for(;p!==null;){var C=p;p=h;for(var k=0;k<r.length;k++)if(C.context===r[k]){p.lanes|=s,C=p.alternate,C!==null&&(C.lanes|=s),sh(p.return,s,n),c||(b=null);break e}p=C.next}}else if(h.tag===18){if(b=h.return,b===null)throw Error(i(341));b.lanes|=s,p=b.alternate,p!==null&&(p.lanes|=s),sh(b,s,n),b=null}else b=h.child;if(b!==null)b.return=h;else for(b=h;b!==null;){if(b===n){b=null;break}if(h=b.sibling,h!==null){h.return=b.return,b=h;break}b=b.return}h=b}}function Mo(n,r,s,c){n=null;for(var h=r,p=!1;h!==null;){if(!p){if((h.flags&524288)!==0)p=!0;else if((h.flags&262144)!==0)break}if(h.tag===10){var b=h.alternate;if(b===null)throw Error(i(387));if(b=b.memoizedProps,b!==null){var C=h.type;Wn(h.pendingProps.value,b.value)||(n!==null?n.push(C):n=[C])}}else if(h===ee.current){if(b=h.alternate,b===null)throw Error(i(387));b.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(n!==null?n.push(Sl):n=[Sl])}h=h.return}n!==null&&lh(r,n,s,c),r.flags|=262144}function Lc(n){for(n=n.firstContext;n!==null;){if(!Wn(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function Li(n){Ii=n,wr=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function bn(n){return rv(Ii,n)}function Uc(n,r){return Ii===null&&Li(n),rv(n,r)}function rv(n,r){var s=r._currentValue;if(r={context:r,memoizedValue:s,next:null},wr===null){if(n===null)throw Error(i(308));wr=r,n.dependencies={lanes:0,firstContext:r},n.flags|=524288}else wr=wr.next=r;return s}var sR=typeof AbortController<"u"?AbortController:function(){var n=[],r=this.signal={aborted:!1,addEventListener:function(s,c){n.push(c)}};this.abort=function(){r.aborted=!0,n.forEach(function(s){return s()})}},lR=e.unstable_scheduleCallback,cR=e.unstable_NormalPriority,Qt={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ch(){return{controller:new sR,data:new Map,refCount:0}}function Ys(n){n.refCount--,n.refCount===0&&lR(cR,function(){n.controller.abort()})}var Qs=null,uh=0,ko=0,zo=null;function uR(n,r){if(Qs===null){var s=Qs=[];uh=0,ko=hp(),zo={status:"pending",value:void 0,then:function(c){s.push(c)}}}return uh++,r.then(iv,iv),r}function iv(){if(--uh===0&&Qs!==null){zo!==null&&(zo.status="fulfilled");var n=Qs;Qs=null,ko=0,zo=null;for(var r=0;r<n.length;r++)(0,n[r])()}}function dR(n,r){var s=[],c={status:"pending",value:null,reason:null,then:function(h){s.push(h)}};return n.then(function(){c.status="fulfilled",c.value=r;for(var h=0;h<s.length;h++)(0,s[h])(r)},function(h){for(c.status="rejected",c.reason=h,h=0;h<s.length;h++)(0,s[h])(void 0)}),c}var ov=O.S;O.S=function(n,r){$x=ue(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&uR(n,r),ov!==null&&ov(n,r)};var Ui=Te(null);function dh(){var n=Ui.current;return n!==null?n:Rt.pooledCache}function qc(n,r){r===null?Y(Ui,Ui.current):Y(Ui,r.pool)}function sv(){var n=dh();return n===null?null:{parent:Qt._currentValue,pool:n}}var Po=Error(i(460)),fh=Error(i(474)),Fc=Error(i(542)),$c={then:function(){}};function lv(n){return n=n.status,n==="fulfilled"||n==="rejected"}function cv(n,r,s){switch(s=n[s],s===void 0?n.push(r):s!==r&&(r.then(yr,yr),r=s),r.status){case"fulfilled":return r.value;case"rejected":throw n=r.reason,dv(n),n;default:if(typeof r.status=="string")r.then(yr,yr);else{if(n=Rt,n!==null&&100<n.shellSuspendCounter)throw Error(i(482));n=r,n.status="pending",n.then(function(c){if(r.status==="pending"){var h=r;h.status="fulfilled",h.value=c}},function(c){if(r.status==="pending"){var h=r;h.status="rejected",h.reason=c}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw n=r.reason,dv(n),n}throw Fi=r,Po}}function qi(n){try{var r=n._init;return r(n._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Fi=s,Po):s}}var Fi=null;function uv(){if(Fi===null)throw Error(i(459));var n=Fi;return Fi=null,n}function dv(n){if(n===Po||n===Fc)throw Error(i(483))}var Ko=null,Js=0;function Vc(n){var r=Js;return Js+=1,Ko===null&&(Ko=[]),cv(Ko,n,r)}function Ws(n,r){r=r.props.ref,n.ref=r!==void 0?r:null}function Bc(n,r){throw r.$$typeof===w?Error(i(525)):(n=Object.prototype.toString.call(r),Error(i(31,n==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":n)))}function fv(n){function r(L,K){if(n){var q=L.deletions;q===null?(L.deletions=[K],L.flags|=16):q.push(K)}}function s(L,K){if(!n)return null;for(;K!==null;)r(L,K),K=K.sibling;return null}function c(L){for(var K=new Map;L!==null;)L.key!==null?K.set(L.key,L):K.set(L.index,L),L=L.sibling;return K}function h(L,K){return L=xr(L,K),L.index=0,L.sibling=null,L}function p(L,K,q){return L.index=q,n?(q=L.alternate,q!==null?(q=q.index,q<K?(L.flags|=67108866,K):q):(L.flags|=67108866,K)):(L.flags|=1048576,K)}function b(L){return n&&L.alternate===null&&(L.flags|=67108866),L}function C(L,K,q,te){return K===null||K.tag!==6?(K=eh(q,L.mode,te),K.return=L,K):(K=h(K,q),K.return=L,K)}function k(L,K,q,te){var $e=q.type;return $e===S?W(L,K,q.props.children,te,q.key):K!==null&&(K.elementType===$e||typeof $e=="object"&&$e!==null&&$e.$$typeof===F&&qi($e)===K.type)?(K=h(K,q.props),Ws(K,q),K.return=L,K):(K=Kc(q.type,q.key,q.props,null,L.mode,te),Ws(K,q),K.return=L,K)}function $(L,K,q,te){return K===null||K.tag!==4||K.stateNode.containerInfo!==q.containerInfo||K.stateNode.implementation!==q.implementation?(K=th(q,L.mode,te),K.return=L,K):(K=h(K,q.children||[]),K.return=L,K)}function W(L,K,q,te,$e){return K===null||K.tag!==7?(K=Pi(q,L.mode,te,$e),K.return=L,K):(K=h(K,q),K.return=L,K)}function ae(L,K,q){if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return K=eh(""+K,L.mode,q),K.return=L,K;if(typeof K=="object"&&K!==null){switch(K.$$typeof){case _:return q=Kc(K.type,K.key,K.props,null,L.mode,q),Ws(q,K),q.return=L,q;case R:return K=th(K,L.mode,q),K.return=L,K;case F:return K=qi(K),ae(L,K,q)}if(ve(K)||ne(K))return K=Pi(K,L.mode,q,null),K.return=L,K;if(typeof K.then=="function")return ae(L,Vc(K),q);if(K.$$typeof===N)return ae(L,Uc(L,K),q);Bc(L,K)}return null}function B(L,K,q,te){var $e=K!==null?K.key:null;if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return $e!==null?null:C(L,K,""+q,te);if(typeof q=="object"&&q!==null){switch(q.$$typeof){case _:return q.key===$e?k(L,K,q,te):null;case R:return q.key===$e?$(L,K,q,te):null;case F:return q=qi(q),B(L,K,q,te)}if(ve(q)||ne(q))return $e!==null?null:W(L,K,q,te,null);if(typeof q.then=="function")return B(L,K,Vc(q),te);if(q.$$typeof===N)return B(L,K,Uc(L,q),te);Bc(L,q)}return null}function X(L,K,q,te,$e){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return L=L.get(q)||null,C(K,L,""+te,$e);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case _:return L=L.get(te.key===null?q:te.key)||null,k(K,L,te,$e);case R:return L=L.get(te.key===null?q:te.key)||null,$(K,L,te,$e);case F:return te=qi(te),X(L,K,q,te,$e)}if(ve(te)||ne(te))return L=L.get(q)||null,W(K,L,te,$e,null);if(typeof te.then=="function")return X(L,K,q,Vc(te),$e);if(te.$$typeof===N)return X(L,K,q,Uc(K,te),$e);Bc(K,te)}return null}function Oe(L,K,q,te){for(var $e=null,pt=null,Le=K,et=K=0,st=null;Le!==null&&et<q.length;et++){Le.index>et?(st=Le,Le=null):st=Le.sibling;var mt=B(L,Le,q[et],te);if(mt===null){Le===null&&(Le=st);break}n&&Le&&mt.alternate===null&&r(L,Le),K=p(mt,K,et),pt===null?$e=mt:pt.sibling=mt,pt=mt,Le=st}if(et===q.length)return s(L,Le),ut&&br(L,et),$e;if(Le===null){for(;et<q.length;et++)Le=ae(L,q[et],te),Le!==null&&(K=p(Le,K,et),pt===null?$e=Le:pt.sibling=Le,pt=Le);return ut&&br(L,et),$e}for(Le=c(Le);et<q.length;et++)st=X(Le,L,et,q[et],te),st!==null&&(n&&st.alternate!==null&&Le.delete(st.key===null?et:st.key),K=p(st,K,et),pt===null?$e=st:pt.sibling=st,pt=st);return n&&Le.forEach(function(fi){return r(L,fi)}),ut&&br(L,et),$e}function Ge(L,K,q,te){if(q==null)throw Error(i(151));for(var $e=null,pt=null,Le=K,et=K=0,st=null,mt=q.next();Le!==null&&!mt.done;et++,mt=q.next()){Le.index>et?(st=Le,Le=null):st=Le.sibling;var fi=B(L,Le,mt.value,te);if(fi===null){Le===null&&(Le=st);break}n&&Le&&fi.alternate===null&&r(L,Le),K=p(fi,K,et),pt===null?$e=fi:pt.sibling=fi,pt=fi,Le=st}if(mt.done)return s(L,Le),ut&&br(L,et),$e;if(Le===null){for(;!mt.done;et++,mt=q.next())mt=ae(L,mt.value,te),mt!==null&&(K=p(mt,K,et),pt===null?$e=mt:pt.sibling=mt,pt=mt);return ut&&br(L,et),$e}for(Le=c(Le);!mt.done;et++,mt=q.next())mt=X(Le,L,et,mt.value,te),mt!==null&&(n&&mt.alternate!==null&&Le.delete(mt.key===null?et:mt.key),K=p(mt,K,et),pt===null?$e=mt:pt.sibling=mt,pt=mt);return n&&Le.forEach(function(SN){return r(L,SN)}),ut&&br(L,et),$e}function Et(L,K,q,te){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:{for(var $e=q.key;K!==null;){if(K.key===$e){if($e=q.type,$e===S){if(K.tag===7){s(L,K.sibling),te=h(K,q.props.children),te.return=L,L=te;break e}}else if(K.elementType===$e||typeof $e=="object"&&$e!==null&&$e.$$typeof===F&&qi($e)===K.type){s(L,K.sibling),te=h(K,q.props),Ws(te,q),te.return=L,L=te;break e}s(L,K);break}else r(L,K);K=K.sibling}q.type===S?(te=Pi(q.props.children,L.mode,te,q.key),te.return=L,L=te):(te=Kc(q.type,q.key,q.props,null,L.mode,te),Ws(te,q),te.return=L,L=te)}return b(L);case R:e:{for($e=q.key;K!==null;){if(K.key===$e)if(K.tag===4&&K.stateNode.containerInfo===q.containerInfo&&K.stateNode.implementation===q.implementation){s(L,K.sibling),te=h(K,q.children||[]),te.return=L,L=te;break e}else{s(L,K);break}else r(L,K);K=K.sibling}te=th(q,L.mode,te),te.return=L,L=te}return b(L);case F:return q=qi(q),Et(L,K,q,te)}if(ve(q))return Oe(L,K,q,te);if(ne(q)){if($e=ne(q),typeof $e!="function")throw Error(i(150));return q=$e.call(q),Ge(L,K,q,te)}if(typeof q.then=="function")return Et(L,K,Vc(q),te);if(q.$$typeof===N)return Et(L,K,Uc(L,q),te);Bc(L,q)}return typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint"?(q=""+q,K!==null&&K.tag===6?(s(L,K.sibling),te=h(K,q),te.return=L,L=te):(s(L,K),te=eh(q,L.mode,te),te.return=L,L=te),b(L)):s(L,K)}return function(L,K,q,te){try{Js=0;var $e=Et(L,K,q,te);return Ko=null,$e}catch(Le){if(Le===Po||Le===Fc)throw Le;var pt=ea(29,Le,null,L.mode);return pt.lanes=te,pt.return=L,pt}finally{}}}var $i=fv(!0),hv=fv(!1),Zr=!1;function hh(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ph(n,r){n=n.updateQueue,r.updateQueue===n&&(r.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function Yr(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function Qr(n,r,s){var c=n.updateQueue;if(c===null)return null;if(c=c.shared,(gt&2)!==0){var h=c.pending;return h===null?r.next=r:(r.next=h.next,h.next=r),c.pending=r,r=Pc(n),Yy(n,null,s),r}return zc(n,c,r,s),Pc(n)}function el(n,r,s){if(r=r.updateQueue,r!==null&&(r=r.shared,(s&4194048)!==0)){var c=r.lanes;c&=n.pendingLanes,s|=c,r.lanes=s,Kn(n,s)}}function mh(n,r){var s=n.updateQueue,c=n.alternate;if(c!==null&&(c=c.updateQueue,s===c)){var h=null,p=null;if(s=s.firstBaseUpdate,s!==null){do{var b={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};p===null?h=p=b:p=p.next=b,s=s.next}while(s!==null);p===null?h=p=r:p=p.next=r}else h=p=r;s={baseState:c.baseState,firstBaseUpdate:h,lastBaseUpdate:p,shared:c.shared,callbacks:c.callbacks},n.updateQueue=s;return}n=s.lastBaseUpdate,n===null?s.firstBaseUpdate=r:n.next=r,s.lastBaseUpdate=r}var gh=!1;function tl(){if(gh){var n=zo;if(n!==null)throw n}}function nl(n,r,s,c){gh=!1;var h=n.updateQueue;Zr=!1;var p=h.firstBaseUpdate,b=h.lastBaseUpdate,C=h.shared.pending;if(C!==null){h.shared.pending=null;var k=C,$=k.next;k.next=null,b===null?p=$:b.next=$,b=k;var W=n.alternate;W!==null&&(W=W.updateQueue,C=W.lastBaseUpdate,C!==b&&(C===null?W.firstBaseUpdate=$:C.next=$,W.lastBaseUpdate=k))}if(p!==null){var ae=h.baseState;b=0,W=$=k=null,C=p;do{var B=C.lane&-536870913,X=B!==C.lane;if(X?(ot&B)===B:(c&B)===B){B!==0&&B===ko&&(gh=!0),W!==null&&(W=W.next={lane:0,tag:C.tag,payload:C.payload,callback:null,next:null});e:{var Oe=n,Ge=C;B=r;var Et=s;switch(Ge.tag){case 1:if(Oe=Ge.payload,typeof Oe=="function"){ae=Oe.call(Et,ae,B);break e}ae=Oe;break e;case 3:Oe.flags=Oe.flags&-65537|128;case 0:if(Oe=Ge.payload,B=typeof Oe=="function"?Oe.call(Et,ae,B):Oe,B==null)break e;ae=v({},ae,B);break e;case 2:Zr=!0}}B=C.callback,B!==null&&(n.flags|=64,X&&(n.flags|=8192),X=h.callbacks,X===null?h.callbacks=[B]:X.push(B))}else X={lane:B,tag:C.tag,payload:C.payload,callback:C.callback,next:null},W===null?($=W=X,k=ae):W=W.next=X,b|=B;if(C=C.next,C===null){if(C=h.shared.pending,C===null)break;X=C,C=X.next,X.next=null,h.lastBaseUpdate=X,h.shared.pending=null}}while(!0);W===null&&(k=ae),h.baseState=k,h.firstBaseUpdate=$,h.lastBaseUpdate=W,p===null&&(h.shared.lanes=0),ni|=b,n.lanes=b,n.memoizedState=ae}}function pv(n,r){if(typeof n!="function")throw Error(i(191,n));n.call(r)}function mv(n,r){var s=n.callbacks;if(s!==null)for(n.callbacks=null,n=0;n<s.length;n++)pv(s[n],r)}var Io=Te(null),Gc=Te(0);function gv(n,r){n=Tr,Y(Gc,n),Y(Io,r),Tr=n|r.baseLanes}function yh(){Y(Gc,Tr),Y(Io,Io.current)}function vh(){Tr=Gc.current,H(Io),H(Gc)}var ta=Te(null),Sa=null;function Jr(n){var r=n.alternate;Y(Ht,Ht.current&1),Y(ta,n),Sa===null&&(r===null||Io.current!==null||r.memoizedState!==null)&&(Sa=n)}function xh(n){Y(Ht,Ht.current),Y(ta,n),Sa===null&&(Sa=n)}function yv(n){n.tag===22?(Y(Ht,Ht.current),Y(ta,n),Sa===null&&(Sa=n)):Wr()}function Wr(){Y(Ht,Ht.current),Y(ta,ta.current)}function na(n){H(ta),Sa===n&&(Sa=null),H(Ht)}var Ht=Te(0);function Hc(n){for(var r=n;r!==null;){if(r.tag===13){var s=r.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Cp(s)||Ep(s)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===n)break;for(;r.sibling===null;){if(r.return===null||r.return===n)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var _r=0,We=null,jt=null,Jt=null,Xc=!1,Lo=!1,Vi=!1,Zc=0,al=0,Uo=null,fR=0;function $t(){throw Error(i(321))}function bh(n,r){if(r===null)return!1;for(var s=0;s<r.length&&s<n.length;s++)if(!Wn(n[s],r[s]))return!1;return!0}function wh(n,r,s,c,h,p){return _r=p,We=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,O.H=n===null||n.memoizedState===null?ex:Ph,Vi=!1,p=s(c,h),Vi=!1,Lo&&(p=xv(r,s,c,h)),vv(n),p}function vv(n){O.H=ol;var r=jt!==null&&jt.next!==null;if(_r=0,Jt=jt=We=null,Xc=!1,al=0,Uo=null,r)throw Error(i(300));n===null||Wt||(n=n.dependencies,n!==null&&Lc(n)&&(Wt=!0))}function xv(n,r,s,c){We=n;var h=0;do{if(Lo&&(Uo=null),al=0,Lo=!1,25<=h)throw Error(i(301));if(h+=1,Jt=jt=null,n.updateQueue!=null){var p=n.updateQueue;p.lastEffect=null,p.events=null,p.stores=null,p.memoCache!=null&&(p.memoCache.index=0)}O.H=tx,p=r(s,c)}while(Lo);return p}function hR(){var n=O.H,r=n.useState()[0];return r=typeof r.then=="function"?rl(r):r,n=n.useState()[0],(jt!==null?jt.memoizedState:null)!==n&&(We.flags|=1024),r}function Sh(){var n=Zc!==0;return Zc=0,n}function _h(n,r,s){r.updateQueue=n.updateQueue,r.flags&=-2053,n.lanes&=~s}function jh(n){if(Xc){for(n=n.memoizedState;n!==null;){var r=n.queue;r!==null&&(r.pending=null),n=n.next}Xc=!1}_r=0,Jt=jt=We=null,Lo=!1,al=Zc=0,Uo=null}function On(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Jt===null?We.memoizedState=Jt=n:Jt=Jt.next=n,Jt}function Xt(){if(jt===null){var n=We.alternate;n=n!==null?n.memoizedState:null}else n=jt.next;var r=Jt===null?We.memoizedState:Jt.next;if(r!==null)Jt=r,jt=n;else{if(n===null)throw We.alternate===null?Error(i(467)):Error(i(310));jt=n,n={memoizedState:jt.memoizedState,baseState:jt.baseState,baseQueue:jt.baseQueue,queue:jt.queue,next:null},Jt===null?We.memoizedState=Jt=n:Jt=Jt.next=n}return Jt}function Yc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function rl(n){var r=al;return al+=1,Uo===null&&(Uo=[]),n=cv(Uo,n,r),r=We,(Jt===null?r.memoizedState:Jt.next)===null&&(r=r.alternate,O.H=r===null||r.memoizedState===null?ex:Ph),n}function Qc(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return rl(n);if(n.$$typeof===N)return bn(n)}throw Error(i(438,String(n)))}function Ch(n){var r=null,s=We.updateQueue;if(s!==null&&(r=s.memoCache),r==null){var c=We.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(r={data:c.data.map(function(h){return h.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),s===null&&(s=Yc(),We.updateQueue=s),s.memoCache=r,s=r.data[r.index],s===void 0)for(s=r.data[r.index]=Array(n),c=0;c<n;c++)s[c]=ge;return r.index++,s}function jr(n,r){return typeof r=="function"?r(n):r}function Jc(n){var r=Xt();return Eh(r,jt,n)}function Eh(n,r,s){var c=n.queue;if(c===null)throw Error(i(311));c.lastRenderedReducer=s;var h=n.baseQueue,p=c.pending;if(p!==null){if(h!==null){var b=h.next;h.next=p.next,p.next=b}r.baseQueue=h=p,c.pending=null}if(p=n.baseState,h===null)n.memoizedState=p;else{r=h.next;var C=b=null,k=null,$=r,W=!1;do{var ae=$.lane&-536870913;if(ae!==$.lane?(ot&ae)===ae:(_r&ae)===ae){var B=$.revertLane;if(B===0)k!==null&&(k=k.next={lane:0,revertLane:0,gesture:null,action:$.action,hasEagerState:$.hasEagerState,eagerState:$.eagerState,next:null}),ae===ko&&(W=!0);else if((_r&B)===B){$=$.next,B===ko&&(W=!0);continue}else ae={lane:0,revertLane:$.revertLane,gesture:null,action:$.action,hasEagerState:$.hasEagerState,eagerState:$.eagerState,next:null},k===null?(C=k=ae,b=p):k=k.next=ae,We.lanes|=B,ni|=B;ae=$.action,Vi&&s(p,ae),p=$.hasEagerState?$.eagerState:s(p,ae)}else B={lane:ae,revertLane:$.revertLane,gesture:$.gesture,action:$.action,hasEagerState:$.hasEagerState,eagerState:$.eagerState,next:null},k===null?(C=k=B,b=p):k=k.next=B,We.lanes|=ae,ni|=ae;$=$.next}while($!==null&&$!==r);if(k===null?b=p:k.next=C,!Wn(p,n.memoizedState)&&(Wt=!0,W&&(s=zo,s!==null)))throw s;n.memoizedState=p,n.baseState=b,n.baseQueue=k,c.lastRenderedState=p}return h===null&&(c.lanes=0),[n.memoizedState,c.dispatch]}function Rh(n){var r=Xt(),s=r.queue;if(s===null)throw Error(i(311));s.lastRenderedReducer=n;var c=s.dispatch,h=s.pending,p=r.memoizedState;if(h!==null){s.pending=null;var b=h=h.next;do p=n(p,b.action),b=b.next;while(b!==h);Wn(p,r.memoizedState)||(Wt=!0),r.memoizedState=p,r.baseQueue===null&&(r.baseState=p),s.lastRenderedState=p}return[p,c]}function bv(n,r,s){var c=We,h=Xt(),p=ut;if(p){if(s===void 0)throw Error(i(407));s=s()}else s=r();var b=!Wn((jt||h).memoizedState,s);if(b&&(h.memoizedState=s,Wt=!0),h=h.queue,Ah(_v.bind(null,c,h,n),[n]),h.getSnapshot!==r||b||Jt!==null&&Jt.memoizedState.tag&1){if(c.flags|=2048,qo(9,{destroy:void 0},Sv.bind(null,c,h,s,r),null),Rt===null)throw Error(i(349));p||(_r&127)!==0||wv(c,r,s)}return s}function wv(n,r,s){n.flags|=16384,n={getSnapshot:r,value:s},r=We.updateQueue,r===null?(r=Yc(),We.updateQueue=r,r.stores=[n]):(s=r.stores,s===null?r.stores=[n]:s.push(n))}function Sv(n,r,s,c){r.value=s,r.getSnapshot=c,jv(r)&&Cv(n)}function _v(n,r,s){return s(function(){jv(r)&&Cv(n)})}function jv(n){var r=n.getSnapshot;n=n.value;try{var s=r();return!Wn(n,s)}catch{return!0}}function Cv(n){var r=zi(n,2);r!==null&&Bn(r,n,2)}function Nh(n){var r=On();if(typeof n=="function"){var s=n;if(n=s(),Vi){Jn(!0);try{s()}finally{Jn(!1)}}}return r.memoizedState=r.baseState=n,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:jr,lastRenderedState:n},r}function Ev(n,r,s,c){return n.baseState=s,Eh(n,jt,typeof c=="function"?c:jr)}function pR(n,r,s,c,h){if(tu(n))throw Error(i(485));if(n=r.action,n!==null){var p={payload:h,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(b){p.listeners.push(b)}};O.T!==null?s(!0):p.isTransition=!1,c(p),s=r.pending,s===null?(p.next=r.pending=p,Rv(r,p)):(p.next=s.next,r.pending=s.next=p)}}function Rv(n,r){var s=r.action,c=r.payload,h=n.state;if(r.isTransition){var p=O.T,b={};O.T=b;try{var C=s(h,c),k=O.S;k!==null&&k(b,C),Nv(n,r,C)}catch($){Oh(n,r,$)}finally{p!==null&&b.types!==null&&(p.types=b.types),O.T=p}}else try{p=s(h,c),Nv(n,r,p)}catch($){Oh(n,r,$)}}function Nv(n,r,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(c){Ov(n,r,c)},function(c){return Oh(n,r,c)}):Ov(n,r,s)}function Ov(n,r,s){r.status="fulfilled",r.value=s,Av(r),n.state=s,r=n.pending,r!==null&&(s=r.next,s===r?n.pending=null:(s=s.next,r.next=s,Rv(n,s)))}function Oh(n,r,s){var c=n.pending;if(n.pending=null,c!==null){c=c.next;do r.status="rejected",r.reason=s,Av(r),r=r.next;while(r!==c)}n.action=null}function Av(n){n=n.listeners;for(var r=0;r<n.length;r++)(0,n[r])()}function Tv(n,r){return r}function Dv(n,r){if(ut){var s=Rt.formState;if(s!==null){e:{var c=We;if(ut){if(At){t:{for(var h=At,p=wa;h.nodeType!==8;){if(!p){h=null;break t}if(h=_a(h.nextSibling),h===null){h=null;break t}}p=h.data,h=p==="F!"||p==="F"?h:null}if(h){At=_a(h.nextSibling),c=h.data==="F!";break e}}Hr(c)}c=!1}c&&(r=s[0])}}return s=On(),s.memoizedState=s.baseState=r,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Tv,lastRenderedState:r},s.queue=c,s=Qv.bind(null,We,c),c.dispatch=s,c=Nh(!1),p=zh.bind(null,We,!1,c.queue),c=On(),h={state:r,dispatch:null,action:n,pending:null},c.queue=h,s=pR.bind(null,We,h,p,s),h.dispatch=s,c.memoizedState=n,[r,s,!1]}function Mv(n){var r=Xt();return kv(r,jt,n)}function kv(n,r,s){if(r=Eh(n,r,Tv)[0],n=Jc(jr)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var c=rl(r)}catch(b){throw b===Po?Fc:b}else c=r;r=Xt();var h=r.queue,p=h.dispatch;return s!==r.memoizedState&&(We.flags|=2048,qo(9,{destroy:void 0},mR.bind(null,h,s),null)),[c,p,n]}function mR(n,r){n.action=r}function zv(n){var r=Xt(),s=jt;if(s!==null)return kv(r,s,n);Xt(),r=r.memoizedState,s=Xt();var c=s.queue.dispatch;return s.memoizedState=n,[r,c,!1]}function qo(n,r,s,c){return n={tag:n,create:s,deps:c,inst:r,next:null},r=We.updateQueue,r===null&&(r=Yc(),We.updateQueue=r),s=r.lastEffect,s===null?r.lastEffect=n.next=n:(c=s.next,s.next=n,n.next=c,r.lastEffect=n),n}function Pv(){return Xt().memoizedState}function Wc(n,r,s,c){var h=On();We.flags|=n,h.memoizedState=qo(1|r,{destroy:void 0},s,c===void 0?null:c)}function eu(n,r,s,c){var h=Xt();c=c===void 0?null:c;var p=h.memoizedState.inst;jt!==null&&c!==null&&bh(c,jt.memoizedState.deps)?h.memoizedState=qo(r,p,s,c):(We.flags|=n,h.memoizedState=qo(1|r,p,s,c))}function Kv(n,r){Wc(8390656,8,n,r)}function Ah(n,r){eu(2048,8,n,r)}function gR(n){We.flags|=4;var r=We.updateQueue;if(r===null)r=Yc(),We.updateQueue=r,r.events=[n];else{var s=r.events;s===null?r.events=[n]:s.push(n)}}function Iv(n){var r=Xt().memoizedState;return gR({ref:r,nextImpl:n}),function(){if((gt&2)!==0)throw Error(i(440));return r.impl.apply(void 0,arguments)}}function Lv(n,r){return eu(4,2,n,r)}function Uv(n,r){return eu(4,4,n,r)}function qv(n,r){if(typeof r=="function"){n=n();var s=r(n);return function(){typeof s=="function"?s():r(null)}}if(r!=null)return n=n(),r.current=n,function(){r.current=null}}function Fv(n,r,s){s=s!=null?s.concat([n]):null,eu(4,4,qv.bind(null,r,n),s)}function Th(){}function $v(n,r){var s=Xt();r=r===void 0?null:r;var c=s.memoizedState;return r!==null&&bh(r,c[1])?c[0]:(s.memoizedState=[n,r],n)}function Vv(n,r){var s=Xt();r=r===void 0?null:r;var c=s.memoizedState;if(r!==null&&bh(r,c[1]))return c[0];if(c=n(),Vi){Jn(!0);try{n()}finally{Jn(!1)}}return s.memoizedState=[c,r],c}function Dh(n,r,s){return s===void 0||(_r&1073741824)!==0&&(ot&261930)===0?n.memoizedState=r:(n.memoizedState=s,n=Bx(),We.lanes|=n,ni|=n,s)}function Bv(n,r,s,c){return Wn(s,r)?s:Io.current!==null?(n=Dh(n,s,c),Wn(n,r)||(Wt=!0),n):(_r&42)===0||(_r&1073741824)!==0&&(ot&261930)===0?(Wt=!0,n.memoizedState=s):(n=Bx(),We.lanes|=n,ni|=n,r)}function Gv(n,r,s,c,h){var p=j.p;j.p=p!==0&&8>p?p:8;var b=O.T,C={};O.T=C,zh(n,!1,r,s);try{var k=h(),$=O.S;if($!==null&&$(C,k),k!==null&&typeof k=="object"&&typeof k.then=="function"){var W=dR(k,c);il(n,r,W,ia(n))}else il(n,r,c,ia(n))}catch(ae){il(n,r,{then:function(){},status:"rejected",reason:ae},ia())}finally{j.p=p,b!==null&&C.types!==null&&(b.types=C.types),O.T=b}}function yR(){}function Mh(n,r,s,c){if(n.tag!==5)throw Error(i(476));var h=Hv(n).queue;Gv(n,h,r,z,s===null?yR:function(){return Xv(n),s(c)})}function Hv(n){var r=n.memoizedState;if(r!==null)return r;r={memoizedState:z,baseState:z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:jr,lastRenderedState:z},next:null};var s={};return r.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:jr,lastRenderedState:s},next:null},n.memoizedState=r,n=n.alternate,n!==null&&(n.memoizedState=r),r}function Xv(n){var r=Hv(n);r.next===null&&(r=n.alternate.memoizedState),il(n,r.next.queue,{},ia())}function kh(){return bn(Sl)}function Zv(){return Xt().memoizedState}function Yv(){return Xt().memoizedState}function vR(n){for(var r=n.return;r!==null;){switch(r.tag){case 24:case 3:var s=ia();n=Yr(s);var c=Qr(r,n,s);c!==null&&(Bn(c,r,s),el(c,r,s)),r={cache:ch()},n.payload=r;return}r=r.return}}function xR(n,r,s){var c=ia();s={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},tu(n)?Jv(r,s):(s=Jf(n,r,s,c),s!==null&&(Bn(s,n,c),Wv(s,r,c)))}function Qv(n,r,s){var c=ia();il(n,r,s,c)}function il(n,r,s,c){var h={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(tu(n))Jv(r,h);else{var p=n.alternate;if(n.lanes===0&&(p===null||p.lanes===0)&&(p=r.lastRenderedReducer,p!==null))try{var b=r.lastRenderedState,C=p(b,s);if(h.hasEagerState=!0,h.eagerState=C,Wn(C,b))return zc(n,r,h,0),Rt===null&&kc(),!1}catch{}finally{}if(s=Jf(n,r,h,c),s!==null)return Bn(s,n,c),Wv(s,r,c),!0}return!1}function zh(n,r,s,c){if(c={lane:2,revertLane:hp(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},tu(n)){if(r)throw Error(i(479))}else r=Jf(n,s,c,2),r!==null&&Bn(r,n,2)}function tu(n){var r=n.alternate;return n===We||r!==null&&r===We}function Jv(n,r){Lo=Xc=!0;var s=n.pending;s===null?r.next=r:(r.next=s.next,s.next=r),n.pending=r}function Wv(n,r,s){if((s&4194048)!==0){var c=r.lanes;c&=n.pendingLanes,s|=c,r.lanes=s,Kn(n,s)}}var ol={readContext:bn,use:Qc,useCallback:$t,useContext:$t,useEffect:$t,useImperativeHandle:$t,useLayoutEffect:$t,useInsertionEffect:$t,useMemo:$t,useReducer:$t,useRef:$t,useState:$t,useDebugValue:$t,useDeferredValue:$t,useTransition:$t,useSyncExternalStore:$t,useId:$t,useHostTransitionStatus:$t,useFormState:$t,useActionState:$t,useOptimistic:$t,useMemoCache:$t,useCacheRefresh:$t};ol.useEffectEvent=$t;var ex={readContext:bn,use:Qc,useCallback:function(n,r){return On().memoizedState=[n,r===void 0?null:r],n},useContext:bn,useEffect:Kv,useImperativeHandle:function(n,r,s){s=s!=null?s.concat([n]):null,Wc(4194308,4,qv.bind(null,r,n),s)},useLayoutEffect:function(n,r){return Wc(4194308,4,n,r)},useInsertionEffect:function(n,r){Wc(4,2,n,r)},useMemo:function(n,r){var s=On();r=r===void 0?null:r;var c=n();if(Vi){Jn(!0);try{n()}finally{Jn(!1)}}return s.memoizedState=[c,r],c},useReducer:function(n,r,s){var c=On();if(s!==void 0){var h=s(r);if(Vi){Jn(!0);try{s(r)}finally{Jn(!1)}}}else h=r;return c.memoizedState=c.baseState=h,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:h},c.queue=n,n=n.dispatch=xR.bind(null,We,n),[c.memoizedState,n]},useRef:function(n){var r=On();return n={current:n},r.memoizedState=n},useState:function(n){n=Nh(n);var r=n.queue,s=Qv.bind(null,We,r);return r.dispatch=s,[n.memoizedState,s]},useDebugValue:Th,useDeferredValue:function(n,r){var s=On();return Dh(s,n,r)},useTransition:function(){var n=Nh(!1);return n=Gv.bind(null,We,n.queue,!0,!1),On().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,r,s){var c=We,h=On();if(ut){if(s===void 0)throw Error(i(407));s=s()}else{if(s=r(),Rt===null)throw Error(i(349));(ot&127)!==0||wv(c,r,s)}h.memoizedState=s;var p={value:s,getSnapshot:r};return h.queue=p,Kv(_v.bind(null,c,p,n),[n]),c.flags|=2048,qo(9,{destroy:void 0},Sv.bind(null,c,p,s,r),null),s},useId:function(){var n=On(),r=Rt.identifierPrefix;if(ut){var s=nr,c=tr;s=(c&~(1<<32-rn(c)-1)).toString(32)+s,r="_"+r+"R_"+s,s=Zc++,0<s&&(r+="H"+s.toString(32)),r+="_"}else s=fR++,r="_"+r+"r_"+s.toString(32)+"_";return n.memoizedState=r},useHostTransitionStatus:kh,useFormState:Dv,useActionState:Dv,useOptimistic:function(n){var r=On();r.memoizedState=r.baseState=n;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=s,r=zh.bind(null,We,!0,s),s.dispatch=r,[n,r]},useMemoCache:Ch,useCacheRefresh:function(){return On().memoizedState=vR.bind(null,We)},useEffectEvent:function(n){var r=On(),s={impl:n};return r.memoizedState=s,function(){if((gt&2)!==0)throw Error(i(440));return s.impl.apply(void 0,arguments)}}},Ph={readContext:bn,use:Qc,useCallback:$v,useContext:bn,useEffect:Ah,useImperativeHandle:Fv,useInsertionEffect:Lv,useLayoutEffect:Uv,useMemo:Vv,useReducer:Jc,useRef:Pv,useState:function(){return Jc(jr)},useDebugValue:Th,useDeferredValue:function(n,r){var s=Xt();return Bv(s,jt.memoizedState,n,r)},useTransition:function(){var n=Jc(jr)[0],r=Xt().memoizedState;return[typeof n=="boolean"?n:rl(n),r]},useSyncExternalStore:bv,useId:Zv,useHostTransitionStatus:kh,useFormState:Mv,useActionState:Mv,useOptimistic:function(n,r){var s=Xt();return Ev(s,jt,n,r)},useMemoCache:Ch,useCacheRefresh:Yv};Ph.useEffectEvent=Iv;var tx={readContext:bn,use:Qc,useCallback:$v,useContext:bn,useEffect:Ah,useImperativeHandle:Fv,useInsertionEffect:Lv,useLayoutEffect:Uv,useMemo:Vv,useReducer:Rh,useRef:Pv,useState:function(){return Rh(jr)},useDebugValue:Th,useDeferredValue:function(n,r){var s=Xt();return jt===null?Dh(s,n,r):Bv(s,jt.memoizedState,n,r)},useTransition:function(){var n=Rh(jr)[0],r=Xt().memoizedState;return[typeof n=="boolean"?n:rl(n),r]},useSyncExternalStore:bv,useId:Zv,useHostTransitionStatus:kh,useFormState:zv,useActionState:zv,useOptimistic:function(n,r){var s=Xt();return jt!==null?Ev(s,jt,n,r):(s.baseState=n,[n,s.queue.dispatch])},useMemoCache:Ch,useCacheRefresh:Yv};tx.useEffectEvent=Iv;function Kh(n,r,s,c){r=n.memoizedState,s=s(c,r),s=s==null?r:v({},r,s),n.memoizedState=s,n.lanes===0&&(n.updateQueue.baseState=s)}var Ih={enqueueSetState:function(n,r,s){n=n._reactInternals;var c=ia(),h=Yr(c);h.payload=r,s!=null&&(h.callback=s),r=Qr(n,h,c),r!==null&&(Bn(r,n,c),el(r,n,c))},enqueueReplaceState:function(n,r,s){n=n._reactInternals;var c=ia(),h=Yr(c);h.tag=1,h.payload=r,s!=null&&(h.callback=s),r=Qr(n,h,c),r!==null&&(Bn(r,n,c),el(r,n,c))},enqueueForceUpdate:function(n,r){n=n._reactInternals;var s=ia(),c=Yr(s);c.tag=2,r!=null&&(c.callback=r),r=Qr(n,c,s),r!==null&&(Bn(r,n,s),el(r,n,s))}};function nx(n,r,s,c,h,p,b){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(c,p,b):r.prototype&&r.prototype.isPureReactComponent?!Gs(s,c)||!Gs(h,p):!0}function ax(n,r,s,c){n=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(s,c),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(s,c),r.state!==n&&Ih.enqueueReplaceState(r,r.state,null)}function Bi(n,r){var s=r;if("ref"in r){s={};for(var c in r)c!=="ref"&&(s[c]=r[c])}if(n=n.defaultProps){s===r&&(s=v({},s));for(var h in n)s[h]===void 0&&(s[h]=n[h])}return s}function rx(n){Mc(n)}function ix(n){console.error(n)}function ox(n){Mc(n)}function nu(n,r){try{var s=n.onUncaughtError;s(r.value,{componentStack:r.stack})}catch(c){setTimeout(function(){throw c})}}function sx(n,r,s){try{var c=n.onCaughtError;c(s.value,{componentStack:s.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function Lh(n,r,s){return s=Yr(s),s.tag=3,s.payload={element:null},s.callback=function(){nu(n,r)},s}function lx(n){return n=Yr(n),n.tag=3,n}function cx(n,r,s,c){var h=s.type.getDerivedStateFromError;if(typeof h=="function"){var p=c.value;n.payload=function(){return h(p)},n.callback=function(){sx(r,s,c)}}var b=s.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(n.callback=function(){sx(r,s,c),typeof h!="function"&&(ai===null?ai=new Set([this]):ai.add(this));var C=c.stack;this.componentDidCatch(c.value,{componentStack:C!==null?C:""})})}function bR(n,r,s,c,h){if(s.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(r=s.alternate,r!==null&&Mo(r,s,h,!0),s=ta.current,s!==null){switch(s.tag){case 31:case 13:return Sa===null?pu():s.alternate===null&&Vt===0&&(Vt=3),s.flags&=-257,s.flags|=65536,s.lanes=h,c===$c?s.flags|=16384:(r=s.updateQueue,r===null?s.updateQueue=new Set([c]):r.add(c),up(n,c,h)),!1;case 22:return s.flags|=65536,c===$c?s.flags|=16384:(r=s.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([c])},s.updateQueue=r):(s=r.retryQueue,s===null?r.retryQueue=new Set([c]):s.add(c)),up(n,c,h)),!1}throw Error(i(435,s.tag))}return up(n,c,h),pu(),!1}if(ut)return r=ta.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=h,c!==rh&&(n=Error(i(422),{cause:c}),Zs(va(n,s)))):(c!==rh&&(r=Error(i(423),{cause:c}),Zs(va(r,s))),n=n.current.alternate,n.flags|=65536,h&=-h,n.lanes|=h,c=va(c,s),h=Lh(n.stateNode,c,h),mh(n,h),Vt!==4&&(Vt=2)),!1;var p=Error(i(520),{cause:c});if(p=va(p,s),pl===null?pl=[p]:pl.push(p),Vt!==4&&(Vt=2),r===null)return!0;c=va(c,s),s=r;do{switch(s.tag){case 3:return s.flags|=65536,n=h&-h,s.lanes|=n,n=Lh(s.stateNode,c,n),mh(s,n),!1;case 1:if(r=s.type,p=s.stateNode,(s.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||p!==null&&typeof p.componentDidCatch=="function"&&(ai===null||!ai.has(p))))return s.flags|=65536,h&=-h,s.lanes|=h,h=lx(h),cx(h,n,s,c),mh(s,h),!1}s=s.return}while(s!==null);return!1}var Uh=Error(i(461)),Wt=!1;function wn(n,r,s,c){r.child=n===null?hv(r,null,s,c):$i(r,n.child,s,c)}function ux(n,r,s,c,h){s=s.render;var p=r.ref;if("ref"in c){var b={};for(var C in c)C!=="ref"&&(b[C]=c[C])}else b=c;return Li(r),c=wh(n,r,s,b,p,h),C=Sh(),n!==null&&!Wt?(_h(n,r,h),Cr(n,r,h)):(ut&&C&&nh(r),r.flags|=1,wn(n,r,c,h),r.child)}function dx(n,r,s,c,h){if(n===null){var p=s.type;return typeof p=="function"&&!Wf(p)&&p.defaultProps===void 0&&s.compare===null?(r.tag=15,r.type=p,fx(n,r,p,c,h)):(n=Kc(s.type,null,c,r,r.mode,h),n.ref=r.ref,n.return=r,r.child=n)}if(p=n.child,!Xh(n,h)){var b=p.memoizedProps;if(s=s.compare,s=s!==null?s:Gs,s(b,c)&&n.ref===r.ref)return Cr(n,r,h)}return r.flags|=1,n=xr(p,c),n.ref=r.ref,n.return=r,r.child=n}function fx(n,r,s,c,h){if(n!==null){var p=n.memoizedProps;if(Gs(p,c)&&n.ref===r.ref)if(Wt=!1,r.pendingProps=c=p,Xh(n,h))(n.flags&131072)!==0&&(Wt=!0);else return r.lanes=n.lanes,Cr(n,r,h)}return qh(n,r,s,c,h)}function hx(n,r,s,c){var h=c.children,p=n!==null?n.memoizedState:null;if(n===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((r.flags&128)!==0){if(p=p!==null?p.baseLanes|s:s,n!==null){for(c=r.child=n.child,h=0;c!==null;)h=h|c.lanes|c.childLanes,c=c.sibling;c=h&~p}else c=0,r.child=null;return px(n,r,p,s,c)}if((s&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},n!==null&&qc(r,p!==null?p.cachePool:null),p!==null?gv(r,p):yh(),yv(r);else return c=r.lanes=536870912,px(n,r,p!==null?p.baseLanes|s:s,s,c)}else p!==null?(qc(r,p.cachePool),gv(r,p),Wr(),r.memoizedState=null):(n!==null&&qc(r,null),yh(),Wr());return wn(n,r,h,s),r.child}function sl(n,r){return n!==null&&n.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function px(n,r,s,c,h){var p=dh();return p=p===null?null:{parent:Qt._currentValue,pool:p},r.memoizedState={baseLanes:s,cachePool:p},n!==null&&qc(r,null),yh(),yv(r),n!==null&&Mo(n,r,c,!0),r.childLanes=h,null}function au(n,r){return r=iu({mode:r.mode,children:r.children},n.mode),r.ref=n.ref,n.child=r,r.return=n,r}function mx(n,r,s){return $i(r,n.child,null,s),n=au(r,r.pendingProps),n.flags|=2,na(r),r.memoizedState=null,n}function wR(n,r,s){var c=r.pendingProps,h=(r.flags&128)!==0;if(r.flags&=-129,n===null){if(ut){if(c.mode==="hidden")return n=au(r,c),r.lanes=536870912,sl(null,n);if(xh(r),(n=At)?(n=Rb(n,wa),n=n!==null&&n.data==="&"?n:null,n!==null&&(r.memoizedState={dehydrated:n,treeContext:Br!==null?{id:tr,overflow:nr}:null,retryLane:536870912,hydrationErrors:null},s=Jy(n),s.return=r,r.child=s,xn=r,At=null)):n=null,n===null)throw Hr(r);return r.lanes=536870912,null}return au(r,c)}var p=n.memoizedState;if(p!==null){var b=p.dehydrated;if(xh(r),h)if(r.flags&256)r.flags&=-257,r=mx(n,r,s);else if(r.memoizedState!==null)r.child=n.child,r.flags|=128,r=null;else throw Error(i(558));else if(Wt||Mo(n,r,s,!1),h=(s&n.childLanes)!==0,Wt||h){if(c=Rt,c!==null&&(b=In(c,s),b!==0&&b!==p.retryLane))throw p.retryLane=b,zi(n,b),Bn(c,n,b),Uh;pu(),r=mx(n,r,s)}else n=p.treeContext,At=_a(b.nextSibling),xn=r,ut=!0,Gr=null,wa=!1,n!==null&&tv(r,n),r=au(r,c),r.flags|=4096;return r}return n=xr(n.child,{mode:c.mode,children:c.children}),n.ref=r.ref,r.child=n,n.return=r,n}function ru(n,r){var s=r.ref;if(s===null)n!==null&&n.ref!==null&&(r.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(i(284));(n===null||n.ref!==s)&&(r.flags|=4194816)}}function qh(n,r,s,c,h){return Li(r),s=wh(n,r,s,c,void 0,h),c=Sh(),n!==null&&!Wt?(_h(n,r,h),Cr(n,r,h)):(ut&&c&&nh(r),r.flags|=1,wn(n,r,s,h),r.child)}function gx(n,r,s,c,h,p){return Li(r),r.updateQueue=null,s=xv(r,c,s,h),vv(n),c=Sh(),n!==null&&!Wt?(_h(n,r,p),Cr(n,r,p)):(ut&&c&&nh(r),r.flags|=1,wn(n,r,s,p),r.child)}function yx(n,r,s,c,h){if(Li(r),r.stateNode===null){var p=Oo,b=s.contextType;typeof b=="object"&&b!==null&&(p=bn(b)),p=new s(c,p),r.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,p.updater=Ih,r.stateNode=p,p._reactInternals=r,p=r.stateNode,p.props=c,p.state=r.memoizedState,p.refs={},hh(r),b=s.contextType,p.context=typeof b=="object"&&b!==null?bn(b):Oo,p.state=r.memoizedState,b=s.getDerivedStateFromProps,typeof b=="function"&&(Kh(r,s,b,c),p.state=r.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof p.getSnapshotBeforeUpdate=="function"||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(b=p.state,typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount(),b!==p.state&&Ih.enqueueReplaceState(p,p.state,null),nl(r,c,p,h),tl(),p.state=r.memoizedState),typeof p.componentDidMount=="function"&&(r.flags|=4194308),c=!0}else if(n===null){p=r.stateNode;var C=r.memoizedProps,k=Bi(s,C);p.props=k;var $=p.context,W=s.contextType;b=Oo,typeof W=="object"&&W!==null&&(b=bn(W));var ae=s.getDerivedStateFromProps;W=typeof ae=="function"||typeof p.getSnapshotBeforeUpdate=="function",C=r.pendingProps!==C,W||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(C||$!==b)&&ax(r,p,c,b),Zr=!1;var B=r.memoizedState;p.state=B,nl(r,c,p,h),tl(),$=r.memoizedState,C||B!==$||Zr?(typeof ae=="function"&&(Kh(r,s,ae,c),$=r.memoizedState),(k=Zr||nx(r,s,k,c,B,$,b))?(W||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount()),typeof p.componentDidMount=="function"&&(r.flags|=4194308)):(typeof p.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=c,r.memoizedState=$),p.props=c,p.state=$,p.context=b,c=k):(typeof p.componentDidMount=="function"&&(r.flags|=4194308),c=!1)}else{p=r.stateNode,ph(n,r),b=r.memoizedProps,W=Bi(s,b),p.props=W,ae=r.pendingProps,B=p.context,$=s.contextType,k=Oo,typeof $=="object"&&$!==null&&(k=bn($)),C=s.getDerivedStateFromProps,($=typeof C=="function"||typeof p.getSnapshotBeforeUpdate=="function")||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(b!==ae||B!==k)&&ax(r,p,c,k),Zr=!1,B=r.memoizedState,p.state=B,nl(r,c,p,h),tl();var X=r.memoizedState;b!==ae||B!==X||Zr||n!==null&&n.dependencies!==null&&Lc(n.dependencies)?(typeof C=="function"&&(Kh(r,s,C,c),X=r.memoizedState),(W=Zr||nx(r,s,W,c,B,X,k)||n!==null&&n.dependencies!==null&&Lc(n.dependencies))?($||typeof p.UNSAFE_componentWillUpdate!="function"&&typeof p.componentWillUpdate!="function"||(typeof p.componentWillUpdate=="function"&&p.componentWillUpdate(c,X,k),typeof p.UNSAFE_componentWillUpdate=="function"&&p.UNSAFE_componentWillUpdate(c,X,k)),typeof p.componentDidUpdate=="function"&&(r.flags|=4),typeof p.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof p.componentDidUpdate!="function"||b===n.memoizedProps&&B===n.memoizedState||(r.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||b===n.memoizedProps&&B===n.memoizedState||(r.flags|=1024),r.memoizedProps=c,r.memoizedState=X),p.props=c,p.state=X,p.context=k,c=W):(typeof p.componentDidUpdate!="function"||b===n.memoizedProps&&B===n.memoizedState||(r.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||b===n.memoizedProps&&B===n.memoizedState||(r.flags|=1024),c=!1)}return p=c,ru(n,r),c=(r.flags&128)!==0,p||c?(p=r.stateNode,s=c&&typeof s.getDerivedStateFromError!="function"?null:p.render(),r.flags|=1,n!==null&&c?(r.child=$i(r,n.child,null,h),r.child=$i(r,null,s,h)):wn(n,r,s,h),r.memoizedState=p.state,n=r.child):n=Cr(n,r,h),n}function vx(n,r,s,c){return Ki(),r.flags|=256,wn(n,r,s,c),r.child}var Fh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function $h(n){return{baseLanes:n,cachePool:sv()}}function Vh(n,r,s){return n=n!==null?n.childLanes&~s:0,r&&(n|=ra),n}function xx(n,r,s){var c=r.pendingProps,h=!1,p=(r.flags&128)!==0,b;if((b=p)||(b=n!==null&&n.memoizedState===null?!1:(Ht.current&2)!==0),b&&(h=!0,r.flags&=-129),b=(r.flags&32)!==0,r.flags&=-33,n===null){if(ut){if(h?Jr(r):Wr(),(n=At)?(n=Rb(n,wa),n=n!==null&&n.data!=="&"?n:null,n!==null&&(r.memoizedState={dehydrated:n,treeContext:Br!==null?{id:tr,overflow:nr}:null,retryLane:536870912,hydrationErrors:null},s=Jy(n),s.return=r,r.child=s,xn=r,At=null)):n=null,n===null)throw Hr(r);return Ep(n)?r.lanes=32:r.lanes=536870912,null}var C=c.children;return c=c.fallback,h?(Wr(),h=r.mode,C=iu({mode:"hidden",children:C},h),c=Pi(c,h,s,null),C.return=r,c.return=r,C.sibling=c,r.child=C,c=r.child,c.memoizedState=$h(s),c.childLanes=Vh(n,b,s),r.memoizedState=Fh,sl(null,c)):(Jr(r),Bh(r,C))}var k=n.memoizedState;if(k!==null&&(C=k.dehydrated,C!==null)){if(p)r.flags&256?(Jr(r),r.flags&=-257,r=Gh(n,r,s)):r.memoizedState!==null?(Wr(),r.child=n.child,r.flags|=128,r=null):(Wr(),C=c.fallback,h=r.mode,c=iu({mode:"visible",children:c.children},h),C=Pi(C,h,s,null),C.flags|=2,c.return=r,C.return=r,c.sibling=C,r.child=c,$i(r,n.child,null,s),c=r.child,c.memoizedState=$h(s),c.childLanes=Vh(n,b,s),r.memoizedState=Fh,r=sl(null,c));else if(Jr(r),Ep(C)){if(b=C.nextSibling&&C.nextSibling.dataset,b)var $=b.dgst;b=$,c=Error(i(419)),c.stack="",c.digest=b,Zs({value:c,source:null,stack:null}),r=Gh(n,r,s)}else if(Wt||Mo(n,r,s,!1),b=(s&n.childLanes)!==0,Wt||b){if(b=Rt,b!==null&&(c=In(b,s),c!==0&&c!==k.retryLane))throw k.retryLane=c,zi(n,c),Bn(b,n,c),Uh;Cp(C)||pu(),r=Gh(n,r,s)}else Cp(C)?(r.flags|=192,r.child=n.child,r=null):(n=k.treeContext,At=_a(C.nextSibling),xn=r,ut=!0,Gr=null,wa=!1,n!==null&&tv(r,n),r=Bh(r,c.children),r.flags|=4096);return r}return h?(Wr(),C=c.fallback,h=r.mode,k=n.child,$=k.sibling,c=xr(k,{mode:"hidden",children:c.children}),c.subtreeFlags=k.subtreeFlags&65011712,$!==null?C=xr($,C):(C=Pi(C,h,s,null),C.flags|=2),C.return=r,c.return=r,c.sibling=C,r.child=c,sl(null,c),c=r.child,C=n.child.memoizedState,C===null?C=$h(s):(h=C.cachePool,h!==null?(k=Qt._currentValue,h=h.parent!==k?{parent:k,pool:k}:h):h=sv(),C={baseLanes:C.baseLanes|s,cachePool:h}),c.memoizedState=C,c.childLanes=Vh(n,b,s),r.memoizedState=Fh,sl(n.child,c)):(Jr(r),s=n.child,n=s.sibling,s=xr(s,{mode:"visible",children:c.children}),s.return=r,s.sibling=null,n!==null&&(b=r.deletions,b===null?(r.deletions=[n],r.flags|=16):b.push(n)),r.child=s,r.memoizedState=null,s)}function Bh(n,r){return r=iu({mode:"visible",children:r},n.mode),r.return=n,n.child=r}function iu(n,r){return n=ea(22,n,null,r),n.lanes=0,n}function Gh(n,r,s){return $i(r,n.child,null,s),n=Bh(r,r.pendingProps.children),n.flags|=2,r.memoizedState=null,n}function bx(n,r,s){n.lanes|=r;var c=n.alternate;c!==null&&(c.lanes|=r),sh(n.return,r,s)}function Hh(n,r,s,c,h,p){var b=n.memoizedState;b===null?n.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:c,tail:s,tailMode:h,treeForkCount:p}:(b.isBackwards=r,b.rendering=null,b.renderingStartTime=0,b.last=c,b.tail=s,b.tailMode=h,b.treeForkCount=p)}function wx(n,r,s){var c=r.pendingProps,h=c.revealOrder,p=c.tail;c=c.children;var b=Ht.current,C=(b&2)!==0;if(C?(b=b&1|2,r.flags|=128):b&=1,Y(Ht,b),wn(n,r,c,s),c=ut?Xs:0,!C&&n!==null&&(n.flags&128)!==0)e:for(n=r.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&bx(n,s,r);else if(n.tag===19)bx(n,s,r);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===r)break e;for(;n.sibling===null;){if(n.return===null||n.return===r)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}switch(h){case"forwards":for(s=r.child,h=null;s!==null;)n=s.alternate,n!==null&&Hc(n)===null&&(h=s),s=s.sibling;s=h,s===null?(h=r.child,r.child=null):(h=s.sibling,s.sibling=null),Hh(r,!1,h,s,p,c);break;case"backwards":case"unstable_legacy-backwards":for(s=null,h=r.child,r.child=null;h!==null;){if(n=h.alternate,n!==null&&Hc(n)===null){r.child=h;break}n=h.sibling,h.sibling=s,s=h,h=n}Hh(r,!0,s,null,p,c);break;case"together":Hh(r,!1,null,null,void 0,c);break;default:r.memoizedState=null}return r.child}function Cr(n,r,s){if(n!==null&&(r.dependencies=n.dependencies),ni|=r.lanes,(s&r.childLanes)===0)if(n!==null){if(Mo(n,r,s,!1),(s&r.childLanes)===0)return null}else return null;if(n!==null&&r.child!==n.child)throw Error(i(153));if(r.child!==null){for(n=r.child,s=xr(n,n.pendingProps),r.child=s,s.return=r;n.sibling!==null;)n=n.sibling,s=s.sibling=xr(n,n.pendingProps),s.return=r;s.sibling=null}return r.child}function Xh(n,r){return(n.lanes&r)!==0?!0:(n=n.dependencies,!!(n!==null&&Lc(n)))}function SR(n,r,s){switch(r.tag){case 3:Se(r,r.stateNode.containerInfo),Xr(r,Qt,n.memoizedState.cache),Ki();break;case 27:case 5:He(r);break;case 4:Se(r,r.stateNode.containerInfo);break;case 10:Xr(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,xh(r),null;break;case 13:var c=r.memoizedState;if(c!==null)return c.dehydrated!==null?(Jr(r),r.flags|=128,null):(s&r.child.childLanes)!==0?xx(n,r,s):(Jr(r),n=Cr(n,r,s),n!==null?n.sibling:null);Jr(r);break;case 19:var h=(n.flags&128)!==0;if(c=(s&r.childLanes)!==0,c||(Mo(n,r,s,!1),c=(s&r.childLanes)!==0),h){if(c)return wx(n,r,s);r.flags|=128}if(h=r.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),Y(Ht,Ht.current),c)break;return null;case 22:return r.lanes=0,hx(n,r,s,r.pendingProps);case 24:Xr(r,Qt,n.memoizedState.cache)}return Cr(n,r,s)}function Sx(n,r,s){if(n!==null)if(n.memoizedProps!==r.pendingProps)Wt=!0;else{if(!Xh(n,s)&&(r.flags&128)===0)return Wt=!1,SR(n,r,s);Wt=(n.flags&131072)!==0}else Wt=!1,ut&&(r.flags&1048576)!==0&&ev(r,Xs,r.index);switch(r.lanes=0,r.tag){case 16:e:{var c=r.pendingProps;if(n=qi(r.elementType),r.type=n,typeof n=="function")Wf(n)?(c=Bi(n,c),r.tag=1,r=yx(null,r,n,c,s)):(r.tag=0,r=qh(null,r,n,c,s));else{if(n!=null){var h=n.$$typeof;if(h===E){r.tag=11,r=ux(null,r,n,c,s);break e}else if(h===U){r.tag=14,r=dx(null,r,n,c,s);break e}}throw r=ce(n)||n,Error(i(306,r,""))}}return r;case 0:return qh(n,r,r.type,r.pendingProps,s);case 1:return c=r.type,h=Bi(c,r.pendingProps),yx(n,r,c,h,s);case 3:e:{if(Se(r,r.stateNode.containerInfo),n===null)throw Error(i(387));c=r.pendingProps;var p=r.memoizedState;h=p.element,ph(n,r),nl(r,c,null,s);var b=r.memoizedState;if(c=b.cache,Xr(r,Qt,c),c!==p.cache&&lh(r,[Qt],s,!0),tl(),c=b.element,p.isDehydrated)if(p={element:c,isDehydrated:!1,cache:b.cache},r.updateQueue.baseState=p,r.memoizedState=p,r.flags&256){r=vx(n,r,c,s);break e}else if(c!==h){h=va(Error(i(424)),r),Zs(h),r=vx(n,r,c,s);break e}else{switch(n=r.stateNode.containerInfo,n.nodeType){case 9:n=n.body;break;default:n=n.nodeName==="HTML"?n.ownerDocument.body:n}for(At=_a(n.firstChild),xn=r,ut=!0,Gr=null,wa=!0,s=hv(r,null,c,s),r.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(Ki(),c===h){r=Cr(n,r,s);break e}wn(n,r,c,s)}r=r.child}return r;case 26:return ru(n,r),n===null?(s=Mb(r.type,null,r.pendingProps,null))?r.memoizedState=s:ut||(s=r.type,n=r.pendingProps,c=wu(we.current).createElement(s),c[vn]=r,c[Ln]=n,Sn(c,s,n),gn(c),r.stateNode=c):r.memoizedState=Mb(r.type,n.memoizedProps,r.pendingProps,n.memoizedState),null;case 27:return He(r),n===null&&ut&&(c=r.stateNode=Ab(r.type,r.pendingProps,we.current),xn=r,wa=!0,h=At,si(r.type)?(Rp=h,At=_a(c.firstChild)):At=h),wn(n,r,r.pendingProps.children,s),ru(n,r),n===null&&(r.flags|=4194304),r.child;case 5:return n===null&&ut&&((h=c=At)&&(c=JR(c,r.type,r.pendingProps,wa),c!==null?(r.stateNode=c,xn=r,At=_a(c.firstChild),wa=!1,h=!0):h=!1),h||Hr(r)),He(r),h=r.type,p=r.pendingProps,b=n!==null?n.memoizedProps:null,c=p.children,Sp(h,p)?c=null:b!==null&&Sp(h,b)&&(r.flags|=32),r.memoizedState!==null&&(h=wh(n,r,hR,null,null,s),Sl._currentValue=h),ru(n,r),wn(n,r,c,s),r.child;case 6:return n===null&&ut&&((n=s=At)&&(s=WR(s,r.pendingProps,wa),s!==null?(r.stateNode=s,xn=r,At=null,n=!0):n=!1),n||Hr(r)),null;case 13:return xx(n,r,s);case 4:return Se(r,r.stateNode.containerInfo),c=r.pendingProps,n===null?r.child=$i(r,null,c,s):wn(n,r,c,s),r.child;case 11:return ux(n,r,r.type,r.pendingProps,s);case 7:return wn(n,r,r.pendingProps,s),r.child;case 8:return wn(n,r,r.pendingProps.children,s),r.child;case 12:return wn(n,r,r.pendingProps.children,s),r.child;case 10:return c=r.pendingProps,Xr(r,r.type,c.value),wn(n,r,c.children,s),r.child;case 9:return h=r.type._context,c=r.pendingProps.children,Li(r),h=bn(h),c=c(h),r.flags|=1,wn(n,r,c,s),r.child;case 14:return dx(n,r,r.type,r.pendingProps,s);case 15:return fx(n,r,r.type,r.pendingProps,s);case 19:return wx(n,r,s);case 31:return wR(n,r,s);case 22:return hx(n,r,s,r.pendingProps);case 24:return Li(r),c=bn(Qt),n===null?(h=dh(),h===null&&(h=Rt,p=ch(),h.pooledCache=p,p.refCount++,p!==null&&(h.pooledCacheLanes|=s),h=p),r.memoizedState={parent:c,cache:h},hh(r),Xr(r,Qt,h)):((n.lanes&s)!==0&&(ph(n,r),nl(r,null,null,s),tl()),h=n.memoizedState,p=r.memoizedState,h.parent!==c?(h={parent:c,cache:c},r.memoizedState=h,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=h),Xr(r,Qt,c)):(c=p.cache,Xr(r,Qt,c),c!==h.cache&&lh(r,[Qt],s,!0))),wn(n,r,r.pendingProps.children,s),r.child;case 29:throw r.pendingProps}throw Error(i(156,r.tag))}function Er(n){n.flags|=4}function Zh(n,r,s,c,h){if((r=(n.mode&32)!==0)&&(r=!1),r){if(n.flags|=16777216,(h&335544128)===h)if(n.stateNode.complete)n.flags|=8192;else if(Zx())n.flags|=8192;else throw Fi=$c,fh}else n.flags&=-16777217}function _x(n,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!Ib(r))if(Zx())n.flags|=8192;else throw Fi=$c,fh}function ou(n,r){r!==null&&(n.flags|=4),n.flags&16384&&(r=n.tag!==22?Rn():536870912,n.lanes|=r,Bo|=r)}function ll(n,r){if(!ut)switch(n.tailMode){case"hidden":r=n.tail;for(var s=null;r!==null;)r.alternate!==null&&(s=r),r=r.sibling;s===null?n.tail=null:s.sibling=null;break;case"collapsed":s=n.tail;for(var c=null;s!==null;)s.alternate!==null&&(c=s),s=s.sibling;c===null?r||n.tail===null?n.tail=null:n.tail.sibling=null:c.sibling=null}}function Tt(n){var r=n.alternate!==null&&n.alternate.child===n.child,s=0,c=0;if(r)for(var h=n.child;h!==null;)s|=h.lanes|h.childLanes,c|=h.subtreeFlags&65011712,c|=h.flags&65011712,h.return=n,h=h.sibling;else for(h=n.child;h!==null;)s|=h.lanes|h.childLanes,c|=h.subtreeFlags,c|=h.flags,h.return=n,h=h.sibling;return n.subtreeFlags|=c,n.childLanes=s,r}function _R(n,r,s){var c=r.pendingProps;switch(ah(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Tt(r),null;case 1:return Tt(r),null;case 3:return s=r.stateNode,c=null,n!==null&&(c=n.memoizedState.cache),r.memoizedState.cache!==c&&(r.flags|=2048),Sr(Qt),De(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(n===null||n.child===null)&&(Do(r)?Er(r):n===null||n.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,ih())),Tt(r),null;case 26:var h=r.type,p=r.memoizedState;return n===null?(Er(r),p!==null?(Tt(r),_x(r,p)):(Tt(r),Zh(r,h,null,c,s))):p?p!==n.memoizedState?(Er(r),Tt(r),_x(r,p)):(Tt(r),r.flags&=-16777217):(n=n.memoizedProps,n!==c&&Er(r),Tt(r),Zh(r,h,n,c,s)),null;case 27:if(Qe(r),s=we.current,h=r.type,n!==null&&r.stateNode!=null)n.memoizedProps!==c&&Er(r);else{if(!c){if(r.stateNode===null)throw Error(i(166));return Tt(r),null}n=oe.current,Do(r)?nv(r):(n=Ab(h,c,s),r.stateNode=n,Er(r))}return Tt(r),null;case 5:if(Qe(r),h=r.type,n!==null&&r.stateNode!=null)n.memoizedProps!==c&&Er(r);else{if(!c){if(r.stateNode===null)throw Error(i(166));return Tt(r),null}if(p=oe.current,Do(r))nv(r);else{var b=wu(we.current);switch(p){case 1:p=b.createElementNS("http://www.w3.org/2000/svg",h);break;case 2:p=b.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;default:switch(h){case"svg":p=b.createElementNS("http://www.w3.org/2000/svg",h);break;case"math":p=b.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;case"script":p=b.createElement("div"),p.innerHTML="<script><\/script>",p=p.removeChild(p.firstChild);break;case"select":p=typeof c.is=="string"?b.createElement("select",{is:c.is}):b.createElement("select"),c.multiple?p.multiple=!0:c.size&&(p.size=c.size);break;default:p=typeof c.is=="string"?b.createElement(h,{is:c.is}):b.createElement(h)}}p[vn]=r,p[Ln]=c;e:for(b=r.child;b!==null;){if(b.tag===5||b.tag===6)p.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===r)break e;for(;b.sibling===null;){if(b.return===null||b.return===r)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}r.stateNode=p;e:switch(Sn(p,h,c),h){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&Er(r)}}return Tt(r),Zh(r,r.type,n===null?null:n.memoizedProps,r.pendingProps,s),null;case 6:if(n&&r.stateNode!=null)n.memoizedProps!==c&&Er(r);else{if(typeof c!="string"&&r.stateNode===null)throw Error(i(166));if(n=we.current,Do(r)){if(n=r.stateNode,s=r.memoizedProps,c=null,h=xn,h!==null)switch(h.tag){case 27:case 5:c=h.memoizedProps}n[vn]=r,n=!!(n.nodeValue===s||c!==null&&c.suppressHydrationWarning===!0||xb(n.nodeValue,s)),n||Hr(r,!0)}else n=wu(n).createTextNode(c),n[vn]=r,r.stateNode=n}return Tt(r),null;case 31:if(s=r.memoizedState,n===null||n.memoizedState!==null){if(c=Do(r),s!==null){if(n===null){if(!c)throw Error(i(318));if(n=r.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(i(557));n[vn]=r}else Ki(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Tt(r),n=!1}else s=ih(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=s),n=!0;if(!n)return r.flags&256?(na(r),r):(na(r),null);if((r.flags&128)!==0)throw Error(i(558))}return Tt(r),null;case 13:if(c=r.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(h=Do(r),c!==null&&c.dehydrated!==null){if(n===null){if(!h)throw Error(i(318));if(h=r.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(i(317));h[vn]=r}else Ki(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Tt(r),h=!1}else h=ih(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=h),h=!0;if(!h)return r.flags&256?(na(r),r):(na(r),null)}return na(r),(r.flags&128)!==0?(r.lanes=s,r):(s=c!==null,n=n!==null&&n.memoizedState!==null,s&&(c=r.child,h=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(h=c.alternate.memoizedState.cachePool.pool),p=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(p=c.memoizedState.cachePool.pool),p!==h&&(c.flags|=2048)),s!==n&&s&&(r.child.flags|=8192),ou(r,r.updateQueue),Tt(r),null);case 4:return De(),n===null&&yp(r.stateNode.containerInfo),Tt(r),null;case 10:return Sr(r.type),Tt(r),null;case 19:if(H(Ht),c=r.memoizedState,c===null)return Tt(r),null;if(h=(r.flags&128)!==0,p=c.rendering,p===null)if(h)ll(c,!1);else{if(Vt!==0||n!==null&&(n.flags&128)!==0)for(n=r.child;n!==null;){if(p=Hc(n),p!==null){for(r.flags|=128,ll(c,!1),n=p.updateQueue,r.updateQueue=n,ou(r,n),r.subtreeFlags=0,n=s,s=r.child;s!==null;)Qy(s,n),s=s.sibling;return Y(Ht,Ht.current&1|2),ut&&br(r,c.treeForkCount),r.child}n=n.sibling}c.tail!==null&&ue()>du&&(r.flags|=128,h=!0,ll(c,!1),r.lanes=4194304)}else{if(!h)if(n=Hc(p),n!==null){if(r.flags|=128,h=!0,n=n.updateQueue,r.updateQueue=n,ou(r,n),ll(c,!0),c.tail===null&&c.tailMode==="hidden"&&!p.alternate&&!ut)return Tt(r),null}else 2*ue()-c.renderingStartTime>du&&s!==536870912&&(r.flags|=128,h=!0,ll(c,!1),r.lanes=4194304);c.isBackwards?(p.sibling=r.child,r.child=p):(n=c.last,n!==null?n.sibling=p:r.child=p,c.last=p)}return c.tail!==null?(n=c.tail,c.rendering=n,c.tail=n.sibling,c.renderingStartTime=ue(),n.sibling=null,s=Ht.current,Y(Ht,h?s&1|2:s&1),ut&&br(r,c.treeForkCount),n):(Tt(r),null);case 22:case 23:return na(r),vh(),c=r.memoizedState!==null,n!==null?n.memoizedState!==null!==c&&(r.flags|=8192):c&&(r.flags|=8192),c?(s&536870912)!==0&&(r.flags&128)===0&&(Tt(r),r.subtreeFlags&6&&(r.flags|=8192)):Tt(r),s=r.updateQueue,s!==null&&ou(r,s.retryQueue),s=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),c=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(c=r.memoizedState.cachePool.pool),c!==s&&(r.flags|=2048),n!==null&&H(Ui),null;case 24:return s=null,n!==null&&(s=n.memoizedState.cache),r.memoizedState.cache!==s&&(r.flags|=2048),Sr(Qt),Tt(r),null;case 25:return null;case 30:return null}throw Error(i(156,r.tag))}function jR(n,r){switch(ah(r),r.tag){case 1:return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 3:return Sr(Qt),De(),n=r.flags,(n&65536)!==0&&(n&128)===0?(r.flags=n&-65537|128,r):null;case 26:case 27:case 5:return Qe(r),null;case 31:if(r.memoizedState!==null){if(na(r),r.alternate===null)throw Error(i(340));Ki()}return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 13:if(na(r),n=r.memoizedState,n!==null&&n.dehydrated!==null){if(r.alternate===null)throw Error(i(340));Ki()}return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 19:return H(Ht),null;case 4:return De(),null;case 10:return Sr(r.type),null;case 22:case 23:return na(r),vh(),n!==null&&H(Ui),n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 24:return Sr(Qt),null;case 25:return null;default:return null}}function jx(n,r){switch(ah(r),r.tag){case 3:Sr(Qt),De();break;case 26:case 27:case 5:Qe(r);break;case 4:De();break;case 31:r.memoizedState!==null&&na(r);break;case 13:na(r);break;case 19:H(Ht);break;case 10:Sr(r.type);break;case 22:case 23:na(r),vh(),n!==null&&H(Ui);break;case 24:Sr(Qt)}}function cl(n,r){try{var s=r.updateQueue,c=s!==null?s.lastEffect:null;if(c!==null){var h=c.next;s=h;do{if((s.tag&n)===n){c=void 0;var p=s.create,b=s.inst;c=p(),b.destroy=c}s=s.next}while(s!==h)}}catch(C){vt(r,r.return,C)}}function ei(n,r,s){try{var c=r.updateQueue,h=c!==null?c.lastEffect:null;if(h!==null){var p=h.next;c=p;do{if((c.tag&n)===n){var b=c.inst,C=b.destroy;if(C!==void 0){b.destroy=void 0,h=r;var k=s,$=C;try{$()}catch(W){vt(h,k,W)}}}c=c.next}while(c!==p)}}catch(W){vt(r,r.return,W)}}function Cx(n){var r=n.updateQueue;if(r!==null){var s=n.stateNode;try{mv(r,s)}catch(c){vt(n,n.return,c)}}}function Ex(n,r,s){s.props=Bi(n.type,n.memoizedProps),s.state=n.memoizedState;try{s.componentWillUnmount()}catch(c){vt(n,r,c)}}function ul(n,r){try{var s=n.ref;if(s!==null){switch(n.tag){case 26:case 27:case 5:var c=n.stateNode;break;case 30:c=n.stateNode;break;default:c=n.stateNode}typeof s=="function"?n.refCleanup=s(c):s.current=c}}catch(h){vt(n,r,h)}}function ar(n,r){var s=n.ref,c=n.refCleanup;if(s!==null)if(typeof c=="function")try{c()}catch(h){vt(n,r,h)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(h){vt(n,r,h)}else s.current=null}function Rx(n){var r=n.type,s=n.memoizedProps,c=n.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":s.autoFocus&&c.focus();break e;case"img":s.src?c.src=s.src:s.srcSet&&(c.srcset=s.srcSet)}}catch(h){vt(n,n.return,h)}}function Yh(n,r,s){try{var c=n.stateNode;GR(c,n.type,s,r),c[Ln]=r}catch(h){vt(n,n.return,h)}}function Nx(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&si(n.type)||n.tag===4}function Qh(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||Nx(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&si(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Jh(n,r,s){var c=n.tag;if(c===5||c===6)n=n.stateNode,r?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(n,r):(r=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,r.appendChild(n),s=s._reactRootContainer,s!=null||r.onclick!==null||(r.onclick=yr));else if(c!==4&&(c===27&&si(n.type)&&(s=n.stateNode,r=null),n=n.child,n!==null))for(Jh(n,r,s),n=n.sibling;n!==null;)Jh(n,r,s),n=n.sibling}function su(n,r,s){var c=n.tag;if(c===5||c===6)n=n.stateNode,r?s.insertBefore(n,r):s.appendChild(n);else if(c!==4&&(c===27&&si(n.type)&&(s=n.stateNode),n=n.child,n!==null))for(su(n,r,s),n=n.sibling;n!==null;)su(n,r,s),n=n.sibling}function Ox(n){var r=n.stateNode,s=n.memoizedProps;try{for(var c=n.type,h=r.attributes;h.length;)r.removeAttributeNode(h[0]);Sn(r,c,s),r[vn]=n,r[Ln]=s}catch(p){vt(n,n.return,p)}}var Rr=!1,en=!1,Wh=!1,Ax=typeof WeakSet=="function"?WeakSet:Set,yn=null;function CR(n,r){if(n=n.containerInfo,bp=Nu,n=Fy(n),Gf(n)){if("selectionStart"in n)var s={start:n.selectionStart,end:n.selectionEnd};else e:{s=(s=n.ownerDocument)&&s.defaultView||window;var c=s.getSelection&&s.getSelection();if(c&&c.rangeCount!==0){s=c.anchorNode;var h=c.anchorOffset,p=c.focusNode;c=c.focusOffset;try{s.nodeType,p.nodeType}catch{s=null;break e}var b=0,C=-1,k=-1,$=0,W=0,ae=n,B=null;t:for(;;){for(var X;ae!==s||h!==0&&ae.nodeType!==3||(C=b+h),ae!==p||c!==0&&ae.nodeType!==3||(k=b+c),ae.nodeType===3&&(b+=ae.nodeValue.length),(X=ae.firstChild)!==null;)B=ae,ae=X;for(;;){if(ae===n)break t;if(B===s&&++$===h&&(C=b),B===p&&++W===c&&(k=b),(X=ae.nextSibling)!==null)break;ae=B,B=ae.parentNode}ae=X}s=C===-1||k===-1?null:{start:C,end:k}}else s=null}s=s||{start:0,end:0}}else s=null;for(wp={focusedElem:n,selectionRange:s},Nu=!1,yn=r;yn!==null;)if(r=yn,n=r.child,(r.subtreeFlags&1028)!==0&&n!==null)n.return=r,yn=n;else for(;yn!==null;){switch(r=yn,p=r.alternate,n=r.flags,r.tag){case 0:if((n&4)!==0&&(n=r.updateQueue,n=n!==null?n.events:null,n!==null))for(s=0;s<n.length;s++)h=n[s],h.ref.impl=h.nextImpl;break;case 11:case 15:break;case 1:if((n&1024)!==0&&p!==null){n=void 0,s=r,h=p.memoizedProps,p=p.memoizedState,c=s.stateNode;try{var Oe=Bi(s.type,h);n=c.getSnapshotBeforeUpdate(Oe,p),c.__reactInternalSnapshotBeforeUpdate=n}catch(Ge){vt(s,s.return,Ge)}}break;case 3:if((n&1024)!==0){if(n=r.stateNode.containerInfo,s=n.nodeType,s===9)jp(n);else if(s===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":jp(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((n&1024)!==0)throw Error(i(163))}if(n=r.sibling,n!==null){n.return=r.return,yn=n;break}yn=r.return}}function Tx(n,r,s){var c=s.flags;switch(s.tag){case 0:case 11:case 15:Or(n,s),c&4&&cl(5,s);break;case 1:if(Or(n,s),c&4)if(n=s.stateNode,r===null)try{n.componentDidMount()}catch(b){vt(s,s.return,b)}else{var h=Bi(s.type,r.memoizedProps);r=r.memoizedState;try{n.componentDidUpdate(h,r,n.__reactInternalSnapshotBeforeUpdate)}catch(b){vt(s,s.return,b)}}c&64&&Cx(s),c&512&&ul(s,s.return);break;case 3:if(Or(n,s),c&64&&(n=s.updateQueue,n!==null)){if(r=null,s.child!==null)switch(s.child.tag){case 27:case 5:r=s.child.stateNode;break;case 1:r=s.child.stateNode}try{mv(n,r)}catch(b){vt(s,s.return,b)}}break;case 27:r===null&&c&4&&Ox(s);case 26:case 5:Or(n,s),r===null&&c&4&&Rx(s),c&512&&ul(s,s.return);break;case 12:Or(n,s);break;case 31:Or(n,s),c&4&&kx(n,s);break;case 13:Or(n,s),c&4&&zx(n,s),c&64&&(n=s.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(s=kR.bind(null,s),eN(n,s))));break;case 22:if(c=s.memoizedState!==null||Rr,!c){r=r!==null&&r.memoizedState!==null||en,h=Rr;var p=en;Rr=c,(en=r)&&!p?Ar(n,s,(s.subtreeFlags&8772)!==0):Or(n,s),Rr=h,en=p}break;case 30:break;default:Or(n,s)}}function Dx(n){var r=n.alternate;r!==null&&(n.alternate=null,Dx(r)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(r=n.stateNode,r!==null&&Of(r)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var It=null,qn=!1;function Nr(n,r,s){for(s=s.child;s!==null;)Mx(n,r,s),s=s.sibling}function Mx(n,r,s){if(an&&typeof an.onCommitFiberUnmount=="function")try{an.onCommitFiberUnmount(Ta,s)}catch{}switch(s.tag){case 26:en||ar(s,r),Nr(n,r,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:en||ar(s,r);var c=It,h=qn;si(s.type)&&(It=s.stateNode,qn=!1),Nr(n,r,s),xl(s.stateNode),It=c,qn=h;break;case 5:en||ar(s,r);case 6:if(c=It,h=qn,It=null,Nr(n,r,s),It=c,qn=h,It!==null)if(qn)try{(It.nodeType===9?It.body:It.nodeName==="HTML"?It.ownerDocument.body:It).removeChild(s.stateNode)}catch(p){vt(s,r,p)}else try{It.removeChild(s.stateNode)}catch(p){vt(s,r,p)}break;case 18:It!==null&&(qn?(n=It,Cb(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,s.stateNode),Wo(n)):Cb(It,s.stateNode));break;case 4:c=It,h=qn,It=s.stateNode.containerInfo,qn=!0,Nr(n,r,s),It=c,qn=h;break;case 0:case 11:case 14:case 15:ei(2,s,r),en||ei(4,s,r),Nr(n,r,s);break;case 1:en||(ar(s,r),c=s.stateNode,typeof c.componentWillUnmount=="function"&&Ex(s,r,c)),Nr(n,r,s);break;case 21:Nr(n,r,s);break;case 22:en=(c=en)||s.memoizedState!==null,Nr(n,r,s),en=c;break;default:Nr(n,r,s)}}function kx(n,r){if(r.memoizedState===null&&(n=r.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{Wo(n)}catch(s){vt(r,r.return,s)}}}function zx(n,r){if(r.memoizedState===null&&(n=r.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{Wo(n)}catch(s){vt(r,r.return,s)}}function ER(n){switch(n.tag){case 31:case 13:case 19:var r=n.stateNode;return r===null&&(r=n.stateNode=new Ax),r;case 22:return n=n.stateNode,r=n._retryCache,r===null&&(r=n._retryCache=new Ax),r;default:throw Error(i(435,n.tag))}}function lu(n,r){var s=ER(n);r.forEach(function(c){if(!s.has(c)){s.add(c);var h=zR.bind(null,n,c);c.then(h,h)}})}function Fn(n,r){var s=r.deletions;if(s!==null)for(var c=0;c<s.length;c++){var h=s[c],p=n,b=r,C=b;e:for(;C!==null;){switch(C.tag){case 27:if(si(C.type)){It=C.stateNode,qn=!1;break e}break;case 5:It=C.stateNode,qn=!1;break e;case 3:case 4:It=C.stateNode.containerInfo,qn=!0;break e}C=C.return}if(It===null)throw Error(i(160));Mx(p,b,h),It=null,qn=!1,p=h.alternate,p!==null&&(p.return=null),h.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)Px(r,n),r=r.sibling}var ka=null;function Px(n,r){var s=n.alternate,c=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:Fn(r,n),$n(n),c&4&&(ei(3,n,n.return),cl(3,n),ei(5,n,n.return));break;case 1:Fn(r,n),$n(n),c&512&&(en||s===null||ar(s,s.return)),c&64&&Rr&&(n=n.updateQueue,n!==null&&(c=n.callbacks,c!==null&&(s=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=s===null?c:s.concat(c))));break;case 26:var h=ka;if(Fn(r,n),$n(n),c&512&&(en||s===null||ar(s,s.return)),c&4){var p=s!==null?s.memoizedState:null;if(c=n.memoizedState,s===null)if(c===null)if(n.stateNode===null){e:{c=n.type,s=n.memoizedProps,h=h.ownerDocument||h;t:switch(c){case"title":p=h.getElementsByTagName("title")[0],(!p||p[Ks]||p[vn]||p.namespaceURI==="http://www.w3.org/2000/svg"||p.hasAttribute("itemprop"))&&(p=h.createElement(c),h.head.insertBefore(p,h.querySelector("head > title"))),Sn(p,c,s),p[vn]=n,gn(p),c=p;break e;case"link":var b=Pb("link","href",h).get(c+(s.href||""));if(b){for(var C=0;C<b.length;C++)if(p=b[C],p.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&p.getAttribute("rel")===(s.rel==null?null:s.rel)&&p.getAttribute("title")===(s.title==null?null:s.title)&&p.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){b.splice(C,1);break t}}p=h.createElement(c),Sn(p,c,s),h.head.appendChild(p);break;case"meta":if(b=Pb("meta","content",h).get(c+(s.content||""))){for(C=0;C<b.length;C++)if(p=b[C],p.getAttribute("content")===(s.content==null?null:""+s.content)&&p.getAttribute("name")===(s.name==null?null:s.name)&&p.getAttribute("property")===(s.property==null?null:s.property)&&p.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&p.getAttribute("charset")===(s.charSet==null?null:s.charSet)){b.splice(C,1);break t}}p=h.createElement(c),Sn(p,c,s),h.head.appendChild(p);break;default:throw Error(i(468,c))}p[vn]=n,gn(p),c=p}n.stateNode=c}else Kb(h,n.type,n.stateNode);else n.stateNode=zb(h,c,n.memoizedProps);else p!==c?(p===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):p.count--,c===null?Kb(h,n.type,n.stateNode):zb(h,c,n.memoizedProps)):c===null&&n.stateNode!==null&&Yh(n,n.memoizedProps,s.memoizedProps)}break;case 27:Fn(r,n),$n(n),c&512&&(en||s===null||ar(s,s.return)),s!==null&&c&4&&Yh(n,n.memoizedProps,s.memoizedProps);break;case 5:if(Fn(r,n),$n(n),c&512&&(en||s===null||ar(s,s.return)),n.flags&32){h=n.stateNode;try{So(h,"")}catch(Oe){vt(n,n.return,Oe)}}c&4&&n.stateNode!=null&&(h=n.memoizedProps,Yh(n,h,s!==null?s.memoizedProps:h)),c&1024&&(Wh=!0);break;case 6:if(Fn(r,n),$n(n),c&4){if(n.stateNode===null)throw Error(i(162));c=n.memoizedProps,s=n.stateNode;try{s.nodeValue=c}catch(Oe){vt(n,n.return,Oe)}}break;case 3:if(ju=null,h=ka,ka=Su(r.containerInfo),Fn(r,n),ka=h,$n(n),c&4&&s!==null&&s.memoizedState.isDehydrated)try{Wo(r.containerInfo)}catch(Oe){vt(n,n.return,Oe)}Wh&&(Wh=!1,Kx(n));break;case 4:c=ka,ka=Su(n.stateNode.containerInfo),Fn(r,n),$n(n),ka=c;break;case 12:Fn(r,n),$n(n);break;case 31:Fn(r,n),$n(n),c&4&&(c=n.updateQueue,c!==null&&(n.updateQueue=null,lu(n,c)));break;case 13:Fn(r,n),$n(n),n.child.flags&8192&&n.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(uu=ue()),c&4&&(c=n.updateQueue,c!==null&&(n.updateQueue=null,lu(n,c)));break;case 22:h=n.memoizedState!==null;var k=s!==null&&s.memoizedState!==null,$=Rr,W=en;if(Rr=$||h,en=W||k,Fn(r,n),en=W,Rr=$,$n(n),c&8192)e:for(r=n.stateNode,r._visibility=h?r._visibility&-2:r._visibility|1,h&&(s===null||k||Rr||en||Gi(n)),s=null,r=n;;){if(r.tag===5||r.tag===26){if(s===null){k=s=r;try{if(p=k.stateNode,h)b=p.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{C=k.stateNode;var ae=k.memoizedProps.style,B=ae!=null&&ae.hasOwnProperty("display")?ae.display:null;C.style.display=B==null||typeof B=="boolean"?"":(""+B).trim()}}catch(Oe){vt(k,k.return,Oe)}}}else if(r.tag===6){if(s===null){k=r;try{k.stateNode.nodeValue=h?"":k.memoizedProps}catch(Oe){vt(k,k.return,Oe)}}}else if(r.tag===18){if(s===null){k=r;try{var X=k.stateNode;h?Eb(X,!0):Eb(k.stateNode,!1)}catch(Oe){vt(k,k.return,Oe)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===n)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===n)break e;for(;r.sibling===null;){if(r.return===null||r.return===n)break e;s===r&&(s=null),r=r.return}s===r&&(s=null),r.sibling.return=r.return,r=r.sibling}c&4&&(c=n.updateQueue,c!==null&&(s=c.retryQueue,s!==null&&(c.retryQueue=null,lu(n,s))));break;case 19:Fn(r,n),$n(n),c&4&&(c=n.updateQueue,c!==null&&(n.updateQueue=null,lu(n,c)));break;case 30:break;case 21:break;default:Fn(r,n),$n(n)}}function $n(n){var r=n.flags;if(r&2){try{for(var s,c=n.return;c!==null;){if(Nx(c)){s=c;break}c=c.return}if(s==null)throw Error(i(160));switch(s.tag){case 27:var h=s.stateNode,p=Qh(n);su(n,p,h);break;case 5:var b=s.stateNode;s.flags&32&&(So(b,""),s.flags&=-33);var C=Qh(n);su(n,C,b);break;case 3:case 4:var k=s.stateNode.containerInfo,$=Qh(n);Jh(n,$,k);break;default:throw Error(i(161))}}catch(W){vt(n,n.return,W)}n.flags&=-3}r&4096&&(n.flags&=-4097)}function Kx(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var r=n;Kx(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),n=n.sibling}}function Or(n,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)Tx(n,r.alternate,r),r=r.sibling}function Gi(n){for(n=n.child;n!==null;){var r=n;switch(r.tag){case 0:case 11:case 14:case 15:ei(4,r,r.return),Gi(r);break;case 1:ar(r,r.return);var s=r.stateNode;typeof s.componentWillUnmount=="function"&&Ex(r,r.return,s),Gi(r);break;case 27:xl(r.stateNode);case 26:case 5:ar(r,r.return),Gi(r);break;case 22:r.memoizedState===null&&Gi(r);break;case 30:Gi(r);break;default:Gi(r)}n=n.sibling}}function Ar(n,r,s){for(s=s&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var c=r.alternate,h=n,p=r,b=p.flags;switch(p.tag){case 0:case 11:case 15:Ar(h,p,s),cl(4,p);break;case 1:if(Ar(h,p,s),c=p,h=c.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch($){vt(c,c.return,$)}if(c=p,h=c.updateQueue,h!==null){var C=c.stateNode;try{var k=h.shared.hiddenCallbacks;if(k!==null)for(h.shared.hiddenCallbacks=null,h=0;h<k.length;h++)pv(k[h],C)}catch($){vt(c,c.return,$)}}s&&b&64&&Cx(p),ul(p,p.return);break;case 27:Ox(p);case 26:case 5:Ar(h,p,s),s&&c===null&&b&4&&Rx(p),ul(p,p.return);break;case 12:Ar(h,p,s);break;case 31:Ar(h,p,s),s&&b&4&&kx(h,p);break;case 13:Ar(h,p,s),s&&b&4&&zx(h,p);break;case 22:p.memoizedState===null&&Ar(h,p,s),ul(p,p.return);break;case 30:break;default:Ar(h,p,s)}r=r.sibling}}function ep(n,r){var s=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),n=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(n=r.memoizedState.cachePool.pool),n!==s&&(n!=null&&n.refCount++,s!=null&&Ys(s))}function tp(n,r){n=null,r.alternate!==null&&(n=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==n&&(r.refCount++,n!=null&&Ys(n))}function za(n,r,s,c){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Ix(n,r,s,c),r=r.sibling}function Ix(n,r,s,c){var h=r.flags;switch(r.tag){case 0:case 11:case 15:za(n,r,s,c),h&2048&&cl(9,r);break;case 1:za(n,r,s,c);break;case 3:za(n,r,s,c),h&2048&&(n=null,r.alternate!==null&&(n=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==n&&(r.refCount++,n!=null&&Ys(n)));break;case 12:if(h&2048){za(n,r,s,c),n=r.stateNode;try{var p=r.memoizedProps,b=p.id,C=p.onPostCommit;typeof C=="function"&&C(b,r.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(k){vt(r,r.return,k)}}else za(n,r,s,c);break;case 31:za(n,r,s,c);break;case 13:za(n,r,s,c);break;case 23:break;case 22:p=r.stateNode,b=r.alternate,r.memoizedState!==null?p._visibility&2?za(n,r,s,c):dl(n,r):p._visibility&2?za(n,r,s,c):(p._visibility|=2,Fo(n,r,s,c,(r.subtreeFlags&10256)!==0||!1)),h&2048&&ep(b,r);break;case 24:za(n,r,s,c),h&2048&&tp(r.alternate,r);break;default:za(n,r,s,c)}}function Fo(n,r,s,c,h){for(h=h&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var p=n,b=r,C=s,k=c,$=b.flags;switch(b.tag){case 0:case 11:case 15:Fo(p,b,C,k,h),cl(8,b);break;case 23:break;case 22:var W=b.stateNode;b.memoizedState!==null?W._visibility&2?Fo(p,b,C,k,h):dl(p,b):(W._visibility|=2,Fo(p,b,C,k,h)),h&&$&2048&&ep(b.alternate,b);break;case 24:Fo(p,b,C,k,h),h&&$&2048&&tp(b.alternate,b);break;default:Fo(p,b,C,k,h)}r=r.sibling}}function dl(n,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var s=n,c=r,h=c.flags;switch(c.tag){case 22:dl(s,c),h&2048&&ep(c.alternate,c);break;case 24:dl(s,c),h&2048&&tp(c.alternate,c);break;default:dl(s,c)}r=r.sibling}}var fl=8192;function $o(n,r,s){if(n.subtreeFlags&fl)for(n=n.child;n!==null;)Lx(n,r,s),n=n.sibling}function Lx(n,r,s){switch(n.tag){case 26:$o(n,r,s),n.flags&fl&&n.memoizedState!==null&&fN(s,ka,n.memoizedState,n.memoizedProps);break;case 5:$o(n,r,s);break;case 3:case 4:var c=ka;ka=Su(n.stateNode.containerInfo),$o(n,r,s),ka=c;break;case 22:n.memoizedState===null&&(c=n.alternate,c!==null&&c.memoizedState!==null?(c=fl,fl=16777216,$o(n,r,s),fl=c):$o(n,r,s));break;default:$o(n,r,s)}}function Ux(n){var r=n.alternate;if(r!==null&&(n=r.child,n!==null)){r.child=null;do r=n.sibling,n.sibling=null,n=r;while(n!==null)}}function hl(n){var r=n.deletions;if((n.flags&16)!==0){if(r!==null)for(var s=0;s<r.length;s++){var c=r[s];yn=c,Fx(c,n)}Ux(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)qx(n),n=n.sibling}function qx(n){switch(n.tag){case 0:case 11:case 15:hl(n),n.flags&2048&&ei(9,n,n.return);break;case 3:hl(n);break;case 12:hl(n);break;case 22:var r=n.stateNode;n.memoizedState!==null&&r._visibility&2&&(n.return===null||n.return.tag!==13)?(r._visibility&=-3,cu(n)):hl(n);break;default:hl(n)}}function cu(n){var r=n.deletions;if((n.flags&16)!==0){if(r!==null)for(var s=0;s<r.length;s++){var c=r[s];yn=c,Fx(c,n)}Ux(n)}for(n=n.child;n!==null;){switch(r=n,r.tag){case 0:case 11:case 15:ei(8,r,r.return),cu(r);break;case 22:s=r.stateNode,s._visibility&2&&(s._visibility&=-3,cu(r));break;default:cu(r)}n=n.sibling}}function Fx(n,r){for(;yn!==null;){var s=yn;switch(s.tag){case 0:case 11:case 15:ei(8,s,r);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var c=s.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:Ys(s.memoizedState.cache)}if(c=s.child,c!==null)c.return=s,yn=c;else e:for(s=n;yn!==null;){c=yn;var h=c.sibling,p=c.return;if(Dx(c),c===s){yn=null;break e}if(h!==null){h.return=p,yn=h;break e}yn=p}}}var RR={getCacheForType:function(n){var r=bn(Qt),s=r.data.get(n);return s===void 0&&(s=n(),r.data.set(n,s)),s},cacheSignal:function(){return bn(Qt).controller.signal}},NR=typeof WeakMap=="function"?WeakMap:Map,gt=0,Rt=null,rt=null,ot=0,yt=0,aa=null,ti=!1,Vo=!1,np=!1,Tr=0,Vt=0,ni=0,Hi=0,ap=0,ra=0,Bo=0,pl=null,Vn=null,rp=!1,uu=0,$x=0,du=1/0,fu=null,ai=null,on=0,ri=null,Go=null,Dr=0,ip=0,op=null,Vx=null,ml=0,sp=null;function ia(){return(gt&2)!==0&&ot!==0?ot&-ot:O.T!==null?hp():Rf()}function Bx(){if(ra===0)if((ot&536870912)===0||ut){var n=po;po<<=1,(po&3932160)===0&&(po=262144),ra=n}else ra=536870912;return n=ta.current,n!==null&&(n.flags|=32),ra}function Bn(n,r,s){(n===Rt&&(yt===2||yt===9)||n.cancelPendingCommit!==null)&&(Ho(n,0),ii(n,ot,ra,!1)),Ut(n,s),((gt&2)===0||n!==Rt)&&(n===Rt&&((gt&2)===0&&(Hi|=s),Vt===4&&ii(n,ot,ra,!1)),rr(n))}function Gx(n,r,s){if((gt&6)!==0)throw Error(i(327));var c=!s&&(r&127)===0&&(r&n.expiredLanes)===0||Kt(n,r),h=c?TR(n,r):cp(n,r,!0),p=c;do{if(h===0){Vo&&!c&&ii(n,r,0,!1);break}else{if(s=n.current.alternate,p&&!OR(s)){h=cp(n,r,!1),p=!1;continue}if(h===2){if(p=r,n.errorRecoveryDisabledLanes&p)var b=0;else b=n.pendingLanes&-536870913,b=b!==0?b:b&536870912?536870912:0;if(b!==0){r=b;e:{var C=n;h=pl;var k=C.current.memoizedState.isDehydrated;if(k&&(Ho(C,b).flags|=256),b=cp(C,b,!1),b!==2){if(np&&!k){C.errorRecoveryDisabledLanes|=p,Hi|=p,h=4;break e}p=Vn,Vn=h,p!==null&&(Vn===null?Vn=p:Vn.push.apply(Vn,p))}h=b}if(p=!1,h!==2)continue}}if(h===1){Ho(n,0),ii(n,r,0,!0);break}e:{switch(c=n,p=h,p){case 0:case 1:throw Error(i(345));case 4:if((r&4194048)!==r)break;case 6:ii(c,r,ra,!ti);break e;case 2:Vn=null;break;case 3:case 5:break;default:throw Error(i(329))}if((r&62914560)===r&&(h=uu+300-ue(),10<h)){if(ii(c,r,ra,!ti),Ze(c,0,!0)!==0)break e;Dr=r,c.timeoutHandle=_b(Hx.bind(null,c,s,Vn,fu,rp,r,ra,Hi,Bo,ti,p,"Throttled",-0,0),h);break e}Hx(c,s,Vn,fu,rp,r,ra,Hi,Bo,ti,p,null,-0,0)}}break}while(!0);rr(n)}function Hx(n,r,s,c,h,p,b,C,k,$,W,ae,B,X){if(n.timeoutHandle=-1,ae=r.subtreeFlags,ae&8192||(ae&16785408)===16785408){ae={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:yr},Lx(r,p,ae);var Oe=(p&62914560)===p?uu-ue():(p&4194048)===p?$x-ue():0;if(Oe=hN(ae,Oe),Oe!==null){Dr=p,n.cancelPendingCommit=Oe(tb.bind(null,n,r,p,s,c,h,b,C,k,W,ae,null,B,X)),ii(n,p,b,!$);return}}tb(n,r,p,s,c,h,b,C,k)}function OR(n){for(var r=n;;){var s=r.tag;if((s===0||s===11||s===15)&&r.flags&16384&&(s=r.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var c=0;c<s.length;c++){var h=s[c],p=h.getSnapshot;h=h.value;try{if(!Wn(p(),h))return!1}catch{return!1}}if(s=r.child,r.subtreeFlags&16384&&s!==null)s.return=r,r=s;else{if(r===n)break;for(;r.sibling===null;){if(r.return===null||r.return===n)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function ii(n,r,s,c){r&=~ap,r&=~Hi,n.suspendedLanes|=r,n.pingedLanes&=~r,c&&(n.warmLanes|=r),c=n.expirationTimes;for(var h=r;0<h;){var p=31-rn(h),b=1<<p;c[p]=-1,h&=~b}s!==0&&Ai(n,s,r)}function hu(){return(gt&6)===0?(gl(0),!1):!0}function lp(){if(rt!==null){if(yt===0)var n=rt.return;else n=rt,wr=Ii=null,jh(n),Ko=null,Js=0,n=rt;for(;n!==null;)jx(n.alternate,n),n=n.return;rt=null}}function Ho(n,r){var s=n.timeoutHandle;s!==-1&&(n.timeoutHandle=-1,ZR(s)),s=n.cancelPendingCommit,s!==null&&(n.cancelPendingCommit=null,s()),Dr=0,lp(),Rt=n,rt=s=xr(n.current,null),ot=r,yt=0,aa=null,ti=!1,Vo=Kt(n,r),np=!1,Bo=ra=ap=Hi=ni=Vt=0,Vn=pl=null,rp=!1,(r&8)!==0&&(r|=r&32);var c=n.entangledLanes;if(c!==0)for(n=n.entanglements,c&=r;0<c;){var h=31-rn(c),p=1<<h;r|=n[h],c&=~p}return Tr=r,kc(),s}function Xx(n,r){We=null,O.H=ol,r===Po||r===Fc?(r=uv(),yt=3):r===fh?(r=uv(),yt=4):yt=r===Uh?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,aa=r,rt===null&&(Vt=1,nu(n,va(r,n.current)))}function Zx(){var n=ta.current;return n===null?!0:(ot&4194048)===ot?Sa===null:(ot&62914560)===ot||(ot&536870912)!==0?n===Sa:!1}function Yx(){var n=O.H;return O.H=ol,n===null?ol:n}function Qx(){var n=O.A;return O.A=RR,n}function pu(){Vt=4,ti||(ot&4194048)!==ot&&ta.current!==null||(Vo=!0),(ni&134217727)===0&&(Hi&134217727)===0||Rt===null||ii(Rt,ot,ra,!1)}function cp(n,r,s){var c=gt;gt|=2;var h=Yx(),p=Qx();(Rt!==n||ot!==r)&&(fu=null,Ho(n,r)),r=!1;var b=Vt;e:do try{if(yt!==0&&rt!==null){var C=rt,k=aa;switch(yt){case 8:lp(),b=6;break e;case 3:case 2:case 9:case 6:ta.current===null&&(r=!0);var $=yt;if(yt=0,aa=null,Xo(n,C,k,$),s&&Vo){b=0;break e}break;default:$=yt,yt=0,aa=null,Xo(n,C,k,$)}}AR(),b=Vt;break}catch(W){Xx(n,W)}while(!0);return r&&n.shellSuspendCounter++,wr=Ii=null,gt=c,O.H=h,O.A=p,rt===null&&(Rt=null,ot=0,kc()),b}function AR(){for(;rt!==null;)Jx(rt)}function TR(n,r){var s=gt;gt|=2;var c=Yx(),h=Qx();Rt!==n||ot!==r?(fu=null,du=ue()+500,Ho(n,r)):Vo=Kt(n,r);e:do try{if(yt!==0&&rt!==null){r=rt;var p=aa;t:switch(yt){case 1:yt=0,aa=null,Xo(n,r,p,1);break;case 2:case 9:if(lv(p)){yt=0,aa=null,Wx(r);break}r=function(){yt!==2&&yt!==9||Rt!==n||(yt=7),rr(n)},p.then(r,r);break e;case 3:yt=7;break e;case 4:yt=5;break e;case 7:lv(p)?(yt=0,aa=null,Wx(r)):(yt=0,aa=null,Xo(n,r,p,7));break;case 5:var b=null;switch(rt.tag){case 26:b=rt.memoizedState;case 5:case 27:var C=rt;if(b?Ib(b):C.stateNode.complete){yt=0,aa=null;var k=C.sibling;if(k!==null)rt=k;else{var $=C.return;$!==null?(rt=$,mu($)):rt=null}break t}}yt=0,aa=null,Xo(n,r,p,5);break;case 6:yt=0,aa=null,Xo(n,r,p,6);break;case 8:lp(),Vt=6;break e;default:throw Error(i(462))}}DR();break}catch(W){Xx(n,W)}while(!0);return wr=Ii=null,O.H=c,O.A=h,gt=s,rt!==null?0:(Rt=null,ot=0,kc(),Vt)}function DR(){for(;rt!==null&&!Z();)Jx(rt)}function Jx(n){var r=Sx(n.alternate,n,Tr);n.memoizedProps=n.pendingProps,r===null?mu(n):rt=r}function Wx(n){var r=n,s=r.alternate;switch(r.tag){case 15:case 0:r=gx(s,r,r.pendingProps,r.type,void 0,ot);break;case 11:r=gx(s,r,r.pendingProps,r.type.render,r.ref,ot);break;case 5:jh(r);default:jx(s,r),r=rt=Qy(r,Tr),r=Sx(s,r,Tr)}n.memoizedProps=n.pendingProps,r===null?mu(n):rt=r}function Xo(n,r,s,c){wr=Ii=null,jh(r),Ko=null,Js=0;var h=r.return;try{if(bR(n,h,r,s,ot)){Vt=1,nu(n,va(s,n.current)),rt=null;return}}catch(p){if(h!==null)throw rt=h,p;Vt=1,nu(n,va(s,n.current)),rt=null;return}r.flags&32768?(ut||c===1?n=!0:Vo||(ot&536870912)!==0?n=!1:(ti=n=!0,(c===2||c===9||c===3||c===6)&&(c=ta.current,c!==null&&c.tag===13&&(c.flags|=16384))),eb(r,n)):mu(r)}function mu(n){var r=n;do{if((r.flags&32768)!==0){eb(r,ti);return}n=r.return;var s=_R(r.alternate,r,Tr);if(s!==null){rt=s;return}if(r=r.sibling,r!==null){rt=r;return}rt=r=n}while(r!==null);Vt===0&&(Vt=5)}function eb(n,r){do{var s=jR(n.alternate,n);if(s!==null){s.flags&=32767,rt=s;return}if(s=n.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!r&&(n=n.sibling,n!==null)){rt=n;return}rt=n=s}while(n!==null);Vt=6,rt=null}function tb(n,r,s,c,h,p,b,C,k){n.cancelPendingCommit=null;do gu();while(on!==0);if((gt&6)!==0)throw Error(i(327));if(r!==null){if(r===n.current)throw Error(i(177));if(p=r.lanes|r.childLanes,p|=Qf,Pn(n,s,p,b,C,k),n===Rt&&(rt=Rt=null,ot=0),Go=r,ri=n,Dr=s,ip=p,op=h,Vx=c,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,PR(ht,function(){return ob(),null})):(n.callbackNode=null,n.callbackPriority=0),c=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||c){c=O.T,O.T=null,h=j.p,j.p=2,b=gt,gt|=4;try{CR(n,r,s)}finally{gt=b,j.p=h,O.T=c}}on=1,nb(),ab(),rb()}}function nb(){if(on===1){on=0;var n=ri,r=Go,s=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||s){s=O.T,O.T=null;var c=j.p;j.p=2;var h=gt;gt|=4;try{Px(r,n);var p=wp,b=Fy(n.containerInfo),C=p.focusedElem,k=p.selectionRange;if(b!==C&&C&&C.ownerDocument&&qy(C.ownerDocument.documentElement,C)){if(k!==null&&Gf(C)){var $=k.start,W=k.end;if(W===void 0&&(W=$),"selectionStart"in C)C.selectionStart=$,C.selectionEnd=Math.min(W,C.value.length);else{var ae=C.ownerDocument||document,B=ae&&ae.defaultView||window;if(B.getSelection){var X=B.getSelection(),Oe=C.textContent.length,Ge=Math.min(k.start,Oe),Et=k.end===void 0?Ge:Math.min(k.end,Oe);!X.extend&&Ge>Et&&(b=Et,Et=Ge,Ge=b);var L=Uy(C,Ge),K=Uy(C,Et);if(L&&K&&(X.rangeCount!==1||X.anchorNode!==L.node||X.anchorOffset!==L.offset||X.focusNode!==K.node||X.focusOffset!==K.offset)){var q=ae.createRange();q.setStart(L.node,L.offset),X.removeAllRanges(),Ge>Et?(X.addRange(q),X.extend(K.node,K.offset)):(q.setEnd(K.node,K.offset),X.addRange(q))}}}}for(ae=[],X=C;X=X.parentNode;)X.nodeType===1&&ae.push({element:X,left:X.scrollLeft,top:X.scrollTop});for(typeof C.focus=="function"&&C.focus(),C=0;C<ae.length;C++){var te=ae[C];te.element.scrollLeft=te.left,te.element.scrollTop=te.top}}Nu=!!bp,wp=bp=null}finally{gt=h,j.p=c,O.T=s}}n.current=r,on=2}}function ab(){if(on===2){on=0;var n=ri,r=Go,s=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||s){s=O.T,O.T=null;var c=j.p;j.p=2;var h=gt;gt|=4;try{Tx(n,r.alternate,r)}finally{gt=h,j.p=c,O.T=s}}on=3}}function rb(){if(on===4||on===3){on=0,be();var n=ri,r=Go,s=Dr,c=Vx;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?on=5:(on=0,Go=ri=null,ib(n,n.pendingLanes));var h=n.pendingLanes;if(h===0&&(ai=null),Da(s),r=r.stateNode,an&&typeof an.onCommitFiberRoot=="function")try{an.onCommitFiberRoot(Ta,r,void 0,(r.current.flags&128)===128)}catch{}if(c!==null){r=O.T,h=j.p,j.p=2,O.T=null;try{for(var p=n.onRecoverableError,b=0;b<c.length;b++){var C=c[b];p(C.value,{componentStack:C.stack})}}finally{O.T=r,j.p=h}}(Dr&3)!==0&&gu(),rr(n),h=n.pendingLanes,(s&261930)!==0&&(h&42)!==0?n===sp?ml++:(ml=0,sp=n):ml=0,gl(0)}}function ib(n,r){(n.pooledCacheLanes&=r)===0&&(r=n.pooledCache,r!=null&&(n.pooledCache=null,Ys(r)))}function gu(){return nb(),ab(),rb(),ob()}function ob(){if(on!==5)return!1;var n=ri,r=ip;ip=0;var s=Da(Dr),c=O.T,h=j.p;try{j.p=32>s?32:s,O.T=null,s=op,op=null;var p=ri,b=Dr;if(on=0,Go=ri=null,Dr=0,(gt&6)!==0)throw Error(i(331));var C=gt;if(gt|=4,qx(p.current),Ix(p,p.current,b,s),gt=C,gl(0,!1),an&&typeof an.onPostCommitFiberRoot=="function")try{an.onPostCommitFiberRoot(Ta,p)}catch{}return!0}finally{j.p=h,O.T=c,ib(n,r)}}function sb(n,r,s){r=va(s,r),r=Lh(n.stateNode,r,2),n=Qr(n,r,2),n!==null&&(Ut(n,2),rr(n))}function vt(n,r,s){if(n.tag===3)sb(n,n,s);else for(;r!==null;){if(r.tag===3){sb(r,n,s);break}else if(r.tag===1){var c=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(ai===null||!ai.has(c))){n=va(s,n),s=lx(2),c=Qr(r,s,2),c!==null&&(cx(s,c,r,n),Ut(c,2),rr(c));break}}r=r.return}}function up(n,r,s){var c=n.pingCache;if(c===null){c=n.pingCache=new NR;var h=new Set;c.set(r,h)}else h=c.get(r),h===void 0&&(h=new Set,c.set(r,h));h.has(s)||(np=!0,h.add(s),n=MR.bind(null,n,r,s),r.then(n,n))}function MR(n,r,s){var c=n.pingCache;c!==null&&c.delete(r),n.pingedLanes|=n.suspendedLanes&s,n.warmLanes&=~s,Rt===n&&(ot&s)===s&&(Vt===4||Vt===3&&(ot&62914560)===ot&&300>ue()-uu?(gt&2)===0&&Ho(n,0):ap|=s,Bo===ot&&(Bo=0)),rr(n)}function lb(n,r){r===0&&(r=Rn()),n=zi(n,r),n!==null&&(Ut(n,r),rr(n))}function kR(n){var r=n.memoizedState,s=0;r!==null&&(s=r.retryLane),lb(n,s)}function zR(n,r){var s=0;switch(n.tag){case 31:case 13:var c=n.stateNode,h=n.memoizedState;h!==null&&(s=h.retryLane);break;case 19:c=n.stateNode;break;case 22:c=n.stateNode._retryCache;break;default:throw Error(i(314))}c!==null&&c.delete(r),lb(n,s)}function PR(n,r){return P(n,r)}var yu=null,Zo=null,dp=!1,vu=!1,fp=!1,oi=0;function rr(n){n!==Zo&&n.next===null&&(Zo===null?yu=Zo=n:Zo=Zo.next=n),vu=!0,dp||(dp=!0,IR())}function gl(n,r){if(!fp&&vu){fp=!0;do for(var s=!1,c=yu;c!==null;){if(n!==0){var h=c.pendingLanes;if(h===0)var p=0;else{var b=c.suspendedLanes,C=c.pingedLanes;p=(1<<31-rn(42|n)+1)-1,p&=h&~(b&~C),p=p&201326741?p&201326741|1:p?p|2:0}p!==0&&(s=!0,fb(c,p))}else p=ot,p=Ze(c,c===Rt?p:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(p&3)===0||Kt(c,p)||(s=!0,fb(c,p));c=c.next}while(s);fp=!1}}function KR(){cb()}function cb(){vu=dp=!1;var n=0;oi!==0&&XR()&&(n=oi);for(var r=ue(),s=null,c=yu;c!==null;){var h=c.next,p=ub(c,r);p===0?(c.next=null,s===null?yu=h:s.next=h,h===null&&(Zo=s)):(s=c,(n!==0||(p&3)!==0)&&(vu=!0)),c=h}on!==0&&on!==5||gl(n),oi!==0&&(oi=0)}function ub(n,r){for(var s=n.suspendedLanes,c=n.pingedLanes,h=n.expirationTimes,p=n.pendingLanes&-62914561;0<p;){var b=31-rn(p),C=1<<b,k=h[b];k===-1?((C&s)===0||(C&c)!==0)&&(h[b]=mn(C,r)):k<=r&&(n.expiredLanes|=C),p&=~C}if(r=Rt,s=ot,s=Ze(n,n===r?s:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),c=n.callbackNode,s===0||n===r&&(yt===2||yt===9)||n.cancelPendingCommit!==null)return c!==null&&c!==null&&V(c),n.callbackNode=null,n.callbackPriority=0;if((s&3)===0||Kt(n,s)){if(r=s&-s,r===n.callbackPriority)return r;switch(c!==null&&V(c),Da(s)){case 2:case 8:s=ft;break;case 32:s=ht;break;case 268435456:s=zn;break;default:s=ht}return c=db.bind(null,n),s=P(s,c),n.callbackPriority=r,n.callbackNode=s,r}return c!==null&&c!==null&&V(c),n.callbackPriority=2,n.callbackNode=null,2}function db(n,r){if(on!==0&&on!==5)return n.callbackNode=null,n.callbackPriority=0,null;var s=n.callbackNode;if(gu()&&n.callbackNode!==s)return null;var c=ot;return c=Ze(n,n===Rt?c:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),c===0?null:(Gx(n,c,r),ub(n,ue()),n.callbackNode!=null&&n.callbackNode===s?db.bind(null,n):null)}function fb(n,r){if(gu())return null;Gx(n,r,!0)}function IR(){YR(function(){(gt&6)!==0?P(Ie,KR):cb()})}function hp(){if(oi===0){var n=ko;n===0&&(n=ho,ho<<=1,(ho&261888)===0&&(ho=256)),oi=n}return oi}function hb(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:Ec(""+n)}function pb(n,r){var s=r.ownerDocument.createElement("input");return s.name=r.name,s.value=r.value,n.id&&s.setAttribute("form",n.id),r.parentNode.insertBefore(s,r),n=new FormData(n),s.parentNode.removeChild(s),n}function LR(n,r,s,c,h){if(r==="submit"&&s&&s.stateNode===h){var p=hb((h[Ln]||null).action),b=c.submitter;b&&(r=(r=b[Ln]||null)?hb(r.formAction):b.getAttribute("formAction"),r!==null&&(p=r,b=null));var C=new Ac("action","action",null,c,h);n.push({event:C,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(oi!==0){var k=b?pb(h,b):new FormData(h);Mh(s,{pending:!0,data:k,method:h.method,action:p},null,k)}}else typeof p=="function"&&(C.preventDefault(),k=b?pb(h,b):new FormData(h),Mh(s,{pending:!0,data:k,method:h.method,action:p},p,k))},currentTarget:h}]})}}for(var pp=0;pp<Yf.length;pp++){var mp=Yf[pp],UR=mp.toLowerCase(),qR=mp[0].toUpperCase()+mp.slice(1);Ma(UR,"on"+qR)}Ma(By,"onAnimationEnd"),Ma(Gy,"onAnimationIteration"),Ma(Hy,"onAnimationStart"),Ma("dblclick","onDoubleClick"),Ma("focusin","onFocus"),Ma("focusout","onBlur"),Ma(aR,"onTransitionRun"),Ma(rR,"onTransitionStart"),Ma(iR,"onTransitionCancel"),Ma(Xy,"onTransitionEnd"),bo("onMouseEnter",["mouseout","mouseover"]),bo("onMouseLeave",["mouseout","mouseover"]),bo("onPointerEnter",["pointerout","pointerover"]),bo("onPointerLeave",["pointerout","pointerover"]),Ti("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ti("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ti("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ti("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ti("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ti("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var yl="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),FR=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(yl));function mb(n,r){r=(r&4)!==0;for(var s=0;s<n.length;s++){var c=n[s],h=c.event;c=c.listeners;e:{var p=void 0;if(r)for(var b=c.length-1;0<=b;b--){var C=c[b],k=C.instance,$=C.currentTarget;if(C=C.listener,k!==p&&h.isPropagationStopped())break e;p=C,h.currentTarget=$;try{p(h)}catch(W){Mc(W)}h.currentTarget=null,p=k}else for(b=0;b<c.length;b++){if(C=c[b],k=C.instance,$=C.currentTarget,C=C.listener,k!==p&&h.isPropagationStopped())break e;p=C,h.currentTarget=$;try{p(h)}catch(W){Mc(W)}h.currentTarget=null,p=k}}}}function it(n,r){var s=r[Nf];s===void 0&&(s=r[Nf]=new Set);var c=n+"__bubble";s.has(c)||(gb(r,n,2,!1),s.add(c))}function gp(n,r,s){var c=0;r&&(c|=4),gb(s,n,c,r)}var xu="_reactListening"+Math.random().toString(36).slice(2);function yp(n){if(!n[xu]){n[xu]=!0,cy.forEach(function(s){s!=="selectionchange"&&(FR.has(s)||gp(s,!1,n),gp(s,!0,n))});var r=n.nodeType===9?n:n.ownerDocument;r===null||r[xu]||(r[xu]=!0,gp("selectionchange",!1,r))}}function gb(n,r,s,c){switch(Bb(r)){case 2:var h=gN;break;case 8:h=yN;break;default:h=Dp}s=h.bind(null,r,s,n),h=void 0,!Kf||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(h=!0),c?h!==void 0?n.addEventListener(r,s,{capture:!0,passive:h}):n.addEventListener(r,s,!0):h!==void 0?n.addEventListener(r,s,{passive:h}):n.addEventListener(r,s,!1)}function vp(n,r,s,c,h){var p=c;if((r&1)===0&&(r&2)===0&&c!==null)e:for(;;){if(c===null)return;var b=c.tag;if(b===3||b===4){var C=c.stateNode.containerInfo;if(C===h)break;if(b===4)for(b=c.return;b!==null;){var k=b.tag;if((k===3||k===4)&&b.stateNode.containerInfo===h)return;b=b.return}for(;C!==null;){if(b=yo(C),b===null)return;if(k=b.tag,k===5||k===6||k===26||k===27){c=p=b;continue e}C=C.parentNode}}c=c.return}wy(function(){var $=p,W=zf(s),ae=[];e:{var B=Zy.get(n);if(B!==void 0){var X=Ac,Oe=n;switch(n){case"keypress":if(Nc(s)===0)break e;case"keydown":case"keyup":X=zE;break;case"focusin":Oe="focus",X=qf;break;case"focusout":Oe="blur",X=qf;break;case"beforeblur":case"afterblur":X=qf;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":X=jy;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":X=_E;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":X=IE;break;case By:case Gy:case Hy:X=EE;break;case Xy:X=UE;break;case"scroll":case"scrollend":X=wE;break;case"wheel":X=FE;break;case"copy":case"cut":case"paste":X=NE;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":X=Ey;break;case"toggle":case"beforetoggle":X=VE}var Ge=(r&4)!==0,Et=!Ge&&(n==="scroll"||n==="scrollend"),L=Ge?B!==null?B+"Capture":null:B;Ge=[];for(var K=$,q;K!==null;){var te=K;if(q=te.stateNode,te=te.tag,te!==5&&te!==26&&te!==27||q===null||L===null||(te=Ls(K,L),te!=null&&Ge.push(vl(K,te,q))),Et)break;K=K.return}0<Ge.length&&(B=new X(B,Oe,null,s,W),ae.push({event:B,listeners:Ge}))}}if((r&7)===0){e:{if(B=n==="mouseover"||n==="pointerover",X=n==="mouseout"||n==="pointerout",B&&s!==kf&&(Oe=s.relatedTarget||s.fromElement)&&(yo(Oe)||Oe[go]))break e;if((X||B)&&(B=W.window===W?W:(B=W.ownerDocument)?B.defaultView||B.parentWindow:window,X?(Oe=s.relatedTarget||s.toElement,X=$,Oe=Oe?yo(Oe):null,Oe!==null&&(Et=u(Oe),Ge=Oe.tag,Oe!==Et||Ge!==5&&Ge!==27&&Ge!==6)&&(Oe=null)):(X=null,Oe=$),X!==Oe)){if(Ge=jy,te="onMouseLeave",L="onMouseEnter",K="mouse",(n==="pointerout"||n==="pointerover")&&(Ge=Ey,te="onPointerLeave",L="onPointerEnter",K="pointer"),Et=X==null?B:Is(X),q=Oe==null?B:Is(Oe),B=new Ge(te,K+"leave",X,s,W),B.target=Et,B.relatedTarget=q,te=null,yo(W)===$&&(Ge=new Ge(L,K+"enter",Oe,s,W),Ge.target=q,Ge.relatedTarget=Et,te=Ge),Et=te,X&&Oe)t:{for(Ge=$R,L=X,K=Oe,q=0,te=L;te;te=Ge(te))q++;te=0;for(var $e=K;$e;$e=Ge($e))te++;for(;0<q-te;)L=Ge(L),q--;for(;0<te-q;)K=Ge(K),te--;for(;q--;){if(L===K||K!==null&&L===K.alternate){Ge=L;break t}L=Ge(L),K=Ge(K)}Ge=null}else Ge=null;X!==null&&yb(ae,B,X,Ge,!1),Oe!==null&&Et!==null&&yb(ae,Et,Oe,Ge,!0)}}e:{if(B=$?Is($):window,X=B.nodeName&&B.nodeName.toLowerCase(),X==="select"||X==="input"&&B.type==="file")var pt=ky;else if(Dy(B))if(zy)pt=eR;else{pt=JE;var Le=QE}else X=B.nodeName,!X||X.toLowerCase()!=="input"||B.type!=="checkbox"&&B.type!=="radio"?$&&Mf($.elementType)&&(pt=ky):pt=WE;if(pt&&(pt=pt(n,$))){My(ae,pt,s,W);break e}Le&&Le(n,B,$),n==="focusout"&&$&&B.type==="number"&&$.memoizedProps.value!=null&&Df(B,"number",B.value)}switch(Le=$?Is($):window,n){case"focusin":(Dy(Le)||Le.contentEditable==="true")&&(Eo=Le,Hf=$,Hs=null);break;case"focusout":Hs=Hf=Eo=null;break;case"mousedown":Xf=!0;break;case"contextmenu":case"mouseup":case"dragend":Xf=!1,$y(ae,s,W);break;case"selectionchange":if(nR)break;case"keydown":case"keyup":$y(ae,s,W)}var et;if($f)e:{switch(n){case"compositionstart":var st="onCompositionStart";break e;case"compositionend":st="onCompositionEnd";break e;case"compositionupdate":st="onCompositionUpdate";break e}st=void 0}else Co?Ay(n,s)&&(st="onCompositionEnd"):n==="keydown"&&s.keyCode===229&&(st="onCompositionStart");st&&(Ry&&s.locale!=="ko"&&(Co||st!=="onCompositionStart"?st==="onCompositionEnd"&&Co&&(et=Sy()):(Vr=W,If="value"in Vr?Vr.value:Vr.textContent,Co=!0)),Le=bu($,st),0<Le.length&&(st=new Cy(st,n,null,s,W),ae.push({event:st,listeners:Le}),et?st.data=et:(et=Ty(s),et!==null&&(st.data=et)))),(et=GE?HE(n,s):XE(n,s))&&(st=bu($,"onBeforeInput"),0<st.length&&(Le=new Cy("onBeforeInput","beforeinput",null,s,W),ae.push({event:Le,listeners:st}),Le.data=et)),LR(ae,n,$,s,W)}mb(ae,r)})}function vl(n,r,s){return{instance:n,listener:r,currentTarget:s}}function bu(n,r){for(var s=r+"Capture",c=[];n!==null;){var h=n,p=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||p===null||(h=Ls(n,s),h!=null&&c.unshift(vl(n,h,p)),h=Ls(n,r),h!=null&&c.push(vl(n,h,p))),n.tag===3)return c;n=n.return}return[]}function $R(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function yb(n,r,s,c,h){for(var p=r._reactName,b=[];s!==null&&s!==c;){var C=s,k=C.alternate,$=C.stateNode;if(C=C.tag,k!==null&&k===c)break;C!==5&&C!==26&&C!==27||$===null||(k=$,h?($=Ls(s,p),$!=null&&b.unshift(vl(s,$,k))):h||($=Ls(s,p),$!=null&&b.push(vl(s,$,k)))),s=s.return}b.length!==0&&n.push({event:r,listeners:b})}var VR=/\r\n?/g,BR=/\u0000|\uFFFD/g;function vb(n){return(typeof n=="string"?n:""+n).replace(VR,`
|
|
`).replace(BR,"")}function xb(n,r){return r=vb(r),vb(n)===r}function Ct(n,r,s,c,h,p){switch(s){case"children":typeof c=="string"?r==="body"||r==="textarea"&&c===""||So(n,c):(typeof c=="number"||typeof c=="bigint")&&r!=="body"&&So(n,""+c);break;case"className":jc(n,"class",c);break;case"tabIndex":jc(n,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":jc(n,s,c);break;case"style":xy(n,c,p);break;case"data":if(r!=="object"){jc(n,"data",c);break}case"src":case"href":if(c===""&&(r!=="a"||s!=="href")){n.removeAttribute(s);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){n.removeAttribute(s);break}c=Ec(""+c),n.setAttribute(s,c);break;case"action":case"formAction":if(typeof c=="function"){n.setAttribute(s,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof p=="function"&&(s==="formAction"?(r!=="input"&&Ct(n,r,"name",h.name,h,null),Ct(n,r,"formEncType",h.formEncType,h,null),Ct(n,r,"formMethod",h.formMethod,h,null),Ct(n,r,"formTarget",h.formTarget,h,null)):(Ct(n,r,"encType",h.encType,h,null),Ct(n,r,"method",h.method,h,null),Ct(n,r,"target",h.target,h,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){n.removeAttribute(s);break}c=Ec(""+c),n.setAttribute(s,c);break;case"onClick":c!=null&&(n.onclick=yr);break;case"onScroll":c!=null&&it("scroll",n);break;case"onScrollEnd":c!=null&&it("scrollend",n);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(i(61));if(s=c.__html,s!=null){if(h.children!=null)throw Error(i(60));n.innerHTML=s}}break;case"multiple":n.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":n.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){n.removeAttribute("xlink:href");break}s=Ec(""+c),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?n.setAttribute(s,""+c):n.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":c&&typeof c!="function"&&typeof c!="symbol"?n.setAttribute(s,""):n.removeAttribute(s);break;case"capture":case"download":c===!0?n.setAttribute(s,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?n.setAttribute(s,c):n.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?n.setAttribute(s,c):n.removeAttribute(s);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?n.removeAttribute(s):n.setAttribute(s,c);break;case"popover":it("beforetoggle",n),it("toggle",n),_c(n,"popover",c);break;case"xlinkActuate":gr(n,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":gr(n,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":gr(n,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":gr(n,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":gr(n,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":gr(n,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":gr(n,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":gr(n,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":gr(n,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":_c(n,"is",c);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=xE.get(s)||s,_c(n,s,c))}}function xp(n,r,s,c,h,p){switch(s){case"style":xy(n,c,p);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(i(61));if(s=c.__html,s!=null){if(h.children!=null)throw Error(i(60));n.innerHTML=s}}break;case"children":typeof c=="string"?So(n,c):(typeof c=="number"||typeof c=="bigint")&&So(n,""+c);break;case"onScroll":c!=null&&it("scroll",n);break;case"onScrollEnd":c!=null&&it("scrollend",n);break;case"onClick":c!=null&&(n.onclick=yr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!uy.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(h=s.endsWith("Capture"),r=s.slice(2,h?s.length-7:void 0),p=n[Ln]||null,p=p!=null?p[s]:null,typeof p=="function"&&n.removeEventListener(r,p,h),typeof c=="function")){typeof p!="function"&&p!==null&&(s in n?n[s]=null:n.hasAttribute(s)&&n.removeAttribute(s)),n.addEventListener(r,c,h);break e}s in n?n[s]=c:c===!0?n.setAttribute(s,""):_c(n,s,c)}}}function Sn(n,r,s){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":it("error",n),it("load",n);var c=!1,h=!1,p;for(p in s)if(s.hasOwnProperty(p)){var b=s[p];if(b!=null)switch(p){case"src":c=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,r));default:Ct(n,r,p,b,s,null)}}h&&Ct(n,r,"srcSet",s.srcSet,s,null),c&&Ct(n,r,"src",s.src,s,null);return;case"input":it("invalid",n);var C=p=b=h=null,k=null,$=null;for(c in s)if(s.hasOwnProperty(c)){var W=s[c];if(W!=null)switch(c){case"name":h=W;break;case"type":b=W;break;case"checked":k=W;break;case"defaultChecked":$=W;break;case"value":p=W;break;case"defaultValue":C=W;break;case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(i(137,r));break;default:Ct(n,r,c,W,s,null)}}my(n,p,C,k,$,b,h,!1);return;case"select":it("invalid",n),c=b=p=null;for(h in s)if(s.hasOwnProperty(h)&&(C=s[h],C!=null))switch(h){case"value":p=C;break;case"defaultValue":b=C;break;case"multiple":c=C;default:Ct(n,r,h,C,s,null)}r=p,s=b,n.multiple=!!c,r!=null?wo(n,!!c,r,!1):s!=null&&wo(n,!!c,s,!0);return;case"textarea":it("invalid",n),p=h=c=null;for(b in s)if(s.hasOwnProperty(b)&&(C=s[b],C!=null))switch(b){case"value":c=C;break;case"defaultValue":h=C;break;case"children":p=C;break;case"dangerouslySetInnerHTML":if(C!=null)throw Error(i(91));break;default:Ct(n,r,b,C,s,null)}yy(n,c,h,p);return;case"option":for(k in s)if(s.hasOwnProperty(k)&&(c=s[k],c!=null))switch(k){case"selected":n.selected=c&&typeof c!="function"&&typeof c!="symbol";break;default:Ct(n,r,k,c,s,null)}return;case"dialog":it("beforetoggle",n),it("toggle",n),it("cancel",n),it("close",n);break;case"iframe":case"object":it("load",n);break;case"video":case"audio":for(c=0;c<yl.length;c++)it(yl[c],n);break;case"image":it("error",n),it("load",n);break;case"details":it("toggle",n);break;case"embed":case"source":case"link":it("error",n),it("load",n);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for($ in s)if(s.hasOwnProperty($)&&(c=s[$],c!=null))switch($){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,r));default:Ct(n,r,$,c,s,null)}return;default:if(Mf(r)){for(W in s)s.hasOwnProperty(W)&&(c=s[W],c!==void 0&&xp(n,r,W,c,s,void 0));return}}for(C in s)s.hasOwnProperty(C)&&(c=s[C],c!=null&&Ct(n,r,C,c,s,null))}function GR(n,r,s,c){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var h=null,p=null,b=null,C=null,k=null,$=null,W=null;for(X in s){var ae=s[X];if(s.hasOwnProperty(X)&&ae!=null)switch(X){case"checked":break;case"value":break;case"defaultValue":k=ae;default:c.hasOwnProperty(X)||Ct(n,r,X,null,c,ae)}}for(var B in c){var X=c[B];if(ae=s[B],c.hasOwnProperty(B)&&(X!=null||ae!=null))switch(B){case"type":p=X;break;case"name":h=X;break;case"checked":$=X;break;case"defaultChecked":W=X;break;case"value":b=X;break;case"defaultValue":C=X;break;case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(i(137,r));break;default:X!==ae&&Ct(n,r,B,X,c,ae)}}Tf(n,b,C,k,$,W,p,h);return;case"select":X=b=C=B=null;for(p in s)if(k=s[p],s.hasOwnProperty(p)&&k!=null)switch(p){case"value":break;case"multiple":X=k;default:c.hasOwnProperty(p)||Ct(n,r,p,null,c,k)}for(h in c)if(p=c[h],k=s[h],c.hasOwnProperty(h)&&(p!=null||k!=null))switch(h){case"value":B=p;break;case"defaultValue":C=p;break;case"multiple":b=p;default:p!==k&&Ct(n,r,h,p,c,k)}r=C,s=b,c=X,B!=null?wo(n,!!s,B,!1):!!c!=!!s&&(r!=null?wo(n,!!s,r,!0):wo(n,!!s,s?[]:"",!1));return;case"textarea":X=B=null;for(C in s)if(h=s[C],s.hasOwnProperty(C)&&h!=null&&!c.hasOwnProperty(C))switch(C){case"value":break;case"children":break;default:Ct(n,r,C,null,c,h)}for(b in c)if(h=c[b],p=s[b],c.hasOwnProperty(b)&&(h!=null||p!=null))switch(b){case"value":B=h;break;case"defaultValue":X=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(i(91));break;default:h!==p&&Ct(n,r,b,h,c,p)}gy(n,B,X);return;case"option":for(var Oe in s)if(B=s[Oe],s.hasOwnProperty(Oe)&&B!=null&&!c.hasOwnProperty(Oe))switch(Oe){case"selected":n.selected=!1;break;default:Ct(n,r,Oe,null,c,B)}for(k in c)if(B=c[k],X=s[k],c.hasOwnProperty(k)&&B!==X&&(B!=null||X!=null))switch(k){case"selected":n.selected=B&&typeof B!="function"&&typeof B!="symbol";break;default:Ct(n,r,k,B,c,X)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ge in s)B=s[Ge],s.hasOwnProperty(Ge)&&B!=null&&!c.hasOwnProperty(Ge)&&Ct(n,r,Ge,null,c,B);for($ in c)if(B=c[$],X=s[$],c.hasOwnProperty($)&&B!==X&&(B!=null||X!=null))switch($){case"children":case"dangerouslySetInnerHTML":if(B!=null)throw Error(i(137,r));break;default:Ct(n,r,$,B,c,X)}return;default:if(Mf(r)){for(var Et in s)B=s[Et],s.hasOwnProperty(Et)&&B!==void 0&&!c.hasOwnProperty(Et)&&xp(n,r,Et,void 0,c,B);for(W in c)B=c[W],X=s[W],!c.hasOwnProperty(W)||B===X||B===void 0&&X===void 0||xp(n,r,W,B,c,X);return}}for(var L in s)B=s[L],s.hasOwnProperty(L)&&B!=null&&!c.hasOwnProperty(L)&&Ct(n,r,L,null,c,B);for(ae in c)B=c[ae],X=s[ae],!c.hasOwnProperty(ae)||B===X||B==null&&X==null||Ct(n,r,ae,B,c,X)}function bb(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function HR(){if(typeof performance.getEntriesByType=="function"){for(var n=0,r=0,s=performance.getEntriesByType("resource"),c=0;c<s.length;c++){var h=s[c],p=h.transferSize,b=h.initiatorType,C=h.duration;if(p&&C&&bb(b)){for(b=0,C=h.responseEnd,c+=1;c<s.length;c++){var k=s[c],$=k.startTime;if($>C)break;var W=k.transferSize,ae=k.initiatorType;W&&bb(ae)&&(k=k.responseEnd,b+=W*(k<C?1:(C-$)/(k-$)))}if(--c,r+=8*(p+b)/(h.duration/1e3),n++,10<n)break}}if(0<n)return r/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?n:5}var bp=null,wp=null;function wu(n){return n.nodeType===9?n:n.ownerDocument}function wb(n){switch(n){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Sb(n,r){if(n===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&r==="foreignObject"?0:n}function Sp(n,r){return n==="textarea"||n==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var _p=null;function XR(){var n=window.event;return n&&n.type==="popstate"?n===_p?!1:(_p=n,!0):(_p=null,!1)}var _b=typeof setTimeout=="function"?setTimeout:void 0,ZR=typeof clearTimeout=="function"?clearTimeout:void 0,jb=typeof Promise=="function"?Promise:void 0,YR=typeof queueMicrotask=="function"?queueMicrotask:typeof jb<"u"?function(n){return jb.resolve(null).then(n).catch(QR)}:_b;function QR(n){setTimeout(function(){throw n})}function si(n){return n==="head"}function Cb(n,r){var s=r,c=0;do{var h=s.nextSibling;if(n.removeChild(s),h&&h.nodeType===8)if(s=h.data,s==="/$"||s==="/&"){if(c===0){n.removeChild(h),Wo(r);return}c--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")c++;else if(s==="html")xl(n.ownerDocument.documentElement);else if(s==="head"){s=n.ownerDocument.head,xl(s);for(var p=s.firstChild;p;){var b=p.nextSibling,C=p.nodeName;p[Ks]||C==="SCRIPT"||C==="STYLE"||C==="LINK"&&p.rel.toLowerCase()==="stylesheet"||s.removeChild(p),p=b}}else s==="body"&&xl(n.ownerDocument.body);s=h}while(s);Wo(r)}function Eb(n,r){var s=n;n=0;do{var c=s.nextSibling;if(s.nodeType===1?r?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(r?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),c&&c.nodeType===8)if(s=c.data,s==="/$"){if(n===0)break;n--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||n++;s=c}while(s)}function jp(n){var r=n.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var s=r;switch(r=r.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":jp(s),Of(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}n.removeChild(s)}}function JR(n,r,s,c){for(;n.nodeType===1;){var h=s;if(n.nodeName.toLowerCase()!==r.toLowerCase()){if(!c&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(c){if(!n[Ks])switch(r){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(p=n.getAttribute("rel"),p==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(p!==h.rel||n.getAttribute("href")!==(h.href==null||h.href===""?null:h.href)||n.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin)||n.getAttribute("title")!==(h.title==null?null:h.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(p=n.getAttribute("src"),(p!==(h.src==null?null:h.src)||n.getAttribute("type")!==(h.type==null?null:h.type)||n.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin))&&p&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(r==="input"&&n.type==="hidden"){var p=h.name==null?null:""+h.name;if(h.type==="hidden"&&n.getAttribute("name")===p)return n}else return n;if(n=_a(n.nextSibling),n===null)break}return null}function WR(n,r,s){if(r==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!s||(n=_a(n.nextSibling),n===null))return null;return n}function Rb(n,r){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!r||(n=_a(n.nextSibling),n===null))return null;return n}function Cp(n){return n.data==="$?"||n.data==="$~"}function Ep(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function eN(n,r){var s=n.ownerDocument;if(n.data==="$~")n._reactRetry=r;else if(n.data!=="$?"||s.readyState!=="loading")r();else{var c=function(){r(),s.removeEventListener("DOMContentLoaded",c)};s.addEventListener("DOMContentLoaded",c),n._reactRetry=c}}function _a(n){for(;n!=null;n=n.nextSibling){var r=n.nodeType;if(r===1||r===3)break;if(r===8){if(r=n.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return n}var Rp=null;function Nb(n){n=n.nextSibling;for(var r=0;n;){if(n.nodeType===8){var s=n.data;if(s==="/$"||s==="/&"){if(r===0)return _a(n.nextSibling);r--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||r++}n=n.nextSibling}return null}function Ob(n){n=n.previousSibling;for(var r=0;n;){if(n.nodeType===8){var s=n.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(r===0)return n;r--}else s!=="/$"&&s!=="/&"||r++}n=n.previousSibling}return null}function Ab(n,r,s){switch(r=wu(s),n){case"html":if(n=r.documentElement,!n)throw Error(i(452));return n;case"head":if(n=r.head,!n)throw Error(i(453));return n;case"body":if(n=r.body,!n)throw Error(i(454));return n;default:throw Error(i(451))}}function xl(n){for(var r=n.attributes;r.length;)n.removeAttributeNode(r[0]);Of(n)}var ja=new Map,Tb=new Set;function Su(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var Mr=j.d;j.d={f:tN,r:nN,D:aN,C:rN,L:iN,m:oN,X:lN,S:sN,M:cN};function tN(){var n=Mr.f(),r=hu();return n||r}function nN(n){var r=vo(n);r!==null&&r.tag===5&&r.type==="form"?Xv(r):Mr.r(n)}var Yo=typeof document>"u"?null:document;function Db(n,r,s){var c=Yo;if(c&&typeof r=="string"&&r){var h=ga(r);h='link[rel="'+n+'"][href="'+h+'"]',typeof s=="string"&&(h+='[crossorigin="'+s+'"]'),Tb.has(h)||(Tb.add(h),n={rel:n,crossOrigin:s,href:r},c.querySelector(h)===null&&(r=c.createElement("link"),Sn(r,"link",n),gn(r),c.head.appendChild(r)))}}function aN(n){Mr.D(n),Db("dns-prefetch",n,null)}function rN(n,r){Mr.C(n,r),Db("preconnect",n,r)}function iN(n,r,s){Mr.L(n,r,s);var c=Yo;if(c&&n&&r){var h='link[rel="preload"][as="'+ga(r)+'"]';r==="image"&&s&&s.imageSrcSet?(h+='[imagesrcset="'+ga(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(h+='[imagesizes="'+ga(s.imageSizes)+'"]')):h+='[href="'+ga(n)+'"]';var p=h;switch(r){case"style":p=Qo(n);break;case"script":p=Jo(n)}ja.has(p)||(n=v({rel:"preload",href:r==="image"&&s&&s.imageSrcSet?void 0:n,as:r},s),ja.set(p,n),c.querySelector(h)!==null||r==="style"&&c.querySelector(bl(p))||r==="script"&&c.querySelector(wl(p))||(r=c.createElement("link"),Sn(r,"link",n),gn(r),c.head.appendChild(r)))}}function oN(n,r){Mr.m(n,r);var s=Yo;if(s&&n){var c=r&&typeof r.as=="string"?r.as:"script",h='link[rel="modulepreload"][as="'+ga(c)+'"][href="'+ga(n)+'"]',p=h;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":p=Jo(n)}if(!ja.has(p)&&(n=v({rel:"modulepreload",href:n},r),ja.set(p,n),s.querySelector(h)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(wl(p)))return}c=s.createElement("link"),Sn(c,"link",n),gn(c),s.head.appendChild(c)}}}function sN(n,r,s){Mr.S(n,r,s);var c=Yo;if(c&&n){var h=xo(c).hoistableStyles,p=Qo(n);r=r||"default";var b=h.get(p);if(!b){var C={loading:0,preload:null};if(b=c.querySelector(bl(p)))C.loading=5;else{n=v({rel:"stylesheet",href:n,"data-precedence":r},s),(s=ja.get(p))&&Np(n,s);var k=b=c.createElement("link");gn(k),Sn(k,"link",n),k._p=new Promise(function($,W){k.onload=$,k.onerror=W}),k.addEventListener("load",function(){C.loading|=1}),k.addEventListener("error",function(){C.loading|=2}),C.loading|=4,_u(b,r,c)}b={type:"stylesheet",instance:b,count:1,state:C},h.set(p,b)}}}function lN(n,r){Mr.X(n,r);var s=Yo;if(s&&n){var c=xo(s).hoistableScripts,h=Jo(n),p=c.get(h);p||(p=s.querySelector(wl(h)),p||(n=v({src:n,async:!0},r),(r=ja.get(h))&&Op(n,r),p=s.createElement("script"),gn(p),Sn(p,"link",n),s.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},c.set(h,p))}}function cN(n,r){Mr.M(n,r);var s=Yo;if(s&&n){var c=xo(s).hoistableScripts,h=Jo(n),p=c.get(h);p||(p=s.querySelector(wl(h)),p||(n=v({src:n,async:!0,type:"module"},r),(r=ja.get(h))&&Op(n,r),p=s.createElement("script"),gn(p),Sn(p,"link",n),s.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},c.set(h,p))}}function Mb(n,r,s,c){var h=(h=we.current)?Su(h):null;if(!h)throw Error(i(446));switch(n){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(r=Qo(s.href),s=xo(h).hoistableStyles,c=s.get(r),c||(c={type:"style",instance:null,count:0,state:null},s.set(r,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){n=Qo(s.href);var p=xo(h).hoistableStyles,b=p.get(n);if(b||(h=h.ownerDocument||h,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},p.set(n,b),(p=h.querySelector(bl(n)))&&!p._p&&(b.instance=p,b.state.loading=5),ja.has(n)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},ja.set(n,s),p||uN(h,n,s,b.state))),r&&c===null)throw Error(i(528,""));return b}if(r&&c!==null)throw Error(i(529,""));return null;case"script":return r=s.async,s=s.src,typeof s=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=Jo(s),s=xo(h).hoistableScripts,c=s.get(r),c||(c={type:"script",instance:null,count:0,state:null},s.set(r,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,n))}}function Qo(n){return'href="'+ga(n)+'"'}function bl(n){return'link[rel="stylesheet"]['+n+"]"}function kb(n){return v({},n,{"data-precedence":n.precedence,precedence:null})}function uN(n,r,s,c){n.querySelector('link[rel="preload"][as="style"]['+r+"]")?c.loading=1:(r=n.createElement("link"),c.preload=r,r.addEventListener("load",function(){return c.loading|=1}),r.addEventListener("error",function(){return c.loading|=2}),Sn(r,"link",s),gn(r),n.head.appendChild(r))}function Jo(n){return'[src="'+ga(n)+'"]'}function wl(n){return"script[async]"+n}function zb(n,r,s){if(r.count++,r.instance===null)switch(r.type){case"style":var c=n.querySelector('style[data-href~="'+ga(s.href)+'"]');if(c)return r.instance=c,gn(c),c;var h=v({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return c=(n.ownerDocument||n).createElement("style"),gn(c),Sn(c,"style",h),_u(c,s.precedence,n),r.instance=c;case"stylesheet":h=Qo(s.href);var p=n.querySelector(bl(h));if(p)return r.state.loading|=4,r.instance=p,gn(p),p;c=kb(s),(h=ja.get(h))&&Np(c,h),p=(n.ownerDocument||n).createElement("link"),gn(p);var b=p;return b._p=new Promise(function(C,k){b.onload=C,b.onerror=k}),Sn(p,"link",c),r.state.loading|=4,_u(p,s.precedence,n),r.instance=p;case"script":return p=Jo(s.src),(h=n.querySelector(wl(p)))?(r.instance=h,gn(h),h):(c=s,(h=ja.get(p))&&(c=v({},s),Op(c,h)),n=n.ownerDocument||n,h=n.createElement("script"),gn(h),Sn(h,"link",c),n.head.appendChild(h),r.instance=h);case"void":return null;default:throw Error(i(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(c=r.instance,r.state.loading|=4,_u(c,s.precedence,n));return r.instance}function _u(n,r,s){for(var c=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=c.length?c[c.length-1]:null,p=h,b=0;b<c.length;b++){var C=c[b];if(C.dataset.precedence===r)p=C;else if(p!==h)break}p?p.parentNode.insertBefore(n,p.nextSibling):(r=s.nodeType===9?s.head:s,r.insertBefore(n,r.firstChild))}function Np(n,r){n.crossOrigin==null&&(n.crossOrigin=r.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=r.referrerPolicy),n.title==null&&(n.title=r.title)}function Op(n,r){n.crossOrigin==null&&(n.crossOrigin=r.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=r.referrerPolicy),n.integrity==null&&(n.integrity=r.integrity)}var ju=null;function Pb(n,r,s){if(ju===null){var c=new Map,h=ju=new Map;h.set(s,c)}else h=ju,c=h.get(s),c||(c=new Map,h.set(s,c));if(c.has(n))return c;for(c.set(n,null),s=s.getElementsByTagName(n),h=0;h<s.length;h++){var p=s[h];if(!(p[Ks]||p[vn]||n==="link"&&p.getAttribute("rel")==="stylesheet")&&p.namespaceURI!=="http://www.w3.org/2000/svg"){var b=p.getAttribute(r)||"";b=n+b;var C=c.get(b);C?C.push(p):c.set(b,[p])}}return c}function Kb(n,r,s){n=n.ownerDocument||n,n.head.insertBefore(s,r==="title"?n.querySelector("head > title"):null)}function dN(n,r,s){if(s===1||r.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;switch(r.rel){case"stylesheet":return n=r.disabled,typeof r.precedence=="string"&&n==null;default:return!0}case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function Ib(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function fN(n,r,s,c){if(s.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var h=Qo(c.href),p=r.querySelector(bl(h));if(p){r=p._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(n.count++,n=Cu.bind(n),r.then(n,n)),s.state.loading|=4,s.instance=p,gn(p);return}p=r.ownerDocument||r,c=kb(c),(h=ja.get(h))&&Np(c,h),p=p.createElement("link"),gn(p);var b=p;b._p=new Promise(function(C,k){b.onload=C,b.onerror=k}),Sn(p,"link",c),s.instance=p}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(s,r),(r=s.state.preload)&&(s.state.loading&3)===0&&(n.count++,s=Cu.bind(n),r.addEventListener("load",s),r.addEventListener("error",s))}}var Ap=0;function hN(n,r){return n.stylesheets&&n.count===0&&Ru(n,n.stylesheets),0<n.count||0<n.imgCount?function(s){var c=setTimeout(function(){if(n.stylesheets&&Ru(n,n.stylesheets),n.unsuspend){var p=n.unsuspend;n.unsuspend=null,p()}},6e4+r);0<n.imgBytes&&Ap===0&&(Ap=62500*HR());var h=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&Ru(n,n.stylesheets),n.unsuspend)){var p=n.unsuspend;n.unsuspend=null,p()}},(n.imgBytes>Ap?50:800)+r);return n.unsuspend=s,function(){n.unsuspend=null,clearTimeout(c),clearTimeout(h)}}:null}function Cu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ru(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var Eu=null;function Ru(n,r){n.stylesheets=null,n.unsuspend!==null&&(n.count++,Eu=new Map,r.forEach(pN,n),Eu=null,Cu.call(n))}function pN(n,r){if(!(r.state.loading&4)){var s=Eu.get(n);if(s)var c=s.get(null);else{s=new Map,Eu.set(n,s);for(var h=n.querySelectorAll("link[data-precedence],style[data-precedence]"),p=0;p<h.length;p++){var b=h[p];(b.nodeName==="LINK"||b.getAttribute("media")!=="not all")&&(s.set(b.dataset.precedence,b),c=b)}c&&s.set(null,c)}h=r.instance,b=h.getAttribute("data-precedence"),p=s.get(b)||c,p===c&&s.set(null,h),s.set(b,h),this.count++,c=Cu.bind(this),h.addEventListener("load",c),h.addEventListener("error",c),p?p.parentNode.insertBefore(h,p.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(h,n.firstChild)),r.state.loading|=4}}var Sl={$$typeof:N,Provider:null,Consumer:null,_currentValue:z,_currentValue2:z,_threadCount:0};function mN(n,r,s,c,h,p,b,C,k){this.tag=1,this.containerInfo=n,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Fr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Fr(0),this.hiddenUpdates=Fr(null),this.identifierPrefix=c,this.onUncaughtError=h,this.onCaughtError=p,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=k,this.incompleteTransitions=new Map}function Lb(n,r,s,c,h,p,b,C,k,$,W,ae){return n=new mN(n,r,s,b,k,$,W,ae,C),r=1,p===!0&&(r|=24),p=ea(3,null,null,r),n.current=p,p.stateNode=n,r=ch(),r.refCount++,n.pooledCache=r,r.refCount++,p.memoizedState={element:c,isDehydrated:s,cache:r},hh(p),n}function Ub(n){return n?(n=Oo,n):Oo}function qb(n,r,s,c,h,p){h=Ub(h),c.context===null?c.context=h:c.pendingContext=h,c=Yr(r),c.payload={element:s},p=p===void 0?null:p,p!==null&&(c.callback=p),s=Qr(n,c,r),s!==null&&(Bn(s,n,r),el(s,n,r))}function Fb(n,r){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var s=n.retryLane;n.retryLane=s!==0&&s<r?s:r}}function Tp(n,r){Fb(n,r),(n=n.alternate)&&Fb(n,r)}function $b(n){if(n.tag===13||n.tag===31){var r=zi(n,67108864);r!==null&&Bn(r,n,67108864),Tp(n,67108864)}}function Vb(n){if(n.tag===13||n.tag===31){var r=ia();r=mo(r);var s=zi(n,r);s!==null&&Bn(s,n,r),Tp(n,r)}}var Nu=!0;function gN(n,r,s,c){var h=O.T;O.T=null;var p=j.p;try{j.p=2,Dp(n,r,s,c)}finally{j.p=p,O.T=h}}function yN(n,r,s,c){var h=O.T;O.T=null;var p=j.p;try{j.p=8,Dp(n,r,s,c)}finally{j.p=p,O.T=h}}function Dp(n,r,s,c){if(Nu){var h=Mp(c);if(h===null)vp(n,r,c,Ou,s),Gb(n,c);else if(xN(h,n,r,s,c))c.stopPropagation();else if(Gb(n,c),r&4&&-1<vN.indexOf(n)){for(;h!==null;){var p=vo(h);if(p!==null)switch(p.tag){case 3:if(p=p.stateNode,p.current.memoizedState.isDehydrated){var b=er(p.pendingLanes);if(b!==0){var C=p;for(C.pendingLanes|=2,C.entangledLanes|=2;b;){var k=1<<31-rn(b);C.entanglements[1]|=k,b&=~k}rr(p),(gt&6)===0&&(du=ue()+500,gl(0))}}break;case 31:case 13:C=zi(p,2),C!==null&&Bn(C,p,2),hu(),Tp(p,2)}if(p=Mp(c),p===null&&vp(n,r,c,Ou,s),p===h)break;h=p}h!==null&&c.stopPropagation()}else vp(n,r,c,null,s)}}function Mp(n){return n=zf(n),kp(n)}var Ou=null;function kp(n){if(Ou=null,n=yo(n),n!==null){var r=u(n);if(r===null)n=null;else{var s=r.tag;if(s===13){if(n=d(r),n!==null)return n;n=null}else if(s===31){if(n=f(r),n!==null)return n;n=null}else if(s===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;n=null}else r!==n&&(n=null)}}return Ou=n,null}function Bb(n){switch(n){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(pe()){case Ie:return 2;case ft:return 8;case ht:case pn:return 32;case zn:return 268435456;default:return 32}default:return 32}}var zp=!1,li=null,ci=null,ui=null,_l=new Map,jl=new Map,di=[],vN="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Gb(n,r){switch(n){case"focusin":case"focusout":li=null;break;case"dragenter":case"dragleave":ci=null;break;case"mouseover":case"mouseout":ui=null;break;case"pointerover":case"pointerout":_l.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":jl.delete(r.pointerId)}}function Cl(n,r,s,c,h,p){return n===null||n.nativeEvent!==p?(n={blockedOn:r,domEventName:s,eventSystemFlags:c,nativeEvent:p,targetContainers:[h]},r!==null&&(r=vo(r),r!==null&&$b(r)),n):(n.eventSystemFlags|=c,r=n.targetContainers,h!==null&&r.indexOf(h)===-1&&r.push(h),n)}function xN(n,r,s,c,h){switch(r){case"focusin":return li=Cl(li,n,r,s,c,h),!0;case"dragenter":return ci=Cl(ci,n,r,s,c,h),!0;case"mouseover":return ui=Cl(ui,n,r,s,c,h),!0;case"pointerover":var p=h.pointerId;return _l.set(p,Cl(_l.get(p)||null,n,r,s,c,h)),!0;case"gotpointercapture":return p=h.pointerId,jl.set(p,Cl(jl.get(p)||null,n,r,s,c,h)),!0}return!1}function Hb(n){var r=yo(n.target);if(r!==null){var s=u(r);if(s!==null){if(r=s.tag,r===13){if(r=d(s),r!==null){n.blockedOn=r,sy(n.priority,function(){Vb(s)});return}}else if(r===31){if(r=f(s),r!==null){n.blockedOn=r,sy(n.priority,function(){Vb(s)});return}}else if(r===3&&s.stateNode.current.memoizedState.isDehydrated){n.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}n.blockedOn=null}function Au(n){if(n.blockedOn!==null)return!1;for(var r=n.targetContainers;0<r.length;){var s=Mp(n.nativeEvent);if(s===null){s=n.nativeEvent;var c=new s.constructor(s.type,s);kf=c,s.target.dispatchEvent(c),kf=null}else return r=vo(s),r!==null&&$b(r),n.blockedOn=s,!1;r.shift()}return!0}function Xb(n,r,s){Au(n)&&s.delete(r)}function bN(){zp=!1,li!==null&&Au(li)&&(li=null),ci!==null&&Au(ci)&&(ci=null),ui!==null&&Au(ui)&&(ui=null),_l.forEach(Xb),jl.forEach(Xb)}function Tu(n,r){n.blockedOn===r&&(n.blockedOn=null,zp||(zp=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,bN)))}var Du=null;function Zb(n){Du!==n&&(Du=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Du===n&&(Du=null);for(var r=0;r<n.length;r+=3){var s=n[r],c=n[r+1],h=n[r+2];if(typeof c!="function"){if(kp(c||s)===null)continue;break}var p=vo(s);p!==null&&(n.splice(r,3),r-=3,Mh(p,{pending:!0,data:h,method:s.method,action:c},c,h))}}))}function Wo(n){function r(k){return Tu(k,n)}li!==null&&Tu(li,n),ci!==null&&Tu(ci,n),ui!==null&&Tu(ui,n),_l.forEach(r),jl.forEach(r);for(var s=0;s<di.length;s++){var c=di[s];c.blockedOn===n&&(c.blockedOn=null)}for(;0<di.length&&(s=di[0],s.blockedOn===null);)Hb(s),s.blockedOn===null&&di.shift();if(s=(n.ownerDocument||n).$$reactFormReplay,s!=null)for(c=0;c<s.length;c+=3){var h=s[c],p=s[c+1],b=h[Ln]||null;if(typeof p=="function")b||Zb(s);else if(b){var C=null;if(p&&p.hasAttribute("formAction")){if(h=p,b=p[Ln]||null)C=b.formAction;else if(kp(h)!==null)continue}else C=b.action;typeof C=="function"?s[c+1]=C:(s.splice(c,3),c-=3),Zb(s)}}}function Yb(){function n(p){p.canIntercept&&p.info==="react-transition"&&p.intercept({handler:function(){return new Promise(function(b){return h=b})},focusReset:"manual",scroll:"manual"})}function r(){h!==null&&(h(),h=null),c||setTimeout(s,20)}function s(){if(!c&&!navigation.transition){var p=navigation.currentEntry;p&&p.url!=null&&navigation.navigate(p.url,{state:p.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,h=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(s,100),function(){c=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),h!==null&&(h(),h=null)}}}function Pp(n){this._internalRoot=n}Mu.prototype.render=Pp.prototype.render=function(n){var r=this._internalRoot;if(r===null)throw Error(i(409));var s=r.current,c=ia();qb(s,c,n,r,null,null)},Mu.prototype.unmount=Pp.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var r=n.containerInfo;qb(n.current,2,null,n,null,null),hu(),r[go]=null}};function Mu(n){this._internalRoot=n}Mu.prototype.unstable_scheduleHydration=function(n){if(n){var r=Rf();n={blockedOn:null,target:n,priority:r};for(var s=0;s<di.length&&r!==0&&r<di[s].priority;s++);di.splice(s,0,n),s===0&&Hb(n)}};var Qb=t.version;if(Qb!=="19.2.0")throw Error(i(527,Qb,"19.2.0"));j.findDOMNode=function(n){var r=n._reactInternals;if(r===void 0)throw typeof n.render=="function"?Error(i(188)):(n=Object.keys(n).join(","),Error(i(268,n)));return n=y(r),n=n!==null?x(n):null,n=n===null?null:n.stateNode,n};var wN={bundleType:0,version:"19.2.0",rendererPackageName:"react-dom",currentDispatcherRef:O,reconcilerVersion:"19.2.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ku=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ku.isDisabled&&ku.supportsFiber)try{Ta=ku.inject(wN),an=ku}catch{}}return Rl.createRoot=function(n,r){if(!l(n))throw Error(i(299));var s=!1,c="",h=rx,p=ix,b=ox;return r!=null&&(r.unstable_strictMode===!0&&(s=!0),r.identifierPrefix!==void 0&&(c=r.identifierPrefix),r.onUncaughtError!==void 0&&(h=r.onUncaughtError),r.onCaughtError!==void 0&&(p=r.onCaughtError),r.onRecoverableError!==void 0&&(b=r.onRecoverableError)),r=Lb(n,1,!1,null,null,s,c,null,h,p,b,Yb),n[go]=r.current,yp(n),new Pp(r)},Rl.hydrateRoot=function(n,r,s){if(!l(n))throw Error(i(299));var c=!1,h="",p=rx,b=ix,C=ox,k=null;return s!=null&&(s.unstable_strictMode===!0&&(c=!0),s.identifierPrefix!==void 0&&(h=s.identifierPrefix),s.onUncaughtError!==void 0&&(p=s.onUncaughtError),s.onCaughtError!==void 0&&(b=s.onCaughtError),s.onRecoverableError!==void 0&&(C=s.onRecoverableError),s.formState!==void 0&&(k=s.formState)),r=Lb(n,1,!0,r,s??null,c,h,k,p,b,C,Yb),r.context=Ub(null),s=r.current,c=ia(),c=mo(c),h=Yr(c),h.callback=null,Qr(s,h,c),s=c,r.current.lanes=s,Ut(r,s),rr(r),n[go]=r.current,yp(n),new Mu(r)},Rl.version="19.2.0",Rl}var vw;function oA(){if(vw)return Up.exports;vw=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Up.exports=iA(),Up.exports}var sA=oA();const yd="autoglue.tokens",jm="autoglue.auth-change";let or=Cm();function Cm(){try{const e=localStorage.getItem(yd);return e?JSON.parse(e):null}catch{return null}}function lA(e){e?localStorage.setItem(yd,JSON.stringify(e)):localStorage.removeItem(yd)}function cA(e){window.dispatchEvent(new CustomEvent(jm,{detail:e}))}const jn={get(){return or},set(e){or=e,lA(e),cA(e)},reload(){return or=Cm(),or},isAuthed(){return!!or?.access_token},getAccessToken(){return or?.access_token??null},isExpired(e=Math.floor(Date.now()/1e3)){const t=xw(or?.access_token);return t!==null?e>=t:!0},willExpireSoon(e=60,t=Math.floor(Date.now()/1e3)){const a=xw(or?.access_token);return a!==null?a-t<=e:!0},logout(){jn.set(null)},subscribe(e){const t=i=>e(i.detail??null),a=i=>{i.key===yd&&(or=Cm(),e(or))};return window.addEventListener(jm,t),window.addEventListener("storage",a),()=>{window.removeEventListener(jm,t),window.removeEventListener("storage",a)}}};function xw(e){if(!e)return null;const t=e.split(".");if(t.length<2)return null;try{const a=JSON.parse(atob(uA(t[1])));return(typeof a?.exp=="number"?a.exp:null)??null}catch{return null}}function uA(e){return e.replace(/-/g,"+").replace(/_/g,"/")+"==".slice((2-e.length*3%4)%4)}const Em="autoglue.org";let Lu=localStorage.getItem(Em);const qa={get(){return Lu},set(e){Lu=e,localStorage.setItem(Em,e),window.dispatchEvent(new CustomEvent("autoglue:org-change",{detail:e}))},subscribe(e){const t=i=>e(i.detail??null),a=i=>{i.key===Em&&(Lu=i.newValue,e(Lu))};return window.addEventListener("autoglue:org-change",t),window.addEventListener("storage",a),()=>{window.removeEventListener("autoglue:org-change",t),window.removeEventListener("storage",a)}}},dA="/api/v1".replace(/\/+$/,"");class MS{constructor(t={}){this.configuration=t}set config(t){this.configuration=t}get basePath(){return this.configuration.basePath!=null?this.configuration.basePath:dA}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||kS}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){const t=this.configuration.apiKey;if(t)return typeof t=="function"?t:()=>t}get accessToken(){const t=this.configuration.accessToken;if(t)return typeof t=="function"?t:async()=>t}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}}const fA=new MS;class Zn{constructor(t=fA){this.configuration=t,this.middleware=t.middleware}static jsonRegex=new RegExp("^(:?application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(:?;.*)?$","i");middleware;withMiddleware(...t){const a=this.clone();return a.middleware=a.middleware.concat(...t),a}withPreMiddleware(...t){const a=t.map(i=>({pre:i}));return this.withMiddleware(...a)}withPostMiddleware(...t){const a=t.map(i=>({post:i}));return this.withMiddleware(...a)}isJsonMime(t){return t?Zn.jsonRegex.test(t):!1}async request(t,a){const{url:i,init:l}=await this.createFetchParams(t,a),u=await this.fetchApi(i,l);if(u&&u.status>=200&&u.status<300)return u;throw new mA(u,"Response returned an error code")}async createFetchParams(t,a){let i=this.configuration.basePath+t.path;t.query!==void 0&&Object.keys(t.query).length!==0&&(i+="?"+this.configuration.queryParamsStringify(t.query));const l=Object.assign({},this.configuration.headers,t.headers);Object.keys(l).forEach(x=>l[x]===void 0?delete l[x]:{});const u=typeof a=="function"?a:async()=>a,d={method:t.method,headers:l,body:t.body,credentials:this.configuration.credentials},f={...d,...await u({init:d,context:t})};let g;pA(f.body)||f.body instanceof URLSearchParams||hA(f.body)?g=f.body:this.isJsonMime(l["Content-Type"])?g=JSON.stringify(f.body):g=f.body;const y={...f,body:g};return{url:i,init:y}}fetchApi=async(t,a)=>{let i={url:t,init:a};for(const u of this.middleware)u.pre&&(i=await u.pre({fetch:this.fetchApi,...i})||i);let l;try{l=await(this.configuration.fetchApi||fetch)(i.url,i.init)}catch(u){for(const d of this.middleware)d.onError&&(l=await d.onError({fetch:this.fetchApi,url:i.url,init:i.init,error:u,response:l?l.clone():void 0})||l);if(l===void 0)throw u instanceof Error?new gA(u,"The request failed and the interceptors did not return an alternative response"):u}for(const u of this.middleware)u.post&&(l=await u.post({fetch:this.fetchApi,url:i.url,init:i.init,response:l.clone()})||l);return l};clone(){const t=this.constructor,a=new t(this.configuration);return a.middleware=this.middleware.slice(),a}}function hA(e){return typeof Blob<"u"&&e instanceof Blob}function pA(e){return typeof FormData<"u"&&e instanceof FormData}class mA extends Error{constructor(t,a){super(a),this.response=t}name="ResponseError"}class gA extends Error{constructor(t,a){super(a),this.cause=t}name="FetchError"}class ye extends Error{constructor(t,a){super(a),this.field=t}name="RequiredError"}function kS(e,t=""){return Object.keys(e).map(a=>zS(a,e[a],t)).filter(a=>a.length>0).join("&")}function zS(e,t,a=""){const i=a+(a.length?`[${e}]`:e);if(t instanceof Array){const l=t.map(u=>encodeURIComponent(String(u))).join(`&${encodeURIComponent(i)}=`);return`${encodeURIComponent(i)}=${l}`}if(t instanceof Set){const l=Array.from(t);return zS(e,l,a)}return t instanceof Date?`${encodeURIComponent(i)}=${encodeURIComponent(t.toISOString())}`:t instanceof Object?kS(t,i):`${encodeURIComponent(i)}=${encodeURIComponent(String(t))}`}class Ne{constructor(t,a=i=>i){this.raw=t,this.transformer=a}async value(){return this.transformer(await this.raw.json())}}class ys{constructor(t){this.raw=t}async value(){}}class Tn{constructor(t){this.raw=t}async value(){return await this.raw.text()}}function ds(e){return yA(e)}function yA(e,t){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 vA(e){return xA(e,!1)}function xA(e,t=!1){return e==null?e:{annotation_ids:e.annotation_ids}}function bA(e){return wA(e,!1)}function wA(e,t=!1){return e==null?e:{label_ids:e.label_ids}}function SA(e){return _A(e,!1)}function _A(e,t=!1){return e==null?e:{server_ids:e.server_ids}}function jA(e){return CA(e,!1)}function CA(e,t=!1){return e==null?e:{taint_ids:e.taint_ids}}function EA(e){return RA(e)}function RA(e,t){return e==null?e:{auth_url:e.auth_url==null?void 0:e.auth_url}}function fs(e){return NA(e)}function NA(e,t){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 hs(e){return OA(e)}function OA(e,t){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 ps(e){return AA(e)}function AA(e,t){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 Uu(e){return TA(e)}function TA(e,t){return e==null?e:{annotations:e.annotations==null?void 0:e.annotations.map(ds),created_at:e.created_at==null?void 0:e.created_at,id:e.id==null?void 0:e.id,labels:e.labels==null?void 0:e.labels.map(hs),name:e.name==null?void 0:e.name,organization_id:e.organization_id==null?void 0:e.organization_id,role:e.role==null?void 0:e.role,servers:e.servers==null?void 0:e.servers.map(ps),taints:e.taints==null?void 0:e.taints.map(fs),updated_at:e.updated_at==null?void 0:e.updated_at}}function DA(e){return MA(e,!1)}function MA(e,t=!1){return e==null?e:{key:e.key,value:e.value}}function kA(e){return zA(e,!1)}function zA(e,t=!1){return e==null?e:{account_id:e.account_id,kind:e.kind,name:e.name,provider:e.provider,region:e.region,schema_version:e.schema_version,scope:e.scope,scope_kind:e.scope_kind,scope_version:e.scope_version,secret:e.secret}}function PA(e){return KA(e,!1)}function KA(e,t=!1){return e==null?e:{key:e.key,value:e.value}}function IA(e){return LA(e,!1)}function LA(e,t=!1){return e==null?e:{name:e.name,role:e.role}}function UA(e){return qA(e,!1)}function qA(e,t=!1){return e==null?e:{bits:e.bits,comment:e.comment,name:e.name,type:e.type}}function FA(e){return $A(e,!1)}function $A(e,t=!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 VA(e){return BA(e,!1)}function BA(e,t=!1){return e==null?e:{effect:e.effect,key:e.key,value:e.value}}function qu(e){return GA(e)}function GA(e,t){return e==null?e:{account_id:e.account_id==null?void 0:e.account_id,created_at:e.created_at==null?void 0:e.created_at,id:e.id==null?void 0:e.id,kind:e.kind==null?void 0:e.kind,name:e.name==null?void 0:e.name,provider:e.provider==null?void 0:e.provider,region:e.region==null?void 0:e.region,schema_version:e.schema_version==null?void 0:e.schema_version,scope:e.scope==null?void 0:e.scope,scope_kind:e.scope_kind==null?void 0:e.scope_kind,scope_version:e.scope_version==null?void 0:e.scope_version,updated_at:e.updated_at==null?void 0:e.updated_at}}function HA(e){return XA(e,!1)}function XA(e,t=!1){return e==null?e:{payload:e.payload,queue:e.queue,run_at:e.run_at,type:e.type}}function ZA(e){return YA(e)}function YA(e,t){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 QA(e){return JA(e)}function JA(e,t){return e==null?e:{keys:e.keys==null?void 0:e.keys.map(ZA)}}function WA(e){return eT(e)}function eT(e,t){return e}function cd(e){return tT(e)}function tT(e,t){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:WA(e.status),type:e.type==null?void 0:e.type,updated_at:e.updated_at==null?void 0:e.updated_at}}function nT(e){return aT(e,!1)}function aT(e,t=!1){return e==null?e:{refresh_token:e.refresh_token}}function rT(e){return iT(e)}function iT(e,t){return e==null?e:{items:e.items==null?void 0:e.items.map(cd),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 oT(e){return sT(e)}function sT(e,t){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 lT(e){return cT(e,!1)}function cT(e,t=!1){return e==null?e:{refresh_token:e.refresh_token}}function bw(e){return uT(e)}function uT(e,t){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 dT(e){return fT(e)}function fT(e,t){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 ww(e){return hT(e)}function hT(e,t){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 pT(e){return mT(e,!1)}function mT(e,t=!1){return e==null?e:{key:e.key,value:e.value}}function gT(e){return yT(e,!1)}function yT(e,t=!1){return e==null?e:{account_id:e.account_id,name:e.name,region:e.region,scope:e.scope,scope_kind:e.scope_kind,scope_version:e.scope_version,secret:e.secret}}function vT(e){return xT(e,!1)}function xT(e,t=!1){return e==null?e:{key:e.key,value:e.value}}function bT(e){return wT(e,!1)}function wT(e,t=!1){return e==null?e:{name:e.name,role:e.role}}function ST(e){return _T(e,!1)}function _T(e,t=!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 jT(e){return CT(e,!1)}function CT(e,t=!1){return e==null?e:{effect:e.effect,key:e.key,value:e.value}}function ET(e){return RT(e,!1)}function RT(e,t=!1){return e==null?e:{expires_in_hours:e.expires_in_hours,name:e.name}}function PS(e){return NT(e)}function NT(e,t){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 OT(e){return AT(e)}function AT(e,t){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:PS(e.user),user_id:e.user_id==null?void 0:e.user_id}}function ql(e){return TT(e)}function TT(e,t){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 DT(e){return MT(e)}function MT(e,t){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(OT),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(ql),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 Sw(e){return kT(e)}function kT(e,t){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 zT(e){return PT(e,!1)}function PT(e,t=!1){return e==null?e:{role:e.role,user_id:e.user_id}}function KT(e){return IT(e,!1)}function IT(e,t=!1){return e==null?e:{domain:e.domain,name:e.name}}function LT(e){return UT(e,!1)}function UT(e,t=!1){return e==null?e:{expires_in_hours:e.expires_in_hours,name:e.name}}function qT(e){return FT(e)}function FT(e,t){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 $T(e){return VT(e,!1)}function VT(e,t=!1){return e==null?e:{domain:e.domain,name:e.name}}function BT(e){return GT(e,!1)}function GT(e,t=!1){return e==null?e:{display_name:e.display_name}}function _w(e){return HT(e)}function HT(e,t){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 XT(e){return ZT(e)}function ZT(e,t){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 YT extends Zn{async createAnnotationRaw(t,a){if(t.body==null)throw new ye("body",'Required parameter "body" was null or undefined when calling createAnnotation().');const i={},l={};l["Content-Type"]="application/json",t.xOrgID!=null&&(l["X-Org-ID"]=String(t.xOrgID)),this.configuration&&this.configuration.apiKey&&(l["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(l["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));const d=await this.request({path:"/annotations",method:"POST",headers:l,query:i,body:DA(t.body)},a);return new Ne(d,f=>ds(f))}async createAnnotation(t,a){return await(await this.createAnnotationRaw(t,a)).value()}async deleteAnnotationRaw(t,a){if(t.id==null)throw new ye("id",'Required parameter "id" was null or undefined when calling deleteAnnotation().');const i={},l={};t.xOrgID!=null&&(l["X-Org-ID"]=String(t.xOrgID)),this.configuration&&this.configuration.apiKey&&(l["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(l["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));let u="/annotations/{id}";u=u.replace("{id}",encodeURIComponent(String(t.id)));const d=await this.request({path:u,method:"DELETE",headers:l,query:i},a);return this.isJsonMime(d.headers.get("content-type"))?new Ne(d):new Tn(d)}async deleteAnnotation(t,a){return await(await this.deleteAnnotationRaw(t,a)).value()}async getAnnotationRaw(t,a){if(t.id==null)throw new ye("id",'Required parameter "id" was null or undefined when calling getAnnotation().');const i={},l={};t.xOrgID!=null&&(l["X-Org-ID"]=String(t.xOrgID)),this.configuration&&this.configuration.apiKey&&(l["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(l["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));let u="/annotations/{id}";u=u.replace("{id}",encodeURIComponent(String(t.id)));const d=await this.request({path:u,method:"GET",headers:l,query:i},a);return new Ne(d,f=>ds(f))}async getAnnotation(t,a){return await(await this.getAnnotationRaw(t,a)).value()}async listAnnotationsRaw(t,a){const i={};t.key!=null&&(i.key=t.key),t.value!=null&&(i.value=t.value),t.q!=null&&(i.q=t.q);const l={};t.xOrgID!=null&&(l["X-Org-ID"]=String(t.xOrgID)),this.configuration&&this.configuration.apiKey&&(l["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(l["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));const d=await this.request({path:"/annotations",method:"GET",headers:l,query:i},a);return new Ne(d,f=>f.map(ds))}async listAnnotations(t={},a){return await(await this.listAnnotationsRaw(t,a)).value()}async updateAnnotationRaw(t,a){if(t.id==null)throw new ye("id",'Required parameter "id" was null or undefined when calling updateAnnotation().');if(t.body==null)throw new ye("body",'Required parameter "body" was null or undefined when calling updateAnnotation().');const i={},l={};l["Content-Type"]="application/json",t.xOrgID!=null&&(l["X-Org-ID"]=String(t.xOrgID)),this.configuration&&this.configuration.apiKey&&(l["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(l["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));let u="/annotations/{id}";u=u.replace("{id}",encodeURIComponent(String(t.id)));const d=await this.request({path:u,method:"PATCH",headers:l,query:i,body:pT(t.body)},a);return new Ne(d,f=>ds(f))}async updateAnnotation(t,a){return await(await this.updateAnnotationRaw(t,a)).value()}}class QT extends Zn{async adminCancelArcherJobRaw(t,a){if(t.id==null)throw new ye("id",'Required parameter "id" was null or undefined when calling adminCancelArcherJob().');const i={},l={};this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));let u="/admin/archer/jobs/{id}/cancel";u=u.replace("{id}",encodeURIComponent(String(t.id)));const d=await this.request({path:u,method:"POST",headers:l,query:i},a);return new Ne(d,f=>cd(f))}async adminCancelArcherJob(t,a){return await(await this.adminCancelArcherJobRaw(t,a)).value()}async adminEnqueueArcherJobRaw(t,a){if(t.body==null)throw new ye("body",'Required parameter "body" was null or undefined when calling adminEnqueueArcherJob().');const i={},l={};l["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));const d=await this.request({path:"/admin/archer/jobs",method:"POST",headers:l,query:i,body:HA(t.body)},a);return new Ne(d,f=>cd(f))}async adminEnqueueArcherJob(t,a){return await(await this.adminEnqueueArcherJobRaw(t,a)).value()}async adminListArcherJobsRaw(t,a){const i={};t.status!=null&&(i.status=t.status),t.queue!=null&&(i.queue=t.queue),t.q!=null&&(i.q=t.q),t.page!=null&&(i.page=t.page),t.pageSize!=null&&(i.page_size=t.pageSize);const l={};this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));const d=await this.request({path:"/admin/archer/jobs",method:"GET",headers:l,query:i},a);return new Ne(d,f=>rT(f))}async adminListArcherJobs(t={},a){return await(await this.adminListArcherJobsRaw(t,a)).value()}async adminListArcherQueuesRaw(t){const a={},i={};this.configuration&&this.configuration.apiKey&&(i.Authorization=await this.configuration.apiKey("Authorization"));const u=await this.request({path:"/admin/archer/queues",method:"GET",headers:i,query:a},t);return new Ne(u,d=>d.map(oT))}async adminListArcherQueues(t){return await(await this.adminListArcherQueuesRaw(t)).value()}async adminRetryArcherJobRaw(t,a){if(t.id==null)throw new ye("id",'Required parameter "id" was null or undefined when calling adminRetryArcherJob().');const i={},l={};this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));let u="/admin/archer/jobs/{id}/retry";u=u.replace("{id}",encodeURIComponent(String(t.id)));const d=await this.request({path:u,method:"POST",headers:l,query:i},a);return new Ne(d,f=>cd(f))}async adminRetryArcherJob(t,a){return await(await this.adminRetryArcherJobRaw(t,a)).value()}}class JT extends Zn{async authCallbackRaw(t,a){if(t.provider==null)throw new ye("provider",'Required parameter "provider" was null or undefined when calling authCallback().');const i={},l={};let u="/auth/{provider}/callback";u=u.replace("{provider}",encodeURIComponent(String(t.provider)));const d=await this.request({path:u,method:"GET",headers:l,query:i},a);return new Ne(d,f=>ww(f))}async authCallback(t,a){return await(await this.authCallbackRaw(t,a)).value()}async authStartRaw(t,a){if(t.provider==null)throw new ye("provider",'Required parameter "provider" was null or undefined when calling authStart().');const i={},l={};let u="/auth/{provider}/start";u=u.replace("{provider}",encodeURIComponent(String(t.provider)));const d=await this.request({path:u,method:"POST",headers:l,query:i},a);return new Ne(d,f=>EA(f))}async authStart(t,a){return await(await this.authStartRaw(t,a)).value()}async getJWKSRaw(t){const a={},i={},u=await this.request({path:"/.well-known/jwks.json",method:"GET",headers:i,query:a},t);return new Ne(u,d=>QA(d))}async getJWKS(t){return await(await this.getJWKSRaw(t)).value()}async logoutRaw(t,a){if(t.body==null)throw new ye("body",'Required parameter "body" was null or undefined when calling logout().');const i={},l={};l["Content-Type"]="application/json";const d=await this.request({path:"/auth/logout",method:"POST",headers:l,query:i,body:nT(t.body)},a);return new ys(d)}async logout(t,a){await this.logoutRaw(t,a)}async refreshRaw(t,a){if(t.body==null)throw new ye("body",'Required parameter "body" was null or undefined when calling refresh().');const i={},l={};l["Content-Type"]="application/json";const d=await this.request({path:"/auth/refresh",method:"POST",headers:l,query:i,body:lT(t.body)},a);return new Ne(d,f=>ww(f))}async refresh(t,a){return await(await this.refreshRaw(t,a)).value()}}class WT extends Zn{async createCredentialRaw(t,a){if(t.body==null)throw new ye("body",'Required parameter "body" was null or undefined when calling createCredential().');const i={},l={};l["Content-Type"]="application/json",t.xOrgID!=null&&(l["X-Org-ID"]=String(t.xOrgID)),this.configuration&&this.configuration.apiKey&&(l["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(l["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));const d=await this.request({path:"/credentials",method:"POST",headers:l,query:i,body:kA(t.body)},a);return new Ne(d,f=>qu(f))}async createCredential(t,a){return await(await this.createCredentialRaw(t,a)).value()}async deleteCredentialRaw(t,a){if(t.id==null)throw new ye("id",'Required parameter "id" was null or undefined when calling deleteCredential().');const i={},l={};t.xOrgID!=null&&(l["X-Org-ID"]=String(t.xOrgID)),this.configuration&&this.configuration.apiKey&&(l["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(l["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));let u="/credentials/{id}";u=u.replace("{id}",encodeURIComponent(String(t.id)));const d=await this.request({path:u,method:"DELETE",headers:l,query:i},a);return new ys(d)}async deleteCredential(t,a){await this.deleteCredentialRaw(t,a)}async getCredentialRaw(t,a){if(t.id==null)throw new ye("id",'Required parameter "id" was null or undefined when calling getCredential().');const i={},l={};t.xOrgID!=null&&(l["X-Org-ID"]=String(t.xOrgID)),this.configuration&&this.configuration.apiKey&&(l["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(l["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));let u="/credentials/{id}";u=u.replace("{id}",encodeURIComponent(String(t.id)));const d=await this.request({path:u,method:"GET",headers:l,query:i},a);return new Ne(d,f=>qu(f))}async getCredential(t,a){return await(await this.getCredentialRaw(t,a)).value()}async listCredentialsRaw(t,a){const i={};t.provider!=null&&(i.provider=t.provider),t.kind!=null&&(i.kind=t.kind),t.scopeKind!=null&&(i.scope_kind=t.scopeKind);const l={};t.xOrgID!=null&&(l["X-Org-ID"]=String(t.xOrgID)),this.configuration&&this.configuration.apiKey&&(l["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(l["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));const d=await this.request({path:"/credentials",method:"GET",headers:l,query:i},a);return new Ne(d,f=>f.map(qu))}async listCredentials(t={},a){return await(await this.listCredentialsRaw(t,a)).value()}async revealCredentialRaw(t,a){if(t.id==null)throw new ye("id",'Required parameter "id" was null or undefined when calling revealCredential().');const i={},l={};t.xOrgID!=null&&(l["X-Org-ID"]=String(t.xOrgID)),this.configuration&&this.configuration.apiKey&&(l["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(l["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));let u="/credentials/{id}/reveal";u=u.replace("{id}",encodeURIComponent(String(t.id)));const d=await this.request({path:u,method:"POST",headers:l,query:i},a);return new Ne(d)}async revealCredential(t,a){return await(await this.revealCredentialRaw(t,a)).value()}async updateCredentialRaw(t,a){if(t.id==null)throw new ye("id",'Required parameter "id" was null or undefined when calling updateCredential().');if(t.body==null)throw new ye("body",'Required parameter "body" was null or undefined when calling updateCredential().');const i={},l={};l["Content-Type"]="application/json",t.xOrgID!=null&&(l["X-Org-ID"]=String(t.xOrgID)),this.configuration&&this.configuration.apiKey&&(l["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(l["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));let u="/credentials/{id}";u=u.replace("{id}",encodeURIComponent(String(t.id)));const d=await this.request({path:u,method:"PATCH",headers:l,query:i,body:gT(t.body)},a);return new Ne(d,f=>qu(f))}async updateCredential(t,a){return await(await this.updateCredentialRaw(t,a)).value()}}class eD extends Zn{async createLabelRaw(t,a){if(t.body==null)throw new ye("body",'Required parameter "body" was null or undefined when calling createLabel().');const i={},l={};l["Content-Type"]="application/json",t.xOrgID!=null&&(l["X-Org-ID"]=String(t.xOrgID)),this.configuration&&this.configuration.apiKey&&(l["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(l["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));const d=await this.request({path:"/labels",method:"POST",headers:l,query:i,body:PA(t.body)},a);return new Ne(d,f=>hs(f))}async createLabel(t,a){return await(await this.createLabelRaw(t,a)).value()}async deleteLabelRaw(t,a){if(t.id==null)throw new ye("id",'Required parameter "id" was null or undefined when calling deleteLabel().');const i={},l={};t.xOrgID!=null&&(l["X-Org-ID"]=String(t.xOrgID)),this.configuration&&this.configuration.apiKey&&(l["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(l["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));let u="/labels/{id}";u=u.replace("{id}",encodeURIComponent(String(t.id)));const d=await this.request({path:u,method:"DELETE",headers:l,query:i},a);return this.isJsonMime(d.headers.get("content-type"))?new Ne(d):new Tn(d)}async deleteLabel(t,a){return await(await this.deleteLabelRaw(t,a)).value()}async getLabelRaw(t,a){if(t.id==null)throw new ye("id",'Required parameter "id" was null or undefined when calling getLabel().');const i={},l={};t.xOrgID!=null&&(l["X-Org-ID"]=String(t.xOrgID)),this.configuration&&this.configuration.apiKey&&(l["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(l["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));let u="/labels/{id}";u=u.replace("{id}",encodeURIComponent(String(t.id)));const d=await this.request({path:u,method:"GET",headers:l,query:i},a);return new Ne(d,f=>hs(f))}async getLabel(t,a){return await(await this.getLabelRaw(t,a)).value()}async listLabelsRaw(t,a){const i={};t.key!=null&&(i.key=t.key),t.value!=null&&(i.value=t.value),t.q!=null&&(i.q=t.q);const l={};t.xOrgID!=null&&(l["X-Org-ID"]=String(t.xOrgID)),this.configuration&&this.configuration.apiKey&&(l["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(l["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));const d=await this.request({path:"/labels",method:"GET",headers:l,query:i},a);return new Ne(d,f=>f.map(hs))}async listLabels(t={},a){return await(await this.listLabelsRaw(t,a)).value()}async updateLabelRaw(t,a){if(t.id==null)throw new ye("id",'Required parameter "id" was null or undefined when calling updateLabel().');if(t.body==null)throw new ye("body",'Required parameter "body" was null or undefined when calling updateLabel().');const i={},l={};l["Content-Type"]="application/json",t.xOrgID!=null&&(l["X-Org-ID"]=String(t.xOrgID)),this.configuration&&this.configuration.apiKey&&(l["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(l["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));let u="/labels/{id}";u=u.replace("{id}",encodeURIComponent(String(t.id)));const d=await this.request({path:u,method:"PATCH",headers:l,query:i,body:vT(t.body)},a);return new Ne(d,f=>hs(f))}async updateLabel(t,a){return await(await this.updateLabelRaw(t,a)).value()}}class tD extends Zn{async getMeRaw(t){const a={},i={};this.configuration&&this.configuration.apiKey&&(i["X-API-KEY"]=await this.configuration.apiKey("X-API-KEY")),this.configuration&&this.configuration.apiKey&&(i.Authorization=await this.configuration.apiKey("Authorization"));const u=await this.request({path:"/me",method:"GET",headers:i,query:a},t);return new Ne(u,d=>DT(d))}async getMe(t){return await(await this.getMeRaw(t)).value()}async updateMeRaw(t,a){if(t.body==null)throw new ye("body",'Required parameter "body" was null or undefined when calling updateMe().');const i={},l={};l["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(l["X-API-KEY"]=await this.configuration.apiKey("X-API-KEY")),this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));const d=await this.request({path:"/me",method:"PATCH",headers:l,query:i,body:BT(t.body)},a);return new Ne(d,f=>PS(f))}async updateMe(t,a){return await(await this.updateMeRaw(t,a)).value()}}class nD extends Zn{async createUserAPIKeyRaw(t,a){if(t.body==null)throw new ye("body",'Required parameter "body" was null or undefined when calling createUserAPIKey().');const i={},l={};l["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(l["X-API-KEY"]=await this.configuration.apiKey("X-API-KEY")),this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));const d=await this.request({path:"/me/api-keys",method:"POST",headers:l,query:i,body:ET(t.body)},a);return new Ne(d,f=>_w(f))}async createUserAPIKey(t,a){return await(await this.createUserAPIKeyRaw(t,a)).value()}async deleteUserAPIKeyRaw(t,a){if(t.id==null)throw new ye("id",'Required parameter "id" was null or undefined when calling deleteUserAPIKey().');const i={},l={};this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));let u="/me/api-keys/{id}";u=u.replace("{id}",encodeURIComponent(String(t.id)));const d=await this.request({path:u,method:"DELETE",headers:l,query:i},a);return new ys(d)}async deleteUserAPIKey(t,a){await this.deleteUserAPIKeyRaw(t,a)}async listUserAPIKeysRaw(t){const a={},i={};this.configuration&&this.configuration.apiKey&&(i["X-API-KEY"]=await this.configuration.apiKey("X-API-KEY")),this.configuration&&this.configuration.apiKey&&(i.Authorization=await this.configuration.apiKey("Authorization"));const u=await this.request({path:"/me/api-keys",method:"GET",headers:i,query:a},t);return new Ne(u,d=>d.map(_w))}async listUserAPIKeys(t){return await(await this.listUserAPIKeysRaw(t)).value()}}class aD extends Zn{async attachNodePoolAnnotationsRaw(t,a){if(t.id==null)throw new ye("id",'Required parameter "id" was null or undefined when calling attachNodePoolAnnotations().');if(t.body==null)throw new ye("body",'Required parameter "body" was null or undefined when calling attachNodePoolAnnotations().');const i={},l={};l["Content-Type"]="application/json",t.xOrgID!=null&&(l["X-Org-ID"]=String(t.xOrgID)),this.configuration&&this.configuration.apiKey&&(l["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(l["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));let u="/node-pools/{id}/annotations";u=u.replace("{id}",encodeURIComponent(String(t.id)));const d=await this.request({path:u,method:"POST",headers:l,query:i,body:vA(t.body)},a);return this.isJsonMime(d.headers.get("content-type"))?new Ne(d):new Tn(d)}async attachNodePoolAnnotations(t,a){return await(await this.attachNodePoolAnnotationsRaw(t,a)).value()}async attachNodePoolLabelsRaw(t,a){if(t.id==null)throw new ye("id",'Required parameter "id" was null or undefined when calling attachNodePoolLabels().');if(t.body==null)throw new ye("body",'Required parameter "body" was null or undefined when calling attachNodePoolLabels().');const i={},l={};l["Content-Type"]="application/json",t.xOrgID!=null&&(l["X-Org-ID"]=String(t.xOrgID)),this.configuration&&this.configuration.apiKey&&(l["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(l["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));let u="/node-pools/{id}/labels";u=u.replace("{id}",encodeURIComponent(String(t.id)));const d=await this.request({path:u,method:"POST",headers:l,query:i,body:bA(t.body)},a);return this.isJsonMime(d.headers.get("content-type"))?new Ne(d):new Tn(d)}async attachNodePoolLabels(t,a){return await(await this.attachNodePoolLabelsRaw(t,a)).value()}async attachNodePoolServersRaw(t,a){if(t.id==null)throw new ye("id",'Required parameter "id" was null or undefined when calling attachNodePoolServers().');if(t.body==null)throw new ye("body",'Required parameter "body" was null or undefined when calling attachNodePoolServers().');const i={},l={};l["Content-Type"]="application/json",t.xOrgID!=null&&(l["X-Org-ID"]=String(t.xOrgID)),this.configuration&&this.configuration.apiKey&&(l["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(l["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));let u="/node-pools/{id}/servers";u=u.replace("{id}",encodeURIComponent(String(t.id)));const d=await this.request({path:u,method:"POST",headers:l,query:i,body:SA(t.body)},a);return this.isJsonMime(d.headers.get("content-type"))?new Ne(d):new Tn(d)}async attachNodePoolServers(t,a){return await(await this.attachNodePoolServersRaw(t,a)).value()}async attachNodePoolTaintsRaw(t,a){if(t.id==null)throw new ye("id",'Required parameter "id" was null or undefined when calling attachNodePoolTaints().');if(t.body==null)throw new ye("body",'Required parameter "body" was null or undefined when calling attachNodePoolTaints().');const i={},l={};l["Content-Type"]="application/json",t.xOrgID!=null&&(l["X-Org-ID"]=String(t.xOrgID)),this.configuration&&this.configuration.apiKey&&(l["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(l["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));let u="/node-pools/{id}/taints";u=u.replace("{id}",encodeURIComponent(String(t.id)));const d=await this.request({path:u,method:"POST",headers:l,query:i,body:jA(t.body)},a);return this.isJsonMime(d.headers.get("content-type"))?new Ne(d):new Tn(d)}async attachNodePoolTaints(t,a){return await(await this.attachNodePoolTaintsRaw(t,a)).value()}async createNodePoolRaw(t,a){if(t.body==null)throw new ye("body",'Required parameter "body" was null or undefined when calling createNodePool().');const i={},l={};l["Content-Type"]="application/json",t.xOrgID!=null&&(l["X-Org-ID"]=String(t.xOrgID)),this.configuration&&this.configuration.apiKey&&(l["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(l["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));const d=await this.request({path:"/node-pools",method:"POST",headers:l,query:i,body:IA(t.body)},a);return new Ne(d,f=>Uu(f))}async createNodePool(t,a){return await(await this.createNodePoolRaw(t,a)).value()}async deleteNodePoolRaw(t,a){if(t.id==null)throw new ye("id",'Required parameter "id" was null or undefined when calling deleteNodePool().');const i={},l={};t.xOrgID!=null&&(l["X-Org-ID"]=String(t.xOrgID)),this.configuration&&this.configuration.apiKey&&(l["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(l["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));let u="/node-pools/{id}";u=u.replace("{id}",encodeURIComponent(String(t.id)));const d=await this.request({path:u,method:"DELETE",headers:l,query:i},a);return this.isJsonMime(d.headers.get("content-type"))?new Ne(d):new Tn(d)}async deleteNodePool(t,a){return await(await this.deleteNodePoolRaw(t,a)).value()}async detachNodePoolAnnotationRaw(t,a){if(t.id==null)throw new ye("id",'Required parameter "id" was null or undefined when calling detachNodePoolAnnotation().');if(t.annotationId==null)throw new ye("annotationId",'Required parameter "annotationId" was null or undefined when calling detachNodePoolAnnotation().');const i={},l={};t.xOrgID!=null&&(l["X-Org-ID"]=String(t.xOrgID)),this.configuration&&this.configuration.apiKey&&(l["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(l["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));let u="/node-pools/{id}/annotations/{annotationId}";u=u.replace("{id}",encodeURIComponent(String(t.id))),u=u.replace("{annotationId}",encodeURIComponent(String(t.annotationId)));const d=await this.request({path:u,method:"DELETE",headers:l,query:i},a);return this.isJsonMime(d.headers.get("content-type"))?new Ne(d):new Tn(d)}async detachNodePoolAnnotation(t,a){return await(await this.detachNodePoolAnnotationRaw(t,a)).value()}async detachNodePoolLabelRaw(t,a){if(t.id==null)throw new ye("id",'Required parameter "id" was null or undefined when calling detachNodePoolLabel().');if(t.labelId==null)throw new ye("labelId",'Required parameter "labelId" was null or undefined when calling detachNodePoolLabel().');const i={},l={};t.xOrgID!=null&&(l["X-Org-ID"]=String(t.xOrgID)),this.configuration&&this.configuration.apiKey&&(l["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(l["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));let u="/node-pools/{id}/labels/{labelId}";u=u.replace("{id}",encodeURIComponent(String(t.id))),u=u.replace("{labelId}",encodeURIComponent(String(t.labelId)));const d=await this.request({path:u,method:"DELETE",headers:l,query:i},a);return this.isJsonMime(d.headers.get("content-type"))?new Ne(d):new Tn(d)}async detachNodePoolLabel(t,a){return await(await this.detachNodePoolLabelRaw(t,a)).value()}async detachNodePoolServerRaw(t,a){if(t.id==null)throw new ye("id",'Required parameter "id" was null or undefined when calling detachNodePoolServer().');if(t.serverId==null)throw new ye("serverId",'Required parameter "serverId" was null or undefined when calling detachNodePoolServer().');const i={},l={};t.xOrgID!=null&&(l["X-Org-ID"]=String(t.xOrgID)),this.configuration&&this.configuration.apiKey&&(l["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(l["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));let u="/node-pools/{id}/servers/{serverId}";u=u.replace("{id}",encodeURIComponent(String(t.id))),u=u.replace("{serverId}",encodeURIComponent(String(t.serverId)));const d=await this.request({path:u,method:"DELETE",headers:l,query:i},a);return this.isJsonMime(d.headers.get("content-type"))?new Ne(d):new Tn(d)}async detachNodePoolServer(t,a){return await(await this.detachNodePoolServerRaw(t,a)).value()}async detachNodePoolTaintRaw(t,a){if(t.id==null)throw new ye("id",'Required parameter "id" was null or undefined when calling detachNodePoolTaint().');if(t.taintId==null)throw new ye("taintId",'Required parameter "taintId" was null or undefined when calling detachNodePoolTaint().');const i={},l={};t.xOrgID!=null&&(l["X-Org-ID"]=String(t.xOrgID)),this.configuration&&this.configuration.apiKey&&(l["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(l["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));let u="/node-pools/{id}/taints/{taintId}";u=u.replace("{id}",encodeURIComponent(String(t.id))),u=u.replace("{taintId}",encodeURIComponent(String(t.taintId)));const d=await this.request({path:u,method:"DELETE",headers:l,query:i},a);return this.isJsonMime(d.headers.get("content-type"))?new Ne(d):new Tn(d)}async detachNodePoolTaint(t,a){return await(await this.detachNodePoolTaintRaw(t,a)).value()}async getNodePoolRaw(t,a){if(t.id==null)throw new ye("id",'Required parameter "id" was null or undefined when calling getNodePool().');const i={},l={};t.xOrgID!=null&&(l["X-Org-ID"]=String(t.xOrgID)),this.configuration&&this.configuration.apiKey&&(l["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(l["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));let u="/node-pools/{id}";u=u.replace("{id}",encodeURIComponent(String(t.id)));const d=await this.request({path:u,method:"GET",headers:l,query:i},a);return new Ne(d,f=>Uu(f))}async getNodePool(t,a){return await(await this.getNodePoolRaw(t,a)).value()}async listNodePoolAnnotationsRaw(t,a){if(t.id==null)throw new ye("id",'Required parameter "id" was null or undefined when calling listNodePoolAnnotations().');const i={},l={};t.xOrgID!=null&&(l["X-Org-ID"]=String(t.xOrgID)),this.configuration&&this.configuration.apiKey&&(l["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(l["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));let u="/node-pools/{id}/annotations";u=u.replace("{id}",encodeURIComponent(String(t.id)));const d=await this.request({path:u,method:"GET",headers:l,query:i},a);return new Ne(d,f=>f.map(ds))}async listNodePoolAnnotations(t,a){return await(await this.listNodePoolAnnotationsRaw(t,a)).value()}async listNodePoolLabelsRaw(t,a){if(t.id==null)throw new ye("id",'Required parameter "id" was null or undefined when calling listNodePoolLabels().');const i={},l={};t.xOrgID!=null&&(l["X-Org-ID"]=String(t.xOrgID)),this.configuration&&this.configuration.apiKey&&(l["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(l["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));let u="/node-pools/{id}/labels";u=u.replace("{id}",encodeURIComponent(String(t.id)));const d=await this.request({path:u,method:"GET",headers:l,query:i},a);return new Ne(d,f=>f.map(hs))}async listNodePoolLabels(t,a){return await(await this.listNodePoolLabelsRaw(t,a)).value()}async listNodePoolServersRaw(t,a){if(t.id==null)throw new ye("id",'Required parameter "id" was null or undefined when calling listNodePoolServers().');const i={},l={};t.xOrgID!=null&&(l["X-Org-ID"]=String(t.xOrgID)),this.configuration&&this.configuration.apiKey&&(l["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(l["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));let u="/node-pools/{id}/servers";u=u.replace("{id}",encodeURIComponent(String(t.id)));const d=await this.request({path:u,method:"GET",headers:l,query:i},a);return new Ne(d,f=>f.map(ps))}async listNodePoolServers(t,a){return await(await this.listNodePoolServersRaw(t,a)).value()}async listNodePoolTaintsRaw(t,a){if(t.id==null)throw new ye("id",'Required parameter "id" was null or undefined when calling listNodePoolTaints().');const i={},l={};t.xOrgID!=null&&(l["X-Org-ID"]=String(t.xOrgID)),this.configuration&&this.configuration.apiKey&&(l["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(l["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));let u="/node-pools/{id}/taints";u=u.replace("{id}",encodeURIComponent(String(t.id)));const d=await this.request({path:u,method:"GET",headers:l,query:i},a);return new Ne(d,f=>f.map(fs))}async listNodePoolTaints(t,a){return await(await this.listNodePoolTaintsRaw(t,a)).value()}async listNodePoolsRaw(t,a){const i={};t.q!=null&&(i.q=t.q);const l={};t.xOrgID!=null&&(l["X-Org-ID"]=String(t.xOrgID)),this.configuration&&this.configuration.apiKey&&(l["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(l["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));const d=await this.request({path:"/node-pools",method:"GET",headers:l,query:i},a);return new Ne(d,f=>f.map(Uu))}async listNodePools(t={},a){return await(await this.listNodePoolsRaw(t,a)).value()}async updateNodePoolRaw(t,a){if(t.id==null)throw new ye("id",'Required parameter "id" was null or undefined when calling updateNodePool().');if(t.body==null)throw new ye("body",'Required parameter "body" was null or undefined when calling updateNodePool().');const i={},l={};l["Content-Type"]="application/json",t.xOrgID!=null&&(l["X-Org-ID"]=String(t.xOrgID)),this.configuration&&this.configuration.apiKey&&(l["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(l["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));let u="/node-pools/{id}";u=u.replace("{id}",encodeURIComponent(String(t.id)));const d=await this.request({path:u,method:"PATCH",headers:l,query:i,body:bT(t.body)},a);return new Ne(d,f=>Uu(f))}async updateNodePool(t,a){return await(await this.updateNodePoolRaw(t,a)).value()}}class rD extends Zn{async addOrUpdateMemberRaw(t,a){if(t.id==null)throw new ye("id",'Required parameter "id" was null or undefined when calling addOrUpdateMember().');if(t.body==null)throw new ye("body",'Required parameter "body" was null or undefined when calling addOrUpdateMember().');const i={},l={};l["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));let u="/orgs/{id}/members";u=u.replace("{id}",encodeURIComponent(String(t.id)));const d=await this.request({path:u,method:"POST",headers:l,query:i,body:zT(t.body)},a);return new Ne(d,f=>Sw(f))}async addOrUpdateMember(t,a){return await(await this.addOrUpdateMemberRaw(t,a)).value()}async createOrgRaw(t,a){if(t.body==null)throw new ye("body",'Required parameter "body" was null or undefined when calling createOrg().');const i={},l={};l["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));const d=await this.request({path:"/orgs",method:"POST",headers:l,query:i,body:KT(t.body)},a);return new Ne(d,f=>ql(f))}async createOrg(t,a){return await(await this.createOrgRaw(t,a)).value()}async createOrgKeyRaw(t,a){if(t.id==null)throw new ye("id",'Required parameter "id" was null or undefined when calling createOrgKey().');if(t.body==null)throw new ye("body",'Required parameter "body" was null or undefined when calling createOrgKey().');const i={},l={};l["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));let u="/orgs/{id}/api-keys";u=u.replace("{id}",encodeURIComponent(String(t.id)));const d=await this.request({path:u,method:"POST",headers:l,query:i,body:LT(t.body)},a);return new Ne(d,f=>qT(f))}async createOrgKey(t,a){return await(await this.createOrgKeyRaw(t,a)).value()}async deleteOrgRaw(t,a){if(t.id==null)throw new ye("id",'Required parameter "id" was null or undefined when calling deleteOrg().');const i={},l={};this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));let u="/orgs/{id}";u=u.replace("{id}",encodeURIComponent(String(t.id)));const d=await this.request({path:u,method:"DELETE",headers:l,query:i},a);return new ys(d)}async deleteOrg(t,a){await this.deleteOrgRaw(t,a)}async deleteOrgKeyRaw(t,a){if(t.id==null)throw new ye("id",'Required parameter "id" was null or undefined when calling deleteOrgKey().');if(t.keyId==null)throw new ye("keyId",'Required parameter "keyId" was null or undefined when calling deleteOrgKey().');const i={},l={};this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));let u="/orgs/{id}/api-keys/{key_id}";u=u.replace("{id}",encodeURIComponent(String(t.id))),u=u.replace("{key_id}",encodeURIComponent(String(t.keyId)));const d=await this.request({path:u,method:"DELETE",headers:l,query:i},a);return new ys(d)}async deleteOrgKey(t,a){await this.deleteOrgKeyRaw(t,a)}async getOrgRaw(t,a){if(t.id==null)throw new ye("id",'Required parameter "id" was null or undefined when calling getOrg().');const i={},l={};this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));let u="/orgs/{id}";u=u.replace("{id}",encodeURIComponent(String(t.id)));const d=await this.request({path:u,method:"GET",headers:l,query:i},a);return new Ne(d,f=>ql(f))}async getOrg(t,a){return await(await this.getOrgRaw(t,a)).value()}async listMembersRaw(t,a){if(t.id==null)throw new ye("id",'Required parameter "id" was null or undefined when calling listMembers().');const i={},l={};this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));let u="/orgs/{id}/members";u=u.replace("{id}",encodeURIComponent(String(t.id)));const d=await this.request({path:u,method:"GET",headers:l,query:i},a);return new Ne(d,f=>f.map(Sw))}async listMembers(t,a){return await(await this.listMembersRaw(t,a)).value()}async listMyOrgsRaw(t){const a={},i={};this.configuration&&this.configuration.apiKey&&(i.Authorization=await this.configuration.apiKey("Authorization"));const u=await this.request({path:"/orgs",method:"GET",headers:i,query:a},t);return new Ne(u,d=>d.map(ql))}async listMyOrgs(t){return await(await this.listMyOrgsRaw(t)).value()}async listOrgKeysRaw(t,a){if(t.id==null)throw new ye("id",'Required parameter "id" was null or undefined when calling listOrgKeys().');const i={},l={};this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));let u="/orgs/{id}/api-keys";u=u.replace("{id}",encodeURIComponent(String(t.id)));const d=await this.request({path:u,method:"GET",headers:l,query:i},a);return new Ne(d,f=>f.map(XT))}async listOrgKeys(t,a){return await(await this.listOrgKeysRaw(t,a)).value()}async removeMemberRaw(t,a){if(t.id==null)throw new ye("id",'Required parameter "id" was null or undefined when calling removeMember().');if(t.userId==null)throw new ye("userId",'Required parameter "userId" was null or undefined when calling removeMember().');const i={},l={};this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));let u="/orgs/{id}/members/{user_id}";u=u.replace("{id}",encodeURIComponent(String(t.id))),u=u.replace("{user_id}",encodeURIComponent(String(t.userId)));const d=await this.request({path:u,method:"DELETE",headers:l,query:i},a);return new ys(d)}async removeMember(t,a){await this.removeMemberRaw(t,a)}async updateOrgRaw(t,a){if(t.id==null)throw new ye("id",'Required parameter "id" was null or undefined when calling updateOrg().');if(t.body==null)throw new ye("body",'Required parameter "body" was null or undefined when calling updateOrg().');const i={},l={};l["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));let u="/orgs/{id}";u=u.replace("{id}",encodeURIComponent(String(t.id)));const d=await this.request({path:u,method:"PATCH",headers:l,query:i,body:$T(t.body)},a);return new Ne(d,f=>ql(f))}async updateOrg(t,a){return await(await this.updateOrgRaw(t,a)).value()}}class iD extends Zn{async createServerRaw(t,a){if(t.body==null)throw new ye("body",'Required parameter "body" was null or undefined when calling createServer().');const i={},l={};l["Content-Type"]="application/json",t.xOrgID!=null&&(l["X-Org-ID"]=String(t.xOrgID)),this.configuration&&this.configuration.apiKey&&(l["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(l["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));const d=await this.request({path:"/servers",method:"POST",headers:l,query:i,body:FA(t.body)},a);return new Ne(d,f=>ps(f))}async createServer(t,a){return await(await this.createServerRaw(t,a)).value()}async deleteServerRaw(t,a){if(t.id==null)throw new ye("id",'Required parameter "id" was null or undefined when calling deleteServer().');const i={},l={};t.xOrgID!=null&&(l["X-Org-ID"]=String(t.xOrgID)),this.configuration&&this.configuration.apiKey&&(l["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(l["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));let u="/servers/{id}";u=u.replace("{id}",encodeURIComponent(String(t.id)));const d=await this.request({path:u,method:"DELETE",headers:l,query:i},a);return this.isJsonMime(d.headers.get("content-type"))?new Ne(d):new Tn(d)}async deleteServer(t,a){return await(await this.deleteServerRaw(t,a)).value()}async getServerRaw(t,a){if(t.id==null)throw new ye("id",'Required parameter "id" was null or undefined when calling getServer().');const i={},l={};t.xOrgID!=null&&(l["X-Org-ID"]=String(t.xOrgID)),this.configuration&&this.configuration.apiKey&&(l["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(l["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));let u="/servers/{id}";u=u.replace("{id}",encodeURIComponent(String(t.id)));const d=await this.request({path:u,method:"GET",headers:l,query:i},a);return new Ne(d,f=>ps(f))}async getServer(t,a){return await(await this.getServerRaw(t,a)).value()}async listServersRaw(t,a){const i={};t.status!=null&&(i.status=t.status),t.role!=null&&(i.role=t.role);const l={};t.xOrgID!=null&&(l["X-Org-ID"]=String(t.xOrgID)),this.configuration&&this.configuration.apiKey&&(l["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(l["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));const d=await this.request({path:"/servers",method:"GET",headers:l,query:i},a);return new Ne(d,f=>f.map(ps))}async listServers(t={},a){return await(await this.listServersRaw(t,a)).value()}async updateServerRaw(t,a){if(t.id==null)throw new ye("id",'Required parameter "id" was null or undefined when calling updateServer().');if(t.body==null)throw new ye("body",'Required parameter "body" was null or undefined when calling updateServer().');const i={},l={};l["Content-Type"]="application/json",t.xOrgID!=null&&(l["X-Org-ID"]=String(t.xOrgID)),this.configuration&&this.configuration.apiKey&&(l["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(l["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));let u="/servers/{id}";u=u.replace("{id}",encodeURIComponent(String(t.id)));const d=await this.request({path:u,method:"PATCH",headers:l,query:i,body:ST(t.body)},a);return new Ne(d,f=>ps(f))}async updateServer(t,a){return await(await this.updateServerRaw(t,a)).value()}}class oD extends Zn{async createSSHKeyRaw(t,a){if(t.body==null)throw new ye("body",'Required parameter "body" was null or undefined when calling createSSHKey().');const i={},l={};l["Content-Type"]="application/json",t.xOrgID!=null&&(l["X-Org-ID"]=String(t.xOrgID)),this.configuration&&this.configuration.apiKey&&(l["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(l["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));const d=await this.request({path:"/ssh",method:"POST",headers:l,query:i,body:UA(t.body)},a);return new Ne(d,f=>bw(f))}async createSSHKey(t,a){return await(await this.createSSHKeyRaw(t,a)).value()}async deleteSSHKeyRaw(t,a){if(t.id==null)throw new ye("id",'Required parameter "id" was null or undefined when calling deleteSSHKey().');const i={},l={};t.xOrgID!=null&&(l["X-Org-ID"]=String(t.xOrgID)),this.configuration&&this.configuration.apiKey&&(l["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(l["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));let u="/ssh/{id}";u=u.replace("{id}",encodeURIComponent(String(t.id)));const d=await this.request({path:u,method:"DELETE",headers:l,query:i},a);return this.isJsonMime(d.headers.get("content-type"))?new Ne(d):new Tn(d)}async deleteSSHKey(t,a){return await(await this.deleteSSHKeyRaw(t,a)).value()}async downloadSSHKeyRaw(t,a){if(t.xOrgID==null)throw new ye("xOrgID",'Required parameter "xOrgID" was null or undefined when calling downloadSSHKey().');if(t.id==null)throw new ye("id",'Required parameter "id" was null or undefined when calling downloadSSHKey().');if(t.part==null)throw new ye("part",'Required parameter "part" was null or undefined when calling downloadSSHKey().');const i={};t.part!=null&&(i.part=t.part);const l={};t.xOrgID!=null&&(l["X-Org-ID"]=String(t.xOrgID)),this.configuration&&this.configuration.apiKey&&(l["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(l["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));let u="/ssh/{id}/download";u=u.replace("{id}",encodeURIComponent(String(t.id)));const d=await this.request({path:u,method:"GET",headers:l,query:i},a);return this.isJsonMime(d.headers.get("content-type"))?new Ne(d):new Tn(d)}async downloadSSHKey(t,a){return await(await this.downloadSSHKeyRaw(t,a)).value()}async getSSHKeyRaw(t,a){if(t.id==null)throw new ye("id",'Required parameter "id" was null or undefined when calling getSSHKey().');const i={};t.reveal!=null&&(i.reveal=t.reveal);const l={};t.xOrgID!=null&&(l["X-Org-ID"]=String(t.xOrgID)),this.configuration&&this.configuration.apiKey&&(l["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(l["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));let u="/ssh/{id}";u=u.replace("{id}",encodeURIComponent(String(t.id)));const d=await this.request({path:u,method:"GET",headers:l,query:i},a);return new Ne(d,f=>dT(f))}async getSSHKey(t,a){return await(await this.getSSHKeyRaw(t,a)).value()}async listPublicSshKeysRaw(t,a){const i={},l={};t.xOrgID!=null&&(l["X-Org-ID"]=String(t.xOrgID)),this.configuration&&this.configuration.apiKey&&(l["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(l["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));const d=await this.request({path:"/ssh",method:"GET",headers:l,query:i},a);return new Ne(d,f=>f.map(bw))}async listPublicSshKeys(t={},a){return await(await this.listPublicSshKeysRaw(t,a)).value()}}class sD extends Zn{async createTaintRaw(t,a){if(t.body==null)throw new ye("body",'Required parameter "body" was null or undefined when calling createTaint().');const i={},l={};l["Content-Type"]="application/json",t.xOrgID!=null&&(l["X-Org-ID"]=String(t.xOrgID)),this.configuration&&this.configuration.apiKey&&(l["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(l["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));const d=await this.request({path:"/taints",method:"POST",headers:l,query:i,body:VA(t.body)},a);return new Ne(d,f=>fs(f))}async createTaint(t,a){return await(await this.createTaintRaw(t,a)).value()}async deleteTaintRaw(t,a){if(t.id==null)throw new ye("id",'Required parameter "id" was null or undefined when calling deleteTaint().');const i={},l={};t.xOrgID!=null&&(l["X-Org-ID"]=String(t.xOrgID)),this.configuration&&this.configuration.apiKey&&(l["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(l["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));let u="/taints/{id}";u=u.replace("{id}",encodeURIComponent(String(t.id)));const d=await this.request({path:u,method:"DELETE",headers:l,query:i},a);return this.isJsonMime(d.headers.get("content-type"))?new Ne(d):new Tn(d)}async deleteTaint(t,a){return await(await this.deleteTaintRaw(t,a)).value()}async getTaintRaw(t,a){if(t.id==null)throw new ye("id",'Required parameter "id" was null or undefined when calling getTaint().');const i={},l={};t.xOrgID!=null&&(l["X-Org-ID"]=String(t.xOrgID)),this.configuration&&this.configuration.apiKey&&(l["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(l["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));let u="/taints/{id}";u=u.replace("{id}",encodeURIComponent(String(t.id)));const d=await this.request({path:u,method:"GET",headers:l,query:i},a);return new Ne(d,f=>fs(f))}async getTaint(t,a){return await(await this.getTaintRaw(t,a)).value()}async listTaintsRaw(t,a){const i={};t.key!=null&&(i.key=t.key),t.value!=null&&(i.value=t.value),t.q!=null&&(i.q=t.q);const l={};t.xOrgID!=null&&(l["X-Org-ID"]=String(t.xOrgID)),this.configuration&&this.configuration.apiKey&&(l["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(l["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));const d=await this.request({path:"/taints",method:"GET",headers:l,query:i},a);return new Ne(d,f=>f.map(fs))}async listTaints(t={},a){return await(await this.listTaintsRaw(t,a)).value()}async updateTaintRaw(t,a){if(t.id==null)throw new ye("id",'Required parameter "id" was null or undefined when calling updateTaint().');if(t.body==null)throw new ye("body",'Required parameter "body" was null or undefined when calling updateTaint().');const i={},l={};l["Content-Type"]="application/json",t.xOrgID!=null&&(l["X-Org-ID"]=String(t.xOrgID)),this.configuration&&this.configuration.apiKey&&(l["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(l["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(l.Authorization=await this.configuration.apiKey("Authorization"));let u="/taints/{id}";u=u.replace("{id}",encodeURIComponent(String(t.id)));const d=await this.request({path:u,method:"PATCH",headers:l,query:i,body:jT(t.body)},a);return new Ne(d,f=>fs(f))}async updateTaint(t,a){return await(await this.updateTaintRaw(t,a)).value()}}const ug="/api/v1";function lD(){return new MS({basePath:ug,accessToken:async()=>jn.getAccessToken()??"",middleware:[{async pre(e){const t=new Headers(e.init?.headers??{});e.init?.body!=null&&!(e.init.body instanceof FormData)&&!(e.init.body instanceof Blob)&&!t.has("Content-Type")&&t.set("Content-Type","application/json");const i=jn.getAccessToken();i&&t.set("Authorization",`Bearer ${i}`);const l=qa.get();return l&&t.set("X-Org-ID",l),{...e,init:{...e.init,headers:t}}},async post(e){return e.response}}]})}function Na(e){return new e(lD())}function cD(){return Na(JT)}function uD(){return Na(tD)}function dD(){return Na(nD)}function Bd(){return Na(rD)}function fD(){return Na(oD)}function hD(){return Na(iD)}function pD(){return Na(sD)}function mD(){return Na(eD)}function gD(){return Na(YT)}function yD(){return Na(QT)}function vD(){return Na(aD)}function xD(){return Na(WT)}let Fu=null;async function bD(){const e=jn.get();if(!e?.refresh_token)return!1;try{const t=await fetch(`${ug}/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refresh_token:e.refresh_token})});if(!t.ok)return!1;const a=await t.json();return jn.set(a),!0}catch{return!1}}async function jw(){return Fu||(Fu=bD().finally(()=>{Fu=null})),Fu}function wD(e){return e?.status===401||e?.cause?.status===401||e?.response?.status===401||e instanceof Response&&e.status===401}async function ze(e){jn.willExpireSoon?.(30)&&await jw();try{return await e()}catch(t){if(!wD(t)||!await jw())throw t;return await e()}}const Cw=uD(),$p=dD(),Zi={getMe:()=>ze(async()=>await Cw.getMe()),updateMe:e=>ze(async()=>await Cw.updateMe({body:e})),listKeys:()=>ze(async()=>await $p.listUserAPIKeys()),createKey:e=>ze(async()=>await $p.createUserAPIKey({body:e})),deleteKey:e=>ze(async()=>(await $p.deleteUserAPIKey({id:e}),!0))},SD={footer:async()=>{const e=await fetch("/api/v1/version",{cache:"no-store"});if(!e.ok)throw new Error("failed to fetch version");return await e.json()}};function Ew(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Mn(...e){return t=>{let a=!1;const i=e.map(l=>{const u=Ew(l,t);return!a&&typeof u=="function"&&(a=!0),u});if(a)return()=>{for(let l=0;l<i.length;l++){const u=i[l];typeof u=="function"?u():Ew(e[l],null)}}}}function dt(...e){return m.useCallback(Mn(...e),e)}var _D=Symbol.for("react.lazy"),vd=eg[" use ".trim().toString()];function jD(e){return typeof e=="object"&&e!==null&&"then"in e}function KS(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===_D&&"_payload"in e&&jD(e._payload)}function lc(e){const t=CD(e),a=m.forwardRef((i,l)=>{let{children:u,...d}=i;KS(u)&&typeof vd=="function"&&(u=vd(u._payload));const f=m.Children.toArray(u),g=f.find(RD);if(g){const y=g.props.children,x=f.map(v=>v===g?m.Children.count(y)>1?m.Children.only(null):m.isValidElement(y)?y.props.children:null:v);return o.jsx(t,{...d,ref:l,children:m.isValidElement(y)?m.cloneElement(y,void 0,x):null})}return o.jsx(t,{...d,ref:l,children:u})});return a.displayName=`${e}.Slot`,a}var Rs=lc("Slot");function CD(e){const t=m.forwardRef((a,i)=>{let{children:l,...u}=a;if(KS(l)&&typeof vd=="function"&&(l=vd(l._payload)),m.isValidElement(l)){const d=OD(l),f=ND(u,l.props);return l.type!==m.Fragment&&(f.ref=i?Mn(i,d):d),m.cloneElement(l,f)}return m.Children.count(l)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ED=Symbol("radix.slottable");function RD(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ED}function ND(e,t){const a={...t};for(const i in t){const l=e[i],u=t[i];/^on[A-Z]/.test(i)?l&&u?a[i]=(...f)=>{const g=u(...f);return l(...f),g}:l&&(a[i]=l):i==="style"?a[i]={...l,...u}:i==="className"&&(a[i]=[l,u].filter(Boolean).join(" "))}return{...e,...a}}function OD(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning;return a?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}function IS(e){var t,a,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var l=e.length;for(t=0;t<l;t++)e[t]&&(a=IS(e[t]))&&(i&&(i+=" "),i+=a)}else for(a in e)e[a]&&(i&&(i+=" "),i+=a);return i}function LS(){for(var e,t,a=0,i="",l=arguments.length;a<l;a++)(e=arguments[a])&&(t=IS(e))&&(i&&(i+=" "),i+=t);return i}const Rw=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Nw=LS,dg=(e,t)=>a=>{var i;if(t?.variants==null)return Nw(e,a?.class,a?.className);const{variants:l,defaultVariants:u}=t,d=Object.keys(l).map(y=>{const x=a?.[y],v=u?.[y];if(x===null)return null;const w=Rw(x)||Rw(v);return l[y][w]}),f=a&&Object.entries(a).reduce((y,x)=>{let[v,w]=x;return w===void 0||(y[v]=w),y},{}),g=t==null||(i=t.compoundVariants)===null||i===void 0?void 0:i.reduce((y,x)=>{let{class:v,className:w,..._}=x;return Object.entries(_).every(R=>{let[S,A]=R;return Array.isArray(A)?A.includes({...u,...f}[S]):{...u,...f}[S]===A})?[...y,v,w]:y},[]);return Nw(e,d,g,a?.class,a?.className)},AD=(e,t)=>{const a=new Array(e.length+t.length);for(let i=0;i<e.length;i++)a[i]=e[i];for(let i=0;i<t.length;i++)a[e.length+i]=t[i];return a},TD=(e,t)=>({classGroupId:e,validator:t}),US=(e=new Map,t=null,a)=>({nextPart:e,validators:t,classGroupId:a}),xd="-",Ow=[],DD="arbitrary..",MD=e=>{const t=zD(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return kD(d);const f=d.split(xd),g=f[0]===""&&f.length>1?1:0;return qS(f,g,t)},getConflictingClassGroupIds:(d,f)=>{if(f){const g=i[d],y=a[d];return g?y?AD(y,g):g:y||Ow}return a[d]||Ow}}},qS=(e,t,a)=>{if(e.length-t===0)return a.classGroupId;const l=e[t],u=a.nextPart.get(l);if(u){const y=qS(e,t+1,u);if(y)return y}const d=a.validators;if(d===null)return;const f=t===0?e.join(xd):e.slice(t).join(xd),g=d.length;for(let y=0;y<g;y++){const x=d[y];if(x.validator(f))return x.classGroupId}},kD=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),a=t.indexOf(":"),i=t.slice(0,a);return i?DD+i:void 0})(),zD=e=>{const{theme:t,classGroups:a}=e;return PD(a,t)},PD=(e,t)=>{const a=US();for(const i in e){const l=e[i];fg(l,a,i,t)}return a},fg=(e,t,a,i)=>{const l=e.length;for(let u=0;u<l;u++){const d=e[u];KD(d,t,a,i)}},KD=(e,t,a,i)=>{if(typeof e=="string"){ID(e,t,a);return}if(typeof e=="function"){LD(e,t,a,i);return}UD(e,t,a,i)},ID=(e,t,a)=>{const i=e===""?t:FS(t,e);i.classGroupId=a},LD=(e,t,a,i)=>{if(qD(e)){fg(e(i),t,a,i);return}t.validators===null&&(t.validators=[]),t.validators.push(TD(a,e))},UD=(e,t,a,i)=>{const l=Object.entries(e),u=l.length;for(let d=0;d<u;d++){const[f,g]=l[d];fg(g,FS(t,f),a,i)}},FS=(e,t)=>{let a=e;const i=t.split(xd),l=i.length;for(let u=0;u<l;u++){const d=i[u];let f=a.nextPart.get(d);f||(f=US(),a.nextPart.set(d,f)),a=f}return a},qD=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,FD=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,a=Object.create(null),i=Object.create(null);const l=(u,d)=>{a[u]=d,t++,t>e&&(t=0,i=a,a=Object.create(null))};return{get(u){let d=a[u];if(d!==void 0)return d;if((d=i[u])!==void 0)return l(u,d),d},set(u,d){u in a?a[u]=d:l(u,d)}}},Rm="!",Aw=":",$D=[],Tw=(e,t,a,i,l)=>({modifiers:e,hasImportantModifier:t,baseClassName:a,maybePostfixModifierPosition:i,isExternal:l}),VD=e=>{const{prefix:t,experimentalParseClassName:a}=e;let i=l=>{const u=[];let d=0,f=0,g=0,y;const x=l.length;for(let S=0;S<x;S++){const A=l[S];if(d===0&&f===0){if(A===Aw){u.push(l.slice(g,S)),g=S+1;continue}if(A==="/"){y=S;continue}}A==="["?d++:A==="]"?d--:A==="("?f++:A===")"&&f--}const v=u.length===0?l:l.slice(g);let w=v,_=!1;v.endsWith(Rm)?(w=v.slice(0,-1),_=!0):v.startsWith(Rm)&&(w=v.slice(1),_=!0);const R=y&&y>g?y-g:void 0;return Tw(u,_,w,R)};if(t){const l=t+Aw,u=i;i=d=>d.startsWith(l)?u(d.slice(l.length)):Tw($D,!1,d,void 0,!0)}if(a){const l=i;i=u=>a({className:u,parseClassName:l})}return i},BD=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((a,i)=>{t.set(a,1e6+i)}),a=>{const i=[];let l=[];for(let u=0;u<a.length;u++){const d=a[u],f=d[0]==="[",g=t.has(d);f||g?(l.length>0&&(l.sort(),i.push(...l),l=[]),i.push(d)):l.push(d)}return l.length>0&&(l.sort(),i.push(...l)),i}},GD=e=>({cache:FD(e.cacheSize),parseClassName:VD(e),sortModifiers:BD(e),...MD(e)}),HD=/\s+/,XD=(e,t)=>{const{parseClassName:a,getClassGroupId:i,getConflictingClassGroupIds:l,sortModifiers:u}=t,d=[],f=e.trim().split(HD);let g="";for(let y=f.length-1;y>=0;y-=1){const x=f[y],{isExternal:v,modifiers:w,hasImportantModifier:_,baseClassName:R,maybePostfixModifierPosition:S}=a(x);if(v){g=x+(g.length>0?" "+g:g);continue}let A=!!S,M=i(A?R.substring(0,S):R);if(!M){if(!A){g=x+(g.length>0?" "+g:g);continue}if(M=i(R),!M){g=x+(g.length>0?" "+g:g);continue}A=!1}const T=w.length===0?"":w.length===1?w[0]:u(w).join(":"),N=_?T+Rm:T,E=N+M;if(d.indexOf(E)>-1)continue;d.push(E);const D=l(M,A);for(let I=0;I<D.length;++I){const U=D[I];d.push(N+U)}g=x+(g.length>0?" "+g:g)}return g},ZD=(...e)=>{let t=0,a,i,l="";for(;t<e.length;)(a=e[t++])&&(i=$S(a))&&(l&&(l+=" "),l+=i);return l},$S=e=>{if(typeof e=="string")return e;let t,a="";for(let i=0;i<e.length;i++)e[i]&&(t=$S(e[i]))&&(a&&(a+=" "),a+=t);return a},YD=(e,...t)=>{let a,i,l,u;const d=g=>{const y=t.reduce((x,v)=>v(x),e());return a=GD(y),i=a.cache.get,l=a.cache.set,u=f,f(g)},f=g=>{const y=i(g);if(y)return y;const x=XD(g,a);return l(g,x),x};return u=d,(...g)=>u(ZD(...g))},QD=[],sn=e=>{const t=a=>a[e]||QD;return t.isThemeGetter=!0,t},VS=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,BS=/^\((?:(\w[\w-]*):)?(.+)\)$/i,JD=/^\d+\/\d+$/,WD=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,eM=/\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$/,tM=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,nM=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,aM=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,es=e=>JD.test(e),nt=e=>!!e&&!Number.isNaN(Number(e)),hi=e=>!!e&&Number.isInteger(Number(e)),Vp=e=>e.endsWith("%")&&nt(e.slice(0,-1)),kr=e=>WD.test(e),rM=()=>!0,iM=e=>eM.test(e)&&!tM.test(e),GS=()=>!1,oM=e=>nM.test(e),sM=e=>aM.test(e),lM=e=>!Me(e)&&!ke(e),cM=e=>Ns(e,ZS,GS),Me=e=>VS.test(e),Xi=e=>Ns(e,YS,iM),Bp=e=>Ns(e,pM,nt),Dw=e=>Ns(e,HS,GS),uM=e=>Ns(e,XS,sM),$u=e=>Ns(e,QS,oM),ke=e=>BS.test(e),Nl=e=>Os(e,YS),dM=e=>Os(e,mM),Mw=e=>Os(e,HS),fM=e=>Os(e,ZS),hM=e=>Os(e,XS),Vu=e=>Os(e,QS,!0),Ns=(e,t,a)=>{const i=VS.exec(e);return i?i[1]?t(i[1]):a(i[2]):!1},Os=(e,t,a=!1)=>{const i=BS.exec(e);return i?i[1]?t(i[1]):a:!1},HS=e=>e==="position"||e==="percentage",XS=e=>e==="image"||e==="url",ZS=e=>e==="length"||e==="size"||e==="bg-size",YS=e=>e==="length",pM=e=>e==="number",mM=e=>e==="family-name",QS=e=>e==="shadow",gM=()=>{const e=sn("color"),t=sn("font"),a=sn("text"),i=sn("font-weight"),l=sn("tracking"),u=sn("leading"),d=sn("breakpoint"),f=sn("container"),g=sn("spacing"),y=sn("radius"),x=sn("shadow"),v=sn("inset-shadow"),w=sn("text-shadow"),_=sn("drop-shadow"),R=sn("blur"),S=sn("perspective"),A=sn("aspect"),M=sn("ease"),T=sn("animate"),N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],E=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...E(),ke,Me],I=()=>["auto","hidden","clip","visible","scroll"],U=()=>["auto","contain","none"],F=()=>[ke,Me,g],fe=()=>[es,"full","auto",...F()],ge=()=>[hi,"none","subgrid",ke,Me],he=()=>["auto",{span:["full",hi,ke,Me]},hi,ke,Me],ne=()=>[hi,"auto",ke,Me],le=()=>["auto","min","max","fr",ke,Me],ce=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ve=()=>["start","end","center","stretch","center-safe","end-safe"],O=()=>["auto",...F()],j=()=>[es,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...F()],z=()=>[e,ke,Me],J=()=>[...E(),Mw,Dw,{position:[ke,Me]}],me=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Te=()=>["auto","cover","contain",fM,cM,{size:[ke,Me]}],H=()=>[Vp,Nl,Xi],Y=()=>["","none","full",y,ke,Me],oe=()=>["",nt,Nl,Xi],se=()=>["solid","dashed","dotted","double"],we=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ee=()=>[nt,Vp,Mw,Dw],Se=()=>["","none",R,ke,Me],De=()=>["none",nt,ke,Me],He=()=>["none",nt,ke,Me],Qe=()=>[nt,ke,Me],Ye=()=>[es,"full",...F()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[kr],breakpoint:[kr],color:[rM],container:[kr],"drop-shadow":[kr],ease:["in","out","in-out"],font:[lM],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[kr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[kr],shadow:[kr],spacing:["px",nt],text:[kr],"text-shadow":[kr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",es,Me,ke,A]}],container:["container"],columns:[{columns:[nt,Me,ke,f]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"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:D()}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:U()}],"overscroll-x":[{"overscroll-x":U()}],"overscroll-y":[{"overscroll-y":U()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:fe()}],"inset-x":[{"inset-x":fe()}],"inset-y":[{"inset-y":fe()}],start:[{start:fe()}],end:[{end:fe()}],top:[{top:fe()}],right:[{right:fe()}],bottom:[{bottom:fe()}],left:[{left:fe()}],visibility:["visible","invisible","collapse"],z:[{z:[hi,"auto",ke,Me]}],basis:[{basis:[es,"full","auto",f,...F()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[nt,es,"auto","initial","none",Me]}],grow:[{grow:["",nt,ke,Me]}],shrink:[{shrink:["",nt,ke,Me]}],order:[{order:[hi,"first","last","none",ke,Me]}],"grid-cols":[{"grid-cols":ge()}],"col-start-end":[{col:he()}],"col-start":[{"col-start":ne()}],"col-end":[{"col-end":ne()}],"grid-rows":[{"grid-rows":ge()}],"row-start-end":[{row:he()}],"row-start":[{"row-start":ne()}],"row-end":[{"row-end":ne()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":le()}],"auto-rows":[{"auto-rows":le()}],gap:[{gap:F()}],"gap-x":[{"gap-x":F()}],"gap-y":[{"gap-y":F()}],"justify-content":[{justify:[...ce(),"normal"]}],"justify-items":[{"justify-items":[...ve(),"normal"]}],"justify-self":[{"justify-self":["auto",...ve()]}],"align-content":[{content:["normal",...ce()]}],"align-items":[{items:[...ve(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ve(),{baseline:["","last"]}]}],"place-content":[{"place-content":ce()}],"place-items":[{"place-items":[...ve(),"baseline"]}],"place-self":[{"place-self":["auto",...ve()]}],p:[{p:F()}],px:[{px:F()}],py:[{py:F()}],ps:[{ps:F()}],pe:[{pe:F()}],pt:[{pt:F()}],pr:[{pr:F()}],pb:[{pb:F()}],pl:[{pl:F()}],m:[{m:O()}],mx:[{mx:O()}],my:[{my:O()}],ms:[{ms:O()}],me:[{me:O()}],mt:[{mt:O()}],mr:[{mr:O()}],mb:[{mb:O()}],ml:[{ml:O()}],"space-x":[{"space-x":F()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":F()}],"space-y-reverse":["space-y-reverse"],size:[{size:j()}],w:[{w:[f,"screen",...j()]}],"min-w":[{"min-w":[f,"screen","none",...j()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[d]},...j()]}],h:[{h:["screen","lh",...j()]}],"min-h":[{"min-h":["screen","lh","none",...j()]}],"max-h":[{"max-h":["screen","lh",...j()]}],"font-size":[{text:["base",a,Nl,Xi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,ke,Bp]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Vp,Me]}],"font-family":[{font:[dM,Me,t]}],"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:[l,ke,Me]}],"line-clamp":[{"line-clamp":[nt,"none",ke,Bp]}],leading:[{leading:[u,...F()]}],"list-image":[{"list-image":["none",ke,Me]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ke,Me]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:z()}],"text-color":[{text:z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...se(),"wavy"]}],"text-decoration-thickness":[{decoration:[nt,"from-font","auto",ke,Xi]}],"text-decoration-color":[{decoration:z()}],"underline-offset":[{"underline-offset":[nt,"auto",ke,Me]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:F()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ke,Me]}],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",ke,Me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:J()}],"bg-repeat":[{bg:me()}],"bg-size":[{bg:Te()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},hi,ke,Me],radial:["",ke,Me],conic:[hi,ke,Me]},hM,uM]}],"bg-color":[{bg:z()}],"gradient-from-pos":[{from:H()}],"gradient-via-pos":[{via:H()}],"gradient-to-pos":[{to:H()}],"gradient-from":[{from:z()}],"gradient-via":[{via:z()}],"gradient-to":[{to:z()}],rounded:[{rounded:Y()}],"rounded-s":[{"rounded-s":Y()}],"rounded-e":[{"rounded-e":Y()}],"rounded-t":[{"rounded-t":Y()}],"rounded-r":[{"rounded-r":Y()}],"rounded-b":[{"rounded-b":Y()}],"rounded-l":[{"rounded-l":Y()}],"rounded-ss":[{"rounded-ss":Y()}],"rounded-se":[{"rounded-se":Y()}],"rounded-ee":[{"rounded-ee":Y()}],"rounded-es":[{"rounded-es":Y()}],"rounded-tl":[{"rounded-tl":Y()}],"rounded-tr":[{"rounded-tr":Y()}],"rounded-br":[{"rounded-br":Y()}],"rounded-bl":[{"rounded-bl":Y()}],"border-w":[{border:oe()}],"border-w-x":[{"border-x":oe()}],"border-w-y":[{"border-y":oe()}],"border-w-s":[{"border-s":oe()}],"border-w-e":[{"border-e":oe()}],"border-w-t":[{"border-t":oe()}],"border-w-r":[{"border-r":oe()}],"border-w-b":[{"border-b":oe()}],"border-w-l":[{"border-l":oe()}],"divide-x":[{"divide-x":oe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":oe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...se(),"hidden","none"]}],"divide-style":[{divide:[...se(),"hidden","none"]}],"border-color":[{border:z()}],"border-color-x":[{"border-x":z()}],"border-color-y":[{"border-y":z()}],"border-color-s":[{"border-s":z()}],"border-color-e":[{"border-e":z()}],"border-color-t":[{"border-t":z()}],"border-color-r":[{"border-r":z()}],"border-color-b":[{"border-b":z()}],"border-color-l":[{"border-l":z()}],"divide-color":[{divide:z()}],"outline-style":[{outline:[...se(),"none","hidden"]}],"outline-offset":[{"outline-offset":[nt,ke,Me]}],"outline-w":[{outline:["",nt,Nl,Xi]}],"outline-color":[{outline:z()}],shadow:[{shadow:["","none",x,Vu,$u]}],"shadow-color":[{shadow:z()}],"inset-shadow":[{"inset-shadow":["none",v,Vu,$u]}],"inset-shadow-color":[{"inset-shadow":z()}],"ring-w":[{ring:oe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:z()}],"ring-offset-w":[{"ring-offset":[nt,Xi]}],"ring-offset-color":[{"ring-offset":z()}],"inset-ring-w":[{"inset-ring":oe()}],"inset-ring-color":[{"inset-ring":z()}],"text-shadow":[{"text-shadow":["none",w,Vu,$u]}],"text-shadow-color":[{"text-shadow":z()}],opacity:[{opacity:[nt,ke,Me]}],"mix-blend":[{"mix-blend":[...we(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":we()}],"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":[nt]}],"mask-image-linear-from-pos":[{"mask-linear-from":ee()}],"mask-image-linear-to-pos":[{"mask-linear-to":ee()}],"mask-image-linear-from-color":[{"mask-linear-from":z()}],"mask-image-linear-to-color":[{"mask-linear-to":z()}],"mask-image-t-from-pos":[{"mask-t-from":ee()}],"mask-image-t-to-pos":[{"mask-t-to":ee()}],"mask-image-t-from-color":[{"mask-t-from":z()}],"mask-image-t-to-color":[{"mask-t-to":z()}],"mask-image-r-from-pos":[{"mask-r-from":ee()}],"mask-image-r-to-pos":[{"mask-r-to":ee()}],"mask-image-r-from-color":[{"mask-r-from":z()}],"mask-image-r-to-color":[{"mask-r-to":z()}],"mask-image-b-from-pos":[{"mask-b-from":ee()}],"mask-image-b-to-pos":[{"mask-b-to":ee()}],"mask-image-b-from-color":[{"mask-b-from":z()}],"mask-image-b-to-color":[{"mask-b-to":z()}],"mask-image-l-from-pos":[{"mask-l-from":ee()}],"mask-image-l-to-pos":[{"mask-l-to":ee()}],"mask-image-l-from-color":[{"mask-l-from":z()}],"mask-image-l-to-color":[{"mask-l-to":z()}],"mask-image-x-from-pos":[{"mask-x-from":ee()}],"mask-image-x-to-pos":[{"mask-x-to":ee()}],"mask-image-x-from-color":[{"mask-x-from":z()}],"mask-image-x-to-color":[{"mask-x-to":z()}],"mask-image-y-from-pos":[{"mask-y-from":ee()}],"mask-image-y-to-pos":[{"mask-y-to":ee()}],"mask-image-y-from-color":[{"mask-y-from":z()}],"mask-image-y-to-color":[{"mask-y-to":z()}],"mask-image-radial":[{"mask-radial":[ke,Me]}],"mask-image-radial-from-pos":[{"mask-radial-from":ee()}],"mask-image-radial-to-pos":[{"mask-radial-to":ee()}],"mask-image-radial-from-color":[{"mask-radial-from":z()}],"mask-image-radial-to-color":[{"mask-radial-to":z()}],"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":E()}],"mask-image-conic-pos":[{"mask-conic":[nt]}],"mask-image-conic-from-pos":[{"mask-conic-from":ee()}],"mask-image-conic-to-pos":[{"mask-conic-to":ee()}],"mask-image-conic-from-color":[{"mask-conic-from":z()}],"mask-image-conic-to-color":[{"mask-conic-to":z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:J()}],"mask-repeat":[{mask:me()}],"mask-size":[{mask:Te()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ke,Me]}],filter:[{filter:["","none",ke,Me]}],blur:[{blur:Se()}],brightness:[{brightness:[nt,ke,Me]}],contrast:[{contrast:[nt,ke,Me]}],"drop-shadow":[{"drop-shadow":["","none",_,Vu,$u]}],"drop-shadow-color":[{"drop-shadow":z()}],grayscale:[{grayscale:["",nt,ke,Me]}],"hue-rotate":[{"hue-rotate":[nt,ke,Me]}],invert:[{invert:["",nt,ke,Me]}],saturate:[{saturate:[nt,ke,Me]}],sepia:[{sepia:["",nt,ke,Me]}],"backdrop-filter":[{"backdrop-filter":["","none",ke,Me]}],"backdrop-blur":[{"backdrop-blur":Se()}],"backdrop-brightness":[{"backdrop-brightness":[nt,ke,Me]}],"backdrop-contrast":[{"backdrop-contrast":[nt,ke,Me]}],"backdrop-grayscale":[{"backdrop-grayscale":["",nt,ke,Me]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[nt,ke,Me]}],"backdrop-invert":[{"backdrop-invert":["",nt,ke,Me]}],"backdrop-opacity":[{"backdrop-opacity":[nt,ke,Me]}],"backdrop-saturate":[{"backdrop-saturate":[nt,ke,Me]}],"backdrop-sepia":[{"backdrop-sepia":["",nt,ke,Me]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":F()}],"border-spacing-x":[{"border-spacing-x":F()}],"border-spacing-y":[{"border-spacing-y":F()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ke,Me]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[nt,"initial",ke,Me]}],ease:[{ease:["linear","initial",M,ke,Me]}],delay:[{delay:[nt,ke,Me]}],animate:[{animate:["none",T,ke,Me]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,ke,Me]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:De()}],"rotate-x":[{"rotate-x":De()}],"rotate-y":[{"rotate-y":De()}],"rotate-z":[{"rotate-z":De()}],scale:[{scale:He()}],"scale-x":[{"scale-x":He()}],"scale-y":[{"scale-y":He()}],"scale-z":[{"scale-z":He()}],"scale-3d":["scale-3d"],skew:[{skew:Qe()}],"skew-x":[{"skew-x":Qe()}],"skew-y":[{"skew-y":Qe()}],transform:[{transform:[ke,Me,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ye()}],"translate-x":[{"translate-x":Ye()}],"translate-y":[{"translate-y":Ye()}],"translate-z":[{"translate-z":Ye()}],"translate-none":["translate-none"],accent:[{accent:z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:z()}],"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",ke,Me]}],"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":F()}],"scroll-mx":[{"scroll-mx":F()}],"scroll-my":[{"scroll-my":F()}],"scroll-ms":[{"scroll-ms":F()}],"scroll-me":[{"scroll-me":F()}],"scroll-mt":[{"scroll-mt":F()}],"scroll-mr":[{"scroll-mr":F()}],"scroll-mb":[{"scroll-mb":F()}],"scroll-ml":[{"scroll-ml":F()}],"scroll-p":[{"scroll-p":F()}],"scroll-px":[{"scroll-px":F()}],"scroll-py":[{"scroll-py":F()}],"scroll-ps":[{"scroll-ps":F()}],"scroll-pe":[{"scroll-pe":F()}],"scroll-pt":[{"scroll-pt":F()}],"scroll-pr":[{"scroll-pr":F()}],"scroll-pb":[{"scroll-pb":F()}],"scroll-pl":[{"scroll-pl":F()}],"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",ke,Me]}],fill:[{fill:["none",...z()]}],"stroke-w":[{stroke:[nt,Nl,Xi,Bp]}],stroke:[{stroke:["none",...z()]}],"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"]}},yM=YD(gM);function de(...e){return yM(LS(e))}function Ji(e,t=24){return!e||e.length<=t*2+3?e:`${e.slice(0,t)}…${e.slice(-t)}`}const vM=dg("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 ca({className:e,variant:t,asChild:a=!1,...i}){const l=a?Rs:"span";return o.jsx(l,{"data-slot":"badge",className:de(vM({variant:t}),e),...i})}const hg=dg("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 ie({className:e,variant:t,size:a,asChild:i=!1,...l}){const u=i?Rs:"button";return o.jsx(u,{"data-slot":"button",className:de(hg({variant:t,size:a,className:e})),...l})}var xM=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],bM=xM.reduce((e,t)=>{const a=lc(`Primitive.${t}`),i=m.forwardRef((l,u)=>{const{asChild:d,...f}=l,g=d?a:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(g,{...f,ref:u})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{}),wM="Separator",kw="horizontal",SM=["horizontal","vertical"],JS=m.forwardRef((e,t)=>{const{decorative:a,orientation:i=kw,...l}=e,u=_M(i)?i:kw,f=a?{role:"none"}:{"aria-orientation":u==="vertical"?u:void 0,role:"separator"};return o.jsx(bM.div,{"data-orientation":u,...f,...l,ref:t})});JS.displayName=wM;function _M(e){return SM.includes(e)}var jM=JS;function Fl({className:e,orientation:t="horizontal",decorative:a=!0,...i}){return o.jsx(jM,{"data-slot":"separator",decorative:a,orientation:t,className:de("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),...i})}function Re(e,t,{checkForDefaultPrevented:a=!0}={}){return function(l){if(e?.(l),a===!1||!l.defaultPrevented)return t?.(l)}}function CM(e,t){const a=m.createContext(t),i=u=>{const{children:d,...f}=u,g=m.useMemo(()=>f,Object.values(f));return o.jsx(a.Provider,{value:g,children:d})};i.displayName=e+"Provider";function l(u){const d=m.useContext(a);if(d)return d;if(t!==void 0)return t;throw new Error(`\`${u}\` must be used within \`${e}\``)}return[i,l]}function Za(e,t=[]){let a=[];function i(u,d){const f=m.createContext(d),g=a.length;a=[...a,d];const y=v=>{const{scope:w,children:_,...R}=v,S=w?.[e]?.[g]||f,A=m.useMemo(()=>R,Object.values(R));return o.jsx(S.Provider,{value:A,children:_})};y.displayName=u+"Provider";function x(v,w){const _=w?.[e]?.[g]||f,R=m.useContext(_);if(R)return R;if(d!==void 0)return d;throw new Error(`\`${v}\` must be used within \`${u}\``)}return[y,x]}const l=()=>{const u=a.map(d=>m.createContext(d));return function(f){const g=f?.[e]||u;return m.useMemo(()=>({[`__scope${e}`]:{...f,[e]:g}}),[f,g])}};return l.scopeName=e,[i,EM(l,...t)]}function EM(...e){const t=e[0];if(e.length===1)return t;const a=()=>{const i=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(u){const d=i.reduce((f,{useScope:g,scopeName:y})=>{const v=g(u)[`__scope${y}`];return{...f,...v}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:d}),[d])}};return a.scopeName=t.scopeName,a}function RM(e){const t=NM(e),a=m.forwardRef((i,l)=>{const{children:u,...d}=i,f=m.Children.toArray(u),g=f.find(AM);if(g){const y=g.props.children,x=f.map(v=>v===g?m.Children.count(y)>1?m.Children.only(null):m.isValidElement(y)?y.props.children:null:v);return o.jsx(t,{...d,ref:l,children:m.isValidElement(y)?m.cloneElement(y,void 0,x):null})}return o.jsx(t,{...d,ref:l,children:u})});return a.displayName=`${e}.Slot`,a}function NM(e){const t=m.forwardRef((a,i)=>{const{children:l,...u}=a;if(m.isValidElement(l)){const d=DM(l),f=TM(u,l.props);return l.type!==m.Fragment&&(f.ref=i?Mn(i,d):d),m.cloneElement(l,f)}return m.Children.count(l)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var OM=Symbol("radix.slottable");function AM(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===OM}function TM(e,t){const a={...t};for(const i in t){const l=e[i],u=t[i];/^on[A-Z]/.test(i)?l&&u?a[i]=(...f)=>{const g=u(...f);return l(...f),g}:l&&(a[i]=l):i==="style"?a[i]={...l,...u}:i==="className"&&(a[i]=[l,u].filter(Boolean).join(" "))}return{...e,...a}}function DM(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning;return a?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var MM=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],at=MM.reduce((e,t)=>{const a=RM(`Primitive.${t}`),i=m.forwardRef((l,u)=>{const{asChild:d,...f}=l,g=d?a:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(g,{...f,ref:u})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{});function WS(e,t){e&&$d.flushSync(()=>e.dispatchEvent(t))}function Ba(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...a)=>t.current?.(...a),[])}function kM(e,t=globalThis?.document){const a=Ba(e);m.useEffect(()=>{const i=l=>{l.key==="Escape"&&a(l)};return t.addEventListener("keydown",i,{capture:!0}),()=>t.removeEventListener("keydown",i,{capture:!0})},[a,t])}var zM="DismissableLayer",Nm="dismissableLayer.update",PM="dismissableLayer.pointerDownOutside",KM="dismissableLayer.focusOutside",zw,e1=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),As=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:a=!1,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,onDismiss:f,...g}=e,y=m.useContext(e1),[x,v]=m.useState(null),w=x?.ownerDocument??globalThis?.document,[,_]=m.useState({}),R=dt(t,U=>v(U)),S=Array.from(y.layers),[A]=[...y.layersWithOutsidePointerEventsDisabled].slice(-1),M=S.indexOf(A),T=x?S.indexOf(x):-1,N=y.layersWithOutsidePointerEventsDisabled.size>0,E=T>=M,D=UM(U=>{const F=U.target,fe=[...y.branches].some(ge=>ge.contains(F));!E||fe||(l?.(U),d?.(U),U.defaultPrevented||f?.())},w),I=qM(U=>{const F=U.target;[...y.branches].some(ge=>ge.contains(F))||(u?.(U),d?.(U),U.defaultPrevented||f?.())},w);return kM(U=>{T===y.layers.size-1&&(i?.(U),!U.defaultPrevented&&f&&(U.preventDefault(),f()))},w),m.useEffect(()=>{if(x)return a&&(y.layersWithOutsidePointerEventsDisabled.size===0&&(zw=w.body.style.pointerEvents,w.body.style.pointerEvents="none"),y.layersWithOutsidePointerEventsDisabled.add(x)),y.layers.add(x),Pw(),()=>{a&&y.layersWithOutsidePointerEventsDisabled.size===1&&(w.body.style.pointerEvents=zw)}},[x,w,a,y]),m.useEffect(()=>()=>{x&&(y.layers.delete(x),y.layersWithOutsidePointerEventsDisabled.delete(x),Pw())},[x,y]),m.useEffect(()=>{const U=()=>_({});return document.addEventListener(Nm,U),()=>document.removeEventListener(Nm,U)},[]),o.jsx(at.div,{...g,ref:R,style:{pointerEvents:N?E?"auto":"none":void 0,...e.style},onFocusCapture:Re(e.onFocusCapture,I.onFocusCapture),onBlurCapture:Re(e.onBlurCapture,I.onBlurCapture),onPointerDownCapture:Re(e.onPointerDownCapture,D.onPointerDownCapture)})});As.displayName=zM;var IM="DismissableLayerBranch",LM=m.forwardRef((e,t)=>{const a=m.useContext(e1),i=m.useRef(null),l=dt(t,i);return m.useEffect(()=>{const u=i.current;if(u)return a.branches.add(u),()=>{a.branches.delete(u)}},[a.branches]),o.jsx(at.div,{...e,ref:l})});LM.displayName=IM;function UM(e,t=globalThis?.document){const a=Ba(e),i=m.useRef(!1),l=m.useRef(()=>{});return m.useEffect(()=>{const u=f=>{if(f.target&&!i.current){let g=function(){t1(PM,a,y,{discrete:!0})};const y={originalEvent:f};f.pointerType==="touch"?(t.removeEventListener("click",l.current),l.current=g,t.addEventListener("click",l.current,{once:!0})):g()}else t.removeEventListener("click",l.current);i.current=!1},d=window.setTimeout(()=>{t.addEventListener("pointerdown",u)},0);return()=>{window.clearTimeout(d),t.removeEventListener("pointerdown",u),t.removeEventListener("click",l.current)}},[t,a]),{onPointerDownCapture:()=>i.current=!0}}function qM(e,t=globalThis?.document){const a=Ba(e),i=m.useRef(!1);return m.useEffect(()=>{const l=u=>{u.target&&!i.current&&t1(KM,a,{originalEvent:u},{discrete:!1})};return t.addEventListener("focusin",l),()=>t.removeEventListener("focusin",l)},[t,a]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function Pw(){const e=new CustomEvent(Nm);document.dispatchEvent(e)}function t1(e,t,a,{discrete:i}){const l=a.originalEvent.target,u=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:a});t&&l.addEventListener(e,t,{once:!0}),i?WS(l,u):l.dispatchEvent(u)}var hn=globalThis?.document?m.useLayoutEffect:()=>{},FM=eg[" useId ".trim().toString()]||(()=>{}),$M=0;function Cn(e){const[t,a]=m.useState(FM());return hn(()=>{a(i=>i??String($M++))},[e]),t?`radix-${t}`:""}const VM=["top","right","bottom","left"],yi=Math.min,sa=Math.max,bd=Math.round,Bu=Math.floor,ur=e=>({x:e,y:e}),BM={left:"right",right:"left",bottom:"top",top:"bottom"},GM={start:"end",end:"start"};function Om(e,t,a){return sa(e,yi(t,a))}function Ir(e,t){return typeof e=="function"?e(t):e}function Lr(e){return e.split("-")[0]}function Ts(e){return e.split("-")[1]}function pg(e){return e==="x"?"y":"x"}function mg(e){return e==="y"?"height":"width"}const HM=new Set(["top","bottom"]);function cr(e){return HM.has(Lr(e))?"y":"x"}function gg(e){return pg(cr(e))}function XM(e,t,a){a===void 0&&(a=!1);const i=Ts(e),l=gg(e),u=mg(l);let d=l==="x"?i===(a?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[u]>t.floating[u]&&(d=wd(d)),[d,wd(d)]}function ZM(e){const t=wd(e);return[Am(e),t,Am(t)]}function Am(e){return e.replace(/start|end/g,t=>GM[t])}const Kw=["left","right"],Iw=["right","left"],YM=["top","bottom"],QM=["bottom","top"];function JM(e,t,a){switch(e){case"top":case"bottom":return a?t?Iw:Kw:t?Kw:Iw;case"left":case"right":return t?YM:QM;default:return[]}}function WM(e,t,a,i){const l=Ts(e);let u=JM(Lr(e),a==="start",i);return l&&(u=u.map(d=>d+"-"+l),t&&(u=u.concat(u.map(Am)))),u}function wd(e){return e.replace(/left|right|bottom|top/g,t=>BM[t])}function ek(e){return{top:0,right:0,bottom:0,left:0,...e}}function n1(e){return typeof e!="number"?ek(e):{top:e,right:e,bottom:e,left:e}}function Sd(e){const{x:t,y:a,width:i,height:l}=e;return{width:i,height:l,top:a,left:t,right:t+i,bottom:a+l,x:t,y:a}}function Lw(e,t,a){let{reference:i,floating:l}=e;const u=cr(t),d=gg(t),f=mg(d),g=Lr(t),y=u==="y",x=i.x+i.width/2-l.width/2,v=i.y+i.height/2-l.height/2,w=i[f]/2-l[f]/2;let _;switch(g){case"top":_={x,y:i.y-l.height};break;case"bottom":_={x,y:i.y+i.height};break;case"right":_={x:i.x+i.width,y:v};break;case"left":_={x:i.x-l.width,y:v};break;default:_={x:i.x,y:i.y}}switch(Ts(t)){case"start":_[d]-=w*(a&&y?-1:1);break;case"end":_[d]+=w*(a&&y?-1:1);break}return _}const tk=async(e,t,a)=>{const{placement:i="bottom",strategy:l="absolute",middleware:u=[],platform:d}=a,f=u.filter(Boolean),g=await(d.isRTL==null?void 0:d.isRTL(t));let y=await d.getElementRects({reference:e,floating:t,strategy:l}),{x,y:v}=Lw(y,i,g),w=i,_={},R=0;for(let S=0;S<f.length;S++){const{name:A,fn:M}=f[S],{x:T,y:N,data:E,reset:D}=await M({x,y:v,initialPlacement:i,placement:w,strategy:l,middlewareData:_,rects:y,platform:d,elements:{reference:e,floating:t}});x=T??x,v=N??v,_={..._,[A]:{..._[A],...E}},D&&R<=50&&(R++,typeof D=="object"&&(D.placement&&(w=D.placement),D.rects&&(y=D.rects===!0?await d.getElementRects({reference:e,floating:t,strategy:l}):D.rects),{x,y:v}=Lw(y,w,g)),S=-1)}return{x,y:v,placement:w,strategy:l,middlewareData:_}};async function ec(e,t){var a;t===void 0&&(t={});const{x:i,y:l,platform:u,rects:d,elements:f,strategy:g}=e,{boundary:y="clippingAncestors",rootBoundary:x="viewport",elementContext:v="floating",altBoundary:w=!1,padding:_=0}=Ir(t,e),R=n1(_),A=f[w?v==="floating"?"reference":"floating":v],M=Sd(await u.getClippingRect({element:(a=await(u.isElement==null?void 0:u.isElement(A)))==null||a?A:A.contextElement||await(u.getDocumentElement==null?void 0:u.getDocumentElement(f.floating)),boundary:y,rootBoundary:x,strategy:g})),T=v==="floating"?{x:i,y:l,width:d.floating.width,height:d.floating.height}:d.reference,N=await(u.getOffsetParent==null?void 0:u.getOffsetParent(f.floating)),E=await(u.isElement==null?void 0:u.isElement(N))?await(u.getScale==null?void 0:u.getScale(N))||{x:1,y:1}:{x:1,y:1},D=Sd(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:T,offsetParent:N,strategy:g}):T);return{top:(M.top-D.top+R.top)/E.y,bottom:(D.bottom-M.bottom+R.bottom)/E.y,left:(M.left-D.left+R.left)/E.x,right:(D.right-M.right+R.right)/E.x}}const nk=e=>({name:"arrow",options:e,async fn(t){const{x:a,y:i,placement:l,rects:u,platform:d,elements:f,middlewareData:g}=t,{element:y,padding:x=0}=Ir(e,t)||{};if(y==null)return{};const v=n1(x),w={x:a,y:i},_=gg(l),R=mg(_),S=await d.getDimensions(y),A=_==="y",M=A?"top":"left",T=A?"bottom":"right",N=A?"clientHeight":"clientWidth",E=u.reference[R]+u.reference[_]-w[_]-u.floating[R],D=w[_]-u.reference[_],I=await(d.getOffsetParent==null?void 0:d.getOffsetParent(y));let U=I?I[N]:0;(!U||!await(d.isElement==null?void 0:d.isElement(I)))&&(U=f.floating[N]||u.floating[R]);const F=E/2-D/2,fe=U/2-S[R]/2-1,ge=yi(v[M],fe),he=yi(v[T],fe),ne=ge,le=U-S[R]-he,ce=U/2-S[R]/2+F,ve=Om(ne,ce,le),O=!g.arrow&&Ts(l)!=null&&ce!==ve&&u.reference[R]/2-(ce<ne?ge:he)-S[R]/2<0,j=O?ce<ne?ce-ne:ce-le:0;return{[_]:w[_]+j,data:{[_]:ve,centerOffset:ce-ve-j,...O&&{alignmentOffset:j}},reset:O}}}),ak=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var a,i;const{placement:l,middlewareData:u,rects:d,initialPlacement:f,platform:g,elements:y}=t,{mainAxis:x=!0,crossAxis:v=!0,fallbackPlacements:w,fallbackStrategy:_="bestFit",fallbackAxisSideDirection:R="none",flipAlignment:S=!0,...A}=Ir(e,t);if((a=u.arrow)!=null&&a.alignmentOffset)return{};const M=Lr(l),T=cr(f),N=Lr(f)===f,E=await(g.isRTL==null?void 0:g.isRTL(y.floating)),D=w||(N||!S?[wd(f)]:ZM(f)),I=R!=="none";!w&&I&&D.push(...WM(f,S,R,E));const U=[f,...D],F=await ec(t,A),fe=[];let ge=((i=u.flip)==null?void 0:i.overflows)||[];if(x&&fe.push(F[M]),v){const ce=XM(l,d,E);fe.push(F[ce[0]],F[ce[1]])}if(ge=[...ge,{placement:l,overflows:fe}],!fe.every(ce=>ce<=0)){var he,ne;const ce=(((he=u.flip)==null?void 0:he.index)||0)+1,ve=U[ce];if(ve&&(!(v==="alignment"?T!==cr(ve):!1)||ge.every(z=>cr(z.placement)===T?z.overflows[0]>0:!0)))return{data:{index:ce,overflows:ge},reset:{placement:ve}};let O=(ne=ge.filter(j=>j.overflows[0]<=0).sort((j,z)=>j.overflows[1]-z.overflows[1])[0])==null?void 0:ne.placement;if(!O)switch(_){case"bestFit":{var le;const j=(le=ge.filter(z=>{if(I){const J=cr(z.placement);return J===T||J==="y"}return!0}).map(z=>[z.placement,z.overflows.filter(J=>J>0).reduce((J,me)=>J+me,0)]).sort((z,J)=>z[1]-J[1])[0])==null?void 0:le[0];j&&(O=j);break}case"initialPlacement":O=f;break}if(l!==O)return{reset:{placement:O}}}return{}}}};function Uw(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function qw(e){return VM.some(t=>e[t]>=0)}const rk=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:a}=t,{strategy:i="referenceHidden",...l}=Ir(e,t);switch(i){case"referenceHidden":{const u=await ec(t,{...l,elementContext:"reference"}),d=Uw(u,a.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:qw(d)}}}case"escaped":{const u=await ec(t,{...l,altBoundary:!0}),d=Uw(u,a.floating);return{data:{escapedOffsets:d,escaped:qw(d)}}}default:return{}}}}},a1=new Set(["left","top"]);async function ik(e,t){const{placement:a,platform:i,elements:l}=e,u=await(i.isRTL==null?void 0:i.isRTL(l.floating)),d=Lr(a),f=Ts(a),g=cr(a)==="y",y=a1.has(d)?-1:1,x=u&&g?-1:1,v=Ir(t,e);let{mainAxis:w,crossAxis:_,alignmentAxis:R}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return f&&typeof R=="number"&&(_=f==="end"?R*-1:R),g?{x:_*x,y:w*y}:{x:w*y,y:_*x}}const ok=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var a,i;const{x:l,y:u,placement:d,middlewareData:f}=t,g=await ik(t,e);return d===((a=f.offset)==null?void 0:a.placement)&&(i=f.arrow)!=null&&i.alignmentOffset?{}:{x:l+g.x,y:u+g.y,data:{...g,placement:d}}}}},sk=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:a,y:i,placement:l}=t,{mainAxis:u=!0,crossAxis:d=!1,limiter:f={fn:A=>{let{x:M,y:T}=A;return{x:M,y:T}}},...g}=Ir(e,t),y={x:a,y:i},x=await ec(t,g),v=cr(Lr(l)),w=pg(v);let _=y[w],R=y[v];if(u){const A=w==="y"?"top":"left",M=w==="y"?"bottom":"right",T=_+x[A],N=_-x[M];_=Om(T,_,N)}if(d){const A=v==="y"?"top":"left",M=v==="y"?"bottom":"right",T=R+x[A],N=R-x[M];R=Om(T,R,N)}const S=f.fn({...t,[w]:_,[v]:R});return{...S,data:{x:S.x-a,y:S.y-i,enabled:{[w]:u,[v]:d}}}}}},lk=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:a,y:i,placement:l,rects:u,middlewareData:d}=t,{offset:f=0,mainAxis:g=!0,crossAxis:y=!0}=Ir(e,t),x={x:a,y:i},v=cr(l),w=pg(v);let _=x[w],R=x[v];const S=Ir(f,t),A=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(g){const N=w==="y"?"height":"width",E=u.reference[w]-u.floating[N]+A.mainAxis,D=u.reference[w]+u.reference[N]-A.mainAxis;_<E?_=E:_>D&&(_=D)}if(y){var M,T;const N=w==="y"?"width":"height",E=a1.has(Lr(l)),D=u.reference[v]-u.floating[N]+(E&&((M=d.offset)==null?void 0:M[v])||0)+(E?0:A.crossAxis),I=u.reference[v]+u.reference[N]+(E?0:((T=d.offset)==null?void 0:T[v])||0)-(E?A.crossAxis:0);R<D?R=D:R>I&&(R=I)}return{[w]:_,[v]:R}}}},ck=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var a,i;const{placement:l,rects:u,platform:d,elements:f}=t,{apply:g=()=>{},...y}=Ir(e,t),x=await ec(t,y),v=Lr(l),w=Ts(l),_=cr(l)==="y",{width:R,height:S}=u.floating;let A,M;v==="top"||v==="bottom"?(A=v,M=w===(await(d.isRTL==null?void 0:d.isRTL(f.floating))?"start":"end")?"left":"right"):(M=v,A=w==="end"?"top":"bottom");const T=S-x.top-x.bottom,N=R-x.left-x.right,E=yi(S-x[A],T),D=yi(R-x[M],N),I=!t.middlewareData.shift;let U=E,F=D;if((a=t.middlewareData.shift)!=null&&a.enabled.x&&(F=N),(i=t.middlewareData.shift)!=null&&i.enabled.y&&(U=T),I&&!w){const ge=sa(x.left,0),he=sa(x.right,0),ne=sa(x.top,0),le=sa(x.bottom,0);_?F=R-2*(ge!==0||he!==0?ge+he:sa(x.left,x.right)):U=S-2*(ne!==0||le!==0?ne+le:sa(x.top,x.bottom))}await g({...t,availableWidth:F,availableHeight:U});const fe=await d.getDimensions(f.floating);return R!==fe.width||S!==fe.height?{reset:{rects:!0}}:{}}}};function Gd(){return typeof window<"u"}function Ds(e){return r1(e)?(e.nodeName||"").toLowerCase():"#document"}function ua(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function mr(e){var t;return(t=(r1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function r1(e){return Gd()?e instanceof Node||e instanceof ua(e).Node:!1}function Ga(e){return Gd()?e instanceof Element||e instanceof ua(e).Element:!1}function fr(e){return Gd()?e instanceof HTMLElement||e instanceof ua(e).HTMLElement:!1}function Fw(e){return!Gd()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ua(e).ShadowRoot}const uk=new Set(["inline","contents"]);function cc(e){const{overflow:t,overflowX:a,overflowY:i,display:l}=Ha(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+a)&&!uk.has(l)}const dk=new Set(["table","td","th"]);function fk(e){return dk.has(Ds(e))}const hk=[":popover-open",":modal"];function Hd(e){return hk.some(t=>{try{return e.matches(t)}catch{return!1}})}const pk=["transform","translate","scale","rotate","perspective"],mk=["transform","translate","scale","rotate","perspective","filter"],gk=["paint","layout","strict","content"];function yg(e){const t=vg(),a=Ga(e)?Ha(e):e;return pk.some(i=>a[i]?a[i]!=="none":!1)||(a.containerType?a.containerType!=="normal":!1)||!t&&(a.backdropFilter?a.backdropFilter!=="none":!1)||!t&&(a.filter?a.filter!=="none":!1)||mk.some(i=>(a.willChange||"").includes(i))||gk.some(i=>(a.contain||"").includes(i))}function yk(e){let t=vi(e);for(;fr(t)&&!Ss(t);){if(yg(t))return t;if(Hd(t))return null;t=vi(t)}return null}function vg(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const vk=new Set(["html","body","#document"]);function Ss(e){return vk.has(Ds(e))}function Ha(e){return ua(e).getComputedStyle(e)}function Xd(e){return Ga(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function vi(e){if(Ds(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Fw(e)&&e.host||mr(e);return Fw(t)?t.host:t}function i1(e){const t=vi(e);return Ss(t)?e.ownerDocument?e.ownerDocument.body:e.body:fr(t)&&cc(t)?t:i1(t)}function tc(e,t,a){var i;t===void 0&&(t=[]),a===void 0&&(a=!0);const l=i1(e),u=l===((i=e.ownerDocument)==null?void 0:i.body),d=ua(l);if(u){const f=Tm(d);return t.concat(d,d.visualViewport||[],cc(l)?l:[],f&&a?tc(f):[])}return t.concat(l,tc(l,[],a))}function Tm(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function o1(e){const t=Ha(e);let a=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const l=fr(e),u=l?e.offsetWidth:a,d=l?e.offsetHeight:i,f=bd(a)!==u||bd(i)!==d;return f&&(a=u,i=d),{width:a,height:i,$:f}}function xg(e){return Ga(e)?e:e.contextElement}function vs(e){const t=xg(e);if(!fr(t))return ur(1);const a=t.getBoundingClientRect(),{width:i,height:l,$:u}=o1(t);let d=(u?bd(a.width):a.width)/i,f=(u?bd(a.height):a.height)/l;return(!d||!Number.isFinite(d))&&(d=1),(!f||!Number.isFinite(f))&&(f=1),{x:d,y:f}}const xk=ur(0);function s1(e){const t=ua(e);return!vg()||!t.visualViewport?xk:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function bk(e,t,a){return t===void 0&&(t=!1),!a||t&&a!==ua(e)?!1:t}function to(e,t,a,i){t===void 0&&(t=!1),a===void 0&&(a=!1);const l=e.getBoundingClientRect(),u=xg(e);let d=ur(1);t&&(i?Ga(i)&&(d=vs(i)):d=vs(e));const f=bk(u,a,i)?s1(u):ur(0);let g=(l.left+f.x)/d.x,y=(l.top+f.y)/d.y,x=l.width/d.x,v=l.height/d.y;if(u){const w=ua(u),_=i&&Ga(i)?ua(i):i;let R=w,S=Tm(R);for(;S&&i&&_!==R;){const A=vs(S),M=S.getBoundingClientRect(),T=Ha(S),N=M.left+(S.clientLeft+parseFloat(T.paddingLeft))*A.x,E=M.top+(S.clientTop+parseFloat(T.paddingTop))*A.y;g*=A.x,y*=A.y,x*=A.x,v*=A.y,g+=N,y+=E,R=ua(S),S=Tm(R)}}return Sd({width:x,height:v,x:g,y})}function Zd(e,t){const a=Xd(e).scrollLeft;return t?t.left+a:to(mr(e)).left+a}function l1(e,t){const a=e.getBoundingClientRect(),i=a.left+t.scrollLeft-Zd(e,a),l=a.top+t.scrollTop;return{x:i,y:l}}function wk(e){let{elements:t,rect:a,offsetParent:i,strategy:l}=e;const u=l==="fixed",d=mr(i),f=t?Hd(t.floating):!1;if(i===d||f&&u)return a;let g={scrollLeft:0,scrollTop:0},y=ur(1);const x=ur(0),v=fr(i);if((v||!v&&!u)&&((Ds(i)!=="body"||cc(d))&&(g=Xd(i)),fr(i))){const _=to(i);y=vs(i),x.x=_.x+i.clientLeft,x.y=_.y+i.clientTop}const w=d&&!v&&!u?l1(d,g):ur(0);return{width:a.width*y.x,height:a.height*y.y,x:a.x*y.x-g.scrollLeft*y.x+x.x+w.x,y:a.y*y.y-g.scrollTop*y.y+x.y+w.y}}function Sk(e){return Array.from(e.getClientRects())}function _k(e){const t=mr(e),a=Xd(e),i=e.ownerDocument.body,l=sa(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),u=sa(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let d=-a.scrollLeft+Zd(e);const f=-a.scrollTop;return Ha(i).direction==="rtl"&&(d+=sa(t.clientWidth,i.clientWidth)-l),{width:l,height:u,x:d,y:f}}const $w=25;function jk(e,t){const a=ua(e),i=mr(e),l=a.visualViewport;let u=i.clientWidth,d=i.clientHeight,f=0,g=0;if(l){u=l.width,d=l.height;const x=vg();(!x||x&&t==="fixed")&&(f=l.offsetLeft,g=l.offsetTop)}const y=Zd(i);if(y<=0){const x=i.ownerDocument,v=x.body,w=getComputedStyle(v),_=x.compatMode==="CSS1Compat"&&parseFloat(w.marginLeft)+parseFloat(w.marginRight)||0,R=Math.abs(i.clientWidth-v.clientWidth-_);R<=$w&&(u-=R)}else y<=$w&&(u+=y);return{width:u,height:d,x:f,y:g}}const Ck=new Set(["absolute","fixed"]);function Ek(e,t){const a=to(e,!0,t==="fixed"),i=a.top+e.clientTop,l=a.left+e.clientLeft,u=fr(e)?vs(e):ur(1),d=e.clientWidth*u.x,f=e.clientHeight*u.y,g=l*u.x,y=i*u.y;return{width:d,height:f,x:g,y}}function Vw(e,t,a){let i;if(t==="viewport")i=jk(e,a);else if(t==="document")i=_k(mr(e));else if(Ga(t))i=Ek(t,a);else{const l=s1(e);i={x:t.x-l.x,y:t.y-l.y,width:t.width,height:t.height}}return Sd(i)}function c1(e,t){const a=vi(e);return a===t||!Ga(a)||Ss(a)?!1:Ha(a).position==="fixed"||c1(a,t)}function Rk(e,t){const a=t.get(e);if(a)return a;let i=tc(e,[],!1).filter(f=>Ga(f)&&Ds(f)!=="body"),l=null;const u=Ha(e).position==="fixed";let d=u?vi(e):e;for(;Ga(d)&&!Ss(d);){const f=Ha(d),g=yg(d);!g&&f.position==="fixed"&&(l=null),(u?!g&&!l:!g&&f.position==="static"&&!!l&&Ck.has(l.position)||cc(d)&&!g&&c1(e,d))?i=i.filter(x=>x!==d):l=f,d=vi(d)}return t.set(e,i),i}function Nk(e){let{element:t,boundary:a,rootBoundary:i,strategy:l}=e;const d=[...a==="clippingAncestors"?Hd(t)?[]:Rk(t,this._c):[].concat(a),i],f=d[0],g=d.reduce((y,x)=>{const v=Vw(t,x,l);return y.top=sa(v.top,y.top),y.right=yi(v.right,y.right),y.bottom=yi(v.bottom,y.bottom),y.left=sa(v.left,y.left),y},Vw(t,f,l));return{width:g.right-g.left,height:g.bottom-g.top,x:g.left,y:g.top}}function Ok(e){const{width:t,height:a}=o1(e);return{width:t,height:a}}function Ak(e,t,a){const i=fr(t),l=mr(t),u=a==="fixed",d=to(e,!0,u,t);let f={scrollLeft:0,scrollTop:0};const g=ur(0);function y(){g.x=Zd(l)}if(i||!i&&!u)if((Ds(t)!=="body"||cc(l))&&(f=Xd(t)),i){const _=to(t,!0,u,t);g.x=_.x+t.clientLeft,g.y=_.y+t.clientTop}else l&&y();u&&!i&&l&&y();const x=l&&!i&&!u?l1(l,f):ur(0),v=d.left+f.scrollLeft-g.x-x.x,w=d.top+f.scrollTop-g.y-x.y;return{x:v,y:w,width:d.width,height:d.height}}function Gp(e){return Ha(e).position==="static"}function Bw(e,t){if(!fr(e)||Ha(e).position==="fixed")return null;if(t)return t(e);let a=e.offsetParent;return mr(e)===a&&(a=a.ownerDocument.body),a}function u1(e,t){const a=ua(e);if(Hd(e))return a;if(!fr(e)){let l=vi(e);for(;l&&!Ss(l);){if(Ga(l)&&!Gp(l))return l;l=vi(l)}return a}let i=Bw(e,t);for(;i&&fk(i)&&Gp(i);)i=Bw(i,t);return i&&Ss(i)&&Gp(i)&&!yg(i)?a:i||yk(e)||a}const Tk=async function(e){const t=this.getOffsetParent||u1,a=this.getDimensions,i=await a(e.floating);return{reference:Ak(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function Dk(e){return Ha(e).direction==="rtl"}const Mk={convertOffsetParentRelativeRectToViewportRelativeRect:wk,getDocumentElement:mr,getClippingRect:Nk,getOffsetParent:u1,getElementRects:Tk,getClientRects:Sk,getDimensions:Ok,getScale:vs,isElement:Ga,isRTL:Dk};function d1(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function kk(e,t){let a=null,i;const l=mr(e);function u(){var f;clearTimeout(i),(f=a)==null||f.disconnect(),a=null}function d(f,g){f===void 0&&(f=!1),g===void 0&&(g=1),u();const y=e.getBoundingClientRect(),{left:x,top:v,width:w,height:_}=y;if(f||t(),!w||!_)return;const R=Bu(v),S=Bu(l.clientWidth-(x+w)),A=Bu(l.clientHeight-(v+_)),M=Bu(x),N={rootMargin:-R+"px "+-S+"px "+-A+"px "+-M+"px",threshold:sa(0,yi(1,g))||1};let E=!0;function D(I){const U=I[0].intersectionRatio;if(U!==g){if(!E)return d();U?d(!1,U):i=setTimeout(()=>{d(!1,1e-7)},1e3)}U===1&&!d1(y,e.getBoundingClientRect())&&d(),E=!1}try{a=new IntersectionObserver(D,{...N,root:l.ownerDocument})}catch{a=new IntersectionObserver(D,N)}a.observe(e)}return d(!0),u}function zk(e,t,a,i){i===void 0&&(i={});const{ancestorScroll:l=!0,ancestorResize:u=!0,elementResize:d=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:g=!1}=i,y=xg(e),x=l||u?[...y?tc(y):[],...tc(t)]:[];x.forEach(M=>{l&&M.addEventListener("scroll",a,{passive:!0}),u&&M.addEventListener("resize",a)});const v=y&&f?kk(y,a):null;let w=-1,_=null;d&&(_=new ResizeObserver(M=>{let[T]=M;T&&T.target===y&&_&&(_.unobserve(t),cancelAnimationFrame(w),w=requestAnimationFrame(()=>{var N;(N=_)==null||N.observe(t)})),a()}),y&&!g&&_.observe(y),_.observe(t));let R,S=g?to(e):null;g&&A();function A(){const M=to(e);S&&!d1(S,M)&&a(),S=M,R=requestAnimationFrame(A)}return a(),()=>{var M;x.forEach(T=>{l&&T.removeEventListener("scroll",a),u&&T.removeEventListener("resize",a)}),v?.(),(M=_)==null||M.disconnect(),_=null,g&&cancelAnimationFrame(R)}}const Pk=ok,Kk=sk,Ik=ak,Lk=ck,Uk=rk,Gw=nk,qk=lk,Fk=(e,t,a)=>{const i=new Map,l={platform:Mk,...a},u={...l.platform,_c:i};return tk(e,t,{...l,platform:u})};var $k=typeof document<"u",Vk=function(){},ud=$k?m.useLayoutEffect:Vk;function _d(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let a,i,l;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(a=e.length,a!==t.length)return!1;for(i=a;i--!==0;)if(!_d(e[i],t[i]))return!1;return!0}if(l=Object.keys(e),a=l.length,a!==Object.keys(t).length)return!1;for(i=a;i--!==0;)if(!{}.hasOwnProperty.call(t,l[i]))return!1;for(i=a;i--!==0;){const u=l[i];if(!(u==="_owner"&&e.$$typeof)&&!_d(e[u],t[u]))return!1}return!0}return e!==e&&t!==t}function f1(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Hw(e,t){const a=f1(e);return Math.round(t*a)/a}function Hp(e){const t=m.useRef(e);return ud(()=>{t.current=e}),t}function Bk(e){e===void 0&&(e={});const{placement:t="bottom",strategy:a="absolute",middleware:i=[],platform:l,elements:{reference:u,floating:d}={},transform:f=!0,whileElementsMounted:g,open:y}=e,[x,v]=m.useState({x:0,y:0,strategy:a,placement:t,middlewareData:{},isPositioned:!1}),[w,_]=m.useState(i);_d(w,i)||_(i);const[R,S]=m.useState(null),[A,M]=m.useState(null),T=m.useCallback(z=>{z!==I.current&&(I.current=z,S(z))},[]),N=m.useCallback(z=>{z!==U.current&&(U.current=z,M(z))},[]),E=u||R,D=d||A,I=m.useRef(null),U=m.useRef(null),F=m.useRef(x),fe=g!=null,ge=Hp(g),he=Hp(l),ne=Hp(y),le=m.useCallback(()=>{if(!I.current||!U.current)return;const z={placement:t,strategy:a,middleware:w};he.current&&(z.platform=he.current),Fk(I.current,U.current,z).then(J=>{const me={...J,isPositioned:ne.current!==!1};ce.current&&!_d(F.current,me)&&(F.current=me,$d.flushSync(()=>{v(me)}))})},[w,t,a,he,ne]);ud(()=>{y===!1&&F.current.isPositioned&&(F.current.isPositioned=!1,v(z=>({...z,isPositioned:!1})))},[y]);const ce=m.useRef(!1);ud(()=>(ce.current=!0,()=>{ce.current=!1}),[]),ud(()=>{if(E&&(I.current=E),D&&(U.current=D),E&&D){if(ge.current)return ge.current(E,D,le);le()}},[E,D,le,ge,fe]);const ve=m.useMemo(()=>({reference:I,floating:U,setReference:T,setFloating:N}),[T,N]),O=m.useMemo(()=>({reference:E,floating:D}),[E,D]),j=m.useMemo(()=>{const z={position:a,left:0,top:0};if(!O.floating)return z;const J=Hw(O.floating,x.x),me=Hw(O.floating,x.y);return f?{...z,transform:"translate("+J+"px, "+me+"px)",...f1(O.floating)>=1.5&&{willChange:"transform"}}:{position:a,left:J,top:me}},[a,f,O.floating,x.x,x.y]);return m.useMemo(()=>({...x,update:le,refs:ve,elements:O,floatingStyles:j}),[x,le,ve,O,j])}const Gk=e=>{function t(a){return{}.hasOwnProperty.call(a,"current")}return{name:"arrow",options:e,fn(a){const{element:i,padding:l}=typeof e=="function"?e(a):e;return i&&t(i)?i.current!=null?Gw({element:i.current,padding:l}).fn(a):{}:i?Gw({element:i,padding:l}).fn(a):{}}}},Hk=(e,t)=>({...Pk(e),options:[e,t]}),Xk=(e,t)=>({...Kk(e),options:[e,t]}),Zk=(e,t)=>({...qk(e),options:[e,t]}),Yk=(e,t)=>({...Ik(e),options:[e,t]}),Qk=(e,t)=>({...Lk(e),options:[e,t]}),Jk=(e,t)=>({...Uk(e),options:[e,t]}),Wk=(e,t)=>({...Gk(e),options:[e,t]});var ez="Arrow",h1=m.forwardRef((e,t)=>{const{children:a,width:i=10,height:l=5,...u}=e;return o.jsx(at.svg,{...u,ref:t,width:i,height:l,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?a:o.jsx("polygon",{points:"0,0 30,0 15,10"})})});h1.displayName=ez;var tz=h1;function p1(e){const[t,a]=m.useState(void 0);return hn(()=>{if(e){a({width:e.offsetWidth,height:e.offsetHeight});const i=new ResizeObserver(l=>{if(!Array.isArray(l)||!l.length)return;const u=l[0];let d,f;if("borderBoxSize"in u){const g=u.borderBoxSize,y=Array.isArray(g)?g[0]:g;d=y.inlineSize,f=y.blockSize}else d=e.offsetWidth,f=e.offsetHeight;a({width:d,height:f})});return i.observe(e,{box:"border-box"}),()=>i.unobserve(e)}else a(void 0)},[e]),t}var bg="Popper",[m1,_i]=Za(bg),[nz,g1]=m1(bg),y1=e=>{const{__scopePopper:t,children:a}=e,[i,l]=m.useState(null);return o.jsx(nz,{scope:t,anchor:i,onAnchorChange:l,children:a})};y1.displayName=bg;var v1="PopperAnchor",x1=m.forwardRef((e,t)=>{const{__scopePopper:a,virtualRef:i,...l}=e,u=g1(v1,a),d=m.useRef(null),f=dt(t,d),g=m.useRef(null);return m.useEffect(()=>{const y=g.current;g.current=i?.current||d.current,y!==g.current&&u.onAnchorChange(g.current)}),i?null:o.jsx(at.div,{...l,ref:f})});x1.displayName=v1;var wg="PopperContent",[az,rz]=m1(wg),b1=m.forwardRef((e,t)=>{const{__scopePopper:a,side:i="bottom",sideOffset:l=0,align:u="center",alignOffset:d=0,arrowPadding:f=0,avoidCollisions:g=!0,collisionBoundary:y=[],collisionPadding:x=0,sticky:v="partial",hideWhenDetached:w=!1,updatePositionStrategy:_="optimized",onPlaced:R,...S}=e,A=g1(wg,a),[M,T]=m.useState(null),N=dt(t,ee=>T(ee)),[E,D]=m.useState(null),I=p1(E),U=I?.width??0,F=I?.height??0,fe=i+(u!=="center"?"-"+u:""),ge=typeof x=="number"?x:{top:0,right:0,bottom:0,left:0,...x},he=Array.isArray(y)?y:[y],ne=he.length>0,le={padding:ge,boundary:he.filter(oz),altBoundary:ne},{refs:ce,floatingStyles:ve,placement:O,isPositioned:j,middlewareData:z}=Bk({strategy:"fixed",placement:fe,whileElementsMounted:(...ee)=>zk(...ee,{animationFrame:_==="always"}),elements:{reference:A.anchor},middleware:[Hk({mainAxis:l+F,alignmentAxis:d}),g&&Xk({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?Zk():void 0,...le}),g&&Yk({...le}),Qk({...le,apply:({elements:ee,rects:Se,availableWidth:De,availableHeight:He})=>{const{width:Qe,height:Ye}=Se.reference,Ft=ee.floating.style;Ft.setProperty("--radix-popper-available-width",`${De}px`),Ft.setProperty("--radix-popper-available-height",`${He}px`),Ft.setProperty("--radix-popper-anchor-width",`${Qe}px`),Ft.setProperty("--radix-popper-anchor-height",`${Ye}px`)}}),E&&Wk({element:E,padding:f}),sz({arrowWidth:U,arrowHeight:F}),w&&Jk({strategy:"referenceHidden",...le})]}),[J,me]=_1(O),Te=Ba(R);hn(()=>{j&&Te?.()},[j,Te]);const H=z.arrow?.x,Y=z.arrow?.y,oe=z.arrow?.centerOffset!==0,[se,we]=m.useState();return hn(()=>{M&&we(window.getComputedStyle(M).zIndex)},[M]),o.jsx("div",{ref:ce.setFloating,"data-radix-popper-content-wrapper":"",style:{...ve,transform:j?ve.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:se,"--radix-popper-transform-origin":[z.transformOrigin?.x,z.transformOrigin?.y].join(" "),...z.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:o.jsx(az,{scope:a,placedSide:J,onArrowChange:D,arrowX:H,arrowY:Y,shouldHideArrow:oe,children:o.jsx(at.div,{"data-side":J,"data-align":me,...S,ref:N,style:{...S.style,animation:j?void 0:"none"}})})})});b1.displayName=wg;var w1="PopperArrow",iz={top:"bottom",right:"left",bottom:"top",left:"right"},S1=m.forwardRef(function(t,a){const{__scopePopper:i,...l}=t,u=rz(w1,i),d=iz[u.placedSide];return o.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:o.jsx(tz,{...l,ref:a,style:{...l.style,display:"block"}})})});S1.displayName=w1;function oz(e){return e!==null}var sz=e=>({name:"transformOrigin",options:e,fn(t){const{placement:a,rects:i,middlewareData:l}=t,d=l.arrow?.centerOffset!==0,f=d?0:e.arrowWidth,g=d?0:e.arrowHeight,[y,x]=_1(a),v={start:"0%",center:"50%",end:"100%"}[x],w=(l.arrow?.x??0)+f/2,_=(l.arrow?.y??0)+g/2;let R="",S="";return y==="bottom"?(R=d?v:`${w}px`,S=`${-g}px`):y==="top"?(R=d?v:`${w}px`,S=`${i.floating.height+g}px`):y==="right"?(R=`${-g}px`,S=d?v:`${_}px`):y==="left"&&(R=`${i.floating.width+g}px`,S=d?v:`${_}px`),{data:{x:R,y:S}}}});function _1(e){const[t,a="center"]=e.split("-");return[t,a]}var Yd=y1,uc=x1,Qd=b1,Jd=S1,lz="Portal",Ms=m.forwardRef((e,t)=>{const{container:a,...i}=e,[l,u]=m.useState(!1);hn(()=>u(!0),[]);const d=a||l&&globalThis?.document?.body;return d?uS.createPortal(o.jsx(at.div,{...i,ref:t}),d):null});Ms.displayName=lz;function cz(e,t){return m.useReducer((a,i)=>t[a][i]??a,e)}var Oa=e=>{const{present:t,children:a}=e,i=uz(t),l=typeof a=="function"?a({present:i.isPresent}):m.Children.only(a),u=dt(i.ref,dz(l));return typeof a=="function"||i.isPresent?m.cloneElement(l,{ref:u}):null};Oa.displayName="Presence";function uz(e){const[t,a]=m.useState(),i=m.useRef(null),l=m.useRef(e),u=m.useRef("none"),d=e?"mounted":"unmounted",[f,g]=cz(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const y=Gu(i.current);u.current=f==="mounted"?y:"none"},[f]),hn(()=>{const y=i.current,x=l.current;if(x!==e){const w=u.current,_=Gu(y);e?g("MOUNT"):_==="none"||y?.display==="none"?g("UNMOUNT"):g(x&&w!==_?"ANIMATION_OUT":"UNMOUNT"),l.current=e}},[e,g]),hn(()=>{if(t){let y;const x=t.ownerDocument.defaultView??window,v=_=>{const S=Gu(i.current).includes(CSS.escape(_.animationName));if(_.target===t&&S&&(g("ANIMATION_END"),!l.current)){const A=t.style.animationFillMode;t.style.animationFillMode="forwards",y=x.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=A)})}},w=_=>{_.target===t&&(u.current=Gu(i.current))};return t.addEventListener("animationstart",w),t.addEventListener("animationcancel",v),t.addEventListener("animationend",v),()=>{x.clearTimeout(y),t.removeEventListener("animationstart",w),t.removeEventListener("animationcancel",v),t.removeEventListener("animationend",v)}}else g("ANIMATION_END")},[t,g]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:m.useCallback(y=>{i.current=y?getComputedStyle(y):null,a(y)},[])}}function Gu(e){return e?.animationName||"none"}function dz(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning;return a?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var fz=Symbol("radix.slottable");function hz(e){const t=({children:a})=>o.jsx(o.Fragment,{children:a});return t.displayName=`${e}.Slottable`,t.__radixId=fz,t}var pz=eg[" useInsertionEffect ".trim().toString()]||hn;function xi({prop:e,defaultProp:t,onChange:a=()=>{},caller:i}){const[l,u,d]=mz({defaultProp:t,onChange:a}),f=e!==void 0,g=f?e:l;{const x=m.useRef(e!==void 0);m.useEffect(()=>{const v=x.current;v!==f&&console.warn(`${i} is changing from ${v?"controlled":"uncontrolled"} to ${f?"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=f},[f,i])}const y=m.useCallback(x=>{if(f){const v=gz(x)?x(e):x;v!==e&&d.current?.(v)}else u(x)},[f,e,u,d]);return[g,y]}function mz({defaultProp:e,onChange:t}){const[a,i]=m.useState(e),l=m.useRef(a),u=m.useRef(t);return pz(()=>{u.current=t},[t]),m.useEffect(()=>{l.current!==a&&(u.current?.(a),l.current=a)},[a,l]),[a,i,u]}function gz(e){return typeof e=="function"}var j1=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"}),yz="VisuallyHidden",C1=m.forwardRef((e,t)=>o.jsx(at.span,{...e,ref:t,style:{...j1,...e.style}}));C1.displayName=yz;var vz=C1,[Wd]=Za("Tooltip",[_i]),ef=_i(),E1="TooltipProvider",xz=700,Dm="tooltip.open",[bz,Sg]=Wd(E1),R1=e=>{const{__scopeTooltip:t,delayDuration:a=xz,skipDelayDuration:i=300,disableHoverableContent:l=!1,children:u}=e,d=m.useRef(!0),f=m.useRef(!1),g=m.useRef(0);return m.useEffect(()=>{const y=g.current;return()=>window.clearTimeout(y)},[]),o.jsx(bz,{scope:t,isOpenDelayedRef:d,delayDuration:a,onOpen:m.useCallback(()=>{window.clearTimeout(g.current),d.current=!1},[]),onClose:m.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>d.current=!0,i)},[i]),isPointerInTransitRef:f,onPointerInTransitChange:m.useCallback(y=>{f.current=y},[]),disableHoverableContent:l,children:u})};R1.displayName=E1;var nc="Tooltip",[wz,dc]=Wd(nc),N1=e=>{const{__scopeTooltip:t,children:a,open:i,defaultOpen:l,onOpenChange:u,disableHoverableContent:d,delayDuration:f}=e,g=Sg(nc,e.__scopeTooltip),y=ef(t),[x,v]=m.useState(null),w=Cn(),_=m.useRef(0),R=d??g.disableHoverableContent,S=f??g.delayDuration,A=m.useRef(!1),[M,T]=xi({prop:i,defaultProp:l??!1,onChange:U=>{U?(g.onOpen(),document.dispatchEvent(new CustomEvent(Dm))):g.onClose(),u?.(U)},caller:nc}),N=m.useMemo(()=>M?A.current?"delayed-open":"instant-open":"closed",[M]),E=m.useCallback(()=>{window.clearTimeout(_.current),_.current=0,A.current=!1,T(!0)},[T]),D=m.useCallback(()=>{window.clearTimeout(_.current),_.current=0,T(!1)},[T]),I=m.useCallback(()=>{window.clearTimeout(_.current),_.current=window.setTimeout(()=>{A.current=!0,T(!0),_.current=0},S)},[S,T]);return m.useEffect(()=>()=>{_.current&&(window.clearTimeout(_.current),_.current=0)},[]),o.jsx(Yd,{...y,children:o.jsx(wz,{scope:t,contentId:w,open:M,stateAttribute:N,trigger:x,onTriggerChange:v,onTriggerEnter:m.useCallback(()=>{g.isOpenDelayedRef.current?I():E()},[g.isOpenDelayedRef,I,E]),onTriggerLeave:m.useCallback(()=>{R?D():(window.clearTimeout(_.current),_.current=0)},[D,R]),onOpen:E,onClose:D,disableHoverableContent:R,children:a})})};N1.displayName=nc;var Mm="TooltipTrigger",O1=m.forwardRef((e,t)=>{const{__scopeTooltip:a,...i}=e,l=dc(Mm,a),u=Sg(Mm,a),d=ef(a),f=m.useRef(null),g=dt(t,f,l.onTriggerChange),y=m.useRef(!1),x=m.useRef(!1),v=m.useCallback(()=>y.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),o.jsx(uc,{asChild:!0,...d,children:o.jsx(at.button,{"aria-describedby":l.open?l.contentId:void 0,"data-state":l.stateAttribute,...i,ref:g,onPointerMove:Re(e.onPointerMove,w=>{w.pointerType!=="touch"&&!x.current&&!u.isPointerInTransitRef.current&&(l.onTriggerEnter(),x.current=!0)}),onPointerLeave:Re(e.onPointerLeave,()=>{l.onTriggerLeave(),x.current=!1}),onPointerDown:Re(e.onPointerDown,()=>{l.open&&l.onClose(),y.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:Re(e.onFocus,()=>{y.current||l.onOpen()}),onBlur:Re(e.onBlur,l.onClose),onClick:Re(e.onClick,l.onClose)})})});O1.displayName=Mm;var _g="TooltipPortal",[Sz,_z]=Wd(_g,{forceMount:void 0}),A1=e=>{const{__scopeTooltip:t,forceMount:a,children:i,container:l}=e,u=dc(_g,t);return o.jsx(Sz,{scope:t,forceMount:a,children:o.jsx(Oa,{present:a||u.open,children:o.jsx(Ms,{asChild:!0,container:l,children:i})})})};A1.displayName=_g;var _s="TooltipContent",T1=m.forwardRef((e,t)=>{const a=_z(_s,e.__scopeTooltip),{forceMount:i=a.forceMount,side:l="top",...u}=e,d=dc(_s,e.__scopeTooltip);return o.jsx(Oa,{present:i||d.open,children:d.disableHoverableContent?o.jsx(D1,{side:l,...u,ref:t}):o.jsx(jz,{side:l,...u,ref:t})})}),jz=m.forwardRef((e,t)=>{const a=dc(_s,e.__scopeTooltip),i=Sg(_s,e.__scopeTooltip),l=m.useRef(null),u=dt(t,l),[d,f]=m.useState(null),{trigger:g,onClose:y}=a,x=l.current,{onPointerInTransitChange:v}=i,w=m.useCallback(()=>{f(null),v(!1)},[v]),_=m.useCallback((R,S)=>{const A=R.currentTarget,M={x:R.clientX,y:R.clientY},T=Nz(M,A.getBoundingClientRect()),N=Oz(M,T),E=Az(S.getBoundingClientRect()),D=Dz([...N,...E]);f(D),v(!0)},[v]);return m.useEffect(()=>()=>w(),[w]),m.useEffect(()=>{if(g&&x){const R=A=>_(A,x),S=A=>_(A,g);return g.addEventListener("pointerleave",R),x.addEventListener("pointerleave",S),()=>{g.removeEventListener("pointerleave",R),x.removeEventListener("pointerleave",S)}}},[g,x,_,w]),m.useEffect(()=>{if(d){const R=S=>{const A=S.target,M={x:S.clientX,y:S.clientY},T=g?.contains(A)||x?.contains(A),N=!Tz(M,d);T?w():N&&(w(),y())};return document.addEventListener("pointermove",R),()=>document.removeEventListener("pointermove",R)}},[g,x,d,y,w]),o.jsx(D1,{...e,ref:u})}),[Cz,Ez]=Wd(nc,{isInside:!1}),Rz=hz("TooltipContent"),D1=m.forwardRef((e,t)=>{const{__scopeTooltip:a,children:i,"aria-label":l,onEscapeKeyDown:u,onPointerDownOutside:d,...f}=e,g=dc(_s,a),y=ef(a),{onClose:x}=g;return m.useEffect(()=>(document.addEventListener(Dm,x),()=>document.removeEventListener(Dm,x)),[x]),m.useEffect(()=>{if(g.trigger){const v=w=>{w.target?.contains(g.trigger)&&x()};return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[g.trigger,x]),o.jsx(As,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:v=>v.preventDefault(),onDismiss:x,children:o.jsxs(Qd,{"data-state":g.stateAttribute,...y,...f,ref:t,style:{...f.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:[o.jsx(Rz,{children:i}),o.jsx(Cz,{scope:a,isInside:!0,children:o.jsx(vz,{id:g.contentId,role:"tooltip",children:l||i})})]})})});T1.displayName=_s;var M1="TooltipArrow",k1=m.forwardRef((e,t)=>{const{__scopeTooltip:a,...i}=e,l=ef(a);return Ez(M1,a).isInside?null:o.jsx(Jd,{...l,...i,ref:t})});k1.displayName=M1;function Nz(e,t){const a=Math.abs(t.top-e.y),i=Math.abs(t.bottom-e.y),l=Math.abs(t.right-e.x),u=Math.abs(t.left-e.x);switch(Math.min(a,i,l,u)){case u:return"left";case l:return"right";case a:return"top";case i:return"bottom";default:throw new Error("unreachable")}}function Oz(e,t,a=5){const i=[];switch(t){case"top":i.push({x:e.x-a,y:e.y+a},{x:e.x+a,y:e.y+a});break;case"bottom":i.push({x:e.x-a,y:e.y-a},{x:e.x+a,y:e.y-a});break;case"left":i.push({x:e.x+a,y:e.y-a},{x:e.x+a,y:e.y+a});break;case"right":i.push({x:e.x-a,y:e.y-a},{x:e.x-a,y:e.y+a});break}return i}function Az(e){const{top:t,right:a,bottom:i,left:l}=e;return[{x:l,y:t},{x:a,y:t},{x:a,y:i},{x:l,y:i}]}function Tz(e,t){const{x:a,y:i}=e;let l=!1;for(let u=0,d=t.length-1;u<t.length;d=u++){const f=t[u],g=t[d],y=f.x,x=f.y,v=g.x,w=g.y;x>i!=w>i&&a<(v-y)*(i-x)/(w-x)+y&&(l=!l)}return l}function Dz(e){const t=e.slice();return t.sort((a,i)=>a.x<i.x?-1:a.x>i.x?1:a.y<i.y?-1:a.y>i.y?1:0),Mz(t)}function Mz(e){if(e.length<=1)return e.slice();const t=[];for(let i=0;i<e.length;i++){const l=e[i];for(;t.length>=2;){const u=t[t.length-1],d=t[t.length-2];if((u.x-d.x)*(l.y-d.y)>=(u.y-d.y)*(l.x-d.x))t.pop();else break}t.push(l)}t.pop();const a=[];for(let i=e.length-1;i>=0;i--){const l=e[i];for(;a.length>=2;){const u=a[a.length-1],d=a[a.length-2];if((u.x-d.x)*(l.y-d.y)>=(u.y-d.y)*(l.x-d.x))a.pop();else break}a.push(l)}return a.pop(),t.length===1&&a.length===1&&t[0].x===a[0].x&&t[0].y===a[0].y?t:t.concat(a)}var kz=R1,zz=N1,Pz=O1,Kz=A1,Iz=T1,Lz=k1;function fc({delayDuration:e=0,...t}){return o.jsx(kz,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function jd({...e}){return o.jsx(fc,{children:o.jsx(zz,{"data-slot":"tooltip",...e})})}function Cd({...e}){return o.jsx(Pz,{"data-slot":"tooltip-trigger",...e})}function Ed({className:e,sideOffset:t=0,children:a,...i}){return o.jsx(Kz,{children:o.jsxs(Iz,{"data-slot":"tooltip-content",sideOffset:t,className:de("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),...i,children:[a,o.jsx(Lz,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}function z1(e){return e&&e!=="none"?e.slice(0,7):"none"}function Uz(e){if(!e||e==="unknown")return"unknown";const t=new Date(e);return isNaN(+t)?e:t.toLocaleString()}function qz(e){return e?`v${e.version} (${z1(e.commit)}) • built ${e.built} • ${e.go} ${e.goOS}/${e.goArch}`:""}const Fz=m.memo(function({className:t}){const a=Zt({queryKey:["footer"],queryFn:()=>SD.footer(),staleTime:6e4,refetchOnWindowFocus:!1}),i=a.data,l=m.useMemo(()=>qz(i),[i]);return o.jsx("footer",{className:"bg-background text-muted-foreground w-full border-t px-3 py-2 text-xs sm:text-sm",children:o.jsxs("div",{className:"mx-auto flex max-w-screen-2xl items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-2 text-xs sm:text-sm",children:[o.jsxs("span",{children:["© ",new Date().getFullYear()," GlueOps"]}),o.jsx(Fl,{orientation:"vertical",className:"hidden h-4 sm:block"}),o.jsx("span",{className:"hidden sm:block",children:"All systems nominal."})]}),o.jsx("div",{className:"flex flex-wrap items-center gap-2 text-xs sm:text-sm",children:a.isLoading?o.jsx("span",{className:"animate-pulse",children:"loading version…"}):a.isError?o.jsx("span",{className:"text-destructive",children:"version unavailable"}):i?o.jsx(fc,{children:o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx(ca,{variant:"secondary",className:"font-mono",children:i.version}),o.jsxs(jd,{children:[o.jsx(Cd,{asChild:!0,children:o.jsxs("span",{className:"inline-flex items-center gap-1",children:[o.jsx(e2,{className:"h-3.5 w-3.5"}),o.jsx("span",{className:"font-mono",children:z1(i.commit)})]})}),o.jsx(Ed,{side:"top",children:o.jsx("div",{className:"font-mono text-xs",children:i.commit})})]}),o.jsx(Fl,{orientation:"vertical",className:"h-4"}),o.jsxs(jd,{children:[o.jsx(Cd,{asChild:!0,children:o.jsxs("span",{className:"inline-flex items-center gap-1",children:[o.jsx(AS,{className:"h-3.5 w-3.5"}),o.jsx("span",{children:i.go})]})}),o.jsx(Ed,{side:"top",children:o.jsxs("div",{className:"font-mono text-xs",children:[i.goOS,"/",i.goArch]})})]}),o.jsx(Fl,{orientation:"vertical",className:"hidden h-4 sm:block"}),o.jsxs("span",{className:"hidden sm:inline",children:["built ",o.jsx("span",{className:"font-mono",children:Uz(i.built)})]}),o.jsx(Fl,{orientation:"vertical",className:"hidden h-4 sm:block"}),o.jsx(ie,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>{navigator.clipboard?.writeText(l).catch(()=>{})},title:"Copy version details",children:o.jsx(FO,{className:"h-4 w-4"})}),o.jsxs("a",{href:"/api/v1/version",target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-xs underline-offset-4 hover:underline",title:"Open raw version JSON",children:["JSON ",o.jsx(ZO,{className:"h-3.5 w-3.5"})]})]})}):null})]})})});var P1={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Xw=Q.createContext&&Q.createContext(P1),$z=["attr","size","title"];function Vz(e,t){if(e==null)return{};var a=Bz(e,t),i,l;if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(l=0;l<u.length;l++)i=u[l],!(t.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(a[i]=e[i])}return a}function Bz(e,t){if(e==null)return{};var a={};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){if(t.indexOf(i)>=0)continue;a[i]=e[i]}return a}function Rd(){return Rd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(e[i]=a[i])}return e},Rd.apply(this,arguments)}function Zw(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),a.push.apply(a,i)}return a}function Nd(e){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?arguments[t]:{};t%2?Zw(Object(a),!0).forEach(function(i){Gz(e,i,a[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):Zw(Object(a)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(a,i))})}return e}function Gz(e,t,a){return t=Hz(t),t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function Hz(e){var t=Xz(e,"string");return typeof t=="symbol"?t:t+""}function Xz(e,t){if(typeof e!="object"||!e)return e;var a=e[Symbol.toPrimitive];if(a!==void 0){var i=a.call(e,t);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function K1(e){return e&&e.map((t,a)=>Q.createElement(t.tag,Nd({key:a},t.attr),K1(t.child)))}function I1(e){return t=>Q.createElement(Zz,Rd({attr:Nd({},e.attr)},t),K1(e.child))}function Zz(e){var t=a=>{var{attr:i,size:l,title:u}=e,d=Vz(e,$z),f=l||a.size||"1em",g;return a.className&&(g=a.className),e.className&&(g=(g?g+" ":"")+e.className),Q.createElement("svg",Rd({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},a.attr,i,d,{className:g,style:Nd(Nd({color:e.color||a.color},a.style),e.style),height:f,width:f,xmlns:"http://www.w3.org/2000/svg"}),u&&Q.createElement("title",null,u),e.children)};return Xw!==void 0?Q.createElement(Xw.Consumer,null,a=>t(a)):t(P1)}function Yz(e){return I1({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 Qz(e){return I1({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 Jz=[{to:"/clusters",label:"Clusters",icon:Yz},{to:"/node-pools",label:"Node Pools",icon:NO},{to:"/annotations",label:"Annotations",icon:VO},{to:"/labels",label:"Labels",icon:Vd},{to:"/taints",label:"Taints",icon:x2},{to:"/servers",label:"Servers",icon:TS},{to:"/ssh",label:"SSH Keys",icon:JO},{to:"/credentials",label:"Credentials",icon:s2}],Wz=[{to:"/org/members",label:"Members",icon:DS},{to:"/org/api-keys",label:"Org API Keys",icon:a2},{to:"/org/settings",label:"Org Settings",icon:ES}],e4=[{to:"/me",label:"Profile",icon:j2}],t4=[{to:"/admin/users",label:"Users Admin",icon:DS},{to:"/admin/jobs",label:"Jobs Admin",icon:Qz}];var Yw=1,n4=.9,a4=.8,r4=.17,Xp=.1,Zp=.999,i4=.9999,o4=.99,s4=/[\\\/_+.#"@\[\(\{&]/,l4=/[\\\/_+.#"@\[\(\{&]/g,c4=/[\s-]/,L1=/[\s-]/g;function km(e,t,a,i,l,u,d){if(u===t.length)return l===e.length?Yw:o4;var f=`${l},${u}`;if(d[f]!==void 0)return d[f];for(var g=i.charAt(u),y=a.indexOf(g,l),x=0,v,w,_,R;y>=0;)v=km(e,t,a,i,y+1,u+1,d),v>x&&(y===l?v*=Yw:s4.test(e.charAt(y-1))?(v*=a4,_=e.slice(l,y-1).match(l4),_&&l>0&&(v*=Math.pow(Zp,_.length))):c4.test(e.charAt(y-1))?(v*=n4,R=e.slice(l,y-1).match(L1),R&&l>0&&(v*=Math.pow(Zp,R.length))):(v*=r4,l>0&&(v*=Math.pow(Zp,y-l))),e.charAt(y)!==t.charAt(u)&&(v*=i4)),(v<Xp&&a.charAt(y-1)===i.charAt(u+1)||i.charAt(u+1)===i.charAt(u)&&a.charAt(y-1)!==i.charAt(u))&&(w=km(e,t,a,i,y+1,u+2,d),w*Xp>v&&(v=w*Xp)),v>x&&(x=v),y=a.indexOf(g,y+1);return d[f]=x,x}function Qw(e){return e.toLowerCase().replace(L1," ")}function u4(e,t,a){return e=a&&a.length>0?`${e+" "+a.join(" ")}`:e,km(e,t,Qw(e),Qw(t),0,0,{})}var Yp="focusScope.autoFocusOnMount",Qp="focusScope.autoFocusOnUnmount",Jw={bubbles:!1,cancelable:!0},d4="FocusScope",hc=m.forwardRef((e,t)=>{const{loop:a=!1,trapped:i=!1,onMountAutoFocus:l,onUnmountAutoFocus:u,...d}=e,[f,g]=m.useState(null),y=Ba(l),x=Ba(u),v=m.useRef(null),w=dt(t,S=>g(S)),_=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(i){let S=function(N){if(_.paused||!f)return;const E=N.target;f.contains(E)?v.current=E:mi(v.current,{select:!0})},A=function(N){if(_.paused||!f)return;const E=N.relatedTarget;E!==null&&(f.contains(E)||mi(v.current,{select:!0}))},M=function(N){if(document.activeElement===document.body)for(const D of N)D.removedNodes.length>0&&mi(f)};document.addEventListener("focusin",S),document.addEventListener("focusout",A);const T=new MutationObserver(M);return f&&T.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",A),T.disconnect()}}},[i,f,_.paused]),m.useEffect(()=>{if(f){e0.add(_);const S=document.activeElement;if(!f.contains(S)){const M=new CustomEvent(Yp,Jw);f.addEventListener(Yp,y),f.dispatchEvent(M),M.defaultPrevented||(f4(y4(U1(f)),{select:!0}),document.activeElement===S&&mi(f))}return()=>{f.removeEventListener(Yp,y),setTimeout(()=>{const M=new CustomEvent(Qp,Jw);f.addEventListener(Qp,x),f.dispatchEvent(M),M.defaultPrevented||mi(S??document.body,{select:!0}),f.removeEventListener(Qp,x),e0.remove(_)},0)}}},[f,y,x,_]);const R=m.useCallback(S=>{if(!a&&!i||_.paused)return;const A=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,M=document.activeElement;if(A&&M){const T=S.currentTarget,[N,E]=h4(T);N&&E?!S.shiftKey&&M===E?(S.preventDefault(),a&&mi(N,{select:!0})):S.shiftKey&&M===N&&(S.preventDefault(),a&&mi(E,{select:!0})):M===T&&S.preventDefault()}},[a,i,_.paused]);return o.jsx(at.div,{tabIndex:-1,...d,ref:w,onKeyDown:R})});hc.displayName=d4;function f4(e,{select:t=!1}={}){const a=document.activeElement;for(const i of e)if(mi(i,{select:t}),document.activeElement!==a)return}function h4(e){const t=U1(e),a=Ww(t,e),i=Ww(t.reverse(),e);return[a,i]}function U1(e){const t=[],a=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const l=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||l?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;a.nextNode();)t.push(a.currentNode);return t}function Ww(e,t){for(const a of e)if(!p4(a,{upTo:t}))return a}function p4(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function m4(e){return e instanceof HTMLInputElement&&"select"in e}function mi(e,{select:t=!1}={}){if(e&&e.focus){const a=document.activeElement;e.focus({preventScroll:!0}),e!==a&&m4(e)&&t&&e.select()}}var e0=g4();function g4(){let e=[];return{add(t){const a=e[0];t!==a&&a?.pause(),e=t0(e,t),e.unshift(t)},remove(t){e=t0(e,t),e[0]?.resume()}}}function t0(e,t){const a=[...e],i=a.indexOf(t);return i!==-1&&a.splice(i,1),a}function y4(e){return e.filter(t=>t.tagName!=="A")}var Jp=0;function tf(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??n0()),document.body.insertAdjacentElement("beforeend",e[1]??n0()),Jp++,()=>{Jp===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Jp--}},[])}function n0(){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 sr=function(){return sr=Object.assign||function(t){for(var a,i=1,l=arguments.length;i<l;i++){a=arguments[i];for(var u in a)Object.prototype.hasOwnProperty.call(a,u)&&(t[u]=a[u])}return t},sr.apply(this,arguments)};function q1(e,t){var a={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(a[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,i=Object.getOwnPropertySymbols(e);l<i.length;l++)t.indexOf(i[l])<0&&Object.prototype.propertyIsEnumerable.call(e,i[l])&&(a[i[l]]=e[i[l]]);return a}function v4(e,t,a){if(a||arguments.length===2)for(var i=0,l=t.length,u;i<l;i++)(u||!(i in t))&&(u||(u=Array.prototype.slice.call(t,0,i)),u[i]=t[i]);return e.concat(u||Array.prototype.slice.call(t))}var dd="right-scroll-bar-position",fd="width-before-scroll-bar",x4="with-scroll-bars-hidden",b4="--removed-body-scroll-bar-size";function Wp(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function w4(e,t){var a=m.useState(function(){return{value:e,callback:t,facade:{get current(){return a.value},set current(i){var l=a.value;l!==i&&(a.value=i,a.callback(i,l))}}}})[0];return a.callback=t,a.facade}var S4=typeof window<"u"?m.useLayoutEffect:m.useEffect,a0=new WeakMap;function _4(e,t){var a=w4(null,function(i){return e.forEach(function(l){return Wp(l,i)})});return S4(function(){var i=a0.get(a);if(i){var l=new Set(i),u=new Set(e),d=a.current;l.forEach(function(f){u.has(f)||Wp(f,null)}),u.forEach(function(f){l.has(f)||Wp(f,d)})}a0.set(a,e)},[e]),a}function j4(e){return e}function C4(e,t){t===void 0&&(t=j4);var a=[],i=!1,l={read:function(){if(i)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return a.length?a[a.length-1]:e},useMedium:function(u){var d=t(u,i);return a.push(d),function(){a=a.filter(function(f){return f!==d})}},assignSyncMedium:function(u){for(i=!0;a.length;){var d=a;a=[],d.forEach(u)}a={push:function(f){return u(f)},filter:function(){return a}}},assignMedium:function(u){i=!0;var d=[];if(a.length){var f=a;a=[],f.forEach(u),d=a}var g=function(){var x=d;d=[],x.forEach(u)},y=function(){return Promise.resolve().then(g)};y(),a={push:function(x){d.push(x),y()},filter:function(x){return d=d.filter(x),a}}}};return l}function E4(e){e===void 0&&(e={});var t=C4(null);return t.options=sr({async:!0,ssr:!1},e),t}var F1=function(e){var t=e.sideCar,a=q1(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var i=t.read();if(!i)throw new Error("Sidecar medium not found");return m.createElement(i,sr({},a))};F1.isSideCarExport=!0;function R4(e,t){return e.useMedium(t),F1}var $1=E4(),em=function(){},nf=m.forwardRef(function(e,t){var a=m.useRef(null),i=m.useState({onScrollCapture:em,onWheelCapture:em,onTouchMoveCapture:em}),l=i[0],u=i[1],d=e.forwardProps,f=e.children,g=e.className,y=e.removeScrollBar,x=e.enabled,v=e.shards,w=e.sideCar,_=e.noRelative,R=e.noIsolation,S=e.inert,A=e.allowPinchZoom,M=e.as,T=M===void 0?"div":M,N=e.gapMode,E=q1(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),D=w,I=_4([a,t]),U=sr(sr({},E),l);return m.createElement(m.Fragment,null,x&&m.createElement(D,{sideCar:$1,removeScrollBar:y,shards:v,noRelative:_,noIsolation:R,inert:S,setCallbacks:u,allowPinchZoom:!!A,lockRef:a,gapMode:N}),d?m.cloneElement(m.Children.only(f),sr(sr({},U),{ref:I})):m.createElement(T,sr({},U,{className:g,ref:I}),f))});nf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};nf.classNames={fullWidth:fd,zeroRight:dd};var N4=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function O4(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=N4();return t&&e.setAttribute("nonce",t),e}function A4(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function T4(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var D4=function(){var e=0,t=null;return{add:function(a){e==0&&(t=O4())&&(A4(t,a),T4(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},M4=function(){var e=D4();return function(t,a){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&a])}},V1=function(){var e=M4(),t=function(a){var i=a.styles,l=a.dynamic;return e(i,l),null};return t},k4={left:0,top:0,right:0,gap:0},tm=function(e){return parseInt(e||"",10)||0},z4=function(e){var t=window.getComputedStyle(document.body),a=t[e==="padding"?"paddingLeft":"marginLeft"],i=t[e==="padding"?"paddingTop":"marginTop"],l=t[e==="padding"?"paddingRight":"marginRight"];return[tm(a),tm(i),tm(l)]},P4=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return k4;var t=z4(e),a=document.documentElement.clientWidth,i=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,i-a+t[2]-t[0])}},K4=V1(),xs="data-scroll-locked",I4=function(e,t,a,i){var l=e.left,u=e.top,d=e.right,f=e.gap;return a===void 0&&(a="margin"),`
|
|
.`.concat(x4,` {
|
|
overflow: hidden `).concat(i,`;
|
|
padding-right: `).concat(f,"px ").concat(i,`;
|
|
}
|
|
body[`).concat(xs,`] {
|
|
overflow: hidden `).concat(i,`;
|
|
overscroll-behavior: contain;
|
|
`).concat([t&&"position: relative ".concat(i,";"),a==="margin"&&`
|
|
padding-left: `.concat(l,`px;
|
|
padding-top: `).concat(u,`px;
|
|
padding-right: `).concat(d,`px;
|
|
margin-left:0;
|
|
margin-top:0;
|
|
margin-right: `).concat(f,"px ").concat(i,`;
|
|
`),a==="padding"&&"padding-right: ".concat(f,"px ").concat(i,";")].filter(Boolean).join(""),`
|
|
}
|
|
|
|
.`).concat(dd,` {
|
|
right: `).concat(f,"px ").concat(i,`;
|
|
}
|
|
|
|
.`).concat(fd,` {
|
|
margin-right: `).concat(f,"px ").concat(i,`;
|
|
}
|
|
|
|
.`).concat(dd," .").concat(dd,` {
|
|
right: 0 `).concat(i,`;
|
|
}
|
|
|
|
.`).concat(fd," .").concat(fd,` {
|
|
margin-right: 0 `).concat(i,`;
|
|
}
|
|
|
|
body[`).concat(xs,`] {
|
|
`).concat(b4,": ").concat(f,`px;
|
|
}
|
|
`)},r0=function(){var e=parseInt(document.body.getAttribute(xs)||"0",10);return isFinite(e)?e:0},L4=function(){m.useEffect(function(){return document.body.setAttribute(xs,(r0()+1).toString()),function(){var e=r0()-1;e<=0?document.body.removeAttribute(xs):document.body.setAttribute(xs,e.toString())}},[])},U4=function(e){var t=e.noRelative,a=e.noImportant,i=e.gapMode,l=i===void 0?"margin":i;L4();var u=m.useMemo(function(){return P4(l)},[l]);return m.createElement(K4,{styles:I4(u,!t,l,a?"":"!important")})},zm=!1;if(typeof window<"u")try{var Hu=Object.defineProperty({},"passive",{get:function(){return zm=!0,!0}});window.addEventListener("test",Hu,Hu),window.removeEventListener("test",Hu,Hu)}catch{zm=!1}var ts=zm?{passive:!1}:!1,q4=function(e){return e.tagName==="TEXTAREA"},B1=function(e,t){if(!(e instanceof Element))return!1;var a=window.getComputedStyle(e);return a[t]!=="hidden"&&!(a.overflowY===a.overflowX&&!q4(e)&&a[t]==="visible")},F4=function(e){return B1(e,"overflowY")},$4=function(e){return B1(e,"overflowX")},i0=function(e,t){var a=t.ownerDocument,i=t;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var l=G1(e,i);if(l){var u=H1(e,i),d=u[1],f=u[2];if(d>f)return!0}i=i.parentNode}while(i&&i!==a.body);return!1},V4=function(e){var t=e.scrollTop,a=e.scrollHeight,i=e.clientHeight;return[t,a,i]},B4=function(e){var t=e.scrollLeft,a=e.scrollWidth,i=e.clientWidth;return[t,a,i]},G1=function(e,t){return e==="v"?F4(t):$4(t)},H1=function(e,t){return e==="v"?V4(t):B4(t)},G4=function(e,t){return e==="h"&&t==="rtl"?-1:1},H4=function(e,t,a,i,l){var u=G4(e,window.getComputedStyle(t).direction),d=u*i,f=a.target,g=t.contains(f),y=!1,x=d>0,v=0,w=0;do{if(!f)break;var _=H1(e,f),R=_[0],S=_[1],A=_[2],M=S-A-u*R;(R||M)&&G1(e,f)&&(v+=M,w+=R);var T=f.parentNode;f=T&&T.nodeType===Node.DOCUMENT_FRAGMENT_NODE?T.host:T}while(!g&&f!==document.body||g&&(t.contains(f)||t===f));return(x&&Math.abs(v)<1||!x&&Math.abs(w)<1)&&(y=!0),y},Xu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},o0=function(e){return[e.deltaX,e.deltaY]},s0=function(e){return e&&"current"in e?e.current:e},X4=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Z4=function(e){return`
|
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
`)},Y4=0,ns=[];function Q4(e){var t=m.useRef([]),a=m.useRef([0,0]),i=m.useRef(),l=m.useState(Y4++)[0],u=m.useState(V1)[0],d=m.useRef(e);m.useEffect(function(){d.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(l));var S=v4([e.lockRef.current],(e.shards||[]).map(s0),!0).filter(Boolean);return S.forEach(function(A){return A.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),S.forEach(function(A){return A.classList.remove("allow-interactivity-".concat(l))})}}},[e.inert,e.lockRef.current,e.shards]);var f=m.useCallback(function(S,A){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!d.current.allowPinchZoom;var M=Xu(S),T=a.current,N="deltaX"in S?S.deltaX:T[0]-M[0],E="deltaY"in S?S.deltaY:T[1]-M[1],D,I=S.target,U=Math.abs(N)>Math.abs(E)?"h":"v";if("touches"in S&&U==="h"&&I.type==="range")return!1;var F=i0(U,I);if(!F)return!0;if(F?D=U:(D=U==="v"?"h":"v",F=i0(U,I)),!F)return!1;if(!i.current&&"changedTouches"in S&&(N||E)&&(i.current=D),!D)return!0;var fe=i.current||D;return H4(fe,A,S,fe==="h"?N:E)},[]),g=m.useCallback(function(S){var A=S;if(!(!ns.length||ns[ns.length-1]!==u)){var M="deltaY"in A?o0(A):Xu(A),T=t.current.filter(function(D){return D.name===A.type&&(D.target===A.target||A.target===D.shadowParent)&&X4(D.delta,M)})[0];if(T&&T.should){A.cancelable&&A.preventDefault();return}if(!T){var N=(d.current.shards||[]).map(s0).filter(Boolean).filter(function(D){return D.contains(A.target)}),E=N.length>0?f(A,N[0]):!d.current.noIsolation;E&&A.cancelable&&A.preventDefault()}}},[]),y=m.useCallback(function(S,A,M,T){var N={name:S,delta:A,target:M,should:T,shadowParent:J4(M)};t.current.push(N),setTimeout(function(){t.current=t.current.filter(function(E){return E!==N})},1)},[]),x=m.useCallback(function(S){a.current=Xu(S),i.current=void 0},[]),v=m.useCallback(function(S){y(S.type,o0(S),S.target,f(S,e.lockRef.current))},[]),w=m.useCallback(function(S){y(S.type,Xu(S),S.target,f(S,e.lockRef.current))},[]);m.useEffect(function(){return ns.push(u),e.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:w}),document.addEventListener("wheel",g,ts),document.addEventListener("touchmove",g,ts),document.addEventListener("touchstart",x,ts),function(){ns=ns.filter(function(S){return S!==u}),document.removeEventListener("wheel",g,ts),document.removeEventListener("touchmove",g,ts),document.removeEventListener("touchstart",x,ts)}},[]);var _=e.removeScrollBar,R=e.inert;return m.createElement(m.Fragment,null,R?m.createElement(u,{styles:Z4(l)}):null,_?m.createElement(U4,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function J4(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const W4=R4($1,Q4);var pc=m.forwardRef(function(e,t){return m.createElement(nf,sr({},e,{ref:t,sideCar:W4}))});pc.classNames=nf.classNames;var e3=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},as=new WeakMap,Zu=new WeakMap,Yu={},nm=0,X1=function(e){return e&&(e.host||X1(e.parentNode))},t3=function(e,t){return t.map(function(a){if(e.contains(a))return a;var i=X1(a);return i&&e.contains(i)?i:(console.error("aria-hidden",a,"in not contained inside",e,". Doing nothing"),null)}).filter(function(a){return!!a})},n3=function(e,t,a,i){var l=t3(t,Array.isArray(e)?e:[e]);Yu[a]||(Yu[a]=new WeakMap);var u=Yu[a],d=[],f=new Set,g=new Set(l),y=function(v){!v||f.has(v)||(f.add(v),y(v.parentNode))};l.forEach(y);var x=function(v){!v||g.has(v)||Array.prototype.forEach.call(v.children,function(w){if(f.has(w))x(w);else try{var _=w.getAttribute(i),R=_!==null&&_!=="false",S=(as.get(w)||0)+1,A=(u.get(w)||0)+1;as.set(w,S),u.set(w,A),d.push(w),S===1&&R&&Zu.set(w,!0),A===1&&w.setAttribute(a,"true"),R||w.setAttribute(i,"true")}catch(M){console.error("aria-hidden: cannot operate on ",w,M)}})};return x(t),f.clear(),nm++,function(){d.forEach(function(v){var w=as.get(v)-1,_=u.get(v)-1;as.set(v,w),u.set(v,_),w||(Zu.has(v)||v.removeAttribute(i),Zu.delete(v)),_||v.removeAttribute(a)}),nm--,nm||(as=new WeakMap,as=new WeakMap,Zu=new WeakMap,Yu={})}},af=function(e,t,a){a===void 0&&(a="data-aria-hidden");var i=Array.from(Array.isArray(e)?e:[e]),l=e3(e);return l?(i.push.apply(i,Array.from(l.querySelectorAll("[aria-live], script"))),n3(i,l,a,"aria-hidden")):function(){return null}};function a3(e){const t=r3(e),a=m.forwardRef((i,l)=>{const{children:u,...d}=i,f=m.Children.toArray(u),g=f.find(o3);if(g){const y=g.props.children,x=f.map(v=>v===g?m.Children.count(y)>1?m.Children.only(null):m.isValidElement(y)?y.props.children:null:v);return o.jsx(t,{...d,ref:l,children:m.isValidElement(y)?m.cloneElement(y,void 0,x):null})}return o.jsx(t,{...d,ref:l,children:u})});return a.displayName=`${e}.Slot`,a}function r3(e){const t=m.forwardRef((a,i)=>{const{children:l,...u}=a;if(m.isValidElement(l)){const d=l3(l),f=s3(u,l.props);return l.type!==m.Fragment&&(f.ref=i?Mn(i,d):d),m.cloneElement(l,f)}return m.Children.count(l)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var i3=Symbol("radix.slottable");function o3(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===i3}function s3(e,t){const a={...t};for(const i in t){const l=e[i],u=t[i];/^on[A-Z]/.test(i)?l&&u?a[i]=(...f)=>{const g=u(...f);return l(...f),g}:l&&(a[i]=l):i==="style"?a[i]={...l,...u}:i==="className"&&(a[i]=[l,u].filter(Boolean).join(" "))}return{...e,...a}}function l3(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning;return a?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var rf="Dialog",[Z1,Y1]=Za(rf),[c3,Ya]=Z1(rf),Q1=e=>{const{__scopeDialog:t,children:a,open:i,defaultOpen:l,onOpenChange:u,modal:d=!0}=e,f=m.useRef(null),g=m.useRef(null),[y,x]=xi({prop:i,defaultProp:l??!1,onChange:u,caller:rf});return o.jsx(c3,{scope:t,triggerRef:f,contentRef:g,contentId:Cn(),titleId:Cn(),descriptionId:Cn(),open:y,onOpenChange:x,onOpenToggle:m.useCallback(()=>x(v=>!v),[x]),modal:d,children:a})};Q1.displayName=rf;var J1="DialogTrigger",W1=m.forwardRef((e,t)=>{const{__scopeDialog:a,...i}=e,l=Ya(J1,a),u=dt(t,l.triggerRef);return o.jsx(at.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":Eg(l.open),...i,ref:u,onClick:Re(e.onClick,l.onOpenToggle)})});W1.displayName=J1;var jg="DialogPortal",[u3,e_]=Z1(jg,{forceMount:void 0}),t_=e=>{const{__scopeDialog:t,forceMount:a,children:i,container:l}=e,u=Ya(jg,t);return o.jsx(u3,{scope:t,forceMount:a,children:m.Children.map(i,d=>o.jsx(Oa,{present:a||u.open,children:o.jsx(Ms,{asChild:!0,container:l,children:d})}))})};t_.displayName=jg;var Od="DialogOverlay",n_=m.forwardRef((e,t)=>{const a=e_(Od,e.__scopeDialog),{forceMount:i=a.forceMount,...l}=e,u=Ya(Od,e.__scopeDialog);return u.modal?o.jsx(Oa,{present:i||u.open,children:o.jsx(f3,{...l,ref:t})}):null});n_.displayName=Od;var d3=a3("DialogOverlay.RemoveScroll"),f3=m.forwardRef((e,t)=>{const{__scopeDialog:a,...i}=e,l=Ya(Od,a);return o.jsx(pc,{as:d3,allowPinchZoom:!0,shards:[l.contentRef],children:o.jsx(at.div,{"data-state":Eg(l.open),...i,ref:t,style:{pointerEvents:"auto",...i.style}})})}),no="DialogContent",a_=m.forwardRef((e,t)=>{const a=e_(no,e.__scopeDialog),{forceMount:i=a.forceMount,...l}=e,u=Ya(no,e.__scopeDialog);return o.jsx(Oa,{present:i||u.open,children:u.modal?o.jsx(h3,{...l,ref:t}):o.jsx(p3,{...l,ref:t})})});a_.displayName=no;var h3=m.forwardRef((e,t)=>{const a=Ya(no,e.__scopeDialog),i=m.useRef(null),l=dt(t,a.contentRef,i);return m.useEffect(()=>{const u=i.current;if(u)return af(u)},[]),o.jsx(r_,{...e,ref:l,trapFocus:a.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Re(e.onCloseAutoFocus,u=>{u.preventDefault(),a.triggerRef.current?.focus()}),onPointerDownOutside:Re(e.onPointerDownOutside,u=>{const d=u.detail.originalEvent,f=d.button===0&&d.ctrlKey===!0;(d.button===2||f)&&u.preventDefault()}),onFocusOutside:Re(e.onFocusOutside,u=>u.preventDefault())})}),p3=m.forwardRef((e,t)=>{const a=Ya(no,e.__scopeDialog),i=m.useRef(!1),l=m.useRef(!1);return o.jsx(r_,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:u=>{e.onCloseAutoFocus?.(u),u.defaultPrevented||(i.current||a.triggerRef.current?.focus(),u.preventDefault()),i.current=!1,l.current=!1},onInteractOutside:u=>{e.onInteractOutside?.(u),u.defaultPrevented||(i.current=!0,u.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const d=u.target;a.triggerRef.current?.contains(d)&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&l.current&&u.preventDefault()}})}),r_=m.forwardRef((e,t)=>{const{__scopeDialog:a,trapFocus:i,onOpenAutoFocus:l,onCloseAutoFocus:u,...d}=e,f=Ya(no,a),g=m.useRef(null),y=dt(t,g);return tf(),o.jsxs(o.Fragment,{children:[o.jsx(hc,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:l,onUnmountAutoFocus:u,children:o.jsx(As,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":Eg(f.open),...d,ref:y,onDismiss:()=>f.onOpenChange(!1)})}),o.jsxs(o.Fragment,{children:[o.jsx(g3,{titleId:f.titleId}),o.jsx(v3,{contentRef:g,descriptionId:f.descriptionId})]})]})}),Cg="DialogTitle",i_=m.forwardRef((e,t)=>{const{__scopeDialog:a,...i}=e,l=Ya(Cg,a);return o.jsx(at.h2,{id:l.titleId,...i,ref:t})});i_.displayName=Cg;var o_="DialogDescription",s_=m.forwardRef((e,t)=>{const{__scopeDialog:a,...i}=e,l=Ya(o_,a);return o.jsx(at.p,{id:l.descriptionId,...i,ref:t})});s_.displayName=o_;var l_="DialogClose",c_=m.forwardRef((e,t)=>{const{__scopeDialog:a,...i}=e,l=Ya(l_,a);return o.jsx(at.button,{type:"button",...i,ref:t,onClick:Re(e.onClick,()=>l.onOpenChange(!1))})});c_.displayName=l_;function Eg(e){return e?"open":"closed"}var u_="DialogTitleWarning",[m3,d_]=CM(u_,{contentName:no,titleName:Cg,docsSlug:"dialog"}),g3=({titleId:e})=>{const t=d_(u_),a=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
|
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
|
|
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return m.useEffect(()=>{e&&(document.getElementById(e)||console.error(a))},[a,e]),null},y3="DialogDescriptionWarning",v3=({contentRef:e,descriptionId:t})=>{const i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${d_(y3).contentName}}.`;return m.useEffect(()=>{const l=e.current?.getAttribute("aria-describedby");t&&l&&(document.getElementById(t)||console.warn(i))},[i,e,t]),null},of=Q1,f_=W1,sf=t_,lf=n_,cf=a_,Rg=i_,Ng=s_,mc=c_,x3=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ji=x3.reduce((e,t)=>{const a=lc(`Primitive.${t}`),i=m.forwardRef((l,u)=>{const{asChild:d,...f}=l,g=d?a:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(g,{...f,ref:u})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{}),Ol='[cmdk-group=""]',am='[cmdk-group-items=""]',b3='[cmdk-group-heading=""]',h_='[cmdk-item=""]',l0=`${h_}:not([aria-disabled="true"])`,Pm="cmdk-item-select",ss="data-value",w3=(e,t,a)=>u4(e,t,a),p_=m.createContext(void 0),gc=()=>m.useContext(p_),m_=m.createContext(void 0),Og=()=>m.useContext(m_),g_=m.createContext(void 0),y_=m.forwardRef((e,t)=>{let a=ls(()=>{var H,Y;return{search:"",value:(Y=(H=e.value)!=null?H:e.defaultValue)!=null?Y:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),i=ls(()=>new Set),l=ls(()=>new Map),u=ls(()=>new Map),d=ls(()=>new Set),f=v_(e),{label:g,children:y,value:x,onValueChange:v,filter:w,shouldFilter:_,loop:R,disablePointerSelection:S=!1,vimBindings:A=!0,...M}=e,T=Cn(),N=Cn(),E=Cn(),D=m.useRef(null),I=D3();ao(()=>{if(x!==void 0){let H=x.trim();a.current.value=H,U.emit()}},[x]),ao(()=>{I(6,le)},[]);let U=m.useMemo(()=>({subscribe:H=>(d.current.add(H),()=>d.current.delete(H)),snapshot:()=>a.current,setState:(H,Y,oe)=>{var se,we,ee,Se;if(!Object.is(a.current[H],Y)){if(a.current[H]=Y,H==="search")ne(),ge(),I(1,he);else if(H==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let De=document.getElementById(E);De?De.focus():(se=document.getElementById(T))==null||se.focus()}if(I(7,()=>{var De;a.current.selectedItemId=(De=ce())==null?void 0:De.id,U.emit()}),oe||I(5,le),((we=f.current)==null?void 0:we.value)!==void 0){let De=Y??"";(Se=(ee=f.current).onValueChange)==null||Se.call(ee,De);return}}U.emit()}},emit:()=>{d.current.forEach(H=>H())}}),[]),F=m.useMemo(()=>({value:(H,Y,oe)=>{var se;Y!==((se=u.current.get(H))==null?void 0:se.value)&&(u.current.set(H,{value:Y,keywords:oe}),a.current.filtered.items.set(H,fe(Y,oe)),I(2,()=>{ge(),U.emit()}))},item:(H,Y)=>(i.current.add(H),Y&&(l.current.has(Y)?l.current.get(Y).add(H):l.current.set(Y,new Set([H]))),I(3,()=>{ne(),ge(),a.current.value||he(),U.emit()}),()=>{u.current.delete(H),i.current.delete(H),a.current.filtered.items.delete(H);let oe=ce();I(4,()=>{ne(),oe?.getAttribute("id")===H&&he(),U.emit()})}),group:H=>(l.current.has(H)||l.current.set(H,new Set),()=>{u.current.delete(H),l.current.delete(H)}),filter:()=>f.current.shouldFilter,label:g||e["aria-label"],getDisablePointerSelection:()=>f.current.disablePointerSelection,listId:T,inputId:E,labelId:N,listInnerRef:D}),[]);function fe(H,Y){var oe,se;let we=(se=(oe=f.current)==null?void 0:oe.filter)!=null?se:w3;return H?we(H,a.current.search,Y):0}function ge(){if(!a.current.search||f.current.shouldFilter===!1)return;let H=a.current.filtered.items,Y=[];a.current.filtered.groups.forEach(se=>{let we=l.current.get(se),ee=0;we.forEach(Se=>{let De=H.get(Se);ee=Math.max(De,ee)}),Y.push([se,ee])});let oe=D.current;ve().sort((se,we)=>{var ee,Se;let De=se.getAttribute("id"),He=we.getAttribute("id");return((ee=H.get(He))!=null?ee:0)-((Se=H.get(De))!=null?Se:0)}).forEach(se=>{let we=se.closest(am);we?we.appendChild(se.parentElement===we?se:se.closest(`${am} > *`)):oe.appendChild(se.parentElement===oe?se:se.closest(`${am} > *`))}),Y.sort((se,we)=>we[1]-se[1]).forEach(se=>{var we;let ee=(we=D.current)==null?void 0:we.querySelector(`${Ol}[${ss}="${encodeURIComponent(se[0])}"]`);ee?.parentElement.appendChild(ee)})}function he(){let H=ve().find(oe=>oe.getAttribute("aria-disabled")!=="true"),Y=H?.getAttribute(ss);U.setState("value",Y||void 0)}function ne(){var H,Y,oe,se;if(!a.current.search||f.current.shouldFilter===!1){a.current.filtered.count=i.current.size;return}a.current.filtered.groups=new Set;let we=0;for(let ee of i.current){let Se=(Y=(H=u.current.get(ee))==null?void 0:H.value)!=null?Y:"",De=(se=(oe=u.current.get(ee))==null?void 0:oe.keywords)!=null?se:[],He=fe(Se,De);a.current.filtered.items.set(ee,He),He>0&&we++}for(let[ee,Se]of l.current)for(let De of Se)if(a.current.filtered.items.get(De)>0){a.current.filtered.groups.add(ee);break}a.current.filtered.count=we}function le(){var H,Y,oe;let se=ce();se&&(((H=se.parentElement)==null?void 0:H.firstChild)===se&&((oe=(Y=se.closest(Ol))==null?void 0:Y.querySelector(b3))==null||oe.scrollIntoView({block:"nearest"})),se.scrollIntoView({block:"nearest"}))}function ce(){var H;return(H=D.current)==null?void 0:H.querySelector(`${h_}[aria-selected="true"]`)}function ve(){var H;return Array.from(((H=D.current)==null?void 0:H.querySelectorAll(l0))||[])}function O(H){let Y=ve()[H];Y&&U.setState("value",Y.getAttribute(ss))}function j(H){var Y;let oe=ce(),se=ve(),we=se.findIndex(Se=>Se===oe),ee=se[we+H];(Y=f.current)!=null&&Y.loop&&(ee=we+H<0?se[se.length-1]:we+H===se.length?se[0]:se[we+H]),ee&&U.setState("value",ee.getAttribute(ss))}function z(H){let Y=ce(),oe=Y?.closest(Ol),se;for(;oe&&!se;)oe=H>0?A3(oe,Ol):T3(oe,Ol),se=oe?.querySelector(l0);se?U.setState("value",se.getAttribute(ss)):j(H)}let J=()=>O(ve().length-1),me=H=>{H.preventDefault(),H.metaKey?J():H.altKey?z(1):j(1)},Te=H=>{H.preventDefault(),H.metaKey?O(0):H.altKey?z(-1):j(-1)};return m.createElement(ji.div,{ref:t,tabIndex:-1,...M,"cmdk-root":"",onKeyDown:H=>{var Y;(Y=M.onKeyDown)==null||Y.call(M,H);let oe=H.nativeEvent.isComposing||H.keyCode===229;if(!(H.defaultPrevented||oe))switch(H.key){case"n":case"j":{A&&H.ctrlKey&&me(H);break}case"ArrowDown":{me(H);break}case"p":case"k":{A&&H.ctrlKey&&Te(H);break}case"ArrowUp":{Te(H);break}case"Home":{H.preventDefault(),O(0);break}case"End":{H.preventDefault(),J();break}case"Enter":{H.preventDefault();let se=ce();if(se){let we=new Event(Pm);se.dispatchEvent(we)}}}}},m.createElement("label",{"cmdk-label":"",htmlFor:F.inputId,id:F.labelId,style:k3},g),uf(e,H=>m.createElement(m_.Provider,{value:U},m.createElement(p_.Provider,{value:F},H))))}),S3=m.forwardRef((e,t)=>{var a,i;let l=Cn(),u=m.useRef(null),d=m.useContext(g_),f=gc(),g=v_(e),y=(i=(a=g.current)==null?void 0:a.forceMount)!=null?i:d?.forceMount;ao(()=>{if(!y)return f.item(l,d?.id)},[y]);let x=x_(l,u,[e.value,e.children,u],e.keywords),v=Og(),w=bi(I=>I.value&&I.value===x.current),_=bi(I=>y||f.filter()===!1?!0:I.search?I.filtered.items.get(l)>0:!0);m.useEffect(()=>{let I=u.current;if(!(!I||e.disabled))return I.addEventListener(Pm,R),()=>I.removeEventListener(Pm,R)},[_,e.onSelect,e.disabled]);function R(){var I,U;S(),(U=(I=g.current).onSelect)==null||U.call(I,x.current)}function S(){v.setState("value",x.current,!0)}if(!_)return null;let{disabled:A,value:M,onSelect:T,forceMount:N,keywords:E,...D}=e;return m.createElement(ji.div,{ref:Mn(u,t),...D,id:l,"cmdk-item":"",role:"option","aria-disabled":!!A,"aria-selected":!!w,"data-disabled":!!A,"data-selected":!!w,onPointerMove:A||f.getDisablePointerSelection()?void 0:S,onClick:A?void 0:R},e.children)}),_3=m.forwardRef((e,t)=>{let{heading:a,children:i,forceMount:l,...u}=e,d=Cn(),f=m.useRef(null),g=m.useRef(null),y=Cn(),x=gc(),v=bi(_=>l||x.filter()===!1?!0:_.search?_.filtered.groups.has(d):!0);ao(()=>x.group(d),[]),x_(d,f,[e.value,e.heading,g]);let w=m.useMemo(()=>({id:d,forceMount:l}),[l]);return m.createElement(ji.div,{ref:Mn(f,t),...u,"cmdk-group":"",role:"presentation",hidden:v?void 0:!0},a&&m.createElement("div",{ref:g,"cmdk-group-heading":"","aria-hidden":!0,id:y},a),uf(e,_=>m.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":a?y:void 0},m.createElement(g_.Provider,{value:w},_))))}),j3=m.forwardRef((e,t)=>{let{alwaysRender:a,...i}=e,l=m.useRef(null),u=bi(d=>!d.search);return!a&&!u?null:m.createElement(ji.div,{ref:Mn(l,t),...i,"cmdk-separator":"",role:"separator"})}),C3=m.forwardRef((e,t)=>{let{onValueChange:a,...i}=e,l=e.value!=null,u=Og(),d=bi(y=>y.search),f=bi(y=>y.selectedItemId),g=gc();return m.useEffect(()=>{e.value!=null&&u.setState("search",e.value)},[e.value]),m.createElement(ji.input,{ref:t,...i,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":g.listId,"aria-labelledby":g.labelId,"aria-activedescendant":f,id:g.inputId,type:"text",value:l?e.value:d,onChange:y=>{l||u.setState("search",y.target.value),a?.(y.target.value)}})}),E3=m.forwardRef((e,t)=>{let{children:a,label:i="Suggestions",...l}=e,u=m.useRef(null),d=m.useRef(null),f=bi(y=>y.selectedItemId),g=gc();return m.useEffect(()=>{if(d.current&&u.current){let y=d.current,x=u.current,v,w=new ResizeObserver(()=>{v=requestAnimationFrame(()=>{let _=y.offsetHeight;x.style.setProperty("--cmdk-list-height",_.toFixed(1)+"px")})});return w.observe(y),()=>{cancelAnimationFrame(v),w.unobserve(y)}}},[]),m.createElement(ji.div,{ref:Mn(u,t),...l,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":f,"aria-label":i,id:g.listId},uf(e,y=>m.createElement("div",{ref:Mn(d,g.listInnerRef),"cmdk-list-sizer":""},y)))}),R3=m.forwardRef((e,t)=>{let{open:a,onOpenChange:i,overlayClassName:l,contentClassName:u,container:d,...f}=e;return m.createElement(of,{open:a,onOpenChange:i},m.createElement(sf,{container:d},m.createElement(lf,{"cmdk-overlay":"",className:l}),m.createElement(cf,{"aria-label":e.label,"cmdk-dialog":"",className:u},m.createElement(y_,{ref:t,...f}))))}),N3=m.forwardRef((e,t)=>bi(a=>a.filtered.count===0)?m.createElement(ji.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),O3=m.forwardRef((e,t)=>{let{progress:a,children:i,label:l="Loading...",...u}=e;return m.createElement(ji.div,{ref:t,...u,"cmdk-loading":"",role:"progressbar","aria-valuenow":a,"aria-valuemin":0,"aria-valuemax":100,"aria-label":l},uf(e,d=>m.createElement("div",{"aria-hidden":!0},d)))}),ks=Object.assign(y_,{List:E3,Item:S3,Input:C3,Group:_3,Separator:j3,Dialog:R3,Empty:N3,Loading:O3});function A3(e,t){let a=e.nextElementSibling;for(;a;){if(a.matches(t))return a;a=a.nextElementSibling}}function T3(e,t){let a=e.previousElementSibling;for(;a;){if(a.matches(t))return a;a=a.previousElementSibling}}function v_(e){let t=m.useRef(e);return ao(()=>{t.current=e}),t}var ao=typeof window>"u"?m.useEffect:m.useLayoutEffect;function ls(e){let t=m.useRef();return t.current===void 0&&(t.current=e()),t}function bi(e){let t=Og(),a=()=>e(t.snapshot());return m.useSyncExternalStore(t.subscribe,a,a)}function x_(e,t,a,i=[]){let l=m.useRef(),u=gc();return ao(()=>{var d;let f=(()=>{var y;for(let x of a){if(typeof x=="string")return x.trim();if(typeof x=="object"&&"current"in x)return x.current?(y=x.current.textContent)==null?void 0:y.trim():l.current}})(),g=i.map(y=>y.trim());u.value(e,f,g),(d=t.current)==null||d.setAttribute(ss,f),l.current=f}),l}var D3=()=>{let[e,t]=m.useState(),a=ls(()=>new Map);return ao(()=>{a.current.forEach(i=>i()),a.current=new Map},[e]),(i,l)=>{a.current.set(i,l),t({})}};function M3(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function uf({asChild:e,children:t},a){return e&&m.isValidElement(t)?m.cloneElement(M3(t),{ref:t.ref},a(t.props.children)):a(t)}var k3={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function bt({...e}){return o.jsx(of,{"data-slot":"dialog",...e})}function Xa({...e}){return o.jsx(f_,{"data-slot":"dialog-trigger",...e})}function z3({...e}){return o.jsx(sf,{"data-slot":"dialog-portal",...e})}function Ad({...e}){return o.jsx(mc,{"data-slot":"dialog-close",...e})}function P3({className:e,...t}){return o.jsx(lf,{"data-slot":"dialog-overlay",className:de("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),...t})}function wt({className:e,children:t,showCloseButton:a=!0,...i}){return o.jsxs(z3,{"data-slot":"dialog-portal",children:[o.jsx(P3,{}),o.jsxs(cf,{"data-slot":"dialog-content",className:de("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),...i,children:[t,a&&o.jsxs(mc,{"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:[o.jsx(cg,{}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function St({className:e,...t}){return o.jsx("div",{"data-slot":"dialog-header",className:de("flex flex-col gap-2 text-center sm:text-left",e),...t})}function Nt({className:e,...t}){return o.jsx("div",{"data-slot":"dialog-footer",className:de("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function _t({className:e,...t}){return o.jsx(Rg,{"data-slot":"dialog-title",className:de("text-lg leading-none font-semibold",e),...t})}function rm({className:e,...t}){return o.jsx(Ng,{"data-slot":"dialog-description",className:de("text-muted-foreground text-sm",e),...t})}function K3({className:e,...t}){return o.jsx(ks,{"data-slot":"command",className:de("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}function I3({className:e,...t}){return o.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[o.jsx(dr,{className:"size-4 shrink-0 opacity-50"}),o.jsx(ks.Input,{"data-slot":"command-input",className:de("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),...t})]})}function L3({className:e,...t}){return o.jsx(ks.List,{"data-slot":"command-list",className:de("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function U3({...e}){return o.jsx(ks.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function q3({className:e,...t}){return o.jsx(ks.Group,{"data-slot":"command-group",className:de("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),...t})}function F3({className:e,...t}){return o.jsx(ks.Item,{"data-slot":"command-item",className:de("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),...t})}function $3(e){const t=V3(e),a=m.forwardRef((i,l)=>{const{children:u,...d}=i,f=m.Children.toArray(u),g=f.find(G3);if(g){const y=g.props.children,x=f.map(v=>v===g?m.Children.count(y)>1?m.Children.only(null):m.isValidElement(y)?y.props.children:null:v);return o.jsx(t,{...d,ref:l,children:m.isValidElement(y)?m.cloneElement(y,void 0,x):null})}return o.jsx(t,{...d,ref:l,children:u})});return a.displayName=`${e}.Slot`,a}function V3(e){const t=m.forwardRef((a,i)=>{const{children:l,...u}=a;if(m.isValidElement(l)){const d=X3(l),f=H3(u,l.props);return l.type!==m.Fragment&&(f.ref=i?Mn(i,d):d),m.cloneElement(l,f)}return m.Children.count(l)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var B3=Symbol("radix.slottable");function G3(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===B3}function H3(e,t){const a={...t};for(const i in t){const l=e[i],u=t[i];/^on[A-Z]/.test(i)?l&&u?a[i]=(...f)=>{const g=u(...f);return l(...f),g}:l&&(a[i]=l):i==="style"?a[i]={...l,...u}:i==="className"&&(a[i]=[l,u].filter(Boolean).join(" "))}return{...e,...a}}function X3(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning;return a?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var df="Popover",[b_]=Za(df,[_i]),yc=_i(),[Z3,Ci]=b_(df),w_=e=>{const{__scopePopover:t,children:a,open:i,defaultOpen:l,onOpenChange:u,modal:d=!1}=e,f=yc(t),g=m.useRef(null),[y,x]=m.useState(!1),[v,w]=xi({prop:i,defaultProp:l??!1,onChange:u,caller:df});return o.jsx(Yd,{...f,children:o.jsx(Z3,{scope:t,contentId:Cn(),triggerRef:g,open:v,onOpenChange:w,onOpenToggle:m.useCallback(()=>w(_=>!_),[w]),hasCustomAnchor:y,onCustomAnchorAdd:m.useCallback(()=>x(!0),[]),onCustomAnchorRemove:m.useCallback(()=>x(!1),[]),modal:d,children:a})})};w_.displayName=df;var S_="PopoverAnchor",Y3=m.forwardRef((e,t)=>{const{__scopePopover:a,...i}=e,l=Ci(S_,a),u=yc(a),{onCustomAnchorAdd:d,onCustomAnchorRemove:f}=l;return m.useEffect(()=>(d(),()=>f()),[d,f]),o.jsx(uc,{...u,...i,ref:t})});Y3.displayName=S_;var __="PopoverTrigger",j_=m.forwardRef((e,t)=>{const{__scopePopover:a,...i}=e,l=Ci(__,a),u=yc(a),d=dt(t,l.triggerRef),f=o.jsx(at.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":O_(l.open),...i,ref:d,onClick:Re(e.onClick,l.onOpenToggle)});return l.hasCustomAnchor?f:o.jsx(uc,{asChild:!0,...u,children:f})});j_.displayName=__;var Ag="PopoverPortal",[Q3,J3]=b_(Ag,{forceMount:void 0}),C_=e=>{const{__scopePopover:t,forceMount:a,children:i,container:l}=e,u=Ci(Ag,t);return o.jsx(Q3,{scope:t,forceMount:a,children:o.jsx(Oa,{present:a||u.open,children:o.jsx(Ms,{asChild:!0,container:l,children:i})})})};C_.displayName=Ag;var js="PopoverContent",E_=m.forwardRef((e,t)=>{const a=J3(js,e.__scopePopover),{forceMount:i=a.forceMount,...l}=e,u=Ci(js,e.__scopePopover);return o.jsx(Oa,{present:i||u.open,children:u.modal?o.jsx(e5,{...l,ref:t}):o.jsx(t5,{...l,ref:t})})});E_.displayName=js;var W3=$3("PopoverContent.RemoveScroll"),e5=m.forwardRef((e,t)=>{const a=Ci(js,e.__scopePopover),i=m.useRef(null),l=dt(t,i),u=m.useRef(!1);return m.useEffect(()=>{const d=i.current;if(d)return af(d)},[]),o.jsx(pc,{as:W3,allowPinchZoom:!0,children:o.jsx(R_,{...e,ref:l,trapFocus:a.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Re(e.onCloseAutoFocus,d=>{d.preventDefault(),u.current||a.triggerRef.current?.focus()}),onPointerDownOutside:Re(e.onPointerDownOutside,d=>{const f=d.detail.originalEvent,g=f.button===0&&f.ctrlKey===!0,y=f.button===2||g;u.current=y},{checkForDefaultPrevented:!1}),onFocusOutside:Re(e.onFocusOutside,d=>d.preventDefault(),{checkForDefaultPrevented:!1})})})}),t5=m.forwardRef((e,t)=>{const a=Ci(js,e.__scopePopover),i=m.useRef(!1),l=m.useRef(!1);return o.jsx(R_,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:u=>{e.onCloseAutoFocus?.(u),u.defaultPrevented||(i.current||a.triggerRef.current?.focus(),u.preventDefault()),i.current=!1,l.current=!1},onInteractOutside:u=>{e.onInteractOutside?.(u),u.defaultPrevented||(i.current=!0,u.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const d=u.target;a.triggerRef.current?.contains(d)&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&l.current&&u.preventDefault()}})}),R_=m.forwardRef((e,t)=>{const{__scopePopover:a,trapFocus:i,onOpenAutoFocus:l,onCloseAutoFocus:u,disableOutsidePointerEvents:d,onEscapeKeyDown:f,onPointerDownOutside:g,onFocusOutside:y,onInteractOutside:x,...v}=e,w=Ci(js,a),_=yc(a);return tf(),o.jsx(hc,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:l,onUnmountAutoFocus:u,children:o.jsx(As,{asChild:!0,disableOutsidePointerEvents:d,onInteractOutside:x,onEscapeKeyDown:f,onPointerDownOutside:g,onFocusOutside:y,onDismiss:()=>w.onOpenChange(!1),children:o.jsx(Qd,{"data-state":O_(w.open),role:"dialog",id:w.contentId,..._,...v,ref:t,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)"}})})})}),N_="PopoverClose",n5=m.forwardRef((e,t)=>{const{__scopePopover:a,...i}=e,l=Ci(N_,a);return o.jsx(at.button,{type:"button",...i,ref:t,onClick:Re(e.onClick,()=>l.onOpenChange(!1))})});n5.displayName=N_;var a5="PopoverArrow",r5=m.forwardRef((e,t)=>{const{__scopePopover:a,...i}=e,l=yc(a);return o.jsx(Jd,{...l,...i,ref:t})});r5.displayName=a5;function O_(e){return e?"open":"closed"}var i5=w_,o5=j_,s5=C_,l5=E_;function c5({...e}){return o.jsx(i5,{"data-slot":"popover",...e})}function u5({...e}){return o.jsx(o5,{"data-slot":"popover-trigger",...e})}function d5({className:e,align:t="center",sideOffset:a=4,...i}){return o.jsx(s5,{children:o.jsx(l5,{"data-slot":"popover-content",align:t,sideOffset:a,className:de("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),...i})})}const f5=({orgs:e})=>{const[t,a]=m.useState(!1),[i,l]=m.useState(qa.get()??"");m.useEffect(()=>qa.subscribe(d=>l(d??"")),[]);const u=e.find(d=>d.id===i);return o.jsxs(c5,{open:t,onOpenChange:a,children:[o.jsx(u5,{asChild:!0,children:o.jsxs(ie,{variant:"ghost",className:"h-9 w-full justify-between px-2","aria-label":"Switch organization",children:[o.jsxs("span",{className:"flex items-center gap-2 truncate",children:[o.jsx(ES,{className:"h-4 w-4"}),o.jsx("span",{className:"truncate",children:u?.name??"Select org"})]}),o.jsx(KO,{className:"ml-2 h-4 w-4 opacity-50"})]})}),o.jsx(d5,{className:"w-[280px] p-0",align:"start",children:o.jsxs(K3,{children:[o.jsx(I3,{placeholder:"Search orgs..."}),o.jsxs(L3,{children:[o.jsx(U3,{children:"No orgs found."}),o.jsx(q3,{heading:"Organizations",children:e.map(d=>o.jsxs(F3,{value:d.id,onSelect:f=>{qa.set(f),a(!1)},children:[o.jsx(RS,{className:de("mr-2 h-4 w-4",i===d.id?"opacity-100":"opacity-0")}),o.jsx("span",{className:"truncate",children:d.name})]},d.id))})]})]})})]})};function h5(){return Zt({queryKey:["me"],queryFn:()=>Zi.getMe(),staleTime:300*1e3})}function p5(e,t=[]){let a=[];function i(u,d){const f=m.createContext(d);f.displayName=u+"Context";const g=a.length;a=[...a,d];const y=v=>{const{scope:w,children:_,...R}=v,S=w?.[e]?.[g]||f,A=m.useMemo(()=>R,Object.values(R));return o.jsx(S.Provider,{value:A,children:_})};y.displayName=u+"Provider";function x(v,w){const _=w?.[e]?.[g]||f,R=m.useContext(_);if(R)return R;if(d!==void 0)return d;throw new Error(`\`${v}\` must be used within \`${u}\``)}return[y,x]}const l=()=>{const u=a.map(d=>m.createContext(d));return function(f){const g=f?.[e]||u;return m.useMemo(()=>({[`__scope${e}`]:{...f,[e]:g}}),[f,g])}};return l.scopeName=e,[i,m5(l,...t)]}function m5(...e){const t=e[0];if(e.length===1)return t;const a=()=>{const i=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(u){const d=i.reduce((f,{useScope:g,scopeName:y})=>{const v=g(u)[`__scope${y}`];return{...f,...v}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:d}),[d])}};return a.scopeName=t.scopeName,a}var g5=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Tg=g5.reduce((e,t)=>{const a=lc(`Primitive.${t}`),i=m.forwardRef((l,u)=>{const{asChild:d,...f}=l,g=d?a:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(g,{...f,ref:u})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{}),im={exports:{}},om={};var c0;function y5(){if(c0)return om;c0=1;var e=dS();function t(v,w){return v===w&&(v!==0||1/v===1/w)||v!==v&&w!==w}var a=typeof Object.is=="function"?Object.is:t,i=e.useState,l=e.useEffect,u=e.useLayoutEffect,d=e.useDebugValue;function f(v,w){var _=w(),R=i({inst:{value:_,getSnapshot:w}}),S=R[0].inst,A=R[1];return u(function(){S.value=_,S.getSnapshot=w,g(S)&&A({inst:S})},[v,_,w]),l(function(){return g(S)&&A({inst:S}),v(function(){g(S)&&A({inst:S})})},[v]),d(_),_}function g(v){var w=v.getSnapshot;v=v.value;try{var _=w();return!a(v,_)}catch{return!0}}function y(v,w){return w()}var x=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?y:f;return om.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:x,om}var u0;function v5(){return u0||(u0=1,im.exports=y5()),im.exports}var x5=v5();function b5(){return x5.useSyncExternalStore(w5,()=>!0,()=>!1)}function w5(){return()=>{}}var Dg="Avatar",[S5]=p5(Dg),[_5,A_]=S5(Dg),T_=m.forwardRef((e,t)=>{const{__scopeAvatar:a,...i}=e,[l,u]=m.useState("idle");return o.jsx(_5,{scope:a,imageLoadingStatus:l,onImageLoadingStatusChange:u,children:o.jsx(Tg.span,{...i,ref:t})})});T_.displayName=Dg;var D_="AvatarImage",j5=m.forwardRef((e,t)=>{const{__scopeAvatar:a,src:i,onLoadingStatusChange:l=()=>{},...u}=e,d=A_(D_,a),f=C5(i,u),g=Ba(y=>{l(y),d.onImageLoadingStatusChange(y)});return hn(()=>{f!=="idle"&&g(f)},[f,g]),f==="loaded"?o.jsx(Tg.img,{...u,ref:t,src:i}):null});j5.displayName=D_;var M_="AvatarFallback",k_=m.forwardRef((e,t)=>{const{__scopeAvatar:a,delayMs:i,...l}=e,u=A_(M_,a),[d,f]=m.useState(i===void 0);return m.useEffect(()=>{if(i!==void 0){const g=window.setTimeout(()=>f(!0),i);return()=>window.clearTimeout(g)}},[i]),d&&u.imageLoadingStatus!=="loaded"?o.jsx(Tg.span,{...l,ref:t}):null});k_.displayName=M_;function d0(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function C5(e,{referrerPolicy:t,crossOrigin:a}){const i=b5(),l=m.useRef(null),u=i?(l.current||(l.current=new window.Image),l.current):null,[d,f]=m.useState(()=>d0(u,e));return hn(()=>{f(d0(u,e))},[u,e]),hn(()=>{const g=v=>()=>{f(v)};if(!u)return;const y=g("loaded"),x=g("error");return u.addEventListener("load",y),u.addEventListener("error",x),t&&(u.referrerPolicy=t),typeof a=="string"&&(u.crossOrigin=a),()=>{u.removeEventListener("load",y),u.removeEventListener("error",x)}},[u,a,t]),d}var E5=T_,R5=k_;function N5({className:e,...t}){return o.jsx(E5,{"data-slot":"avatar",className:de("relative flex size-8 shrink-0 overflow-hidden rounded-full",e),...t})}function O5({className:e,...t}){return o.jsx(R5,{"data-slot":"avatar-fallback",className:de("bg-muted flex size-full items-center justify-center rounded-full",e),...t})}function A5({...e}){return o.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function T5({className:e,...t}){return o.jsx("ol",{"data-slot":"breadcrumb-list",className:de("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",e),...t})}function f0({className:e,...t}){return o.jsx("li",{"data-slot":"breadcrumb-item",className:de("inline-flex items-center gap-1.5",e),...t})}function h0({asChild:e,className:t,...a}){const i=e?Rs:"a";return o.jsx(i,{"data-slot":"breadcrumb-link",className:de("hover:text-foreground transition-colors",t),...a})}function D5({className:e,...t}){return o.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:de("text-foreground font-normal",e),...t})}function M5({children:e,className:t,...a}){return o.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:de("[&>svg]:size-3.5",t),...a,children:e??o.jsx(MO,{})})}const sm=768;function k5(){const[e,t]=m.useState(void 0);return m.useEffect(()=>{const a=window.matchMedia(`(max-width: ${sm-1}px)`),i=()=>{t(window.innerWidth<sm)};return a.addEventListener("change",i),t(window.innerWidth<sm),()=>a.removeEventListener("change",i)},[]),!!e}function Ae({className:e,type:t,...a}){return o.jsx("input",{type:t,"data-slot":"input",className:de("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),...a})}function z5({...e}){return o.jsx(of,{"data-slot":"sheet",...e})}function P5({...e}){return o.jsx(sf,{"data-slot":"sheet-portal",...e})}function K5({className:e,...t}){return o.jsx(lf,{"data-slot":"sheet-overlay",className:de("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),...t})}function I5({className:e,children:t,side:a="right",...i}){return o.jsxs(P5,{children:[o.jsx(K5,{}),o.jsxs(cf,{"data-slot":"sheet-content",className:de("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",a==="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",a==="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",a==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",a==="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),...i,children:[t,o.jsxs(mc,{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:[o.jsx(cg,{className:"size-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function L5({className:e,...t}){return o.jsx("div",{"data-slot":"sheet-header",className:de("flex flex-col gap-1.5 p-4",e),...t})}function U5({className:e,...t}){return o.jsx(Rg,{"data-slot":"sheet-title",className:de("text-foreground font-semibold",e),...t})}function q5({className:e,...t}){return o.jsx(Ng,{"data-slot":"sheet-description",className:de("text-muted-foreground text-sm",e),...t})}const F5="sidebar_state",$5=3600*24*7,V5="16rem",B5="18rem",G5="3rem",H5="b",z_=m.createContext(null);function Mg(){const e=m.useContext(z_);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function X5({defaultOpen:e=!0,open:t,onOpenChange:a,className:i,style:l,children:u,...d}){const f=k5(),[g,y]=m.useState(!1),[x,v]=m.useState(e),w=t??x,_=m.useCallback(M=>{const T=typeof M=="function"?M(w):M;a?a(T):v(T),document.cookie=`${F5}=${T}; path=/; max-age=${$5}`},[a,w]),R=m.useCallback(()=>f?y(M=>!M):_(M=>!M),[f,_,y]);m.useEffect(()=>{const M=T=>{T.key===H5&&(T.metaKey||T.ctrlKey)&&(T.preventDefault(),R())};return window.addEventListener("keydown",M),()=>window.removeEventListener("keydown",M)},[R]);const S=w?"expanded":"collapsed",A=m.useMemo(()=>({state:S,open:w,setOpen:_,isMobile:f,openMobile:g,setOpenMobile:y,toggleSidebar:R}),[S,w,_,f,g,y,R]);return o.jsx(z_.Provider,{value:A,children:o.jsx(fc,{delayDuration:0,children:o.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":V5,"--sidebar-width-icon":G5,...l},className:de("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",i),...d,children:u})})})}function Z5({side:e="left",variant:t="sidebar",collapsible:a="offcanvas",className:i,children:l,...u}){const{isMobile:d,state:f,openMobile:g,setOpenMobile:y}=Mg();return a==="none"?o.jsx("div",{"data-slot":"sidebar",className:de("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",i),...u,children:l}):d?o.jsx(z5,{open:g,onOpenChange:y,...u,children:o.jsxs(I5,{"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":B5},side:e,children:[o.jsxs(L5,{className:"sr-only",children:[o.jsx(U5,{children:"Sidebar"}),o.jsx(q5,{children:"Displays the mobile sidebar."})]}),o.jsx("div",{className:"flex h-full w-full flex-col",children:l})]})}):o.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":f,"data-collapsible":f==="collapsed"?a:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[o.jsx("div",{"data-slot":"sidebar-gap",className:de("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),o.jsx("div",{"data-slot":"sidebar-container",className:de("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)]",t==="floating"||t==="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",i),...u,children:o.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:l})})]})}function Y5({className:e,onClick:t,...a}){const{toggleSidebar:i}=Mg();return o.jsxs(ie,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:de("size-7",e),onClick:l=>{t?.(l),i()},...a,children:[o.jsx(d2,{}),o.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function Q5({className:e,...t}){return o.jsx("main",{"data-slot":"sidebar-inset",className:de("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),...t})}function J5({className:e,...t}){return o.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:de("flex flex-col gap-2 p-2",e),...t})}function W5({className:e,...t}){return o.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:de("flex flex-col gap-2 p-2",e),...t})}function e6({className:e,...t}){return o.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:de("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function Qu({className:e,...t}){return o.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:de("relative flex w-full min-w-0 flex-col p-2",e),...t})}function Ju({className:e,asChild:t=!1,...a}){const i=t?Rs:"div";return o.jsx(i,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:de("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),...a})}function Wu({className:e,...t}){return o.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:de("w-full text-sm",e),...t})}function ed({className:e,...t}){return o.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:de("flex w-full min-w-0 flex-col gap-1",e),...t})}function td({className:e,...t}){return o.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:de("group/menu-item relative",e),...t})}const t6=dg("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 nd({asChild:e=!1,isActive:t=!1,variant:a="default",size:i="default",tooltip:l,className:u,...d}){const f=e?Rs:"button",{isMobile:g,state:y}=Mg(),x=o.jsx(f,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":i,"data-active":t,className:de(t6({variant:a,size:i}),u),...d});return l?(typeof l=="string"&&(l={children:l}),o.jsxs(jd,{children:[o.jsx(Cd,{asChild:!0,children:x}),o.jsx(Ed,{side:"right",align:"center",hidden:y!=="collapsed"||g,...l})]})):x}const n6=()=>{const e=tg(),{data:t,isLoading:a}=h5(),i=m.useMemo(()=>{const u=e.pathname.split("/").filter(Boolean),d=[];let f="";for(const g of u)f+=`/${g}`,d.push({to:f,label:g});return d},[e.pathname]),l=m.useMemo(()=>{if(!t)return"U";const d=(t.display_name||t.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"},[t]);return o.jsxs("div",{className:"flex h-12 items-center gap-2 border-b px-3",children:[o.jsx(Y5,{}),o.jsx("div",{className:"flex-1",children:o.jsx(A5,{children:o.jsxs(T5,{children:[o.jsx(f0,{children:o.jsx(h0,{asChild:!0,children:o.jsx(Kp,{to:"/",children:"Home"})})}),i.map((u,d)=>o.jsxs("span",{className:"flex items-center",children:[o.jsx(M5,{}),o.jsx(f0,{children:d===i.length-1?o.jsx(D5,{className:"capitalize",children:u.label}):o.jsx(h0,{asChild:!0,children:o.jsx(Kp,{to:u.to,className:"capitalize",children:u.label})})})]},u.to))]})})}),o.jsx(ie,{variant:"ghost",size:"sm",asChild:!0,children:o.jsx(Kp,{to:"/me",children:a?"…":t?.display_name||"Profile"})}),o.jsx(N5,{className:"h-7 w-7",children:o.jsx(O5,{children:l})})]})};async function a6(){const e=jn.get();if(!e?.refresh_token){jn.logout();return}try{const t={refresh_token:e.refresh_token};await cD().logout({body:t})}catch(t){console.warn("Logout API failed; clearing local state anyway",t)}finally{jn.logout()}}function r6(){return{logout:m.useCallback(()=>a6(),[])}}const i6=()=>{const[e,t]=m.useState([]),{logout:a}=r6();return m.useEffect(()=>{let i=!0;return(async()=>{try{const u=((await Zi.getMe()).organizations??[]).map(d=>({id:d.id,name:d.name??d.id}));if(!i)return;t(u),!qa.get()&&u.length>0&&qa.set(u[0].id)}catch{}})(),()=>{i=!1}},[]),o.jsxs(X5,{defaultOpen:!0,children:[o.jsxs(Z5,{collapsible:"icon",variant:"floating",children:[o.jsx(J5,{children:o.jsx("div",{className:"px-2 py-2",children:o.jsx(f5,{orgs:e})})}),o.jsxs(e6,{children:[o.jsxs(Qu,{children:[o.jsx(Ju,{children:"Navigation"}),o.jsx(Wu,{children:o.jsx(ed,{children:Jz.map(i=>o.jsx(td,{children:o.jsx(nd,{asChild:!0,tooltip:i.label,children:o.jsxs(zu,{to:i.to,className:({isActive:l})=>de("flex items-center gap-2",l&&"text-primary"),children:[o.jsx(i.icon,{className:"h-4 w-4"}),o.jsx("span",{children:i.label})]})})},i.to))})})]}),o.jsxs(Qu,{children:[o.jsx(Ju,{children:"Organization"}),o.jsx(Wu,{children:o.jsx(ed,{children:Wz.map(i=>o.jsx(td,{children:o.jsx(nd,{asChild:!0,tooltip:i.label,children:o.jsxs(zu,{to:i.to,className:({isActive:l})=>de("flex items-center gap-2",l&&"text-primary"),children:[o.jsx(i.icon,{className:"h-4 w-4"}),o.jsx("span",{children:i.label})]})})},i.to))})})]}),o.jsxs(Qu,{children:[o.jsx(Ju,{children:"User"}),o.jsx(Wu,{children:o.jsx(ed,{children:e4.map(i=>o.jsx(td,{children:o.jsx(nd,{asChild:!0,tooltip:i.label,children:o.jsxs(zu,{to:i.to,className:({isActive:l})=>de("flex items-center gap-2",l&&"text-primary"),children:[o.jsx(i.icon,{className:"h-4 w-4"}),o.jsx("span",{children:i.label})]})})},i.to))})})]}),o.jsxs(Qu,{children:[o.jsx(Ju,{children:"Admin"}),o.jsx(Wu,{children:o.jsx(ed,{children:t4.map(i=>o.jsx(td,{children:o.jsx(nd,{asChild:!0,tooltip:i.label,children:o.jsxs(zu,{to:i.to,className:({isActive:l})=>de("flex items-center gap-2",l&&"text-primary"),children:[o.jsx(i.icon,{className:"h-4 w-4"}),o.jsx("span",{children:i.label})]})})},i.to))})})]})]}),o.jsx(W5,{children:o.jsx("div",{className:"px-2 py-2",children:o.jsx(ie,{variant:"ghost",size:"sm",className:"w-full",onClick:()=>void a(),children:"Sign out"})})})]}),o.jsxs(Q5,{className:"flex min-h-screen flex-col",children:[o.jsx(n6,{}),o.jsx("main",{className:"p-4",children:o.jsx(fS,{})}),o.jsx(Fz,{})]})]})},o6=()=>{const e=m.useSyncExternalStore(t=>jn.subscribe(t),()=>jn.get(),()=>jn.get());return{tokens:e,authed:!!e?.access_token,isExpired:jn.isExpired(),willExpireSoon:jn.willExpireSoon()}},s6=()=>{const{authed:e}=o6(),t=tg();return e?o.jsx(fS,{}):o.jsx(jN,{to:`/login?to=${encodeURIComponent(t.pathname+t.search)}`,replace:!0})},Al=gD(),$l={listAnnotations:()=>ze(async()=>await Al.listAnnotations()),createAnnotation:e=>ze(async()=>await Al.createAnnotation({body:e})),getAnnotation:e=>ze(async()=>await Al.getAnnotation({id:e})),deleteAnnotation:e=>ze(async()=>{await Al.deleteAnnotation({id:e})}),updateAnnotation:(e,t)=>ze(async()=>await Al.updateAnnotation({id:e,body:t}))},Tl=mD(),Vl={listLabels:()=>ze(async()=>await Tl.listLabels()),createLabel:e=>ze(async()=>await Tl.createLabel({body:e})),getLabel:e=>ze(async()=>await Tl.getLabel({id:e})),deleteLabel:e=>ze(async()=>{await Tl.deleteLabel({id:e})}),updateLabel:(e,t)=>ze(async()=>await Tl.updateLabel({id:e,body:t}))};var vc=e=>e.type==="checkbox",Qi=e=>e instanceof Date,Hn=e=>e==null;const P_=e=>typeof e=="object";var nn=e=>!Hn(e)&&!Array.isArray(e)&&P_(e)&&!Qi(e),K_=e=>nn(e)&&e.target?vc(e.target)?e.target.checked:e.target.value:e,l6=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,I_=(e,t)=>e.has(l6(t)),c6=e=>{const t=e.constructor&&e.constructor.prototype;return nn(t)&&t.hasOwnProperty("isPrototypeOf")},kg=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function ln(e){let t;const a=Array.isArray(e),i=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(kg&&(e instanceof Blob||i))&&(a||nn(e)))if(t=a?[]:Object.create(Object.getPrototypeOf(e)),!a&&!c6(e))t=e;else for(const l in e)e.hasOwnProperty(l)&&(t[l]=ln(e[l]));else return e;return t}var ff=e=>/^\w*$/.test(e),Bt=e=>e===void 0,zg=e=>Array.isArray(e)?e.filter(Boolean):[],Pg=e=>zg(e.replace(/["|']|\]/g,"").split(/\.|\[/)),_e=(e,t,a)=>{if(!t||!nn(e))return a;const i=(ff(t)?[t]:Pg(t)).reduce((l,u)=>Hn(l)?l:l[u],e);return Bt(i)||i===e?Bt(e[t])?a:e[t]:i},oa=e=>typeof e=="boolean",xt=(e,t,a)=>{let i=-1;const l=ff(t)?[t]:Pg(t),u=l.length,d=u-1;for(;++i<u;){const f=l[i];let g=a;if(i!==d){const y=e[f];g=nn(y)||Array.isArray(y)?y:isNaN(+l[i+1])?{}:[]}if(f==="__proto__"||f==="constructor"||f==="prototype")return;e[f]=g,e=e[f]}};const Td={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Ia={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},zr={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Kg=Q.createContext(null);Kg.displayName="HookFormContext";const hf=()=>Q.useContext(Kg),u6=e=>{const{children:t,...a}=e;return Q.createElement(Kg.Provider,{value:a},t)};var L_=(e,t,a,i=!0)=>{const l={defaultValues:t._defaultValues};for(const u in e)Object.defineProperty(l,u,{get:()=>{const d=u;return t._proxyFormState[d]!==Ia.all&&(t._proxyFormState[d]=!i||Ia.all),a&&(a[d]=!0),e[d]}});return l};const Ig=typeof window<"u"?Q.useLayoutEffect:Q.useEffect;function U_(e){const t=hf(),{control:a=t.control,disabled:i,name:l,exact:u}=e||{},[d,f]=Q.useState(a._formState),g=Q.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Ig(()=>a._subscribe({name:l,formState:g.current,exact:u,callback:y=>{!i&&f({...a._formState,...y})}}),[l,i,u]),Q.useEffect(()=>{g.current.isValid&&a._setValid(!0)},[a]),Q.useMemo(()=>L_(d,a,g.current,!1),[d,a])}var la=e=>typeof e=="string",Km=(e,t,a,i,l)=>la(e)?(i&&t.watch.add(e),_e(a,e,l)):Array.isArray(e)?e.map(u=>(i&&t.watch.add(u),_e(a,u))):(i&&(t.watchAll=!0),a),Im=e=>Hn(e)||!P_(e);function La(e,t,a=new WeakSet){if(Im(e)||Im(t))return e===t;if(Qi(e)&&Qi(t))return e.getTime()===t.getTime();const i=Object.keys(e),l=Object.keys(t);if(i.length!==l.length)return!1;if(a.has(e)||a.has(t))return!0;a.add(e),a.add(t);for(const u of i){const d=e[u];if(!l.includes(u))return!1;if(u!=="ref"){const f=t[u];if(Qi(d)&&Qi(f)||nn(d)&&nn(f)||Array.isArray(d)&&Array.isArray(f)?!La(d,f,a):d!==f)return!1}}return!0}function d6(e){const t=hf(),{control:a=t.control,name:i,defaultValue:l,disabled:u,exact:d,compute:f}=e||{},g=Q.useRef(l),y=Q.useRef(f),x=Q.useRef(void 0),v=Q.useRef(a),w=Q.useRef(i);y.current=f;const[_,R]=Q.useState(()=>{const E=a._getWatch(i,g.current);return y.current?y.current(E):E}),S=Q.useCallback(E=>{const D=Km(i,a._names,E||a._formValues,!1,g.current);return y.current?y.current(D):D},[a._formValues,a._names,i]),A=Q.useCallback(E=>{if(!u){const D=Km(i,a._names,E||a._formValues,!1,g.current);if(y.current){const I=y.current(D);La(I,x.current)||(R(I),x.current=I)}else R(D)}},[a._formValues,a._names,u,i]);Ig(()=>((v.current!==a||!La(w.current,i))&&(v.current=a,w.current=i,A()),a._subscribe({name:i,formState:{values:!0},exact:d,callback:E=>{A(E.values)}})),[a,d,i,A]),Q.useEffect(()=>a._removeUnmounted());const M=v.current!==a,T=w.current,N=Q.useMemo(()=>{if(u)return null;const E=!M&&!La(T,i);return M||E?S():null},[u,M,i,T,S]);return N!==null?N:_}function f6(e){const t=hf(),{name:a,disabled:i,control:l=t.control,shouldUnregister:u,defaultValue:d}=e,f=I_(l._names.array,a),g=Q.useMemo(()=>_e(l._formValues,a,_e(l._defaultValues,a,d)),[l,a,d]),y=d6({control:l,name:a,defaultValue:g,exact:!0}),x=U_({control:l,name:a,exact:!0}),v=Q.useRef(e),w=Q.useRef(void 0),_=Q.useRef(l.register(a,{...e.rules,value:y,...oa(e.disabled)?{disabled:e.disabled}:{}}));v.current=e;const R=Q.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!_e(x.errors,a)},isDirty:{enumerable:!0,get:()=>!!_e(x.dirtyFields,a)},isTouched:{enumerable:!0,get:()=>!!_e(x.touchedFields,a)},isValidating:{enumerable:!0,get:()=>!!_e(x.validatingFields,a)},error:{enumerable:!0,get:()=>_e(x.errors,a)}}),[x,a]),S=Q.useCallback(N=>_.current.onChange({target:{value:K_(N),name:a},type:Td.CHANGE}),[a]),A=Q.useCallback(()=>_.current.onBlur({target:{value:_e(l._formValues,a),name:a},type:Td.BLUR}),[a,l._formValues]),M=Q.useCallback(N=>{const E=_e(l._fields,a);E&&N&&(E._f.ref={focus:()=>N.focus&&N.focus(),select:()=>N.select&&N.select(),setCustomValidity:D=>N.setCustomValidity(D),reportValidity:()=>N.reportValidity()})},[l._fields,a]),T=Q.useMemo(()=>({name:a,value:y,...oa(i)||x.disabled?{disabled:x.disabled||i}:{},onChange:S,onBlur:A,ref:M}),[a,i,x.disabled,S,A,M,y]);return Q.useEffect(()=>{const N=l._options.shouldUnregister||u,E=w.current;E&&E!==a&&!f&&l.unregister(E),l.register(a,{...v.current.rules,...oa(v.current.disabled)?{disabled:v.current.disabled}:{}});const D=(I,U)=>{const F=_e(l._fields,I);F&&F._f&&(F._f.mount=U)};if(D(a,!0),N){const I=ln(_e(l._options.defaultValues,a,v.current.defaultValue));xt(l._defaultValues,a,I),Bt(_e(l._formValues,a))&&xt(l._formValues,a,I)}return!f&&l.register(a),w.current=a,()=>{(f?N&&!l._state.action:N)?l.unregister(a):D(a,!1)}},[a,l,f,u]),Q.useEffect(()=>{l._setDisabledField({disabled:i,name:a})},[i,a,l]),Q.useMemo(()=>({field:T,formState:x,fieldState:R}),[T,x,R])}const Pa=e=>e.render(f6(e));var Lg=(e,t,a,i,l)=>t?{...a[e],types:{...a[e]&&a[e].types?a[e].types:{},[i]:l||!0}}:{},Yl=e=>Array.isArray(e)?e:[e],p0=()=>{let e=[];return{get observers(){return e},next:l=>{for(const u of e)u.next&&u.next(l)},subscribe:l=>(e.push(l),{unsubscribe:()=>{e=e.filter(u=>u!==l)}}),unsubscribe:()=>{e=[]}}};function q_(e,t){const a={};for(const i in e)if(e.hasOwnProperty(i)){const l=e[i],u=t[i];if(l&&nn(l)&&u){const d=q_(l,u);nn(d)&&(a[i]=d)}else e[i]&&(a[i]=u)}return a}var An=e=>nn(e)&&!Object.keys(e).length,Ug=e=>e.type==="file",Ua=e=>typeof e=="function",Dd=e=>{if(!kg)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},F_=e=>e.type==="select-multiple",qg=e=>e.type==="radio",h6=e=>qg(e)||vc(e),lm=e=>Dd(e)&&e.isConnected;function p6(e,t){const a=t.slice(0,-1).length;let i=0;for(;i<a;)e=Bt(e)?i++:e[t[i++]];return e}function m6(e){for(const t in e)if(e.hasOwnProperty(t)&&!Bt(e[t]))return!1;return!0}function tn(e,t){const a=Array.isArray(t)?t:ff(t)?[t]:Pg(t),i=a.length===1?e:p6(e,a),l=a.length-1,u=a[l];return i&&delete i[u],l!==0&&(nn(i)&&An(i)||Array.isArray(i)&&m6(i))&&tn(e,a.slice(0,-1)),e}var g6=e=>{for(const t in e)if(Ua(e[t]))return!0;return!1};function $_(e){return Array.isArray(e)||nn(e)&&!g6(e)}function Lm(e,t={}){for(const a in e)$_(e[a])?(t[a]=Array.isArray(e[a])?[]:{},Lm(e[a],t[a])):Bt(e[a])||(t[a]=!0);return t}function cs(e,t,a){a||(a=Lm(t));for(const i in e)$_(e[i])?Bt(t)||Im(a[i])?a[i]=Lm(e[i],Array.isArray(e[i])?[]:{}):cs(e[i],Hn(t)?{}:t[i],a[i]):a[i]=!La(e[i],t[i]);return a}const m0={value:!1,isValid:!1},g0={value:!0,isValid:!0};var V_=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(a=>a&&a.checked&&!a.disabled).map(a=>a.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Bt(e[0].attributes.value)?Bt(e[0].value)||e[0].value===""?g0:{value:e[0].value,isValid:!0}:g0:m0}return m0},B_=(e,{valueAsNumber:t,valueAsDate:a,setValueAs:i})=>Bt(e)?e:t?e===""?NaN:e&&+e:a&&la(e)?new Date(e):i?i(e):e;const y0={isValid:!1,value:null};var G_=e=>Array.isArray(e)?e.reduce((t,a)=>a&&a.checked&&!a.disabled?{isValid:!0,value:a.value}:t,y0):y0;function v0(e){const t=e.ref;return Ug(t)?t.files:qg(t)?G_(e.refs).value:F_(t)?[...t.selectedOptions].map(({value:a})=>a):vc(t)?V_(e.refs).value:B_(Bt(t.value)?e.ref.value:t.value,e)}var y6=(e,t,a,i)=>{const l={};for(const u of e){const d=_e(t,u);d&&xt(l,u,d._f)}return{criteriaMode:a,names:[...e],fields:l,shouldUseNativeValidation:i}},Md=e=>e instanceof RegExp,Dl=e=>Bt(e)?e:Md(e)?e.source:nn(e)?Md(e.value)?e.value.source:e.value:e,x0=e=>({isOnSubmit:!e||e===Ia.onSubmit,isOnBlur:e===Ia.onBlur,isOnChange:e===Ia.onChange,isOnAll:e===Ia.all,isOnTouch:e===Ia.onTouched});const b0="AsyncFunction";var v6=e=>!!e&&!!e.validate&&!!(Ua(e.validate)&&e.validate.constructor.name===b0||nn(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===b0)),x6=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),w0=(e,t,a)=>!a&&(t.watchAll||t.watch.has(e)||[...t.watch].some(i=>e.startsWith(i)&&/^\.\w+/.test(e.slice(i.length))));const Ql=(e,t,a,i)=>{for(const l of a||Object.keys(e)){const u=_e(e,l);if(u){const{_f:d,...f}=u;if(d){if(d.refs&&d.refs[0]&&t(d.refs[0],l)&&!i)return!0;if(d.ref&&t(d.ref,d.name)&&!i)return!0;if(Ql(f,t))break}else if(nn(f)&&Ql(f,t))break}}};function S0(e,t,a){const i=_e(e,a);if(i||ff(a))return{error:i,name:a};const l=a.split(".");for(;l.length;){const u=l.join("."),d=_e(t,u),f=_e(e,u);if(d&&!Array.isArray(d)&&a!==u)return{name:a};if(f&&f.type)return{name:u,error:f};if(f&&f.root&&f.root.type)return{name:`${u}.root`,error:f.root};l.pop()}return{name:a}}var b6=(e,t,a,i)=>{a(e);const{name:l,...u}=e;return An(u)||Object.keys(u).length>=Object.keys(t).length||Object.keys(u).find(d=>t[d]===(!i||Ia.all))},w6=(e,t,a)=>!e||!t||e===t||Yl(e).some(i=>i&&(a?i===t:i.startsWith(t)||t.startsWith(i))),S6=(e,t,a,i,l)=>l.isOnAll?!1:!a&&l.isOnTouch?!(t||e):(a?i.isOnBlur:l.isOnBlur)?!e:(a?i.isOnChange:l.isOnChange)?e:!0,_6=(e,t)=>!zg(_e(e,t)).length&&tn(e,t),j6=(e,t,a)=>{const i=Yl(_e(e,a));return xt(i,"root",t[a]),xt(e,a,i),e};function _0(e,t,a="validate"){if(la(e)||Array.isArray(e)&&e.every(la)||oa(e)&&!e)return{type:a,message:la(e)?e:"",ref:t}}var rs=e=>nn(e)&&!Md(e)?e:{value:e,message:""},j0=async(e,t,a,i,l,u)=>{const{ref:d,refs:f,required:g,maxLength:y,minLength:x,min:v,max:w,pattern:_,validate:R,name:S,valueAsNumber:A,mount:M}=e._f,T=_e(a,S);if(!M||t.has(S))return{};const N=f?f[0]:d,E=ne=>{l&&N.reportValidity&&(N.setCustomValidity(oa(ne)?"":ne||""),N.reportValidity())},D={},I=qg(d),U=vc(d),F=I||U,fe=(A||Ug(d))&&Bt(d.value)&&Bt(T)||Dd(d)&&d.value===""||T===""||Array.isArray(T)&&!T.length,ge=Lg.bind(null,S,i,D),he=(ne,le,ce,ve=zr.maxLength,O=zr.minLength)=>{const j=ne?le:ce;D[S]={type:ne?ve:O,message:j,ref:d,...ge(ne?ve:O,j)}};if(u?!Array.isArray(T)||!T.length:g&&(!F&&(fe||Hn(T))||oa(T)&&!T||U&&!V_(f).isValid||I&&!G_(f).isValid)){const{value:ne,message:le}=la(g)?{value:!!g,message:g}:rs(g);if(ne&&(D[S]={type:zr.required,message:le,ref:N,...ge(zr.required,le)},!i))return E(le),D}if(!fe&&(!Hn(v)||!Hn(w))){let ne,le;const ce=rs(w),ve=rs(v);if(!Hn(T)&&!isNaN(T)){const O=d.valueAsNumber||T&&+T;Hn(ce.value)||(ne=O>ce.value),Hn(ve.value)||(le=O<ve.value)}else{const O=d.valueAsDate||new Date(T),j=me=>new Date(new Date().toDateString()+" "+me),z=d.type=="time",J=d.type=="week";la(ce.value)&&T&&(ne=z?j(T)>j(ce.value):J?T>ce.value:O>new Date(ce.value)),la(ve.value)&&T&&(le=z?j(T)<j(ve.value):J?T<ve.value:O<new Date(ve.value))}if((ne||le)&&(he(!!ne,ce.message,ve.message,zr.max,zr.min),!i))return E(D[S].message),D}if((y||x)&&!fe&&(la(T)||u&&Array.isArray(T))){const ne=rs(y),le=rs(x),ce=!Hn(ne.value)&&T.length>+ne.value,ve=!Hn(le.value)&&T.length<+le.value;if((ce||ve)&&(he(ce,ne.message,le.message),!i))return E(D[S].message),D}if(_&&!fe&&la(T)){const{value:ne,message:le}=rs(_);if(Md(ne)&&!T.match(ne)&&(D[S]={type:zr.pattern,message:le,ref:d,...ge(zr.pattern,le)},!i))return E(le),D}if(R){if(Ua(R)){const ne=await R(T,a),le=_0(ne,N);if(le&&(D[S]={...le,...ge(zr.validate,le.message)},!i))return E(le.message),D}else if(nn(R)){let ne={};for(const le in R){if(!An(ne)&&!i)break;const ce=_0(await R[le](T,a),N,le);ce&&(ne={...ce,...ge(le,ce.message)},E(ce.message),i&&(D[S]=ne))}if(!An(ne)&&(D[S]={ref:N,...ne},!i))return D}}return E(!0),D};const C6={mode:Ia.onSubmit,reValidateMode:Ia.onChange,shouldFocusError:!0};function E6(e={}){let t={...C6,...e},a={submitCount:0,isDirty:!1,isReady:!1,isLoading:Ua(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},i={},l=nn(t.defaultValues)||nn(t.values)?ln(t.defaultValues||t.values)||{}:{},u=t.shouldUnregister?{}:ln(l),d={action:!1,mount:!1,watch:!1},f={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},g,y=0;const x={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let v={...x};const w={array:p0(),state:p0()},_=t.criteriaMode===Ia.all,R=P=>V=>{clearTimeout(y),y=setTimeout(P,V)},S=async P=>{if(!t.disabled&&(x.isValid||v.isValid||P)){const V=t.resolver?An((await U()).errors):await fe(i,!0);V!==a.isValid&&w.state.next({isValid:V})}},A=(P,V)=>{!t.disabled&&(x.isValidating||x.validatingFields||v.isValidating||v.validatingFields)&&((P||Array.from(f.mount)).forEach(Z=>{Z&&(V?xt(a.validatingFields,Z,V):tn(a.validatingFields,Z))}),w.state.next({validatingFields:a.validatingFields,isValidating:!An(a.validatingFields)}))},M=(P,V=[],Z,be,ue=!0,pe=!0)=>{if(be&&Z&&!t.disabled){if(d.action=!0,pe&&Array.isArray(_e(i,P))){const Ie=Z(_e(i,P),be.argA,be.argB);ue&&xt(i,P,Ie)}if(pe&&Array.isArray(_e(a.errors,P))){const Ie=Z(_e(a.errors,P),be.argA,be.argB);ue&&xt(a.errors,P,Ie),_6(a.errors,P)}if((x.touchedFields||v.touchedFields)&&pe&&Array.isArray(_e(a.touchedFields,P))){const Ie=Z(_e(a.touchedFields,P),be.argA,be.argB);ue&&xt(a.touchedFields,P,Ie)}(x.dirtyFields||v.dirtyFields)&&(a.dirtyFields=cs(l,u)),w.state.next({name:P,isDirty:he(P,V),dirtyFields:a.dirtyFields,errors:a.errors,isValid:a.isValid})}else xt(u,P,V)},T=(P,V)=>{xt(a.errors,P,V),w.state.next({errors:a.errors})},N=P=>{a.errors=P,w.state.next({errors:a.errors,isValid:!1})},E=(P,V,Z,be)=>{const ue=_e(i,P);if(ue){const pe=_e(u,P,Bt(Z)?_e(l,P):Z);Bt(pe)||be&&be.defaultChecked||V?xt(u,P,V?pe:v0(ue._f)):ce(P,pe),d.mount&&S()}},D=(P,V,Z,be,ue)=>{let pe=!1,Ie=!1;const ft={name:P};if(!t.disabled){if(!Z||be){(x.isDirty||v.isDirty)&&(Ie=a.isDirty,a.isDirty=ft.isDirty=he(),pe=Ie!==ft.isDirty);const ht=La(_e(l,P),V);Ie=!!_e(a.dirtyFields,P),ht?tn(a.dirtyFields,P):xt(a.dirtyFields,P,!0),ft.dirtyFields=a.dirtyFields,pe=pe||(x.dirtyFields||v.dirtyFields)&&Ie!==!ht}if(Z){const ht=_e(a.touchedFields,P);ht||(xt(a.touchedFields,P,Z),ft.touchedFields=a.touchedFields,pe=pe||(x.touchedFields||v.touchedFields)&&ht!==Z)}pe&&ue&&w.state.next(ft)}return pe?ft:{}},I=(P,V,Z,be)=>{const ue=_e(a.errors,P),pe=(x.isValid||v.isValid)&&oa(V)&&a.isValid!==V;if(t.delayError&&Z?(g=R(()=>T(P,Z)),g(t.delayError)):(clearTimeout(y),g=null,Z?xt(a.errors,P,Z):tn(a.errors,P)),(Z?!La(ue,Z):ue)||!An(be)||pe){const Ie={...be,...pe&&oa(V)?{isValid:V}:{},errors:a.errors,name:P};a={...a,...Ie},w.state.next(Ie)}},U=async P=>{A(P,!0);const V=await t.resolver(u,t.context,y6(P||f.mount,i,t.criteriaMode,t.shouldUseNativeValidation));return A(P),V},F=async P=>{const{errors:V}=await U(P);if(P)for(const Z of P){const be=_e(V,Z);be?xt(a.errors,Z,be):tn(a.errors,Z)}else a.errors=V;return V},fe=async(P,V,Z={valid:!0})=>{for(const be in P){const ue=P[be];if(ue){const{_f:pe,...Ie}=ue;if(pe){const ft=f.array.has(pe.name),ht=ue._f&&v6(ue._f);ht&&x.validatingFields&&A([pe.name],!0);const pn=await j0(ue,f.disabled,u,_,t.shouldUseNativeValidation&&!V,ft);if(ht&&x.validatingFields&&A([pe.name]),pn[pe.name]&&(Z.valid=!1,V))break;!V&&(_e(pn,pe.name)?ft?j6(a.errors,pn,pe.name):xt(a.errors,pe.name,pn[pe.name]):tn(a.errors,pe.name))}!An(Ie)&&await fe(Ie,V,Z)}}return Z.valid},ge=()=>{for(const P of f.unMount){const V=_e(i,P);V&&(V._f.refs?V._f.refs.every(Z=>!lm(Z)):!lm(V._f.ref))&&ee(P)}f.unMount=new Set},he=(P,V)=>!t.disabled&&(P&&V&&xt(u,P,V),!La(me(),l)),ne=(P,V,Z)=>Km(P,f,{...d.mount?u:Bt(V)?l:la(P)?{[P]:V}:V},Z,V),le=P=>zg(_e(d.mount?u:l,P,t.shouldUnregister?_e(l,P,[]):[])),ce=(P,V,Z={})=>{const be=_e(i,P);let ue=V;if(be){const pe=be._f;pe&&(!pe.disabled&&xt(u,P,B_(V,pe)),ue=Dd(pe.ref)&&Hn(V)?"":V,F_(pe.ref)?[...pe.ref.options].forEach(Ie=>Ie.selected=ue.includes(Ie.value)):pe.refs?vc(pe.ref)?pe.refs.forEach(Ie=>{(!Ie.defaultChecked||!Ie.disabled)&&(Array.isArray(ue)?Ie.checked=!!ue.find(ft=>ft===Ie.value):Ie.checked=ue===Ie.value||!!ue)}):pe.refs.forEach(Ie=>Ie.checked=Ie.value===ue):Ug(pe.ref)?pe.ref.value="":(pe.ref.value=ue,pe.ref.type||w.state.next({name:P,values:ln(u)})))}(Z.shouldDirty||Z.shouldTouch)&&D(P,ue,Z.shouldTouch,Z.shouldDirty,!0),Z.shouldValidate&&J(P)},ve=(P,V,Z)=>{for(const be in V){if(!V.hasOwnProperty(be))return;const ue=V[be],pe=P+"."+be,Ie=_e(i,pe);(f.array.has(P)||nn(ue)||Ie&&!Ie._f)&&!Qi(ue)?ve(pe,ue,Z):ce(pe,ue,Z)}},O=(P,V,Z={})=>{const be=_e(i,P),ue=f.array.has(P),pe=ln(V);xt(u,P,pe),ue?(w.array.next({name:P,values:ln(u)}),(x.isDirty||x.dirtyFields||v.isDirty||v.dirtyFields)&&Z.shouldDirty&&w.state.next({name:P,dirtyFields:cs(l,u),isDirty:he(P,pe)})):be&&!be._f&&!Hn(pe)?ve(P,pe,Z):ce(P,pe,Z),w0(P,f)&&w.state.next({...a,name:P}),w.state.next({name:d.mount?P:void 0,values:ln(u)})},j=async P=>{d.mount=!0;const V=P.target;let Z=V.name,be=!0;const ue=_e(i,Z),pe=ht=>{be=Number.isNaN(ht)||Qi(ht)&&isNaN(ht.getTime())||La(ht,_e(u,Z,ht))},Ie=x0(t.mode),ft=x0(t.reValidateMode);if(ue){let ht,pn;const zn=V.type?v0(ue._f):K_(P),Qn=P.type===Td.BLUR||P.type===Td.FOCUS_OUT,Ja=!x6(ue._f)&&!t.resolver&&!_e(a.errors,Z)&&!ue._f.deps||S6(Qn,_e(a.touchedFields,Z),a.isSubmitted,ft,Ie),Ta=w0(Z,f,Qn);xt(u,Z,zn),Qn?(!V||!V.readOnly)&&(ue._f.onBlur&&ue._f.onBlur(P),g&&g(0)):ue._f.onChange&&ue._f.onChange(P);const an=D(Z,zn,Qn),Jn=!An(an)||Ta;if(!Qn&&w.state.next({name:Z,type:P.type,values:ln(u)}),Ja)return(x.isValid||v.isValid)&&(t.mode==="onBlur"?Qn&&S():Qn||S()),Jn&&w.state.next({name:Z,...Ta?{}:an});if(!Qn&&Ta&&w.state.next({...a}),t.resolver){const{errors:rn}=await U([Z]);if(pe(zn),be){const Ps=S0(a.errors,i,Z),qr=S0(rn,i,Ps.name||Z);ht=qr.error,Z=qr.name,pn=An(rn)}}else A([Z],!0),ht=(await j0(ue,f.disabled,u,_,t.shouldUseNativeValidation))[Z],A([Z]),pe(zn),be&&(ht?pn=!1:(x.isValid||v.isValid)&&(pn=await fe(i,!0)));be&&(ue._f.deps&&(!Array.isArray(ue._f.deps)||ue._f.deps.length>0)&&J(ue._f.deps),I(Z,pn,ht,an))}},z=(P,V)=>{if(_e(a.errors,V)&&P.focus)return P.focus(),1},J=async(P,V={})=>{let Z,be;const ue=Yl(P);if(t.resolver){const pe=await F(Bt(P)?P:ue);Z=An(pe),be=P?!ue.some(Ie=>_e(pe,Ie)):Z}else P?(be=(await Promise.all(ue.map(async pe=>{const Ie=_e(i,pe);return await fe(Ie&&Ie._f?{[pe]:Ie}:Ie)}))).every(Boolean),!(!be&&!a.isValid)&&S()):be=Z=await fe(i);return w.state.next({...!la(P)||(x.isValid||v.isValid)&&Z!==a.isValid?{}:{name:P},...t.resolver||!P?{isValid:Z}:{},errors:a.errors}),V.shouldFocus&&!be&&Ql(i,z,P?ue:f.mount),be},me=(P,V)=>{let Z={...d.mount?u:l};return V&&(Z=q_(V.dirtyFields?a.dirtyFields:a.touchedFields,Z)),Bt(P)?Z:la(P)?_e(Z,P):P.map(be=>_e(Z,be))},Te=(P,V)=>({invalid:!!_e((V||a).errors,P),isDirty:!!_e((V||a).dirtyFields,P),error:_e((V||a).errors,P),isValidating:!!_e(a.validatingFields,P),isTouched:!!_e((V||a).touchedFields,P)}),H=P=>{P&&Yl(P).forEach(V=>tn(a.errors,V)),w.state.next({errors:P?a.errors:{}})},Y=(P,V,Z)=>{const be=(_e(i,P,{_f:{}})._f||{}).ref,ue=_e(a.errors,P)||{},{ref:pe,message:Ie,type:ft,...ht}=ue;xt(a.errors,P,{...ht,...V,ref:be}),w.state.next({name:P,errors:a.errors,isValid:!1}),Z&&Z.shouldFocus&&be&&be.focus&&be.focus()},oe=(P,V)=>Ua(P)?w.state.subscribe({next:Z=>"values"in Z&&P(ne(void 0,V),Z)}):ne(P,V,!0),se=P=>w.state.subscribe({next:V=>{w6(P.name,V.name,P.exact)&&b6(V,P.formState||x,Je,P.reRenderRoot)&&P.callback({values:{...u},...a,...V,defaultValues:l})}}).unsubscribe,we=P=>(d.mount=!0,v={...v,...P.formState},se({...P,formState:v})),ee=(P,V={})=>{for(const Z of P?Yl(P):f.mount)f.mount.delete(Z),f.array.delete(Z),V.keepValue||(tn(i,Z),tn(u,Z)),!V.keepError&&tn(a.errors,Z),!V.keepDirty&&tn(a.dirtyFields,Z),!V.keepTouched&&tn(a.touchedFields,Z),!V.keepIsValidating&&tn(a.validatingFields,Z),!t.shouldUnregister&&!V.keepDefaultValue&&tn(l,Z);w.state.next({values:ln(u)}),w.state.next({...a,...V.keepDirty?{isDirty:he()}:{}}),!V.keepIsValid&&S()},Se=({disabled:P,name:V})=>{(oa(P)&&d.mount||P||f.disabled.has(V))&&(P?f.disabled.add(V):f.disabled.delete(V))},De=(P,V={})=>{let Z=_e(i,P);const be=oa(V.disabled)||oa(t.disabled);return xt(i,P,{...Z||{},_f:{...Z&&Z._f?Z._f:{ref:{name:P}},name:P,mount:!0,...V}}),f.mount.add(P),Z?Se({disabled:oa(V.disabled)?V.disabled:t.disabled,name:P}):E(P,!0,V.value),{...be?{disabled:V.disabled||t.disabled}:{},...t.progressive?{required:!!V.required,min:Dl(V.min),max:Dl(V.max),minLength:Dl(V.minLength),maxLength:Dl(V.maxLength),pattern:Dl(V.pattern)}:{},name:P,onChange:j,onBlur:j,ref:ue=>{if(ue){De(P,V),Z=_e(i,P);const pe=Bt(ue.value)&&ue.querySelectorAll&&ue.querySelectorAll("input,select,textarea")[0]||ue,Ie=h6(pe),ft=Z._f.refs||[];if(Ie?ft.find(ht=>ht===pe):pe===Z._f.ref)return;xt(i,P,{_f:{...Z._f,...Ie?{refs:[...ft.filter(lm),pe,...Array.isArray(_e(l,P))?[{}]:[]],ref:{type:pe.type,name:P}}:{ref:pe}}}),E(P,!1,void 0,pe)}else Z=_e(i,P,{}),Z._f&&(Z._f.mount=!1),(t.shouldUnregister||V.shouldUnregister)&&!(I_(f.array,P)&&d.action)&&f.unMount.add(P)}}},He=()=>t.shouldFocusError&&Ql(i,z,f.mount),Qe=P=>{oa(P)&&(w.state.next({disabled:P}),Ql(i,(V,Z)=>{const be=_e(i,Z);be&&(V.disabled=be._f.disabled||P,Array.isArray(be._f.refs)&&be._f.refs.forEach(ue=>{ue.disabled=be._f.disabled||P}))},0,!1))},Ye=(P,V)=>async Z=>{let be;Z&&(Z.preventDefault&&Z.preventDefault(),Z.persist&&Z.persist());let ue=ln(u);if(w.state.next({isSubmitting:!0}),t.resolver){const{errors:pe,values:Ie}=await U();a.errors=pe,ue=ln(Ie)}else await fe(i);if(f.disabled.size)for(const pe of f.disabled)tn(ue,pe);if(tn(a.errors,"root"),An(a.errors)){w.state.next({errors:{}});try{await P(ue,Z)}catch(pe){be=pe}}else V&&await V({...a.errors},Z),He(),setTimeout(He);if(w.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:An(a.errors)&&!be,submitCount:a.submitCount+1,errors:a.errors}),be)throw be},Ft=(P,V={})=>{_e(i,P)&&(Bt(V.defaultValue)?O(P,ln(_e(l,P))):(O(P,V.defaultValue),xt(l,P,ln(V.defaultValue))),V.keepTouched||tn(a.touchedFields,P),V.keepDirty||(tn(a.dirtyFields,P),a.isDirty=V.defaultValue?he(P,ln(_e(l,P))):he()),V.keepError||(tn(a.errors,P),x.isValid&&S()),w.state.next({...a}))},G=(P,V={})=>{const Z=P?ln(P):l,be=ln(Z),ue=An(P),pe=ue?l:be;if(V.keepDefaultValues||(l=Z),!V.keepValues){if(V.keepDirtyValues){const Ie=new Set([...f.mount,...Object.keys(cs(l,u))]);for(const ft of Array.from(Ie))_e(a.dirtyFields,ft)?xt(pe,ft,_e(u,ft)):O(ft,_e(pe,ft))}else{if(kg&&Bt(P))for(const Ie of f.mount){const ft=_e(i,Ie);if(ft&&ft._f){const ht=Array.isArray(ft._f.refs)?ft._f.refs[0]:ft._f.ref;if(Dd(ht)){const pn=ht.closest("form");if(pn){pn.reset();break}}}}if(V.keepFieldsRef)for(const Ie of f.mount)O(Ie,_e(pe,Ie));else i={}}u=t.shouldUnregister?V.keepDefaultValues?ln(l):{}:ln(pe),w.array.next({values:{...pe}}),w.state.next({values:{...pe}})}f={mount:V.keepDirtyValues?f.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},d.mount=!x.isValid||!!V.keepIsValid||!!V.keepDirtyValues||!t.shouldUnregister&&!An(pe),d.watch=!!t.shouldUnregister,w.state.next({submitCount:V.keepSubmitCount?a.submitCount:0,isDirty:ue?!1:V.keepDirty?a.isDirty:!!(V.keepDefaultValues&&!La(P,l)),isSubmitted:V.keepIsSubmitted?a.isSubmitted:!1,dirtyFields:ue?{}:V.keepDirtyValues?V.keepDefaultValues&&u?cs(l,u):a.dirtyFields:V.keepDefaultValues&&P?cs(l,P):V.keepDirty?a.dirtyFields:{},touchedFields:V.keepTouched?a.touchedFields:{},errors:V.keepErrors?a.errors:{},isSubmitSuccessful:V.keepIsSubmitSuccessful?a.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:l})},Xe=(P,V)=>G(Ua(P)?P(u):P,V),qe=(P,V={})=>{const Z=_e(i,P),be=Z&&Z._f;if(be){const ue=be.refs?be.refs[0]:be.ref;ue.focus&&(ue.focus(),V.shouldSelect&&Ua(ue.select)&&ue.select())}},Je=P=>{a={...a,...P}},En={control:{register:De,unregister:ee,getFieldState:Te,handleSubmit:Ye,setError:Y,_subscribe:se,_runSchema:U,_focusError:He,_getWatch:ne,_getDirty:he,_setValid:S,_setFieldArray:M,_setDisabledField:Se,_setErrors:N,_getFieldArray:le,_reset:G,_resetDefaultValues:()=>Ua(t.defaultValues)&&t.defaultValues().then(P=>{Xe(P,t.resetOptions),w.state.next({isLoading:!1})}),_removeUnmounted:ge,_disableForm:Qe,_subjects:w,_proxyFormState:x,get _fields(){return i},get _formValues(){return u},get _state(){return d},set _state(P){d=P},get _defaultValues(){return l},get _names(){return f},set _names(P){f=P},get _formState(){return a},get _options(){return t},set _options(P){t={...t,...P}}},subscribe:we,trigger:J,register:De,handleSubmit:Ye,watch:oe,setValue:O,getValues:me,reset:Xe,resetField:Ft,clearErrors:H,unregister:ee,setError:Y,setFocus:qe,getFieldState:Te};return{...En,formControl:En}}function un(e={}){const t=Q.useRef(void 0),a=Q.useRef(void 0),[i,l]=Q.useState({isDirty:!1,isValidating:!1,isLoading:Ua(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:Ua(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:i},e.defaultValues&&!Ua(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:d,...f}=E6(e);t.current={...f,formState:i}}const u=t.current.control;return u._options=e,Ig(()=>{const d=u._subscribe({formState:u._proxyFormState,callback:()=>l({...u._formState}),reRenderRoot:!0});return l(f=>({...f,isReady:!0})),u._formState.isReady=!0,d},[u]),Q.useEffect(()=>u._disableForm(e.disabled),[u,e.disabled]),Q.useEffect(()=>{e.mode&&(u._options.mode=e.mode),e.reValidateMode&&(u._options.reValidateMode=e.reValidateMode)},[u,e.mode,e.reValidateMode]),Q.useEffect(()=>{e.errors&&(u._setErrors(e.errors),u._focusError())},[u,e.errors]),Q.useEffect(()=>{e.shouldUnregister&&u._subjects.state.next({values:u._getWatch()})},[u,e.shouldUnregister]),Q.useEffect(()=>{if(u._proxyFormState.isDirty){const d=u._getDirty();d!==i.isDirty&&u._subjects.state.next({isDirty:d})}},[u,i.isDirty]),Q.useEffect(()=>{e.values&&!La(e.values,a.current)?(u._reset(e.values,{keepFieldsRef:!0,...u._options.resetOptions}),a.current=e.values,l(d=>({...d}))):u._resetDefaultValues()},[u,e.values]),Q.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()}),t.current.formState=L_(i,u),t.current}const C0=(e,t,a)=>{if(e&&"reportValidity"in e){const i=_e(a,t);e.setCustomValidity(i&&i.message||""),e.reportValidity()}},Um=(e,t)=>{for(const a in t.fields){const i=t.fields[a];i&&i.ref&&"reportValidity"in i.ref?C0(i.ref,a,e):i&&i.refs&&i.refs.forEach(l=>C0(l,a,e))}},E0=(e,t)=>{t.shouldUseNativeValidation&&Um(e,t);const a={};for(const i in e){const l=_e(t.fields,i),u=Object.assign(e[i]||{},{ref:l&&l.ref});if(R6(t.names||Object.keys(e),i)){const d=Object.assign({},_e(a,i));xt(d,"root",u),xt(a,i,d)}else xt(a,i,u)}return a},R6=(e,t)=>{const a=R0(t);return e.some(i=>R0(i).match(`^${a}\\.\\d+`))};function R0(e){return e.replace(/\]|\[/g,"")}function re(e,t,a){function i(f,g){var y;Object.defineProperty(f,"_zod",{value:f._zod??{},enumerable:!1}),(y=f._zod).traits??(y.traits=new Set),f._zod.traits.add(e),t(f,g);for(const x in d.prototype)x in f||Object.defineProperty(f,x,{value:d.prototype[x].bind(f)});f._zod.constr=d,f._zod.def=g}const l=a?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(f){var g;const y=a?.Parent?new u:this;i(y,f),(g=y._zod).deferred??(g.deferred=[]);for(const x of y._zod.deferred)x();return y}return Object.defineProperty(d,"init",{value:i}),Object.defineProperty(d,Symbol.hasInstance,{value:f=>a?.Parent&&f instanceof a.Parent?!0:f?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}class bs extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class H_ extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const X_={};function ro(e){return X_}function N6(e){const t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,l])=>t.indexOf(+i)===-1).map(([i,l])=>l)}function qm(e,t){return typeof t=="bigint"?t.toString():t}function Fg(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function $g(e){return e==null}function Vg(e){const t=e.startsWith("^")?1:0,a=e.endsWith("$")?e.length-1:e.length;return e.slice(t,a)}function O6(e,t){const a=(e.toString().split(".")[1]||"").length,i=t.toString();let l=(i.split(".")[1]||"").length;if(l===0&&/\d?e-\d?/.test(i)){const g=i.match(/\d?e-(\d?)/);g?.[1]&&(l=Number.parseInt(g[1]))}const u=a>l?a:l,d=Number.parseInt(e.toFixed(u).replace(".","")),f=Number.parseInt(t.toFixed(u).replace(".",""));return d%f/10**u}const N0=Symbol("evaluating");function Ot(e,t,a){let i;Object.defineProperty(e,t,{get(){if(i!==N0)return i===void 0&&(i=N0,i=a()),i},set(l){Object.defineProperty(e,t,{value:l})},configurable:!0})}function lo(e,t,a){Object.defineProperty(e,t,{value:a,writable:!0,enumerable:!0,configurable:!0})}function co(...e){const t={};for(const a of e){const i=Object.getOwnPropertyDescriptors(a);Object.assign(t,i)}return Object.defineProperties({},t)}function O0(e){return JSON.stringify(e)}const Z_="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function kd(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const A6=Fg(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function ac(e){if(kd(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const a=t.prototype;return!(kd(a)===!1||Object.prototype.hasOwnProperty.call(a,"isPrototypeOf")===!1)}function Y_(e){return ac(e)?{...e}:Array.isArray(e)?[...e]:e}const T6=new Set(["string","number","symbol"]);function Cs(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ei(e,t,a){const i=new e._zod.constr(t??e._zod.def);return(!t||a?.parent)&&(i._zod.parent=e),i}function Ve(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function D6(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const M6={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 k6(e,t){const a=e._zod.def,i=co(e._zod.def,{get shape(){const l={};for(const u in t){if(!(u in a.shape))throw new Error(`Unrecognized key: "${u}"`);t[u]&&(l[u]=a.shape[u])}return lo(this,"shape",l),l},checks:[]});return Ei(e,i)}function z6(e,t){const a=e._zod.def,i=co(e._zod.def,{get shape(){const l={...e._zod.def.shape};for(const u in t){if(!(u in a.shape))throw new Error(`Unrecognized key: "${u}"`);t[u]&&delete l[u]}return lo(this,"shape",l),l},checks:[]});return Ei(e,i)}function P6(e,t){if(!ac(t))throw new Error("Invalid input to extend: expected a plain object");const a=e._zod.def.checks;if(a&&a.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const l=co(e._zod.def,{get shape(){const u={...e._zod.def.shape,...t};return lo(this,"shape",u),u},checks:[]});return Ei(e,l)}function K6(e,t){if(!ac(t))throw new Error("Invalid input to safeExtend: expected a plain object");const a={...e._zod.def,get shape(){const i={...e._zod.def.shape,...t};return lo(this,"shape",i),i},checks:e._zod.def.checks};return Ei(e,a)}function I6(e,t){const a=co(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t._zod.def.shape};return lo(this,"shape",i),i},get catchall(){return t._zod.def.catchall},checks:[]});return Ei(e,a)}function L6(e,t,a){const i=co(t._zod.def,{get shape(){const l=t._zod.def.shape,u={...l};if(a)for(const d in a){if(!(d in l))throw new Error(`Unrecognized key: "${d}"`);a[d]&&(u[d]=e?new e({type:"optional",innerType:l[d]}):l[d])}else for(const d in l)u[d]=e?new e({type:"optional",innerType:l[d]}):l[d];return lo(this,"shape",u),u},checks:[]});return Ei(t,i)}function U6(e,t,a){const i=co(t._zod.def,{get shape(){const l=t._zod.def.shape,u={...l};if(a)for(const d in a){if(!(d in u))throw new Error(`Unrecognized key: "${d}"`);a[d]&&(u[d]=new e({type:"nonoptional",innerType:l[d]}))}else for(const d in l)u[d]=new e({type:"nonoptional",innerType:l[d]});return lo(this,"shape",u),u},checks:[]});return Ei(t,i)}function ms(e,t=0){if(e.aborted===!0)return!0;for(let a=t;a<e.issues.length;a++)if(e.issues[a]?.continue!==!0)return!0;return!1}function Q_(e,t){return t.map(a=>{var i;return(i=a).path??(i.path=[]),a.path.unshift(e),a})}function ad(e){return typeof e=="string"?e:e?.message}function io(e,t,a){const i={...e,path:e.path??[]};if(!e.message){const l=ad(e.inst?._zod.def?.error?.(e))??ad(t?.error?.(e))??ad(a.customError?.(e))??ad(a.localeError?.(e))??"Invalid input";i.message=l}return delete i.inst,delete i.continue,t?.reportInput||delete i.input,i}function Bg(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function rc(...e){const[t,a,i]=e;return typeof t=="string"?{message:t,code:"custom",input:a,inst:i}:{...t}}const J_=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,qm,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Gg=re("$ZodError",J_),pf=re("$ZodError",J_,{Parent:Error});function q6(e,t=a=>a.message){const a={},i=[];for(const l of e.issues)l.path.length>0?(a[l.path[0]]=a[l.path[0]]||[],a[l.path[0]].push(t(l))):i.push(t(l));return{formErrors:i,fieldErrors:a}}function F6(e,t=a=>a.message){const a={_errors:[]},i=l=>{for(const u of l.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(d=>i({issues:d}));else if(u.code==="invalid_key")i({issues:u.issues});else if(u.code==="invalid_element")i({issues:u.issues});else if(u.path.length===0)a._errors.push(t(u));else{let d=a,f=0;for(;f<u.path.length;){const g=u.path[f];f===u.path.length-1?(d[g]=d[g]||{_errors:[]},d[g]._errors.push(t(u))):d[g]=d[g]||{_errors:[]},d=d[g],f++}}};return i(e),a}const mf=e=>(t,a,i,l)=>{const u=i?Object.assign(i,{async:!1}):{async:!1},d=t._zod.run({value:a,issues:[]},u);if(d instanceof Promise)throw new bs;if(d.issues.length){const f=new(l?.Err??e)(d.issues.map(g=>io(g,u,ro())));throw Z_(f,l?.callee),f}return d.value},$6=mf(pf),gf=e=>async(t,a,i,l)=>{const u=i?Object.assign(i,{async:!0}):{async:!0};let d=t._zod.run({value:a,issues:[]},u);if(d instanceof Promise&&(d=await d),d.issues.length){const f=new(l?.Err??e)(d.issues.map(g=>io(g,u,ro())));throw Z_(f,l?.callee),f}return d.value},V6=gf(pf),yf=e=>(t,a,i)=>{const l=i?{...i,async:!1}:{async:!1},u=t._zod.run({value:a,issues:[]},l);if(u instanceof Promise)throw new bs;return u.issues.length?{success:!1,error:new(e??Gg)(u.issues.map(d=>io(d,l,ro())))}:{success:!0,data:u.value}},B6=yf(pf),vf=e=>async(t,a,i)=>{const l=i?Object.assign(i,{async:!0}):{async:!0};let u=t._zod.run({value:a,issues:[]},l);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(d=>io(d,l,ro())))}:{success:!0,data:u.value}},G6=vf(pf),H6=e=>(t,a,i)=>{const l=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return mf(e)(t,a,l)},X6=e=>(t,a,i)=>mf(e)(t,a,i),Z6=e=>async(t,a,i)=>{const l=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return gf(e)(t,a,l)},Y6=e=>async(t,a,i)=>gf(e)(t,a,i),Q6=e=>(t,a,i)=>{const l=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return yf(e)(t,a,l)},J6=e=>(t,a,i)=>yf(e)(t,a,i),W6=e=>async(t,a,i)=>{const l=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return vf(e)(t,a,l)},eP=e=>async(t,a,i)=>vf(e)(t,a,i),tP=/^[cC][^\s-]{8,}$/,nP=/^[0-9a-z]+$/,aP=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,rP=/^[0-9a-vA-V]{20}$/,iP=/^[A-Za-z0-9]{27}$/,oP=/^[a-zA-Z0-9_-]{21}$/,sP=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,lP=/^([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})$/,A0=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)$/,cP=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,uP="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function dP(){return new RegExp(uP,"u")}const fP=/^(?:(?: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])$/,hP=/^(([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}|:))$/,pP=/^((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])$/,mP=/^(([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])$/,gP=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,W_=/^[A-Za-z0-9_-]*$/,yP=/^(?=.{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])?)*\.?$/,vP=/^\+(?:[0-9]){6,14}[0-9]$/,ej="(?:(?:\\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])))",xP=new RegExp(`^${ej}$`);function tj(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function bP(e){return new RegExp(`^${tj(e)}$`)}function wP(e){const t=tj({precision:e.precision}),a=["Z"];e.local&&a.push(""),e.offset&&a.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const i=`${t}(?:${a.join("|")})`;return new RegExp(`^${ej}T(?:${i})$`)}const SP=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},_P=/^-?\d+$/,jP=/^-?\d+(?:\.\d+)?/,CP=/^[^A-Z]*$/,EP=/^[^a-z]*$/,Yn=re("$ZodCheck",(e,t)=>{var a;e._zod??(e._zod={}),e._zod.def=t,(a=e._zod).onattach??(a.onattach=[])}),nj={number:"number",bigint:"bigint",object:"date"},aj=re("$ZodCheckLessThan",(e,t)=>{Yn.init(e,t);const a=nj[typeof t.value];e._zod.onattach.push(i=>{const l=i._zod.bag,u=(t.inclusive?l.maximum:l.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<u&&(t.inclusive?l.maximum=t.value:l.exclusiveMaximum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:a,code:"too_big",maximum:t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),rj=re("$ZodCheckGreaterThan",(e,t)=>{Yn.init(e,t);const a=nj[typeof t.value];e._zod.onattach.push(i=>{const l=i._zod.bag,u=(t.inclusive?l.minimum:l.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>u&&(t.inclusive?l.minimum=t.value:l.exclusiveMinimum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:a,code:"too_small",minimum:t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),RP=re("$ZodCheckMultipleOf",(e,t)=>{Yn.init(e,t),e._zod.onattach.push(a=>{var i;(i=a._zod.bag).multipleOf??(i.multipleOf=t.value)}),e._zod.check=a=>{if(typeof a.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof a.value=="bigint"?a.value%t.value===BigInt(0):O6(a.value,t.value)===0)||a.issues.push({origin:typeof a.value,code:"not_multiple_of",divisor:t.value,input:a.value,inst:e,continue:!t.abort})}}),NP=re("$ZodCheckNumberFormat",(e,t)=>{Yn.init(e,t),t.format=t.format||"float64";const a=t.format?.includes("int"),i=a?"int":"number",[l,u]=M6[t.format];e._zod.onattach.push(d=>{const f=d._zod.bag;f.format=t.format,f.minimum=l,f.maximum=u,a&&(f.pattern=_P)}),e._zod.check=d=>{const f=d.value;if(a){if(!Number.isInteger(f)){d.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:f,inst:e});return}if(!Number.isSafeInteger(f)){f>0?d.issues.push({input:f,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!t.abort}):d.issues.push({input:f,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!t.abort});return}}f<l&&d.issues.push({origin:"number",input:f,code:"too_small",minimum:l,inclusive:!0,inst:e,continue:!t.abort}),f>u&&d.issues.push({origin:"number",input:f,code:"too_big",maximum:u,inst:e})}}),OP=re("$ZodCheckMaxLength",(e,t)=>{var a;Yn.init(e,t),(a=e._zod.def).when??(a.when=i=>{const l=i.value;return!$g(l)&&l.length!==void 0}),e._zod.onattach.push(i=>{const l=i._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<l&&(i._zod.bag.maximum=t.maximum)}),e._zod.check=i=>{const l=i.value;if(l.length<=t.maximum)return;const d=Bg(l);i.issues.push({origin:d,code:"too_big",maximum:t.maximum,inclusive:!0,input:l,inst:e,continue:!t.abort})}}),AP=re("$ZodCheckMinLength",(e,t)=>{var a;Yn.init(e,t),(a=e._zod.def).when??(a.when=i=>{const l=i.value;return!$g(l)&&l.length!==void 0}),e._zod.onattach.push(i=>{const l=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>l&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{const l=i.value;if(l.length>=t.minimum)return;const d=Bg(l);i.issues.push({origin:d,code:"too_small",minimum:t.minimum,inclusive:!0,input:l,inst:e,continue:!t.abort})}}),TP=re("$ZodCheckLengthEquals",(e,t)=>{var a;Yn.init(e,t),(a=e._zod.def).when??(a.when=i=>{const l=i.value;return!$g(l)&&l.length!==void 0}),e._zod.onattach.push(i=>{const l=i._zod.bag;l.minimum=t.length,l.maximum=t.length,l.length=t.length}),e._zod.check=i=>{const l=i.value,u=l.length;if(u===t.length)return;const d=Bg(l),f=u>t.length;i.issues.push({origin:d,...f?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),xf=re("$ZodCheckStringFormat",(e,t)=>{var a,i;Yn.init(e,t),e._zod.onattach.push(l=>{const u=l._zod.bag;u.format=t.format,t.pattern&&(u.patterns??(u.patterns=new Set),u.patterns.add(t.pattern))}),t.pattern?(a=e._zod).check??(a.check=l=>{t.pattern.lastIndex=0,!t.pattern.test(l.value)&&l.issues.push({origin:"string",code:"invalid_format",format:t.format,input:l.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})}),DP=re("$ZodCheckRegex",(e,t)=>{xf.init(e,t),e._zod.check=a=>{t.pattern.lastIndex=0,!t.pattern.test(a.value)&&a.issues.push({origin:"string",code:"invalid_format",format:"regex",input:a.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),MP=re("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=CP),xf.init(e,t)}),kP=re("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=EP),xf.init(e,t)}),zP=re("$ZodCheckIncludes",(e,t)=>{Yn.init(e,t);const a=Cs(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position}}${a}`:a);t.pattern=i,e._zod.onattach.push(l=>{const u=l._zod.bag;u.patterns??(u.patterns=new Set),u.patterns.add(i)}),e._zod.check=l=>{l.value.includes(t.includes,t.position)||l.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:l.value,inst:e,continue:!t.abort})}}),PP=re("$ZodCheckStartsWith",(e,t)=>{Yn.init(e,t);const a=new RegExp(`^${Cs(t.prefix)}.*`);t.pattern??(t.pattern=a),e._zod.onattach.push(i=>{const l=i._zod.bag;l.patterns??(l.patterns=new Set),l.patterns.add(a)}),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),KP=re("$ZodCheckEndsWith",(e,t)=>{Yn.init(e,t);const a=new RegExp(`.*${Cs(t.suffix)}$`);t.pattern??(t.pattern=a),e._zod.onattach.push(i=>{const l=i._zod.bag;l.patterns??(l.patterns=new Set),l.patterns.add(a)}),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}}),IP=re("$ZodCheckOverwrite",(e,t)=>{Yn.init(e,t),e._zod.check=a=>{a.value=t.tx(a.value)}});class LP{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const i=t.split(`
|
|
`).filter(d=>d),l=Math.min(...i.map(d=>d.length-d.trimStart().length)),u=i.map(d=>d.slice(l)).map(d=>" ".repeat(this.indent*2)+d);for(const d of u)this.content.push(d)}compile(){const t=Function,a=this?.args,l=[...(this?.content??[""]).map(u=>` ${u}`)];return new t(...a,l.join(`
|
|
`))}}const UP={major:4,minor:1,patch:12},Gt=re("$ZodType",(e,t)=>{var a;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=UP;const i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(const l of i)for(const u of l._zod.onattach)u(e);if(i.length===0)(a=e._zod).deferred??(a.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const l=(d,f,g)=>{let y=ms(d),x;for(const v of f){if(v._zod.def.when){if(!v._zod.def.when(d))continue}else if(y)continue;const w=d.issues.length,_=v._zod.check(d);if(_ instanceof Promise&&g?.async===!1)throw new bs;if(x||_ instanceof Promise)x=(x??Promise.resolve()).then(async()=>{await _,d.issues.length!==w&&(y||(y=ms(d,w)))});else{if(d.issues.length===w)continue;y||(y=ms(d,w))}}return x?x.then(()=>d):d},u=(d,f,g)=>{if(ms(d))return d.aborted=!0,d;const y=l(f,i,g);if(y instanceof Promise){if(g.async===!1)throw new bs;return y.then(x=>e._zod.parse(x,g))}return e._zod.parse(y,g)};e._zod.run=(d,f)=>{if(f.skipChecks)return e._zod.parse(d,f);if(f.direction==="backward"){const y=e._zod.parse({value:d.value,issues:[]},{...f,skipChecks:!0});return y instanceof Promise?y.then(x=>u(x,d,f)):u(y,d,f)}const g=e._zod.parse(d,f);if(g instanceof Promise){if(f.async===!1)throw new bs;return g.then(y=>l(y,i,f))}return l(g,i,f)}}e["~standard"]={validate:l=>{try{const u=B6(e,l);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return G6(e,l).then(d=>d.success?{value:d.data}:{issues:d.error?.issues})}},vendor:"zod",version:1}}),Hg=re("$ZodString",(e,t)=>{Gt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??SP(e._zod.bag),e._zod.parse=(a,i)=>{if(t.coerce)try{a.value=String(a.value)}catch{}return typeof a.value=="string"||a.issues.push({expected:"string",code:"invalid_type",input:a.value,inst:e}),a}}),Lt=re("$ZodStringFormat",(e,t)=>{xf.init(e,t),Hg.init(e,t)}),qP=re("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=lP),Lt.init(e,t)}),FP=re("$ZodUUID",(e,t)=>{if(t.version){const i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(i===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=A0(i))}else t.pattern??(t.pattern=A0());Lt.init(e,t)}),$P=re("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=cP),Lt.init(e,t)}),VP=re("$ZodURL",(e,t)=>{Lt.init(e,t),e._zod.check=a=>{try{const i=a.value.trim(),l=new URL(i);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(l.hostname)||a.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:yP.source,input:a.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(l.protocol.endsWith(":")?l.protocol.slice(0,-1):l.protocol)||a.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:a.value,inst:e,continue:!t.abort})),t.normalize?a.value=l.href:a.value=i;return}catch{a.issues.push({code:"invalid_format",format:"url",input:a.value,inst:e,continue:!t.abort})}}}),BP=re("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=dP()),Lt.init(e,t)}),GP=re("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=oP),Lt.init(e,t)}),HP=re("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=tP),Lt.init(e,t)}),XP=re("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=nP),Lt.init(e,t)}),ZP=re("$ZodULID",(e,t)=>{t.pattern??(t.pattern=aP),Lt.init(e,t)}),YP=re("$ZodXID",(e,t)=>{t.pattern??(t.pattern=rP),Lt.init(e,t)}),QP=re("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=iP),Lt.init(e,t)}),JP=re("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=wP(t)),Lt.init(e,t)}),WP=re("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=xP),Lt.init(e,t)}),eK=re("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=bP(t)),Lt.init(e,t)}),tK=re("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=sP),Lt.init(e,t)}),nK=re("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=fP),Lt.init(e,t),e._zod.onattach.push(a=>{const i=a._zod.bag;i.format="ipv4"})}),aK=re("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=hP),Lt.init(e,t),e._zod.onattach.push(a=>{const i=a._zod.bag;i.format="ipv6"}),e._zod.check=a=>{try{new URL(`http://[${a.value}]`)}catch{a.issues.push({code:"invalid_format",format:"ipv6",input:a.value,inst:e,continue:!t.abort})}}}),rK=re("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=pP),Lt.init(e,t)}),iK=re("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=mP),Lt.init(e,t),e._zod.check=a=>{const i=a.value.split("/");try{if(i.length!==2)throw new Error;const[l,u]=i;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://[${l}]`)}catch{a.issues.push({code:"invalid_format",format:"cidrv6",input:a.value,inst:e,continue:!t.abort})}}});function ij(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const oK=re("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=gP),Lt.init(e,t),e._zod.onattach.push(a=>{a._zod.bag.contentEncoding="base64"}),e._zod.check=a=>{ij(a.value)||a.issues.push({code:"invalid_format",format:"base64",input:a.value,inst:e,continue:!t.abort})}});function sK(e){if(!W_.test(e))return!1;const t=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),a=t.padEnd(Math.ceil(t.length/4)*4,"=");return ij(a)}const lK=re("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=W_),Lt.init(e,t),e._zod.onattach.push(a=>{a._zod.bag.contentEncoding="base64url"}),e._zod.check=a=>{sK(a.value)||a.issues.push({code:"invalid_format",format:"base64url",input:a.value,inst:e,continue:!t.abort})}}),cK=re("$ZodE164",(e,t)=>{t.pattern??(t.pattern=vP),Lt.init(e,t)});function uK(e,t=null){try{const a=e.split(".");if(a.length!==3)return!1;const[i]=a;if(!i)return!1;const l=JSON.parse(atob(i));return!("typ"in l&&l?.typ!=="JWT"||!l.alg||t&&(!("alg"in l)||l.alg!==t))}catch{return!1}}const dK=re("$ZodJWT",(e,t)=>{Lt.init(e,t),e._zod.check=a=>{uK(a.value,t.alg)||a.issues.push({code:"invalid_format",format:"jwt",input:a.value,inst:e,continue:!t.abort})}}),oj=re("$ZodNumber",(e,t)=>{Gt.init(e,t),e._zod.pattern=e._zod.bag.pattern??jP,e._zod.parse=(a,i)=>{if(t.coerce)try{a.value=Number(a.value)}catch{}const l=a.value;if(typeof l=="number"&&!Number.isNaN(l)&&Number.isFinite(l))return a;const u=typeof l=="number"?Number.isNaN(l)?"NaN":Number.isFinite(l)?void 0:"Infinity":void 0;return a.issues.push({expected:"number",code:"invalid_type",input:l,inst:e,...u?{received:u}:{}}),a}}),fK=re("$ZodNumber",(e,t)=>{NP.init(e,t),oj.init(e,t)}),hK=re("$ZodAny",(e,t)=>{Gt.init(e,t),e._zod.parse=a=>a}),pK=re("$ZodUnknown",(e,t)=>{Gt.init(e,t),e._zod.parse=a=>a}),mK=re("$ZodNever",(e,t)=>{Gt.init(e,t),e._zod.parse=(a,i)=>(a.issues.push({expected:"never",code:"invalid_type",input:a.value,inst:e}),a)});function T0(e,t,a){e.issues.length&&t.issues.push(...Q_(a,e.issues)),t.value[a]=e.value}const gK=re("$ZodArray",(e,t)=>{Gt.init(e,t),e._zod.parse=(a,i)=>{const l=a.value;if(!Array.isArray(l))return a.issues.push({expected:"array",code:"invalid_type",input:l,inst:e}),a;a.value=Array(l.length);const u=[];for(let d=0;d<l.length;d++){const f=l[d],g=t.element._zod.run({value:f,issues:[]},i);g instanceof Promise?u.push(g.then(y=>T0(y,a,d))):T0(g,a,d)}return u.length?Promise.all(u).then(()=>a):a}});function zd(e,t,a,i){e.issues.length&&t.issues.push(...Q_(a,e.issues)),e.value===void 0?a in i&&(t.value[a]=void 0):t.value[a]=e.value}function sj(e){const t=Object.keys(e.shape);for(const i of t)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);const a=D6(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function lj(e,t,a,i,l,u){const d=[],f=l.keySet,g=l.catchall._zod,y=g.def.type;for(const x of Object.keys(t)){if(f.has(x))continue;if(y==="never"){d.push(x);continue}const v=g.run({value:t[x],issues:[]},i);v instanceof Promise?e.push(v.then(w=>zd(w,a,x,t))):zd(v,a,x,t)}return d.length&&a.issues.push({code:"unrecognized_keys",keys:d,input:t,inst:u}),e.length?Promise.all(e).then(()=>a):a}const yK=re("$ZodObject",(e,t)=>{if(Gt.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const f=t.shape;Object.defineProperty(t,"shape",{get:()=>{const g={...f};return Object.defineProperty(t,"shape",{value:g}),g}})}const i=Fg(()=>sj(t));Ot(e._zod,"propValues",()=>{const f=t.shape,g={};for(const y in f){const x=f[y]._zod;if(x.values){g[y]??(g[y]=new Set);for(const v of x.values)g[y].add(v)}}return g});const l=kd,u=t.catchall;let d;e._zod.parse=(f,g)=>{d??(d=i.value);const y=f.value;if(!l(y))return f.issues.push({expected:"object",code:"invalid_type",input:y,inst:e}),f;f.value={};const x=[],v=d.shape;for(const w of d.keys){const R=v[w]._zod.run({value:y[w],issues:[]},g);R instanceof Promise?x.push(R.then(S=>zd(S,f,w,y))):zd(R,f,w,y)}return u?lj(x,y,f,g,i.value,e):x.length?Promise.all(x).then(()=>f):f}}),vK=re("$ZodObjectJIT",(e,t)=>{yK.init(e,t);const a=e._zod.parse,i=Fg(()=>sj(t)),l=w=>{const _=new LP(["shape","payload","ctx"]),R=i.value,S=N=>{const E=O0(N);return`shape[${E}]._zod.run({ value: input[${E}], issues: [] }, ctx)`};_.write("const input = payload.value;");const A=Object.create(null);let M=0;for(const N of R.keys)A[N]=`key_${M++}`;_.write("const newResult = {};");for(const N of R.keys){const E=A[N],D=O0(N);_.write(`const ${E} = ${S(N)};`),_.write(`
|
|
if (${E}.issues.length) {
|
|
payload.issues = payload.issues.concat(${E}.issues.map(iss => ({
|
|
...iss,
|
|
path: iss.path ? [${D}, ...iss.path] : [${D}]
|
|
})));
|
|
}
|
|
|
|
|
|
if (${E}.value === undefined) {
|
|
if (${D} in input) {
|
|
newResult[${D}] = undefined;
|
|
}
|
|
} else {
|
|
newResult[${D}] = ${E}.value;
|
|
}
|
|
|
|
`)}_.write("payload.value = newResult;"),_.write("return payload;");const T=_.compile();return(N,E)=>T(w,N,E)};let u;const d=kd,f=!X_.jitless,y=f&&A6.value,x=t.catchall;let v;e._zod.parse=(w,_)=>{v??(v=i.value);const R=w.value;return d(R)?f&&y&&_?.async===!1&&_.jitless!==!0?(u||(u=l(t.shape)),w=u(w,_),x?lj([],R,w,_,v,e):w):a(w,_):(w.issues.push({expected:"object",code:"invalid_type",input:R,inst:e}),w)}});function D0(e,t,a,i){for(const u of e)if(u.issues.length===0)return t.value=u.value,t;const l=e.filter(u=>!ms(u));return l.length===1?(t.value=l[0].value,l[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:a,errors:e.map(u=>u.issues.map(d=>io(d,i,ro())))}),t)}const xK=re("$ZodUnion",(e,t)=>{Gt.init(e,t),Ot(e._zod,"optin",()=>t.options.some(l=>l._zod.optin==="optional")?"optional":void 0),Ot(e._zod,"optout",()=>t.options.some(l=>l._zod.optout==="optional")?"optional":void 0),Ot(e._zod,"values",()=>{if(t.options.every(l=>l._zod.values))return new Set(t.options.flatMap(l=>Array.from(l._zod.values)))}),Ot(e._zod,"pattern",()=>{if(t.options.every(l=>l._zod.pattern)){const l=t.options.map(u=>u._zod.pattern);return new RegExp(`^(${l.map(u=>Vg(u.source)).join("|")})$`)}});const a=t.options.length===1,i=t.options[0]._zod.run;e._zod.parse=(l,u)=>{if(a)return i(l,u);let d=!1;const f=[];for(const g of t.options){const y=g._zod.run({value:l.value,issues:[]},u);if(y instanceof Promise)f.push(y),d=!0;else{if(y.issues.length===0)return y;f.push(y)}}return d?Promise.all(f).then(g=>D0(g,l,e,u)):D0(f,l,e,u)}}),bK=re("$ZodIntersection",(e,t)=>{Gt.init(e,t),e._zod.parse=(a,i)=>{const l=a.value,u=t.left._zod.run({value:l,issues:[]},i),d=t.right._zod.run({value:l,issues:[]},i);return u instanceof Promise||d instanceof Promise?Promise.all([u,d]).then(([g,y])=>M0(a,g,y)):M0(a,u,d)}});function Fm(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ac(e)&&ac(t)){const a=Object.keys(t),i=Object.keys(e).filter(u=>a.indexOf(u)!==-1),l={...e,...t};for(const u of i){const d=Fm(e[u],t[u]);if(!d.valid)return{valid:!1,mergeErrorPath:[u,...d.mergeErrorPath]};l[u]=d.data}return{valid:!0,data:l}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const a=[];for(let i=0;i<e.length;i++){const l=e[i],u=t[i],d=Fm(l,u);if(!d.valid)return{valid:!1,mergeErrorPath:[i,...d.mergeErrorPath]};a.push(d.data)}return{valid:!0,data:a}}return{valid:!1,mergeErrorPath:[]}}function M0(e,t,a){if(t.issues.length&&e.issues.push(...t.issues),a.issues.length&&e.issues.push(...a.issues),ms(e))return e;const i=Fm(t.value,a.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const wK=re("$ZodEnum",(e,t)=>{Gt.init(e,t);const a=N6(t.entries),i=new Set(a);e._zod.values=i,e._zod.pattern=new RegExp(`^(${a.filter(l=>T6.has(typeof l)).map(l=>typeof l=="string"?Cs(l):l.toString()).join("|")})$`),e._zod.parse=(l,u)=>{const d=l.value;return i.has(d)||l.issues.push({code:"invalid_value",values:a,input:d,inst:e}),l}}),SK=re("$ZodLiteral",(e,t)=>{if(Gt.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(a=>typeof a=="string"?Cs(a):a?Cs(a.toString()):String(a)).join("|")})$`),e._zod.parse=(a,i)=>{const l=a.value;return e._zod.values.has(l)||a.issues.push({code:"invalid_value",values:t.values,input:l,inst:e}),a}}),_K=re("$ZodTransform",(e,t)=>{Gt.init(e,t),e._zod.parse=(a,i)=>{if(i.direction==="backward")throw new H_(e.constructor.name);const l=t.transform(a.value,a);if(i.async)return(l instanceof Promise?l:Promise.resolve(l)).then(d=>(a.value=d,a));if(l instanceof Promise)throw new bs;return a.value=l,a}});function k0(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const jK=re("$ZodOptional",(e,t)=>{Gt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Ot(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Ot(e._zod,"pattern",()=>{const a=t.innerType._zod.pattern;return a?new RegExp(`^(${Vg(a.source)})?$`):void 0}),e._zod.parse=(a,i)=>{if(t.innerType._zod.optin==="optional"){const l=t.innerType._zod.run(a,i);return l instanceof Promise?l.then(u=>k0(u,a.value)):k0(l,a.value)}return a.value===void 0?a:t.innerType._zod.run(a,i)}}),CK=re("$ZodNullable",(e,t)=>{Gt.init(e,t),Ot(e._zod,"optin",()=>t.innerType._zod.optin),Ot(e._zod,"optout",()=>t.innerType._zod.optout),Ot(e._zod,"pattern",()=>{const a=t.innerType._zod.pattern;return a?new RegExp(`^(${Vg(a.source)}|null)$`):void 0}),Ot(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(a,i)=>a.value===null?a:t.innerType._zod.run(a,i)}),EK=re("$ZodDefault",(e,t)=>{Gt.init(e,t),e._zod.optin="optional",Ot(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(a,i)=>{if(i.direction==="backward")return t.innerType._zod.run(a,i);if(a.value===void 0)return a.value=t.defaultValue,a;const l=t.innerType._zod.run(a,i);return l instanceof Promise?l.then(u=>z0(u,t)):z0(l,t)}});function z0(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const RK=re("$ZodPrefault",(e,t)=>{Gt.init(e,t),e._zod.optin="optional",Ot(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(a,i)=>(i.direction==="backward"||a.value===void 0&&(a.value=t.defaultValue),t.innerType._zod.run(a,i))}),NK=re("$ZodNonOptional",(e,t)=>{Gt.init(e,t),Ot(e._zod,"values",()=>{const a=t.innerType._zod.values;return a?new Set([...a].filter(i=>i!==void 0)):void 0}),e._zod.parse=(a,i)=>{const l=t.innerType._zod.run(a,i);return l instanceof Promise?l.then(u=>P0(u,e)):P0(l,e)}});function P0(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const OK=re("$ZodCatch",(e,t)=>{Gt.init(e,t),Ot(e._zod,"optin",()=>t.innerType._zod.optin),Ot(e._zod,"optout",()=>t.innerType._zod.optout),Ot(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(a,i)=>{if(i.direction==="backward")return t.innerType._zod.run(a,i);const l=t.innerType._zod.run(a,i);return l instanceof Promise?l.then(u=>(a.value=u.value,u.issues.length&&(a.value=t.catchValue({...a,error:{issues:u.issues.map(d=>io(d,i,ro()))},input:a.value}),a.issues=[]),a)):(a.value=l.value,l.issues.length&&(a.value=t.catchValue({...a,error:{issues:l.issues.map(u=>io(u,i,ro()))},input:a.value}),a.issues=[]),a)}}),AK=re("$ZodPipe",(e,t)=>{Gt.init(e,t),Ot(e._zod,"values",()=>t.in._zod.values),Ot(e._zod,"optin",()=>t.in._zod.optin),Ot(e._zod,"optout",()=>t.out._zod.optout),Ot(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(a,i)=>{if(i.direction==="backward"){const u=t.out._zod.run(a,i);return u instanceof Promise?u.then(d=>rd(d,t.in,i)):rd(u,t.in,i)}const l=t.in._zod.run(a,i);return l instanceof Promise?l.then(u=>rd(u,t.out,i)):rd(l,t.out,i)}});function rd(e,t,a){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},a)}const TK=re("$ZodReadonly",(e,t)=>{Gt.init(e,t),Ot(e._zod,"propValues",()=>t.innerType._zod.propValues),Ot(e._zod,"values",()=>t.innerType._zod.values),Ot(e._zod,"optin",()=>t.innerType._zod.optin),Ot(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(a,i)=>{if(i.direction==="backward")return t.innerType._zod.run(a,i);const l=t.innerType._zod.run(a,i);return l instanceof Promise?l.then(K0):K0(l)}});function K0(e){return e.value=Object.freeze(e.value),e}const DK=re("$ZodCustom",(e,t)=>{Yn.init(e,t),Gt.init(e,t),e._zod.parse=(a,i)=>a,e._zod.check=a=>{const i=a.value,l=t.fn(i);if(l instanceof Promise)return l.then(u=>I0(u,a,i,e));I0(l,a,i,e)}});function I0(e,t,a,i){if(!e){const l={code:"custom",input:a,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(l.params=i._zod.def.params),t.issues.push(rc(l))}}class MK{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...a){const i=a[0];if(this._map.set(t,i),i&&typeof i=="object"&&"id"in i){if(this._idmap.has(i.id))throw new Error(`ID ${i.id} already exists in the registry`);this._idmap.set(i.id,t)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const a=this._map.get(t);return a&&typeof a=="object"&&"id"in a&&this._idmap.delete(a.id),this._map.delete(t),this}get(t){const a=t._zod.parent;if(a){const i={...this.get(a)??{}};delete i.id;const l={...i,...this._map.get(t)};return Object.keys(l).length?l:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function kK(){return new MK}const id=kK();function zK(e,t){return new e({type:"string",...Ve(t)})}function PK(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ve(t)})}function L0(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ve(t)})}function cj(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ve(t)})}function KK(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ve(t)})}function IK(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ve(t)})}function LK(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ve(t)})}function UK(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ve(t)})}function qK(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ve(t)})}function FK(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ve(t)})}function $K(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ve(t)})}function VK(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ve(t)})}function BK(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ve(t)})}function GK(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ve(t)})}function HK(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ve(t)})}function XK(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ve(t)})}function ZK(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ve(t)})}function YK(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ve(t)})}function QK(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ve(t)})}function JK(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ve(t)})}function WK(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ve(t)})}function eI(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ve(t)})}function tI(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ve(t)})}function nI(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ve(t)})}function aI(e,t){return new e({type:"string",format:"date",check:"string_format",...Ve(t)})}function rI(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ve(t)})}function iI(e,t){return new e({type:"string",format:"duration",check:"string_format",...Ve(t)})}function oI(e,t){return new e({type:"number",checks:[],...Ve(t)})}function sI(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ve(t)})}function lI(e){return new e({type:"any"})}function cI(e){return new e({type:"unknown"})}function uI(e,t){return new e({type:"never",...Ve(t)})}function U0(e,t){return new aj({check:"less_than",...Ve(t),value:e,inclusive:!1})}function cm(e,t){return new aj({check:"less_than",...Ve(t),value:e,inclusive:!0})}function q0(e,t){return new rj({check:"greater_than",...Ve(t),value:e,inclusive:!1})}function um(e,t){return new rj({check:"greater_than",...Ve(t),value:e,inclusive:!0})}function F0(e,t){return new RP({check:"multiple_of",...Ve(t),value:e})}function uj(e,t){return new OP({check:"max_length",...Ve(t),maximum:e})}function Pd(e,t){return new AP({check:"min_length",...Ve(t),minimum:e})}function dj(e,t){return new TP({check:"length_equals",...Ve(t),length:e})}function dI(e,t){return new DP({check:"string_format",format:"regex",...Ve(t),pattern:e})}function fI(e){return new MP({check:"string_format",format:"lowercase",...Ve(e)})}function hI(e){return new kP({check:"string_format",format:"uppercase",...Ve(e)})}function pI(e,t){return new zP({check:"string_format",format:"includes",...Ve(t),includes:e})}function mI(e,t){return new PP({check:"string_format",format:"starts_with",...Ve(t),prefix:e})}function gI(e,t){return new KP({check:"string_format",format:"ends_with",...Ve(t),suffix:e})}function xc(e){return new IP({check:"overwrite",tx:e})}function yI(e){return xc(t=>t.normalize(e))}function vI(){return xc(e=>e.trim())}function xI(){return xc(e=>e.toLowerCase())}function bI(){return xc(e=>e.toUpperCase())}function wI(e,t,a){return new e({type:"array",element:t,...Ve(a)})}function SI(e,t,a){return new e({type:"custom",check:"custom",fn:t,...Ve(a)})}function _I(e){const t=jI(a=>(a.addIssue=i=>{if(typeof i=="string")a.issues.push(rc(i,a.value,t._zod.def));else{const l=i;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=a.value),l.inst??(l.inst=t),l.continue??(l.continue=!t._zod.def.abort),a.issues.push(rc(l))}},e(a.value,a)));return t}function jI(e,t){const a=new Yn({check:"custom",...Ve(t)});return a._zod.check=e,a}function $0(e,t){try{var a=e()}catch(i){return t(i)}return a&&a.then?a.then(void 0,t):a}function CI(e,t){for(var a={};e.length;){var i=e[0],l=i.code,u=i.message,d=i.path.join(".");if(!a[d])if("unionErrors"in i){var f=i.unionErrors[0].errors[0];a[d]={message:f.message,type:f.code}}else a[d]={message:u,type:l};if("unionErrors"in i&&i.unionErrors.forEach(function(x){return x.errors.forEach(function(v){return e.push(v)})}),t){var g=a[d].types,y=g&&g[i.code];a[d]=Lg(d,t,a,l,y?[].concat(y,i.message):i.message)}e.shift()}return a}function EI(e,t){for(var a={};e.length;){var i=e[0],l=i.code,u=i.message,d=i.path.join(".");if(!a[d])if(i.code==="invalid_union"&&i.errors.length>0){var f=i.errors[0][0];a[d]={message:f.message,type:f.code}}else a[d]={message:u,type:l};if(i.code==="invalid_union"&&i.errors.forEach(function(x){return x.forEach(function(v){return e.push(v)})}),t){var g=a[d].types,y=g&&g[i.code];a[d]=Lg(d,t,a,l,y?[].concat(y,i.message):i.message)}e.shift()}return a}function dn(e,t,a){if(a===void 0&&(a={}),(function(i){return"_def"in i&&typeof i._def=="object"&&"typeName"in i._def})(e))return function(i,l,u){try{return Promise.resolve($0(function(){return Promise.resolve(e[a.mode==="sync"?"parse":"parseAsync"](i,t)).then(function(d){return u.shouldUseNativeValidation&&Um({},u),{errors:{},values:a.raw?Object.assign({},i):d}})},function(d){if((function(f){return Array.isArray(f?.issues)})(d))return{values:{},errors:E0(CI(d.errors,!u.shouldUseNativeValidation&&u.criteriaMode==="all"),u)};throw d}))}catch(d){return Promise.reject(d)}};if((function(i){return"_zod"in i&&typeof i._zod=="object"})(e))return function(i,l,u){try{return Promise.resolve($0(function(){return Promise.resolve((a.mode==="sync"?$6:V6)(e,i,t)).then(function(d){return u.shouldUseNativeValidation&&Um({},u),{errors:{},values:a.raw?Object.assign({},i):d}})},function(d){if((function(f){return f instanceof Gg})(d))return{values:{},errors:E0(EI(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 RI=re("ZodISODateTime",(e,t)=>{JP.init(e,t),qt.init(e,t)});function NI(e){return nI(RI,e)}const OI=re("ZodISODate",(e,t)=>{WP.init(e,t),qt.init(e,t)});function AI(e){return aI(OI,e)}const TI=re("ZodISOTime",(e,t)=>{eK.init(e,t),qt.init(e,t)});function DI(e){return rI(TI,e)}const MI=re("ZodISODuration",(e,t)=>{tK.init(e,t),qt.init(e,t)});function kI(e){return iI(MI,e)}const zI=(e,t)=>{Gg.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:a=>F6(e,a)},flatten:{value:a=>q6(e,a)},addIssue:{value:a=>{e.issues.push(a),e.message=JSON.stringify(e.issues,qm,2)}},addIssues:{value:a=>{e.issues.push(...a),e.message=JSON.stringify(e.issues,qm,2)}},isEmpty:{get(){return e.issues.length===0}}})},Aa=re("ZodError",zI,{Parent:Error}),PI=mf(Aa),KI=gf(Aa),II=yf(Aa),LI=vf(Aa),UI=H6(Aa),qI=X6(Aa),FI=Z6(Aa),$I=Y6(Aa),VI=Q6(Aa),BI=J6(Aa),GI=W6(Aa),HI=eP(Aa),Yt=re("ZodType",(e,t)=>(Gt.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...a)=>e.clone(co(t,{checks:[...t.checks??[],...a.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]})),e.clone=(a,i)=>Ei(e,a,i),e.brand=()=>e,e.register=((a,i)=>(a.add(e,i),e)),e.parse=(a,i)=>PI(e,a,i,{callee:e.parse}),e.safeParse=(a,i)=>II(e,a,i),e.parseAsync=async(a,i)=>KI(e,a,i,{callee:e.parseAsync}),e.safeParseAsync=async(a,i)=>LI(e,a,i),e.spa=e.safeParseAsync,e.encode=(a,i)=>UI(e,a,i),e.decode=(a,i)=>qI(e,a,i),e.encodeAsync=async(a,i)=>FI(e,a,i),e.decodeAsync=async(a,i)=>$I(e,a,i),e.safeEncode=(a,i)=>VI(e,a,i),e.safeDecode=(a,i)=>BI(e,a,i),e.safeEncodeAsync=async(a,i)=>GI(e,a,i),e.safeDecodeAsync=async(a,i)=>HI(e,a,i),e.refine=(a,i)=>e.check(L8(a,i)),e.superRefine=a=>e.check(U8(a)),e.overwrite=a=>e.check(xc(a)),e.optional=()=>X0(e),e.nullable=()=>Z0(e),e.nullish=()=>X0(Z0(e)),e.nonoptional=a=>D8(e,a),e.array=()=>v8(e),e.or=a=>w8([e,a]),e.and=a=>_8(e,a),e.transform=a=>Y0(e,E8(a)),e.default=a=>O8(e,a),e.prefault=a=>T8(e,a),e.catch=a=>k8(e,a),e.pipe=a=>Y0(e,a),e.readonly=()=>K8(e),e.describe=a=>{const i=e.clone();return id.add(i,{description:a}),i},Object.defineProperty(e,"description",{get(){return id.get(e)?.description},configurable:!0}),e.meta=(...a)=>{if(a.length===0)return id.get(e);const i=e.clone();return id.add(i,a[0]),i},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),fj=re("_ZodString",(e,t)=>{Hg.init(e,t),Yt.init(e,t);const a=e._zod.bag;e.format=a.format??null,e.minLength=a.minimum??null,e.maxLength=a.maximum??null,e.regex=(...i)=>e.check(dI(...i)),e.includes=(...i)=>e.check(pI(...i)),e.startsWith=(...i)=>e.check(mI(...i)),e.endsWith=(...i)=>e.check(gI(...i)),e.min=(...i)=>e.check(Pd(...i)),e.max=(...i)=>e.check(uj(...i)),e.length=(...i)=>e.check(dj(...i)),e.nonempty=(...i)=>e.check(Pd(1,...i)),e.lowercase=i=>e.check(fI(i)),e.uppercase=i=>e.check(hI(i)),e.trim=()=>e.check(vI()),e.normalize=(...i)=>e.check(yI(...i)),e.toLowerCase=()=>e.check(xI()),e.toUpperCase=()=>e.check(bI())}),XI=re("ZodString",(e,t)=>{Hg.init(e,t),fj.init(e,t),e.email=a=>e.check(PK(ZI,a)),e.url=a=>e.check(UK(YI,a)),e.jwt=a=>e.check(tI(d8,a)),e.emoji=a=>e.check(qK(QI,a)),e.guid=a=>e.check(L0(V0,a)),e.uuid=a=>e.check(cj(Bl,a)),e.uuidv4=a=>e.check(KK(Bl,a)),e.uuidv6=a=>e.check(IK(Bl,a)),e.uuidv7=a=>e.check(LK(Bl,a)),e.nanoid=a=>e.check(FK(JI,a)),e.guid=a=>e.check(L0(V0,a)),e.cuid=a=>e.check($K(WI,a)),e.cuid2=a=>e.check(VK(e8,a)),e.ulid=a=>e.check(BK(t8,a)),e.base64=a=>e.check(JK(l8,a)),e.base64url=a=>e.check(WK(c8,a)),e.xid=a=>e.check(GK(n8,a)),e.ksuid=a=>e.check(HK(a8,a)),e.ipv4=a=>e.check(XK(r8,a)),e.ipv6=a=>e.check(ZK(i8,a)),e.cidrv4=a=>e.check(YK(o8,a)),e.cidrv6=a=>e.check(QK(s8,a)),e.e164=a=>e.check(eI(u8,a)),e.datetime=a=>e.check(NI(a)),e.date=a=>e.check(AI(a)),e.time=a=>e.check(DI(a)),e.duration=a=>e.check(kI(a))});function Pt(e){return zK(XI,e)}const qt=re("ZodStringFormat",(e,t)=>{Lt.init(e,t),fj.init(e,t)}),ZI=re("ZodEmail",(e,t)=>{$P.init(e,t),qt.init(e,t)}),V0=re("ZodGUID",(e,t)=>{qP.init(e,t),qt.init(e,t)}),Bl=re("ZodUUID",(e,t)=>{FP.init(e,t),qt.init(e,t)});function hj(e){return cj(Bl,e)}const YI=re("ZodURL",(e,t)=>{VP.init(e,t),qt.init(e,t)}),QI=re("ZodEmoji",(e,t)=>{BP.init(e,t),qt.init(e,t)}),JI=re("ZodNanoID",(e,t)=>{GP.init(e,t),qt.init(e,t)}),WI=re("ZodCUID",(e,t)=>{HP.init(e,t),qt.init(e,t)}),e8=re("ZodCUID2",(e,t)=>{XP.init(e,t),qt.init(e,t)}),t8=re("ZodULID",(e,t)=>{ZP.init(e,t),qt.init(e,t)}),n8=re("ZodXID",(e,t)=>{YP.init(e,t),qt.init(e,t)}),a8=re("ZodKSUID",(e,t)=>{QP.init(e,t),qt.init(e,t)}),r8=re("ZodIPv4",(e,t)=>{nK.init(e,t),qt.init(e,t)}),i8=re("ZodIPv6",(e,t)=>{aK.init(e,t),qt.init(e,t)}),o8=re("ZodCIDRv4",(e,t)=>{rK.init(e,t),qt.init(e,t)}),s8=re("ZodCIDRv6",(e,t)=>{iK.init(e,t),qt.init(e,t)}),l8=re("ZodBase64",(e,t)=>{oK.init(e,t),qt.init(e,t)}),c8=re("ZodBase64URL",(e,t)=>{lK.init(e,t),qt.init(e,t)}),u8=re("ZodE164",(e,t)=>{cK.init(e,t),qt.init(e,t)}),d8=re("ZodJWT",(e,t)=>{dK.init(e,t),qt.init(e,t)}),pj=re("ZodNumber",(e,t)=>{oj.init(e,t),Yt.init(e,t),e.gt=(i,l)=>e.check(q0(i,l)),e.gte=(i,l)=>e.check(um(i,l)),e.min=(i,l)=>e.check(um(i,l)),e.lt=(i,l)=>e.check(U0(i,l)),e.lte=(i,l)=>e.check(cm(i,l)),e.max=(i,l)=>e.check(cm(i,l)),e.int=i=>e.check(B0(i)),e.safe=i=>e.check(B0(i)),e.positive=i=>e.check(q0(0,i)),e.nonnegative=i=>e.check(um(0,i)),e.negative=i=>e.check(U0(0,i)),e.nonpositive=i=>e.check(cm(0,i)),e.multipleOf=(i,l)=>e.check(F0(i,l)),e.step=(i,l)=>e.check(F0(i,l)),e.finite=()=>e;const a=e._zod.bag;e.minValue=Math.max(a.minimum??Number.NEGATIVE_INFINITY,a.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(a.maximum??Number.POSITIVE_INFINITY,a.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(a.format??"").includes("int")||Number.isSafeInteger(a.multipleOf??.5),e.isFinite=!0,e.format=a.format??null});function Kd(e){return oI(pj,e)}const f8=re("ZodNumberFormat",(e,t)=>{fK.init(e,t),pj.init(e,t)});function B0(e){return sI(f8,e)}const h8=re("ZodAny",(e,t)=>{hK.init(e,t),Yt.init(e,t)});function G0(){return lI(h8)}const p8=re("ZodUnknown",(e,t)=>{pK.init(e,t),Yt.init(e,t)});function H0(){return cI(p8)}const m8=re("ZodNever",(e,t)=>{mK.init(e,t),Yt.init(e,t)});function g8(e){return uI(m8,e)}const y8=re("ZodArray",(e,t)=>{gK.init(e,t),Yt.init(e,t),e.element=t.element,e.min=(a,i)=>e.check(Pd(a,i)),e.nonempty=a=>e.check(Pd(1,a)),e.max=(a,i)=>e.check(uj(a,i)),e.length=(a,i)=>e.check(dj(a,i)),e.unwrap=()=>e.element});function v8(e,t){return wI(y8,e,t)}const x8=re("ZodObject",(e,t)=>{vK.init(e,t),Yt.init(e,t),Ot(e,"shape",()=>t.shape),e.keyof=()=>Fa(Object.keys(e._zod.def.shape)),e.catchall=a=>e.clone({...e._zod.def,catchall:a}),e.passthrough=()=>e.clone({...e._zod.def,catchall:H0()}),e.loose=()=>e.clone({...e._zod.def,catchall:H0()}),e.strict=()=>e.clone({...e._zod.def,catchall:g8()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=a=>P6(e,a),e.safeExtend=a=>K6(e,a),e.merge=a=>I6(e,a),e.pick=a=>k6(e,a),e.omit=a=>z6(e,a),e.partial=(...a)=>L6(mj,e,a[0]),e.required=(...a)=>U6(gj,e,a[0])});function pa(e,t){const a={type:"object",shape:e??{},...Ve(t)};return new x8(a)}const b8=re("ZodUnion",(e,t)=>{xK.init(e,t),Yt.init(e,t),e.options=t.options});function w8(e,t){return new b8({type:"union",options:e,...Ve(t)})}const S8=re("ZodIntersection",(e,t)=>{bK.init(e,t),Yt.init(e,t)});function _8(e,t){return new S8({type:"intersection",left:e,right:t})}const $m=re("ZodEnum",(e,t)=>{wK.init(e,t),Yt.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const a=new Set(Object.keys(t.entries));e.extract=(i,l)=>{const u={};for(const d of i)if(a.has(d))u[d]=t.entries[d];else throw new Error(`Key ${d} not found in enum`);return new $m({...t,checks:[],...Ve(l),entries:u})},e.exclude=(i,l)=>{const u={...t.entries};for(const d of i)if(a.has(d))delete u[d];else throw new Error(`Key ${d} not found in enum`);return new $m({...t,checks:[],...Ve(l),entries:u})}});function Fa(e,t){const a=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new $m({type:"enum",entries:a,...Ve(t)})}const j8=re("ZodLiteral",(e,t)=>{SK.init(e,t),Yt.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Id(e,t){return new j8({type:"literal",values:Array.isArray(e)?e:[e],...Ve(t)})}const C8=re("ZodTransform",(e,t)=>{_K.init(e,t),Yt.init(e,t),e._zod.parse=(a,i)=>{if(i.direction==="backward")throw new H_(e.constructor.name);a.addIssue=u=>{if(typeof u=="string")a.issues.push(rc(u,a.value,t));else{const d=u;d.fatal&&(d.continue=!1),d.code??(d.code="custom"),d.input??(d.input=a.value),d.inst??(d.inst=e),a.issues.push(rc(d))}};const l=t.transform(a.value,a);return l instanceof Promise?l.then(u=>(a.value=u,a)):(a.value=l,a)}});function E8(e){return new C8({type:"transform",transform:e})}const mj=re("ZodOptional",(e,t)=>{jK.init(e,t),Yt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function X0(e){return new mj({type:"optional",innerType:e})}const R8=re("ZodNullable",(e,t)=>{CK.init(e,t),Yt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Z0(e){return new R8({type:"nullable",innerType:e})}const N8=re("ZodDefault",(e,t)=>{EK.init(e,t),Yt.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function O8(e,t){return new N8({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Y_(t)}})}const A8=re("ZodPrefault",(e,t)=>{RK.init(e,t),Yt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function T8(e,t){return new A8({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Y_(t)}})}const gj=re("ZodNonOptional",(e,t)=>{NK.init(e,t),Yt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function D8(e,t){return new gj({type:"nonoptional",innerType:e,...Ve(t)})}const M8=re("ZodCatch",(e,t)=>{OK.init(e,t),Yt.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function k8(e,t){return new M8({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const z8=re("ZodPipe",(e,t)=>{AK.init(e,t),Yt.init(e,t),e.in=t.in,e.out=t.out});function Y0(e,t){return new z8({type:"pipe",in:e,out:t})}const P8=re("ZodReadonly",(e,t)=>{TK.init(e,t),Yt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function K8(e){return new P8({type:"readonly",innerType:e})}const I8=re("ZodCustom",(e,t)=>{DK.init(e,t),Yt.init(e,t)});function L8(e,t={}){return SI(I8,e,t)}function U8(e){return _I(e)}const pi={custom:"custom"};var q8=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],F8=q8.reduce((e,t)=>{const a=lc(`Primitive.${t}`),i=m.forwardRef((l,u)=>{const{asChild:d,...f}=l,g=d?a:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(g,{...f,ref:u})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{}),$8="Label",yj=m.forwardRef((e,t)=>o.jsx(F8.label,{...e,ref:t,onMouseDown:a=>{a.target.closest("button, input, select, textarea")||(e.onMouseDown?.(a),!a.defaultPrevented&&a.detail>1&&a.preventDefault())}}));yj.displayName=$8;var V8=yj;function Kr({className:e,...t}){return o.jsx(V8,{"data-slot":"label",className:de("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),...t})}const fn=u6,vj=m.createContext({}),Ke=({...e})=>o.jsx(vj.Provider,{value:{name:e.name},children:o.jsx(Pa,{...e})}),Xg=()=>{const e=m.useContext(vj),t=m.useContext(xj),{getFieldState:a}=hf(),i=U_({name:e.name}),l=a(e.name,i);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:u}=t;return{id:u,name:e.name,formItemId:`${u}-form-item`,formDescriptionId:`${u}-form-item-description`,formMessageId:`${u}-form-item-message`,...l}},xj=m.createContext({});function Ce({className:e,...t}){const a=m.useId();return o.jsx(xj.Provider,{value:{id:a},children:o.jsx("div",{"data-slot":"form-item",className:de("grid gap-2",e),...t})})}function Ee({className:e,...t}){const{error:a,formItemId:i}=Xg();return o.jsx(Kr,{"data-slot":"form-label","data-error":!!a,className:de("data-[error=true]:text-destructive",e),htmlFor:i,...t})}function Be({...e}){const{error:t,formItemId:a,formDescriptionId:i,formMessageId:l}=Xg();return o.jsx(Rs,{"data-slot":"form-control",id:a,"aria-describedby":t?`${i} ${l}`:`${i}`,"aria-invalid":!!t,...e})}function Pe({className:e,...t}){const{error:a,formMessageId:i}=Xg(),l=a?String(a?.message??""):t.children;return l?o.jsx("p",{"data-slot":"form-message",id:i,className:de("text-destructive text-sm",e),...t,children:l}):null}function da({className:e,...t}){return o.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:o.jsx("table",{"data-slot":"table",className:de("w-full caption-bottom text-sm",e),...t})})}function fa({className:e,...t}){return o.jsx("thead",{"data-slot":"table-header",className:de("[&_tr]:border-b",e),...t})}function ha({className:e,...t}){return o.jsx("tbody",{"data-slot":"table-body",className:de("[&_tr:last-child]:border-0",e),...t})}function tt({className:e,...t}){return o.jsx("tr",{"data-slot":"table-row",className:de("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function Ue({className:e,...t}){return o.jsx("th",{"data-slot":"table-head",className:de("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),...t})}function je({className:e,...t}){return o.jsx("td",{"data-slot":"table-cell",className:de("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function B8({className:e,...t}){return o.jsx("caption",{"data-slot":"table-caption",className:de("text-muted-foreground mt-4 text-sm",e),...t})}const bj=pa({key:Pt().trim().min(1,"Key is required").max(120,"Max 120 chars"),value:Pt().trim().optional()}),G8=bj.partial();function H8({t:e}){const t=`${e.key}${e.value?`=${e.value}`:""}`;return o.jsxs(ca,{variant:"secondary",className:"font-mono text-xs",children:[o.jsx(Vd,{className:"mr-1 h-3 w-3"}),t]})}const X8=()=>{const[e,t]=m.useState(""),[a,i]=m.useState(!1),[l,u]=m.useState(!1),[d,f]=m.useState(null),[g,y]=m.useState(null),x=Xn(),v=Zt({queryKey:["annotations"],queryFn:()=>$l.listAnnotations()}),w=un({resolver:dn(bj),defaultValues:{key:"",value:""}}),_=lt({mutationFn:E=>$l.createAnnotation(E),onSuccess:async()=>{await x.invalidateQueries({queryKey:["annotations"]}),w.reset(),i(!1),xe.success("Annotation Created Successfully.")},onError:E=>{xe.error(E.message??"There was an error while creating Annotation")}}),R=E=>{_.mutate(E)},S=un({resolver:dn(G8),defaultValues:{}}),A=lt({mutationFn:({id:E,values:D})=>$l.updateAnnotation(E,D),onSuccess:async()=>{await x.invalidateQueries({queryKey:["annotations"]}),S.reset(),u(!1),xe.success("Annotation Updated Successfully.")},onError:E=>{xe.error(E.message??"There was an error while updating Annotation")}}),M=E=>{y(E.id),S.reset({key:E.key,value:E.value}),u(!0)},T=lt({mutationFn:E=>$l.deleteAnnotation(E),onSuccess:async()=>{await x.invalidateQueries({queryKey:["annotations"]}),f(null),xe.success("Annotation Deleted Successfully.")},onError:E=>{xe.error(E.message??"There was an error while deleting Annotation")}}),N=m.useMemo(()=>{const E=v.data??[],D=e.trim().toLowerCase();return D?E.filter(I=>I.key?.toLowerCase().includes(D)||I.value?.toLowerCase().includes(D)):E},[e,v.data]);return v.isLoading?o.jsx("div",{className:"p-6",children:"Loading annotations…"}):v.error?o.jsxs("div",{className:"p-6 text-red-500",children:["Error loading annotations.",o.jsx("pre",{children:JSON.stringify(v,null,2)})]}):o.jsxs("div",{className:"space-y-4 p-6",children:[o.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[o.jsx("h1",{className:"mb-4 text-2xl font-bold",children:"Annotations"}),o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsxs("div",{className:"relative",children:[o.jsx(dr,{className:"absolute top-2.5 left-2 h-4 w-4 opacity-60"}),o.jsx(Ae,{value:e,onChange:E=>t(E.target.value),placeholder:"Search annotations",className:"w-64 pl-8"})]}),o.jsxs(bt,{open:a,onOpenChange:i,children:[o.jsx(Xa,{asChild:!0,children:o.jsxs(ie,{onClick:()=>i(!0),children:[o.jsx(Si,{className:"mr-2 h-4 w-4"}),"Create Annotation"]})}),o.jsxs(wt,{className:"sm:max-w-lg",children:[o.jsx(St,{children:o.jsx(_t,{children:"Create Label"})}),o.jsx(fn,{...w,children:o.jsxs("form",{className:"space-y-4",onSubmit:w.handleSubmit(R),children:[o.jsx(Ke,{control:w.control,name:"key",render:({field:E})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Key"}),o.jsx(Be,{children:o.jsx(Ae,{placeholder:"environment",...E})}),o.jsx(Pe,{})]})}),o.jsx(Ke,{control:w.control,name:"value",render:({field:E})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Value"}),o.jsx(Be,{children:o.jsx(Ae,{placeholder:"dev",...E})}),o.jsx(Pe,{})]})}),o.jsxs(Nt,{className:"gap-2",children:[o.jsx(ie,{type:"button",variant:"outline",onClick:()=>i(!1),children:"Cancel"}),o.jsx(ie,{type:"submit",disabled:w.formState.isSubmitting,children:w.formState.isSubmitting?"Creating…":"Create"})]})]})})]})]})]})]}),o.jsx("div",{className:"bg-background overflow-hidden rounded-2xl border shadow-sm",children:o.jsx("div",{className:"overflow-x-auto",children:o.jsxs(da,{children:[o.jsx(fa,{children:o.jsxs(tt,{children:[o.jsx(Ue,{children:"Key"}),o.jsx(Ue,{children:"Value"}),o.jsx(Ue,{children:"Annotation"}),o.jsx(Ue,{className:"w-[180px] text-right",children:"Actions"})]})}),o.jsxs(ha,{children:[N.map(E=>o.jsxs(tt,{children:[o.jsx(je,{children:E.key}),o.jsx(je,{children:E.value}),o.jsx(je,{children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(H8,{t:E}),o.jsx("code",{className:"text-muted-foreground text-xs",children:Ji(E.id,6)})]})}),o.jsx(je,{children:o.jsxs("div",{className:"flex justify-end gap-2",children:[o.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>M(E),children:[o.jsx(sc,{className:"mr-2 h-4 w-4"})," Edit"]}),o.jsx(ie,{variant:"destructive",size:"sm",onClick:()=>f(E.id),disabled:T.isPending&&d===E.id,children:T.isPending&&d===E.id?"Deleting…":"Delete"})]})})]},E.id)),N.length===0&&o.jsx(tt,{children:o.jsxs(je,{colSpan:4,className:"text-muted-foreground py-10 text-center",children:[o.jsx(sg,{className:"mx-auto mb-2 h-6 w-6 opacity-60"}),"No labels match your search."]})})]})]})})}),o.jsx(bt,{open:l,onOpenChange:u,children:o.jsxs(wt,{className:"sm:max-w-lg",children:[o.jsx(St,{children:o.jsx(_t,{children:"Edit Annotation"})}),o.jsx(fn,{...S,children:o.jsxs("form",{className:"space-y-4",onSubmit:S.handleSubmit(E=>{g&&A.mutate({id:g,values:E})}),children:[o.jsx(Ke,{control:S.control,name:"key",render:({field:E})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Key"}),o.jsx(Be,{children:o.jsx(Ae,{placeholder:"dedicated",...E})}),o.jsx(Pe,{})]})}),o.jsx(Ke,{control:S.control,name:"value",render:({field:E})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Value (optional)"}),o.jsx(Be,{children:o.jsx(Ae,{placeholder:"gpu",...E})}),o.jsx(Pe,{})]})}),o.jsxs(Nt,{className:"gap-2",children:[o.jsx(ie,{type:"button",variant:"outline",onClick:()=>u(!1),children:"Cancel"}),o.jsx(ie,{type:"submit",disabled:A.isPending,children:A.isPending?"Saving…":"Save changes"})]})]})})]})}),o.jsx(bt,{open:!!d,onOpenChange:E=>!E&&f(null),children:o.jsxs(wt,{className:"sm:max-w-md",children:[o.jsx(St,{children:o.jsx(_t,{children:"Delete annotation"})}),o.jsx("p",{className:"text-muted-foreground text-sm",children:"This action cannot be undone. Are you sure you want to delete this annotation?"}),o.jsxs(Nt,{className:"gap-2",children:[o.jsx(ie,{variant:"outline",onClick:()=>f(null),children:"Cancel"}),o.jsx(ie,{variant:"destructive",onClick:()=>d&&T.mutate(d),disabled:T.isPending,children:T.isPending?"Deleting…":"Delete"})]})]})})]})};function $a({className:e,...t}){return o.jsx("div",{"data-slot":"card",className:de("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function hr({className:e,...t}){return o.jsx("div",{"data-slot":"card-header",className:de("@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),...t})}function pr({className:e,...t}){return o.jsx("div",{"data-slot":"card-title",className:de("leading-none font-semibold",e),...t})}function Vm({className:e,...t}){return o.jsx("div",{"data-slot":"card-description",className:de("text-muted-foreground text-sm",e),...t})}function Va({className:e,...t}){return o.jsx("div",{"data-slot":"card-content",className:de("px-6",e),...t})}function Z8(e,t="gsot-auth",a=520,i=640){const l=window.top.outerHeight/2+window.top.screenY-i/2,u=window.top.outerWidth/2+window.top.screenX-a/2;return window.open(e,t,`toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=${a},height=${i},top=${l},left=${u}`)}async function Y8(e){const t=new URLSearchParams({mode:"spa",origin:window.location.origin}),a=await fetch(`${ug}/auth/${e}/start?`+t,{method:"POST"});if(!a.ok)throw new Error("Failed to start auth");return(await a.json()).auth_url}const Q0=()=>{const e=CN(),t=tg(),a=m.useMemo(()=>{const l=new URLSearchParams(t.search).get("to")||"/me";try{const u=new URL(l,window.location.origin);return u.origin===window.location.origin?u.pathname+u.search:"/me"}catch{return"/me"}},[t.search]);m.useEffect(()=>{jn.get()?.access_token&&e(a,{replace:!0})},[e,a]),m.useEffect(()=>{const l=u=>{if(!(typeof u.data=="object"&&u.data?.type==="autoglue:auth"))return;const f=u.data.payload;jn.set(f),e(a,{replace:!0})};return window.addEventListener("message",l),()=>window.removeEventListener("message",l)},[e,a]);const i=async l=>{const u=await Y8(l);Z8(u)||alert("Please allow popups to sign in.")};return o.jsx("div",{className:"mx-auto flex items-center justify-center p-4",children:o.jsxs($a,{className:"w-full max-w-md",children:[o.jsxs(hr,{children:[o.jsx(pr,{className:"text-lg md:text-xl",children:"Sign In"}),o.jsx(Vm,{className:"text-xs md:text-sm",children:"Continue with a provider below to access your account."})]}),o.jsx(Va,{children:o.jsx("div",{className:"grid gap-4",children:o.jsx("div",{className:de("flex w-full items-center gap-2","flex-col justify-between"),children:o.jsxs(ie,{variant:"outline",className:"w-full gap-2",onClick:()=>i("google"),children:[o.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:[o.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"}),o.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"}),o.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"}),o.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"]})})})})]})})},is=xD(),Ml={listCredentials:()=>ze(async()=>await is.listCredentials()),createCredential:async e=>ze(async()=>await is.createCredential({body:e})),getCredential:async e=>ze(async()=>await is.getCredential({id:e})),deleteCredential:async e=>ze(async()=>{await is.deleteCredential({id:e})}),updateCredential:async(e,t)=>ze(async()=>await is.updateCredential({id:e,body:t})),revealCredential:async e=>ze(async()=>await is.revealCredential({id:e}))};var Q8=Symbol("radix.slottable");function J8(e){const t=({children:a})=>o.jsx(o.Fragment,{children:a});return t.displayName=`${e}.Slottable`,t.__radixId=Q8,t}var wj="AlertDialog",[W8]=Za(wj,[Y1]),Ur=Y1(),Sj=e=>{const{__scopeAlertDialog:t,...a}=e,i=Ur(t);return o.jsx(of,{...i,...a,modal:!0})};Sj.displayName=wj;var eL="AlertDialogTrigger",_j=m.forwardRef((e,t)=>{const{__scopeAlertDialog:a,...i}=e,l=Ur(a);return o.jsx(f_,{...l,...i,ref:t})});_j.displayName=eL;var tL="AlertDialogPortal",jj=e=>{const{__scopeAlertDialog:t,...a}=e,i=Ur(t);return o.jsx(sf,{...i,...a})};jj.displayName=tL;var nL="AlertDialogOverlay",Cj=m.forwardRef((e,t)=>{const{__scopeAlertDialog:a,...i}=e,l=Ur(a);return o.jsx(lf,{...l,...i,ref:t})});Cj.displayName=nL;var ws="AlertDialogContent",[aL,rL]=W8(ws),iL=J8("AlertDialogContent"),Ej=m.forwardRef((e,t)=>{const{__scopeAlertDialog:a,children:i,...l}=e,u=Ur(a),d=m.useRef(null),f=dt(t,d),g=m.useRef(null);return o.jsx(m3,{contentName:ws,titleName:Rj,docsSlug:"alert-dialog",children:o.jsx(aL,{scope:a,cancelRef:g,children:o.jsxs(cf,{role:"alertdialog",...u,...l,ref:f,onOpenAutoFocus:Re(l.onOpenAutoFocus,y=>{y.preventDefault(),g.current?.focus({preventScroll:!0})}),onPointerDownOutside:y=>y.preventDefault(),onInteractOutside:y=>y.preventDefault(),children:[o.jsx(iL,{children:i}),o.jsx(sL,{contentRef:d})]})})})});Ej.displayName=ws;var Rj="AlertDialogTitle",Nj=m.forwardRef((e,t)=>{const{__scopeAlertDialog:a,...i}=e,l=Ur(a);return o.jsx(Rg,{...l,...i,ref:t})});Nj.displayName=Rj;var Oj="AlertDialogDescription",Aj=m.forwardRef((e,t)=>{const{__scopeAlertDialog:a,...i}=e,l=Ur(a);return o.jsx(Ng,{...l,...i,ref:t})});Aj.displayName=Oj;var oL="AlertDialogAction",Tj=m.forwardRef((e,t)=>{const{__scopeAlertDialog:a,...i}=e,l=Ur(a);return o.jsx(mc,{...l,...i,ref:t})});Tj.displayName=oL;var Dj="AlertDialogCancel",Mj=m.forwardRef((e,t)=>{const{__scopeAlertDialog:a,...i}=e,{cancelRef:l}=rL(Dj,a),u=Ur(a),d=dt(t,l);return o.jsx(mc,{...u,...i,ref:d})});Mj.displayName=Dj;var sL=({contentRef:e})=>{const t=`\`${ws}\` requires a description for the component to be accessible for screen reader users.
|
|
|
|
You can add a description to the \`${ws}\` by passing a \`${Oj}\` 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 \`${ws}\`. 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 m.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},lL=Sj,cL=_j,uL=jj,dL=Cj,fL=Ej,hL=Tj,pL=Mj,mL=Nj,gL=Aj;function kj({...e}){return o.jsx(lL,{"data-slot":"alert-dialog",...e})}function zj({...e}){return o.jsx(cL,{"data-slot":"alert-dialog-trigger",...e})}function yL({...e}){return o.jsx(uL,{"data-slot":"alert-dialog-portal",...e})}function vL({className:e,...t}){return o.jsx(dL,{"data-slot":"alert-dialog-overlay",className:de("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),...t})}function Pj({className:e,...t}){return o.jsxs(yL,{children:[o.jsx(vL,{}),o.jsx(fL,{"data-slot":"alert-dialog-content",className:de("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),...t})]})}function Kj({className:e,...t}){return o.jsx("div",{"data-slot":"alert-dialog-header",className:de("flex flex-col gap-2 text-center sm:text-left",e),...t})}function Ij({className:e,...t}){return o.jsx("div",{"data-slot":"alert-dialog-footer",className:de("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function Lj({className:e,...t}){return o.jsx(mL,{"data-slot":"alert-dialog-title",className:de("text-lg font-semibold",e),...t})}function Uj({className:e,...t}){return o.jsx(gL,{"data-slot":"alert-dialog-description",className:de("text-muted-foreground text-sm",e),...t})}function qj({className:e,...t}){return o.jsx(hL,{className:de(hg(),e),...t})}function Fj({className:e,...t}){return o.jsx(pL,{className:de(hg({variant:"outline"}),e),...t})}function J0(e){const t=xL(e),a=m.forwardRef((i,l)=>{const{children:u,...d}=i,f=m.Children.toArray(u),g=f.find(wL);if(g){const y=g.props.children,x=f.map(v=>v===g?m.Children.count(y)>1?m.Children.only(null):m.isValidElement(y)?y.props.children:null:v);return o.jsx(t,{...d,ref:l,children:m.isValidElement(y)?m.cloneElement(y,void 0,x):null})}return o.jsx(t,{...d,ref:l,children:u})});return a.displayName=`${e}.Slot`,a}function xL(e){const t=m.forwardRef((a,i)=>{const{children:l,...u}=a;if(m.isValidElement(l)){const d=_L(l),f=SL(u,l.props);return l.type!==m.Fragment&&(f.ref=i?Mn(i,d):d),m.cloneElement(l,f)}return m.Children.count(l)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var bL=Symbol("radix.slottable");function wL(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===bL}function SL(e,t){const a={...t};for(const i in t){const l=e[i],u=t[i];/^on[A-Z]/.test(i)?l&&u?a[i]=(...f)=>{const g=u(...f);return l(...f),g}:l&&(a[i]=l):i==="style"?a[i]={...l,...u}:i==="className"&&(a[i]=[l,u].filter(Boolean).join(" "))}return{...e,...a}}function _L(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning;return a?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}function Zg(e){const t=e+"CollectionProvider",[a,i]=Za(t),[l,u]=a(t,{collectionRef:{current:null},itemMap:new Map}),d=S=>{const{scope:A,children:M}=S,T=Q.useRef(null),N=Q.useRef(new Map).current;return o.jsx(l,{scope:A,itemMap:N,collectionRef:T,children:M})};d.displayName=t;const f=e+"CollectionSlot",g=J0(f),y=Q.forwardRef((S,A)=>{const{scope:M,children:T}=S,N=u(f,M),E=dt(A,N.collectionRef);return o.jsx(g,{ref:E,children:T})});y.displayName=f;const x=e+"CollectionItemSlot",v="data-radix-collection-item",w=J0(x),_=Q.forwardRef((S,A)=>{const{scope:M,children:T,...N}=S,E=Q.useRef(null),D=dt(A,E),I=u(x,M);return Q.useEffect(()=>(I.itemMap.set(E,{ref:E,...N}),()=>void I.itemMap.delete(E))),o.jsx(w,{[v]:"",ref:D,children:T})});_.displayName=x;function R(S){const A=u(e+"CollectionConsumer",S);return Q.useCallback(()=>{const T=A.collectionRef.current;if(!T)return[];const N=Array.from(T.querySelectorAll(`[${v}]`));return Array.from(A.itemMap.values()).sort((I,U)=>N.indexOf(I.ref.current)-N.indexOf(U.ref.current))},[A.collectionRef,A.itemMap])}return[{Provider:d,Slot:y,ItemSlot:_},R,i]}var jL=m.createContext(void 0);function Yg(e){const t=m.useContext(jL);return e||t||"ltr"}var dm="rovingFocusGroup.onEntryFocus",CL={bubbles:!1,cancelable:!0},bc="RovingFocusGroup",[Bm,$j,EL]=Zg(bc),[RL,Vj]=Za(bc,[EL]),[NL,OL]=RL(bc),Bj=m.forwardRef((e,t)=>o.jsx(Bm.Provider,{scope:e.__scopeRovingFocusGroup,children:o.jsx(Bm.Slot,{scope:e.__scopeRovingFocusGroup,children:o.jsx(AL,{...e,ref:t})})}));Bj.displayName=bc;var AL=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:a,orientation:i,loop:l=!1,dir:u,currentTabStopId:d,defaultCurrentTabStopId:f,onCurrentTabStopIdChange:g,onEntryFocus:y,preventScrollOnEntryFocus:x=!1,...v}=e,w=m.useRef(null),_=dt(t,w),R=Yg(u),[S,A]=xi({prop:d,defaultProp:f??null,onChange:g,caller:bc}),[M,T]=m.useState(!1),N=Ba(y),E=$j(a),D=m.useRef(!1),[I,U]=m.useState(0);return m.useEffect(()=>{const F=w.current;if(F)return F.addEventListener(dm,N),()=>F.removeEventListener(dm,N)},[N]),o.jsx(NL,{scope:a,orientation:i,dir:R,loop:l,currentTabStopId:S,onItemFocus:m.useCallback(F=>A(F),[A]),onItemShiftTab:m.useCallback(()=>T(!0),[]),onFocusableItemAdd:m.useCallback(()=>U(F=>F+1),[]),onFocusableItemRemove:m.useCallback(()=>U(F=>F-1),[]),children:o.jsx(at.div,{tabIndex:M||I===0?-1:0,"data-orientation":i,...v,ref:_,style:{outline:"none",...e.style},onMouseDown:Re(e.onMouseDown,()=>{D.current=!0}),onFocus:Re(e.onFocus,F=>{const fe=!D.current;if(F.target===F.currentTarget&&fe&&!M){const ge=new CustomEvent(dm,CL);if(F.currentTarget.dispatchEvent(ge),!ge.defaultPrevented){const he=E().filter(O=>O.focusable),ne=he.find(O=>O.active),le=he.find(O=>O.id===S),ve=[ne,le,...he].filter(Boolean).map(O=>O.ref.current);Xj(ve,x)}}D.current=!1}),onBlur:Re(e.onBlur,()=>T(!1))})})}),Gj="RovingFocusGroupItem",Hj=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:a,focusable:i=!0,active:l=!1,tabStopId:u,children:d,...f}=e,g=Cn(),y=u||g,x=OL(Gj,a),v=x.currentTabStopId===y,w=$j(a),{onFocusableItemAdd:_,onFocusableItemRemove:R,currentTabStopId:S}=x;return m.useEffect(()=>{if(i)return _(),()=>R()},[i,_,R]),o.jsx(Bm.ItemSlot,{scope:a,id:y,focusable:i,active:l,children:o.jsx(at.span,{tabIndex:v?0:-1,"data-orientation":x.orientation,...f,ref:t,onMouseDown:Re(e.onMouseDown,A=>{i?x.onItemFocus(y):A.preventDefault()}),onFocus:Re(e.onFocus,()=>x.onItemFocus(y)),onKeyDown:Re(e.onKeyDown,A=>{if(A.key==="Tab"&&A.shiftKey){x.onItemShiftTab();return}if(A.target!==A.currentTarget)return;const M=ML(A,x.orientation,x.dir);if(M!==void 0){if(A.metaKey||A.ctrlKey||A.altKey||A.shiftKey)return;A.preventDefault();let N=w().filter(E=>E.focusable).map(E=>E.ref.current);if(M==="last")N.reverse();else if(M==="prev"||M==="next"){M==="prev"&&N.reverse();const E=N.indexOf(A.currentTarget);N=x.loop?kL(N,E+1):N.slice(E+1)}setTimeout(()=>Xj(N))}}),children:typeof d=="function"?d({isCurrentTabStop:v,hasTabStop:S!=null}):d})})});Hj.displayName=Gj;var TL={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function DL(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function ML(e,t,a){const i=DL(e.key,a);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return TL[i]}function Xj(e,t=!1){const a=document.activeElement;for(const i of e)if(i===a||(i.focus({preventScroll:t}),document.activeElement!==a))return}function kL(e,t){return e.map((a,i)=>e[(t+i)%e.length])}var zL=Bj,PL=Hj;function KL(e){const t=IL(e),a=m.forwardRef((i,l)=>{const{children:u,...d}=i,f=m.Children.toArray(u),g=f.find(UL);if(g){const y=g.props.children,x=f.map(v=>v===g?m.Children.count(y)>1?m.Children.only(null):m.isValidElement(y)?y.props.children:null:v);return o.jsx(t,{...d,ref:l,children:m.isValidElement(y)?m.cloneElement(y,void 0,x):null})}return o.jsx(t,{...d,ref:l,children:u})});return a.displayName=`${e}.Slot`,a}function IL(e){const t=m.forwardRef((a,i)=>{const{children:l,...u}=a;if(m.isValidElement(l)){const d=FL(l),f=qL(u,l.props);return l.type!==m.Fragment&&(f.ref=i?Mn(i,d):d),m.cloneElement(l,f)}return m.Children.count(l)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var LL=Symbol("radix.slottable");function UL(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===LL}function qL(e,t){const a={...t};for(const i in t){const l=e[i],u=t[i];/^on[A-Z]/.test(i)?l&&u?a[i]=(...f)=>{const g=u(...f);return l(...f),g}:l&&(a[i]=l):i==="style"?a[i]={...l,...u}:i==="className"&&(a[i]=[l,u].filter(Boolean).join(" "))}return{...e,...a}}function FL(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning;return a?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var Gm=["Enter"," "],$L=["ArrowDown","PageUp","Home"],Zj=["ArrowUp","PageDown","End"],VL=[...$L,...Zj],BL={ltr:[...Gm,"ArrowRight"],rtl:[...Gm,"ArrowLeft"]},GL={ltr:["ArrowLeft"],rtl:["ArrowRight"]},wc="Menu",[ic,HL,XL]=Zg(wc),[uo,Yj]=Za(wc,[XL,_i,Vj]),bf=_i(),Qj=Vj(),[ZL,fo]=uo(wc),[YL,Sc]=uo(wc),Jj=e=>{const{__scopeMenu:t,open:a=!1,children:i,dir:l,onOpenChange:u,modal:d=!0}=e,f=bf(t),[g,y]=m.useState(null),x=m.useRef(!1),v=Ba(u),w=Yg(l);return m.useEffect(()=>{const _=()=>{x.current=!0,document.addEventListener("pointerdown",R,{capture:!0,once:!0}),document.addEventListener("pointermove",R,{capture:!0,once:!0})},R=()=>x.current=!1;return document.addEventListener("keydown",_,{capture:!0}),()=>{document.removeEventListener("keydown",_,{capture:!0}),document.removeEventListener("pointerdown",R,{capture:!0}),document.removeEventListener("pointermove",R,{capture:!0})}},[]),o.jsx(Yd,{...f,children:o.jsx(ZL,{scope:t,open:a,onOpenChange:v,content:g,onContentChange:y,children:o.jsx(YL,{scope:t,onClose:m.useCallback(()=>v(!1),[v]),isUsingKeyboardRef:x,dir:w,modal:d,children:i})})})};Jj.displayName=wc;var QL="MenuAnchor",Qg=m.forwardRef((e,t)=>{const{__scopeMenu:a,...i}=e,l=bf(a);return o.jsx(uc,{...l,...i,ref:t})});Qg.displayName=QL;var Jg="MenuPortal",[JL,Wj]=uo(Jg,{forceMount:void 0}),eC=e=>{const{__scopeMenu:t,forceMount:a,children:i,container:l}=e,u=fo(Jg,t);return o.jsx(JL,{scope:t,forceMount:a,children:o.jsx(Oa,{present:a||u.open,children:o.jsx(Ms,{asChild:!0,container:l,children:i})})})};eC.displayName=Jg;var Ra="MenuContent",[WL,Wg]=uo(Ra),tC=m.forwardRef((e,t)=>{const a=Wj(Ra,e.__scopeMenu),{forceMount:i=a.forceMount,...l}=e,u=fo(Ra,e.__scopeMenu),d=Sc(Ra,e.__scopeMenu);return o.jsx(ic.Provider,{scope:e.__scopeMenu,children:o.jsx(Oa,{present:i||u.open,children:o.jsx(ic.Slot,{scope:e.__scopeMenu,children:d.modal?o.jsx(eU,{...l,ref:t}):o.jsx(tU,{...l,ref:t})})})})}),eU=m.forwardRef((e,t)=>{const a=fo(Ra,e.__scopeMenu),i=m.useRef(null),l=dt(t,i);return m.useEffect(()=>{const u=i.current;if(u)return af(u)},[]),o.jsx(ey,{...e,ref:l,trapFocus:a.open,disableOutsidePointerEvents:a.open,disableOutsideScroll:!0,onFocusOutside:Re(e.onFocusOutside,u=>u.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>a.onOpenChange(!1)})}),tU=m.forwardRef((e,t)=>{const a=fo(Ra,e.__scopeMenu);return o.jsx(ey,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>a.onOpenChange(!1)})}),nU=KL("MenuContent.ScrollLock"),ey=m.forwardRef((e,t)=>{const{__scopeMenu:a,loop:i=!1,trapFocus:l,onOpenAutoFocus:u,onCloseAutoFocus:d,disableOutsidePointerEvents:f,onEntryFocus:g,onEscapeKeyDown:y,onPointerDownOutside:x,onFocusOutside:v,onInteractOutside:w,onDismiss:_,disableOutsideScroll:R,...S}=e,A=fo(Ra,a),M=Sc(Ra,a),T=bf(a),N=Qj(a),E=HL(a),[D,I]=m.useState(null),U=m.useRef(null),F=dt(t,U,A.onContentChange),fe=m.useRef(0),ge=m.useRef(""),he=m.useRef(0),ne=m.useRef(null),le=m.useRef("right"),ce=m.useRef(0),ve=R?pc:m.Fragment,O=R?{as:nU,allowPinchZoom:!0}:void 0,j=J=>{const me=ge.current+J,Te=E().filter(ee=>!ee.disabled),H=document.activeElement,Y=Te.find(ee=>ee.ref.current===H)?.textValue,oe=Te.map(ee=>ee.textValue),se=pU(oe,me,Y),we=Te.find(ee=>ee.textValue===se)?.ref.current;(function ee(Se){ge.current=Se,window.clearTimeout(fe.current),Se!==""&&(fe.current=window.setTimeout(()=>ee(""),1e3))})(me),we&&setTimeout(()=>we.focus())};m.useEffect(()=>()=>window.clearTimeout(fe.current),[]),tf();const z=m.useCallback(J=>le.current===ne.current?.side&&gU(J,ne.current?.area),[]);return o.jsx(WL,{scope:a,searchRef:ge,onItemEnter:m.useCallback(J=>{z(J)&&J.preventDefault()},[z]),onItemLeave:m.useCallback(J=>{z(J)||(U.current?.focus(),I(null))},[z]),onTriggerLeave:m.useCallback(J=>{z(J)&&J.preventDefault()},[z]),pointerGraceTimerRef:he,onPointerGraceIntentChange:m.useCallback(J=>{ne.current=J},[]),children:o.jsx(ve,{...O,children:o.jsx(hc,{asChild:!0,trapped:l,onMountAutoFocus:Re(u,J=>{J.preventDefault(),U.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:d,children:o.jsx(As,{asChild:!0,disableOutsidePointerEvents:f,onEscapeKeyDown:y,onPointerDownOutside:x,onFocusOutside:v,onInteractOutside:w,onDismiss:_,children:o.jsx(zL,{asChild:!0,...N,dir:M.dir,orientation:"vertical",loop:i,currentTabStopId:D,onCurrentTabStopIdChange:I,onEntryFocus:Re(g,J=>{M.isUsingKeyboardRef.current||J.preventDefault()}),preventScrollOnEntryFocus:!0,children:o.jsx(Qd,{role:"menu","aria-orientation":"vertical","data-state":yC(A.open),"data-radix-menu-content":"",dir:M.dir,...T,...S,ref:F,style:{outline:"none",...S.style},onKeyDown:Re(S.onKeyDown,J=>{const Te=J.target.closest("[data-radix-menu-content]")===J.currentTarget,H=J.ctrlKey||J.altKey||J.metaKey,Y=J.key.length===1;Te&&(J.key==="Tab"&&J.preventDefault(),!H&&Y&&j(J.key));const oe=U.current;if(J.target!==oe||!VL.includes(J.key))return;J.preventDefault();const we=E().filter(ee=>!ee.disabled).map(ee=>ee.ref.current);Zj.includes(J.key)&&we.reverse(),fU(we)}),onBlur:Re(e.onBlur,J=>{J.currentTarget.contains(J.target)||(window.clearTimeout(fe.current),ge.current="")}),onPointerMove:Re(e.onPointerMove,oc(J=>{const me=J.target,Te=ce.current!==J.clientX;if(J.currentTarget.contains(me)&&Te){const H=J.clientX>ce.current?"right":"left";le.current=H,ce.current=J.clientX}}))})})})})})})});tC.displayName=Ra;var aU="MenuGroup",ty=m.forwardRef((e,t)=>{const{__scopeMenu:a,...i}=e;return o.jsx(at.div,{role:"group",...i,ref:t})});ty.displayName=aU;var rU="MenuLabel",nC=m.forwardRef((e,t)=>{const{__scopeMenu:a,...i}=e;return o.jsx(at.div,{...i,ref:t})});nC.displayName=rU;var Ld="MenuItem",W0="menu.itemSelect",wf=m.forwardRef((e,t)=>{const{disabled:a=!1,onSelect:i,...l}=e,u=m.useRef(null),d=Sc(Ld,e.__scopeMenu),f=Wg(Ld,e.__scopeMenu),g=dt(t,u),y=m.useRef(!1),x=()=>{const v=u.current;if(!a&&v){const w=new CustomEvent(W0,{bubbles:!0,cancelable:!0});v.addEventListener(W0,_=>i?.(_),{once:!0}),WS(v,w),w.defaultPrevented?y.current=!1:d.onClose()}};return o.jsx(aC,{...l,ref:g,disabled:a,onClick:Re(e.onClick,x),onPointerDown:v=>{e.onPointerDown?.(v),y.current=!0},onPointerUp:Re(e.onPointerUp,v=>{y.current||v.currentTarget?.click()}),onKeyDown:Re(e.onKeyDown,v=>{const w=f.searchRef.current!=="";a||w&&v.key===" "||Gm.includes(v.key)&&(v.currentTarget.click(),v.preventDefault())})})});wf.displayName=Ld;var aC=m.forwardRef((e,t)=>{const{__scopeMenu:a,disabled:i=!1,textValue:l,...u}=e,d=Wg(Ld,a),f=Qj(a),g=m.useRef(null),y=dt(t,g),[x,v]=m.useState(!1),[w,_]=m.useState("");return m.useEffect(()=>{const R=g.current;R&&_((R.textContent??"").trim())},[u.children]),o.jsx(ic.ItemSlot,{scope:a,disabled:i,textValue:l??w,children:o.jsx(PL,{asChild:!0,...f,focusable:!i,children:o.jsx(at.div,{role:"menuitem","data-highlighted":x?"":void 0,"aria-disabled":i||void 0,"data-disabled":i?"":void 0,...u,ref:y,onPointerMove:Re(e.onPointerMove,oc(R=>{i?d.onItemLeave(R):(d.onItemEnter(R),R.defaultPrevented||R.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Re(e.onPointerLeave,oc(R=>d.onItemLeave(R))),onFocus:Re(e.onFocus,()=>v(!0)),onBlur:Re(e.onBlur,()=>v(!1))})})})}),iU="MenuCheckboxItem",rC=m.forwardRef((e,t)=>{const{checked:a=!1,onCheckedChange:i,...l}=e;return o.jsx(cC,{scope:e.__scopeMenu,checked:a,children:o.jsx(wf,{role:"menuitemcheckbox","aria-checked":Ud(a)?"mixed":a,...l,ref:t,"data-state":ay(a),onSelect:Re(l.onSelect,()=>i?.(Ud(a)?!0:!a),{checkForDefaultPrevented:!1})})})});rC.displayName=iU;var iC="MenuRadioGroup",[oU,sU]=uo(iC,{value:void 0,onValueChange:()=>{}}),oC=m.forwardRef((e,t)=>{const{value:a,onValueChange:i,...l}=e,u=Ba(i);return o.jsx(oU,{scope:e.__scopeMenu,value:a,onValueChange:u,children:o.jsx(ty,{...l,ref:t})})});oC.displayName=iC;var sC="MenuRadioItem",lC=m.forwardRef((e,t)=>{const{value:a,...i}=e,l=sU(sC,e.__scopeMenu),u=a===l.value;return o.jsx(cC,{scope:e.__scopeMenu,checked:u,children:o.jsx(wf,{role:"menuitemradio","aria-checked":u,...i,ref:t,"data-state":ay(u),onSelect:Re(i.onSelect,()=>l.onValueChange?.(a),{checkForDefaultPrevented:!1})})})});lC.displayName=sC;var ny="MenuItemIndicator",[cC,lU]=uo(ny,{checked:!1}),uC=m.forwardRef((e,t)=>{const{__scopeMenu:a,forceMount:i,...l}=e,u=lU(ny,a);return o.jsx(Oa,{present:i||Ud(u.checked)||u.checked===!0,children:o.jsx(at.span,{...l,ref:t,"data-state":ay(u.checked)})})});uC.displayName=ny;var cU="MenuSeparator",dC=m.forwardRef((e,t)=>{const{__scopeMenu:a,...i}=e;return o.jsx(at.div,{role:"separator","aria-orientation":"horizontal",...i,ref:t})});dC.displayName=cU;var uU="MenuArrow",fC=m.forwardRef((e,t)=>{const{__scopeMenu:a,...i}=e,l=bf(a);return o.jsx(Jd,{...l,...i,ref:t})});fC.displayName=uU;var dU="MenuSub",[Kq,hC]=uo(dU),Gl="MenuSubTrigger",pC=m.forwardRef((e,t)=>{const a=fo(Gl,e.__scopeMenu),i=Sc(Gl,e.__scopeMenu),l=hC(Gl,e.__scopeMenu),u=Wg(Gl,e.__scopeMenu),d=m.useRef(null),{pointerGraceTimerRef:f,onPointerGraceIntentChange:g}=u,y={__scopeMenu:e.__scopeMenu},x=m.useCallback(()=>{d.current&&window.clearTimeout(d.current),d.current=null},[]);return m.useEffect(()=>x,[x]),m.useEffect(()=>{const v=f.current;return()=>{window.clearTimeout(v),g(null)}},[f,g]),o.jsx(Qg,{asChild:!0,...y,children:o.jsx(aC,{id:l.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":l.contentId,"data-state":yC(a.open),...e,ref:Mn(t,l.onTriggerChange),onClick:v=>{e.onClick?.(v),!(e.disabled||v.defaultPrevented)&&(v.currentTarget.focus(),a.open||a.onOpenChange(!0))},onPointerMove:Re(e.onPointerMove,oc(v=>{u.onItemEnter(v),!v.defaultPrevented&&!e.disabled&&!a.open&&!d.current&&(u.onPointerGraceIntentChange(null),d.current=window.setTimeout(()=>{a.onOpenChange(!0),x()},100))})),onPointerLeave:Re(e.onPointerLeave,oc(v=>{x();const w=a.content?.getBoundingClientRect();if(w){const _=a.content?.dataset.side,R=_==="right",S=R?-5:5,A=w[R?"left":"right"],M=w[R?"right":"left"];u.onPointerGraceIntentChange({area:[{x:v.clientX+S,y:v.clientY},{x:A,y:w.top},{x:M,y:w.top},{x:M,y:w.bottom},{x:A,y:w.bottom}],side:_}),window.clearTimeout(f.current),f.current=window.setTimeout(()=>u.onPointerGraceIntentChange(null),300)}else{if(u.onTriggerLeave(v),v.defaultPrevented)return;u.onPointerGraceIntentChange(null)}})),onKeyDown:Re(e.onKeyDown,v=>{const w=u.searchRef.current!=="";e.disabled||w&&v.key===" "||BL[i.dir].includes(v.key)&&(a.onOpenChange(!0),a.content?.focus(),v.preventDefault())})})})});pC.displayName=Gl;var mC="MenuSubContent",gC=m.forwardRef((e,t)=>{const a=Wj(Ra,e.__scopeMenu),{forceMount:i=a.forceMount,...l}=e,u=fo(Ra,e.__scopeMenu),d=Sc(Ra,e.__scopeMenu),f=hC(mC,e.__scopeMenu),g=m.useRef(null),y=dt(t,g);return o.jsx(ic.Provider,{scope:e.__scopeMenu,children:o.jsx(Oa,{present:i||u.open,children:o.jsx(ic.Slot,{scope:e.__scopeMenu,children:o.jsx(ey,{id:f.contentId,"aria-labelledby":f.triggerId,...l,ref:y,align:"start",side:d.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:x=>{d.isUsingKeyboardRef.current&&g.current?.focus(),x.preventDefault()},onCloseAutoFocus:x=>x.preventDefault(),onFocusOutside:Re(e.onFocusOutside,x=>{x.target!==f.trigger&&u.onOpenChange(!1)}),onEscapeKeyDown:Re(e.onEscapeKeyDown,x=>{d.onClose(),x.preventDefault()}),onKeyDown:Re(e.onKeyDown,x=>{const v=x.currentTarget.contains(x.target),w=GL[d.dir].includes(x.key);v&&w&&(u.onOpenChange(!1),f.trigger?.focus(),x.preventDefault())})})})})})});gC.displayName=mC;function yC(e){return e?"open":"closed"}function Ud(e){return e==="indeterminate"}function ay(e){return Ud(e)?"indeterminate":e?"checked":"unchecked"}function fU(e){const t=document.activeElement;for(const a of e)if(a===t||(a.focus(),document.activeElement!==t))return}function hU(e,t){return e.map((a,i)=>e[(t+i)%e.length])}function pU(e,t,a){const l=t.length>1&&Array.from(t).every(y=>y===t[0])?t[0]:t,u=a?e.indexOf(a):-1;let d=hU(e,Math.max(u,0));l.length===1&&(d=d.filter(y=>y!==a));const g=d.find(y=>y.toLowerCase().startsWith(l.toLowerCase()));return g!==a?g:void 0}function mU(e,t){const{x:a,y:i}=e;let l=!1;for(let u=0,d=t.length-1;u<t.length;d=u++){const f=t[u],g=t[d],y=f.x,x=f.y,v=g.x,w=g.y;x>i!=w>i&&a<(v-y)*(i-x)/(w-x)+y&&(l=!l)}return l}function gU(e,t){if(!t)return!1;const a={x:e.clientX,y:e.clientY};return mU(a,t)}function oc(e){return t=>t.pointerType==="mouse"?e(t):void 0}var yU=Jj,vU=Qg,xU=eC,bU=tC,wU=ty,SU=nC,_U=wf,jU=rC,CU=oC,EU=lC,RU=uC,NU=dC,OU=fC,AU=pC,TU=gC,Sf="DropdownMenu",[DU]=Za(Sf,[Yj]),kn=Yj(),[MU,vC]=DU(Sf),xC=e=>{const{__scopeDropdownMenu:t,children:a,dir:i,open:l,defaultOpen:u,onOpenChange:d,modal:f=!0}=e,g=kn(t),y=m.useRef(null),[x,v]=xi({prop:l,defaultProp:u??!1,onChange:d,caller:Sf});return o.jsx(MU,{scope:t,triggerId:Cn(),triggerRef:y,contentId:Cn(),open:x,onOpenChange:v,onOpenToggle:m.useCallback(()=>v(w=>!w),[v]),modal:f,children:o.jsx(yU,{...g,open:x,onOpenChange:v,dir:i,modal:f,children:a})})};xC.displayName=Sf;var bC="DropdownMenuTrigger",wC=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:a,disabled:i=!1,...l}=e,u=vC(bC,a),d=kn(a);return o.jsx(vU,{asChild:!0,...d,children:o.jsx(at.button,{type:"button",id:u.triggerId,"aria-haspopup":"menu","aria-expanded":u.open,"aria-controls":u.open?u.contentId:void 0,"data-state":u.open?"open":"closed","data-disabled":i?"":void 0,disabled:i,...l,ref:Mn(t,u.triggerRef),onPointerDown:Re(e.onPointerDown,f=>{!i&&f.button===0&&f.ctrlKey===!1&&(u.onOpenToggle(),u.open||f.preventDefault())}),onKeyDown:Re(e.onKeyDown,f=>{i||(["Enter"," "].includes(f.key)&&u.onOpenToggle(),f.key==="ArrowDown"&&u.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(f.key)&&f.preventDefault())})})})});wC.displayName=bC;var kU="DropdownMenuPortal",SC=e=>{const{__scopeDropdownMenu:t,...a}=e,i=kn(t);return o.jsx(xU,{...i,...a})};SC.displayName=kU;var _C="DropdownMenuContent",jC=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:a,...i}=e,l=vC(_C,a),u=kn(a),d=m.useRef(!1);return o.jsx(bU,{id:l.contentId,"aria-labelledby":l.triggerId,...u,...i,ref:t,onCloseAutoFocus:Re(e.onCloseAutoFocus,f=>{d.current||l.triggerRef.current?.focus(),d.current=!1,f.preventDefault()}),onInteractOutside:Re(e.onInteractOutside,f=>{const g=f.detail.originalEvent,y=g.button===0&&g.ctrlKey===!0,x=g.button===2||y;(!l.modal||x)&&(d.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});jC.displayName=_C;var zU="DropdownMenuGroup",PU=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:a,...i}=e,l=kn(a);return o.jsx(wU,{...l,...i,ref:t})});PU.displayName=zU;var KU="DropdownMenuLabel",IU=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:a,...i}=e,l=kn(a);return o.jsx(SU,{...l,...i,ref:t})});IU.displayName=KU;var LU="DropdownMenuItem",CC=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:a,...i}=e,l=kn(a);return o.jsx(_U,{...l,...i,ref:t})});CC.displayName=LU;var UU="DropdownMenuCheckboxItem",qU=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:a,...i}=e,l=kn(a);return o.jsx(jU,{...l,...i,ref:t})});qU.displayName=UU;var FU="DropdownMenuRadioGroup",$U=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:a,...i}=e,l=kn(a);return o.jsx(CU,{...l,...i,ref:t})});$U.displayName=FU;var VU="DropdownMenuRadioItem",BU=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:a,...i}=e,l=kn(a);return o.jsx(EU,{...l,...i,ref:t})});BU.displayName=VU;var GU="DropdownMenuItemIndicator",HU=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:a,...i}=e,l=kn(a);return o.jsx(RU,{...l,...i,ref:t})});HU.displayName=GU;var XU="DropdownMenuSeparator",ZU=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:a,...i}=e,l=kn(a);return o.jsx(NU,{...l,...i,ref:t})});ZU.displayName=XU;var YU="DropdownMenuArrow",QU=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:a,...i}=e,l=kn(a);return o.jsx(OU,{...l,...i,ref:t})});QU.displayName=YU;var JU="DropdownMenuSubTrigger",WU=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:a,...i}=e,l=kn(a);return o.jsx(AU,{...l,...i,ref:t})});WU.displayName=JU;var e7="DropdownMenuSubContent",t7=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:a,...i}=e,l=kn(a);return o.jsx(TU,{...l,...i,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});t7.displayName=e7;var n7=xC,a7=wC,r7=SC,i7=jC,o7=CC;function EC({...e}){return o.jsx(n7,{"data-slot":"dropdown-menu",...e})}function RC({...e}){return o.jsx(a7,{"data-slot":"dropdown-menu-trigger",...e})}function NC({className:e,sideOffset:t=4,...a}){return o.jsx(r7,{children:o.jsx(i7,{"data-slot":"dropdown-menu-content",sideOffset:t,className:de("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 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...a})})}function Jl({className:e,inset:t,variant:a="default",...i}){return o.jsx(o7,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":a,className:de("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_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]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...i})}function eS(e,[t,a]){return Math.min(a,Math.max(t,e))}function s7(e){const t=l7(e),a=m.forwardRef((i,l)=>{const{children:u,...d}=i,f=m.Children.toArray(u),g=f.find(u7);if(g){const y=g.props.children,x=f.map(v=>v===g?m.Children.count(y)>1?m.Children.only(null):m.isValidElement(y)?y.props.children:null:v);return o.jsx(t,{...d,ref:l,children:m.isValidElement(y)?m.cloneElement(y,void 0,x):null})}return o.jsx(t,{...d,ref:l,children:u})});return a.displayName=`${e}.Slot`,a}function l7(e){const t=m.forwardRef((a,i)=>{const{children:l,...u}=a;if(m.isValidElement(l)){const d=f7(l),f=d7(u,l.props);return l.type!==m.Fragment&&(f.ref=i?Mn(i,d):d),m.cloneElement(l,f)}return m.Children.count(l)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var c7=Symbol("radix.slottable");function u7(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===c7}function d7(e,t){const a={...t};for(const i in t){const l=e[i],u=t[i];/^on[A-Z]/.test(i)?l&&u?a[i]=(...f)=>{const g=u(...f);return l(...f),g}:l&&(a[i]=l):i==="style"?a[i]={...l,...u}:i==="className"&&(a[i]=[l,u].filter(Boolean).join(" "))}return{...e,...a}}function f7(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning;return a?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}function OC(e){const t=m.useRef({value:e,previous:e});return m.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var h7=[" ","Enter","ArrowUp","ArrowDown"],p7=[" ","Enter"],oo="Select",[_f,jf,m7]=Zg(oo),[zs]=Za(oo,[m7,_i]),Cf=_i(),[g7,Ri]=zs(oo),[y7,v7]=zs(oo),AC=e=>{const{__scopeSelect:t,children:a,open:i,defaultOpen:l,onOpenChange:u,value:d,defaultValue:f,onValueChange:g,dir:y,name:x,autoComplete:v,disabled:w,required:_,form:R}=e,S=Cf(t),[A,M]=m.useState(null),[T,N]=m.useState(null),[E,D]=m.useState(!1),I=Yg(y),[U,F]=xi({prop:i,defaultProp:l??!1,onChange:u,caller:oo}),[fe,ge]=xi({prop:d,defaultProp:f,onChange:g,caller:oo}),he=m.useRef(null),ne=A?R||!!A.closest("form"):!0,[le,ce]=m.useState(new Set),ve=Array.from(le).map(O=>O.props.value).join(";");return o.jsx(Yd,{...S,children:o.jsxs(g7,{required:_,scope:t,trigger:A,onTriggerChange:M,valueNode:T,onValueNodeChange:N,valueNodeHasChildren:E,onValueNodeHasChildrenChange:D,contentId:Cn(),value:fe,onValueChange:ge,open:U,onOpenChange:F,dir:I,triggerPointerDownPosRef:he,disabled:w,children:[o.jsx(_f.Provider,{scope:t,children:o.jsx(y7,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback(O=>{ce(j=>new Set(j).add(O))},[]),onNativeOptionRemove:m.useCallback(O=>{ce(j=>{const z=new Set(j);return z.delete(O),z})},[]),children:a})}),ne?o.jsxs(JC,{"aria-hidden":!0,required:_,tabIndex:-1,name:x,autoComplete:v,value:fe,onChange:O=>ge(O.target.value),disabled:w,form:R,children:[fe===void 0?o.jsx("option",{value:""}):null,Array.from(le)]},ve):null]})})};AC.displayName=oo;var TC="SelectTrigger",DC=m.forwardRef((e,t)=>{const{__scopeSelect:a,disabled:i=!1,...l}=e,u=Cf(a),d=Ri(TC,a),f=d.disabled||i,g=dt(t,d.onTriggerChange),y=jf(a),x=m.useRef("touch"),[v,w,_]=eE(S=>{const A=y().filter(N=>!N.disabled),M=A.find(N=>N.value===d.value),T=tE(A,S,M);T!==void 0&&d.onValueChange(T.value)}),R=S=>{f||(d.onOpenChange(!0),_()),S&&(d.triggerPointerDownPosRef.current={x:Math.round(S.pageX),y:Math.round(S.pageY)})};return o.jsx(uc,{asChild:!0,...u,children:o.jsx(at.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:f,"data-disabled":f?"":void 0,"data-placeholder":WC(d.value)?"":void 0,...l,ref:g,onClick:Re(l.onClick,S=>{S.currentTarget.focus(),x.current!=="mouse"&&R(S)}),onPointerDown:Re(l.onPointerDown,S=>{x.current=S.pointerType;const A=S.target;A.hasPointerCapture(S.pointerId)&&A.releasePointerCapture(S.pointerId),S.button===0&&S.ctrlKey===!1&&S.pointerType==="mouse"&&(R(S),S.preventDefault())}),onKeyDown:Re(l.onKeyDown,S=>{const A=v.current!=="";!(S.ctrlKey||S.altKey||S.metaKey)&&S.key.length===1&&w(S.key),!(A&&S.key===" ")&&h7.includes(S.key)&&(R(),S.preventDefault())})})})});DC.displayName=TC;var MC="SelectValue",kC=m.forwardRef((e,t)=>{const{__scopeSelect:a,className:i,style:l,children:u,placeholder:d="",...f}=e,g=Ri(MC,a),{onValueNodeHasChildrenChange:y}=g,x=u!==void 0,v=dt(t,g.onValueNodeChange);return hn(()=>{y(x)},[y,x]),o.jsx(at.span,{...f,ref:v,style:{pointerEvents:"none"},children:WC(g.value)?o.jsx(o.Fragment,{children:d}):u})});kC.displayName=MC;var x7="SelectIcon",zC=m.forwardRef((e,t)=>{const{__scopeSelect:a,children:i,...l}=e;return o.jsx(at.span,{"aria-hidden":!0,...l,ref:t,children:i||"▼"})});zC.displayName=x7;var b7="SelectPortal",PC=e=>o.jsx(Ms,{asChild:!0,...e});PC.displayName=b7;var so="SelectContent",KC=m.forwardRef((e,t)=>{const a=Ri(so,e.__scopeSelect),[i,l]=m.useState();if(hn(()=>{l(new DocumentFragment)},[]),!a.open){const u=i;return u?$d.createPortal(o.jsx(IC,{scope:e.__scopeSelect,children:o.jsx(_f.Slot,{scope:e.__scopeSelect,children:o.jsx("div",{children:e.children})})}),u):null}return o.jsx(LC,{...e,ref:t})});KC.displayName=so;var Ka=10,[IC,Ni]=zs(so),w7="SelectContentImpl",S7=s7("SelectContent.RemoveScroll"),LC=m.forwardRef((e,t)=>{const{__scopeSelect:a,position:i="item-aligned",onCloseAutoFocus:l,onEscapeKeyDown:u,onPointerDownOutside:d,side:f,sideOffset:g,align:y,alignOffset:x,arrowPadding:v,collisionBoundary:w,collisionPadding:_,sticky:R,hideWhenDetached:S,avoidCollisions:A,...M}=e,T=Ri(so,a),[N,E]=m.useState(null),[D,I]=m.useState(null),U=dt(t,ee=>E(ee)),[F,fe]=m.useState(null),[ge,he]=m.useState(null),ne=jf(a),[le,ce]=m.useState(!1),ve=m.useRef(!1);m.useEffect(()=>{if(N)return af(N)},[N]),tf();const O=m.useCallback(ee=>{const[Se,...De]=ne().map(Ye=>Ye.ref.current),[He]=De.slice(-1),Qe=document.activeElement;for(const Ye of ee)if(Ye===Qe||(Ye?.scrollIntoView({block:"nearest"}),Ye===Se&&D&&(D.scrollTop=0),Ye===He&&D&&(D.scrollTop=D.scrollHeight),Ye?.focus(),document.activeElement!==Qe))return},[ne,D]),j=m.useCallback(()=>O([F,N]),[O,F,N]);m.useEffect(()=>{le&&j()},[le,j]);const{onOpenChange:z,triggerPointerDownPosRef:J}=T;m.useEffect(()=>{if(N){let ee={x:0,y:0};const Se=He=>{ee={x:Math.abs(Math.round(He.pageX)-(J.current?.x??0)),y:Math.abs(Math.round(He.pageY)-(J.current?.y??0))}},De=He=>{ee.x<=10&&ee.y<=10?He.preventDefault():N.contains(He.target)||z(!1),document.removeEventListener("pointermove",Se),J.current=null};return J.current!==null&&(document.addEventListener("pointermove",Se),document.addEventListener("pointerup",De,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Se),document.removeEventListener("pointerup",De,{capture:!0})}}},[N,z,J]),m.useEffect(()=>{const ee=()=>z(!1);return window.addEventListener("blur",ee),window.addEventListener("resize",ee),()=>{window.removeEventListener("blur",ee),window.removeEventListener("resize",ee)}},[z]);const[me,Te]=eE(ee=>{const Se=ne().filter(Qe=>!Qe.disabled),De=Se.find(Qe=>Qe.ref.current===document.activeElement),He=tE(Se,ee,De);He&&setTimeout(()=>He.ref.current.focus())}),H=m.useCallback((ee,Se,De)=>{const He=!ve.current&&!De;(T.value!==void 0&&T.value===Se||He)&&(fe(ee),He&&(ve.current=!0))},[T.value]),Y=m.useCallback(()=>N?.focus(),[N]),oe=m.useCallback((ee,Se,De)=>{const He=!ve.current&&!De;(T.value!==void 0&&T.value===Se||He)&&he(ee)},[T.value]),se=i==="popper"?Hm:UC,we=se===Hm?{side:f,sideOffset:g,align:y,alignOffset:x,arrowPadding:v,collisionBoundary:w,collisionPadding:_,sticky:R,hideWhenDetached:S,avoidCollisions:A}:{};return o.jsx(IC,{scope:a,content:N,viewport:D,onViewportChange:I,itemRefCallback:H,selectedItem:F,onItemLeave:Y,itemTextRefCallback:oe,focusSelectedItem:j,selectedItemText:ge,position:i,isPositioned:le,searchRef:me,children:o.jsx(pc,{as:S7,allowPinchZoom:!0,children:o.jsx(hc,{asChild:!0,trapped:T.open,onMountAutoFocus:ee=>{ee.preventDefault()},onUnmountAutoFocus:Re(l,ee=>{T.trigger?.focus({preventScroll:!0}),ee.preventDefault()}),children:o.jsx(As,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:ee=>ee.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:o.jsx(se,{role:"listbox",id:T.contentId,"data-state":T.open?"open":"closed",dir:T.dir,onContextMenu:ee=>ee.preventDefault(),...M,...we,onPlaced:()=>ce(!0),ref:U,style:{display:"flex",flexDirection:"column",outline:"none",...M.style},onKeyDown:Re(M.onKeyDown,ee=>{const Se=ee.ctrlKey||ee.altKey||ee.metaKey;if(ee.key==="Tab"&&ee.preventDefault(),!Se&&ee.key.length===1&&Te(ee.key),["ArrowUp","ArrowDown","Home","End"].includes(ee.key)){let He=ne().filter(Qe=>!Qe.disabled).map(Qe=>Qe.ref.current);if(["ArrowUp","End"].includes(ee.key)&&(He=He.slice().reverse()),["ArrowUp","ArrowDown"].includes(ee.key)){const Qe=ee.target,Ye=He.indexOf(Qe);He=He.slice(Ye+1)}setTimeout(()=>O(He)),ee.preventDefault()}})})})})})})});LC.displayName=w7;var _7="SelectItemAlignedPosition",UC=m.forwardRef((e,t)=>{const{__scopeSelect:a,onPlaced:i,...l}=e,u=Ri(so,a),d=Ni(so,a),[f,g]=m.useState(null),[y,x]=m.useState(null),v=dt(t,U=>x(U)),w=jf(a),_=m.useRef(!1),R=m.useRef(!0),{viewport:S,selectedItem:A,selectedItemText:M,focusSelectedItem:T}=d,N=m.useCallback(()=>{if(u.trigger&&u.valueNode&&f&&y&&S&&A&&M){const U=u.trigger.getBoundingClientRect(),F=y.getBoundingClientRect(),fe=u.valueNode.getBoundingClientRect(),ge=M.getBoundingClientRect();if(u.dir!=="rtl"){const Qe=ge.left-F.left,Ye=fe.left-Qe,Ft=U.left-Ye,G=U.width+Ft,Xe=Math.max(G,F.width),qe=window.innerWidth-Ka,Je=eS(Ye,[Ka,Math.max(Ka,qe-Xe)]);f.style.minWidth=G+"px",f.style.left=Je+"px"}else{const Qe=F.right-ge.right,Ye=window.innerWidth-fe.right-Qe,Ft=window.innerWidth-U.right-Ye,G=U.width+Ft,Xe=Math.max(G,F.width),qe=window.innerWidth-Ka,Je=eS(Ye,[Ka,Math.max(Ka,qe-Xe)]);f.style.minWidth=G+"px",f.style.right=Je+"px"}const he=w(),ne=window.innerHeight-Ka*2,le=S.scrollHeight,ce=window.getComputedStyle(y),ve=parseInt(ce.borderTopWidth,10),O=parseInt(ce.paddingTop,10),j=parseInt(ce.borderBottomWidth,10),z=parseInt(ce.paddingBottom,10),J=ve+O+le+z+j,me=Math.min(A.offsetHeight*5,J),Te=window.getComputedStyle(S),H=parseInt(Te.paddingTop,10),Y=parseInt(Te.paddingBottom,10),oe=U.top+U.height/2-Ka,se=ne-oe,we=A.offsetHeight/2,ee=A.offsetTop+we,Se=ve+O+ee,De=J-Se;if(Se<=oe){const Qe=he.length>0&&A===he[he.length-1].ref.current;f.style.bottom="0px";const Ye=y.clientHeight-S.offsetTop-S.offsetHeight,Ft=Math.max(se,we+(Qe?Y:0)+Ye+j),G=Se+Ft;f.style.height=G+"px"}else{const Qe=he.length>0&&A===he[0].ref.current;f.style.top="0px";const Ft=Math.max(oe,ve+S.offsetTop+(Qe?H:0)+we)+De;f.style.height=Ft+"px",S.scrollTop=Se-oe+S.offsetTop}f.style.margin=`${Ka}px 0`,f.style.minHeight=me+"px",f.style.maxHeight=ne+"px",i?.(),requestAnimationFrame(()=>_.current=!0)}},[w,u.trigger,u.valueNode,f,y,S,A,M,u.dir,i]);hn(()=>N(),[N]);const[E,D]=m.useState();hn(()=>{y&&D(window.getComputedStyle(y).zIndex)},[y]);const I=m.useCallback(U=>{U&&R.current===!0&&(N(),T?.(),R.current=!1)},[N,T]);return o.jsx(C7,{scope:a,contentWrapper:f,shouldExpandOnScrollRef:_,onScrollButtonChange:I,children:o.jsx("div",{ref:g,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E},children:o.jsx(at.div,{...l,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...l.style}})})})});UC.displayName=_7;var j7="SelectPopperPosition",Hm=m.forwardRef((e,t)=>{const{__scopeSelect:a,align:i="start",collisionPadding:l=Ka,...u}=e,d=Cf(a);return o.jsx(Qd,{...d,...u,ref:t,align:i,collisionPadding:l,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)"}})});Hm.displayName=j7;var[C7,ry]=zs(so,{}),Xm="SelectViewport",qC=m.forwardRef((e,t)=>{const{__scopeSelect:a,nonce:i,...l}=e,u=Ni(Xm,a),d=ry(Xm,a),f=dt(t,u.onViewportChange),g=m.useRef(0);return o.jsxs(o.Fragment,{children:[o.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:i}),o.jsx(_f.Slot,{scope:a,children:o.jsx(at.div,{"data-radix-select-viewport":"",role:"presentation",...l,ref:f,style:{position:"relative",flex:1,overflow:"hidden auto",...l.style},onScroll:Re(l.onScroll,y=>{const x=y.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:w}=d;if(w?.current&&v){const _=Math.abs(g.current-x.scrollTop);if(_>0){const R=window.innerHeight-Ka*2,S=parseFloat(v.style.minHeight),A=parseFloat(v.style.height),M=Math.max(S,A);if(M<R){const T=M+_,N=Math.min(R,T),E=T-N;v.style.height=N+"px",v.style.bottom==="0px"&&(x.scrollTop=E>0?E:0,v.style.justifyContent="flex-end")}}}g.current=x.scrollTop})})})]})});qC.displayName=Xm;var FC="SelectGroup",[E7,R7]=zs(FC),N7=m.forwardRef((e,t)=>{const{__scopeSelect:a,...i}=e,l=Cn();return o.jsx(E7,{scope:a,id:l,children:o.jsx(at.div,{role:"group","aria-labelledby":l,...i,ref:t})})});N7.displayName=FC;var $C="SelectLabel",O7=m.forwardRef((e,t)=>{const{__scopeSelect:a,...i}=e,l=R7($C,a);return o.jsx(at.div,{id:l.id,...i,ref:t})});O7.displayName=$C;var qd="SelectItem",[A7,VC]=zs(qd),BC=m.forwardRef((e,t)=>{const{__scopeSelect:a,value:i,disabled:l=!1,textValue:u,...d}=e,f=Ri(qd,a),g=Ni(qd,a),y=f.value===i,[x,v]=m.useState(u??""),[w,_]=m.useState(!1),R=dt(t,T=>g.itemRefCallback?.(T,i,l)),S=Cn(),A=m.useRef("touch"),M=()=>{l||(f.onValueChange(i),f.onOpenChange(!1))};if(i==="")throw new Error("A <Select.Item /> 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 o.jsx(A7,{scope:a,value:i,disabled:l,textId:S,isSelected:y,onItemTextChange:m.useCallback(T=>{v(N=>N||(T?.textContent??"").trim())},[]),children:o.jsx(_f.ItemSlot,{scope:a,value:i,disabled:l,textValue:x,children:o.jsx(at.div,{role:"option","aria-labelledby":S,"data-highlighted":w?"":void 0,"aria-selected":y&&w,"data-state":y?"checked":"unchecked","aria-disabled":l||void 0,"data-disabled":l?"":void 0,tabIndex:l?void 0:-1,...d,ref:R,onFocus:Re(d.onFocus,()=>_(!0)),onBlur:Re(d.onBlur,()=>_(!1)),onClick:Re(d.onClick,()=>{A.current!=="mouse"&&M()}),onPointerUp:Re(d.onPointerUp,()=>{A.current==="mouse"&&M()}),onPointerDown:Re(d.onPointerDown,T=>{A.current=T.pointerType}),onPointerMove:Re(d.onPointerMove,T=>{A.current=T.pointerType,l?g.onItemLeave?.():A.current==="mouse"&&T.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Re(d.onPointerLeave,T=>{T.currentTarget===document.activeElement&&g.onItemLeave?.()}),onKeyDown:Re(d.onKeyDown,T=>{g.searchRef?.current!==""&&T.key===" "||(p7.includes(T.key)&&M(),T.key===" "&&T.preventDefault())})})})})});BC.displayName=qd;var Hl="SelectItemText",GC=m.forwardRef((e,t)=>{const{__scopeSelect:a,className:i,style:l,...u}=e,d=Ri(Hl,a),f=Ni(Hl,a),g=VC(Hl,a),y=v7(Hl,a),[x,v]=m.useState(null),w=dt(t,M=>v(M),g.onItemTextChange,M=>f.itemTextRefCallback?.(M,g.value,g.disabled)),_=x?.textContent,R=m.useMemo(()=>o.jsx("option",{value:g.value,disabled:g.disabled,children:_},g.value),[g.disabled,g.value,_]),{onNativeOptionAdd:S,onNativeOptionRemove:A}=y;return hn(()=>(S(R),()=>A(R)),[S,A,R]),o.jsxs(o.Fragment,{children:[o.jsx(at.span,{id:g.textId,...u,ref:w}),g.isSelected&&d.valueNode&&!d.valueNodeHasChildren?$d.createPortal(u.children,d.valueNode):null]})});GC.displayName=Hl;var HC="SelectItemIndicator",XC=m.forwardRef((e,t)=>{const{__scopeSelect:a,...i}=e;return VC(HC,a).isSelected?o.jsx(at.span,{"aria-hidden":!0,...i,ref:t}):null});XC.displayName=HC;var Zm="SelectScrollUpButton",ZC=m.forwardRef((e,t)=>{const a=Ni(Zm,e.__scopeSelect),i=ry(Zm,e.__scopeSelect),[l,u]=m.useState(!1),d=dt(t,i.onScrollButtonChange);return hn(()=>{if(a.viewport&&a.isPositioned){let f=function(){const y=g.scrollTop>0;u(y)};const g=a.viewport;return f(),g.addEventListener("scroll",f),()=>g.removeEventListener("scroll",f)}},[a.viewport,a.isPositioned]),l?o.jsx(QC,{...e,ref:d,onAutoScroll:()=>{const{viewport:f,selectedItem:g}=a;f&&g&&(f.scrollTop=f.scrollTop-g.offsetHeight)}}):null});ZC.displayName=Zm;var Ym="SelectScrollDownButton",YC=m.forwardRef((e,t)=>{const a=Ni(Ym,e.__scopeSelect),i=ry(Ym,e.__scopeSelect),[l,u]=m.useState(!1),d=dt(t,i.onScrollButtonChange);return hn(()=>{if(a.viewport&&a.isPositioned){let f=function(){const y=g.scrollHeight-g.clientHeight,x=Math.ceil(g.scrollTop)<y;u(x)};const g=a.viewport;return f(),g.addEventListener("scroll",f),()=>g.removeEventListener("scroll",f)}},[a.viewport,a.isPositioned]),l?o.jsx(QC,{...e,ref:d,onAutoScroll:()=>{const{viewport:f,selectedItem:g}=a;f&&g&&(f.scrollTop=f.scrollTop+g.offsetHeight)}}):null});YC.displayName=Ym;var QC=m.forwardRef((e,t)=>{const{__scopeSelect:a,onAutoScroll:i,...l}=e,u=Ni("SelectScrollButton",a),d=m.useRef(null),f=jf(a),g=m.useCallback(()=>{d.current!==null&&(window.clearInterval(d.current),d.current=null)},[]);return m.useEffect(()=>()=>g(),[g]),hn(()=>{f().find(x=>x.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[f]),o.jsx(at.div,{"aria-hidden":!0,...l,ref:t,style:{flexShrink:0,...l.style},onPointerDown:Re(l.onPointerDown,()=>{d.current===null&&(d.current=window.setInterval(i,50))}),onPointerMove:Re(l.onPointerMove,()=>{u.onItemLeave?.(),d.current===null&&(d.current=window.setInterval(i,50))}),onPointerLeave:Re(l.onPointerLeave,()=>{g()})})}),T7="SelectSeparator",D7=m.forwardRef((e,t)=>{const{__scopeSelect:a,...i}=e;return o.jsx(at.div,{"aria-hidden":!0,...i,ref:t})});D7.displayName=T7;var Qm="SelectArrow",M7=m.forwardRef((e,t)=>{const{__scopeSelect:a,...i}=e,l=Cf(a),u=Ri(Qm,a),d=Ni(Qm,a);return u.open&&d.position==="popper"?o.jsx(Jd,{...l,...i,ref:t}):null});M7.displayName=Qm;var k7="SelectBubbleInput",JC=m.forwardRef(({__scopeSelect:e,value:t,...a},i)=>{const l=m.useRef(null),u=dt(i,l),d=OC(t);return m.useEffect(()=>{const f=l.current;if(!f)return;const g=window.HTMLSelectElement.prototype,x=Object.getOwnPropertyDescriptor(g,"value").set;if(d!==t&&x){const v=new Event("change",{bubbles:!0});x.call(f,t),f.dispatchEvent(v)}},[d,t]),o.jsx(at.select,{...a,style:{...j1,...a.style},ref:u,defaultValue:t})});JC.displayName=k7;function WC(e){return e===""||e===void 0}function eE(e){const t=Ba(e),a=m.useRef(""),i=m.useRef(0),l=m.useCallback(d=>{const f=a.current+d;t(f),(function g(y){a.current=y,window.clearTimeout(i.current),y!==""&&(i.current=window.setTimeout(()=>g(""),1e3))})(f)},[t]),u=m.useCallback(()=>{a.current="",window.clearTimeout(i.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(i.current),[]),[a,l,u]}function tE(e,t,a){const l=t.length>1&&Array.from(t).every(y=>y===t[0])?t[0]:t,u=a?e.indexOf(a):-1;let d=z7(e,Math.max(u,0));l.length===1&&(d=d.filter(y=>y!==a));const g=d.find(y=>y.textValue.toLowerCase().startsWith(l.toLowerCase()));return g!==a?g:void 0}function z7(e,t){return e.map((a,i)=>e[(t+i)%e.length])}var P7=AC,K7=DC,I7=kC,L7=zC,U7=PC,q7=KC,F7=qC,$7=BC,V7=GC,B7=XC,G7=ZC,H7=YC;function Dt({...e}){return o.jsx(P7,{"data-slot":"select",...e})}function Mt({...e}){return o.jsx(I7,{"data-slot":"select-value",...e})}function kt({className:e,size:t="default",children:a,...i}){return o.jsxs(K7,{"data-slot":"select-trigger","data-size":t,className:de("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),...i,children:[a,o.jsx(L7,{asChild:!0,children:o.jsx(NS,{className:"size-4 opacity-50"})})]})}function zt({className:e,children:t,position:a="popper",align:i="center",...l}){return o.jsx(U7,{children:o.jsxs(q7,{"data-slot":"select-content",className:de("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",a==="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:a,align:i,...l,children:[o.jsx(X7,{}),o.jsx(F7,{className:de("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),o.jsx(Z7,{})]})})}function Fe({className:e,children:t,...a}){return o.jsxs($7,{"data-slot":"select-item",className:de("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),...a,children:[o.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:o.jsx(B7,{children:o.jsx(RS,{className:"size-4"})})}),o.jsx(V7,{children:t})]})}function X7({className:e,...t}){return o.jsx(G7,{"data-slot":"select-scroll-up-button",className:de("flex cursor-default items-center justify-center py-1",e),...t,children:o.jsx(zO,{className:"size-4"})})}function Z7({className:e,...t}){return o.jsx(H7,{"data-slot":"select-scroll-down-button",className:de("flex cursor-default items-center justify-center py-1",e),...t,children:o.jsx(NS,{className:"size-4"})})}var Ef="Switch",[Y7]=Za(Ef),[Q7,J7]=Y7(Ef),nE=m.forwardRef((e,t)=>{const{__scopeSwitch:a,name:i,checked:l,defaultChecked:u,required:d,disabled:f,value:g="on",onCheckedChange:y,form:x,...v}=e,[w,_]=m.useState(null),R=dt(t,N=>_(N)),S=m.useRef(!1),A=w?x||!!w.closest("form"):!0,[M,T]=xi({prop:l,defaultProp:u??!1,onChange:y,caller:Ef});return o.jsxs(Q7,{scope:a,checked:M,disabled:f,children:[o.jsx(at.button,{type:"button",role:"switch","aria-checked":M,"aria-required":d,"data-state":oE(M),"data-disabled":f?"":void 0,disabled:f,value:g,...v,ref:R,onClick:Re(e.onClick,N=>{T(E=>!E),A&&(S.current=N.isPropagationStopped(),S.current||N.stopPropagation())})}),A&&o.jsx(iE,{control:w,bubbles:!S.current,name:i,value:g,checked:M,required:d,disabled:f,form:x,style:{transform:"translateX(-100%)"}})]})});nE.displayName=Ef;var aE="SwitchThumb",rE=m.forwardRef((e,t)=>{const{__scopeSwitch:a,...i}=e,l=J7(aE,a);return o.jsx(at.span,{"data-state":oE(l.checked),"data-disabled":l.disabled?"":void 0,...i,ref:t})});rE.displayName=aE;var W7="SwitchBubbleInput",iE=m.forwardRef(({__scopeSwitch:e,control:t,checked:a,bubbles:i=!0,...l},u)=>{const d=m.useRef(null),f=dt(d,u),g=OC(a),y=p1(t);return m.useEffect(()=>{const x=d.current;if(!x)return;const v=window.HTMLInputElement.prototype,_=Object.getOwnPropertyDescriptor(v,"checked").set;if(g!==a&&_){const R=new Event("click",{bubbles:i});_.call(x,a),x.dispatchEvent(R)}},[g,a,i]),o.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:a,...l,tabIndex:-1,ref:f,style:{...l.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});iE.displayName=W7;function oE(e){return e?"checked":"unchecked"}var e9=nE,t9=rE;function tS({className:e,...t}){return o.jsx(e9,{"data-slot":"switch",className:de("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:o.jsx(t9,{"data-slot":"switch-thumb",className:de("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}function gs({className:e,...t}){return o.jsx("textarea",{"data-slot":"textarea",className:de("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),...t})}const Fd=["route53","s3","ec2","iam","rds","dynamodb"];Pt().min(2,"JSON required").refine(e=>{try{return JSON.parse(e),!0}catch{return!1}},"Invalid JSON").transform(e=>JSON.parse(e));const Jm=pa({provider:Fa(["aws","cloudflare","hetzner","digitalocean","generic"]),kind:Fa(["aws_access_key","api_token","basic_auth","oauth2"]),schema_version:Kd().default(1),name:Pt().min(1,"Name is required").max(100),scope_kind:Fa(["provider","service","resource"]),scope_version:Kd().default(1),scope:G0(),account_id:Pt().optional().or(Id("")).transform(e=>e||void 0),region:Pt().optional().or(Id("")).transform(e=>e||void 0),secret:G0()}).superRefine((e,t)=>{if(e.provider==="aws"){if(e.scope_kind==="service"){const a=e.scope?.service;Fd.includes(a)||t.addIssue({code:pi.custom,path:["scope"],message:`For AWS service scope, "service" must be one of: ${Fd.join(", ")}`})}if(e.scope_kind==="resource"){const a=e.scope?.arn;(typeof a!="string"||!a.startsWith("arn:"))&&t.addIssue({code:pi.custom,path:["scope"],message:'For AWS resource scope, "arn" must start with "arn:"'})}if(e.kind==="aws_access_key"){const a=e.secret??{},i=a.access_key_id;(typeof i!="string"||!/^[A-Z0-9]{20}$/.test(i))&&t.addIssue({code:pi.custom,path:["secret"],message:"access_key_id must be 20 chars (A-Z0-9)"}),(typeof a.secret_access_key!="string"||a.secret_access_key.length<10)&&t.addIssue({code:pi.custom,path:["secret"],message:"secret_access_key is required"})}}if(e.kind==="api_token"&&((e.secret??{}).token||t.addIssue({code:pi.custom,path:["secret"],message:"token is required"})),e.kind==="basic_auth"){const a=e.secret??{};(!a.username||!a.password)&&t.addIssue({code:pi.custom,path:["secret"],message:"username and password are required"})}if(e.kind==="oauth2"){const a=e.secret??{};(!a.client_id||!a.client_secret||!a.refresh_token)&&t.addIssue({code:pi.custom,path:["secret"],message:"client_id, client_secret, and refresh_token are required"})}e.scope_kind!=="provider"&&!e.scope&&t.addIssue({code:pi.custom,path:["scope"],message:"scope is required"})}),nS=Jm.partial().extend({name:Pt().min(1,"Name is required").max(100).optional()});function os(e){try{return JSON.stringify(e,null,2)}catch{return""}}function od(e){const t=e?.body??e?.response??e?.message;if(typeof t=="string")return t;try{const a=e?.response?.data?.message||e?.message;if(a)return String(a);const i=e?.response?.text?JSON.parse(e.response.text()):null;if(i?.message)return i.message}catch{}return"Unknown error"}function n9({provider:e,scope_kind:t}){return e==="aws"&&t==="service"}function a9({provider:e,scope_kind:t}){return e==="aws"&&t==="resource"}function r9({scope_kind:e}){return e==="provider"}function aS(){return{provider:"aws",kind:"aws_access_key",schema_version:1,name:"",scope_kind:"provider",scope_version:1,scope:{},account_id:"",region:"",secret:{}}}const i9=()=>{const[e,t]=m.useState(""),[a,i]=m.useState(!1),[l,u]=m.useState(!1),[d,f]=m.useState(!1),[g,y]=m.useState(null),[x,v]=m.useState(null),[w,_]=m.useState(!1),[R,S]=m.useState(!1),A=Xn(),M=Zt({queryKey:["credentials"],queryFn:()=>Ml.listCredentials()}),T=lt({mutationFn:j=>Ml.createCredential({provider:j.provider,kind:j.kind,schema_version:j.schema_version??1,name:j.name,scope_kind:j.scope_kind,scope_version:j.scope_version??1,scope:j.scope,account_id:j.account_id,region:j.region,secret:j.secret}),onSuccess:async()=>{await A.invalidateQueries({queryKey:["credentials"]}),xe.success("Credential created"),i(!1),I.reset(aS()),_(!1)},onError:j=>{xe.error("Failed to create credential",{description:od(j)})}}),N=lt({mutationFn:j=>Ml.updateCredential(j.id,j.body),onSuccess:async()=>{await A.invalidateQueries({queryKey:["credentials"]}),xe.success("Credential updated"),u(!1),v(null),S(!1)},onError:j=>{xe.error("Failed to update credential",{description:od(j)})}}),E=lt({mutationFn:j=>Ml.deleteCredential(j),onSuccess:async()=>{await A.invalidateQueries({queryKey:["credentials"]}),xe.success("Credential deleted")},onError:j=>{xe.error("Failed to delete credential",{description:od(j)})}}),D=lt({mutationFn:j=>Ml.revealCredential(j),onSuccess:j=>{y(j),f(!0)},onError:j=>{xe.error("Failed to reveal secret",{description:od(j)})}}),I=un({resolver:dn(Jm),defaultValues:aS(),mode:"onBlur"}),U=un({resolver:dn(nS),defaultValues:{},mode:"onBlur"});function F(j){v(j.id),U.reset({provider:j.provider,kind:j.kind,schema_version:j.schema_version??1,name:j.name,scope_kind:j.scope_kind,scope_version:j.scope_version??1,account_id:j.account_id??"",region:j.region??"",scope:j.scope??(j.scope_kind==="provider"?{}:void 0),secret:void 0}),S(!1),u(!0)}const fe=m.useMemo(()=>{const j=M.data??[];if(!e.trim())return j;const z=e.toLowerCase();return j.filter(J=>[J.name,J.provider,J.kind,J.scope_kind,J.account_id,J.region,JSON.stringify(J.scope??{})].filter(Boolean).map(me=>String(me).toLowerCase()).some(me=>me.includes(z)))},[M.data,e]);if(M.isLoading)return o.jsxs("div",{className:"flex items-center gap-2 p-6",children:[o.jsx(lr,{className:"h-4 w-4 animate-spin"})," Loading credentials…"]});if(M.error)return o.jsxs("div",{className:"p-6 text-red-500",children:["Error loading credentials.",o.jsx("pre",{className:"mt-2 text-xs opacity-80",children:JSON.stringify(M.error,null,2)})]});const ge=I.watch("provider"),he=I.watch("kind"),ne=I.watch("scope_kind"),le=j=>I.setValue("scope",j,{shouldDirty:!0,shouldValidate:!0}),ce=j=>I.setValue("secret",j,{shouldDirty:!0,shouldValidate:!0});function ve(){if(!w){if(ge==="aws"&&he==="aws_access_key"){const j=I.getValues("secret")??{};ce({access_key_id:j.access_key_id??"",secret_access_key:j.secret_access_key??""})}else if(he==="api_token"){const j=I.getValues("secret")??{};ce({token:j.token??""})}else if(he==="basic_auth"){const j=I.getValues("secret")??{};ce({username:j.username??"",password:j.password??""})}else if(he==="oauth2"){const j=I.getValues("secret")??{};ce({client_id:j.client_id??"",client_secret:j.client_secret??"",refresh_token:j.refresh_token??""})}}}function O(j){I.setValue("scope_kind",j),j==="provider"&&le({}),j==="service"&&le({service:"route53"}),j==="resource"&&le({arn:""})}return o.jsxs("div",{className:"space-y-4 p-6",children:[o.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"mb-1 text-2xl font-bold",children:"Credentials"}),o.jsx("p",{className:"text-muted-foreground text-sm",children:"Store provider credentials. Secrets are encrypted server-side; revealing is a one-time read."})]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsxs("div",{className:"relative",children:[o.jsx(dr,{className:"absolute top-2.5 left-2 h-4 w-4 opacity-60"}),o.jsx(Ae,{value:e,onChange:j=>t(j.target.value),placeholder:"Search by name, provider, kind, scope…",className:"w-64 pl-8"})]}),o.jsxs(bt,{open:a,onOpenChange:i,children:[o.jsx(Xa,{asChild:!0,children:o.jsxs(ie,{onClick:()=>i(!0),children:[o.jsx(Si,{className:"mr-2 h-4 w-4"}),"Create Credential"]})}),o.jsxs(wt,{className:"sm:max-w-2xl",children:[o.jsx(St,{children:o.jsx(_t,{children:"Create Credential"})}),o.jsx(fn,{...I,children:o.jsxs("form",{onSubmit:I.handleSubmit(j=>{const z=Jm.safeParse(j);if(!z.success){xe.error("Please fix validation errors");return}T.mutate(z.data)}),className:"space-y-5 pt-2",children:[o.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[o.jsx(Ke,{control:I.control,name:"provider",render:({field:j})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Provider"}),o.jsxs(Dt,{onValueChange:z=>{j.onChange(z),ve()},defaultValue:j.value,children:[o.jsx(Be,{children:o.jsx(kt,{children:o.jsx(Mt,{})})}),o.jsxs(zt,{children:[o.jsx(Fe,{value:"aws",children:"AWS"}),o.jsx(Fe,{value:"cloudflare",children:"Cloudflare"}),o.jsx(Fe,{value:"hetzner",children:"Hetzner"}),o.jsx(Fe,{value:"digitalocean",children:"DigitalOcean"}),o.jsx(Fe,{value:"generic",children:"Generic"})]})]}),o.jsx(Pe,{})]})}),o.jsx(Ke,{control:I.control,name:"kind",render:({field:j})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Kind"}),o.jsxs(Dt,{onValueChange:z=>{j.onChange(z),ve()},defaultValue:j.value,children:[o.jsx(Be,{children:o.jsx(kt,{children:o.jsx(Mt,{})})}),o.jsxs(zt,{children:[o.jsx(Fe,{value:"aws_access_key",children:"AWS Access Key"}),o.jsx(Fe,{value:"api_token",children:"API Token"}),o.jsx(Fe,{value:"basic_auth",children:"Basic Auth"}),o.jsx(Fe,{value:"oauth2",children:"OAuth2"})]})]}),o.jsx(Pe,{})]})}),o.jsx(Ke,{control:I.control,name:"scope_kind",render:({field:j})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Scope Kind"}),o.jsxs(Dt,{onValueChange:z=>{O(z)},defaultValue:j.value,children:[o.jsx(Be,{children:o.jsx(kt,{children:o.jsx(Mt,{})})}),o.jsxs(zt,{children:[o.jsx(Fe,{value:"provider",children:"Provider"}),o.jsx(Fe,{value:"service",children:"Service"}),o.jsx(Fe,{value:"resource",children:"Resource"})]})]}),o.jsx(Pe,{})]})}),o.jsx(Ke,{control:I.control,name:"name",render:({field:j})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Name"}),o.jsx(Ae,{...j,placeholder:"My AWS Key"}),o.jsx(Pe,{})]})}),o.jsx(Ke,{control:I.control,name:"account_id",render:({field:j})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Account ID (optional)"}),o.jsx(Ae,{...j,placeholder:"e.g. 123456789012"}),o.jsx(Pe,{})]})}),o.jsx(Ke,{control:I.control,name:"region",render:({field:j})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Region (optional)"}),o.jsx(Ae,{...j,placeholder:"e.g. us-east-1"}),o.jsx(Pe,{})]})})]}),!r9({scope_kind:ne})&&o.jsx(o.Fragment,{children:n9({provider:ge,scope_kind:ne})?o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Service"}),o.jsx(Pa,{control:I.control,name:"scope",render:({field:j})=>o.jsxs(Dt,{onValueChange:z=>j.onChange({service:z}),value:j.value?.service??"route53",children:[o.jsx(Be,{children:o.jsx(kt,{children:o.jsx(Mt,{placeholder:"Select an AWS service"})})}),o.jsx(zt,{children:Fd.map(z=>o.jsx(Fe,{value:z,children:z.toUpperCase()},z))})]})}),o.jsxs("p",{className:"text-muted-foreground mt-1 text-xs",children:["Must be one of: ",Fd.join(", "),"."]})]}):a9({provider:ge,scope_kind:ne})?o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Resource ARN"}),o.jsx(Pa,{control:I.control,name:"scope",render:({field:j})=>o.jsx(Ae,{value:j.value?.arn??"",onChange:z=>j.onChange({arn:z.target.value}),placeholder:"arn:aws:service:region:account:resource"})}),o.jsx(Pe,{})]}):o.jsx(Ke,{control:I.control,name:"scope",render:({field:j})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Scope (JSON)"}),o.jsx(gs,{value:os(j.value??{}),onChange:z=>{try{const J=JSON.parse(z.target.value);j.onChange(J)}catch{j.onChange(z.target.value)}},rows:3,placeholder:'{"service":"route53"} or {"arn":"arn:aws:..."}',className:"font-mono"}),o.jsx(Pe,{})]})})}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(tS,{checked:w,onCheckedChange:j=>{_(j),ve()},id:"raw-secret-toggle"}),o.jsx("label",{htmlFor:"raw-secret-toggle",className:"text-sm",children:"Edit secret as raw JSON"})]}),w?o.jsx(Ke,{control:I.control,name:"secret",render:({field:j})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Secret (JSON)"}),o.jsx(gs,{value:os(j.value??{}),onChange:z=>{try{j.onChange(JSON.parse(z.target.value))}catch{j.onChange(z.target.value)}},rows:6,placeholder:he==="aws_access_key"?'{"access_key_id":"...","secret_access_key":"..."}':he==="api_token"?'{"token":"..."}':he==="basic_auth"?'{"username":"...","password":"..."}':'{"client_id":"...","client_secret":"...","refresh_token":"..."}',className:"font-mono"}),o.jsx(Pe,{})]})}):o.jsxs(o.Fragment,{children:[ge==="aws"&&he==="aws_access_key"&&o.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Access Key ID"}),o.jsx(Pa,{control:I.control,name:"secret",render:({field:j})=>o.jsx(Ae,{value:(j.value??{}).access_key_id??"",onChange:z=>ce({...j.value??{},access_key_id:z.target.value.trim()}),placeholder:"AKIA..."})})]}),o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Secret Access Key"}),o.jsx(Pa,{control:I.control,name:"secret",render:({field:j})=>o.jsx(Ae,{type:"password",value:(j.value??{}).secret_access_key??"",onChange:z=>ce({...j.value??{},secret_access_key:z.target.value}),placeholder:"•••••••••••••••"})})]})]}),he==="api_token"&&o.jsxs(Ce,{children:[o.jsx(Ee,{children:"API Token"}),o.jsx(Pa,{control:I.control,name:"secret",render:({field:j})=>o.jsx(Ae,{value:(j.value??{}).token??"",onChange:z=>ce({...j.value??{},token:z.target.value}),placeholder:"token..."})})]}),he==="basic_auth"&&o.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Username"}),o.jsx(Pa,{control:I.control,name:"secret",render:({field:j})=>o.jsx(Ae,{value:(j.value??{}).username??"",onChange:z=>ce({...j.value??{},username:z.target.value})})})]}),o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Password"}),o.jsx(Pa,{control:I.control,name:"secret",render:({field:j})=>o.jsx(Ae,{type:"password",value:(j.value??{}).password??"",onChange:z=>ce({...j.value??{},password:z.target.value})})})]})]}),he==="oauth2"&&o.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-3",children:[o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Client ID"}),o.jsx(Pa,{control:I.control,name:"secret",render:({field:j})=>o.jsx(Ae,{value:(j.value??{}).client_id??"",onChange:z=>ce({...j.value??{},client_id:z.target.value})})})]}),o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Client Secret"}),o.jsx(Pa,{control:I.control,name:"secret",render:({field:j})=>o.jsx(Ae,{type:"password",value:(j.value??{}).client_secret??"",onChange:z=>ce({...j.value??{},client_secret:z.target.value})})})]}),o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Refresh Token"}),o.jsx(Pa,{control:I.control,name:"secret",render:({field:j})=>o.jsx(Ae,{value:(j.value??{}).refresh_token??"",onChange:z=>ce({...j.value??{},refresh_token:z.target.value})})})]})]})]}),o.jsxs(Nt,{className:"gap-2",children:[o.jsx(ie,{variant:"outline",type:"button",onClick:()=>i(!1),children:"Cancel"}),o.jsxs(ie,{type:"submit",disabled:T.isPending,children:[T.isPending&&o.jsx(lr,{className:"mr-2 h-4 w-4 animate-spin"}),"Create"]})]})]})})]})]})]})]}),o.jsx("div",{className:"overflow-x-auto rounded-xl border",children:o.jsxs("table",{className:"min-w-full text-sm",children:[o.jsx("thead",{className:"bg-muted/40 text-xs tracking-wide uppercase",children:o.jsxs("tr",{children:[o.jsx("th",{className:"w-[26%] px-4 py-2 text-left",children:"Name"}),o.jsx("th",{className:"px-4 py-2 text-left",children:"Provider"}),o.jsx("th",{className:"px-4 py-2 text-left",children:"Kind"}),o.jsx("th",{className:"px-4 py-2 text-left",children:"Scope"}),o.jsx("th",{className:"px-4 py-2 text-left",children:"Account"}),o.jsx("th",{className:"px-4 py-2 text-left",children:"Region"}),o.jsx("th",{className:"px-4 py-2 text-right",children:"Actions"})]})}),o.jsxs("tbody",{children:[fe.map(j=>o.jsxs("tr",{className:"border-t",children:[o.jsxs("td",{className:"px-4 py-2",children:[o.jsx("div",{className:"font-medium",children:j.name}),o.jsxs("div",{className:"text-muted-foreground text-xs",children:[o.jsx("span",{className:"mr-1",children:"id:"}),o.jsxs("code",{className:"bg-muted rounded px-1",children:[j.id.slice(0,8),"…"]})]})]}),o.jsx("td",{className:"px-4 py-2",children:j.provider}),o.jsx("td",{className:"px-4 py-2",children:j.kind}),o.jsx("td",{className:"px-4 py-2",children:o.jsx(ca,{variant:"secondary",children:j.scope_kind})}),o.jsx("td",{className:"px-4 py-2",children:j.account_id??"—"}),o.jsx("td",{className:"px-4 py-2",children:j.region??"—"}),o.jsx("td",{className:"px-4 py-2",children:o.jsxs("div",{className:"flex items-center justify-end gap-2",children:[o.jsx(ie,{size:"icon",variant:"ghost",title:"Reveal secret (one-time read)",onClick:()=>D.mutate(j.id),children:o.jsx(wm,{className:"h-4 w-4"})}),o.jsx(ie,{size:"icon",variant:"ghost",title:"Edit",onClick:()=>F(j),children:o.jsx(sc,{className:"h-4 w-4"})}),o.jsxs(kj,{children:[o.jsx(zj,{asChild:!0,children:o.jsx(ie,{size:"icon",variant:"ghost",title:"Delete",children:o.jsx(lg,{className:"h-4 w-4"})})}),o.jsxs(Pj,{children:[o.jsxs(Kj,{children:[o.jsxs(Lj,{children:["Delete “",j.name,"”?"]}),o.jsx(Uj,{children:"This will permanently remove the credential metadata. Secrets are not recoverable."})]}),o.jsxs(Ij,{children:[o.jsx(Fj,{disabled:E.isPending,children:"Cancel"}),o.jsxs(qj,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>E.mutate(j.id),disabled:E.isPending,children:[E.isPending&&o.jsx(lr,{className:"mr-2 inline h-4 w-4 animate-spin"}),"Delete"]})]})]})]}),o.jsxs(EC,{children:[o.jsx(RC,{asChild:!0,children:o.jsx(ie,{size:"icon",variant:"ghost",children:o.jsx(OS,{className:"h-4 w-4"})})}),o.jsxs(NC,{align:"end",children:[o.jsx(Jl,{onClick:()=>F(j),children:"Edit"}),o.jsx(Jl,{onClick:()=>D.mutate(j.id),children:"Reveal secret"}),o.jsx(Jl,{className:"text-destructive",onClick:()=>E.mutate(j.id),children:"Delete"})]})]})]})})]},j.id)),fe.length===0&&o.jsx("tr",{children:o.jsx("td",{colSpan:7,className:"px-4 py-12 text-center",children:o.jsxs("div",{className:"mx-auto max-w-md",children:[o.jsx("div",{className:"mb-2 flex items-center justify-center",children:o.jsx(Sm,{className:"text-muted-foreground h-5 w-5"})}),o.jsx("p",{className:"text-muted-foreground",children:"No credentials match your search."})]})})})]})]})}),o.jsx(bt,{open:l,onOpenChange:u,children:o.jsxs(wt,{className:"sm:max-w-2xl",children:[o.jsx(St,{children:o.jsx(_t,{children:"Edit Credential"})}),o.jsx(fn,{...U,children:o.jsxs("form",{onSubmit:U.handleSubmit(j=>{if(!x)return;const z=nS.safeParse(j);if(!z.success){xe.error("Please fix validation errors");return}N.mutate({id:x,body:z.data})}),className:"space-y-5 pt-2",children:[o.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[o.jsx(Ke,{control:U.control,name:"provider",render:({field:j})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Provider"}),o.jsxs(Dt,{onValueChange:j.onChange,value:j.value,children:[o.jsx(Be,{children:o.jsx(kt,{children:o.jsx(Mt,{})})}),o.jsxs(zt,{children:[o.jsx(Fe,{value:"aws",children:"AWS"}),o.jsx(Fe,{value:"cloudflare",children:"Cloudflare"}),o.jsx(Fe,{value:"hetzner",children:"Hetzner"}),o.jsx(Fe,{value:"digitalocean",children:"DigitalOcean"}),o.jsx(Fe,{value:"generic",children:"Generic"})]})]}),o.jsx(Pe,{})]})}),o.jsx(Ke,{control:U.control,name:"kind",render:({field:j})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Kind"}),o.jsxs(Dt,{onValueChange:j.onChange,value:j.value,children:[o.jsx(Be,{children:o.jsx(kt,{children:o.jsx(Mt,{})})}),o.jsxs(zt,{children:[o.jsx(Fe,{value:"aws_access_key",children:"AWS Access Key"}),o.jsx(Fe,{value:"api_token",children:"API Token"}),o.jsx(Fe,{value:"basic_auth",children:"Basic Auth"}),o.jsx(Fe,{value:"oauth2",children:"OAuth2"})]})]}),o.jsx(Pe,{})]})}),o.jsx(Ke,{control:U.control,name:"scope_kind",render:({field:j})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Scope Kind"}),o.jsxs(Dt,{onValueChange:j.onChange,value:j.value,children:[o.jsx(Be,{children:o.jsx(kt,{children:o.jsx(Mt,{})})}),o.jsxs(zt,{children:[o.jsx(Fe,{value:"provider",children:"Provider"}),o.jsx(Fe,{value:"service",children:"Service"}),o.jsx(Fe,{value:"resource",children:"Resource"})]})]}),o.jsx(Pe,{})]})}),o.jsx(Ke,{control:U.control,name:"name",render:({field:j})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Name"}),o.jsx(Ae,{...j}),o.jsx(Pe,{})]})}),o.jsx(Ke,{control:U.control,name:"account_id",render:({field:j})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Account ID"}),o.jsx(Ae,{...j,placeholder:"optional"}),o.jsx(Pe,{})]})}),o.jsx(Ke,{control:U.control,name:"region",render:({field:j})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Region"}),o.jsx(Ae,{...j,placeholder:"optional"}),o.jsx(Pe,{})]})})]}),o.jsx(Ke,{control:U.control,name:"scope",render:({field:j})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Scope (JSON)"}),o.jsx(gs,{value:os(j.value??(U.getValues("scope_kind")==="provider"?{}:void 0)),onChange:z=>{try{j.onChange(JSON.parse(z.target.value))}catch{j.onChange(z.target.value)}},rows:3,className:"font-mono"}),o.jsx(Pe,{})]})}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(tS,{checked:R,onCheckedChange:S,id:"raw-edit-secret-toggle"}),o.jsx("label",{htmlFor:"raw-edit-secret-toggle",className:"text-sm",children:"Rotate secret with raw JSON (leave empty to keep existing)"})]}),R&&o.jsx(Ke,{control:U.control,name:"secret",render:({field:j})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Rotate Secret (JSON)"}),o.jsx(gs,{value:typeof j.value=="string"?j.value:os(j.value??{}),onChange:z=>{try{j.onChange(JSON.parse(z.target.value))}catch{j.onChange(z.target.value)}},rows:6,className:"font-mono",placeholder:'{"access_key_id":"...","secret_access_key":"..."}'}),o.jsx(Pe,{})]})}),o.jsxs(Nt,{className:"gap-2",children:[o.jsx(ie,{variant:"outline",type:"button",onClick:()=>u(!1),children:"Cancel"}),o.jsxs(ie,{type:"submit",disabled:N.isPending,children:[N.isPending&&o.jsx(lr,{className:"mr-2 h-4 w-4 animate-spin"}),"Save changes"]})]})]})})]})}),o.jsx(bt,{open:d,onOpenChange:f,children:o.jsxs(wt,{className:"sm:max-w-xl",children:[o.jsx(St,{children:o.jsxs(_t,{className:"flex items-center gap-2",children:[o.jsx(wm,{className:"h-4 w-4"})," Decrypted Secret"]})}),o.jsx("div",{className:"bg-muted/40 rounded-lg border p-3",children:o.jsx("pre",{className:"max-h-[50vh] overflow-auto text-xs leading-relaxed",children:os(g??{})})}),o.jsxs("div",{className:"text-muted-foreground flex items-center gap-2 text-xs",children:[o.jsx(Sm,{className:"h-3.5 w-3.5"}),"One-time read. Close this dialog to hide the secret."]}),o.jsxs(Nt,{children:[o.jsx(ie,{variant:"outline",onClick:()=>{navigator.clipboard.writeText(os(g??{})),xe.success("Copied to clipboard")},children:"Copy"}),o.jsx(ie,{onClick:()=>f(!1),children:"Close"})]})]})})]})},kl=yD(),zl={listJobs:(e={})=>ze(async()=>await kl.adminListArcherJobs(e)),enqueue:e=>ze(async()=>await kl.adminEnqueueArcherJob({body:e})),retryJob:e=>ze(async()=>await kl.adminRetryArcherJob({id:e})),cancelJob:e=>ze(async()=>await kl.adminCancelArcherJob({id:e})),listQueues:()=>ze(async()=>await kl.adminListArcherQueues())},o9=["queued","running","succeeded","failed","canceled","retrying","scheduled"],s9={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 rS(e){if(!e)return"—";const t=new Date(e);return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(t)}function l9(e,t=300){const[a,i]=m.useState(e);return m.useEffect(()=>{const l=setTimeout(()=>i(e),t);return()=>clearTimeout(l)},[e,t]),a}const c9=()=>{const e=Xn(),[t,a]=m.useState(""),[i,l]=m.useState(""),[u,d]=m.useState(""),f=l9(u,300),[g,y]=m.useState(1),[x,v]=m.useState(25),_=Zt({queryKey:["archer","jobs",{status:t,queue:i,q:f,page:g,pageSize:x}],queryFn:()=>zl.listJobs({status:t,queue:i||void 0,q:f||void 0,page:g,pageSize:x}),placeholderData:D=>D,staleTime:1e4}),R=Zt({queryKey:["archer","queues"],queryFn:()=>zl.listQueues(),staleTime:3e4}),S=lt({mutationFn:D=>zl.enqueue(D),onSuccess:()=>e.invalidateQueries({queryKey:["archer","jobs"]})}),A=lt({mutationFn:D=>zl.retryJob(D),onSuccess:()=>e.invalidateQueries({queryKey:["archer","jobs"]})}),M=lt({mutationFn:D=>zl.cancelJob(D),onSuccess:()=>e.invalidateQueries({queryKey:["archer","jobs"]})}),T=_.isFetching,N=_.data,E=N?Math.max(1,Math.ceil(N.total/N.pageSize)):1;return o.jsxs("div",{className:"container mx-auto space-y-6 p-6",children:[o.jsxs("div",{className:"flex items-start justify-between gap-4",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl font-semibold",children:"Archer Jobs"}),o.jsx("p",{className:"text-muted-foreground text-sm",children:"Inspect, enqueue, retry and cancel background jobs."})]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(d9,{onSubmit:D=>S.mutateAsync(D),submitting:S.isPending}),o.jsxs(ie,{variant:"secondary",onClick:()=>e.invalidateQueries({queryKey:["archer","jobs"]}),disabled:T,children:[T?o.jsx(lr,{className:"mr-2 h-4 w-4 animate-spin"}):o.jsx(m2,{className:"mr-2 h-4 w-4"}),"Refresh"]})]})]}),o.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:R.data?.map(D=>o.jsxs($a,{children:[o.jsx(hr,{children:o.jsx(pr,{className:"text-base",children:D.name})}),o.jsxs(Va,{className:"grid grid-cols-2 gap-2 text-sm",children:[o.jsx(sd,{label:"Pending",value:D.pending}),o.jsx(sd,{label:"Running",value:D.running}),o.jsx(sd,{label:"Failed",value:D.failed}),o.jsx(sd,{label:"Scheduled",value:D.scheduled})]})]},D.name))}),o.jsxs($a,{children:[o.jsx(hr,{children:o.jsx(pr,{children:"Filters"})}),o.jsxs(Va,{className:"grid gap-3 md:grid-cols-4",children:[o.jsxs("div",{className:"col-span-2 flex items-center gap-2",children:[o.jsx(Ae,{placeholder:"Search id, queue, error, payload…",value:u,onChange:D=>{d(D.target.value),y(1)},onKeyDown:D=>D.key==="Enter"&&e.invalidateQueries({queryKey:["archer","jobs"]})}),u&&o.jsx(ie,{variant:"ghost",size:"icon",onClick:()=>d(""),children:o.jsx(cg,{className:"h-4 w-4"})}),o.jsxs(ie,{onClick:()=>e.invalidateQueries({queryKey:["archer","jobs"]}),children:[o.jsx(dr,{className:"mr-2 h-4 w-4"})," Search"]})]}),o.jsxs(Dt,{value:t||"all",onValueChange:D=>{a(D==="all"?"":D),y(1)},children:[o.jsx(kt,{children:o.jsx(Mt,{placeholder:"All statuses"})}),o.jsxs(zt,{children:[o.jsx(Fe,{value:"all",children:"All statuses"}),o9.map(D=>o.jsx(Fe,{value:D,children:D},D))]})]}),o.jsx(Ae,{placeholder:"Queue (optional)",value:i,onChange:D=>{l(D.target.value),y(1)}}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Kr,{className:"whitespace-nowrap",children:"Page size"}),o.jsxs(Dt,{value:String(x),onValueChange:D=>{v(Number(D)),y(1)},children:[o.jsx(kt,{className:"w-[120px]",children:o.jsx(Mt,{})}),o.jsx(zt,{children:[10,25,50,100].map(D=>o.jsx(Fe,{value:String(D),children:D},D))})]})]})]})]}),o.jsx($a,{children:o.jsxs(Va,{className:"p-0",children:[o.jsxs(da,{children:[o.jsx(fa,{children:o.jsxs(tt,{children:[o.jsx(Ue,{children:"ID"}),o.jsx(Ue,{children:"Queue"}),o.jsx(Ue,{children:"Status"}),o.jsx(Ue,{children:"Attempts"}),o.jsx(Ue,{children:"Run At"}),o.jsx(Ue,{children:"Updated"}),o.jsx(Ue,{className:"pr-4 text-right",children:"Actions"})]})}),o.jsxs(ha,{children:[_.isLoading&&o.jsx(tt,{children:o.jsx(je,{colSpan:7,className:"text-muted-foreground py-8 text-center",children:"Loading…"})}),_.isError&&o.jsx(tt,{children:o.jsx(je,{colSpan:7,className:"py-8 text-center text-red-600",children:"Failed to load jobs"})}),!_.isLoading&&N&&N.items.length===0&&o.jsx(tt,{children:o.jsx(je,{colSpan:7,className:"text-muted-foreground py-8 text-center",children:"No jobs match your filters."})}),N?.items.map(D=>o.jsxs(tt,{children:[o.jsx(je,{children:o.jsx("code",{className:"text-xs",children:D.id})}),o.jsx(je,{children:o.jsx(ca,{variant:"secondary",children:D.queue})}),o.jsx(je,{children:o.jsx("span",{className:de("rounded-md px-2 py-0.5 text-xs",s9[D.status]),children:D.status})}),o.jsx(je,{children:D.maxAttempts?`${D.attempts}/${D.maxAttempts}`:D.attempts}),o.jsx(je,{children:rS(D.runAt)}),o.jsx(je,{children:rS(D.updatedAt??D.createdAt)}),o.jsx(je,{className:"text-right",children:o.jsxs("div",{className:"flex justify-end gap-2",children:[(D.status==="failed"||D.status==="canceled")&&o.jsx(ie,{size:"sm",variant:"outline",disabled:A.isPending,onClick:()=>A.mutate(D.id),children:"Retry"}),(D.status==="queued"||D.status==="running"||D.status==="scheduled")&&o.jsx(ie,{size:"sm",variant:"outline",disabled:M.isPending,onClick:()=>M.mutate(D.id),children:"Cancel"}),o.jsx(u9,{job:D})]})})]},D.id))]})]}),o.jsxs("div",{className:"flex items-center justify-between border-t p-3 text-sm",children:[o.jsxs("div",{children:["Page ",g," of ",E," • ",N?.total??0," total"]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(ie,{variant:"outline",disabled:g<=1||_.isFetching,onClick:()=>y(D=>Math.max(1,D-1)),children:"Prev"}),o.jsx(ie,{variant:"outline",disabled:g>=E||_.isFetching,onClick:()=>y(D=>D+1),children:"Next"})]})]})]})})]})};function sd({label:e,value:t}){return o.jsxs("div",{className:"bg-muted/30 rounded-lg border p-3",children:[o.jsx("div",{className:"text-muted-foreground text-xs",children:e}),o.jsx("div",{className:"text-lg font-semibold",children:t})]})}function u9({job:e}){return o.jsxs(bt,{children:[o.jsx(Xa,{asChild:!0,children:o.jsx(ie,{size:"sm",variant:"ghost",children:"Details"})}),o.jsxs(wt,{className:"max-w-2xl",children:[o.jsx(St,{children:o.jsxs(_t,{children:["Job ",e.id]})}),o.jsxs("div",{className:"grid gap-3",children:[e.lastError&&o.jsxs($a,{children:[o.jsx(hr,{children:o.jsx(pr,{className:"text-sm",children:"Last error"})}),o.jsx(Va,{children:o.jsx("pre",{className:"overflow-auto text-xs whitespace-pre-wrap",children:e.lastError})})]}),o.jsxs($a,{children:[o.jsx(hr,{children:o.jsx(pr,{className:"text-sm",children:"Payload"})}),o.jsx(Va,{children:o.jsx("pre",{className:"overflow-auto text-xs whitespace-pre-wrap",children:JSON.stringify(e.payload,null,2)})})]})]}),o.jsx(Nt,{children:o.jsx(Ad,{asChild:!0,children:o.jsx(ie,{variant:"secondary",children:"Close"})})})]})]})}function d9({onSubmit:e,submitting:t}){const[a,i]=m.useState(!1),[l,u]=m.useState(""),[d,f]=m.useState(""),[g,y]=m.useState("{}"),[x,v]=m.useState(""),w=l&&d&&!t;async function _(){const R=g?JSON.parse(g):void 0;await e({queue:l,type:d,payload:R,run_at:x||void 0}),i(!1),u(""),f(""),y("{}"),v("")}return o.jsxs(bt,{open:a,onOpenChange:i,children:[o.jsx(Xa,{asChild:!0,children:o.jsxs(ie,{children:[o.jsx(Si,{className:"mr-2 h-4 w-4"})," Enqueue"]})}),o.jsxs(wt,{children:[o.jsx(St,{children:o.jsx(_t,{children:"Enqueue Job"})}),o.jsxs("div",{className:"grid gap-3",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(Kr,{children:"Queue"}),o.jsx(Ae,{value:l,onChange:R=>u(R.target.value),placeholder:"e.g. bootstrap_bastion"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(Kr,{children:"Type"}),o.jsx(Ae,{value:d,onChange:R=>f(R.target.value),placeholder:"e.g. bootstrap_bastion"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(Kr,{children:"Payload (JSON)"}),o.jsx(gs,{value:g,onChange:R=>y(R.target.value),className:"min-h-[120px] font-mono text-xs"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(Kr,{children:"Run at (optional)"}),o.jsx(Ae,{type:"datetime-local",value:x,onChange:R=>v(R.target.value)})]})]}),o.jsxs(Nt,{children:[o.jsx(Ad,{asChild:!0,children:o.jsx(ie,{variant:"secondary",children:"Cancel"})}),o.jsxs(ie,{onClick:_,disabled:!w,children:[t?o.jsx(lr,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Enqueue"]})]})]})]})}const sE=pa({key:Pt().trim().min(1,"Key is required").max(120,"Max 120 chars"),value:Pt().trim().optional()}),f9=sE.partial();function h9({t:e}){const t=`${e.key}${e.value?`=${e.value}`:""}`;return o.jsxs(ca,{variant:"secondary",className:"font-mono text-xs",children:[o.jsx(Vd,{className:"mr-1 h-3 w-3"}),t]})}const p9=()=>{const[e,t]=m.useState(""),[a,i]=m.useState(!1),[l,u]=m.useState(!1),[d,f]=m.useState(null),[g,y]=m.useState(null),x=Xn(),v=Zt({queryKey:["labels"],queryFn:()=>Vl.listLabels()}),w=un({resolver:dn(sE),defaultValues:{key:"",value:""}}),_=lt({mutationFn:E=>Vl.createLabel(E),onSuccess:async()=>{await x.invalidateQueries({queryKey:["labels"]}),w.reset(),i(!1),xe.success("Label Created Successfully.")},onError:E=>{xe.error(E.message??"There was an error while creating Label")}}),R=E=>{_.mutate(E)},S=un({resolver:dn(f9),defaultValues:{}}),A=lt({mutationFn:({id:E,values:D})=>Vl.updateLabel(E,D),onSuccess:async()=>{await x.invalidateQueries({queryKey:["labels"]}),S.reset(),u(!1),xe.success("Label Updated Successfully.")},onError:E=>{xe.error(E.message??"There was an error while updating Label")}}),M=E=>{y(E.id),S.reset({key:E.key,value:E.value}),u(!0)},T=lt({mutationFn:E=>Vl.deleteLabel(E),onSuccess:async()=>{await x.invalidateQueries({queryKey:["labels"]}),f(null),xe.success("Label Deleted Successfully.")},onError:E=>{xe.error(E.message??"There was an error while deleting Label")}}),N=m.useMemo(()=>{const E=v.data??[],D=e.trim().toLowerCase();return D?E.filter(I=>I.key?.toLowerCase().includes(D)||I.value?.toLowerCase().includes(D)):E},[e,v.data]);return v.isLoading?o.jsx("div",{className:"p-6",children:"Loading labels…"}):v.error?o.jsx("div",{className:"p-6 text-red-500",children:"Error loading labels."}):o.jsxs("div",{className:"space-y-4 p-6",children:[o.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[o.jsx("h1",{className:"mb-4 text-2xl font-bold",children:"Labels"}),o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsxs("div",{className:"relative",children:[o.jsx(dr,{className:"absolute top-2.5 left-2 h-4 w-4 opacity-60"}),o.jsx(Ae,{value:e,onChange:E=>t(E.target.value),placeholder:"Search labels",className:"w-64 pl-8"})]}),o.jsxs(bt,{open:a,onOpenChange:i,children:[o.jsx(Xa,{asChild:!0,children:o.jsxs(ie,{onClick:()=>i(!0),children:[o.jsx(Si,{className:"mr-2 h-4 w-4"}),"Create Label"]})}),o.jsxs(wt,{className:"sm:max-w-lg",children:[o.jsx(St,{children:o.jsx(_t,{children:"Create Label"})}),o.jsx(fn,{...w,children:o.jsxs("form",{className:"space-y-4",onSubmit:w.handleSubmit(R),children:[o.jsx(Ke,{control:w.control,name:"key",render:({field:E})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Key"}),o.jsx(Be,{children:o.jsx(Ae,{placeholder:"environment",...E})}),o.jsx(Pe,{})]})}),o.jsx(Ke,{control:w.control,name:"value",render:({field:E})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Value"}),o.jsx(Be,{children:o.jsx(Ae,{placeholder:"dev",...E})}),o.jsx(Pe,{})]})}),o.jsxs(Nt,{className:"gap-2",children:[o.jsx(ie,{type:"button",variant:"outline",onClick:()=>i(!1),children:"Cancel"}),o.jsx(ie,{type:"submit",disabled:w.formState.isSubmitting,children:w.formState.isSubmitting?"Creating…":"Create"})]})]})})]})]})]})]}),o.jsx("div",{className:"bg-background overflow-hidden rounded-2xl border shadow-sm",children:o.jsx("div",{className:"overflow-x-auto",children:o.jsxs(da,{children:[o.jsx(fa,{children:o.jsxs(tt,{children:[o.jsx(Ue,{children:"Key"}),o.jsx(Ue,{children:"Value"}),o.jsx(Ue,{children:"Label"}),o.jsx(Ue,{className:"w-[180px] text-right",children:"Actions"})]})}),o.jsxs(ha,{children:[N.map(E=>o.jsxs(tt,{children:[o.jsx(je,{children:E.key}),o.jsx(je,{children:E.value}),o.jsx(je,{children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(h9,{t:E}),o.jsx("code",{className:"text-muted-foreground text-xs",children:Ji(E.id,6)})]})}),o.jsx(je,{children:o.jsxs("div",{className:"flex justify-end gap-2",children:[o.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>M(E),children:[o.jsx(sc,{className:"mr-2 h-4 w-4"})," Edit"]}),o.jsx(ie,{variant:"destructive",size:"sm",onClick:()=>f(E.id),disabled:T.isPending&&d===E.id,children:T.isPending&&d===E.id?"Deleting…":"Delete"})]})})]},E.id)),N.length===0&&o.jsx(tt,{children:o.jsxs(je,{colSpan:4,className:"text-muted-foreground py-10 text-center",children:[o.jsx(sg,{className:"mx-auto mb-2 h-6 w-6 opacity-60"}),"No labels match your search."]})})]})]})})}),o.jsx(bt,{open:l,onOpenChange:u,children:o.jsxs(wt,{className:"sm:max-w-lg",children:[o.jsx(St,{children:o.jsx(_t,{children:"Edit Label"})}),o.jsx(fn,{...S,children:o.jsxs("form",{className:"space-y-4",onSubmit:S.handleSubmit(E=>{g&&A.mutate({id:g,values:E})}),children:[o.jsx(Ke,{control:S.control,name:"key",render:({field:E})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Key"}),o.jsx(Be,{children:o.jsx(Ae,{placeholder:"dedicated",...E})}),o.jsx(Pe,{})]})}),o.jsx(Ke,{control:S.control,name:"value",render:({field:E})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Value (optional)"}),o.jsx(Be,{children:o.jsx(Ae,{placeholder:"gpu",...E})}),o.jsx(Pe,{})]})}),o.jsxs(Nt,{className:"gap-2",children:[o.jsx(ie,{type:"button",variant:"outline",onClick:()=>u(!1),children:"Cancel"}),o.jsx(ie,{type:"submit",disabled:A.isPending,children:A.isPending?"Saving…":"Save changes"})]})]})})]})}),o.jsx(bt,{open:!!d,onOpenChange:E=>!E&&f(null),children:o.jsxs(wt,{className:"sm:max-w-md",children:[o.jsx(St,{children:o.jsx(_t,{children:"Delete label"})}),o.jsx("p",{className:"text-muted-foreground text-sm",children:"This action cannot be undone. Are you sure you want to delete this label?"}),o.jsxs(Nt,{className:"gap-2",children:[o.jsx(ie,{variant:"outline",onClick:()=>f(null),children:"Cancel"}),o.jsx(ie,{variant:"destructive",onClick:()=>d&&T.mutate(d),disabled:T.isPending,children:T.isPending?"Deleting…":"Delete"})]})]})})]})},m9=Bd(),g9={create:e=>ze(async()=>m9.createOrg({body:e}))},y9=pa({display_name:Pt().min(2,"Too short").max(100,"Too long")}),v9=pa({name:Pt().min(2,"Too short").max(100,"Too long"),expires_in_hours:Kd().min(1).max(43800)}),x9=pa({name:Pt().min(2,"Too short").max(100,"Too long"),domain:Pt().trim().toLowerCase().optional().or(Id("")).refine(e=>!e||/^[a-z0-9.-]+\.[a-z]{2,}$/i.test(e),"Invalid domain (e.g. example.com)")}),b9=()=>{const e=Xn(),t=Zt({queryKey:["me"],queryFn:()=>Zi.getMe()}),a=un({resolver:dn(y9),defaultValues:{display_name:""},values:t.data?{display_name:t.data.display_name??""}:void 0}),i=lt({mutationFn:N=>Zi.updateMe(N),onSuccess:()=>{e.invalidateQueries({queryKey:["me"]}),xe.success("Profile updated")},onError:N=>xe.error(N?.message??"Update failed")}),l=Zt({queryKey:["me","api-keys"],queryFn:()=>Zi.listKeys()}),[u,d]=m.useState(!1),[f,g]=m.useState(null),y=un({resolver:dn(v9),defaultValues:{name:"",expires_in_hours:720}}),x=lt({mutationFn:N=>Zi.createKey({name:N.name,expires_in_hours:N.expires_in_hours}),onSuccess:N=>{g(N),d(!1),e.invalidateQueries({queryKey:["me","api-keys"]}),xe.success("API key created")},onError:N=>xe.error(N?.message??"Failed to create key")}),[v,w]=m.useState(null),_=lt({mutationFn:N=>Zi.deleteKey(N),onSuccess:()=>{e.invalidateQueries({queryKey:["me","api-keys"]}),w(null),xe.success("Key deleted")},onError:N=>xe.error(N?.message??"Failed to delete key")}),R=m.useMemo(()=>t.data?.emails?.find(N=>N.is_primary)?.email??t.data?.primary_email??"",[t.data]),[S,A]=m.useState(!1),M=un({resolver:dn(x9),defaultValues:{name:"",domain:""}}),T=lt({mutationFn:N=>g9.create({name:N.name.trim(),domain:N.domain?.trim()?N.domain.trim().toLowerCase():void 0}),onSuccess:()=>{A(!1),M.reset(),e.invalidateQueries({queryKey:["me"]}),xe.success("Organization created")},onError:N=>xe.error(N?.message??"Failed to create organization")});return t.isLoading?o.jsx("div",{className:"p-6",children:"Loading…"}):t.error?o.jsx("div",{className:"text-destructive p-6",children:"Failed to load profile"}):o.jsxs("div",{className:"space-y-6 p-6",children:[o.jsxs($a,{children:[o.jsxs(hr,{children:[o.jsx(pr,{children:"Profile"}),o.jsx(Vm,{children:"Manage your personal information."})]}),o.jsx(Va,{children:o.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{children:[o.jsx(Kr,{children:"Email"}),o.jsx("div",{className:"text-muted-foreground mt-1 text-sm",children:R||"—"})]}),o.jsxs("div",{children:[o.jsx(Kr,{children:"ID"}),o.jsx("div",{className:"text-muted-foreground mt-1 text-sm",children:t.data?.id||"—"}),o.jsx("div",{className:"text-muted-foreground mt-1 text-sm",children:"Share this ID with the organization owner of the Organization to join"})]}),o.jsx(fn,{...a,children:o.jsxs("form",{className:"space-y-4",onSubmit:a.handleSubmit(N=>i.mutate(N)),children:[o.jsx(Ke,{control:a.control,name:"display_name",render:({field:N})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Display name"}),o.jsx(Be,{children:o.jsx(Ae,{placeholder:"Your name",...N})}),o.jsx(Pe,{})]})}),o.jsx(ie,{type:"submit",disabled:i.isPending,children:"Save"})]})})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(Kr,{children:"Organizations"}),o.jsxs(bt,{open:S,onOpenChange:A,children:[o.jsx(Xa,{asChild:!0,children:o.jsx(ie,{size:"sm",children:"New Organization"})}),o.jsxs(wt,{children:[o.jsxs(St,{children:[o.jsx(_t,{children:"Create organization"}),o.jsx(rm,{children:"Give it a name, and optionally assign your company domain."})]}),o.jsx(fn,{...M,children:o.jsxs("form",{className:"space-y-4",onSubmit:M.handleSubmit(N=>T.mutate(N)),children:[o.jsx(Ke,{control:M.control,name:"name",render:({field:N})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Name"}),o.jsx(Be,{children:o.jsx(Ae,{placeholder:"Acme Inc.",...N})}),o.jsx(Pe,{})]})}),o.jsx(Ke,{control:M.control,name:"domain",render:({field:N})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Domain (optional)"}),o.jsx(Be,{children:o.jsx(Ae,{placeholder:"acme.com",...N})}),o.jsx(Pe,{})]})}),o.jsxs(Nt,{children:[o.jsx(Ad,{asChild:!0,children:o.jsx(ie,{type:"button",variant:"outline",children:"Cancel"})}),o.jsx(ie,{type:"submit",disabled:T.isPending,children:"Create"})]})]})})]})]})]}),o.jsx("div",{className:"rounded-md border",children:o.jsxs(da,{children:[o.jsx(fa,{children:o.jsxs(tt,{children:[o.jsx(Ue,{children:"Name"}),o.jsx(Ue,{children:"Domain"})]})}),o.jsxs(ha,{children:[t.data?.organizations?.map(N=>o.jsxs(tt,{children:[o.jsx(je,{children:N.name}),o.jsx(je,{children:N.domain??"—"})]},N.id)),(!t.data?.organizations||t.data.organizations.length===0)&&o.jsx(tt,{children:o.jsx(je,{colSpan:2,className:"text-muted-foreground",children:"No organizations"})})]})]})})]})]})})]}),o.jsx(Fl,{}),o.jsxs($a,{children:[o.jsxs(hr,{className:"flex flex-row items-center justify-between space-y-0",children:[o.jsxs("div",{children:[o.jsx(pr,{children:"User API Keys"}),o.jsx(Vm,{children:"Personal keys for API access."})]}),o.jsxs(bt,{open:u,onOpenChange:d,children:[o.jsx(Xa,{asChild:!0,children:o.jsx(ie,{children:"New Key"})}),o.jsxs(wt,{children:[o.jsxs(St,{children:[o.jsx(_t,{children:"Create API Key"}),o.jsx(rm,{children:"Give it a label and expiry."})]}),o.jsx(fn,{...y,children:o.jsxs("form",{className:"space-y-4",onSubmit:y.handleSubmit(N=>x.mutate(N)),children:[o.jsx(Ke,{control:y.control,name:"name",render:({field:N})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Label"}),o.jsx(Be,{children:o.jsx(Ae,{placeholder:"CI script, local dev, ...",...N})}),o.jsx(Pe,{})]})}),o.jsx(Ke,{control:y.control,name:"expires_in_hours",render:({field:N})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Expires in hours"}),o.jsx(Be,{children:o.jsx(Ae,{type:"number",inputMode:"numeric",step:1,min:1,placeholder:"e.g. 720",...N,onChange:E=>N.onChange(E.target.value===""?"":Number(E.target.value))})}),o.jsx(Pe,{})]})}),o.jsxs(Nt,{children:[o.jsx(Ad,{asChild:!0,children:o.jsx(ie,{type:"button",variant:"outline",children:"Cancel"})}),o.jsx(ie,{type:"submit",disabled:x.isPending,children:"Create"})]})]})})]})]})]}),o.jsx(Va,{children:o.jsx("div",{className:"overflow-x-auto rounded-md border",children:o.jsxs(da,{className:"text-sm",children:[o.jsx(B8,{children:"Your user-scoped API keys."}),o.jsx(fa,{children:o.jsxs(tt,{children:[o.jsx(Ue,{children:"Label"}),o.jsx(Ue,{children:"Created"}),o.jsx(Ue,{children:"Expires"}),o.jsx(Ue,{children:"Last used"}),o.jsx(Ue,{className:"w-24"})]})}),o.jsxs(ha,{children:[l.data?.map(N=>o.jsxs(tt,{children:[o.jsx(je,{children:N.name??"—"}),o.jsx(je,{children:new Date(N.created_at).toLocaleString()}),o.jsx(je,{children:N.expires_at?new Date(N.expires_at).toLocaleString():"—"}),o.jsx(je,{children:N.last_used_at?new Date(N.last_used_at).toLocaleString():"—"}),o.jsx(je,{className:"text-right",children:o.jsxs(kj,{open:v===N.id,onOpenChange:E=>!E&&w(null),children:[o.jsx(zj,{asChild:!0,children:o.jsx(ie,{variant:"destructive",size:"sm",onClick:()=>w(N.id),children:"Delete"})}),o.jsxs(Pj,{children:[o.jsxs(Kj,{children:[o.jsx(Lj,{children:"Delete this key?"}),o.jsx(Uj,{children:"This action cannot be undone. Requests using this key will stop working."})]}),o.jsxs(Ij,{children:[o.jsx(Fj,{children:"Cancel"}),o.jsx(qj,{onClick:()=>_.mutate(N.id),children:"Delete"})]})]})]})})]},N.id)),(!l.data||l.data.length===0)&&o.jsx(tt,{children:o.jsx(je,{colSpan:5,className:"text-muted-foreground",children:"No API keys yet."})})]})]})})})]}),o.jsx(bt,{open:!!f,onOpenChange:N=>!N&&g(null),children:o.jsxs(wt,{children:[o.jsxs(St,{children:[o.jsx(_t,{children:"Copy your new API key"}),o.jsx(rm,{children:"This is only shown once. Store it securely."})]}),o.jsx("div",{className:"rounded-md border p-3 font-mono text-sm break-all",children:f?.plain??"—"}),o.jsxs("div",{className:"flex justify-end gap-2",children:[o.jsx(ie,{variant:"outline",onClick:()=>{const N=f?.plain;N&&(navigator.clipboard.writeText(N),xe.success("Copied"))},children:"Copy"}),o.jsx(ie,{onClick:()=>g(null),children:"Done"})]})]})})]})},_n=vD(),w9=(e,t)=>e?e===t:!0,Ca={listNodePools:()=>ze(async()=>await _n.listNodePools({})),createNodePool:e=>ze(async()=>await _n.createNodePool({body:e})),getNodePool:e=>ze(async()=>await _n.getNodePool({id:e})),deleteNodePool:e=>ze(async()=>{await _n.deleteNodePool({id:e})}),updateNodePool:(e,t)=>ze(async()=>await _n.updateNodePool({id:e,body:t})),listNodePoolServers:e=>ze(async()=>await _n.listNodePoolServers({id:e})),attachNodePoolServer:(e,t)=>ze(async()=>await _n.attachNodePoolServers({id:e,body:t})),detachNodePoolServers:(e,t)=>ze(async()=>await _n.detachNodePoolServer({id:e,serverId:t})),listNodePoolTaints:e=>ze(async()=>await _n.listNodePoolTaints({id:e})),attachNodePoolTaints:(e,t)=>ze(async()=>await _n.attachNodePoolTaints({id:e,body:t})),detachNodePoolTaints:(e,t)=>ze(async()=>await _n.detachNodePoolTaint({id:e,taintId:t})),listNodePoolLabels:e=>ze(async()=>await _n.listNodePoolLabels({id:e})),attachNodePoolLabels:(e,t)=>ze(async()=>await _n.attachNodePoolLabels({id:e,body:t})),detachNodePoolLabels:(e,t)=>ze(async()=>await _n.detachNodePoolLabel({id:e,labelId:t})),listNodePoolAnnotations:e=>ze(async()=>await _n.listNodePoolAnnotations({id:e})),attachNodePoolAnnotations:(e,t)=>ze(async()=>await _n.attachNodePoolAnnotations({id:e,body:t})),detachNodePoolAnnotations:(e,t)=>ze(async()=>await _n.detachNodePoolAnnotation({id:e,annotationId:t}))},Pl=hD(),Xl={listServers:()=>ze(async()=>await Pl.listServers()),createServer:e=>ze(async()=>await Pl.createServer({body:e})),getServer:e=>ze(async()=>await Pl.getServer({id:e})),updateServer:(e,t)=>ze(async()=>await Pl.updateServer({id:e,body:t})),deleteServer:e=>ze(async()=>{await Pl.deleteServer({id:e})})},Kl=pD(),Zl={listTaints:()=>ze(async()=>await Kl.listTaints()),createTaint:e=>ze(async()=>await Kl.createTaint({body:e})),getTaint:e=>ze(async()=>await Kl.getTaint({id:e})),deleteTaint:e=>ze(async()=>{await Kl.deleteTaint({id:e})}),updateTaint:(e,t)=>ze(async()=>await Kl.updateTaint({id:e,body:t}))},S9=["master","worker"];function iS({status:e}){const t=e==="ready"?"default":e==="provisioning"?"secondary":e==="failed"?"destructive":"outline";return o.jsx(ca,{variant:t,className:"capitalize",children:e||"unknown"})}function Pr(e,t){return(e??"").toLowerCase().includes(t)}function fm(e){const{open:t,title:a,onOpenChange:i,items:l,initialSelectedIds:u,onSave:d,columns:f,allowItem:g}=e,[y,x]=m.useState(""),[v,w]=m.useState(new Set(u)),[_,R]=m.useState(!1);m.useEffect(()=>{w(new Set(u)),x("")},[u,t]);const S=m.useMemo(()=>{const T=y.trim().toLowerCase();return l.filter(N=>g&&!g(N)?!1:T?Pr(N.name,T)||Pr(N.key,T)||Pr(N.value,T)||Pr(N.effect,T)||Pr(N.hostname,T)||Pr(N.private_ip_address,T)||Pr(N.public_ip_address,T)||Pr(N.role,T)||Pr(N.status,T):!0)},[l,y,g]),A=u,M=Array.from(v).some(T=>!A.has(T))||Array.from(A).some(T=>!v.has(T));return o.jsx(bt,{open:t,onOpenChange:i,children:o.jsxs(wt,{className:"sm:max-w-3xl",children:[o.jsx(St,{children:o.jsx(_t,{children:a})}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"relative",children:[o.jsx(dr,{className:"absolute top-2.5 left-2 h-4 w-4 opacity-60"}),o.jsx(Ae,{value:y,onChange:T=>x(T.target.value),placeholder:"Search…",className:"pl-8"})]}),o.jsx("div",{className:"max-h-[50vh] overflow-auto rounded border",children:o.jsxs(da,{children:[o.jsx(fa,{children:o.jsxs(tt,{children:[o.jsx(Ue,{className:"w-[48px]"}),f.map((T,N)=>o.jsx(Ue,{children:T.header},N))]})}),o.jsxs(ha,{children:[S.map(T=>{const N=T.id,E=v.has(N);return o.jsxs(tt,{children:[o.jsx(je,{className:"text-center align-middle",children:o.jsx("input",{type:"checkbox",className:"h-4 w-4",checked:E,onChange:D=>{const I=new Set(v);D.target.checked?I.add(N):I.delete(N),w(I)}})}),f.map((D,I)=>o.jsx(je,{children:D.render(T)},I))]},N)}),S.length===0&&o.jsx(tt,{children:o.jsx(je,{colSpan:1+f.length,className:"text-muted-foreground py-8 text-center",children:"No items found."})})]})]})}),o.jsxs("div",{className:"text-muted-foreground text-sm",children:["Selected: ",o.jsx("span",{className:"text-foreground font-medium",children:v.size})]})]}),o.jsxs(Nt,{className:"gap-2",children:[o.jsx(ie,{type:"button",variant:"outline",onClick:()=>i(!1),disabled:_,children:"Close"}),o.jsx(ie,{onClick:async()=>{const T=[],N=[];for(const E of v)A.has(E)||T.push(E);for(const E of A)v.has(E)||N.push(E);try{R(!0),await d({toAttach:T,toDetach:N}),i(!1)}finally{R(!1)}},disabled:_||!M,children:_?"Saving…":"Save changes"})]})]})})}const lE=pa({name:Pt().trim().min(1,"Name is required").max(120,"Max 120 chars"),role:Fa(S9)}),_9=lE.partial();function j9(){const[e,t]=m.useState(""),[a,i]=m.useState(!1),[l,u]=m.useState(!1),[d,f]=m.useState(!1),[g,y]=m.useState(null),[x,v]=m.useState(null),[w,_]=m.useState(!1),[R,S]=m.useState(null),[A,M]=m.useState(new Set),[T,N]=m.useState(new Set),[E,D]=m.useState(""),[I,U]=m.useState(!1),[F,fe]=m.useState(!1),[ge,he]=m.useState(!1),[ne,le]=m.useState(null),[ce,ve]=m.useState(new Set),[O,j]=m.useState(new Set),[z,J]=m.useState(new Set),me=Xn(),Te=Zt({queryKey:["node-pools"],queryFn:()=>Ca.listNodePools()}),H=Zt({queryKey:["servers"],queryFn:()=>Xl.listServers()}),Y=Zt({queryKey:["annotations"],queryFn:()=>$l.listAnnotations()}),oe=Zt({queryKey:["labels"],queryFn:()=>Vl.listLabels()}),se=Zt({queryKey:["taints"],queryFn:()=>Zl.listTaints()}),we=un({resolver:dn(lE),defaultValues:{name:"",role:"worker"}}),ee=lt({mutationFn:G=>Ca.createNodePool(G),onSuccess:async()=>{await me.invalidateQueries({queryKey:["node-pools"]}),we.reset({name:"",role:"worker"}),i(!1),xe.success("Node pool created.")},onError:G=>xe.error(G?.message??"Unable to create node pool.")}),Se=G=>ee.mutate(G),De=un({resolver:dn(_9),defaultValues:{name:void 0,role:void 0}});m.useEffect(()=>{g?De.reset({name:g.name,role:g.role}):De.reset({name:void 0,role:void 0})},[g]);const He=lt({mutationFn:async G=>{if(!g)return;const Xe={};return G.name!==g.name&&(Xe.name=G.name),G.role!==g.role&&(Xe.role=G.role),await Ca.updateNodePool(g.id,Xe)},onSuccess:async()=>{await me.invalidateQueries({queryKey:["node-pools"]}),u(!1),y(null),xe.success("Node pool updated.")},onError:G=>xe.error(G?.message??"Unable to update node pool.")}),Qe=G=>He.mutate(G),Ye=lt({mutationFn:async()=>{x&&await Ca.deleteNodePool(x.id)},onSuccess:async()=>{await me.invalidateQueries({queryKey:["node-pools"]}),f(!1),v(null),xe.success("Node pool deleted.")},onError:G=>xe.error(G?.message??"Unable to delete node pool.")}),Ft=m.useMemo(()=>{const G=Te.data??[],Xe=e.trim().toLowerCase();return Xe?G.filter(qe=>qe.name?.toLowerCase().includes(Xe)||qe.role?.toLowerCase().includes(Xe)):G},[e,Te.data]);return Te.isLoading?o.jsx("div",{className:"p-6",children:"Loading node pools…"}):Te.error?o.jsxs("div",{className:"p-6 text-red-500",children:["Error loading node pools.",o.jsx("pre",{className:"bg-muted mt-3 rounded p-3 text-xs",children:JSON.stringify(Te.error,null,2)})]}):o.jsxs("div",{className:"space-y-4 p-6",children:[o.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[o.jsx("h1",{className:"mb-4 text-2xl font-bold",children:"Node Pools"}),o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsxs("div",{className:"relative",children:[o.jsx(dr,{className:"absolute top-2.5 left-2 h-4 w-4 opacity-60"}),o.jsx(Ae,{value:e,onChange:G=>t(G.target.value),placeholder:"Search node pools",className:"w-64 pl-8"})]}),o.jsxs(bt,{open:a,onOpenChange:i,children:[o.jsx(Xa,{asChild:!0,children:o.jsxs(ie,{onClick:()=>i(!0),children:[o.jsx(Si,{className:"mr-2 h-4 w-4"}),"Create Node Pool"]})}),o.jsxs(wt,{className:"sm:max-w-lg",children:[o.jsx(St,{children:o.jsx(_t,{children:"Create Node Pool"})}),o.jsx(fn,{...we,children:o.jsxs("form",{className:"space-y-4",onSubmit:we.handleSubmit(Se),children:[o.jsx(Ke,{control:we.control,name:"name",render:({field:G})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Name"}),o.jsx(Be,{children:o.jsx(Ae,{placeholder:"master-pool",...G})}),o.jsx(Pe,{})]})}),o.jsx(Ke,{control:we.control,name:"role",render:({field:G})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Role"}),o.jsxs(Dt,{onValueChange:Xe=>we.setValue("role",Xe,{shouldDirty:!0,shouldValidate:!0}),value:G.value,children:[o.jsx(Be,{children:o.jsx(kt,{children:o.jsx(Mt,{placeholder:"Select role"})})}),o.jsxs(zt,{children:[o.jsx(Fe,{value:"master",children:"master"}),o.jsx(Fe,{value:"worker",children:"worker"})]})]}),o.jsx(Pe,{})]})}),o.jsxs(Nt,{className:"gap-2",children:[o.jsx(ie,{type:"button",variant:"outline",onClick:()=>i(!1),children:"Cancel"}),o.jsx(ie,{type:"submit",disabled:we.formState.isSubmitting,children:we.formState.isSubmitting?"Creating…":"Create"})]})]})})]})]})]})]}),o.jsx("div",{className:"bg-background overflow-hidden rounded-2xl border shadow-sm",children:o.jsx("div",{className:"overflow-x-auto",children:o.jsxs(da,{children:[o.jsx(fa,{children:o.jsxs(tt,{children:[o.jsx(Ue,{children:"Name"}),o.jsx(Ue,{children:"Role"}),o.jsx(Ue,{children:"Servers"}),o.jsx(Ue,{children:"Annotations"}),o.jsx(Ue,{children:"Labels"}),o.jsx(Ue,{children:"Taints"}),o.jsx(Ue,{className:"w-[180px] text-right",children:"Actions"})]})}),o.jsxs(ha,{children:[Ft.map(G=>{const Xe=Array.isArray(G.servers)?G.servers.length:0;return o.jsxs(tt,{children:[o.jsx(je,{className:"font-medium",children:G.name}),o.jsx(je,{className:"font-medium",children:G.role}),o.jsx(je,{children:o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[(G.servers||[]).slice(0,6).map(qe=>o.jsxs(ca,{variant:"secondary",className:"gap-1",children:[o.jsx(TS,{className:"h-3 w-3"}),qe.hostname||qe.private_ip_address,o.jsx("span",{className:"ml-1",children:qe.role}),qe.status&&o.jsx("span",{className:"ml-1",children:o.jsx(iS,{status:qe.status})})]},qe.id)),Xe===0&&o.jsx("span",{className:"text-muted-foreground",children:"No servers"}),Xe>6&&o.jsxs("span",{className:"text-muted-foreground",children:["+",Xe-6," more"]}),o.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>{S(G);const qe=new Set((G.servers||[]).map(Je=>Je.id));M(new Set(qe)),N(new Set(qe)),D(""),_(!0)},children:[o.jsx(Ku,{className:"mr-2 h-4 w-4"}),"Manage Servers"]})]})}),o.jsx(je,{children:o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[(G.annotations||[]).slice(0,6).map(qe=>o.jsxs(ca,{variant:"outline",className:"gap-1",children:[qe.key,":",qe.value]},qe.id)),(G.annotations||[]).length===0&&o.jsx("span",{className:"text-muted-foreground",children:"No annotations"}),(G.annotations||[]).length>6&&o.jsxs("span",{className:"text-muted-foreground",children:["+",(G.annotations||[]).length-6," more"]}),o.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>{le(G),j(new Set((G.annotations||[]).map(qe=>qe.id))),fe(!0)},children:[o.jsx(Ku,{className:"mr-2 h-4 w-4"}),"Manage"]})]})}),o.jsx(je,{children:o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[(G.labels||[]).slice(0,6).map(qe=>o.jsxs(ca,{variant:"secondary",className:"gap-1",children:[qe.key,":",qe.value]},qe.id)),(G.labels||[]).length===0&&o.jsx("span",{className:"text-muted-foreground",children:"No labels"}),(G.labels||[]).length>6&&o.jsxs("span",{className:"text-muted-foreground",children:["+",(G.labels||[]).length-6," more"]}),o.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>{le(G),ve(new Set((G.labels||[]).map(qe=>qe.id))),U(!0)},children:[o.jsx(Ku,{className:"mr-2 h-4 w-4"}),"Manage"]})]})}),o.jsx(je,{children:o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[(G.taints||[]).slice(0,6).map(qe=>o.jsxs(ca,{variant:"outline",className:"gap-1",children:[qe.key,":",qe.value,qe.effect?o.jsxs("span",{className:"ml-1",children:["(",qe.effect,")"]}):null]},qe.id)),(G.taints||[]).length===0&&o.jsx("span",{className:"text-muted-foreground",children:"No taints"}),(G.taints||[]).length>6&&o.jsxs("span",{className:"text-muted-foreground",children:["+",(G.taints||[]).length-6," more"]}),o.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>{le(G),J(new Set((G.taints||[]).map(qe=>qe.id))),he(!0)},children:[o.jsx(Ku,{className:"mr-2 h-4 w-4"}),"Manage"]})]})}),o.jsx(je,{className:"text-right",children:o.jsxs(EC,{children:[o.jsx(RC,{asChild:!0,children:o.jsx(ie,{size:"icon",variant:"ghost",className:"h-8 w-8",children:o.jsx(OS,{className:"h-4 w-4"})})}),o.jsxs(NC,{align:"end",children:[o.jsxs(Jl,{onClick:()=>{y(G),u(!0)},children:[o.jsx(sc,{className:"mr-2 h-4 w-4"})," Edit"]}),o.jsxs(Jl,{className:"text-red-600 focus:text-red-600",onClick:()=>{v(G),f(!0)},children:[o.jsx(lg,{className:"mr-2 h-4 w-4"})," Delete"]})]})]})})]},G.id)}),Ft.length===0&&o.jsx(tt,{children:o.jsx(je,{colSpan:7,className:"text-muted-foreground py-10 text-center",children:"No node pools found."})})]})]})})}),o.jsx(bt,{open:l,onOpenChange:u,children:o.jsxs(wt,{className:"sm:max-w-lg",children:[o.jsx(St,{children:o.jsx(_t,{children:"Edit Node Pool"})}),o.jsx(fn,{...De,children:o.jsxs("form",{className:"space-y-4",onSubmit:De.handleSubmit(Qe),children:[o.jsx(Ke,{control:De.control,name:"name",render:({field:G})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Name"}),o.jsx(Be,{children:o.jsx(Ae,{placeholder:"pool-name",...G})}),o.jsx(Pe,{})]})}),o.jsx(Ke,{control:De.control,name:"role",render:({field:G})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Role"}),o.jsxs(Dt,{onValueChange:Xe=>De.setValue("role",Xe,{shouldDirty:!0,shouldValidate:!0}),value:G.value,children:[o.jsx(Be,{children:o.jsx(kt,{children:o.jsx(Mt,{placeholder:"Select role"})})}),o.jsxs(zt,{children:[o.jsx(Fe,{value:"master",children:"master"}),o.jsx(Fe,{value:"worker",children:"worker"})]})]}),o.jsx(Pe,{})]})}),o.jsxs(Nt,{className:"gap-2",children:[o.jsx(ie,{type:"button",variant:"outline",onClick:()=>{u(!1),y(null)},children:"Cancel"}),o.jsx(ie,{type:"submit",disabled:De.formState.isSubmitting,children:De.formState.isSubmitting?"Saving…":"Save changes"})]})]})})]})}),o.jsx(bt,{open:d,onOpenChange:f,children:o.jsxs(wt,{className:"sm:max-w-md",children:[o.jsx(St,{children:o.jsx(_t,{children:"Delete node pool"})}),o.jsxs("p",{className:"text-muted-foreground text-sm",children:["This will permanently delete"," ",o.jsx("span",{className:"text-foreground font-medium",children:x?.name}),"."]}),o.jsxs(Nt,{className:"gap-2",children:[o.jsx(ie,{type:"button",variant:"outline",onClick:()=>{f(!1),v(null)},children:"Cancel"}),o.jsx(ie,{variant:"destructive",onClick:()=>Ye.mutate(),disabled:Ye.isPending,children:Ye.isPending?"Deleting…":"Delete"})]})]})}),o.jsx(bt,{open:w,onOpenChange:_,children:o.jsxs(wt,{className:"sm:max-w-3xl",children:[o.jsx(St,{children:o.jsxs(_t,{children:["Manage Servers",R?` — ${R.name}`:""]})}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"relative",children:[o.jsx(dr,{className:"absolute top-2.5 left-2 h-4 w-4 opacity-60"}),o.jsx(Ae,{value:E,onChange:G=>D(G.target.value),placeholder:"Search by hostname, IP or role…",className:"pl-8"})]}),o.jsx("div",{className:"max-h-[50vh] overflow-auto rounded border",children:o.jsxs(da,{children:[o.jsx(fa,{children:o.jsxs(tt,{children:[o.jsx(Ue,{className:"w-[48px]"}),o.jsx(Ue,{children:"Hostname"}),o.jsx(Ue,{children:"Private IP"}),o.jsx(Ue,{children:"Public IP"}),o.jsx(Ue,{children:"Role"}),o.jsx(Ue,{children:"Status"})]})}),o.jsxs(ha,{children:[(H.data??[]).filter(G=>{if(R?.role&&!w9(R.role,G.role))return!1;const Xe=E.trim().toLowerCase();return Xe?(G.hostname??"").toLowerCase().includes(Xe)||(G.private_ip_address??"").toLowerCase().includes(Xe)||(G.public_ip_address??"").toLowerCase().includes(Xe)||(G.role??"").toLowerCase().includes(Xe):!0}).map(G=>{const Xe=G.id,qe=A.has(Xe);return o.jsxs(tt,{children:[o.jsx(je,{className:"text-center align-middle",children:o.jsx("input",{type:"checkbox",className:"h-4 w-4",checked:qe,onChange:Je=>{const Qa=new Set(A);Je.target.checked?Qa.add(Xe):Qa.delete(Xe),M(Qa)}})}),o.jsx(je,{className:"font-medium",children:G.hostname||"—"}),o.jsx(je,{children:G.private_ip_address||"—"}),o.jsx(je,{children:G.public_ip_address||"—"}),o.jsx(je,{className:"capitalize",children:G.role||"—"}),o.jsx(je,{children:o.jsx(iS,{status:G.status})})]},Xe)}),(H.data??[]).length===0&&o.jsx(tt,{children:o.jsx(je,{colSpan:6,className:"text-muted-foreground py-8 text-center",children:H.isLoading?"Loading servers…":"No servers found."})})]})]})}),o.jsxs("div",{className:"text-muted-foreground text-sm",children:["Selected: ",o.jsx("span",{className:"text-foreground font-medium",children:A.size})]})]}),o.jsxs(Nt,{className:"gap-2",children:[o.jsx(ie,{type:"button",variant:"outline",onClick:()=>{_(!1),S(null),M(new Set),N(new Set),D("")},children:"Close"}),o.jsx(ie,{onClick:async()=>{if(!R)return;const G=R.id,Xe=[],qe=[];for(const Je of A)T.has(Je)||Xe.push(Je);for(const Je of T)A.has(Je)||qe.push(Je);try{Xe.length>0&&await Ca.attachNodePoolServer(G,{server_ids:Xe});for(const Je of qe)await Ca.detachNodePoolServers(G,Je);await me.invalidateQueries({queryKey:["node-pools"]}),await me.invalidateQueries({queryKey:["servers"]}),xe.success("Servers updated for node pool."),_(!1),S(null),M(new Set),N(new Set),D("")}catch(Je){xe.error(Je?.message??"Failed to update servers.")}},disabled:H.isLoading,children:"Save changes"})]})]})}),o.jsx(fm,{open:I,onOpenChange:G=>{U(G),G||le(null)},title:`Manage Labels${ne?` — ${ne.name}`:""}`,items:(oe.data??[]).map(G=>({id:G.id,key:G.key,value:G.value,name:`${G.key}:${G.value}`})),initialSelectedIds:ce,columns:[{header:"Key",render:G=>o.jsx("span",{className:"font-medium",children:G.key})},{header:"Value",render:G=>G.value??"—"}],onSave:async({toAttach:G,toDetach:Xe})=>{if(!ne)return;const qe=ne.id;try{G.length>0&&await Ca.attachNodePoolLabels(qe,{label_ids:G});for(const Je of Xe)await Ca.detachNodePoolLabels(qe,Je);await me.invalidateQueries({queryKey:["node-pools"]}),xe.success("Labels updated for node pool.")}catch(Je){throw xe.error(Je?.message??"Failed to update labels."),Je}}}),o.jsx(fm,{open:F,onOpenChange:G=>{fe(G),G||le(null)},title:`Manage Annotations${ne?` — ${ne.name}`:""}`,items:(Y.data??[]).map(G=>({id:G.id,key:G.key,value:G.value,name:`${G.key}:${G.value}`})),initialSelectedIds:O,columns:[{header:"Key",render:G=>o.jsx("span",{className:"font-medium",children:G.key})},{header:"Value",render:G=>G.value??"—"}],onSave:async({toAttach:G,toDetach:Xe})=>{if(!ne)return;const qe=ne.id;try{G.length>0&&await Ca.attachNodePoolAnnotations(qe,{annotation_ids:G});for(const Je of Xe)await Ca.detachNodePoolAnnotations(qe,Je);await me.invalidateQueries({queryKey:["node-pools"]}),xe.success("Annotations updated for node pool.")}catch(Je){throw xe.error(Je?.message??"Failed to update annotations."),Je}}}),o.jsx(fm,{open:ge,onOpenChange:G=>{he(G),G||le(null)},title:`Manage Taints${ne?` — ${ne.name}`:""}`,items:(se.data??[]).map(G=>({id:G.id,key:G.key,value:G.value,effect:G.effect,name:`${G.key}:${G.value}`})),initialSelectedIds:z,columns:[{header:"Key",render:G=>o.jsx("span",{className:"font-medium",children:G.key})},{header:"Value",render:G=>G.value??"—"},{header:"Effect",render:G=>G.effect??"—"}],onSave:async({toAttach:G,toDetach:Xe})=>{if(!ne)return;const qe=ne.id;try{G.length>0&&await Ca.attachNodePoolTaints(qe,{taint_ids:G});for(const Je of Xe)await Ca.detachNodePoolTaints(qe,Je);await me.invalidateQueries({queryKey:["node-pools"]}),xe.success("Taints updated for node pool.")}catch(Je){throw xe.error(Je?.message??"Failed to update taints."),Je}}})]})}const C9=pa({name:Pt(),expires_in_hours:Kd().min(1).max(43800)}),E9=()=>{const e=Bd(),t=Xn(),a=qa.get(),i=Zt({enabled:!!a,queryKey:["org:keys",a],queryFn:()=>ze(()=>e.listOrgKeys({id:a}))}),l=un({resolver:dn(C9),defaultValues:{name:"",expires_in_hours:720}}),[u,d]=m.useState(null),f=lt({mutationFn:y=>e.createOrgKey({id:a,body:y}),onSuccess:y=>{t.invalidateQueries({queryKey:["org:keys",a]}),d({key:y.org_key,secret:y.org_secret}),xe.success("Key created"),l.reset({name:"",expires_in_hours:void 0})},onError:y=>xe.error(y?.message??"Failed to create key")}),g=lt({mutationFn:y=>e.deleteOrgKey({id:a,keyId:y}),onSuccess:()=>{t.invalidateQueries({queryKey:["org:keys",a]}),xe.success("Key deleted")},onError:y=>xe.error(y?.message??"Failed to delete key")});return a?i.isLoading?o.jsx("p",{children:"Loading..."}):i.error?o.jsx("p",{className:"text-destructive",children:"Failed to load keys."}):o.jsxs($a,{children:[o.jsx(hr,{children:o.jsx(pr,{children:"Org API Keys"})}),o.jsxs(Va,{className:"space-y-6",children:[o.jsx(fn,{...l,children:o.jsxs("form",{onSubmit:l.handleSubmit(y=>f.mutate(y)),className:"grid grid-cols-1 items-end gap-3 md:grid-cols-12",children:[o.jsx("div",{className:"md:col-span-6",children:o.jsx(Ke,{control:l.control,name:"name",render:({field:y})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Name"}),o.jsx(Be,{children:o.jsx(Ae,{placeholder:"automation-bot",...y})}),o.jsx(Pe,{})]})})}),o.jsx("div",{className:"md:col-span-4",children:o.jsx(Ke,{control:l.control,name:"expires_in_hours",render:({field:y})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Expires In (hours)"}),o.jsx(Be,{children:o.jsx(Ae,{placeholder:"e.g. 720",...y})}),o.jsx(Pe,{})]})})}),o.jsx("div",{className:"md:col-span-2",children:o.jsx(ie,{type:"submit",className:"w-full",disabled:f.isPending,children:"Create"})})]})}),o.jsx("div",{className:"overflow-x-auto rounded-md border",children:o.jsxs(da,{children:[o.jsx(fa,{children:o.jsxs(tt,{children:[o.jsx(Ue,{children:"Name"}),o.jsx(Ue,{children:"Scope"}),o.jsx(Ue,{children:"Created"}),o.jsx(Ue,{children:"Expires"}),o.jsx(Ue,{className:"w-28"})]})}),o.jsxs(ha,{children:[i.data?.map(y=>o.jsxs(tt,{children:[o.jsx(je,{children:y.name??"-"}),o.jsx(je,{children:y.scope}),o.jsx(je,{children:new Date(y.created_at).toLocaleString()}),o.jsx(je,{children:y.expires_at?new Date(y.expires_at).toLocaleString():"-"}),o.jsx(je,{className:"text-right",children:o.jsx(ie,{variant:"destructive",size:"sm",onClick:()=>g.mutate(y.id),children:"Delete"})})]},y.id)),i.data?.length===0&&o.jsx(tt,{children:o.jsx(je,{colSpan:5,className:"text-muted-foreground p-4",children:"No keys."})})]})]})}),o.jsx(bt,{open:!!u,onOpenChange:y=>!y&&d(null),children:o.jsxs(wt,{children:[o.jsx(St,{children:o.jsx(_t,{children:"Copy your credentials"})}),o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{children:[o.jsx("div",{className:"text-muted-foreground mb-1 text-xs",children:"Org Key"}),o.jsx(Ae,{readOnly:!0,value:u?.key??"",onFocus:y=>y.currentTarget.select()})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-muted-foreground mb-1 text-xs",children:"Org Secret"}),o.jsx(Ae,{readOnly:!0,value:u?.secret??"",onFocus:y=>y.currentTarget.select()})]}),o.jsx("p",{className:"text-muted-foreground text-xs",children:"This secret is shown once. Store it securely."})]}),o.jsx(Nt,{children:o.jsx(ie,{onClick:()=>d(null),children:"Done"})})]})})]})]}):o.jsx("p",{className:"text-muted-foreground",children:"Pick an organization."})},R9=pa({user_id:hj("Invalid UUID"),role:Fa(["owner","admin","member"])}),N9=()=>{const e=Bd(),t=Xn(),a=qa.get(),[i,l]=m.useState(null),u=Zt({enabled:!!a,queryKey:["org:members",a],queryFn:()=>ze(()=>e.listMembers({id:a}))}),d=m.useMemo(()=>(u.data??[]).filter(w=>w.role==="owner").length,[u.data]),f=un({resolver:dn(R9),defaultValues:{user_id:"",role:"member"}}),g=lt({mutationFn:w=>e.addOrUpdateMember({id:a,body:w}),onSuccess:()=>{xe.success("Member added/updated"),t.invalidateQueries({queryKey:["org:members",a]}),f.reset({user_id:"",role:"member"})},onError:w=>xe.error(w?.message??"Failed")}),y=lt({mutationFn:w=>e.removeMember({id:a,userId:w}),onSuccess:()=>{xe.success("Member removed"),t.invalidateQueries({queryKey:["org:members",a]})},onError:w=>xe.error(w?.message??"Failed")}),x=lt({mutationFn:({userId:w,role:_})=>e.addOrUpdateMember({id:a,body:{user_id:w,role:_}}),onMutate:async({userId:w,role:_})=>{l(w),await t.cancelQueries({queryKey:["org:members",a]});const R=t.getQueryData(["org:members",a]);return t.setQueryData(["org:members",a],(S=[])=>S.map(A=>A.user_id===w?{...A,role:_}:A)),{prev:R}},onError:(w,_,R)=>{R?.prev&&t.setQueryData(["org:members",a],R.prev),xe.error(w?.message??"Failed to update role")},onSuccess:()=>{xe.success("Role updated")},onSettled:()=>{l(null),t.invalidateQueries({queryKey:["org:members",a]})}}),v=w=>!(w.role==="owner"&&d<=1);return a?u.isLoading?o.jsx("p",{children:"Loading..."}):u.error?o.jsx("p",{className:"text-destructive",children:"Failed to load members."}):o.jsxs($a,{children:[o.jsx(hr,{children:o.jsx(pr,{children:"Members"})}),o.jsxs(Va,{className:"space-y-6",children:[o.jsx(fn,{...f,children:o.jsxs("form",{className:"grid grid-cols-1 items-end gap-3 md:grid-cols-12",onSubmit:f.handleSubmit(w=>g.mutate(w)),children:[o.jsx("div",{className:"md:col-span-6",children:o.jsx(Ke,{control:f.control,name:"user_id",render:({field:w})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"User ID"}),o.jsx(Be,{children:o.jsx(Ae,{placeholder:"UUID",...w})}),o.jsx(Pe,{})]})})}),o.jsx("div",{className:"md:col-span-4",children:o.jsx(Ke,{control:f.control,name:"role",render:({field:w})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Role"}),o.jsxs(Dt,{onValueChange:w.onChange,value:w.value,children:[o.jsx(kt,{children:o.jsx(Mt,{placeholder:"Select role"})}),o.jsxs(zt,{children:[o.jsx(Fe,{value:"member",children:"member"}),o.jsx(Fe,{value:"admin",children:"admin"}),o.jsx(Fe,{value:"owner",children:"owner"})]})]}),o.jsx(Pe,{})]})})}),o.jsx("div",{className:"md:col-span-2",children:o.jsx(ie,{type:"submit",className:"w-full",disabled:g.isPending,children:"Save"})})]})}),o.jsx("div",{className:"overflow-x-auto rounded-md border",children:o.jsxs(da,{children:[o.jsx(fa,{children:o.jsxs(tt,{children:[o.jsx(Ue,{children:"Id"}),o.jsx(Ue,{children:"User"}),o.jsx(Ue,{children:"Role"}),o.jsx(Ue,{className:"w-28"})]})}),o.jsxs(ha,{children:[u.data?.map(w=>{const _=i===w.user_id;return o.jsxs(tt,{className:"align-middle",children:[o.jsx(je,{className:"font-mono text-xs",children:w.user_id}),o.jsx(je,{children:w.email}),o.jsx(je,{className:"capitalize",children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs(Dt,{value:w.role,onValueChange:R=>{if(w.role!==R){if(w.role==="owner"&&R!=="owner"&&!v(w)){xe.error("You cannot demote the last owner.");return}x.mutate({userId:w.user_id,role:R})}},disabled:_,children:[o.jsx(kt,{className:"h-8 w-[140px]",children:o.jsx(Mt,{})}),o.jsxs(zt,{children:[o.jsx(Fe,{value:"member",children:"member"}),o.jsx(Fe,{value:"admin",children:"admin"}),o.jsx(Fe,{value:"owner",children:"owner"})]})]}),_&&o.jsx(lr,{className:"h-4 w-4 animate-spin"})]})}),o.jsx(je,{className:"text-right",children:o.jsx(ie,{variant:"destructive",size:"sm",onClick:()=>y.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&&o.jsx(tt,{children:o.jsx(je,{colSpan:3,className:"text-muted-foreground p-4",children:"No members."})})]})]})})]})]}):o.jsx("p",{className:"text-muted-foreground",children:"Pick an organization."})},O9=pa({name:Pt().min(1,"Required"),domain:Pt().optional()}),A9=()=>{const e=Bd(),t=Xn(),a=qa.get(),i=Zt({enabled:!!a,queryKey:["org",a],queryFn:()=>ze(()=>e.getOrg({id:a}))}),l=un({resolver:dn(O9),defaultValues:{name:"",domain:""}});m.useEffect(()=>{i.data&&l.reset({name:i.data.name??"",domain:i.data.domain??""})},[i.data]);const u=lt({mutationFn:g=>e.updateOrg({id:a,body:g}),onSuccess:()=>{t.invalidateQueries({queryKey:["org",a]}),xe.success("Organization updated")},onError:g=>xe.error(g?.message??"Update failed")}),d=lt({mutationFn:()=>e.deleteOrg({id:a}),onSuccess:()=>{xe.success("Organization deleted"),qa.set(""),t.invalidateQueries({queryKey:["orgs:mine"]})},onError:g=>xe.error(g?.message??"Delete failed")});if(!a)return o.jsx("p",{className:"text-muted-foreground",children:"Pick an organization."});if(i.isLoading)return o.jsx("p",{children:"Loading..."});if(i.error)return o.jsx("p",{className:"text-destructive",children:"Failed to load."});const f=g=>{const y={};g.name!==i.data?.name&&(y.name=g.name);const x=g.domain?.trim()||void 0;(x??null)!==(i.data?.domain??null)&&(y.domain=x),Object.keys(y).length!==0&&u.mutate(y)};return o.jsxs($a,{children:[o.jsx(hr,{children:o.jsx(pr,{children:"Organization Settings"})}),o.jsx(Va,{className:"space-y-6",children:o.jsx(fn,{...l,children:o.jsxs("form",{className:"space-y-4",onSubmit:l.handleSubmit(f),children:[o.jsx(Ke,{control:l.control,name:"name",render:({field:g})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Name"}),o.jsx(Be,{children:o.jsx(Ae,{...g})}),o.jsx(Pe,{})]})}),o.jsx(Ke,{control:l.control,name:"domain",render:({field:g})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Domain (optional)"}),o.jsx(Be,{children:o.jsx(Ae,{placeholder:"acme.com",...g})}),o.jsx(Pe,{})]})}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(ie,{type:"submit",disabled:u.isPending,children:"Save"}),o.jsx(ie,{type:"button",variant:"destructive",onClick:()=>d.mutate(),disabled:d.isPending,children:"Delete Org"})]})]})})})]})},Il=fD();function T9(){const e=jn.getAccessToken(),t=qa.get();return{...e?{Authorization:`Bearer ${e}`}:{},...t?{"X-Org-ID":t}:{}}}async function oS(e,t={}){return fetch(e,{...t,headers:{...t.headers,...T9()},credentials:"include"})}const us={listSshKeys:()=>ze(async()=>await Il.listPublicSshKeys()),createSshKey:e=>ze(async()=>await Il.createSSHKey({body:e})),getSshKeyById:e=>ze(async()=>await Il.getSSHKey({id:e})),revealSshKeyById:e=>ze(async()=>await Il.getSSHKey({id:e,reveal:!0})),deleteSshKey:e=>ze(async()=>{await Il.deleteSSHKey({id:e})}),downloadJson:(e,t)=>ze(async()=>{const a=new URL(`/api/v1/ssh/${e}/download`,window.location.origin);a.searchParams.set("part",t),a.searchParams.set("mode","json");const i=await oS(a.toString());if(!i.ok)throw new Error(`Download failed: ${i.statusText}`);return await i.json()}),downloadBlob:(e,t)=>ze(async()=>{const a=new URL(`/api/v1/ssh/${e}/download`,window.location.origin);a.searchParams.set("part",t);const i=await oS(a.toString());if(!i.ok)throw new Error(`Download failed: ${i.statusText}`);const l=i.headers.get("Content-Disposition")||"",d=/filename="([^"]+)"/i.exec(l)?.[1]??"ssh-key-download",f=await i.blob();return{filename:d,blob:f}})},ld=43200,sS=1440,lS=Symbol.for("constructDateFrom");function iy(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&lS in e?e[lS](t):e instanceof Date?new e.constructor(t):new Date(t)}function wi(e,t){return iy(e,e)}let D9={};function M9(){return D9}function cS(e){const t=wi(e),a=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return a.setUTCFullYear(t.getFullYear()),+e-+a}function oy(e,...t){const a=iy.bind(null,e||t.find(i=>typeof i=="object"));return t.map(a)}function hd(e,t){const a=+wi(e)-+wi(t);return a<0?-1:a>0?1:a}function k9(e){return iy(e,Date.now())}function z9(e,t,a){const[i,l]=oy(a?.in,e,t),u=i.getFullYear()-l.getFullYear(),d=i.getMonth()-l.getMonth();return u*12+d}function P9(e){return t=>{const i=(e?Math[e]:Math.trunc)(t);return i===0?0:i}}function K9(e,t){return+wi(e)-+wi(t)}function I9(e,t){const a=wi(e);return a.setHours(23,59,59,999),a}function L9(e,t){const a=wi(e),i=a.getMonth();return a.setFullYear(a.getFullYear(),i+1,0),a.setHours(23,59,59,999),a}function U9(e,t){const a=wi(e);return+I9(a)==+L9(a)}function q9(e,t,a){const[i,l,u]=oy(a?.in,e,e,t),d=hd(l,u),f=Math.abs(z9(l,u));if(f<1)return 0;l.getMonth()===1&&l.getDate()>27&&l.setDate(30),l.setMonth(l.getMonth()-d*f);let g=hd(l,u)===-d;U9(i)&&f===1&&hd(i,u)===1&&(g=!1);const y=d*(f-+g);return y===0?0:y}function F9(e,t,a){const i=K9(e,t)/1e3;return P9(a?.roundingMethod)(i)}const $9={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"}},V9=(e,t,a)=>{let i;const l=$9[e];return typeof l=="string"?i=l:t===1?i=l.one:i=l.other.replace("{{count}}",t.toString()),a?.addSuffix?a.comparison&&a.comparison>0?"in "+i:i+" ago":i};function hm(e){return(t={})=>{const a=t.width?String(t.width):e.defaultWidth;return e.formats[a]||e.formats[e.defaultWidth]}}const B9={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},G9={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},H9={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},X9={date:hm({formats:B9,defaultWidth:"full"}),time:hm({formats:G9,defaultWidth:"full"}),dateTime:hm({formats:H9,defaultWidth:"full"})},Z9={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Y9=(e,t,a,i)=>Z9[e];function Ll(e){return(t,a)=>{const i=a?.context?String(a.context):"standalone";let l;if(i==="formatting"&&e.formattingValues){const d=e.defaultFormattingWidth||e.defaultWidth,f=a?.width?String(a.width):d;l=e.formattingValues[f]||e.formattingValues[d]}else{const d=e.defaultWidth,f=a?.width?String(a.width):e.defaultWidth;l=e.values[f]||e.values[d]}const u=e.argumentCallback?e.argumentCallback(t):t;return l[u]}}const Q9={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},J9={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},W9={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"]},eq={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"]},tq={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"}},nq={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"}},aq=(e,t)=>{const a=Number(e),i=a%100;if(i>20||i<10)switch(i%10){case 1:return a+"st";case 2:return a+"nd";case 3:return a+"rd"}return a+"th"},rq={ordinalNumber:aq,era:Ll({values:Q9,defaultWidth:"wide"}),quarter:Ll({values:J9,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Ll({values:W9,defaultWidth:"wide"}),day:Ll({values:eq,defaultWidth:"wide"}),dayPeriod:Ll({values:tq,defaultWidth:"wide",formattingValues:nq,defaultFormattingWidth:"wide"})};function Ul(e){return(t,a={})=>{const i=a.width,l=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],u=t.match(l);if(!u)return null;const d=u[0],f=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],g=Array.isArray(f)?oq(f,v=>v.test(d)):iq(f,v=>v.test(d));let y;y=e.valueCallback?e.valueCallback(g):g,y=a.valueCallback?a.valueCallback(y):y;const x=t.slice(d.length);return{value:y,rest:x}}}function iq(e,t){for(const a in e)if(Object.prototype.hasOwnProperty.call(e,a)&&t(e[a]))return a}function oq(e,t){for(let a=0;a<e.length;a++)if(t(e[a]))return a}function sq(e){return(t,a={})=>{const i=t.match(e.matchPattern);if(!i)return null;const l=i[0],u=t.match(e.parsePattern);if(!u)return null;let d=e.valueCallback?e.valueCallback(u[0]):u[0];d=a.valueCallback?a.valueCallback(d):d;const f=t.slice(l.length);return{value:d,rest:f}}}const lq=/^(\d+)(th|st|nd|rd)?/i,cq=/\d+/i,uq={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},dq={any:[/^b/i,/^(a|c)/i]},fq={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},hq={any:[/1/i,/2/i,/3/i,/4/i]},pq={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},mq={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]},gq={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},yq={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]},vq={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},xq={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}},bq={ordinalNumber:sq({matchPattern:lq,parsePattern:cq,valueCallback:e=>parseInt(e,10)}),era:Ul({matchPatterns:uq,defaultMatchWidth:"wide",parsePatterns:dq,defaultParseWidth:"any"}),quarter:Ul({matchPatterns:fq,defaultMatchWidth:"wide",parsePatterns:hq,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Ul({matchPatterns:pq,defaultMatchWidth:"wide",parsePatterns:mq,defaultParseWidth:"any"}),day:Ul({matchPatterns:gq,defaultMatchWidth:"wide",parsePatterns:yq,defaultParseWidth:"any"}),dayPeriod:Ul({matchPatterns:vq,defaultMatchWidth:"any",parsePatterns:xq,defaultParseWidth:"any"})},wq={code:"en-US",formatDistance:V9,formatLong:X9,formatRelative:Y9,localize:rq,match:bq,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Sq(e,t,a){const i=M9(),l=a?.locale??i.locale??wq,u=2520,d=hd(e,t);if(isNaN(d))throw new RangeError("Invalid time value");const f=Object.assign({},a,{addSuffix:a?.addSuffix,comparison:d}),[g,y]=oy(a?.in,...d>0?[t,e]:[e,t]),x=F9(y,g),v=(cS(y)-cS(g))/1e3,w=Math.round((x-v)/60);let _;if(w<2)return a?.includeSeconds?x<5?l.formatDistance("lessThanXSeconds",5,f):x<10?l.formatDistance("lessThanXSeconds",10,f):x<20?l.formatDistance("lessThanXSeconds",20,f):x<40?l.formatDistance("halfAMinute",0,f):x<60?l.formatDistance("lessThanXMinutes",1,f):l.formatDistance("xMinutes",1,f):w===0?l.formatDistance("lessThanXMinutes",1,f):l.formatDistance("xMinutes",w,f);if(w<45)return l.formatDistance("xMinutes",w,f);if(w<90)return l.formatDistance("aboutXHours",1,f);if(w<sS){const R=Math.round(w/60);return l.formatDistance("aboutXHours",R,f)}else{if(w<u)return l.formatDistance("xDays",1,f);if(w<ld){const R=Math.round(w/sS);return l.formatDistance("xDays",R,f)}else if(w<ld*2)return _=Math.round(w/ld),l.formatDistance("aboutXMonths",_,f)}if(_=q9(y,g),_<12){const R=Math.round(w/ld);return l.formatDistance("xMonths",R,f)}else{const R=_%12,S=Math.trunc(_/12);return R<3?l.formatDistance("aboutXYears",S,f):R<9?l.formatDistance("overXYears",S,f):l.formatDistance("almostXYears",S+1,f)}}function _q(e,t){return Sq(e,k9(e),t)}const cE=["master","worker","bastion"],pd=["pending","provisioning","ready","failed"],uE=pa({hostname:Pt().trim().max(60,"Max 60 chars"),public_ip_address:Pt().trim().optional().or(Id("")),private_ip_address:Pt().trim().min(1,"Private IP address required"),role:Fa(cE),ssh_key_id:hj("Pick a valid SSH key"),ssh_user:Pt().trim().min(1,"SSH user is required"),status:Fa(pd).default("pending")}).refine(e=>e.role!=="bastion"||e.public_ip_address&&e.public_ip_address.trim()!=="",{message:"Public IP required for bastion",path:["public_ip_address"]}),jq=uE.partial();function Cq({status:e}){const t=e==="ready"?"default":e==="provisioning"?"secondary":e==="failed"?"destructive":"outline";return o.jsx(ca,{variant:t,className:"capitalize",children:e})}const Eq=()=>{const[e,t]=m.useState(""),[a,i]=m.useState(!1),[l,u]=m.useState(!1),[d,f]=m.useState(null),[g,y]=m.useState(""),[x,v]=m.useState(""),[w,_]=m.useState(null),R=Xn(),S=Zt({queryKey:["servers"],queryFn:()=>Xl.listServers()}),A=Zt({queryKey:["ssh_keys"],queryFn:()=>us.listSshKeys()}),M=m.useMemo(()=>{const O=new Map;for(const j of A.data??[]){const z=j.name?j.name:"Unnamed key",J=j.fingerprint?Ji(j.fingerprint,8):"";O.set(j.id,J?`${z} — ${J}`:z)}return O},[A.data]),T=un({resolver:dn(uE),defaultValues:{hostname:"",private_ip_address:"",public_ip_address:"",role:"worker",ssh_key_id:"",ssh_user:"",status:"pending"},mode:"onChange"}),N=T.watch("role")==="bastion",E=T.watch("public_ip_address")?.trim()??"",D=N&&E==="",I=lt({mutationFn:O=>Xl.createServer(O),onSuccess:async()=>{await R.invalidateQueries({queryKey:["servers"]}),T.reset(),i(!1),xe.success("Server created successfully")},onError:O=>{xe.error(O?.message??"Failed to create server")}}),U=un({resolver:dn(jq),defaultValues:{},mode:"onChange"}),F=U.watch("role")==="bastion",fe=U.watch("public_ip_address")?.trim()??"",ge=F&&fe==="",he=lt({mutationFn:({id:O,values:j})=>Xl.updateServer(O,j),onSuccess:async()=>{await R.invalidateQueries({queryKey:["servers"]}),u(!1),_(null),xe.success("Server updated successfully")},onError:O=>{xe.error(O?.message??"Failed to update server")}}),ne=lt({mutationFn:O=>Xl.deleteServer(O),onSuccess:async()=>{await R.invalidateQueries({queryKey:["servers"]}),f(null),xe.success("Server deleted successfully")},onError:O=>{xe.error(O?.message??"Failed to delete server")}}),le=m.useMemo(()=>{const O=S.data??[],j=e.trim().toLowerCase(),z=j?O.filter(Te=>Te.hostname?.toLowerCase().includes(j)||Te.public_ip_address?.toLowerCase().includes(j)||Te.private_ip_address?.toLowerCase().includes(j)||Te.role?.toLowerCase().includes(j)||Te.ssh_user?.toLowerCase().includes(j)):O,J=x?z.filter(Te=>Te.role===x):z;return g?J.filter(Te=>Te.status===g):J},[e,x,g,S.data]),ce=O=>{I.mutate(O)},ve=O=>{_(O.id),U.reset({hostname:O.hostname??"",public_ip_address:O.public_ip_address??"",private_ip_address:O.private_ip_address??"",role:O.role??"worker",ssh_key_id:O.ssh_key_id??"",ssh_user:O.ssh_user??"",status:O.status??"pending"}),u(!0)};return A.data?.length===0?o.jsx("div",{className:"p-6",children:"Please create an SSH key for your organization first."}):S.isLoading?o.jsx("div",{className:"p-6",children:"Loading servers…"}):S.error?o.jsx("div",{className:"p-6 text-red-500",children:"Error loading servers."}):o.jsxs(fc,{children:[o.jsxs("div",{className:"space-y-4 p-6",children:[o.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[o.jsx("h1",{className:"mb-4 text-2xl font-bold",children:"Servers"}),o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsxs("div",{className:"relative",children:[o.jsx(dr,{className:"absolute top-2.5 left-2 h-4 w-4 opacity-60"}),o.jsx(Ae,{value:e,onChange:O=>t(O.target.value),placeholder:"Search hostname, Public IP, Private IP, role, user…",className:"w-64 pl-8"})]}),o.jsxs(Dt,{value:x||"all",onValueChange:O=>v(O==="all"?"":O),children:[o.jsx(kt,{className:"w-36",children:o.jsx(Mt,{placeholder:"Role (all)"})}),o.jsxs(zt,{children:[o.jsx(Fe,{value:"all",children:"All roles"}),cE.map(O=>o.jsx(Fe,{value:O,children:O},O))]})]}),o.jsxs(Dt,{value:g||"all",onValueChange:O=>y(O==="all"?"":O),children:[o.jsx(kt,{className:"w-40",children:o.jsx(Mt,{placeholder:"Status (all)"})}),o.jsxs(zt,{children:[o.jsx(Fe,{value:"all",children:"All statuses"})," ",pd.map(O=>o.jsx(Fe,{value:O,children:O},O))]})]}),o.jsxs(bt,{open:a,onOpenChange:i,children:[o.jsx(Xa,{asChild:!0,children:o.jsxs(ie,{onClick:()=>i(!0),children:[o.jsx(Si,{className:"mr-2 h-4 w-4"}),"Create Server"]})}),o.jsxs(wt,{className:"sm:max-w-lg",children:[o.jsx(St,{children:o.jsx(_t,{children:"Create server"})}),o.jsx(fn,{...T,children:o.jsxs("form",{className:"space-y-4",onSubmit:T.handleSubmit(ce),children:[o.jsx(Ke,{control:T.control,name:"hostname",render:({field:O})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Hostname"}),o.jsx(Be,{children:o.jsx(Ae,{placeholder:"worker-01",...O})}),o.jsx(Pe,{})]})}),o.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[o.jsx(Ke,{control:T.control,name:"public_ip_address",render:({field:O})=>o.jsxs(Ce,{children:[o.jsxs(Ee,{className:"flex items-center justify-between",children:[o.jsx("span",{children:"Public IP Address"}),o.jsx("span",{className:de("rounded-full px-2 py-0.5 text-xs",N?"bg-amber-100 text-amber-900":"bg-muted text-muted-foreground"),children:N?"Required for bastion":"Optional"})]}),o.jsx(Be,{children:o.jsx(Ae,{placeholder:N?"Required for bastion (e.g. 34.12.56.78)":"34.12.56.78","aria-required":N,"aria-invalid":D||!!T.formState.errors.public_ip_address,required:N,...O,className:de(D&&"border-destructive focus-visible:ring-destructive")})}),N&&o.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"," ",o.jsx("span",{className:"font-medium",children:"Public IP"}),"."]}),o.jsx(Pe,{})]})}),o.jsx(Ke,{control:T.control,name:"private_ip_address",render:({field:O})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Private IP Address"}),o.jsx(Be,{children:o.jsx(Ae,{placeholder:"192.168.10.1",...O})}),o.jsx(Pe,{})]})})]}),o.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[o.jsx(Ke,{control:T.control,name:"role",render:({field:O})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Role"}),o.jsxs(Dt,{onValueChange:j=>T.setValue("role",j,{shouldDirty:!0,shouldValidate:!0}),value:O.value,children:[o.jsx(Be,{children:o.jsx(kt,{children:o.jsx(Mt,{placeholder:"Select role"})})}),o.jsxs(zt,{children:[o.jsx(Fe,{value:"master",children:"master"}),o.jsx(Fe,{value:"worker",children:"worker"}),o.jsx(Fe,{value:"bastion",children:"bastion — requires Public IP"})]})]}),o.jsx(Pe,{})]})}),o.jsx(Ke,{control:T.control,name:"ssh_user",render:({field:O})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"SSH user"}),o.jsx(Be,{children:o.jsx(Ae,{placeholder:"ubuntu",...O})}),o.jsx(Pe,{})]})})]}),o.jsx(Ke,{control:T.control,name:"ssh_key_id",render:({field:O})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"SSH key"}),o.jsxs(Dt,{onValueChange:O.onChange,value:O.value,children:[o.jsx(Be,{children:o.jsx(kt,{children:o.jsx(Mt,{placeholder:A.data?.length?"Select SSH key":"No SSH keys found"})})}),o.jsx(zt,{children:A.data.map(j=>o.jsxs(Fe,{value:j.id,children:[j.name?j.name:"Unnamed key"," —"," ",Ji(j.fingerprint,8)]},j.id))})]}),o.jsx(Pe,{})]})}),o.jsx(Ke,{control:T.control,name:"status",render:({field:O})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Initial status"}),o.jsxs(Dt,{onValueChange:O.onChange,value:O.value,children:[o.jsx(Be,{children:o.jsx(kt,{children:o.jsx(Mt,{placeholder:"pending"})})}),o.jsx(zt,{children:pd.map(j=>o.jsx(Fe,{value:j,children:j},j))})]}),o.jsx(Pe,{})]})}),o.jsxs(Nt,{className:"gap-2",children:[o.jsx(ie,{type:"button",variant:"outline",onClick:()=>i(!1),children:"Cancel"}),o.jsx(ie,{type:"submit",disabled:I.isPending||T.formState.isSubmitting||!T.formState.isValid,children:I.isPending?"Creating…":"Create"})]})]})})]})]})]})]}),o.jsx("div",{className:"bg-background overflow-hidden rounded-2xl border shadow-sm",children:o.jsx("div",{className:"overflow-x-auto",children:o.jsxs(da,{children:[o.jsx(fa,{children:o.jsxs(tt,{children:[o.jsx(Ue,{children:"Hostname"}),o.jsx(Ue,{children:"IP address"}),o.jsx(Ue,{children:"Role"}),o.jsx(Ue,{children:"SSH user"}),o.jsx(Ue,{children:"SSH key"}),o.jsx(Ue,{children:"Status"}),o.jsx(Ue,{children:"Created"}),o.jsx(Ue,{className:"w-[220px] text-right",children:"Actions"})]})}),o.jsx(ha,{children:le.length===0?o.jsx(tt,{children:o.jsx(je,{colSpan:8,className:"text-muted-foreground py-10 text-center text-sm",children:"No servers found."})}):le.map(O=>o.jsxs(tt,{children:[o.jsx(je,{className:"font-medium",children:O.hostname}),o.jsx(je,{children:o.jsxs("div",{className:"flex flex-col",children:[o.jsx("span",{className:de("tabular-nums",!O.public_ip_address&&"text-muted-foreground"),children:O.public_ip_address||"—"}),o.jsx("span",{className:"text-muted-foreground tabular-nums",children:O.private_ip_address})]})}),o.jsx(je,{className:"capitalize",children:o.jsx("span",{className:de(O.role==="bastion"&&"rounded bg-amber-50 px-2 py-0.5 dark:bg-amber-900"),children:O.role})}),o.jsx(je,{className:"tabular-nums",children:O.ssh_user}),o.jsx(je,{className:"truncate",children:M.get(O.ssh_key_id)??"—"}),o.jsx(je,{children:o.jsx(Cq,{status:O.status??"pending"})}),o.jsx(je,{title:O.created_at,children:O.created_at?`${_q(new Date(O.created_at),{addSuffix:!0})}`:"—"}),o.jsx(je,{className:"text-right",children:o.jsxs("div",{className:"flex justify-end gap-2",children:[o.jsx(ie,{variant:"outline",size:"sm",onClick:()=>ve(O),children:"Edit"}),o.jsx(ie,{variant:"destructive",size:"sm",onClick:()=>f(O.id),disabled:ne.isPending&&d===O.id,children:ne.isPending&&d===O.id?"Deleting…":"Delete"})]})})]},O.id))})]})})})]}),o.jsx(bt,{open:l,onOpenChange:u,children:o.jsxs(wt,{className:"sm:max-w-lg",children:[o.jsx(St,{children:o.jsx(_t,{children:"Edit server"})}),o.jsx(fn,{...U,children:o.jsxs("form",{className:"space-y-4",onSubmit:U.handleSubmit(O=>{w&&he.mutate({id:w,values:O})}),children:[o.jsx(Ke,{control:U.control,name:"hostname",render:({field:O})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Hostname"}),o.jsx(Be,{children:o.jsx(Ae,{placeholder:"worker-01",...O})}),o.jsx(Pe,{})]})}),o.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[o.jsx(Ke,{control:U.control,name:"public_ip_address",render:({field:O})=>o.jsxs(Ce,{children:[o.jsxs(Ee,{className:"flex items-center justify-between",children:[o.jsx("span",{children:"Public IP Address"}),o.jsx("span",{className:de("rounded-full px-2 py-0.5 text-xs",F?"bg-amber-100 text-amber-900":"bg-muted text-muted-foreground"),children:F?"Required for bastion":"Optional"})]}),o.jsx(Be,{children:o.jsx(Ae,{placeholder:F?"Required for bastion (e.g. 34.12.56.78)":"34.12.56.78","aria-required":F,"aria-invalid":ge||!!U.formState.errors.public_ip_address,required:F,...O,className:de(ge&&"border-destructive focus-visible:ring-destructive")})}),F&&o.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 ",o.jsx("span",{className:"font-medium",children:"Public IP"}),"."]}),o.jsx(Pe,{})]})}),o.jsx(Ke,{control:U.control,name:"private_ip_address",render:({field:O})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Private IP Address"}),o.jsx(Be,{children:o.jsx(Ae,{placeholder:"192.168.10.1",...O})}),o.jsx(Pe,{})]})})]}),o.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[o.jsx(Ke,{control:U.control,name:"role",render:({field:O})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Role"}),o.jsxs(Dt,{onValueChange:j=>U.setValue("role",j,{shouldDirty:!0,shouldValidate:!0}),value:O.value,children:[o.jsx(Be,{children:o.jsx(kt,{children:o.jsx(Mt,{placeholder:"Select role"})})}),o.jsxs(zt,{children:[o.jsx(Fe,{value:"master",children:"master"}),o.jsx(Fe,{value:"worker",children:"worker"}),o.jsx(Fe,{value:"bastion",children:"bastion — requires Public IP"})]})]}),o.jsx(Pe,{})]})}),o.jsx(Ke,{control:U.control,name:"ssh_user",render:({field:O})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"SSH user"}),o.jsx(Be,{children:o.jsx(Ae,{placeholder:"ubuntu",...O})}),o.jsx(Pe,{})]})})]}),o.jsx(Ke,{control:U.control,name:"ssh_key_id",render:({field:O})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"SSH key"}),o.jsxs(Dt,{onValueChange:O.onChange,value:O.value,children:[o.jsx(Be,{children:o.jsx(kt,{children:o.jsx(Mt,{placeholder:"Select SSH key"})})}),o.jsx(zt,{children:A.data.map(j=>o.jsxs(Fe,{value:j.id,children:[j.name?j.name:"Unnamed key"," — ",Ji(j.fingerprint,8)]},j.id))})]}),o.jsx(Pe,{})]})}),o.jsx(Ke,{control:U.control,name:"status",render:({field:O})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Status"}),o.jsxs(Dt,{onValueChange:O.onChange,value:O.value,children:[o.jsx(Be,{children:o.jsx(kt,{children:o.jsx(Mt,{placeholder:"pending"})})}),o.jsx(zt,{children:pd.map(j=>o.jsx(Fe,{value:j,children:j},j))})]}),o.jsx(Pe,{})]})}),o.jsxs(Nt,{className:"gap-2",children:[o.jsx(ie,{type:"button",variant:"outline",onClick:()=>u(!1),children:"Cancel"}),o.jsx(ie,{type:"submit",disabled:he.isPending,children:he.isPending?"Saving…":"Save changes"})]})]})})]})}),o.jsx(bt,{open:!!d,onOpenChange:O=>!O&&f(null),children:o.jsxs(wt,{className:"sm:max-w-md",children:[o.jsx(St,{children:o.jsx(_t,{children:"Delete server"})}),o.jsx("p",{className:"text-muted-foreground text-sm",children:"This action cannot be undone. Are you sure you want to delete this server?"}),o.jsxs(Nt,{className:"gap-2",children:[o.jsx(ie,{variant:"outline",onClick:()=>f(null),children:"Cancel"}),o.jsx(ie,{variant:"destructive",onClick:()=>d&&ne.mutate(d),disabled:ne.isPending,children:ne.isPending?"Deleting…":"Delete"})]})]})})]})},Rq=pa({name:Pt().trim().min(1,"Name is required").max(100,"Max 100 characters"),comment:Pt().trim().min(1,"Comment is required").max(100,"Max 100 characters"),bits:Fa(["2048","3072","4096"]).optional(),type:Fa(["rsa","ed25519"]).optional()});function Nq(e,t){const a=URL.createObjectURL(e),i=document.createElement("a");i.href=a,i.download=t,document.body.appendChild(i),i.click(),i.remove(),URL.revokeObjectURL(a)}function pm(e,t="Copied"){navigator.clipboard.writeText(e).then(()=>xe.success(t)).catch(()=>xe.error("Copy failed"))}function Oq(e){return e?.split(/\s+/)?.[0]??"ssh-key"}const Aq=()=>{const[e,t]=m.useState(""),[a,i]=m.useState(!1),[l,u]=m.useState(null),[d,f]=m.useState(null),g=Xn(),y=Zt({queryKey:["ssh"],queryFn:()=>us.listSshKeys()}),x=un({resolver:dn(Rq),defaultValues:{name:"",comment:"",type:"rsa",bits:"4096"}}),v=lt({mutationFn:async S=>{const A={name:S.name,comment:S.comment,bits:S.type==="rsa"&&S.bits?Number(S.bits):void 0,type:S.type};return await us.createSshKey(A)},onSuccess:()=>{g.invalidateQueries({queryKey:["ssh"]}),i(!1),x.reset({name:"",comment:"",type:"rsa",bits:"4096"}),xe.success("SSH Key created")},onError:S=>xe.error(S?.message??"SSH Key creation failed")}),w=lt({mutationFn:S=>us.revealSshKeyById(S),onSuccess:S=>u(S),onError:S=>xe.error(S?.message??"Failed to reveal key")}),_=lt({mutationFn:S=>us.deleteSshKey(S),onSuccess:async()=>{await g.invalidateQueries({queryKey:["ssh"]}),f(null),xe.success("SSH Key deleted")},onError:S=>xe.error(S?.message??"Delete failed")}),R=m.useMemo(()=>{const S=e.trim().toLowerCase();return S?(y.data??[]).filter(A=>A.name?.toLowerCase().includes(S)||A.fingerprint?.toLowerCase().includes(S)||A.public_key?.toLowerCase().includes(S)):y.data??[]},[e,y.data]);return y.isLoading?o.jsx("div",{className:"p-6",children:"Loading SSH Keys…"}):y.error?o.jsx("div",{className:"p-6 text-red-500",children:"Error Loading SSH Keys"}):o.jsx(fc,{children:o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o.jsx("h1",{className:"text-2xl font-bold",children:"SSH Keys"}),o.jsx("div",{className:"w-full max-w-sm",children:o.jsx(Ae,{value:e,onChange:S=>t(S.target.value),placeholder:"Search by name, fingerprint or key"})}),o.jsxs(bt,{open:a,onOpenChange:i,children:[o.jsx(Xa,{asChild:!0,children:o.jsxs(ie,{onClick:()=>i(!0),children:[o.jsx(Si,{className:"mr-2 h-4 w-4"}),"Create New Keypair"]})}),o.jsxs(wt,{className:"sm:max-w-lg",children:[o.jsx(St,{children:o.jsx(_t,{children:"Create SSH Keypair"})}),o.jsx(fn,{...x,children:o.jsxs("form",{onSubmit:x.handleSubmit(S=>v.mutate(S)),className:"space-y-4",children:[o.jsx(Ke,{control:x.control,name:"name",render:({field:S})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Name"}),o.jsx(Be,{children:o.jsx(Ae,{placeholder:"e.g., CI deploy key",...S})}),o.jsx(Pe,{})]})}),o.jsx(Ke,{control:x.control,name:"comment",render:({field:S})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Comment"}),o.jsx(Be,{children:o.jsx(Ae,{placeholder:"e.g., deploy@autoglue",...S})}),o.jsx(Pe,{})]})}),o.jsx(Ke,{control:x.control,name:"type",render:({field:S})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Type"}),o.jsx(Be,{children:o.jsxs(Dt,{value:S.value,onValueChange:A=>{S.onChange(A),A==="ed25519"?x.setValue("bits",void 0):x.setValue("bits","4096")},children:[o.jsx(kt,{className:"w-[180px]",children:o.jsx(Mt,{placeholder:"Select a ssh key type"})}),o.jsxs(zt,{children:[o.jsx(Fe,{value:"rsa",children:"RSA"}),o.jsx(Fe,{value:"ed25519",children:"ED25519"})]})]})}),o.jsx(Pe,{})]})}),o.jsx(Ke,{control:x.control,name:"bits",render:({field:S})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Key size"}),o.jsx(Be,{children:o.jsxs(Dt,{value:S.value,disabled:x.watch("type")==="ed25519",onValueChange:S.onChange,children:[o.jsx(kt,{className:"w-[180px]",children:o.jsx(Mt,{placeholder:"RSA only"})}),o.jsxs(zt,{children:[o.jsx(Fe,{value:"2048",children:"2048"}),o.jsx(Fe,{value:"3072",children:"3072"}),o.jsx(Fe,{value:"4096",children:"4096"})]})]})}),o.jsx(Pe,{})]})}),o.jsxs(Nt,{className:"gap-2",children:[o.jsx(ie,{type:"button",variant:"outline",onClick:()=>i(!1),disabled:v.isPending,children:"Cancel"}),o.jsx(ie,{type:"submit",disabled:v.isPending,children:v.isPending?o.jsxs(o.Fragment,{children:[o.jsx(lr,{className:"mr-2 h-4 w-4 animate-spin"}),"Creating…"]}):"Create"})]})]})})]})]})]}),o.jsx("div",{className:"bg-background overflow-hidden rounded-2xl border shadow-sm",children:o.jsx("div",{className:"overflow-x-auto",children:o.jsxs(da,{children:[o.jsx(fa,{children:o.jsxs(tt,{children:[o.jsx(Ue,{children:"Name"}),o.jsx(Ue,{children:"Public Key"}),o.jsx(Ue,{children:"Fingerprint"}),o.jsx(Ue,{children:"Created"}),o.jsx(Ue,{className:"w-[160px] text-right",children:"Actions"})]})}),o.jsxs(ha,{children:[R.map(S=>{const A=Oq(S.public_key);return Ji(S.public_key,18),o.jsxs(tt,{children:[o.jsx(je,{className:"font-medium",children:S.name||"—"}),o.jsx(je,{children:o.jsxs(jd,{children:[o.jsx(Cd,{asChild:!0,children:o.jsx(ca,{variant:"secondary",className:"whitespace-nowrap",children:A})}),o.jsx(Ed,{className:"max-w-[70vw]",children:o.jsx("div",{className:"max-w-full",children:o.jsx("p",{className:"font-mono text-xs break-all",children:S.public_key})})})]})}),o.jsx(je,{className:"font-mono text-xs",children:S.fingerprint}),o.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"}):"—"}),o.jsxs(je,{className:"space-x-2 text-right",children:[o.jsx(ie,{size:"sm",variant:"outline",onClick:()=>pm(S.public_key??"","Public key copied"),children:"Copy Pub"}),o.jsx(ie,{size:"sm",variant:"outline",onClick:()=>pm(S.fingerprint??"","Fingerprint copied"),children:"Copy FP"}),o.jsxs(ie,{size:"sm",variant:"outline",onClick:()=>w.mutate(S.id),children:[o.jsx(wm,{className:"mr-1 h-4 w-4"}),"Reveal"]}),o.jsxs(ie,{size:"sm",variant:"outline",onClick:async()=>{try{const{filename:M,blob:T}=await us.downloadBlob(S.id,"both");Nq(T,M)}catch(M){xe.error(M?.message??"Download failed")}},children:[o.jsx(GO,{className:"mr-1 h-4 w-4"}),"Download"]}),o.jsxs(ie,{size:"sm",variant:"destructive",onClick:()=>f(S.id),children:[o.jsx(lg,{className:"mr-1 h-4 w-4"}),"Delete"]})]})]},S.id)}),R.length===0&&o.jsx(tt,{children:o.jsx(je,{colSpan:5,className:"text-muted-foreground py-10 text-center",children:"No SSH Keys"})})]})]})})}),o.jsx(bt,{open:!!l,onOpenChange:S=>!S&&u(null),children:o.jsxs(wt,{className:"sm:max-w-2xl",children:[o.jsx(St,{children:o.jsx(_t,{children:"Private Key (read-only)"})}),o.jsx("div",{className:"space-y-3",children:o.jsxs("div",{className:"text-sm",children:[o.jsx("div",{className:"font-medium",children:l?.name??"SSH key"}),o.jsx("div",{className:"text-muted-foreground font-mono text-xs",children:l?.fingerprint}),o.jsx(gs,{readOnly:!0,className:"h-64 w-full rounded-md border p-3 font-mono text-xs",value:l?.private_key??""}),o.jsx("div",{className:"flex justify-end",children:o.jsx(ie,{onClick:()=>l?.private_key&&pm(l.private_key,"Private key copied"),children:"Copy"})})]})})]})}),o.jsx(bt,{open:!!d,onOpenChange:S=>!S&&f(null),children:o.jsxs(wt,{className:"sm:max-w-md",children:[o.jsx(St,{children:o.jsx(_t,{children:"Delete SSH Key"})}),o.jsx("p",{className:"text-muted-foreground text-sm",children:"This will permanently delete the keypair. This action cannot be undone."}),o.jsxs(Nt,{className:"gap-2",children:[o.jsx(ie,{variant:"outline",onClick:()=>f(null),children:"Cancel"}),o.jsx(ie,{variant:"destructive",onClick:()=>d&&_.mutate(d),disabled:_.isPending,children:_.isPending?o.jsxs(o.Fragment,{children:[o.jsx(lr,{className:"mr-2 h-4 w-4 animate-spin"}),"Deleting…"]}):"Delete"})]})]})})]})})},Wm=["NoSchedule","PreferNoSchedule","NoExecute"],dE=pa({key:Pt().trim().min(1,"Key is required").max(120,"Max 120 chars"),value:Pt().trim().optional(),effect:Fa(Wm)}),Tq=dE.partial();function Dq({t:e}){const t=`${e.key}${e.value?`=${e.value}`:""}${e.effect?`:${e.effect}`:""}`;return o.jsxs(ca,{variant:"secondary",className:"font-mono text-xs",children:[o.jsx(Vd,{className:"mr-1 h-3 w-3"}),t]})}const Mq=()=>{const[e,t]=m.useState(""),[a,i]=m.useState(!1),[l,u]=m.useState(!1),[d,f]=m.useState(null),[g,y]=m.useState(null),x=Xn(),v=Zt({queryKey:["taints"],queryFn:()=>Zl.listTaints()}),w=un({resolver:dn(dE),defaultValues:{key:"",value:"",effect:void 0}}),_=lt({mutationFn:E=>Zl.createTaint(E),onSuccess:async()=>{await x.invalidateQueries({queryKey:["taints"]}),w.reset(),i(!1),xe.success("Taint Created Successfully.")},onError:E=>{xe.error(E.message??"There was an error while creating Taint")}}),R=E=>{_.mutate(E)},S=un({resolver:dn(Tq),defaultValues:{}}),A=lt({mutationFn:({id:E,values:D})=>Zl.updateTaint(E,D),onSuccess:async()=>{await x.invalidateQueries({queryKey:["taints"]}),S.reset(),u(!1),xe.success("Taint Updated Successfully.")},onError:E=>{xe.error(E.message??"There was an error while updating Taint")}}),M=E=>{y(E.id),S.reset({key:E.key,value:E.value,effect:E.effect}),u(!0)},T=lt({mutationFn:E=>Zl.deleteTaint(E),onSuccess:async()=>{await x.invalidateQueries({queryKey:["taints"]}),f(null),xe.success("Taint Deleted Successfully.")},onError:E=>{xe.error(E.message??"There was an error while deleting Taint")}}),N=m.useMemo(()=>{const E=v.data??[],D=e.trim().toLowerCase();return D?E.filter(I=>I.key?.toLowerCase().includes(D)||I.value?.toLowerCase().includes(D)||I.effect?.toLowerCase().includes(D)):E},[e,v.data]);return v.isLoading?o.jsx("div",{className:"p-6",children:"Loading taints…"}):v.error?o.jsx("div",{className:"p-6 text-red-500",children:"Error loading taints."}):o.jsxs("div",{className:"space-y-4 p-6",children:[o.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[o.jsx("h1",{className:"mb-4 text-2xl font-bold",children:"Taints"}),o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsxs("div",{className:"relative",children:[o.jsx(dr,{className:"absolute top-2.5 left-2 h-4 w-4 opacity-60"}),o.jsx(Ae,{value:e,onChange:E=>t(E.target.value),placeholder:"Search taints",className:"w-64 pl-8"})]}),o.jsxs(bt,{open:a,onOpenChange:i,children:[o.jsx(Xa,{asChild:!0,children:o.jsxs(ie,{onClick:()=>i(!0),children:[o.jsx(Si,{className:"mr-2 h-4 w-4"})," Create Taint"]})}),o.jsxs(wt,{className:"sm:max-w-lg",children:[o.jsx(St,{children:o.jsx(_t,{children:"Create taint"})}),o.jsx(fn,{...w,children:o.jsxs("form",{className:"space-y-4",onSubmit:w.handleSubmit(R),children:[o.jsx(Ke,{control:w.control,name:"key",render:({field:E})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Key"}),o.jsx(Be,{children:o.jsx(Ae,{placeholder:"dedicated",...E})}),o.jsx(Pe,{})]})}),o.jsx(Ke,{control:w.control,name:"value",render:({field:E})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Value (optional)"}),o.jsx(Be,{children:o.jsx(Ae,{placeholder:"gpu",...E})}),o.jsx(Pe,{})]})}),o.jsx(Ke,{control:w.control,name:"effect",render:({field:E})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Effect"}),o.jsxs(Dt,{onValueChange:E.onChange,value:E.value,children:[o.jsx(Be,{children:o.jsx(kt,{children:o.jsx(Mt,{placeholder:"Select effect"})})}),o.jsx(zt,{children:Wm.map(D=>o.jsx(Fe,{value:D,children:D},D))})]}),o.jsx(Pe,{})]})}),o.jsxs(Nt,{className:"gap-2",children:[o.jsx(ie,{type:"button",variant:"outline",onClick:()=>i(!1),children:"Cancel"}),o.jsx(ie,{type:"submit",disabled:w.formState.isSubmitting,children:w.formState.isSubmitting?"Creating…":"Create"})]})]})})]})]})]})]}),o.jsx("div",{className:"bg-background overflow-hidden rounded-2xl border shadow-sm",children:o.jsx("div",{className:"overflow-x-auto",children:o.jsxs(da,{children:[o.jsx(fa,{children:o.jsxs(tt,{children:[o.jsx(Ue,{children:"Taint"}),o.jsx(Ue,{className:"w-[180px] text-right",children:"Actions"})]})}),o.jsxs(ha,{children:[N.map(E=>o.jsxs(tt,{children:[o.jsx(je,{children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Dq,{t:E}),o.jsx("code",{className:"text-muted-foreground text-xs",children:Ji(E.id,6)})]})}),o.jsx(je,{children:o.jsxs("div",{className:"flex justify-end gap-2",children:[o.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>M(E),children:[o.jsx(sc,{className:"mr-2 h-4 w-4"})," Edit"]}),o.jsx(ie,{variant:"destructive",size:"sm",onClick:()=>f(E.id),disabled:T.isPending&&d===E.id,children:T.isPending&&d===E.id?"Deleting…":"Delete"})]})})]},E.id)),N.length===0&&o.jsx(tt,{children:o.jsxs(je,{colSpan:3,className:"text-muted-foreground py-10 text-center",children:[o.jsx(sg,{className:"mx-auto mb-2 h-6 w-6 opacity-60"}),"No taints match your search."]})})]})]})})}),o.jsx(bt,{open:l,onOpenChange:u,children:o.jsxs(wt,{className:"sm:max-w-lg",children:[o.jsx(St,{children:o.jsx(_t,{children:"Edit taint"})}),o.jsx(fn,{...S,children:o.jsxs("form",{className:"space-y-4",onSubmit:S.handleSubmit(E=>{g&&A.mutate({id:g,values:E})}),children:[o.jsx(Ke,{control:S.control,name:"key",render:({field:E})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Key"}),o.jsx(Be,{children:o.jsx(Ae,{placeholder:"dedicated",...E})}),o.jsx(Pe,{})]})}),o.jsx(Ke,{control:S.control,name:"value",render:({field:E})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Value (optional)"}),o.jsx(Be,{children:o.jsx(Ae,{placeholder:"gpu",...E})}),o.jsx(Pe,{})]})}),o.jsx(Ke,{control:S.control,name:"effect",render:({field:E})=>o.jsxs(Ce,{children:[o.jsx(Ee,{children:"Effect"}),o.jsxs(Dt,{onValueChange:E.onChange,value:E.value,children:[o.jsx(Be,{children:o.jsx(kt,{children:o.jsx(Mt,{placeholder:"Select effect"})})}),o.jsx(zt,{children:Wm.map(D=>o.jsx(Fe,{value:D,children:D},D))})]}),o.jsx(Pe,{})]})}),o.jsxs(Nt,{className:"gap-2",children:[o.jsx(ie,{type:"button",variant:"outline",onClick:()=>u(!1),children:"Cancel"}),o.jsx(ie,{type:"submit",disabled:A.isPending,children:A.isPending?"Saving…":"Save changes"})]})]})})]})}),o.jsx(bt,{open:!!d,onOpenChange:E=>!E&&f(null),children:o.jsxs(wt,{className:"sm:max-w-md",children:[o.jsx(St,{children:o.jsx(_t,{children:"Delete taint"})}),o.jsx("p",{className:"text-muted-foreground text-sm",children:"This action cannot be undone. Are you sure you want to delete this taint?"}),o.jsxs(Nt,{className:"gap-2",children:[o.jsx(ie,{variant:"outline",onClick:()=>f(null),children:"Cancel"}),o.jsx(ie,{variant:"destructive",onClick:()=>d&&T.mutate(d),disabled:T.isPending,children:T.isPending?"Deleting…":"Delete"})]})]})})]})};function kq(){return o.jsxs(EN,{children:[o.jsx(Nn,{path:"/login",element:o.jsx(Q0,{})}),o.jsx(Nn,{element:o.jsx(s6,{}),children:o.jsxs(Nn,{element:o.jsx(i6,{}),children:[o.jsx(Nn,{path:"/me",element:o.jsx(b9,{})}),o.jsx(Nn,{path:"/org/settings",element:o.jsx(A9,{})}),o.jsx(Nn,{path:"/org/members",element:o.jsx(N9,{})}),o.jsx(Nn,{path:"/org/api-keys",element:o.jsx(E9,{})}),o.jsx(Nn,{path:"/ssh",element:o.jsx(Aq,{})}),o.jsx(Nn,{path:"/servers",element:o.jsx(Eq,{})}),o.jsx(Nn,{path:"/taints",element:o.jsx(Mq,{})}),o.jsx(Nn,{path:"/labels",element:o.jsx(p9,{})}),o.jsx(Nn,{path:"/annotations",element:o.jsx(X8,{})}),o.jsx(Nn,{path:"/node-pools",element:o.jsx(j9,{})}),o.jsx(Nn,{path:"/credentials",element:o.jsx(i9,{})}),o.jsx(Nn,{path:"/admin/jobs",element:o.jsx(c9,{})})]})}),o.jsx(Nn,{path:"*",element:o.jsx(Q0,{})})]})}sA.createRoot(document.getElementById("root")).render(o.jsx(m.StrictMode,{children:o.jsx(RN,{children:o.jsx(nA,{children:o.jsx(kq,{})})})}));
|
|
//# sourceMappingURL=index-52pog1DZ.js.map
|