import{r as T,R as et,a as ez,b as tz,c as _Y,d as q_,e as SC,u as B_,L as PR,N as BE,O as nz,f as $Y,g as Hm,h as NY,i as DY,j as ns,B as PY}from"./react-v1TLhXpT.js";(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))o(u);new MutationObserver(u=>{for(const h of u)if(h.type==="childList")for(const m of h.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&o(m)}).observe(document,{childList:!0,subtree:!0});function s(u){const h={};return u.integrity&&(h.integrity=u.integrity),u.referrerPolicy&&(h.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?h.credentials="include":u.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function o(u){if(u.ep)return;u.ep=!0;const h=s(u);fetch(u.href,h)}})();var MR={exports:{}},ob={};var jM;function MY(){if(jM)return ob;jM=1;var e=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function s(o,u,h){var m=null;if(h!==void 0&&(m=""+h),u.key!==void 0&&(m=""+u.key),"key"in u){h={};for(var g in u)g!=="key"&&(h[g]=u[g])}else h=u;return u=h.ref,{$$typeof:e,type:o,key:m,ref:u!==void 0?u:null,props:h}}return ob.Fragment=r,ob.jsx=s,ob.jsxs=s,ob}var CM;function IY(){return CM||(CM=1,MR.exports=MY()),MR.exports}var c=IY(),zY=(e,r,s,o,u,h,m,g)=>{let b=document.documentElement,w=["light","dark"];function E(R){(Array.isArray(e)?e:[e]).forEach(M=>{let I=M==="class",F=I&&h?u.map(H=>h[H]||H):u;I?(b.classList.remove(...F),b.classList.add(h&&h[R]?h[R]:R)):b.setAttribute(M,R)}),A(R)}function A(R){g&&w.includes(R)&&(b.style.colorScheme=R)}function k(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(o)E(o);else try{let R=localStorage.getItem(r)||s,M=m&&R==="system"?k():R;E(M)}catch{}},AM=["light","dark"],rz="(prefers-color-scheme: dark)",LY=typeof window>"u",U_=T.createContext(void 0),FY={setTheme:e=>{},themes:[]},K_=()=>{var e;return(e=T.useContext(U_))!=null?e:FY},qY=e=>T.useContext(U_)?T.createElement(T.Fragment,null,e.children):T.createElement(UY,{...e}),BY=["light","dark"],UY=({forcedTheme:e,disableTransitionOnChange:r=!1,enableSystem:s=!0,enableColorScheme:o=!0,storageKey:u="theme",themes:h=BY,defaultTheme:m=s?"system":"light",attribute:g="data-theme",value:b,children:w,nonce:E,scriptProps:A})=>{let[k,R]=T.useState(()=>VY(u,m)),[M,I]=T.useState(()=>k==="system"?IR():k),F=b?Object.values(b):h,H=T.useCallback(W=>{let ae=W;if(!ae)return;W==="system"&&s&&(ae=IR());let Q=b?b[ae]:ae,te=r?HY(E):null,de=document.documentElement,je=we=>{we==="class"?(de.classList.remove(...F),Q&&de.classList.add(Q)):we.startsWith("data-")&&(Q?de.setAttribute(we,Q):de.removeAttribute(we))};if(Array.isArray(g)?g.forEach(je):je(g),o){let we=AM.includes(m)?m:null,ie=AM.includes(ae)?ae:we;de.style.colorScheme=ie}te?.()},[E]),V=T.useCallback(W=>{let ae=typeof W=="function"?W(k):W;R(ae);try{localStorage.setItem(u,ae)}catch{}},[k]),K=T.useCallback(W=>{let ae=IR(W);I(ae),k==="system"&&s&&!e&&H("system")},[k,e]);T.useEffect(()=>{let W=window.matchMedia(rz);return W.addListener(K),K(W),()=>W.removeListener(K)},[K]),T.useEffect(()=>{let W=ae=>{ae.key===u&&(ae.newValue?R(ae.newValue):V(m))};return window.addEventListener("storage",W),()=>window.removeEventListener("storage",W)},[V]),T.useEffect(()=>{H(e??k)},[e,k]);let z=T.useMemo(()=>({theme:k,setTheme:V,forcedTheme:e,resolvedTheme:k==="system"?M:k,themes:s?[...h,"system"]:h,systemTheme:s?M:void 0}),[k,V,e,M,s,h]);return T.createElement(U_.Provider,{value:z},T.createElement(KY,{forcedTheme:e,storageKey:u,attribute:g,enableSystem:s,enableColorScheme:o,defaultTheme:m,value:b,themes:h,nonce:E,scriptProps:A}),w)},KY=T.memo(({forcedTheme:e,storageKey:r,attribute:s,enableSystem:o,enableColorScheme:u,defaultTheme:h,value:m,themes:g,nonce:b,scriptProps:w})=>{let E=JSON.stringify([s,r,h,e,g,m,o,u]).slice(1,-1);return T.createElement("script",{...w,suppressHydrationWarning:!0,nonce:typeof window>"u"?b:"",dangerouslySetInnerHTML:{__html:`(${zY.toString()})(${E})`}})}),VY=(e,r)=>{if(LY)return;let s;try{s=localStorage.getItem(e)||void 0}catch{}return s||r},HY=e=>{let r=document.createElement("style");return e&&r.setAttribute("nonce",e),r.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(r),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(r)},1)}},IR=e=>(e||(e=window.matchMedia(rz)),e.matches?"dark":"light");function GY({children:e,defaultTheme:r="system",storageKey:s="vite-ui-theme"}){return c.jsx(qY,{attribute:"class",defaultTheme:r,enableSystem:!0,storageKey:s,disableTransitionOnChange:!0,children:e})}var kg=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(){}},XY={setTimeout:(e,r)=>setTimeout(e,r),clearTimeout:e=>clearTimeout(e),setInterval:(e,r)=>setInterval(e,r),clearInterval:e=>clearInterval(e)},YY=class{#e=XY;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,r){return this.#e.setTimeout(e,r)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,r){return this.#e.setInterval(e,r)}clearInterval(e){this.#e.clearInterval(e)}},Sp=new YY;function ZY(e){setTimeout(e,0)}var Rp=typeof window>"u"||"Deno"in globalThis;function Ui(){}function JY(e,r){return typeof e=="function"?e(r):e}function NT(e){return typeof e=="number"&&e>=0&&e!==1/0}function sz(e,r){return Math.max(e+(r||0)-Date.now(),0)}function qd(e,r){return typeof e=="function"?e(r):e}function oo(e,r){return typeof e=="function"?e(r):e}function OM(e,r){const{type:s="all",exact:o,fetchStatus:u,predicate:h,queryKey:m,stale:g}=e;if(m){if(o){if(r.queryHash!==V_(m,r.options))return!1}else if(!Kb(r.queryKey,m))return!1}if(s!=="all"){const b=r.isActive();if(s==="active"&&!b||s==="inactive"&&b)return!1}return!(typeof g=="boolean"&&r.isStale()!==g||u&&u!==r.state.fetchStatus||h&&!h(r))}function kM(e,r){const{exact:s,status:o,predicate:u,mutationKey:h}=e;if(h){if(!r.options.mutationKey)return!1;if(s){if(Tp(r.options.mutationKey)!==Tp(h))return!1}else if(!Kb(r.options.mutationKey,h))return!1}return!(o&&r.state.status!==o||u&&!u(r))}function V_(e,r){return(r?.queryKeyHashFn||Tp)(e)}function Tp(e){return JSON.stringify(e,(r,s)=>DT(s)?Object.keys(s).sort().reduce((o,u)=>(o[u]=s[u],o),{}):s)}function Kb(e,r){return e===r?!0:typeof e!=typeof r?!1:e&&r&&typeof e=="object"&&typeof r=="object"?Object.keys(r).every(s=>Kb(e[s],r[s])):!1}var WY=Object.prototype.hasOwnProperty;function iz(e,r){if(e===r)return e;const s=RM(e)&&RM(r);if(!s&&!(DT(e)&&DT(r)))return r;const u=(s?e:Object.keys(e)).length,h=s?r:Object.keys(r),m=h.length,g=s?new Array(m):{};let b=0;for(let w=0;w{Sp.setTimeout(r,e)})}function PT(e,r,s){return typeof s.structuralSharing=="function"?s.structuralSharing(e,r):s.structuralSharing!==!1?iz(e,r):r}function eZ(e,r,s=0){const o=[...e,r];return s&&o.length>s?o.slice(1):o}function tZ(e,r,s=0){const o=[r,...e];return s&&o.length>s?o.slice(0,-1):o}var H_=Symbol();function az(e,r){return!e.queryFn&&r?.initialPromise?()=>r.initialPromise:!e.queryFn||e.queryFn===H_?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function G_(e,r){return typeof e=="function"?e(...r):!!e}function nZ(e,r,s){let o=!1,u;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(u??=r(),o||(o=!0,u.aborted?s():u.addEventListener("abort",s,{once:!0})),u)}),e}var rZ=class extends kg{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!Rp&&window.addEventListener){const r=()=>e();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(r=>{r(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},X_=new rZ;function MT(){let e,r;const s=new Promise((u,h)=>{e=u,r=h});s.status="pending",s.catch(()=>{});function o(u){Object.assign(s,u),delete s.resolve,delete s.reject}return s.resolve=u=>{o({status:"fulfilled",value:u}),e(u)},s.reject=u=>{o({status:"rejected",reason:u}),r(u)},s}var sZ=ZY;function iZ(){let e=[],r=0,s=g=>{g()},o=g=>{g()},u=sZ;const h=g=>{r?e.push(g):u(()=>{s(g)})},m=()=>{const g=e;e=[],g.length&&u(()=>{o(()=>{g.forEach(b=>{s(b)})})})};return{batch:g=>{let b;r++;try{b=g()}finally{r--,r||m()}return b},batchCalls:g=>(...b)=>{h(()=>{g(...b)})},schedule:h,setNotifyFunction:g=>{s=g},setBatchNotifyFunction:g=>{o=g},setScheduler:g=>{u=g}}}var As=iZ(),aZ=class extends kg{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!Rp&&window.addEventListener){const r=()=>e(!0),s=()=>e(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",s)}}}}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(s=>{s(e)}))}isOnline(){return this.#e}},Nj=new aZ;function oZ(e){return Math.min(1e3*2**e,3e4)}function oz(e){return(e??"online")==="online"?Nj.isOnline():!0}var IT=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function lz(e){let r=!1,s=0,o;const u=MT(),h=()=>u.status!=="pending",m=I=>{if(!h()){const F=new IT(I);k(F),e.onCancel?.(F)}},g=()=>{r=!0},b=()=>{r=!1},w=()=>X_.isFocused()&&(e.networkMode==="always"||Nj.isOnline())&&e.canRun(),E=()=>oz(e.networkMode)&&e.canRun(),A=I=>{h()||(o?.(),u.resolve(I))},k=I=>{h()||(o?.(),u.reject(I))},R=()=>new Promise(I=>{o=F=>{(h()||w())&&I(F)},e.onPause?.()}).then(()=>{o=void 0,h()||e.onContinue?.()}),M=()=>{if(h())return;let I;const F=s===0?e.initialPromise:void 0;try{I=F??e.fn()}catch(H){I=Promise.reject(H)}Promise.resolve(I).then(A).catch(H=>{if(h())return;const V=e.retry??(Rp?0:3),K=e.retryDelay??oZ,z=typeof K=="function"?K(s,H):K,W=V===!0||typeof V=="number"&&sw()?void 0:R()).then(()=>{r?k(H):M()})})};return{promise:u,status:()=>u.status,cancel:m,continue:()=>(o?.(),u),cancelRetry:g,continueRetry:b,canStart:E,start:()=>(E()?M():R().then(M),u)}}var cz=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),NT(this.gcTime)&&(this.#e=Sp.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Rp?1/0:300*1e3))}clearGcTimeout(){this.#e&&(Sp.clearTimeout(this.#e),this.#e=void 0)}},lZ=class extends cz{#e;#t;#n;#s;#r;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#s=e.client,this.#n=this.#s.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=$M(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=$M(this.options);r.data!==void 0&&(this.setState(_M(r.data,r.dataUpdatedAt)),this.#e=r)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,r){const s=PT(this.state.data,e,this.options);return this.#i({data:s,type:"success",dataUpdatedAt:r?.updatedAt,manual:r?.manual}),s}setState(e,r){this.#i({type:"setState",state:e,setStateOptions:r})}cancel(e){const r=this.#r?.promise;return this.#r?.cancel(e),r?r.then(Ui).catch(Ui):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>oo(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===H_||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>qd(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:!sz(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(r=>r.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(r=>r.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(r=>r!==e),this.observers.length||(this.#r&&(this.#o?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}async fetch(e,r){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&r?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const g=this.observers.find(b=>b.options.queryFn);g&&this.setOptions(g.options)}const s=new AbortController,o=g=>{Object.defineProperty(g,"signal",{enumerable:!0,get:()=>(this.#o=!0,s.signal)})},u=()=>{const g=az(this.options,r),w=(()=>{const E={client:this.#s,queryKey:this.queryKey,meta:this.meta};return o(E),E})();return this.#o=!1,this.options.persister?this.options.persister(g,w,this):g(w)},m=(()=>{const g={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:this.#s,state:this.state,fetchFn:u};return o(g),g})();this.options.behavior?.onFetch(m,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==m.fetchOptions?.meta)&&this.#i({type:"fetch",meta:m.fetchOptions?.meta}),this.#r=lz({initialPromise:r?.initialPromise,fn:m.fetchFn,onCancel:g=>{g instanceof IT&&g.revert&&this.setState({...this.#t,fetchStatus:"idle"}),s.abort()},onFail:(g,b)=>{this.#i({type:"failed",failureCount:g,error:b})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:m.options.retry,retryDelay:m.options.retryDelay,networkMode:m.options.networkMode,canRun:()=>!0});try{const g=await this.#r.start();if(g===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(g),this.#n.config.onSuccess?.(g,this),this.#n.config.onSettled?.(g,this.state.error,this),g}catch(g){if(g instanceof IT){if(g.silent)return this.#r.promise;if(g.revert){if(this.state.data===void 0)throw g;return this.state.data}}throw this.#i({type:"error",error:g}),this.#n.config.onError?.(g,this),this.#n.config.onSettled?.(this.state.data,g,this),g}finally{this.scheduleGc()}}#i(e){const r=s=>{switch(e.type){case"failed":return{...s,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...uz(s.data,this.options),fetchMeta:e.meta??null};case"success":const o={...s,..._M(e.data,e.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?o:void 0,o;case"error":const u=e.error;return{...s,error:u,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:u,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...e.state}}};this.state=r(this.state),As.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function uz(e,r){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:oz(r.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function _M(e,r){return{data:e,dataUpdatedAt:r??Date.now(),error:null,isInvalidated:!1,status:"success"}}function $M(e){const r=typeof e.initialData=="function"?e.initialData():e.initialData,s=r!==void 0,o=s?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:r,dataUpdateCount:0,dataUpdatedAt:s?o??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var cZ=class extends kg{constructor(e,r){super(),this.options=r,this.#e=e,this.#i=null,this.#o=MT(),this.bindMethods(),this.setOptions(r)}#e;#t=void 0;#n=void 0;#s=void 0;#r;#a;#o;#i;#m;#h;#p;#c;#u;#l;#f=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),NM(this.#t,this.options)?this.#d():this.updateResult(),this.#x())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return zT(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return zT(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#w(),this.#t.removeObserver(this)}setOptions(e){const r=this.options,s=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 oo(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),r._defaulted&&!$j(this.options,r)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const o=this.hasListeners();o&&DM(this.#t,s,this.options,r)&&this.#d(),this.updateResult(),o&&(this.#t!==s||oo(this.options.enabled,this.#t)!==oo(r.enabled,this.#t)||qd(this.options.staleTime,this.#t)!==qd(r.staleTime,this.#t))&&this.#g();const u=this.#y();o&&(this.#t!==s||oo(this.options.enabled,this.#t)!==oo(r.enabled,this.#t)||u!==this.#l)&&this.#v(u)}getOptimisticResult(e){const r=this.#e.getQueryCache().build(this.#e,e),s=this.createResult(r,e);return dZ(this,s)&&(this.#s=s,this.#a=this.options,this.#r=this.#t.state),s}getCurrentResult(){return this.#s}trackResult(e,r){return new Proxy(e,{get:(s,o)=>(this.trackProp(o),r?.(o),o==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(s,o))})}trackProp(e){this.#f.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const r=this.#e.defaultQueryOptions(e),s=this.#e.getQueryCache().build(this.#e,r);return s.fetch().then(()=>this.createResult(s,r))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#s))}#d(e){this.#S();let r=this.#t.fetch(this.options,e);return e?.throwOnError||(r=r.catch(Ui)),r}#g(){this.#b();const e=qd(this.options.staleTime,this.#t);if(Rp||this.#s.isStale||!NT(e))return;const s=sz(this.#s.dataUpdatedAt,e)+1;this.#c=Sp.setTimeout(()=>{this.#s.isStale||this.updateResult()},s)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#w(),this.#l=e,!(Rp||oo(this.options.enabled,this.#t)===!1||!NT(this.#l)||this.#l===0)&&(this.#u=Sp.setInterval(()=>{(this.options.refetchIntervalInBackground||X_.isFocused())&&this.#d()},this.#l))}#x(){this.#g(),this.#v(this.#y())}#b(){this.#c&&(Sp.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#u&&(Sp.clearInterval(this.#u),this.#u=void 0)}createResult(e,r){const s=this.#t,o=this.options,u=this.#s,h=this.#r,m=this.#a,b=e!==s?e.state:this.#n,{state:w}=e;let E={...w},A=!1,k;if(r._optimisticResults){const te=this.hasListeners(),de=!te&&NM(e,r),je=te&&DM(e,s,r,o);(de||je)&&(E={...E,...uz(w.data,e.options)}),r._optimisticResults==="isRestoring"&&(E.fetchStatus="idle")}let{error:R,errorUpdatedAt:M,status:I}=E;k=E.data;let F=!1;if(r.placeholderData!==void 0&&k===void 0&&I==="pending"){let te;u?.isPlaceholderData&&r.placeholderData===m?.placeholderData?(te=u.data,F=!0):te=typeof r.placeholderData=="function"?r.placeholderData(this.#p?.state.data,this.#p):r.placeholderData,te!==void 0&&(I="success",k=PT(u?.data,te,r),A=!0)}if(r.select&&k!==void 0&&!F)if(u&&k===h?.data&&r.select===this.#m)k=this.#h;else try{this.#m=r.select,k=r.select(k),k=PT(u?.data,k,r),this.#h=k,this.#i=null}catch(te){this.#i=te}this.#i&&(R=this.#i,k=this.#h,M=Date.now(),I="error");const H=E.fetchStatus==="fetching",V=I==="pending",K=I==="error",z=V&&H,W=k!==void 0,Q={status:I,fetchStatus:E.fetchStatus,isPending:V,isSuccess:I==="success",isError:K,isInitialLoading:z,isLoading:z,data:k,dataUpdatedAt:E.dataUpdatedAt,error:R,errorUpdatedAt:M,failureCount:E.fetchFailureCount,failureReason:E.fetchFailureReason,errorUpdateCount:E.errorUpdateCount,isFetched:E.dataUpdateCount>0||E.errorUpdateCount>0,isFetchedAfterMount:E.dataUpdateCount>b.dataUpdateCount||E.errorUpdateCount>b.errorUpdateCount,isFetching:H,isRefetching:H&&!V,isLoadingError:K&&!W,isPaused:E.fetchStatus==="paused",isPlaceholderData:A,isRefetchError:K&&W,isStale:Y_(e,r),refetch:this.refetch,promise:this.#o,isEnabled:oo(r.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const te=we=>{Q.status==="error"?we.reject(Q.error):Q.data!==void 0&&we.resolve(Q.data)},de=()=>{const we=this.#o=Q.promise=MT();te(we)},je=this.#o;switch(je.status){case"pending":e.queryHash===s.queryHash&&te(je);break;case"fulfilled":(Q.status==="error"||Q.data!==je.value)&&de();break;case"rejected":(Q.status!=="error"||Q.error!==je.reason)&&de();break}}return Q}updateResult(){const e=this.#s,r=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#a=this.options,this.#r.data!==void 0&&(this.#p=this.#t),$j(r,e))return;this.#s=r;const s=()=>{if(!e)return!0;const{notifyOnChangeProps:o}=this.options,u=typeof o=="function"?o():o;if(u==="all"||!u&&!this.#f.size)return!0;const h=new Set(u??this.#f);return this.options.throwOnError&&h.add("error"),Object.keys(this.#s).some(m=>{const g=m;return this.#s[g]!==e[g]&&h.has(g)})};this.#E({listeners:s()})}#S(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const r=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(r?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#x()}#E(e){As.batch(()=>{e.listeners&&this.listeners.forEach(r=>{r(this.#s)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function uZ(e,r){return oo(r.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&r.retryOnMount===!1)}function NM(e,r){return uZ(e,r)||e.state.data!==void 0&&zT(e,r,r.refetchOnMount)}function zT(e,r,s){if(oo(r.enabled,e)!==!1&&qd(r.staleTime,e)!=="static"){const o=typeof s=="function"?s(e):s;return o==="always"||o!==!1&&Y_(e,r)}return!1}function DM(e,r,s,o){return(e!==r||oo(o.enabled,e)===!1)&&(!s.suspense||e.state.status!=="error")&&Y_(e,s)}function Y_(e,r){return oo(r.enabled,e)!==!1&&e.isStaleByTime(qd(r.staleTime,e))}function dZ(e,r){return!$j(e.getCurrentResult(),r)}function PM(e){return{onFetch:(r,s)=>{const o=r.options,u=r.fetchOptions?.meta?.fetchMore?.direction,h=r.state.data?.pages||[],m=r.state.data?.pageParams||[];let g={pages:[],pageParams:[]},b=0;const w=async()=>{let E=!1;const A=M=>{nZ(M,()=>r.signal,()=>E=!0)},k=az(r.options,r.fetchOptions),R=async(M,I,F)=>{if(E)return Promise.reject();if(I==null&&M.pages.length)return Promise.resolve(M);const V=(()=>{const ae={client:r.client,queryKey:r.queryKey,pageParam:I,direction:F?"backward":"forward",meta:r.options.meta};return A(ae),ae})(),K=await k(V),{maxPages:z}=r.options,W=F?tZ:eZ;return{pages:W(M.pages,K,z),pageParams:W(M.pageParams,I,z)}};if(u&&h.length){const M=u==="backward",I=M?hZ:MM,F={pages:h,pageParams:m},H=I(o,F);g=await R(F,H,M)}else{const M=e??h.length;do{const I=b===0?m[0]??o.initialPageParam:MM(o,g);if(b>0&&I==null)break;g=await R(g,I),b++}while(br.options.persister?.(w,{client:r.client,queryKey:r.queryKey,meta:r.options.meta,signal:r.signal},s):r.fetchFn=w}}}function MM(e,{pages:r,pageParams:s}){const o=r.length-1;return r.length>0?e.getNextPageParam(r[o],r,s[o],s):void 0}function hZ(e,{pages:r,pageParams:s}){return r.length>0?e.getPreviousPageParam?.(r[0],r,s[0],s):void 0}var pZ=class extends cz{#e;#t;#n;#s;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||dz(),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(r=>r!==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.#s?.continue()??this.execute(this.state.variables)}async execute(e){const r=()=>{this.#r({type:"continue"})},s={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#s=lz({fn:()=>this.options.mutationFn?this.options.mutationFn(e,s):Promise.reject(new Error("No mutationFn found")),onFail:(h,m)=>{this.#r({type:"failed",failureCount:h,error:m})},onPause:()=>{this.#r({type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const o=this.state.status==="pending",u=!this.#s.canStart();try{if(o)r();else{this.#r({type:"pending",variables:e,isPaused:u}),await this.#n.config.onMutate?.(e,this,s);const m=await this.options.onMutate?.(e,s);m!==this.state.context&&this.#r({type:"pending",context:m,variables:e,isPaused:u})}const h=await this.#s.start();return await this.#n.config.onSuccess?.(h,e,this.state.context,this,s),await this.options.onSuccess?.(h,e,this.state.context,s),await this.#n.config.onSettled?.(h,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(h,null,e,this.state.context,s),this.#r({type:"success",data:h}),h}catch(h){try{await this.#n.config.onError?.(h,e,this.state.context,this,s)}catch(m){Promise.reject(m)}try{await this.options.onError?.(h,e,this.state.context,s)}catch(m){Promise.reject(m)}try{await this.#n.config.onSettled?.(void 0,h,this.state.variables,this.state.context,this,s)}catch(m){Promise.reject(m)}try{await this.options.onSettled?.(void 0,h,e,this.state.context,s)}catch(m){Promise.reject(m)}throw this.#r({type:"error",error:h}),h}finally{this.#n.runNext(this)}}#r(e){const r=s=>{switch(e.type){case"failed":return{...s,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,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{...s,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:e.error,failureCount:s.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=r(this.state),As.batch(()=>{this.#t.forEach(s=>{s.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function dz(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var fZ=class extends kg{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,r,s){const o=new pZ({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(r),state:s});return this.add(o),o}add(e){this.#e.add(e);const r=UE(e);if(typeof r=="string"){const s=this.#t.get(r);s?s.push(e):this.#t.set(r,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const r=UE(e);if(typeof r=="string"){const s=this.#t.get(r);if(s)if(s.length>1){const o=s.indexOf(e);o!==-1&&s.splice(o,1)}else s[0]===e&&this.#t.delete(r)}}this.notify({type:"removed",mutation:e})}canRun(e){const r=UE(e);if(typeof r=="string"){const o=this.#t.get(r)?.find(u=>u.state.status==="pending");return!o||o===e}else return!0}runNext(e){const r=UE(e);return typeof r=="string"?this.#t.get(r)?.find(o=>o!==e&&o.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){As.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 r={exact:!0,...e};return this.getAll().find(s=>kM(r,s))}findAll(e={}){return this.getAll().filter(r=>kM(e,r))}notify(e){As.batch(()=>{this.listeners.forEach(r=>{r(e)})})}resumePausedMutations(){const e=this.getAll().filter(r=>r.state.isPaused);return As.batch(()=>Promise.all(e.map(r=>r.continue().catch(Ui))))}};function UE(e){return e.options.scope?.id}var mZ=class extends kg{#e;#t=void 0;#n;#s;constructor(r,s){super(),this.#e=r,this.setOptions(s),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){const s=this.options;this.options=this.#e.defaultMutationOptions(r),$j(this.options,s)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),s?.mutationKey&&this.options.mutationKey&&Tp(s.mutationKey)!==Tp(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(r){this.#r(),this.#a(r)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#r(),this.#a()}mutate(r,s){return this.#s=s,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(r)}#r(){const r=this.#n?.state??dz();this.#t={...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset}}#a(r){As.batch(()=>{if(this.#s&&this.hasListeners()){const s=this.#t.variables,o=this.#t.context,u={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(r?.type==="success"){try{this.#s.onSuccess?.(r.data,s,o,u)}catch(h){Promise.reject(h)}try{this.#s.onSettled?.(r.data,null,s,o,u)}catch(h){Promise.reject(h)}}else if(r?.type==="error"){try{this.#s.onError?.(r.error,s,o,u)}catch(h){Promise.reject(h)}try{this.#s.onSettled?.(void 0,r.error,s,o,u)}catch(h){Promise.reject(h)}}}this.listeners.forEach(s=>{s(this.#t)})})}},gZ=class extends kg{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,r,s){const o=r.queryKey,u=r.queryHash??V_(o,r);let h=this.get(u);return h||(h=new lZ({client:e,queryKey:o,queryHash:u,options:e.defaultQueryOptions(r),state:s,defaultOptions:e.getQueryDefaults(o)}),this.add(h)),h}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const r=this.#e.get(e.queryHash);r&&(e.destroy(),r===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){As.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const r={exact:!0,...e};return this.getAll().find(s=>OM(r,s))}findAll(e={}){const r=this.getAll();return Object.keys(e).length>0?r.filter(s=>OM(e,s)):r}notify(e){As.batch(()=>{this.listeners.forEach(r=>{r(e)})})}onFocus(){As.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){As.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},yZ=class{#e;#t;#n;#s;#r;#a;#o;#i;constructor(e={}){this.#e=e.queryCache||new gZ,this.#t=e.mutationCache||new fZ,this.#n=e.defaultOptions||{},this.#s=new Map,this.#r=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=X_.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=Nj.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#i?.(),this.#i=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const r=this.defaultQueryOptions({queryKey:e});return this.#e.get(r.queryHash)?.state.data}ensureQueryData(e){const r=this.defaultQueryOptions(e),s=this.#e.build(this,r),o=s.state.data;return o===void 0?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime(qd(r.staleTime,s))&&this.prefetchQuery(r),Promise.resolve(o))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:r,state:s})=>{const o=s.data;return[r,o]})}setQueryData(e,r,s){const o=this.defaultQueryOptions({queryKey:e}),h=this.#e.get(o.queryHash)?.state.data,m=JY(r,h);if(m!==void 0)return this.#e.build(this,o).setData(m,{...s,manual:!0})}setQueriesData(e,r,s){return As.batch(()=>this.#e.findAll(e).map(({queryKey:o})=>[o,this.setQueryData(o,r,s)]))}getQueryState(e){const r=this.defaultQueryOptions({queryKey:e});return this.#e.get(r.queryHash)?.state}removeQueries(e){const r=this.#e;As.batch(()=>{r.findAll(e).forEach(s=>{r.remove(s)})})}resetQueries(e,r){const s=this.#e;return As.batch(()=>(s.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries({type:"active",...e},r)))}cancelQueries(e,r={}){const s={revert:!0,...r},o=As.batch(()=>this.#e.findAll(e).map(u=>u.cancel(s)));return Promise.all(o).then(Ui).catch(Ui)}invalidateQueries(e,r={}){return As.batch(()=>(this.#e.findAll(e).forEach(s=>{s.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},r)))}refetchQueries(e,r={}){const s={...r,cancelRefetch:r.cancelRefetch??!0},o=As.batch(()=>this.#e.findAll(e).filter(u=>!u.isDisabled()&&!u.isStatic()).map(u=>{let h=u.fetch(void 0,s);return s.throwOnError||(h=h.catch(Ui)),u.state.fetchStatus==="paused"?Promise.resolve():h}));return Promise.all(o).then(Ui)}fetchQuery(e){const r=this.defaultQueryOptions(e);r.retry===void 0&&(r.retry=!1);const s=this.#e.build(this,r);return s.isStaleByTime(qd(r.staleTime,s))?s.fetch(r):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ui).catch(Ui)}fetchInfiniteQuery(e){return e.behavior=PM(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ui).catch(Ui)}ensureInfiniteQueryData(e){return e.behavior=PM(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Nj.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,r){this.#s.set(Tp(e),{queryKey:e,defaultOptions:r})}getQueryDefaults(e){const r=[...this.#s.values()],s={};return r.forEach(o=>{Kb(e,o.queryKey)&&Object.assign(s,o.defaultOptions)}),s}setMutationDefaults(e,r){this.#r.set(Tp(e),{mutationKey:e,defaultOptions:r})}getMutationDefaults(e){const r=[...this.#r.values()],s={};return r.forEach(o=>{Kb(e,o.mutationKey)&&Object.assign(s,o.defaultOptions)}),s}defaultQueryOptions(e){if(e._defaulted)return e;const r={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return r.queryHash||(r.queryHash=V_(r.queryKey,r)),r.refetchOnReconnect===void 0&&(r.refetchOnReconnect=r.networkMode!=="always"),r.throwOnError===void 0&&(r.throwOnError=!!r.suspense),!r.networkMode&&r.persister&&(r.networkMode="offlineFirst"),r.queryFn===H_&&(r.enabled=!1),r}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()}},hz=T.createContext(void 0),Ms=e=>{const r=T.useContext(hz);if(!r)throw new Error("No QueryClient set, use QueryClientProvider to set one");return r},vZ=({client:e,children:r})=>(T.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),c.jsx(hz.Provider,{value:e,children:r})),pz=T.createContext(!1),xZ=()=>T.useContext(pz);pz.Provider;function bZ(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var wZ=T.createContext(bZ()),SZ=()=>T.useContext(wZ),EZ=(e,r,s)=>{const o=s?.state.error&&typeof e.throwOnError=="function"?G_(e.throwOnError,[s.state.error,s]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||o)&&(r.isReset()||(e.retryOnMount=!1))},jZ=e=>{T.useEffect(()=>{e.clearReset()},[e])},CZ=({result:e,errorResetBoundary:r,throwOnError:s,query:o,suspense:u})=>e.isError&&!r.isReset()&&!e.isFetching&&o&&(u&&e.data===void 0||G_(s,[e.error,o])),AZ=e=>{if(e.suspense){const s=u=>u==="static"?u:Math.max(u??1e3,1e3),o=e.staleTime;e.staleTime=typeof o=="function"?(...u)=>s(o(...u)):s(o),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},OZ=(e,r)=>e.isLoading&&e.isFetching&&!r,kZ=(e,r)=>e?.suspense&&r.isPending,IM=(e,r,s)=>r.fetchOptimistic(e).catch(()=>{s.clearReset()});function RZ(e,r,s){const o=xZ(),u=SZ(),h=Ms(),m=h.defaultQueryOptions(e);h.getDefaultOptions().queries?._experimental_beforeQuery?.(m);const g=h.getQueryCache().get(m.queryHash);m._optimisticResults=o?"isRestoring":"optimistic",AZ(m),EZ(m,u,g),jZ(u);const b=!h.getQueryCache().get(m.queryHash),[w]=T.useState(()=>new r(h,m)),E=w.getOptimisticResult(m),A=!o&&e.subscribed!==!1;if(T.useSyncExternalStore(T.useCallback(k=>{const R=A?w.subscribe(As.batchCalls(k)):Ui;return w.updateResult(),R},[w,A]),()=>w.getCurrentResult(),()=>w.getCurrentResult()),T.useEffect(()=>{w.setOptions(m)},[m,w]),kZ(m,E))throw IM(m,w,u);if(CZ({result:E,errorResetBoundary:u,throwOnError:m.throwOnError,query:g,suspense:m.suspense}))throw E.error;return h.getDefaultOptions().queries?._experimental_afterQuery?.(m,E),m.experimental_prefetchInRender&&!Rp&&OZ(E,o)&&(b?IM(m,w,u):g?.promise)?.catch(Ui).finally(()=>{w.updateResult()}),m.notifyOnChangeProps?E:w.trackResult(E)}function Un(e,r){return RZ(e,cZ)}function Wt(e,r){const s=Ms(),[o]=T.useState(()=>new mZ(s,e));T.useEffect(()=>{o.setOptions(e)},[o,e]);const u=T.useSyncExternalStore(T.useCallback(m=>o.subscribe(As.batchCalls(m)),[o]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),h=T.useCallback((m,g)=>{o.mutate(m,g).catch(Ui)},[o]);if(u.error&&G_(o.options.throwOnError,[u.error]))throw u.error;return{...u,mutate:h,mutateAsync:u.mutate}}const TZ=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),_Z=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(r,s,o)=>o?o.toUpperCase():s.toLowerCase()),zM=e=>{const r=_Z(e);return r.charAt(0).toUpperCase()+r.slice(1)},fz=(...e)=>e.filter((r,s,o)=>!!r&&r.trim()!==""&&o.indexOf(r)===s).join(" ").trim(),$Z=e=>{for(const r in e)if(r.startsWith("aria-")||r==="role"||r==="title")return!0};var NZ={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 DZ=T.forwardRef(({color:e="currentColor",size:r=24,strokeWidth:s=2,absoluteStrokeWidth:o,className:u="",children:h,iconNode:m,...g},b)=>T.createElement("svg",{ref:b,...NZ,width:r,height:r,stroke:e,strokeWidth:o?Number(s)*24/Number(r):s,className:fz("lucide",u),...!h&&!$Z(g)&&{"aria-hidden":"true"},...g},[...m.map(([w,E])=>T.createElement(w,E)),...Array.isArray(h)?h:[h]]));const ln=(e,r)=>{const s=T.forwardRef(({className:o,...u},h)=>T.createElement(DZ,{ref:h,iconNode:r,className:fz(`lucide-${TZ(zM(e))}`,`lucide-${e}`,o),...u}));return s.displayName=zM(e),s};const PZ=[["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"}]],MZ=ln("boxes",PZ);const IZ=[["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"}]],mz=ln("building-2",IZ);const zZ=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],gz=ln("check",zZ);const LZ=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],yz=ln("chevron-down",LZ);const FZ=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],qZ=ln("chevron-right",FZ);const BZ=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],UZ=ln("chevron-up",BZ);const KZ=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],VZ=ln("chevrons-up-down",KZ);const HZ=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Dj=ln("circle-alert",HZ);const GZ=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],EC=ln("circle-check",GZ);const XZ=[["path",{d:"M22 2 2 22",key:"y4kqgn"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Rg=ln("circle-slash-2",XZ);const YZ=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],ZZ=ln("circle",YZ);const JZ=[["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"}]],WZ=ln("clipboard",JZ);const QZ=[["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"}]],eJ=ln("component",QZ);const tJ=[["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"}]],nJ=ln("download",tJ);const rJ=[["path",{d:"M21.54 15H17a2 2 0 0 0-2 2v4.54",key:"1djwo0"}],["path",{d:"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17",key:"1tzkfa"}],["path",{d:"M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05",key:"14pb5j"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],sJ=ln("earth",rJ);const iJ=[["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"}]],Z_=ln("ellipsis",iJ);const aJ=[["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"}]],oJ=ln("external-link",aJ);const lJ=[["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"}]],LT=ln("eye",lJ);const cJ=[["path",{d:"M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35",key:"1wthlu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 16-3 3 3 3",key:"331omg"}],["path",{d:"m9 22 3-3-3-3",key:"lsp7cz"}]],uJ=ln("file-code-corner",cJ);const dJ=[["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"}]],hJ=ln("file-key",dJ);const pJ=[["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"}]],fJ=ln("git-commit-horizontal",pJ);const mJ=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],vz=ln("info",mJ);const gJ=[["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"}]],yJ=ln("key-round",gJ);const vJ=[["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"}]],KE=ln("link",vJ);const xJ=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],ys=ln("loader-circle",xJ);const bJ=[["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"}]],wJ=ln("lock-keyhole",bJ);const SJ=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],EJ=ln("map-pin",SJ);const jJ=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],CJ=ln("monitor",jJ);const AJ=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],OJ=ln("moon",AJ);const kJ=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],RJ=ln("network",kJ);const TJ=[["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"}]],_J=ln("octagon-x",TJ);const $J=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],NJ=ln("panel-left",$J);const DJ=[["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"}]],uc=ln("pencil",DJ);const PJ=[["path",{d:"m14 13-8.381 8.38a1 1 0 0 1-3.001-3L11 9.999",key:"1lw9ds"}],["path",{d:"M15.973 4.027A13 13 0 0 0 5.902 2.373c-1.398.342-1.092 2.158.277 2.601a19.9 19.9 0 0 1 5.822 3.024",key:"ffj4ej"}],["path",{d:"M16.001 11.999a19.9 19.9 0 0 1 3.024 5.824c.444 1.369 2.26 1.676 2.603.278A13 13 0 0 0 20 8.069",key:"8tj4zw"}],["path",{d:"M18.352 3.352a1.205 1.205 0 0 0-1.704 0l-5.296 5.296a1.205 1.205 0 0 0 0 1.704l2.296 2.296a1.205 1.205 0 0 0 1.704 0l5.296-5.296a1.205 1.205 0 0 0 0-1.704z",key:"hh6h97"}]],MJ=ln("pickaxe",PJ);const IJ=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],qa=ln("plus",IJ);const zJ=[["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"}]],LJ=ln("refresh-cw",zJ);const FJ=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],va=ln("search",FJ);const qJ=[["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"}]],J_=ln("server",qJ);const BJ=[["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"}]],UJ=ln("spray-can",BJ);const KJ=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],VJ=ln("sun",KJ);const HJ=[["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"}]],jC=ln("tags",HJ);const GJ=[["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"}]],wg=ln("trash-2",GJ);const XJ=[["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"}]],Pj=ln("triangle-alert",XJ);const YJ=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],ZJ=ln("user-round",YJ);const JJ=[["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"}]],xz=ln("users",JJ);const WJ=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],LM=ln("wrench",WJ);const QJ=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],W_=ln("x",QJ);function eW(e){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",r.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}const tW=e=>{switch(e){case"success":return sW;case"info":return aW;case"warning":return iW;case"error":return oW;default:return null}},nW=Array(12).fill(0),rW=({visible:e,className:r})=>et.createElement("div",{className:["sonner-loading-wrapper",r].filter(Boolean).join(" "),"data-visible":e},et.createElement("div",{className:"sonner-spinner"},nW.map((s,o)=>et.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${o}`})))),sW=et.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},et.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"})),iW=et.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},et.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"})),aW=et.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},et.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"})),oW=et.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},et.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"})),lW=et.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"},et.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),et.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),cW=()=>{const[e,r]=et.useState(document.hidden);return et.useEffect(()=>{const s=()=>{r(document.hidden)};return document.addEventListener("visibilitychange",s),()=>window.removeEventListener("visibilitychange",s)},[]),e};let FT=1;class uW{constructor(){this.subscribe=r=>(this.subscribers.push(r),()=>{const s=this.subscribers.indexOf(r);this.subscribers.splice(s,1)}),this.publish=r=>{this.subscribers.forEach(s=>s(r))},this.addToast=r=>{this.publish(r),this.toasts=[...this.toasts,r]},this.create=r=>{var s;const{message:o,...u}=r,h=typeof r?.id=="number"||((s=r.id)==null?void 0:s.length)>0?r.id:FT++,m=this.toasts.find(b=>b.id===h),g=r.dismissible===void 0?!0:r.dismissible;return this.dismissedToasts.has(h)&&this.dismissedToasts.delete(h),m?this.toasts=this.toasts.map(b=>b.id===h?(this.publish({...b,...r,id:h,title:o}),{...b,...r,id:h,dismissible:g,title:o}):b):this.addToast({title:o,...u,dismissible:g,id:h}),h},this.dismiss=r=>(r?(this.dismissedToasts.add(r),requestAnimationFrame(()=>this.subscribers.forEach(s=>s({id:r,dismiss:!0})))):this.toasts.forEach(s=>{this.subscribers.forEach(o=>o({id:s.id,dismiss:!0}))}),r),this.message=(r,s)=>this.create({...s,message:r}),this.error=(r,s)=>this.create({...s,message:r,type:"error"}),this.success=(r,s)=>this.create({...s,type:"success",message:r}),this.info=(r,s)=>this.create({...s,type:"info",message:r}),this.warning=(r,s)=>this.create({...s,type:"warning",message:r}),this.loading=(r,s)=>this.create({...s,type:"loading",message:r}),this.promise=(r,s)=>{if(!s)return;let o;s.loading!==void 0&&(o=this.create({...s,promise:r,type:"loading",message:s.loading,description:typeof s.description!="function"?s.description:void 0}));const u=Promise.resolve(r instanceof Function?r():r);let h=o!==void 0,m;const g=u.then(async w=>{if(m=["resolve",w],et.isValidElement(w))h=!1,this.create({id:o,type:"default",message:w});else if(hW(w)&&!w.ok){h=!1;const A=typeof s.error=="function"?await s.error(`HTTP error! status: ${w.status}`):s.error,k=typeof s.description=="function"?await s.description(`HTTP error! status: ${w.status}`):s.description,M=typeof A=="object"&&!et.isValidElement(A)?A:{message:A};this.create({id:o,type:"error",description:k,...M})}else if(w instanceof Error){h=!1;const A=typeof s.error=="function"?await s.error(w):s.error,k=typeof s.description=="function"?await s.description(w):s.description,M=typeof A=="object"&&!et.isValidElement(A)?A:{message:A};this.create({id:o,type:"error",description:k,...M})}else if(s.success!==void 0){h=!1;const A=typeof s.success=="function"?await s.success(w):s.success,k=typeof s.description=="function"?await s.description(w):s.description,M=typeof A=="object"&&!et.isValidElement(A)?A:{message:A};this.create({id:o,type:"success",description:k,...M})}}).catch(async w=>{if(m=["reject",w],s.error!==void 0){h=!1;const E=typeof s.error=="function"?await s.error(w):s.error,A=typeof s.description=="function"?await s.description(w):s.description,R=typeof E=="object"&&!et.isValidElement(E)?E:{message:E};this.create({id:o,type:"error",description:A,...R})}}).finally(()=>{h&&(this.dismiss(o),o=void 0),s.finally==null||s.finally.call(s)}),b=()=>new Promise((w,E)=>g.then(()=>m[0]==="reject"?E(m[1]):w(m[1])).catch(E));return typeof o!="string"&&typeof o!="number"?{unwrap:b}:Object.assign(o,{unwrap:b})},this.custom=(r,s)=>{const o=s?.id||FT++;return this.create({jsx:r(o),id:o,...s}),o},this.getActiveToasts=()=>this.toasts.filter(r=>!this.dismissedToasts.has(r.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const fa=new uW,dW=(e,r)=>{const s=r?.id||FT++;return fa.addToast({title:e,...r,id:s}),s},hW=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",pW=dW,fW=()=>fa.toasts,mW=()=>fa.getActiveToasts(),Ge=Object.assign(pW,{success:fa.success,info:fa.info,warning:fa.warning,error:fa.error,custom:fa.custom,message:fa.message,promise:fa.promise,dismiss:fa.dismiss,loading:fa.loading},{getHistory:fW,getToasts:mW});eW("[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 VE(e){return e.label!==void 0}const gW=3,yW="24px",vW="16px",FM=4e3,xW=356,bW=14,wW=45,SW=200;function tc(...e){return e.filter(Boolean).join(" ")}function EW(e){const[r,s]=e.split("-"),o=[];return r&&o.push(r),s&&o.push(s),o}const jW=e=>{var r,s,o,u,h,m,g,b,w;const{invert:E,toast:A,unstyled:k,interacting:R,setHeights:M,visibleToasts:I,heights:F,index:H,toasts:V,expanded:K,removeToast:z,defaultRichColors:W,closeButton:ae,style:Q,cancelButtonStyle:te,actionButtonStyle:de,className:je="",descriptionClassName:we="",duration:ie,position:Se,gap:Ae,expandByDefault:He,classNames:ue,icons:ne,closeButtonAriaLabel:ce="Close toast"}=e,[$e,me]=et.useState(null),[Xe,Oe]=et.useState(null),[Te,Ke]=et.useState(!1),[se,Ne]=et.useState(!1),[Fe,at]=et.useState(!1),[gt,Ot]=et.useState(!1),[Lt,Rt]=et.useState(!1),[Ft,qe]=et.useState(0),[Bt,kt]=et.useState(0),G=et.useRef(A.duration||ie||FM),On=et.useRef(null),mn=et.useRef(null),Oi=H===0,ge=H+1<=I,Me=A.type,_=A.dismissible!==!1,q=A.className||"",X=A.descriptionClassName||"",oe=et.useMemo(()=>F.findIndex(qt=>qt.toastId===A.id)||0,[F,A.id]),ve=et.useMemo(()=>{var qt;return(qt=A.closeButton)!=null?qt:ae},[A.closeButton,ae]),Re=et.useMemo(()=>A.duration||ie||FM,[A.duration,ie]),Je=et.useRef(0),Tt=et.useRef(0),fe=et.useRef(0),Ut=et.useRef(null),[nn,Gt]=Se.split("-"),ss=et.useMemo(()=>F.reduce((qt,xr,Yr)=>Yr>=oe?qt:qt+xr.height,0),[F,oe]),is=cW(),Yi=A.invert||E,dl=Me==="loading";Tt.current=et.useMemo(()=>oe*Ae+ss,[oe,ss]),et.useEffect(()=>{G.current=Re},[Re]),et.useEffect(()=>{Ke(!0)},[]),et.useEffect(()=>{const qt=mn.current;if(qt){const xr=qt.getBoundingClientRect().height;return kt(xr),M(Yr=>[{toastId:A.id,height:xr,position:A.position},...Yr]),()=>M(Yr=>Yr.filter(Rs=>Rs.toastId!==A.id))}},[M,A.id]),et.useLayoutEffect(()=>{if(!Te)return;const qt=mn.current,xr=qt.style.height;qt.style.height="auto";const Yr=qt.getBoundingClientRect().height;qt.style.height=xr,kt(Yr),M(Rs=>Rs.find(Er=>Er.toastId===A.id)?Rs.map(Er=>Er.toastId===A.id?{...Er,height:Yr}:Er):[{toastId:A.id,height:Yr,position:A.position},...Rs])},[Te,A.title,A.description,M,A.id,A.jsx,A.action,A.cancel]);const ki=et.useCallback(()=>{Ne(!0),qe(Tt.current),M(qt=>qt.filter(xr=>xr.toastId!==A.id)),setTimeout(()=>{z(A)},SW)},[A,z,M,Tt]);et.useEffect(()=>{if(A.promise&&Me==="loading"||A.duration===1/0||A.type==="loading")return;let qt;return K||R||is?(()=>{if(fe.current{A.onAutoClose==null||A.onAutoClose.call(A,A),ki()},G.current)),()=>clearTimeout(qt)},[K,R,A,Me,is,ki]),et.useEffect(()=>{A.delete&&(ki(),A.onDismiss==null||A.onDismiss.call(A,A))},[ki,A.delete]);function pc(){var qt;if(ne?.loading){var xr;return et.createElement("div",{className:tc(ue?.loader,A==null||(xr=A.classNames)==null?void 0:xr.loader,"sonner-loader"),"data-visible":Me==="loading"},ne.loading)}return et.createElement(rW,{className:tc(ue?.loader,A==null||(qt=A.classNames)==null?void 0:qt.loader),visible:Me==="loading"})}const wu=A.icon||ne?.[Me]||tW(Me);var fc,ba;return et.createElement("li",{tabIndex:0,ref:mn,className:tc(je,q,ue?.toast,A==null||(r=A.classNames)==null?void 0:r.toast,ue?.default,ue?.[Me],A==null||(s=A.classNames)==null?void 0:s[Me]),"data-sonner-toast":"","data-rich-colors":(fc=A.richColors)!=null?fc:W,"data-styled":!(A.jsx||A.unstyled||k),"data-mounted":Te,"data-promise":!!A.promise,"data-swiped":Lt,"data-removed":se,"data-visible":ge,"data-y-position":nn,"data-x-position":Gt,"data-index":H,"data-front":Oi,"data-swiping":Fe,"data-dismissible":_,"data-type":Me,"data-invert":Yi,"data-swipe-out":gt,"data-swipe-direction":Xe,"data-expanded":!!(K||He&&Te),"data-testid":A.testId,style:{"--index":H,"--toasts-before":H,"--z-index":V.length-H,"--offset":`${se?Ft:Tt.current}px`,"--initial-height":He?"auto":`${Bt}px`,...Q,...A.style},onDragEnd:()=>{at(!1),me(null),Ut.current=null},onPointerDown:qt=>{qt.button!==2&&(dl||!_||(On.current=new Date,qe(Tt.current),qt.target.setPointerCapture(qt.pointerId),qt.target.tagName!=="BUTTON"&&(at(!0),Ut.current={x:qt.clientX,y:qt.clientY})))},onPointerUp:()=>{var qt,xr,Yr;if(gt||!_)return;Ut.current=null;const Rs=Number(((qt=mn.current)==null?void 0:qt.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Pn=Number(((xr=mn.current)==null?void 0:xr.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Er=new Date().getTime()-((Yr=On.current)==null?void 0:Yr.getTime()),ti=$e==="x"?Rs:Pn,hl=Math.abs(ti)/Er;if(Math.abs(ti)>=wW||hl>.11){qe(Tt.current),A.onDismiss==null||A.onDismiss.call(A,A),Oe($e==="x"?Rs>0?"right":"left":Pn>0?"down":"up"),ki(),Ot(!0);return}else{var xs,ni;(xs=mn.current)==null||xs.style.setProperty("--swipe-amount-x","0px"),(ni=mn.current)==null||ni.style.setProperty("--swipe-amount-y","0px")}Rt(!1),at(!1),me(null)},onPointerMove:qt=>{var xr,Yr,Rs;if(!Ut.current||!_||((xr=window.getSelection())==null?void 0:xr.toString().length)>0)return;const Er=qt.clientY-Ut.current.y,ti=qt.clientX-Ut.current.x;var hl;const xs=(hl=e.swipeDirections)!=null?hl:EW(Se);!$e&&(Math.abs(ti)>1||Math.abs(Er)>1)&&me(Math.abs(ti)>Math.abs(Er)?"x":"y");let ni={x:0,y:0};const Su=wa=>1/(1.5+Math.abs(wa)/20);if($e==="y"){if(xs.includes("top")||xs.includes("bottom"))if(xs.includes("top")&&Er<0||xs.includes("bottom")&&Er>0)ni.y=Er;else{const wa=Er*Su(Er);ni.y=Math.abs(wa)0)ni.x=ti;else{const wa=ti*Su(ti);ni.x=Math.abs(wa)0||Math.abs(ni.y)>0)&&Rt(!0),(Yr=mn.current)==null||Yr.style.setProperty("--swipe-amount-x",`${ni.x}px`),(Rs=mn.current)==null||Rs.style.setProperty("--swipe-amount-y",`${ni.y}px`)}},ve&&!A.jsx&&Me!=="loading"?et.createElement("button",{"aria-label":ce,"data-disabled":dl,"data-close-button":!0,onClick:dl||!_?()=>{}:()=>{ki(),A.onDismiss==null||A.onDismiss.call(A,A)},className:tc(ue?.closeButton,A==null||(o=A.classNames)==null?void 0:o.closeButton)},(ba=ne?.close)!=null?ba:lW):null,(Me||A.icon||A.promise)&&A.icon!==null&&(ne?.[Me]!==null||A.icon)?et.createElement("div",{"data-icon":"",className:tc(ue?.icon,A==null||(u=A.classNames)==null?void 0:u.icon)},A.promise||A.type==="loading"&&!A.icon?A.icon||pc():null,A.type!=="loading"?wu:null):null,et.createElement("div",{"data-content":"",className:tc(ue?.content,A==null||(h=A.classNames)==null?void 0:h.content)},et.createElement("div",{"data-title":"",className:tc(ue?.title,A==null||(m=A.classNames)==null?void 0:m.title)},A.jsx?A.jsx:typeof A.title=="function"?A.title():A.title),A.description?et.createElement("div",{"data-description":"",className:tc(we,X,ue?.description,A==null||(g=A.classNames)==null?void 0:g.description)},typeof A.description=="function"?A.description():A.description):null),et.isValidElement(A.cancel)?A.cancel:A.cancel&&VE(A.cancel)?et.createElement("button",{"data-button":!0,"data-cancel":!0,style:A.cancelButtonStyle||te,onClick:qt=>{VE(A.cancel)&&_&&(A.cancel.onClick==null||A.cancel.onClick.call(A.cancel,qt),ki())},className:tc(ue?.cancelButton,A==null||(b=A.classNames)==null?void 0:b.cancelButton)},A.cancel.label):null,et.isValidElement(A.action)?A.action:A.action&&VE(A.action)?et.createElement("button",{"data-button":!0,"data-action":!0,style:A.actionButtonStyle||de,onClick:qt=>{VE(A.action)&&(A.action.onClick==null||A.action.onClick.call(A.action,qt),!qt.defaultPrevented&&ki())},className:tc(ue?.actionButton,A==null||(w=A.classNames)==null?void 0:w.actionButton)},A.action.label):null)};function qM(){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 CW(e,r){const s={};return[e,r].forEach((o,u)=>{const h=u===1,m=h?"--mobile-offset":"--offset",g=h?vW:yW;function b(w){["top","right","bottom","left"].forEach(E=>{s[`${m}-${E}`]=typeof w=="number"?`${w}px`:w})}typeof o=="number"||typeof o=="string"?b(o):typeof o=="object"?["top","right","bottom","left"].forEach(w=>{o[w]===void 0?s[`${m}-${w}`]=g:s[`${m}-${w}`]=typeof o[w]=="number"?`${o[w]}px`:o[w]}):b(g)}),s}const AW=et.forwardRef(function(r,s){const{id:o,invert:u,position:h="bottom-right",hotkey:m=["altKey","KeyT"],expand:g,closeButton:b,className:w,offset:E,mobileOffset:A,theme:k="light",richColors:R,duration:M,style:I,visibleToasts:F=gW,toastOptions:H,dir:V=qM(),gap:K=bW,icons:z,containerAriaLabel:W="Notifications"}=r,[ae,Q]=et.useState([]),te=et.useMemo(()=>o?ae.filter(Te=>Te.toasterId===o):ae.filter(Te=>!Te.toasterId),[ae,o]),de=et.useMemo(()=>Array.from(new Set([h].concat(te.filter(Te=>Te.position).map(Te=>Te.position)))),[te,h]),[je,we]=et.useState([]),[ie,Se]=et.useState(!1),[Ae,He]=et.useState(!1),[ue,ne]=et.useState(k!=="system"?k:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),ce=et.useRef(null),$e=m.join("+").replace(/Key/g,"").replace(/Digit/g,""),me=et.useRef(null),Xe=et.useRef(!1),Oe=et.useCallback(Te=>{Q(Ke=>{var se;return(se=Ke.find(Ne=>Ne.id===Te.id))!=null&&se.delete||fa.dismiss(Te.id),Ke.filter(({id:Ne})=>Ne!==Te.id)})},[]);return et.useEffect(()=>fa.subscribe(Te=>{if(Te.dismiss){requestAnimationFrame(()=>{Q(Ke=>Ke.map(se=>se.id===Te.id?{...se,delete:!0}:se))});return}setTimeout(()=>{ez.flushSync(()=>{Q(Ke=>{const se=Ke.findIndex(Ne=>Ne.id===Te.id);return se!==-1?[...Ke.slice(0,se),{...Ke[se],...Te},...Ke.slice(se+1)]:[Te,...Ke]})})})}),[ae]),et.useEffect(()=>{if(k!=="system"){ne(k);return}if(k==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?ne("dark"):ne("light")),typeof window>"u")return;const Te=window.matchMedia("(prefers-color-scheme: dark)");try{Te.addEventListener("change",({matches:Ke})=>{ne(Ke?"dark":"light")})}catch{Te.addListener(({matches:se})=>{try{ne(se?"dark":"light")}catch(Ne){console.error(Ne)}})}},[k]),et.useEffect(()=>{ae.length<=1&&Se(!1)},[ae]),et.useEffect(()=>{const Te=Ke=>{var se;if(m.every(at=>Ke[at]||Ke.code===at)){var Fe;Se(!0),(Fe=ce.current)==null||Fe.focus()}Ke.code==="Escape"&&(document.activeElement===ce.current||(se=ce.current)!=null&&se.contains(document.activeElement))&&Se(!1)};return document.addEventListener("keydown",Te),()=>document.removeEventListener("keydown",Te)},[m]),et.useEffect(()=>{if(ce.current)return()=>{me.current&&(me.current.focus({preventScroll:!0}),me.current=null,Xe.current=!1)}},[ce.current]),et.createElement("section",{ref:s,"aria-label":`${W} ${$e}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},de.map((Te,Ke)=>{var se;const[Ne,Fe]=Te.split("-");return te.length?et.createElement("ol",{key:Te,dir:V==="auto"?qM():V,tabIndex:-1,ref:ce,className:w,"data-sonner-toaster":!0,"data-sonner-theme":ue,"data-y-position":Ne,"data-x-position":Fe,style:{"--front-toast-height":`${((se=je[0])==null?void 0:se.height)||0}px`,"--width":`${xW}px`,"--gap":`${K}px`,...I,...CW(E,A)},onBlur:at=>{Xe.current&&!at.currentTarget.contains(at.relatedTarget)&&(Xe.current=!1,me.current&&(me.current.focus({preventScroll:!0}),me.current=null))},onFocus:at=>{at.target instanceof HTMLElement&&at.target.dataset.dismissible==="false"||Xe.current||(Xe.current=!0,me.current=at.relatedTarget)},onMouseEnter:()=>Se(!0),onMouseMove:()=>Se(!0),onMouseLeave:()=>{Ae||Se(!1)},onDragEnd:()=>Se(!1),onPointerDown:at=>{at.target instanceof HTMLElement&&at.target.dataset.dismissible==="false"||He(!0)},onPointerUp:()=>He(!1)},te.filter(at=>!at.position&&Ke===0||at.position===Te).map((at,gt)=>{var Ot,Lt;return et.createElement(jW,{key:at.id,icons:z,index:gt,toast:at,defaultRichColors:R,duration:(Ot=H?.duration)!=null?Ot:M,className:H?.className,descriptionClassName:H?.descriptionClassName,invert:u,visibleToasts:F,closeButton:(Lt=H?.closeButton)!=null?Lt:b,interacting:Ae,position:Te,style:H?.style,unstyled:H?.unstyled,classNames:H?.classNames,cancelButtonStyle:H?.cancelButtonStyle,actionButtonStyle:H?.actionButtonStyle,closeButtonAriaLabel:H?.closeButtonAriaLabel,removeToast:Oe,toasts:te.filter(Rt=>Rt.position==at.position),heights:je.filter(Rt=>Rt.position==at.position),setHeights:we,expandByDefault:g,gap:K,expanded:ie,swipeDirections:r.swipeDirections})})):null}))}),OW=({...e})=>{const{theme:r="system"}=K_();return c.jsx(AW,{theme:r,className:"toaster group",icons:{success:c.jsx(EC,{className:"size-4"}),info:c.jsx(vz,{className:"size-4"}),warning:c.jsx(Pj,{className:"size-4"}),error:c.jsx(_J,{className:"size-4"}),loading:c.jsx(ys,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},...e})},kW=new yZ,RW=({children:e})=>c.jsx(vZ,{client:kW,children:c.jsxs(GY,{defaultTheme:"system",storageKey:"dragon-theme",children:[e,c.jsx(OW,{richColors:!0,expand:!0,position:"top-center"})]})});var zR={exports:{}},lb={},LR={exports:{}},FR={};var BM;function TW(){return BM||(BM=1,(function(e){function r(ue,ne){var ce=ue.length;ue.push(ne);e:for(;0>>1,me=ue[$e];if(0>>1;$eu(Te,ce))Keu(se,Te)?(ue[$e]=se,ue[Ke]=ce,$e=Ke):(ue[$e]=Te,ue[Oe]=ce,$e=Oe);else if(Keu(se,ce))ue[$e]=se,ue[Ke]=ce,$e=Ke;else break e}}return ne}function u(ue,ne){var ce=ue.sortIndex-ne.sortIndex;return ce!==0?ce:ue.id-ne.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var h=performance;e.unstable_now=function(){return h.now()}}else{var m=Date,g=m.now();e.unstable_now=function(){return m.now()-g}}var b=[],w=[],E=1,A=null,k=3,R=!1,M=!1,I=!1,F=!1,H=typeof setTimeout=="function"?setTimeout:null,V=typeof clearTimeout=="function"?clearTimeout:null,K=typeof setImmediate<"u"?setImmediate:null;function z(ue){for(var ne=s(w);ne!==null;){if(ne.callback===null)o(w);else if(ne.startTime<=ue)o(w),ne.sortIndex=ne.expirationTime,r(b,ne);else break;ne=s(w)}}function W(ue){if(I=!1,z(ue),!M)if(s(b)!==null)M=!0,ae||(ae=!0,ie());else{var ne=s(w);ne!==null&&He(W,ne.startTime-ue)}}var ae=!1,Q=-1,te=5,de=-1;function je(){return F?!0:!(e.unstable_now()-deue&&je());){var $e=A.callback;if(typeof $e=="function"){A.callback=null,k=A.priorityLevel;var me=$e(A.expirationTime<=ue);if(ue=e.unstable_now(),typeof me=="function"){A.callback=me,z(ue),ne=!0;break t}A===s(b)&&o(b),z(ue)}else o(b);A=s(b)}if(A!==null)ne=!0;else{var Xe=s(w);Xe!==null&&He(W,Xe.startTime-ue),ne=!1}}break e}finally{A=null,k=ce,R=!1}ne=void 0}}finally{ne?ie():ae=!1}}}var ie;if(typeof K=="function")ie=function(){K(we)};else if(typeof MessageChannel<"u"){var Se=new MessageChannel,Ae=Se.port2;Se.port1.onmessage=we,ie=function(){Ae.postMessage(null)}}else ie=function(){H(we,0)};function He(ue,ne){Q=H(function(){ue(e.unstable_now())},ne)}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(ue){ue.callback=null},e.unstable_forceFrameRate=function(ue){0>ue||125$e?(ue.sortIndex=ce,r(w,ue),s(b)===null&&ue===s(w)&&(I?(V(Q),Q=-1):I=!0,He(W,ce-$e))):(ue.sortIndex=me,r(b,ue),M||R||(M=!0,ae||(ae=!0,ie()))),ue},e.unstable_shouldYield=je,e.unstable_wrapCallback=function(ue){var ne=k;return function(){var ce=k;k=ne;try{return ue.apply(this,arguments)}finally{k=ce}}}})(FR)),FR}var UM;function _W(){return UM||(UM=1,LR.exports=TW()),LR.exports}var KM;function $W(){if(KM)return lb;KM=1;var e=_W(),r=tz(),s=_Y();function o(a){var d="https://react.dev/errors/"+a;if(1me||(a.current=$e[me],$e[me]=null,me--)}function Te(a,d){me++,$e[me]=a.current,a.current=d}var Ke=Xe(null),se=Xe(null),Ne=Xe(null),Fe=Xe(null);function at(a,d){switch(Te(Ne,d),Te(se,a),Te(Ke,null),d.nodeType){case 9:case 11:a=(a=d.documentElement)&&(a=a.namespaceURI)?vd(a):0;break;default:if(a=d.tagName,d=d.namespaceURI)d=vd(d),a=Vh(d,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}Oe(Ke),Te(Ke,a)}function gt(){Oe(Ke),Oe(se),Oe(Ne)}function Ot(a){a.memoizedState!==null&&Te(Fe,a);var d=Ke.current,f=Vh(d,a.type);d!==f&&(Te(se,a),Te(Ke,f))}function Lt(a){se.current===a&&(Oe(Ke),Oe(se)),Fe.current===a&&(Oe(Fe),Sd._currentValue=ce)}var Rt,Ft;function qe(a){if(Rt===void 0)try{throw Error()}catch(f){var d=f.stack.trim().match(/\n( *(at )?)/);Rt=d&&d[1]||"",Ft=-1)":-1j||be[y]!==Ue[j]){var We=` `+be[y].replace(" at new "," at ");return a.displayName&&We.includes("")&&(We=We.replace("",a.displayName)),We}while(1<=y&&0<=j);break}}}finally{Bt=!1,Error.prepareStackTrace=f}return(f=a?a.displayName||a.name:"")?qe(f):""}function G(a,d){switch(a.tag){case 26:case 27:case 5:return qe(a.type);case 16:return qe("Lazy");case 13:return a.child!==d&&d!==null?qe("Suspense Fallback"):qe("Suspense");case 19:return qe("SuspenseList");case 0:case 15:return kt(a.type,!1);case 11:return kt(a.type.render,!1);case 1:return kt(a.type,!0);case 31:return qe("Activity");default:return""}}function On(a){try{var d="",f=null;do d+=G(a,f),f=a,a=a.return;while(a);return d}catch(y){return` Error generating stack: `+y.message+` `+y.stack}}var mn=Object.prototype.hasOwnProperty,Oi=e.unstable_scheduleCallback,ge=e.unstable_cancelCallback,Me=e.unstable_shouldYield,_=e.unstable_requestPaint,q=e.unstable_now,X=e.unstable_getCurrentPriorityLevel,oe=e.unstable_ImmediatePriority,ve=e.unstable_UserBlockingPriority,Re=e.unstable_NormalPriority,Je=e.unstable_LowPriority,Tt=e.unstable_IdlePriority,fe=e.log,Ut=e.unstable_setDisableYieldValue,nn=null,Gt=null;function ss(a){if(typeof fe=="function"&&Ut(a),Gt&&typeof Gt.setStrictMode=="function")try{Gt.setStrictMode(nn,a)}catch{}}var is=Math.clz32?Math.clz32:ki,Yi=Math.log,dl=Math.LN2;function ki(a){return a>>>=0,a===0?32:31-(Yi(a)/dl|0)|0}var pc=256,wu=262144,fc=4194304;function ba(a){var d=a&42;if(d!==0)return d;switch(a&-a){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 a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function qt(a,d,f){var y=a.pendingLanes;if(y===0)return 0;var j=0,O=a.suspendedLanes,B=a.pingedLanes;a=a.warmLanes;var ee=y&134217727;return ee!==0?(y=ee&~O,y!==0?j=ba(y):(B&=ee,B!==0?j=ba(B):f||(f=ee&~a,f!==0&&(j=ba(f))))):(ee=y&~O,ee!==0?j=ba(ee):B!==0?j=ba(B):f||(f=y&~a,f!==0&&(j=ba(f)))),j===0?0:d!==0&&d!==j&&(d&O)===0&&(O=j&-j,f=d&-d,O>=f||O===32&&(f&4194048)!==0)?d:j}function xr(a,d){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&d)===0}function Yr(a,d){switch(a){case 1:case 2:case 4:case 8:case 64:return d+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 d+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 Rs(){var a=fc;return fc<<=1,(fc&62914560)===0&&(fc=4194304),a}function Pn(a){for(var d=[],f=0;31>f;f++)d.push(a);return d}function Er(a,d){a.pendingLanes|=d,d!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function ti(a,d,f,y,j,O){var B=a.pendingLanes;a.pendingLanes=f,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=f,a.entangledLanes&=f,a.errorRecoveryDisabledLanes&=f,a.shellSuspendCounter=0;var ee=a.entanglements,be=a.expirationTimes,Ue=a.hiddenUpdates;for(f=B&~f;0"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var ih=/[\n"\\]/g;function si(a){return a.replace(ih,function(d){return"\\"+d.charCodeAt(0).toString(16)+" "})}function qp(a,d,f,y,j,O,B,ee){a.name="",B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"?a.type=B:a.removeAttribute("type"),d!=null?B==="number"?(d===0&&a.value===""||a.value!=d)&&(a.value=""+ri(d)):a.value!==""+ri(d)&&(a.value=""+ri(d)):B!=="submit"&&B!=="reset"||a.removeAttribute("value"),d!=null?Bp(a,B,ri(d)):f!=null?Bp(a,B,ri(f)):y!=null&&a.removeAttribute("value"),j==null&&O!=null&&(a.defaultChecked=!!O),j!=null&&(a.checked=j&&typeof j!="function"&&typeof j!="symbol"),ee!=null&&typeof ee!="function"&&typeof ee!="symbol"&&typeof ee!="boolean"?a.name=""+ri(ee):a.removeAttribute("name")}function Hg(a,d,f,y,j,O,B,ee){if(O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"&&(a.type=O),d!=null||f!=null){if(!(O!=="submit"&&O!=="reset"||d!=null)){mo(a);return}f=f!=null?""+ri(f):"",d=d!=null?""+ri(d):f,ee||d===a.value||(a.value=d),a.defaultValue=d}y=y??j,y=typeof y!="function"&&typeof y!="symbol"&&!!y,a.checked=ee?a.checked:!!y,a.defaultChecked=!!y,B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"&&(a.name=B),mo(a)}function Bp(a,d,f){d==="number"&&gl(a.ownerDocument)===a||a.defaultValue===""+f||(a.defaultValue=""+f)}function ku(a,d,f,y){if(a=a.options,d){d={};for(var j=0;j"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vp=!1;if(ar)try{var go={};Object.defineProperty(go,"passive",{get:function(){Vp=!0}}),window.addEventListener("test",go,go),window.removeEventListener("test",go,go)}catch{Vp=!1}var Rr=null,lh=null,$u=null;function Tw(){if($u)return $u;var a,d=lh,f=d.length,y,j="value"in Rr?Rr.value:Rr.textContent,O=j.length;for(a=0;a=Ca),Xw=" ",ty=!1;function Yw(a,d){switch(a){case"keyup":return Gw.indexOf(d.keyCode)!==-1;case"keydown":return d.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ny(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var wc=!1;function Pu(a,d){switch(a){case"compositionend":return ny(d);case"keypress":return d.which!==32?null:(ty=!0,Xw);case"textInput":return a=d.data,a===Xw&&ty?null:a;default:return null}}function vA(a,d){if(wc)return a==="compositionend"||!Wi&&Yw(a,d)?(a=Tw(),$u=lh=Rr=null,wc=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(d.ctrlKey||d.altKey||d.metaKey)||d.ctrlKey&&d.altKey){if(d.char&&1=d)return{node:f,offset:d-a};a=y}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=t0(f)}}function r0(a,d){return a&&d?a===d?!0:a&&a.nodeType===3?!1:d&&d.nodeType===3?r0(a,d.parentNode):"contains"in a?a.contains(d):a.compareDocumentPosition?!!(a.compareDocumentPosition(d)&16):!1:!1}function s0(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var d=gl(a.document);d instanceof a.HTMLIFrameElement;){try{var f=typeof d.contentWindow.location.href=="string"}catch{f=!1}if(f)a=d.contentWindow;else break;d=gl(a.document)}return d}function sy(a){var d=a&&a.nodeName&&a.nodeName.toLowerCase();return d&&(d==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||d==="textarea"||a.contentEditable==="true")}var i0=ar&&"documentMode"in document&&11>=document.documentMode,vl=null,Fu=null,xo=null,Jp=!1;function iy(a,d,f){var y=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;Jp||vl==null||vl!==gl(y)||(y=vl,"selectionStart"in y&&sy(y)?y={start:y.selectionStart,end:y.selectionEnd}:(y=(y.ownerDocument&&y.ownerDocument.defaultView||window).getSelection(),y={anchorNode:y.anchorNode,anchorOffset:y.anchorOffset,focusNode:y.focusNode,focusOffset:y.focusOffset}),xo&&Lu(xo,y)||(xo=y,y=Wf(Fu,"onSelect"),0>=B,j-=B,Kn=1<<32-is(d)+j|f<an?(En=Mt,Mt=null):En=Mt.sibling;var Rn=Ve(De,Mt,Ie[an],nt);if(Rn===null){Mt===null&&(Mt=En);break}a&&Mt&&Rn.alternate===null&&d(De,Mt),Ce=O(Rn,Ce,an),vn===null?Ht=Rn:vn.sibling=Rn,vn=Rn,Mt=En}if(an===Ie.length)return f(De,Mt),xn&&di(De,an),Ht;if(Mt===null){for(;anan?(En=Mt,Mt=null):En=Mt.sibling;var Hl=Ve(De,Mt,Rn.value,nt);if(Hl===null){Mt===null&&(Mt=En);break}a&&Mt&&Hl.alternate===null&&d(De,Mt),Ce=O(Hl,Ce,an),vn===null?Ht=Hl:vn.sibling=Hl,vn=Hl,Mt=En}if(Rn.done)return f(De,Mt),xn&&di(De,an),Ht;if(Mt===null){for(;!Rn.done;an++,Rn=Ie.next())Rn=rt(De,Rn.value,nt),Rn!==null&&(Ce=O(Rn,Ce,an),vn===null?Ht=Rn:vn.sibling=Rn,vn=Rn);return xn&&di(De,an),Ht}for(Mt=y(Mt);!Rn.done;an++,Rn=Ie.next())Rn=Ye(Mt,De,an,Rn.value,nt),Rn!==null&&(a&&Rn.alternate!==null&&Mt.delete(Rn.key===null?an:Rn.key),Ce=O(Rn,Ce,an),vn===null?Ht=Rn:vn.sibling=Rn,vn=Rn);return a&&Mt.forEach(function(WS){return d(De,WS)}),xn&&di(De,an),Ht}function Qn(De,Ce,Ie,nt){if(typeof Ie=="object"&&Ie!==null&&Ie.type===I&&Ie.key===null&&(Ie=Ie.props.children),typeof Ie=="object"&&Ie!==null){switch(Ie.$$typeof){case R:e:{for(var Ht=Ie.key;Ce!==null;){if(Ce.key===Ht){if(Ht=Ie.type,Ht===I){if(Ce.tag===7){f(De,Ce.sibling),nt=j(Ce,Ie.props.children),nt.return=De,De=nt;break e}}else if(Ce.elementType===Ht||typeof Ht=="object"&&Ht!==null&&Ht.$$typeof===te&&$c(Ht)===Ce.type){f(De,Ce.sibling),nt=j(Ce,Ie.props),Ts(nt,Ie),nt.return=De,De=nt;break e}f(De,Ce);break}else d(De,Ce);Ce=Ce.sibling}Ie.type===I?(nt=bl(Ie.props.children,De.mode,nt,Ie.key),nt.return=De,De=nt):(nt=Ku(Ie.type,Ie.key,Ie.props,null,De.mode,nt),Ts(nt,Ie),nt.return=De,De=nt)}return B(De);case M:e:{for(Ht=Ie.key;Ce!==null;){if(Ce.key===Ht)if(Ce.tag===4&&Ce.stateNode.containerInfo===Ie.containerInfo&&Ce.stateNode.implementation===Ie.implementation){f(De,Ce.sibling),nt=j(Ce,Ie.children||[]),nt.return=De,De=nt;break e}else{f(De,Ce);break}else d(De,Ce);Ce=Ce.sibling}nt=gy(Ie,De.mode,nt),nt.return=De,De=nt}return B(De);case te:return Ie=$c(Ie),Qn(De,Ce,Ie,nt)}if(He(Ie))return Pt(De,Ce,Ie,nt);if(ie(Ie)){if(Ht=ie(Ie),typeof Ht!="function")throw Error(o(150));return Ie=Ht.call(Ie),Zt(De,Ce,Ie,nt)}if(typeof Ie.then=="function")return Qn(De,Ce,Qu(Ie),nt);if(Ie.$$typeof===K)return Qn(De,Ce,Xu(De,Ie),nt);ed(De,Ie)}return typeof Ie=="string"&&Ie!==""||typeof Ie=="number"||typeof Ie=="bigint"?(Ie=""+Ie,Ce!==null&&Ce.tag===6?(f(De,Ce.sibling),nt=j(Ce,Ie),nt.return=De,De=nt):(f(De,Ce),nt=Vu(Ie,De.mode,nt),nt.return=De,De=nt),B(De)):f(De,Ce)}return function(De,Ce,Ie,nt){try{Dc=0;var Ht=Qn(De,Ce,Ie,nt);return Wu=null,Ht}catch(Mt){if(Mt===_c||Mt===Ju)throw Mt;var vn=oi(29,Mt,null,De.mode);return vn.lanes=nt,vn.return=De,vn}}}var Pc=Co(!0),gh=Co(!1),fi=!1;function ff(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function mf(a,d){a=a.updateQueue,d.updateQueue===a&&(d.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function Ao(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function kl(a,d,f){var y=a.updateQueue;if(y===null)return null;if(y=y.shared,(Hn&2)!==0){var j=y.pending;return j===null?d.next=d:(d.next=j.next,j.next=d),y.pending=d,d=tf(a),o0(a,null,f),d}return ef(a,y,d,f),tf(a)}function ra(a,d,f){if(d=d.updateQueue,d!==null&&(d=d.shared,(f&4194048)!==0)){var y=d.lanes;y&=a.pendingLanes,f|=y,d.lanes=f,xs(a,f)}}function td(a,d){var f=a.updateQueue,y=a.alternate;if(y!==null&&(y=y.updateQueue,f===y)){var j=null,O=null;if(f=f.firstBaseUpdate,f!==null){do{var B={lane:f.lane,tag:f.tag,payload:f.payload,callback:null,next:null};O===null?j=O=B:O=O.next=B,f=f.next}while(f!==null);O===null?j=O=d:O=O.next=d}else j=O=d;f={baseState:y.baseState,firstBaseUpdate:j,lastBaseUpdate:O,shared:y.shared,callbacks:y.callbacks},a.updateQueue=f;return}a=f.lastBaseUpdate,a===null?f.firstBaseUpdate=d:a.next=d,f.lastBaseUpdate=d}var Mc=!1;function yh(){if(Mc){var a=Ha;if(a!==null)throw a}}function vh(a,d,f,y){Mc=!1;var j=a.updateQueue;fi=!1;var O=j.firstBaseUpdate,B=j.lastBaseUpdate,ee=j.shared.pending;if(ee!==null){j.shared.pending=null;var be=ee,Ue=be.next;be.next=null,B===null?O=Ue:B.next=Ue,B=be;var We=a.alternate;We!==null&&(We=We.updateQueue,ee=We.lastBaseUpdate,ee!==B&&(ee===null?We.firstBaseUpdate=Ue:ee.next=Ue,We.lastBaseUpdate=be))}if(O!==null){var rt=j.baseState;B=0,We=Ue=be=null,ee=O;do{var Ve=ee.lane&-536870913,Ye=Ve!==ee.lane;if(Ye?(kn&Ve)===Ve:(y&Ve)===Ve){Ve!==0&&Ve===Al&&(Mc=!0),We!==null&&(We=We.next={lane:0,tag:ee.tag,payload:ee.payload,callback:null,next:null});e:{var Pt=a,Zt=ee;Ve=d;var Qn=f;switch(Zt.tag){case 1:if(Pt=Zt.payload,typeof Pt=="function"){rt=Pt.call(Qn,rt,Ve);break e}rt=Pt;break e;case 3:Pt.flags=Pt.flags&-65537|128;case 0:if(Pt=Zt.payload,Ve=typeof Pt=="function"?Pt.call(Qn,rt,Ve):Pt,Ve==null)break e;rt=A({},rt,Ve);break e;case 2:fi=!0}}Ve=ee.callback,Ve!==null&&(a.flags|=64,Ye&&(a.flags|=8192),Ye=j.callbacks,Ye===null?j.callbacks=[Ve]:Ye.push(Ve))}else Ye={lane:Ve,tag:ee.tag,payload:ee.payload,callback:ee.callback,next:null},We===null?(Ue=We=Ye,be=rt):We=We.next=Ye,B|=Ve;if(ee=ee.next,ee===null){if(ee=j.shared.pending,ee===null)break;Ye=ee,ee=Ye.next,Ye.next=null,j.lastBaseUpdate=Ye,j.shared.pending=null}}while(!0);We===null&&(be=rt),j.baseState=be,j.firstBaseUpdate=Ue,j.lastBaseUpdate=We,O===null&&(j.shared.lanes=0),Wa|=B,a.lanes=B,a.memoizedState=rt}}function gf(a,d){if(typeof a!="function")throw Error(o(191,a));a.call(d)}function p0(a,d){var f=a.callbacks;if(f!==null)for(a.callbacks=null,a=0;aO?O:8;var B=ue.T,ee={};ue.T=ee,ev(a,!1,d,f);try{var be=j(),Ue=ue.S;if(Ue!==null&&Ue(ee,be),be!==null&&typeof be=="object"&&typeof be.then=="function"){var We=lf(be,y);Ch(a,d,We,Pi(a))}else Ch(a,d,y,Pi(a))}catch(rt){Ch(a,d,{then:function(){},status:"rejected",reason:rt},Pi())}finally{ne.p=O,B!==null&&ee.types!==null&&(B.types=ee.types),ue.T=B}}function AA(){}function Zy(a,d,f,y){if(a.tag!==5)throw Error(o(476));var j=Jy(a).queue;O0(a,j,d,ce,f===null?AA:function(){return Wy(a),f(y)})}function Jy(a){var d=a.memoizedState;if(d!==null)return d;d={memoizedState:ce,baseState:ce,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:aa,lastRenderedState:ce},next:null};var f={};return d.next={memoizedState:f,baseState:f,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:aa,lastRenderedState:f},next:null},a.memoizedState=d,a=a.alternate,a!==null&&(a.memoizedState=d),d}function Wy(a){var d=Jy(a);d.next===null&&(d=a.alternate.memoizedState),Ch(a,d.next.queue,{},Pi())}function jh(){return Jr(Sd)}function k0(){return Ir().memoizedState}function Qy(){return Ir().memoizedState}function OA(a){for(var d=a.return;d!==null;){switch(d.tag){case 24:case 3:var f=Pi();a=Ao(f);var y=kl(d,a,f);y!==null&&(Ns(y,d,f),ra(y,d,f)),d={cache:of()},a.payload=d;return}d=d.return}}function R0(a,d,f){var y=Pi();f={lane:y,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},Sf(a)?_0(d,f):(f=fy(a,d,f,y),f!==null&&(Ns(f,a,y),$0(f,d,y)))}function T0(a,d,f){var y=Pi();Ch(a,d,f,y)}function Ch(a,d,f,y){var j={lane:y,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null};if(Sf(a))_0(d,j);else{var O=a.alternate;if(a.lanes===0&&(O===null||O.lanes===0)&&(O=d.lastRenderedReducer,O!==null))try{var B=d.lastRenderedState,ee=O(B,f);if(j.hasEagerState=!0,j.eagerState=ee,ai(ee,B))return ef(a,d,j,0),lr===null&&Qp(),!1}catch{}if(f=fy(a,d,j,y),f!==null)return Ns(f,a,y),$0(f,d,y),!0}return!1}function ev(a,d,f,y){if(y={lane:2,revertLane:zv(),gesture:null,action:y,hasEagerState:!1,eagerState:null,next:null},Sf(a)){if(d)throw Error(o(479))}else d=fy(a,f,y,2),d!==null&&Ns(d,a,2)}function Sf(a){var d=a.alternate;return a===rn||d!==null&&d===rn}function _0(a,d){Ic=xh=!0;var f=a.pending;f===null?d.next=d:(d.next=f.next,f.next=d),a.pending=d}function $0(a,d,f){if((f&4194048)!==0){var y=d.lanes;y&=a.pendingLanes,f|=y,d.lanes=f,xs(a,f)}}var Ah={readContext:Jr,use:vf,useCallback:Cr,useContext:Cr,useEffect:Cr,useImperativeHandle:Cr,useLayoutEffect:Cr,useInsertionEffect:Cr,useMemo:Cr,useReducer:Cr,useRef:Cr,useState:Cr,useDebugValue:Cr,useDeferredValue:Cr,useTransition:Cr,useSyncExternalStore:Cr,useId:Cr,useHostTransitionStatus:Cr,useFormState:Cr,useActionState:Cr,useOptimistic:Cr,useMemoCache:Cr,useCacheRefresh:Cr};Ah.useEffectEvent=Cr;var N0={readContext:Jr,use:vf,useCallback:function(a,d){return _s().memoizedState=[a,d===void 0?null:d],a},useContext:Jr,useEffect:Ky,useImperativeHandle:function(a,d,f){f=f!=null?f.concat([a]):null,Eh(4194308,4,C0.bind(null,d,a),f)},useLayoutEffect:function(a,d){return Eh(4194308,4,a,d)},useInsertionEffect:function(a,d){Eh(4,2,a,d)},useMemo:function(a,d){var f=_s();d=d===void 0?null:d;var y=a();if(Oo){ss(!0);try{a()}finally{ss(!1)}}return f.memoizedState=[y,d],y},useReducer:function(a,d,f){var y=_s();if(f!==void 0){var j=f(d);if(Oo){ss(!0);try{f(d)}finally{ss(!1)}}}else j=d;return y.memoizedState=y.baseState=j,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:j},y.queue=a,a=a.dispatch=R0.bind(null,rn,a),[y.memoizedState,a]},useRef:function(a){var d=_s();return a={current:a},d.memoizedState=a},useState:function(a){a=zy(a);var d=a.queue,f=T0.bind(null,rn,d);return d.dispatch=f,[a.memoizedState,f]},useDebugValue:Hy,useDeferredValue:function(a,d){var f=_s();return Yy(f,a,d)},useTransition:function(){var a=zy(!1);return a=O0.bind(null,rn,a.queue,!0,!1),_s().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,d,f){var y=rn,j=_s();if(xn){if(f===void 0)throw Error(o(407));f=f()}else{if(f=d(),lr===null)throw Error(o(349));(kn&127)!==0||Dy(y,d,f)}j.memoizedState=f;var O={value:f,getSnapshot:d};return j.queue=O,Ky(g0.bind(null,y,O,a),[a]),y.flags|=2048,od(9,{destroy:void 0},Py.bind(null,y,O,f,d),null),f},useId:function(){var a=_s(),d=lr.identifierPrefix;if(xn){var f=Ua,y=Kn;f=(y&~(1<<32-is(y)-1)).toString(32)+f,d="_"+d+"R_"+f,f=bh++,0<\/script>",O=O.removeChild(O.firstChild);break;case"select":O=typeof y.is=="string"?B.createElement("select",{is:y.is}):B.createElement("select"),y.multiple?O.multiple=!0:y.size&&(O.size=y.size);break;default:O=typeof y.is=="string"?B.createElement(j,{is:y.is}):B.createElement(j)}}O[as]=d,O[zs]=y;e:for(B=d.child;B!==null;){if(B.tag===5||B.tag===6)O.appendChild(B.stateNode);else if(B.tag!==4&&B.tag!==27&&B.child!==null){B.child.return=B,B=B.child;continue}if(B===d)break e;for(;B.sibling===null;){if(B.return===null||B.return===d)break e;B=B.return}B.sibling.return=B.return,B=B.sibling}d.stateNode=O;e:switch(ws(O,j,y),j){case"button":case"input":case"select":case"textarea":y=!!y.autoFocus;break e;case"img":y=!0;break e;default:y=!1}y&&To(d)}}return or(d),fv(d,d.type,a===null?null:a.memoizedProps,d.pendingProps,f),null;case 6:if(a&&d.stateNode!=null)a.memoizedProps!==y&&To(d);else{if(typeof y!="string"&&d.stateNode===null)throw Error(o(166));if(a=Ne.current,Gu(d)){if(a=d.stateNode,f=d.memoizedProps,y=null,j=qr,j!==null)switch(j.tag){case 27:case 5:y=j.memoizedProps}a[as]=d,a=!!(a.nodeValue===f||y!==null&&y.suppressHydrationWarning===!0||Uh(a.nodeValue,f)),a||El(d,!0)}else a=Vc(a).createTextNode(y),a[as]=d,d.stateNode=a}return or(d),null;case 31:if(f=d.memoizedState,a===null||a.memoizedState!==null){if(y=Gu(d),f!==null){if(a===null){if(!y)throw Error(o(318));if(a=d.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(o(557));a[as]=d}else Ka(),(d.flags&128)===0&&(d.memoizedState=null),d.flags|=4;or(d),a=!1}else f=vy(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=f),a=!0;if(!a)return d.flags&256?(Fs(d),d):(Fs(d),null);if((d.flags&128)!==0)throw Error(o(558))}return or(d),null;case 13:if(y=d.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(j=Gu(d),y!==null&&y.dehydrated!==null){if(a===null){if(!j)throw Error(o(318));if(j=d.memoizedState,j=j!==null?j.dehydrated:null,!j)throw Error(o(317));j[as]=d}else Ka(),(d.flags&128)===0&&(d.memoizedState=null),d.flags|=4;or(d),j=!1}else j=vy(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=j),j=!0;if(!j)return d.flags&256?(Fs(d),d):(Fs(d),null)}return Fs(d),(d.flags&128)!==0?(d.lanes=f,d):(f=y!==null,a=a!==null&&a.memoizedState!==null,f&&(y=d.child,j=null,y.alternate!==null&&y.alternate.memoizedState!==null&&y.alternate.memoizedState.cachePool!==null&&(j=y.alternate.memoizedState.cachePool.pool),O=null,y.memoizedState!==null&&y.memoizedState.cachePool!==null&&(O=y.memoizedState.cachePool.pool),O!==j&&(y.flags|=2048)),f!==a&&f&&(d.child.flags|=8192),Tf(d,d.updateQueue),or(d),null);case 4:return gt(),a===null&&Jf(d.stateNode.containerInfo),or(d),null;case 10:return pi(d.type),or(d),null;case 19:if(Oe(jr),y=d.memoizedState,y===null)return or(d),null;if(j=(d.flags&128)!==0,O=y.rendering,O===null)if(j)ud(y,!1);else{if(Ar!==0||a!==null&&(a.flags&128)!==0)for(a=d.child;a!==null;){if(O=yf(a),O!==null){for(d.flags|=128,ud(y,!1),a=O.updateQueue,d.updateQueue=a,Tf(d,a),d.subtreeFlags=0,a=f,f=d.child;f!==null;)my(f,a),f=f.sibling;return Te(jr,jr.current&1|2),xn&&di(d,y.treeForkCount),d.child}a=a.sibling}y.tail!==null&&q()>If&&(d.flags|=128,j=!0,ud(y,!1),d.lanes=4194304)}else{if(!j)if(a=yf(O),a!==null){if(d.flags|=128,j=!0,a=a.updateQueue,d.updateQueue=a,Tf(d,a),ud(y,!0),y.tail===null&&y.tailMode==="hidden"&&!O.alternate&&!xn)return or(d),null}else 2*q()-y.renderingStartTime>If&&f!==536870912&&(d.flags|=128,j=!0,ud(y,!1),d.lanes=4194304);y.isBackwards?(O.sibling=d.child,d.child=O):(a=y.last,a!==null?a.sibling=O:d.child=O,y.last=O)}return y.tail!==null?(a=y.tail,y.rendering=a,y.tail=a.sibling,y.renderingStartTime=q(),a.sibling=null,f=jr.current,Te(jr,j?f&1|2:f&1),xn&&di(d,y.treeForkCount),a):(or(d),null);case 22:case 23:return Fs(d),sd(),y=d.memoizedState!==null,a!==null?a.memoizedState!==null!==y&&(d.flags|=8192):y&&(d.flags|=8192),y?(f&536870912)!==0&&(d.flags&128)===0&&(or(d),d.subtreeFlags&6&&(d.flags|=8192)):or(d),f=d.updateQueue,f!==null&&Tf(d,f.retryQueue),f=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(f=a.memoizedState.cachePool.pool),y=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(y=d.memoizedState.cachePool.pool),y!==f&&(d.flags|=2048),a!==null&&Oe(Ol),null;case 24:return f=null,a!==null&&(f=a.memoizedState.cache),d.memoizedState.cache!==f&&(d.flags|=2048),pi(Pr),or(d),null;case 25:return null;case 30:return null}throw Error(o(156,d.tag))}function mv(a,d){switch(So(d),d.tag){case 1:return a=d.flags,a&65536?(d.flags=a&-65537|128,d):null;case 3:return pi(Pr),gt(),a=d.flags,(a&65536)!==0&&(a&128)===0?(d.flags=a&-65537|128,d):null;case 26:case 27:case 5:return Lt(d),null;case 31:if(d.memoizedState!==null){if(Fs(d),d.alternate===null)throw Error(o(340));Ka()}return a=d.flags,a&65536?(d.flags=a&-65537|128,d):null;case 13:if(Fs(d),a=d.memoizedState,a!==null&&a.dehydrated!==null){if(d.alternate===null)throw Error(o(340));Ka()}return a=d.flags,a&65536?(d.flags=a&-65537|128,d):null;case 19:return Oe(jr),null;case 4:return gt(),null;case 10:return pi(d.type),null;case 22:case 23:return Fs(d),sd(),a!==null&&Oe(Ol),a=d.flags,a&65536?(d.flags=a&-65537|128,d):null;case 24:return pi(Pr),null;case 25:return null;default:return null}}function X0(a,d){switch(So(d),d.tag){case 3:pi(Pr),gt();break;case 26:case 27:case 5:Lt(d);break;case 4:gt();break;case 31:d.memoizedState!==null&&Fs(d);break;case 13:Fs(d);break;case 19:Oe(jr);break;case 10:pi(d.type);break;case 22:case 23:Fs(d),sd(),a!==null&&Oe(Ol);break;case 24:pi(Pr)}}function kh(a,d){try{var f=d.updateQueue,y=f!==null?f.lastEffect:null;if(y!==null){var j=y.next;f=j;do{if((f.tag&a)===a){y=void 0;var O=f.create,B=f.inst;y=O(),B.destroy=y}f=f.next}while(f!==j)}}catch(ee){Xn(d,d.return,ee)}}function Dl(a,d,f){try{var y=d.updateQueue,j=y!==null?y.lastEffect:null;if(j!==null){var O=j.next;y=O;do{if((y.tag&a)===a){var B=y.inst,ee=B.destroy;if(ee!==void 0){B.destroy=void 0,j=d;var be=f,Ue=ee;try{Ue()}catch(We){Xn(j,be,We)}}}y=y.next}while(y!==O)}}catch(We){Xn(d,d.return,We)}}function Y0(a){var d=a.updateQueue;if(d!==null){var f=a.stateNode;try{p0(d,f)}catch(y){Xn(a,a.return,y)}}}function Z0(a,d,f){f.props=Fc(a.type,a.memoizedProps),f.state=a.memoizedState;try{f.componentWillUnmount()}catch(y){Xn(a,d,y)}}function Rh(a,d){try{var f=a.ref;if(f!==null){switch(a.tag){case 26:case 27:case 5:var y=a.stateNode;break;case 30:y=a.stateNode;break;default:y=a.stateNode}typeof f=="function"?a.refCleanup=f(y):f.current=y}}catch(j){Xn(a,d,j)}}function Ja(a,d){var f=a.ref,y=a.refCleanup;if(f!==null)if(typeof y=="function")try{y()}catch(j){Xn(a,d,j)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof f=="function")try{f(null)}catch(j){Xn(a,d,j)}else f.current=null}function J0(a){var d=a.type,f=a.memoizedProps,y=a.stateNode;try{e:switch(d){case"button":case"input":case"select":case"textarea":f.autoFocus&&y.focus();break e;case"img":f.src?y.src=f.src:f.srcSet&&(y.srcset=f.srcSet)}}catch(j){Xn(a,a.return,j)}}function Th(a,d,f){try{var y=a.stateNode;qA(y,a.type,f,d),y[zs]=d}catch(j){Xn(a,a.return,j)}}function gv(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&ql(a.type)||a.tag===4}function yv(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||gv(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&ql(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function vv(a,d,f){var y=a.tag;if(y===5||y===6)a=a.stateNode,d?(f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f).insertBefore(a,d):(d=f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f,d.appendChild(a),f=f._reactRootContainer,f!=null||d.onclick!==null||(d.onclick=ja));else if(y!==4&&(y===27&&ql(a.type)&&(f=a.stateNode,d=null),a=a.child,a!==null))for(vv(a,d,f),a=a.sibling;a!==null;)vv(a,d,f),a=a.sibling}function _f(a,d,f){var y=a.tag;if(y===5||y===6)a=a.stateNode,d?f.insertBefore(a,d):f.appendChild(a);else if(y!==4&&(y===27&&ql(a.type)&&(f=a.stateNode),a=a.child,a!==null))for(_f(a,d,f),a=a.sibling;a!==null;)_f(a,d,f),a=a.sibling}function $f(a){var d=a.stateNode,f=a.memoizedProps;try{for(var y=a.type,j=d.attributes;j.length;)d.removeAttributeNode(j[0]);ws(d,y,f),d[as]=a,d[zs]=f}catch(O){Xn(a,a.return,O)}}var _o=!1,Ur=!1,xv=!1,W0=typeof WeakSet=="function"?WeakSet:Set,us=null;function Q0(a,d){if(a=a.containerInfo,Qf=dm,a=s0(a),sy(a)){if("selectionStart"in a)var f={start:a.selectionStart,end:a.selectionEnd};else e:{f=(f=a.ownerDocument)&&f.defaultView||window;var y=f.getSelection&&f.getSelection();if(y&&y.rangeCount!==0){f=y.anchorNode;var j=y.anchorOffset,O=y.focusNode;y=y.focusOffset;try{f.nodeType,O.nodeType}catch{f=null;break e}var B=0,ee=-1,be=-1,Ue=0,We=0,rt=a,Ve=null;t:for(;;){for(var Ye;rt!==f||j!==0&&rt.nodeType!==3||(ee=B+j),rt!==O||y!==0&&rt.nodeType!==3||(be=B+y),rt.nodeType===3&&(B+=rt.nodeValue.length),(Ye=rt.firstChild)!==null;)Ve=rt,rt=Ye;for(;;){if(rt===a)break t;if(Ve===f&&++Ue===j&&(ee=B),Ve===O&&++We===y&&(be=B),(Ye=rt.nextSibling)!==null)break;rt=Ve,Ve=rt.parentNode}rt=Ye}f=ee===-1||be===-1?null:{start:ee,end:be}}else f=null}f=f||{start:0,end:0}}else f=null;for(em={focusedElem:a,selectionRange:f},dm=!1,us=d;us!==null;)if(d=us,a=d.child,(d.subtreeFlags&1028)!==0&&a!==null)a.return=d,us=a;else for(;us!==null;){switch(d=us,O=d.alternate,a=d.flags,d.tag){case 0:if((a&4)!==0&&(a=d.updateQueue,a=a!==null?a.events:null,a!==null))for(f=0;f title"))),ws(O,y,f),O[as]=a,Zr(O),y=O;break e;case"link":var B=BS("link","href",j).get(y+(f.href||""));if(B){for(var ee=0;eeQn&&(B=Qn,Qn=Zt,Zt=B);var De=n0(ee,Zt),Ce=n0(ee,Qn);if(De&&Ce&&(Ye.rangeCount!==1||Ye.anchorNode!==De.node||Ye.anchorOffset!==De.offset||Ye.focusNode!==Ce.node||Ye.focusOffset!==Ce.offset)){var Ie=rt.createRange();Ie.setStart(De.node,De.offset),Ye.removeAllRanges(),Zt>Qn?(Ye.addRange(Ie),Ye.extend(Ce.node,Ce.offset)):(Ie.setEnd(Ce.node,Ce.offset),Ye.addRange(Ie))}}}}for(rt=[],Ye=ee;Ye=Ye.parentNode;)Ye.nodeType===1&&rt.push({element:Ye,left:Ye.scrollLeft,top:Ye.scrollTop});for(typeof ee.focus=="function"&&ee.focus(),ee=0;eef?32:f,ue.T=null,f=Lf,Lf=null;var O=zl,B=Mo;if(Wr=0,pd=zl=null,Mo=0,(Hn&6)!==0)throw Error(o(331));var ee=Hn;if(Hn|=4,aS(O.current),Ev(O,O.current,B,f),Hn=ee,md(0,!1),Gt&&typeof Gt.onPostCommitFiberRoot=="function")try{Gt.onPostCommitFiberRoot(nn,O)}catch{}return!0}finally{ne.p=j,ue.T=y,bS(a,d)}}function wS(a,d,f){d=ci(f,d),d=rv(a.stateNode,d,2),a=kl(a,d,2),a!==null&&(Er(a,2),Qa(a))}function Xn(a,d,f){if(a.tag===3)wS(a,a,f);else for(;d!==null;){if(d.tag===3){wS(d,a,f);break}else if(d.tag===1){var y=d.stateNode;if(typeof d.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(Il===null||!Il.has(y))){a=ci(f,a),f=sv(2),y=kl(d,f,2),y!==null&&(Rl(f,y,d,a),Er(y,2),Qa(y));break}}d=d.return}}function $v(a,d,f){var y=a.pingCache;if(y===null){y=a.pingCache=new $A;var j=new Set;y.set(d,j)}else j=y.get(d),j===void 0&&(j=new Set,y.set(d,j));j.has(f)||(Cv=!0,j.add(f),a=Hf.bind(null,a,d,f),d.then(a,a))}function Hf(a,d,f){var y=a.pingCache;y!==null&&y.delete(d),a.pingedLanes|=a.suspendedLanes&f,a.warmLanes&=~f,lr===a&&(kn&f)===f&&(Ar===4||Ar===3&&(kn&62914560)===kn&&300>q()-Mh?(Hn&2)===0&&Fl(a,0):Pf|=f,Ml===kn&&(Ml=0)),Qa(a)}function Nv(a,d){d===0&&(d=Rs()),a=jc(a,d),a!==null&&(Er(a,d),Qa(a))}function MA(a){var d=a.memoizedState,f=0;d!==null&&(f=d.retryLane),Nv(a,f)}function IA(a,d){var f=0;switch(a.tag){case 31:case 13:var y=a.stateNode,j=a.memoizedState;j!==null&&(f=j.retryLane);break;case 19:y=a.stateNode;break;case 22:y=a.stateNode._retryCache;break;default:throw Error(o(314))}y!==null&&y.delete(d),Nv(a,f)}function Dv(a,d){return Oi(a,d)}var Gf=null,Kc=null,Pv=!1,Xf=!1,Mv=!1,_a=0;function Qa(a){a!==Kc&&a.next===null&&(Kc===null?Gf=Kc=a:Kc=Kc.next=a),Xf=!0,Pv||(Pv=!0,zA())}function md(a,d){if(!Mv&&Xf){Mv=!0;do for(var f=!1,y=Gf;y!==null;){if(a!==0){var j=y.pendingLanes;if(j===0)var O=0;else{var B=y.suspendedLanes,ee=y.pingedLanes;O=(1<<31-is(42|a)+1)-1,O&=j&~(B&~ee),O=O&201326741?O&201326741|1:O?O|2:0}O!==0&&(f=!0,jS(y,O))}else O=kn,O=qt(y,y===lr?O:0,y.cancelPendingCommit!==null||y.timeoutHandle!==-1),(O&3)===0||xr(y,O)||(f=!0,jS(y,O));y=y.next}while(f);Mv=!1}}function Iv(){Yf()}function Yf(){Xf=Pv=!1;var a=0;_a!==0&&UA()&&(a=_a);for(var d=q(),f=null,y=Gf;y!==null;){var j=y.next,O=SS(y,d);O===0?(y.next=null,f===null?Gf=j:f.next=j,j===null&&(Kc=f)):(f=y,(a!==0||(O&3)!==0)&&(Xf=!0)),y=j}Wr!==0&&Wr!==5||md(a),_a!==0&&(_a=0)}function SS(a,d){for(var f=a.suspendedLanes,y=a.pingedLanes,j=a.expirationTimes,O=a.pendingLanes&-62914561;0ee)break;var We=be.transferSize,rt=be.initiatorType;We&&Uv(rt)&&(be=be.responseEnd,B+=We*(be"u"?null:document;function PS(a,d,f){var y=Hc;if(y&&typeof d=="string"&&d){var j=si(d);j='link[rel="'+a+'"][href="'+j+'"]',typeof f=="string"&&(j+='[crossorigin="'+f+'"]'),Wv.has(j)||(Wv.add(j),a={rel:a,crossOrigin:f,href:d},y.querySelector(j)===null&&(d=y.createElement("link"),ws(d,"link",a),Zr(d),y.head.appendChild(d)))}}function Qv(a){Io.D(a),PS("dns-prefetch",a,null)}function MS(a,d){Io.C(a,d),PS("preconnect",a,d)}function GA(a,d,f){Io.L(a,d,f);var y=Hc;if(y&&a&&d){var j='link[rel="preload"][as="'+si(d)+'"]';d==="image"&&f&&f.imageSrcSet?(j+='[imagesrcset="'+si(f.imageSrcSet)+'"]',typeof f.imageSizes=="string"&&(j+='[imagesizes="'+si(f.imageSizes)+'"]')):j+='[href="'+si(a)+'"]';var O=j;switch(d){case"style":O=bd(a);break;case"script":O=Ul(a)}oa.has(O)||(a=A({rel:"preload",href:d==="image"&&f&&f.imageSrcSet?void 0:a,as:d},f),oa.set(O,a),y.querySelector(j)!==null||d==="style"&&y.querySelector(Gh(O))||d==="script"&&y.querySelector(Xh(O))||(d=y.createElement("link"),ws(d,"link",a),Zr(d),y.head.appendChild(d)))}}function IS(a,d){Io.m(a,d);var f=Hc;if(f&&a){var y=d&&typeof d.as=="string"?d.as:"script",j='link[rel="modulepreload"][as="'+si(y)+'"][href="'+si(a)+'"]',O=j;switch(y){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":O=Ul(a)}if(!oa.has(O)&&(a=A({rel:"modulepreload",href:a},d),oa.set(O,a),f.querySelector(j)===null)){switch(y){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(f.querySelector(Xh(O)))return}y=f.createElement("link"),ws(y,"link",a),Zr(y),f.head.appendChild(y)}}}function XA(a,d,f){Io.S(a,d,f);var y=Hc;if(y&&a){var j=fl(y).hoistableStyles,O=bd(a);d=d||"default";var B=j.get(O);if(!B){var ee={loading:0,preload:null};if(B=y.querySelector(Gh(O)))ee.loading=5;else{a=A({rel:"stylesheet",href:a,"data-precedence":d},f),(f=oa.get(O))&&ex(a,f);var be=B=y.createElement("link");Zr(be),ws(be,"link",a),be._p=new Promise(function(Ue,We){be.onload=Ue,be.onerror=We}),be.addEventListener("load",function(){ee.loading|=1}),be.addEventListener("error",function(){ee.loading|=2}),ee.loading|=4,am(B,d,y)}B={type:"stylesheet",instance:B,count:1,state:ee},j.set(O,B)}}}function YA(a,d){Io.X(a,d);var f=Hc;if(f&&a){var y=fl(f).hoistableScripts,j=Ul(a),O=y.get(j);O||(O=f.querySelector(Xh(j)),O||(a=A({src:a,async:!0},d),(d=oa.get(j))&&tx(a,d),O=f.createElement("script"),Zr(O),ws(O,"link",a),f.head.appendChild(O)),O={type:"script",instance:O,count:1,state:null},y.set(j,O))}}function ZA(a,d){Io.M(a,d);var f=Hc;if(f&&a){var y=fl(f).hoistableScripts,j=Ul(a),O=y.get(j);O||(O=f.querySelector(Xh(j)),O||(a=A({src:a,async:!0,type:"module"},d),(d=oa.get(j))&&tx(a,d),O=f.createElement("script"),Zr(O),ws(O,"link",a),f.head.appendChild(O)),O={type:"script",instance:O,count:1,state:null},y.set(j,O))}}function zS(a,d,f,y){var j=(j=Ne.current)?im(j):null;if(!j)throw Error(o(446));switch(a){case"meta":case"title":return null;case"style":return typeof f.precedence=="string"&&typeof f.href=="string"?(d=bd(f.href),f=fl(j).hoistableStyles,y=f.get(d),y||(y={type:"style",instance:null,count:0,state:null},f.set(d,y)),y):{type:"void",instance:null,count:0,state:null};case"link":if(f.rel==="stylesheet"&&typeof f.href=="string"&&typeof f.precedence=="string"){a=bd(f.href);var O=fl(j).hoistableStyles,B=O.get(a);if(B||(j=j.ownerDocument||j,B={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},O.set(a,B),(O=j.querySelector(Gh(a)))&&!O._p&&(B.instance=O,B.state.loading=5),oa.has(a)||(f={rel:"preload",as:"style",href:f.href,crossOrigin:f.crossOrigin,integrity:f.integrity,media:f.media,hrefLang:f.hrefLang,referrerPolicy:f.referrerPolicy},oa.set(a,f),O||FS(j,a,f,B.state))),d&&y===null)throw Error(o(528,""));return B}if(d&&y!==null)throw Error(o(529,""));return null;case"script":return d=f.async,f=f.src,typeof f=="string"&&d&&typeof d!="function"&&typeof d!="symbol"?(d=Ul(f),f=fl(j).hoistableScripts,y=f.get(d),y||(y={type:"script",instance:null,count:0,state:null},f.set(d,y)),y):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,a))}}function bd(a){return'href="'+si(a)+'"'}function Gh(a){return'link[rel="stylesheet"]['+a+"]"}function LS(a){return A({},a,{"data-precedence":a.precedence,precedence:null})}function FS(a,d,f,y){a.querySelector('link[rel="preload"][as="style"]['+d+"]")?y.loading=1:(d=a.createElement("link"),y.preload=d,d.addEventListener("load",function(){return y.loading|=1}),d.addEventListener("error",function(){return y.loading|=2}),ws(d,"link",f),Zr(d),a.head.appendChild(d))}function Ul(a){return'[src="'+si(a)+'"]'}function Xh(a){return"script[async]"+a}function qS(a,d,f){if(d.count++,d.instance===null)switch(d.type){case"style":var y=a.querySelector('style[data-href~="'+si(f.href)+'"]');if(y)return d.instance=y,Zr(y),y;var j=A({},f,{"data-href":f.href,"data-precedence":f.precedence,href:null,precedence:null});return y=(a.ownerDocument||a).createElement("style"),Zr(y),ws(y,"style",j),am(y,f.precedence,a),d.instance=y;case"stylesheet":j=bd(f.href);var O=a.querySelector(Gh(j));if(O)return d.state.loading|=4,d.instance=O,Zr(O),O;y=LS(f),(j=oa.get(j))&&ex(y,j),O=(a.ownerDocument||a).createElement("link"),Zr(O);var B=O;return B._p=new Promise(function(ee,be){B.onload=ee,B.onerror=be}),ws(O,"link",y),d.state.loading|=4,am(O,f.precedence,a),d.instance=O;case"script":return O=Ul(f.src),(j=a.querySelector(Xh(O)))?(d.instance=j,Zr(j),j):(y=f,(j=oa.get(O))&&(y=A({},f),tx(y,j)),a=a.ownerDocument||a,j=a.createElement("script"),Zr(j),ws(j,"link",y),a.head.appendChild(j),d.instance=j);case"void":return null;default:throw Error(o(443,d.type))}else d.type==="stylesheet"&&(d.state.loading&4)===0&&(y=d.instance,d.state.loading|=4,am(y,f.precedence,a));return d.instance}function am(a,d,f){for(var y=f.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),j=y.length?y[y.length-1]:null,O=j,B=0;B title"):null)}function JA(a,d,f){if(f===1||d.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof d.precedence!="string"||typeof d.href!="string"||d.href==="")break;return!0;case"link":if(typeof d.rel!="string"||typeof d.href!="string"||d.href===""||d.onLoad||d.onError)break;return d.rel==="stylesheet"?(a=d.disabled,typeof d.precedence=="string"&&a==null):!0;case"script":if(d.async&&typeof d.async!="function"&&typeof d.async!="symbol"&&!d.onLoad&&!d.onError&&d.src&&typeof d.src=="string")return!0}return!1}function KS(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function VS(a,d,f,y){if(f.type==="stylesheet"&&(typeof y.media!="string"||matchMedia(y.media).matches!==!1)&&(f.state.loading&4)===0){if(f.instance===null){var j=bd(y.href),O=d.querySelector(Gh(j));if(O){d=O._p,d!==null&&typeof d=="object"&&typeof d.then=="function"&&(a.count++,a=Gc.bind(a),d.then(a,a)),f.state.loading|=4,f.instance=O,Zr(O);return}O=d.ownerDocument||d,y=LS(y),(j=oa.get(j))&&ex(y,j),O=O.createElement("link"),Zr(O);var B=O;B._p=new Promise(function(ee,be){B.onload=ee,B.onerror=be}),ws(O,"link",y),f.instance=O}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(f,d),(d=f.state.preload)&&(f.state.loading&3)===0&&(a.count++,f=Gc.bind(a),d.addEventListener("load",f),d.addEventListener("error",f))}}var lm=0;function WA(a,d){return a.stylesheets&&a.count===0&&cm(a,a.stylesheets),0lm?50:800)+d);return a.unsuspend=f,function(){a.unsuspend=null,clearTimeout(y),clearTimeout(j)}}:null}function Gc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)cm(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var wd=null;function cm(a,d){a.stylesheets=null,a.unsuspend!==null&&(a.count++,wd=new Map,d.forEach(HS,a),wd=null,Gc.call(a))}function HS(a,d){if(!(d.state.loading&4)){var f=wd.get(a);if(f)var y=f.get(null);else{f=new Map,wd.set(a,f);for(var j=a.querySelectorAll("link[data-precedence],style[data-precedence]"),O=0;O"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(r){console.error(r)}}return e(),zR.exports=$W(),zR.exports}var DW=NW();const Mj="autoglue.tokens",qT="autoglue.auth-change";let nc=BT();function BT(){try{const e=localStorage.getItem(Mj);return e?JSON.parse(e):null}catch{return null}}function PW(e){e?localStorage.setItem(Mj,JSON.stringify(e)):localStorage.removeItem(Mj)}function MW(e){window.dispatchEvent(new CustomEvent(qT,{detail:e}))}const Xs={get(){return nc},set(e){nc=e,PW(e),MW(e)},reload(){return nc=BT(),nc},isAuthed(){return!!nc?.access_token},getAccessToken(){return nc?.access_token??null},isExpired(e=Math.floor(Date.now()/1e3)){const r=HM(nc?.access_token);return r!==null?e>=r:!0},willExpireSoon(e=60,r=Math.floor(Date.now()/1e3)){const s=HM(nc?.access_token);return s!==null?s-r<=e:!0},logout(){Xs.set(null)},subscribe(e){const r=o=>e(o.detail??null),s=o=>{o.key===Mj&&(nc=BT(),e(nc))};return window.addEventListener(qT,r),window.addEventListener("storage",s),()=>{window.removeEventListener(qT,r),window.removeEventListener("storage",s)}}};function HM(e){if(!e)return null;const r=e.split(".");if(r.length<2)return null;try{const s=JSON.parse(atob(IW(r[1])));return(typeof s?.exp=="number"?s.exp:null)??null}catch{return null}}function IW(e){return e.replace(/-/g,"+").replace(/_/g,"/")+"==".slice((2-e.length*3%4)%4)}const UT="autoglue.org";let HE=localStorage.getItem(UT);const rl={get(){return HE},set(e){HE=e,localStorage.setItem(UT,e),window.dispatchEvent(new CustomEvent("autoglue:org-change",{detail:e}))},subscribe(e){const r=o=>e(o.detail??null),s=o=>{o.key===UT&&(HE=o.newValue,e(HE))};return window.addEventListener("autoglue:org-change",r),window.addEventListener("storage",s),()=>{window.removeEventListener("autoglue:org-change",r),window.removeEventListener("storage",s)}}},zW="https://autoglue.glueopshosted.com/api/v1".replace(/\/+$/,"");class bz{constructor(r={}){this.configuration=r}set config(r){this.configuration=r}get basePath(){return this.configuration.basePath!=null?this.configuration.basePath:zW}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||wz}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){const r=this.configuration.apiKey;if(r)return typeof r=="function"?r:()=>r}get accessToken(){const r=this.configuration.accessToken;if(r)return typeof r=="function"?r:async()=>r}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}}const LW=new bz;class ks{constructor(r=LW){this.configuration=r,this.middleware=r.middleware}static jsonRegex=new RegExp("^(:?application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(:?;.*)?$","i");middleware;withMiddleware(...r){const s=this.clone();return s.middleware=s.middleware.concat(...r),s}withPreMiddleware(...r){const s=r.map(o=>({pre:o}));return this.withMiddleware(...s)}withPostMiddleware(...r){const s=r.map(o=>({post:o}));return this.withMiddleware(...s)}isJsonMime(r){return r?ks.jsonRegex.test(r):!1}async request(r,s){const{url:o,init:u}=await this.createFetchParams(r,s),h=await this.fetchApi(o,u);if(h&&h.status>=200&&h.status<300)return h;throw new BW(h,"Response returned an error code")}async createFetchParams(r,s){let o=this.configuration.basePath+r.path;r.query!==void 0&&Object.keys(r.query).length!==0&&(o+="?"+this.configuration.queryParamsStringify(r.query));const u=Object.assign({},this.configuration.headers,r.headers);Object.keys(u).forEach(E=>u[E]===void 0?delete u[E]:{});const h=typeof s=="function"?s:async()=>s,m={method:r.method,headers:u,body:r.body,credentials:this.configuration.credentials},g={...m,...await h({init:m,context:r})};let b;qW(g.body)||g.body instanceof URLSearchParams||FW(g.body)?b=g.body:this.isJsonMime(u["Content-Type"])?b=JSON.stringify(g.body):b=g.body;const w={...g,body:b};return{url:o,init:w}}fetchApi=async(r,s)=>{let o={url:r,init:s};for(const h of this.middleware)h.pre&&(o=await h.pre({fetch:this.fetchApi,...o})||o);let u;try{u=await(this.configuration.fetchApi||fetch)(o.url,o.init)}catch(h){for(const m of this.middleware)m.onError&&(u=await m.onError({fetch:this.fetchApi,url:o.url,init:o.init,error:h,response:u?u.clone():void 0})||u);if(u===void 0)throw h instanceof Error?new UW(h,"The request failed and the interceptors did not return an alternative response"):h}for(const h of this.middleware)h.post&&(u=await h.post({fetch:this.fetchApi,url:o.url,init:o.init,response:u.clone()})||u);return u};clone(){const r=this.constructor,s=new r(this.configuration);return s.middleware=this.middleware.slice(),s}}function FW(e){return typeof Blob<"u"&&e instanceof Blob}function qW(e){return typeof FormData<"u"&&e instanceof FormData}class BW extends Error{constructor(r,s){super(s),this.response=r}name="ResponseError"}class UW extends Error{constructor(r,s){super(s),this.cause=r}name="FetchError"}class Qe extends Error{constructor(r,s){super(s),this.field=r}name="RequiredError"}function wz(e,r=""){return Object.keys(e).map(s=>Sz(s,e[s],r)).filter(s=>s.length>0).join("&")}function Sz(e,r,s=""){const o=s+(s.length?`[${e}]`:e);if(r instanceof Array){const u=r.map(h=>encodeURIComponent(String(h))).join(`&${encodeURIComponent(o)}=`);return`${encodeURIComponent(o)}=${u}`}if(r instanceof Set){const u=Array.from(r);return Sz(e,u,s)}return r instanceof Date?`${encodeURIComponent(o)}=${encodeURIComponent(r.toISOString())}`:r instanceof Object?wz(r,o):`${encodeURIComponent(o)}=${encodeURIComponent(String(r))}`}class ht{constructor(r,s=o=>o){this.raw=r,this.transformer=s}async value(){return this.transformer(await this.raw.json())}}class Hi{constructor(r){this.raw=r}async value(){}}class Qo{constructor(r){this.raw=r}async value(){return await this.raw.text()}}function GE(e){return KW(e)}function KW(e,r){return e==null?e:{created_at:e.created_at==null?void 0:new Date(e.created_at),description:e.description==null?void 0:e.description,id:e.id==null?void 0:e.id,label:e.label==null?void 0:e.label,make_target:e.make_target==null?void 0:e.make_target,updated_at:e.updated_at==null?void 0:new Date(e.updated_at)}}function sg(e){return VW(e)}function VW(e,r){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 HW(e){return GW(e,!1)}function GW(e,r=!1){return e==null?e:{annotation_ids:e.annotation_ids}}function XW(e){return YW(e,!1)}function YW(e,r=!1){return e==null?e:{server_id:e.server_id}}function ZW(e){return JW(e,!1)}function JW(e,r=!1){return e==null?e:{domain_id:e.domain_id}}function WW(e){return QW(e,!1)}function QW(e,r=!1){return e==null?e:{label_ids:e.label_ids}}function GM(e){return eQ(e,!1)}function eQ(e,r=!1){return e==null?e:{load_balancer_id:e.load_balancer_id}}function tQ(e){return nQ(e,!1)}function nQ(e,r=!1){return e==null?e:{node_pool_id:e.node_pool_id}}function rQ(e){return sQ(e,!1)}function sQ(e,r=!1){return e==null?e:{record_set_id:e.record_set_id}}function iQ(e){return aQ(e,!1)}function aQ(e,r=!1){return e==null?e:{server_ids:e.server_ids}}function oQ(e){return lQ(e,!1)}function lQ(e,r=!1){return e==null?e:{taint_ids:e.taint_ids}}function cQ(e){return uQ(e)}function uQ(e,r){return e==null?e:{auth_url:e.auth_url==null?void 0:e.auth_url}}function Sb(e){return dQ(e)}function dQ(e,r){return e==null?e:{created_at:e.created_at==null?void 0:e.created_at,credential_id:e.credential_id==null?void 0:e.credential_id,domain_name:e.domain_name==null?void 0:e.domain_name,id:e.id==null?void 0:e.id,last_error:e.last_error==null?void 0:e.last_error,organization_id:e.organization_id==null?void 0:e.organization_id,status:e.status==null?void 0:e.status,updated_at:e.updated_at==null?void 0:e.updated_at,zone_id:e.zone_id==null?void 0:e.zone_id}}function ig(e){return hQ(e)}function hQ(e,r){return e==null?e:{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,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,updated_at:e.updated_at==null?void 0:e.updated_at}}function ag(e){return pQ(e)}function pQ(e,r){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 og(e){return fQ(e)}function fQ(e,r){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 Fd(e){return mQ(e)}function mQ(e,r){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 Eb(e){return gQ(e)}function gQ(e,r){return e==null?e:{annotations:e.annotations==null?void 0:e.annotations.map(sg),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(og),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(Fd),taints:e.taints==null?void 0:e.taints.map(ag),updated_at:e.updated_at==null?void 0:e.updated_at}}function jb(e){return yQ(e)}function yQ(e,r){return e==null?e:{created_at:e.created_at==null?void 0:e.created_at,domain_id:e.domain_id==null?void 0:e.domain_id,fingerprint:e.fingerprint==null?void 0:e.fingerprint,id:e.id==null?void 0:e.id,last_error:e.last_error==null?void 0:e.last_error,name:e.name==null?void 0:e.name,owner:e.owner==null?void 0:e.owner,status:e.status==null?void 0:e.status,ttl:e.ttl==null?void 0:e.ttl,type:e.type==null?void 0:e.type,updated_at:e.updated_at==null?void 0:e.updated_at,values:e.values==null?void 0:e.values}}function Ps(e){return vQ(e)}function vQ(e,r){return e==null?e:{apps_load_balancer:e.apps_load_balancer==null?void 0:ig(e.apps_load_balancer),bastion_server:e.bastion_server==null?void 0:Fd(e.bastion_server),captain_domain:e.captain_domain==null?void 0:Sb(e.captain_domain),certificate_key:e.certificate_key==null?void 0:e.certificate_key,cluster_provider:e.cluster_provider==null?void 0:e.cluster_provider,control_plane_fqdn:e.control_plane_fqdn==null?void 0:e.control_plane_fqdn,control_plane_record_set:e.control_plane_record_set==null?void 0:jb(e.control_plane_record_set),created_at:e.created_at==null?void 0:e.created_at,docker_image:e.docker_image==null?void 0:e.docker_image,docker_tag:e.docker_tag==null?void 0:e.docker_tag,glueops_load_balancer:e.glueops_load_balancer==null?void 0:ig(e.glueops_load_balancer),id:e.id==null?void 0:e.id,kubeconfig:e.kubeconfig==null?void 0:e.kubeconfig,last_error:e.last_error==null?void 0:e.last_error,name:e.name==null?void 0:e.name,node_pools:e.node_pools==null?void 0:e.node_pools.map(Eb),org_key:e.org_key==null?void 0:e.org_key,org_secret:e.org_secret==null?void 0:e.org_secret,random_token:e.random_token==null?void 0:e.random_token,region:e.region==null?void 0:e.region,status:e.status==null?void 0:e.status,updated_at:e.updated_at==null?void 0:e.updated_at}}function qR(e){return xQ(e)}function xQ(e,r){return e==null?e:{action:e.action==null?void 0:e.action,cluster_id:e.cluster_id==null?void 0:e.cluster_id,created_at:e.created_at==null?void 0:new Date(e.created_at),error:e.error==null?void 0:e.error,finished_at:e.finished_at==null?void 0:new Date(e.finished_at),id:e.id==null?void 0:e.id,organization_id:e.organization_id==null?void 0:e.organization_id,status:e.status==null?void 0:e.status,updated_at:e.updated_at==null?void 0:new Date(e.updated_at)}}function bQ(e){return wQ(e,!1)}function wQ(e,r=!1){return e==null?e:{description:e.description,label:e.label,make_target:e.make_target}}function SQ(e){return EQ(e,!1)}function EQ(e,r=!1){return e==null?e:{key:e.key,value:e.value}}function jQ(e){return CQ(e,!1)}function CQ(e,r=!1){return e==null?e:{cluster_provider:e.cluster_provider,docker_image:e.docker_image,docker_tag:e.docker_tag,name:e.name,region:e.region}}function AQ(e){return OQ(e,!1)}function OQ(e,r=!1){return e==null?e:{account_id:e.account_id,credential_provider:e.credential_provider,kind:e.kind,name:e.name,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 kQ(e){return RQ(e,!1)}function RQ(e,r=!1){return e==null?e:{credential_id:e.credential_id,domain_name:e.domain_name,zone_id:e.zone_id}}function TQ(e){return _Q(e,!1)}function _Q(e,r=!1){return e==null?e:{key:e.key,value:e.value}}function $Q(e){return NQ(e,!1)}function NQ(e,r=!1){return e==null?e:{kind:e.kind,name:e.name,private_ip_address:e.private_ip_address,public_ip_address:e.public_ip_address}}function DQ(e){return PQ(e,!1)}function PQ(e,r=!1){return e==null?e:{name:e.name,role:e.role}}function MQ(e){return IQ(e,!1)}function IQ(e,r=!1){return e==null?e:{name:e.name,ttl:e.ttl,type:e.type,values:e.values}}function zQ(e){return LQ(e,!1)}function LQ(e,r=!1){return e==null?e:{bits:e.bits,comment:e.comment,name:e.name,type:e.type}}function FQ(e){return qQ(e,!1)}function qQ(e,r=!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 BQ(e){return UQ(e,!1)}function UQ(e,r=!1){return e==null?e:{effect:e.effect,key:e.key,value:e.value}}function XE(e){return KQ(e)}function KQ(e,r){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,credential_provider:e.credential_provider==null?void 0:e.credential_provider,id:e.id==null?void 0:e.id,kind:e.kind==null?void 0:e.kind,name:e.name==null?void 0:e.name,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 VQ(e){return HQ(e,!1)}function HQ(e,r=!1){return e==null?e:{payload:e.payload,queue:e.queue,run_at:e.run_at,type:e.type}}function GQ(e){return XQ(e)}function XQ(e,r){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 YQ(e){return ZQ(e)}function ZQ(e,r){return e==null?e:{keys:e.keys==null?void 0:e.keys.map(GQ)}}function JQ(e){return WQ(e)}function WQ(e,r){return e}function bj(e){return QQ(e)}function QQ(e,r){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:JQ(e.status),type:e.type==null?void 0:e.type,updated_at:e.updated_at==null?void 0:e.updated_at}}function eee(e){return tee(e,!1)}function tee(e,r=!1){return e==null?e:{refresh_token:e.refresh_token}}function nee(e){return ree(e)}function ree(e,r){return e==null?e:{items:e.items==null?void 0:e.items.map(bj),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 see(e){return iee(e)}function iee(e,r){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 aee(e){return oee(e,!1)}function oee(e,r=!1){return e==null?e:{refresh_token:e.refresh_token}}function lee(e){return cee(e,!1)}function cee(e,r=!1){return e==null?e:{kubeconfig:e.kubeconfig}}function XM(e){return Ez(e)}function Ez(e,r){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 YM(e){return uee(e)}function uee(e,r){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 dee(e){return hee(e,!1)}function hee(e,r=!1){return e==null?e:{description:e.description,label:e.label,make_target:e.make_target}}function pee(e){return fee(e,!1)}function fee(e,r=!1){return e==null?e:{key:e.key,value:e.value}}function mee(e){return gee(e,!1)}function gee(e,r=!1){return e==null?e:{cluster_provider:e.cluster_provider,docker_image:e.docker_image,docker_tag:e.docker_tag,name:e.name,region:e.region}}function yee(e){return vee(e,!1)}function vee(e,r=!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 xee(e){return bee(e,!1)}function bee(e,r=!1){return e==null?e:{credential_id:e.credential_id,domain_name:e.domain_name,status:e.status,zone_id:e.zone_id}}function wee(e){return See(e,!1)}function See(e,r=!1){return e==null?e:{key:e.key,value:e.value}}function Eee(e){return jee(e,!1)}function jee(e,r=!1){return e==null?e:{kind:e.kind,name:e.name,private_ip_address:e.private_ip_address,public_ip_address:e.public_ip_address}}function Cee(e){return Aee(e,!1)}function Aee(e,r=!1){return e==null?e:{name:e.name,role:e.role}}function Oee(e){return kee(e,!1)}function kee(e,r=!1){return e==null?e:{name:e.name,status:e.status,ttl:e.ttl,type:e.type,values:e.values}}function Ree(e){return Tee(e,!1)}function Tee(e,r=!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 _ee(e){return $ee(e,!1)}function $ee(e,r=!1){return e==null?e:{effect:e.effect,key:e.key,value:e.value}}function Nee(e){return Dee(e)}function Dee(e,r){return e==null||typeof e!="object"?e:Ez(e)}function Pee(e){return Mee(e,!1)}function Mee(e,r=!1){return e==null?e:{expires_in_hours:e.expires_in_hours,name:e.name}}function jz(e){return Iee(e)}function Iee(e,r){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 zee(e){return Lee(e)}function Lee(e,r){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:jz(e.user),user_id:e.user_id==null?void 0:e.user_id}}function Cb(e){return Fee(e)}function Fee(e,r){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 qee(e){return Bee(e)}function Bee(e,r){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(zee),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(Cb),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 ZM(e){return Uee(e)}function Uee(e,r){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 Kee(e){return Vee(e,!1)}function Vee(e,r=!1){return e==null?e:{role:e.role,user_id:e.user_id}}function Hee(e){return Gee(e,!1)}function Gee(e,r=!1){return e==null?e:{domain:e.domain,name:e.name}}function Xee(e){return Yee(e,!1)}function Yee(e,r=!1){return e==null?e:{expires_in_hours:e.expires_in_hours,name:e.name}}function Zee(e){return Jee(e)}function Jee(e,r){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 Wee(e){return Qee(e,!1)}function Qee(e,r=!1){return e==null?e:{domain:e.domain,name:e.name}}function ete(e){return tte(e,!1)}function tte(e,r=!1){return e==null?e:{display_name:e.display_name}}function JM(e){return nte(e)}function nte(e,r){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 rte(e){return ste(e)}function ste(e,r){return e==null?e:{cluster_id:e.cluster_id==null?void 0:e.cluster_id,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,is_ephemeral:e.is_ephemeral==null?void 0:e.is_ephemeral,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,purpose:e.purpose==null?void 0:e.purpose,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 ite extends ks{async createActionRaw(r,s){if(r.dtoCreateActionRequest==null)throw new Qe("dtoCreateActionRequest",'Required parameter "dtoCreateActionRequest" was null or undefined when calling createAction().');const o={},u={};u["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/admin/actions",method:"POST",headers:u,query:o,body:bQ(r.dtoCreateActionRequest)},s);return new ht(m,g=>GE(g))}async createAction(r,s){return await(await this.createActionRaw(r,s)).value()}async deleteActionRaw(r,s){if(r.actionID==null)throw new Qe("actionID",'Required parameter "actionID" was null or undefined when calling deleteAction().');const o={},u={};this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/admin/actions/{actionID}";h=h.replace("{actionID}",encodeURIComponent(String(r.actionID)));const m=await this.request({path:h,method:"DELETE",headers:u,query:o},s);return this.isJsonMime(m.headers.get("content-type"))?new ht(m):new Qo(m)}async deleteAction(r,s){return await(await this.deleteActionRaw(r,s)).value()}async getActionRaw(r,s){if(r.actionID==null)throw new Qe("actionID",'Required parameter "actionID" was null or undefined when calling getAction().');const o={},u={};this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/admin/actions/{actionID}";h=h.replace("{actionID}",encodeURIComponent(String(r.actionID)));const m=await this.request({path:h,method:"GET",headers:u,query:o},s);return new ht(m,g=>GE(g))}async getAction(r,s){return await(await this.getActionRaw(r,s)).value()}async listActionsRaw(r){const s={},o={};this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));const h=await this.request({path:"/admin/actions",method:"GET",headers:o,query:s},r);return new ht(h,m=>m.map(GE))}async listActions(r){return await(await this.listActionsRaw(r)).value()}async updateActionRaw(r,s){if(r.actionID==null)throw new Qe("actionID",'Required parameter "actionID" was null or undefined when calling updateAction().');if(r.dtoUpdateActionRequest==null)throw new Qe("dtoUpdateActionRequest",'Required parameter "dtoUpdateActionRequest" was null or undefined when calling updateAction().');const o={},u={};u["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/admin/actions/{actionID}";h=h.replace("{actionID}",encodeURIComponent(String(r.actionID)));const m=await this.request({path:h,method:"PATCH",headers:u,query:o,body:dee(r.dtoUpdateActionRequest)},s);return new ht(m,g=>GE(g))}async updateAction(r,s){return await(await this.updateActionRaw(r,s)).value()}}class ate extends ks{async createAnnotationRaw(r,s){if(r.dtoCreateAnnotationRequest==null)throw new Qe("dtoCreateAnnotationRequest",'Required parameter "dtoCreateAnnotationRequest" was null or undefined when calling createAnnotation().');const o={},u={};u["Content-Type"]="application/json",r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/annotations",method:"POST",headers:u,query:o,body:SQ(r.dtoCreateAnnotationRequest)},s);return new ht(m,g=>sg(g))}async createAnnotation(r,s){return await(await this.createAnnotationRaw(r,s)).value()}async deleteAnnotationRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling deleteAnnotation().');const o={},u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/annotations/{id}";h=h.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:h,method:"DELETE",headers:u,query:o},s);return new Hi(m)}async deleteAnnotation(r,s){await this.deleteAnnotationRaw(r,s)}async getAnnotationRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling getAnnotation().');const o={},u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/annotations/{id}";h=h.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:h,method:"GET",headers:u,query:o},s);return new ht(m,g=>sg(g))}async getAnnotation(r,s){return await(await this.getAnnotationRaw(r,s)).value()}async listAnnotationsRaw(r,s){const o={};r.key!=null&&(o.key=r.key),r.value!=null&&(o.value=r.value),r.q!=null&&(o.q=r.q);const u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/annotations",method:"GET",headers:u,query:o},s);return new ht(m,g=>g.map(sg))}async listAnnotations(r={},s){return await(await this.listAnnotationsRaw(r,s)).value()}async updateAnnotationRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling updateAnnotation().');if(r.dtoUpdateAnnotationRequest==null)throw new Qe("dtoUpdateAnnotationRequest",'Required parameter "dtoUpdateAnnotationRequest" was null or undefined when calling updateAnnotation().');const o={},u={};u["Content-Type"]="application/json",r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/annotations/{id}";h=h.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:h,method:"PATCH",headers:u,query:o,body:pee(r.dtoUpdateAnnotationRequest)},s);return new ht(m,g=>sg(g))}async updateAnnotation(r,s){return await(await this.updateAnnotationRaw(r,s)).value()}}class ote extends ks{async adminCancelArcherJobRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling adminCancelArcherJob().');const o={},u={};u["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/admin/archer/jobs/{id}/cancel";h=h.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:h,method:"POST",headers:u,query:o,body:r.body},s);return new ht(m,g=>bj(g))}async adminCancelArcherJob(r,s){return await(await this.adminCancelArcherJobRaw(r,s)).value()}async adminEnqueueArcherJobRaw(r,s){if(r.dtoEnqueueRequest==null)throw new Qe("dtoEnqueueRequest",'Required parameter "dtoEnqueueRequest" was null or undefined when calling adminEnqueueArcherJob().');const o={},u={};u["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/admin/archer/jobs",method:"POST",headers:u,query:o,body:VQ(r.dtoEnqueueRequest)},s);return new ht(m,g=>bj(g))}async adminEnqueueArcherJob(r,s){return await(await this.adminEnqueueArcherJobRaw(r,s)).value()}async adminListArcherJobsRaw(r,s){const o={};r.status!=null&&(o.status=r.status),r.queue!=null&&(o.queue=r.queue),r.q!=null&&(o.q=r.q),r.page!=null&&(o.page=r.page),r.pageSize!=null&&(o.page_size=r.pageSize);const u={};this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/admin/archer/jobs",method:"GET",headers:u,query:o},s);return new ht(m,g=>nee(g))}async adminListArcherJobs(r={},s){return await(await this.adminListArcherJobsRaw(r,s)).value()}async adminListArcherQueuesRaw(r){const s={},o={};this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));const h=await this.request({path:"/admin/archer/queues",method:"GET",headers:o,query:s},r);return new ht(h,m=>m.map(see))}async adminListArcherQueues(r){return await(await this.adminListArcherQueuesRaw(r)).value()}async adminRetryArcherJobRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling adminRetryArcherJob().');const o={},u={};u["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/admin/archer/jobs/{id}/retry";h=h.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:h,method:"POST",headers:u,query:o,body:r.body},s);return new ht(m,g=>bj(g))}async adminRetryArcherJob(r,s){return await(await this.adminRetryArcherJobRaw(r,s)).value()}}const Da={queued:"queued",running:"running",succeeded:"succeeded",failed:"failed",canceled:"canceled",retrying:"retrying",scheduled:"scheduled"};class lte extends ks{async authCallbackRaw(r,s){if(r.provider==null)throw new Qe("provider",'Required parameter "provider" was null or undefined when calling authCallback().');const o={},u={};let h="/auth/{provider}/callback";h=h.replace("{provider}",encodeURIComponent(String(r.provider)));const m=await this.request({path:h,method:"GET",headers:u,query:o},s);return new ht(m,g=>YM(g))}async authCallback(r,s){return await(await this.authCallbackRaw(r,s)).value()}async authStartRaw(r,s){if(r.provider==null)throw new Qe("provider",'Required parameter "provider" was null or undefined when calling authStart().');const o={},u={};let h="/auth/{provider}/start";h=h.replace("{provider}",encodeURIComponent(String(r.provider)));const m=await this.request({path:h,method:"POST",headers:u,query:o},s);return new ht(m,g=>cQ(g))}async authStart(r,s){return await(await this.authStartRaw(r,s)).value()}async getJWKSRaw(r){const s={},o={},h=await this.request({path:"/.well-known/jwks.json",method:"GET",headers:o,query:s},r);return new ht(h,m=>YQ(m))}async getJWKS(r){return await(await this.getJWKSRaw(r)).value()}async logoutRaw(r,s){if(r.dtoLogoutRequest==null)throw new Qe("dtoLogoutRequest",'Required parameter "dtoLogoutRequest" was null or undefined when calling logout().');const o={},u={};u["Content-Type"]="application/json";const m=await this.request({path:"/auth/logout",method:"POST",headers:u,query:o,body:eee(r.dtoLogoutRequest)},s);return new Hi(m)}async logout(r,s){await this.logoutRaw(r,s)}async refreshRaw(r,s){if(r.dtoRefreshRequest==null)throw new Qe("dtoRefreshRequest",'Required parameter "dtoRefreshRequest" was null or undefined when calling refresh().');const o={},u={};u["Content-Type"]="application/json";const m=await this.request({path:"/auth/refresh",method:"POST",headers:u,query:o,body:aee(r.dtoRefreshRequest)},s);return new ht(m,g=>YM(g))}async refresh(r,s){return await(await this.refreshRaw(r,s)).value()}}class cte extends ks{async getClusterRunRaw(r,s){if(r.clusterID==null)throw new Qe("clusterID",'Required parameter "clusterID" was null or undefined when calling getClusterRun().');if(r.runID==null)throw new Qe("runID",'Required parameter "runID" was null or undefined when calling getClusterRun().');const o={},u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/clusters/{clusterID}/runs/{runID}";h=h.replace("{clusterID}",encodeURIComponent(String(r.clusterID))),h=h.replace("{runID}",encodeURIComponent(String(r.runID)));const m=await this.request({path:h,method:"GET",headers:u,query:o},s);return new ht(m,g=>qR(g))}async getClusterRun(r,s){return await(await this.getClusterRunRaw(r,s)).value()}async listClusterRunsRaw(r,s){if(r.clusterID==null)throw new Qe("clusterID",'Required parameter "clusterID" was null or undefined when calling listClusterRuns().');const o={},u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/clusters/{clusterID}/runs";h=h.replace("{clusterID}",encodeURIComponent(String(r.clusterID)));const m=await this.request({path:h,method:"GET",headers:u,query:o},s);return new ht(m,g=>g.map(qR))}async listClusterRuns(r,s){return await(await this.listClusterRunsRaw(r,s)).value()}async runClusterActionRaw(r,s){if(r.clusterID==null)throw new Qe("clusterID",'Required parameter "clusterID" was null or undefined when calling runClusterAction().');if(r.actionID==null)throw new Qe("actionID",'Required parameter "actionID" was null or undefined when calling runClusterAction().');const o={},u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/clusters/{clusterID}/actions/{actionID}/runs";h=h.replace("{clusterID}",encodeURIComponent(String(r.clusterID))),h=h.replace("{actionID}",encodeURIComponent(String(r.actionID)));const m=await this.request({path:h,method:"POST",headers:u,query:o},s);return new ht(m,g=>qR(g))}async runClusterAction(r,s){return await(await this.runClusterActionRaw(r,s)).value()}}class ute extends ks{async attachAppsLoadBalancerRaw(r,s){if(r.clusterID==null)throw new Qe("clusterID",'Required parameter "clusterID" was null or undefined when calling attachAppsLoadBalancer().');if(r.dtoAttachLoadBalancerRequest==null)throw new Qe("dtoAttachLoadBalancerRequest",'Required parameter "dtoAttachLoadBalancerRequest" was null or undefined when calling attachAppsLoadBalancer().');const o={},u={};u["Content-Type"]="application/json",r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/clusters/{clusterID}/apps-load-balancer";h=h.replace("{clusterID}",encodeURIComponent(String(r.clusterID)));const m=await this.request({path:h,method:"POST",headers:u,query:o,body:GM(r.dtoAttachLoadBalancerRequest)},s);return new ht(m,g=>Ps(g))}async attachAppsLoadBalancer(r,s){return await(await this.attachAppsLoadBalancerRaw(r,s)).value()}async attachBastionServerRaw(r,s){if(r.clusterID==null)throw new Qe("clusterID",'Required parameter "clusterID" was null or undefined when calling attachBastionServer().');if(r.dtoAttachBastionRequest==null)throw new Qe("dtoAttachBastionRequest",'Required parameter "dtoAttachBastionRequest" was null or undefined when calling attachBastionServer().');const o={},u={};u["Content-Type"]="application/json",r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/clusters/{clusterID}/bastion";h=h.replace("{clusterID}",encodeURIComponent(String(r.clusterID)));const m=await this.request({path:h,method:"POST",headers:u,query:o,body:XW(r.dtoAttachBastionRequest)},s);return new ht(m,g=>Ps(g))}async attachBastionServer(r,s){return await(await this.attachBastionServerRaw(r,s)).value()}async attachCaptainDomainRaw(r,s){if(r.clusterID==null)throw new Qe("clusterID",'Required parameter "clusterID" was null or undefined when calling attachCaptainDomain().');if(r.dtoAttachCaptainDomainRequest==null)throw new Qe("dtoAttachCaptainDomainRequest",'Required parameter "dtoAttachCaptainDomainRequest" was null or undefined when calling attachCaptainDomain().');const o={},u={};u["Content-Type"]="application/json",r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/clusters/{clusterID}/captain-domain";h=h.replace("{clusterID}",encodeURIComponent(String(r.clusterID)));const m=await this.request({path:h,method:"POST",headers:u,query:o,body:ZW(r.dtoAttachCaptainDomainRequest)},s);return new ht(m,g=>Ps(g))}async attachCaptainDomain(r,s){return await(await this.attachCaptainDomainRaw(r,s)).value()}async attachControlPlaneRecordSetRaw(r,s){if(r.clusterID==null)throw new Qe("clusterID",'Required parameter "clusterID" was null or undefined when calling attachControlPlaneRecordSet().');if(r.dtoAttachRecordSetRequest==null)throw new Qe("dtoAttachRecordSetRequest",'Required parameter "dtoAttachRecordSetRequest" was null or undefined when calling attachControlPlaneRecordSet().');const o={},u={};u["Content-Type"]="application/json",r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/clusters/{clusterID}/control-plane-record-set";h=h.replace("{clusterID}",encodeURIComponent(String(r.clusterID)));const m=await this.request({path:h,method:"POST",headers:u,query:o,body:rQ(r.dtoAttachRecordSetRequest)},s);return new ht(m,g=>Ps(g))}async attachControlPlaneRecordSet(r,s){return await(await this.attachControlPlaneRecordSetRaw(r,s)).value()}async attachGlueOpsLoadBalancerRaw(r,s){if(r.clusterID==null)throw new Qe("clusterID",'Required parameter "clusterID" was null or undefined when calling attachGlueOpsLoadBalancer().');if(r.dtoAttachLoadBalancerRequest==null)throw new Qe("dtoAttachLoadBalancerRequest",'Required parameter "dtoAttachLoadBalancerRequest" was null or undefined when calling attachGlueOpsLoadBalancer().');const o={},u={};u["Content-Type"]="application/json",r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/clusters/{clusterID}/glueops-load-balancer";h=h.replace("{clusterID}",encodeURIComponent(String(r.clusterID)));const m=await this.request({path:h,method:"POST",headers:u,query:o,body:GM(r.dtoAttachLoadBalancerRequest)},s);return new ht(m,g=>Ps(g))}async attachGlueOpsLoadBalancer(r,s){return await(await this.attachGlueOpsLoadBalancerRaw(r,s)).value()}async attachNodePoolRaw(r,s){if(r.clusterID==null)throw new Qe("clusterID",'Required parameter "clusterID" was null or undefined when calling attachNodePool().');if(r.dtoAttachNodePoolRequest==null)throw new Qe("dtoAttachNodePoolRequest",'Required parameter "dtoAttachNodePoolRequest" was null or undefined when calling attachNodePool().');const o={},u={};u["Content-Type"]="application/json",r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/clusters/{clusterID}/node-pools";h=h.replace("{clusterID}",encodeURIComponent(String(r.clusterID)));const m=await this.request({path:h,method:"POST",headers:u,query:o,body:tQ(r.dtoAttachNodePoolRequest)},s);return new ht(m,g=>Ps(g))}async attachNodePool(r,s){return await(await this.attachNodePoolRaw(r,s)).value()}async clearClusterKubeconfigRaw(r,s){if(r.clusterID==null)throw new Qe("clusterID",'Required parameter "clusterID" was null or undefined when calling clearClusterKubeconfig().');const o={},u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/clusters/{clusterID}/kubeconfig";h=h.replace("{clusterID}",encodeURIComponent(String(r.clusterID)));const m=await this.request({path:h,method:"DELETE",headers:u,query:o},s);return new ht(m,g=>Ps(g))}async clearClusterKubeconfig(r,s){return await(await this.clearClusterKubeconfigRaw(r,s)).value()}async createClusterRaw(r,s){if(r.dtoCreateClusterRequest==null)throw new Qe("dtoCreateClusterRequest",'Required parameter "dtoCreateClusterRequest" was null or undefined when calling createCluster().');const o={},u={};u["Content-Type"]="application/json",r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/clusters",method:"POST",headers:u,query:o,body:jQ(r.dtoCreateClusterRequest)},s);return new ht(m,g=>Ps(g))}async createCluster(r,s){return await(await this.createClusterRaw(r,s)).value()}async deleteClusterRaw(r,s){if(r.clusterID==null)throw new Qe("clusterID",'Required parameter "clusterID" was null or undefined when calling deleteCluster().');const o={},u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/clusters/{clusterID}";h=h.replace("{clusterID}",encodeURIComponent(String(r.clusterID)));const m=await this.request({path:h,method:"DELETE",headers:u,query:o},s);return this.isJsonMime(m.headers.get("content-type"))?new ht(m):new Qo(m)}async deleteCluster(r,s){return await(await this.deleteClusterRaw(r,s)).value()}async detachAppsLoadBalancerRaw(r,s){if(r.clusterID==null)throw new Qe("clusterID",'Required parameter "clusterID" was null or undefined when calling detachAppsLoadBalancer().');const o={},u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/clusters/{clusterID}/apps-load-balancer";h=h.replace("{clusterID}",encodeURIComponent(String(r.clusterID)));const m=await this.request({path:h,method:"DELETE",headers:u,query:o},s);return new ht(m,g=>Ps(g))}async detachAppsLoadBalancer(r,s){return await(await this.detachAppsLoadBalancerRaw(r,s)).value()}async detachBastionServerRaw(r,s){if(r.clusterID==null)throw new Qe("clusterID",'Required parameter "clusterID" was null or undefined when calling detachBastionServer().');const o={},u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/clusters/{clusterID}/bastion";h=h.replace("{clusterID}",encodeURIComponent(String(r.clusterID)));const m=await this.request({path:h,method:"DELETE",headers:u,query:o},s);return new ht(m,g=>Ps(g))}async detachBastionServer(r,s){return await(await this.detachBastionServerRaw(r,s)).value()}async detachCaptainDomainRaw(r,s){if(r.clusterID==null)throw new Qe("clusterID",'Required parameter "clusterID" was null or undefined when calling detachCaptainDomain().');const o={},u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/clusters/{clusterID}/captain-domain";h=h.replace("{clusterID}",encodeURIComponent(String(r.clusterID)));const m=await this.request({path:h,method:"DELETE",headers:u,query:o},s);return new ht(m,g=>Ps(g))}async detachCaptainDomain(r,s){return await(await this.detachCaptainDomainRaw(r,s)).value()}async detachControlPlaneRecordSetRaw(r,s){if(r.clusterID==null)throw new Qe("clusterID",'Required parameter "clusterID" was null or undefined when calling detachControlPlaneRecordSet().');const o={},u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/clusters/{clusterID}/control-plane-record-set";h=h.replace("{clusterID}",encodeURIComponent(String(r.clusterID)));const m=await this.request({path:h,method:"DELETE",headers:u,query:o},s);return new ht(m,g=>Ps(g))}async detachControlPlaneRecordSet(r,s){return await(await this.detachControlPlaneRecordSetRaw(r,s)).value()}async detachGlueOpsLoadBalancerRaw(r,s){if(r.clusterID==null)throw new Qe("clusterID",'Required parameter "clusterID" was null or undefined when calling detachGlueOpsLoadBalancer().');const o={},u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/clusters/{clusterID}/glueops-load-balancer";h=h.replace("{clusterID}",encodeURIComponent(String(r.clusterID)));const m=await this.request({path:h,method:"DELETE",headers:u,query:o},s);return new ht(m,g=>Ps(g))}async detachGlueOpsLoadBalancer(r,s){return await(await this.detachGlueOpsLoadBalancerRaw(r,s)).value()}async detachNodePoolRaw(r,s){if(r.clusterID==null)throw new Qe("clusterID",'Required parameter "clusterID" was null or undefined when calling detachNodePool().');if(r.nodePoolID==null)throw new Qe("nodePoolID",'Required parameter "nodePoolID" was null or undefined when calling detachNodePool().');const o={},u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/clusters/{clusterID}/node-pools/{nodePoolID}";h=h.replace("{clusterID}",encodeURIComponent(String(r.clusterID))),h=h.replace("{nodePoolID}",encodeURIComponent(String(r.nodePoolID)));const m=await this.request({path:h,method:"DELETE",headers:u,query:o},s);return new ht(m,g=>Ps(g))}async detachNodePool(r,s){return await(await this.detachNodePoolRaw(r,s)).value()}async getClusterRaw(r,s){if(r.clusterID==null)throw new Qe("clusterID",'Required parameter "clusterID" was null or undefined when calling getCluster().');const o={},u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/clusters/{clusterID}";h=h.replace("{clusterID}",encodeURIComponent(String(r.clusterID)));const m=await this.request({path:h,method:"GET",headers:u,query:o},s);return new ht(m,g=>Ps(g))}async getCluster(r,s){return await(await this.getClusterRaw(r,s)).value()}async listClustersRaw(r,s){const o={};r.q!=null&&(o.q=r.q);const u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/clusters",method:"GET",headers:u,query:o},s);return new ht(m,g=>g.map(Ps))}async listClusters(r={},s){return await(await this.listClustersRaw(r,s)).value()}async setClusterKubeconfigRaw(r,s){if(r.clusterID==null)throw new Qe("clusterID",'Required parameter "clusterID" was null or undefined when calling setClusterKubeconfig().');if(r.dtoSetKubeconfigRequest==null)throw new Qe("dtoSetKubeconfigRequest",'Required parameter "dtoSetKubeconfigRequest" was null or undefined when calling setClusterKubeconfig().');const o={},u={};u["Content-Type"]="application/json",r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/clusters/{clusterID}/kubeconfig";h=h.replace("{clusterID}",encodeURIComponent(String(r.clusterID)));const m=await this.request({path:h,method:"POST",headers:u,query:o,body:lee(r.dtoSetKubeconfigRequest)},s);return new ht(m,g=>Ps(g))}async setClusterKubeconfig(r,s){return await(await this.setClusterKubeconfigRaw(r,s)).value()}async updateClusterRaw(r,s){if(r.clusterID==null)throw new Qe("clusterID",'Required parameter "clusterID" was null or undefined when calling updateCluster().');if(r.dtoUpdateClusterRequest==null)throw new Qe("dtoUpdateClusterRequest",'Required parameter "dtoUpdateClusterRequest" was null or undefined when calling updateCluster().');const o={},u={};u["Content-Type"]="application/json",r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/clusters/{clusterID}";h=h.replace("{clusterID}",encodeURIComponent(String(r.clusterID)));const m=await this.request({path:h,method:"PATCH",headers:u,query:o,body:mee(r.dtoUpdateClusterRequest)},s);return new ht(m,g=>Ps(g))}async updateCluster(r,s){return await(await this.updateClusterRaw(r,s)).value()}}class dte extends ks{async createCredentialRaw(r,s){if(r.dtoCreateCredentialRequest==null)throw new Qe("dtoCreateCredentialRequest",'Required parameter "dtoCreateCredentialRequest" was null or undefined when calling createCredential().');const o={},u={};u["Content-Type"]="application/json",r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/credentials",method:"POST",headers:u,query:o,body:AQ(r.dtoCreateCredentialRequest)},s);return new ht(m,g=>XE(g))}async createCredential(r,s){return await(await this.createCredentialRaw(r,s)).value()}async deleteCredentialRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling deleteCredential().');const o={},u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/credentials/{id}";h=h.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:h,method:"DELETE",headers:u,query:o},s);return new Hi(m)}async deleteCredential(r,s){await this.deleteCredentialRaw(r,s)}async getCredentialRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling getCredential().');const o={},u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/credentials/{id}";h=h.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:h,method:"GET",headers:u,query:o},s);return new ht(m,g=>XE(g))}async getCredential(r,s){return await(await this.getCredentialRaw(r,s)).value()}async listCredentialsRaw(r,s){const o={};r.credentialProvider!=null&&(o.credential_provider=r.credentialProvider),r.kind!=null&&(o.kind=r.kind),r.scopeKind!=null&&(o.scope_kind=r.scopeKind);const u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/credentials",method:"GET",headers:u,query:o},s);return new ht(m,g=>g.map(XE))}async listCredentials(r={},s){return await(await this.listCredentialsRaw(r,s)).value()}async revealCredentialRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling revealCredential().');const o={},u={};u["Content-Type"]="application/json",r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/credentials/{id}/reveal";h=h.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:h,method:"POST",headers:u,query:o,body:r.body},s);return new ht(m)}async revealCredential(r,s){return await(await this.revealCredentialRaw(r,s)).value()}async updateCredentialRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling updateCredential().');if(r.dtoUpdateCredentialRequest==null)throw new Qe("dtoUpdateCredentialRequest",'Required parameter "dtoUpdateCredentialRequest" was null or undefined when calling updateCredential().');const o={},u={};u["Content-Type"]="application/json",r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/credentials/{id}";h=h.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:h,method:"PATCH",headers:u,query:o,body:yee(r.dtoUpdateCredentialRequest)},s);return new ht(m,g=>XE(g))}async updateCredential(r,s){return await(await this.updateCredentialRaw(r,s)).value()}}class hte extends ks{async createDomainRaw(r,s){if(r.dtoCreateDomainRequest==null)throw new Qe("dtoCreateDomainRequest",'Required parameter "dtoCreateDomainRequest" was null or undefined when calling createDomain().');const o={},u={};u["Content-Type"]="application/json",r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/dns/domains",method:"POST",headers:u,query:o,body:kQ(r.dtoCreateDomainRequest)},s);return new ht(m,g=>Sb(g))}async createDomain(r,s){return await(await this.createDomainRaw(r,s)).value()}async createRecordSetRaw(r,s){if(r.domainId==null)throw new Qe("domainId",'Required parameter "domainId" was null or undefined when calling createRecordSet().');if(r.dtoCreateRecordSetRequest==null)throw new Qe("dtoCreateRecordSetRequest",'Required parameter "dtoCreateRecordSetRequest" was null or undefined when calling createRecordSet().');const o={},u={};u["Content-Type"]="application/json",r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/dns/domains/{domain_id}/records";h=h.replace("{domain_id}",encodeURIComponent(String(r.domainId)));const m=await this.request({path:h,method:"POST",headers:u,query:o,body:MQ(r.dtoCreateRecordSetRequest)},s);return new ht(m,g=>jb(g))}async createRecordSet(r,s){return await(await this.createRecordSetRaw(r,s)).value()}async deleteDomainRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling deleteDomain().');const o={},u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/dns/domains/{id}";h=h.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:h,method:"DELETE",headers:u,query:o},s);return new Hi(m)}async deleteDomain(r,s){await this.deleteDomainRaw(r,s)}async deleteRecordSetRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling deleteRecordSet().');const o={},u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/dns/records/{id}";h=h.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:h,method:"DELETE",headers:u,query:o},s);return new Hi(m)}async deleteRecordSet(r,s){await this.deleteRecordSetRaw(r,s)}async getDomainRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling getDomain().');const o={},u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/dns/domains/{id}";h=h.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:h,method:"GET",headers:u,query:o},s);return new ht(m,g=>Sb(g))}async getDomain(r,s){return await(await this.getDomainRaw(r,s)).value()}async getRecordSetRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling getRecordSet().');const o={},u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID));let h="/dns/records/{id}";h=h.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:h,method:"GET",headers:u,query:o},s);return new ht(m,g=>jb(g))}async getRecordSet(r,s){return await(await this.getRecordSetRaw(r,s)).value()}async listDomainsRaw(r,s){const o={};r.domainName!=null&&(o.domain_name=r.domainName),r.status!=null&&(o.status=r.status),r.q!=null&&(o.q=r.q);const u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/dns/domains",method:"GET",headers:u,query:o},s);return new ht(m,g=>g.map(Sb))}async listDomains(r={},s){return await(await this.listDomainsRaw(r,s)).value()}async listRecordSetsRaw(r,s){if(r.domainId==null)throw new Qe("domainId",'Required parameter "domainId" was null or undefined when calling listRecordSets().');const o={};r.name!=null&&(o.name=r.name),r.type!=null&&(o.type=r.type),r.status!=null&&(o.status=r.status);const u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/dns/domains/{domain_id}/records";h=h.replace("{domain_id}",encodeURIComponent(String(r.domainId)));const m=await this.request({path:h,method:"GET",headers:u,query:o},s);return new ht(m,g=>g.map(jb))}async listRecordSets(r,s){return await(await this.listRecordSetsRaw(r,s)).value()}async updateDomainRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling updateDomain().');if(r.dtoUpdateDomainRequest==null)throw new Qe("dtoUpdateDomainRequest",'Required parameter "dtoUpdateDomainRequest" was null or undefined when calling updateDomain().');const o={},u={};u["Content-Type"]="application/json",r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/dns/domains/{id}";h=h.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:h,method:"PATCH",headers:u,query:o,body:xee(r.dtoUpdateDomainRequest)},s);return new ht(m,g=>Sb(g))}async updateDomain(r,s){return await(await this.updateDomainRaw(r,s)).value()}async updateRecordSetRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling updateRecordSet().');if(r.dtoUpdateRecordSetRequest==null)throw new Qe("dtoUpdateRecordSetRequest",'Required parameter "dtoUpdateRecordSetRequest" was null or undefined when calling updateRecordSet().');const o={},u={};u["Content-Type"]="application/json",r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/dns/records/{id}";h=h.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:h,method:"PATCH",headers:u,query:o,body:Oee(r.dtoUpdateRecordSetRequest)},s);return new ht(m,g=>jb(g))}async updateRecordSet(r,s){return await(await this.updateRecordSetRaw(r,s)).value()}}class pte extends ks{async createLabelRaw(r,s){if(r.dtoCreateLabelRequest==null)throw new Qe("dtoCreateLabelRequest",'Required parameter "dtoCreateLabelRequest" was null or undefined when calling createLabel().');const o={},u={};u["Content-Type"]="application/json",r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/labels",method:"POST",headers:u,query:o,body:TQ(r.dtoCreateLabelRequest)},s);return new ht(m,g=>og(g))}async createLabel(r,s){return await(await this.createLabelRaw(r,s)).value()}async deleteLabelRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling deleteLabel().');const o={},u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/labels/{id}";h=h.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:h,method:"DELETE",headers:u,query:o},s);return new Hi(m)}async deleteLabel(r,s){await this.deleteLabelRaw(r,s)}async getLabelRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling getLabel().');const o={},u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/labels/{id}";h=h.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:h,method:"GET",headers:u,query:o},s);return new ht(m,g=>og(g))}async getLabel(r,s){return await(await this.getLabelRaw(r,s)).value()}async listLabelsRaw(r,s){const o={};r.key!=null&&(o.key=r.key),r.value!=null&&(o.value=r.value),r.q!=null&&(o.q=r.q);const u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/labels",method:"GET",headers:u,query:o},s);return new ht(m,g=>g.map(og))}async listLabels(r={},s){return await(await this.listLabelsRaw(r,s)).value()}async updateLabelRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling updateLabel().');if(r.dtoUpdateLabelRequest==null)throw new Qe("dtoUpdateLabelRequest",'Required parameter "dtoUpdateLabelRequest" was null or undefined when calling updateLabel().');const o={},u={};u["Content-Type"]="application/json",r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/labels/{id}";h=h.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:h,method:"PATCH",headers:u,query:o,body:wee(r.dtoUpdateLabelRequest)},s);return new ht(m,g=>og(g))}async updateLabel(r,s){return await(await this.updateLabelRaw(r,s)).value()}}class fte extends ks{async createLoadBalancerRaw(r,s){if(r.dtoCreateLoadBalancerRequest==null)throw new Qe("dtoCreateLoadBalancerRequest",'Required parameter "dtoCreateLoadBalancerRequest" was null or undefined when calling createLoadBalancer().');const o={},u={};u["Content-Type"]="application/json",r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/load-balancers",method:"POST",headers:u,query:o,body:$Q(r.dtoCreateLoadBalancerRequest)},s);return new ht(m,g=>ig(g))}async createLoadBalancer(r,s){return await(await this.createLoadBalancerRaw(r,s)).value()}async deleteLoadBalancerRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling deleteLoadBalancer().');const o={},u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/load-balancers/{id}";h=h.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:h,method:"DELETE",headers:u,query:o},s);return new Hi(m)}async deleteLoadBalancer(r,s){await this.deleteLoadBalancerRaw(r,s)}async getLoadBalancersRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling getLoadBalancers().');const o={},u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/load-balancers/{id}";h=h.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:h,method:"GET",headers:u,query:o},s);return new ht(m,g=>g.map(ig))}async getLoadBalancers(r,s){return await(await this.getLoadBalancersRaw(r,s)).value()}async listLoadBalancersRaw(r,s){const o={},u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/load-balancers",method:"GET",headers:u,query:o},s);return new ht(m,g=>g.map(ig))}async listLoadBalancers(r={},s){return await(await this.listLoadBalancersRaw(r,s)).value()}async updateLoadBalancerRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling updateLoadBalancer().');if(r.dtoUpdateLoadBalancerRequest==null)throw new Qe("dtoUpdateLoadBalancerRequest",'Required parameter "dtoUpdateLoadBalancerRequest" was null or undefined when calling updateLoadBalancer().');const o={},u={};u["Content-Type"]="application/json",r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/load-balancers/{id}";h=h.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:h,method:"PATCH",headers:u,query:o,body:Eee(r.dtoUpdateLoadBalancerRequest)},s);return new ht(m,g=>ig(g))}async updateLoadBalancer(r,s){return await(await this.updateLoadBalancerRaw(r,s)).value()}}class mte extends ks{async getMeRaw(r){const s={},o={};this.configuration&&this.configuration.apiKey&&(o["X-API-KEY"]=await this.configuration.apiKey("X-API-KEY")),this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));const h=await this.request({path:"/me",method:"GET",headers:o,query:s},r);return new ht(h,m=>qee(m))}async getMe(r){return await(await this.getMeRaw(r)).value()}async updateMeRaw(r,s){if(r.handlersUpdateMeRequest==null)throw new Qe("handlersUpdateMeRequest",'Required parameter "handlersUpdateMeRequest" was null or undefined when calling updateMe().');const o={},u={};u["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(u["X-API-KEY"]=await this.configuration.apiKey("X-API-KEY")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/me",method:"PATCH",headers:u,query:o,body:ete(r.handlersUpdateMeRequest)},s);return new ht(m,g=>jz(g))}async updateMe(r,s){return await(await this.updateMeRaw(r,s)).value()}}class gte extends ks{async createUserAPIKeyRaw(r,s){if(r.handlersCreateUserKeyRequest==null)throw new Qe("handlersCreateUserKeyRequest",'Required parameter "handlersCreateUserKeyRequest" was null or undefined when calling createUserAPIKey().');const o={},u={};u["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(u["X-API-KEY"]=await this.configuration.apiKey("X-API-KEY")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/me/api-keys",method:"POST",headers:u,query:o,body:Pee(r.handlersCreateUserKeyRequest)},s);return new ht(m,g=>JM(g))}async createUserAPIKey(r,s){return await(await this.createUserAPIKeyRaw(r,s)).value()}async deleteUserAPIKeyRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling deleteUserAPIKey().');const o={},u={};this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/me/api-keys/{id}";h=h.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:h,method:"DELETE",headers:u,query:o},s);return new Hi(m)}async deleteUserAPIKey(r,s){await this.deleteUserAPIKeyRaw(r,s)}async listUserAPIKeysRaw(r){const s={},o={};this.configuration&&this.configuration.apiKey&&(o["X-API-KEY"]=await this.configuration.apiKey("X-API-KEY")),this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));const h=await this.request({path:"/me/api-keys",method:"GET",headers:o,query:s},r);return new ht(h,m=>m.map(JM))}async listUserAPIKeys(r){return await(await this.listUserAPIKeysRaw(r)).value()}}class yte extends ks{async attachNodePoolAnnotationsRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling attachNodePoolAnnotations().');if(r.dtoAttachAnnotationsRequest==null)throw new Qe("dtoAttachAnnotationsRequest",'Required parameter "dtoAttachAnnotationsRequest" was null or undefined when calling attachNodePoolAnnotations().');const o={},u={};u["Content-Type"]="application/json",r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/node-pools/{id}/annotations";h=h.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:h,method:"POST",headers:u,query:o,body:HW(r.dtoAttachAnnotationsRequest)},s);return this.isJsonMime(m.headers.get("content-type"))?new ht(m):new Qo(m)}async attachNodePoolAnnotations(r,s){return await(await this.attachNodePoolAnnotationsRaw(r,s)).value()}async attachNodePoolLabelsRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling attachNodePoolLabels().');if(r.dtoAttachLabelsRequest==null)throw new Qe("dtoAttachLabelsRequest",'Required parameter "dtoAttachLabelsRequest" was null or undefined when calling attachNodePoolLabels().');const o={},u={};u["Content-Type"]="application/json",r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/node-pools/{id}/labels";h=h.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:h,method:"POST",headers:u,query:o,body:WW(r.dtoAttachLabelsRequest)},s);return this.isJsonMime(m.headers.get("content-type"))?new ht(m):new Qo(m)}async attachNodePoolLabels(r,s){return await(await this.attachNodePoolLabelsRaw(r,s)).value()}async attachNodePoolServersRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling attachNodePoolServers().');if(r.dtoAttachServersRequest==null)throw new Qe("dtoAttachServersRequest",'Required parameter "dtoAttachServersRequest" was null or undefined when calling attachNodePoolServers().');const o={},u={};u["Content-Type"]="application/json",r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/node-pools/{id}/servers";h=h.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:h,method:"POST",headers:u,query:o,body:iQ(r.dtoAttachServersRequest)},s);return this.isJsonMime(m.headers.get("content-type"))?new ht(m):new Qo(m)}async attachNodePoolServers(r,s){return await(await this.attachNodePoolServersRaw(r,s)).value()}async attachNodePoolTaintsRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling attachNodePoolTaints().');if(r.dtoAttachTaintsRequest==null)throw new Qe("dtoAttachTaintsRequest",'Required parameter "dtoAttachTaintsRequest" was null or undefined when calling attachNodePoolTaints().');const o={},u={};u["Content-Type"]="application/json",r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/node-pools/{id}/taints";h=h.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:h,method:"POST",headers:u,query:o,body:oQ(r.dtoAttachTaintsRequest)},s);return this.isJsonMime(m.headers.get("content-type"))?new ht(m):new Qo(m)}async attachNodePoolTaints(r,s){return await(await this.attachNodePoolTaintsRaw(r,s)).value()}async createNodePoolRaw(r,s){if(r.dtoCreateNodePoolRequest==null)throw new Qe("dtoCreateNodePoolRequest",'Required parameter "dtoCreateNodePoolRequest" was null or undefined when calling createNodePool().');const o={},u={};u["Content-Type"]="application/json",r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/node-pools",method:"POST",headers:u,query:o,body:DQ(r.dtoCreateNodePoolRequest)},s);return new ht(m,g=>Eb(g))}async createNodePool(r,s){return await(await this.createNodePoolRaw(r,s)).value()}async deleteNodePoolRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling deleteNodePool().');const o={},u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/node-pools/{id}";h=h.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:h,method:"DELETE",headers:u,query:o},s);return new Hi(m)}async deleteNodePool(r,s){await this.deleteNodePoolRaw(r,s)}async detachNodePoolAnnotationRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling detachNodePoolAnnotation().');if(r.annotationId==null)throw new Qe("annotationId",'Required parameter "annotationId" was null or undefined when calling detachNodePoolAnnotation().');const o={},u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/node-pools/{id}/annotations/{annotationId}";h=h.replace("{id}",encodeURIComponent(String(r.id))),h=h.replace("{annotationId}",encodeURIComponent(String(r.annotationId)));const m=await this.request({path:h,method:"DELETE",headers:u,query:o},s);return this.isJsonMime(m.headers.get("content-type"))?new ht(m):new Qo(m)}async detachNodePoolAnnotation(r,s){return await(await this.detachNodePoolAnnotationRaw(r,s)).value()}async detachNodePoolLabelRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling detachNodePoolLabel().');if(r.labelId==null)throw new Qe("labelId",'Required parameter "labelId" was null or undefined when calling detachNodePoolLabel().');const o={},u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/node-pools/{id}/labels/{labelId}";h=h.replace("{id}",encodeURIComponent(String(r.id))),h=h.replace("{labelId}",encodeURIComponent(String(r.labelId)));const m=await this.request({path:h,method:"DELETE",headers:u,query:o},s);return this.isJsonMime(m.headers.get("content-type"))?new ht(m):new Qo(m)}async detachNodePoolLabel(r,s){return await(await this.detachNodePoolLabelRaw(r,s)).value()}async detachNodePoolServerRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling detachNodePoolServer().');if(r.serverId==null)throw new Qe("serverId",'Required parameter "serverId" was null or undefined when calling detachNodePoolServer().');const o={},u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/node-pools/{id}/servers/{serverId}";h=h.replace("{id}",encodeURIComponent(String(r.id))),h=h.replace("{serverId}",encodeURIComponent(String(r.serverId)));const m=await this.request({path:h,method:"DELETE",headers:u,query:o},s);return this.isJsonMime(m.headers.get("content-type"))?new ht(m):new Qo(m)}async detachNodePoolServer(r,s){return await(await this.detachNodePoolServerRaw(r,s)).value()}async detachNodePoolTaintRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling detachNodePoolTaint().');if(r.taintId==null)throw new Qe("taintId",'Required parameter "taintId" was null or undefined when calling detachNodePoolTaint().');const o={},u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/node-pools/{id}/taints/{taintId}";h=h.replace("{id}",encodeURIComponent(String(r.id))),h=h.replace("{taintId}",encodeURIComponent(String(r.taintId)));const m=await this.request({path:h,method:"DELETE",headers:u,query:o},s);return this.isJsonMime(m.headers.get("content-type"))?new ht(m):new Qo(m)}async detachNodePoolTaint(r,s){return await(await this.detachNodePoolTaintRaw(r,s)).value()}async getNodePoolRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling getNodePool().');const o={},u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/node-pools/{id}";h=h.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:h,method:"GET",headers:u,query:o},s);return new ht(m,g=>Eb(g))}async getNodePool(r,s){return await(await this.getNodePoolRaw(r,s)).value()}async listNodePoolAnnotationsRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling listNodePoolAnnotations().');const o={},u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/node-pools/{id}/annotations";h=h.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:h,method:"GET",headers:u,query:o},s);return new ht(m,g=>g.map(sg))}async listNodePoolAnnotations(r,s){return await(await this.listNodePoolAnnotationsRaw(r,s)).value()}async listNodePoolLabelsRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling listNodePoolLabels().');const o={},u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/node-pools/{id}/labels";h=h.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:h,method:"GET",headers:u,query:o},s);return new ht(m,g=>g.map(og))}async listNodePoolLabels(r,s){return await(await this.listNodePoolLabelsRaw(r,s)).value()}async listNodePoolServersRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling listNodePoolServers().');const o={},u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/node-pools/{id}/servers";h=h.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:h,method:"GET",headers:u,query:o},s);return new ht(m,g=>g.map(Fd))}async listNodePoolServers(r,s){return await(await this.listNodePoolServersRaw(r,s)).value()}async listNodePoolTaintsRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling listNodePoolTaints().');const o={},u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/node-pools/{id}/taints";h=h.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:h,method:"GET",headers:u,query:o},s);return new ht(m,g=>g.map(ag))}async listNodePoolTaints(r,s){return await(await this.listNodePoolTaintsRaw(r,s)).value()}async listNodePoolsRaw(r,s){const o={};r.q!=null&&(o.q=r.q);const u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/node-pools",method:"GET",headers:u,query:o},s);return new ht(m,g=>g.map(Eb))}async listNodePools(r={},s){return await(await this.listNodePoolsRaw(r,s)).value()}async updateNodePoolRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling updateNodePool().');if(r.dtoUpdateNodePoolRequest==null)throw new Qe("dtoUpdateNodePoolRequest",'Required parameter "dtoUpdateNodePoolRequest" was null or undefined when calling updateNodePool().');const o={},u={};u["Content-Type"]="application/json",r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/node-pools/{id}";h=h.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:h,method:"PATCH",headers:u,query:o,body:Cee(r.dtoUpdateNodePoolRequest)},s);return new ht(m,g=>Eb(g))}async updateNodePool(r,s){return await(await this.updateNodePoolRaw(r,s)).value()}}class vte extends ks{async addOrUpdateMemberRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling addOrUpdateMember().');if(r.handlersMemberUpsertReq==null)throw new Qe("handlersMemberUpsertReq",'Required parameter "handlersMemberUpsertReq" was null or undefined when calling addOrUpdateMember().');const o={},u={};u["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/orgs/{id}/members";h=h.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:h,method:"POST",headers:u,query:o,body:Kee(r.handlersMemberUpsertReq)},s);return new ht(m,g=>ZM(g))}async addOrUpdateMember(r,s){return await(await this.addOrUpdateMemberRaw(r,s)).value()}async createOrgRaw(r,s){if(r.handlersOrgCreateReq==null)throw new Qe("handlersOrgCreateReq",'Required parameter "handlersOrgCreateReq" was null or undefined when calling createOrg().');const o={},u={};u["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/orgs",method:"POST",headers:u,query:o,body:Hee(r.handlersOrgCreateReq)},s);return new ht(m,g=>Cb(g))}async createOrg(r,s){return await(await this.createOrgRaw(r,s)).value()}async createOrgKeyRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling createOrgKey().');if(r.handlersOrgKeyCreateReq==null)throw new Qe("handlersOrgKeyCreateReq",'Required parameter "handlersOrgKeyCreateReq" was null or undefined when calling createOrgKey().');const o={},u={};u["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/orgs/{id}/api-keys";h=h.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:h,method:"POST",headers:u,query:o,body:Xee(r.handlersOrgKeyCreateReq)},s);return new ht(m,g=>Zee(g))}async createOrgKey(r,s){return await(await this.createOrgKeyRaw(r,s)).value()}async deleteOrgRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling deleteOrg().');const o={},u={};this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/orgs/{id}";h=h.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:h,method:"DELETE",headers:u,query:o},s);return new Hi(m)}async deleteOrg(r,s){await this.deleteOrgRaw(r,s)}async deleteOrgKeyRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling deleteOrgKey().');if(r.keyId==null)throw new Qe("keyId",'Required parameter "keyId" was null or undefined when calling deleteOrgKey().');const o={},u={};this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/orgs/{id}/api-keys/{key_id}";h=h.replace("{id}",encodeURIComponent(String(r.id))),h=h.replace("{key_id}",encodeURIComponent(String(r.keyId)));const m=await this.request({path:h,method:"DELETE",headers:u,query:o},s);return new Hi(m)}async deleteOrgKey(r,s){await this.deleteOrgKeyRaw(r,s)}async getOrgRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling getOrg().');const o={},u={};this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/orgs/{id}";h=h.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:h,method:"GET",headers:u,query:o},s);return new ht(m,g=>Cb(g))}async getOrg(r,s){return await(await this.getOrgRaw(r,s)).value()}async listMembersRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling listMembers().');const o={},u={};this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/orgs/{id}/members";h=h.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:h,method:"GET",headers:u,query:o},s);return new ht(m,g=>g.map(ZM))}async listMembers(r,s){return await(await this.listMembersRaw(r,s)).value()}async listMyOrgsRaw(r){const s={},o={};this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));const h=await this.request({path:"/orgs",method:"GET",headers:o,query:s},r);return new ht(h,m=>m.map(Cb))}async listMyOrgs(r){return await(await this.listMyOrgsRaw(r)).value()}async listOrgKeysRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling listOrgKeys().');const o={},u={};this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/orgs/{id}/api-keys";h=h.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:h,method:"GET",headers:u,query:o},s);return new ht(m,g=>g.map(rte))}async listOrgKeys(r,s){return await(await this.listOrgKeysRaw(r,s)).value()}async removeMemberRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling removeMember().');if(r.userId==null)throw new Qe("userId",'Required parameter "userId" was null or undefined when calling removeMember().');const o={},u={};this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/orgs/{id}/members/{user_id}";h=h.replace("{id}",encodeURIComponent(String(r.id))),h=h.replace("{user_id}",encodeURIComponent(String(r.userId)));const m=await this.request({path:h,method:"DELETE",headers:u,query:o},s);return new Hi(m)}async removeMember(r,s){await this.removeMemberRaw(r,s)}async updateOrgRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling updateOrg().');if(r.handlersOrgUpdateReq==null)throw new Qe("handlersOrgUpdateReq",'Required parameter "handlersOrgUpdateReq" was null or undefined when calling updateOrg().');const o={},u={};u["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/orgs/{id}";h=h.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:h,method:"PATCH",headers:u,query:o,body:Wee(r.handlersOrgUpdateReq)},s);return new ht(m,g=>Cb(g))}async updateOrg(r,s){return await(await this.updateOrgRaw(r,s)).value()}}class xte extends ks{async createServerRaw(r,s){if(r.dtoCreateServerRequest==null)throw new Qe("dtoCreateServerRequest",'Required parameter "dtoCreateServerRequest" was null or undefined when calling createServer().');const o={},u={};u["Content-Type"]="application/json",r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/servers",method:"POST",headers:u,query:o,body:FQ(r.dtoCreateServerRequest)},s);return new ht(m,g=>Fd(g))}async createServer(r,s){return await(await this.createServerRaw(r,s)).value()}async deleteServerRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling deleteServer().');const o={},u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/servers/{id}";h=h.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:h,method:"DELETE",headers:u,query:o},s);return new Hi(m)}async deleteServer(r,s){await this.deleteServerRaw(r,s)}async getServerRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling getServer().');const o={},u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/servers/{id}";h=h.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:h,method:"GET",headers:u,query:o},s);return new ht(m,g=>Fd(g))}async getServer(r,s){return await(await this.getServerRaw(r,s)).value()}async listServersRaw(r,s){const o={};r.status!=null&&(o.status=r.status),r.role!=null&&(o.role=r.role);const u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/servers",method:"GET",headers:u,query:o},s);return new ht(m,g=>g.map(Fd))}async listServers(r={},s){return await(await this.listServersRaw(r,s)).value()}async resetServerHostKeyRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling resetServerHostKey().');const o={},u={};u["Content-Type"]="application/json",r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/servers/{id}/reset-hostkey";h=h.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:h,method:"POST",headers:u,query:o,body:r.body},s);return new ht(m,g=>Fd(g))}async resetServerHostKey(r,s){return await(await this.resetServerHostKeyRaw(r,s)).value()}async updateServerRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling updateServer().');if(r.dtoUpdateServerRequest==null)throw new Qe("dtoUpdateServerRequest",'Required parameter "dtoUpdateServerRequest" was null or undefined when calling updateServer().');const o={},u={};u["Content-Type"]="application/json",r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/servers/{id}";h=h.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:h,method:"PATCH",headers:u,query:o,body:Ree(r.dtoUpdateServerRequest)},s);return new ht(m,g=>Fd(g))}async updateServer(r,s){return await(await this.updateServerRaw(r,s)).value()}}class bte extends ks{async createSSHKeyRaw(r,s){if(r.dtoCreateSSHRequest==null)throw new Qe("dtoCreateSSHRequest",'Required parameter "dtoCreateSSHRequest" was null or undefined when calling createSSHKey().');const o={},u={};u["Content-Type"]="application/json",r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/ssh",method:"POST",headers:u,query:o,body:zQ(r.dtoCreateSSHRequest)},s);return new ht(m,g=>XM(g))}async createSSHKey(r,s){return await(await this.createSSHKeyRaw(r,s)).value()}async deleteSSHKeyRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling deleteSSHKey().');const o={},u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/ssh/{id}";h=h.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:h,method:"DELETE",headers:u,query:o},s);return new Hi(m)}async deleteSSHKey(r,s){await this.deleteSSHKeyRaw(r,s)}async downloadSSHKeyRaw(r,s){if(r.xOrgID==null)throw new Qe("xOrgID",'Required parameter "xOrgID" was null or undefined when calling downloadSSHKey().');if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling downloadSSHKey().');if(r.part==null)throw new Qe("part",'Required parameter "part" was null or undefined when calling downloadSSHKey().');const o={};r.part!=null&&(o.part=r.part);const u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/ssh/{id}/download";h=h.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:h,method:"GET",headers:u,query:o},s);return this.isJsonMime(m.headers.get("content-type"))?new ht(m):new Qo(m)}async downloadSSHKey(r,s){return await(await this.downloadSSHKeyRaw(r,s)).value()}async getSSHKeyRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling getSSHKey().');const o={};r.reveal!=null&&(o.reveal=r.reveal);const u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/ssh/{id}";h=h.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:h,method:"GET",headers:u,query:o},s);return new ht(m,g=>Nee(g))}async getSSHKey(r,s){return await(await this.getSSHKeyRaw(r,s)).value()}async listPublicSshKeysRaw(r,s){const o={},u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/ssh",method:"GET",headers:u,query:o},s);return new ht(m,g=>g.map(XM))}async listPublicSshKeys(r={},s){return await(await this.listPublicSshKeysRaw(r,s)).value()}}class wte extends ks{async createTaintRaw(r,s){if(r.dtoCreateTaintRequest==null)throw new Qe("dtoCreateTaintRequest",'Required parameter "dtoCreateTaintRequest" was null or undefined when calling createTaint().');const o={},u={};u["Content-Type"]="application/json",r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/taints",method:"POST",headers:u,query:o,body:BQ(r.dtoCreateTaintRequest)},s);return new ht(m,g=>ag(g))}async createTaint(r,s){return await(await this.createTaintRaw(r,s)).value()}async deleteTaintRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling deleteTaint().');const o={},u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/taints/{id}";h=h.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:h,method:"DELETE",headers:u,query:o},s);return new Hi(m)}async deleteTaint(r,s){await this.deleteTaintRaw(r,s)}async getTaintRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling getTaint().');const o={},u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/taints/{id}";h=h.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:h,method:"GET",headers:u,query:o},s);return new ht(m,g=>ag(g))}async getTaint(r,s){return await(await this.getTaintRaw(r,s)).value()}async listTaintsRaw(r,s){const o={};r.key!=null&&(o.key=r.key),r.value!=null&&(o.value=r.value),r.q!=null&&(o.q=r.q);const u={};r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/taints",method:"GET",headers:u,query:o},s);return new ht(m,g=>g.map(ag))}async listTaints(r={},s){return await(await this.listTaintsRaw(r,s)).value()}async updateTaintRaw(r,s){if(r.id==null)throw new Qe("id",'Required parameter "id" was null or undefined when calling updateTaint().');if(r.dtoUpdateTaintRequest==null)throw new Qe("dtoUpdateTaintRequest",'Required parameter "dtoUpdateTaintRequest" was null or undefined when calling updateTaint().');const o={},u={};u["Content-Type"]="application/json",r.xOrgID!=null&&(u["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(u["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(u["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(u.Authorization=await this.configuration.apiKey("Authorization"));let h="/taints/{id}";h=h.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:h,method:"PATCH",headers:u,query:o,body:_ee(r.dtoUpdateTaintRequest)},s);return new ht(m,g=>ag(g))}async updateTaint(r,s){return await(await this.updateTaintRaw(r,s)).value()}}const Q_="/api/v1";function Ste(){return new bz({basePath:Q_,accessToken:async()=>Xs.getAccessToken()??"",middleware:[{async pre(e){const r=new Headers(e.init?.headers??{});e.init?.body!=null&&!(e.init.body instanceof FormData)&&!(e.init.body instanceof Blob)&&!r.has("Content-Type")&&r.set("Content-Type","application/json");const o=Xs.getAccessToken();o&&r.set("Authorization",`Bearer ${o}`);const u=rl.get();return u&&r.set("X-Org-ID",u),{...e,init:{...e.init,headers:r}}},async post(e){return e.response}}]})}function ei(e){return new e(Ste())}function Ete(){return ei(lte)}function jte(){return ei(mte)}function Cte(){return ei(gte)}function CC(){return ei(vte)}function Ate(){return ei(bte)}function Ote(){return ei(xte)}function kte(){return ei(wte)}function Rte(){return ei(pte)}function Tte(){return ei(ate)}function _te(){return ei(ote)}function $te(){return ei(yte)}function Nte(){return ei(dte)}function Dte(){return ei(hte)}function Pte(){return ei(fte)}function Mte(){return ei(ute)}function Ite(){return ei(ite)}function zte(){return ei(cte)}let YE=null;async function Lte(){const e=Xs.get();if(!e?.refresh_token)return!1;try{const r=await fetch(`${Q_}/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refresh_token:e.refresh_token})});if(!r.ok)return!1;const s=await r.json();return Xs.set(s),!0}catch{return!1}}async function WM(){return YE||(YE=Lte().finally(()=>{YE=null})),YE}function Fte(e){return e?.status===401||e?.cause?.status===401||e?.response?.status===401||e instanceof Response&&e.status===401}async function ct(e){Xs.willExpireSoon?.(30)&&await WM();try{return await e()}catch(r){if(!Fte(r)||!await WM())throw r;return await e()}}const QM=jte(),BR=Cte(),wp={getMe:()=>ct(async()=>await QM.getMe()),updateMe:e=>ct(async()=>await QM.updateMe({handlersUpdateMeRequest:e})),listKeys:()=>ct(async()=>await BR.listUserAPIKeys()),createKey:e=>ct(async()=>await BR.createUserAPIKey({handlersCreateUserKeyRequest:e})),deleteKey:e=>ct(async()=>(await BR.deleteUserAPIKey({id:e}),!0))},qte={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 eI(e,r){if(typeof e=="function")return e(r);e!=null&&(e.current=r)}function Gi(...e){return r=>{let s=!1;const o=e.map(u=>{const h=eI(u,r);return!s&&typeof h=="function"&&(s=!0),h});if(s)return()=>{for(let u=0;u{let{children:h,...m}=o;Cz(h)&&typeof Ij=="function"&&(h=Ij(h._payload));const g=T.Children.toArray(h),b=g.find(Hte);if(b){const w=b.props.children,E=g.map(A=>A===b?T.Children.count(w)>1?T.Children.only(null):T.isValidElement(w)?w.props.children:null:A);return c.jsx(r,{...m,ref:u,children:T.isValidElement(w)?T.cloneElement(w,void 0,E):null})}return c.jsx(r,{...m,ref:u,children:h})});return s.displayName=`${e}.Slot`,s}var Tg=iw("Slot");function Kte(e){const r=T.forwardRef((s,o)=>{let{children:u,...h}=s;if(Cz(u)&&typeof Ij=="function"&&(u=Ij(u._payload)),T.isValidElement(u)){const m=Xte(u),g=Gte(h,u.props);return u.type!==T.Fragment&&(g.ref=o?Gi(o,m):m),T.cloneElement(u,g)}return T.Children.count(u)>1?T.Children.only(null):null});return r.displayName=`${e}.SlotClone`,r}var Vte=Symbol("radix.slottable");function Hte(e){return T.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Vte}function Gte(e,r){const s={...r};for(const o in r){const u=e[o],h=r[o];/^on[A-Z]/.test(o)?u&&h?s[o]=(...g)=>{const b=h(...g);return u(...g),b}:u&&(s[o]=u):o==="style"?s[o]={...u,...h}:o==="className"&&(s[o]=[u,h].filter(Boolean).join(" "))}return{...e,...s}}function Xte(e){let r=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=r&&"isReactWarning"in r&&r.isReactWarning;return s?e.ref:(r=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=r&&"isReactWarning"in r&&r.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}function Az(e){var r,s,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var u=e.length;for(r=0;rtypeof e=="boolean"?`${e}`:e===0?"0":e,nI=Oz,e2=(e,r)=>s=>{var o;if(r?.variants==null)return nI(e,s?.class,s?.className);const{variants:u,defaultVariants:h}=r,m=Object.keys(u).map(w=>{const E=s?.[w],A=h?.[w];if(E===null)return null;const k=tI(E)||tI(A);return u[w][k]}),g=s&&Object.entries(s).reduce((w,E)=>{let[A,k]=E;return k===void 0||(w[A]=k),w},{}),b=r==null||(o=r.compoundVariants)===null||o===void 0?void 0:o.reduce((w,E)=>{let{class:A,className:k,...R}=E;return Object.entries(R).every(M=>{let[I,F]=M;return Array.isArray(F)?F.includes({...h,...g}[I]):{...h,...g}[I]===F})?[...w,A,k]:w},[]);return nI(e,m,b,s?.class,s?.className)},Yte=(e,r)=>{const s=new Array(e.length+r.length);for(let o=0;o({classGroupId:e,validator:r}),kz=(e=new Map,r=null,s)=>({nextPart:e,validators:r,classGroupId:s}),zj="-",rI=[],Jte="arbitrary..",Wte=e=>{const r=ene(e),{conflictingClassGroups:s,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:m=>{if(m.startsWith("[")&&m.endsWith("]"))return Qte(m);const g=m.split(zj),b=g[0]===""&&g.length>1?1:0;return Rz(g,b,r)},getConflictingClassGroupIds:(m,g)=>{if(g){const b=o[m],w=s[m];return b?w?Yte(w,b):b:w||rI}return s[m]||rI}}},Rz=(e,r,s)=>{if(e.length-r===0)return s.classGroupId;const u=e[r],h=s.nextPart.get(u);if(h){const w=Rz(e,r+1,h);if(w)return w}const m=s.validators;if(m===null)return;const g=r===0?e.join(zj):e.slice(r).join(zj),b=m.length;for(let w=0;we.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const r=e.slice(1,-1),s=r.indexOf(":"),o=r.slice(0,s);return o?Jte+o:void 0})(),ene=e=>{const{theme:r,classGroups:s}=e;return tne(s,r)},tne=(e,r)=>{const s=kz();for(const o in e){const u=e[o];t2(u,s,o,r)}return s},t2=(e,r,s,o)=>{const u=e.length;for(let h=0;h{if(typeof e=="string"){rne(e,r,s);return}if(typeof e=="function"){sne(e,r,s,o);return}ine(e,r,s,o)},rne=(e,r,s)=>{const o=e===""?r:Tz(r,e);o.classGroupId=s},sne=(e,r,s,o)=>{if(ane(e)){t2(e(o),r,s,o);return}r.validators===null&&(r.validators=[]),r.validators.push(Zte(s,e))},ine=(e,r,s,o)=>{const u=Object.entries(e),h=u.length;for(let m=0;m{let s=e;const o=r.split(zj),u=o.length;for(let h=0;h"isThemeGetter"in e&&e.isThemeGetter===!0,one=e=>{if(e<1)return{get:()=>{},set:()=>{}};let r=0,s=Object.create(null),o=Object.create(null);const u=(h,m)=>{s[h]=m,r++,r>e&&(r=0,o=s,s=Object.create(null))};return{get(h){let m=s[h];if(m!==void 0)return m;if((m=o[h])!==void 0)return u(h,m),m},set(h,m){h in s?s[h]=m:u(h,m)}}},KT="!",sI=":",lne=[],iI=(e,r,s,o,u)=>({modifiers:e,hasImportantModifier:r,baseClassName:s,maybePostfixModifierPosition:o,isExternal:u}),cne=e=>{const{prefix:r,experimentalParseClassName:s}=e;let o=u=>{const h=[];let m=0,g=0,b=0,w;const E=u.length;for(let I=0;Ib?w-b:void 0;return iI(h,R,k,M)};if(r){const u=r+sI,h=o;o=m=>m.startsWith(u)?h(m.slice(u.length)):iI(lne,!1,m,void 0,!0)}if(s){const u=o;o=h=>s({className:h,parseClassName:u})}return o},une=e=>{const r=new Map;return e.orderSensitiveModifiers.forEach((s,o)=>{r.set(s,1e6+o)}),s=>{const o=[];let u=[];for(let h=0;h0&&(u.sort(),o.push(...u),u=[]),o.push(m)):u.push(m)}return u.length>0&&(u.sort(),o.push(...u)),o}},dne=e=>({cache:one(e.cacheSize),parseClassName:cne(e),sortModifiers:une(e),...Wte(e)}),hne=/\s+/,pne=(e,r)=>{const{parseClassName:s,getClassGroupId:o,getConflictingClassGroupIds:u,sortModifiers:h}=r,m=[],g=e.trim().split(hne);let b="";for(let w=g.length-1;w>=0;w-=1){const E=g[w],{isExternal:A,modifiers:k,hasImportantModifier:R,baseClassName:M,maybePostfixModifierPosition:I}=s(E);if(A){b=E+(b.length>0?" "+b:b);continue}let F=!!I,H=o(F?M.substring(0,I):M);if(!H){if(!F){b=E+(b.length>0?" "+b:b);continue}if(H=o(M),!H){b=E+(b.length>0?" "+b:b);continue}F=!1}const V=k.length===0?"":k.length===1?k[0]:h(k).join(":"),K=R?V+KT:V,z=K+H;if(m.indexOf(z)>-1)continue;m.push(z);const W=u(H,F);for(let ae=0;ae0?" "+b:b)}return b},fne=(...e)=>{let r=0,s,o,u="";for(;r{if(typeof e=="string")return e;let r,s="";for(let o=0;o{let s,o,u,h;const m=b=>{const w=r.reduce((E,A)=>A(E),e());return s=dne(w),o=s.cache.get,u=s.cache.set,h=g,g(b)},g=b=>{const w=o(b);if(w)return w;const E=pne(b,s);return u(b,E),E};return h=m,(...b)=>h(fne(...b))},gne=[],Es=e=>{const r=s=>s[e]||gne;return r.isThemeGetter=!0,r},$z=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Nz=/^\((?:(\w[\w-]*):)?(.+)\)$/i,yne=/^\d+\/\d+$/,vne=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,xne=/\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$/,bne=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,wne=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Sne=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Gm=e=>yne.test(e),Cn=e=>!!e&&!Number.isNaN(Number(e)),Pd=e=>!!e&&Number.isInteger(Number(e)),UR=e=>e.endsWith("%")&&Cn(e.slice(0,-1)),hu=e=>vne.test(e),Ene=()=>!0,jne=e=>xne.test(e)&&!bne.test(e),Dz=()=>!1,Cne=e=>wne.test(e),Ane=e=>Sne.test(e),One=e=>!It(e)&&!zt(e),kne=e=>_g(e,Iz,Dz),It=e=>$z.test(e),vp=e=>_g(e,zz,jne),KR=e=>_g(e,Nne,Cn),aI=e=>_g(e,Pz,Dz),Rne=e=>_g(e,Mz,Ane),ZE=e=>_g(e,Lz,Cne),zt=e=>Nz.test(e),cb=e=>$g(e,zz),Tne=e=>$g(e,Dne),oI=e=>$g(e,Pz),_ne=e=>$g(e,Iz),$ne=e=>$g(e,Mz),JE=e=>$g(e,Lz,!0),_g=(e,r,s)=>{const o=$z.exec(e);return o?o[1]?r(o[1]):s(o[2]):!1},$g=(e,r,s=!1)=>{const o=Nz.exec(e);return o?o[1]?r(o[1]):s:!1},Pz=e=>e==="position"||e==="percentage",Mz=e=>e==="image"||e==="url",Iz=e=>e==="length"||e==="size"||e==="bg-size",zz=e=>e==="length",Nne=e=>e==="number",Dne=e=>e==="family-name",Lz=e=>e==="shadow",Pne=()=>{const e=Es("color"),r=Es("font"),s=Es("text"),o=Es("font-weight"),u=Es("tracking"),h=Es("leading"),m=Es("breakpoint"),g=Es("container"),b=Es("spacing"),w=Es("radius"),E=Es("shadow"),A=Es("inset-shadow"),k=Es("text-shadow"),R=Es("drop-shadow"),M=Es("blur"),I=Es("perspective"),F=Es("aspect"),H=Es("ease"),V=Es("animate"),K=()=>["auto","avoid","all","avoid-page","page","left","right","column"],z=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],W=()=>[...z(),zt,It],ae=()=>["auto","hidden","clip","visible","scroll"],Q=()=>["auto","contain","none"],te=()=>[zt,It,b],de=()=>[Gm,"full","auto",...te()],je=()=>[Pd,"none","subgrid",zt,It],we=()=>["auto",{span:["full",Pd,zt,It]},Pd,zt,It],ie=()=>[Pd,"auto",zt,It],Se=()=>["auto","min","max","fr",zt,It],Ae=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],He=()=>["start","end","center","stretch","center-safe","end-safe"],ue=()=>["auto",...te()],ne=()=>[Gm,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...te()],ce=()=>[e,zt,It],$e=()=>[...z(),oI,aI,{position:[zt,It]}],me=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Xe=()=>["auto","cover","contain",_ne,kne,{size:[zt,It]}],Oe=()=>[UR,cb,vp],Te=()=>["","none","full",w,zt,It],Ke=()=>["",Cn,cb,vp],se=()=>["solid","dashed","dotted","double"],Ne=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Fe=()=>[Cn,UR,oI,aI],at=()=>["","none",M,zt,It],gt=()=>["none",Cn,zt,It],Ot=()=>["none",Cn,zt,It],Lt=()=>[Cn,zt,It],Rt=()=>[Gm,"full",...te()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[hu],breakpoint:[hu],color:[Ene],container:[hu],"drop-shadow":[hu],ease:["in","out","in-out"],font:[One],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[hu],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[hu],shadow:[hu],spacing:["px",Cn],text:[hu],"text-shadow":[hu],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Gm,It,zt,F]}],container:["container"],columns:[{columns:[Cn,It,zt,g]}],"break-after":[{"break-after":K()}],"break-before":[{"break-before":K()}],"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:W()}],overflow:[{overflow:ae()}],"overflow-x":[{"overflow-x":ae()}],"overflow-y":[{"overflow-y":ae()}],overscroll:[{overscroll:Q()}],"overscroll-x":[{"overscroll-x":Q()}],"overscroll-y":[{"overscroll-y":Q()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:de()}],"inset-x":[{"inset-x":de()}],"inset-y":[{"inset-y":de()}],start:[{start:de()}],end:[{end:de()}],top:[{top:de()}],right:[{right:de()}],bottom:[{bottom:de()}],left:[{left:de()}],visibility:["visible","invisible","collapse"],z:[{z:[Pd,"auto",zt,It]}],basis:[{basis:[Gm,"full","auto",g,...te()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Cn,Gm,"auto","initial","none",It]}],grow:[{grow:["",Cn,zt,It]}],shrink:[{shrink:["",Cn,zt,It]}],order:[{order:[Pd,"first","last","none",zt,It]}],"grid-cols":[{"grid-cols":je()}],"col-start-end":[{col:we()}],"col-start":[{"col-start":ie()}],"col-end":[{"col-end":ie()}],"grid-rows":[{"grid-rows":je()}],"row-start-end":[{row:we()}],"row-start":[{"row-start":ie()}],"row-end":[{"row-end":ie()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Se()}],"auto-rows":[{"auto-rows":Se()}],gap:[{gap:te()}],"gap-x":[{"gap-x":te()}],"gap-y":[{"gap-y":te()}],"justify-content":[{justify:[...Ae(),"normal"]}],"justify-items":[{"justify-items":[...He(),"normal"]}],"justify-self":[{"justify-self":["auto",...He()]}],"align-content":[{content:["normal",...Ae()]}],"align-items":[{items:[...He(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...He(),{baseline:["","last"]}]}],"place-content":[{"place-content":Ae()}],"place-items":[{"place-items":[...He(),"baseline"]}],"place-self":[{"place-self":["auto",...He()]}],p:[{p:te()}],px:[{px:te()}],py:[{py:te()}],ps:[{ps:te()}],pe:[{pe:te()}],pt:[{pt:te()}],pr:[{pr:te()}],pb:[{pb:te()}],pl:[{pl:te()}],m:[{m:ue()}],mx:[{mx:ue()}],my:[{my:ue()}],ms:[{ms:ue()}],me:[{me:ue()}],mt:[{mt:ue()}],mr:[{mr:ue()}],mb:[{mb:ue()}],ml:[{ml:ue()}],"space-x":[{"space-x":te()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":te()}],"space-y-reverse":["space-y-reverse"],size:[{size:ne()}],w:[{w:[g,"screen",...ne()]}],"min-w":[{"min-w":[g,"screen","none",...ne()]}],"max-w":[{"max-w":[g,"screen","none","prose",{screen:[m]},...ne()]}],h:[{h:["screen","lh",...ne()]}],"min-h":[{"min-h":["screen","lh","none",...ne()]}],"max-h":[{"max-h":["screen","lh",...ne()]}],"font-size":[{text:["base",s,cb,vp]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,zt,KR]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",UR,It]}],"font-family":[{font:[Tne,It,r]}],"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:[u,zt,It]}],"line-clamp":[{"line-clamp":[Cn,"none",zt,KR]}],leading:[{leading:[h,...te()]}],"list-image":[{"list-image":["none",zt,It]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",zt,It]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:ce()}],"text-color":[{text:ce()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...se(),"wavy"]}],"text-decoration-thickness":[{decoration:[Cn,"from-font","auto",zt,vp]}],"text-decoration-color":[{decoration:ce()}],"underline-offset":[{"underline-offset":[Cn,"auto",zt,It]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:te()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",zt,It]}],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",zt,It]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:$e()}],"bg-repeat":[{bg:me()}],"bg-size":[{bg:Xe()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Pd,zt,It],radial:["",zt,It],conic:[Pd,zt,It]},$ne,Rne]}],"bg-color":[{bg:ce()}],"gradient-from-pos":[{from:Oe()}],"gradient-via-pos":[{via:Oe()}],"gradient-to-pos":[{to:Oe()}],"gradient-from":[{from:ce()}],"gradient-via":[{via:ce()}],"gradient-to":[{to:ce()}],rounded:[{rounded:Te()}],"rounded-s":[{"rounded-s":Te()}],"rounded-e":[{"rounded-e":Te()}],"rounded-t":[{"rounded-t":Te()}],"rounded-r":[{"rounded-r":Te()}],"rounded-b":[{"rounded-b":Te()}],"rounded-l":[{"rounded-l":Te()}],"rounded-ss":[{"rounded-ss":Te()}],"rounded-se":[{"rounded-se":Te()}],"rounded-ee":[{"rounded-ee":Te()}],"rounded-es":[{"rounded-es":Te()}],"rounded-tl":[{"rounded-tl":Te()}],"rounded-tr":[{"rounded-tr":Te()}],"rounded-br":[{"rounded-br":Te()}],"rounded-bl":[{"rounded-bl":Te()}],"border-w":[{border:Ke()}],"border-w-x":[{"border-x":Ke()}],"border-w-y":[{"border-y":Ke()}],"border-w-s":[{"border-s":Ke()}],"border-w-e":[{"border-e":Ke()}],"border-w-t":[{"border-t":Ke()}],"border-w-r":[{"border-r":Ke()}],"border-w-b":[{"border-b":Ke()}],"border-w-l":[{"border-l":Ke()}],"divide-x":[{"divide-x":Ke()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Ke()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...se(),"hidden","none"]}],"divide-style":[{divide:[...se(),"hidden","none"]}],"border-color":[{border:ce()}],"border-color-x":[{"border-x":ce()}],"border-color-y":[{"border-y":ce()}],"border-color-s":[{"border-s":ce()}],"border-color-e":[{"border-e":ce()}],"border-color-t":[{"border-t":ce()}],"border-color-r":[{"border-r":ce()}],"border-color-b":[{"border-b":ce()}],"border-color-l":[{"border-l":ce()}],"divide-color":[{divide:ce()}],"outline-style":[{outline:[...se(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Cn,zt,It]}],"outline-w":[{outline:["",Cn,cb,vp]}],"outline-color":[{outline:ce()}],shadow:[{shadow:["","none",E,JE,ZE]}],"shadow-color":[{shadow:ce()}],"inset-shadow":[{"inset-shadow":["none",A,JE,ZE]}],"inset-shadow-color":[{"inset-shadow":ce()}],"ring-w":[{ring:Ke()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:ce()}],"ring-offset-w":[{"ring-offset":[Cn,vp]}],"ring-offset-color":[{"ring-offset":ce()}],"inset-ring-w":[{"inset-ring":Ke()}],"inset-ring-color":[{"inset-ring":ce()}],"text-shadow":[{"text-shadow":["none",k,JE,ZE]}],"text-shadow-color":[{"text-shadow":ce()}],opacity:[{opacity:[Cn,zt,It]}],"mix-blend":[{"mix-blend":[...Ne(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ne()}],"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":[Cn]}],"mask-image-linear-from-pos":[{"mask-linear-from":Fe()}],"mask-image-linear-to-pos":[{"mask-linear-to":Fe()}],"mask-image-linear-from-color":[{"mask-linear-from":ce()}],"mask-image-linear-to-color":[{"mask-linear-to":ce()}],"mask-image-t-from-pos":[{"mask-t-from":Fe()}],"mask-image-t-to-pos":[{"mask-t-to":Fe()}],"mask-image-t-from-color":[{"mask-t-from":ce()}],"mask-image-t-to-color":[{"mask-t-to":ce()}],"mask-image-r-from-pos":[{"mask-r-from":Fe()}],"mask-image-r-to-pos":[{"mask-r-to":Fe()}],"mask-image-r-from-color":[{"mask-r-from":ce()}],"mask-image-r-to-color":[{"mask-r-to":ce()}],"mask-image-b-from-pos":[{"mask-b-from":Fe()}],"mask-image-b-to-pos":[{"mask-b-to":Fe()}],"mask-image-b-from-color":[{"mask-b-from":ce()}],"mask-image-b-to-color":[{"mask-b-to":ce()}],"mask-image-l-from-pos":[{"mask-l-from":Fe()}],"mask-image-l-to-pos":[{"mask-l-to":Fe()}],"mask-image-l-from-color":[{"mask-l-from":ce()}],"mask-image-l-to-color":[{"mask-l-to":ce()}],"mask-image-x-from-pos":[{"mask-x-from":Fe()}],"mask-image-x-to-pos":[{"mask-x-to":Fe()}],"mask-image-x-from-color":[{"mask-x-from":ce()}],"mask-image-x-to-color":[{"mask-x-to":ce()}],"mask-image-y-from-pos":[{"mask-y-from":Fe()}],"mask-image-y-to-pos":[{"mask-y-to":Fe()}],"mask-image-y-from-color":[{"mask-y-from":ce()}],"mask-image-y-to-color":[{"mask-y-to":ce()}],"mask-image-radial":[{"mask-radial":[zt,It]}],"mask-image-radial-from-pos":[{"mask-radial-from":Fe()}],"mask-image-radial-to-pos":[{"mask-radial-to":Fe()}],"mask-image-radial-from-color":[{"mask-radial-from":ce()}],"mask-image-radial-to-color":[{"mask-radial-to":ce()}],"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":z()}],"mask-image-conic-pos":[{"mask-conic":[Cn]}],"mask-image-conic-from-pos":[{"mask-conic-from":Fe()}],"mask-image-conic-to-pos":[{"mask-conic-to":Fe()}],"mask-image-conic-from-color":[{"mask-conic-from":ce()}],"mask-image-conic-to-color":[{"mask-conic-to":ce()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:$e()}],"mask-repeat":[{mask:me()}],"mask-size":[{mask:Xe()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",zt,It]}],filter:[{filter:["","none",zt,It]}],blur:[{blur:at()}],brightness:[{brightness:[Cn,zt,It]}],contrast:[{contrast:[Cn,zt,It]}],"drop-shadow":[{"drop-shadow":["","none",R,JE,ZE]}],"drop-shadow-color":[{"drop-shadow":ce()}],grayscale:[{grayscale:["",Cn,zt,It]}],"hue-rotate":[{"hue-rotate":[Cn,zt,It]}],invert:[{invert:["",Cn,zt,It]}],saturate:[{saturate:[Cn,zt,It]}],sepia:[{sepia:["",Cn,zt,It]}],"backdrop-filter":[{"backdrop-filter":["","none",zt,It]}],"backdrop-blur":[{"backdrop-blur":at()}],"backdrop-brightness":[{"backdrop-brightness":[Cn,zt,It]}],"backdrop-contrast":[{"backdrop-contrast":[Cn,zt,It]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Cn,zt,It]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Cn,zt,It]}],"backdrop-invert":[{"backdrop-invert":["",Cn,zt,It]}],"backdrop-opacity":[{"backdrop-opacity":[Cn,zt,It]}],"backdrop-saturate":[{"backdrop-saturate":[Cn,zt,It]}],"backdrop-sepia":[{"backdrop-sepia":["",Cn,zt,It]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":te()}],"border-spacing-x":[{"border-spacing-x":te()}],"border-spacing-y":[{"border-spacing-y":te()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",zt,It]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Cn,"initial",zt,It]}],ease:[{ease:["linear","initial",H,zt,It]}],delay:[{delay:[Cn,zt,It]}],animate:[{animate:["none",V,zt,It]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[I,zt,It]}],"perspective-origin":[{"perspective-origin":W()}],rotate:[{rotate:gt()}],"rotate-x":[{"rotate-x":gt()}],"rotate-y":[{"rotate-y":gt()}],"rotate-z":[{"rotate-z":gt()}],scale:[{scale:Ot()}],"scale-x":[{"scale-x":Ot()}],"scale-y":[{"scale-y":Ot()}],"scale-z":[{"scale-z":Ot()}],"scale-3d":["scale-3d"],skew:[{skew:Lt()}],"skew-x":[{"skew-x":Lt()}],"skew-y":[{"skew-y":Lt()}],transform:[{transform:[zt,It,"","none","gpu","cpu"]}],"transform-origin":[{origin:W()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Rt()}],"translate-x":[{"translate-x":Rt()}],"translate-y":[{"translate-y":Rt()}],"translate-z":[{"translate-z":Rt()}],"translate-none":["translate-none"],accent:[{accent:ce()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:ce()}],"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",zt,It]}],"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":te()}],"scroll-mx":[{"scroll-mx":te()}],"scroll-my":[{"scroll-my":te()}],"scroll-ms":[{"scroll-ms":te()}],"scroll-me":[{"scroll-me":te()}],"scroll-mt":[{"scroll-mt":te()}],"scroll-mr":[{"scroll-mr":te()}],"scroll-mb":[{"scroll-mb":te()}],"scroll-ml":[{"scroll-ml":te()}],"scroll-p":[{"scroll-p":te()}],"scroll-px":[{"scroll-px":te()}],"scroll-py":[{"scroll-py":te()}],"scroll-ps":[{"scroll-ps":te()}],"scroll-pe":[{"scroll-pe":te()}],"scroll-pt":[{"scroll-pt":te()}],"scroll-pr":[{"scroll-pr":te()}],"scroll-pb":[{"scroll-pb":te()}],"scroll-pl":[{"scroll-pl":te()}],"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",zt,It]}],fill:[{fill:["none",...ce()]}],"stroke-w":[{stroke:[Cn,cb,vp,KR]}],stroke:[{stroke:["none",...ce()]}],"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"]}},Mne=mne(Pne);function vt(...e){return Mne(Oz(e))}function za(e,r=24){return!e||e.length<=r*2+3?e:`${e.slice(0,r)}…${e.slice(-r)}`}const Ine=e2("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 rr({className:e,variant:r,asChild:s=!1,...o}){const u=s?Tg:"span";return c.jsx(u,{"data-slot":"badge",className:vt(Ine({variant:r}),e),...o})}const n2=e2("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 Pe({className:e,variant:r,size:s,asChild:o=!1,...u}){const h=o?Tg:"button";return c.jsx(h,{"data-slot":"button",className:vt(n2({variant:r,size:s,className:e})),...u})}var zne=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Lne=zne.reduce((e,r)=>{const s=iw(`Primitive.${r}`),o=T.forwardRef((u,h)=>{const{asChild:m,...g}=u,b=m?s:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(b,{...g,ref:h})});return o.displayName=`Primitive.${r}`,{...e,[r]:o}},{}),Fne="Separator",lI="horizontal",qne=["horizontal","vertical"],Fz=T.forwardRef((e,r)=>{const{decorative:s,orientation:o=lI,...u}=e,h=Bne(o)?o:lI,g=s?{role:"none"}:{"aria-orientation":h==="vertical"?h:void 0,role:"separator"};return c.jsx(Lne.div,{"data-orientation":h,...g,...u,ref:r})});Fz.displayName=Fne;function Bne(e){return qne.includes(e)}var Une=Fz;function Ab({className:e,orientation:r="horizontal",decorative:s=!0,...o}){return c.jsx(Une,{"data-slot":"separator",decorative:s,orientation:r,className:vt("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),...o})}function Nt(e,r,{checkForDefaultPrevented:s=!0}={}){return function(u){if(e?.(u),s===!1||!u.defaultPrevented)return r?.(u)}}function Kne(e,r){const s=T.createContext(r),o=h=>{const{children:m,...g}=h,b=T.useMemo(()=>g,Object.values(g));return c.jsx(s.Provider,{value:b,children:m})};o.displayName=e+"Provider";function u(h){const m=T.useContext(s);if(m)return m;if(r!==void 0)return r;throw new Error(`\`${h}\` must be used within \`${e}\``)}return[o,u]}function cl(e,r=[]){let s=[];function o(h,m){const g=T.createContext(m),b=s.length;s=[...s,m];const w=A=>{const{scope:k,children:R,...M}=A,I=k?.[e]?.[b]||g,F=T.useMemo(()=>M,Object.values(M));return c.jsx(I.Provider,{value:F,children:R})};w.displayName=h+"Provider";function E(A,k){const R=k?.[e]?.[b]||g,M=T.useContext(R);if(M)return M;if(m!==void 0)return m;throw new Error(`\`${A}\` must be used within \`${h}\``)}return[w,E]}const u=()=>{const h=s.map(m=>T.createContext(m));return function(g){const b=g?.[e]||h;return T.useMemo(()=>({[`__scope${e}`]:{...g,[e]:b}}),[g,b])}};return u.scopeName=e,[o,Vne(u,...r)]}function Vne(...e){const r=e[0];if(e.length===1)return r;const s=()=>{const o=e.map(u=>({useScope:u(),scopeName:u.scopeName}));return function(h){const m=o.reduce((g,{useScope:b,scopeName:w})=>{const A=b(h)[`__scope${w}`];return{...g,...A}},{});return T.useMemo(()=>({[`__scope${r.scopeName}`]:m}),[m])}};return s.scopeName=r.scopeName,s}function Hne(e){const r=Gne(e),s=T.forwardRef((o,u)=>{const{children:h,...m}=o,g=T.Children.toArray(h),b=g.find(Yne);if(b){const w=b.props.children,E=g.map(A=>A===b?T.Children.count(w)>1?T.Children.only(null):T.isValidElement(w)?w.props.children:null:A);return c.jsx(r,{...m,ref:u,children:T.isValidElement(w)?T.cloneElement(w,void 0,E):null})}return c.jsx(r,{...m,ref:u,children:h})});return s.displayName=`${e}.Slot`,s}function Gne(e){const r=T.forwardRef((s,o)=>{const{children:u,...h}=s;if(T.isValidElement(u)){const m=Jne(u),g=Zne(h,u.props);return u.type!==T.Fragment&&(g.ref=o?Gi(o,m):m),T.cloneElement(u,g)}return T.Children.count(u)>1?T.Children.only(null):null});return r.displayName=`${e}.SlotClone`,r}var Xne=Symbol("radix.slottable");function Yne(e){return T.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Xne}function Zne(e,r){const s={...r};for(const o in r){const u=e[o],h=r[o];/^on[A-Z]/.test(o)?u&&h?s[o]=(...g)=>{const b=h(...g);return u(...g),b}:u&&(s[o]=u):o==="style"?s[o]={...u,...h}:o==="className"&&(s[o]=[u,h].filter(Boolean).join(" "))}return{...e,...s}}function Jne(e){let r=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=r&&"isReactWarning"in r&&r.isReactWarning;return s?e.ref:(r=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=r&&"isReactWarning"in r&&r.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}var Wne=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],An=Wne.reduce((e,r)=>{const s=Hne(`Primitive.${r}`),o=T.forwardRef((u,h)=>{const{asChild:m,...g}=u,b=m?s:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(b,{...g,ref:h})});return o.displayName=`Primitive.${r}`,{...e,[r]:o}},{});function qz(e,r){e&&SC.flushSync(()=>e.dispatchEvent(r))}function sl(e){const r=T.useRef(e);return T.useEffect(()=>{r.current=e}),T.useMemo(()=>(...s)=>r.current?.(...s),[])}function Qne(e,r=globalThis?.document){const s=sl(e);T.useEffect(()=>{const o=u=>{u.key==="Escape"&&s(u)};return r.addEventListener("keydown",o,{capture:!0}),()=>r.removeEventListener("keydown",o,{capture:!0})},[s,r])}var ere="DismissableLayer",VT="dismissableLayer.update",tre="dismissableLayer.pointerDownOutside",nre="dismissableLayer.focusOutside",cI,Bz=T.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ng=T.forwardRef((e,r)=>{const{disableOutsidePointerEvents:s=!1,onEscapeKeyDown:o,onPointerDownOutside:u,onFocusOutside:h,onInteractOutside:m,onDismiss:g,...b}=e,w=T.useContext(Bz),[E,A]=T.useState(null),k=E?.ownerDocument??globalThis?.document,[,R]=T.useState({}),M=Ln(r,Q=>A(Q)),I=Array.from(w.layers),[F]=[...w.layersWithOutsidePointerEventsDisabled].slice(-1),H=I.indexOf(F),V=E?I.indexOf(E):-1,K=w.layersWithOutsidePointerEventsDisabled.size>0,z=V>=H,W=ire(Q=>{const te=Q.target,de=[...w.branches].some(je=>je.contains(te));!z||de||(u?.(Q),m?.(Q),Q.defaultPrevented||g?.())},k),ae=are(Q=>{const te=Q.target;[...w.branches].some(je=>je.contains(te))||(h?.(Q),m?.(Q),Q.defaultPrevented||g?.())},k);return Qne(Q=>{V===w.layers.size-1&&(o?.(Q),!Q.defaultPrevented&&g&&(Q.preventDefault(),g()))},k),T.useEffect(()=>{if(E)return s&&(w.layersWithOutsidePointerEventsDisabled.size===0&&(cI=k.body.style.pointerEvents,k.body.style.pointerEvents="none"),w.layersWithOutsidePointerEventsDisabled.add(E)),w.layers.add(E),uI(),()=>{s&&w.layersWithOutsidePointerEventsDisabled.size===1&&(k.body.style.pointerEvents=cI)}},[E,k,s,w]),T.useEffect(()=>()=>{E&&(w.layers.delete(E),w.layersWithOutsidePointerEventsDisabled.delete(E),uI())},[E,w]),T.useEffect(()=>{const Q=()=>R({});return document.addEventListener(VT,Q),()=>document.removeEventListener(VT,Q)},[]),c.jsx(An.div,{...b,ref:M,style:{pointerEvents:K?z?"auto":"none":void 0,...e.style},onFocusCapture:Nt(e.onFocusCapture,ae.onFocusCapture),onBlurCapture:Nt(e.onBlurCapture,ae.onBlurCapture),onPointerDownCapture:Nt(e.onPointerDownCapture,W.onPointerDownCapture)})});Ng.displayName=ere;var rre="DismissableLayerBranch",sre=T.forwardRef((e,r)=>{const s=T.useContext(Bz),o=T.useRef(null),u=Ln(r,o);return T.useEffect(()=>{const h=o.current;if(h)return s.branches.add(h),()=>{s.branches.delete(h)}},[s.branches]),c.jsx(An.div,{...e,ref:u})});sre.displayName=rre;function ire(e,r=globalThis?.document){const s=sl(e),o=T.useRef(!1),u=T.useRef(()=>{});return T.useEffect(()=>{const h=g=>{if(g.target&&!o.current){let b=function(){Uz(tre,s,w,{discrete:!0})};const w={originalEvent:g};g.pointerType==="touch"?(r.removeEventListener("click",u.current),u.current=b,r.addEventListener("click",u.current,{once:!0})):b()}else r.removeEventListener("click",u.current);o.current=!1},m=window.setTimeout(()=>{r.addEventListener("pointerdown",h)},0);return()=>{window.clearTimeout(m),r.removeEventListener("pointerdown",h),r.removeEventListener("click",u.current)}},[r,s]),{onPointerDownCapture:()=>o.current=!0}}function are(e,r=globalThis?.document){const s=sl(e),o=T.useRef(!1);return T.useEffect(()=>{const u=h=>{h.target&&!o.current&&Uz(nre,s,{originalEvent:h},{discrete:!1})};return r.addEventListener("focusin",u),()=>r.removeEventListener("focusin",u)},[r,s]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function uI(){const e=new CustomEvent(VT);document.dispatchEvent(e)}function Uz(e,r,s,{discrete:o}){const u=s.originalEvent.target,h=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:s});r&&u.addEventListener(e,r,{once:!0}),o?qz(u,h):u.dispatchEvent(h)}var Os=globalThis?.document?T.useLayoutEffect:()=>{},ore=q_[" useId ".trim().toString()]||(()=>{}),lre=0;function Ys(e){const[r,s]=T.useState(ore());return Os(()=>{s(o=>o??String(lre++))},[e]),r?`radix-${r}`:""}const cre=["top","right","bottom","left"],Bd=Math.min,Ma=Math.max,Lj=Math.round,WE=Math.floor,oc=e=>({x:e,y:e}),ure={left:"right",right:"left",bottom:"top",top:"bottom"},dre={start:"end",end:"start"};function HT(e,r,s){return Ma(e,Bd(r,s))}function gu(e,r){return typeof e=="function"?e(r):e}function yu(e){return e.split("-")[0]}function Dg(e){return e.split("-")[1]}function r2(e){return e==="x"?"y":"x"}function s2(e){return e==="y"?"height":"width"}const hre=new Set(["top","bottom"]);function ac(e){return hre.has(yu(e))?"y":"x"}function i2(e){return r2(ac(e))}function pre(e,r,s){s===void 0&&(s=!1);const o=Dg(e),u=i2(e),h=s2(u);let m=u==="x"?o===(s?"end":"start")?"right":"left":o==="start"?"bottom":"top";return r.reference[h]>r.floating[h]&&(m=Fj(m)),[m,Fj(m)]}function fre(e){const r=Fj(e);return[GT(e),r,GT(r)]}function GT(e){return e.replace(/start|end/g,r=>dre[r])}const dI=["left","right"],hI=["right","left"],mre=["top","bottom"],gre=["bottom","top"];function yre(e,r,s){switch(e){case"top":case"bottom":return s?r?hI:dI:r?dI:hI;case"left":case"right":return r?mre:gre;default:return[]}}function vre(e,r,s,o){const u=Dg(e);let h=yre(yu(e),s==="start",o);return u&&(h=h.map(m=>m+"-"+u),r&&(h=h.concat(h.map(GT)))),h}function Fj(e){return e.replace(/left|right|bottom|top/g,r=>ure[r])}function xre(e){return{top:0,right:0,bottom:0,left:0,...e}}function Kz(e){return typeof e!="number"?xre(e):{top:e,right:e,bottom:e,left:e}}function qj(e){const{x:r,y:s,width:o,height:u}=e;return{width:o,height:u,top:s,left:r,right:r+o,bottom:s+u,x:r,y:s}}function pI(e,r,s){let{reference:o,floating:u}=e;const h=ac(r),m=i2(r),g=s2(m),b=yu(r),w=h==="y",E=o.x+o.width/2-u.width/2,A=o.y+o.height/2-u.height/2,k=o[g]/2-u[g]/2;let R;switch(b){case"top":R={x:E,y:o.y-u.height};break;case"bottom":R={x:E,y:o.y+o.height};break;case"right":R={x:o.x+o.width,y:A};break;case"left":R={x:o.x-u.width,y:A};break;default:R={x:o.x,y:o.y}}switch(Dg(r)){case"start":R[m]-=k*(s&&w?-1:1);break;case"end":R[m]+=k*(s&&w?-1:1);break}return R}const bre=async(e,r,s)=>{const{placement:o="bottom",strategy:u="absolute",middleware:h=[],platform:m}=s,g=h.filter(Boolean),b=await(m.isRTL==null?void 0:m.isRTL(r));let w=await m.getElementRects({reference:e,floating:r,strategy:u}),{x:E,y:A}=pI(w,o,b),k=o,R={},M=0;for(let I=0;I({name:"arrow",options:e,async fn(r){const{x:s,y:o,placement:u,rects:h,platform:m,elements:g,middlewareData:b}=r,{element:w,padding:E=0}=gu(e,r)||{};if(w==null)return{};const A=Kz(E),k={x:s,y:o},R=i2(u),M=s2(R),I=await m.getDimensions(w),F=R==="y",H=F?"top":"left",V=F?"bottom":"right",K=F?"clientHeight":"clientWidth",z=h.reference[M]+h.reference[R]-k[R]-h.floating[M],W=k[R]-h.reference[R],ae=await(m.getOffsetParent==null?void 0:m.getOffsetParent(w));let Q=ae?ae[K]:0;(!Q||!await(m.isElement==null?void 0:m.isElement(ae)))&&(Q=g.floating[K]||h.floating[M]);const te=z/2-W/2,de=Q/2-I[M]/2-1,je=Bd(A[H],de),we=Bd(A[V],de),ie=je,Se=Q-I[M]-we,Ae=Q/2-I[M]/2+te,He=HT(ie,Ae,Se),ue=!b.arrow&&Dg(u)!=null&&Ae!==He&&h.reference[M]/2-(AeAe<=0)){var we,ie;const Ae=(((we=h.flip)==null?void 0:we.index)||0)+1,He=Q[Ae];if(He&&(!(A==="alignment"?V!==ac(He):!1)||je.every(ce=>ac(ce.placement)===V?ce.overflows[0]>0:!0)))return{data:{index:Ae,overflows:je},reset:{placement:He}};let ue=(ie=je.filter(ne=>ne.overflows[0]<=0).sort((ne,ce)=>ne.overflows[1]-ce.overflows[1])[0])==null?void 0:ie.placement;if(!ue)switch(R){case"bestFit":{var Se;const ne=(Se=je.filter(ce=>{if(ae){const $e=ac(ce.placement);return $e===V||$e==="y"}return!0}).map(ce=>[ce.placement,ce.overflows.filter($e=>$e>0).reduce(($e,me)=>$e+me,0)]).sort((ce,$e)=>ce[1]-$e[1])[0])==null?void 0:Se[0];ne&&(ue=ne);break}case"initialPlacement":ue=g;break}if(u!==ue)return{reset:{placement:ue}}}return{}}}};function fI(e,r){return{top:e.top-r.height,right:e.right-r.width,bottom:e.bottom-r.height,left:e.left-r.width}}function mI(e){return cre.some(r=>e[r]>=0)}const Ere=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(r){const{rects:s}=r,{strategy:o="referenceHidden",...u}=gu(e,r);switch(o){case"referenceHidden":{const h=await Vb(r,{...u,elementContext:"reference"}),m=fI(h,s.reference);return{data:{referenceHiddenOffsets:m,referenceHidden:mI(m)}}}case"escaped":{const h=await Vb(r,{...u,altBoundary:!0}),m=fI(h,s.floating);return{data:{escapedOffsets:m,escaped:mI(m)}}}default:return{}}}}},Vz=new Set(["left","top"]);async function jre(e,r){const{placement:s,platform:o,elements:u}=e,h=await(o.isRTL==null?void 0:o.isRTL(u.floating)),m=yu(s),g=Dg(s),b=ac(s)==="y",w=Vz.has(m)?-1:1,E=h&&b?-1:1,A=gu(r,e);let{mainAxis:k,crossAxis:R,alignmentAxis:M}=typeof A=="number"?{mainAxis:A,crossAxis:0,alignmentAxis:null}:{mainAxis:A.mainAxis||0,crossAxis:A.crossAxis||0,alignmentAxis:A.alignmentAxis};return g&&typeof M=="number"&&(R=g==="end"?M*-1:M),b?{x:R*E,y:k*w}:{x:k*w,y:R*E}}const Cre=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(r){var s,o;const{x:u,y:h,placement:m,middlewareData:g}=r,b=await jre(r,e);return m===((s=g.offset)==null?void 0:s.placement)&&(o=g.arrow)!=null&&o.alignmentOffset?{}:{x:u+b.x,y:h+b.y,data:{...b,placement:m}}}}},Are=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(r){const{x:s,y:o,placement:u}=r,{mainAxis:h=!0,crossAxis:m=!1,limiter:g={fn:F=>{let{x:H,y:V}=F;return{x:H,y:V}}},...b}=gu(e,r),w={x:s,y:o},E=await Vb(r,b),A=ac(yu(u)),k=r2(A);let R=w[k],M=w[A];if(h){const F=k==="y"?"top":"left",H=k==="y"?"bottom":"right",V=R+E[F],K=R-E[H];R=HT(V,R,K)}if(m){const F=A==="y"?"top":"left",H=A==="y"?"bottom":"right",V=M+E[F],K=M-E[H];M=HT(V,M,K)}const I=g.fn({...r,[k]:R,[A]:M});return{...I,data:{x:I.x-s,y:I.y-o,enabled:{[k]:h,[A]:m}}}}}},Ore=function(e){return e===void 0&&(e={}),{options:e,fn(r){const{x:s,y:o,placement:u,rects:h,middlewareData:m}=r,{offset:g=0,mainAxis:b=!0,crossAxis:w=!0}=gu(e,r),E={x:s,y:o},A=ac(u),k=r2(A);let R=E[k],M=E[A];const I=gu(g,r),F=typeof I=="number"?{mainAxis:I,crossAxis:0}:{mainAxis:0,crossAxis:0,...I};if(b){const K=k==="y"?"height":"width",z=h.reference[k]-h.floating[K]+F.mainAxis,W=h.reference[k]+h.reference[K]-F.mainAxis;RW&&(R=W)}if(w){var H,V;const K=k==="y"?"width":"height",z=Vz.has(yu(u)),W=h.reference[A]-h.floating[K]+(z&&((H=m.offset)==null?void 0:H[A])||0)+(z?0:F.crossAxis),ae=h.reference[A]+h.reference[K]+(z?0:((V=m.offset)==null?void 0:V[A])||0)-(z?F.crossAxis:0);Mae&&(M=ae)}return{[k]:R,[A]:M}}}},kre=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(r){var s,o;const{placement:u,rects:h,platform:m,elements:g}=r,{apply:b=()=>{},...w}=gu(e,r),E=await Vb(r,w),A=yu(u),k=Dg(u),R=ac(u)==="y",{width:M,height:I}=h.floating;let F,H;A==="top"||A==="bottom"?(F=A,H=k===(await(m.isRTL==null?void 0:m.isRTL(g.floating))?"start":"end")?"left":"right"):(H=A,F=k==="end"?"top":"bottom");const V=I-E.top-E.bottom,K=M-E.left-E.right,z=Bd(I-E[F],V),W=Bd(M-E[H],K),ae=!r.middlewareData.shift;let Q=z,te=W;if((s=r.middlewareData.shift)!=null&&s.enabled.x&&(te=K),(o=r.middlewareData.shift)!=null&&o.enabled.y&&(Q=V),ae&&!k){const je=Ma(E.left,0),we=Ma(E.right,0),ie=Ma(E.top,0),Se=Ma(E.bottom,0);R?te=M-2*(je!==0||we!==0?je+we:Ma(E.left,E.right)):Q=I-2*(ie!==0||Se!==0?ie+Se:Ma(E.top,E.bottom))}await b({...r,availableWidth:te,availableHeight:Q});const de=await m.getDimensions(g.floating);return M!==de.width||I!==de.height?{reset:{rects:!0}}:{}}}};function AC(){return typeof window<"u"}function Pg(e){return Hz(e)?(e.nodeName||"").toLowerCase():"#document"}function La(e){var r;return(e==null||(r=e.ownerDocument)==null?void 0:r.defaultView)||window}function hc(e){var r;return(r=(Hz(e)?e.ownerDocument:e.document)||window.document)==null?void 0:r.documentElement}function Hz(e){return AC()?e instanceof Node||e instanceof La(e).Node:!1}function il(e){return AC()?e instanceof Element||e instanceof La(e).Element:!1}function dc(e){return AC()?e instanceof HTMLElement||e instanceof La(e).HTMLElement:!1}function gI(e){return!AC()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof La(e).ShadowRoot}const Rre=new Set(["inline","contents"]);function aw(e){const{overflow:r,overflowX:s,overflowY:o,display:u}=al(e);return/auto|scroll|overlay|hidden|clip/.test(r+o+s)&&!Rre.has(u)}const Tre=new Set(["table","td","th"]);function _re(e){return Tre.has(Pg(e))}const $re=[":popover-open",":modal"];function OC(e){return $re.some(r=>{try{return e.matches(r)}catch{return!1}})}const Nre=["transform","translate","scale","rotate","perspective"],Dre=["transform","translate","scale","rotate","perspective","filter"],Pre=["paint","layout","strict","content"];function a2(e){const r=o2(),s=il(e)?al(e):e;return Nre.some(o=>s[o]?s[o]!=="none":!1)||(s.containerType?s.containerType!=="normal":!1)||!r&&(s.backdropFilter?s.backdropFilter!=="none":!1)||!r&&(s.filter?s.filter!=="none":!1)||Dre.some(o=>(s.willChange||"").includes(o))||Pre.some(o=>(s.contain||"").includes(o))}function Mre(e){let r=Ud(e);for(;dc(r)&&!Sg(r);){if(a2(r))return r;if(OC(r))return null;r=Ud(r)}return null}function o2(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Ire=new Set(["html","body","#document"]);function Sg(e){return Ire.has(Pg(e))}function al(e){return La(e).getComputedStyle(e)}function kC(e){return il(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ud(e){if(Pg(e)==="html")return e;const r=e.assignedSlot||e.parentNode||gI(e)&&e.host||hc(e);return gI(r)?r.host:r}function Gz(e){const r=Ud(e);return Sg(r)?e.ownerDocument?e.ownerDocument.body:e.body:dc(r)&&aw(r)?r:Gz(r)}function Hb(e,r,s){var o;r===void 0&&(r=[]),s===void 0&&(s=!0);const u=Gz(e),h=u===((o=e.ownerDocument)==null?void 0:o.body),m=La(u);if(h){const g=XT(m);return r.concat(m,m.visualViewport||[],aw(u)?u:[],g&&s?Hb(g):[])}return r.concat(u,Hb(u,[],s))}function XT(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Xz(e){const r=al(e);let s=parseFloat(r.width)||0,o=parseFloat(r.height)||0;const u=dc(e),h=u?e.offsetWidth:s,m=u?e.offsetHeight:o,g=Lj(s)!==h||Lj(o)!==m;return g&&(s=h,o=m),{width:s,height:o,$:g}}function l2(e){return il(e)?e:e.contextElement}function gg(e){const r=l2(e);if(!dc(r))return oc(1);const s=r.getBoundingClientRect(),{width:o,height:u,$:h}=Xz(r);let m=(h?Lj(s.width):s.width)/o,g=(h?Lj(s.height):s.height)/u;return(!m||!Number.isFinite(m))&&(m=1),(!g||!Number.isFinite(g))&&(g=1),{x:m,y:g}}const zre=oc(0);function Yz(e){const r=La(e);return!o2()||!r.visualViewport?zre:{x:r.visualViewport.offsetLeft,y:r.visualViewport.offsetTop}}function Lre(e,r,s){return r===void 0&&(r=!1),!s||r&&s!==La(e)?!1:r}function _p(e,r,s,o){r===void 0&&(r=!1),s===void 0&&(s=!1);const u=e.getBoundingClientRect(),h=l2(e);let m=oc(1);r&&(o?il(o)&&(m=gg(o)):m=gg(e));const g=Lre(h,s,o)?Yz(h):oc(0);let b=(u.left+g.x)/m.x,w=(u.top+g.y)/m.y,E=u.width/m.x,A=u.height/m.y;if(h){const k=La(h),R=o&&il(o)?La(o):o;let M=k,I=XT(M);for(;I&&o&&R!==M;){const F=gg(I),H=I.getBoundingClientRect(),V=al(I),K=H.left+(I.clientLeft+parseFloat(V.paddingLeft))*F.x,z=H.top+(I.clientTop+parseFloat(V.paddingTop))*F.y;b*=F.x,w*=F.y,E*=F.x,A*=F.y,b+=K,w+=z,M=La(I),I=XT(M)}}return qj({width:E,height:A,x:b,y:w})}function RC(e,r){const s=kC(e).scrollLeft;return r?r.left+s:_p(hc(e)).left+s}function Zz(e,r){const s=e.getBoundingClientRect(),o=s.left+r.scrollLeft-RC(e,s),u=s.top+r.scrollTop;return{x:o,y:u}}function Fre(e){let{elements:r,rect:s,offsetParent:o,strategy:u}=e;const h=u==="fixed",m=hc(o),g=r?OC(r.floating):!1;if(o===m||g&&h)return s;let b={scrollLeft:0,scrollTop:0},w=oc(1);const E=oc(0),A=dc(o);if((A||!A&&!h)&&((Pg(o)!=="body"||aw(m))&&(b=kC(o)),dc(o))){const R=_p(o);w=gg(o),E.x=R.x+o.clientLeft,E.y=R.y+o.clientTop}const k=m&&!A&&!h?Zz(m,b):oc(0);return{width:s.width*w.x,height:s.height*w.y,x:s.x*w.x-b.scrollLeft*w.x+E.x+k.x,y:s.y*w.y-b.scrollTop*w.y+E.y+k.y}}function qre(e){return Array.from(e.getClientRects())}function Bre(e){const r=hc(e),s=kC(e),o=e.ownerDocument.body,u=Ma(r.scrollWidth,r.clientWidth,o.scrollWidth,o.clientWidth),h=Ma(r.scrollHeight,r.clientHeight,o.scrollHeight,o.clientHeight);let m=-s.scrollLeft+RC(e);const g=-s.scrollTop;return al(o).direction==="rtl"&&(m+=Ma(r.clientWidth,o.clientWidth)-u),{width:u,height:h,x:m,y:g}}const yI=25;function Ure(e,r){const s=La(e),o=hc(e),u=s.visualViewport;let h=o.clientWidth,m=o.clientHeight,g=0,b=0;if(u){h=u.width,m=u.height;const E=o2();(!E||E&&r==="fixed")&&(g=u.offsetLeft,b=u.offsetTop)}const w=RC(o);if(w<=0){const E=o.ownerDocument,A=E.body,k=getComputedStyle(A),R=E.compatMode==="CSS1Compat"&&parseFloat(k.marginLeft)+parseFloat(k.marginRight)||0,M=Math.abs(o.clientWidth-A.clientWidth-R);M<=yI&&(h-=M)}else w<=yI&&(h+=w);return{width:h,height:m,x:g,y:b}}const Kre=new Set(["absolute","fixed"]);function Vre(e,r){const s=_p(e,!0,r==="fixed"),o=s.top+e.clientTop,u=s.left+e.clientLeft,h=dc(e)?gg(e):oc(1),m=e.clientWidth*h.x,g=e.clientHeight*h.y,b=u*h.x,w=o*h.y;return{width:m,height:g,x:b,y:w}}function vI(e,r,s){let o;if(r==="viewport")o=Ure(e,s);else if(r==="document")o=Bre(hc(e));else if(il(r))o=Vre(r,s);else{const u=Yz(e);o={x:r.x-u.x,y:r.y-u.y,width:r.width,height:r.height}}return qj(o)}function Jz(e,r){const s=Ud(e);return s===r||!il(s)||Sg(s)?!1:al(s).position==="fixed"||Jz(s,r)}function Hre(e,r){const s=r.get(e);if(s)return s;let o=Hb(e,[],!1).filter(g=>il(g)&&Pg(g)!=="body"),u=null;const h=al(e).position==="fixed";let m=h?Ud(e):e;for(;il(m)&&!Sg(m);){const g=al(m),b=a2(m);!b&&g.position==="fixed"&&(u=null),(h?!b&&!u:!b&&g.position==="static"&&!!u&&Kre.has(u.position)||aw(m)&&!b&&Jz(e,m))?o=o.filter(E=>E!==m):u=g,m=Ud(m)}return r.set(e,o),o}function Gre(e){let{element:r,boundary:s,rootBoundary:o,strategy:u}=e;const m=[...s==="clippingAncestors"?OC(r)?[]:Hre(r,this._c):[].concat(s),o],g=m[0],b=m.reduce((w,E)=>{const A=vI(r,E,u);return w.top=Ma(A.top,w.top),w.right=Bd(A.right,w.right),w.bottom=Bd(A.bottom,w.bottom),w.left=Ma(A.left,w.left),w},vI(r,g,u));return{width:b.right-b.left,height:b.bottom-b.top,x:b.left,y:b.top}}function Xre(e){const{width:r,height:s}=Xz(e);return{width:r,height:s}}function Yre(e,r,s){const o=dc(r),u=hc(r),h=s==="fixed",m=_p(e,!0,h,r);let g={scrollLeft:0,scrollTop:0};const b=oc(0);function w(){b.x=RC(u)}if(o||!o&&!h)if((Pg(r)!=="body"||aw(u))&&(g=kC(r)),o){const R=_p(r,!0,h,r);b.x=R.x+r.clientLeft,b.y=R.y+r.clientTop}else u&&w();h&&!o&&u&&w();const E=u&&!o&&!h?Zz(u,g):oc(0),A=m.left+g.scrollLeft-b.x-E.x,k=m.top+g.scrollTop-b.y-E.y;return{x:A,y:k,width:m.width,height:m.height}}function VR(e){return al(e).position==="static"}function xI(e,r){if(!dc(e)||al(e).position==="fixed")return null;if(r)return r(e);let s=e.offsetParent;return hc(e)===s&&(s=s.ownerDocument.body),s}function Wz(e,r){const s=La(e);if(OC(e))return s;if(!dc(e)){let u=Ud(e);for(;u&&!Sg(u);){if(il(u)&&!VR(u))return u;u=Ud(u)}return s}let o=xI(e,r);for(;o&&_re(o)&&VR(o);)o=xI(o,r);return o&&Sg(o)&&VR(o)&&!a2(o)?s:o||Mre(e)||s}const Zre=async function(e){const r=this.getOffsetParent||Wz,s=this.getDimensions,o=await s(e.floating);return{reference:Yre(e.reference,await r(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Jre(e){return al(e).direction==="rtl"}const Wre={convertOffsetParentRelativeRectToViewportRelativeRect:Fre,getDocumentElement:hc,getClippingRect:Gre,getOffsetParent:Wz,getElementRects:Zre,getClientRects:qre,getDimensions:Xre,getScale:gg,isElement:il,isRTL:Jre};function Qz(e,r){return e.x===r.x&&e.y===r.y&&e.width===r.width&&e.height===r.height}function Qre(e,r){let s=null,o;const u=hc(e);function h(){var g;clearTimeout(o),(g=s)==null||g.disconnect(),s=null}function m(g,b){g===void 0&&(g=!1),b===void 0&&(b=1),h();const w=e.getBoundingClientRect(),{left:E,top:A,width:k,height:R}=w;if(g||r(),!k||!R)return;const M=WE(A),I=WE(u.clientWidth-(E+k)),F=WE(u.clientHeight-(A+R)),H=WE(E),K={rootMargin:-M+"px "+-I+"px "+-F+"px "+-H+"px",threshold:Ma(0,Bd(1,b))||1};let z=!0;function W(ae){const Q=ae[0].intersectionRatio;if(Q!==b){if(!z)return m();Q?m(!1,Q):o=setTimeout(()=>{m(!1,1e-7)},1e3)}Q===1&&!Qz(w,e.getBoundingClientRect())&&m(),z=!1}try{s=new IntersectionObserver(W,{...K,root:u.ownerDocument})}catch{s=new IntersectionObserver(W,K)}s.observe(e)}return m(!0),h}function ese(e,r,s,o){o===void 0&&(o={});const{ancestorScroll:u=!0,ancestorResize:h=!0,elementResize:m=typeof ResizeObserver=="function",layoutShift:g=typeof IntersectionObserver=="function",animationFrame:b=!1}=o,w=l2(e),E=u||h?[...w?Hb(w):[],...Hb(r)]:[];E.forEach(H=>{u&&H.addEventListener("scroll",s,{passive:!0}),h&&H.addEventListener("resize",s)});const A=w&&g?Qre(w,s):null;let k=-1,R=null;m&&(R=new ResizeObserver(H=>{let[V]=H;V&&V.target===w&&R&&(R.unobserve(r),cancelAnimationFrame(k),k=requestAnimationFrame(()=>{var K;(K=R)==null||K.observe(r)})),s()}),w&&!b&&R.observe(w),R.observe(r));let M,I=b?_p(e):null;b&&F();function F(){const H=_p(e);I&&!Qz(I,H)&&s(),I=H,M=requestAnimationFrame(F)}return s(),()=>{var H;E.forEach(V=>{u&&V.removeEventListener("scroll",s),h&&V.removeEventListener("resize",s)}),A?.(),(H=R)==null||H.disconnect(),R=null,b&&cancelAnimationFrame(M)}}const tse=Cre,nse=Are,rse=Sre,sse=kre,ise=Ere,bI=wre,ase=Ore,ose=(e,r,s)=>{const o=new Map,u={platform:Wre,...s},h={...u.platform,_c:o};return bre(e,r,{...u,platform:h})};var lse=typeof document<"u",cse=function(){},wj=lse?T.useLayoutEffect:cse;function Bj(e,r){if(e===r)return!0;if(typeof e!=typeof r)return!1;if(typeof e=="function"&&e.toString()===r.toString())return!0;let s,o,u;if(e&&r&&typeof e=="object"){if(Array.isArray(e)){if(s=e.length,s!==r.length)return!1;for(o=s;o--!==0;)if(!Bj(e[o],r[o]))return!1;return!0}if(u=Object.keys(e),s=u.length,s!==Object.keys(r).length)return!1;for(o=s;o--!==0;)if(!{}.hasOwnProperty.call(r,u[o]))return!1;for(o=s;o--!==0;){const h=u[o];if(!(h==="_owner"&&e.$$typeof)&&!Bj(e[h],r[h]))return!1}return!0}return e!==e&&r!==r}function eL(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function wI(e,r){const s=eL(e);return Math.round(r*s)/s}function HR(e){const r=T.useRef(e);return wj(()=>{r.current=e}),r}function use(e){e===void 0&&(e={});const{placement:r="bottom",strategy:s="absolute",middleware:o=[],platform:u,elements:{reference:h,floating:m}={},transform:g=!0,whileElementsMounted:b,open:w}=e,[E,A]=T.useState({x:0,y:0,strategy:s,placement:r,middlewareData:{},isPositioned:!1}),[k,R]=T.useState(o);Bj(k,o)||R(o);const[M,I]=T.useState(null),[F,H]=T.useState(null),V=T.useCallback(ce=>{ce!==ae.current&&(ae.current=ce,I(ce))},[]),K=T.useCallback(ce=>{ce!==Q.current&&(Q.current=ce,H(ce))},[]),z=h||M,W=m||F,ae=T.useRef(null),Q=T.useRef(null),te=T.useRef(E),de=b!=null,je=HR(b),we=HR(u),ie=HR(w),Se=T.useCallback(()=>{if(!ae.current||!Q.current)return;const ce={placement:r,strategy:s,middleware:k};we.current&&(ce.platform=we.current),ose(ae.current,Q.current,ce).then($e=>{const me={...$e,isPositioned:ie.current!==!1};Ae.current&&!Bj(te.current,me)&&(te.current=me,SC.flushSync(()=>{A(me)}))})},[k,r,s,we,ie]);wj(()=>{w===!1&&te.current.isPositioned&&(te.current.isPositioned=!1,A(ce=>({...ce,isPositioned:!1})))},[w]);const Ae=T.useRef(!1);wj(()=>(Ae.current=!0,()=>{Ae.current=!1}),[]),wj(()=>{if(z&&(ae.current=z),W&&(Q.current=W),z&&W){if(je.current)return je.current(z,W,Se);Se()}},[z,W,Se,je,de]);const He=T.useMemo(()=>({reference:ae,floating:Q,setReference:V,setFloating:K}),[V,K]),ue=T.useMemo(()=>({reference:z,floating:W}),[z,W]),ne=T.useMemo(()=>{const ce={position:s,left:0,top:0};if(!ue.floating)return ce;const $e=wI(ue.floating,E.x),me=wI(ue.floating,E.y);return g?{...ce,transform:"translate("+$e+"px, "+me+"px)",...eL(ue.floating)>=1.5&&{willChange:"transform"}}:{position:s,left:$e,top:me}},[s,g,ue.floating,E.x,E.y]);return T.useMemo(()=>({...E,update:Se,refs:He,elements:ue,floatingStyles:ne}),[E,Se,He,ue,ne])}const dse=e=>{function r(s){return{}.hasOwnProperty.call(s,"current")}return{name:"arrow",options:e,fn(s){const{element:o,padding:u}=typeof e=="function"?e(s):e;return o&&r(o)?o.current!=null?bI({element:o.current,padding:u}).fn(s):{}:o?bI({element:o,padding:u}).fn(s):{}}}},hse=(e,r)=>({...tse(e),options:[e,r]}),pse=(e,r)=>({...nse(e),options:[e,r]}),fse=(e,r)=>({...ase(e),options:[e,r]}),mse=(e,r)=>({...rse(e),options:[e,r]}),gse=(e,r)=>({...sse(e),options:[e,r]}),yse=(e,r)=>({...ise(e),options:[e,r]}),vse=(e,r)=>({...dse(e),options:[e,r]});var xse="Arrow",tL=T.forwardRef((e,r)=>{const{children:s,width:o=10,height:u=5,...h}=e;return c.jsx(An.svg,{...h,ref:r,width:o,height:u,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?s:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});tL.displayName=xse;var bse=tL;function nL(e){const[r,s]=T.useState(void 0);return Os(()=>{if(e){s({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(u=>{if(!Array.isArray(u)||!u.length)return;const h=u[0];let m,g;if("borderBoxSize"in h){const b=h.borderBoxSize,w=Array.isArray(b)?b[0]:b;m=w.inlineSize,g=w.blockSize}else m=e.offsetWidth,g=e.offsetHeight;s({width:m,height:g})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else s(void 0)},[e]),r}var c2="Popper",[rL,Yd]=cl(c2),[wse,sL]=rL(c2),iL=e=>{const{__scopePopper:r,children:s}=e,[o,u]=T.useState(null);return c.jsx(wse,{scope:r,anchor:o,onAnchorChange:u,children:s})};iL.displayName=c2;var aL="PopperAnchor",oL=T.forwardRef((e,r)=>{const{__scopePopper:s,virtualRef:o,...u}=e,h=sL(aL,s),m=T.useRef(null),g=Ln(r,m),b=T.useRef(null);return T.useEffect(()=>{const w=b.current;b.current=o?.current||m.current,w!==b.current&&h.onAnchorChange(b.current)}),o?null:c.jsx(An.div,{...u,ref:g})});oL.displayName=aL;var u2="PopperContent",[Sse,Ese]=rL(u2),lL=T.forwardRef((e,r)=>{const{__scopePopper:s,side:o="bottom",sideOffset:u=0,align:h="center",alignOffset:m=0,arrowPadding:g=0,avoidCollisions:b=!0,collisionBoundary:w=[],collisionPadding:E=0,sticky:A="partial",hideWhenDetached:k=!1,updatePositionStrategy:R="optimized",onPlaced:M,...I}=e,F=sL(u2,s),[H,V]=T.useState(null),K=Ln(r,Fe=>V(Fe)),[z,W]=T.useState(null),ae=nL(z),Q=ae?.width??0,te=ae?.height??0,de=o+(h!=="center"?"-"+h:""),je=typeof E=="number"?E:{top:0,right:0,bottom:0,left:0,...E},we=Array.isArray(w)?w:[w],ie=we.length>0,Se={padding:je,boundary:we.filter(Cse),altBoundary:ie},{refs:Ae,floatingStyles:He,placement:ue,isPositioned:ne,middlewareData:ce}=use({strategy:"fixed",placement:de,whileElementsMounted:(...Fe)=>ese(...Fe,{animationFrame:R==="always"}),elements:{reference:F.anchor},middleware:[hse({mainAxis:u+te,alignmentAxis:m}),b&&pse({mainAxis:!0,crossAxis:!1,limiter:A==="partial"?fse():void 0,...Se}),b&&mse({...Se}),gse({...Se,apply:({elements:Fe,rects:at,availableWidth:gt,availableHeight:Ot})=>{const{width:Lt,height:Rt}=at.reference,Ft=Fe.floating.style;Ft.setProperty("--radix-popper-available-width",`${gt}px`),Ft.setProperty("--radix-popper-available-height",`${Ot}px`),Ft.setProperty("--radix-popper-anchor-width",`${Lt}px`),Ft.setProperty("--radix-popper-anchor-height",`${Rt}px`)}}),z&&vse({element:z,padding:g}),Ase({arrowWidth:Q,arrowHeight:te}),k&&yse({strategy:"referenceHidden",...Se})]}),[$e,me]=dL(ue),Xe=sl(M);Os(()=>{ne&&Xe?.()},[ne,Xe]);const Oe=ce.arrow?.x,Te=ce.arrow?.y,Ke=ce.arrow?.centerOffset!==0,[se,Ne]=T.useState();return Os(()=>{H&&Ne(window.getComputedStyle(H).zIndex)},[H]),c.jsx("div",{ref:Ae.setFloating,"data-radix-popper-content-wrapper":"",style:{...He,transform:ne?He.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:se,"--radix-popper-transform-origin":[ce.transformOrigin?.x,ce.transformOrigin?.y].join(" "),...ce.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(Sse,{scope:s,placedSide:$e,onArrowChange:W,arrowX:Oe,arrowY:Te,shouldHideArrow:Ke,children:c.jsx(An.div,{"data-side":$e,"data-align":me,...I,ref:K,style:{...I.style,animation:ne?void 0:"none"}})})})});lL.displayName=u2;var cL="PopperArrow",jse={top:"bottom",right:"left",bottom:"top",left:"right"},uL=T.forwardRef(function(r,s){const{__scopePopper:o,...u}=r,h=Ese(cL,o),m=jse[h.placedSide];return c.jsx("span",{ref:h.onArrowChange,style:{position:"absolute",left:h.arrowX,top:h.arrowY,[m]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[h.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[h.placedSide],visibility:h.shouldHideArrow?"hidden":void 0},children:c.jsx(bse,{...u,ref:s,style:{...u.style,display:"block"}})})});uL.displayName=cL;function Cse(e){return e!==null}var Ase=e=>({name:"transformOrigin",options:e,fn(r){const{placement:s,rects:o,middlewareData:u}=r,m=u.arrow?.centerOffset!==0,g=m?0:e.arrowWidth,b=m?0:e.arrowHeight,[w,E]=dL(s),A={start:"0%",center:"50%",end:"100%"}[E],k=(u.arrow?.x??0)+g/2,R=(u.arrow?.y??0)+b/2;let M="",I="";return w==="bottom"?(M=m?A:`${k}px`,I=`${-b}px`):w==="top"?(M=m?A:`${k}px`,I=`${o.floating.height+b}px`):w==="right"?(M=`${-b}px`,I=m?A:`${R}px`):w==="left"&&(M=`${o.floating.width+b}px`,I=m?A:`${R}px`),{data:{x:M,y:I}}}});function dL(e){const[r,s="center"]=e.split("-");return[r,s]}var TC=iL,ow=oL,_C=lL,$C=uL,Ose="Portal",Mg=T.forwardRef((e,r)=>{const{container:s,...o}=e,[u,h]=T.useState(!1);Os(()=>h(!0),[]);const m=s||u&&globalThis?.document?.body;return m?ez.createPortal(c.jsx(An.div,{...o,ref:r}),m):null});Mg.displayName=Ose;function kse(e,r){return T.useReducer((s,o)=>r[s][o]??s,e)}var po=e=>{const{present:r,children:s}=e,o=Rse(r),u=typeof s=="function"?s({present:o.isPresent}):T.Children.only(s),h=Ln(o.ref,Tse(u));return typeof s=="function"||o.isPresent?T.cloneElement(u,{ref:h}):null};po.displayName="Presence";function Rse(e){const[r,s]=T.useState(),o=T.useRef(null),u=T.useRef(e),h=T.useRef("none"),m=e?"mounted":"unmounted",[g,b]=kse(m,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return T.useEffect(()=>{const w=QE(o.current);h.current=g==="mounted"?w:"none"},[g]),Os(()=>{const w=o.current,E=u.current;if(E!==e){const k=h.current,R=QE(w);e?b("MOUNT"):R==="none"||w?.display==="none"?b("UNMOUNT"):b(E&&k!==R?"ANIMATION_OUT":"UNMOUNT"),u.current=e}},[e,b]),Os(()=>{if(r){let w;const E=r.ownerDocument.defaultView??window,A=R=>{const I=QE(o.current).includes(CSS.escape(R.animationName));if(R.target===r&&I&&(b("ANIMATION_END"),!u.current)){const F=r.style.animationFillMode;r.style.animationFillMode="forwards",w=E.setTimeout(()=>{r.style.animationFillMode==="forwards"&&(r.style.animationFillMode=F)})}},k=R=>{R.target===r&&(h.current=QE(o.current))};return r.addEventListener("animationstart",k),r.addEventListener("animationcancel",A),r.addEventListener("animationend",A),()=>{E.clearTimeout(w),r.removeEventListener("animationstart",k),r.removeEventListener("animationcancel",A),r.removeEventListener("animationend",A)}}else b("ANIMATION_END")},[r,b]),{isPresent:["mounted","unmountSuspended"].includes(g),ref:T.useCallback(w=>{o.current=w?getComputedStyle(w):null,s(w)},[])}}function QE(e){return e?.animationName||"none"}function Tse(e){let r=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=r&&"isReactWarning"in r&&r.isReactWarning;return s?e.ref:(r=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=r&&"isReactWarning"in r&&r.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}var _se=Symbol("radix.slottable");function $se(e){const r=({children:s})=>c.jsx(c.Fragment,{children:s});return r.displayName=`${e}.Slottable`,r.__radixId=_se,r}var Nse=q_[" useInsertionEffect ".trim().toString()]||Os;function Kd({prop:e,defaultProp:r,onChange:s=()=>{},caller:o}){const[u,h,m]=Dse({defaultProp:r,onChange:s}),g=e!==void 0,b=g?e:u;{const E=T.useRef(e!==void 0);T.useEffect(()=>{const A=E.current;A!==g&&console.warn(`${o} is changing from ${A?"controlled":"uncontrolled"} to ${g?"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.`),E.current=g},[g,o])}const w=T.useCallback(E=>{if(g){const A=Pse(E)?E(e):E;A!==e&&m.current?.(A)}else h(E)},[g,e,h,m]);return[b,w]}function Dse({defaultProp:e,onChange:r}){const[s,o]=T.useState(e),u=T.useRef(s),h=T.useRef(r);return Nse(()=>{h.current=r},[r]),T.useEffect(()=>{u.current!==s&&(h.current?.(s),u.current=s)},[s,u]),[s,o,h]}function Pse(e){return typeof e=="function"}var hL=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"}),Mse="VisuallyHidden",pL=T.forwardRef((e,r)=>c.jsx(An.span,{...e,ref:r,style:{...hL,...e.style}}));pL.displayName=Mse;var Ise=pL,[NC]=cl("Tooltip",[Yd]),DC=Yd(),fL="TooltipProvider",zse=700,YT="tooltip.open",[Lse,d2]=NC(fL),mL=e=>{const{__scopeTooltip:r,delayDuration:s=zse,skipDelayDuration:o=300,disableHoverableContent:u=!1,children:h}=e,m=T.useRef(!0),g=T.useRef(!1),b=T.useRef(0);return T.useEffect(()=>{const w=b.current;return()=>window.clearTimeout(w)},[]),c.jsx(Lse,{scope:r,isOpenDelayedRef:m,delayDuration:s,onOpen:T.useCallback(()=>{window.clearTimeout(b.current),m.current=!1},[]),onClose:T.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>m.current=!0,o)},[o]),isPointerInTransitRef:g,onPointerInTransitChange:T.useCallback(w=>{g.current=w},[]),disableHoverableContent:u,children:h})};mL.displayName=fL;var Gb="Tooltip",[Fse,lw]=NC(Gb),gL=e=>{const{__scopeTooltip:r,children:s,open:o,defaultOpen:u,onOpenChange:h,disableHoverableContent:m,delayDuration:g}=e,b=d2(Gb,e.__scopeTooltip),w=DC(r),[E,A]=T.useState(null),k=Ys(),R=T.useRef(0),M=m??b.disableHoverableContent,I=g??b.delayDuration,F=T.useRef(!1),[H,V]=Kd({prop:o,defaultProp:u??!1,onChange:Q=>{Q?(b.onOpen(),document.dispatchEvent(new CustomEvent(YT))):b.onClose(),h?.(Q)},caller:Gb}),K=T.useMemo(()=>H?F.current?"delayed-open":"instant-open":"closed",[H]),z=T.useCallback(()=>{window.clearTimeout(R.current),R.current=0,F.current=!1,V(!0)},[V]),W=T.useCallback(()=>{window.clearTimeout(R.current),R.current=0,V(!1)},[V]),ae=T.useCallback(()=>{window.clearTimeout(R.current),R.current=window.setTimeout(()=>{F.current=!0,V(!0),R.current=0},I)},[I,V]);return T.useEffect(()=>()=>{R.current&&(window.clearTimeout(R.current),R.current=0)},[]),c.jsx(TC,{...w,children:c.jsx(Fse,{scope:r,contentId:k,open:H,stateAttribute:K,trigger:E,onTriggerChange:A,onTriggerEnter:T.useCallback(()=>{b.isOpenDelayedRef.current?ae():z()},[b.isOpenDelayedRef,ae,z]),onTriggerLeave:T.useCallback(()=>{M?W():(window.clearTimeout(R.current),R.current=0)},[W,M]),onOpen:z,onClose:W,disableHoverableContent:M,children:s})})};gL.displayName=Gb;var ZT="TooltipTrigger",yL=T.forwardRef((e,r)=>{const{__scopeTooltip:s,...o}=e,u=lw(ZT,s),h=d2(ZT,s),m=DC(s),g=T.useRef(null),b=Ln(r,g,u.onTriggerChange),w=T.useRef(!1),E=T.useRef(!1),A=T.useCallback(()=>w.current=!1,[]);return T.useEffect(()=>()=>document.removeEventListener("pointerup",A),[A]),c.jsx(ow,{asChild:!0,...m,children:c.jsx(An.button,{"aria-describedby":u.open?u.contentId:void 0,"data-state":u.stateAttribute,...o,ref:b,onPointerMove:Nt(e.onPointerMove,k=>{k.pointerType!=="touch"&&!E.current&&!h.isPointerInTransitRef.current&&(u.onTriggerEnter(),E.current=!0)}),onPointerLeave:Nt(e.onPointerLeave,()=>{u.onTriggerLeave(),E.current=!1}),onPointerDown:Nt(e.onPointerDown,()=>{u.open&&u.onClose(),w.current=!0,document.addEventListener("pointerup",A,{once:!0})}),onFocus:Nt(e.onFocus,()=>{w.current||u.onOpen()}),onBlur:Nt(e.onBlur,u.onClose),onClick:Nt(e.onClick,u.onClose)})})});yL.displayName=ZT;var h2="TooltipPortal",[qse,Bse]=NC(h2,{forceMount:void 0}),vL=e=>{const{__scopeTooltip:r,forceMount:s,children:o,container:u}=e,h=lw(h2,r);return c.jsx(qse,{scope:r,forceMount:s,children:c.jsx(po,{present:s||h.open,children:c.jsx(Mg,{asChild:!0,container:u,children:o})})})};vL.displayName=h2;var Eg="TooltipContent",xL=T.forwardRef((e,r)=>{const s=Bse(Eg,e.__scopeTooltip),{forceMount:o=s.forceMount,side:u="top",...h}=e,m=lw(Eg,e.__scopeTooltip);return c.jsx(po,{present:o||m.open,children:m.disableHoverableContent?c.jsx(bL,{side:u,...h,ref:r}):c.jsx(Use,{side:u,...h,ref:r})})}),Use=T.forwardRef((e,r)=>{const s=lw(Eg,e.__scopeTooltip),o=d2(Eg,e.__scopeTooltip),u=T.useRef(null),h=Ln(r,u),[m,g]=T.useState(null),{trigger:b,onClose:w}=s,E=u.current,{onPointerInTransitChange:A}=o,k=T.useCallback(()=>{g(null),A(!1)},[A]),R=T.useCallback((M,I)=>{const F=M.currentTarget,H={x:M.clientX,y:M.clientY},V=Gse(H,F.getBoundingClientRect()),K=Xse(H,V),z=Yse(I.getBoundingClientRect()),W=Jse([...K,...z]);g(W),A(!0)},[A]);return T.useEffect(()=>()=>k(),[k]),T.useEffect(()=>{if(b&&E){const M=F=>R(F,E),I=F=>R(F,b);return b.addEventListener("pointerleave",M),E.addEventListener("pointerleave",I),()=>{b.removeEventListener("pointerleave",M),E.removeEventListener("pointerleave",I)}}},[b,E,R,k]),T.useEffect(()=>{if(m){const M=I=>{const F=I.target,H={x:I.clientX,y:I.clientY},V=b?.contains(F)||E?.contains(F),K=!Zse(H,m);V?k():K&&(k(),w())};return document.addEventListener("pointermove",M),()=>document.removeEventListener("pointermove",M)}},[b,E,m,w,k]),c.jsx(bL,{...e,ref:h})}),[Kse,Vse]=NC(Gb,{isInside:!1}),Hse=$se("TooltipContent"),bL=T.forwardRef((e,r)=>{const{__scopeTooltip:s,children:o,"aria-label":u,onEscapeKeyDown:h,onPointerDownOutside:m,...g}=e,b=lw(Eg,s),w=DC(s),{onClose:E}=b;return T.useEffect(()=>(document.addEventListener(YT,E),()=>document.removeEventListener(YT,E)),[E]),T.useEffect(()=>{if(b.trigger){const A=k=>{k.target?.contains(b.trigger)&&E()};return window.addEventListener("scroll",A,{capture:!0}),()=>window.removeEventListener("scroll",A,{capture:!0})}},[b.trigger,E]),c.jsx(Ng,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:h,onPointerDownOutside:m,onFocusOutside:A=>A.preventDefault(),onDismiss:E,children:c.jsxs(_C,{"data-state":b.stateAttribute,...w,...g,ref:r,style:{...g.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[c.jsx(Hse,{children:o}),c.jsx(Kse,{scope:s,isInside:!0,children:c.jsx(Ise,{id:b.contentId,role:"tooltip",children:u||o})})]})})});xL.displayName=Eg;var wL="TooltipArrow",SL=T.forwardRef((e,r)=>{const{__scopeTooltip:s,...o}=e,u=DC(s);return Vse(wL,s).isInside?null:c.jsx($C,{...u,...o,ref:r})});SL.displayName=wL;function Gse(e,r){const s=Math.abs(r.top-e.y),o=Math.abs(r.bottom-e.y),u=Math.abs(r.right-e.x),h=Math.abs(r.left-e.x);switch(Math.min(s,o,u,h)){case h:return"left";case u:return"right";case s:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function Xse(e,r,s=5){const o=[];switch(r){case"top":o.push({x:e.x-s,y:e.y+s},{x:e.x+s,y:e.y+s});break;case"bottom":o.push({x:e.x-s,y:e.y-s},{x:e.x+s,y:e.y-s});break;case"left":o.push({x:e.x+s,y:e.y-s},{x:e.x+s,y:e.y+s});break;case"right":o.push({x:e.x-s,y:e.y-s},{x:e.x-s,y:e.y+s});break}return o}function Yse(e){const{top:r,right:s,bottom:o,left:u}=e;return[{x:u,y:r},{x:s,y:r},{x:s,y:o},{x:u,y:o}]}function Zse(e,r){const{x:s,y:o}=e;let u=!1;for(let h=0,m=r.length-1;ho!=k>o&&s<(A-w)*(o-E)/(k-E)+w&&(u=!u)}return u}function Jse(e){const r=e.slice();return r.sort((s,o)=>s.xo.x?1:s.yo.y?1:0),Wse(r)}function Wse(e){if(e.length<=1)return e.slice();const r=[];for(let o=0;o=2;){const h=r[r.length-1],m=r[r.length-2];if((h.x-m.x)*(u.y-m.y)>=(h.y-m.y)*(u.x-m.x))r.pop();else break}r.push(u)}r.pop();const s=[];for(let o=e.length-1;o>=0;o--){const u=e[o];for(;s.length>=2;){const h=s[s.length-1],m=s[s.length-2];if((h.x-m.x)*(u.y-m.y)>=(h.y-m.y)*(u.x-m.x))s.pop();else break}s.push(u)}return s.pop(),r.length===1&&s.length===1&&r[0].x===s[0].x&&r[0].y===s[0].y?r:r.concat(s)}var Qse=mL,eie=gL,tie=yL,nie=vL,rie=xL,sie=SL;function cw({delayDuration:e=0,...r}){return c.jsx(Qse,{"data-slot":"tooltip-provider",delayDuration:e,...r})}function Uj({...e}){return c.jsx(cw,{children:c.jsx(eie,{"data-slot":"tooltip",...e})})}function Kj({...e}){return c.jsx(tie,{"data-slot":"tooltip-trigger",...e})}function Vj({className:e,sideOffset:r=0,children:s,...o}){return c.jsx(nie,{children:c.jsxs(rie,{"data-slot":"tooltip-content",sideOffset:r,className:vt("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),...o,children:[s,c.jsx(sie,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}function EL(e){return e&&e!=="none"?e.slice(0,7):"none"}function iie(e){if(!e||e==="unknown")return"unknown";const r=new Date(e);return isNaN(+r)?e:r.toLocaleString()}function aie(e){return e?`v${e.version} (${EL(e.commit)}) • built ${e.built} • ${e.go} ${e.goOS}/${e.goArch}`:""}const oie=T.memo(function(){const r=Un({queryKey:["footer"],queryFn:()=>qte.footer(),staleTime:6e4,refetchOnWindowFocus:!1}),s=r.data,o=T.useMemo(()=>aie(s),[s]);return c.jsx("footer",{className:"bg-background text-muted-foreground w-full border-t px-3 py-2 text-xs sm:text-sm",children:c.jsxs("div",{className:"mx-auto flex max-w-screen-2xl items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-2 text-xs sm:text-sm",children:[c.jsxs("span",{children:["© ",new Date().getFullYear()," GlueOps"]}),c.jsx(Ab,{orientation:"vertical",className:"hidden h-4 sm:block"}),c.jsx("span",{className:"hidden sm:block",children:"All systems nominal."})]}),c.jsx("div",{className:"flex flex-wrap items-center gap-2 text-xs sm:text-sm",children:r.isLoading?c.jsx("span",{className:"animate-pulse",children:"loading version…"}):r.isError?c.jsx("span",{className:"text-destructive",children:"version unavailable"}):s?c.jsx(cw,{children:c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(rr,{variant:"secondary",className:"font-mono",children:s.version}),c.jsxs(Uj,{children:[c.jsx(Kj,{asChild:!0,children:c.jsxs("span",{className:"inline-flex items-center gap-1",children:[c.jsx(fJ,{className:"h-3.5 w-3.5"}),c.jsx("span",{className:"font-mono",children:EL(s.commit)})]})}),c.jsx(Vj,{side:"top",children:c.jsx("div",{className:"font-mono text-xs",children:s.commit})})]}),c.jsx(Ab,{orientation:"vertical",className:"h-4"}),c.jsxs(Uj,{children:[c.jsx(Kj,{asChild:!0,children:c.jsxs("span",{className:"inline-flex items-center gap-1",children:[c.jsx(vz,{className:"h-3.5 w-3.5"}),c.jsx("span",{children:s.go})]})}),c.jsx(Vj,{side:"top",children:c.jsxs("div",{className:"font-mono text-xs",children:[s.goOS,"/",s.goArch]})})]}),c.jsx(Ab,{orientation:"vertical",className:"hidden h-4 sm:block"}),c.jsxs("span",{className:"hidden sm:inline",children:["built ",c.jsx("span",{className:"font-mono",children:iie(s.built)})]}),c.jsx(Ab,{orientation:"vertical",className:"hidden h-4 sm:block"}),c.jsx(Pe,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>{navigator.clipboard?.writeText(o).catch(()=>{})},title:"Copy version details",children:c.jsx(WZ,{className:"h-4 w-4"})}),c.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 ",c.jsx(oJ,{className:"h-3.5 w-3.5"})]})]})}):null})]})})});var jL={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},SI=et.createContext&&et.createContext(jL),lie=["attr","size","title"];function cie(e,r){if(e==null)return{};var s=uie(e,r),o,u;if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(e);for(u=0;u=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(s[o]=e[o])}return s}function uie(e,r){if(e==null)return{};var s={};for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){if(r.indexOf(o)>=0)continue;s[o]=e[o]}return s}function Hj(){return Hj=Object.assign?Object.assign.bind():function(e){for(var r=1;ret.createElement(r.tag,Gj({key:s},r.attr),CL(r.child)))}function uw(e){return r=>et.createElement(fie,Hj({attr:Gj({},e.attr)},r),CL(e.child))}function fie(e){var r=s=>{var{attr:o,size:u,title:h}=e,m=cie(e,lie),g=u||s.size||"1em",b;return s.className&&(b=s.className),e.className&&(b=(b?b+" ":"")+e.className),et.createElement("svg",Hj({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},s.attr,o,m,{className:b,style:Gj(Gj({color:e.color||s.color},s.style),e.style),height:g,width:g,xmlns:"http://www.w3.org/2000/svg"}),h&&et.createElement("title",null,h),e.children)};return SI!==void 0?et.createElement(SI.Consumer,null,s=>r(s)):r(jL)}function mie(e){return uw({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 gie(e){return uw({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)}function yie(e){return uw({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M19 15v4H5v-4h14m1-2H4c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h16c.55 0 1-.45 1-1v-6c0-.55-.45-1-1-1zM7 18.5c-.82 0-1.5-.67-1.5-1.5s.68-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5zM19 5v4H5V5h14m1-2H4c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h16c.55 0 1-.45 1-1V4c0-.55-.45-1-1-1zM7 8.5c-.82 0-1.5-.67-1.5-1.5S6.18 5.5 7 5.5s1.5.68 1.5 1.5S7.83 8.5 7 8.5z"},child:[]}]})(e)}function vie(e){return uw({attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 0C5.383 0 0 5.383 0 12s5.383 12 12 12c6.616 0 12-5.383 12-12S18.616 0 12 0zm0 1.144c5.995 0 10.856 4.86 10.856 10.856 0 5.995-4.86 10.856-10.856 10.856-5.996 0-10.856-4.86-10.856-10.856C1.144 6.004 6.004 1.144 12 1.144zM8.37 5.868a6.707 6.707 0 0 0-.423.005c-.983.056-1.573.517-1.735 1.472-.115.665-.096 1.348-.143 2.017-.013.35-.05.697-.115 1.038-.134.609-.397.798-1.016.83a2.65 2.65 0 0 0-.244.042v1.463c1.126.055 1.278.452 1.37 1.629.033.429-.013.858.015 1.287.018.406.073.808.156 1.2.259 1.075 1.307 1.435 2.575 1.218v-1.283c-.203 0-.383.005-.558 0-.43-.013-.591-.12-.632-.535-.056-.535-.042-1.08-.075-1.62-.064-1.001-.175-1.988-1.153-2.625.503-.37.868-.812.983-1.398.083-.41.134-.821.166-1.237.028-.415-.023-.84.014-1.25.06-.665.102-.937.9-.91.12 0 .235-.017.369-.027v-1.31c-.16 0-.31-.004-.454-.006zm7.593.009a4.247 4.247 0 0 0-.813.06v1.274c.245 0 .434 0 .623.005.328.004.577.13.61.494.032.332.031.669.064 1.006.065.669.101 1.347.217 2.007.102.544.475.95.941 1.283-.817.549-1.057 1.333-1.098 2.215-.023.604-.037 1.213-.069 1.822-.028.554-.222.734-.78.748-.157.004-.31.018-.484.028v1.305c.327 0 .627.019.927 0 .932-.055 1.495-.507 1.68-1.412.078-.498.124-1 .138-1.504.032-.461.028-.927.074-1.384.069-.715.397-1.01 1.112-1.057a.972.972 0 0 0 .199-.046v-1.463c-.12-.014-.204-.027-.291-.032-.536-.023-.804-.203-.937-.71a5.146 5.146 0 0 1-.152-.993c-.037-.618-.033-1.241-.074-1.86-.08-1.192-.794-1.753-1.887-1.786zm-6.89 5.28a.844.844 0 0 0-.083 1.684h.055a.83.83 0 0 0 .877-.78v-.046a.845.845 0 0 0-.83-.858zm2.911 0a.808.808 0 0 0-.834.78c0 .027 0 .05.004.078 0 .503.342.826.859.826.507 0 .826-.332.826-.853-.005-.503-.342-.836-.855-.831zm2.963 0a.861.861 0 0 0-.876.835c0 .47.378.849.849.849h.009c.425.074.853-.337.881-.83.023-.457-.392-.854-.863-.854z"},child:[]}]})(e)}function xie(e){return uw({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M12 13m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"},child:[]},{tag:"path",attr:{d:"M12 20m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},child:[]},{tag:"path",attr:{d:"M12 16v3"},child:[]},{tag:"path",attr:{d:"M12 10v-7"},child:[]},{tag:"path",attr:{d:"M9 6l3 -3l3 3"},child:[]},{tag:"path",attr:{d:"M12 10v-7"},child:[]},{tag:"path",attr:{d:"M9 6l3 -3l3 3"},child:[]},{tag:"path",attr:{d:"M14.894 12.227l6.11 -2.224"},child:[]},{tag:"path",attr:{d:"M17.159 8.21l3.845 1.793l-1.793 3.845"},child:[]},{tag:"path",attr:{d:"M9.101 12.214l-6.075 -2.211"},child:[]},{tag:"path",attr:{d:"M6.871 8.21l-3.845 1.793l1.793 3.845"},child:[]}]})(e)}const bie=[{to:"/clusters",label:"Clusters",icon:mie},{to:"/load-balancers",label:"Load Balancers",icon:xie},{to:"/dns",label:"DNS",icon:yie},{to:"/node-pools",label:"Node Pools",icon:MZ},{to:"/annotations",label:"Annotations",icon:eJ},{to:"/labels",label:"Labels",icon:jC},{to:"/taints",label:"Taints",icon:UJ},{to:"/servers",label:"Servers",icon:J_},{to:"/ssh",label:"SSH Keys",icon:hJ},{to:"/credentials",label:"Credentials",icon:wJ}],wie=[{to:"/org/members",label:"Members",icon:xz},{to:"/org/api-keys",label:"Org API Keys",icon:yJ},{to:"/org/settings",label:"Org Settings",icon:mz}],Sie=[{to:"/me",label:"Profile",icon:ZJ}],Eie=[{to:"/admin/users",label:"Users Admin",icon:xz},{to:"/admin/jobs",label:"Jobs Admin",icon:gie},{to:"/admin/actions",label:"Actions Admin",icon:MJ},{to:"/docs",label:"API Docs ",icon:vie,target:"_blank"}];var jI=1,jie=.9,Cie=.8,Aie=.17,GR=.1,XR=.999,Oie=.9999,kie=.99,Rie=/[\\\/_+.#"@\[\(\{&]/,Tie=/[\\\/_+.#"@\[\(\{&]/g,_ie=/[\s-]/,AL=/[\s-]/g;function JT(e,r,s,o,u,h,m){if(h===r.length)return u===e.length?jI:kie;var g=`${u},${h}`;if(m[g]!==void 0)return m[g];for(var b=o.charAt(h),w=s.indexOf(b,u),E=0,A,k,R,M;w>=0;)A=JT(e,r,s,o,w+1,h+1,m),A>E&&(w===u?A*=jI:Rie.test(e.charAt(w-1))?(A*=Cie,R=e.slice(u,w-1).match(Tie),R&&u>0&&(A*=Math.pow(XR,R.length))):_ie.test(e.charAt(w-1))?(A*=jie,M=e.slice(u,w-1).match(AL),M&&u>0&&(A*=Math.pow(XR,M.length))):(A*=Aie,u>0&&(A*=Math.pow(XR,w-u))),e.charAt(w)!==r.charAt(h)&&(A*=Oie)),(AA&&(A=k*GR)),A>E&&(E=A),w=s.indexOf(b,w+1);return m[g]=E,E}function CI(e){return e.toLowerCase().replace(AL," ")}function $ie(e,r,s){return e=s&&s.length>0?`${e+" "+s.join(" ")}`:e,JT(e,r,CI(e),CI(r),0,0,{})}var YR="focusScope.autoFocusOnMount",ZR="focusScope.autoFocusOnUnmount",AI={bubbles:!1,cancelable:!0},Nie="FocusScope",dw=T.forwardRef((e,r)=>{const{loop:s=!1,trapped:o=!1,onMountAutoFocus:u,onUnmountAutoFocus:h,...m}=e,[g,b]=T.useState(null),w=sl(u),E=sl(h),A=T.useRef(null),k=Ln(r,I=>b(I)),R=T.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;T.useEffect(()=>{if(o){let I=function(K){if(R.paused||!g)return;const z=K.target;g.contains(z)?A.current=z:zd(A.current,{select:!0})},F=function(K){if(R.paused||!g)return;const z=K.relatedTarget;z!==null&&(g.contains(z)||zd(A.current,{select:!0}))},H=function(K){if(document.activeElement===document.body)for(const W of K)W.removedNodes.length>0&&zd(g)};document.addEventListener("focusin",I),document.addEventListener("focusout",F);const V=new MutationObserver(H);return g&&V.observe(g,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",I),document.removeEventListener("focusout",F),V.disconnect()}}},[o,g,R.paused]),T.useEffect(()=>{if(g){kI.add(R);const I=document.activeElement;if(!g.contains(I)){const H=new CustomEvent(YR,AI);g.addEventListener(YR,w),g.dispatchEvent(H),H.defaultPrevented||(Die(Lie(OL(g)),{select:!0}),document.activeElement===I&&zd(g))}return()=>{g.removeEventListener(YR,w),setTimeout(()=>{const H=new CustomEvent(ZR,AI);g.addEventListener(ZR,E),g.dispatchEvent(H),H.defaultPrevented||zd(I??document.body,{select:!0}),g.removeEventListener(ZR,E),kI.remove(R)},0)}}},[g,w,E,R]);const M=T.useCallback(I=>{if(!s&&!o||R.paused)return;const F=I.key==="Tab"&&!I.altKey&&!I.ctrlKey&&!I.metaKey,H=document.activeElement;if(F&&H){const V=I.currentTarget,[K,z]=Pie(V);K&&z?!I.shiftKey&&H===z?(I.preventDefault(),s&&zd(K,{select:!0})):I.shiftKey&&H===K&&(I.preventDefault(),s&&zd(z,{select:!0})):H===V&&I.preventDefault()}},[s,o,R.paused]);return c.jsx(An.div,{tabIndex:-1,...m,ref:k,onKeyDown:M})});dw.displayName=Nie;function Die(e,{select:r=!1}={}){const s=document.activeElement;for(const o of e)if(zd(o,{select:r}),document.activeElement!==s)return}function Pie(e){const r=OL(e),s=OI(r,e),o=OI(r.reverse(),e);return[s,o]}function OL(e){const r=[],s=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const u=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||u?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;s.nextNode();)r.push(s.currentNode);return r}function OI(e,r){for(const s of e)if(!Mie(s,{upTo:r}))return s}function Mie(e,{upTo:r}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(r!==void 0&&e===r)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Iie(e){return e instanceof HTMLInputElement&&"select"in e}function zd(e,{select:r=!1}={}){if(e&&e.focus){const s=document.activeElement;e.focus({preventScroll:!0}),e!==s&&Iie(e)&&r&&e.select()}}var kI=zie();function zie(){let e=[];return{add(r){const s=e[0];r!==s&&s?.pause(),e=RI(e,r),e.unshift(r)},remove(r){e=RI(e,r),e[0]?.resume()}}}function RI(e,r){const s=[...e],o=s.indexOf(r);return o!==-1&&s.splice(o,1),s}function Lie(e){return e.filter(r=>r.tagName!=="A")}var JR=0;function PC(){T.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??TI()),document.body.insertAdjacentElement("beforeend",e[1]??TI()),JR++,()=>{JR===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),JR--}},[])}function TI(){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 ic=function(){return ic=Object.assign||function(r){for(var s,o=1,u=arguments.length;o"u")return nae;var r=rae(e),s=document.documentElement.clientWidth,o=window.innerWidth;return{left:r[0],top:r[1],right:r[2],gap:Math.max(0,o-s+r[2]-r[0])}},iae=_L(),yg="data-scroll-locked",aae=function(e,r,s,o){var u=e.left,h=e.top,m=e.right,g=e.gap;return s===void 0&&(s="margin"),` .`.concat(qie,` { overflow: hidden `).concat(o,`; padding-right: `).concat(g,"px ").concat(o,`; } body[`).concat(yg,`] { overflow: hidden `).concat(o,`; overscroll-behavior: contain; `).concat([r&&"position: relative ".concat(o,";"),s==="margin"&&` padding-left: `.concat(u,`px; padding-top: `).concat(h,`px; padding-right: `).concat(m,`px; margin-left:0; margin-top:0; margin-right: `).concat(g,"px ").concat(o,`; `),s==="padding"&&"padding-right: ".concat(g,"px ").concat(o,";")].filter(Boolean).join(""),` } .`).concat(Sj,` { right: `).concat(g,"px ").concat(o,`; } .`).concat(Ej,` { margin-right: `).concat(g,"px ").concat(o,`; } .`).concat(Sj," .").concat(Sj,` { right: 0 `).concat(o,`; } .`).concat(Ej," .").concat(Ej,` { margin-right: 0 `).concat(o,`; } body[`).concat(yg,`] { `).concat(Bie,": ").concat(g,`px; } `)},$I=function(){var e=parseInt(document.body.getAttribute(yg)||"0",10);return isFinite(e)?e:0},oae=function(){T.useEffect(function(){return document.body.setAttribute(yg,($I()+1).toString()),function(){var e=$I()-1;e<=0?document.body.removeAttribute(yg):document.body.setAttribute(yg,e.toString())}},[])},lae=function(e){var r=e.noRelative,s=e.noImportant,o=e.gapMode,u=o===void 0?"margin":o;oae();var h=T.useMemo(function(){return sae(u)},[u]);return T.createElement(iae,{styles:aae(h,!r,u,s?"":"!important")})},WT=!1;if(typeof window<"u")try{var ej=Object.defineProperty({},"passive",{get:function(){return WT=!0,!0}});window.addEventListener("test",ej,ej),window.removeEventListener("test",ej,ej)}catch{WT=!1}var Xm=WT?{passive:!1}:!1,cae=function(e){return e.tagName==="TEXTAREA"},$L=function(e,r){if(!(e instanceof Element))return!1;var s=window.getComputedStyle(e);return s[r]!=="hidden"&&!(s.overflowY===s.overflowX&&!cae(e)&&s[r]==="visible")},uae=function(e){return $L(e,"overflowY")},dae=function(e){return $L(e,"overflowX")},NI=function(e,r){var s=r.ownerDocument,o=r;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var u=NL(e,o);if(u){var h=DL(e,o),m=h[1],g=h[2];if(m>g)return!0}o=o.parentNode}while(o&&o!==s.body);return!1},hae=function(e){var r=e.scrollTop,s=e.scrollHeight,o=e.clientHeight;return[r,s,o]},pae=function(e){var r=e.scrollLeft,s=e.scrollWidth,o=e.clientWidth;return[r,s,o]},NL=function(e,r){return e==="v"?uae(r):dae(r)},DL=function(e,r){return e==="v"?hae(r):pae(r)},fae=function(e,r){return e==="h"&&r==="rtl"?-1:1},mae=function(e,r,s,o,u){var h=fae(e,window.getComputedStyle(r).direction),m=h*o,g=s.target,b=r.contains(g),w=!1,E=m>0,A=0,k=0;do{if(!g)break;var R=DL(e,g),M=R[0],I=R[1],F=R[2],H=I-F-h*M;(M||H)&&NL(e,g)&&(A+=H,k+=M);var V=g.parentNode;g=V&&V.nodeType===Node.DOCUMENT_FRAGMENT_NODE?V.host:V}while(!b&&g!==document.body||b&&(r.contains(g)||r===g));return(E&&Math.abs(A)<1||!E&&Math.abs(k)<1)&&(w=!0),w},tj=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},DI=function(e){return[e.deltaX,e.deltaY]},PI=function(e){return e&&"current"in e?e.current:e},gae=function(e,r){return e[0]===r[0]&&e[1]===r[1]},yae=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} `)},vae=0,Ym=[];function xae(e){var r=T.useRef([]),s=T.useRef([0,0]),o=T.useRef(),u=T.useState(vae++)[0],h=T.useState(_L)[0],m=T.useRef(e);T.useEffect(function(){m.current=e},[e]),T.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(u));var I=Fie([e.lockRef.current],(e.shards||[]).map(PI),!0).filter(Boolean);return I.forEach(function(F){return F.classList.add("allow-interactivity-".concat(u))}),function(){document.body.classList.remove("block-interactivity-".concat(u)),I.forEach(function(F){return F.classList.remove("allow-interactivity-".concat(u))})}}},[e.inert,e.lockRef.current,e.shards]);var g=T.useCallback(function(I,F){if("touches"in I&&I.touches.length===2||I.type==="wheel"&&I.ctrlKey)return!m.current.allowPinchZoom;var H=tj(I),V=s.current,K="deltaX"in I?I.deltaX:V[0]-H[0],z="deltaY"in I?I.deltaY:V[1]-H[1],W,ae=I.target,Q=Math.abs(K)>Math.abs(z)?"h":"v";if("touches"in I&&Q==="h"&&ae.type==="range")return!1;var te=window.getSelection(),de=te&&te.anchorNode,je=de?de===ae||de.contains(ae):!1;if(je)return!1;var we=NI(Q,ae);if(!we)return!0;if(we?W=Q:(W=Q==="v"?"h":"v",we=NI(Q,ae)),!we)return!1;if(!o.current&&"changedTouches"in I&&(K||z)&&(o.current=W),!W)return!0;var ie=o.current||W;return mae(ie,F,I,ie==="h"?K:z)},[]),b=T.useCallback(function(I){var F=I;if(!(!Ym.length||Ym[Ym.length-1]!==h)){var H="deltaY"in F?DI(F):tj(F),V=r.current.filter(function(W){return W.name===F.type&&(W.target===F.target||F.target===W.shadowParent)&&gae(W.delta,H)})[0];if(V&&V.should){F.cancelable&&F.preventDefault();return}if(!V){var K=(m.current.shards||[]).map(PI).filter(Boolean).filter(function(W){return W.contains(F.target)}),z=K.length>0?g(F,K[0]):!m.current.noIsolation;z&&F.cancelable&&F.preventDefault()}}},[]),w=T.useCallback(function(I,F,H,V){var K={name:I,delta:F,target:H,should:V,shadowParent:bae(H)};r.current.push(K),setTimeout(function(){r.current=r.current.filter(function(z){return z!==K})},1)},[]),E=T.useCallback(function(I){s.current=tj(I),o.current=void 0},[]),A=T.useCallback(function(I){w(I.type,DI(I),I.target,g(I,e.lockRef.current))},[]),k=T.useCallback(function(I){w(I.type,tj(I),I.target,g(I,e.lockRef.current))},[]);T.useEffect(function(){return Ym.push(h),e.setCallbacks({onScrollCapture:A,onWheelCapture:A,onTouchMoveCapture:k}),document.addEventListener("wheel",b,Xm),document.addEventListener("touchmove",b,Xm),document.addEventListener("touchstart",E,Xm),function(){Ym=Ym.filter(function(I){return I!==h}),document.removeEventListener("wheel",b,Xm),document.removeEventListener("touchmove",b,Xm),document.removeEventListener("touchstart",E,Xm)}},[]);var R=e.removeScrollBar,M=e.inert;return T.createElement(T.Fragment,null,M?T.createElement(h,{styles:yae(u)}):null,R?T.createElement(lae,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function bae(e){for(var r=null;e!==null;)e instanceof ShadowRoot&&(r=e.host,e=e.host),e=e.parentNode;return r}const wae=Yie(TL,xae);var hw=T.forwardRef(function(e,r){return T.createElement(MC,ic({},e,{ref:r,sideCar:wae}))});hw.classNames=MC.classNames;var Sae=function(e){if(typeof document>"u")return null;var r=Array.isArray(e)?e[0]:e;return r.ownerDocument.body},Zm=new WeakMap,nj=new WeakMap,rj={},tT=0,PL=function(e){return e&&(e.host||PL(e.parentNode))},Eae=function(e,r){return r.map(function(s){if(e.contains(s))return s;var o=PL(s);return o&&e.contains(o)?o:(console.error("aria-hidden",s,"in not contained inside",e,". Doing nothing"),null)}).filter(function(s){return!!s})},jae=function(e,r,s,o){var u=Eae(r,Array.isArray(e)?e:[e]);rj[s]||(rj[s]=new WeakMap);var h=rj[s],m=[],g=new Set,b=new Set(u),w=function(A){!A||g.has(A)||(g.add(A),w(A.parentNode))};u.forEach(w);var E=function(A){!A||b.has(A)||Array.prototype.forEach.call(A.children,function(k){if(g.has(k))E(k);else try{var R=k.getAttribute(o),M=R!==null&&R!=="false",I=(Zm.get(k)||0)+1,F=(h.get(k)||0)+1;Zm.set(k,I),h.set(k,F),m.push(k),I===1&&M&&nj.set(k,!0),F===1&&k.setAttribute(s,"true"),M||k.setAttribute(o,"true")}catch(H){console.error("aria-hidden: cannot operate on ",k,H)}})};return E(r),g.clear(),tT++,function(){m.forEach(function(A){var k=Zm.get(A)-1,R=h.get(A)-1;Zm.set(A,k),h.set(A,R),k||(nj.has(A)||A.removeAttribute(o),nj.delete(A)),R||A.removeAttribute(s)}),tT--,tT||(Zm=new WeakMap,Zm=new WeakMap,nj=new WeakMap,rj={})}},IC=function(e,r,s){s===void 0&&(s="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),u=Sae(e);return u?(o.push.apply(o,Array.from(u.querySelectorAll("[aria-live], script"))),jae(o,u,s,"aria-hidden")):function(){return null}};function Cae(e){const r=Aae(e),s=T.forwardRef((o,u)=>{const{children:h,...m}=o,g=T.Children.toArray(h),b=g.find(kae);if(b){const w=b.props.children,E=g.map(A=>A===b?T.Children.count(w)>1?T.Children.only(null):T.isValidElement(w)?w.props.children:null:A);return c.jsx(r,{...m,ref:u,children:T.isValidElement(w)?T.cloneElement(w,void 0,E):null})}return c.jsx(r,{...m,ref:u,children:h})});return s.displayName=`${e}.Slot`,s}function Aae(e){const r=T.forwardRef((s,o)=>{const{children:u,...h}=s;if(T.isValidElement(u)){const m=Tae(u),g=Rae(h,u.props);return u.type!==T.Fragment&&(g.ref=o?Gi(o,m):m),T.cloneElement(u,g)}return T.Children.count(u)>1?T.Children.only(null):null});return r.displayName=`${e}.SlotClone`,r}var Oae=Symbol("radix.slottable");function kae(e){return T.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Oae}function Rae(e,r){const s={...r};for(const o in r){const u=e[o],h=r[o];/^on[A-Z]/.test(o)?u&&h?s[o]=(...g)=>{const b=h(...g);return u(...g),b}:u&&(s[o]=u):o==="style"?s[o]={...u,...h}:o==="className"&&(s[o]=[u,h].filter(Boolean).join(" "))}return{...e,...s}}function Tae(e){let r=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=r&&"isReactWarning"in r&&r.isReactWarning;return s?e.ref:(r=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=r&&"isReactWarning"in r&&r.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}var zC="Dialog",[ML,IL]=cl(zC),[_ae,ul]=ML(zC),zL=e=>{const{__scopeDialog:r,children:s,open:o,defaultOpen:u,onOpenChange:h,modal:m=!0}=e,g=T.useRef(null),b=T.useRef(null),[w,E]=Kd({prop:o,defaultProp:u??!1,onChange:h,caller:zC});return c.jsx(_ae,{scope:r,triggerRef:g,contentRef:b,contentId:Ys(),titleId:Ys(),descriptionId:Ys(),open:w,onOpenChange:E,onOpenToggle:T.useCallback(()=>E(A=>!A),[E]),modal:m,children:s})};zL.displayName=zC;var LL="DialogTrigger",FL=T.forwardRef((e,r)=>{const{__scopeDialog:s,...o}=e,u=ul(LL,s),h=Ln(r,u.triggerRef);return c.jsx(An.button,{type:"button","aria-haspopup":"dialog","aria-expanded":u.open,"aria-controls":u.contentId,"data-state":m2(u.open),...o,ref:h,onClick:Nt(e.onClick,u.onOpenToggle)})});FL.displayName=LL;var p2="DialogPortal",[$ae,qL]=ML(p2,{forceMount:void 0}),BL=e=>{const{__scopeDialog:r,forceMount:s,children:o,container:u}=e,h=ul(p2,r);return c.jsx($ae,{scope:r,forceMount:s,children:T.Children.map(o,m=>c.jsx(po,{present:s||h.open,children:c.jsx(Mg,{asChild:!0,container:u,children:m})}))})};BL.displayName=p2;var Xj="DialogOverlay",UL=T.forwardRef((e,r)=>{const s=qL(Xj,e.__scopeDialog),{forceMount:o=s.forceMount,...u}=e,h=ul(Xj,e.__scopeDialog);return h.modal?c.jsx(po,{present:o||h.open,children:c.jsx(Dae,{...u,ref:r})}):null});UL.displayName=Xj;var Nae=Cae("DialogOverlay.RemoveScroll"),Dae=T.forwardRef((e,r)=>{const{__scopeDialog:s,...o}=e,u=ul(Xj,s);return c.jsx(hw,{as:Nae,allowPinchZoom:!0,shards:[u.contentRef],children:c.jsx(An.div,{"data-state":m2(u.open),...o,ref:r,style:{pointerEvents:"auto",...o.style}})})}),$p="DialogContent",KL=T.forwardRef((e,r)=>{const s=qL($p,e.__scopeDialog),{forceMount:o=s.forceMount,...u}=e,h=ul($p,e.__scopeDialog);return c.jsx(po,{present:o||h.open,children:h.modal?c.jsx(Pae,{...u,ref:r}):c.jsx(Mae,{...u,ref:r})})});KL.displayName=$p;var Pae=T.forwardRef((e,r)=>{const s=ul($p,e.__scopeDialog),o=T.useRef(null),u=Ln(r,s.contentRef,o);return T.useEffect(()=>{const h=o.current;if(h)return IC(h)},[]),c.jsx(VL,{...e,ref:u,trapFocus:s.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Nt(e.onCloseAutoFocus,h=>{h.preventDefault(),s.triggerRef.current?.focus()}),onPointerDownOutside:Nt(e.onPointerDownOutside,h=>{const m=h.detail.originalEvent,g=m.button===0&&m.ctrlKey===!0;(m.button===2||g)&&h.preventDefault()}),onFocusOutside:Nt(e.onFocusOutside,h=>h.preventDefault())})}),Mae=T.forwardRef((e,r)=>{const s=ul($p,e.__scopeDialog),o=T.useRef(!1),u=T.useRef(!1);return c.jsx(VL,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:h=>{e.onCloseAutoFocus?.(h),h.defaultPrevented||(o.current||s.triggerRef.current?.focus(),h.preventDefault()),o.current=!1,u.current=!1},onInteractOutside:h=>{e.onInteractOutside?.(h),h.defaultPrevented||(o.current=!0,h.detail.originalEvent.type==="pointerdown"&&(u.current=!0));const m=h.target;s.triggerRef.current?.contains(m)&&h.preventDefault(),h.detail.originalEvent.type==="focusin"&&u.current&&h.preventDefault()}})}),VL=T.forwardRef((e,r)=>{const{__scopeDialog:s,trapFocus:o,onOpenAutoFocus:u,onCloseAutoFocus:h,...m}=e,g=ul($p,s),b=T.useRef(null),w=Ln(r,b);return PC(),c.jsxs(c.Fragment,{children:[c.jsx(dw,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:u,onUnmountAutoFocus:h,children:c.jsx(Ng,{role:"dialog",id:g.contentId,"aria-describedby":g.descriptionId,"aria-labelledby":g.titleId,"data-state":m2(g.open),...m,ref:w,onDismiss:()=>g.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(zae,{titleId:g.titleId}),c.jsx(Fae,{contentRef:b,descriptionId:g.descriptionId})]})]})}),f2="DialogTitle",HL=T.forwardRef((e,r)=>{const{__scopeDialog:s,...o}=e,u=ul(f2,s);return c.jsx(An.h2,{id:u.titleId,...o,ref:r})});HL.displayName=f2;var GL="DialogDescription",XL=T.forwardRef((e,r)=>{const{__scopeDialog:s,...o}=e,u=ul(GL,s);return c.jsx(An.p,{id:u.descriptionId,...o,ref:r})});XL.displayName=GL;var YL="DialogClose",ZL=T.forwardRef((e,r)=>{const{__scopeDialog:s,...o}=e,u=ul(YL,s);return c.jsx(An.button,{type:"button",...o,ref:r,onClick:Nt(e.onClick,()=>u.onOpenChange(!1))})});ZL.displayName=YL;function m2(e){return e?"open":"closed"}var JL="DialogTitleWarning",[Iae,WL]=Kne(JL,{contentName:$p,titleName:f2,docsSlug:"dialog"}),zae=({titleId:e})=>{const r=WL(JL),s=`\`${r.contentName}\` requires a \`${r.titleName}\` for the component to be accessible for screen reader users. If you want to hide the \`${r.titleName}\`, you can wrap it with our VisuallyHidden component. For more information, see https://radix-ui.com/primitives/docs/components/${r.docsSlug}`;return T.useEffect(()=>{e&&(document.getElementById(e)||console.error(s))},[s,e]),null},Lae="DialogDescriptionWarning",Fae=({contentRef:e,descriptionId:r})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${WL(Lae).contentName}}.`;return T.useEffect(()=>{const u=e.current?.getAttribute("aria-describedby");r&&u&&(document.getElementById(r)||console.warn(o))},[o,e,r]),null},LC=zL,QL=FL,FC=BL,qC=UL,BC=KL,g2=HL,y2=XL,pw=ZL,qae=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Zd=qae.reduce((e,r)=>{const s=iw(`Primitive.${r}`),o=T.forwardRef((u,h)=>{const{asChild:m,...g}=u,b=m?s:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(b,{...g,ref:h})});return o.displayName=`Primitive.${r}`,{...e,[r]:o}},{}),ub='[cmdk-group=""]',nT='[cmdk-group-items=""]',Bae='[cmdk-group-heading=""]',e5='[cmdk-item=""]',MI=`${e5}:not([aria-disabled="true"])`,QT="cmdk-item-select",Qm="data-value",Uae=(e,r,s)=>$ie(e,r,s),t5=T.createContext(void 0),fw=()=>T.useContext(t5),n5=T.createContext(void 0),v2=()=>T.useContext(n5),r5=T.createContext(void 0),s5=T.forwardRef((e,r)=>{let s=eg(()=>{var Oe,Te;return{search:"",value:(Te=(Oe=e.value)!=null?Oe:e.defaultValue)!=null?Te:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),o=eg(()=>new Set),u=eg(()=>new Map),h=eg(()=>new Map),m=eg(()=>new Set),g=i5(e),{label:b,children:w,value:E,onValueChange:A,filter:k,shouldFilter:R,loop:M,disablePointerSelection:I=!1,vimBindings:F=!0,...H}=e,V=Ys(),K=Ys(),z=Ys(),W=T.useRef(null),ae=eoe();Np(()=>{if(E!==void 0){let Oe=E.trim();s.current.value=Oe,Q.emit()}},[E]),Np(()=>{ae(6,Se)},[]);let Q=T.useMemo(()=>({subscribe:Oe=>(m.current.add(Oe),()=>m.current.delete(Oe)),snapshot:()=>s.current,setState:(Oe,Te,Ke)=>{var se,Ne,Fe,at;if(!Object.is(s.current[Oe],Te)){if(s.current[Oe]=Te,Oe==="search")ie(),je(),ae(1,we);else if(Oe==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let gt=document.getElementById(z);gt?gt.focus():(se=document.getElementById(V))==null||se.focus()}if(ae(7,()=>{var gt;s.current.selectedItemId=(gt=Ae())==null?void 0:gt.id,Q.emit()}),Ke||ae(5,Se),((Ne=g.current)==null?void 0:Ne.value)!==void 0){let gt=Te??"";(at=(Fe=g.current).onValueChange)==null||at.call(Fe,gt);return}}Q.emit()}},emit:()=>{m.current.forEach(Oe=>Oe())}}),[]),te=T.useMemo(()=>({value:(Oe,Te,Ke)=>{var se;Te!==((se=h.current.get(Oe))==null?void 0:se.value)&&(h.current.set(Oe,{value:Te,keywords:Ke}),s.current.filtered.items.set(Oe,de(Te,Ke)),ae(2,()=>{je(),Q.emit()}))},item:(Oe,Te)=>(o.current.add(Oe),Te&&(u.current.has(Te)?u.current.get(Te).add(Oe):u.current.set(Te,new Set([Oe]))),ae(3,()=>{ie(),je(),s.current.value||we(),Q.emit()}),()=>{h.current.delete(Oe),o.current.delete(Oe),s.current.filtered.items.delete(Oe);let Ke=Ae();ae(4,()=>{ie(),Ke?.getAttribute("id")===Oe&&we(),Q.emit()})}),group:Oe=>(u.current.has(Oe)||u.current.set(Oe,new Set),()=>{h.current.delete(Oe),u.current.delete(Oe)}),filter:()=>g.current.shouldFilter,label:b||e["aria-label"],getDisablePointerSelection:()=>g.current.disablePointerSelection,listId:V,inputId:z,labelId:K,listInnerRef:W}),[]);function de(Oe,Te){var Ke,se;let Ne=(se=(Ke=g.current)==null?void 0:Ke.filter)!=null?se:Uae;return Oe?Ne(Oe,s.current.search,Te):0}function je(){if(!s.current.search||g.current.shouldFilter===!1)return;let Oe=s.current.filtered.items,Te=[];s.current.filtered.groups.forEach(se=>{let Ne=u.current.get(se),Fe=0;Ne.forEach(at=>{let gt=Oe.get(at);Fe=Math.max(gt,Fe)}),Te.push([se,Fe])});let Ke=W.current;He().sort((se,Ne)=>{var Fe,at;let gt=se.getAttribute("id"),Ot=Ne.getAttribute("id");return((Fe=Oe.get(Ot))!=null?Fe:0)-((at=Oe.get(gt))!=null?at:0)}).forEach(se=>{let Ne=se.closest(nT);Ne?Ne.appendChild(se.parentElement===Ne?se:se.closest(`${nT} > *`)):Ke.appendChild(se.parentElement===Ke?se:se.closest(`${nT} > *`))}),Te.sort((se,Ne)=>Ne[1]-se[1]).forEach(se=>{var Ne;let Fe=(Ne=W.current)==null?void 0:Ne.querySelector(`${ub}[${Qm}="${encodeURIComponent(se[0])}"]`);Fe?.parentElement.appendChild(Fe)})}function we(){let Oe=He().find(Ke=>Ke.getAttribute("aria-disabled")!=="true"),Te=Oe?.getAttribute(Qm);Q.setState("value",Te||void 0)}function ie(){var Oe,Te,Ke,se;if(!s.current.search||g.current.shouldFilter===!1){s.current.filtered.count=o.current.size;return}s.current.filtered.groups=new Set;let Ne=0;for(let Fe of o.current){let at=(Te=(Oe=h.current.get(Fe))==null?void 0:Oe.value)!=null?Te:"",gt=(se=(Ke=h.current.get(Fe))==null?void 0:Ke.keywords)!=null?se:[],Ot=de(at,gt);s.current.filtered.items.set(Fe,Ot),Ot>0&&Ne++}for(let[Fe,at]of u.current)for(let gt of at)if(s.current.filtered.items.get(gt)>0){s.current.filtered.groups.add(Fe);break}s.current.filtered.count=Ne}function Se(){var Oe,Te,Ke;let se=Ae();se&&(((Oe=se.parentElement)==null?void 0:Oe.firstChild)===se&&((Ke=(Te=se.closest(ub))==null?void 0:Te.querySelector(Bae))==null||Ke.scrollIntoView({block:"nearest"})),se.scrollIntoView({block:"nearest"}))}function Ae(){var Oe;return(Oe=W.current)==null?void 0:Oe.querySelector(`${e5}[aria-selected="true"]`)}function He(){var Oe;return Array.from(((Oe=W.current)==null?void 0:Oe.querySelectorAll(MI))||[])}function ue(Oe){let Te=He()[Oe];Te&&Q.setState("value",Te.getAttribute(Qm))}function ne(Oe){var Te;let Ke=Ae(),se=He(),Ne=se.findIndex(at=>at===Ke),Fe=se[Ne+Oe];(Te=g.current)!=null&&Te.loop&&(Fe=Ne+Oe<0?se[se.length-1]:Ne+Oe===se.length?se[0]:se[Ne+Oe]),Fe&&Q.setState("value",Fe.getAttribute(Qm))}function ce(Oe){let Te=Ae(),Ke=Te?.closest(ub),se;for(;Ke&&!se;)Ke=Oe>0?Wae(Ke,ub):Qae(Ke,ub),se=Ke?.querySelector(MI);se?Q.setState("value",se.getAttribute(Qm)):ne(Oe)}let $e=()=>ue(He().length-1),me=Oe=>{Oe.preventDefault(),Oe.metaKey?$e():Oe.altKey?ce(1):ne(1)},Xe=Oe=>{Oe.preventDefault(),Oe.metaKey?ue(0):Oe.altKey?ce(-1):ne(-1)};return T.createElement(Zd.div,{ref:r,tabIndex:-1,...H,"cmdk-root":"",onKeyDown:Oe=>{var Te;(Te=H.onKeyDown)==null||Te.call(H,Oe);let Ke=Oe.nativeEvent.isComposing||Oe.keyCode===229;if(!(Oe.defaultPrevented||Ke))switch(Oe.key){case"n":case"j":{F&&Oe.ctrlKey&&me(Oe);break}case"ArrowDown":{me(Oe);break}case"p":case"k":{F&&Oe.ctrlKey&&Xe(Oe);break}case"ArrowUp":{Xe(Oe);break}case"Home":{Oe.preventDefault(),ue(0);break}case"End":{Oe.preventDefault(),$e();break}case"Enter":{Oe.preventDefault();let se=Ae();if(se){let Ne=new Event(QT);se.dispatchEvent(Ne)}}}}},T.createElement("label",{"cmdk-label":"",htmlFor:te.inputId,id:te.labelId,style:noe},b),UC(e,Oe=>T.createElement(n5.Provider,{value:Q},T.createElement(t5.Provider,{value:te},Oe))))}),Kae=T.forwardRef((e,r)=>{var s,o;let u=Ys(),h=T.useRef(null),m=T.useContext(r5),g=fw(),b=i5(e),w=(o=(s=b.current)==null?void 0:s.forceMount)!=null?o:m?.forceMount;Np(()=>{if(!w)return g.item(u,m?.id)},[w]);let E=a5(u,h,[e.value,e.children,h],e.keywords),A=v2(),k=Vd(ae=>ae.value&&ae.value===E.current),R=Vd(ae=>w||g.filter()===!1?!0:ae.search?ae.filtered.items.get(u)>0:!0);T.useEffect(()=>{let ae=h.current;if(!(!ae||e.disabled))return ae.addEventListener(QT,M),()=>ae.removeEventListener(QT,M)},[R,e.onSelect,e.disabled]);function M(){var ae,Q;I(),(Q=(ae=b.current).onSelect)==null||Q.call(ae,E.current)}function I(){A.setState("value",E.current,!0)}if(!R)return null;let{disabled:F,value:H,onSelect:V,forceMount:K,keywords:z,...W}=e;return T.createElement(Zd.div,{ref:Gi(h,r),...W,id:u,"cmdk-item":"",role:"option","aria-disabled":!!F,"aria-selected":!!k,"data-disabled":!!F,"data-selected":!!k,onPointerMove:F||g.getDisablePointerSelection()?void 0:I,onClick:F?void 0:M},e.children)}),Vae=T.forwardRef((e,r)=>{let{heading:s,children:o,forceMount:u,...h}=e,m=Ys(),g=T.useRef(null),b=T.useRef(null),w=Ys(),E=fw(),A=Vd(R=>u||E.filter()===!1?!0:R.search?R.filtered.groups.has(m):!0);Np(()=>E.group(m),[]),a5(m,g,[e.value,e.heading,b]);let k=T.useMemo(()=>({id:m,forceMount:u}),[u]);return T.createElement(Zd.div,{ref:Gi(g,r),...h,"cmdk-group":"",role:"presentation",hidden:A?void 0:!0},s&&T.createElement("div",{ref:b,"cmdk-group-heading":"","aria-hidden":!0,id:w},s),UC(e,R=>T.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":s?w:void 0},T.createElement(r5.Provider,{value:k},R))))}),Hae=T.forwardRef((e,r)=>{let{alwaysRender:s,...o}=e,u=T.useRef(null),h=Vd(m=>!m.search);return!s&&!h?null:T.createElement(Zd.div,{ref:Gi(u,r),...o,"cmdk-separator":"",role:"separator"})}),Gae=T.forwardRef((e,r)=>{let{onValueChange:s,...o}=e,u=e.value!=null,h=v2(),m=Vd(w=>w.search),g=Vd(w=>w.selectedItemId),b=fw();return T.useEffect(()=>{e.value!=null&&h.setState("search",e.value)},[e.value]),T.createElement(Zd.input,{ref:r,...o,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":b.listId,"aria-labelledby":b.labelId,"aria-activedescendant":g,id:b.inputId,type:"text",value:u?e.value:m,onChange:w=>{u||h.setState("search",w.target.value),s?.(w.target.value)}})}),Xae=T.forwardRef((e,r)=>{let{children:s,label:o="Suggestions",...u}=e,h=T.useRef(null),m=T.useRef(null),g=Vd(w=>w.selectedItemId),b=fw();return T.useEffect(()=>{if(m.current&&h.current){let w=m.current,E=h.current,A,k=new ResizeObserver(()=>{A=requestAnimationFrame(()=>{let R=w.offsetHeight;E.style.setProperty("--cmdk-list-height",R.toFixed(1)+"px")})});return k.observe(w),()=>{cancelAnimationFrame(A),k.unobserve(w)}}},[]),T.createElement(Zd.div,{ref:Gi(h,r),...u,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":g,"aria-label":o,id:b.listId},UC(e,w=>T.createElement("div",{ref:Gi(m,b.listInnerRef),"cmdk-list-sizer":""},w)))}),Yae=T.forwardRef((e,r)=>{let{open:s,onOpenChange:o,overlayClassName:u,contentClassName:h,container:m,...g}=e;return T.createElement(LC,{open:s,onOpenChange:o},T.createElement(FC,{container:m},T.createElement(qC,{"cmdk-overlay":"",className:u}),T.createElement(BC,{"aria-label":e.label,"cmdk-dialog":"",className:h},T.createElement(s5,{ref:r,...g}))))}),Zae=T.forwardRef((e,r)=>Vd(s=>s.filtered.count===0)?T.createElement(Zd.div,{ref:r,...e,"cmdk-empty":"",role:"presentation"}):null),Jae=T.forwardRef((e,r)=>{let{progress:s,children:o,label:u="Loading...",...h}=e;return T.createElement(Zd.div,{ref:r,...h,"cmdk-loading":"",role:"progressbar","aria-valuenow":s,"aria-valuemin":0,"aria-valuemax":100,"aria-label":u},UC(e,m=>T.createElement("div",{"aria-hidden":!0},m)))}),Ig=Object.assign(s5,{List:Xae,Item:Kae,Input:Gae,Group:Vae,Separator:Hae,Dialog:Yae,Empty:Zae,Loading:Jae});function Wae(e,r){let s=e.nextElementSibling;for(;s;){if(s.matches(r))return s;s=s.nextElementSibling}}function Qae(e,r){let s=e.previousElementSibling;for(;s;){if(s.matches(r))return s;s=s.previousElementSibling}}function i5(e){let r=T.useRef(e);return Np(()=>{r.current=e}),r}var Np=typeof window>"u"?T.useEffect:T.useLayoutEffect;function eg(e){let r=T.useRef();return r.current===void 0&&(r.current=e()),r}function Vd(e){let r=v2(),s=()=>e(r.snapshot());return T.useSyncExternalStore(r.subscribe,s,s)}function a5(e,r,s,o=[]){let u=T.useRef(),h=fw();return Np(()=>{var m;let g=(()=>{var w;for(let E of s){if(typeof E=="string")return E.trim();if(typeof E=="object"&&"current"in E)return E.current?(w=E.current.textContent)==null?void 0:w.trim():u.current}})(),b=o.map(w=>w.trim());h.value(e,g,b),(m=r.current)==null||m.setAttribute(Qm,g),u.current=g}),u}var eoe=()=>{let[e,r]=T.useState(),s=eg(()=>new Map);return Np(()=>{s.current.forEach(o=>o()),s.current=new Map},[e]),(o,u)=>{s.current.set(o,u),r({})}};function toe(e){let r=e.type;return typeof r=="function"?r(e.props):"render"in r?r.render(e.props):e}function UC({asChild:e,children:r},s){return e&&T.isValidElement(r)?T.cloneElement(toe(r),{ref:r.ref},s(r.props.children)):s(r)}var noe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function dn({...e}){return c.jsx(LC,{"data-slot":"dialog",...e})}function Ai({...e}){return c.jsx(QL,{"data-slot":"dialog-trigger",...e})}function roe({...e}){return c.jsx(FC,{"data-slot":"dialog-portal",...e})}function Yj({...e}){return c.jsx(pw,{"data-slot":"dialog-close",...e})}function soe({className:e,...r}){return c.jsx(qC,{"data-slot":"dialog-overlay",className:vt("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),...r})}function hn({className:e,children:r,showCloseButton:s=!0,...o}){return c.jsxs(roe,{"data-slot":"dialog-portal",children:[c.jsx(soe,{}),c.jsxs(BC,{"data-slot":"dialog-content",className:vt("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),...o,children:[r,s&&c.jsxs(pw,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[c.jsx(W_,{}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function pn({className:e,...r}){return c.jsx("div",{"data-slot":"dialog-header",className:vt("flex flex-col gap-2 text-center sm:text-left",e),...r})}function gn({className:e,...r}){return c.jsx("div",{"data-slot":"dialog-footer",className:vt("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...r})}function fn({className:e,...r}){return c.jsx(g2,{"data-slot":"dialog-title",className:vt("text-lg leading-none font-semibold",e),...r})}function rT({className:e,...r}){return c.jsx(y2,{"data-slot":"dialog-description",className:vt("text-muted-foreground text-sm",e),...r})}function ioe({className:e,...r}){return c.jsx(Ig,{"data-slot":"command",className:vt("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...r})}function aoe({className:e,...r}){return c.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[c.jsx(va,{className:"size-4 shrink-0 opacity-50"}),c.jsx(Ig.Input,{"data-slot":"command-input",className:vt("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),...r})]})}function ooe({className:e,...r}){return c.jsx(Ig.List,{"data-slot":"command-list",className:vt("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...r})}function loe({...e}){return c.jsx(Ig.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function coe({className:e,...r}){return c.jsx(Ig.Group,{"data-slot":"command-group",className:vt("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),...r})}function uoe({className:e,...r}){return c.jsx(Ig.Item,{"data-slot":"command-item",className:vt("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),...r})}function doe(e){const r=hoe(e),s=T.forwardRef((o,u)=>{const{children:h,...m}=o,g=T.Children.toArray(h),b=g.find(foe);if(b){const w=b.props.children,E=g.map(A=>A===b?T.Children.count(w)>1?T.Children.only(null):T.isValidElement(w)?w.props.children:null:A);return c.jsx(r,{...m,ref:u,children:T.isValidElement(w)?T.cloneElement(w,void 0,E):null})}return c.jsx(r,{...m,ref:u,children:h})});return s.displayName=`${e}.Slot`,s}function hoe(e){const r=T.forwardRef((s,o)=>{const{children:u,...h}=s;if(T.isValidElement(u)){const m=goe(u),g=moe(h,u.props);return u.type!==T.Fragment&&(g.ref=o?Gi(o,m):m),T.cloneElement(u,g)}return T.Children.count(u)>1?T.Children.only(null):null});return r.displayName=`${e}.SlotClone`,r}var poe=Symbol("radix.slottable");function foe(e){return T.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===poe}function moe(e,r){const s={...r};for(const o in r){const u=e[o],h=r[o];/^on[A-Z]/.test(o)?u&&h?s[o]=(...g)=>{const b=h(...g);return u(...g),b}:u&&(s[o]=u):o==="style"?s[o]={...u,...h}:o==="className"&&(s[o]=[u,h].filter(Boolean).join(" "))}return{...e,...s}}function goe(e){let r=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=r&&"isReactWarning"in r&&r.isReactWarning;return s?e.ref:(r=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=r&&"isReactWarning"in r&&r.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}var KC="Popover",[o5]=cl(KC,[Yd]),mw=Yd(),[yoe,Jd]=o5(KC),l5=e=>{const{__scopePopover:r,children:s,open:o,defaultOpen:u,onOpenChange:h,modal:m=!1}=e,g=mw(r),b=T.useRef(null),[w,E]=T.useState(!1),[A,k]=Kd({prop:o,defaultProp:u??!1,onChange:h,caller:KC});return c.jsx(TC,{...g,children:c.jsx(yoe,{scope:r,contentId:Ys(),triggerRef:b,open:A,onOpenChange:k,onOpenToggle:T.useCallback(()=>k(R=>!R),[k]),hasCustomAnchor:w,onCustomAnchorAdd:T.useCallback(()=>E(!0),[]),onCustomAnchorRemove:T.useCallback(()=>E(!1),[]),modal:m,children:s})})};l5.displayName=KC;var c5="PopoverAnchor",voe=T.forwardRef((e,r)=>{const{__scopePopover:s,...o}=e,u=Jd(c5,s),h=mw(s),{onCustomAnchorAdd:m,onCustomAnchorRemove:g}=u;return T.useEffect(()=>(m(),()=>g()),[m,g]),c.jsx(ow,{...h,...o,ref:r})});voe.displayName=c5;var u5="PopoverTrigger",d5=T.forwardRef((e,r)=>{const{__scopePopover:s,...o}=e,u=Jd(u5,s),h=mw(s),m=Ln(r,u.triggerRef),g=c.jsx(An.button,{type:"button","aria-haspopup":"dialog","aria-expanded":u.open,"aria-controls":u.contentId,"data-state":g5(u.open),...o,ref:m,onClick:Nt(e.onClick,u.onOpenToggle)});return u.hasCustomAnchor?g:c.jsx(ow,{asChild:!0,...h,children:g})});d5.displayName=u5;var x2="PopoverPortal",[xoe,boe]=o5(x2,{forceMount:void 0}),h5=e=>{const{__scopePopover:r,forceMount:s,children:o,container:u}=e,h=Jd(x2,r);return c.jsx(xoe,{scope:r,forceMount:s,children:c.jsx(po,{present:s||h.open,children:c.jsx(Mg,{asChild:!0,container:u,children:o})})})};h5.displayName=x2;var jg="PopoverContent",p5=T.forwardRef((e,r)=>{const s=boe(jg,e.__scopePopover),{forceMount:o=s.forceMount,...u}=e,h=Jd(jg,e.__scopePopover);return c.jsx(po,{present:o||h.open,children:h.modal?c.jsx(Soe,{...u,ref:r}):c.jsx(Eoe,{...u,ref:r})})});p5.displayName=jg;var woe=doe("PopoverContent.RemoveScroll"),Soe=T.forwardRef((e,r)=>{const s=Jd(jg,e.__scopePopover),o=T.useRef(null),u=Ln(r,o),h=T.useRef(!1);return T.useEffect(()=>{const m=o.current;if(m)return IC(m)},[]),c.jsx(hw,{as:woe,allowPinchZoom:!0,children:c.jsx(f5,{...e,ref:u,trapFocus:s.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Nt(e.onCloseAutoFocus,m=>{m.preventDefault(),h.current||s.triggerRef.current?.focus()}),onPointerDownOutside:Nt(e.onPointerDownOutside,m=>{const g=m.detail.originalEvent,b=g.button===0&&g.ctrlKey===!0,w=g.button===2||b;h.current=w},{checkForDefaultPrevented:!1}),onFocusOutside:Nt(e.onFocusOutside,m=>m.preventDefault(),{checkForDefaultPrevented:!1})})})}),Eoe=T.forwardRef((e,r)=>{const s=Jd(jg,e.__scopePopover),o=T.useRef(!1),u=T.useRef(!1);return c.jsx(f5,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:h=>{e.onCloseAutoFocus?.(h),h.defaultPrevented||(o.current||s.triggerRef.current?.focus(),h.preventDefault()),o.current=!1,u.current=!1},onInteractOutside:h=>{e.onInteractOutside?.(h),h.defaultPrevented||(o.current=!0,h.detail.originalEvent.type==="pointerdown"&&(u.current=!0));const m=h.target;s.triggerRef.current?.contains(m)&&h.preventDefault(),h.detail.originalEvent.type==="focusin"&&u.current&&h.preventDefault()}})}),f5=T.forwardRef((e,r)=>{const{__scopePopover:s,trapFocus:o,onOpenAutoFocus:u,onCloseAutoFocus:h,disableOutsidePointerEvents:m,onEscapeKeyDown:g,onPointerDownOutside:b,onFocusOutside:w,onInteractOutside:E,...A}=e,k=Jd(jg,s),R=mw(s);return PC(),c.jsx(dw,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:u,onUnmountAutoFocus:h,children:c.jsx(Ng,{asChild:!0,disableOutsidePointerEvents:m,onInteractOutside:E,onEscapeKeyDown:g,onPointerDownOutside:b,onFocusOutside:w,onDismiss:()=>k.onOpenChange(!1),children:c.jsx(_C,{"data-state":g5(k.open),role:"dialog",id:k.contentId,...R,...A,ref:r,style:{...A.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)"}})})})}),m5="PopoverClose",joe=T.forwardRef((e,r)=>{const{__scopePopover:s,...o}=e,u=Jd(m5,s);return c.jsx(An.button,{type:"button",...o,ref:r,onClick:Nt(e.onClick,()=>u.onOpenChange(!1))})});joe.displayName=m5;var Coe="PopoverArrow",Aoe=T.forwardRef((e,r)=>{const{__scopePopover:s,...o}=e,u=mw(s);return c.jsx($C,{...u,...o,ref:r})});Aoe.displayName=Coe;function g5(e){return e?"open":"closed"}var Ooe=l5,koe=d5,Roe=h5,Toe=p5;function _oe({...e}){return c.jsx(Ooe,{"data-slot":"popover",...e})}function $oe({...e}){return c.jsx(koe,{"data-slot":"popover-trigger",...e})}function Noe({className:e,align:r="center",sideOffset:s=4,...o}){return c.jsx(Roe,{children:c.jsx(Toe,{"data-slot":"popover-content",align:r,sideOffset:s,className:vt("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),...o})})}const Doe=({orgs:e})=>{const[r,s]=T.useState(!1),[o,u]=T.useState(rl.get()??"");T.useEffect(()=>rl.subscribe(m=>u(m??"")),[]);const h=e.find(m=>m.id===o);return c.jsxs(_oe,{open:r,onOpenChange:s,children:[c.jsx($oe,{asChild:!0,children:c.jsxs(Pe,{variant:"ghost",className:"h-9 w-full justify-between px-2","aria-label":"Switch organization",children:[c.jsxs("span",{className:"flex items-center gap-2 truncate",children:[c.jsx(mz,{className:"h-4 w-4"}),c.jsx("span",{className:"truncate",children:h?.name??"Select org"})]}),c.jsx(VZ,{className:"ml-2 h-4 w-4 opacity-50"})]})}),c.jsx(Noe,{className:"w-[280px] p-0",align:"start",children:c.jsxs(ioe,{children:[c.jsx(aoe,{placeholder:"Search orgs..."}),c.jsxs(ooe,{children:[c.jsx(loe,{children:"No orgs found."}),c.jsx(coe,{heading:"Organizations",children:e.map(m=>c.jsxs(uoe,{value:m.id,onSelect:g=>{rl.set(g),s(!1)},children:[c.jsx(gz,{className:vt("mr-2 h-4 w-4",o===m.id?"opacity-100":"opacity-0")}),c.jsx("span",{className:"truncate",children:m.name})]},m.id))})]})]})})]})},y5=T.createContext({});function Poe(e){const r=T.useRef(null);return r.current===null&&(r.current=e()),r.current}const b2=typeof window<"u",Moe=b2?T.useLayoutEffect:T.useEffect,w2=T.createContext(null);function S2(e,r){e.indexOf(r)===-1&&e.push(r)}function E2(e,r){const s=e.indexOf(r);s>-1&&e.splice(s,1)}const vu=(e,r,s)=>s>r?r:s{};const xu={},v5=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function x5(e){return typeof e=="object"&&e!==null}const b5=e=>/^0[^.\s]+$/u.test(e);function C2(e){let r;return()=>(r===void 0&&(r=e()),r)}const co=e=>e,Ioe=(e,r)=>s=>r(e(s)),gw=(...e)=>e.reduce(Ioe),Xb=(e,r,s)=>{const o=r-e;return o===0?1:(s-e)/o};class A2{constructor(){this.subscriptions=[]}add(r){return S2(this.subscriptions,r),()=>E2(this.subscriptions,r)}notify(r,s,o){const u=this.subscriptions.length;if(u)if(u===1)this.subscriptions[0](r,s,o);else for(let h=0;he*1e3,lo=e=>e/1e3;function w5(e,r){return r?e*(1e3/r):0}const S5=(e,r,s)=>(((1-3*s+3*r)*e+(3*s-6*r))*e+3*r)*e,zoe=1e-7,Loe=12;function Foe(e,r,s,o,u){let h,m,g=0;do m=r+(s-r)/2,h=S5(m,o,u)-e,h>0?s=m:r=m;while(Math.abs(h)>zoe&&++gFoe(h,0,1,e,s);return h=>h===0||h===1?h:S5(u(h),r,o)}const E5=e=>r=>r<=.5?e(2*r)/2:(2-e(2*(1-r)))/2,j5=e=>r=>1-e(1-r),C5=yw(.33,1.53,.69,.99),O2=j5(C5),A5=E5(O2),O5=e=>(e*=2)<1?.5*O2(e):.5*(2-Math.pow(2,-10*(e-1))),k2=e=>1-Math.sin(Math.acos(e)),k5=j5(k2),R5=E5(k2),qoe=yw(.42,0,1,1),Boe=yw(0,0,.58,1),T5=yw(.42,0,.58,1),Uoe=e=>Array.isArray(e)&&typeof e[0]!="number",_5=e=>Array.isArray(e)&&typeof e[0]=="number",Koe={linear:co,easeIn:qoe,easeInOut:T5,easeOut:Boe,circIn:k2,circInOut:R5,circOut:k5,backIn:O2,backInOut:A5,backOut:C5,anticipate:O5},Voe=e=>typeof e=="string",II=e=>{if(_5(e)){j2(e.length===4);const[r,s,o,u]=e;return yw(r,s,o,u)}else if(Voe(e))return Koe[e];return e},sj=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Hoe(e,r){let s=new Set,o=new Set,u=!1,h=!1;const m=new WeakSet;let g={delta:0,timestamp:0,isProcessing:!1};function b(E){m.has(E)&&(w.schedule(E),e()),E(g)}const w={schedule:(E,A=!1,k=!1)=>{const M=k&&u?s:o;return A&&m.add(E),M.has(E)||M.add(E),E},cancel:E=>{o.delete(E),m.delete(E)},process:E=>{if(g=E,u){h=!0;return}u=!0,[s,o]=[o,s],s.forEach(b),s.clear(),u=!1,h&&(h=!1,w.process(E))}};return w}const Goe=40;function $5(e,r){let s=!1,o=!0;const u={delta:0,timestamp:0,isProcessing:!1},h=()=>s=!0,m=sj.reduce((K,z)=>(K[z]=Hoe(h),K),{}),{setup:g,read:b,resolveKeyframes:w,preUpdate:E,update:A,preRender:k,render:R,postRender:M}=m,I=()=>{const K=xu.useManualTiming?u.timestamp:performance.now();s=!1,xu.useManualTiming||(u.delta=o?1e3/60:Math.max(Math.min(K-u.timestamp,Goe),1)),u.timestamp=K,u.isProcessing=!0,g.process(u),b.process(u),w.process(u),E.process(u),A.process(u),k.process(u),R.process(u),M.process(u),u.isProcessing=!1,s&&r&&(o=!1,e(I))},F=()=>{s=!0,o=!0,u.isProcessing||e(I)};return{schedule:sj.reduce((K,z)=>{const W=m[z];return K[z]=(ae,Q=!1,te=!1)=>(s||F(),W.schedule(ae,Q,te)),K},{}),cancel:K=>{for(let z=0;z(jj===void 0&&ga.set(Hs.isProcessing||xu.useManualTiming?Hs.timestamp:performance.now()),jj),set:e=>{jj=e,queueMicrotask(Xoe)}},N5=e=>r=>typeof r=="string"&&r.startsWith(e),D5=N5("--"),Yoe=N5("var(--"),R2=e=>Yoe(e)?Zoe.test(e.split("/*")[0].trim()):!1,Zoe=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,zg={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Yb={...zg,transform:e=>vu(0,1,e)},ij={...zg,default:1},zb=e=>Math.round(e*1e5)/1e5,T2=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Joe(e){return e==null}const Woe=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,_2=(e,r)=>s=>!!(typeof s=="string"&&Woe.test(s)&&s.startsWith(e)||r&&!Joe(s)&&Object.prototype.hasOwnProperty.call(s,r)),P5=(e,r,s)=>o=>{if(typeof o!="string")return o;const[u,h,m,g]=o.match(T2);return{[e]:parseFloat(u),[r]:parseFloat(h),[s]:parseFloat(m),alpha:g!==void 0?parseFloat(g):1}},Qoe=e=>vu(0,255,e),iT={...zg,transform:e=>Math.round(Qoe(e))},Ep={test:_2("rgb","red"),parse:P5("red","green","blue"),transform:({red:e,green:r,blue:s,alpha:o=1})=>"rgba("+iT.transform(e)+", "+iT.transform(r)+", "+iT.transform(s)+", "+zb(Yb.transform(o))+")"};function ele(e){let r="",s="",o="",u="";return e.length>5?(r=e.substring(1,3),s=e.substring(3,5),o=e.substring(5,7),u=e.substring(7,9)):(r=e.substring(1,2),s=e.substring(2,3),o=e.substring(3,4),u=e.substring(4,5),r+=r,s+=s,o+=o,u+=u),{red:parseInt(r,16),green:parseInt(s,16),blue:parseInt(o,16),alpha:u?parseInt(u,16)/255:1}}const e_={test:_2("#"),parse:ele,transform:Ep.transform},vw=e=>({test:r=>typeof r=="string"&&r.endsWith(e)&&r.split(" ").length===1,parse:parseFloat,transform:r=>`${r}${e}`}),Ld=vw("deg"),cc=vw("%"),sn=vw("px"),tle=vw("vh"),nle=vw("vw"),zI={...cc,parse:e=>cc.parse(e)/100,transform:e=>cc.transform(e*100)},lg={test:_2("hsl","hue"),parse:P5("hue","saturation","lightness"),transform:({hue:e,saturation:r,lightness:s,alpha:o=1})=>"hsla("+Math.round(e)+", "+cc.transform(zb(r))+", "+cc.transform(zb(s))+", "+zb(Yb.transform(o))+")"},gs={test:e=>Ep.test(e)||e_.test(e)||lg.test(e),parse:e=>Ep.test(e)?Ep.parse(e):lg.test(e)?lg.parse(e):e_.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ep.transform(e):lg.transform(e),getAnimatableNone:e=>{const r=gs.parse(e);return r.alpha=0,gs.transform(r)}},rle=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function sle(e){return isNaN(e)&&typeof e=="string"&&(e.match(T2)?.length||0)+(e.match(rle)?.length||0)>0}const M5="number",I5="color",ile="var",ale="var(",LI="${}",ole=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Zb(e){const r=e.toString(),s=[],o={color:[],number:[],var:[]},u=[];let h=0;const g=r.replace(ole,b=>(gs.test(b)?(o.color.push(h),u.push(I5),s.push(gs.parse(b))):b.startsWith(ale)?(o.var.push(h),u.push(ile),s.push(b)):(o.number.push(h),u.push(M5),s.push(parseFloat(b))),++h,LI)).split(LI);return{values:s,split:g,indexes:o,types:u}}function z5(e){return Zb(e).values}function L5(e){const{split:r,types:s}=Zb(e),o=r.length;return u=>{let h="";for(let m=0;mtypeof e=="number"?0:gs.test(e)?gs.getAnimatableNone(e):e;function cle(e){const r=z5(e);return L5(e)(r.map(lle))}const Gd={test:sle,parse:z5,createTransformer:L5,getAnimatableNone:cle};function aT(e,r,s){return s<0&&(s+=1),s>1&&(s-=1),s<1/6?e+(r-e)*6*s:s<1/2?r:s<2/3?e+(r-e)*(2/3-s)*6:e}function ule({hue:e,saturation:r,lightness:s,alpha:o}){e/=360,r/=100,s/=100;let u=0,h=0,m=0;if(!r)u=h=m=s;else{const g=s<.5?s*(1+r):s+r-s*r,b=2*s-g;u=aT(b,g,e+1/3),h=aT(b,g,e),m=aT(b,g,e-1/3)}return{red:Math.round(u*255),green:Math.round(h*255),blue:Math.round(m*255),alpha:o}}function Zj(e,r){return s=>s>0?r:e}const Lr=(e,r,s)=>e+(r-e)*s,oT=(e,r,s)=>{const o=e*e,u=s*(r*r-o)+o;return u<0?0:Math.sqrt(u)},dle=[e_,Ep,lg],hle=e=>dle.find(r=>r.test(e));function FI(e){const r=hle(e);if(!r)return!1;let s=r.parse(e);return r===lg&&(s=ule(s)),s}const qI=(e,r)=>{const s=FI(e),o=FI(r);if(!s||!o)return Zj(e,r);const u={...s};return h=>(u.red=oT(s.red,o.red,h),u.green=oT(s.green,o.green,h),u.blue=oT(s.blue,o.blue,h),u.alpha=Lr(s.alpha,o.alpha,h),Ep.transform(u))},t_=new Set(["none","hidden"]);function ple(e,r){return t_.has(e)?s=>s<=0?e:r:s=>s>=1?r:e}function fle(e,r){return s=>Lr(e,r,s)}function $2(e){return typeof e=="number"?fle:typeof e=="string"?R2(e)?Zj:gs.test(e)?qI:yle:Array.isArray(e)?F5:typeof e=="object"?gs.test(e)?qI:mle:Zj}function F5(e,r){const s=[...e],o=s.length,u=e.map((h,m)=>$2(h)(h,r[m]));return h=>{for(let m=0;m{for(const h in o)s[h]=o[h](u);return s}}function gle(e,r){const s=[],o={color:0,var:0,number:0};for(let u=0;u{const s=Gd.createTransformer(r),o=Zb(e),u=Zb(r);return o.indexes.var.length===u.indexes.var.length&&o.indexes.color.length===u.indexes.color.length&&o.indexes.number.length>=u.indexes.number.length?t_.has(e)&&!u.values.length||t_.has(r)&&!o.values.length?ple(e,r):gw(F5(gle(o,u),u.values),s):Zj(e,r)};function q5(e,r,s){return typeof e=="number"&&typeof r=="number"&&typeof s=="number"?Lr(e,r,s):$2(e)(e,r)}const vle=e=>{const r=({timestamp:s})=>e(s);return{start:(s=!0)=>$r.update(r,s),stop:()=>Hd(r),now:()=>Hs.isProcessing?Hs.timestamp:ga.now()}},B5=(e,r,s=10)=>{let o="";const u=Math.max(Math.round(r/s),2);for(let h=0;h=Jj?1/0:r}function xle(e,r=100,s){const o=s({...e,keyframes:[0,r]}),u=Math.min(N2(o),Jj);return{type:"keyframes",ease:h=>o.next(u*h).value/r,duration:lo(u)}}const ble=5;function U5(e,r,s){const o=Math.max(r-ble,0);return w5(s-e(o),r-o)}const Hr={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},lT=.001;function wle({duration:e=Hr.duration,bounce:r=Hr.bounce,velocity:s=Hr.velocity,mass:o=Hr.mass}){let u,h,m=1-r;m=vu(Hr.minDamping,Hr.maxDamping,m),e=vu(Hr.minDuration,Hr.maxDuration,lo(e)),m<1?(u=w=>{const E=w*m,A=E*e,k=E-s,R=n_(w,m),M=Math.exp(-A);return lT-k/R*M},h=w=>{const A=w*m*e,k=A*s+s,R=Math.pow(m,2)*Math.pow(w,2)*e,M=Math.exp(-A),I=n_(Math.pow(w,2),m);return(-u(w)+lT>0?-1:1)*((k-R)*M)/I}):(u=w=>{const E=Math.exp(-w*e),A=(w-s)*e+1;return-lT+E*A},h=w=>{const E=Math.exp(-w*e),A=(s-w)*(e*e);return E*A});const g=5/e,b=Ele(u,h,g);if(e=lc(e),isNaN(b))return{stiffness:Hr.stiffness,damping:Hr.damping,duration:e};{const w=Math.pow(b,2)*o;return{stiffness:w,damping:m*2*Math.sqrt(o*w),duration:e}}}const Sle=12;function Ele(e,r,s){let o=s;for(let u=1;ue[s]!==void 0)}function Ale(e){let r={velocity:Hr.velocity,stiffness:Hr.stiffness,damping:Hr.damping,mass:Hr.mass,isResolvedFromDuration:!1,...e};if(!BI(e,Cle)&&BI(e,jle))if(e.visualDuration){const s=e.visualDuration,o=2*Math.PI/(s*1.2),u=o*o,h=2*vu(.05,1,1-(e.bounce||0))*Math.sqrt(u);r={...r,mass:Hr.mass,stiffness:u,damping:h}}else{const s=wle(e);r={...r,...s,mass:Hr.mass},r.isResolvedFromDuration=!0}return r}function Wj(e=Hr.visualDuration,r=Hr.bounce){const s=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:r}:e;let{restSpeed:o,restDelta:u}=s;const h=s.keyframes[0],m=s.keyframes[s.keyframes.length-1],g={done:!1,value:h},{stiffness:b,damping:w,mass:E,duration:A,velocity:k,isResolvedFromDuration:R}=Ale({...s,velocity:-lo(s.velocity||0)}),M=k||0,I=w/(2*Math.sqrt(b*E)),F=m-h,H=lo(Math.sqrt(b/E)),V=Math.abs(F)<5;o||(o=V?Hr.restSpeed.granular:Hr.restSpeed.default),u||(u=V?Hr.restDelta.granular:Hr.restDelta.default);let K;if(I<1){const W=n_(H,I);K=ae=>{const Q=Math.exp(-I*H*ae);return m-Q*((M+I*H*F)/W*Math.sin(W*ae)+F*Math.cos(W*ae))}}else if(I===1)K=W=>m-Math.exp(-H*W)*(F+(M+H*F)*W);else{const W=H*Math.sqrt(I*I-1);K=ae=>{const Q=Math.exp(-I*H*ae),te=Math.min(W*ae,300);return m-Q*((M+I*H*F)*Math.sinh(te)+W*F*Math.cosh(te))/W}}const z={calculatedDuration:R&&A||null,next:W=>{const ae=K(W);if(R)g.done=W>=A;else{let Q=W===0?M:0;I<1&&(Q=W===0?lc(M):U5(K,W,ae));const te=Math.abs(Q)<=o,de=Math.abs(m-ae)<=u;g.done=te&&de}return g.value=g.done?m:ae,g},toString:()=>{const W=Math.min(N2(z),Jj),ae=B5(Q=>z.next(W*Q).value,W,30);return W+"ms "+ae},toTransition:()=>{}};return z}Wj.applyToOptions=e=>{const r=xle(e,100,Wj);return e.ease=r.ease,e.duration=lc(r.duration),e.type="keyframes",e};function r_({keyframes:e,velocity:r=0,power:s=.8,timeConstant:o=325,bounceDamping:u=10,bounceStiffness:h=500,modifyTarget:m,min:g,max:b,restDelta:w=.5,restSpeed:E}){const A=e[0],k={done:!1,value:A},R=te=>g!==void 0&&teb,M=te=>g===void 0?b:b===void 0||Math.abs(g-te)-I*Math.exp(-te/o),K=te=>H+V(te),z=te=>{const de=V(te),je=K(te);k.done=Math.abs(de)<=w,k.value=k.done?H:je};let W,ae;const Q=te=>{R(k.value)&&(W=te,ae=Wj({keyframes:[k.value,M(k.value)],velocity:U5(K,te,k.value),damping:u,stiffness:h,restDelta:w,restSpeed:E}))};return Q(0),{calculatedDuration:null,next:te=>{let de=!1;return!ae&&W===void 0&&(de=!0,z(te),Q(te)),W!==void 0&&te>=W?ae.next(te-W):(!de&&z(te),k)}}}function Ole(e,r,s){const o=[],u=s||xu.mix||q5,h=e.length-1;for(let m=0;mr[0];if(h===2&&r[0]===r[1])return()=>r[1];const m=e[0]===e[1];e[0]>e[h-1]&&(e=[...e].reverse(),r=[...r].reverse());const g=Ole(r,o,u),b=g.length,w=E=>{if(m&&E1)for(;Aw(vu(e[0],e[h-1],E)):w}function Rle(e,r){const s=e[e.length-1];for(let o=1;o<=r;o++){const u=Xb(0,r,o);e.push(Lr(s,1,u))}}function Tle(e){const r=[0];return Rle(r,e.length-1),r}function _le(e,r){return e.map(s=>s*r)}function $le(e,r){return e.map(()=>r||T5).splice(0,e.length-1)}function Lb({duration:e=300,keyframes:r,times:s,ease:o="easeInOut"}){const u=Uoe(o)?o.map(II):II(o),h={done:!1,value:r[0]},m=_le(s&&s.length===r.length?s:Tle(r),e),g=kle(m,r,{ease:Array.isArray(u)?u:$le(r,u)});return{calculatedDuration:e,next:b=>(h.value=g(b),h.done=b>=e,h)}}const Nle=e=>e!==null;function D2(e,{repeat:r,repeatType:s="loop"},o,u=1){const h=e.filter(Nle),g=u<0||r&&s!=="loop"&&r%2===1?0:h.length-1;return!g||o===void 0?h[g]:o}const Dle={decay:r_,inertia:r_,tween:Lb,keyframes:Lb,spring:Wj};function K5(e){typeof e.type=="string"&&(e.type=Dle[e.type])}class P2{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(r=>{this.resolve=r})}notifyFinished(){this.resolve()}then(r,s){return this.finished.then(r,s)}}const Ple=e=>e/100;class M2 extends P2{constructor(r){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:s}=this.options;s&&s.updatedAt!==ga.now()&&this.tick(ga.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=r,this.initAnimation(),this.play(),r.autoplay===!1&&this.pause()}initAnimation(){const{options:r}=this;K5(r);const{type:s=Lb,repeat:o=0,repeatDelay:u=0,repeatType:h,velocity:m=0}=r;let{keyframes:g}=r;const b=s||Lb;b!==Lb&&typeof g[0]!="number"&&(this.mixKeyframes=gw(Ple,q5(g[0],g[1])),g=[0,100]);const w=b({...r,keyframes:g});h==="mirror"&&(this.mirroredGenerator=b({...r,keyframes:[...g].reverse(),velocity:-m})),w.calculatedDuration===null&&(w.calculatedDuration=N2(w));const{calculatedDuration:E}=w;this.calculatedDuration=E,this.resolvedDuration=E+u,this.totalDuration=this.resolvedDuration*(o+1)-u,this.generator=w}updateTime(r){const s=Math.round(r-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=s}tick(r,s=!1){const{generator:o,totalDuration:u,mixKeyframes:h,mirroredGenerator:m,resolvedDuration:g,calculatedDuration:b}=this;if(this.startTime===null)return o.next(0);const{delay:w=0,keyframes:E,repeat:A,repeatType:k,repeatDelay:R,type:M,onUpdate:I,finalKeyframe:F}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,r):this.speed<0&&(this.startTime=Math.min(r-u/this.speed,this.startTime)),s?this.currentTime=r:this.updateTime(r);const H=this.currentTime-w*(this.playbackSpeed>=0?1:-1),V=this.playbackSpeed>=0?H<0:H>u;this.currentTime=Math.max(H,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=u);let K=this.currentTime,z=o;if(A){const te=Math.min(this.currentTime,u)/g;let de=Math.floor(te),je=te%1;!je&&te>=1&&(je=1),je===1&&de--,de=Math.min(de,A+1),de%2&&(k==="reverse"?(je=1-je,R&&(je-=R/g)):k==="mirror"&&(z=m)),K=vu(0,1,je)*g}const W=V?{done:!1,value:E[0]}:z.next(K);h&&(W.value=h(W.value));let{done:ae}=W;!V&&b!==null&&(ae=this.playbackSpeed>=0?this.currentTime>=u:this.currentTime<=0);const Q=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&ae);return Q&&M!==r_&&(W.value=D2(E,this.options,F,this.speed)),I&&I(W.value),Q&&this.finish(),W}then(r,s){return this.finished.then(r,s)}get duration(){return lo(this.calculatedDuration)}get iterationDuration(){const{delay:r=0}=this.options||{};return this.duration+lo(r)}get time(){return lo(this.currentTime)}set time(r){r=lc(r),this.currentTime=r,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=r:this.driver&&(this.startTime=this.driver.now()-r/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(r){this.updateTime(ga.now());const s=this.playbackSpeed!==r;this.playbackSpeed=r,s&&(this.time=lo(this.currentTime))}play(){if(this.isStopped)return;const{driver:r=vle,startTime:s}=this.options;this.driver||(this.driver=r(u=>this.tick(u))),this.options.onPlay?.();const o=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=o):this.holdTime!==null?this.startTime=o-this.holdTime:this.startTime||(this.startTime=s??o),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(ga.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(r){return this.startTime=0,this.tick(r,!0)}attachTimeline(r){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),r.observe(this)}}function Mle(e){for(let r=1;re*180/Math.PI,s_=e=>{const r=jp(Math.atan2(e[1],e[0]));return i_(r)},Ile={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:s_,rotateZ:s_,skewX:e=>jp(Math.atan(e[1])),skewY:e=>jp(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},i_=e=>(e=e%360,e<0&&(e+=360),e),UI=s_,KI=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),VI=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),zle={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:KI,scaleY:VI,scale:e=>(KI(e)+VI(e))/2,rotateX:e=>i_(jp(Math.atan2(e[6],e[5]))),rotateY:e=>i_(jp(Math.atan2(-e[2],e[0]))),rotateZ:UI,rotate:UI,skewX:e=>jp(Math.atan(e[4])),skewY:e=>jp(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function a_(e){return e.includes("scale")?1:0}function o_(e,r){if(!e||e==="none")return a_(r);const s=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let o,u;if(s)o=zle,u=s;else{const g=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);o=Ile,u=g}if(!u)return a_(r);const h=o[r],m=u[1].split(",").map(Fle);return typeof h=="function"?h(m):m[h]}const Lle=(e,r)=>{const{transform:s="none"}=getComputedStyle(e);return o_(s,r)};function Fle(e){return parseFloat(e.trim())}const Lg=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Fg=new Set(Lg),HI=e=>e===zg||e===sn,qle=new Set(["x","y","z"]),Ble=Lg.filter(e=>!qle.has(e));function Ule(e){const r=[];return Ble.forEach(s=>{const o=e.getValue(s);o!==void 0&&(r.push([s,o.get()]),o.set(s.startsWith("scale")?1:0))}),r}const Ap={width:({x:e},{paddingLeft:r="0",paddingRight:s="0"})=>e.max-e.min-parseFloat(r)-parseFloat(s),height:({y:e},{paddingTop:r="0",paddingBottom:s="0"})=>e.max-e.min-parseFloat(r)-parseFloat(s),top:(e,{top:r})=>parseFloat(r),left:(e,{left:r})=>parseFloat(r),bottom:({y:e},{top:r})=>parseFloat(r)+(e.max-e.min),right:({x:e},{left:r})=>parseFloat(r)+(e.max-e.min),x:(e,{transform:r})=>o_(r,"x"),y:(e,{transform:r})=>o_(r,"y")};Ap.translateX=Ap.x;Ap.translateY=Ap.y;const Op=new Set;let l_=!1,c_=!1,u_=!1;function V5(){if(c_){const e=Array.from(Op).filter(o=>o.needsMeasurement),r=new Set(e.map(o=>o.element)),s=new Map;r.forEach(o=>{const u=Ule(o);u.length&&(s.set(o,u),o.render())}),e.forEach(o=>o.measureInitialState()),r.forEach(o=>{o.render();const u=s.get(o);u&&u.forEach(([h,m])=>{o.getValue(h)?.set(m)})}),e.forEach(o=>o.measureEndState()),e.forEach(o=>{o.suspendedScrollY!==void 0&&window.scrollTo(0,o.suspendedScrollY)})}c_=!1,l_=!1,Op.forEach(e=>e.complete(u_)),Op.clear()}function H5(){Op.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(c_=!0)})}function Kle(){u_=!0,H5(),V5(),u_=!1}class I2{constructor(r,s,o,u,h,m=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...r],this.onComplete=s,this.name=o,this.motionValue=u,this.element=h,this.isAsync=m}scheduleResolve(){this.state="scheduled",this.isAsync?(Op.add(this),l_||(l_=!0,$r.read(H5),$r.resolveKeyframes(V5))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:r,name:s,element:o,motionValue:u}=this;if(r[0]===null){const h=u?.get(),m=r[r.length-1];if(h!==void 0)r[0]=h;else if(o&&s){const g=o.readValue(s,m);g!=null&&(r[0]=g)}r[0]===void 0&&(r[0]=m),u&&h===void 0&&u.set(r[0])}Mle(r)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(r=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,r),Op.delete(this)}cancel(){this.state==="scheduled"&&(Op.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Vle=e=>e.startsWith("--");function Hle(e,r,s){Vle(r)?e.style.setProperty(r,s):e.style[r]=s}const Gle=C2(()=>window.ScrollTimeline!==void 0),Xle={};function Yle(e,r){const s=C2(e);return()=>Xle[r]??s()}const G5=Yle(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Ob=([e,r,s,o])=>`cubic-bezier(${e}, ${r}, ${s}, ${o})`,GI={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ob([0,.65,.55,1]),circOut:Ob([.55,0,1,.45]),backIn:Ob([.31,.01,.66,-.59]),backOut:Ob([.33,1.53,.69,.99])};function X5(e,r){if(e)return typeof e=="function"?G5()?B5(e,r):"ease-out":_5(e)?Ob(e):Array.isArray(e)?e.map(s=>X5(s,r)||GI.easeOut):GI[e]}function Zle(e,r,s,{delay:o=0,duration:u=300,repeat:h=0,repeatType:m="loop",ease:g="easeOut",times:b}={},w=void 0){const E={[r]:s};b&&(E.offset=b);const A=X5(g,u);Array.isArray(A)&&(E.easing=A);const k={delay:o,duration:u,easing:Array.isArray(A)?"linear":A,fill:"both",iterations:h+1,direction:m==="reverse"?"alternate":"normal"};return w&&(k.pseudoElement=w),e.animate(E,k)}function Y5(e){return typeof e=="function"&&"applyToOptions"in e}function Jle({type:e,...r}){return Y5(e)&&G5()?e.applyToOptions(r):(r.duration??(r.duration=300),r.ease??(r.ease="easeOut"),r)}class Wle extends P2{constructor(r){if(super(),this.finishedTime=null,this.isStopped=!1,!r)return;const{element:s,name:o,keyframes:u,pseudoElement:h,allowFlatten:m=!1,finalKeyframe:g,onComplete:b}=r;this.isPseudoElement=!!h,this.allowFlatten=m,this.options=r,j2(typeof r.type!="string");const w=Jle(r);this.animation=Zle(s,o,u,w,h),w.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!h){const E=D2(u,this.options,g,this.speed);this.updateMotionValue?this.updateMotionValue(E):Hle(s,o,E),this.animation.cancel()}b?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:r}=this;r==="idle"||r==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const r=this.animation.effect?.getComputedTiming?.().duration||0;return lo(Number(r))}get iterationDuration(){const{delay:r=0}=this.options||{};return this.duration+lo(r)}get time(){return lo(Number(this.animation.currentTime)||0)}set time(r){this.finishedTime=null,this.animation.currentTime=lc(r)}get speed(){return this.animation.playbackRate}set speed(r){r<0&&(this.finishedTime=null),this.animation.playbackRate=r}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(r){this.animation.startTime=r}attachTimeline({timeline:r,observe:s}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,r&&Gle()?(this.animation.timeline=r,co):s(this)}}const Z5={anticipate:O5,backInOut:A5,circInOut:R5};function Qle(e){return e in Z5}function ece(e){typeof e.ease=="string"&&Qle(e.ease)&&(e.ease=Z5[e.ease])}const XI=10;class tce extends Wle{constructor(r){ece(r),K5(r),super(r),r.startTime&&(this.startTime=r.startTime),this.options=r}updateMotionValue(r){const{motionValue:s,onUpdate:o,onComplete:u,element:h,...m}=this.options;if(!s)return;if(r!==void 0){s.set(r);return}const g=new M2({...m,autoplay:!1}),b=lc(this.finishedTime??this.time);s.setWithVelocity(g.sample(b-XI).value,g.sample(b).value,XI),g.stop()}}const YI=(e,r)=>r==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Gd.test(e)||e==="0")&&!e.startsWith("url("));function nce(e){const r=e[0];if(e.length===1)return!0;for(let s=0;sObject.hasOwnProperty.call(Element.prototype,"animate"));function ace(e){const{motionValue:r,name:s,repeatDelay:o,repeatType:u,damping:h,type:m}=e;if(!(r?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:b,transformTemplate:w}=r.owner.getProps();return ice()&&s&&sce.has(s)&&(s!=="transform"||!w)&&!b&&!o&&u!=="mirror"&&h!==0&&m!=="inertia"}const oce=40;class lce extends P2{constructor({autoplay:r=!0,delay:s=0,type:o="keyframes",repeat:u=0,repeatDelay:h=0,repeatType:m="loop",keyframes:g,name:b,motionValue:w,element:E,...A}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=ga.now();const k={autoplay:r,delay:s,type:o,repeat:u,repeatDelay:h,repeatType:m,name:b,motionValue:w,element:E,...A},R=E?.KeyframeResolver||I2;this.keyframeResolver=new R(g,(M,I,F)=>this.onKeyframesResolved(M,I,k,!F),b,w,E),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(r,s,o,u){this.keyframeResolver=void 0;const{name:h,type:m,velocity:g,delay:b,isHandoff:w,onUpdate:E}=o;this.resolvedAt=ga.now(),rce(r,h,m,g)||((xu.instantAnimations||!b)&&E?.(D2(r,o,s)),r[0]=r[r.length-1],d_(o),o.repeat=0);const k={startTime:u?this.resolvedAt?this.resolvedAt-this.createdAt>oce?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:s,...o,keyframes:r},R=!w&&ace(k)?new tce({...k,element:k.motionValue.owner.current}):new M2(k);R.finished.then(()=>this.notifyFinished()).catch(co),this.pendingTimeline&&(this.stopTimeline=R.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=R}get finished(){return this._animation?this.animation.finished:this._finished}then(r,s){return this.finished.finally(r).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Kle()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(r){this.animation.time=r}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(r){this.animation.speed=r}get startTime(){return this.animation.startTime}attachTimeline(r){return this._animation?this.stopTimeline=this.animation.attachTimeline(r):this.pendingTimeline=r,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const cce=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function uce(e){const r=cce.exec(e);if(!r)return[,];const[,s,o,u]=r;return[`--${s??o}`,u]}function J5(e,r,s=1){const[o,u]=uce(e);if(!o)return;const h=window.getComputedStyle(r).getPropertyValue(o);if(h){const m=h.trim();return v5(m)?parseFloat(m):m}return R2(u)?J5(u,r,s+1):u}function z2(e,r){return e?.[r]??e?.default??e}const W5=new Set(["width","height","top","left","right","bottom",...Lg]),dce={test:e=>e==="auto",parse:e=>e},Q5=e=>r=>r.test(e),eF=[zg,sn,cc,Ld,nle,tle,dce],ZI=e=>eF.find(Q5(e));function hce(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||b5(e):!0}const pce=new Set(["brightness","contrast","saturate","opacity"]);function fce(e){const[r,s]=e.slice(0,-1).split("(");if(r==="drop-shadow")return e;const[o]=s.match(T2)||[];if(!o)return e;const u=s.replace(o,"");let h=pce.has(r)?1:0;return o!==s&&(h*=100),r+"("+h+u+")"}const mce=/\b([a-z-]*)\(.*?\)/gu,h_={...Gd,getAnimatableNone:e=>{const r=e.match(mce);return r?r.map(fce).join(" "):e}},JI={...zg,transform:Math.round},gce={rotate:Ld,rotateX:Ld,rotateY:Ld,rotateZ:Ld,scale:ij,scaleX:ij,scaleY:ij,scaleZ:ij,skew:Ld,skewX:Ld,skewY:Ld,distance:sn,translateX:sn,translateY:sn,translateZ:sn,x:sn,y:sn,z:sn,perspective:sn,transformPerspective:sn,opacity:Yb,originX:zI,originY:zI,originZ:sn},L2={borderWidth:sn,borderTopWidth:sn,borderRightWidth:sn,borderBottomWidth:sn,borderLeftWidth:sn,borderRadius:sn,radius:sn,borderTopLeftRadius:sn,borderTopRightRadius:sn,borderBottomRightRadius:sn,borderBottomLeftRadius:sn,width:sn,maxWidth:sn,height:sn,maxHeight:sn,top:sn,right:sn,bottom:sn,left:sn,padding:sn,paddingTop:sn,paddingRight:sn,paddingBottom:sn,paddingLeft:sn,margin:sn,marginTop:sn,marginRight:sn,marginBottom:sn,marginLeft:sn,backgroundPositionX:sn,backgroundPositionY:sn,...gce,zIndex:JI,fillOpacity:Yb,strokeOpacity:Yb,numOctaves:JI},yce={...L2,color:gs,backgroundColor:gs,outlineColor:gs,fill:gs,stroke:gs,borderColor:gs,borderTopColor:gs,borderRightColor:gs,borderBottomColor:gs,borderLeftColor:gs,filter:h_,WebkitFilter:h_},tF=e=>yce[e];function nF(e,r){let s=tF(e);return s!==h_&&(s=Gd),s.getAnimatableNone?s.getAnimatableNone(r):void 0}const vce=new Set(["auto","none","0"]);function xce(e,r,s){let o=0,u;for(;o{r.getValue(g).set(b)}),this.resolveNoneKeyframes()}}function wce(e,r,s){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let o=document;const u=s?.[e]??o.querySelectorAll(e);return u?Array.from(u):[]}return Array.from(e)}const rF=(e,r)=>r&&typeof e=="number"?r.transform(e):e;function Sce(e){return x5(e)&&"offsetHeight"in e}const WI=30,Ece=e=>!isNaN(parseFloat(e));class jce{constructor(r,s={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=o=>{const u=ga.now();if(this.updatedAt!==u&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(o),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const h of this.dependents)h.dirty()},this.hasAnimated=!1,this.setCurrent(r),this.owner=s.owner}setCurrent(r){this.current=r,this.updatedAt=ga.now(),this.canTrackVelocity===null&&r!==void 0&&(this.canTrackVelocity=Ece(this.current))}setPrevFrameValue(r=this.current){this.prevFrameValue=r,this.prevUpdatedAt=this.updatedAt}onChange(r){return this.on("change",r)}on(r,s){this.events[r]||(this.events[r]=new A2);const o=this.events[r].add(s);return r==="change"?()=>{o(),$r.read(()=>{this.events.change.getSize()||this.stop()})}:o}clearListeners(){for(const r in this.events)this.events[r].clear()}attach(r,s){this.passiveEffect=r,this.stopPassiveEffect=s}set(r){this.passiveEffect?this.passiveEffect(r,this.updateAndNotify):this.updateAndNotify(r)}setWithVelocity(r,s,o){this.set(s),this.prev=void 0,this.prevFrameValue=r,this.prevUpdatedAt=this.updatedAt-o}jump(r,s=!0){this.updateAndNotify(r),this.prev=r,this.prevUpdatedAt=this.prevFrameValue=void 0,s&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(r){this.dependents||(this.dependents=new Set),this.dependents.add(r)}removeDependent(r){this.dependents&&this.dependents.delete(r)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const r=ga.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||r-this.updatedAt>WI)return 0;const s=Math.min(this.updatedAt-this.prevUpdatedAt,WI);return w5(parseFloat(this.current)-parseFloat(this.prevFrameValue),s)}start(r){return this.stop(),new Promise(s=>{this.hasAnimated=!0,this.animation=r(s),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Cg(e,r){return new jce(e,r)}const{schedule:F2}=$5(queueMicrotask,!1),Jo={x:!1,y:!1};function sF(){return Jo.x||Jo.y}function Cce(e){return e==="x"||e==="y"?Jo[e]?null:(Jo[e]=!0,()=>{Jo[e]=!1}):Jo.x||Jo.y?null:(Jo.x=Jo.y=!0,()=>{Jo.x=Jo.y=!1})}function iF(e,r){const s=wce(e),o=new AbortController,u={passive:!0,...r,signal:o.signal};return[s,u,()=>o.abort()]}function QI(e){return!(e.pointerType==="touch"||sF())}function Ace(e,r,s={}){const[o,u,h]=iF(e,s),m=g=>{if(!QI(g))return;const{target:b}=g,w=r(b,g);if(typeof w!="function"||!b)return;const E=A=>{QI(A)&&(w(A),b.removeEventListener("pointerleave",E))};b.addEventListener("pointerleave",E,u)};return o.forEach(g=>{g.addEventListener("pointerenter",m,u)}),h}const aF=(e,r)=>r?e===r?!0:aF(e,r.parentElement):!1,q2=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Oce=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function kce(e){return Oce.has(e.tagName)||e.tabIndex!==-1}const Cj=new WeakSet;function e4(e){return r=>{r.key==="Enter"&&e(r)}}function cT(e,r){e.dispatchEvent(new PointerEvent("pointer"+r,{isPrimary:!0,bubbles:!0}))}const Rce=(e,r)=>{const s=e.currentTarget;if(!s)return;const o=e4(()=>{if(Cj.has(s))return;cT(s,"down");const u=e4(()=>{cT(s,"up")}),h=()=>cT(s,"cancel");s.addEventListener("keyup",u,r),s.addEventListener("blur",h,r)});s.addEventListener("keydown",o,r),s.addEventListener("blur",()=>s.removeEventListener("keydown",o),r)};function t4(e){return q2(e)&&!sF()}function Tce(e,r,s={}){const[o,u,h]=iF(e,s),m=g=>{const b=g.currentTarget;if(!t4(g))return;Cj.add(b);const w=r(b,g),E=(R,M)=>{window.removeEventListener("pointerup",A),window.removeEventListener("pointercancel",k),Cj.has(b)&&Cj.delete(b),t4(R)&&typeof w=="function"&&w(R,{success:M})},A=R=>{E(R,b===window||b===document||s.useGlobalTarget||aF(b,R.target))},k=R=>{E(R,!1)};window.addEventListener("pointerup",A,u),window.addEventListener("pointercancel",k,u)};return o.forEach(g=>{(s.useGlobalTarget?window:g).addEventListener("pointerdown",m,u),Sce(g)&&(g.addEventListener("focus",w=>Rce(w,u)),!kce(g)&&!g.hasAttribute("tabindex")&&(g.tabIndex=0))}),h}function oF(e){return x5(e)&&"ownerSVGElement"in e}function _ce(e){return oF(e)&&e.tagName==="svg"}const Ci=e=>!!(e&&e.getVelocity),$ce=[...eF,gs,Gd],Nce=e=>$ce.find(Q5(e)),lF=T.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function Dce(e=!0){const r=T.useContext(w2);if(r===null)return[!0,null];const{isPresent:s,onExitComplete:o,register:u}=r,h=T.useId();T.useEffect(()=>{if(e)return u(h)},[e]);const m=T.useCallback(()=>e&&o&&o(h),[h,o,e]);return!s&&o?[!1,m]:[!0]}const cF=T.createContext({strict:!1}),n4={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Ag={};for(const e in n4)Ag[e]={isEnabled:r=>n4[e].some(s=>!!r[s])};function Pce(e){for(const r in e)Ag[r]={...Ag[r],...e[r]}}const Mce=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Qj(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Mce.has(e)}let uF=e=>!Qj(e);function Ice(e){typeof e=="function"&&(uF=r=>r.startsWith("on")?!Qj(r):e(r))}try{Ice(require("@emotion/is-prop-valid").default)}catch{}function zce(e,r,s){const o={};for(const u in e)u==="values"&&typeof e.values=="object"||(uF(u)||s===!0&&Qj(u)||!r&&!Qj(u)||e.draggable&&u.startsWith("onDrag"))&&(o[u]=e[u]);return o}const VC=T.createContext({});function HC(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Jb(e){return typeof e=="string"||Array.isArray(e)}const B2=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],U2=["initial",...B2];function GC(e){return HC(e.animate)||U2.some(r=>Jb(e[r]))}function dF(e){return!!(GC(e)||e.variants)}function Lce(e,r){if(GC(e)){const{initial:s,animate:o}=e;return{initial:s===!1||Jb(s)?s:void 0,animate:Jb(o)?o:void 0}}return e.inherit!==!1?r:{}}function Fce(e){const{initial:r,animate:s}=Lce(e,T.useContext(VC));return T.useMemo(()=>({initial:r,animate:s}),[r4(r),r4(s)])}function r4(e){return Array.isArray(e)?e.join(" "):e}function s4(e,r){return r.max===r.min?0:e/(r.max-r.min)*100}const db={correct:(e,r)=>{if(!r.target)return e;if(typeof e=="string")if(sn.test(e))e=parseFloat(e);else return e;const s=s4(e,r.target.x),o=s4(e,r.target.y);return`${s}% ${o}%`}},qce={correct:(e,{treeScale:r,projectionDelta:s})=>{const o=e,u=Gd.parse(e);if(u.length>5)return o;const h=Gd.createTransformer(e),m=typeof u[0]!="number"?1:0,g=s.x.scale*r.x,b=s.y.scale*r.y;u[0+m]/=g,u[1+m]/=b;const w=Lr(g,b,.5);return typeof u[2+m]=="number"&&(u[2+m]/=w),typeof u[3+m]=="number"&&(u[3+m]/=w),h(u)}},p_={borderRadius:{...db,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:db,borderTopRightRadius:db,borderBottomLeftRadius:db,borderBottomRightRadius:db,boxShadow:qce};function hF(e,{layout:r,layoutId:s}){return Fg.has(e)||e.startsWith("origin")||(r||s!==void 0)&&(!!p_[e]||e==="opacity")}const Bce={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Uce=Lg.length;function Kce(e,r,s){let o="",u=!0;for(let h=0;h({style:{},transform:{},transformOrigin:{},vars:{}});function pF(e,r,s){for(const o in r)!Ci(r[o])&&!hF(o,s)&&(e[o]=r[o])}function Vce({transformTemplate:e},r){return T.useMemo(()=>{const s=V2();return K2(s,r,e),Object.assign({},s.vars,s.style)},[r])}function Hce(e,r){const s=e.style||{},o={};return pF(o,s,e),Object.assign(o,Vce(e,r)),o}function Gce(e,r){const s={},o=Hce(e,r);return e.drag&&e.dragListener!==!1&&(s.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(s.tabIndex=0),s.style=o,s}const Xce={offset:"stroke-dashoffset",array:"stroke-dasharray"},Yce={offset:"strokeDashoffset",array:"strokeDasharray"};function Zce(e,r,s=1,o=0,u=!0){e.pathLength=1;const h=u?Xce:Yce;e[h.offset]=sn.transform(-o);const m=sn.transform(r),g=sn.transform(s);e[h.array]=`${m} ${g}`}function fF(e,{attrX:r,attrY:s,attrScale:o,pathLength:u,pathSpacing:h=1,pathOffset:m=0,...g},b,w,E){if(K2(e,g,w),b){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:A,style:k}=e;A.transform&&(k.transform=A.transform,delete A.transform),(k.transform||A.transformOrigin)&&(k.transformOrigin=A.transformOrigin??"50% 50%",delete A.transformOrigin),k.transform&&(k.transformBox=E?.transformBox??"fill-box",delete A.transformBox),r!==void 0&&(A.x=r),s!==void 0&&(A.y=s),o!==void 0&&(A.scale=o),u!==void 0&&Zce(A,u,h,m,!1)}const mF=()=>({...V2(),attrs:{}}),gF=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Jce(e,r,s,o){const u=T.useMemo(()=>{const h=mF();return fF(h,r,gF(o),e.transformTemplate,e.style),{...h.attrs,style:{...h.style}}},[r]);if(e.style){const h={};pF(h,e.style,e),u.style={...h,...u.style}}return u}const Wce=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function H2(e){return typeof e!="string"||e.includes("-")?!1:!!(Wce.indexOf(e)>-1||/[A-Z]/u.test(e))}function Qce(e,r,s,{latestValues:o},u,h=!1){const g=(H2(e)?Jce:Gce)(r,o,u,e),b=zce(r,typeof e=="string",h),w=e!==T.Fragment?{...b,...g,ref:s}:{},{children:E}=r,A=T.useMemo(()=>Ci(E)?E.get():E,[E]);return T.createElement(e,{...w,children:A})}function i4(e){const r=[{},{}];return e?.values.forEach((s,o)=>{r[0][o]=s.get(),r[1][o]=s.getVelocity()}),r}function G2(e,r,s,o){if(typeof r=="function"){const[u,h]=i4(o);r=r(s!==void 0?s:e.custom,u,h)}if(typeof r=="string"&&(r=e.variants&&e.variants[r]),typeof r=="function"){const[u,h]=i4(o);r=r(s!==void 0?s:e.custom,u,h)}return r}function Aj(e){return Ci(e)?e.get():e}function eue({scrapeMotionValuesFromProps:e,createRenderState:r},s,o,u){return{latestValues:tue(s,o,u,e),renderState:r()}}function tue(e,r,s,o){const u={},h=o(e,{});for(const k in h)u[k]=Aj(h[k]);let{initial:m,animate:g}=e;const b=GC(e),w=dF(e);r&&w&&!b&&e.inherit!==!1&&(m===void 0&&(m=r.initial),g===void 0&&(g=r.animate));let E=s?s.initial===!1:!1;E=E||m===!1;const A=E?g:m;if(A&&typeof A!="boolean"&&!HC(A)){const k=Array.isArray(A)?A:[A];for(let R=0;R(r,s)=>{const o=T.useContext(VC),u=T.useContext(w2),h=()=>eue(e,r,o,u);return s?h():Poe(h)};function X2(e,r,s){const{style:o}=e,u={};for(const h in o)(Ci(o[h])||r.style&&Ci(r.style[h])||hF(h,e)||s?.getValue(h)?.liveStyle!==void 0)&&(u[h]=o[h]);return u}const nue=yF({scrapeMotionValuesFromProps:X2,createRenderState:V2});function vF(e,r,s){const o=X2(e,r,s);for(const u in e)if(Ci(e[u])||Ci(r[u])){const h=Lg.indexOf(u)!==-1?"attr"+u.charAt(0).toUpperCase()+u.substring(1):u;o[h]=e[u]}return o}const rue=yF({scrapeMotionValuesFromProps:vF,createRenderState:mF}),sue=Symbol.for("motionComponentSymbol");function cg(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function iue(e,r,s){return T.useCallback(o=>{o&&e.onMount&&e.onMount(o),r&&(o?r.mount(o):r.unmount()),s&&(typeof s=="function"?s(o):cg(s)&&(s.current=o))},[r])}const Y2=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),aue="framerAppearId",xF="data-"+Y2(aue),bF=T.createContext({});function oue(e,r,s,o,u){const{visualElement:h}=T.useContext(VC),m=T.useContext(cF),g=T.useContext(w2),b=T.useContext(lF).reducedMotion,w=T.useRef(null);o=o||m.renderer,!w.current&&o&&(w.current=o(e,{visualState:r,parent:h,props:s,presenceContext:g,blockInitialAnimation:g?g.initial===!1:!1,reducedMotionConfig:b}));const E=w.current,A=T.useContext(bF);E&&!E.projection&&u&&(E.type==="html"||E.type==="svg")&&lue(w.current,s,u,A);const k=T.useRef(!1);T.useInsertionEffect(()=>{E&&k.current&&E.update(s,g)});const R=s[xF],M=T.useRef(!!R&&!window.MotionHandoffIsComplete?.(R)&&window.MotionHasOptimisedAnimation?.(R));return Moe(()=>{E&&(k.current=!0,window.MotionIsMounted=!0,E.updateFeatures(),E.scheduleRenderMicrotask(),M.current&&E.animationState&&E.animationState.animateChanges())}),T.useEffect(()=>{E&&(!M.current&&E.animationState&&E.animationState.animateChanges(),M.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(R)}),M.current=!1),E.enteringChildren=void 0)}),E}function lue(e,r,s,o){const{layoutId:u,layout:h,drag:m,dragConstraints:g,layoutScroll:b,layoutRoot:w,layoutCrossfade:E}=r;e.projection=new s(e.latestValues,r["data-framer-portal-id"]?void 0:wF(e.parent)),e.projection.setOptions({layoutId:u,layout:h,alwaysMeasureLayout:!!m||g&&cg(g),visualElement:e,animationType:typeof h=="string"?h:"both",initialPromotionConfig:o,crossfade:E,layoutScroll:b,layoutRoot:w})}function wF(e){if(e)return e.options.allowProjection!==!1?e.projection:wF(e.parent)}function uT(e,{forwardMotionProps:r=!1}={},s,o){s&&Pce(s);const u=H2(e)?rue:nue;function h(g,b){let w;const E={...T.useContext(lF),...g,layoutId:cue(g)},{isStatic:A}=E,k=Fce(g),R=u(g,A);if(!A&&b2){uue();const M=due(E);w=M.MeasureLayout,k.visualElement=oue(e,R,E,o,M.ProjectionNode)}return c.jsxs(VC.Provider,{value:k,children:[w&&k.visualElement?c.jsx(w,{visualElement:k.visualElement,...E}):null,Qce(e,g,iue(R,k.visualElement,b),R,A,r)]})}h.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const m=T.forwardRef(h);return m[sue]=e,m}function cue({layoutId:e}){const r=T.useContext(y5).id;return r&&e!==void 0?r+"-"+e:e}function uue(e,r){T.useContext(cF).strict}function due(e){const{drag:r,layout:s}=Ag;if(!r&&!s)return{};const o={...r,...s};return{MeasureLayout:r?.isEnabled(e)||s?.isEnabled(e)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}function hue(e,r){if(typeof Proxy>"u")return uT;const s=new Map,o=(h,m)=>uT(h,m,e,r),u=(h,m)=>o(h,m);return new Proxy(u,{get:(h,m)=>m==="create"?o:(s.has(m)||s.set(m,uT(m,void 0,e,r)),s.get(m))})}function SF({top:e,left:r,right:s,bottom:o}){return{x:{min:r,max:s},y:{min:e,max:o}}}function pue({x:e,y:r}){return{top:r.min,right:e.max,bottom:r.max,left:e.min}}function fue(e,r){if(!r)return e;const s=r({x:e.left,y:e.top}),o=r({x:e.right,y:e.bottom});return{top:s.y,left:s.x,bottom:o.y,right:o.x}}function dT(e){return e===void 0||e===1}function f_({scale:e,scaleX:r,scaleY:s}){return!dT(e)||!dT(r)||!dT(s)}function bp(e){return f_(e)||EF(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function EF(e){return a4(e.x)||a4(e.y)}function a4(e){return e&&e!=="0%"}function eC(e,r,s){const o=e-s,u=r*o;return s+u}function o4(e,r,s,o,u){return u!==void 0&&(e=eC(e,u,o)),eC(e,s,o)+r}function m_(e,r=0,s=1,o,u){e.min=o4(e.min,r,s,o,u),e.max=o4(e.max,r,s,o,u)}function jF(e,{x:r,y:s}){m_(e.x,r.translate,r.scale,r.originPoint),m_(e.y,s.translate,s.scale,s.originPoint)}const l4=.999999999999,c4=1.0000000000001;function mue(e,r,s,o=!1){const u=s.length;if(!u)return;r.x=r.y=1;let h,m;for(let g=0;gl4&&(r.x=1),r.yl4&&(r.y=1)}function ug(e,r){e.min=e.min+r,e.max=e.max+r}function u4(e,r,s,o,u=.5){const h=Lr(e.min,e.max,u);m_(e,r,s,h,o)}function dg(e,r){u4(e.x,r.x,r.scaleX,r.scale,r.originX),u4(e.y,r.y,r.scaleY,r.scale,r.originY)}function CF(e,r){return SF(fue(e.getBoundingClientRect(),r))}function gue(e,r,s){const o=CF(e,s),{scroll:u}=r;return u&&(ug(o.x,u.offset.x),ug(o.y,u.offset.y)),o}const d4=()=>({translate:0,scale:1,origin:0,originPoint:0}),hg=()=>({x:d4(),y:d4()}),h4=()=>({min:0,max:0}),Cs=()=>({x:h4(),y:h4()}),g_={current:null},AF={current:!1};function yue(){if(AF.current=!0,!!b2)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),r=()=>g_.current=e.matches;e.addEventListener("change",r),r()}else g_.current=!1}const vue=new WeakMap;function xue(e,r,s){for(const o in r){const u=r[o],h=s[o];if(Ci(u))e.addValue(o,u);else if(Ci(h))e.addValue(o,Cg(u,{owner:e}));else if(h!==u)if(e.hasValue(o)){const m=e.getValue(o);m.liveStyle===!0?m.jump(u):m.hasAnimated||m.set(u)}else{const m=e.getStaticValue(o);e.addValue(o,Cg(m!==void 0?m:u,{owner:e}))}}for(const o in s)r[o]===void 0&&e.removeValue(o);return r}const p4=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class bue{scrapeMotionValuesFromProps(r,s,o){return{}}constructor({parent:r,props:s,presenceContext:o,reducedMotionConfig:u,blockInitialAnimation:h,visualState:m},g={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=I2,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const k=ga.now();this.renderScheduledAtthis.bindToMotionValue(o,s)),AF.current||yue(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:g_.current,this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Hd(this.notifyUpdate),Hd(this.render),this.valueSubscriptions.forEach(r=>r()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const r in this.events)this.events[r].clear();for(const r in this.features){const s=this.features[r];s&&(s.unmount(),s.isMounted=!1)}this.current=null}addChild(r){this.children.add(r),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(r)}removeChild(r){this.children.delete(r),this.enteringChildren&&this.enteringChildren.delete(r)}bindToMotionValue(r,s){this.valueSubscriptions.has(r)&&this.valueSubscriptions.get(r)();const o=Fg.has(r);o&&this.onBindTransform&&this.onBindTransform();const u=s.on("change",m=>{this.latestValues[r]=m,this.props.onUpdate&&$r.preRender(this.notifyUpdate),o&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let h;window.MotionCheckAppearSync&&(h=window.MotionCheckAppearSync(this,r,s)),this.valueSubscriptions.set(r,()=>{u(),h&&h(),s.owner&&s.stop()})}sortNodePosition(r){return!this.current||!this.sortInstanceNodePosition||this.type!==r.type?0:this.sortInstanceNodePosition(this.current,r.current)}updateFeatures(){let r="animation";for(r in Ag){const s=Ag[r];if(!s)continue;const{isEnabled:o,Feature:u}=s;if(!this.features[r]&&u&&o(this.props)&&(this.features[r]=new u(this)),this.features[r]){const h=this.features[r];h.isMounted?h.update():(h.mount(),h.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Cs()}getStaticValue(r){return this.latestValues[r]}setStaticValue(r,s){this.latestValues[r]=s}update(r,s){(r.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=r,this.prevPresenceContext=this.presenceContext,this.presenceContext=s;for(let o=0;os.variantChildren.delete(r)}addValue(r,s){const o=this.values.get(r);s!==o&&(o&&this.removeValue(r),this.bindToMotionValue(r,s),this.values.set(r,s),this.latestValues[r]=s.get())}removeValue(r){this.values.delete(r);const s=this.valueSubscriptions.get(r);s&&(s(),this.valueSubscriptions.delete(r)),delete this.latestValues[r],this.removeValueFromRenderState(r,this.renderState)}hasValue(r){return this.values.has(r)}getValue(r,s){if(this.props.values&&this.props.values[r])return this.props.values[r];let o=this.values.get(r);return o===void 0&&s!==void 0&&(o=Cg(s===null?void 0:s,{owner:this}),this.addValue(r,o)),o}readValue(r,s){let o=this.latestValues[r]!==void 0||!this.current?this.latestValues[r]:this.getBaseTargetFromProps(this.props,r)??this.readValueFromInstance(this.current,r,this.options);return o!=null&&(typeof o=="string"&&(v5(o)||b5(o))?o=parseFloat(o):!Nce(o)&&Gd.test(s)&&(o=nF(r,s)),this.setBaseTarget(r,Ci(o)?o.get():o)),Ci(o)?o.get():o}setBaseTarget(r,s){this.baseTarget[r]=s}getBaseTarget(r){const{initial:s}=this.props;let o;if(typeof s=="string"||typeof s=="object"){const h=G2(this.props,s,this.presenceContext?.custom);h&&(o=h[r])}if(s&&o!==void 0)return o;const u=this.getBaseTargetFromProps(this.props,r);return u!==void 0&&!Ci(u)?u:this.initialValues[r]!==void 0&&o===void 0?void 0:this.baseTarget[r]}on(r,s){return this.events[r]||(this.events[r]=new A2),this.events[r].add(s)}notify(r,...s){this.events[r]&&this.events[r].notify(...s)}scheduleRenderMicrotask(){F2.render(this.render)}}class OF extends bue{constructor(){super(...arguments),this.KeyframeResolver=bce}sortInstanceNodePosition(r,s){return r.compareDocumentPosition(s)&2?1:-1}getBaseTargetFromProps(r,s){return r.style?r.style[s]:void 0}removeValueFromRenderState(r,{vars:s,style:o}){delete s[r],delete o[r]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:r}=this.props;Ci(r)&&(this.childSubscription=r.on("change",s=>{this.current&&(this.current.textContent=`${s}`)}))}}function kF(e,{style:r,vars:s},o,u){const h=e.style;let m;for(m in r)h[m]=r[m];u?.applyProjectionStyles(h,o);for(m in s)h.setProperty(m,s[m])}function wue(e){return window.getComputedStyle(e)}class Sue extends OF{constructor(){super(...arguments),this.type="html",this.renderInstance=kF}readValueFromInstance(r,s){if(Fg.has(s))return this.projection?.isProjecting?a_(s):Lle(r,s);{const o=wue(r),u=(D5(s)?o.getPropertyValue(s):o[s])||0;return typeof u=="string"?u.trim():u}}measureInstanceViewportBox(r,{transformPagePoint:s}){return CF(r,s)}build(r,s,o){K2(r,s,o.transformTemplate)}scrapeMotionValuesFromProps(r,s,o){return X2(r,s,o)}}const RF=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Eue(e,r,s,o){kF(e,r,void 0,o);for(const u in r.attrs)e.setAttribute(RF.has(u)?u:Y2(u),r.attrs[u])}class jue extends OF{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Cs}getBaseTargetFromProps(r,s){return r[s]}readValueFromInstance(r,s){if(Fg.has(s)){const o=tF(s);return o&&o.default||0}return s=RF.has(s)?s:Y2(s),r.getAttribute(s)}scrapeMotionValuesFromProps(r,s,o){return vF(r,s,o)}build(r,s,o){fF(r,s,this.isSVGTag,o.transformTemplate,o.style)}renderInstance(r,s,o,u){Eue(r,s,o,u)}mount(r){this.isSVGTag=gF(r.tagName),super.mount(r)}}const Cue=(e,r)=>H2(e)?new jue(r):new Sue(r,{allowProjection:e!==T.Fragment});function vg(e,r,s){const o=e.getProps();return G2(o,r,s!==void 0?s:o.custom,e)}const y_=e=>Array.isArray(e);function Aue(e,r,s){e.hasValue(r)?e.getValue(r).set(s):e.addValue(r,Cg(s))}function Oue(e){return y_(e)?e[e.length-1]||0:e}function kue(e,r){const s=vg(e,r);let{transitionEnd:o={},transition:u={},...h}=s||{};h={...h,...o};for(const m in h){const g=Oue(h[m]);Aue(e,m,g)}}function Rue(e){return!!(Ci(e)&&e.add)}function v_(e,r){const s=e.getValue("willChange");if(Rue(s))return s.add(r);if(!s&&xu.WillChange){const o=new xu.WillChange("auto");e.addValue("willChange",o),o.add(r)}}function TF(e){return e.props[xF]}const Tue=e=>e!==null;function _ue(e,{repeat:r,repeatType:s="loop"},o){const u=e.filter(Tue),h=r&&s!=="loop"&&r%2===1?0:u.length-1;return u[h]}const $ue={type:"spring",stiffness:500,damping:25,restSpeed:10},Nue=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Due={type:"keyframes",duration:.8},Pue={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Mue=(e,{keyframes:r})=>r.length>2?Due:Fg.has(e)?e.startsWith("scale")?Nue(r[1]):$ue:Pue;function Iue({when:e,delay:r,delayChildren:s,staggerChildren:o,staggerDirection:u,repeat:h,repeatType:m,repeatDelay:g,from:b,elapsed:w,...E}){return!!Object.keys(E).length}const Z2=(e,r,s,o={},u,h)=>m=>{const g=z2(o,e)||{},b=g.delay||o.delay||0;let{elapsed:w=0}=o;w=w-lc(b);const E={keyframes:Array.isArray(s)?s:[null,s],ease:"easeOut",velocity:r.getVelocity(),...g,delay:-w,onUpdate:k=>{r.set(k),g.onUpdate&&g.onUpdate(k)},onComplete:()=>{m(),g.onComplete&&g.onComplete()},name:e,motionValue:r,element:h?void 0:u};Iue(g)||Object.assign(E,Mue(e,E)),E.duration&&(E.duration=lc(E.duration)),E.repeatDelay&&(E.repeatDelay=lc(E.repeatDelay)),E.from!==void 0&&(E.keyframes[0]=E.from);let A=!1;if((E.type===!1||E.duration===0&&!E.repeatDelay)&&(d_(E),E.delay===0&&(A=!0)),(xu.instantAnimations||xu.skipAnimations)&&(A=!0,d_(E),E.delay=0),E.allowFlatten=!g.type&&!g.ease,A&&!h&&r.get()!==void 0){const k=_ue(E.keyframes,g);if(k!==void 0){$r.update(()=>{E.onUpdate(k),E.onComplete()});return}}return g.isSync?new M2(E):new lce(E)};function zue({protectedKeys:e,needsAnimating:r},s){const o=e.hasOwnProperty(s)&&r[s]!==!0;return r[s]=!1,o}function _F(e,r,{delay:s=0,transitionOverride:o,type:u}={}){let{transition:h=e.getDefaultTransition(),transitionEnd:m,...g}=r;o&&(h=o);const b=[],w=u&&e.animationState&&e.animationState.getState()[u];for(const E in g){const A=e.getValue(E,e.latestValues[E]??null),k=g[E];if(k===void 0||w&&zue(w,E))continue;const R={delay:s,...z2(h||{},E)},M=A.get();if(M!==void 0&&!A.isAnimating&&!Array.isArray(k)&&k===M&&!R.velocity)continue;let I=!1;if(window.MotionHandoffAnimation){const H=TF(e);if(H){const V=window.MotionHandoffAnimation(H,E,$r);V!==null&&(R.startTime=V,I=!0)}}v_(e,E),A.start(Z2(E,A,k,e.shouldReduceMotion&&W5.has(E)?{type:!1}:R,e,I));const F=A.animation;F&&b.push(F)}return m&&Promise.all(b).then(()=>{$r.update(()=>{m&&kue(e,m)})}),b}function $F(e,r,s,o=0,u=1){const h=Array.from(e).sort((w,E)=>w.sortNodePosition(E)).indexOf(r),m=e.size,g=(m-1)*o;return typeof s=="function"?s(h,m):u===1?h*o:g-h*o}function x_(e,r,s={}){const o=vg(e,r,s.type==="exit"?e.presenceContext?.custom:void 0);let{transition:u=e.getDefaultTransition()||{}}=o||{};s.transitionOverride&&(u=s.transitionOverride);const h=o?()=>Promise.all(_F(e,o,s)):()=>Promise.resolve(),m=e.variantChildren&&e.variantChildren.size?(b=0)=>{const{delayChildren:w=0,staggerChildren:E,staggerDirection:A}=u;return Lue(e,r,b,w,E,A,s)}:()=>Promise.resolve(),{when:g}=u;if(g){const[b,w]=g==="beforeChildren"?[h,m]:[m,h];return b().then(()=>w())}else return Promise.all([h(),m(s.delay)])}function Lue(e,r,s=0,o=0,u=0,h=1,m){const g=[];for(const b of e.variantChildren)b.notify("AnimationStart",r),g.push(x_(b,r,{...m,delay:s+(typeof o=="function"?0:o)+$F(e.variantChildren,b,o,u,h)}).then(()=>b.notify("AnimationComplete",r)));return Promise.all(g)}function Fue(e,r,s={}){e.notify("AnimationStart",r);let o;if(Array.isArray(r)){const u=r.map(h=>x_(e,h,s));o=Promise.all(u)}else if(typeof r=="string")o=x_(e,r,s);else{const u=typeof r=="function"?vg(e,r,s.custom):r;o=Promise.all(_F(e,u,s))}return o.then(()=>{e.notify("AnimationComplete",r)})}function NF(e,r){if(!Array.isArray(r))return!1;const s=r.length;if(s!==e.length)return!1;for(let o=0;oPromise.all(r.map(({animation:s,options:o})=>Fue(e,s,o)))}function Vue(e){let r=Kue(e),s=f4(),o=!0;const u=b=>(w,E)=>{const A=vg(e,E,b==="exit"?e.presenceContext?.custom:void 0);if(A){const{transition:k,transitionEnd:R,...M}=A;w={...w,...M,...R}}return w};function h(b){r=b(e)}function m(b){const{props:w}=e,E=DF(e.parent)||{},A=[],k=new Set;let R={},M=1/0;for(let F=0;FM&&z,de=!1;const je=Array.isArray(K)?K:[K];let we=je.reduce(u(H),{});W===!1&&(we={});const{prevResolvedValues:ie={}}=V,Se={...ie,...we},Ae=ne=>{te=!0,k.has(ne)&&(de=!0,k.delete(ne)),V.needsAnimating[ne]=!0;const ce=e.getValue(ne);ce&&(ce.liveStyle=!1)};for(const ne in Se){const ce=we[ne],$e=ie[ne];if(R.hasOwnProperty(ne))continue;let me=!1;y_(ce)&&y_($e)?me=!NF(ce,$e):me=ce!==$e,me?ce!=null?Ae(ne):k.add(ne):ce!==void 0&&k.has(ne)?Ae(ne):V.protectedKeys[ne]=!0}V.prevProp=K,V.prevResolvedValues=we,V.isActive&&(R={...R,...we}),o&&e.blockInitialAnimation&&(te=!1);const He=ae&&Q;te&&(!He||de)&&A.push(...je.map(ne=>{const ce={type:H};if(typeof ne=="string"&&o&&!He&&e.manuallyAnimateOnMount&&e.parent){const{parent:$e}=e,me=vg($e,ne);if($e.enteringChildren&&me){const{delayChildren:Xe}=me.transition||{};ce.delay=$F($e.enteringChildren,e,Xe)}}return{animation:ne,options:ce}}))}if(k.size){const F={};if(typeof w.initial!="boolean"){const H=vg(e,Array.isArray(w.initial)?w.initial[0]:w.initial);H&&H.transition&&(F.transition=H.transition)}k.forEach(H=>{const V=e.getBaseTarget(H),K=e.getValue(H);K&&(K.liveStyle=!0),F[H]=V??null}),A.push({animation:F})}let I=!!A.length;return o&&(w.initial===!1||w.initial===w.animate)&&!e.manuallyAnimateOnMount&&(I=!1),o=!1,I?r(A):Promise.resolve()}function g(b,w){if(s[b].isActive===w)return Promise.resolve();e.variantChildren?.forEach(A=>A.animationState?.setActive(b,w)),s[b].isActive=w;const E=m(b);for(const A in s)s[A].protectedKeys={};return E}return{animateChanges:m,setActive:g,setAnimateFunction:h,getState:()=>s,reset:()=>{s=f4()}}}function Hue(e,r){return typeof r=="string"?r!==e:Array.isArray(r)?!NF(r,e):!1}function xp(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function f4(){return{animate:xp(!0),whileInView:xp(),whileHover:xp(),whileTap:xp(),whileDrag:xp(),whileFocus:xp(),exit:xp()}}class Wd{constructor(r){this.isMounted=!1,this.node=r}update(){}}class Gue extends Wd{constructor(r){super(r),r.animationState||(r.animationState=Vue(r))}updateAnimationControlsSubscription(){const{animate:r}=this.node.getProps();HC(r)&&(this.unmountControls=r.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:r}=this.node.getProps(),{animate:s}=this.node.prevProps||{};r!==s&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let Xue=0;class Yue extends Wd{constructor(){super(...arguments),this.id=Xue++}update(){if(!this.node.presenceContext)return;const{isPresent:r,onExitComplete:s}=this.node.presenceContext,{isPresent:o}=this.node.prevPresenceContext||{};if(!this.node.animationState||r===o)return;const u=this.node.animationState.setActive("exit",!r);s&&!r&&u.then(()=>{s(this.id)})}mount(){const{register:r,onExitComplete:s}=this.node.presenceContext||{};s&&s(this.id),r&&(this.unmount=r(this.id))}unmount(){}}const Zue={animation:{Feature:Gue},exit:{Feature:Yue}};function Wb(e,r,s,o={passive:!0}){return e.addEventListener(r,s,o),()=>e.removeEventListener(r,s)}function xw(e){return{point:{x:e.pageX,y:e.pageY}}}const Jue=e=>r=>q2(r)&&e(r,xw(r));function Fb(e,r,s,o){return Wb(e,r,Jue(s),o)}const PF=1e-4,Wue=1-PF,Que=1+PF,MF=.01,ede=0-MF,tde=0+MF;function Vi(e){return e.max-e.min}function nde(e,r,s){return Math.abs(e-r)<=s}function m4(e,r,s,o=.5){e.origin=o,e.originPoint=Lr(r.min,r.max,e.origin),e.scale=Vi(s)/Vi(r),e.translate=Lr(s.min,s.max,e.origin)-e.originPoint,(e.scale>=Wue&&e.scale<=Que||isNaN(e.scale))&&(e.scale=1),(e.translate>=ede&&e.translate<=tde||isNaN(e.translate))&&(e.translate=0)}function qb(e,r,s,o){m4(e.x,r.x,s.x,o?o.originX:void 0),m4(e.y,r.y,s.y,o?o.originY:void 0)}function g4(e,r,s){e.min=s.min+r.min,e.max=e.min+Vi(r)}function rde(e,r,s){g4(e.x,r.x,s.x),g4(e.y,r.y,s.y)}function y4(e,r,s){e.min=r.min-s.min,e.max=e.min+Vi(r)}function tC(e,r,s){y4(e.x,r.x,s.x),y4(e.y,r.y,s.y)}function ao(e){return[e("x"),e("y")]}const IF=({current:e})=>e?e.ownerDocument.defaultView:null,v4=(e,r)=>Math.abs(e-r);function sde(e,r){const s=v4(e.x,r.x),o=v4(e.y,r.y);return Math.sqrt(s**2+o**2)}class zF{constructor(r,s,{transformPagePoint:o,contextWindow:u=window,dragSnapToOrigin:h=!1,distanceThreshold:m=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const k=pT(this.lastMoveEventInfo,this.history),R=this.startEvent!==null,M=sde(k.offset,{x:0,y:0})>=this.distanceThreshold;if(!R&&!M)return;const{point:I}=k,{timestamp:F}=Hs;this.history.push({...I,timestamp:F});const{onStart:H,onMove:V}=this.handlers;R||(H&&H(this.lastMoveEvent,k),this.startEvent=this.lastMoveEvent),V&&V(this.lastMoveEvent,k)},this.handlePointerMove=(k,R)=>{this.lastMoveEvent=k,this.lastMoveEventInfo=hT(R,this.transformPagePoint),$r.update(this.updatePoint,!0)},this.handlePointerUp=(k,R)=>{this.end();const{onEnd:M,onSessionEnd:I,resumeAnimation:F}=this.handlers;if(this.dragSnapToOrigin&&F&&F(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const H=pT(k.type==="pointercancel"?this.lastMoveEventInfo:hT(R,this.transformPagePoint),this.history);this.startEvent&&M&&M(k,H),I&&I(k,H)},!q2(r))return;this.dragSnapToOrigin=h,this.handlers=s,this.transformPagePoint=o,this.distanceThreshold=m,this.contextWindow=u||window;const g=xw(r),b=hT(g,this.transformPagePoint),{point:w}=b,{timestamp:E}=Hs;this.history=[{...w,timestamp:E}];const{onSessionStart:A}=s;A&&A(r,pT(b,this.history)),this.removeListeners=gw(Fb(this.contextWindow,"pointermove",this.handlePointerMove),Fb(this.contextWindow,"pointerup",this.handlePointerUp),Fb(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(r){this.handlers=r}end(){this.removeListeners&&this.removeListeners(),Hd(this.updatePoint)}}function hT(e,r){return r?{point:r(e.point)}:e}function x4(e,r){return{x:e.x-r.x,y:e.y-r.y}}function pT({point:e},r){return{point:e,delta:x4(e,LF(r)),offset:x4(e,ide(r)),velocity:ade(r,.1)}}function ide(e){return e[0]}function LF(e){return e[e.length-1]}function ade(e,r){if(e.length<2)return{x:0,y:0};let s=e.length-1,o=null;const u=LF(e);for(;s>=0&&(o=e[s],!(u.timestamp-o.timestamp>lc(r)));)s--;if(!o)return{x:0,y:0};const h=lo(u.timestamp-o.timestamp);if(h===0)return{x:0,y:0};const m={x:(u.x-o.x)/h,y:(u.y-o.y)/h};return m.x===1/0&&(m.x=0),m.y===1/0&&(m.y=0),m}function ode(e,{min:r,max:s},o){return r!==void 0&&es&&(e=o?Lr(s,e,o.max):Math.min(e,s)),e}function b4(e,r,s){return{min:r!==void 0?e.min+r:void 0,max:s!==void 0?e.max+s-(e.max-e.min):void 0}}function lde(e,{top:r,left:s,bottom:o,right:u}){return{x:b4(e.x,s,u),y:b4(e.y,r,o)}}function w4(e,r){let s=r.min-e.min,o=r.max-e.max;return r.max-r.mino?s=Xb(r.min,r.max-o,e.min):o>u&&(s=Xb(e.min,e.max-u,r.min)),vu(0,1,s)}function dde(e,r){const s={};return r.min!==void 0&&(s.min=r.min-e.min),r.max!==void 0&&(s.max=r.max-e.min),s}const b_=.35;function hde(e=b_){return e===!1?e=0:e===!0&&(e=b_),{x:S4(e,"left","right"),y:S4(e,"top","bottom")}}function S4(e,r,s){return{min:E4(e,r),max:E4(e,s)}}function E4(e,r){return typeof e=="number"?e:e[r]||0}const pde=new WeakMap;class fde{constructor(r){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Cs(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=r}start(r,{snapToCursor:s=!1,distanceThreshold:o}={}){const{presenceContext:u}=this.visualElement;if(u&&u.isPresent===!1)return;const h=A=>{const{dragSnapToOrigin:k}=this.getProps();k?this.pauseAnimation():this.stopAnimation(),s&&this.snapToCursor(xw(A).point)},m=(A,k)=>{const{drag:R,dragPropagation:M,onDragStart:I}=this.getProps();if(R&&!M&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Cce(R),!this.openDragLock))return;this.latestPointerEvent=A,this.latestPanInfo=k,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),ao(H=>{let V=this.getAxisMotionValue(H).get()||0;if(cc.test(V)){const{projection:K}=this.visualElement;if(K&&K.layout){const z=K.layout.layoutBox[H];z&&(V=Vi(z)*(parseFloat(V)/100))}}this.originPoint[H]=V}),I&&$r.postRender(()=>I(A,k)),v_(this.visualElement,"transform");const{animationState:F}=this.visualElement;F&&F.setActive("whileDrag",!0)},g=(A,k)=>{this.latestPointerEvent=A,this.latestPanInfo=k;const{dragPropagation:R,dragDirectionLock:M,onDirectionLock:I,onDrag:F}=this.getProps();if(!R&&!this.openDragLock)return;const{offset:H}=k;if(M&&this.currentDirection===null){this.currentDirection=mde(H),this.currentDirection!==null&&I&&I(this.currentDirection);return}this.updateAxis("x",k.point,H),this.updateAxis("y",k.point,H),this.visualElement.render(),F&&F(A,k)},b=(A,k)=>{this.latestPointerEvent=A,this.latestPanInfo=k,this.stop(A,k),this.latestPointerEvent=null,this.latestPanInfo=null},w=()=>ao(A=>this.getAnimationState(A)==="paused"&&this.getAxisMotionValue(A).animation?.play()),{dragSnapToOrigin:E}=this.getProps();this.panSession=new zF(r,{onSessionStart:h,onStart:m,onMove:g,onSessionEnd:b,resumeAnimation:w},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:E,distanceThreshold:o,contextWindow:IF(this.visualElement)})}stop(r,s){const o=r||this.latestPointerEvent,u=s||this.latestPanInfo,h=this.isDragging;if(this.cancel(),!h||!u||!o)return;const{velocity:m}=u;this.startAnimation(m);const{onDragEnd:g}=this.getProps();g&&$r.postRender(()=>g(o,u))}cancel(){this.isDragging=!1;const{projection:r,animationState:s}=this.visualElement;r&&(r.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:o}=this.getProps();!o&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),s&&s.setActive("whileDrag",!1)}updateAxis(r,s,o){const{drag:u}=this.getProps();if(!o||!aj(r,u,this.currentDirection))return;const h=this.getAxisMotionValue(r);let m=this.originPoint[r]+o[r];this.constraints&&this.constraints[r]&&(m=ode(m,this.constraints[r],this.elastic[r])),h.set(m)}resolveConstraints(){const{dragConstraints:r,dragElastic:s}=this.getProps(),o=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,u=this.constraints;r&&cg(r)?this.constraints||(this.constraints=this.resolveRefConstraints()):r&&o?this.constraints=lde(o.layoutBox,r):this.constraints=!1,this.elastic=hde(s),u!==this.constraints&&o&&this.constraints&&!this.hasMutatedConstraints&&ao(h=>{this.constraints!==!1&&this.getAxisMotionValue(h)&&(this.constraints[h]=dde(o.layoutBox[h],this.constraints[h]))})}resolveRefConstraints(){const{dragConstraints:r,onMeasureDragConstraints:s}=this.getProps();if(!r||!cg(r))return!1;const o=r.current,{projection:u}=this.visualElement;if(!u||!u.layout)return!1;const h=gue(o,u.root,this.visualElement.getTransformPagePoint());let m=cde(u.layout.layoutBox,h);if(s){const g=s(pue(m));this.hasMutatedConstraints=!!g,g&&(m=SF(g))}return m}startAnimation(r){const{drag:s,dragMomentum:o,dragElastic:u,dragTransition:h,dragSnapToOrigin:m,onDragTransitionEnd:g}=this.getProps(),b=this.constraints||{},w=ao(E=>{if(!aj(E,s,this.currentDirection))return;let A=b&&b[E]||{};m&&(A={min:0,max:0});const k=u?200:1e6,R=u?40:1e7,M={type:"inertia",velocity:o?r[E]:0,bounceStiffness:k,bounceDamping:R,timeConstant:750,restDelta:1,restSpeed:10,...h,...A};return this.startAxisValueAnimation(E,M)});return Promise.all(w).then(g)}startAxisValueAnimation(r,s){const o=this.getAxisMotionValue(r);return v_(this.visualElement,r),o.start(Z2(r,o,0,s,this.visualElement,!1))}stopAnimation(){ao(r=>this.getAxisMotionValue(r).stop())}pauseAnimation(){ao(r=>this.getAxisMotionValue(r).animation?.pause())}getAnimationState(r){return this.getAxisMotionValue(r).animation?.state}getAxisMotionValue(r){const s=`_drag${r.toUpperCase()}`,o=this.visualElement.getProps(),u=o[s];return u||this.visualElement.getValue(r,(o.initial?o.initial[r]:void 0)||0)}snapToCursor(r){ao(s=>{const{drag:o}=this.getProps();if(!aj(s,o,this.currentDirection))return;const{projection:u}=this.visualElement,h=this.getAxisMotionValue(s);if(u&&u.layout){const{min:m,max:g}=u.layout.layoutBox[s];h.set(r[s]-Lr(m,g,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:r,dragConstraints:s}=this.getProps(),{projection:o}=this.visualElement;if(!cg(s)||!o||!this.constraints)return;this.stopAnimation();const u={x:0,y:0};ao(m=>{const g=this.getAxisMotionValue(m);if(g&&this.constraints!==!1){const b=g.get();u[m]=ude({min:b,max:b},this.constraints[m])}});const{transformTemplate:h}=this.visualElement.getProps();this.visualElement.current.style.transform=h?h({},""):"none",o.root&&o.root.updateScroll(),o.updateLayout(),this.resolveConstraints(),ao(m=>{if(!aj(m,r,null))return;const g=this.getAxisMotionValue(m),{min:b,max:w}=this.constraints[m];g.set(Lr(b,w,u[m]))})}addListeners(){if(!this.visualElement.current)return;pde.set(this.visualElement,this);const r=this.visualElement.current,s=Fb(r,"pointerdown",b=>{const{drag:w,dragListener:E=!0}=this.getProps();w&&E&&this.start(b)}),o=()=>{const{dragConstraints:b}=this.getProps();cg(b)&&b.current&&(this.constraints=this.resolveRefConstraints())},{projection:u}=this.visualElement,h=u.addEventListener("measure",o);u&&!u.layout&&(u.root&&u.root.updateScroll(),u.updateLayout()),$r.read(o);const m=Wb(window,"resize",()=>this.scalePositionWithinConstraints()),g=u.addEventListener("didUpdate",(({delta:b,hasLayoutChanged:w})=>{this.isDragging&&w&&(ao(E=>{const A=this.getAxisMotionValue(E);A&&(this.originPoint[E]+=b[E].translate,A.set(A.get()+b[E].translate))}),this.visualElement.render())}));return()=>{m(),s(),h(),g&&g()}}getProps(){const r=this.visualElement.getProps(),{drag:s=!1,dragDirectionLock:o=!1,dragPropagation:u=!1,dragConstraints:h=!1,dragElastic:m=b_,dragMomentum:g=!0}=r;return{...r,drag:s,dragDirectionLock:o,dragPropagation:u,dragConstraints:h,dragElastic:m,dragMomentum:g}}}function aj(e,r,s){return(r===!0||r===e)&&(s===null||s===e)}function mde(e,r=10){let s=null;return Math.abs(e.y)>r?s="y":Math.abs(e.x)>r&&(s="x"),s}class gde extends Wd{constructor(r){super(r),this.removeGroupControls=co,this.removeListeners=co,this.controls=new fde(r)}mount(){const{dragControls:r}=this.node.getProps();r&&(this.removeGroupControls=r.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||co}unmount(){this.removeGroupControls(),this.removeListeners()}}const j4=e=>(r,s)=>{e&&$r.postRender(()=>e(r,s))};class yde extends Wd{constructor(){super(...arguments),this.removePointerDownListener=co}onPointerDown(r){this.session=new zF(r,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:IF(this.node)})}createPanHandlers(){const{onPanSessionStart:r,onPanStart:s,onPan:o,onPanEnd:u}=this.node.getProps();return{onSessionStart:j4(r),onStart:j4(s),onMove:o,onEnd:(h,m)=>{delete this.session,u&&$r.postRender(()=>u(h,m))}}}mount(){this.removePointerDownListener=Fb(this.node.current,"pointerdown",r=>this.onPointerDown(r))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Oj={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let fT=!1;class vde extends T.Component{componentDidMount(){const{visualElement:r,layoutGroup:s,switchLayoutGroup:o,layoutId:u}=this.props,{projection:h}=r;h&&(s.group&&s.group.add(h),o&&o.register&&u&&o.register(h),fT&&h.root.didUpdate(),h.addEventListener("animationComplete",()=>{this.safeToRemove()}),h.setOptions({...h.options,onExitComplete:()=>this.safeToRemove()})),Oj.hasEverUpdated=!0}getSnapshotBeforeUpdate(r){const{layoutDependency:s,visualElement:o,drag:u,isPresent:h}=this.props,{projection:m}=o;return m&&(m.isPresent=h,fT=!0,u||r.layoutDependency!==s||s===void 0||r.isPresent!==h?m.willUpdate():this.safeToRemove(),r.isPresent!==h&&(h?m.promote():m.relegate()||$r.postRender(()=>{const g=m.getStack();(!g||!g.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:r}=this.props.visualElement;r&&(r.root.didUpdate(),F2.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:r,layoutGroup:s,switchLayoutGroup:o}=this.props,{projection:u}=r;fT=!0,u&&(u.scheduleCheckAfterUnmount(),s&&s.group&&s.group.remove(u),o&&o.deregister&&o.deregister(u))}safeToRemove(){const{safeToRemove:r}=this.props;r&&r()}render(){return null}}function FF(e){const[r,s]=Dce(),o=T.useContext(y5);return c.jsx(vde,{...e,layoutGroup:o,switchLayoutGroup:T.useContext(bF),isPresent:r,safeToRemove:s})}function xde(e,r,s){const o=Ci(e)?e:Cg(e);return o.start(Z2("",o,r,s)),o.animation}const bde=(e,r)=>e.depth-r.depth;class wde{constructor(){this.children=[],this.isDirty=!1}add(r){S2(this.children,r),this.isDirty=!0}remove(r){E2(this.children,r),this.isDirty=!0}forEach(r){this.isDirty&&this.children.sort(bde),this.isDirty=!1,this.children.forEach(r)}}function Sde(e,r){const s=ga.now(),o=({timestamp:u})=>{const h=u-s;h>=r&&(Hd(o),e(h-r))};return $r.setup(o,!0),()=>Hd(o)}const qF=["TopLeft","TopRight","BottomLeft","BottomRight"],Ede=qF.length,C4=e=>typeof e=="string"?parseFloat(e):e,A4=e=>typeof e=="number"||sn.test(e);function jde(e,r,s,o,u,h){u?(e.opacity=Lr(0,s.opacity??1,Cde(o)),e.opacityExit=Lr(r.opacity??1,0,Ade(o))):h&&(e.opacity=Lr(r.opacity??1,s.opacity??1,o));for(let m=0;mor?1:s(Xb(e,r,o))}function k4(e,r){e.min=r.min,e.max=r.max}function Yo(e,r){k4(e.x,r.x),k4(e.y,r.y)}function R4(e,r){e.translate=r.translate,e.scale=r.scale,e.originPoint=r.originPoint,e.origin=r.origin}function T4(e,r,s,o,u){return e-=r,e=eC(e,1/s,o),u!==void 0&&(e=eC(e,1/u,o)),e}function Ode(e,r=0,s=1,o=.5,u,h=e,m=e){if(cc.test(r)&&(r=parseFloat(r),r=Lr(m.min,m.max,r/100)-m.min),typeof r!="number")return;let g=Lr(h.min,h.max,o);e===h&&(g-=r),e.min=T4(e.min,r,s,g,u),e.max=T4(e.max,r,s,g,u)}function _4(e,r,[s,o,u],h,m){Ode(e,r[s],r[o],r[u],r.scale,h,m)}const kde=["x","scaleX","originX"],Rde=["y","scaleY","originY"];function $4(e,r,s,o){_4(e.x,r,kde,s?s.x:void 0,o?o.x:void 0),_4(e.y,r,Rde,s?s.y:void 0,o?o.y:void 0)}function N4(e){return e.translate===0&&e.scale===1}function UF(e){return N4(e.x)&&N4(e.y)}function D4(e,r){return e.min===r.min&&e.max===r.max}function Tde(e,r){return D4(e.x,r.x)&&D4(e.y,r.y)}function P4(e,r){return Math.round(e.min)===Math.round(r.min)&&Math.round(e.max)===Math.round(r.max)}function KF(e,r){return P4(e.x,r.x)&&P4(e.y,r.y)}function M4(e){return Vi(e.x)/Vi(e.y)}function I4(e,r){return e.translate===r.translate&&e.scale===r.scale&&e.originPoint===r.originPoint}class _de{constructor(){this.members=[]}add(r){S2(this.members,r),r.scheduleRender()}remove(r){if(E2(this.members,r),r===this.prevLead&&(this.prevLead=void 0),r===this.lead){const s=this.members[this.members.length-1];s&&this.promote(s)}}relegate(r){const s=this.members.findIndex(u=>r===u);if(s===0)return!1;let o;for(let u=s;u>=0;u--){const h=this.members[u];if(h.isPresent!==!1){o=h;break}}return o?(this.promote(o),!0):!1}promote(r,s){const o=this.lead;if(r!==o&&(this.prevLead=o,this.lead=r,r.show(),o)){o.instance&&o.scheduleRender(),r.scheduleRender(),r.resumeFrom=o,s&&(r.resumeFrom.preserveOpacity=!0),o.snapshot&&(r.snapshot=o.snapshot,r.snapshot.latestValues=o.animationValues||o.latestValues),r.root&&r.root.isUpdating&&(r.isLayoutDirty=!0);const{crossfade:u}=r.options;u===!1&&o.hide()}}exitAnimationComplete(){this.members.forEach(r=>{const{options:s,resumingFrom:o}=r;s.onExitComplete&&s.onExitComplete(),o&&o.options.onExitComplete&&o.options.onExitComplete()})}scheduleRender(){this.members.forEach(r=>{r.instance&&r.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function $de(e,r,s){let o="";const u=e.x.translate/r.x,h=e.y.translate/r.y,m=s?.z||0;if((u||h||m)&&(o=`translate3d(${u}px, ${h}px, ${m}px) `),(r.x!==1||r.y!==1)&&(o+=`scale(${1/r.x}, ${1/r.y}) `),s){const{transformPerspective:w,rotate:E,rotateX:A,rotateY:k,skewX:R,skewY:M}=s;w&&(o=`perspective(${w}px) ${o}`),E&&(o+=`rotate(${E}deg) `),A&&(o+=`rotateX(${A}deg) `),k&&(o+=`rotateY(${k}deg) `),R&&(o+=`skewX(${R}deg) `),M&&(o+=`skewY(${M}deg) `)}const g=e.x.scale*r.x,b=e.y.scale*r.y;return(g!==1||b!==1)&&(o+=`scale(${g}, ${b})`),o||"none"}const mT=["","X","Y","Z"],Nde=1e3;let Dde=0;function gT(e,r,s,o){const{latestValues:u}=r;u[e]&&(s[e]=u[e],r.setStaticValue(e,0),o&&(o[e]=0))}function VF(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:r}=e.options;if(!r)return;const s=TF(r);if(window.MotionHasOptimisedAnimation(s,"transform")){const{layout:u,layoutId:h}=e.options;window.MotionCancelOptimisedAnimation(s,"transform",$r,!(u||h))}const{parent:o}=e;o&&!o.hasCheckedOptimisedAppear&&VF(o)}function HF({attachResizeListener:e,defaultParent:r,measureScroll:s,checkIsScrollRoot:o,resetTransform:u}){return class{constructor(m={},g=r?.()){this.id=Dde++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Ide),this.nodes.forEach(qde),this.nodes.forEach(Bde),this.nodes.forEach(zde)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=m,this.root=g?g.root||g:this,this.path=g?[...g.path,g]:[],this.parent=g,this.depth=g?g.depth+1:0;for(let b=0;bthis.root.updateBlockedByResize=!1;$r.read(()=>{A=window.innerWidth}),e(m,()=>{const R=window.innerWidth;R!==A&&(A=R,this.root.updateBlockedByResize=!0,E&&E(),E=Sde(k,250),Oj.hasAnimatedSinceResize&&(Oj.hasAnimatedSinceResize=!1,this.nodes.forEach(F4)))})}g&&this.root.registerSharedNode(g,this),this.options.animate!==!1&&w&&(g||b)&&this.addEventListener("didUpdate",({delta:E,hasLayoutChanged:A,hasRelativeLayoutChanged:k,layout:R})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const M=this.options.transition||w.getDefaultTransition()||Gde,{onLayoutAnimationStart:I,onLayoutAnimationComplete:F}=w.getProps(),H=!this.targetLayout||!KF(this.targetLayout,R),V=!A&&k;if(this.options.layoutRoot||this.resumeFrom||V||A&&(H||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const K={...z2(M,"layout"),onPlay:I,onComplete:F};(w.shouldReduceMotion||this.options.layoutRoot)&&(K.delay=0,K.type=!1),this.startAnimation(K),this.setAnimationOrigin(E,V)}else A||F4(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=R})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const m=this.getStack();m&&m.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Hd(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Ude),this.animationId++)}getTransformTemplate(){const{visualElement:m}=this.options;return m&&m.getProps().transformTemplate}willUpdate(m=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&VF(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let E=0;E{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Vi(this.snapshot.measuredBox.x)&&!Vi(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let b=0;b{const W=z/1e3;q4(A.x,m.x,W),q4(A.y,m.y,W),this.setTargetDelta(A),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(tC(k,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Vde(this.relativeTarget,this.relativeTargetOrigin,k,W),K&&Tde(this.relativeTarget,K)&&(this.isProjectionDirty=!1),K||(K=Cs()),Yo(K,this.relativeTarget)),I&&(this.animationValues=E,jde(E,w,this.latestValues,W,V,H)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=W},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(m){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Hd(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=$r.update(()=>{Oj.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Cg(0)),this.currentAnimation=xde(this.motionValue,[0,1e3],{...m,velocity:0,isSync:!0,onUpdate:g=>{this.mixTargetDelta(g),m.onUpdate&&m.onUpdate(g)},onStop:()=>{},onComplete:()=>{m.onComplete&&m.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const m=this.getStack();m&&m.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Nde),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const m=this.getLead();let{targetWithTransforms:g,target:b,layout:w,latestValues:E}=m;if(!(!g||!b||!w)){if(this!==m&&this.layout&&w&&GF(this.options.animationType,this.layout.layoutBox,w.layoutBox)){b=this.target||Cs();const A=Vi(this.layout.layoutBox.x);b.x.min=m.target.x.min,b.x.max=b.x.min+A;const k=Vi(this.layout.layoutBox.y);b.y.min=m.target.y.min,b.y.max=b.y.min+k}Yo(g,b),dg(g,E),qb(this.projectionDeltaWithTransform,this.layoutCorrected,g,E)}}registerSharedNode(m,g){this.sharedNodes.has(m)||this.sharedNodes.set(m,new _de),this.sharedNodes.get(m).add(g);const w=g.options.initialPromotionConfig;g.promote({transition:w?w.transition:void 0,preserveFollowOpacity:w&&w.shouldPreserveFollowOpacity?w.shouldPreserveFollowOpacity(g):void 0})}isLead(){const m=this.getStack();return m?m.lead===this:!0}getLead(){const{layoutId:m}=this.options;return m?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:m}=this.options;return m?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:m}=this.options;if(m)return this.root.sharedNodes.get(m)}promote({needsReset:m,transition:g,preserveFollowOpacity:b}={}){const w=this.getStack();w&&w.promote(this,b),m&&(this.projectionDelta=void 0,this.needsReset=!0),g&&this.setOptions({transition:g})}relegate(){const m=this.getStack();return m?m.relegate(this):!1}resetSkewAndRotation(){const{visualElement:m}=this.options;if(!m)return;let g=!1;const{latestValues:b}=m;if((b.z||b.rotate||b.rotateX||b.rotateY||b.rotateZ||b.skewX||b.skewY)&&(g=!0),!g)return;const w={};b.z&&gT("z",m,w,this.animationValues);for(let E=0;Em.currentAnimation?.stop()),this.root.nodes.forEach(z4),this.root.sharedNodes.clear()}}}function Pde(e){e.updateLayout()}function Mde(e){const r=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&r&&e.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:o}=e.layout,{animationType:u}=e.options,h=r.source!==e.layout.source;u==="size"?ao(E=>{const A=h?r.measuredBox[E]:r.layoutBox[E],k=Vi(A);A.min=s[E].min,A.max=A.min+k}):GF(u,r.layoutBox,s)&&ao(E=>{const A=h?r.measuredBox[E]:r.layoutBox[E],k=Vi(s[E]);A.max=A.min+k,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[E].max=e.relativeTarget[E].min+k)});const m=hg();qb(m,s,r.layoutBox);const g=hg();h?qb(g,e.applyTransform(o,!0),r.measuredBox):qb(g,s,r.layoutBox);const b=!UF(m);let w=!1;if(!e.resumeFrom){const E=e.getClosestProjectingParent();if(E&&!E.resumeFrom){const{snapshot:A,layout:k}=E;if(A&&k){const R=Cs();tC(R,r.layoutBox,A.layoutBox);const M=Cs();tC(M,s,k.layoutBox),KF(R,M)||(w=!0),E.options.layoutRoot&&(e.relativeTarget=M,e.relativeTargetOrigin=R,e.relativeParent=E)}}}e.notifyListeners("didUpdate",{layout:s,snapshot:r,delta:g,layoutDelta:m,hasLayoutChanged:b,hasRelativeLayoutChanged:w})}else if(e.isLead()){const{onExitComplete:s}=e.options;s&&s()}e.options.transition=void 0}function Ide(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function zde(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Lde(e){e.clearSnapshot()}function z4(e){e.clearMeasurements()}function L4(e){e.isLayoutDirty=!1}function Fde(e){const{visualElement:r}=e.options;r&&r.getProps().onBeforeLayoutMeasure&&r.notify("BeforeLayoutMeasure"),e.resetTransform()}function F4(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function qde(e){e.resolveTargetDelta()}function Bde(e){e.calcProjection()}function Ude(e){e.resetSkewAndRotation()}function Kde(e){e.removeLeadSnapshot()}function q4(e,r,s){e.translate=Lr(r.translate,0,s),e.scale=Lr(r.scale,1,s),e.origin=r.origin,e.originPoint=r.originPoint}function B4(e,r,s,o){e.min=Lr(r.min,s.min,o),e.max=Lr(r.max,s.max,o)}function Vde(e,r,s,o){B4(e.x,r.x,s.x,o),B4(e.y,r.y,s.y,o)}function Hde(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Gde={duration:.45,ease:[.4,0,.1,1]},U4=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),K4=U4("applewebkit/")&&!U4("chrome/")?Math.round:co;function V4(e){e.min=K4(e.min),e.max=K4(e.max)}function Xde(e){V4(e.x),V4(e.y)}function GF(e,r,s){return e==="position"||e==="preserve-aspect"&&!nde(M4(r),M4(s),.2)}function Yde(e){return e!==e.root&&e.scroll?.wasRoot}const Zde=HF({attachResizeListener:(e,r)=>Wb(e,"resize",r),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),yT={current:void 0},XF=HF({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!yT.current){const e=new Zde({});e.mount(window),e.setOptions({layoutScroll:!0}),yT.current=e}return yT.current},resetTransform:(e,r)=>{e.style.transform=r!==void 0?r:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Jde={pan:{Feature:yde},drag:{Feature:gde,ProjectionNode:XF,MeasureLayout:FF}};function H4(e,r,s){const{props:o}=e;e.animationState&&o.whileHover&&e.animationState.setActive("whileHover",s==="Start");const u="onHover"+s,h=o[u];h&&$r.postRender(()=>h(r,xw(r)))}class Wde extends Wd{mount(){const{current:r}=this.node;r&&(this.unmount=Ace(r,(s,o)=>(H4(this.node,o,"Start"),u=>H4(this.node,u,"End"))))}unmount(){}}class Qde extends Wd{constructor(){super(...arguments),this.isActive=!1}onFocus(){let r=!1;try{r=this.node.current.matches(":focus-visible")}catch{r=!0}!r||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=gw(Wb(this.node.current,"focus",()=>this.onFocus()),Wb(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function G4(e,r,s){const{props:o}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&o.whileTap&&e.animationState.setActive("whileTap",s==="Start");const u="onTap"+(s==="End"?"":s),h=o[u];h&&$r.postRender(()=>h(r,xw(r)))}class ehe extends Wd{mount(){const{current:r}=this.node;r&&(this.unmount=Tce(r,(s,o)=>(G4(this.node,o,"Start"),(u,{success:h})=>G4(this.node,u,h?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const w_=new WeakMap,vT=new WeakMap,the=e=>{const r=w_.get(e.target);r&&r(e)},nhe=e=>{e.forEach(the)};function rhe({root:e,...r}){const s=e||document;vT.has(s)||vT.set(s,{});const o=vT.get(s),u=JSON.stringify(r);return o[u]||(o[u]=new IntersectionObserver(nhe,{root:e,...r})),o[u]}function she(e,r,s){const o=rhe(r);return w_.set(e,s),o.observe(e),()=>{w_.delete(e),o.unobserve(e)}}const ihe={some:0,all:1};class ahe extends Wd{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:r={}}=this.node.getProps(),{root:s,margin:o,amount:u="some",once:h}=r,m={root:s?s.current:void 0,rootMargin:o,threshold:typeof u=="number"?u:ihe[u]},g=b=>{const{isIntersecting:w}=b;if(this.isInView===w||(this.isInView=w,h&&!w&&this.hasEnteredView))return;w&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",w);const{onViewportEnter:E,onViewportLeave:A}=this.node.getProps(),k=w?E:A;k&&k(b)};return she(this.node.current,m,g)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:r,prevProps:s}=this.node;["amount","margin","root"].some(ohe(r,s))&&this.startObserver()}unmount(){}}function ohe({viewport:e={}},{viewport:r={}}={}){return s=>e[s]!==r[s]}const lhe={inView:{Feature:ahe},tap:{Feature:ehe},focus:{Feature:Qde},hover:{Feature:Wde}},che={layout:{ProjectionNode:XF,MeasureLayout:FF}},uhe={...Zue,...lhe,...Jde,...che},dhe=hue(uhe,Cue),hhe=[{id:"light",icon:VJ,label:"Light"},{id:"dark",icon:OJ,label:"Dark"},{id:"system",icon:CJ,label:"System"}],YF=({className:e="",variant:r="pill",ariaLabel:s="Toggle theme"})=>{const{theme:o,setTheme:u}=K_(),h=o??"system",m=r==="pill";return c.jsx("div",{className:vt("inline-flex items-center",m&&"bg-muted/70 rounded-full p-1 text-xs shadow-sm",!m&&"gap-2",e),"aria-label":s,role:"radiogroup",children:hhe.map(({id:g,icon:b,label:w})=>{const E=h===g;return c.jsxs("button",{type:"button",role:"radio","aria-checked":E,onClick:()=>u(g),"aria-label":m?w:void 0,className:vt("focus-visible:ring-ring focus-visible:ring-offset-background relative flex items-center justify-center rounded-full transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",E?"text-foreground border":"text-muted-foreground hover:text-foreground",m&&"h-8 w-8",!m&&"h-8 gap-2 px-3 text-sm font-medium"),children:[E&&c.jsx(dhe.span,{layoutId:"theme-switcher-pill",className:"bg-background absolute inset-0 rounded-full shadow-sm",transition:{type:"spring",stiffness:350,damping:26}}),c.jsx(b,{className:"relative z-10 h-4 w-4"}),!m&&c.jsx("span",{className:"relative z-10",children:w})]},g)})})};function phe(){return Un({queryKey:["me"],queryFn:()=>wp.getMe(),staleTime:300*1e3})}function fhe(e,r=[]){let s=[];function o(h,m){const g=T.createContext(m);g.displayName=h+"Context";const b=s.length;s=[...s,m];const w=A=>{const{scope:k,children:R,...M}=A,I=k?.[e]?.[b]||g,F=T.useMemo(()=>M,Object.values(M));return c.jsx(I.Provider,{value:F,children:R})};w.displayName=h+"Provider";function E(A,k){const R=k?.[e]?.[b]||g,M=T.useContext(R);if(M)return M;if(m!==void 0)return m;throw new Error(`\`${A}\` must be used within \`${h}\``)}return[w,E]}const u=()=>{const h=s.map(m=>T.createContext(m));return function(g){const b=g?.[e]||h;return T.useMemo(()=>({[`__scope${e}`]:{...g,[e]:b}}),[g,b])}};return u.scopeName=e,[o,mhe(u,...r)]}function mhe(...e){const r=e[0];if(e.length===1)return r;const s=()=>{const o=e.map(u=>({useScope:u(),scopeName:u.scopeName}));return function(h){const m=o.reduce((g,{useScope:b,scopeName:w})=>{const A=b(h)[`__scope${w}`];return{...g,...A}},{});return T.useMemo(()=>({[`__scope${r.scopeName}`]:m}),[m])}};return s.scopeName=r.scopeName,s}var ghe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],J2=ghe.reduce((e,r)=>{const s=iw(`Primitive.${r}`),o=T.forwardRef((u,h)=>{const{asChild:m,...g}=u,b=m?s:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(b,{...g,ref:h})});return o.displayName=`Primitive.${r}`,{...e,[r]:o}},{}),xT={exports:{}},bT={};var X4;function yhe(){if(X4)return bT;X4=1;var e=tz();function r(A,k){return A===k&&(A!==0||1/A===1/k)||A!==A&&k!==k}var s=typeof Object.is=="function"?Object.is:r,o=e.useState,u=e.useEffect,h=e.useLayoutEffect,m=e.useDebugValue;function g(A,k){var R=k(),M=o({inst:{value:R,getSnapshot:k}}),I=M[0].inst,F=M[1];return h(function(){I.value=R,I.getSnapshot=k,b(I)&&F({inst:I})},[A,R,k]),u(function(){return b(I)&&F({inst:I}),A(function(){b(I)&&F({inst:I})})},[A]),m(R),R}function b(A){var k=A.getSnapshot;A=A.value;try{var R=k();return!s(A,R)}catch{return!0}}function w(A,k){return k()}var E=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?w:g;return bT.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:E,bT}var Y4;function vhe(){return Y4||(Y4=1,xT.exports=yhe()),xT.exports}var xhe=vhe();function bhe(){return xhe.useSyncExternalStore(whe,()=>!0,()=>!1)}function whe(){return()=>{}}var W2="Avatar",[She]=fhe(W2),[Ehe,ZF]=She(W2),JF=T.forwardRef((e,r)=>{const{__scopeAvatar:s,...o}=e,[u,h]=T.useState("idle");return c.jsx(Ehe,{scope:s,imageLoadingStatus:u,onImageLoadingStatusChange:h,children:c.jsx(J2.span,{...o,ref:r})})});JF.displayName=W2;var WF="AvatarImage",jhe=T.forwardRef((e,r)=>{const{__scopeAvatar:s,src:o,onLoadingStatusChange:u=()=>{},...h}=e,m=ZF(WF,s),g=Che(o,h),b=sl(w=>{u(w),m.onImageLoadingStatusChange(w)});return Os(()=>{g!=="idle"&&b(g)},[g,b]),g==="loaded"?c.jsx(J2.img,{...h,ref:r,src:o}):null});jhe.displayName=WF;var QF="AvatarFallback",e6=T.forwardRef((e,r)=>{const{__scopeAvatar:s,delayMs:o,...u}=e,h=ZF(QF,s),[m,g]=T.useState(o===void 0);return T.useEffect(()=>{if(o!==void 0){const b=window.setTimeout(()=>g(!0),o);return()=>window.clearTimeout(b)}},[o]),m&&h.imageLoadingStatus!=="loaded"?c.jsx(J2.span,{...u,ref:r}):null});e6.displayName=QF;function Z4(e,r){return e?r?(e.src!==r&&(e.src=r),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function Che(e,{referrerPolicy:r,crossOrigin:s}){const o=bhe(),u=T.useRef(null),h=o?(u.current||(u.current=new window.Image),u.current):null,[m,g]=T.useState(()=>Z4(h,e));return Os(()=>{g(Z4(h,e))},[h,e]),Os(()=>{const b=A=>()=>{g(A)};if(!h)return;const w=b("loaded"),E=b("error");return h.addEventListener("load",w),h.addEventListener("error",E),r&&(h.referrerPolicy=r),typeof s=="string"&&(h.crossOrigin=s),()=>{h.removeEventListener("load",w),h.removeEventListener("error",E)}},[h,s,r]),m}var Ahe=JF,Ohe=e6;function khe({className:e,...r}){return c.jsx(Ahe,{"data-slot":"avatar",className:vt("relative flex size-8 shrink-0 overflow-hidden rounded-full",e),...r})}function Rhe({className:e,...r}){return c.jsx(Ohe,{"data-slot":"avatar-fallback",className:vt("bg-muted flex size-full items-center justify-center rounded-full",e),...r})}function The({...e}){return c.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function _he({className:e,...r}){return c.jsx("ol",{"data-slot":"breadcrumb-list",className:vt("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",e),...r})}function J4({className:e,...r}){return c.jsx("li",{"data-slot":"breadcrumb-item",className:vt("inline-flex items-center gap-1.5",e),...r})}function W4({asChild:e,className:r,...s}){const o=e?Tg:"a";return c.jsx(o,{"data-slot":"breadcrumb-link",className:vt("hover:text-foreground transition-colors",r),...s})}function $he({className:e,...r}){return c.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:vt("text-foreground font-normal",e),...r})}function Nhe({children:e,className:r,...s}){return c.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:vt("[&>svg]:size-3.5",r),...s,children:e??c.jsx(qZ,{})})}const wT=768;function Dhe(){const[e,r]=T.useState(void 0);return T.useEffect(()=>{const s=window.matchMedia(`(max-width: ${wT-1}px)`),o=()=>{r(window.innerWidths.removeEventListener("change",o)},[]),!!e}function mt({className:e,type:r,...s}){return c.jsx("input",{type:r,"data-slot":"input",className:vt("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),...s})}function Phe({...e}){return c.jsx(LC,{"data-slot":"sheet",...e})}function Mhe({...e}){return c.jsx(FC,{"data-slot":"sheet-portal",...e})}function Ihe({className:e,...r}){return c.jsx(qC,{"data-slot":"sheet-overlay",className:vt("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),...r})}function zhe({className:e,children:r,side:s="right",...o}){return c.jsxs(Mhe,{children:[c.jsx(Ihe,{}),c.jsxs(BC,{"data-slot":"sheet-content",className:vt("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",s==="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",s==="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",s==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",s==="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),...o,children:[r,c.jsxs(pw,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[c.jsx(W_,{className:"size-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Lhe({className:e,...r}){return c.jsx("div",{"data-slot":"sheet-header",className:vt("flex flex-col gap-1.5 p-4",e),...r})}function Fhe({className:e,...r}){return c.jsx(g2,{"data-slot":"sheet-title",className:vt("text-foreground font-semibold",e),...r})}function qhe({className:e,...r}){return c.jsx(y2,{"data-slot":"sheet-description",className:vt("text-muted-foreground text-sm",e),...r})}const Bhe="sidebar_state",Uhe=3600*24*7,Khe="16rem",Vhe="18rem",Hhe="3rem",Ghe="b",t6=T.createContext(null);function Q2(){const e=T.useContext(t6);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function Xhe({defaultOpen:e=!0,open:r,onOpenChange:s,className:o,style:u,children:h,...m}){const g=Dhe(),[b,w]=T.useState(!1),[E,A]=T.useState(e),k=r??E,R=T.useCallback(H=>{const V=typeof H=="function"?H(k):H;s?s(V):A(V),document.cookie=`${Bhe}=${V}; path=/; max-age=${Uhe}`},[s,k]),M=T.useCallback(()=>g?w(H=>!H):R(H=>!H),[g,R,w]);T.useEffect(()=>{const H=V=>{V.key===Ghe&&(V.metaKey||V.ctrlKey)&&(V.preventDefault(),M())};return window.addEventListener("keydown",H),()=>window.removeEventListener("keydown",H)},[M]);const I=k?"expanded":"collapsed",F=T.useMemo(()=>({state:I,open:k,setOpen:R,isMobile:g,openMobile:b,setOpenMobile:w,toggleSidebar:M}),[I,k,R,g,b,w,M]);return c.jsx(t6.Provider,{value:F,children:c.jsx(cw,{delayDuration:0,children:c.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":Khe,"--sidebar-width-icon":Hhe,...u},className:vt("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",o),...m,children:h})})})}function Yhe({side:e="left",variant:r="sidebar",collapsible:s="offcanvas",className:o,children:u,...h}){const{isMobile:m,state:g,openMobile:b,setOpenMobile:w}=Q2();return s==="none"?c.jsx("div",{"data-slot":"sidebar",className:vt("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",o),...h,children:u}):m?c.jsx(Phe,{open:b,onOpenChange:w,...h,children:c.jsxs(zhe,{"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":Vhe},side:e,children:[c.jsxs(Lhe,{className:"sr-only",children:[c.jsx(Fhe,{children:"Sidebar"}),c.jsx(qhe,{children:"Displays the mobile sidebar."})]}),c.jsx("div",{className:"flex h-full w-full flex-col",children:u})]})}):c.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":g,"data-collapsible":g==="collapsed"?s:"","data-variant":r,"data-side":e,"data-slot":"sidebar",children:[c.jsx("div",{"data-slot":"sidebar-gap",className:vt("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",r==="floating"||r==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),c.jsx("div",{"data-slot":"sidebar-container",className:vt("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)]",r==="floating"||r==="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",o),...h,children:c.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:u})})]})}function Zhe({className:e,onClick:r,...s}){const{toggleSidebar:o}=Q2();return c.jsxs(Pe,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:vt("size-7",e),onClick:u=>{r?.(u),o()},...s,children:[c.jsx(NJ,{}),c.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function Jhe({className:e,...r}){return c.jsx("main",{"data-slot":"sidebar-inset",className:vt("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),...r})}function Whe({className:e,...r}){return c.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:vt("flex flex-col gap-2 p-2",e),...r})}function Qhe({className:e,...r}){return c.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:vt("flex flex-col gap-2 p-2",e),...r})}function epe({className:e,...r}){return c.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:vt("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...r})}function oj({className:e,...r}){return c.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:vt("relative flex w-full min-w-0 flex-col p-2",e),...r})}function lj({className:e,asChild:r=!1,...s}){const o=r?Tg:"div";return c.jsx(o,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:vt("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),...s})}function cj({className:e,...r}){return c.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:vt("w-full text-sm",e),...r})}function uj({className:e,...r}){return c.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:vt("flex w-full min-w-0 flex-col gap-1",e),...r})}function dj({className:e,...r}){return c.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:vt("group/menu-item relative",e),...r})}const tpe=e2("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 hj({asChild:e=!1,isActive:r=!1,variant:s="default",size:o="default",tooltip:u,className:h,...m}){const g=e?Tg:"button",{isMobile:b,state:w}=Q2(),E=c.jsx(g,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":o,"data-active":r,className:vt(tpe({variant:s,size:o}),h),...m});return u?(typeof u=="string"&&(u={children:u}),c.jsxs(Uj,{children:[c.jsx(Kj,{asChild:!0,children:E}),c.jsx(Vj,{side:"right",align:"center",hidden:w!=="collapsed"||b,...u})]})):E}const npe=()=>{const e=B_(),{data:r,isLoading:s}=phe(),o=T.useMemo(()=>{const h=e.pathname.split("/").filter(Boolean),m=[];let g="";for(const b of h)g+=`/${b}`,m.push({to:g,label:b});return m},[e.pathname]),u=T.useMemo(()=>{if(!r)return"U";const m=(r.display_name||r.primary_email||"").trim().split(/\s+/);return m.length>=2?(m[0][0]+m[1][0]).toUpperCase():m.length===1&&m[0]?m[0][0].toUpperCase():"U"},[r]);return c.jsxs("div",{className:"flex h-12 items-center gap-2 border-b px-3",children:[c.jsx(Zhe,{}),c.jsx("div",{className:"flex-1",children:c.jsx(The,{children:c.jsxs(_he,{children:[c.jsx(J4,{children:c.jsx(W4,{asChild:!0,children:c.jsx(PR,{to:"/",children:"Home"})})}),o.map((h,m)=>c.jsxs("span",{className:"flex items-center",children:[c.jsx(Nhe,{}),c.jsx(J4,{children:m===o.length-1?c.jsx($he,{className:"capitalize",children:h.label}):c.jsx(W4,{asChild:!0,children:c.jsx(PR,{to:h.to,className:"capitalize",children:h.label})})})]},h.to))]})})}),c.jsx(YF,{variant:"wide"}),c.jsx(Pe,{variant:"ghost",size:"sm",asChild:!0,children:c.jsx(PR,{to:"/me",children:s?"…":r?.display_name||"Profile"})}),c.jsx(khe,{className:"h-7 w-7",children:c.jsx(Rhe,{children:u})})]})};async function rpe(){const e=Xs.get();if(!e?.refresh_token){Xs.logout();return}try{const r={refresh_token:e.refresh_token};await Ete().logout({dtoLogoutRequest:r})}catch(r){console.warn("Logout API failed; clearing local state anyway",r)}finally{Xs.logout()}}function spe(){return{logout:T.useCallback(()=>rpe(),[])}}const ipe=()=>{const[e,r]=T.useState([]),{logout:s}=spe();return T.useEffect(()=>{let o=!0;return(async()=>{try{const h=((await wp.getMe()).organizations??[]).map(m=>({id:m.id,name:m.name??m.id}));if(!o)return;r(h),!rl.get()&&h.length>0&&rl.set(h[0].id)}catch{}})(),()=>{o=!1}},[]),c.jsxs(Xhe,{defaultOpen:!0,children:[c.jsxs(Yhe,{collapsible:"icon",variant:"floating",children:[c.jsx(Whe,{children:c.jsx("div",{className:"px-2 py-2",children:c.jsx(Doe,{orgs:e})})}),c.jsxs(epe,{children:[c.jsxs(oj,{children:[c.jsx(lj,{children:"Navigation"}),c.jsx(cj,{children:c.jsx(uj,{children:bie.map(o=>c.jsx(dj,{children:c.jsx(hj,{asChild:!0,tooltip:o.label,children:c.jsxs(BE,{to:o.to,className:({isActive:u})=>vt("flex items-center gap-2",u&&"text-primary"),children:[c.jsx(o.icon,{className:"h-4 w-4"}),c.jsx("span",{children:o.label})]})})},o.to))})})]}),c.jsxs(oj,{children:[c.jsx(lj,{children:"Organization"}),c.jsx(cj,{children:c.jsx(uj,{children:wie.map(o=>c.jsx(dj,{children:c.jsx(hj,{asChild:!0,tooltip:o.label,children:c.jsxs(BE,{to:o.to,className:({isActive:u})=>vt("flex items-center gap-2",u&&"text-primary"),children:[c.jsx(o.icon,{className:"h-4 w-4"}),c.jsx("span",{children:o.label})]})})},o.to))})})]}),c.jsxs(oj,{children:[c.jsx(lj,{children:"User"}),c.jsx(cj,{children:c.jsx(uj,{children:Sie.map(o=>c.jsx(dj,{children:c.jsx(hj,{asChild:!0,tooltip:o.label,children:c.jsxs(BE,{to:o.to,className:({isActive:u})=>vt("flex items-center gap-2",u&&"text-primary"),children:[c.jsx(o.icon,{className:"h-4 w-4"}),c.jsx("span",{children:o.label})]})})},o.to))})})]}),c.jsxs(oj,{children:[c.jsx(lj,{children:"Admin"}),c.jsx(cj,{children:c.jsx(uj,{children:Eie.map(o=>c.jsx(dj,{children:c.jsx(hj,{asChild:!0,tooltip:o.label,children:c.jsxs(BE,{to:o.to,target:o.target?o.target:"_self",className:({isActive:u})=>vt("flex items-center gap-2",u&&"text-primary"),children:[c.jsx(o.icon,{className:"h-4 w-4"}),c.jsx("span",{children:o.label})]})})},o.to))})})]}),c.jsx("div",{className:"mt-auto flex items-center justify-center p-3",children:c.jsx(YF,{})})]}),c.jsx(Qhe,{children:c.jsx("div",{className:"px-2 py-2",children:c.jsx(Pe,{variant:"ghost",size:"sm",className:"w-full",onClick:()=>{s()},children:"Sign out"})})})]}),c.jsxs(Jhe,{className:"flex min-h-screen flex-col",children:[c.jsx(npe,{}),c.jsx("main",{className:"p-4",children:c.jsx(nz,{})}),c.jsx(oie,{})]})]})},ape=()=>{const e=T.useSyncExternalStore(r=>Xs.subscribe(r),()=>Xs.get(),()=>Xs.get());return{tokens:e,authed:!!e?.access_token,isExpired:Xs.isExpired(),willExpireSoon:Xs.willExpireSoon()}},ope=()=>{const{authed:e}=ape(),r=B_();return e?c.jsx(nz,{}):c.jsx($Y,{to:`/login?to=${encodeURIComponent(r.pathname+r.search)}`,replace:!0})},pj=Ite(),kb={listActions:()=>ct(async()=>await pj.listActions()),createAction:e=>ct(async()=>await pj.createAction({dtoCreateActionRequest:e})),updateAction:(e,r)=>ct(async()=>await pj.updateAction({actionID:e,dtoUpdateActionRequest:r})),deleteAction:e=>ct(async()=>{await pj.deleteAction({actionID:e})})};var bw=e=>e.type==="checkbox",Cp=e=>e instanceof Date,ma=e=>e==null;const n6=e=>typeof e=="object";var vs=e=>!ma(e)&&!Array.isArray(e)&&n6(e)&&!Cp(e),r6=e=>vs(e)&&e.target?bw(e.target)?e.target.checked:e.target.value:e,lpe=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,s6=(e,r)=>e.has(lpe(r)),cpe=e=>{const r=e.constructor&&e.constructor.prototype;return vs(r)&&r.hasOwnProperty("isPrototypeOf")},e$=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function fs(e){if(e instanceof Date)return new Date(e);const r=typeof FileList<"u"&&e instanceof FileList;if(e$&&(e instanceof Blob||r))return e;const s=Array.isArray(e);if(!s&&!(vs(e)&&cpe(e)))return e;const o=s?[]:Object.create(Object.getPrototypeOf(e));for(const u in e)Object.prototype.hasOwnProperty.call(e,u)&&(o[u]=fs(e[u]));return o}var XC=e=>/^\w*$/.test(e),_r=e=>e===void 0,t$=e=>Array.isArray(e)?e.filter(Boolean):[],n$=e=>t$(e.replace(/["|']|\]/g,"").split(/\.|\[/)),jt=(e,r,s)=>{if(!r||!vs(e))return s;const o=(XC(r)?[r]:n$(r)).reduce((u,h)=>ma(u)?u:u[h],e);return _r(o)||o===e?_r(e[r])?s:e[r]:o},Pa=e=>typeof e=="boolean",Ki=e=>typeof e=="function",dr=(e,r,s)=>{let o=-1;const u=XC(r)?[r]:n$(r),h=u.length,m=h-1;for(;++oet.useContext(r$),upe=e=>{const{children:r,...s}=e;return et.createElement(r$.Provider,{value:s},r)};var i6=(e,r,s,o=!0)=>{const u={defaultValues:r._defaultValues};for(const h in e)Object.defineProperty(u,h,{get:()=>{const m=h;return r._proxyFormState[m]!==el.all&&(r._proxyFormState[m]=!o||el.all),s&&(s[m]=!0),e[m]}});return u};const s$=typeof window<"u"?et.useLayoutEffect:et.useEffect;function a6(e){const r=YC(),{control:s=r.control,disabled:o,name:u,exact:h}=e||{},[m,g]=et.useState(s._formState),b=et.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return s$(()=>s._subscribe({name:u,formState:b.current,exact:h,callback:w=>{!o&&g({...s._formState,...w})}}),[u,o,h]),et.useEffect(()=>{b.current.isValid&&s._setValid(!0)},[s]),et.useMemo(()=>i6(m,s,b.current,!1),[m,s])}var Ia=e=>typeof e=="string",S_=(e,r,s,o,u)=>Ia(e)?(o&&r.watch.add(e),jt(s,e,u)):Array.isArray(e)?e.map(h=>(o&&r.watch.add(h),jt(s,h))):(o&&(r.watchAll=!0),s),E_=e=>ma(e)||!n6(e);function tl(e,r,s=new WeakSet){if(E_(e)||E_(r))return Object.is(e,r);if(Cp(e)&&Cp(r))return Object.is(e.getTime(),r.getTime());const o=Object.keys(e),u=Object.keys(r);if(o.length!==u.length)return!1;if(s.has(e)||s.has(r))return!0;s.add(e),s.add(r);for(const h of o){const m=e[h];if(!u.includes(h))return!1;if(h!=="ref"){const g=r[h];if(Cp(m)&&Cp(g)||vs(m)&&vs(g)||Array.isArray(m)&&Array.isArray(g)?!tl(m,g,s):!Object.is(m,g))return!1}}return!0}function pg(e){const r=YC(),{control:s=r.control,name:o,defaultValue:u,disabled:h,exact:m,compute:g}=e||{},b=et.useRef(u),w=et.useRef(g),E=et.useRef(void 0),A=et.useRef(s),k=et.useRef(o);w.current=g;const[R,M]=et.useState(()=>{const z=s._getWatch(o,b.current);return w.current?w.current(z):z}),I=et.useCallback(z=>{const W=S_(o,s._names,z||s._formValues,!1,b.current);return w.current?w.current(W):W},[s._formValues,s._names,o]),F=et.useCallback(z=>{if(!h){const W=S_(o,s._names,z||s._formValues,!1,b.current);if(w.current){const ae=w.current(W);tl(ae,E.current)||(M(ae),E.current=ae)}else M(W)}},[s._formValues,s._names,h,o]);s$(()=>((A.current!==s||!tl(k.current,o))&&(A.current=s,k.current=o,F()),s._subscribe({name:o,formState:{values:!0},exact:m,callback:z=>{F(z.values)}})),[s,m,o,F]),et.useEffect(()=>s._removeUnmounted());const H=A.current!==s,V=k.current,K=et.useMemo(()=>{if(h)return null;const z=!H&&!tl(V,o);return H||z?I():null},[h,H,o,V,I]);return K!==null?K:R}function dpe(e){const r=YC(),{name:s,disabled:o,control:u=r.control,shouldUnregister:h,defaultValue:m,exact:g=!0}=e,b=s6(u._names.array,s),w=et.useMemo(()=>jt(u._formValues,s,jt(u._defaultValues,s,m)),[u,s,m]),E=pg({control:u,name:s,defaultValue:w,exact:g}),A=a6({control:u,name:s,exact:g}),k=et.useRef(e),R=et.useRef(void 0),M=et.useRef(u.register(s,{...e.rules,value:E,...Pa(e.disabled)?{disabled:e.disabled}:{}}));k.current=e;const I=et.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!jt(A.errors,s)},isDirty:{enumerable:!0,get:()=>!!jt(A.dirtyFields,s)},isTouched:{enumerable:!0,get:()=>!!jt(A.touchedFields,s)},isValidating:{enumerable:!0,get:()=>!!jt(A.validatingFields,s)},error:{enumerable:!0,get:()=>jt(A.errors,s)}}),[A,s]),F=et.useCallback(z=>M.current.onChange({target:{value:r6(z),name:s},type:nC.CHANGE}),[s]),H=et.useCallback(()=>M.current.onBlur({target:{value:jt(u._formValues,s),name:s},type:nC.BLUR}),[s,u._formValues]),V=et.useCallback(z=>{const W=jt(u._fields,s);W&&W._f&&z&&(W._f.ref={focus:()=>Ki(z.focus)&&z.focus(),select:()=>Ki(z.select)&&z.select(),setCustomValidity:ae=>Ki(z.setCustomValidity)&&z.setCustomValidity(ae),reportValidity:()=>Ki(z.reportValidity)&&z.reportValidity()})},[u._fields,s]),K=et.useMemo(()=>({name:s,value:E,...Pa(o)||A.disabled?{disabled:A.disabled||o}:{},onChange:F,onBlur:H,ref:V}),[s,o,A.disabled,F,H,V,E]);return et.useEffect(()=>{const z=u._options.shouldUnregister||h,W=R.current;W&&W!==s&&!b&&u.unregister(W),u.register(s,{...k.current.rules,...Pa(k.current.disabled)?{disabled:k.current.disabled}:{}});const ae=(Q,te)=>{const de=jt(u._fields,Q);de&&de._f&&(de._f.mount=te)};if(ae(s,!0),z){const Q=fs(jt(u._options.defaultValues,s,k.current.defaultValue));dr(u._defaultValues,s,Q),_r(jt(u._formValues,s))&&dr(u._formValues,s,Q)}return!b&&u.register(s),R.current=s,()=>{(b?z&&!u._state.action:z)?u.unregister(s):ae(s,!1)}},[s,u,b,h]),et.useEffect(()=>{u._setDisabledField({disabled:o,name:s})},[o,s,u]),et.useMemo(()=>({field:K,formState:A,fieldState:I}),[K,A,I])}const Zo=e=>e.render(dpe(e));var i$=(e,r,s,o,u)=>r?{...s[e],types:{...s[e]&&s[e].types?s[e].types:{},[o]:u||!0}}:{},Bb=e=>Array.isArray(e)?e:[e],Q4=()=>{let e=[];return{get observers(){return e},next:u=>{for(const h of e)h.next&&h.next(u)},subscribe:u=>(e.push(u),{unsubscribe:()=>{e=e.filter(h=>h!==u)}}),unsubscribe:()=>{e=[]}}};function o6(e,r){const s={};for(const o in e)if(e.hasOwnProperty(o)){const u=e[o],h=r[o];if(u&&vs(u)&&h){const m=o6(u,h);vs(m)&&(s[o]=m)}else e[o]&&(s[o]=h)}return s}var Bi=e=>vs(e)&&!Object.keys(e).length,a$=e=>e.type==="file",rC=e=>{if(!e$)return!1;const r=e?e.ownerDocument:0;return e instanceof(r&&r.defaultView?r.defaultView.HTMLElement:HTMLElement)},l6=e=>e.type==="select-multiple",o$=e=>e.type==="radio",hpe=e=>o$(e)||bw(e),ST=e=>rC(e)&&e.isConnected;function ppe(e,r){const s=r.slice(0,-1).length;let o=0;for(;o{for(const r in e)if(Ki(e[r]))return!0;return!1};function c6(e){return Array.isArray(e)||vs(e)&&!mpe(e)}function j_(e,r={}){for(const s in e){const o=e[s];c6(o)?(r[s]=Array.isArray(o)?[]:{},j_(o,r[s])):_r(o)||(r[s]=!0)}return r}function tg(e,r,s){s||(s=j_(r));for(const o in e){const u=e[o];if(c6(u))_r(r)||E_(s[o])?s[o]=j_(u,Array.isArray(u)?[]:{}):tg(u,ma(r)?{}:r[o],s[o]);else{const h=r[o];s[o]=!tl(u,h)}}return s}const e3={value:!1,isValid:!1},t3={value:!0,isValid:!0};var u6=e=>{if(Array.isArray(e)){if(e.length>1){const r=e.filter(s=>s&&s.checked&&!s.disabled).map(s=>s.value);return{value:r,isValid:!!r.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!_r(e[0].attributes.value)?_r(e[0].value)||e[0].value===""?t3:{value:e[0].value,isValid:!0}:t3:e3}return e3},d6=(e,{valueAsNumber:r,valueAsDate:s,setValueAs:o})=>_r(e)?e:r?e===""?NaN:e&&+e:s&&Ia(e)?new Date(e):o?o(e):e;const n3={isValid:!1,value:null};var h6=e=>Array.isArray(e)?e.reduce((r,s)=>s&&s.checked&&!s.disabled?{isValid:!0,value:s.value}:r,n3):n3;function r3(e){const r=e.ref;return a$(r)?r.files:o$(r)?h6(e.refs).value:l6(r)?[...r.selectedOptions].map(({value:s})=>s):bw(r)?u6(e.refs).value:d6(_r(r.value)?e.ref.value:r.value,e)}var gpe=(e,r,s,o)=>{const u={};for(const h of e){const m=jt(r,h);m&&dr(u,h,m._f)}return{criteriaMode:s,names:[...e],fields:u,shouldUseNativeValidation:o}},sC=e=>e instanceof RegExp,hb=e=>_r(e)?e:sC(e)?e.source:vs(e)?sC(e.value)?e.value.source:e.value:e,s3=e=>({isOnSubmit:!e||e===el.onSubmit,isOnBlur:e===el.onBlur,isOnChange:e===el.onChange,isOnAll:e===el.all,isOnTouch:e===el.onTouched});const i3="AsyncFunction";var ype=e=>!!e&&!!e.validate&&!!(Ki(e.validate)&&e.validate.constructor.name===i3||vs(e.validate)&&Object.values(e.validate).find(r=>r.constructor.name===i3)),vpe=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),a3=(e,r,s)=>!s&&(r.watchAll||r.watch.has(e)||[...r.watch].some(o=>e.startsWith(o)&&/^\.\w+/.test(e.slice(o.length))));const Ub=(e,r,s,o)=>{for(const u of s||Object.keys(e)){const h=jt(e,u);if(h){const{_f:m,...g}=h;if(m){if(m.refs&&m.refs[0]&&r(m.refs[0],u)&&!o)return!0;if(m.ref&&r(m.ref,m.name)&&!o)return!0;if(Ub(g,r))break}else if(vs(g)&&Ub(g,r))break}}};function o3(e,r,s){const o=jt(e,s);if(o||XC(s))return{error:o,name:s};const u=s.split(".");for(;u.length;){const h=u.join("."),m=jt(r,h),g=jt(e,h);if(m&&!Array.isArray(m)&&s!==h)return{name:s};if(g&&g.type)return{name:h,error:g};if(g&&g.root&&g.root.type)return{name:`${h}.root`,error:g.root};u.pop()}return{name:s}}var xpe=(e,r,s,o)=>{s(e);const{name:u,...h}=e;return Bi(h)||Object.keys(h).length>=Object.keys(r).length||Object.keys(h).find(m=>r[m]===(!o||el.all))},bpe=(e,r,s)=>!e||!r||e===r||Bb(e).some(o=>o&&(s?o===r:o.startsWith(r)||r.startsWith(o))),wpe=(e,r,s,o,u)=>u.isOnAll?!1:!s&&u.isOnTouch?!(r||e):(s?o.isOnBlur:u.isOnBlur)?!e:(s?o.isOnChange:u.isOnChange)?e:!0,Spe=(e,r)=>!t$(jt(e,r)).length&&ms(e,r),Epe=(e,r,s)=>{const o=Bb(jt(e,s));return dr(o,"root",r[s]),dr(e,s,o),e};function l3(e,r,s="validate"){if(Ia(e)||Array.isArray(e)&&e.every(Ia)||Pa(e)&&!e)return{type:s,message:Ia(e)?e:"",ref:r}}var Jm=e=>vs(e)&&!sC(e)?e:{value:e,message:""},c3=async(e,r,s,o,u,h)=>{const{ref:m,refs:g,required:b,maxLength:w,minLength:E,min:A,max:k,pattern:R,validate:M,name:I,valueAsNumber:F,mount:H}=e._f,V=jt(s,I);if(!H||r.has(I))return{};const K=g?g[0]:m,z=ie=>{u&&K.reportValidity&&(K.setCustomValidity(Pa(ie)?"":ie||""),K.reportValidity())},W={},ae=o$(m),Q=bw(m),te=ae||Q,de=(F||a$(m))&&_r(m.value)&&_r(V)||rC(m)&&m.value===""||V===""||Array.isArray(V)&&!V.length,je=i$.bind(null,I,o,W),we=(ie,Se,Ae,He=pu.maxLength,ue=pu.minLength)=>{const ne=ie?Se:Ae;W[I]={type:ie?He:ue,message:ne,ref:m,...je(ie?He:ue,ne)}};if(h?!Array.isArray(V)||!V.length:b&&(!te&&(de||ma(V))||Pa(V)&&!V||Q&&!u6(g).isValid||ae&&!h6(g).isValid)){const{value:ie,message:Se}=Ia(b)?{value:!!b,message:b}:Jm(b);if(ie&&(W[I]={type:pu.required,message:Se,ref:K,...je(pu.required,Se)},!o))return z(Se),W}if(!de&&(!ma(A)||!ma(k))){let ie,Se;const Ae=Jm(k),He=Jm(A);if(!ma(V)&&!isNaN(V)){const ue=m.valueAsNumber||V&&+V;ma(Ae.value)||(ie=ue>Ae.value),ma(He.value)||(Se=uenew Date(new Date().toDateString()+" "+me),ce=m.type=="time",$e=m.type=="week";Ia(Ae.value)&&V&&(ie=ce?ne(V)>ne(Ae.value):$e?V>Ae.value:ue>new Date(Ae.value)),Ia(He.value)&&V&&(Se=ce?ne(V)+ie.value,He=!ma(Se.value)&&V.length<+Se.value;if((Ae||He)&&(we(Ae,ie.message,Se.message),!o))return z(W[I].message),W}if(R&&!de&&Ia(V)){const{value:ie,message:Se}=Jm(R);if(sC(ie)&&!V.match(ie)&&(W[I]={type:pu.pattern,message:Se,ref:m,...je(pu.pattern,Se)},!o))return z(Se),W}if(M){if(Ki(M)){const ie=await M(V,s),Se=l3(ie,K);if(Se&&(W[I]={...Se,...je(pu.validate,Se.message)},!o))return z(Se.message),W}else if(vs(M)){let ie={};for(const Se in M){if(!Bi(ie)&&!o)break;const Ae=l3(await M[Se](V,s),K,Se);Ae&&(ie={...Ae,...je(Se,Ae.message)},z(Ae.message),o&&(W[I]=ie))}if(!Bi(ie)&&(W[I]={ref:K,...ie},!o))return W}}return z(!0),W};const jpe={mode:el.onSubmit,reValidateMode:el.onChange,shouldFocusError:!0};function Cpe(e={}){let r={...jpe,...e},s={submitCount:0,isDirty:!1,isReady:!1,isLoading:Ki(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1},o={},u=vs(r.defaultValues)||vs(r.values)?fs(r.defaultValues||r.values)||{}:{},h=r.shouldUnregister?{}:fs(u),m={action:!1,mount:!1,watch:!1,keepIsValid:!1},g={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},b,w=0;const E={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},A={...E};let k={...A};const R={array:Q4(),state:Q4()},M=r.criteriaMode===el.all,I=ge=>Me=>{clearTimeout(w),w=setTimeout(ge,Me)},F=async ge=>{if(!m.keepIsValid&&!r.disabled&&(A.isValid||k.isValid||ge)){let Me;r.resolver?(Me=Bi((await te()).errors),H()):Me=await je(o,!0),Me!==s.isValid&&R.state.next({isValid:Me})}},H=(ge,Me)=>{!r.disabled&&(A.isValidating||A.validatingFields||k.isValidating||k.validatingFields)&&((ge||Array.from(g.mount)).forEach(_=>{_&&(Me?dr(s.validatingFields,_,Me):ms(s.validatingFields,_))}),R.state.next({validatingFields:s.validatingFields,isValidating:!Bi(s.validatingFields)}))},V=(ge,Me=[],_,q,X=!0,oe=!0)=>{if(q&&_&&!r.disabled){if(m.action=!0,oe&&Array.isArray(jt(o,ge))){const ve=_(jt(o,ge),q.argA,q.argB);X&&dr(o,ge,ve)}if(oe&&Array.isArray(jt(s.errors,ge))){const ve=_(jt(s.errors,ge),q.argA,q.argB);X&&dr(s.errors,ge,ve),Spe(s.errors,ge)}if((A.touchedFields||k.touchedFields)&&oe&&Array.isArray(jt(s.touchedFields,ge))){const ve=_(jt(s.touchedFields,ge),q.argA,q.argB);X&&dr(s.touchedFields,ge,ve)}(A.dirtyFields||k.dirtyFields)&&(s.dirtyFields=tg(u,h)),R.state.next({name:ge,isDirty:ie(ge,Me),dirtyFields:s.dirtyFields,errors:s.errors,isValid:s.isValid})}else dr(h,ge,Me)},K=(ge,Me)=>{dr(s.errors,ge,Me),R.state.next({errors:s.errors})},z=ge=>{s.errors=ge,R.state.next({errors:s.errors,isValid:!1})},W=(ge,Me,_,q)=>{const X=jt(o,ge);if(X){const oe=jt(h,ge,_r(_)?jt(u,ge):_);_r(oe)||q&&q.defaultChecked||Me?dr(h,ge,Me?oe:r3(X._f)):He(ge,oe),m.mount&&!m.action&&F()}},ae=(ge,Me,_,q,X)=>{let oe=!1,ve=!1;const Re={name:ge};if(!r.disabled){if(!_||q){(A.isDirty||k.isDirty)&&(ve=s.isDirty,s.isDirty=Re.isDirty=ie(),oe=ve!==Re.isDirty);const Je=tl(jt(u,ge),Me);ve=!!jt(s.dirtyFields,ge),Je?ms(s.dirtyFields,ge):dr(s.dirtyFields,ge,!0),Re.dirtyFields=s.dirtyFields,oe=oe||(A.dirtyFields||k.dirtyFields)&&ve!==!Je}if(_){const Je=jt(s.touchedFields,ge);Je||(dr(s.touchedFields,ge,_),Re.touchedFields=s.touchedFields,oe=oe||(A.touchedFields||k.touchedFields)&&Je!==_)}oe&&X&&R.state.next(Re)}return oe?Re:{}},Q=(ge,Me,_,q)=>{const X=jt(s.errors,ge),oe=(A.isValid||k.isValid)&&Pa(Me)&&s.isValid!==Me;if(r.delayError&&_?(b=I(()=>K(ge,_)),b(r.delayError)):(clearTimeout(w),b=null,_?dr(s.errors,ge,_):ms(s.errors,ge)),(_?!tl(X,_):X)||!Bi(q)||oe){const ve={...q,...oe&&Pa(Me)?{isValid:Me}:{},errors:s.errors,name:ge};s={...s,...ve},R.state.next(ve)}},te=async ge=>(H(ge,!0),await r.resolver(h,r.context,gpe(ge||g.mount,o,r.criteriaMode,r.shouldUseNativeValidation))),de=async ge=>{const{errors:Me}=await te(ge);if(H(ge),ge)for(const _ of ge){const q=jt(Me,_);q?dr(s.errors,_,q):ms(s.errors,_)}else s.errors=Me;return Me},je=async(ge,Me,_={valid:!0})=>{for(const q in ge){const X=ge[q];if(X){const{_f:oe,...ve}=X;if(oe){const Re=g.array.has(oe.name),Je=X._f&&ype(X._f);Je&&A.validatingFields&&H([oe.name],!0);const Tt=await c3(X,g.disabled,h,M,r.shouldUseNativeValidation&&!Me,Re);if(Je&&A.validatingFields&&H([oe.name]),Tt[oe.name]&&(_.valid=!1,Me||e.shouldUseNativeValidation))break;!Me&&(jt(Tt,oe.name)?Re?Epe(s.errors,Tt,oe.name):dr(s.errors,oe.name,Tt[oe.name]):ms(s.errors,oe.name))}!Bi(ve)&&await je(ve,Me,_)}}return _.valid},we=()=>{for(const ge of g.unMount){const Me=jt(o,ge);Me&&(Me._f.refs?Me._f.refs.every(_=>!ST(_)):!ST(Me._f.ref))&&at(ge)}g.unMount=new Set},ie=(ge,Me)=>!r.disabled&&(ge&&Me&&dr(h,ge,Me),!tl(Xe(),u)),Se=(ge,Me,_)=>S_(ge,g,{...m.mount?h:_r(Me)?u:Ia(ge)?{[ge]:Me}:Me},_,Me),Ae=ge=>t$(jt(m.mount?h:u,ge,r.shouldUnregister?jt(u,ge,[]):[])),He=(ge,Me,_={})=>{const q=jt(o,ge);let X=Me;if(q){const oe=q._f;oe&&(!oe.disabled&&dr(h,ge,d6(Me,oe)),X=rC(oe.ref)&&ma(Me)?"":Me,l6(oe.ref)?[...oe.ref.options].forEach(ve=>ve.selected=X.includes(ve.value)):oe.refs?bw(oe.ref)?oe.refs.forEach(ve=>{(!ve.defaultChecked||!ve.disabled)&&(Array.isArray(X)?ve.checked=!!X.find(Re=>Re===ve.value):ve.checked=X===ve.value||!!X)}):oe.refs.forEach(ve=>ve.checked=ve.value===X):a$(oe.ref)?oe.ref.value="":(oe.ref.value=X,oe.ref.type||R.state.next({name:ge,values:fs(h)})))}(_.shouldDirty||_.shouldTouch)&&ae(ge,X,_.shouldTouch,_.shouldDirty,!0),_.shouldValidate&&me(ge)},ue=(ge,Me,_)=>{for(const q in Me){if(!Me.hasOwnProperty(q))return;const X=Me[q],oe=ge+"."+q,ve=jt(o,oe);(g.array.has(ge)||vs(X)||ve&&!ve._f)&&!Cp(X)?ue(oe,X,_):He(oe,X,_)}},ne=(ge,Me,_={})=>{const q=jt(o,ge),X=g.array.has(ge),oe=fs(Me);dr(h,ge,oe),X?(R.array.next({name:ge,values:fs(h)}),(A.isDirty||A.dirtyFields||k.isDirty||k.dirtyFields)&&_.shouldDirty&&R.state.next({name:ge,dirtyFields:tg(u,h),isDirty:ie(ge,oe)})):q&&!q._f&&!ma(oe)?ue(ge,oe,_):He(ge,oe,_),a3(ge,g)?R.state.next({...s,name:ge,values:fs(h)}):R.state.next({name:m.mount?ge:void 0,values:fs(h)})},ce=async ge=>{m.mount=!0;const Me=ge.target;let _=Me.name,q=!0;const X=jt(o,_),oe=Je=>{q=Number.isNaN(Je)||Cp(Je)&&isNaN(Je.getTime())||tl(Je,jt(h,_,Je))},ve=s3(r.mode),Re=s3(r.reValidateMode);if(X){let Je,Tt;const fe=Me.type?r3(X._f):r6(ge),Ut=ge.type===nC.BLUR||ge.type===nC.FOCUS_OUT,nn=!vpe(X._f)&&!r.resolver&&!jt(s.errors,_)&&!X._f.deps||wpe(Ut,jt(s.touchedFields,_),s.isSubmitted,Re,ve),Gt=a3(_,g,Ut);dr(h,_,fe),Ut?(!Me||!Me.readOnly)&&(X._f.onBlur&&X._f.onBlur(ge),b&&b(0)):X._f.onChange&&X._f.onChange(ge);const ss=ae(_,fe,Ut),is=!Bi(ss)||Gt;if(!Ut&&R.state.next({name:_,type:ge.type,values:fs(h)}),nn)return(A.isValid||k.isValid)&&(r.mode==="onBlur"?Ut&&F():Ut||F()),is&&R.state.next({name:_,...Gt?{}:ss});if(!Ut&&Gt&&R.state.next({...s}),r.resolver){const{errors:Yi}=await te([_]);if(H([_]),oe(fe),q){const dl=o3(s.errors,o,_),ki=o3(Yi,o,dl.name||_);Je=ki.error,_=ki.name,Tt=Bi(Yi)}}else H([_],!0),Je=(await c3(X,g.disabled,h,M,r.shouldUseNativeValidation))[_],H([_]),oe(fe),q&&(Je?Tt=!1:(A.isValid||k.isValid)&&(Tt=await je(o,!0)));q&&(X._f.deps&&(!Array.isArray(X._f.deps)||X._f.deps.length>0)&&me(X._f.deps),Q(_,Tt,Je,ss))}},$e=(ge,Me)=>{if(jt(s.errors,Me)&&ge.focus)return ge.focus(),1},me=async(ge,Me={})=>{let _,q;const X=Bb(ge);if(r.resolver){const oe=await de(_r(ge)?ge:X);_=Bi(oe),q=ge?!X.some(ve=>jt(oe,ve)):_}else ge?(q=(await Promise.all(X.map(async oe=>{const ve=jt(o,oe);return await je(ve&&ve._f?{[oe]:ve}:ve)}))).every(Boolean),!(!q&&!s.isValid)&&F()):q=_=await je(o);return R.state.next({...!Ia(ge)||(A.isValid||k.isValid)&&_!==s.isValid?{}:{name:ge},...r.resolver||!ge?{isValid:_}:{},errors:s.errors}),Me.shouldFocus&&!q&&Ub(o,$e,ge?X:g.mount),q},Xe=(ge,Me)=>{let _={...m.mount?h:u};return Me&&(_=o6(Me.dirtyFields?s.dirtyFields:s.touchedFields,_)),_r(ge)?_:Ia(ge)?jt(_,ge):ge.map(q=>jt(_,q))},Oe=(ge,Me)=>({invalid:!!jt((Me||s).errors,ge),isDirty:!!jt((Me||s).dirtyFields,ge),error:jt((Me||s).errors,ge),isValidating:!!jt(s.validatingFields,ge),isTouched:!!jt((Me||s).touchedFields,ge)}),Te=ge=>{ge&&Bb(ge).forEach(Me=>ms(s.errors,Me)),R.state.next({errors:ge?s.errors:{}})},Ke=(ge,Me,_)=>{const q=(jt(o,ge,{_f:{}})._f||{}).ref,X=jt(s.errors,ge)||{},{ref:oe,message:ve,type:Re,...Je}=X;dr(s.errors,ge,{...Je,...Me,ref:q}),R.state.next({name:ge,errors:s.errors,isValid:!1}),_&&_.shouldFocus&&q&&q.focus&&q.focus()},se=(ge,Me)=>Ki(ge)?R.state.subscribe({next:_=>"values"in _&&ge(Se(void 0,Me),_)}):Se(ge,Me,!0),Ne=ge=>R.state.subscribe({next:Me=>{bpe(ge.name,Me.name,ge.exact)&&xpe(Me,ge.formState||A,On,ge.reRenderRoot)&&ge.callback({values:{...h},...s,...Me,defaultValues:u})}}).unsubscribe,Fe=ge=>(m.mount=!0,k={...k,...ge.formState},Ne({...ge,formState:{...E,...ge.formState}})),at=(ge,Me={})=>{for(const _ of ge?Bb(ge):g.mount)g.mount.delete(_),g.array.delete(_),Me.keepValue||(ms(o,_),ms(h,_)),!Me.keepError&&ms(s.errors,_),!Me.keepDirty&&ms(s.dirtyFields,_),!Me.keepTouched&&ms(s.touchedFields,_),!Me.keepIsValidating&&ms(s.validatingFields,_),!r.shouldUnregister&&!Me.keepDefaultValue&&ms(u,_);R.state.next({values:fs(h)}),R.state.next({...s,...Me.keepDirty?{isDirty:ie()}:{}}),!Me.keepIsValid&&F()},gt=({disabled:ge,name:Me})=>{(Pa(ge)&&m.mount||ge||g.disabled.has(Me))&&(ge?g.disabled.add(Me):g.disabled.delete(Me))},Ot=(ge,Me={})=>{let _=jt(o,ge);const q=Pa(Me.disabled)||Pa(r.disabled);return dr(o,ge,{..._||{},_f:{..._&&_._f?_._f:{ref:{name:ge}},name:ge,mount:!0,...Me}}),g.mount.add(ge),_?gt({disabled:Pa(Me.disabled)?Me.disabled:r.disabled,name:ge}):W(ge,!0,Me.value),{...q?{disabled:Me.disabled||r.disabled}:{},...r.progressive?{required:!!Me.required,min:hb(Me.min),max:hb(Me.max),minLength:hb(Me.minLength),maxLength:hb(Me.maxLength),pattern:hb(Me.pattern)}:{},name:ge,onChange:ce,onBlur:ce,ref:X=>{if(X){Ot(ge,Me),_=jt(o,ge);const oe=_r(X.value)&&X.querySelectorAll&&X.querySelectorAll("input,select,textarea")[0]||X,ve=hpe(oe),Re=_._f.refs||[];if(ve?Re.find(Je=>Je===oe):oe===_._f.ref)return;dr(o,ge,{_f:{..._._f,...ve?{refs:[...Re.filter(ST),oe,...Array.isArray(jt(u,ge))?[{}]:[]],ref:{type:oe.type,name:ge}}:{ref:oe}}}),W(ge,!1,void 0,oe)}else _=jt(o,ge,{}),_._f&&(_._f.mount=!1),(r.shouldUnregister||Me.shouldUnregister)&&!(s6(g.array,ge)&&m.action)&&g.unMount.add(ge)}}},Lt=()=>r.shouldFocusError&&Ub(o,$e,g.mount),Rt=ge=>{Pa(ge)&&(R.state.next({disabled:ge}),Ub(o,(Me,_)=>{const q=jt(o,_);q&&(Me.disabled=q._f.disabled||ge,Array.isArray(q._f.refs)&&q._f.refs.forEach(X=>{X.disabled=q._f.disabled||ge}))},0,!1))},Ft=(ge,Me)=>async _=>{let q;_&&(_.preventDefault&&_.preventDefault(),_.persist&&_.persist());let X=fs(h);if(R.state.next({isSubmitting:!0}),r.resolver){const{errors:oe,values:ve}=await te();H(),s.errors=oe,X=fs(ve)}else await je(o);if(g.disabled.size)for(const oe of g.disabled)ms(X,oe);if(ms(s.errors,"root"),Bi(s.errors)){R.state.next({errors:{}});try{await ge(X,_)}catch(oe){q=oe}}else Me&&await Me({...s.errors},_),Lt(),setTimeout(Lt);if(R.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Bi(s.errors)&&!q,submitCount:s.submitCount+1,errors:s.errors}),q)throw q},qe=(ge,Me={})=>{jt(o,ge)&&(_r(Me.defaultValue)?ne(ge,fs(jt(u,ge))):(ne(ge,Me.defaultValue),dr(u,ge,fs(Me.defaultValue))),Me.keepTouched||ms(s.touchedFields,ge),Me.keepDirty||(ms(s.dirtyFields,ge),s.isDirty=Me.defaultValue?ie(ge,fs(jt(u,ge))):ie()),Me.keepError||(ms(s.errors,ge),A.isValid&&F()),R.state.next({...s}))},Bt=(ge,Me={})=>{const _=ge?fs(ge):u,q=fs(_),X=Bi(ge),oe=X?u:q;if(Me.keepDefaultValues||(u=_),!Me.keepValues){if(Me.keepDirtyValues){const ve=new Set([...g.mount,...Object.keys(tg(u,h))]);for(const Re of Array.from(ve)){const Je=jt(s.dirtyFields,Re),Tt=jt(h,Re),fe=jt(oe,Re);Je&&!_r(Tt)?dr(oe,Re,Tt):!Je&&!_r(fe)&&ne(Re,fe)}}else{if(e$&&_r(ge))for(const ve of g.mount){const Re=jt(o,ve);if(Re&&Re._f){const Je=Array.isArray(Re._f.refs)?Re._f.refs[0]:Re._f.ref;if(rC(Je)){const Tt=Je.closest("form");if(Tt){Tt.reset();break}}}}if(Me.keepFieldsRef)for(const ve of g.mount)ne(ve,jt(oe,ve));else o={}}h=r.shouldUnregister?Me.keepDefaultValues?fs(u):{}:fs(oe),R.array.next({values:{...oe}}),R.state.next({values:{...oe}})}g={mount:Me.keepDirtyValues?g.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},m.mount=!A.isValid||!!Me.keepIsValid||!!Me.keepDirtyValues||!r.shouldUnregister&&!Bi(oe),m.watch=!!r.shouldUnregister,m.keepIsValid=!!Me.keepIsValid,m.action=!1,Me.keepErrors||(s.errors={}),R.state.next({submitCount:Me.keepSubmitCount?s.submitCount:0,isDirty:X?!1:Me.keepDirty?s.isDirty:!!(Me.keepDefaultValues&&!tl(ge,u)),isSubmitted:Me.keepIsSubmitted?s.isSubmitted:!1,dirtyFields:X?{}:Me.keepDirtyValues?Me.keepDefaultValues&&h?tg(u,h):s.dirtyFields:Me.keepDefaultValues&&ge?tg(u,ge):Me.keepDirty?s.dirtyFields:{},touchedFields:Me.keepTouched?s.touchedFields:{},errors:Me.keepErrors?s.errors:{},isSubmitSuccessful:Me.keepIsSubmitSuccessful?s.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:u})},kt=(ge,Me)=>Bt(Ki(ge)?ge(h):ge,{...r.resetOptions,...Me}),G=(ge,Me={})=>{const _=jt(o,ge),q=_&&_._f;if(q){const X=q.refs?q.refs[0]:q.ref;X.focus&&setTimeout(()=>{X.focus(),Me.shouldSelect&&Ki(X.select)&&X.select()})}},On=ge=>{s={...s,...ge}},Oi={control:{register:Ot,unregister:at,getFieldState:Oe,handleSubmit:Ft,setError:Ke,_subscribe:Ne,_runSchema:te,_updateIsValidating:H,_focusError:Lt,_getWatch:Se,_getDirty:ie,_setValid:F,_setFieldArray:V,_setDisabledField:gt,_setErrors:z,_getFieldArray:Ae,_reset:Bt,_resetDefaultValues:()=>Ki(r.defaultValues)&&r.defaultValues().then(ge=>{kt(ge,r.resetOptions),R.state.next({isLoading:!1})}),_removeUnmounted:we,_disableForm:Rt,_subjects:R,_proxyFormState:A,get _fields(){return o},get _formValues(){return h},get _state(){return m},set _state(ge){m=ge},get _defaultValues(){return u},get _names(){return g},set _names(ge){g=ge},get _formState(){return s},get _options(){return r},set _options(ge){r={...r,...ge}}},subscribe:Fe,trigger:me,register:Ot,handleSubmit:Ft,watch:se,setValue:ne,getValues:Xe,reset:kt,resetField:qe,clearErrors:Te,unregister:at,setError:Ke,setFocus:G,getFieldState:Oe};return{...Oi,formControl:Oi}}function hr(e={}){const r=et.useRef(void 0),s=et.useRef(void 0),[o,u]=et.useState({isDirty:!1,isValidating:!1,isLoading:Ki(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:Ki(e.defaultValues)?void 0:e.defaultValues});if(!r.current)if(e.formControl)r.current={...e.formControl,formState:o},e.defaultValues&&!Ki(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:m,...g}=Cpe(e);r.current={...g,formState:o}}const h=r.current.control;return h._options=e,s$(()=>{const m=h._subscribe({formState:h._proxyFormState,callback:()=>u({...h._formState}),reRenderRoot:!0});return u(g=>({...g,isReady:!0})),h._formState.isReady=!0,m},[h]),et.useEffect(()=>h._disableForm(e.disabled),[h,e.disabled]),et.useEffect(()=>{e.mode&&(h._options.mode=e.mode),e.reValidateMode&&(h._options.reValidateMode=e.reValidateMode)},[h,e.mode,e.reValidateMode]),et.useEffect(()=>{e.errors&&(h._setErrors(e.errors),h._focusError())},[h,e.errors]),et.useEffect(()=>{e.shouldUnregister&&h._subjects.state.next({values:h._getWatch()})},[h,e.shouldUnregister]),et.useEffect(()=>{if(h._proxyFormState.isDirty){const m=h._getDirty();m!==o.isDirty&&h._subjects.state.next({isDirty:m})}},[h,o.isDirty]),et.useEffect(()=>{var m;e.values&&!tl(e.values,s.current)?(h._reset(e.values,{keepFieldsRef:!0,...h._options.resetOptions}),!((m=h._options.resetOptions)===null||m===void 0)&&m.keepIsValid||h._setValid(),s.current=e.values,u(g=>({...g}))):h._resetDefaultValues()},[h,e.values]),et.useEffect(()=>{h._state.mount||(h._setValid(),h._state.mount=!0),h._state.watch&&(h._state.watch=!1,h._subjects.state.next({...h._formState})),h._removeUnmounted()}),r.current.formState=i6(o,h),r.current}const u3=(e,r,s)=>{if(e&&"reportValidity"in e){const o=jt(s,r);e.setCustomValidity(o&&o.message||""),e.reportValidity()}},C_=(e,r)=>{for(const s in r.fields){const o=r.fields[s];o&&o.ref&&"reportValidity"in o.ref?u3(o.ref,s,e):o&&o.refs&&o.refs.forEach(u=>u3(u,s,e))}},d3=(e,r)=>{r.shouldUseNativeValidation&&C_(e,r);const s={};for(const o in e){const u=jt(r.fields,o),h=Object.assign(e[o]||{},{ref:u&&u.ref});if(Ape(r.names||Object.keys(e),o)){const m=Object.assign({},jt(s,o));dr(m,"root",h),dr(s,o,m)}else dr(s,o,h)}return s},Ape=(e,r)=>{const s=h3(r);return e.some(o=>h3(o).match(`^${s}\\.\\d+`))};function h3(e){return e.replace(/\]|\[/g,"")}function it(e,r,s){function o(g,b){if(g._zod||Object.defineProperty(g,"_zod",{value:{def:b,constr:m,traits:new Set},enumerable:!1}),g._zod.traits.has(e))return;g._zod.traits.add(e),r(g,b);const w=m.prototype,E=Object.keys(w);for(let A=0;As?.Parent&&g instanceof s.Parent?!0:g?._zod?.traits?.has(e)}),Object.defineProperty(m,"name",{value:e}),m}class xg extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class p6 extends Error{constructor(r){super(`Encountered unidirectional transform during encode: ${r}`),this.name="ZodEncodeError"}}const f6={};function Dp(e){return f6}function m6(e){const r=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,u])=>r.indexOf(+o)===-1).map(([o,u])=>u)}function A_(e,r){return typeof r=="bigint"?r.toString():r}function l$(e){return{get value(){{const r=e();return Object.defineProperty(this,"value",{value:r}),r}}}}function c$(e){return e==null}function u$(e){const r=e.startsWith("^")?1:0,s=e.endsWith("$")?e.length-1:e.length;return e.slice(r,s)}function Ope(e,r){const s=(e.toString().split(".")[1]||"").length,o=r.toString();let u=(o.split(".")[1]||"").length;if(u===0&&/\d?e-\d?/.test(o)){const b=o.match(/\d?e-(\d?)/);b?.[1]&&(u=Number.parseInt(b[1]))}const h=s>u?s:u,m=Number.parseInt(e.toFixed(h).replace(".","")),g=Number.parseInt(r.toFixed(h).replace(".",""));return m%g/10**h}const p3=Symbol("evaluating");function pr(e,r,s){let o;Object.defineProperty(e,r,{get(){if(o!==p3)return o===void 0&&(o=p3,o=s()),o},set(u){Object.defineProperty(e,r,{value:u})},configurable:!0})}function zp(e,r,s){Object.defineProperty(e,r,{value:s,writable:!0,enumerable:!0,configurable:!0})}function Qd(...e){const r={};for(const s of e){const o=Object.getOwnPropertyDescriptors(s);Object.assign(r,o)}return Object.defineProperties({},r)}function f3(e){return JSON.stringify(e)}function kpe(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const g6="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function iC(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Rpe=l$(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Qb(e){if(iC(e)===!1)return!1;const r=e.constructor;if(r===void 0||typeof r!="function")return!0;const s=r.prototype;return!(iC(s)===!1||Object.prototype.hasOwnProperty.call(s,"isPrototypeOf")===!1)}function y6(e){return Qb(e)?{...e}:Array.isArray(e)?[...e]:e}const Tpe=new Set(["string","number","symbol"]);function Og(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function eh(e,r,s){const o=new e._zod.constr(r??e._zod.def);return(!r||s?.parent)&&(o._zod.parent=e),o}function Jt(e){const r=e;if(!r)return{};if(typeof r=="string")return{error:()=>r};if(r?.message!==void 0){if(r?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");r.error=r.message}return delete r.message,typeof r.error=="string"?{...r,error:()=>r.error}:r}function _pe(e){return Object.keys(e).filter(r=>e[r]._zod.optin==="optional"&&e[r]._zod.optout==="optional")}const $pe={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 Npe(e,r){const s=e._zod.def,o=s.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const h=Qd(e._zod.def,{get shape(){const m={};for(const g in r){if(!(g in s.shape))throw new Error(`Unrecognized key: "${g}"`);r[g]&&(m[g]=s.shape[g])}return zp(this,"shape",m),m},checks:[]});return eh(e,h)}function Dpe(e,r){const s=e._zod.def,o=s.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const h=Qd(e._zod.def,{get shape(){const m={...e._zod.def.shape};for(const g in r){if(!(g in s.shape))throw new Error(`Unrecognized key: "${g}"`);r[g]&&delete m[g]}return zp(this,"shape",m),m},checks:[]});return eh(e,h)}function Ppe(e,r){if(!Qb(r))throw new Error("Invalid input to extend: expected a plain object");const s=e._zod.def.checks;if(s&&s.length>0){const h=e._zod.def.shape;for(const m in r)if(Object.getOwnPropertyDescriptor(h,m)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const u=Qd(e._zod.def,{get shape(){const h={...e._zod.def.shape,...r};return zp(this,"shape",h),h}});return eh(e,u)}function Mpe(e,r){if(!Qb(r))throw new Error("Invalid input to safeExtend: expected a plain object");const s=Qd(e._zod.def,{get shape(){const o={...e._zod.def.shape,...r};return zp(this,"shape",o),o}});return eh(e,s)}function Ipe(e,r){const s=Qd(e._zod.def,{get shape(){const o={...e._zod.def.shape,...r._zod.def.shape};return zp(this,"shape",o),o},get catchall(){return r._zod.def.catchall},checks:[]});return eh(e,s)}function zpe(e,r,s){const u=r._zod.def.checks;if(u&&u.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const m=Qd(r._zod.def,{get shape(){const g=r._zod.def.shape,b={...g};if(s)for(const w in s){if(!(w in g))throw new Error(`Unrecognized key: "${w}"`);s[w]&&(b[w]=e?new e({type:"optional",innerType:g[w]}):g[w])}else for(const w in g)b[w]=e?new e({type:"optional",innerType:g[w]}):g[w];return zp(this,"shape",b),b},checks:[]});return eh(r,m)}function Lpe(e,r,s){const o=Qd(r._zod.def,{get shape(){const u=r._zod.def.shape,h={...u};if(s)for(const m in s){if(!(m in h))throw new Error(`Unrecognized key: "${m}"`);s[m]&&(h[m]=new e({type:"nonoptional",innerType:u[m]}))}else for(const m in u)h[m]=new e({type:"nonoptional",innerType:u[m]});return zp(this,"shape",h),h}});return eh(r,o)}function fg(e,r=0){if(e.aborted===!0)return!0;for(let s=r;s{var o;return(o=s).path??(o.path=[]),s.path.unshift(e),s})}function fj(e){return typeof e=="string"?e:e?.message}function Pp(e,r,s){const o={...e,path:e.path??[]};if(!e.message){const u=fj(e.inst?._zod.def?.error?.(e))??fj(r?.error?.(e))??fj(s.customError?.(e))??fj(s.localeError?.(e))??"Invalid input";o.message=u}return delete o.inst,delete o.continue,r?.reportInput||delete o.input,o}function d$(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function ew(...e){const[r,s,o]=e;return typeof r=="string"?{message:r,code:"custom",input:s,inst:o}:{...r}}const x6=(e,r)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:r,enumerable:!1}),e.message=JSON.stringify(r,A_,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},h$=it("$ZodError",x6),ZC=it("$ZodError",x6,{Parent:Error});function Fpe(e,r=s=>s.message){const s={},o=[];for(const u of e.issues)u.path.length>0?(s[u.path[0]]=s[u.path[0]]||[],s[u.path[0]].push(r(u))):o.push(r(u));return{formErrors:o,fieldErrors:s}}function qpe(e,r=s=>s.message){const s={_errors:[]},o=u=>{for(const h of u.issues)if(h.code==="invalid_union"&&h.errors.length)h.errors.map(m=>o({issues:m}));else if(h.code==="invalid_key")o({issues:h.issues});else if(h.code==="invalid_element")o({issues:h.issues});else if(h.path.length===0)s._errors.push(r(h));else{let m=s,g=0;for(;g(r,s,o,u)=>{const h=o?Object.assign(o,{async:!1}):{async:!1},m=r._zod.run({value:s,issues:[]},h);if(m instanceof Promise)throw new xg;if(m.issues.length){const g=new(u?.Err??e)(m.issues.map(b=>Pp(b,h,Dp())));throw g6(g,u?.callee),g}return m.value},Bpe=JC(ZC),WC=e=>async(r,s,o,u)=>{const h=o?Object.assign(o,{async:!0}):{async:!0};let m=r._zod.run({value:s,issues:[]},h);if(m instanceof Promise&&(m=await m),m.issues.length){const g=new(u?.Err??e)(m.issues.map(b=>Pp(b,h,Dp())));throw g6(g,u?.callee),g}return m.value},Upe=WC(ZC),QC=e=>(r,s,o)=>{const u=o?{...o,async:!1}:{async:!1},h=r._zod.run({value:s,issues:[]},u);if(h instanceof Promise)throw new xg;return h.issues.length?{success:!1,error:new(e??h$)(h.issues.map(m=>Pp(m,u,Dp())))}:{success:!0,data:h.value}},Kpe=QC(ZC),eA=e=>async(r,s,o)=>{const u=o?Object.assign(o,{async:!0}):{async:!0};let h=r._zod.run({value:s,issues:[]},u);return h instanceof Promise&&(h=await h),h.issues.length?{success:!1,error:new e(h.issues.map(m=>Pp(m,u,Dp())))}:{success:!0,data:h.value}},Vpe=eA(ZC),Hpe=e=>(r,s,o)=>{const u=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return JC(e)(r,s,u)},Gpe=e=>(r,s,o)=>JC(e)(r,s,o),Xpe=e=>async(r,s,o)=>{const u=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return WC(e)(r,s,u)},Ype=e=>async(r,s,o)=>WC(e)(r,s,o),Zpe=e=>(r,s,o)=>{const u=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return QC(e)(r,s,u)},Jpe=e=>(r,s,o)=>QC(e)(r,s,o),Wpe=e=>async(r,s,o)=>{const u=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return eA(e)(r,s,u)},Qpe=e=>async(r,s,o)=>eA(e)(r,s,o),efe=/^[cC][^\s-]{8,}$/,tfe=/^[0-9a-z]+$/,nfe=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,rfe=/^[0-9a-vA-V]{20}$/,sfe=/^[A-Za-z0-9]{27}$/,ife=/^[a-zA-Z0-9_-]{21}$/,afe=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ofe=/^([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})$/,m3=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)$/,lfe=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,cfe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function ufe(){return new RegExp(cfe,"u")}const dfe=/^(?:(?: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])$/,hfe=/^(([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}|:))$/,pfe=/^((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])$/,ffe=/^(([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])$/,mfe=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,b6=/^[A-Za-z0-9_-]*$/,gfe=/^\+[1-9]\d{6,14}$/,w6="(?:(?:\\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])))",yfe=new RegExp(`^${w6}$`);function S6(e){const r="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${r}`:e.precision===0?`${r}:[0-5]\\d`:`${r}:[0-5]\\d\\.\\d{${e.precision}}`:`${r}(?::[0-5]\\d(?:\\.\\d+)?)?`}function vfe(e){return new RegExp(`^${S6(e)}$`)}function xfe(e){const r=S6({precision:e.precision}),s=["Z"];e.local&&s.push(""),e.offset&&s.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const o=`${r}(?:${s.join("|")})`;return new RegExp(`^${w6}T(?:${o})$`)}const bfe=e=>{const r=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${r}$`)},wfe=/^-?\d+$/,Sfe=/^-?\d+(?:\.\d+)?$/,Efe=/^[^A-Z]*$/,jfe=/^[^a-z]*$/,xa=it("$ZodCheck",(e,r)=>{var s;e._zod??(e._zod={}),e._zod.def=r,(s=e._zod).onattach??(s.onattach=[])}),E6={number:"number",bigint:"bigint",object:"date"},j6=it("$ZodCheckLessThan",(e,r)=>{xa.init(e,r);const s=E6[typeof r.value];e._zod.onattach.push(o=>{const u=o._zod.bag,h=(r.inclusive?u.maximum:u.exclusiveMaximum)??Number.POSITIVE_INFINITY;r.value{(r.inclusive?o.value<=r.value:o.value{xa.init(e,r);const s=E6[typeof r.value];e._zod.onattach.push(o=>{const u=o._zod.bag,h=(r.inclusive?u.minimum:u.exclusiveMinimum)??Number.NEGATIVE_INFINITY;r.value>h&&(r.inclusive?u.minimum=r.value:u.exclusiveMinimum=r.value)}),e._zod.check=o=>{(r.inclusive?o.value>=r.value:o.value>r.value)||o.issues.push({origin:s,code:"too_small",minimum:typeof r.value=="object"?r.value.getTime():r.value,input:o.value,inclusive:r.inclusive,inst:e,continue:!r.abort})}}),Cfe=it("$ZodCheckMultipleOf",(e,r)=>{xa.init(e,r),e._zod.onattach.push(s=>{var o;(o=s._zod.bag).multipleOf??(o.multipleOf=r.value)}),e._zod.check=s=>{if(typeof s.value!=typeof r.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof s.value=="bigint"?s.value%r.value===BigInt(0):Ope(s.value,r.value)===0)||s.issues.push({origin:typeof s.value,code:"not_multiple_of",divisor:r.value,input:s.value,inst:e,continue:!r.abort})}}),Afe=it("$ZodCheckNumberFormat",(e,r)=>{xa.init(e,r),r.format=r.format||"float64";const s=r.format?.includes("int"),o=s?"int":"number",[u,h]=$pe[r.format];e._zod.onattach.push(m=>{const g=m._zod.bag;g.format=r.format,g.minimum=u,g.maximum=h,s&&(g.pattern=wfe)}),e._zod.check=m=>{const g=m.value;if(s){if(!Number.isInteger(g)){m.issues.push({expected:o,format:r.format,code:"invalid_type",continue:!1,input:g,inst:e});return}if(!Number.isSafeInteger(g)){g>0?m.issues.push({input:g,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!r.abort}):m.issues.push({input:g,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!r.abort});return}}gh&&m.issues.push({origin:"number",input:g,code:"too_big",maximum:h,inclusive:!0,inst:e,continue:!r.abort})}}),Ofe=it("$ZodCheckMaxLength",(e,r)=>{var s;xa.init(e,r),(s=e._zod.def).when??(s.when=o=>{const u=o.value;return!c$(u)&&u.length!==void 0}),e._zod.onattach.push(o=>{const u=o._zod.bag.maximum??Number.POSITIVE_INFINITY;r.maximum{const u=o.value;if(u.length<=r.maximum)return;const m=d$(u);o.issues.push({origin:m,code:"too_big",maximum:r.maximum,inclusive:!0,input:u,inst:e,continue:!r.abort})}}),kfe=it("$ZodCheckMinLength",(e,r)=>{var s;xa.init(e,r),(s=e._zod.def).when??(s.when=o=>{const u=o.value;return!c$(u)&&u.length!==void 0}),e._zod.onattach.push(o=>{const u=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;r.minimum>u&&(o._zod.bag.minimum=r.minimum)}),e._zod.check=o=>{const u=o.value;if(u.length>=r.minimum)return;const m=d$(u);o.issues.push({origin:m,code:"too_small",minimum:r.minimum,inclusive:!0,input:u,inst:e,continue:!r.abort})}}),Rfe=it("$ZodCheckLengthEquals",(e,r)=>{var s;xa.init(e,r),(s=e._zod.def).when??(s.when=o=>{const u=o.value;return!c$(u)&&u.length!==void 0}),e._zod.onattach.push(o=>{const u=o._zod.bag;u.minimum=r.length,u.maximum=r.length,u.length=r.length}),e._zod.check=o=>{const u=o.value,h=u.length;if(h===r.length)return;const m=d$(u),g=h>r.length;o.issues.push({origin:m,...g?{code:"too_big",maximum:r.length}:{code:"too_small",minimum:r.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!r.abort})}}),tA=it("$ZodCheckStringFormat",(e,r)=>{var s,o;xa.init(e,r),e._zod.onattach.push(u=>{const h=u._zod.bag;h.format=r.format,r.pattern&&(h.patterns??(h.patterns=new Set),h.patterns.add(r.pattern))}),r.pattern?(s=e._zod).check??(s.check=u=>{r.pattern.lastIndex=0,!r.pattern.test(u.value)&&u.issues.push({origin:"string",code:"invalid_format",format:r.format,input:u.value,...r.pattern?{pattern:r.pattern.toString()}:{},inst:e,continue:!r.abort})}):(o=e._zod).check??(o.check=()=>{})}),Tfe=it("$ZodCheckRegex",(e,r)=>{tA.init(e,r),e._zod.check=s=>{r.pattern.lastIndex=0,!r.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:"regex",input:s.value,pattern:r.pattern.toString(),inst:e,continue:!r.abort})}}),_fe=it("$ZodCheckLowerCase",(e,r)=>{r.pattern??(r.pattern=Efe),tA.init(e,r)}),$fe=it("$ZodCheckUpperCase",(e,r)=>{r.pattern??(r.pattern=jfe),tA.init(e,r)}),Nfe=it("$ZodCheckIncludes",(e,r)=>{xa.init(e,r);const s=Og(r.includes),o=new RegExp(typeof r.position=="number"?`^.{${r.position}}${s}`:s);r.pattern=o,e._zod.onattach.push(u=>{const h=u._zod.bag;h.patterns??(h.patterns=new Set),h.patterns.add(o)}),e._zod.check=u=>{u.value.includes(r.includes,r.position)||u.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:r.includes,input:u.value,inst:e,continue:!r.abort})}}),Dfe=it("$ZodCheckStartsWith",(e,r)=>{xa.init(e,r);const s=new RegExp(`^${Og(r.prefix)}.*`);r.pattern??(r.pattern=s),e._zod.onattach.push(o=>{const u=o._zod.bag;u.patterns??(u.patterns=new Set),u.patterns.add(s)}),e._zod.check=o=>{o.value.startsWith(r.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:r.prefix,input:o.value,inst:e,continue:!r.abort})}}),Pfe=it("$ZodCheckEndsWith",(e,r)=>{xa.init(e,r);const s=new RegExp(`.*${Og(r.suffix)}$`);r.pattern??(r.pattern=s),e._zod.onattach.push(o=>{const u=o._zod.bag;u.patterns??(u.patterns=new Set),u.patterns.add(s)}),e._zod.check=o=>{o.value.endsWith(r.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:r.suffix,input:o.value,inst:e,continue:!r.abort})}}),Mfe=it("$ZodCheckOverwrite",(e,r)=>{xa.init(e,r),e._zod.check=s=>{s.value=r.tx(s.value)}});class Ife{constructor(r=[]){this.content=[],this.indent=0,this&&(this.args=r)}indented(r){this.indent+=1,r(this),this.indent-=1}write(r){if(typeof r=="function"){r(this,{execution:"sync"}),r(this,{execution:"async"});return}const o=r.split(` `).filter(m=>m),u=Math.min(...o.map(m=>m.length-m.trimStart().length)),h=o.map(m=>m.slice(u)).map(m=>" ".repeat(this.indent*2)+m);for(const m of h)this.content.push(m)}compile(){const r=Function,s=this?.args,u=[...(this?.content??[""]).map(h=>` ${h}`)];return new r(...s,u.join(` `))}}const zfe={major:4,minor:3,patch:5},Gr=it("$ZodType",(e,r)=>{var s;e??(e={}),e._zod.def=r,e._zod.bag=e._zod.bag||{},e._zod.version=zfe;const o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(const u of o)for(const h of u._zod.onattach)h(e);if(o.length===0)(s=e._zod).deferred??(s.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const u=(m,g,b)=>{let w=fg(m),E;for(const A of g){if(A._zod.def.when){if(!A._zod.def.when(m))continue}else if(w)continue;const k=m.issues.length,R=A._zod.check(m);if(R instanceof Promise&&b?.async===!1)throw new xg;if(E||R instanceof Promise)E=(E??Promise.resolve()).then(async()=>{await R,m.issues.length!==k&&(w||(w=fg(m,k)))});else{if(m.issues.length===k)continue;w||(w=fg(m,k))}}return E?E.then(()=>m):m},h=(m,g,b)=>{if(fg(m))return m.aborted=!0,m;const w=u(g,o,b);if(w instanceof Promise){if(b.async===!1)throw new xg;return w.then(E=>e._zod.parse(E,b))}return e._zod.parse(w,b)};e._zod.run=(m,g)=>{if(g.skipChecks)return e._zod.parse(m,g);if(g.direction==="backward"){const w=e._zod.parse({value:m.value,issues:[]},{...g,skipChecks:!0});return w instanceof Promise?w.then(E=>h(E,m,g)):h(w,m,g)}const b=e._zod.parse(m,g);if(b instanceof Promise){if(g.async===!1)throw new xg;return b.then(w=>u(w,o,g))}return u(b,o,g)}}pr(e,"~standard",()=>({validate:u=>{try{const h=Kpe(e,u);return h.success?{value:h.data}:{issues:h.error?.issues}}catch{return Vpe(e,u).then(m=>m.success?{value:m.data}:{issues:m.error?.issues})}},vendor:"zod",version:1}))}),p$=it("$ZodString",(e,r)=>{Gr.init(e,r),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??bfe(e._zod.bag),e._zod.parse=(s,o)=>{if(r.coerce)try{s.value=String(s.value)}catch{}return typeof s.value=="string"||s.issues.push({expected:"string",code:"invalid_type",input:s.value,inst:e}),s}}),Nr=it("$ZodStringFormat",(e,r)=>{tA.init(e,r),p$.init(e,r)}),Lfe=it("$ZodGUID",(e,r)=>{r.pattern??(r.pattern=ofe),Nr.init(e,r)}),Ffe=it("$ZodUUID",(e,r)=>{if(r.version){const o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[r.version];if(o===void 0)throw new Error(`Invalid UUID version: "${r.version}"`);r.pattern??(r.pattern=m3(o))}else r.pattern??(r.pattern=m3());Nr.init(e,r)}),qfe=it("$ZodEmail",(e,r)=>{r.pattern??(r.pattern=lfe),Nr.init(e,r)}),Bfe=it("$ZodURL",(e,r)=>{Nr.init(e,r),e._zod.check=s=>{try{const o=s.value.trim(),u=new URL(o);r.hostname&&(r.hostname.lastIndex=0,r.hostname.test(u.hostname)||s.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:r.hostname.source,input:s.value,inst:e,continue:!r.abort})),r.protocol&&(r.protocol.lastIndex=0,r.protocol.test(u.protocol.endsWith(":")?u.protocol.slice(0,-1):u.protocol)||s.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:r.protocol.source,input:s.value,inst:e,continue:!r.abort})),r.normalize?s.value=u.href:s.value=o;return}catch{s.issues.push({code:"invalid_format",format:"url",input:s.value,inst:e,continue:!r.abort})}}}),Ufe=it("$ZodEmoji",(e,r)=>{r.pattern??(r.pattern=ufe()),Nr.init(e,r)}),Kfe=it("$ZodNanoID",(e,r)=>{r.pattern??(r.pattern=ife),Nr.init(e,r)}),Vfe=it("$ZodCUID",(e,r)=>{r.pattern??(r.pattern=efe),Nr.init(e,r)}),Hfe=it("$ZodCUID2",(e,r)=>{r.pattern??(r.pattern=tfe),Nr.init(e,r)}),Gfe=it("$ZodULID",(e,r)=>{r.pattern??(r.pattern=nfe),Nr.init(e,r)}),Xfe=it("$ZodXID",(e,r)=>{r.pattern??(r.pattern=rfe),Nr.init(e,r)}),Yfe=it("$ZodKSUID",(e,r)=>{r.pattern??(r.pattern=sfe),Nr.init(e,r)}),Zfe=it("$ZodISODateTime",(e,r)=>{r.pattern??(r.pattern=xfe(r)),Nr.init(e,r)}),Jfe=it("$ZodISODate",(e,r)=>{r.pattern??(r.pattern=yfe),Nr.init(e,r)}),Wfe=it("$ZodISOTime",(e,r)=>{r.pattern??(r.pattern=vfe(r)),Nr.init(e,r)}),Qfe=it("$ZodISODuration",(e,r)=>{r.pattern??(r.pattern=afe),Nr.init(e,r)}),eme=it("$ZodIPv4",(e,r)=>{r.pattern??(r.pattern=dfe),Nr.init(e,r),e._zod.bag.format="ipv4"}),tme=it("$ZodIPv6",(e,r)=>{r.pattern??(r.pattern=hfe),Nr.init(e,r),e._zod.bag.format="ipv6",e._zod.check=s=>{try{new URL(`http://[${s.value}]`)}catch{s.issues.push({code:"invalid_format",format:"ipv6",input:s.value,inst:e,continue:!r.abort})}}}),nme=it("$ZodCIDRv4",(e,r)=>{r.pattern??(r.pattern=pfe),Nr.init(e,r)}),rme=it("$ZodCIDRv6",(e,r)=>{r.pattern??(r.pattern=ffe),Nr.init(e,r),e._zod.check=s=>{const o=s.value.split("/");try{if(o.length!==2)throw new Error;const[u,h]=o;if(!h)throw new Error;const m=Number(h);if(`${m}`!==h)throw new Error;if(m<0||m>128)throw new Error;new URL(`http://[${u}]`)}catch{s.issues.push({code:"invalid_format",format:"cidrv6",input:s.value,inst:e,continue:!r.abort})}}});function A6(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const sme=it("$ZodBase64",(e,r)=>{r.pattern??(r.pattern=mfe),Nr.init(e,r),e._zod.bag.contentEncoding="base64",e._zod.check=s=>{A6(s.value)||s.issues.push({code:"invalid_format",format:"base64",input:s.value,inst:e,continue:!r.abort})}});function ime(e){if(!b6.test(e))return!1;const r=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),s=r.padEnd(Math.ceil(r.length/4)*4,"=");return A6(s)}const ame=it("$ZodBase64URL",(e,r)=>{r.pattern??(r.pattern=b6),Nr.init(e,r),e._zod.bag.contentEncoding="base64url",e._zod.check=s=>{ime(s.value)||s.issues.push({code:"invalid_format",format:"base64url",input:s.value,inst:e,continue:!r.abort})}}),ome=it("$ZodE164",(e,r)=>{r.pattern??(r.pattern=gfe),Nr.init(e,r)});function lme(e,r=null){try{const s=e.split(".");if(s.length!==3)return!1;const[o]=s;if(!o)return!1;const u=JSON.parse(atob(o));return!("typ"in u&&u?.typ!=="JWT"||!u.alg||r&&(!("alg"in u)||u.alg!==r))}catch{return!1}}const cme=it("$ZodJWT",(e,r)=>{Nr.init(e,r),e._zod.check=s=>{lme(s.value,r.alg)||s.issues.push({code:"invalid_format",format:"jwt",input:s.value,inst:e,continue:!r.abort})}}),O6=it("$ZodNumber",(e,r)=>{Gr.init(e,r),e._zod.pattern=e._zod.bag.pattern??Sfe,e._zod.parse=(s,o)=>{if(r.coerce)try{s.value=Number(s.value)}catch{}const u=s.value;if(typeof u=="number"&&!Number.isNaN(u)&&Number.isFinite(u))return s;const h=typeof u=="number"?Number.isNaN(u)?"NaN":Number.isFinite(u)?void 0:"Infinity":void 0;return s.issues.push({expected:"number",code:"invalid_type",input:u,inst:e,...h?{received:h}:{}}),s}}),ume=it("$ZodNumberFormat",(e,r)=>{Afe.init(e,r),O6.init(e,r)}),dme=it("$ZodAny",(e,r)=>{Gr.init(e,r),e._zod.parse=s=>s}),hme=it("$ZodUnknown",(e,r)=>{Gr.init(e,r),e._zod.parse=s=>s}),pme=it("$ZodNever",(e,r)=>{Gr.init(e,r),e._zod.parse=(s,o)=>(s.issues.push({expected:"never",code:"invalid_type",input:s.value,inst:e}),s)});function g3(e,r,s){e.issues.length&&r.issues.push(...v6(s,e.issues)),r.value[s]=e.value}const fme=it("$ZodArray",(e,r)=>{Gr.init(e,r),e._zod.parse=(s,o)=>{const u=s.value;if(!Array.isArray(u))return s.issues.push({expected:"array",code:"invalid_type",input:u,inst:e}),s;s.value=Array(u.length);const h=[];for(let m=0;mg3(w,s,m))):g3(b,s,m)}return h.length?Promise.all(h).then(()=>s):s}});function aC(e,r,s,o,u){if(e.issues.length){if(u&&!(s in o))return;r.issues.push(...v6(s,e.issues))}e.value===void 0?s in o&&(r.value[s]=void 0):r.value[s]=e.value}function k6(e){const r=Object.keys(e.shape);for(const o of r)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);const s=_pe(e.shape);return{...e,keys:r,keySet:new Set(r),numKeys:r.length,optionalKeys:new Set(s)}}function R6(e,r,s,o,u,h){const m=[],g=u.keySet,b=u.catchall._zod,w=b.def.type,E=b.optout==="optional";for(const A in r){if(g.has(A))continue;if(w==="never"){m.push(A);continue}const k=b.run({value:r[A],issues:[]},o);k instanceof Promise?e.push(k.then(R=>aC(R,s,A,r,E))):aC(k,s,A,r,E)}return m.length&&s.issues.push({code:"unrecognized_keys",keys:m,input:r,inst:h}),e.length?Promise.all(e).then(()=>s):s}const mme=it("$ZodObject",(e,r)=>{if(Gr.init(e,r),!Object.getOwnPropertyDescriptor(r,"shape")?.get){const g=r.shape;Object.defineProperty(r,"shape",{get:()=>{const b={...g};return Object.defineProperty(r,"shape",{value:b}),b}})}const o=l$(()=>k6(r));pr(e._zod,"propValues",()=>{const g=r.shape,b={};for(const w in g){const E=g[w]._zod;if(E.values){b[w]??(b[w]=new Set);for(const A of E.values)b[w].add(A)}}return b});const u=iC,h=r.catchall;let m;e._zod.parse=(g,b)=>{m??(m=o.value);const w=g.value;if(!u(w))return g.issues.push({expected:"object",code:"invalid_type",input:w,inst:e}),g;g.value={};const E=[],A=m.shape;for(const k of m.keys){const R=A[k],M=R._zod.optout==="optional",I=R._zod.run({value:w[k],issues:[]},b);I instanceof Promise?E.push(I.then(F=>aC(F,g,k,w,M))):aC(I,g,k,w,M)}return h?R6(E,w,g,b,o.value,e):E.length?Promise.all(E).then(()=>g):g}}),gme=it("$ZodObjectJIT",(e,r)=>{mme.init(e,r);const s=e._zod.parse,o=l$(()=>k6(r)),u=k=>{const R=new Ife(["shape","payload","ctx"]),M=o.value,I=K=>{const z=f3(K);return`shape[${z}]._zod.run({ value: input[${z}], issues: [] }, ctx)`};R.write("const input = payload.value;");const F=Object.create(null);let H=0;for(const K of M.keys)F[K]=`key_${H++}`;R.write("const newResult = {};");for(const K of M.keys){const z=F[K],W=f3(K),Q=k[K]?._zod?.optout==="optional";R.write(`const ${z} = ${I(K)};`),Q?R.write(` if (${z}.issues.length) { if (${W} in input) { payload.issues = payload.issues.concat(${z}.issues.map(iss => ({ ...iss, path: iss.path ? [${W}, ...iss.path] : [${W}] }))); } } if (${z}.value === undefined) { if (${W} in input) { newResult[${W}] = undefined; } } else { newResult[${W}] = ${z}.value; } `):R.write(` if (${z}.issues.length) { payload.issues = payload.issues.concat(${z}.issues.map(iss => ({ ...iss, path: iss.path ? [${W}, ...iss.path] : [${W}] }))); } if (${z}.value === undefined) { if (${W} in input) { newResult[${W}] = undefined; } } else { newResult[${W}] = ${z}.value; } `)}R.write("payload.value = newResult;"),R.write("return payload;");const V=R.compile();return(K,z)=>V(k,K,z)};let h;const m=iC,g=!f6.jitless,w=g&&Rpe.value,E=r.catchall;let A;e._zod.parse=(k,R)=>{A??(A=o.value);const M=k.value;return m(M)?g&&w&&R?.async===!1&&R.jitless!==!0?(h||(h=u(r.shape)),k=h(k,R),E?R6([],M,k,R,A,e):k):s(k,R):(k.issues.push({expected:"object",code:"invalid_type",input:M,inst:e}),k)}});function y3(e,r,s,o){for(const h of e)if(h.issues.length===0)return r.value=h.value,r;const u=e.filter(h=>!fg(h));return u.length===1?(r.value=u[0].value,u[0]):(r.issues.push({code:"invalid_union",input:r.value,inst:s,errors:e.map(h=>h.issues.map(m=>Pp(m,o,Dp())))}),r)}const yme=it("$ZodUnion",(e,r)=>{Gr.init(e,r),pr(e._zod,"optin",()=>r.options.some(u=>u._zod.optin==="optional")?"optional":void 0),pr(e._zod,"optout",()=>r.options.some(u=>u._zod.optout==="optional")?"optional":void 0),pr(e._zod,"values",()=>{if(r.options.every(u=>u._zod.values))return new Set(r.options.flatMap(u=>Array.from(u._zod.values)))}),pr(e._zod,"pattern",()=>{if(r.options.every(u=>u._zod.pattern)){const u=r.options.map(h=>h._zod.pattern);return new RegExp(`^(${u.map(h=>u$(h.source)).join("|")})$`)}});const s=r.options.length===1,o=r.options[0]._zod.run;e._zod.parse=(u,h)=>{if(s)return o(u,h);let m=!1;const g=[];for(const b of r.options){const w=b._zod.run({value:u.value,issues:[]},h);if(w instanceof Promise)g.push(w),m=!0;else{if(w.issues.length===0)return w;g.push(w)}}return m?Promise.all(g).then(b=>y3(b,u,e,h)):y3(g,u,e,h)}}),vme=it("$ZodIntersection",(e,r)=>{Gr.init(e,r),e._zod.parse=(s,o)=>{const u=s.value,h=r.left._zod.run({value:u,issues:[]},o),m=r.right._zod.run({value:u,issues:[]},o);return h instanceof Promise||m instanceof Promise?Promise.all([h,m]).then(([b,w])=>v3(s,b,w)):v3(s,h,m)}});function O_(e,r){if(e===r)return{valid:!0,data:e};if(e instanceof Date&&r instanceof Date&&+e==+r)return{valid:!0,data:e};if(Qb(e)&&Qb(r)){const s=Object.keys(r),o=Object.keys(e).filter(h=>s.indexOf(h)!==-1),u={...e,...r};for(const h of o){const m=O_(e[h],r[h]);if(!m.valid)return{valid:!1,mergeErrorPath:[h,...m.mergeErrorPath]};u[h]=m.data}return{valid:!0,data:u}}if(Array.isArray(e)&&Array.isArray(r)){if(e.length!==r.length)return{valid:!1,mergeErrorPath:[]};const s=[];for(let o=0;og.l&&g.r).map(([g])=>g);if(h.length&&u&&e.issues.push({...u,keys:h}),fg(e))return e;const m=O_(r.value,s.value);if(!m.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(m.mergeErrorPath)}`);return e.value=m.data,e}const xme=it("$ZodEnum",(e,r)=>{Gr.init(e,r);const s=m6(r.entries),o=new Set(s);e._zod.values=o,e._zod.pattern=new RegExp(`^(${s.filter(u=>Tpe.has(typeof u)).map(u=>typeof u=="string"?Og(u):u.toString()).join("|")})$`),e._zod.parse=(u,h)=>{const m=u.value;return o.has(m)||u.issues.push({code:"invalid_value",values:s,input:m,inst:e}),u}}),bme=it("$ZodLiteral",(e,r)=>{if(Gr.init(e,r),r.values.length===0)throw new Error("Cannot create literal schema with no valid values");const s=new Set(r.values);e._zod.values=s,e._zod.pattern=new RegExp(`^(${r.values.map(o=>typeof o=="string"?Og(o):o?Og(o.toString()):String(o)).join("|")})$`),e._zod.parse=(o,u)=>{const h=o.value;return s.has(h)||o.issues.push({code:"invalid_value",values:r.values,input:h,inst:e}),o}}),wme=it("$ZodTransform",(e,r)=>{Gr.init(e,r),e._zod.parse=(s,o)=>{if(o.direction==="backward")throw new p6(e.constructor.name);const u=r.transform(s.value,s);if(o.async)return(u instanceof Promise?u:Promise.resolve(u)).then(m=>(s.value=m,s));if(u instanceof Promise)throw new xg;return s.value=u,s}});function x3(e,r){return e.issues.length&&r===void 0?{issues:[],value:void 0}:e}const T6=it("$ZodOptional",(e,r)=>{Gr.init(e,r),e._zod.optin="optional",e._zod.optout="optional",pr(e._zod,"values",()=>r.innerType._zod.values?new Set([...r.innerType._zod.values,void 0]):void 0),pr(e._zod,"pattern",()=>{const s=r.innerType._zod.pattern;return s?new RegExp(`^(${u$(s.source)})?$`):void 0}),e._zod.parse=(s,o)=>{if(r.innerType._zod.optin==="optional"){const u=r.innerType._zod.run(s,o);return u instanceof Promise?u.then(h=>x3(h,s.value)):x3(u,s.value)}return s.value===void 0?s:r.innerType._zod.run(s,o)}}),Sme=it("$ZodExactOptional",(e,r)=>{T6.init(e,r),pr(e._zod,"values",()=>r.innerType._zod.values),pr(e._zod,"pattern",()=>r.innerType._zod.pattern),e._zod.parse=(s,o)=>r.innerType._zod.run(s,o)}),Eme=it("$ZodNullable",(e,r)=>{Gr.init(e,r),pr(e._zod,"optin",()=>r.innerType._zod.optin),pr(e._zod,"optout",()=>r.innerType._zod.optout),pr(e._zod,"pattern",()=>{const s=r.innerType._zod.pattern;return s?new RegExp(`^(${u$(s.source)}|null)$`):void 0}),pr(e._zod,"values",()=>r.innerType._zod.values?new Set([...r.innerType._zod.values,null]):void 0),e._zod.parse=(s,o)=>s.value===null?s:r.innerType._zod.run(s,o)}),jme=it("$ZodDefault",(e,r)=>{Gr.init(e,r),e._zod.optin="optional",pr(e._zod,"values",()=>r.innerType._zod.values),e._zod.parse=(s,o)=>{if(o.direction==="backward")return r.innerType._zod.run(s,o);if(s.value===void 0)return s.value=r.defaultValue,s;const u=r.innerType._zod.run(s,o);return u instanceof Promise?u.then(h=>b3(h,r)):b3(u,r)}});function b3(e,r){return e.value===void 0&&(e.value=r.defaultValue),e}const Cme=it("$ZodPrefault",(e,r)=>{Gr.init(e,r),e._zod.optin="optional",pr(e._zod,"values",()=>r.innerType._zod.values),e._zod.parse=(s,o)=>(o.direction==="backward"||s.value===void 0&&(s.value=r.defaultValue),r.innerType._zod.run(s,o))}),Ame=it("$ZodNonOptional",(e,r)=>{Gr.init(e,r),pr(e._zod,"values",()=>{const s=r.innerType._zod.values;return s?new Set([...s].filter(o=>o!==void 0)):void 0}),e._zod.parse=(s,o)=>{const u=r.innerType._zod.run(s,o);return u instanceof Promise?u.then(h=>w3(h,e)):w3(u,e)}});function w3(e,r){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:r}),e}const Ome=it("$ZodCatch",(e,r)=>{Gr.init(e,r),pr(e._zod,"optin",()=>r.innerType._zod.optin),pr(e._zod,"optout",()=>r.innerType._zod.optout),pr(e._zod,"values",()=>r.innerType._zod.values),e._zod.parse=(s,o)=>{if(o.direction==="backward")return r.innerType._zod.run(s,o);const u=r.innerType._zod.run(s,o);return u instanceof Promise?u.then(h=>(s.value=h.value,h.issues.length&&(s.value=r.catchValue({...s,error:{issues:h.issues.map(m=>Pp(m,o,Dp()))},input:s.value}),s.issues=[]),s)):(s.value=u.value,u.issues.length&&(s.value=r.catchValue({...s,error:{issues:u.issues.map(h=>Pp(h,o,Dp()))},input:s.value}),s.issues=[]),s)}}),kme=it("$ZodPipe",(e,r)=>{Gr.init(e,r),pr(e._zod,"values",()=>r.in._zod.values),pr(e._zod,"optin",()=>r.in._zod.optin),pr(e._zod,"optout",()=>r.out._zod.optout),pr(e._zod,"propValues",()=>r.in._zod.propValues),e._zod.parse=(s,o)=>{if(o.direction==="backward"){const h=r.out._zod.run(s,o);return h instanceof Promise?h.then(m=>mj(m,r.in,o)):mj(h,r.in,o)}const u=r.in._zod.run(s,o);return u instanceof Promise?u.then(h=>mj(h,r.out,o)):mj(u,r.out,o)}});function mj(e,r,s){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:e.value,issues:e.issues},s)}const Rme=it("$ZodReadonly",(e,r)=>{Gr.init(e,r),pr(e._zod,"propValues",()=>r.innerType._zod.propValues),pr(e._zod,"values",()=>r.innerType._zod.values),pr(e._zod,"optin",()=>r.innerType?._zod?.optin),pr(e._zod,"optout",()=>r.innerType?._zod?.optout),e._zod.parse=(s,o)=>{if(o.direction==="backward")return r.innerType._zod.run(s,o);const u=r.innerType._zod.run(s,o);return u instanceof Promise?u.then(S3):S3(u)}});function S3(e){return e.value=Object.freeze(e.value),e}const Tme=it("$ZodCustom",(e,r)=>{xa.init(e,r),Gr.init(e,r),e._zod.parse=(s,o)=>s,e._zod.check=s=>{const o=s.value,u=r.fn(o);if(u instanceof Promise)return u.then(h=>E3(h,s,o,e));E3(u,s,o,e)}});function E3(e,r,s,o){if(!e){const u={code:"custom",input:s,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(u.params=o._zod.def.params),r.issues.push(ew(u))}}var j3;class _me{constructor(){this._map=new WeakMap,this._idmap=new Map}add(r,...s){const o=s[0];return this._map.set(r,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,r),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(r){const s=this._map.get(r);return s&&typeof s=="object"&&"id"in s&&this._idmap.delete(s.id),this._map.delete(r),this}get(r){const s=r._zod.parent;if(s){const o={...this.get(s)??{}};delete o.id;const u={...o,...this._map.get(r)};return Object.keys(u).length?u:void 0}return this._map.get(r)}has(r){return this._map.has(r)}}function $me(){return new _me}(j3=globalThis).__zod_globalRegistry??(j3.__zod_globalRegistry=$me());const Rb=globalThis.__zod_globalRegistry;function Nme(e,r){return new e({type:"string",...Jt(r)})}function Dme(e,r){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Jt(r)})}function C3(e,r){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Jt(r)})}function _6(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Jt(r)})}function Pme(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Jt(r)})}function Mme(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Jt(r)})}function Ime(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Jt(r)})}function zme(e,r){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Jt(r)})}function Lme(e,r){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Jt(r)})}function Fme(e,r){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Jt(r)})}function qme(e,r){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Jt(r)})}function Bme(e,r){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Jt(r)})}function Ume(e,r){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Jt(r)})}function Kme(e,r){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Jt(r)})}function Vme(e,r){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Jt(r)})}function Hme(e,r){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Jt(r)})}function Gme(e,r){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Jt(r)})}function Xme(e,r){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Jt(r)})}function Yme(e,r){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Jt(r)})}function Zme(e,r){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Jt(r)})}function Jme(e,r){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Jt(r)})}function Wme(e,r){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Jt(r)})}function Qme(e,r){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Jt(r)})}function ege(e,r){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Jt(r)})}function tge(e,r){return new e({type:"string",format:"date",check:"string_format",...Jt(r)})}function nge(e,r){return new e({type:"string",format:"time",check:"string_format",precision:null,...Jt(r)})}function rge(e,r){return new e({type:"string",format:"duration",check:"string_format",...Jt(r)})}function sge(e,r){return new e({type:"number",checks:[],...Jt(r)})}function ige(e,r){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Jt(r)})}function age(e){return new e({type:"any"})}function oge(e){return new e({type:"unknown"})}function lge(e,r){return new e({type:"never",...Jt(r)})}function A3(e,r){return new j6({check:"less_than",...Jt(r),value:e,inclusive:!1})}function ET(e,r){return new j6({check:"less_than",...Jt(r),value:e,inclusive:!0})}function O3(e,r){return new C6({check:"greater_than",...Jt(r),value:e,inclusive:!1})}function jT(e,r){return new C6({check:"greater_than",...Jt(r),value:e,inclusive:!0})}function k3(e,r){return new Cfe({check:"multiple_of",...Jt(r),value:e})}function $6(e,r){return new Ofe({check:"max_length",...Jt(r),maximum:e})}function oC(e,r){return new kfe({check:"min_length",...Jt(r),minimum:e})}function N6(e,r){return new Rfe({check:"length_equals",...Jt(r),length:e})}function cge(e,r){return new Tfe({check:"string_format",format:"regex",...Jt(r),pattern:e})}function uge(e){return new _fe({check:"string_format",format:"lowercase",...Jt(e)})}function dge(e){return new $fe({check:"string_format",format:"uppercase",...Jt(e)})}function hge(e,r){return new Nfe({check:"string_format",format:"includes",...Jt(r),includes:e})}function pge(e,r){return new Dfe({check:"string_format",format:"starts_with",...Jt(r),prefix:e})}function fge(e,r){return new Pfe({check:"string_format",format:"ends_with",...Jt(r),suffix:e})}function qg(e){return new Mfe({check:"overwrite",tx:e})}function mge(e){return qg(r=>r.normalize(e))}function gge(){return qg(e=>e.trim())}function yge(){return qg(e=>e.toLowerCase())}function vge(){return qg(e=>e.toUpperCase())}function xge(){return qg(e=>kpe(e))}function bge(e,r,s){return new e({type:"array",element:r,...Jt(s)})}function wge(e,r,s){return new e({type:"custom",check:"custom",fn:r,...Jt(s)})}function Sge(e){const r=Ege(s=>(s.addIssue=o=>{if(typeof o=="string")s.issues.push(ew(o,s.value,r._zod.def));else{const u=o;u.fatal&&(u.continue=!1),u.code??(u.code="custom"),u.input??(u.input=s.value),u.inst??(u.inst=r),u.continue??(u.continue=!r._zod.def.abort),s.issues.push(ew(u))}},e(s.value,s)));return r}function Ege(e,r){const s=new xa({check:"custom",...Jt(r)});return s._zod.check=e,s}function D6(e){let r=e?.target??"draft-2020-12";return r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Rb,target:r,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Zs(e,r,s={path:[],schemaPath:[]}){var o;const u=e._zod.def,h=r.seen.get(e);if(h)return h.count++,s.schemaPath.includes(e)&&(h.cycle=s.path),h.schema;const m={schema:{},count:1,cycle:void 0,path:s.path};r.seen.set(e,m);const g=e._zod.toJSONSchema?.();if(g)m.schema=g;else{const E={...s,schemaPath:[...s.schemaPath,e],path:s.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(r,m.schema,E);else{const k=m.schema,R=r.processors[u.type];if(!R)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${u.type}`);R(e,r,k,E)}const A=e._zod.parent;A&&(m.ref||(m.ref=A),Zs(A,r,E),r.seen.get(A).isParent=!0)}const b=r.metadataRegistry.get(e);return b&&Object.assign(m.schema,b),r.io==="input"&&qi(e)&&(delete m.schema.examples,delete m.schema.default),r.io==="input"&&m.schema._prefault&&((o=m.schema).default??(o.default=m.schema._prefault)),delete m.schema._prefault,r.seen.get(e).schema}function P6(e,r){const s=e.seen.get(r);if(!s)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=new Map;for(const m of e.seen.entries()){const g=e.metadataRegistry.get(m[0])?.id;if(g){const b=o.get(g);if(b&&b!==m[0])throw new Error(`Duplicate schema id "${g}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(g,m[0])}}const u=m=>{const g=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const A=e.external.registry.get(m[0])?.id,k=e.external.uri??(M=>M);if(A)return{ref:k(A)};const R=m[1].defId??m[1].schema.id??`schema${e.counter++}`;return m[1].defId=R,{defId:R,ref:`${k("__shared")}#/${g}/${R}`}}if(m[1]===s)return{ref:"#"};const w=`#/${g}/`,E=m[1].schema.id??`__schema${e.counter++}`;return{defId:E,ref:w+E}},h=m=>{if(m[1].schema.$ref)return;const g=m[1],{ref:b,defId:w}=u(m);g.def={...g.schema},w&&(g.defId=w);const E=g.schema;for(const A in E)delete E[A];E.$ref=b};if(e.cycles==="throw")for(const m of e.seen.entries()){const g=m[1];if(g.cycle)throw new Error(`Cycle detected: #/${g.cycle?.join("/")}/ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const m of e.seen.entries()){const g=m[1];if(r===m[0]){h(m);continue}if(e.external){const w=e.external.registry.get(m[0])?.id;if(r!==m[0]&&w){h(m);continue}}if(e.metadataRegistry.get(m[0])?.id){h(m);continue}if(g.cycle){h(m);continue}if(g.count>1&&e.reused==="ref"){h(m);continue}}}function M6(e,r){const s=e.seen.get(r);if(!s)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=m=>{const g=e.seen.get(m);if(g.ref===null)return;const b=g.def??g.schema,w={...b},E=g.ref;if(g.ref=null,E){o(E);const k=e.seen.get(E),R=k.schema;if(R.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(b.allOf=b.allOf??[],b.allOf.push(R)):Object.assign(b,R),Object.assign(b,w),m._zod.parent===E)for(const I in b)I==="$ref"||I==="allOf"||I in w||delete b[I];if(R.$ref)for(const I in b)I==="$ref"||I==="allOf"||I in k.def&&JSON.stringify(b[I])===JSON.stringify(k.def[I])&&delete b[I]}const A=m._zod.parent;if(A&&A!==E){o(A);const k=e.seen.get(A);if(k?.schema.$ref&&(b.$ref=k.schema.$ref,k.def))for(const R in b)R==="$ref"||R==="allOf"||R in k.def&&JSON.stringify(b[R])===JSON.stringify(k.def[R])&&delete b[R]}e.override({zodSchema:m,jsonSchema:b,path:g.path??[]})};for(const m of[...e.seen.entries()].reverse())o(m[0]);const u={};if(e.target==="draft-2020-12"?u.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?u.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?u.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const m=e.external.registry.get(r)?.id;if(!m)throw new Error("Schema is missing an `id` property");u.$id=e.external.uri(m)}Object.assign(u,s.def??s.schema);const h=e.external?.defs??{};for(const m of e.seen.entries()){const g=m[1];g.def&&g.defId&&(h[g.defId]=g.def)}e.external||Object.keys(h).length>0&&(e.target==="draft-2020-12"?u.$defs=h:u.definitions=h);try{const m=JSON.parse(JSON.stringify(u));return Object.defineProperty(m,"~standard",{value:{...r["~standard"],jsonSchema:{input:lC(r,"input",e.processors),output:lC(r,"output",e.processors)}},enumerable:!1,writable:!1}),m}catch{throw new Error("Error converting schema to JSON.")}}function qi(e,r){const s=r??{seen:new Set};if(s.seen.has(e))return!1;s.seen.add(e);const o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return qi(o.element,s);if(o.type==="set")return qi(o.valueType,s);if(o.type==="lazy")return qi(o.getter(),s);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return qi(o.innerType,s);if(o.type==="intersection")return qi(o.left,s)||qi(o.right,s);if(o.type==="record"||o.type==="map")return qi(o.keyType,s)||qi(o.valueType,s);if(o.type==="pipe")return qi(o.in,s)||qi(o.out,s);if(o.type==="object"){for(const u in o.shape)if(qi(o.shape[u],s))return!0;return!1}if(o.type==="union"){for(const u of o.options)if(qi(u,s))return!0;return!1}if(o.type==="tuple"){for(const u of o.items)if(qi(u,s))return!0;return!!(o.rest&&qi(o.rest,s))}return!1}const jge=(e,r={})=>s=>{const o=D6({...s,processors:r});return Zs(e,o),P6(o,e),M6(o,e)},lC=(e,r,s={})=>o=>{const{libraryOptions:u,target:h}=o??{},m=D6({...u??{},target:h,io:r,processors:s});return Zs(e,m),P6(m,e),M6(m,e)},Cge={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Age=(e,r,s,o)=>{const u=s;u.type="string";const{minimum:h,maximum:m,format:g,patterns:b,contentEncoding:w}=e._zod.bag;if(typeof h=="number"&&(u.minLength=h),typeof m=="number"&&(u.maxLength=m),g&&(u.format=Cge[g]??g,u.format===""&&delete u.format,g==="time"&&delete u.format),w&&(u.contentEncoding=w),b&&b.size>0){const E=[...b];E.length===1?u.pattern=E[0].source:E.length>1&&(u.allOf=[...E.map(A=>({...r.target==="draft-07"||r.target==="draft-04"||r.target==="openapi-3.0"?{type:"string"}:{},pattern:A.source}))])}},Oge=(e,r,s,o)=>{const u=s,{minimum:h,maximum:m,format:g,multipleOf:b,exclusiveMaximum:w,exclusiveMinimum:E}=e._zod.bag;typeof g=="string"&&g.includes("int")?u.type="integer":u.type="number",typeof E=="number"&&(r.target==="draft-04"||r.target==="openapi-3.0"?(u.minimum=E,u.exclusiveMinimum=!0):u.exclusiveMinimum=E),typeof h=="number"&&(u.minimum=h,typeof E=="number"&&r.target!=="draft-04"&&(E>=h?delete u.minimum:delete u.exclusiveMinimum)),typeof w=="number"&&(r.target==="draft-04"||r.target==="openapi-3.0"?(u.maximum=w,u.exclusiveMaximum=!0):u.exclusiveMaximum=w),typeof m=="number"&&(u.maximum=m,typeof w=="number"&&r.target!=="draft-04"&&(w<=m?delete u.maximum:delete u.exclusiveMaximum)),typeof b=="number"&&(u.multipleOf=b)},kge=(e,r,s,o)=>{s.not={}},Rge=(e,r,s,o)=>{},Tge=(e,r,s,o)=>{},_ge=(e,r,s,o)=>{const u=e._zod.def,h=m6(u.entries);h.every(m=>typeof m=="number")&&(s.type="number"),h.every(m=>typeof m=="string")&&(s.type="string"),s.enum=h},$ge=(e,r,s,o)=>{const u=e._zod.def,h=[];for(const m of u.values)if(m===void 0){if(r.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof m=="bigint"){if(r.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");h.push(Number(m))}else h.push(m);if(h.length!==0)if(h.length===1){const m=h[0];s.type=m===null?"null":typeof m,r.target==="draft-04"||r.target==="openapi-3.0"?s.enum=[m]:s.const=m}else h.every(m=>typeof m=="number")&&(s.type="number"),h.every(m=>typeof m=="string")&&(s.type="string"),h.every(m=>typeof m=="boolean")&&(s.type="boolean"),h.every(m=>m===null)&&(s.type="null"),s.enum=h},Nge=(e,r,s,o)=>{if(r.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Dge=(e,r,s,o)=>{if(r.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Pge=(e,r,s,o)=>{const u=s,h=e._zod.def,{minimum:m,maximum:g}=e._zod.bag;typeof m=="number"&&(u.minItems=m),typeof g=="number"&&(u.maxItems=g),u.type="array",u.items=Zs(h.element,r,{...o,path:[...o.path,"items"]})},Mge=(e,r,s,o)=>{const u=s,h=e._zod.def;u.type="object",u.properties={};const m=h.shape;for(const w in m)u.properties[w]=Zs(m[w],r,{...o,path:[...o.path,"properties",w]});const g=new Set(Object.keys(m)),b=new Set([...g].filter(w=>{const E=h.shape[w]._zod;return r.io==="input"?E.optin===void 0:E.optout===void 0}));b.size>0&&(u.required=Array.from(b)),h.catchall?._zod.def.type==="never"?u.additionalProperties=!1:h.catchall?h.catchall&&(u.additionalProperties=Zs(h.catchall,r,{...o,path:[...o.path,"additionalProperties"]})):r.io==="output"&&(u.additionalProperties=!1)},Ige=(e,r,s,o)=>{const u=e._zod.def,h=u.inclusive===!1,m=u.options.map((g,b)=>Zs(g,r,{...o,path:[...o.path,h?"oneOf":"anyOf",b]}));h?s.oneOf=m:s.anyOf=m},zge=(e,r,s,o)=>{const u=e._zod.def,h=Zs(u.left,r,{...o,path:[...o.path,"allOf",0]}),m=Zs(u.right,r,{...o,path:[...o.path,"allOf",1]}),g=w=>"allOf"in w&&Object.keys(w).length===1,b=[...g(h)?h.allOf:[h],...g(m)?m.allOf:[m]];s.allOf=b},Lge=(e,r,s,o)=>{const u=e._zod.def,h=Zs(u.innerType,r,o),m=r.seen.get(e);r.target==="openapi-3.0"?(m.ref=u.innerType,s.nullable=!0):s.anyOf=[h,{type:"null"}]},Fge=(e,r,s,o)=>{const u=e._zod.def;Zs(u.innerType,r,o);const h=r.seen.get(e);h.ref=u.innerType},qge=(e,r,s,o)=>{const u=e._zod.def;Zs(u.innerType,r,o);const h=r.seen.get(e);h.ref=u.innerType,s.default=JSON.parse(JSON.stringify(u.defaultValue))},Bge=(e,r,s,o)=>{const u=e._zod.def;Zs(u.innerType,r,o);const h=r.seen.get(e);h.ref=u.innerType,r.io==="input"&&(s._prefault=JSON.parse(JSON.stringify(u.defaultValue)))},Uge=(e,r,s,o)=>{const u=e._zod.def;Zs(u.innerType,r,o);const h=r.seen.get(e);h.ref=u.innerType;let m;try{m=u.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}s.default=m},Kge=(e,r,s,o)=>{const u=e._zod.def,h=r.io==="input"?u.in._zod.def.type==="transform"?u.out:u.in:u.out;Zs(h,r,o);const m=r.seen.get(e);m.ref=h},Vge=(e,r,s,o)=>{const u=e._zod.def;Zs(u.innerType,r,o);const h=r.seen.get(e);h.ref=u.innerType,s.readOnly=!0},I6=(e,r,s,o)=>{const u=e._zod.def;Zs(u.innerType,r,o);const h=r.seen.get(e);h.ref=u.innerType};function R3(e,r){try{var s=e()}catch(o){return r(o)}return s&&s.then?s.then(void 0,r):s}function Hge(e,r){for(var s={};e.length;){var o=e[0],u=o.code,h=o.message,m=o.path.join(".");if(!s[m])if("unionErrors"in o){var g=o.unionErrors[0].errors[0];s[m]={message:g.message,type:g.code}}else s[m]={message:h,type:u};if("unionErrors"in o&&o.unionErrors.forEach(function(E){return E.errors.forEach(function(A){return e.push(A)})}),r){var b=s[m].types,w=b&&b[o.code];s[m]=i$(m,r,s,u,w?[].concat(w,o.message):o.message)}e.shift()}return s}function Gge(e,r){for(var s={};e.length;){var o=e[0],u=o.code,h=o.message,m=o.path.join(".");if(!s[m])if(o.code==="invalid_union"&&o.errors.length>0){var g=o.errors[0][0];s[m]={message:g.message,type:g.code}}else s[m]={message:h,type:u};if(o.code==="invalid_union"&&o.errors.forEach(function(E){return E.forEach(function(A){return e.push(A)})}),r){var b=s[m].types,w=b&&b[o.code];s[m]=i$(m,r,s,u,w?[].concat(w,o.message):o.message)}e.shift()}return s}function fr(e,r,s){if(s===void 0&&(s={}),(function(o){return"_def"in o&&typeof o._def=="object"&&"typeName"in o._def})(e))return function(o,u,h){try{return Promise.resolve(R3(function(){return Promise.resolve(e[s.mode==="sync"?"parse":"parseAsync"](o,r)).then(function(m){return h.shouldUseNativeValidation&&C_({},h),{errors:{},values:s.raw?Object.assign({},o):m}})},function(m){if((function(g){return Array.isArray(g?.issues)})(m))return{values:{},errors:d3(Hge(m.errors,!h.shouldUseNativeValidation&&h.criteriaMode==="all"),h)};throw m}))}catch(m){return Promise.reject(m)}};if((function(o){return"_zod"in o&&typeof o._zod=="object"})(e))return function(o,u,h){try{return Promise.resolve(R3(function(){return Promise.resolve((s.mode==="sync"?Bpe:Upe)(e,o,r)).then(function(m){return h.shouldUseNativeValidation&&C_({},h),{errors:{},values:s.raw?Object.assign({},o):m}})},function(m){if((function(g){return g instanceof h$})(m))return{values:{},errors:d3(Gge(m.issues,!h.shouldUseNativeValidation&&h.criteriaMode==="all"),h)};throw m}))}catch(m){return Promise.reject(m)}};throw new Error("Invalid input: not a Zod schema")}const Xge=it("ZodISODateTime",(e,r)=>{Zfe.init(e,r),Fr.init(e,r)});function Yge(e){return ege(Xge,e)}const Zge=it("ZodISODate",(e,r)=>{Jfe.init(e,r),Fr.init(e,r)});function Jge(e){return tge(Zge,e)}const Wge=it("ZodISOTime",(e,r)=>{Wfe.init(e,r),Fr.init(e,r)});function Qge(e){return nge(Wge,e)}const eye=it("ZodISODuration",(e,r)=>{Qfe.init(e,r),Fr.init(e,r)});function tye(e){return rge(eye,e)}const nye=(e,r)=>{h$.init(e,r),e.name="ZodError",Object.defineProperties(e,{format:{value:s=>qpe(e,s)},flatten:{value:s=>Fpe(e,s)},addIssue:{value:s=>{e.issues.push(s),e.message=JSON.stringify(e.issues,A_,2)}},addIssues:{value:s=>{e.issues.push(...s),e.message=JSON.stringify(e.issues,A_,2)}},isEmpty:{get(){return e.issues.length===0}}})},fo=it("ZodError",nye,{Parent:Error}),rye=JC(fo),sye=WC(fo),iye=QC(fo),aye=eA(fo),oye=Hpe(fo),lye=Gpe(fo),cye=Xpe(fo),uye=Ype(fo),dye=Zpe(fo),hye=Jpe(fo),pye=Wpe(fo),fye=Qpe(fo),Xr=it("ZodType",(e,r)=>(Gr.init(e,r),Object.assign(e["~standard"],{jsonSchema:{input:lC(e,"input"),output:lC(e,"output")}}),e.toJSONSchema=jge(e,{}),e.def=r,e.type=r.type,Object.defineProperty(e,"_def",{value:r}),e.check=(...s)=>e.clone(Qd(r,{checks:[...r.checks??[],...s.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),{parent:!0}),e.with=e.check,e.clone=(s,o)=>eh(e,s,o),e.brand=()=>e,e.register=((s,o)=>(s.add(e,o),e)),e.parse=(s,o)=>rye(e,s,o,{callee:e.parse}),e.safeParse=(s,o)=>iye(e,s,o),e.parseAsync=async(s,o)=>sye(e,s,o,{callee:e.parseAsync}),e.safeParseAsync=async(s,o)=>aye(e,s,o),e.spa=e.safeParseAsync,e.encode=(s,o)=>oye(e,s,o),e.decode=(s,o)=>lye(e,s,o),e.encodeAsync=async(s,o)=>cye(e,s,o),e.decodeAsync=async(s,o)=>uye(e,s,o),e.safeEncode=(s,o)=>dye(e,s,o),e.safeDecode=(s,o)=>hye(e,s,o),e.safeEncodeAsync=async(s,o)=>pye(e,s,o),e.safeDecodeAsync=async(s,o)=>fye(e,s,o),e.refine=(s,o)=>e.check(ove(s,o)),e.superRefine=s=>e.check(lve(s)),e.overwrite=s=>e.check(qg(s)),e.optional=()=>D3(e),e.exactOptional=()=>Xye(e),e.nullable=()=>P3(e),e.nullish=()=>D3(P3(e)),e.nonoptional=s=>eve(e,s),e.array=()=>Lye(e),e.or=s=>q6([e,s]),e.and=s=>Uye(e,s),e.transform=s=>M3(e,Hye(s)),e.default=s=>Jye(e,s),e.prefault=s=>Qye(e,s),e.catch=s=>nve(e,s),e.pipe=s=>M3(e,s),e.readonly=()=>ive(e),e.describe=s=>{const o=e.clone();return Rb.add(o,{description:s}),o},Object.defineProperty(e,"description",{get(){return Rb.get(e)?.description},configurable:!0}),e.meta=(...s)=>{if(s.length===0)return Rb.get(e);const o=e.clone();return Rb.add(o,s[0]),o},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=s=>s(e),e)),z6=it("_ZodString",(e,r)=>{p$.init(e,r),Xr.init(e,r),e._zod.processJSONSchema=(o,u,h)=>Age(e,o,u);const s=e._zod.bag;e.format=s.format??null,e.minLength=s.minimum??null,e.maxLength=s.maximum??null,e.regex=(...o)=>e.check(cge(...o)),e.includes=(...o)=>e.check(hge(...o)),e.startsWith=(...o)=>e.check(pge(...o)),e.endsWith=(...o)=>e.check(fge(...o)),e.min=(...o)=>e.check(oC(...o)),e.max=(...o)=>e.check($6(...o)),e.length=(...o)=>e.check(N6(...o)),e.nonempty=(...o)=>e.check(oC(1,...o)),e.lowercase=o=>e.check(uge(o)),e.uppercase=o=>e.check(dge(o)),e.trim=()=>e.check(gge()),e.normalize=(...o)=>e.check(mge(...o)),e.toLowerCase=()=>e.check(yge()),e.toUpperCase=()=>e.check(vge()),e.slugify=()=>e.check(xge())}),mye=it("ZodString",(e,r)=>{p$.init(e,r),z6.init(e,r),e.email=s=>e.check(Dme(gye,s)),e.url=s=>e.check(zme(yye,s)),e.jwt=s=>e.check(Qme($ye,s)),e.emoji=s=>e.check(Lme(vye,s)),e.guid=s=>e.check(C3(T3,s)),e.uuid=s=>e.check(_6(Tb,s)),e.uuidv4=s=>e.check(Pme(Tb,s)),e.uuidv6=s=>e.check(Mme(Tb,s)),e.uuidv7=s=>e.check(Ime(Tb,s)),e.nanoid=s=>e.check(Fme(xye,s)),e.guid=s=>e.check(C3(T3,s)),e.cuid=s=>e.check(qme(bye,s)),e.cuid2=s=>e.check(Bme(wye,s)),e.ulid=s=>e.check(Ume(Sye,s)),e.base64=s=>e.check(Zme(Rye,s)),e.base64url=s=>e.check(Jme(Tye,s)),e.xid=s=>e.check(Kme(Eye,s)),e.ksuid=s=>e.check(Vme(jye,s)),e.ipv4=s=>e.check(Hme(Cye,s)),e.ipv6=s=>e.check(Gme(Aye,s)),e.cidrv4=s=>e.check(Xme(Oye,s)),e.cidrv6=s=>e.check(Yme(kye,s)),e.e164=s=>e.check(Wme(_ye,s)),e.datetime=s=>e.check(Yge(s)),e.date=s=>e.check(Jge(s)),e.time=s=>e.check(Qge(s)),e.duration=s=>e.check(tye(s))});function Sn(e){return Nme(mye,e)}const Fr=it("ZodStringFormat",(e,r)=>{Nr.init(e,r),z6.init(e,r)}),gye=it("ZodEmail",(e,r)=>{qfe.init(e,r),Fr.init(e,r)}),T3=it("ZodGUID",(e,r)=>{Lfe.init(e,r),Fr.init(e,r)}),Tb=it("ZodUUID",(e,r)=>{Ffe.init(e,r),Fr.init(e,r)});function L6(e){return _6(Tb,e)}const yye=it("ZodURL",(e,r)=>{Bfe.init(e,r),Fr.init(e,r)}),vye=it("ZodEmoji",(e,r)=>{Ufe.init(e,r),Fr.init(e,r)}),xye=it("ZodNanoID",(e,r)=>{Kfe.init(e,r),Fr.init(e,r)}),bye=it("ZodCUID",(e,r)=>{Vfe.init(e,r),Fr.init(e,r)}),wye=it("ZodCUID2",(e,r)=>{Hfe.init(e,r),Fr.init(e,r)}),Sye=it("ZodULID",(e,r)=>{Gfe.init(e,r),Fr.init(e,r)}),Eye=it("ZodXID",(e,r)=>{Xfe.init(e,r),Fr.init(e,r)}),jye=it("ZodKSUID",(e,r)=>{Yfe.init(e,r),Fr.init(e,r)}),Cye=it("ZodIPv4",(e,r)=>{eme.init(e,r),Fr.init(e,r)}),Aye=it("ZodIPv6",(e,r)=>{tme.init(e,r),Fr.init(e,r)}),Oye=it("ZodCIDRv4",(e,r)=>{nme.init(e,r),Fr.init(e,r)}),kye=it("ZodCIDRv6",(e,r)=>{rme.init(e,r),Fr.init(e,r)}),Rye=it("ZodBase64",(e,r)=>{sme.init(e,r),Fr.init(e,r)}),Tye=it("ZodBase64URL",(e,r)=>{ame.init(e,r),Fr.init(e,r)}),_ye=it("ZodE164",(e,r)=>{ome.init(e,r),Fr.init(e,r)}),$ye=it("ZodJWT",(e,r)=>{cme.init(e,r),Fr.init(e,r)}),F6=it("ZodNumber",(e,r)=>{O6.init(e,r),Xr.init(e,r),e._zod.processJSONSchema=(o,u,h)=>Oge(e,o,u),e.gt=(o,u)=>e.check(O3(o,u)),e.gte=(o,u)=>e.check(jT(o,u)),e.min=(o,u)=>e.check(jT(o,u)),e.lt=(o,u)=>e.check(A3(o,u)),e.lte=(o,u)=>e.check(ET(o,u)),e.max=(o,u)=>e.check(ET(o,u)),e.int=o=>e.check(_3(o)),e.safe=o=>e.check(_3(o)),e.positive=o=>e.check(O3(0,o)),e.nonnegative=o=>e.check(jT(0,o)),e.negative=o=>e.check(A3(0,o)),e.nonpositive=o=>e.check(ET(0,o)),e.multipleOf=(o,u)=>e.check(k3(o,u)),e.step=(o,u)=>e.check(k3(o,u)),e.finite=()=>e;const s=e._zod.bag;e.minValue=Math.max(s.minimum??Number.NEGATIVE_INFINITY,s.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(s.maximum??Number.POSITIVE_INFINITY,s.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(s.format??"").includes("int")||Number.isSafeInteger(s.multipleOf??.5),e.isFinite=!0,e.format=s.format??null});function tw(e){return sge(F6,e)}const Nye=it("ZodNumberFormat",(e,r)=>{ume.init(e,r),F6.init(e,r)});function _3(e){return ige(Nye,e)}const Dye=it("ZodAny",(e,r)=>{dme.init(e,r),Xr.init(e,r),e._zod.processJSONSchema=(s,o,u)=>Rge()});function $3(){return age(Dye)}const Pye=it("ZodUnknown",(e,r)=>{hme.init(e,r),Xr.init(e,r),e._zod.processJSONSchema=(s,o,u)=>Tge()});function N3(){return oge(Pye)}const Mye=it("ZodNever",(e,r)=>{pme.init(e,r),Xr.init(e,r),e._zod.processJSONSchema=(s,o,u)=>kge(e,s,o)});function Iye(e){return lge(Mye,e)}const zye=it("ZodArray",(e,r)=>{fme.init(e,r),Xr.init(e,r),e._zod.processJSONSchema=(s,o,u)=>Pge(e,s,o,u),e.element=r.element,e.min=(s,o)=>e.check(oC(s,o)),e.nonempty=s=>e.check(oC(1,s)),e.max=(s,o)=>e.check($6(s,o)),e.length=(s,o)=>e.check(N6(s,o)),e.unwrap=()=>e.element});function Lye(e,r){return bge(zye,e,r)}const Fye=it("ZodObject",(e,r)=>{gme.init(e,r),Xr.init(e,r),e._zod.processJSONSchema=(s,o,u)=>Mge(e,s,o,u),pr(e,"shape",()=>r.shape),e.keyof=()=>Fa(Object.keys(e._zod.def.shape)),e.catchall=s=>e.clone({...e._zod.def,catchall:s}),e.passthrough=()=>e.clone({...e._zod.def,catchall:N3()}),e.loose=()=>e.clone({...e._zod.def,catchall:N3()}),e.strict=()=>e.clone({...e._zod.def,catchall:Iye()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=s=>Ppe(e,s),e.safeExtend=s=>Mpe(e,s),e.merge=s=>Ipe(e,s),e.pick=s=>Npe(e,s),e.omit=s=>Dpe(e,s),e.partial=(...s)=>zpe(B6,e,s[0]),e.required=(...s)=>Lpe(U6,e,s[0])});function Is(e,r){const s={type:"object",shape:e??{},...Jt(r)};return new Fye(s)}const qye=it("ZodUnion",(e,r)=>{yme.init(e,r),Xr.init(e,r),e._zod.processJSONSchema=(s,o,u)=>Ige(e,s,o,u),e.options=r.options});function q6(e,r){return new qye({type:"union",options:e,...Jt(r)})}const Bye=it("ZodIntersection",(e,r)=>{vme.init(e,r),Xr.init(e,r),e._zod.processJSONSchema=(s,o,u)=>zge(e,s,o,u)});function Uye(e,r){return new Bye({type:"intersection",left:e,right:r})}const k_=it("ZodEnum",(e,r)=>{xme.init(e,r),Xr.init(e,r),e._zod.processJSONSchema=(o,u,h)=>_ge(e,o,u),e.enum=r.entries,e.options=Object.values(r.entries);const s=new Set(Object.keys(r.entries));e.extract=(o,u)=>{const h={};for(const m of o)if(s.has(m))h[m]=r.entries[m];else throw new Error(`Key ${m} not found in enum`);return new k_({...r,checks:[],...Jt(u),entries:h})},e.exclude=(o,u)=>{const h={...r.entries};for(const m of o)if(s.has(m))delete h[m];else throw new Error(`Key ${m} not found in enum`);return new k_({...r,checks:[],...Jt(u),entries:h})}});function Fa(e,r){const s=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new k_({type:"enum",entries:s,...Jt(r)})}const Kye=it("ZodLiteral",(e,r)=>{bme.init(e,r),Xr.init(e,r),e._zod.processJSONSchema=(s,o,u)=>$ge(e,s,o),e.values=new Set(r.values),Object.defineProperty(e,"value",{get(){if(r.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return r.values[0]}})});function nw(e,r){return new Kye({type:"literal",values:Array.isArray(e)?e:[e],...Jt(r)})}const Vye=it("ZodTransform",(e,r)=>{wme.init(e,r),Xr.init(e,r),e._zod.processJSONSchema=(s,o,u)=>Dge(e,s),e._zod.parse=(s,o)=>{if(o.direction==="backward")throw new p6(e.constructor.name);s.addIssue=h=>{if(typeof h=="string")s.issues.push(ew(h,s.value,r));else{const m=h;m.fatal&&(m.continue=!1),m.code??(m.code="custom"),m.input??(m.input=s.value),m.inst??(m.inst=e),s.issues.push(ew(m))}};const u=r.transform(s.value,s);return u instanceof Promise?u.then(h=>(s.value=h,s)):(s.value=u,s)}});function Hye(e){return new Vye({type:"transform",transform:e})}const B6=it("ZodOptional",(e,r)=>{T6.init(e,r),Xr.init(e,r),e._zod.processJSONSchema=(s,o,u)=>I6(e,s,o,u),e.unwrap=()=>e._zod.def.innerType});function D3(e){return new B6({type:"optional",innerType:e})}const Gye=it("ZodExactOptional",(e,r)=>{Sme.init(e,r),Xr.init(e,r),e._zod.processJSONSchema=(s,o,u)=>I6(e,s,o,u),e.unwrap=()=>e._zod.def.innerType});function Xye(e){return new Gye({type:"optional",innerType:e})}const Yye=it("ZodNullable",(e,r)=>{Eme.init(e,r),Xr.init(e,r),e._zod.processJSONSchema=(s,o,u)=>Lge(e,s,o,u),e.unwrap=()=>e._zod.def.innerType});function P3(e){return new Yye({type:"nullable",innerType:e})}const Zye=it("ZodDefault",(e,r)=>{jme.init(e,r),Xr.init(e,r),e._zod.processJSONSchema=(s,o,u)=>qge(e,s,o,u),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Jye(e,r){return new Zye({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():y6(r)}})}const Wye=it("ZodPrefault",(e,r)=>{Cme.init(e,r),Xr.init(e,r),e._zod.processJSONSchema=(s,o,u)=>Bge(e,s,o,u),e.unwrap=()=>e._zod.def.innerType});function Qye(e,r){return new Wye({type:"prefault",innerType:e,get defaultValue(){return typeof r=="function"?r():y6(r)}})}const U6=it("ZodNonOptional",(e,r)=>{Ame.init(e,r),Xr.init(e,r),e._zod.processJSONSchema=(s,o,u)=>Fge(e,s,o,u),e.unwrap=()=>e._zod.def.innerType});function eve(e,r){return new U6({type:"nonoptional",innerType:e,...Jt(r)})}const tve=it("ZodCatch",(e,r)=>{Ome.init(e,r),Xr.init(e,r),e._zod.processJSONSchema=(s,o,u)=>Uge(e,s,o,u),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function nve(e,r){return new tve({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}const rve=it("ZodPipe",(e,r)=>{kme.init(e,r),Xr.init(e,r),e._zod.processJSONSchema=(s,o,u)=>Kge(e,s,o,u),e.in=r.in,e.out=r.out});function M3(e,r){return new rve({type:"pipe",in:e,out:r})}const sve=it("ZodReadonly",(e,r)=>{Rme.init(e,r),Xr.init(e,r),e._zod.processJSONSchema=(s,o,u)=>Vge(e,s,o,u),e.unwrap=()=>e._zod.def.innerType});function ive(e){return new sve({type:"readonly",innerType:e})}const ave=it("ZodCustom",(e,r)=>{Tme.init(e,r),Xr.init(e,r),e._zod.processJSONSchema=(s,o,u)=>Nge(e,s)});function ove(e,r={}){return wge(ave,e,r)}function lve(e){return Sge(e)}const Md={custom:"custom"};var cve=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],uve=cve.reduce((e,r)=>{const s=iw(`Primitive.${r}`),o=T.forwardRef((u,h)=>{const{asChild:m,...g}=u,b=m?s:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(b,{...g,ref:h})});return o.displayName=`Primitive.${r}`,{...e,[r]:o}},{}),dve="Label",K6=T.forwardRef((e,r)=>c.jsx(uve.label,{...e,ref:r,onMouseDown:s=>{s.target.closest("button, input, select, textarea")||(e.onMouseDown?.(s),!s.defaultPrevented&&s.detail>1&&s.preventDefault())}}));K6.displayName=dve;var hve=K6;function Gs({className:e,...r}){return c.jsx(hve,{"data-slot":"label",className:vt("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),...r})}const mr=upe,V6=T.createContext({}),ft=({...e})=>c.jsx(V6.Provider,{value:{name:e.name},children:c.jsx(Zo,{...e})}),f$=()=>{const e=T.useContext(V6),r=T.useContext(H6),{getFieldState:s}=YC(),o=a6({name:e.name}),u=s(e.name,o);if(!e)throw new Error("useFormField should be used within ");const{id:h}=r;return{id:h,name:e.name,formItemId:`${h}-form-item`,formDescriptionId:`${h}-form-item-description`,formMessageId:`${h}-form-item-message`,...u}},H6=T.createContext({});function ot({className:e,...r}){const s=T.useId();return c.jsx(H6.Provider,{value:{id:s},children:c.jsx("div",{"data-slot":"form-item",className:vt("grid gap-2",e),...r})})}function lt({className:e,...r}){const{error:s,formItemId:o}=f$();return c.jsx(Gs,{"data-slot":"form-label","data-error":!!s,className:vt("data-[error=true]:text-destructive",e),htmlFor:o,...r})}function bt({...e}){const{error:r,formItemId:s,formDescriptionId:o,formMessageId:u}=f$();return c.jsx(Tg,{"data-slot":"form-control",id:s,"aria-describedby":r?`${o} ${u}`:`${o}`,"aria-invalid":!!r,...e})}function pt({className:e,...r}){const{error:s,formMessageId:o}=f$(),u=s?String(s?.message??""):r.children;return u?c.jsx("p",{"data-slot":"form-message",id:o,className:vt("text-destructive text-sm",e),...r,children:u}):null}function Js({className:e,...r}){return c.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:c.jsx("table",{"data-slot":"table",className:vt("w-full caption-bottom text-sm",e),...r})})}function Ws({className:e,...r}){return c.jsx("thead",{"data-slot":"table-header",className:vt("[&_tr]:border-b",e),...r})}function Qs({className:e,...r}){return c.jsx("tbody",{"data-slot":"table-body",className:vt("[&_tr:last-child]:border-0",e),...r})}function Qt({className:e,...r}){return c.jsx("tr",{"data-slot":"table-row",className:vt("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...r})}function St({className:e,...r}){return c.jsx("th",{"data-slot":"table-head",className:vt("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),...r})}function dt({className:e,...r}){return c.jsx("td",{"data-slot":"table-cell",className:vt("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...r})}function pve({className:e,...r}){return c.jsx("caption",{"data-slot":"table-caption",className:vt("text-muted-foreground mt-4 text-sm",e),...r})}function nl({className:e,...r}){return c.jsx("textarea",{"data-slot":"textarea",className:vt("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),...r})}const G6=Is({label:Sn().trim().min(1,"Label is required").max(255,"Max 255 chars"),description:Sn().trim().min(1,"Description is required"),make_target:Sn().trim().min(1,"Make target is required").max(255,"Max 255 chars").regex(/^[a-zA-Z0-9][a-zA-Z0-9._-]{0,63}$/,"Invalid make target (allowed: a-z A-Z 0-9 . _ -)")}),fve=G6.partial();function mve({target:e}){return e?c.jsx(rr,{variant:"secondary",className:"font-mono text-xs",children:e}):c.jsx(rr,{variant:"outline",className:"text-xs",children:"—"})}const gve=()=>{const e=Ms(),[r,s]=T.useState(""),[o,u]=T.useState(!1),[h,m]=T.useState(!1),[g,b]=T.useState(null),[w,E]=T.useState(null),A=Un({queryKey:["admin-actions"],queryFn:()=>kb.listActions()}),k=T.useMemo(()=>{const K=A.data??[],z=r.trim().toLowerCase();return z?K.filter(W=>(W.label??"").toLowerCase().includes(z)||(W.description??"").toLowerCase().includes(z)||(W.make_target??"").toLowerCase().includes(z)):K},[r,A.data]),R=hr({resolver:fr(G6),defaultValues:{label:"",description:"",make_target:""}}),M=Wt({mutationFn:K=>kb.createAction(K),onSuccess:async()=>{await e.invalidateQueries({queryKey:["admin-actions"]}),R.reset(),u(!1),Ge.success("Action created.")},onError:K=>{Ge.error(K?.message??"Failed to create action.")}}),I=hr({resolver:fr(fve),defaultValues:{}}),F=Wt({mutationFn:({id:K,values:z})=>kb.updateAction(K,z),onSuccess:async()=>{await e.invalidateQueries({queryKey:["admin-actions"]}),I.reset(),m(!1),E(null),Ge.success("Action updated.")},onError:K=>{Ge.error(K?.message??"Failed to update action.")}}),H=K=>{K.id&&(E(K),I.reset({label:K.label??"",description:K.description??"",make_target:K.make_target??""}),m(!0))},V=Wt({mutationFn:K=>kb.deleteAction(K),onSuccess:async()=>{await e.invalidateQueries({queryKey:["admin-actions"]}),b(null),Ge.success("Action deleted.")},onError:K=>{Ge.error(K?.message??"Failed to delete action.")}});return A.isLoading?c.jsx("div",{className:"p-6",children:"Loading actions…"}):A.error?c.jsx("div",{className:"p-6 text-red-500",children:"Error loading actions."}):c.jsxs("div",{className:"space-y-4 p-6",children:[c.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[c.jsx("h1",{className:"text-2xl font-bold",children:"Admin Actions"}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsxs("div",{className:"relative",children:[c.jsx(va,{className:"absolute top-2.5 left-2 h-4 w-4 opacity-60"}),c.jsx(mt,{value:r,onChange:K=>s(K.target.value),placeholder:"Search actions",className:"w-72 pl-8"})]}),c.jsxs(dn,{open:o,onOpenChange:u,children:[c.jsx(Ai,{asChild:!0,children:c.jsxs(Pe,{onClick:()=>u(!0),children:[c.jsx(qa,{className:"mr-2 h-4 w-4"}),"Create Action"]})}),c.jsxs(hn,{className:"sm:max-w-lg",children:[c.jsx(pn,{children:c.jsx(fn,{children:"Create Action"})}),c.jsx(mr,{...R,children:c.jsxs("form",{className:"space-y-4",onSubmit:R.handleSubmit(K=>M.mutate(K)),children:[c.jsx(ft,{control:R.control,name:"label",render:({field:K})=>c.jsxs(ot,{children:[c.jsx(lt,{children:"Label"}),c.jsx(bt,{children:c.jsx(mt,{placeholder:"Setup",...K})}),c.jsx(pt,{})]})}),c.jsx(ft,{control:R.control,name:"make_target",render:({field:K})=>c.jsxs(ot,{children:[c.jsx(lt,{children:"Make Target"}),c.jsx(bt,{children:c.jsx(mt,{placeholder:"setup",className:"font-mono",...K})}),c.jsx(pt,{})]})}),c.jsx(ft,{control:R.control,name:"description",render:({field:K})=>c.jsxs(ot,{children:[c.jsx(lt,{children:"Description"}),c.jsx(bt,{children:c.jsx(nl,{rows:4,placeholder:"Runs prepare, ping-servers, then make setup on the bastion.",...K})}),c.jsx(pt,{})]})}),c.jsxs(gn,{className:"gap-2",children:[c.jsx(Pe,{type:"button",variant:"outline",onClick:()=>u(!1),children:"Cancel"}),c.jsx(Pe,{type:"submit",disabled:M.isPending,children:M.isPending?"Creating…":"Create"})]})]})})]})]})]})]}),c.jsx("div",{className:"bg-background overflow-hidden rounded-2xl border shadow-sm",children:c.jsx("div",{className:"overflow-x-auto",children:c.jsxs(Js,{children:[c.jsx(Ws,{children:c.jsxs(Qt,{children:[c.jsx(St,{children:"Label"}),c.jsx(St,{children:"Make Target"}),c.jsx(St,{children:"Description"}),c.jsx(St,{className:"w-[260px] text-right",children:"Actions"})]})}),c.jsxs(Qs,{children:[k.map(K=>c.jsxs(Qt,{children:[c.jsx(dt,{className:"font-medium",children:K.label}),c.jsx(dt,{children:c.jsx(mve,{target:K.make_target})}),c.jsx(dt,{className:"text-muted-foreground max-w-[680px] truncate",children:K.description}),c.jsx(dt,{children:c.jsxs("div",{className:"flex justify-end gap-2",children:[c.jsxs(Pe,{variant:"outline",size:"sm",onClick:()=>H(K),children:[c.jsx(uc,{className:"mr-2 h-4 w-4"}),"Edit"]}),c.jsxs(Pe,{variant:"destructive",size:"sm",onClick:()=>K.id&&b(K.id),disabled:V.isPending&&g===K.id,children:[c.jsx(wg,{className:"mr-2 h-4 w-4"}),V.isPending&&g===K.id?"Deleting…":"Delete"]})]})})]},K.id)),k.length===0&&c.jsx(Qt,{children:c.jsxs(dt,{colSpan:4,className:"text-muted-foreground py-10 text-center",children:[c.jsx(Rg,{className:"mx-auto mb-2 h-6 w-6 opacity-60"}),"No actions match your search."]})})]})]})})}),c.jsx(dn,{open:h,onOpenChange:K=>{m(K),K||E(null)},children:c.jsxs(hn,{className:"sm:max-w-lg",children:[c.jsx(pn,{children:c.jsx(fn,{children:"Edit Action"})}),w?c.jsx(mr,{...I,children:c.jsxs("form",{className:"space-y-4",onSubmit:I.handleSubmit(K=>{w.id&&F.mutate({id:w.id,values:K})}),children:[c.jsx(ft,{control:I.control,name:"label",render:({field:K})=>c.jsxs(ot,{children:[c.jsx(lt,{children:"Label"}),c.jsx(bt,{children:c.jsx(mt,{...K})}),c.jsx(pt,{})]})}),c.jsx(ft,{control:I.control,name:"make_target",render:({field:K})=>c.jsxs(ot,{children:[c.jsx(lt,{children:"Make Target"}),c.jsx(bt,{children:c.jsx(mt,{className:"font-mono",...K})}),c.jsx(pt,{})]})}),c.jsx(ft,{control:I.control,name:"description",render:({field:K})=>c.jsxs(ot,{children:[c.jsx(lt,{children:"Description"}),c.jsx(bt,{children:c.jsx(nl,{rows:4,...K})}),c.jsx(pt,{})]})}),c.jsxs(gn,{className:"gap-2",children:[c.jsx(Pe,{type:"button",variant:"outline",onClick:()=>m(!1),children:"Cancel"}),c.jsx(Pe,{type:"submit",disabled:F.isPending,children:F.isPending?c.jsxs("span",{className:"inline-flex items-center gap-2",children:[c.jsx(ys,{className:"h-4 w-4 animate-spin"}),"Saving…"]}):"Save changes"})]})]})}):c.jsx("div",{className:"text-muted-foreground text-sm",children:"No action selected."})]})}),c.jsx(dn,{open:!!g,onOpenChange:K=>!K&&b(null),children:c.jsxs(hn,{className:"sm:max-w-md",children:[c.jsx(pn,{children:c.jsx(fn,{children:"Delete action"})}),c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx(Dj,{className:"mt-0.5 h-5 w-5 text-red-500"}),c.jsx("p",{className:"text-muted-foreground text-sm",children:"This action cannot be undone. Are you sure you want to delete it?"})]}),c.jsxs(gn,{className:"gap-2",children:[c.jsx(Pe,{variant:"outline",onClick:()=>b(null),children:"Cancel"}),c.jsx(Pe,{variant:"destructive",onClick:()=>g&&V.mutate(g),disabled:V.isPending,children:V.isPending?"Deleting…":"Delete"})]})]})})]})},pb=Tte(),_b={listAnnotations:()=>ct(async()=>await pb.listAnnotations()),createAnnotation:e=>ct(async()=>await pb.createAnnotation({dtoCreateAnnotationRequest:e})),getAnnotation:e=>ct(async()=>await pb.getAnnotation({id:e})),deleteAnnotation:e=>ct(async()=>{await pb.deleteAnnotation({id:e})}),updateAnnotation:(e,r)=>ct(async()=>await pb.updateAnnotation({id:e,dtoUpdateAnnotationRequest:r}))},X6=Is({key:Sn().trim().min(1,"Key is required").max(120,"Max 120 chars"),value:Sn().trim().optional()}),yve=X6.partial();function vve({t:e}){const r=`${e.key}${e.value?`=${e.value}`:""}`;return c.jsxs(rr,{variant:"secondary",className:"font-mono text-xs",children:[c.jsx(jC,{className:"mr-1 h-3 w-3"}),r]})}const xve=()=>{const[e,r]=T.useState(""),[s,o]=T.useState(!1),[u,h]=T.useState(!1),[m,g]=T.useState(null),[b,w]=T.useState(null),E=Ms(),A=Un({queryKey:["annotations"],queryFn:()=>_b.listAnnotations()}),k=hr({resolver:fr(X6),defaultValues:{key:"",value:""}}),R=Wt({mutationFn:z=>_b.createAnnotation(z),onSuccess:async()=>{await E.invalidateQueries({queryKey:["annotations"]}),k.reset(),o(!1),Ge.success("Annotation Created Successfully.")},onError:z=>{Ge.error(z.message??"There was an error while creating Annotation")}}),M=z=>{R.mutate(z)},I=hr({resolver:fr(yve),defaultValues:{}}),F=Wt({mutationFn:({id:z,values:W})=>_b.updateAnnotation(z,W),onSuccess:async()=>{await E.invalidateQueries({queryKey:["annotations"]}),I.reset(),h(!1),Ge.success("Annotation Updated Successfully.")},onError:z=>{Ge.error(z.message??"There was an error while updating Annotation")}}),H=z=>{w(z.id),I.reset({key:z.key,value:z.value}),h(!0)},V=Wt({mutationFn:z=>_b.deleteAnnotation(z),onSuccess:async()=>{await E.invalidateQueries({queryKey:["annotations"]}),g(null),Ge.success("Annotation Deleted Successfully.")},onError:z=>{Ge.error(z.message??"There was an error while deleting Annotation")}}),K=T.useMemo(()=>{const z=A.data??[],W=e.trim().toLowerCase();return W?z.filter(ae=>ae.key?.toLowerCase().includes(W)||ae.value?.toLowerCase().includes(W)):z},[e,A.data]);return A.isLoading?c.jsx("div",{className:"p-6",children:"Loading annotations…"}):A.error?c.jsxs("div",{className:"p-6 text-red-500",children:["Error loading annotations.",c.jsx("pre",{children:JSON.stringify(A,null,2)})]}):c.jsxs("div",{className:"space-y-4 p-6",children:[c.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[c.jsx("h1",{className:"mb-4 text-2xl font-bold",children:"Annotations"}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsxs("div",{className:"relative",children:[c.jsx(va,{className:"absolute top-2.5 left-2 h-4 w-4 opacity-60"}),c.jsx(mt,{value:e,onChange:z=>r(z.target.value),placeholder:"Search annotations",className:"w-64 pl-8"})]}),c.jsxs(dn,{open:s,onOpenChange:o,children:[c.jsx(Ai,{asChild:!0,children:c.jsxs(Pe,{onClick:()=>o(!0),children:[c.jsx(qa,{className:"mr-2 h-4 w-4"}),"Create Annotation"]})}),c.jsxs(hn,{className:"sm:max-w-lg",children:[c.jsx(pn,{children:c.jsx(fn,{children:"Create Label"})}),c.jsx(mr,{...k,children:c.jsxs("form",{className:"space-y-4",onSubmit:k.handleSubmit(M),children:[c.jsx(ft,{control:k.control,name:"key",render:({field:z})=>c.jsxs(ot,{children:[c.jsx(lt,{children:"Key"}),c.jsx(bt,{children:c.jsx(mt,{placeholder:"environment",...z})}),c.jsx(pt,{})]})}),c.jsx(ft,{control:k.control,name:"value",render:({field:z})=>c.jsxs(ot,{children:[c.jsx(lt,{children:"Value"}),c.jsx(bt,{children:c.jsx(mt,{placeholder:"dev",...z})}),c.jsx(pt,{})]})}),c.jsxs(gn,{className:"gap-2",children:[c.jsx(Pe,{type:"button",variant:"outline",onClick:()=>o(!1),children:"Cancel"}),c.jsx(Pe,{type:"submit",disabled:k.formState.isSubmitting,children:k.formState.isSubmitting?"Creating…":"Create"})]})]})})]})]})]})]}),c.jsx("div",{className:"bg-background overflow-hidden rounded-2xl border shadow-sm",children:c.jsx("div",{className:"overflow-x-auto",children:c.jsxs(Js,{children:[c.jsx(Ws,{children:c.jsxs(Qt,{children:[c.jsx(St,{children:"Key"}),c.jsx(St,{children:"Value"}),c.jsx(St,{children:"Annotation"}),c.jsx(St,{className:"w-[180px] text-right",children:"Actions"})]})}),c.jsxs(Qs,{children:[K.map(z=>c.jsxs(Qt,{children:[c.jsx(dt,{children:z.key}),c.jsx(dt,{children:z.value}),c.jsx(dt,{children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(vve,{t:z}),c.jsx("code",{className:"text-muted-foreground text-xs",children:za(z.id,6)})]})}),c.jsx(dt,{children:c.jsxs("div",{className:"flex justify-end gap-2",children:[c.jsxs(Pe,{variant:"outline",size:"sm",onClick:()=>H(z),children:[c.jsx(uc,{className:"mr-2 h-4 w-4"})," Edit"]}),c.jsx(Pe,{variant:"destructive",size:"sm",onClick:()=>g(z.id),disabled:V.isPending&&m===z.id,children:V.isPending&&m===z.id?"Deleting…":"Delete"})]})})]},z.id)),K.length===0&&c.jsx(Qt,{children:c.jsxs(dt,{colSpan:4,className:"text-muted-foreground py-10 text-center",children:[c.jsx(Rg,{className:"mx-auto mb-2 h-6 w-6 opacity-60"}),"No labels match your search."]})})]})]})})}),c.jsx(dn,{open:u,onOpenChange:h,children:c.jsxs(hn,{className:"sm:max-w-lg",children:[c.jsx(pn,{children:c.jsx(fn,{children:"Edit Annotation"})}),c.jsx(mr,{...I,children:c.jsxs("form",{className:"space-y-4",onSubmit:I.handleSubmit(z=>{b&&F.mutate({id:b,values:z})}),children:[c.jsx(ft,{control:I.control,name:"key",render:({field:z})=>c.jsxs(ot,{children:[c.jsx(lt,{children:"Key"}),c.jsx(bt,{children:c.jsx(mt,{placeholder:"dedicated",...z})}),c.jsx(pt,{})]})}),c.jsx(ft,{control:I.control,name:"value",render:({field:z})=>c.jsxs(ot,{children:[c.jsx(lt,{children:"Value (optional)"}),c.jsx(bt,{children:c.jsx(mt,{placeholder:"gpu",...z})}),c.jsx(pt,{})]})}),c.jsxs(gn,{className:"gap-2",children:[c.jsx(Pe,{type:"button",variant:"outline",onClick:()=>h(!1),children:"Cancel"}),c.jsx(Pe,{type:"submit",disabled:F.isPending,children:F.isPending?"Saving…":"Save changes"})]})]})})]})}),c.jsx(dn,{open:!!m,onOpenChange:z=>!z&&g(null),children:c.jsxs(hn,{className:"sm:max-w-md",children:[c.jsx(pn,{children:c.jsx(fn,{children:"Delete annotation"})}),c.jsx("p",{className:"text-muted-foreground text-sm",children:"This action cannot be undone. Are you sure you want to delete this annotation?"}),c.jsxs(gn,{className:"gap-2",children:[c.jsx(Pe,{variant:"outline",onClick:()=>g(null),children:"Cancel"}),c.jsx(Pe,{variant:"destructive",onClick:()=>m&&V.mutate(m),disabled:V.isPending,children:V.isPending?"Deleting…":"Delete"})]})]})})]})},js=Mte(),CT=zte(),rs={listClusters:e=>ct(async()=>await js.listClusters(e?{q:e}:{})),getCluster:e=>ct(async()=>await js.getCluster({clusterID:e})),createCluster:e=>ct(async()=>await js.createCluster({dtoCreateClusterRequest:e})),updateCluster:(e,r)=>ct(async()=>await js.updateCluster({clusterID:e,dtoUpdateClusterRequest:r})),deleteCluster:e=>ct(async()=>await js.deleteCluster({clusterID:e})),setKubeconfig:(e,r)=>ct(async()=>await js.setClusterKubeconfig({clusterID:e,dtoSetKubeconfigRequest:r})),clearKubeconfig:e=>ct(async()=>await js.clearClusterKubeconfig({clusterID:e})),attachCaptainDomain:(e,r)=>ct(async()=>await js.attachCaptainDomain({clusterID:e,dtoAttachCaptainDomainRequest:r})),detachCaptainDomain:e=>ct(async()=>await js.detachCaptainDomain({clusterID:e})),attachControlPlaneRecordSet:(e,r)=>ct(async()=>await js.attachControlPlaneRecordSet({clusterID:e,dtoAttachRecordSetRequest:r})),detachControlPlaneRecordSet:e=>ct(async()=>await js.detachControlPlaneRecordSet({clusterID:e})),attachAppsLoadBalancer:(e,r)=>ct(async()=>await js.attachAppsLoadBalancer({clusterID:e,dtoAttachLoadBalancerRequest:r})),detachAppsLoadBalancer:e=>ct(async()=>await js.detachAppsLoadBalancer({clusterID:e})),attachGlueOpsLoadBalancer:(e,r)=>ct(async()=>await js.attachGlueOpsLoadBalancer({clusterID:e,dtoAttachLoadBalancerRequest:r})),detachGlueOpsLoadBalancer:e=>ct(async()=>await js.detachGlueOpsLoadBalancer({clusterID:e})),attachBastion:(e,r)=>ct(async()=>await js.attachBastionServer({clusterID:e,dtoAttachBastionRequest:r})),detachBastion:e=>ct(async()=>await js.detachBastionServer({clusterID:e})),attachNodePool:(e,r)=>ct(async()=>await js.attachNodePool({clusterID:e,dtoAttachNodePoolRequest:{node_pool_id:r}})),detachNodePool:(e,r)=>ct(async()=>await js.detachNodePool({clusterID:e,nodePoolID:r})),listClusterRuns:e=>ct(async()=>await CT.listClusterRuns({clusterID:e})),getClusterRun:(e,r)=>ct(async()=>await CT.getClusterRun({clusterID:e,runID:r})),runClusterAction:(e,r)=>ct(async()=>await CT.runClusterAction({clusterID:e,actionID:r}))},fu=Dte(),sc={listDomains:()=>ct(async()=>await fu.listDomains()),getDomain:e=>ct(async()=>await fu.getDomain({id:e})),createDomain:async e=>ct(async()=>await fu.createDomain({dtoCreateDomainRequest:e})),updateDomain:async(e,r)=>ct(async()=>await fu.updateDomain({id:e,dtoUpdateDomainRequest:r})),deleteDomain:async e=>ct(async()=>await fu.deleteDomain({id:e})),listRecordSetsByDomain:async e=>ct(async()=>await fu.listRecordSets({domainId:e})),createRecordSetsByDomain:async(e,r)=>ct(async()=>await fu.createRecordSet({domainId:e,dtoCreateRecordSetRequest:r})),updateRecordSetsByDomain:async(e,r)=>ct(async()=>await fu.updateRecordSet({id:e,dtoUpdateRecordSetRequest:r})),deleteRecordSetsByDomain:async e=>ct(async()=>await fu.deleteRecordSet({id:e}))},fb=Pte(),$b={listLoadBalancers:()=>ct(async()=>await fb.listLoadBalancers()),getLoadBalancer:e=>ct(async()=>await fb.getLoadBalancers({id:e})),createLoadBalancer:e=>ct(async()=>await fb.createLoadBalancer({dtoCreateLoadBalancerRequest:e})),updateLoadBalancer:(e,r)=>ct(async()=>await fb.updateLoadBalancer({id:e,dtoUpdateLoadBalancerRequest:r})),deleteLoadBalancer:e=>ct(async()=>await fb.deleteLoadBalancer({id:e}))},Vs=$te(),bve=(e,r)=>e?e===r:!0,Na={listNodePools:()=>ct(async()=>await Vs.listNodePools({})),createNodePool:e=>ct(async()=>await Vs.createNodePool({dtoCreateNodePoolRequest:e})),getNodePool:e=>ct(async()=>await Vs.getNodePool({id:e})),deleteNodePool:e=>ct(async()=>{await Vs.deleteNodePool({id:e})}),updateNodePool:(e,r)=>ct(async()=>await Vs.updateNodePool({id:e,dtoUpdateNodePoolRequest:r})),listNodePoolServers:e=>ct(async()=>await Vs.listNodePoolServers({id:e})),attachNodePoolServer:(e,r)=>ct(async()=>await Vs.attachNodePoolServers({id:e,dtoAttachServersRequest:r})),detachNodePoolServers:(e,r)=>ct(async()=>await Vs.detachNodePoolServer({id:e,serverId:r})),listNodePoolTaints:e=>ct(async()=>await Vs.listNodePoolTaints({id:e})),attachNodePoolTaints:(e,r)=>ct(async()=>await Vs.attachNodePoolTaints({id:e,dtoAttachTaintsRequest:r})),detachNodePoolTaints:(e,r)=>ct(async()=>await Vs.detachNodePoolTaint({id:e,taintId:r})),listNodePoolLabels:e=>ct(async()=>await Vs.listNodePoolLabels({id:e})),attachNodePoolLabels:(e,r)=>ct(async()=>await Vs.attachNodePoolLabels({id:e,dtoAttachLabelsRequest:r})),detachNodePoolLabels:(e,r)=>ct(async()=>await Vs.detachNodePoolLabel({id:e,labelId:r})),listNodePoolAnnotations:e=>ct(async()=>await Vs.listNodePoolAnnotations({id:e})),attachNodePoolAnnotations:(e,r)=>ct(async()=>await Vs.attachNodePoolAnnotations({id:e,dtoAttachAnnotationsRequest:r})),detachNodePoolAnnotations:(e,r)=>ct(async()=>await Vs.detachNodePoolAnnotation({id:e,annotationId:r}))},mb=Ote(),mg={listServers:()=>ct(async()=>await mb.listServers()),createServer:e=>ct(async()=>await mb.createServer({dtoCreateServerRequest:e})),getServer:e=>ct(async()=>await mb.getServer({id:e})),updateServer:(e,r)=>ct(async()=>await mb.updateServer({id:e,dtoUpdateServerRequest:r})),deleteServer:e=>ct(async()=>{await mb.deleteServer({id:e})})};function I3(e,[r,s]){return Math.min(s,Math.max(r,e))}function z3(e){const r=wve(e),s=T.forwardRef((o,u)=>{const{children:h,...m}=o,g=T.Children.toArray(h),b=g.find(Eve);if(b){const w=b.props.children,E=g.map(A=>A===b?T.Children.count(w)>1?T.Children.only(null):T.isValidElement(w)?w.props.children:null:A);return c.jsx(r,{...m,ref:u,children:T.isValidElement(w)?T.cloneElement(w,void 0,E):null})}return c.jsx(r,{...m,ref:u,children:h})});return s.displayName=`${e}.Slot`,s}function wve(e){const r=T.forwardRef((s,o)=>{const{children:u,...h}=s;if(T.isValidElement(u)){const m=Cve(u),g=jve(h,u.props);return u.type!==T.Fragment&&(g.ref=o?Gi(o,m):m),T.cloneElement(u,g)}return T.Children.count(u)>1?T.Children.only(null):null});return r.displayName=`${e}.SlotClone`,r}var Sve=Symbol("radix.slottable");function Eve(e){return T.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Sve}function jve(e,r){const s={...r};for(const o in r){const u=e[o],h=r[o];/^on[A-Z]/.test(o)?u&&h?s[o]=(...g)=>{const b=h(...g);return u(...g),b}:u&&(s[o]=u):o==="style"?s[o]={...u,...h}:o==="className"&&(s[o]=[u,h].filter(Boolean).join(" "))}return{...e,...s}}function Cve(e){let r=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=r&&"isReactWarning"in r&&r.isReactWarning;return s?e.ref:(r=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=r&&"isReactWarning"in r&&r.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}function m$(e){const r=e+"CollectionProvider",[s,o]=cl(r),[u,h]=s(r,{collectionRef:{current:null},itemMap:new Map}),m=I=>{const{scope:F,children:H}=I,V=et.useRef(null),K=et.useRef(new Map).current;return c.jsx(u,{scope:F,itemMap:K,collectionRef:V,children:H})};m.displayName=r;const g=e+"CollectionSlot",b=z3(g),w=et.forwardRef((I,F)=>{const{scope:H,children:V}=I,K=h(g,H),z=Ln(F,K.collectionRef);return c.jsx(b,{ref:z,children:V})});w.displayName=g;const E=e+"CollectionItemSlot",A="data-radix-collection-item",k=z3(E),R=et.forwardRef((I,F)=>{const{scope:H,children:V,...K}=I,z=et.useRef(null),W=Ln(F,z),ae=h(E,H);return et.useEffect(()=>(ae.itemMap.set(z,{ref:z,...K}),()=>{ae.itemMap.delete(z)})),c.jsx(k,{[A]:"",ref:W,children:V})});R.displayName=E;function M(I){const F=h(e+"CollectionConsumer",I);return et.useCallback(()=>{const V=F.collectionRef.current;if(!V)return[];const K=Array.from(V.querySelectorAll(`[${A}]`));return Array.from(F.itemMap.values()).sort((ae,Q)=>K.indexOf(ae.ref.current)-K.indexOf(Q.ref.current))},[F.collectionRef,F.itemMap])}return[{Provider:m,Slot:w,ItemSlot:R},M,o]}var Ave=T.createContext(void 0);function g$(e){const r=T.useContext(Ave);return e||r||"ltr"}function Ove(e){const r=kve(e),s=T.forwardRef((o,u)=>{const{children:h,...m}=o,g=T.Children.toArray(h),b=g.find(Tve);if(b){const w=b.props.children,E=g.map(A=>A===b?T.Children.count(w)>1?T.Children.only(null):T.isValidElement(w)?w.props.children:null:A);return c.jsx(r,{...m,ref:u,children:T.isValidElement(w)?T.cloneElement(w,void 0,E):null})}return c.jsx(r,{...m,ref:u,children:h})});return s.displayName=`${e}.Slot`,s}function kve(e){const r=T.forwardRef((s,o)=>{const{children:u,...h}=s;if(T.isValidElement(u)){const m=$ve(u),g=_ve(h,u.props);return u.type!==T.Fragment&&(g.ref=o?Gi(o,m):m),T.cloneElement(u,g)}return T.Children.count(u)>1?T.Children.only(null):null});return r.displayName=`${e}.SlotClone`,r}var Rve=Symbol("radix.slottable");function Tve(e){return T.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Rve}function _ve(e,r){const s={...r};for(const o in r){const u=e[o],h=r[o];/^on[A-Z]/.test(o)?u&&h?s[o]=(...g)=>{const b=h(...g);return u(...g),b}:u&&(s[o]=u):o==="style"?s[o]={...u,...h}:o==="className"&&(s[o]=[u,h].filter(Boolean).join(" "))}return{...e,...s}}function $ve(e){let r=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=r&&"isReactWarning"in r&&r.isReactWarning;return s?e.ref:(r=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=r&&"isReactWarning"in r&&r.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}function Y6(e){const r=T.useRef({value:e,previous:e});return T.useMemo(()=>(r.current.value!==e&&(r.current.previous=r.current.value,r.current.value=e),r.current.previous),[e])}var Nve=[" ","Enter","ArrowUp","ArrowDown"],Dve=[" ","Enter"],Mp="Select",[nA,rA,Pve]=m$(Mp),[Bg]=cl(Mp,[Pve,Yd]),sA=Yd(),[Mve,th]=Bg(Mp),[Ive,zve]=Bg(Mp),Z6=e=>{const{__scopeSelect:r,children:s,open:o,defaultOpen:u,onOpenChange:h,value:m,defaultValue:g,onValueChange:b,dir:w,name:E,autoComplete:A,disabled:k,required:R,form:M}=e,I=sA(r),[F,H]=T.useState(null),[V,K]=T.useState(null),[z,W]=T.useState(!1),ae=g$(w),[Q,te]=Kd({prop:o,defaultProp:u??!1,onChange:h,caller:Mp}),[de,je]=Kd({prop:m,defaultProp:g,onChange:b,caller:Mp}),we=T.useRef(null),ie=F?M||!!F.closest("form"):!0,[Se,Ae]=T.useState(new Set),He=Array.from(Se).map(ue=>ue.props.value).join(";");return c.jsx(TC,{...I,children:c.jsxs(Mve,{required:R,scope:r,trigger:F,onTriggerChange:H,valueNode:V,onValueNodeChange:K,valueNodeHasChildren:z,onValueNodeHasChildrenChange:W,contentId:Ys(),value:de,onValueChange:je,open:Q,onOpenChange:te,dir:ae,triggerPointerDownPosRef:we,disabled:k,children:[c.jsx(nA.Provider,{scope:r,children:c.jsx(Ive,{scope:e.__scopeSelect,onNativeOptionAdd:T.useCallback(ue=>{Ae(ne=>new Set(ne).add(ue))},[]),onNativeOptionRemove:T.useCallback(ue=>{Ae(ne=>{const ce=new Set(ne);return ce.delete(ue),ce})},[]),children:s})}),ie?c.jsxs(vq,{"aria-hidden":!0,required:R,tabIndex:-1,name:E,autoComplete:A,value:de,onChange:ue=>je(ue.target.value),disabled:k,form:M,children:[de===void 0?c.jsx("option",{value:""}):null,Array.from(Se)]},He):null]})})};Z6.displayName=Mp;var J6="SelectTrigger",W6=T.forwardRef((e,r)=>{const{__scopeSelect:s,disabled:o=!1,...u}=e,h=sA(s),m=th(J6,s),g=m.disabled||o,b=Ln(r,m.onTriggerChange),w=rA(s),E=T.useRef("touch"),[A,k,R]=bq(I=>{const F=w().filter(K=>!K.disabled),H=F.find(K=>K.value===m.value),V=wq(F,I,H);V!==void 0&&m.onValueChange(V.value)}),M=I=>{g||(m.onOpenChange(!0),R()),I&&(m.triggerPointerDownPosRef.current={x:Math.round(I.pageX),y:Math.round(I.pageY)})};return c.jsx(ow,{asChild:!0,...h,children:c.jsx(An.button,{type:"button",role:"combobox","aria-controls":m.contentId,"aria-expanded":m.open,"aria-required":m.required,"aria-autocomplete":"none",dir:m.dir,"data-state":m.open?"open":"closed",disabled:g,"data-disabled":g?"":void 0,"data-placeholder":xq(m.value)?"":void 0,...u,ref:b,onClick:Nt(u.onClick,I=>{I.currentTarget.focus(),E.current!=="mouse"&&M(I)}),onPointerDown:Nt(u.onPointerDown,I=>{E.current=I.pointerType;const F=I.target;F.hasPointerCapture(I.pointerId)&&F.releasePointerCapture(I.pointerId),I.button===0&&I.ctrlKey===!1&&I.pointerType==="mouse"&&(M(I),I.preventDefault())}),onKeyDown:Nt(u.onKeyDown,I=>{const F=A.current!=="";!(I.ctrlKey||I.altKey||I.metaKey)&&I.key.length===1&&k(I.key),!(F&&I.key===" ")&&Nve.includes(I.key)&&(M(),I.preventDefault())})})})});W6.displayName=J6;var Q6="SelectValue",eq=T.forwardRef((e,r)=>{const{__scopeSelect:s,className:o,style:u,children:h,placeholder:m="",...g}=e,b=th(Q6,s),{onValueNodeHasChildrenChange:w}=b,E=h!==void 0,A=Ln(r,b.onValueNodeChange);return Os(()=>{w(E)},[w,E]),c.jsx(An.span,{...g,ref:A,style:{pointerEvents:"none"},children:xq(b.value)?c.jsx(c.Fragment,{children:m}):h})});eq.displayName=Q6;var Lve="SelectIcon",tq=T.forwardRef((e,r)=>{const{__scopeSelect:s,children:o,...u}=e;return c.jsx(An.span,{"aria-hidden":!0,...u,ref:r,children:o||"▼"})});tq.displayName=Lve;var Fve="SelectPortal",nq=e=>c.jsx(Mg,{asChild:!0,...e});nq.displayName=Fve;var Ip="SelectContent",rq=T.forwardRef((e,r)=>{const s=th(Ip,e.__scopeSelect),[o,u]=T.useState();if(Os(()=>{u(new DocumentFragment)},[]),!s.open){const h=o;return h?SC.createPortal(c.jsx(sq,{scope:e.__scopeSelect,children:c.jsx(nA.Slot,{scope:e.__scopeSelect,children:c.jsx("div",{children:e.children})})}),h):null}return c.jsx(iq,{...e,ref:r})});rq.displayName=Ip;var Wo=10,[sq,nh]=Bg(Ip),qve="SelectContentImpl",Bve=Ove("SelectContent.RemoveScroll"),iq=T.forwardRef((e,r)=>{const{__scopeSelect:s,position:o="item-aligned",onCloseAutoFocus:u,onEscapeKeyDown:h,onPointerDownOutside:m,side:g,sideOffset:b,align:w,alignOffset:E,arrowPadding:A,collisionBoundary:k,collisionPadding:R,sticky:M,hideWhenDetached:I,avoidCollisions:F,...H}=e,V=th(Ip,s),[K,z]=T.useState(null),[W,ae]=T.useState(null),Q=Ln(r,Fe=>z(Fe)),[te,de]=T.useState(null),[je,we]=T.useState(null),ie=rA(s),[Se,Ae]=T.useState(!1),He=T.useRef(!1);T.useEffect(()=>{if(K)return IC(K)},[K]),PC();const ue=T.useCallback(Fe=>{const[at,...gt]=ie().map(Rt=>Rt.ref.current),[Ot]=gt.slice(-1),Lt=document.activeElement;for(const Rt of Fe)if(Rt===Lt||(Rt?.scrollIntoView({block:"nearest"}),Rt===at&&W&&(W.scrollTop=0),Rt===Ot&&W&&(W.scrollTop=W.scrollHeight),Rt?.focus(),document.activeElement!==Lt))return},[ie,W]),ne=T.useCallback(()=>ue([te,K]),[ue,te,K]);T.useEffect(()=>{Se&&ne()},[Se,ne]);const{onOpenChange:ce,triggerPointerDownPosRef:$e}=V;T.useEffect(()=>{if(K){let Fe={x:0,y:0};const at=Ot=>{Fe={x:Math.abs(Math.round(Ot.pageX)-($e.current?.x??0)),y:Math.abs(Math.round(Ot.pageY)-($e.current?.y??0))}},gt=Ot=>{Fe.x<=10&&Fe.y<=10?Ot.preventDefault():K.contains(Ot.target)||ce(!1),document.removeEventListener("pointermove",at),$e.current=null};return $e.current!==null&&(document.addEventListener("pointermove",at),document.addEventListener("pointerup",gt,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",at),document.removeEventListener("pointerup",gt,{capture:!0})}}},[K,ce,$e]),T.useEffect(()=>{const Fe=()=>ce(!1);return window.addEventListener("blur",Fe),window.addEventListener("resize",Fe),()=>{window.removeEventListener("blur",Fe),window.removeEventListener("resize",Fe)}},[ce]);const[me,Xe]=bq(Fe=>{const at=ie().filter(Lt=>!Lt.disabled),gt=at.find(Lt=>Lt.ref.current===document.activeElement),Ot=wq(at,Fe,gt);Ot&&setTimeout(()=>Ot.ref.current.focus())}),Oe=T.useCallback((Fe,at,gt)=>{const Ot=!He.current&&!gt;(V.value!==void 0&&V.value===at||Ot)&&(de(Fe),Ot&&(He.current=!0))},[V.value]),Te=T.useCallback(()=>K?.focus(),[K]),Ke=T.useCallback((Fe,at,gt)=>{const Ot=!He.current&&!gt;(V.value!==void 0&&V.value===at||Ot)&&we(Fe)},[V.value]),se=o==="popper"?R_:aq,Ne=se===R_?{side:g,sideOffset:b,align:w,alignOffset:E,arrowPadding:A,collisionBoundary:k,collisionPadding:R,sticky:M,hideWhenDetached:I,avoidCollisions:F}:{};return c.jsx(sq,{scope:s,content:K,viewport:W,onViewportChange:ae,itemRefCallback:Oe,selectedItem:te,onItemLeave:Te,itemTextRefCallback:Ke,focusSelectedItem:ne,selectedItemText:je,position:o,isPositioned:Se,searchRef:me,children:c.jsx(hw,{as:Bve,allowPinchZoom:!0,children:c.jsx(dw,{asChild:!0,trapped:V.open,onMountAutoFocus:Fe=>{Fe.preventDefault()},onUnmountAutoFocus:Nt(u,Fe=>{V.trigger?.focus({preventScroll:!0}),Fe.preventDefault()}),children:c.jsx(Ng,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:h,onPointerDownOutside:m,onFocusOutside:Fe=>Fe.preventDefault(),onDismiss:()=>V.onOpenChange(!1),children:c.jsx(se,{role:"listbox",id:V.contentId,"data-state":V.open?"open":"closed",dir:V.dir,onContextMenu:Fe=>Fe.preventDefault(),...H,...Ne,onPlaced:()=>Ae(!0),ref:Q,style:{display:"flex",flexDirection:"column",outline:"none",...H.style},onKeyDown:Nt(H.onKeyDown,Fe=>{const at=Fe.ctrlKey||Fe.altKey||Fe.metaKey;if(Fe.key==="Tab"&&Fe.preventDefault(),!at&&Fe.key.length===1&&Xe(Fe.key),["ArrowUp","ArrowDown","Home","End"].includes(Fe.key)){let Ot=ie().filter(Lt=>!Lt.disabled).map(Lt=>Lt.ref.current);if(["ArrowUp","End"].includes(Fe.key)&&(Ot=Ot.slice().reverse()),["ArrowUp","ArrowDown"].includes(Fe.key)){const Lt=Fe.target,Rt=Ot.indexOf(Lt);Ot=Ot.slice(Rt+1)}setTimeout(()=>ue(Ot)),Fe.preventDefault()}})})})})})})});iq.displayName=qve;var Uve="SelectItemAlignedPosition",aq=T.forwardRef((e,r)=>{const{__scopeSelect:s,onPlaced:o,...u}=e,h=th(Ip,s),m=nh(Ip,s),[g,b]=T.useState(null),[w,E]=T.useState(null),A=Ln(r,Q=>E(Q)),k=rA(s),R=T.useRef(!1),M=T.useRef(!0),{viewport:I,selectedItem:F,selectedItemText:H,focusSelectedItem:V}=m,K=T.useCallback(()=>{if(h.trigger&&h.valueNode&&g&&w&&I&&F&&H){const Q=h.trigger.getBoundingClientRect(),te=w.getBoundingClientRect(),de=h.valueNode.getBoundingClientRect(),je=H.getBoundingClientRect();if(h.dir!=="rtl"){const Lt=je.left-te.left,Rt=de.left-Lt,Ft=Q.left-Rt,qe=Q.width+Ft,Bt=Math.max(qe,te.width),kt=window.innerWidth-Wo,G=I3(Rt,[Wo,Math.max(Wo,kt-Bt)]);g.style.minWidth=qe+"px",g.style.left=G+"px"}else{const Lt=te.right-je.right,Rt=window.innerWidth-de.right-Lt,Ft=window.innerWidth-Q.right-Rt,qe=Q.width+Ft,Bt=Math.max(qe,te.width),kt=window.innerWidth-Wo,G=I3(Rt,[Wo,Math.max(Wo,kt-Bt)]);g.style.minWidth=qe+"px",g.style.right=G+"px"}const we=k(),ie=window.innerHeight-Wo*2,Se=I.scrollHeight,Ae=window.getComputedStyle(w),He=parseInt(Ae.borderTopWidth,10),ue=parseInt(Ae.paddingTop,10),ne=parseInt(Ae.borderBottomWidth,10),ce=parseInt(Ae.paddingBottom,10),$e=He+ue+Se+ce+ne,me=Math.min(F.offsetHeight*5,$e),Xe=window.getComputedStyle(I),Oe=parseInt(Xe.paddingTop,10),Te=parseInt(Xe.paddingBottom,10),Ke=Q.top+Q.height/2-Wo,se=ie-Ke,Ne=F.offsetHeight/2,Fe=F.offsetTop+Ne,at=He+ue+Fe,gt=$e-at;if(at<=Ke){const Lt=we.length>0&&F===we[we.length-1].ref.current;g.style.bottom="0px";const Rt=w.clientHeight-I.offsetTop-I.offsetHeight,Ft=Math.max(se,Ne+(Lt?Te:0)+Rt+ne),qe=at+Ft;g.style.height=qe+"px"}else{const Lt=we.length>0&&F===we[0].ref.current;g.style.top="0px";const Ft=Math.max(Ke,He+I.offsetTop+(Lt?Oe:0)+Ne)+gt;g.style.height=Ft+"px",I.scrollTop=at-Ke+I.offsetTop}g.style.margin=`${Wo}px 0`,g.style.minHeight=me+"px",g.style.maxHeight=ie+"px",o?.(),requestAnimationFrame(()=>R.current=!0)}},[k,h.trigger,h.valueNode,g,w,I,F,H,h.dir,o]);Os(()=>K(),[K]);const[z,W]=T.useState();Os(()=>{w&&W(window.getComputedStyle(w).zIndex)},[w]);const ae=T.useCallback(Q=>{Q&&M.current===!0&&(K(),V?.(),M.current=!1)},[K,V]);return c.jsx(Vve,{scope:s,contentWrapper:g,shouldExpandOnScrollRef:R,onScrollButtonChange:ae,children:c.jsx("div",{ref:b,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:z},children:c.jsx(An.div,{...u,ref:A,style:{boxSizing:"border-box",maxHeight:"100%",...u.style}})})})});aq.displayName=Uve;var Kve="SelectPopperPosition",R_=T.forwardRef((e,r)=>{const{__scopeSelect:s,align:o="start",collisionPadding:u=Wo,...h}=e,m=sA(s);return c.jsx(_C,{...m,...h,ref:r,align:o,collisionPadding:u,style:{boxSizing:"border-box",...h.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)"}})});R_.displayName=Kve;var[Vve,y$]=Bg(Ip,{}),T_="SelectViewport",oq=T.forwardRef((e,r)=>{const{__scopeSelect:s,nonce:o,...u}=e,h=nh(T_,s),m=y$(T_,s),g=Ln(r,h.onViewportChange),b=T.useRef(0);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),c.jsx(nA.Slot,{scope:s,children:c.jsx(An.div,{"data-radix-select-viewport":"",role:"presentation",...u,ref:g,style:{position:"relative",flex:1,overflow:"hidden auto",...u.style},onScroll:Nt(u.onScroll,w=>{const E=w.currentTarget,{contentWrapper:A,shouldExpandOnScrollRef:k}=m;if(k?.current&&A){const R=Math.abs(b.current-E.scrollTop);if(R>0){const M=window.innerHeight-Wo*2,I=parseFloat(A.style.minHeight),F=parseFloat(A.style.height),H=Math.max(I,F);if(H0?z:0,A.style.justifyContent="flex-end")}}}b.current=E.scrollTop})})})]})});oq.displayName=T_;var lq="SelectGroup",[Hve,Gve]=Bg(lq),Xve=T.forwardRef((e,r)=>{const{__scopeSelect:s,...o}=e,u=Ys();return c.jsx(Hve,{scope:s,id:u,children:c.jsx(An.div,{role:"group","aria-labelledby":u,...o,ref:r})})});Xve.displayName=lq;var cq="SelectLabel",Yve=T.forwardRef((e,r)=>{const{__scopeSelect:s,...o}=e,u=Gve(cq,s);return c.jsx(An.div,{id:u.id,...o,ref:r})});Yve.displayName=cq;var cC="SelectItem",[Zve,uq]=Bg(cC),dq=T.forwardRef((e,r)=>{const{__scopeSelect:s,value:o,disabled:u=!1,textValue:h,...m}=e,g=th(cC,s),b=nh(cC,s),w=g.value===o,[E,A]=T.useState(h??""),[k,R]=T.useState(!1),M=Ln(r,V=>b.itemRefCallback?.(V,o,u)),I=Ys(),F=T.useRef("touch"),H=()=>{u||(g.onValueChange(o),g.onOpenChange(!1))};if(o==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return c.jsx(Zve,{scope:s,value:o,disabled:u,textId:I,isSelected:w,onItemTextChange:T.useCallback(V=>{A(K=>K||(V?.textContent??"").trim())},[]),children:c.jsx(nA.ItemSlot,{scope:s,value:o,disabled:u,textValue:E,children:c.jsx(An.div,{role:"option","aria-labelledby":I,"data-highlighted":k?"":void 0,"aria-selected":w&&k,"data-state":w?"checked":"unchecked","aria-disabled":u||void 0,"data-disabled":u?"":void 0,tabIndex:u?void 0:-1,...m,ref:M,onFocus:Nt(m.onFocus,()=>R(!0)),onBlur:Nt(m.onBlur,()=>R(!1)),onClick:Nt(m.onClick,()=>{F.current!=="mouse"&&H()}),onPointerUp:Nt(m.onPointerUp,()=>{F.current==="mouse"&&H()}),onPointerDown:Nt(m.onPointerDown,V=>{F.current=V.pointerType}),onPointerMove:Nt(m.onPointerMove,V=>{F.current=V.pointerType,u?b.onItemLeave?.():F.current==="mouse"&&V.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Nt(m.onPointerLeave,V=>{V.currentTarget===document.activeElement&&b.onItemLeave?.()}),onKeyDown:Nt(m.onKeyDown,V=>{b.searchRef?.current!==""&&V.key===" "||(Dve.includes(V.key)&&H(),V.key===" "&&V.preventDefault())})})})})});dq.displayName=cC;var Nb="SelectItemText",hq=T.forwardRef((e,r)=>{const{__scopeSelect:s,className:o,style:u,...h}=e,m=th(Nb,s),g=nh(Nb,s),b=uq(Nb,s),w=zve(Nb,s),[E,A]=T.useState(null),k=Ln(r,H=>A(H),b.onItemTextChange,H=>g.itemTextRefCallback?.(H,b.value,b.disabled)),R=E?.textContent,M=T.useMemo(()=>c.jsx("option",{value:b.value,disabled:b.disabled,children:R},b.value),[b.disabled,b.value,R]),{onNativeOptionAdd:I,onNativeOptionRemove:F}=w;return Os(()=>(I(M),()=>F(M)),[I,F,M]),c.jsxs(c.Fragment,{children:[c.jsx(An.span,{id:b.textId,...h,ref:k}),b.isSelected&&m.valueNode&&!m.valueNodeHasChildren?SC.createPortal(h.children,m.valueNode):null]})});hq.displayName=Nb;var pq="SelectItemIndicator",fq=T.forwardRef((e,r)=>{const{__scopeSelect:s,...o}=e;return uq(pq,s).isSelected?c.jsx(An.span,{"aria-hidden":!0,...o,ref:r}):null});fq.displayName=pq;var __="SelectScrollUpButton",mq=T.forwardRef((e,r)=>{const s=nh(__,e.__scopeSelect),o=y$(__,e.__scopeSelect),[u,h]=T.useState(!1),m=Ln(r,o.onScrollButtonChange);return Os(()=>{if(s.viewport&&s.isPositioned){let g=function(){const w=b.scrollTop>0;h(w)};const b=s.viewport;return g(),b.addEventListener("scroll",g),()=>b.removeEventListener("scroll",g)}},[s.viewport,s.isPositioned]),u?c.jsx(yq,{...e,ref:m,onAutoScroll:()=>{const{viewport:g,selectedItem:b}=s;g&&b&&(g.scrollTop=g.scrollTop-b.offsetHeight)}}):null});mq.displayName=__;var $_="SelectScrollDownButton",gq=T.forwardRef((e,r)=>{const s=nh($_,e.__scopeSelect),o=y$($_,e.__scopeSelect),[u,h]=T.useState(!1),m=Ln(r,o.onScrollButtonChange);return Os(()=>{if(s.viewport&&s.isPositioned){let g=function(){const w=b.scrollHeight-b.clientHeight,E=Math.ceil(b.scrollTop)b.removeEventListener("scroll",g)}},[s.viewport,s.isPositioned]),u?c.jsx(yq,{...e,ref:m,onAutoScroll:()=>{const{viewport:g,selectedItem:b}=s;g&&b&&(g.scrollTop=g.scrollTop+b.offsetHeight)}}):null});gq.displayName=$_;var yq=T.forwardRef((e,r)=>{const{__scopeSelect:s,onAutoScroll:o,...u}=e,h=nh("SelectScrollButton",s),m=T.useRef(null),g=rA(s),b=T.useCallback(()=>{m.current!==null&&(window.clearInterval(m.current),m.current=null)},[]);return T.useEffect(()=>()=>b(),[b]),Os(()=>{g().find(E=>E.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[g]),c.jsx(An.div,{"aria-hidden":!0,...u,ref:r,style:{flexShrink:0,...u.style},onPointerDown:Nt(u.onPointerDown,()=>{m.current===null&&(m.current=window.setInterval(o,50))}),onPointerMove:Nt(u.onPointerMove,()=>{h.onItemLeave?.(),m.current===null&&(m.current=window.setInterval(o,50))}),onPointerLeave:Nt(u.onPointerLeave,()=>{b()})})}),Jve="SelectSeparator",Wve=T.forwardRef((e,r)=>{const{__scopeSelect:s,...o}=e;return c.jsx(An.div,{"aria-hidden":!0,...o,ref:r})});Wve.displayName=Jve;var N_="SelectArrow",Qve=T.forwardRef((e,r)=>{const{__scopeSelect:s,...o}=e,u=sA(s),h=th(N_,s),m=nh(N_,s);return h.open&&m.position==="popper"?c.jsx($C,{...u,...o,ref:r}):null});Qve.displayName=N_;var exe="SelectBubbleInput",vq=T.forwardRef(({__scopeSelect:e,value:r,...s},o)=>{const u=T.useRef(null),h=Ln(o,u),m=Y6(r);return T.useEffect(()=>{const g=u.current;if(!g)return;const b=window.HTMLSelectElement.prototype,E=Object.getOwnPropertyDescriptor(b,"value").set;if(m!==r&&E){const A=new Event("change",{bubbles:!0});E.call(g,r),g.dispatchEvent(A)}},[m,r]),c.jsx(An.select,{...s,style:{...hL,...s.style},ref:h,defaultValue:r})});vq.displayName=exe;function xq(e){return e===""||e===void 0}function bq(e){const r=sl(e),s=T.useRef(""),o=T.useRef(0),u=T.useCallback(m=>{const g=s.current+m;r(g),(function b(w){s.current=w,window.clearTimeout(o.current),w!==""&&(o.current=window.setTimeout(()=>b(""),1e3))})(g)},[r]),h=T.useCallback(()=>{s.current="",window.clearTimeout(o.current)},[]);return T.useEffect(()=>()=>window.clearTimeout(o.current),[]),[s,u,h]}function wq(e,r,s){const u=r.length>1&&Array.from(r).every(w=>w===r[0])?r[0]:r,h=s?e.indexOf(s):-1;let m=txe(e,Math.max(h,0));u.length===1&&(m=m.filter(w=>w!==s));const b=m.find(w=>w.textValue.toLowerCase().startsWith(u.toLowerCase()));return b!==s?b:void 0}function txe(e,r){return e.map((s,o)=>e[(r+o)%e.length])}var nxe=Z6,rxe=W6,sxe=eq,ixe=tq,axe=nq,oxe=rq,lxe=oq,cxe=dq,uxe=hq,dxe=fq,hxe=mq,pxe=gq;function _n({...e}){return c.jsx(nxe,{"data-slot":"select",...e})}function $n({...e}){return c.jsx(sxe,{"data-slot":"select-value",...e})}function Nn({className:e,size:r="default",children:s,...o}){return c.jsxs(rxe,{"data-slot":"select-trigger","data-size":r,className:vt("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),...o,children:[s,c.jsx(ixe,{asChild:!0,children:c.jsx(yz,{className:"size-4 opacity-50"})})]})}function Dn({className:e,children:r,position:s="popper",align:o="center",...u}){return c.jsx(axe,{children:c.jsxs(oxe,{"data-slot":"select-content",className:vt("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",s==="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:s,align:o,...u,children:[c.jsx(fxe,{}),c.jsx(lxe,{className:vt("p-1",s==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:r}),c.jsx(mxe,{})]})})}function Ct({className:e,children:r,...s}){return c.jsxs(cxe,{"data-slot":"select-item",className:vt("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),...s,children:[c.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:c.jsx(dxe,{children:c.jsx(gz,{className:"size-4"})})}),c.jsx(uxe,{children:r})]})}function fxe({className:e,...r}){return c.jsx(hxe,{"data-slot":"select-scroll-up-button",className:vt("flex cursor-default items-center justify-center py-1",e),...r,children:c.jsx(UZ,{className:"size-4"})})}function mxe({className:e,...r}){return c.jsx(pxe,{"data-slot":"select-scroll-down-button",className:vt("flex cursor-default items-center justify-center py-1",e),...r,children:c.jsx(yz,{className:"size-4"})})}const Sq=Is({name:Sn().trim().min(1,"Name is required").max(120,"Max 120 chars"),cluster_provider:Sn().trim().min(1,"Provider is required").max(120,"Max 120 chars"),region:Sn().trim().min(1,"Region is required").max(120,"Max 120 chars"),docker_image:Sn().trim().min(1,"Docker Image is required"),docker_tag:Sn().trim().min(1,"Docker Tag is required")}),gxe=Sq.partial();function Id(e){return Array.isArray(e)?e:Array.isArray(e?.data)?e.data:Array.isArray(e?.body)?e.body:Array.isArray(e?.result)?e.result:[]}function yxe(e){return e?.data&&typeof e.data=="object"?e.data:e}function vxe({status:e}){const r=(e??"").toLowerCase();return r?r==="ready"?c.jsxs(rr,{variant:"default",className:"flex items-center gap-1 text-xs",children:[c.jsx(EC,{className:"h-3 w-3"}),"ready"]}):r==="failed"?c.jsxs(rr,{variant:"destructive",className:"flex items-center gap-1 text-xs",children:[c.jsx(Dj,{className:"h-3 w-3"}),"failed"]}):r==="provisioning"||r==="pending"||r==="pre_pending"?c.jsxs(rr,{variant:"secondary",className:"flex items-center gap-1 text-xs",children:[c.jsx(ys,{className:"h-3 w-3 animate-spin"}),r.replace("_"," ")]}):r==="incomplete"?c.jsxs(rr,{variant:"outline",className:"flex items-center gap-1 text-xs",children:[c.jsx(Dj,{className:"h-3 w-3"}),"incomplete"]}):c.jsx(rr,{variant:"outline",className:"text-xs",children:r}):c.jsx(rr,{variant:"outline",className:"text-xs",children:"unknown"})}function xxe({status:e}){const r=(e??"").toLowerCase();return r?r==="succeeded"||r==="success"?c.jsxs(rr,{variant:"default",className:"flex items-center gap-1 text-xs",children:[c.jsx(EC,{className:"h-3 w-3"}),"succeeded"]}):r==="failed"||r==="error"?c.jsxs(rr,{variant:"destructive",className:"flex items-center gap-1 text-xs",children:[c.jsx(Dj,{className:"h-3 w-3"}),"failed"]}):r==="queued"||r==="running"?c.jsxs(rr,{variant:"secondary",className:"flex items-center gap-1 text-xs",children:[c.jsx(ys,{className:"h-3 w-3 animate-spin"}),r]}):c.jsx(rr,{variant:"outline",className:"text-xs",children:r}):c.jsx(rr,{variant:"outline",className:"text-xs",children:"unknown"})}function L3(e){if(!e)return"-";try{const r=e instanceof Date?e:new Date(e);return Number.isNaN(r.getTime())?"-":r.toLocaleString()}catch{return"-"}}function bxe({c:e}){return c.jsxs("div",{className:"text-muted-foreground flex flex-col gap-1 text-xs",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.cluster_provider&&c.jsxs("span",{className:"inline-flex items-center gap-1",children:[c.jsx(sJ,{className:"h-3 w-3"}),e.cluster_provider]}),e.region&&c.jsxs("span",{className:"inline-flex items-center gap-1",children:[c.jsx(EJ,{className:"h-3 w-3"}),e.region]})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2 font-mono",children:[e.random_token&&c.jsxs("span",{children:["token: ",c.jsx("span",{className:"ml-1",children:za(e.random_token,8)})]}),e.certificate_key&&c.jsxs("span",{children:["cert: ",c.jsx("span",{className:"ml-1",children:za(e.certificate_key,8)})]})]})]})}const wxe=()=>{const[e,r]=T.useState(""),[s,o]=T.useState(!1),[u,h]=T.useState(!1),[m,g]=T.useState(null),[b,w]=T.useState(null),[E,A]=T.useState(null),[k,R]=T.useState(""),[M,I]=T.useState(""),[F,H]=T.useState(""),[V,K]=T.useState(""),[z,W]=T.useState(""),[ae,Q]=T.useState(""),[te,de]=T.useState(""),[je,we]=T.useState(null),ie=fe=>je===fe,Se=Ms(),Ae=Un({queryKey:["clusters"],queryFn:async()=>Id(await rs.listClusters())}),He=Un({queryKey:["load-balancers"],queryFn:async()=>Id(await $b.listLoadBalancers())}),ue=Un({queryKey:["domains"],queryFn:async()=>Id(await sc.listDomains())}),ne=Un({queryKey:["record-sets",k],enabled:!!k,queryFn:async()=>Id(await sc.listRecordSetsByDomain(k))}),ce=Un({queryKey:["servers"],queryFn:async()=>Id(await mg.listServers())}),$e=Un({queryKey:["node-pools"],queryFn:async()=>Id(await Na.listNodePools())}),me=Un({queryKey:["actions"],queryFn:async()=>Id(await kb.listActions())}),Xe=Un({queryKey:["cluster-runs",E?.id],enabled:!!E?.id,queryFn:async()=>Id(await rs.listClusterRuns(E.id)),refetchInterval:fe=>(Array.isArray(fe)?fe:[]).some(Gt=>{const ss=String(Gt?.status??"").toLowerCase();return ss==="queued"||ss==="running"})?2e3:!1}),Oe=T.useMemo(()=>{const fe=new Map;return(me.data??[]).forEach(Ut=>{Ut.make_target&&fe.set(Ut.make_target,Ut.label??Ut.make_target)}),fe},[me.data]),Te=fe=>Oe.get(fe.action??"")??fe.action??"unknown",Ke=hr({resolver:fr(Sq),defaultValues:{name:"",cluster_provider:"",region:"",docker_image:"",docker_tag:""}}),se=Wt({mutationFn:fe=>rs.createCluster(fe),onSuccess:async()=>{await Se.invalidateQueries({queryKey:["clusters"]}),Ke.reset(),o(!1),Ge.success("Cluster created successfully.")},onError:fe=>Ge.error(fe?.message??"There was an error while creating the cluster")}),Ne=hr({resolver:fr(gxe),defaultValues:{}}),Fe=Wt({mutationFn:({id:fe,values:Ut})=>rs.updateCluster(fe,Ut),onSuccess:async()=>{await Se.invalidateQueries({queryKey:["clusters"]}),Ne.reset(),h(!1),Ge.success("Cluster updated successfully.")},onError:fe=>Ge.error(fe?.message??"There was an error while updating the cluster")}),at=fe=>{fe.id&&(w(fe.id),Ne.reset({name:fe.name??"",cluster_provider:fe.cluster_provider??"",region:fe.region??"",docker_image:fe.docker_image??"",docker_tag:fe.docker_tag??""}),h(!0))},gt=Wt({mutationFn:fe=>rs.deleteCluster(fe),onSuccess:async()=>{await Se.invalidateQueries({queryKey:["clusters"]}),g(null),Ge.success("Cluster deleted successfully.")},onError:fe=>Ge.error(fe?.message??"There was an error while deleting the cluster")}),Ot=Wt({mutationFn:({clusterID:fe,actionID:Ut})=>rs.runClusterAction(fe,Ut),onSuccess:async()=>{await Se.invalidateQueries({queryKey:["cluster-runs",E?.id]}),Ge.success("Action enqueued.")},onError:fe=>Ge.error(fe?.message??"Failed to enqueue action.")});async function Lt(fe){if(E?.id){we(`run:${fe}`);try{await Ot.mutateAsync({clusterID:E.id,actionID:fe})}finally{we(null)}}}const Rt=T.useMemo(()=>{const fe=Ae.data??[],Ut=e.trim().toLowerCase();return Ut?fe.filter(nn=>nn.name?.toLowerCase().includes(Ut)||nn.cluster_provider?.toLowerCase().includes(Ut)||nn.region?.toLowerCase().includes(Ut)||nn.status?.toLowerCase().includes(Ut)):fe},[e,Ae.data]);T.useEffect(()=>{if(!E){R(""),I(""),H(""),K(""),W(""),Q(""),de("");return}E.captain_domain?.id&&R(E.captain_domain.id),E.control_plane_record_set?.id&&I(E.control_plane_record_set.id),E.apps_load_balancer?.id&&H(E.apps_load_balancer.id),E.glueops_load_balancer?.id&&K(E.glueops_load_balancer.id),E.bastion_server?.id&&W(E.bastion_server.id)},[E]);async function Ft(){if(E?.id)try{const fe=await rs.getCluster(E.id),Ut=yxe(fe);A(Ut),await Se.invalidateQueries({queryKey:["clusters"]}),await Se.invalidateQueries({queryKey:["cluster-runs",E.id]})}catch{}}async function qe(){if(E?.id){if(!k)return Ge.error("Domain is required");we("captain");try{await rs.attachCaptainDomain(E.id,{domain_id:k}),Ge.success("Captain domain attached."),await Ft()}catch(fe){Ge.error(fe?.message??"Failed to attach captain domain.")}finally{we(null)}}}async function Bt(){if(E?.id){we("captain");try{await rs.detachCaptainDomain(E.id),Ge.success("Captain domain detached."),await Ft()}catch(fe){Ge.error(fe?.message??"Failed to detach captain domain.")}finally{we(null)}}}async function kt(){if(E?.id){if(!M)return Ge.error("Record set is required");we("recordset");try{await rs.attachControlPlaneRecordSet(E.id,{record_set_id:M}),Ge.success("Control plane record set attached."),await Ft()}catch(fe){Ge.error(fe?.message??"Failed to attach record set.")}finally{we(null)}}}async function G(){if(E?.id){we("recordset");try{await rs.detachControlPlaneRecordSet(E.id),Ge.success("Control plane record set detached."),await Ft()}catch(fe){Ge.error(fe?.message??"Failed to detach record set.")}finally{we(null)}}}async function On(){if(E?.id){if(!F)return Ge.error("Load balancer is required");we("apps-lb");try{await rs.attachAppsLoadBalancer(E.id,{load_balancer_id:F}),Ge.success("Apps load balancer attached."),await Ft()}catch(fe){Ge.error(fe?.message??"Failed to attach apps load balancer.")}finally{we(null)}}}async function mn(){if(E?.id){we("apps-lb");try{await rs.detachAppsLoadBalancer(E.id),Ge.success("Apps load balancer detached."),await Ft()}catch(fe){Ge.error(fe?.message??"Failed to detach apps load balancer.")}finally{we(null)}}}async function Oi(){if(E?.id){if(!V)return Ge.error("Load balancer is required");we("glueops-lb");try{await rs.attachGlueOpsLoadBalancer(E.id,{load_balancer_id:V}),Ge.success("GlueOps load balancer attached."),await Ft()}catch(fe){Ge.error(fe?.message??"Failed to attach GlueOps load balancer.")}finally{we(null)}}}async function ge(){if(E?.id){we("glueops-lb");try{await rs.detachGlueOpsLoadBalancer(E.id),Ge.success("GlueOps load balancer detached."),await Ft()}catch(fe){Ge.error(fe?.message??"Failed to detach GlueOps load balancer.")}finally{we(null)}}}async function Me(){if(E?.id){if(!z)return Ge.error("Server is required");we("bastion");try{await rs.attachBastion(E.id,{server_id:z}),Ge.success("Bastion server attached."),await Ft()}catch(fe){Ge.error(fe?.message??"Failed to attach bastion server.")}finally{we(null)}}}async function _(){if(E?.id){we("bastion");try{await rs.detachBastion(E.id),Ge.success("Bastion server detached."),await Ft()}catch(fe){Ge.error(fe?.message??"Failed to detach bastion server.")}finally{we(null)}}}async function q(){if(E?.id){if(!ae)return Ge.error("Node pool is required");we("nodepool");try{await rs.attachNodePool(E.id,ae),Ge.success("Node pool attached."),Q(""),await Ft()}catch(fe){Ge.error(fe?.message??"Failed to attach node pool.")}finally{we(null)}}}async function X(fe){if(E?.id){we("nodepool");try{await rs.detachNodePool(E.id,fe),Ge.success("Node pool detached."),await Ft()}catch(Ut){Ge.error(Ut?.message??"Failed to detach node pool.")}finally{we(null)}}}async function oe(){if(E?.id){if(!te.trim())return Ge.error("Kubeconfig is required");we("kubeconfig");try{await rs.setKubeconfig(E.id,{kubeconfig:te}),Ge.success("Kubeconfig updated."),de(""),await Ft()}catch(fe){Ge.error(fe?.message??"Failed to set kubeconfig.")}finally{we(null)}}}async function ve(){if(E?.id){we("kubeconfig");try{await rs.clearKubeconfig(E.id),Ge.success("Kubeconfig cleared."),await Ft()}catch(fe){Ge.error(fe?.message??"Failed to clear kubeconfig.")}finally{we(null)}}}if(Ae.isLoading)return c.jsx("div",{className:"p-6",children:"Loading clusters…"});if(Ae.error)return c.jsx("div",{className:"p-6 text-red-500",children:"Error loading clusters."});const Re=He.data??[],Je=Re.filter(fe=>fe.kind==="public"),Tt=Re.filter(fe=>fe.kind==="glueops");return c.jsxs("div",{className:"space-y-4 p-6",children:[c.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[c.jsx("h1",{className:"mb-4 text-2xl font-bold",children:"Clusters"}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsxs("div",{className:"relative",children:[c.jsx(va,{className:"absolute top-2.5 left-2 h-4 w-4 opacity-60"}),c.jsx(mt,{value:e,onChange:fe=>r(fe.target.value),placeholder:"Search clusters",className:"w-64 pl-8"})]}),c.jsxs(dn,{open:s,onOpenChange:o,children:[c.jsx(Ai,{asChild:!0,children:c.jsxs(Pe,{onClick:()=>o(!0),children:[c.jsx(qa,{className:"mr-2 h-4 w-4"}),"Create Cluster"]})}),c.jsxs(hn,{className:"sm:max-w-lg",children:[c.jsx(pn,{children:c.jsx(fn,{children:"Create Cluster"})}),c.jsx(mr,{...Ke,children:c.jsxs("form",{className:"space-y-4",onSubmit:Ke.handleSubmit(fe=>se.mutate(fe)),children:[c.jsx(ft,{control:Ke.control,name:"name",render:({field:fe})=>c.jsxs(ot,{children:[c.jsx(lt,{children:"Name"}),c.jsx(bt,{children:c.jsx(mt,{placeholder:"prod-cluster-eu-west-1",...fe})}),c.jsx(pt,{})]})}),c.jsx(ft,{control:Ke.control,name:"cluster_provider",render:({field:fe})=>c.jsxs(ot,{children:[c.jsx(lt,{children:"Provider"}),c.jsx(bt,{children:c.jsx(mt,{placeholder:"aws / hetzner / baremetal",...fe})}),c.jsx(pt,{})]})}),c.jsx(ft,{control:Ke.control,name:"region",render:({field:fe})=>c.jsxs(ot,{children:[c.jsx(lt,{children:"Region"}),c.jsx(bt,{children:c.jsx(mt,{placeholder:"eu-west-1",...fe})}),c.jsx(pt,{})]})}),c.jsx(ft,{control:Ke.control,name:"docker_image",render:({field:fe})=>c.jsxs(ot,{children:[c.jsx(lt,{children:"Docker Image"}),c.jsx(bt,{children:c.jsx(mt,{placeholder:"ghcr.io/glueops/gluekube",...fe})}),c.jsx(pt,{})]})}),c.jsx(ft,{control:Ke.control,name:"docker_tag",render:({field:fe})=>c.jsxs(ot,{children:[c.jsx(lt,{children:"Docker Tag"}),c.jsx(bt,{children:c.jsx(mt,{placeholder:"v1.33",...fe})}),c.jsx(pt,{})]})}),c.jsxs(gn,{className:"gap-2",children:[c.jsx(Pe,{type:"button",variant:"outline",onClick:()=>o(!1),children:"Cancel"}),c.jsx(Pe,{type:"submit",disabled:se.isPending,children:se.isPending?"Creating…":"Create"})]})]})})]})]})]})]}),c.jsx("div",{className:"bg-background overflow-hidden rounded-2xl border shadow-sm",children:c.jsx("div",{className:"overflow-x-auto",children:c.jsxs(Js,{children:[c.jsx(Ws,{children:c.jsxs(Qt,{children:[c.jsx(St,{children:"Name"}),c.jsx(St,{children:"Provider"}),c.jsx(St,{children:"Region"}),c.jsx(St,{children:"Status"}),c.jsx(St,{children:"Docker"}),c.jsx(St,{children:"Summary"}),c.jsx(St,{className:"w-[320px] text-right",children:"Actions"})]})}),c.jsxs(Qs,{children:[Rt.map(fe=>c.jsxs(Qt,{children:[c.jsx(dt,{className:"font-medium",children:fe.name}),c.jsx(dt,{children:fe.cluster_provider}),c.jsx(dt,{children:fe.region}),c.jsxs(dt,{children:[c.jsx(vxe,{status:fe.status}),fe.last_error&&c.jsx("div",{className:"mt-1 text-xs text-red-500",children:za(fe.last_error,80)})]}),c.jsx(dt,{children:(fe.docker_image??"")+":"+(fe.docker_tag??"")}),c.jsxs(dt,{children:[c.jsx(bxe,{c:fe}),fe.id&&c.jsx("code",{className:"text-muted-foreground mt-1 block text-xs",children:za(fe.id,6)})]}),c.jsx(dt,{children:c.jsxs("div",{className:"flex flex-wrap justify-end gap-2",children:[c.jsxs(Pe,{variant:"ghost",size:"sm",onClick:()=>A(fe),children:[c.jsx(LM,{className:"mr-1 h-4 w-4"})," Configure"]}),c.jsxs(Pe,{variant:"outline",size:"sm",onClick:()=>at(fe),children:[c.jsx(uc,{className:"mr-2 h-4 w-4"})," Edit"]}),c.jsx(Pe,{variant:"destructive",size:"sm",onClick:()=>fe.id&&g(fe.id),disabled:gt.isPending&&m===fe.id,children:gt.isPending&&m===fe.id?"Deleting…":"Delete"})]})})]},fe.id)),Rt.length===0&&c.jsx(Qt,{children:c.jsxs(dt,{colSpan:7,className:"text-muted-foreground py-10 text-center",children:[c.jsx(Rg,{className:"mx-auto mb-2 h-6 w-6 opacity-60"}),"No clusters match your search."]})})]})]})})}),c.jsx(dn,{open:u,onOpenChange:h,children:c.jsxs(hn,{className:"sm:max-w-lg",children:[c.jsx(pn,{children:c.jsx(fn,{children:"Edit Cluster"})}),c.jsx(mr,{...Ne,children:c.jsxs("form",{className:"space-y-4",onSubmit:Ne.handleSubmit(fe=>{b&&Fe.mutate({id:b,values:fe})}),children:[c.jsx(ft,{control:Ne.control,name:"name",render:({field:fe})=>c.jsxs(ot,{children:[c.jsx(lt,{children:"Name"}),c.jsx(bt,{children:c.jsx(mt,{placeholder:"prod-cluster-eu-west-1",...fe})}),c.jsx(pt,{})]})}),c.jsx(ft,{control:Ne.control,name:"cluster_provider",render:({field:fe})=>c.jsxs(ot,{children:[c.jsx(lt,{children:"Provider"}),c.jsx(bt,{children:c.jsx(mt,{placeholder:"aws / hetzner / baremetal",...fe})}),c.jsx(pt,{})]})}),c.jsx(ft,{control:Ne.control,name:"region",render:({field:fe})=>c.jsxs(ot,{children:[c.jsx(lt,{children:"Region"}),c.jsx(bt,{children:c.jsx(mt,{placeholder:"eu-west-1",...fe})}),c.jsx(pt,{})]})}),c.jsx(ft,{control:Ne.control,name:"docker_image",render:({field:fe})=>c.jsxs(ot,{children:[c.jsx(lt,{children:"Docker Image"}),c.jsx(bt,{children:c.jsx(mt,{placeholder:"ghcr.io/glueops/gluekube",...fe})}),c.jsx(pt,{})]})}),c.jsx(ft,{control:Ne.control,name:"docker_tag",render:({field:fe})=>c.jsxs(ot,{children:[c.jsx(lt,{children:"Docker Tag"}),c.jsx(bt,{children:c.jsx(mt,{placeholder:"v1.33",...fe})}),c.jsx(pt,{})]})}),c.jsxs(gn,{className:"gap-2",children:[c.jsx(Pe,{type:"button",variant:"outline",onClick:()=>h(!1),children:"Cancel"}),c.jsx(Pe,{type:"submit",disabled:Fe.isPending,children:Fe.isPending?"Saving…":"Save changes"})]})]})})]})}),c.jsx(dn,{open:!!E,onOpenChange:fe=>!fe&&A(null),children:c.jsxs(hn,{className:"max-h-[90vh] overflow-y-auto sm:max-w-2xl lg:max-w-250 ",children:[c.jsx(pn,{children:c.jsxs(fn,{children:["Configure Cluster",E?.name?`: ${E.name}`:""]})}),E&&c.jsxs("div",{className:"space-y-6 py-2",children:[c.jsxs("section",{className:"space-y-2 rounded-xl border p-4",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(LM,{className:"h-4 w-4"}),c.jsx("h3",{className:"text-sm font-semibold",children:"Cluster Actions"})]}),c.jsx("p",{className:"text-muted-foreground text-xs",children:"Run admin-configured actions on this cluster. Actions are executed asynchronously."})]}),c.jsx(Pe,{size:"sm",variant:"outline",onClick:()=>Xe.refetch(),disabled:Xe.isFetching||!E?.id,children:Xe.isFetching?"Refreshing…":"Refresh runs"})]}),c.jsx("div",{className:"space-y-2",children:me.isLoading?c.jsx("p",{className:"text-muted-foreground text-xs",children:"Loading actions…"}):(me.data??[]).length===0?c.jsx("p",{className:"text-muted-foreground text-xs",children:"No actions configured yet. Create actions in Admin → Actions."}):c.jsx("div",{className:"divide-border rounded-md border",children:(me.data??[]).map(fe=>c.jsxs("div",{className:"flex items-center justify-between gap-3 px-3 py-2",children:[c.jsxs("div",{className:"flex min-w-0 flex-col",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-sm font-medium",children:fe.label}),fe.make_target&&c.jsx("code",{className:"text-muted-foreground text-xs",children:fe.make_target})]}),fe.description&&c.jsx("p",{className:"text-muted-foreground line-clamp-2 text-xs",children:fe.description})]}),c.jsx(Pe,{size:"sm",onClick:()=>fe.id&&Lt(fe.id),disabled:!fe.id||ie(`run:${fe.id}`),children:fe.id&&ie(`run:${fe.id}`)?"Enqueueing…":"Run"})]},fe.id))})}),c.jsxs("div",{className:"mt-3 space-y-1",children:[c.jsx(Gs,{className:"text-xs",children:"Recent Runs"}),Xe.isLoading?c.jsx("p",{className:"text-muted-foreground text-xs",children:"Loading runs…"}):(Xe.data??[]).length===0?c.jsx("p",{className:"text-muted-foreground text-xs",children:"No runs yet for this cluster."}):c.jsx("div",{className:"overflow-x-auto rounded-md border",children:c.jsxs(Js,{children:[c.jsx(Ws,{children:c.jsxs(Qt,{children:[c.jsx(St,{children:"Action"}),c.jsx(St,{children:"Status"}),c.jsx(St,{children:"Created"}),c.jsx(St,{children:"Finished"}),c.jsx(St,{children:"Error"})]})}),c.jsx(Qs,{children:(Xe.data??[]).slice(0,20).map(fe=>c.jsxs(Qt,{children:[c.jsx(dt,{className:"min-w-[220px]",children:c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-sm font-medium",children:Te(fe)}),fe.id&&c.jsx("code",{className:"text-muted-foreground text-xs",children:za(fe.id,8)})]})}),c.jsx(dt,{children:c.jsx(xxe,{status:fe.status})}),c.jsx(dt,{className:"text-xs",children:L3(fe.created_at)}),c.jsx(dt,{className:"text-xs",children:L3(fe.finished_at)}),c.jsx(dt,{className:"text-xs",children:fe.error?za(fe.error,80):"-"})]},fe.id))})]})})]})]}),c.jsxs("section",{className:"space-y-2 rounded-xl border p-4",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(uJ,{className:"h-4 w-4"}),c.jsx("h3",{className:"text-sm font-semibold",children:"Kubeconfig"})]}),c.jsx("p",{className:"text-muted-foreground text-xs",children:"Paste the kubeconfig for this cluster. It will be stored encrypted and never returned by the API."})]}),c.jsx(nl,{value:te,onChange:fe=>de(fe.target.value),rows:6,placeholder:`apiVersion: v1 clusters: - cluster: ...`,className:"font-mono text-xs"}),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsx(Pe,{size:"sm",onClick:oe,disabled:ie("kubeconfig"),children:ie("kubeconfig")?"Saving…":"Save kubeconfig"}),c.jsx(Pe,{size:"sm",variant:"outline",onClick:ve,disabled:ie("kubeconfig"),children:"Clear kubeconfig"})]})]}),c.jsxs("section",{className:"space-y-2 rounded-xl border p-4",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-semibold",children:"Captain Domain"}),c.jsx("p",{className:"text-muted-foreground text-xs",children:"Domain used for the AutoGlue captain endpoint."})]}),c.jsx("div",{className:"text-right text-xs",children:c.jsx("div",{className:"font-mono",children:E.captain_domain?E.captain_domain.domain_name:"Not attached"})})]}),c.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-end",children:[c.jsxs("div",{className:"flex-1",children:[c.jsx(Gs,{className:"text-xs",children:"Domain"}),c.jsxs(_n,{value:k,onValueChange:fe=>{R(fe),I("")},children:[c.jsx(Nn,{className:"w-full",children:c.jsx($n,{placeholder:ue.isLoading?"Loading domains…":"Select domain"})}),c.jsx(Dn,{children:(ue.data??[]).map(fe=>c.jsx(Ct,{value:fe.id,children:fe.domain_name},fe.id))})]}),c.jsx("p",{className:"text-muted-foreground mt-1 text-[11px]",children:"Once a domain is attached, control plane record sets for that domain will be available below."})]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(Pe,{size:"sm",onClick:qe,disabled:ie("captain")||ue.isLoading,children:ie("captain")?"Attaching…":"Attach"}),c.jsx(Pe,{size:"sm",variant:"outline",onClick:Bt,disabled:ie("captain")||!E.captain_domain,children:"Detach"})]})]})]}),k&&c.jsxs("section",{className:"space-y-2 rounded-xl border p-4",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-semibold",children:"Control Plane Record Set"}),c.jsx("p",{className:"text-muted-foreground text-xs",children:"DNS record set used for the cluster control plane endpoint."})]}),c.jsx("div",{className:"text-right text-xs",children:c.jsx("div",{className:"font-mono",children:E.control_plane_record_set?E.control_plane_record_set.name:"Not attached"})})]}),c.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-end",children:[c.jsxs("div",{className:"flex-1",children:[c.jsx(Gs,{className:"text-xs",children:"Record Set"}),c.jsxs(_n,{value:M,onValueChange:fe=>I(fe),children:[c.jsx(Nn,{className:"w-full",children:c.jsx($n,{placeholder:ne.isLoading?"Loading record sets…":"Select record set"})}),c.jsx(Dn,{children:(ne.data??[]).map(fe=>c.jsxs(Ct,{value:fe.id,children:[fe.name," · ",fe.type]},fe.id))})]})]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(Pe,{size:"sm",onClick:kt,disabled:ie("recordset")||ne.isLoading,children:ie("recordset")?"Attaching…":"Attach"}),c.jsx(Pe,{size:"sm",variant:"outline",onClick:G,disabled:ie("recordset")||!E.control_plane_record_set,children:"Detach"})]})]})]}),c.jsxs("section",{className:"space-y-2 rounded-xl border p-4",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-semibold",children:"Apps Load Balancer"}),c.jsx("p",{className:"text-muted-foreground text-xs",children:"Frontend load balancer for application traffic."})]}),c.jsx("div",{className:"text-right text-xs",children:c.jsx("div",{className:"font-mono",children:E.apps_load_balancer?E.apps_load_balancer.name:"Not attached"})})]}),c.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-end",children:[c.jsxs("div",{className:"flex-1",children:[c.jsx(Gs,{className:"text-xs",children:"Apps Load Balancer"}),c.jsxs(_n,{value:F,onValueChange:fe=>H(fe),children:[c.jsx(Nn,{className:"w-full",children:c.jsx($n,{placeholder:He.isLoading?"Loading load balancers…":"Select apps LB"})}),c.jsx(Dn,{children:Je.map(fe=>c.jsxs(Ct,{value:fe.id,children:[fe.name," · ",fe.public_ip_address]},fe.id))})]})]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(Pe,{size:"sm",onClick:On,disabled:ie("apps-lb")||He.isLoading,children:ie("apps-lb")?"Attaching…":"Attach"}),c.jsx(Pe,{size:"sm",variant:"outline",onClick:mn,disabled:ie("apps-lb")||!E.apps_load_balancer,children:"Detach"})]})]})]}),c.jsxs("section",{className:"space-y-2 rounded-xl border p-4",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-semibold",children:"GlueOps / Control-plane Load Balancer"}),c.jsx("p",{className:"text-muted-foreground text-xs",children:"Load balancer for GlueOps/control-plane traffic."})]}),c.jsx("div",{className:"text-right text-xs",children:c.jsx("div",{className:"font-mono",children:E.glueops_load_balancer?E.glueops_load_balancer.name:"Not attached"})})]}),c.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-end",children:[c.jsxs("div",{className:"flex-1",children:[c.jsx(Gs,{className:"text-xs",children:"GlueOps Load Balancer"}),c.jsxs(_n,{value:V,onValueChange:fe=>K(fe),children:[c.jsx(Nn,{className:"w-full",children:c.jsx($n,{placeholder:He.isLoading?"Loading load balancers…":"Select GlueOps LB"})}),c.jsx(Dn,{children:Tt.map(fe=>c.jsxs(Ct,{value:fe.id,children:[fe.name," · ",fe.private_ip_address]},fe.id))})]})]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(Pe,{size:"sm",onClick:Oi,disabled:ie("glueops-lb")||He.isLoading,children:ie("glueops-lb")?"Attaching…":"Attach"}),c.jsx(Pe,{size:"sm",variant:"outline",onClick:ge,disabled:ie("glueops-lb")||!E.glueops_load_balancer,children:"Detach"})]})]})]}),c.jsxs("section",{className:"space-y-2 rounded-xl border p-4",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(J_,{className:"h-4 w-4"}),c.jsx("h3",{className:"text-sm font-semibold",children:"Bastion Server"})]}),c.jsx("p",{className:"text-muted-foreground text-xs",children:"SSH bastion used to reach the cluster nodes."})]}),c.jsx("div",{className:"text-right text-xs",children:c.jsx("div",{className:"font-mono",children:E.bastion_server?E.bastion_server.hostname??E.bastion_server.id:"Not attached"})})]}),c.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-end",children:[c.jsxs("div",{className:"flex-1",children:[c.jsx(Gs,{className:"text-xs",children:"Bastion Server"}),c.jsxs(_n,{value:z,onValueChange:fe=>W(fe),children:[c.jsx(Nn,{className:"w-full",children:c.jsx($n,{placeholder:ce.isLoading?"Loading servers…":"Select server"})}),c.jsx(Dn,{children:(ce.data??[]).map(fe=>c.jsxs(Ct,{value:fe.id,children:[fe.hostname??fe.id," · ",fe.private_ip_address]},fe.id))})]})]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(Pe,{size:"sm",onClick:Me,disabled:ie("bastion")||ce.isLoading,children:ie("bastion")?"Attaching…":"Attach"}),c.jsx(Pe,{size:"sm",variant:"outline",onClick:_,disabled:ie("bastion")||!E.bastion_server,children:"Detach"})]})]})]}),c.jsxs("section",{className:"space-y-2 rounded-xl border p-4",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-semibold",children:"Node Pools"}),c.jsx("p",{className:"text-muted-foreground text-xs",children:"Attach node pools to this cluster. Each node pool may have its own labels, taints, and backing servers."})]}),c.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-end",children:[c.jsxs("div",{className:"flex-1",children:[c.jsx(Gs,{className:"text-xs",children:"Available Node Pools"}),c.jsxs(_n,{value:ae,onValueChange:fe=>Q(fe),children:[c.jsx(Nn,{className:"w-full",children:c.jsx($n,{placeholder:$e.isLoading?"Loading node pools…":"Select node pool"})}),c.jsx(Dn,{children:($e.data??[]).map(fe=>c.jsxs(Ct,{value:fe.id,children:[fe.name," · ",fe.role]},fe.id))})]})]}),c.jsx("div",{className:"flex gap-2",children:c.jsx(Pe,{size:"sm",onClick:q,disabled:ie("nodepool")||$e.isLoading,children:ie("nodepool")?"Attaching…":"Attach"})})]}),c.jsxs("div",{className:"mt-3 space-y-1",children:[c.jsx(Gs,{className:"text-xs",children:"Attached Node Pools"}),E.node_pools&&E.node_pools.length>0?c.jsx("div",{className:"divide-border mt-1 rounded-md border",children:E.node_pools.map(fe=>c.jsxs("div",{className:"flex items-center justify-between gap-3 px-3 py-2 text-xs",children:[c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"font-medium",children:fe.name}),c.jsxs("span",{className:"text-muted-foreground",children:["role: ",fe.role," · servers: ",fe.servers?.length??0]})]}),c.jsx(Pe,{size:"sm",variant:"outline",onClick:()=>fe.id&&X(fe.id),disabled:ie("nodepool"),children:"Detach"})]},fe.id))}):c.jsx("p",{className:"text-muted-foreground mt-1 text-xs",children:"No node pools attached to this cluster yet."})]})]}),c.jsx(gn,{className:"mt-2",children:c.jsx(Pe,{variant:"outline",onClick:()=>A(null),children:"Close"})})]})]})}),c.jsx(dn,{open:!!m,onOpenChange:fe=>!fe&&g(null),children:c.jsxs(hn,{className:"sm:max-w-md",children:[c.jsx(pn,{children:c.jsx(fn,{children:"Delete cluster"})}),c.jsx("p",{className:"text-muted-foreground text-sm",children:"This action cannot be undone. Are you sure you want to delete this cluster?"}),c.jsxs(gn,{className:"gap-2",children:[c.jsx(Pe,{variant:"outline",onClick:()=>g(null),children:"Cancel"}),c.jsx(Pe,{variant:"destructive",onClick:()=>m&>.mutate(m),disabled:gt.isPending,children:gt.isPending?"Deleting…":"Delete"})]})]})})]})},Wm=Nte(),ng={listCredentials:()=>ct(async()=>await Wm.listCredentials()),createCredential:async e=>ct(async()=>await Wm.createCredential({dtoCreateCredentialRequest:e})),getCredential:async e=>ct(async()=>await Wm.getCredential({id:e})),deleteCredential:async e=>ct(async()=>{await Wm.deleteCredential({id:e})}),updateCredential:async(e,r)=>ct(async()=>await Wm.updateCredential({id:e,dtoUpdateCredentialRequest:r})),revealCredential:async e=>ct(async()=>await Wm.revealCredential({id:e}))};var Sxe=Symbol("radix.slottable");function Exe(e){const r=({children:s})=>c.jsx(c.Fragment,{children:s});return r.displayName=`${e}.Slottable`,r.__radixId=Sxe,r}var Eq="AlertDialog",[jxe]=cl(Eq,[IL]),bu=IL(),jq=e=>{const{__scopeAlertDialog:r,...s}=e,o=bu(r);return c.jsx(LC,{...o,...s,modal:!0})};jq.displayName=Eq;var Cxe="AlertDialogTrigger",Cq=T.forwardRef((e,r)=>{const{__scopeAlertDialog:s,...o}=e,u=bu(s);return c.jsx(QL,{...u,...o,ref:r})});Cq.displayName=Cxe;var Axe="AlertDialogPortal",Aq=e=>{const{__scopeAlertDialog:r,...s}=e,o=bu(r);return c.jsx(FC,{...o,...s})};Aq.displayName=Axe;var Oxe="AlertDialogOverlay",Oq=T.forwardRef((e,r)=>{const{__scopeAlertDialog:s,...o}=e,u=bu(s);return c.jsx(qC,{...u,...o,ref:r})});Oq.displayName=Oxe;var bg="AlertDialogContent",[kxe,Rxe]=jxe(bg),Txe=Exe("AlertDialogContent"),kq=T.forwardRef((e,r)=>{const{__scopeAlertDialog:s,children:o,...u}=e,h=bu(s),m=T.useRef(null),g=Ln(r,m),b=T.useRef(null);return c.jsx(Iae,{contentName:bg,titleName:Rq,docsSlug:"alert-dialog",children:c.jsx(kxe,{scope:s,cancelRef:b,children:c.jsxs(BC,{role:"alertdialog",...h,...u,ref:g,onOpenAutoFocus:Nt(u.onOpenAutoFocus,w=>{w.preventDefault(),b.current?.focus({preventScroll:!0})}),onPointerDownOutside:w=>w.preventDefault(),onInteractOutside:w=>w.preventDefault(),children:[c.jsx(Txe,{children:o}),c.jsx($xe,{contentRef:m})]})})})});kq.displayName=bg;var Rq="AlertDialogTitle",Tq=T.forwardRef((e,r)=>{const{__scopeAlertDialog:s,...o}=e,u=bu(s);return c.jsx(g2,{...u,...o,ref:r})});Tq.displayName=Rq;var _q="AlertDialogDescription",$q=T.forwardRef((e,r)=>{const{__scopeAlertDialog:s,...o}=e,u=bu(s);return c.jsx(y2,{...u,...o,ref:r})});$q.displayName=_q;var _xe="AlertDialogAction",Nq=T.forwardRef((e,r)=>{const{__scopeAlertDialog:s,...o}=e,u=bu(s);return c.jsx(pw,{...u,...o,ref:r})});Nq.displayName=_xe;var Dq="AlertDialogCancel",Pq=T.forwardRef((e,r)=>{const{__scopeAlertDialog:s,...o}=e,{cancelRef:u}=Rxe(Dq,s),h=bu(s),m=Ln(r,u);return c.jsx(pw,{...h,...o,ref:m})});Pq.displayName=Dq;var $xe=({contentRef:e})=>{const r=`\`${bg}\` requires a description for the component to be accessible for screen reader users. You can add a description to the \`${bg}\` by passing a \`${_q}\` 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 \`${bg}\`. 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 T.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(r)},[r,e]),null},Nxe=jq,Dxe=Cq,Pxe=Aq,Mxe=Oq,Ixe=kq,zxe=Nq,Lxe=Pq,Fxe=Tq,qxe=$q;function uC({...e}){return c.jsx(Nxe,{"data-slot":"alert-dialog",...e})}function dC({...e}){return c.jsx(Dxe,{"data-slot":"alert-dialog-trigger",...e})}function Bxe({...e}){return c.jsx(Pxe,{"data-slot":"alert-dialog-portal",...e})}function Uxe({className:e,...r}){return c.jsx(Mxe,{"data-slot":"alert-dialog-overlay",className:vt("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),...r})}function hC({className:e,...r}){return c.jsxs(Bxe,{children:[c.jsx(Uxe,{}),c.jsx(Ixe,{"data-slot":"alert-dialog-content",className:vt("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),...r})]})}function pC({className:e,...r}){return c.jsx("div",{"data-slot":"alert-dialog-header",className:vt("flex flex-col gap-2 text-center sm:text-left",e),...r})}function fC({className:e,...r}){return c.jsx("div",{"data-slot":"alert-dialog-footer",className:vt("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...r})}function mC({className:e,...r}){return c.jsx(Fxe,{"data-slot":"alert-dialog-title",className:vt("text-lg font-semibold",e),...r})}function gC({className:e,...r}){return c.jsx(qxe,{"data-slot":"alert-dialog-description",className:vt("text-muted-foreground text-sm",e),...r})}function yC({className:e,...r}){return c.jsx(zxe,{className:vt(n2(),e),...r})}function vC({className:e,...r}){return c.jsx(Lxe,{className:vt(n2({variant:"outline"}),e),...r})}var AT="rovingFocusGroup.onEntryFocus",Kxe={bubbles:!1,cancelable:!0},ww="RovingFocusGroup",[D_,Mq,Vxe]=m$(ww),[Hxe,Iq]=cl(ww,[Vxe]),[Gxe,Xxe]=Hxe(ww),zq=T.forwardRef((e,r)=>c.jsx(D_.Provider,{scope:e.__scopeRovingFocusGroup,children:c.jsx(D_.Slot,{scope:e.__scopeRovingFocusGroup,children:c.jsx(Yxe,{...e,ref:r})})}));zq.displayName=ww;var Yxe=T.forwardRef((e,r)=>{const{__scopeRovingFocusGroup:s,orientation:o,loop:u=!1,dir:h,currentTabStopId:m,defaultCurrentTabStopId:g,onCurrentTabStopIdChange:b,onEntryFocus:w,preventScrollOnEntryFocus:E=!1,...A}=e,k=T.useRef(null),R=Ln(r,k),M=g$(h),[I,F]=Kd({prop:m,defaultProp:g??null,onChange:b,caller:ww}),[H,V]=T.useState(!1),K=sl(w),z=Mq(s),W=T.useRef(!1),[ae,Q]=T.useState(0);return T.useEffect(()=>{const te=k.current;if(te)return te.addEventListener(AT,K),()=>te.removeEventListener(AT,K)},[K]),c.jsx(Gxe,{scope:s,orientation:o,dir:M,loop:u,currentTabStopId:I,onItemFocus:T.useCallback(te=>F(te),[F]),onItemShiftTab:T.useCallback(()=>V(!0),[]),onFocusableItemAdd:T.useCallback(()=>Q(te=>te+1),[]),onFocusableItemRemove:T.useCallback(()=>Q(te=>te-1),[]),children:c.jsx(An.div,{tabIndex:H||ae===0?-1:0,"data-orientation":o,...A,ref:R,style:{outline:"none",...e.style},onMouseDown:Nt(e.onMouseDown,()=>{W.current=!0}),onFocus:Nt(e.onFocus,te=>{const de=!W.current;if(te.target===te.currentTarget&&de&&!H){const je=new CustomEvent(AT,Kxe);if(te.currentTarget.dispatchEvent(je),!je.defaultPrevented){const we=z().filter(ue=>ue.focusable),ie=we.find(ue=>ue.active),Se=we.find(ue=>ue.id===I),He=[ie,Se,...we].filter(Boolean).map(ue=>ue.ref.current);qq(He,E)}}W.current=!1}),onBlur:Nt(e.onBlur,()=>V(!1))})})}),Lq="RovingFocusGroupItem",Fq=T.forwardRef((e,r)=>{const{__scopeRovingFocusGroup:s,focusable:o=!0,active:u=!1,tabStopId:h,children:m,...g}=e,b=Ys(),w=h||b,E=Xxe(Lq,s),A=E.currentTabStopId===w,k=Mq(s),{onFocusableItemAdd:R,onFocusableItemRemove:M,currentTabStopId:I}=E;return T.useEffect(()=>{if(o)return R(),()=>M()},[o,R,M]),c.jsx(D_.ItemSlot,{scope:s,id:w,focusable:o,active:u,children:c.jsx(An.span,{tabIndex:A?0:-1,"data-orientation":E.orientation,...g,ref:r,onMouseDown:Nt(e.onMouseDown,F=>{o?E.onItemFocus(w):F.preventDefault()}),onFocus:Nt(e.onFocus,()=>E.onItemFocus(w)),onKeyDown:Nt(e.onKeyDown,F=>{if(F.key==="Tab"&&F.shiftKey){E.onItemShiftTab();return}if(F.target!==F.currentTarget)return;const H=Wxe(F,E.orientation,E.dir);if(H!==void 0){if(F.metaKey||F.ctrlKey||F.altKey||F.shiftKey)return;F.preventDefault();let K=k().filter(z=>z.focusable).map(z=>z.ref.current);if(H==="last")K.reverse();else if(H==="prev"||H==="next"){H==="prev"&&K.reverse();const z=K.indexOf(F.currentTarget);K=E.loop?Qxe(K,z+1):K.slice(z+1)}setTimeout(()=>qq(K))}}),children:typeof m=="function"?m({isCurrentTabStop:A,hasTabStop:I!=null}):m})})});Fq.displayName=Lq;var Zxe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Jxe(e,r){return r!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Wxe(e,r,s){const o=Jxe(e.key,s);if(!(r==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(r==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return Zxe[o]}function qq(e,r=!1){const s=document.activeElement;for(const o of e)if(o===s||(o.focus({preventScroll:r}),document.activeElement!==s))return}function Qxe(e,r){return e.map((s,o)=>e[(r+o)%e.length])}var ebe=zq,tbe=Fq;function nbe(e){const r=rbe(e),s=T.forwardRef((o,u)=>{const{children:h,...m}=o,g=T.Children.toArray(h),b=g.find(ibe);if(b){const w=b.props.children,E=g.map(A=>A===b?T.Children.count(w)>1?T.Children.only(null):T.isValidElement(w)?w.props.children:null:A);return c.jsx(r,{...m,ref:u,children:T.isValidElement(w)?T.cloneElement(w,void 0,E):null})}return c.jsx(r,{...m,ref:u,children:h})});return s.displayName=`${e}.Slot`,s}function rbe(e){const r=T.forwardRef((s,o)=>{const{children:u,...h}=s;if(T.isValidElement(u)){const m=obe(u),g=abe(h,u.props);return u.type!==T.Fragment&&(g.ref=o?Gi(o,m):m),T.cloneElement(u,g)}return T.Children.count(u)>1?T.Children.only(null):null});return r.displayName=`${e}.SlotClone`,r}var sbe=Symbol("radix.slottable");function ibe(e){return T.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===sbe}function abe(e,r){const s={...r};for(const o in r){const u=e[o],h=r[o];/^on[A-Z]/.test(o)?u&&h?s[o]=(...g)=>{const b=h(...g);return u(...g),b}:u&&(s[o]=u):o==="style"?s[o]={...u,...h}:o==="className"&&(s[o]=[u,h].filter(Boolean).join(" "))}return{...e,...s}}function obe(e){let r=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=r&&"isReactWarning"in r&&r.isReactWarning;return s?e.ref:(r=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=r&&"isReactWarning"in r&&r.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}var P_=["Enter"," "],lbe=["ArrowDown","PageUp","Home"],Bq=["ArrowUp","PageDown","End"],cbe=[...lbe,...Bq],ube={ltr:[...P_,"ArrowRight"],rtl:[...P_,"ArrowLeft"]},dbe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Sw="Menu",[rw,hbe,pbe]=m$(Sw),[Lp,Uq]=cl(Sw,[pbe,Yd,Iq]),iA=Yd(),Kq=Iq(),[fbe,Fp]=Lp(Sw),[mbe,Ew]=Lp(Sw),Vq=e=>{const{__scopeMenu:r,open:s=!1,children:o,dir:u,onOpenChange:h,modal:m=!0}=e,g=iA(r),[b,w]=T.useState(null),E=T.useRef(!1),A=sl(h),k=g$(u);return T.useEffect(()=>{const R=()=>{E.current=!0,document.addEventListener("pointerdown",M,{capture:!0,once:!0}),document.addEventListener("pointermove",M,{capture:!0,once:!0})},M=()=>E.current=!1;return document.addEventListener("keydown",R,{capture:!0}),()=>{document.removeEventListener("keydown",R,{capture:!0}),document.removeEventListener("pointerdown",M,{capture:!0}),document.removeEventListener("pointermove",M,{capture:!0})}},[]),c.jsx(TC,{...g,children:c.jsx(fbe,{scope:r,open:s,onOpenChange:A,content:b,onContentChange:w,children:c.jsx(mbe,{scope:r,onClose:T.useCallback(()=>A(!1),[A]),isUsingKeyboardRef:E,dir:k,modal:m,children:o})})})};Vq.displayName=Sw;var gbe="MenuAnchor",v$=T.forwardRef((e,r)=>{const{__scopeMenu:s,...o}=e,u=iA(s);return c.jsx(ow,{...u,...o,ref:r})});v$.displayName=gbe;var x$="MenuPortal",[ybe,Hq]=Lp(x$,{forceMount:void 0}),Gq=e=>{const{__scopeMenu:r,forceMount:s,children:o,container:u}=e,h=Fp(x$,r);return c.jsx(ybe,{scope:r,forceMount:s,children:c.jsx(po,{present:s||h.open,children:c.jsx(Mg,{asChild:!0,container:u,children:o})})})};Gq.displayName=x$;var uo="MenuContent",[vbe,b$]=Lp(uo),Xq=T.forwardRef((e,r)=>{const s=Hq(uo,e.__scopeMenu),{forceMount:o=s.forceMount,...u}=e,h=Fp(uo,e.__scopeMenu),m=Ew(uo,e.__scopeMenu);return c.jsx(rw.Provider,{scope:e.__scopeMenu,children:c.jsx(po,{present:o||h.open,children:c.jsx(rw.Slot,{scope:e.__scopeMenu,children:m.modal?c.jsx(xbe,{...u,ref:r}):c.jsx(bbe,{...u,ref:r})})})})}),xbe=T.forwardRef((e,r)=>{const s=Fp(uo,e.__scopeMenu),o=T.useRef(null),u=Ln(r,o);return T.useEffect(()=>{const h=o.current;if(h)return IC(h)},[]),c.jsx(w$,{...e,ref:u,trapFocus:s.open,disableOutsidePointerEvents:s.open,disableOutsideScroll:!0,onFocusOutside:Nt(e.onFocusOutside,h=>h.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>s.onOpenChange(!1)})}),bbe=T.forwardRef((e,r)=>{const s=Fp(uo,e.__scopeMenu);return c.jsx(w$,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>s.onOpenChange(!1)})}),wbe=nbe("MenuContent.ScrollLock"),w$=T.forwardRef((e,r)=>{const{__scopeMenu:s,loop:o=!1,trapFocus:u,onOpenAutoFocus:h,onCloseAutoFocus:m,disableOutsidePointerEvents:g,onEntryFocus:b,onEscapeKeyDown:w,onPointerDownOutside:E,onFocusOutside:A,onInteractOutside:k,onDismiss:R,disableOutsideScroll:M,...I}=e,F=Fp(uo,s),H=Ew(uo,s),V=iA(s),K=Kq(s),z=hbe(s),[W,ae]=T.useState(null),Q=T.useRef(null),te=Ln(r,Q,F.onContentChange),de=T.useRef(0),je=T.useRef(""),we=T.useRef(0),ie=T.useRef(null),Se=T.useRef("right"),Ae=T.useRef(0),He=M?hw:T.Fragment,ue=M?{as:wbe,allowPinchZoom:!0}:void 0,ne=$e=>{const me=je.current+$e,Xe=z().filter(Fe=>!Fe.disabled),Oe=document.activeElement,Te=Xe.find(Fe=>Fe.ref.current===Oe)?.textValue,Ke=Xe.map(Fe=>Fe.textValue),se=Nbe(Ke,me,Te),Ne=Xe.find(Fe=>Fe.textValue===se)?.ref.current;(function Fe(at){je.current=at,window.clearTimeout(de.current),at!==""&&(de.current=window.setTimeout(()=>Fe(""),1e3))})(me),Ne&&setTimeout(()=>Ne.focus())};T.useEffect(()=>()=>window.clearTimeout(de.current),[]),PC();const ce=T.useCallback($e=>Se.current===ie.current?.side&&Pbe($e,ie.current?.area),[]);return c.jsx(vbe,{scope:s,searchRef:je,onItemEnter:T.useCallback($e=>{ce($e)&&$e.preventDefault()},[ce]),onItemLeave:T.useCallback($e=>{ce($e)||(Q.current?.focus(),ae(null))},[ce]),onTriggerLeave:T.useCallback($e=>{ce($e)&&$e.preventDefault()},[ce]),pointerGraceTimerRef:we,onPointerGraceIntentChange:T.useCallback($e=>{ie.current=$e},[]),children:c.jsx(He,{...ue,children:c.jsx(dw,{asChild:!0,trapped:u,onMountAutoFocus:Nt(h,$e=>{$e.preventDefault(),Q.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:m,children:c.jsx(Ng,{asChild:!0,disableOutsidePointerEvents:g,onEscapeKeyDown:w,onPointerDownOutside:E,onFocusOutside:A,onInteractOutside:k,onDismiss:R,children:c.jsx(ebe,{asChild:!0,...K,dir:H.dir,orientation:"vertical",loop:o,currentTabStopId:W,onCurrentTabStopIdChange:ae,onEntryFocus:Nt(b,$e=>{H.isUsingKeyboardRef.current||$e.preventDefault()}),preventScrollOnEntryFocus:!0,children:c.jsx(_C,{role:"menu","aria-orientation":"vertical","data-state":uB(F.open),"data-radix-menu-content":"",dir:H.dir,...V,...I,ref:te,style:{outline:"none",...I.style},onKeyDown:Nt(I.onKeyDown,$e=>{const Xe=$e.target.closest("[data-radix-menu-content]")===$e.currentTarget,Oe=$e.ctrlKey||$e.altKey||$e.metaKey,Te=$e.key.length===1;Xe&&($e.key==="Tab"&&$e.preventDefault(),!Oe&&Te&&ne($e.key));const Ke=Q.current;if($e.target!==Ke||!cbe.includes($e.key))return;$e.preventDefault();const Ne=z().filter(Fe=>!Fe.disabled).map(Fe=>Fe.ref.current);Bq.includes($e.key)&&Ne.reverse(),_be(Ne)}),onBlur:Nt(e.onBlur,$e=>{$e.currentTarget.contains($e.target)||(window.clearTimeout(de.current),je.current="")}),onPointerMove:Nt(e.onPointerMove,sw($e=>{const me=$e.target,Xe=Ae.current!==$e.clientX;if($e.currentTarget.contains(me)&&Xe){const Oe=$e.clientX>Ae.current?"right":"left";Se.current=Oe,Ae.current=$e.clientX}}))})})})})})})});Xq.displayName=uo;var Sbe="MenuGroup",S$=T.forwardRef((e,r)=>{const{__scopeMenu:s,...o}=e;return c.jsx(An.div,{role:"group",...o,ref:r})});S$.displayName=Sbe;var Ebe="MenuLabel",Yq=T.forwardRef((e,r)=>{const{__scopeMenu:s,...o}=e;return c.jsx(An.div,{...o,ref:r})});Yq.displayName=Ebe;var xC="MenuItem",F3="menu.itemSelect",aA=T.forwardRef((e,r)=>{const{disabled:s=!1,onSelect:o,...u}=e,h=T.useRef(null),m=Ew(xC,e.__scopeMenu),g=b$(xC,e.__scopeMenu),b=Ln(r,h),w=T.useRef(!1),E=()=>{const A=h.current;if(!s&&A){const k=new CustomEvent(F3,{bubbles:!0,cancelable:!0});A.addEventListener(F3,R=>o?.(R),{once:!0}),qz(A,k),k.defaultPrevented?w.current=!1:m.onClose()}};return c.jsx(Zq,{...u,ref:b,disabled:s,onClick:Nt(e.onClick,E),onPointerDown:A=>{e.onPointerDown?.(A),w.current=!0},onPointerUp:Nt(e.onPointerUp,A=>{w.current||A.currentTarget?.click()}),onKeyDown:Nt(e.onKeyDown,A=>{const k=g.searchRef.current!=="";s||k&&A.key===" "||P_.includes(A.key)&&(A.currentTarget.click(),A.preventDefault())})})});aA.displayName=xC;var Zq=T.forwardRef((e,r)=>{const{__scopeMenu:s,disabled:o=!1,textValue:u,...h}=e,m=b$(xC,s),g=Kq(s),b=T.useRef(null),w=Ln(r,b),[E,A]=T.useState(!1),[k,R]=T.useState("");return T.useEffect(()=>{const M=b.current;M&&R((M.textContent??"").trim())},[h.children]),c.jsx(rw.ItemSlot,{scope:s,disabled:o,textValue:u??k,children:c.jsx(tbe,{asChild:!0,...g,focusable:!o,children:c.jsx(An.div,{role:"menuitem","data-highlighted":E?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...h,ref:w,onPointerMove:Nt(e.onPointerMove,sw(M=>{o?m.onItemLeave(M):(m.onItemEnter(M),M.defaultPrevented||M.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Nt(e.onPointerLeave,sw(M=>m.onItemLeave(M))),onFocus:Nt(e.onFocus,()=>A(!0)),onBlur:Nt(e.onBlur,()=>A(!1))})})})}),jbe="MenuCheckboxItem",Jq=T.forwardRef((e,r)=>{const{checked:s=!1,onCheckedChange:o,...u}=e;return c.jsx(nB,{scope:e.__scopeMenu,checked:s,children:c.jsx(aA,{role:"menuitemcheckbox","aria-checked":bC(s)?"mixed":s,...u,ref:r,"data-state":j$(s),onSelect:Nt(u.onSelect,()=>o?.(bC(s)?!0:!s),{checkForDefaultPrevented:!1})})})});Jq.displayName=jbe;var Wq="MenuRadioGroup",[Cbe,Abe]=Lp(Wq,{value:void 0,onValueChange:()=>{}}),Qq=T.forwardRef((e,r)=>{const{value:s,onValueChange:o,...u}=e,h=sl(o);return c.jsx(Cbe,{scope:e.__scopeMenu,value:s,onValueChange:h,children:c.jsx(S$,{...u,ref:r})})});Qq.displayName=Wq;var eB="MenuRadioItem",tB=T.forwardRef((e,r)=>{const{value:s,...o}=e,u=Abe(eB,e.__scopeMenu),h=s===u.value;return c.jsx(nB,{scope:e.__scopeMenu,checked:h,children:c.jsx(aA,{role:"menuitemradio","aria-checked":h,...o,ref:r,"data-state":j$(h),onSelect:Nt(o.onSelect,()=>u.onValueChange?.(s),{checkForDefaultPrevented:!1})})})});tB.displayName=eB;var E$="MenuItemIndicator",[nB,Obe]=Lp(E$,{checked:!1}),rB=T.forwardRef((e,r)=>{const{__scopeMenu:s,forceMount:o,...u}=e,h=Obe(E$,s);return c.jsx(po,{present:o||bC(h.checked)||h.checked===!0,children:c.jsx(An.span,{...u,ref:r,"data-state":j$(h.checked)})})});rB.displayName=E$;var kbe="MenuSeparator",sB=T.forwardRef((e,r)=>{const{__scopeMenu:s,...o}=e;return c.jsx(An.div,{role:"separator","aria-orientation":"horizontal",...o,ref:r})});sB.displayName=kbe;var Rbe="MenuArrow",iB=T.forwardRef((e,r)=>{const{__scopeMenu:s,...o}=e,u=iA(s);return c.jsx($C,{...u,...o,ref:r})});iB.displayName=Rbe;var Tbe="MenuSub",[OSe,aB]=Lp(Tbe),Db="MenuSubTrigger",oB=T.forwardRef((e,r)=>{const s=Fp(Db,e.__scopeMenu),o=Ew(Db,e.__scopeMenu),u=aB(Db,e.__scopeMenu),h=b$(Db,e.__scopeMenu),m=T.useRef(null),{pointerGraceTimerRef:g,onPointerGraceIntentChange:b}=h,w={__scopeMenu:e.__scopeMenu},E=T.useCallback(()=>{m.current&&window.clearTimeout(m.current),m.current=null},[]);return T.useEffect(()=>E,[E]),T.useEffect(()=>{const A=g.current;return()=>{window.clearTimeout(A),b(null)}},[g,b]),c.jsx(v$,{asChild:!0,...w,children:c.jsx(Zq,{id:u.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":u.contentId,"data-state":uB(s.open),...e,ref:Gi(r,u.onTriggerChange),onClick:A=>{e.onClick?.(A),!(e.disabled||A.defaultPrevented)&&(A.currentTarget.focus(),s.open||s.onOpenChange(!0))},onPointerMove:Nt(e.onPointerMove,sw(A=>{h.onItemEnter(A),!A.defaultPrevented&&!e.disabled&&!s.open&&!m.current&&(h.onPointerGraceIntentChange(null),m.current=window.setTimeout(()=>{s.onOpenChange(!0),E()},100))})),onPointerLeave:Nt(e.onPointerLeave,sw(A=>{E();const k=s.content?.getBoundingClientRect();if(k){const R=s.content?.dataset.side,M=R==="right",I=M?-5:5,F=k[M?"left":"right"],H=k[M?"right":"left"];h.onPointerGraceIntentChange({area:[{x:A.clientX+I,y:A.clientY},{x:F,y:k.top},{x:H,y:k.top},{x:H,y:k.bottom},{x:F,y:k.bottom}],side:R}),window.clearTimeout(g.current),g.current=window.setTimeout(()=>h.onPointerGraceIntentChange(null),300)}else{if(h.onTriggerLeave(A),A.defaultPrevented)return;h.onPointerGraceIntentChange(null)}})),onKeyDown:Nt(e.onKeyDown,A=>{const k=h.searchRef.current!=="";e.disabled||k&&A.key===" "||ube[o.dir].includes(A.key)&&(s.onOpenChange(!0),s.content?.focus(),A.preventDefault())})})})});oB.displayName=Db;var lB="MenuSubContent",cB=T.forwardRef((e,r)=>{const s=Hq(uo,e.__scopeMenu),{forceMount:o=s.forceMount,...u}=e,h=Fp(uo,e.__scopeMenu),m=Ew(uo,e.__scopeMenu),g=aB(lB,e.__scopeMenu),b=T.useRef(null),w=Ln(r,b);return c.jsx(rw.Provider,{scope:e.__scopeMenu,children:c.jsx(po,{present:o||h.open,children:c.jsx(rw.Slot,{scope:e.__scopeMenu,children:c.jsx(w$,{id:g.contentId,"aria-labelledby":g.triggerId,...u,ref:w,align:"start",side:m.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:E=>{m.isUsingKeyboardRef.current&&b.current?.focus(),E.preventDefault()},onCloseAutoFocus:E=>E.preventDefault(),onFocusOutside:Nt(e.onFocusOutside,E=>{E.target!==g.trigger&&h.onOpenChange(!1)}),onEscapeKeyDown:Nt(e.onEscapeKeyDown,E=>{m.onClose(),E.preventDefault()}),onKeyDown:Nt(e.onKeyDown,E=>{const A=E.currentTarget.contains(E.target),k=dbe[m.dir].includes(E.key);A&&k&&(h.onOpenChange(!1),g.trigger?.focus(),E.preventDefault())})})})})})});cB.displayName=lB;function uB(e){return e?"open":"closed"}function bC(e){return e==="indeterminate"}function j$(e){return bC(e)?"indeterminate":e?"checked":"unchecked"}function _be(e){const r=document.activeElement;for(const s of e)if(s===r||(s.focus(),document.activeElement!==r))return}function $be(e,r){return e.map((s,o)=>e[(r+o)%e.length])}function Nbe(e,r,s){const u=r.length>1&&Array.from(r).every(w=>w===r[0])?r[0]:r,h=s?e.indexOf(s):-1;let m=$be(e,Math.max(h,0));u.length===1&&(m=m.filter(w=>w!==s));const b=m.find(w=>w.toLowerCase().startsWith(u.toLowerCase()));return b!==s?b:void 0}function Dbe(e,r){const{x:s,y:o}=e;let u=!1;for(let h=0,m=r.length-1;ho!=k>o&&s<(A-w)*(o-E)/(k-E)+w&&(u=!u)}return u}function Pbe(e,r){if(!r)return!1;const s={x:e.clientX,y:e.clientY};return Dbe(s,r)}function sw(e){return r=>r.pointerType==="mouse"?e(r):void 0}var Mbe=Vq,Ibe=v$,zbe=Gq,Lbe=Xq,Fbe=S$,qbe=Yq,Bbe=aA,Ube=Jq,Kbe=Qq,Vbe=tB,Hbe=rB,Gbe=sB,Xbe=iB,Ybe=oB,Zbe=cB,oA="DropdownMenu",[Jbe]=cl(oA,[Uq]),Xi=Uq(),[Wbe,dB]=Jbe(oA),hB=e=>{const{__scopeDropdownMenu:r,children:s,dir:o,open:u,defaultOpen:h,onOpenChange:m,modal:g=!0}=e,b=Xi(r),w=T.useRef(null),[E,A]=Kd({prop:u,defaultProp:h??!1,onChange:m,caller:oA});return c.jsx(Wbe,{scope:r,triggerId:Ys(),triggerRef:w,contentId:Ys(),open:E,onOpenChange:A,onOpenToggle:T.useCallback(()=>A(k=>!k),[A]),modal:g,children:c.jsx(Mbe,{...b,open:E,onOpenChange:A,dir:o,modal:g,children:s})})};hB.displayName=oA;var pB="DropdownMenuTrigger",fB=T.forwardRef((e,r)=>{const{__scopeDropdownMenu:s,disabled:o=!1,...u}=e,h=dB(pB,s),m=Xi(s);return c.jsx(Ibe,{asChild:!0,...m,children:c.jsx(An.button,{type:"button",id:h.triggerId,"aria-haspopup":"menu","aria-expanded":h.open,"aria-controls":h.open?h.contentId:void 0,"data-state":h.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...u,ref:Gi(r,h.triggerRef),onPointerDown:Nt(e.onPointerDown,g=>{!o&&g.button===0&&g.ctrlKey===!1&&(h.onOpenToggle(),h.open||g.preventDefault())}),onKeyDown:Nt(e.onKeyDown,g=>{o||(["Enter"," "].includes(g.key)&&h.onOpenToggle(),g.key==="ArrowDown"&&h.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(g.key)&&g.preventDefault())})})})});fB.displayName=pB;var Qbe="DropdownMenuPortal",mB=e=>{const{__scopeDropdownMenu:r,...s}=e,o=Xi(r);return c.jsx(zbe,{...o,...s})};mB.displayName=Qbe;var gB="DropdownMenuContent",yB=T.forwardRef((e,r)=>{const{__scopeDropdownMenu:s,...o}=e,u=dB(gB,s),h=Xi(s),m=T.useRef(!1);return c.jsx(Lbe,{id:u.contentId,"aria-labelledby":u.triggerId,...h,...o,ref:r,onCloseAutoFocus:Nt(e.onCloseAutoFocus,g=>{m.current||u.triggerRef.current?.focus(),m.current=!1,g.preventDefault()}),onInteractOutside:Nt(e.onInteractOutside,g=>{const b=g.detail.originalEvent,w=b.button===0&&b.ctrlKey===!0,E=b.button===2||w;(!u.modal||E)&&(m.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)"}})});yB.displayName=gB;var ewe="DropdownMenuGroup",twe=T.forwardRef((e,r)=>{const{__scopeDropdownMenu:s,...o}=e,u=Xi(s);return c.jsx(Fbe,{...u,...o,ref:r})});twe.displayName=ewe;var nwe="DropdownMenuLabel",rwe=T.forwardRef((e,r)=>{const{__scopeDropdownMenu:s,...o}=e,u=Xi(s);return c.jsx(qbe,{...u,...o,ref:r})});rwe.displayName=nwe;var swe="DropdownMenuItem",vB=T.forwardRef((e,r)=>{const{__scopeDropdownMenu:s,...o}=e,u=Xi(s);return c.jsx(Bbe,{...u,...o,ref:r})});vB.displayName=swe;var iwe="DropdownMenuCheckboxItem",awe=T.forwardRef((e,r)=>{const{__scopeDropdownMenu:s,...o}=e,u=Xi(s);return c.jsx(Ube,{...u,...o,ref:r})});awe.displayName=iwe;var owe="DropdownMenuRadioGroup",lwe=T.forwardRef((e,r)=>{const{__scopeDropdownMenu:s,...o}=e,u=Xi(s);return c.jsx(Kbe,{...u,...o,ref:r})});lwe.displayName=owe;var cwe="DropdownMenuRadioItem",uwe=T.forwardRef((e,r)=>{const{__scopeDropdownMenu:s,...o}=e,u=Xi(s);return c.jsx(Vbe,{...u,...o,ref:r})});uwe.displayName=cwe;var dwe="DropdownMenuItemIndicator",hwe=T.forwardRef((e,r)=>{const{__scopeDropdownMenu:s,...o}=e,u=Xi(s);return c.jsx(Hbe,{...u,...o,ref:r})});hwe.displayName=dwe;var pwe="DropdownMenuSeparator",fwe=T.forwardRef((e,r)=>{const{__scopeDropdownMenu:s,...o}=e,u=Xi(s);return c.jsx(Gbe,{...u,...o,ref:r})});fwe.displayName=pwe;var mwe="DropdownMenuArrow",gwe=T.forwardRef((e,r)=>{const{__scopeDropdownMenu:s,...o}=e,u=Xi(s);return c.jsx(Xbe,{...u,...o,ref:r})});gwe.displayName=mwe;var ywe="DropdownMenuSubTrigger",vwe=T.forwardRef((e,r)=>{const{__scopeDropdownMenu:s,...o}=e,u=Xi(s);return c.jsx(Ybe,{...u,...o,ref:r})});vwe.displayName=ywe;var xwe="DropdownMenuSubContent",bwe=T.forwardRef((e,r)=>{const{__scopeDropdownMenu:s,...o}=e,u=Xi(s);return c.jsx(Zbe,{...u,...o,ref:r,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)"}})});bwe.displayName=xwe;var wwe=hB,Swe=fB,Ewe=mB,jwe=yB,Cwe=vB;function C$({...e}){return c.jsx(wwe,{"data-slot":"dropdown-menu",...e})}function A$({...e}){return c.jsx(Swe,{"data-slot":"dropdown-menu-trigger",...e})}function O$({className:e,sideOffset:r=4,...s}){return c.jsx(Ewe,{children:c.jsx(jwe,{"data-slot":"dropdown-menu-content",sideOffset:r,className:vt("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),...s})})}function kp({className:e,inset:r,variant:s="default",...o}){return c.jsx(Cwe,{"data-slot":"dropdown-menu-item","data-inset":r,"data-variant":s,className:vt("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),...o})}var lA="Switch",[Awe]=cl(lA),[Owe,kwe]=Awe(lA),xB=T.forwardRef((e,r)=>{const{__scopeSwitch:s,name:o,checked:u,defaultChecked:h,required:m,disabled:g,value:b="on",onCheckedChange:w,form:E,...A}=e,[k,R]=T.useState(null),M=Ln(r,K=>R(K)),I=T.useRef(!1),F=k?E||!!k.closest("form"):!0,[H,V]=Kd({prop:u,defaultProp:h??!1,onChange:w,caller:lA});return c.jsxs(Owe,{scope:s,checked:H,disabled:g,children:[c.jsx(An.button,{type:"button",role:"switch","aria-checked":H,"aria-required":m,"data-state":EB(H),"data-disabled":g?"":void 0,disabled:g,value:b,...A,ref:M,onClick:Nt(e.onClick,K=>{V(z=>!z),F&&(I.current=K.isPropagationStopped(),I.current||K.stopPropagation())})}),F&&c.jsx(SB,{control:k,bubbles:!I.current,name:o,value:b,checked:H,required:m,disabled:g,form:E,style:{transform:"translateX(-100%)"}})]})});xB.displayName=lA;var bB="SwitchThumb",wB=T.forwardRef((e,r)=>{const{__scopeSwitch:s,...o}=e,u=kwe(bB,s);return c.jsx(An.span,{"data-state":EB(u.checked),"data-disabled":u.disabled?"":void 0,...o,ref:r})});wB.displayName=bB;var Rwe="SwitchBubbleInput",SB=T.forwardRef(({__scopeSwitch:e,control:r,checked:s,bubbles:o=!0,...u},h)=>{const m=T.useRef(null),g=Ln(m,h),b=Y6(s),w=nL(r);return T.useEffect(()=>{const E=m.current;if(!E)return;const A=window.HTMLInputElement.prototype,R=Object.getOwnPropertyDescriptor(A,"checked").set;if(b!==s&&R){const M=new Event("click",{bubbles:o});R.call(E,s),E.dispatchEvent(M)}},[b,s,o]),c.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:s,...u,tabIndex:-1,ref:g,style:{...u.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});SB.displayName=Rwe;function EB(e){return e?"checked":"unchecked"}var Twe=xB,_we=wB;function q3({className:e,...r}){return c.jsx(Twe,{"data-slot":"switch",className:vt("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),...r,children:c.jsx(_we,{"data-slot":"switch-thumb",className:vt("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")})})}const wC=["route53","s3","ec2","iam","rds","dynamodb"],kj=Is({credential_provider:Fa(["aws","cloudflare","hetzner","digitalocean","generic"]),kind:Fa(["aws_access_key","api_token","basic_auth","oauth2"]),schema_version:tw().default(1),name:Sn().min(1,"Name is required").max(100),scope_kind:Fa(["provider","service","resource"]),scope_version:tw().default(1),scope:$3(),account_id:Sn().optional().or(nw("")).transform(e=>e||void 0),region:Sn().optional().or(nw("")).transform(e=>e||void 0),secret:$3()}).superRefine((e,r)=>{if(e.credential_provider==="aws"){if(e.scope_kind==="service"){const s=e.scope?.service;wC.includes(s)||r.addIssue({code:Md.custom,path:["scope"],message:`For AWS service scope, "service" must be one of: ${wC.join(", ")}`})}if(e.scope_kind==="resource"){const s=e.scope?.arn;(typeof s!="string"||!s.startsWith("arn:"))&&r.addIssue({code:Md.custom,path:["scope"],message:'For AWS resource scope, "arn" must start with "arn:"'})}if(e.kind==="aws_access_key"){const s=e.secret??{},o=s.access_key_id;(typeof o!="string"||!/^[A-Z0-9]{20}$/.test(o))&&r.addIssue({code:Md.custom,path:["secret"],message:"access_key_id must be 20 chars (A-Z0-9)"}),(typeof s.secret_access_key!="string"||s.secret_access_key.length<10)&&r.addIssue({code:Md.custom,path:["secret"],message:"secret_access_key is required"})}}if(e.kind==="api_token"&&((e.secret??{}).token||r.addIssue({code:Md.custom,path:["secret"],message:"token is required"})),e.kind==="basic_auth"){const s=e.secret??{};(!s.username||!s.password)&&r.addIssue({code:Md.custom,path:["secret"],message:"username and password are required"})}if(e.kind==="oauth2"){const s=e.secret??{};(!s.client_id||!s.client_secret||!s.refresh_token)&&r.addIssue({code:Md.custom,path:["secret"],message:"client_id, client_secret, and refresh_token are required"})}e.scope_kind!=="provider"&&!e.scope&&r.addIssue({code:Md.custom,path:["scope"],message:"scope is required"})}),OT=kj.partial().extend({name:Sn().min(1,"Name is required").max(100).optional()});function rc(e){try{return JSON.stringify(JSON.parse(e),null,2)}catch{return""}}function gj(e){const r=e?.body??e?.response??e?.message;if(typeof r=="string")return r;try{const s=e?.response?.data?.message||e?.message;if(s)return String(s)}catch{return"Unknown error"}return"Unknown error"}function $we({credential_provider:e,scope_kind:r}){return e==="aws"&&r==="service"}function Nwe({credential_provider:e,scope_kind:r}){return e==="aws"&&r==="resource"}function Dwe({scope_kind:e}){return e==="provider"}function B3(){return{credential_provider:"aws",kind:"aws_access_key",schema_version:1,name:"",scope_kind:"provider",scope_version:1,scope:{},account_id:"",region:"",secret:{}}}function U3(e){return{credential_provider:e.credential_provider,kind:e.kind,schema_version:e.schema_version??1,name:e.name,scope_kind:e.scope_kind,scope_version:e.scope_version??1,scope:e.scope??{},account_id:e.account_id,region:e.region,secret:e.secret??{}}}function K3(e){const r={},s=["name","account_id","region","scope_kind","scope_version","scope","secret","credential_provider","kind","schema_version"];for(const o of s)typeof e[o]<"u"&&e[o]!==""&&(r[o]=e[o]);return r}const Pwe=()=>{const[e,r]=T.useState(""),[s,o]=T.useState(!1),[u,h]=T.useState(!1),[m,g]=T.useState(!1),[b,w]=T.useState(null),[E,A]=T.useState(null),[k,R]=T.useState(!1),[M,I]=T.useState(!1),[F,H]=T.useState(!1),[V,K]=T.useState(null),[z,W]=T.useState(!1),[ae,Q]=T.useState(null),te=Ms(),de=Un({queryKey:["credentials"],queryFn:()=>ng.listCredentials()}),je=Wt({mutationFn:se=>ng.createCredential(U3(se)),onSuccess:async()=>{await te.invalidateQueries({queryKey:["credentials"]}),Ge.success("Credential created"),o(!1),Ae.reset(B3()),R(!1)},onError:se=>{Ge.error("Failed to create credential",{description:gj(se)})}}),we=Wt({mutationFn:se=>ng.updateCredential(se.id,K3(se.body)),onSuccess:async()=>{await te.invalidateQueries({queryKey:["credentials"]}),Ge.success("Credential updated"),h(!1),A(null),I(!1)},onError:se=>{Ge.error("Failed to update credential",{description:gj(se)})}}),ie=Wt({mutationFn:se=>ng.deleteCredential(se),onSuccess:async()=>{await te.invalidateQueries({queryKey:["credentials"]}),Ge.success("Credential deleted")},onError:se=>{Ge.error("Failed to delete credential",{description:gj(se)})}}),Se=Wt({mutationFn:se=>ng.revealCredential(se),onSuccess:se=>{w(se),g(!0)},onError:se=>{Ge.error("Failed to reveal secret",{description:gj(se)})}}),Ae=hr({resolver:fr(kj),defaultValues:B3(),mode:"onBlur"}),He=hr({resolver:fr(OT),defaultValues:{},mode:"onBlur"});function ue(se){A(se.id),He.reset({provider:se.provider,kind:se.kind,schema_version:se.schema_version??1,name:se.name,scope_kind:se.scope_kind,scope_version:se.scope_version??1,account_id:se.account_id??"",region:se.region??"",scope:se.scope??(se.scope_kind==="provider"?{}:void 0),secret:void 0}),I(!1),h(!0)}const ne=T.useMemo(()=>{const se=de.data??[];if(!e.trim())return se;const Ne=e.toLowerCase();return se.filter(Fe=>[Fe.name,Fe.provider,Fe.kind,Fe.scope_kind,Fe.account_id,Fe.region,JSON.stringify(Fe.scope??{})].filter(Boolean).map(at=>String(at).toLowerCase()).some(at=>at.includes(Ne)))},[de.data,e]);if(de.isLoading)return c.jsxs("div",{className:"flex items-center gap-2 p-6",children:[c.jsx(ys,{className:"h-4 w-4 animate-spin"})," Loading credentials…"]});if(de.error)return c.jsxs("div",{className:"p-6 text-red-500",children:["Error loading credentials.",c.jsx("pre",{className:"mt-2 text-xs opacity-80",children:JSON.stringify(de.error,null,2)})]});const ce=Ae.watch("credential_provider"),$e=Ae.watch("kind"),me=Ae.watch("scope_kind"),Xe=se=>Ae.setValue("scope",se,{shouldDirty:!0,shouldValidate:!0}),Oe=se=>Ae.setValue("secret",se,{shouldDirty:!0,shouldValidate:!0});function Te(){if(!k){if(ce==="aws"&&$e==="aws_access_key"){const se=Ae.getValues("secret")??{};Oe({access_key_id:se.access_key_id??"",secret_access_key:se.secret_access_key??""})}else if($e==="api_token"){const se=Ae.getValues("secret")??{};Oe({token:se.token??""})}else if($e==="basic_auth"){const se=Ae.getValues("secret")??{};Oe({username:se.username??"",password:se.password??""})}else if($e==="oauth2"){const se=Ae.getValues("secret")??{};Oe({client_id:se.client_id??"",client_secret:se.client_secret??"",refresh_token:se.refresh_token??""})}}}function Ke(se){Ae.setValue("scope_kind",se),se==="provider"&&Xe({}),se==="service"&&Xe({service:"route53"}),se==="resource"&&Xe({arn:""})}return c.jsxs("div",{className:"space-y-4 p-6",children:[c.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"mb-1 text-2xl font-bold",children:"Credentials"}),c.jsx("p",{className:"text-muted-foreground text-sm",children:"Store provider credentials. Secrets are encrypted server-side; revealing is a one-time read."})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsxs("div",{className:"relative",children:[c.jsx(va,{className:"absolute top-2.5 left-2 h-4 w-4 opacity-60"}),c.jsx(mt,{value:e,onChange:se=>r(se.target.value),placeholder:"Search by name, provider, kind, scope…",className:"w-64 pl-8"})]}),c.jsxs(dn,{open:s,onOpenChange:o,children:[c.jsx(Ai,{asChild:!0,children:c.jsxs(Pe,{onClick:()=>o(!0),children:[c.jsx(qa,{className:"mr-2 h-4 w-4"}),"Create Credential"]})}),c.jsxs(hn,{className:"sm:max-w-2xl",children:[c.jsx(pn,{children:c.jsx(fn,{children:"Create Credential"})}),c.jsx(mr,{...Ae,children:c.jsxs("form",{onSubmit:Ae.handleSubmit(se=>{const Ne=kj.safeParse(se);if(!Ne.success){Ge.error("Please fix validation errors");return}je.mutate(Ne.data)}),className:"space-y-5 pt-2",children:[c.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[c.jsx(ft,{control:Ae.control,name:"credential_provider",render:({field:se})=>c.jsxs(ot,{children:[c.jsx(lt,{children:"Provider"}),c.jsxs(_n,{onValueChange:Ne=>{se.onChange(Ne),Te()},defaultValue:se.value,children:[c.jsx(bt,{children:c.jsx(Nn,{children:c.jsx($n,{})})}),c.jsxs(Dn,{children:[c.jsx(Ct,{value:"aws",children:"AWS"}),c.jsx(Ct,{value:"cloudflare",children:"Cloudflare"}),c.jsx(Ct,{value:"hetzner",children:"Hetzner"}),c.jsx(Ct,{value:"digitalocean",children:"DigitalOcean"}),c.jsx(Ct,{value:"generic",children:"Generic"})]})]}),c.jsx(pt,{})]})}),c.jsx(ft,{control:Ae.control,name:"kind",render:({field:se})=>c.jsxs(ot,{children:[c.jsx(lt,{children:"Kind"}),c.jsxs(_n,{onValueChange:Ne=>{se.onChange(Ne),Te()},defaultValue:se.value,children:[c.jsx(bt,{children:c.jsx(Nn,{children:c.jsx($n,{})})}),c.jsxs(Dn,{children:[c.jsx(Ct,{value:"aws_access_key",children:"AWS Access Key"}),c.jsx(Ct,{value:"api_token",children:"API Token"}),c.jsx(Ct,{value:"basic_auth",children:"Basic Auth"}),c.jsx(Ct,{value:"oauth2",children:"OAuth2"})]})]}),c.jsx(pt,{})]})}),c.jsx(ft,{control:Ae.control,name:"scope_kind",render:({field:se})=>c.jsxs(ot,{children:[c.jsx(lt,{children:"Scope Kind"}),c.jsxs(_n,{onValueChange:Ne=>{Ke(Ne)},defaultValue:se.value,children:[c.jsx(bt,{children:c.jsx(Nn,{children:c.jsx($n,{})})}),c.jsxs(Dn,{children:[c.jsx(Ct,{value:"provider",children:"Provider"}),c.jsx(Ct,{value:"service",children:"Service"}),c.jsx(Ct,{value:"resource",children:"Resource"})]})]}),c.jsx(pt,{})]})}),c.jsx(ft,{control:Ae.control,name:"name",render:({field:se})=>c.jsxs(ot,{children:[c.jsx(lt,{children:"Name"}),c.jsx(mt,{...se,placeholder:"My AWS Key"}),c.jsx(pt,{})]})}),c.jsx(ft,{control:Ae.control,name:"account_id",render:({field:se})=>c.jsxs(ot,{children:[c.jsx(lt,{children:"Account ID (optional)"}),c.jsx(mt,{...se,placeholder:"e.g. 123456789012"}),c.jsx(pt,{})]})}),c.jsx(ft,{control:Ae.control,name:"region",render:({field:se})=>c.jsxs(ot,{children:[c.jsx(lt,{children:"Region (optional)"}),c.jsx(mt,{...se,placeholder:"e.g. us-east-1"}),c.jsx(pt,{})]})})]}),!Dwe({scope_kind:me})&&c.jsx(c.Fragment,{children:$we({credential_provider:ce,scope_kind:me})?c.jsxs(ot,{children:[c.jsx(lt,{children:"Service"}),c.jsx(Zo,{control:Ae.control,name:"scope",render:({field:se})=>c.jsxs(_n,{onValueChange:Ne=>se.onChange({service:Ne}),value:se.value?.service??"route53",children:[c.jsx(bt,{children:c.jsx(Nn,{children:c.jsx($n,{placeholder:"Select an AWS service"})})}),c.jsx(Dn,{children:wC.map(Ne=>c.jsx(Ct,{value:Ne,children:Ne.toUpperCase()},Ne))})]})}),c.jsxs("p",{className:"text-muted-foreground mt-1 text-xs",children:["Must be one of: ",wC.join(", "),"."]})]}):Nwe({credential_provider:ce,scope_kind:me})?c.jsxs(ot,{children:[c.jsx(lt,{children:"Resource ARN"}),c.jsx(Zo,{control:Ae.control,name:"scope",render:({field:se})=>c.jsx(mt,{value:se.value?.arn??"",onChange:Ne=>se.onChange({arn:Ne.target.value}),placeholder:"arn:aws:service:region:account:resource"})}),c.jsx(pt,{})]}):c.jsx(ft,{control:Ae.control,name:"scope",render:({field:se})=>c.jsxs(ot,{children:[c.jsx(lt,{children:"Scope (JSON)"}),c.jsx(nl,{value:rc(se.value??{}),onChange:Ne=>{try{const Fe=JSON.parse(Ne.target.value);se.onChange(Fe)}catch{se.onChange(Ne.target.value)}},rows:3,placeholder:'{"service":"route53"} or {"arn":"arn:aws:..."}',className:"font-mono"}),c.jsx(pt,{})]})})}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(q3,{checked:k,onCheckedChange:se=>{R(se),Te()},id:"raw-secret-toggle"}),c.jsx("label",{htmlFor:"raw-secret-toggle",className:"text-sm",children:"Edit secret as raw JSON"})]}),k?c.jsx(ft,{control:Ae.control,name:"secret",render:({field:se})=>c.jsxs(ot,{children:[c.jsx(lt,{children:"Secret (JSON)"}),c.jsx(nl,{value:rc(se.value??{}),onChange:Ne=>{try{se.onChange(JSON.parse(Ne.target.value))}catch{se.onChange(Ne.target.value)}},rows:6,placeholder:$e==="aws_access_key"?'{"access_key_id":"...","secret_access_key":"..."}':$e==="api_token"?'{"token":"..."}':$e==="basic_auth"?'{"username":"...","password":"..."}':'{"client_id":"...","client_secret":"...","refresh_token":"..."}',className:"font-mono"}),c.jsx(pt,{})]})}):c.jsxs(c.Fragment,{children:[ce==="aws"&&$e==="aws_access_key"&&c.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[c.jsxs(ot,{children:[c.jsx(lt,{children:"Access Key ID"}),c.jsx(Zo,{control:Ae.control,name:"secret",render:({field:se})=>c.jsx(mt,{value:(se.value??{}).access_key_id??"",onChange:Ne=>Oe({...se.value??{},access_key_id:Ne.target.value.trim()}),placeholder:"AKIA..."})})]}),c.jsxs(ot,{children:[c.jsx(lt,{children:"Secret Access Key"}),c.jsx(Zo,{control:Ae.control,name:"secret",render:({field:se})=>c.jsx(mt,{type:"password",value:(se.value??{}).secret_access_key??"",onChange:Ne=>Oe({...se.value??{},secret_access_key:Ne.target.value}),placeholder:"•••••••••••••••"})})]})]}),$e==="api_token"&&c.jsxs(ot,{children:[c.jsx(lt,{children:"API Token"}),c.jsx(Zo,{control:Ae.control,name:"secret",render:({field:se})=>c.jsx(mt,{value:(se.value??{}).token??"",onChange:Ne=>Oe({...se.value??{},token:Ne.target.value}),placeholder:"token..."})})]}),$e==="basic_auth"&&c.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[c.jsxs(ot,{children:[c.jsx(lt,{children:"Username"}),c.jsx(Zo,{control:Ae.control,name:"secret",render:({field:se})=>c.jsx(mt,{value:(se.value??{}).username??"",onChange:Ne=>Oe({...se.value??{},username:Ne.target.value})})})]}),c.jsxs(ot,{children:[c.jsx(lt,{children:"Password"}),c.jsx(Zo,{control:Ae.control,name:"secret",render:({field:se})=>c.jsx(mt,{type:"password",value:(se.value??{}).password??"",onChange:Ne=>Oe({...se.value??{},password:Ne.target.value})})})]})]}),$e==="oauth2"&&c.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-3",children:[c.jsxs(ot,{children:[c.jsx(lt,{children:"Client ID"}),c.jsx(Zo,{control:Ae.control,name:"secret",render:({field:se})=>c.jsx(mt,{value:(se.value??{}).client_id??"",onChange:Ne=>Oe({...se.value??{},client_id:Ne.target.value})})})]}),c.jsxs(ot,{children:[c.jsx(lt,{children:"Client Secret"}),c.jsx(Zo,{control:Ae.control,name:"secret",render:({field:se})=>c.jsx(mt,{type:"password",value:(se.value??{}).client_secret??"",onChange:Ne=>Oe({...se.value??{},client_secret:Ne.target.value})})})]}),c.jsxs(ot,{children:[c.jsx(lt,{children:"Refresh Token"}),c.jsx(Zo,{control:Ae.control,name:"secret",render:({field:se})=>c.jsx(mt,{value:(se.value??{}).refresh_token??"",onChange:Ne=>Oe({...se.value??{},refresh_token:Ne.target.value})})})]})]})]}),c.jsxs(gn,{className:"gap-2",children:[c.jsx(Pe,{type:"button",variant:"secondary",onClick:()=>{const se=kj.safeParse(Ae.getValues());if(!se.success){Ge.error("Fix validation errors before previewing");return}const Ne=U3(se.data);K(Ne),H(!0)},children:"Preview request"}),c.jsx(Pe,{variant:"outline",type:"button",onClick:()=>o(!1),children:"Cancel"}),c.jsxs(Pe,{type:"submit",disabled:je.isPending,children:[je.isPending&&c.jsx(ys,{className:"mr-2 h-4 w-4 animate-spin"}),"Create"]})]})]})})]})]})]})]}),c.jsx("div",{className:"overflow-x-auto rounded-xl border",children:c.jsxs("table",{className:"min-w-full text-sm",children:[c.jsx("thead",{className:"bg-muted/40 text-xs tracking-wide uppercase",children:c.jsxs("tr",{children:[c.jsx("th",{className:"w-[26%] px-4 py-2 text-left",children:"Name"}),c.jsx("th",{className:"px-4 py-2 text-left",children:"Provider"}),c.jsx("th",{className:"px-4 py-2 text-left",children:"Kind"}),c.jsx("th",{className:"px-4 py-2 text-left",children:"Scope"}),c.jsx("th",{className:"px-4 py-2 text-left",children:"Account"}),c.jsx("th",{className:"px-4 py-2 text-left",children:"Region"}),c.jsx("th",{className:"px-4 py-2 text-right",children:"Actions"})]})}),c.jsxs("tbody",{children:[ne.map(se=>c.jsxs("tr",{className:"border-t",children:[c.jsxs("td",{className:"px-4 py-2",children:[c.jsx("div",{className:"font-medium",children:se.name}),c.jsxs("div",{className:"text-muted-foreground text-xs",children:[c.jsx("span",{className:"mr-1",children:"id:"}),c.jsxs("code",{className:"bg-muted rounded px-1",children:[se.id.slice(0,8),"…"]})]})]}),c.jsx("td",{className:"px-4 py-2",children:se.credential_provider}),c.jsx("td",{className:"px-4 py-2",children:se.kind}),c.jsx("td",{className:"px-4 py-2",children:c.jsx(rr,{variant:"secondary",children:se.scope_kind})}),c.jsx("td",{className:"px-4 py-2",children:se.account_id??"—"}),c.jsx("td",{className:"px-4 py-2",children:se.region??"—"}),c.jsx("td",{className:"px-4 py-2",children:c.jsxs("div",{className:"flex items-center justify-end gap-2",children:[c.jsx(Pe,{size:"icon",variant:"ghost",title:"Reveal secret (one-time read)",onClick:()=>Se.mutate(se.id),children:c.jsx(LT,{className:"h-4 w-4"})}),c.jsx(Pe,{size:"icon",variant:"ghost",title:"Edit",onClick:()=>ue(se),children:c.jsx(uc,{className:"h-4 w-4"})}),c.jsxs(uC,{children:[c.jsx(dC,{asChild:!0,children:c.jsx(Pe,{size:"icon",variant:"ghost",title:"Delete",children:c.jsx(wg,{className:"h-4 w-4"})})}),c.jsxs(hC,{children:[c.jsxs(pC,{children:[c.jsxs(mC,{children:["Delete “",se.name,"”?"]}),c.jsx(gC,{children:"This will permanently remove the credential metadata. Secrets are not recoverable."})]}),c.jsxs(fC,{children:[c.jsx(vC,{disabled:ie.isPending,children:"Cancel"}),c.jsxs(yC,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>ie.mutate(se.id),disabled:ie.isPending,children:[ie.isPending&&c.jsx(ys,{className:"mr-2 inline h-4 w-4 animate-spin"}),"Delete"]})]})]})]}),c.jsxs(C$,{children:[c.jsx(A$,{asChild:!0,children:c.jsx(Pe,{size:"icon",variant:"ghost",children:c.jsx(Z_,{className:"h-4 w-4"})})}),c.jsxs(O$,{align:"end",children:[c.jsx(kp,{onClick:()=>ue(se),children:"Edit"}),c.jsx(kp,{onClick:()=>Se.mutate(se.id),children:"Reveal secret"}),c.jsx(kp,{className:"text-destructive",onClick:()=>ie.mutate(se.id),children:"Delete"})]})]})]})})]},se.id)),ne.length===0&&c.jsx("tr",{children:c.jsx("td",{colSpan:7,className:"px-4 py-12 text-center",children:c.jsxs("div",{className:"mx-auto max-w-md",children:[c.jsx("div",{className:"mb-2 flex items-center justify-center",children:c.jsx(Pj,{className:"text-muted-foreground h-5 w-5"})}),c.jsx("p",{className:"text-muted-foreground",children:"No credentials match your search."})]})})})]})]})}),c.jsx(dn,{open:u,onOpenChange:h,children:c.jsxs(hn,{className:"sm:max-w-2xl",children:[c.jsx(pn,{children:c.jsx(fn,{children:"Edit Credential"})}),c.jsx(mr,{...He,children:c.jsxs("form",{onSubmit:He.handleSubmit(se=>{if(!E)return;const Ne=OT.safeParse(se);if(!Ne.success){Ge.error("Please fix validation errors");return}we.mutate({id:E,body:Ne.data})}),className:"space-y-5 pt-2",children:[c.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[c.jsx(ft,{control:He.control,name:"credential_provider",render:({field:se})=>c.jsxs(ot,{children:[c.jsx(lt,{children:"Provider"}),c.jsxs(_n,{onValueChange:se.onChange,value:se.value,children:[c.jsx(bt,{children:c.jsx(Nn,{children:c.jsx($n,{})})}),c.jsxs(Dn,{children:[c.jsx(Ct,{value:"aws",children:"AWS"}),c.jsx(Ct,{value:"cloudflare",children:"Cloudflare"}),c.jsx(Ct,{value:"hetzner",children:"Hetzner"}),c.jsx(Ct,{value:"digitalocean",children:"DigitalOcean"}),c.jsx(Ct,{value:"generic",children:"Generic"})]})]}),c.jsx(pt,{})]})}),c.jsx(ft,{control:He.control,name:"kind",render:({field:se})=>c.jsxs(ot,{children:[c.jsx(lt,{children:"Kind"}),c.jsxs(_n,{onValueChange:se.onChange,value:se.value,children:[c.jsx(bt,{children:c.jsx(Nn,{children:c.jsx($n,{})})}),c.jsxs(Dn,{children:[c.jsx(Ct,{value:"aws_access_key",children:"AWS Access Key"}),c.jsx(Ct,{value:"api_token",children:"API Token"}),c.jsx(Ct,{value:"basic_auth",children:"Basic Auth"}),c.jsx(Ct,{value:"oauth2",children:"OAuth2"})]})]}),c.jsx(pt,{})]})}),c.jsx(ft,{control:He.control,name:"scope_kind",render:({field:se})=>c.jsxs(ot,{children:[c.jsx(lt,{children:"Scope Kind"}),c.jsxs(_n,{onValueChange:se.onChange,value:se.value,children:[c.jsx(bt,{children:c.jsx(Nn,{children:c.jsx($n,{})})}),c.jsxs(Dn,{children:[c.jsx(Ct,{value:"provider",children:"Provider"}),c.jsx(Ct,{value:"service",children:"Service"}),c.jsx(Ct,{value:"resource",children:"Resource"})]})]}),c.jsx(pt,{})]})}),c.jsx(ft,{control:He.control,name:"name",render:({field:se})=>c.jsxs(ot,{children:[c.jsx(lt,{children:"Name"}),c.jsx(mt,{...se}),c.jsx(pt,{})]})}),c.jsx(ft,{control:He.control,name:"account_id",render:({field:se})=>c.jsxs(ot,{children:[c.jsx(lt,{children:"Account ID"}),c.jsx(mt,{...se,placeholder:"optional"}),c.jsx(pt,{})]})}),c.jsx(ft,{control:He.control,name:"region",render:({field:se})=>c.jsxs(ot,{children:[c.jsx(lt,{children:"Region"}),c.jsx(mt,{...se,placeholder:"optional"}),c.jsx(pt,{})]})})]}),c.jsx(ft,{control:He.control,name:"scope",render:({field:se})=>c.jsxs(ot,{children:[c.jsx(lt,{children:"Scope (JSON)"}),c.jsx(nl,{value:rc(se.value??(He.getValues("scope_kind")==="provider"?{}:void 0)),onChange:Ne=>{try{se.onChange(JSON.parse(Ne.target.value))}catch{se.onChange(Ne.target.value)}},rows:3,className:"font-mono"}),c.jsx(pt,{})]})}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(q3,{checked:M,onCheckedChange:I,id:"raw-edit-secret-toggle"}),c.jsx("label",{htmlFor:"raw-edit-secret-toggle",className:"text-sm",children:"Rotate secret with raw JSON (leave empty to keep existing)"})]}),M&&c.jsx(ft,{control:He.control,name:"secret",render:({field:se})=>c.jsxs(ot,{children:[c.jsx(lt,{children:"Rotate Secret (JSON)"}),c.jsx(nl,{value:typeof se.value=="string"?se.value:rc(se.value??{}),onChange:Ne=>{try{se.onChange(JSON.parse(Ne.target.value))}catch{se.onChange(Ne.target.value)}},rows:6,className:"font-mono",placeholder:'{"access_key_id":"...","secret_access_key":"..."}'}),c.jsx(pt,{})]})}),c.jsxs(gn,{className:"gap-2",children:[c.jsx(Pe,{type:"button",variant:"secondary",onClick:()=>{const se=OT.safeParse(He.getValues());if(!se.success){Ge.error("Fix validation errors before previewing");return}const Ne=K3(se.data);Q(Ne),W(!0)},children:"Preview request"}),c.jsx(Pe,{variant:"outline",type:"button",onClick:()=>h(!1),children:"Cancel"}),c.jsxs(Pe,{type:"submit",disabled:we.isPending,children:[we.isPending&&c.jsx(ys,{className:"mr-2 h-4 w-4 animate-spin"}),"Save changes"]})]})]})})]})}),c.jsx(dn,{open:m,onOpenChange:g,children:c.jsxs(hn,{className:"sm:max-w-xl",children:[c.jsx(pn,{children:c.jsxs(fn,{className:"flex items-center gap-2",children:[c.jsx(LT,{className:"h-4 w-4"})," Decrypted Secret"]})}),c.jsx("div",{className:"bg-muted/40 rounded-lg border p-3",children:c.jsx("pre",{className:"max-h-[50vh] overflow-auto text-xs leading-relaxed",children:rc(b??{})})}),c.jsxs("div",{className:"text-muted-foreground flex items-center gap-2 text-xs",children:[c.jsx(Pj,{className:"h-3.5 w-3.5"}),"One-time read. Close this dialog to hide the secret."]}),c.jsxs(gn,{children:[c.jsx(Pe,{variant:"outline",onClick:()=>{navigator.clipboard.writeText(rc(b??{})),Ge.success("Copied to clipboard")},children:"Copy"}),c.jsx(Pe,{onClick:()=>g(!1),children:"Close"})]})]})}),c.jsx(dn,{open:F,onOpenChange:H,children:c.jsxs(hn,{className:"sm:max-w-2xl",children:[c.jsx(pn,{children:c.jsx(fn,{children:"Preview: POST /api/v1/credentials"})}),c.jsx("div",{className:"bg-muted/40 rounded-lg border p-3",children:c.jsx("pre",{className:"max-h-[50vh] overflow-auto text-xs leading-relaxed",children:rc(V??{})})}),c.jsxs(gn,{children:[c.jsx(Pe,{variant:"outline",onClick:()=>{navigator.clipboard.writeText(rc(V??{})),Ge.success("Copied body")},children:"Copy body"}),c.jsx(Pe,{onClick:()=>H(!1),children:"Close"})]})]})}),c.jsx(dn,{open:z,onOpenChange:W,children:c.jsxs(hn,{className:"sm:max-w-2xl",children:[c.jsx(pn,{children:c.jsx(fn,{children:"Preview: PATCH /api/v1/credentials/:id"})}),c.jsx("div",{className:"bg-muted/40 rounded-lg border p-3",children:c.jsx("pre",{className:"max-h-[50vh] overflow-auto text-xs leading-relaxed",children:rc(ae??{})})}),c.jsxs(gn,{children:[c.jsx(Pe,{variant:"outline",onClick:()=>{navigator.clipboard.writeText(rc(ae??{})),Ge.success("Copied body")},children:"Copy body"}),c.jsx(Pe,{onClick:()=>W(!1),children:"Close"})]})]})})]})};function ya({className:e,...r}){return c.jsx("div",{"data-slot":"card",className:vt("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...r})}function ol({className:e,...r}){return c.jsx("div",{"data-slot":"card-header",className:vt("@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),...r})}function ll({className:e,...r}){return c.jsx("div",{"data-slot":"card-title",className:vt("leading-none font-semibold",e),...r})}function M_({className:e,...r}){return c.jsx("div",{"data-slot":"card-description",className:vt("text-muted-foreground text-sm",e),...r})}function ho({className:e,...r}){return c.jsx("div",{"data-slot":"card-content",className:vt("px-6",e),...r})}const Mwe=e=>{switch(e){case"ready":return c.jsx(EC,{className:"h-4 w-4 text-emerald-600"});case"provisioning":return c.jsx(ys,{className:"h-4 w-4 animate-spin text-blue-600"});case"failed":return c.jsx(Pj,{className:"h-4 w-4 text-red-600"});default:return c.jsx(ZZ,{className:"text-muted-foreground h-4 w-4"})}},kT=({s:e})=>c.jsxs(rr,{variant:e==="failed"?"destructive":e==="ready"?"default":"secondary",className:"gap-1",title:e,children:[Mwe(e),c.jsx("span",{className:"capitalize",children:e??"pending"})]}),I_=e=>e.split(",").map(r=>r.trim()).filter(Boolean),Iwe=e=>e&&e.length?e.join(","):"",z_=["A","AAAA","CNAME","TXT","MX","NS","SRV","CAA"],zwe=e=>e.credential_provider==="aws"&&e.scope_kind==="service"&&(()=>{const r=e.scope;try{return(typeof r=="string"?JSON.parse(r):r||{})?.service==="route53"}catch{return!1}})(),V3=e=>[e.name||"Unnamed",e.account_id,e.region].filter(Boolean).join(" · "),jB=Is({domain_name:Sn().min(1,"Domain is required").max(253).transform(e=>e.trim().replace(/\.$/,"").toLowerCase()),credential_id:Sn().uuid("Pick a credential"),zone_id:Sn().optional().or(nw("")).transform(e=>e?e.trim():void 0)}),Lwe=jB.partial(),Fwe=q6([tw(),Sn().regex(/^\d+$/).transform(e=>Number(e))]).optional().refine(e=>e===void 0||e>=1&&e<=86400,{message:"TTL must be between 1 and 86400"}),CB=Is({name:Sn().min(1,"Name required").max(253).transform(e=>e.trim().replace(/\.$/,"").toLowerCase()),type:Fa(z_),ttl:Fwe,valuesCsv:Sn().optional()}).superRefine((e,r)=>{const s=I_(e.valuesCsv??"");s.length===0&&r.addIssue({code:"custom",message:"At least one value is required"}),e.type==="CNAME"&&s.length!==1&&r.addIssue({code:"custom",message:"CNAME requires exactly one value"})}),qwe=CB.partial(),Bwe=()=>{const[e,r]=T.useState(""),[s,o]=T.useState(null),[u,h]=T.useState(!1),[m,g]=T.useState(!1),[b,w]=T.useState(!1),[E,A]=T.useState(!1),[k,R]=T.useState(null),M=Ms(),I=Un({queryKey:["dns","domains"],queryFn:()=>sc.listDomains()}),F=Un({queryKey:["dns","records",s?.id],queryFn:async()=>s?await sc.listRecordSetsByDomain(s.id):[],enabled:!!s?.id}),H=Un({queryKey:["credentials","r53"],queryFn:()=>ng.listCredentials()}),V=T.useMemo(()=>(H.data??[]).filter(zwe),[H.data]);T.useEffect(()=>{!s&&I.data&&I.data.length&&o(I.data[0])},[I.data,s]);const K=T.useMemo(()=>{const ne=I.data??[];if(!e.trim())return ne;const ce=e.toLowerCase();return ne.filter($e=>[$e.domain_name,$e.zone_id,$e.status,$e.domain_name].filter(Boolean).map(me=>String(me).toLowerCase()).some(me=>me.includes(ce)))},[I.data,e]),z=hr({resolver:fr(jB),defaultValues:{domain_name:"",credential_id:"",zone_id:""}}),W=Wt({mutationFn:ne=>sc.createDomain(ne),onSuccess:async ne=>{Ge.success("Domain created"),h(!1),z.reset(),await M.invalidateQueries({queryKey:["dns","domains"]}),o(ne)},onError:ne=>Ge.error("Failed to create domain",{description:ne?.message??"Unknown error"})}),ae=hr({resolver:fr(Lwe)}),Q=ne=>{o(ne),ae.reset({domain_name:ne.domain_name,credential_id:ne.credential_id,zone_id:ne.zone_id||""}),g(!0)},te=Wt({mutationFn:ne=>{if(!s)throw new Error("No domain selected");return sc.updateDomain(s.id,ne)},onSuccess:async()=>{Ge.success("Domain updated"),g(!1),await M.invalidateQueries({queryKey:["dns","domains"]}),await M.invalidateQueries({queryKey:["dns","records",s?.id]})},onError:ne=>Ge.error("Failed to update domain",{description:ne?.message??"Unknown error"})}),de=Wt({mutationFn:ne=>sc.deleteDomain(ne),onSuccess:async()=>{Ge.success("Domain deleted"),await M.invalidateQueries({queryKey:["dns","domains"]}),o(null)},onError:ne=>Ge.error("Failed to delete domain",{description:ne?.message??"Unknown error"})}),je=hr({resolver:fr(CB),defaultValues:{name:"",type:"A",ttl:300,valuesCsv:""}}),we=ne=>{const ce=ne?.response?.data?.error||ne?.message||"Unknown error";return ce.includes("ownership_conflict")?"Ownership conflict: this (name,type) exists but isn’t owned by autoglue.":ce.includes("already_exists")?"A record with this (name,type) already exists. Use Edit instead.":ce},ie=Wt({mutationFn:async ne=>{if(!s)throw new Error("No domain selected");const ce={name:ne.name,type:ne.type,...ne.ttl?{ttl:ne.ttl}:{},values:I_(ne.valuesCsv??"")};return sc.createRecordSetsByDomain(s.id,ce)},onSuccess:async()=>{Ge.success("Record set created"),w(!1),je.reset(),await M.invalidateQueries({queryKey:["dns","records",s?.id]})},onError:ne=>Ge.error("Failed to create record set",{description:we(ne)})}),Se=hr({resolver:fr(qwe)}),Ae=ne=>{R(ne);const ce=ne.values||[];Se.reset({name:ne.name,type:ne.type,ttl:ne.ttl?Number(ne.ttl):void 0,valuesCsv:Iwe(ce)}),A(!0)},He=Wt({mutationFn:async ne=>{if(!k)throw new Error("No record selected");const ce={};return ne.name!==void 0&&(ce.name=ne.name),ne.type!==void 0&&(ce.type=ne.type),ne.ttl!==void 0&&ne.ttl!==null&&(ce.ttl=ne.ttl),ne.valuesCsv!==void 0&&(ce.values=I_(ne.valuesCsv)),sc.updateRecordSetsByDomain(k.id,ce)},onSuccess:async()=>{Ge.success("Record set updated"),A(!1),R(null),await M.invalidateQueries({queryKey:["dns","records",s?.id]})},onError:ne=>Ge.error("Failed to update record set",{description:we(ne)})}),ue=Wt({mutationFn:ne=>sc.deleteRecordSetsByDomain(ne),onSuccess:async()=>{Ge.success("Record set deleted"),await M.invalidateQueries({queryKey:["dns","records",s?.id]})},onError:ne=>Ge.error("Failed to delete record set",{description:ne?.message??"Unknown error"})});return c.jsxs("div",{className:"space-y-5 p-6",children:[c.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[c.jsx("h1",{className:"text-2xl font-bold",children:"DNS"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs("div",{className:"relative",children:[c.jsx(va,{className:"absolute top-2.5 left-2 h-4 w-4 opacity-60"}),c.jsx(mt,{value:e,onChange:ne=>r(ne.target.value),placeholder:"Search domains…",className:"w-64 pl-8"})]}),c.jsxs(dn,{open:u,onOpenChange:h,children:[c.jsx(Ai,{asChild:!0,children:c.jsxs(Pe,{onClick:()=>h(!0),children:[c.jsx(qa,{className:"mr-2 h-4 w-4"}),"Add Domain"]})}),c.jsxs(hn,{className:"sm:max-w-lg",children:[c.jsx(pn,{children:c.jsx(fn,{children:"Add Domain"})}),c.jsx(mr,{...z,children:c.jsxs("form",{className:"space-y-4 pt-2",onSubmit:z.handleSubmit(ne=>W.mutate(ne)),children:[c.jsx(ft,{control:z.control,name:"domain_name",render:({field:ne})=>c.jsxs(ot,{children:[c.jsx(lt,{children:"Domain"}),c.jsx(bt,{children:c.jsx(mt,{...ne,placeholder:"example.com"})}),c.jsx(pt,{})]})}),c.jsx(ft,{control:z.control,name:"credential_id",render:({field:ne})=>c.jsxs(ot,{children:[c.jsx(lt,{children:"Route53 Credential"}),c.jsxs(_n,{onValueChange:ne.onChange,value:ne.value,disabled:H.isLoading||(V?.length??0)===0,children:[c.jsx(bt,{children:c.jsx(Nn,{children:c.jsx($n,{placeholder:H.isLoading?"Loading…":(V?.length??0)===0?"No Route53 credentials found":"Select credential"})})}),c.jsx(Dn,{children:(V??[]).map(ce=>c.jsx(Ct,{value:ce.id,children:V3(ce)},ce.id))})]}),H.error&&c.jsx("p",{className:"text-destructive text-xs",children:"Failed to load credentials."}),c.jsx(pt,{})]})}),c.jsx(ft,{control:z.control,name:"zone_id",render:({field:ne})=>c.jsxs(ot,{children:[c.jsx(lt,{children:"Zone ID (optional)"}),c.jsx(bt,{children:c.jsx(mt,{...ne,placeholder:"/hostedzone/Z123…"})}),c.jsx(pt,{})]})}),c.jsxs(gn,{className:"gap-2",children:[c.jsx(Pe,{type:"button",variant:"outline",onClick:()=>h(!1),children:"Cancel"}),c.jsxs(Pe,{type:"submit",disabled:W.isPending,children:[W.isPending&&c.jsx(ys,{className:"mr-2 h-4 w-4 animate-spin"}),"Create"]})]})]})})]})]})]})]}),c.jsx("div",{children:c.jsxs(ya,{className:"p-3 md:col-span-5",children:[c.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[c.jsx("div",{className:"text-sm font-semibold",children:"Domains"}),I.isFetching&&c.jsx(ys,{className:"h-4 w-4 animate-spin"})]}),c.jsx("div",{className:"max-h-[60vh] overflow-auto rounded-md border",children:c.jsxs("table",{className:"min-w-full text-sm",children:[c.jsx("thead",{className:"bg-muted/40 text-xs tracking-wide uppercase",children:c.jsxs("tr",{children:[c.jsx("th",{className:"px-3 py-2 text-left",children:"Domain"}),c.jsx("th",{className:"px-3 py-2 text-left",children:"Zone"}),c.jsx("th",{className:"px-3 py-2 text-left",children:"Status"}),c.jsx("th",{className:"px-3 py-2 text-right",children:"Actions"})]})}),c.jsxs("tbody",{children:[(K??[]).map(ne=>c.jsxs("tr",{className:`hover:bg-muted/30 border-t ${s?.id===ne.id?"bg-muted/40":""}`,onClick:()=>o(ne),children:[c.jsx("td",{className:"cursor-pointer px-3 py-2 font-medium",children:ne.domain_name}),c.jsx("td",{className:"px-3 py-2",children:ne.zone_id||"—"}),c.jsx("td",{className:"px-3 py-2",children:c.jsx(kT,{s:ne.status})}),c.jsx("td",{className:"px-3 py-2",children:c.jsxs("div",{className:"flex items-center justify-end gap-2",children:[c.jsx(Pe,{size:"icon",variant:"ghost",onClick:()=>Q(ne),children:c.jsx(uc,{className:"h-4 w-4"})}),c.jsxs(uC,{children:[c.jsx(dC,{asChild:!0,children:c.jsx(Pe,{size:"icon",variant:"ghost",onClick:ce=>ce.stopPropagation(),children:c.jsx(wg,{className:"h-4 w-4"})})}),c.jsxs(hC,{children:[c.jsxs(pC,{children:[c.jsxs(mC,{children:["Delete “",ne.domain_name,"”?"]}),c.jsx(gC,{children:"This deletes the domain metadata. External DNS records are not touched."})]}),c.jsxs(fC,{children:[c.jsx(vC,{children:"Cancel"}),c.jsx(yC,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>de.mutate(ne.id),children:"Delete"})]})]})]})]})})]},ne.id)),(!K||K.length===0)&&c.jsx("tr",{children:c.jsx("td",{colSpan:4,className:"text-muted-foreground px-3 py-8 text-center",children:"No domains yet."})})]})]})})]})}),c.jsx("div",{children:c.jsxs(ya,{className:"p-3 md:col-span-7",children:[c.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[c.jsxs("div",{className:"text-sm font-semibold",children:["Records ",s?`— ${s.domain_name}`:""]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(kT,{s:s?.status}),c.jsxs(dn,{open:b,onOpenChange:w,children:[c.jsx(Ai,{asChild:!0,children:c.jsxs(Pe,{disabled:!s,children:[c.jsx(qa,{className:"mr-2 h-4 w-4"}),"Add Record"]})}),c.jsxs(hn,{className:"sm:max-w-xl",children:[c.jsx(pn,{children:c.jsx(fn,{children:"Add Record"})}),c.jsx(mr,{...je,children:c.jsxs("form",{className:"space-y-4 pt-2",onSubmit:je.handleSubmit(ne=>ie.mutate(ne)),children:[c.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-3",children:[c.jsx(ft,{control:je.control,name:"name",render:({field:ne})=>c.jsxs(ot,{className:"md:col-span-1",children:[c.jsx(lt,{children:"Name"}),c.jsx(bt,{children:c.jsx(mt,{...ne,placeholder:"endpoint (or @)"})}),c.jsx(pt,{})]})}),c.jsx(ft,{control:je.control,name:"type",render:({field:ne})=>c.jsxs(ot,{children:[c.jsx(lt,{children:"Type"}),c.jsxs(_n,{onValueChange:ne.onChange,defaultValue:ne.value,children:[c.jsx(bt,{children:c.jsx(Nn,{children:c.jsx($n,{})})}),c.jsx(Dn,{children:z_.map(ce=>c.jsx(Ct,{value:ce,children:ce},ce))})]}),c.jsx(pt,{})]})}),c.jsx(ft,{control:je.control,name:"ttl",render:({field:ne})=>c.jsxs(ot,{children:[c.jsx(lt,{children:"TTL (sec, optional)"}),c.jsx(bt,{children:c.jsx(mt,{type:"number",value:ne.value,onChange:ce=>ne.onChange(ce.target.value===""?void 0:Number(ce.target.value)),placeholder:"300"})}),c.jsx(pt,{})]})})]}),c.jsx(ft,{control:je.control,name:"valuesCsv",render:({field:ne})=>c.jsxs(ot,{children:[c.jsx(lt,{children:"Values (comma-separated)"}),c.jsx(bt,{children:c.jsx(nl,{...ne,rows:3,placeholder:'e.g. 10.0.30.1, 10.0.30.2 or "v=spf1 ~all"',className:"font-mono"})}),c.jsx(pt,{})]})}),c.jsxs(gn,{className:"gap-2",children:[c.jsx(Pe,{variant:"outline",type:"button",onClick:()=>w(!1),children:"Cancel"}),c.jsxs(Pe,{type:"submit",disabled:ie.isPending,children:[ie.isPending&&c.jsx(ys,{className:"mr-2 h-4 w-4 animate-spin"}),"Create"]})]})]})})]})]})]})]}),c.jsxs("div",{className:"overflow-x-auto rounded-md border",children:[F.isLoading&&c.jsxs("div",{className:"flex items-center gap-2 p-4",children:[c.jsx(ys,{className:"h-4 w-4 animate-spin"})," Loading records…"]}),!F.isLoading&&c.jsxs("table",{className:"min-w-full text-sm",children:[c.jsx("thead",{className:"bg-muted/40 text-xs tracking-wide uppercase",children:c.jsxs("tr",{children:[c.jsx("th",{className:"px-3 py-2 text-left",children:"Name"}),c.jsx("th",{className:"px-3 py-2 text-left",children:"Type"}),c.jsx("th",{className:"px-3 py-2 text-left",children:"TTL"}),c.jsx("th",{className:"px-3 py-2 text-left",children:"Values"}),c.jsx("th",{className:"px-3 py-2 text-left",children:"Status"}),c.jsx("th",{className:"px-3 py-2 text-left",children:"Owner"}),c.jsx("th",{className:"px-3 py-2 text-right",children:"Actions"})]})}),c.jsxs("tbody",{children:[(F.data??[]).map(ne=>{const ce=ne.values||[];return c.jsxs("tr",{className:"border-t",children:[c.jsx("td",{className:"px-3 py-2 font-medium",children:ne.name||"@"}),c.jsx("td",{className:"px-3 py-2",children:ne.type}),c.jsx("td",{className:"px-3 py-2",children:ne.ttl??"—"}),c.jsx("td",{className:"px-3 py-2",children:c.jsx("div",{className:"max-w-[420px] truncate",title:(ce||[]).join(", "),children:(ce||[]).join(", ")})}),c.jsx("td",{className:"px-3 py-2",children:c.jsx(kT,{s:ne.status})}),c.jsx("td",{className:"px-3 py-2",children:ne.owner}),c.jsx("td",{className:"px-3 py-2",children:c.jsxs("div",{className:"flex items-center justify-end gap-2",children:[c.jsx(Pe,{size:"icon",variant:"ghost",onClick:()=>Ae(ne),children:c.jsx(uc,{className:"h-4 w-4"})}),c.jsxs(uC,{children:[c.jsx(dC,{asChild:!0,children:c.jsx(Pe,{size:"icon",variant:"ghost",children:c.jsx(wg,{className:"h-4 w-4"})})}),c.jsxs(hC,{children:[c.jsxs(pC,{children:[c.jsxs(mC,{children:["Delete “",ne.name||"@"," ",ne.type,"”?"]}),c.jsx(gC,{children:"This removes the record set from your project. Your worker does not delete it from the DNS provider right now."})]}),c.jsxs(fC,{children:[c.jsx(vC,{children:"Cancel"}),c.jsx(yC,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>ue.mutate(ne.id),children:"Delete"})]})]})]}),c.jsxs(C$,{children:[c.jsx(A$,{asChild:!0,children:c.jsx(Pe,{variant:"ghost",size:"icon",children:c.jsx(Z_,{className:"h-4 w-4"})})}),c.jsxs(O$,{align:"end",children:[c.jsx(kp,{onClick:()=>Ae(ne),children:"Edit"}),c.jsx(kp,{className:"text-destructive",onClick:()=>ue.mutate(ne.id),children:"Delete"})]})]})]})})]},ne.id)}),(!F.data||F.data.length===0)&&c.jsx("tr",{children:c.jsx("td",{colSpan:7,className:"text-muted-foreground px-3 py-8 text-center",children:s?"No records yet — add one.":"Select a domain to view records."})})]})]})]})]})}),c.jsx(dn,{open:m,onOpenChange:g,children:c.jsxs(hn,{className:"sm:max-w-lg",children:[c.jsx(pn,{children:c.jsx(fn,{children:"Edit Domain"})}),c.jsx(mr,{...ae,children:c.jsxs("form",{className:"space-y-4 pt-2",onSubmit:ae.handleSubmit(ne=>te.mutate(ne)),children:[c.jsx(ft,{control:ae.control,name:"domain_name",render:({field:ne})=>c.jsxs(ot,{children:[c.jsx(lt,{children:"Domain"}),c.jsx(bt,{children:c.jsx(mt,{...ne,placeholder:"example.com"})}),c.jsx(pt,{})]})}),c.jsx(ft,{control:ae.control,name:"credential_id",render:({field:ne})=>c.jsxs(ot,{children:[c.jsx(lt,{children:"Route53 Credential"}),c.jsxs(_n,{onValueChange:ne.onChange,value:ne.value??"",disabled:H.isLoading||(V?.length??0)===0,children:[c.jsx(bt,{children:c.jsx(Nn,{children:c.jsx($n,{placeholder:H.isLoading?"Loading…":(V?.length??0)===0?"No Route53 credentials found":"Select credential"})})}),c.jsx(Dn,{children:(V??[]).map(ce=>c.jsx(Ct,{value:ce.id,children:V3(ce)},ce.id))})]}),H.error&&c.jsx("p",{className:"text-destructive text-xs",children:"Failed to load credentials."}),c.jsx(pt,{})]})}),c.jsx(ft,{control:ae.control,name:"zone_id",render:({field:ne})=>c.jsxs(ot,{children:[c.jsx(lt,{children:"Zone ID"}),c.jsx(bt,{children:c.jsx(mt,{...ne,placeholder:"/hostedzone/Z123…"})}),c.jsx(pt,{})]})}),c.jsxs(gn,{className:"gap-2",children:[c.jsx(Pe,{variant:"outline",type:"button",onClick:()=>g(!1),children:"Cancel"}),c.jsxs(Pe,{type:"submit",disabled:te.isPending,children:[te.isPending&&c.jsx(ys,{className:"mr-2 h-4 w-4 animate-spin"}),"Save Changes"]})]})]})})]})}),c.jsx(dn,{open:E,onOpenChange:A,children:c.jsxs(hn,{className:"sm:max-w-xl",children:[c.jsx(pn,{children:c.jsx(fn,{children:"Edit Record"})}),c.jsx(mr,{...Se,children:c.jsxs("form",{className:"space-y-4 pt-2",onSubmit:Se.handleSubmit(ne=>He.mutate(ne)),children:[c.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-3",children:[c.jsx(ft,{control:Se.control,name:"name",render:({field:ne})=>c.jsxs(ot,{className:"md:col-span-1",children:[c.jsx(lt,{children:"Name"}),c.jsx(bt,{children:c.jsx(mt,{...ne})}),c.jsx(pt,{})]})}),c.jsx(ft,{control:Se.control,name:"type",render:({field:ne})=>c.jsxs(ot,{children:[c.jsx(lt,{children:"Type"}),c.jsxs(_n,{onValueChange:ne.onChange,defaultValue:ne.value,children:[c.jsx(bt,{children:c.jsx(Nn,{children:c.jsx($n,{})})}),c.jsx(Dn,{children:z_.map(ce=>c.jsx(Ct,{value:ce,children:ce},ce))})]}),c.jsx(pt,{})]})}),c.jsx(ft,{control:Se.control,name:"ttl",render:({field:ne})=>c.jsxs(ot,{children:[c.jsx(lt,{children:"TTL (sec, optional)"}),c.jsx(bt,{children:c.jsx(mt,{type:"number",value:ne.value,onChange:ce=>ne.onChange(ce.target.value===""?void 0:Number(ce.target.value)),placeholder:"300"})}),c.jsx(pt,{})]})})]}),c.jsx(ft,{control:Se.control,name:"valuesCsv",render:({field:ne})=>c.jsxs(ot,{children:[c.jsx(lt,{children:"Values (comma-separated)"}),c.jsx(bt,{children:c.jsx(nl,{...ne,rows:3,className:"font-mono"})}),c.jsx(pt,{})]})}),c.jsxs(gn,{className:"gap-2",children:[c.jsx(Pe,{variant:"outline",type:"button",onClick:()=>A(!1),children:"Cancel"}),c.jsxs(Pe,{type:"submit",disabled:He.isPending,children:[He.isPending&&c.jsx(ys,{className:"mr-2 h-4 w-4 animate-spin"}),"Save Changes"]})]})]})})]})})]})};var H3={};var G3;function Uwe(){return G3||(G3=1,(()=>{var e,r,s={557:(h,m,g)=>{const b=globalThis,w=b.ShadowRoot&&(b.ShadyCSS===void 0||b.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,E=Symbol(),A=new WeakMap;class k{constructor(n,i,l){if(this._$cssResult$=!0,l!==E)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=n,this.t=i}get styleSheet(){let n=this.o;const i=this.t;if(w&&n===void 0){const l=i!==void 0&&i.length===1;l&&(n=A.get(i)),n===void 0&&((this.o=n=new CSSStyleSheet).replaceSync(this.cssText),l&&A.set(i,n))}return n}toString(){return this.cssText}}const R=t=>new k(typeof t=="string"?t:t+"",void 0,E),M=(t,...n)=>{const i=t.length===1?t[0]:n.reduce(((l,p,v)=>l+(x=>{if(x._$cssResult$===!0)return x.cssText;if(typeof x=="number")return x;throw Error("Value passed to 'css' function must be a 'css' function result: "+x+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(p)+t[v+1]),t[0]);return new k(i,t,E)},I=(t,n)=>{if(w)t.adoptedStyleSheets=n.map((i=>i instanceof CSSStyleSheet?i:i.styleSheet));else for(const i of n){const l=document.createElement("style"),p=b.litNonce;p!==void 0&&l.setAttribute("nonce",p),l.textContent=i.cssText,t.appendChild(l)}},F=w?t=>t:t=>t instanceof CSSStyleSheet?(n=>{let i="";for(const l of n.cssRules)i+=l.cssText;return R(i)})(t):t,{is:H,defineProperty:V,getOwnPropertyDescriptor:K,getOwnPropertyNames:z,getOwnPropertySymbols:W,getPrototypeOf:ae}=Object,Q=globalThis,te=Q.trustedTypes,de=te?te.emptyScript:"",je=Q.reactiveElementPolyfillSupport,we=(t,n)=>t,ie={toAttribute(t,n){switch(n){case Boolean:t=t?de:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,n){let i=t;switch(n){case Boolean:i=t!==null;break;case Number:i=t===null?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch{i=null}}return i}},Se=(t,n)=>!H(t,n),Ae={attribute:!0,type:String,converter:ie,reflect:!1,hasChanged:Se};Symbol.metadata??=Symbol("metadata"),Q.litPropertyMetadata??=new WeakMap;class He extends HTMLElement{static addInitializer(n){this._$Ei(),(this.l??=[]).push(n)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(n,i=Ae){if(i.state&&(i.attribute=!1),this._$Ei(),this.elementProperties.set(n,i),!i.noAccessor){const l=Symbol(),p=this.getPropertyDescriptor(n,l,i);p!==void 0&&V(this.prototype,n,p)}}static getPropertyDescriptor(n,i,l){const{get:p,set:v}=K(this.prototype,n)??{get(){return this[i]},set(x){this[i]=x}};return{get(){return p?.call(this)},set(x){const S=p?.call(this);v.call(this,x),this.requestUpdate(n,S,l)},configurable:!0,enumerable:!0}}static getPropertyOptions(n){return this.elementProperties.get(n)??Ae}static _$Ei(){if(this.hasOwnProperty(we("elementProperties")))return;const n=ae(this);n.finalize(),n.l!==void 0&&(this.l=[...n.l]),this.elementProperties=new Map(n.elementProperties)}static finalize(){if(this.hasOwnProperty(we("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(we("properties"))){const i=this.properties,l=[...z(i),...W(i)];for(const p of l)this.createProperty(p,i[p])}const n=this[Symbol.metadata];if(n!==null){const i=litPropertyMetadata.get(n);if(i!==void 0)for(const[l,p]of i)this.elementProperties.set(l,p)}this._$Eh=new Map;for(const[i,l]of this.elementProperties){const p=this._$Eu(i,l);p!==void 0&&this._$Eh.set(p,i)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(n){const i=[];if(Array.isArray(n)){const l=new Set(n.flat(1/0).reverse());for(const p of l)i.unshift(F(p))}else n!==void 0&&i.push(F(n));return i}static _$Eu(n,i){const l=i.attribute;return l===!1?void 0:typeof l=="string"?l:typeof n=="string"?n.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((n=>this.enableUpdating=n)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((n=>n(this)))}addController(n){(this._$EO??=new Set).add(n),this.renderRoot!==void 0&&this.isConnected&&n.hostConnected?.()}removeController(n){this._$EO?.delete(n)}_$E_(){const n=new Map,i=this.constructor.elementProperties;for(const l of i.keys())this.hasOwnProperty(l)&&(n.set(l,this[l]),delete this[l]);n.size>0&&(this._$Ep=n)}createRenderRoot(){const n=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return I(n,this.constructor.elementStyles),n}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((n=>n.hostConnected?.()))}enableUpdating(n){}disconnectedCallback(){this._$EO?.forEach((n=>n.hostDisconnected?.()))}attributeChangedCallback(n,i,l){this._$AK(n,l)}_$EC(n,i){const l=this.constructor.elementProperties.get(n),p=this.constructor._$Eu(n,l);if(p!==void 0&&l.reflect===!0){const v=(l.converter?.toAttribute!==void 0?l.converter:ie).toAttribute(i,l.type);this._$Em=n,v==null?this.removeAttribute(p):this.setAttribute(p,v),this._$Em=null}}_$AK(n,i){const l=this.constructor,p=l._$Eh.get(n);if(p!==void 0&&this._$Em!==p){const v=l.getPropertyOptions(p),x=typeof v.converter=="function"?{fromAttribute:v.converter}:v.converter?.fromAttribute!==void 0?v.converter:ie;this._$Em=p,this[p]=x.fromAttribute(i,v.type),this._$Em=null}}requestUpdate(n,i,l){if(n!==void 0){if(l??=this.constructor.getPropertyOptions(n),!(l.hasChanged??Se)(this[n],i))return;this.P(n,i,l)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(n,i,l){this._$AL.has(n)||this._$AL.set(n,i),l.reflect===!0&&this._$Em!==n&&(this._$Ej??=new Set).add(n)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(i){Promise.reject(i)}const n=this.scheduleUpdate();return n!=null&&await n,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[p,v]of this._$Ep)this[p]=v;this._$Ep=void 0}const l=this.constructor.elementProperties;if(l.size>0)for(const[p,v]of l)v.wrapped!==!0||this._$AL.has(p)||this[p]===void 0||this.P(p,this[p],v)}let n=!1;const i=this._$AL;try{n=this.shouldUpdate(i),n?(this.willUpdate(i),this._$EO?.forEach((l=>l.hostUpdate?.())),this.update(i)):this._$EU()}catch(l){throw n=!1,this._$EU(),l}n&&this._$AE(i)}willUpdate(n){}_$AE(n){this._$EO?.forEach((i=>i.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(n)),this.updated(n)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(n){return!0}update(n){this._$Ej&&=this._$Ej.forEach((i=>this._$EC(i,this[i]))),this._$EU()}updated(n){}firstUpdated(n){}}He.elementStyles=[],He.shadowRootOptions={mode:"open"},He[we("elementProperties")]=new Map,He[we("finalized")]=new Map,je?.({ReactiveElement:He}),(Q.reactiveElementVersions??=[]).push("2.0.4");const ue=globalThis,ne=ue.trustedTypes,ce=ne?ne.createPolicy("lit-html",{createHTML:t=>t}):void 0,$e="$lit$",me=`lit$${Math.random().toFixed(9).slice(2)}$`,Xe="?"+me,Oe=`<${Xe}>`,Te=document,Ke=()=>Te.createComment(""),se=t=>t===null||typeof t!="object"&&typeof t!="function",Ne=Array.isArray,Fe=t=>Ne(t)||typeof t?.[Symbol.iterator]=="function",at=`[ \f\r]`,gt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ot=/-->/g,Lt=/>/g,Rt=RegExp(`>|${at}(?:([^\\s"'>=/]+)(${at}*=${at}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`,"g"),Ft=/'/g,qe=/"/g,Bt=/^(?:script|style|textarea|title)$/i,kt=t=>(n,...i)=>({_$litType$:t,strings:n,values:i}),G=kt(1),On=Symbol.for("lit-noChange"),mn=Symbol.for("lit-nothing"),Oi=new WeakMap,ge=Te.createTreeWalker(Te,129);function Me(t,n){if(!Ne(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return ce!==void 0?ce.createHTML(n):n}const _=(t,n)=>{const i=t.length-1,l=[];let p,v=n===2?"":n===3?"":"",x=gt;for(let S=0;S"?(x=p??gt,$=-1):D[1]===void 0?$=-2:($=x.lastIndex-D[2].length,N=D[1],x=D[3]===void 0?Rt:D[3]==='"'?qe:Ft):x===qe||x===Ft?x=Rt:x===Ot||x===Lt?x=gt:(x=Rt,p=void 0);const U=x===Rt&&t[S+1].startsWith("/>")?" ":"";v+=x===gt?C+Oe:$>=0?(l.push(N),C.slice(0,$)+$e+C.slice($)+me+U):C+me+($===-2?S:U)}return[Me(t,v+(t[i]||"")+(n===2?"":n===3?"":"")),l]};class q{constructor({strings:n,_$litType$:i},l){let p;this.parts=[];let v=0,x=0;const S=n.length-1,C=this.parts,[N,D]=_(n,i);if(this.el=q.createElement(N,l),ge.currentNode=this.el.content,i===2||i===3){const $=this.el.content.firstChild;$.replaceWith(...$.childNodes)}for(;(p=ge.nextNode())!==null&&C.length0){p.textContent=ne?ne.emptyScript:"";for(let U=0;U2||l[0]!==""||l[1]!==""?(this._$AH=Array(l.length-1).fill(new String),this.strings=l):this._$AH=mn}_$AI(n,i=this,l,p){const v=this.strings;let x=!1;if(v===void 0)n=X(this,n,i,0),x=!se(n)||n!==this._$AH&&n!==On,x&&(this._$AH=n);else{const S=n;let C,N;for(n=v[0],C=0;C{const x=v?.renderBefore??p;let S=x._$litPart$;if(S===void 0){const C=v?.renderBefore??null;x._$litPart$=S=new ve(p.insertBefore(Ke(),C),C,void 0,v??{})}return S._$AI(l),S})(i,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return On}}Gt._$litElement$=!0,Gt.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:Gt});const ss=globalThis.litElementPolyfillSupport;ss?.({LitElement:Gt});function is(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}(globalThis.litElementVersions??=[]).push("4.1.0");let Yi={async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1};const dl=/[&<>"']/,ki=new RegExp(dl.source,"g"),pc=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,wu=new RegExp(pc.source,"g"),fc={"&":"&","<":"<",">":">",'"':""","'":"'"},ba=t=>fc[t];function qt(t,n){if(n){if(dl.test(t))return t.replace(ki,ba)}else if(pc.test(t))return t.replace(wu,ba);return t}const xr=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function Yr(t){return t.replace(xr,((n,i)=>(i=i.toLowerCase())==="colon"?":":i.charAt(0)==="#"?i.charAt(1)==="x"?String.fromCharCode(parseInt(i.substring(2),16)):String.fromCharCode(+i.substring(1)):""))}const Rs=/(^|[^\[])\^/g;function Pn(t,n){t=typeof t=="string"?t:t.source,n=n||"";const i={replace:(l,p)=>(p=(p=p.source||p).replace(Rs,"$1"),t=t.replace(l,p),i),getRegex:()=>new RegExp(t,n)};return i}const Er=/[^\w:]/g,ti=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function hl(t,n,i){if(t){let l;try{l=decodeURIComponent(Yr(i)).replace(Er,"").toLowerCase()}catch{return null}if(l.indexOf("javascript:")===0||l.indexOf("vbscript:")===0||l.indexOf("data:")===0)return null}n&&!ti.test(i)&&(i=(function(l,p){xs[" "+l]||(ni.test(l)?xs[" "+l]=l+"/":xs[" "+l]=Sa(l,"/",!0)),l=xs[" "+l];const v=l.indexOf(":")===-1;return p.substring(0,2)==="//"?v?p:l.replace(Su,"$1")+p:p.charAt(0)==="/"?v?p:l.replace(wa,"$1")+p:l+p})(n,i));try{i=encodeURI(i).replace(/%25/g,"%")}catch{return null}return i}const xs={},ni=/^[^:]+:\/*[^/]*$/,Su=/^([^:]+:)[\s\S]*$/,wa=/^([^:]+:\/*[^/]*)[\s\S]*$/,Eu={exec:function(){}};function Ug(t,n){const i=t.replace(/\|/g,((p,v,x)=>{let S=!1,C=v;for(;--C>=0&&x[C]==="\\";)S=!S;return S?"|":" |"})).split(/ \|/);let l=0;if(i[0].trim()||i.shift(),i.length>0&&!i[i.length-1].trim()&&i.pop(),i.length>n)i.splice(n);else for(;i.length1;)1&n&&(i+=t),n>>=1,t+=t;return i+t}function zs(t,n,i,l){const p=n.href,v=n.title?qt(n.title):null,x=t[1].replace(/\\([\[\]])/g,"$1");if(t[0].charAt(0)!=="!"){l.state.inLink=!0;const S={type:"link",raw:i,href:p,title:v,text:x,tokens:l.inlineTokens(x)};return l.state.inLink=!1,S}return{type:"image",raw:i,href:p,title:v,text:qt(x)}}class pl{constructor(n){this.options=n||Yi}space(n){const i=this.rules.block.newline.exec(n);if(i&&i[0].length>0)return{type:"space",raw:i[0]}}code(n){const i=this.rules.block.code.exec(n);if(i){const l=i[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:i[0],codeBlockStyle:"indented",text:this.options.pedantic?l:Sa(l,` `)}}}fences(n){const i=this.rules.block.fences.exec(n);if(i){const l=i[0],p=(function(v,x){const S=v.match(/^(\s+)(?:```)/);if(S===null)return x;const C=S[1];return x.split(` `).map((N=>{const D=N.match(/^\s+/);if(D===null)return N;const[$]=D;return $.length>=C.length?N.slice(C.length):N})).join(` `)})(l,i[3]||"");return{type:"code",raw:l,lang:i[2]?i[2].trim().replace(this.rules.inline._escapes,"$1"):i[2],text:p}}}heading(n){const i=this.rules.block.heading.exec(n);if(i){let l=i[2].trim();if(/#$/.test(l)){const p=Sa(l,"#");this.options.pedantic?l=p.trim():p&&!/ $/.test(p)||(l=p.trim())}return{type:"heading",raw:i[0],depth:i[1].length,text:l,tokens:this.lexer.inline(l)}}}hr(n){const i=this.rules.block.hr.exec(n);if(i)return{type:"hr",raw:i[0]}}blockquote(n){const i=this.rules.block.blockquote.exec(n);if(i){const l=i[0].replace(/^ *>[ \t]?/gm,""),p=this.lexer.state.top;this.lexer.state.top=!0;const v=this.lexer.blockTokens(l);return this.lexer.state.top=p,{type:"blockquote",raw:i[0],tokens:v,text:l}}}list(n){let i=this.rules.block.list.exec(n);if(i){let l,p,v,x,S,C,N,D,$,L,U,J,Y=i[1].trim();const Z=Y.length>1,P={type:"list",raw:"",ordered:Z,start:Z?+Y.slice(0,-1):"",loose:!1,items:[]};Y=Z?`\\d{1,9}\\${Y.slice(-1)}`:`\\${Y}`,this.options.pedantic&&(Y=Z?Y:"[*+-]");const re=new RegExp(`^( {0,3}${Y})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;n&&(J=!1,i=re.exec(n))&&!this.rules.block.hr.test(n);){if(l=i[0],n=n.substring(l.length),D=i[2].split(` `,1)[0].replace(/^\t+/,(he=>" ".repeat(3*he.length))),$=n.split(` `,1)[0],this.options.pedantic?(x=2,U=D.trimLeft()):(x=i[2].search(/[^ ]/),x=x>4?1:x,U=D.slice(x),x+=i[1].length),C=!1,!D&&/^ *$/.test($)&&(l+=$+` `,n=n.substring($.length+1),J=!0),!J){const he=new RegExp(`^ {0,${Math.min(3,x-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),xe=new RegExp(`^ {0,${Math.min(3,x-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),pe=new RegExp(`^ {0,${Math.min(3,x-1)}}(?:\`\`\`|~~~)`),_e=new RegExp(`^ {0,${Math.min(3,x-1)}}#`);for(;n&&(L=n.split(` `,1)[0],$=L,this.options.pedantic&&($=$.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!pe.test($))&&!_e.test($)&&!he.test($)&&!xe.test(n);){if($.search(/[^ ]/)>=x||!$.trim())U+=` `+$.slice(x);else{if(C||D.search(/[^ ]/)>=4||pe.test(D)||_e.test(D)||xe.test(D))break;U+=` `+$}C||$.trim()||(C=!0),l+=L+` `,n=n.substring(L.length+1),D=$.slice(x)}}P.loose||(N?P.loose=!0:/\n *\n *$/.test(l)&&(N=!0)),this.options.gfm&&(p=/^\[[ xX]\] /.exec(U),p&&(v=p[0]!=="[ ] ",U=U.replace(/^\[[ xX]\] +/,""))),P.items.push({type:"list_item",raw:l,task:!!p,checked:v,loose:!1,text:U}),P.raw+=l}P.items[P.items.length-1].raw=l.trimRight(),P.items[P.items.length-1].text=U.trimRight(),P.raw=P.raw.trimRight();const le=P.items.length;for(S=0;Spe.type==="space")),xe=he.length>0&&he.some((pe=>/\n.*\n/.test(pe.raw)));P.loose=xe}if(P.loose)for(S=0;S$/,"$1").replace(this.rules.inline._escapes,"$1"):"",v=i[3]?i[3].substring(1,i[3].length-1).replace(this.rules.inline._escapes,"$1"):i[3];return{type:"def",tag:l,raw:i[0],href:p,title:v}}}table(n){const i=this.rules.block.table.exec(n);if(i){const l={type:"table",header:Ug(i[1]).map((p=>({text:p}))),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:i[3]&&i[3].trim()?i[3].replace(/\n[ \t]*$/,"").split(` `):[]};if(l.header.length===l.align.length){l.raw=i[0];let p,v,x,S,C=l.align.length;for(p=0;p({text:N})));for(C=l.header.length,v=0;v/i.test(i[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(i[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(i[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:i[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):qt(i[0]):i[0]}}link(n){const i=this.rules.inline.link.exec(n);if(i){const l=i[2].trim();if(!this.options.pedantic&&/^$/.test(l))return;const x=Sa(l.slice(0,-1),"\\");if((l.length-x.length)%2==0)return}else{const x=(function(S,C){if(S.indexOf(C[1])===-1)return-1;const N=S.length;let D=0,$=0;for(;$-1){const S=(i[0].indexOf("!")===0?5:4)+i[1].length+x;i[2]=i[2].substring(0,x),i[0]=i[0].substring(0,S).trim(),i[3]=""}}let p=i[2],v="";if(this.options.pedantic){const x=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(p);x&&(p=x[1],v=x[3])}else v=i[3]?i[3].slice(1,-1):"";return p=p.trim(),/^$/.test(l)?p.slice(1):p.slice(1,-1)),zs(i,{href:p&&p.replace(this.rules.inline._escapes,"$1"),title:v&&v.replace(this.rules.inline._escapes,"$1")},i[0],this.lexer)}}reflink(n,i){let l;if((l=this.rules.inline.reflink.exec(n))||(l=this.rules.inline.nolink.exec(n))){let p=(l[2]||l[1]).replace(/\s+/g," ");if(p=i[p.toLowerCase()],!p){const v=l[0].charAt(0);return{type:"text",raw:v,text:v}}return zs(l,p,l[0],this.lexer)}}emStrong(n,i,l=""){let p=this.rules.inline.emStrong.lDelim.exec(n);if(!p||p[3]&&l.match(/[\p{L}\p{N}]/u))return;const v=p[1]||p[2]||"";if(!v||v&&(l===""||this.rules.inline.punctuation.exec(l))){const x=p[0].length-1;let S,C,N=x,D=0;const $=p[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for($.lastIndex=0,i=i.slice(-1*n.length+x);(p=$.exec(i))!=null;){if(S=p[1]||p[2]||p[3]||p[4]||p[5]||p[6],!S)continue;if(C=S.length,p[3]||p[4]){N+=C;continue}if((p[5]||p[6])&&x%3&&!((x+C)%3)){D+=C;continue}if(N-=C,N>0)continue;C=Math.min(C,C+N+D);const L=n.slice(0,x+p.index+(p[0].length-S.length)+C);if(Math.min(x,C)%2){const J=L.slice(1,-1);return{type:"em",raw:L,text:J,tokens:this.lexer.inlineTokens(J)}}const U=L.slice(2,-2);return{type:"strong",raw:L,text:U,tokens:this.lexer.inlineTokens(U)}}}}codespan(n){const i=this.rules.inline.code.exec(n);if(i){let l=i[2].replace(/\n/g," ");const p=/[^ ]/.test(l),v=/^ /.test(l)&&/ $/.test(l);return p&&v&&(l=l.substring(1,l.length-1)),l=qt(l,!0),{type:"codespan",raw:i[0],text:l}}}br(n){const i=this.rules.inline.br.exec(n);if(i)return{type:"br",raw:i[0]}}del(n){const i=this.rules.inline.del.exec(n);if(i)return{type:"del",raw:i[0],text:i[2],tokens:this.lexer.inlineTokens(i[2])}}autolink(n,i){const l=this.rules.inline.autolink.exec(n);if(l){let p,v;return l[2]==="@"?(p=qt(this.options.mangle?i(l[1]):l[1]),v="mailto:"+p):(p=qt(l[1]),v=p),{type:"link",raw:l[0],text:p,href:v,tokens:[{type:"text",raw:p,text:p}]}}}url(n,i){let l;if(l=this.rules.inline.url.exec(n)){let p,v;if(l[2]==="@")p=qt(this.options.mangle?i(l[0]):l[0]),v="mailto:"+p;else{let x;do x=l[0],l[0]=this.rules.inline._backpedal.exec(l[0])[0];while(x!==l[0]);p=qt(l[0]),v=l[1]==="www."?"http://"+l[0]:l[0]}return{type:"link",raw:l[0],text:p,href:v,tokens:[{type:"text",raw:p,text:p}]}}}inlineText(n,i){const l=this.rules.inline.text.exec(n);if(l){let p;return p=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(l[0]):qt(l[0]):l[0]:qt(this.options.smartypants?i(l[0]):l[0]),{type:"text",raw:l[0],text:p}}}}const Yt={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:Eu,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};Yt.def=Pn(Yt.def).replace("label",Yt._label).replace("title",Yt._title).getRegex(),Yt.bullet=/(?:[*+-]|\d{1,9}[.)])/,Yt.listItemStart=Pn(/^( *)(bull) */).replace("bull",Yt.bullet).getRegex(),Yt.list=Pn(Yt.list).replace(/bull/g,Yt.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Yt.def.source+")").getRegex(),Yt._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Yt._comment=/|$)/,Yt.html=Pn(Yt.html,"i").replace("comment",Yt._comment).replace("tag",Yt._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Yt.paragraph=Pn(Yt._paragraph).replace("hr",Yt.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Yt._tag).getRegex(),Yt.blockquote=Pn(Yt.blockquote).replace("paragraph",Yt.paragraph).getRegex(),Yt.normal={...Yt},Yt.gfm={...Yt.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"},Yt.gfm.table=Pn(Yt.gfm.table).replace("hr",Yt.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Yt._tag).getRegex(),Yt.gfm.paragraph=Pn(Yt._paragraph).replace("hr",Yt.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",Yt.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Yt._tag).getRegex(),Yt.pedantic={...Yt.normal,html:Pn(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Yt._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Eu,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Pn(Yt.normal._paragraph).replace("hr",Yt.hr).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",Yt.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const Dt={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Eu,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Eu,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\.5&&(i="x"+i.toString(16)),l+="&#"+i+";";return l}Dt._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",Dt.punctuation=Pn(Dt.punctuation).replace(/punctuation/g,Dt._punctuation).getRegex(),Dt.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,Dt.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g,Dt._comment=Pn(Yt._comment).replace("(?:-->|$)","-->").getRegex(),Dt.emStrong.lDelim=Pn(Dt.emStrong.lDelim).replace(/punct/g,Dt._punctuation).getRegex(),Dt.emStrong.rDelimAst=Pn(Dt.emStrong.rDelimAst,"g").replace(/punct/g,Dt._punctuation).getRegex(),Dt.emStrong.rDelimUnd=Pn(Dt.emStrong.rDelimUnd,"g").replace(/punct/g,Dt._punctuation).getRegex(),Dt._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Dt._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Dt._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,Dt.autolink=Pn(Dt.autolink).replace("scheme",Dt._scheme).replace("email",Dt._email).getRegex(),Dt._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Dt.tag=Pn(Dt.tag).replace("comment",Dt._comment).replace("attribute",Dt._attribute).getRegex(),Dt._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Dt._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Dt._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Dt.link=Pn(Dt.link).replace("label",Dt._label).replace("href",Dt._href).replace("title",Dt._title).getRegex(),Dt.reflink=Pn(Dt.reflink).replace("label",Dt._label).replace("ref",Yt._label).getRegex(),Dt.nolink=Pn(Dt.nolink).replace("ref",Yt._label).getRegex(),Dt.reflinkSearch=Pn(Dt.reflinkSearch,"g").replace("reflink",Dt.reflink).replace("nolink",Dt.nolink).getRegex(),Dt.normal={...Dt},Dt.pedantic={...Dt.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Pn(/^!?\[(label)\]\((.*?)\)/).replace("label",Dt._label).getRegex(),reflink:Pn(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Dt._label).getRegex()},Dt.gfm={...Dt.normal,escape:Pn(Dt.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\C+" ".repeat(N.length)));n;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((S=>!!(l=S.call({lexer:this},n,i))&&(n=n.substring(l.raw.length),i.push(l),!0)))))if(l=this.tokenizer.space(n))n=n.substring(l.raw.length),l.raw.length===1&&i.length>0?i[i.length-1].raw+=` `:i.push(l);else if(l=this.tokenizer.code(n))n=n.substring(l.raw.length),p=i[i.length-1],!p||p.type!=="paragraph"&&p.type!=="text"?i.push(l):(p.raw+=` `+l.raw,p.text+=` `+l.text,this.inlineQueue[this.inlineQueue.length-1].src=p.text);else if(l=this.tokenizer.fences(n))n=n.substring(l.raw.length),i.push(l);else if(l=this.tokenizer.heading(n))n=n.substring(l.raw.length),i.push(l);else if(l=this.tokenizer.hr(n))n=n.substring(l.raw.length),i.push(l);else if(l=this.tokenizer.blockquote(n))n=n.substring(l.raw.length),i.push(l);else if(l=this.tokenizer.list(n))n=n.substring(l.raw.length),i.push(l);else if(l=this.tokenizer.html(n))n=n.substring(l.raw.length),i.push(l);else if(l=this.tokenizer.def(n))n=n.substring(l.raw.length),p=i[i.length-1],!p||p.type!=="paragraph"&&p.type!=="text"?this.tokens.links[l.tag]||(this.tokens.links[l.tag]={href:l.href,title:l.title}):(p.raw+=` `+l.raw,p.text+=` `+l.raw,this.inlineQueue[this.inlineQueue.length-1].src=p.text);else if(l=this.tokenizer.table(n))n=n.substring(l.raw.length),i.push(l);else if(l=this.tokenizer.lheading(n))n=n.substring(l.raw.length),i.push(l);else{if(v=n,this.options.extensions&&this.options.extensions.startBlock){let S=1/0;const C=n.slice(1);let N;this.options.extensions.startBlock.forEach((function(D){N=D.call({lexer:this},C),typeof N=="number"&&N>=0&&(S=Math.min(S,N))})),S<1/0&&S>=0&&(v=n.substring(0,S+1))}if(this.state.top&&(l=this.tokenizer.paragraph(v)))p=i[i.length-1],x&&p.type==="paragraph"?(p.raw+=` `+l.raw,p.text+=` `+l.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=p.text):i.push(l),x=v.length!==n.length,n=n.substring(l.raw.length);else if(l=this.tokenizer.text(n))n=n.substring(l.raw.length),p=i[i.length-1],p&&p.type==="text"?(p.raw+=` `+l.raw,p.text+=` `+l.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=p.text):i.push(l);else if(n){const S="Infinite loop on byte: "+n.charCodeAt(0);if(this.options.silent){console.error(S);break}throw new Error(S)}}return this.state.top=!0,i}inline(n,i=[]){return this.inlineQueue.push({src:n,tokens:i}),i}inlineTokens(n,i=[]){let l,p,v,x,S,C,N=n;if(this.tokens.links){const D=Object.keys(this.tokens.links);if(D.length>0)for(;(x=this.tokenizer.rules.inline.reflinkSearch.exec(N))!=null;)D.includes(x[0].slice(x[0].lastIndexOf("[")+1,-1))&&(N=N.slice(0,x.index)+"["+as("a",x[0].length-2)+"]"+N.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(x=this.tokenizer.rules.inline.blockSkip.exec(N))!=null;)N=N.slice(0,x.index)+"["+as("a",x[0].length-2)+"]"+N.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(x=this.tokenizer.rules.inline.escapedEmSt.exec(N))!=null;)N=N.slice(0,x.index+x[0].length-2)+"++"+N.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;n;)if(S||(C=""),S=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((D=>!!(l=D.call({lexer:this},n,i))&&(n=n.substring(l.raw.length),i.push(l),!0)))))if(l=this.tokenizer.escape(n))n=n.substring(l.raw.length),i.push(l);else if(l=this.tokenizer.tag(n))n=n.substring(l.raw.length),p=i[i.length-1],p&&l.type==="text"&&p.type==="text"?(p.raw+=l.raw,p.text+=l.text):i.push(l);else if(l=this.tokenizer.link(n))n=n.substring(l.raw.length),i.push(l);else if(l=this.tokenizer.reflink(n,this.tokens.links))n=n.substring(l.raw.length),p=i[i.length-1],p&&l.type==="text"&&p.type==="text"?(p.raw+=l.raw,p.text+=l.text):i.push(l);else if(l=this.tokenizer.emStrong(n,N,C))n=n.substring(l.raw.length),i.push(l);else if(l=this.tokenizer.codespan(n))n=n.substring(l.raw.length),i.push(l);else if(l=this.tokenizer.br(n))n=n.substring(l.raw.length),i.push(l);else if(l=this.tokenizer.del(n))n=n.substring(l.raw.length),i.push(l);else if(l=this.tokenizer.autolink(n,Kg))n=n.substring(l.raw.length),i.push(l);else if(this.state.inLink||!(l=this.tokenizer.url(n,Kg))){if(v=n,this.options.extensions&&this.options.extensions.startInline){let D=1/0;const $=n.slice(1);let L;this.options.extensions.startInline.forEach((function(U){L=U.call({lexer:this},$),typeof L=="number"&&L>=0&&(D=Math.min(D,L))})),D<1/0&&D>=0&&(v=n.substring(0,D+1))}if(l=this.tokenizer.inlineText(v,cA))n=n.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(C=l.raw.slice(-1)),S=!0,p=i[i.length-1],p&&p.type==="text"?(p.raw+=l.raw,p.text+=l.text):i.push(l);else if(n){const D="Infinite loop on byte: "+n.charCodeAt(0);if(this.options.silent){console.error(D);break}throw new Error(D)}}else n=n.substring(l.raw.length),i.push(l);return i}}class rh{constructor(n){this.options=n||Yi}code(n,i,l){const p=(i||"").match(/\S*/)[0];if(this.options.highlight){const v=this.options.highlight(n,p);v!=null&&v!==n&&(l=!0,n=v)}return n=n.replace(/\n$/,"")+` `,p?'
'+(l?n:qt(n,!0))+`
`:"
"+(l?n:qt(n,!0))+`
`}blockquote(n){return`
${n}
`}html(n){return n}heading(n,i,l,p){return this.options.headerIds?`${n} `:`${n} `}hr(){return this.options.xhtml?`
`:`
`}list(n,i,l){const p=i?"ol":"ul";return"<"+p+(i&&l!==1?' start="'+l+'"':"")+`> `+n+" `}listitem(n){return`
  • ${n}
  • `}checkbox(n){return" "}paragraph(n){return`

    ${n}

    `}table(n,i){return i&&(i=`${i}`),` `+n+` `+i+`
    `}tablerow(n){return` ${n} `}tablecell(n,i){const l=i.header?"th":"td";return(i.align?`<${l} align="${i.align}">`:`<${l}>`)+n+` `}strong(n){return`${n}`}em(n){return`${n}`}codespan(n){return`${n}`}br(){return this.options.xhtml?"
    ":"
    "}del(n){return`${n}`}link(n,i,l){if((n=hl(this.options.sanitize,this.options.baseUrl,n))===null)return l;let p='",p}image(n,i,l){if((n=hl(this.options.sanitize,this.options.baseUrl,n))===null)return l;let p=`${l}":">",p}text(n){return n}}class mc{strong(n){return n}em(n){return n}codespan(n){return n}del(n){return n}html(n){return n}text(n){return n}link(n,i,l){return""+l}image(n,i,l){return""+l}br(){return""}}class gc{constructor(){this.seen={}}serialize(n){return n.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(n,i){let l=n,p=0;if(this.seen.hasOwnProperty(l)){p=this.seen[n];do p++,l=n+"-"+p;while(this.seen.hasOwnProperty(l))}return i||(this.seen[n]=p,this.seen[l]=0),l}slug(n,i={}){const l=this.serialize(n);return this.getNextSafeSlug(l,i.dryrun)}}class Ji{constructor(n){this.options=n||Yi,this.options.renderer=this.options.renderer||new rh,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new mc,this.slugger=new gc}static parse(n,i){return new Ji(i).parse(n)}static parseInline(n,i){return new Ji(i).parseInline(n)}parse(n,i=!0){let l,p,v,x,S,C,N,D,$,L,U,J,Y,Z,P,re,le,he,xe,pe="";const _e=n.length;for(l=0;l<_e;l++)if(L=n[l],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[L.type]&&(xe=this.options.extensions.renderers[L.type].call({parser:this},L),xe!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(L.type)))pe+=xe||"";else switch(L.type){case"space":continue;case"hr":pe+=this.renderer.hr();continue;case"heading":pe+=this.renderer.heading(this.parseInline(L.tokens),L.depth,Yr(this.parseInline(L.tokens,this.textRenderer)),this.slugger);continue;case"code":pe+=this.renderer.code(L.text,L.lang,L.escaped);continue;case"table":for(D="",N="",x=L.header.length,p=0;p0&&P.tokens[0].type==="paragraph"?(P.tokens[0].text=he+" "+P.tokens[0].text,P.tokens[0].tokens&&P.tokens[0].tokens.length>0&&P.tokens[0].tokens[0].type==="text"&&(P.tokens[0].tokens[0].text=he+" "+P.tokens[0].tokens[0].text)):P.tokens.unshift({type:"text",text:he}):Z+=he),Z+=this.parse(P.tokens,Y),$+=this.renderer.listitem(Z,le,re);pe+=this.renderer.list($,U,J);continue;case"html":pe+=this.renderer.html(L.text);continue;case"paragraph":pe+=this.renderer.paragraph(this.parseInline(L.tokens));continue;case"text":for($=L.tokens?this.parseInline(L.tokens):L.text;l+1<_e&&n[l+1].type==="text";)L=n[++l],$+=` `+(L.tokens?this.parseInline(L.tokens):L.text);pe+=i?this.renderer.paragraph($):$;continue;default:{const ke='Token with "'+L.type+'" type was not found.';if(this.options.silent)return void console.error(ke);throw new Error(ke)}}return pe}parseInline(n,i){i=i||this.renderer;let l,p,v,x="";const S=n.length;for(l=0;l{typeof l=="function"&&(p=l,l=null);const v={...l},x=(function(S,C,N){return D=>{if(D.message+=` Please report this to https://github.com/markedjs/marked.`,S){const $="

    An error occurred:

    "+qt(D.message+"",!0)+"
    ";return C?Promise.resolve($):N?void N(null,$):$}if(C)return Promise.reject(D);if(!N)throw D;N(D)}})((l={...yt.defaults,...v}).silent,l.async,p);if(i==null)return x(new Error("marked(): input parameter is undefined or null"));if(typeof i!="string")return x(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(i)+", string expected"));if((function(S){S&&S.sanitize&&!S.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")})(l),l.hooks&&(l.hooks.options=l),p){const S=l.highlight;let C;try{l.hooks&&(i=l.hooks.preprocess(i)),C=t(i,l)}catch($){return x($)}const N=function($){let L;if(!$)try{l.walkTokens&&yt.walkTokens(C,l.walkTokens),L=n(C,l),l.hooks&&(L=l.hooks.postprocess(L))}catch(U){$=U}return l.highlight=S,$?x($):p(null,L)};if(!S||S.length<3||(delete l.highlight,!C.length))return N();let D=0;return yt.walkTokens(C,(function($){$.type==="code"&&(D++,setTimeout((()=>{S($.text,$.lang,(function(L,U){if(L)return N(L);U!=null&&U!==$.text&&($.text=U,$.escaped=!0),D--,D===0&&N()}))}),0))})),void(D===0&&N())}if(l.async)return Promise.resolve(l.hooks?l.hooks.preprocess(i):i).then((S=>t(S,l))).then((S=>l.walkTokens?Promise.all(yt.walkTokens(S,l.walkTokens)).then((()=>S)):S)).then((S=>n(S,l))).then((S=>l.hooks?l.hooks.postprocess(S):S)).catch(x);try{l.hooks&&(i=l.hooks.preprocess(i));const S=t(i,l);l.walkTokens&&yt.walkTokens(S,l.walkTokens);let C=n(S,l);return l.hooks&&(C=l.hooks.postprocess(C)),C}catch(S){return x(S)}}}function yt(t,n,i){return Zr(Zi.lex,Ji.parse)(t,n,i)}yt.options=yt.setOptions=function(t){var n;return yt.defaults={...yt.defaults,...t},n=yt.defaults,Yi=n,yt},yt.getDefaults=is,yt.defaults=Yi,yt.use=function(...t){const n=yt.defaults.extensions||{renderers:{},childTokens:{}};t.forEach((i=>{const l={...i};if(l.async=yt.defaults.async||l.async||!1,i.extensions&&(i.extensions.forEach((p=>{if(!p.name)throw new Error("extension name required");if(p.renderer){const v=n.renderers[p.name];n.renderers[p.name]=v?function(...x){let S=p.renderer.apply(this,x);return S===!1&&(S=v.apply(this,x)),S}:p.renderer}if(p.tokenizer){if(!p.level||p.level!=="block"&&p.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");n[p.level]?n[p.level].unshift(p.tokenizer):n[p.level]=[p.tokenizer],p.start&&(p.level==="block"?n.startBlock?n.startBlock.push(p.start):n.startBlock=[p.start]:p.level==="inline"&&(n.startInline?n.startInline.push(p.start):n.startInline=[p.start]))}p.childTokens&&(n.childTokens[p.name]=p.childTokens)})),l.extensions=n),i.renderer){const p=yt.defaults.renderer||new rh;for(const v in i.renderer){const x=p[v];p[v]=(...S)=>{let C=i.renderer[v].apply(p,S);return C===!1&&(C=x.apply(p,S)),C}}l.renderer=p}if(i.tokenizer){const p=yt.defaults.tokenizer||new pl;for(const v in i.tokenizer){const x=p[v];p[v]=(...S)=>{let C=i.tokenizer[v].apply(p,S);return C===!1&&(C=x.apply(p,S)),C}}l.tokenizer=p}if(i.hooks){const p=yt.defaults.hooks||new fl;for(const v in i.hooks){const x=p[v];fl.passThroughHooks.has(v)?p[v]=S=>{if(yt.defaults.async)return Promise.resolve(i.hooks[v].call(p,S)).then((N=>x.call(p,N)));const C=i.hooks[v].call(p,S);return x.call(p,C)}:p[v]=(...S)=>{let C=i.hooks[v].apply(p,S);return C===!1&&(C=x.apply(p,S)),C}}l.hooks=p}if(i.walkTokens){const p=yt.defaults.walkTokens;l.walkTokens=function(v){let x=[];return x.push(i.walkTokens.call(this,v)),p&&(x=x.concat(p.call(this,v))),x}}yt.setOptions(l)}))},yt.walkTokens=function(t,n){let i=[];for(const l of t)switch(i=i.concat(n.call(yt,l)),l.type){case"table":for(const p of l.header)i=i.concat(yt.walkTokens(p.tokens,n));for(const p of l.rows)for(const v of p)i=i.concat(yt.walkTokens(v.tokens,n));break;case"list":i=i.concat(yt.walkTokens(l.items,n));break;default:yt.defaults.extensions&&yt.defaults.extensions.childTokens&&yt.defaults.extensions.childTokens[l.type]?yt.defaults.extensions.childTokens[l.type].forEach((function(p){i=i.concat(yt.walkTokens(l[p],n))})):l.tokens&&(i=i.concat(yt.walkTokens(l.tokens,n)))}return i},yt.parseInline=Zr(Zi.lexInline,Ji.parseInline),yt.Parser=Ji,yt.parser=Ji.parse,yt.Renderer=rh,yt.TextRenderer=mc,yt.Lexer=Zi,yt.lexer=Zi.lex,yt.Tokenizer=pl,yt.Slugger=gc,yt.Hooks=fl,yt.parse=yt,yt.options,yt.setOptions,yt.use,yt.walkTokens,yt.parseInline,Ji.parse,Zi.lex;var jw=g(848),sr=g.n(jw);g(113),g(83),g(378),g(976),g(514),g(22),g(342),g(784),g(651);const Ri=M` .hover-bg:hover { background: var(--bg3); } ::selection { background: var(--selection-bg); color: var(--selection-fg); } .regular-font { font-family:var(--font-regular); } .mono-font { font-family:var(--font-mono); } .title { font-size: calc(var(--font-size-small) + 18px); font-weight: normal } .sub-title{ font-size: 20px; } .req-res-title { font-family: var(--font-regular); font-size: calc(var(--font-size-small) + 4px); font-weight:bold; margin-bottom:8px; text-align:left; } .tiny-title { font-size:calc(var(--font-size-small) + 1px); font-weight:bold; } .regular-font-size { font-size: var(--font-size-regular); } .small-font-size { font-size: var(--font-size-small); } .upper { text-transform: uppercase; } .primary-text { color: var(--primary-color); } .bold-text { font-weight:bold; } .gray-text { color: var(--light-fg); } .red-text { color: var(--red) } .blue-text { color: var(--blue) } .multiline { overflow: scroll; max-height: var(--resp-area-height, 400px); color: var(--fg3); } .method-fg.put { color: var(--orange); } .method-fg.post { color: var(--green); } .method-fg.get { color: var(--blue); } .method-fg.delete { color: var(--red); } .method-fg.options, .method-fg.head, .method-fg.patch { color: var(--yellow); } h1 { font-family:var(--font-regular); font-size:28px; padding-top: 10px; letter-spacing:normal; font-weight:normal; } h2 { font-family:var(--font-regular); font-size:24px; padding-top: 10px; letter-spacing:normal; font-weight:normal; } h3 { font-family:var(--font-regular); font-size:18px; padding-top: 10px; letter-spacing:normal; font-weight:normal; } h4 { font-family:var(--font-regular); font-size:16px; padding-top: 10px; letter-spacing:normal; font-weight:normal; } h5 { font-family:var(--font-regular); font-size:14px; padding-top: 10px; letter-spacing:normal; font-weight:normal; } h6 { font-family:var(--font-regular); font-size:14px; padding-top: 10px; letter-spacing:normal; font-weight:normal; } h1,h2,h3,h4,h5,h5 { margin-block-end: 0.2em; } p { margin-block-start: 0.5em; } a { color: var(--blue); cursor:pointer; } a.inactive-link { color:var(--fg); text-decoration: none; cursor:text; } code, pre { margin: 0px; font-family: var(--font-mono); font-size: calc(var(--font-size-mono) - 1px); } .m-markdown, .m-markdown-small { display:block; } .m-markdown p, .m-markdown span { font-size: var(--font-size-regular); line-height:calc(var(--font-size-regular) + 8px); } .m-markdown li { font-size: var(--font-size-regular); line-height:calc(var(--font-size-regular) + 10px); } .m-markdown-small p, .m-markdown-small span, .m-markdown-small li { font-size: var(--font-size-small); line-height: calc(var(--font-size-small) + 6px); } .m-markdown-small li { line-height: calc(var(--font-size-small) + 8px); } .m-markdown p:not(:first-child) { margin-block-start: 24px; } .m-markdown-small p:not(:first-child) { margin-block-start: 12px; } .m-markdown-small p:first-child { margin-block-start: 0; } .m-markdown p, .m-markdown-small p { margin-block-end: 0 } .m-markdown code span { font-size:var(--font-size-mono); } .m-markdown-small code, .m-markdown code { padding: 1px 6px; border-radius: 2px; color: var(--inline-code-fg); background-color: var(--bg3); font-size: calc(var(--font-size-mono)); line-height: 1.2; } .m-markdown-small code { font-size: calc(var(--font-size-mono) - 1px); } .m-markdown-small pre, .m-markdown pre { white-space: pre-wrap; overflow-x: auto; line-height: normal; border-radius: 2px; border: 1px solid var(--code-border-color); } .m-markdown pre { padding: 12px; background-color: var(--code-bg); color:var(--code-fg); } .m-markdown-small pre { margin-top: 4px; padding: 2px 4px; background-color: var(--bg3); color: var(--fg2); } .m-markdown-small pre code, .m-markdown pre code { border:none; padding:0; } .m-markdown pre code { color: var(--code-fg); background-color: var(--code-bg); background-color: transparent; } .m-markdown-small pre code { color: var(--fg2); background-color: var(--bg3); } .m-markdown ul, .m-markdown ol { padding-inline-start: 30px; } .m-markdown-small ul, .m-markdown-small ol { padding-inline-start: 20px; } .m-markdown-small a, .m-markdown a { color:var(--blue); } .m-markdown-small img, .m-markdown img { max-width: 100%; } /* Markdown table */ .m-markdown-small table, .m-markdown table { border-spacing: 0; margin: 10px 0; border-collapse: separate; border: 1px solid var(--border-color); border-radius: var(--border-radius); font-size: calc(var(--font-size-small) + 1px); line-height: calc(var(--font-size-small) + 4px); max-width: 100%; } .m-markdown-small table { font-size: var(--font-size-small); line-height: calc(var(--font-size-small) + 2px); margin: 8px 0; } .m-markdown-small td, .m-markdown-small th, .m-markdown td, .m-markdown th { vertical-align: top; border-top: 1px solid var(--border-color); line-height: calc(var(--font-size-small) + 4px); } .m-markdown-small tr:first-child th, .m-markdown tr:first-child th { border-top: 0 none; } .m-markdown th, .m-markdown td { padding: 10px 12px; } .m-markdown-small th, .m-markdown-small td { padding: 8px 8px; } .m-markdown th, .m-markdown-small th { font-weight: 600; background-color: var(--bg2); vertical-align: middle; } .m-markdown-small table code { font-size: calc(var(--font-size-mono) - 2px); } .m-markdown table code { font-size: calc(var(--font-size-mono) - 1px); } .m-markdown blockquote, .m-markdown-small blockquote { margin-inline-start: 0; margin-inline-end: 0; border-left: 3px solid var(--border-color); padding: 6px 0 6px 6px; } .m-markdown hr{ border: 1px solid var(--border-color); } `,ju=M` /* Button */ .m-btn { border-radius: var(--border-radius); font-weight: 600; display: inline-block; padding: 6px 16px; font-size: var(--font-size-small); outline: 0; line-height: 1; text-align: center; white-space: nowrap; border: 2px solid var(--primary-color); background-color:transparent; user-select: none; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); transition-duration: 0.75s; } .m-btn.primary { background-color: var(--primary-color); color: var(--primary-color-invert); } .m-btn.thin-border { border-width: 1px; } .m-btn.large { padding:8px 14px; } .m-btn.small { padding:5px 12px; } .m-btn.tiny { padding:5px 6px; } .m-btn.circle { border-radius: 50%; } .m-btn:hover { background-color: var(--primary-color); color: var(--primary-color-invert); } .m-btn.nav { border: 2px solid var(--nav-accent-color); } .m-btn.nav:hover { background-color: var(--nav-accent-color); } .m-btn:disabled { background-color: var(--bg3); color: var(--fg3); border-color: var(--fg3); cursor: not-allowed; opacity: 0.4; } .m-btn:active { filter: brightness(75%); transform: scale(0.95); transition:scale 0s; } .toolbar-btn { cursor: pointer; padding: 4px; margin:0 2px; font-size: var(--font-size-small); min-width: 50px; color: var(--primary-color-invert); border-radius: 2px; border: none; background-color: var(--primary-color); } input, textarea, select, button, pre { color:var(--fg); outline: none; background-color: var(--input-bg); border: 1px solid var(--border-color); border-radius: var(--border-radius); } button { font-family: var(--font-regular); } /* Form Inputs */ pre, select, textarea, input[type="file"], input[type="text"], input[type="password"] { font-family: var(--font-mono); font-weight: 400; font-size: var(--font-size-small); transition: border .2s; padding: 6px 5px; } select { font-family: var(--font-regular); padding: 5px 30px 5px 5px; background-image: url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%2212%22%3E%3Cpath%20d%3D%22M10.3%203.3L6%207.6%201.7%203.3A1%201%200%2000.3%204.7l5%205a1%201%200%20001.4%200l5-5a1%201%200%2010-1.4-1.4z%22%20fill%3D%22%23777777%22%2F%3E%3C%2Fsvg%3E"); background-position: calc(100% - 5px) center; background-repeat: no-repeat; background-size: 10px; -webkit-appearance: none; -moz-appearance: none; appearance: none; cursor: pointer; } select:hover { border-color: var(--primary-color); } textarea::placeholder, input[type="text"]::placeholder, input[type="password"]::placeholder { color: var(--placeholder-color); opacity:1; } input[type="file"]{ font-family: var(--font-regular); padding:2px; cursor:pointer; border: 1px solid var(--primary-color); min-height: calc(var(--font-size-small) + 18px); } input[type="file"]::-webkit-file-upload-button { font-family: var(--font-regular); font-size: var(--font-size-small); outline: none; cursor:pointer; padding: 3px 8px; border: 1px solid var(--primary-color); background-color: var(--primary-color); color: var(--primary-color-invert); border-radius: var(--border-radius);; -webkit-appearance: none; } pre, textarea { scrollbar-width: thin; scrollbar-color: var(--border-color) var(--input-bg); } pre::-webkit-scrollbar, textarea::-webkit-scrollbar { width: 8px; height: 8px; } pre::-webkit-scrollbar-track, textarea::-webkit-scrollbar-track { background:var(--input-bg); } pre::-webkit-scrollbar-thumb, textarea::-webkit-scrollbar-thumb { border-radius: 2px; background-color: var(--border-color); } .link { font-size:var(--font-size-small); text-decoration: underline; color:var(--blue); font-family:var(--font-mono); margin-bottom:2px; } /* Toggle Body */ input[type="checkbox"] { appearance: none; display: inline-block; background-color: var(--light-bg); border: 1px solid var(--light-bg); border-radius: 9px; cursor: pointer; height: 18px; position: relative; transition: border .25s .15s, box-shadow .25s .3s, padding .25s; min-width: 36px; width: 36px; vertical-align: top; } /* Toggle Thumb */ input[type="checkbox"]:after { position: absolute; background-color: var(--bg); border: 1px solid var(--light-bg); border-radius: 8px; content: ''; top: 0px; left: 0px; right: 16px; display: block; height: 16px; transition: border .25s .15s, left .25s .1s, right .15s .175s; } /* Toggle Body - Checked */ input[type="checkbox"]:checked { background-color: var(--green); border-color: var(--green); } /* Toggle Thumb - Checked*/ input[type="checkbox"]:checked:after { border: 1px solid var(--green); left: 16px; right: 1px; transition: border .25s, left .15s .25s, right .25s .175s; }`,Cu=M` .row, .col { display:flex; } .row { align-items:center; flex-direction: row; } .col { align-items:stretch; flex-direction: column; } `,Au=M` .m-table { border-spacing: 0; border-collapse: separate; border: 1px solid var(--light-border-color); border-radius: var(--border-radius); margin: 0; max-width: 100%; direction: ltr; } .m-table tr:first-child td, .m-table tr:first-child th { border-top: 0 none; } .m-table td, .m-table th { font-size: var(--font-size-small); line-height: calc(var(--font-size-small) + 4px); padding: 4px 5px 4px; vertical-align: top; } .m-table.padded-12 td, .m-table.padded-12 th { padding: 12px; } .m-table td:not([align]), .m-table th:not([align]) { text-align: left; } .m-table th { color: var(--fg2); font-size: var(--font-size-small); line-height: calc(var(--font-size-small) + 18px); font-weight: 600; letter-spacing: normal; background-color: var(--bg2); vertical-align: bottom; border-bottom: 1px solid var(--light-border-color); } .m-table > tbody > tr > td, .m-table > tr > td { border-top: 1px solid var(--light-border-color); text-overflow: ellipsis; overflow: hidden; } .table-title { font-size:var(--font-size-small); font-weight:bold; vertical-align: middle; margin: 12px 0 4px 0; } `,Vg=M` :host { container-type: inline-size; } .only-large-screen { display:none; } .endpoint-head .path { display: flex; font-family:var(--font-mono); font-size: var(--font-size-small); align-items: center; overflow-wrap: break-word; word-break: break-all; } .endpoint-head .descr { font-size: var(--font-size-small); color:var(--light-fg); font-weight:400; align-items: center; overflow-wrap: break-word; word-break: break-all; display:none; } .m-endpoint.expanded { margin-bottom:16px; } .m-endpoint > .endpoint-head{ border-width:1px 1px 1px 5px; border-style:solid; border-color:transparent; border-top-color:var(--light-border-color); display:flex; padding:6px 16px; align-items: center; cursor: pointer; } .m-endpoint > .endpoint-head.put:hover, .m-endpoint > .endpoint-head.put.expanded { border-color:var(--orange); background-color:var(--light-orange); } .m-endpoint > .endpoint-head.post:hover, .m-endpoint > .endpoint-head.post.expanded { border-color:var(--green); background-color:var(--light-green); } .m-endpoint > .endpoint-head.get:hover, .m-endpoint > .endpoint-head.get.expanded { border-color:var(--blue); background-color:var(--light-blue); } .m-endpoint > .endpoint-head.delete:hover, .m-endpoint > .endpoint-head.delete.expanded { border-color:var(--red); background-color:var(--light-red); } .m-endpoint > .endpoint-head.head:hover, .m-endpoint > .endpoint-head.head.expanded, .m-endpoint > .endpoint-head.patch:hover, .m-endpoint > .endpoint-head.patch.expanded, .m-endpoint > .endpoint-head.options:hover, .m-endpoint > .endpoint-head.options.expanded { border-color:var(--yellow); background-color:var(--light-yellow); } .m-endpoint > .endpoint-head.deprecated:hover, .m-endpoint > .endpoint-head.deprecated.expanded { border-color:var(--border-color); filter:opacity(0.6); } .m-endpoint .endpoint-body { flex-wrap:wrap; padding:16px 0px 0 0px; border-width:0px 1px 1px 5px; border-style:solid; box-shadow: 0px 4px 3px -3px rgba(0, 0, 0, 0.15); } .m-endpoint .endpoint-body.delete{ border-color:var(--red); } .m-endpoint .endpoint-body.put{ border-color:var(--orange); } .m-endpoint .endpoint-body.post { border-color:var(--green); } .m-endpoint .endpoint-body.get { border-color:var(--blue); } .m-endpoint .endpoint-body.head, .m-endpoint .endpoint-body.patch, .m-endpoint .endpoint-body.options { border-color:var(--yellow); } .m-endpoint .endpoint-body.deprecated { border-color:var(--border-color); filter:opacity(0.6); } .endpoint-head .deprecated { color: var(--light-fg); filter:opacity(0.6); } .summary{ padding:8px 8px; } .summary .title { font-size:calc(var(--font-size-regular) + 2px); margin-bottom: 6px; word-break: break-all; } .endpoint-head .method { padding:2px 5px; vertical-align: middle; font-size:var(--font-size-small); height: calc(var(--font-size-small) + 16px); line-height: calc(var(--font-size-small) + 8px); width: 60px; border-radius: 2px; display:inline-block; text-align: center; font-weight: bold; text-transform:uppercase; margin-right:5px; } .endpoint-head .method.delete{ border: 2px solid var(--red);} .endpoint-head .method.put{ border: 2px solid var(--orange); } .endpoint-head .method.post{ border: 2px solid var(--green); } .endpoint-head .method.get{ border: 2px solid var(--blue); } .endpoint-head .method.get.deprecated{ border: 2px solid var(--border-color); } .endpoint-head .method.head, .endpoint-head .method.patch, .endpoint-head .method.options { border: 2px solid var(--yellow); } .req-resp-container { display: flex; margin-top:16px; align-items: stretch; flex-wrap: wrap; flex-direction: column; border-top:1px solid var(--light-border-color); } .view-mode-request, api-response.view-mode { flex:1; min-height:100px; padding:16px 8px; overflow:hidden; } .view-mode-request { border-width:0 0 1px 0; border-style:dashed; } .head .view-mode-request, .patch .view-mode-request, .options .view-mode-request { border-color:var(--yellow); } .put .view-mode-request { border-color:var(--orange); } .post .view-mode-request { border-color:var(--green); } .get .view-mode-request { border-color:var(--blue); } .delete .view-mode-request { border-color:var(--red); } @container (min-width: 1024px) { .only-large-screen { display:block; } .endpoint-head .path{ font-size: var(--font-size-regular); } .endpoint-head .descr{ display: flex; } .endpoint-head .m-markdown-small, .descr .m-markdown-small{ display:block; } .req-resp-container{ flex-direction: var(--layout, row); flex-wrap: nowrap; } api-response.view-mode { padding:16px; } .view-mode-request.row-layout { border-width:0 1px 0 0; padding:16px; } .summary{ padding:8px 16px; } } `,yc=M` code[class*="language-"], pre[class*="language-"] { text-align: left; white-space: pre; word-spacing: normal; word-break: normal; word-wrap: normal; line-height: 1.5; tab-size: 2; -webkit-hyphens: none; -moz-hyphens: none; -ms-hyphens: none; hyphens: none; } /* Code blocks */ pre[class*="language-"] { padding: 1em; margin: .5em 0; overflow: auto; } /* Inline code */ :not(pre) > code[class*="language-"] { white-space: normal; } .token.comment, .token.block-comment, .token.prolog, .token.doctype, .token.cdata { color: var(--light-fg) } .token.punctuation { color: var(--fg); } .token.tag, .token.attr-name, .token.namespace, .token.deleted { color:var(--pink); } .token.function-name { color: var(--blue); } .token.boolean, .token.number, .token.function { color: var(--red); } .token.property, .token.class-name, .token.constant, .token.symbol { color: var(--code-property-color); } .token.selector, .token.important, .token.atrule, .token.keyword, .token.builtin { color: var(--code-keyword-color); } .token.string, .token.char, .token.attr-value, .token.regex, .token.variable { color: var(--green); } .token.operator, .token.entity, .token.url { color: var(--code-operator-color); } .token.important, .token.bold { font-weight: bold; } .token.italic { font-style: italic; } .token.entity { cursor: help; } .token.inserted { color: green; } `,ml=M` .tab-panel { border: none; } .tab-buttons { height:30px; padding: 4px 4px 0 4px; border-bottom: 1px solid var(--light-border-color) ; align-items: stretch; overflow-y: hidden; overflow-x: auto; scrollbar-width: thin; } .tab-buttons::-webkit-scrollbar { height: 1px; background-color: var(--border-color); } .tab-btn { border: none; border-bottom: 3px solid transparent; color: var(--light-fg); background-color: transparent; white-space: nowrap; cursor:pointer; outline:none; font-family:var(--font-regular); font-size:var(--font-size-small); margin-right:16px; padding:1px; } .tab-btn.active { border-bottom: 3px solid var(--primary-color); font-weight:bold; color:var(--primary-color); } .tab-btn:hover { color:var(--primary-color); } .tab-content { margin:-1px 0 0 0; position:relative; min-height: 50px; } `,Ea=M` .nav-bar-info:focus-visible, .nav-bar-tag:focus-visible, .nav-bar-path:focus-visible { outline: 1px solid; box-shadow: none; outline-offset: -4px; } .nav-bar-expand-all:focus-visible, .nav-bar-collapse-all:focus-visible, .nav-bar-tag-icon:focus-visible { outline: 1px solid; box-shadow: none; outline-offset: 2px; } .nav-bar { width:0; height:100%; overflow: hidden; color:var(--nav-text-color); background-color: var(--nav-bg-color); background-blend-mode: multiply; line-height: calc(var(--font-size-small) + 4px); display:none; position:relative; flex-direction:column; flex-wrap:nowrap; word-break:break-word; } ::slotted([slot=nav-logo]) { padding:16px 16px 0 16px; } .nav-scroll { overflow-x: hidden; overflow-y: auto; overflow-y: overlay; scrollbar-width: thin; scrollbar-color: var(--nav-hover-bg-color) transparent; } .nav-bar-tag { display: flex; align-items: center; justify-content: space-between; flex-direction: row; } .nav-bar.read .nav-bar-tag-icon { display:none; } .nav-bar-paths-under-tag { overflow:hidden; transition: max-height .2s ease-out, visibility .3s; } .collapsed .nav-bar-paths-under-tag { visibility: hidden; } .nav-bar-expand-all { transform: rotate(90deg); cursor:pointer; margin-right:10px; } .nav-bar-collapse-all { transform: rotate(270deg); cursor:pointer; } .nav-bar-expand-all:hover, .nav-bar-collapse-all:hover { color: var(--primary-color); } .nav-bar-tag-icon { color: var(--nav-text-color); font-size: 20px; } .nav-bar-tag-icon:hover { color:var(--nav-hover-text-color); } .nav-bar.focused .nav-bar-tag-and-paths.collapsed .nav-bar-tag-icon::after { content: '⌵'; width:16px; height:16px; text-align: center; display: inline-block; transform: rotate(-90deg); transition: transform 0.2s ease-out 0s; } .nav-bar.focused .nav-bar-tag-and-paths.expanded .nav-bar-tag-icon::after { content: '⌵'; width:16px; height:16px; text-align: center; display: inline-block; transition: transform 0.2s ease-out 0s; } .nav-scroll::-webkit-scrollbar { width: var(--scroll-bar-width, 8px); } .nav-scroll::-webkit-scrollbar-track { background:transparent; } .nav-scroll::-webkit-scrollbar-thumb { background-color: var(--nav-hover-bg-color); } .nav-bar-tag { font-size: var(--font-size-regular); color: var(--nav-accent-color); border-left:4px solid transparent; font-weight:bold; padding: 15px 15px 15px 10px; text-transform: capitalize; } .nav-bar-components, .nav-bar-h1, .nav-bar-h2, .nav-bar-info, .nav-bar-tag, .nav-bar-path { display:flex; cursor: pointer; width: 100%; border: none; border-radius:4px; color: var(--nav-text-color); background: transparent; border-left:4px solid transparent; } .nav-bar-h1, .nav-bar-h2, .nav-bar-path { font-size: calc(var(--font-size-small) + 1px); padding: var(--nav-item-padding); } .nav-bar-path.small-font { font-size: var(--font-size-small); } .nav-bar-info { font-size: var(--font-size-regular); padding: 16px 10px; font-weight:bold; } .nav-bar-section { display: flex; flex-direction: row; justify-content: space-between; font-size: var(--font-size-small); color: var(--nav-text-color); padding: var(--nav-item-padding); font-weight:bold; } .nav-bar-section.operations { cursor:pointer; } .nav-bar-section.operations:hover { color:var(--nav-hover-text-color); background-color:var(--nav-hover-bg-color); } .nav-bar-section:first-child { display: none; } .nav-bar-h2 {margin-left:12px;} .nav-bar-h1.left-bar.active, .nav-bar-h2.left-bar.active, .nav-bar-info.left-bar.active, .nav-bar-tag.left-bar.active, .nav-bar-path.left-bar.active, .nav-bar-section.left-bar.operations.active { border-left:4px solid var(--nav-accent-color); color:var(--nav-hover-text-color); } .nav-bar-h1.colored-block.active, .nav-bar-h2.colored-block.active, .nav-bar-info.colored-block.active, .nav-bar-tag.colored-block.active, .nav-bar-path.colored-block.active, .nav-bar-section.colored-block.operations.active { background-color: var(--nav-accent-color); color: var(--nav-accent-text-color); border-radius: 0; } .nav-bar-h1:hover, .nav-bar-h2:hover, .nav-bar-info:hover, .nav-bar-tag:hover, .nav-bar-path:hover { color:var(--nav-hover-text-color); background-color:var(--nav-hover-bg-color); } `,ri=M` #api-info { font-size: calc(var(--font-size-regular) - 1px); margin-top: 8px; margin-left: -15px; } #api-info span:before { content: "|"; display: inline-block; opacity: 0.5; width: 15px; text-align: center; } #api-info span:first-child:before { content: ""; width: 0px; } `,vc=M` `,sh=/[\s#:?&={}]/g,mo="_rapidoc_api_key";function Ou(t){return new Promise((n=>setTimeout(n,t)))}function gl(t,n){const i=n.target,l=document.createElement("textarea");l.value=t,l.style.position="fixed",document.body.appendChild(l),l.focus(),l.select();try{document.execCommand("copy"),i.innerText="Copied",setTimeout((()=>{i.innerText="Copy"}),5e3)}catch(p){console.error("Unable to copy",p)}document.body.removeChild(l)}function ih(t,n,i=""){return`${n.method} ${n.path} ${n.summary||""} ${n.description||""} ${n.operationId||""} ${i}`.toLowerCase().includes(t.toLowerCase())}function si(t,n=new Set){return t&&Object.keys(t).forEach((i=>{var l;if(n.add(i),t[i].properties)si(t[i].properties,n);else if((l=t[i].items)!==null&&l!==void 0&&l.properties){var p;si((p=t[i].items)===null||p===void 0?void 0:p.properties,n)}})),n}function qp(t,n){if(t){const i=document.createElement("a");document.body.appendChild(i),i.style="display: none",i.href=t,i.download=n,i.click(),i.remove()}}function Hg(t){if(t){const n=document.createElement("a");document.body.appendChild(n),n.style="display: none",n.href=t,n.target="_blank",n.click(),n.remove()}}const Bp=Object.freeze({url:"/"}),{fetch:ku,Response:Cw,Headers:Aw,Request:Ru,FormData:uA,File:Ow,Blob:kw}=globalThis;function ah(t,n){return n||typeof navigator>"u"||(n=navigator),n&&n.product==="ReactNative"?!(!t||typeof t!="object"||typeof t.uri!="string"):typeof File<"u"&&t instanceof File||typeof Blob<"u"&&t instanceof Blob||!!ArrayBuffer.isView(t)||t!==null&&typeof t=="object"&&typeof t.pipe=="function"}function Rw(t,n){return Array.isArray(t)&&t.some((i=>ah(i,n)))}globalThis.fetch===void 0&&(globalThis.fetch=ku),globalThis.Headers===void 0&&(globalThis.Headers=Aw),globalThis.Request===void 0&&(globalThis.Request=Ru),globalThis.Response===void 0&&(globalThis.Response=Cw),globalThis.FormData===void 0&&(globalThis.FormData=uA),globalThis.File===void 0&&(globalThis.File=Ow),globalThis.Blob===void 0&&(globalThis.Blob=kw);class Gg extends File{constructor(n,i="",l={}){super([n],i,l),this.data=n}valueOf(){return this.data}toString(){return this.valueOf()}}function oh(t,n="reserved"){return[...t].map((i=>{if((p=>/^[a-z0-9\-._~]+$/i.test(p))(i)||(p=>":/?#[]@!$&'()*+,;=".indexOf(p)>-1)(i)&&n==="unsafe")return i;const l=new TextEncoder;return Array.from(l.encode(i)).map((p=>`0${p.toString(16).toUpperCase()}`.slice(-2))).map((p=>`%${p}`)).join("")})).join("")}function ja(t){const{value:n}=t;return Array.isArray(n)?(function({key:i,value:l,style:p,explode:v,escape:x}){if(p==="simple")return l.map((S=>os(S,x))).join(",");if(p==="label")return`.${l.map((S=>os(S,x))).join(".")}`;if(p==="matrix")return l.map((S=>os(S,x))).reduce(((S,C)=>!S||v?`${S||""};${i}=${C}`:`${S},${C}`),"");if(p==="form"){const S=v?`&${i}=`:",";return l.map((C=>os(C,x))).join(S)}if(p==="spaceDelimited"){const S=v?`${i}=`:"";return l.map((C=>os(C,x))).join(` ${S}`)}if(p==="pipeDelimited"){const S=v?`${i}=`:"";return l.map((C=>os(C,x))).join(`|${S}`)}})(t):typeof n=="object"?(function({key:i,value:l,style:p,explode:v,escape:x}){const S=Object.keys(l);return p==="simple"?S.reduce(((C,N)=>{const D=os(l[N],x);return`${C?`${C},`:""}${N}${v?"=":","}${D}`}),""):p==="label"?S.reduce(((C,N)=>{const D=os(l[N],x);return`${C?`${C}.`:"."}${N}${v?"=":"."}${D}`}),""):p==="matrix"&&v?S.reduce(((C,N)=>`${C?`${C};`:";"}${N}=${os(l[N],x)}`),""):p==="matrix"?S.reduce(((C,N)=>{const D=os(l[N],x);return`${C?`${C},`:`;${i}=`}${N},${D}`}),""):p==="form"?S.reduce(((C,N)=>{const D=os(l[N],x);return`${C?`${C}${v?"&":","}`:""}${N}${v?"=":","}${D}`}),""):void 0})(t):(function({key:i,value:l,style:p,escape:v}){return p==="simple"?os(l,v):p==="label"?`.${os(l,v)}`:p==="matrix"?`;${i}=${os(l,v)}`:p==="form"||p==="deepObject"?os(l,v):void 0})(t)}function os(t,n=!1){return Array.isArray(t)||t!==null&&typeof t=="object"?t=JSON.stringify(t):typeof t!="number"&&typeof t!="boolean"||(t=String(t)),n&&t.length>0?oh(t,n):t}const Xg={form:",",spaceDelimited:"%20",pipeDelimited:"|"},Tu={csv:",",ssv:"%20",tsv:"%09",pipes:"|"};function xc(t,n,i=!1){const{collectionFormat:l,allowEmptyValue:p,serializationOption:v,encoding:x}=n,S=typeof n!="object"||Array.isArray(n)?n:n.value,C=i?D=>D.toString():D=>encodeURIComponent(D),N=C(t);if(S===void 0&&p)return[[N,""]];if(ah(S)||Rw(S))return[[N,S]];if(v)return Yg(t,S,i,v);if(x){if([typeof x.style,typeof x.explode,typeof x.allowReserved].some((D=>D!=="undefined"))){const{style:D,explode:$,allowReserved:L}=x;return Yg(t,S,i,{style:D,explode:$,allowReserved:L})}if(typeof x.contentType=="string"){if(x.contentType.startsWith("application/json")){const $=C(typeof S=="string"?S:JSON.stringify(S));return[[N,new Gg($,"blob",{type:x.contentType})]]}const D=C(String(S));return[[N,new Gg(D,"blob",{type:x.contentType})]]}return typeof S!="object"?[[N,C(S)]]:Array.isArray(S)&&S.every((D=>typeof D!="object"))?[[N,S.map(C).join(",")]]:[[N,C(JSON.stringify(S))]]}return typeof S!="object"?[[N,C(S)]]:Array.isArray(S)?l==="multi"?[[N,S.map(C)]]:[[N,S.map(C).join(Tu[l||"csv"])]]:[[N,""]]}function Yg(t,n,i,l){const p=l.style||"form",v=l.explode===void 0?p==="form":l.explode,x=!i&&(l&&l.allowReserved?"unsafe":"reserved"),S=N=>os(N,x),C=i?N=>N:N=>S(N);return typeof n!="object"?[[C(t),S(n)]]:Array.isArray(n)?v?[[C(t),n.map(S)]]:[[C(t),n.map(S).join(Xg[p])]]:p==="deepObject"?Object.keys(n).map((N=>[C(`${t}[${N}]`),S(n[N])])):v?Object.keys(n).map((N=>[C(N),S(n[N])])):[[C(t),Object.keys(n).map((N=>[`${C(N)},${S(n[N])}`])).join(",")]]}function Up(t){return((n,{encode:i=!0}={})=>{const l=(x,S,C)=>(C==null?x.append(S,""):Array.isArray(C)?C.reduce(((N,D)=>l(x,S,D)),x):C instanceof Date?x.append(S,C.toISOString()):typeof C=="object"?Object.entries(C).reduce(((N,[D,$])=>l(x,`${S}[${D}]`,$)),x):x.append(S,C),x),p=Object.entries(n).reduce(((x,[S,C])=>l(x,S,C)),new URLSearchParams),v=String(p);return i?v:decodeURIComponent(v)})(Object.keys(t).reduce(((n,i)=>{for(const[l,p]of xc(i,t[i]))n[l]=p instanceof Gg?p.valueOf():p;return n}),{}),{encode:!1})}function Kp(t={}){const{url:n="",query:i,form:l}=t;if(l){const v=Object.keys(l).some((S=>{const{value:C}=l[S];return ah(C)||Rw(C)})),x=t.headers["content-type"]||t.headers["Content-Type"];if(v||/multipart\/form-data/i.test(x)){const S=(p=t.form,Object.entries(p).reduce(((C,[N,D])=>{for(const[$,L]of xc(N,D,!0))if(Array.isArray(L))for(const U of L)if(ArrayBuffer.isView(U)){const J=new Blob([U]);C.append($,J)}else C.append($,U);else if(ArrayBuffer.isView(L)){const U=new Blob([L]);C.append($,U)}else C.append($,L);return C}),new FormData));t.formdata=S,t.body=S}else t.body=Up(l);delete t.form}var p;if(i){const[v,x]=n.split("?");let S="";if(x){const N=new URLSearchParams(x);Object.keys(i).forEach((D=>N.delete(D))),S=String(N)}const C=((...N)=>{const D=N.filter(($=>$)).join("&");return D?`?${D}`:""})(S,Up(i));t.url=v+C,delete t.query}return t}function _u(t){return t==null}var ar={isNothing:_u,isObject:function(t){return typeof t=="object"&&t!==null},toArray:function(t){return Array.isArray(t)?t:_u(t)?[]:[t]},repeat:function(t,n){var i,l="";for(i=0;iS&&(n=l-S+(v=" ... ").length),i-l>S&&(i=l+S-(x=" ...").length),{str:v+t.slice(n,i).replace(/\t/g,"→")+x,pos:l-n+v.length}}function $u(t,n){return ar.repeat(" ",n-t.length)+t}var Tw=function(t,n){if(n=Object.create(n||null),!t.buffer)return null;n.maxLength||(n.maxLength=79),typeof n.indent!="number"&&(n.indent=1),typeof n.linesBefore!="number"&&(n.linesBefore=3),typeof n.linesAfter!="number"&&(n.linesAfter=2);for(var i,l=/\r?\n|\r|\0/g,p=[0],v=[],x=-1;i=l.exec(t.buffer);)v.push(i.index),p.push(i.index+i[0].length),t.position<=i.index&&x<0&&(x=p.length-2);x<0&&(x=p.length-1);var S,C,N="",D=Math.min(t.line+n.linesAfter,v.length).toString().length,$=n.maxLength-(n.indent+D+3);for(S=1;S<=n.linesBefore&&!(x-S<0);S++)C=lh(t.buffer,p[x-S],v[x-S],t.position-(p[x]-p[x-S]),$),N=ar.repeat(" ",n.indent)+$u((t.line-S+1).toString(),D)+" | "+C.str+` `+N;for(C=lh(t.buffer,p[x],v[x],t.position,$),N+=ar.repeat(" ",n.indent)+$u((t.line+1).toString(),D)+" | "+C.str+` `,N+=ar.repeat("-",n.indent+D+3+C.pos)+`^ `,S=1;S<=n.linesAfter&&!(x+S>=v.length);S++)C=lh(t.buffer,p[x+S],v[x+S],t.position-(p[x]-p[x+S]),$),N+=ar.repeat(" ",n.indent)+$u((t.line+S+1).toString(),D)+" | "+C.str+` `;return N.replace(/\n$/,"")},Hp=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Gp=["scalar","sequence","mapping"],ls=function(t,n){if(n=n||{},Object.keys(n).forEach((function(i){if(Hp.indexOf(i)===-1)throw new Rr('Unknown option "'+i+'" is met in definition of "'+t+'" YAML type.')})),this.options=n,this.tag=t,this.kind=n.kind||null,this.resolve=n.resolve||function(){return!0},this.construct=n.construct||function(i){return i},this.instanceOf=n.instanceOf||null,this.predicate=n.predicate||null,this.represent=n.represent||null,this.representName=n.representName||null,this.defaultStyle=n.defaultStyle||null,this.multi=n.multi||!1,this.styleAliases=(function(i){var l={};return i!==null&&Object.keys(i).forEach((function(p){i[p].forEach((function(v){l[String(v)]=p}))})),l})(n.styleAliases||null),Gp.indexOf(this.kind)===-1)throw new Rr('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')};function Ls(t,n){var i=[];return t[n].forEach((function(l){var p=i.length;i.forEach((function(v,x){v.tag===l.tag&&v.kind===l.kind&&v.multi===l.multi&&(p=x)})),i[p]=l})),i}function yo(t){return this.extend(t)}yo.prototype.extend=function(t){var n=[],i=[];if(t instanceof ls)i.push(t);else if(Array.isArray(t))i=i.concat(t);else{if(!t||!Array.isArray(t.implicit)&&!Array.isArray(t.explicit))throw new Rr("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");t.implicit&&(n=n.concat(t.implicit)),t.explicit&&(i=i.concat(t.explicit))}n.forEach((function(p){if(!(p instanceof ls))throw new Rr("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(p.loadKind&&p.loadKind!=="scalar")throw new Rr("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(p.multi)throw new Rr("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")})),i.forEach((function(p){if(!(p instanceof ls))throw new Rr("Specified list of YAML types (or a single Type object) contains a non-Type object.")}));var l=Object.create(yo.prototype);return l.implicit=(this.implicit||[]).concat(n),l.explicit=(this.explicit||[]).concat(i),l.compiledImplicit=Ls(l,"implicit"),l.compiledExplicit=Ls(l,"explicit"),l.compiledTypeMap=(function(){var p,v,x={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function S(C){C.multi?(x.multi[C.kind].push(C),x.multi.fallback.push(C)):x[C.kind][C.tag]=x.fallback[C.tag]=C}for(p=0,v=arguments.length;p=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},octal:function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},decimal:function(t){return t.toString(10)},hexadecimal:function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),hA=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),Zg=/^[-+]?[0-9]+e/,Dw=new ls("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(t){return t!==null&&!(!hA.test(t)||t[t.length-1]==="_")},construct:function(t){var n,i;return i=(n=t.replace(/_/g,"").toLowerCase())[0]==="-"?-1:1,"+-".indexOf(n[0])>=0&&(n=n.slice(1)),n===".inf"?i===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:n===".nan"?NaN:i*parseFloat(n,10)},predicate:function(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!=0||ar.isNegativeZero(t))},represent:function(t,n){var i;if(isNaN(t))switch(n){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(n){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(n){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(ar.isNegativeZero(t))return"-0.0";return i=t.toString(10),Zg.test(i)?i.replace("e",".e"):i},defaultStyle:"lowercase"}),Pw=Yp.extend({implicit:[Du,uh,Nw,Dw]}),Mw=Pw,Iw=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),zw=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$"),Jg=new ls("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(t){return t!==null&&(Iw.exec(t)!==null||zw.exec(t)!==null)},construct:function(t){var n,i,l,p,v,x,S,C,N=0,D=null;if((n=Iw.exec(t))===null&&(n=zw.exec(t)),n===null)throw new Error("Date resolve error");if(i=+n[1],l=+n[2]-1,p=+n[3],!n[4])return new Date(Date.UTC(i,l,p));if(v=+n[4],x=+n[5],S=+n[6],n[7]){for(N=n[7].slice(0,3);N.length<3;)N+="0";N=+N}return n[9]&&(D=6e4*(60*+n[10]+ +(n[11]||0)),n[9]==="-"&&(D=-D)),C=new Date(Date.UTC(i,l,p,v,x,S,N)),D&&C.setTime(C.getTime()-D),C},instanceOf:Date,represent:function(t){return t.toISOString()}}),Lw=new ls("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(t){return t==="<<"||t===null}}),Wg=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= \r`,Fw=new ls("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(t){if(t===null)return!1;var n,i,l=0,p=t.length,v=Wg;for(i=0;i64)){if(n<0)return!1;l+=6}return l%8==0},construct:function(t){var n,i,l=t.replace(/[\r\n=]/g,""),p=l.length,v=Wg,x=0,S=[];for(n=0;n>16&255),S.push(x>>8&255),S.push(255&x)),x=x<<6|v.indexOf(l.charAt(n));return(i=p%4*6)==0?(S.push(x>>16&255),S.push(x>>8&255),S.push(255&x)):i===18?(S.push(x>>10&255),S.push(x>>2&255)):i===12&&S.push(x>>4&255),new Uint8Array(S)},predicate:function(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"},represent:function(t){var n,i,l="",p=0,v=t.length,x=Wg;for(n=0;n>18&63],l+=x[p>>12&63],l+=x[p>>6&63],l+=x[63&p]),p=(p<<8)+t[n];return(i=v%3)==0?(l+=x[p>>18&63],l+=x[p>>12&63],l+=x[p>>6&63],l+=x[63&p]):i===2?(l+=x[p>>10&63],l+=x[p>>4&63],l+=x[p<<2&63],l+=x[64]):i===1&&(l+=x[p>>2&63],l+=x[p<<4&63],l+=x[64],l+=x[64]),l}}),pA=Object.prototype.hasOwnProperty,Qg=Object.prototype.toString,qw=new ls("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(t){if(t===null)return!0;var n,i,l,p,v,x=[],S=t;for(n=0,i=S.length;n>10),56320+(t-65536&1023))}for(var ny=new Array(256),wc=new Array(256),Pu=0;Pu<256;Pu++)ny[Pu]=ty(Pu)?1:0,wc[Pu]=ty(Pu);function vA(t,n){this.input=t,this.filename=n.filename||null,this.schema=n.schema||ey,this.onWarning=n.onWarning||null,this.legacy=n.legacy||!1,this.json=n.json||!1,this.listener=n.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function Zw(t,n){var i={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return i.snippet=Tw(i),new Rr(n,i)}function Vt(t,n){throw Zw(t,n)}function dh(t,n){t.onWarning&&t.onWarning.call(null,Zw(t,n))}var Mu={YAML:function(t,n,i){var l,p,v;t.version!==null&&Vt(t,"duplication of %YAML directive"),i.length!==1&&Vt(t,"YAML directive accepts exactly one argument"),(l=/^([0-9]+)\.([0-9]+)$/.exec(i[0]))===null&&Vt(t,"ill-formed argument of the YAML directive"),p=parseInt(l[1],10),v=parseInt(l[2],10),p!==1&&Vt(t,"unacceptable YAML version of the document"),t.version=i[0],t.checkLineBreaks=v<2,v!==1&&v!==2&&dh(t,"unsupported YAML version of the document")},TAG:function(t,n,i){var l,p;i.length!==2&&Vt(t,"TAG directive accepts exactly two arguments"),l=i[0],p=i[1],Vw.test(l)||Vt(t,"ill-formed tag handle (first argument) of the TAG directive"),yl.call(t.tagMap,l)&&Vt(t,'there is a previously declared suffix for "'+l+'" tag handle'),Hw.test(p)||Vt(t,"ill-formed tag prefix (second argument) of the TAG directive");try{p=decodeURIComponent(p)}catch{Vt(t,"tag prefix is malformed: "+p)}t.tagMap[l]=p}};function Qi(t,n,i,l){var p,v,x,S;if(n1&&(t.result+=ar.repeat(` `,n-1))}function ry(t,n){var i,l,p=t.tag,v=t.anchor,x=[],S=!1;if(t.firstTabInLine!==-1)return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=x),l=t.input.charCodeAt(t.position);l!==0&&(t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,Vt(t,"tab characters must not be used in indentation")),l===45)&&ii(t.input.charCodeAt(t.position+1));)if(S=!0,t.position++,Dr(t,!0,-1)&&t.lineIndent<=n)x.push(null),l=t.input.charCodeAt(t.position);else if(i=t.line,zu(t,n,3,!1,!0),x.push(t.result),Dr(t,!0,-1),l=t.input.charCodeAt(t.position),(t.line===i||t.lineIndent>n)&&l!==0)Vt(t,"bad indentation of a sequence entry");else if(t.lineIndentn?J=1:t.lineIndent===n?J=0:t.lineIndentn?J=1:t.lineIndent===n?J=0:t.lineIndentre)&&(_t&&(_e=P.line,ke=P.lineStart,Be=P.position),zu(P,re,4,!0,xe)&&(_t?Kt=P.result:Tn=P.result),_t||(vo(P,Le,tt,ut,Kt,Tn,_e,ke,Be),ut=Kt=Tn=null),Dr(P,!0,-1),Ee=P.input.charCodeAt(P.position)),(P.line===pe||P.lineIndent>re)&&Ee!==0)Vt(P,"bad indentation of a mapping entry");else if(P.lineIndent=0))break;xe===0?Vt(P,"bad explicit indentation width of a block scalar; it cannot be less than one"):Ee?Vt(P,"repeat of an indentation width identifier"):(ye=re+xe-1,Ee=!0)}if(Ca(pe)){do pe=P.input.charCodeAt(++P.position);while(Ca(pe));if(pe===35)do pe=P.input.charCodeAt(++P.position);while(!Wi(pe)&&pe!==0)}for(;pe!==0;){for(Zp(P),P.lineIndent=0,pe=P.input.charCodeAt(P.position);(!Ee||P.lineIndentye&&(ye=P.lineIndent),Wi(pe))ze++;else{if(P.lineIndent0){for(xe=_e,pe=0;xe>0;xe--)(_e=Xw(ke=P.input.charCodeAt(++P.position)))>=0?pe=(pe<<4)+_e:Vt(P,"expected hexadecimal character");P.result+=Yw(pe),P.position++}else Vt(P,"unknown escape sequence");le=he=P.position}else Wi(ke)?(Qi(P,le,he,!0),hh(P,Dr(P,!1,re)),le=he=P.position):P.position===P.lineStart&&Iu(P)?Vt(P,"unexpected end of the document within a double quoted scalar"):(P.position++,he=P.position)}Vt(P,"unexpected end of the stream within a double quoted scalar")})(t,L)?Z=!0:(function(P){var re,le,he;if((he=P.input.charCodeAt(P.position))!==42)return!1;for(he=P.input.charCodeAt(++P.position),re=P.position;he!==0&&!ii(he)&&!bc(he);)he=P.input.charCodeAt(++P.position);return P.position===re&&Vt(P,"name of an alias node must contain at least one character"),le=P.input.slice(re,P.position),yl.call(P.anchorMap,le)||Vt(P,'unidentified alias "'+le+'"'),P.result=P.anchorMap[le],Dr(P,!0,-1),!0})(t)?(Z=!0,t.tag===null&&t.anchor===null||Vt(t,"alias node should not have any properties")):(function(P,re,le){var he,xe,pe,_e,ke,Be,Ee,ye,ze=P.kind,Le=P.result;if(ii(ye=P.input.charCodeAt(P.position))||bc(ye)||ye===35||ye===38||ye===42||ye===33||ye===124||ye===62||ye===39||ye===34||ye===37||ye===64||ye===96||(ye===63||ye===45)&&(ii(he=P.input.charCodeAt(P.position+1))||le&&bc(he)))return!1;for(P.kind="scalar",P.result="",xe=pe=P.position,_e=!1;ye!==0;){if(ye===58){if(ii(he=P.input.charCodeAt(P.position+1))||le&&bc(he))break}else if(ye===35){if(ii(P.input.charCodeAt(P.position-1)))break}else{if(P.position===P.lineStart&&Iu(P)||le&&bc(ye))break;if(Wi(ye)){if(ke=P.line,Be=P.lineStart,Ee=P.lineIndent,Dr(P,!1,-1),P.lineIndent>=re){_e=!0,ye=P.input.charCodeAt(P.position);continue}P.position=pe,P.line=ke,P.lineStart=Be,P.lineIndent=Ee;break}}_e&&(Qi(P,xe,pe,!1),hh(P,P.line-ke),xe=pe=P.position,_e=!1),Ca(ye)||(pe=P.position+1),ye=P.input.charCodeAt(++P.position)}return Qi(P,xe,pe,!1),!!P.result||(P.kind=ze,P.result=Le,!1)})(t,L,i===1)&&(Z=!0,t.tag===null&&(t.tag="?")),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):J===0&&(Z=S&&ry(t,U))),t.tag===null)t.anchor!==null&&(t.anchorMap[t.anchor]=t.result);else if(t.tag==="?"){for(t.result!==null&&t.kind!=="scalar"&&Vt(t,'unacceptable node kind for ! tag; it should be "scalar", not "'+t.kind+'"'),C=0,N=t.implicitTypes.length;C"),t.result!==null&&$.kind!==t.kind&&Vt(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+$.kind+'", not "'+t.kind+'"'),$.resolve(t.result,t.tag)?(t.result=$.construct(t.result,t.tag),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):Vt(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return t.listener!==null&&t.listener("close",t),t.tag!==null||t.anchor!==null||Z}function xA(t){var n,i,l,p,v=t.position,x=!1;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);(p=t.input.charCodeAt(t.position))!==0&&(Dr(t,!0,-1),p=t.input.charCodeAt(t.position),!(t.lineIndent>0||p!==37));){for(x=!0,p=t.input.charCodeAt(++t.position),n=t.position;p!==0&&!ii(p);)p=t.input.charCodeAt(++t.position);for(l=[],(i=t.input.slice(n,t.position)).length<1&&Vt(t,"directive name must not be less than one character in length");p!==0;){for(;Ca(p);)p=t.input.charCodeAt(++t.position);if(p===35){do p=t.input.charCodeAt(++t.position);while(p!==0&&!Wi(p));break}if(Wi(p))break;for(n=t.position;p!==0&&!ii(p);)p=t.input.charCodeAt(++t.position);l.push(t.input.slice(n,t.position))}p!==0&&Zp(t),yl.call(Mu,i)?Mu[i](t,i,l):dh(t,'unknown document directive "'+i+'"')}Dr(t,!0,-1),t.lineIndent===0&&t.input.charCodeAt(t.position)===45&&t.input.charCodeAt(t.position+1)===45&&t.input.charCodeAt(t.position+2)===45?(t.position+=3,Dr(t,!0,-1)):x&&Vt(t,"directives end mark is expected"),zu(t,t.lineIndent-1,4,!1,!0),Dr(t,!0,-1),t.checkLineBreaks&&gA.test(t.input.slice(v,t.position))&&dh(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&Iu(t)?t.input.charCodeAt(t.position)===46&&(t.position+=3,Dr(t,!0,-1)):t.position=55296&&l<=56319&&n+1=56320&&i<=57343?1024*(l-55296)+i-56320+65536:l}function Sc(t){return/^\n* /.test(t)}function ay(t,n,i,l,p){t.dump=(function(){if(n.length===0)return t.quotingType===2?'""':"''";if(!t.noCompatMode&&(n0.indexOf(n)!==-1||r0.test(n)))return t.quotingType===2?'"'+n+'"':"'"+n+"'";var v=t.indent*Math.max(1,i),x=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-v),S=l||t.flowLevel>-1&&i>=t.flowLevel;switch((function(C,N,D,$,L,U,J,Y){var Z,P,re=0,le=null,he=!1,xe=!1,pe=$!==-1,_e=-1,ke=xo(P=Aa(C,0))&&P!==65279&&!Fu(P)&&P!==45&&P!==63&&P!==58&&P!==44&&P!==91&&P!==93&&P!==123&&P!==125&&P!==35&&P!==38&&P!==42&&P!==33&&P!==124&&P!==61&&P!==62&&P!==39&&P!==34&&P!==37&&P!==64&&P!==96&&(function(Be){return!Fu(Be)&&Be!==58})(Aa(C,C.length-1));if(N||J)for(Z=0;Z=65536?Z+=2:Z++){if(!xo(re=Aa(C,Z)))return 5;ke=ke&&iy(re,le,Y),le=re}else{for(Z=0;Z=65536?Z+=2:Z++){if((re=Aa(C,Z))===10)he=!0,pe&&(xe=xe||Z-_e-1>$&&C[_e+1]!==" ",_e=Z);else if(!xo(re))return 5;ke=ke&&iy(re,le,Y),le=re}xe=xe||pe&&Z-_e-1>$&&C[_e+1]!==" "}return he||xe?D>9&&Sc(C)?5:J?U===2?5:2:xe?4:3:!ke||J||L(C)?U===2?5:2:1})(n,S,t.indent,x,(function(C){return(function(N,D){var $,L;for($=0,L=N.implicitTypes.length;$"+oy(n,t.indent)+xl(i0((function(C,N){for(var D,$,L,U=/(\n+)([^\n]*)/g,J=(L=(L=C.indexOf(` `))!==-1?L:C.length,U.lastIndex=L,ly(C.slice(0,L),N)),Y=C[0]===` `||C[0]===" ";$=U.exec(C);){var Z=$[1],P=$[2];D=P[0]===" ",J+=Z+(Y||D||P===""?"":` `)+ly(P,N),Y=D}return J})(n,x),v));case 5:return'"'+(function(C){for(var N,D="",$=0,L=0;L=65536?L+=2:L++)$=Aa(C,L),!(N=t0[$])&&xo($)?(D+=C[L],$>=65536&&(D+=C[L+1])):D+=N||s0($);return D})(n)+'"';default:throw new Rr("impossible error: invalid scalar style")}})()}function oy(t,n){var i=Sc(t)?String(n):"",l=t[t.length-1]===` `;return i+(!l||t[t.length-2]!==` `&&t!==` `?l?"":"-":"+")+` `}function xl(t){return t[t.length-1]===` `?t.slice(0,-1):t}function ly(t,n){if(t===""||t[0]===" ")return t;for(var i,l,p=/ [^ ]/g,v=0,x=0,S=0,C="";i=p.exec(t);)(S=i.index)-v>n&&(l=x>v?x:S,C+=` `+t.slice(v,l),v=l+1),x=S;return C+=` `,t.length-v>n&&x>v?C+=t.slice(v,x)+` `+t.slice(x+1):C+=t.slice(v),C.slice(1)}function cy(t,n,i,l){var p,v,x,S="",C=t.tag;for(p=0,v=i.length;p tag resolver accepts not "'+C+'" style');l=S.represent[C](n,C)}t.dump=l}return!0}return!1}function bo(t,n,i,l,p,v,x){t.tag=null,t.dump=i,uy(t,i,!1)||uy(t,i,!0);var S,C=ai.call(t.dump),N=l;l&&(l=t.flowLevel<0||t.flowLevel>n);var D,$,L=C==="[object Object]"||C==="[object Array]";if(L&&($=(D=t.duplicates.indexOf(i))!==-1),(t.tag!==null&&t.tag!=="?"||$||t.indent!==2&&n>0)&&(p=!1),$&&t.usedDuplicates[D])t.dump="*ref_"+D;else{if(L&&$&&!t.usedDuplicates[D]&&(t.usedDuplicates[D]=!0),C==="[object Object]")l&&Object.keys(t.dump).length!==0?((function(U,J,Y,Z){var P,re,le,he,xe,pe,_e="",ke=U.tag,Be=Object.keys(Y);if(U.sortKeys===!0)Be.sort();else if(typeof U.sortKeys=="function")Be.sort(U.sortKeys);else if(U.sortKeys)throw new Rr("sortKeys must be a boolean or a function");for(P=0,re=Be.length;P1024)&&(U.dump&&U.dump.charCodeAt(0)===10?pe+="?":pe+="? "),pe+=U.dump,xe&&(pe+=vl(U,J)),bo(U,J+1,he,!0,xe)&&(U.dump&&U.dump.charCodeAt(0)===10?pe+=":":pe+=": ",_e+=pe+=U.dump));U.tag=ke,U.dump=_e||"{}"})(t,n,t.dump,p),$&&(t.dump="&ref_"+D+t.dump)):((function(U,J,Y){var Z,P,re,le,he,xe="",pe=U.tag,_e=Object.keys(Y);for(Z=0,P=_e.length;Z1024&&(he+="? "),he+=U.dump+(U.condenseFlow?'"':"")+":"+(U.condenseFlow?"":" "),bo(U,J,le,!1,!1)&&(xe+=he+=U.dump));U.tag=pe,U.dump="{"+xe+"}"})(t,n,t.dump),$&&(t.dump="&ref_"+D+" "+t.dump));else if(C==="[object Array]")l&&t.dump.length!==0?(t.noArrayIndent&&!x&&n>0?cy(t,n-1,t.dump,p):cy(t,n,t.dump,p),$&&(t.dump="&ref_"+D+t.dump)):((function(U,J,Y){var Z,P,re,le="",he=U.tag;for(Z=0,P=Y.length;Z",t.dump=S+" "+t.dump)}return!0}function SA(t,n){var i,l,p=[],v=[];for(dy(t,p,v),i=0,l=v.length;i(n[i]=(function(p){return p.includes(", ")?p.split(", "):p})(l),n)),{})}function nf(t,n,{loadSpec:i=!1}={}){const l={ok:t.ok,url:t.url||n,status:t.status,statusText:t.statusText,headers:oi(t.headers)},p=l.headers["content-type"],v=i||((x="")=>/(json|xml|yaml|text)\b/.test(x))(p);return(v?t.text:t.blob||t.buffer).call(t).then((x=>{if(l.text=x,l.data=x,v)try{const S=(function(C,N){return N&&(N.indexOf("application/json")===0||N.indexOf("+json")>0)?JSON.parse(C):Uu.load(C)})(x,p);l.body=S,l.obj=S}catch(S){l.parseError=S}return l}))}async function li(t,n={}){typeof t=="object"&&(t=(n=t).url),n.headers=n.headers||{},(n=Kp(n)).headers&&Object.keys(n.headers).forEach((p=>{const v=n.headers[p];typeof v=="string"&&(n.headers[p]=v.replace(/\n+/g," "))})),n.requestInterceptor&&(n=await n.requestInterceptor(n)||n);const i=n.headers["content-type"]||n.headers["Content-Type"];let l;/multipart\/form-data/i.test(i)&&(delete n.headers["content-type"],delete n.headers["Content-Type"]);try{l=await(n.userFetch||fetch)(n.url,n),l=await nf(l,t,n),n.responseInterceptor&&(l=await n.responseInterceptor(l)||l)}catch(p){if(!l)throw p;const v=new Error(l.statusText||`response status is ${l.status}`);throw v.status=l.status,v.statusCode=l.status,v.responseError=p,v}if(!l.ok){const p=new Error(l.statusText||`response status is ${l.status}`);throw p.status=l.status,p.statusCode=l.status,p.response=l,p}return l}function my(t,n={}){const{requestInterceptor:i,responseInterceptor:l}=n,p=t.withCredentials?"include":"same-origin";return v=>t({url:v,loadSpec:!0,requestInterceptor:i,responseInterceptor:l,headers:{Accept:"application/json, application/yaml"},credentials:p}).then((x=>x.body))}const Ku=t=>{var n,i;const{baseDoc:l,url:p}=t,v=(n=l??p)!==null&&n!==void 0?n:"";return typeof((i=globalThis.document)===null||i===void 0?void 0:i.baseURI)=="string"?String(new URL(v,globalThis.document.baseURI)):v},bl=t=>{const{fetch:n,http:i}=t;return n||i||li};var Vu,l0=(Vu=function(t,n){return Vu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,l){i.__proto__=l}||function(i,l){for(var p in l)l.hasOwnProperty(p)&&(i[p]=l[p])},Vu(t,n)},function(t,n){function i(){this.constructor=t}Vu(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}),gy=Object.prototype.hasOwnProperty;function rf(t,n){return gy.call(t,n)}function ci(t){if(Array.isArray(t)){for(var n=new Array(t.length),i=0;i=48&&n<=57))return!1;i++}return!0}function Ba(t){return t.indexOf("/")===-1&&t.indexOf("~")===-1?t:t.replace(/~/g,"~0").replace(/\//g,"~1")}function Hu(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}function ui(t){if(t===void 0)return!0;if(t){if(Array.isArray(t)){for(var n=0,i=t.length;n0&&S[N-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(i&&$===void 0&&(C[L]===void 0?$=S.slice(0,N).join("/"):N==D-1&&($=n.path),$!==void 0&&U(n,0,t,$)),N++,Array.isArray(C)){if(L==="-")L=C.length;else{if(i&&!wl(L))throw new Kn("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",v,n,t);wl(L)&&(L=~~L)}if(N>=D){if(i&&n.op==="add"&&L>C.length)throw new Kn("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",v,n,t);if((x=c0[n.op].call(n,C,L,t)).test===!1)throw new Kn("Test operation failed","TEST_OPERATION_FAILED",v,n,t);return x}}else if(N>=D){if((x=di[n.op].call(n,C,L,t)).test===!1)throw new Kn("Test operation failed","TEST_OPERATION_FAILED",v,n,t);return x}if(C=C[L],i&&N0)throw new Kn('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",n,t,i);if((t.op==="move"||t.op==="copy")&&typeof t.from!="string")throw new Kn("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",n,t,i);if((t.op==="add"||t.op==="replace"||t.op==="test")&&t.value===void 0)throw new Kn("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",n,t,i);if((t.op==="add"||t.op==="replace"||t.op==="test")&&ui(t.value))throw new Kn("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",n,t,i);if(i){if(t.op=="add"){var p=t.path.split("/").length,v=l.split("/").length;if(p!==v+1&&p!==v)throw new Kn("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",n,t,i)}else if(t.op==="replace"||t.op==="remove"||t.op==="_get"){if(t.path!==l)throw new Kn("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",n,t,i)}else if(t.op==="move"||t.op==="copy"){var x=gr([{op:"_get",path:t.from,value:void 0}],i);if(x&&x.name==="OPERATION_PATH_UNRESOLVABLE")throw new Kn("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",n,t,i)}}}function gr(t,n,i){try{if(!Array.isArray(t))throw new Kn("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(n)Eo(cs(n),cs(t),i||!0);else{i=i||qr;for(var l=0;l0&&(t.patches=[],t.callback&&t.callback(l)),l}function af(t,n,i,l,p){if(n!==t){typeof n.toJSON=="function"&&(n=n.toJSON());for(var v=ci(n),x=ci(t),S=!1,C=x.length-1;C>=0;C--){var N=t[$=x[C]];if(!rf(n,$)||n[$]===void 0&&N!==void 0&&Array.isArray(n)===!1)Array.isArray(t)===Array.isArray(n)?(p&&i.push({op:"test",path:l+"/"+Ba($),value:cs(N)}),i.push({op:"remove",path:l+"/"+Ba($)}),S=!0):(p&&i.push({op:"test",path:l,value:t}),i.push({op:"replace",path:l,value:n}));else{var D=n[$];typeof N=="object"&&N!=null&&typeof D=="object"&&D!=null&&Array.isArray(N)===Array.isArray(D)?af(N,D,i,l+"/"+Ba($),p):N!==D&&(p&&i.push({op:"test",path:l+"/"+Ba($),value:cs(N)}),i.push({op:"replace",path:l+"/"+Ba($),value:cs(D)}))}}if(S||v.length!=x.length)for(C=0;Cl!==void 0&&i?i[l]:i),t)},applyPatch:function(t,n,i){if(i=i||{},(n={...n,path:n.path&&kc(n.path)}).op==="merge"){const l=Al(t,n.path);Object.assign(l,n.value),Eo(t,[Rc(n.path,l)])}else if(n.op==="mergeDeep"){const l=Al(t,n.path),p=xy(l,n.value);t=Eo(t,[Rc(n.path,p)]).newDocument}else if(n.op==="add"&&n.path===""&&Tc(n.value)){const l=Object.keys(n.value).reduce(((p,v)=>(p.push({op:"add",path:`/${kc(v)}`,value:n.value[v]}),p)),[]);Eo(t,l)}else if(n.op==="replace"&&n.path===""){let{value:l}=n;i.allowMetaPatches&&n.meta&&Cl(n)&&(Array.isArray(n.value)||Tc(n.value))&&(l={...l,...n.meta}),t=l}else if(Eo(t,[n]),i.allowMetaPatches&&n.meta&&Cl(n)&&(Array.isArray(n.value)||Tc(n.value))){const l={...Al(t,n.path),...n.meta};Eo(t,[Rc(n.path,l)])}return t},parentPathMatch:function(t,n){if(!Array.isArray(n))return!1;for(let i=0,l=n.length;i(n+"").replace(/~/g,"~0").replace(/\//g,"~1"))).join("/")}`:t}function Rc(t,n,i){return{op:"replace",path:t,value:n,meta:i}}function jl(t,n,i){return u0(fh(t.filter(Cl).map((l=>n(l.value,i,l.path)))||[]))}function Jr(t,n,i){return i=i||[],Array.isArray(t)?t.map(((l,p)=>Jr(l,n,i.concat(p)))):Tc(t)?Object.keys(t).map((l=>Jr(t[l],n,i.concat(l)))):n(t,i[i.length-1],i)}function Xu(t,n,i){let l=[];if((i=i||[]).length>0){const p=n(t,i[i.length-1],i);p&&(l=l.concat(p))}if(Array.isArray(t)){const p=t.map(((v,x)=>Xu(v,n,i.concat(x))));p&&(l=l.concat(p))}else if(Tc(t)){const p=Object.keys(t).map((v=>Xu(t[v],n,i.concat(v))));p&&(l=l.concat(p))}return l=fh(l),l}function by(t){return Array.isArray(t)?t:[t]}function fh(t){return[].concat(...t.map((n=>Array.isArray(n)?fh(n):n)))}function u0(t){return t.filter((n=>n!==void 0))}function Tc(t){return t&&typeof t=="object"}function Pr(t){return t&&typeof t=="function"}function of(t){if(Zu(t)){const{op:n}=t;return n==="add"||n==="remove"||n==="replace"}return!1}function Yu(t){return of(t)||Zu(t)&&t.type==="mutation"}function Cl(t){return Yu(t)&&(t.op==="add"||t.op==="replace"||t.op==="merge"||t.op==="mergeDeep")}function Zu(t){return t&&typeof t=="object"}function Al(t,n){try{return Cc(t,n)}catch(i){return console.error(i),{}}}var Ha=function(t){return t&&t.Math===Math&&t},_i=Ha(typeof globalThis=="object"&&globalThis)||Ha(typeof window=="object"&&window)||Ha(typeof self=="object"&&self)||Ha(typeof Hm=="object"&&Hm)||Ha(!1)||(function(){return this})()||Function("return this")(),ta=function(t){try{return!!t()}catch{return!0}},lf=!ta((function(){var t=(function(){}).bind();return typeof t!="function"||t.hasOwnProperty("prototype")})),d0=lf,Ol=Function.prototype,cf=Ol.apply,mh=Ol.call,uf=typeof Reflect=="object"&&Reflect.apply||(d0?mh.bind(cf):function(){return mh.apply(cf,arguments)}),_c=lf,df=Function.prototype,Ju=df.call,hf=_c&&df.bind.bind(Ju,Ju),na=_c?hf:function(t){return function(){return Ju.apply(t,arguments)}},wy=na,$c=wy({}.toString),Nc=wy("".slice),pf=function(t){return Nc($c(t),8,-1)},h0=pf,Wu=na,Dc=function(t){if(h0(t)==="Function")return Wu(t)},Qu=typeof document=="object"&&document.all,Ts=Qu===void 0&&Qu!==void 0?function(t){return typeof t=="function"||t===Qu}:function(t){return typeof t=="function"},ed={},Co=!ta((function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})),Pc=lf,gh=Function.prototype.call,fi=Pc?gh.bind(gh):function(){return gh.apply(gh,arguments)},ff={},mf={}.propertyIsEnumerable,Ao=Object.getOwnPropertyDescriptor,kl=Ao&&!mf.call({1:2},1);ff.f=kl?function(t){var n=Ao(this,t);return!!n&&n.enumerable}:mf;var ra,td,Mc=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}},yh=ta,vh=pf,gf=Object,p0=na("".split),nd=yh((function(){return!gf("z").propertyIsEnumerable(0)}))?function(t){return vh(t)==="String"?p0(t,""):gf(t)}:gf,rd=function(t){return t==null},f0=rd,Sy=TypeError,sd=function(t){if(f0(t))throw new Sy("Can't call method on "+t);return t},$i=nd,sa=sd,ia=function(t){return $i(sa(t))},Ey=Ts,ka=function(t){return typeof t=="object"?t!==null:Ey(t)},Ga={},Fs=Ga,jr=_i,yf=Ts,Xa=function(t){return yf(t)?t:void 0},rn=function(t,n){return arguments.length<2?Xa(Fs[t])||Xa(jr[t]):Fs[t]&&Fs[t][n]||jr[t]&&jr[t][n]},Vn=na({}.isPrototypeOf),Mr=_i.navigator,xh=Mr&&Mr.userAgent,Ic=_i,Oo=xh?String(xh):"",bh=Ic.process,id=Ic.Deno,zc=bh&&bh.versions||id&&id.version,m0=zc&&zc.v8;m0&&(td=(ra=m0.split("."))[0]>0&&ra[0]<4?1:+(ra[0]+ra[1])),!td&&Oo&&(!(ra=Oo.match(/Edge\/(\d+)/))||ra[1]>=74)&&(ra=Oo.match(/Chrome\/(\d+)/))&&(td=+ra[1]);var Cr=td,jy=ta,Cy=_i.String,Ay=!!Object.getOwnPropertySymbols&&!jy((function(){var t=Symbol("symbol detection");return!Cy(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&Cr&&Cr<41})),Oy=Ay&&!Symbol.sham&&typeof Symbol.iterator=="symbol",EA=rn,ky=Ts,Ry=Vn,Ty=Object,_s=Oy?function(t){return typeof t=="symbol"}:function(t){var n=EA("Symbol");return ky(n)&&Ry(n.prototype,Ty(t))},Ir=String,ad=function(t){try{return Ir(t)}catch{return"Object"}},wh=Ts,vf=ad,_y=TypeError,aa=function(t){if(wh(t))return t;throw new _y(vf(t)+" is not a function")},xf=aa,$y=rd,Sh=function(t,n){var i=t[n];return $y(i)?void 0:xf(i)},Ny=fi,Dy=Ts,Py=ka,g0=TypeError,My={exports:{}},Iy=_i,zy=Object.defineProperty,y0=_i,v0=My.exports=y0.o||(function(t,n){try{zy(Iy,t,{value:n,configurable:!0,writable:!0})}catch{Iy[t]=n}return n})("__core-js_shared__",{});(v0.versions||(v0.versions=[])).push({version:"3.38.1",mode:"pure",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.38.1/LICENSE",source:"https://github.com/zloirock/core-js"});var Ly=My.exports,Fy=Ly,qy=function(t,n){return Fy[t]||(Fy[t]=n||{})},By=sd,x0=Object,Uy=function(t){return x0(By(t))},b0=Uy,w0=na({}.hasOwnProperty),Ya=Object.hasOwn||function(t,n){return w0(b0(t),n)},jA=na,S0=0,od=Math.random(),E0=jA(1 .toString),Eh=function(t){return"Symbol("+(t===void 0?"":t)+")_"+E0(++S0+od,36)},bf=qy,Ky=Ya,Vy=Eh,CA=Ay,j0=Oy,Lc=_i.Symbol,wf=bf("wks"),C0=j0?Lc.for||Lc:Lc&&Lc.withoutSetter||Vy,Za=function(t){return Ky(wf,t)||(wf[t]=CA&&Ky(Lc,t)?Lc[t]:C0("Symbol."+t)),wf[t]},Hy=fi,Gy=ka,Xy=_s,Yy=Sh,A0=TypeError,O0=Za("toPrimitive"),AA=function(t,n){if(!Gy(t)||Xy(t))return t;var i,l=Yy(t,O0);if(l){if(i=Hy(l,t,n),!Gy(i)||Xy(i))return i;throw new A0("Can't convert object to primitive value")}return(function(p,v){var x,S;if(Dy(x=p.toString)&&!Py(S=Ny(x,p))||Dy(x=p.valueOf)&&!Py(S=Ny(x,p)))return S;throw new g0("Can't convert object to primitive value")})(t)},Zy=_s,Jy=function(t){var n=AA(t,"string");return Zy(n)?n:n+""},Wy=ka,jh=_i.document,k0=Wy(jh)&&Wy(jh.createElement),Qy=function(t){return k0?jh.createElement(t):{}},OA=Qy,R0=!Co&&!ta((function(){return Object.defineProperty(OA("div"),"a",{get:function(){return 7}}).a!==7})),T0=Co,Ch=fi,ev=ff,Sf=Mc,_0=ia,$0=Jy,Ah=Ya,N0=R0,Ef=Object.getOwnPropertyDescriptor;ed.f=T0?Ef:function(t,n){if(t=_0(t),n=$0(n),N0)try{return Ef(t,n)}catch{}if(Ah(t,n))return Sf(!Ch(ev.f,t,n),t[n])};var D0=ta,tv=Ts,nv=/#|\.prototype\./,ld=function(t,n){var i=Fc[P0(t)];return i===I0||i!==M0&&(tv(n)?D0(n):!!n)},P0=ld.normalize=function(t){return String(t).replace(nv,".").toLowerCase()},Fc=ld.data={},M0=ld.NATIVE="N",I0=ld.POLYFILL="P",z0=ld,jf=aa,L0=lf,rv=Dc(Dc.bind),sv=function(t,n){return jf(t),n===void 0?t:L0?rv(t,n):function(){return t.apply(n,arguments)}},Rl={},F0=Co&&ta((function(){return Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype!==42})),iv=ka,Br=String,bs=TypeError,Tl=function(t){if(iv(t))return t;throw new bs(Br(t)+" is not an object")},q0=Co,B0=R0,U0=F0,_l=Tl,av=Jy,Cf=TypeError,Af=Object.defineProperty,kA=Object.getOwnPropertyDescriptor;Rl.f=q0?U0?function(t,n,i){if(_l(t),n=av(n),_l(i),typeof t=="function"&&n==="prototype"&&"value"in i&&"writable"in i&&!i.writable){var l=kA(t,n);l&&l.writable&&(t[n]=i.value,i={configurable:"configurable"in i?i.configurable:l.configurable,enumerable:"enumerable"in i?i.enumerable:l.enumerable,writable:!1})}return Af(t,n,i)}:Af:function(t,n,i){if(_l(t),n=av(n),_l(i),B0)try{return Af(t,n,i)}catch{}if("get"in i||"set"in i)throw new Cf("Accessors not supported");return"value"in i&&(t[n]=i.value),t};var Of=Rl,ov=Mc,ko=Co?function(t,n,i){return Of.f(t,n,ov(1,i))}:function(t,n,i){return t[n]=i,t},cd=_i,K0=uf,lv=Dc,cv=Ts,uv=ed.f,V0=z0,$l=Ga,kf=sv,Nl=ko,dv=Ya,hv=function(t){var n=function(i,l,p){if(this instanceof n){switch(arguments.length){case 0:return new t;case 1:return new t(i);case 2:return new t(i,l)}return new t(i,l,p)}return K0(t,this,arguments)};return n.prototype=t.prototype,n},Oh=function(t,n){var i,l,p,v,x,S,C,N,D,$=t.target,L=t.global,U=t.stat,J=t.proto,Y=L?cd:U?cd[$]:cd[$]&&cd[$].prototype,Z=L?$l:$l[$]||Nl($l,$,{})[$],P=Z.prototype;for(v in n)l=!(i=V0(L?v:$+(U?".":"#")+v,t.forced))&&Y&&dv(Y,v),S=Z[v],l&&(C=t.dontCallGetSet?(D=uv(Y,v))&&D.value:Y[v]),x=l&&C?C:n[v],(i||J||typeof S!=typeof x)&&(N=t.bind&&l?kf(x,cd):t.wrap&&l?hv(x):J&&cv(x)?lv(x):x,(t.sham||x&&x.sham||S&&S.sham)&&Nl(N,"sham",!0),Nl(Z,v,N),J&&(dv($l,p=$+"Prototype")||Nl($l,p,{}),Nl($l[p],v,x),t.real&&P&&(i||!P[v])&&Nl(P,v,x)))},Ro=Eh,Rf=qy("keys"),pv=function(t){return Rf[t]||(Rf[t]=Ro(t))},H0=!ta((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),To=Ya,fv=Ts,G0=Uy,Tf=H0,ud=pv("IE_PROTO"),or=Object,RA=or.prototype,mv=Tf?or.getPrototypeOf:function(t){var n=G0(t);if(To(n,ud))return n[ud];var i=n.constructor;return fv(i)&&n instanceof i?i.prototype:n instanceof or?RA:null},X0=na,kh=aa,Dl=ka,Y0=String,Z0=TypeError,Rh=ka,Ja=sd,J0=function(t){if((function(n){return Dl(n)||n===null})(t))return t;throw new Z0("Can't set "+Y0(t)+" as a prototype")},Th=Object.setPrototypeOf||("__proto__"in{}?(function(){var t,n=!1,i={};try{(t=(function(l,p,v){try{return X0(kh(Object.getOwnPropertyDescriptor(l,p)[v]))}catch{}})(Object.prototype,"__proto__","set"))(i,[]),n=i instanceof Array}catch{}return function(l,p){return Ja(l),J0(p),Rh(l)&&(n?t(l,p):l.__proto__=p),l}})():void 0),gv={},yv=Math.ceil,vv=Math.floor,_f=Math.trunc||function(t){var n=+t;return(n>0?vv:yv)(n)},$f=function(t){var n=+t;return n!=n||n===0?0:_f(n)},_o=$f,Ur=Math.max,xv=Math.min,W0=$f,us=Math.min,Q0=function(t){return(function(n){var i=W0(n);return i>0?us(i,9007199254740991):0})(t.length)},eS=ia,tS=Q0,br=function(t){return function(n,i,l){var p=eS(n),v=tS(p);if(v===0)return!t&&-1;var x,S=(function(C,N){var D=_o(C);return D<0?Ur(D+N,0):xv(D,N)})(l,v);if(t&&i!=i){for(;v>S;)if((x=p[S++])!=x)return!0}else for(;v>S;S++)if((t||S in p)&&p[S]===i)return t||S||0;return!t&&-1}},mi={indexOf:br(!1)},Ra={},Nf=Ya,nS=ia,rS=mi.indexOf,TA=Ra,_h=na([].push),qs=function(t,n){var i,l=nS(t),p=0,v=[];for(i in l)!Nf(TA,i)&&Nf(l,i)&&_h(v,i);for(;n.length>p;)Nf(l,i=n[p++])&&(~rS(v,i)||_h(v,i));return v},Ni=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],sS=qs,gi=Ni.concat("length","prototype");gv.f=Object.getOwnPropertyNames||function(t){return sS(t,gi)};var bv={};bv.f=Object.getOwnPropertySymbols;var $o=rn,qc=gv,No=bv,wv=Tl,Sv=na([].concat),Ta=$o("Reflect","ownKeys")||function(t){var n=qc.f(wv(t)),i=No.f;return i?Sv(n,i(t)):n},Ev=Ya,dd=Ta,$h=ed,Nh=Rl,Bc=function(t,n,i){for(var l=dd(n),p=Nh.f,v=$h.f,x=0;xx;)_A.f(t,i=p[x++],l[i]);return t};var yn,kn=rn("document","documentElement"),Jn=Tl,Di=jv,Do=Ni,hd=Ra,Cv=kn,Po=Qy,Ar=pv("IE_PROTO"),Wa=function(){},Pl=function(t){return"