@agent-team-foundation/first-tree-hub 0.10.0 → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,361 @@
1
+ var u0=e=>{throw TypeError(e)};var Cm=(e,t,n)=>t.has(e)||u0("Cannot "+n);var P=(e,t,n)=>(Cm(e,t,"read from private field"),n?n.call(e):t.get(e)),_e=(e,t,n)=>t.has(e)?u0("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),xe=(e,t,n,a)=>(Cm(e,t,"write to private field"),a?a.call(e,n):t.set(e,n),n),qe=(e,t,n)=>(Cm(e,t,"access private method"),n);var Gc=(e,t,n,a)=>({set _(l){xe(e,t,l,n)},get _(){return P(e,t,a)}});function D_(e,t){for(var n=0;n<t.length;n++){const a=t[n];if(typeof a!="string"&&!Array.isArray(a)){for(const l in a)if(l!=="default"&&!(l in e)){const o=Object.getOwnPropertyDescriptor(a,l);o&&Object.defineProperty(e,l,o.get?o:{enumerable:!0,get:()=>a[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))a(l);new MutationObserver(l=>{for(const o of l)if(o.type==="childList")for(const u of o.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&a(u)}).observe(document,{childList:!0,subtree:!0});function n(l){const o={};return l.integrity&&(o.integrity=l.integrity),l.referrerPolicy&&(o.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?o.credentials="include":l.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function a(l){if(l.ep)return;l.ep=!0;const o=n(l);fetch(l.href,o)}})();function $d(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Em={exports:{}},$o={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var c0;function L_(){if(c0)return $o;c0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(a,l,o){var u=null;if(o!==void 0&&(u=""+o),l.key!==void 0&&(u=""+l.key),"key"in l){o={};for(var f in l)f!=="key"&&(o[f]=l[f])}else o=l;return l=o.ref,{$$typeof:e,type:a,key:u,ref:l!==void 0?l:null,props:o}}return $o.Fragment=t,$o.jsx=n,$o.jsxs=n,$o}var d0;function I_(){return d0||(d0=1,Em.exports=L_()),Em.exports}var d=I_(),Nm={exports:{}},Ie={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var f0;function U_(){if(f0)return Ie;f0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),b=Symbol.iterator;function S(I){return I===null||typeof I!="object"?null:(I=b&&I[b]||I["@@iterator"],typeof I=="function"?I:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,E={};function C(I,U,_){this.props=I,this.context=U,this.refs=E,this.updater=_||k}C.prototype.isReactComponent={},C.prototype.setState=function(I,U){if(typeof I!="object"&&typeof I!="function"&&I!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,I,U,"setState")},C.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function T(){}T.prototype=C.prototype;function O(I,U,_){this.props=I,this.context=U,this.refs=E,this.updater=_||k}var B=O.prototype=new T;B.constructor=O,j(B,C.prototype),B.isPureReactComponent=!0;var M=Array.isArray;function R(){}var D={H:null,A:null,T:null,S:null},Z=Object.prototype.hasOwnProperty;function te(I,U,_){var $=_.ref;return{$$typeof:e,type:I,key:U,ref:$!==void 0?$:null,props:_}}function q(I,U){return te(I.type,U,I.props)}function oe(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function W(I){var U={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(_){return U[_]})}var me=/\/+/g;function de(I,U){return typeof I=="object"&&I!==null&&I.key!=null?W(""+I.key):U.toString(36)}function ee(I){switch(I.status){case"fulfilled":return I.value;case"rejected":throw I.reason;default:switch(typeof I.status=="string"?I.then(R,R):(I.status="pending",I.then(function(U){I.status==="pending"&&(I.status="fulfilled",I.value=U)},function(U){I.status==="pending"&&(I.status="rejected",I.reason=U)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function H(I,U,_,$,X){var ue=typeof I;(ue==="undefined"||ue==="boolean")&&(I=null);var Se=!1;if(I===null)Se=!0;else switch(ue){case"bigint":case"string":case"number":Se=!0;break;case"object":switch(I.$$typeof){case e:case t:Se=!0;break;case g:return Se=I._init,H(Se(I._payload),U,_,$,X)}}if(Se)return X=X(I),Se=$===""?"."+de(I,0):$,M(X)?(_="",Se!=null&&(_=Se.replace(me,"$&/")+"/"),H(X,U,_,"",function(ut){return ut})):X!=null&&(oe(X)&&(X=q(X,_+(X.key==null||I&&I.key===X.key?"":(""+X.key).replace(me,"$&/")+"/")+Se)),U.push(X)),1;Se=0;var De=$===""?".":$+":";if(M(I))for(var ge=0;ge<I.length;ge++)$=I[ge],ue=De+de($,ge),Se+=H($,U,_,ue,X);else if(ge=S(I),typeof ge=="function")for(I=ge.call(I),ge=0;!($=I.next()).done;)$=$.value,ue=De+de($,ge++),Se+=H($,U,_,ue,X);else if(ue==="object"){if(typeof I.then=="function")return H(ee(I),U,_,$,X);throw U=String(I),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return Se}function re(I,U,_){if(I==null)return I;var $=[],X=0;return H(I,$,"","",function(ue){return U.call(_,ue,X++)}),$}function K(I){if(I._status===-1){var U=I._result;U=U(),U.then(function(_){(I._status===0||I._status===-1)&&(I._status=1,I._result=_)},function(_){(I._status===0||I._status===-1)&&(I._status=2,I._result=_)}),I._status===-1&&(I._status=0,I._result=U)}if(I._status===1)return I._result.default;throw I._result}var he=typeof reportError=="function"?reportError:function(I){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof I=="object"&&I!==null&&typeof I.message=="string"?String(I.message):String(I),error:I});if(!window.dispatchEvent(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",I);return}console.error(I)},A={map:re,forEach:function(I,U,_){re(I,function(){U.apply(this,arguments)},_)},count:function(I){var U=0;return re(I,function(){U++}),U},toArray:function(I){return re(I,function(U){return U})||[]},only:function(I){if(!oe(I))throw Error("React.Children.only expected to receive a single React element child.");return I}};return Ie.Activity=y,Ie.Children=A,Ie.Component=C,Ie.Fragment=n,Ie.Profiler=l,Ie.PureComponent=O,Ie.StrictMode=a,Ie.Suspense=m,Ie.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,Ie.__COMPILER_RUNTIME={__proto__:null,c:function(I){return D.H.useMemoCache(I)}},Ie.cache=function(I){return function(){return I.apply(null,arguments)}},Ie.cacheSignal=function(){return null},Ie.cloneElement=function(I,U,_){if(I==null)throw Error("The argument must be a React element, but you passed "+I+".");var $=j({},I.props),X=I.key;if(U!=null)for(ue in U.key!==void 0&&(X=""+U.key),U)!Z.call(U,ue)||ue==="key"||ue==="__self"||ue==="__source"||ue==="ref"&&U.ref===void 0||($[ue]=U[ue]);var ue=arguments.length-2;if(ue===1)$.children=_;else if(1<ue){for(var Se=Array(ue),De=0;De<ue;De++)Se[De]=arguments[De+2];$.children=Se}return te(I.type,X,$)},Ie.createContext=function(I){return I={$$typeof:u,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null},I.Provider=I,I.Consumer={$$typeof:o,_context:I},I},Ie.createElement=function(I,U,_){var $,X={},ue=null;if(U!=null)for($ in U.key!==void 0&&(ue=""+U.key),U)Z.call(U,$)&&$!=="key"&&$!=="__self"&&$!=="__source"&&(X[$]=U[$]);var Se=arguments.length-2;if(Se===1)X.children=_;else if(1<Se){for(var De=Array(Se),ge=0;ge<Se;ge++)De[ge]=arguments[ge+2];X.children=De}if(I&&I.defaultProps)for($ in Se=I.defaultProps,Se)X[$]===void 0&&(X[$]=Se[$]);return te(I,ue,X)},Ie.createRef=function(){return{current:null}},Ie.forwardRef=function(I){return{$$typeof:f,render:I}},Ie.isValidElement=oe,Ie.lazy=function(I){return{$$typeof:g,_payload:{_status:-1,_result:I},_init:K}},Ie.memo=function(I,U){return{$$typeof:h,type:I,compare:U===void 0?null:U}},Ie.startTransition=function(I){var U=D.T,_={};D.T=_;try{var $=I(),X=D.S;X!==null&&X(_,$),typeof $=="object"&&$!==null&&typeof $.then=="function"&&$.then(R,he)}catch(ue){he(ue)}finally{U!==null&&_.types!==null&&(U.types=_.types),D.T=U}},Ie.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},Ie.use=function(I){return D.H.use(I)},Ie.useActionState=function(I,U,_){return D.H.useActionState(I,U,_)},Ie.useCallback=function(I,U){return D.H.useCallback(I,U)},Ie.useContext=function(I){return D.H.useContext(I)},Ie.useDebugValue=function(){},Ie.useDeferredValue=function(I,U){return D.H.useDeferredValue(I,U)},Ie.useEffect=function(I,U){return D.H.useEffect(I,U)},Ie.useEffectEvent=function(I){return D.H.useEffectEvent(I)},Ie.useId=function(){return D.H.useId()},Ie.useImperativeHandle=function(I,U,_){return D.H.useImperativeHandle(I,U,_)},Ie.useInsertionEffect=function(I,U){return D.H.useInsertionEffect(I,U)},Ie.useLayoutEffect=function(I,U){return D.H.useLayoutEffect(I,U)},Ie.useMemo=function(I,U){return D.H.useMemo(I,U)},Ie.useOptimistic=function(I,U){return D.H.useOptimistic(I,U)},Ie.useReducer=function(I,U,_){return D.H.useReducer(I,U,_)},Ie.useRef=function(I){return D.H.useRef(I)},Ie.useState=function(I){return D.H.useState(I)},Ie.useSyncExternalStore=function(I,U,_){return D.H.useSyncExternalStore(I,U,_)},Ie.useTransition=function(){return D.H.useTransition()},Ie.version="19.2.4",Ie}var h0;function ug(){return h0||(h0=1,Nm.exports=U_()),Nm.exports}var x=ug();const P_=$d(x),cg=D_({__proto__:null,default:P_},[x]);var _m={exports:{}},Fo={},Am={exports:{}},Tm={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var m0;function B_(){return m0||(m0=1,(function(e){function t(H,re){var K=H.length;H.push(re);e:for(;0<K;){var he=K-1>>>1,A=H[he];if(0<l(A,re))H[he]=re,H[K]=A,K=he;else break e}}function n(H){return H.length===0?null:H[0]}function a(H){if(H.length===0)return null;var re=H[0],K=H.pop();if(K!==re){H[0]=K;e:for(var he=0,A=H.length,I=A>>>1;he<I;){var U=2*(he+1)-1,_=H[U],$=U+1,X=H[$];if(0>l(_,K))$<A&&0>l(X,_)?(H[he]=X,H[$]=K,he=$):(H[he]=_,H[U]=K,he=U);else if($<A&&0>l(X,K))H[he]=X,H[$]=K,he=$;else break e}}return re}function l(H,re){var K=H.sortIndex-re.sortIndex;return K!==0?K:H.id-re.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var m=[],h=[],g=1,y=null,b=3,S=!1,k=!1,j=!1,E=!1,C=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function B(H){for(var re=n(h);re!==null;){if(re.callback===null)a(h);else if(re.startTime<=H)a(h),re.sortIndex=re.expirationTime,t(m,re);else break;re=n(h)}}function M(H){if(j=!1,B(H),!k)if(n(m)!==null)k=!0,R||(R=!0,W());else{var re=n(h);re!==null&&ee(M,re.startTime-H)}}var R=!1,D=-1,Z=5,te=-1;function q(){return E?!0:!(e.unstable_now()-te<Z)}function oe(){if(E=!1,R){var H=e.unstable_now();te=H;var re=!0;try{e:{k=!1,j&&(j=!1,T(D),D=-1),S=!0;var K=b;try{t:{for(B(H),y=n(m);y!==null&&!(y.expirationTime>H&&q());){var he=y.callback;if(typeof he=="function"){y.callback=null,b=y.priorityLevel;var A=he(y.expirationTime<=H);if(H=e.unstable_now(),typeof A=="function"){y.callback=A,B(H),re=!0;break t}y===n(m)&&a(m),B(H)}else a(m);y=n(m)}if(y!==null)re=!0;else{var I=n(h);I!==null&&ee(M,I.startTime-H),re=!1}}break e}finally{y=null,b=K,S=!1}re=void 0}}finally{re?W():R=!1}}}var W;if(typeof O=="function")W=function(){O(oe)};else if(typeof MessageChannel<"u"){var me=new MessageChannel,de=me.port2;me.port1.onmessage=oe,W=function(){de.postMessage(null)}}else W=function(){C(oe,0)};function ee(H,re){D=C(function(){H(e.unstable_now())},re)}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(H){H.callback=null},e.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Z=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(H){switch(b){case 1:case 2:case 3:var re=3;break;default:re=b}var K=b;b=re;try{return H()}finally{b=K}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(H,re){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var K=b;b=H;try{return re()}finally{b=K}},e.unstable_scheduleCallback=function(H,re,K){var he=e.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?he+K:he):K=he,H){case 1:var A=-1;break;case 2:A=250;break;case 5:A=1073741823;break;case 4:A=1e4;break;default:A=5e3}return A=K+A,H={id:g++,callback:re,priorityLevel:H,startTime:K,expirationTime:A,sortIndex:-1},K>he?(H.sortIndex=K,t(h,H),n(m)===null&&H===n(h)&&(j?(T(D),D=-1):j=!0,ee(M,K-he))):(H.sortIndex=A,t(m,H),k||S||(k=!0,R||(R=!0,W()))),H},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(H){var re=b;return function(){var K=b;b=re;try{return H.apply(this,arguments)}finally{b=K}}}})(Tm)),Tm}var p0;function $_(){return p0||(p0=1,Am.exports=B_()),Am.exports}var Rm={exports:{}},vn={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var g0;function F_(){if(g0)return vn;g0=1;var e=ug();function t(m){var h="https://react.dev/errors/"+m;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)h+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+m+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var a={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},l=Symbol.for("react.portal");function o(m,h,g){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:y==null?null:""+y,children:m,containerInfo:h,implementation:g}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(m,h){if(m==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return vn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,vn.createPortal=function(m,h){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return o(m,h,null,g)},vn.flushSync=function(m){var h=u.T,g=a.p;try{if(u.T=null,a.p=2,m)return m()}finally{u.T=h,a.p=g,a.d.f()}},vn.preconnect=function(m,h){typeof m=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,a.d.C(m,h))},vn.prefetchDNS=function(m){typeof m=="string"&&a.d.D(m)},vn.preinit=function(m,h){if(typeof m=="string"&&h&&typeof h.as=="string"){var g=h.as,y=f(g,h.crossOrigin),b=typeof h.integrity=="string"?h.integrity:void 0,S=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;g==="style"?a.d.S(m,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:y,integrity:b,fetchPriority:S}):g==="script"&&a.d.X(m,{crossOrigin:y,integrity:b,fetchPriority:S,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},vn.preinitModule=function(m,h){if(typeof m=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var g=f(h.as,h.crossOrigin);a.d.M(m,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&a.d.M(m)},vn.preload=function(m,h){if(typeof m=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var g=h.as,y=f(g,h.crossOrigin);a.d.L(m,g,{crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},vn.preloadModule=function(m,h){if(typeof m=="string")if(h){var g=f(h.as,h.crossOrigin);a.d.m(m,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else a.d.m(m)},vn.requestFormReset=function(m){a.d.r(m)},vn.unstable_batchedUpdates=function(m,h){return m(h)},vn.useFormState=function(m,h,g){return u.H.useFormState(m,h,g)},vn.useFormStatus=function(){return u.H.useHostTransitionStatus()},vn.version="19.2.4",vn}var y0;function XS(){if(y0)return Rm.exports;y0=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Rm.exports=F_(),Rm.exports}/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var v0;function q_(){if(v0)return Fo;v0=1;var e=$_(),t=ug(),n=XS();function a(r){var i="https://react.dev/errors/"+r;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)i+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+r+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function o(r){var i=r,s=r;if(r.alternate)for(;i.return;)i=i.return;else{r=i;do i=r,(i.flags&4098)!==0&&(s=i.return),r=i.return;while(r)}return i.tag===3?s:null}function u(r){if(r.tag===13){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function f(r){if(r.tag===31){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function m(r){if(o(r)!==r)throw Error(a(188))}function h(r){var i=r.alternate;if(!i){if(i=o(r),i===null)throw Error(a(188));return i!==r?null:r}for(var s=r,c=i;;){var p=s.return;if(p===null)break;var v=p.alternate;if(v===null){if(c=p.return,c!==null){s=c;continue}break}if(p.child===v.child){for(v=p.child;v;){if(v===s)return m(p),r;if(v===c)return m(p),i;v=v.sibling}throw Error(a(188))}if(s.return!==c.return)s=p,c=v;else{for(var w=!1,N=p.child;N;){if(N===s){w=!0,s=p,c=v;break}if(N===c){w=!0,c=p,s=v;break}N=N.sibling}if(!w){for(N=v.child;N;){if(N===s){w=!0,s=v,c=p;break}if(N===c){w=!0,c=v,s=p;break}N=N.sibling}if(!w)throw Error(a(189))}}if(s.alternate!==c)throw Error(a(190))}if(s.tag!==3)throw Error(a(188));return s.stateNode.current===s?r:i}function g(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r;for(r=r.child;r!==null;){if(i=g(r),i!==null)return i;r=r.sibling}return null}var y=Object.assign,b=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),O=Symbol.for("react.context"),B=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),Z=Symbol.for("react.lazy"),te=Symbol.for("react.activity"),q=Symbol.for("react.memo_cache_sentinel"),oe=Symbol.iterator;function W(r){return r===null||typeof r!="object"?null:(r=oe&&r[oe]||r["@@iterator"],typeof r=="function"?r:null)}var me=Symbol.for("react.client.reference");function de(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===me?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case j:return"Fragment";case C:return"Profiler";case E:return"StrictMode";case M:return"Suspense";case R:return"SuspenseList";case te:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case k:return"Portal";case O:return r.displayName||"Context";case T:return(r._context.displayName||"Context")+".Consumer";case B:var i=r.render;return r=r.displayName,r||(r=i.displayName||i.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case D:return i=r.displayName||null,i!==null?i:de(r.type)||"Memo";case Z:i=r._payload,r=r._init;try{return de(r(i))}catch{}}return null}var ee=Array.isArray,H=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K={pending:!1,data:null,method:null,action:null},he=[],A=-1;function I(r){return{current:r}}function U(r){0>A||(r.current=he[A],he[A]=null,A--)}function _(r,i){A++,he[A]=r.current,r.current=i}var $=I(null),X=I(null),ue=I(null),Se=I(null);function De(r,i){switch(_(ue,i),_(X,r),_($,null),i.nodeType){case 9:case 11:r=(r=i.documentElement)&&(r=r.namespaceURI)?zx(r):0;break;default:if(r=i.tagName,i=i.namespaceURI)i=zx(i),r=Ox(i,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}U($),_($,r)}function ge(){U($),U(X),U(ue)}function ut(r){r.memoizedState!==null&&_(Se,r);var i=$.current,s=Ox(i,r.type);i!==s&&(_(X,r),_($,s))}function ae(r){X.current===r&&(U($),U(X)),Se.current===r&&(U(Se),Io._currentValue=K)}var Oe,at;function Pe(r){if(Oe===void 0)try{throw Error()}catch(s){var i=s.stack.trim().match(/\n( *(at )?)/);Oe=i&&i[1]||"",at=-1<s.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+Oe+r+at}var Mt=!1;function ln(r,i){if(!r||Mt)return"";Mt=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(i){var ce=function(){throw Error()};if(Object.defineProperty(ce.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ce,[])}catch(J){var Y=J}Reflect.construct(r,[],ce)}else{try{ce.call()}catch(J){Y=J}r.call(ce.prototype)}}else{try{throw Error()}catch(J){Y=J}(ce=r())&&typeof ce.catch=="function"&&ce.catch(function(){})}}catch(J){if(J&&Y&&typeof J.stack=="string")return[J.stack,Y.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=c.DetermineComponentFrameRoot(),w=v[0],N=v[1];if(w&&N){var L=w.split(`
44
+ `),G=N.split(`
45
+ `);for(p=c=0;c<L.length&&!L[c].includes("DetermineComponentFrameRoot");)c++;for(;p<G.length&&!G[p].includes("DetermineComponentFrameRoot");)p++;if(c===L.length||p===G.length)for(c=L.length-1,p=G.length-1;1<=c&&0<=p&&L[c]!==G[p];)p--;for(;1<=c&&0<=p;c--,p--)if(L[c]!==G[p]){if(c!==1||p!==1)do if(c--,p--,0>p||L[c]!==G[p]){var ne=`
46
+ `+L[c].replace(" at new "," at ");return r.displayName&&ne.includes("<anonymous>")&&(ne=ne.replace("<anonymous>",r.displayName)),ne}while(1<=c&&0<=p);break}}}finally{Mt=!1,Error.prepareStackTrace=s}return(s=r?r.displayName||r.name:"")?Pe(s):""}function Na(r,i){switch(r.tag){case 26:case 27:case 5:return Pe(r.type);case 16:return Pe("Lazy");case 13:return r.child!==i&&i!==null?Pe("Suspense Fallback"):Pe("Suspense");case 19:return Pe("SuspenseList");case 0:case 15:return ln(r.type,!1);case 11:return ln(r.type.render,!1);case 1:return ln(r.type,!0);case 31:return Pe("Activity");default:return""}}function xl(r){try{var i="",s=null;do i+=Na(r,s),s=r,r=r.return;while(r);return i}catch(c){return`
47
+ Error generating stack: `+c.message+`
48
+ `+c.stack}}var Tr=Object.prototype.hasOwnProperty,_a=e.unstable_scheduleCallback,_i=e.unstable_cancelCallback,Gs=e.unstable_shouldYield,Ks=e.unstable_requestPaint,sn=e.unstable_now,Ys=e.unstable_getCurrentPriorityLevel,ie=e.unstable_ImmediatePriority,ye=e.unstable_UserBlockingPriority,Te=e.unstable_NormalPriority,$e=e.unstable_LowPriority,lt=e.unstable_IdlePriority,on=e.log,Sr=e.unstable_setDisableYieldValue,Jt=null,Dt=null;function un(r){if(typeof on=="function"&&Sr(r),Dt&&typeof Dt.setStrictMode=="function")try{Dt.setStrictMode(Jt,r)}catch{}}var dt=Math.clz32?Math.clz32:Du,wr=Math.log,An=Math.LN2;function Du(r){return r>>>=0,r===0?32:31-(wr(r)/An|0)|0}var Ai=256,Ti=262144,Ri=4194304;function Rr(r){var i=r&42;if(i!==0)return i;switch(r&-r){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 r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function zi(r,i,s){var c=r.pendingLanes;if(c===0)return 0;var p=0,v=r.suspendedLanes,w=r.pingedLanes;r=r.warmLanes;var N=c&134217727;return N!==0?(c=N&~v,c!==0?p=Rr(c):(w&=N,w!==0?p=Rr(w):s||(s=N&~r,s!==0&&(p=Rr(s))))):(N=c&~v,N!==0?p=Rr(N):w!==0?p=Rr(w):s||(s=c&~r,s!==0&&(p=Rr(s)))),p===0?0:i!==0&&i!==p&&(i&v)===0&&(v=p&-p,s=i&-i,v>=s||v===32&&(s&4194048)!==0)?i:p}function ve(r,i){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&i)===0}function et(r,i){switch(r){case 1:case 2:case 4:case 8:case 64:return i+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 i+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 Tn(){var r=Ri;return Ri<<=1,(Ri&62914560)===0&&(Ri=4194304),r}function kr(r){for(var i=[],s=0;31>s;s++)i.push(r);return i}function Aa(r,i){r.pendingLanes|=i,i!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function hf(r,i,s,c,p,v){var w=r.pendingLanes;r.pendingLanes=s,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=s,r.entangledLanes&=s,r.errorRecoveryDisabledLanes&=s,r.shellSuspendCounter=0;var N=r.entanglements,L=r.expirationTimes,G=r.hiddenUpdates;for(s=w&~s;0<s;){var ne=31-dt(s),ce=1<<ne;N[ne]=0,L[ne]=-1;var Y=G[ne];if(Y!==null)for(G[ne]=null,ne=0;ne<Y.length;ne++){var J=Y[ne];J!==null&&(J.lane&=-536870913)}s&=~ce}c!==0&&my(r,c,0),v!==0&&p===0&&r.tag!==0&&(r.suspendedLanes|=v&~(w&~i))}function my(r,i,s){r.pendingLanes|=i,r.suspendedLanes&=~i;var c=31-dt(i);r.entangledLanes|=i,r.entanglements[c]=r.entanglements[c]|1073741824|s&261930}function py(r,i){var s=r.entangledLanes|=i;for(r=r.entanglements;s;){var c=31-dt(s),p=1<<c;p&i|r[c]&i&&(r[c]|=i),s&=~p}}function gy(r,i){var s=i&-i;return s=(s&42)!==0?1:mf(s),(s&(r.suspendedLanes|i))!==0?0:s}function mf(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function pf(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function yy(){var r=re.p;return r!==0?r:(r=window.event,r===void 0?32:n0(r.type))}function vy(r,i){var s=re.p;try{return re.p=r,i()}finally{re.p=s}}var Ta=Math.random().toString(36).slice(2),cn="__reactFiber$"+Ta,Rn="__reactProps$"+Ta,Sl="__reactContainer$"+Ta,gf="__reactEvents$"+Ta,jE="__reactListeners$"+Ta,CE="__reactHandles$"+Ta,by="__reactResources$"+Ta,Xs="__reactMarker$"+Ta;function yf(r){delete r[cn],delete r[Rn],delete r[gf],delete r[jE],delete r[CE]}function wl(r){var i=r[cn];if(i)return i;for(var s=r.parentNode;s;){if(i=s[Sl]||s[cn]){if(s=i.alternate,i.child!==null||s!==null&&s.child!==null)for(r=Bx(r);r!==null;){if(s=r[cn])return s;r=Bx(r)}return i}r=s,s=r.parentNode}return null}function kl(r){if(r=r[cn]||r[Sl]){var i=r.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return r}return null}function Js(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r.stateNode;throw Error(a(33))}function jl(r){var i=r[by];return i||(i=r[by]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function Wt(r){r[Xs]=!0}var xy=new Set,Sy={};function Oi(r,i){Cl(r,i),Cl(r+"Capture",i)}function Cl(r,i){for(Sy[r]=i,r=0;r<i.length;r++)xy.add(i[r])}var EE=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),wy={},ky={};function NE(r){return Tr.call(ky,r)?!0:Tr.call(wy,r)?!1:EE.test(r)?ky[r]=!0:(wy[r]=!0,!1)}function Lu(r,i,s){if(NE(i))if(s===null)r.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":r.removeAttribute(i);return;case"boolean":var c=i.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){r.removeAttribute(i);return}}r.setAttribute(i,""+s)}}function Iu(r,i,s){if(s===null)r.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(i);return}r.setAttribute(i,""+s)}}function Kr(r,i,s,c){if(c===null)r.removeAttribute(s);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(s);return}r.setAttributeNS(i,s,""+c)}}function ar(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function jy(r){var i=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function _E(r,i,s){var c=Object.getOwnPropertyDescriptor(r.constructor.prototype,i);if(!r.hasOwnProperty(i)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var p=c.get,v=c.set;return Object.defineProperty(r,i,{configurable:!0,get:function(){return p.call(this)},set:function(w){s=""+w,v.call(this,w)}}),Object.defineProperty(r,i,{enumerable:c.enumerable}),{getValue:function(){return s},setValue:function(w){s=""+w},stopTracking:function(){r._valueTracker=null,delete r[i]}}}}function vf(r){if(!r._valueTracker){var i=jy(r)?"checked":"value";r._valueTracker=_E(r,i,""+r[i])}}function Cy(r){if(!r)return!1;var i=r._valueTracker;if(!i)return!0;var s=i.getValue(),c="";return r&&(c=jy(r)?r.checked?"true":"false":r.value),r=c,r!==s?(i.setValue(r),!0):!1}function Uu(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var AE=/[\n"\\]/g;function ir(r){return r.replace(AE,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function bf(r,i,s,c,p,v,w,N){r.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?r.type=w:r.removeAttribute("type"),i!=null?w==="number"?(i===0&&r.value===""||r.value!=i)&&(r.value=""+ar(i)):r.value!==""+ar(i)&&(r.value=""+ar(i)):w!=="submit"&&w!=="reset"||r.removeAttribute("value"),i!=null?xf(r,w,ar(i)):s!=null?xf(r,w,ar(s)):c!=null&&r.removeAttribute("value"),p==null&&v!=null&&(r.defaultChecked=!!v),p!=null&&(r.checked=p&&typeof p!="function"&&typeof p!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?r.name=""+ar(N):r.removeAttribute("name")}function Ey(r,i,s,c,p,v,w,N){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(r.type=v),i!=null||s!=null){if(!(v!=="submit"&&v!=="reset"||i!=null)){vf(r);return}s=s!=null?""+ar(s):"",i=i!=null?""+ar(i):s,N||i===r.value||(r.value=i),r.defaultValue=i}c=c??p,c=typeof c!="function"&&typeof c!="symbol"&&!!c,r.checked=N?r.checked:!!c,r.defaultChecked=!!c,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(r.name=w),vf(r)}function xf(r,i,s){i==="number"&&Uu(r.ownerDocument)===r||r.defaultValue===""+s||(r.defaultValue=""+s)}function El(r,i,s,c){if(r=r.options,i){i={};for(var p=0;p<s.length;p++)i["$"+s[p]]=!0;for(s=0;s<r.length;s++)p=i.hasOwnProperty("$"+r[s].value),r[s].selected!==p&&(r[s].selected=p),p&&c&&(r[s].defaultSelected=!0)}else{for(s=""+ar(s),i=null,p=0;p<r.length;p++){if(r[p].value===s){r[p].selected=!0,c&&(r[p].defaultSelected=!0);return}i!==null||r[p].disabled||(i=r[p])}i!==null&&(i.selected=!0)}}function Ny(r,i,s){if(i!=null&&(i=""+ar(i),i!==r.value&&(r.value=i),s==null)){r.defaultValue!==i&&(r.defaultValue=i);return}r.defaultValue=s!=null?""+ar(s):""}function _y(r,i,s,c){if(i==null){if(c!=null){if(s!=null)throw Error(a(92));if(ee(c)){if(1<c.length)throw Error(a(93));c=c[0]}s=c}s==null&&(s=""),i=s}s=ar(i),r.defaultValue=s,c=r.textContent,c===s&&c!==""&&c!==null&&(r.value=c),vf(r)}function Nl(r,i){if(i){var s=r.firstChild;if(s&&s===r.lastChild&&s.nodeType===3){s.nodeValue=i;return}}r.textContent=i}var TE=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Ay(r,i,s){var c=i.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?c?r.setProperty(i,""):i==="float"?r.cssFloat="":r[i]="":c?r.setProperty(i,s):typeof s!="number"||s===0||TE.has(i)?i==="float"?r.cssFloat=s:r[i]=(""+s).trim():r[i]=s+"px"}function Ty(r,i,s){if(i!=null&&typeof i!="object")throw Error(a(62));if(r=r.style,s!=null){for(var c in s)!s.hasOwnProperty(c)||i!=null&&i.hasOwnProperty(c)||(c.indexOf("--")===0?r.setProperty(c,""):c==="float"?r.cssFloat="":r[c]="");for(var p in i)c=i[p],i.hasOwnProperty(p)&&s[p]!==c&&Ay(r,p,c)}else for(var v in i)i.hasOwnProperty(v)&&Ay(r,v,i[v])}function Sf(r){if(r.indexOf("-")===-1)return!1;switch(r){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var RE=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),zE=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Pu(r){return zE.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function Yr(){}var wf=null;function kf(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var _l=null,Al=null;function Ry(r){var i=kl(r);if(i&&(r=i.stateNode)){var s=r[Rn]||null;e:switch(r=i.stateNode,i.type){case"input":if(bf(r,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),i=s.name,s.type==="radio"&&i!=null){for(s=r;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+ir(""+i)+'"][type="radio"]'),i=0;i<s.length;i++){var c=s[i];if(c!==r&&c.form===r.form){var p=c[Rn]||null;if(!p)throw Error(a(90));bf(c,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(i=0;i<s.length;i++)c=s[i],c.form===r.form&&Cy(c)}break e;case"textarea":Ny(r,s.value,s.defaultValue);break e;case"select":i=s.value,i!=null&&El(r,!!s.multiple,i,!1)}}}var jf=!1;function zy(r,i,s){if(jf)return r(i,s);jf=!0;try{var c=r(i);return c}finally{if(jf=!1,(_l!==null||Al!==null)&&(Ec(),_l&&(i=_l,r=Al,Al=_l=null,Ry(i),r)))for(i=0;i<r.length;i++)Ry(r[i])}}function Ws(r,i){var s=r.stateNode;if(s===null)return null;var c=s[Rn]||null;if(c===null)return null;s=c[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(r=r.type,c=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!c;break e;default:r=!1}if(r)return null;if(s&&typeof s!="function")throw Error(a(231,i,typeof s));return s}var Xr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Cf=!1;if(Xr)try{var eo={};Object.defineProperty(eo,"passive",{get:function(){Cf=!0}}),window.addEventListener("test",eo,eo),window.removeEventListener("test",eo,eo)}catch{Cf=!1}var Ra=null,Ef=null,Bu=null;function Oy(){if(Bu)return Bu;var r,i=Ef,s=i.length,c,p="value"in Ra?Ra.value:Ra.textContent,v=p.length;for(r=0;r<s&&i[r]===p[r];r++);var w=s-r;for(c=1;c<=w&&i[s-c]===p[v-c];c++);return Bu=p.slice(r,1<c?1-c:void 0)}function $u(r){var i=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&i===13&&(r=13)):r=i,r===10&&(r=13),32<=r||r===13?r:0}function Fu(){return!0}function My(){return!1}function zn(r){function i(s,c,p,v,w){this._reactName=s,this._targetInst=p,this.type=c,this.nativeEvent=v,this.target=w,this.currentTarget=null;for(var N in r)r.hasOwnProperty(N)&&(s=r[N],this[N]=s?s(v):v[N]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?Fu:My,this.isPropagationStopped=My,this}return y(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=Fu)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Fu)},persist:function(){},isPersistent:Fu}),i}var Mi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},qu=zn(Mi),to=y({},Mi,{view:0,detail:0}),OE=zn(to),Nf,_f,no,Hu=y({},to,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Tf,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==no&&(no&&r.type==="mousemove"?(Nf=r.screenX-no.screenX,_f=r.screenY-no.screenY):_f=Nf=0,no=r),Nf)},movementY:function(r){return"movementY"in r?r.movementY:_f}}),Dy=zn(Hu),ME=y({},Hu,{dataTransfer:0}),DE=zn(ME),LE=y({},to,{relatedTarget:0}),Af=zn(LE),IE=y({},Mi,{animationName:0,elapsedTime:0,pseudoElement:0}),UE=zn(IE),PE=y({},Mi,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),BE=zn(PE),$E=y({},Mi,{data:0}),Ly=zn($E),FE={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},qE={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},HE={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ZE(r){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(r):(r=HE[r])?!!i[r]:!1}function Tf(){return ZE}var VE=y({},to,{key:function(r){if(r.key){var i=FE[r.key]||r.key;if(i!=="Unidentified")return i}return r.type==="keypress"?(r=$u(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?qE[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Tf,charCode:function(r){return r.type==="keypress"?$u(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?$u(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),QE=zn(VE),GE=y({},Hu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Iy=zn(GE),KE=y({},to,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Tf}),YE=zn(KE),XE=y({},Mi,{propertyName:0,elapsedTime:0,pseudoElement:0}),JE=zn(XE),WE=y({},Hu,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),eN=zn(WE),tN=y({},Mi,{newState:0,oldState:0}),nN=zn(tN),rN=[9,13,27,32],Rf=Xr&&"CompositionEvent"in window,ro=null;Xr&&"documentMode"in document&&(ro=document.documentMode);var aN=Xr&&"TextEvent"in window&&!ro,Uy=Xr&&(!Rf||ro&&8<ro&&11>=ro),Py=" ",By=!1;function $y(r,i){switch(r){case"keyup":return rN.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Fy(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Tl=!1;function iN(r,i){switch(r){case"compositionend":return Fy(i);case"keypress":return i.which!==32?null:(By=!0,Py);case"textInput":return r=i.data,r===Py&&By?null:r;default:return null}}function lN(r,i){if(Tl)return r==="compositionend"||!Rf&&$y(r,i)?(r=Oy(),Bu=Ef=Ra=null,Tl=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return Uy&&i.locale!=="ko"?null:i.data;default:return null}}var sN={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function qy(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i==="input"?!!sN[r.type]:i==="textarea"}function Hy(r,i,s,c){_l?Al?Al.push(c):Al=[c]:_l=c,i=Oc(i,"onChange"),0<i.length&&(s=new qu("onChange","change",null,s,c),r.push({event:s,listeners:i}))}var ao=null,io=null;function oN(r){Ex(r,0)}function Zu(r){var i=Js(r);if(Cy(i))return r}function Zy(r,i){if(r==="change")return i}var Vy=!1;if(Xr){var zf;if(Xr){var Of="oninput"in document;if(!Of){var Qy=document.createElement("div");Qy.setAttribute("oninput","return;"),Of=typeof Qy.oninput=="function"}zf=Of}else zf=!1;Vy=zf&&(!document.documentMode||9<document.documentMode)}function Gy(){ao&&(ao.detachEvent("onpropertychange",Ky),io=ao=null)}function Ky(r){if(r.propertyName==="value"&&Zu(io)){var i=[];Hy(i,io,r,kf(r)),zy(oN,i)}}function uN(r,i,s){r==="focusin"?(Gy(),ao=i,io=s,ao.attachEvent("onpropertychange",Ky)):r==="focusout"&&Gy()}function cN(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return Zu(io)}function dN(r,i){if(r==="click")return Zu(i)}function fN(r,i){if(r==="input"||r==="change")return Zu(i)}function hN(r,i){return r===i&&(r!==0||1/r===1/i)||r!==r&&i!==i}var Vn=typeof Object.is=="function"?Object.is:hN;function lo(r,i){if(Vn(r,i))return!0;if(typeof r!="object"||r===null||typeof i!="object"||i===null)return!1;var s=Object.keys(r),c=Object.keys(i);if(s.length!==c.length)return!1;for(c=0;c<s.length;c++){var p=s[c];if(!Tr.call(i,p)||!Vn(r[p],i[p]))return!1}return!0}function Yy(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Xy(r,i){var s=Yy(r);r=0;for(var c;s;){if(s.nodeType===3){if(c=r+s.textContent.length,r<=i&&c>=i)return{node:s,offset:i-r};r=c}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Yy(s)}}function Jy(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?Jy(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function Wy(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var i=Uu(r.document);i instanceof r.HTMLIFrameElement;){try{var s=typeof i.contentWindow.location.href=="string"}catch{s=!1}if(s)r=i.contentWindow;else break;i=Uu(r.document)}return i}function Mf(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i&&(i==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||i==="textarea"||r.contentEditable==="true")}var mN=Xr&&"documentMode"in document&&11>=document.documentMode,Rl=null,Df=null,so=null,Lf=!1;function ev(r,i,s){var c=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Lf||Rl==null||Rl!==Uu(c)||(c=Rl,"selectionStart"in c&&Mf(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),so&&lo(so,c)||(so=c,c=Oc(Df,"onSelect"),0<c.length&&(i=new qu("onSelect","select",null,i,s),r.push({event:i,listeners:c}),i.target=Rl)))}function Di(r,i){var s={};return s[r.toLowerCase()]=i.toLowerCase(),s["Webkit"+r]="webkit"+i,s["Moz"+r]="moz"+i,s}var zl={animationend:Di("Animation","AnimationEnd"),animationiteration:Di("Animation","AnimationIteration"),animationstart:Di("Animation","AnimationStart"),transitionrun:Di("Transition","TransitionRun"),transitionstart:Di("Transition","TransitionStart"),transitioncancel:Di("Transition","TransitionCancel"),transitionend:Di("Transition","TransitionEnd")},If={},tv={};Xr&&(tv=document.createElement("div").style,"AnimationEvent"in window||(delete zl.animationend.animation,delete zl.animationiteration.animation,delete zl.animationstart.animation),"TransitionEvent"in window||delete zl.transitionend.transition);function Li(r){if(If[r])return If[r];if(!zl[r])return r;var i=zl[r],s;for(s in i)if(i.hasOwnProperty(s)&&s in tv)return If[r]=i[s];return r}var nv=Li("animationend"),rv=Li("animationiteration"),av=Li("animationstart"),pN=Li("transitionrun"),gN=Li("transitionstart"),yN=Li("transitioncancel"),iv=Li("transitionend"),lv=new Map,Uf="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Uf.push("scrollEnd");function jr(r,i){lv.set(r,i),Oi(i,[r])}var Vu=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},lr=[],Ol=0,Pf=0;function Qu(){for(var r=Ol,i=Pf=Ol=0;i<r;){var s=lr[i];lr[i++]=null;var c=lr[i];lr[i++]=null;var p=lr[i];lr[i++]=null;var v=lr[i];if(lr[i++]=null,c!==null&&p!==null){var w=c.pending;w===null?p.next=p:(p.next=w.next,w.next=p),c.pending=p}v!==0&&sv(s,p,v)}}function Gu(r,i,s,c){lr[Ol++]=r,lr[Ol++]=i,lr[Ol++]=s,lr[Ol++]=c,Pf|=c,r.lanes|=c,r=r.alternate,r!==null&&(r.lanes|=c)}function Bf(r,i,s,c){return Gu(r,i,s,c),Ku(r)}function Ii(r,i){return Gu(r,null,null,i),Ku(r)}function sv(r,i,s){r.lanes|=s;var c=r.alternate;c!==null&&(c.lanes|=s);for(var p=!1,v=r.return;v!==null;)v.childLanes|=s,c=v.alternate,c!==null&&(c.childLanes|=s),v.tag===22&&(r=v.stateNode,r===null||r._visibility&1||(p=!0)),r=v,v=v.return;return r.tag===3?(v=r.stateNode,p&&i!==null&&(p=31-dt(s),r=v.hiddenUpdates,c=r[p],c===null?r[p]=[i]:c.push(i),i.lane=s|536870912),v):null}function Ku(r){if(50<To)throw To=0,Kh=null,Error(a(185));for(var i=r.return;i!==null;)r=i,i=r.return;return r.tag===3?r.stateNode:null}var Ml={};function vN(r,i,s,c){this.tag=r,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Qn(r,i,s,c){return new vN(r,i,s,c)}function $f(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Jr(r,i){var s=r.alternate;return s===null?(s=Qn(r.tag,i,r.key,r.mode),s.elementType=r.elementType,s.type=r.type,s.stateNode=r.stateNode,s.alternate=r,r.alternate=s):(s.pendingProps=i,s.type=r.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=r.flags&65011712,s.childLanes=r.childLanes,s.lanes=r.lanes,s.child=r.child,s.memoizedProps=r.memoizedProps,s.memoizedState=r.memoizedState,s.updateQueue=r.updateQueue,i=r.dependencies,s.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},s.sibling=r.sibling,s.index=r.index,s.ref=r.ref,s.refCleanup=r.refCleanup,s}function ov(r,i){r.flags&=65011714;var s=r.alternate;return s===null?(r.childLanes=0,r.lanes=i,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=s.childLanes,r.lanes=s.lanes,r.child=s.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=s.memoizedProps,r.memoizedState=s.memoizedState,r.updateQueue=s.updateQueue,r.type=s.type,i=s.dependencies,r.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),r}function Yu(r,i,s,c,p,v){var w=0;if(c=r,typeof r=="function")$f(r)&&(w=1);else if(typeof r=="string")w=k_(r,s,$.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case te:return r=Qn(31,s,i,p),r.elementType=te,r.lanes=v,r;case j:return Ui(s.children,p,v,i);case E:w=8,p|=24;break;case C:return r=Qn(12,s,i,p|2),r.elementType=C,r.lanes=v,r;case M:return r=Qn(13,s,i,p),r.elementType=M,r.lanes=v,r;case R:return r=Qn(19,s,i,p),r.elementType=R,r.lanes=v,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case O:w=10;break e;case T:w=9;break e;case B:w=11;break e;case D:w=14;break e;case Z:w=16,c=null;break e}w=29,s=Error(a(130,r===null?"null":typeof r,"")),c=null}return i=Qn(w,s,i,p),i.elementType=r,i.type=c,i.lanes=v,i}function Ui(r,i,s,c){return r=Qn(7,r,c,i),r.lanes=s,r}function Ff(r,i,s){return r=Qn(6,r,null,i),r.lanes=s,r}function uv(r){var i=Qn(18,null,null,0);return i.stateNode=r,i}function qf(r,i,s){return i=Qn(4,r.children!==null?r.children:[],r.key,i),i.lanes=s,i.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},i}var cv=new WeakMap;function sr(r,i){if(typeof r=="object"&&r!==null){var s=cv.get(r);return s!==void 0?s:(i={value:r,source:i,stack:xl(i)},cv.set(r,i),i)}return{value:r,source:i,stack:xl(i)}}var Dl=[],Ll=0,Xu=null,oo=0,or=[],ur=0,za=null,zr=1,Or="";function Wr(r,i){Dl[Ll++]=oo,Dl[Ll++]=Xu,Xu=r,oo=i}function dv(r,i,s){or[ur++]=zr,or[ur++]=Or,or[ur++]=za,za=r;var c=zr;r=Or;var p=32-dt(c)-1;c&=~(1<<p),s+=1;var v=32-dt(i)+p;if(30<v){var w=p-p%5;v=(c&(1<<w)-1).toString(32),c>>=w,p-=w,zr=1<<32-dt(i)+p|s<<p|c,Or=v+r}else zr=1<<v|s<<p|c,Or=r}function Hf(r){r.return!==null&&(Wr(r,1),dv(r,1,0))}function Zf(r){for(;r===Xu;)Xu=Dl[--Ll],Dl[Ll]=null,oo=Dl[--Ll],Dl[Ll]=null;for(;r===za;)za=or[--ur],or[ur]=null,Or=or[--ur],or[ur]=null,zr=or[--ur],or[ur]=null}function fv(r,i){or[ur++]=zr,or[ur++]=Or,or[ur++]=za,zr=i.id,Or=i.overflow,za=r}var dn=null,Et=null,tt=!1,Oa=null,cr=!1,Vf=Error(a(519));function Ma(r){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw uo(sr(i,r)),Vf}function hv(r){var i=r.stateNode,s=r.type,c=r.memoizedProps;switch(i[cn]=r,i[Rn]=c,s){case"dialog":Ke("cancel",i),Ke("close",i);break;case"iframe":case"object":case"embed":Ke("load",i);break;case"video":case"audio":for(s=0;s<zo.length;s++)Ke(zo[s],i);break;case"source":Ke("error",i);break;case"img":case"image":case"link":Ke("error",i),Ke("load",i);break;case"details":Ke("toggle",i);break;case"input":Ke("invalid",i),Ey(i,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":Ke("invalid",i);break;case"textarea":Ke("invalid",i),_y(i,c.value,c.defaultValue,c.children)}s=c.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||i.textContent===""+s||c.suppressHydrationWarning===!0||Tx(i.textContent,s)?(c.popover!=null&&(Ke("beforetoggle",i),Ke("toggle",i)),c.onScroll!=null&&Ke("scroll",i),c.onScrollEnd!=null&&Ke("scrollend",i),c.onClick!=null&&(i.onclick=Yr),i=!0):i=!1,i||Ma(r,!0)}function mv(r){for(dn=r.return;dn;)switch(dn.tag){case 5:case 31:case 13:cr=!1;return;case 27:case 3:cr=!0;return;default:dn=dn.return}}function Il(r){if(r!==dn)return!1;if(!tt)return mv(r),tt=!0,!1;var i=r.tag,s;if((s=i!==3&&i!==27)&&((s=i===5)&&(s=r.type,s=!(s!=="form"&&s!=="button")||cm(r.type,r.memoizedProps)),s=!s),s&&Et&&Ma(r),mv(r),i===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));Et=Px(r)}else if(i===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));Et=Px(r)}else i===27?(i=Et,Ga(r.type)?(r=pm,pm=null,Et=r):Et=i):Et=dn?fr(r.stateNode.nextSibling):null;return!0}function Pi(){Et=dn=null,tt=!1}function Qf(){var r=Oa;return r!==null&&(Ln===null?Ln=r:Ln.push.apply(Ln,r),Oa=null),r}function uo(r){Oa===null?Oa=[r]:Oa.push(r)}var Gf=I(null),Bi=null,ea=null;function Da(r,i,s){_(Gf,i._currentValue),i._currentValue=s}function ta(r){r._currentValue=Gf.current,U(Gf)}function Kf(r,i,s){for(;r!==null;){var c=r.alternate;if((r.childLanes&i)!==i?(r.childLanes|=i,c!==null&&(c.childLanes|=i)):c!==null&&(c.childLanes&i)!==i&&(c.childLanes|=i),r===s)break;r=r.return}}function Yf(r,i,s,c){var p=r.child;for(p!==null&&(p.return=r);p!==null;){var v=p.dependencies;if(v!==null){var w=p.child;v=v.firstContext;e:for(;v!==null;){var N=v;v=p;for(var L=0;L<i.length;L++)if(N.context===i[L]){v.lanes|=s,N=v.alternate,N!==null&&(N.lanes|=s),Kf(v.return,s,r),c||(w=null);break e}v=N.next}}else if(p.tag===18){if(w=p.return,w===null)throw Error(a(341));w.lanes|=s,v=w.alternate,v!==null&&(v.lanes|=s),Kf(w,s,r),w=null}else w=p.child;if(w!==null)w.return=p;else for(w=p;w!==null;){if(w===r){w=null;break}if(p=w.sibling,p!==null){p.return=w.return,w=p;break}w=w.return}p=w}}function Ul(r,i,s,c){r=null;for(var p=i,v=!1;p!==null;){if(!v){if((p.flags&524288)!==0)v=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var w=p.alternate;if(w===null)throw Error(a(387));if(w=w.memoizedProps,w!==null){var N=p.type;Vn(p.pendingProps.value,w.value)||(r!==null?r.push(N):r=[N])}}else if(p===Se.current){if(w=p.alternate,w===null)throw Error(a(387));w.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(r!==null?r.push(Io):r=[Io])}p=p.return}r!==null&&Yf(i,r,s,c),i.flags|=262144}function Ju(r){for(r=r.firstContext;r!==null;){if(!Vn(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function $i(r){Bi=r,ea=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function fn(r){return pv(Bi,r)}function Wu(r,i){return Bi===null&&$i(r),pv(r,i)}function pv(r,i){var s=i._currentValue;if(i={context:i,memoizedValue:s,next:null},ea===null){if(r===null)throw Error(a(308));ea=i,r.dependencies={lanes:0,firstContext:i},r.flags|=524288}else ea=ea.next=i;return s}var bN=typeof AbortController<"u"?AbortController:function(){var r=[],i=this.signal={aborted:!1,addEventListener:function(s,c){r.push(c)}};this.abort=function(){i.aborted=!0,r.forEach(function(s){return s()})}},xN=e.unstable_scheduleCallback,SN=e.unstable_NormalPriority,Ft={$$typeof:O,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Xf(){return{controller:new bN,data:new Map,refCount:0}}function co(r){r.refCount--,r.refCount===0&&xN(SN,function(){r.controller.abort()})}var fo=null,Jf=0,Pl=0,Bl=null;function wN(r,i){if(fo===null){var s=fo=[];Jf=0,Pl=tm(),Bl={status:"pending",value:void 0,then:function(c){s.push(c)}}}return Jf++,i.then(gv,gv),i}function gv(){if(--Jf===0&&fo!==null){Bl!==null&&(Bl.status="fulfilled");var r=fo;fo=null,Pl=0,Bl=null;for(var i=0;i<r.length;i++)(0,r[i])()}}function kN(r,i){var s=[],c={status:"pending",value:null,reason:null,then:function(p){s.push(p)}};return r.then(function(){c.status="fulfilled",c.value=i;for(var p=0;p<s.length;p++)(0,s[p])(i)},function(p){for(c.status="rejected",c.reason=p,p=0;p<s.length;p++)(0,s[p])(void 0)}),c}var yv=H.S;H.S=function(r,i){ex=sn(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&wN(r,i),yv!==null&&yv(r,i)};var Fi=I(null);function Wf(){var r=Fi.current;return r!==null?r:St.pooledCache}function ec(r,i){i===null?_(Fi,Fi.current):_(Fi,i.pool)}function vv(){var r=Wf();return r===null?null:{parent:Ft._currentValue,pool:r}}var $l=Error(a(460)),eh=Error(a(474)),tc=Error(a(542)),nc={then:function(){}};function bv(r){return r=r.status,r==="fulfilled"||r==="rejected"}function xv(r,i,s){switch(s=r[s],s===void 0?r.push(i):s!==i&&(i.then(Yr,Yr),i=s),i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,wv(r),r;default:if(typeof i.status=="string")i.then(Yr,Yr);else{if(r=St,r!==null&&100<r.shellSuspendCounter)throw Error(a(482));r=i,r.status="pending",r.then(function(c){if(i.status==="pending"){var p=i;p.status="fulfilled",p.value=c}},function(c){if(i.status==="pending"){var p=i;p.status="rejected",p.reason=c}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,wv(r),r}throw Hi=i,$l}}function qi(r){try{var i=r._init;return i(r._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Hi=s,$l):s}}var Hi=null;function Sv(){if(Hi===null)throw Error(a(459));var r=Hi;return Hi=null,r}function wv(r){if(r===$l||r===tc)throw Error(a(483))}var Fl=null,ho=0;function rc(r){var i=ho;return ho+=1,Fl===null&&(Fl=[]),xv(Fl,r,i)}function mo(r,i){i=i.props.ref,r.ref=i!==void 0?i:null}function ac(r,i){throw i.$$typeof===b?Error(a(525)):(r=Object.prototype.toString.call(i),Error(a(31,r==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":r)))}function kv(r){function i(V,F){if(r){var Q=V.deletions;Q===null?(V.deletions=[F],V.flags|=16):Q.push(F)}}function s(V,F){if(!r)return null;for(;F!==null;)i(V,F),F=F.sibling;return null}function c(V){for(var F=new Map;V!==null;)V.key!==null?F.set(V.key,V):F.set(V.index,V),V=V.sibling;return F}function p(V,F){return V=Jr(V,F),V.index=0,V.sibling=null,V}function v(V,F,Q){return V.index=Q,r?(Q=V.alternate,Q!==null?(Q=Q.index,Q<F?(V.flags|=67108866,F):Q):(V.flags|=67108866,F)):(V.flags|=1048576,F)}function w(V){return r&&V.alternate===null&&(V.flags|=67108866),V}function N(V,F,Q,se){return F===null||F.tag!==6?(F=Ff(Q,V.mode,se),F.return=V,F):(F=p(F,Q),F.return=V,F)}function L(V,F,Q,se){var Ae=Q.type;return Ae===j?ne(V,F,Q.props.children,se,Q.key):F!==null&&(F.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===Z&&qi(Ae)===F.type)?(F=p(F,Q.props),mo(F,Q),F.return=V,F):(F=Yu(Q.type,Q.key,Q.props,null,V.mode,se),mo(F,Q),F.return=V,F)}function G(V,F,Q,se){return F===null||F.tag!==4||F.stateNode.containerInfo!==Q.containerInfo||F.stateNode.implementation!==Q.implementation?(F=qf(Q,V.mode,se),F.return=V,F):(F=p(F,Q.children||[]),F.return=V,F)}function ne(V,F,Q,se,Ae){return F===null||F.tag!==7?(F=Ui(Q,V.mode,se,Ae),F.return=V,F):(F=p(F,Q),F.return=V,F)}function ce(V,F,Q){if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return F=Ff(""+F,V.mode,Q),F.return=V,F;if(typeof F=="object"&&F!==null){switch(F.$$typeof){case S:return Q=Yu(F.type,F.key,F.props,null,V.mode,Q),mo(Q,F),Q.return=V,Q;case k:return F=qf(F,V.mode,Q),F.return=V,F;case Z:return F=qi(F),ce(V,F,Q)}if(ee(F)||W(F))return F=Ui(F,V.mode,Q,null),F.return=V,F;if(typeof F.then=="function")return ce(V,rc(F),Q);if(F.$$typeof===O)return ce(V,Wu(V,F),Q);ac(V,F)}return null}function Y(V,F,Q,se){var Ae=F!==null?F.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Ae!==null?null:N(V,F,""+Q,se);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case S:return Q.key===Ae?L(V,F,Q,se):null;case k:return Q.key===Ae?G(V,F,Q,se):null;case Z:return Q=qi(Q),Y(V,F,Q,se)}if(ee(Q)||W(Q))return Ae!==null?null:ne(V,F,Q,se,null);if(typeof Q.then=="function")return Y(V,F,rc(Q),se);if(Q.$$typeof===O)return Y(V,F,Wu(V,Q),se);ac(V,Q)}return null}function J(V,F,Q,se,Ae){if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return V=V.get(Q)||null,N(F,V,""+se,Ae);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case S:return V=V.get(se.key===null?Q:se.key)||null,L(F,V,se,Ae);case k:return V=V.get(se.key===null?Q:se.key)||null,G(F,V,se,Ae);case Z:return se=qi(se),J(V,F,Q,se,Ae)}if(ee(se)||W(se))return V=V.get(Q)||null,ne(F,V,se,Ae,null);if(typeof se.then=="function")return J(V,F,Q,rc(se),Ae);if(se.$$typeof===O)return J(V,F,Q,Wu(F,se),Ae);ac(F,se)}return null}function we(V,F,Q,se){for(var Ae=null,st=null,Ce=F,Fe=F=0,Je=null;Ce!==null&&Fe<Q.length;Fe++){Ce.index>Fe?(Je=Ce,Ce=null):Je=Ce.sibling;var ot=Y(V,Ce,Q[Fe],se);if(ot===null){Ce===null&&(Ce=Je);break}r&&Ce&&ot.alternate===null&&i(V,Ce),F=v(ot,F,Fe),st===null?Ae=ot:st.sibling=ot,st=ot,Ce=Je}if(Fe===Q.length)return s(V,Ce),tt&&Wr(V,Fe),Ae;if(Ce===null){for(;Fe<Q.length;Fe++)Ce=ce(V,Q[Fe],se),Ce!==null&&(F=v(Ce,F,Fe),st===null?Ae=Ce:st.sibling=Ce,st=Ce);return tt&&Wr(V,Fe),Ae}for(Ce=c(Ce);Fe<Q.length;Fe++)Je=J(Ce,V,Fe,Q[Fe],se),Je!==null&&(r&&Je.alternate!==null&&Ce.delete(Je.key===null?Fe:Je.key),F=v(Je,F,Fe),st===null?Ae=Je:st.sibling=Je,st=Je);return r&&Ce.forEach(function(Wa){return i(V,Wa)}),tt&&Wr(V,Fe),Ae}function ze(V,F,Q,se){if(Q==null)throw Error(a(151));for(var Ae=null,st=null,Ce=F,Fe=F=0,Je=null,ot=Q.next();Ce!==null&&!ot.done;Fe++,ot=Q.next()){Ce.index>Fe?(Je=Ce,Ce=null):Je=Ce.sibling;var Wa=Y(V,Ce,ot.value,se);if(Wa===null){Ce===null&&(Ce=Je);break}r&&Ce&&Wa.alternate===null&&i(V,Ce),F=v(Wa,F,Fe),st===null?Ae=Wa:st.sibling=Wa,st=Wa,Ce=Je}if(ot.done)return s(V,Ce),tt&&Wr(V,Fe),Ae;if(Ce===null){for(;!ot.done;Fe++,ot=Q.next())ot=ce(V,ot.value,se),ot!==null&&(F=v(ot,F,Fe),st===null?Ae=ot:st.sibling=ot,st=ot);return tt&&Wr(V,Fe),Ae}for(Ce=c(Ce);!ot.done;Fe++,ot=Q.next())ot=J(Ce,V,Fe,ot.value,se),ot!==null&&(r&&ot.alternate!==null&&Ce.delete(ot.key===null?Fe:ot.key),F=v(ot,F,Fe),st===null?Ae=ot:st.sibling=ot,st=ot);return r&&Ce.forEach(function(M_){return i(V,M_)}),tt&&Wr(V,Fe),Ae}function bt(V,F,Q,se){if(typeof Q=="object"&&Q!==null&&Q.type===j&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case S:e:{for(var Ae=Q.key;F!==null;){if(F.key===Ae){if(Ae=Q.type,Ae===j){if(F.tag===7){s(V,F.sibling),se=p(F,Q.props.children),se.return=V,V=se;break e}}else if(F.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===Z&&qi(Ae)===F.type){s(V,F.sibling),se=p(F,Q.props),mo(se,Q),se.return=V,V=se;break e}s(V,F);break}else i(V,F);F=F.sibling}Q.type===j?(se=Ui(Q.props.children,V.mode,se,Q.key),se.return=V,V=se):(se=Yu(Q.type,Q.key,Q.props,null,V.mode,se),mo(se,Q),se.return=V,V=se)}return w(V);case k:e:{for(Ae=Q.key;F!==null;){if(F.key===Ae)if(F.tag===4&&F.stateNode.containerInfo===Q.containerInfo&&F.stateNode.implementation===Q.implementation){s(V,F.sibling),se=p(F,Q.children||[]),se.return=V,V=se;break e}else{s(V,F);break}else i(V,F);F=F.sibling}se=qf(Q,V.mode,se),se.return=V,V=se}return w(V);case Z:return Q=qi(Q),bt(V,F,Q,se)}if(ee(Q))return we(V,F,Q,se);if(W(Q)){if(Ae=W(Q),typeof Ae!="function")throw Error(a(150));return Q=Ae.call(Q),ze(V,F,Q,se)}if(typeof Q.then=="function")return bt(V,F,rc(Q),se);if(Q.$$typeof===O)return bt(V,F,Wu(V,Q),se);ac(V,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,F!==null&&F.tag===6?(s(V,F.sibling),se=p(F,Q),se.return=V,V=se):(s(V,F),se=Ff(Q,V.mode,se),se.return=V,V=se),w(V)):s(V,F)}return function(V,F,Q,se){try{ho=0;var Ae=bt(V,F,Q,se);return Fl=null,Ae}catch(Ce){if(Ce===$l||Ce===tc)throw Ce;var st=Qn(29,Ce,null,V.mode);return st.lanes=se,st.return=V,st}finally{}}}var Zi=kv(!0),jv=kv(!1),La=!1;function th(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function nh(r,i){r=r.updateQueue,i.updateQueue===r&&(i.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function Ia(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function Ua(r,i,s){var c=r.updateQueue;if(c===null)return null;if(c=c.shared,(ct&2)!==0){var p=c.pending;return p===null?i.next=i:(i.next=p.next,p.next=i),c.pending=i,i=Ku(r),sv(r,null,s),i}return Gu(r,c,i,s),Ku(r)}function po(r,i,s){if(i=i.updateQueue,i!==null&&(i=i.shared,(s&4194048)!==0)){var c=i.lanes;c&=r.pendingLanes,s|=c,i.lanes=s,py(r,s)}}function rh(r,i){var s=r.updateQueue,c=r.alternate;if(c!==null&&(c=c.updateQueue,s===c)){var p=null,v=null;if(s=s.firstBaseUpdate,s!==null){do{var w={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};v===null?p=v=w:v=v.next=w,s=s.next}while(s!==null);v===null?p=v=i:v=v.next=i}else p=v=i;s={baseState:c.baseState,firstBaseUpdate:p,lastBaseUpdate:v,shared:c.shared,callbacks:c.callbacks},r.updateQueue=s;return}r=s.lastBaseUpdate,r===null?s.firstBaseUpdate=i:r.next=i,s.lastBaseUpdate=i}var ah=!1;function go(){if(ah){var r=Bl;if(r!==null)throw r}}function yo(r,i,s,c){ah=!1;var p=r.updateQueue;La=!1;var v=p.firstBaseUpdate,w=p.lastBaseUpdate,N=p.shared.pending;if(N!==null){p.shared.pending=null;var L=N,G=L.next;L.next=null,w===null?v=G:w.next=G,w=L;var ne=r.alternate;ne!==null&&(ne=ne.updateQueue,N=ne.lastBaseUpdate,N!==w&&(N===null?ne.firstBaseUpdate=G:N.next=G,ne.lastBaseUpdate=L))}if(v!==null){var ce=p.baseState;w=0,ne=G=L=null,N=v;do{var Y=N.lane&-536870913,J=Y!==N.lane;if(J?(Xe&Y)===Y:(c&Y)===Y){Y!==0&&Y===Pl&&(ah=!0),ne!==null&&(ne=ne.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var we=r,ze=N;Y=i;var bt=s;switch(ze.tag){case 1:if(we=ze.payload,typeof we=="function"){ce=we.call(bt,ce,Y);break e}ce=we;break e;case 3:we.flags=we.flags&-65537|128;case 0:if(we=ze.payload,Y=typeof we=="function"?we.call(bt,ce,Y):we,Y==null)break e;ce=y({},ce,Y);break e;case 2:La=!0}}Y=N.callback,Y!==null&&(r.flags|=64,J&&(r.flags|=8192),J=p.callbacks,J===null?p.callbacks=[Y]:J.push(Y))}else J={lane:Y,tag:N.tag,payload:N.payload,callback:N.callback,next:null},ne===null?(G=ne=J,L=ce):ne=ne.next=J,w|=Y;if(N=N.next,N===null){if(N=p.shared.pending,N===null)break;J=N,N=J.next,J.next=null,p.lastBaseUpdate=J,p.shared.pending=null}}while(!0);ne===null&&(L=ce),p.baseState=L,p.firstBaseUpdate=G,p.lastBaseUpdate=ne,v===null&&(p.shared.lanes=0),qa|=w,r.lanes=w,r.memoizedState=ce}}function Cv(r,i){if(typeof r!="function")throw Error(a(191,r));r.call(i)}function Ev(r,i){var s=r.callbacks;if(s!==null)for(r.callbacks=null,r=0;r<s.length;r++)Cv(s[r],i)}var ql=I(null),ic=I(0);function Nv(r,i){r=ca,_(ic,r),_(ql,i),ca=r|i.baseLanes}function ih(){_(ic,ca),_(ql,ql.current)}function lh(){ca=ic.current,U(ql),U(ic)}var Gn=I(null),dr=null;function Pa(r){var i=r.alternate;_(Pt,Pt.current&1),_(Gn,r),dr===null&&(i===null||ql.current!==null||i.memoizedState!==null)&&(dr=r)}function sh(r){_(Pt,Pt.current),_(Gn,r),dr===null&&(dr=r)}function _v(r){r.tag===22?(_(Pt,Pt.current),_(Gn,r),dr===null&&(dr=r)):Ba()}function Ba(){_(Pt,Pt.current),_(Gn,Gn.current)}function Kn(r){U(Gn),dr===r&&(dr=null),U(Pt)}var Pt=I(0);function lc(r){for(var i=r;i!==null;){if(i.tag===13){var s=i.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||hm(s)||mm(s)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var na=0,Be=null,yt=null,qt=null,sc=!1,Hl=!1,Vi=!1,oc=0,vo=0,Zl=null,jN=0;function Lt(){throw Error(a(321))}function oh(r,i){if(i===null)return!1;for(var s=0;s<i.length&&s<r.length;s++)if(!Vn(r[s],i[s]))return!1;return!0}function uh(r,i,s,c,p,v){return na=v,Be=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,H.H=r===null||r.memoizedState===null?db:jh,Vi=!1,v=s(c,p),Vi=!1,Hl&&(v=Tv(i,s,c,p)),Av(r),v}function Av(r){H.H=So;var i=yt!==null&&yt.next!==null;if(na=0,qt=yt=Be=null,sc=!1,vo=0,Zl=null,i)throw Error(a(300));r===null||Ht||(r=r.dependencies,r!==null&&Ju(r)&&(Ht=!0))}function Tv(r,i,s,c){Be=r;var p=0;do{if(Hl&&(Zl=null),vo=0,Hl=!1,25<=p)throw Error(a(301));if(p+=1,qt=yt=null,r.updateQueue!=null){var v=r.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}H.H=fb,v=i(s,c)}while(Hl);return v}function CN(){var r=H.H,i=r.useState()[0];return i=typeof i.then=="function"?bo(i):i,r=r.useState()[0],(yt!==null?yt.memoizedState:null)!==r&&(Be.flags|=1024),i}function ch(){var r=oc!==0;return oc=0,r}function dh(r,i,s){i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~s}function fh(r){if(sc){for(r=r.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}sc=!1}na=0,qt=yt=Be=null,Hl=!1,vo=oc=0,Zl=null}function kn(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return qt===null?Be.memoizedState=qt=r:qt=qt.next=r,qt}function Bt(){if(yt===null){var r=Be.alternate;r=r!==null?r.memoizedState:null}else r=yt.next;var i=qt===null?Be.memoizedState:qt.next;if(i!==null)qt=i,yt=r;else{if(r===null)throw Be.alternate===null?Error(a(467)):Error(a(310));yt=r,r={memoizedState:yt.memoizedState,baseState:yt.baseState,baseQueue:yt.baseQueue,queue:yt.queue,next:null},qt===null?Be.memoizedState=qt=r:qt=qt.next=r}return qt}function uc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function bo(r){var i=vo;return vo+=1,Zl===null&&(Zl=[]),r=xv(Zl,r,i),i=Be,(qt===null?i.memoizedState:qt.next)===null&&(i=i.alternate,H.H=i===null||i.memoizedState===null?db:jh),r}function cc(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return bo(r);if(r.$$typeof===O)return fn(r)}throw Error(a(438,String(r)))}function hh(r){var i=null,s=Be.updateQueue;if(s!==null&&(i=s.memoCache),i==null){var c=Be.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(i={data:c.data.map(function(p){return p.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),s===null&&(s=uc(),Be.updateQueue=s),s.memoCache=i,s=i.data[i.index],s===void 0)for(s=i.data[i.index]=Array(r),c=0;c<r;c++)s[c]=q;return i.index++,s}function ra(r,i){return typeof i=="function"?i(r):i}function dc(r){var i=Bt();return mh(i,yt,r)}function mh(r,i,s){var c=r.queue;if(c===null)throw Error(a(311));c.lastRenderedReducer=s;var p=r.baseQueue,v=c.pending;if(v!==null){if(p!==null){var w=p.next;p.next=v.next,v.next=w}i.baseQueue=p=v,c.pending=null}if(v=r.baseState,p===null)r.memoizedState=v;else{i=p.next;var N=w=null,L=null,G=i,ne=!1;do{var ce=G.lane&-536870913;if(ce!==G.lane?(Xe&ce)===ce:(na&ce)===ce){var Y=G.revertLane;if(Y===0)L!==null&&(L=L.next={lane:0,revertLane:0,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null}),ce===Pl&&(ne=!0);else if((na&Y)===Y){G=G.next,Y===Pl&&(ne=!0);continue}else ce={lane:0,revertLane:G.revertLane,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},L===null?(N=L=ce,w=v):L=L.next=ce,Be.lanes|=Y,qa|=Y;ce=G.action,Vi&&s(v,ce),v=G.hasEagerState?G.eagerState:s(v,ce)}else Y={lane:ce,revertLane:G.revertLane,gesture:G.gesture,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},L===null?(N=L=Y,w=v):L=L.next=Y,Be.lanes|=ce,qa|=ce;G=G.next}while(G!==null&&G!==i);if(L===null?w=v:L.next=N,!Vn(v,r.memoizedState)&&(Ht=!0,ne&&(s=Bl,s!==null)))throw s;r.memoizedState=v,r.baseState=w,r.baseQueue=L,c.lastRenderedState=v}return p===null&&(c.lanes=0),[r.memoizedState,c.dispatch]}function ph(r){var i=Bt(),s=i.queue;if(s===null)throw Error(a(311));s.lastRenderedReducer=r;var c=s.dispatch,p=s.pending,v=i.memoizedState;if(p!==null){s.pending=null;var w=p=p.next;do v=r(v,w.action),w=w.next;while(w!==p);Vn(v,i.memoizedState)||(Ht=!0),i.memoizedState=v,i.baseQueue===null&&(i.baseState=v),s.lastRenderedState=v}return[v,c]}function Rv(r,i,s){var c=Be,p=Bt(),v=tt;if(v){if(s===void 0)throw Error(a(407));s=s()}else s=i();var w=!Vn((yt||p).memoizedState,s);if(w&&(p.memoizedState=s,Ht=!0),p=p.queue,vh(Mv.bind(null,c,p,r),[r]),p.getSnapshot!==i||w||qt!==null&&qt.memoizedState.tag&1){if(c.flags|=2048,Vl(9,{destroy:void 0},Ov.bind(null,c,p,s,i),null),St===null)throw Error(a(349));v||(na&127)!==0||zv(c,i,s)}return s}function zv(r,i,s){r.flags|=16384,r={getSnapshot:i,value:s},i=Be.updateQueue,i===null?(i=uc(),Be.updateQueue=i,i.stores=[r]):(s=i.stores,s===null?i.stores=[r]:s.push(r))}function Ov(r,i,s,c){i.value=s,i.getSnapshot=c,Dv(i)&&Lv(r)}function Mv(r,i,s){return s(function(){Dv(i)&&Lv(r)})}function Dv(r){var i=r.getSnapshot;r=r.value;try{var s=i();return!Vn(r,s)}catch{return!0}}function Lv(r){var i=Ii(r,2);i!==null&&In(i,r,2)}function gh(r){var i=kn();if(typeof r=="function"){var s=r;if(r=s(),Vi){un(!0);try{s()}finally{un(!1)}}}return i.memoizedState=i.baseState=r,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ra,lastRenderedState:r},i}function Iv(r,i,s,c){return r.baseState=s,mh(r,yt,typeof c=="function"?c:ra)}function EN(r,i,s,c,p){if(mc(r))throw Error(a(485));if(r=i.action,r!==null){var v={payload:p,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(w){v.listeners.push(w)}};H.T!==null?s(!0):v.isTransition=!1,c(v),s=i.pending,s===null?(v.next=i.pending=v,Uv(i,v)):(v.next=s.next,i.pending=s.next=v)}}function Uv(r,i){var s=i.action,c=i.payload,p=r.state;if(i.isTransition){var v=H.T,w={};H.T=w;try{var N=s(p,c),L=H.S;L!==null&&L(w,N),Pv(r,i,N)}catch(G){yh(r,i,G)}finally{v!==null&&w.types!==null&&(v.types=w.types),H.T=v}}else try{v=s(p,c),Pv(r,i,v)}catch(G){yh(r,i,G)}}function Pv(r,i,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(c){Bv(r,i,c)},function(c){return yh(r,i,c)}):Bv(r,i,s)}function Bv(r,i,s){i.status="fulfilled",i.value=s,$v(i),r.state=s,i=r.pending,i!==null&&(s=i.next,s===i?r.pending=null:(s=s.next,i.next=s,Uv(r,s)))}function yh(r,i,s){var c=r.pending;if(r.pending=null,c!==null){c=c.next;do i.status="rejected",i.reason=s,$v(i),i=i.next;while(i!==c)}r.action=null}function $v(r){r=r.listeners;for(var i=0;i<r.length;i++)(0,r[i])()}function Fv(r,i){return i}function qv(r,i){if(tt){var s=St.formState;if(s!==null){e:{var c=Be;if(tt){if(Et){t:{for(var p=Et,v=cr;p.nodeType!==8;){if(!v){p=null;break t}if(p=fr(p.nextSibling),p===null){p=null;break t}}v=p.data,p=v==="F!"||v==="F"?p:null}if(p){Et=fr(p.nextSibling),c=p.data==="F!";break e}}Ma(c)}c=!1}c&&(i=s[0])}}return s=kn(),s.memoizedState=s.baseState=i,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fv,lastRenderedState:i},s.queue=c,s=ob.bind(null,Be,c),c.dispatch=s,c=gh(!1),v=kh.bind(null,Be,!1,c.queue),c=kn(),p={state:i,dispatch:null,action:r,pending:null},c.queue=p,s=EN.bind(null,Be,p,v,s),p.dispatch=s,c.memoizedState=r,[i,s,!1]}function Hv(r){var i=Bt();return Zv(i,yt,r)}function Zv(r,i,s){if(i=mh(r,i,Fv)[0],r=dc(ra)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var c=bo(i)}catch(w){throw w===$l?tc:w}else c=i;i=Bt();var p=i.queue,v=p.dispatch;return s!==i.memoizedState&&(Be.flags|=2048,Vl(9,{destroy:void 0},NN.bind(null,p,s),null)),[c,v,r]}function NN(r,i){r.action=i}function Vv(r){var i=Bt(),s=yt;if(s!==null)return Zv(i,s,r);Bt(),i=i.memoizedState,s=Bt();var c=s.queue.dispatch;return s.memoizedState=r,[i,c,!1]}function Vl(r,i,s,c){return r={tag:r,create:s,deps:c,inst:i,next:null},i=Be.updateQueue,i===null&&(i=uc(),Be.updateQueue=i),s=i.lastEffect,s===null?i.lastEffect=r.next=r:(c=s.next,s.next=r,r.next=c,i.lastEffect=r),r}function Qv(){return Bt().memoizedState}function fc(r,i,s,c){var p=kn();Be.flags|=r,p.memoizedState=Vl(1|i,{destroy:void 0},s,c===void 0?null:c)}function hc(r,i,s,c){var p=Bt();c=c===void 0?null:c;var v=p.memoizedState.inst;yt!==null&&c!==null&&oh(c,yt.memoizedState.deps)?p.memoizedState=Vl(i,v,s,c):(Be.flags|=r,p.memoizedState=Vl(1|i,v,s,c))}function Gv(r,i){fc(8390656,8,r,i)}function vh(r,i){hc(2048,8,r,i)}function _N(r){Be.flags|=4;var i=Be.updateQueue;if(i===null)i=uc(),Be.updateQueue=i,i.events=[r];else{var s=i.events;s===null?i.events=[r]:s.push(r)}}function Kv(r){var i=Bt().memoizedState;return _N({ref:i,nextImpl:r}),function(){if((ct&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function Yv(r,i){return hc(4,2,r,i)}function Xv(r,i){return hc(4,4,r,i)}function Jv(r,i){if(typeof i=="function"){r=r();var s=i(r);return function(){typeof s=="function"?s():i(null)}}if(i!=null)return r=r(),i.current=r,function(){i.current=null}}function Wv(r,i,s){s=s!=null?s.concat([r]):null,hc(4,4,Jv.bind(null,i,r),s)}function bh(){}function eb(r,i){var s=Bt();i=i===void 0?null:i;var c=s.memoizedState;return i!==null&&oh(i,c[1])?c[0]:(s.memoizedState=[r,i],r)}function tb(r,i){var s=Bt();i=i===void 0?null:i;var c=s.memoizedState;if(i!==null&&oh(i,c[1]))return c[0];if(c=r(),Vi){un(!0);try{r()}finally{un(!1)}}return s.memoizedState=[c,i],c}function xh(r,i,s){return s===void 0||(na&1073741824)!==0&&(Xe&261930)===0?r.memoizedState=i:(r.memoizedState=s,r=nx(),Be.lanes|=r,qa|=r,s)}function nb(r,i,s,c){return Vn(s,i)?s:ql.current!==null?(r=xh(r,s,c),Vn(r,i)||(Ht=!0),r):(na&42)===0||(na&1073741824)!==0&&(Xe&261930)===0?(Ht=!0,r.memoizedState=s):(r=nx(),Be.lanes|=r,qa|=r,i)}function rb(r,i,s,c,p){var v=re.p;re.p=v!==0&&8>v?v:8;var w=H.T,N={};H.T=N,kh(r,!1,i,s);try{var L=p(),G=H.S;if(G!==null&&G(N,L),L!==null&&typeof L=="object"&&typeof L.then=="function"){var ne=kN(L,c);xo(r,i,ne,Jn(r))}else xo(r,i,c,Jn(r))}catch(ce){xo(r,i,{then:function(){},status:"rejected",reason:ce},Jn())}finally{re.p=v,w!==null&&N.types!==null&&(w.types=N.types),H.T=w}}function AN(){}function Sh(r,i,s,c){if(r.tag!==5)throw Error(a(476));var p=ab(r).queue;rb(r,p,i,K,s===null?AN:function(){return ib(r),s(c)})}function ab(r){var i=r.memoizedState;if(i!==null)return i;i={memoizedState:K,baseState:K,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ra,lastRenderedState:K},next:null};var s={};return i.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ra,lastRenderedState:s},next:null},r.memoizedState=i,r=r.alternate,r!==null&&(r.memoizedState=i),i}function ib(r){var i=ab(r);i.next===null&&(i=r.alternate.memoizedState),xo(r,i.next.queue,{},Jn())}function wh(){return fn(Io)}function lb(){return Bt().memoizedState}function sb(){return Bt().memoizedState}function TN(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var s=Jn();r=Ia(s);var c=Ua(i,r,s);c!==null&&(In(c,i,s),po(c,i,s)),i={cache:Xf()},r.payload=i;return}i=i.return}}function RN(r,i,s){var c=Jn();s={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},mc(r)?ub(i,s):(s=Bf(r,i,s,c),s!==null&&(In(s,r,c),cb(s,i,c)))}function ob(r,i,s){var c=Jn();xo(r,i,s,c)}function xo(r,i,s,c){var p={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(mc(r))ub(i,p);else{var v=r.alternate;if(r.lanes===0&&(v===null||v.lanes===0)&&(v=i.lastRenderedReducer,v!==null))try{var w=i.lastRenderedState,N=v(w,s);if(p.hasEagerState=!0,p.eagerState=N,Vn(N,w))return Gu(r,i,p,0),St===null&&Qu(),!1}catch{}finally{}if(s=Bf(r,i,p,c),s!==null)return In(s,r,c),cb(s,i,c),!0}return!1}function kh(r,i,s,c){if(c={lane:2,revertLane:tm(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},mc(r)){if(i)throw Error(a(479))}else i=Bf(r,s,c,2),i!==null&&In(i,r,2)}function mc(r){var i=r.alternate;return r===Be||i!==null&&i===Be}function ub(r,i){Hl=sc=!0;var s=r.pending;s===null?i.next=i:(i.next=s.next,s.next=i),r.pending=i}function cb(r,i,s){if((s&4194048)!==0){var c=i.lanes;c&=r.pendingLanes,s|=c,i.lanes=s,py(r,s)}}var So={readContext:fn,use:cc,useCallback:Lt,useContext:Lt,useEffect:Lt,useImperativeHandle:Lt,useLayoutEffect:Lt,useInsertionEffect:Lt,useMemo:Lt,useReducer:Lt,useRef:Lt,useState:Lt,useDebugValue:Lt,useDeferredValue:Lt,useTransition:Lt,useSyncExternalStore:Lt,useId:Lt,useHostTransitionStatus:Lt,useFormState:Lt,useActionState:Lt,useOptimistic:Lt,useMemoCache:Lt,useCacheRefresh:Lt};So.useEffectEvent=Lt;var db={readContext:fn,use:cc,useCallback:function(r,i){return kn().memoizedState=[r,i===void 0?null:i],r},useContext:fn,useEffect:Gv,useImperativeHandle:function(r,i,s){s=s!=null?s.concat([r]):null,fc(4194308,4,Jv.bind(null,i,r),s)},useLayoutEffect:function(r,i){return fc(4194308,4,r,i)},useInsertionEffect:function(r,i){fc(4,2,r,i)},useMemo:function(r,i){var s=kn();i=i===void 0?null:i;var c=r();if(Vi){un(!0);try{r()}finally{un(!1)}}return s.memoizedState=[c,i],c},useReducer:function(r,i,s){var c=kn();if(s!==void 0){var p=s(i);if(Vi){un(!0);try{s(i)}finally{un(!1)}}}else p=i;return c.memoizedState=c.baseState=p,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:p},c.queue=r,r=r.dispatch=RN.bind(null,Be,r),[c.memoizedState,r]},useRef:function(r){var i=kn();return r={current:r},i.memoizedState=r},useState:function(r){r=gh(r);var i=r.queue,s=ob.bind(null,Be,i);return i.dispatch=s,[r.memoizedState,s]},useDebugValue:bh,useDeferredValue:function(r,i){var s=kn();return xh(s,r,i)},useTransition:function(){var r=gh(!1);return r=rb.bind(null,Be,r.queue,!0,!1),kn().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,i,s){var c=Be,p=kn();if(tt){if(s===void 0)throw Error(a(407));s=s()}else{if(s=i(),St===null)throw Error(a(349));(Xe&127)!==0||zv(c,i,s)}p.memoizedState=s;var v={value:s,getSnapshot:i};return p.queue=v,Gv(Mv.bind(null,c,v,r),[r]),c.flags|=2048,Vl(9,{destroy:void 0},Ov.bind(null,c,v,s,i),null),s},useId:function(){var r=kn(),i=St.identifierPrefix;if(tt){var s=Or,c=zr;s=(c&~(1<<32-dt(c)-1)).toString(32)+s,i="_"+i+"R_"+s,s=oc++,0<s&&(i+="H"+s.toString(32)),i+="_"}else s=jN++,i="_"+i+"r_"+s.toString(32)+"_";return r.memoizedState=i},useHostTransitionStatus:wh,useFormState:qv,useActionState:qv,useOptimistic:function(r){var i=kn();i.memoizedState=i.baseState=r;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=s,i=kh.bind(null,Be,!0,s),s.dispatch=i,[r,i]},useMemoCache:hh,useCacheRefresh:function(){return kn().memoizedState=TN.bind(null,Be)},useEffectEvent:function(r){var i=kn(),s={impl:r};return i.memoizedState=s,function(){if((ct&2)!==0)throw Error(a(440));return s.impl.apply(void 0,arguments)}}},jh={readContext:fn,use:cc,useCallback:eb,useContext:fn,useEffect:vh,useImperativeHandle:Wv,useInsertionEffect:Yv,useLayoutEffect:Xv,useMemo:tb,useReducer:dc,useRef:Qv,useState:function(){return dc(ra)},useDebugValue:bh,useDeferredValue:function(r,i){var s=Bt();return nb(s,yt.memoizedState,r,i)},useTransition:function(){var r=dc(ra)[0],i=Bt().memoizedState;return[typeof r=="boolean"?r:bo(r),i]},useSyncExternalStore:Rv,useId:lb,useHostTransitionStatus:wh,useFormState:Hv,useActionState:Hv,useOptimistic:function(r,i){var s=Bt();return Iv(s,yt,r,i)},useMemoCache:hh,useCacheRefresh:sb};jh.useEffectEvent=Kv;var fb={readContext:fn,use:cc,useCallback:eb,useContext:fn,useEffect:vh,useImperativeHandle:Wv,useInsertionEffect:Yv,useLayoutEffect:Xv,useMemo:tb,useReducer:ph,useRef:Qv,useState:function(){return ph(ra)},useDebugValue:bh,useDeferredValue:function(r,i){var s=Bt();return yt===null?xh(s,r,i):nb(s,yt.memoizedState,r,i)},useTransition:function(){var r=ph(ra)[0],i=Bt().memoizedState;return[typeof r=="boolean"?r:bo(r),i]},useSyncExternalStore:Rv,useId:lb,useHostTransitionStatus:wh,useFormState:Vv,useActionState:Vv,useOptimistic:function(r,i){var s=Bt();return yt!==null?Iv(s,yt,r,i):(s.baseState=r,[r,s.queue.dispatch])},useMemoCache:hh,useCacheRefresh:sb};fb.useEffectEvent=Kv;function Ch(r,i,s,c){i=r.memoizedState,s=s(c,i),s=s==null?i:y({},i,s),r.memoizedState=s,r.lanes===0&&(r.updateQueue.baseState=s)}var Eh={enqueueSetState:function(r,i,s){r=r._reactInternals;var c=Jn(),p=Ia(c);p.payload=i,s!=null&&(p.callback=s),i=Ua(r,p,c),i!==null&&(In(i,r,c),po(i,r,c))},enqueueReplaceState:function(r,i,s){r=r._reactInternals;var c=Jn(),p=Ia(c);p.tag=1,p.payload=i,s!=null&&(p.callback=s),i=Ua(r,p,c),i!==null&&(In(i,r,c),po(i,r,c))},enqueueForceUpdate:function(r,i){r=r._reactInternals;var s=Jn(),c=Ia(s);c.tag=2,i!=null&&(c.callback=i),i=Ua(r,c,s),i!==null&&(In(i,r,s),po(i,r,s))}};function hb(r,i,s,c,p,v,w){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(c,v,w):i.prototype&&i.prototype.isPureReactComponent?!lo(s,c)||!lo(p,v):!0}function mb(r,i,s,c){r=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(s,c),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(s,c),i.state!==r&&Eh.enqueueReplaceState(i,i.state,null)}function Qi(r,i){var s=i;if("ref"in i){s={};for(var c in i)c!=="ref"&&(s[c]=i[c])}if(r=r.defaultProps){s===i&&(s=y({},s));for(var p in r)s[p]===void 0&&(s[p]=r[p])}return s}function pb(r){Vu(r)}function gb(r){console.error(r)}function yb(r){Vu(r)}function pc(r,i){try{var s=r.onUncaughtError;s(i.value,{componentStack:i.stack})}catch(c){setTimeout(function(){throw c})}}function vb(r,i,s){try{var c=r.onCaughtError;c(s.value,{componentStack:s.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function Nh(r,i,s){return s=Ia(s),s.tag=3,s.payload={element:null},s.callback=function(){pc(r,i)},s}function bb(r){return r=Ia(r),r.tag=3,r}function xb(r,i,s,c){var p=s.type.getDerivedStateFromError;if(typeof p=="function"){var v=c.value;r.payload=function(){return p(v)},r.callback=function(){vb(i,s,c)}}var w=s.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(r.callback=function(){vb(i,s,c),typeof p!="function"&&(Ha===null?Ha=new Set([this]):Ha.add(this));var N=c.stack;this.componentDidCatch(c.value,{componentStack:N!==null?N:""})})}function zN(r,i,s,c,p){if(s.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(i=s.alternate,i!==null&&Ul(i,s,p,!0),s=Gn.current,s!==null){switch(s.tag){case 31:case 13:return dr===null?Nc():s.alternate===null&&It===0&&(It=3),s.flags&=-257,s.flags|=65536,s.lanes=p,c===nc?s.flags|=16384:(i=s.updateQueue,i===null?s.updateQueue=new Set([c]):i.add(c),Jh(r,c,p)),!1;case 22:return s.flags|=65536,c===nc?s.flags|=16384:(i=s.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([c])},s.updateQueue=i):(s=i.retryQueue,s===null?i.retryQueue=new Set([c]):s.add(c)),Jh(r,c,p)),!1}throw Error(a(435,s.tag))}return Jh(r,c,p),Nc(),!1}if(tt)return i=Gn.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=p,c!==Vf&&(r=Error(a(422),{cause:c}),uo(sr(r,s)))):(c!==Vf&&(i=Error(a(423),{cause:c}),uo(sr(i,s))),r=r.current.alternate,r.flags|=65536,p&=-p,r.lanes|=p,c=sr(c,s),p=Nh(r.stateNode,c,p),rh(r,p),It!==4&&(It=2)),!1;var v=Error(a(520),{cause:c});if(v=sr(v,s),Ao===null?Ao=[v]:Ao.push(v),It!==4&&(It=2),i===null)return!0;c=sr(c,s),s=i;do{switch(s.tag){case 3:return s.flags|=65536,r=p&-p,s.lanes|=r,r=Nh(s.stateNode,c,r),rh(s,r),!1;case 1:if(i=s.type,v=s.stateNode,(s.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Ha===null||!Ha.has(v))))return s.flags|=65536,p&=-p,s.lanes|=p,p=bb(p),xb(p,r,s,c),rh(s,p),!1}s=s.return}while(s!==null);return!1}var _h=Error(a(461)),Ht=!1;function hn(r,i,s,c){i.child=r===null?jv(i,null,s,c):Zi(i,r.child,s,c)}function Sb(r,i,s,c,p){s=s.render;var v=i.ref;if("ref"in c){var w={};for(var N in c)N!=="ref"&&(w[N]=c[N])}else w=c;return $i(i),c=uh(r,i,s,w,v,p),N=ch(),r!==null&&!Ht?(dh(r,i,p),aa(r,i,p)):(tt&&N&&Hf(i),i.flags|=1,hn(r,i,c,p),i.child)}function wb(r,i,s,c,p){if(r===null){var v=s.type;return typeof v=="function"&&!$f(v)&&v.defaultProps===void 0&&s.compare===null?(i.tag=15,i.type=v,kb(r,i,v,c,p)):(r=Yu(s.type,null,c,i,i.mode,p),r.ref=i.ref,r.return=i,i.child=r)}if(v=r.child,!Lh(r,p)){var w=v.memoizedProps;if(s=s.compare,s=s!==null?s:lo,s(w,c)&&r.ref===i.ref)return aa(r,i,p)}return i.flags|=1,r=Jr(v,c),r.ref=i.ref,r.return=i,i.child=r}function kb(r,i,s,c,p){if(r!==null){var v=r.memoizedProps;if(lo(v,c)&&r.ref===i.ref)if(Ht=!1,i.pendingProps=c=v,Lh(r,p))(r.flags&131072)!==0&&(Ht=!0);else return i.lanes=r.lanes,aa(r,i,p)}return Ah(r,i,s,c,p)}function jb(r,i,s,c){var p=c.children,v=r!==null?r.memoizedState:null;if(r===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((i.flags&128)!==0){if(v=v!==null?v.baseLanes|s:s,r!==null){for(c=i.child=r.child,p=0;c!==null;)p=p|c.lanes|c.childLanes,c=c.sibling;c=p&~v}else c=0,i.child=null;return Cb(r,i,v,s,c)}if((s&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},r!==null&&ec(i,v!==null?v.cachePool:null),v!==null?Nv(i,v):ih(),_v(i);else return c=i.lanes=536870912,Cb(r,i,v!==null?v.baseLanes|s:s,s,c)}else v!==null?(ec(i,v.cachePool),Nv(i,v),Ba(),i.memoizedState=null):(r!==null&&ec(i,null),ih(),Ba());return hn(r,i,p,s),i.child}function wo(r,i){return r!==null&&r.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function Cb(r,i,s,c,p){var v=Wf();return v=v===null?null:{parent:Ft._currentValue,pool:v},i.memoizedState={baseLanes:s,cachePool:v},r!==null&&ec(i,null),ih(),_v(i),r!==null&&Ul(r,i,c,!0),i.childLanes=p,null}function gc(r,i){return i=vc({mode:i.mode,children:i.children},r.mode),i.ref=r.ref,r.child=i,i.return=r,i}function Eb(r,i,s){return Zi(i,r.child,null,s),r=gc(i,i.pendingProps),r.flags|=2,Kn(i),i.memoizedState=null,r}function ON(r,i,s){var c=i.pendingProps,p=(i.flags&128)!==0;if(i.flags&=-129,r===null){if(tt){if(c.mode==="hidden")return r=gc(i,c),i.lanes=536870912,wo(null,r);if(sh(i),(r=Et)?(r=Ux(r,cr),r=r!==null&&r.data==="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:za!==null?{id:zr,overflow:Or}:null,retryLane:536870912,hydrationErrors:null},s=uv(r),s.return=i,i.child=s,dn=i,Et=null)):r=null,r===null)throw Ma(i);return i.lanes=536870912,null}return gc(i,c)}var v=r.memoizedState;if(v!==null){var w=v.dehydrated;if(sh(i),p)if(i.flags&256)i.flags&=-257,i=Eb(r,i,s);else if(i.memoizedState!==null)i.child=r.child,i.flags|=128,i=null;else throw Error(a(558));else if(Ht||Ul(r,i,s,!1),p=(s&r.childLanes)!==0,Ht||p){if(c=St,c!==null&&(w=gy(c,s),w!==0&&w!==v.retryLane))throw v.retryLane=w,Ii(r,w),In(c,r,w),_h;Nc(),i=Eb(r,i,s)}else r=v.treeContext,Et=fr(w.nextSibling),dn=i,tt=!0,Oa=null,cr=!1,r!==null&&fv(i,r),i=gc(i,c),i.flags|=4096;return i}return r=Jr(r.child,{mode:c.mode,children:c.children}),r.ref=i.ref,i.child=r,r.return=i,r}function yc(r,i){var s=i.ref;if(s===null)r!==null&&r.ref!==null&&(i.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(a(284));(r===null||r.ref!==s)&&(i.flags|=4194816)}}function Ah(r,i,s,c,p){return $i(i),s=uh(r,i,s,c,void 0,p),c=ch(),r!==null&&!Ht?(dh(r,i,p),aa(r,i,p)):(tt&&c&&Hf(i),i.flags|=1,hn(r,i,s,p),i.child)}function Nb(r,i,s,c,p,v){return $i(i),i.updateQueue=null,s=Tv(i,c,s,p),Av(r),c=ch(),r!==null&&!Ht?(dh(r,i,v),aa(r,i,v)):(tt&&c&&Hf(i),i.flags|=1,hn(r,i,s,v),i.child)}function _b(r,i,s,c,p){if($i(i),i.stateNode===null){var v=Ml,w=s.contextType;typeof w=="object"&&w!==null&&(v=fn(w)),v=new s(c,v),i.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=Eh,i.stateNode=v,v._reactInternals=i,v=i.stateNode,v.props=c,v.state=i.memoizedState,v.refs={},th(i),w=s.contextType,v.context=typeof w=="object"&&w!==null?fn(w):Ml,v.state=i.memoizedState,w=s.getDerivedStateFromProps,typeof w=="function"&&(Ch(i,s,w,c),v.state=i.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(w=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),w!==v.state&&Eh.enqueueReplaceState(v,v.state,null),yo(i,c,v,p),go(),v.state=i.memoizedState),typeof v.componentDidMount=="function"&&(i.flags|=4194308),c=!0}else if(r===null){v=i.stateNode;var N=i.memoizedProps,L=Qi(s,N);v.props=L;var G=v.context,ne=s.contextType;w=Ml,typeof ne=="object"&&ne!==null&&(w=fn(ne));var ce=s.getDerivedStateFromProps;ne=typeof ce=="function"||typeof v.getSnapshotBeforeUpdate=="function",N=i.pendingProps!==N,ne||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(N||G!==w)&&mb(i,v,c,w),La=!1;var Y=i.memoizedState;v.state=Y,yo(i,c,v,p),go(),G=i.memoizedState,N||Y!==G||La?(typeof ce=="function"&&(Ch(i,s,ce,c),G=i.memoizedState),(L=La||hb(i,s,L,c,Y,G,w))?(ne||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(i.flags|=4194308)):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=c,i.memoizedState=G),v.props=c,v.state=G,v.context=w,c=L):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),c=!1)}else{v=i.stateNode,nh(r,i),w=i.memoizedProps,ne=Qi(s,w),v.props=ne,ce=i.pendingProps,Y=v.context,G=s.contextType,L=Ml,typeof G=="object"&&G!==null&&(L=fn(G)),N=s.getDerivedStateFromProps,(G=typeof N=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(w!==ce||Y!==L)&&mb(i,v,c,L),La=!1,Y=i.memoizedState,v.state=Y,yo(i,c,v,p),go();var J=i.memoizedState;w!==ce||Y!==J||La||r!==null&&r.dependencies!==null&&Ju(r.dependencies)?(typeof N=="function"&&(Ch(i,s,N,c),J=i.memoizedState),(ne=La||hb(i,s,ne,c,Y,J,L)||r!==null&&r.dependencies!==null&&Ju(r.dependencies))?(G||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(c,J,L),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(c,J,L)),typeof v.componentDidUpdate=="function"&&(i.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof v.componentDidUpdate!="function"||w===r.memoizedProps&&Y===r.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||w===r.memoizedProps&&Y===r.memoizedState||(i.flags|=1024),i.memoizedProps=c,i.memoizedState=J),v.props=c,v.state=J,v.context=L,c=ne):(typeof v.componentDidUpdate!="function"||w===r.memoizedProps&&Y===r.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||w===r.memoizedProps&&Y===r.memoizedState||(i.flags|=1024),c=!1)}return v=c,yc(r,i),c=(i.flags&128)!==0,v||c?(v=i.stateNode,s=c&&typeof s.getDerivedStateFromError!="function"?null:v.render(),i.flags|=1,r!==null&&c?(i.child=Zi(i,r.child,null,p),i.child=Zi(i,null,s,p)):hn(r,i,s,p),i.memoizedState=v.state,r=i.child):r=aa(r,i,p),r}function Ab(r,i,s,c){return Pi(),i.flags|=256,hn(r,i,s,c),i.child}var Th={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Rh(r){return{baseLanes:r,cachePool:vv()}}function zh(r,i,s){return r=r!==null?r.childLanes&~s:0,i&&(r|=Xn),r}function Tb(r,i,s){var c=i.pendingProps,p=!1,v=(i.flags&128)!==0,w;if((w=v)||(w=r!==null&&r.memoizedState===null?!1:(Pt.current&2)!==0),w&&(p=!0,i.flags&=-129),w=(i.flags&32)!==0,i.flags&=-33,r===null){if(tt){if(p?Pa(i):Ba(),(r=Et)?(r=Ux(r,cr),r=r!==null&&r.data!=="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:za!==null?{id:zr,overflow:Or}:null,retryLane:536870912,hydrationErrors:null},s=uv(r),s.return=i,i.child=s,dn=i,Et=null)):r=null,r===null)throw Ma(i);return mm(r)?i.lanes=32:i.lanes=536870912,null}var N=c.children;return c=c.fallback,p?(Ba(),p=i.mode,N=vc({mode:"hidden",children:N},p),c=Ui(c,p,s,null),N.return=i,c.return=i,N.sibling=c,i.child=N,c=i.child,c.memoizedState=Rh(s),c.childLanes=zh(r,w,s),i.memoizedState=Th,wo(null,c)):(Pa(i),Oh(i,N))}var L=r.memoizedState;if(L!==null&&(N=L.dehydrated,N!==null)){if(v)i.flags&256?(Pa(i),i.flags&=-257,i=Mh(r,i,s)):i.memoizedState!==null?(Ba(),i.child=r.child,i.flags|=128,i=null):(Ba(),N=c.fallback,p=i.mode,c=vc({mode:"visible",children:c.children},p),N=Ui(N,p,s,null),N.flags|=2,c.return=i,N.return=i,c.sibling=N,i.child=c,Zi(i,r.child,null,s),c=i.child,c.memoizedState=Rh(s),c.childLanes=zh(r,w,s),i.memoizedState=Th,i=wo(null,c));else if(Pa(i),mm(N)){if(w=N.nextSibling&&N.nextSibling.dataset,w)var G=w.dgst;w=G,c=Error(a(419)),c.stack="",c.digest=w,uo({value:c,source:null,stack:null}),i=Mh(r,i,s)}else if(Ht||Ul(r,i,s,!1),w=(s&r.childLanes)!==0,Ht||w){if(w=St,w!==null&&(c=gy(w,s),c!==0&&c!==L.retryLane))throw L.retryLane=c,Ii(r,c),In(w,r,c),_h;hm(N)||Nc(),i=Mh(r,i,s)}else hm(N)?(i.flags|=192,i.child=r.child,i=null):(r=L.treeContext,Et=fr(N.nextSibling),dn=i,tt=!0,Oa=null,cr=!1,r!==null&&fv(i,r),i=Oh(i,c.children),i.flags|=4096);return i}return p?(Ba(),N=c.fallback,p=i.mode,L=r.child,G=L.sibling,c=Jr(L,{mode:"hidden",children:c.children}),c.subtreeFlags=L.subtreeFlags&65011712,G!==null?N=Jr(G,N):(N=Ui(N,p,s,null),N.flags|=2),N.return=i,c.return=i,c.sibling=N,i.child=c,wo(null,c),c=i.child,N=r.child.memoizedState,N===null?N=Rh(s):(p=N.cachePool,p!==null?(L=Ft._currentValue,p=p.parent!==L?{parent:L,pool:L}:p):p=vv(),N={baseLanes:N.baseLanes|s,cachePool:p}),c.memoizedState=N,c.childLanes=zh(r,w,s),i.memoizedState=Th,wo(r.child,c)):(Pa(i),s=r.child,r=s.sibling,s=Jr(s,{mode:"visible",children:c.children}),s.return=i,s.sibling=null,r!==null&&(w=i.deletions,w===null?(i.deletions=[r],i.flags|=16):w.push(r)),i.child=s,i.memoizedState=null,s)}function Oh(r,i){return i=vc({mode:"visible",children:i},r.mode),i.return=r,r.child=i}function vc(r,i){return r=Qn(22,r,null,i),r.lanes=0,r}function Mh(r,i,s){return Zi(i,r.child,null,s),r=Oh(i,i.pendingProps.children),r.flags|=2,i.memoizedState=null,r}function Rb(r,i,s){r.lanes|=i;var c=r.alternate;c!==null&&(c.lanes|=i),Kf(r.return,i,s)}function Dh(r,i,s,c,p,v){var w=r.memoizedState;w===null?r.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:c,tail:s,tailMode:p,treeForkCount:v}:(w.isBackwards=i,w.rendering=null,w.renderingStartTime=0,w.last=c,w.tail=s,w.tailMode=p,w.treeForkCount=v)}function zb(r,i,s){var c=i.pendingProps,p=c.revealOrder,v=c.tail;c=c.children;var w=Pt.current,N=(w&2)!==0;if(N?(w=w&1|2,i.flags|=128):w&=1,_(Pt,w),hn(r,i,c,s),c=tt?oo:0,!N&&r!==null&&(r.flags&128)!==0)e:for(r=i.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&Rb(r,s,i);else if(r.tag===19)Rb(r,s,i);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break e;for(;r.sibling===null;){if(r.return===null||r.return===i)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(p){case"forwards":for(s=i.child,p=null;s!==null;)r=s.alternate,r!==null&&lc(r)===null&&(p=s),s=s.sibling;s=p,s===null?(p=i.child,i.child=null):(p=s.sibling,s.sibling=null),Dh(i,!1,p,s,v,c);break;case"backwards":case"unstable_legacy-backwards":for(s=null,p=i.child,i.child=null;p!==null;){if(r=p.alternate,r!==null&&lc(r)===null){i.child=p;break}r=p.sibling,p.sibling=s,s=p,p=r}Dh(i,!0,s,null,v,c);break;case"together":Dh(i,!1,null,null,void 0,c);break;default:i.memoizedState=null}return i.child}function aa(r,i,s){if(r!==null&&(i.dependencies=r.dependencies),qa|=i.lanes,(s&i.childLanes)===0)if(r!==null){if(Ul(r,i,s,!1),(s&i.childLanes)===0)return null}else return null;if(r!==null&&i.child!==r.child)throw Error(a(153));if(i.child!==null){for(r=i.child,s=Jr(r,r.pendingProps),i.child=s,s.return=i;r.sibling!==null;)r=r.sibling,s=s.sibling=Jr(r,r.pendingProps),s.return=i;s.sibling=null}return i.child}function Lh(r,i){return(r.lanes&i)!==0?!0:(r=r.dependencies,!!(r!==null&&Ju(r)))}function MN(r,i,s){switch(i.tag){case 3:De(i,i.stateNode.containerInfo),Da(i,Ft,r.memoizedState.cache),Pi();break;case 27:case 5:ut(i);break;case 4:De(i,i.stateNode.containerInfo);break;case 10:Da(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,sh(i),null;break;case 13:var c=i.memoizedState;if(c!==null)return c.dehydrated!==null?(Pa(i),i.flags|=128,null):(s&i.child.childLanes)!==0?Tb(r,i,s):(Pa(i),r=aa(r,i,s),r!==null?r.sibling:null);Pa(i);break;case 19:var p=(r.flags&128)!==0;if(c=(s&i.childLanes)!==0,c||(Ul(r,i,s,!1),c=(s&i.childLanes)!==0),p){if(c)return zb(r,i,s);i.flags|=128}if(p=i.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),_(Pt,Pt.current),c)break;return null;case 22:return i.lanes=0,jb(r,i,s,i.pendingProps);case 24:Da(i,Ft,r.memoizedState.cache)}return aa(r,i,s)}function Ob(r,i,s){if(r!==null)if(r.memoizedProps!==i.pendingProps)Ht=!0;else{if(!Lh(r,s)&&(i.flags&128)===0)return Ht=!1,MN(r,i,s);Ht=(r.flags&131072)!==0}else Ht=!1,tt&&(i.flags&1048576)!==0&&dv(i,oo,i.index);switch(i.lanes=0,i.tag){case 16:e:{var c=i.pendingProps;if(r=qi(i.elementType),i.type=r,typeof r=="function")$f(r)?(c=Qi(r,c),i.tag=1,i=_b(null,i,r,c,s)):(i.tag=0,i=Ah(null,i,r,c,s));else{if(r!=null){var p=r.$$typeof;if(p===B){i.tag=11,i=Sb(null,i,r,c,s);break e}else if(p===D){i.tag=14,i=wb(null,i,r,c,s);break e}}throw i=de(r)||r,Error(a(306,i,""))}}return i;case 0:return Ah(r,i,i.type,i.pendingProps,s);case 1:return c=i.type,p=Qi(c,i.pendingProps),_b(r,i,c,p,s);case 3:e:{if(De(i,i.stateNode.containerInfo),r===null)throw Error(a(387));c=i.pendingProps;var v=i.memoizedState;p=v.element,nh(r,i),yo(i,c,null,s);var w=i.memoizedState;if(c=w.cache,Da(i,Ft,c),c!==v.cache&&Yf(i,[Ft],s,!0),go(),c=w.element,v.isDehydrated)if(v={element:c,isDehydrated:!1,cache:w.cache},i.updateQueue.baseState=v,i.memoizedState=v,i.flags&256){i=Ab(r,i,c,s);break e}else if(c!==p){p=sr(Error(a(424)),i),uo(p),i=Ab(r,i,c,s);break e}else{switch(r=i.stateNode.containerInfo,r.nodeType){case 9:r=r.body;break;default:r=r.nodeName==="HTML"?r.ownerDocument.body:r}for(Et=fr(r.firstChild),dn=i,tt=!0,Oa=null,cr=!0,s=jv(i,null,c,s),i.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(Pi(),c===p){i=aa(r,i,s);break e}hn(r,i,c,s)}i=i.child}return i;case 26:return yc(r,i),r===null?(s=Hx(i.type,null,i.pendingProps,null))?i.memoizedState=s:tt||(s=i.type,r=i.pendingProps,c=Mc(ue.current).createElement(s),c[cn]=i,c[Rn]=r,mn(c,s,r),Wt(c),i.stateNode=c):i.memoizedState=Hx(i.type,r.memoizedProps,i.pendingProps,r.memoizedState),null;case 27:return ut(i),r===null&&tt&&(c=i.stateNode=$x(i.type,i.pendingProps,ue.current),dn=i,cr=!0,p=Et,Ga(i.type)?(pm=p,Et=fr(c.firstChild)):Et=p),hn(r,i,i.pendingProps.children,s),yc(r,i),r===null&&(i.flags|=4194304),i.child;case 5:return r===null&&tt&&((p=c=Et)&&(c=c_(c,i.type,i.pendingProps,cr),c!==null?(i.stateNode=c,dn=i,Et=fr(c.firstChild),cr=!1,p=!0):p=!1),p||Ma(i)),ut(i),p=i.type,v=i.pendingProps,w=r!==null?r.memoizedProps:null,c=v.children,cm(p,v)?c=null:w!==null&&cm(p,w)&&(i.flags|=32),i.memoizedState!==null&&(p=uh(r,i,CN,null,null,s),Io._currentValue=p),yc(r,i),hn(r,i,c,s),i.child;case 6:return r===null&&tt&&((r=s=Et)&&(s=d_(s,i.pendingProps,cr),s!==null?(i.stateNode=s,dn=i,Et=null,r=!0):r=!1),r||Ma(i)),null;case 13:return Tb(r,i,s);case 4:return De(i,i.stateNode.containerInfo),c=i.pendingProps,r===null?i.child=Zi(i,null,c,s):hn(r,i,c,s),i.child;case 11:return Sb(r,i,i.type,i.pendingProps,s);case 7:return hn(r,i,i.pendingProps,s),i.child;case 8:return hn(r,i,i.pendingProps.children,s),i.child;case 12:return hn(r,i,i.pendingProps.children,s),i.child;case 10:return c=i.pendingProps,Da(i,i.type,c.value),hn(r,i,c.children,s),i.child;case 9:return p=i.type._context,c=i.pendingProps.children,$i(i),p=fn(p),c=c(p),i.flags|=1,hn(r,i,c,s),i.child;case 14:return wb(r,i,i.type,i.pendingProps,s);case 15:return kb(r,i,i.type,i.pendingProps,s);case 19:return zb(r,i,s);case 31:return ON(r,i,s);case 22:return jb(r,i,s,i.pendingProps);case 24:return $i(i),c=fn(Ft),r===null?(p=Wf(),p===null&&(p=St,v=Xf(),p.pooledCache=v,v.refCount++,v!==null&&(p.pooledCacheLanes|=s),p=v),i.memoizedState={parent:c,cache:p},th(i),Da(i,Ft,p)):((r.lanes&s)!==0&&(nh(r,i),yo(i,null,null,s),go()),p=r.memoizedState,v=i.memoizedState,p.parent!==c?(p={parent:c,cache:c},i.memoizedState=p,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=p),Da(i,Ft,c)):(c=v.cache,Da(i,Ft,c),c!==p.cache&&Yf(i,[Ft],s,!0))),hn(r,i,i.pendingProps.children,s),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function ia(r){r.flags|=4}function Ih(r,i,s,c,p){if((i=(r.mode&32)!==0)&&(i=!1),i){if(r.flags|=16777216,(p&335544128)===p)if(r.stateNode.complete)r.flags|=8192;else if(lx())r.flags|=8192;else throw Hi=nc,eh}else r.flags&=-16777217}function Mb(r,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!Kx(i))if(lx())r.flags|=8192;else throw Hi=nc,eh}function bc(r,i){i!==null&&(r.flags|=4),r.flags&16384&&(i=r.tag!==22?Tn():536870912,r.lanes|=i,Yl|=i)}function ko(r,i){if(!tt)switch(r.tailMode){case"hidden":i=r.tail;for(var s=null;i!==null;)i.alternate!==null&&(s=i),i=i.sibling;s===null?r.tail=null:s.sibling=null;break;case"collapsed":s=r.tail;for(var c=null;s!==null;)s.alternate!==null&&(c=s),s=s.sibling;c===null?i||r.tail===null?r.tail=null:r.tail.sibling=null:c.sibling=null}}function Nt(r){var i=r.alternate!==null&&r.alternate.child===r.child,s=0,c=0;if(i)for(var p=r.child;p!==null;)s|=p.lanes|p.childLanes,c|=p.subtreeFlags&65011712,c|=p.flags&65011712,p.return=r,p=p.sibling;else for(p=r.child;p!==null;)s|=p.lanes|p.childLanes,c|=p.subtreeFlags,c|=p.flags,p.return=r,p=p.sibling;return r.subtreeFlags|=c,r.childLanes=s,i}function DN(r,i,s){var c=i.pendingProps;switch(Zf(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Nt(i),null;case 1:return Nt(i),null;case 3:return s=i.stateNode,c=null,r!==null&&(c=r.memoizedState.cache),i.memoizedState.cache!==c&&(i.flags|=2048),ta(Ft),ge(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(r===null||r.child===null)&&(Il(i)?ia(i):r===null||r.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Qf())),Nt(i),null;case 26:var p=i.type,v=i.memoizedState;return r===null?(ia(i),v!==null?(Nt(i),Mb(i,v)):(Nt(i),Ih(i,p,null,c,s))):v?v!==r.memoizedState?(ia(i),Nt(i),Mb(i,v)):(Nt(i),i.flags&=-16777217):(r=r.memoizedProps,r!==c&&ia(i),Nt(i),Ih(i,p,r,c,s)),null;case 27:if(ae(i),s=ue.current,p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==c&&ia(i);else{if(!c){if(i.stateNode===null)throw Error(a(166));return Nt(i),null}r=$.current,Il(i)?hv(i):(r=$x(p,c,s),i.stateNode=r,ia(i))}return Nt(i),null;case 5:if(ae(i),p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==c&&ia(i);else{if(!c){if(i.stateNode===null)throw Error(a(166));return Nt(i),null}if(v=$.current,Il(i))hv(i);else{var w=Mc(ue.current);switch(v){case 1:v=w.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:v=w.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":v=w.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":v=w.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":v=w.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof c.is=="string"?w.createElement("select",{is:c.is}):w.createElement("select"),c.multiple?v.multiple=!0:c.size&&(v.size=c.size);break;default:v=typeof c.is=="string"?w.createElement(p,{is:c.is}):w.createElement(p)}}v[cn]=i,v[Rn]=c;e:for(w=i.child;w!==null;){if(w.tag===5||w.tag===6)v.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===i)break e;for(;w.sibling===null;){if(w.return===null||w.return===i)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}i.stateNode=v;e:switch(mn(v,p,c),p){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&ia(i)}}return Nt(i),Ih(i,i.type,r===null?null:r.memoizedProps,i.pendingProps,s),null;case 6:if(r&&i.stateNode!=null)r.memoizedProps!==c&&ia(i);else{if(typeof c!="string"&&i.stateNode===null)throw Error(a(166));if(r=ue.current,Il(i)){if(r=i.stateNode,s=i.memoizedProps,c=null,p=dn,p!==null)switch(p.tag){case 27:case 5:c=p.memoizedProps}r[cn]=i,r=!!(r.nodeValue===s||c!==null&&c.suppressHydrationWarning===!0||Tx(r.nodeValue,s)),r||Ma(i,!0)}else r=Mc(r).createTextNode(c),r[cn]=i,i.stateNode=r}return Nt(i),null;case 31:if(s=i.memoizedState,r===null||r.memoizedState!==null){if(c=Il(i),s!==null){if(r===null){if(!c)throw Error(a(318));if(r=i.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(557));r[cn]=i}else Pi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Nt(i),r=!1}else s=Qf(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=s),r=!0;if(!r)return i.flags&256?(Kn(i),i):(Kn(i),null);if((i.flags&128)!==0)throw Error(a(558))}return Nt(i),null;case 13:if(c=i.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(p=Il(i),c!==null&&c.dehydrated!==null){if(r===null){if(!p)throw Error(a(318));if(p=i.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(a(317));p[cn]=i}else Pi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Nt(i),p=!1}else p=Qf(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=p),p=!0;if(!p)return i.flags&256?(Kn(i),i):(Kn(i),null)}return Kn(i),(i.flags&128)!==0?(i.lanes=s,i):(s=c!==null,r=r!==null&&r.memoizedState!==null,s&&(c=i.child,p=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(p=c.alternate.memoizedState.cachePool.pool),v=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(v=c.memoizedState.cachePool.pool),v!==p&&(c.flags|=2048)),s!==r&&s&&(i.child.flags|=8192),bc(i,i.updateQueue),Nt(i),null);case 4:return ge(),r===null&&im(i.stateNode.containerInfo),Nt(i),null;case 10:return ta(i.type),Nt(i),null;case 19:if(U(Pt),c=i.memoizedState,c===null)return Nt(i),null;if(p=(i.flags&128)!==0,v=c.rendering,v===null)if(p)ko(c,!1);else{if(It!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(v=lc(r),v!==null){for(i.flags|=128,ko(c,!1),r=v.updateQueue,i.updateQueue=r,bc(i,r),i.subtreeFlags=0,r=s,s=i.child;s!==null;)ov(s,r),s=s.sibling;return _(Pt,Pt.current&1|2),tt&&Wr(i,c.treeForkCount),i.child}r=r.sibling}c.tail!==null&&sn()>jc&&(i.flags|=128,p=!0,ko(c,!1),i.lanes=4194304)}else{if(!p)if(r=lc(v),r!==null){if(i.flags|=128,p=!0,r=r.updateQueue,i.updateQueue=r,bc(i,r),ko(c,!0),c.tail===null&&c.tailMode==="hidden"&&!v.alternate&&!tt)return Nt(i),null}else 2*sn()-c.renderingStartTime>jc&&s!==536870912&&(i.flags|=128,p=!0,ko(c,!1),i.lanes=4194304);c.isBackwards?(v.sibling=i.child,i.child=v):(r=c.last,r!==null?r.sibling=v:i.child=v,c.last=v)}return c.tail!==null?(r=c.tail,c.rendering=r,c.tail=r.sibling,c.renderingStartTime=sn(),r.sibling=null,s=Pt.current,_(Pt,p?s&1|2:s&1),tt&&Wr(i,c.treeForkCount),r):(Nt(i),null);case 22:case 23:return Kn(i),lh(),c=i.memoizedState!==null,r!==null?r.memoizedState!==null!==c&&(i.flags|=8192):c&&(i.flags|=8192),c?(s&536870912)!==0&&(i.flags&128)===0&&(Nt(i),i.subtreeFlags&6&&(i.flags|=8192)):Nt(i),s=i.updateQueue,s!==null&&bc(i,s.retryQueue),s=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),c=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),c!==s&&(i.flags|=2048),r!==null&&U(Fi),null;case 24:return s=null,r!==null&&(s=r.memoizedState.cache),i.memoizedState.cache!==s&&(i.flags|=2048),ta(Ft),Nt(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function LN(r,i){switch(Zf(i),i.tag){case 1:return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return ta(Ft),ge(),r=i.flags,(r&65536)!==0&&(r&128)===0?(i.flags=r&-65537|128,i):null;case 26:case 27:case 5:return ae(i),null;case 31:if(i.memoizedState!==null){if(Kn(i),i.alternate===null)throw Error(a(340));Pi()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 13:if(Kn(i),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(a(340));Pi()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return U(Pt),null;case 4:return ge(),null;case 10:return ta(i.type),null;case 22:case 23:return Kn(i),lh(),r!==null&&U(Fi),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 24:return ta(Ft),null;case 25:return null;default:return null}}function Db(r,i){switch(Zf(i),i.tag){case 3:ta(Ft),ge();break;case 26:case 27:case 5:ae(i);break;case 4:ge();break;case 31:i.memoizedState!==null&&Kn(i);break;case 13:Kn(i);break;case 19:U(Pt);break;case 10:ta(i.type);break;case 22:case 23:Kn(i),lh(),r!==null&&U(Fi);break;case 24:ta(Ft)}}function jo(r,i){try{var s=i.updateQueue,c=s!==null?s.lastEffect:null;if(c!==null){var p=c.next;s=p;do{if((s.tag&r)===r){c=void 0;var v=s.create,w=s.inst;c=v(),w.destroy=c}s=s.next}while(s!==p)}}catch(N){gt(i,i.return,N)}}function $a(r,i,s){try{var c=i.updateQueue,p=c!==null?c.lastEffect:null;if(p!==null){var v=p.next;c=v;do{if((c.tag&r)===r){var w=c.inst,N=w.destroy;if(N!==void 0){w.destroy=void 0,p=i;var L=s,G=N;try{G()}catch(ne){gt(p,L,ne)}}}c=c.next}while(c!==v)}}catch(ne){gt(i,i.return,ne)}}function Lb(r){var i=r.updateQueue;if(i!==null){var s=r.stateNode;try{Ev(i,s)}catch(c){gt(r,r.return,c)}}}function Ib(r,i,s){s.props=Qi(r.type,r.memoizedProps),s.state=r.memoizedState;try{s.componentWillUnmount()}catch(c){gt(r,i,c)}}function Co(r,i){try{var s=r.ref;if(s!==null){switch(r.tag){case 26:case 27:case 5:var c=r.stateNode;break;case 30:c=r.stateNode;break;default:c=r.stateNode}typeof s=="function"?r.refCleanup=s(c):s.current=c}}catch(p){gt(r,i,p)}}function Mr(r,i){var s=r.ref,c=r.refCleanup;if(s!==null)if(typeof c=="function")try{c()}catch(p){gt(r,i,p)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(p){gt(r,i,p)}else s.current=null}function Ub(r){var i=r.type,s=r.memoizedProps,c=r.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":s.autoFocus&&c.focus();break e;case"img":s.src?c.src=s.src:s.srcSet&&(c.srcset=s.srcSet)}}catch(p){gt(r,r.return,p)}}function Uh(r,i,s){try{var c=r.stateNode;a_(c,r.type,s,i),c[Rn]=i}catch(p){gt(r,r.return,p)}}function Pb(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&Ga(r.type)||r.tag===4}function Ph(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||Pb(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&Ga(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function Bh(r,i,s){var c=r.tag;if(c===5||c===6)r=r.stateNode,i?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(r,i):(i=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,i.appendChild(r),s=s._reactRootContainer,s!=null||i.onclick!==null||(i.onclick=Yr));else if(c!==4&&(c===27&&Ga(r.type)&&(s=r.stateNode,i=null),r=r.child,r!==null))for(Bh(r,i,s),r=r.sibling;r!==null;)Bh(r,i,s),r=r.sibling}function xc(r,i,s){var c=r.tag;if(c===5||c===6)r=r.stateNode,i?s.insertBefore(r,i):s.appendChild(r);else if(c!==4&&(c===27&&Ga(r.type)&&(s=r.stateNode),r=r.child,r!==null))for(xc(r,i,s),r=r.sibling;r!==null;)xc(r,i,s),r=r.sibling}function Bb(r){var i=r.stateNode,s=r.memoizedProps;try{for(var c=r.type,p=i.attributes;p.length;)i.removeAttributeNode(p[0]);mn(i,c,s),i[cn]=r,i[Rn]=s}catch(v){gt(r,r.return,v)}}var la=!1,Zt=!1,$h=!1,$b=typeof WeakSet=="function"?WeakSet:Set,en=null;function IN(r,i){if(r=r.containerInfo,om=$c,r=Wy(r),Mf(r)){if("selectionStart"in r)var s={start:r.selectionStart,end:r.selectionEnd};else e:{s=(s=r.ownerDocument)&&s.defaultView||window;var c=s.getSelection&&s.getSelection();if(c&&c.rangeCount!==0){s=c.anchorNode;var p=c.anchorOffset,v=c.focusNode;c=c.focusOffset;try{s.nodeType,v.nodeType}catch{s=null;break e}var w=0,N=-1,L=-1,G=0,ne=0,ce=r,Y=null;t:for(;;){for(var J;ce!==s||p!==0&&ce.nodeType!==3||(N=w+p),ce!==v||c!==0&&ce.nodeType!==3||(L=w+c),ce.nodeType===3&&(w+=ce.nodeValue.length),(J=ce.firstChild)!==null;)Y=ce,ce=J;for(;;){if(ce===r)break t;if(Y===s&&++G===p&&(N=w),Y===v&&++ne===c&&(L=w),(J=ce.nextSibling)!==null)break;ce=Y,Y=ce.parentNode}ce=J}s=N===-1||L===-1?null:{start:N,end:L}}else s=null}s=s||{start:0,end:0}}else s=null;for(um={focusedElem:r,selectionRange:s},$c=!1,en=i;en!==null;)if(i=en,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,en=r;else for(;en!==null;){switch(i=en,v=i.alternate,r=i.flags,i.tag){case 0:if((r&4)!==0&&(r=i.updateQueue,r=r!==null?r.events:null,r!==null))for(s=0;s<r.length;s++)p=r[s],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&v!==null){r=void 0,s=i,p=v.memoizedProps,v=v.memoizedState,c=s.stateNode;try{var we=Qi(s.type,p);r=c.getSnapshotBeforeUpdate(we,v),c.__reactInternalSnapshotBeforeUpdate=r}catch(ze){gt(s,s.return,ze)}}break;case 3:if((r&1024)!==0){if(r=i.stateNode.containerInfo,s=r.nodeType,s===9)fm(r);else if(s===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":fm(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(a(163))}if(r=i.sibling,r!==null){r.return=i.return,en=r;break}en=i.return}}function Fb(r,i,s){var c=s.flags;switch(s.tag){case 0:case 11:case 15:oa(r,s),c&4&&jo(5,s);break;case 1:if(oa(r,s),c&4)if(r=s.stateNode,i===null)try{r.componentDidMount()}catch(w){gt(s,s.return,w)}else{var p=Qi(s.type,i.memoizedProps);i=i.memoizedState;try{r.componentDidUpdate(p,i,r.__reactInternalSnapshotBeforeUpdate)}catch(w){gt(s,s.return,w)}}c&64&&Lb(s),c&512&&Co(s,s.return);break;case 3:if(oa(r,s),c&64&&(r=s.updateQueue,r!==null)){if(i=null,s.child!==null)switch(s.child.tag){case 27:case 5:i=s.child.stateNode;break;case 1:i=s.child.stateNode}try{Ev(r,i)}catch(w){gt(s,s.return,w)}}break;case 27:i===null&&c&4&&Bb(s);case 26:case 5:oa(r,s),i===null&&c&4&&Ub(s),c&512&&Co(s,s.return);break;case 12:oa(r,s);break;case 31:oa(r,s),c&4&&Zb(r,s);break;case 13:oa(r,s),c&4&&Vb(r,s),c&64&&(r=s.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(s=VN.bind(null,s),f_(r,s))));break;case 22:if(c=s.memoizedState!==null||la,!c){i=i!==null&&i.memoizedState!==null||Zt,p=la;var v=Zt;la=c,(Zt=i)&&!v?ua(r,s,(s.subtreeFlags&8772)!==0):oa(r,s),la=p,Zt=v}break;case 30:break;default:oa(r,s)}}function qb(r){var i=r.alternate;i!==null&&(r.alternate=null,qb(i)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(i=r.stateNode,i!==null&&yf(i)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var _t=null,On=!1;function sa(r,i,s){for(s=s.child;s!==null;)Hb(r,i,s),s=s.sibling}function Hb(r,i,s){if(Dt&&typeof Dt.onCommitFiberUnmount=="function")try{Dt.onCommitFiberUnmount(Jt,s)}catch{}switch(s.tag){case 26:Zt||Mr(s,i),sa(r,i,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Zt||Mr(s,i);var c=_t,p=On;Ga(s.type)&&(_t=s.stateNode,On=!1),sa(r,i,s),Mo(s.stateNode),_t=c,On=p;break;case 5:Zt||Mr(s,i);case 6:if(c=_t,p=On,_t=null,sa(r,i,s),_t=c,On=p,_t!==null)if(On)try{(_t.nodeType===9?_t.body:_t.nodeName==="HTML"?_t.ownerDocument.body:_t).removeChild(s.stateNode)}catch(v){gt(s,i,v)}else try{_t.removeChild(s.stateNode)}catch(v){gt(s,i,v)}break;case 18:_t!==null&&(On?(r=_t,Lx(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,s.stateNode),as(r)):Lx(_t,s.stateNode));break;case 4:c=_t,p=On,_t=s.stateNode.containerInfo,On=!0,sa(r,i,s),_t=c,On=p;break;case 0:case 11:case 14:case 15:$a(2,s,i),Zt||$a(4,s,i),sa(r,i,s);break;case 1:Zt||(Mr(s,i),c=s.stateNode,typeof c.componentWillUnmount=="function"&&Ib(s,i,c)),sa(r,i,s);break;case 21:sa(r,i,s);break;case 22:Zt=(c=Zt)||s.memoizedState!==null,sa(r,i,s),Zt=c;break;default:sa(r,i,s)}}function Zb(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{as(r)}catch(s){gt(i,i.return,s)}}}function Vb(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{as(r)}catch(s){gt(i,i.return,s)}}function UN(r){switch(r.tag){case 31:case 13:case 19:var i=r.stateNode;return i===null&&(i=r.stateNode=new $b),i;case 22:return r=r.stateNode,i=r._retryCache,i===null&&(i=r._retryCache=new $b),i;default:throw Error(a(435,r.tag))}}function Sc(r,i){var s=UN(r);i.forEach(function(c){if(!s.has(c)){s.add(c);var p=QN.bind(null,r,c);c.then(p,p)}})}function Mn(r,i){var s=i.deletions;if(s!==null)for(var c=0;c<s.length;c++){var p=s[c],v=r,w=i,N=w;e:for(;N!==null;){switch(N.tag){case 27:if(Ga(N.type)){_t=N.stateNode,On=!1;break e}break;case 5:_t=N.stateNode,On=!1;break e;case 3:case 4:_t=N.stateNode.containerInfo,On=!0;break e}N=N.return}if(_t===null)throw Error(a(160));Hb(v,w,p),_t=null,On=!1,v=p.alternate,v!==null&&(v.return=null),p.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)Qb(i,r),i=i.sibling}var Cr=null;function Qb(r,i){var s=r.alternate,c=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:Mn(i,r),Dn(r),c&4&&($a(3,r,r.return),jo(3,r),$a(5,r,r.return));break;case 1:Mn(i,r),Dn(r),c&512&&(Zt||s===null||Mr(s,s.return)),c&64&&la&&(r=r.updateQueue,r!==null&&(c=r.callbacks,c!==null&&(s=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=s===null?c:s.concat(c))));break;case 26:var p=Cr;if(Mn(i,r),Dn(r),c&512&&(Zt||s===null||Mr(s,s.return)),c&4){var v=s!==null?s.memoizedState:null;if(c=r.memoizedState,s===null)if(c===null)if(r.stateNode===null){e:{c=r.type,s=r.memoizedProps,p=p.ownerDocument||p;t:switch(c){case"title":v=p.getElementsByTagName("title")[0],(!v||v[Xs]||v[cn]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=p.createElement(c),p.head.insertBefore(v,p.querySelector("head > title"))),mn(v,c,s),v[cn]=r,Wt(v),c=v;break e;case"link":var w=Qx("link","href",p).get(c+(s.href||""));if(w){for(var N=0;N<w.length;N++)if(v=w[N],v.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&v.getAttribute("rel")===(s.rel==null?null:s.rel)&&v.getAttribute("title")===(s.title==null?null:s.title)&&v.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){w.splice(N,1);break t}}v=p.createElement(c),mn(v,c,s),p.head.appendChild(v);break;case"meta":if(w=Qx("meta","content",p).get(c+(s.content||""))){for(N=0;N<w.length;N++)if(v=w[N],v.getAttribute("content")===(s.content==null?null:""+s.content)&&v.getAttribute("name")===(s.name==null?null:s.name)&&v.getAttribute("property")===(s.property==null?null:s.property)&&v.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&v.getAttribute("charset")===(s.charSet==null?null:s.charSet)){w.splice(N,1);break t}}v=p.createElement(c),mn(v,c,s),p.head.appendChild(v);break;default:throw Error(a(468,c))}v[cn]=r,Wt(v),c=v}r.stateNode=c}else Gx(p,r.type,r.stateNode);else r.stateNode=Vx(p,c,r.memoizedProps);else v!==c?(v===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):v.count--,c===null?Gx(p,r.type,r.stateNode):Vx(p,c,r.memoizedProps)):c===null&&r.stateNode!==null&&Uh(r,r.memoizedProps,s.memoizedProps)}break;case 27:Mn(i,r),Dn(r),c&512&&(Zt||s===null||Mr(s,s.return)),s!==null&&c&4&&Uh(r,r.memoizedProps,s.memoizedProps);break;case 5:if(Mn(i,r),Dn(r),c&512&&(Zt||s===null||Mr(s,s.return)),r.flags&32){p=r.stateNode;try{Nl(p,"")}catch(we){gt(r,r.return,we)}}c&4&&r.stateNode!=null&&(p=r.memoizedProps,Uh(r,p,s!==null?s.memoizedProps:p)),c&1024&&($h=!0);break;case 6:if(Mn(i,r),Dn(r),c&4){if(r.stateNode===null)throw Error(a(162));c=r.memoizedProps,s=r.stateNode;try{s.nodeValue=c}catch(we){gt(r,r.return,we)}}break;case 3:if(Ic=null,p=Cr,Cr=Dc(i.containerInfo),Mn(i,r),Cr=p,Dn(r),c&4&&s!==null&&s.memoizedState.isDehydrated)try{as(i.containerInfo)}catch(we){gt(r,r.return,we)}$h&&($h=!1,Gb(r));break;case 4:c=Cr,Cr=Dc(r.stateNode.containerInfo),Mn(i,r),Dn(r),Cr=c;break;case 12:Mn(i,r),Dn(r);break;case 31:Mn(i,r),Dn(r),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,Sc(r,c)));break;case 13:Mn(i,r),Dn(r),r.child.flags&8192&&r.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(kc=sn()),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,Sc(r,c)));break;case 22:p=r.memoizedState!==null;var L=s!==null&&s.memoizedState!==null,G=la,ne=Zt;if(la=G||p,Zt=ne||L,Mn(i,r),Zt=ne,la=G,Dn(r),c&8192)e:for(i=r.stateNode,i._visibility=p?i._visibility&-2:i._visibility|1,p&&(s===null||L||la||Zt||Gi(r)),s=null,i=r;;){if(i.tag===5||i.tag===26){if(s===null){L=s=i;try{if(v=L.stateNode,p)w=v.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none";else{N=L.stateNode;var ce=L.memoizedProps.style,Y=ce!=null&&ce.hasOwnProperty("display")?ce.display:null;N.style.display=Y==null||typeof Y=="boolean"?"":(""+Y).trim()}}catch(we){gt(L,L.return,we)}}}else if(i.tag===6){if(s===null){L=i;try{L.stateNode.nodeValue=p?"":L.memoizedProps}catch(we){gt(L,L.return,we)}}}else if(i.tag===18){if(s===null){L=i;try{var J=L.stateNode;p?Ix(J,!0):Ix(L.stateNode,!1)}catch(we){gt(L,L.return,we)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===r)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break e;for(;i.sibling===null;){if(i.return===null||i.return===r)break e;s===i&&(s=null),i=i.return}s===i&&(s=null),i.sibling.return=i.return,i=i.sibling}c&4&&(c=r.updateQueue,c!==null&&(s=c.retryQueue,s!==null&&(c.retryQueue=null,Sc(r,s))));break;case 19:Mn(i,r),Dn(r),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,Sc(r,c)));break;case 30:break;case 21:break;default:Mn(i,r),Dn(r)}}function Dn(r){var i=r.flags;if(i&2){try{for(var s,c=r.return;c!==null;){if(Pb(c)){s=c;break}c=c.return}if(s==null)throw Error(a(160));switch(s.tag){case 27:var p=s.stateNode,v=Ph(r);xc(r,v,p);break;case 5:var w=s.stateNode;s.flags&32&&(Nl(w,""),s.flags&=-33);var N=Ph(r);xc(r,N,w);break;case 3:case 4:var L=s.stateNode.containerInfo,G=Ph(r);Bh(r,G,L);break;default:throw Error(a(161))}}catch(ne){gt(r,r.return,ne)}r.flags&=-3}i&4096&&(r.flags&=-4097)}function Gb(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var i=r;Gb(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),r=r.sibling}}function oa(r,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)Fb(r,i.alternate,i),i=i.sibling}function Gi(r){for(r=r.child;r!==null;){var i=r;switch(i.tag){case 0:case 11:case 14:case 15:$a(4,i,i.return),Gi(i);break;case 1:Mr(i,i.return);var s=i.stateNode;typeof s.componentWillUnmount=="function"&&Ib(i,i.return,s),Gi(i);break;case 27:Mo(i.stateNode);case 26:case 5:Mr(i,i.return),Gi(i);break;case 22:i.memoizedState===null&&Gi(i);break;case 30:Gi(i);break;default:Gi(i)}r=r.sibling}}function ua(r,i,s){for(s=s&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var c=i.alternate,p=r,v=i,w=v.flags;switch(v.tag){case 0:case 11:case 15:ua(p,v,s),jo(4,v);break;case 1:if(ua(p,v,s),c=v,p=c.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(G){gt(c,c.return,G)}if(c=v,p=c.updateQueue,p!==null){var N=c.stateNode;try{var L=p.shared.hiddenCallbacks;if(L!==null)for(p.shared.hiddenCallbacks=null,p=0;p<L.length;p++)Cv(L[p],N)}catch(G){gt(c,c.return,G)}}s&&w&64&&Lb(v),Co(v,v.return);break;case 27:Bb(v);case 26:case 5:ua(p,v,s),s&&c===null&&w&4&&Ub(v),Co(v,v.return);break;case 12:ua(p,v,s);break;case 31:ua(p,v,s),s&&w&4&&Zb(p,v);break;case 13:ua(p,v,s),s&&w&4&&Vb(p,v);break;case 22:v.memoizedState===null&&ua(p,v,s),Co(v,v.return);break;case 30:break;default:ua(p,v,s)}i=i.sibling}}function Fh(r,i){var s=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),r=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(r=i.memoizedState.cachePool.pool),r!==s&&(r!=null&&r.refCount++,s!=null&&co(s))}function qh(r,i){r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&co(r))}function Er(r,i,s,c){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Kb(r,i,s,c),i=i.sibling}function Kb(r,i,s,c){var p=i.flags;switch(i.tag){case 0:case 11:case 15:Er(r,i,s,c),p&2048&&jo(9,i);break;case 1:Er(r,i,s,c);break;case 3:Er(r,i,s,c),p&2048&&(r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&co(r)));break;case 12:if(p&2048){Er(r,i,s,c),r=i.stateNode;try{var v=i.memoizedProps,w=v.id,N=v.onPostCommit;typeof N=="function"&&N(w,i.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(L){gt(i,i.return,L)}}else Er(r,i,s,c);break;case 31:Er(r,i,s,c);break;case 13:Er(r,i,s,c);break;case 23:break;case 22:v=i.stateNode,w=i.alternate,i.memoizedState!==null?v._visibility&2?Er(r,i,s,c):Eo(r,i):v._visibility&2?Er(r,i,s,c):(v._visibility|=2,Ql(r,i,s,c,(i.subtreeFlags&10256)!==0||!1)),p&2048&&Fh(w,i);break;case 24:Er(r,i,s,c),p&2048&&qh(i.alternate,i);break;default:Er(r,i,s,c)}}function Ql(r,i,s,c,p){for(p=p&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var v=r,w=i,N=s,L=c,G=w.flags;switch(w.tag){case 0:case 11:case 15:Ql(v,w,N,L,p),jo(8,w);break;case 23:break;case 22:var ne=w.stateNode;w.memoizedState!==null?ne._visibility&2?Ql(v,w,N,L,p):Eo(v,w):(ne._visibility|=2,Ql(v,w,N,L,p)),p&&G&2048&&Fh(w.alternate,w);break;case 24:Ql(v,w,N,L,p),p&&G&2048&&qh(w.alternate,w);break;default:Ql(v,w,N,L,p)}i=i.sibling}}function Eo(r,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var s=r,c=i,p=c.flags;switch(c.tag){case 22:Eo(s,c),p&2048&&Fh(c.alternate,c);break;case 24:Eo(s,c),p&2048&&qh(c.alternate,c);break;default:Eo(s,c)}i=i.sibling}}var No=8192;function Gl(r,i,s){if(r.subtreeFlags&No)for(r=r.child;r!==null;)Yb(r,i,s),r=r.sibling}function Yb(r,i,s){switch(r.tag){case 26:Gl(r,i,s),r.flags&No&&r.memoizedState!==null&&j_(s,Cr,r.memoizedState,r.memoizedProps);break;case 5:Gl(r,i,s);break;case 3:case 4:var c=Cr;Cr=Dc(r.stateNode.containerInfo),Gl(r,i,s),Cr=c;break;case 22:r.memoizedState===null&&(c=r.alternate,c!==null&&c.memoizedState!==null?(c=No,No=16777216,Gl(r,i,s),No=c):Gl(r,i,s));break;default:Gl(r,i,s)}}function Xb(r){var i=r.alternate;if(i!==null&&(r=i.child,r!==null)){i.child=null;do i=r.sibling,r.sibling=null,r=i;while(r!==null)}}function _o(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var c=i[s];en=c,Wb(c,r)}Xb(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Jb(r),r=r.sibling}function Jb(r){switch(r.tag){case 0:case 11:case 15:_o(r),r.flags&2048&&$a(9,r,r.return);break;case 3:_o(r);break;case 12:_o(r);break;case 22:var i=r.stateNode;r.memoizedState!==null&&i._visibility&2&&(r.return===null||r.return.tag!==13)?(i._visibility&=-3,wc(r)):_o(r);break;default:_o(r)}}function wc(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var c=i[s];en=c,Wb(c,r)}Xb(r)}for(r=r.child;r!==null;){switch(i=r,i.tag){case 0:case 11:case 15:$a(8,i,i.return),wc(i);break;case 22:s=i.stateNode,s._visibility&2&&(s._visibility&=-3,wc(i));break;default:wc(i)}r=r.sibling}}function Wb(r,i){for(;en!==null;){var s=en;switch(s.tag){case 0:case 11:case 15:$a(8,s,i);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var c=s.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:co(s.memoizedState.cache)}if(c=s.child,c!==null)c.return=s,en=c;else e:for(s=r;en!==null;){c=en;var p=c.sibling,v=c.return;if(qb(c),c===s){en=null;break e}if(p!==null){p.return=v,en=p;break e}en=v}}}var PN={getCacheForType:function(r){var i=fn(Ft),s=i.data.get(r);return s===void 0&&(s=r(),i.data.set(r,s)),s},cacheSignal:function(){return fn(Ft).controller.signal}},BN=typeof WeakMap=="function"?WeakMap:Map,ct=0,St=null,Ge=null,Xe=0,pt=0,Yn=null,Fa=!1,Kl=!1,Hh=!1,ca=0,It=0,qa=0,Ki=0,Zh=0,Xn=0,Yl=0,Ao=null,Ln=null,Vh=!1,kc=0,ex=0,jc=1/0,Cc=null,Ha=null,Gt=0,Za=null,Xl=null,da=0,Qh=0,Gh=null,tx=null,To=0,Kh=null;function Jn(){return(ct&2)!==0&&Xe!==0?Xe&-Xe:H.T!==null?tm():yy()}function nx(){if(Xn===0)if((Xe&536870912)===0||tt){var r=Ti;Ti<<=1,(Ti&3932160)===0&&(Ti=262144),Xn=r}else Xn=536870912;return r=Gn.current,r!==null&&(r.flags|=32),Xn}function In(r,i,s){(r===St&&(pt===2||pt===9)||r.cancelPendingCommit!==null)&&(Jl(r,0),Va(r,Xe,Xn,!1)),Aa(r,s),((ct&2)===0||r!==St)&&(r===St&&((ct&2)===0&&(Ki|=s),It===4&&Va(r,Xe,Xn,!1)),Dr(r))}function rx(r,i,s){if((ct&6)!==0)throw Error(a(327));var c=!s&&(i&127)===0&&(i&r.expiredLanes)===0||ve(r,i),p=c?qN(r,i):Xh(r,i,!0),v=c;do{if(p===0){Kl&&!c&&Va(r,i,0,!1);break}else{if(s=r.current.alternate,v&&!$N(s)){p=Xh(r,i,!1),v=!1;continue}if(p===2){if(v=i,r.errorRecoveryDisabledLanes&v)var w=0;else w=r.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){i=w;e:{var N=r;p=Ao;var L=N.current.memoizedState.isDehydrated;if(L&&(Jl(N,w).flags|=256),w=Xh(N,w,!1),w!==2){if(Hh&&!L){N.errorRecoveryDisabledLanes|=v,Ki|=v,p=4;break e}v=Ln,Ln=p,v!==null&&(Ln===null?Ln=v:Ln.push.apply(Ln,v))}p=w}if(v=!1,p!==2)continue}}if(p===1){Jl(r,0),Va(r,i,0,!0);break}e:{switch(c=r,v=p,v){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:Va(c,i,Xn,!Fa);break e;case 2:Ln=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(p=kc+300-sn(),10<p)){if(Va(c,i,Xn,!Fa),zi(c,0,!0)!==0)break e;da=i,c.timeoutHandle=Mx(ax.bind(null,c,s,Ln,Cc,Vh,i,Xn,Ki,Yl,Fa,v,"Throttled",-0,0),p);break e}ax(c,s,Ln,Cc,Vh,i,Xn,Ki,Yl,Fa,v,null,-0,0)}}break}while(!0);Dr(r)}function ax(r,i,s,c,p,v,w,N,L,G,ne,ce,Y,J){if(r.timeoutHandle=-1,ce=i.subtreeFlags,ce&8192||(ce&16785408)===16785408){ce={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Yr},Yb(i,v,ce);var we=(v&62914560)===v?kc-sn():(v&4194048)===v?ex-sn():0;if(we=C_(ce,we),we!==null){da=v,r.cancelPendingCommit=we(fx.bind(null,r,i,v,s,c,p,w,N,L,ne,ce,null,Y,J)),Va(r,v,w,!G);return}}fx(r,i,v,s,c,p,w,N,L)}function $N(r){for(var i=r;;){var s=i.tag;if((s===0||s===11||s===15)&&i.flags&16384&&(s=i.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var c=0;c<s.length;c++){var p=s[c],v=p.getSnapshot;p=p.value;try{if(!Vn(v(),p))return!1}catch{return!1}}if(s=i.child,i.subtreeFlags&16384&&s!==null)s.return=i,i=s;else{if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function Va(r,i,s,c){i&=~Zh,i&=~Ki,r.suspendedLanes|=i,r.pingedLanes&=~i,c&&(r.warmLanes|=i),c=r.expirationTimes;for(var p=i;0<p;){var v=31-dt(p),w=1<<v;c[v]=-1,p&=~w}s!==0&&my(r,s,i)}function Ec(){return(ct&6)===0?(Ro(0),!1):!0}function Yh(){if(Ge!==null){if(pt===0)var r=Ge.return;else r=Ge,ea=Bi=null,fh(r),Fl=null,ho=0,r=Ge;for(;r!==null;)Db(r.alternate,r),r=r.return;Ge=null}}function Jl(r,i){var s=r.timeoutHandle;s!==-1&&(r.timeoutHandle=-1,s_(s)),s=r.cancelPendingCommit,s!==null&&(r.cancelPendingCommit=null,s()),da=0,Yh(),St=r,Ge=s=Jr(r.current,null),Xe=i,pt=0,Yn=null,Fa=!1,Kl=ve(r,i),Hh=!1,Yl=Xn=Zh=Ki=qa=It=0,Ln=Ao=null,Vh=!1,(i&8)!==0&&(i|=i&32);var c=r.entangledLanes;if(c!==0)for(r=r.entanglements,c&=i;0<c;){var p=31-dt(c),v=1<<p;i|=r[p],c&=~v}return ca=i,Qu(),s}function ix(r,i){Be=null,H.H=So,i===$l||i===tc?(i=Sv(),pt=3):i===eh?(i=Sv(),pt=4):pt=i===_h?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Yn=i,Ge===null&&(It=1,pc(r,sr(i,r.current)))}function lx(){var r=Gn.current;return r===null?!0:(Xe&4194048)===Xe?dr===null:(Xe&62914560)===Xe||(Xe&536870912)!==0?r===dr:!1}function sx(){var r=H.H;return H.H=So,r===null?So:r}function ox(){var r=H.A;return H.A=PN,r}function Nc(){It=4,Fa||(Xe&4194048)!==Xe&&Gn.current!==null||(Kl=!0),(qa&134217727)===0&&(Ki&134217727)===0||St===null||Va(St,Xe,Xn,!1)}function Xh(r,i,s){var c=ct;ct|=2;var p=sx(),v=ox();(St!==r||Xe!==i)&&(Cc=null,Jl(r,i)),i=!1;var w=It;e:do try{if(pt!==0&&Ge!==null){var N=Ge,L=Yn;switch(pt){case 8:Yh(),w=6;break e;case 3:case 2:case 9:case 6:Gn.current===null&&(i=!0);var G=pt;if(pt=0,Yn=null,Wl(r,N,L,G),s&&Kl){w=0;break e}break;default:G=pt,pt=0,Yn=null,Wl(r,N,L,G)}}FN(),w=It;break}catch(ne){ix(r,ne)}while(!0);return i&&r.shellSuspendCounter++,ea=Bi=null,ct=c,H.H=p,H.A=v,Ge===null&&(St=null,Xe=0,Qu()),w}function FN(){for(;Ge!==null;)ux(Ge)}function qN(r,i){var s=ct;ct|=2;var c=sx(),p=ox();St!==r||Xe!==i?(Cc=null,jc=sn()+500,Jl(r,i)):Kl=ve(r,i);e:do try{if(pt!==0&&Ge!==null){i=Ge;var v=Yn;t:switch(pt){case 1:pt=0,Yn=null,Wl(r,i,v,1);break;case 2:case 9:if(bv(v)){pt=0,Yn=null,cx(i);break}i=function(){pt!==2&&pt!==9||St!==r||(pt=7),Dr(r)},v.then(i,i);break e;case 3:pt=7;break e;case 4:pt=5;break e;case 7:bv(v)?(pt=0,Yn=null,cx(i)):(pt=0,Yn=null,Wl(r,i,v,7));break;case 5:var w=null;switch(Ge.tag){case 26:w=Ge.memoizedState;case 5:case 27:var N=Ge;if(w?Kx(w):N.stateNode.complete){pt=0,Yn=null;var L=N.sibling;if(L!==null)Ge=L;else{var G=N.return;G!==null?(Ge=G,_c(G)):Ge=null}break t}}pt=0,Yn=null,Wl(r,i,v,5);break;case 6:pt=0,Yn=null,Wl(r,i,v,6);break;case 8:Yh(),It=6;break e;default:throw Error(a(462))}}HN();break}catch(ne){ix(r,ne)}while(!0);return ea=Bi=null,H.H=c,H.A=p,ct=s,Ge!==null?0:(St=null,Xe=0,Qu(),It)}function HN(){for(;Ge!==null&&!Gs();)ux(Ge)}function ux(r){var i=Ob(r.alternate,r,ca);r.memoizedProps=r.pendingProps,i===null?_c(r):Ge=i}function cx(r){var i=r,s=i.alternate;switch(i.tag){case 15:case 0:i=Nb(s,i,i.pendingProps,i.type,void 0,Xe);break;case 11:i=Nb(s,i,i.pendingProps,i.type.render,i.ref,Xe);break;case 5:fh(i);default:Db(s,i),i=Ge=ov(i,ca),i=Ob(s,i,ca)}r.memoizedProps=r.pendingProps,i===null?_c(r):Ge=i}function Wl(r,i,s,c){ea=Bi=null,fh(i),Fl=null,ho=0;var p=i.return;try{if(zN(r,p,i,s,Xe)){It=1,pc(r,sr(s,r.current)),Ge=null;return}}catch(v){if(p!==null)throw Ge=p,v;It=1,pc(r,sr(s,r.current)),Ge=null;return}i.flags&32768?(tt||c===1?r=!0:Kl||(Xe&536870912)!==0?r=!1:(Fa=r=!0,(c===2||c===9||c===3||c===6)&&(c=Gn.current,c!==null&&c.tag===13&&(c.flags|=16384))),dx(i,r)):_c(i)}function _c(r){var i=r;do{if((i.flags&32768)!==0){dx(i,Fa);return}r=i.return;var s=DN(i.alternate,i,ca);if(s!==null){Ge=s;return}if(i=i.sibling,i!==null){Ge=i;return}Ge=i=r}while(i!==null);It===0&&(It=5)}function dx(r,i){do{var s=LN(r.alternate,r);if(s!==null){s.flags&=32767,Ge=s;return}if(s=r.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!i&&(r=r.sibling,r!==null)){Ge=r;return}Ge=r=s}while(r!==null);It=6,Ge=null}function fx(r,i,s,c,p,v,w,N,L){r.cancelPendingCommit=null;do Ac();while(Gt!==0);if((ct&6)!==0)throw Error(a(327));if(i!==null){if(i===r.current)throw Error(a(177));if(v=i.lanes|i.childLanes,v|=Pf,hf(r,s,v,w,N,L),r===St&&(Ge=St=null,Xe=0),Xl=i,Za=r,da=s,Qh=v,Gh=p,tx=c,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,GN(Te,function(){return yx(),null})):(r.callbackNode=null,r.callbackPriority=0),c=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||c){c=H.T,H.T=null,p=re.p,re.p=2,w=ct,ct|=4;try{IN(r,i,s)}finally{ct=w,re.p=p,H.T=c}}Gt=1,hx(),mx(),px()}}function hx(){if(Gt===1){Gt=0;var r=Za,i=Xl,s=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||s){s=H.T,H.T=null;var c=re.p;re.p=2;var p=ct;ct|=4;try{Qb(i,r);var v=um,w=Wy(r.containerInfo),N=v.focusedElem,L=v.selectionRange;if(w!==N&&N&&N.ownerDocument&&Jy(N.ownerDocument.documentElement,N)){if(L!==null&&Mf(N)){var G=L.start,ne=L.end;if(ne===void 0&&(ne=G),"selectionStart"in N)N.selectionStart=G,N.selectionEnd=Math.min(ne,N.value.length);else{var ce=N.ownerDocument||document,Y=ce&&ce.defaultView||window;if(Y.getSelection){var J=Y.getSelection(),we=N.textContent.length,ze=Math.min(L.start,we),bt=L.end===void 0?ze:Math.min(L.end,we);!J.extend&&ze>bt&&(w=bt,bt=ze,ze=w);var V=Xy(N,ze),F=Xy(N,bt);if(V&&F&&(J.rangeCount!==1||J.anchorNode!==V.node||J.anchorOffset!==V.offset||J.focusNode!==F.node||J.focusOffset!==F.offset)){var Q=ce.createRange();Q.setStart(V.node,V.offset),J.removeAllRanges(),ze>bt?(J.addRange(Q),J.extend(F.node,F.offset)):(Q.setEnd(F.node,F.offset),J.addRange(Q))}}}}for(ce=[],J=N;J=J.parentNode;)J.nodeType===1&&ce.push({element:J,left:J.scrollLeft,top:J.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<ce.length;N++){var se=ce[N];se.element.scrollLeft=se.left,se.element.scrollTop=se.top}}$c=!!om,um=om=null}finally{ct=p,re.p=c,H.T=s}}r.current=i,Gt=2}}function mx(){if(Gt===2){Gt=0;var r=Za,i=Xl,s=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||s){s=H.T,H.T=null;var c=re.p;re.p=2;var p=ct;ct|=4;try{Fb(r,i.alternate,i)}finally{ct=p,re.p=c,H.T=s}}Gt=3}}function px(){if(Gt===4||Gt===3){Gt=0,Ks();var r=Za,i=Xl,s=da,c=tx;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Gt=5:(Gt=0,Xl=Za=null,gx(r,r.pendingLanes));var p=r.pendingLanes;if(p===0&&(Ha=null),pf(s),i=i.stateNode,Dt&&typeof Dt.onCommitFiberRoot=="function")try{Dt.onCommitFiberRoot(Jt,i,void 0,(i.current.flags&128)===128)}catch{}if(c!==null){i=H.T,p=re.p,re.p=2,H.T=null;try{for(var v=r.onRecoverableError,w=0;w<c.length;w++){var N=c[w];v(N.value,{componentStack:N.stack})}}finally{H.T=i,re.p=p}}(da&3)!==0&&Ac(),Dr(r),p=r.pendingLanes,(s&261930)!==0&&(p&42)!==0?r===Kh?To++:(To=0,Kh=r):To=0,Ro(0)}}function gx(r,i){(r.pooledCacheLanes&=i)===0&&(i=r.pooledCache,i!=null&&(r.pooledCache=null,co(i)))}function Ac(){return hx(),mx(),px(),yx()}function yx(){if(Gt!==5)return!1;var r=Za,i=Qh;Qh=0;var s=pf(da),c=H.T,p=re.p;try{re.p=32>s?32:s,H.T=null,s=Gh,Gh=null;var v=Za,w=da;if(Gt=0,Xl=Za=null,da=0,(ct&6)!==0)throw Error(a(331));var N=ct;if(ct|=4,Jb(v.current),Kb(v,v.current,w,s),ct=N,Ro(0,!1),Dt&&typeof Dt.onPostCommitFiberRoot=="function")try{Dt.onPostCommitFiberRoot(Jt,v)}catch{}return!0}finally{re.p=p,H.T=c,gx(r,i)}}function vx(r,i,s){i=sr(s,i),i=Nh(r.stateNode,i,2),r=Ua(r,i,2),r!==null&&(Aa(r,2),Dr(r))}function gt(r,i,s){if(r.tag===3)vx(r,r,s);else for(;i!==null;){if(i.tag===3){vx(i,r,s);break}else if(i.tag===1){var c=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(Ha===null||!Ha.has(c))){r=sr(s,r),s=bb(2),c=Ua(i,s,2),c!==null&&(xb(s,c,i,r),Aa(c,2),Dr(c));break}}i=i.return}}function Jh(r,i,s){var c=r.pingCache;if(c===null){c=r.pingCache=new BN;var p=new Set;c.set(i,p)}else p=c.get(i),p===void 0&&(p=new Set,c.set(i,p));p.has(s)||(Hh=!0,p.add(s),r=ZN.bind(null,r,i,s),i.then(r,r))}function ZN(r,i,s){var c=r.pingCache;c!==null&&c.delete(i),r.pingedLanes|=r.suspendedLanes&s,r.warmLanes&=~s,St===r&&(Xe&s)===s&&(It===4||It===3&&(Xe&62914560)===Xe&&300>sn()-kc?(ct&2)===0&&Jl(r,0):Zh|=s,Yl===Xe&&(Yl=0)),Dr(r)}function bx(r,i){i===0&&(i=Tn()),r=Ii(r,i),r!==null&&(Aa(r,i),Dr(r))}function VN(r){var i=r.memoizedState,s=0;i!==null&&(s=i.retryLane),bx(r,s)}function QN(r,i){var s=0;switch(r.tag){case 31:case 13:var c=r.stateNode,p=r.memoizedState;p!==null&&(s=p.retryLane);break;case 19:c=r.stateNode;break;case 22:c=r.stateNode._retryCache;break;default:throw Error(a(314))}c!==null&&c.delete(i),bx(r,s)}function GN(r,i){return _a(r,i)}var Tc=null,es=null,Wh=!1,Rc=!1,em=!1,Qa=0;function Dr(r){r!==es&&r.next===null&&(es===null?Tc=es=r:es=es.next=r),Rc=!0,Wh||(Wh=!0,YN())}function Ro(r,i){if(!em&&Rc){em=!0;do for(var s=!1,c=Tc;c!==null;){if(r!==0){var p=c.pendingLanes;if(p===0)var v=0;else{var w=c.suspendedLanes,N=c.pingedLanes;v=(1<<31-dt(42|r)+1)-1,v&=p&~(w&~N),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(s=!0,kx(c,v))}else v=Xe,v=zi(c,c===St?v:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(v&3)===0||ve(c,v)||(s=!0,kx(c,v));c=c.next}while(s);em=!1}}function KN(){xx()}function xx(){Rc=Wh=!1;var r=0;Qa!==0&&l_()&&(r=Qa);for(var i=sn(),s=null,c=Tc;c!==null;){var p=c.next,v=Sx(c,i);v===0?(c.next=null,s===null?Tc=p:s.next=p,p===null&&(es=s)):(s=c,(r!==0||(v&3)!==0)&&(Rc=!0)),c=p}Gt!==0&&Gt!==5||Ro(r),Qa!==0&&(Qa=0)}function Sx(r,i){for(var s=r.suspendedLanes,c=r.pingedLanes,p=r.expirationTimes,v=r.pendingLanes&-62914561;0<v;){var w=31-dt(v),N=1<<w,L=p[w];L===-1?((N&s)===0||(N&c)!==0)&&(p[w]=et(N,i)):L<=i&&(r.expiredLanes|=N),v&=~N}if(i=St,s=Xe,s=zi(r,r===i?s:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),c=r.callbackNode,s===0||r===i&&(pt===2||pt===9)||r.cancelPendingCommit!==null)return c!==null&&c!==null&&_i(c),r.callbackNode=null,r.callbackPriority=0;if((s&3)===0||ve(r,s)){if(i=s&-s,i===r.callbackPriority)return i;switch(c!==null&&_i(c),pf(s)){case 2:case 8:s=ye;break;case 32:s=Te;break;case 268435456:s=lt;break;default:s=Te}return c=wx.bind(null,r),s=_a(s,c),r.callbackPriority=i,r.callbackNode=s,i}return c!==null&&c!==null&&_i(c),r.callbackPriority=2,r.callbackNode=null,2}function wx(r,i){if(Gt!==0&&Gt!==5)return r.callbackNode=null,r.callbackPriority=0,null;var s=r.callbackNode;if(Ac()&&r.callbackNode!==s)return null;var c=Xe;return c=zi(r,r===St?c:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),c===0?null:(rx(r,c,i),Sx(r,sn()),r.callbackNode!=null&&r.callbackNode===s?wx.bind(null,r):null)}function kx(r,i){if(Ac())return null;rx(r,i,!0)}function YN(){o_(function(){(ct&6)!==0?_a(ie,KN):xx()})}function tm(){if(Qa===0){var r=Pl;r===0&&(r=Ai,Ai<<=1,(Ai&261888)===0&&(Ai=256)),Qa=r}return Qa}function jx(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:Pu(""+r)}function Cx(r,i){var s=i.ownerDocument.createElement("input");return s.name=i.name,s.value=i.value,r.id&&s.setAttribute("form",r.id),i.parentNode.insertBefore(s,i),r=new FormData(r),s.parentNode.removeChild(s),r}function XN(r,i,s,c,p){if(i==="submit"&&s&&s.stateNode===p){var v=jx((p[Rn]||null).action),w=c.submitter;w&&(i=(i=w[Rn]||null)?jx(i.formAction):w.getAttribute("formAction"),i!==null&&(v=i,w=null));var N=new qu("action","action",null,c,p);r.push({event:N,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(Qa!==0){var L=w?Cx(p,w):new FormData(p);Sh(s,{pending:!0,data:L,method:p.method,action:v},null,L)}}else typeof v=="function"&&(N.preventDefault(),L=w?Cx(p,w):new FormData(p),Sh(s,{pending:!0,data:L,method:p.method,action:v},v,L))},currentTarget:p}]})}}for(var nm=0;nm<Uf.length;nm++){var rm=Uf[nm],JN=rm.toLowerCase(),WN=rm[0].toUpperCase()+rm.slice(1);jr(JN,"on"+WN)}jr(nv,"onAnimationEnd"),jr(rv,"onAnimationIteration"),jr(av,"onAnimationStart"),jr("dblclick","onDoubleClick"),jr("focusin","onFocus"),jr("focusout","onBlur"),jr(pN,"onTransitionRun"),jr(gN,"onTransitionStart"),jr(yN,"onTransitionCancel"),jr(iv,"onTransitionEnd"),Cl("onMouseEnter",["mouseout","mouseover"]),Cl("onMouseLeave",["mouseout","mouseover"]),Cl("onPointerEnter",["pointerout","pointerover"]),Cl("onPointerLeave",["pointerout","pointerover"]),Oi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Oi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Oi("onBeforeInput",["compositionend","keypress","textInput","paste"]),Oi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Oi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Oi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var zo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),e_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(zo));function Ex(r,i){i=(i&4)!==0;for(var s=0;s<r.length;s++){var c=r[s],p=c.event;c=c.listeners;e:{var v=void 0;if(i)for(var w=c.length-1;0<=w;w--){var N=c[w],L=N.instance,G=N.currentTarget;if(N=N.listener,L!==v&&p.isPropagationStopped())break e;v=N,p.currentTarget=G;try{v(p)}catch(ne){Vu(ne)}p.currentTarget=null,v=L}else for(w=0;w<c.length;w++){if(N=c[w],L=N.instance,G=N.currentTarget,N=N.listener,L!==v&&p.isPropagationStopped())break e;v=N,p.currentTarget=G;try{v(p)}catch(ne){Vu(ne)}p.currentTarget=null,v=L}}}}function Ke(r,i){var s=i[gf];s===void 0&&(s=i[gf]=new Set);var c=r+"__bubble";s.has(c)||(Nx(i,r,2,!1),s.add(c))}function am(r,i,s){var c=0;i&&(c|=4),Nx(s,r,c,i)}var zc="_reactListening"+Math.random().toString(36).slice(2);function im(r){if(!r[zc]){r[zc]=!0,xy.forEach(function(s){s!=="selectionchange"&&(e_.has(s)||am(s,!1,r),am(s,!0,r))});var i=r.nodeType===9?r:r.ownerDocument;i===null||i[zc]||(i[zc]=!0,am("selectionchange",!1,i))}}function Nx(r,i,s,c){switch(n0(i)){case 2:var p=__;break;case 8:p=A_;break;default:p=xm}s=p.bind(null,i,s,r),p=void 0,!Cf||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(p=!0),c?p!==void 0?r.addEventListener(i,s,{capture:!0,passive:p}):r.addEventListener(i,s,!0):p!==void 0?r.addEventListener(i,s,{passive:p}):r.addEventListener(i,s,!1)}function lm(r,i,s,c,p){var v=c;if((i&1)===0&&(i&2)===0&&c!==null)e:for(;;){if(c===null)return;var w=c.tag;if(w===3||w===4){var N=c.stateNode.containerInfo;if(N===p)break;if(w===4)for(w=c.return;w!==null;){var L=w.tag;if((L===3||L===4)&&w.stateNode.containerInfo===p)return;w=w.return}for(;N!==null;){if(w=wl(N),w===null)return;if(L=w.tag,L===5||L===6||L===26||L===27){c=v=w;continue e}N=N.parentNode}}c=c.return}zy(function(){var G=v,ne=kf(s),ce=[];e:{var Y=lv.get(r);if(Y!==void 0){var J=qu,we=r;switch(r){case"keypress":if($u(s)===0)break e;case"keydown":case"keyup":J=QE;break;case"focusin":we="focus",J=Af;break;case"focusout":we="blur",J=Af;break;case"beforeblur":case"afterblur":J=Af;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":J=Dy;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":J=DE;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":J=YE;break;case nv:case rv:case av:J=UE;break;case iv:J=JE;break;case"scroll":case"scrollend":J=OE;break;case"wheel":J=eN;break;case"copy":case"cut":case"paste":J=BE;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":J=Iy;break;case"toggle":case"beforetoggle":J=nN}var ze=(i&4)!==0,bt=!ze&&(r==="scroll"||r==="scrollend"),V=ze?Y!==null?Y+"Capture":null:Y;ze=[];for(var F=G,Q;F!==null;){var se=F;if(Q=se.stateNode,se=se.tag,se!==5&&se!==26&&se!==27||Q===null||V===null||(se=Ws(F,V),se!=null&&ze.push(Oo(F,se,Q))),bt)break;F=F.return}0<ze.length&&(Y=new J(Y,we,null,s,ne),ce.push({event:Y,listeners:ze}))}}if((i&7)===0){e:{if(Y=r==="mouseover"||r==="pointerover",J=r==="mouseout"||r==="pointerout",Y&&s!==wf&&(we=s.relatedTarget||s.fromElement)&&(wl(we)||we[Sl]))break e;if((J||Y)&&(Y=ne.window===ne?ne:(Y=ne.ownerDocument)?Y.defaultView||Y.parentWindow:window,J?(we=s.relatedTarget||s.toElement,J=G,we=we?wl(we):null,we!==null&&(bt=o(we),ze=we.tag,we!==bt||ze!==5&&ze!==27&&ze!==6)&&(we=null)):(J=null,we=G),J!==we)){if(ze=Dy,se="onMouseLeave",V="onMouseEnter",F="mouse",(r==="pointerout"||r==="pointerover")&&(ze=Iy,se="onPointerLeave",V="onPointerEnter",F="pointer"),bt=J==null?Y:Js(J),Q=we==null?Y:Js(we),Y=new ze(se,F+"leave",J,s,ne),Y.target=bt,Y.relatedTarget=Q,se=null,wl(ne)===G&&(ze=new ze(V,F+"enter",we,s,ne),ze.target=Q,ze.relatedTarget=bt,se=ze),bt=se,J&&we)t:{for(ze=t_,V=J,F=we,Q=0,se=V;se;se=ze(se))Q++;se=0;for(var Ae=F;Ae;Ae=ze(Ae))se++;for(;0<Q-se;)V=ze(V),Q--;for(;0<se-Q;)F=ze(F),se--;for(;Q--;){if(V===F||F!==null&&V===F.alternate){ze=V;break t}V=ze(V),F=ze(F)}ze=null}else ze=null;J!==null&&_x(ce,Y,J,ze,!1),we!==null&&bt!==null&&_x(ce,bt,we,ze,!0)}}e:{if(Y=G?Js(G):window,J=Y.nodeName&&Y.nodeName.toLowerCase(),J==="select"||J==="input"&&Y.type==="file")var st=Zy;else if(qy(Y))if(Vy)st=fN;else{st=cN;var Ce=uN}else J=Y.nodeName,!J||J.toLowerCase()!=="input"||Y.type!=="checkbox"&&Y.type!=="radio"?G&&Sf(G.elementType)&&(st=Zy):st=dN;if(st&&(st=st(r,G))){Hy(ce,st,s,ne);break e}Ce&&Ce(r,Y,G),r==="focusout"&&G&&Y.type==="number"&&G.memoizedProps.value!=null&&xf(Y,"number",Y.value)}switch(Ce=G?Js(G):window,r){case"focusin":(qy(Ce)||Ce.contentEditable==="true")&&(Rl=Ce,Df=G,so=null);break;case"focusout":so=Df=Rl=null;break;case"mousedown":Lf=!0;break;case"contextmenu":case"mouseup":case"dragend":Lf=!1,ev(ce,s,ne);break;case"selectionchange":if(mN)break;case"keydown":case"keyup":ev(ce,s,ne)}var Fe;if(Rf)e:{switch(r){case"compositionstart":var Je="onCompositionStart";break e;case"compositionend":Je="onCompositionEnd";break e;case"compositionupdate":Je="onCompositionUpdate";break e}Je=void 0}else Tl?$y(r,s)&&(Je="onCompositionEnd"):r==="keydown"&&s.keyCode===229&&(Je="onCompositionStart");Je&&(Uy&&s.locale!=="ko"&&(Tl||Je!=="onCompositionStart"?Je==="onCompositionEnd"&&Tl&&(Fe=Oy()):(Ra=ne,Ef="value"in Ra?Ra.value:Ra.textContent,Tl=!0)),Ce=Oc(G,Je),0<Ce.length&&(Je=new Ly(Je,r,null,s,ne),ce.push({event:Je,listeners:Ce}),Fe?Je.data=Fe:(Fe=Fy(s),Fe!==null&&(Je.data=Fe)))),(Fe=aN?iN(r,s):lN(r,s))&&(Je=Oc(G,"onBeforeInput"),0<Je.length&&(Ce=new Ly("onBeforeInput","beforeinput",null,s,ne),ce.push({event:Ce,listeners:Je}),Ce.data=Fe)),XN(ce,r,G,s,ne)}Ex(ce,i)})}function Oo(r,i,s){return{instance:r,listener:i,currentTarget:s}}function Oc(r,i){for(var s=i+"Capture",c=[];r!==null;){var p=r,v=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||v===null||(p=Ws(r,s),p!=null&&c.unshift(Oo(r,p,v)),p=Ws(r,i),p!=null&&c.push(Oo(r,p,v))),r.tag===3)return c;r=r.return}return[]}function t_(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function _x(r,i,s,c,p){for(var v=i._reactName,w=[];s!==null&&s!==c;){var N=s,L=N.alternate,G=N.stateNode;if(N=N.tag,L!==null&&L===c)break;N!==5&&N!==26&&N!==27||G===null||(L=G,p?(G=Ws(s,v),G!=null&&w.unshift(Oo(s,G,L))):p||(G=Ws(s,v),G!=null&&w.push(Oo(s,G,L)))),s=s.return}w.length!==0&&r.push({event:i,listeners:w})}var n_=/\r\n?/g,r_=/\u0000|\uFFFD/g;function Ax(r){return(typeof r=="string"?r:""+r).replace(n_,`
49
+ `).replace(r_,"")}function Tx(r,i){return i=Ax(i),Ax(r)===i}function vt(r,i,s,c,p,v){switch(s){case"children":typeof c=="string"?i==="body"||i==="textarea"&&c===""||Nl(r,c):(typeof c=="number"||typeof c=="bigint")&&i!=="body"&&Nl(r,""+c);break;case"className":Iu(r,"class",c);break;case"tabIndex":Iu(r,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":Iu(r,s,c);break;case"style":Ty(r,c,v);break;case"data":if(i!=="object"){Iu(r,"data",c);break}case"src":case"href":if(c===""&&(i!=="a"||s!=="href")){r.removeAttribute(s);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){r.removeAttribute(s);break}c=Pu(""+c),r.setAttribute(s,c);break;case"action":case"formAction":if(typeof c=="function"){r.setAttribute(s,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof v=="function"&&(s==="formAction"?(i!=="input"&&vt(r,i,"name",p.name,p,null),vt(r,i,"formEncType",p.formEncType,p,null),vt(r,i,"formMethod",p.formMethod,p,null),vt(r,i,"formTarget",p.formTarget,p,null)):(vt(r,i,"encType",p.encType,p,null),vt(r,i,"method",p.method,p,null),vt(r,i,"target",p.target,p,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){r.removeAttribute(s);break}c=Pu(""+c),r.setAttribute(s,c);break;case"onClick":c!=null&&(r.onclick=Yr);break;case"onScroll":c!=null&&Ke("scroll",r);break;case"onScrollEnd":c!=null&&Ke("scrollend",r);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(a(61));if(s=c.__html,s!=null){if(p.children!=null)throw Error(a(60));r.innerHTML=s}}break;case"multiple":r.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":r.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){r.removeAttribute("xlink:href");break}s=Pu(""+c),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?r.setAttribute(s,""+c):r.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":c&&typeof c!="function"&&typeof c!="symbol"?r.setAttribute(s,""):r.removeAttribute(s);break;case"capture":case"download":c===!0?r.setAttribute(s,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?r.setAttribute(s,c):r.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?r.setAttribute(s,c):r.removeAttribute(s);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?r.removeAttribute(s):r.setAttribute(s,c);break;case"popover":Ke("beforetoggle",r),Ke("toggle",r),Lu(r,"popover",c);break;case"xlinkActuate":Kr(r,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":Kr(r,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":Kr(r,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":Kr(r,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":Kr(r,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":Kr(r,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":Kr(r,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":Kr(r,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":Kr(r,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":Lu(r,"is",c);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=RE.get(s)||s,Lu(r,s,c))}}function sm(r,i,s,c,p,v){switch(s){case"style":Ty(r,c,v);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(a(61));if(s=c.__html,s!=null){if(p.children!=null)throw Error(a(60));r.innerHTML=s}}break;case"children":typeof c=="string"?Nl(r,c):(typeof c=="number"||typeof c=="bigint")&&Nl(r,""+c);break;case"onScroll":c!=null&&Ke("scroll",r);break;case"onScrollEnd":c!=null&&Ke("scrollend",r);break;case"onClick":c!=null&&(r.onclick=Yr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Sy.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(p=s.endsWith("Capture"),i=s.slice(2,p?s.length-7:void 0),v=r[Rn]||null,v=v!=null?v[s]:null,typeof v=="function"&&r.removeEventListener(i,v,p),typeof c=="function")){typeof v!="function"&&v!==null&&(s in r?r[s]=null:r.hasAttribute(s)&&r.removeAttribute(s)),r.addEventListener(i,c,p);break e}s in r?r[s]=c:c===!0?r.setAttribute(s,""):Lu(r,s,c)}}}function mn(r,i,s){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ke("error",r),Ke("load",r);var c=!1,p=!1,v;for(v in s)if(s.hasOwnProperty(v)){var w=s[v];if(w!=null)switch(v){case"src":c=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:vt(r,i,v,w,s,null)}}p&&vt(r,i,"srcSet",s.srcSet,s,null),c&&vt(r,i,"src",s.src,s,null);return;case"input":Ke("invalid",r);var N=v=w=p=null,L=null,G=null;for(c in s)if(s.hasOwnProperty(c)){var ne=s[c];if(ne!=null)switch(c){case"name":p=ne;break;case"type":w=ne;break;case"checked":L=ne;break;case"defaultChecked":G=ne;break;case"value":v=ne;break;case"defaultValue":N=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(a(137,i));break;default:vt(r,i,c,ne,s,null)}}Ey(r,v,N,L,G,w,p,!1);return;case"select":Ke("invalid",r),c=w=v=null;for(p in s)if(s.hasOwnProperty(p)&&(N=s[p],N!=null))switch(p){case"value":v=N;break;case"defaultValue":w=N;break;case"multiple":c=N;default:vt(r,i,p,N,s,null)}i=v,s=w,r.multiple=!!c,i!=null?El(r,!!c,i,!1):s!=null&&El(r,!!c,s,!0);return;case"textarea":Ke("invalid",r),v=p=c=null;for(w in s)if(s.hasOwnProperty(w)&&(N=s[w],N!=null))switch(w){case"value":c=N;break;case"defaultValue":p=N;break;case"children":v=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(a(91));break;default:vt(r,i,w,N,s,null)}_y(r,c,p,v);return;case"option":for(L in s)if(s.hasOwnProperty(L)&&(c=s[L],c!=null))switch(L){case"selected":r.selected=c&&typeof c!="function"&&typeof c!="symbol";break;default:vt(r,i,L,c,s,null)}return;case"dialog":Ke("beforetoggle",r),Ke("toggle",r),Ke("cancel",r),Ke("close",r);break;case"iframe":case"object":Ke("load",r);break;case"video":case"audio":for(c=0;c<zo.length;c++)Ke(zo[c],r);break;case"image":Ke("error",r),Ke("load",r);break;case"details":Ke("toggle",r);break;case"embed":case"source":case"link":Ke("error",r),Ke("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(G in s)if(s.hasOwnProperty(G)&&(c=s[G],c!=null))switch(G){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:vt(r,i,G,c,s,null)}return;default:if(Sf(i)){for(ne in s)s.hasOwnProperty(ne)&&(c=s[ne],c!==void 0&&sm(r,i,ne,c,s,void 0));return}}for(N in s)s.hasOwnProperty(N)&&(c=s[N],c!=null&&vt(r,i,N,c,s,null))}function a_(r,i,s,c){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,v=null,w=null,N=null,L=null,G=null,ne=null;for(J in s){var ce=s[J];if(s.hasOwnProperty(J)&&ce!=null)switch(J){case"checked":break;case"value":break;case"defaultValue":L=ce;default:c.hasOwnProperty(J)||vt(r,i,J,null,c,ce)}}for(var Y in c){var J=c[Y];if(ce=s[Y],c.hasOwnProperty(Y)&&(J!=null||ce!=null))switch(Y){case"type":v=J;break;case"name":p=J;break;case"checked":G=J;break;case"defaultChecked":ne=J;break;case"value":w=J;break;case"defaultValue":N=J;break;case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(a(137,i));break;default:J!==ce&&vt(r,i,Y,J,c,ce)}}bf(r,w,N,L,G,ne,v,p);return;case"select":J=w=N=Y=null;for(v in s)if(L=s[v],s.hasOwnProperty(v)&&L!=null)switch(v){case"value":break;case"multiple":J=L;default:c.hasOwnProperty(v)||vt(r,i,v,null,c,L)}for(p in c)if(v=c[p],L=s[p],c.hasOwnProperty(p)&&(v!=null||L!=null))switch(p){case"value":Y=v;break;case"defaultValue":N=v;break;case"multiple":w=v;default:v!==L&&vt(r,i,p,v,c,L)}i=N,s=w,c=J,Y!=null?El(r,!!s,Y,!1):!!c!=!!s&&(i!=null?El(r,!!s,i,!0):El(r,!!s,s?[]:"",!1));return;case"textarea":J=Y=null;for(N in s)if(p=s[N],s.hasOwnProperty(N)&&p!=null&&!c.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:vt(r,i,N,null,c,p)}for(w in c)if(p=c[w],v=s[w],c.hasOwnProperty(w)&&(p!=null||v!=null))switch(w){case"value":Y=p;break;case"defaultValue":J=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(a(91));break;default:p!==v&&vt(r,i,w,p,c,v)}Ny(r,Y,J);return;case"option":for(var we in s)if(Y=s[we],s.hasOwnProperty(we)&&Y!=null&&!c.hasOwnProperty(we))switch(we){case"selected":r.selected=!1;break;default:vt(r,i,we,null,c,Y)}for(L in c)if(Y=c[L],J=s[L],c.hasOwnProperty(L)&&Y!==J&&(Y!=null||J!=null))switch(L){case"selected":r.selected=Y&&typeof Y!="function"&&typeof Y!="symbol";break;default:vt(r,i,L,Y,c,J)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ze in s)Y=s[ze],s.hasOwnProperty(ze)&&Y!=null&&!c.hasOwnProperty(ze)&&vt(r,i,ze,null,c,Y);for(G in c)if(Y=c[G],J=s[G],c.hasOwnProperty(G)&&Y!==J&&(Y!=null||J!=null))switch(G){case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(a(137,i));break;default:vt(r,i,G,Y,c,J)}return;default:if(Sf(i)){for(var bt in s)Y=s[bt],s.hasOwnProperty(bt)&&Y!==void 0&&!c.hasOwnProperty(bt)&&sm(r,i,bt,void 0,c,Y);for(ne in c)Y=c[ne],J=s[ne],!c.hasOwnProperty(ne)||Y===J||Y===void 0&&J===void 0||sm(r,i,ne,Y,c,J);return}}for(var V in s)Y=s[V],s.hasOwnProperty(V)&&Y!=null&&!c.hasOwnProperty(V)&&vt(r,i,V,null,c,Y);for(ce in c)Y=c[ce],J=s[ce],!c.hasOwnProperty(ce)||Y===J||Y==null&&J==null||vt(r,i,ce,Y,c,J)}function Rx(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function i_(){if(typeof performance.getEntriesByType=="function"){for(var r=0,i=0,s=performance.getEntriesByType("resource"),c=0;c<s.length;c++){var p=s[c],v=p.transferSize,w=p.initiatorType,N=p.duration;if(v&&N&&Rx(w)){for(w=0,N=p.responseEnd,c+=1;c<s.length;c++){var L=s[c],G=L.startTime;if(G>N)break;var ne=L.transferSize,ce=L.initiatorType;ne&&Rx(ce)&&(L=L.responseEnd,w+=ne*(L<N?1:(N-G)/(L-G)))}if(--c,i+=8*(v+w)/(p.duration/1e3),r++,10<r)break}}if(0<r)return i/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var om=null,um=null;function Mc(r){return r.nodeType===9?r:r.ownerDocument}function zx(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Ox(r,i){if(r===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&i==="foreignObject"?0:r}function cm(r,i){return r==="textarea"||r==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var dm=null;function l_(){var r=window.event;return r&&r.type==="popstate"?r===dm?!1:(dm=r,!0):(dm=null,!1)}var Mx=typeof setTimeout=="function"?setTimeout:void 0,s_=typeof clearTimeout=="function"?clearTimeout:void 0,Dx=typeof Promise=="function"?Promise:void 0,o_=typeof queueMicrotask=="function"?queueMicrotask:typeof Dx<"u"?function(r){return Dx.resolve(null).then(r).catch(u_)}:Mx;function u_(r){setTimeout(function(){throw r})}function Ga(r){return r==="head"}function Lx(r,i){var s=i,c=0;do{var p=s.nextSibling;if(r.removeChild(s),p&&p.nodeType===8)if(s=p.data,s==="/$"||s==="/&"){if(c===0){r.removeChild(p),as(i);return}c--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")c++;else if(s==="html")Mo(r.ownerDocument.documentElement);else if(s==="head"){s=r.ownerDocument.head,Mo(s);for(var v=s.firstChild;v;){var w=v.nextSibling,N=v.nodeName;v[Xs]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&v.rel.toLowerCase()==="stylesheet"||s.removeChild(v),v=w}}else s==="body"&&Mo(r.ownerDocument.body);s=p}while(s);as(i)}function Ix(r,i){var s=r;r=0;do{var c=s.nextSibling;if(s.nodeType===1?i?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(i?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),c&&c.nodeType===8)if(s=c.data,s==="/$"){if(r===0)break;r--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||r++;s=c}while(s)}function fm(r){var i=r.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var s=i;switch(i=i.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":fm(s),yf(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}r.removeChild(s)}}function c_(r,i,s,c){for(;r.nodeType===1;){var p=s;if(r.nodeName.toLowerCase()!==i.toLowerCase()){if(!c&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(c){if(!r[Xs])switch(i){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(v=r.getAttribute("rel"),v==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(v!==p.rel||r.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||r.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||r.getAttribute("title")!==(p.title==null?null:p.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(v=r.getAttribute("src"),(v!==(p.src==null?null:p.src)||r.getAttribute("type")!==(p.type==null?null:p.type)||r.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&v&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(i==="input"&&r.type==="hidden"){var v=p.name==null?null:""+p.name;if(p.type==="hidden"&&r.getAttribute("name")===v)return r}else return r;if(r=fr(r.nextSibling),r===null)break}return null}function d_(r,i,s){if(i==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!s||(r=fr(r.nextSibling),r===null))return null;return r}function Ux(r,i){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!i||(r=fr(r.nextSibling),r===null))return null;return r}function hm(r){return r.data==="$?"||r.data==="$~"}function mm(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function f_(r,i){var s=r.ownerDocument;if(r.data==="$~")r._reactRetry=i;else if(r.data!=="$?"||s.readyState!=="loading")i();else{var c=function(){i(),s.removeEventListener("DOMContentLoaded",c)};s.addEventListener("DOMContentLoaded",c),r._reactRetry=c}}function fr(r){for(;r!=null;r=r.nextSibling){var i=r.nodeType;if(i===1||i===3)break;if(i===8){if(i=r.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return r}var pm=null;function Px(r){r=r.nextSibling;for(var i=0;r;){if(r.nodeType===8){var s=r.data;if(s==="/$"||s==="/&"){if(i===0)return fr(r.nextSibling);i--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||i++}r=r.nextSibling}return null}function Bx(r){r=r.previousSibling;for(var i=0;r;){if(r.nodeType===8){var s=r.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(i===0)return r;i--}else s!=="/$"&&s!=="/&"||i++}r=r.previousSibling}return null}function $x(r,i,s){switch(i=Mc(s),r){case"html":if(r=i.documentElement,!r)throw Error(a(452));return r;case"head":if(r=i.head,!r)throw Error(a(453));return r;case"body":if(r=i.body,!r)throw Error(a(454));return r;default:throw Error(a(451))}}function Mo(r){for(var i=r.attributes;i.length;)r.removeAttributeNode(i[0]);yf(r)}var hr=new Map,Fx=new Set;function Dc(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var fa=re.d;re.d={f:h_,r:m_,D:p_,C:g_,L:y_,m:v_,X:x_,S:b_,M:S_};function h_(){var r=fa.f(),i=Ec();return r||i}function m_(r){var i=kl(r);i!==null&&i.tag===5&&i.type==="form"?ib(i):fa.r(r)}var ts=typeof document>"u"?null:document;function qx(r,i,s){var c=ts;if(c&&typeof i=="string"&&i){var p=ir(i);p='link[rel="'+r+'"][href="'+p+'"]',typeof s=="string"&&(p+='[crossorigin="'+s+'"]'),Fx.has(p)||(Fx.add(p),r={rel:r,crossOrigin:s,href:i},c.querySelector(p)===null&&(i=c.createElement("link"),mn(i,"link",r),Wt(i),c.head.appendChild(i)))}}function p_(r){fa.D(r),qx("dns-prefetch",r,null)}function g_(r,i){fa.C(r,i),qx("preconnect",r,i)}function y_(r,i,s){fa.L(r,i,s);var c=ts;if(c&&r&&i){var p='link[rel="preload"][as="'+ir(i)+'"]';i==="image"&&s&&s.imageSrcSet?(p+='[imagesrcset="'+ir(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(p+='[imagesizes="'+ir(s.imageSizes)+'"]')):p+='[href="'+ir(r)+'"]';var v=p;switch(i){case"style":v=ns(r);break;case"script":v=rs(r)}hr.has(v)||(r=y({rel:"preload",href:i==="image"&&s&&s.imageSrcSet?void 0:r,as:i},s),hr.set(v,r),c.querySelector(p)!==null||i==="style"&&c.querySelector(Do(v))||i==="script"&&c.querySelector(Lo(v))||(i=c.createElement("link"),mn(i,"link",r),Wt(i),c.head.appendChild(i)))}}function v_(r,i){fa.m(r,i);var s=ts;if(s&&r){var c=i&&typeof i.as=="string"?i.as:"script",p='link[rel="modulepreload"][as="'+ir(c)+'"][href="'+ir(r)+'"]',v=p;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=rs(r)}if(!hr.has(v)&&(r=y({rel:"modulepreload",href:r},i),hr.set(v,r),s.querySelector(p)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Lo(v)))return}c=s.createElement("link"),mn(c,"link",r),Wt(c),s.head.appendChild(c)}}}function b_(r,i,s){fa.S(r,i,s);var c=ts;if(c&&r){var p=jl(c).hoistableStyles,v=ns(r);i=i||"default";var w=p.get(v);if(!w){var N={loading:0,preload:null};if(w=c.querySelector(Do(v)))N.loading=5;else{r=y({rel:"stylesheet",href:r,"data-precedence":i},s),(s=hr.get(v))&&gm(r,s);var L=w=c.createElement("link");Wt(L),mn(L,"link",r),L._p=new Promise(function(G,ne){L.onload=G,L.onerror=ne}),L.addEventListener("load",function(){N.loading|=1}),L.addEventListener("error",function(){N.loading|=2}),N.loading|=4,Lc(w,i,c)}w={type:"stylesheet",instance:w,count:1,state:N},p.set(v,w)}}}function x_(r,i){fa.X(r,i);var s=ts;if(s&&r){var c=jl(s).hoistableScripts,p=rs(r),v=c.get(p);v||(v=s.querySelector(Lo(p)),v||(r=y({src:r,async:!0},i),(i=hr.get(p))&&ym(r,i),v=s.createElement("script"),Wt(v),mn(v,"link",r),s.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},c.set(p,v))}}function S_(r,i){fa.M(r,i);var s=ts;if(s&&r){var c=jl(s).hoistableScripts,p=rs(r),v=c.get(p);v||(v=s.querySelector(Lo(p)),v||(r=y({src:r,async:!0,type:"module"},i),(i=hr.get(p))&&ym(r,i),v=s.createElement("script"),Wt(v),mn(v,"link",r),s.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},c.set(p,v))}}function Hx(r,i,s,c){var p=(p=ue.current)?Dc(p):null;if(!p)throw Error(a(446));switch(r){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(i=ns(s.href),s=jl(p).hoistableStyles,c=s.get(i),c||(c={type:"style",instance:null,count:0,state:null},s.set(i,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){r=ns(s.href);var v=jl(p).hoistableStyles,w=v.get(r);if(w||(p=p.ownerDocument||p,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(r,w),(v=p.querySelector(Do(r)))&&!v._p&&(w.instance=v,w.state.loading=5),hr.has(r)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},hr.set(r,s),v||w_(p,r,s,w.state))),i&&c===null)throw Error(a(528,""));return w}if(i&&c!==null)throw Error(a(529,""));return null;case"script":return i=s.async,s=s.src,typeof s=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=rs(s),s=jl(p).hoistableScripts,c=s.get(i),c||(c={type:"script",instance:null,count:0,state:null},s.set(i,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,r))}}function ns(r){return'href="'+ir(r)+'"'}function Do(r){return'link[rel="stylesheet"]['+r+"]"}function Zx(r){return y({},r,{"data-precedence":r.precedence,precedence:null})}function w_(r,i,s,c){r.querySelector('link[rel="preload"][as="style"]['+i+"]")?c.loading=1:(i=r.createElement("link"),c.preload=i,i.addEventListener("load",function(){return c.loading|=1}),i.addEventListener("error",function(){return c.loading|=2}),mn(i,"link",s),Wt(i),r.head.appendChild(i))}function rs(r){return'[src="'+ir(r)+'"]'}function Lo(r){return"script[async]"+r}function Vx(r,i,s){if(i.count++,i.instance===null)switch(i.type){case"style":var c=r.querySelector('style[data-href~="'+ir(s.href)+'"]');if(c)return i.instance=c,Wt(c),c;var p=y({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return c=(r.ownerDocument||r).createElement("style"),Wt(c),mn(c,"style",p),Lc(c,s.precedence,r),i.instance=c;case"stylesheet":p=ns(s.href);var v=r.querySelector(Do(p));if(v)return i.state.loading|=4,i.instance=v,Wt(v),v;c=Zx(s),(p=hr.get(p))&&gm(c,p),v=(r.ownerDocument||r).createElement("link"),Wt(v);var w=v;return w._p=new Promise(function(N,L){w.onload=N,w.onerror=L}),mn(v,"link",c),i.state.loading|=4,Lc(v,s.precedence,r),i.instance=v;case"script":return v=rs(s.src),(p=r.querySelector(Lo(v)))?(i.instance=p,Wt(p),p):(c=s,(p=hr.get(v))&&(c=y({},s),ym(c,p)),r=r.ownerDocument||r,p=r.createElement("script"),Wt(p),mn(p,"link",c),r.head.appendChild(p),i.instance=p);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(c=i.instance,i.state.loading|=4,Lc(c,s.precedence,r));return i.instance}function Lc(r,i,s){for(var c=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=c.length?c[c.length-1]:null,v=p,w=0;w<c.length;w++){var N=c[w];if(N.dataset.precedence===i)v=N;else if(v!==p)break}v?v.parentNode.insertBefore(r,v.nextSibling):(i=s.nodeType===9?s.head:s,i.insertBefore(r,i.firstChild))}function gm(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.title==null&&(r.title=i.title)}function ym(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.integrity==null&&(r.integrity=i.integrity)}var Ic=null;function Qx(r,i,s){if(Ic===null){var c=new Map,p=Ic=new Map;p.set(s,c)}else p=Ic,c=p.get(s),c||(c=new Map,p.set(s,c));if(c.has(r))return c;for(c.set(r,null),s=s.getElementsByTagName(r),p=0;p<s.length;p++){var v=s[p];if(!(v[Xs]||v[cn]||r==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var w=v.getAttribute(i)||"";w=r+w;var N=c.get(w);N?N.push(v):c.set(w,[v])}}return c}function Gx(r,i,s){r=r.ownerDocument||r,r.head.insertBefore(s,i==="title"?r.querySelector("head > title"):null)}function k_(r,i,s){if(s===1||i.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;switch(i.rel){case"stylesheet":return r=i.disabled,typeof i.precedence=="string"&&r==null;default:return!0}case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function Kx(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function j_(r,i,s,c){if(s.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var p=ns(c.href),v=i.querySelector(Do(p));if(v){i=v._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(r.count++,r=Uc.bind(r),i.then(r,r)),s.state.loading|=4,s.instance=v,Wt(v);return}v=i.ownerDocument||i,c=Zx(c),(p=hr.get(p))&&gm(c,p),v=v.createElement("link"),Wt(v);var w=v;w._p=new Promise(function(N,L){w.onload=N,w.onerror=L}),mn(v,"link",c),s.instance=v}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(s,i),(i=s.state.preload)&&(s.state.loading&3)===0&&(r.count++,s=Uc.bind(r),i.addEventListener("load",s),i.addEventListener("error",s))}}var vm=0;function C_(r,i){return r.stylesheets&&r.count===0&&Bc(r,r.stylesheets),0<r.count||0<r.imgCount?function(s){var c=setTimeout(function(){if(r.stylesheets&&Bc(r,r.stylesheets),r.unsuspend){var v=r.unsuspend;r.unsuspend=null,v()}},6e4+i);0<r.imgBytes&&vm===0&&(vm=62500*i_());var p=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&Bc(r,r.stylesheets),r.unsuspend)){var v=r.unsuspend;r.unsuspend=null,v()}},(r.imgBytes>vm?50:800)+i);return r.unsuspend=s,function(){r.unsuspend=null,clearTimeout(c),clearTimeout(p)}}:null}function Uc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Bc(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var Pc=null;function Bc(r,i){r.stylesheets=null,r.unsuspend!==null&&(r.count++,Pc=new Map,i.forEach(E_,r),Pc=null,Uc.call(r))}function E_(r,i){if(!(i.state.loading&4)){var s=Pc.get(r);if(s)var c=s.get(null);else{s=new Map,Pc.set(r,s);for(var p=r.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<p.length;v++){var w=p[v];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(s.set(w.dataset.precedence,w),c=w)}c&&s.set(null,c)}p=i.instance,w=p.getAttribute("data-precedence"),v=s.get(w)||c,v===c&&s.set(null,p),s.set(w,p),this.count++,c=Uc.bind(this),p.addEventListener("load",c),p.addEventListener("error",c),v?v.parentNode.insertBefore(p,v.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(p,r.firstChild)),i.state.loading|=4}}var Io={$$typeof:O,Provider:null,Consumer:null,_currentValue:K,_currentValue2:K,_threadCount:0};function N_(r,i,s,c,p,v,w,N,L){this.tag=1,this.containerInfo=r,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=kr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=kr(0),this.hiddenUpdates=kr(null),this.identifierPrefix=c,this.onUncaughtError=p,this.onCaughtError=v,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=L,this.incompleteTransitions=new Map}function Yx(r,i,s,c,p,v,w,N,L,G,ne,ce){return r=new N_(r,i,s,w,L,G,ne,ce,N),i=1,v===!0&&(i|=24),v=Qn(3,null,null,i),r.current=v,v.stateNode=r,i=Xf(),i.refCount++,r.pooledCache=i,i.refCount++,v.memoizedState={element:c,isDehydrated:s,cache:i},th(v),r}function Xx(r){return r?(r=Ml,r):Ml}function Jx(r,i,s,c,p,v){p=Xx(p),c.context===null?c.context=p:c.pendingContext=p,c=Ia(i),c.payload={element:s},v=v===void 0?null:v,v!==null&&(c.callback=v),s=Ua(r,c,i),s!==null&&(In(s,r,i),po(s,r,i))}function Wx(r,i){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var s=r.retryLane;r.retryLane=s!==0&&s<i?s:i}}function bm(r,i){Wx(r,i),(r=r.alternate)&&Wx(r,i)}function e0(r){if(r.tag===13||r.tag===31){var i=Ii(r,67108864);i!==null&&In(i,r,67108864),bm(r,67108864)}}function t0(r){if(r.tag===13||r.tag===31){var i=Jn();i=mf(i);var s=Ii(r,i);s!==null&&In(s,r,i),bm(r,i)}}var $c=!0;function __(r,i,s,c){var p=H.T;H.T=null;var v=re.p;try{re.p=2,xm(r,i,s,c)}finally{re.p=v,H.T=p}}function A_(r,i,s,c){var p=H.T;H.T=null;var v=re.p;try{re.p=8,xm(r,i,s,c)}finally{re.p=v,H.T=p}}function xm(r,i,s,c){if($c){var p=Sm(c);if(p===null)lm(r,i,c,Fc,s),r0(r,c);else if(R_(p,r,i,s,c))c.stopPropagation();else if(r0(r,c),i&4&&-1<T_.indexOf(r)){for(;p!==null;){var v=kl(p);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var w=Rr(v.pendingLanes);if(w!==0){var N=v;for(N.pendingLanes|=2,N.entangledLanes|=2;w;){var L=1<<31-dt(w);N.entanglements[1]|=L,w&=~L}Dr(v),(ct&6)===0&&(jc=sn()+500,Ro(0))}}break;case 31:case 13:N=Ii(v,2),N!==null&&In(N,v,2),Ec(),bm(v,2)}if(v=Sm(c),v===null&&lm(r,i,c,Fc,s),v===p)break;p=v}p!==null&&c.stopPropagation()}else lm(r,i,c,null,s)}}function Sm(r){return r=kf(r),wm(r)}var Fc=null;function wm(r){if(Fc=null,r=wl(r),r!==null){var i=o(r);if(i===null)r=null;else{var s=i.tag;if(s===13){if(r=u(i),r!==null)return r;r=null}else if(s===31){if(r=f(i),r!==null)return r;r=null}else if(s===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;r=null}else i!==r&&(r=null)}}return Fc=r,null}function n0(r){switch(r){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ys()){case ie:return 2;case ye:return 8;case Te:case $e:return 32;case lt:return 268435456;default:return 32}default:return 32}}var km=!1,Ka=null,Ya=null,Xa=null,Uo=new Map,Po=new Map,Ja=[],T_="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function r0(r,i){switch(r){case"focusin":case"focusout":Ka=null;break;case"dragenter":case"dragleave":Ya=null;break;case"mouseover":case"mouseout":Xa=null;break;case"pointerover":case"pointerout":Uo.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Po.delete(i.pointerId)}}function Bo(r,i,s,c,p,v){return r===null||r.nativeEvent!==v?(r={blockedOn:i,domEventName:s,eventSystemFlags:c,nativeEvent:v,targetContainers:[p]},i!==null&&(i=kl(i),i!==null&&e0(i)),r):(r.eventSystemFlags|=c,i=r.targetContainers,p!==null&&i.indexOf(p)===-1&&i.push(p),r)}function R_(r,i,s,c,p){switch(i){case"focusin":return Ka=Bo(Ka,r,i,s,c,p),!0;case"dragenter":return Ya=Bo(Ya,r,i,s,c,p),!0;case"mouseover":return Xa=Bo(Xa,r,i,s,c,p),!0;case"pointerover":var v=p.pointerId;return Uo.set(v,Bo(Uo.get(v)||null,r,i,s,c,p)),!0;case"gotpointercapture":return v=p.pointerId,Po.set(v,Bo(Po.get(v)||null,r,i,s,c,p)),!0}return!1}function a0(r){var i=wl(r.target);if(i!==null){var s=o(i);if(s!==null){if(i=s.tag,i===13){if(i=u(s),i!==null){r.blockedOn=i,vy(r.priority,function(){t0(s)});return}}else if(i===31){if(i=f(s),i!==null){r.blockedOn=i,vy(r.priority,function(){t0(s)});return}}else if(i===3&&s.stateNode.current.memoizedState.isDehydrated){r.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}r.blockedOn=null}function qc(r){if(r.blockedOn!==null)return!1;for(var i=r.targetContainers;0<i.length;){var s=Sm(r.nativeEvent);if(s===null){s=r.nativeEvent;var c=new s.constructor(s.type,s);wf=c,s.target.dispatchEvent(c),wf=null}else return i=kl(s),i!==null&&e0(i),r.blockedOn=s,!1;i.shift()}return!0}function i0(r,i,s){qc(r)&&s.delete(i)}function z_(){km=!1,Ka!==null&&qc(Ka)&&(Ka=null),Ya!==null&&qc(Ya)&&(Ya=null),Xa!==null&&qc(Xa)&&(Xa=null),Uo.forEach(i0),Po.forEach(i0)}function Hc(r,i){r.blockedOn===i&&(r.blockedOn=null,km||(km=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,z_)))}var Zc=null;function l0(r){Zc!==r&&(Zc=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Zc===r&&(Zc=null);for(var i=0;i<r.length;i+=3){var s=r[i],c=r[i+1],p=r[i+2];if(typeof c!="function"){if(wm(c||s)===null)continue;break}var v=kl(s);v!==null&&(r.splice(i,3),i-=3,Sh(v,{pending:!0,data:p,method:s.method,action:c},c,p))}}))}function as(r){function i(L){return Hc(L,r)}Ka!==null&&Hc(Ka,r),Ya!==null&&Hc(Ya,r),Xa!==null&&Hc(Xa,r),Uo.forEach(i),Po.forEach(i);for(var s=0;s<Ja.length;s++){var c=Ja[s];c.blockedOn===r&&(c.blockedOn=null)}for(;0<Ja.length&&(s=Ja[0],s.blockedOn===null);)a0(s),s.blockedOn===null&&Ja.shift();if(s=(r.ownerDocument||r).$$reactFormReplay,s!=null)for(c=0;c<s.length;c+=3){var p=s[c],v=s[c+1],w=p[Rn]||null;if(typeof v=="function")w||l0(s);else if(w){var N=null;if(v&&v.hasAttribute("formAction")){if(p=v,w=v[Rn]||null)N=w.formAction;else if(wm(p)!==null)continue}else N=w.action;typeof N=="function"?s[c+1]=N:(s.splice(c,3),c-=3),l0(s)}}}function s0(){function r(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(w){return p=w})},focusReset:"manual",scroll:"manual"})}function i(){p!==null&&(p(),p=null),c||setTimeout(s,20)}function s(){if(!c&&!navigation.transition){var v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,p=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(s,100),function(){c=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),p!==null&&(p(),p=null)}}}function jm(r){this._internalRoot=r}Vc.prototype.render=jm.prototype.render=function(r){var i=this._internalRoot;if(i===null)throw Error(a(409));var s=i.current,c=Jn();Jx(s,c,r,i,null,null)},Vc.prototype.unmount=jm.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var i=r.containerInfo;Jx(r.current,2,null,r,null,null),Ec(),i[Sl]=null}};function Vc(r){this._internalRoot=r}Vc.prototype.unstable_scheduleHydration=function(r){if(r){var i=yy();r={blockedOn:null,target:r,priority:i};for(var s=0;s<Ja.length&&i!==0&&i<Ja[s].priority;s++);Ja.splice(s,0,r),s===0&&a0(r)}};var o0=t.version;if(o0!=="19.2.4")throw Error(a(527,o0,"19.2.4"));re.findDOMNode=function(r){var i=r._reactInternals;if(i===void 0)throw typeof r.render=="function"?Error(a(188)):(r=Object.keys(r).join(","),Error(a(268,r)));return r=h(i),r=r!==null?g(r):null,r=r===null?null:r.stateNode,r};var O_={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Qc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Qc.isDisabled&&Qc.supportsFiber)try{Jt=Qc.inject(O_),Dt=Qc}catch{}}return Fo.createRoot=function(r,i){if(!l(r))throw Error(a(299));var s=!1,c="",p=pb,v=gb,w=yb;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(c=i.identifierPrefix),i.onUncaughtError!==void 0&&(p=i.onUncaughtError),i.onCaughtError!==void 0&&(v=i.onCaughtError),i.onRecoverableError!==void 0&&(w=i.onRecoverableError)),i=Yx(r,1,!1,null,null,s,c,null,p,v,w,s0),r[Sl]=i.current,im(r),new jm(i)},Fo.hydrateRoot=function(r,i,s){if(!l(r))throw Error(a(299));var c=!1,p="",v=pb,w=gb,N=yb,L=null;return s!=null&&(s.unstable_strictMode===!0&&(c=!0),s.identifierPrefix!==void 0&&(p=s.identifierPrefix),s.onUncaughtError!==void 0&&(v=s.onUncaughtError),s.onCaughtError!==void 0&&(w=s.onCaughtError),s.onRecoverableError!==void 0&&(N=s.onRecoverableError),s.formState!==void 0&&(L=s.formState)),i=Yx(r,1,!0,i,s??null,c,p,L,v,w,N,s0),i.context=Xx(null),s=i.current,c=Jn(),c=mf(c),p=Ia(c),p.callback=null,Ua(s,p,c),s=c,i.current.lanes=s,Aa(i,s),Dr(i),r[Sl]=i.current,im(r),new Vc(i)},Fo.version="19.2.4",Fo}var b0;function H_(){if(b0)return _m.exports;b0=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),_m.exports=q_(),_m.exports}var Z_=H_(),Bs=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(){}},Wi,li,Ss,BS,V_=(BS=class extends Bs{constructor(){super();_e(this,Wi);_e(this,li);_e(this,Ss);xe(this,Ss,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){P(this,li)||this.setEventListener(P(this,Ss))}onUnsubscribe(){var t;this.hasListeners()||((t=P(this,li))==null||t.call(this),xe(this,li,void 0))}setEventListener(t){var n;xe(this,Ss,t),(n=P(this,li))==null||n.call(this),xe(this,li,t(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()}))}setFocused(t){P(this,Wi)!==t&&(xe(this,Wi,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof P(this,Wi)=="boolean"?P(this,Wi):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Wi=new WeakMap,li=new WeakMap,Ss=new WeakMap,BS),dg=new V_,Q_={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},si,og,$S,G_=($S=class{constructor(){_e(this,si,Q_);_e(this,og,!1)}setTimeoutProvider(e){xe(this,si,e)}setTimeout(e,t){return P(this,si).setTimeout(e,t)}clearTimeout(e){P(this,si).clearTimeout(e)}setInterval(e,t){return P(this,si).setInterval(e,t)}clearInterval(e){P(this,si).clearInterval(e)}},si=new WeakMap,og=new WeakMap,$S),Ji=new G_;function K_(e){setTimeout(e,0)}var Y_=typeof window>"u"||"Deno"in globalThis;function En(){}function X_(e,t){return typeof e=="function"?e(t):e}function vp(e){return typeof e=="number"&&e>=0&&e!==1/0}function JS(e,t){return Math.max(e+(t||0)-Date.now(),0)}function gi(e,t){return typeof e=="function"?e(t):e}function pr(e,t){return typeof e=="function"?e(t):e}function x0(e,t){const{type:n="all",exact:a,fetchStatus:l,predicate:o,queryKey:u,stale:f}=e;if(u){if(a){if(t.queryHash!==fg(u,t.options))return!1}else if(!su(t.queryKey,u))return!1}if(n!=="all"){const m=t.isActive();if(n==="active"&&!m||n==="inactive"&&m)return!1}return!(typeof f=="boolean"&&t.isStale()!==f||l&&l!==t.state.fetchStatus||o&&!o(t))}function S0(e,t){const{exact:n,status:a,predicate:l,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(ol(t.options.mutationKey)!==ol(o))return!1}else if(!su(t.options.mutationKey,o))return!1}return!(a&&t.state.status!==a||l&&!l(t))}function fg(e,t){return((t==null?void 0:t.queryKeyHashFn)||ol)(e)}function ol(e){return JSON.stringify(e,(t,n)=>bp(n)?Object.keys(n).sort().reduce((a,l)=>(a[l]=n[l],a),{}):n)}function su(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>su(e[n],t[n])):!1}var J_=Object.prototype.hasOwnProperty;function WS(e,t,n=0){if(e===t)return e;if(n>500)return t;const a=w0(e)&&w0(t);if(!a&&!(bp(e)&&bp(t)))return t;const o=(a?e:Object.keys(e)).length,u=a?t:Object.keys(t),f=u.length,m=a?new Array(f):{};let h=0;for(let g=0;g<f;g++){const y=a?g:u[g],b=e[y],S=t[y];if(b===S){m[y]=b,(a?g<o:J_.call(e,y))&&h++;continue}if(b===null||S===null||typeof b!="object"||typeof S!="object"){m[y]=S;continue}const k=WS(b,S,n+1);m[y]=k,k===b&&h++}return o===f&&h===o?e:m}function jd(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function w0(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function bp(e){if(!k0(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!k0(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function k0(e){return Object.prototype.toString.call(e)==="[object Object]"}function W_(e){return new Promise(t=>{Ji.setTimeout(t,e)})}function xp(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?WS(e,t):t}function e2(e,t,n=0){const a=[...e,t];return n&&a.length>n?a.slice(1):a}function t2(e,t,n=0){const a=[t,...e];return n&&a.length>n?a.slice(0,-1):a}var hg=Symbol();function ew(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===hg?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function mg(e,t){return typeof e=="function"?e(...t):!!e}function n2(e,t,n){let a=!1,l;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(l??(l=t()),a||(a=!0,l.aborted?n():l.addEventListener("abort",n,{once:!0})),l)}),e}var ou=(()=>{let e=()=>Y_;return{isServer(){return e()},setIsServer(t){e=t}}})();function Sp(){let e,t;const n=new Promise((l,o)=>{e=l,t=o});n.status="pending",n.catch(()=>{});function a(l){Object.assign(n,l),delete n.resolve,delete n.reject}return n.resolve=l=>{a({status:"fulfilled",value:l}),e(l)},n.reject=l=>{a({status:"rejected",reason:l}),t(l)},n}var r2=K_;function a2(){let e=[],t=0,n=f=>{f()},a=f=>{f()},l=r2;const o=f=>{t?e.push(f):l(()=>{n(f)})},u=()=>{const f=e;e=[],f.length&&l(()=>{a(()=>{f.forEach(m=>{n(m)})})})};return{batch:f=>{let m;t++;try{m=f()}finally{t--,t||u()}return m},batchCalls:f=>(...m)=>{o(()=>{f(...m)})},schedule:o,setNotifyFunction:f=>{n=f},setBatchNotifyFunction:f=>{a=f},setScheduler:f=>{l=f}}}var Yt=a2(),ws,oi,ks,FS,i2=(FS=class extends Bs{constructor(){super();_e(this,ws,!0);_e(this,oi);_e(this,ks);xe(this,ks,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),a=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",a,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",a)}}})}onSubscribe(){P(this,oi)||this.setEventListener(P(this,ks))}onUnsubscribe(){var t;this.hasListeners()||((t=P(this,oi))==null||t.call(this),xe(this,oi,void 0))}setEventListener(t){var n;xe(this,ks,t),(n=P(this,oi))==null||n.call(this),xe(this,oi,t(this.setOnline.bind(this)))}setOnline(t){P(this,ws)!==t&&(xe(this,ws,t),this.listeners.forEach(a=>{a(t)}))}isOnline(){return P(this,ws)}},ws=new WeakMap,oi=new WeakMap,ks=new WeakMap,FS),Cd=new i2;function l2(e){return Math.min(1e3*2**e,3e4)}function tw(e){return(e??"online")==="online"?Cd.isOnline():!0}var wp=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function nw(e){let t=!1,n=0,a;const l=Sp(),o=()=>l.status!=="pending",u=j=>{var E;if(!o()){const C=new wp(j);b(C),(E=e.onCancel)==null||E.call(e,C)}},f=()=>{t=!0},m=()=>{t=!1},h=()=>dg.isFocused()&&(e.networkMode==="always"||Cd.isOnline())&&e.canRun(),g=()=>tw(e.networkMode)&&e.canRun(),y=j=>{o()||(a==null||a(),l.resolve(j))},b=j=>{o()||(a==null||a(),l.reject(j))},S=()=>new Promise(j=>{var E;a=C=>{(o()||h())&&j(C)},(E=e.onPause)==null||E.call(e)}).then(()=>{var j;a=void 0,o()||(j=e.onContinue)==null||j.call(e)}),k=()=>{if(o())return;let j;const E=n===0?e.initialPromise:void 0;try{j=E??e.fn()}catch(C){j=Promise.reject(C)}Promise.resolve(j).then(y).catch(C=>{var R;if(o())return;const T=e.retry??(ou.isServer()?0:3),O=e.retryDelay??l2,B=typeof O=="function"?O(n,C):O,M=T===!0||typeof T=="number"&&n<T||typeof T=="function"&&T(n,C);if(t||!M){b(C);return}n++,(R=e.onFail)==null||R.call(e,n,C),W_(B).then(()=>h()?void 0:S()).then(()=>{t?b(C):k()})})};return{promise:l,status:()=>l.status,cancel:u,continue:()=>(a==null||a(),l),cancelRetry:f,continueRetry:m,canStart:g,start:()=>(g()?k():S().then(k),l)}}var el,qS,rw=(qS=class{constructor(){_e(this,el)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),vp(this.gcTime)&&xe(this,el,Ji.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ou.isServer()?1/0:300*1e3))}clearGcTimeout(){P(this,el)&&(Ji.clearTimeout(P(this,el)),xe(this,el,void 0))}},el=new WeakMap,qS),tl,js,mr,nl,tn,vu,rl,er,aw,ma,HS,s2=(HS=class extends rw{constructor(t){super();_e(this,er);_e(this,tl);_e(this,js);_e(this,mr);_e(this,nl);_e(this,tn);_e(this,vu);_e(this,rl);xe(this,rl,!1),xe(this,vu,t.defaultOptions),this.setOptions(t.options),this.observers=[],xe(this,nl,t.client),xe(this,mr,P(this,nl).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,xe(this,tl,C0(this.options)),this.state=t.state??P(this,tl),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=P(this,tn))==null?void 0:t.promise}setOptions(t){if(this.options={...P(this,vu),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=C0(this.options);n.data!==void 0&&(this.setState(j0(n.data,n.dataUpdatedAt)),xe(this,tl,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&P(this,mr).remove(this)}setData(t,n){const a=xp(this.state.data,t,this.options);return qe(this,er,ma).call(this,{data:a,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),a}setState(t,n){qe(this,er,ma).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var a,l;const n=(a=P(this,tn))==null?void 0:a.promise;return(l=P(this,tn))==null||l.cancel(t),n?n.then(En).catch(En):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return P(this,tl)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>pr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===hg||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>gi(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!JS(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(a=>a.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=P(this,tn))==null||n.continue()}onOnline(){var n;const t=this.observers.find(a=>a.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=P(this,tn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),P(this,mr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(P(this,tn)&&(P(this,rl)||qe(this,er,aw).call(this)?P(this,tn).cancel({revert:!0}):P(this,tn).cancelRetry()),this.scheduleGc()),P(this,mr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||qe(this,er,ma).call(this,{type:"invalidate"})}async fetch(t,n){var m,h,g,y,b,S,k,j,E,C,T,O;if(this.state.fetchStatus!=="idle"&&((m=P(this,tn))==null?void 0:m.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(P(this,tn))return P(this,tn).continueRetry(),P(this,tn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const B=this.observers.find(M=>M.options.queryFn);B&&this.setOptions(B.options)}const a=new AbortController,l=B=>{Object.defineProperty(B,"signal",{enumerable:!0,get:()=>(xe(this,rl,!0),a.signal)})},o=()=>{const B=ew(this.options,n),R=(()=>{const D={client:P(this,nl),queryKey:this.queryKey,meta:this.meta};return l(D),D})();return xe(this,rl,!1),this.options.persister?this.options.persister(B,R,this):B(R)},f=(()=>{const B={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:P(this,nl),state:this.state,fetchFn:o};return l(B),B})();(h=this.options.behavior)==null||h.onFetch(f,this),xe(this,js,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((g=f.fetchOptions)==null?void 0:g.meta))&&qe(this,er,ma).call(this,{type:"fetch",meta:(y=f.fetchOptions)==null?void 0:y.meta}),xe(this,tn,nw({initialPromise:n==null?void 0:n.initialPromise,fn:f.fetchFn,onCancel:B=>{B instanceof wp&&B.revert&&this.setState({...P(this,js),fetchStatus:"idle"}),a.abort()},onFail:(B,M)=>{qe(this,er,ma).call(this,{type:"failed",failureCount:B,error:M})},onPause:()=>{qe(this,er,ma).call(this,{type:"pause"})},onContinue:()=>{qe(this,er,ma).call(this,{type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.options.networkMode,canRun:()=>!0}));try{const B=await P(this,tn).start();if(B===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(B),(S=(b=P(this,mr).config).onSuccess)==null||S.call(b,B,this),(j=(k=P(this,mr).config).onSettled)==null||j.call(k,B,this.state.error,this),B}catch(B){if(B instanceof wp){if(B.silent)return P(this,tn).promise;if(B.revert){if(this.state.data===void 0)throw B;return this.state.data}}throw qe(this,er,ma).call(this,{type:"error",error:B}),(C=(E=P(this,mr).config).onError)==null||C.call(E,B,this),(O=(T=P(this,mr).config).onSettled)==null||O.call(T,this.state.data,B,this),B}finally{this.scheduleGc()}}},tl=new WeakMap,js=new WeakMap,mr=new WeakMap,nl=new WeakMap,tn=new WeakMap,vu=new WeakMap,rl=new WeakMap,er=new WeakSet,aw=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},ma=function(t){const n=a=>{switch(t.type){case"failed":return{...a,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...a,fetchStatus:"paused"};case"continue":return{...a,fetchStatus:"fetching"};case"fetch":return{...a,...iw(a.data,this.options),fetchMeta:t.meta??null};case"success":const l={...a,...j0(t.data,t.dataUpdatedAt),dataUpdateCount:a.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return xe(this,js,t.manual?l:void 0),l;case"error":const o=t.error;return{...a,error:o,errorUpdateCount:a.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:a.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...a,isInvalidated:!0};case"setState":return{...a,...t.state}}};this.state=n(this.state),Yt.batch(()=>{this.observers.forEach(a=>{a.onQueryUpdate()}),P(this,mr).notify({query:this,type:"updated",action:t})})},HS);function iw(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:tw(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function j0(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function C0(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,a=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?a??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Pn,nt,bu,Cn,al,Cs,pa,ui,xu,Es,Ns,il,ll,ci,_s,ht,Jo,kp,jp,Cp,Ep,Np,_p,Ap,lw,ZS,o2=(ZS=class extends Bs{constructor(t,n){super();_e(this,ht);_e(this,Pn);_e(this,nt);_e(this,bu);_e(this,Cn);_e(this,al);_e(this,Cs);_e(this,pa);_e(this,ui);_e(this,xu);_e(this,Es);_e(this,Ns);_e(this,il);_e(this,ll);_e(this,ci);_e(this,_s,new Set);this.options=n,xe(this,Pn,t),xe(this,ui,null),xe(this,pa,Sp()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(P(this,nt).addObserver(this),E0(P(this,nt),this.options)?qe(this,ht,Jo).call(this):this.updateResult(),qe(this,ht,Ep).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Tp(P(this,nt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Tp(P(this,nt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,qe(this,ht,Np).call(this),qe(this,ht,_p).call(this),P(this,nt).removeObserver(this)}setOptions(t){const n=this.options,a=P(this,nt);if(this.options=P(this,Pn).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof pr(this.options.enabled,P(this,nt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");qe(this,ht,Ap).call(this),P(this,nt).setOptions(this.options),n._defaulted&&!jd(this.options,n)&&P(this,Pn).getQueryCache().notify({type:"observerOptionsUpdated",query:P(this,nt),observer:this});const l=this.hasListeners();l&&N0(P(this,nt),a,this.options,n)&&qe(this,ht,Jo).call(this),this.updateResult(),l&&(P(this,nt)!==a||pr(this.options.enabled,P(this,nt))!==pr(n.enabled,P(this,nt))||gi(this.options.staleTime,P(this,nt))!==gi(n.staleTime,P(this,nt)))&&qe(this,ht,kp).call(this);const o=qe(this,ht,jp).call(this);l&&(P(this,nt)!==a||pr(this.options.enabled,P(this,nt))!==pr(n.enabled,P(this,nt))||o!==P(this,ci))&&qe(this,ht,Cp).call(this,o)}getOptimisticResult(t){const n=P(this,Pn).getQueryCache().build(P(this,Pn),t),a=this.createResult(n,t);return c2(this,a)&&(xe(this,Cn,a),xe(this,Cs,this.options),xe(this,al,P(this,nt).state)),a}getCurrentResult(){return P(this,Cn)}trackResult(t,n){return new Proxy(t,{get:(a,l)=>(this.trackProp(l),n==null||n(l),l==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&P(this,pa).status==="pending"&&P(this,pa).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(a,l))})}trackProp(t){P(this,_s).add(t)}getCurrentQuery(){return P(this,nt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=P(this,Pn).defaultQueryOptions(t),a=P(this,Pn).getQueryCache().build(P(this,Pn),n);return a.fetch().then(()=>this.createResult(a,n))}fetch(t){return qe(this,ht,Jo).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),P(this,Cn)))}createResult(t,n){var te;const a=P(this,nt),l=this.options,o=P(this,Cn),u=P(this,al),f=P(this,Cs),h=t!==a?t.state:P(this,bu),{state:g}=t;let y={...g},b=!1,S;if(n._optimisticResults){const q=this.hasListeners(),oe=!q&&E0(t,n),W=q&&N0(t,a,n,l);(oe||W)&&(y={...y,...iw(g.data,t.options)}),n._optimisticResults==="isRestoring"&&(y.fetchStatus="idle")}let{error:k,errorUpdatedAt:j,status:E}=y;S=y.data;let C=!1;if(n.placeholderData!==void 0&&S===void 0&&E==="pending"){let q;o!=null&&o.isPlaceholderData&&n.placeholderData===(f==null?void 0:f.placeholderData)?(q=o.data,C=!0):q=typeof n.placeholderData=="function"?n.placeholderData((te=P(this,Ns))==null?void 0:te.state.data,P(this,Ns)):n.placeholderData,q!==void 0&&(E="success",S=xp(o==null?void 0:o.data,q,n),b=!0)}if(n.select&&S!==void 0&&!C)if(o&&S===(u==null?void 0:u.data)&&n.select===P(this,xu))S=P(this,Es);else try{xe(this,xu,n.select),S=n.select(S),S=xp(o==null?void 0:o.data,S,n),xe(this,Es,S),xe(this,ui,null)}catch(q){xe(this,ui,q)}P(this,ui)&&(k=P(this,ui),S=P(this,Es),j=Date.now(),E="error");const T=y.fetchStatus==="fetching",O=E==="pending",B=E==="error",M=O&&T,R=S!==void 0,Z={status:E,fetchStatus:y.fetchStatus,isPending:O,isSuccess:E==="success",isError:B,isInitialLoading:M,isLoading:M,data:S,dataUpdatedAt:y.dataUpdatedAt,error:k,errorUpdatedAt:j,failureCount:y.fetchFailureCount,failureReason:y.fetchFailureReason,errorUpdateCount:y.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:y.dataUpdateCount>h.dataUpdateCount||y.errorUpdateCount>h.errorUpdateCount,isFetching:T,isRefetching:T&&!O,isLoadingError:B&&!R,isPaused:y.fetchStatus==="paused",isPlaceholderData:b,isRefetchError:B&&R,isStale:pg(t,n),refetch:this.refetch,promise:P(this,pa),isEnabled:pr(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const q=Z.data!==void 0,oe=Z.status==="error"&&!q,W=ee=>{oe?ee.reject(Z.error):q&&ee.resolve(Z.data)},me=()=>{const ee=xe(this,pa,Z.promise=Sp());W(ee)},de=P(this,pa);switch(de.status){case"pending":t.queryHash===a.queryHash&&W(de);break;case"fulfilled":(oe||Z.data!==de.value)&&me();break;case"rejected":(!oe||Z.error!==de.reason)&&me();break}}return Z}updateResult(){const t=P(this,Cn),n=this.createResult(P(this,nt),this.options);if(xe(this,al,P(this,nt).state),xe(this,Cs,this.options),P(this,al).data!==void 0&&xe(this,Ns,P(this,nt)),jd(n,t))return;xe(this,Cn,n);const a=()=>{if(!t)return!0;const{notifyOnChangeProps:l}=this.options,o=typeof l=="function"?l():l;if(o==="all"||!o&&!P(this,_s).size)return!0;const u=new Set(o??P(this,_s));return this.options.throwOnError&&u.add("error"),Object.keys(P(this,Cn)).some(f=>{const m=f;return P(this,Cn)[m]!==t[m]&&u.has(m)})};qe(this,ht,lw).call(this,{listeners:a()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&qe(this,ht,Ep).call(this)}},Pn=new WeakMap,nt=new WeakMap,bu=new WeakMap,Cn=new WeakMap,al=new WeakMap,Cs=new WeakMap,pa=new WeakMap,ui=new WeakMap,xu=new WeakMap,Es=new WeakMap,Ns=new WeakMap,il=new WeakMap,ll=new WeakMap,ci=new WeakMap,_s=new WeakMap,ht=new WeakSet,Jo=function(t){qe(this,ht,Ap).call(this);let n=P(this,nt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(En)),n},kp=function(){qe(this,ht,Np).call(this);const t=gi(this.options.staleTime,P(this,nt));if(ou.isServer()||P(this,Cn).isStale||!vp(t))return;const a=JS(P(this,Cn).dataUpdatedAt,t)+1;xe(this,il,Ji.setTimeout(()=>{P(this,Cn).isStale||this.updateResult()},a))},jp=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(P(this,nt)):this.options.refetchInterval)??!1},Cp=function(t){qe(this,ht,_p).call(this),xe(this,ci,t),!(ou.isServer()||pr(this.options.enabled,P(this,nt))===!1||!vp(P(this,ci))||P(this,ci)===0)&&xe(this,ll,Ji.setInterval(()=>{(this.options.refetchIntervalInBackground||dg.isFocused())&&qe(this,ht,Jo).call(this)},P(this,ci)))},Ep=function(){qe(this,ht,kp).call(this),qe(this,ht,Cp).call(this,qe(this,ht,jp).call(this))},Np=function(){P(this,il)&&(Ji.clearTimeout(P(this,il)),xe(this,il,void 0))},_p=function(){P(this,ll)&&(Ji.clearInterval(P(this,ll)),xe(this,ll,void 0))},Ap=function(){const t=P(this,Pn).getQueryCache().build(P(this,Pn),this.options);if(t===P(this,nt))return;const n=P(this,nt);xe(this,nt,t),xe(this,bu,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},lw=function(t){Yt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(P(this,Cn))}),P(this,Pn).getQueryCache().notify({query:P(this,nt),type:"observerResultsUpdated"})})},ZS);function u2(e,t){return pr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function E0(e,t){return u2(e,t)||e.state.data!==void 0&&Tp(e,t,t.refetchOnMount)}function Tp(e,t,n){if(pr(t.enabled,e)!==!1&&gi(t.staleTime,e)!=="static"){const a=typeof n=="function"?n(e):n;return a==="always"||a!==!1&&pg(e,t)}return!1}function N0(e,t,n,a){return(e!==t||pr(a.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&pg(e,n)}function pg(e,t){return pr(t.enabled,e)!==!1&&e.isStaleByTime(gi(t.staleTime,e))}function c2(e,t){return!jd(e.getCurrentResult(),t)}function _0(e){return{onFetch:(t,n)=>{var g,y,b,S,k;const a=t.options,l=(b=(y=(g=t.fetchOptions)==null?void 0:g.meta)==null?void 0:y.fetchMore)==null?void 0:b.direction,o=((S=t.state.data)==null?void 0:S.pages)||[],u=((k=t.state.data)==null?void 0:k.pageParams)||[];let f={pages:[],pageParams:[]},m=0;const h=async()=>{let j=!1;const E=O=>{n2(O,()=>t.signal,()=>j=!0)},C=ew(t.options,t.fetchOptions),T=async(O,B,M)=>{if(j)return Promise.reject();if(B==null&&O.pages.length)return Promise.resolve(O);const D=(()=>{const oe={client:t.client,queryKey:t.queryKey,pageParam:B,direction:M?"backward":"forward",meta:t.options.meta};return E(oe),oe})(),Z=await C(D),{maxPages:te}=t.options,q=M?t2:e2;return{pages:q(O.pages,Z,te),pageParams:q(O.pageParams,B,te)}};if(l&&o.length){const O=l==="backward",B=O?d2:A0,M={pages:o,pageParams:u},R=B(a,M);f=await T(M,R,O)}else{const O=e??o.length;do{const B=m===0?u[0]??a.initialPageParam:A0(a,f);if(m>0&&B==null)break;f=await T(f,B),m++}while(m<O)}return f};t.options.persister?t.fetchFn=()=>{var j,E;return(E=(j=t.options).persister)==null?void 0:E.call(j,h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=h}}}function A0(e,{pages:t,pageParams:n}){const a=t.length-1;return t.length>0?e.getNextPageParam(t[a],t,n[a],n):void 0}function d2(e,{pages:t,pageParams:n}){var a;return t.length>0?(a=e.getPreviousPageParam)==null?void 0:a.call(e,t[0],t,n[0],n):void 0}var Su,Ur,bn,sl,Pr,ri,VS,f2=(VS=class extends rw{constructor(t){super();_e(this,Pr);_e(this,Su);_e(this,Ur);_e(this,bn);_e(this,sl);xe(this,Su,t.client),this.mutationId=t.mutationId,xe(this,bn,t.mutationCache),xe(this,Ur,[]),this.state=t.state||sw(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){P(this,Ur).includes(t)||(P(this,Ur).push(t),this.clearGcTimeout(),P(this,bn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){xe(this,Ur,P(this,Ur).filter(n=>n!==t)),this.scheduleGc(),P(this,bn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){P(this,Ur).length||(this.state.status==="pending"?this.scheduleGc():P(this,bn).remove(this))}continue(){var t;return((t=P(this,sl))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var u,f,m,h,g,y,b,S,k,j,E,C,T,O,B,M,R,D;const n=()=>{qe(this,Pr,ri).call(this,{type:"continue"})},a={client:P(this,Su),meta:this.options.meta,mutationKey:this.options.mutationKey};xe(this,sl,nw({fn:()=>this.options.mutationFn?this.options.mutationFn(t,a):Promise.reject(new Error("No mutationFn found")),onFail:(Z,te)=>{qe(this,Pr,ri).call(this,{type:"failed",failureCount:Z,error:te})},onPause:()=>{qe(this,Pr,ri).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>P(this,bn).canRun(this)}));const l=this.state.status==="pending",o=!P(this,sl).canStart();try{if(l)n();else{qe(this,Pr,ri).call(this,{type:"pending",variables:t,isPaused:o}),P(this,bn).config.onMutate&&await P(this,bn).config.onMutate(t,this,a);const te=await((f=(u=this.options).onMutate)==null?void 0:f.call(u,t,a));te!==this.state.context&&qe(this,Pr,ri).call(this,{type:"pending",context:te,variables:t,isPaused:o})}const Z=await P(this,sl).start();return await((h=(m=P(this,bn).config).onSuccess)==null?void 0:h.call(m,Z,t,this.state.context,this,a)),await((y=(g=this.options).onSuccess)==null?void 0:y.call(g,Z,t,this.state.context,a)),await((S=(b=P(this,bn).config).onSettled)==null?void 0:S.call(b,Z,null,this.state.variables,this.state.context,this,a)),await((j=(k=this.options).onSettled)==null?void 0:j.call(k,Z,null,t,this.state.context,a)),qe(this,Pr,ri).call(this,{type:"success",data:Z}),Z}catch(Z){try{await((C=(E=P(this,bn).config).onError)==null?void 0:C.call(E,Z,t,this.state.context,this,a))}catch(te){Promise.reject(te)}try{await((O=(T=this.options).onError)==null?void 0:O.call(T,Z,t,this.state.context,a))}catch(te){Promise.reject(te)}try{await((M=(B=P(this,bn).config).onSettled)==null?void 0:M.call(B,void 0,Z,this.state.variables,this.state.context,this,a))}catch(te){Promise.reject(te)}try{await((D=(R=this.options).onSettled)==null?void 0:D.call(R,void 0,Z,t,this.state.context,a))}catch(te){Promise.reject(te)}throw qe(this,Pr,ri).call(this,{type:"error",error:Z}),Z}finally{P(this,bn).runNext(this)}}},Su=new WeakMap,Ur=new WeakMap,bn=new WeakMap,sl=new WeakMap,Pr=new WeakSet,ri=function(t){const n=a=>{switch(t.type){case"failed":return{...a,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...a,isPaused:!0};case"continue":return{...a,isPaused:!1};case"pending":return{...a,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...a,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...a,data:void 0,error:t.error,failureCount:a.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Yt.batch(()=>{P(this,Ur).forEach(a=>{a.onMutationUpdate(t)}),P(this,bn).notify({mutation:this,type:"updated",action:t})})},VS);function sw(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ga,Nr,wu,QS,h2=(QS=class extends Bs{constructor(t={}){super();_e(this,ga);_e(this,Nr);_e(this,wu);this.config=t,xe(this,ga,new Set),xe(this,Nr,new Map),xe(this,wu,0)}build(t,n,a){const l=new f2({client:t,mutationCache:this,mutationId:++Gc(this,wu)._,options:t.defaultMutationOptions(n),state:a});return this.add(l),l}add(t){P(this,ga).add(t);const n=Kc(t);if(typeof n=="string"){const a=P(this,Nr).get(n);a?a.push(t):P(this,Nr).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(P(this,ga).delete(t)){const n=Kc(t);if(typeof n=="string"){const a=P(this,Nr).get(n);if(a)if(a.length>1){const l=a.indexOf(t);l!==-1&&a.splice(l,1)}else a[0]===t&&P(this,Nr).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Kc(t);if(typeof n=="string"){const a=P(this,Nr).get(n),l=a==null?void 0:a.find(o=>o.state.status==="pending");return!l||l===t}else return!0}runNext(t){var a;const n=Kc(t);if(typeof n=="string"){const l=(a=P(this,Nr).get(n))==null?void 0:a.find(o=>o!==t&&o.state.isPaused);return(l==null?void 0:l.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Yt.batch(()=>{P(this,ga).forEach(t=>{this.notify({type:"removed",mutation:t})}),P(this,ga).clear(),P(this,Nr).clear()})}getAll(){return Array.from(P(this,ga))}find(t){const n={exact:!0,...t};return this.getAll().find(a=>S0(n,a))}findAll(t={}){return this.getAll().filter(n=>S0(t,n))}notify(t){Yt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Yt.batch(()=>Promise.all(t.map(n=>n.continue().catch(En))))}},ga=new WeakMap,Nr=new WeakMap,wu=new WeakMap,QS);function Kc(e){var t;return(t=e.options.scope)==null?void 0:t.id}var ya,di,Bn,va,xa,pd,Rp,GS,m2=(GS=class extends Bs{constructor(n,a){super();_e(this,xa);_e(this,ya);_e(this,di);_e(this,Bn);_e(this,va);xe(this,ya,n),this.setOptions(a),this.bindMethods(),qe(this,xa,pd).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var l;const a=this.options;this.options=P(this,ya).defaultMutationOptions(n),jd(this.options,a)||P(this,ya).getMutationCache().notify({type:"observerOptionsUpdated",mutation:P(this,Bn),observer:this}),a!=null&&a.mutationKey&&this.options.mutationKey&&ol(a.mutationKey)!==ol(this.options.mutationKey)?this.reset():((l=P(this,Bn))==null?void 0:l.state.status)==="pending"&&P(this,Bn).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=P(this,Bn))==null||n.removeObserver(this)}onMutationUpdate(n){qe(this,xa,pd).call(this),qe(this,xa,Rp).call(this,n)}getCurrentResult(){return P(this,di)}reset(){var n;(n=P(this,Bn))==null||n.removeObserver(this),xe(this,Bn,void 0),qe(this,xa,pd).call(this),qe(this,xa,Rp).call(this)}mutate(n,a){var l;return xe(this,va,a),(l=P(this,Bn))==null||l.removeObserver(this),xe(this,Bn,P(this,ya).getMutationCache().build(P(this,ya),this.options)),P(this,Bn).addObserver(this),P(this,Bn).execute(n)}},ya=new WeakMap,di=new WeakMap,Bn=new WeakMap,va=new WeakMap,xa=new WeakSet,pd=function(){var a;const n=((a=P(this,Bn))==null?void 0:a.state)??sw();xe(this,di,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Rp=function(n){Yt.batch(()=>{var a,l,o,u,f,m,h,g;if(P(this,va)&&this.hasListeners()){const y=P(this,di).variables,b=P(this,di).context,S={client:P(this,ya),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(l=(a=P(this,va)).onSuccess)==null||l.call(a,n.data,y,b,S)}catch(k){Promise.reject(k)}try{(u=(o=P(this,va)).onSettled)==null||u.call(o,n.data,null,y,b,S)}catch(k){Promise.reject(k)}}else if((n==null?void 0:n.type)==="error"){try{(m=(f=P(this,va)).onError)==null||m.call(f,n.error,y,b,S)}catch(k){Promise.reject(k)}try{(g=(h=P(this,va)).onSettled)==null||g.call(h,void 0,n.error,y,b,S)}catch(k){Promise.reject(k)}}}this.listeners.forEach(y=>{y(P(this,di))})})},GS),Br,KS,p2=(KS=class extends Bs{constructor(t={}){super();_e(this,Br);this.config=t,xe(this,Br,new Map)}build(t,n,a){const l=n.queryKey,o=n.queryHash??fg(l,n);let u=this.get(o);return u||(u=new s2({client:t,queryKey:l,queryHash:o,options:t.defaultQueryOptions(n),state:a,defaultOptions:t.getQueryDefaults(l)}),this.add(u)),u}add(t){P(this,Br).has(t.queryHash)||(P(this,Br).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=P(this,Br).get(t.queryHash);n&&(t.destroy(),n===t&&P(this,Br).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Yt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return P(this,Br).get(t)}getAll(){return[...P(this,Br).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(a=>x0(n,a))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(a=>x0(t,a)):n}notify(t){Yt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Yt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Yt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Br=new WeakMap,KS),Ut,fi,hi,As,Ts,mi,Rs,zs,YS,g2=(YS=class{constructor(e={}){_e(this,Ut);_e(this,fi);_e(this,hi);_e(this,As);_e(this,Ts);_e(this,mi);_e(this,Rs);_e(this,zs);xe(this,Ut,e.queryCache||new p2),xe(this,fi,e.mutationCache||new h2),xe(this,hi,e.defaultOptions||{}),xe(this,As,new Map),xe(this,Ts,new Map),xe(this,mi,0)}mount(){Gc(this,mi)._++,P(this,mi)===1&&(xe(this,Rs,dg.subscribe(async e=>{e&&(await this.resumePausedMutations(),P(this,Ut).onFocus())})),xe(this,zs,Cd.subscribe(async e=>{e&&(await this.resumePausedMutations(),P(this,Ut).onOnline())})))}unmount(){var e,t;Gc(this,mi)._--,P(this,mi)===0&&((e=P(this,Rs))==null||e.call(this),xe(this,Rs,void 0),(t=P(this,zs))==null||t.call(this),xe(this,zs,void 0))}isFetching(e){return P(this,Ut).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return P(this,fi).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=P(this,Ut).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=P(this,Ut).build(this,t),a=n.state.data;return a===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(gi(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(a))}getQueriesData(e){return P(this,Ut).findAll(e).map(({queryKey:t,state:n})=>{const a=n.data;return[t,a]})}setQueryData(e,t,n){const a=this.defaultQueryOptions({queryKey:e}),l=P(this,Ut).get(a.queryHash),o=l==null?void 0:l.state.data,u=X_(t,o);if(u!==void 0)return P(this,Ut).build(this,a).setData(u,{...n,manual:!0})}setQueriesData(e,t,n){return Yt.batch(()=>P(this,Ut).findAll(e).map(({queryKey:a})=>[a,this.setQueryData(a,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=P(this,Ut).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=P(this,Ut);Yt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=P(this,Ut);return Yt.batch(()=>(n.findAll(e).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},a=Yt.batch(()=>P(this,Ut).findAll(e).map(l=>l.cancel(n)));return Promise.all(a).then(En).catch(En)}invalidateQueries(e,t={}){return Yt.batch(()=>(P(this,Ut).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},a=Yt.batch(()=>P(this,Ut).findAll(e).filter(l=>!l.isDisabled()&&!l.isStatic()).map(l=>{let o=l.fetch(void 0,n);return n.throwOnError||(o=o.catch(En)),l.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(a).then(En)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=P(this,Ut).build(this,t);return n.isStaleByTime(gi(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(En).catch(En)}fetchInfiniteQuery(e){return e.behavior=_0(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(En).catch(En)}ensureInfiniteQueryData(e){return e.behavior=_0(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Cd.isOnline()?P(this,fi).resumePausedMutations():Promise.resolve()}getQueryCache(){return P(this,Ut)}getMutationCache(){return P(this,fi)}getDefaultOptions(){return P(this,hi)}setDefaultOptions(e){xe(this,hi,e)}setQueryDefaults(e,t){P(this,As).set(ol(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...P(this,As).values()],n={};return t.forEach(a=>{su(e,a.queryKey)&&Object.assign(n,a.defaultOptions)}),n}setMutationDefaults(e,t){P(this,Ts).set(ol(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...P(this,Ts).values()],n={};return t.forEach(a=>{su(e,a.mutationKey)&&Object.assign(n,a.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...P(this,hi).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=fg(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===hg&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...P(this,hi).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){P(this,Ut).clear(),P(this,fi).clear()}},Ut=new WeakMap,fi=new WeakMap,hi=new WeakMap,As=new WeakMap,Ts=new WeakMap,mi=new WeakMap,Rs=new WeakMap,zs=new WeakMap,YS),ow=x.createContext(void 0),Fn=e=>{const t=x.useContext(ow);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},y2=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),d.jsx(ow.Provider,{value:e,children:t})),uw=x.createContext(!1),v2=()=>x.useContext(uw);uw.Provider;function b2(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var x2=x.createContext(b2()),S2=()=>x.useContext(x2),w2=(e,t,n)=>{const a=n!=null&&n.state.error&&typeof e.throwOnError=="function"?mg(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||a)&&(t.isReset()||(e.retryOnMount=!1))},k2=e=>{x.useEffect(()=>{e.clearReset()},[e])},j2=({result:e,errorResetBoundary:t,throwOnError:n,query:a,suspense:l})=>e.isError&&!t.isReset()&&!e.isFetching&&a&&(l&&e.data===void 0||mg(n,[e.error,a])),C2=e=>{if(e.suspense){const n=l=>l==="static"?l:Math.max(l??1e3,1e3),a=e.staleTime;e.staleTime=typeof a=="function"?(...l)=>n(a(...l)):n(a),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},E2=(e,t)=>e.isLoading&&e.isFetching&&!t,N2=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,T0=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function _2(e,t,n){var b,S,k,j;const a=v2(),l=S2(),o=Fn(),u=o.defaultQueryOptions(e);(S=(b=o.getDefaultOptions().queries)==null?void 0:b._experimental_beforeQuery)==null||S.call(b,u);const f=o.getQueryCache().get(u.queryHash);u._optimisticResults=a?"isRestoring":"optimistic",C2(u),w2(u,l,f),k2(l);const m=!o.getQueryCache().get(u.queryHash),[h]=x.useState(()=>new t(o,u)),g=h.getOptimisticResult(u),y=!a&&e.subscribed!==!1;if(x.useSyncExternalStore(x.useCallback(E=>{const C=y?h.subscribe(Yt.batchCalls(E)):En;return h.updateResult(),C},[h,y]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),x.useEffect(()=>{h.setOptions(u)},[u,h]),N2(u,g))throw T0(u,h,l);if(j2({result:g,errorResetBoundary:l,throwOnError:u.throwOnError,query:f,suspense:u.suspense}))throw g.error;if((j=(k=o.getDefaultOptions().queries)==null?void 0:k._experimental_afterQuery)==null||j.call(k,u,g),u.experimental_prefetchInRender&&!ou.isServer()&&E2(g,a)){const E=m?T0(u,h,l):f==null?void 0:f.promise;E==null||E.catch(En).finally(()=>{h.updateResult()})}return u.notifyOnChangeProps?g:h.trackResult(g)}function Ve(e,t){return _2(e,o2)}function wt(e,t){const n=Fn(),[a]=x.useState(()=>new m2(n,e));x.useEffect(()=>{a.setOptions(e)},[a,e]);const l=x.useSyncExternalStore(x.useCallback(u=>a.subscribe(Yt.batchCalls(u)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),o=x.useCallback((u,f)=>{a.mutate(u,f).catch(En)},[a]);if(l.error&&mg(a.options.throwOnError,[l.error]))throw l.error;return{...l,mutate:o,mutateAsync:l.mutate}}/**
50
+ * react-router v7.13.1
51
+ *
52
+ * Copyright (c) Remix Software Inc.
53
+ *
54
+ * This source code is licensed under the MIT license found in the
55
+ * LICENSE.md file in the root directory of this source tree.
56
+ *
57
+ * @license MIT
58
+ */var R0="popstate";function z0(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function A2(e={}){function t(a,l){var h;let o=(h=l.state)==null?void 0:h.masked,{pathname:u,search:f,hash:m}=o||a.location;return zp("",{pathname:u,search:f,hash:m},l.state&&l.state.usr||null,l.state&&l.state.key||"default",o?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function n(a,l){return typeof l=="string"?l:uu(l)}return R2(t,n,null,e)}function At(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function yr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function T2(){return Math.random().toString(36).substring(2,10)}function O0(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function zp(e,t,n=null,a,l){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?$s(t):t,state:n,key:t&&t.key||a||T2(),unstable_mask:l}}function uu({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function $s(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let a=e.indexOf("?");a>=0&&(t.search=e.substring(a),e=e.substring(0,a)),e&&(t.pathname=e)}return t}function R2(e,t,n,a={}){let{window:l=document.defaultView,v5Compat:o=!1}=a,u=l.history,f="POP",m=null,h=g();h==null&&(h=0,u.replaceState({...u.state,idx:h},""));function g(){return(u.state||{idx:null}).idx}function y(){f="POP";let E=g(),C=E==null?null:E-h;h=E,m&&m({action:f,location:j.location,delta:C})}function b(E,C){f="PUSH";let T=z0(E)?E:zp(j.location,E,C);h=g()+1;let O=O0(T,h),B=j.createHref(T.unstable_mask||T);try{u.pushState(O,"",B)}catch(M){if(M instanceof DOMException&&M.name==="DataCloneError")throw M;l.location.assign(B)}o&&m&&m({action:f,location:j.location,delta:1})}function S(E,C){f="REPLACE";let T=z0(E)?E:zp(j.location,E,C);h=g();let O=O0(T,h),B=j.createHref(T.unstable_mask||T);u.replaceState(O,"",B),o&&m&&m({action:f,location:j.location,delta:0})}function k(E){return z2(E)}let j={get action(){return f},get location(){return e(l,u)},listen(E){if(m)throw new Error("A history only accepts one active listener");return l.addEventListener(R0,y),m=E,()=>{l.removeEventListener(R0,y),m=null}},createHref(E){return t(l,E)},createURL:k,encodeLocation(E){let C=k(E);return{pathname:C.pathname,search:C.search,hash:C.hash}},push:b,replace:S,go(E){return u.go(E)}};return j}function z2(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),At(n,"No window.location.(origin|href) available to create URL");let a=typeof e=="string"?e:uu(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=n+a),new URL(a,n)}function cw(e,t,n="/"){return O2(e,t,n,!1)}function O2(e,t,n,a){let l=typeof t=="string"?$s(t):t,o=Sa(l.pathname||"/",n);if(o==null)return null;let u=dw(e);M2(u);let f=null;for(let m=0;f==null&&m<u.length;++m){let h=Z2(o);f=q2(u[m],h,a)}return f}function dw(e,t=[],n=[],a="",l=!1){let o=(u,f,m=l,h)=>{let g={relativePath:h===void 0?u.path||"":h,caseSensitive:u.caseSensitive===!0,childrenIndex:f,route:u};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(a)&&m)return;At(g.relativePath.startsWith(a),`Absolute route path "${g.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(a.length)}let y=qr([a,g.relativePath]),b=n.concat(g);u.children&&u.children.length>0&&(At(u.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),dw(u.children,t,b,y,m)),!(u.path==null&&!u.index)&&t.push({path:y,score:$2(y,u.index),routesMeta:b})};return e.forEach((u,f)=>{var m;if(u.path===""||!((m=u.path)!=null&&m.includes("?")))o(u,f);else for(let h of fw(u.path))o(u,f,!0,h)}),t}function fw(e){let t=e.split("/");if(t.length===0)return[];let[n,...a]=t,l=n.endsWith("?"),o=n.replace(/\?$/,"");if(a.length===0)return l?[o,""]:[o];let u=fw(a.join("/")),f=[];return f.push(...u.map(m=>m===""?o:[o,m].join("/"))),l&&f.push(...u),f.map(m=>e.startsWith("/")&&m===""?"/":m)}function M2(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:F2(t.routesMeta.map(a=>a.childrenIndex),n.routesMeta.map(a=>a.childrenIndex)))}var D2=/^:[\w-]+$/,L2=3,I2=2,U2=1,P2=10,B2=-2,M0=e=>e==="*";function $2(e,t){let n=e.split("/"),a=n.length;return n.some(M0)&&(a+=B2),t&&(a+=I2),n.filter(l=>!M0(l)).reduce((l,o)=>l+(D2.test(o)?L2:o===""?U2:P2),a)}function F2(e,t){return e.length===t.length&&e.slice(0,-1).every((a,l)=>a===t[l])?e[e.length-1]-t[t.length-1]:0}function q2(e,t,n=!1){let{routesMeta:a}=e,l={},o="/",u=[];for(let f=0;f<a.length;++f){let m=a[f],h=f===a.length-1,g=o==="/"?t:t.slice(o.length)||"/",y=Ed({path:m.relativePath,caseSensitive:m.caseSensitive,end:h},g),b=m.route;if(!y&&h&&n&&!a[a.length-1].route.index&&(y=Ed({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},g)),!y)return null;Object.assign(l,y.params),u.push({params:l,pathname:qr([o,y.pathname]),pathnameBase:K2(qr([o,y.pathnameBase])),route:b}),y.pathnameBase!=="/"&&(o=qr([o,y.pathnameBase]))}return u}function Ed(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,a]=H2(e.path,e.caseSensitive,e.end),l=t.match(n);if(!l)return null;let o=l[0],u=o.replace(/(.)\/+$/,"$1"),f=l.slice(1);return{params:a.reduce((h,{paramName:g,isOptional:y},b)=>{if(g==="*"){let k=f[b]||"";u=o.slice(0,o.length-k.length).replace(/(.)\/+$/,"$1")}const S=f[b];return y&&!S?h[g]=void 0:h[g]=(S||"").replace(/%2F/g,"/"),h},{}),pathname:o,pathnameBase:u,pattern:e}}function H2(e,t=!1,n=!0){yr(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let a=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(u,f,m,h,g)=>{if(a.push({paramName:f,isOptional:m!=null}),m){let y=g.charAt(h+u.length);return y&&y!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),a]}function Z2(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return yr(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Sa(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,a=e.charAt(n);return a&&a!=="/"?null:e.slice(n)||"/"}var V2=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function Q2(e,t="/"){let{pathname:n,search:a="",hash:l=""}=typeof e=="string"?$s(e):e,o;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?o=D0(n.substring(1),"/"):o=D0(n,t)):o=t,{pathname:o,search:Y2(a),hash:X2(l)}}function D0(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(l=>{l===".."?n.length>1&&n.pop():l!=="."&&n.push(l)}),n.length>1?n.join("/"):"/"}function zm(e,t,n,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function G2(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function gg(e){let t=G2(e);return t.map((n,a)=>a===t.length-1?n.pathname:n.pathnameBase)}function Fd(e,t,n,a=!1){let l;typeof e=="string"?l=$s(e):(l={...e},At(!l.pathname||!l.pathname.includes("?"),zm("?","pathname","search",l)),At(!l.pathname||!l.pathname.includes("#"),zm("#","pathname","hash",l)),At(!l.search||!l.search.includes("#"),zm("#","search","hash",l)));let o=e===""||l.pathname==="",u=o?"/":l.pathname,f;if(u==null)f=n;else{let y=t.length-1;if(!a&&u.startsWith("..")){let b=u.split("/");for(;b[0]==="..";)b.shift(),y-=1;l.pathname=b.join("/")}f=y>=0?t[y]:"/"}let m=Q2(l,f),h=u&&u!=="/"&&u.endsWith("/"),g=(o||u===".")&&n.endsWith("/");return!m.pathname.endsWith("/")&&(h||g)&&(m.pathname+="/"),m}var qr=e=>e.join("/").replace(/\/\/+/g,"/"),K2=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Y2=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,X2=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,J2=class{constructor(e,t,n,a=!1){this.status=e,this.statusText=t||"",this.internal=a,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function W2(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function eA(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var hw=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function mw(e,t){let n=e;if(typeof n!="string"||!V2.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let a=n,l=!1;if(hw)try{let o=new URL(window.location.href),u=n.startsWith("//")?new URL(o.protocol+n):new URL(n),f=Sa(u.pathname,t);u.origin===o.origin&&f!=null?n=f+u.search+u.hash:l=!0}catch{yr(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:l,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var pw=["POST","PUT","PATCH","DELETE"];new Set(pw);var tA=["GET",...pw];new Set(tA);var Fs=x.createContext(null);Fs.displayName="DataRouter";var qd=x.createContext(null);qd.displayName="DataRouterState";var nA=x.createContext(!1),gw=x.createContext({isTransitioning:!1});gw.displayName="ViewTransition";var rA=x.createContext(new Map);rA.displayName="Fetchers";var aA=x.createContext(null);aA.displayName="Await";var rr=x.createContext(null);rr.displayName="Navigation";var ku=x.createContext(null);ku.displayName="Location";var vr=x.createContext({outlet:null,matches:[],isDataRoute:!1});vr.displayName="Route";var yg=x.createContext(null);yg.displayName="RouteError";var yw="REACT_ROUTER_ERROR",iA="REDIRECT",lA="ROUTE_ERROR_RESPONSE";function sA(e){if(e.startsWith(`${yw}:${iA}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function oA(e){if(e.startsWith(`${yw}:${lA}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new J2(t.status,t.statusText,t.data)}catch{}}function uA(e,{relative:t}={}){At(qs(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:a}=x.useContext(rr),{hash:l,pathname:o,search:u}=ju(e,{relative:t}),f=o;return n!=="/"&&(f=o==="/"?n:qr([n,o])),a.createHref({pathname:f,search:u,hash:l})}function qs(){return x.useContext(ku)!=null}function br(){return At(qs(),"useLocation() may be used only in the context of a <Router> component."),x.useContext(ku).location}var vw="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function bw(e){x.useContext(rr).static||x.useLayoutEffect(e)}function Zr(){let{isDataRoute:e}=x.useContext(vr);return e?CA():cA()}function cA(){At(qs(),"useNavigate() may be used only in the context of a <Router> component.");let e=x.useContext(Fs),{basename:t,navigator:n}=x.useContext(rr),{matches:a}=x.useContext(vr),{pathname:l}=br(),o=JSON.stringify(gg(a)),u=x.useRef(!1);return bw(()=>{u.current=!0}),x.useCallback((m,h={})=>{if(yr(u.current,vw),!u.current)return;if(typeof m=="number"){n.go(m);return}let g=Fd(m,JSON.parse(o),l,h.relative==="path");e==null&&t!=="/"&&(g.pathname=g.pathname==="/"?t:qr([t,g.pathname])),(h.replace?n.replace:n.push)(g,h.state,h)},[t,n,o,l,e])}var dA=x.createContext(null);function fA(e){let t=x.useContext(vr).outlet;return x.useMemo(()=>t&&x.createElement(dA.Provider,{value:e},t),[t,e])}function hA(){let{matches:e}=x.useContext(vr),t=e[e.length-1];return t?t.params:{}}function ju(e,{relative:t}={}){let{matches:n}=x.useContext(vr),{pathname:a}=br(),l=JSON.stringify(gg(n));return x.useMemo(()=>Fd(e,JSON.parse(l),a,t==="path"),[e,l,a,t])}function mA(e,t){return xw(e,t)}function xw(e,t,n){var E;At(qs(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=x.useContext(rr),{matches:l}=x.useContext(vr),o=l[l.length-1],u=o?o.params:{},f=o?o.pathname:"/",m=o?o.pathnameBase:"/",h=o&&o.route;{let C=h&&h.path||"";ww(f,!h||C.endsWith("*")||C.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${C}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
59
+
60
+ Please change the parent <Route path="${C}"> to <Route path="${C==="/"?"*":`${C}/*`}">.`)}let g=br(),y;if(t){let C=typeof t=="string"?$s(t):t;At(m==="/"||((E=C.pathname)==null?void 0:E.startsWith(m)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${m}" but pathname "${C.pathname}" was given in the \`location\` prop.`),y=C}else y=g;let b=y.pathname||"/",S=b;if(m!=="/"){let C=m.replace(/^\//,"").split("/");S="/"+b.replace(/^\//,"").split("/").slice(C.length).join("/")}let k=cw(e,{pathname:S});yr(h||k!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),yr(k==null||k[k.length-1].route.element!==void 0||k[k.length-1].route.Component!==void 0||k[k.length-1].route.lazy!==void 0,`Matched leaf route at location "${y.pathname}${y.search}${y.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let j=bA(k&&k.map(C=>Object.assign({},C,{params:Object.assign({},u,C.params),pathname:qr([m,a.encodeLocation?a.encodeLocation(C.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?m:qr([m,a.encodeLocation?a.encodeLocation(C.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathnameBase])})),l,n);return t&&j?x.createElement(ku.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...y},navigationType:"POP"}},j):j}function pA(){let e=jA(),t=W2(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",l={padding:"0.5rem",backgroundColor:a},o={padding:"2px 4px",backgroundColor:a},u=null;return console.error("Error handled by React Router default ErrorBoundary:",e),u=x.createElement(x.Fragment,null,x.createElement("p",null,"💿 Hey developer 👋"),x.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",x.createElement("code",{style:o},"ErrorBoundary")," or"," ",x.createElement("code",{style:o},"errorElement")," prop on your route.")),x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},t),n?x.createElement("pre",{style:l},n):null,u)}var gA=x.createElement(pA,null),Sw=class extends x.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=oA(e.digest);n&&(e=n)}let t=e!==void 0?x.createElement(vr.Provider,{value:this.props.routeContext},x.createElement(yg.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?x.createElement(yA,{error:e},t):t}};Sw.contextType=nA;var Om=new WeakMap;function yA({children:e,error:t}){let{basename:n}=x.useContext(rr);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=sA(t.digest);if(a){let l=Om.get(t);if(l)throw l;let o=mw(a.location,n);if(hw&&!Om.get(t))if(o.isExternal||a.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const u=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:a.replace}));throw Om.set(t,u),u}return x.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function vA({routeContext:e,match:t,children:n}){let a=x.useContext(Fs);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),x.createElement(vr.Provider,{value:e},n)}function bA(e,t=[],n){let a=n==null?void 0:n.state;if(e==null){if(!a)return null;if(a.errors)e=a.matches;else if(t.length===0&&!a.initialized&&a.matches.length>0)e=a.matches;else return null}let l=e,o=a==null?void 0:a.errors;if(o!=null){let g=l.findIndex(y=>y.route.id&&(o==null?void 0:o[y.route.id])!==void 0);At(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),l=l.slice(0,Math.min(l.length,g+1))}let u=!1,f=-1;if(n&&a){u=a.renderFallback;for(let g=0;g<l.length;g++){let y=l[g];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(f=g),y.route.id){let{loaderData:b,errors:S}=a,k=y.route.loader&&!b.hasOwnProperty(y.route.id)&&(!S||S[y.route.id]===void 0);if(y.route.lazy||k){n.isStatic&&(u=!0),f>=0?l=l.slice(0,f+1):l=[l[0]];break}}}}let m=n==null?void 0:n.onError,h=a&&m?(g,y)=>{var b,S;m(g,{location:a.location,params:((S=(b=a.matches)==null?void 0:b[0])==null?void 0:S.params)??{},unstable_pattern:eA(a.matches),errorInfo:y})}:void 0;return l.reduceRight((g,y,b)=>{let S,k=!1,j=null,E=null;a&&(S=o&&y.route.id?o[y.route.id]:void 0,j=y.route.errorElement||gA,u&&(f<0&&b===0?(ww("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),k=!0,E=null):f===b&&(k=!0,E=y.route.hydrateFallbackElement||null)));let C=t.concat(l.slice(0,b+1)),T=()=>{let O;return S?O=j:k?O=E:y.route.Component?O=x.createElement(y.route.Component,null):y.route.element?O=y.route.element:O=g,x.createElement(vA,{match:y,routeContext:{outlet:g,matches:C,isDataRoute:a!=null},children:O})};return a&&(y.route.ErrorBoundary||y.route.errorElement||b===0)?x.createElement(Sw,{location:a.location,revalidation:a.revalidation,component:j,error:S,children:T(),routeContext:{outlet:null,matches:C,isDataRoute:!0},onError:h}):T()},null)}function vg(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function xA(e){let t=x.useContext(Fs);return At(t,vg(e)),t}function SA(e){let t=x.useContext(qd);return At(t,vg(e)),t}function wA(e){let t=x.useContext(vr);return At(t,vg(e)),t}function bg(e){let t=wA(e),n=t.matches[t.matches.length-1];return At(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function kA(){return bg("useRouteId")}function jA(){var a;let e=x.useContext(yg),t=SA("useRouteError"),n=bg("useRouteError");return e!==void 0?e:(a=t.errors)==null?void 0:a[n]}function CA(){let{router:e}=xA("useNavigate"),t=bg("useNavigate"),n=x.useRef(!1);return bw(()=>{n.current=!0}),x.useCallback(async(l,o={})=>{yr(n.current,vw),n.current&&(typeof l=="number"?await e.navigate(l):await e.navigate(l,{fromRouteId:t,...o}))},[e,t])}var L0={};function ww(e,t,n){!t&&!L0[e]&&(L0[e]=!0,yr(!1,n))}x.memo(EA);function EA({routes:e,future:t,state:n,isStatic:a,onError:l}){return xw(e,void 0,{state:n,isStatic:a,onError:l})}function xg({to:e,replace:t,state:n,relative:a}){At(qs(),"<Navigate> may be used only in the context of a <Router> component.");let{static:l}=x.useContext(rr);yr(!l,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:o}=x.useContext(vr),{pathname:u}=br(),f=Zr(),m=Fd(e,gg(o),u,a==="path"),h=JSON.stringify(m);return x.useEffect(()=>{f(JSON.parse(h),{replace:t,state:n,relative:a})},[f,h,a,t,n]),null}function Op(e){return fA(e.context)}function Lr(e){At(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function NA({basename:e="/",children:t=null,location:n,navigationType:a="POP",navigator:l,static:o=!1,unstable_useTransitions:u}){At(!qs(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),m=x.useMemo(()=>({basename:f,navigator:l,static:o,unstable_useTransitions:u,future:{}}),[f,l,o,u]);typeof n=="string"&&(n=$s(n));let{pathname:h="/",search:g="",hash:y="",state:b=null,key:S="default",unstable_mask:k}=n,j=x.useMemo(()=>{let E=Sa(h,f);return E==null?null:{location:{pathname:E,search:g,hash:y,state:b,key:S,unstable_mask:k},navigationType:a}},[f,h,g,y,b,S,a,k]);return yr(j!=null,`<Router basename="${f}"> is not able to match the URL "${h}${g}${y}" because it does not start with the basename, so the <Router> won't render anything.`),j==null?null:x.createElement(rr.Provider,{value:m},x.createElement(ku.Provider,{children:t,value:j}))}function _A({children:e,location:t}){return mA(Mp(e),t)}function Mp(e,t=[]){let n=[];return x.Children.forEach(e,(a,l)=>{if(!x.isValidElement(a))return;let o=[...t,l];if(a.type===x.Fragment){n.push.apply(n,Mp(a.props.children,o));return}At(a.type===Lr,`[${typeof a.type=="string"?a.type:a.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),At(!a.props.index||!a.props.children,"An index route cannot have child routes.");let u={id:a.props.id||o.join("-"),caseSensitive:a.props.caseSensitive,element:a.props.element,Component:a.props.Component,index:a.props.index,path:a.props.path,middleware:a.props.middleware,loader:a.props.loader,action:a.props.action,hydrateFallbackElement:a.props.hydrateFallbackElement,HydrateFallback:a.props.HydrateFallback,errorElement:a.props.errorElement,ErrorBoundary:a.props.ErrorBoundary,hasErrorBoundary:a.props.hasErrorBoundary===!0||a.props.ErrorBoundary!=null||a.props.errorElement!=null,shouldRevalidate:a.props.shouldRevalidate,handle:a.props.handle,lazy:a.props.lazy};a.props.children&&(u.children=Mp(a.props.children,o)),n.push(u)}),n}var gd="get",yd="application/x-www-form-urlencoded";function Hd(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function AA(e){return Hd(e)&&e.tagName.toLowerCase()==="button"}function TA(e){return Hd(e)&&e.tagName.toLowerCase()==="form"}function RA(e){return Hd(e)&&e.tagName.toLowerCase()==="input"}function zA(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function OA(e,t){return e.button===0&&(!t||t==="_self")&&!zA(e)}function Dp(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let a=e[n];return t.concat(Array.isArray(a)?a.map(l=>[n,l]):[[n,a]])},[]))}function MA(e,t){let n=Dp(e);return t&&t.forEach((a,l)=>{n.has(l)||t.getAll(l).forEach(o=>{n.append(l,o)})}),n}var Yc=null;function DA(){if(Yc===null)try{new FormData(document.createElement("form"),0),Yc=!1}catch{Yc=!0}return Yc}var LA=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Mm(e){return e!=null&&!LA.has(e)?(yr(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${yd}"`),null):e}function IA(e,t){let n,a,l,o,u;if(TA(e)){let f=e.getAttribute("action");a=f?Sa(f,t):null,n=e.getAttribute("method")||gd,l=Mm(e.getAttribute("enctype"))||yd,o=new FormData(e)}else if(AA(e)||RA(e)&&(e.type==="submit"||e.type==="image")){let f=e.form;if(f==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let m=e.getAttribute("formaction")||f.getAttribute("action");if(a=m?Sa(m,t):null,n=e.getAttribute("formmethod")||f.getAttribute("method")||gd,l=Mm(e.getAttribute("formenctype"))||Mm(f.getAttribute("enctype"))||yd,o=new FormData(f,e),!DA()){let{name:h,type:g,value:y}=e;if(g==="image"){let b=h?`${h}.`:"";o.append(`${b}x`,"0"),o.append(`${b}y`,"0")}else h&&o.append(h,y)}}else{if(Hd(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=gd,a=null,l=yd,u=e}return o&&l==="text/plain"&&(u=o,o=void 0),{action:a,method:n.toLowerCase(),encType:l,formData:o,body:u}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Sg(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function UA(e,t,n,a){let l=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?l.pathname.endsWith("/")?l.pathname=`${l.pathname}_.${a}`:l.pathname=`${l.pathname}.${a}`:l.pathname==="/"?l.pathname=`_root.${a}`:t&&Sa(l.pathname,t)==="/"?l.pathname=`${t.replace(/\/$/,"")}/_root.${a}`:l.pathname=`${l.pathname.replace(/\/$/,"")}.${a}`,l}async function PA(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function BA(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function $A(e,t,n){let a=await Promise.all(e.map(async l=>{let o=t.routes[l.route.id];if(o){let u=await PA(o,n);return u.links?u.links():[]}return[]}));return ZA(a.flat(1).filter(BA).filter(l=>l.rel==="stylesheet"||l.rel==="preload").map(l=>l.rel==="stylesheet"?{...l,rel:"prefetch",as:"style"}:{...l,rel:"prefetch"}))}function I0(e,t,n,a,l,o){let u=(m,h)=>n[h]?m.route.id!==n[h].route.id:!0,f=(m,h)=>{var g;return n[h].pathname!==m.pathname||((g=n[h].route.path)==null?void 0:g.endsWith("*"))&&n[h].params["*"]!==m.params["*"]};return o==="assets"?t.filter((m,h)=>u(m,h)||f(m,h)):o==="data"?t.filter((m,h)=>{var y;let g=a.routes[m.route.id];if(!g||!g.hasLoader)return!1;if(u(m,h)||f(m,h))return!0;if(m.route.shouldRevalidate){let b=m.route.shouldRevalidate({currentUrl:new URL(l.pathname+l.search+l.hash,window.origin),currentParams:((y=n[0])==null?void 0:y.params)||{},nextUrl:new URL(e,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof b=="boolean")return b}return!0}):[]}function FA(e,t,{includeHydrateFallback:n}={}){return qA(e.map(a=>{let l=t.routes[a.route.id];if(!l)return[];let o=[l.module];return l.clientActionModule&&(o=o.concat(l.clientActionModule)),l.clientLoaderModule&&(o=o.concat(l.clientLoaderModule)),n&&l.hydrateFallbackModule&&(o=o.concat(l.hydrateFallbackModule)),l.imports&&(o=o.concat(l.imports)),o}).flat(1))}function qA(e){return[...new Set(e)]}function HA(e){let t={},n=Object.keys(e).sort();for(let a of n)t[a]=e[a];return t}function ZA(e,t){let n=new Set;return new Set(t),e.reduce((a,l)=>{let o=JSON.stringify(HA(l));return n.has(o)||(n.add(o),a.push({key:o,link:l})),a},[])}function kw(){let e=x.useContext(Fs);return Sg(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function VA(){let e=x.useContext(qd);return Sg(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var wg=x.createContext(void 0);wg.displayName="FrameworkContext";function jw(){let e=x.useContext(wg);return Sg(e,"You must render this element inside a <HydratedRouter> element"),e}function QA(e,t){let n=x.useContext(wg),[a,l]=x.useState(!1),[o,u]=x.useState(!1),{onFocus:f,onBlur:m,onMouseEnter:h,onMouseLeave:g,onTouchStart:y}=t,b=x.useRef(null);x.useEffect(()=>{if(e==="render"&&u(!0),e==="viewport"){let j=C=>{C.forEach(T=>{u(T.isIntersecting)})},E=new IntersectionObserver(j,{threshold:.5});return b.current&&E.observe(b.current),()=>{E.disconnect()}}},[e]),x.useEffect(()=>{if(a){let j=setTimeout(()=>{u(!0)},100);return()=>{clearTimeout(j)}}},[a]);let S=()=>{l(!0)},k=()=>{l(!1),u(!1)};return n?e!=="intent"?[o,b,{}]:[o,b,{onFocus:qo(f,S),onBlur:qo(m,k),onMouseEnter:qo(h,S),onMouseLeave:qo(g,k),onTouchStart:qo(y,S)}]:[!1,b,{}]}function qo(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function GA({page:e,...t}){let{router:n}=kw(),a=x.useMemo(()=>cw(n.routes,e,n.basename),[n.routes,e,n.basename]);return a?x.createElement(YA,{page:e,matches:a,...t}):null}function KA(e){let{manifest:t,routeModules:n}=jw(),[a,l]=x.useState([]);return x.useEffect(()=>{let o=!1;return $A(e,t,n).then(u=>{o||l(u)}),()=>{o=!0}},[e,t,n]),a}function YA({page:e,matches:t,...n}){let a=br(),{future:l,manifest:o,routeModules:u}=jw(),{basename:f}=kw(),{loaderData:m,matches:h}=VA(),g=x.useMemo(()=>I0(e,t,h,o,a,"data"),[e,t,h,o,a]),y=x.useMemo(()=>I0(e,t,h,o,a,"assets"),[e,t,h,o,a]),b=x.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let j=new Set,E=!1;if(t.forEach(T=>{var B;let O=o.routes[T.route.id];!O||!O.hasLoader||(!g.some(M=>M.route.id===T.route.id)&&T.route.id in m&&((B=u[T.route.id])!=null&&B.shouldRevalidate)||O.hasClientLoader?E=!0:j.add(T.route.id))}),j.size===0)return[];let C=UA(e,f,l.unstable_trailingSlashAwareDataRequests,"data");return E&&j.size>0&&C.searchParams.set("_routes",t.filter(T=>j.has(T.route.id)).map(T=>T.route.id).join(",")),[C.pathname+C.search]},[f,l.unstable_trailingSlashAwareDataRequests,m,a,o,g,t,e,u]),S=x.useMemo(()=>FA(y,o),[y,o]),k=KA(y);return x.createElement(x.Fragment,null,b.map(j=>x.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...n})),S.map(j=>x.createElement("link",{key:j,rel:"modulepreload",href:j,...n})),k.map(({key:j,link:E})=>x.createElement("link",{key:j,nonce:n.nonce,...E,crossOrigin:E.crossOrigin??n.crossOrigin})))}function XA(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var JA=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{JA&&(window.__reactRouterVersion="7.13.1")}catch{}function WA({basename:e,children:t,unstable_useTransitions:n,window:a}){let l=x.useRef();l.current==null&&(l.current=A2({window:a,v5Compat:!0}));let o=l.current,[u,f]=x.useState({action:o.action,location:o.location}),m=x.useCallback(h=>{n===!1?f(h):x.startTransition(()=>f(h))},[n]);return x.useLayoutEffect(()=>o.listen(m),[o,m]),x.createElement(NA,{basename:e,children:t,location:u.location,navigationType:u.action,navigator:o,unstable_useTransitions:n})}var Cw=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ew=x.forwardRef(function({onClick:t,discover:n="render",prefetch:a="none",relative:l,reloadDocument:o,replace:u,unstable_mask:f,state:m,target:h,to:g,preventScrollReset:y,viewTransition:b,unstable_defaultShouldRevalidate:S,...k},j){let{basename:E,navigator:C,unstable_useTransitions:T}=x.useContext(rr),O=typeof g=="string"&&Cw.test(g),B=mw(g,E);g=B.to;let M=uA(g,{relative:l}),R=br(),D=null;if(f){let ee=Fd(f,[],R.unstable_mask?R.unstable_mask.pathname:"/",!0);E!=="/"&&(ee.pathname=ee.pathname==="/"?E:qr([E,ee.pathname])),D=C.createHref(ee)}let[Z,te,q]=QA(a,k),oe=nT(g,{replace:u,unstable_mask:f,state:m,target:h,preventScrollReset:y,relative:l,viewTransition:b,unstable_defaultShouldRevalidate:S,unstable_useTransitions:T});function W(ee){t&&t(ee),ee.defaultPrevented||oe(ee)}let me=!(B.isExternal||o),de=x.createElement("a",{...k,...q,href:(me?D:void 0)||B.absoluteURL||M,onClick:me?W:t,ref:XA(j,te),target:h,"data-discover":!O&&n==="render"?"true":void 0});return Z&&!O?x.createElement(x.Fragment,null,de,x.createElement(GA,{page:M})):de});Ew.displayName="Link";var Nw=x.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:a="",end:l=!1,style:o,to:u,viewTransition:f,children:m,...h},g){let y=ju(u,{relative:h.relative}),b=br(),S=x.useContext(qd),{navigator:k,basename:j}=x.useContext(rr),E=S!=null&&sT(y)&&f===!0,C=k.encodeLocation?k.encodeLocation(y).pathname:y.pathname,T=b.pathname,O=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;n||(T=T.toLowerCase(),O=O?O.toLowerCase():null,C=C.toLowerCase()),O&&j&&(O=Sa(O,j)||O);const B=C!=="/"&&C.endsWith("/")?C.length-1:C.length;let M=T===C||!l&&T.startsWith(C)&&T.charAt(B)==="/",R=O!=null&&(O===C||!l&&O.startsWith(C)&&O.charAt(C.length)==="/"),D={isActive:M,isPending:R,isTransitioning:E},Z=M?t:void 0,te;typeof a=="function"?te=a(D):te=[a,M?"active":null,R?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let q=typeof o=="function"?o(D):o;return x.createElement(Ew,{...h,"aria-current":Z,className:te,ref:g,style:q,to:u,viewTransition:f},typeof m=="function"?m(D):m)});Nw.displayName="NavLink";var eT=x.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:a,replace:l,state:o,method:u=gd,action:f,onSubmit:m,relative:h,preventScrollReset:g,viewTransition:y,unstable_defaultShouldRevalidate:b,...S},k)=>{let{unstable_useTransitions:j}=x.useContext(rr),E=iT(),C=lT(f,{relative:h}),T=u.toLowerCase()==="get"?"get":"post",O=typeof f=="string"&&Cw.test(f),B=M=>{if(m&&m(M),M.defaultPrevented)return;M.preventDefault();let R=M.nativeEvent.submitter,D=(R==null?void 0:R.getAttribute("formmethod"))||u,Z=()=>E(R||M.currentTarget,{fetcherKey:t,method:D,navigate:n,replace:l,state:o,relative:h,preventScrollReset:g,viewTransition:y,unstable_defaultShouldRevalidate:b});j&&n!==!1?x.startTransition(()=>Z()):Z()};return x.createElement("form",{ref:k,method:T,action:C,onSubmit:a?m:B,...S,"data-discover":!O&&e==="render"?"true":void 0})});eT.displayName="Form";function tT(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function _w(e){let t=x.useContext(Fs);return At(t,tT(e)),t}function nT(e,{target:t,replace:n,unstable_mask:a,state:l,preventScrollReset:o,relative:u,viewTransition:f,unstable_defaultShouldRevalidate:m,unstable_useTransitions:h}={}){let g=Zr(),y=br(),b=ju(e,{relative:u});return x.useCallback(S=>{if(OA(S,t)){S.preventDefault();let k=n!==void 0?n:uu(y)===uu(b),j=()=>g(e,{replace:k,unstable_mask:a,state:l,preventScrollReset:o,relative:u,viewTransition:f,unstable_defaultShouldRevalidate:m});h?x.startTransition(()=>j()):j()}},[y,g,b,n,a,l,t,e,o,u,f,m,h])}function Zd(e){yr(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=x.useRef(Dp(e)),n=x.useRef(!1),a=br(),l=x.useMemo(()=>MA(a.search,n.current?null:t.current),[a.search]),o=Zr(),u=x.useCallback((f,m)=>{const h=Dp(typeof f=="function"?f(new URLSearchParams(l)):f);n.current=!0,o("?"+h,m)},[o,l]);return[l,u]}var rT=0,aT=()=>`__${String(++rT)}__`;function iT(){let{router:e}=_w("useSubmit"),{basename:t}=x.useContext(rr),n=kA(),a=e.fetch,l=e.navigate;return x.useCallback(async(o,u={})=>{let{action:f,method:m,encType:h,formData:g,body:y}=IA(o,t);if(u.navigate===!1){let b=u.fetcherKey||aT();await a(b,n,u.action||f,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:g,body:y,formMethod:u.method||m,formEncType:u.encType||h,flushSync:u.flushSync})}else await l(u.action||f,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:g,body:y,formMethod:u.method||m,formEncType:u.encType||h,replace:u.replace,state:u.state,fromRouteId:n,flushSync:u.flushSync,viewTransition:u.viewTransition})},[a,l,t,n])}function lT(e,{relative:t}={}){let{basename:n}=x.useContext(rr),a=x.useContext(vr);At(a,"useFormAction must be used inside a RouteContext");let[l]=a.matches.slice(-1),o={...ju(e||".",{relative:t})},u=br();if(e==null){o.search=u.search;let f=new URLSearchParams(o.search),m=f.getAll("index");if(m.some(g=>g==="")){f.delete("index"),m.filter(y=>y).forEach(y=>f.append("index",y));let g=f.toString();o.search=g?`?${g}`:""}}return(!e||e===".")&&l.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:qr([n,o.pathname])),uu(o)}function sT(e,{relative:t}={}){let n=x.useContext(gw);At(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=_w("useViewTransitionState"),l=ju(e,{relative:t});if(!n.isTransitioning)return!1;let o=Sa(n.currentLocation.pathname,a)||n.currentLocation.pathname,u=Sa(n.nextLocation.pathname,a)||n.nextLocation.pathname;return Ed(l.pathname,u)!=null||Ed(l.pathname,o)!=null}const oT="/api/v1";async function uT(e,t){const n=await fetch(`${oT}/auth/login`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:e,password:t})});if(!n.ok){const a=await n.text();let l;try{l=JSON.parse(a).error??a}catch{l=a}throw new Error(l)}return await n.json()}const Aw="/api/v1",kg="first-tree-hub:tokens";function jg(){const e=localStorage.getItem(kg);if(!e)return null;try{return JSON.parse(e)}catch{return null}}function Tw(e){localStorage.setItem(kg,JSON.stringify(e))}function Rw(){localStorage.removeItem(kg)}class Vd extends Error{constructor(t,n,a){super(n),this.status=t,this.issues=a,this.name="ApiError"}}let Ho=null;async function cT(e){return Ho||(Ho=(async()=>{try{const t=await fetch(`${Aw}/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:e})});if(!t.ok)return null;const n=await t.json(),a={accessToken:n.accessToken,refreshToken:n.refreshToken??e};return Tw(a),a}catch{return null}finally{Ho=null}})(),Ho)}async function Xc(e,t){const{method:n="GET",body:a}=t??{},l=f=>{const m={};return f&&(m.Authorization=`Bearer ${f}`),a!==void 0&&(m["Content-Type"]="application/json"),fetch(`${Aw}${e}`,{method:n,headers:m,body:a!==void 0?JSON.stringify(a):void 0})},o=jg();let u=await l(o==null?void 0:o.accessToken);if(u.status===401&&(o!=null&&o.refreshToken)){const f=await cT(o.refreshToken);f&&(u=await l(f.accessToken))}if(!u.ok){u.status===401&&(Rw(),window.dispatchEvent(new CustomEvent("auth:logout")));const f=await u.text();let m,h;try{const g=JSON.parse(f);m=g.error??f,Array.isArray(g.details)&&(h=g.details.filter(y=>typeof y=="object"&&y!==null&&Array.isArray(y.path)))}catch{m=f}throw new Vd(u.status,m,h)}if(u.status!==204)return await u.json()}const Me={get:e=>Xc(e),post:(e,t)=>Xc(e,{method:"POST",body:t}),patch:(e,t)=>Xc(e,{method:"PATCH",body:t}),delete:e=>Xc(e,{method:"DELETE"})},zw=x.createContext(null);function dT({children:e}){const[t,n]=x.useState(()=>!!jg()),[a,l]=x.useState(null),[o,u]=x.useState(null),[f,m]=x.useState(null),h=x.useCallback(()=>{Rw(),n(!1),l(null),u(null),m(null)},[]),g=x.useCallback(async()=>{try{const b=await Me.get("/me");l(b.member.role),u(b.member.id),m(b.member.agentId)}catch{}},[]),y=x.useCallback(async(b,S)=>{const k=await uT(b,S);Tw({accessToken:k.accessToken,refreshToken:k.refreshToken}),n(!0),await Me.get("/me").then(j=>{l(j.member.role),u(j.member.id),m(j.member.agentId)}).catch(()=>{})},[]);return x.useEffect(()=>{t&&!a&&g()},[t,a,g]),x.useEffect(()=>{const b=()=>h();return window.addEventListener("auth:logout",b),()=>window.removeEventListener("auth:logout",b)},[h]),d.jsx(zw.Provider,{value:{isAuthenticated:t,role:a,memberId:o,agentId:f,login:y,logout:h},children:e})}function wa(){const e=x.useContext(zw);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}function fT(){const{isAuthenticated:e}=wa();return e?d.jsx(Op,{}):d.jsx(xg,{to:"/login",replace:!0})}/**
61
+ * @license lucide-react v0.577.0 - ISC
62
+ *
63
+ * This source code is licensed under the ISC license.
64
+ * See the LICENSE file in the root directory of this source tree.
65
+ */const Ow=(...e)=>e.filter((t,n,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===n).join(" ").trim();/**
66
+ * @license lucide-react v0.577.0 - ISC
67
+ *
68
+ * This source code is licensed under the ISC license.
69
+ * See the LICENSE file in the root directory of this source tree.
70
+ */const hT=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
71
+ * @license lucide-react v0.577.0 - ISC
72
+ *
73
+ * This source code is licensed under the ISC license.
74
+ * See the LICENSE file in the root directory of this source tree.
75
+ */const mT=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,a)=>a?a.toUpperCase():n.toLowerCase());/**
76
+ * @license lucide-react v0.577.0 - ISC
77
+ *
78
+ * This source code is licensed under the ISC license.
79
+ * See the LICENSE file in the root directory of this source tree.
80
+ */const U0=e=>{const t=mT(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
81
+ * @license lucide-react v0.577.0 - ISC
82
+ *
83
+ * This source code is licensed under the ISC license.
84
+ * See the LICENSE file in the root directory of this source tree.
85
+ */var pT={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"};/**
86
+ * @license lucide-react v0.577.0 - ISC
87
+ *
88
+ * This source code is licensed under the ISC license.
89
+ * See the LICENSE file in the root directory of this source tree.
90
+ */const gT=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
91
+ * @license lucide-react v0.577.0 - ISC
92
+ *
93
+ * This source code is licensed under the ISC license.
94
+ * See the LICENSE file in the root directory of this source tree.
95
+ */const yT=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:l="",children:o,iconNode:u,...f},m)=>x.createElement("svg",{ref:m,...pT,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:Ow("lucide",l),...!o&&!gT(f)&&{"aria-hidden":"true"},...f},[...u.map(([h,g])=>x.createElement(h,g)),...Array.isArray(o)?o:[o]]));/**
96
+ * @license lucide-react v0.577.0 - ISC
97
+ *
98
+ * This source code is licensed under the ISC license.
99
+ * See the LICENSE file in the root directory of this source tree.
100
+ */const mt=(e,t)=>{const n=x.forwardRef(({className:a,...l},o)=>x.createElement(yT,{ref:o,iconNode:t,className:Ow(`lucide-${hT(U0(e))}`,`lucide-${e}`,a),...l}));return n.displayName=U0(e),n};/**
101
+ * @license lucide-react v0.577.0 - ISC
102
+ *
103
+ * This source code is licensed under the ISC license.
104
+ * See the LICENSE file in the root directory of this source tree.
105
+ */const vT=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],bT=mt("bell",vT);/**
106
+ * @license lucide-react v0.577.0 - ISC
107
+ *
108
+ * This source code is licensed under the ISC license.
109
+ * See the LICENSE file in the root directory of this source tree.
110
+ */const xT=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],ST=mt("bot",xT);/**
111
+ * @license lucide-react v0.577.0 - ISC
112
+ *
113
+ * This source code is licensed under the ISC license.
114
+ * See the LICENSE file in the root directory of this source tree.
115
+ */const wT=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Cu=mt("check",wT);/**
116
+ * @license lucide-react v0.577.0 - ISC
117
+ *
118
+ * This source code is licensed under the ISC license.
119
+ * See the LICENSE file in the root directory of this source tree.
120
+ */const kT=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],jT=mt("chevron-down",kT);/**
121
+ * @license lucide-react v0.577.0 - ISC
122
+ *
123
+ * This source code is licensed under the ISC license.
124
+ * See the LICENSE file in the root directory of this source tree.
125
+ */const CT=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ET=mt("chevron-right",CT);/**
126
+ * @license lucide-react v0.577.0 - ISC
127
+ *
128
+ * This source code is licensed under the ISC license.
129
+ * See the LICENSE file in the root directory of this source tree.
130
+ */const NT=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Cg=mt("copy",NT);/**
131
+ * @license lucide-react v0.577.0 - ISC
132
+ *
133
+ * This source code is licensed under the ISC license.
134
+ * See the LICENSE file in the root directory of this source tree.
135
+ */const _T=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],AT=mt("eye-off",_T);/**
136
+ * @license lucide-react v0.577.0 - ISC
137
+ *
138
+ * This source code is licensed under the ISC license.
139
+ * See the LICENSE file in the root directory of this source tree.
140
+ */const TT=[["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"}]],RT=mt("eye",TT);/**
141
+ * @license lucide-react v0.577.0 - ISC
142
+ *
143
+ * This source code is licensed under the ISC license.
144
+ * See the LICENSE file in the root directory of this source tree.
145
+ */const zT=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],OT=mt("layout-dashboard",zT);/**
146
+ * @license lucide-react v0.577.0 - ISC
147
+ *
148
+ * This source code is licensed under the ISC license.
149
+ * See the LICENSE file in the root directory of this source tree.
150
+ */const MT=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],Mw=mt("link-2",MT);/**
151
+ * @license lucide-react v0.577.0 - ISC
152
+ *
153
+ * This source code is licensed under the ISC license.
154
+ * See the LICENSE file in the root directory of this source tree.
155
+ */const DT=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],LT=mt("loader-circle",DT);/**
156
+ * @license lucide-react v0.577.0 - ISC
157
+ *
158
+ * This source code is licensed under the ISC license.
159
+ * See the LICENSE file in the root directory of this source tree.
160
+ */const IT=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],Dw=mt("lock",IT);/**
161
+ * @license lucide-react v0.577.0 - ISC
162
+ *
163
+ * This source code is licensed under the ISC license.
164
+ * See the LICENSE file in the root directory of this source tree.
165
+ */const UT=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],PT=mt("log-out",UT);/**
166
+ * @license lucide-react v0.577.0 - ISC
167
+ *
168
+ * This source code is licensed under the ISC license.
169
+ * See the LICENSE file in the root directory of this source tree.
170
+ */const BT=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],Eg=mt("message-square",BT);/**
171
+ * @license lucide-react v0.577.0 - ISC
172
+ *
173
+ * This source code is licensed under the ISC license.
174
+ * See the LICENSE file in the root directory of this source tree.
175
+ */const $T=[["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"}]],FT=mt("moon",$T);/**
176
+ * @license lucide-react v0.577.0 - ISC
177
+ *
178
+ * This source code is licensed under the ISC license.
179
+ * See the LICENSE file in the root directory of this source tree.
180
+ */const qT=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],HT=mt("paperclip",qT);/**
181
+ * @license lucide-react v0.577.0 - ISC
182
+ *
183
+ * This source code is licensed under the ISC license.
184
+ * See the LICENSE file in the root directory of this source tree.
185
+ */const ZT=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],VT=mt("pause",ZT);/**
186
+ * @license lucide-react v0.577.0 - ISC
187
+ *
188
+ * This source code is licensed under the ISC license.
189
+ * See the LICENSE file in the root directory of this source tree.
190
+ */const QT=[["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"}]],Eu=mt("pencil",QT);/**
191
+ * @license lucide-react v0.577.0 - ISC
192
+ *
193
+ * This source code is licensed under the ISC license.
194
+ * See the LICENSE file in the root directory of this source tree.
195
+ */const GT=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],Lw=mt("play",GT);/**
196
+ * @license lucide-react v0.577.0 - ISC
197
+ *
198
+ * This source code is licensed under the ISC license.
199
+ * See the LICENSE file in the root directory of this source tree.
200
+ */const KT=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],vi=mt("plus",KT);/**
201
+ * @license lucide-react v0.577.0 - ISC
202
+ *
203
+ * This source code is licensed under the ISC license.
204
+ * See the LICENSE file in the root directory of this source tree.
205
+ */const YT=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Qd=mt("search",YT);/**
206
+ * @license lucide-react v0.577.0 - ISC
207
+ *
208
+ * This source code is licensed under the ISC license.
209
+ * See the LICENSE file in the root directory of this source tree.
210
+ */const XT=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],JT=mt("send",XT);/**
211
+ * @license lucide-react v0.577.0 - ISC
212
+ *
213
+ * This source code is licensed under the ISC license.
214
+ * See the LICENSE file in the root directory of this source tree.
215
+ */const WT=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],eR=mt("square",WT);/**
216
+ * @license lucide-react v0.577.0 - ISC
217
+ *
218
+ * This source code is licensed under the ISC license.
219
+ * See the LICENSE file in the root directory of this source tree.
220
+ */const tR=[["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"}]],nR=mt("sun",tR);/**
221
+ * @license lucide-react v0.577.0 - ISC
222
+ *
223
+ * This source code is licensed under the ISC license.
224
+ * See the LICENSE file in the root directory of this source tree.
225
+ */const rR=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],aR=mt("terminal",rR);/**
226
+ * @license lucide-react v0.577.0 - ISC
227
+ *
228
+ * This source code is licensed under the ISC license.
229
+ * See the LICENSE file in the root directory of this source tree.
230
+ */const iR=[["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"}]],Os=mt("trash-2",iR);/**
231
+ * @license lucide-react v0.577.0 - ISC
232
+ *
233
+ * This source code is licensed under the ISC license.
234
+ * See the LICENSE file in the root directory of this source tree.
235
+ */const lR=[["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"}]],sR=mt("triangle-alert",lR);/**
236
+ * @license lucide-react v0.577.0 - ISC
237
+ *
238
+ * This source code is licensed under the ISC license.
239
+ * See the LICENSE file in the root directory of this source tree.
240
+ */const oR=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],uR=mt("undo-2",oR);/**
241
+ * @license lucide-react v0.577.0 - ISC
242
+ *
243
+ * This source code is licensed under the ISC license.
244
+ * See the LICENSE file in the root directory of this source tree.
245
+ */const cR=[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]],dR=mt("unplug",cR);/**
246
+ * @license lucide-react v0.577.0 - ISC
247
+ *
248
+ * This source code is licensed under the ISC license.
249
+ * See the LICENSE file in the root directory of this source tree.
250
+ */const fR=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Nd=mt("x",fR);function Iw(e){var t,n,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var l=e.length;for(t=0;t<l;t++)e[t]&&(n=Iw(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function Uw(){for(var e,t,n=0,a="",l=arguments.length;n<l;n++)(e=arguments[n])&&(t=Iw(e))&&(a&&(a+=" "),a+=t);return a}const hR=(e,t)=>{const n=new Array(e.length+t.length);for(let a=0;a<e.length;a++)n[a]=e[a];for(let a=0;a<t.length;a++)n[e.length+a]=t[a];return n},mR=(e,t)=>({classGroupId:e,validator:t}),Pw=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),_d="-",P0=[],pR="arbitrary..",gR=e=>{const t=vR(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return yR(u);const f=u.split(_d),m=f[0]===""&&f.length>1?1:0;return Bw(f,m,t)},getConflictingClassGroupIds:(u,f)=>{if(f){const m=a[u],h=n[u];return m?h?hR(h,m):m:h||P0}return n[u]||P0}}},Bw=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const l=e[t],o=n.nextPart.get(l);if(o){const h=Bw(e,t+1,o);if(h)return h}const u=n.validators;if(u===null)return;const f=t===0?e.join(_d):e.slice(t).join(_d),m=u.length;for(let h=0;h<m;h++){const g=u[h];if(g.validator(f))return g.classGroupId}},yR=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),a=t.slice(0,n);return a?pR+a:void 0})(),vR=e=>{const{theme:t,classGroups:n}=e;return bR(n,t)},bR=(e,t)=>{const n=Pw();for(const a in e){const l=e[a];Ng(l,n,a,t)}return n},Ng=(e,t,n,a)=>{const l=e.length;for(let o=0;o<l;o++){const u=e[o];xR(u,t,n,a)}},xR=(e,t,n,a)=>{if(typeof e=="string"){SR(e,t,n);return}if(typeof e=="function"){wR(e,t,n,a);return}kR(e,t,n,a)},SR=(e,t,n)=>{const a=e===""?t:$w(t,e);a.classGroupId=n},wR=(e,t,n,a)=>{if(jR(e)){Ng(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(mR(n,e))},kR=(e,t,n,a)=>{const l=Object.entries(e),o=l.length;for(let u=0;u<o;u++){const[f,m]=l[u];Ng(m,$w(t,f),n,a)}},$w=(e,t)=>{let n=e;const a=t.split(_d),l=a.length;for(let o=0;o<l;o++){const u=a[o];let f=n.nextPart.get(u);f||(f=Pw(),n.nextPart.set(u,f)),n=f}return n},jR=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,CR=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),a=Object.create(null);const l=(o,u)=>{n[o]=u,t++,t>e&&(t=0,a=n,n=Object.create(null))};return{get(o){let u=n[o];if(u!==void 0)return u;if((u=a[o])!==void 0)return l(o,u),u},set(o,u){o in n?n[o]=u:l(o,u)}}},Lp="!",B0=":",ER=[],$0=(e,t,n,a,l)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:l}),NR=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=l=>{const o=[];let u=0,f=0,m=0,h;const g=l.length;for(let j=0;j<g;j++){const E=l[j];if(u===0&&f===0){if(E===B0){o.push(l.slice(m,j)),m=j+1;continue}if(E==="/"){h=j;continue}}E==="["?u++:E==="]"?u--:E==="("?f++:E===")"&&f--}const y=o.length===0?l:l.slice(m);let b=y,S=!1;y.endsWith(Lp)?(b=y.slice(0,-1),S=!0):y.startsWith(Lp)&&(b=y.slice(1),S=!0);const k=h&&h>m?h-m:void 0;return $0(o,S,b,k)};if(t){const l=t+B0,o=a;a=u=>u.startsWith(l)?o(u.slice(l.length)):$0(ER,!1,u,void 0,!0)}if(n){const l=a;a=o=>n({className:o,parseClassName:l})}return a},_R=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,a)=>{t.set(n,1e6+a)}),n=>{const a=[];let l=[];for(let o=0;o<n.length;o++){const u=n[o],f=u[0]==="[",m=t.has(u);f||m?(l.length>0&&(l.sort(),a.push(...l),l=[]),a.push(u)):l.push(u)}return l.length>0&&(l.sort(),a.push(...l)),a}},AR=e=>({cache:CR(e.cacheSize),parseClassName:NR(e),sortModifiers:_R(e),...gR(e)}),TR=/\s+/,RR=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:l,sortModifiers:o}=t,u=[],f=e.trim().split(TR);let m="";for(let h=f.length-1;h>=0;h-=1){const g=f[h],{isExternal:y,modifiers:b,hasImportantModifier:S,baseClassName:k,maybePostfixModifierPosition:j}=n(g);if(y){m=g+(m.length>0?" "+m:m);continue}let E=!!j,C=a(E?k.substring(0,j):k);if(!C){if(!E){m=g+(m.length>0?" "+m:m);continue}if(C=a(k),!C){m=g+(m.length>0?" "+m:m);continue}E=!1}const T=b.length===0?"":b.length===1?b[0]:o(b).join(":"),O=S?T+Lp:T,B=O+C;if(u.indexOf(B)>-1)continue;u.push(B);const M=l(C,E);for(let R=0;R<M.length;++R){const D=M[R];u.push(O+D)}m=g+(m.length>0?" "+m:m)}return m},zR=(...e)=>{let t=0,n,a,l="";for(;t<e.length;)(n=e[t++])&&(a=Fw(n))&&(l&&(l+=" "),l+=a);return l},Fw=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=Fw(e[a]))&&(n&&(n+=" "),n+=t);return n},OR=(e,...t)=>{let n,a,l,o;const u=m=>{const h=t.reduce((g,y)=>y(g),e());return n=AR(h),a=n.cache.get,l=n.cache.set,o=f,f(m)},f=m=>{const h=a(m);if(h)return h;const g=RR(m,n);return l(m,g),g};return o=u,(...m)=>o(zR(...m))},MR=[],Kt=e=>{const t=n=>n[e]||MR;return t.isThemeGetter=!0,t},qw=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Hw=/^\((?:(\w[\w-]*):)?(.+)\)$/i,DR=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,LR=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,IR=/\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$/,UR=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,PR=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,BR=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ei=e=>DR.test(e),Ze=e=>!!e&&!Number.isNaN(Number(e)),ti=e=>!!e&&Number.isInteger(Number(e)),Dm=e=>e.endsWith("%")&&Ze(e.slice(0,-1)),ha=e=>LR.test(e),Zw=()=>!0,$R=e=>IR.test(e)&&!UR.test(e),_g=()=>!1,FR=e=>PR.test(e),qR=e=>BR.test(e),HR=e=>!ke(e)&&!je(e),ZR=e=>ji(e,Gw,_g),ke=e=>qw.test(e),Yi=e=>ji(e,Kw,$R),F0=e=>ji(e,WR,Ze),VR=e=>ji(e,Xw,Zw),QR=e=>ji(e,Yw,_g),q0=e=>ji(e,Vw,_g),GR=e=>ji(e,Qw,qR),Jc=e=>ji(e,Jw,FR),je=e=>Hw.test(e),Zo=e=>pl(e,Kw),KR=e=>pl(e,Yw),H0=e=>pl(e,Vw),YR=e=>pl(e,Gw),XR=e=>pl(e,Qw),Wc=e=>pl(e,Jw,!0),JR=e=>pl(e,Xw,!0),ji=(e,t,n)=>{const a=qw.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},pl=(e,t,n=!1)=>{const a=Hw.exec(e);return a?a[1]?t(a[1]):n:!1},Vw=e=>e==="position"||e==="percentage",Qw=e=>e==="image"||e==="url",Gw=e=>e==="length"||e==="size"||e==="bg-size",Kw=e=>e==="length",WR=e=>e==="number",Yw=e=>e==="family-name",Xw=e=>e==="number"||e==="weight",Jw=e=>e==="shadow",ez=()=>{const e=Kt("color"),t=Kt("font"),n=Kt("text"),a=Kt("font-weight"),l=Kt("tracking"),o=Kt("leading"),u=Kt("breakpoint"),f=Kt("container"),m=Kt("spacing"),h=Kt("radius"),g=Kt("shadow"),y=Kt("inset-shadow"),b=Kt("text-shadow"),S=Kt("drop-shadow"),k=Kt("blur"),j=Kt("perspective"),E=Kt("aspect"),C=Kt("ease"),T=Kt("animate"),O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],B=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],M=()=>[...B(),je,ke],R=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto","contain","none"],Z=()=>[je,ke,m],te=()=>[ei,"full","auto",...Z()],q=()=>[ti,"none","subgrid",je,ke],oe=()=>["auto",{span:["full",ti,je,ke]},ti,je,ke],W=()=>[ti,"auto",je,ke],me=()=>["auto","min","max","fr",je,ke],de=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ee=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...Z()],re=()=>[ei,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...Z()],K=()=>[ei,"screen","full","dvw","lvw","svw","min","max","fit",...Z()],he=()=>[ei,"screen","full","lh","dvh","lvh","svh","min","max","fit",...Z()],A=()=>[e,je,ke],I=()=>[...B(),H0,q0,{position:[je,ke]}],U=()=>["no-repeat",{repeat:["","x","y","space","round"]}],_=()=>["auto","cover","contain",YR,ZR,{size:[je,ke]}],$=()=>[Dm,Zo,Yi],X=()=>["","none","full",h,je,ke],ue=()=>["",Ze,Zo,Yi],Se=()=>["solid","dashed","dotted","double"],De=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ge=()=>[Ze,Dm,H0,q0],ut=()=>["","none",k,je,ke],ae=()=>["none",Ze,je,ke],Oe=()=>["none",Ze,je,ke],at=()=>[Ze,je,ke],Pe=()=>[ei,"full",...Z()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ha],breakpoint:[ha],color:[Zw],container:[ha],"drop-shadow":[ha],ease:["in","out","in-out"],font:[HR],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ha],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ha],shadow:[ha],spacing:["px",Ze],text:[ha],"text-shadow":[ha],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ei,ke,je,E]}],container:["container"],columns:[{columns:[Ze,ke,je,f]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:M()}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:te()}],"inset-x":[{"inset-x":te()}],"inset-y":[{"inset-y":te()}],start:[{"inset-s":te(),start:te()}],end:[{"inset-e":te(),end:te()}],"inset-bs":[{"inset-bs":te()}],"inset-be":[{"inset-be":te()}],top:[{top:te()}],right:[{right:te()}],bottom:[{bottom:te()}],left:[{left:te()}],visibility:["visible","invisible","collapse"],z:[{z:[ti,"auto",je,ke]}],basis:[{basis:[ei,"full","auto",f,...Z()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ze,ei,"auto","initial","none",ke]}],grow:[{grow:["",Ze,je,ke]}],shrink:[{shrink:["",Ze,je,ke]}],order:[{order:[ti,"first","last","none",je,ke]}],"grid-cols":[{"grid-cols":q()}],"col-start-end":[{col:oe()}],"col-start":[{"col-start":W()}],"col-end":[{"col-end":W()}],"grid-rows":[{"grid-rows":q()}],"row-start-end":[{row:oe()}],"row-start":[{"row-start":W()}],"row-end":[{"row-end":W()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":me()}],"auto-rows":[{"auto-rows":me()}],gap:[{gap:Z()}],"gap-x":[{"gap-x":Z()}],"gap-y":[{"gap-y":Z()}],"justify-content":[{justify:[...de(),"normal"]}],"justify-items":[{"justify-items":[...ee(),"normal"]}],"justify-self":[{"justify-self":["auto",...ee()]}],"align-content":[{content:["normal",...de()]}],"align-items":[{items:[...ee(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ee(),{baseline:["","last"]}]}],"place-content":[{"place-content":de()}],"place-items":[{"place-items":[...ee(),"baseline"]}],"place-self":[{"place-self":["auto",...ee()]}],p:[{p:Z()}],px:[{px:Z()}],py:[{py:Z()}],ps:[{ps:Z()}],pe:[{pe:Z()}],pbs:[{pbs:Z()}],pbe:[{pbe:Z()}],pt:[{pt:Z()}],pr:[{pr:Z()}],pb:[{pb:Z()}],pl:[{pl:Z()}],m:[{m:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mbs:[{mbs:H()}],mbe:[{mbe:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":Z()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":Z()}],"space-y-reverse":["space-y-reverse"],size:[{size:re()}],"inline-size":[{inline:["auto",...K()]}],"min-inline-size":[{"min-inline":["auto",...K()]}],"max-inline-size":[{"max-inline":["none",...K()]}],"block-size":[{block:["auto",...he()]}],"min-block-size":[{"min-block":["auto",...he()]}],"max-block-size":[{"max-block":["none",...he()]}],w:[{w:[f,"screen",...re()]}],"min-w":[{"min-w":[f,"screen","none",...re()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[u]},...re()]}],h:[{h:["screen","lh",...re()]}],"min-h":[{"min-h":["screen","lh","none",...re()]}],"max-h":[{"max-h":["screen","lh",...re()]}],"font-size":[{text:["base",n,Zo,Yi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,JR,VR]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Dm,ke]}],"font-family":[{font:[KR,QR,t]}],"font-features":[{"font-features":[ke]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[l,je,ke]}],"line-clamp":[{"line-clamp":[Ze,"none",je,F0]}],leading:[{leading:[o,...Z()]}],"list-image":[{"list-image":["none",je,ke]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",je,ke]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:A()}],"text-color":[{text:A()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Se(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ze,"from-font","auto",je,Yi]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[Ze,"auto",je,ke]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:Z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",je,ke]}],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",je,ke]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:I()}],"bg-repeat":[{bg:U()}],"bg-size":[{bg:_()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ti,je,ke],radial:["",je,ke],conic:[ti,je,ke]},XR,GR]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:$()}],"gradient-via-pos":[{via:$()}],"gradient-to-pos":[{to:$()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:X()}],"rounded-s":[{"rounded-s":X()}],"rounded-e":[{"rounded-e":X()}],"rounded-t":[{"rounded-t":X()}],"rounded-r":[{"rounded-r":X()}],"rounded-b":[{"rounded-b":X()}],"rounded-l":[{"rounded-l":X()}],"rounded-ss":[{"rounded-ss":X()}],"rounded-se":[{"rounded-se":X()}],"rounded-ee":[{"rounded-ee":X()}],"rounded-es":[{"rounded-es":X()}],"rounded-tl":[{"rounded-tl":X()}],"rounded-tr":[{"rounded-tr":X()}],"rounded-br":[{"rounded-br":X()}],"rounded-bl":[{"rounded-bl":X()}],"border-w":[{border:ue()}],"border-w-x":[{"border-x":ue()}],"border-w-y":[{"border-y":ue()}],"border-w-s":[{"border-s":ue()}],"border-w-e":[{"border-e":ue()}],"border-w-bs":[{"border-bs":ue()}],"border-w-be":[{"border-be":ue()}],"border-w-t":[{"border-t":ue()}],"border-w-r":[{"border-r":ue()}],"border-w-b":[{"border-b":ue()}],"border-w-l":[{"border-l":ue()}],"divide-x":[{"divide-x":ue()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ue()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Se(),"hidden","none"]}],"divide-style":[{divide:[...Se(),"hidden","none"]}],"border-color":[{border:A()}],"border-color-x":[{"border-x":A()}],"border-color-y":[{"border-y":A()}],"border-color-s":[{"border-s":A()}],"border-color-e":[{"border-e":A()}],"border-color-bs":[{"border-bs":A()}],"border-color-be":[{"border-be":A()}],"border-color-t":[{"border-t":A()}],"border-color-r":[{"border-r":A()}],"border-color-b":[{"border-b":A()}],"border-color-l":[{"border-l":A()}],"divide-color":[{divide:A()}],"outline-style":[{outline:[...Se(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ze,je,ke]}],"outline-w":[{outline:["",Ze,Zo,Yi]}],"outline-color":[{outline:A()}],shadow:[{shadow:["","none",g,Wc,Jc]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":["none",y,Wc,Jc]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:ue()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[Ze,Yi]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":ue()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":["none",b,Wc,Jc]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[Ze,je,ke]}],"mix-blend":[{"mix-blend":[...De(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":De()}],"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":[Ze]}],"mask-image-linear-from-pos":[{"mask-linear-from":ge()}],"mask-image-linear-to-pos":[{"mask-linear-to":ge()}],"mask-image-linear-from-color":[{"mask-linear-from":A()}],"mask-image-linear-to-color":[{"mask-linear-to":A()}],"mask-image-t-from-pos":[{"mask-t-from":ge()}],"mask-image-t-to-pos":[{"mask-t-to":ge()}],"mask-image-t-from-color":[{"mask-t-from":A()}],"mask-image-t-to-color":[{"mask-t-to":A()}],"mask-image-r-from-pos":[{"mask-r-from":ge()}],"mask-image-r-to-pos":[{"mask-r-to":ge()}],"mask-image-r-from-color":[{"mask-r-from":A()}],"mask-image-r-to-color":[{"mask-r-to":A()}],"mask-image-b-from-pos":[{"mask-b-from":ge()}],"mask-image-b-to-pos":[{"mask-b-to":ge()}],"mask-image-b-from-color":[{"mask-b-from":A()}],"mask-image-b-to-color":[{"mask-b-to":A()}],"mask-image-l-from-pos":[{"mask-l-from":ge()}],"mask-image-l-to-pos":[{"mask-l-to":ge()}],"mask-image-l-from-color":[{"mask-l-from":A()}],"mask-image-l-to-color":[{"mask-l-to":A()}],"mask-image-x-from-pos":[{"mask-x-from":ge()}],"mask-image-x-to-pos":[{"mask-x-to":ge()}],"mask-image-x-from-color":[{"mask-x-from":A()}],"mask-image-x-to-color":[{"mask-x-to":A()}],"mask-image-y-from-pos":[{"mask-y-from":ge()}],"mask-image-y-to-pos":[{"mask-y-to":ge()}],"mask-image-y-from-color":[{"mask-y-from":A()}],"mask-image-y-to-color":[{"mask-y-to":A()}],"mask-image-radial":[{"mask-radial":[je,ke]}],"mask-image-radial-from-pos":[{"mask-radial-from":ge()}],"mask-image-radial-to-pos":[{"mask-radial-to":ge()}],"mask-image-radial-from-color":[{"mask-radial-from":A()}],"mask-image-radial-to-color":[{"mask-radial-to":A()}],"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":B()}],"mask-image-conic-pos":[{"mask-conic":[Ze]}],"mask-image-conic-from-pos":[{"mask-conic-from":ge()}],"mask-image-conic-to-pos":[{"mask-conic-to":ge()}],"mask-image-conic-from-color":[{"mask-conic-from":A()}],"mask-image-conic-to-color":[{"mask-conic-to":A()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:I()}],"mask-repeat":[{mask:U()}],"mask-size":[{mask:_()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",je,ke]}],filter:[{filter:["","none",je,ke]}],blur:[{blur:ut()}],brightness:[{brightness:[Ze,je,ke]}],contrast:[{contrast:[Ze,je,ke]}],"drop-shadow":[{"drop-shadow":["","none",S,Wc,Jc]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:["",Ze,je,ke]}],"hue-rotate":[{"hue-rotate":[Ze,je,ke]}],invert:[{invert:["",Ze,je,ke]}],saturate:[{saturate:[Ze,je,ke]}],sepia:[{sepia:["",Ze,je,ke]}],"backdrop-filter":[{"backdrop-filter":["","none",je,ke]}],"backdrop-blur":[{"backdrop-blur":ut()}],"backdrop-brightness":[{"backdrop-brightness":[Ze,je,ke]}],"backdrop-contrast":[{"backdrop-contrast":[Ze,je,ke]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ze,je,ke]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ze,je,ke]}],"backdrop-invert":[{"backdrop-invert":["",Ze,je,ke]}],"backdrop-opacity":[{"backdrop-opacity":[Ze,je,ke]}],"backdrop-saturate":[{"backdrop-saturate":[Ze,je,ke]}],"backdrop-sepia":[{"backdrop-sepia":["",Ze,je,ke]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":Z()}],"border-spacing-x":[{"border-spacing-x":Z()}],"border-spacing-y":[{"border-spacing-y":Z()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",je,ke]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ze,"initial",je,ke]}],ease:[{ease:["linear","initial",C,je,ke]}],delay:[{delay:[Ze,je,ke]}],animate:[{animate:["none",T,je,ke]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[j,je,ke]}],"perspective-origin":[{"perspective-origin":M()}],rotate:[{rotate:ae()}],"rotate-x":[{"rotate-x":ae()}],"rotate-y":[{"rotate-y":ae()}],"rotate-z":[{"rotate-z":ae()}],scale:[{scale:Oe()}],"scale-x":[{"scale-x":Oe()}],"scale-y":[{"scale-y":Oe()}],"scale-z":[{"scale-z":Oe()}],"scale-3d":["scale-3d"],skew:[{skew:at()}],"skew-x":[{"skew-x":at()}],"skew-y":[{"skew-y":at()}],transform:[{transform:[je,ke,"","none","gpu","cpu"]}],"transform-origin":[{origin:M()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Pe()}],"translate-x":[{"translate-x":Pe()}],"translate-y":[{"translate-y":Pe()}],"translate-z":[{"translate-z":Pe()}],"translate-none":["translate-none"],accent:[{accent:A()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:A()}],"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",je,ke]}],"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":Z()}],"scroll-mx":[{"scroll-mx":Z()}],"scroll-my":[{"scroll-my":Z()}],"scroll-ms":[{"scroll-ms":Z()}],"scroll-me":[{"scroll-me":Z()}],"scroll-mbs":[{"scroll-mbs":Z()}],"scroll-mbe":[{"scroll-mbe":Z()}],"scroll-mt":[{"scroll-mt":Z()}],"scroll-mr":[{"scroll-mr":Z()}],"scroll-mb":[{"scroll-mb":Z()}],"scroll-ml":[{"scroll-ml":Z()}],"scroll-p":[{"scroll-p":Z()}],"scroll-px":[{"scroll-px":Z()}],"scroll-py":[{"scroll-py":Z()}],"scroll-ps":[{"scroll-ps":Z()}],"scroll-pe":[{"scroll-pe":Z()}],"scroll-pbs":[{"scroll-pbs":Z()}],"scroll-pbe":[{"scroll-pbe":Z()}],"scroll-pt":[{"scroll-pt":Z()}],"scroll-pr":[{"scroll-pr":Z()}],"scroll-pb":[{"scroll-pb":Z()}],"scroll-pl":[{"scroll-pl":Z()}],"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",je,ke]}],fill:[{fill:["none",...A()]}],"stroke-w":[{stroke:[Ze,Zo,Yi,F0]}],stroke:[{stroke:["none",...A()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","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","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","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-bs","border-w-be","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-bs","border-color-be","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-mbs","scroll-mbe","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-pbs","scroll-pbe","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"]}},tz=OR(ez);function Ee(...e){return tz(Uw(e))}function bi(e){return e?new Intl.DateTimeFormat("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(new Date(e)):"—"}function nz(e){return Me.delete(`/clients/${encodeURIComponent(e)}`)}function Nu(){return Me.get("/admin/agents/activity")}function cu(){return Me.get("/clients")}function rz(e){return Me.post(`/clients/${e}/disconnect`)}function Ww(){return Me.post("/connect-tokens")}const ek=(e,t)=>["session",e,t],Ip=e=>["agent-sessions",e];function az(e){if(typeof e!="object"||e===null)return null;const t=e;return typeof t.toolUseId!="string"||typeof t.name!="string"||t.status!=="pending"&&t.status!=="ok"&&t.status!=="error"?null:{toolUseId:t.toolUseId,name:t.name,args:t.args,status:t.status,durationMs:typeof t.durationMs=="number"?t.durationMs:void 0,resultPreview:typeof t.resultPreview=="string"?t.resultPreview:void 0}}function iz(e){if(typeof e!="object"||e===null)return null;const t=e;return t.source!=="sdk"&&t.source!=="runtime"&&t.source!=="tool"||typeof t.message!="string"?null:{source:t.source,message:t.message}}function lz(e){if(typeof e!="object"||e===null)return null;const t=e;return typeof t.text!="string"?null:{text:t.text}}function Hs(e,t){const n=new URLSearchParams;t!=null&&t.state&&n.set("state",t.state),t!=null&&t.runtimeState&&n.set("runtimeState",t.runtimeState);const a=n.toString();return Me.get(`/admin/sessions/agents/${e}${a?`?${a}`:""}`)}function sz(e,t,n){const a=new URLSearchParams;a.set("limit",String(n.limit)),(n==null?void 0:n.cursor)!==void 0&&a.set("cursor",String(n.cursor)),n!=null&&n.direction&&a.set("direction",n.direction);const l=a.toString();return Me.get(`/admin/sessions/agents/${e}/${t}/events${l?`?${l}`:""}`)}function oz(e,t){return Me.post(`/admin/sessions/agents/${e}/${t}/suspend`)}function uz(e,t){return Me.post(`/admin/sessions/agents/${e}/${t}/terminate`)}var Z0=1,cz=.9,dz=.8,fz=.17,Lm=.1,Im=.999,hz=.9999,mz=.99,pz=/[\\\/_+.#"@\[\(\{&]/,gz=/[\\\/_+.#"@\[\(\{&]/g,yz=/[\s-]/,tk=/[\s-]/g;function Up(e,t,n,a,l,o,u){if(o===t.length)return l===e.length?Z0:mz;var f=`${l},${o}`;if(u[f]!==void 0)return u[f];for(var m=a.charAt(o),h=n.indexOf(m,l),g=0,y,b,S,k;h>=0;)y=Up(e,t,n,a,h+1,o+1,u),y>g&&(h===l?y*=Z0:pz.test(e.charAt(h-1))?(y*=dz,S=e.slice(l,h-1).match(gz),S&&l>0&&(y*=Math.pow(Im,S.length))):yz.test(e.charAt(h-1))?(y*=cz,k=e.slice(l,h-1).match(tk),k&&l>0&&(y*=Math.pow(Im,k.length))):(y*=fz,l>0&&(y*=Math.pow(Im,h-l))),e.charAt(h)!==t.charAt(o)&&(y*=hz)),(y<Lm&&n.charAt(h-1)===a.charAt(o+1)||a.charAt(o+1)===a.charAt(o)&&n.charAt(h-1)!==a.charAt(o))&&(b=Up(e,t,n,a,h+1,o+2,u),b*Lm>y&&(y=b*Lm)),y>g&&(g=y),h=n.indexOf(m,h+1);return u[f]=g,g}function V0(e){return e.toLowerCase().replace(tk," ")}function vz(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Up(e,t,V0(e),V0(t),0,0,{})}function yi(e,t,{checkForDefaultPrevented:n=!0}={}){return function(l){if(e==null||e(l),n===!1||!l.defaultPrevented)return t==null?void 0:t(l)}}function Q0(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function xi(...e){return t=>{let n=!1;const a=e.map(l=>{const o=Q0(l,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let l=0;l<a.length;l++){const o=a[l];typeof o=="function"?o():Q0(e[l],null)}}}}function gl(...e){return x.useCallback(xi(...e),e)}function bz(e,t){const n=x.createContext(t),a=o=>{const{children:u,...f}=o,m=x.useMemo(()=>f,Object.values(f));return d.jsx(n.Provider,{value:m,children:u})};a.displayName=e+"Provider";function l(o){const u=x.useContext(n);if(u)return u;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[a,l]}function xz(e,t=[]){let n=[];function a(o,u){const f=x.createContext(u),m=n.length;n=[...n,u];const h=y=>{var C;const{scope:b,children:S,...k}=y,j=((C=b==null?void 0:b[e])==null?void 0:C[m])||f,E=x.useMemo(()=>k,Object.values(k));return d.jsx(j.Provider,{value:E,children:S})};h.displayName=o+"Provider";function g(y,b){var j;const S=((j=b==null?void 0:b[e])==null?void 0:j[m])||f,k=x.useContext(S);if(k)return k;if(u!==void 0)return u;throw new Error(`\`${y}\` must be used within \`${o}\``)}return[h,g]}const l=()=>{const o=n.map(u=>x.createContext(u));return function(f){const m=(f==null?void 0:f[e])||o;return x.useMemo(()=>({[`__scope${e}`]:{...f,[e]:m}}),[f,m])}};return l.scopeName=e,[a,Sz(l,...t)]}function Sz(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const a=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(o){const u=a.reduce((f,{useScope:m,scopeName:h})=>{const y=m(o)[`__scope${h}`];return{...f,...y}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])}};return n.scopeName=t.scopeName,n}var du=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},wz=cg[" useId ".trim().toString()]||(()=>{}),kz=0;function ba(e){const[t,n]=x.useState(wz());return du(()=>{n(a=>a??String(kz++))},[e]),t?`radix-${t}`:""}var jz=cg[" useInsertionEffect ".trim().toString()]||du;function Cz({prop:e,defaultProp:t,onChange:n=()=>{},caller:a}){const[l,o,u]=Ez({defaultProp:t,onChange:n}),f=e!==void 0,m=f?e:l;{const g=x.useRef(e!==void 0);x.useEffect(()=>{const y=g.current;y!==f&&console.warn(`${a} is changing from ${y?"controlled":"uncontrolled"} to ${f?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),g.current=f},[f,a])}const h=x.useCallback(g=>{var y;if(f){const b=Nz(g)?g(e):g;b!==e&&((y=u.current)==null||y.call(u,b))}else o(g)},[f,e,o,u]);return[m,h]}function Ez({defaultProp:e,onChange:t}){const[n,a]=x.useState(e),l=x.useRef(n),o=x.useRef(t);return jz(()=>{o.current=t},[t]),x.useEffect(()=>{var u;l.current!==n&&((u=o.current)==null||u.call(o,n),l.current=n)},[n,l]),[n,a,o]}function Nz(e){return typeof e=="function"}var nk=XS();const _z=$d(nk);function rk(e){const t=Az(e),n=x.forwardRef((a,l)=>{const{children:o,...u}=a,f=x.Children.toArray(o),m=f.find(Rz);if(m){const h=m.props.children,g=f.map(y=>y===m?x.Children.count(h)>1?x.Children.only(null):x.isValidElement(h)?h.props.children:null:y);return d.jsx(t,{...u,ref:l,children:x.isValidElement(h)?x.cloneElement(h,void 0,g):null})}return d.jsx(t,{...u,ref:l,children:o})});return n.displayName=`${e}.Slot`,n}function Az(e){const t=x.forwardRef((n,a)=>{const{children:l,...o}=n;if(x.isValidElement(l)){const u=Oz(l),f=zz(o,l.props);return l.type!==x.Fragment&&(f.ref=a?xi(a,u):u),x.cloneElement(l,f)}return x.Children.count(l)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Tz=Symbol("radix.slottable");function Rz(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Tz}function zz(e,t){const n={...t};for(const a in t){const l=e[a],o=t[a];/^on[A-Z]/.test(a)?l&&o?n[a]=(...f)=>{const m=o(...f);return l(...f),m}:l&&(n[a]=l):a==="style"?n[a]={...l,...o}:a==="className"&&(n[a]=[l,o].filter(Boolean).join(" "))}return{...e,...n}}function Oz(e){var a,l;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Mz=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ka=Mz.reduce((e,t)=>{const n=rk(`Primitive.${t}`),a=x.forwardRef((l,o)=>{const{asChild:u,...f}=l,m=u?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(m,{...f,ref:o})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});function Dz(e,t){e&&nk.flushSync(()=>e.dispatchEvent(t))}function fu(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>{var a;return(a=t.current)==null?void 0:a.call(t,...n)},[])}function Lz(e,t=globalThis==null?void 0:globalThis.document){const n=fu(e);x.useEffect(()=>{const a=l=>{l.key==="Escape"&&n(l)};return t.addEventListener("keydown",a,{capture:!0}),()=>t.removeEventListener("keydown",a,{capture:!0})},[n,t])}var Iz="DismissableLayer",Pp="dismissableLayer.update",Uz="dismissableLayer.pointerDownOutside",Pz="dismissableLayer.focusOutside",G0,ak=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ik=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:o,onInteractOutside:u,onDismiss:f,...m}=e,h=x.useContext(ak),[g,y]=x.useState(null),b=(g==null?void 0:g.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,S]=x.useState({}),k=gl(t,D=>y(D)),j=Array.from(h.layers),[E]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),C=j.indexOf(E),T=g?j.indexOf(g):-1,O=h.layersWithOutsidePointerEventsDisabled.size>0,B=T>=C,M=Fz(D=>{const Z=D.target,te=[...h.branches].some(q=>q.contains(Z));!B||te||(l==null||l(D),u==null||u(D),D.defaultPrevented||f==null||f())},b),R=qz(D=>{const Z=D.target;[...h.branches].some(q=>q.contains(Z))||(o==null||o(D),u==null||u(D),D.defaultPrevented||f==null||f())},b);return Lz(D=>{T===h.layers.size-1&&(a==null||a(D),!D.defaultPrevented&&f&&(D.preventDefault(),f()))},b),x.useEffect(()=>{if(g)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(G0=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(g)),h.layers.add(g),K0(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=G0)}},[g,b,n,h]),x.useEffect(()=>()=>{g&&(h.layers.delete(g),h.layersWithOutsidePointerEventsDisabled.delete(g),K0())},[g,h]),x.useEffect(()=>{const D=()=>S({});return document.addEventListener(Pp,D),()=>document.removeEventListener(Pp,D)},[]),d.jsx(ka.div,{...m,ref:k,style:{pointerEvents:O?B?"auto":"none":void 0,...e.style},onFocusCapture:yi(e.onFocusCapture,R.onFocusCapture),onBlurCapture:yi(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:yi(e.onPointerDownCapture,M.onPointerDownCapture)})});ik.displayName=Iz;var Bz="DismissableLayerBranch",$z=x.forwardRef((e,t)=>{const n=x.useContext(ak),a=x.useRef(null),l=gl(t,a);return x.useEffect(()=>{const o=a.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),d.jsx(ka.div,{...e,ref:l})});$z.displayName=Bz;function Fz(e,t=globalThis==null?void 0:globalThis.document){const n=fu(e),a=x.useRef(!1),l=x.useRef(()=>{});return x.useEffect(()=>{const o=f=>{if(f.target&&!a.current){let m=function(){lk(Uz,n,h,{discrete:!0})};const h={originalEvent:f};f.pointerType==="touch"?(t.removeEventListener("click",l.current),l.current=m,t.addEventListener("click",l.current,{once:!0})):m()}else t.removeEventListener("click",l.current);a.current=!1},u=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(u),t.removeEventListener("pointerdown",o),t.removeEventListener("click",l.current)}},[t,n]),{onPointerDownCapture:()=>a.current=!0}}function qz(e,t=globalThis==null?void 0:globalThis.document){const n=fu(e),a=x.useRef(!1);return x.useEffect(()=>{const l=o=>{o.target&&!a.current&&lk(Pz,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",l),()=>t.removeEventListener("focusin",l)},[t,n]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}function K0(){const e=new CustomEvent(Pp);document.dispatchEvent(e)}function lk(e,t,n,{discrete:a}){const l=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&l.addEventListener(e,t,{once:!0}),a?Dz(l,o):l.dispatchEvent(o)}var Um="focusScope.autoFocusOnMount",Pm="focusScope.autoFocusOnUnmount",Y0={bubbles:!1,cancelable:!0},Hz="FocusScope",sk=x.forwardRef((e,t)=>{const{loop:n=!1,trapped:a=!1,onMountAutoFocus:l,onUnmountAutoFocus:o,...u}=e,[f,m]=x.useState(null),h=fu(l),g=fu(o),y=x.useRef(null),b=gl(t,j=>m(j)),S=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(a){let j=function(O){if(S.paused||!f)return;const B=O.target;f.contains(B)?y.current=B:ai(y.current,{select:!0})},E=function(O){if(S.paused||!f)return;const B=O.relatedTarget;B!==null&&(f.contains(B)||ai(y.current,{select:!0}))},C=function(O){if(document.activeElement===document.body)for(const M of O)M.removedNodes.length>0&&ai(f)};document.addEventListener("focusin",j),document.addEventListener("focusout",E);const T=new MutationObserver(C);return f&&T.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",j),document.removeEventListener("focusout",E),T.disconnect()}}},[a,f,S.paused]),x.useEffect(()=>{if(f){J0.add(S);const j=document.activeElement;if(!f.contains(j)){const C=new CustomEvent(Um,Y0);f.addEventListener(Um,h),f.dispatchEvent(C),C.defaultPrevented||(Zz(Yz(ok(f)),{select:!0}),document.activeElement===j&&ai(f))}return()=>{f.removeEventListener(Um,h),setTimeout(()=>{const C=new CustomEvent(Pm,Y0);f.addEventListener(Pm,g),f.dispatchEvent(C),C.defaultPrevented||ai(j??document.body,{select:!0}),f.removeEventListener(Pm,g),J0.remove(S)},0)}}},[f,h,g,S]);const k=x.useCallback(j=>{if(!n&&!a||S.paused)return;const E=j.key==="Tab"&&!j.altKey&&!j.ctrlKey&&!j.metaKey,C=document.activeElement;if(E&&C){const T=j.currentTarget,[O,B]=Vz(T);O&&B?!j.shiftKey&&C===B?(j.preventDefault(),n&&ai(O,{select:!0})):j.shiftKey&&C===O&&(j.preventDefault(),n&&ai(B,{select:!0})):C===T&&j.preventDefault()}},[n,a,S.paused]);return d.jsx(ka.div,{tabIndex:-1,...u,ref:b,onKeyDown:k})});sk.displayName=Hz;function Zz(e,{select:t=!1}={}){const n=document.activeElement;for(const a of e)if(ai(a,{select:t}),document.activeElement!==n)return}function Vz(e){const t=ok(e),n=X0(t,e),a=X0(t.reverse(),e);return[n,a]}function ok(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const l=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||l?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function X0(e,t){for(const n of e)if(!Qz(n,{upTo:t}))return n}function Qz(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Gz(e){return e instanceof HTMLInputElement&&"select"in e}function ai(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Gz(e)&&t&&e.select()}}var J0=Kz();function Kz(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=W0(e,t),e.unshift(t)},remove(t){var n;e=W0(e,t),(n=e[0])==null||n.resume()}}}function W0(e,t){const n=[...e],a=n.indexOf(t);return a!==-1&&n.splice(a,1),n}function Yz(e){return e.filter(t=>t.tagName!=="A")}var Xz="Portal",uk=x.forwardRef((e,t)=>{var f;const{container:n,...a}=e,[l,o]=x.useState(!1);du(()=>o(!0),[]);const u=n||l&&((f=globalThis==null?void 0:globalThis.document)==null?void 0:f.body);return u?_z.createPortal(d.jsx(ka.div,{...a,ref:t}),u):null});uk.displayName=Xz;function Jz(e,t){return x.useReducer((n,a)=>t[n][a]??n,e)}var Gd=e=>{const{present:t,children:n}=e,a=Wz(t),l=typeof n=="function"?n({present:a.isPresent}):x.Children.only(n),o=gl(a.ref,eO(l));return typeof n=="function"||a.isPresent?x.cloneElement(l,{ref:o}):null};Gd.displayName="Presence";function Wz(e){const[t,n]=x.useState(),a=x.useRef(null),l=x.useRef(e),o=x.useRef("none"),u=e?"mounted":"unmounted",[f,m]=Jz(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const h=ed(a.current);o.current=f==="mounted"?h:"none"},[f]),du(()=>{const h=a.current,g=l.current;if(g!==e){const b=o.current,S=ed(h);e?m("MOUNT"):S==="none"||(h==null?void 0:h.display)==="none"?m("UNMOUNT"):m(g&&b!==S?"ANIMATION_OUT":"UNMOUNT"),l.current=e}},[e,m]),du(()=>{if(t){let h;const g=t.ownerDocument.defaultView??window,y=S=>{const j=ed(a.current).includes(CSS.escape(S.animationName));if(S.target===t&&j&&(m("ANIMATION_END"),!l.current)){const E=t.style.animationFillMode;t.style.animationFillMode="forwards",h=g.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=E)})}},b=S=>{S.target===t&&(o.current=ed(a.current))};return t.addEventListener("animationstart",b),t.addEventListener("animationcancel",y),t.addEventListener("animationend",y),()=>{g.clearTimeout(h),t.removeEventListener("animationstart",b),t.removeEventListener("animationcancel",y),t.removeEventListener("animationend",y)}}else m("ANIMATION_END")},[t,m]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:x.useCallback(h=>{a.current=h?getComputedStyle(h):null,n(h)},[])}}function ed(e){return(e==null?void 0:e.animationName)||"none"}function eO(e){var a,l;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Bm=0;function tO(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??e1()),document.body.insertAdjacentElement("beforeend",e[1]??e1()),Bm++,()=>{Bm===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Bm--}},[])}function e1(){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 $r=function(){return $r=Object.assign||function(t){for(var n,a=1,l=arguments.length;a<l;a++){n=arguments[a];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},$r.apply(this,arguments)};function ck(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,a=Object.getOwnPropertySymbols(e);l<a.length;l++)t.indexOf(a[l])<0&&Object.prototype.propertyIsEnumerable.call(e,a[l])&&(n[a[l]]=e[a[l]]);return n}function nO(e,t,n){if(n||arguments.length===2)for(var a=0,l=t.length,o;a<l;a++)(o||!(a in t))&&(o||(o=Array.prototype.slice.call(t,0,a)),o[a]=t[a]);return e.concat(o||Array.prototype.slice.call(t))}var vd="right-scroll-bar-position",bd="width-before-scroll-bar",rO="with-scroll-bars-hidden",aO="--removed-body-scroll-bar-size";function $m(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function iO(e,t){var n=x.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(a){var l=n.value;l!==a&&(n.value=a,n.callback(a,l))}}}})[0];return n.callback=t,n.facade}var lO=typeof window<"u"?x.useLayoutEffect:x.useEffect,t1=new WeakMap;function sO(e,t){var n=iO(null,function(a){return e.forEach(function(l){return $m(l,a)})});return lO(function(){var a=t1.get(n);if(a){var l=new Set(a),o=new Set(e),u=n.current;l.forEach(function(f){o.has(f)||$m(f,null)}),o.forEach(function(f){l.has(f)||$m(f,u)})}t1.set(n,e)},[e]),n}function oO(e){return e}function uO(e,t){t===void 0&&(t=oO);var n=[],a=!1,l={read:function(){if(a)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var u=t(o,a);return n.push(u),function(){n=n.filter(function(f){return f!==u})}},assignSyncMedium:function(o){for(a=!0;n.length;){var u=n;n=[],u.forEach(o)}n={push:function(f){return o(f)},filter:function(){return n}}},assignMedium:function(o){a=!0;var u=[];if(n.length){var f=n;n=[],f.forEach(o),u=n}var m=function(){var g=u;u=[],g.forEach(o)},h=function(){return Promise.resolve().then(m)};h(),n={push:function(g){u.push(g),h()},filter:function(g){return u=u.filter(g),n}}}};return l}function cO(e){e===void 0&&(e={});var t=uO(null);return t.options=$r({async:!0,ssr:!1},e),t}var dk=function(e){var t=e.sideCar,n=ck(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var a=t.read();if(!a)throw new Error("Sidecar medium not found");return x.createElement(a,$r({},n))};dk.isSideCarExport=!0;function dO(e,t){return e.useMedium(t),dk}var fk=cO(),Fm=function(){},Kd=x.forwardRef(function(e,t){var n=x.useRef(null),a=x.useState({onScrollCapture:Fm,onWheelCapture:Fm,onTouchMoveCapture:Fm}),l=a[0],o=a[1],u=e.forwardProps,f=e.children,m=e.className,h=e.removeScrollBar,g=e.enabled,y=e.shards,b=e.sideCar,S=e.noRelative,k=e.noIsolation,j=e.inert,E=e.allowPinchZoom,C=e.as,T=C===void 0?"div":C,O=e.gapMode,B=ck(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),M=b,R=sO([n,t]),D=$r($r({},B),l);return x.createElement(x.Fragment,null,g&&x.createElement(M,{sideCar:fk,removeScrollBar:h,shards:y,noRelative:S,noIsolation:k,inert:j,setCallbacks:o,allowPinchZoom:!!E,lockRef:n,gapMode:O}),u?x.cloneElement(x.Children.only(f),$r($r({},D),{ref:R})):x.createElement(T,$r({},D,{className:m,ref:R}),f))});Kd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Kd.classNames={fullWidth:bd,zeroRight:vd};var fO=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function hO(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=fO();return t&&e.setAttribute("nonce",t),e}function mO(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function pO(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var gO=function(){var e=0,t=null;return{add:function(n){e==0&&(t=hO())&&(mO(t,n),pO(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},yO=function(){var e=gO();return function(t,n){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},hk=function(){var e=yO(),t=function(n){var a=n.styles,l=n.dynamic;return e(a,l),null};return t},vO={left:0,top:0,right:0,gap:0},qm=function(e){return parseInt(e||"",10)||0},bO=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],a=t[e==="padding"?"paddingTop":"marginTop"],l=t[e==="padding"?"paddingRight":"marginRight"];return[qm(n),qm(a),qm(l)]},xO=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return vO;var t=bO(e),n=document.documentElement.clientWidth,a=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,a-n+t[2]-t[0])}},SO=hk(),vs="data-scroll-locked",wO=function(e,t,n,a){var l=e.left,o=e.top,u=e.right,f=e.gap;return n===void 0&&(n="margin"),`
251
+ .`.concat(rO,` {
252
+ overflow: hidden `).concat(a,`;
253
+ padding-right: `).concat(f,"px ").concat(a,`;
254
+ }
255
+ body[`).concat(vs,`] {
256
+ overflow: hidden `).concat(a,`;
257
+ overscroll-behavior: contain;
258
+ `).concat([t&&"position: relative ".concat(a,";"),n==="margin"&&`
259
+ padding-left: `.concat(l,`px;
260
+ padding-top: `).concat(o,`px;
261
+ padding-right: `).concat(u,`px;
262
+ margin-left:0;
263
+ margin-top:0;
264
+ margin-right: `).concat(f,"px ").concat(a,`;
265
+ `),n==="padding"&&"padding-right: ".concat(f,"px ").concat(a,";")].filter(Boolean).join(""),`
266
+ }
267
+
268
+ .`).concat(vd,` {
269
+ right: `).concat(f,"px ").concat(a,`;
270
+ }
271
+
272
+ .`).concat(bd,` {
273
+ margin-right: `).concat(f,"px ").concat(a,`;
274
+ }
275
+
276
+ .`).concat(vd," .").concat(vd,` {
277
+ right: 0 `).concat(a,`;
278
+ }
279
+
280
+ .`).concat(bd," .").concat(bd,` {
281
+ margin-right: 0 `).concat(a,`;
282
+ }
283
+
284
+ body[`).concat(vs,`] {
285
+ `).concat(aO,": ").concat(f,`px;
286
+ }
287
+ `)},n1=function(){var e=parseInt(document.body.getAttribute(vs)||"0",10);return isFinite(e)?e:0},kO=function(){x.useEffect(function(){return document.body.setAttribute(vs,(n1()+1).toString()),function(){var e=n1()-1;e<=0?document.body.removeAttribute(vs):document.body.setAttribute(vs,e.toString())}},[])},jO=function(e){var t=e.noRelative,n=e.noImportant,a=e.gapMode,l=a===void 0?"margin":a;kO();var o=x.useMemo(function(){return xO(l)},[l]);return x.createElement(SO,{styles:wO(o,!t,l,n?"":"!important")})},Bp=!1;if(typeof window<"u")try{var td=Object.defineProperty({},"passive",{get:function(){return Bp=!0,!0}});window.addEventListener("test",td,td),window.removeEventListener("test",td,td)}catch{Bp=!1}var is=Bp?{passive:!1}:!1,CO=function(e){return e.tagName==="TEXTAREA"},mk=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!CO(e)&&n[t]==="visible")},EO=function(e){return mk(e,"overflowY")},NO=function(e){return mk(e,"overflowX")},r1=function(e,t){var n=t.ownerDocument,a=t;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var l=pk(e,a);if(l){var o=gk(e,a),u=o[1],f=o[2];if(u>f)return!0}a=a.parentNode}while(a&&a!==n.body);return!1},_O=function(e){var t=e.scrollTop,n=e.scrollHeight,a=e.clientHeight;return[t,n,a]},AO=function(e){var t=e.scrollLeft,n=e.scrollWidth,a=e.clientWidth;return[t,n,a]},pk=function(e,t){return e==="v"?EO(t):NO(t)},gk=function(e,t){return e==="v"?_O(t):AO(t)},TO=function(e,t){return e==="h"&&t==="rtl"?-1:1},RO=function(e,t,n,a,l){var o=TO(e,window.getComputedStyle(t).direction),u=o*a,f=n.target,m=t.contains(f),h=!1,g=u>0,y=0,b=0;do{if(!f)break;var S=gk(e,f),k=S[0],j=S[1],E=S[2],C=j-E-o*k;(k||C)&&pk(e,f)&&(y+=C,b+=k);var T=f.parentNode;f=T&&T.nodeType===Node.DOCUMENT_FRAGMENT_NODE?T.host:T}while(!m&&f!==document.body||m&&(t.contains(f)||t===f));return(g&&Math.abs(y)<1||!g&&Math.abs(b)<1)&&(h=!0),h},nd=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},a1=function(e){return[e.deltaX,e.deltaY]},i1=function(e){return e&&"current"in e?e.current:e},zO=function(e,t){return e[0]===t[0]&&e[1]===t[1]},OO=function(e){return`
288
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
289
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
290
+ `)},MO=0,ls=[];function DO(e){var t=x.useRef([]),n=x.useRef([0,0]),a=x.useRef(),l=x.useState(MO++)[0],o=x.useState(hk)[0],u=x.useRef(e);x.useEffect(function(){u.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(l));var j=nO([e.lockRef.current],(e.shards||[]).map(i1),!0).filter(Boolean);return j.forEach(function(E){return E.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),j.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(l))})}}},[e.inert,e.lockRef.current,e.shards]);var f=x.useCallback(function(j,E){if("touches"in j&&j.touches.length===2||j.type==="wheel"&&j.ctrlKey)return!u.current.allowPinchZoom;var C=nd(j),T=n.current,O="deltaX"in j?j.deltaX:T[0]-C[0],B="deltaY"in j?j.deltaY:T[1]-C[1],M,R=j.target,D=Math.abs(O)>Math.abs(B)?"h":"v";if("touches"in j&&D==="h"&&R.type==="range")return!1;var Z=window.getSelection(),te=Z&&Z.anchorNode,q=te?te===R||te.contains(R):!1;if(q)return!1;var oe=r1(D,R);if(!oe)return!0;if(oe?M=D:(M=D==="v"?"h":"v",oe=r1(D,R)),!oe)return!1;if(!a.current&&"changedTouches"in j&&(O||B)&&(a.current=M),!M)return!0;var W=a.current||M;return RO(W,E,j,W==="h"?O:B)},[]),m=x.useCallback(function(j){var E=j;if(!(!ls.length||ls[ls.length-1]!==o)){var C="deltaY"in E?a1(E):nd(E),T=t.current.filter(function(M){return M.name===E.type&&(M.target===E.target||E.target===M.shadowParent)&&zO(M.delta,C)})[0];if(T&&T.should){E.cancelable&&E.preventDefault();return}if(!T){var O=(u.current.shards||[]).map(i1).filter(Boolean).filter(function(M){return M.contains(E.target)}),B=O.length>0?f(E,O[0]):!u.current.noIsolation;B&&E.cancelable&&E.preventDefault()}}},[]),h=x.useCallback(function(j,E,C,T){var O={name:j,delta:E,target:C,should:T,shadowParent:LO(C)};t.current.push(O),setTimeout(function(){t.current=t.current.filter(function(B){return B!==O})},1)},[]),g=x.useCallback(function(j){n.current=nd(j),a.current=void 0},[]),y=x.useCallback(function(j){h(j.type,a1(j),j.target,f(j,e.lockRef.current))},[]),b=x.useCallback(function(j){h(j.type,nd(j),j.target,f(j,e.lockRef.current))},[]);x.useEffect(function(){return ls.push(o),e.setCallbacks({onScrollCapture:y,onWheelCapture:y,onTouchMoveCapture:b}),document.addEventListener("wheel",m,is),document.addEventListener("touchmove",m,is),document.addEventListener("touchstart",g,is),function(){ls=ls.filter(function(j){return j!==o}),document.removeEventListener("wheel",m,is),document.removeEventListener("touchmove",m,is),document.removeEventListener("touchstart",g,is)}},[]);var S=e.removeScrollBar,k=e.inert;return x.createElement(x.Fragment,null,k?x.createElement(o,{styles:OO(l)}):null,S?x.createElement(jO,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function LO(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const IO=dO(fk,DO);var yk=x.forwardRef(function(e,t){return x.createElement(Kd,$r({},e,{ref:t,sideCar:IO}))});yk.classNames=Kd.classNames;var UO=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ss=new WeakMap,rd=new WeakMap,ad={},Hm=0,vk=function(e){return e&&(e.host||vk(e.parentNode))},PO=function(e,t){return t.map(function(n){if(e.contains(n))return n;var a=vk(n);return a&&e.contains(a)?a:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},BO=function(e,t,n,a){var l=PO(t,Array.isArray(e)?e:[e]);ad[n]||(ad[n]=new WeakMap);var o=ad[n],u=[],f=new Set,m=new Set(l),h=function(y){!y||f.has(y)||(f.add(y),h(y.parentNode))};l.forEach(h);var g=function(y){!y||m.has(y)||Array.prototype.forEach.call(y.children,function(b){if(f.has(b))g(b);else try{var S=b.getAttribute(a),k=S!==null&&S!=="false",j=(ss.get(b)||0)+1,E=(o.get(b)||0)+1;ss.set(b,j),o.set(b,E),u.push(b),j===1&&k&&rd.set(b,!0),E===1&&b.setAttribute(n,"true"),k||b.setAttribute(a,"true")}catch(C){console.error("aria-hidden: cannot operate on ",b,C)}})};return g(t),f.clear(),Hm++,function(){u.forEach(function(y){var b=ss.get(y)-1,S=o.get(y)-1;ss.set(y,b),o.set(y,S),b||(rd.has(y)||y.removeAttribute(a),rd.delete(y)),S||y.removeAttribute(n)}),Hm--,Hm||(ss=new WeakMap,ss=new WeakMap,rd=new WeakMap,ad={})}},$O=function(e,t,n){n===void 0&&(n="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),l=UO(e);return l?(a.push.apply(a,Array.from(l.querySelectorAll("[aria-live], script"))),BO(a,l,n,"aria-hidden")):function(){return null}},Yd="Dialog",[bk]=xz(Yd),[FO,Ar]=bk(Yd),xk=e=>{const{__scopeDialog:t,children:n,open:a,defaultOpen:l,onOpenChange:o,modal:u=!0}=e,f=x.useRef(null),m=x.useRef(null),[h,g]=Cz({prop:a,defaultProp:l??!1,onChange:o,caller:Yd});return d.jsx(FO,{scope:t,triggerRef:f,contentRef:m,contentId:ba(),titleId:ba(),descriptionId:ba(),open:h,onOpenChange:g,onOpenToggle:x.useCallback(()=>g(y=>!y),[g]),modal:u,children:n})};xk.displayName=Yd;var Sk="DialogTrigger",wk=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Ar(Sk,n),o=gl(t,l.triggerRef);return d.jsx(ka.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":Rg(l.open),...a,ref:o,onClick:yi(e.onClick,l.onOpenToggle)})});wk.displayName=Sk;var Ag="DialogPortal",[qO,kk]=bk(Ag,{forceMount:void 0}),jk=e=>{const{__scopeDialog:t,forceMount:n,children:a,container:l}=e,o=Ar(Ag,t);return d.jsx(qO,{scope:t,forceMount:n,children:x.Children.map(a,u=>d.jsx(Gd,{present:n||o.open,children:d.jsx(uk,{asChild:!0,container:l,children:u})}))})};jk.displayName=Ag;var Ad="DialogOverlay",Ck=x.forwardRef((e,t)=>{const n=kk(Ad,e.__scopeDialog),{forceMount:a=n.forceMount,...l}=e,o=Ar(Ad,e.__scopeDialog);return o.modal?d.jsx(Gd,{present:a||o.open,children:d.jsx(ZO,{...l,ref:t})}):null});Ck.displayName=Ad;var HO=rk("DialogOverlay.RemoveScroll"),ZO=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Ar(Ad,n);return d.jsx(yk,{as:HO,allowPinchZoom:!0,shards:[l.contentRef],children:d.jsx(ka.div,{"data-state":Rg(l.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),ul="DialogContent",Ek=x.forwardRef((e,t)=>{const n=kk(ul,e.__scopeDialog),{forceMount:a=n.forceMount,...l}=e,o=Ar(ul,e.__scopeDialog);return d.jsx(Gd,{present:a||o.open,children:o.modal?d.jsx(VO,{...l,ref:t}):d.jsx(QO,{...l,ref:t})})});Ek.displayName=ul;var VO=x.forwardRef((e,t)=>{const n=Ar(ul,e.__scopeDialog),a=x.useRef(null),l=gl(t,n.contentRef,a);return x.useEffect(()=>{const o=a.current;if(o)return $O(o)},[]),d.jsx(Nk,{...e,ref:l,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:yi(e.onCloseAutoFocus,o=>{var u;o.preventDefault(),(u=n.triggerRef.current)==null||u.focus()}),onPointerDownOutside:yi(e.onPointerDownOutside,o=>{const u=o.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0;(u.button===2||f)&&o.preventDefault()}),onFocusOutside:yi(e.onFocusOutside,o=>o.preventDefault())})}),QO=x.forwardRef((e,t)=>{const n=Ar(ul,e.__scopeDialog),a=x.useRef(!1),l=x.useRef(!1);return d.jsx(Nk,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var u,f;(u=e.onCloseAutoFocus)==null||u.call(e,o),o.defaultPrevented||(a.current||(f=n.triggerRef.current)==null||f.focus(),o.preventDefault()),a.current=!1,l.current=!1},onInteractOutside:o=>{var m,h;(m=e.onInteractOutside)==null||m.call(e,o),o.defaultPrevented||(a.current=!0,o.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const u=o.target;((h=n.triggerRef.current)==null?void 0:h.contains(u))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&l.current&&o.preventDefault()}})}),Nk=x.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:a,onOpenAutoFocus:l,onCloseAutoFocus:o,...u}=e,f=Ar(ul,n),m=x.useRef(null),h=gl(t,m);return tO(),d.jsxs(d.Fragment,{children:[d.jsx(sk,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:l,onUnmountAutoFocus:o,children:d.jsx(ik,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":Rg(f.open),...u,ref:h,onDismiss:()=>f.onOpenChange(!1)})}),d.jsxs(d.Fragment,{children:[d.jsx(GO,{titleId:f.titleId}),d.jsx(YO,{contentRef:m,descriptionId:f.descriptionId})]})]})}),Tg="DialogTitle",_k=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Ar(Tg,n);return d.jsx(ka.h2,{id:l.titleId,...a,ref:t})});_k.displayName=Tg;var Ak="DialogDescription",Tk=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Ar(Ak,n);return d.jsx(ka.p,{id:l.descriptionId,...a,ref:t})});Tk.displayName=Ak;var Rk="DialogClose",zk=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Ar(Rk,n);return d.jsx(ka.button,{type:"button",...a,ref:t,onClick:yi(e.onClick,()=>l.onOpenChange(!1))})});zk.displayName=Rk;function Rg(e){return e?"open":"closed"}var Ok="DialogTitleWarning",[zq,Mk]=bz(Ok,{contentName:ul,titleName:Tg,docsSlug:"dialog"}),GO=({titleId:e})=>{const t=Mk(Ok),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
291
+
292
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
293
+
294
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return x.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},KO="DialogDescriptionWarning",YO=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Mk(KO).contentName}}.`;return x.useEffect(()=>{var o;const l=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&l&&(document.getElementById(t)||console.warn(a))},[a,e,t]),null},Dk=xk,XO=wk,Lk=jk,Ik=Ck,Uk=Ek,JO=_k,WO=Tk,eM=zk,tM=Symbol.for("react.lazy"),Td=cg[" use ".trim().toString()];function nM(e){return typeof e=="object"&&e!==null&&"then"in e}function Pk(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===tM&&"_payload"in e&&nM(e._payload)}function Bk(e){const t=aM(e),n=x.forwardRef((a,l)=>{let{children:o,...u}=a;Pk(o)&&typeof Td=="function"&&(o=Td(o._payload));const f=x.Children.toArray(o),m=f.find(lM);if(m){const h=m.props.children,g=f.map(y=>y===m?x.Children.count(h)>1?x.Children.only(null):x.isValidElement(h)?h.props.children:null:y);return d.jsx(t,{...u,ref:l,children:x.isValidElement(h)?x.cloneElement(h,void 0,g):null})}return d.jsx(t,{...u,ref:l,children:o})});return n.displayName=`${e}.Slot`,n}var rM=Bk("Slot");function aM(e){const t=x.forwardRef((n,a)=>{let{children:l,...o}=n;if(Pk(l)&&typeof Td=="function"&&(l=Td(l._payload)),x.isValidElement(l)){const u=oM(l),f=sM(o,l.props);return l.type!==x.Fragment&&(f.ref=a?xi(a,u):u),x.cloneElement(l,f)}return x.Children.count(l)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var iM=Symbol("radix.slottable");function lM(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===iM}function sM(e,t){const n={...t};for(const a in t){const l=e[a],o=t[a];/^on[A-Z]/.test(a)?l&&o?n[a]=(...f)=>{const m=o(...f);return l(...f),m}:l&&(n[a]=l):a==="style"?n[a]={...l,...o}:a==="className"&&(n[a]=[l,o].filter(Boolean).join(" "))}return{...e,...n}}function oM(e){var a,l;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var uM=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ja=uM.reduce((e,t)=>{const n=Bk(`Primitive.${t}`),a=x.forwardRef((l,o)=>{const{asChild:u,...f}=l,m=u?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(m,{...f,ref:o})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{}),Vo='[cmdk-group=""]',Zm='[cmdk-group-items=""]',cM='[cmdk-group-heading=""]',$k='[cmdk-item=""]',l1=`${$k}:not([aria-disabled="true"])`,$p="cmdk-item-select",ds="data-value",dM=(e,t,n)=>vz(e,t,n),Fk=x.createContext(void 0),_u=()=>x.useContext(Fk),qk=x.createContext(void 0),zg=()=>x.useContext(qk),Hk=x.createContext(void 0),Zk=x.forwardRef((e,t)=>{let n=fs(()=>{var U,_;return{search:"",value:(_=(U=e.value)!=null?U:e.defaultValue)!=null?_:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),a=fs(()=>new Set),l=fs(()=>new Map),o=fs(()=>new Map),u=fs(()=>new Set),f=Vk(e),{label:m,children:h,value:g,onValueChange:y,filter:b,shouldFilter:S,loop:k,disablePointerSelection:j=!1,vimBindings:E=!0,...C}=e,T=ba(),O=ba(),B=ba(),M=x.useRef(null),R=wM();cl(()=>{if(g!==void 0){let U=g.trim();n.current.value=U,D.emit()}},[g]),cl(()=>{R(6,me)},[]);let D=x.useMemo(()=>({subscribe:U=>(u.current.add(U),()=>u.current.delete(U)),snapshot:()=>n.current,setState:(U,_,$)=>{var X,ue,Se,De;if(!Object.is(n.current[U],_)){if(n.current[U]=_,U==="search")W(),q(),R(1,oe);else if(U==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ge=document.getElementById(B);ge?ge.focus():(X=document.getElementById(T))==null||X.focus()}if(R(7,()=>{var ge;n.current.selectedItemId=(ge=de())==null?void 0:ge.id,D.emit()}),$||R(5,me),((ue=f.current)==null?void 0:ue.value)!==void 0){let ge=_??"";(De=(Se=f.current).onValueChange)==null||De.call(Se,ge);return}}D.emit()}},emit:()=>{u.current.forEach(U=>U())}}),[]),Z=x.useMemo(()=>({value:(U,_,$)=>{var X;_!==((X=o.current.get(U))==null?void 0:X.value)&&(o.current.set(U,{value:_,keywords:$}),n.current.filtered.items.set(U,te(_,$)),R(2,()=>{q(),D.emit()}))},item:(U,_)=>(a.current.add(U),_&&(l.current.has(_)?l.current.get(_).add(U):l.current.set(_,new Set([U]))),R(3,()=>{W(),q(),n.current.value||oe(),D.emit()}),()=>{o.current.delete(U),a.current.delete(U),n.current.filtered.items.delete(U);let $=de();R(4,()=>{W(),($==null?void 0:$.getAttribute("id"))===U&&oe(),D.emit()})}),group:U=>(l.current.has(U)||l.current.set(U,new Set),()=>{o.current.delete(U),l.current.delete(U)}),filter:()=>f.current.shouldFilter,label:m||e["aria-label"],getDisablePointerSelection:()=>f.current.disablePointerSelection,listId:T,inputId:B,labelId:O,listInnerRef:M}),[]);function te(U,_){var $,X;let ue=(X=($=f.current)==null?void 0:$.filter)!=null?X:dM;return U?ue(U,n.current.search,_):0}function q(){if(!n.current.search||f.current.shouldFilter===!1)return;let U=n.current.filtered.items,_=[];n.current.filtered.groups.forEach(X=>{let ue=l.current.get(X),Se=0;ue.forEach(De=>{let ge=U.get(De);Se=Math.max(ge,Se)}),_.push([X,Se])});let $=M.current;ee().sort((X,ue)=>{var Se,De;let ge=X.getAttribute("id"),ut=ue.getAttribute("id");return((Se=U.get(ut))!=null?Se:0)-((De=U.get(ge))!=null?De:0)}).forEach(X=>{let ue=X.closest(Zm);ue?ue.appendChild(X.parentElement===ue?X:X.closest(`${Zm} > *`)):$.appendChild(X.parentElement===$?X:X.closest(`${Zm} > *`))}),_.sort((X,ue)=>ue[1]-X[1]).forEach(X=>{var ue;let Se=(ue=M.current)==null?void 0:ue.querySelector(`${Vo}[${ds}="${encodeURIComponent(X[0])}"]`);Se==null||Se.parentElement.appendChild(Se)})}function oe(){let U=ee().find($=>$.getAttribute("aria-disabled")!=="true"),_=U==null?void 0:U.getAttribute(ds);D.setState("value",_||void 0)}function W(){var U,_,$,X;if(!n.current.search||f.current.shouldFilter===!1){n.current.filtered.count=a.current.size;return}n.current.filtered.groups=new Set;let ue=0;for(let Se of a.current){let De=(_=(U=o.current.get(Se))==null?void 0:U.value)!=null?_:"",ge=(X=($=o.current.get(Se))==null?void 0:$.keywords)!=null?X:[],ut=te(De,ge);n.current.filtered.items.set(Se,ut),ut>0&&ue++}for(let[Se,De]of l.current)for(let ge of De)if(n.current.filtered.items.get(ge)>0){n.current.filtered.groups.add(Se);break}n.current.filtered.count=ue}function me(){var U,_,$;let X=de();X&&(((U=X.parentElement)==null?void 0:U.firstChild)===X&&(($=(_=X.closest(Vo))==null?void 0:_.querySelector(cM))==null||$.scrollIntoView({block:"nearest"})),X.scrollIntoView({block:"nearest"}))}function de(){var U;return(U=M.current)==null?void 0:U.querySelector(`${$k}[aria-selected="true"]`)}function ee(){var U;return Array.from(((U=M.current)==null?void 0:U.querySelectorAll(l1))||[])}function H(U){let _=ee()[U];_&&D.setState("value",_.getAttribute(ds))}function re(U){var _;let $=de(),X=ee(),ue=X.findIndex(De=>De===$),Se=X[ue+U];(_=f.current)!=null&&_.loop&&(Se=ue+U<0?X[X.length-1]:ue+U===X.length?X[0]:X[ue+U]),Se&&D.setState("value",Se.getAttribute(ds))}function K(U){let _=de(),$=_==null?void 0:_.closest(Vo),X;for(;$&&!X;)$=U>0?xM($,Vo):SM($,Vo),X=$==null?void 0:$.querySelector(l1);X?D.setState("value",X.getAttribute(ds)):re(U)}let he=()=>H(ee().length-1),A=U=>{U.preventDefault(),U.metaKey?he():U.altKey?K(1):re(1)},I=U=>{U.preventDefault(),U.metaKey?H(0):U.altKey?K(-1):re(-1)};return x.createElement(ja.div,{ref:t,tabIndex:-1,...C,"cmdk-root":"",onKeyDown:U=>{var _;(_=C.onKeyDown)==null||_.call(C,U);let $=U.nativeEvent.isComposing||U.keyCode===229;if(!(U.defaultPrevented||$))switch(U.key){case"n":case"j":{E&&U.ctrlKey&&A(U);break}case"ArrowDown":{A(U);break}case"p":case"k":{E&&U.ctrlKey&&I(U);break}case"ArrowUp":{I(U);break}case"Home":{U.preventDefault(),H(0);break}case"End":{U.preventDefault(),he();break}case"Enter":{U.preventDefault();let X=de();if(X){let ue=new Event($p);X.dispatchEvent(ue)}}}}},x.createElement("label",{"cmdk-label":"",htmlFor:Z.inputId,id:Z.labelId,style:jM},m),Xd(e,U=>x.createElement(qk.Provider,{value:D},x.createElement(Fk.Provider,{value:Z},U))))}),fM=x.forwardRef((e,t)=>{var n,a;let l=ba(),o=x.useRef(null),u=x.useContext(Hk),f=_u(),m=Vk(e),h=(a=(n=m.current)==null?void 0:n.forceMount)!=null?a:u==null?void 0:u.forceMount;cl(()=>{if(!h)return f.item(l,u==null?void 0:u.id)},[h]);let g=Qk(l,o,[e.value,e.children,o],e.keywords),y=zg(),b=Si(R=>R.value&&R.value===g.current),S=Si(R=>h||f.filter()===!1?!0:R.search?R.filtered.items.get(l)>0:!0);x.useEffect(()=>{let R=o.current;if(!(!R||e.disabled))return R.addEventListener($p,k),()=>R.removeEventListener($p,k)},[S,e.onSelect,e.disabled]);function k(){var R,D;j(),(D=(R=m.current).onSelect)==null||D.call(R,g.current)}function j(){y.setState("value",g.current,!0)}if(!S)return null;let{disabled:E,value:C,onSelect:T,forceMount:O,keywords:B,...M}=e;return x.createElement(ja.div,{ref:xi(o,t),...M,id:l,"cmdk-item":"",role:"option","aria-disabled":!!E,"aria-selected":!!b,"data-disabled":!!E,"data-selected":!!b,onPointerMove:E||f.getDisablePointerSelection()?void 0:j,onClick:E?void 0:k},e.children)}),hM=x.forwardRef((e,t)=>{let{heading:n,children:a,forceMount:l,...o}=e,u=ba(),f=x.useRef(null),m=x.useRef(null),h=ba(),g=_u(),y=Si(S=>l||g.filter()===!1?!0:S.search?S.filtered.groups.has(u):!0);cl(()=>g.group(u),[]),Qk(u,f,[e.value,e.heading,m]);let b=x.useMemo(()=>({id:u,forceMount:l}),[l]);return x.createElement(ja.div,{ref:xi(f,t),...o,"cmdk-group":"",role:"presentation",hidden:y?void 0:!0},n&&x.createElement("div",{ref:m,"cmdk-group-heading":"","aria-hidden":!0,id:h},n),Xd(e,S=>x.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?h:void 0},x.createElement(Hk.Provider,{value:b},S))))}),mM=x.forwardRef((e,t)=>{let{alwaysRender:n,...a}=e,l=x.useRef(null),o=Si(u=>!u.search);return!n&&!o?null:x.createElement(ja.div,{ref:xi(l,t),...a,"cmdk-separator":"",role:"separator"})}),pM=x.forwardRef((e,t)=>{let{onValueChange:n,...a}=e,l=e.value!=null,o=zg(),u=Si(h=>h.search),f=Si(h=>h.selectedItemId),m=_u();return x.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),x.createElement(ja.input,{ref:t,...a,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":m.listId,"aria-labelledby":m.labelId,"aria-activedescendant":f,id:m.inputId,type:"text",value:l?e.value:u,onChange:h=>{l||o.setState("search",h.target.value),n==null||n(h.target.value)}})}),gM=x.forwardRef((e,t)=>{let{children:n,label:a="Suggestions",...l}=e,o=x.useRef(null),u=x.useRef(null),f=Si(h=>h.selectedItemId),m=_u();return x.useEffect(()=>{if(u.current&&o.current){let h=u.current,g=o.current,y,b=new ResizeObserver(()=>{y=requestAnimationFrame(()=>{let S=h.offsetHeight;g.style.setProperty("--cmdk-list-height",S.toFixed(1)+"px")})});return b.observe(h),()=>{cancelAnimationFrame(y),b.unobserve(h)}}},[]),x.createElement(ja.div,{ref:xi(o,t),...l,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":f,"aria-label":a,id:m.listId},Xd(e,h=>x.createElement("div",{ref:xi(u,m.listInnerRef),"cmdk-list-sizer":""},h)))}),yM=x.forwardRef((e,t)=>{let{open:n,onOpenChange:a,overlayClassName:l,contentClassName:o,container:u,...f}=e;return x.createElement(Dk,{open:n,onOpenChange:a},x.createElement(Lk,{container:u},x.createElement(Ik,{"cmdk-overlay":"",className:l}),x.createElement(Uk,{"aria-label":e.label,"cmdk-dialog":"",className:o},x.createElement(Zk,{ref:t,...f}))))}),vM=x.forwardRef((e,t)=>Si(n=>n.filtered.count===0)?x.createElement(ja.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),bM=x.forwardRef((e,t)=>{let{progress:n,children:a,label:l="Loading...",...o}=e;return x.createElement(ja.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":l},Xd(e,u=>x.createElement("div",{"aria-hidden":!0},u)))}),qn=Object.assign(Zk,{List:gM,Item:fM,Input:pM,Group:hM,Separator:mM,Dialog:yM,Empty:vM,Loading:bM});function xM(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function SM(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Vk(e){let t=x.useRef(e);return cl(()=>{t.current=e}),t}var cl=typeof window>"u"?x.useEffect:x.useLayoutEffect;function fs(e){let t=x.useRef();return t.current===void 0&&(t.current=e()),t}function Si(e){let t=zg(),n=()=>e(t.snapshot());return x.useSyncExternalStore(t.subscribe,n,n)}function Qk(e,t,n,a=[]){let l=x.useRef(),o=_u();return cl(()=>{var u;let f=(()=>{var h;for(let g of n){if(typeof g=="string")return g.trim();if(typeof g=="object"&&"current"in g)return g.current?(h=g.current.textContent)==null?void 0:h.trim():l.current}})(),m=a.map(h=>h.trim());o.value(e,f,m),(u=t.current)==null||u.setAttribute(ds,f),l.current=f}),l}var wM=()=>{let[e,t]=x.useState(),n=fs(()=>new Map);return cl(()=>{n.current.forEach(a=>a()),n.current=new Map},[e]),(a,l)=>{n.current.set(a,l),t({})}};function kM(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Xd({asChild:e,children:t},n){return e&&x.isValidElement(t)?x.cloneElement(kM(t),{ref:t.ref},n(t.props.children)):n(t)}var jM={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const nn=Dk,CM=XO,EM=Lk,Gk=x.forwardRef(({className:e,...t},n)=>d.jsx(Ik,{ref:n,className:Ee("fixed inset-0 z-50 bg-overlay-scrim data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Gk.displayName="DialogOverlay";const Xt=x.forwardRef(({className:e,children:t,...n},a)=>d.jsxs(EM,{children:[d.jsx(Gk,{}),d.jsxs(Uk,{ref:a,className:Ee("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-lg",e),...n,children:[t,d.jsxs(eM,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[d.jsx(Nd,{className:"h-4 w-4"}),d.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Xt.displayName="DialogContent";function gn({className:e,...t}){return d.jsx("div",{className:Ee("flex flex-col space-y-1.5 text-center sm:text-left",e),...t})}function rn({className:e,...t}){return d.jsx("div",{className:Ee("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t})}const an=x.forwardRef(({className:e,...t},n)=>d.jsx(JO,{ref:n,className:Ee("text-subtitle leading-none tracking-tight",e),...t}));an.displayName="DialogTitle";const NM=x.forwardRef(({className:e,...t},n)=>d.jsx(WO,{ref:n,className:Ee("text-body text-muted-foreground",e),...t}));NM.displayName="DialogDescription";const Kk=x.forwardRef(({className:e,...t},n)=>d.jsx(qn,{ref:n,className:Ee("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));Kk.displayName=qn.displayName;function _M({open:e,onOpenChange:t,children:n}){return d.jsx(nn,{open:e,onOpenChange:t,children:d.jsx(Xt,{className:"overflow-hidden p-0 shadow-lg",children:d.jsx(Kk,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:n})})})}const Yk=x.forwardRef(({className:e,...t},n)=>d.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[d.jsx(Qd,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),d.jsx(qn.Input,{ref:n,className:Ee("flex h-11 w-full rounded-md bg-transparent py-3 text-body outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));Yk.displayName=qn.Input.displayName;const Xk=x.forwardRef(({className:e,...t},n)=>d.jsx(qn.List,{ref:n,className:Ee("max-h-[var(--sp-75)] overflow-y-auto overflow-x-hidden",e),...t}));Xk.displayName=qn.List.displayName;const Jk=x.forwardRef((e,t)=>d.jsx(qn.Empty,{ref:t,className:"py-6 text-center text-body",...e}));Jk.displayName=qn.Empty.displayName;const xd=x.forwardRef(({className:e,...t},n)=>d.jsx(qn.Group,{ref:n,className:Ee("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-caption [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));xd.displayName=qn.Group.displayName;const Fp=x.forwardRef(({className:e,...t},n)=>d.jsx(qn.Separator,{ref:n,className:Ee("-mx-1 h-px bg-border",e),...t}));Fp.displayName=qn.Separator.displayName;const Sd=x.forwardRef(({className:e,...t},n)=>d.jsx(qn.Item,{ref:n,className:Ee("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-body outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t}));Sd.displayName=qn.Item.displayName;function Au(e){const t=new URLSearchParams;e!=null&&e.limit&&t.set("limit",String(e.limit)),e!=null&&e.cursor&&t.set("cursor",e.cursor),e!=null&&e.type&&t.set("type",e.type);const n=t.toString();return Me.get(`/admin/agents${n?`?${n}`:""}`)}function AM(e){const t=new URLSearchParams;t.set("limit",String(e.limit)),e!=null&&e.cursor&&t.set("cursor",e.cursor);const n=t.toString();return Me.get(`/admin/agents/all${n?`?${n}`:""}`)}function Wk(e){return Me.get(`/admin/agents/${encodeURIComponent(e)}`)}function TM(e){return Me.post("/admin/agents",e)}function RM(e){return Me.get(`/admin/agents/names/${encodeURIComponent(e)}/availability`)}function s1(e,t){return Me.patch(`/admin/agents/${encodeURIComponent(e)}`,t)}function zM(e){return Me.delete(`/admin/agents/${encodeURIComponent(e)}`)}function OM(e){return Me.post(`/admin/agents/${encodeURIComponent(e)}/suspend`,{})}function MM(e){return Me.post(`/admin/agents/${encodeURIComponent(e)}/reactivate`,{})}function DM(e){return Me.post(`/admin/agents/${encodeURIComponent(e)}/test`,{})}function yl(){const{data:e}=Ve({queryKey:["agents","name-map"],queryFn:()=>Au({limit:100}),staleTime:3e4});return x.useMemo(()=>{const t=new Map;if(e!=null&&e.items)for(const n of e.items)t.set(n.uuid,n.displayName);return n=>n?t.get(n)??n:"—"},[e])}function Og(){const{data:e}=Ve({queryKey:["agents","name-map"],queryFn:()=>Au({limit:100}),staleTime:3e4});return x.useMemo(()=>{const t=new Map;if(e!=null&&e.items)for(const n of e.items)t.set(n.uuid,{name:n.name,displayName:n.displayName});return n=>n?t.get(n)??null:null},[e])}const LM=[{path:"/",label:"Workspace"},{path:"/agents",label:"Agents"},{path:"/clients",label:"Computers"},{path:"/settings",label:"Settings"},{path:"/admin",label:"Admin"}];function IM({open:e,onOpenChange:t}){const n=Zr(),a=yl(),{data:l}=Ve({queryKey:["activity"],queryFn:Nu,enabled:e,staleTime:3e4}),o=(l==null?void 0:l.agents)??[],f=Ve({queryKey:["palette-sessions",o.map(h=>h.agentId).join(",")],queryFn:async()=>{const h=[];for(const g of o)try{const y=await Hs(g.agentId);for(const b of y)h.push({agentId:g.agentId,session:b})}catch{}return h},enabled:e&&o.length>0,staleTime:3e4}).data??[],m=h=>{t(!1),n(h)};return d.jsxs(_M,{open:e,onOpenChange:t,children:[d.jsx(Yk,{placeholder:"Jump to agent, chat, or page…"}),d.jsxs(Xk,{children:[d.jsx(Jk,{children:"No results"}),o.length>0&&d.jsx(xd,{heading:"Agents",children:o.map(h=>{const g=a(h.agentId);return d.jsxs(Sd,{value:`agent ${g} ${h.agentId}`,onSelect:()=>m(`/?a=${h.agentId}`),children:[d.jsx(ST,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),d.jsx("span",{className:"flex-1 truncate",children:g}),d.jsx("span",{className:"text-caption text-muted-foreground font-mono ml-2",children:h.agentId.slice(0,8)})]},h.agentId)})}),f.length>0&&d.jsxs(d.Fragment,{children:[d.jsx(Fp,{}),d.jsx(xd,{heading:"Chats",children:f.map(({agentId:h,session:g})=>{const y=a(h);return d.jsxs(Sd,{value:`chat ${y} ${g.chatId}`,onSelect:()=>m(`/?a=${h}&c=${g.chatId}`),children:[d.jsx(Eg,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),d.jsx("span",{className:"flex-1 truncate",children:y}),d.jsx("span",{className:"text-caption text-muted-foreground font-mono ml-2",children:g.chatId.slice(0,8)})]},`${h}-${g.chatId}`)})})]}),d.jsx(Fp,{}),d.jsx(xd,{heading:"Pages",children:LM.map(h=>d.jsxs(Sd,{value:`page ${h.label}`,onSelect:()=>m(h.path),children:[d.jsx(OT,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),d.jsx("span",{children:h.label})]},h.path))})]})]})}function Tu(e){return d.jsxs("svg",{viewBox:"0 0 9 10",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",shapeRendering:"crispEdges","aria-hidden":"true",...e,children:[d.jsx("rect",{x:"4",y:"0",width:"1",height:"1"}),d.jsx("rect",{x:"3",y:"1",width:"3",height:"1"}),d.jsx("rect",{x:"2",y:"2",width:"5",height:"1"}),d.jsx("rect",{x:"3",y:"3",width:"3",height:"1"}),d.jsx("rect",{x:"2",y:"4",width:"5",height:"1"}),d.jsx("rect",{x:"1",y:"5",width:"7",height:"1"}),d.jsx("rect",{x:"2",y:"6",width:"5",height:"1"}),d.jsx("rect",{x:"1",y:"7",width:"7",height:"1"}),d.jsx("rect",{x:"0",y:"8",width:"9",height:"1"}),d.jsx("rect",{x:"3",y:"9",width:"3",height:"1"})]})}function qp(e){const t=new URLSearchParams;e!=null&&e.limit&&t.set("limit",String(e.limit)),e!=null&&e.cursor&&t.set("cursor",e.cursor),e!=null&&e.severity&&t.set("severity",e.severity),(e==null?void 0:e.read)!==void 0&&t.set("read",String(e.read)),e!=null&&e.agentId&&t.set("agentId",e.agentId);const n=t.toString();return Me.get(`/admin/notifications${n?`?${n}`:""}`)}function ej(e){return Me.post(`/admin/notifications/${e}/read`)}function UM(){return Me.post("/admin/notifications/read-all")}const PM={agent_error:"Error",session_error:"Error",agent_blocked:"Blocked",agent_stale:"Stale",agent_disconnected:"Disconnected",agent_connected:"Connected",agent_needs_decision:"Decision",session_completed:"Completed"};function BM(e){switch(e){case"high":return"var(--state-error)";case"medium":return"var(--state-blocked)";default:return"var(--accent-dim)"}}function tj({notification:e,onClick:t,clickable:n}){const a=(PM[e.type]??e.type).toString(),l=BM(e.severity),o=n??!0;return d.jsxs("button",{type:"button",onClick:t,className:Ee("w-full text-left transition-colors text-body",o?"cursor-pointer":"cursor-default"),style:{padding:"var(--sp-1_5) var(--sp-2)",background:e.read?"transparent":"var(--bg-sunken)",borderLeft:`var(--hairline-bold) solid ${l}`,borderRadius:"0 var(--sp-0_75) var(--sp-0_75) 0"},onMouseEnter:u=>{o&&(u.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:u=>{u.currentTarget.style.background=e.read?"transparent":"var(--bg-sunken)"},children:[d.jsxs("div",{className:"flex items-baseline justify-between",style:{gap:8},children:[d.jsx("span",{className:"mono uppercase text-label",style:{color:e.severity==="high"?"var(--state-error)":"var(--fg-3)"},children:a.replace("_"," ")}),d.jsx("span",{className:"mono text-label",style:{color:"var(--fg-4)",whiteSpace:"nowrap"},children:bi(e.createdAt)})]}),d.jsx("div",{style:{color:"var(--fg-2)",marginTop:1,wordBreak:"break-word"},children:e.message})]})}function $M(){var S;const[e,t]=x.useState(!1),[n,a]=x.useState(null),l=x.useRef(null),o=Zr(),u=Fn(),{data:f}=Ve({queryKey:["notifications","bell"],queryFn:()=>qp({limit:8}),refetchInterval:1e4}),{data:m}=Ve({queryKey:["notifications","unread-count"],queryFn:()=>qp({read:!1,limit:100}),refetchInterval:1e4}),h=((S=m==null?void 0:m.items)==null?void 0:S.length)??0,g=h>0,y=x.useCallback(async k=>{k.read||(ej(k.id).catch(()=>{}),u.invalidateQueries({queryKey:["notifications"]})),t(!1),k.agentId&&k.chatId?o(`/?a=${k.agentId}&c=${k.chatId}`):k.agentId&&o(`/?a=${k.agentId}`)},[o,u]),b=x.useCallback(async()=>{a(null);try{await UM(),await u.invalidateQueries({queryKey:["notifications"]})}catch(k){a(k instanceof Error?k.message:"Failed to mark all as read")}},[u]);return d.jsxs("div",{className:"relative",children:[d.jsxs("button",{type:"button",onClick:()=>t(!e),className:"relative flex items-center justify-center rounded-md p-1.5 text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-colors",children:[d.jsx(bT,{className:"h-4 w-4"}),g&&d.jsx("span",{className:"absolute -top-0.5 -right-0.5 flex items-center justify-center rounded-full px-1 font-medium text-label",style:{height:16,minWidth:16,background:"var(--state-error)",color:"var(--bg)"},children:h>99?"99+":h})]}),e&&d.jsxs(d.Fragment,{children:[d.jsx("button",{type:"button",className:"fixed inset-0 z-40 cursor-default",onClick:()=>t(!1)}),d.jsxs("div",{ref:l,className:"absolute right-0 top-full mt-1 z-50",style:{width:320,background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:6,boxShadow:"var(--shadow-md)"},children:[d.jsxs("div",{className:"flex items-center justify-between",style:{padding:"var(--sp-2) var(--sp-3)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsx("span",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-4)"},children:"Notifications"}),g&&d.jsx("button",{type:"button",onClick:b,className:"hover:underline text-body",style:{color:"var(--accent)"},children:"Mark all read"})]}),n&&d.jsx("div",{className:"text-body",style:{padding:"var(--sp-1_5) var(--sp-3)",color:"var(--state-error)",background:"var(--bg-sunken)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:n}),d.jsx("div",{className:"flex flex-col overflow-y-auto",style:{maxHeight:360,padding:8,gap:4},children:!(f!=null&&f.items)||f.items.length===0?d.jsx("div",{className:"text-center text-body",style:{color:"var(--fg-3)",padding:"var(--sp-4_5) 0"},children:"No notifications"}):f.items.map(k=>d.jsx(tj,{notification:k,clickable:!!k.agentId,onClick:()=>y(k)},k.id))})]})]})]})}function FM(){if(typeof window>"u")return"light";const e=window.localStorage.getItem("theme");return e==="light"||e==="dark"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function qM(){const[e,t]=x.useState(FM);return x.useEffect(()=>{document.documentElement.classList.toggle("dark",e==="dark"),window.localStorage.setItem("theme",e)},[e]),d.jsx("button",{type:"button",onClick:()=>t(e==="dark"?"light":"dark"),"aria-label":e==="dark"?"Switch to light theme":"Switch to dark theme",className:"flex items-center gap-1.5 rounded-md px-2 py-1.5 text-body text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-colors",children:e==="dark"?d.jsx(nR,{className:"h-4 w-4"}):d.jsx(FT,{className:"h-4 w-4"})})}const o1=[{to:"/",label:"Workspace",end:!0,kbd:"⌘1"},{to:"/agents",label:"Agents",end:!1,kbd:"⌘2"},{to:"/clients",label:"Computers",end:!1,kbd:"⌘3"},{to:"/settings",label:"Settings",end:!1,kbd:"⌘4"}],HM={to:"/admin",label:"Admin",end:!1,kbd:"⌘5"};function ZM(){const{role:e,logout:t}=wa(),n=e==="admin",[a,l]=x.useState(!1),o=n?[...o1,HM]:o1,u=br(),f=u.pathname==="/"||u.search.includes("a=");return x.useEffect(()=>{const m=h=>{(h.metaKey||h.ctrlKey)&&h.key.toLowerCase()==="k"&&(h.preventDefault(),l(g=>!g))};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[]),d.jsxs("div",{className:"flex flex-col overflow-hidden",style:{height:"100vh",background:"var(--bg)"},children:[d.jsxs("header",{className:"relative shrink-0 grid items-center",style:{height:48,gridTemplateColumns:"auto 1fr auto",padding:"0 var(--sp-3)",borderBottom:"var(--hairline) solid var(--border)",background:"var(--bg-raised)"},children:[d.jsxs("div",{className:"flex items-center",style:{gap:10},children:[d.jsx(Tu,{width:16,height:18,style:{color:"var(--fg)"}}),d.jsxs("span",{className:"text-title",style:{color:"var(--fg)"},children:["First Tree"," ",d.jsx("span",{className:"font-normal",style:{color:"var(--fg-3)"},children:"Hub"})]})]}),d.jsx("nav",{className:"flex justify-center",style:{gap:2,pointerEvents:"none"},children:o.map(m=>d.jsx(Nw,{to:m.to,end:m.end,style:{pointerEvents:"auto"},className:({isActive:h})=>Ee("inline-flex items-center transition-colors",h?"":"hover:text-[var(--fg)]"),children:({isActive:h})=>d.jsxs("span",{className:"inline-flex items-center text-subtitle font-medium",style:{padding:"var(--sp-1_5) var(--sp-3)",gap:6,borderRadius:5,color:h?"var(--fg)":"var(--fg-3)",background:h?"var(--bg-hover)":"transparent"},children:[m.label,h&&d.jsx("span",{className:"kbd",children:m.kbd})]})},m.to))}),d.jsxs("div",{className:"flex items-center",style:{gap:6},children:[d.jsxs("button",{type:"button",onClick:()=>l(!0),"aria-label":"Open command palette",className:"inline-flex items-center transition-colors text-body",style:{gap:8,padding:"var(--sp-1) var(--sp-2)",color:"var(--fg-3)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",background:"var(--bg-sunken)"},onMouseEnter:m=>{m.currentTarget.style.color="var(--fg)"},onMouseLeave:m=>{m.currentTarget.style.color="var(--fg-3)"},children:[d.jsx(Qd,{className:"h-4 w-4"}),d.jsx("span",{children:"Jump to…"}),d.jsx("span",{className:"kbd",children:"⌘K"})]}),d.jsx("span",{style:{width:1,height:18,background:"var(--border)",margin:"0 var(--sp-1)"}}),d.jsx($M,{}),d.jsx(qM,{}),d.jsx("span",{style:{width:1,height:18,background:"var(--border)",margin:"0 var(--sp-1)"}}),d.jsx("button",{type:"button",onClick:t,className:"inline-flex items-center transition-colors hover:text-[var(--fg)] text-body",style:{padding:"var(--sp-1) var(--sp-2)",color:"var(--fg-3)",borderRadius:"var(--radius-input)",gap:6},"aria-label":"Log out",children:d.jsx(PT,{className:"h-4 w-4"})})]})]}),d.jsx(IM,{open:a,onOpenChange:l}),f?d.jsx(Op,{}):d.jsx("main",{className:"flex-1 overflow-auto",children:d.jsx("div",{className:"p-6 mx-auto",style:{maxWidth:1280},children:d.jsx(Op,{})})})]})}function le(e,t,n){function a(f,m){if(f._zod||Object.defineProperty(f,"_zod",{value:{def:m,constr:u,traits:new Set},enumerable:!1}),f._zod.traits.has(e))return;f._zod.traits.add(e),t(f,m);const h=u.prototype,g=Object.keys(h);for(let y=0;y<g.length;y++){const b=g[y];b in f||(f[b]=h[b].bind(f))}}const l=(n==null?void 0:n.Parent)??Object;class o extends l{}Object.defineProperty(o,"name",{value:e});function u(f){var m;const h=n!=null&&n.Parent?new o:this;a(h,f),(m=h._zod).deferred??(m.deferred=[]);for(const g of h._zod.deferred)g();return h}return Object.defineProperty(u,"init",{value:a}),Object.defineProperty(u,Symbol.hasInstance,{value:f=>{var m,h;return n!=null&&n.Parent&&f instanceof n.Parent?!0:(h=(m=f==null?void 0:f._zod)==null?void 0:m.traits)==null?void 0:h.has(e)}}),Object.defineProperty(u,"name",{value:e}),u}class bs extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class nj extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const rj={};function wi(e){return rj}function aj(e){const t=Object.values(e).filter(a=>typeof a=="number");return Object.entries(e).filter(([a,l])=>t.indexOf(+a)===-1).map(([a,l])=>l)}function Hp(e,t){return typeof t=="bigint"?t.toString():t}function Jd(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Mg(e){return e==null}function Dg(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function VM(e,t){const n=(e.toString().split(".")[1]||"").length,a=t.toString();let l=(a.split(".")[1]||"").length;if(l===0&&/\d?e-\d?/.test(a)){const m=a.match(/\d?e-(\d?)/);m!=null&&m[1]&&(l=Number.parseInt(m[1]))}const o=n>l?n:l,u=Number.parseInt(e.toFixed(o).replace(".","")),f=Number.parseInt(t.toFixed(o).replace(".",""));return u%f/10**o}const u1=Symbol("evaluating");function ft(e,t,n){let a;Object.defineProperty(e,t,{get(){if(a!==u1)return a===void 0&&(a=u1,a=n()),a},set(l){Object.defineProperty(e,t,{value:l})},configurable:!0})}function vl(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ci(...e){const t={};for(const n of e){const a=Object.getOwnPropertyDescriptors(n);Object.assign(t,a)}return Object.defineProperties({},t)}function c1(e){return JSON.stringify(e)}function QM(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const ij="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function hu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const GM=Jd(()=>{var e;if(typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function Ms(e){if(hu(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(hu(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function lj(e){return Ms(e)?{...e}:Array.isArray(e)?[...e]:e}const KM=new Set(["string","number","symbol"]);function Ds(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ei(e,t,n){const a=new e._zod.constr(t??e._zod.def);return(!t||n!=null&&n.parent)&&(a._zod.parent=e),a}function Ne(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function YM(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const XM={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 JM(e,t){const n=e._zod.def,a=n.checks;if(a&&a.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const o=Ci(e._zod.def,{get shape(){const u={};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&(u[f]=n.shape[f])}return vl(this,"shape",u),u},checks:[]});return Ei(e,o)}function WM(e,t){const n=e._zod.def,a=n.checks;if(a&&a.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const o=Ci(e._zod.def,{get shape(){const u={...e._zod.def.shape};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&delete u[f]}return vl(this,"shape",u),u},checks:[]});return Ei(e,o)}function e3(e,t){if(!Ms(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const o=e._zod.def.shape;for(const u in t)if(Object.getOwnPropertyDescriptor(o,u)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const l=Ci(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return vl(this,"shape",o),o}});return Ei(e,l)}function t3(e,t){if(!Ms(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Ci(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return vl(this,"shape",a),a}});return Ei(e,n)}function n3(e,t){const n=Ci(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return vl(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:[]});return Ei(e,n)}function r3(e,t,n){const l=t._zod.def.checks;if(l&&l.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const u=Ci(t._zod.def,{get shape(){const f=t._zod.def.shape,m={...f};if(n)for(const h in n){if(!(h in f))throw new Error(`Unrecognized key: "${h}"`);n[h]&&(m[h]=e?new e({type:"optional",innerType:f[h]}):f[h])}else for(const h in f)m[h]=e?new e({type:"optional",innerType:f[h]}):f[h];return vl(this,"shape",m),m},checks:[]});return Ei(t,u)}function a3(e,t,n){const a=Ci(t._zod.def,{get shape(){const l=t._zod.def.shape,o={...l};if(n)for(const u in n){if(!(u in o))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(o[u]=new e({type:"nonoptional",innerType:l[u]}))}else for(const u in l)o[u]=new e({type:"nonoptional",innerType:l[u]});return vl(this,"shape",o),o}});return Ei(t,a)}function ms(e,t=0){var n;if(e.aborted===!0)return!0;for(let a=t;a<e.issues.length;a++)if(((n=e.issues[a])==null?void 0:n.continue)!==!0)return!0;return!1}function ps(e,t){return t.map(n=>{var a;return(a=n).path??(a.path=[]),n.path.unshift(e),n})}function id(e){return typeof e=="string"?e:e==null?void 0:e.message}function ki(e,t,n){var l,o,u,f,m,h;const a={...e,path:e.path??[]};if(!e.message){const g=id((u=(o=(l=e.inst)==null?void 0:l._zod.def)==null?void 0:o.error)==null?void 0:u.call(o,e))??id((f=t==null?void 0:t.error)==null?void 0:f.call(t,e))??id((m=n.customError)==null?void 0:m.call(n,e))??id((h=n.localeError)==null?void 0:h.call(n,e))??"Invalid input";a.message=g}return delete a.inst,delete a.continue,t!=null&&t.reportInput||delete a.input,a}function Lg(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function mu(...e){const[t,n,a]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:a}:{...t}}const sj=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Hp,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},oj=le("$ZodError",sj),uj=le("$ZodError",sj,{Parent:Error});function i3(e,t=n=>n.message){const n={},a=[];for(const l of e.issues)l.path.length>0?(n[l.path[0]]=n[l.path[0]]||[],n[l.path[0]].push(t(l))):a.push(t(l));return{formErrors:a,fieldErrors:n}}function l3(e,t=n=>n.message){const n={_errors:[]},a=l=>{for(const o of l.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(u=>a({issues:u}));else if(o.code==="invalid_key")a({issues:o.issues});else if(o.code==="invalid_element")a({issues:o.issues});else if(o.path.length===0)n._errors.push(t(o));else{let u=n,f=0;for(;f<o.path.length;){const m=o.path[f];f===o.path.length-1?(u[m]=u[m]||{_errors:[]},u[m]._errors.push(t(o))):u[m]=u[m]||{_errors:[]},u=u[m],f++}}};return a(e),n}const Ig=e=>(t,n,a,l)=>{const o=a?Object.assign(a,{async:!1}):{async:!1},u=t._zod.run({value:n,issues:[]},o);if(u instanceof Promise)throw new bs;if(u.issues.length){const f=new((l==null?void 0:l.Err)??e)(u.issues.map(m=>ki(m,o,wi())));throw ij(f,l==null?void 0:l.callee),f}return u.value},Ug=e=>async(t,n,a,l)=>{const o=a?Object.assign(a,{async:!0}):{async:!0};let u=t._zod.run({value:n,issues:[]},o);if(u instanceof Promise&&(u=await u),u.issues.length){const f=new((l==null?void 0:l.Err)??e)(u.issues.map(m=>ki(m,o,wi())));throw ij(f,l==null?void 0:l.callee),f}return u.value},Wd=e=>(t,n,a)=>{const l=a?{...a,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},l);if(o instanceof Promise)throw new bs;return o.issues.length?{success:!1,error:new(e??oj)(o.issues.map(u=>ki(u,l,wi())))}:{success:!0,data:o.value}},s3=Wd(uj),ef=e=>async(t,n,a)=>{const l=a?Object.assign(a,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},l);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(u=>ki(u,l,wi())))}:{success:!0,data:o.value}},o3=ef(uj),u3=e=>(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Ig(e)(t,n,l)},c3=e=>(t,n,a)=>Ig(e)(t,n,a),d3=e=>async(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Ug(e)(t,n,l)},f3=e=>async(t,n,a)=>Ug(e)(t,n,a),h3=e=>(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Wd(e)(t,n,l)},m3=e=>(t,n,a)=>Wd(e)(t,n,a),p3=e=>async(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return ef(e)(t,n,l)},g3=e=>async(t,n,a)=>ef(e)(t,n,a),y3=/^[cC][^\s-]{8,}$/,v3=/^[0-9a-z]+$/,b3=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,x3=/^[0-9a-vA-V]{20}$/,S3=/^[A-Za-z0-9]{27}$/,w3=/^[a-zA-Z0-9_-]{21}$/,k3=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,j3=/^([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})$/,d1=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)$/,C3=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,E3="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function N3(){return new RegExp(E3,"u")}const _3=/^(?:(?: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])$/,A3=/^(([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}|:))$/,T3=/^((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])$/,R3=/^(([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])$/,z3=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,cj=/^[A-Za-z0-9_-]*$/,O3=/^\+[1-9]\d{6,14}$/,dj="(?:(?:\\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])))",M3=new RegExp(`^${dj}$`);function fj(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function D3(e){return new RegExp(`^${fj(e)}$`)}function L3(e){const t=fj({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const a=`${t}(?:${n.join("|")})`;return new RegExp(`^${dj}T(?:${a})$`)}const I3=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},U3=/^-?\d+$/,hj=/^-?\d+(?:\.\d+)?$/,P3=/^(?:true|false)$/i,B3=/^[^A-Z]*$/,$3=/^[^a-z]*$/,Hn=le("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),mj={number:"number",bigint:"bigint",object:"date"},pj=le("$ZodCheckLessThan",(e,t)=>{Hn.init(e,t);const n=mj[typeof t.value];e._zod.onattach.push(a=>{const l=a._zod.bag,o=(t.inclusive?l.maximum:l.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<o&&(t.inclusive?l.maximum=t.value:l.exclusiveMaximum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value<=t.value:a.value<t.value)||a.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),gj=le("$ZodCheckGreaterThan",(e,t)=>{Hn.init(e,t);const n=mj[typeof t.value];e._zod.onattach.push(a=>{const l=a._zod.bag,o=(t.inclusive?l.minimum:l.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>o&&(t.inclusive?l.minimum=t.value:l.exclusiveMinimum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value>=t.value:a.value>t.value)||a.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),F3=le("$ZodCheckMultipleOf",(e,t)=>{Hn.init(e,t),e._zod.onattach.push(n=>{var a;(a=n._zod.bag).multipleOf??(a.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):VM(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),q3=le("$ZodCheckNumberFormat",(e,t)=>{var u;Hn.init(e,t),t.format=t.format||"float64";const n=(u=t.format)==null?void 0:u.includes("int"),a=n?"int":"number",[l,o]=XM[t.format];e._zod.onattach.push(f=>{const m=f._zod.bag;m.format=t.format,m.minimum=l,m.maximum=o,n&&(m.pattern=U3)}),e._zod.check=f=>{const m=f.value;if(n){if(!Number.isInteger(m)){f.issues.push({expected:a,format:t.format,code:"invalid_type",continue:!1,input:m,inst:e});return}if(!Number.isSafeInteger(m)){m>0?f.issues.push({input:m,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!t.abort}):f.issues.push({input:m,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!t.abort});return}}m<l&&f.issues.push({origin:"number",input:m,code:"too_small",minimum:l,inclusive:!0,inst:e,continue:!t.abort}),m>o&&f.issues.push({origin:"number",input:m,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),H3=le("$ZodCheckMaxLength",(e,t)=>{var n;Hn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const l=a.value;return!Mg(l)&&l.length!==void 0}),e._zod.onattach.push(a=>{const l=a._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<l&&(a._zod.bag.maximum=t.maximum)}),e._zod.check=a=>{const l=a.value;if(l.length<=t.maximum)return;const u=Lg(l);a.issues.push({origin:u,code:"too_big",maximum:t.maximum,inclusive:!0,input:l,inst:e,continue:!t.abort})}}),Z3=le("$ZodCheckMinLength",(e,t)=>{var n;Hn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const l=a.value;return!Mg(l)&&l.length!==void 0}),e._zod.onattach.push(a=>{const l=a._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>l&&(a._zod.bag.minimum=t.minimum)}),e._zod.check=a=>{const l=a.value;if(l.length>=t.minimum)return;const u=Lg(l);a.issues.push({origin:u,code:"too_small",minimum:t.minimum,inclusive:!0,input:l,inst:e,continue:!t.abort})}}),V3=le("$ZodCheckLengthEquals",(e,t)=>{var n;Hn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const l=a.value;return!Mg(l)&&l.length!==void 0}),e._zod.onattach.push(a=>{const l=a._zod.bag;l.minimum=t.length,l.maximum=t.length,l.length=t.length}),e._zod.check=a=>{const l=a.value,o=l.length;if(o===t.length)return;const u=Lg(l),f=o>t.length;a.issues.push({origin:u,...f?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:a.value,inst:e,continue:!t.abort})}}),tf=le("$ZodCheckStringFormat",(e,t)=>{var n,a;Hn.init(e,t),e._zod.onattach.push(l=>{const o=l._zod.bag;o.format=t.format,t.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=l=>{t.pattern.lastIndex=0,!t.pattern.test(l.value)&&l.issues.push({origin:"string",code:"invalid_format",format:t.format,input:l.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(a=e._zod).check??(a.check=()=>{})}),Q3=le("$ZodCheckRegex",(e,t)=>{tf.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),G3=le("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=B3),tf.init(e,t)}),K3=le("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=$3),tf.init(e,t)}),Y3=le("$ZodCheckIncludes",(e,t)=>{Hn.init(e,t);const n=Ds(t.includes),a=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=a,e._zod.onattach.push(l=>{const o=l._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(a)}),e._zod.check=l=>{l.value.includes(t.includes,t.position)||l.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:l.value,inst:e,continue:!t.abort})}}),X3=le("$ZodCheckStartsWith",(e,t)=>{Hn.init(e,t);const n=new RegExp(`^${Ds(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(a=>{const l=a._zod.bag;l.patterns??(l.patterns=new Set),l.patterns.add(n)}),e._zod.check=a=>{a.value.startsWith(t.prefix)||a.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:a.value,inst:e,continue:!t.abort})}}),J3=le("$ZodCheckEndsWith",(e,t)=>{Hn.init(e,t);const n=new RegExp(`.*${Ds(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(a=>{const l=a._zod.bag;l.patterns??(l.patterns=new Set),l.patterns.add(n)}),e._zod.check=a=>{a.value.endsWith(t.suffix)||a.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:a.value,inst:e,continue:!t.abort})}}),W3=le("$ZodCheckOverwrite",(e,t)=>{Hn.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class eD{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const a=t.split(`
295
+ `).filter(u=>u),l=Math.min(...a.map(u=>u.length-u.trimStart().length)),o=a.map(u=>u.slice(l)).map(u=>" ".repeat(this.indent*2)+u);for(const u of o)this.content.push(u)}compile(){const t=Function,n=this==null?void 0:this.args,l=[...((this==null?void 0:this.content)??[""]).map(o=>` ${o}`)];return new t(...n,l.join(`
296
+ `))}}const tD={major:4,minor:3,patch:6},Rt=le("$ZodType",(e,t)=>{var l;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=tD;const a=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&a.unshift(e);for(const o of a)for(const u of o._zod.onattach)u(e);if(a.length===0)(n=e._zod).deferred??(n.deferred=[]),(l=e._zod.deferred)==null||l.push(()=>{e._zod.run=e._zod.parse});else{const o=(f,m,h)=>{let g=ms(f),y;for(const b of m){if(b._zod.def.when){if(!b._zod.def.when(f))continue}else if(g)continue;const S=f.issues.length,k=b._zod.check(f);if(k instanceof Promise&&(h==null?void 0:h.async)===!1)throw new bs;if(y||k instanceof Promise)y=(y??Promise.resolve()).then(async()=>{await k,f.issues.length!==S&&(g||(g=ms(f,S)))});else{if(f.issues.length===S)continue;g||(g=ms(f,S))}}return y?y.then(()=>f):f},u=(f,m,h)=>{if(ms(f))return f.aborted=!0,f;const g=o(m,a,h);if(g instanceof Promise){if(h.async===!1)throw new bs;return g.then(y=>e._zod.parse(y,h))}return e._zod.parse(g,h)};e._zod.run=(f,m)=>{if(m.skipChecks)return e._zod.parse(f,m);if(m.direction==="backward"){const g=e._zod.parse({value:f.value,issues:[]},{...m,skipChecks:!0});return g instanceof Promise?g.then(y=>u(y,f,m)):u(g,f,m)}const h=e._zod.parse(f,m);if(h instanceof Promise){if(m.async===!1)throw new bs;return h.then(g=>o(g,a,m))}return o(h,a,m)}}ft(e,"~standard",()=>({validate:o=>{var u;try{const f=s3(e,o);return f.success?{value:f.data}:{issues:(u=f.error)==null?void 0:u.issues}}catch{return o3(e,o).then(m=>{var h;return m.success?{value:m.data}:{issues:(h=m.error)==null?void 0:h.issues}})}},vendor:"zod",version:1}))}),Pg=le("$ZodString",(e,t)=>{var n;Rt.init(e,t),e._zod.pattern=[...((n=e==null?void 0:e._zod.bag)==null?void 0:n.patterns)??[]].pop()??I3(e._zod.bag),e._zod.parse=(a,l)=>{if(t.coerce)try{a.value=String(a.value)}catch{}return typeof a.value=="string"||a.issues.push({expected:"string",code:"invalid_type",input:a.value,inst:e}),a}}),Tt=le("$ZodStringFormat",(e,t)=>{tf.init(e,t),Pg.init(e,t)}),nD=le("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=j3),Tt.init(e,t)}),rD=le("$ZodUUID",(e,t)=>{if(t.version){const a={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(a===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=d1(a))}else t.pattern??(t.pattern=d1());Tt.init(e,t)}),aD=le("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=C3),Tt.init(e,t)}),iD=le("$ZodURL",(e,t)=>{Tt.init(e,t),e._zod.check=n=>{try{const a=n.value.trim(),l=new URL(a);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(l.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(l.protocol.endsWith(":")?l.protocol.slice(0,-1):l.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=l.href:n.value=a;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),lD=le("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=N3()),Tt.init(e,t)}),sD=le("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=w3),Tt.init(e,t)}),oD=le("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=y3),Tt.init(e,t)}),uD=le("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=v3),Tt.init(e,t)}),cD=le("$ZodULID",(e,t)=>{t.pattern??(t.pattern=b3),Tt.init(e,t)}),dD=le("$ZodXID",(e,t)=>{t.pattern??(t.pattern=x3),Tt.init(e,t)}),fD=le("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=S3),Tt.init(e,t)}),hD=le("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=L3(t)),Tt.init(e,t)}),mD=le("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=M3),Tt.init(e,t)}),pD=le("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=D3(t)),Tt.init(e,t)}),gD=le("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=k3),Tt.init(e,t)}),yD=le("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=_3),Tt.init(e,t),e._zod.bag.format="ipv4"}),vD=le("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=A3),Tt.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),bD=le("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=T3),Tt.init(e,t)}),xD=le("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=R3),Tt.init(e,t),e._zod.check=n=>{const a=n.value.split("/");try{if(a.length!==2)throw new Error;const[l,o]=a;if(!o)throw new Error;const u=Number(o);if(`${u}`!==o)throw new Error;if(u<0||u>128)throw new Error;new URL(`http://[${l}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function yj(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const SD=le("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=z3),Tt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{yj(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function wD(e){if(!cj.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return yj(n)}const kD=le("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=cj),Tt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{wD(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),jD=le("$ZodE164",(e,t)=>{t.pattern??(t.pattern=O3),Tt.init(e,t)});function CD(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[a]=n;if(!a)return!1;const l=JSON.parse(atob(a));return!("typ"in l&&(l==null?void 0:l.typ)!=="JWT"||!l.alg||t&&(!("alg"in l)||l.alg!==t))}catch{return!1}}const ED=le("$ZodJWT",(e,t)=>{Tt.init(e,t),e._zod.check=n=>{CD(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),vj=le("$ZodNumber",(e,t)=>{Rt.init(e,t),e._zod.pattern=e._zod.bag.pattern??hj,e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const l=n.value;if(typeof l=="number"&&!Number.isNaN(l)&&Number.isFinite(l))return n;const o=typeof l=="number"?Number.isNaN(l)?"NaN":Number.isFinite(l)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:l,inst:e,...o?{received:o}:{}}),n}}),ND=le("$ZodNumberFormat",(e,t)=>{q3.init(e,t),vj.init(e,t)}),_D=le("$ZodBoolean",(e,t)=>{Rt.init(e,t),e._zod.pattern=P3,e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=!!n.value}catch{}const l=n.value;return typeof l=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:l,inst:e}),n}}),AD=le("$ZodUnknown",(e,t)=>{Rt.init(e,t),e._zod.parse=n=>n}),TD=le("$ZodNever",(e,t)=>{Rt.init(e,t),e._zod.parse=(n,a)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function f1(e,t,n){e.issues.length&&t.issues.push(...ps(n,e.issues)),t.value[n]=e.value}const RD=le("$ZodArray",(e,t)=>{Rt.init(e,t),e._zod.parse=(n,a)=>{const l=n.value;if(!Array.isArray(l))return n.issues.push({expected:"array",code:"invalid_type",input:l,inst:e}),n;n.value=Array(l.length);const o=[];for(let u=0;u<l.length;u++){const f=l[u],m=t.element._zod.run({value:f,issues:[]},a);m instanceof Promise?o.push(m.then(h=>f1(h,n,u))):f1(m,n,u)}return o.length?Promise.all(o).then(()=>n):n}});function Rd(e,t,n,a,l){if(e.issues.length){if(l&&!(n in a))return;t.issues.push(...ps(n,e.issues))}e.value===void 0?n in a&&(t.value[n]=void 0):t.value[n]=e.value}function bj(e){var a,l,o,u;const t=Object.keys(e.shape);for(const f of t)if(!((u=(o=(l=(a=e.shape)==null?void 0:a[f])==null?void 0:l._zod)==null?void 0:o.traits)!=null&&u.has("$ZodType")))throw new Error(`Invalid element at key "${f}": expected a Zod schema`);const n=YM(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function xj(e,t,n,a,l,o){const u=[],f=l.keySet,m=l.catchall._zod,h=m.def.type,g=m.optout==="optional";for(const y in t){if(f.has(y))continue;if(h==="never"){u.push(y);continue}const b=m.run({value:t[y],issues:[]},a);b instanceof Promise?e.push(b.then(S=>Rd(S,n,y,t,g))):Rd(b,n,y,t,g)}return u.length&&n.issues.push({code:"unrecognized_keys",keys:u,input:t,inst:o}),e.length?Promise.all(e).then(()=>n):n}const zD=le("$ZodObject",(e,t)=>{Rt.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape");if(!(n!=null&&n.get)){const f=t.shape;Object.defineProperty(t,"shape",{get:()=>{const m={...f};return Object.defineProperty(t,"shape",{value:m}),m}})}const a=Jd(()=>bj(t));ft(e._zod,"propValues",()=>{const f=t.shape,m={};for(const h in f){const g=f[h]._zod;if(g.values){m[h]??(m[h]=new Set);for(const y of g.values)m[h].add(y)}}return m});const l=hu,o=t.catchall;let u;e._zod.parse=(f,m)=>{u??(u=a.value);const h=f.value;if(!l(h))return f.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),f;f.value={};const g=[],y=u.shape;for(const b of u.keys){const S=y[b],k=S._zod.optout==="optional",j=S._zod.run({value:h[b],issues:[]},m);j instanceof Promise?g.push(j.then(E=>Rd(E,f,b,h,k))):Rd(j,f,b,h,k)}return o?xj(g,h,f,m,a.value,e):g.length?Promise.all(g).then(()=>f):f}}),OD=le("$ZodObjectJIT",(e,t)=>{zD.init(e,t);const n=e._zod.parse,a=Jd(()=>bj(t)),l=b=>{var O;const S=new eD(["shape","payload","ctx"]),k=a.value,j=B=>{const M=c1(B);return`shape[${M}]._zod.run({ value: input[${M}], issues: [] }, ctx)`};S.write("const input = payload.value;");const E=Object.create(null);let C=0;for(const B of k.keys)E[B]=`key_${C++}`;S.write("const newResult = {};");for(const B of k.keys){const M=E[B],R=c1(B),D=b[B],Z=((O=D==null?void 0:D._zod)==null?void 0:O.optout)==="optional";S.write(`const ${M} = ${j(B)};`),Z?S.write(`
297
+ if (${M}.issues.length) {
298
+ if (${R} in input) {
299
+ payload.issues = payload.issues.concat(${M}.issues.map(iss => ({
300
+ ...iss,
301
+ path: iss.path ? [${R}, ...iss.path] : [${R}]
302
+ })));
303
+ }
304
+ }
305
+
306
+ if (${M}.value === undefined) {
307
+ if (${R} in input) {
308
+ newResult[${R}] = undefined;
309
+ }
310
+ } else {
311
+ newResult[${R}] = ${M}.value;
312
+ }
313
+
314
+ `):S.write(`
315
+ if (${M}.issues.length) {
316
+ payload.issues = payload.issues.concat(${M}.issues.map(iss => ({
317
+ ...iss,
318
+ path: iss.path ? [${R}, ...iss.path] : [${R}]
319
+ })));
320
+ }
321
+
322
+ if (${M}.value === undefined) {
323
+ if (${R} in input) {
324
+ newResult[${R}] = undefined;
325
+ }
326
+ } else {
327
+ newResult[${R}] = ${M}.value;
328
+ }
329
+
330
+ `)}S.write("payload.value = newResult;"),S.write("return payload;");const T=S.compile();return(B,M)=>T(b,B,M)};let o;const u=hu,f=!rj.jitless,h=f&&GM.value,g=t.catchall;let y;e._zod.parse=(b,S)=>{y??(y=a.value);const k=b.value;return u(k)?f&&h&&(S==null?void 0:S.async)===!1&&S.jitless!==!0?(o||(o=l(t.shape)),b=o(b,S),g?xj([],k,b,S,y,e):b):n(b,S):(b.issues.push({expected:"object",code:"invalid_type",input:k,inst:e}),b)}});function h1(e,t,n,a){for(const o of e)if(o.issues.length===0)return t.value=o.value,t;const l=e.filter(o=>!ms(o));return l.length===1?(t.value=l[0].value,l[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(o=>o.issues.map(u=>ki(u,a,wi())))}),t)}const Sj=le("$ZodUnion",(e,t)=>{Rt.init(e,t),ft(e._zod,"optin",()=>t.options.some(l=>l._zod.optin==="optional")?"optional":void 0),ft(e._zod,"optout",()=>t.options.some(l=>l._zod.optout==="optional")?"optional":void 0),ft(e._zod,"values",()=>{if(t.options.every(l=>l._zod.values))return new Set(t.options.flatMap(l=>Array.from(l._zod.values)))}),ft(e._zod,"pattern",()=>{if(t.options.every(l=>l._zod.pattern)){const l=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${l.map(o=>Dg(o.source)).join("|")})$`)}});const n=t.options.length===1,a=t.options[0]._zod.run;e._zod.parse=(l,o)=>{if(n)return a(l,o);let u=!1;const f=[];for(const m of t.options){const h=m._zod.run({value:l.value,issues:[]},o);if(h instanceof Promise)f.push(h),u=!0;else{if(h.issues.length===0)return h;f.push(h)}}return u?Promise.all(f).then(m=>h1(m,l,e,o)):h1(f,l,e,o)}}),MD=le("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Sj.init(e,t);const n=e._zod.parse;ft(e._zod,"propValues",()=>{const l={};for(const o of t.options){const u=o._zod.propValues;if(!u||Object.keys(u).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(const[f,m]of Object.entries(u)){l[f]||(l[f]=new Set);for(const h of m)l[f].add(h)}}return l});const a=Jd(()=>{var u;const l=t.options,o=new Map;for(const f of l){const m=(u=f._zod.propValues)==null?void 0:u[t.discriminator];if(!m||m.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(f)}"`);for(const h of m){if(o.has(h))throw new Error(`Duplicate discriminator value "${String(h)}"`);o.set(h,f)}}return o});e._zod.parse=(l,o)=>{const u=l.value;if(!hu(u))return l.issues.push({code:"invalid_type",expected:"object",input:u,inst:e}),l;const f=a.value.get(u==null?void 0:u[t.discriminator]);return f?f._zod.run(l,o):t.unionFallback?n(l,o):(l.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:u,path:[t.discriminator],inst:e}),l)}}),DD=le("$ZodIntersection",(e,t)=>{Rt.init(e,t),e._zod.parse=(n,a)=>{const l=n.value,o=t.left._zod.run({value:l,issues:[]},a),u=t.right._zod.run({value:l,issues:[]},a);return o instanceof Promise||u instanceof Promise?Promise.all([o,u]).then(([m,h])=>m1(n,m,h)):m1(n,o,u)}});function Zp(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Ms(e)&&Ms(t)){const n=Object.keys(t),a=Object.keys(e).filter(o=>n.indexOf(o)!==-1),l={...e,...t};for(const o of a){const u=Zp(e[o],t[o]);if(!u.valid)return{valid:!1,mergeErrorPath:[o,...u.mergeErrorPath]};l[o]=u.data}return{valid:!0,data:l}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let a=0;a<e.length;a++){const l=e[a],o=t[a],u=Zp(l,o);if(!u.valid)return{valid:!1,mergeErrorPath:[a,...u.mergeErrorPath]};n.push(u.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function m1(e,t,n){const a=new Map;let l;for(const f of t.issues)if(f.code==="unrecognized_keys"){l??(l=f);for(const m of f.keys)a.has(m)||a.set(m,{}),a.get(m).l=!0}else e.issues.push(f);for(const f of n.issues)if(f.code==="unrecognized_keys")for(const m of f.keys)a.has(m)||a.set(m,{}),a.get(m).r=!0;else e.issues.push(f);const o=[...a].filter(([,f])=>f.l&&f.r).map(([f])=>f);if(o.length&&l&&e.issues.push({...l,keys:o}),ms(e))return e;const u=Zp(t.value,n.value);if(!u.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(u.mergeErrorPath)}`);return e.value=u.data,e}const LD=le("$ZodRecord",(e,t)=>{Rt.init(e,t),e._zod.parse=(n,a)=>{const l=n.value;if(!Ms(l))return n.issues.push({expected:"record",code:"invalid_type",input:l,inst:e}),n;const o=[],u=t.keyType._zod.values;if(u){n.value={};const f=new Set;for(const h of u)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){f.add(typeof h=="number"?h.toString():h);const g=t.valueType._zod.run({value:l[h],issues:[]},a);g instanceof Promise?o.push(g.then(y=>{y.issues.length&&n.issues.push(...ps(h,y.issues)),n.value[h]=y.value})):(g.issues.length&&n.issues.push(...ps(h,g.issues)),n.value[h]=g.value)}let m;for(const h in l)f.has(h)||(m=m??[],m.push(h));m&&m.length>0&&n.issues.push({code:"unrecognized_keys",input:l,inst:e,keys:m})}else{n.value={};for(const f of Reflect.ownKeys(l)){if(f==="__proto__")continue;let m=t.keyType._zod.run({value:f,issues:[]},a);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof f=="string"&&hj.test(f)&&m.issues.length){const y=t.keyType._zod.run({value:Number(f),issues:[]},a);if(y instanceof Promise)throw new Error("Async schemas not supported in object keys currently");y.issues.length===0&&(m=y)}if(m.issues.length){t.mode==="loose"?n.value[f]=l[f]:n.issues.push({code:"invalid_key",origin:"record",issues:m.issues.map(y=>ki(y,a,wi())),input:f,path:[f],inst:e});continue}const g=t.valueType._zod.run({value:l[f],issues:[]},a);g instanceof Promise?o.push(g.then(y=>{y.issues.length&&n.issues.push(...ps(f,y.issues)),n.value[m.value]=y.value})):(g.issues.length&&n.issues.push(...ps(f,g.issues)),n.value[m.value]=g.value)}}return o.length?Promise.all(o).then(()=>n):n}}),ID=le("$ZodEnum",(e,t)=>{Rt.init(e,t);const n=aj(t.entries),a=new Set(n);e._zod.values=a,e._zod.pattern=new RegExp(`^(${n.filter(l=>KM.has(typeof l)).map(l=>typeof l=="string"?Ds(l):l.toString()).join("|")})$`),e._zod.parse=(l,o)=>{const u=l.value;return a.has(u)||l.issues.push({code:"invalid_value",values:n,input:u,inst:e}),l}}),UD=le("$ZodLiteral",(e,t)=>{if(Rt.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(a=>typeof a=="string"?Ds(a):a?Ds(a.toString()):String(a)).join("|")})$`),e._zod.parse=(a,l)=>{const o=a.value;return n.has(o)||a.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),a}}),PD=le("$ZodTransform",(e,t)=>{Rt.init(e,t),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new nj(e.constructor.name);const l=t.transform(n.value,n);if(a.async)return(l instanceof Promise?l:Promise.resolve(l)).then(u=>(n.value=u,n));if(l instanceof Promise)throw new bs;return n.value=l,n}});function p1(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const wj=le("$ZodOptional",(e,t)=>{Rt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ft(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ft(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Dg(n.source)})?$`):void 0}),e._zod.parse=(n,a)=>{if(t.innerType._zod.optin==="optional"){const l=t.innerType._zod.run(n,a);return l instanceof Promise?l.then(o=>p1(o,n.value)):p1(l,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,a)}}),BD=le("$ZodExactOptional",(e,t)=>{wj.init(e,t),ft(e._zod,"values",()=>t.innerType._zod.values),ft(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,a)=>t.innerType._zod.run(n,a)}),$D=le("$ZodNullable",(e,t)=>{Rt.init(e,t),ft(e._zod,"optin",()=>t.innerType._zod.optin),ft(e._zod,"optout",()=>t.innerType._zod.optout),ft(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Dg(n.source)}|null)$`):void 0}),ft(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,a)=>n.value===null?n:t.innerType._zod.run(n,a)}),FD=le("$ZodDefault",(e,t)=>{Rt.init(e,t),e._zod.optin="optional",ft(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);if(n.value===void 0)return n.value=t.defaultValue,n;const l=t.innerType._zod.run(n,a);return l instanceof Promise?l.then(o=>g1(o,t)):g1(l,t)}});function g1(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const qD=le("$ZodPrefault",(e,t)=>{Rt.init(e,t),e._zod.optin="optional",ft(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>(a.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,a))}),HD=le("$ZodNonOptional",(e,t)=>{Rt.init(e,t),ft(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(a=>a!==void 0)):void 0}),e._zod.parse=(n,a)=>{const l=t.innerType._zod.run(n,a);return l instanceof Promise?l.then(o=>y1(o,e)):y1(l,e)}});function y1(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const ZD=le("$ZodCatch",(e,t)=>{Rt.init(e,t),ft(e._zod,"optin",()=>t.innerType._zod.optin),ft(e._zod,"optout",()=>t.innerType._zod.optout),ft(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);const l=t.innerType._zod.run(n,a);return l instanceof Promise?l.then(o=>(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(u=>ki(u,a,wi()))},input:n.value}),n.issues=[]),n)):(n.value=l.value,l.issues.length&&(n.value=t.catchValue({...n,error:{issues:l.issues.map(o=>ki(o,a,wi()))},input:n.value}),n.issues=[]),n)}}),VD=le("$ZodPipe",(e,t)=>{Rt.init(e,t),ft(e._zod,"values",()=>t.in._zod.values),ft(e._zod,"optin",()=>t.in._zod.optin),ft(e._zod,"optout",()=>t.out._zod.optout),ft(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,a)=>{if(a.direction==="backward"){const o=t.out._zod.run(n,a);return o instanceof Promise?o.then(u=>ld(u,t.in,a)):ld(o,t.in,a)}const l=t.in._zod.run(n,a);return l instanceof Promise?l.then(o=>ld(o,t.out,a)):ld(l,t.out,a)}});function ld(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const QD=le("$ZodReadonly",(e,t)=>{Rt.init(e,t),ft(e._zod,"propValues",()=>t.innerType._zod.propValues),ft(e._zod,"values",()=>t.innerType._zod.values),ft(e._zod,"optin",()=>{var n,a;return(a=(n=t.innerType)==null?void 0:n._zod)==null?void 0:a.optin}),ft(e._zod,"optout",()=>{var n,a;return(a=(n=t.innerType)==null?void 0:n._zod)==null?void 0:a.optout}),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);const l=t.innerType._zod.run(n,a);return l instanceof Promise?l.then(v1):v1(l)}});function v1(e){return e.value=Object.freeze(e.value),e}const GD=le("$ZodCustom",(e,t)=>{Hn.init(e,t),Rt.init(e,t),e._zod.parse=(n,a)=>n,e._zod.check=n=>{const a=n.value,l=t.fn(a);if(l instanceof Promise)return l.then(o=>b1(o,n,a,e));b1(l,n,a,e)}});function b1(e,t,n,a){if(!e){const l={code:"custom",input:n,inst:a,path:[...a._zod.def.path??[]],continue:!a._zod.def.abort};a._zod.def.params&&(l.params=a._zod.def.params),t.issues.push(mu(l))}}var x1;class KD{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const a=n[0];return this._map.set(t,a),a&&typeof a=="object"&&"id"in a&&this._idmap.set(a.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const a={...this.get(n)??{}};delete a.id;const l={...a,...this._map.get(t)};return Object.keys(l).length?l:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function YD(){return new KD}(x1=globalThis).__zod_globalRegistry??(x1.__zod_globalRegistry=YD());const Wo=globalThis.__zod_globalRegistry;function XD(e,t){return new e({type:"string",...Ne(t)})}function JD(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ne(t)})}function S1(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ne(t)})}function WD(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ne(t)})}function e4(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ne(t)})}function t4(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ne(t)})}function n4(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ne(t)})}function r4(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ne(t)})}function a4(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ne(t)})}function i4(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ne(t)})}function l4(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ne(t)})}function s4(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ne(t)})}function o4(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ne(t)})}function u4(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ne(t)})}function c4(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ne(t)})}function d4(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ne(t)})}function f4(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ne(t)})}function h4(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ne(t)})}function m4(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ne(t)})}function p4(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ne(t)})}function g4(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ne(t)})}function y4(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ne(t)})}function v4(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ne(t)})}function b4(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ne(t)})}function x4(e,t){return new e({type:"string",format:"date",check:"string_format",...Ne(t)})}function S4(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ne(t)})}function w4(e,t){return new e({type:"string",format:"duration",check:"string_format",...Ne(t)})}function k4(e,t){return new e({type:"number",checks:[],...Ne(t)})}function j4(e,t){return new e({type:"number",coerce:!0,checks:[],...Ne(t)})}function C4(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ne(t)})}function E4(e,t){return new e({type:"boolean",...Ne(t)})}function N4(e){return new e({type:"unknown"})}function _4(e,t){return new e({type:"never",...Ne(t)})}function w1(e,t){return new pj({check:"less_than",...Ne(t),value:e,inclusive:!1})}function Vm(e,t){return new pj({check:"less_than",...Ne(t),value:e,inclusive:!0})}function k1(e,t){return new gj({check:"greater_than",...Ne(t),value:e,inclusive:!1})}function Qm(e,t){return new gj({check:"greater_than",...Ne(t),value:e,inclusive:!0})}function j1(e,t){return new F3({check:"multiple_of",...Ne(t),value:e})}function kj(e,t){return new H3({check:"max_length",...Ne(t),maximum:e})}function zd(e,t){return new Z3({check:"min_length",...Ne(t),minimum:e})}function jj(e,t){return new V3({check:"length_equals",...Ne(t),length:e})}function A4(e,t){return new Q3({check:"string_format",format:"regex",...Ne(t),pattern:e})}function T4(e){return new G3({check:"string_format",format:"lowercase",...Ne(e)})}function R4(e){return new K3({check:"string_format",format:"uppercase",...Ne(e)})}function z4(e,t){return new Y3({check:"string_format",format:"includes",...Ne(t),includes:e})}function O4(e,t){return new X3({check:"string_format",format:"starts_with",...Ne(t),prefix:e})}function M4(e,t){return new J3({check:"string_format",format:"ends_with",...Ne(t),suffix:e})}function Zs(e){return new W3({check:"overwrite",tx:e})}function D4(e){return Zs(t=>t.normalize(e))}function L4(){return Zs(e=>e.trim())}function I4(){return Zs(e=>e.toLowerCase())}function U4(){return Zs(e=>e.toUpperCase())}function P4(){return Zs(e=>QM(e))}function B4(e,t,n){return new e({type:"array",element:t,...Ne(n)})}function $4(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Ne(n)})}function F4(e){const t=q4(n=>(n.addIssue=a=>{if(typeof a=="string")n.issues.push(mu(a,n.value,t._zod.def));else{const l=a;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=n.value),l.inst??(l.inst=t),l.continue??(l.continue=!t._zod.def.abort),n.issues.push(mu(l))}},e(n.value,n)));return t}function q4(e,t){const n=new Hn({check:"custom",...Ne(t)});return n._zod.check=e,n}function Cj(e){let t=(e==null?void 0:e.target)??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:(e==null?void 0:e.metadata)??Wo,target:t,unrepresentable:(e==null?void 0:e.unrepresentable)??"throw",override:(e==null?void 0:e.override)??(()=>{}),io:(e==null?void 0:e.io)??"output",counter:0,seen:new Map,cycles:(e==null?void 0:e.cycles)??"ref",reused:(e==null?void 0:e.reused)??"inline",external:(e==null?void 0:e.external)??void 0}}function Qt(e,t,n={path:[],schemaPath:[]}){var g,y;var a;const l=e._zod.def,o=t.seen.get(e);if(o)return o.count++,n.schemaPath.includes(e)&&(o.cycle=n.path),o.schema;const u={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,u);const f=(y=(g=e._zod).toJSONSchema)==null?void 0:y.call(g);if(f)u.schema=f;else{const b={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,u.schema,b);else{const k=u.schema,j=t.processors[l.type];if(!j)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${l.type}`);j(e,t,k,b)}const S=e._zod.parent;S&&(u.ref||(u.ref=S),Qt(S,t,b),t.seen.get(S).isParent=!0)}const m=t.metadataRegistry.get(e);return m&&Object.assign(u.schema,m),t.io==="input"&&jn(e)&&(delete u.schema.examples,delete u.schema.default),t.io==="input"&&u.schema._prefault&&((a=u.schema).default??(a.default=u.schema._prefault)),delete u.schema._prefault,t.seen.get(e).schema}function Ej(e,t){var u,f,m,h;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=new Map;for(const g of e.seen.entries()){const y=(u=e.metadataRegistry.get(g[0]))==null?void 0:u.id;if(y){const b=a.get(y);if(b&&b!==g[0])throw new Error(`Duplicate schema id "${y}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(y,g[0])}}const l=g=>{var j;const y=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const E=(j=e.external.registry.get(g[0]))==null?void 0:j.id,C=e.external.uri??(O=>O);if(E)return{ref:C(E)};const T=g[1].defId??g[1].schema.id??`schema${e.counter++}`;return g[1].defId=T,{defId:T,ref:`${C("__shared")}#/${y}/${T}`}}if(g[1]===n)return{ref:"#"};const S=`#/${y}/`,k=g[1].schema.id??`__schema${e.counter++}`;return{defId:k,ref:S+k}},o=g=>{if(g[1].schema.$ref)return;const y=g[1],{ref:b,defId:S}=l(g);y.def={...y.schema},S&&(y.defId=S);const k=y.schema;for(const j in k)delete k[j];k.$ref=b};if(e.cycles==="throw")for(const g of e.seen.entries()){const y=g[1];if(y.cycle)throw new Error(`Cycle detected: #/${(f=y.cycle)==null?void 0:f.join("/")}/<root>
331
+
332
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const g of e.seen.entries()){const y=g[1];if(t===g[0]){o(g);continue}if(e.external){const S=(m=e.external.registry.get(g[0]))==null?void 0:m.id;if(t!==g[0]&&S){o(g);continue}}if((h=e.metadataRegistry.get(g[0]))==null?void 0:h.id){o(g);continue}if(y.cycle){o(g);continue}if(y.count>1&&e.reused==="ref"){o(g);continue}}}function Nj(e,t){var u,f,m;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=h=>{const g=e.seen.get(h);if(g.ref===null)return;const y=g.def??g.schema,b={...y},S=g.ref;if(g.ref=null,S){a(S);const j=e.seen.get(S),E=j.schema;if(E.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(y.allOf=y.allOf??[],y.allOf.push(E)):Object.assign(y,E),Object.assign(y,b),h._zod.parent===S)for(const T in y)T==="$ref"||T==="allOf"||T in b||delete y[T];if(E.$ref&&j.def)for(const T in y)T==="$ref"||T==="allOf"||T in j.def&&JSON.stringify(y[T])===JSON.stringify(j.def[T])&&delete y[T]}const k=h._zod.parent;if(k&&k!==S){a(k);const j=e.seen.get(k);if(j!=null&&j.schema.$ref&&(y.$ref=j.schema.$ref,j.def))for(const E in y)E==="$ref"||E==="allOf"||E in j.def&&JSON.stringify(y[E])===JSON.stringify(j.def[E])&&delete y[E]}e.override({zodSchema:h,jsonSchema:y,path:g.path??[]})};for(const h of[...e.seen.entries()].reverse())a(h[0]);const l={};if(e.target==="draft-2020-12"?l.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?l.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?l.$schema="http://json-schema.org/draft-04/schema#":e.target,(u=e.external)!=null&&u.uri){const h=(f=e.external.registry.get(t))==null?void 0:f.id;if(!h)throw new Error("Schema is missing an `id` property");l.$id=e.external.uri(h)}Object.assign(l,n.def??n.schema);const o=((m=e.external)==null?void 0:m.defs)??{};for(const h of e.seen.entries()){const g=h[1];g.def&&g.defId&&(o[g.defId]=g.def)}e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?l.$defs=o:l.definitions=o);try{const h=JSON.parse(JSON.stringify(l));return Object.defineProperty(h,"~standard",{value:{...t["~standard"],jsonSchema:{input:Od(t,"input",e.processors),output:Od(t,"output",e.processors)}},enumerable:!1,writable:!1}),h}catch{throw new Error("Error converting schema to JSON.")}}function jn(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const a=e._zod.def;if(a.type==="transform")return!0;if(a.type==="array")return jn(a.element,n);if(a.type==="set")return jn(a.valueType,n);if(a.type==="lazy")return jn(a.getter(),n);if(a.type==="promise"||a.type==="optional"||a.type==="nonoptional"||a.type==="nullable"||a.type==="readonly"||a.type==="default"||a.type==="prefault")return jn(a.innerType,n);if(a.type==="intersection")return jn(a.left,n)||jn(a.right,n);if(a.type==="record"||a.type==="map")return jn(a.keyType,n)||jn(a.valueType,n);if(a.type==="pipe")return jn(a.in,n)||jn(a.out,n);if(a.type==="object"){for(const l in a.shape)if(jn(a.shape[l],n))return!0;return!1}if(a.type==="union"){for(const l of a.options)if(jn(l,n))return!0;return!1}if(a.type==="tuple"){for(const l of a.items)if(jn(l,n))return!0;return!!(a.rest&&jn(a.rest,n))}return!1}const H4=(e,t={})=>n=>{const a=Cj({...n,processors:t});return Qt(e,a),Ej(a,e),Nj(a,e)},Od=(e,t,n={})=>a=>{const{libraryOptions:l,target:o}=a??{},u=Cj({...l??{},target:o,io:t,processors:n});return Qt(e,u),Ej(u,e),Nj(u,e)},Z4={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},V4=(e,t,n,a)=>{const l=n;l.type="string";const{minimum:o,maximum:u,format:f,patterns:m,contentEncoding:h}=e._zod.bag;if(typeof o=="number"&&(l.minLength=o),typeof u=="number"&&(l.maxLength=u),f&&(l.format=Z4[f]??f,l.format===""&&delete l.format,f==="time"&&delete l.format),h&&(l.contentEncoding=h),m&&m.size>0){const g=[...m];g.length===1?l.pattern=g[0].source:g.length>1&&(l.allOf=[...g.map(y=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:y.source}))])}},Q4=(e,t,n,a)=>{const l=n,{minimum:o,maximum:u,format:f,multipleOf:m,exclusiveMaximum:h,exclusiveMinimum:g}=e._zod.bag;typeof f=="string"&&f.includes("int")?l.type="integer":l.type="number",typeof g=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(l.minimum=g,l.exclusiveMinimum=!0):l.exclusiveMinimum=g),typeof o=="number"&&(l.minimum=o,typeof g=="number"&&t.target!=="draft-04"&&(g>=o?delete l.minimum:delete l.exclusiveMinimum)),typeof h=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(l.maximum=h,l.exclusiveMaximum=!0):l.exclusiveMaximum=h),typeof u=="number"&&(l.maximum=u,typeof h=="number"&&t.target!=="draft-04"&&(h<=u?delete l.maximum:delete l.exclusiveMaximum)),typeof m=="number"&&(l.multipleOf=m)},G4=(e,t,n,a)=>{n.type="boolean"},K4=(e,t,n,a)=>{n.not={}},Y4=(e,t,n,a)=>{},X4=(e,t,n,a)=>{const l=e._zod.def,o=aj(l.entries);o.every(u=>typeof u=="number")&&(n.type="number"),o.every(u=>typeof u=="string")&&(n.type="string"),n.enum=o},J4=(e,t,n,a)=>{const l=e._zod.def,o=[];for(const u of l.values)if(u===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof u=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(u))}else o.push(u);if(o.length!==0)if(o.length===1){const u=o[0];n.type=u===null?"null":typeof u,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[u]:n.const=u}else o.every(u=>typeof u=="number")&&(n.type="number"),o.every(u=>typeof u=="string")&&(n.type="string"),o.every(u=>typeof u=="boolean")&&(n.type="boolean"),o.every(u=>u===null)&&(n.type="null"),n.enum=o},W4=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},e5=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},t5=(e,t,n,a)=>{const l=n,o=e._zod.def,{minimum:u,maximum:f}=e._zod.bag;typeof u=="number"&&(l.minItems=u),typeof f=="number"&&(l.maxItems=f),l.type="array",l.items=Qt(o.element,t,{...a,path:[...a.path,"items"]})},n5=(e,t,n,a)=>{var h;const l=n,o=e._zod.def;l.type="object",l.properties={};const u=o.shape;for(const g in u)l.properties[g]=Qt(u[g],t,{...a,path:[...a.path,"properties",g]});const f=new Set(Object.keys(u)),m=new Set([...f].filter(g=>{const y=o.shape[g]._zod;return t.io==="input"?y.optin===void 0:y.optout===void 0}));m.size>0&&(l.required=Array.from(m)),((h=o.catchall)==null?void 0:h._zod.def.type)==="never"?l.additionalProperties=!1:o.catchall?o.catchall&&(l.additionalProperties=Qt(o.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(l.additionalProperties=!1)},r5=(e,t,n,a)=>{const l=e._zod.def,o=l.inclusive===!1,u=l.options.map((f,m)=>Qt(f,t,{...a,path:[...a.path,o?"oneOf":"anyOf",m]}));o?n.oneOf=u:n.anyOf=u},a5=(e,t,n,a)=>{const l=e._zod.def,o=Qt(l.left,t,{...a,path:[...a.path,"allOf",0]}),u=Qt(l.right,t,{...a,path:[...a.path,"allOf",1]}),f=h=>"allOf"in h&&Object.keys(h).length===1,m=[...f(o)?o.allOf:[o],...f(u)?u.allOf:[u]];n.allOf=m},i5=(e,t,n,a)=>{const l=n,o=e._zod.def;l.type="object";const u=o.keyType,f=u._zod.bag,m=f==null?void 0:f.patterns;if(o.mode==="loose"&&m&&m.size>0){const g=Qt(o.valueType,t,{...a,path:[...a.path,"patternProperties","*"]});l.patternProperties={};for(const y of m)l.patternProperties[y.source]=g}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(l.propertyNames=Qt(o.keyType,t,{...a,path:[...a.path,"propertyNames"]})),l.additionalProperties=Qt(o.valueType,t,{...a,path:[...a.path,"additionalProperties"]});const h=u._zod.values;if(h){const g=[...h].filter(y=>typeof y=="string"||typeof y=="number");g.length>0&&(l.required=g)}},l5=(e,t,n,a)=>{const l=e._zod.def,o=Qt(l.innerType,t,a),u=t.seen.get(e);t.target==="openapi-3.0"?(u.ref=l.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}]},s5=(e,t,n,a)=>{const l=e._zod.def;Qt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType},o5=(e,t,n,a)=>{const l=e._zod.def;Qt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType,n.default=JSON.parse(JSON.stringify(l.defaultValue))},u5=(e,t,n,a)=>{const l=e._zod.def;Qt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(l.defaultValue)))},c5=(e,t,n,a)=>{const l=e._zod.def;Qt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType;let u;try{u=l.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=u},d5=(e,t,n,a)=>{const l=e._zod.def,o=t.io==="input"?l.in._zod.def.type==="transform"?l.out:l.in:l.out;Qt(o,t,a);const u=t.seen.get(e);u.ref=o},f5=(e,t,n,a)=>{const l=e._zod.def;Qt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType,n.readOnly=!0},_j=(e,t,n,a)=>{const l=e._zod.def;Qt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType},h5=le("ZodISODateTime",(e,t)=>{hD.init(e,t),Ot.init(e,t)});function m5(e){return b4(h5,e)}const p5=le("ZodISODate",(e,t)=>{mD.init(e,t),Ot.init(e,t)});function g5(e){return x4(p5,e)}const y5=le("ZodISOTime",(e,t)=>{pD.init(e,t),Ot.init(e,t)});function v5(e){return S4(y5,e)}const b5=le("ZodISODuration",(e,t)=>{gD.init(e,t),Ot.init(e,t)});function x5(e){return w4(b5,e)}const S5=(e,t)=>{oj.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>l3(e,n)},flatten:{value:n=>i3(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Hp,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Hp,2)}},isEmpty:{get(){return e.issues.length===0}}})},xr=le("ZodError",S5,{Parent:Error}),w5=Ig(xr),k5=Ug(xr),j5=Wd(xr),C5=ef(xr),E5=u3(xr),N5=c3(xr),_5=d3(xr),A5=f3(xr),T5=h3(xr),R5=m3(xr),z5=p3(xr),O5=g3(xr),zt=le("ZodType",(e,t)=>(Rt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Od(e,"input"),output:Od(e,"output")}}),e.toJSONSchema=H4(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Ci(t,{checks:[...t.checks??[],...n.map(a=>typeof a=="function"?{_zod:{check:a,def:{check:"custom"},onattach:[]}}:a)]}),{parent:!0}),e.with=e.check,e.clone=(n,a)=>Ei(e,n,a),e.brand=()=>e,e.register=((n,a)=>(n.add(e,a),e)),e.parse=(n,a)=>w5(e,n,a,{callee:e.parse}),e.safeParse=(n,a)=>j5(e,n,a),e.parseAsync=async(n,a)=>k5(e,n,a,{callee:e.parseAsync}),e.safeParseAsync=async(n,a)=>C5(e,n,a),e.spa=e.safeParseAsync,e.encode=(n,a)=>E5(e,n,a),e.decode=(n,a)=>N5(e,n,a),e.encodeAsync=async(n,a)=>_5(e,n,a),e.decodeAsync=async(n,a)=>A5(e,n,a),e.safeEncode=(n,a)=>T5(e,n,a),e.safeDecode=(n,a)=>R5(e,n,a),e.safeEncodeAsync=async(n,a)=>z5(e,n,a),e.safeDecodeAsync=async(n,a)=>O5(e,n,a),e.refine=(n,a)=>e.check(EL(n,a)),e.superRefine=n=>e.check(NL(n)),e.overwrite=n=>e.check(Zs(n)),e.optional=()=>N1(e),e.exactOptional=()=>hL(e),e.nullable=()=>_1(e),e.nullish=()=>N1(_1(e)),e.nonoptional=n=>bL(e,n),e.array=()=>$n(e),e.or=n=>Rj([e,n]),e.and=n=>sL(e,n),e.transform=n=>A1(e,dL(n)),e.default=n=>gL(e,n),e.prefault=n=>vL(e,n),e.catch=n=>SL(e,n),e.pipe=n=>A1(e,n),e.readonly=()=>jL(e),e.describe=n=>{const a=e.clone();return Wo.add(a,{description:n}),a},Object.defineProperty(e,"description",{get(){var n;return(n=Wo.get(e))==null?void 0:n.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Wo.get(e);const a=e.clone();return Wo.add(a,n[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),Aj=le("_ZodString",(e,t)=>{Pg.init(e,t),zt.init(e,t),e._zod.processJSONSchema=(a,l,o)=>V4(e,a,l);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...a)=>e.check(A4(...a)),e.includes=(...a)=>e.check(z4(...a)),e.startsWith=(...a)=>e.check(O4(...a)),e.endsWith=(...a)=>e.check(M4(...a)),e.min=(...a)=>e.check(zd(...a)),e.max=(...a)=>e.check(kj(...a)),e.length=(...a)=>e.check(jj(...a)),e.nonempty=(...a)=>e.check(zd(1,...a)),e.lowercase=a=>e.check(T4(a)),e.uppercase=a=>e.check(R4(a)),e.trim=()=>e.check(L4()),e.normalize=(...a)=>e.check(D4(...a)),e.toLowerCase=()=>e.check(I4()),e.toUpperCase=()=>e.check(U4()),e.slugify=()=>e.check(P4())}),M5=le("ZodString",(e,t)=>{Pg.init(e,t),Aj.init(e,t),e.email=n=>e.check(JD(D5,n)),e.url=n=>e.check(r4(L5,n)),e.jwt=n=>e.check(v4(X5,n)),e.emoji=n=>e.check(a4(I5,n)),e.guid=n=>e.check(S1(C1,n)),e.uuid=n=>e.check(WD(sd,n)),e.uuidv4=n=>e.check(e4(sd,n)),e.uuidv6=n=>e.check(t4(sd,n)),e.uuidv7=n=>e.check(n4(sd,n)),e.nanoid=n=>e.check(i4(U5,n)),e.guid=n=>e.check(S1(C1,n)),e.cuid=n=>e.check(l4(P5,n)),e.cuid2=n=>e.check(s4(B5,n)),e.ulid=n=>e.check(o4($5,n)),e.base64=n=>e.check(p4(G5,n)),e.base64url=n=>e.check(g4(K5,n)),e.xid=n=>e.check(u4(F5,n)),e.ksuid=n=>e.check(c4(q5,n)),e.ipv4=n=>e.check(d4(H5,n)),e.ipv6=n=>e.check(f4(Z5,n)),e.cidrv4=n=>e.check(h4(V5,n)),e.cidrv6=n=>e.check(m4(Q5,n)),e.e164=n=>e.check(y4(Y5,n)),e.datetime=n=>e.check(m5(n)),e.date=n=>e.check(g5(n)),e.time=n=>e.check(v5(n)),e.duration=n=>e.check(x5(n))});function z(e){return XD(M5,e)}const Ot=le("ZodStringFormat",(e,t)=>{Tt.init(e,t),Aj.init(e,t)}),D5=le("ZodEmail",(e,t)=>{aD.init(e,t),Ot.init(e,t)}),C1=le("ZodGUID",(e,t)=>{nD.init(e,t),Ot.init(e,t)}),sd=le("ZodUUID",(e,t)=>{rD.init(e,t),Ot.init(e,t)}),L5=le("ZodURL",(e,t)=>{iD.init(e,t),Ot.init(e,t)}),I5=le("ZodEmoji",(e,t)=>{lD.init(e,t),Ot.init(e,t)}),U5=le("ZodNanoID",(e,t)=>{sD.init(e,t),Ot.init(e,t)}),P5=le("ZodCUID",(e,t)=>{oD.init(e,t),Ot.init(e,t)}),B5=le("ZodCUID2",(e,t)=>{uD.init(e,t),Ot.init(e,t)}),$5=le("ZodULID",(e,t)=>{cD.init(e,t),Ot.init(e,t)}),F5=le("ZodXID",(e,t)=>{dD.init(e,t),Ot.init(e,t)}),q5=le("ZodKSUID",(e,t)=>{fD.init(e,t),Ot.init(e,t)}),H5=le("ZodIPv4",(e,t)=>{yD.init(e,t),Ot.init(e,t)}),Z5=le("ZodIPv6",(e,t)=>{vD.init(e,t),Ot.init(e,t)}),V5=le("ZodCIDRv4",(e,t)=>{bD.init(e,t),Ot.init(e,t)}),Q5=le("ZodCIDRv6",(e,t)=>{xD.init(e,t),Ot.init(e,t)}),G5=le("ZodBase64",(e,t)=>{SD.init(e,t),Ot.init(e,t)}),K5=le("ZodBase64URL",(e,t)=>{kD.init(e,t),Ot.init(e,t)}),Y5=le("ZodE164",(e,t)=>{jD.init(e,t),Ot.init(e,t)}),X5=le("ZodJWT",(e,t)=>{ED.init(e,t),Ot.init(e,t)}),Bg=le("ZodNumber",(e,t)=>{vj.init(e,t),zt.init(e,t),e._zod.processJSONSchema=(a,l,o)=>Q4(e,a,l),e.gt=(a,l)=>e.check(k1(a,l)),e.gte=(a,l)=>e.check(Qm(a,l)),e.min=(a,l)=>e.check(Qm(a,l)),e.lt=(a,l)=>e.check(w1(a,l)),e.lte=(a,l)=>e.check(Vm(a,l)),e.max=(a,l)=>e.check(Vm(a,l)),e.int=a=>e.check(E1(a)),e.safe=a=>e.check(E1(a)),e.positive=a=>e.check(k1(0,a)),e.nonnegative=a=>e.check(Qm(0,a)),e.negative=a=>e.check(w1(0,a)),e.nonpositive=a=>e.check(Vm(0,a)),e.multipleOf=(a,l)=>e.check(j1(a,l)),e.step=(a,l)=>e.check(j1(a,l)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Qe(e){return k4(Bg,e)}const J5=le("ZodNumberFormat",(e,t)=>{ND.init(e,t),Bg.init(e,t)});function E1(e){return C4(J5,e)}const W5=le("ZodBoolean",(e,t)=>{_D.init(e,t),zt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>G4(e,n,a)});function Ru(e){return E4(W5,e)}const eL=le("ZodUnknown",(e,t)=>{AD.init(e,t),zt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>Y4()});function xt(){return N4(eL)}const tL=le("ZodNever",(e,t)=>{TD.init(e,t),zt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>K4(e,n,a)});function nL(e){return _4(tL,e)}const rL=le("ZodArray",(e,t)=>{RD.init(e,t),zt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>t5(e,n,a,l),e.element=t.element,e.min=(n,a)=>e.check(zd(n,a)),e.nonempty=n=>e.check(zd(1,n)),e.max=(n,a)=>e.check(kj(n,a)),e.length=(n,a)=>e.check(jj(n,a)),e.unwrap=()=>e.element});function $n(e,t){return B4(rL,e,t)}const aL=le("ZodObject",(e,t)=>{OD.init(e,t),zt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>n5(e,n,a,l),ft(e,"shape",()=>t.shape),e.keyof=()=>We(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:xt()}),e.loose=()=>e.clone({...e._zod.def,catchall:xt()}),e.strict=()=>e.clone({...e._zod.def,catchall:nL()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>e3(e,n),e.safeExtend=n=>t3(e,n),e.merge=n=>n3(e,n),e.pick=n=>JM(e,n),e.omit=n=>WM(e,n),e.partial=(...n)=>r3(Oj,e,n[0]),e.required=(...n)=>a3(Mj,e,n[0])});function fe(e,t){const n={type:"object",shape:e??{},...Ne(t)};return new aL(n)}const Tj=le("ZodUnion",(e,t)=>{Sj.init(e,t),zt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>r5(e,n,a,l),e.options=t.options});function Rj(e,t){return new Tj({type:"union",options:e,...Ne(t)})}const iL=le("ZodDiscriminatedUnion",(e,t)=>{Tj.init(e,t),MD.init(e,t)});function zj(e,t,n){return new iL({type:"union",options:t,discriminator:e,...Ne(n)})}const lL=le("ZodIntersection",(e,t)=>{DD.init(e,t),zt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>a5(e,n,a,l)});function sL(e,t){return new lL({type:"intersection",left:e,right:t})}const oL=le("ZodRecord",(e,t)=>{LD.init(e,t),zt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>i5(e,n,a,l),e.keyType=t.keyType,e.valueType=t.valueType});function $t(e,t,n){return new oL({type:"record",keyType:e,valueType:t,...Ne(n)})}const Vp=le("ZodEnum",(e,t)=>{ID.init(e,t),zt.init(e,t),e._zod.processJSONSchema=(a,l,o)=>X4(e,a,l),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(a,l)=>{const o={};for(const u of a)if(n.has(u))o[u]=t.entries[u];else throw new Error(`Key ${u} not found in enum`);return new Vp({...t,checks:[],...Ne(l),entries:o})},e.exclude=(a,l)=>{const o={...t.entries};for(const u of a)if(n.has(u))delete o[u];else throw new Error(`Key ${u} not found in enum`);return new Vp({...t,checks:[],...Ne(l),entries:o})}});function We(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new Vp({type:"enum",entries:n,...Ne(t)})}const uL=le("ZodLiteral",(e,t)=>{UD.init(e,t),zt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>J4(e,n,a),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Nn(e,t){return new uL({type:"literal",values:Array.isArray(e)?e:[e],...Ne(t)})}const cL=le("ZodTransform",(e,t)=>{PD.init(e,t),zt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>e5(e,n),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new nj(e.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(mu(o,n.value,t));else{const u=o;u.fatal&&(u.continue=!1),u.code??(u.code="custom"),u.input??(u.input=n.value),u.inst??(u.inst=e),n.issues.push(mu(u))}};const l=t.transform(n.value,n);return l instanceof Promise?l.then(o=>(n.value=o,n)):(n.value=l,n)}});function dL(e){return new cL({type:"transform",transform:e})}const Oj=le("ZodOptional",(e,t)=>{wj.init(e,t),zt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>_j(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function N1(e){return new Oj({type:"optional",innerType:e})}const fL=le("ZodExactOptional",(e,t)=>{BD.init(e,t),zt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>_j(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function hL(e){return new fL({type:"optional",innerType:e})}const mL=le("ZodNullable",(e,t)=>{$D.init(e,t),zt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>l5(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function _1(e){return new mL({type:"nullable",innerType:e})}const pL=le("ZodDefault",(e,t)=>{FD.init(e,t),zt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>o5(e,n,a,l),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function gL(e,t){return new pL({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():lj(t)}})}const yL=le("ZodPrefault",(e,t)=>{qD.init(e,t),zt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>u5(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function vL(e,t){return new yL({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():lj(t)}})}const Mj=le("ZodNonOptional",(e,t)=>{HD.init(e,t),zt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>s5(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function bL(e,t){return new Mj({type:"nonoptional",innerType:e,...Ne(t)})}const xL=le("ZodCatch",(e,t)=>{ZD.init(e,t),zt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>c5(e,n,a,l),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function SL(e,t){return new xL({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const wL=le("ZodPipe",(e,t)=>{VD.init(e,t),zt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>d5(e,n,a,l),e.in=t.in,e.out=t.out});function A1(e,t){return new wL({type:"pipe",in:e,out:t})}const kL=le("ZodReadonly",(e,t)=>{QD.init(e,t),zt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>f5(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function jL(e){return new kL({type:"readonly",innerType:e})}const CL=le("ZodCustom",(e,t)=>{GD.init(e,t),zt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>W4(e,n)});function EL(e,t={}){return $4(CL,e,t)}function NL(e){return F4(e)}const Gm={custom:"custom"};function nf(e){return j4(Bg,e)}const _L=new RegExp("(?<![A-Za-z0-9_.@-])@([A-Za-z0-9][A-Za-z0-9_-]{0,63})\\b","g");function AL(e){return e.replace(/```[\s\S]*?```/g,"").replace(/~~~[\s\S]*?~~~/g,"").replace(/`[^`\n]+`/g,"")}function TL(e,t){const n=AL(e),a=new Map;for(const o of t)o.name&&a.set(o.name.toLowerCase(),o.agentId);if(a.size===0)return[];const l=new Set;for(const o of n.matchAll(_L)){const u=o[1];if(!u)continue;const f=a.get(u.toLowerCase());f&&l.add(f)}return[...l]}const RL={FEISHU:"feishu",SLACK:"slack",KAEL:"kael"},Dj=We(["feishu","slack","kael"]),Lj=We(["active","inactive"]);fe({platform:Dj,agentId:z().min(1),credentials:$t(z(),xt()),status:Lj.default("active")});fe({agentId:z().min(1).optional(),credentials:$t(z(),xt()).optional(),status:Lj.optional()});fe({id:Qe(),platform:z(),agentId:z(),hasCredentials:Ru(),status:z(),createdAt:z(),updatedAt:z()});const zL=We(["code","reverse_token","oauth","manual"]);fe({appId:z().min(1),appSecret:z().min(1)});fe({platform:Dj,externalUserId:z().min(1),agentId:z().min(1),boundVia:zL.default("manual"),displayName:z().max(200).optional()});fe({id:Qe(),platform:z(),externalUserId:z(),agentId:z(),boundVia:z().nullable(),displayName:z().nullable(),createdAt:z()});fe({feishuUserId:z().min(1),displayName:z().max(200).optional()});fe({configId:Qe(),platform:z(),agentId:z(),appId:z(),connected:Ru(),lastActiveAt:z().nullable()});const Ij=We(["online","offline"]),Uj=We(["idle","working","blocked","error"]);We(["active","suspended","evicted"]);const OL=We(["active","suspended"]);fe({chatId:z().min(1),state:OL});fe({runtimeState:Uj});fe({agentId:z().min(1),runtimeType:z().max(50),runtimeVersion:z().max(50).optional()});We(["wrong_client","not_owned","agent_suspended","wrong_org","unknown_agent"]);fe({agentId:z(),status:Ij,connectedAt:z().nullable(),lastSeenAt:z(),clientId:z().nullable().optional(),runtimeType:z().nullable().optional(),runtimeVersion:z().nullable().optional(),runtimeState:Uj.nullable().optional(),activeSessions:Qe().int().nullable().optional(),totalSessions:Qe().int().nullable().optional(),runtimeUpdatedAt:z().nullable().optional()});fe({total:Qe().int(),running:Qe().int(),byState:fe({idle:Qe().int(),working:Qe().int(),blocked:Qe().int(),error:Qe().int()}),clients:Qe().int()});const ML={HUMAN:"human",PERSONAL_ASSISTANT:"personal_assistant",AUTONOMOUS_AGENT:"autonomous_agent"},rf=We(["human","personal_assistant","autonomous_agent"]),T1={PRIVATE:"private",ORGANIZATION:"organization"},$g=We(["private","organization"]),DL=We(["admin-api","portal"]);We(["active","suspended"]);const Qp=/^[a-z0-9][a-z0-9_-]{0,63}$/,gs=64,LL=["admin","agent","first-tree","hub","me","null","system","undefined"],IL=new Set(LL);function Gp(e){return IL.has(e)}fe({name:z().min(1).max(64).regex(Qp,"Must start with a letter or digit and contain only lowercase letters, digits, hyphens (-), and underscores (_). Max 64 chars.").refine(e=>!Gp(e),{message:"That agent name is reserved — pick a different one."}).optional(),type:rf,displayName:z().min(1).max(200).optional(),delegateMention:z().max(100).optional(),organizationId:z().max(100).optional(),source:DL.optional(),visibility:$g.optional(),metadata:$t(z(),xt()).optional(),managerId:z().optional(),clientId:z().min(1).max(100).optional()});fe({type:rf.optional(),displayName:z().min(1).max(200).optional(),delegateMention:z().max(100).nullable().optional(),visibility:$g.optional(),metadata:$t(z(),xt()).optional(),managerId:z().nullable().optional(),clientId:z().min(1).max(100).nullable().optional()});fe({uuid:z(),name:z().nullable(),organizationId:z(),type:rf,displayName:z(),delegateMention:z().nullable(),inboxId:z(),status:z(),source:z().nullable().optional(),visibility:$g,metadata:$t(z(),xt()),managerId:z().nullable(),clientId:z().nullable(),presenceStatus:Ij.optional(),createdAt:z(),updatedAt:z()});fe({repo:z().nullable(),branch:z().nullable()});fe({type:Nn("agent:pinned"),agentId:z(),name:z().nullable(),displayName:z(),agentType:rf});const UL=32e3,Fg=/^[a-z0-9][a-z0-9_-]{0,63}$/i,PL=/^[A-Z][A-Z0-9_]*$/,BL=fe({append:z().max(UL).default("")}),$L=fe({name:z().regex(Fg,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:Nn("stdio"),command:z().min(1),args:$n(z()).optional()}),FL=fe({name:z().regex(Fg,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:Nn("http"),url:z().url(),headers:$t(z(),z()).optional()}),qL=fe({name:z().regex(Fg,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:Nn("sse"),url:z().url(),headers:$t(z(),z()).optional()}),HL=zj("transport",[$L,FL,qL]),ZL=fe({key:z().regex(PL,"Env key must match /^[A-Z][A-Z0-9_]*$/"),value:z(),sensitive:Ru().default(!1)}),VL=fe({url:z().min(1),ref:z().min(1).optional(),localPath:z().min(1).optional()}),qg=fe({prompt:BL.default({append:""}),model:z().default("opus"),mcpServers:$n(HL).default([]),env:$n(ZL).default([]),gitRepos:$n(VL).default([])}),QL=(e,t)=>{const n=new Set;e.mcpServers.forEach((o,u)=>{const f=o.name.toLowerCase();n.has(f)&&t.addIssue({code:Gm.custom,path:["mcpServers",u,"name"],message:`Duplicate MCP server name "${o.name}"`}),n.add(f)});const a=new Set;e.env.forEach((o,u)=>{a.has(o.key)&&t.addIssue({code:Gm.custom,path:["env",u,"key"],message:`Duplicate env key "${o.key}"`}),a.add(o.key)});const l=new Set;e.gitRepos.forEach((o,u)=>{const f=o.localPath??Dd(o.url);f&&(l.has(f)&&t.addIssue({code:Gm.custom,path:["gitRepos",u,"localPath"],message:`Duplicate git repo local path "${f}"`}),l.add(f))})},Pj=qg.superRefine(QL),GL=fe({agentId:z(),version:Qe().int().positive(),payload:Pj,updatedAt:z(),updatedBy:z()});fe({expectedVersion:Qe().int().positive(),payload:qg.partial()});fe({payload:qg.partial()});fe({current:GL,next:Pj,diff:$n(fe({path:z(),op:We(["add","remove","replace"]),before:xt().optional(),after:xt().optional()}))});const Md="***";function Dd(e){const t=e.trim();return t?((t.split(/[?#]/)[0]??"").split(/[/:]/).filter(Boolean).pop()??"").replace(/\.git$/i,""):""}fe({username:z().min(1),password:z().min(1)});fe({accessToken:z(),refreshToken:z()});fe({refreshToken:z().min(1)});fe({token:z().min(1)});fe({token:z(),expiresIn:Qe(),command:z()});const KL=We(["direct","group","thread"]);fe({type:KL,topic:z().max(500).optional(),participantIds:$n(z()).min(1),metadata:$t(z(),xt()).optional()});const Bj=fe({agentId:z(),role:z(),mode:z(),joinedAt:z()});Bj.extend({name:z().nullable(),displayName:z(),type:z()});const YL=fe({id:z(),organizationId:z(),type:z(),topic:z().nullable(),lifecyclePolicy:z().nullable().optional(),metadata:$t(z(),xt()),createdAt:z(),updatedAt:z()});YL.extend({participants:$n(Bj)});fe({topic:z().trim().max(500).nullable()});fe({agentId:z().min(1),mode:We(["full","mention_only"]).default("full")});fe({agentId:z().min(1)});const XL=We(["connected","disconnected"]);fe({id:z(),userId:z().nullable(),status:XL,sdkVersion:z().max(50).nullable(),hostname:z().max(100).nullable(),os:z().max(50).nullable(),agentCount:Qe().int().min(0),connectedAt:z().nullable(),lastSeenAt:z(),metadata:$t(z(),xt()).nullable()});fe({clientId:z().min(1).max(100),hostname:z().max(100).optional(),os:z().max(50).optional(),sdkVersion:z().max(50).optional()});fe({limit:nf().int().min(1).max(100).default(20),cursor:z().optional()});const JL=["image/png","image/jpeg","image/gif","image/webp"],Hg=We(JL);fe({data:z().min(1),mimeType:Hg,filename:z().min(1),size:Qe().int().nonnegative().optional(),imageId:z().uuid().optional()});fe({imageId:z().uuid(),mimeType:Hg,filename:z().min(1),size:Qe().int().nonnegative().optional()});fe({type:Nn("image_payload"),imageId:z().uuid(),chatId:z(),base64:z().min(1),mimeType:Hg,filename:z().min(1),size:Qe().int().nonnegative().optional()});const Zg=We(["hub_ui","cli","feishu","github","api"]),$j=We(["text","markdown","card","reference","file","task"]);fe({format:$j.default("text"),content:xt(),metadata:$t(z(),xt()).optional(),inReplyTo:z().optional(),replyToInbox:z().optional(),replyToChat:z().optional(),source:Zg.optional()});fe({format:$j.default("text"),content:xt(),metadata:$t(z(),xt()).optional(),replyToInbox:z().optional(),replyToChat:z().optional(),source:Zg.optional()});const WL=fe({id:z(),chatId:z(),senderId:z(),format:z(),content:xt(),metadata:$t(z(),xt()),replyToInbox:z().nullable(),replyToChat:z().nullable(),inReplyTo:z().nullable(),source:Zg.nullable(),createdAt:z()}),e6=fe({senderId:z(),chatId:z(),replyToChat:z().nullable()}).nullable(),t6=We(["full","mention_only"]),n6=fe({id:z(),senderId:z(),format:z(),content:xt(),metadata:$t(z(),xt()).default({}),createdAt:z()}),r6=WL.extend({configVersion:Qe().int().positive(),recipientMode:t6.default("full"),inReplyToSnapshot:e6.default(null),precedingMessages:$n(n6).default([])});We(["pending","delivered","acked","failed"]);const a6=fe({id:Qe(),inboxId:z(),messageId:z(),chatId:z().nullable(),status:z(),retryCount:Qe(),createdAt:z(),deliveredAt:z().nullable(),ackedAt:z().nullable()});a6.extend({message:r6});fe({limit:nf().int().min(1).max(50).default(10)});const i6={ADMIN:"admin",MEMBER:"member"},Vg=We(["admin","member"]),l6=fe({id:z(),userId:z(),organizationId:z(),agentId:z(),role:Vg,createdAt:z()});fe({username:z().min(1).max(100),displayName:z().min(1).max(200),role:Vg.default("member")});fe({role:Vg.optional(),displayName:z().min(1).max(200).optional()});l6.extend({username:z(),displayName:z(),password:z()});const s6=We(["agent_error","session_error","agent_needs_decision","agent_blocked","agent_stale","agent_disconnected","agent_connected","session_completed"]),Fj=We(["high","medium","low"]);fe({id:z(),organizationId:z(),type:s6,severity:Fj,agentId:z().nullable(),chatId:z().nullable(),message:z(),read:Ru(),createdAt:z()});fe({limit:nf().int().min(1).max(100).default(20),cursor:z().optional(),severity:Fj.optional(),read:We(["true","false"]).transform(e=>e==="true").optional(),agentId:z().optional()});const qj=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;fe({name:z().min(2).max(50).regex(/^[a-z0-9][a-z0-9-]*$/,"Must start with a letter or digit and contain only lowercase alphanumeric and hyphens").refine(e=>!qj.test(e),"Name must not be a UUID format"),displayName:z().min(1).max(200),maxAgents:Qe().int().min(0).default(0),maxMessagesPerMinute:Qe().int().min(0).default(0),features:$t(z(),xt()).default({})});fe({name:z().min(2).max(50).regex(/^[a-z0-9][a-z0-9-]*$/,"Must start with a letter or digit and contain only lowercase alphanumeric and hyphens").refine(e=>!qj.test(e),"Name must not be a UUID format").optional(),displayName:z().min(1).max(200).optional(),maxAgents:Qe().int().min(0).optional(),maxMessagesPerMinute:Qe().int().min(0).optional(),features:$t(z(),xt()).optional()});fe({id:z(),name:z(),displayName:z(),maxAgents:Qe(),maxMessagesPerMinute:Qe(),features:$t(z(),xt()),createdAt:z(),updatedAt:z()});const o6=fe({workingCount:Qe().int().nonnegative(),errorMask:Ru()}),u6=fe({type:Nn("pulse:tick"),organizationId:z(),agents:$t(z(),$n(o6).length(32))}),c6=We(["tool_call","error","assistant_text","thinking","turn_end"]),Hj=fe({toolUseId:z(),name:z(),args:xt(),status:We(["pending","ok","error"]),durationMs:Qe().int().nonnegative().optional(),resultPreview:z().max(400).optional()}),Zj=fe({source:We(["sdk","runtime","tool"]),message:z().max(2e3)}),Vj=fe({text:z().max(8e3)}),Qj=fe({}),Gj=fe({status:We(["success","error"])}),d6=zj("kind",[fe({kind:Nn("tool_call"),payload:Hj}),fe({kind:Nn("error"),payload:Zj}),fe({kind:Nn("assistant_text"),payload:Vj}),fe({kind:Nn("thinking"),payload:Qj}),fe({kind:Nn("turn_end"),payload:Gj})]);fe({id:z(),agentId:z(),chatId:z(),seq:Qe().int().positive(),kind:c6,payload:Rj([Hj,Zj,Vj,Qj,Gj]),createdAt:z()});fe({agentId:z(),chatId:z(),event:d6});fe({agentId:z(),chatId:z()});fe({type:Nn("session:reconcile"),agentId:z().min(1),chatIds:$n(z().min(1)).max(500)});fe({type:Nn("session:reconcile:result"),agentId:z().min(1),staleChatIds:$n(z().min(1))});const f6=fe({organizationId:z(),agentCount:Qe(),chatCount:Qe(),messageCount:Qe()});fe({totalAgents:Qe(),totalChats:Qe(),totalMessages:Qe(),byOrganization:$n(f6)});fe({key:z(),value:xt(),updatedAt:z()});$t(z(),xt());const pi={INBOX_TIMEOUT_SECONDS:"inbox_timeout_seconds",MAX_RETRY_COUNT:"max_retry_count",POLLING_INTERVAL_SECONDS:"polling_interval_seconds",PRESENCE_CLEANUP_SECONDS:"presence_cleanup_seconds"},wd={[pi.INBOX_TIMEOUT_SECONDS]:300,[pi.MAX_RETRY_COUNT]:3,[pi.POLLING_INTERVAL_SECONDS]:5,[pi.PRESENCE_CLEANUP_SECONDS]:60},pu=We(["pending","assigned","working","completed","failed","cancelled"]),R1=We(["agent","admin"]),h6=We(["assigned","status_changed","cancelled"]);fe({taskId:z(),event:h6,title:z(),body:z().default(""),status:pu,fromStatus:pu.optional(),originRef:z().nullable().optional()});const m6=fe({title:z().min(1).max(500),body:z().optional(),assigneeAgentId:z().optional(),originRef:z().max(500).optional(),metadata:$t(z(),xt()).optional()});m6.extend({organizationId:z().optional()});fe({status:We(["working","completed","failed"]),result:z().optional()});fe({assigneeAgentId:z().nullable().optional(),status:pu.optional(),result:z().optional()});fe({chatId:z().min(1)});const p6=fe({id:z(),organizationId:z(),title:z(),body:z(),status:pu,assigneeAgentId:z().nullable(),createdByType:R1,createdById:z(),originRef:z().nullable(),result:z().nullable(),metadata:$t(z(),xt()),createdAt:z(),updatedAt:z(),cancelledAt:z().nullable(),cancelledByType:R1.nullable(),cancelledById:z().nullable()}),g6=fe({taskId:z(),chatId:z(),linkedByAgentId:z().nullable(),linkedAt:z()});p6.extend({chats:$n(g6)});fe({status:pu.optional(),assigneeAgentId:z().optional(),originRef:z().optional(),limit:nf().int().min(1).max(100).default(20),cursor:z().optional()});const y6=We(["normal","idle_island","awaiting_reply","no_chat","not_applicable"]);fe({taskId:z(),signal:y6,reason:z()});const v6=We(["active","suspended"]);fe({id:z(),username:z(),displayName:z(),avatarUrl:z().nullable(),status:v6,createdAt:z(),updatedAt:z()});fe({username:z().min(1).max(100),displayName:z().min(1).max(200),password:z().min(8).max(200)});fe({displayName:z().min(1).max(200).optional(),password:z().min(8).max(200).optional()});fe({type:Nn("auth"),token:z().min(1)});fe({type:Nn("server:welcome"),serverCommandVersion:z().min(1),serverTimeMs:Qe().int().nonnegative()}).passthrough();const Kj=Array.from({length:32},()=>({workingCount:0,errorMask:!1}));function b6(e){const t=Array.from({length:32},()=>({workingCount:0,errorMask:!1}));for(const n of Object.values(e))for(let a=0;a<32&&a<n.length;a++){const l=n[a],o=t[a];!l||!o||(o.workingCount+=l.workingCount,o.errorMask=o.errorMask||l.errorMask)}return t}const x6=2e3,S6=3e4;let ii=null,Ld=!1,Km=0,nu=null;const Kp=new Set;let eu=null,ys=0;function w6(e){for(const t of Kp)try{t(e)}catch{}eu&&(e.type==="notification"?eu.invalidateQueries({queryKey:["notifications"]}):e.type==="session:state"&&(eu.invalidateQueries({queryKey:["activity"]}),eu.invalidateQueries({queryKey:["sessions"]})))}function Yj(){const e=jg();if(!(e!=null&&e.accessToken))return;const n=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/v1/ws/admin?token=${e.accessToken}`,a=new WebSocket(n);ii=a,a.onmessage=l=>{if(a===ii)try{const o=JSON.parse(l.data);w6(o)}catch{}},a.onopen=()=>{a===ii&&(Km=0)},a.onclose=()=>{if(a!==ii||(ii=null,Ld||ys===0))return;Km++;const l=Math.min(x6*2**(Km-1),S6);nu=setTimeout(()=>{nu=null,!Ld&&ys>0&&Yj()},l)}}function k6(){Ld=!0,nu&&(clearTimeout(nu),nu=null),ii&&(ii.close(1e3,"unmount"),ii=null)}function Xj(e){const{onMessage:t,enabled:n=!0}=e??{},a=Fn(),l=x.useRef(t);l.current=t,x.useEffect(()=>{eu=a},[a]),x.useEffect(()=>{if(!n)return;const o=u=>{var f;return(f=l.current)==null?void 0:f.call(l,u)};return Kp.add(o),ys++,ys===1&&(Ld=!1,Yj()),()=>{Kp.delete(o),ys--,ys===0&&k6()}},[n])}const Jj=x.createContext({aggregated:Kj,agents:{},receivedAtMs:null,stale:!0});function j6({children:e}){const[t,n]=x.useState({aggregated:Kj,agents:{},receivedAtMs:null}),[a,l]=x.useState(()=>Date.now());Xj({onMessage:u=>{const f=u6.safeParse(u);f.success&&n({aggregated:b6(f.data.agents),agents:f.data.agents,receivedAtMs:Date.now()})}}),x.useEffect(()=>{const u=setInterval(()=>l(Date.now()),1e4);return()=>clearInterval(u)},[]);const o=x.useMemo(()=>({...t,stale:t.receivedAtMs===null||a-t.receivedAtMs>3e4}),[t,a]);return d.jsx(Jj.Provider,{value:o,children:e})}function C6(){return x.useContext(Jj)}function af({title:e,subtitle:t,right:n,className:a,style:l,...o}){return d.jsxs("div",{className:Ee("flex items-baseline gap-3 shrink-0",a),style:{padding:"var(--sp-3) var(--sp-5) var(--sp-2_5)",borderBottom:"var(--hairline) solid var(--border-faint)",background:"var(--bg-raised)",...l},...o,children:[d.jsx("h1",{className:"m-0 text-title",style:{color:"var(--fg)"},children:e}),t&&d.jsx("span",{className:"text-label",style:{color:"var(--fg-3)"},children:t}),d.jsx("div",{style:{flex:1}}),n]})}function Wj({className:e,style:t,...n}){return d.jsx("div",{className:Ee("flex items-end",e),style:{gap:2,height:34,padding:"0 var(--sp-5)",borderBottom:"var(--hairline) solid var(--border)",background:"var(--bg-raised)",...t},...n})}function eC({active:e,onClick:t,children:n}){return d.jsx("button",{type:"button",onClick:t,className:"inline-flex items-center gap-1.5 bg-transparent text-body font-medium",style:{padding:"var(--sp-1_75) var(--sp-3)",marginBottom:-1,borderBottom:`var(--hairline-bold) solid ${e?"var(--accent)":"transparent"}`,color:e?"var(--fg)":"var(--fg-3)",cursor:"pointer",transition:"color 0.12s"},onMouseEnter:a=>{e||(a.currentTarget.style.color="var(--fg)")},onMouseLeave:a=>{e||(a.currentTarget.style.color="var(--fg-3)")},children:n})}const E6={neutral:{bg:"var(--bg-sunken)",fg:"var(--fg-2)",bd:"var(--border)"},accent:{bg:"var(--accent-bg)",fg:"var(--accent-dim)",bd:"color-mix(in oklch, var(--accent) 30%, transparent)"},warn:{bg:"color-mix(in oklch, var(--state-blocked) 16%, transparent)",fg:"color-mix(in oklch, var(--state-blocked) 50%, var(--fg))",bd:"color-mix(in oklch, var(--state-blocked) 30%, transparent)"},error:{bg:"color-mix(in oklch, var(--state-error) 14%, transparent)",fg:"var(--state-error)",bd:"color-mix(in oklch, var(--state-error) 30%, transparent)"},outline:{bg:"transparent",fg:"var(--fg-3)",bd:"var(--border)"},idle:{bg:"color-mix(in oklch, var(--state-idle) 14%, transparent)",fg:"var(--state-idle)",bd:"color-mix(in oklch, var(--state-idle) 30%, transparent)"},working:{bg:"color-mix(in oklch, var(--state-working) 14%, transparent)",fg:"var(--state-working)",bd:"color-mix(in oklch, var(--state-working) 30%, transparent)"},blocked:{bg:"color-mix(in oklch, var(--state-blocked) 14%, transparent)",fg:"color-mix(in oklch, var(--state-blocked) 50%, var(--fg))",bd:"color-mix(in oklch, var(--state-blocked) 30%, transparent)"},offline:{bg:"color-mix(in oklch, var(--state-offline) 14%, transparent)",fg:"var(--state-offline)",bd:"color-mix(in oklch, var(--state-offline) 30%, transparent)"}};function pn({tone:e="neutral",className:t,style:n,...a}){const l=E6[e],o={background:l.bg,color:l.fg,border:`var(--hairline) solid ${l.bd}`,...n};return d.jsx("span",{className:Ee("mono inline-flex items-center uppercase text-caption leading-[1.6]",t),style:{padding:"var(--hairline) var(--sp-1_75)",borderRadius:"var(--radius-chip)",...o},...a})}const dl=x.forwardRef(({className:e,...t},n)=>d.jsx("table",{ref:n,className:Ee("w-full",e),style:{borderCollapse:"separate",borderSpacing:0},...t}));dl.displayName="DenseTable";const fl=x.forwardRef(({className:e,...t},n)=>d.jsx("thead",{ref:n,className:e,...t}));fl.displayName="DenseTableHeader";const hl=x.forwardRef(({className:e,...t},n)=>d.jsx("tbody",{ref:n,className:e,...t}));hl.displayName="DenseTableBody";const tr=x.forwardRef(({className:e,interactive:t,selected:n,style:a,...l},o)=>d.jsx("tr",{ref:o,className:Ee("transition-colors",e),"data-interactive":t?"":void 0,"data-selected":n?"":void 0,style:{background:n?"var(--bg-active)":void 0,cursor:t?"pointer":void 0,...a},...l}));tr.displayName="DenseTableRow";const Ue=x.forwardRef(({className:e,style:t,...n},a)=>d.jsx("th",{ref:a,className:Ee("mono text-left uppercase text-eyebrow whitespace-nowrap",e),style:{padding:"var(--sp-2) var(--sp-3)",color:"var(--fg-4)",background:"var(--bg-sunken)",borderBottom:"var(--hairline) solid var(--border)",...t},...n}));Ue.displayName="DenseTableHead";const Le=x.forwardRef(({className:e,style:t,...n},a)=>d.jsx("td",{ref:a,className:Ee("align-middle text-body",e),style:{padding:"var(--sp-2_25) var(--sp-3)",borderBottom:"var(--hairline) solid var(--border-faint)",...t},...n}));Le.displayName="DenseTableCell";const yn=x.forwardRef(({className:e,style:t,...n},a)=>d.jsx("div",{ref:a,className:Ee("overflow-hidden",e),style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)",...t},...n}));yn.displayName="Panel";const Vr=x.forwardRef(({className:e,style:t,...n},a)=>d.jsx("div",{ref:a,className:Ee("flex items-center justify-between gap-3",e),style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)",...t},...n}));Vr.displayName="PanelHeader";const Qr=x.forwardRef(({className:e,style:t,...n},a)=>d.jsx("div",{ref:a,className:Ee("inline-flex items-center gap-2 text-body font-semibold",e),style:{color:"var(--fg)",...t},...n}));Qr.displayName="PanelTitle";const Ca=x.forwardRef(({className:e,style:t,...n},a)=>d.jsx("div",{ref:a,className:Ee(e),style:{padding:"var(--sp-3) var(--sp-3_5)",...t},...n}));Ca.displayName="PanelBody";function Ls({children:e,right:t,className:n,style:a,...l}){return d.jsxs("div",{className:Ee("mono flex items-center justify-between uppercase text-eyebrow",n),style:{padding:"var(--sp-1_75) var(--sp-3_5)",color:"var(--fg-4)",background:"var(--bg-raised)",borderBottom:"var(--hairline) solid var(--border-faint)",...a},...l,children:[d.jsx("span",{children:e}),t]})}function lf({className:e,style:t,...n}){return d.jsx("span",{className:Ee("mono uppercase text-caption",e),style:{color:"var(--fg-3)",...t},...n})}function Qg(){return Me.get("/members")}function N6(e){return Me.post("/members",e)}function _6(e,t){return Me.patch(`/members/${encodeURIComponent(e)}`,t)}function A6(e){return Me.delete(`/members/${encodeURIComponent(e)}`)}function Gg(){const{data:e}=Ve({queryKey:["members","name-map"],queryFn:Qg,staleTime:3e4});return x.useMemo(()=>{const t=new Map;if(e)for(const n of e)t.set(n.id,n.displayName||n.username);return n=>n?t.get(n)??n:"—"},[e])}function T6(){const e=Zr(),t=Gg(),{data:n,isLoading:a,error:l}=Ve({queryKey:["admin-all-agents"],queryFn:()=>AM({limit:100})});return d.jsxs("div",{children:[d.jsx("p",{className:"text-label",style:{color:"var(--fg-3)",padding:"0 var(--sp-0_5) var(--sp-2_5)"},children:"Every agent in the organization — including private agents owned by other members. Use this view to troubleshoot or reassign."}),d.jsxs(yn,{children:[d.jsxs(Ls,{children:["All agents · ",(n==null?void 0:n.items.length)??0]}),a?d.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):l?d.jsxs("div",{className:"text-center py-8 text-body",style:{color:"var(--state-error)"},children:["Failed to load agents: ",l instanceof Error?l.message:"Unknown error"]}):!n||n.items.length===0?d.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"No agents"}):d.jsxs(dl,{children:[d.jsx(fl,{children:d.jsxs(tr,{children:[d.jsx(Ue,{children:"Display name"}),d.jsx(Ue,{children:"Agent name"}),d.jsx(Ue,{children:"Type"}),d.jsx(Ue,{children:"Visibility"}),d.jsx(Ue,{children:"Owner"}),d.jsx(Ue,{children:"Status"}),d.jsx(Ue,{children:"Created"})]})}),d.jsx(hl,{children:n.items.map(o=>d.jsxs(tr,{interactive:!0,onClick:()=>e(`/agents/${encodeURIComponent(o.uuid)}`),children:[d.jsx(Le,{children:d.jsx("span",{className:"font-medium",children:o.displayName})}),d.jsx(Le,{children:o.name?d.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-3)"},children:["@",o.name]}):d.jsx("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:o.uuid.slice(0,8)})}),d.jsx(Le,{children:d.jsx(pn,{tone:o.type==="autonomous_agent"?"accent":"neutral",children:o.type})}),d.jsx(Le,{children:d.jsx(pn,{tone:o.visibility==="organization"?"accent":"outline",children:o.visibility})}),d.jsx(Le,{className:"text-label",style:{color:"var(--fg-2)"},children:o.managerId?t(o.managerId):"—"}),d.jsx(Le,{children:d.jsx(pn,{tone:o.status==="active"?"accent":"neutral",children:o.status})}),d.jsx(Le,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:bi(o.createdAt)})]},o.uuid))})]})]})]})}const z1=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,O1=Uw,R6=(e,t)=>n=>{var a;if((t==null?void 0:t.variants)==null)return O1(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:l,defaultVariants:o}=t,u=Object.keys(l).map(h=>{const g=n==null?void 0:n[h],y=o==null?void 0:o[h];if(g===null)return null;const b=z1(g)||z1(y);return l[h][b]}),f=n&&Object.entries(n).reduce((h,g)=>{let[y,b]=g;return b===void 0||(h[y]=b),h},{}),m=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((h,g)=>{let{class:y,className:b,...S}=g;return Object.entries(S).every(k=>{let[j,E]=k;return Array.isArray(E)?E.includes({...o,...f}[j]):{...o,...f}[j]===E})?[...h,y,b]:h},[]);return O1(e,u,m,n==null?void 0:n.class,n==null?void 0:n.className)},z6=R6("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-[var(--radius-input)] text-body font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 px-3 text-label",xs:"h-7 rounded-[var(--radius-chip)] px-2.5 text-label gap-1.5",lg:"h-10 px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),be=x.forwardRef(({className:e,variant:t,size:n,asChild:a=!1,...l},o)=>{const u=a?rM:"button";return d.jsx(u,{className:Ee(z6({variant:t,size:n,className:e})),ref:o,...l})});be.displayName="Button";const kt=x.forwardRef(({className:e,type:t,...n},a)=>d.jsx("input",{type:t,className:Ee("flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm transition-colors file:border-0 file:bg-transparent file:text-body file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:a,...n}));kt.displayName="Input";var O6="Label",tC=x.forwardRef((e,t)=>d.jsx(ja.label,{...e,ref:t,onMouseDown:n=>{var l;n.target.closest("button, input, select, textarea")||((l=e.onMouseDown)==null||l.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));tC.displayName=O6;var M6=tC;const rt=x.forwardRef(({className:e,...t},n)=>d.jsx(M6,{ref:n,className:Ee("text-label leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...t}));rt.displayName="Label";const nC=Object.values(i6);function D6(e,t){const n=(e==null?void 0:e.trim())||t,a=n.split(/[\s._-]+/).filter(Boolean);if(a.length>=2){const l=a[0]??"",o=a[1]??"";return`${l[0]??""}${o[0]??""}`.toUpperCase()}return n.slice(0,2).toUpperCase()}function L6(){const e=Fn(),{memberId:t}=wa(),[n,a]=x.useState(!1),[l,o]=x.useState({username:"",displayName:"",role:"member"}),[u,f]=x.useState(null),[m,h]=x.useState(null),{data:g,isLoading:y,error:b}=Ve({queryKey:["members"],queryFn:Qg}),S=wt({mutationFn:()=>N6({username:l.username,displayName:l.displayName,role:l.role}),onSuccess:T=>{e.invalidateQueries({queryKey:["members"]}),f(T.password)}}),k=wt({mutationFn:A6,onSuccess:()=>e.invalidateQueries({queryKey:["members"]})});function j(){a(!1),o({username:"",displayName:"",role:"member"}),f(null)}function E(T){T.preventDefault(),S.mutate()}function C(T){window.confirm("Delete this member? Their human agent will also be deactivated.")&&k.mutate(T)}return d.jsxs(d.Fragment,{children:[d.jsxs(yn,{children:[d.jsxs(Ls,{right:d.jsxs(nn,{open:n,onOpenChange:T=>T?a(!0):j(),children:[d.jsx(CM,{asChild:!0,children:d.jsxs(be,{size:"xs",className:"normal-case tracking-normal",children:[d.jsx(vi,{className:"h-3 w-3"}),"Add member"]})}),d.jsxs(Xt,{children:[d.jsx(gn,{children:d.jsx(an,{children:u?"Member Created":"Create Member"})}),u?d.jsxs("div",{className:"space-y-4",children:[d.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Member created. Share the password below — it will only be shown once."}),d.jsxs("div",{className:"flex items-center gap-2 rounded-md p-3",style:{background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)"},children:[d.jsx("code",{className:"flex-1 text-body mono",children:u}),d.jsx(be,{variant:"ghost",size:"icon",onClick:()=>navigator.clipboard.writeText(u),title:"Copy password",children:d.jsx(Cg,{className:"h-4 w-4"})})]}),d.jsx(rn,{children:d.jsx(be,{onClick:j,children:"Done"})})]}):d.jsxs("form",{onSubmit:E,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"member-username",children:"Username"}),d.jsx(kt,{id:"member-username",type:"text",value:l.username,onChange:T=>o({...l,username:T.target.value}),required:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"member-name",children:"Display Name"}),d.jsx(kt,{id:"member-name",value:l.displayName,onChange:T=>o({...l,displayName:T.target.value}),required:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"member-role",children:"Role"}),d.jsx("select",{id:"member-role",value:l.role,onChange:T=>o({...l,role:T.target.value}),className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:nC.map(T=>d.jsx("option",{value:T,children:T},T))})]}),S.error instanceof Error&&d.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:S.error.message}),d.jsx(rn,{children:d.jsx(be,{type:"submit",disabled:S.isPending,children:S.isPending?"Creating...":"Create"})})]})]})]}),children:["Members · ",(g==null?void 0:g.length)??0]}),y?d.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):b?d.jsxs("div",{className:"text-center py-8 text-body",style:{color:"var(--state-error)"},children:["Failed to load members: ",b instanceof Error?b.message:"Unknown error"]}):(g==null?void 0:g.length)===0?d.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"No members"}):d.jsxs(dl,{children:[d.jsx(fl,{children:d.jsxs(tr,{children:[d.jsx(Ue,{style:{width:30}}),d.jsx(Ue,{children:"Username"}),d.jsx(Ue,{children:"Name"}),d.jsx(Ue,{children:"Role"}),d.jsx(Ue,{children:"Created"}),d.jsx(Ue,{style:{width:1}})]})}),d.jsx(hl,{children:g==null?void 0:g.map(T=>{const O=t===T.id;return d.jsxs(tr,{children:[d.jsx(Le,{children:d.jsx("span",{className:"mono inline-flex items-center justify-center text-caption font-semibold",style:{width:22,height:22,borderRadius:"var(--radius-input)",background:O?"var(--accent-bg)":"var(--bg-active)",border:"var(--hairline) solid var(--border-strong)",color:O?"var(--accent-dim)":"var(--fg-2)"},children:D6(T.displayName,T.username)})}),d.jsxs(Le,{children:[d.jsx("span",{className:"mono font-medium",children:T.username}),O&&d.jsx(lf,{style:{marginLeft:6},children:"you"})]}),d.jsx(Le,{style:{color:"var(--fg-2)"},children:T.displayName}),d.jsx(Le,{children:d.jsx(pn,{tone:T.role==="admin"?"accent":"neutral",children:T.role})}),d.jsx(Le,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:bi(T.createdAt)}),d.jsx(Le,{style:{whiteSpace:"nowrap"},children:d.jsxs("div",{className:"flex gap-0.5 justify-end",children:[d.jsx(be,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>h({id:T.id,username:T.username,displayName:T.displayName,role:T.role}),title:"Edit",children:d.jsx(Eu,{className:"h-3.5 w-3.5"})}),d.jsx(be,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>C(T.id),disabled:k.isPending,title:"Delete",style:{color:"var(--fg-4)"},children:d.jsx(Os,{className:"h-3.5 w-3.5"})})]})})]},T.id)})})]})]}),d.jsx(I6,{target:m,onClose:()=>h(null),onSaved:()=>{h(null),e.invalidateQueries({queryKey:["members"]})}})]})}function I6({target:e,onClose:t,onSaved:n}){const[a,l]=x.useState(""),[o,u]=x.useState("member"),[f,m]=x.useState(null);x.useEffect(()=>{e&&(l(e.displayName),u(e.role),m(null))},[e]);const h=wt({mutationFn:async()=>{if(!e)throw new Error("No target");const b={};return a.trim()&&a!==e.displayName&&(b.displayName=a.trim()),o!==e.role&&(b.role=o),Object.keys(b).length===0?e:_6(e.id,b)},onSuccess:()=>{m(null),n()},onError:b=>{m(b instanceof Error?b.message:String(b))}});function g(b){b.preventDefault(),h.mutate()}const y=e!==null;return d.jsx(nn,{open:y,onOpenChange:b=>b?void 0:t(),children:d.jsxs(Xt,{children:[d.jsx(gn,{children:d.jsx(an,{children:"Edit Member"})}),e&&d.jsxs("form",{onSubmit:g,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{children:"Username"}),d.jsx(kt,{value:e.username,disabled:!0,className:"font-mono"}),d.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:"Username is permanent after creation."})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"edit-member-display",children:"Display Name"}),d.jsx(kt,{id:"edit-member-display",value:a,onChange:b=>l(b.target.value),required:!0,maxLength:200})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"edit-member-role",children:"Role"}),d.jsx("select",{id:"edit-member-role",value:o,onChange:b=>u(b.target.value),className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:nC.map(b=>d.jsx("option",{value:b,children:b},b))}),d.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:"Demoting the last admin is blocked — every org needs at least one admin to manage members."})]}),f&&d.jsx("p",{className:"text-body",style:{color:"var(--state-error)"},children:f}),d.jsxs(rn,{children:[d.jsx(be,{type:"button",variant:"ghost",onClick:t,disabled:h.isPending,children:"Cancel"}),d.jsx(be,{type:"submit",disabled:h.isPending,children:h.isPending?"Saving…":"Save"})]})]})]})})}function U6(){return Me.get("/admin/system/config")}function P6(e){return Me.patch("/admin/system/config",e)}const rC=[{key:pi.INBOX_TIMEOUT_SECONDS,label:"Inbox timeout",description:"How long an agent waits for inbound messages before sleeping.",unit:"seconds"},{key:pi.MAX_RETRY_COUNT,label:"Max retry count",description:"Delivery attempts before a message is marked failed.",unit:null},{key:pi.POLLING_INTERVAL_SECONDS,label:"Polling interval",description:"Runtime heartbeat cadence for offline detection.",unit:"seconds"},{key:pi.PRESENCE_CLEANUP_SECONDS,label:"Presence cleanup",description:"When presence rows expire after disconnect.",unit:"seconds"}],M1=rC.map(e=>e.key);function B6(){const e=Fn(),{data:t,isLoading:n}=Ve({queryKey:["system-config"],queryFn:U6}),[a,l]=x.useState({}),[o,u]=x.useState(!1);x.useEffect(()=>{if(!t)return;const g={};for(const y of M1){const b=t[y]??wd[y]??"";g[y]=String(b)}l(g)},[t]);const f=wt({mutationFn:()=>{const g={};for(const[y,b]of Object.entries(a)){const S=b.trim();if(S==="")g[y]=wd[y]??0;else{const k=Number(S);g[y]=Number.isNaN(k)?S:k}}return P6(g)},onSuccess:()=>{e.invalidateQueries({queryKey:["system-config"]}),u(!0),setTimeout(()=>u(!1),2e3)}});function m(){const g={};for(const y of M1)g[y]=String(wd[y]??"");l(g)}function h(g){g.preventDefault(),f.mutate()}return d.jsx("form",{onSubmit:h,children:d.jsxs(yn,{children:[d.jsxs(Vr,{children:[d.jsx(Qr,{children:"System configuration"}),d.jsxs("div",{className:"flex items-center gap-1.5",children:[o&&d.jsx("span",{className:"mono text-caption",style:{color:"var(--accent-dim)"},children:"saved"}),d.jsx(be,{type:"button",variant:"ghost",size:"xs",onClick:m,disabled:f.isPending,children:"Reset defaults"}),d.jsxs(be,{type:"submit",size:"xs",disabled:f.isPending,children:[d.jsx(Cu,{className:"h-3 w-3"}),f.isPending?"Saving…":"Save changes"]})]})]}),d.jsxs("div",{style:{padding:"var(--sp-1) var(--sp-4) var(--sp-3_5)"},children:[n?d.jsx("div",{className:"py-6 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):rC.map(g=>d.jsx($6,{field:g,value:a[g.key]??"",onChange:y=>l({...a,[g.key]:y})},g.key)),f.error instanceof Error&&d.jsx("div",{className:"text-body pt-2",style:{color:"var(--state-error)"},children:f.error.message})]})]})})}function $6({field:e,value:t,onChange:n}){const a=String(wd[e.key]??"—");return d.jsxs("div",{className:"grid items-start gap-5",style:{gridTemplateColumns:"1fr var(--sp-45)",padding:"var(--sp-3_5) 0",borderTop:"var(--hairline) solid var(--border-faint)"},children:[d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-baseline gap-2",children:[d.jsx("span",{className:"text-body font-medium",style:{color:"var(--fg)"},children:e.label}),d.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:e.key})]}),d.jsx("div",{className:"text-label",style:{color:"var(--fg-3)",marginTop:2},children:e.description}),d.jsxs(lf,{style:{marginTop:4,display:"block"},children:["default"," ",d.jsx("span",{className:"mono normal-case tracking-normal",style:{color:"var(--fg-3)"},children:a})]})]}),d.jsxs("div",{style:{position:"relative"},children:[d.jsx("input",{value:t,onChange:l=>n(l.target.value),className:"w-full outline-none mono text-body",style:{padding:`var(--sp-1_25) ${e.unit?56:10}px var(--sp-1_25) var(--sp-2_5)`,background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",color:"var(--fg)"}}),e.unit&&d.jsx("span",{className:"mono text-caption",style:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",color:"var(--fg-4)",pointerEvents:"none"},children:e.unit})]})]})}const D1=[{key:"members",label:"Members"},{key:"all-agents",label:"All agents"},{key:"settings",label:"Org settings"}];function F6(){const{role:e}=wa(),t=br(),n=Zr();if(e===null)return d.jsx("div",{className:"text-body",style:{padding:20,color:"var(--fg-3)"},children:"Loading…"});if(e!=="admin")return d.jsx(xg,{to:"/settings",replace:!0});const a=t.hash.replace("#",""),l=D1.some(u=>u.key===a)?a:"members",o=u=>{n({hash:u},{replace:!0})};return d.jsxs("div",{className:"-m-6",children:[d.jsx(af,{title:"Admin",subtitle:"Organization-wide controls"}),d.jsx(Wj,{children:D1.map(u=>d.jsx(eC,{active:l===u.key,onClick:()=>o(u.key),children:u.label},u.key))}),d.jsxs("div",{style:{padding:"var(--sp-4) var(--sp-5) var(--sp-7)"},children:[l==="members"&&d.jsx(L6,{}),l==="all-agents"&&d.jsx(T6,{}),l==="settings"&&d.jsx(B6,{})]})]})}function q6(e){return Me.get(`/admin/agents/${e}/config`)}function H6(e,t){return Me.patch(`/admin/agents/${e}/config`,t)}function Z6(e,t){return Me.post(`/admin/agents/${e}/config/dry-run`,{payload:t})}function V6(e){return Me.get(`/admin/agents/${e}/client-status`)}function Q6({className:e,style:t,...n}){return d.jsx("div",{className:Ee("flex items-center text-body",e),style:{gap:6,color:"var(--fg-3)",...t},...n})}function G6({onClick:e,children:t}){return d.jsx("button",{type:"button",onClick:e,className:"bg-transparent border-0 p-0 cursor-pointer",style:{color:"var(--fg-3)",textDecoration:"none",font:"inherit"},onMouseEnter:n=>{n.currentTarget.style.color="var(--fg)"},onMouseLeave:n=>{n.currentTarget.style.color="var(--fg-3)"},children:t})}function K6(){return d.jsx("span",{style:{color:"var(--fg-4)"},children:"/"})}function Y6({children:e,mono:t}){return d.jsx("span",{className:Ee("font-medium",t&&"mono"),style:{color:"var(--fg)"},children:e})}function Hr({state:e,size:t=8,className:n}){const a={width:t,height:t,display:"inline-block",position:"relative",flexShrink:0};return e==="working"?d.jsxs("span",{className:Ee("shrink-0",n),style:a,role:"img","aria-label":"working",children:[d.jsx("span",{style:{position:"absolute",inset:0,borderRadius:"50%",background:"var(--state-working)"}}),d.jsx("span",{style:{position:"absolute",inset:-3,borderRadius:"50%",border:"var(--hairline) solid var(--state-working)",animation:"ring-pulse 1.8s infinite",opacity:.6}})]}):e==="blocked"?d.jsx("span",{className:Ee("shrink-0",n),style:{...a,border:"var(--hairline-bold) dashed var(--state-blocked)",borderRadius:"50%",animation:"dash-spin 4s linear infinite"},role:"img","aria-label":"blocked",children:d.jsx("span",{style:{position:"absolute",inset:2,borderRadius:"50%",background:"var(--state-blocked)"}})}):e==="error"?d.jsx("span",{className:Ee("shrink-0",n),style:{...a,background:"var(--state-error)",clipPath:"polygon(50% 0%, 100% 100%, 0% 100%)",borderRadius:1},role:"img","aria-label":"error"}):e==="idle"?d.jsx("span",{className:Ee("shrink-0",n),style:{...a,borderRadius:"50%",background:"var(--state-idle)"},role:"img","aria-label":"idle"}):d.jsx("span",{className:Ee("shrink-0",n),style:{...a,borderRadius:"50%",border:"var(--hairline) solid var(--state-offline)",background:"transparent"},role:"img","aria-label":"offline"})}function X6(e){return e==="idle"||e==="working"||e==="blocked"||e==="error"||e==="offline"}function Is({state:e,className:t}){const n=e!==null&&X6(e)?e:"offline",a=n==="offline"?"var(--fg-3)":`var(--state-${n})`;return d.jsxs("span",{className:Ee("mono inline-flex items-center gap-1.5 uppercase text-caption",t),style:{color:a},children:[d.jsx(Hr,{state:n,size:7}),n]})}function od({label:e,value:t,accent:n}){return d.jsxs("div",{style:{padding:"var(--sp-2) var(--sp-2_5)",background:"var(--bg-sunken)",borderRadius:"var(--radius-input)",cursor:"default"},children:[d.jsx("div",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-4)"},children:e}),d.jsx("div",{className:"mono text-subtitle font-semibold",style:{color:n??"var(--fg)",marginTop:"var(--sp-px)"},children:t})]})}function J6({runtimeLabel:e,computerLabel:t,visible:n=!0}){return n?d.jsx("div",{className:"sticky z-20 flex items-center justify-between gap-3 backdrop-blur",style:{top:0,padding:"var(--sp-1_75) var(--sp-5)",background:"color-mix(in oklch, var(--bg-raised) 94%, transparent)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:d.jsxs("div",{className:"mono text-caption flex items-center gap-2",style:{color:"var(--fg-3)"},children:[d.jsxs("span",{children:["Runs on ",d.jsx("span",{style:{color:"var(--fg-2)"},children:e})]}),t&&d.jsxs(d.Fragment,{children:[d.jsx("span",{style:{color:"var(--fg-4)"},"aria-hidden":!0,children:"@"}),d.jsx("span",{style:{color:"var(--fg-2)"},children:t})]})]})}):null}function W6(e){const{agent:t}=e,[n,a]=x.useState(!1),[l,o]=x.useState(!1),u=t.displayName||t.name||t.uuid;return d.jsxs("section",{id:"ad-danger",style:{background:"color-mix(in oklch, var(--state-error) 6%, var(--bg-raised))",border:"var(--hairline) solid color-mix(in oklch, var(--state-error) 28%, transparent)",borderRadius:"var(--radius-panel)"},children:[d.jsxs("header",{className:"flex items-center gap-2",style:{padding:"var(--sp-2_5) var(--sp-3_5)"},children:[d.jsx(sR,{className:"h-3.5 w-3.5",style:{color:"var(--state-error)"}}),d.jsx("h3",{className:"text-body font-semibold",style:{color:"var(--state-error)"},children:"Danger zone"})]}),d.jsxs("div",{children:[t.status==="active"?d.jsx(Ym,{title:"Suspend agent",body:"Pause all active sessions. You can reactivate later; tokens stay revoked until then.",action:d.jsx(be,{variant:"outline",size:"xs",onClick:()=>o(!0),disabled:e.suspendPending,children:e.suspendPending?"Suspending…":"Suspend"})}):d.jsx(Ym,{title:"Reactivate agent",body:"Resume sessions. Tokens must be recreated — they are not restored.",action:d.jsx(be,{variant:"outline",size:"xs",onClick:e.onReactivate,disabled:e.reactivatePending,children:e.reactivatePending?"Reactivating…":"Reactivate"})}),d.jsx(Ym,{title:"Delete agent",body:"Permanent. Configuration, bindings, tokens, and session history are all dropped.",action:d.jsxs(be,{variant:"destructive",size:"xs",onClick:()=>a(!0),disabled:e.deletePending,children:[d.jsx(Os,{className:"h-3 w-3"}),"Delete"]})})]}),d.jsx(eI,{open:l,onOpenChange:o,label:u,onConfirm:()=>{o(!1),e.onSuspend()},pending:e.suspendPending}),d.jsx(tI,{open:n,onOpenChange:a,expected:u,onDelete:()=>{a(!1),e.onDelete()},deleting:e.deletePending})]})}function Ym(e){return d.jsxs("div",{className:"flex items-start justify-between gap-4 text-body",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderTop:"var(--hairline) solid color-mix(in oklch, var(--state-error) 14%, transparent)"},children:[d.jsxs("div",{children:[d.jsx("p",{className:"font-medium",style:{color:"var(--fg)"},children:e.title}),d.jsx("p",{className:"text-label font-normal",style:{color:"var(--fg-3)"},children:e.body})]}),d.jsx("div",{children:e.action})]})}function eI({open:e,onOpenChange:t,label:n,onConfirm:a,pending:l}){return d.jsx(nn,{open:e,onOpenChange:t,children:d.jsxs(Xt,{children:[d.jsx(gn,{children:d.jsxs(an,{children:['Suspend "',n,'"?']})}),d.jsx("div",{className:"space-y-3",children:d.jsx("p",{className:"text-body",style:{color:"var(--fg-2)"},children:"Runtime binds and HTTP calls will be refused while the agent is suspended. Active sessions end on their next message. You can reactivate later from this same page."})}),d.jsxs(rn,{children:[d.jsx(be,{type:"button",variant:"ghost",onClick:()=>t(!1),disabled:l,children:"Cancel"}),d.jsx(be,{type:"button",variant:"destructive",onClick:a,disabled:l,children:l?"Suspending…":"Suspend"})]})]})})}function tI({open:e,onOpenChange:t,expected:n,onDelete:a,deleting:l}){const[o,u]=x.useState("");function f(m){m.preventDefault(),o===n&&a()}return d.jsx(nn,{open:e,onOpenChange:m=>{t(m),m||u("")},children:d.jsxs(Xt,{children:[d.jsx(gn,{children:d.jsxs(an,{children:['Delete "',n,'"?']})}),d.jsxs("form",{onSubmit:f,className:"space-y-4",children:[d.jsxs("p",{className:"text-body text-muted-foreground",children:["This action cannot be undone. Type ",d.jsx("span",{className:"font-mono font-medium text-foreground",children:n})," ","to confirm."]}),d.jsx(kt,{value:o,onChange:m=>u(m.target.value),autoFocus:!0,placeholder:n,className:"font-mono"}),d.jsxs(rn,{children:[d.jsx(be,{type:"button",variant:"ghost",onClick:()=>t(!1),disabled:l,children:"Cancel"}),d.jsx(be,{type:"submit",variant:"destructive",disabled:o!==n||l,children:l?"Deleting…":"Delete"})]})]})]})})}const nI={unchanged:{label:"",tone:""},added:{label:"new",tone:"bg-success-soft text-success"},modified:{label:"changed",tone:"bg-warn-soft text-warn"},deleted:{label:"will be removed on save",tone:"bg-error-soft text-error"}};function Kg({status:e,onEdit:t,onDelete:n,onUndo:a,children:l,disabled:o}){const u=nI[e],f=e==="deleted";return d.jsxs("div",{className:Ee("flex items-center gap-2 rounded border px-3 py-2 text-body",f?"bg-error-soft border-error text-error line-through decoration-error":"bg-card"),children:[d.jsx("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:l}),u.label&&d.jsx("span",{className:Ee("text-caption rounded px-1.5 py-0.5 whitespace-nowrap",u.tone),children:u.label}),!o&&(f?d.jsxs(be,{size:"sm",variant:"ghost",onClick:a,children:[d.jsx(uR,{className:"h-3.5 w-3.5 mr-1"}),"Undo"]}):d.jsxs("div",{className:"flex gap-1 shrink-0",children:[d.jsxs(be,{size:"icon",variant:"ghost",className:"h-7 w-7",onClick:t,title:"Edit",children:[d.jsx(Eu,{className:"h-3.5 w-3.5"}),d.jsx("span",{className:"sr-only",children:"Edit"})]}),d.jsxs(be,{size:"icon",variant:"ghost",className:"h-7 w-7",onClick:n,title:"Delete",children:[d.jsx(Os,{className:"h-3.5 w-3.5"}),d.jsx("span",{className:"sr-only",children:"Delete"})]})]}))]})}function rI(e){const[t,n]=x.useState(null),[a,l]=x.useState(()=>new Set),o=f=>l(m=>{const h=new Set(m);return h.has(f)?h.delete(f):h.add(f),h}),u=e.items.filter(f=>f.status!=="deleted").length;return d.jsxs(yn,{children:[d.jsxs(Vr,{children:[d.jsxs(Qr,{children:["Environment variables (",u,")"]}),!e.disabled&&d.jsxs(be,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[d.jsx(vi,{className:"h-3 w-3"})," Add"]})]}),d.jsx(Ca,{className:"space-y-2",children:e.items.length===0?d.jsx("p",{className:"text-body text-muted-foreground",children:"No environment variables."}):e.items.map(f=>{const m=f.value.sensitive,h=f.value.value===Md,g=m&&!h&&!!f.value.value,y=a.has(f.key);let b;return m?g&&y?b=f.value.value:b="••••••":b=f.value.value||d.jsx("em",{children:"(empty)"}),d.jsxs(Kg,{status:f.status,onEdit:()=>n({mode:"edit",key:f.key,initial:f.value}),onDelete:()=>e.onDelete(f.key),onUndo:()=>e.onUndoDelete(f.key),disabled:e.disabled,children:[d.jsx("span",{className:"font-mono font-medium",children:f.value.key}),d.jsx("span",{className:"font-mono text-caption text-muted-foreground truncate max-w-xs",children:b}),m&&d.jsx(Dw,{className:"h-3 w-3 text-muted-foreground","aria-hidden":!0}),m&&d.jsx("button",{type:"button",onClick:()=>g&&o(f.key),className:"bg-transparent border-0 cursor-pointer inline-flex items-center text-muted-foreground",title:g?y?"Hide value":"Reveal value":"Saved sensitive values can't be revealed. Edit to set a new value.","aria-label":y?"Hide value":"Reveal value",disabled:!g,style:{padding:0,opacity:g?1:.4},children:y?d.jsx(AT,{className:"h-3.5 w-3.5"}):d.jsx(RT,{className:"h-3.5 w-3.5"})})]},f.key)})}),t&&d.jsx(aI,{open:!!t,onOpenChange:f=>!f&&n(null),initial:t.mode==="edit"?t.initial:null,forbiddenKeys:e.otherKeys(t.mode==="edit"?t.key:null),onSubmit:f=>{t.mode==="edit"?e.onUpdate(t.key,f):e.onAdd(f),n(null)}})]})}function aI({open:e,onOpenChange:t,initial:n,forbiddenKeys:a,onSubmit:l}){const[o,u]=x.useState((n==null?void 0:n.key)??""),[f,m]=x.useState(n!=null&&n.sensitive?"":(n==null?void 0:n.value)??""),[h,g]=x.useState((n==null?void 0:n.sensitive)??!1),[y,b]=x.useState(null);x.useEffect(()=>{e&&(u((n==null?void 0:n.key)??""),m(n!=null&&n.sensitive?"":(n==null?void 0:n.value)??""),g((n==null?void 0:n.sensitive)??!1),b(null))},[e,n]);function S(k){if(k.preventDefault(),!o.match(/^[A-Z][A-Z0-9_]*$/)){b("Key must match /^[A-Z][A-Z0-9_]*$/.");return}if(a.has(o)){b(`Another entry already uses key "${o}".`);return}let j=f;if(h&&(n!=null&&n.sensitive)&&!f&&(j=Md),!h&&!n&&!f){b("Value is required for non-sensitive entries.");return}l({key:o,value:j,sensitive:h})}return d.jsx(nn,{open:e,onOpenChange:t,children:d.jsxs(Xt,{children:[d.jsx(gn,{children:d.jsx(an,{children:n?"Edit environment variable":"Add environment variable"})}),d.jsxs("form",{onSubmit:S,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"env-key",children:"Key"}),d.jsx(kt,{id:"env-key",value:o,onChange:k=>u(k.target.value.toUpperCase()),placeholder:"OPENAI_API_KEY",className:"font-mono",disabled:!!n}),n&&d.jsx("p",{className:"text-caption text-muted-foreground",children:"Key can't be renamed — delete and re-add."})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"env-value",children:"Value"}),d.jsx(kt,{id:"env-value",type:h?"password":"text",autoComplete:"new-password",value:f,onChange:k=>m(k.target.value),placeholder:n!=null&&n.sensitive?"Leave empty to keep existing value":h?"new secret":"value",className:"font-mono"})]}),d.jsxs("label",{className:"flex items-center gap-2 text-body",children:[d.jsx("input",{type:"checkbox",checked:h,onChange:k=>g(k.target.checked),className:"h-4 w-4",disabled:!!n&&n.sensitive}),"Mark as sensitive (encrypted at rest, never displayed again)"]}),d.jsx("p",{className:"text-caption text-muted-foreground",children:"Sensitive values cannot be viewed after saving. If you need to verify, save a new value."}),y&&d.jsx("p",{className:"text-body text-destructive",children:y}),d.jsxs(rn,{children:[d.jsx(be,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),d.jsx(be,{type:"submit",children:n?"Done":"Add"})]})]})]})})}function iI(e){const[t,n]=x.useState(null),a=e.items.filter(l=>l.status!=="deleted").length;return d.jsxs(yn,{children:[d.jsxs(Vr,{children:[d.jsxs(Qr,{children:["Git repositories (",a,")"]}),!e.disabled&&d.jsxs(be,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[d.jsx(vi,{className:"h-3 w-3"})," Add"]})]}),d.jsx(Ca,{className:"space-y-2",children:e.items.length===0?d.jsx("p",{className:"text-body text-muted-foreground",children:"No Git repositories."}):e.items.map(l=>{const o=l.value.localPath??Dd(l.value.url);return d.jsxs(Kg,{status:l.status,onEdit:()=>n({mode:"edit",key:l.key,initial:l.value}),onDelete:()=>e.onDelete(l.key),onUndo:()=>e.onUndoDelete(l.key),disabled:e.disabled,children:[d.jsx("span",{className:"font-mono text-caption",children:l.value.url}),l.value.ref&&d.jsxs("span",{className:"text-caption text-muted-foreground",children:["@ ",l.value.ref]}),d.jsxs("span",{className:"text-caption text-muted-foreground",children:["→ ",o||"./"]})]},l.key)})}),t&&d.jsx(lI,{open:!!t,onOpenChange:l=>!l&&n(null),initial:t.mode==="edit"?t.initial:null,forbiddenPaths:e.otherPaths(t.mode==="edit"?t.key:null),onSubmit:l=>{t.mode==="edit"?e.onUpdate(t.key,l):e.onAdd(l),n(null)}})]})}function lI({open:e,onOpenChange:t,initial:n,forbiddenPaths:a,onSubmit:l}){const[o,u]=x.useState((n==null?void 0:n.url)??""),[f,m]=x.useState((n==null?void 0:n.ref)??""),[h,g]=x.useState((n==null?void 0:n.localPath)??""),[y,b]=x.useState(null);x.useEffect(()=>{e&&(u((n==null?void 0:n.url)??""),m((n==null?void 0:n.ref)??""),g((n==null?void 0:n.localPath)??""),b(null))},[e,n]);function S(k){k.preventDefault();const j=o.trim();if(!j){b("URL is required.");return}const E=h.trim()||Dd(j);if(E&&a.has(E)){b(`Another repo already occupies local path "${E}".`);return}const C={url:j,...f.trim()?{ref:f.trim()}:{},...h.trim()?{localPath:h.trim()}:{}};l(C)}return d.jsx(nn,{open:e,onOpenChange:t,children:d.jsxs(Xt,{children:[d.jsx(gn,{children:d.jsx(an,{children:n?"Edit Git repository":"Add Git repository"})}),d.jsxs("form",{onSubmit:S,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"git-url",children:"URL"}),d.jsx(kt,{id:"git-url",value:o,onChange:k=>u(k.target.value),placeholder:"git@github.com:org/repo.git",className:"font-mono"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"git-ref",children:"Ref (branch / tag / sha, optional)"}),d.jsx(kt,{id:"git-ref",value:f,onChange:k=>m(k.target.value),placeholder:"main",className:"font-mono"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"git-path",children:"Local path (optional)"}),d.jsx(kt,{id:"git-path",value:h,onChange:k=>g(k.target.value),placeholder:Dd(o)||"repo-name",className:"font-mono"}),d.jsx("p",{className:"text-caption text-muted-foreground",children:"Relative to the session working directory. Leave empty to derive from the URL."})]}),y&&d.jsx("p",{className:"text-body text-destructive",children:y}),d.jsxs(rn,{children:[d.jsx(be,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),d.jsx(be,{type:"submit",children:n?"Done":"Add"})]})]})]})})}function aC({name:e,displayName:t,variant:n="inline",tone:a="neutral",emptyLabel:l="—",className:o,style:u,title:f}){const m=typeof e=="string"&&e.length>0,h=typeof t=="string"&&t.length>0;if(!m&&!h)return d.jsx("span",{className:Ee("mono text-label",o),style:{color:"var(--fg-4)",...u},title:f,children:l});const g=f??(m&&h?`${t} (@${e})`:h?t:`@${e}`),y=a==="accent"?"var(--accent-dim)":void 0,b=a==="accent"?"var(--accent-dim)":"var(--fg-3)";return n==="stacked"?d.jsxs("span",{className:Ee("inline-flex flex-col leading-tight",o),style:{gap:1,...u},title:g??void 0,children:[h&&d.jsx("span",{className:"text-body",style:{color:y},children:t}),m&&d.jsxs("span",{className:"mono text-caption",style:{color:b},children:["@",e]})]}):d.jsxs("span",{className:Ee("inline-flex items-baseline gap-1.5",o),style:u,title:g??void 0,children:[h&&d.jsx("span",{style:{color:y},children:t}),m&&d.jsxs("span",{className:"mono text-caption",style:{color:b},children:["@",e]})]})}function sI({agent:e,onSave:t}){const[n,a]=x.useState(!1),l=Og(),o=Gg(),u=e.metadata,f=u==null?void 0:u.tree,m=typeof(f==null?void 0:f.role)=="string"?f.role:null,h=Array.isArray(f==null?void 0:f.domains)?(f==null?void 0:f.domains).filter(b=>typeof b=="string"):[],g=e.managerId?o(e.managerId):null,y=e.delegateMention?l(e.delegateMention):null;return d.jsxs(yn,{children:[d.jsxs(Vr,{children:[d.jsx(Qr,{children:"Profile"}),e.status==="active"&&d.jsxs(be,{size:"xs",variant:"outline",onClick:()=>a(!0),children:[d.jsx(Eu,{className:"h-3 w-3"})," Edit"]})]}),d.jsxs(Ca,{className:"text-body space-y-1",children:[d.jsxs("div",{children:[d.jsx("span",{className:"font-semibold",children:e.displayName}),e.name&&d.jsxs("span",{className:"ml-2 font-mono text-caption text-muted-foreground",children:["@",e.name]}),y&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"mx-2 text-muted-foreground",children:"·"}),d.jsxs("span",{className:"text-muted-foreground",children:["delegate ",d.jsx(aC,{name:y.name,displayName:y.displayName})]})]})]}),d.jsxs("div",{className:"text-caption text-muted-foreground flex flex-wrap items-center gap-x-3 gap-y-1",children:[d.jsxs("span",{children:["owner ",d.jsx("span",{className:"text-foreground",children:g??"—"})]}),m&&d.jsxs("span",{children:["role ",d.jsx("span",{className:"text-foreground",children:m})]}),d.jsxs("span",{children:["type ",d.jsx(pn,{tone:e.type==="autonomous_agent"?"accent":"neutral",children:e.type})]}),d.jsxs("span",{children:["visibility"," ",d.jsx(pn,{tone:e.visibility==="organization"?"accent":"outline",children:e.visibility})]}),h.length>0&&d.jsxs("span",{children:["domains"," ",d.jsx("span",{className:"inline-flex flex-wrap gap-1 align-middle",children:h.map(b=>d.jsx(pn,{tone:"outline",children:b},b))})]})]})]}),d.jsx(oI,{agent:e,open:n,onOpenChange:a,onSave:t})]})}function oI({agent:e,open:t,onOpenChange:n,onSave:a}){var B;const{memberId:l,role:o}=wa(),[u,f]=x.useState(e.displayName),[m,h]=x.useState(e.delegateMention??""),[g,y]=x.useState(e.visibility),[b,S]=x.useState(!1),[k,j]=x.useState(null);x.useEffect(()=>{t&&(f(e.displayName),h(e.delegateMention??""),y(e.visibility),j(null))},[t,e]);const E=e.type==="human",C=o==="admin"||e.managerId===l,T=Ve({queryKey:["agents-for-delegate"],queryFn:async()=>(await Au({limit:100})).items.filter(R=>R.type==="personal_assistant"&&R.status==="active"),enabled:t&&E});async function O(M){M.preventDefault(),j(null);const R=u.trim();if(!R){j("Display name is required.");return}S(!0);try{const D={displayName:R,delegateMention:m||null};g!==e.visibility&&(D.visibility=g),await a(D),n(!1)}catch(D){j(D instanceof Error?D.message:String(D))}finally{S(!1)}}return d.jsx(nn,{open:t,onOpenChange:n,children:d.jsxs(Xt,{children:[d.jsx(gn,{children:d.jsx(an,{children:"Edit Identity"})}),d.jsxs("form",{onSubmit:O,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{children:"Agent name"}),d.jsx(kt,{value:e.name?`@${e.name}`:"",disabled:!0,className:"font-mono"}),d.jsx("p",{className:"text-caption text-muted-foreground",children:"Agent name is permanent after creation — used in @mentions and CLI commands."})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"id-display",children:"Display Name"}),d.jsx(kt,{id:"id-display",value:u,onChange:M=>f(M.target.value),placeholder:"How teammates see this agent",maxLength:200})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"id-visibility",children:"Visibility"}),d.jsxs("select",{id:"id-visibility",value:g,onChange:M=>y(M.target.value),disabled:!C,className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",children:[d.jsx("option",{value:T1.PRIVATE,children:"Private — only the manager"}),d.jsx("option",{value:T1.ORGANIZATION,children:"Organization — all members"})]}),d.jsx("p",{className:"text-caption text-muted-foreground",children:C?"Private agents are only visible to their manager; organization agents appear in every member's list.":"Only the manager or an admin can change this agent's visibility."})]}),E&&d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"id-delegate",children:"Delegate Mention"}),d.jsxs("select",{id:"id-delegate",value:m,onChange:M=>h(M.target.value),className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[d.jsx("option",{value:"",children:"None"}),(B=T.data)==null?void 0:B.map(M=>d.jsx("option",{value:M.uuid,children:M.displayName?`${M.displayName} (@${M.name??M.uuid})`:M.name?`@${M.name}`:M.uuid},M.uuid))]}),d.jsx("p",{className:"text-caption text-muted-foreground",children:"Assistant that acts on behalf of this agent."})]}),k&&d.jsx("p",{className:"text-body text-destructive",children:k}),d.jsxs(rn,{children:[d.jsx(be,{type:"button",variant:"ghost",onClick:()=>n(!1),disabled:b,children:"Cancel"}),d.jsx(be,{type:"submit",disabled:b,children:b?"Saving…":"Save"})]})]})]})})}function uI(e){return e==="working"?"accent":e==="error"?"error":"outline"}function cI(e){const[t,n]=x.useState(null),a=e.items.filter(l=>l.status!=="deleted").length;return d.jsxs(yn,{children:[d.jsxs(Vr,{children:[d.jsxs(Qr,{children:["MCP servers (",a,")"]}),!e.disabled&&d.jsxs(be,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[d.jsx(vi,{className:"h-3 w-3"})," Add"]})]}),d.jsx(Ca,{className:"space-y-2",children:e.items.length===0?d.jsx("p",{className:"text-body text-muted-foreground",children:"No MCP servers. Add one to extend the agent's tools."}):e.items.map(l=>{const o=l.status==="deleted"||!e.toolHealth?"unknown":e.toolHealth(l.value.name);return d.jsxs(Kg,{status:l.status,onEdit:()=>n({mode:"edit",key:l.key,initial:l.value}),onDelete:()=>e.onDelete(l.key),onUndo:()=>e.onUndoDelete(l.key),disabled:e.disabled,children:[d.jsx("span",{className:"text-caption rounded bg-muted px-1.5 py-0.5 font-mono",children:l.value.transport}),d.jsx("span",{className:"font-medium font-mono",children:l.value.name}),d.jsx(pn,{tone:uI(o),children:o}),d.jsx("span",{className:"text-caption text-muted-foreground truncate",children:dI(l.value)})]},l.key)})}),t&&d.jsx(fI,{open:!!t,onOpenChange:l=>!l&&n(null),initial:t.mode==="edit"?t.initial:null,forbiddenNames:e.otherNames(t.mode==="edit"?t.key:null),onSubmit:l=>{t.mode==="edit"?e.onUpdate(t.key,l):e.onAdd(l),n(null)}})]})}function dI(e){var t;if(e.transport==="stdio"){const n=(t=e.args)!=null&&t.length?` ${e.args.join(" ")}`:"";return`${e.command}${n}`}return e.url}function fI({open:e,onOpenChange:t,initial:n,forbiddenNames:a,onSubmit:l}){const[o,u]=x.useState((n==null?void 0:n.transport)??"stdio"),[f,m]=x.useState((n==null?void 0:n.name)??""),[h,g]=x.useState((n==null?void 0:n.transport)==="stdio"?n.command:""),[y,b]=x.useState((n==null?void 0:n.transport)==="stdio"&&n.args?n.args.join(" "):""),[S,k]=x.useState(n&&(n.transport==="http"||n.transport==="sse")?n.url:""),[j,E]=x.useState(null);x.useEffect(()=>{e&&(u((n==null?void 0:n.transport)??"stdio"),m((n==null?void 0:n.name)??""),g((n==null?void 0:n.transport)==="stdio"?n.command:""),b((n==null?void 0:n.transport)==="stdio"&&n.args?n.args.join(" "):""),k(n&&(n.transport==="http"||n.transport==="sse")?n.url:""),E(null))},[e,n]);function C(T){if(T.preventDefault(),!f.match(/^[a-z0-9][a-z0-9_-]{0,63}$/i)){E("Name must start alphanumeric and contain only a-z0-9_-.");return}if(a.has(f.toLowerCase())){E(`Another MCP server is already named "${f}".`);return}let O;if(o==="stdio"){if(!h.trim()){E("stdio transport requires a command.");return}const B=y.trim().split(/\s+/).filter(M=>M.length>0);O={name:f,transport:"stdio",command:h.trim(),...B.length?{args:B}:{}}}else{const B=S.trim();try{new URL(B)}catch{E("URL is not valid.");return}O={name:f,transport:o,url:B}}l(O)}return d.jsx(nn,{open:e,onOpenChange:t,children:d.jsxs(Xt,{children:[d.jsx(gn,{children:d.jsx(an,{children:n?"Edit MCP server":"Add MCP server"})}),d.jsxs("form",{onSubmit:C,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"mcp-transport",children:"Transport"}),d.jsxs("select",{id:"mcp-transport",value:o,onChange:T=>u(T.target.value),className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[d.jsx("option",{value:"stdio",children:"stdio (local subprocess)"}),d.jsx("option",{value:"http",children:"http"}),d.jsx("option",{value:"sse",children:"sse"})]})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"mcp-name",children:"Name"}),d.jsx(kt,{id:"mcp-name",value:f,onChange:T=>m(T.target.value),placeholder:"playwright",className:"font-mono"})]}),o==="stdio"?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"mcp-command",children:"Command"}),d.jsx(kt,{id:"mcp-command",value:h,onChange:T=>g(T.target.value),placeholder:"/usr/local/bin/playwright-mcp",className:"font-mono"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"mcp-args",children:"Args (space-separated, optional)"}),d.jsx(kt,{id:"mcp-args",value:y,onChange:T=>b(T.target.value),placeholder:"--port 3000",className:"font-mono"})]})]}):d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"mcp-url",children:"URL"}),d.jsx(kt,{id:"mcp-url",value:S,onChange:T=>k(T.target.value),placeholder:"https://internal.api/mcp",className:"font-mono"})]}),j&&d.jsx("p",{className:"text-body text-destructive",children:j}),d.jsxs(rn,{children:[d.jsx(be,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),d.jsx(be,{type:"submit",children:n?"Done":"Add"})]})]})]})})}const L1=[{value:"opus",label:"opus",hint:"most capable"},{value:"sonnet",label:"sonnet",hint:"balanced"},{value:"haiku",label:"haiku",hint:"fastest"}];function hI({value:e,baseline:t,onChange:n,onRevert:a,disabled:l}){const o=e!==t,u=!L1.some(f=>f.value===e)&&e!=="";return d.jsxs(yn,{style:{borderColor:o?"color-mix(in oklch, var(--state-blocked) 70%, transparent)":void 0},children:[d.jsxs(Vr,{children:[d.jsxs(Qr,{children:["Model",o&&d.jsx("span",{className:"mono uppercase text-caption",style:{padding:"var(--hairline) var(--sp-1_5)",borderRadius:"var(--radius-chip)",background:"color-mix(in oklch, var(--state-blocked) 16%, transparent)",color:"color-mix(in oklch, var(--state-blocked) 60%, var(--fg))"},children:"changed"})]}),o&&d.jsx(be,{size:"xs",variant:"ghost",onClick:a,disabled:l,children:"Revert"})]}),d.jsxs(Ca,{className:"space-y-2",children:[d.jsxs("select",{value:e,onChange:f=>n(f.target.value),disabled:l,className:"flex h-9 w-full max-w-md rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50",children:[e===""&&d.jsx("option",{value:"",children:"(unset — inherits local)"}),L1.map(f=>d.jsxs("option",{value:f.value,children:[f.label,f.hint?` — ${f.hint}`:""]},f.value)),u&&d.jsxs("option",{value:e,children:[e," — custom"]})]}),d.jsxs("p",{className:"text-caption text-muted-foreground",children:["Choose which Claude model powers this agent. Aliases (opus / sonnet / haiku) follow the CLI's latest-in-family mapping and may shift across releases. Applies to new sessions immediately; active sessions switch on their next message. Unset falls back to the operator's local ",d.jsx("code",{children:"~/.claude/settings.json"})," model preference, then the CLI default."]})]})]})}function mI(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const pI=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,gI=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,yI={};function I1(e,t){return(yI.jsx?gI:pI).test(e)}const vI=/[ \t\n\f\r]/g;function bI(e){return typeof e=="object"?e.type==="text"?U1(e.value):!1:U1(e)}function U1(e){return e.replace(vI,"")===""}class zu{constructor(t,n,a){this.normal=n,this.property=t,a&&(this.space=a)}}zu.prototype.normal={};zu.prototype.property={};zu.prototype.space=void 0;function iC(e,t){const n={},a={};for(const l of e)Object.assign(n,l.property),Object.assign(a,l.normal);return new zu(n,a,t)}function Yp(e){return e.toLowerCase()}class Zn{constructor(t,n){this.attribute=n,this.property=t}}Zn.prototype.attribute="";Zn.prototype.booleanish=!1;Zn.prototype.boolean=!1;Zn.prototype.commaOrSpaceSeparated=!1;Zn.prototype.commaSeparated=!1;Zn.prototype.defined=!1;Zn.prototype.mustUseProperty=!1;Zn.prototype.number=!1;Zn.prototype.overloadedBoolean=!1;Zn.prototype.property="";Zn.prototype.spaceSeparated=!1;Zn.prototype.space=void 0;let xI=0;const He=bl(),Vt=bl(),Xp=bl(),pe=bl(),Ct=bl(),xs=bl(),Wn=bl();function bl(){return 2**++xI}const Jp=Object.freeze(Object.defineProperty({__proto__:null,boolean:He,booleanish:Vt,commaOrSpaceSeparated:Wn,commaSeparated:xs,number:pe,overloadedBoolean:Xp,spaceSeparated:Ct},Symbol.toStringTag,{value:"Module"})),Xm=Object.keys(Jp);class Yg extends Zn{constructor(t,n,a,l){let o=-1;if(super(t,n),P1(this,"space",l),typeof a=="number")for(;++o<Xm.length;){const u=Xm[o];P1(this,Xm[o],(a&Jp[u])===Jp[u])}}}Yg.prototype.defined=!0;function P1(e,t,n){n&&(e[t]=n)}function Vs(e){const t={},n={};for(const[a,l]of Object.entries(e.properties)){const o=new Yg(a,e.transform(e.attributes||{},a),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(o.mustUseProperty=!0),t[a]=o,n[Yp(a)]=a,n[Yp(o.attribute)]=a}return new zu(t,n,e.space)}const lC=Vs({properties:{ariaActiveDescendant:null,ariaAtomic:Vt,ariaAutoComplete:null,ariaBusy:Vt,ariaChecked:Vt,ariaColCount:pe,ariaColIndex:pe,ariaColSpan:pe,ariaControls:Ct,ariaCurrent:null,ariaDescribedBy:Ct,ariaDetails:null,ariaDisabled:Vt,ariaDropEffect:Ct,ariaErrorMessage:null,ariaExpanded:Vt,ariaFlowTo:Ct,ariaGrabbed:Vt,ariaHasPopup:null,ariaHidden:Vt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ct,ariaLevel:pe,ariaLive:null,ariaModal:Vt,ariaMultiLine:Vt,ariaMultiSelectable:Vt,ariaOrientation:null,ariaOwns:Ct,ariaPlaceholder:null,ariaPosInSet:pe,ariaPressed:Vt,ariaReadOnly:Vt,ariaRelevant:null,ariaRequired:Vt,ariaRoleDescription:Ct,ariaRowCount:pe,ariaRowIndex:pe,ariaRowSpan:pe,ariaSelected:Vt,ariaSetSize:pe,ariaSort:null,ariaValueMax:pe,ariaValueMin:pe,ariaValueNow:pe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function sC(e,t){return t in e?e[t]:t}function oC(e,t){return sC(e,t.toLowerCase())}const SI=Vs({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:xs,acceptCharset:Ct,accessKey:Ct,action:null,allow:null,allowFullScreen:He,allowPaymentRequest:He,allowUserMedia:He,alt:null,as:null,async:He,autoCapitalize:null,autoComplete:Ct,autoFocus:He,autoPlay:He,blocking:Ct,capture:null,charSet:null,checked:He,cite:null,className:Ct,cols:pe,colSpan:null,content:null,contentEditable:Vt,controls:He,controlsList:Ct,coords:pe|xs,crossOrigin:null,data:null,dateTime:null,decoding:null,default:He,defer:He,dir:null,dirName:null,disabled:He,download:Xp,draggable:Vt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:He,formTarget:null,headers:Ct,height:pe,hidden:Xp,high:pe,href:null,hrefLang:null,htmlFor:Ct,httpEquiv:Ct,id:null,imageSizes:null,imageSrcSet:null,inert:He,inputMode:null,integrity:null,is:null,isMap:He,itemId:null,itemProp:Ct,itemRef:Ct,itemScope:He,itemType:Ct,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:He,low:pe,manifest:null,max:null,maxLength:pe,media:null,method:null,min:null,minLength:pe,multiple:He,muted:He,name:null,nonce:null,noModule:He,noValidate:He,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:He,optimum:pe,pattern:null,ping:Ct,placeholder:null,playsInline:He,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:He,referrerPolicy:null,rel:Ct,required:He,reversed:He,rows:pe,rowSpan:pe,sandbox:Ct,scope:null,scoped:He,seamless:He,selected:He,shadowRootClonable:He,shadowRootDelegatesFocus:He,shadowRootMode:null,shape:null,size:pe,sizes:null,slot:null,span:pe,spellCheck:Vt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:pe,step:null,style:null,tabIndex:pe,target:null,title:null,translate:null,type:null,typeMustMatch:He,useMap:null,value:Vt,width:pe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ct,axis:null,background:null,bgColor:null,border:pe,borderColor:null,bottomMargin:pe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:He,declare:He,event:null,face:null,frame:null,frameBorder:null,hSpace:pe,leftMargin:pe,link:null,longDesc:null,lowSrc:null,marginHeight:pe,marginWidth:pe,noResize:He,noHref:He,noShade:He,noWrap:He,object:null,profile:null,prompt:null,rev:null,rightMargin:pe,rules:null,scheme:null,scrolling:Vt,standby:null,summary:null,text:null,topMargin:pe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:pe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:He,disableRemotePlayback:He,prefix:null,property:null,results:pe,security:null,unselectable:null},space:"html",transform:oC}),wI=Vs({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Wn,accentHeight:pe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:pe,amplitude:pe,arabicForm:null,ascent:pe,attributeName:null,attributeType:null,azimuth:pe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:pe,by:null,calcMode:null,capHeight:pe,className:Ct,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:pe,diffuseConstant:pe,direction:null,display:null,dur:null,divisor:pe,dominantBaseline:null,download:He,dx:null,dy:null,edgeMode:null,editable:null,elevation:pe,enableBackground:null,end:null,event:null,exponent:pe,externalResourcesRequired:null,fill:null,fillOpacity:pe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:xs,g2:xs,glyphName:xs,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:pe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:pe,horizOriginX:pe,horizOriginY:pe,id:null,ideographic:pe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:pe,k:pe,k1:pe,k2:pe,k3:pe,k4:pe,kernelMatrix:Wn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:pe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:pe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:pe,overlineThickness:pe,paintOrder:null,panose1:null,path:null,pathLength:pe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ct,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:pe,pointsAtY:pe,pointsAtZ:pe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Wn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Wn,rev:Wn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Wn,requiredFeatures:Wn,requiredFonts:Wn,requiredFormats:Wn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:pe,specularExponent:pe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:pe,strikethroughThickness:pe,string:null,stroke:null,strokeDashArray:Wn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:pe,strokeOpacity:pe,strokeWidth:null,style:null,surfaceScale:pe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Wn,tabIndex:pe,tableValues:null,target:null,targetX:pe,targetY:pe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Wn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:pe,underlineThickness:pe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:pe,values:null,vAlphabetic:pe,vMathematical:pe,vectorEffect:null,vHanging:pe,vIdeographic:pe,version:null,vertAdvY:pe,vertOriginX:pe,vertOriginY:pe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:pe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:sC}),uC=Vs({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),cC=Vs({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:oC}),dC=Vs({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),kI={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},jI=/[A-Z]/g,B1=/-[a-z]/g,CI=/^data[-\w.:]+$/i;function EI(e,t){const n=Yp(t);let a=t,l=Zn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&CI.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(B1,_I);a="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!B1.test(o)){let u=o.replace(jI,NI);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}l=Yg}return new l(a,t)}function NI(e){return"-"+e.toLowerCase()}function _I(e){return e.charAt(1).toUpperCase()}const AI=iC([lC,SI,uC,cC,dC],"html"),Xg=iC([lC,wI,uC,cC,dC],"svg");function TI(e){return e.join(" ").trim()}var os={},Jm,$1;function RI(){if($1)return Jm;$1=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,f=/^\s+|\s+$/g,m=`
333
+ `,h="/",g="*",y="",b="comment",S="declaration";function k(E,C){if(typeof E!="string")throw new TypeError("First argument must be a string");if(!E)return[];C=C||{};var T=1,O=1;function B(de){var ee=de.match(t);ee&&(T+=ee.length);var H=de.lastIndexOf(m);O=~H?de.length-H:O+de.length}function M(){var de={line:T,column:O};return function(ee){return ee.position=new R(de),te(),ee}}function R(de){this.start=de,this.end={line:T,column:O},this.source=C.source}R.prototype.content=E;function D(de){var ee=new Error(C.source+":"+T+":"+O+": "+de);if(ee.reason=de,ee.filename=C.source,ee.line=T,ee.column=O,ee.source=E,!C.silent)throw ee}function Z(de){var ee=de.exec(E);if(ee){var H=ee[0];return B(H),E=E.slice(H.length),ee}}function te(){Z(n)}function q(de){var ee;for(de=de||[];ee=oe();)ee!==!1&&de.push(ee);return de}function oe(){var de=M();if(!(h!=E.charAt(0)||g!=E.charAt(1))){for(var ee=2;y!=E.charAt(ee)&&(g!=E.charAt(ee)||h!=E.charAt(ee+1));)++ee;if(ee+=2,y===E.charAt(ee-1))return D("End of comment missing");var H=E.slice(2,ee-2);return O+=2,B(H),E=E.slice(ee),O+=2,de({type:b,comment:H})}}function W(){var de=M(),ee=Z(a);if(ee){if(oe(),!Z(l))return D("property missing ':'");var H=Z(o),re=de({type:S,property:j(ee[0].replace(e,y)),value:H?j(H[0].replace(e,y)):y});return Z(u),re}}function me(){var de=[];q(de);for(var ee;ee=W();)ee!==!1&&(de.push(ee),q(de));return de}return te(),me()}function j(E){return E?E.replace(f,y):y}return Jm=k,Jm}var F1;function zI(){if(F1)return os;F1=1;var e=os&&os.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(os,"__esModule",{value:!0}),os.default=n;const t=e(RI());function n(a,l){let o=null;if(!a||typeof a!="string")return o;const u=(0,t.default)(a),f=typeof l=="function";return u.forEach(m=>{if(m.type!=="declaration")return;const{property:h,value:g}=m;f?l(h,g,m):g&&(o=o||{},o[h]=g)}),o}return os}var Qo={},q1;function OI(){if(q1)return Qo;q1=1,Object.defineProperty(Qo,"__esModule",{value:!0}),Qo.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,l=/^-(ms)-/,o=function(h){return!h||n.test(h)||e.test(h)},u=function(h,g){return g.toUpperCase()},f=function(h,g){return"".concat(g,"-")},m=function(h,g){return g===void 0&&(g={}),o(h)?h:(h=h.toLowerCase(),g.reactCompat?h=h.replace(l,f):h=h.replace(a,f),h.replace(t,u))};return Qo.camelCase=m,Qo}var Go,H1;function MI(){if(H1)return Go;H1=1;var e=Go&&Go.__importDefault||function(l){return l&&l.__esModule?l:{default:l}},t=e(zI()),n=OI();function a(l,o){var u={};return!l||typeof l!="string"||(0,t.default)(l,function(f,m){f&&m&&(u[(0,n.camelCase)(f,o)]=m)}),u}return a.default=a,Go=a,Go}var DI=MI();const LI=$d(DI),fC=hC("end"),Jg=hC("start");function hC(e){return t;function t(n){const a=n&&n.position&&n.position[e]||{};if(typeof a.line=="number"&&a.line>0&&typeof a.column=="number"&&a.column>0)return{line:a.line,column:a.column,offset:typeof a.offset=="number"&&a.offset>-1?a.offset:void 0}}}function II(e){const t=Jg(e),n=fC(e);if(t&&n)return{start:t,end:n}}function ru(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Z1(e.position):"start"in e||"end"in e?Z1(e):"line"in e||"column"in e?Wp(e):""}function Wp(e){return V1(e&&e.line)+":"+V1(e&&e.column)}function Z1(e){return Wp(e&&e.start)+"-"+Wp(e&&e.end)}function V1(e){return e&&typeof e=="number"?e:1}class wn extends Error{constructor(t,n,a){super(),typeof n=="string"&&(a=n,n=void 0);let l="",o={},u=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?l=t:!o.cause&&t&&(u=!0,l=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof a=="string"){const m=a.indexOf(":");m===-1?o.ruleId=a:(o.source=a.slice(0,m),o.ruleId=a.slice(m+1))}if(!o.place&&o.ancestors&&o.ancestors){const m=o.ancestors[o.ancestors.length-1];m&&(o.place=m.position)}const f=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=l,this.line=f?f.line:void 0,this.name=ru(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=u&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}wn.prototype.file="";wn.prototype.name="";wn.prototype.reason="";wn.prototype.message="";wn.prototype.stack="";wn.prototype.column=void 0;wn.prototype.line=void 0;wn.prototype.ancestors=void 0;wn.prototype.cause=void 0;wn.prototype.fatal=void 0;wn.prototype.place=void 0;wn.prototype.ruleId=void 0;wn.prototype.source=void 0;const Wg={}.hasOwnProperty,UI=new Map,PI=/[A-Z]/g,BI=new Set(["table","tbody","thead","tfoot","tr"]),$I=new Set(["td","th"]),mC="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function FI(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let a;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");a=YI(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");a=KI(n,t.jsx,t.jsxs)}const l={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:a,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Xg:AI,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=pC(l,e,void 0);return o&&typeof o!="string"?o:l.create(e,l.Fragment,{children:o||void 0},void 0)}function pC(e,t,n){if(t.type==="element")return qI(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return HI(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return VI(e,t,n);if(t.type==="mdxjsEsm")return ZI(e,t);if(t.type==="root")return QI(e,t,n);if(t.type==="text")return GI(e,t)}function qI(e,t,n){const a=e.schema;let l=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(l=Xg,e.schema=l),e.ancestors.push(t);const o=yC(e,t.tagName,!1),u=XI(e,t);let f=ty(e,t);return BI.has(t.tagName)&&(f=f.filter(function(m){return typeof m=="string"?!bI(m):!0})),gC(e,u,o,t),ey(u,f),e.ancestors.pop(),e.schema=a,e.create(t,o,u,n)}function HI(e,t){if(t.data&&t.data.estree&&e.evaluater){const a=t.data.estree.body[0];return a.type,e.evaluater.evaluateExpression(a.expression)}gu(e,t.position)}function ZI(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);gu(e,t.position)}function VI(e,t,n){const a=e.schema;let l=a;t.name==="svg"&&a.space==="html"&&(l=Xg,e.schema=l),e.ancestors.push(t);const o=t.name===null?e.Fragment:yC(e,t.name,!0),u=JI(e,t),f=ty(e,t);return gC(e,u,o,t),ey(u,f),e.ancestors.pop(),e.schema=a,e.create(t,o,u,n)}function QI(e,t,n){const a={};return ey(a,ty(e,t)),e.create(t,e.Fragment,a,n)}function GI(e,t){return t.value}function gC(e,t,n,a){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=a)}function ey(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function KI(e,t,n){return a;function a(l,o,u,f){const h=Array.isArray(u.children)?n:t;return f?h(o,u,f):h(o,u)}}function YI(e,t){return n;function n(a,l,o,u){const f=Array.isArray(o.children),m=Jg(a);return t(l,o,u,f,{columnNumber:m?m.column-1:void 0,fileName:e,lineNumber:m?m.line:void 0},void 0)}}function XI(e,t){const n={};let a,l;for(l in t.properties)if(l!=="children"&&Wg.call(t.properties,l)){const o=WI(e,l,t.properties[l]);if(o){const[u,f]=o;e.tableCellAlignToStyle&&u==="align"&&typeof f=="string"&&$I.has(t.tagName)?a=f:n[u]=f}}if(a){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return n}function JI(e,t){const n={};for(const a of t.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&e.evaluater){const o=a.data.estree.body[0];o.type;const u=o.expression;u.type;const f=u.properties[0];f.type,Object.assign(n,e.evaluater.evaluateExpression(f.argument))}else gu(e,t.position);else{const l=a.name;let o;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&e.evaluater){const f=a.value.data.estree.body[0];f.type,o=e.evaluater.evaluateExpression(f.expression)}else gu(e,t.position);else o=a.value===null?!0:a.value;n[l]=o}return n}function ty(e,t){const n=[];let a=-1;const l=e.passKeys?new Map:UI;for(;++a<t.children.length;){const o=t.children[a];let u;if(e.passKeys){const m=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(m){const h=l.get(m)||0;u=m+"-"+h,l.set(m,h+1)}}const f=pC(e,o,u);f!==void 0&&n.push(f)}return n}function WI(e,t,n){const a=EI(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=a.commaSeparated?mI(n):TI(n)),a.property==="style"){let l=typeof n=="object"?n:eU(e,String(n));return e.stylePropertyNameCase==="css"&&(l=tU(l)),["style",l]}return[e.elementAttributeNameCase==="react"&&a.space?kI[a.property]||a.property:a.attribute,n]}}function eU(e,t){try{return LI(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const a=n,l=new wn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw l.file=e.filePath||void 0,l.url=mC+"#cannot-parse-style-attribute",l}}function yC(e,t,n){let a;if(!n)a={type:"Literal",value:t};else if(t.includes(".")){const l=t.split(".");let o=-1,u;for(;++o<l.length;){const f=I1(l[o])?{type:"Identifier",name:l[o]}:{type:"Literal",value:l[o]};u=u?{type:"MemberExpression",object:u,property:f,computed:!!(o&&f.type==="Literal"),optional:!1}:f}a=u}else a=I1(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(a.type==="Literal"){const l=a.value;return Wg.call(e.components,l)?e.components[l]:l}if(e.evaluater)return e.evaluater.evaluateExpression(a);gu(e)}function gu(e,t){const n=new wn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=mC+"#cannot-handle-mdx-estrees-without-createevaluater",n}function tU(e){const t={};let n;for(n in e)Wg.call(e,n)&&(t[nU(n)]=e[n]);return t}function nU(e){let t=e.replace(PI,rU);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function rU(e){return"-"+e.toLowerCase()}const Wm={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},aU={};function ny(e,t){const n=aU,a=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,l=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return vC(e,a,l)}function vC(e,t,n){if(iU(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Q1(e.children,t,n)}return Array.isArray(e)?Q1(e,t,n):""}function Q1(e,t,n){const a=[];let l=-1;for(;++l<e.length;)a[l]=vC(e[l],t,n);return a.join("")}function iU(e){return!!(e&&typeof e=="object")}const G1=document.createElement("i");function ry(e){const t="&"+e+";";G1.innerHTML=t;const n=G1.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function nr(e,t,n,a){const l=e.length;let o=0,u;if(t<0?t=-t>l?0:l+t:t=t>l?l:t,n=n>0?n:0,a.length<1e4)u=Array.from(a),u.unshift(t,n),e.splice(...u);else for(n&&e.splice(t,n);o<a.length;)u=a.slice(o,o+1e4),u.unshift(t,0),e.splice(...u),o+=1e4,t+=1e4}function gr(e,t){return e.length>0?(nr(e,e.length,0,t),e):t}const K1={}.hasOwnProperty;function bC(e){const t={};let n=-1;for(;++n<e.length;)lU(t,e[n]);return t}function lU(e,t){let n;for(n in t){const l=(K1.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let u;if(o)for(u in o){K1.call(l,u)||(l[u]=[]);const f=o[u];sU(l[u],Array.isArray(f)?f:f?[f]:[])}}}function sU(e,t){let n=-1;const a=[];for(;++n<t.length;)(t[n].add==="after"?e:a).push(t[n]);nr(e,0,0,a)}function xC(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function _r(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const _n=Ni(/[A-Za-z]/),Sn=Ni(/[\dA-Za-z]/),oU=Ni(/[#-'*+\--9=?A-Z^-~]/);function Id(e){return e!==null&&(e<32||e===127)}const eg=Ni(/\d/),uU=Ni(/[\dA-Fa-f]/),cU=Ni(/[!-/:-@[-`{-~]/);function Re(e){return e!==null&&e<-2}function jt(e){return e!==null&&(e<0||e===32)}function Ye(e){return e===-2||e===-1||e===32}const sf=Ni(new RegExp("\\p{P}|\\p{S}","u")),ml=Ni(/\s/);function Ni(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Qs(e){const t=[];let n=-1,a=0,l=0;for(;++n<e.length;){const o=e.charCodeAt(n);let u="";if(o===37&&Sn(e.charCodeAt(n+1))&&Sn(e.charCodeAt(n+2)))l=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(u=String.fromCharCode(o));else if(o>55295&&o<57344){const f=e.charCodeAt(n+1);o<56320&&f>56319&&f<57344?(u=String.fromCharCode(o,f),l=1):u="�"}else u=String.fromCharCode(o);u&&(t.push(e.slice(a,n),encodeURIComponent(u)),a=n+l+1,u=""),l&&(n+=l,l=0)}return t.join("")+e.slice(a)}function it(e,t,n,a){const l=a?a-1:Number.POSITIVE_INFINITY;let o=0;return u;function u(m){return Ye(m)?(e.enter(n),f(m)):t(m)}function f(m){return Ye(m)&&o++<l?(e.consume(m),f):(e.exit(n),t(m))}}const dU={tokenize:fU};function fU(e){const t=e.attempt(this.parser.constructs.contentInitial,a,l);let n;return t;function a(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),it(e,t,"linePrefix")}function l(f){return e.enter("paragraph"),o(f)}function o(f){const m=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=m),n=m,u(f)}function u(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return Re(f)?(e.consume(f),e.exit("chunkText"),o):(e.consume(f),u)}}const hU={tokenize:mU},Y1={tokenize:pU};function mU(e){const t=this,n=[];let a=0,l,o,u;return f;function f(O){if(a<n.length){const B=n[a];return t.containerState=B[1],e.attempt(B[0].continuation,m,h)(O)}return h(O)}function m(O){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,l&&T();const B=t.events.length;let M=B,R;for(;M--;)if(t.events[M][0]==="exit"&&t.events[M][1].type==="chunkFlow"){R=t.events[M][1].end;break}C(a);let D=B;for(;D<t.events.length;)t.events[D][1].end={...R},D++;return nr(t.events,M+1,0,t.events.slice(B)),t.events.length=D,h(O)}return f(O)}function h(O){if(a===n.length){if(!l)return b(O);if(l.currentConstruct&&l.currentConstruct.concrete)return k(O);t.interrupt=!!(l.currentConstruct&&!l._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Y1,g,y)(O)}function g(O){return l&&T(),C(a),b(O)}function y(O){return t.parser.lazy[t.now().line]=a!==n.length,u=t.now().offset,k(O)}function b(O){return t.containerState={},e.attempt(Y1,S,k)(O)}function S(O){return a++,n.push([t.currentConstruct,t.containerState]),b(O)}function k(O){if(O===null){l&&T(),C(0),e.consume(O);return}return l=l||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:l,contentType:"flow",previous:o}),j(O)}function j(O){if(O===null){E(e.exit("chunkFlow"),!0),C(0),e.consume(O);return}return Re(O)?(e.consume(O),E(e.exit("chunkFlow")),a=0,t.interrupt=void 0,f):(e.consume(O),j)}function E(O,B){const M=t.sliceStream(O);if(B&&M.push(null),O.previous=o,o&&(o.next=O),o=O,l.defineSkip(O.start),l.write(M),t.parser.lazy[O.start.line]){let R=l.events.length;for(;R--;)if(l.events[R][1].start.offset<u&&(!l.events[R][1].end||l.events[R][1].end.offset>u))return;const D=t.events.length;let Z=D,te,q;for(;Z--;)if(t.events[Z][0]==="exit"&&t.events[Z][1].type==="chunkFlow"){if(te){q=t.events[Z][1].end;break}te=!0}for(C(a),R=D;R<t.events.length;)t.events[R][1].end={...q},R++;nr(t.events,Z+1,0,t.events.slice(D)),t.events.length=R}}function C(O){let B=n.length;for(;B-- >O;){const M=n[B];t.containerState=M[1],M[0].exit.call(t,e)}n.length=O}function T(){l.write([null]),o=void 0,l=void 0,t.containerState._closeFlow=void 0}}function pU(e,t,n){return it(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Us(e){if(e===null||jt(e)||ml(e))return 1;if(sf(e))return 2}function of(e,t,n){const a=[];let l=-1;for(;++l<e.length;){const o=e[l].resolveAll;o&&!a.includes(o)&&(t=o(t,n),a.push(o))}return t}const tg={name:"attention",resolveAll:gU,tokenize:yU};function gU(e,t){let n=-1,a,l,o,u,f,m,h,g;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(a=n;a--;)if(e[a][0]==="exit"&&e[a][1].type==="attentionSequence"&&e[a][1]._open&&t.sliceSerialize(e[a][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[a][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[a][1].end.offset-e[a][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;m=e[a][1].end.offset-e[a][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const y={...e[a][1].end},b={...e[n][1].start};X1(y,-m),X1(b,m),u={type:m>1?"strongSequence":"emphasisSequence",start:y,end:{...e[a][1].end}},f={type:m>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:b},o={type:m>1?"strongText":"emphasisText",start:{...e[a][1].end},end:{...e[n][1].start}},l={type:m>1?"strong":"emphasis",start:{...u.start},end:{...f.end}},e[a][1].end={...u.start},e[n][1].start={...f.end},h=[],e[a][1].end.offset-e[a][1].start.offset&&(h=gr(h,[["enter",e[a][1],t],["exit",e[a][1],t]])),h=gr(h,[["enter",l,t],["enter",u,t],["exit",u,t],["enter",o,t]]),h=gr(h,of(t.parser.constructs.insideSpan.null,e.slice(a+1,n),t)),h=gr(h,[["exit",o,t],["enter",f,t],["exit",f,t],["exit",l,t]]),e[n][1].end.offset-e[n][1].start.offset?(g=2,h=gr(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):g=0,nr(e,a-1,n-a+3,h),n=a+h.length-g-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function yU(e,t){const n=this.parser.constructs.attentionMarkers.null,a=this.previous,l=Us(a);let o;return u;function u(m){return o=m,e.enter("attentionSequence"),f(m)}function f(m){if(m===o)return e.consume(m),f;const h=e.exit("attentionSequence"),g=Us(m),y=!g||g===2&&l||n.includes(m),b=!l||l===2&&g||n.includes(a);return h._open=!!(o===42?y:y&&(l||!b)),h._close=!!(o===42?b:b&&(g||!y)),t(m)}}function X1(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const vU={name:"autolink",tokenize:bU};function bU(e,t,n){let a=0;return l;function l(S){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(S),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(S){return _n(S)?(e.consume(S),u):S===64?n(S):h(S)}function u(S){return S===43||S===45||S===46||Sn(S)?(a=1,f(S)):h(S)}function f(S){return S===58?(e.consume(S),a=0,m):(S===43||S===45||S===46||Sn(S))&&a++<32?(e.consume(S),f):(a=0,h(S))}function m(S){return S===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(S),e.exit("autolinkMarker"),e.exit("autolink"),t):S===null||S===32||S===60||Id(S)?n(S):(e.consume(S),m)}function h(S){return S===64?(e.consume(S),g):oU(S)?(e.consume(S),h):n(S)}function g(S){return Sn(S)?y(S):n(S)}function y(S){return S===46?(e.consume(S),a=0,g):S===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(S),e.exit("autolinkMarker"),e.exit("autolink"),t):b(S)}function b(S){if((S===45||Sn(S))&&a++<63){const k=S===45?b:y;return e.consume(S),k}return n(S)}}const Ou={partial:!0,tokenize:xU};function xU(e,t,n){return a;function a(o){return Ye(o)?it(e,l,"linePrefix")(o):l(o)}function l(o){return o===null||Re(o)?t(o):n(o)}}const SC={continuation:{tokenize:wU},exit:kU,name:"blockQuote",tokenize:SU};function SU(e,t,n){const a=this;return l;function l(u){if(u===62){const f=a.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(u),e.exit("blockQuoteMarker"),o}return n(u)}function o(u){return Ye(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(u))}}function wU(e,t,n){const a=this;return l;function l(u){return Ye(u)?it(e,o,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):o(u)}function o(u){return e.attempt(SC,t,n)(u)}}function kU(e){e.exit("blockQuote")}const wC={name:"characterEscape",tokenize:jU};function jU(e,t,n){return a;function a(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),l}function l(o){return cU(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const kC={name:"characterReference",tokenize:CU};function CU(e,t,n){const a=this;let l=0,o,u;return f;function f(y){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(y),e.exit("characterReferenceMarker"),m}function m(y){return y===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(y),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),o=31,u=Sn,g(y))}function h(y){return y===88||y===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(y),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,u=uU,g):(e.enter("characterReferenceValue"),o=7,u=eg,g(y))}function g(y){if(y===59&&l){const b=e.exit("characterReferenceValue");return u===Sn&&!ry(a.sliceSerialize(b))?n(y):(e.enter("characterReferenceMarker"),e.consume(y),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return u(y)&&l++<o?(e.consume(y),g):n(y)}}const J1={partial:!0,tokenize:NU},W1={concrete:!0,name:"codeFenced",tokenize:EU};function EU(e,t,n){const a=this,l={partial:!0,tokenize:M};let o=0,u=0,f;return m;function m(R){return h(R)}function h(R){const D=a.events[a.events.length-1];return o=D&&D[1].type==="linePrefix"?D[2].sliceSerialize(D[1],!0).length:0,f=R,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(R)}function g(R){return R===f?(u++,e.consume(R),g):u<3?n(R):(e.exit("codeFencedFenceSequence"),Ye(R)?it(e,y,"whitespace")(R):y(R))}function y(R){return R===null||Re(R)?(e.exit("codeFencedFence"),a.interrupt?t(R):e.check(J1,j,B)(R)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(R))}function b(R){return R===null||Re(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),y(R)):Ye(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),it(e,S,"whitespace")(R)):R===96&&R===f?n(R):(e.consume(R),b)}function S(R){return R===null||Re(R)?y(R):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),k(R))}function k(R){return R===null||Re(R)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),y(R)):R===96&&R===f?n(R):(e.consume(R),k)}function j(R){return e.attempt(l,B,E)(R)}function E(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),C}function C(R){return o>0&&Ye(R)?it(e,T,"linePrefix",o+1)(R):T(R)}function T(R){return R===null||Re(R)?e.check(J1,j,B)(R):(e.enter("codeFlowValue"),O(R))}function O(R){return R===null||Re(R)?(e.exit("codeFlowValue"),T(R)):(e.consume(R),O)}function B(R){return e.exit("codeFenced"),t(R)}function M(R,D,Z){let te=0;return q;function q(ee){return R.enter("lineEnding"),R.consume(ee),R.exit("lineEnding"),oe}function oe(ee){return R.enter("codeFencedFence"),Ye(ee)?it(R,W,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ee):W(ee)}function W(ee){return ee===f?(R.enter("codeFencedFenceSequence"),me(ee)):Z(ee)}function me(ee){return ee===f?(te++,R.consume(ee),me):te>=u?(R.exit("codeFencedFenceSequence"),Ye(ee)?it(R,de,"whitespace")(ee):de(ee)):Z(ee)}function de(ee){return ee===null||Re(ee)?(R.exit("codeFencedFence"),D(ee)):Z(ee)}}}function NU(e,t,n){const a=this;return l;function l(u){return u===null?n(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o)}function o(u){return a.parser.lazy[a.now().line]?n(u):t(u)}}const ep={name:"codeIndented",tokenize:AU},_U={partial:!0,tokenize:TU};function AU(e,t,n){const a=this;return l;function l(h){return e.enter("codeIndented"),it(e,o,"linePrefix",5)(h)}function o(h){const g=a.events[a.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?u(h):n(h)}function u(h){return h===null?m(h):Re(h)?e.attempt(_U,u,m)(h):(e.enter("codeFlowValue"),f(h))}function f(h){return h===null||Re(h)?(e.exit("codeFlowValue"),u(h)):(e.consume(h),f)}function m(h){return e.exit("codeIndented"),t(h)}}function TU(e,t,n){const a=this;return l;function l(u){return a.parser.lazy[a.now().line]?n(u):Re(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l):it(e,o,"linePrefix",5)(u)}function o(u){const f=a.events[a.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(u):Re(u)?l(u):n(u)}}const RU={name:"codeText",previous:OU,resolve:zU,tokenize:MU};function zU(e){let t=e.length-4,n=3,a,l;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(a=n;++a<t;)if(e[a][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(a=n-1,t++;++a<=t;)l===void 0?a!==t&&e[a][1].type!=="lineEnding"&&(l=a):(a===t||e[a][1].type==="lineEnding")&&(e[l][1].type="codeTextData",a!==l+2&&(e[l][1].end=e[a-1][1].end,e.splice(l+2,a-l-2),t-=a-l-2,a=l+2),l=void 0);return e}function OU(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function MU(e,t,n){let a=0,l,o;return u;function u(y){return e.enter("codeText"),e.enter("codeTextSequence"),f(y)}function f(y){return y===96?(e.consume(y),a++,f):(e.exit("codeTextSequence"),m(y))}function m(y){return y===null?n(y):y===32?(e.enter("space"),e.consume(y),e.exit("space"),m):y===96?(o=e.enter("codeTextSequence"),l=0,g(y)):Re(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),m):(e.enter("codeTextData"),h(y))}function h(y){return y===null||y===32||y===96||Re(y)?(e.exit("codeTextData"),m(y)):(e.consume(y),h)}function g(y){return y===96?(e.consume(y),l++,g):l===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(y)):(o.type="codeTextData",h(y))}}class DU{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const a=n??Number.POSITIVE_INFINITY;return a<this.left.length?this.left.slice(t,a):t>this.left.length?this.right.slice(this.right.length-a+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-a+this.left.length).reverse())}splice(t,n,a){const l=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-l,Number.POSITIVE_INFINITY);return a&&Ko(this.left,a),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Ko(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ko(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Ko(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Ko(this.left,n.reverse())}}}function Ko(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function jC(e){const t={};let n=-1,a,l,o,u,f,m,h;const g=new DU(e);for(;++n<g.length;){for(;n in t;)n=t[n];if(a=g.get(n),n&&a[1].type==="chunkFlow"&&g.get(n-1)[1].type==="listItemPrefix"&&(m=a[1]._tokenizer.events,o=0,o<m.length&&m[o][1].type==="lineEndingBlank"&&(o+=2),o<m.length&&m[o][1].type==="content"))for(;++o<m.length&&m[o][1].type!=="content";)m[o][1].type==="chunkText"&&(m[o][1]._isInFirstContentOfListItem=!0,o++);if(a[0]==="enter")a[1].contentType&&(Object.assign(t,LU(g,n)),n=t[n],h=!0);else if(a[1]._container){for(o=n,l=void 0;o--;)if(u=g.get(o),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(l&&(g.get(l)[1].type="lineEndingBlank"),u[1].type="lineEnding",l=o);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;l&&(a[1].end={...g.get(l)[1].start},f=g.slice(l,n),f.unshift(a),g.splice(l,n-l+1,f))}}return nr(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!h}function LU(e,t){const n=e.get(t)[1],a=e.get(t)[2];let l=t-1;const o=[];let u=n._tokenizer;u||(u=a.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const f=u.events,m=[],h={};let g,y,b=-1,S=n,k=0,j=0;const E=[j];for(;S;){for(;e.get(++l)[1]!==S;);o.push(l),S._tokenizer||(g=a.sliceStream(S),S.next||g.push(null),y&&u.defineSkip(S.start),S._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(g),S._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),y=S,S=S.next}for(S=n;++b<f.length;)f[b][0]==="exit"&&f[b-1][0]==="enter"&&f[b][1].type===f[b-1][1].type&&f[b][1].start.line!==f[b][1].end.line&&(j=b+1,E.push(j),S._tokenizer=void 0,S.previous=void 0,S=S.next);for(u.events=[],S?(S._tokenizer=void 0,S.previous=void 0):E.pop(),b=E.length;b--;){const C=f.slice(E[b],E[b+1]),T=o.pop();m.push([T,T+C.length-1]),e.splice(T,2,C)}for(m.reverse(),b=-1;++b<m.length;)h[k+m[b][0]]=k+m[b][1],k+=m[b][1]-m[b][0]-1;return h}const IU={resolve:PU,tokenize:BU},UU={partial:!0,tokenize:$U};function PU(e){return jC(e),e}function BU(e,t){let n;return a;function a(f){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),l(f)}function l(f){return f===null?o(f):Re(f)?e.check(UU,u,o)(f):(e.consume(f),l)}function o(f){return e.exit("chunkContent"),e.exit("content"),t(f)}function u(f){return e.consume(f),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,l}}function $U(e,t,n){const a=this;return l;function l(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),it(e,o,"linePrefix")}function o(u){if(u===null||Re(u))return n(u);const f=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(u):e.interrupt(a.parser.constructs.flow,n,t)(u)}}function CC(e,t,n,a,l,o,u,f,m){const h=m||Number.POSITIVE_INFINITY;let g=0;return y;function y(C){return C===60?(e.enter(a),e.enter(l),e.enter(o),e.consume(C),e.exit(o),b):C===null||C===32||C===41||Id(C)?n(C):(e.enter(a),e.enter(u),e.enter(f),e.enter("chunkString",{contentType:"string"}),j(C))}function b(C){return C===62?(e.enter(o),e.consume(C),e.exit(o),e.exit(l),e.exit(a),t):(e.enter(f),e.enter("chunkString",{contentType:"string"}),S(C))}function S(C){return C===62?(e.exit("chunkString"),e.exit(f),b(C)):C===null||C===60||Re(C)?n(C):(e.consume(C),C===92?k:S)}function k(C){return C===60||C===62||C===92?(e.consume(C),S):S(C)}function j(C){return!g&&(C===null||C===41||jt(C))?(e.exit("chunkString"),e.exit(f),e.exit(u),e.exit(a),t(C)):g<h&&C===40?(e.consume(C),g++,j):C===41?(e.consume(C),g--,j):C===null||C===32||C===40||Id(C)?n(C):(e.consume(C),C===92?E:j)}function E(C){return C===40||C===41||C===92?(e.consume(C),j):j(C)}}function EC(e,t,n,a,l,o){const u=this;let f=0,m;return h;function h(S){return e.enter(a),e.enter(l),e.consume(S),e.exit(l),e.enter(o),g}function g(S){return f>999||S===null||S===91||S===93&&!m||S===94&&!f&&"_hiddenFootnoteSupport"in u.parser.constructs?n(S):S===93?(e.exit(o),e.enter(l),e.consume(S),e.exit(l),e.exit(a),t):Re(S)?(e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),y(S))}function y(S){return S===null||S===91||S===93||Re(S)||f++>999?(e.exit("chunkString"),g(S)):(e.consume(S),m||(m=!Ye(S)),S===92?b:y)}function b(S){return S===91||S===92||S===93?(e.consume(S),f++,y):y(S)}}function NC(e,t,n,a,l,o){let u;return f;function f(b){return b===34||b===39||b===40?(e.enter(a),e.enter(l),e.consume(b),e.exit(l),u=b===40?41:b,m):n(b)}function m(b){return b===u?(e.enter(l),e.consume(b),e.exit(l),e.exit(a),t):(e.enter(o),h(b))}function h(b){return b===u?(e.exit(o),m(u)):b===null?n(b):Re(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),it(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(b))}function g(b){return b===u||b===null||Re(b)?(e.exit("chunkString"),h(b)):(e.consume(b),b===92?y:g)}function y(b){return b===u||b===92?(e.consume(b),g):g(b)}}function au(e,t){let n;return a;function a(l){return Re(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n=!0,a):Ye(l)?it(e,a,n?"linePrefix":"lineSuffix")(l):t(l)}}const FU={name:"definition",tokenize:HU},qU={partial:!0,tokenize:ZU};function HU(e,t,n){const a=this;let l;return o;function o(S){return e.enter("definition"),u(S)}function u(S){return EC.call(a,e,f,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(S)}function f(S){return l=_r(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),S===58?(e.enter("definitionMarker"),e.consume(S),e.exit("definitionMarker"),m):n(S)}function m(S){return jt(S)?au(e,h)(S):h(S)}function h(S){return CC(e,g,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(S)}function g(S){return e.attempt(qU,y,y)(S)}function y(S){return Ye(S)?it(e,b,"whitespace")(S):b(S)}function b(S){return S===null||Re(S)?(e.exit("definition"),a.parser.defined.push(l),t(S)):n(S)}}function ZU(e,t,n){return a;function a(f){return jt(f)?au(e,l)(f):n(f)}function l(f){return NC(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function o(f){return Ye(f)?it(e,u,"whitespace")(f):u(f)}function u(f){return f===null||Re(f)?t(f):n(f)}}const VU={name:"hardBreakEscape",tokenize:QU};function QU(e,t,n){return a;function a(o){return e.enter("hardBreakEscape"),e.consume(o),l}function l(o){return Re(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const GU={name:"headingAtx",resolve:KU,tokenize:YU};function KU(e,t){let n=e.length-2,a=3,l,o;return e[a][1].type==="whitespace"&&(a+=2),n-2>a&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(a===n-1||n-4>a&&e[n-2][1].type==="whitespace")&&(n-=a+1===n?2:4),n>a&&(l={type:"atxHeadingText",start:e[a][1].start,end:e[n][1].end},o={type:"chunkText",start:e[a][1].start,end:e[n][1].end,contentType:"text"},nr(e,a,n-a+1,[["enter",l,t],["enter",o,t],["exit",o,t],["exit",l,t]])),e}function YU(e,t,n){let a=0;return l;function l(g){return e.enter("atxHeading"),o(g)}function o(g){return e.enter("atxHeadingSequence"),u(g)}function u(g){return g===35&&a++<6?(e.consume(g),u):g===null||jt(g)?(e.exit("atxHeadingSequence"),f(g)):n(g)}function f(g){return g===35?(e.enter("atxHeadingSequence"),m(g)):g===null||Re(g)?(e.exit("atxHeading"),t(g)):Ye(g)?it(e,f,"whitespace")(g):(e.enter("atxHeadingText"),h(g))}function m(g){return g===35?(e.consume(g),m):(e.exit("atxHeadingSequence"),f(g))}function h(g){return g===null||g===35||jt(g)?(e.exit("atxHeadingText"),f(g)):(e.consume(g),h)}}const XU=["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","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],eS=["pre","script","style","textarea"],JU={concrete:!0,name:"htmlFlow",resolveTo:t9,tokenize:n9},WU={partial:!0,tokenize:a9},e9={partial:!0,tokenize:r9};function t9(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function n9(e,t,n){const a=this;let l,o,u,f,m;return h;function h(_){return g(_)}function g(_){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(_),y}function y(_){return _===33?(e.consume(_),b):_===47?(e.consume(_),o=!0,j):_===63?(e.consume(_),l=3,a.interrupt?t:A):_n(_)?(e.consume(_),u=String.fromCharCode(_),E):n(_)}function b(_){return _===45?(e.consume(_),l=2,S):_===91?(e.consume(_),l=5,f=0,k):_n(_)?(e.consume(_),l=4,a.interrupt?t:A):n(_)}function S(_){return _===45?(e.consume(_),a.interrupt?t:A):n(_)}function k(_){const $="CDATA[";return _===$.charCodeAt(f++)?(e.consume(_),f===$.length?a.interrupt?t:W:k):n(_)}function j(_){return _n(_)?(e.consume(_),u=String.fromCharCode(_),E):n(_)}function E(_){if(_===null||_===47||_===62||jt(_)){const $=_===47,X=u.toLowerCase();return!$&&!o&&eS.includes(X)?(l=1,a.interrupt?t(_):W(_)):XU.includes(u.toLowerCase())?(l=6,$?(e.consume(_),C):a.interrupt?t(_):W(_)):(l=7,a.interrupt&&!a.parser.lazy[a.now().line]?n(_):o?T(_):O(_))}return _===45||Sn(_)?(e.consume(_),u+=String.fromCharCode(_),E):n(_)}function C(_){return _===62?(e.consume(_),a.interrupt?t:W):n(_)}function T(_){return Ye(_)?(e.consume(_),T):q(_)}function O(_){return _===47?(e.consume(_),q):_===58||_===95||_n(_)?(e.consume(_),B):Ye(_)?(e.consume(_),O):q(_)}function B(_){return _===45||_===46||_===58||_===95||Sn(_)?(e.consume(_),B):M(_)}function M(_){return _===61?(e.consume(_),R):Ye(_)?(e.consume(_),M):O(_)}function R(_){return _===null||_===60||_===61||_===62||_===96?n(_):_===34||_===39?(e.consume(_),m=_,D):Ye(_)?(e.consume(_),R):Z(_)}function D(_){return _===m?(e.consume(_),m=null,te):_===null||Re(_)?n(_):(e.consume(_),D)}function Z(_){return _===null||_===34||_===39||_===47||_===60||_===61||_===62||_===96||jt(_)?M(_):(e.consume(_),Z)}function te(_){return _===47||_===62||Ye(_)?O(_):n(_)}function q(_){return _===62?(e.consume(_),oe):n(_)}function oe(_){return _===null||Re(_)?W(_):Ye(_)?(e.consume(_),oe):n(_)}function W(_){return _===45&&l===2?(e.consume(_),H):_===60&&l===1?(e.consume(_),re):_===62&&l===4?(e.consume(_),I):_===63&&l===3?(e.consume(_),A):_===93&&l===5?(e.consume(_),he):Re(_)&&(l===6||l===7)?(e.exit("htmlFlowData"),e.check(WU,U,me)(_)):_===null||Re(_)?(e.exit("htmlFlowData"),me(_)):(e.consume(_),W)}function me(_){return e.check(e9,de,U)(_)}function de(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),ee}function ee(_){return _===null||Re(_)?me(_):(e.enter("htmlFlowData"),W(_))}function H(_){return _===45?(e.consume(_),A):W(_)}function re(_){return _===47?(e.consume(_),u="",K):W(_)}function K(_){if(_===62){const $=u.toLowerCase();return eS.includes($)?(e.consume(_),I):W(_)}return _n(_)&&u.length<8?(e.consume(_),u+=String.fromCharCode(_),K):W(_)}function he(_){return _===93?(e.consume(_),A):W(_)}function A(_){return _===62?(e.consume(_),I):_===45&&l===2?(e.consume(_),A):W(_)}function I(_){return _===null||Re(_)?(e.exit("htmlFlowData"),U(_)):(e.consume(_),I)}function U(_){return e.exit("htmlFlow"),t(_)}}function r9(e,t,n){const a=this;return l;function l(u){return Re(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o):n(u)}function o(u){return a.parser.lazy[a.now().line]?n(u):t(u)}}function a9(e,t,n){return a;function a(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),e.attempt(Ou,t,n)}}const i9={name:"htmlText",tokenize:l9};function l9(e,t,n){const a=this;let l,o,u;return f;function f(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),m}function m(A){return A===33?(e.consume(A),h):A===47?(e.consume(A),M):A===63?(e.consume(A),O):_n(A)?(e.consume(A),Z):n(A)}function h(A){return A===45?(e.consume(A),g):A===91?(e.consume(A),o=0,k):_n(A)?(e.consume(A),T):n(A)}function g(A){return A===45?(e.consume(A),S):n(A)}function y(A){return A===null?n(A):A===45?(e.consume(A),b):Re(A)?(u=y,re(A)):(e.consume(A),y)}function b(A){return A===45?(e.consume(A),S):y(A)}function S(A){return A===62?H(A):A===45?b(A):y(A)}function k(A){const I="CDATA[";return A===I.charCodeAt(o++)?(e.consume(A),o===I.length?j:k):n(A)}function j(A){return A===null?n(A):A===93?(e.consume(A),E):Re(A)?(u=j,re(A)):(e.consume(A),j)}function E(A){return A===93?(e.consume(A),C):j(A)}function C(A){return A===62?H(A):A===93?(e.consume(A),C):j(A)}function T(A){return A===null||A===62?H(A):Re(A)?(u=T,re(A)):(e.consume(A),T)}function O(A){return A===null?n(A):A===63?(e.consume(A),B):Re(A)?(u=O,re(A)):(e.consume(A),O)}function B(A){return A===62?H(A):O(A)}function M(A){return _n(A)?(e.consume(A),R):n(A)}function R(A){return A===45||Sn(A)?(e.consume(A),R):D(A)}function D(A){return Re(A)?(u=D,re(A)):Ye(A)?(e.consume(A),D):H(A)}function Z(A){return A===45||Sn(A)?(e.consume(A),Z):A===47||A===62||jt(A)?te(A):n(A)}function te(A){return A===47?(e.consume(A),H):A===58||A===95||_n(A)?(e.consume(A),q):Re(A)?(u=te,re(A)):Ye(A)?(e.consume(A),te):H(A)}function q(A){return A===45||A===46||A===58||A===95||Sn(A)?(e.consume(A),q):oe(A)}function oe(A){return A===61?(e.consume(A),W):Re(A)?(u=oe,re(A)):Ye(A)?(e.consume(A),oe):te(A)}function W(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),l=A,me):Re(A)?(u=W,re(A)):Ye(A)?(e.consume(A),W):(e.consume(A),de)}function me(A){return A===l?(e.consume(A),l=void 0,ee):A===null?n(A):Re(A)?(u=me,re(A)):(e.consume(A),me)}function de(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||jt(A)?te(A):(e.consume(A),de)}function ee(A){return A===47||A===62||jt(A)?te(A):n(A)}function H(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):n(A)}function re(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),K}function K(A){return Ye(A)?it(e,he,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):he(A)}function he(A){return e.enter("htmlTextData"),u(A)}}const ay={name:"labelEnd",resolveAll:c9,resolveTo:d9,tokenize:f9},s9={tokenize:h9},o9={tokenize:m9},u9={tokenize:p9};function c9(e){let t=-1;const n=[];for(;++t<e.length;){const a=e[t][1];if(n.push(e[t]),a.type==="labelImage"||a.type==="labelLink"||a.type==="labelEnd"){const l=a.type==="labelImage"?4:2;a.type="data",t+=l}}return e.length!==n.length&&nr(e,0,e.length,n),e}function d9(e,t){let n=e.length,a=0,l,o,u,f;for(;n--;)if(l=e[n][1],o){if(l.type==="link"||l.type==="labelLink"&&l._inactive)break;e[n][0]==="enter"&&l.type==="labelLink"&&(l._inactive=!0)}else if(u){if(e[n][0]==="enter"&&(l.type==="labelImage"||l.type==="labelLink")&&!l._balanced&&(o=n,l.type!=="labelLink")){a=2;break}}else l.type==="labelEnd"&&(u=n);const m={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[o][1].start},end:{...e[u][1].end}},g={type:"labelText",start:{...e[o+a+2][1].end},end:{...e[u-2][1].start}};return f=[["enter",m,t],["enter",h,t]],f=gr(f,e.slice(o+1,o+a+3)),f=gr(f,[["enter",g,t]]),f=gr(f,of(t.parser.constructs.insideSpan.null,e.slice(o+a+4,u-3),t)),f=gr(f,[["exit",g,t],e[u-2],e[u-1],["exit",h,t]]),f=gr(f,e.slice(u+1)),f=gr(f,[["exit",m,t]]),nr(e,o,e.length,f),e}function f9(e,t,n){const a=this;let l=a.events.length,o,u;for(;l--;)if((a.events[l][1].type==="labelImage"||a.events[l][1].type==="labelLink")&&!a.events[l][1]._balanced){o=a.events[l][1];break}return f;function f(b){return o?o._inactive?y(b):(u=a.parser.defined.includes(_r(a.sliceSerialize({start:o.end,end:a.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(b),e.exit("labelMarker"),e.exit("labelEnd"),m):n(b)}function m(b){return b===40?e.attempt(s9,g,u?g:y)(b):b===91?e.attempt(o9,g,u?h:y)(b):u?g(b):y(b)}function h(b){return e.attempt(u9,g,y)(b)}function g(b){return t(b)}function y(b){return o._balanced=!0,n(b)}}function h9(e,t,n){return a;function a(y){return e.enter("resource"),e.enter("resourceMarker"),e.consume(y),e.exit("resourceMarker"),l}function l(y){return jt(y)?au(e,o)(y):o(y)}function o(y){return y===41?g(y):CC(e,u,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(y)}function u(y){return jt(y)?au(e,m)(y):g(y)}function f(y){return n(y)}function m(y){return y===34||y===39||y===40?NC(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(y):g(y)}function h(y){return jt(y)?au(e,g)(y):g(y)}function g(y){return y===41?(e.enter("resourceMarker"),e.consume(y),e.exit("resourceMarker"),e.exit("resource"),t):n(y)}}function m9(e,t,n){const a=this;return l;function l(f){return EC.call(a,e,o,u,"reference","referenceMarker","referenceString")(f)}function o(f){return a.parser.defined.includes(_r(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?t(f):n(f)}function u(f){return n(f)}}function p9(e,t,n){return a;function a(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),l}function l(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const g9={name:"labelStartImage",resolveAll:ay.resolveAll,tokenize:y9};function y9(e,t,n){const a=this;return l;function l(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),o}function o(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),u):n(f)}function u(f){return f===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(f):t(f)}}const v9={name:"labelStartLink",resolveAll:ay.resolveAll,tokenize:b9};function b9(e,t,n){const a=this;return l;function l(u){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelLink"),o}function o(u){return u===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(u):t(u)}}const tp={name:"lineEnding",tokenize:x9};function x9(e,t){return n;function n(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),it(e,t,"linePrefix")}}const kd={name:"thematicBreak",tokenize:S9};function S9(e,t,n){let a=0,l;return o;function o(h){return e.enter("thematicBreak"),u(h)}function u(h){return l=h,f(h)}function f(h){return h===l?(e.enter("thematicBreakSequence"),m(h)):a>=3&&(h===null||Re(h))?(e.exit("thematicBreak"),t(h)):n(h)}function m(h){return h===l?(e.consume(h),a++,m):(e.exit("thematicBreakSequence"),Ye(h)?it(e,f,"whitespace")(h):f(h))}}const Un={continuation:{tokenize:C9},exit:N9,name:"list",tokenize:j9},w9={partial:!0,tokenize:_9},k9={partial:!0,tokenize:E9};function j9(e,t,n){const a=this,l=a.events[a.events.length-1];let o=l&&l[1].type==="linePrefix"?l[2].sliceSerialize(l[1],!0).length:0,u=0;return f;function f(S){const k=a.containerState.type||(S===42||S===43||S===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!a.containerState.marker||S===a.containerState.marker:eg(S)){if(a.containerState.type||(a.containerState.type=k,e.enter(k,{_container:!0})),k==="listUnordered")return e.enter("listItemPrefix"),S===42||S===45?e.check(kd,n,h)(S):h(S);if(!a.interrupt||S===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),m(S)}return n(S)}function m(S){return eg(S)&&++u<10?(e.consume(S),m):(!a.interrupt||u<2)&&(a.containerState.marker?S===a.containerState.marker:S===41||S===46)?(e.exit("listItemValue"),h(S)):n(S)}function h(S){return e.enter("listItemMarker"),e.consume(S),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||S,e.check(Ou,a.interrupt?n:g,e.attempt(w9,b,y))}function g(S){return a.containerState.initialBlankLine=!0,o++,b(S)}function y(S){return Ye(S)?(e.enter("listItemPrefixWhitespace"),e.consume(S),e.exit("listItemPrefixWhitespace"),b):n(S)}function b(S){return a.containerState.size=o+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(S)}}function C9(e,t,n){const a=this;return a.containerState._closeFlow=void 0,e.check(Ou,l,o);function l(f){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,it(e,t,"listItemIndent",a.containerState.size+1)(f)}function o(f){return a.containerState.furtherBlankLines||!Ye(f)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,u(f)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt(k9,t,u)(f))}function u(f){return a.containerState._closeFlow=!0,a.interrupt=void 0,it(e,e.attempt(Un,t,n),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function E9(e,t,n){const a=this;return it(e,l,"listItemIndent",a.containerState.size+1);function l(o){const u=a.events[a.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===a.containerState.size?t(o):n(o)}}function N9(e){e.exit(this.containerState.type)}function _9(e,t,n){const a=this;return it(e,l,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function l(o){const u=a.events[a.events.length-1];return!Ye(o)&&u&&u[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const tS={name:"setextUnderline",resolveTo:A9,tokenize:T9};function A9(e,t){let n=e.length,a,l,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){a=n;break}e[n][1].type==="paragraph"&&(l=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const u={type:"setextHeading",start:{...e[a][1].start},end:{...e[e.length-1][1].end}};return e[l][1].type="setextHeadingText",o?(e.splice(l,0,["enter",u,t]),e.splice(o+1,0,["exit",e[a][1],t]),e[a][1].end={...e[o][1].end}):e[a][1]=u,e.push(["exit",u,t]),e}function T9(e,t,n){const a=this;let l;return o;function o(h){let g=a.events.length,y;for(;g--;)if(a.events[g][1].type!=="lineEnding"&&a.events[g][1].type!=="linePrefix"&&a.events[g][1].type!=="content"){y=a.events[g][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||y)?(e.enter("setextHeadingLine"),l=h,u(h)):n(h)}function u(h){return e.enter("setextHeadingLineSequence"),f(h)}function f(h){return h===l?(e.consume(h),f):(e.exit("setextHeadingLineSequence"),Ye(h)?it(e,m,"lineSuffix")(h):m(h))}function m(h){return h===null||Re(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const R9={tokenize:z9};function z9(e){const t=this,n=e.attempt(Ou,a,e.attempt(this.parser.constructs.flowInitial,l,it(e,e.attempt(this.parser.constructs.flow,l,e.attempt(IU,l)),"linePrefix")));return n;function a(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function l(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const O9={resolveAll:AC()},M9=_C("string"),D9=_C("text");function _C(e){return{resolveAll:AC(e==="text"?L9:void 0),tokenize:t};function t(n){const a=this,l=this.parser.constructs[e],o=n.attempt(l,u,f);return u;function u(g){return h(g)?o(g):f(g)}function f(g){if(g===null){n.consume(g);return}return n.enter("data"),n.consume(g),m}function m(g){return h(g)?(n.exit("data"),o(g)):(n.consume(g),m)}function h(g){if(g===null)return!0;const y=l[g];let b=-1;if(y)for(;++b<y.length;){const S=y[b];if(!S.previous||S.previous.call(a,a.previous))return!0}return!1}}}function AC(e){return t;function t(n,a){let l=-1,o;for(;++l<=n.length;)o===void 0?n[l]&&n[l][1].type==="data"&&(o=l,l++):(!n[l]||n[l][1].type!=="data")&&(l!==o+2&&(n[o][1].end=n[l-1][1].end,n.splice(o+2,l-o-2),l=o+2),o=void 0);return e?e(n,a):n}}function L9(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const a=e[n-1][1],l=t.sliceStream(a);let o=l.length,u=-1,f=0,m;for(;o--;){const h=l[o];if(typeof h=="string"){for(u=h.length;h.charCodeAt(u-1)===32;)f++,u--;if(u)break;u=-1}else if(h===-2)m=!0,f++;else if(h!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(f=0),f){const h={type:n===e.length||m||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?u:a.start._bufferIndex+u,_index:a.start._index+o,line:a.end.line,column:a.end.column-f,offset:a.end.offset-f},end:{...a.end}};a.end={...h.start},a.start.offset===a.end.offset?Object.assign(a,h):(e.splice(n,0,["enter",h,t],["exit",h,t]),n+=2)}n++}return e}const I9={42:Un,43:Un,45:Un,48:Un,49:Un,50:Un,51:Un,52:Un,53:Un,54:Un,55:Un,56:Un,57:Un,62:SC},U9={91:FU},P9={[-2]:ep,[-1]:ep,32:ep},B9={35:GU,42:kd,45:[tS,kd],60:JU,61:tS,95:kd,96:W1,126:W1},$9={38:kC,92:wC},F9={[-5]:tp,[-4]:tp,[-3]:tp,33:g9,38:kC,42:tg,60:[vU,i9],91:v9,92:[VU,wC],93:ay,95:tg,96:RU},q9={null:[tg,O9]},H9={null:[42,95]},Z9={null:[]},V9=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:H9,contentInitial:U9,disable:Z9,document:I9,flow:B9,flowInitial:P9,insideSpan:q9,string:$9,text:F9},Symbol.toStringTag,{value:"Module"}));function Q9(e,t,n){let a={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const l={},o=[];let u=[],f=[];const m={attempt:D(M),check:D(R),consume:T,enter:O,exit:B,interrupt:D(R,{interrupt:!0})},h={code:null,containerState:{},defineSkip:j,events:[],now:k,parser:e,previous:null,sliceSerialize:b,sliceStream:S,write:y};let g=t.tokenize.call(h,m);return t.resolveAll&&o.push(t),h;function y(oe){return u=gr(u,oe),E(),u[u.length-1]!==null?[]:(Z(t,0),h.events=of(o,h.events,h),h.events)}function b(oe,W){return K9(S(oe),W)}function S(oe){return G9(u,oe)}function k(){const{_bufferIndex:oe,_index:W,line:me,column:de,offset:ee}=a;return{_bufferIndex:oe,_index:W,line:me,column:de,offset:ee}}function j(oe){l[oe.line]=oe.column,q()}function E(){let oe;for(;a._index<u.length;){const W=u[a._index];if(typeof W=="string")for(oe=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===oe&&a._bufferIndex<W.length;)C(W.charCodeAt(a._bufferIndex));else C(W)}}function C(oe){g=g(oe)}function T(oe){Re(oe)?(a.line++,a.column=1,a.offset+=oe===-3?2:1,q()):oe!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===u[a._index].length&&(a._bufferIndex=-1,a._index++)),h.previous=oe}function O(oe,W){const me=W||{};return me.type=oe,me.start=k(),h.events.push(["enter",me,h]),f.push(me),me}function B(oe){const W=f.pop();return W.end=k(),h.events.push(["exit",W,h]),W}function M(oe,W){Z(oe,W.from)}function R(oe,W){W.restore()}function D(oe,W){return me;function me(de,ee,H){let re,K,he,A;return Array.isArray(de)?U(de):"tokenize"in de?U([de]):I(de);function I(ue){return Se;function Se(De){const ge=De!==null&&ue[De],ut=De!==null&&ue.null,ae=[...Array.isArray(ge)?ge:ge?[ge]:[],...Array.isArray(ut)?ut:ut?[ut]:[]];return U(ae)(De)}}function U(ue){return re=ue,K=0,ue.length===0?H:_(ue[K])}function _(ue){return Se;function Se(De){return A=te(),he=ue,ue.partial||(h.currentConstruct=ue),ue.name&&h.parser.constructs.disable.null.includes(ue.name)?X():ue.tokenize.call(W?Object.assign(Object.create(h),W):h,m,$,X)(De)}}function $(ue){return oe(he,A),ee}function X(ue){return A.restore(),++K<re.length?_(re[K]):H}}}function Z(oe,W){oe.resolveAll&&!o.includes(oe)&&o.push(oe),oe.resolve&&nr(h.events,W,h.events.length-W,oe.resolve(h.events.slice(W),h)),oe.resolveTo&&(h.events=oe.resolveTo(h.events,h))}function te(){const oe=k(),W=h.previous,me=h.currentConstruct,de=h.events.length,ee=Array.from(f);return{from:de,restore:H};function H(){a=oe,h.previous=W,h.currentConstruct=me,h.events.length=de,f=ee,q()}}function q(){a.line in l&&a.column<2&&(a.column=l[a.line],a.offset+=l[a.line]-1)}}function G9(e,t){const n=t.start._index,a=t.start._bufferIndex,l=t.end._index,o=t.end._bufferIndex;let u;if(n===l)u=[e[n].slice(a,o)];else{if(u=e.slice(n,l),a>-1){const f=u[0];typeof f=="string"?u[0]=f.slice(a):u.shift()}o>0&&u.push(e[l].slice(0,o))}return u}function K9(e,t){let n=-1;const a=[];let l;for(;++n<e.length;){const o=e[n];let u;if(typeof o=="string")u=o;else switch(o){case-5:{u="\r";break}case-4:{u=`
334
+ `;break}case-3:{u=`\r
335
+ `;break}case-2:{u=t?" ":" ";break}case-1:{if(!t&&l)continue;u=" ";break}default:u=String.fromCharCode(o)}l=o===-2,a.push(u)}return a.join("")}function Y9(e){const a={constructs:bC([V9,...(e||{}).extensions||[]]),content:l(dU),defined:[],document:l(hU),flow:l(R9),lazy:{},string:l(M9),text:l(D9)};return a;function l(o){return u;function u(f){return Q9(a,o,f)}}}function X9(e){for(;!jC(e););return e}const nS=/[\0\t\n\r]/g;function J9(){let e=1,t="",n=!0,a;return l;function l(o,u,f){const m=[];let h,g,y,b,S;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(u||void 0).decode(o)),y=0,t="",n&&(o.charCodeAt(0)===65279&&y++,n=void 0);y<o.length;){if(nS.lastIndex=y,h=nS.exec(o),b=h&&h.index!==void 0?h.index:o.length,S=o.charCodeAt(b),!h){t=o.slice(y);break}if(S===10&&y===b&&a)m.push(-3),a=void 0;else switch(a&&(m.push(-5),a=void 0),y<b&&(m.push(o.slice(y,b)),e+=b-y),S){case 0:{m.push(65533),e++;break}case 9:{for(g=Math.ceil(e/4)*4,m.push(-2);e++<g;)m.push(-1);break}case 10:{m.push(-4),e=1;break}default:a=!0,e=1}y=b+1}return f&&(a&&m.push(-5),t&&m.push(t),m.push(null)),m}}const W9=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function eP(e){return e.replace(W9,tP)}function tP(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const l=n.charCodeAt(1),o=l===120||l===88;return xC(n.slice(o?2:1),o?16:10)}return ry(n)||e}const TC={}.hasOwnProperty;function nP(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),rP(n)(X9(Y9(n).document().write(J9()(e,t,!0))))}function rP(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Tr),autolinkProtocol:te,autolinkEmail:te,atxHeading:o(Mt),blockQuote:o(ut),characterEscape:te,characterReference:te,codeFenced:o(ae),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:o(ae,u),codeText:o(Oe,u),codeTextData:te,data:te,codeFlowValue:te,definition:o(at),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:o(Pe),hardBreakEscape:o(ln),hardBreakTrailing:o(ln),htmlFlow:o(Na,u),htmlFlowData:te,htmlText:o(Na,u),htmlTextData:te,image:o(xl),label:u,link:o(Tr),listItem:o(_i),listItemValue:b,listOrdered:o(_a,y),listUnordered:o(_a),paragraph:o(Gs),reference:_,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:o(Mt),strong:o(Ks),thematicBreak:o(Ys)},exit:{atxHeading:m(),atxHeadingSequence:M,autolink:m(),autolinkEmail:ge,autolinkProtocol:De,blockQuote:m(),characterEscapeValue:q,characterReferenceMarkerHexadecimal:X,characterReferenceMarkerNumeric:X,characterReferenceValue:ue,characterReference:Se,codeFenced:m(E),codeFencedFence:j,codeFencedFenceInfo:S,codeFencedFenceMeta:k,codeFlowValue:q,codeIndented:m(C),codeText:m(ee),codeTextData:q,data:q,definition:m(),definitionDestinationString:B,definitionLabelString:T,definitionTitleString:O,emphasis:m(),hardBreakEscape:m(W),hardBreakTrailing:m(W),htmlFlow:m(me),htmlFlowData:q,htmlText:m(de),htmlTextData:q,image:m(re),label:he,labelText:K,lineEnding:oe,link:m(H),listItem:m(),listOrdered:m(),listUnordered:m(),paragraph:m(),referenceString:$,resourceDestinationString:A,resourceTitleString:I,resource:U,setextHeading:m(Z),setextHeadingLineSequence:D,setextHeadingText:R,strong:m(),thematicBreak:m()}};RC(t,(e||{}).mdastExtensions||[]);const n={};return a;function a(ie){let ye={type:"root",children:[]};const Te={stack:[ye],tokenStack:[],config:t,enter:f,exit:h,buffer:u,resume:g,data:n},$e=[];let lt=-1;for(;++lt<ie.length;)if(ie[lt][1].type==="listOrdered"||ie[lt][1].type==="listUnordered")if(ie[lt][0]==="enter")$e.push(lt);else{const on=$e.pop();lt=l(ie,on,lt)}for(lt=-1;++lt<ie.length;){const on=t[ie[lt][0]];TC.call(on,ie[lt][1].type)&&on[ie[lt][1].type].call(Object.assign({sliceSerialize:ie[lt][2].sliceSerialize},Te),ie[lt][1])}if(Te.tokenStack.length>0){const on=Te.tokenStack[Te.tokenStack.length-1];(on[1]||rS).call(Te,void 0,on[0])}for(ye.position={start:ni(ie.length>0?ie[0][1].start:{line:1,column:1,offset:0}),end:ni(ie.length>0?ie[ie.length-2][1].end:{line:1,column:1,offset:0})},lt=-1;++lt<t.transforms.length;)ye=t.transforms[lt](ye)||ye;return ye}function l(ie,ye,Te){let $e=ye-1,lt=-1,on=!1,Sr,Jt,Dt,un;for(;++$e<=Te;){const dt=ie[$e];switch(dt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{dt[0]==="enter"?lt++:lt--,un=void 0;break}case"lineEndingBlank":{dt[0]==="enter"&&(Sr&&!un&&!lt&&!Dt&&(Dt=$e),un=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:un=void 0}if(!lt&&dt[0]==="enter"&&dt[1].type==="listItemPrefix"||lt===-1&&dt[0]==="exit"&&(dt[1].type==="listUnordered"||dt[1].type==="listOrdered")){if(Sr){let wr=$e;for(Jt=void 0;wr--;){const An=ie[wr];if(An[1].type==="lineEnding"||An[1].type==="lineEndingBlank"){if(An[0]==="exit")continue;Jt&&(ie[Jt][1].type="lineEndingBlank",on=!0),An[1].type="lineEnding",Jt=wr}else if(!(An[1].type==="linePrefix"||An[1].type==="blockQuotePrefix"||An[1].type==="blockQuotePrefixWhitespace"||An[1].type==="blockQuoteMarker"||An[1].type==="listItemIndent"))break}Dt&&(!Jt||Dt<Jt)&&(Sr._spread=!0),Sr.end=Object.assign({},Jt?ie[Jt][1].start:dt[1].end),ie.splice(Jt||$e,0,["exit",Sr,dt[2]]),$e++,Te++}if(dt[1].type==="listItemPrefix"){const wr={type:"listItem",_spread:!1,start:Object.assign({},dt[1].start),end:void 0};Sr=wr,ie.splice($e,0,["enter",wr,dt[2]]),$e++,Te++,Dt=void 0,un=!0}}}return ie[ye][1]._spread=on,Te}function o(ie,ye){return Te;function Te($e){f.call(this,ie($e),$e),ye&&ye.call(this,$e)}}function u(){this.stack.push({type:"fragment",children:[]})}function f(ie,ye,Te){this.stack[this.stack.length-1].children.push(ie),this.stack.push(ie),this.tokenStack.push([ye,Te||void 0]),ie.position={start:ni(ye.start),end:void 0}}function m(ie){return ye;function ye(Te){ie&&ie.call(this,Te),h.call(this,Te)}}function h(ie,ye){const Te=this.stack.pop(),$e=this.tokenStack.pop();if($e)$e[0].type!==ie.type&&(ye?ye.call(this,ie,$e[0]):($e[1]||rS).call(this,ie,$e[0]));else throw new Error("Cannot close `"+ie.type+"` ("+ru({start:ie.start,end:ie.end})+"): it’s not open");Te.position.end=ni(ie.end)}function g(){return ny(this.stack.pop())}function y(){this.data.expectingFirstListItemValue=!0}function b(ie){if(this.data.expectingFirstListItemValue){const ye=this.stack[this.stack.length-2];ye.start=Number.parseInt(this.sliceSerialize(ie),10),this.data.expectingFirstListItemValue=void 0}}function S(){const ie=this.resume(),ye=this.stack[this.stack.length-1];ye.lang=ie}function k(){const ie=this.resume(),ye=this.stack[this.stack.length-1];ye.meta=ie}function j(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function E(){const ie=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ie.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function C(){const ie=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ie.replace(/(\r?\n|\r)$/g,"")}function T(ie){const ye=this.resume(),Te=this.stack[this.stack.length-1];Te.label=ye,Te.identifier=_r(this.sliceSerialize(ie)).toLowerCase()}function O(){const ie=this.resume(),ye=this.stack[this.stack.length-1];ye.title=ie}function B(){const ie=this.resume(),ye=this.stack[this.stack.length-1];ye.url=ie}function M(ie){const ye=this.stack[this.stack.length-1];if(!ye.depth){const Te=this.sliceSerialize(ie).length;ye.depth=Te}}function R(){this.data.setextHeadingSlurpLineEnding=!0}function D(ie){const ye=this.stack[this.stack.length-1];ye.depth=this.sliceSerialize(ie).codePointAt(0)===61?1:2}function Z(){this.data.setextHeadingSlurpLineEnding=void 0}function te(ie){const Te=this.stack[this.stack.length-1].children;let $e=Te[Te.length-1];(!$e||$e.type!=="text")&&($e=sn(),$e.position={start:ni(ie.start),end:void 0},Te.push($e)),this.stack.push($e)}function q(ie){const ye=this.stack.pop();ye.value+=this.sliceSerialize(ie),ye.position.end=ni(ie.end)}function oe(ie){const ye=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Te=ye.children[ye.children.length-1];Te.position.end=ni(ie.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ye.type)&&(te.call(this,ie),q.call(this,ie))}function W(){this.data.atHardBreak=!0}function me(){const ie=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ie}function de(){const ie=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ie}function ee(){const ie=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ie}function H(){const ie=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";ie.type+="Reference",ie.referenceType=ye,delete ie.url,delete ie.title}else delete ie.identifier,delete ie.label;this.data.referenceType=void 0}function re(){const ie=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";ie.type+="Reference",ie.referenceType=ye,delete ie.url,delete ie.title}else delete ie.identifier,delete ie.label;this.data.referenceType=void 0}function K(ie){const ye=this.sliceSerialize(ie),Te=this.stack[this.stack.length-2];Te.label=eP(ye),Te.identifier=_r(ye).toLowerCase()}function he(){const ie=this.stack[this.stack.length-1],ye=this.resume(),Te=this.stack[this.stack.length-1];if(this.data.inReference=!0,Te.type==="link"){const $e=ie.children;Te.children=$e}else Te.alt=ye}function A(){const ie=this.resume(),ye=this.stack[this.stack.length-1];ye.url=ie}function I(){const ie=this.resume(),ye=this.stack[this.stack.length-1];ye.title=ie}function U(){this.data.inReference=void 0}function _(){this.data.referenceType="collapsed"}function $(ie){const ye=this.resume(),Te=this.stack[this.stack.length-1];Te.label=ye,Te.identifier=_r(this.sliceSerialize(ie)).toLowerCase(),this.data.referenceType="full"}function X(ie){this.data.characterReferenceType=ie.type}function ue(ie){const ye=this.sliceSerialize(ie),Te=this.data.characterReferenceType;let $e;Te?($e=xC(ye,Te==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):$e=ry(ye);const lt=this.stack[this.stack.length-1];lt.value+=$e}function Se(ie){const ye=this.stack.pop();ye.position.end=ni(ie.end)}function De(ie){q.call(this,ie);const ye=this.stack[this.stack.length-1];ye.url=this.sliceSerialize(ie)}function ge(ie){q.call(this,ie);const ye=this.stack[this.stack.length-1];ye.url="mailto:"+this.sliceSerialize(ie)}function ut(){return{type:"blockquote",children:[]}}function ae(){return{type:"code",lang:null,meta:null,value:""}}function Oe(){return{type:"inlineCode",value:""}}function at(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Pe(){return{type:"emphasis",children:[]}}function Mt(){return{type:"heading",depth:0,children:[]}}function ln(){return{type:"break"}}function Na(){return{type:"html",value:""}}function xl(){return{type:"image",title:null,url:"",alt:null}}function Tr(){return{type:"link",title:null,url:"",children:[]}}function _a(ie){return{type:"list",ordered:ie.type==="listOrdered",start:null,spread:ie._spread,children:[]}}function _i(ie){return{type:"listItem",spread:ie._spread,checked:null,children:[]}}function Gs(){return{type:"paragraph",children:[]}}function Ks(){return{type:"strong",children:[]}}function sn(){return{type:"text",value:""}}function Ys(){return{type:"thematicBreak"}}}function ni(e){return{line:e.line,column:e.column,offset:e.offset}}function RC(e,t){let n=-1;for(;++n<t.length;){const a=t[n];Array.isArray(a)?RC(e,a):aP(e,a)}}function aP(e,t){let n;for(n in t)if(TC.call(t,n))switch(n){case"canContainEols":{const a=t[n];a&&e[n].push(...a);break}case"transforms":{const a=t[n];a&&e[n].push(...a);break}case"enter":case"exit":{const a=t[n];a&&Object.assign(e[n],a);break}}}function rS(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+ru({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ru({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+ru({start:t.start,end:t.end})+") is still open")}function iP(e){const t=this;t.parser=n;function n(a){return nP(a,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function lP(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function sP(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
336
+ `}]}function oP(e,t){const n=t.value?t.value+`
337
+ `:"",a={},l=t.lang?t.lang.split(/\s+/):[];l.length>0&&(a.className=["language-"+l[0]]);let o={type:"element",tagName:"code",properties:a,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function uP(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function cP(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function dP(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),l=Qs(a.toLowerCase()),o=e.footnoteOrder.indexOf(a);let u,f=e.footnoteCounts.get(a);f===void 0?(f=0,e.footnoteOrder.push(a),u=e.footnoteOrder.length):u=o+1,f+=1,e.footnoteCounts.set(a,f);const m={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+l,id:n+"fnref-"+l+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(u)}]};e.patch(t,m);const h={type:"element",tagName:"sup",properties:{},children:[m]};return e.patch(t,h),e.applyData(t,h)}function fP(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function hP(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function zC(e,t){const n=t.referenceType;let a="]";if(n==="collapsed"?a+="[]":n==="full"&&(a+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+a}];const l=e.all(t),o=l[0];o&&o.type==="text"?o.value="["+o.value:l.unshift({type:"text",value:"["});const u=l[l.length-1];return u&&u.type==="text"?u.value+=a:l.push({type:"text",value:a}),l}function mP(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return zC(e,t);const l={src:Qs(a.url||""),alt:t.alt};a.title!==null&&a.title!==void 0&&(l.title=a.title);const o={type:"element",tagName:"img",properties:l,children:[]};return e.patch(t,o),e.applyData(t,o)}function pP(e,t){const n={src:Qs(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const a={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,a),e.applyData(t,a)}function gP(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const a={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,a),e.applyData(t,a)}function yP(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return zC(e,t);const l={href:Qs(a.url||"")};a.title!==null&&a.title!==void 0&&(l.title=a.title);const o={type:"element",tagName:"a",properties:l,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function vP(e,t){const n={href:Qs(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const a={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function bP(e,t,n){const a=e.all(t),l=n?xP(n):OC(t),o={},u=[];if(typeof t.checked=="boolean"){const g=a[0];let y;g&&g.type==="element"&&g.tagName==="p"?y=g:(y={type:"element",tagName:"p",properties:{},children:[]},a.unshift(y)),y.children.length>0&&y.children.unshift({type:"text",value:" "}),y.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let f=-1;for(;++f<a.length;){const g=a[f];(l||f!==0||g.type!=="element"||g.tagName!=="p")&&u.push({type:"text",value:`
338
+ `}),g.type==="element"&&g.tagName==="p"&&!l?u.push(...g.children):u.push(g)}const m=a[a.length-1];m&&(l||m.type!=="element"||m.tagName!=="p")&&u.push({type:"text",value:`
339
+ `});const h={type:"element",tagName:"li",properties:o,children:u};return e.patch(t,h),e.applyData(t,h)}function xP(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let a=-1;for(;!t&&++a<n.length;)t=OC(n[a])}return t}function OC(e){const t=e.spread;return t??e.children.length>1}function SP(e,t){const n={},a=e.all(t);let l=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++l<a.length;){const u=a[l];if(u.type==="element"&&u.tagName==="li"&&u.properties&&Array.isArray(u.properties.className)&&u.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(a,!0)};return e.patch(t,o),e.applyData(t,o)}function wP(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function kP(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function jP(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function CP(e,t){const n=e.all(t),a=n.shift(),l=[];if(a){const u={type:"element",tagName:"thead",properties:{},children:e.wrap([a],!0)};e.patch(t.children[0],u),l.push(u)}if(n.length>0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},f=Jg(t.children[1]),m=fC(t.children[t.children.length-1]);f&&m&&(u.position={start:f,end:m}),l.push(u)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(l,!0)};return e.patch(t,o),e.applyData(t,o)}function EP(e,t,n){const a=n?n.children:void 0,o=(a?a.indexOf(t):1)===0?"th":"td",u=n&&n.type==="table"?n.align:void 0,f=u?u.length:t.children.length;let m=-1;const h=[];for(;++m<f;){const y=t.children[m],b={},S=u?u[m]:void 0;S&&(b.align=S);let k={type:"element",tagName:o,properties:b,children:[]};y&&(k.children=e.all(y),e.patch(y,k),k=e.applyData(y,k)),h.push(k)}const g={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,g),e.applyData(t,g)}function NP(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const aS=9,iS=32;function _P(e){const t=String(e),n=/\r?\n|\r/g;let a=n.exec(t),l=0;const o=[];for(;a;)o.push(lS(t.slice(l,a.index),l>0,!0),a[0]),l=a.index+a[0].length,a=n.exec(t);return o.push(lS(t.slice(l),l>0,!1)),o.join("")}function lS(e,t,n){let a=0,l=e.length;if(t){let o=e.codePointAt(a);for(;o===aS||o===iS;)a++,o=e.codePointAt(a)}if(n){let o=e.codePointAt(l-1);for(;o===aS||o===iS;)l--,o=e.codePointAt(l-1)}return l>a?e.slice(a,l):""}function AP(e,t){const n={type:"text",value:_P(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function TP(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const RP={blockquote:lP,break:sP,code:oP,delete:uP,emphasis:cP,footnoteReference:dP,heading:fP,html:hP,imageReference:mP,image:pP,inlineCode:gP,linkReference:yP,link:vP,listItem:bP,list:SP,paragraph:wP,root:kP,strong:jP,table:CP,tableCell:NP,tableRow:EP,text:AP,thematicBreak:TP,toml:ud,yaml:ud,definition:ud,footnoteDefinition:ud};function ud(){}const MC=-1,uf=0,iu=1,Ud=2,iy=3,ly=4,sy=5,oy=6,DC=7,LC=8,sS=typeof self=="object"?self:globalThis,zP=(e,t)=>{const n=(l,o)=>(e.set(o,l),l),a=l=>{if(e.has(l))return e.get(l);const[o,u]=t[l];switch(o){case uf:case MC:return n(u,l);case iu:{const f=n([],l);for(const m of u)f.push(a(m));return f}case Ud:{const f=n({},l);for(const[m,h]of u)f[a(m)]=a(h);return f}case iy:return n(new Date(u),l);case ly:{const{source:f,flags:m}=u;return n(new RegExp(f,m),l)}case sy:{const f=n(new Map,l);for(const[m,h]of u)f.set(a(m),a(h));return f}case oy:{const f=n(new Set,l);for(const m of u)f.add(a(m));return f}case DC:{const{name:f,message:m}=u;return n(new sS[f](m),l)}case LC:return n(BigInt(u),l);case"BigInt":return n(Object(BigInt(u)),l);case"ArrayBuffer":return n(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:f}=new Uint8Array(u);return n(new DataView(f),u)}}return n(new sS[o](u),l)};return a},oS=e=>zP(new Map,e)(0),us="",{toString:OP}={},{keys:MP}=Object,Yo=e=>{const t=typeof e;if(t!=="object"||!e)return[uf,t];const n=OP.call(e).slice(8,-1);switch(n){case"Array":return[iu,us];case"Object":return[Ud,us];case"Date":return[iy,us];case"RegExp":return[ly,us];case"Map":return[sy,us];case"Set":return[oy,us];case"DataView":return[iu,n]}return n.includes("Array")?[iu,n]:n.includes("Error")?[DC,n]:[Ud,n]},cd=([e,t])=>e===uf&&(t==="function"||t==="symbol"),DP=(e,t,n,a)=>{const l=(u,f)=>{const m=a.push(u)-1;return n.set(f,m),m},o=u=>{if(n.has(u))return n.get(u);let[f,m]=Yo(u);switch(f){case uf:{let g=u;switch(m){case"bigint":f=LC,g=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+m);g=null;break;case"undefined":return l([MC],u)}return l([f,g],u)}case iu:{if(m){let b=u;return m==="DataView"?b=new Uint8Array(u.buffer):m==="ArrayBuffer"&&(b=new Uint8Array(u)),l([m,[...b]],u)}const g=[],y=l([f,g],u);for(const b of u)g.push(o(b));return y}case Ud:{if(m)switch(m){case"BigInt":return l([m,u.toString()],u);case"Boolean":case"Number":case"String":return l([m,u.valueOf()],u)}if(t&&"toJSON"in u)return o(u.toJSON());const g=[],y=l([f,g],u);for(const b of MP(u))(e||!cd(Yo(u[b])))&&g.push([o(b),o(u[b])]);return y}case iy:return l([f,u.toISOString()],u);case ly:{const{source:g,flags:y}=u;return l([f,{source:g,flags:y}],u)}case sy:{const g=[],y=l([f,g],u);for(const[b,S]of u)(e||!(cd(Yo(b))||cd(Yo(S))))&&g.push([o(b),o(S)]);return y}case oy:{const g=[],y=l([f,g],u);for(const b of u)(e||!cd(Yo(b)))&&g.push(o(b));return y}}const{message:h}=u;return l([f,{name:m,message:h}],u)};return o},uS=(e,{json:t,lossy:n}={})=>{const a=[];return DP(!(t||n),!!t,new Map,a)(e),a},Pd=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?oS(uS(e,t)):structuredClone(e):(e,t)=>oS(uS(e,t));function LP(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function IP(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function UP(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||LP,a=e.options.footnoteBackLabel||IP,l=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",u=e.options.footnoteLabelProperties||{className:["sr-only"]},f=[];let m=-1;for(;++m<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[m]);if(!h)continue;const g=e.all(h),y=String(h.identifier).toUpperCase(),b=Qs(y.toLowerCase());let S=0;const k=[],j=e.footnoteCounts.get(y);for(;j!==void 0&&++S<=j;){k.length>0&&k.push({type:"text",value:" "});let T=typeof n=="string"?n:n(m,S);typeof T=="string"&&(T={type:"text",value:T}),k.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+b+(S>1?"-"+S:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(m,S),className:["data-footnote-backref"]},children:Array.isArray(T)?T:[T]})}const E=g[g.length-1];if(E&&E.type==="element"&&E.tagName==="p"){const T=E.children[E.children.length-1];T&&T.type==="text"?T.value+=" ":E.children.push({type:"text",value:" "}),E.children.push(...k)}else g.push(...k);const C={type:"element",tagName:"li",properties:{id:t+"fn-"+b},children:e.wrap(g,!0)};e.patch(h,C),f.push(C)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Pd(u),id:"footnote-label"},children:[{type:"text",value:l}]},{type:"text",value:`
340
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
341
+ `}]}}const cf=(function(e){if(e==null)return FP;if(typeof e=="function")return df(e);if(typeof e=="object")return Array.isArray(e)?PP(e):BP(e);if(typeof e=="string")return $P(e);throw new Error("Expected function, string, or object as test")});function PP(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=cf(e[n]);return df(a);function a(...l){let o=-1;for(;++o<t.length;)if(t[o].apply(this,l))return!0;return!1}}function BP(e){const t=e;return df(n);function n(a){const l=a;let o;for(o in e)if(l[o]!==t[o])return!1;return!0}}function $P(e){return df(t);function t(n){return n&&n.type===e}}function df(e){return t;function t(n,a,l){return!!(qP(n)&&e.call(this,n,typeof a=="number"?a:void 0,l||void 0))}}function FP(){return!0}function qP(e){return e!==null&&typeof e=="object"&&"type"in e}const IC=[],HP=!0,ng=!1,ZP="skip";function UC(e,t,n,a){let l;typeof t=="function"&&typeof n!="function"?(a=n,n=t):l=t;const o=cf(l),u=a?-1:1;f(e,void 0,[])();function f(m,h,g){const y=m&&typeof m=="object"?m:{};if(typeof y.type=="string"){const S=typeof y.tagName=="string"?y.tagName:typeof y.name=="string"?y.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(m.type+(S?"<"+S+">":""))+")"})}return b;function b(){let S=IC,k,j,E;if((!t||o(m,h,g[g.length-1]||void 0))&&(S=VP(n(m,g)),S[0]===ng))return S;if("children"in m&&m.children){const C=m;if(C.children&&S[0]!==ZP)for(j=(a?C.children.length:-1)+u,E=g.concat(C);j>-1&&j<C.children.length;){const T=C.children[j];if(k=f(T,j,E)(),k[0]===ng)return k;j=typeof k[1]=="number"?k[1]:j+u}}return S}}}function VP(e){return Array.isArray(e)?e:typeof e=="number"?[HP,e]:e==null?IC:[e]}function uy(e,t,n,a){let l,o,u;typeof t=="function"&&typeof n!="function"?(o=void 0,u=t,l=n):(o=t,u=n,l=a),UC(e,o,f,l);function f(m,h){const g=h[h.length-1],y=g?g.children.indexOf(m):void 0;return u(m,y,g)}}const rg={}.hasOwnProperty,QP={};function GP(e,t){const n=t||QP,a=new Map,l=new Map,o=new Map,u={...RP,...n.handlers},f={all:h,applyData:YP,definitionById:a,footnoteById:l,footnoteCounts:o,footnoteOrder:[],handlers:u,one:m,options:n,patch:KP,wrap:JP};return uy(e,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const y=g.type==="definition"?a:l,b=String(g.identifier).toUpperCase();y.has(b)||y.set(b,g)}}),f;function m(g,y){const b=g.type,S=f.handlers[b];if(rg.call(f.handlers,b)&&S)return S(f,g,y);if(f.options.passThrough&&f.options.passThrough.includes(b)){if("children"in g){const{children:j,...E}=g,C=Pd(E);return C.children=f.all(g),C}return Pd(g)}return(f.options.unknownHandler||XP)(f,g,y)}function h(g){const y=[];if("children"in g){const b=g.children;let S=-1;for(;++S<b.length;){const k=f.one(b[S],g);if(k){if(S&&b[S-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=cS(k.value)),!Array.isArray(k)&&k.type==="element")){const j=k.children[0];j&&j.type==="text"&&(j.value=cS(j.value))}Array.isArray(k)?y.push(...k):y.push(k)}}}return y}}function KP(e,t){e.position&&(t.position=II(e))}function YP(e,t){let n=t;if(e&&e.data){const a=e.data.hName,l=e.data.hChildren,o=e.data.hProperties;if(typeof a=="string")if(n.type==="element")n.tagName=a;else{const u="children"in n?n.children:[n];n={type:"element",tagName:a,properties:{},children:u}}n.type==="element"&&o&&Object.assign(n.properties,Pd(o)),"children"in n&&n.children&&l!==null&&l!==void 0&&(n.children=l)}return n}function XP(e,t){const n=t.data||{},a="value"in t&&!(rg.call(n,"hProperties")||rg.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function JP(e,t){const n=[];let a=-1;for(t&&n.push({type:"text",value:`
342
+ `});++a<e.length;)a&&n.push({type:"text",value:`
343
+ `}),n.push(e[a]);return t&&e.length>0&&n.push({type:"text",value:`
344
+ `}),n}function cS(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function dS(e,t){const n=GP(e,t),a=n.one(e,void 0),l=UP(n),o=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return l&&o.children.push({type:"text",value:`
345
+ `},l),o}function WP(e,t){return e&&"run"in e?async function(n,a){const l=dS(n,{file:a,...t});await e.run(l,a)}:function(n,a){return dS(n,{file:a,...e||t})}}function fS(e){if(e)throw e}var np,hS;function e8(){if(hS)return np;hS=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,a=Object.getOwnPropertyDescriptor,l=function(h){return typeof Array.isArray=="function"?Array.isArray(h):t.call(h)==="[object Array]"},o=function(h){if(!h||t.call(h)!=="[object Object]")return!1;var g=e.call(h,"constructor"),y=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!g&&!y)return!1;var b;for(b in h);return typeof b>"u"||e.call(h,b)},u=function(h,g){n&&g.name==="__proto__"?n(h,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):h[g.name]=g.newValue},f=function(h,g){if(g==="__proto__")if(e.call(h,g)){if(a)return a(h,g).value}else return;return h[g]};return np=function m(){var h,g,y,b,S,k,j=arguments[0],E=1,C=arguments.length,T=!1;for(typeof j=="boolean"&&(T=j,j=arguments[1]||{},E=2),(j==null||typeof j!="object"&&typeof j!="function")&&(j={});E<C;++E)if(h=arguments[E],h!=null)for(g in h)y=f(j,g),b=f(h,g),j!==b&&(T&&b&&(o(b)||(S=l(b)))?(S?(S=!1,k=y&&l(y)?y:[]):k=y&&o(y)?y:{},u(j,{name:g,newValue:m(T,k,b)})):typeof b<"u"&&u(j,{name:g,newValue:b}));return j},np}var t8=e8();const rp=$d(t8);function ag(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function n8(){const e=[],t={run:n,use:a};return t;function n(...l){let o=-1;const u=l.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);f(null,...l);function f(m,...h){const g=e[++o];let y=-1;if(m){u(m);return}for(;++y<l.length;)(h[y]===null||h[y]===void 0)&&(h[y]=l[y]);l=h,g?r8(g,f)(...h):u(null,...h)}}function a(l){if(typeof l!="function")throw new TypeError("Expected `middelware` to be a function, not "+l);return e.push(l),t}}function r8(e,t){let n;return a;function a(...u){const f=e.length>u.length;let m;f&&u.push(l);try{m=e.apply(this,u)}catch(h){const g=h;if(f&&n)throw g;return l(g)}f||(m&&m.then&&typeof m.then=="function"?m.then(o,l):m instanceof Error?l(m):o(m))}function l(u,...f){n||(n=!0,t(u,...f))}function o(u){l(null,u)}}const Ir={basename:a8,dirname:i8,extname:l8,join:s8,sep:"/"};function a8(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Mu(e);let n=0,a=-1,l=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;l--;)if(e.codePointAt(l)===47){if(o){n=l+1;break}}else a<0&&(o=!0,a=l+1);return a<0?"":e.slice(n,a)}if(t===e)return"";let u=-1,f=t.length-1;for(;l--;)if(e.codePointAt(l)===47){if(o){n=l+1;break}}else u<0&&(o=!0,u=l+1),f>-1&&(e.codePointAt(l)===t.codePointAt(f--)?f<0&&(a=l):(f=-1,a=u));return n===a?a=u:a<0&&(a=e.length),e.slice(n,a)}function i8(e){if(Mu(e),e.length===0)return".";let t=-1,n=e.length,a;for(;--n;)if(e.codePointAt(n)===47){if(a){t=n;break}}else a||(a=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function l8(e){Mu(e);let t=e.length,n=-1,a=0,l=-1,o=0,u;for(;t--;){const f=e.codePointAt(t);if(f===47){if(u){a=t+1;break}continue}n<0&&(u=!0,n=t+1),f===46?l<0?l=t:o!==1&&(o=1):l>-1&&(o=-1)}return l<0||n<0||o===0||o===1&&l===n-1&&l===a+1?"":e.slice(l,n)}function s8(...e){let t=-1,n;for(;++t<e.length;)Mu(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":o8(n)}function o8(e){Mu(e);const t=e.codePointAt(0)===47;let n=u8(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function u8(e,t){let n="",a=0,l=-1,o=0,u=-1,f,m;for(;++u<=e.length;){if(u<e.length)f=e.codePointAt(u);else{if(f===47)break;f=47}if(f===47){if(!(l===u-1||o===1))if(l!==u-1&&o===2){if(n.length<2||a!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(m=n.lastIndexOf("/"),m!==n.length-1){m<0?(n="",a=0):(n=n.slice(0,m),a=n.length-1-n.lastIndexOf("/")),l=u,o=0;continue}}else if(n.length>0){n="",a=0,l=u,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",a=2)}else n.length>0?n+="/"+e.slice(l+1,u):n=e.slice(l+1,u),a=u-l-1;l=u,o=0}else f===46&&o>-1?o++:o=-1}return n}function Mu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const c8={cwd:d8};function d8(){return"/"}function ig(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function f8(e){if(typeof e=="string")e=new URL(e);else if(!ig(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return h8(e)}function h8(e){if(e.hostname!==""){const a=new TypeError('File URL host must be "localhost" or empty on darwin');throw a.code="ERR_INVALID_FILE_URL_HOST",a}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const a=t.codePointAt(n+2);if(a===70||a===102){const l=new TypeError("File URL path must not include encoded / characters");throw l.code="ERR_INVALID_FILE_URL_PATH",l}}return decodeURIComponent(t)}const ap=["history","path","basename","stem","extname","dirname"];class PC{constructor(t){let n;t?ig(t)?n={path:t}:typeof t=="string"||m8(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":c8.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<ap.length;){const o=ap[a];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let l;for(l in n)ap.includes(l)||(this[l]=n[l])}get basename(){return typeof this.path=="string"?Ir.basename(this.path):void 0}set basename(t){lp(t,"basename"),ip(t,"basename"),this.path=Ir.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Ir.dirname(this.path):void 0}set dirname(t){mS(this.basename,"dirname"),this.path=Ir.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Ir.extname(this.path):void 0}set extname(t){if(ip(t,"extname"),mS(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ir.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){ig(t)&&(t=f8(t)),lp(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Ir.basename(this.path,this.extname):void 0}set stem(t){lp(t,"stem"),ip(t,"stem"),this.path=Ir.join(this.dirname||"",t+(this.extname||""))}fail(t,n,a){const l=this.message(t,n,a);throw l.fatal=!0,l}info(t,n,a){const l=this.message(t,n,a);return l.fatal=void 0,l}message(t,n,a){const l=new wn(t,n,a);return this.path&&(l.name=this.path+":"+l.name,l.file=this.path),l.fatal=!1,this.messages.push(l),l}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function ip(e,t){if(e&&e.includes(Ir.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Ir.sep+"`")}function lp(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function mS(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function m8(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const p8=(function(e){const a=this.constructor.prototype,l=a[e],o=function(){return l.apply(o,arguments)};return Object.setPrototypeOf(o,a),o}),g8={}.hasOwnProperty;class cy extends p8{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=n8()}copy(){const t=new cy;let n=-1;for(;++n<this.attachers.length;){const a=this.attachers[n];t.use(...a)}return t.data(rp(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(up("data",this.frozen),this.namespace[t]=n,this):g8.call(this.namespace,t)&&this.namespace[t]||void 0:t?(up("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...a]=this.attachers[this.freezeIndex];if(a[0]===!1)continue;a[0]===!0&&(a[0]=void 0);const l=n.call(t,...a);typeof l=="function"&&this.transformers.use(l)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=dd(t),a=this.parser||this.Parser;return sp("parse",a),a(String(n),n)}process(t,n){const a=this;return this.freeze(),sp("process",this.parser||this.Parser),op("process",this.compiler||this.Compiler),n?l(void 0,n):new Promise(l);function l(o,u){const f=dd(t),m=a.parse(f);a.run(m,f,function(g,y,b){if(g||!y||!b)return h(g);const S=y,k=a.stringify(S,b);b8(k)?b.value=k:b.result=k,h(g,b)});function h(g,y){g||!y?u(g):o?o(y):n(void 0,y)}}}processSync(t){let n=!1,a;return this.freeze(),sp("processSync",this.parser||this.Parser),op("processSync",this.compiler||this.Compiler),this.process(t,l),gS("processSync","process",n),a;function l(o,u){n=!0,fS(o),a=u}}run(t,n,a){pS(t),this.freeze();const l=this.transformers;return!a&&typeof n=="function"&&(a=n,n=void 0),a?o(void 0,a):new Promise(o);function o(u,f){const m=dd(n);l.run(t,m,h);function h(g,y,b){const S=y||t;g?f(g):u?u(S):a(void 0,S,b)}}}runSync(t,n){let a=!1,l;return this.run(t,n,o),gS("runSync","run",a),l;function o(u,f){fS(u),l=f,a=!0}}stringify(t,n){this.freeze();const a=dd(n),l=this.compiler||this.Compiler;return op("stringify",l),pS(t),l(t,a)}use(t,...n){const a=this.attachers,l=this.namespace;if(up("use",this.frozen),t!=null)if(typeof t=="function")m(t,n);else if(typeof t=="object")Array.isArray(t)?f(t):u(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(h){if(typeof h=="function")m(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[g,...y]=h;m(g,y)}else u(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function u(h){if(!("plugins"in h)&&!("settings"in h))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");f(h.plugins),h.settings&&(l.settings=rp(!0,l.settings,h.settings))}function f(h){let g=-1;if(h!=null)if(Array.isArray(h))for(;++g<h.length;){const y=h[g];o(y)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function m(h,g){let y=-1,b=-1;for(;++y<a.length;)if(a[y][0]===h){b=y;break}if(b===-1)a.push([h,...g]);else if(g.length>0){let[S,...k]=g;const j=a[b][1];ag(j)&&ag(S)&&(S=rp(!0,j,S)),a[b]=[h,S,...k]}}}}const y8=new cy().freeze();function sp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function op(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function up(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function pS(e){if(!ag(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function gS(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function dd(e){return v8(e)?e:new PC(e)}function v8(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function b8(e){return typeof e=="string"||x8(e)}function x8(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const S8="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",yS=[],vS={allowDangerousHtml:!0},w8=/^(https?|ircs?|mailto|xmpp)$/i,k8=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function j8(e){const t=C8(e),n=E8(e);return N8(t.runSync(t.parse(n),n),e)}function C8(e){const t=e.rehypePlugins||yS,n=e.remarkPlugins||yS,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...vS}:vS;return y8().use(iP).use(n).use(WP,a).use(t)}function E8(e){const t=e.children||"",n=new PC;return typeof t=="string"&&(n.value=t),n}function N8(e,t){const n=t.allowedElements,a=t.allowElement,l=t.components,o=t.disallowedElements,u=t.skipHtml,f=t.unwrapDisallowed,m=t.urlTransform||_8;for(const g of k8)Object.hasOwn(t,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+S8+g.id,void 0);return uy(e,h),FI(e,{Fragment:d.Fragment,components:l,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0});function h(g,y,b){if(g.type==="raw"&&b&&typeof y=="number")return u?b.children.splice(y,1):b.children[y]={type:"text",value:g.value},y;if(g.type==="element"){let S;for(S in Wm)if(Object.hasOwn(Wm,S)&&Object.hasOwn(g.properties,S)){const k=g.properties[S],j=Wm[S];(j===null||j.includes(g.tagName))&&(g.properties[S]=m(String(k||""),S,g))}}if(g.type==="element"){let S=n?!n.includes(g.tagName):o?o.includes(g.tagName):!1;if(!S&&a&&typeof y=="number"&&(S=!a(g,y,b)),S&&b&&typeof y=="number")return f&&g.children?b.children.splice(y,1,...g.children):b.children.splice(y,1),y}}}function _8(e){const t=e.indexOf(":"),n=e.indexOf("?"),a=e.indexOf("#"),l=e.indexOf("/");return t===-1||l!==-1&&t>l||n!==-1&&t>n||a!==-1&&t>a||w8.test(e.slice(0,t))?e:""}function A8(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function BC(e,t,n){const l=cf((n||{}).ignore||[]),o=T8(t);let u=-1;for(;++u<o.length;)UC(e,"text",f);function f(h,g){let y=-1,b;for(;++y<g.length;){const S=g[y],k=b?b.children:void 0;if(l(S,k?k.indexOf(S):void 0,b))return;b=S}if(b)return m(h,g)}function m(h,g){const y=g[g.length-1],b=o[u][0],S=o[u][1];let k=0;const E=y.children.indexOf(h);let C=!1,T=[];b.lastIndex=0;let O=b.exec(h.value);for(;O;){const B=O.index,M={index:O.index,input:O.input,stack:[...g,h]};let R=S(...O,M);if(typeof R=="string"&&(R=R.length>0?{type:"text",value:R}:void 0),R===!1?b.lastIndex=B+1:(k!==B&&T.push({type:"text",value:h.value.slice(k,B)}),Array.isArray(R)?T.push(...R):R&&T.push(R),k=B+O[0].length,C=!0),!b.global)break;O=b.exec(h.value)}return C?(k<h.value.length&&T.push({type:"text",value:h.value.slice(k)}),y.children.splice(E,1,...T)):T=[h],E+T.length}}function T8(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let a=-1;for(;++a<n.length;){const l=n[a];t.push([R8(l[0]),z8(l[1])])}return t}function R8(e){return typeof e=="string"?new RegExp(A8(e),"g"):e}function z8(e){return typeof e=="function"?e:function(){return e}}function O8(e){BC(e,[/\r?\n|\r/g,M8])}function M8(){return{type:"break"}}function D8(){return function(e){O8(e)}}function bS(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let a=0,l=n.indexOf(t);for(;l!==-1;)a++,l=n.indexOf(t,l+t.length);return a}const cp="phrasing",dp=["autolink","link","image","label"];function L8(){return{transforms:[q8],enter:{literalAutolink:U8,literalAutolinkEmail:fp,literalAutolinkHttp:fp,literalAutolinkWww:fp},exit:{literalAutolink:F8,literalAutolinkEmail:$8,literalAutolinkHttp:P8,literalAutolinkWww:B8}}}function I8(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:cp,notInConstruct:dp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:cp,notInConstruct:dp},{character:":",before:"[ps]",after:"\\/",inConstruct:cp,notInConstruct:dp}]}}function U8(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function fp(e){this.config.enter.autolinkProtocol.call(this,e)}function P8(e){this.config.exit.autolinkProtocol.call(this,e)}function B8(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function $8(e){this.config.exit.autolinkEmail.call(this,e)}function F8(e){this.exit(e)}function q8(e){BC(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,H8],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Z8]],{ignore:["link","linkReference"]})}function H8(e,t,n,a,l){let o="";if(!$C(l)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!V8(n)))return!1;const u=Q8(n+a);if(!u[0])return!1;const f={type:"link",title:null,url:o+t+u[0],children:[{type:"text",value:t+u[0]}]};return u[1]?[f,{type:"text",value:u[1]}]:f}function Z8(e,t,n,a){return!$C(a,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function V8(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function Q8(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],a=n.indexOf(")");const l=bS(e,"(");let o=bS(e,")");for(;a!==-1&&l>o;)e+=n.slice(0,a+1),n=n.slice(a+1),a=n.indexOf(")"),o++;return[e,n]}function $C(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||ml(n)||sf(n))&&(!t||n!==47)}FC.peek=nB;function G8(){this.buffer()}function K8(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Y8(){this.buffer()}function X8(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function J8(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=_r(this.sliceSerialize(e)).toLowerCase(),n.label=t}function W8(e){this.exit(e)}function eB(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=_r(this.sliceSerialize(e)).toLowerCase(),n.label=t}function tB(e){this.exit(e)}function nB(){return"["}function FC(e,t,n,a){const l=n.createTracker(a);let o=l.move("[^");const u=n.enter("footnoteReference"),f=n.enter("reference");return o+=l.move(n.safe(n.associationId(e),{after:"]",before:o})),f(),u(),o+=l.move("]"),o}function rB(){return{enter:{gfmFootnoteCallString:G8,gfmFootnoteCall:K8,gfmFootnoteDefinitionLabelString:Y8,gfmFootnoteDefinition:X8},exit:{gfmFootnoteCallString:J8,gfmFootnoteCall:W8,gfmFootnoteDefinitionLabelString:eB,gfmFootnoteDefinition:tB}}}function aB(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:FC},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(a,l,o,u){const f=o.createTracker(u);let m=f.move("[^");const h=o.enter("footnoteDefinition"),g=o.enter("label");return m+=f.move(o.safe(o.associationId(a),{before:m,after:"]"})),g(),m+=f.move("]:"),a.children&&a.children.length>0&&(f.shift(4),m+=f.move((t?`
346
+ `:" ")+o.indentLines(o.containerFlow(a,f.current()),t?qC:iB))),h(),m}}function iB(e,t,n){return t===0?e:qC(e,t,n)}function qC(e,t,n){return(n?"":" ")+e}const lB=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];HC.peek=dB;function sB(){return{canContainEols:["delete"],enter:{strikethrough:uB},exit:{strikethrough:cB}}}function oB(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:lB}],handlers:{delete:HC}}}function uB(e){this.enter({type:"delete",children:[]},e)}function cB(e){this.exit(e)}function HC(e,t,n,a){const l=n.createTracker(a),o=n.enter("strikethrough");let u=l.move("~~");return u+=n.containerPhrasing(e,{...l.current(),before:u,after:"~"}),u+=l.move("~~"),o(),u}function dB(){return"~"}function fB(e){return e.length}function hB(e,t){const n=t||{},a=(n.align||[]).concat(),l=n.stringLength||fB,o=[],u=[],f=[],m=[];let h=0,g=-1;for(;++g<e.length;){const j=[],E=[];let C=-1;for(e[g].length>h&&(h=e[g].length);++C<e[g].length;){const T=mB(e[g][C]);if(n.alignDelimiters!==!1){const O=l(T);E[C]=O,(m[C]===void 0||O>m[C])&&(m[C]=O)}j.push(T)}u[g]=j,f[g]=E}let y=-1;if(typeof a=="object"&&"length"in a)for(;++y<h;)o[y]=xS(a[y]);else{const j=xS(a);for(;++y<h;)o[y]=j}y=-1;const b=[],S=[];for(;++y<h;){const j=o[y];let E="",C="";j===99?(E=":",C=":"):j===108?E=":":j===114&&(C=":");let T=n.alignDelimiters===!1?1:Math.max(1,m[y]-E.length-C.length);const O=E+"-".repeat(T)+C;n.alignDelimiters!==!1&&(T=E.length+T+C.length,T>m[y]&&(m[y]=T),S[y]=T),b[y]=O}u.splice(1,0,b),f.splice(1,0,S),g=-1;const k=[];for(;++g<u.length;){const j=u[g],E=f[g];y=-1;const C=[];for(;++y<h;){const T=j[y]||"";let O="",B="";if(n.alignDelimiters!==!1){const M=m[y]-(E[y]||0),R=o[y];R===114?O=" ".repeat(M):R===99?M%2?(O=" ".repeat(M/2+.5),B=" ".repeat(M/2-.5)):(O=" ".repeat(M/2),B=O):B=" ".repeat(M)}n.delimiterStart!==!1&&!y&&C.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&T==="")&&(n.delimiterStart!==!1||y)&&C.push(" "),n.alignDelimiters!==!1&&C.push(O),C.push(T),n.alignDelimiters!==!1&&C.push(B),n.padding!==!1&&C.push(" "),(n.delimiterEnd!==!1||y!==h-1)&&C.push("|")}k.push(n.delimiterEnd===!1?C.join("").replace(/ +$/,""):C.join(""))}return k.join(`
347
+ `)}function mB(e){return e==null?"":String(e)}function xS(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function pB(e,t,n,a){const l=n.enter("blockquote"),o=n.createTracker(a);o.move("> "),o.shift(2);const u=n.indentLines(n.containerFlow(e,o.current()),gB);return l(),u}function gB(e,t,n){return">"+(n?"":" ")+e}function yB(e,t){return SS(e,t.inConstruct,!0)&&!SS(e,t.notInConstruct,!1)}function SS(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let a=-1;for(;++a<t.length;)if(e.includes(t[a]))return!0;return!1}function wS(e,t,n,a){let l=-1;for(;++l<n.unsafe.length;)if(n.unsafe[l].character===`
348
+ `&&yB(n.stack,n.unsafe[l]))return/[ \t]/.test(a.before)?"":" ";return`\\
349
+ `}function vB(e,t){const n=String(e);let a=n.indexOf(t),l=a,o=0,u=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;a!==-1;)a===l?++o>u&&(u=o):o=1,l=a+t.length,a=n.indexOf(t,l);return u}function bB(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function xB(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function SB(e,t,n,a){const l=xB(n),o=e.value||"",u=l==="`"?"GraveAccent":"Tilde";if(bB(e,n)){const y=n.enter("codeIndented"),b=n.indentLines(o,wB);return y(),b}const f=n.createTracker(a),m=l.repeat(Math.max(vB(o,l)+1,3)),h=n.enter("codeFenced");let g=f.move(m);if(e.lang){const y=n.enter(`codeFencedLang${u}`);g+=f.move(n.safe(e.lang,{before:g,after:" ",encode:["`"],...f.current()})),y()}if(e.lang&&e.meta){const y=n.enter(`codeFencedMeta${u}`);g+=f.move(" "),g+=f.move(n.safe(e.meta,{before:g,after:`
350
+ `,encode:["`"],...f.current()})),y()}return g+=f.move(`
351
+ `),o&&(g+=f.move(o+`
352
+ `)),g+=f.move(m),h(),g}function wB(e,t,n){return(n?"":" ")+e}function dy(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function kB(e,t,n,a){const l=dy(n),o=l==='"'?"Quote":"Apostrophe",u=n.enter("definition");let f=n.enter("label");const m=n.createTracker(a);let h=m.move("[");return h+=m.move(n.safe(n.associationId(e),{before:h,after:"]",...m.current()})),h+=m.move("]: "),f(),!e.url||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),h+=m.move("<"),h+=m.move(n.safe(e.url,{before:h,after:">",...m.current()})),h+=m.move(">")):(f=n.enter("destinationRaw"),h+=m.move(n.safe(e.url,{before:h,after:e.title?" ":`
353
+ `,...m.current()}))),f(),e.title&&(f=n.enter(`title${o}`),h+=m.move(" "+l),h+=m.move(n.safe(e.title,{before:h,after:l,...m.current()})),h+=m.move(l),f()),u(),h}function jB(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function yu(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Bd(e,t,n){const a=Us(e),l=Us(t);return a===void 0?l===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:a===1?l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}ZC.peek=CB;function ZC(e,t,n,a){const l=jB(n),o=n.enter("emphasis"),u=n.createTracker(a),f=u.move(l);let m=u.move(n.containerPhrasing(e,{after:l,before:f,...u.current()}));const h=m.charCodeAt(0),g=Bd(a.before.charCodeAt(a.before.length-1),h,l);g.inside&&(m=yu(h)+m.slice(1));const y=m.charCodeAt(m.length-1),b=Bd(a.after.charCodeAt(0),y,l);b.inside&&(m=m.slice(0,-1)+yu(y));const S=u.move(l);return o(),n.attentionEncodeSurroundingInfo={after:b.outside,before:g.outside},f+m+S}function CB(e,t,n){return n.options.emphasis||"*"}function EB(e,t){let n=!1;return uy(e,function(a){if("value"in a&&/\r?\n|\r/.test(a.value)||a.type==="break")return n=!0,ng}),!!((!e.depth||e.depth<3)&&ny(e)&&(t.options.setext||n))}function NB(e,t,n,a){const l=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(a);if(EB(e,n)){const g=n.enter("headingSetext"),y=n.enter("phrasing"),b=n.containerPhrasing(e,{...o.current(),before:`
354
+ `,after:`
355
+ `});return y(),g(),b+`
356
+ `+(l===1?"=":"-").repeat(b.length-(Math.max(b.lastIndexOf("\r"),b.lastIndexOf(`
357
+ `))+1))}const u="#".repeat(l),f=n.enter("headingAtx"),m=n.enter("phrasing");o.move(u+" ");let h=n.containerPhrasing(e,{before:"# ",after:`
358
+ `,...o.current()});return/^[\t ]/.test(h)&&(h=yu(h.charCodeAt(0))+h.slice(1)),h=h?u+" "+h:u,n.options.closeAtx&&(h+=" "+u),m(),f(),h}VC.peek=_B;function VC(e){return e.value||""}function _B(){return"<"}QC.peek=AB;function QC(e,t,n,a){const l=dy(n),o=l==='"'?"Quote":"Apostrophe",u=n.enter("image");let f=n.enter("label");const m=n.createTracker(a);let h=m.move("![");return h+=m.move(n.safe(e.alt,{before:h,after:"]",...m.current()})),h+=m.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),h+=m.move("<"),h+=m.move(n.safe(e.url,{before:h,after:">",...m.current()})),h+=m.move(">")):(f=n.enter("destinationRaw"),h+=m.move(n.safe(e.url,{before:h,after:e.title?" ":")",...m.current()}))),f(),e.title&&(f=n.enter(`title${o}`),h+=m.move(" "+l),h+=m.move(n.safe(e.title,{before:h,after:l,...m.current()})),h+=m.move(l),f()),h+=m.move(")"),u(),h}function AB(){return"!"}GC.peek=TB;function GC(e,t,n,a){const l=e.referenceType,o=n.enter("imageReference");let u=n.enter("label");const f=n.createTracker(a);let m=f.move("![");const h=n.safe(e.alt,{before:m,after:"]",...f.current()});m+=f.move(h+"]["),u();const g=n.stack;n.stack=[],u=n.enter("reference");const y=n.safe(n.associationId(e),{before:m,after:"]",...f.current()});return u(),n.stack=g,o(),l==="full"||!h||h!==y?m+=f.move(y+"]"):l==="shortcut"?m=m.slice(0,-1):m+=f.move("]"),m}function TB(){return"!"}KC.peek=RB;function KC(e,t,n){let a=e.value||"",l="`",o=-1;for(;new RegExp("(^|[^`])"+l+"([^`]|$)").test(a);)l+="`";for(/[^ \r\n]/.test(a)&&(/^[ \r\n]/.test(a)&&/[ \r\n]$/.test(a)||/^`|`$/.test(a))&&(a=" "+a+" ");++o<n.unsafe.length;){const u=n.unsafe[o],f=n.compilePattern(u);let m;if(u.atBreak)for(;m=f.exec(a);){let h=m.index;a.charCodeAt(h)===10&&a.charCodeAt(h-1)===13&&h--,a=a.slice(0,h)+" "+a.slice(m.index+1)}}return l+a+l}function RB(){return"`"}function YC(e,t){const n=ny(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}XC.peek=zB;function XC(e,t,n,a){const l=dy(n),o=l==='"'?"Quote":"Apostrophe",u=n.createTracker(a);let f,m;if(YC(e,n)){const g=n.stack;n.stack=[],f=n.enter("autolink");let y=u.move("<");return y+=u.move(n.containerPhrasing(e,{before:y,after:">",...u.current()})),y+=u.move(">"),f(),n.stack=g,y}f=n.enter("link"),m=n.enter("label");let h=u.move("[");return h+=u.move(n.containerPhrasing(e,{before:h,after:"](",...u.current()})),h+=u.move("]("),m(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(m=n.enter("destinationLiteral"),h+=u.move("<"),h+=u.move(n.safe(e.url,{before:h,after:">",...u.current()})),h+=u.move(">")):(m=n.enter("destinationRaw"),h+=u.move(n.safe(e.url,{before:h,after:e.title?" ":")",...u.current()}))),m(),e.title&&(m=n.enter(`title${o}`),h+=u.move(" "+l),h+=u.move(n.safe(e.title,{before:h,after:l,...u.current()})),h+=u.move(l),m()),h+=u.move(")"),f(),h}function zB(e,t,n){return YC(e,n)?"<":"["}JC.peek=OB;function JC(e,t,n,a){const l=e.referenceType,o=n.enter("linkReference");let u=n.enter("label");const f=n.createTracker(a);let m=f.move("[");const h=n.containerPhrasing(e,{before:m,after:"]",...f.current()});m+=f.move(h+"]["),u();const g=n.stack;n.stack=[],u=n.enter("reference");const y=n.safe(n.associationId(e),{before:m,after:"]",...f.current()});return u(),n.stack=g,o(),l==="full"||!h||h!==y?m+=f.move(y+"]"):l==="shortcut"?m=m.slice(0,-1):m+=f.move("]"),m}function OB(){return"["}function fy(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function MB(e){const t=fy(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function DB(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function WC(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function LB(e,t,n,a){const l=n.enter("list"),o=n.bulletCurrent;let u=e.ordered?DB(n):fy(n);const f=e.ordered?u==="."?")":".":MB(n);let m=t&&n.bulletLastUsed?u===n.bulletLastUsed:!1;if(!e.ordered){const g=e.children?e.children[0]:void 0;if((u==="*"||u==="-")&&g&&(!g.children||!g.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(m=!0),WC(n)===u&&g){let y=-1;for(;++y<e.children.length;){const b=e.children[y];if(b&&b.type==="listItem"&&b.children&&b.children[0]&&b.children[0].type==="thematicBreak"){m=!0;break}}}}m&&(u=f),n.bulletCurrent=u;const h=n.containerFlow(e,a);return n.bulletLastUsed=u,n.bulletCurrent=o,l(),h}function IB(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function UB(e,t,n,a){const l=IB(n);let o=n.bulletCurrent||fy(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let u=o.length+1;(l==="tab"||l==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(u=Math.ceil(u/4)*4);const f=n.createTracker(a);f.move(o+" ".repeat(u-o.length)),f.shift(u);const m=n.enter("listItem"),h=n.indentLines(n.containerFlow(e,f.current()),g);return m(),h;function g(y,b,S){return b?(S?"":" ".repeat(u))+y:(S?o:o+" ".repeat(u-o.length))+y}}function PB(e,t,n,a){const l=n.enter("paragraph"),o=n.enter("phrasing"),u=n.containerPhrasing(e,a);return o(),l(),u}const BB=cf(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function $B(e,t,n,a){return(e.children.some(function(u){return BB(u)})?n.containerPhrasing:n.containerFlow).call(n,e,a)}function FB(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}eE.peek=qB;function eE(e,t,n,a){const l=FB(n),o=n.enter("strong"),u=n.createTracker(a),f=u.move(l+l);let m=u.move(n.containerPhrasing(e,{after:l,before:f,...u.current()}));const h=m.charCodeAt(0),g=Bd(a.before.charCodeAt(a.before.length-1),h,l);g.inside&&(m=yu(h)+m.slice(1));const y=m.charCodeAt(m.length-1),b=Bd(a.after.charCodeAt(0),y,l);b.inside&&(m=m.slice(0,-1)+yu(y));const S=u.move(l+l);return o(),n.attentionEncodeSurroundingInfo={after:b.outside,before:g.outside},f+m+S}function qB(e,t,n){return n.options.strong||"*"}function HB(e,t,n,a){return n.safe(e.value,a)}function ZB(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function VB(e,t,n){const a=(WC(n)+(n.options.ruleSpaces?" ":"")).repeat(ZB(n));return n.options.ruleSpaces?a.slice(0,-1):a}const tE={blockquote:pB,break:wS,code:SB,definition:kB,emphasis:ZC,hardBreak:wS,heading:NB,html:VC,image:QC,imageReference:GC,inlineCode:KC,link:XC,linkReference:JC,list:LB,listItem:UB,paragraph:PB,root:$B,strong:eE,text:HB,thematicBreak:VB};function QB(){return{enter:{table:GB,tableData:kS,tableHeader:kS,tableRow:YB},exit:{codeText:XB,table:KB,tableData:hp,tableHeader:hp,tableRow:hp}}}function GB(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function KB(e){this.exit(e),this.data.inTable=void 0}function YB(e){this.enter({type:"tableRow",children:[]},e)}function hp(e){this.exit(e)}function kS(e){this.enter({type:"tableCell",children:[]},e)}function XB(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,JB));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function JB(e,t){return t==="|"?t:e}function WB(e){const t=e||{},n=t.tableCellPadding,a=t.tablePipeAlign,l=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
359
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:b,table:u,tableCell:m,tableRow:f}};function u(S,k,j,E){return h(g(S,j,E),S.align)}function f(S,k,j,E){const C=y(S,j,E),T=h([C]);return T.slice(0,T.indexOf(`
360
+ `))}function m(S,k,j,E){const C=j.enter("tableCell"),T=j.enter("phrasing"),O=j.containerPhrasing(S,{...E,before:o,after:o});return T(),C(),O}function h(S,k){return hB(S,{align:k,alignDelimiters:a,padding:n,stringLength:l})}function g(S,k,j){const E=S.children;let C=-1;const T=[],O=k.enter("table");for(;++C<E.length;)T[C]=y(E[C],k,j);return O(),T}function y(S,k,j){const E=S.children;let C=-1;const T=[],O=k.enter("tableRow");for(;++C<E.length;)T[C]=m(E[C],S,k,j);return O(),T}function b(S,k,j){let E=tE.inlineCode(S,k,j);return j.stack.includes("tableCell")&&(E=E.replace(/\|/g,"\\$&")),E}}function e$(){return{exit:{taskListCheckValueChecked:jS,taskListCheckValueUnchecked:jS,paragraph:n$}}}function t$(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:r$}}}function jS(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function n$(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const a=n.children[0];if(a&&a.type==="text"){const l=t.children;let o=-1,u;for(;++o<l.length;){const f=l[o];if(f.type==="paragraph"){u=f;break}}u===n&&(a.value=a.value.slice(1),a.value.length===0?n.children.shift():n.position&&a.position&&typeof a.position.start.offset=="number"&&(a.position.start.column++,a.position.start.offset++,n.position.start=Object.assign({},a.position.start)))}}this.exit(e)}function r$(e,t,n,a){const l=e.children[0],o=typeof e.checked=="boolean"&&l&&l.type==="paragraph",u="["+(e.checked?"x":" ")+"] ",f=n.createTracker(a);o&&f.move(u);let m=tE.listItem(e,t,n,{...a,...f.current()});return o&&(m=m.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),m;function h(g){return g+u}}function a$(){return[L8(),rB(),sB(),QB(),e$()]}function i$(e){return{extensions:[I8(),aB(e),oB(),WB(e),t$()]}}const l$={tokenize:f$,partial:!0},nE={tokenize:h$,partial:!0},rE={tokenize:m$,partial:!0},aE={tokenize:p$,partial:!0},s$={tokenize:g$,partial:!0},iE={name:"wwwAutolink",tokenize:c$,previous:sE},lE={name:"protocolAutolink",tokenize:d$,previous:oE},Ea={name:"emailAutolink",tokenize:u$,previous:uE},Gr={};function o$(){return{text:Gr}}let Xi=48;for(;Xi<123;)Gr[Xi]=Ea,Xi++,Xi===58?Xi=65:Xi===91&&(Xi=97);Gr[43]=Ea;Gr[45]=Ea;Gr[46]=Ea;Gr[95]=Ea;Gr[72]=[Ea,lE];Gr[104]=[Ea,lE];Gr[87]=[Ea,iE];Gr[119]=[Ea,iE];function u$(e,t,n){const a=this;let l,o;return u;function u(y){return!lg(y)||!uE.call(a,a.previous)||hy(a.events)?n(y):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(y))}function f(y){return lg(y)?(e.consume(y),f):y===64?(e.consume(y),m):n(y)}function m(y){return y===46?e.check(s$,g,h)(y):y===45||y===95||Sn(y)?(o=!0,e.consume(y),m):g(y)}function h(y){return e.consume(y),l=!0,m}function g(y){return o&&l&&_n(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(y)):n(y)}}function c$(e,t,n){const a=this;return l;function l(u){return u!==87&&u!==119||!sE.call(a,a.previous)||hy(a.events)?n(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(l$,e.attempt(nE,e.attempt(rE,o),n),n)(u))}function o(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(u)}}function d$(e,t,n){const a=this;let l="",o=!1;return u;function u(y){return(y===72||y===104)&&oE.call(a,a.previous)&&!hy(a.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),l+=String.fromCodePoint(y),e.consume(y),f):n(y)}function f(y){if(_n(y)&&l.length<5)return l+=String.fromCodePoint(y),e.consume(y),f;if(y===58){const b=l.toLowerCase();if(b==="http"||b==="https")return e.consume(y),m}return n(y)}function m(y){return y===47?(e.consume(y),o?h:(o=!0,m)):n(y)}function h(y){return y===null||Id(y)||jt(y)||ml(y)||sf(y)?n(y):e.attempt(nE,e.attempt(rE,g),n)(y)}function g(y){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(y)}}function f$(e,t,n){let a=0;return l;function l(u){return(u===87||u===119)&&a<3?(a++,e.consume(u),l):u===46&&a===3?(e.consume(u),o):n(u)}function o(u){return u===null?n(u):t(u)}}function h$(e,t,n){let a,l,o;return u;function u(h){return h===46||h===95?e.check(aE,m,f)(h):h===null||jt(h)||ml(h)||h!==45&&sf(h)?m(h):(o=!0,e.consume(h),u)}function f(h){return h===95?a=!0:(l=a,a=void 0),e.consume(h),u}function m(h){return l||a||!o?n(h):t(h)}}function m$(e,t){let n=0,a=0;return l;function l(u){return u===40?(n++,e.consume(u),l):u===41&&a<n?o(u):u===33||u===34||u===38||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===60||u===63||u===93||u===95||u===126?e.check(aE,t,o)(u):u===null||jt(u)||ml(u)?t(u):(e.consume(u),l)}function o(u){return u===41&&a++,e.consume(u),l}}function p$(e,t,n){return a;function a(f){return f===33||f===34||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===63||f===95||f===126?(e.consume(f),a):f===38?(e.consume(f),o):f===93?(e.consume(f),l):f===60||f===null||jt(f)||ml(f)?t(f):n(f)}function l(f){return f===null||f===40||f===91||jt(f)||ml(f)?t(f):a(f)}function o(f){return _n(f)?u(f):n(f)}function u(f){return f===59?(e.consume(f),a):_n(f)?(e.consume(f),u):n(f)}}function g$(e,t,n){return a;function a(o){return e.consume(o),l}function l(o){return Sn(o)?n(o):t(o)}}function sE(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||jt(e)}function oE(e){return!_n(e)}function uE(e){return!(e===47||lg(e))}function lg(e){return e===43||e===45||e===46||e===95||Sn(e)}function hy(e){let t=e.length,n=!1;for(;t--;){const a=e[t][1];if((a.type==="labelLink"||a.type==="labelImage")&&!a._balanced){n=!0;break}if(a._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const y$={tokenize:C$,partial:!0};function v$(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:w$,continuation:{tokenize:k$},exit:j$}},text:{91:{name:"gfmFootnoteCall",tokenize:S$},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:b$,resolveTo:x$}}}}function b$(e,t,n){const a=this;let l=a.events.length;const o=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let u;for(;l--;){const m=a.events[l][1];if(m.type==="labelImage"){u=m;break}if(m.type==="gfmFootnoteCall"||m.type==="labelLink"||m.type==="label"||m.type==="image"||m.type==="link")break}return f;function f(m){if(!u||!u._balanced)return n(m);const h=_r(a.sliceSerialize({start:u.end,end:a.now()}));return h.codePointAt(0)!==94||!o.includes(h.slice(1))?n(m):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),t(m))}}function x$(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const a={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},l={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};l.end.column++,l.end.offset++,l.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},l.end),end:Object.assign({},e[e.length-1][1].start)},u={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},f=[e[n+1],e[n+2],["enter",a,t],e[n+3],e[n+4],["enter",l,t],["exit",l,t],["enter",o,t],["enter",u,t],["exit",u,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",a,t]];return e.splice(n,e.length-n+1,...f),e}function S$(e,t,n){const a=this,l=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o=0,u;return f;function f(y){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(y),e.exit("gfmFootnoteCallLabelMarker"),m}function m(y){return y!==94?n(y):(e.enter("gfmFootnoteCallMarker"),e.consume(y),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(y){if(o>999||y===93&&!u||y===null||y===91||jt(y))return n(y);if(y===93){e.exit("chunkString");const b=e.exit("gfmFootnoteCallString");return l.includes(_r(a.sliceSerialize(b)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(y),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(y)}return jt(y)||(u=!0),o++,e.consume(y),y===92?g:h}function g(y){return y===91||y===92||y===93?(e.consume(y),o++,h):h(y)}}function w$(e,t,n){const a=this,l=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o,u=0,f;return m;function m(k){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(k){return k===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",g):n(k)}function g(k){if(u>999||k===93&&!f||k===null||k===91||jt(k))return n(k);if(k===93){e.exit("chunkString");const j=e.exit("gfmFootnoteDefinitionLabelString");return o=_r(a.sliceSerialize(j)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),b}return jt(k)||(f=!0),u++,e.consume(k),k===92?y:g}function y(k){return k===91||k===92||k===93?(e.consume(k),u++,g):g(k)}function b(k){return k===58?(e.enter("definitionMarker"),e.consume(k),e.exit("definitionMarker"),l.includes(o)||l.push(o),it(e,S,"gfmFootnoteDefinitionWhitespace")):n(k)}function S(k){return t(k)}}function k$(e,t,n){return e.check(Ou,t,e.attempt(y$,t,n))}function j$(e){e.exit("gfmFootnoteDefinition")}function C$(e,t,n){const a=this;return it(e,l,"gfmFootnoteDefinitionIndent",5);function l(o){const u=a.events[a.events.length-1];return u&&u[1].type==="gfmFootnoteDefinitionIndent"&&u[2].sliceSerialize(u[1],!0).length===4?t(o):n(o)}}function E$(e){let n=(e||{}).singleTilde;const a={name:"strikethrough",tokenize:o,resolveAll:l};return n==null&&(n=!0),{text:{126:a},insideSpan:{null:[a]},attentionMarkers:{null:[126]}};function l(u,f){let m=-1;for(;++m<u.length;)if(u[m][0]==="enter"&&u[m][1].type==="strikethroughSequenceTemporary"&&u[m][1]._close){let h=m;for(;h--;)if(u[h][0]==="exit"&&u[h][1].type==="strikethroughSequenceTemporary"&&u[h][1]._open&&u[m][1].end.offset-u[m][1].start.offset===u[h][1].end.offset-u[h][1].start.offset){u[m][1].type="strikethroughSequence",u[h][1].type="strikethroughSequence";const g={type:"strikethrough",start:Object.assign({},u[h][1].start),end:Object.assign({},u[m][1].end)},y={type:"strikethroughText",start:Object.assign({},u[h][1].end),end:Object.assign({},u[m][1].start)},b=[["enter",g,f],["enter",u[h][1],f],["exit",u[h][1],f],["enter",y,f]],S=f.parser.constructs.insideSpan.null;S&&nr(b,b.length,0,of(S,u.slice(h+1,m),f)),nr(b,b.length,0,[["exit",y,f],["enter",u[m][1],f],["exit",u[m][1],f],["exit",g,f]]),nr(u,h-1,m-h+3,b),m=h+b.length-2;break}}for(m=-1;++m<u.length;)u[m][1].type==="strikethroughSequenceTemporary"&&(u[m][1].type="data");return u}function o(u,f,m){const h=this.previous,g=this.events;let y=0;return b;function b(k){return h===126&&g[g.length-1][1].type!=="characterEscape"?m(k):(u.enter("strikethroughSequenceTemporary"),S(k))}function S(k){const j=Us(h);if(k===126)return y>1?m(k):(u.consume(k),y++,S);if(y<2&&!n)return m(k);const E=u.exit("strikethroughSequenceTemporary"),C=Us(k);return E._open=!C||C===2&&!!j,E._close=!j||j===2&&!!C,f(k)}}}class N${constructor(){this.map=[]}add(t,n,a){_$(this,t,n,a)}consume(t){if(this.map.sort(function(o,u){return o[0]-u[0]}),this.map.length===0)return;let n=this.map.length;const a=[];for(;n>0;)n-=1,a.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];a.push(t.slice()),t.length=0;let l=a.pop();for(;l;){for(const o of l)t.push(o);l=a.pop()}this.map.length=0}}function _$(e,t,n,a){let l=0;if(!(n===0&&a.length===0)){for(;l<e.map.length;){if(e.map[l][0]===t){e.map[l][1]+=n,e.map[l][2].push(...a);return}l+=1}e.map.push([t,n,a])}}function A$(e,t){let n=!1;const a=[];for(;t<e.length;){const l=e[t];if(n){if(l[0]==="enter")l[1].type==="tableContent"&&a.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(l[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=a.length-1;a[o]=a[o]==="left"?"center":"right"}}else if(l[1].type==="tableDelimiterRow")break}else l[0]==="enter"&&l[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return a}function T$(){return{flow:{null:{name:"table",tokenize:R$,resolveAll:z$}}}}function R$(e,t,n){const a=this;let l=0,o=0,u;return f;function f(q){let oe=a.events.length-1;for(;oe>-1;){const de=a.events[oe][1].type;if(de==="lineEnding"||de==="linePrefix")oe--;else break}const W=oe>-1?a.events[oe][1].type:null,me=W==="tableHead"||W==="tableRow"?R:m;return me===R&&a.parser.lazy[a.now().line]?n(q):me(q)}function m(q){return e.enter("tableHead"),e.enter("tableRow"),h(q)}function h(q){return q===124||(u=!0,o+=1),g(q)}function g(q){return q===null?n(q):Re(q)?o>1?(o=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(q),e.exit("lineEnding"),S):n(q):Ye(q)?it(e,g,"whitespace")(q):(o+=1,u&&(u=!1,l+=1),q===124?(e.enter("tableCellDivider"),e.consume(q),e.exit("tableCellDivider"),u=!0,g):(e.enter("data"),y(q)))}function y(q){return q===null||q===124||jt(q)?(e.exit("data"),g(q)):(e.consume(q),q===92?b:y)}function b(q){return q===92||q===124?(e.consume(q),y):y(q)}function S(q){return a.interrupt=!1,a.parser.lazy[a.now().line]?n(q):(e.enter("tableDelimiterRow"),u=!1,Ye(q)?it(e,k,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(q):k(q))}function k(q){return q===45||q===58?E(q):q===124?(u=!0,e.enter("tableCellDivider"),e.consume(q),e.exit("tableCellDivider"),j):M(q)}function j(q){return Ye(q)?it(e,E,"whitespace")(q):E(q)}function E(q){return q===58?(o+=1,u=!0,e.enter("tableDelimiterMarker"),e.consume(q),e.exit("tableDelimiterMarker"),C):q===45?(o+=1,C(q)):q===null||Re(q)?B(q):M(q)}function C(q){return q===45?(e.enter("tableDelimiterFiller"),T(q)):M(q)}function T(q){return q===45?(e.consume(q),T):q===58?(u=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(q),e.exit("tableDelimiterMarker"),O):(e.exit("tableDelimiterFiller"),O(q))}function O(q){return Ye(q)?it(e,B,"whitespace")(q):B(q)}function B(q){return q===124?k(q):q===null||Re(q)?!u||l!==o?M(q):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(q)):M(q)}function M(q){return n(q)}function R(q){return e.enter("tableRow"),D(q)}function D(q){return q===124?(e.enter("tableCellDivider"),e.consume(q),e.exit("tableCellDivider"),D):q===null||Re(q)?(e.exit("tableRow"),t(q)):Ye(q)?it(e,D,"whitespace")(q):(e.enter("data"),Z(q))}function Z(q){return q===null||q===124||jt(q)?(e.exit("data"),D(q)):(e.consume(q),q===92?te:Z)}function te(q){return q===92||q===124?(e.consume(q),Z):Z(q)}}function z$(e,t){let n=-1,a=!0,l=0,o=[0,0,0,0],u=[0,0,0,0],f=!1,m=0,h,g,y;const b=new N$;for(;++n<e.length;){const S=e[n],k=S[1];S[0]==="enter"?k.type==="tableHead"?(f=!1,m!==0&&(CS(b,t,m,h,g),g=void 0,m=0),h={type:"table",start:Object.assign({},k.start),end:Object.assign({},k.end)},b.add(n,0,[["enter",h,t]])):k.type==="tableRow"||k.type==="tableDelimiterRow"?(a=!0,y=void 0,o=[0,0,0,0],u=[0,n+1,0,0],f&&(f=!1,g={type:"tableBody",start:Object.assign({},k.start),end:Object.assign({},k.end)},b.add(n,0,[["enter",g,t]])),l=k.type==="tableDelimiterRow"?2:g?3:1):l&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")?(a=!1,u[2]===0&&(o[1]!==0&&(u[0]=u[1],y=fd(b,t,o,l,void 0,y),o=[0,0,0,0]),u[2]=n)):k.type==="tableCellDivider"&&(a?a=!1:(o[1]!==0&&(u[0]=u[1],y=fd(b,t,o,l,void 0,y)),o=u,u=[o[1],n,0,0])):k.type==="tableHead"?(f=!0,m=n):k.type==="tableRow"||k.type==="tableDelimiterRow"?(m=n,o[1]!==0?(u[0]=u[1],y=fd(b,t,o,l,n,y)):u[1]!==0&&(y=fd(b,t,u,l,n,y)),l=0):l&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(u[3]=n)}for(m!==0&&CS(b,t,m,h,g),b.consume(t.events),n=-1;++n<t.events.length;){const S=t.events[n];S[0]==="enter"&&S[1].type==="table"&&(S[1]._align=A$(t.events,n))}return e}function fd(e,t,n,a,l,o){const u=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",f="tableContent";n[0]!==0&&(o.end=Object.assign({},hs(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const m=hs(t.events,n[1]);if(o={type:u,start:Object.assign({},m),end:Object.assign({},m)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const h=hs(t.events,n[2]),g=hs(t.events,n[3]),y={type:f,start:Object.assign({},h),end:Object.assign({},g)};if(e.add(n[2],0,[["enter",y,t]]),a!==2){const b=t.events[n[2]],S=t.events[n[3]];if(b[1].end=Object.assign({},S[1].end),b[1].type="chunkText",b[1].contentType="text",n[3]>n[2]+1){const k=n[2]+1,j=n[3]-n[2]-1;e.add(k,j,[])}}e.add(n[3]+1,0,[["exit",y,t]])}return l!==void 0&&(o.end=Object.assign({},hs(t.events,l)),e.add(l,0,[["exit",o,t]]),o=void 0),o}function CS(e,t,n,a,l){const o=[],u=hs(t.events,n);l&&(l.end=Object.assign({},u),o.push(["exit",l,t])),a.end=Object.assign({},u),o.push(["exit",a,t]),e.add(n+1,0,o)}function hs(e,t){const n=e[t],a=n[0]==="enter"?"start":"end";return n[1][a]}const O$={name:"tasklistCheck",tokenize:D$};function M$(){return{text:{91:O$}}}function D$(e,t,n){const a=this;return l;function l(m){return a.previous!==null||!a._gfmTasklistFirstContentOfListItem?n(m):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),o)}function o(m){return jt(m)?(e.enter("taskListCheckValueUnchecked"),e.consume(m),e.exit("taskListCheckValueUnchecked"),u):m===88||m===120?(e.enter("taskListCheckValueChecked"),e.consume(m),e.exit("taskListCheckValueChecked"),u):n(m)}function u(m){return m===93?(e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):n(m)}function f(m){return Re(m)?t(m):Ye(m)?e.check({tokenize:L$},t,n)(m):n(m)}}function L$(e,t,n){return it(e,a,"whitespace");function a(l){return l===null?n(l):t(l)}}function I$(e){return bC([o$(),v$(),E$(e),T$(),M$()])}const U$={};function P$(e){const t=this,n=e||U$,a=t.data(),l=a.micromarkExtensions||(a.micromarkExtensions=[]),o=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),u=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);l.push(I$(n)),o.push(a$()),u.push(i$(n))}function cE({children:e,className:t}){return d.jsx("div",{className:Ee("prose prose-sm max-w-none leading-[1.55] text-[color:inherit]","prose-headings:text-current prose-p:text-current prose-li:text-current prose-strong:text-current prose-em:text-current prose-blockquote:text-current","prose-p:my-2 prose-headings:mt-3 prose-headings:mb-1.5 prose-ul:my-2 prose-ol:my-2 prose-li:my-0.5 prose-pre:my-2 prose-blockquote:my-2 prose-hr:my-3","prose-a:text-[color:var(--accent)] prose-a:no-underline hover:prose-a:underline","prose-code:text-current prose-code:bg-[color:var(--bg-sunken)] prose-code:rounded prose-code:px-1 prose-code:py-0.5 prose-code:text-[0.9em] prose-code:before:content-none prose-code:after:content-none","prose-pre:bg-[color:var(--bg-sunken)] prose-pre:text-current prose-pre:border prose-pre:border-[color:var(--border)]","prose-hr:border-[color:var(--border)]","prose-blockquote:border-l-[color:var(--border-strong)] prose-blockquote:text-[color:var(--fg-2)]","prose-th:border-[color:var(--border)] prose-td:border-[color:var(--border)]",t),children:d.jsx(j8,{remarkPlugins:[P$,D8],children:e})})}function B$({value:e,baseline:t,onChange:n,onRevert:a,disabled:l}){const[o,u]=x.useState(!1),f=x.useRef(null),m=e!==t;return x.useEffect(()=>{var h;o&&((h=f.current)==null||h.focus())},[o]),d.jsxs(yn,{style:{borderColor:m?"color-mix(in oklch, var(--state-blocked) 70%, transparent)":void 0},children:[d.jsxs(Vr,{children:[d.jsxs(Qr,{children:["System prompt append",m&&d.jsx($$,{})]}),!o&&!l&&d.jsxs(be,{size:"xs",variant:"outline",onClick:()=>u(!0),children:[d.jsx(Eu,{className:"h-3 w-3"})," Edit"]})]}),d.jsx(Ca,{children:o?d.jsxs("div",{className:"space-y-2",children:[d.jsx("textarea",{ref:f,value:e,onChange:h=>n(h.target.value),onKeyDown:h=>{h.key==="Escape"&&(h.preventDefault(),u(!1))},rows:10,className:"w-full rounded border bg-transparent p-2 font-mono text-body shadow-sm focus:outline-none focus:ring-1 focus:ring-ring",placeholder:"Appended to Claude Code's default system prompt.",maxLength:32e3,spellCheck:!1}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(be,{size:"xs",variant:"ghost",onClick:()=>{a(),u(!1)},disabled:!m,children:"Revert"}),d.jsx(be,{size:"xs",onClick:()=>u(!1),children:"Done"})]}),d.jsx("p",{className:"text-caption text-muted-foreground",children:"`Done` collapses this editor. The change is saved only when you click Save in the bar at the bottom of the page."})]}):d.jsx("div",{className:"rounded bg-muted p-3 text-body max-h-64 overflow-auto min-h-8",children:e?d.jsx(cE,{children:e}):d.jsx("span",{className:"text-muted-foreground italic",children:"No prompt append."})})})]})}function $$(){return d.jsx("span",{className:"mono uppercase text-caption",style:{padding:"var(--hairline) var(--sp-1_5)",borderRadius:"var(--radius-chip)",background:"color-mix(in oklch, var(--state-blocked) 16%, transparent)",color:"color-mix(in oklch, var(--state-blocked) 60%, var(--fg))"},children:"changed"})}const F$={prompt:"Prompt",model:"Model",mcp:"MCP",env:"Env",git:"Git"};function q$(e){if(!e.summary.anyDirty&&!e.conflictMessage&&!e.errorMessage&&!e.justSaved)return null;const t=e.summary.dirtySections.length;return d.jsx("div",{className:"sticky bottom-0 z-30 -mx-6 backdrop-blur",style:{padding:"var(--sp-3) var(--sp-6)",background:"color-mix(in oklch, var(--bg-raised) 94%, transparent)",borderTop:"var(--hairline) solid var(--border)"},children:d.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[d.jsxs("div",{className:"flex flex-col gap-1 text-body min-w-0",children:[e.summary.anyDirty&&d.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[d.jsx(Hr,{state:"blocked",size:8}),d.jsxs("span",{className:"font-medium",children:[t," section",t===1?"":"s"," with unsaved changes"]}),d.jsx("span",{style:{color:"var(--fg-4)"},"aria-hidden":!0,children:"·"}),d.jsx("span",{className:"flex flex-wrap gap-1",children:e.summary.dirtySections.map(n=>d.jsx("button",{type:"button",onClick:()=>e.onJumpTo(n),className:"text-caption transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",style:{padding:"var(--sp-0_5) var(--sp-1_5)",borderRadius:"var(--radius-chip)",background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",color:"var(--fg-2)",cursor:"pointer"},children:F$[n]},n))})]}),e.justSaved&&!e.summary.anyDirty&&!e.errorMessage&&!e.conflictMessage&&d.jsxs("div",{className:"inline-flex items-center gap-1.5 text-body font-medium",style:{color:"var(--state-idle)"},children:[d.jsx(Cu,{className:"h-3.5 w-3.5"}),"Saved"]}),e.saveHint&&d.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:e.saveHint}),e.conflictMessage&&d.jsx("p",{className:"text-caption font-medium",style:{color:"var(--state-blocked)"},children:e.conflictMessage}),e.errorMessage&&d.jsx("p",{className:"text-caption font-medium",style:{color:"var(--state-error)"},children:e.errorMessage})]}),d.jsxs("div",{className:"flex gap-2 shrink-0",children:[e.conflictMessage&&d.jsx(be,{variant:"outline",size:"sm",onClick:e.onReloadRemote,children:"Discard mine, load latest"}),d.jsx(be,{variant:"ghost",size:"sm",onClick:e.onDiscard,disabled:e.saving,children:"Discard changes"}),d.jsx(be,{size:"sm",onClick:e.onSave,disabled:e.saving||!e.summary.anyDirty,children:e.saving?d.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[d.jsx(LT,{className:"h-3 w-3 animate-spin","aria-hidden":!0}),"Saving…"]}):"Save"})]})]})})}function lu(e){return`agent-cfg-${e}`}function Xo({anchorId:e,title:t,caption:n,right:a,children:l,className:o,sectionProps:u}){return d.jsxs("section",{id:e,className:Ee("space-y-3",o),...u,children:[d.jsxs("div",{className:"flex items-end justify-between gap-3",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-subtitle",style:{color:"var(--fg)"},children:t}),n&&d.jsx("div",{className:"text-caption",style:{color:"var(--fg-3)"},children:n})]}),a]}),d.jsx("div",{className:"space-y-3",children:l})]})}function H$(){return d.jsx("hr",{"aria-hidden":!0,style:{border:0,borderTop:"var(--hairline) solid var(--border)",margin:"var(--sp-2) 0"}})}const Z$={"claude-code":{name:"Claude Code",caption:"Anthropic's Claude Code runtime. Fixed after creation — create a new agent to switch."},kael:{name:"Kael",caption:"Kael runtime (coming soon). Fixed after creation — create a new agent to switch."}};function V$(e){const t=Z$[e.runtimeKind];return d.jsxs("div",{className:"space-y-3",children:[d.jsx(Q$,{name:t.name,caption:t.caption,locked:!0}),d.jsx(G$,{computerLabel:e.computerLabel,canBindComputer:e.canBindComputer,bindPending:e.bindComputerPending??!1,onBindComputer:e.onBindComputer}),e.modelSlot]})}function Q$({name:e,caption:t,locked:n}){return d.jsxs(yn,{children:[d.jsx(Vr,{children:d.jsxs(Qr,{children:["Where it runs",n&&d.jsxs("span",{className:"mono uppercase text-caption inline-flex items-center gap-1",style:{color:"var(--fg-4)"},children:[d.jsx(Dw,{className:"h-3 w-3","aria-hidden":!0})," locked"]})]})}),d.jsxs(Ca,{className:"space-y-1 text-body",children:[d.jsxs("div",{className:"inline-flex items-center gap-2",children:[d.jsx(Lw,{className:"h-3.5 w-3.5","aria-hidden":!0,style:{color:"var(--accent)"}}),d.jsx("span",{className:"font-medium",children:e})]}),d.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:t})]})]})}function G$(e){const t=!!e.computerLabel;return d.jsxs(yn,{children:[d.jsxs(Vr,{children:[d.jsx(Qr,{children:"Bound computer"}),e.canBindComputer&&e.onBindComputer&&!t&&d.jsxs(be,{size:"xs",variant:"outline",onClick:e.onBindComputer,disabled:e.bindPending,children:[d.jsx(Mw,{className:"h-3 w-3"}),e.bindPending?"Binding…":"Bind computer"]})]}),d.jsx(Ca,{className:"text-body",children:t?d.jsx("div",{className:"mono",style:{color:"var(--fg-2)"},children:e.computerLabel}):d.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:"No computer bound. A computer claims this agent on its first WebSocket connect, or you can pick one manually via the button above."})})]})}function K$(e){return e.isUnclaimed?"Saving: configuration stored; will apply when a computer claims this agent.":e.isOffline?"Saving: configuration stored; will apply when the computer reconnects.":e.activeSessions>0?`Saving: new chats use this immediately; ${e.activeSessions} active chat${e.activeSessions===1?"":"s"} switch on their next message.`:"Saving: new chats use this immediately."}function Y$(e,t){let n=t.size+1;for(;t.has(`${e}-${n}`);)n++;return`${e}-${n}`}function X$(e,t){return JSON.stringify(e)===JSON.stringify(t)}function mp(e,t){return e.map((n,a)=>({key:`${t}-${a+1}`,value:n,baseline:n,status:"unchanged"}))}function ES(e){return e.map(t=>t.status==="deleted"?t:t.baseline==null?{...t,status:"added"}:X$(t.value,t.baseline)?{...t,status:"unchanged"}:{...t,status:"modified"})}function pp(e,t){const n=e;return{add:a=>t(l=>{const o=l[e],u=new Set(o.map(h=>h.key)),f=Y$(n,u),m=[...o,{key:f,value:a,baseline:null,status:"added"}];return{...l,[e]:ES(m)}}),update:(a,l)=>t(o=>{const f=o[e].map(m=>m.key===a?{...m,value:l}:m);return{...o,[e]:ES(f)}}),remove:a=>t(l=>{const u=l[e].map(f=>f.key!==a?f:f.baseline==null?null:{...f,status:"deleted"}).filter(f=>f!==null);return{...l,[e]:u}}),undo:a=>t(l=>{const u=l[e].map(f=>f.key!==a||f.baseline==null?f:{...f,value:f.baseline,status:"unchanged"});return{...l,[e]:u}})}}function J$(e){return{promptAppend:e.payload.prompt.append,model:e.payload.model,mcp:mp(e.payload.mcpServers,"mcp"),env:mp(e.payload.env,"env"),git:mp(e.payload.gitRepos,"git")}}function W$(e){const[t,n]=x.useState(null);x.useEffect(()=>{e&&t===null&&n(J$(e))},[e,t]);const a=t??{promptAppend:"",model:"",mcp:[],env:[],git:[]},l=(e==null?void 0:e.payload.prompt.append)??"",o=(e==null?void 0:e.payload.model)??"",u=a.promptAppend!==l,f=a.model!==o,m=x.useMemo(()=>{const O=[],B=Z=>Z.reduce((te,q)=>q.status==="unchanged"?te:te+1,0),M=B(a.mcp),R=B(a.env),D=B(a.git);return u&&O.push("prompt"),f&&O.push("model"),M>0&&O.push("mcp"),R>0&&O.push("env"),D>0&&O.push("git"),{anyDirty:O.length>0,dirtySections:O,counts:{prompt:u?1:0,model:f?1:0,mcp:M,env:R,git:D}}},[a,u,f]),h=x.useCallback(O=>{n(B=>B&&O(B))},[]),g=x.useCallback(O=>h(B=>({...B,promptAppend:O})),[h]),y=x.useCallback(()=>h(O=>({...O,promptAppend:l})),[h,l]),b=x.useCallback(O=>h(B=>({...B,model:O})),[h]),S=x.useCallback(()=>h(O=>({...O,model:o})),[h,o]),k=x.useMemo(()=>pp("mcp",h),[h]),j=x.useMemo(()=>pp("env",h),[h]),E=x.useMemo(()=>pp("git",h),[h]),C=x.useCallback(()=>{n(null)},[]),T=x.useCallback(()=>{if(!t||!e)return{};const O={};u&&(O.prompt={append:t.promptAppend}),f&&(O.model=t.model);const B=m.counts.mcp>0,M=m.counts.env>0,R=m.counts.git>0;return B&&(O.mcpServers=t.mcp.filter(D=>D.status!=="deleted").map(D=>D.value)),M&&(O.env=t.env.filter(D=>D.status!=="deleted").map(D=>{const Z=D.value;return Z.sensitive&&Z.value===Md?{key:Z.key,value:Md,sensitive:!0}:Z})),R&&(O.gitRepos=t.git.filter(D=>D.status!=="deleted").map(D=>D.value)),O},[t,e,u,f,m]);return{draft:a,summary:m,promptDirty:u,modelDirty:f,setPromptAppend:g,revertPrompt:y,setModel:b,revertModel:S,addMcp:k.add,updateMcp:k.update,deleteMcp:k.remove,undoDeleteMcp:k.undo,addEnv:j.add,updateEnv:j.update,deleteEnv:j.remove,undoDeleteEnv:j.undo,addGit:E.add,updateGit:E.update,deleteGit:E.remove,undoDeleteGit:E.undo,resetAll:C,buildPayloadPatch:T}}const xn={overview:"ad-overview",setup:"ad-setup",prompt:lu("prompt"),tools:lu("mcp"),advanced:"ad-advanced",danger:"ad-danger"};function eF(e){const t=[{key:"overview",label:"Profile",anchor:xn.overview}];return e||t.push({key:"setup",label:"Setup",anchor:xn.setup},{key:"prompt",label:"Prompt",anchor:xn.prompt},{key:"tools",label:"Tools",anchor:xn.tools},{key:"advanced",label:"Advanced",anchor:xn.advanced}),t.push({key:"danger",label:"Danger zone",anchor:xn.danger,divider:!0,danger:!0}),t}function tF(){var Jt,Dt,un,dt,wr,An,Du,Ai,Ti,Ri,Rr,zi;const t=hA().uuid??"",n=Zr(),a=Fn(),l=Ve({queryKey:["agent",t],queryFn:()=>Wk(t),enabled:!!t}),o=Ve({queryKey:["agent-config",t],queryFn:()=>q6(t),enabled:!!t&&((Jt=l.data)==null?void 0:Jt.type)!=="human"}),u=Ve({queryKey:["agent-client-status",t],queryFn:()=>V6(t),enabled:!!t&&((Dt=l.data)==null?void 0:Dt.type)!=="human"}),f=Ve({queryKey:["agent-sessions-active",t],queryFn:()=>Hs(t,{state:"active"}),enabled:!!t&&((un=l.data)==null?void 0:un.type)!=="human"}),m=Ve({queryKey:["clients"],queryFn:cu,enabled:!!t&&((dt=l.data)==null?void 0:dt.type)!=="human",refetchInterval:3e4}),h=W$(o.data),[g,y]=x.useState(null),[b,S]=x.useState(null),[k,j]=x.useState(!1),E=wt({mutationFn:async()=>{if(!o.data)throw new Error("config not loaded");const ve=h.buildPayloadPatch();return H6(t,{expectedVersion:o.data.version,payload:ve})},onSuccess:ve=>{a.setQueryData(["agent-config",t],ve),y(null),S(null),j(!0)},onError:ve=>{if(j(!1),ve instanceof Vd&&ve.status===409){S("Someone else saved a newer version while you were editing."),y(null);return}y(ve instanceof Error?ve.message:String(ve))}});x.useEffect(()=>{if(!k)return;const ve=setTimeout(()=>j(!1),2500);return()=>clearTimeout(ve)},[k]),x.useEffect(()=>{h.summary.anyDirty&&j(!1)},[h.summary.anyDirty]);const C=x.useCallback(()=>{S(null),y(null),a.invalidateQueries({queryKey:["agent-config",t]}),h.resetAll()},[a,t,h]),T=x.useCallback(ve=>{const et=document.getElementById(ve);et&&et.scrollIntoView({behavior:"smooth",block:"start"})},[]),O=wt({mutationFn:ve=>s1(t,ve),onSuccess:()=>{a.invalidateQueries({queryKey:["agent",t]}),a.invalidateQueries({queryKey:["agents"]})}}),B=wt({mutationFn:()=>OM(t),onSuccess:()=>a.invalidateQueries({queryKey:["agent",t]})}),M=wt({mutationFn:()=>MM(t),onSuccess:()=>a.invalidateQueries({queryKey:["agent",t]})}),R=wt({mutationFn:()=>zM(t),onSuccess:()=>n("/agents")}),D=wt({mutationFn:()=>DM(t)}),[Z,te]=x.useState(!1),[q,oe]=x.useState(""),[W,me]=x.useState(null),de=Ve({queryKey:["clients"],queryFn:cu,enabled:Z}),ee=wt({mutationFn:ve=>s1(t,{clientId:ve}),onSuccess:()=>{a.invalidateQueries({queryKey:["agent",t]}),a.invalidateQueries({queryKey:["agent-client-status",t]}),a.invalidateQueries({queryKey:["agents"]}),te(!1),oe(""),me(null)},onError:ve=>me(ve instanceof Error?ve.message:String(ve))}),[H,re]=x.useState(!1),[K,he]=x.useState(null),A=wt({mutationFn:()=>Z6(t,h.buildPayloadPatch()),onSuccess:ve=>{const et=ve.diff.length?ve.diff.map(Tn=>`${Tn.op} ${Tn.path}`).join(`
361
+ `):"(no changes)";he(et)},onError:ve=>he(`Dry run failed: ${ve instanceof Error?ve.message:String(ve)}`)});x.useEffect(()=>{if(!h.summary.anyDirty)return;const ve=et=>{et.preventDefault(),et.returnValue=""};return window.addEventListener("beforeunload",ve),()=>window.removeEventListener("beforeunload",ve)},[h.summary.anyDirty]);const I=((wr=l.data)==null?void 0:wr.type)==="human",U=x.useMemo(()=>eF(I),[I]),_=x.useRef(null),[$,X]=x.useState(!1);x.useEffect(()=>{if(I)return;const ve=_.current;if(!ve||typeof IntersectionObserver>"u")return;const et=new IntersectionObserver(Tn=>{const kr=Tn[0];kr&&X(!kr.isIntersecting&&kr.boundingClientRect.top<0)},{threshold:0});return et.observe(ve),()=>et.disconnect()},[I]);const[ue,Se]=x.useState(xn.overview);x.useEffect(()=>{if(typeof IntersectionObserver>"u")return;const ve=[];for(const et of U){const Tn=document.getElementById(et.anchor);if(!Tn)continue;const kr=new IntersectionObserver(Aa=>{for(const hf of Aa)hf.isIntersecting&&Se(et.anchor)},{rootMargin:"0% 0% -70% 0%",threshold:0});kr.observe(Tn),ve.push(kr)}return()=>{for(const et of ve)et.disconnect()}},[U]);const De=x.useMemo(()=>{const ve=new Set;for(const et of h.summary.dirtySections)et==="prompt"&&ve.add(xn.prompt),et==="model"&&ve.add(xn.setup),et==="mcp"&&ve.add(xn.tools),(et==="env"||et==="git")&&ve.add(xn.advanced);return ve},[h.summary.dirtySections]);if(l.isLoading)return d.jsx("div",{className:"-m-6 flex",style:{minHeight:"100%"},children:d.jsx("div",{className:"p-6 text-body",style:{color:"var(--fg-3)"},children:"Loading…"})});if(l.error)return d.jsxs("div",{className:"-m-6 p-6 text-body",style:{color:"var(--state-error)"},children:["Failed to load agent: ",l.error instanceof Error?l.error.message:"Unknown error"]});const ge=l.data;if(!ge)return d.jsx("div",{className:"-m-6 p-6 text-body",style:{color:"var(--fg-3)"},children:"Agent not found"});const ut=ge.type==="human",ae=u.data,Oe=((An=f.data)==null?void 0:An.length)??0,at=!ut&&!(ae!=null&&ae.clientId),Pe=!ut&&ae?!ae.online&&!!ae.clientId:!1,Mt=ge,ln=Mt.runtimeState??null,Na=Mt.runtimeType??null,xl=Mt.totalSessions??null,Tr=ge.uuid.slice(0,8),_a=K$({activeSessions:Oe,isUnclaimed:at,isOffline:Pe}),_i=h.draft.mcp.filter(ve=>ve.status!=="deleted"),Gs=h.draft.env.filter(ve=>ve.status!=="deleted"),Ks=h.draft.git.filter(ve=>ve.status!=="deleted"),sn=ve=>new Set(_i.filter(et=>et.key!==ve).map(et=>et.value.name.toLowerCase())),Ys=ve=>new Set(Gs.filter(et=>et.key!==ve).map(et=>et.value.key)),ie=ve=>new Set(Ks.filter(et=>et.key!==ve).map(et=>{const{value:Tn}=et;return Tn.localPath?Tn.localPath:((Tn.url.split(/[?#]/)[0]??"").split(/[/:]/).filter(Boolean).pop()??"").replace(/\.git$/i,"")}).filter(Boolean)),ye={sessions:xl??"—",active:Oe,runtime:Na??(ut?"human":"—"),model:((Ai=(Du=o.data)==null?void 0:Du.payload.model)==null?void 0:Ai.trim())||"—"},Te=(ae==null?void 0:ae.clientId)??null,$e=Te?((Ti=m.data)==null?void 0:Ti.find(ve=>ve.id===Te))??null:null,lt=Te?($e==null?void 0:$e.hostname)??Te:null,on=Na==="kael"?"kael":"claude-code",Sr=on==="kael"?"Kael":on==="claude-code"?"Claude Code":Na??"—";return d.jsxs("div",{className:"-m-6 flex",style:{minHeight:"calc(100vh - var(--sp-10))"},children:[d.jsxs("aside",{className:"shrink-0 overflow-auto",style:{width:220,borderRight:"var(--hairline) solid var(--border)",background:"var(--bg-raised)",padding:"var(--sp-3) 0"},children:[d.jsx(lf,{style:{display:"block",padding:"var(--sp-1) var(--sp-4) var(--sp-2)"},children:"Agent"}),U.map(ve=>d.jsxs("div",{children:[ve.divider&&d.jsx("div",{"aria-hidden":!0,style:{margin:"var(--sp-2) var(--sp-3_5)",borderTop:"var(--hairline) solid var(--border)"}}),d.jsx(nF,{label:ve.label,active:ue===ve.anchor,danger:ve.danger??!1,dirty:De.has(ve.anchor),onClick:()=>T(ve.anchor)})]},ve.key))]}),d.jsxs("div",{className:"flex-1 min-w-0 overflow-auto",style:{background:"var(--bg)"},children:[d.jsxs("div",{style:{padding:"var(--sp-3_5) var(--sp-5)",borderBottom:"var(--hairline) solid var(--border-faint)",background:"var(--bg-raised)"},children:[d.jsxs(Q6,{style:{marginBottom:"var(--sp-2)"},children:[d.jsx(G6,{onClick:()=>n("/agents"),children:"Agents"}),d.jsx(K6,{}),d.jsx(Y6,{mono:!0,children:ge.name??Tr})]}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"inline-flex items-center justify-center",style:{width:36,height:36,borderRadius:"var(--radius-panel)",background:"var(--bg-active)",border:"var(--hairline) solid var(--border-strong)"},children:d.jsx(Tu,{width:18,height:20,style:{color:"var(--accent)"}})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("div",{className:"flex items-baseline gap-2",children:[d.jsx("span",{className:"text-title",title:`agt_${Tr}`,children:ge.displayName}),d.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:["@",ge.name??Tr]})]}),d.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 text-caption",style:{color:"var(--fg-4)"},children:[d.jsx(pn,{tone:ge.type==="autonomous_agent"?"accent":"neutral",children:ge.type}),ge.visibility&&d.jsx(pn,{tone:ge.visibility==="organization"?"accent":"outline",children:ge.visibility}),(ae==null?void 0:ae.offlineSince)&&d.jsxs("span",{className:"mono",children:["offline since ",bi(ae.offlineSince)]})]})]}),d.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[d.jsx(Is,{state:ln}),d.jsxs(be,{variant:"ghost",size:"xs",onClick:()=>n(`/?a=${ge.uuid}`),children:[d.jsx(Eg,{className:"h-3 w-3"})," Open chat"]}),!ut&&ge.status==="active"&&d.jsxs(be,{variant:"outline",size:"xs",onClick:()=>{D.reset(),D.mutate()},disabled:D.isPending,children:[d.jsx(Lw,{className:"h-3 w-3"}),D.isPending?"Testing…":"Test"]})]})]}),d.jsxs("div",{className:"grid gap-1.5 mt-3",style:{gridTemplateColumns:"repeat(4, 1fr)"},children:[d.jsx(od,{label:"sessions",value:ye.sessions}),d.jsx(od,{label:"active",value:ye.active,accent:typeof ye.active=="number"&&ye.active>0?"var(--accent)":void 0}),d.jsx(od,{label:"runtime",value:ye.runtime}),d.jsx(od,{label:"model",value:ye.model})]})]}),d.jsx("div",{ref:_,"aria-hidden":!0,style:{height:0}}),!ut&&d.jsx(J6,{runtimeLabel:Sr,computerLabel:lt,visible:$}),d.jsxs("div",{className:"mx-auto",style:{padding:"var(--sp-3_5) var(--sp-5) var(--sp-7)",maxWidth:960,display:"flex",flexDirection:"column",gap:20},children:[(D.data||D.error)&&d.jsx(oF,{result:D.data??{status:"error",message:"Failed to reach server"},onDismiss:()=>D.reset()}),d.jsx(Xo,{anchorId:xn.overview,title:"Profile",right:d.jsxs(be,{variant:"outline",size:"xs",onClick:()=>n(`/settings?agent=${ge.uuid}`),title:"Manage platform bindings in Settings",children:[d.jsx(Mw,{className:"h-3 w-3"}),"Manage bindings"]}),children:d.jsx(sI,{agent:ge,onSave:async ve=>{await O.mutateAsync(ve)}})}),!ut&&d.jsxs(d.Fragment,{children:[d.jsxs(Xo,{anchorId:xn.setup,title:"Setup",caption:((Ri=o.data)==null?void 0:Ri.version)!=null?d.jsxs("span",{className:"mono",children:["config v",o.data.version,h.summary.anyDirty&&d.jsxs(d.Fragment,{children:[" · ",d.jsx("span",{style:{color:"var(--state-blocked)"},children:"draft"})]})]}):null,children:[o.isLoading&&d.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Loading configuration…"}),o.error&&d.jsxs("div",{className:"text-body",style:{color:"var(--state-error)"},children:["Failed to load configuration: ",String(o.error)]}),o.data&&d.jsx(V$,{runtimeKind:on,computerLabel:lt,canBindComputer:at&&ge.status==="active",bindComputerPending:ee.isPending,onBindComputer:()=>te(!0),modelSlot:d.jsx(hI,{value:h.draft.model,baseline:((Rr=o.data)==null?void 0:Rr.payload.model)??"",onChange:h.setModel,onRevert:h.revertModel,disabled:ge.status!=="active"})})]}),d.jsx(Xo,{anchorId:xn.prompt,title:"Prompt",children:o.data?d.jsx(B$,{value:h.draft.promptAppend,baseline:((zi=o.data)==null?void 0:zi.payload.prompt.append)??"",onChange:h.setPromptAppend,onRevert:h.revertPrompt,disabled:ge.status!=="active"}):null}),d.jsx(Xo,{anchorId:xn.tools,title:"Tools",caption:"MCP servers available to this agent",children:o.data?d.jsx(cI,{items:h.draft.mcp,otherNames:sn,onAdd:h.addMcp,onUpdate:h.updateMcp,onDelete:h.deleteMcp,onUndoDelete:h.undoDeleteMcp,disabled:ge.status!=="active"}):null}),d.jsx(Xo,{anchorId:xn.advanced,title:"Advanced",caption:"Environment variables and git repositories the runtime clones into each session.",children:o.data&&d.jsxs("div",{className:"space-y-4",children:[d.jsx("div",{id:lu("env"),children:d.jsx(rI,{items:h.draft.env,otherKeys:Ys,onAdd:h.addEnv,onUpdate:h.updateEnv,onDelete:h.deleteEnv,onUndoDelete:h.undoDeleteEnv,disabled:ge.status!=="active"})}),d.jsx("div",{id:lu("git"),children:d.jsx(iI,{items:h.draft.git,otherPaths:ie,onAdd:h.addGit,onUpdate:h.updateGit,onDelete:h.deleteGit,onUndoDelete:h.undoDeleteGit,disabled:ge.status!=="active"})}),K&&d.jsx("pre",{className:"whitespace-pre-wrap mono text-label",style:{padding:"var(--sp-2)",borderRadius:"var(--radius-input)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)",color:"var(--fg-2)"},children:K}),h.summary.anyDirty&&d.jsx("div",{className:"text-label",style:{color:"var(--fg-3)"},children:d.jsx("button",{type:"button",onClick:()=>A.mutate(),className:"underline bg-transparent border-0 cursor-pointer",style:{color:"var(--fg-3)"},disabled:A.isPending,children:A.isPending?"Computing dry-run…":"Preview server-side diff"})})]})})]}),d.jsx(H$,{}),d.jsx(W6,{agent:ge,suspendPending:B.isPending,reactivatePending:M.isPending,deletePending:R.isPending,onSuspend:()=>B.mutate(),onReactivate:()=>M.mutate(),onDelete:()=>R.mutate()})]}),!ut&&d.jsx(q$,{summary:h.summary,saveHint:_a,conflictMessage:b,errorMessage:g,saving:E.isPending,justSaved:k,onSave:()=>E.mutate(),onDiscard:()=>{h.summary.anyDirty&&re(!0)},onReloadRemote:C,onJumpTo:ve=>T(lu(ve))})]}),d.jsx(rF,{open:H,onOpenChange:re,title:"Discard unsaved changes?",description:"Your edits to Prompt / Model / Tools / Advanced will be reverted to the last saved baseline.",confirmLabel:"Discard changes",destructive:!0,onConfirm:()=>{h.resetAll(),y(null),S(null),re(!1)}}),d.jsx(nn,{open:Z,onOpenChange:ve=>{te(ve),ve||(oe(""),me(null),ee.reset())},children:d.jsxs(Xt,{children:[d.jsx(gn,{children:d.jsx(an,{children:"Bind computer"})}),d.jsxs("div",{className:"space-y-4",children:[d.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Pick a computer you own to pin this agent to. The bind is one-shot — once set, moving the agent requires deleting and re-creating it on the target computer."}),de.isLoading?d.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Loading computers…"}):de.error?d.jsxs("div",{className:"text-body",style:{color:"var(--state-error)"},children:["Failed to load computers: ",de.error instanceof Error?de.error.message:"Unknown"]}):d.jsx(aF,{clients:de.data??[],selected:q,onSelect:oe}),W&&d.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:W})]}),d.jsxs(rn,{children:[d.jsx(be,{variant:"outline",onClick:()=>te(!1),children:"Cancel"}),d.jsx(be,{disabled:!q||ee.isPending,onClick:()=>{me(null),ee.mutate(q)},children:ee.isPending?"Binding…":"Bind"})]})]})})]})}function nF({label:e,active:t,danger:n,dirty:a,onClick:l}){return d.jsx("button",{type:"button",onClick:l,className:Ee("block w-full text-left bg-transparent text-body transition-colors cursor-pointer","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",t?"":"hover:bg-accent"),style:{padding:"var(--sp-1_25) var(--sp-4) var(--sp-1_25) var(--sp-3_5)",border:"none",borderLeft:`var(--hairline-bold) solid ${t?"var(--accent)":"transparent"}`,background:t?"var(--bg-active)":"transparent",color:t?"var(--fg)":"var(--fg-3)",fontWeight:t?500:400},children:d.jsxs("span",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"flex-1 truncate",children:e}),a&&d.jsx("span",{role:"img","aria-label":"unsaved changes",style:{width:"var(--sp-1_5)",height:"var(--sp-1_5)",borderRadius:"50%",background:"var(--state-blocked)",flexShrink:0}}),n&&!a&&d.jsx("span",{"aria-hidden":!0,style:{width:"var(--sp-1_5)",height:"var(--sp-1_5)",borderRadius:"50%",background:"var(--state-error)",flexShrink:0}})]})})}function rF(e){return d.jsx(nn,{open:e.open,onOpenChange:e.onOpenChange,children:d.jsxs(Xt,{children:[d.jsx(gn,{children:d.jsx(an,{children:e.title})}),d.jsx("div",{className:"space-y-3 text-body",style:{color:"var(--fg-2)"},children:e.description}),d.jsxs(rn,{children:[d.jsx(be,{type:"button",variant:"ghost",onClick:()=>e.onOpenChange(!1),disabled:e.pending,children:"Cancel"}),d.jsx(be,{type:"button",variant:e.destructive?"destructive":"default",onClick:e.onConfirm,disabled:e.pending,children:e.pending?"Working…":e.confirmLabel})]})]})})}function aF({clients:e,selected:t,onSelect:n}){const a=e.filter(l=>l.status==="connected");return a.length===0?d.jsxs("div",{className:"text-body",style:{background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)",borderRadius:"var(--radius-input)",padding:"var(--sp-2_5) var(--sp-3)",color:"var(--fg-3)"},children:["No connected computers available. Run"," ",d.jsx("code",{className:"mono text-label",children:"first-tree-hub client connect <url>"})," on the computer that should run this agent, then reopen this dialog."]}):d.jsx("ul",{className:"max-h-64 overflow-y-auto",style:{border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",margin:0,padding:0,listStyle:"none"},children:a.map(l=>{const o=l.id===t,u=l.status==="online"||l.status==="active";return d.jsx("li",{style:{borderTop:"var(--hairline) solid var(--border-faint)"},children:d.jsxs("button",{type:"button",onClick:()=>n(l.id),className:Ee("w-full text-left flex items-center gap-3"),style:{padding:"var(--sp-2) var(--sp-3)",background:o?"var(--accent-bg)":"transparent",border:"none",cursor:"pointer"},children:[d.jsx("span",{className:Ee("inline-block h-2 w-2 rounded-full shrink-0"),style:{background:u?"var(--state-idle)":"var(--fg-4)"},"aria-hidden":!0}),d.jsxs("span",{className:"flex-1 min-w-0",children:[d.jsx("span",{className:"block text-body truncate font-medium",children:l.hostname??l.id}),d.jsxs("span",{className:"block mono truncate text-caption",style:{color:"var(--fg-4)"},children:[l.id,l.os?` · ${l.os}`:"",l.sdkVersion?` · SDK ${l.sdkVersion}`:""]})]}),d.jsx("span",{className:"text-label",style:{color:"var(--fg-3)"},children:l.status})]})},l.id)})})}const iF={success:"Connected",timeout:"Timed out",offline:"Offline",stale:"Stale",error:"Error"},lF={success:"var(--state-idle)",timeout:"var(--state-blocked)",offline:"var(--state-offline)",stale:"var(--state-blocked)",error:"var(--state-error)"},sF={success:"accent",timeout:"warn",stale:"warn",error:"error",offline:"neutral"};function oF({result:e,onDismiss:t}){const n=lF[e.status],a=sF[e.status],l=e.connection;return d.jsx("div",{style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderLeft:`var(--sp-0_75) solid ${n}`,borderRadius:"var(--radius-panel)",padding:"var(--sp-3) var(--sp-3_5)"},children:d.jsxs("div",{className:"flex items-start justify-between gap-3",children:[d.jsxs("div",{className:"space-y-1.5",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(pn,{tone:a,children:iF[e.status]}),e.responseTime!=null&&d.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:[(e.responseTime/1e3).toFixed(1),"s"]})]}),e.message&&d.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:e.message}),l&&d.jsxs("div",{className:"text-label",style:{color:"var(--fg-3)",borderTop:"var(--hairline) solid var(--border-faint)",paddingTop:6,marginTop:2},children:[d.jsx("div",{children:l.runtimeState&&d.jsxs("span",{className:"mono",children:["runtime: ",l.runtimeState]})}),l.client?d.jsxs("div",{children:["Computer: ",l.client.hostname??l.client.id,l.client.os&&` (${l.client.os})`,l.client.sdkVersion&&` · SDK ${l.client.sdkVersion}`]}):d.jsx("div",{children:"No computer bound"}),l.lastSeenAt&&d.jsxs("div",{children:["Last seen: ",new Date(l.lastSeenAt).toLocaleString()]})]}),e.responseContent&&d.jsx("p",{className:"mono whitespace-pre-wrap text-label",style:{background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)",borderRadius:"var(--radius-input)",padding:8,maxHeight:160,overflow:"auto"},children:e.responseContent})]}),d.jsx(be,{variant:"ghost",size:"sm",onClick:t,children:"Dismiss"})]})})}function uF(e){return/^[A-Za-z0-9_./:=-]+$/.test(e)?e:`'${e.replace(/'/g,"'\\''")}'`}function cF({agent:e,open:t,onClose:n,onBound:a}){var y;const[l,o]=x.useState(!1),u=Ve({queryKey:["connect-token",e.uuid],queryFn:()=>Ww(),enabled:t,staleTime:6e4}),f=Ve({queryKey:["agent-poll",e.uuid],queryFn:()=>Wk(e.uuid),enabled:t&&!e.clientId,refetchInterval:2e3});x.useEffect(()=>{const b=f.data;b!=null&&b.clientId&&a(b)},[f.data,a]);const m=((y=u.data)==null?void 0:y.command)??"",h=m&&e.name?`npm install -g @agent-team-foundation/first-tree-hub && first-tree-hub agent add ${uF(e.name)} --agent-id ${e.uuid} && `+m:m;function g(){h&&(navigator.clipboard.writeText(h),o(!0),setTimeout(()=>o(!1),2e3))}return d.jsx(nn,{open:t,onOpenChange:b=>!b&&n(),children:d.jsxs(Xt,{className:"max-w-lg",children:[d.jsx(gn,{children:d.jsx(an,{children:"Last step — connect your computer"})}),d.jsxs("div",{className:"space-y-4",children:[d.jsx("p",{className:"text-body text-muted-foreground",children:"Open a terminal on your computer and run this command. It installs the First Tree Hub CLI, signs your computer in, and keeps it online in the background."}),d.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-border bg-muted p-3",children:[d.jsx("code",{className:"flex-1 text-caption font-mono break-all select-all",children:h||"Generating command…"}),d.jsx(be,{variant:"outline",size:"icon",className:"shrink-0",onClick:g,disabled:!h,children:l?d.jsx(Cu,{className:"h-4 w-4",style:{color:"var(--state-idle)"}}):d.jsx(Cg,{className:"h-4 w-4"})})]}),d.jsxs("div",{className:"flex items-center gap-2 text-body text-muted-foreground",children:[d.jsx(Hr,{state:"working",size:8}),d.jsx("span",{children:"Waiting for your computer to connect…"})]}),d.jsx("p",{className:"text-caption text-muted-foreground",children:"The command is good for 10 minutes. After it runs once, your computer stays online automatically — no need to keep this terminal open."})]}),d.jsx(rn,{children:d.jsx(be,{variant:"outline",onClick:n,children:"Skip for now"})})]})})}const gp=200;function dF(e){if(!e||e.length===0)return{};const t={},n=["name","displayName","clientId"];for(const a of e){const l=a.path[0];if(typeof l=="string"&&n.includes(l)){const o=l;t[o]||(t[o]=a.message)}else t._root=a.message}return t}function NS(e){return e.toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^[-_]+|[-_]+$/g,"").slice(0,gs)}function fF(e){return e.toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^[-_]+/,"").slice(0,gs)}function hF(e){switch(e){case"taken":return"That agent name is already in use in this organization. Pick a different one.";case"reserved":return"That agent name is reserved — pick a different one.";case"invalid":return"Agent name must start with a letter or digit and contain only lowercase letters, digits, hyphens (-), and underscores (_)."}}function mF({open:e,onOpenChange:t,onCreated:n}){const a=Fn(),[l,o]=x.useState(""),[u,f]=x.useState(""),[m,h]=x.useState(!1),[g,y]=x.useState("claude-code"),[b,S]=x.useState("form"),[k,j]=x.useState([]),[E,C]=x.useState(null),[T,O]=x.useState(!1),[B,M]=x.useState({}),[R,D]=x.useState({status:"idle"});x.useEffect(()=>{e&&(o(""),f(""),h(!1),y("claude-code"),S("form"),j([]),C(null),O(!1),M({}),D({status:"idle"}))},[e]),x.useEffect(()=>{m||f(NS(l))},[l,m]);const Z=x.useRef(0);x.useEffect(()=>{if(!e||!u){D({status:"idle"});return}if(!Qp.test(u)){D({status:"bad",reason:"invalid"});return}if(Gp(u)){D({status:"bad",reason:"reserved"});return}const K=++Z.current;D({status:"checking"});const he=window.setTimeout(()=>{RM(u).then(A=>{K===Z.current&&(A.available?D({status:"ok"}):D({status:"bad",reason:A.reason}))}).catch(()=>{K===Z.current&&D({status:"idle"})})},300);return()=>window.clearTimeout(he)},[u,e]);const te=wt({mutationFn:async K=>{const he=l.trim()||u.trim()||"Untitled assistant";return TM({name:u||void 0,type:"personal_assistant",displayName:he,clientId:K.clientId})},onSuccess:K=>{a.invalidateQueries({queryKey:["agents"]}),a.invalidateQueries({queryKey:["activity"]}),n(K,g)}}),q=x.useMemo(()=>{const K=te.error;if(!K)return{};if(K instanceof Vd){const he=dF(K.issues);return Object.keys(he).length>0?he:K.status===409?{name:"That agent name is already in use in this organization. Pick a different one."}:{_root:K.message}}return K instanceof Error?{_root:K.message}:{}},[te.error]),oe=R.status==="bad"?hF(R.reason):void 0,W={...oe?{name:oe}:{},...q,...B};function me(){const K={};return u?u.length>gs?K.name=`Agent name must be at most ${gs} characters (got ${u.length}).`:Qp.test(u)?Gp(u)&&(K.name="That agent name is reserved — pick a different one."):K.name="Agent name must start with a letter or digit and contain only lowercase letters, digits, hyphens (-), and underscores (_).":l.trim().length>0&&(K.name="Agent name must contain at least one letter or digit (e.g. a-z, 0-9)."),l.length>gp&&(K.displayName=`Display name must be at most ${gp} characters (got ${l.length}).`),K}async function de(K){var A,I;K.preventDefault();const he=me();if(M(he),!(Object.keys(he).length>0)&&R.status!=="bad"){if(g!=="claude-code"){te.mutate({clientId:void 0});return}O(!0);try{const _=(await cu()).filter(X=>X.status==="connected");if(_.length===0){te.mutate({clientId:void 0});return}if(_.length===1){te.mutate({clientId:(A=_[0])==null?void 0:A.id});return}const $=[..._].sort((X,ue)=>ue.lastSeenAt.localeCompare(X.lastSeenAt));j($),C(((I=$[0])==null?void 0:I.id)??null),S("pick-computer")}catch{te.mutate({clientId:void 0})}finally{O(!1)}}}function ee(){E&&te.mutate({clientId:E})}const H=R.status==="bad",re=l.trim().length>0&&!H&&!te.isPending&&!T;return b==="pick-computer"?d.jsx(nn,{open:e,onOpenChange:t,children:d.jsxs(Xt,{className:"max-w-lg",children:[d.jsx(gn,{children:d.jsx(an,{children:"Choose a computer"})}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("p",{className:"text-body text-muted-foreground",children:["Multiple computers are online. Pick where ",d.jsx("span",{className:"font-medium",children:l||u})," ","should run:"]}),d.jsx("div",{className:"space-y-2",children:k.map(K=>{const he=E===K.id;return d.jsxs("label",{className:he?"flex items-start gap-3 rounded-md border border-primary bg-primary/5 p-3 cursor-pointer":"flex items-start gap-3 rounded-md border border-border p-3 cursor-pointer hover:bg-accent/30",children:[d.jsx("input",{type:"radio",name:"target-computer",checked:he,onChange:()=>C(K.id),className:"mt-1"}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{className:"text-body font-medium truncate",children:K.hostname??K.id}),d.jsxs("div",{className:"text-caption text-muted-foreground",children:[K.os??"unknown OS"," · last seen ",new Date(K.lastSeenAt).toLocaleString()]})]})]},K.id)})}),W.clientId&&d.jsx("p",{className:"text-body text-destructive",children:W.clientId}),W._root&&d.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-body text-destructive",children:W._root})]}),d.jsxs(rn,{children:[d.jsx(be,{variant:"outline",onClick:()=>S("form"),disabled:te.isPending,children:"Back"}),d.jsx(be,{onClick:ee,disabled:!E||te.isPending,children:te.isPending?"Creating…":"Create"})]})]})}):d.jsx(nn,{open:e,onOpenChange:t,children:d.jsxs(Xt,{className:"max-w-lg",children:[d.jsx(gn,{children:d.jsx(an,{children:"New Agent"})}),d.jsxs("form",{onSubmit:de,className:"space-y-5",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"new-agent-display-name",children:"Display name"}),d.jsx(kt,{id:"new-agent-display-name",value:l,onChange:K=>{o(K.target.value),B.displayName&&M(he=>({...he,displayName:void 0}))},placeholder:"My Dev Assistant",autoFocus:!0,maxLength:gp,"aria-invalid":W.displayName?!0:void 0,"aria-describedby":"new-agent-display-name-help new-agent-display-name-error"}),d.jsx("p",{id:"new-agent-display-name-help",className:"text-caption text-muted-foreground",children:"How teammates see this agent in chats and lists. Can be changed anytime."}),W.displayName&&d.jsx("p",{id:"new-agent-display-name-error",className:"text-caption text-destructive",children:W.displayName})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"new-agent-name",children:"Agent name"}),d.jsxs("div",{className:"flex items-stretch",children:[d.jsx("span",{"aria-hidden":!0,className:"inline-flex items-center px-2 font-mono text-body text-muted-foreground border border-r-0 border-input rounded-l-[var(--radius-input)] bg-muted/40",children:"@"}),d.jsx(kt,{id:"new-agent-name",value:u,onChange:K=>{const he=fF(K.target.value);f(he),h(!0),B.name&&M(A=>({...A,name:void 0}))},onBlur:K=>{const he=NS(K.target.value);he!==u&&f(he)},placeholder:"my-dev-assistant",className:"rounded-l-none font-mono",maxLength:gs,"aria-invalid":W.name?!0:void 0,"aria-describedby":"new-agent-name-help new-agent-name-error new-agent-name-status"})]}),d.jsxs("p",{id:"new-agent-name-help",className:"text-caption text-muted-foreground",children:["Used in @mentions and CLI commands. Lowercase letters, digits, hyphens (-), and underscores (_). Up to"," ",gs," characters. Permanent after creation."]}),u&&!W.name&&R.status!=="idle"&&d.jsxs("p",{id:"new-agent-name-status",className:"text-caption",style:{color:R.status==="ok"?"var(--state-idle)":R.status==="checking"?"var(--fg-3)":"var(--fg-4)"},children:[R.status==="checking"&&"Checking availability…",R.status==="ok"&&"Available."]}),W.name&&d.jsx("p",{id:"new-agent-name-error",className:"text-caption text-destructive",children:W.name})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{children:"Where it runs"}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs("label",{className:g==="claude-code"?"flex items-start gap-3 rounded-md border border-primary bg-primary/5 p-3 cursor-pointer":"flex items-start gap-3 rounded-md border border-border p-3 cursor-pointer hover:bg-accent/30",children:[d.jsx("input",{type:"radio",name:"runtime",checked:g==="claude-code",onChange:()=>y("claude-code"),className:"mt-1"}),d.jsxs("div",{children:[d.jsx("div",{className:"text-body font-medium",children:"Claude Code"}),d.jsx("div",{className:"text-caption text-muted-foreground",children:"Runs on your computer, can access your local files. (default)"})]})]}),d.jsxs("label",{className:"flex items-start gap-3 rounded-md border border-border p-3 cursor-not-allowed opacity-60",title:"Coming soon",children:[d.jsx("input",{type:"radio",name:"runtime",disabled:!0,className:"mt-1"}),d.jsxs("div",{children:[d.jsxs("div",{className:"text-body font-medium",children:["Kael ",d.jsx("span",{className:"ml-1 text-caption font-normal text-muted-foreground",children:"— coming soon"})]}),d.jsx("div",{className:"text-caption text-muted-foreground",children:"Ready to go, runs in the cloud."})]})]})]})]}),W._root&&d.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-body text-destructive",children:W._root}),d.jsx(rn,{children:d.jsx(be,{type:"submit",disabled:!re,children:T?"Checking computers…":te.isPending?"Creating…":"Create"})})]})]})})}function tu({active:e,count:t,warn:n,className:a,children:l,style:o,...u}){return d.jsxs("button",{type:"button",className:Ee("mono inline-flex items-center gap-1 text-caption leading-[1.6]",a),style:{padding:"var(--sp-0_5) var(--sp-1_75)",borderRadius:3,border:`var(--hairline) solid ${e?"var(--border-strong)":"var(--border)"}`,background:e?"var(--bg-active)":"transparent",color:e?"var(--fg)":"var(--fg-3)",cursor:"pointer",...o},...u,children:[l,t!==void 0&&d.jsx("span",{className:"mono",style:{color:n&&typeof t=="number"&&t>0?"var(--state-error)":"var(--fg-4)"},children:t})]})}const pF=Object.values(ML);function _S(e){return[...e].sort((t,n)=>{const a=(t.displayName||t.name||"").toLowerCase(),l=(n.displayName||n.name||"").toLowerCase();return a.localeCompare(l)})}function gF(e,t){const n=t.get(e.uuid);return{runtimeState:(n==null?void 0:n.runtimeState)??null}}function cs(e,t,n){var l;let a=0;for(const o of e)((l=t.get(o.uuid))==null?void 0:l.runtimeState)===n&&a++;return a}function yF(){const e=Zr(),{memberId:t}=wa(),[n,a]=x.useState(),[l,o]=x.useState(""),[u,f]=x.useState(!1),[m,h]=x.useState(null),[g,y]=x.useState("all"),[b,S]=x.useState(""),k=yl(),j=Og(),E=Gg(),{data:C,isLoading:T,error:O}=Ve({queryKey:["agents",n,l],queryFn:()=>Au({limit:100,cursor:n,type:l||void 0})}),{data:B}=Ve({queryKey:["activity"],queryFn:Nu,refetchInterval:1e4}),M=x.useMemo(()=>{const K=new Map;for(const he of(B==null?void 0:B.agents)??[])K.set(he.agentId,he);return K},[B==null?void 0:B.agents]),{myAgents:R,teamAgents:D}=x.useMemo(()=>{if(!(C!=null&&C.items))return{myAgents:[],teamAgents:[]};const K=[],he=[];for(const A of C.items)t&&A.managerId===t?K.push(A):he.push(A);return{myAgents:_S(K),teamAgents:_S(he)}},[C,t]),Z=(C==null?void 0:C.items.length)??0,te=R.length,q=D.length,oe=x.useMemo(()=>((C==null?void 0:C.items)??[]).filter(K=>{var he;return((he=M.get(K.uuid))==null?void 0:he.runtimeState)==="working"}).length,[C==null?void 0:C.items,M]),W=x.useMemo(()=>((C==null?void 0:C.items)??[]).filter(K=>{var A;const he=(A=M.get(K.uuid))==null?void 0:A.runtimeState;return he==="blocked"||he==="error"}).length,[C==null?void 0:C.items,M]);function me(K){var A;const he=(A=M.get(K.uuid))==null?void 0:A.runtimeState;return g==="mine"?t!=null&&K.managerId===t:g==="running"?he==="working":g==="attn"?he==="blocked"||he==="error":!0}function de(K){if(!b.trim())return!0;const he=b.toLowerCase(),A=K.delegateMention?k(K.delegateMention):"",I=E(K.managerId);return(K.name??"").toLowerCase().includes(he)||K.displayName.toLowerCase().includes(he)||A.toLowerCase().includes(he)||I.toLowerCase().includes(he)}const ee=R.filter(K=>me(K)&&de(K)),H=D.filter(K=>me(K)&&de(K));function re(K,he){if(f(!1),K.clientId){e(`/?a=${K.uuid}`);return}if(he==="claude-code"){h(K);return}e(`/?a=${K.uuid}`)}return d.jsxs("div",{className:"-m-6",children:[d.jsx(af,{title:"Agents",subtitle:Z>0?d.jsxs(d.Fragment,{children:[Z," total · ",te," mine · ",q," team"]}):null,right:d.jsx("div",{className:"flex items-center gap-1.5",children:d.jsxs(be,{size:"xs",onClick:()=>f(!0),children:[d.jsx(vi,{className:"h-3 w-3"}),"New agent"]})})}),d.jsxs("div",{style:{padding:"var(--sp-3_5) var(--sp-5) var(--sp-7)"},children:[d.jsxs("div",{className:"flex items-center gap-2.5 mb-3.5",style:{padding:"var(--sp-2) var(--sp-2_5)",background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)"},children:[d.jsxs("div",{className:"relative",style:{width:240},children:[d.jsx(Qd,{className:"absolute pointer-events-none",style:{left:8,top:"50%",transform:"translateY(-50%)",color:"var(--fg-4)"},size:13}),d.jsx("input",{value:b,onChange:K=>S(K.target.value),placeholder:"Filter by name, delegate, owner…",className:"w-full outline-none text-body",style:{padding:"var(--sp-1_25) var(--sp-2_5) var(--sp-1_25) var(--sp-7)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",color:"var(--fg)"}})]}),d.jsxs("div",{className:"flex gap-1",children:[d.jsx(tu,{active:g==="all",count:Z,onClick:()=>y("all"),children:"all"}),d.jsx(tu,{active:g==="mine",count:te,onClick:()=>y("mine"),children:"mine"}),d.jsx(tu,{active:g==="running",count:oe,onClick:()=>y("running"),children:"running"}),d.jsx(tu,{active:g==="attn",count:W,warn:!0,onClick:()=>y("attn"),children:"attn"})]}),d.jsx("div",{style:{flex:1}}),d.jsxs("select",{value:l,onChange:K=>{o(K.target.value),a(void 0)},className:"outline-none text-label",style:{padding:"var(--sp-1_25) var(--sp-2_5)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",color:"var(--fg)"},children:[d.jsx("option",{value:"",children:"all types"}),pF.map(K=>d.jsx("option",{value:K,children:K},K))]})]}),T?d.jsx("div",{className:"text-center py-8",style:{color:"var(--fg-3)"},children:"Loading…"}):O?d.jsxs("div",{className:"text-center py-8",style:{color:"var(--state-error)"},children:["Failed to load agents: ",O instanceof Error?O.message:"Unknown error"]}):d.jsxs(d.Fragment,{children:[d.jsx(AS,{title:`My agents · ${ee.length}`,agents:ee,runtimeMap:M,resolveAgentIdentity:j,resolveMemberName:E,navigate:e,showOwner:!1,emptyLabel:R.length===0?"No agents yet — create one to get started":"No agents match the current filter",breakdown:d.jsx(TS,{items:[{state:"working",count:cs(R,M,"working")},{state:"blocked",count:cs(R,M,"blocked")},{state:"error",count:cs(R,M,"error")}]}),className:"mb-4"}),D.length>0&&d.jsx(AS,{title:`Team agents · ${H.length}`,agents:H,runtimeMap:M,resolveAgentIdentity:j,resolveMemberName:E,navigate:e,showOwner:!0,emptyLabel:"No agents match the current filter",breakdown:d.jsx(TS,{items:[{state:"working",count:cs(D,M,"working")},{state:"blocked",count:cs(D,M,"blocked")},{state:"error",count:cs(D,M,"error")}]})})]}),(C==null?void 0:C.nextCursor)&&d.jsx("div",{className:"flex justify-end mt-4",children:d.jsx(be,{variant:"outline",size:"xs",onClick:()=>a(C.nextCursor??void 0),children:"Next page"})})]}),d.jsx(mF,{open:u,onOpenChange:f,onCreated:re}),m&&d.jsx(cF,{agent:m,open:m!==null,onClose:()=>{const K=m.uuid;h(null),e(`/?a=${K}`)},onBound:K=>{h(null),e(`/?a=${K.uuid}`)}})]})}function AS({title:e,agents:t,runtimeMap:n,resolveAgentIdentity:a,resolveMemberName:l,navigate:o,emptyLabel:u,breakdown:f,className:m,showOwner:h}){return d.jsxs(yn,{className:m,children:[d.jsx(Ls,{right:f,children:e}),t.length===0?d.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:u}):d.jsxs(dl,{children:[d.jsx(fl,{children:d.jsxs(tr,{children:[d.jsx(Ue,{children:"Display name"}),d.jsx(Ue,{children:"Agent name"}),d.jsx(Ue,{children:"Type"}),d.jsx(Ue,{children:"Delegate"}),h&&d.jsx(Ue,{children:"Owner"}),d.jsx(Ue,{children:"Runtime"}),d.jsx(Ue,{children:"Status"}),d.jsx(Ue,{children:"Created"})]})}),d.jsx(hl,{children:t.map(g=>d.jsx(vF,{agent:g,runtime:gF(g,n),resolveAgentIdentity:a,resolveMemberName:l,navigate:o,showOwner:h},g.uuid))})]})]})}function TS({items:e}){const t=e.filter(n=>n.count>0);return t.length===0?null:d.jsx("span",{className:"inline-flex items-center",children:t.map((n,a)=>d.jsxs("span",{className:"inline-flex items-center",children:[a>0&&d.jsx("span",{style:{color:"var(--fg-4)",margin:"0 var(--sp-1_5)"},"aria-hidden":!0,children:"·"}),d.jsxs("span",{className:"mono inline-flex items-center gap-1 text-caption",style:{color:`var(--state-${n.state})`},children:[d.jsx("span",{"aria-hidden":!0,children:"●"}),n.count," ",n.label??n.state]})]},n.state))})}function vF({agent:e,runtime:t,resolveAgentIdentity:n,resolveMemberName:a,navigate:l,showOwner:o}){const{runtimeState:u}=t,f=u==="idle"||u==="working"||u==="blocked"||u==="error"||u==="offline",m=e.delegateMention?n(e.delegateMention):null;return d.jsxs(tr,{interactive:!0,onClick:()=>l(`/agents/${e.uuid}`),children:[d.jsx(Le,{children:d.jsx("span",{className:"font-medium",children:e.displayName})}),d.jsx(Le,{children:e.name?d.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-3)"},children:["@",e.name]}):d.jsx("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:"—"})}),d.jsx(Le,{children:d.jsx(pn,{tone:e.type==="autonomous_agent"?"accent":"neutral",children:e.type})}),d.jsx(Le,{children:e.delegateMention?d.jsx(aC,{name:(m==null?void 0:m.name)??null,displayName:(m==null?void 0:m.displayName)??null,tone:"accent"}):d.jsx("span",{style:{color:"var(--fg-4)"},children:"—"})}),o&&d.jsx(Le,{className:"text-label",style:{color:"var(--fg-2)"},children:a(e.managerId)}),d.jsx(Le,{children:u&&f?d.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[d.jsx(Hr,{state:u,size:7}),d.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-3)"},children:u})]}):d.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:"—"})}),d.jsx(Le,{children:d.jsx(pn,{tone:e.status==="active"?"accent":"outline",children:e.status})}),d.jsx(Le,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:bi(e.createdAt)})]})}function bF(){const{data:e}=Ve({queryKey:["members","user-name-map"],queryFn:Qg,staleTime:3e4});return x.useMemo(()=>{const t=new Map;if(e)for(const n of e)t.set(n.userId,n.displayName||n.username);return n=>n?t.get(n)??n:"—"},[e])}function xF(){const[e,t]=x.useState(null),[n,a]=x.useState(!1),l=wt({mutationFn:Ww,onSuccess:u=>{t(u),a(!1)}}),o=async()=>{e&&(await navigator.clipboard.writeText(e.command),a(!0),setTimeout(()=>a(!1),2e3))};return d.jsxs("div",{className:"grid items-center gap-2.5 mb-3.5",style:{gridTemplateColumns:"auto 1fr auto auto",padding:"var(--sp-2) var(--sp-3)",background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)"},children:[d.jsxs("span",{className:"inline-flex items-center gap-2 text-body",style:{color:"var(--fg-2)"},children:[d.jsx(aR,{className:"h-3.5 w-3.5"}),"Connect a computer"]}),e?d.jsxs("code",{className:"mono whitespace-nowrap overflow-hidden text-ellipsis text-label",style:{padding:"var(--sp-1_25) var(--sp-2_5)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)",borderRadius:"var(--radius-input)",color:"var(--fg-2)"},title:e.command,children:[e.command," ",d.jsxs("span",{style:{color:"var(--fg-4)"},children:["# expires in ",Math.round(e.expiresIn/60),"m"]})]}):d.jsx("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:"Generate a single-use command to pair a new machine with this Hub."}),d.jsxs(be,{variant:"outline",size:"xs",onClick:o,disabled:!e,children:[n?d.jsx(Cu,{className:"h-3 w-3"}):d.jsx(Cg,{className:"h-3 w-3"}),n?"Copied":"Copy"]}),d.jsx(be,{variant:"outline",size:"xs",onClick:()=>l.mutate(),disabled:l.isPending,children:l.isPending?"Generating…":e?"Regenerate":"Generate"})]})}function SF(){const e=Fn(),t=yl(),n=bF(),{role:a}=wa(),l=a==="admin",[o,u]=x.useState(null),[f,m]=x.useState(null),[h,g]=x.useState(null),[y,b]=x.useState(null),{data:S}=Ve({queryKey:["clients"],queryFn:cu,refetchInterval:1e4}),{data:k}=Ve({queryKey:["activity"],queryFn:Nu,refetchInterval:1e4}),j=wt({mutationFn:rz,onSuccess:()=>{m(null),e.invalidateQueries({queryKey:["clients"]}),e.invalidateQueries({queryKey:["activity"]})}}),E=wt({mutationFn:nz,onSuccess:()=>{g(null),b(null),e.invalidateQueries({queryKey:["clients"]}),e.invalidateQueries({queryKey:["activity"]})},onError:M=>{M instanceof Vd?b(M.message):b(M instanceof Error?M.message:String(M))}}),C=x.useMemo(()=>{const M=new Map;for(const R of(k==null?void 0:k.agents)??[]){if(!R.clientId)continue;const D=M.get(R.clientId)??[];D.push(R),M.set(R.clientId,D)}return M},[k==null?void 0:k.agents]),T=M=>C.get(M)??[],O=(S??[]).filter(M=>M.status==="connected").length,B=(S??[]).reduce((M,R)=>M+R.agentCount,0);return d.jsxs("div",{className:"-m-6",children:[d.jsx(af,{title:"Computers",subtitle:S&&S.length>0?d.jsxs(d.Fragment,{children:[S.length," total · ",O," connected · ",B," agents bound"]}):null}),d.jsxs("div",{style:{padding:"var(--sp-3_5) var(--sp-5) var(--sp-7)"},children:[d.jsx(xF,{}),h&&d.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-overlay-scrim",children:d.jsxs("div",{className:"max-w-md w-full",style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)",padding:24,boxShadow:"var(--shadow-md)"},children:[d.jsx("h3",{className:"text-subtitle mb-2",children:"Retire Computer"}),d.jsxs("p",{className:"text-body mb-3",style:{color:"var(--fg-3)"},children:["Permanently remove"," ",d.jsx("span",{className:"font-medium",style:{color:"var(--fg)"},children:h.hostname??h.id.slice(0,8)}),". Retire refuses if any agent is still pinned to this computer — you must delete those agents first (reassign is not available in this milestone)."]}),T(h.id).length>0&&d.jsxs("div",{className:"mb-3 p-2 rounded",style:{background:"color-mix(in oklch, var(--state-blocked) 12%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-blocked) 28%, transparent)"},children:[d.jsx("div",{className:"text-label mb-1",children:"Agents currently bound to this computer (delete them first):"}),d.jsx("ul",{className:"text-body space-y-0.5",children:T(h.id).map(M=>d.jsx("li",{className:"font-medium",children:t(M.agentId)},M.agentId))})]}),y&&d.jsx("div",{className:"mb-3 p-2 rounded text-body",style:{background:"color-mix(in oklch, var(--state-error) 12%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-error) 28%, transparent)",color:"var(--state-error)"},children:y}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(be,{variant:"outline",size:"sm",onClick:()=>{g(null),b(null)},children:"Cancel"}),d.jsx(be,{variant:"destructive",size:"sm",onClick:()=>E.mutate(h.id),disabled:E.isPending,children:E.isPending?"Retiring…":"Retire"})]})]})}),f&&d.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-overlay-scrim",children:d.jsxs("div",{className:"max-w-md w-full",style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)",padding:24,boxShadow:"var(--shadow-md)"},children:[d.jsx("h3",{className:"text-subtitle mb-2",children:"Disconnect Computer"}),d.jsxs("p",{className:"text-body mb-3",style:{color:"var(--fg-3)"},children:["This will disconnect"," ",d.jsx("span",{className:"font-medium",style:{color:"var(--fg)"},children:f.hostname??f.id.slice(0,8)})," ","and affect all bound agents:"]}),d.jsx("ul",{className:"mb-4 space-y-1",children:T(f.id).length===0?d.jsx("li",{className:"text-body",style:{color:"var(--fg-3)"},children:"No bound agents"}):T(f.id).map(M=>d.jsxs("li",{className:"text-body flex items-center gap-2",children:[d.jsx("span",{className:"font-medium",children:t(M.agentId)}),d.jsx(Is,{state:M.runtimeState})]},M.agentId))}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(be,{variant:"outline",size:"sm",onClick:()=>m(null),children:"Cancel"}),d.jsx(be,{variant:"destructive",size:"sm",onClick:()=>j.mutate(f.id),disabled:j.isPending,children:j.isPending?"Disconnecting…":"Disconnect"})]})]})}),!S||S.length===0?d.jsx(yn,{children:d.jsx("div",{className:"text-center py-10 text-body",style:{color:"var(--fg-3)"},children:"No computers. Use the button above to generate a connect command."})}):d.jsxs(yn,{children:[d.jsxs(Ls,{right:d.jsx("span",{className:"mono text-caption normal-case tracking-normal",style:{color:"var(--fg-3)"},children:"click a row to expand"}),children:["Registered · ",S.length]}),d.jsxs(dl,{children:[d.jsx(fl,{children:d.jsxs(tr,{children:[d.jsx(Ue,{style:{width:16}}),d.jsx(Ue,{children:"Hostname"}),l&&d.jsx(Ue,{children:"Owner"}),d.jsx(Ue,{children:"OS"}),d.jsx(Ue,{children:"SDK"}),d.jsx(Ue,{children:"Agents"}),d.jsx(Ue,{children:"Connected"}),d.jsx(Ue,{children:"Status"}),d.jsx(Ue,{})]})}),d.jsx(hl,{children:S.map(M=>{const R=o===M.id,D=T(M.id);return d.jsx(wF,{client:M,boundAgents:D,isExpanded:R,agentName:t,showOwner:l,ownerName:n,onToggle:()=>u(R?null:M.id),onDisconnect:()=>m(M),onRetire:()=>{b(null),g(M)}},M.id)})})]})]})]})]})}function wF({client:e,boundAgents:t,isExpanded:n,agentName:a,showOwner:l,ownerName:o,onToggle:u,onDisconnect:f,onRetire:m}){const h=l?9:8,g=e.status==="connected"?"idle":"offline";return d.jsxs(d.Fragment,{children:[d.jsxs(tr,{interactive:!0,selected:n,onClick:u,children:[d.jsx(Le,{style:{width:16},children:d.jsx("span",{style:{color:"var(--fg-4)",display:"inline-flex"},children:n?d.jsx(jT,{className:"h-3.5 w-3.5"}):d.jsx(ET,{className:"h-3.5 w-3.5"})})}),d.jsx(Le,{className:"font-medium",children:e.hostname??"—"}),l&&d.jsx(Le,{style:{color:"var(--fg-2)"},children:o(e.userId)}),d.jsx(Le,{style:{color:"var(--fg-3)"},children:e.os??"—"}),d.jsx(Le,{className:"mono text-label",style:{color:"var(--fg-3)"},children:e.sdkVersion??"—"}),d.jsx(Le,{children:d.jsx("span",{className:"mono tnum text-label",children:e.agentCount})}),d.jsx(Le,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:e.connectedAt?bi(e.connectedAt):"—"}),d.jsx(Le,{children:d.jsx(Is,{state:g})}),d.jsx(Le,{style:{width:1,whiteSpace:"nowrap"},children:d.jsxs("div",{className:"flex gap-1 justify-end",children:[d.jsxs(be,{variant:"ghost",size:"xs",className:"text-label",onClick:y=>{y.stopPropagation(),f()},children:[d.jsx(dR,{className:"h-3 w-3"})," Disconnect"]}),d.jsxs(be,{variant:"ghost",size:"xs",className:"text-label",style:{color:"var(--fg-4)"},onClick:y=>{y.stopPropagation(),m()},children:[d.jsx(Os,{className:"h-3 w-3"})," Retire"]})]})})]}),n&&d.jsxs("tr",{style:{background:"var(--bg-sunken)"},children:[d.jsx(Le,{}),d.jsxs(Le,{colSpan:h-1,style:{padding:"var(--sp-2_5) var(--sp-3) var(--sp-3_5)"},children:[d.jsxs(lf,{style:{display:"block",marginBottom:6},children:["Bound agents · ",t.length]}),t.length===0?d.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"No agents bound to this computer"}):d.jsx("div",{className:"flex flex-col gap-1",children:t.map(y=>d.jsxs("div",{className:"flex items-center gap-2.5 text-body",children:[d.jsx("span",{className:"mono font-medium",style:{minWidth:180},children:a(y.agentId)}),d.jsx(Is,{state:y.runtimeState}),y.activeSessions!==null&&d.jsxs("span",{className:"mono tnum text-caption",style:{color:"var(--fg-3)"},children:[y.activeSessions," / ",y.totalSessions??0," sessions"]})]},y.agentId))})]})]})]})}const dE=x.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:Ee("rounded-[var(--radius-panel)] border bg-card text-card-foreground shadow-sm",e),...t}));dE.displayName="Card";const fE=x.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:Ee("flex flex-col space-y-1.5 p-6",e),...t}));fE.displayName="CardHeader";const hE=x.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:Ee("text-subtitle leading-none",e),...t}));hE.displayName="CardTitle";const mE=x.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:Ee("text-body text-muted-foreground",e),...t}));mE.displayName="CardDescription";const pE=x.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:Ee("p-6 pt-0",e),...t}));pE.displayName="CardContent";const kF=x.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:Ee("flex items-center p-6 pt-0",e),...t}));kF.displayName="CardFooter";function jF(){const{isAuthenticated:e,login:t}=wa(),[n,a]=x.useState(""),[l,o]=x.useState(""),[u,f]=x.useState(null),[m,h]=x.useState(!1);if(e)return d.jsx(xg,{to:"/",replace:!0});const g=async y=>{y.preventDefault(),f(null),h(!0);try{await t(n,l)}catch(b){f(b instanceof Error?b.message:"Login failed")}finally{h(!1)}};return d.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:d.jsxs(dE,{className:"w-full max-w-sm",children:[d.jsxs(fE,{className:"text-center",children:[d.jsx(hE,{className:"text-title",children:"First Tree"}),d.jsx(mE,{children:"Sign in to your workspace"})]}),d.jsx(pE,{children:d.jsxs("form",{onSubmit:g,className:"space-y-4",children:[u&&d.jsx("div",{className:"rounded-md bg-destructive/10 p-3 text-body text-destructive",children:u}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"username",children:"Username"}),d.jsx(kt,{id:"username",value:n,onChange:y=>a(y.target.value),required:!0,autoFocus:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"password",children:"Password"}),d.jsx(kt,{id:"password",type:"password",value:l,onChange:y=>o(y.target.value),required:!0})]}),d.jsx(be,{type:"submit",className:"w-full",disabled:m,children:m?"Signing in...":"Sign in"})]})})]})})}function CF(){return Me.get("/admin/adapter-mappings")}function EF(e){return Me.post("/admin/adapter-mappings",e)}function NF(e){return Me.delete(`/admin/adapter-mappings/${e}`)}function _F(){return Me.get("/admin/adapters/status")}function AF(){return Me.get("/admin/adapters")}function TF(e){return Me.post("/admin/adapters",e)}function RF(e,t){return Me.patch(`/admin/adapters/${e}`,t)}function zF(e){return Me.delete(`/admin/adapters/${e}`)}const OF=Object.values(RL),RS={platform:"feishu",feishuAppId:"",feishuAppSecret:"",credentialsJson:"{}",status:"active",externalUserId:"",displayName:"",kaelUserId:"",kaelProjectId:""};function zS(e){const[t,n]=x.useState(RS),[a,l]=x.useState("");x.useEffect(()=>{e.open&&(n({...RS,platform:e.initialPlatform??"feishu",status:e.initialStatus??"active"}),l(""))},[e.open,e.initialPlatform,e.initialStatus]);function o(f){if(f.preventDefault(),l(""),e.kind==="user"){if(!t.externalUserId)return;e.onSubmit({kind:"user-create",draft:{platform:t.platform,externalUserId:t.externalUserId,displayName:t.displayName||null}});return}if(t.platform==="feishu"){if(!e.editingId&&(!t.feishuAppId||!t.feishuAppSecret)){l("App ID and App Secret are required");return}}else if(t.platform==="kael"){if(!e.editingId&&(!t.kaelUserId||!t.kaelProjectId)){l("User ID and Project ID are required");return}}else{const h=t.credentialsJson.trim();if(!e.editingId&&!h){l("Credentials are required");return}if(h)try{JSON.parse(h)}catch{l("Invalid JSON");return}}const m=MF(t);if(!e.editingId&&!m){l("Credentials are required");return}if(e.editingId)e.onSubmit({kind:"bot-update",status:t.status,...m?{credentials:m}:{}});else{if(!m)return;e.onSubmit({kind:"bot-create",draft:{platform:t.platform,status:t.status,credentials:m}})}}const u=e.kind==="user"?`Bind external user → ${e.agentLabel}`:e.editingId?`Edit bot binding · ${e.agentLabel}`:`Bind bot → ${e.agentLabel}`;return d.jsx(nn,{open:e.open,onOpenChange:e.onOpenChange,children:d.jsxs(Xt,{children:[d.jsx(gn,{children:d.jsx(an,{children:u})}),d.jsxs("form",{onSubmit:o,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"binding-platform",children:"Platform"}),d.jsx("select",{id:"binding-platform",value:t.platform,onChange:f=>n({...t,platform:f.target.value}),disabled:!!e.editingId,className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50",children:OF.map(f=>d.jsx("option",{value:f,children:f},f))})]}),e.kind==="user"?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"binding-ext-id",children:"External user ID"}),d.jsx(kt,{id:"binding-ext-id",value:t.externalUserId,onChange:f=>n({...t,externalUserId:f.target.value}),placeholder:"ou_xxxxxxxx...",className:"font-mono",required:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"binding-name",children:"Display name (optional)"}),d.jsx(kt,{id:"binding-name",value:t.displayName,onChange:f=>n({...t,displayName:f.target.value})})]})]}):d.jsxs(d.Fragment,{children:[t.platform==="feishu"?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"space-y-2",children:[d.jsxs(rt,{htmlFor:"feishu-app-id",children:["App ID",e.editingId?" — leave empty to keep existing":""]}),d.jsx(kt,{id:"feishu-app-id",value:t.feishuAppId,onChange:f=>n({...t,feishuAppId:f.target.value}),placeholder:"cli_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs(rt,{htmlFor:"feishu-app-secret",children:["App Secret",e.editingId?" — leave empty to keep existing":""]}),d.jsx(kt,{id:"feishu-app-secret",type:"password",autoComplete:"new-password",value:t.feishuAppSecret,onChange:f=>n({...t,feishuAppSecret:f.target.value}),placeholder:"••••••••"})]})]}):t.platform==="kael"?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"space-y-2",children:[d.jsxs(rt,{htmlFor:"kael-user-id",children:["User ID",e.editingId?" — leave empty to keep existing":""]}),d.jsx(kt,{id:"kael-user-id",value:t.kaelUserId,onChange:f=>n({...t,kaelUserId:f.target.value}),placeholder:"user_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs(rt,{htmlFor:"kael-project-id",children:["Project ID",e.editingId?" — leave empty to keep existing":""]}),d.jsx(kt,{id:"kael-project-id",value:t.kaelProjectId,onChange:f=>n({...t,kaelProjectId:f.target.value}),placeholder:"proj_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),!e.editingId&&d.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Agent Token will be created automatically when you save."})]}):d.jsxs("div",{className:"space-y-2",children:[d.jsxs(rt,{htmlFor:"binding-creds",children:["Credentials (JSON)",e.editingId?" — leave empty to keep existing":""]}),d.jsx("textarea",{id:"binding-creds",value:t.credentialsJson,onChange:f=>n({...t,credentialsJson:f.target.value}),rows:4,className:"flex w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-2 text-body shadow-sm font-mono focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",placeholder:'{"bot_token": "xoxb-...", "signing_secret": "..."}'})]}),a&&d.jsx("p",{className:"text-body",style:{color:"var(--state-error)"},children:a}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"binding-status",children:"Status"}),d.jsxs("select",{id:"binding-status",value:t.status,onChange:f=>n({...t,status:f.target.value}),className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[d.jsx("option",{value:"active",children:"active"}),d.jsx("option",{value:"inactive",children:"inactive"})]})]})]}),e.errorMessage&&d.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:e.errorMessage}),d.jsxs(rn,{children:[d.jsx(be,{type:"button",variant:"ghost",onClick:()=>e.onOpenChange(!1),disabled:e.pending,children:"Cancel"}),d.jsx(be,{type:"submit",disabled:e.pending,children:e.pending?"Saving…":e.editingId?"Update":"Create"})]})]})]})})}function MF(e){if(e.platform==="feishu")return!e.feishuAppId&&!e.feishuAppSecret||!e.feishuAppId||!e.feishuAppSecret?null:{app_id:e.feishuAppId,app_secret:e.feishuAppSecret};if(e.platform==="kael")return!e.kaelUserId&&!e.kaelProjectId||!e.kaelUserId||!e.kaelProjectId?null:{kaelUserId:e.kaelUserId,kaelProjectId:e.kaelProjectId};const t=e.credentialsJson.trim();return t?JSON.parse(t):null}function DF(){var _;const e=Zr(),t=Fn(),[n,a]=Zd(),l=n.get("agent"),o=yl(),u=Ve({queryKey:["adapters"],queryFn:AF}),f=Ve({queryKey:["adapter-mappings"],queryFn:CF}),m=Ve({queryKey:["adapter-statuses"],queryFn:_F,refetchInterval:15e3}),g=((_=Ve({queryKey:["agents","name-map"],queryFn:()=>Au({limit:100}),staleTime:3e4}).data)==null?void 0:_.items)??[],y=x.useMemo(()=>{const $=new Map;for(const X of m.data??[])$.set(X.configId,X);return $},[m.data]),b=x.useMemo(()=>{const $=u.data??[];return l?$.filter(X=>X.agentId===l):$},[u.data,l]),S=x.useMemo(()=>{const $=f.data??[];return l?$.filter(X=>X.agentId===l):$},[f.data,l]),k=b.reduce(($,X)=>{var ue;return $+((ue=y.get(X.id))!=null&&ue.connected?1:0)},0),j=b.length-k,E=u.isLoading||f.isLoading,[C,T]=x.useState(null),[O,B]=x.useState(""),[M,R]=x.useState(null),[D,Z]=x.useState(null),[te,q]=x.useState(null),[oe,W]=x.useState(null),me=wt({mutationFn:$=>TF({platform:$.platform,agentId:$.agentId,credentials:$.credentials,status:$.status}),onSuccess:()=>{t.invalidateQueries({queryKey:["adapters"]}),R(null)}}),de=wt({mutationFn:$=>{const X={status:$.status};return $.credentials&&(X.credentials=$.credentials),RF($.id,X)},onSuccess:()=>{t.invalidateQueries({queryKey:["adapters"]}),R(null)}}),ee=wt({mutationFn:zF,onSuccess:()=>t.invalidateQueries({queryKey:["adapters"]})}),H=wt({mutationFn:$=>EF({platform:$.platform,externalUserId:$.externalUserId,agentId:$.agentId,boundVia:"manual",displayName:$.displayName??void 0}),onSuccess:()=>{t.invalidateQueries({queryKey:["adapter-mappings"]}),Z(null)}}),re=wt({mutationFn:NF,onSuccess:()=>t.invalidateQueries({queryKey:["adapter-mappings"]})});function K($){if(l){$==="bot"?R({agentId:l,editingId:null}):Z({agentId:l});return}B(""),T({kind:$})}function he(){!C||!O||(C.kind==="bot"?R({agentId:O,editingId:null}):Z({agentId:O}),T(null))}function A($){if(M){if($.kind==="bot-create")me.mutate({agentId:M.agentId,platform:$.draft.platform,status:$.draft.status,credentials:$.draft.credentials});else if($.kind==="bot-update"){if(!M.editingId)return;de.mutate({id:M.editingId,status:$.status,credentials:$.credentials})}}}function I($){!D||$.kind!=="user-create"||H.mutate({agentId:D.agentId,platform:$.draft.platform,externalUserId:$.draft.externalUserId,displayName:$.draft.displayName})}const U=l?g.find($=>$.uuid===l):null;return d.jsxs(d.Fragment,{children:[d.jsx("p",{className:"text-label",style:{color:"var(--fg-3)",padding:"0 var(--sp-0_5) var(--sp-3)"},children:"Manage how external platforms (Feishu, Slack, Kael) reach your agents. Bot bindings hold encrypted credentials; user bindings map an external user to a human agent in this organization."}),l&&d.jsxs("div",{className:"flex items-center gap-2",style:{padding:"0 var(--sp-0_5) var(--sp-3)"},children:[d.jsx("span",{className:"text-caption",style:{color:"var(--fg-3)"},children:"Filtered to"}),d.jsxs("span",{className:"inline-flex items-center gap-1.5 mono text-caption",style:{padding:"var(--sp-0_5) var(--sp-2)",borderRadius:"var(--radius-chip)",background:"var(--bg-active)",border:"var(--hairline) solid var(--border)"},children:[(U==null?void 0:U.displayName)??l,d.jsx("button",{type:"button",onClick:()=>{const $=new URLSearchParams(n);$.delete("agent"),a($,{replace:!0})},"aria-label":"Clear filter",className:"inline-flex items-center justify-center hover:bg-accent rounded-full",style:{width:14,height:14,border:"none",background:"transparent",cursor:"pointer"},children:d.jsx(Nd,{className:"h-3 w-3"})})]})]}),d.jsxs(yn,{className:"mb-3.5",children:[d.jsxs(Ls,{right:d.jsxs("span",{className:"inline-flex items-center gap-2",children:[d.jsxs("span",{className:"inline-flex items-center gap-3 text-caption",children:[d.jsxs("span",{className:"mono inline-flex items-center gap-1",style:{color:"var(--state-idle)"},children:[d.jsx(Hr,{state:"idle",size:6})," ",k," online"]}),d.jsxs("span",{className:"mono inline-flex items-center gap-1",style:{color:"var(--fg-4)"},children:[d.jsx(Hr,{state:"offline",size:6})," ",j," offline"]})]}),d.jsxs(be,{size:"xs",variant:"outline",onClick:()=>K("bot"),children:[d.jsx(vi,{className:"h-3 w-3"})," Bot binding"]})]}),children:["Bot bindings · ",b.length]}),E?d.jsx(hd,{children:"Loading…"}):b.length?d.jsxs(dl,{children:[d.jsx(fl,{children:d.jsxs(tr,{children:[d.jsx(Ue,{children:"Agent"}),d.jsx(Ue,{children:"Platform"}),d.jsx(Ue,{children:"Status"}),d.jsx(Ue,{children:"Connection"}),d.jsx(Ue,{children:"Created"}),d.jsx(Ue,{style:{width:96,textAlign:"right"}})]})}),d.jsx(hl,{children:b.map($=>{var ue;const X=((ue=y.get($.id))==null?void 0:ue.connected)??!1;return d.jsxs(tr,{interactive:!0,onClick:()=>e(`/agents/${$.agentId}`),children:[d.jsx(Le,{children:d.jsx("span",{className:"mono font-medium",children:o($.agentId)})}),d.jsx(Le,{children:d.jsx(pn,{children:$.platform})}),d.jsx(Le,{children:d.jsx(pn,{tone:$.status==="active"?"accent":"outline",children:$.status})}),d.jsx(Le,{children:d.jsxs("span",{className:"inline-flex items-center gap-1.5 text-label",children:[d.jsx(Hr,{state:X?"idle":"offline",size:7}),d.jsx("span",{style:{color:"var(--fg-3)"},children:X?"Online":"Offline"})]})}),d.jsx(Le,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:bi($.createdAt)}),d.jsxs(Le,{style:{textAlign:"right",whiteSpace:"nowrap"},onClick:Se=>Se.stopPropagation(),children:[d.jsx(be,{variant:"ghost",size:"xs",className:"text-label",onClick:()=>R({agentId:$.agentId,editingId:$.id,initialPlatform:LF($.platform),initialStatus:IF($.status)}),children:"Edit"}),d.jsx(be,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>q($.id),disabled:ee.isPending,title:"Delete",children:d.jsx(Os,{className:"h-3.5 w-3.5"})})]})]},$.id)})})]}):d.jsx(hd,{children:l?"No bot bindings for this agent yet.":"No bot bindings"})]}),d.jsxs(yn,{children:[d.jsxs(Ls,{right:d.jsxs(be,{size:"xs",variant:"outline",onClick:()=>K("user"),children:[d.jsx(vi,{className:"h-3 w-3"})," User binding"]}),children:["User bindings · ",S.length]}),E?d.jsx(hd,{children:"Loading…"}):S.length?d.jsxs(dl,{children:[d.jsx(fl,{children:d.jsxs(tr,{children:[d.jsx(Ue,{children:"Agent"}),d.jsx(Ue,{children:"Platform"}),d.jsx(Ue,{children:"External user ID"}),d.jsx(Ue,{children:"Display name"}),d.jsx(Ue,{children:"Bound via"}),d.jsx(Ue,{children:"Created"}),d.jsx(Ue,{style:{width:32}})]})}),d.jsx(hl,{children:S.map($=>d.jsxs(tr,{interactive:!0,onClick:()=>e(`/agents/${$.agentId}`),children:[d.jsx(Le,{children:d.jsx("span",{className:"mono font-medium",style:{color:"var(--accent-dim)"},children:o($.agentId)})}),d.jsx(Le,{children:d.jsx(pn,{children:$.platform})}),d.jsx(Le,{children:d.jsx("span",{className:"mono text-label",style:{color:"var(--fg-2)"},children:$.externalUserId})}),d.jsx(Le,{style:{color:"var(--fg-2)"},children:$.displayName??"—"}),d.jsx(Le,{children:d.jsx(pn,{tone:"outline",children:$.boundVia??"—"})}),d.jsx(Le,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:bi($.createdAt)}),d.jsx(Le,{onClick:X=>X.stopPropagation(),children:d.jsx(be,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>W($.id),disabled:re.isPending,title:"Delete",children:d.jsx(Os,{className:"h-3.5 w-3.5"})})})]},$.id))})]}):d.jsx(hd,{children:l?"No user bindings for this agent yet.":"No user bindings"})]}),d.jsx(UF,{open:C!=null,kind:(C==null?void 0:C.kind)??"bot",agents:g,agentId:O,onAgentChange:B,onCancel:()=>T(null),onConfirm:he}),d.jsx(zS,{open:M!=null,kind:"bot",editingId:(M==null?void 0:M.editingId)??null,initialPlatform:M==null?void 0:M.initialPlatform,initialStatus:M==null?void 0:M.initialStatus,agentLabel:M?o(M.agentId):"",pending:me.isPending||de.isPending,errorMessage:(me.error??de.error)instanceof Error?(me.error??de.error).message:null,onOpenChange:$=>{$||(R(null),me.reset(),de.reset())},onSubmit:A}),d.jsx(zS,{open:D!=null,kind:"user",editingId:null,agentLabel:D?o(D.agentId):"",pending:H.isPending,errorMessage:H.error instanceof Error?H.error.message:null,onOpenChange:$=>{$||(Z(null),H.reset())},onSubmit:I}),d.jsx(OS,{open:te!=null,onOpenChange:$=>!$&&q(null),title:"Remove this bot binding?",description:"The bot will stop routing to this agent and any platform credentials stored here will be dropped.",confirmLabel:"Remove binding",pending:ee.isPending,onConfirm:()=>{te!=null&&(ee.mutate(te),q(null))}}),d.jsx(OS,{open:oe!=null,onOpenChange:$=>!$&&W(null),title:"Remove this binding?",description:"The external user will stop routing to this agent. You can add the mapping again later.",confirmLabel:"Remove binding",pending:re.isPending,onConfirm:()=>{oe!=null&&(re.mutate(oe),W(null))}})]})}function LF(e){return e==="feishu"||e==="slack"||e==="kael"?e:"feishu"}function IF(e){return e==="inactive"?"inactive":"active"}function hd({children:e}){return d.jsx("div",{className:"text-center py-6 text-body",style:{color:"var(--fg-3)"},children:e})}function UF(e){const t=e.kind==="user"?e.agents.filter(n=>n.type==="human"&&n.status==="active"):e.agents.filter(n=>n.type!=="human"&&n.status==="active");return d.jsx(nn,{open:e.open,onOpenChange:n=>!n&&e.onCancel(),children:d.jsxs(Xt,{children:[d.jsx(gn,{children:d.jsx(an,{children:e.kind==="bot"?"Bind a bot":"Bind an external user"})}),d.jsxs("div",{className:"space-y-3",children:[d.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Pick the agent this binding routes to."}),d.jsxs("select",{value:e.agentId,onChange:n=>e.onAgentChange(n.target.value),className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[d.jsx("option",{value:"",children:"Select an agent…"}),t.map(n=>d.jsxs("option",{value:n.uuid,children:[n.displayName," ",n.name?`(@${n.name})`:""]},n.uuid))]})]}),d.jsxs(rn,{children:[d.jsx(be,{variant:"ghost",onClick:e.onCancel,children:"Cancel"}),d.jsx(be,{onClick:e.onConfirm,disabled:!e.agentId,children:"Continue"})]})]})})}function OS(e){return d.jsx(nn,{open:e.open,onOpenChange:e.onOpenChange,children:d.jsxs(Xt,{children:[d.jsx(gn,{children:d.jsx(an,{children:e.title})}),d.jsx("div",{className:"space-y-3 text-body",style:{color:"var(--fg-2)"},children:e.description}),d.jsxs(rn,{children:[d.jsx(be,{type:"button",variant:"ghost",onClick:()=>e.onOpenChange(!1),disabled:e.pending,children:"Cancel"}),d.jsx(be,{type:"button",variant:"destructive",onClick:e.onConfirm,disabled:e.pending,children:e.pending?"Working…":e.confirmLabel})]})]})})}function PF(){return d.jsxs("div",{className:"-m-6",children:[d.jsx(af,{title:"Settings",subtitle:"Per-member controls"}),d.jsx(Wj,{children:d.jsx(eC,{active:!0,children:"Bindings"})}),d.jsx("div",{style:{padding:"var(--sp-4) var(--sp-5) var(--sp-7)"},children:d.jsx(DF,{})})]})}function BF(e){return Me.get(`/admin/chats/${encodeURIComponent(e)}`)}function $F(e,t){return Me.patch(`/admin/chats/${encodeURIComponent(e)}`,{topic:t})}function MS(e,t){return Me.post(`/admin/chats/${encodeURIComponent(e)}/messages`,{format:"text",content:t})}function FF(e,t){return Me.post(`/admin/chats/${encodeURIComponent(e)}/messages`,{format:"file",content:t})}function qF(e){return new Promise((t,n)=>{const a=new FileReader;a.onload=()=>{const l=a.result;if(typeof l!="string"){n(new Error("Unexpected FileReader result"));return}const o=l.indexOf(",");t(o>=0?l.slice(o+1):l)},a.onerror=()=>n(a.error??new Error("FileReader error")),a.readAsDataURL(e)})}function HF(e){return Me.post(`/admin/agents/${encodeURIComponent(e)}/chats`,{})}function ZF(e,t){const n=new URLSearchParams;n.set("limit",String(t.limit)),t!=null&&t.cursor&&n.set("cursor",t.cursor);const a=n.toString();return Me.get(`/admin/chats/${encodeURIComponent(e)}/messages${a?`?${a}`:""}`)}const VF="first-tree-hub-images",QF=1,Ps="images";let md=null;function gE(){return md||(md=new Promise(e=>{if(typeof indexedDB>"u"){e(null);return}const t=indexedDB.open(VF,QF);t.onupgradeneeded=()=>{const n=t.result;n.objectStoreNames.contains(Ps)||n.createObjectStore(Ps,{keyPath:"imageId"})},t.onsuccess=()=>e(t.result),t.onerror=()=>e(null),t.onblocked=()=>e(null)}),md)}async function GF(e){const t=await gE();if(!t)throw new Error("Image storage unavailable (IndexedDB disabled or blocked)");await new Promise((n,a)=>{const l=t.transaction(Ps,"readwrite"),o=l.objectStore(Ps),u={imageId:e.imageId,base64:e.base64,mimeType:e.mimeType,createdAt:Date.now()};o.put(u),l.oncomplete=()=>n(),l.onerror=()=>a(l.error??new Error("Image storage write failed")),l.onabort=()=>a(l.error??new Error("Image storage write aborted"))})}async function KF(e){const t=await gE();return t?new Promise(n=>{const o=t.transaction(Ps,"readonly").objectStore(Ps).get(e);o.onsuccess=()=>{const u=o.result;if(!u){n(null);return}n({base64:u.base64,mimeType:u.mimeType})},o.onerror=()=>n(null)}):null}function YF(e,t){if(t<=0||t>e.length)return null;let n=t-1;for(;n>=0;){const l=e[n];if(l===void 0)return null;if(l==="@")break;if(!/[A-Za-z0-9_-]/.test(l))return null;n--}if(n<0||e[n]!=="@")return null;if(n>0){const l=e[n-1];if(l!==void 0&&/[A-Za-z0-9_.@-]/.test(l))return null}const a=e.slice(n+1,t).toLowerCase();return{triggerIndex:n,query:a}}function XF(e,t){if(!t)return[...e].sort((a,l)=>(a.displayName??a.name??"").localeCompare(l.displayName??l.name??"")).slice(0,8);const n=[];for(const a of e){const l=(a.name??"").toLowerCase(),o=(a.displayName??"").toLowerCase();let u=1/0;l.startsWith(t)?u=0:o.startsWith(t)?u=1:o.includes(t)&&(u=2),u!==1/0&&n.push({c:a,score:u})}return n.sort((a,l)=>a.score-l.score||(a.c.displayName??"").localeCompare(l.c.displayName??"")),n.slice(0,8).map(a=>a.c)}function JF(e,t,n,a){if(!a.name)return null;const l=e.slice(0,t.triggerIndex),o=e.slice(n),u=`@${a.name}`,f=o.length===0||!/\s/.test(o[0]??""),m=f?` ${o}`:o,h=`${l}${u}${m}`,g=l.length+u.length+(f?1:0);return{text:h,cursor:g}}function WF({value:e,cursor:t,candidates:n,onSelect:a,disabled:l}){const[o,u]=x.useState(0),[f,m]=x.useState(null),h=x.useMemo(()=>l?null:YF(e,t),[e,t,l]),g=x.useMemo(()=>h?XF(n,h.query):[],[h,n]),y=h?`${h.triggerIndex}:${h.query}`:"";x.useEffect(()=>{u(0)},[y]),x.useEffect(()=>{h===null&&f!==null&&m(null)},[h,f]);const b=f!==null&&h!==null&&f===h.triggerIndex,S=h!==null&&g.length>0&&!b;function k(){m((h==null?void 0:h.triggerIndex)??null)}function j(C){if(!h)return;const T=JF(e,h,t,C);T&&a(T)}return{trigger:S?h:null,results:S?g:[],highlightIndex:o,handleKey:C=>{if(!S||!h)return!1;if(C.key==="ArrowDown")return C.preventDefault(),u(T=>g.length===0?0:(T+1)%g.length),!0;if(C.key==="ArrowUp")return C.preventDefault(),u(T=>g.length===0?0:(T-1+g.length)%g.length),!0;if(C.key==="Enter"||C.key==="Tab"){const T=g[o]??g[0];return T?(C.preventDefault(),j(T),!0):!1}return C.key==="Escape"?(C.preventDefault(),k(),!0):!1},pick:j,dismiss:k}}function eq({trigger:e,results:t,highlightIndex:n,onPick:a,anchorRef:l}){const o=x.useRef(null);return x.useEffect(()=>{var m;const f=(m=o.current)==null?void 0:m.querySelector(`[data-mention-index="${n}"]`);f==null||f.scrollIntoView({block:"nearest"})},[n]),!e||t.length===0||!l.current?null:d.jsx("div",{ref:o,role:"listbox","aria-label":"Mention suggestions",className:Ee("absolute z-20 max-h-56 overflow-auto rounded-md border shadow-lg"),style:{bottom:"calc(100% + var(--sp-1))",left:0,right:0,background:"var(--bg-raised)",borderColor:"var(--border)"},children:t.map((f,m)=>{const h=m===n;return d.jsxs("button",{type:"button",role:"option","aria-selected":h,"data-mention-index":m,onMouseDown:g=>{g.preventDefault(),a(f)},className:"flex w-full items-baseline gap-2 px-3 py-1.5 text-left text-body",style:{background:h?"var(--accent-dim)":"transparent",color:"var(--fg)",border:"none",cursor:"pointer"},children:[d.jsx("span",{className:"font-medium",children:f.displayName??(f.name?`@${f.name}`:"—")}),f.name&&f.displayName&&d.jsxs("span",{className:"mono text-caption",style:{color:"var(--fg-3)"},children:["@",f.name]})]},f.agentId)})})}function yE(e,t){return t&&(e==="idle"||e==="working"||e==="blocked"||e==="error")?e:"offline"}function tq(e){let t=-1;for(const l of e)l.kind==="turn_end"&&l.seq>t&&(t=l.seq);const n=e.filter(l=>l.kind==="turn_end"?!1:l.kind==="error"?!0:l.seq>t),a=new Map;for(const l of n){if(l.kind!=="tool_call")continue;const o=DS(l.payload);if(!o)continue;const u=a.get(o)??-1;l.seq>u&&a.set(o,l.seq)}return n.filter(l=>{if(l.kind!=="tool_call")return!0;const o=DS(l.payload);return o?a.get(o)===l.seq:!0})}function DS(e){if(typeof e!="object"||e===null)return;const t=e.toolUseId;return typeof t=="string"?t:void 0}function ff(e){const t=new Date(e),n=new Intl.DateTimeFormat("en-GB",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}).formatToParts(t),a=l=>{var o;return((o=n.find(u=>u.type===l))==null?void 0:o.value)??""};return`${a("month")}/${a("day")} ${a("hour")}:${a("minute")}`}function vE(e){if(!e)return"—";const t=Date.now()-new Date(e).getTime(),n=Math.round(t/1e3);if(n<60)return`${n}s ago`;const a=Math.round(n/60);if(a<60)return`${a}m ago`;const l=Math.round(a/60);return l<24?`${l}h ago`:`${Math.round(l/24)}d ago`}function nq(e){return e>=1e3?`${(e/1e3).toFixed(1)}s`:`${e}ms`}function LS(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return"…"}}function rq({msg:e,myAgentId:t}){if(!t||e.senderId!==t)return null;const n=e.deliveryStatus??"sent";return n==="acked"?d.jsx("span",{className:"mono text-caption",style:{color:"var(--accent)"},title:"Agent has started processing",children:"✓✓ read"}):n==="delivered"?d.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-3)"},title:"Delivered to agent inbox",children:"✓✓"}):d.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},title:"Sent",children:"✓ sent"})}function aq({agentId:e,chatId:t,session:n}){const a=Fn(),[,l]=Zd(),[o,u]=x.useState(!1),[f,m]=x.useState(null),h=ek(e,t),g=Ip(e),y=E=>{a.setQueryData(h,C=>C&&{...C,state:E}),a.setQueryData(g,C=>C&&C.map(T=>T.chatId===t?{...T,state:E}:T))},b=wt({mutationFn:()=>oz(e,t),onMutate:async()=>{await a.cancelQueries({queryKey:h}),await a.cancelQueries({queryKey:g});const E=a.getQueryData(h),C=a.getQueryData(g);return y("suspended"),{previousSession:E,previousList:C}},onError:(E,C,T)=>{T!=null&&T.previousSession&&a.setQueryData(h,T.previousSession),T!=null&&T.previousList&&a.setQueryData(g,T.previousList)},onSuccess:E=>{y(E.state)}}),S=wt({mutationFn:()=>uz(e,t),onMutate:async()=>{await a.cancelQueries({queryKey:h}),await a.cancelQueries({queryKey:g});const E=a.getQueryData(h),C=a.getQueryData(g);return a.setQueryData(g,T=>T&&T.filter(O=>O.chatId!==t)),{previousSession:E,previousList:C}},onError:(E,C,T)=>{T!=null&&T.previousSession&&a.setQueryData(h,T.previousSession),T!=null&&T.previousList&&a.setQueryData(g,T.previousList),m(E instanceof Error?E.message:"Terminate failed")},onSuccess:(E,C,T)=>{if(E.state!=="evicted"){T!=null&&T.previousList&&a.setQueryData(g,T.previousList),y(E.state),m(`Session is ${E.state}; terminate only applies to suspended sessions.`);return}m(null),u(!1),l({a:e})}}),k=(n==null?void 0:n.state)==="active",j=(n==null?void 0:n.state)==="suspended";return!k&&!j?null:d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"inline-flex items-center",style:{gap:4,padding:4,border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)",background:"var(--bg-sunken)"},children:[k&&d.jsxs("button",{type:"button",onClick:()=>b.mutate(),disabled:b.isPending,className:"inline-flex items-center transition-colors text-label",style:{gap:6,padding:"var(--sp-1) var(--sp-2_5)",color:"var(--fg-2)",borderRadius:"var(--radius-input)"},onMouseEnter:E=>E.currentTarget.style.background="var(--bg-hover)",onMouseLeave:E=>E.currentTarget.style.background="transparent",children:[d.jsx(VT,{className:"h-3 w-3"})," Suspend",d.jsx("span",{className:"kbd",style:{marginLeft:2},children:"⌘⇧P"})]}),j&&d.jsxs("button",{type:"button",onClick:()=>{m(null),u(!0)},disabled:S.isPending,className:"inline-flex items-center transition-colors text-label font-semibold",style:{gap:6,padding:"var(--sp-1) var(--sp-2_5)",color:"var(--state-error)",background:"color-mix(in oklch, var(--state-error) 18%, transparent)",borderRadius:"var(--radius-input)"},onMouseEnter:E=>E.currentTarget.style.background="color-mix(in oklch, var(--state-error) 28%, transparent)",onMouseLeave:E=>E.currentTarget.style.background="color-mix(in oklch, var(--state-error) 18%, transparent)",children:[d.jsx(eR,{className:"h-3 w-3"})," Terminate"]})]}),d.jsx(iq,{open:o,onOpenChange:E=>{S.isPending||u(E),E||m(null)},session:n,chatId:t,error:f,pending:S.isPending,onConfirm:()=>S.mutate()})]})}function iq(e){const{open:t,onOpenChange:n,session:a,chatId:l,pending:o,error:u,onConfirm:f}=e;function m(g){g.preventDefault(),o||f()}const h=l.slice(0,8);return d.jsx(nn,{open:t,onOpenChange:n,children:d.jsxs(Xt,{children:[d.jsx(gn,{children:d.jsx(an,{children:"Terminate session?"})}),d.jsxs("form",{onSubmit:m,className:"space-y-4",children:[d.jsx("p",{className:"text-body text-muted-foreground",children:"Ending this session is permanent. It is removed from the workspace and cannot be resumed. Chat history is preserved; a new message will start a fresh session."}),d.jsxs("div",{className:"mono text-label",style:{padding:"var(--sp-2) var(--sp-2_5)",borderRadius:"var(--radius-input)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",color:"var(--fg-2)",display:"grid",gap:4},children:[d.jsxs("span",{children:["chat: ",d.jsxs("span",{className:"font-medium",children:[h,"…"]})]}),(a==null?void 0:a.lastActivityAt)&&d.jsxs("span",{children:["last activity: ",vE(a.lastActivityAt)]}),typeof(a==null?void 0:a.messageCount)=="number"&&d.jsxs("span",{children:["messages: ",a.messageCount]})]}),u&&d.jsx("p",{className:"mono text-label",style:{color:"var(--state-error)"},children:u}),d.jsxs(rn,{children:[d.jsx(be,{type:"button",variant:"ghost",onClick:()=>n(!1),disabled:o,children:"Cancel"}),d.jsx(be,{type:"submit",variant:"destructive",disabled:o,children:o?"Terminating…":"Terminate"})]})]})]})})}function lq({event:e}){const t=az(e.payload);if(!t)return null;const n=t.status==="error",a=t.status==="pending",l=n?"var(--state-error)":a?"var(--state-blocked)":"var(--fg-3)",o=n?"failed":a?"using":"used";return d.jsxs("div",{className:"mono flex items-center text-label",style:{gap:8,padding:"var(--sp-0_5) var(--sp-2)",color:"var(--fg-3)"},children:[a?d.jsx("span",{"aria-hidden":!0,style:{width:6,height:6,borderRadius:"50%",background:l,animation:"heartbeat-pulse 1.2s ease-in-out infinite",flexShrink:0,marginTop:5}}):d.jsx("span",{"aria-hidden":!0,style:{color:l,flexShrink:0},children:n?"⚠":"↳"}),d.jsxs("span",{className:"flex items-baseline",style:{color:"var(--fg-3)",minWidth:0,flex:1},title:t.args!==void 0&&t.args!==null?LS(t.args):void 0,children:[d.jsxs("span",{style:{whiteSpace:"nowrap",flexShrink:0},children:[o," ",d.jsx("span",{style:{color:"var(--fg-2)"},children:t.name})]}),t.args!==void 0&&t.args!==null?d.jsxs("span",{className:"truncate",style:{color:"var(--fg-4)",minWidth:0,flex:1},children:["(",LS(t.args),")"]}):null,t.durationMs!==void 0&&!a?d.jsxs("span",{className:"text-caption",style:{color:"var(--fg-4)",marginLeft:6,whiteSpace:"nowrap",flexShrink:0},children:["· ",nq(t.durationMs)]}):null]})]})}function sq({event:e,agentNameFn:t,agentId:n}){const a=lz(e.payload);if(!a||a.text.length===0)return null;const l=t(n);return d.jsxs("div",{className:"grid",style:{gridTemplateColumns:"var(--sp-5) 1fr",columnGap:8,padding:"var(--sp-1) 0",opacity:.85},children:[d.jsx(bE,{name:l,isSelf:!1}),d.jsxs("div",{className:"min-w-0",children:[d.jsxs("div",{className:"flex items-baseline",style:{gap:8},children:[d.jsx("span",{className:"mono text-label font-semibold",style:{color:"var(--accent)"},children:l}),d.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:ff(e.createdAt)}),d.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:"· streaming"})]}),d.jsx("div",{className:"text-body",style:{color:"var(--fg-2)",whiteSpace:"pre-wrap",marginTop:2},children:a.text})]})]})}function oq({event:e}){return d.jsxs("div",{className:"mono flex items-center text-label",style:{gap:8,padding:"var(--sp-0_5) var(--sp-2)",color:"var(--fg-3)"},children:[d.jsx("span",{"aria-hidden":!0,style:{width:6,height:6,borderRadius:"50%",background:"var(--accent)",animation:"heartbeat-pulse 1.2s ease-in-out infinite",flexShrink:0}}),d.jsx("span",{style:{color:"var(--fg-3)"},children:"thinking…"}),d.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:ff(e.createdAt)})]})}function uq({event:e}){const t=iz(e.payload),n=ff(e.createdAt);return d.jsxs("div",{style:{padding:"var(--sp-1_5) var(--sp-2_5)",borderLeft:"var(--hairline-bold) solid var(--state-error)",background:"color-mix(in oklch, var(--state-error) 6%, transparent)",borderRadius:"0 var(--radius-input) var(--radius-input) 0"},children:[d.jsxs("div",{className:"mono uppercase text-caption",style:{color:"var(--state-error)"},children:["error · ",(t==null?void 0:t.source)??"unknown"," · ",n]}),d.jsx("div",{className:"text-label",style:{marginTop:2,color:"var(--fg-2)",whiteSpace:"pre-wrap"},children:(t==null?void 0:t.message)??"(invalid error payload)"})]})}function bE({name:e,isSelf:t}){const n=e.slice(0,2).toUpperCase();return d.jsx("div",{className:"mono text-eyebrow font-bold",style:{width:20,height:20,borderRadius:"var(--radius-input)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,background:t?"linear-gradient(135deg, var(--accent), oklch(0.58 0.14 170))":"var(--bg-active)",border:t?"none":"var(--hairline) solid var(--border-strong)",color:t?"oklch(0.14 0.01 150)":"var(--fg-2)"},children:t?n:d.jsx(Tu,{width:9,height:10,style:{color:"var(--accent)"}})})}function cq({msg:e,myAgentId:t,agentNameFn:n}){const a=n(e.senderId),l=t===e.senderId;return d.jsxs("div",{className:"grid",style:{gridTemplateColumns:"var(--sp-5) 1fr",columnGap:8,padding:"var(--sp-1_5) 0"},children:[d.jsx(bE,{name:a,isSelf:l}),d.jsxs("div",{className:"min-w-0",children:[d.jsxs("div",{className:"flex items-baseline",style:{gap:8},children:[d.jsx("span",{className:"mono text-body font-semibold",style:{color:l?"var(--fg)":"var(--accent)"},children:a}),d.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:ff(e.createdAt)}),d.jsx("span",{style:{marginLeft:"auto"},children:d.jsx(rq,{msg:e,myAgentId:t})})]}),d.jsx("div",{className:"text-body",style:{color:"var(--fg)",marginTop:2},children:e.format==="file"&&dq(e.content)?d.jsx("img",{src:`data:${e.content.mimeType};base64,${e.content.data}`,alt:e.content.filename??"image",style:{maxWidth:320,borderRadius:"var(--radius-panel)",marginTop:4}}):e.format==="file"&&fq(e.content)?d.jsx(hq,{content:e.content}):e.format==="text"?d.jsx(cE,{children:typeof e.content=="string"?e.content:JSON.stringify(e.content)}):d.jsx("pre",{className:"mono text-label",style:{background:"var(--bg-sunken)",padding:8,borderRadius:"var(--radius-input)",overflow:"auto",maxHeight:160},children:JSON.stringify(e.content,null,2)})})]})]})}function dq(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.data=="string"&&typeof t.mimeType=="string"&&t.mimeType.startsWith("image/")}function fq(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.imageId=="string"&&typeof t.mimeType=="string"&&t.mimeType.startsWith("image/")&&typeof t.filename=="string"}function hq({content:e}){const[t,n]=x.useState({kind:"loading"});return x.useEffect(()=>{let a=!1;return KF(e.imageId).then(l=>{a||n(l?{kind:"hit",src:`data:${l.mimeType};base64,${l.base64}`}:{kind:"miss"})}),()=>{a=!0}},[e.imageId]),t.kind==="hit"?d.jsx("img",{src:t.src,alt:e.filename,style:{maxWidth:320,borderRadius:"var(--radius-panel)",marginTop:4}}):t.kind==="miss"?d.jsxs("span",{className:"text-label",style:{color:"var(--fg-3)",fontStyle:"italic"},children:['[Image "',e.filename,'" not available on this device]']}):d.jsx("span",{className:"text-label",style:{color:"var(--fg-4)"},children:"…"})}function mq({agentId:e,chatId:t}){var ut;const n=Fn(),a=yl(),l=Og(),{agentId:o}=wa(),[u,f]=x.useState(""),[m,h]=x.useState(0),[g,y]=x.useState([]),[b,S]=x.useState(!1),[k,j]=x.useState(null),E=x.useRef(null),C=x.useRef(null),T=x.useRef(null),O=x.useRef(!1);x.useEffect(()=>{O.current=!1},[t]);const{data:B}=Ve({queryKey:["chat-messages",t],queryFn:()=>ZF(t,{limit:50}),refetchInterval:5e3}),{data:M}=Ve({queryKey:["session-events",e,t],queryFn:()=>sz(e,t,{limit:200,direction:"desc"}),refetchInterval:5e3}),{data:R}=Ve({queryKey:ek(e,t),queryFn:()=>Hs(e).then(ae=>ae.find(Oe=>Oe.chatId===t)??null),refetchInterval:5e3}),{data:D}=Ve({queryKey:["chat-detail",t],queryFn:()=>BF(t),enabled:!!t}),Z=wt({mutationFn:ae=>MS(t,ae),onSuccess:()=>{f(""),n.invalidateQueries({queryKey:["chat-messages",t]})}}),te=x.useCallback(ae=>{const at=ae.filter(ln=>ln.type.startsWith("image/"));if(at.length===0)return;const Pe=at.find(ln=>ln.size>5242880);if(Pe){j(`Image too large (${(Pe.size/1024/1024).toFixed(1)}MB). Maximum ${5242880/1024/1024}MB per image.`);return}const Mt=at.map(ln=>({id:crypto.randomUUID(),file:ln,previewUrl:URL.createObjectURL(ln)}));y(ln=>[...ln,...Mt]),j(null)},[]),q=x.useCallback(ae=>{y(Oe=>{const at=Oe.find(Pe=>Pe.id===ae);return at&&URL.revokeObjectURL(at.previewUrl),Oe.filter(Pe=>Pe.id!==ae)})},[]),oe=async()=>{const ae=u.trim(),Oe=g;if(!(!ae&&Oe.length===0)&&!b&&!($&&X.length===0)){if(Oe.length>0){S(!0),j(null);try{for(const at of Oe){const Pe=await qF(at.file),Mt=crypto.randomUUID();await GF({imageId:Mt,base64:Pe,mimeType:at.file.type}),await FF(t,{data:Pe,mimeType:at.file.type,filename:at.file.name,size:at.file.size,imageId:Mt}),URL.revokeObjectURL(at.previewUrl)}y([]),ae&&await MS(t,ae),f(""),n.invalidateQueries({queryKey:["chat-messages",t]})}catch(at){j(at instanceof Error?at.message:"Failed to send image")}finally{S(!1)}return}Z.mutate(ae)}},[W,me]=x.useState(!1),[de,ee]=x.useState(""),H=x.useRef(null);x.useEffect(()=>{var ae;W&&((ae=H.current)==null||ae.focus())},[W]);const re=wt({mutationFn:ae=>$F(t,ae),onSuccess:()=>{me(!1),n.invalidateQueries({queryKey:["chat-detail",t]}),n.invalidateQueries({queryKey:["agent-sessions",e]}),n.invalidateQueries({queryKey:["session",e,t]})}}),K=()=>{const ae=de.trim();re.mutate(ae.length>0?ae:null)},he=x.useMemo(()=>{const ae=(B==null?void 0:B.items)??[],Oe=tq((M==null?void 0:M.items)??[]),at=[...ae.map(Pe=>({kind:"message",at:Pe.createdAt,key:`m-${Pe.id}`,data:Pe})),...Oe.map(Pe=>({kind:"event",at:Pe.createdAt,key:`e-${Pe.id}`,data:Pe}))];return at.sort((Pe,Mt)=>Pe.at.localeCompare(Mt.at)),at},[B,M]),A=he.length;x.useEffect(()=>{var ae;A>0&&((ae=T.current)==null||ae.scrollIntoView({behavior:"smooth"}))},[A]);const I=D!=null&&D.participants?D.participants.map(ae=>{const Oe=a(ae.agentId);return`@${Oe.length>20?`${Oe.slice(0,17)}…`:Oe}`}).join(" "):`@${a(e)}`,U=a(e),_=x.useMemo(()=>{var at;const ae=((at=D==null?void 0:D.participants)==null?void 0:at.map(Pe=>Pe.agentId))??[e],Oe=[];for(const Pe of ae){if(Pe===o)continue;const Mt=l(Pe);!Mt||!Mt.name||Oe.push({agentId:Pe,name:Mt.name,displayName:Mt.displayName})}return Oe},[D==null?void 0:D.participants,e,l,o]),$=x.useMemo(()=>{if(!D)return!1;if(D.type==="group")return!0;const ae=D.participants.some(Oe=>Oe.agentId===o);return D.type==="direct"&&!ae&&D.participants.length>=2},[D,o]),X=x.useMemo(()=>{if(!$)return[];const ae=_.map(Oe=>({agentId:Oe.agentId,name:Oe.name}));return TL(u,ae)},[u,_,$]),ue=WF({value:u,cursor:m,candidates:_,disabled:Z.isPending||b,onSelect:ae=>{f(ae.text),h(ae.cursor),requestAnimationFrame(()=>{const Oe=C.current;Oe&&(Oe.focus(),Oe.setSelectionRange(ae.cursor,ae.cursor))})}}),Se=(R==null?void 0:R.runtimeState)??"idle",De=yE((R==null?void 0:R.runtimeState)??null,e?"connected":null),ge=(R==null?void 0:R.messageCount)??((ut=B==null?void 0:B.items)==null?void 0:ut.length)??0;return d.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[d.jsxs("div",{className:"grid items-center shrink-0",style:{gridTemplateColumns:"1fr auto",gap:10,padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border)"},children:[d.jsxs("div",{className:"min-w-0",children:[d.jsxs("div",{className:"flex items-center",style:{gap:8},children:[d.jsx(Hr,{state:De,size:8}),W?d.jsxs(d.Fragment,{children:[d.jsx("input",{ref:H,value:de,onChange:ae=>ee(ae.target.value),onKeyDown:ae=>{ae.key==="Enter"?(ae.preventDefault(),K()):ae.key==="Escape"&&(ae.preventDefault(),me(!1))},disabled:re.isPending,maxLength:500,placeholder:"Chat name",className:"outline-none text-subtitle",style:{flex:1,minWidth:0,color:"var(--fg)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",padding:"var(--sp-0_5) var(--sp-1_5)"}}),d.jsx("button",{type:"button",onClick:K,disabled:re.isPending,title:"Save",className:"inline-flex items-center",style:{color:"var(--accent)",padding:2},children:d.jsx(Cu,{className:"h-3.5 w-3.5"})}),d.jsx("button",{type:"button",onClick:()=>me(!1),disabled:re.isPending,title:"Cancel",className:"inline-flex items-center",style:{color:"var(--fg-3)",padding:2},children:d.jsx(Nd,{className:"h-3.5 w-3.5"})})]}):d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"truncate text-subtitle",style:{color:"var(--fg)"},children:(D==null?void 0:D.topic)||(R==null?void 0:R.summary)||`Chat · ${t.slice(0,8)}`}),d.jsx("button",{type:"button",onClick:()=>{ee((D==null?void 0:D.topic)??""),me(!0)},title:"Rename chat",className:"inline-flex items-center transition-colors",style:{color:"var(--fg-4)",padding:2},onMouseEnter:ae=>ae.currentTarget.style.color="var(--fg-2)",onMouseLeave:ae=>ae.currentTarget.style.color="var(--fg-4)",children:d.jsx(Eu,{className:"h-3 w-3"})})]}),d.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)",padding:"var(--hairline) var(--sp-1_25)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-chip)"},children:t})]}),d.jsxs("div",{className:"flex items-center text-caption",style:{color:"var(--fg-3)",marginTop:4,gap:10},children:[d.jsx("span",{className:"mono",children:I}),d.jsx("span",{children:"·"}),d.jsxs("span",{children:["started ",vE((R==null?void 0:R.startedAt)??null)]}),d.jsx("span",{children:"·"}),d.jsxs("span",{children:[ge," msgs"]}),d.jsx("span",{children:"·"}),d.jsxs("span",{children:["runtime"," ",d.jsx("span",{className:"mono",style:{color:De==="error"?"var(--state-error)":"var(--fg-2)"},children:Se})]})]})]}),d.jsx(aq,{agentId:e,chatId:t,session:R??null})]}),d.jsxs("div",{className:"flex-1 overflow-y-auto relative",style:{padding:"var(--sp-2_5) var(--sp-3_5)"},children:[A===0&&d.jsxs("div",{className:"flex flex-col items-center text-body",style:{color:"var(--fg-3)",padding:"var(--sp-8) 0",gap:6},children:[d.jsx(Eg,{className:"h-8 w-8",style:{opacity:.3}}),"Send a message to start the conversation"]}),d.jsx("div",{className:"flex flex-col",style:{gap:4},children:he.map(ae=>{if(ae.kind==="event"){const Oe=ae.data;switch(Oe.kind){case"tool_call":return d.jsx(lq,{event:Oe},ae.key);case"assistant_text":return d.jsx(sq,{event:Oe,agentId:e,agentNameFn:a},ae.key);case"thinking":return d.jsx(oq,{event:Oe},ae.key);case"error":return d.jsx(uq,{event:Oe},ae.key);default:return null}}return d.jsx(cq,{msg:ae.data,myAgentId:o,agentNameFn:a},ae.key)})}),d.jsx("div",{ref:T})]}),d.jsxs("div",{className:"shrink-0",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderTop:"var(--hairline) solid var(--border)"},children:[d.jsxs("div",{style:{position:"relative",border:"var(--hairline) solid var(--border)",borderRadius:6,background:"var(--bg-sunken)"},onDragOver:ae=>ae.preventDefault(),onDrop:ae=>{ae.preventDefault(),te(Array.from(ae.dataTransfer.files))},children:[g.length>0&&d.jsx("div",{className:"flex items-center",style:{gap:6,padding:"var(--sp-1_5) var(--sp-2_5) 0",overflowX:"auto"},children:g.map(ae=>d.jsxs("div",{style:{position:"relative",flexShrink:0,borderRadius:4,border:"var(--hairline) solid var(--border)",overflow:"hidden"},children:[d.jsx("img",{src:ae.previewUrl,alt:ae.file.name,style:{height:32,width:"auto",display:"block",objectFit:"cover"}}),d.jsx("button",{type:"button",onClick:()=>q(ae.id),style:{position:"absolute",top:1,right:1,width:14,height:14,borderRadius:"50%",background:"var(--color-overlay-scrim)",border:"none",color:"var(--bg-raised)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",padding:0},children:d.jsx(Nd,{className:"h-2 w-2"})})]},ae.id))}),d.jsxs("div",{style:{position:"relative"},children:[d.jsx(eq,{trigger:ue.trigger,results:ue.results,highlightIndex:ue.highlightIndex,anchorRef:C,onPick:ue.pick}),d.jsx("textarea",{ref:C,value:u,onChange:ae=>{f(ae.target.value),h(ae.target.selectionStart??ae.target.value.length)},onSelect:ae=>{h(ae.currentTarget.selectionStart??u.length)},onFocus:()=>{$&&(O.current||u.length>0||_.length===0||(O.current=!0,f("@"),h(1),requestAnimationFrame(()=>{const ae=C.current;ae&&ae.setSelectionRange(1,1)})))},onPaste:ae=>{const Oe=Array.from(ae.clipboardData.files);Oe.length>0&&(ae.preventDefault(),te(Oe))},placeholder:$?"Type @ to pick a recipient, then your message":`Message @${U} · / for commands · @ to mention`,rows:2,onKeyDown:ae=>{ue.handleKey(ae)||ae.key==="Enter"&&!ae.shiftKey&&(ae.preventDefault(),oe())},disabled:Z.isPending||b,className:"w-full outline-none text-subtitle font-normal",style:{padding:"var(--sp-2_25) var(--sp-3) var(--sp-7_5)",background:"transparent",border:"none",resize:"none",color:"var(--fg)"}})]}),d.jsxs("div",{className:"flex items-center justify-between text-caption",style:{position:"absolute",bottom:6,left:10,right:10,color:"var(--fg-4)"},children:[d.jsxs("span",{className:"mono flex items-center",style:{gap:8},children:[d.jsx("button",{type:"button",onClick:()=>{var ae;return(ae=E.current)==null?void 0:ae.click()},title:"Attach image",style:{background:"none",border:"none",cursor:"pointer",color:"var(--fg-3)",padding:0,display:"inline-flex",alignItems:"center"},children:d.jsx(HT,{className:"h-3.5 w-3.5"})}),d.jsx("input",{ref:E,type:"file",accept:"image/*",multiple:!0,style:{display:"none"},onChange:ae=>{ae.target.files&&(te(Array.from(ae.target.files)),ae.target.value="")}}),d.jsx("span",{children:"/suspend"}),d.jsx("span",{children:"/resume"}),d.jsx("span",{children:"/branch"}),d.jsx("span",{children:"/promote"})]}),d.jsxs("span",{className:"flex items-center",style:{gap:8},children:[b&&d.jsx("span",{className:"mono text-caption",style:{color:"var(--accent)"},children:"uploading…"}),d.jsxs("span",{children:[d.jsx("span",{className:"kbd",children:"⏎"})," send ",d.jsx("span",{className:"kbd",children:"⇧⏎"})," new line"]}),d.jsxs("button",{type:"button",onClick:oe,disabled:Z.isPending||b||!u.trim()&&g.length===0||$&&X.length===0,title:$&&X.length===0?"Pick at least one recipient with @ before sending in a group chat":void 0,className:Ee("inline-flex items-center transition-colors text-label font-semibold",(Z.isPending||b||!u.trim()&&g.length===0||$&&X.length===0)&&"opacity-50 cursor-not-allowed"),style:{gap:6,padding:"var(--sp-1) var(--sp-2_5)",color:"oklch(0.14 0.01 150)",background:"var(--accent)",border:"var(--hairline) solid var(--accent)",borderRadius:"var(--radius-input)"},children:[d.jsx(JT,{className:"h-3 w-3"})," Send"]})]})]})]}),(Z.isError||k)&&d.jsx("p",{className:"mono text-label",style:{color:"var(--state-error)",padding:"var(--sp-1_5) var(--sp-0_5) 0"},children:k??(Z.error instanceof Error?Z.error.message:"Failed to send")})]})]})}function pq(){return d.jsx("div",{className:"flex-1 flex items-center justify-center p-8",children:d.jsxs("div",{className:"text-center max-w-sm",children:[d.jsx(Tu,{width:36,height:40,className:"mx-auto mb-3 text-primary opacity-60"}),d.jsx("div",{className:"text-subtitle mb-1",children:"Select a chat"}),d.jsx("div",{className:"text-body text-muted-foreground",children:"Pick an agent from the roster to view its sessions, or open a chat to start collaborating."})]})})}function gq({selectedAgentId:e,selectedChatId:t}){return t&&e?d.jsx(mq,{agentId:e,chatId:t}):d.jsx(pq,{})}function xE(){const{data:e}=Ve({queryKey:["clients"],queryFn:cu,staleTime:1e4,refetchInterval:1e4});return x.useMemo(()=>{const t=e??[],n=new Map;for(const a of t)n.set(a.id,a);return{resolve:a=>a?n.get(a)??null:null,clients:t,connectedClients:t.filter(a=>a.status==="connected")}},[e])}function sg({children:e}){return d.jsx("div",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-4)",marginBottom:8},children:e})}function SE({children:e}){return d.jsx("div",{className:"grid text-body",style:{gridTemplateColumns:"auto 1fr",columnGap:10,rowGap:4},children:e})}function Fr({label:e,children:t}){return d.jsxs(d.Fragment,{children:[d.jsx("div",{style:{color:"var(--fg-3)"},children:e}),d.jsx("div",{className:"text-right truncate",style:{color:"var(--fg)",overflow:"hidden",textOverflow:"ellipsis"},children:t})]})}function IS(e){if(!e)return"—";const t=Date.now()-new Date(e).getTime(),n=Math.round(t/1e3);if(n<60)return`${n}s ago`;const a=Math.round(n/60);if(a<60)return`${a}m ago`;const l=Math.round(a/60);return l<24?`${l}h ago`:`${Math.round(l/24)}d ago`}function US(e){if(!e)return"—";const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<60)return`${n}m`;const a=Math.floor(n/60);return a<24?`${a}h ${n%60}m`:`${Math.floor(a/24)}d ${a%24}h`}function yp({label:e,value:t,accent:n}){return d.jsxs("div",{style:{padding:"var(--sp-1_5) var(--sp-2)",background:"var(--bg-sunken)",borderRadius:"var(--radius-input)"},children:[d.jsx("div",{className:"mono uppercase text-caption",style:{color:"var(--fg-4)"},children:e}),d.jsx("div",{className:"mono text-subtitle",style:{color:n??"var(--fg)"},children:t})]})}function yq({notifications:e,agentId:t}){const[,n]=Zd(),a=Fn(),l=wt({mutationFn:o=>ej(o),onSuccess:()=>{a.invalidateQueries({queryKey:["notifications"]})}});return d.jsx("div",{className:"flex flex-col",style:{gap:4},children:e.map(o=>d.jsx(tj,{notification:o,clickable:!!o.chatId,onClick:()=>{o.read||l.mutate(o.id),o.chatId&&n({a:t,c:o.chatId})}},o.id))})}function wE({agentId:e}){var h;const t=yl(),{resolve:n}=xE(),{data:a}=Ve({queryKey:["activity"],queryFn:Nu,refetchInterval:1e4}),l=(h=a==null?void 0:a.agents)==null?void 0:h.find(g=>g.agentId===e),o=n(l==null?void 0:l.clientId),{data:u}=Ve({queryKey:["notifications","agent",e],queryFn:()=>qp({agentId:e,limit:3}),refetchInterval:3e4}),f=t(e),m=(l==null?void 0:l.runtimeState)??"offline";return d.jsxs("div",{className:"flex-1 overflow-y-auto",children:[d.jsxs("div",{style:{padding:"var(--sp-3) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsxs("div",{className:"flex items-center",style:{gap:10},children:[d.jsx("div",{className:"flex items-center justify-center",style:{width:32,height:32,borderRadius:5,background:"var(--bg-active)",border:"var(--hairline) solid var(--border-strong)"},children:d.jsx(Tu,{width:14,height:16,style:{color:"var(--accent)"}})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{className:"text-subtitle",style:{color:"var(--fg)"},children:f}),d.jsx("div",{className:"mono truncate text-body",style:{color:"var(--fg-4)"},children:e})]}),d.jsx(Is,{state:m})]}),d.jsxs("div",{className:"grid",style:{gridTemplateColumns:"repeat(3, 1fr)",gap:4,marginTop:10},children:[d.jsx(yp,{label:"sessions",value:(l==null?void 0:l.totalSessions)??0,accent:((l==null?void 0:l.totalSessions)??0)>0?"var(--fg)":"var(--fg-4)"}),d.jsx(yp,{label:"active",value:(l==null?void 0:l.activeSessions)??0,accent:((l==null?void 0:l.activeSessions)??0)>0?"var(--accent)":"var(--fg-4)"}),d.jsx(yp,{label:"uptime",value:US((o==null?void 0:o.connectedAt)??null)})]})]}),d.jsxs("div",{style:{padding:"var(--sp-3) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsx(sg,{children:"Computer · runtime"}),d.jsxs(SE,{children:[d.jsx(Fr,{label:"host",children:d.jsx("span",{className:"mono text-label",children:(o==null?void 0:o.hostname)??"—"})}),d.jsx(Fr,{label:"os",children:d.jsx("span",{className:"mono text-label",children:(o==null?void 0:o.os)??"—"})}),d.jsx(Fr,{label:"runtime",children:d.jsx("span",{className:"mono",children:(l==null?void 0:l.runtimeType)??"—"})}),d.jsx(Fr,{label:"sdk",children:d.jsx("span",{className:"mono text-label",children:(o==null?void 0:o.sdkVersion)??"—"})}),d.jsx(Fr,{label:"connected",children:d.jsx("span",{className:"mono text-label",children:US((o==null?void 0:o.connectedAt)??null)})})]})]}),d.jsxs("div",{style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},className:"flex flex-col",children:[d.jsx("a",{href:`/agents/${e}`,style:{color:"var(--accent)"},className:"hover:underline text-label",children:"Manage agent →"}),d.jsx("a",{href:"/clients",style:{color:"var(--accent)",marginTop:4},className:"hover:underline text-label",children:"Computers →"})]}),d.jsxs("div",{style:{padding:"var(--sp-3) var(--sp-3_5)"},children:[d.jsx(sg,{children:"Notifications"}),!(u!=null&&u.items)||u.items.length===0?d.jsx("div",{className:"text-center text-label",style:{color:"var(--fg-3)",padding:"var(--sp-3) 0"},children:"No notifications for this agent"}):d.jsx(yq,{notifications:u.items,agentId:e})]})]})}function vq({agentId:e,chatId:t}){const{data:n}=Ve({queryKey:["session",e,t],queryFn:()=>Hs(e).then(a=>a.find(l=>l.chatId===t)??null),refetchInterval:5e3});return d.jsxs("div",{className:"flex flex-col overflow-hidden flex-1",children:[d.jsxs("div",{style:{padding:"var(--sp-3) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsx(sg,{children:"Session"}),d.jsxs(SE,{children:[d.jsx(Fr,{label:"state",children:d.jsx(Is,{state:(n==null?void 0:n.runtimeState)??(n==null?void 0:n.state)??null})}),d.jsx(Fr,{label:"chat",children:d.jsx("span",{className:"mono text-body",children:t.slice(0,12)})}),d.jsx(Fr,{label:"started",children:IS((n==null?void 0:n.startedAt)??null)}),d.jsx(Fr,{label:"last",children:IS((n==null?void 0:n.lastActivityAt)??null)}),d.jsx(Fr,{label:"messages",children:d.jsx("span",{className:"mono",children:(n==null?void 0:n.messageCount)??0})})]})]}),d.jsx(wE,{agentId:e})]})}function bq({selectedAgentId:e,selectedChatId:t}){return t&&e?d.jsx(vq,{agentId:e,chatId:t}):e?d.jsx(wE,{agentId:e}):null}const xq=32;function Sq({aggregated:e,stale:t,className:n}){const a=Math.max(1,...e.map(l=>l.workingCount));return d.jsx("div",{className:Ee("flex items-end gap-[var(--sp-0_5)]",t&&"opacity-40",n),style:{height:22},"aria-hidden":!0,children:Array.from({length:xq}).map((l,o)=>{const u=e[o]??{workingCount:0,errorMask:!1},f=u.workingCount===0?.08:u.workingCount/a,m=.25+f*.7,h=u.errorMask?"var(--state-error)":"var(--accent)";return d.jsx("span",{className:"flex-1",style:{height:`${Math.max(12,f*100)}%`,background:h,opacity:m,borderRadius:.5}},o)})})}const wq={error:0,blocked:1,working:2,idle:3};function kq(e,t){return t?e?wq[e]??4:4:5}function jq(e,t){return t==="all"?!0:t==="active"?e.runtimeState==="working":e.runtimeState==="blocked"||e.runtimeState==="error"}function Cq({selectedAgentId:e,selectedChatId:t,onSelectAgent:n,onSelectChat:a}){const l=yl(),{resolve:o}=xE(),u=Fn(),f=C6(),[m,h]=x.useState(""),[g,y]=x.useState("all"),{data:b}=Ve({queryKey:["activity"],queryFn:Nu,refetchInterval:1e4}),{data:S}=Ve({queryKey:e?Ip(e):["agent-sessions",null],queryFn:()=>e?Hs(e):Promise.resolve([]),enabled:!!e,refetchInterval:1e4}),k=wt({mutationFn:R=>HF(R),onSuccess:(R,D)=>{u.invalidateQueries({queryKey:Ip(D)}),a(D,R.id)}}),{humans:j,agents:E,totalAll:C}=x.useMemo(()=>{const R=(b==null?void 0:b.agents)??[],D=m.trim().toLowerCase(),Z=R.filter(W=>{var ee;if(!jq(W,g))return!1;if(!D)return!0;const me=l(W.agentId).toLowerCase(),de=W.clientId?(((ee=o(W.clientId))==null?void 0:ee.hostname)??"").toLowerCase():"";return me.includes(D)||de.includes(D)||W.agentId.toLowerCase().includes(D)}),te=W=>kq(W.runtimeState,W.clientId),q=[],oe=[];for(const W of Z)(W.type==="human"?q:oe).push(W);return q.sort((W,me)=>te(W)-te(me)),oe.sort((W,me)=>te(W)-te(me)),{humans:q,agents:oe,totalAll:R.length}},[b,m,g,l,o]),T=x.useMemo(()=>{const R=(b==null?void 0:b.agents)??[];return{working:R.filter(D=>D.runtimeState==="working").length,blocked:R.filter(D=>D.runtimeState==="blocked").length,error:R.filter(D=>D.runtimeState==="error").length}},[b]),O=[{value:"all",label:"all",count:C},{value:"active",label:"active",count:T.working},{value:"attn",label:"attn",count:T.blocked+T.error,warn:T.blocked+T.error>0}],B=R=>{var W;const D=e===R.agentId,Z=yE(R.runtimeState,R.clientId),te=R.clientId?((W=o(R.clientId))==null?void 0:W.hostname)??R.clientId.slice(0,8):null,q=R.activeSessions??0,oe=R.totalSessions??0;return d.jsxs("div",{style:{borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsxs("button",{type:"button",onClick:()=>n(D?null:R.agentId),className:Ee("w-full text-left transition-colors grid items-center","hover:bg-[var(--bg-hover)]"),style:{gridTemplateColumns:"var(--sp-3_5) 1fr auto",columnGap:8,padding:"var(--sp-1_75) var(--sp-2_5) var(--sp-1_75) var(--sp-3)",background:D?"var(--bg-active)":"transparent",borderLeft:`var(--hairline-bold) solid ${D?"var(--accent)":"transparent"}`},children:[d.jsx(Hr,{state:Z,size:8}),d.jsxs("div",{className:"min-w-0",children:[d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("span",{className:"mono truncate text-body font-medium",style:{color:"var(--fg)"},children:l(R.agentId)}),R.type==="human"&&d.jsx("span",{className:"mono uppercase text-eyebrow",style:{padding:"var(--hairline) var(--sp-1_25)",borderRadius:2,color:"var(--accent)",background:"color-mix(in oklch, var(--accent) 15%, transparent)"},children:"human"})]}),d.jsx("div",{className:"truncate text-body",style:{color:"var(--fg-3)"},children:Z==="offline"?"disconnected":te||"—"})]}),d.jsx("div",{className:"flex flex-col items-end gap-0.5",children:oe>0&&d.jsxs("span",{className:"mono tnum text-label",style:{color:"var(--fg-3)"},children:[q,d.jsxs("span",{style:{color:"var(--fg-4)"},children:[" / ",oe]})]})})]}),D&&d.jsxs("div",{style:{background:"var(--bg-sunken)",paddingBottom:4},children:[(!S||S.length===0)&&d.jsx("div",{className:"text-body",style:{padding:"var(--sp-1_75) var(--sp-2_5) var(--sp-1_75) var(--sp-7)",color:"var(--fg-4)"},children:"No sessions yet"}),S==null?void 0:S.filter(me=>me.state!=="evicted").map(me=>{const de=me.state==="active"?"working":"idle";return d.jsxs("button",{type:"button",onClick:()=>a(R.agentId,me.chatId),className:"w-full grid items-center text-left transition-colors",style:{gridTemplateColumns:"var(--sp-3_5) 1fr",columnGap:6,padding:"var(--sp-1_75) var(--sp-2_5) var(--sp-1_75) var(--sp-7)",background:t===me.chatId?"var(--bg-hover)":"transparent",color:me.state==="active"?"var(--fg-2)":"var(--fg-3)"},onMouseEnter:ee=>{t!==me.chatId&&(ee.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:ee=>{t!==me.chatId&&(ee.currentTarget.style.background="transparent")},children:[d.jsx(Hr,{state:de,size:6}),d.jsx("span",{className:"truncate text-body",style:{color:me.topic||me.summary?"var(--fg-2)":"var(--fg-4)"},children:me.topic||me.summary||`Chat · ${me.chatId.slice(0,8)}`})]},me.chatId)}),d.jsxs("button",{type:"button",onClick:()=>k.mutate(R.agentId),disabled:k.isPending,className:"w-full flex items-center text-left transition-colors text-body",style:{gap:6,padding:"var(--sp-1_75) var(--sp-2_5) var(--sp-1_75) var(--sp-7)",color:"var(--fg-3)"},onMouseEnter:me=>{me.currentTarget.style.background="var(--bg-hover)"},onMouseLeave:me=>{me.currentTarget.style.background="transparent"},children:[d.jsx(vi,{className:"h-3 w-3"}),"New chat"]})]})]},R.agentId)},M=j.length+E.length;return d.jsxs("aside",{className:"shrink-0 flex flex-col overflow-hidden",style:{width:268,background:"var(--bg-raised)",borderRight:"var(--hairline) solid var(--border)"},children:[d.jsxs("div",{className:"shrink-0",style:{padding:"var(--sp-2_5) var(--sp-3) var(--sp-2)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsx("div",{style:{marginBottom:8},children:d.jsxs("span",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-3)"},children:[C," members"]})}),d.jsxs("div",{className:"relative",children:[d.jsx(Qd,{className:"h-3.5 w-3.5 absolute pointer-events-none",style:{left:8,top:"50%",transform:"translateY(-50%)",color:"var(--fg-4)"}}),d.jsx("input",{value:m,onChange:R=>h(R.target.value),placeholder:"Filter…",className:"w-full outline-none text-body",style:{padding:"var(--sp-1_25) var(--sp-2) var(--sp-1_25) var(--sp-6_5)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",color:"var(--fg)"}})]}),d.jsx("div",{className:"flex gap-1",style:{marginTop:8},children:O.map(R=>d.jsx(tu,{active:g===R.value,count:R.count,warn:R.warn,onClick:()=>y(R.value),children:R.label},R.value))})]}),d.jsxs("div",{className:"shrink-0",style:{padding:"var(--sp-2) var(--sp-3)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsxs("div",{className:"flex items-center justify-between",style:{marginBottom:4},children:[d.jsxs("span",{className:"mono flex items-center gap-1.5 text-eyebrow",style:{color:"var(--fg-3)"},children:[d.jsx(Eq,{}),"5m"]}),d.jsx("span",{className:"mono text-body",style:{color:"var(--fg-4)"},children:f.stale?"stale":"live"})]}),d.jsx(Sq,{aggregated:f.aggregated,stale:f.stale}),d.jsxs("div",{className:"flex justify-between text-body",style:{marginTop:6},children:[d.jsxs("span",{className:"mono",style:{color:"var(--state-working)"},children:[T.working," working"]}),d.jsxs("span",{className:"mono",style:{color:"var(--state-blocked)"},children:[T.blocked," blocked"]}),d.jsxs("span",{className:"mono",style:{color:"var(--state-error)"},children:[T.error," error"]})]})]}),d.jsxs("div",{className:"flex-1 overflow-y-auto",children:[M===0&&d.jsx("div",{className:"text-center text-body",style:{padding:"var(--sp-6) var(--sp-3)",color:"var(--fg-3)"},children:m||g!=="all"?"No matches":"No agents"}),E.length>0&&d.jsxs("div",{children:[d.jsx(PS,{label:"Agents",count:E.length}),E.map(B)]}),j.length>0&&d.jsxs("div",{children:[d.jsx(PS,{label:"Humans",count:j.length}),j.map(B)]})]})]})}function PS({label:e,count:t}){return d.jsxs("div",{className:"mono uppercase sticky top-0 z-10 text-eyebrow",style:{padding:"var(--sp-1_25) var(--sp-3)",color:"var(--fg-4)",background:"var(--bg-raised)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[e," · ",t]})}function Eq(){return d.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",focusable:"false",style:{color:"var(--accent)"},children:[d.jsx("title",{children:"pulse"}),d.jsx("path",{d:"M1 8 h3 l1.5 -4 l3 8 l2 -4 h4.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]})}function Nq(){const[e,t]=Zd(),n=e.get("a"),a=e.get("c");Xj();const l=x.useCallback(f=>{t(f?{a:f}:{})},[t]),o=x.useCallback((f,m)=>{t({a:f,c:m})},[t]),{data:u}=Ve({queryKey:["agent-sessions",n],queryFn:()=>n?Hs(n):Promise.resolve([]),enabled:!!n&&!a});return x.useEffect(()=>{if(!n||a||!u||u.length===0)return;const f=[...u].filter(m=>m.state!=="evicted").sort((m,h)=>(h.lastActivityAt??"").localeCompare(m.lastActivityAt??""))[0];f&&t({a:n,c:f.chatId},{replace:!0})},[n,a,u,t]),d.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[d.jsx(Cq,{selectedAgentId:n,selectedChatId:a,onSelectAgent:l,onSelectChat:o}),d.jsx("main",{className:"flex-1 flex flex-col overflow-hidden min-w-0",style:{background:"var(--bg)"},children:d.jsx(gq,{selectedAgentId:n,selectedChatId:a})}),n&&d.jsx("aside",{className:"shrink-0 flex flex-col overflow-hidden",style:{width:290,borderLeft:"var(--hairline) solid var(--border)",background:"var(--bg-raised)"},children:d.jsx(bq,{selectedAgentId:n,selectedChatId:a})})]})}const _q=new g2({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}});function Aq(){return d.jsx(y2,{client:_q,children:d.jsx(dT,{children:d.jsx(WA,{children:d.jsxs(_A,{children:[d.jsx(Lr,{path:"/login",element:d.jsx(jF,{})}),d.jsx(Lr,{element:d.jsx(fT,{}),children:d.jsxs(Lr,{element:d.jsx(j6,{children:d.jsx(ZM,{})}),children:[d.jsx(Lr,{index:!0,element:d.jsx(Nq,{})}),d.jsx(Lr,{path:"agents",element:d.jsx(yF,{})}),d.jsx(Lr,{path:"agents/:uuid",element:d.jsx(tF,{})}),d.jsx(Lr,{path:"clients",element:d.jsx(SF,{})}),d.jsx(Lr,{path:"settings",element:d.jsx(PF,{})}),d.jsx(Lr,{path:"admin",element:d.jsx(F6,{})})]})})]})})})})}const kE=document.getElementById("root");if(!kE)throw new Error("Root element not found");Z_.createRoot(kE).render(d.jsx(x.StrictMode,{children:d.jsx(Aq,{})}));