@agent-team-foundation/first-tree-hub 0.10.6 → 0.10.7
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.
- package/dist/web/assets/{index-FAu90ACE.js → index-BADzOlHO.js} +4 -9
- package/dist/web/assets/index-BR-pWR44.css +1 -0
- package/dist/web/assets/index-CKiF80RI.js +388 -0
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/web/assets/index-5490TxIp.css +0 -1
- package/dist/web/assets/index-CJEdMYWd.js +0 -387
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
var Y0=e=>{throw TypeError(e)};var Ym=(e,t,n)=>t.has(e)||Y0("Cannot "+n);var L=(e,t,n)=>(Ym(e,t,"read from private field"),n?n.call(e):t.get(e)),je=(e,t,n)=>t.has(e)?Y0("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ve=(e,t,n,a)=>(Ym(e,t,"write to private field"),a?a.call(e,n):t.set(e,n),n),Me=(e,t,n)=>(Ym(e,t,"access private method"),n);var gd=(e,t,n,a)=>({set _(l){ve(e,t,l,n)},get _(){return L(e,t,a)}});function O2(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 c of o.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&a(c)}).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 df(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Xm={exports:{}},nu={};/**
|
|
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 X0;function D2(){if(X0)return nu;X0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(a,l,o){var c=null;if(o!==void 0&&(c=""+o),l.key!==void 0&&(c=""+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:c,ref:l!==void 0?l:null,props:o}}return nu.Fragment=t,nu.jsx=n,nu.jsxs=n,nu}var J0;function M2(){return J0||(J0=1,Xm.exports=D2()),Xm.exports}var u=M2(),Jm={exports:{}},Fe={};/**
|
|
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 W0;function L2(){if(W0)return Fe;W0=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"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),b=Symbol.iterator;function w(P){return P===null||typeof P!="object"?null:(P=b&&P[b]||P["@@iterator"],typeof P=="function"?P:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,E={};function C(P,B,T){this.props=P,this.context=B,this.refs=E,this.updater=T||k}C.prototype.isReactComponent={},C.prototype.setState=function(P,B){if(typeof P!="object"&&typeof P!="function"&&P!=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,P,B,"setState")},C.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function N(){}N.prototype=C.prototype;function z(P,B,T){this.props=P,this.context=B,this.refs=E,this.updater=T||k}var U=z.prototype=new N;U.constructor=z,j(U,C.prototype),U.isPureReactComponent=!0;var D=Array.isArray;function O(){}var M={H:null,A:null,T:null,S:null},I=Object.prototype.hasOwnProperty;function X(P,B,T){var q=T.ref;return{$$typeof:e,type:P,key:B,ref:q!==void 0?q:null,props:T}}function F(P,B){return X(P.type,B,P.props)}function W(P){return typeof P=="object"&&P!==null&&P.$$typeof===e}function ee(P){var B={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(T){return B[T]})}var ye=/\/+/g;function he(P,B){return typeof P=="object"&&P!==null&&P.key!=null?ee(""+P.key):B.toString(36)}function ne(P){switch(P.status){case"fulfilled":return P.value;case"rejected":throw P.reason;default:switch(typeof P.status=="string"?P.then(O,O):(P.status="pending",P.then(function(B){P.status==="pending"&&(P.status="fulfilled",P.value=B)},function(B){P.status==="pending"&&(P.status="rejected",P.reason=B)})),P.status){case"fulfilled":return P.value;case"rejected":throw P.reason}}throw P}function Z(P,B,T,q,K){var ce=typeof P;(ce==="undefined"||ce==="boolean")&&(P=null);var xe=!1;if(P===null)xe=!0;else switch(ce){case"bigint":case"string":case"number":xe=!0;break;case"object":switch(P.$$typeof){case e:case t:xe=!0;break;case y:return xe=P._init,Z(xe(P._payload),B,T,q,K)}}if(xe)return K=K(P),xe=q===""?"."+he(P,0):q,D(K)?(T="",xe!=null&&(T=xe.replace(ye,"$&/")+"/"),Z(K,B,T,"",function(Xe){return Xe})):K!=null&&(W(K)&&(K=F(K,T+(K.key==null||P&&P.key===K.key?"":(""+K.key).replace(ye,"$&/")+"/")+xe)),B.push(K)),1;xe=0;var we=q===""?".":q+":";if(D(P))for(var pe=0;pe<P.length;pe++)q=P[pe],ce=we+he(q,pe),xe+=Z(q,B,T,ce,K);else if(pe=w(P),typeof pe=="function")for(P=pe.call(P),pe=0;!(q=P.next()).done;)q=q.value,ce=we+he(q,pe++),xe+=Z(q,B,T,ce,K);else if(ce==="object"){if(typeof P.then=="function")return Z(ne(P),B,T,q,K);throw B=String(P),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys(P).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.")}return xe}function te(P,B,T){if(P==null)return P;var q=[],K=0;return Z(P,q,"","",function(ce){return B.call(T,ce,K++)}),q}function ie(P){if(P._status===-1){var B=P._result;B=B(),B.then(function(T){(P._status===0||P._status===-1)&&(P._status=1,P._result=T)},function(T){(P._status===0||P._status===-1)&&(P._status=2,P._result=T)}),P._status===-1&&(P._status=0,P._result=B)}if(P._status===1)return P._result.default;throw P._result}var ue=typeof reportError=="function"?reportError:function(P){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var B=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof P=="object"&&P!==null&&typeof P.message=="string"?String(P.message):String(P),error:P});if(!window.dispatchEvent(B))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",P);return}console.error(P)},A={map:te,forEach:function(P,B,T){te(P,function(){B.apply(this,arguments)},T)},count:function(P){var B=0;return te(P,function(){B++}),B},toArray:function(P){return te(P,function(B){return B})||[]},only:function(P){if(!W(P))throw Error("React.Children.only expected to receive a single React element child.");return P}};return Fe.Activity=g,Fe.Children=A,Fe.Component=C,Fe.Fragment=n,Fe.Profiler=l,Fe.PureComponent=z,Fe.StrictMode=a,Fe.Suspense=m,Fe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,Fe.__COMPILER_RUNTIME={__proto__:null,c:function(P){return M.H.useMemoCache(P)}},Fe.cache=function(P){return function(){return P.apply(null,arguments)}},Fe.cacheSignal=function(){return null},Fe.cloneElement=function(P,B,T){if(P==null)throw Error("The argument must be a React element, but you passed "+P+".");var q=j({},P.props),K=P.key;if(B!=null)for(ce in B.key!==void 0&&(K=""+B.key),B)!I.call(B,ce)||ce==="key"||ce==="__self"||ce==="__source"||ce==="ref"&&B.ref===void 0||(q[ce]=B[ce]);var ce=arguments.length-2;if(ce===1)q.children=T;else if(1<ce){for(var xe=Array(ce),we=0;we<ce;we++)xe[we]=arguments[we+2];q.children=xe}return X(P.type,K,q)},Fe.createContext=function(P){return P={$$typeof:c,_currentValue:P,_currentValue2:P,_threadCount:0,Provider:null,Consumer:null},P.Provider=P,P.Consumer={$$typeof:o,_context:P},P},Fe.createElement=function(P,B,T){var q,K={},ce=null;if(B!=null)for(q in B.key!==void 0&&(ce=""+B.key),B)I.call(B,q)&&q!=="key"&&q!=="__self"&&q!=="__source"&&(K[q]=B[q]);var xe=arguments.length-2;if(xe===1)K.children=T;else if(1<xe){for(var we=Array(xe),pe=0;pe<xe;pe++)we[pe]=arguments[pe+2];K.children=we}if(P&&P.defaultProps)for(q in xe=P.defaultProps,xe)K[q]===void 0&&(K[q]=xe[q]);return X(P,ce,K)},Fe.createRef=function(){return{current:null}},Fe.forwardRef=function(P){return{$$typeof:f,render:P}},Fe.isValidElement=W,Fe.lazy=function(P){return{$$typeof:y,_payload:{_status:-1,_result:P},_init:ie}},Fe.memo=function(P,B){return{$$typeof:h,type:P,compare:B===void 0?null:B}},Fe.startTransition=function(P){var B=M.T,T={};M.T=T;try{var q=P(),K=M.S;K!==null&&K(T,q),typeof q=="object"&&q!==null&&typeof q.then=="function"&&q.then(O,ue)}catch(ce){ue(ce)}finally{B!==null&&T.types!==null&&(B.types=T.types),M.T=B}},Fe.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},Fe.use=function(P){return M.H.use(P)},Fe.useActionState=function(P,B,T){return M.H.useActionState(P,B,T)},Fe.useCallback=function(P,B){return M.H.useCallback(P,B)},Fe.useContext=function(P){return M.H.useContext(P)},Fe.useDebugValue=function(){},Fe.useDeferredValue=function(P,B){return M.H.useDeferredValue(P,B)},Fe.useEffect=function(P,B){return M.H.useEffect(P,B)},Fe.useEffectEvent=function(P){return M.H.useEffectEvent(P)},Fe.useId=function(){return M.H.useId()},Fe.useImperativeHandle=function(P,B,T){return M.H.useImperativeHandle(P,B,T)},Fe.useInsertionEffect=function(P,B){return M.H.useInsertionEffect(P,B)},Fe.useLayoutEffect=function(P,B){return M.H.useLayoutEffect(P,B)},Fe.useMemo=function(P,B){return M.H.useMemo(P,B)},Fe.useOptimistic=function(P,B){return M.H.useOptimistic(P,B)},Fe.useReducer=function(P,B,T){return M.H.useReducer(P,B,T)},Fe.useRef=function(P){return M.H.useRef(P)},Fe.useState=function(P){return M.H.useState(P)},Fe.useSyncExternalStore=function(P,B,T){return M.H.useSyncExternalStore(P,B,T)},Fe.useTransition=function(){return M.H.useTransition()},Fe.version="19.2.4",Fe}var e1;function Zg(){return e1||(e1=1,Jm.exports=L2()),Jm.exports}var x=Zg();const I2=df(x),Vg=O2({__proto__:null,default:I2},[x]);var Wm={exports:{}},ru={},ep={exports:{}},tp={};/**
|
|
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 t1;function U2(){return t1||(t1=1,(function(e){function t(Z,te){var ie=Z.length;Z.push(te);e:for(;0<ie;){var ue=ie-1>>>1,A=Z[ue];if(0<l(A,te))Z[ue]=te,Z[ie]=A,ie=ue;else break e}}function n(Z){return Z.length===0?null:Z[0]}function a(Z){if(Z.length===0)return null;var te=Z[0],ie=Z.pop();if(ie!==te){Z[0]=ie;e:for(var ue=0,A=Z.length,P=A>>>1;ue<P;){var B=2*(ue+1)-1,T=Z[B],q=B+1,K=Z[q];if(0>l(T,ie))q<A&&0>l(K,T)?(Z[ue]=K,Z[q]=ie,ue=q):(Z[ue]=T,Z[B]=ie,ue=B);else if(q<A&&0>l(K,ie))Z[ue]=K,Z[q]=ie,ue=q;else break e}}return te}function l(Z,te){var ie=Z.sortIndex-te.sortIndex;return ie!==0?ie:Z.id-te.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 c=Date,f=c.now();e.unstable_now=function(){return c.now()-f}}var m=[],h=[],y=1,g=null,b=3,w=!1,k=!1,j=!1,E=!1,C=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,z=typeof setImmediate<"u"?setImmediate:null;function U(Z){for(var te=n(h);te!==null;){if(te.callback===null)a(h);else if(te.startTime<=Z)a(h),te.sortIndex=te.expirationTime,t(m,te);else break;te=n(h)}}function D(Z){if(j=!1,U(Z),!k)if(n(m)!==null)k=!0,O||(O=!0,ee());else{var te=n(h);te!==null&&ne(D,te.startTime-Z)}}var O=!1,M=-1,I=5,X=-1;function F(){return E?!0:!(e.unstable_now()-X<I)}function W(){if(E=!1,O){var Z=e.unstable_now();X=Z;var te=!0;try{e:{k=!1,j&&(j=!1,N(M),M=-1),w=!0;var ie=b;try{t:{for(U(Z),g=n(m);g!==null&&!(g.expirationTime>Z&&F());){var ue=g.callback;if(typeof ue=="function"){g.callback=null,b=g.priorityLevel;var A=ue(g.expirationTime<=Z);if(Z=e.unstable_now(),typeof A=="function"){g.callback=A,U(Z),te=!0;break t}g===n(m)&&a(m),U(Z)}else a(m);g=n(m)}if(g!==null)te=!0;else{var P=n(h);P!==null&&ne(D,P.startTime-Z),te=!1}}break e}finally{g=null,b=ie,w=!1}te=void 0}}finally{te?ee():O=!1}}}var ee;if(typeof z=="function")ee=function(){z(W)};else if(typeof MessageChannel<"u"){var ye=new MessageChannel,he=ye.port2;ye.port1.onmessage=W,ee=function(){he.postMessage(null)}}else ee=function(){C(W,0)};function ne(Z,te){M=C(function(){Z(e.unstable_now())},te)}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(Z){Z.callback=null},e.unstable_forceFrameRate=function(Z){0>Z||125<Z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<Z?Math.floor(1e3/Z):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(Z){switch(b){case 1:case 2:case 3:var te=3;break;default:te=b}var ie=b;b=te;try{return Z()}finally{b=ie}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(Z,te){switch(Z){case 1:case 2:case 3:case 4:case 5:break;default:Z=3}var ie=b;b=Z;try{return te()}finally{b=ie}},e.unstable_scheduleCallback=function(Z,te,ie){var ue=e.unstable_now();switch(typeof ie=="object"&&ie!==null?(ie=ie.delay,ie=typeof ie=="number"&&0<ie?ue+ie:ue):ie=ue,Z){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=ie+A,Z={id:y++,callback:te,priorityLevel:Z,startTime:ie,expirationTime:A,sortIndex:-1},ie>ue?(Z.sortIndex=ie,t(h,Z),n(m)===null&&Z===n(h)&&(j?(N(M),M=-1):j=!0,ne(D,ie-ue))):(Z.sortIndex=A,t(m,Z),k||w||(k=!0,O||(O=!0,ee()))),Z},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(Z){var te=b;return function(){var ie=b;b=te;try{return Z.apply(this,arguments)}finally{b=ie}}}})(tp)),tp}var n1;function P2(){return n1||(n1=1,ep.exports=U2()),ep.exports}var np={exports:{}},Cn={};/**
|
|
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 r1;function B2(){if(r1)return Cn;r1=1;var e=Zg();function t(m){var h="https://react.dev/errors/"+m;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)h+="&args[]="+encodeURIComponent(arguments[y])}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,y){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:g==null?null:""+g,children:m,containerInfo:h,implementation:y}}var c=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 Cn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Cn.createPortal=function(m,h){var y=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,y)},Cn.flushSync=function(m){var h=c.T,y=a.p;try{if(c.T=null,a.p=2,m)return m()}finally{c.T=h,a.p=y,a.d.f()}},Cn.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))},Cn.prefetchDNS=function(m){typeof m=="string"&&a.d.D(m)},Cn.preinit=function(m,h){if(typeof m=="string"&&h&&typeof h.as=="string"){var y=h.as,g=f(y,h.crossOrigin),b=typeof h.integrity=="string"?h.integrity:void 0,w=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;y==="style"?a.d.S(m,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:g,integrity:b,fetchPriority:w}):y==="script"&&a.d.X(m,{crossOrigin:g,integrity:b,fetchPriority:w,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Cn.preinitModule=function(m,h){if(typeof m=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var y=f(h.as,h.crossOrigin);a.d.M(m,{crossOrigin:y,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)},Cn.preload=function(m,h){if(typeof m=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var y=h.as,g=f(y,h.crossOrigin);a.d.L(m,y,{crossOrigin:g,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})}},Cn.preloadModule=function(m,h){if(typeof m=="string")if(h){var y=f(h.as,h.crossOrigin);a.d.m(m,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else a.d.m(m)},Cn.requestFormReset=function(m){a.d.r(m)},Cn.unstable_batchedUpdates=function(m,h){return m(h)},Cn.useFormState=function(m,h,y){return c.H.useFormState(m,h,y)},Cn.useFormStatus=function(){return c.H.useHostTransitionStatus()},Cn.version="19.2.4",Cn}var a1;function HS(){if(a1)return np.exports;a1=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(),np.exports=B2(),np.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 i1;function $2(){if(i1)return ru;i1=1;var e=P2(),t=Zg(),n=HS();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 c(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,d=i;;){var p=s.return;if(p===null)break;var v=p.alternate;if(v===null){if(d=p.return,d!==null){s=d;continue}break}if(p.child===v.child){for(v=p.child;v;){if(v===s)return m(p),r;if(v===d)return m(p),i;v=v.sibling}throw Error(a(188))}if(s.return!==d.return)s=p,d=v;else{for(var S=!1,_=p.child;_;){if(_===s){S=!0,s=p,d=v;break}if(_===d){S=!0,d=p,s=v;break}_=_.sibling}if(!S){for(_=v.child;_;){if(_===s){S=!0,s=v,d=p;break}if(_===d){S=!0,d=v,s=p;break}_=_.sibling}if(!S)throw Error(a(189))}}if(s.alternate!==d)throw Error(a(190))}if(s.tag!==3)throw Error(a(188));return s.stateNode.current===s?r:i}function y(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r;for(r=r.child;r!==null;){if(i=y(r),i!==null)return i;r=r.sibling}return null}var g=Object.assign,b=Symbol.for("react.element"),w=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"),N=Symbol.for("react.consumer"),z=Symbol.for("react.context"),U=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),X=Symbol.for("react.activity"),F=Symbol.for("react.memo_cache_sentinel"),W=Symbol.iterator;function ee(r){return r===null||typeof r!="object"?null:(r=W&&r[W]||r["@@iterator"],typeof r=="function"?r:null)}var ye=Symbol.for("react.client.reference");function he(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===ye?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 D:return"Suspense";case O:return"SuspenseList";case X:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case k:return"Portal";case z:return r.displayName||"Context";case N:return(r._context.displayName||"Context")+".Consumer";case U:var i=r.render;return r=r.displayName,r||(r=i.displayName||i.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case M:return i=r.displayName||null,i!==null?i:he(r.type)||"Memo";case I:i=r._payload,r=r._init;try{return he(r(i))}catch{}}return null}var ne=Array.isArray,Z=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ie={pending:!1,data:null,method:null,action:null},ue=[],A=-1;function P(r){return{current:r}}function B(r){0>A||(r.current=ue[A],ue[A]=null,A--)}function T(r,i){A++,ue[A]=r.current,r.current=i}var q=P(null),K=P(null),ce=P(null),xe=P(null);function we(r,i){switch(T(ce,i),T(K,r),T(q,null),i.nodeType){case 9:case 11:r=(r=i.documentElement)&&(r=r.namespaceURI)?b0(r):0;break;default:if(r=i.tagName,i=i.namespaceURI)i=b0(i),r=x0(i,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}B(q),T(q,r)}function pe(){B(q),B(K),B(ce)}function Xe(r){r.memoizedState!==null&&T(xe,r);var i=q.current,s=x0(i,r.type);i!==s&&(T(K,r),T(q,s))}function Le(r){K.current===r&&(B(q),B(K)),xe.current===r&&(B(xe),Jo._currentValue=ie)}var re,Ee;function Ie(r){if(re===void 0)try{throw Error()}catch(s){var i=s.stack.trim().match(/\n( *(at )?)/);re=i&&i[1]||"",Ee=-1<s.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+re+r+Ee}var Pe=!1;function Lt(r,i){if(!r||Pe)return"";Pe=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(i){var de=function(){throw Error()};if(Object.defineProperty(de.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(de,[])}catch(J){var Y=J}Reflect.construct(r,[],de)}else{try{de.call()}catch(J){Y=J}r.call(de.prototype)}}else{try{throw Error()}catch(J){Y=J}(de=r())&&typeof de.catch=="function"&&de.catch(function(){})}}catch(J){if(J&&Y&&typeof J.stack=="string")return[J.stack,Y.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=d.DetermineComponentFrameRoot(),S=v[0],_=v[1];if(S&&_){var $=S.split(`
|
|
44
|
+
`),G=_.split(`
|
|
45
|
+
`);for(p=d=0;d<$.length&&!$[d].includes("DetermineComponentFrameRoot");)d++;for(;p<G.length&&!G[p].includes("DetermineComponentFrameRoot");)p++;if(d===$.length||p===G.length)for(d=$.length-1,p=G.length-1;1<=d&&0<=p&&$[d]!==G[p];)p--;for(;1<=d&&0<=p;d--,p--)if($[d]!==G[p]){if(d!==1||p!==1)do if(d--,p--,0>p||$[d]!==G[p]){var ae=`
|
|
46
|
+
`+$[d].replace(" at new "," at ");return r.displayName&&ae.includes("<anonymous>")&&(ae=ae.replace("<anonymous>",r.displayName)),ae}while(1<=d&&0<=p);break}}}finally{Pe=!1,Error.prepareStackTrace=s}return(s=r?r.displayName||r.name:"")?Ie(s):""}function fn(r,i){switch(r.tag){case 26:case 27:case 5:return Ie(r.type);case 16:return Ie("Lazy");case 13:return r.child!==i&&i!==null?Ie("Suspense Fallback"):Ie("Suspense");case 19:return Ie("SuspenseList");case 0:case 15:return Lt(r.type,!1);case 11:return Lt(r.type.render,!1);case 1:return Lt(r.type,!0);case 31:return Ie("Activity");default:return""}}function _l(r){try{var i="",s=null;do i+=fn(r,s),s=r,r=r.return;while(r);return i}catch(d){return`
|
|
47
|
+
Error generating stack: `+d.message+`
|
|
48
|
+
`+d.stack}}var Ma=Object.prototype.hasOwnProperty,La=e.unstable_scheduleCallback,na=e.unstable_cancelCallback,oo=e.unstable_shouldYield,uo=e.unstable_requestPaint,hn=e.unstable_now,co=e.unstable_getCurrentPriorityLevel,le=e.unstable_ImmediatePriority,be=e.unstable_UserBlockingPriority,Ue=e.unstable_NormalPriority,$e=e.unstable_LowPriority,at=e.unstable_IdlePriority,mn=e.log,fr=e.unstable_setDisableYieldValue,nn=null,Zt=null;function pn(r){if(typeof mn=="function"&&fr(r),Zt&&typeof Zt.setStrictMode=="function")try{Zt.setStrictMode(nn,r)}catch{}}var ht=Math.clz32?Math.clz32:tc,zr=Math.log,Ln=Math.LN2;function tc(r){return r>>>=0,r===0?32:31-(zr(r)/Ln|0)|0}var Li=256,Ii=262144,Ui=4194304;function Pr(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 Pi(r,i,s){var d=r.pendingLanes;if(d===0)return 0;var p=0,v=r.suspendedLanes,S=r.pingedLanes;r=r.warmLanes;var _=d&134217727;return _!==0?(d=_&~v,d!==0?p=Pr(d):(S&=_,S!==0?p=Pr(S):s||(s=_&~r,s!==0&&(p=Pr(s))))):(_=d&~v,_!==0?p=Pr(_):S!==0?p=Pr(S):s||(s=d&~r,s!==0&&(p=Pr(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 Ia(r,i){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&i)===0}function nc(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 Se(){var r=Ui;return Ui<<=1,(Ui&62914560)===0&&(Ui=4194304),r}function Je(r){for(var i=[],s=0;31>s;s++)i.push(r);return i}function gn(r,i){r.pendingLanes|=i,i!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function ra(r,i,s,d,p,v){var S=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 _=r.entanglements,$=r.expirationTimes,G=r.hiddenUpdates;for(s=S&~s;0<s;){var ae=31-ht(s),de=1<<ae;_[ae]=0,$[ae]=-1;var Y=G[ae];if(Y!==null)for(G[ae]=null,ae=0;ae<Y.length;ae++){var J=Y[ae];J!==null&&(J.lane&=-536870913)}s&=~de}d!==0&&fo(r,d,0),v!==0&&p===0&&r.tag!==0&&(r.suspendedLanes|=v&~(S&~i))}function fo(r,i,s){r.pendingLanes|=i,r.suspendedLanes&=~i;var d=31-ht(i);r.entangledLanes|=i,r.entanglements[d]=r.entanglements[d]|1073741824|s&261930}function rc(r,i){var s=r.entangledLanes|=i;for(r=r.entanglements;s;){var d=31-ht(s),p=1<<d;p&i|r[d]&i&&(r[d]|=i),s&=~p}}function rv(r,i){var s=i&-i;return s=(s&42)!==0?1:Pf(s),(s&(r.suspendedLanes|i))!==0?0:s}function Pf(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 Bf(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function av(){var r=te.p;return r!==0?r:(r=window.event,r===void 0?32:q0(r.type))}function iv(r,i){var s=te.p;try{return te.p=r,i()}finally{te.p=s}}var Ua=Math.random().toString(36).slice(2),yn="__reactFiber$"+Ua,In="__reactProps$"+Ua,Tl="__reactContainer$"+Ua,$f="__reactEvents$"+Ua,SN="__reactListeners$"+Ua,kN="__reactHandles$"+Ua,lv="__reactResources$"+Ua,ho="__reactMarker$"+Ua;function Ff(r){delete r[yn],delete r[In],delete r[$f],delete r[SN],delete r[kN]}function Al(r){var i=r[yn];if(i)return i;for(var s=r.parentNode;s;){if(i=s[Tl]||s[yn]){if(s=i.alternate,i.child!==null||s!==null&&s.child!==null)for(r=N0(r);r!==null;){if(s=r[yn])return s;r=N0(r)}return i}r=s,s=r.parentNode}return null}function Rl(r){if(r=r[yn]||r[Tl]){var i=r.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return r}return null}function mo(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r.stateNode;throw Error(a(33))}function zl(r){var i=r[lv];return i||(i=r[lv]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function on(r){r[ho]=!0}var sv=new Set,ov={};function Bi(r,i){Ol(r,i),Ol(r+"Capture",i)}function Ol(r,i){for(ov[r]=i,r=0;r<i.length;r++)sv.add(i[r])}var jN=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]*$"),uv={},cv={};function CN(r){return Ma.call(cv,r)?!0:Ma.call(uv,r)?!1:jN.test(r)?cv[r]=!0:(uv[r]=!0,!1)}function ac(r,i,s){if(CN(i))if(s===null)r.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":r.removeAttribute(i);return;case"boolean":var d=i.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="aria-"){r.removeAttribute(i);return}}r.setAttribute(i,""+s)}}function ic(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 aa(r,i,s,d){if(d===null)r.removeAttribute(s);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(s);return}r.setAttributeNS(i,s,""+d)}}function hr(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function dv(r){var i=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function EN(r,i,s){var d=Object.getOwnPropertyDescriptor(r.constructor.prototype,i);if(!r.hasOwnProperty(i)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var p=d.get,v=d.set;return Object.defineProperty(r,i,{configurable:!0,get:function(){return p.call(this)},set:function(S){s=""+S,v.call(this,S)}}),Object.defineProperty(r,i,{enumerable:d.enumerable}),{getValue:function(){return s},setValue:function(S){s=""+S},stopTracking:function(){r._valueTracker=null,delete r[i]}}}}function qf(r){if(!r._valueTracker){var i=dv(r)?"checked":"value";r._valueTracker=EN(r,i,""+r[i])}}function fv(r){if(!r)return!1;var i=r._valueTracker;if(!i)return!0;var s=i.getValue(),d="";return r&&(d=dv(r)?r.checked?"true":"false":r.value),r=d,r!==s?(i.setValue(r),!0):!1}function lc(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 NN=/[\n"\\]/g;function mr(r){return r.replace(NN,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Hf(r,i,s,d,p,v,S,_){r.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?r.type=S:r.removeAttribute("type"),i!=null?S==="number"?(i===0&&r.value===""||r.value!=i)&&(r.value=""+hr(i)):r.value!==""+hr(i)&&(r.value=""+hr(i)):S!=="submit"&&S!=="reset"||r.removeAttribute("value"),i!=null?Zf(r,S,hr(i)):s!=null?Zf(r,S,hr(s)):d!=null&&r.removeAttribute("value"),p==null&&v!=null&&(r.defaultChecked=!!v),p!=null&&(r.checked=p&&typeof p!="function"&&typeof p!="symbol"),_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?r.name=""+hr(_):r.removeAttribute("name")}function hv(r,i,s,d,p,v,S,_){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)){qf(r);return}s=s!=null?""+hr(s):"",i=i!=null?""+hr(i):s,_||i===r.value||(r.value=i),r.defaultValue=i}d=d??p,d=typeof d!="function"&&typeof d!="symbol"&&!!d,r.checked=_?r.checked:!!d,r.defaultChecked=!!d,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(r.name=S),qf(r)}function Zf(r,i,s){i==="number"&&lc(r.ownerDocument)===r||r.defaultValue===""+s||(r.defaultValue=""+s)}function Dl(r,i,s,d){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&&d&&(r[s].defaultSelected=!0)}else{for(s=""+hr(s),i=null,p=0;p<r.length;p++){if(r[p].value===s){r[p].selected=!0,d&&(r[p].defaultSelected=!0);return}i!==null||r[p].disabled||(i=r[p])}i!==null&&(i.selected=!0)}}function mv(r,i,s){if(i!=null&&(i=""+hr(i),i!==r.value&&(r.value=i),s==null)){r.defaultValue!==i&&(r.defaultValue=i);return}r.defaultValue=s!=null?""+hr(s):""}function pv(r,i,s,d){if(i==null){if(d!=null){if(s!=null)throw Error(a(92));if(ne(d)){if(1<d.length)throw Error(a(93));d=d[0]}s=d}s==null&&(s=""),i=s}s=hr(i),r.defaultValue=s,d=r.textContent,d===s&&d!==""&&d!==null&&(r.value=d),qf(r)}function Ml(r,i){if(i){var s=r.firstChild;if(s&&s===r.lastChild&&s.nodeType===3){s.nodeValue=i;return}}r.textContent=i}var _N=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 gv(r,i,s){var d=i.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?d?r.setProperty(i,""):i==="float"?r.cssFloat="":r[i]="":d?r.setProperty(i,s):typeof s!="number"||s===0||_N.has(i)?i==="float"?r.cssFloat=s:r[i]=(""+s).trim():r[i]=s+"px"}function yv(r,i,s){if(i!=null&&typeof i!="object")throw Error(a(62));if(r=r.style,s!=null){for(var d in s)!s.hasOwnProperty(d)||i!=null&&i.hasOwnProperty(d)||(d.indexOf("--")===0?r.setProperty(d,""):d==="float"?r.cssFloat="":r[d]="");for(var p in i)d=i[p],i.hasOwnProperty(p)&&s[p]!==d&&gv(r,p,d)}else for(var v in i)i.hasOwnProperty(v)&&gv(r,v,i[v])}function Vf(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 TN=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"]]),AN=/^[\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 sc(r){return AN.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function ia(){}var Qf=null;function Gf(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Ll=null,Il=null;function vv(r){var i=Rl(r);if(i&&(r=i.stateNode)){var s=r[In]||null;e:switch(r=i.stateNode,i.type){case"input":if(Hf(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="'+mr(""+i)+'"][type="radio"]'),i=0;i<s.length;i++){var d=s[i];if(d!==r&&d.form===r.form){var p=d[In]||null;if(!p)throw Error(a(90));Hf(d,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(i=0;i<s.length;i++)d=s[i],d.form===r.form&&fv(d)}break e;case"textarea":mv(r,s.value,s.defaultValue);break e;case"select":i=s.value,i!=null&&Dl(r,!!s.multiple,i,!1)}}}var Kf=!1;function bv(r,i,s){if(Kf)return r(i,s);Kf=!0;try{var d=r(i);return d}finally{if(Kf=!1,(Ll!==null||Il!==null)&&(Gc(),Ll&&(i=Ll,r=Il,Il=Ll=null,vv(i),r)))for(i=0;i<r.length;i++)vv(r[i])}}function po(r,i){var s=r.stateNode;if(s===null)return null;var d=s[In]||null;if(d===null)return null;s=d[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":(d=!d.disabled)||(r=r.type,d=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!d;break e;default:r=!1}if(r)return null;if(s&&typeof s!="function")throw Error(a(231,i,typeof s));return s}var la=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Yf=!1;if(la)try{var go={};Object.defineProperty(go,"passive",{get:function(){Yf=!0}}),window.addEventListener("test",go,go),window.removeEventListener("test",go,go)}catch{Yf=!1}var Pa=null,Xf=null,oc=null;function xv(){if(oc)return oc;var r,i=Xf,s=i.length,d,p="value"in Pa?Pa.value:Pa.textContent,v=p.length;for(r=0;r<s&&i[r]===p[r];r++);var S=s-r;for(d=1;d<=S&&i[s-d]===p[v-d];d++);return oc=p.slice(r,1<d?1-d:void 0)}function uc(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 cc(){return!0}function wv(){return!1}function Un(r){function i(s,d,p,v,S){this._reactName=s,this._targetInst=p,this.type=d,this.nativeEvent=v,this.target=S,this.currentTarget=null;for(var _ in r)r.hasOwnProperty(_)&&(s=r[_],this[_]=s?s(v):v[_]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?cc:wv,this.isPropagationStopped=wv,this}return g(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=cc)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=cc)},persist:function(){},isPersistent:cc}),i}var $i={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},dc=Un($i),yo=g({},$i,{view:0,detail:0}),RN=Un(yo),Jf,Wf,vo,fc=g({},yo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:th,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!==vo&&(vo&&r.type==="mousemove"?(Jf=r.screenX-vo.screenX,Wf=r.screenY-vo.screenY):Wf=Jf=0,vo=r),Jf)},movementY:function(r){return"movementY"in r?r.movementY:Wf}}),Sv=Un(fc),zN=g({},fc,{dataTransfer:0}),ON=Un(zN),DN=g({},yo,{relatedTarget:0}),eh=Un(DN),MN=g({},$i,{animationName:0,elapsedTime:0,pseudoElement:0}),LN=Un(MN),IN=g({},$i,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),UN=Un(IN),PN=g({},$i,{data:0}),kv=Un(PN),BN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},$N={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"},FN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function qN(r){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(r):(r=FN[r])?!!i[r]:!1}function th(){return qN}var HN=g({},yo,{key:function(r){if(r.key){var i=BN[r.key]||r.key;if(i!=="Unidentified")return i}return r.type==="keypress"?(r=uc(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?$N[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:th,charCode:function(r){return r.type==="keypress"?uc(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?uc(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),ZN=Un(HN),VN=g({},fc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),jv=Un(VN),QN=g({},yo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:th}),GN=Un(QN),KN=g({},$i,{propertyName:0,elapsedTime:0,pseudoElement:0}),YN=Un(KN),XN=g({},fc,{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}),JN=Un(XN),WN=g({},$i,{newState:0,oldState:0}),e_=Un(WN),t_=[9,13,27,32],nh=la&&"CompositionEvent"in window,bo=null;la&&"documentMode"in document&&(bo=document.documentMode);var n_=la&&"TextEvent"in window&&!bo,Cv=la&&(!nh||bo&&8<bo&&11>=bo),Ev=" ",Nv=!1;function _v(r,i){switch(r){case"keyup":return t_.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Tv(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Ul=!1;function r_(r,i){switch(r){case"compositionend":return Tv(i);case"keypress":return i.which!==32?null:(Nv=!0,Ev);case"textInput":return r=i.data,r===Ev&&Nv?null:r;default:return null}}function a_(r,i){if(Ul)return r==="compositionend"||!nh&&_v(r,i)?(r=xv(),oc=Xf=Pa=null,Ul=!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 Cv&&i.locale!=="ko"?null:i.data;default:return null}}var i_={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 Av(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i==="input"?!!i_[r.type]:i==="textarea"}function Rv(r,i,s,d){Ll?Il?Il.push(d):Il=[d]:Ll=d,i=td(i,"onChange"),0<i.length&&(s=new dc("onChange","change",null,s,d),r.push({event:s,listeners:i}))}var xo=null,wo=null;function l_(r){h0(r,0)}function hc(r){var i=mo(r);if(fv(i))return r}function zv(r,i){if(r==="change")return i}var Ov=!1;if(la){var rh;if(la){var ah="oninput"in document;if(!ah){var Dv=document.createElement("div");Dv.setAttribute("oninput","return;"),ah=typeof Dv.oninput=="function"}rh=ah}else rh=!1;Ov=rh&&(!document.documentMode||9<document.documentMode)}function Mv(){xo&&(xo.detachEvent("onpropertychange",Lv),wo=xo=null)}function Lv(r){if(r.propertyName==="value"&&hc(wo)){var i=[];Rv(i,wo,r,Gf(r)),bv(l_,i)}}function s_(r,i,s){r==="focusin"?(Mv(),xo=i,wo=s,xo.attachEvent("onpropertychange",Lv)):r==="focusout"&&Mv()}function o_(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return hc(wo)}function u_(r,i){if(r==="click")return hc(i)}function c_(r,i){if(r==="input"||r==="change")return hc(i)}function d_(r,i){return r===i&&(r!==0||1/r===1/i)||r!==r&&i!==i}var Xn=typeof Object.is=="function"?Object.is:d_;function So(r,i){if(Xn(r,i))return!0;if(typeof r!="object"||r===null||typeof i!="object"||i===null)return!1;var s=Object.keys(r),d=Object.keys(i);if(s.length!==d.length)return!1;for(d=0;d<s.length;d++){var p=s[d];if(!Ma.call(i,p)||!Xn(r[p],i[p]))return!1}return!0}function Iv(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Uv(r,i){var s=Iv(r);r=0;for(var d;s;){if(s.nodeType===3){if(d=r+s.textContent.length,r<=i&&d>=i)return{node:s,offset:i-r};r=d}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Iv(s)}}function Pv(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?Pv(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function Bv(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var i=lc(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=lc(r.document)}return i}function ih(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 f_=la&&"documentMode"in document&&11>=document.documentMode,Pl=null,lh=null,ko=null,sh=!1;function $v(r,i,s){var d=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;sh||Pl==null||Pl!==lc(d)||(d=Pl,"selectionStart"in d&&ih(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),ko&&So(ko,d)||(ko=d,d=td(lh,"onSelect"),0<d.length&&(i=new dc("onSelect","select",null,i,s),r.push({event:i,listeners:d}),i.target=Pl)))}function Fi(r,i){var s={};return s[r.toLowerCase()]=i.toLowerCase(),s["Webkit"+r]="webkit"+i,s["Moz"+r]="moz"+i,s}var Bl={animationend:Fi("Animation","AnimationEnd"),animationiteration:Fi("Animation","AnimationIteration"),animationstart:Fi("Animation","AnimationStart"),transitionrun:Fi("Transition","TransitionRun"),transitionstart:Fi("Transition","TransitionStart"),transitioncancel:Fi("Transition","TransitionCancel"),transitionend:Fi("Transition","TransitionEnd")},oh={},Fv={};la&&(Fv=document.createElement("div").style,"AnimationEvent"in window||(delete Bl.animationend.animation,delete Bl.animationiteration.animation,delete Bl.animationstart.animation),"TransitionEvent"in window||delete Bl.transitionend.transition);function qi(r){if(oh[r])return oh[r];if(!Bl[r])return r;var i=Bl[r],s;for(s in i)if(i.hasOwnProperty(s)&&s in Fv)return oh[r]=i[s];return r}var qv=qi("animationend"),Hv=qi("animationiteration"),Zv=qi("animationstart"),h_=qi("transitionrun"),m_=qi("transitionstart"),p_=qi("transitioncancel"),Vv=qi("transitionend"),Qv=new Map,uh="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(" ");uh.push("scrollEnd");function Or(r,i){Qv.set(r,i),Bi(i,[r])}var mc=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)},pr=[],$l=0,ch=0;function pc(){for(var r=$l,i=ch=$l=0;i<r;){var s=pr[i];pr[i++]=null;var d=pr[i];pr[i++]=null;var p=pr[i];pr[i++]=null;var v=pr[i];if(pr[i++]=null,d!==null&&p!==null){var S=d.pending;S===null?p.next=p:(p.next=S.next,S.next=p),d.pending=p}v!==0&&Gv(s,p,v)}}function gc(r,i,s,d){pr[$l++]=r,pr[$l++]=i,pr[$l++]=s,pr[$l++]=d,ch|=d,r.lanes|=d,r=r.alternate,r!==null&&(r.lanes|=d)}function dh(r,i,s,d){return gc(r,i,s,d),yc(r)}function Hi(r,i){return gc(r,null,null,i),yc(r)}function Gv(r,i,s){r.lanes|=s;var d=r.alternate;d!==null&&(d.lanes|=s);for(var p=!1,v=r.return;v!==null;)v.childLanes|=s,d=v.alternate,d!==null&&(d.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-ht(s),r=v.hiddenUpdates,d=r[p],d===null?r[p]=[i]:d.push(i),i.lane=s|536870912),v):null}function yc(r){if(50<Zo)throw Zo=0,xm=null,Error(a(185));for(var i=r.return;i!==null;)r=i,i=r.return;return r.tag===3?r.stateNode:null}var Fl={};function g_(r,i,s,d){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=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Jn(r,i,s,d){return new g_(r,i,s,d)}function fh(r){return r=r.prototype,!(!r||!r.isReactComponent)}function sa(r,i){var s=r.alternate;return s===null?(s=Jn(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 Kv(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 vc(r,i,s,d,p,v){var S=0;if(d=r,typeof r=="function")fh(r)&&(S=1);else if(typeof r=="string")S=w2(r,s,q.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case X:return r=Jn(31,s,i,p),r.elementType=X,r.lanes=v,r;case j:return Zi(s.children,p,v,i);case E:S=8,p|=24;break;case C:return r=Jn(12,s,i,p|2),r.elementType=C,r.lanes=v,r;case D:return r=Jn(13,s,i,p),r.elementType=D,r.lanes=v,r;case O:return r=Jn(19,s,i,p),r.elementType=O,r.lanes=v,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case z:S=10;break e;case N:S=9;break e;case U:S=11;break e;case M:S=14;break e;case I:S=16,d=null;break e}S=29,s=Error(a(130,r===null?"null":typeof r,"")),d=null}return i=Jn(S,s,i,p),i.elementType=r,i.type=d,i.lanes=v,i}function Zi(r,i,s,d){return r=Jn(7,r,d,i),r.lanes=s,r}function hh(r,i,s){return r=Jn(6,r,null,i),r.lanes=s,r}function Yv(r){var i=Jn(18,null,null,0);return i.stateNode=r,i}function mh(r,i,s){return i=Jn(4,r.children!==null?r.children:[],r.key,i),i.lanes=s,i.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},i}var Xv=new WeakMap;function gr(r,i){if(typeof r=="object"&&r!==null){var s=Xv.get(r);return s!==void 0?s:(i={value:r,source:i,stack:_l(i)},Xv.set(r,i),i)}return{value:r,source:i,stack:_l(i)}}var ql=[],Hl=0,bc=null,jo=0,yr=[],vr=0,Ba=null,Br=1,$r="";function oa(r,i){ql[Hl++]=jo,ql[Hl++]=bc,bc=r,jo=i}function Jv(r,i,s){yr[vr++]=Br,yr[vr++]=$r,yr[vr++]=Ba,Ba=r;var d=Br;r=$r;var p=32-ht(d)-1;d&=~(1<<p),s+=1;var v=32-ht(i)+p;if(30<v){var S=p-p%5;v=(d&(1<<S)-1).toString(32),d>>=S,p-=S,Br=1<<32-ht(i)+p|s<<p|d,$r=v+r}else Br=1<<v|s<<p|d,$r=r}function ph(r){r.return!==null&&(oa(r,1),Jv(r,1,0))}function gh(r){for(;r===bc;)bc=ql[--Hl],ql[Hl]=null,jo=ql[--Hl],ql[Hl]=null;for(;r===Ba;)Ba=yr[--vr],yr[vr]=null,$r=yr[--vr],yr[vr]=null,Br=yr[--vr],yr[vr]=null}function Wv(r,i){yr[vr++]=Br,yr[vr++]=$r,yr[vr++]=Ba,Br=i.id,$r=i.overflow,Ba=r}var vn=null,Nt=null,it=!1,$a=null,br=!1,yh=Error(a(519));function Fa(r){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Co(gr(i,r)),yh}function eb(r){var i=r.stateNode,s=r.type,d=r.memoizedProps;switch(i[yn]=r,i[In]=d,s){case"dialog":et("cancel",i),et("close",i);break;case"iframe":case"object":case"embed":et("load",i);break;case"video":case"audio":for(s=0;s<Qo.length;s++)et(Qo[s],i);break;case"source":et("error",i);break;case"img":case"image":case"link":et("error",i),et("load",i);break;case"details":et("toggle",i);break;case"input":et("invalid",i),hv(i,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0);break;case"select":et("invalid",i);break;case"textarea":et("invalid",i),pv(i,d.value,d.defaultValue,d.children)}s=d.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||i.textContent===""+s||d.suppressHydrationWarning===!0||y0(i.textContent,s)?(d.popover!=null&&(et("beforetoggle",i),et("toggle",i)),d.onScroll!=null&&et("scroll",i),d.onScrollEnd!=null&&et("scrollend",i),d.onClick!=null&&(i.onclick=ia),i=!0):i=!1,i||Fa(r,!0)}function tb(r){for(vn=r.return;vn;)switch(vn.tag){case 5:case 31:case 13:br=!1;return;case 27:case 3:br=!0;return;default:vn=vn.return}}function Zl(r){if(r!==vn)return!1;if(!it)return tb(r),it=!0,!1;var i=r.tag,s;if((s=i!==3&&i!==27)&&((s=i===5)&&(s=r.type,s=!(s!=="form"&&s!=="button")||Mm(r.type,r.memoizedProps)),s=!s),s&&Nt&&Fa(r),tb(r),i===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));Nt=E0(r)}else if(i===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));Nt=E0(r)}else i===27?(i=Nt,ni(r.type)?(r=Bm,Bm=null,Nt=r):Nt=i):Nt=vn?wr(r.stateNode.nextSibling):null;return!0}function Vi(){Nt=vn=null,it=!1}function vh(){var r=$a;return r!==null&&(Fn===null?Fn=r:Fn.push.apply(Fn,r),$a=null),r}function Co(r){$a===null?$a=[r]:$a.push(r)}var bh=P(null),Qi=null,ua=null;function qa(r,i,s){T(bh,i._currentValue),i._currentValue=s}function ca(r){r._currentValue=bh.current,B(bh)}function xh(r,i,s){for(;r!==null;){var d=r.alternate;if((r.childLanes&i)!==i?(r.childLanes|=i,d!==null&&(d.childLanes|=i)):d!==null&&(d.childLanes&i)!==i&&(d.childLanes|=i),r===s)break;r=r.return}}function wh(r,i,s,d){var p=r.child;for(p!==null&&(p.return=r);p!==null;){var v=p.dependencies;if(v!==null){var S=p.child;v=v.firstContext;e:for(;v!==null;){var _=v;v=p;for(var $=0;$<i.length;$++)if(_.context===i[$]){v.lanes|=s,_=v.alternate,_!==null&&(_.lanes|=s),xh(v.return,s,r),d||(S=null);break e}v=_.next}}else if(p.tag===18){if(S=p.return,S===null)throw Error(a(341));S.lanes|=s,v=S.alternate,v!==null&&(v.lanes|=s),xh(S,s,r),S=null}else S=p.child;if(S!==null)S.return=p;else for(S=p;S!==null;){if(S===r){S=null;break}if(p=S.sibling,p!==null){p.return=S.return,S=p;break}S=S.return}p=S}}function Vl(r,i,s,d){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 S=p.alternate;if(S===null)throw Error(a(387));if(S=S.memoizedProps,S!==null){var _=p.type;Xn(p.pendingProps.value,S.value)||(r!==null?r.push(_):r=[_])}}else if(p===xe.current){if(S=p.alternate,S===null)throw Error(a(387));S.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(r!==null?r.push(Jo):r=[Jo])}p=p.return}r!==null&&wh(i,r,s,d),i.flags|=262144}function xc(r){for(r=r.firstContext;r!==null;){if(!Xn(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function Gi(r){Qi=r,ua=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function bn(r){return nb(Qi,r)}function wc(r,i){return Qi===null&&Gi(r),nb(r,i)}function nb(r,i){var s=i._currentValue;if(i={context:i,memoizedValue:s,next:null},ua===null){if(r===null)throw Error(a(308));ua=i,r.dependencies={lanes:0,firstContext:i},r.flags|=524288}else ua=ua.next=i;return s}var y_=typeof AbortController<"u"?AbortController:function(){var r=[],i=this.signal={aborted:!1,addEventListener:function(s,d){r.push(d)}};this.abort=function(){i.aborted=!0,r.forEach(function(s){return s()})}},v_=e.unstable_scheduleCallback,b_=e.unstable_NormalPriority,Kt={$$typeof:z,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Sh(){return{controller:new y_,data:new Map,refCount:0}}function Eo(r){r.refCount--,r.refCount===0&&v_(b_,function(){r.controller.abort()})}var No=null,kh=0,Ql=0,Gl=null;function x_(r,i){if(No===null){var s=No=[];kh=0,Ql=Em(),Gl={status:"pending",value:void 0,then:function(d){s.push(d)}}}return kh++,i.then(rb,rb),i}function rb(){if(--kh===0&&No!==null){Gl!==null&&(Gl.status="fulfilled");var r=No;No=null,Ql=0,Gl=null;for(var i=0;i<r.length;i++)(0,r[i])()}}function w_(r,i){var s=[],d={status:"pending",value:null,reason:null,then:function(p){s.push(p)}};return r.then(function(){d.status="fulfilled",d.value=i;for(var p=0;p<s.length;p++)(0,s[p])(i)},function(p){for(d.status="rejected",d.reason=p,p=0;p<s.length;p++)(0,s[p])(void 0)}),d}var ab=Z.S;Z.S=function(r,i){$x=hn(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&x_(r,i),ab!==null&&ab(r,i)};var Ki=P(null);function jh(){var r=Ki.current;return r!==null?r:kt.pooledCache}function Sc(r,i){i===null?T(Ki,Ki.current):T(Ki,i.pool)}function ib(){var r=jh();return r===null?null:{parent:Kt._currentValue,pool:r}}var Kl=Error(a(460)),Ch=Error(a(474)),kc=Error(a(542)),jc={then:function(){}};function lb(r){return r=r.status,r==="fulfilled"||r==="rejected"}function sb(r,i,s){switch(s=r[s],s===void 0?r.push(i):s!==i&&(i.then(ia,ia),i=s),i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,ub(r),r;default:if(typeof i.status=="string")i.then(ia,ia);else{if(r=kt,r!==null&&100<r.shellSuspendCounter)throw Error(a(482));r=i,r.status="pending",r.then(function(d){if(i.status==="pending"){var p=i;p.status="fulfilled",p.value=d}},function(d){if(i.status==="pending"){var p=i;p.status="rejected",p.reason=d}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,ub(r),r}throw Xi=i,Kl}}function Yi(r){try{var i=r._init;return i(r._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Xi=s,Kl):s}}var Xi=null;function ob(){if(Xi===null)throw Error(a(459));var r=Xi;return Xi=null,r}function ub(r){if(r===Kl||r===kc)throw Error(a(483))}var Yl=null,_o=0;function Cc(r){var i=_o;return _o+=1,Yl===null&&(Yl=[]),sb(Yl,r,i)}function To(r,i){i=i.props.ref,r.ref=i!==void 0?i:null}function Ec(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 cb(r){function i(V,H){if(r){var Q=V.deletions;Q===null?(V.deletions=[H],V.flags|=16):Q.push(H)}}function s(V,H){if(!r)return null;for(;H!==null;)i(V,H),H=H.sibling;return null}function d(V){for(var H=new Map;V!==null;)V.key!==null?H.set(V.key,V):H.set(V.index,V),V=V.sibling;return H}function p(V,H){return V=sa(V,H),V.index=0,V.sibling=null,V}function v(V,H,Q){return V.index=Q,r?(Q=V.alternate,Q!==null?(Q=Q.index,Q<H?(V.flags|=67108866,H):Q):(V.flags|=67108866,H)):(V.flags|=1048576,H)}function S(V){return r&&V.alternate===null&&(V.flags|=67108866),V}function _(V,H,Q,oe){return H===null||H.tag!==6?(H=hh(Q,V.mode,oe),H.return=V,H):(H=p(H,Q),H.return=V,H)}function $(V,H,Q,oe){var ze=Q.type;return ze===j?ae(V,H,Q.props.children,oe,Q.key):H!==null&&(H.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===I&&Yi(ze)===H.type)?(H=p(H,Q.props),To(H,Q),H.return=V,H):(H=vc(Q.type,Q.key,Q.props,null,V.mode,oe),To(H,Q),H.return=V,H)}function G(V,H,Q,oe){return H===null||H.tag!==4||H.stateNode.containerInfo!==Q.containerInfo||H.stateNode.implementation!==Q.implementation?(H=mh(Q,V.mode,oe),H.return=V,H):(H=p(H,Q.children||[]),H.return=V,H)}function ae(V,H,Q,oe,ze){return H===null||H.tag!==7?(H=Zi(Q,V.mode,oe,ze),H.return=V,H):(H=p(H,Q),H.return=V,H)}function de(V,H,Q){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return H=hh(""+H,V.mode,Q),H.return=V,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case w:return Q=vc(H.type,H.key,H.props,null,V.mode,Q),To(Q,H),Q.return=V,Q;case k:return H=mh(H,V.mode,Q),H.return=V,H;case I:return H=Yi(H),de(V,H,Q)}if(ne(H)||ee(H))return H=Zi(H,V.mode,Q,null),H.return=V,H;if(typeof H.then=="function")return de(V,Cc(H),Q);if(H.$$typeof===z)return de(V,wc(V,H),Q);Ec(V,H)}return null}function Y(V,H,Q,oe){var ze=H!==null?H.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return ze!==null?null:_(V,H,""+Q,oe);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case w:return Q.key===ze?$(V,H,Q,oe):null;case k:return Q.key===ze?G(V,H,Q,oe):null;case I:return Q=Yi(Q),Y(V,H,Q,oe)}if(ne(Q)||ee(Q))return ze!==null?null:ae(V,H,Q,oe,null);if(typeof Q.then=="function")return Y(V,H,Cc(Q),oe);if(Q.$$typeof===z)return Y(V,H,wc(V,Q),oe);Ec(V,Q)}return null}function J(V,H,Q,oe,ze){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return V=V.get(Q)||null,_(H,V,""+oe,ze);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case w:return V=V.get(oe.key===null?Q:oe.key)||null,$(H,V,oe,ze);case k:return V=V.get(oe.key===null?Q:oe.key)||null,G(H,V,oe,ze);case I:return oe=Yi(oe),J(V,H,Q,oe,ze)}if(ne(oe)||ee(oe))return V=V.get(Q)||null,ae(H,V,oe,ze,null);if(typeof oe.then=="function")return J(V,H,Q,Cc(oe),ze);if(oe.$$typeof===z)return J(V,H,Q,wc(H,oe),ze);Ec(H,oe)}return null}function Ce(V,H,Q,oe){for(var ze=null,ct=null,Te=H,Ve=H=0,rt=null;Te!==null&&Ve<Q.length;Ve++){Te.index>Ve?(rt=Te,Te=null):rt=Te.sibling;var dt=Y(V,Te,Q[Ve],oe);if(dt===null){Te===null&&(Te=rt);break}r&&Te&&dt.alternate===null&&i(V,Te),H=v(dt,H,Ve),ct===null?ze=dt:ct.sibling=dt,ct=dt,Te=rt}if(Ve===Q.length)return s(V,Te),it&&oa(V,Ve),ze;if(Te===null){for(;Ve<Q.length;Ve++)Te=de(V,Q[Ve],oe),Te!==null&&(H=v(Te,H,Ve),ct===null?ze=Te:ct.sibling=Te,ct=Te);return it&&oa(V,Ve),ze}for(Te=d(Te);Ve<Q.length;Ve++)rt=J(Te,V,Ve,Q[Ve],oe),rt!==null&&(r&&rt.alternate!==null&&Te.delete(rt.key===null?Ve:rt.key),H=v(rt,H,Ve),ct===null?ze=rt:ct.sibling=rt,ct=rt);return r&&Te.forEach(function(si){return i(V,si)}),it&&oa(V,Ve),ze}function De(V,H,Q,oe){if(Q==null)throw Error(a(151));for(var ze=null,ct=null,Te=H,Ve=H=0,rt=null,dt=Q.next();Te!==null&&!dt.done;Ve++,dt=Q.next()){Te.index>Ve?(rt=Te,Te=null):rt=Te.sibling;var si=Y(V,Te,dt.value,oe);if(si===null){Te===null&&(Te=rt);break}r&&Te&&si.alternate===null&&i(V,Te),H=v(si,H,Ve),ct===null?ze=si:ct.sibling=si,ct=si,Te=rt}if(dt.done)return s(V,Te),it&&oa(V,Ve),ze;if(Te===null){for(;!dt.done;Ve++,dt=Q.next())dt=de(V,dt.value,oe),dt!==null&&(H=v(dt,H,Ve),ct===null?ze=dt:ct.sibling=dt,ct=dt);return it&&oa(V,Ve),ze}for(Te=d(Te);!dt.done;Ve++,dt=Q.next())dt=J(Te,V,Ve,dt.value,oe),dt!==null&&(r&&dt.alternate!==null&&Te.delete(dt.key===null?Ve:dt.key),H=v(dt,H,Ve),ct===null?ze=dt:ct.sibling=dt,ct=dt);return r&&Te.forEach(function(z2){return i(V,z2)}),it&&oa(V,Ve),ze}function xt(V,H,Q,oe){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 w:e:{for(var ze=Q.key;H!==null;){if(H.key===ze){if(ze=Q.type,ze===j){if(H.tag===7){s(V,H.sibling),oe=p(H,Q.props.children),oe.return=V,V=oe;break e}}else if(H.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===I&&Yi(ze)===H.type){s(V,H.sibling),oe=p(H,Q.props),To(oe,Q),oe.return=V,V=oe;break e}s(V,H);break}else i(V,H);H=H.sibling}Q.type===j?(oe=Zi(Q.props.children,V.mode,oe,Q.key),oe.return=V,V=oe):(oe=vc(Q.type,Q.key,Q.props,null,V.mode,oe),To(oe,Q),oe.return=V,V=oe)}return S(V);case k:e:{for(ze=Q.key;H!==null;){if(H.key===ze)if(H.tag===4&&H.stateNode.containerInfo===Q.containerInfo&&H.stateNode.implementation===Q.implementation){s(V,H.sibling),oe=p(H,Q.children||[]),oe.return=V,V=oe;break e}else{s(V,H);break}else i(V,H);H=H.sibling}oe=mh(Q,V.mode,oe),oe.return=V,V=oe}return S(V);case I:return Q=Yi(Q),xt(V,H,Q,oe)}if(ne(Q))return Ce(V,H,Q,oe);if(ee(Q)){if(ze=ee(Q),typeof ze!="function")throw Error(a(150));return Q=ze.call(Q),De(V,H,Q,oe)}if(typeof Q.then=="function")return xt(V,H,Cc(Q),oe);if(Q.$$typeof===z)return xt(V,H,wc(V,Q),oe);Ec(V,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,H!==null&&H.tag===6?(s(V,H.sibling),oe=p(H,Q),oe.return=V,V=oe):(s(V,H),oe=hh(Q,V.mode,oe),oe.return=V,V=oe),S(V)):s(V,H)}return function(V,H,Q,oe){try{_o=0;var ze=xt(V,H,Q,oe);return Yl=null,ze}catch(Te){if(Te===Kl||Te===kc)throw Te;var ct=Jn(29,Te,null,V.mode);return ct.lanes=oe,ct.return=V,ct}finally{}}}var Ji=cb(!0),db=cb(!1),Ha=!1;function Eh(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 Za(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function Va(r,i,s){var d=r.updateQueue;if(d===null)return null;if(d=d.shared,(ft&2)!==0){var p=d.pending;return p===null?i.next=i:(i.next=p.next,p.next=i),d.pending=i,i=yc(r),Gv(r,null,s),i}return gc(r,d,i,s),yc(r)}function Ao(r,i,s){if(i=i.updateQueue,i!==null&&(i=i.shared,(s&4194048)!==0)){var d=i.lanes;d&=r.pendingLanes,s|=d,i.lanes=s,rc(r,s)}}function _h(r,i){var s=r.updateQueue,d=r.alternate;if(d!==null&&(d=d.updateQueue,s===d)){var p=null,v=null;if(s=s.firstBaseUpdate,s!==null){do{var S={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};v===null?p=v=S:v=v.next=S,s=s.next}while(s!==null);v===null?p=v=i:v=v.next=i}else p=v=i;s={baseState:d.baseState,firstBaseUpdate:p,lastBaseUpdate:v,shared:d.shared,callbacks:d.callbacks},r.updateQueue=s;return}r=s.lastBaseUpdate,r===null?s.firstBaseUpdate=i:r.next=i,s.lastBaseUpdate=i}var Th=!1;function Ro(){if(Th){var r=Gl;if(r!==null)throw r}}function zo(r,i,s,d){Th=!1;var p=r.updateQueue;Ha=!1;var v=p.firstBaseUpdate,S=p.lastBaseUpdate,_=p.shared.pending;if(_!==null){p.shared.pending=null;var $=_,G=$.next;$.next=null,S===null?v=G:S.next=G,S=$;var ae=r.alternate;ae!==null&&(ae=ae.updateQueue,_=ae.lastBaseUpdate,_!==S&&(_===null?ae.firstBaseUpdate=G:_.next=G,ae.lastBaseUpdate=$))}if(v!==null){var de=p.baseState;S=0,ae=G=$=null,_=v;do{var Y=_.lane&-536870913,J=Y!==_.lane;if(J?(nt&Y)===Y:(d&Y)===Y){Y!==0&&Y===Ql&&(Th=!0),ae!==null&&(ae=ae.next={lane:0,tag:_.tag,payload:_.payload,callback:null,next:null});e:{var Ce=r,De=_;Y=i;var xt=s;switch(De.tag){case 1:if(Ce=De.payload,typeof Ce=="function"){de=Ce.call(xt,de,Y);break e}de=Ce;break e;case 3:Ce.flags=Ce.flags&-65537|128;case 0:if(Ce=De.payload,Y=typeof Ce=="function"?Ce.call(xt,de,Y):Ce,Y==null)break e;de=g({},de,Y);break e;case 2:Ha=!0}}Y=_.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:_.tag,payload:_.payload,callback:_.callback,next:null},ae===null?(G=ae=J,$=de):ae=ae.next=J,S|=Y;if(_=_.next,_===null){if(_=p.shared.pending,_===null)break;J=_,_=J.next,J.next=null,p.lastBaseUpdate=J,p.shared.pending=null}}while(!0);ae===null&&($=de),p.baseState=$,p.firstBaseUpdate=G,p.lastBaseUpdate=ae,v===null&&(p.shared.lanes=0),Xa|=S,r.lanes=S,r.memoizedState=de}}function fb(r,i){if(typeof r!="function")throw Error(a(191,r));r.call(i)}function hb(r,i){var s=r.callbacks;if(s!==null)for(r.callbacks=null,r=0;r<s.length;r++)fb(s[r],i)}var Xl=P(null),Nc=P(0);function mb(r,i){r=ba,T(Nc,r),T(Xl,i),ba=r|i.baseLanes}function Ah(){T(Nc,ba),T(Xl,Xl.current)}function Rh(){ba=Nc.current,B(Xl),B(Nc)}var Wn=P(null),xr=null;function Qa(r){var i=r.alternate;T(Vt,Vt.current&1),T(Wn,r),xr===null&&(i===null||Xl.current!==null||i.memoizedState!==null)&&(xr=r)}function zh(r){T(Vt,Vt.current),T(Wn,r),xr===null&&(xr=r)}function pb(r){r.tag===22?(T(Vt,Vt.current),T(Wn,r),xr===null&&(xr=r)):Ga()}function Ga(){T(Vt,Vt.current),T(Wn,Wn.current)}function er(r){B(Wn),xr===r&&(xr=null),B(Vt)}var Vt=P(0);function _c(r){for(var i=r;i!==null;){if(i.tag===13){var s=i.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Um(s)||Pm(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 da=0,Ze=null,vt=null,Yt=null,Tc=!1,Jl=!1,Wi=!1,Ac=0,Oo=0,Wl=null,S_=0;function It(){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(!Xn(r[s],i[s]))return!1;return!0}function Dh(r,i,s,d,p,v){return da=v,Ze=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,Z.H=r===null||r.memoizedState===null?Jb:Kh,Wi=!1,v=s(d,p),Wi=!1,Jl&&(v=yb(i,s,d,p)),gb(r),v}function gb(r){Z.H=Lo;var i=vt!==null&&vt.next!==null;if(da=0,Yt=vt=Ze=null,Tc=!1,Oo=0,Wl=null,i)throw Error(a(300));r===null||Xt||(r=r.dependencies,r!==null&&xc(r)&&(Xt=!0))}function yb(r,i,s,d){Ze=r;var p=0;do{if(Jl&&(Wl=null),Oo=0,Jl=!1,25<=p)throw Error(a(301));if(p+=1,Yt=vt=null,r.updateQueue!=null){var v=r.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}Z.H=Wb,v=i(s,d)}while(Jl);return v}function k_(){var r=Z.H,i=r.useState()[0];return i=typeof i.then=="function"?Do(i):i,r=r.useState()[0],(vt!==null?vt.memoizedState:null)!==r&&(Ze.flags|=1024),i}function Mh(){var r=Ac!==0;return Ac=0,r}function Lh(r,i,s){i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~s}function Ih(r){if(Tc){for(r=r.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Tc=!1}da=0,Yt=vt=Ze=null,Jl=!1,Oo=Ac=0,Wl=null}function Rn(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Yt===null?Ze.memoizedState=Yt=r:Yt=Yt.next=r,Yt}function Qt(){if(vt===null){var r=Ze.alternate;r=r!==null?r.memoizedState:null}else r=vt.next;var i=Yt===null?Ze.memoizedState:Yt.next;if(i!==null)Yt=i,vt=r;else{if(r===null)throw Ze.alternate===null?Error(a(467)):Error(a(310));vt=r,r={memoizedState:vt.memoizedState,baseState:vt.baseState,baseQueue:vt.baseQueue,queue:vt.queue,next:null},Yt===null?Ze.memoizedState=Yt=r:Yt=Yt.next=r}return Yt}function Rc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Do(r){var i=Oo;return Oo+=1,Wl===null&&(Wl=[]),r=sb(Wl,r,i),i=Ze,(Yt===null?i.memoizedState:Yt.next)===null&&(i=i.alternate,Z.H=i===null||i.memoizedState===null?Jb:Kh),r}function zc(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return Do(r);if(r.$$typeof===z)return bn(r)}throw Error(a(438,String(r)))}function Uh(r){var i=null,s=Ze.updateQueue;if(s!==null&&(i=s.memoCache),i==null){var d=Ze.alternate;d!==null&&(d=d.updateQueue,d!==null&&(d=d.memoCache,d!=null&&(i={data:d.data.map(function(p){return p.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),s===null&&(s=Rc(),Ze.updateQueue=s),s.memoCache=i,s=i.data[i.index],s===void 0)for(s=i.data[i.index]=Array(r),d=0;d<r;d++)s[d]=F;return i.index++,s}function fa(r,i){return typeof i=="function"?i(r):i}function Oc(r){var i=Qt();return Ph(i,vt,r)}function Ph(r,i,s){var d=r.queue;if(d===null)throw Error(a(311));d.lastRenderedReducer=s;var p=r.baseQueue,v=d.pending;if(v!==null){if(p!==null){var S=p.next;p.next=v.next,v.next=S}i.baseQueue=p=v,d.pending=null}if(v=r.baseState,p===null)r.memoizedState=v;else{i=p.next;var _=S=null,$=null,G=i,ae=!1;do{var de=G.lane&-536870913;if(de!==G.lane?(nt&de)===de:(da&de)===de){var Y=G.revertLane;if(Y===0)$!==null&&($=$.next={lane:0,revertLane:0,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null}),de===Ql&&(ae=!0);else if((da&Y)===Y){G=G.next,Y===Ql&&(ae=!0);continue}else de={lane:0,revertLane:G.revertLane,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},$===null?(_=$=de,S=v):$=$.next=de,Ze.lanes|=Y,Xa|=Y;de=G.action,Wi&&s(v,de),v=G.hasEagerState?G.eagerState:s(v,de)}else Y={lane:de,revertLane:G.revertLane,gesture:G.gesture,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},$===null?(_=$=Y,S=v):$=$.next=Y,Ze.lanes|=de,Xa|=de;G=G.next}while(G!==null&&G!==i);if($===null?S=v:$.next=_,!Xn(v,r.memoizedState)&&(Xt=!0,ae&&(s=Gl,s!==null)))throw s;r.memoizedState=v,r.baseState=S,r.baseQueue=$,d.lastRenderedState=v}return p===null&&(d.lanes=0),[r.memoizedState,d.dispatch]}function Bh(r){var i=Qt(),s=i.queue;if(s===null)throw Error(a(311));s.lastRenderedReducer=r;var d=s.dispatch,p=s.pending,v=i.memoizedState;if(p!==null){s.pending=null;var S=p=p.next;do v=r(v,S.action),S=S.next;while(S!==p);Xn(v,i.memoizedState)||(Xt=!0),i.memoizedState=v,i.baseQueue===null&&(i.baseState=v),s.lastRenderedState=v}return[v,d]}function vb(r,i,s){var d=Ze,p=Qt(),v=it;if(v){if(s===void 0)throw Error(a(407));s=s()}else s=i();var S=!Xn((vt||p).memoizedState,s);if(S&&(p.memoizedState=s,Xt=!0),p=p.queue,qh(wb.bind(null,d,p,r),[r]),p.getSnapshot!==i||S||Yt!==null&&Yt.memoizedState.tag&1){if(d.flags|=2048,es(9,{destroy:void 0},xb.bind(null,d,p,s,i),null),kt===null)throw Error(a(349));v||(da&127)!==0||bb(d,i,s)}return s}function bb(r,i,s){r.flags|=16384,r={getSnapshot:i,value:s},i=Ze.updateQueue,i===null?(i=Rc(),Ze.updateQueue=i,i.stores=[r]):(s=i.stores,s===null?i.stores=[r]:s.push(r))}function xb(r,i,s,d){i.value=s,i.getSnapshot=d,Sb(i)&&kb(r)}function wb(r,i,s){return s(function(){Sb(i)&&kb(r)})}function Sb(r){var i=r.getSnapshot;r=r.value;try{var s=i();return!Xn(r,s)}catch{return!0}}function kb(r){var i=Hi(r,2);i!==null&&qn(i,r,2)}function $h(r){var i=Rn();if(typeof r=="function"){var s=r;if(r=s(),Wi){pn(!0);try{s()}finally{pn(!1)}}}return i.memoizedState=i.baseState=r,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:fa,lastRenderedState:r},i}function jb(r,i,s,d){return r.baseState=s,Ph(r,vt,typeof d=="function"?d:fa)}function j_(r,i,s,d,p){if(Lc(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(S){v.listeners.push(S)}};Z.T!==null?s(!0):v.isTransition=!1,d(v),s=i.pending,s===null?(v.next=i.pending=v,Cb(i,v)):(v.next=s.next,i.pending=s.next=v)}}function Cb(r,i){var s=i.action,d=i.payload,p=r.state;if(i.isTransition){var v=Z.T,S={};Z.T=S;try{var _=s(p,d),$=Z.S;$!==null&&$(S,_),Eb(r,i,_)}catch(G){Fh(r,i,G)}finally{v!==null&&S.types!==null&&(v.types=S.types),Z.T=v}}else try{v=s(p,d),Eb(r,i,v)}catch(G){Fh(r,i,G)}}function Eb(r,i,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(d){Nb(r,i,d)},function(d){return Fh(r,i,d)}):Nb(r,i,s)}function Nb(r,i,s){i.status="fulfilled",i.value=s,_b(i),r.state=s,i=r.pending,i!==null&&(s=i.next,s===i?r.pending=null:(s=s.next,i.next=s,Cb(r,s)))}function Fh(r,i,s){var d=r.pending;if(r.pending=null,d!==null){d=d.next;do i.status="rejected",i.reason=s,_b(i),i=i.next;while(i!==d)}r.action=null}function _b(r){r=r.listeners;for(var i=0;i<r.length;i++)(0,r[i])()}function Tb(r,i){return i}function Ab(r,i){if(it){var s=kt.formState;if(s!==null){e:{var d=Ze;if(it){if(Nt){t:{for(var p=Nt,v=br;p.nodeType!==8;){if(!v){p=null;break t}if(p=wr(p.nextSibling),p===null){p=null;break t}}v=p.data,p=v==="F!"||v==="F"?p:null}if(p){Nt=wr(p.nextSibling),d=p.data==="F!";break e}}Fa(d)}d=!1}d&&(i=s[0])}}return s=Rn(),s.memoizedState=s.baseState=i,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Tb,lastRenderedState:i},s.queue=d,s=Kb.bind(null,Ze,d),d.dispatch=s,d=$h(!1),v=Gh.bind(null,Ze,!1,d.queue),d=Rn(),p={state:i,dispatch:null,action:r,pending:null},d.queue=p,s=j_.bind(null,Ze,p,v,s),p.dispatch=s,d.memoizedState=r,[i,s,!1]}function Rb(r){var i=Qt();return zb(i,vt,r)}function zb(r,i,s){if(i=Ph(r,i,Tb)[0],r=Oc(fa)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var d=Do(i)}catch(S){throw S===Kl?kc:S}else d=i;i=Qt();var p=i.queue,v=p.dispatch;return s!==i.memoizedState&&(Ze.flags|=2048,es(9,{destroy:void 0},C_.bind(null,p,s),null)),[d,v,r]}function C_(r,i){r.action=i}function Ob(r){var i=Qt(),s=vt;if(s!==null)return zb(i,s,r);Qt(),i=i.memoizedState,s=Qt();var d=s.queue.dispatch;return s.memoizedState=r,[i,d,!1]}function es(r,i,s,d){return r={tag:r,create:s,deps:d,inst:i,next:null},i=Ze.updateQueue,i===null&&(i=Rc(),Ze.updateQueue=i),s=i.lastEffect,s===null?i.lastEffect=r.next=r:(d=s.next,s.next=r,r.next=d,i.lastEffect=r),r}function Db(){return Qt().memoizedState}function Dc(r,i,s,d){var p=Rn();Ze.flags|=r,p.memoizedState=es(1|i,{destroy:void 0},s,d===void 0?null:d)}function Mc(r,i,s,d){var p=Qt();d=d===void 0?null:d;var v=p.memoizedState.inst;vt!==null&&d!==null&&Oh(d,vt.memoizedState.deps)?p.memoizedState=es(i,v,s,d):(Ze.flags|=r,p.memoizedState=es(1|i,v,s,d))}function Mb(r,i){Dc(8390656,8,r,i)}function qh(r,i){Mc(2048,8,r,i)}function E_(r){Ze.flags|=4;var i=Ze.updateQueue;if(i===null)i=Rc(),Ze.updateQueue=i,i.events=[r];else{var s=i.events;s===null?i.events=[r]:s.push(r)}}function Lb(r){var i=Qt().memoizedState;return E_({ref:i,nextImpl:r}),function(){if((ft&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function Ib(r,i){return Mc(4,2,r,i)}function Ub(r,i){return Mc(4,4,r,i)}function Pb(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 Bb(r,i,s){s=s!=null?s.concat([r]):null,Mc(4,4,Pb.bind(null,i,r),s)}function Hh(){}function $b(r,i){var s=Qt();i=i===void 0?null:i;var d=s.memoizedState;return i!==null&&Oh(i,d[1])?d[0]:(s.memoizedState=[r,i],r)}function Fb(r,i){var s=Qt();i=i===void 0?null:i;var d=s.memoizedState;if(i!==null&&Oh(i,d[1]))return d[0];if(d=r(),Wi){pn(!0);try{r()}finally{pn(!1)}}return s.memoizedState=[d,i],d}function Zh(r,i,s){return s===void 0||(da&1073741824)!==0&&(nt&261930)===0?r.memoizedState=i:(r.memoizedState=s,r=qx(),Ze.lanes|=r,Xa|=r,s)}function qb(r,i,s,d){return Xn(s,i)?s:Xl.current!==null?(r=Zh(r,s,d),Xn(r,i)||(Xt=!0),r):(da&42)===0||(da&1073741824)!==0&&(nt&261930)===0?(Xt=!0,r.memoizedState=s):(r=qx(),Ze.lanes|=r,Xa|=r,i)}function Hb(r,i,s,d,p){var v=te.p;te.p=v!==0&&8>v?v:8;var S=Z.T,_={};Z.T=_,Gh(r,!1,i,s);try{var $=p(),G=Z.S;if(G!==null&&G(_,$),$!==null&&typeof $=="object"&&typeof $.then=="function"){var ae=w_($,d);Mo(r,i,ae,rr(r))}else Mo(r,i,d,rr(r))}catch(de){Mo(r,i,{then:function(){},status:"rejected",reason:de},rr())}finally{te.p=v,S!==null&&_.types!==null&&(S.types=_.types),Z.T=S}}function N_(){}function Vh(r,i,s,d){if(r.tag!==5)throw Error(a(476));var p=Zb(r).queue;Hb(r,p,i,ie,s===null?N_:function(){return Vb(r),s(d)})}function Zb(r){var i=r.memoizedState;if(i!==null)return i;i={memoizedState:ie,baseState:ie,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fa,lastRenderedState:ie},next:null};var s={};return i.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fa,lastRenderedState:s},next:null},r.memoizedState=i,r=r.alternate,r!==null&&(r.memoizedState=i),i}function Vb(r){var i=Zb(r);i.next===null&&(i=r.alternate.memoizedState),Mo(r,i.next.queue,{},rr())}function Qh(){return bn(Jo)}function Qb(){return Qt().memoizedState}function Gb(){return Qt().memoizedState}function __(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var s=rr();r=Za(s);var d=Va(i,r,s);d!==null&&(qn(d,i,s),Ao(d,i,s)),i={cache:Sh()},r.payload=i;return}i=i.return}}function T_(r,i,s){var d=rr();s={lane:d,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Lc(r)?Yb(i,s):(s=dh(r,i,s,d),s!==null&&(qn(s,r,d),Xb(s,i,d)))}function Kb(r,i,s){var d=rr();Mo(r,i,s,d)}function Mo(r,i,s,d){var p={lane:d,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(Lc(r))Yb(i,p);else{var v=r.alternate;if(r.lanes===0&&(v===null||v.lanes===0)&&(v=i.lastRenderedReducer,v!==null))try{var S=i.lastRenderedState,_=v(S,s);if(p.hasEagerState=!0,p.eagerState=_,Xn(_,S))return gc(r,i,p,0),kt===null&&pc(),!1}catch{}finally{}if(s=dh(r,i,p,d),s!==null)return qn(s,r,d),Xb(s,i,d),!0}return!1}function Gh(r,i,s,d){if(d={lane:2,revertLane:Em(),gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},Lc(r)){if(i)throw Error(a(479))}else i=dh(r,s,d,2),i!==null&&qn(i,r,2)}function Lc(r){var i=r.alternate;return r===Ze||i!==null&&i===Ze}function Yb(r,i){Jl=Tc=!0;var s=r.pending;s===null?i.next=i:(i.next=s.next,s.next=i),r.pending=i}function Xb(r,i,s){if((s&4194048)!==0){var d=i.lanes;d&=r.pendingLanes,s|=d,i.lanes=s,rc(r,s)}}var Lo={readContext:bn,use:zc,useCallback:It,useContext:It,useEffect:It,useImperativeHandle:It,useLayoutEffect:It,useInsertionEffect:It,useMemo:It,useReducer:It,useRef:It,useState:It,useDebugValue:It,useDeferredValue:It,useTransition:It,useSyncExternalStore:It,useId:It,useHostTransitionStatus:It,useFormState:It,useActionState:It,useOptimistic:It,useMemoCache:It,useCacheRefresh:It};Lo.useEffectEvent=It;var Jb={readContext:bn,use:zc,useCallback:function(r,i){return Rn().memoizedState=[r,i===void 0?null:i],r},useContext:bn,useEffect:Mb,useImperativeHandle:function(r,i,s){s=s!=null?s.concat([r]):null,Dc(4194308,4,Pb.bind(null,i,r),s)},useLayoutEffect:function(r,i){return Dc(4194308,4,r,i)},useInsertionEffect:function(r,i){Dc(4,2,r,i)},useMemo:function(r,i){var s=Rn();i=i===void 0?null:i;var d=r();if(Wi){pn(!0);try{r()}finally{pn(!1)}}return s.memoizedState=[d,i],d},useReducer:function(r,i,s){var d=Rn();if(s!==void 0){var p=s(i);if(Wi){pn(!0);try{s(i)}finally{pn(!1)}}}else p=i;return d.memoizedState=d.baseState=p,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:p},d.queue=r,r=r.dispatch=T_.bind(null,Ze,r),[d.memoizedState,r]},useRef:function(r){var i=Rn();return r={current:r},i.memoizedState=r},useState:function(r){r=$h(r);var i=r.queue,s=Kb.bind(null,Ze,i);return i.dispatch=s,[r.memoizedState,s]},useDebugValue:Hh,useDeferredValue:function(r,i){var s=Rn();return Zh(s,r,i)},useTransition:function(){var r=$h(!1);return r=Hb.bind(null,Ze,r.queue,!0,!1),Rn().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,i,s){var d=Ze,p=Rn();if(it){if(s===void 0)throw Error(a(407));s=s()}else{if(s=i(),kt===null)throw Error(a(349));(nt&127)!==0||bb(d,i,s)}p.memoizedState=s;var v={value:s,getSnapshot:i};return p.queue=v,Mb(wb.bind(null,d,v,r),[r]),d.flags|=2048,es(9,{destroy:void 0},xb.bind(null,d,v,s,i),null),s},useId:function(){var r=Rn(),i=kt.identifierPrefix;if(it){var s=$r,d=Br;s=(d&~(1<<32-ht(d)-1)).toString(32)+s,i="_"+i+"R_"+s,s=Ac++,0<s&&(i+="H"+s.toString(32)),i+="_"}else s=S_++,i="_"+i+"r_"+s.toString(32)+"_";return r.memoizedState=i},useHostTransitionStatus:Qh,useFormState:Ab,useActionState:Ab,useOptimistic:function(r){var i=Rn();i.memoizedState=i.baseState=r;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=s,i=Gh.bind(null,Ze,!0,s),s.dispatch=i,[r,i]},useMemoCache:Uh,useCacheRefresh:function(){return Rn().memoizedState=__.bind(null,Ze)},useEffectEvent:function(r){var i=Rn(),s={impl:r};return i.memoizedState=s,function(){if((ft&2)!==0)throw Error(a(440));return s.impl.apply(void 0,arguments)}}},Kh={readContext:bn,use:zc,useCallback:$b,useContext:bn,useEffect:qh,useImperativeHandle:Bb,useInsertionEffect:Ib,useLayoutEffect:Ub,useMemo:Fb,useReducer:Oc,useRef:Db,useState:function(){return Oc(fa)},useDebugValue:Hh,useDeferredValue:function(r,i){var s=Qt();return qb(s,vt.memoizedState,r,i)},useTransition:function(){var r=Oc(fa)[0],i=Qt().memoizedState;return[typeof r=="boolean"?r:Do(r),i]},useSyncExternalStore:vb,useId:Qb,useHostTransitionStatus:Qh,useFormState:Rb,useActionState:Rb,useOptimistic:function(r,i){var s=Qt();return jb(s,vt,r,i)},useMemoCache:Uh,useCacheRefresh:Gb};Kh.useEffectEvent=Lb;var Wb={readContext:bn,use:zc,useCallback:$b,useContext:bn,useEffect:qh,useImperativeHandle:Bb,useInsertionEffect:Ib,useLayoutEffect:Ub,useMemo:Fb,useReducer:Bh,useRef:Db,useState:function(){return Bh(fa)},useDebugValue:Hh,useDeferredValue:function(r,i){var s=Qt();return vt===null?Zh(s,r,i):qb(s,vt.memoizedState,r,i)},useTransition:function(){var r=Bh(fa)[0],i=Qt().memoizedState;return[typeof r=="boolean"?r:Do(r),i]},useSyncExternalStore:vb,useId:Qb,useHostTransitionStatus:Qh,useFormState:Ob,useActionState:Ob,useOptimistic:function(r,i){var s=Qt();return vt!==null?jb(s,vt,r,i):(s.baseState=r,[r,s.queue.dispatch])},useMemoCache:Uh,useCacheRefresh:Gb};Wb.useEffectEvent=Lb;function Yh(r,i,s,d){i=r.memoizedState,s=s(d,i),s=s==null?i:g({},i,s),r.memoizedState=s,r.lanes===0&&(r.updateQueue.baseState=s)}var Xh={enqueueSetState:function(r,i,s){r=r._reactInternals;var d=rr(),p=Za(d);p.payload=i,s!=null&&(p.callback=s),i=Va(r,p,d),i!==null&&(qn(i,r,d),Ao(i,r,d))},enqueueReplaceState:function(r,i,s){r=r._reactInternals;var d=rr(),p=Za(d);p.tag=1,p.payload=i,s!=null&&(p.callback=s),i=Va(r,p,d),i!==null&&(qn(i,r,d),Ao(i,r,d))},enqueueForceUpdate:function(r,i){r=r._reactInternals;var s=rr(),d=Za(s);d.tag=2,i!=null&&(d.callback=i),i=Va(r,d,s),i!==null&&(qn(i,r,s),Ao(i,r,s))}};function ex(r,i,s,d,p,v,S){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(d,v,S):i.prototype&&i.prototype.isPureReactComponent?!So(s,d)||!So(p,v):!0}function tx(r,i,s,d){r=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(s,d),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(s,d),i.state!==r&&Xh.enqueueReplaceState(i,i.state,null)}function el(r,i){var s=i;if("ref"in i){s={};for(var d in i)d!=="ref"&&(s[d]=i[d])}if(r=r.defaultProps){s===i&&(s=g({},s));for(var p in r)s[p]===void 0&&(s[p]=r[p])}return s}function nx(r){mc(r)}function rx(r){console.error(r)}function ax(r){mc(r)}function Ic(r,i){try{var s=r.onUncaughtError;s(i.value,{componentStack:i.stack})}catch(d){setTimeout(function(){throw d})}}function ix(r,i,s){try{var d=r.onCaughtError;d(s.value,{componentStack:s.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function Jh(r,i,s){return s=Za(s),s.tag=3,s.payload={element:null},s.callback=function(){Ic(r,i)},s}function lx(r){return r=Za(r),r.tag=3,r}function sx(r,i,s,d){var p=s.type.getDerivedStateFromError;if(typeof p=="function"){var v=d.value;r.payload=function(){return p(v)},r.callback=function(){ix(i,s,d)}}var S=s.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(r.callback=function(){ix(i,s,d),typeof p!="function"&&(Ja===null?Ja=new Set([this]):Ja.add(this));var _=d.stack;this.componentDidCatch(d.value,{componentStack:_!==null?_:""})})}function A_(r,i,s,d,p){if(s.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(i=s.alternate,i!==null&&Vl(i,s,p,!0),s=Wn.current,s!==null){switch(s.tag){case 31:case 13:return xr===null?Kc():s.alternate===null&&Ut===0&&(Ut=3),s.flags&=-257,s.flags|=65536,s.lanes=p,d===jc?s.flags|=16384:(i=s.updateQueue,i===null?s.updateQueue=new Set([d]):i.add(d),km(r,d,p)),!1;case 22:return s.flags|=65536,d===jc?s.flags|=16384:(i=s.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([d])},s.updateQueue=i):(s=i.retryQueue,s===null?i.retryQueue=new Set([d]):s.add(d)),km(r,d,p)),!1}throw Error(a(435,s.tag))}return km(r,d,p),Kc(),!1}if(it)return i=Wn.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=p,d!==yh&&(r=Error(a(422),{cause:d}),Co(gr(r,s)))):(d!==yh&&(i=Error(a(423),{cause:d}),Co(gr(i,s))),r=r.current.alternate,r.flags|=65536,p&=-p,r.lanes|=p,d=gr(d,s),p=Jh(r.stateNode,d,p),_h(r,p),Ut!==4&&(Ut=2)),!1;var v=Error(a(520),{cause:d});if(v=gr(v,s),Ho===null?Ho=[v]:Ho.push(v),Ut!==4&&(Ut=2),i===null)return!0;d=gr(d,s),s=i;do{switch(s.tag){case 3:return s.flags|=65536,r=p&-p,s.lanes|=r,r=Jh(s.stateNode,d,r),_h(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"&&(Ja===null||!Ja.has(v))))return s.flags|=65536,p&=-p,s.lanes|=p,p=lx(p),sx(p,r,s,d),_h(s,p),!1}s=s.return}while(s!==null);return!1}var Wh=Error(a(461)),Xt=!1;function xn(r,i,s,d){i.child=r===null?db(i,null,s,d):Ji(i,r.child,s,d)}function ox(r,i,s,d,p){s=s.render;var v=i.ref;if("ref"in d){var S={};for(var _ in d)_!=="ref"&&(S[_]=d[_])}else S=d;return Gi(i),d=Dh(r,i,s,S,v,p),_=Mh(),r!==null&&!Xt?(Lh(r,i,p),ha(r,i,p)):(it&&_&&ph(i),i.flags|=1,xn(r,i,d,p),i.child)}function ux(r,i,s,d,p){if(r===null){var v=s.type;return typeof v=="function"&&!fh(v)&&v.defaultProps===void 0&&s.compare===null?(i.tag=15,i.type=v,cx(r,i,v,d,p)):(r=vc(s.type,null,d,i,i.mode,p),r.ref=i.ref,r.return=i,i.child=r)}if(v=r.child,!sm(r,p)){var S=v.memoizedProps;if(s=s.compare,s=s!==null?s:So,s(S,d)&&r.ref===i.ref)return ha(r,i,p)}return i.flags|=1,r=sa(v,d),r.ref=i.ref,r.return=i,i.child=r}function cx(r,i,s,d,p){if(r!==null){var v=r.memoizedProps;if(So(v,d)&&r.ref===i.ref)if(Xt=!1,i.pendingProps=d=v,sm(r,p))(r.flags&131072)!==0&&(Xt=!0);else return i.lanes=r.lanes,ha(r,i,p)}return em(r,i,s,d,p)}function dx(r,i,s,d){var p=d.children,v=r!==null?r.memoizedState:null;if(r===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.mode==="hidden"){if((i.flags&128)!==0){if(v=v!==null?v.baseLanes|s:s,r!==null){for(d=i.child=r.child,p=0;d!==null;)p=p|d.lanes|d.childLanes,d=d.sibling;d=p&~v}else d=0,i.child=null;return fx(r,i,v,s,d)}if((s&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},r!==null&&Sc(i,v!==null?v.cachePool:null),v!==null?mb(i,v):Ah(),pb(i);else return d=i.lanes=536870912,fx(r,i,v!==null?v.baseLanes|s:s,s,d)}else v!==null?(Sc(i,v.cachePool),mb(i,v),Ga(),i.memoizedState=null):(r!==null&&Sc(i,null),Ah(),Ga());return xn(r,i,p,s),i.child}function Io(r,i){return r!==null&&r.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function fx(r,i,s,d,p){var v=jh();return v=v===null?null:{parent:Kt._currentValue,pool:v},i.memoizedState={baseLanes:s,cachePool:v},r!==null&&Sc(i,null),Ah(),pb(i),r!==null&&Vl(r,i,d,!0),i.childLanes=p,null}function Uc(r,i){return i=Bc({mode:i.mode,children:i.children},r.mode),i.ref=r.ref,r.child=i,i.return=r,i}function hx(r,i,s){return Ji(i,r.child,null,s),r=Uc(i,i.pendingProps),r.flags|=2,er(i),i.memoizedState=null,r}function R_(r,i,s){var d=i.pendingProps,p=(i.flags&128)!==0;if(i.flags&=-129,r===null){if(it){if(d.mode==="hidden")return r=Uc(i,d),i.lanes=536870912,Io(null,r);if(zh(i),(r=Nt)?(r=C0(r,br),r=r!==null&&r.data==="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:Ba!==null?{id:Br,overflow:$r}:null,retryLane:536870912,hydrationErrors:null},s=Yv(r),s.return=i,i.child=s,vn=i,Nt=null)):r=null,r===null)throw Fa(i);return i.lanes=536870912,null}return Uc(i,d)}var v=r.memoizedState;if(v!==null){var S=v.dehydrated;if(zh(i),p)if(i.flags&256)i.flags&=-257,i=hx(r,i,s);else if(i.memoizedState!==null)i.child=r.child,i.flags|=128,i=null;else throw Error(a(558));else if(Xt||Vl(r,i,s,!1),p=(s&r.childLanes)!==0,Xt||p){if(d=kt,d!==null&&(S=rv(d,s),S!==0&&S!==v.retryLane))throw v.retryLane=S,Hi(r,S),qn(d,r,S),Wh;Kc(),i=hx(r,i,s)}else r=v.treeContext,Nt=wr(S.nextSibling),vn=i,it=!0,$a=null,br=!1,r!==null&&Wv(i,r),i=Uc(i,d),i.flags|=4096;return i}return r=sa(r.child,{mode:d.mode,children:d.children}),r.ref=i.ref,i.child=r,r.return=i,r}function Pc(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 em(r,i,s,d,p){return Gi(i),s=Dh(r,i,s,d,void 0,p),d=Mh(),r!==null&&!Xt?(Lh(r,i,p),ha(r,i,p)):(it&&d&&ph(i),i.flags|=1,xn(r,i,s,p),i.child)}function mx(r,i,s,d,p,v){return Gi(i),i.updateQueue=null,s=yb(i,d,s,p),gb(r),d=Mh(),r!==null&&!Xt?(Lh(r,i,v),ha(r,i,v)):(it&&d&&ph(i),i.flags|=1,xn(r,i,s,v),i.child)}function px(r,i,s,d,p){if(Gi(i),i.stateNode===null){var v=Fl,S=s.contextType;typeof S=="object"&&S!==null&&(v=bn(S)),v=new s(d,v),i.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=Xh,i.stateNode=v,v._reactInternals=i,v=i.stateNode,v.props=d,v.state=i.memoizedState,v.refs={},Eh(i),S=s.contextType,v.context=typeof S=="object"&&S!==null?bn(S):Fl,v.state=i.memoizedState,S=s.getDerivedStateFromProps,typeof S=="function"&&(Yh(i,s,S,d),v.state=i.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(S=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),S!==v.state&&Xh.enqueueReplaceState(v,v.state,null),zo(i,d,v,p),Ro(),v.state=i.memoizedState),typeof v.componentDidMount=="function"&&(i.flags|=4194308),d=!0}else if(r===null){v=i.stateNode;var _=i.memoizedProps,$=el(s,_);v.props=$;var G=v.context,ae=s.contextType;S=Fl,typeof ae=="object"&&ae!==null&&(S=bn(ae));var de=s.getDerivedStateFromProps;ae=typeof de=="function"||typeof v.getSnapshotBeforeUpdate=="function",_=i.pendingProps!==_,ae||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(_||G!==S)&&tx(i,v,d,S),Ha=!1;var Y=i.memoizedState;v.state=Y,zo(i,d,v,p),Ro(),G=i.memoizedState,_||Y!==G||Ha?(typeof de=="function"&&(Yh(i,s,de,d),G=i.memoizedState),($=Ha||ex(i,s,$,d,Y,G,S))?(ae||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=d,i.memoizedState=G),v.props=d,v.state=G,v.context=S,d=$):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),d=!1)}else{v=i.stateNode,Nh(r,i),S=i.memoizedProps,ae=el(s,S),v.props=ae,de=i.pendingProps,Y=v.context,G=s.contextType,$=Fl,typeof G=="object"&&G!==null&&($=bn(G)),_=s.getDerivedStateFromProps,(G=typeof _=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(S!==de||Y!==$)&&tx(i,v,d,$),Ha=!1,Y=i.memoizedState,v.state=Y,zo(i,d,v,p),Ro();var J=i.memoizedState;S!==de||Y!==J||Ha||r!==null&&r.dependencies!==null&&xc(r.dependencies)?(typeof _=="function"&&(Yh(i,s,_,d),J=i.memoizedState),(ae=Ha||ex(i,s,ae,d,Y,J,$)||r!==null&&r.dependencies!==null&&xc(r.dependencies))?(G||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(d,J,$),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(d,J,$)),typeof v.componentDidUpdate=="function"&&(i.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof v.componentDidUpdate!="function"||S===r.memoizedProps&&Y===r.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||S===r.memoizedProps&&Y===r.memoizedState||(i.flags|=1024),i.memoizedProps=d,i.memoizedState=J),v.props=d,v.state=J,v.context=$,d=ae):(typeof v.componentDidUpdate!="function"||S===r.memoizedProps&&Y===r.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||S===r.memoizedProps&&Y===r.memoizedState||(i.flags|=1024),d=!1)}return v=d,Pc(r,i),d=(i.flags&128)!==0,v||d?(v=i.stateNode,s=d&&typeof s.getDerivedStateFromError!="function"?null:v.render(),i.flags|=1,r!==null&&d?(i.child=Ji(i,r.child,null,p),i.child=Ji(i,null,s,p)):xn(r,i,s,p),i.memoizedState=v.state,r=i.child):r=ha(r,i,p),r}function gx(r,i,s,d){return Vi(),i.flags|=256,xn(r,i,s,d),i.child}var tm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function nm(r){return{baseLanes:r,cachePool:ib()}}function rm(r,i,s){return r=r!==null?r.childLanes&~s:0,i&&(r|=nr),r}function yx(r,i,s){var d=i.pendingProps,p=!1,v=(i.flags&128)!==0,S;if((S=v)||(S=r!==null&&r.memoizedState===null?!1:(Vt.current&2)!==0),S&&(p=!0,i.flags&=-129),S=(i.flags&32)!==0,i.flags&=-33,r===null){if(it){if(p?Qa(i):Ga(),(r=Nt)?(r=C0(r,br),r=r!==null&&r.data!=="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:Ba!==null?{id:Br,overflow:$r}:null,retryLane:536870912,hydrationErrors:null},s=Yv(r),s.return=i,i.child=s,vn=i,Nt=null)):r=null,r===null)throw Fa(i);return Pm(r)?i.lanes=32:i.lanes=536870912,null}var _=d.children;return d=d.fallback,p?(Ga(),p=i.mode,_=Bc({mode:"hidden",children:_},p),d=Zi(d,p,s,null),_.return=i,d.return=i,_.sibling=d,i.child=_,d=i.child,d.memoizedState=nm(s),d.childLanes=rm(r,S,s),i.memoizedState=tm,Io(null,d)):(Qa(i),am(i,_))}var $=r.memoizedState;if($!==null&&(_=$.dehydrated,_!==null)){if(v)i.flags&256?(Qa(i),i.flags&=-257,i=im(r,i,s)):i.memoizedState!==null?(Ga(),i.child=r.child,i.flags|=128,i=null):(Ga(),_=d.fallback,p=i.mode,d=Bc({mode:"visible",children:d.children},p),_=Zi(_,p,s,null),_.flags|=2,d.return=i,_.return=i,d.sibling=_,i.child=d,Ji(i,r.child,null,s),d=i.child,d.memoizedState=nm(s),d.childLanes=rm(r,S,s),i.memoizedState=tm,i=Io(null,d));else if(Qa(i),Pm(_)){if(S=_.nextSibling&&_.nextSibling.dataset,S)var G=S.dgst;S=G,d=Error(a(419)),d.stack="",d.digest=S,Co({value:d,source:null,stack:null}),i=im(r,i,s)}else if(Xt||Vl(r,i,s,!1),S=(s&r.childLanes)!==0,Xt||S){if(S=kt,S!==null&&(d=rv(S,s),d!==0&&d!==$.retryLane))throw $.retryLane=d,Hi(r,d),qn(S,r,d),Wh;Um(_)||Kc(),i=im(r,i,s)}else Um(_)?(i.flags|=192,i.child=r.child,i=null):(r=$.treeContext,Nt=wr(_.nextSibling),vn=i,it=!0,$a=null,br=!1,r!==null&&Wv(i,r),i=am(i,d.children),i.flags|=4096);return i}return p?(Ga(),_=d.fallback,p=i.mode,$=r.child,G=$.sibling,d=sa($,{mode:"hidden",children:d.children}),d.subtreeFlags=$.subtreeFlags&65011712,G!==null?_=sa(G,_):(_=Zi(_,p,s,null),_.flags|=2),_.return=i,d.return=i,d.sibling=_,i.child=d,Io(null,d),d=i.child,_=r.child.memoizedState,_===null?_=nm(s):(p=_.cachePool,p!==null?($=Kt._currentValue,p=p.parent!==$?{parent:$,pool:$}:p):p=ib(),_={baseLanes:_.baseLanes|s,cachePool:p}),d.memoizedState=_,d.childLanes=rm(r,S,s),i.memoizedState=tm,Io(r.child,d)):(Qa(i),s=r.child,r=s.sibling,s=sa(s,{mode:"visible",children:d.children}),s.return=i,s.sibling=null,r!==null&&(S=i.deletions,S===null?(i.deletions=[r],i.flags|=16):S.push(r)),i.child=s,i.memoizedState=null,s)}function am(r,i){return i=Bc({mode:"visible",children:i},r.mode),i.return=r,r.child=i}function Bc(r,i){return r=Jn(22,r,null,i),r.lanes=0,r}function im(r,i,s){return Ji(i,r.child,null,s),r=am(i,i.pendingProps.children),r.flags|=2,i.memoizedState=null,r}function vx(r,i,s){r.lanes|=i;var d=r.alternate;d!==null&&(d.lanes|=i),xh(r.return,i,s)}function lm(r,i,s,d,p,v){var S=r.memoizedState;S===null?r.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:d,tail:s,tailMode:p,treeForkCount:v}:(S.isBackwards=i,S.rendering=null,S.renderingStartTime=0,S.last=d,S.tail=s,S.tailMode=p,S.treeForkCount=v)}function bx(r,i,s){var d=i.pendingProps,p=d.revealOrder,v=d.tail;d=d.children;var S=Vt.current,_=(S&2)!==0;if(_?(S=S&1|2,i.flags|=128):S&=1,T(Vt,S),xn(r,i,d,s),d=it?jo:0,!_&&r!==null&&(r.flags&128)!==0)e:for(r=i.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&vx(r,s,i);else if(r.tag===19)vx(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&&_c(r)===null&&(p=s),s=s.sibling;s=p,s===null?(p=i.child,i.child=null):(p=s.sibling,s.sibling=null),lm(i,!1,p,s,v,d);break;case"backwards":case"unstable_legacy-backwards":for(s=null,p=i.child,i.child=null;p!==null;){if(r=p.alternate,r!==null&&_c(r)===null){i.child=p;break}r=p.sibling,p.sibling=s,s=p,p=r}lm(i,!0,s,null,v,d);break;case"together":lm(i,!1,null,null,void 0,d);break;default:i.memoizedState=null}return i.child}function ha(r,i,s){if(r!==null&&(i.dependencies=r.dependencies),Xa|=i.lanes,(s&i.childLanes)===0)if(r!==null){if(Vl(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=sa(r,r.pendingProps),i.child=s,s.return=i;r.sibling!==null;)r=r.sibling,s=s.sibling=sa(r,r.pendingProps),s.return=i;s.sibling=null}return i.child}function sm(r,i){return(r.lanes&i)!==0?!0:(r=r.dependencies,!!(r!==null&&xc(r)))}function z_(r,i,s){switch(i.tag){case 3:we(i,i.stateNode.containerInfo),qa(i,Kt,r.memoizedState.cache),Vi();break;case 27:case 5:Xe(i);break;case 4:we(i,i.stateNode.containerInfo);break;case 10:qa(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,zh(i),null;break;case 13:var d=i.memoizedState;if(d!==null)return d.dehydrated!==null?(Qa(i),i.flags|=128,null):(s&i.child.childLanes)!==0?yx(r,i,s):(Qa(i),r=ha(r,i,s),r!==null?r.sibling:null);Qa(i);break;case 19:var p=(r.flags&128)!==0;if(d=(s&i.childLanes)!==0,d||(Vl(r,i,s,!1),d=(s&i.childLanes)!==0),p){if(d)return bx(r,i,s);i.flags|=128}if(p=i.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),T(Vt,Vt.current),d)break;return null;case 22:return i.lanes=0,dx(r,i,s,i.pendingProps);case 24:qa(i,Kt,r.memoizedState.cache)}return ha(r,i,s)}function xx(r,i,s){if(r!==null)if(r.memoizedProps!==i.pendingProps)Xt=!0;else{if(!sm(r,s)&&(i.flags&128)===0)return Xt=!1,z_(r,i,s);Xt=(r.flags&131072)!==0}else Xt=!1,it&&(i.flags&1048576)!==0&&Jv(i,jo,i.index);switch(i.lanes=0,i.tag){case 16:e:{var d=i.pendingProps;if(r=Yi(i.elementType),i.type=r,typeof r=="function")fh(r)?(d=el(r,d),i.tag=1,i=px(null,i,r,d,s)):(i.tag=0,i=em(null,i,r,d,s));else{if(r!=null){var p=r.$$typeof;if(p===U){i.tag=11,i=ox(null,i,r,d,s);break e}else if(p===M){i.tag=14,i=ux(null,i,r,d,s);break e}}throw i=he(r)||r,Error(a(306,i,""))}}return i;case 0:return em(r,i,i.type,i.pendingProps,s);case 1:return d=i.type,p=el(d,i.pendingProps),px(r,i,d,p,s);case 3:e:{if(we(i,i.stateNode.containerInfo),r===null)throw Error(a(387));d=i.pendingProps;var v=i.memoizedState;p=v.element,Nh(r,i),zo(i,d,null,s);var S=i.memoizedState;if(d=S.cache,qa(i,Kt,d),d!==v.cache&&wh(i,[Kt],s,!0),Ro(),d=S.element,v.isDehydrated)if(v={element:d,isDehydrated:!1,cache:S.cache},i.updateQueue.baseState=v,i.memoizedState=v,i.flags&256){i=gx(r,i,d,s);break e}else if(d!==p){p=gr(Error(a(424)),i),Co(p),i=gx(r,i,d,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(Nt=wr(r.firstChild),vn=i,it=!0,$a=null,br=!0,s=db(i,null,d,s),i.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(Vi(),d===p){i=ha(r,i,s);break e}xn(r,i,d,s)}i=i.child}return i;case 26:return Pc(r,i),r===null?(s=R0(i.type,null,i.pendingProps,null))?i.memoizedState=s:it||(s=i.type,r=i.pendingProps,d=nd(ce.current).createElement(s),d[yn]=i,d[In]=r,wn(d,s,r),on(d),i.stateNode=d):i.memoizedState=R0(i.type,r.memoizedProps,i.pendingProps,r.memoizedState),null;case 27:return Xe(i),r===null&&it&&(d=i.stateNode=_0(i.type,i.pendingProps,ce.current),vn=i,br=!0,p=Nt,ni(i.type)?(Bm=p,Nt=wr(d.firstChild)):Nt=p),xn(r,i,i.pendingProps.children,s),Pc(r,i),r===null&&(i.flags|=4194304),i.child;case 5:return r===null&&it&&((p=d=Nt)&&(d=o2(d,i.type,i.pendingProps,br),d!==null?(i.stateNode=d,vn=i,Nt=wr(d.firstChild),br=!1,p=!0):p=!1),p||Fa(i)),Xe(i),p=i.type,v=i.pendingProps,S=r!==null?r.memoizedProps:null,d=v.children,Mm(p,v)?d=null:S!==null&&Mm(p,S)&&(i.flags|=32),i.memoizedState!==null&&(p=Dh(r,i,k_,null,null,s),Jo._currentValue=p),Pc(r,i),xn(r,i,d,s),i.child;case 6:return r===null&&it&&((r=s=Nt)&&(s=u2(s,i.pendingProps,br),s!==null?(i.stateNode=s,vn=i,Nt=null,r=!0):r=!1),r||Fa(i)),null;case 13:return yx(r,i,s);case 4:return we(i,i.stateNode.containerInfo),d=i.pendingProps,r===null?i.child=Ji(i,null,d,s):xn(r,i,d,s),i.child;case 11:return ox(r,i,i.type,i.pendingProps,s);case 7:return xn(r,i,i.pendingProps,s),i.child;case 8:return xn(r,i,i.pendingProps.children,s),i.child;case 12:return xn(r,i,i.pendingProps.children,s),i.child;case 10:return d=i.pendingProps,qa(i,i.type,d.value),xn(r,i,d.children,s),i.child;case 9:return p=i.type._context,d=i.pendingProps.children,Gi(i),p=bn(p),d=d(p),i.flags|=1,xn(r,i,d,s),i.child;case 14:return ux(r,i,i.type,i.pendingProps,s);case 15:return cx(r,i,i.type,i.pendingProps,s);case 19:return bx(r,i,s);case 31:return R_(r,i,s);case 22:return dx(r,i,s,i.pendingProps);case 24:return Gi(i),d=bn(Kt),r===null?(p=jh(),p===null&&(p=kt,v=Sh(),p.pooledCache=v,v.refCount++,v!==null&&(p.pooledCacheLanes|=s),p=v),i.memoizedState={parent:d,cache:p},Eh(i),qa(i,Kt,p)):((r.lanes&s)!==0&&(Nh(r,i),zo(i,null,null,s),Ro()),p=r.memoizedState,v=i.memoizedState,p.parent!==d?(p={parent:d,cache:d},i.memoizedState=p,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=p),qa(i,Kt,d)):(d=v.cache,qa(i,Kt,d),d!==p.cache&&wh(i,[Kt],s,!0))),xn(r,i,i.pendingProps.children,s),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function ma(r){r.flags|=4}function om(r,i,s,d,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(Qx())r.flags|=8192;else throw Xi=jc,Ch}else r.flags&=-16777217}function wx(r,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!L0(i))if(Qx())r.flags|=8192;else throw Xi=jc,Ch}function $c(r,i){i!==null&&(r.flags|=4),r.flags&16384&&(i=r.tag!==22?Se():536870912,r.lanes|=i,as|=i)}function Uo(r,i){if(!it)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 d=null;s!==null;)s.alternate!==null&&(d=s),s=s.sibling;d===null?i||r.tail===null?r.tail=null:r.tail.sibling=null:d.sibling=null}}function _t(r){var i=r.alternate!==null&&r.alternate.child===r.child,s=0,d=0;if(i)for(var p=r.child;p!==null;)s|=p.lanes|p.childLanes,d|=p.subtreeFlags&65011712,d|=p.flags&65011712,p.return=r,p=p.sibling;else for(p=r.child;p!==null;)s|=p.lanes|p.childLanes,d|=p.subtreeFlags,d|=p.flags,p.return=r,p=p.sibling;return r.subtreeFlags|=d,r.childLanes=s,i}function O_(r,i,s){var d=i.pendingProps;switch(gh(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return _t(i),null;case 1:return _t(i),null;case 3:return s=i.stateNode,d=null,r!==null&&(d=r.memoizedState.cache),i.memoizedState.cache!==d&&(i.flags|=2048),ca(Kt),pe(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(r===null||r.child===null)&&(Zl(i)?ma(i):r===null||r.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,vh())),_t(i),null;case 26:var p=i.type,v=i.memoizedState;return r===null?(ma(i),v!==null?(_t(i),wx(i,v)):(_t(i),om(i,p,null,d,s))):v?v!==r.memoizedState?(ma(i),_t(i),wx(i,v)):(_t(i),i.flags&=-16777217):(r=r.memoizedProps,r!==d&&ma(i),_t(i),om(i,p,r,d,s)),null;case 27:if(Le(i),s=ce.current,p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==d&&ma(i);else{if(!d){if(i.stateNode===null)throw Error(a(166));return _t(i),null}r=q.current,Zl(i)?eb(i):(r=_0(p,d,s),i.stateNode=r,ma(i))}return _t(i),null;case 5:if(Le(i),p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==d&&ma(i);else{if(!d){if(i.stateNode===null)throw Error(a(166));return _t(i),null}if(v=q.current,Zl(i))eb(i);else{var S=nd(ce.current);switch(v){case 1:v=S.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:v=S.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":v=S.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":v=S.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":v=S.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof d.is=="string"?S.createElement("select",{is:d.is}):S.createElement("select"),d.multiple?v.multiple=!0:d.size&&(v.size=d.size);break;default:v=typeof d.is=="string"?S.createElement(p,{is:d.is}):S.createElement(p)}}v[yn]=i,v[In]=d;e:for(S=i.child;S!==null;){if(S.tag===5||S.tag===6)v.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===i)break e;for(;S.sibling===null;){if(S.return===null||S.return===i)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}i.stateNode=v;e:switch(wn(v,p,d),p){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}d&&ma(i)}}return _t(i),om(i,i.type,r===null?null:r.memoizedProps,i.pendingProps,s),null;case 6:if(r&&i.stateNode!=null)r.memoizedProps!==d&&ma(i);else{if(typeof d!="string"&&i.stateNode===null)throw Error(a(166));if(r=ce.current,Zl(i)){if(r=i.stateNode,s=i.memoizedProps,d=null,p=vn,p!==null)switch(p.tag){case 27:case 5:d=p.memoizedProps}r[yn]=i,r=!!(r.nodeValue===s||d!==null&&d.suppressHydrationWarning===!0||y0(r.nodeValue,s)),r||Fa(i,!0)}else r=nd(r).createTextNode(d),r[yn]=i,i.stateNode=r}return _t(i),null;case 31:if(s=i.memoizedState,r===null||r.memoizedState!==null){if(d=Zl(i),s!==null){if(r===null){if(!d)throw Error(a(318));if(r=i.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(557));r[yn]=i}else Vi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;_t(i),r=!1}else s=vh(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=s),r=!0;if(!r)return i.flags&256?(er(i),i):(er(i),null);if((i.flags&128)!==0)throw Error(a(558))}return _t(i),null;case 13:if(d=i.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(p=Zl(i),d!==null&&d.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[yn]=i}else Vi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;_t(i),p=!1}else p=vh(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=p),p=!0;if(!p)return i.flags&256?(er(i),i):(er(i),null)}return er(i),(i.flags&128)!==0?(i.lanes=s,i):(s=d!==null,r=r!==null&&r.memoizedState!==null,s&&(d=i.child,p=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(p=d.alternate.memoizedState.cachePool.pool),v=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(v=d.memoizedState.cachePool.pool),v!==p&&(d.flags|=2048)),s!==r&&s&&(i.child.flags|=8192),$c(i,i.updateQueue),_t(i),null);case 4:return pe(),r===null&&Am(i.stateNode.containerInfo),_t(i),null;case 10:return ca(i.type),_t(i),null;case 19:if(B(Vt),d=i.memoizedState,d===null)return _t(i),null;if(p=(i.flags&128)!==0,v=d.rendering,v===null)if(p)Uo(d,!1);else{if(Ut!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(v=_c(r),v!==null){for(i.flags|=128,Uo(d,!1),r=v.updateQueue,i.updateQueue=r,$c(i,r),i.subtreeFlags=0,r=s,s=i.child;s!==null;)Kv(s,r),s=s.sibling;return T(Vt,Vt.current&1|2),it&&oa(i,d.treeForkCount),i.child}r=r.sibling}d.tail!==null&&hn()>Vc&&(i.flags|=128,p=!0,Uo(d,!1),i.lanes=4194304)}else{if(!p)if(r=_c(v),r!==null){if(i.flags|=128,p=!0,r=r.updateQueue,i.updateQueue=r,$c(i,r),Uo(d,!0),d.tail===null&&d.tailMode==="hidden"&&!v.alternate&&!it)return _t(i),null}else 2*hn()-d.renderingStartTime>Vc&&s!==536870912&&(i.flags|=128,p=!0,Uo(d,!1),i.lanes=4194304);d.isBackwards?(v.sibling=i.child,i.child=v):(r=d.last,r!==null?r.sibling=v:i.child=v,d.last=v)}return d.tail!==null?(r=d.tail,d.rendering=r,d.tail=r.sibling,d.renderingStartTime=hn(),r.sibling=null,s=Vt.current,T(Vt,p?s&1|2:s&1),it&&oa(i,d.treeForkCount),r):(_t(i),null);case 22:case 23:return er(i),Rh(),d=i.memoizedState!==null,r!==null?r.memoizedState!==null!==d&&(i.flags|=8192):d&&(i.flags|=8192),d?(s&536870912)!==0&&(i.flags&128)===0&&(_t(i),i.subtreeFlags&6&&(i.flags|=8192)):_t(i),s=i.updateQueue,s!==null&&$c(i,s.retryQueue),s=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),d=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(d=i.memoizedState.cachePool.pool),d!==s&&(i.flags|=2048),r!==null&&B(Ki),null;case 24:return s=null,r!==null&&(s=r.memoizedState.cache),i.memoizedState.cache!==s&&(i.flags|=2048),ca(Kt),_t(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function D_(r,i){switch(gh(i),i.tag){case 1:return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return ca(Kt),pe(),r=i.flags,(r&65536)!==0&&(r&128)===0?(i.flags=r&-65537|128,i):null;case 26:case 27:case 5:return Le(i),null;case 31:if(i.memoizedState!==null){if(er(i),i.alternate===null)throw Error(a(340));Vi()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 13:if(er(i),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(a(340));Vi()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return B(Vt),null;case 4:return pe(),null;case 10:return ca(i.type),null;case 22:case 23:return er(i),Rh(),r!==null&&B(Ki),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 24:return ca(Kt),null;case 25:return null;default:return null}}function Sx(r,i){switch(gh(i),i.tag){case 3:ca(Kt),pe();break;case 26:case 27:case 5:Le(i);break;case 4:pe();break;case 31:i.memoizedState!==null&&er(i);break;case 13:er(i);break;case 19:B(Vt);break;case 10:ca(i.type);break;case 22:case 23:er(i),Rh(),r!==null&&B(Ki);break;case 24:ca(Kt)}}function Po(r,i){try{var s=i.updateQueue,d=s!==null?s.lastEffect:null;if(d!==null){var p=d.next;s=p;do{if((s.tag&r)===r){d=void 0;var v=s.create,S=s.inst;d=v(),S.destroy=d}s=s.next}while(s!==p)}}catch(_){yt(i,i.return,_)}}function Ka(r,i,s){try{var d=i.updateQueue,p=d!==null?d.lastEffect:null;if(p!==null){var v=p.next;d=v;do{if((d.tag&r)===r){var S=d.inst,_=S.destroy;if(_!==void 0){S.destroy=void 0,p=i;var $=s,G=_;try{G()}catch(ae){yt(p,$,ae)}}}d=d.next}while(d!==v)}}catch(ae){yt(i,i.return,ae)}}function kx(r){var i=r.updateQueue;if(i!==null){var s=r.stateNode;try{hb(i,s)}catch(d){yt(r,r.return,d)}}}function jx(r,i,s){s.props=el(r.type,r.memoizedProps),s.state=r.memoizedState;try{s.componentWillUnmount()}catch(d){yt(r,i,d)}}function Bo(r,i){try{var s=r.ref;if(s!==null){switch(r.tag){case 26:case 27:case 5:var d=r.stateNode;break;case 30:d=r.stateNode;break;default:d=r.stateNode}typeof s=="function"?r.refCleanup=s(d):s.current=d}}catch(p){yt(r,i,p)}}function Fr(r,i){var s=r.ref,d=r.refCleanup;if(s!==null)if(typeof d=="function")try{d()}catch(p){yt(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){yt(r,i,p)}else s.current=null}function Cx(r){var i=r.type,s=r.memoizedProps,d=r.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":s.autoFocus&&d.focus();break e;case"img":s.src?d.src=s.src:s.srcSet&&(d.srcset=s.srcSet)}}catch(p){yt(r,r.return,p)}}function um(r,i,s){try{var d=r.stateNode;n2(d,r.type,s,i),d[In]=i}catch(p){yt(r,r.return,p)}}function Ex(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&ni(r.type)||r.tag===4}function cm(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||Ex(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&&ni(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 dm(r,i,s){var d=r.tag;if(d===5||d===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=ia));else if(d!==4&&(d===27&&ni(r.type)&&(s=r.stateNode,i=null),r=r.child,r!==null))for(dm(r,i,s),r=r.sibling;r!==null;)dm(r,i,s),r=r.sibling}function Fc(r,i,s){var d=r.tag;if(d===5||d===6)r=r.stateNode,i?s.insertBefore(r,i):s.appendChild(r);else if(d!==4&&(d===27&&ni(r.type)&&(s=r.stateNode),r=r.child,r!==null))for(Fc(r,i,s),r=r.sibling;r!==null;)Fc(r,i,s),r=r.sibling}function Nx(r){var i=r.stateNode,s=r.memoizedProps;try{for(var d=r.type,p=i.attributes;p.length;)i.removeAttributeNode(p[0]);wn(i,d,s),i[yn]=r,i[In]=s}catch(v){yt(r,r.return,v)}}var pa=!1,Jt=!1,fm=!1,_x=typeof WeakSet=="function"?WeakSet:Set,un=null;function M_(r,i){if(r=r.containerInfo,Om=ud,r=Bv(r),ih(r)){if("selectionStart"in r)var s={start:r.selectionStart,end:r.selectionEnd};else e:{s=(s=r.ownerDocument)&&s.defaultView||window;var d=s.getSelection&&s.getSelection();if(d&&d.rangeCount!==0){s=d.anchorNode;var p=d.anchorOffset,v=d.focusNode;d=d.focusOffset;try{s.nodeType,v.nodeType}catch{s=null;break e}var S=0,_=-1,$=-1,G=0,ae=0,de=r,Y=null;t:for(;;){for(var J;de!==s||p!==0&&de.nodeType!==3||(_=S+p),de!==v||d!==0&&de.nodeType!==3||($=S+d),de.nodeType===3&&(S+=de.nodeValue.length),(J=de.firstChild)!==null;)Y=de,de=J;for(;;){if(de===r)break t;if(Y===s&&++G===p&&(_=S),Y===v&&++ae===d&&($=S),(J=de.nextSibling)!==null)break;de=Y,Y=de.parentNode}de=J}s=_===-1||$===-1?null:{start:_,end:$}}else s=null}s=s||{start:0,end:0}}else s=null;for(Dm={focusedElem:r,selectionRange:s},ud=!1,un=i;un!==null;)if(i=un,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,un=r;else for(;un!==null;){switch(i=un,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,d=s.stateNode;try{var Ce=el(s.type,p);r=d.getSnapshotBeforeUpdate(Ce,v),d.__reactInternalSnapshotBeforeUpdate=r}catch(De){yt(s,s.return,De)}}break;case 3:if((r&1024)!==0){if(r=i.stateNode.containerInfo,s=r.nodeType,s===9)Im(r);else if(s===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":Im(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,un=r;break}un=i.return}}function Tx(r,i,s){var d=s.flags;switch(s.tag){case 0:case 11:case 15:ya(r,s),d&4&&Po(5,s);break;case 1:if(ya(r,s),d&4)if(r=s.stateNode,i===null)try{r.componentDidMount()}catch(S){yt(s,s.return,S)}else{var p=el(s.type,i.memoizedProps);i=i.memoizedState;try{r.componentDidUpdate(p,i,r.__reactInternalSnapshotBeforeUpdate)}catch(S){yt(s,s.return,S)}}d&64&&kx(s),d&512&&Bo(s,s.return);break;case 3:if(ya(r,s),d&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{hb(r,i)}catch(S){yt(s,s.return,S)}}break;case 27:i===null&&d&4&&Nx(s);case 26:case 5:ya(r,s),i===null&&d&4&&Cx(s),d&512&&Bo(s,s.return);break;case 12:ya(r,s);break;case 31:ya(r,s),d&4&&zx(r,s);break;case 13:ya(r,s),d&4&&Ox(r,s),d&64&&(r=s.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(s=H_.bind(null,s),c2(r,s))));break;case 22:if(d=s.memoizedState!==null||pa,!d){i=i!==null&&i.memoizedState!==null||Jt,p=pa;var v=Jt;pa=d,(Jt=i)&&!v?va(r,s,(s.subtreeFlags&8772)!==0):ya(r,s),pa=p,Jt=v}break;case 30:break;default:ya(r,s)}}function Ax(r){var i=r.alternate;i!==null&&(r.alternate=null,Ax(i)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(i=r.stateNode,i!==null&&Ff(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 Tt=null,Pn=!1;function ga(r,i,s){for(s=s.child;s!==null;)Rx(r,i,s),s=s.sibling}function Rx(r,i,s){if(Zt&&typeof Zt.onCommitFiberUnmount=="function")try{Zt.onCommitFiberUnmount(nn,s)}catch{}switch(s.tag){case 26:Jt||Fr(s,i),ga(r,i,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Jt||Fr(s,i);var d=Tt,p=Pn;ni(s.type)&&(Tt=s.stateNode,Pn=!1),ga(r,i,s),Ko(s.stateNode),Tt=d,Pn=p;break;case 5:Jt||Fr(s,i);case 6:if(d=Tt,p=Pn,Tt=null,ga(r,i,s),Tt=d,Pn=p,Tt!==null)if(Pn)try{(Tt.nodeType===9?Tt.body:Tt.nodeName==="HTML"?Tt.ownerDocument.body:Tt).removeChild(s.stateNode)}catch(v){yt(s,i,v)}else try{Tt.removeChild(s.stateNode)}catch(v){yt(s,i,v)}break;case 18:Tt!==null&&(Pn?(r=Tt,k0(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,s.stateNode),fs(r)):k0(Tt,s.stateNode));break;case 4:d=Tt,p=Pn,Tt=s.stateNode.containerInfo,Pn=!0,ga(r,i,s),Tt=d,Pn=p;break;case 0:case 11:case 14:case 15:Ka(2,s,i),Jt||Ka(4,s,i),ga(r,i,s);break;case 1:Jt||(Fr(s,i),d=s.stateNode,typeof d.componentWillUnmount=="function"&&jx(s,i,d)),ga(r,i,s);break;case 21:ga(r,i,s);break;case 22:Jt=(d=Jt)||s.memoizedState!==null,ga(r,i,s),Jt=d;break;default:ga(r,i,s)}}function zx(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{fs(r)}catch(s){yt(i,i.return,s)}}}function Ox(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{fs(r)}catch(s){yt(i,i.return,s)}}function L_(r){switch(r.tag){case 31:case 13:case 19:var i=r.stateNode;return i===null&&(i=r.stateNode=new _x),i;case 22:return r=r.stateNode,i=r._retryCache,i===null&&(i=r._retryCache=new _x),i;default:throw Error(a(435,r.tag))}}function qc(r,i){var s=L_(r);i.forEach(function(d){if(!s.has(d)){s.add(d);var p=Z_.bind(null,r,d);d.then(p,p)}})}function Bn(r,i){var s=i.deletions;if(s!==null)for(var d=0;d<s.length;d++){var p=s[d],v=r,S=i,_=S;e:for(;_!==null;){switch(_.tag){case 27:if(ni(_.type)){Tt=_.stateNode,Pn=!1;break e}break;case 5:Tt=_.stateNode,Pn=!1;break e;case 3:case 4:Tt=_.stateNode.containerInfo,Pn=!0;break e}_=_.return}if(Tt===null)throw Error(a(160));Rx(v,S,p),Tt=null,Pn=!1,v=p.alternate,v!==null&&(v.return=null),p.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)Dx(i,r),i=i.sibling}var Dr=null;function Dx(r,i){var s=r.alternate,d=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:Bn(i,r),$n(r),d&4&&(Ka(3,r,r.return),Po(3,r),Ka(5,r,r.return));break;case 1:Bn(i,r),$n(r),d&512&&(Jt||s===null||Fr(s,s.return)),d&64&&pa&&(r=r.updateQueue,r!==null&&(d=r.callbacks,d!==null&&(s=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=s===null?d:s.concat(d))));break;case 26:var p=Dr;if(Bn(i,r),$n(r),d&512&&(Jt||s===null||Fr(s,s.return)),d&4){var v=s!==null?s.memoizedState:null;if(d=r.memoizedState,s===null)if(d===null)if(r.stateNode===null){e:{d=r.type,s=r.memoizedProps,p=p.ownerDocument||p;t:switch(d){case"title":v=p.getElementsByTagName("title")[0],(!v||v[ho]||v[yn]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=p.createElement(d),p.head.insertBefore(v,p.querySelector("head > title"))),wn(v,d,s),v[yn]=r,on(v),d=v;break e;case"link":var S=D0("link","href",p).get(d+(s.href||""));if(S){for(var _=0;_<S.length;_++)if(v=S[_],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)){S.splice(_,1);break t}}v=p.createElement(d),wn(v,d,s),p.head.appendChild(v);break;case"meta":if(S=D0("meta","content",p).get(d+(s.content||""))){for(_=0;_<S.length;_++)if(v=S[_],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)){S.splice(_,1);break t}}v=p.createElement(d),wn(v,d,s),p.head.appendChild(v);break;default:throw Error(a(468,d))}v[yn]=r,on(v),d=v}r.stateNode=d}else M0(p,r.type,r.stateNode);else r.stateNode=O0(p,d,r.memoizedProps);else v!==d?(v===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):v.count--,d===null?M0(p,r.type,r.stateNode):O0(p,d,r.memoizedProps)):d===null&&r.stateNode!==null&&um(r,r.memoizedProps,s.memoizedProps)}break;case 27:Bn(i,r),$n(r),d&512&&(Jt||s===null||Fr(s,s.return)),s!==null&&d&4&&um(r,r.memoizedProps,s.memoizedProps);break;case 5:if(Bn(i,r),$n(r),d&512&&(Jt||s===null||Fr(s,s.return)),r.flags&32){p=r.stateNode;try{Ml(p,"")}catch(Ce){yt(r,r.return,Ce)}}d&4&&r.stateNode!=null&&(p=r.memoizedProps,um(r,p,s!==null?s.memoizedProps:p)),d&1024&&(fm=!0);break;case 6:if(Bn(i,r),$n(r),d&4){if(r.stateNode===null)throw Error(a(162));d=r.memoizedProps,s=r.stateNode;try{s.nodeValue=d}catch(Ce){yt(r,r.return,Ce)}}break;case 3:if(id=null,p=Dr,Dr=rd(i.containerInfo),Bn(i,r),Dr=p,$n(r),d&4&&s!==null&&s.memoizedState.isDehydrated)try{fs(i.containerInfo)}catch(Ce){yt(r,r.return,Ce)}fm&&(fm=!1,Mx(r));break;case 4:d=Dr,Dr=rd(r.stateNode.containerInfo),Bn(i,r),$n(r),Dr=d;break;case 12:Bn(i,r),$n(r);break;case 31:Bn(i,r),$n(r),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,qc(r,d)));break;case 13:Bn(i,r),$n(r),r.child.flags&8192&&r.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Zc=hn()),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,qc(r,d)));break;case 22:p=r.memoizedState!==null;var $=s!==null&&s.memoizedState!==null,G=pa,ae=Jt;if(pa=G||p,Jt=ae||$,Bn(i,r),Jt=ae,pa=G,$n(r),d&8192)e:for(i=r.stateNode,i._visibility=p?i._visibility&-2:i._visibility|1,p&&(s===null||$||pa||Jt||tl(r)),s=null,i=r;;){if(i.tag===5||i.tag===26){if(s===null){$=s=i;try{if(v=$.stateNode,p)S=v.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{_=$.stateNode;var de=$.memoizedProps.style,Y=de!=null&&de.hasOwnProperty("display")?de.display:null;_.style.display=Y==null||typeof Y=="boolean"?"":(""+Y).trim()}}catch(Ce){yt($,$.return,Ce)}}}else if(i.tag===6){if(s===null){$=i;try{$.stateNode.nodeValue=p?"":$.memoizedProps}catch(Ce){yt($,$.return,Ce)}}}else if(i.tag===18){if(s===null){$=i;try{var J=$.stateNode;p?j0(J,!0):j0($.stateNode,!1)}catch(Ce){yt($,$.return,Ce)}}}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}d&4&&(d=r.updateQueue,d!==null&&(s=d.retryQueue,s!==null&&(d.retryQueue=null,qc(r,s))));break;case 19:Bn(i,r),$n(r),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,qc(r,d)));break;case 30:break;case 21:break;default:Bn(i,r),$n(r)}}function $n(r){var i=r.flags;if(i&2){try{for(var s,d=r.return;d!==null;){if(Ex(d)){s=d;break}d=d.return}if(s==null)throw Error(a(160));switch(s.tag){case 27:var p=s.stateNode,v=cm(r);Fc(r,v,p);break;case 5:var S=s.stateNode;s.flags&32&&(Ml(S,""),s.flags&=-33);var _=cm(r);Fc(r,_,S);break;case 3:case 4:var $=s.stateNode.containerInfo,G=cm(r);dm(r,G,$);break;default:throw Error(a(161))}}catch(ae){yt(r,r.return,ae)}r.flags&=-3}i&4096&&(r.flags&=-4097)}function Mx(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var i=r;Mx(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),r=r.sibling}}function ya(r,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)Tx(r,i.alternate,i),i=i.sibling}function tl(r){for(r=r.child;r!==null;){var i=r;switch(i.tag){case 0:case 11:case 14:case 15:Ka(4,i,i.return),tl(i);break;case 1:Fr(i,i.return);var s=i.stateNode;typeof s.componentWillUnmount=="function"&&jx(i,i.return,s),tl(i);break;case 27:Ko(i.stateNode);case 26:case 5:Fr(i,i.return),tl(i);break;case 22:i.memoizedState===null&&tl(i);break;case 30:tl(i);break;default:tl(i)}r=r.sibling}}function va(r,i,s){for(s=s&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var d=i.alternate,p=r,v=i,S=v.flags;switch(v.tag){case 0:case 11:case 15:va(p,v,s),Po(4,v);break;case 1:if(va(p,v,s),d=v,p=d.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(G){yt(d,d.return,G)}if(d=v,p=d.updateQueue,p!==null){var _=d.stateNode;try{var $=p.shared.hiddenCallbacks;if($!==null)for(p.shared.hiddenCallbacks=null,p=0;p<$.length;p++)fb($[p],_)}catch(G){yt(d,d.return,G)}}s&&S&64&&kx(v),Bo(v,v.return);break;case 27:Nx(v);case 26:case 5:va(p,v,s),s&&d===null&&S&4&&Cx(v),Bo(v,v.return);break;case 12:va(p,v,s);break;case 31:va(p,v,s),s&&S&4&&zx(p,v);break;case 13:va(p,v,s),s&&S&4&&Ox(p,v);break;case 22:v.memoizedState===null&&va(p,v,s),Bo(v,v.return);break;case 30:break;default:va(p,v,s)}i=i.sibling}}function hm(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&&Eo(s))}function mm(r,i){r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&Eo(r))}function Mr(r,i,s,d){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Lx(r,i,s,d),i=i.sibling}function Lx(r,i,s,d){var p=i.flags;switch(i.tag){case 0:case 11:case 15:Mr(r,i,s,d),p&2048&&Po(9,i);break;case 1:Mr(r,i,s,d);break;case 3:Mr(r,i,s,d),p&2048&&(r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&Eo(r)));break;case 12:if(p&2048){Mr(r,i,s,d),r=i.stateNode;try{var v=i.memoizedProps,S=v.id,_=v.onPostCommit;typeof _=="function"&&_(S,i.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch($){yt(i,i.return,$)}}else Mr(r,i,s,d);break;case 31:Mr(r,i,s,d);break;case 13:Mr(r,i,s,d);break;case 23:break;case 22:v=i.stateNode,S=i.alternate,i.memoizedState!==null?v._visibility&2?Mr(r,i,s,d):$o(r,i):v._visibility&2?Mr(r,i,s,d):(v._visibility|=2,ts(r,i,s,d,(i.subtreeFlags&10256)!==0||!1)),p&2048&&hm(S,i);break;case 24:Mr(r,i,s,d),p&2048&&mm(i.alternate,i);break;default:Mr(r,i,s,d)}}function ts(r,i,s,d,p){for(p=p&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var v=r,S=i,_=s,$=d,G=S.flags;switch(S.tag){case 0:case 11:case 15:ts(v,S,_,$,p),Po(8,S);break;case 23:break;case 22:var ae=S.stateNode;S.memoizedState!==null?ae._visibility&2?ts(v,S,_,$,p):$o(v,S):(ae._visibility|=2,ts(v,S,_,$,p)),p&&G&2048&&hm(S.alternate,S);break;case 24:ts(v,S,_,$,p),p&&G&2048&&mm(S.alternate,S);break;default:ts(v,S,_,$,p)}i=i.sibling}}function $o(r,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var s=r,d=i,p=d.flags;switch(d.tag){case 22:$o(s,d),p&2048&&hm(d.alternate,d);break;case 24:$o(s,d),p&2048&&mm(d.alternate,d);break;default:$o(s,d)}i=i.sibling}}var Fo=8192;function ns(r,i,s){if(r.subtreeFlags&Fo)for(r=r.child;r!==null;)Ix(r,i,s),r=r.sibling}function Ix(r,i,s){switch(r.tag){case 26:ns(r,i,s),r.flags&Fo&&r.memoizedState!==null&&S2(s,Dr,r.memoizedState,r.memoizedProps);break;case 5:ns(r,i,s);break;case 3:case 4:var d=Dr;Dr=rd(r.stateNode.containerInfo),ns(r,i,s),Dr=d;break;case 22:r.memoizedState===null&&(d=r.alternate,d!==null&&d.memoizedState!==null?(d=Fo,Fo=16777216,ns(r,i,s),Fo=d):ns(r,i,s));break;default:ns(r,i,s)}}function Ux(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 qo(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var d=i[s];un=d,Bx(d,r)}Ux(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Px(r),r=r.sibling}function Px(r){switch(r.tag){case 0:case 11:case 15:qo(r),r.flags&2048&&Ka(9,r,r.return);break;case 3:qo(r);break;case 12:qo(r);break;case 22:var i=r.stateNode;r.memoizedState!==null&&i._visibility&2&&(r.return===null||r.return.tag!==13)?(i._visibility&=-3,Hc(r)):qo(r);break;default:qo(r)}}function Hc(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var d=i[s];un=d,Bx(d,r)}Ux(r)}for(r=r.child;r!==null;){switch(i=r,i.tag){case 0:case 11:case 15:Ka(8,i,i.return),Hc(i);break;case 22:s=i.stateNode,s._visibility&2&&(s._visibility&=-3,Hc(i));break;default:Hc(i)}r=r.sibling}}function Bx(r,i){for(;un!==null;){var s=un;switch(s.tag){case 0:case 11:case 15:Ka(8,s,i);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var d=s.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:Eo(s.memoizedState.cache)}if(d=s.child,d!==null)d.return=s,un=d;else e:for(s=r;un!==null;){d=un;var p=d.sibling,v=d.return;if(Ax(d),d===s){un=null;break e}if(p!==null){p.return=v,un=p;break e}un=v}}}var I_={getCacheForType:function(r){var i=bn(Kt),s=i.data.get(r);return s===void 0&&(s=r(),i.data.set(r,s)),s},cacheSignal:function(){return bn(Kt).controller.signal}},U_=typeof WeakMap=="function"?WeakMap:Map,ft=0,kt=null,We=null,nt=0,gt=0,tr=null,Ya=!1,rs=!1,pm=!1,ba=0,Ut=0,Xa=0,nl=0,gm=0,nr=0,as=0,Ho=null,Fn=null,ym=!1,Zc=0,$x=0,Vc=1/0,Qc=null,Ja=null,rn=0,Wa=null,is=null,xa=0,vm=0,bm=null,Fx=null,Zo=0,xm=null;function rr(){return(ft&2)!==0&&nt!==0?nt&-nt:Z.T!==null?Em():av()}function qx(){if(nr===0)if((nt&536870912)===0||it){var r=Ii;Ii<<=1,(Ii&3932160)===0&&(Ii=262144),nr=r}else nr=536870912;return r=Wn.current,r!==null&&(r.flags|=32),nr}function qn(r,i,s){(r===kt&&(gt===2||gt===9)||r.cancelPendingCommit!==null)&&(ls(r,0),ei(r,nt,nr,!1)),gn(r,s),((ft&2)===0||r!==kt)&&(r===kt&&((ft&2)===0&&(nl|=s),Ut===4&&ei(r,nt,nr,!1)),qr(r))}function Hx(r,i,s){if((ft&6)!==0)throw Error(a(327));var d=!s&&(i&127)===0&&(i&r.expiredLanes)===0||Ia(r,i),p=d?$_(r,i):Sm(r,i,!0),v=d;do{if(p===0){rs&&!d&&ei(r,i,0,!1);break}else{if(s=r.current.alternate,v&&!P_(s)){p=Sm(r,i,!1),v=!1;continue}if(p===2){if(v=i,r.errorRecoveryDisabledLanes&v)var S=0;else S=r.pendingLanes&-536870913,S=S!==0?S:S&536870912?536870912:0;if(S!==0){i=S;e:{var _=r;p=Ho;var $=_.current.memoizedState.isDehydrated;if($&&(ls(_,S).flags|=256),S=Sm(_,S,!1),S!==2){if(pm&&!$){_.errorRecoveryDisabledLanes|=v,nl|=v,p=4;break e}v=Fn,Fn=p,v!==null&&(Fn===null?Fn=v:Fn.push.apply(Fn,v))}p=S}if(v=!1,p!==2)continue}}if(p===1){ls(r,0),ei(r,i,0,!0);break}e:{switch(d=r,v=p,v){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:ei(d,i,nr,!Ya);break e;case 2:Fn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(p=Zc+300-hn(),10<p)){if(ei(d,i,nr,!Ya),Pi(d,0,!0)!==0)break e;xa=i,d.timeoutHandle=w0(Zx.bind(null,d,s,Fn,Qc,ym,i,nr,nl,as,Ya,v,"Throttled",-0,0),p);break e}Zx(d,s,Fn,Qc,ym,i,nr,nl,as,Ya,v,null,-0,0)}}break}while(!0);qr(r)}function Zx(r,i,s,d,p,v,S,_,$,G,ae,de,Y,J){if(r.timeoutHandle=-1,de=i.subtreeFlags,de&8192||(de&16785408)===16785408){de={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ia},Ix(i,v,de);var Ce=(v&62914560)===v?Zc-hn():(v&4194048)===v?$x-hn():0;if(Ce=k2(de,Ce),Ce!==null){xa=v,r.cancelPendingCommit=Ce(Wx.bind(null,r,i,v,s,d,p,S,_,$,ae,de,null,Y,J)),ei(r,v,S,!G);return}}Wx(r,i,v,s,d,p,S,_,$)}function P_(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 d=0;d<s.length;d++){var p=s[d],v=p.getSnapshot;p=p.value;try{if(!Xn(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 ei(r,i,s,d){i&=~gm,i&=~nl,r.suspendedLanes|=i,r.pingedLanes&=~i,d&&(r.warmLanes|=i),d=r.expirationTimes;for(var p=i;0<p;){var v=31-ht(p),S=1<<v;d[v]=-1,p&=~S}s!==0&&fo(r,s,i)}function Gc(){return(ft&6)===0?(Vo(0),!1):!0}function wm(){if(We!==null){if(gt===0)var r=We.return;else r=We,ua=Qi=null,Ih(r),Yl=null,_o=0,r=We;for(;r!==null;)Sx(r.alternate,r),r=r.return;We=null}}function ls(r,i){var s=r.timeoutHandle;s!==-1&&(r.timeoutHandle=-1,i2(s)),s=r.cancelPendingCommit,s!==null&&(r.cancelPendingCommit=null,s()),xa=0,wm(),kt=r,We=s=sa(r.current,null),nt=i,gt=0,tr=null,Ya=!1,rs=Ia(r,i),pm=!1,as=nr=gm=nl=Xa=Ut=0,Fn=Ho=null,ym=!1,(i&8)!==0&&(i|=i&32);var d=r.entangledLanes;if(d!==0)for(r=r.entanglements,d&=i;0<d;){var p=31-ht(d),v=1<<p;i|=r[p],d&=~v}return ba=i,pc(),s}function Vx(r,i){Ze=null,Z.H=Lo,i===Kl||i===kc?(i=ob(),gt=3):i===Ch?(i=ob(),gt=4):gt=i===Wh?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,tr=i,We===null&&(Ut=1,Ic(r,gr(i,r.current)))}function Qx(){var r=Wn.current;return r===null?!0:(nt&4194048)===nt?xr===null:(nt&62914560)===nt||(nt&536870912)!==0?r===xr:!1}function Gx(){var r=Z.H;return Z.H=Lo,r===null?Lo:r}function Kx(){var r=Z.A;return Z.A=I_,r}function Kc(){Ut=4,Ya||(nt&4194048)!==nt&&Wn.current!==null||(rs=!0),(Xa&134217727)===0&&(nl&134217727)===0||kt===null||ei(kt,nt,nr,!1)}function Sm(r,i,s){var d=ft;ft|=2;var p=Gx(),v=Kx();(kt!==r||nt!==i)&&(Qc=null,ls(r,i)),i=!1;var S=Ut;e:do try{if(gt!==0&&We!==null){var _=We,$=tr;switch(gt){case 8:wm(),S=6;break e;case 3:case 2:case 9:case 6:Wn.current===null&&(i=!0);var G=gt;if(gt=0,tr=null,ss(r,_,$,G),s&&rs){S=0;break e}break;default:G=gt,gt=0,tr=null,ss(r,_,$,G)}}B_(),S=Ut;break}catch(ae){Vx(r,ae)}while(!0);return i&&r.shellSuspendCounter++,ua=Qi=null,ft=d,Z.H=p,Z.A=v,We===null&&(kt=null,nt=0,pc()),S}function B_(){for(;We!==null;)Yx(We)}function $_(r,i){var s=ft;ft|=2;var d=Gx(),p=Kx();kt!==r||nt!==i?(Qc=null,Vc=hn()+500,ls(r,i)):rs=Ia(r,i);e:do try{if(gt!==0&&We!==null){i=We;var v=tr;t:switch(gt){case 1:gt=0,tr=null,ss(r,i,v,1);break;case 2:case 9:if(lb(v)){gt=0,tr=null,Xx(i);break}i=function(){gt!==2&>!==9||kt!==r||(gt=7),qr(r)},v.then(i,i);break e;case 3:gt=7;break e;case 4:gt=5;break e;case 7:lb(v)?(gt=0,tr=null,Xx(i)):(gt=0,tr=null,ss(r,i,v,7));break;case 5:var S=null;switch(We.tag){case 26:S=We.memoizedState;case 5:case 27:var _=We;if(S?L0(S):_.stateNode.complete){gt=0,tr=null;var $=_.sibling;if($!==null)We=$;else{var G=_.return;G!==null?(We=G,Yc(G)):We=null}break t}}gt=0,tr=null,ss(r,i,v,5);break;case 6:gt=0,tr=null,ss(r,i,v,6);break;case 8:wm(),Ut=6;break e;default:throw Error(a(462))}}F_();break}catch(ae){Vx(r,ae)}while(!0);return ua=Qi=null,Z.H=d,Z.A=p,ft=s,We!==null?0:(kt=null,nt=0,pc(),Ut)}function F_(){for(;We!==null&&!oo();)Yx(We)}function Yx(r){var i=xx(r.alternate,r,ba);r.memoizedProps=r.pendingProps,i===null?Yc(r):We=i}function Xx(r){var i=r,s=i.alternate;switch(i.tag){case 15:case 0:i=mx(s,i,i.pendingProps,i.type,void 0,nt);break;case 11:i=mx(s,i,i.pendingProps,i.type.render,i.ref,nt);break;case 5:Ih(i);default:Sx(s,i),i=We=Kv(i,ba),i=xx(s,i,ba)}r.memoizedProps=r.pendingProps,i===null?Yc(r):We=i}function ss(r,i,s,d){ua=Qi=null,Ih(i),Yl=null,_o=0;var p=i.return;try{if(A_(r,p,i,s,nt)){Ut=1,Ic(r,gr(s,r.current)),We=null;return}}catch(v){if(p!==null)throw We=p,v;Ut=1,Ic(r,gr(s,r.current)),We=null;return}i.flags&32768?(it||d===1?r=!0:rs||(nt&536870912)!==0?r=!1:(Ya=r=!0,(d===2||d===9||d===3||d===6)&&(d=Wn.current,d!==null&&d.tag===13&&(d.flags|=16384))),Jx(i,r)):Yc(i)}function Yc(r){var i=r;do{if((i.flags&32768)!==0){Jx(i,Ya);return}r=i.return;var s=O_(i.alternate,i,ba);if(s!==null){We=s;return}if(i=i.sibling,i!==null){We=i;return}We=i=r}while(i!==null);Ut===0&&(Ut=5)}function Jx(r,i){do{var s=D_(r.alternate,r);if(s!==null){s.flags&=32767,We=s;return}if(s=r.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!i&&(r=r.sibling,r!==null)){We=r;return}We=r=s}while(r!==null);Ut=6,We=null}function Wx(r,i,s,d,p,v,S,_,$){r.cancelPendingCommit=null;do Xc();while(rn!==0);if((ft&6)!==0)throw Error(a(327));if(i!==null){if(i===r.current)throw Error(a(177));if(v=i.lanes|i.childLanes,v|=ch,ra(r,s,v,S,_,$),r===kt&&(We=kt=null,nt=0),is=i,Wa=r,xa=s,vm=v,bm=p,Fx=d,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,V_(Ue,function(){return a0(),null})):(r.callbackNode=null,r.callbackPriority=0),d=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||d){d=Z.T,Z.T=null,p=te.p,te.p=2,S=ft,ft|=4;try{M_(r,i,s)}finally{ft=S,te.p=p,Z.T=d}}rn=1,e0(),t0(),n0()}}function e0(){if(rn===1){rn=0;var r=Wa,i=is,s=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||s){s=Z.T,Z.T=null;var d=te.p;te.p=2;var p=ft;ft|=4;try{Dx(i,r);var v=Dm,S=Bv(r.containerInfo),_=v.focusedElem,$=v.selectionRange;if(S!==_&&_&&_.ownerDocument&&Pv(_.ownerDocument.documentElement,_)){if($!==null&&ih(_)){var G=$.start,ae=$.end;if(ae===void 0&&(ae=G),"selectionStart"in _)_.selectionStart=G,_.selectionEnd=Math.min(ae,_.value.length);else{var de=_.ownerDocument||document,Y=de&&de.defaultView||window;if(Y.getSelection){var J=Y.getSelection(),Ce=_.textContent.length,De=Math.min($.start,Ce),xt=$.end===void 0?De:Math.min($.end,Ce);!J.extend&&De>xt&&(S=xt,xt=De,De=S);var V=Uv(_,De),H=Uv(_,xt);if(V&&H&&(J.rangeCount!==1||J.anchorNode!==V.node||J.anchorOffset!==V.offset||J.focusNode!==H.node||J.focusOffset!==H.offset)){var Q=de.createRange();Q.setStart(V.node,V.offset),J.removeAllRanges(),De>xt?(J.addRange(Q),J.extend(H.node,H.offset)):(Q.setEnd(H.node,H.offset),J.addRange(Q))}}}}for(de=[],J=_;J=J.parentNode;)J.nodeType===1&&de.push({element:J,left:J.scrollLeft,top:J.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_<de.length;_++){var oe=de[_];oe.element.scrollLeft=oe.left,oe.element.scrollTop=oe.top}}ud=!!Om,Dm=Om=null}finally{ft=p,te.p=d,Z.T=s}}r.current=i,rn=2}}function t0(){if(rn===2){rn=0;var r=Wa,i=is,s=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||s){s=Z.T,Z.T=null;var d=te.p;te.p=2;var p=ft;ft|=4;try{Tx(r,i.alternate,i)}finally{ft=p,te.p=d,Z.T=s}}rn=3}}function n0(){if(rn===4||rn===3){rn=0,uo();var r=Wa,i=is,s=xa,d=Fx;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?rn=5:(rn=0,is=Wa=null,r0(r,r.pendingLanes));var p=r.pendingLanes;if(p===0&&(Ja=null),Bf(s),i=i.stateNode,Zt&&typeof Zt.onCommitFiberRoot=="function")try{Zt.onCommitFiberRoot(nn,i,void 0,(i.current.flags&128)===128)}catch{}if(d!==null){i=Z.T,p=te.p,te.p=2,Z.T=null;try{for(var v=r.onRecoverableError,S=0;S<d.length;S++){var _=d[S];v(_.value,{componentStack:_.stack})}}finally{Z.T=i,te.p=p}}(xa&3)!==0&&Xc(),qr(r),p=r.pendingLanes,(s&261930)!==0&&(p&42)!==0?r===xm?Zo++:(Zo=0,xm=r):Zo=0,Vo(0)}}function r0(r,i){(r.pooledCacheLanes&=i)===0&&(i=r.pooledCache,i!=null&&(r.pooledCache=null,Eo(i)))}function Xc(){return e0(),t0(),n0(),a0()}function a0(){if(rn!==5)return!1;var r=Wa,i=vm;vm=0;var s=Bf(xa),d=Z.T,p=te.p;try{te.p=32>s?32:s,Z.T=null,s=bm,bm=null;var v=Wa,S=xa;if(rn=0,is=Wa=null,xa=0,(ft&6)!==0)throw Error(a(331));var _=ft;if(ft|=4,Px(v.current),Lx(v,v.current,S,s),ft=_,Vo(0,!1),Zt&&typeof Zt.onPostCommitFiberRoot=="function")try{Zt.onPostCommitFiberRoot(nn,v)}catch{}return!0}finally{te.p=p,Z.T=d,r0(r,i)}}function i0(r,i,s){i=gr(s,i),i=Jh(r.stateNode,i,2),r=Va(r,i,2),r!==null&&(gn(r,2),qr(r))}function yt(r,i,s){if(r.tag===3)i0(r,r,s);else for(;i!==null;){if(i.tag===3){i0(i,r,s);break}else if(i.tag===1){var d=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(Ja===null||!Ja.has(d))){r=gr(s,r),s=lx(2),d=Va(i,s,2),d!==null&&(sx(s,d,i,r),gn(d,2),qr(d));break}}i=i.return}}function km(r,i,s){var d=r.pingCache;if(d===null){d=r.pingCache=new U_;var p=new Set;d.set(i,p)}else p=d.get(i),p===void 0&&(p=new Set,d.set(i,p));p.has(s)||(pm=!0,p.add(s),r=q_.bind(null,r,i,s),i.then(r,r))}function q_(r,i,s){var d=r.pingCache;d!==null&&d.delete(i),r.pingedLanes|=r.suspendedLanes&s,r.warmLanes&=~s,kt===r&&(nt&s)===s&&(Ut===4||Ut===3&&(nt&62914560)===nt&&300>hn()-Zc?(ft&2)===0&&ls(r,0):gm|=s,as===nt&&(as=0)),qr(r)}function l0(r,i){i===0&&(i=Se()),r=Hi(r,i),r!==null&&(gn(r,i),qr(r))}function H_(r){var i=r.memoizedState,s=0;i!==null&&(s=i.retryLane),l0(r,s)}function Z_(r,i){var s=0;switch(r.tag){case 31:case 13:var d=r.stateNode,p=r.memoizedState;p!==null&&(s=p.retryLane);break;case 19:d=r.stateNode;break;case 22:d=r.stateNode._retryCache;break;default:throw Error(a(314))}d!==null&&d.delete(i),l0(r,s)}function V_(r,i){return La(r,i)}var Jc=null,os=null,jm=!1,Wc=!1,Cm=!1,ti=0;function qr(r){r!==os&&r.next===null&&(os===null?Jc=os=r:os=os.next=r),Wc=!0,jm||(jm=!0,G_())}function Vo(r,i){if(!Cm&&Wc){Cm=!0;do for(var s=!1,d=Jc;d!==null;){if(r!==0){var p=d.pendingLanes;if(p===0)var v=0;else{var S=d.suspendedLanes,_=d.pingedLanes;v=(1<<31-ht(42|r)+1)-1,v&=p&~(S&~_),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(s=!0,c0(d,v))}else v=nt,v=Pi(d,d===kt?v:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(v&3)===0||Ia(d,v)||(s=!0,c0(d,v));d=d.next}while(s);Cm=!1}}function Q_(){s0()}function s0(){Wc=jm=!1;var r=0;ti!==0&&a2()&&(r=ti);for(var i=hn(),s=null,d=Jc;d!==null;){var p=d.next,v=o0(d,i);v===0?(d.next=null,s===null?Jc=p:s.next=p,p===null&&(os=s)):(s=d,(r!==0||(v&3)!==0)&&(Wc=!0)),d=p}rn!==0&&rn!==5||Vo(r),ti!==0&&(ti=0)}function o0(r,i){for(var s=r.suspendedLanes,d=r.pingedLanes,p=r.expirationTimes,v=r.pendingLanes&-62914561;0<v;){var S=31-ht(v),_=1<<S,$=p[S];$===-1?((_&s)===0||(_&d)!==0)&&(p[S]=nc(_,i)):$<=i&&(r.expiredLanes|=_),v&=~_}if(i=kt,s=nt,s=Pi(r,r===i?s:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),d=r.callbackNode,s===0||r===i&&(gt===2||gt===9)||r.cancelPendingCommit!==null)return d!==null&&d!==null&&na(d),r.callbackNode=null,r.callbackPriority=0;if((s&3)===0||Ia(r,s)){if(i=s&-s,i===r.callbackPriority)return i;switch(d!==null&&na(d),Bf(s)){case 2:case 8:s=be;break;case 32:s=Ue;break;case 268435456:s=at;break;default:s=Ue}return d=u0.bind(null,r),s=La(s,d),r.callbackPriority=i,r.callbackNode=s,i}return d!==null&&d!==null&&na(d),r.callbackPriority=2,r.callbackNode=null,2}function u0(r,i){if(rn!==0&&rn!==5)return r.callbackNode=null,r.callbackPriority=0,null;var s=r.callbackNode;if(Xc()&&r.callbackNode!==s)return null;var d=nt;return d=Pi(r,r===kt?d:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),d===0?null:(Hx(r,d,i),o0(r,hn()),r.callbackNode!=null&&r.callbackNode===s?u0.bind(null,r):null)}function c0(r,i){if(Xc())return null;Hx(r,i,!0)}function G_(){l2(function(){(ft&6)!==0?La(le,Q_):s0()})}function Em(){if(ti===0){var r=Ql;r===0&&(r=Li,Li<<=1,(Li&261888)===0&&(Li=256)),ti=r}return ti}function d0(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:sc(""+r)}function f0(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 K_(r,i,s,d,p){if(i==="submit"&&s&&s.stateNode===p){var v=d0((p[In]||null).action),S=d.submitter;S&&(i=(i=S[In]||null)?d0(i.formAction):S.getAttribute("formAction"),i!==null&&(v=i,S=null));var _=new dc("action","action",null,d,p);r.push({event:_,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(ti!==0){var $=S?f0(p,S):new FormData(p);Vh(s,{pending:!0,data:$,method:p.method,action:v},null,$)}}else typeof v=="function"&&(_.preventDefault(),$=S?f0(p,S):new FormData(p),Vh(s,{pending:!0,data:$,method:p.method,action:v},v,$))},currentTarget:p}]})}}for(var Nm=0;Nm<uh.length;Nm++){var _m=uh[Nm],Y_=_m.toLowerCase(),X_=_m[0].toUpperCase()+_m.slice(1);Or(Y_,"on"+X_)}Or(qv,"onAnimationEnd"),Or(Hv,"onAnimationIteration"),Or(Zv,"onAnimationStart"),Or("dblclick","onDoubleClick"),Or("focusin","onFocus"),Or("focusout","onBlur"),Or(h_,"onTransitionRun"),Or(m_,"onTransitionStart"),Or(p_,"onTransitionCancel"),Or(Vv,"onTransitionEnd"),Ol("onMouseEnter",["mouseout","mouseover"]),Ol("onMouseLeave",["mouseout","mouseover"]),Ol("onPointerEnter",["pointerout","pointerover"]),Ol("onPointerLeave",["pointerout","pointerover"]),Bi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Bi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Bi("onBeforeInput",["compositionend","keypress","textInput","paste"]),Bi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Bi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Bi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Qo="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(" "),J_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Qo));function h0(r,i){i=(i&4)!==0;for(var s=0;s<r.length;s++){var d=r[s],p=d.event;d=d.listeners;e:{var v=void 0;if(i)for(var S=d.length-1;0<=S;S--){var _=d[S],$=_.instance,G=_.currentTarget;if(_=_.listener,$!==v&&p.isPropagationStopped())break e;v=_,p.currentTarget=G;try{v(p)}catch(ae){mc(ae)}p.currentTarget=null,v=$}else for(S=0;S<d.length;S++){if(_=d[S],$=_.instance,G=_.currentTarget,_=_.listener,$!==v&&p.isPropagationStopped())break e;v=_,p.currentTarget=G;try{v(p)}catch(ae){mc(ae)}p.currentTarget=null,v=$}}}}function et(r,i){var s=i[$f];s===void 0&&(s=i[$f]=new Set);var d=r+"__bubble";s.has(d)||(m0(i,r,2,!1),s.add(d))}function Tm(r,i,s){var d=0;i&&(d|=4),m0(s,r,d,i)}var ed="_reactListening"+Math.random().toString(36).slice(2);function Am(r){if(!r[ed]){r[ed]=!0,sv.forEach(function(s){s!=="selectionchange"&&(J_.has(s)||Tm(s,!1,r),Tm(s,!0,r))});var i=r.nodeType===9?r:r.ownerDocument;i===null||i[ed]||(i[ed]=!0,Tm("selectionchange",!1,i))}}function m0(r,i,s,d){switch(q0(i)){case 2:var p=E2;break;case 8:p=N2;break;default:p=Zm}s=p.bind(null,i,s,r),p=void 0,!Yf||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(p=!0),d?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 Rm(r,i,s,d,p){var v=d;if((i&1)===0&&(i&2)===0&&d!==null)e:for(;;){if(d===null)return;var S=d.tag;if(S===3||S===4){var _=d.stateNode.containerInfo;if(_===p)break;if(S===4)for(S=d.return;S!==null;){var $=S.tag;if(($===3||$===4)&&S.stateNode.containerInfo===p)return;S=S.return}for(;_!==null;){if(S=Al(_),S===null)return;if($=S.tag,$===5||$===6||$===26||$===27){d=v=S;continue e}_=_.parentNode}}d=d.return}bv(function(){var G=v,ae=Gf(s),de=[];e:{var Y=Qv.get(r);if(Y!==void 0){var J=dc,Ce=r;switch(r){case"keypress":if(uc(s)===0)break e;case"keydown":case"keyup":J=ZN;break;case"focusin":Ce="focus",J=eh;break;case"focusout":Ce="blur",J=eh;break;case"beforeblur":case"afterblur":J=eh;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=Sv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":J=ON;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":J=GN;break;case qv:case Hv:case Zv:J=LN;break;case Vv:J=YN;break;case"scroll":case"scrollend":J=RN;break;case"wheel":J=JN;break;case"copy":case"cut":case"paste":J=UN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":J=jv;break;case"toggle":case"beforetoggle":J=e_}var De=(i&4)!==0,xt=!De&&(r==="scroll"||r==="scrollend"),V=De?Y!==null?Y+"Capture":null:Y;De=[];for(var H=G,Q;H!==null;){var oe=H;if(Q=oe.stateNode,oe=oe.tag,oe!==5&&oe!==26&&oe!==27||Q===null||V===null||(oe=po(H,V),oe!=null&&De.push(Go(H,oe,Q))),xt)break;H=H.return}0<De.length&&(Y=new J(Y,Ce,null,s,ae),de.push({event:Y,listeners:De}))}}if((i&7)===0){e:{if(Y=r==="mouseover"||r==="pointerover",J=r==="mouseout"||r==="pointerout",Y&&s!==Qf&&(Ce=s.relatedTarget||s.fromElement)&&(Al(Ce)||Ce[Tl]))break e;if((J||Y)&&(Y=ae.window===ae?ae:(Y=ae.ownerDocument)?Y.defaultView||Y.parentWindow:window,J?(Ce=s.relatedTarget||s.toElement,J=G,Ce=Ce?Al(Ce):null,Ce!==null&&(xt=o(Ce),De=Ce.tag,Ce!==xt||De!==5&&De!==27&&De!==6)&&(Ce=null)):(J=null,Ce=G),J!==Ce)){if(De=Sv,oe="onMouseLeave",V="onMouseEnter",H="mouse",(r==="pointerout"||r==="pointerover")&&(De=jv,oe="onPointerLeave",V="onPointerEnter",H="pointer"),xt=J==null?Y:mo(J),Q=Ce==null?Y:mo(Ce),Y=new De(oe,H+"leave",J,s,ae),Y.target=xt,Y.relatedTarget=Q,oe=null,Al(ae)===G&&(De=new De(V,H+"enter",Ce,s,ae),De.target=Q,De.relatedTarget=xt,oe=De),xt=oe,J&&Ce)t:{for(De=W_,V=J,H=Ce,Q=0,oe=V;oe;oe=De(oe))Q++;oe=0;for(var ze=H;ze;ze=De(ze))oe++;for(;0<Q-oe;)V=De(V),Q--;for(;0<oe-Q;)H=De(H),oe--;for(;Q--;){if(V===H||H!==null&&V===H.alternate){De=V;break t}V=De(V),H=De(H)}De=null}else De=null;J!==null&&p0(de,Y,J,De,!1),Ce!==null&&xt!==null&&p0(de,xt,Ce,De,!0)}}e:{if(Y=G?mo(G):window,J=Y.nodeName&&Y.nodeName.toLowerCase(),J==="select"||J==="input"&&Y.type==="file")var ct=zv;else if(Av(Y))if(Ov)ct=c_;else{ct=o_;var Te=s_}else J=Y.nodeName,!J||J.toLowerCase()!=="input"||Y.type!=="checkbox"&&Y.type!=="radio"?G&&Vf(G.elementType)&&(ct=zv):ct=u_;if(ct&&(ct=ct(r,G))){Rv(de,ct,s,ae);break e}Te&&Te(r,Y,G),r==="focusout"&&G&&Y.type==="number"&&G.memoizedProps.value!=null&&Zf(Y,"number",Y.value)}switch(Te=G?mo(G):window,r){case"focusin":(Av(Te)||Te.contentEditable==="true")&&(Pl=Te,lh=G,ko=null);break;case"focusout":ko=lh=Pl=null;break;case"mousedown":sh=!0;break;case"contextmenu":case"mouseup":case"dragend":sh=!1,$v(de,s,ae);break;case"selectionchange":if(f_)break;case"keydown":case"keyup":$v(de,s,ae)}var Ve;if(nh)e:{switch(r){case"compositionstart":var rt="onCompositionStart";break e;case"compositionend":rt="onCompositionEnd";break e;case"compositionupdate":rt="onCompositionUpdate";break e}rt=void 0}else Ul?_v(r,s)&&(rt="onCompositionEnd"):r==="keydown"&&s.keyCode===229&&(rt="onCompositionStart");rt&&(Cv&&s.locale!=="ko"&&(Ul||rt!=="onCompositionStart"?rt==="onCompositionEnd"&&Ul&&(Ve=xv()):(Pa=ae,Xf="value"in Pa?Pa.value:Pa.textContent,Ul=!0)),Te=td(G,rt),0<Te.length&&(rt=new kv(rt,r,null,s,ae),de.push({event:rt,listeners:Te}),Ve?rt.data=Ve:(Ve=Tv(s),Ve!==null&&(rt.data=Ve)))),(Ve=n_?r_(r,s):a_(r,s))&&(rt=td(G,"onBeforeInput"),0<rt.length&&(Te=new kv("onBeforeInput","beforeinput",null,s,ae),de.push({event:Te,listeners:rt}),Te.data=Ve)),K_(de,r,G,s,ae)}h0(de,i)})}function Go(r,i,s){return{instance:r,listener:i,currentTarget:s}}function td(r,i){for(var s=i+"Capture",d=[];r!==null;){var p=r,v=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||v===null||(p=po(r,s),p!=null&&d.unshift(Go(r,p,v)),p=po(r,i),p!=null&&d.push(Go(r,p,v))),r.tag===3)return d;r=r.return}return[]}function W_(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function p0(r,i,s,d,p){for(var v=i._reactName,S=[];s!==null&&s!==d;){var _=s,$=_.alternate,G=_.stateNode;if(_=_.tag,$!==null&&$===d)break;_!==5&&_!==26&&_!==27||G===null||($=G,p?(G=po(s,v),G!=null&&S.unshift(Go(s,G,$))):p||(G=po(s,v),G!=null&&S.push(Go(s,G,$)))),s=s.return}S.length!==0&&r.push({event:i,listeners:S})}var e2=/\r\n?/g,t2=/\u0000|\uFFFD/g;function g0(r){return(typeof r=="string"?r:""+r).replace(e2,`
|
|
49
|
+
`).replace(t2,"")}function y0(r,i){return i=g0(i),g0(r)===i}function bt(r,i,s,d,p,v){switch(s){case"children":typeof d=="string"?i==="body"||i==="textarea"&&d===""||Ml(r,d):(typeof d=="number"||typeof d=="bigint")&&i!=="body"&&Ml(r,""+d);break;case"className":ic(r,"class",d);break;case"tabIndex":ic(r,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":ic(r,s,d);break;case"style":yv(r,d,v);break;case"data":if(i!=="object"){ic(r,"data",d);break}case"src":case"href":if(d===""&&(i!=="a"||s!=="href")){r.removeAttribute(s);break}if(d==null||typeof d=="function"||typeof d=="symbol"||typeof d=="boolean"){r.removeAttribute(s);break}d=sc(""+d),r.setAttribute(s,d);break;case"action":case"formAction":if(typeof d=="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"&&bt(r,i,"name",p.name,p,null),bt(r,i,"formEncType",p.formEncType,p,null),bt(r,i,"formMethod",p.formMethod,p,null),bt(r,i,"formTarget",p.formTarget,p,null)):(bt(r,i,"encType",p.encType,p,null),bt(r,i,"method",p.method,p,null),bt(r,i,"target",p.target,p,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){r.removeAttribute(s);break}d=sc(""+d),r.setAttribute(s,d);break;case"onClick":d!=null&&(r.onclick=ia);break;case"onScroll":d!=null&&et("scroll",r);break;case"onScrollEnd":d!=null&&et("scrollend",r);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(a(61));if(s=d.__html,s!=null){if(p.children!=null)throw Error(a(60));r.innerHTML=s}}break;case"multiple":r.multiple=d&&typeof d!="function"&&typeof d!="symbol";break;case"muted":r.muted=d&&typeof d!="function"&&typeof d!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(d==null||typeof d=="function"||typeof d=="boolean"||typeof d=="symbol"){r.removeAttribute("xlink:href");break}s=sc(""+d),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":d!=null&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(s,""+d):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":d&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(s,""):r.removeAttribute(s);break;case"capture":case"download":d===!0?r.setAttribute(s,""):d!==!1&&d!=null&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(s,d):r.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":d!=null&&typeof d!="function"&&typeof d!="symbol"&&!isNaN(d)&&1<=d?r.setAttribute(s,d):r.removeAttribute(s);break;case"rowSpan":case"start":d==null||typeof d=="function"||typeof d=="symbol"||isNaN(d)?r.removeAttribute(s):r.setAttribute(s,d);break;case"popover":et("beforetoggle",r),et("toggle",r),ac(r,"popover",d);break;case"xlinkActuate":aa(r,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":aa(r,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":aa(r,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":aa(r,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":aa(r,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":aa(r,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":aa(r,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":aa(r,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":aa(r,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":ac(r,"is",d);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=TN.get(s)||s,ac(r,s,d))}}function zm(r,i,s,d,p,v){switch(s){case"style":yv(r,d,v);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(a(61));if(s=d.__html,s!=null){if(p.children!=null)throw Error(a(60));r.innerHTML=s}}break;case"children":typeof d=="string"?Ml(r,d):(typeof d=="number"||typeof d=="bigint")&&Ml(r,""+d);break;case"onScroll":d!=null&&et("scroll",r);break;case"onScrollEnd":d!=null&&et("scrollend",r);break;case"onClick":d!=null&&(r.onclick=ia);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ov.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[In]||null,v=v!=null?v[s]:null,typeof v=="function"&&r.removeEventListener(i,v,p),typeof d=="function")){typeof v!="function"&&v!==null&&(s in r?r[s]=null:r.hasAttribute(s)&&r.removeAttribute(s)),r.addEventListener(i,d,p);break e}s in r?r[s]=d:d===!0?r.setAttribute(s,""):ac(r,s,d)}}}function wn(r,i,s){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":et("error",r),et("load",r);var d=!1,p=!1,v;for(v in s)if(s.hasOwnProperty(v)){var S=s[v];if(S!=null)switch(v){case"src":d=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:bt(r,i,v,S,s,null)}}p&&bt(r,i,"srcSet",s.srcSet,s,null),d&&bt(r,i,"src",s.src,s,null);return;case"input":et("invalid",r);var _=v=S=p=null,$=null,G=null;for(d in s)if(s.hasOwnProperty(d)){var ae=s[d];if(ae!=null)switch(d){case"name":p=ae;break;case"type":S=ae;break;case"checked":$=ae;break;case"defaultChecked":G=ae;break;case"value":v=ae;break;case"defaultValue":_=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(a(137,i));break;default:bt(r,i,d,ae,s,null)}}hv(r,v,_,$,G,S,p,!1);return;case"select":et("invalid",r),d=S=v=null;for(p in s)if(s.hasOwnProperty(p)&&(_=s[p],_!=null))switch(p){case"value":v=_;break;case"defaultValue":S=_;break;case"multiple":d=_;default:bt(r,i,p,_,s,null)}i=v,s=S,r.multiple=!!d,i!=null?Dl(r,!!d,i,!1):s!=null&&Dl(r,!!d,s,!0);return;case"textarea":et("invalid",r),v=p=d=null;for(S in s)if(s.hasOwnProperty(S)&&(_=s[S],_!=null))switch(S){case"value":d=_;break;case"defaultValue":p=_;break;case"children":v=_;break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(a(91));break;default:bt(r,i,S,_,s,null)}pv(r,d,p,v);return;case"option":for($ in s)if(s.hasOwnProperty($)&&(d=s[$],d!=null))switch($){case"selected":r.selected=d&&typeof d!="function"&&typeof d!="symbol";break;default:bt(r,i,$,d,s,null)}return;case"dialog":et("beforetoggle",r),et("toggle",r),et("cancel",r),et("close",r);break;case"iframe":case"object":et("load",r);break;case"video":case"audio":for(d=0;d<Qo.length;d++)et(Qo[d],r);break;case"image":et("error",r),et("load",r);break;case"details":et("toggle",r);break;case"embed":case"source":case"link":et("error",r),et("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)&&(d=s[G],d!=null))switch(G){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:bt(r,i,G,d,s,null)}return;default:if(Vf(i)){for(ae in s)s.hasOwnProperty(ae)&&(d=s[ae],d!==void 0&&zm(r,i,ae,d,s,void 0));return}}for(_ in s)s.hasOwnProperty(_)&&(d=s[_],d!=null&&bt(r,i,_,d,s,null))}function n2(r,i,s,d){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,S=null,_=null,$=null,G=null,ae=null;for(J in s){var de=s[J];if(s.hasOwnProperty(J)&&de!=null)switch(J){case"checked":break;case"value":break;case"defaultValue":$=de;default:d.hasOwnProperty(J)||bt(r,i,J,null,d,de)}}for(var Y in d){var J=d[Y];if(de=s[Y],d.hasOwnProperty(Y)&&(J!=null||de!=null))switch(Y){case"type":v=J;break;case"name":p=J;break;case"checked":G=J;break;case"defaultChecked":ae=J;break;case"value":S=J;break;case"defaultValue":_=J;break;case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(a(137,i));break;default:J!==de&&bt(r,i,Y,J,d,de)}}Hf(r,S,_,$,G,ae,v,p);return;case"select":J=S=_=Y=null;for(v in s)if($=s[v],s.hasOwnProperty(v)&&$!=null)switch(v){case"value":break;case"multiple":J=$;default:d.hasOwnProperty(v)||bt(r,i,v,null,d,$)}for(p in d)if(v=d[p],$=s[p],d.hasOwnProperty(p)&&(v!=null||$!=null))switch(p){case"value":Y=v;break;case"defaultValue":_=v;break;case"multiple":S=v;default:v!==$&&bt(r,i,p,v,d,$)}i=_,s=S,d=J,Y!=null?Dl(r,!!s,Y,!1):!!d!=!!s&&(i!=null?Dl(r,!!s,i,!0):Dl(r,!!s,s?[]:"",!1));return;case"textarea":J=Y=null;for(_ in s)if(p=s[_],s.hasOwnProperty(_)&&p!=null&&!d.hasOwnProperty(_))switch(_){case"value":break;case"children":break;default:bt(r,i,_,null,d,p)}for(S in d)if(p=d[S],v=s[S],d.hasOwnProperty(S)&&(p!=null||v!=null))switch(S){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&&bt(r,i,S,p,d,v)}mv(r,Y,J);return;case"option":for(var Ce in s)if(Y=s[Ce],s.hasOwnProperty(Ce)&&Y!=null&&!d.hasOwnProperty(Ce))switch(Ce){case"selected":r.selected=!1;break;default:bt(r,i,Ce,null,d,Y)}for($ in d)if(Y=d[$],J=s[$],d.hasOwnProperty($)&&Y!==J&&(Y!=null||J!=null))switch($){case"selected":r.selected=Y&&typeof Y!="function"&&typeof Y!="symbol";break;default:bt(r,i,$,Y,d,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 De in s)Y=s[De],s.hasOwnProperty(De)&&Y!=null&&!d.hasOwnProperty(De)&&bt(r,i,De,null,d,Y);for(G in d)if(Y=d[G],J=s[G],d.hasOwnProperty(G)&&Y!==J&&(Y!=null||J!=null))switch(G){case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(a(137,i));break;default:bt(r,i,G,Y,d,J)}return;default:if(Vf(i)){for(var xt in s)Y=s[xt],s.hasOwnProperty(xt)&&Y!==void 0&&!d.hasOwnProperty(xt)&&zm(r,i,xt,void 0,d,Y);for(ae in d)Y=d[ae],J=s[ae],!d.hasOwnProperty(ae)||Y===J||Y===void 0&&J===void 0||zm(r,i,ae,Y,d,J);return}}for(var V in s)Y=s[V],s.hasOwnProperty(V)&&Y!=null&&!d.hasOwnProperty(V)&&bt(r,i,V,null,d,Y);for(de in d)Y=d[de],J=s[de],!d.hasOwnProperty(de)||Y===J||Y==null&&J==null||bt(r,i,de,Y,d,J)}function v0(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function r2(){if(typeof performance.getEntriesByType=="function"){for(var r=0,i=0,s=performance.getEntriesByType("resource"),d=0;d<s.length;d++){var p=s[d],v=p.transferSize,S=p.initiatorType,_=p.duration;if(v&&_&&v0(S)){for(S=0,_=p.responseEnd,d+=1;d<s.length;d++){var $=s[d],G=$.startTime;if(G>_)break;var ae=$.transferSize,de=$.initiatorType;ae&&v0(de)&&($=$.responseEnd,S+=ae*($<_?1:(_-G)/($-G)))}if(--d,i+=8*(v+S)/(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,Dm=null;function nd(r){return r.nodeType===9?r:r.ownerDocument}function b0(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 x0(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 Mm(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 Lm=null;function a2(){var r=window.event;return r&&r.type==="popstate"?r===Lm?!1:(Lm=r,!0):(Lm=null,!1)}var w0=typeof setTimeout=="function"?setTimeout:void 0,i2=typeof clearTimeout=="function"?clearTimeout:void 0,S0=typeof Promise=="function"?Promise:void 0,l2=typeof queueMicrotask=="function"?queueMicrotask:typeof S0<"u"?function(r){return S0.resolve(null).then(r).catch(s2)}:w0;function s2(r){setTimeout(function(){throw r})}function ni(r){return r==="head"}function k0(r,i){var s=i,d=0;do{var p=s.nextSibling;if(r.removeChild(s),p&&p.nodeType===8)if(s=p.data,s==="/$"||s==="/&"){if(d===0){r.removeChild(p),fs(i);return}d--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")d++;else if(s==="html")Ko(r.ownerDocument.documentElement);else if(s==="head"){s=r.ownerDocument.head,Ko(s);for(var v=s.firstChild;v;){var S=v.nextSibling,_=v.nodeName;v[ho]||_==="SCRIPT"||_==="STYLE"||_==="LINK"&&v.rel.toLowerCase()==="stylesheet"||s.removeChild(v),v=S}}else s==="body"&&Ko(r.ownerDocument.body);s=p}while(s);fs(i)}function j0(r,i){var s=r;r=0;do{var d=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||""),d&&d.nodeType===8)if(s=d.data,s==="/$"){if(r===0)break;r--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||r++;s=d}while(s)}function Im(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":Im(s),Ff(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}r.removeChild(s)}}function o2(r,i,s,d){for(;r.nodeType===1;){var p=s;if(r.nodeName.toLowerCase()!==i.toLowerCase()){if(!d&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(d){if(!r[ho])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=wr(r.nextSibling),r===null)break}return null}function u2(r,i,s){if(i==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!s||(r=wr(r.nextSibling),r===null))return null;return r}function C0(r,i){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!i||(r=wr(r.nextSibling),r===null))return null;return r}function Um(r){return r.data==="$?"||r.data==="$~"}function Pm(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function c2(r,i){var s=r.ownerDocument;if(r.data==="$~")r._reactRetry=i;else if(r.data!=="$?"||s.readyState!=="loading")i();else{var d=function(){i(),s.removeEventListener("DOMContentLoaded",d)};s.addEventListener("DOMContentLoaded",d),r._reactRetry=d}}function wr(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 Bm=null;function E0(r){r=r.nextSibling;for(var i=0;r;){if(r.nodeType===8){var s=r.data;if(s==="/$"||s==="/&"){if(i===0)return wr(r.nextSibling);i--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||i++}r=r.nextSibling}return null}function N0(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 _0(r,i,s){switch(i=nd(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 Ko(r){for(var i=r.attributes;i.length;)r.removeAttributeNode(i[0]);Ff(r)}var Sr=new Map,T0=new Set;function rd(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var wa=te.d;te.d={f:d2,r:f2,D:h2,C:m2,L:p2,m:g2,X:v2,S:y2,M:b2};function d2(){var r=wa.f(),i=Gc();return r||i}function f2(r){var i=Rl(r);i!==null&&i.tag===5&&i.type==="form"?Vb(i):wa.r(r)}var us=typeof document>"u"?null:document;function A0(r,i,s){var d=us;if(d&&typeof i=="string"&&i){var p=mr(i);p='link[rel="'+r+'"][href="'+p+'"]',typeof s=="string"&&(p+='[crossorigin="'+s+'"]'),T0.has(p)||(T0.add(p),r={rel:r,crossOrigin:s,href:i},d.querySelector(p)===null&&(i=d.createElement("link"),wn(i,"link",r),on(i),d.head.appendChild(i)))}}function h2(r){wa.D(r),A0("dns-prefetch",r,null)}function m2(r,i){wa.C(r,i),A0("preconnect",r,i)}function p2(r,i,s){wa.L(r,i,s);var d=us;if(d&&r&&i){var p='link[rel="preload"][as="'+mr(i)+'"]';i==="image"&&s&&s.imageSrcSet?(p+='[imagesrcset="'+mr(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(p+='[imagesizes="'+mr(s.imageSizes)+'"]')):p+='[href="'+mr(r)+'"]';var v=p;switch(i){case"style":v=cs(r);break;case"script":v=ds(r)}Sr.has(v)||(r=g({rel:"preload",href:i==="image"&&s&&s.imageSrcSet?void 0:r,as:i},s),Sr.set(v,r),d.querySelector(p)!==null||i==="style"&&d.querySelector(Yo(v))||i==="script"&&d.querySelector(Xo(v))||(i=d.createElement("link"),wn(i,"link",r),on(i),d.head.appendChild(i)))}}function g2(r,i){wa.m(r,i);var s=us;if(s&&r){var d=i&&typeof i.as=="string"?i.as:"script",p='link[rel="modulepreload"][as="'+mr(d)+'"][href="'+mr(r)+'"]',v=p;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=ds(r)}if(!Sr.has(v)&&(r=g({rel:"modulepreload",href:r},i),Sr.set(v,r),s.querySelector(p)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Xo(v)))return}d=s.createElement("link"),wn(d,"link",r),on(d),s.head.appendChild(d)}}}function y2(r,i,s){wa.S(r,i,s);var d=us;if(d&&r){var p=zl(d).hoistableStyles,v=cs(r);i=i||"default";var S=p.get(v);if(!S){var _={loading:0,preload:null};if(S=d.querySelector(Yo(v)))_.loading=5;else{r=g({rel:"stylesheet",href:r,"data-precedence":i},s),(s=Sr.get(v))&&$m(r,s);var $=S=d.createElement("link");on($),wn($,"link",r),$._p=new Promise(function(G,ae){$.onload=G,$.onerror=ae}),$.addEventListener("load",function(){_.loading|=1}),$.addEventListener("error",function(){_.loading|=2}),_.loading|=4,ad(S,i,d)}S={type:"stylesheet",instance:S,count:1,state:_},p.set(v,S)}}}function v2(r,i){wa.X(r,i);var s=us;if(s&&r){var d=zl(s).hoistableScripts,p=ds(r),v=d.get(p);v||(v=s.querySelector(Xo(p)),v||(r=g({src:r,async:!0},i),(i=Sr.get(p))&&Fm(r,i),v=s.createElement("script"),on(v),wn(v,"link",r),s.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},d.set(p,v))}}function b2(r,i){wa.M(r,i);var s=us;if(s&&r){var d=zl(s).hoistableScripts,p=ds(r),v=d.get(p);v||(v=s.querySelector(Xo(p)),v||(r=g({src:r,async:!0,type:"module"},i),(i=Sr.get(p))&&Fm(r,i),v=s.createElement("script"),on(v),wn(v,"link",r),s.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},d.set(p,v))}}function R0(r,i,s,d){var p=(p=ce.current)?rd(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=cs(s.href),s=zl(p).hoistableStyles,d=s.get(i),d||(d={type:"style",instance:null,count:0,state:null},s.set(i,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){r=cs(s.href);var v=zl(p).hoistableStyles,S=v.get(r);if(S||(p=p.ownerDocument||p,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(r,S),(v=p.querySelector(Yo(r)))&&!v._p&&(S.instance=v,S.state.loading=5),Sr.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},Sr.set(r,s),v||x2(p,r,s,S.state))),i&&d===null)throw Error(a(528,""));return S}if(i&&d!==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=ds(s),s=zl(p).hoistableScripts,d=s.get(i),d||(d={type:"script",instance:null,count:0,state:null},s.set(i,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,r))}}function cs(r){return'href="'+mr(r)+'"'}function Yo(r){return'link[rel="stylesheet"]['+r+"]"}function z0(r){return g({},r,{"data-precedence":r.precedence,precedence:null})}function x2(r,i,s,d){r.querySelector('link[rel="preload"][as="style"]['+i+"]")?d.loading=1:(i=r.createElement("link"),d.preload=i,i.addEventListener("load",function(){return d.loading|=1}),i.addEventListener("error",function(){return d.loading|=2}),wn(i,"link",s),on(i),r.head.appendChild(i))}function ds(r){return'[src="'+mr(r)+'"]'}function Xo(r){return"script[async]"+r}function O0(r,i,s){if(i.count++,i.instance===null)switch(i.type){case"style":var d=r.querySelector('style[data-href~="'+mr(s.href)+'"]');if(d)return i.instance=d,on(d),d;var p=g({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return d=(r.ownerDocument||r).createElement("style"),on(d),wn(d,"style",p),ad(d,s.precedence,r),i.instance=d;case"stylesheet":p=cs(s.href);var v=r.querySelector(Yo(p));if(v)return i.state.loading|=4,i.instance=v,on(v),v;d=z0(s),(p=Sr.get(p))&&$m(d,p),v=(r.ownerDocument||r).createElement("link"),on(v);var S=v;return S._p=new Promise(function(_,$){S.onload=_,S.onerror=$}),wn(v,"link",d),i.state.loading|=4,ad(v,s.precedence,r),i.instance=v;case"script":return v=ds(s.src),(p=r.querySelector(Xo(v)))?(i.instance=p,on(p),p):(d=s,(p=Sr.get(v))&&(d=g({},s),Fm(d,p)),r=r.ownerDocument||r,p=r.createElement("script"),on(p),wn(p,"link",d),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&&(d=i.instance,i.state.loading|=4,ad(d,s.precedence,r));return i.instance}function ad(r,i,s){for(var d=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=d.length?d[d.length-1]:null,v=p,S=0;S<d.length;S++){var _=d[S];if(_.dataset.precedence===i)v=_;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 $m(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.title==null&&(r.title=i.title)}function Fm(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.integrity==null&&(r.integrity=i.integrity)}var id=null;function D0(r,i,s){if(id===null){var d=new Map,p=id=new Map;p.set(s,d)}else p=id,d=p.get(s),d||(d=new Map,p.set(s,d));if(d.has(r))return d;for(d.set(r,null),s=s.getElementsByTagName(r),p=0;p<s.length;p++){var v=s[p];if(!(v[ho]||v[yn]||r==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var S=v.getAttribute(i)||"";S=r+S;var _=d.get(S);_?_.push(v):d.set(S,[v])}}return d}function M0(r,i,s){r=r.ownerDocument||r,r.head.insertBefore(s,i==="title"?r.querySelector("head > title"):null)}function w2(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 L0(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function S2(r,i,s,d){if(s.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var p=cs(d.href),v=i.querySelector(Yo(p));if(v){i=v._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(r.count++,r=ld.bind(r),i.then(r,r)),s.state.loading|=4,s.instance=v,on(v);return}v=i.ownerDocument||i,d=z0(d),(p=Sr.get(p))&&$m(d,p),v=v.createElement("link"),on(v);var S=v;S._p=new Promise(function(_,$){S.onload=_,S.onerror=$}),wn(v,"link",d),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=ld.bind(r),i.addEventListener("load",s),i.addEventListener("error",s))}}var qm=0;function k2(r,i){return r.stylesheets&&r.count===0&&od(r,r.stylesheets),0<r.count||0<r.imgCount?function(s){var d=setTimeout(function(){if(r.stylesheets&&od(r,r.stylesheets),r.unsuspend){var v=r.unsuspend;r.unsuspend=null,v()}},6e4+i);0<r.imgBytes&&qm===0&&(qm=62500*r2());var p=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&od(r,r.stylesheets),r.unsuspend)){var v=r.unsuspend;r.unsuspend=null,v()}},(r.imgBytes>qm?50:800)+i);return r.unsuspend=s,function(){r.unsuspend=null,clearTimeout(d),clearTimeout(p)}}:null}function ld(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)od(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var sd=null;function od(r,i){r.stylesheets=null,r.unsuspend!==null&&(r.count++,sd=new Map,i.forEach(j2,r),sd=null,ld.call(r))}function j2(r,i){if(!(i.state.loading&4)){var s=sd.get(r);if(s)var d=s.get(null);else{s=new Map,sd.set(r,s);for(var p=r.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<p.length;v++){var S=p[v];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(s.set(S.dataset.precedence,S),d=S)}d&&s.set(null,d)}p=i.instance,S=p.getAttribute("data-precedence"),v=s.get(S)||d,v===d&&s.set(null,p),s.set(S,p),this.count++,d=ld.bind(this),p.addEventListener("load",d),p.addEventListener("error",d),v?v.parentNode.insertBefore(p,v.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(p,r.firstChild)),i.state.loading|=4}}var Jo={$$typeof:z,Provider:null,Consumer:null,_currentValue:ie,_currentValue2:ie,_threadCount:0};function C2(r,i,s,d,p,v,S,_,$){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=Je(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Je(0),this.hiddenUpdates=Je(null),this.identifierPrefix=d,this.onUncaughtError=p,this.onCaughtError=v,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=$,this.incompleteTransitions=new Map}function I0(r,i,s,d,p,v,S,_,$,G,ae,de){return r=new C2(r,i,s,S,$,G,ae,de,_),i=1,v===!0&&(i|=24),v=Jn(3,null,null,i),r.current=v,v.stateNode=r,i=Sh(),i.refCount++,r.pooledCache=i,i.refCount++,v.memoizedState={element:d,isDehydrated:s,cache:i},Eh(v),r}function U0(r){return r?(r=Fl,r):Fl}function P0(r,i,s,d,p,v){p=U0(p),d.context===null?d.context=p:d.pendingContext=p,d=Za(i),d.payload={element:s},v=v===void 0?null:v,v!==null&&(d.callback=v),s=Va(r,d,i),s!==null&&(qn(s,r,i),Ao(s,r,i))}function B0(r,i){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var s=r.retryLane;r.retryLane=s!==0&&s<i?s:i}}function Hm(r,i){B0(r,i),(r=r.alternate)&&B0(r,i)}function $0(r){if(r.tag===13||r.tag===31){var i=Hi(r,67108864);i!==null&&qn(i,r,67108864),Hm(r,67108864)}}function F0(r){if(r.tag===13||r.tag===31){var i=rr();i=Pf(i);var s=Hi(r,i);s!==null&&qn(s,r,i),Hm(r,i)}}var ud=!0;function E2(r,i,s,d){var p=Z.T;Z.T=null;var v=te.p;try{te.p=2,Zm(r,i,s,d)}finally{te.p=v,Z.T=p}}function N2(r,i,s,d){var p=Z.T;Z.T=null;var v=te.p;try{te.p=8,Zm(r,i,s,d)}finally{te.p=v,Z.T=p}}function Zm(r,i,s,d){if(ud){var p=Vm(d);if(p===null)Rm(r,i,d,cd,s),H0(r,d);else if(T2(p,r,i,s,d))d.stopPropagation();else if(H0(r,d),i&4&&-1<_2.indexOf(r)){for(;p!==null;){var v=Rl(p);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var S=Pr(v.pendingLanes);if(S!==0){var _=v;for(_.pendingLanes|=2,_.entangledLanes|=2;S;){var $=1<<31-ht(S);_.entanglements[1]|=$,S&=~$}qr(v),(ft&6)===0&&(Vc=hn()+500,Vo(0))}}break;case 31:case 13:_=Hi(v,2),_!==null&&qn(_,v,2),Gc(),Hm(v,2)}if(v=Vm(d),v===null&&Rm(r,i,d,cd,s),v===p)break;p=v}p!==null&&d.stopPropagation()}else Rm(r,i,d,null,s)}}function Vm(r){return r=Gf(r),Qm(r)}var cd=null;function Qm(r){if(cd=null,r=Al(r),r!==null){var i=o(r);if(i===null)r=null;else{var s=i.tag;if(s===13){if(r=c(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 cd=r,null}function q0(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(co()){case le:return 2;case be:return 8;case Ue:case $e:return 32;case at:return 268435456;default:return 32}default:return 32}}var Gm=!1,ri=null,ai=null,ii=null,Wo=new Map,eu=new Map,li=[],_2="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 H0(r,i){switch(r){case"focusin":case"focusout":ri=null;break;case"dragenter":case"dragleave":ai=null;break;case"mouseover":case"mouseout":ii=null;break;case"pointerover":case"pointerout":Wo.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":eu.delete(i.pointerId)}}function tu(r,i,s,d,p,v){return r===null||r.nativeEvent!==v?(r={blockedOn:i,domEventName:s,eventSystemFlags:d,nativeEvent:v,targetContainers:[p]},i!==null&&(i=Rl(i),i!==null&&$0(i)),r):(r.eventSystemFlags|=d,i=r.targetContainers,p!==null&&i.indexOf(p)===-1&&i.push(p),r)}function T2(r,i,s,d,p){switch(i){case"focusin":return ri=tu(ri,r,i,s,d,p),!0;case"dragenter":return ai=tu(ai,r,i,s,d,p),!0;case"mouseover":return ii=tu(ii,r,i,s,d,p),!0;case"pointerover":var v=p.pointerId;return Wo.set(v,tu(Wo.get(v)||null,r,i,s,d,p)),!0;case"gotpointercapture":return v=p.pointerId,eu.set(v,tu(eu.get(v)||null,r,i,s,d,p)),!0}return!1}function Z0(r){var i=Al(r.target);if(i!==null){var s=o(i);if(s!==null){if(i=s.tag,i===13){if(i=c(s),i!==null){r.blockedOn=i,iv(r.priority,function(){F0(s)});return}}else if(i===31){if(i=f(s),i!==null){r.blockedOn=i,iv(r.priority,function(){F0(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 dd(r){if(r.blockedOn!==null)return!1;for(var i=r.targetContainers;0<i.length;){var s=Vm(r.nativeEvent);if(s===null){s=r.nativeEvent;var d=new s.constructor(s.type,s);Qf=d,s.target.dispatchEvent(d),Qf=null}else return i=Rl(s),i!==null&&$0(i),r.blockedOn=s,!1;i.shift()}return!0}function V0(r,i,s){dd(r)&&s.delete(i)}function A2(){Gm=!1,ri!==null&&dd(ri)&&(ri=null),ai!==null&&dd(ai)&&(ai=null),ii!==null&&dd(ii)&&(ii=null),Wo.forEach(V0),eu.forEach(V0)}function fd(r,i){r.blockedOn===i&&(r.blockedOn=null,Gm||(Gm=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,A2)))}var hd=null;function Q0(r){hd!==r&&(hd=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){hd===r&&(hd=null);for(var i=0;i<r.length;i+=3){var s=r[i],d=r[i+1],p=r[i+2];if(typeof d!="function"){if(Qm(d||s)===null)continue;break}var v=Rl(s);v!==null&&(r.splice(i,3),i-=3,Vh(v,{pending:!0,data:p,method:s.method,action:d},d,p))}}))}function fs(r){function i($){return fd($,r)}ri!==null&&fd(ri,r),ai!==null&&fd(ai,r),ii!==null&&fd(ii,r),Wo.forEach(i),eu.forEach(i);for(var s=0;s<li.length;s++){var d=li[s];d.blockedOn===r&&(d.blockedOn=null)}for(;0<li.length&&(s=li[0],s.blockedOn===null);)Z0(s),s.blockedOn===null&&li.shift();if(s=(r.ownerDocument||r).$$reactFormReplay,s!=null)for(d=0;d<s.length;d+=3){var p=s[d],v=s[d+1],S=p[In]||null;if(typeof v=="function")S||Q0(s);else if(S){var _=null;if(v&&v.hasAttribute("formAction")){if(p=v,S=v[In]||null)_=S.formAction;else if(Qm(p)!==null)continue}else _=S.action;typeof _=="function"?s[d+1]=_:(s.splice(d,3),d-=3),Q0(s)}}}function G0(){function r(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(S){return p=S})},focusReset:"manual",scroll:"manual"})}function i(){p!==null&&(p(),p=null),d||setTimeout(s,20)}function s(){if(!d&&!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 d=!1,p=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(s,100),function(){d=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),p!==null&&(p(),p=null)}}}function Km(r){this._internalRoot=r}md.prototype.render=Km.prototype.render=function(r){var i=this._internalRoot;if(i===null)throw Error(a(409));var s=i.current,d=rr();P0(s,d,r,i,null,null)},md.prototype.unmount=Km.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var i=r.containerInfo;P0(r.current,2,null,r,null,null),Gc(),i[Tl]=null}};function md(r){this._internalRoot=r}md.prototype.unstable_scheduleHydration=function(r){if(r){var i=av();r={blockedOn:null,target:r,priority:i};for(var s=0;s<li.length&&i!==0&&i<li[s].priority;s++);li.splice(s,0,r),s===0&&Z0(r)}};var K0=t.version;if(K0!=="19.2.4")throw Error(a(527,K0,"19.2.4"));te.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?y(r):null,r=r===null?null:r.stateNode,r};var R2={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:Z,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var pd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!pd.isDisabled&&pd.supportsFiber)try{nn=pd.inject(R2),Zt=pd}catch{}}return ru.createRoot=function(r,i){if(!l(r))throw Error(a(299));var s=!1,d="",p=nx,v=rx,S=ax;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(d=i.identifierPrefix),i.onUncaughtError!==void 0&&(p=i.onUncaughtError),i.onCaughtError!==void 0&&(v=i.onCaughtError),i.onRecoverableError!==void 0&&(S=i.onRecoverableError)),i=I0(r,1,!1,null,null,s,d,null,p,v,S,G0),r[Tl]=i.current,Am(r),new Km(i)},ru.hydrateRoot=function(r,i,s){if(!l(r))throw Error(a(299));var d=!1,p="",v=nx,S=rx,_=ax,$=null;return s!=null&&(s.unstable_strictMode===!0&&(d=!0),s.identifierPrefix!==void 0&&(p=s.identifierPrefix),s.onUncaughtError!==void 0&&(v=s.onUncaughtError),s.onCaughtError!==void 0&&(S=s.onCaughtError),s.onRecoverableError!==void 0&&(_=s.onRecoverableError),s.formState!==void 0&&($=s.formState)),i=I0(r,1,!0,i,s??null,d,p,$,v,S,_,G0),i.context=U0(null),s=i.current,d=rr(),d=Pf(d),p=Za(d),p.callback=null,Va(s,p,d),s=d,i.current.lanes=s,gn(i,s),qr(i),r[Tl]=i.current,Am(r),new md(i)},ru.version="19.2.4",ru}var l1;function F2(){if(l1)return Wm.exports;l1=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(),Wm.exports=$2(),Wm.exports}var q2=F2(),Sl=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(){}},ll,mi,Ts,zS,H2=(zS=class extends Sl{constructor(){super();je(this,ll);je(this,mi);je(this,Ts);ve(this,Ts,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){L(this,mi)||this.setEventListener(L(this,Ts))}onUnsubscribe(){var t;this.hasListeners()||((t=L(this,mi))==null||t.call(this),ve(this,mi,void 0))}setEventListener(t){var n;ve(this,Ts,t),(n=L(this,mi))==null||n.call(this),ve(this,mi,t(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()}))}setFocused(t){L(this,ll)!==t&&(ve(this,ll,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof L(this,ll)=="boolean"?L(this,ll):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},ll=new WeakMap,mi=new WeakMap,Ts=new WeakMap,zS),Qg=new H2,Z2={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},pi,Hg,OS,V2=(OS=class{constructor(){je(this,pi,Z2);je(this,Hg,!1)}setTimeoutProvider(e){ve(this,pi,e)}setTimeout(e,t){return L(this,pi).setTimeout(e,t)}clearTimeout(e){L(this,pi).clearTimeout(e)}setInterval(e,t){return L(this,pi).setInterval(e,t)}clearInterval(e){L(this,pi).clearInterval(e)}},pi=new WeakMap,Hg=new WeakMap,OS),il=new V2;function Q2(e){setTimeout(e,0)}var G2=typeof window>"u"||"Deno"in globalThis;function _n(){}function K2(e,t){return typeof e=="function"?e(t):e}function Hp(e){return typeof e=="number"&&e>=0&&e!==1/0}function ZS(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ci(e,t){return typeof e=="function"?e(t):e}function Cr(e,t){return typeof e=="function"?e(t):e}function s1(e,t){const{type:n="all",exact:a,fetchStatus:l,predicate:o,queryKey:c,stale:f}=e;if(c){if(a){if(t.queryHash!==Gg(c,t.options))return!1}else if(!Su(t.queryKey,c))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 o1(e,t){const{exact:n,status:a,predicate:l,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(pl(t.options.mutationKey)!==pl(o))return!1}else if(!Su(t.options.mutationKey,o))return!1}return!(a&&t.state.status!==a||l&&!l(t))}function Gg(e,t){return((t==null?void 0:t.queryKeyHashFn)||pl)(e)}function pl(e){return JSON.stringify(e,(t,n)=>Zp(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 Y2=Object.prototype.hasOwnProperty;function Kg(e,t,n=0){if(e===t)return e;if(n>500)return t;const a=u1(e)&&u1(t);if(!a&&!(Zp(e)&&Zp(t)))return t;const o=(a?e:Object.keys(e)).length,c=a?t:Object.keys(t),f=c.length,m=a?new Array(f):{};let h=0;for(let y=0;y<f;y++){const g=a?y:c[y],b=e[g],w=t[g];if(b===w){m[g]=b,(a?y<o:Y2.call(e,g))&&h++;continue}if(b===null||w===null||typeof b!="object"||typeof w!="object"){m[g]=w;continue}const k=Kg(b,w,n+1);m[g]=k,k===b&&h++}return o===f&&h===o?e:m}function ku(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 u1(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Zp(e){if(!c1(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!c1(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function c1(e){return Object.prototype.toString.call(e)==="[object Object]"}function X2(e){return new Promise(t=>{il.setTimeout(t,e)})}function Vp(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Kg(e,t):t}function J2(e,t,n=0){const a=[...e,t];return n&&a.length>n?a.slice(1):a}function W2(e,t,n=0){const a=[t,...e];return n&&a.length>n?a.slice(0,-1):a}var Yg=Symbol();function VS(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Yg?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Xg(e,t){return typeof e=="function"?e(...t):!!e}function eT(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 ju=(()=>{let e=()=>G2;return{isServer(){return e()},setIsServer(t){e=t}}})();function Qp(){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 tT=Q2;function nT(){let e=[],t=0,n=f=>{f()},a=f=>{f()},l=tT;const o=f=>{t?e.push(f):l(()=>{n(f)})},c=()=>{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||c()}return m},batchCalls:f=>(...m)=>{o(()=>{f(...m)})},schedule:o,setNotifyFunction:f=>{n=f},setBatchNotifyFunction:f=>{a=f},setScheduler:f=>{l=f}}}var Bt=nT(),As,gi,Rs,DS,rT=(DS=class extends Sl{constructor(){super();je(this,As,!0);je(this,gi);je(this,Rs);ve(this,Rs,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(){L(this,gi)||this.setEventListener(L(this,Rs))}onUnsubscribe(){var t;this.hasListeners()||((t=L(this,gi))==null||t.call(this),ve(this,gi,void 0))}setEventListener(t){var n;ve(this,Rs,t),(n=L(this,gi))==null||n.call(this),ve(this,gi,t(this.setOnline.bind(this)))}setOnline(t){L(this,As)!==t&&(ve(this,As,t),this.listeners.forEach(a=>{a(t)}))}isOnline(){return L(this,As)}},As=new WeakMap,gi=new WeakMap,Rs=new WeakMap,DS),Vd=new rT;function aT(e){return Math.min(1e3*2**e,3e4)}function QS(e){return(e??"online")==="online"?Vd.isOnline():!0}var Gp=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function GS(e){let t=!1,n=0,a;const l=Qp(),o=()=>l.status!=="pending",c=j=>{var E;if(!o()){const C=new Gp(j);b(C),(E=e.onCancel)==null||E.call(e,C)}},f=()=>{t=!0},m=()=>{t=!1},h=()=>Qg.isFocused()&&(e.networkMode==="always"||Vd.isOnline())&&e.canRun(),y=()=>QS(e.networkMode)&&e.canRun(),g=j=>{o()||(a==null||a(),l.resolve(j))},b=j=>{o()||(a==null||a(),l.reject(j))},w=()=>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(g).catch(C=>{var O;if(o())return;const N=e.retry??(ju.isServer()?0:3),z=e.retryDelay??aT,U=typeof z=="function"?z(n,C):z,D=N===!0||typeof N=="number"&&n<N||typeof N=="function"&&N(n,C);if(t||!D){b(C);return}n++,(O=e.onFail)==null||O.call(e,n,C),X2(U).then(()=>h()?void 0:w()).then(()=>{t?b(C):k()})})};return{promise:l,status:()=>l.status,cancel:c,continue:()=>(a==null||a(),l),cancelRetry:f,continueRetry:m,canStart:y,start:()=>(y()?k():w().then(k),l)}}var sl,MS,KS=(MS=class{constructor(){je(this,sl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Hp(this.gcTime)&&ve(this,sl,il.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ju.isServer()?1/0:300*1e3))}clearGcTimeout(){L(this,sl)&&(il.clearTimeout(L(this,sl)),ve(this,sl,void 0))}},sl=new WeakMap,MS),ol,zs,kr,ul,cn,Ou,cl,sr,YS,ka,LS,iT=(LS=class extends KS{constructor(t){super();je(this,sr);je(this,ol);je(this,zs);je(this,kr);je(this,ul);je(this,cn);je(this,Ou);je(this,cl);ve(this,cl,!1),ve(this,Ou,t.defaultOptions),this.setOptions(t.options),this.observers=[],ve(this,ul,t.client),ve(this,kr,L(this,ul).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ve(this,ol,f1(this.options)),this.state=t.state??L(this,ol),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=L(this,cn))==null?void 0:t.promise}setOptions(t){if(this.options={...L(this,Ou),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=f1(this.options);n.data!==void 0&&(this.setState(d1(n.data,n.dataUpdatedAt)),ve(this,ol,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&L(this,kr).remove(this)}setData(t,n){const a=Vp(this.state.data,t,this.options);return Me(this,sr,ka).call(this,{data:a,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),a}setState(t,n){Me(this,sr,ka).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var a,l;const n=(a=L(this,cn))==null?void 0:a.promise;return(l=L(this,cn))==null||l.cancel(t),n?n.then(_n).catch(_n):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return L(this,ol)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Cr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Yg||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Ci(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:!ZS(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(a=>a.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=L(this,cn))==null||n.continue()}onOnline(){var n;const t=this.observers.find(a=>a.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=L(this,cn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),L(this,kr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(L(this,cn)&&(L(this,cl)||Me(this,sr,YS).call(this)?L(this,cn).cancel({revert:!0}):L(this,cn).cancelRetry()),this.scheduleGc()),L(this,kr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Me(this,sr,ka).call(this,{type:"invalidate"})}async fetch(t,n){var m,h,y,g,b,w,k,j,E,C,N,z;if(this.state.fetchStatus!=="idle"&&((m=L(this,cn))==null?void 0:m.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(L(this,cn))return L(this,cn).continueRetry(),L(this,cn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const U=this.observers.find(D=>D.options.queryFn);U&&this.setOptions(U.options)}const a=new AbortController,l=U=>{Object.defineProperty(U,"signal",{enumerable:!0,get:()=>(ve(this,cl,!0),a.signal)})},o=()=>{const U=VS(this.options,n),O=(()=>{const M={client:L(this,ul),queryKey:this.queryKey,meta:this.meta};return l(M),M})();return ve(this,cl,!1),this.options.persister?this.options.persister(U,O,this):U(O)},f=(()=>{const U={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:L(this,ul),state:this.state,fetchFn:o};return l(U),U})();(h=this.options.behavior)==null||h.onFetch(f,this),ve(this,zs,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((y=f.fetchOptions)==null?void 0:y.meta))&&Me(this,sr,ka).call(this,{type:"fetch",meta:(g=f.fetchOptions)==null?void 0:g.meta}),ve(this,cn,GS({initialPromise:n==null?void 0:n.initialPromise,fn:f.fetchFn,onCancel:U=>{U instanceof Gp&&U.revert&&this.setState({...L(this,zs),fetchStatus:"idle"}),a.abort()},onFail:(U,D)=>{Me(this,sr,ka).call(this,{type:"failed",failureCount:U,error:D})},onPause:()=>{Me(this,sr,ka).call(this,{type:"pause"})},onContinue:()=>{Me(this,sr,ka).call(this,{type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.options.networkMode,canRun:()=>!0}));try{const U=await L(this,cn).start();if(U===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(U),(w=(b=L(this,kr).config).onSuccess)==null||w.call(b,U,this),(j=(k=L(this,kr).config).onSettled)==null||j.call(k,U,this.state.error,this),U}catch(U){if(U instanceof Gp){if(U.silent)return L(this,cn).promise;if(U.revert){if(this.state.data===void 0)throw U;return this.state.data}}throw Me(this,sr,ka).call(this,{type:"error",error:U}),(C=(E=L(this,kr).config).onError)==null||C.call(E,U,this),(z=(N=L(this,kr).config).onSettled)==null||z.call(N,this.state.data,U,this),U}finally{this.scheduleGc()}}},ol=new WeakMap,zs=new WeakMap,kr=new WeakMap,ul=new WeakMap,cn=new WeakMap,Ou=new WeakMap,cl=new WeakMap,sr=new WeakSet,YS=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},ka=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,...XS(a.data,this.options),fetchMeta:t.meta??null};case"success":const l={...a,...d1(t.data,t.dataUpdatedAt),dataUpdateCount:a.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ve(this,zs,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),Bt.batch(()=>{this.observers.forEach(a=>{a.onQueryUpdate()}),L(this,kr).notify({query:this,type:"updated",action:t})})},LS);function XS(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:QS(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function d1(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function f1(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 Zn,lt,Du,On,dl,Os,ja,yi,Mu,Ds,Ms,fl,hl,vi,Ls,pt,hu,Kp,Yp,Xp,Jp,Wp,eg,tg,JS,IS,Jg=(IS=class extends Sl{constructor(t,n){super();je(this,pt);je(this,Zn);je(this,lt);je(this,Du);je(this,On);je(this,dl);je(this,Os);je(this,ja);je(this,yi);je(this,Mu);je(this,Ds);je(this,Ms);je(this,fl);je(this,hl);je(this,vi);je(this,Ls,new Set);this.options=n,ve(this,Zn,t),ve(this,yi,null),ve(this,ja,Qp()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(L(this,lt).addObserver(this),h1(L(this,lt),this.options)?Me(this,pt,hu).call(this):this.updateResult(),Me(this,pt,Jp).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ng(L(this,lt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ng(L(this,lt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Me(this,pt,Wp).call(this),Me(this,pt,eg).call(this),L(this,lt).removeObserver(this)}setOptions(t){const n=this.options,a=L(this,lt);if(this.options=L(this,Zn).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Cr(this.options.enabled,L(this,lt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Me(this,pt,tg).call(this),L(this,lt).setOptions(this.options),n._defaulted&&!ku(this.options,n)&&L(this,Zn).getQueryCache().notify({type:"observerOptionsUpdated",query:L(this,lt),observer:this});const l=this.hasListeners();l&&m1(L(this,lt),a,this.options,n)&&Me(this,pt,hu).call(this),this.updateResult(),l&&(L(this,lt)!==a||Cr(this.options.enabled,L(this,lt))!==Cr(n.enabled,L(this,lt))||Ci(this.options.staleTime,L(this,lt))!==Ci(n.staleTime,L(this,lt)))&&Me(this,pt,Kp).call(this);const o=Me(this,pt,Yp).call(this);l&&(L(this,lt)!==a||Cr(this.options.enabled,L(this,lt))!==Cr(n.enabled,L(this,lt))||o!==L(this,vi))&&Me(this,pt,Xp).call(this,o)}getOptimisticResult(t){const n=L(this,Zn).getQueryCache().build(L(this,Zn),t),a=this.createResult(n,t);return sT(this,a)&&(ve(this,On,a),ve(this,Os,this.options),ve(this,dl,L(this,lt).state)),a}getCurrentResult(){return L(this,On)}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&&L(this,ja).status==="pending"&&L(this,ja).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(a,l))})}trackProp(t){L(this,Ls).add(t)}getCurrentQuery(){return L(this,lt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=L(this,Zn).defaultQueryOptions(t),a=L(this,Zn).getQueryCache().build(L(this,Zn),n);return a.fetch().then(()=>this.createResult(a,n))}fetch(t){return Me(this,pt,hu).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),L(this,On)))}createResult(t,n){var X;const a=L(this,lt),l=this.options,o=L(this,On),c=L(this,dl),f=L(this,Os),h=t!==a?t.state:L(this,Du),{state:y}=t;let g={...y},b=!1,w;if(n._optimisticResults){const F=this.hasListeners(),W=!F&&h1(t,n),ee=F&&m1(t,a,n,l);(W||ee)&&(g={...g,...XS(y.data,t.options)}),n._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:k,errorUpdatedAt:j,status:E}=g;w=g.data;let C=!1;if(n.placeholderData!==void 0&&w===void 0&&E==="pending"){let F;o!=null&&o.isPlaceholderData&&n.placeholderData===(f==null?void 0:f.placeholderData)?(F=o.data,C=!0):F=typeof n.placeholderData=="function"?n.placeholderData((X=L(this,Ms))==null?void 0:X.state.data,L(this,Ms)):n.placeholderData,F!==void 0&&(E="success",w=Vp(o==null?void 0:o.data,F,n),b=!0)}if(n.select&&w!==void 0&&!C)if(o&&w===(c==null?void 0:c.data)&&n.select===L(this,Mu))w=L(this,Ds);else try{ve(this,Mu,n.select),w=n.select(w),w=Vp(o==null?void 0:o.data,w,n),ve(this,Ds,w),ve(this,yi,null)}catch(F){ve(this,yi,F)}L(this,yi)&&(k=L(this,yi),w=L(this,Ds),j=Date.now(),E="error");const N=g.fetchStatus==="fetching",z=E==="pending",U=E==="error",D=z&&N,O=w!==void 0,I={status:E,fetchStatus:g.fetchStatus,isPending:z,isSuccess:E==="success",isError:U,isInitialLoading:D,isLoading:D,data:w,dataUpdatedAt:g.dataUpdatedAt,error:k,errorUpdatedAt:j,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:g.dataUpdateCount>h.dataUpdateCount||g.errorUpdateCount>h.errorUpdateCount,isFetching:N,isRefetching:N&&!z,isLoadingError:U&&!O,isPaused:g.fetchStatus==="paused",isPlaceholderData:b,isRefetchError:U&&O,isStale:Wg(t,n),refetch:this.refetch,promise:L(this,ja),isEnabled:Cr(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const F=I.data!==void 0,W=I.status==="error"&&!F,ee=ne=>{W?ne.reject(I.error):F&&ne.resolve(I.data)},ye=()=>{const ne=ve(this,ja,I.promise=Qp());ee(ne)},he=L(this,ja);switch(he.status){case"pending":t.queryHash===a.queryHash&&ee(he);break;case"fulfilled":(W||I.data!==he.value)&&ye();break;case"rejected":(!W||I.error!==he.reason)&&ye();break}}return I}updateResult(){const t=L(this,On),n=this.createResult(L(this,lt),this.options);if(ve(this,dl,L(this,lt).state),ve(this,Os,this.options),L(this,dl).data!==void 0&&ve(this,Ms,L(this,lt)),ku(n,t))return;ve(this,On,n);const a=()=>{if(!t)return!0;const{notifyOnChangeProps:l}=this.options,o=typeof l=="function"?l():l;if(o==="all"||!o&&!L(this,Ls).size)return!0;const c=new Set(o??L(this,Ls));return this.options.throwOnError&&c.add("error"),Object.keys(L(this,On)).some(f=>{const m=f;return L(this,On)[m]!==t[m]&&c.has(m)})};Me(this,pt,JS).call(this,{listeners:a()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Me(this,pt,Jp).call(this)}},Zn=new WeakMap,lt=new WeakMap,Du=new WeakMap,On=new WeakMap,dl=new WeakMap,Os=new WeakMap,ja=new WeakMap,yi=new WeakMap,Mu=new WeakMap,Ds=new WeakMap,Ms=new WeakMap,fl=new WeakMap,hl=new WeakMap,vi=new WeakMap,Ls=new WeakMap,pt=new WeakSet,hu=function(t){Me(this,pt,tg).call(this);let n=L(this,lt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(_n)),n},Kp=function(){Me(this,pt,Wp).call(this);const t=Ci(this.options.staleTime,L(this,lt));if(ju.isServer()||L(this,On).isStale||!Hp(t))return;const a=ZS(L(this,On).dataUpdatedAt,t)+1;ve(this,fl,il.setTimeout(()=>{L(this,On).isStale||this.updateResult()},a))},Yp=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(L(this,lt)):this.options.refetchInterval)??!1},Xp=function(t){Me(this,pt,eg).call(this),ve(this,vi,t),!(ju.isServer()||Cr(this.options.enabled,L(this,lt))===!1||!Hp(L(this,vi))||L(this,vi)===0)&&ve(this,hl,il.setInterval(()=>{(this.options.refetchIntervalInBackground||Qg.isFocused())&&Me(this,pt,hu).call(this)},L(this,vi)))},Jp=function(){Me(this,pt,Kp).call(this),Me(this,pt,Xp).call(this,Me(this,pt,Yp).call(this))},Wp=function(){L(this,fl)&&(il.clearTimeout(L(this,fl)),ve(this,fl,void 0))},eg=function(){L(this,hl)&&(il.clearInterval(L(this,hl)),ve(this,hl,void 0))},tg=function(){const t=L(this,Zn).getQueryCache().build(L(this,Zn),this.options);if(t===L(this,lt))return;const n=L(this,lt);ve(this,lt,t),ve(this,Du,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},JS=function(t){Bt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(L(this,On))}),L(this,Zn).getQueryCache().notify({query:L(this,lt),type:"observerResultsUpdated"})})},IS);function lT(e,t){return Cr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function h1(e,t){return lT(e,t)||e.state.data!==void 0&&ng(e,t,t.refetchOnMount)}function ng(e,t,n){if(Cr(t.enabled,e)!==!1&&Ci(t.staleTime,e)!=="static"){const a=typeof n=="function"?n(e):n;return a==="always"||a!==!1&&Wg(e,t)}return!1}function m1(e,t,n,a){return(e!==t||Cr(a.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Wg(e,n)}function Wg(e,t){return Cr(t.enabled,e)!==!1&&e.isStaleByTime(Ci(t.staleTime,e))}function sT(e,t){return!ku(e.getCurrentResult(),t)}function p1(e){return{onFetch:(t,n)=>{var y,g,b,w,k;const a=t.options,l=(b=(g=(y=t.fetchOptions)==null?void 0:y.meta)==null?void 0:g.fetchMore)==null?void 0:b.direction,o=((w=t.state.data)==null?void 0:w.pages)||[],c=((k=t.state.data)==null?void 0:k.pageParams)||[];let f={pages:[],pageParams:[]},m=0;const h=async()=>{let j=!1;const E=z=>{eT(z,()=>t.signal,()=>j=!0)},C=VS(t.options,t.fetchOptions),N=async(z,U,D)=>{if(j)return Promise.reject();if(U==null&&z.pages.length)return Promise.resolve(z);const M=(()=>{const W={client:t.client,queryKey:t.queryKey,pageParam:U,direction:D?"backward":"forward",meta:t.options.meta};return E(W),W})(),I=await C(M),{maxPages:X}=t.options,F=D?W2:J2;return{pages:F(z.pages,I,X),pageParams:F(z.pageParams,U,X)}};if(l&&o.length){const z=l==="backward",U=z?oT:g1,D={pages:o,pageParams:c},O=U(a,D);f=await N(D,O,z)}else{const z=e??o.length;do{const U=m===0?c[0]??a.initialPageParam:g1(a,f);if(m>0&&U==null)break;f=await N(f,U),m++}while(m<z)}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 g1(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 oT(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 Lu,Zr,En,ml,Vr,di,US,uT=(US=class extends KS{constructor(t){super();je(this,Vr);je(this,Lu);je(this,Zr);je(this,En);je(this,ml);ve(this,Lu,t.client),this.mutationId=t.mutationId,ve(this,En,t.mutationCache),ve(this,Zr,[]),this.state=t.state||WS(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){L(this,Zr).includes(t)||(L(this,Zr).push(t),this.clearGcTimeout(),L(this,En).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ve(this,Zr,L(this,Zr).filter(n=>n!==t)),this.scheduleGc(),L(this,En).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){L(this,Zr).length||(this.state.status==="pending"?this.scheduleGc():L(this,En).remove(this))}continue(){var t;return((t=L(this,ml))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var c,f,m,h,y,g,b,w,k,j,E,C,N,z,U,D,O,M;const n=()=>{Me(this,Vr,di).call(this,{type:"continue"})},a={client:L(this,Lu),meta:this.options.meta,mutationKey:this.options.mutationKey};ve(this,ml,GS({fn:()=>this.options.mutationFn?this.options.mutationFn(t,a):Promise.reject(new Error("No mutationFn found")),onFail:(I,X)=>{Me(this,Vr,di).call(this,{type:"failed",failureCount:I,error:X})},onPause:()=>{Me(this,Vr,di).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>L(this,En).canRun(this)}));const l=this.state.status==="pending",o=!L(this,ml).canStart();try{if(l)n();else{Me(this,Vr,di).call(this,{type:"pending",variables:t,isPaused:o}),L(this,En).config.onMutate&&await L(this,En).config.onMutate(t,this,a);const X=await((f=(c=this.options).onMutate)==null?void 0:f.call(c,t,a));X!==this.state.context&&Me(this,Vr,di).call(this,{type:"pending",context:X,variables:t,isPaused:o})}const I=await L(this,ml).start();return await((h=(m=L(this,En).config).onSuccess)==null?void 0:h.call(m,I,t,this.state.context,this,a)),await((g=(y=this.options).onSuccess)==null?void 0:g.call(y,I,t,this.state.context,a)),await((w=(b=L(this,En).config).onSettled)==null?void 0:w.call(b,I,null,this.state.variables,this.state.context,this,a)),await((j=(k=this.options).onSettled)==null?void 0:j.call(k,I,null,t,this.state.context,a)),Me(this,Vr,di).call(this,{type:"success",data:I}),I}catch(I){try{await((C=(E=L(this,En).config).onError)==null?void 0:C.call(E,I,t,this.state.context,this,a))}catch(X){Promise.reject(X)}try{await((z=(N=this.options).onError)==null?void 0:z.call(N,I,t,this.state.context,a))}catch(X){Promise.reject(X)}try{await((D=(U=L(this,En).config).onSettled)==null?void 0:D.call(U,void 0,I,this.state.variables,this.state.context,this,a))}catch(X){Promise.reject(X)}try{await((M=(O=this.options).onSettled)==null?void 0:M.call(O,void 0,I,t,this.state.context,a))}catch(X){Promise.reject(X)}throw Me(this,Vr,di).call(this,{type:"error",error:I}),I}finally{L(this,En).runNext(this)}}},Lu=new WeakMap,Zr=new WeakMap,En=new WeakMap,ml=new WeakMap,Vr=new WeakSet,di=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),Bt.batch(()=>{L(this,Zr).forEach(a=>{a.onMutationUpdate(t)}),L(this,En).notify({mutation:this,type:"updated",action:t})})},US);function WS(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ca,Lr,Iu,PS,cT=(PS=class extends Sl{constructor(t={}){super();je(this,Ca);je(this,Lr);je(this,Iu);this.config=t,ve(this,Ca,new Set),ve(this,Lr,new Map),ve(this,Iu,0)}build(t,n,a){const l=new uT({client:t,mutationCache:this,mutationId:++gd(this,Iu)._,options:t.defaultMutationOptions(n),state:a});return this.add(l),l}add(t){L(this,Ca).add(t);const n=yd(t);if(typeof n=="string"){const a=L(this,Lr).get(n);a?a.push(t):L(this,Lr).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(L(this,Ca).delete(t)){const n=yd(t);if(typeof n=="string"){const a=L(this,Lr).get(n);if(a)if(a.length>1){const l=a.indexOf(t);l!==-1&&a.splice(l,1)}else a[0]===t&&L(this,Lr).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=yd(t);if(typeof n=="string"){const a=L(this,Lr).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=yd(t);if(typeof n=="string"){const l=(a=L(this,Lr).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(){Bt.batch(()=>{L(this,Ca).forEach(t=>{this.notify({type:"removed",mutation:t})}),L(this,Ca).clear(),L(this,Lr).clear()})}getAll(){return Array.from(L(this,Ca))}find(t){const n={exact:!0,...t};return this.getAll().find(a=>o1(n,a))}findAll(t={}){return this.getAll().filter(n=>o1(t,n))}notify(t){Bt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Bt.batch(()=>Promise.all(t.map(n=>n.continue().catch(_n))))}},Ca=new WeakMap,Lr=new WeakMap,Iu=new WeakMap,PS);function yd(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Ea,bi,Vn,Na,Ta,Id,rg,BS,dT=(BS=class extends Sl{constructor(n,a){super();je(this,Ta);je(this,Ea);je(this,bi);je(this,Vn);je(this,Na);ve(this,Ea,n),this.setOptions(a),this.bindMethods(),Me(this,Ta,Id).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=L(this,Ea).defaultMutationOptions(n),ku(this.options,a)||L(this,Ea).getMutationCache().notify({type:"observerOptionsUpdated",mutation:L(this,Vn),observer:this}),a!=null&&a.mutationKey&&this.options.mutationKey&&pl(a.mutationKey)!==pl(this.options.mutationKey)?this.reset():((l=L(this,Vn))==null?void 0:l.state.status)==="pending"&&L(this,Vn).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=L(this,Vn))==null||n.removeObserver(this)}onMutationUpdate(n){Me(this,Ta,Id).call(this),Me(this,Ta,rg).call(this,n)}getCurrentResult(){return L(this,bi)}reset(){var n;(n=L(this,Vn))==null||n.removeObserver(this),ve(this,Vn,void 0),Me(this,Ta,Id).call(this),Me(this,Ta,rg).call(this)}mutate(n,a){var l;return ve(this,Na,a),(l=L(this,Vn))==null||l.removeObserver(this),ve(this,Vn,L(this,Ea).getMutationCache().build(L(this,Ea),this.options)),L(this,Vn).addObserver(this),L(this,Vn).execute(n)}},Ea=new WeakMap,bi=new WeakMap,Vn=new WeakMap,Na=new WeakMap,Ta=new WeakSet,Id=function(){var a;const n=((a=L(this,Vn))==null?void 0:a.state)??WS();ve(this,bi,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},rg=function(n){Bt.batch(()=>{var a,l,o,c,f,m,h,y;if(L(this,Na)&&this.hasListeners()){const g=L(this,bi).variables,b=L(this,bi).context,w={client:L(this,Ea),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(l=(a=L(this,Na)).onSuccess)==null||l.call(a,n.data,g,b,w)}catch(k){Promise.reject(k)}try{(c=(o=L(this,Na)).onSettled)==null||c.call(o,n.data,null,g,b,w)}catch(k){Promise.reject(k)}}else if((n==null?void 0:n.type)==="error"){try{(m=(f=L(this,Na)).onError)==null||m.call(f,n.error,g,b,w)}catch(k){Promise.reject(k)}try{(y=(h=L(this,Na)).onSettled)==null||y.call(h,void 0,n.error,g,b,w)}catch(k){Promise.reject(k)}}}this.listeners.forEach(g=>{g(L(this,bi))})})},BS);function y1(e,t){const n=new Set(t);return e.filter(a=>!n.has(a))}function fT(e,t,n){const a=e.slice(0);return a[t]=n,a}var Is,lr,Us,Ps,jr,xi,Uu,Pu,Bu,$u,kn,ag,ig,lg,sg,og,$S,hT=($S=class extends Sl{constructor(t,n,a){super();je(this,kn);je(this,Is);je(this,lr);je(this,Us);je(this,Ps);je(this,jr);je(this,xi);je(this,Uu);je(this,Pu);je(this,Bu);je(this,$u,[]);ve(this,Is,t),ve(this,Ps,a),ve(this,Us,[]),ve(this,jr,[]),ve(this,lr,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&L(this,jr).forEach(t=>{t.subscribe(n=>{Me(this,kn,sg).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,L(this,jr).forEach(t=>{t.destroy()})}setQueries(t,n){ve(this,Us,t),ve(this,Ps,n),Bt.batch(()=>{const a=L(this,jr),l=Me(this,kn,lg).call(this,L(this,Us));l.forEach(g=>g.observer.setOptions(g.defaultedQueryOptions));const o=l.map(g=>g.observer),c=o.map(g=>g.getCurrentResult()),f=a.length!==o.length,m=o.some((g,b)=>g!==a[b]),h=f||m,y=h?!0:c.some((g,b)=>{const w=L(this,lr)[b];return!w||!ku(g,w)});!h&&!y||(h&&(ve(this,$u,l),ve(this,jr,o)),ve(this,lr,c),this.hasListeners()&&(h&&(y1(a,o).forEach(g=>{g.destroy()}),y1(o,a).forEach(g=>{g.subscribe(b=>{Me(this,kn,sg).call(this,g,b)})})),Me(this,kn,og).call(this)))})}getCurrentResult(){return L(this,lr)}getQueries(){return L(this,jr).map(t=>t.getCurrentQuery())}getObservers(){return L(this,jr)}getOptimisticResult(t,n){const a=Me(this,kn,lg).call(this,t),l=a.map(c=>c.observer.getOptimisticResult(c.defaultedQueryOptions)),o=a.map(c=>c.defaultedQueryOptions.queryHash);return[l,c=>Me(this,kn,ig).call(this,c??l,n,o),()=>Me(this,kn,ag).call(this,l,a)]}},Is=new WeakMap,lr=new WeakMap,Us=new WeakMap,Ps=new WeakMap,jr=new WeakMap,xi=new WeakMap,Uu=new WeakMap,Pu=new WeakMap,Bu=new WeakMap,$u=new WeakMap,kn=new WeakSet,ag=function(t,n){return n.map((a,l)=>{const o=t[l];return a.defaultedQueryOptions.notifyOnChangeProps?o:a.observer.trackResult(o,c=>{n.forEach(f=>{f.observer.trackProp(c)})})})},ig=function(t,n,a){if(n){const l=L(this,Bu),o=a!==void 0&&l!==void 0&&(l.length!==a.length||a.some((c,f)=>c!==l[f]));return(!L(this,xi)||L(this,lr)!==L(this,Pu)||o||n!==L(this,Uu))&&(ve(this,Uu,n),ve(this,Pu,L(this,lr)),a!==void 0&&ve(this,Bu,a),ve(this,xi,Kg(L(this,xi),n(t)))),L(this,xi)}return t},lg=function(t){const n=new Map;L(this,jr).forEach(l=>{const o=l.options.queryHash;if(!o)return;const c=n.get(o);c?c.push(l):n.set(o,[l])});const a=[];return t.forEach(l=>{var m;const o=L(this,Is).defaultQueryOptions(l),f=((m=n.get(o.queryHash))==null?void 0:m.shift())??new Jg(L(this,Is),o);a.push({defaultedQueryOptions:o,observer:f})}),a},sg=function(t,n){const a=L(this,jr).indexOf(t);a!==-1&&(ve(this,lr,fT(L(this,lr),a,n)),Me(this,kn,og).call(this))},og=function(){var t;if(this.hasListeners()){const n=L(this,xi),a=Me(this,kn,ag).call(this,L(this,lr),L(this,$u)),l=Me(this,kn,ig).call(this,a,(t=L(this,Ps))==null?void 0:t.combine);n!==l&&Bt.batch(()=>{this.listeners.forEach(o=>{o(L(this,lr))})})}},$S),Qr,FS,mT=(FS=class extends Sl{constructor(t={}){super();je(this,Qr);this.config=t,ve(this,Qr,new Map)}build(t,n,a){const l=n.queryKey,o=n.queryHash??Gg(l,n);let c=this.get(o);return c||(c=new iT({client:t,queryKey:l,queryHash:o,options:t.defaultQueryOptions(n),state:a,defaultOptions:t.getQueryDefaults(l)}),this.add(c)),c}add(t){L(this,Qr).has(t.queryHash)||(L(this,Qr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=L(this,Qr).get(t.queryHash);n&&(t.destroy(),n===t&&L(this,Qr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Bt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return L(this,Qr).get(t)}getAll(){return[...L(this,Qr).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(a=>s1(n,a))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(a=>s1(t,a)):n}notify(t){Bt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Bt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Bt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Qr=new WeakMap,FS),Pt,wi,Si,Bs,$s,ki,Fs,qs,qS,pT=(qS=class{constructor(e={}){je(this,Pt);je(this,wi);je(this,Si);je(this,Bs);je(this,$s);je(this,ki);je(this,Fs);je(this,qs);ve(this,Pt,e.queryCache||new mT),ve(this,wi,e.mutationCache||new cT),ve(this,Si,e.defaultOptions||{}),ve(this,Bs,new Map),ve(this,$s,new Map),ve(this,ki,0)}mount(){gd(this,ki)._++,L(this,ki)===1&&(ve(this,Fs,Qg.subscribe(async e=>{e&&(await this.resumePausedMutations(),L(this,Pt).onFocus())})),ve(this,qs,Vd.subscribe(async e=>{e&&(await this.resumePausedMutations(),L(this,Pt).onOnline())})))}unmount(){var e,t;gd(this,ki)._--,L(this,ki)===0&&((e=L(this,Fs))==null||e.call(this),ve(this,Fs,void 0),(t=L(this,qs))==null||t.call(this),ve(this,qs,void 0))}isFetching(e){return L(this,Pt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return L(this,wi).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=L(this,Pt).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=L(this,Pt).build(this,t),a=n.state.data;return a===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Ci(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(a))}getQueriesData(e){return L(this,Pt).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=L(this,Pt).get(a.queryHash),o=l==null?void 0:l.state.data,c=K2(t,o);if(c!==void 0)return L(this,Pt).build(this,a).setData(c,{...n,manual:!0})}setQueriesData(e,t,n){return Bt.batch(()=>L(this,Pt).findAll(e).map(({queryKey:a})=>[a,this.setQueryData(a,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=L(this,Pt).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=L(this,Pt);Bt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=L(this,Pt);return Bt.batch(()=>(n.findAll(e).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},a=Bt.batch(()=>L(this,Pt).findAll(e).map(l=>l.cancel(n)));return Promise.all(a).then(_n).catch(_n)}invalidateQueries(e,t={}){return Bt.batch(()=>(L(this,Pt).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=Bt.batch(()=>L(this,Pt).findAll(e).filter(l=>!l.isDisabled()&&!l.isStatic()).map(l=>{let o=l.fetch(void 0,n);return n.throwOnError||(o=o.catch(_n)),l.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(a).then(_n)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=L(this,Pt).build(this,t);return n.isStaleByTime(Ci(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(_n).catch(_n)}fetchInfiniteQuery(e){return e.behavior=p1(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(_n).catch(_n)}ensureInfiniteQueryData(e){return e.behavior=p1(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Vd.isOnline()?L(this,wi).resumePausedMutations():Promise.resolve()}getQueryCache(){return L(this,Pt)}getMutationCache(){return L(this,wi)}getDefaultOptions(){return L(this,Si)}setDefaultOptions(e){ve(this,Si,e)}setQueryDefaults(e,t){L(this,Bs).set(pl(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...L(this,Bs).values()],n={};return t.forEach(a=>{Su(e,a.queryKey)&&Object.assign(n,a.defaultOptions)}),n}setMutationDefaults(e,t){L(this,$s).set(pl(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...L(this,$s).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={...L(this,Si).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Gg(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===Yg&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...L(this,Si).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){L(this,Pt).clear(),L(this,wi).clear()}},Pt=new WeakMap,wi=new WeakMap,Si=new WeakMap,Bs=new WeakMap,$s=new WeakMap,ki=new WeakMap,Fs=new WeakMap,qs=new WeakMap,qS),ek=x.createContext(void 0),jn=e=>{const t=x.useContext(ek);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},gT=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),u.jsx(ek.Provider,{value:e,children:t})),tk=x.createContext(!1),nk=()=>x.useContext(tk);tk.Provider;function yT(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var vT=x.createContext(yT()),rk=()=>x.useContext(vT),ak=(e,t,n)=>{const a=n!=null&&n.state.error&&typeof e.throwOnError=="function"?Xg(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||a)&&(t.isReset()||(e.retryOnMount=!1))},ik=e=>{x.useEffect(()=>{e.clearReset()},[e])},lk=({result:e,errorResetBoundary:t,throwOnError:n,query:a,suspense:l})=>e.isError&&!t.isReset()&&!e.isFetching&&a&&(l&&e.data===void 0||Xg(n,[e.error,a])),sk=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))}},bT=(e,t)=>e.isLoading&&e.isFetching&&!t,ug=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,cg=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function xT({queries:e,...t},n){const a=jn(),l=nk(),o=rk(),c=x.useMemo(()=>e.map(j=>{const E=a.defaultQueryOptions(j);return E._optimisticResults=l?"isRestoring":"optimistic",E}),[e,a,l]);c.forEach(j=>{sk(j);const E=a.getQueryCache().get(j.queryHash);ak(j,o,E)}),ik(o);const[f]=x.useState(()=>new hT(a,c,t)),[m,h,y]=f.getOptimisticResult(c,t.combine),g=!l&&t.subscribed!==!1;x.useSyncExternalStore(x.useCallback(j=>g?f.subscribe(Bt.batchCalls(j)):_n,[f,g]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),x.useEffect(()=>{f.setQueries(c,t)},[c,t,f]);const w=m.some((j,E)=>ug(c[E],j))?m.flatMap((j,E)=>{const C=c[E];if(C&&ug(C,j)){const N=new Jg(a,C);return cg(C,N,o)}return[]}):[];if(w.length>0)throw Promise.all(w);const k=m.find((j,E)=>{const C=c[E];return C&&lk({result:j,errorResetBoundary:o,throwOnError:C.throwOnError,query:a.getQueryCache().get(C.queryHash),suspense:C.suspense})});if(k!=null&&k.error)throw k.error;return h(y())}function wT(e,t,n){var b,w,k,j;const a=nk(),l=rk(),o=jn(),c=o.defaultQueryOptions(e);(w=(b=o.getDefaultOptions().queries)==null?void 0:b._experimental_beforeQuery)==null||w.call(b,c);const f=o.getQueryCache().get(c.queryHash);c._optimisticResults=a?"isRestoring":"optimistic",sk(c),ak(c,l,f),ik(l);const m=!o.getQueryCache().get(c.queryHash),[h]=x.useState(()=>new t(o,c)),y=h.getOptimisticResult(c),g=!a&&e.subscribed!==!1;if(x.useSyncExternalStore(x.useCallback(E=>{const C=g?h.subscribe(Bt.batchCalls(E)):_n;return h.updateResult(),C},[h,g]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),x.useEffect(()=>{h.setOptions(c)},[c,h]),ug(c,y))throw cg(c,h,l);if(lk({result:y,errorResetBoundary:l,throwOnError:c.throwOnError,query:f,suspense:c.suspense}))throw y.error;if((j=(k=o.getDefaultOptions().queries)==null?void 0:k._experimental_afterQuery)==null||j.call(k,c,y),c.experimental_prefetchInRender&&!ju.isServer()&&bT(y,a)){const E=m?cg(c,h,l):f==null?void 0:f.promise;E==null||E.catch(_n).finally(()=>{h.updateResult()})}return c.notifyOnChangeProps?y:h.trackResult(y)}function He(e,t){return wT(e,Jg)}function wt(e,t){const n=jn(),[a]=x.useState(()=>new dT(n,e));x.useEffect(()=>{a.setOptions(e)},[a,e]);const l=x.useSyncExternalStore(x.useCallback(c=>a.subscribe(Bt.batchCalls(c)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),o=x.useCallback((c,f)=>{a.mutate(c,f).catch(_n)},[a]);if(l.error&&Xg(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 v1="popstate";function b1(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function ST(e={}){function t(a,l){var h;let o=(h=l.state)==null?void 0:h.masked,{pathname:c,search:f,hash:m}=o||a.location;return dg("",{pathname:c,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:Cu(l)}return jT(t,n,null,e)}function At(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Nr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function kT(){return Math.random().toString(36).substring(2,10)}function x1(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 dg(e,t,n=null,a,l){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Xs(t):t,state:n,key:t&&t.key||a||kT(),unstable_mask:l}}function Cu({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 Xs(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 jT(e,t,n,a={}){let{window:l=document.defaultView,v5Compat:o=!1}=a,c=l.history,f="POP",m=null,h=y();h==null&&(h=0,c.replaceState({...c.state,idx:h},""));function y(){return(c.state||{idx:null}).idx}function g(){f="POP";let E=y(),C=E==null?null:E-h;h=E,m&&m({action:f,location:j.location,delta:C})}function b(E,C){f="PUSH";let N=b1(E)?E:dg(j.location,E,C);h=y()+1;let z=x1(N,h),U=j.createHref(N.unstable_mask||N);try{c.pushState(z,"",U)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;l.location.assign(U)}o&&m&&m({action:f,location:j.location,delta:1})}function w(E,C){f="REPLACE";let N=b1(E)?E:dg(j.location,E,C);h=y();let z=x1(N,h),U=j.createHref(N.unstable_mask||N);c.replaceState(z,"",U),o&&m&&m({action:f,location:j.location,delta:0})}function k(E){return CT(E)}let j={get action(){return f},get location(){return e(l,c)},listen(E){if(m)throw new Error("A history only accepts one active listener");return l.addEventListener(v1,g),m=E,()=>{l.removeEventListener(v1,g),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:w,go(E){return c.go(E)}};return j}function CT(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:Cu(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=n+a),new URL(a,n)}function ok(e,t,n="/"){return ET(e,t,n,!1)}function ET(e,t,n,a){let l=typeof t=="string"?Xs(t):t,o=Aa(l.pathname||"/",n);if(o==null)return null;let c=uk(e);NT(c);let f=null;for(let m=0;f==null&&m<c.length;++m){let h=UT(o);f=LT(c[m],h,a)}return f}function uk(e,t=[],n=[],a="",l=!1){let o=(c,f,m=l,h)=>{let y={relativePath:h===void 0?c.path||"":h,caseSensitive:c.caseSensitive===!0,childrenIndex:f,route:c};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(a)&&m)return;At(y.relativePath.startsWith(a),`Absolute route path "${y.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(a.length)}let g=Yr([a,y.relativePath]),b=n.concat(y);c.children&&c.children.length>0&&(At(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),uk(c.children,t,b,g,m)),!(c.path==null&&!c.index)&&t.push({path:g,score:DT(g,c.index),routesMeta:b})};return e.forEach((c,f)=>{var m;if(c.path===""||!((m=c.path)!=null&&m.includes("?")))o(c,f);else for(let h of ck(c.path))o(c,f,!0,h)}),t}function ck(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 c=ck(a.join("/")),f=[];return f.push(...c.map(m=>m===""?o:[o,m].join("/"))),l&&f.push(...c),f.map(m=>e.startsWith("/")&&m===""?"/":m)}function NT(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:MT(t.routesMeta.map(a=>a.childrenIndex),n.routesMeta.map(a=>a.childrenIndex)))}var _T=/^:[\w-]+$/,TT=3,AT=2,RT=1,zT=10,OT=-2,w1=e=>e==="*";function DT(e,t){let n=e.split("/"),a=n.length;return n.some(w1)&&(a+=OT),t&&(a+=AT),n.filter(l=>!w1(l)).reduce((l,o)=>l+(_T.test(o)?TT:o===""?RT:zT),a)}function MT(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 LT(e,t,n=!1){let{routesMeta:a}=e,l={},o="/",c=[];for(let f=0;f<a.length;++f){let m=a[f],h=f===a.length-1,y=o==="/"?t:t.slice(o.length)||"/",g=Qd({path:m.relativePath,caseSensitive:m.caseSensitive,end:h},y),b=m.route;if(!g&&h&&n&&!a[a.length-1].route.index&&(g=Qd({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},y)),!g)return null;Object.assign(l,g.params),c.push({params:l,pathname:Yr([o,g.pathname]),pathnameBase:FT(Yr([o,g.pathnameBase])),route:b}),g.pathnameBase!=="/"&&(o=Yr([o,g.pathnameBase]))}return c}function Qd(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,a]=IT(e.path,e.caseSensitive,e.end),l=t.match(n);if(!l)return null;let o=l[0],c=o.replace(/(.)\/+$/,"$1"),f=l.slice(1);return{params:a.reduce((h,{paramName:y,isOptional:g},b)=>{if(y==="*"){let k=f[b]||"";c=o.slice(0,o.length-k.length).replace(/(.)\/+$/,"$1")}const w=f[b];return g&&!w?h[y]=void 0:h[y]=(w||"").replace(/%2F/g,"/"),h},{}),pathname:o,pathnameBase:c,pattern:e}}function IT(e,t=!1,n=!0){Nr(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,(c,f,m,h,y)=>{if(a.push({paramName:f,isOptional:m!=null}),m){let g=y.charAt(h+c.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}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 UT(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Nr(!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 Aa(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 PT=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function BT(e,t="/"){let{pathname:n,search:a="",hash:l=""}=typeof e=="string"?Xs(e):e,o;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?o=S1(n.substring(1),"/"):o=S1(n,t)):o=t,{pathname:o,search:qT(a),hash:HT(l)}}function S1(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 rp(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 $T(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function ey(e){let t=$T(e);return t.map((n,a)=>a===t.length-1?n.pathname:n.pathnameBase)}function ff(e,t,n,a=!1){let l;typeof e=="string"?l=Xs(e):(l={...e},At(!l.pathname||!l.pathname.includes("?"),rp("?","pathname","search",l)),At(!l.pathname||!l.pathname.includes("#"),rp("#","pathname","hash",l)),At(!l.search||!l.search.includes("#"),rp("#","search","hash",l)));let o=e===""||l.pathname==="",c=o?"/":l.pathname,f;if(c==null)f=n;else{let g=t.length-1;if(!a&&c.startsWith("..")){let b=c.split("/");for(;b[0]==="..";)b.shift(),g-=1;l.pathname=b.join("/")}f=g>=0?t[g]:"/"}let m=BT(l,f),h=c&&c!=="/"&&c.endsWith("/"),y=(o||c===".")&&n.endsWith("/");return!m.pathname.endsWith("/")&&(h||y)&&(m.pathname+="/"),m}var Yr=e=>e.join("/").replace(/\/\/+/g,"/"),FT=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),qT=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,HT=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,ZT=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 VT(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function QT(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var dk=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function fk(e,t){let n=e;if(typeof n!="string"||!PT.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let a=n,l=!1;if(dk)try{let o=new URL(window.location.href),c=n.startsWith("//")?new URL(o.protocol+n):new URL(n),f=Aa(c.pathname,t);c.origin===o.origin&&f!=null?n=f+c.search+c.hash:l=!0}catch{Nr(!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 hk=["POST","PUT","PATCH","DELETE"];new Set(hk);var GT=["GET",...hk];new Set(GT);var Js=x.createContext(null);Js.displayName="DataRouter";var hf=x.createContext(null);hf.displayName="DataRouterState";var KT=x.createContext(!1),mk=x.createContext({isTransitioning:!1});mk.displayName="ViewTransition";var YT=x.createContext(new Map);YT.displayName="Fetchers";var XT=x.createContext(null);XT.displayName="Await";var dr=x.createContext(null);dr.displayName="Navigation";var Fu=x.createContext(null);Fu.displayName="Location";var _r=x.createContext({outlet:null,matches:[],isDataRoute:!1});_r.displayName="Route";var ty=x.createContext(null);ty.displayName="RouteError";var pk="REACT_ROUTER_ERROR",JT="REDIRECT",WT="ROUTE_ERROR_RESPONSE";function eA(e){if(e.startsWith(`${pk}:${JT}:{`))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 tA(e){if(e.startsWith(`${pk}:${WT}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new ZT(t.status,t.statusText,t.data)}catch{}}function nA(e,{relative:t}={}){At(Ws(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:a}=x.useContext(dr),{hash:l,pathname:o,search:c}=qu(e,{relative:t}),f=o;return n!=="/"&&(f=o==="/"?n:Yr([n,o])),a.createHref({pathname:f,search:c,hash:l})}function Ws(){return x.useContext(Fu)!=null}function Mn(){return At(Ws(),"useLocation() may be used only in the context of a <Router> component."),x.useContext(Fu).location}var gk="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function yk(e){x.useContext(dr).static||x.useLayoutEffect(e)}function dn(){let{isDataRoute:e}=x.useContext(_r);return e?yA():rA()}function rA(){At(Ws(),"useNavigate() may be used only in the context of a <Router> component.");let e=x.useContext(Js),{basename:t,navigator:n}=x.useContext(dr),{matches:a}=x.useContext(_r),{pathname:l}=Mn(),o=JSON.stringify(ey(a)),c=x.useRef(!1);return yk(()=>{c.current=!0}),x.useCallback((m,h={})=>{if(Nr(c.current,gk),!c.current)return;if(typeof m=="number"){n.go(m);return}let y=ff(m,JSON.parse(o),l,h.relative==="path");e==null&&t!=="/"&&(y.pathname=y.pathname==="/"?t:Yr([t,y.pathname])),(h.replace?n.replace:n.push)(y,h.state,h)},[t,n,o,l,e])}var aA=x.createContext(null);function iA(e){let t=x.useContext(_r).outlet;return x.useMemo(()=>t&&x.createElement(aA.Provider,{value:e},t),[t,e])}function vk(){let{matches:e}=x.useContext(_r),t=e[e.length-1];return t?t.params:{}}function qu(e,{relative:t}={}){let{matches:n}=x.useContext(_r),{pathname:a}=Mn(),l=JSON.stringify(ey(n));return x.useMemo(()=>ff(e,JSON.parse(l),a,t==="path"),[e,l,a,t])}function lA(e,t){return bk(e,t)}function bk(e,t,n){var E;At(Ws(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=x.useContext(dr),{matches:l}=x.useContext(_r),o=l[l.length-1],c=o?o.params:{},f=o?o.pathname:"/",m=o?o.pathnameBase:"/",h=o&&o.route;{let C=h&&h.path||"";wk(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 y=Mn(),g;if(t){let C=typeof t=="string"?Xs(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.`),g=C}else g=y;let b=g.pathname||"/",w=b;if(m!=="/"){let C=m.replace(/^\//,"").split("/");w="/"+b.replace(/^\//,"").split("/").slice(C.length).join("/")}let k=ok(e,{pathname:w});Nr(h||k!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),Nr(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 "${g.pathname}${g.search}${g.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=dA(k&&k.map(C=>Object.assign({},C,{params:Object.assign({},c,C.params),pathname:Yr([m,a.encodeLocation?a.encodeLocation(C.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?m:Yr([m,a.encodeLocation?a.encodeLocation(C.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathnameBase])})),l,n);return t&&j?x.createElement(Fu.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...g},navigationType:"POP"}},j):j}function sA(){let e=gA(),t=VT(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},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=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,c)}var oA=x.createElement(sA,null),xk=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=tA(e.digest);n&&(e=n)}let t=e!==void 0?x.createElement(_r.Provider,{value:this.props.routeContext},x.createElement(ty.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?x.createElement(uA,{error:e},t):t}};xk.contextType=KT;var ap=new WeakMap;function uA({children:e,error:t}){let{basename:n}=x.useContext(dr);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=eA(t.digest);if(a){let l=ap.get(t);if(l)throw l;let o=fk(a.location,n);if(dk&&!ap.get(t))if(o.isExternal||a.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const c=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:a.replace}));throw ap.set(t,c),c}return x.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function cA({routeContext:e,match:t,children:n}){let a=x.useContext(Js);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),x.createElement(_r.Provider,{value:e},n)}function dA(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 y=l.findIndex(g=>g.route.id&&(o==null?void 0:o[g.route.id])!==void 0);At(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),l=l.slice(0,Math.min(l.length,y+1))}let c=!1,f=-1;if(n&&a){c=a.renderFallback;for(let y=0;y<l.length;y++){let g=l[y];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(f=y),g.route.id){let{loaderData:b,errors:w}=a,k=g.route.loader&&!b.hasOwnProperty(g.route.id)&&(!w||w[g.route.id]===void 0);if(g.route.lazy||k){n.isStatic&&(c=!0),f>=0?l=l.slice(0,f+1):l=[l[0]];break}}}}let m=n==null?void 0:n.onError,h=a&&m?(y,g)=>{var b,w;m(y,{location:a.location,params:((w=(b=a.matches)==null?void 0:b[0])==null?void 0:w.params)??{},unstable_pattern:QT(a.matches),errorInfo:g})}:void 0;return l.reduceRight((y,g,b)=>{let w,k=!1,j=null,E=null;a&&(w=o&&g.route.id?o[g.route.id]:void 0,j=g.route.errorElement||oA,c&&(f<0&&b===0?(wk("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),k=!0,E=null):f===b&&(k=!0,E=g.route.hydrateFallbackElement||null)));let C=t.concat(l.slice(0,b+1)),N=()=>{let z;return w?z=j:k?z=E:g.route.Component?z=x.createElement(g.route.Component,null):g.route.element?z=g.route.element:z=y,x.createElement(cA,{match:g,routeContext:{outlet:y,matches:C,isDataRoute:a!=null},children:z})};return a&&(g.route.ErrorBoundary||g.route.errorElement||b===0)?x.createElement(xk,{location:a.location,revalidation:a.revalidation,component:j,error:w,children:N(),routeContext:{outlet:null,matches:C,isDataRoute:!0},onError:h}):N()},null)}function ny(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function fA(e){let t=x.useContext(Js);return At(t,ny(e)),t}function hA(e){let t=x.useContext(hf);return At(t,ny(e)),t}function mA(e){let t=x.useContext(_r);return At(t,ny(e)),t}function ry(e){let t=mA(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 pA(){return ry("useRouteId")}function gA(){var a;let e=x.useContext(ty),t=hA("useRouteError"),n=ry("useRouteError");return e!==void 0?e:(a=t.errors)==null?void 0:a[n]}function yA(){let{router:e}=fA("useNavigate"),t=ry("useNavigate"),n=x.useRef(!1);return yk(()=>{n.current=!0}),x.useCallback(async(l,o={})=>{Nr(n.current,gk),n.current&&(typeof l=="number"?await e.navigate(l):await e.navigate(l,{fromRouteId:t,...o}))},[e,t])}var k1={};function wk(e,t,n){!t&&!k1[e]&&(k1[e]=!0,Nr(!1,n))}x.memo(vA);function vA({routes:e,future:t,state:n,isStatic:a,onError:l}){return bk(e,void 0,{state:n,isStatic:a,onError:l})}function mf({to:e,replace:t,state:n,relative:a}){At(Ws(),"<Navigate> may be used only in the context of a <Router> component.");let{static:l}=x.useContext(dr);Nr(!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(_r),{pathname:c}=Mn(),f=dn(),m=ff(e,ey(o),c,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 fg(e){return iA(e.context)}function ar(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 bA({basename:e="/",children:t=null,location:n,navigationType:a="POP",navigator:l,static:o=!1,unstable_useTransitions:c}){At(!Ws(),"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:c,future:{}}),[f,l,o,c]);typeof n=="string"&&(n=Xs(n));let{pathname:h="/",search:y="",hash:g="",state:b=null,key:w="default",unstable_mask:k}=n,j=x.useMemo(()=>{let E=Aa(h,f);return E==null?null:{location:{pathname:E,search:y,hash:g,state:b,key:w,unstable_mask:k},navigationType:a}},[f,h,y,g,b,w,a,k]);return Nr(j!=null,`<Router basename="${f}"> is not able to match the URL "${h}${y}${g}" because it does not start with the basename, so the <Router> won't render anything.`),j==null?null:x.createElement(dr.Provider,{value:m},x.createElement(Fu.Provider,{children:t,value:j}))}function xA({children:e,location:t}){return lA(hg(e),t)}function hg(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,hg(a.props.children,o));return}At(a.type===ar,`[${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 c={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&&(c.children=hg(a.props.children,o)),n.push(c)}),n}var Ud="get",Pd="application/x-www-form-urlencoded";function pf(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function wA(e){return pf(e)&&e.tagName.toLowerCase()==="button"}function SA(e){return pf(e)&&e.tagName.toLowerCase()==="form"}function kA(e){return pf(e)&&e.tagName.toLowerCase()==="input"}function jA(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function CA(e,t){return e.button===0&&(!t||t==="_self")&&!jA(e)}function mg(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 EA(e,t){let n=mg(e);return t&&t.forEach((a,l)=>{n.has(l)||t.getAll(l).forEach(o=>{n.append(l,o)})}),n}var vd=null;function NA(){if(vd===null)try{new FormData(document.createElement("form"),0),vd=!1}catch{vd=!0}return vd}var _A=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function ip(e){return e!=null&&!_A.has(e)?(Nr(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Pd}"`),null):e}function TA(e,t){let n,a,l,o,c;if(SA(e)){let f=e.getAttribute("action");a=f?Aa(f,t):null,n=e.getAttribute("method")||Ud,l=ip(e.getAttribute("enctype"))||Pd,o=new FormData(e)}else if(wA(e)||kA(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?Aa(m,t):null,n=e.getAttribute("formmethod")||f.getAttribute("method")||Ud,l=ip(e.getAttribute("formenctype"))||ip(f.getAttribute("enctype"))||Pd,o=new FormData(f,e),!NA()){let{name:h,type:y,value:g}=e;if(y==="image"){let b=h?`${h}.`:"";o.append(`${b}x`,"0"),o.append(`${b}y`,"0")}else h&&o.append(h,g)}}else{if(pf(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Ud,a=null,l=Pd,c=e}return o&&l==="text/plain"&&(c=o,o=void 0),{action:a,method:n.toLowerCase(),encType:l,formData:o,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function ay(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function AA(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&&Aa(l.pathname,t)==="/"?l.pathname=`${t.replace(/\/$/,"")}/_root.${a}`:l.pathname=`${l.pathname.replace(/\/$/,"")}.${a}`,l}async function RA(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 zA(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 OA(e,t,n){let a=await Promise.all(e.map(async l=>{let o=t.routes[l.route.id];if(o){let c=await RA(o,n);return c.links?c.links():[]}return[]}));return IA(a.flat(1).filter(zA).filter(l=>l.rel==="stylesheet"||l.rel==="preload").map(l=>l.rel==="stylesheet"?{...l,rel:"prefetch",as:"style"}:{...l,rel:"prefetch"}))}function j1(e,t,n,a,l,o){let c=(m,h)=>n[h]?m.route.id!==n[h].route.id:!0,f=(m,h)=>{var y;return n[h].pathname!==m.pathname||((y=n[h].route.path)==null?void 0:y.endsWith("*"))&&n[h].params["*"]!==m.params["*"]};return o==="assets"?t.filter((m,h)=>c(m,h)||f(m,h)):o==="data"?t.filter((m,h)=>{var g;let y=a.routes[m.route.id];if(!y||!y.hasLoader)return!1;if(c(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:((g=n[0])==null?void 0:g.params)||{},nextUrl:new URL(e,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof b=="boolean")return b}return!0}):[]}function DA(e,t,{includeHydrateFallback:n}={}){return MA(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 MA(e){return[...new Set(e)]}function LA(e){let t={},n=Object.keys(e).sort();for(let a of n)t[a]=e[a];return t}function IA(e,t){let n=new Set;return new Set(t),e.reduce((a,l)=>{let o=JSON.stringify(LA(l));return n.has(o)||(n.add(o),a.push({key:o,link:l})),a},[])}function Sk(){let e=x.useContext(Js);return ay(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function UA(){let e=x.useContext(hf);return ay(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var iy=x.createContext(void 0);iy.displayName="FrameworkContext";function kk(){let e=x.useContext(iy);return ay(e,"You must render this element inside a <HydratedRouter> element"),e}function PA(e,t){let n=x.useContext(iy),[a,l]=x.useState(!1),[o,c]=x.useState(!1),{onFocus:f,onBlur:m,onMouseEnter:h,onMouseLeave:y,onTouchStart:g}=t,b=x.useRef(null);x.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let j=C=>{C.forEach(N=>{c(N.isIntersecting)})},E=new IntersectionObserver(j,{threshold:.5});return b.current&&E.observe(b.current),()=>{E.disconnect()}}},[e]),x.useEffect(()=>{if(a){let j=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(j)}}},[a]);let w=()=>{l(!0)},k=()=>{l(!1),c(!1)};return n?e!=="intent"?[o,b,{}]:[o,b,{onFocus:au(f,w),onBlur:au(m,k),onMouseEnter:au(h,w),onMouseLeave:au(y,k),onTouchStart:au(g,w)}]:[!1,b,{}]}function au(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function BA({page:e,...t}){let{router:n}=Sk(),a=x.useMemo(()=>ok(n.routes,e,n.basename),[n.routes,e,n.basename]);return a?x.createElement(FA,{page:e,matches:a,...t}):null}function $A(e){let{manifest:t,routeModules:n}=kk(),[a,l]=x.useState([]);return x.useEffect(()=>{let o=!1;return OA(e,t,n).then(c=>{o||l(c)}),()=>{o=!0}},[e,t,n]),a}function FA({page:e,matches:t,...n}){let a=Mn(),{future:l,manifest:o,routeModules:c}=kk(),{basename:f}=Sk(),{loaderData:m,matches:h}=UA(),y=x.useMemo(()=>j1(e,t,h,o,a,"data"),[e,t,h,o,a]),g=x.useMemo(()=>j1(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(N=>{var U;let z=o.routes[N.route.id];!z||!z.hasLoader||(!y.some(D=>D.route.id===N.route.id)&&N.route.id in m&&((U=c[N.route.id])!=null&&U.shouldRevalidate)||z.hasClientLoader?E=!0:j.add(N.route.id))}),j.size===0)return[];let C=AA(e,f,l.unstable_trailingSlashAwareDataRequests,"data");return E&&j.size>0&&C.searchParams.set("_routes",t.filter(N=>j.has(N.route.id)).map(N=>N.route.id).join(",")),[C.pathname+C.search]},[f,l.unstable_trailingSlashAwareDataRequests,m,a,o,y,t,e,c]),w=x.useMemo(()=>DA(g,o),[g,o]),k=$A(g);return x.createElement(x.Fragment,null,b.map(j=>x.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...n})),w.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 qA(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var HA=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{HA&&(window.__reactRouterVersion="7.13.1")}catch{}function ZA({basename:e,children:t,unstable_useTransitions:n,window:a}){let l=x.useRef();l.current==null&&(l.current=ST({window:a,v5Compat:!0}));let o=l.current,[c,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(bA,{basename:e,children:t,location:c.location,navigationType:c.action,navigator:o,unstable_useTransitions:n})}var jk=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Hu=x.forwardRef(function({onClick:t,discover:n="render",prefetch:a="none",relative:l,reloadDocument:o,replace:c,unstable_mask:f,state:m,target:h,to:y,preventScrollReset:g,viewTransition:b,unstable_defaultShouldRevalidate:w,...k},j){let{basename:E,navigator:C,unstable_useTransitions:N}=x.useContext(dr),z=typeof y=="string"&&jk.test(y),U=fk(y,E);y=U.to;let D=nA(y,{relative:l}),O=Mn(),M=null;if(f){let ne=ff(f,[],O.unstable_mask?O.unstable_mask.pathname:"/",!0);E!=="/"&&(ne.pathname=ne.pathname==="/"?E:Yr([E,ne.pathname])),M=C.createHref(ne)}let[I,X,F]=PA(a,k),W=GA(y,{replace:c,unstable_mask:f,state:m,target:h,preventScrollReset:g,relative:l,viewTransition:b,unstable_defaultShouldRevalidate:w,unstable_useTransitions:N});function ee(ne){t&&t(ne),ne.defaultPrevented||W(ne)}let ye=!(U.isExternal||o),he=x.createElement("a",{...k,...F,href:(ye?M:void 0)||U.absoluteURL||D,onClick:ye?ee:t,ref:qA(j,X),target:h,"data-discover":!z&&n==="render"?"true":void 0});return I&&!z?x.createElement(x.Fragment,null,he,x.createElement(BA,{page:D})):he});Hu.displayName="Link";var Ck=x.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:a="",end:l=!1,style:o,to:c,viewTransition:f,children:m,...h},y){let g=qu(c,{relative:h.relative}),b=Mn(),w=x.useContext(hf),{navigator:k,basename:j}=x.useContext(dr),E=w!=null&&WA(g)&&f===!0,C=k.encodeLocation?k.encodeLocation(g).pathname:g.pathname,N=b.pathname,z=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;n||(N=N.toLowerCase(),z=z?z.toLowerCase():null,C=C.toLowerCase()),z&&j&&(z=Aa(z,j)||z);const U=C!=="/"&&C.endsWith("/")?C.length-1:C.length;let D=N===C||!l&&N.startsWith(C)&&N.charAt(U)==="/",O=z!=null&&(z===C||!l&&z.startsWith(C)&&z.charAt(C.length)==="/"),M={isActive:D,isPending:O,isTransitioning:E},I=D?t:void 0,X;typeof a=="function"?X=a(M):X=[a,D?"active":null,O?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let F=typeof o=="function"?o(M):o;return x.createElement(Hu,{...h,"aria-current":I,className:X,ref:y,style:F,to:c,viewTransition:f},typeof m=="function"?m(M):m)});Ck.displayName="NavLink";var VA=x.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:a,replace:l,state:o,method:c=Ud,action:f,onSubmit:m,relative:h,preventScrollReset:y,viewTransition:g,unstable_defaultShouldRevalidate:b,...w},k)=>{let{unstable_useTransitions:j}=x.useContext(dr),E=XA(),C=JA(f,{relative:h}),N=c.toLowerCase()==="get"?"get":"post",z=typeof f=="string"&&jk.test(f),U=D=>{if(m&&m(D),D.defaultPrevented)return;D.preventDefault();let O=D.nativeEvent.submitter,M=(O==null?void 0:O.getAttribute("formmethod"))||c,I=()=>E(O||D.currentTarget,{fetcherKey:t,method:M,navigate:n,replace:l,state:o,relative:h,preventScrollReset:y,viewTransition:g,unstable_defaultShouldRevalidate:b});j&&n!==!1?x.startTransition(()=>I()):I()};return x.createElement("form",{ref:k,method:N,action:C,onSubmit:a?m:U,...w,"data-discover":!z&&e==="render"?"true":void 0})});VA.displayName="Form";function QA(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ek(e){let t=x.useContext(Js);return At(t,QA(e)),t}function GA(e,{target:t,replace:n,unstable_mask:a,state:l,preventScrollReset:o,relative:c,viewTransition:f,unstable_defaultShouldRevalidate:m,unstable_useTransitions:h}={}){let y=dn(),g=Mn(),b=qu(e,{relative:c});return x.useCallback(w=>{if(CA(w,t)){w.preventDefault();let k=n!==void 0?n:Cu(g)===Cu(b),j=()=>y(e,{replace:k,unstable_mask:a,state:l,preventScrollReset:o,relative:c,viewTransition:f,unstable_defaultShouldRevalidate:m});h?x.startTransition(()=>j()):j()}},[g,y,b,n,a,l,t,e,o,c,f,m,h])}function gf(e){Nr(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(mg(e)),n=x.useRef(!1),a=Mn(),l=x.useMemo(()=>EA(a.search,n.current?null:t.current),[a.search]),o=dn(),c=x.useCallback((f,m)=>{const h=mg(typeof f=="function"?f(new URLSearchParams(l)):f);n.current=!0,o("?"+h,m)},[o,l]);return[l,c]}var KA=0,YA=()=>`__${String(++KA)}__`;function XA(){let{router:e}=Ek("useSubmit"),{basename:t}=x.useContext(dr),n=pA(),a=e.fetch,l=e.navigate;return x.useCallback(async(o,c={})=>{let{action:f,method:m,encType:h,formData:y,body:g}=TA(o,t);if(c.navigate===!1){let b=c.fetcherKey||YA();await a(b,n,c.action||f,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:y,body:g,formMethod:c.method||m,formEncType:c.encType||h,flushSync:c.flushSync})}else await l(c.action||f,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:y,body:g,formMethod:c.method||m,formEncType:c.encType||h,replace:c.replace,state:c.state,fromRouteId:n,flushSync:c.flushSync,viewTransition:c.viewTransition})},[a,l,t,n])}function JA(e,{relative:t}={}){let{basename:n}=x.useContext(dr),a=x.useContext(_r);At(a,"useFormAction must be used inside a RouteContext");let[l]=a.matches.slice(-1),o={...qu(e||".",{relative:t})},c=Mn();if(e==null){o.search=c.search;let f=new URLSearchParams(o.search),m=f.getAll("index");if(m.some(y=>y==="")){f.delete("index"),m.filter(g=>g).forEach(g=>f.append("index",g));let y=f.toString();o.search=y?`?${y}`:""}}return(!e||e===".")&&l.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:Yr([n,o.pathname])),Cu(o)}function WA(e,{relative:t}={}){let n=x.useContext(mk);At(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=Ek("useViewTransitionState"),l=qu(e,{relative:t});if(!n.isTransitioning)return!1;let o=Aa(n.currentLocation.pathname,a)||n.currentLocation.pathname,c=Aa(n.nextLocation.pathname,a)||n.nextLocation.pathname;return Qd(l.pathname,c)!=null||Qd(l.pathname,o)!=null}const eR="/api/v1";async function tR(e,t){const n=await fetch(`${eR}/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 Nk="/api/v1",ly="first-tree-hub:tokens";function sy(){const e=localStorage.getItem(ly);if(!e)return null;try{return JSON.parse(e)}catch{return null}}function pg(e){localStorage.setItem(ly,JSON.stringify(e))}function _k(){localStorage.removeItem(ly)}class Zu extends Error{constructor(t,n,a){super(n),this.status=t,this.issues=a,this.name="ApiError"}}let iu=null;async function nR(e){return iu||(iu=(async()=>{try{const t=await fetch(`${Nk}/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 pg(a),a}catch{return null}finally{iu=null}})(),iu)}async function bd(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(`${Nk}${e}`,{method:n,headers:m,body:a!==void 0?JSON.stringify(a):void 0})},o=sy();let c=await l(o==null?void 0:o.accessToken);if(c.status===401&&(o!=null&&o.refreshToken)){const f=await nR(o.refreshToken);f&&(c=await l(f.accessToken))}if(!c.ok){c.status===401&&(_k(),window.dispatchEvent(new CustomEvent("auth:logout")));const f=await c.text();let m,h;try{const y=JSON.parse(f);m=y.error??f,Array.isArray(y.details)&&(h=y.details.filter(g=>typeof g=="object"&&g!==null&&Array.isArray(g.path)))}catch{m=f}throw new Zu(c.status,m,h)}if(c.status!==204)return await c.json()}const ke={get:e=>bd(e),post:(e,t)=>bd(e,{method:"POST",body:t}),patch:(e,t)=>bd(e,{method:"PATCH",body:t}),delete:e=>bd(e,{method:"DELETE"})},oy="onboarding:joinPath",rR="onboarding:draft";function Tk(e){typeof window>"u"||window.sessionStorage.setItem(oy,e)}function aR(){if(typeof window>"u")return null;const e=window.sessionStorage.getItem(oy);return e==="solo"||e==="invite"?e:null}function iR(){typeof window>"u"||window.sessionStorage.removeItem(oy)}function lR(e,t){return`${e??"unknown-org"}:${t??"unknown-member"}`}function uy(e){return`${rR}:${e}`}function sR(e){if(!e||typeof e!="object"||!("displayName"in e)||typeof e.displayName!="string")return null;const t="selectedRuntime"in e?e.selectedRuntime:null;if(t!==null&&typeof t!="string")return null;const n="connectToken"in e?e.connectToken:null;if(n!==null&&typeof n!="string")return null;const a="connectTokenExpiresAt"in e?e.connectTokenExpiresAt:null;return a!==null&&typeof a!="number"?null:{displayName:e.displayName,selectedRuntime:t,connectToken:n,connectTokenExpiresAt:a}}function oR(e){if(typeof window>"u")return null;const t=window.sessionStorage.getItem(uy(e));if(!t)return null;try{return sR(JSON.parse(t))}catch{return null}}function uR(e,t){typeof window>"u"||window.sessionStorage.setItem(uy(e),JSON.stringify(t))}function cR(e){typeof window>"u"||window.sessionStorage.removeItem(uy(e))}const Ak=x.createContext(null);function dR({children:e}){const[t,n]=x.useState(()=>!!sy()),[a,l]=x.useState(null),[o,c]=x.useState(null),[f,m]=x.useState(null),[h,y]=x.useState(null),[g,b]=x.useState(null),[w,k]=x.useState(null),j=x.useCallback(()=>{_k(),n(!1),l(null),c(null),m(null),y(null),b(null),k(null)},[]),E=x.useCallback(async()=>{var z;try{const U=await ke.get("/me");l(U.member.role),c(U.member.id),m(U.member.agentId),y(U.member.organizationId),b(U.user??null);const D=((z=U.wizard)==null?void 0:z.step)??null;k(D),D==="completed"&&iR()}catch{}},[]),C=x.useCallback(async(z,U)=>{const D=await tR(z,U);pg({accessToken:D.accessToken,refreshToken:D.refreshToken}),n(!0),await E()},[E]),N=x.useCallback(async z=>{pg(z),n(!0),await E()},[E]);return x.useEffect(()=>{t&&!a&&E()},[t,a,E]),x.useEffect(()=>{const z=()=>j();return window.addEventListener("auth:logout",z),()=>window.removeEventListener("auth:logout",z)},[j]),u.jsx(Ak.Provider,{value:{isAuthenticated:t,role:a,memberId:o,agentId:f,organizationId:h,user:g,wizardStep:w,login:C,adoptTokens:N,refreshMe:E,logout:j},children:e})}function qt(){const e=x.useContext(Ak);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}const fR="modulepreload",hR=function(e){return"/"+e},C1={},mR=function(t,n,a){let l=Promise.resolve();if(n&&n.length>0){let c=function(h){return Promise.all(h.map(y=>Promise.resolve(y).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const f=document.querySelector("meta[property=csp-nonce]"),m=(f==null?void 0:f.nonce)||(f==null?void 0:f.getAttribute("nonce"));l=c(n.map(h=>{if(h=hR(h),h in C1)return;C1[h]=!0;const y=h.endsWith(".css"),g=y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${g}`))return;const b=document.createElement("link");if(b.rel=y?"stylesheet":fR,y||(b.as="script"),b.crossOrigin="",b.href=h,m&&b.setAttribute("nonce",m),document.head.appendChild(b),y)return new Promise((w,k)=>{b.addEventListener("load",w),b.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${h}`)))})}))}function o(c){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=c,window.dispatchEvent(f),!f.defaultPrevented)throw c}return l.then(c=>{for(const f of c||[])f.status==="rejected"&&o(f.reason);return t().catch(o)})},pR=x.lazy(()=>mR(()=>import("./index-BADzOlHO.js"),[]).then(e=>({default:e.LandingPage}))),gR=()=>u.jsx("div",{className:"landing-marketing min-h-screen bg-background"});function yR(){const{isAuthenticated:e}=qt(),t=Mn();return e?u.jsx(fg,{}):t.pathname==="/"?u.jsx(x.Suspense,{fallback:u.jsx(gR,{}),children:u.jsx(pR,{})}):u.jsx(mf,{to:"/login",replace:!0,state:{from:t}})}/**
|
|
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 Rk=(...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 vR=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 bR=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 E1=e=>{const t=bR(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 xR={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 wR=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 SR=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:l="",children:o,iconNode:c,...f},m)=>x.createElement("svg",{ref:m,...xR,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:Rk("lucide",l),...!o&&!wR(f)&&{"aria-hidden":"true"},...f},[...c.map(([h,y])=>x.createElement(h,y)),...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 ot=(e,t)=>{const n=x.forwardRef(({className:a,...l},o)=>x.createElement(SR,{ref:o,iconNode:t,className:Rk(`lucide-${vR(E1(e))}`,`lucide-${e}`,a),...l}));return n.displayName=E1(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 kR=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],cy=ot("arrow-left",kR);/**
|
|
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 jR=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],CR=ot("arrow-right",jR);/**
|
|
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 ER=[["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"}]],NR=ot("bell",ER);/**
|
|
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 _R=[["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"}]],TR=ot("bot",_R);/**
|
|
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 AR=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],cr=ot("check",AR);/**
|
|
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 RR=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],zk=ot("chevron-down",RR);/**
|
|
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 zR=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],OR=ot("chevron-right",zR);/**
|
|
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 DR=[["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"}]],yf=ot("copy",DR);/**
|
|
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 MR=[["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"}]],LR=ot("eye-off",MR);/**
|
|
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 IR=[["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"}]],UR=ot("eye",IR);/**
|
|
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 PR=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],Ok=ot("github",PR);/**
|
|
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 BR=[["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"}]],$R=ot("layout-dashboard",BR);/**
|
|
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 FR=[["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"}]],gg=ot("link-2",FR);/**
|
|
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 qR=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],HR=ot("loader-circle",qR);/**
|
|
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 ZR=[["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"}]],Dk=ot("lock",ZR);/**
|
|
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 VR=[["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"}]],QR=ot("log-out",VR);/**
|
|
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 GR=[["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"}]],dy=ot("message-square",GR);/**
|
|
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 KR=[["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"}]],YR=ot("moon",KR);/**
|
|
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 XR=[["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"}]],JR=ot("paperclip",XR);/**
|
|
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 WR=[["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"}]],ez=ot("pause",WR);/**
|
|
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 tz=[["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"}]],Vu=ot("pencil",tz);/**
|
|
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 nz=[["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"}]],Mk=ot("play",nz);/**
|
|
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 rz=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Jr=ot("plus",rz);/**
|
|
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 az=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],vf=ot("search",az);/**
|
|
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 iz=[["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"}]],lz=ot("send",iz);/**
|
|
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 sz=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],oz=ot("settings",sz);/**
|
|
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 uz=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],cz=ot("square",uz);/**
|
|
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 dz=[["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"}]],fz=ot("sun",dz);/**
|
|
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 hz=[["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"}]],Hs=ot("trash-2",hz);/**
|
|
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 mz=[["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"}]],fy=ot("triangle-alert",mz);/**
|
|
251
|
+
* @license lucide-react v0.577.0 - ISC
|
|
252
|
+
*
|
|
253
|
+
* This source code is licensed under the ISC license.
|
|
254
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
255
|
+
*/const pz=[["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"}]],gz=ot("undo-2",pz);/**
|
|
256
|
+
* @license lucide-react v0.577.0 - ISC
|
|
257
|
+
*
|
|
258
|
+
* This source code is licensed under the ISC license.
|
|
259
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
260
|
+
*/const yz=[["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"}]],vz=ot("unplug",yz);/**
|
|
261
|
+
* @license lucide-react v0.577.0 - ISC
|
|
262
|
+
*
|
|
263
|
+
* This source code is licensed under the ISC license.
|
|
264
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
265
|
+
*/const bz=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],xz=ot("user-plus",bz);/**
|
|
266
|
+
* @license lucide-react v0.577.0 - ISC
|
|
267
|
+
*
|
|
268
|
+
* This source code is licensed under the ISC license.
|
|
269
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
270
|
+
*/const wz=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Gd=ot("x",wz);/**
|
|
271
|
+
* @license lucide-react v0.577.0 - ISC
|
|
272
|
+
*
|
|
273
|
+
* This source code is licensed under the ISC license.
|
|
274
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
275
|
+
*/const Sz=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],kz=ot("zap",Sz);function Lk(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=Lk(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function Ik(){for(var e,t,n=0,a="",l=arguments.length;n<l;n++)(e=arguments[n])&&(t=Lk(e))&&(a&&(a+=" "),a+=t);return a}const jz=(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},Cz=(e,t)=>({classGroupId:e,validator:t}),Uk=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Kd="-",N1=[],Ez="arbitrary..",Nz=e=>{const t=Tz(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return _z(c);const f=c.split(Kd),m=f[0]===""&&f.length>1?1:0;return Pk(f,m,t)},getConflictingClassGroupIds:(c,f)=>{if(f){const m=a[c],h=n[c];return m?h?jz(h,m):m:h||N1}return n[c]||N1}}},Pk=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const l=e[t],o=n.nextPart.get(l);if(o){const h=Pk(e,t+1,o);if(h)return h}const c=n.validators;if(c===null)return;const f=t===0?e.join(Kd):e.slice(t).join(Kd),m=c.length;for(let h=0;h<m;h++){const y=c[h];if(y.validator(f))return y.classGroupId}},_z=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?Ez+a:void 0})(),Tz=e=>{const{theme:t,classGroups:n}=e;return Az(n,t)},Az=(e,t)=>{const n=Uk();for(const a in e){const l=e[a];hy(l,n,a,t)}return n},hy=(e,t,n,a)=>{const l=e.length;for(let o=0;o<l;o++){const c=e[o];Rz(c,t,n,a)}},Rz=(e,t,n,a)=>{if(typeof e=="string"){zz(e,t,n);return}if(typeof e=="function"){Oz(e,t,n,a);return}Dz(e,t,n,a)},zz=(e,t,n)=>{const a=e===""?t:Bk(t,e);a.classGroupId=n},Oz=(e,t,n,a)=>{if(Mz(e)){hy(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(Cz(n,e))},Dz=(e,t,n,a)=>{const l=Object.entries(e),o=l.length;for(let c=0;c<o;c++){const[f,m]=l[c];hy(m,Bk(t,f),n,a)}},Bk=(e,t)=>{let n=e;const a=t.split(Kd),l=a.length;for(let o=0;o<l;o++){const c=a[o];let f=n.nextPart.get(c);f||(f=Uk(),n.nextPart.set(c,f)),n=f}return n},Mz=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Lz=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),a=Object.create(null);const l=(o,c)=>{n[o]=c,t++,t>e&&(t=0,a=n,n=Object.create(null))};return{get(o){let c=n[o];if(c!==void 0)return c;if((c=a[o])!==void 0)return l(o,c),c},set(o,c){o in n?n[o]=c:l(o,c)}}},yg="!",_1=":",Iz=[],T1=(e,t,n,a,l)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:l}),Uz=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=l=>{const o=[];let c=0,f=0,m=0,h;const y=l.length;for(let j=0;j<y;j++){const E=l[j];if(c===0&&f===0){if(E===_1){o.push(l.slice(m,j)),m=j+1;continue}if(E==="/"){h=j;continue}}E==="["?c++:E==="]"?c--:E==="("?f++:E===")"&&f--}const g=o.length===0?l:l.slice(m);let b=g,w=!1;g.endsWith(yg)?(b=g.slice(0,-1),w=!0):g.startsWith(yg)&&(b=g.slice(1),w=!0);const k=h&&h>m?h-m:void 0;return T1(o,w,b,k)};if(t){const l=t+_1,o=a;a=c=>c.startsWith(l)?o(c.slice(l.length)):T1(Iz,!1,c,void 0,!0)}if(n){const l=a;a=o=>n({className:o,parseClassName:l})}return a},Pz=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 c=n[o],f=c[0]==="[",m=t.has(c);f||m?(l.length>0&&(l.sort(),a.push(...l),l=[]),a.push(c)):l.push(c)}return l.length>0&&(l.sort(),a.push(...l)),a}},Bz=e=>({cache:Lz(e.cacheSize),parseClassName:Uz(e),sortModifiers:Pz(e),...Nz(e)}),$z=/\s+/,Fz=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:l,sortModifiers:o}=t,c=[],f=e.trim().split($z);let m="";for(let h=f.length-1;h>=0;h-=1){const y=f[h],{isExternal:g,modifiers:b,hasImportantModifier:w,baseClassName:k,maybePostfixModifierPosition:j}=n(y);if(g){m=y+(m.length>0?" "+m:m);continue}let E=!!j,C=a(E?k.substring(0,j):k);if(!C){if(!E){m=y+(m.length>0?" "+m:m);continue}if(C=a(k),!C){m=y+(m.length>0?" "+m:m);continue}E=!1}const N=b.length===0?"":b.length===1?b[0]:o(b).join(":"),z=w?N+yg:N,U=z+C;if(c.indexOf(U)>-1)continue;c.push(U);const D=l(C,E);for(let O=0;O<D.length;++O){const M=D[O];c.push(z+M)}m=y+(m.length>0?" "+m:m)}return m},qz=(...e)=>{let t=0,n,a,l="";for(;t<e.length;)(n=e[t++])&&(a=$k(n))&&(l&&(l+=" "),l+=a);return l},$k=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=$k(e[a]))&&(n&&(n+=" "),n+=t);return n},Hz=(e,...t)=>{let n,a,l,o;const c=m=>{const h=t.reduce((y,g)=>g(y),e());return n=Bz(h),a=n.cache.get,l=n.cache.set,o=f,f(m)},f=m=>{const h=a(m);if(h)return h;const y=Fz(m,n);return l(m,y),y};return o=c,(...m)=>o(qz(...m))},Zz=[],an=e=>{const t=n=>n[e]||Zz;return t.isThemeGetter=!0,t},Fk=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,qk=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Vz=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Qz=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Gz=/\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$/,Kz=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Yz=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Xz=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,oi=e=>Vz.test(e),Ye=e=>!!e&&!Number.isNaN(Number(e)),ui=e=>!!e&&Number.isInteger(Number(e)),lp=e=>e.endsWith("%")&&Ye(e.slice(0,-1)),Sa=e=>Qz.test(e),Hk=()=>!0,Jz=e=>Gz.test(e)&&!Kz.test(e),my=()=>!1,Wz=e=>Yz.test(e),e3=e=>Xz.test(e),t3=e=>!Ne(e)&&!_e(e),n3=e=>zi(e,Qk,my),Ne=e=>Fk.test(e),rl=e=>zi(e,Gk,Jz),A1=e=>zi(e,c3,Ye),r3=e=>zi(e,Yk,Hk),a3=e=>zi(e,Kk,my),R1=e=>zi(e,Zk,my),i3=e=>zi(e,Vk,e3),xd=e=>zi(e,Xk,Wz),_e=e=>qk.test(e),lu=e=>kl(e,Gk),l3=e=>kl(e,Kk),z1=e=>kl(e,Zk),s3=e=>kl(e,Qk),o3=e=>kl(e,Vk),wd=e=>kl(e,Xk,!0),u3=e=>kl(e,Yk,!0),zi=(e,t,n)=>{const a=Fk.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},kl=(e,t,n=!1)=>{const a=qk.exec(e);return a?a[1]?t(a[1]):n:!1},Zk=e=>e==="position"||e==="percentage",Vk=e=>e==="image"||e==="url",Qk=e=>e==="length"||e==="size"||e==="bg-size",Gk=e=>e==="length",c3=e=>e==="number",Kk=e=>e==="family-name",Yk=e=>e==="number"||e==="weight",Xk=e=>e==="shadow",d3=()=>{const e=an("color"),t=an("font"),n=an("text"),a=an("font-weight"),l=an("tracking"),o=an("leading"),c=an("breakpoint"),f=an("container"),m=an("spacing"),h=an("radius"),y=an("shadow"),g=an("inset-shadow"),b=an("text-shadow"),w=an("drop-shadow"),k=an("blur"),j=an("perspective"),E=an("aspect"),C=an("ease"),N=an("animate"),z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],U=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...U(),_e,Ne],O=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto","contain","none"],I=()=>[_e,Ne,m],X=()=>[oi,"full","auto",...I()],F=()=>[ui,"none","subgrid",_e,Ne],W=()=>["auto",{span:["full",ui,_e,Ne]},ui,_e,Ne],ee=()=>[ui,"auto",_e,Ne],ye=()=>["auto","min","max","fr",_e,Ne],he=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ne=()=>["start","end","center","stretch","center-safe","end-safe"],Z=()=>["auto",...I()],te=()=>[oi,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...I()],ie=()=>[oi,"screen","full","dvw","lvw","svw","min","max","fit",...I()],ue=()=>[oi,"screen","full","lh","dvh","lvh","svh","min","max","fit",...I()],A=()=>[e,_e,Ne],P=()=>[...U(),z1,R1,{position:[_e,Ne]}],B=()=>["no-repeat",{repeat:["","x","y","space","round"]}],T=()=>["auto","cover","contain",s3,n3,{size:[_e,Ne]}],q=()=>[lp,lu,rl],K=()=>["","none","full",h,_e,Ne],ce=()=>["",Ye,lu,rl],xe=()=>["solid","dashed","dotted","double"],we=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],pe=()=>[Ye,lp,z1,R1],Xe=()=>["","none",k,_e,Ne],Le=()=>["none",Ye,_e,Ne],re=()=>["none",Ye,_e,Ne],Ee=()=>[Ye,_e,Ne],Ie=()=>[oi,"full",...I()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Sa],breakpoint:[Sa],color:[Hk],container:[Sa],"drop-shadow":[Sa],ease:["in","out","in-out"],font:[t3],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Sa],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Sa],shadow:[Sa],spacing:["px",Ye],text:[Sa],"text-shadow":[Sa],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",oi,Ne,_e,E]}],container:["container"],columns:[{columns:[Ye,Ne,_e,f]}],"break-after":[{"break-after":z()}],"break-before":[{"break-before":z()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:D()}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:X()}],"inset-x":[{"inset-x":X()}],"inset-y":[{"inset-y":X()}],start:[{"inset-s":X(),start:X()}],end:[{"inset-e":X(),end:X()}],"inset-bs":[{"inset-bs":X()}],"inset-be":[{"inset-be":X()}],top:[{top:X()}],right:[{right:X()}],bottom:[{bottom:X()}],left:[{left:X()}],visibility:["visible","invisible","collapse"],z:[{z:[ui,"auto",_e,Ne]}],basis:[{basis:[oi,"full","auto",f,...I()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ye,oi,"auto","initial","none",Ne]}],grow:[{grow:["",Ye,_e,Ne]}],shrink:[{shrink:["",Ye,_e,Ne]}],order:[{order:[ui,"first","last","none",_e,Ne]}],"grid-cols":[{"grid-cols":F()}],"col-start-end":[{col:W()}],"col-start":[{"col-start":ee()}],"col-end":[{"col-end":ee()}],"grid-rows":[{"grid-rows":F()}],"row-start-end":[{row:W()}],"row-start":[{"row-start":ee()}],"row-end":[{"row-end":ee()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ye()}],"auto-rows":[{"auto-rows":ye()}],gap:[{gap:I()}],"gap-x":[{"gap-x":I()}],"gap-y":[{"gap-y":I()}],"justify-content":[{justify:[...he(),"normal"]}],"justify-items":[{"justify-items":[...ne(),"normal"]}],"justify-self":[{"justify-self":["auto",...ne()]}],"align-content":[{content:["normal",...he()]}],"align-items":[{items:[...ne(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ne(),{baseline:["","last"]}]}],"place-content":[{"place-content":he()}],"place-items":[{"place-items":[...ne(),"baseline"]}],"place-self":[{"place-self":["auto",...ne()]}],p:[{p:I()}],px:[{px:I()}],py:[{py:I()}],ps:[{ps:I()}],pe:[{pe:I()}],pbs:[{pbs:I()}],pbe:[{pbe:I()}],pt:[{pt:I()}],pr:[{pr:I()}],pb:[{pb:I()}],pl:[{pl:I()}],m:[{m:Z()}],mx:[{mx:Z()}],my:[{my:Z()}],ms:[{ms:Z()}],me:[{me:Z()}],mbs:[{mbs:Z()}],mbe:[{mbe:Z()}],mt:[{mt:Z()}],mr:[{mr:Z()}],mb:[{mb:Z()}],ml:[{ml:Z()}],"space-x":[{"space-x":I()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":I()}],"space-y-reverse":["space-y-reverse"],size:[{size:te()}],"inline-size":[{inline:["auto",...ie()]}],"min-inline-size":[{"min-inline":["auto",...ie()]}],"max-inline-size":[{"max-inline":["none",...ie()]}],"block-size":[{block:["auto",...ue()]}],"min-block-size":[{"min-block":["auto",...ue()]}],"max-block-size":[{"max-block":["none",...ue()]}],w:[{w:[f,"screen",...te()]}],"min-w":[{"min-w":[f,"screen","none",...te()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[c]},...te()]}],h:[{h:["screen","lh",...te()]}],"min-h":[{"min-h":["screen","lh","none",...te()]}],"max-h":[{"max-h":["screen","lh",...te()]}],"font-size":[{text:["base",n,lu,rl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,u3,r3]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",lp,Ne]}],"font-family":[{font:[l3,a3,t]}],"font-features":[{"font-features":[Ne]}],"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,_e,Ne]}],"line-clamp":[{"line-clamp":[Ye,"none",_e,A1]}],leading:[{leading:[o,...I()]}],"list-image":[{"list-image":["none",_e,Ne]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",_e,Ne]}],"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:[...xe(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ye,"from-font","auto",_e,rl]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[Ye,"auto",_e,Ne]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",_e,Ne]}],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",_e,Ne]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:P()}],"bg-repeat":[{bg:B()}],"bg-size":[{bg:T()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ui,_e,Ne],radial:["",_e,Ne],conic:[ui,_e,Ne]},o3,i3]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:q()}],"gradient-via-pos":[{via:q()}],"gradient-to-pos":[{to:q()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:K()}],"rounded-s":[{"rounded-s":K()}],"rounded-e":[{"rounded-e":K()}],"rounded-t":[{"rounded-t":K()}],"rounded-r":[{"rounded-r":K()}],"rounded-b":[{"rounded-b":K()}],"rounded-l":[{"rounded-l":K()}],"rounded-ss":[{"rounded-ss":K()}],"rounded-se":[{"rounded-se":K()}],"rounded-ee":[{"rounded-ee":K()}],"rounded-es":[{"rounded-es":K()}],"rounded-tl":[{"rounded-tl":K()}],"rounded-tr":[{"rounded-tr":K()}],"rounded-br":[{"rounded-br":K()}],"rounded-bl":[{"rounded-bl":K()}],"border-w":[{border:ce()}],"border-w-x":[{"border-x":ce()}],"border-w-y":[{"border-y":ce()}],"border-w-s":[{"border-s":ce()}],"border-w-e":[{"border-e":ce()}],"border-w-bs":[{"border-bs":ce()}],"border-w-be":[{"border-be":ce()}],"border-w-t":[{"border-t":ce()}],"border-w-r":[{"border-r":ce()}],"border-w-b":[{"border-b":ce()}],"border-w-l":[{"border-l":ce()}],"divide-x":[{"divide-x":ce()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ce()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...xe(),"hidden","none"]}],"divide-style":[{divide:[...xe(),"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:[...xe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ye,_e,Ne]}],"outline-w":[{outline:["",Ye,lu,rl]}],"outline-color":[{outline:A()}],shadow:[{shadow:["","none",y,wd,xd]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":["none",g,wd,xd]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:ce()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[Ye,rl]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":ce()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":["none",b,wd,xd]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[Ye,_e,Ne]}],"mix-blend":[{"mix-blend":[...we(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":we()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ye]}],"mask-image-linear-from-pos":[{"mask-linear-from":pe()}],"mask-image-linear-to-pos":[{"mask-linear-to":pe()}],"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":pe()}],"mask-image-t-to-pos":[{"mask-t-to":pe()}],"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":pe()}],"mask-image-r-to-pos":[{"mask-r-to":pe()}],"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":pe()}],"mask-image-b-to-pos":[{"mask-b-to":pe()}],"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":pe()}],"mask-image-l-to-pos":[{"mask-l-to":pe()}],"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":pe()}],"mask-image-x-to-pos":[{"mask-x-to":pe()}],"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":pe()}],"mask-image-y-to-pos":[{"mask-y-to":pe()}],"mask-image-y-from-color":[{"mask-y-from":A()}],"mask-image-y-to-color":[{"mask-y-to":A()}],"mask-image-radial":[{"mask-radial":[_e,Ne]}],"mask-image-radial-from-pos":[{"mask-radial-from":pe()}],"mask-image-radial-to-pos":[{"mask-radial-to":pe()}],"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":U()}],"mask-image-conic-pos":[{"mask-conic":[Ye]}],"mask-image-conic-from-pos":[{"mask-conic-from":pe()}],"mask-image-conic-to-pos":[{"mask-conic-to":pe()}],"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:P()}],"mask-repeat":[{mask:B()}],"mask-size":[{mask:T()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",_e,Ne]}],filter:[{filter:["","none",_e,Ne]}],blur:[{blur:Xe()}],brightness:[{brightness:[Ye,_e,Ne]}],contrast:[{contrast:[Ye,_e,Ne]}],"drop-shadow":[{"drop-shadow":["","none",w,wd,xd]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:["",Ye,_e,Ne]}],"hue-rotate":[{"hue-rotate":[Ye,_e,Ne]}],invert:[{invert:["",Ye,_e,Ne]}],saturate:[{saturate:[Ye,_e,Ne]}],sepia:[{sepia:["",Ye,_e,Ne]}],"backdrop-filter":[{"backdrop-filter":["","none",_e,Ne]}],"backdrop-blur":[{"backdrop-blur":Xe()}],"backdrop-brightness":[{"backdrop-brightness":[Ye,_e,Ne]}],"backdrop-contrast":[{"backdrop-contrast":[Ye,_e,Ne]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ye,_e,Ne]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ye,_e,Ne]}],"backdrop-invert":[{"backdrop-invert":["",Ye,_e,Ne]}],"backdrop-opacity":[{"backdrop-opacity":[Ye,_e,Ne]}],"backdrop-saturate":[{"backdrop-saturate":[Ye,_e,Ne]}],"backdrop-sepia":[{"backdrop-sepia":["",Ye,_e,Ne]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":I()}],"border-spacing-x":[{"border-spacing-x":I()}],"border-spacing-y":[{"border-spacing-y":I()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",_e,Ne]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ye,"initial",_e,Ne]}],ease:[{ease:["linear","initial",C,_e,Ne]}],delay:[{delay:[Ye,_e,Ne]}],animate:[{animate:["none",N,_e,Ne]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[j,_e,Ne]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:Le()}],"rotate-x":[{"rotate-x":Le()}],"rotate-y":[{"rotate-y":Le()}],"rotate-z":[{"rotate-z":Le()}],scale:[{scale:re()}],"scale-x":[{"scale-x":re()}],"scale-y":[{"scale-y":re()}],"scale-z":[{"scale-z":re()}],"scale-3d":["scale-3d"],skew:[{skew:Ee()}],"skew-x":[{"skew-x":Ee()}],"skew-y":[{"skew-y":Ee()}],transform:[{transform:[_e,Ne,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ie()}],"translate-x":[{"translate-x":Ie()}],"translate-y":[{"translate-y":Ie()}],"translate-z":[{"translate-z":Ie()}],"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",_e,Ne]}],"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":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mbs":[{"scroll-mbs":I()}],"scroll-mbe":[{"scroll-mbe":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pbs":[{"scroll-pbs":I()}],"scroll-pbe":[{"scroll-pbe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"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",_e,Ne]}],fill:[{fill:["none",...A()]}],"stroke-w":[{stroke:[Ye,lu,rl,A1]}],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"]}},f3=Hz(d3);function Ae(...e){return f3(Ik(e))}function Ni(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 h3(e){return ke.delete(`/clients/${encodeURIComponent(e)}`)}function Qu(){return ke.get("/admin/agents/activity")}function Ra(){return ke.get("/clients")}function py(e){return ke.get(`/clients/${e}`)}function m3(e){return ke.post(`/clients/${e}/disconnect`)}function Jk(){return ke.post("/connect-tokens")}const Wk=(e,t)=>["session",e,t],Yd=e=>["agent-sessions",e];function p3(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 g3(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 y3(e){if(typeof e!="object"||e===null)return null;const t=e;return typeof t.text!="string"?null:{text:t.text}}function eo(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 ke.get(`/admin/sessions/agents/${e}${a?`?${a}`:""}`)}function v3(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 ke.get(`/admin/sessions/agents/${e}/${t}/events${l?`?${l}`:""}`)}function b3(e,t){return ke.post(`/admin/sessions/agents/${e}/${t}/suspend`)}function x3(e,t){return ke.post(`/admin/sessions/agents/${e}/${t}/terminate`)}var O1=1,w3=.9,S3=.8,k3=.17,sp=.1,op=.999,j3=.9999,C3=.99,E3=/[\\\/_+.#"@\[\(\{&]/,N3=/[\\\/_+.#"@\[\(\{&]/g,_3=/[\s-]/,ej=/[\s-]/g;function vg(e,t,n,a,l,o,c){if(o===t.length)return l===e.length?O1:C3;var f=`${l},${o}`;if(c[f]!==void 0)return c[f];for(var m=a.charAt(o),h=n.indexOf(m,l),y=0,g,b,w,k;h>=0;)g=vg(e,t,n,a,h+1,o+1,c),g>y&&(h===l?g*=O1:E3.test(e.charAt(h-1))?(g*=S3,w=e.slice(l,h-1).match(N3),w&&l>0&&(g*=Math.pow(op,w.length))):_3.test(e.charAt(h-1))?(g*=w3,k=e.slice(l,h-1).match(ej),k&&l>0&&(g*=Math.pow(op,k.length))):(g*=k3,l>0&&(g*=Math.pow(op,h-l))),e.charAt(h)!==t.charAt(o)&&(g*=j3)),(g<sp&&n.charAt(h-1)===a.charAt(o+1)||a.charAt(o+1)===a.charAt(o)&&n.charAt(h-1)!==a.charAt(o))&&(b=vg(e,t,n,a,h+1,o+2,c),b*sp>g&&(g=b*sp)),g>y&&(y=g),h=n.indexOf(m,h+1);return c[f]=y,y}function D1(e){return e.toLowerCase().replace(ej," ")}function T3(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,vg(e,t,D1(e),D1(t),0,0,{})}function Ei(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 M1(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function _i(...e){return t=>{let n=!1;const a=e.map(l=>{const o=M1(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():M1(e[l],null)}}}}function jl(...e){return x.useCallback(_i(...e),e)}function A3(e,t){const n=x.createContext(t),a=o=>{const{children:c,...f}=o,m=x.useMemo(()=>f,Object.values(f));return u.jsx(n.Provider,{value:m,children:c})};a.displayName=e+"Provider";function l(o){const c=x.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[a,l]}function R3(e,t=[]){let n=[];function a(o,c){const f=x.createContext(c),m=n.length;n=[...n,c];const h=g=>{var C;const{scope:b,children:w,...k}=g,j=((C=b==null?void 0:b[e])==null?void 0:C[m])||f,E=x.useMemo(()=>k,Object.values(k));return u.jsx(j.Provider,{value:E,children:w})};h.displayName=o+"Provider";function y(g,b){var j;const w=((j=b==null?void 0:b[e])==null?void 0:j[m])||f,k=x.useContext(w);if(k)return k;if(c!==void 0)return c;throw new Error(`\`${g}\` must be used within \`${o}\``)}return[h,y]}const l=()=>{const o=n.map(c=>x.createContext(c));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,z3(l,...t)]}function z3(...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 c=a.reduce((f,{useScope:m,scopeName:h})=>{const g=m(o)[`__scope${h}`];return{...f,...g}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}var Eu=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},O3=Vg[" useId ".trim().toString()]||(()=>{}),D3=0;function _a(e){const[t,n]=x.useState(O3());return Eu(()=>{n(a=>a??String(D3++))},[e]),t?`radix-${t}`:""}var M3=Vg[" useInsertionEffect ".trim().toString()]||Eu;function L3({prop:e,defaultProp:t,onChange:n=()=>{},caller:a}){const[l,o,c]=I3({defaultProp:t,onChange:n}),f=e!==void 0,m=f?e:l;{const y=x.useRef(e!==void 0);x.useEffect(()=>{const g=y.current;g!==f&&console.warn(`${a} is changing from ${g?"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.`),y.current=f},[f,a])}const h=x.useCallback(y=>{var g;if(f){const b=U3(y)?y(e):y;b!==e&&((g=c.current)==null||g.call(c,b))}else o(y)},[f,e,o,c]);return[m,h]}function I3({defaultProp:e,onChange:t}){const[n,a]=x.useState(e),l=x.useRef(n),o=x.useRef(t);return M3(()=>{o.current=t},[t]),x.useEffect(()=>{var c;l.current!==n&&((c=o.current)==null||c.call(o,n),l.current=n)},[n,l]),[n,a,o]}function U3(e){return typeof e=="function"}var gy=HS();const P3=df(gy);function tj(e){const t=B3(e),n=x.forwardRef((a,l)=>{const{children:o,...c}=a,f=x.Children.toArray(o),m=f.find(F3);if(m){const h=m.props.children,y=f.map(g=>g===m?x.Children.count(h)>1?x.Children.only(null):x.isValidElement(h)?h.props.children:null:g);return u.jsx(t,{...c,ref:l,children:x.isValidElement(h)?x.cloneElement(h,void 0,y):null})}return u.jsx(t,{...c,ref:l,children:o})});return n.displayName=`${e}.Slot`,n}function B3(e){const t=x.forwardRef((n,a)=>{const{children:l,...o}=n;if(x.isValidElement(l)){const c=H3(l),f=q3(o,l.props);return l.type!==x.Fragment&&(f.ref=a?_i(a,c):c),x.cloneElement(l,f)}return x.Children.count(l)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var $3=Symbol("radix.slottable");function F3(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===$3}function q3(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 H3(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 Z3=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],za=Z3.reduce((e,t)=>{const n=tj(`Primitive.${t}`),a=x.forwardRef((l,o)=>{const{asChild:c,...f}=l,m=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(m,{...f,ref:o})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});function V3(e,t){e&&gy.flushSync(()=>e.dispatchEvent(t))}function Nu(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 Q3(e,t=globalThis==null?void 0:globalThis.document){const n=Nu(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 G3="DismissableLayer",bg="dismissableLayer.update",K3="dismissableLayer.pointerDownOutside",Y3="dismissableLayer.focusOutside",L1,nj=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),rj=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:o,onInteractOutside:c,onDismiss:f,...m}=e,h=x.useContext(nj),[y,g]=x.useState(null),b=(y==null?void 0:y.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,w]=x.useState({}),k=jl(t,M=>g(M)),j=Array.from(h.layers),[E]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),C=j.indexOf(E),N=y?j.indexOf(y):-1,z=h.layersWithOutsidePointerEventsDisabled.size>0,U=N>=C,D=W3(M=>{const I=M.target,X=[...h.branches].some(F=>F.contains(I));!U||X||(l==null||l(M),c==null||c(M),M.defaultPrevented||f==null||f())},b),O=eO(M=>{const I=M.target;[...h.branches].some(F=>F.contains(I))||(o==null||o(M),c==null||c(M),M.defaultPrevented||f==null||f())},b);return Q3(M=>{N===h.layers.size-1&&(a==null||a(M),!M.defaultPrevented&&f&&(M.preventDefault(),f()))},b),x.useEffect(()=>{if(y)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(L1=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(y)),h.layers.add(y),I1(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=L1)}},[y,b,n,h]),x.useEffect(()=>()=>{y&&(h.layers.delete(y),h.layersWithOutsidePointerEventsDisabled.delete(y),I1())},[y,h]),x.useEffect(()=>{const M=()=>w({});return document.addEventListener(bg,M),()=>document.removeEventListener(bg,M)},[]),u.jsx(za.div,{...m,ref:k,style:{pointerEvents:z?U?"auto":"none":void 0,...e.style},onFocusCapture:Ei(e.onFocusCapture,O.onFocusCapture),onBlurCapture:Ei(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:Ei(e.onPointerDownCapture,D.onPointerDownCapture)})});rj.displayName=G3;var X3="DismissableLayerBranch",J3=x.forwardRef((e,t)=>{const n=x.useContext(nj),a=x.useRef(null),l=jl(t,a);return x.useEffect(()=>{const o=a.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),u.jsx(za.div,{...e,ref:l})});J3.displayName=X3;function W3(e,t=globalThis==null?void 0:globalThis.document){const n=Nu(e),a=x.useRef(!1),l=x.useRef(()=>{});return x.useEffect(()=>{const o=f=>{if(f.target&&!a.current){let m=function(){aj(K3,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},c=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",o),t.removeEventListener("click",l.current)}},[t,n]),{onPointerDownCapture:()=>a.current=!0}}function eO(e,t=globalThis==null?void 0:globalThis.document){const n=Nu(e),a=x.useRef(!1);return x.useEffect(()=>{const l=o=>{o.target&&!a.current&&aj(Y3,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 I1(){const e=new CustomEvent(bg);document.dispatchEvent(e)}function aj(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?V3(l,o):l.dispatchEvent(o)}var up="focusScope.autoFocusOnMount",cp="focusScope.autoFocusOnUnmount",U1={bubbles:!1,cancelable:!0},tO="FocusScope",ij=x.forwardRef((e,t)=>{const{loop:n=!1,trapped:a=!1,onMountAutoFocus:l,onUnmountAutoFocus:o,...c}=e,[f,m]=x.useState(null),h=Nu(l),y=Nu(o),g=x.useRef(null),b=jl(t,j=>m(j)),w=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(a){let j=function(z){if(w.paused||!f)return;const U=z.target;f.contains(U)?g.current=U:fi(g.current,{select:!0})},E=function(z){if(w.paused||!f)return;const U=z.relatedTarget;U!==null&&(f.contains(U)||fi(g.current,{select:!0}))},C=function(z){if(document.activeElement===document.body)for(const D of z)D.removedNodes.length>0&&fi(f)};document.addEventListener("focusin",j),document.addEventListener("focusout",E);const N=new MutationObserver(C);return f&&N.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",j),document.removeEventListener("focusout",E),N.disconnect()}}},[a,f,w.paused]),x.useEffect(()=>{if(f){B1.add(w);const j=document.activeElement;if(!f.contains(j)){const C=new CustomEvent(up,U1);f.addEventListener(up,h),f.dispatchEvent(C),C.defaultPrevented||(nO(sO(lj(f)),{select:!0}),document.activeElement===j&&fi(f))}return()=>{f.removeEventListener(up,h),setTimeout(()=>{const C=new CustomEvent(cp,U1);f.addEventListener(cp,y),f.dispatchEvent(C),C.defaultPrevented||fi(j??document.body,{select:!0}),f.removeEventListener(cp,y),B1.remove(w)},0)}}},[f,h,y,w]);const k=x.useCallback(j=>{if(!n&&!a||w.paused)return;const E=j.key==="Tab"&&!j.altKey&&!j.ctrlKey&&!j.metaKey,C=document.activeElement;if(E&&C){const N=j.currentTarget,[z,U]=rO(N);z&&U?!j.shiftKey&&C===U?(j.preventDefault(),n&&fi(z,{select:!0})):j.shiftKey&&C===z&&(j.preventDefault(),n&&fi(U,{select:!0})):C===N&&j.preventDefault()}},[n,a,w.paused]);return u.jsx(za.div,{tabIndex:-1,...c,ref:b,onKeyDown:k})});ij.displayName=tO;function nO(e,{select:t=!1}={}){const n=document.activeElement;for(const a of e)if(fi(a,{select:t}),document.activeElement!==n)return}function rO(e){const t=lj(e),n=P1(t,e),a=P1(t.reverse(),e);return[n,a]}function lj(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 P1(e,t){for(const n of e)if(!aO(n,{upTo:t}))return n}function aO(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 iO(e){return e instanceof HTMLInputElement&&"select"in e}function fi(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&iO(e)&&t&&e.select()}}var B1=lO();function lO(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=$1(e,t),e.unshift(t)},remove(t){var n;e=$1(e,t),(n=e[0])==null||n.resume()}}}function $1(e,t){const n=[...e],a=n.indexOf(t);return a!==-1&&n.splice(a,1),n}function sO(e){return e.filter(t=>t.tagName!=="A")}var oO="Portal",sj=x.forwardRef((e,t)=>{var f;const{container:n,...a}=e,[l,o]=x.useState(!1);Eu(()=>o(!0),[]);const c=n||l&&((f=globalThis==null?void 0:globalThis.document)==null?void 0:f.body);return c?P3.createPortal(u.jsx(za.div,{...a,ref:t}),c):null});sj.displayName=oO;function uO(e,t){return x.useReducer((n,a)=>t[n][a]??n,e)}var bf=e=>{const{present:t,children:n}=e,a=cO(t),l=typeof n=="function"?n({present:a.isPresent}):x.Children.only(n),o=jl(a.ref,dO(l));return typeof n=="function"||a.isPresent?x.cloneElement(l,{ref:o}):null};bf.displayName="Presence";function cO(e){const[t,n]=x.useState(),a=x.useRef(null),l=x.useRef(e),o=x.useRef("none"),c=e?"mounted":"unmounted",[f,m]=uO(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const h=Sd(a.current);o.current=f==="mounted"?h:"none"},[f]),Eu(()=>{const h=a.current,y=l.current;if(y!==e){const b=o.current,w=Sd(h);e?m("MOUNT"):w==="none"||(h==null?void 0:h.display)==="none"?m("UNMOUNT"):m(y&&b!==w?"ANIMATION_OUT":"UNMOUNT"),l.current=e}},[e,m]),Eu(()=>{if(t){let h;const y=t.ownerDocument.defaultView??window,g=w=>{const j=Sd(a.current).includes(CSS.escape(w.animationName));if(w.target===t&&j&&(m("ANIMATION_END"),!l.current)){const E=t.style.animationFillMode;t.style.animationFillMode="forwards",h=y.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=E)})}},b=w=>{w.target===t&&(o.current=Sd(a.current))};return t.addEventListener("animationstart",b),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{y.clearTimeout(h),t.removeEventListener("animationstart",b),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else m("ANIMATION_END")},[t,m]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:x.useCallback(h=>{a.current=h?getComputedStyle(h):null,n(h)},[])}}function Sd(e){return(e==null?void 0:e.animationName)||"none"}function dO(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 dp=0;function fO(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??F1()),document.body.insertAdjacentElement("beforeend",e[1]??F1()),dp++,()=>{dp===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),dp--}},[])}function F1(){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 Gr=function(){return Gr=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},Gr.apply(this,arguments)};function oj(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 hO(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 Bd="right-scroll-bar-position",$d="width-before-scroll-bar",mO="with-scroll-bars-hidden",pO="--removed-body-scroll-bar-size";function fp(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function gO(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 yO=typeof window<"u"?x.useLayoutEffect:x.useEffect,q1=new WeakMap;function vO(e,t){var n=gO(null,function(a){return e.forEach(function(l){return fp(l,a)})});return yO(function(){var a=q1.get(n);if(a){var l=new Set(a),o=new Set(e),c=n.current;l.forEach(function(f){o.has(f)||fp(f,null)}),o.forEach(function(f){l.has(f)||fp(f,c)})}q1.set(n,e)},[e]),n}function bO(e){return e}function xO(e,t){t===void 0&&(t=bO);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 c=t(o,a);return n.push(c),function(){n=n.filter(function(f){return f!==c})}},assignSyncMedium:function(o){for(a=!0;n.length;){var c=n;n=[],c.forEach(o)}n={push:function(f){return o(f)},filter:function(){return n}}},assignMedium:function(o){a=!0;var c=[];if(n.length){var f=n;n=[],f.forEach(o),c=n}var m=function(){var y=c;c=[],y.forEach(o)},h=function(){return Promise.resolve().then(m)};h(),n={push:function(y){c.push(y),h()},filter:function(y){return c=c.filter(y),n}}}};return l}function wO(e){e===void 0&&(e={});var t=xO(null);return t.options=Gr({async:!0,ssr:!1},e),t}var uj=function(e){var t=e.sideCar,n=oj(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,Gr({},n))};uj.isSideCarExport=!0;function SO(e,t){return e.useMedium(t),uj}var cj=wO(),hp=function(){},xf=x.forwardRef(function(e,t){var n=x.useRef(null),a=x.useState({onScrollCapture:hp,onWheelCapture:hp,onTouchMoveCapture:hp}),l=a[0],o=a[1],c=e.forwardProps,f=e.children,m=e.className,h=e.removeScrollBar,y=e.enabled,g=e.shards,b=e.sideCar,w=e.noRelative,k=e.noIsolation,j=e.inert,E=e.allowPinchZoom,C=e.as,N=C===void 0?"div":C,z=e.gapMode,U=oj(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),D=b,O=vO([n,t]),M=Gr(Gr({},U),l);return x.createElement(x.Fragment,null,y&&x.createElement(D,{sideCar:cj,removeScrollBar:h,shards:g,noRelative:w,noIsolation:k,inert:j,setCallbacks:o,allowPinchZoom:!!E,lockRef:n,gapMode:z}),c?x.cloneElement(x.Children.only(f),Gr(Gr({},M),{ref:O})):x.createElement(N,Gr({},M,{className:m,ref:O}),f))});xf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};xf.classNames={fullWidth:$d,zeroRight:Bd};var kO=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function jO(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=kO();return t&&e.setAttribute("nonce",t),e}function CO(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function EO(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var NO=function(){var e=0,t=null;return{add:function(n){e==0&&(t=jO())&&(CO(t,n),EO(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},_O=function(){var e=NO();return function(t,n){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},dj=function(){var e=_O(),t=function(n){var a=n.styles,l=n.dynamic;return e(a,l),null};return t},TO={left:0,top:0,right:0,gap:0},mp=function(e){return parseInt(e||"",10)||0},AO=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[mp(n),mp(a),mp(l)]},RO=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return TO;var t=AO(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])}},zO=dj(),Es="data-scroll-locked",OO=function(e,t,n,a){var l=e.left,o=e.top,c=e.right,f=e.gap;return n===void 0&&(n="margin"),`
|
|
276
|
+
.`.concat(mO,` {
|
|
277
|
+
overflow: hidden `).concat(a,`;
|
|
278
|
+
padding-right: `).concat(f,"px ").concat(a,`;
|
|
279
|
+
}
|
|
280
|
+
body[`).concat(Es,`] {
|
|
281
|
+
overflow: hidden `).concat(a,`;
|
|
282
|
+
overscroll-behavior: contain;
|
|
283
|
+
`).concat([t&&"position: relative ".concat(a,";"),n==="margin"&&`
|
|
284
|
+
padding-left: `.concat(l,`px;
|
|
285
|
+
padding-top: `).concat(o,`px;
|
|
286
|
+
padding-right: `).concat(c,`px;
|
|
287
|
+
margin-left:0;
|
|
288
|
+
margin-top:0;
|
|
289
|
+
margin-right: `).concat(f,"px ").concat(a,`;
|
|
290
|
+
`),n==="padding"&&"padding-right: ".concat(f,"px ").concat(a,";")].filter(Boolean).join(""),`
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
.`).concat(Bd,` {
|
|
294
|
+
right: `).concat(f,"px ").concat(a,`;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.`).concat($d,` {
|
|
298
|
+
margin-right: `).concat(f,"px ").concat(a,`;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.`).concat(Bd," .").concat(Bd,` {
|
|
302
|
+
right: 0 `).concat(a,`;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.`).concat($d," .").concat($d,` {
|
|
306
|
+
margin-right: 0 `).concat(a,`;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
body[`).concat(Es,`] {
|
|
310
|
+
`).concat(pO,": ").concat(f,`px;
|
|
311
|
+
}
|
|
312
|
+
`)},H1=function(){var e=parseInt(document.body.getAttribute(Es)||"0",10);return isFinite(e)?e:0},DO=function(){x.useEffect(function(){return document.body.setAttribute(Es,(H1()+1).toString()),function(){var e=H1()-1;e<=0?document.body.removeAttribute(Es):document.body.setAttribute(Es,e.toString())}},[])},MO=function(e){var t=e.noRelative,n=e.noImportant,a=e.gapMode,l=a===void 0?"margin":a;DO();var o=x.useMemo(function(){return RO(l)},[l]);return x.createElement(zO,{styles:OO(o,!t,l,n?"":"!important")})},xg=!1;if(typeof window<"u")try{var kd=Object.defineProperty({},"passive",{get:function(){return xg=!0,!0}});window.addEventListener("test",kd,kd),window.removeEventListener("test",kd,kd)}catch{xg=!1}var hs=xg?{passive:!1}:!1,LO=function(e){return e.tagName==="TEXTAREA"},fj=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!LO(e)&&n[t]==="visible")},IO=function(e){return fj(e,"overflowY")},UO=function(e){return fj(e,"overflowX")},Z1=function(e,t){var n=t.ownerDocument,a=t;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var l=hj(e,a);if(l){var o=mj(e,a),c=o[1],f=o[2];if(c>f)return!0}a=a.parentNode}while(a&&a!==n.body);return!1},PO=function(e){var t=e.scrollTop,n=e.scrollHeight,a=e.clientHeight;return[t,n,a]},BO=function(e){var t=e.scrollLeft,n=e.scrollWidth,a=e.clientWidth;return[t,n,a]},hj=function(e,t){return e==="v"?IO(t):UO(t)},mj=function(e,t){return e==="v"?PO(t):BO(t)},$O=function(e,t){return e==="h"&&t==="rtl"?-1:1},FO=function(e,t,n,a,l){var o=$O(e,window.getComputedStyle(t).direction),c=o*a,f=n.target,m=t.contains(f),h=!1,y=c>0,g=0,b=0;do{if(!f)break;var w=mj(e,f),k=w[0],j=w[1],E=w[2],C=j-E-o*k;(k||C)&&hj(e,f)&&(g+=C,b+=k);var N=f.parentNode;f=N&&N.nodeType===Node.DOCUMENT_FRAGMENT_NODE?N.host:N}while(!m&&f!==document.body||m&&(t.contains(f)||t===f));return(y&&Math.abs(g)<1||!y&&Math.abs(b)<1)&&(h=!0),h},jd=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},V1=function(e){return[e.deltaX,e.deltaY]},Q1=function(e){return e&&"current"in e?e.current:e},qO=function(e,t){return e[0]===t[0]&&e[1]===t[1]},HO=function(e){return`
|
|
313
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
314
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
315
|
+
`)},ZO=0,ms=[];function VO(e){var t=x.useRef([]),n=x.useRef([0,0]),a=x.useRef(),l=x.useState(ZO++)[0],o=x.useState(dj)[0],c=x.useRef(e);x.useEffect(function(){c.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(l));var j=hO([e.lockRef.current],(e.shards||[]).map(Q1),!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!c.current.allowPinchZoom;var C=jd(j),N=n.current,z="deltaX"in j?j.deltaX:N[0]-C[0],U="deltaY"in j?j.deltaY:N[1]-C[1],D,O=j.target,M=Math.abs(z)>Math.abs(U)?"h":"v";if("touches"in j&&M==="h"&&O.type==="range")return!1;var I=window.getSelection(),X=I&&I.anchorNode,F=X?X===O||X.contains(O):!1;if(F)return!1;var W=Z1(M,O);if(!W)return!0;if(W?D=M:(D=M==="v"?"h":"v",W=Z1(M,O)),!W)return!1;if(!a.current&&"changedTouches"in j&&(z||U)&&(a.current=D),!D)return!0;var ee=a.current||D;return FO(ee,E,j,ee==="h"?z:U)},[]),m=x.useCallback(function(j){var E=j;if(!(!ms.length||ms[ms.length-1]!==o)){var C="deltaY"in E?V1(E):jd(E),N=t.current.filter(function(D){return D.name===E.type&&(D.target===E.target||E.target===D.shadowParent)&&qO(D.delta,C)})[0];if(N&&N.should){E.cancelable&&E.preventDefault();return}if(!N){var z=(c.current.shards||[]).map(Q1).filter(Boolean).filter(function(D){return D.contains(E.target)}),U=z.length>0?f(E,z[0]):!c.current.noIsolation;U&&E.cancelable&&E.preventDefault()}}},[]),h=x.useCallback(function(j,E,C,N){var z={name:j,delta:E,target:C,should:N,shadowParent:QO(C)};t.current.push(z),setTimeout(function(){t.current=t.current.filter(function(U){return U!==z})},1)},[]),y=x.useCallback(function(j){n.current=jd(j),a.current=void 0},[]),g=x.useCallback(function(j){h(j.type,V1(j),j.target,f(j,e.lockRef.current))},[]),b=x.useCallback(function(j){h(j.type,jd(j),j.target,f(j,e.lockRef.current))},[]);x.useEffect(function(){return ms.push(o),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:b}),document.addEventListener("wheel",m,hs),document.addEventListener("touchmove",m,hs),document.addEventListener("touchstart",y,hs),function(){ms=ms.filter(function(j){return j!==o}),document.removeEventListener("wheel",m,hs),document.removeEventListener("touchmove",m,hs),document.removeEventListener("touchstart",y,hs)}},[]);var w=e.removeScrollBar,k=e.inert;return x.createElement(x.Fragment,null,k?x.createElement(o,{styles:HO(l)}):null,w?x.createElement(MO,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function QO(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const GO=SO(cj,VO);var pj=x.forwardRef(function(e,t){return x.createElement(xf,Gr({},e,{ref:t,sideCar:GO}))});pj.classNames=xf.classNames;var KO=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ps=new WeakMap,Cd=new WeakMap,Ed={},pp=0,gj=function(e){return e&&(e.host||gj(e.parentNode))},YO=function(e,t){return t.map(function(n){if(e.contains(n))return n;var a=gj(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})},XO=function(e,t,n,a){var l=YO(t,Array.isArray(e)?e:[e]);Ed[n]||(Ed[n]=new WeakMap);var o=Ed[n],c=[],f=new Set,m=new Set(l),h=function(g){!g||f.has(g)||(f.add(g),h(g.parentNode))};l.forEach(h);var y=function(g){!g||m.has(g)||Array.prototype.forEach.call(g.children,function(b){if(f.has(b))y(b);else try{var w=b.getAttribute(a),k=w!==null&&w!=="false",j=(ps.get(b)||0)+1,E=(o.get(b)||0)+1;ps.set(b,j),o.set(b,E),c.push(b),j===1&&k&&Cd.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 y(t),f.clear(),pp++,function(){c.forEach(function(g){var b=ps.get(g)-1,w=o.get(g)-1;ps.set(g,b),o.set(g,w),b||(Cd.has(g)||g.removeAttribute(a),Cd.delete(g)),w||g.removeAttribute(n)}),pp--,pp||(ps=new WeakMap,ps=new WeakMap,Cd=new WeakMap,Ed={})}},JO=function(e,t,n){n===void 0&&(n="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),l=KO(e);return l?(a.push.apply(a,Array.from(l.querySelectorAll("[aria-live], script"))),XO(a,l,n,"aria-hidden")):function(){return null}},wf="Dialog",[yj]=R3(wf),[WO,Ur]=yj(wf),vj=e=>{const{__scopeDialog:t,children:n,open:a,defaultOpen:l,onOpenChange:o,modal:c=!0}=e,f=x.useRef(null),m=x.useRef(null),[h,y]=L3({prop:a,defaultProp:l??!1,onChange:o,caller:wf});return u.jsx(WO,{scope:t,triggerRef:f,contentRef:m,contentId:_a(),titleId:_a(),descriptionId:_a(),open:h,onOpenChange:y,onOpenToggle:x.useCallback(()=>y(g=>!g),[y]),modal:c,children:n})};vj.displayName=wf;var bj="DialogTrigger",xj=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Ur(bj,n),o=jl(t,l.triggerRef);return u.jsx(za.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":by(l.open),...a,ref:o,onClick:Ei(e.onClick,l.onOpenToggle)})});xj.displayName=bj;var yy="DialogPortal",[eD,wj]=yj(yy,{forceMount:void 0}),Sj=e=>{const{__scopeDialog:t,forceMount:n,children:a,container:l}=e,o=Ur(yy,t);return u.jsx(eD,{scope:t,forceMount:n,children:x.Children.map(a,c=>u.jsx(bf,{present:n||o.open,children:u.jsx(sj,{asChild:!0,container:l,children:c})}))})};Sj.displayName=yy;var Xd="DialogOverlay",kj=x.forwardRef((e,t)=>{const n=wj(Xd,e.__scopeDialog),{forceMount:a=n.forceMount,...l}=e,o=Ur(Xd,e.__scopeDialog);return o.modal?u.jsx(bf,{present:a||o.open,children:u.jsx(nD,{...l,ref:t})}):null});kj.displayName=Xd;var tD=tj("DialogOverlay.RemoveScroll"),nD=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Ur(Xd,n);return u.jsx(pj,{as:tD,allowPinchZoom:!0,shards:[l.contentRef],children:u.jsx(za.div,{"data-state":by(l.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),gl="DialogContent",jj=x.forwardRef((e,t)=>{const n=wj(gl,e.__scopeDialog),{forceMount:a=n.forceMount,...l}=e,o=Ur(gl,e.__scopeDialog);return u.jsx(bf,{present:a||o.open,children:o.modal?u.jsx(rD,{...l,ref:t}):u.jsx(aD,{...l,ref:t})})});jj.displayName=gl;var rD=x.forwardRef((e,t)=>{const n=Ur(gl,e.__scopeDialog),a=x.useRef(null),l=jl(t,n.contentRef,a);return x.useEffect(()=>{const o=a.current;if(o)return JO(o)},[]),u.jsx(Cj,{...e,ref:l,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ei(e.onCloseAutoFocus,o=>{var c;o.preventDefault(),(c=n.triggerRef.current)==null||c.focus()}),onPointerDownOutside:Ei(e.onPointerDownOutside,o=>{const c=o.detail.originalEvent,f=c.button===0&&c.ctrlKey===!0;(c.button===2||f)&&o.preventDefault()}),onFocusOutside:Ei(e.onFocusOutside,o=>o.preventDefault())})}),aD=x.forwardRef((e,t)=>{const n=Ur(gl,e.__scopeDialog),a=x.useRef(!1),l=x.useRef(!1);return u.jsx(Cj,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var c,f;(c=e.onCloseAutoFocus)==null||c.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 c=o.target;((h=n.triggerRef.current)==null?void 0:h.contains(c))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&l.current&&o.preventDefault()}})}),Cj=x.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:a,onOpenAutoFocus:l,onCloseAutoFocus:o,...c}=e,f=Ur(gl,n),m=x.useRef(null),h=jl(t,m);return fO(),u.jsxs(u.Fragment,{children:[u.jsx(ij,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:l,onUnmountAutoFocus:o,children:u.jsx(rj,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":by(f.open),...c,ref:h,onDismiss:()=>f.onOpenChange(!1)})}),u.jsxs(u.Fragment,{children:[u.jsx(iD,{titleId:f.titleId}),u.jsx(sD,{contentRef:m,descriptionId:f.descriptionId})]})]})}),vy="DialogTitle",Ej=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Ur(vy,n);return u.jsx(za.h2,{id:l.titleId,...a,ref:t})});Ej.displayName=vy;var Nj="DialogDescription",_j=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Ur(Nj,n);return u.jsx(za.p,{id:l.descriptionId,...a,ref:t})});_j.displayName=Nj;var Tj="DialogClose",Aj=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Ur(Tj,n);return u.jsx(za.button,{type:"button",...a,ref:t,onClick:Ei(e.onClick,()=>l.onOpenChange(!1))})});Aj.displayName=Tj;function by(e){return e?"open":"closed"}var Rj="DialogTitleWarning",[aZ,zj]=A3(Rj,{contentName:gl,titleName:vy,docsSlug:"dialog"}),iD=({titleId:e})=>{const t=zj(Rj),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
316
|
+
|
|
317
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
318
|
+
|
|
319
|
+
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},lD="DialogDescriptionWarning",sD=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${zj(lD).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},Oj=vj,oD=xj,Dj=Sj,Mj=kj,Lj=jj,uD=Ej,cD=_j,dD=Aj,fD=Symbol.for("react.lazy"),Jd=Vg[" use ".trim().toString()];function hD(e){return typeof e=="object"&&e!==null&&"then"in e}function Ij(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===fD&&"_payload"in e&&hD(e._payload)}function Uj(e){const t=pD(e),n=x.forwardRef((a,l)=>{let{children:o,...c}=a;Ij(o)&&typeof Jd=="function"&&(o=Jd(o._payload));const f=x.Children.toArray(o),m=f.find(yD);if(m){const h=m.props.children,y=f.map(g=>g===m?x.Children.count(h)>1?x.Children.only(null):x.isValidElement(h)?h.props.children:null:g);return u.jsx(t,{...c,ref:l,children:x.isValidElement(h)?x.cloneElement(h,void 0,y):null})}return u.jsx(t,{...c,ref:l,children:o})});return n.displayName=`${e}.Slot`,n}var mD=Uj("Slot");function pD(e){const t=x.forwardRef((n,a)=>{let{children:l,...o}=n;if(Ij(l)&&typeof Jd=="function"&&(l=Jd(l._payload)),x.isValidElement(l)){const c=bD(l),f=vD(o,l.props);return l.type!==x.Fragment&&(f.ref=a?_i(a,c):c),x.cloneElement(l,f)}return x.Children.count(l)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var gD=Symbol("radix.slottable");function yD(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===gD}function vD(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 bD(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 xD=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Oa=xD.reduce((e,t)=>{const n=Uj(`Primitive.${t}`),a=x.forwardRef((l,o)=>{const{asChild:c,...f}=l,m=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(m,{...f,ref:o})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{}),su='[cmdk-group=""]',gp='[cmdk-group-items=""]',wD='[cmdk-group-heading=""]',Pj='[cmdk-item=""]',G1=`${Pj}:not([aria-disabled="true"])`,wg="cmdk-item-select",bs="data-value",SD=(e,t,n)=>T3(e,t,n),Bj=x.createContext(void 0),Gu=()=>x.useContext(Bj),$j=x.createContext(void 0),xy=()=>x.useContext($j),Fj=x.createContext(void 0),qj=x.forwardRef((e,t)=>{let n=xs(()=>{var B,T;return{search:"",value:(T=(B=e.value)!=null?B:e.defaultValue)!=null?T:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),a=xs(()=>new Set),l=xs(()=>new Map),o=xs(()=>new Map),c=xs(()=>new Set),f=Hj(e),{label:m,children:h,value:y,onValueChange:g,filter:b,shouldFilter:w,loop:k,disablePointerSelection:j=!1,vimBindings:E=!0,...C}=e,N=_a(),z=_a(),U=_a(),D=x.useRef(null),O=OD();yl(()=>{if(y!==void 0){let B=y.trim();n.current.value=B,M.emit()}},[y]),yl(()=>{O(6,ye)},[]);let M=x.useMemo(()=>({subscribe:B=>(c.current.add(B),()=>c.current.delete(B)),snapshot:()=>n.current,setState:(B,T,q)=>{var K,ce,xe,we;if(!Object.is(n.current[B],T)){if(n.current[B]=T,B==="search")ee(),F(),O(1,W);else if(B==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let pe=document.getElementById(U);pe?pe.focus():(K=document.getElementById(N))==null||K.focus()}if(O(7,()=>{var pe;n.current.selectedItemId=(pe=he())==null?void 0:pe.id,M.emit()}),q||O(5,ye),((ce=f.current)==null?void 0:ce.value)!==void 0){let pe=T??"";(we=(xe=f.current).onValueChange)==null||we.call(xe,pe);return}}M.emit()}},emit:()=>{c.current.forEach(B=>B())}}),[]),I=x.useMemo(()=>({value:(B,T,q)=>{var K;T!==((K=o.current.get(B))==null?void 0:K.value)&&(o.current.set(B,{value:T,keywords:q}),n.current.filtered.items.set(B,X(T,q)),O(2,()=>{F(),M.emit()}))},item:(B,T)=>(a.current.add(B),T&&(l.current.has(T)?l.current.get(T).add(B):l.current.set(T,new Set([B]))),O(3,()=>{ee(),F(),n.current.value||W(),M.emit()}),()=>{o.current.delete(B),a.current.delete(B),n.current.filtered.items.delete(B);let q=he();O(4,()=>{ee(),(q==null?void 0:q.getAttribute("id"))===B&&W(),M.emit()})}),group:B=>(l.current.has(B)||l.current.set(B,new Set),()=>{o.current.delete(B),l.current.delete(B)}),filter:()=>f.current.shouldFilter,label:m||e["aria-label"],getDisablePointerSelection:()=>f.current.disablePointerSelection,listId:N,inputId:U,labelId:z,listInnerRef:D}),[]);function X(B,T){var q,K;let ce=(K=(q=f.current)==null?void 0:q.filter)!=null?K:SD;return B?ce(B,n.current.search,T):0}function F(){if(!n.current.search||f.current.shouldFilter===!1)return;let B=n.current.filtered.items,T=[];n.current.filtered.groups.forEach(K=>{let ce=l.current.get(K),xe=0;ce.forEach(we=>{let pe=B.get(we);xe=Math.max(pe,xe)}),T.push([K,xe])});let q=D.current;ne().sort((K,ce)=>{var xe,we;let pe=K.getAttribute("id"),Xe=ce.getAttribute("id");return((xe=B.get(Xe))!=null?xe:0)-((we=B.get(pe))!=null?we:0)}).forEach(K=>{let ce=K.closest(gp);ce?ce.appendChild(K.parentElement===ce?K:K.closest(`${gp} > *`)):q.appendChild(K.parentElement===q?K:K.closest(`${gp} > *`))}),T.sort((K,ce)=>ce[1]-K[1]).forEach(K=>{var ce;let xe=(ce=D.current)==null?void 0:ce.querySelector(`${su}[${bs}="${encodeURIComponent(K[0])}"]`);xe==null||xe.parentElement.appendChild(xe)})}function W(){let B=ne().find(q=>q.getAttribute("aria-disabled")!=="true"),T=B==null?void 0:B.getAttribute(bs);M.setState("value",T||void 0)}function ee(){var B,T,q,K;if(!n.current.search||f.current.shouldFilter===!1){n.current.filtered.count=a.current.size;return}n.current.filtered.groups=new Set;let ce=0;for(let xe of a.current){let we=(T=(B=o.current.get(xe))==null?void 0:B.value)!=null?T:"",pe=(K=(q=o.current.get(xe))==null?void 0:q.keywords)!=null?K:[],Xe=X(we,pe);n.current.filtered.items.set(xe,Xe),Xe>0&&ce++}for(let[xe,we]of l.current)for(let pe of we)if(n.current.filtered.items.get(pe)>0){n.current.filtered.groups.add(xe);break}n.current.filtered.count=ce}function ye(){var B,T,q;let K=he();K&&(((B=K.parentElement)==null?void 0:B.firstChild)===K&&((q=(T=K.closest(su))==null?void 0:T.querySelector(wD))==null||q.scrollIntoView({block:"nearest"})),K.scrollIntoView({block:"nearest"}))}function he(){var B;return(B=D.current)==null?void 0:B.querySelector(`${Pj}[aria-selected="true"]`)}function ne(){var B;return Array.from(((B=D.current)==null?void 0:B.querySelectorAll(G1))||[])}function Z(B){let T=ne()[B];T&&M.setState("value",T.getAttribute(bs))}function te(B){var T;let q=he(),K=ne(),ce=K.findIndex(we=>we===q),xe=K[ce+B];(T=f.current)!=null&&T.loop&&(xe=ce+B<0?K[K.length-1]:ce+B===K.length?K[0]:K[ce+B]),xe&&M.setState("value",xe.getAttribute(bs))}function ie(B){let T=he(),q=T==null?void 0:T.closest(su),K;for(;q&&!K;)q=B>0?RD(q,su):zD(q,su),K=q==null?void 0:q.querySelector(G1);K?M.setState("value",K.getAttribute(bs)):te(B)}let ue=()=>Z(ne().length-1),A=B=>{B.preventDefault(),B.metaKey?ue():B.altKey?ie(1):te(1)},P=B=>{B.preventDefault(),B.metaKey?Z(0):B.altKey?ie(-1):te(-1)};return x.createElement(Oa.div,{ref:t,tabIndex:-1,...C,"cmdk-root":"",onKeyDown:B=>{var T;(T=C.onKeyDown)==null||T.call(C,B);let q=B.nativeEvent.isComposing||B.keyCode===229;if(!(B.defaultPrevented||q))switch(B.key){case"n":case"j":{E&&B.ctrlKey&&A(B);break}case"ArrowDown":{A(B);break}case"p":case"k":{E&&B.ctrlKey&&P(B);break}case"ArrowUp":{P(B);break}case"Home":{B.preventDefault(),Z(0);break}case"End":{B.preventDefault(),ue();break}case"Enter":{B.preventDefault();let K=he();if(K){let ce=new Event(wg);K.dispatchEvent(ce)}}}}},x.createElement("label",{"cmdk-label":"",htmlFor:I.inputId,id:I.labelId,style:MD},m),Sf(e,B=>x.createElement($j.Provider,{value:M},x.createElement(Bj.Provider,{value:I},B))))}),kD=x.forwardRef((e,t)=>{var n,a;let l=_a(),o=x.useRef(null),c=x.useContext(Fj),f=Gu(),m=Hj(e),h=(a=(n=m.current)==null?void 0:n.forceMount)!=null?a:c==null?void 0:c.forceMount;yl(()=>{if(!h)return f.item(l,c==null?void 0:c.id)},[h]);let y=Zj(l,o,[e.value,e.children,o],e.keywords),g=xy(),b=Ti(O=>O.value&&O.value===y.current),w=Ti(O=>h||f.filter()===!1?!0:O.search?O.filtered.items.get(l)>0:!0);x.useEffect(()=>{let O=o.current;if(!(!O||e.disabled))return O.addEventListener(wg,k),()=>O.removeEventListener(wg,k)},[w,e.onSelect,e.disabled]);function k(){var O,M;j(),(M=(O=m.current).onSelect)==null||M.call(O,y.current)}function j(){g.setState("value",y.current,!0)}if(!w)return null;let{disabled:E,value:C,onSelect:N,forceMount:z,keywords:U,...D}=e;return x.createElement(Oa.div,{ref:_i(o,t),...D,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)}),jD=x.forwardRef((e,t)=>{let{heading:n,children:a,forceMount:l,...o}=e,c=_a(),f=x.useRef(null),m=x.useRef(null),h=_a(),y=Gu(),g=Ti(w=>l||y.filter()===!1?!0:w.search?w.filtered.groups.has(c):!0);yl(()=>y.group(c),[]),Zj(c,f,[e.value,e.heading,m]);let b=x.useMemo(()=>({id:c,forceMount:l}),[l]);return x.createElement(Oa.div,{ref:_i(f,t),...o,"cmdk-group":"",role:"presentation",hidden:g?void 0:!0},n&&x.createElement("div",{ref:m,"cmdk-group-heading":"","aria-hidden":!0,id:h},n),Sf(e,w=>x.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?h:void 0},x.createElement(Fj.Provider,{value:b},w))))}),CD=x.forwardRef((e,t)=>{let{alwaysRender:n,...a}=e,l=x.useRef(null),o=Ti(c=>!c.search);return!n&&!o?null:x.createElement(Oa.div,{ref:_i(l,t),...a,"cmdk-separator":"",role:"separator"})}),ED=x.forwardRef((e,t)=>{let{onValueChange:n,...a}=e,l=e.value!=null,o=xy(),c=Ti(h=>h.search),f=Ti(h=>h.selectedItemId),m=Gu();return x.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),x.createElement(Oa.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:c,onChange:h=>{l||o.setState("search",h.target.value),n==null||n(h.target.value)}})}),ND=x.forwardRef((e,t)=>{let{children:n,label:a="Suggestions",...l}=e,o=x.useRef(null),c=x.useRef(null),f=Ti(h=>h.selectedItemId),m=Gu();return x.useEffect(()=>{if(c.current&&o.current){let h=c.current,y=o.current,g,b=new ResizeObserver(()=>{g=requestAnimationFrame(()=>{let w=h.offsetHeight;y.style.setProperty("--cmdk-list-height",w.toFixed(1)+"px")})});return b.observe(h),()=>{cancelAnimationFrame(g),b.unobserve(h)}}},[]),x.createElement(Oa.div,{ref:_i(o,t),...l,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":f,"aria-label":a,id:m.listId},Sf(e,h=>x.createElement("div",{ref:_i(c,m.listInnerRef),"cmdk-list-sizer":""},h)))}),_D=x.forwardRef((e,t)=>{let{open:n,onOpenChange:a,overlayClassName:l,contentClassName:o,container:c,...f}=e;return x.createElement(Oj,{open:n,onOpenChange:a},x.createElement(Dj,{container:c},x.createElement(Mj,{"cmdk-overlay":"",className:l}),x.createElement(Lj,{"aria-label":e.label,"cmdk-dialog":"",className:o},x.createElement(qj,{ref:t,...f}))))}),TD=x.forwardRef((e,t)=>Ti(n=>n.filtered.count===0)?x.createElement(Oa.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),AD=x.forwardRef((e,t)=>{let{progress:n,children:a,label:l="Loading...",...o}=e;return x.createElement(Oa.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":l},Sf(e,c=>x.createElement("div",{"aria-hidden":!0},c)))}),Gn=Object.assign(qj,{List:ND,Item:kD,Input:ED,Group:jD,Separator:CD,Dialog:_D,Empty:TD,Loading:AD});function RD(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function zD(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Hj(e){let t=x.useRef(e);return yl(()=>{t.current=e}),t}var yl=typeof window>"u"?x.useEffect:x.useLayoutEffect;function xs(e){let t=x.useRef();return t.current===void 0&&(t.current=e()),t}function Ti(e){let t=xy(),n=()=>e(t.snapshot());return x.useSyncExternalStore(t.subscribe,n,n)}function Zj(e,t,n,a=[]){let l=x.useRef(),o=Gu();return yl(()=>{var c;let f=(()=>{var h;for(let y of n){if(typeof y=="string")return y.trim();if(typeof y=="object"&&"current"in y)return y.current?(h=y.current.textContent)==null?void 0:h.trim():l.current}})(),m=a.map(h=>h.trim());o.value(e,f,m),(c=t.current)==null||c.setAttribute(bs,f),l.current=f}),l}var OD=()=>{let[e,t]=x.useState(),n=xs(()=>new Map);return yl(()=>{n.current.forEach(a=>a()),n.current=new Map},[e]),(a,l)=>{n.current.set(a,l),t({})}};function DD(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Sf({asChild:e,children:t},n){return e&&x.isValidElement(t)?x.cloneElement(DD(t),{ref:t.ref},n(t.props.children)):n(t)}var MD={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const $t=Oj,LD=oD,ID=Dj,Vj=x.forwardRef(({className:e,...t},n)=>u.jsx(Mj,{ref:n,className:Ae("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}));Vj.displayName="DialogOverlay";const zt=x.forwardRef(({className:e,children:t,...n},a)=>u.jsxs(ID,{children:[u.jsx(Vj,{}),u.jsxs(Lj,{ref:a,className:Ae("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,u.jsxs(dD,{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:[u.jsx(Gd,{className:"h-4 w-4"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));zt.displayName="DialogContent";function Gt({className:e,...t}){return u.jsx("div",{className:Ae("flex flex-col space-y-1.5 text-center sm:text-left",e),...t})}function tn({className:e,...t}){return u.jsx("div",{className:Ae("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t})}const Ft=x.forwardRef(({className:e,...t},n)=>u.jsx(uD,{ref:n,className:Ae("text-subtitle leading-none tracking-tight",e),...t}));Ft.displayName="DialogTitle";const kf=x.forwardRef(({className:e,...t},n)=>u.jsx(cD,{ref:n,className:Ae("text-body text-muted-foreground",e),...t}));kf.displayName="DialogDescription";const Qj=x.forwardRef(({className:e,...t},n)=>u.jsx(Gn,{ref:n,className:Ae("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));Qj.displayName=Gn.displayName;function UD({open:e,onOpenChange:t,children:n}){return u.jsx($t,{open:e,onOpenChange:t,children:u.jsx(zt,{className:"overflow-hidden p-0 shadow-lg",children:u.jsx(Qj,{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 Gj=x.forwardRef(({className:e,...t},n)=>u.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[u.jsx(vf,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),u.jsx(Gn.Input,{ref:n,className:Ae("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})]}));Gj.displayName=Gn.Input.displayName;const Kj=x.forwardRef(({className:e,...t},n)=>u.jsx(Gn.List,{ref:n,className:Ae("max-h-[var(--sp-75)] overflow-y-auto overflow-x-hidden",e),...t}));Kj.displayName=Gn.List.displayName;const Yj=x.forwardRef((e,t)=>u.jsx(Gn.Empty,{ref:t,className:"py-6 text-center text-body",...e}));Yj.displayName=Gn.Empty.displayName;const Fd=x.forwardRef(({className:e,...t},n)=>u.jsx(Gn.Group,{ref:n,className:Ae("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}));Fd.displayName=Gn.Group.displayName;const Sg=x.forwardRef(({className:e,...t},n)=>u.jsx(Gn.Separator,{ref:n,className:Ae("-mx-1 h-px bg-border",e),...t}));Sg.displayName=Gn.Separator.displayName;const qd=x.forwardRef(({className:e,...t},n)=>u.jsx(Gn.Item,{ref:n,className:Ae("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}));qd.displayName=Gn.Item.displayName;function Ku(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 ke.get(`/admin/agents${n?`?${n}`:""}`)}function PD(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 ke.get(`/admin/agents/all${n?`?${n}`:""}`)}function Xj(e){return ke.get(`/admin/agents/${encodeURIComponent(e)}`)}function BD(e){return ke.post("/admin/agents",e)}function $D(e){return ke.get(`/admin/agents/names/${encodeURIComponent(e)}/availability`)}function K1(e,t){return ke.patch(`/admin/agents/${encodeURIComponent(e)}`,t)}function FD(e,t){return ke.patch(`/admin/agents/${encodeURIComponent(e)}/rebind`,t)}function qD(e){return ke.delete(`/admin/agents/${encodeURIComponent(e)}`)}function HD(e){return ke.post(`/admin/agents/${encodeURIComponent(e)}/suspend`,{})}function ZD(e){return ke.post(`/admin/agents/${encodeURIComponent(e)}/reactivate`,{})}function VD(e){return ke.post(`/admin/agents/${encodeURIComponent(e)}/test`,{})}function Cl(){const{data:e}=He({queryKey:["agents","name-map"],queryFn:()=>Ku({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 wy(){const{data:e}=He({queryKey:["agents","name-map"],queryFn:()=>Ku({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 QD=[{path:"/",label:"Workspace"},{path:"/agents",label:"Agents"},{path:"/clients",label:"Computers"},{path:"/settings",label:"Settings"},{path:"/admin",label:"Admin"}];function GD({open:e,onOpenChange:t}){const n=dn(),a=Cl(),{data:l}=He({queryKey:["activity"],queryFn:Qu,enabled:e,staleTime:3e4}),o=(l==null?void 0:l.agents)??[],f=He({queryKey:["palette-sessions",o.map(h=>h.agentId).join(",")],queryFn:async()=>{const h=[];for(const y of o)try{const g=await eo(y.agentId);for(const b of g)h.push({agentId:y.agentId,session:b})}catch{}return h},enabled:e&&o.length>0,staleTime:3e4}).data??[],m=h=>{t(!1),n(h)};return u.jsxs(UD,{open:e,onOpenChange:t,children:[u.jsx(Gj,{placeholder:"Jump to agent, chat, or page…"}),u.jsxs(Kj,{children:[u.jsx(Yj,{children:"No results"}),o.length>0&&u.jsx(Fd,{heading:"Agents",children:o.map(h=>{const y=a(h.agentId);return u.jsxs(qd,{value:`agent ${y} ${h.agentId}`,onSelect:()=>m(`/?a=${h.agentId}`),children:[u.jsx(TR,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),u.jsx("span",{className:"flex-1 truncate",children:y}),u.jsx("span",{className:"text-caption text-muted-foreground font-mono ml-2",children:h.agentId.slice(0,8)})]},h.agentId)})}),f.length>0&&u.jsxs(u.Fragment,{children:[u.jsx(Sg,{}),u.jsx(Fd,{heading:"Chats",children:f.map(({agentId:h,session:y})=>{const g=a(h);return u.jsxs(qd,{value:`chat ${g} ${y.chatId}`,onSelect:()=>m(`/?a=${h}&c=${y.chatId}`),children:[u.jsx(dy,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),u.jsx("span",{className:"flex-1 truncate",children:g}),u.jsx("span",{className:"text-caption text-muted-foreground font-mono ml-2",children:y.chatId.slice(0,8)})]},`${h}-${y.chatId}`)})})]}),u.jsx(Sg,{}),u.jsx(Fd,{heading:"Pages",children:QD.map(h=>u.jsxs(qd,{value:`page ${h.label}`,onSelect:()=>m(h.path),children:[u.jsx($R,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),u.jsx("span",{children:h.label})]},h.path))})]})]})}function KD(e,t){return t?e.filter(n=>n.userId===t&&n.status==="disconnected"&&n.agentCount>0):[]}function YD(){var a;const{user:e}=qt(),{data:t}=He({queryKey:["clients"],queryFn:Ra,refetchInterval:1e4,enabled:!!e});if(!t||!e)return{rows:[],firstHostname:null};const n=KD(t,e.id);return{rows:n,firstHostname:((a=n[0])==null?void 0:a.hostname)??null}}const XD=160;function JD(){const e=dn(),{rows:t,firstHostname:n}=YD();if(t.length===0)return null;const a=t.length>1,l=a?`${t.length} computers disconnected. Click to manage.`:`${n??"Your computer"} is disconnected. Click to manage.`;return u.jsxs("button",{type:"button",onClick:()=>e("/clients"),title:l,"aria-label":l,className:"inline-flex items-center cursor-pointer text-body font-medium",style:{gap:8,height:26,padding:"0 var(--sp-2_5) 0 var(--sp-2_25)",borderRadius:999,border:0,outline:"var(--hairline) solid color-mix(in oklch, var(--state-error) 38%, transparent)",outlineOffset:-1,background:"color-mix(in oklch, var(--state-error) 14%, transparent)",color:"color-mix(in oklch, var(--state-error) 80%, var(--fg))",minWidth:0},children:[u.jsx(WD,{}),a?u.jsxs("span",{style:{fontVariantNumeric:"tabular-nums"},children:[u.jsx("span",{className:"font-semibold",children:t.length})," computers disconnected"]}):u.jsxs("span",{className:"inline-flex items-center",style:{gap:5,minWidth:0},children:[u.jsx("span",{className:"mono text-label font-medium",style:{maxWidth:XD,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"color-mix(in oklch, var(--state-error) 60%, var(--fg))"},children:n??"computer"}),u.jsx("span",{style:{flexShrink:0},children:"disconnected"})]})]})}function WD(){return u.jsxs("span",{"aria-hidden":"true",style:{position:"relative",width:8,height:8,flexShrink:0,display:"inline-block"},children:[u.jsx("span",{style:{position:"absolute",inset:0,borderRadius:"50%",background:"var(--state-error)"}}),u.jsx("span",{style:{position:"absolute",inset:-3,borderRadius:"50%",border:"var(--hairline) solid var(--state-error)",animation:"ring-pulse 1.8s infinite",opacity:.6}})]})}function to(e){return u.jsxs("svg",{viewBox:"0 0 9 10",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",shapeRendering:"crispEdges","aria-hidden":"true",...e,children:[u.jsx("rect",{x:"4",y:"0",width:"1",height:"1"}),u.jsx("rect",{x:"3",y:"1",width:"3",height:"1"}),u.jsx("rect",{x:"2",y:"2",width:"5",height:"1"}),u.jsx("rect",{x:"3",y:"3",width:"3",height:"1"}),u.jsx("rect",{x:"2",y:"4",width:"5",height:"1"}),u.jsx("rect",{x:"1",y:"5",width:"7",height:"1"}),u.jsx("rect",{x:"2",y:"6",width:"5",height:"1"}),u.jsx("rect",{x:"1",y:"7",width:"7",height:"1"}),u.jsx("rect",{x:"0",y:"8",width:"9",height:"1"}),u.jsx("rect",{x:"3",y:"9",width:"3",height:"1"})]})}function kg(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 ke.get(`/admin/notifications${n?`?${n}`:""}`)}function Jj(e){return ke.post(`/admin/notifications/${e}/read`)}function eM(){return ke.post("/admin/notifications/read-all")}const tM={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 nM(e){switch(e){case"high":return"var(--state-error)";case"medium":return"var(--state-blocked)";default:return"var(--accent-dim)"}}function Wj({notification:e,onClick:t,clickable:n}){const a=(tM[e.type]??e.type).toString(),l=nM(e.severity),o=n??!0;return u.jsxs("button",{type:"button",onClick:t,className:Ae("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:c=>{o&&(c.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:c=>{c.currentTarget.style.background=e.read?"transparent":"var(--bg-sunken)"},children:[u.jsxs("div",{className:"flex items-baseline justify-between",style:{gap:8},children:[u.jsx("span",{className:"mono uppercase text-label",style:{color:e.severity==="high"?"var(--state-error)":"var(--fg-3)"},children:a.replace("_"," ")}),u.jsx("span",{className:"mono text-label",style:{color:"var(--fg-4)",whiteSpace:"nowrap"},children:Ni(e.createdAt)})]}),u.jsx("div",{style:{color:"var(--fg-2)",marginTop:1,wordBreak:"break-word"},children:e.message})]})}function rM(){var w;const[e,t]=x.useState(!1),[n,a]=x.useState(null),l=x.useRef(null),o=dn(),c=jn(),{data:f}=He({queryKey:["notifications","bell"],queryFn:()=>kg({limit:8}),refetchInterval:1e4}),{data:m}=He({queryKey:["notifications","unread-count"],queryFn:()=>kg({read:!1,limit:100}),refetchInterval:1e4}),h=((w=m==null?void 0:m.items)==null?void 0:w.length)??0,y=h>0,g=x.useCallback(async k=>{k.read||(Jj(k.id).catch(()=>{}),c.invalidateQueries({queryKey:["notifications"]})),t(!1),k.agentId&&k.chatId?o(`/?a=${k.agentId}&c=${k.chatId}`):k.agentId&&o(`/?a=${k.agentId}`)},[o,c]),b=x.useCallback(async()=>{a(null);try{await eM(),await c.invalidateQueries({queryKey:["notifications"]})}catch(k){a(k instanceof Error?k.message:"Failed to mark all as read")}},[c]);return u.jsxs("div",{className:"relative",children:[u.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:[u.jsx(NR,{className:"h-4 w-4"}),y&&u.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&&u.jsxs(u.Fragment,{children:[u.jsx("button",{type:"button",className:"fixed inset-0 z-40 cursor-default",onClick:()=>t(!1)}),u.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:[u.jsxs("div",{className:"flex items-center justify-between",style:{padding:"var(--sp-2) var(--sp-3)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[u.jsx("span",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-4)"},children:"Notifications"}),y&&u.jsx("button",{type:"button",onClick:b,className:"hover:underline text-body",style:{color:"var(--accent)"},children:"Mark all read"})]}),n&&u.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}),u.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?u.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=>u.jsx(Wj,{notification:k,clickable:!!k.agentId,onClick:()=>g(k)},k.id))})]})]})]})}function aM(){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 iM(){const[e,t]=x.useState(aM);return x.useEffect(()=>{document.documentElement.classList.toggle("dark",e==="dark"),window.localStorage.setItem("theme",e)},[e]),u.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 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",children:e==="dark"?u.jsx(fz,{className:"h-4 w-4"}):u.jsx(YR,{className:"h-4 w-4"})})}function lM(e){var n;const t=e.trim();return t?((n=t[0])==null?void 0:n.toUpperCase())??"?":"?"}function Y1({src:e,name:t,size:n=28,className:a}){const l=`${n}px`;return e?u.jsx("img",{src:e,alt:t,width:n,height:n,className:a,style:{width:l,height:l,borderRadius:"50%",objectFit:"cover",display:"block"}}):u.jsx("span",{className:a,role:"img","aria-label":t,style:{width:l,height:l,borderRadius:"50%",background:"var(--accent)",color:"var(--bg-raised)",display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:1,userSelect:"none"},children:u.jsx("span",{className:"text-subtitle font-semibold",children:lM(t)})})}const X1=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,J1=Ik,sM=(e,t)=>n=>{var a;if((t==null?void 0:t.variants)==null)return J1(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:l,defaultVariants:o}=t,c=Object.keys(l).map(h=>{const y=n==null?void 0:n[h],g=o==null?void 0:o[h];if(y===null)return null;const b=X1(y)||X1(g);return l[h][b]}),f=n&&Object.entries(n).reduce((h,y)=>{let[g,b]=y;return b===void 0||(h[g]=b),h},{}),m=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((h,y)=>{let{class:g,className:b,...w}=y;return Object.entries(w).every(k=>{let[j,E]=k;return Array.isArray(E)?E.includes({...o,...f}[j]):{...o,...f}[j]===E})?[...h,g,b]:h},[]);return J1(e,c,m,n==null?void 0:n.class,n==null?void 0:n.className)},oM=sM("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"}}),me=x.forwardRef(({className:e,variant:t,size:n,asChild:a=!1,...l},o)=>{const c=a?mD:"button";return u.jsx(c,{className:Ae(oM({variant:t,size:n,className:e})),ref:o,...l})});me.displayName="Button";const jt=x.forwardRef(({className:e,type:t,...n},a)=>u.jsx("input",{type:t,className:Ae("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}));jt.displayName="Input";function uM({action:e,onClose:t}){const n=e!==null;return u.jsx($t,{open:n,onOpenChange:a=>!a&&t(),children:u.jsxs(zt,{children:[u.jsxs(Gt,{children:[u.jsx(Ft,{children:e==="join"?"Join a team":"Create a new team"}),u.jsx(kf,{children:e==="join"?"Paste the invite token shared with you.":"You'll be the admin. You can rename or invite teammates afterward."})]}),e==="create"&&u.jsx(dM,{onDone:t}),e==="join"&&u.jsx(fM,{onDone:t})]})})}function cM(e){return e.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").slice(0,40)||"team"}function dM({onDone:e}){const{adoptTokens:t}=qt(),n=dn(),[a,l]=x.useState(""),[o,c]=x.useState(null),[f,m]=x.useState(!1);x.useEffect(()=>{l(""),c(null),m(!1)},[]);const h=async y=>{y.preventDefault();const g=a.trim();if(g){m(!0),c(null);try{const b=await ke.post("/me/organizations",{name:cM(g),displayName:g});await t(b.tokens),e(),n("/",{replace:!0})}catch(b){c(b instanceof Error?b.message:"Failed to create team")}finally{m(!1)}}};return u.jsxs("form",{className:"space-y-3",onSubmit:h,children:[o&&u.jsx("div",{className:"rounded-md bg-destructive/10 p-2 text-label text-destructive",children:o}),u.jsx(jt,{id:"team-display-name","aria-label":"Team name",value:a,onChange:y=>l(y.target.value),placeholder:"Acme Robotics",autoFocus:!0}),u.jsx(me,{type:"submit",className:"w-full",disabled:f||!a.trim(),children:f?"Creating…":"Create team"})]})}function fM({onDone:e}){const{adoptTokens:t}=qt(),n=dn(),[a,l]=x.useState(""),[o,c]=x.useState(null),[f,m]=x.useState(!1);x.useEffect(()=>{l(""),c(null),m(!1)},[]);const h=async y=>{if(y.preventDefault(),!!a.trim()){m(!0),c(null);try{const g=a.trim(),b=/\/invite\/([^/?#]+)/.exec(g),w=(b==null?void 0:b[1])??g,k=await ke.post("/me/organizations/join",{token:w});await t(k.tokens),e(),n("/",{replace:!0})}catch(g){c(g instanceof Error?g.message:"Failed to join team")}finally{m(!1)}}};return u.jsxs("form",{className:"space-y-3",onSubmit:h,children:[o&&u.jsx("div",{className:"rounded-md bg-destructive/10 p-2 text-label text-destructive",children:o}),u.jsx(jt,{id:"join-token","aria-label":"Invite token or full URL",value:a,onChange:y=>l(y.target.value),placeholder:"abc123… or https://hub/invite/abc123",autoFocus:!0}),u.jsx(me,{type:"submit",className:"w-full",disabled:f||!a.trim(),children:f?"Joining…":"Join team"})]})}function hM(){var N;const{organizationId:e,user:t,adoptTokens:n,logout:a}=qt(),l=dn(),[o,c]=x.useState([]),[f,m]=x.useState(!1),[h,y]=x.useState(null),g=x.useRef(null);x.useEffect(()=>{(async()=>{try{const z=await ke.get("/me/organizations");c(z)}catch{}})()},[]),x.useEffect(()=>{const z=D=>{f&&g.current&&!g.current.contains(D.target)&&m(!1)},U=D=>{f&&D.key==="Escape"&&m(!1)};return window.addEventListener("mousedown",z),window.addEventListener("keydown",U),()=>{window.removeEventListener("mousedown",z),window.removeEventListener("keydown",U)}},[f]);const b=(t==null?void 0:t.displayName)??"User",w=(t==null?void 0:t.username)??"",k=(t==null?void 0:t.avatarUrl)??null,j=async z=>{if(z===e){m(!1);return}try{const U=await ke.post("/auth/switch-org",{organizationId:z});await n(U),m(!1),l("/",{replace:!0})}catch{}},E=()=>{m(!1),y("create")},C=()=>{m(!1),y("join")};return u.jsxs(u.Fragment,{children:[u.jsxs("div",{ref:g,className:"relative","data-testid":"user-menu",children:[u.jsx("button",{type:"button","aria-label":`User menu, ${b}`,"aria-haspopup":"menu","aria-expanded":f,onClick:()=>m(z=>!z),className:"inline-flex items-center justify-center rounded-full focus:outline-none focus:ring-2 focus:ring-ring transition-shadow",style:{background:"transparent",border:f?"var(--hairline) solid var(--border)":"var(--hairline) solid transparent",padding:1,cursor:"pointer"},children:u.jsx(Y1,{src:k,name:b,size:28})}),f&&u.jsxs("div",{role:"menu",className:"absolute right-0 z-30 mt-2 rounded-md border bg-popover shadow-md",style:{width:280},children:[u.jsxs("div",{className:"flex items-center gap-3 border-b px-4 py-3",style:{borderColor:"var(--border)"},children:[u.jsx(Y1,{src:k,name:b,size:32}),u.jsxs("div",{className:"min-w-0",children:[u.jsx("div",{className:"text-subtitle font-medium truncate",style:{color:"var(--fg)"},children:b}),w&&w!==b&&u.jsxs("div",{className:"text-label text-muted-foreground truncate",children:["@",w]})]})]}),o.length>0&&u.jsxs("div",{className:"border-b py-1",style:{borderColor:"var(--border)"},children:[u.jsx("div",{className:"px-4 py-1 text-eyebrow text-muted-foreground",children:"Team"}),o.length===1?u.jsxs("div",{className:"flex w-full items-center gap-2 px-4 py-1.5 text-left text-body",style:{color:"var(--fg)"},children:[u.jsx("span",{style:{width:14,display:"inline-flex"},children:u.jsx(cr,{className:"h-3.5 w-3.5"})}),u.jsx("span",{className:"truncate",children:(N=o[0])==null?void 0:N.displayName})]}):u.jsx("div",{children:o.map(z=>u.jsxs("button",{type:"button",role:"menuitem",onClick:()=>void j(z.id),className:"flex w-full items-center gap-2 px-4 py-1.5 text-left text-body hover:bg-accent transition-colors",style:{color:"var(--fg)"},children:[u.jsx("span",{style:{width:14,display:"inline-flex"},children:z.id===e?u.jsx(cr,{className:"h-3.5 w-3.5"}):null}),u.jsx("span",{className:"truncate",children:z.displayName})]},z.id))})]}),u.jsxs("div",{className:"border-b py-1",style:{borderColor:"var(--border)"},children:[u.jsxs("button",{type:"button",role:"menuitem",onClick:E,className:"flex w-full items-center gap-2 px-4 py-1.5 text-left text-body hover:bg-accent transition-colors",style:{color:"var(--fg)"},children:[u.jsx(Jr,{className:"h-3.5 w-3.5"}),u.jsx("span",{children:"Create new team"})]}),u.jsxs("button",{type:"button",role:"menuitem",onClick:C,className:"flex w-full items-center gap-2 px-4 py-1.5 text-left text-body hover:bg-accent transition-colors",style:{color:"var(--fg)"},children:[u.jsx(xz,{className:"h-3.5 w-3.5"}),u.jsx("span",{children:"Join with invite link"})]})]}),u.jsxs("div",{className:"py-1",children:[u.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{m(!1),l("/settings")},className:"flex w-full items-center gap-2 px-4 py-1.5 text-left text-body hover:bg-accent transition-colors",style:{color:"var(--fg)"},children:[u.jsx(oz,{className:"h-3.5 w-3.5"}),u.jsx("span",{children:"Settings"})]}),u.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{m(!1),a()},className:"flex w-full items-center gap-2 px-4 py-1.5 text-left text-body hover:bg-accent transition-colors",style:{color:"var(--fg)"},children:[u.jsx(QR,{className:"h-3.5 w-3.5"}),u.jsx("span",{children:"Sign out"})]})]})]})]}),u.jsx(uM,{action:h,onClose:()=>y(null)})]})}const W1=[{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"}],mM={to:"/admin",label:"Admin",end:!1,kbd:"⌘5"};function pM(){const{role:e}=qt(),t=e==="admin",[n,a]=x.useState(!1),l=t?[...W1,mM]:W1,o=Mn(),c=o.pathname==="/"||o.search.includes("a=");return x.useEffect(()=>{const f=m=>{(m.metaKey||m.ctrlKey)&&m.key.toLowerCase()==="k"&&(m.preventDefault(),a(h=>!h))};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[]),u.jsxs("div",{className:"flex flex-col overflow-hidden",style:{height:"100vh",background:"var(--bg)"},children:[u.jsxs("header",{className:"relative shrink-0 grid items-center",style:{height:48,gridTemplateColumns:"1fr auto 1fr",gap:"var(--sp-3)",padding:"0 var(--sp-3)",borderBottom:"var(--hairline) solid var(--border)",background:"var(--bg-raised)"},children:[u.jsxs("div",{className:"flex items-center",style:{gap:"var(--sp-3_5)",justifySelf:"start",minWidth:0},children:[u.jsxs("span",{className:"flex items-center",style:{gap:10,flexShrink:0},children:[u.jsx(to,{width:16,height:18,style:{color:"var(--fg)"}}),u.jsxs("span",{className:"text-title",style:{color:"var(--fg)"},children:["First Tree"," ",u.jsx("span",{className:"font-normal",style:{color:"var(--fg-3)"},children:"Hub"})]})]}),u.jsx(JD,{})]}),u.jsx("nav",{className:"flex",style:{gap:2,pointerEvents:"none",justifySelf:"center"},children:l.map(f=>u.jsx(Ck,{to:f.to,end:f.end,style:{pointerEvents:"auto"},className:({isActive:m})=>Ae("inline-flex items-center transition-colors",m?"":"hover:text-[var(--fg)]"),children:({isActive:m})=>u.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:m?"var(--fg)":"var(--fg-3)",background:m?"var(--bg-hover)":"transparent"},children:[f.label,m&&u.jsx("span",{className:"kbd",children:f.kbd})]})},f.to))}),u.jsxs("div",{className:"flex items-center",style:{gap:6,justifySelf:"end"},children:[u.jsxs("button",{type:"button",onClick:()=>a(!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:f=>{f.currentTarget.style.color="var(--fg)"},onMouseLeave:f=>{f.currentTarget.style.color="var(--fg-3)"},children:[u.jsx(vf,{className:"h-4 w-4"}),u.jsx("span",{children:"Jump to…"}),u.jsx("span",{className:"kbd",children:"⌘K"})]}),u.jsx("span",{style:{width:1,height:18,background:"var(--border)",margin:"0 var(--sp-1)"}}),u.jsx(rM,{}),u.jsx(iM,{}),u.jsx("span",{style:{width:1,height:18,background:"var(--border)",margin:"0 var(--sp-1)"}}),u.jsx(hM,{})]})]}),u.jsx(GD,{open:n,onOpenChange:a}),c?u.jsx(fg,{}):u.jsx("main",{className:"flex-1 overflow-auto",children:u.jsx("div",{className:"p-6 mx-auto",style:{maxWidth:1280},children:u.jsx(fg,{})})})]})}function se(e,t,n){function a(f,m){if(f._zod||Object.defineProperty(f,"_zod",{value:{def:m,constr:c,traits:new Set},enumerable:!1}),f._zod.traits.has(e))return;f._zod.traits.add(e),t(f,m);const h=c.prototype,y=Object.keys(h);for(let g=0;g<y.length;g++){const b=y[g];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 c(f){var m;const h=n!=null&&n.Parent?new o:this;a(h,f),(m=h._zod).deferred??(m.deferred=[]);for(const y of h._zod.deferred)y();return h}return Object.defineProperty(c,"init",{value:a}),Object.defineProperty(c,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(c,"name",{value:e}),c}class Ns extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class eC extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const tC={};function Ai(e){return tC}function nC(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 jg(e,t){return typeof t=="bigint"?t.toString():t}function jf(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Sy(e){return e==null}function ky(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function gM(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,c=Number.parseInt(e.toFixed(o).replace(".","")),f=Number.parseInt(t.toFixed(o).replace(".",""));return c%f/10**o}const ew=Symbol("evaluating");function mt(e,t,n){let a;Object.defineProperty(e,t,{get(){if(a!==ew)return a===void 0&&(a=ew,a=n()),a},set(l){Object.defineProperty(e,t,{value:l})},configurable:!0})}function El(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Oi(...e){const t={};for(const n of e){const a=Object.getOwnPropertyDescriptors(n);Object.assign(t,a)}return Object.defineProperties({},t)}function tw(e){return JSON.stringify(e)}function yM(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const rC="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function _u(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const vM=jf(()=>{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 Zs(e){if(_u(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(_u(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function aC(e){return Zs(e)?{...e}:Array.isArray(e)?[...e]:e}const bM=new Set(["string","number","symbol"]);function Vs(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Di(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 Re(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 xM(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const wM={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 SM(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=Oi(e._zod.def,{get shape(){const c={};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&(c[f]=n.shape[f])}return El(this,"shape",c),c},checks:[]});return Di(e,o)}function kM(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=Oi(e._zod.def,{get shape(){const c={...e._zod.def.shape};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&delete c[f]}return El(this,"shape",c),c},checks:[]});return Di(e,o)}function jM(e,t){if(!Zs(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 c in t)if(Object.getOwnPropertyDescriptor(o,c)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const l=Oi(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return El(this,"shape",o),o}});return Di(e,l)}function CM(e,t){if(!Zs(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Oi(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return El(this,"shape",a),a}});return Di(e,n)}function EM(e,t){const n=Oi(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return El(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:[]});return Di(e,n)}function NM(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 c=Oi(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 El(this,"shape",m),m},checks:[]});return Di(t,c)}function _M(e,t,n){const a=Oi(t._zod.def,{get shape(){const l=t._zod.def.shape,o={...l};if(n)for(const c in n){if(!(c in o))throw new Error(`Unrecognized key: "${c}"`);n[c]&&(o[c]=new e({type:"nonoptional",innerType:l[c]}))}else for(const c in l)o[c]=new e({type:"nonoptional",innerType:l[c]});return El(this,"shape",o),o}});return Di(t,a)}function Ss(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 ks(e,t){return t.map(n=>{var a;return(a=n).path??(a.path=[]),n.path.unshift(e),n})}function Nd(e){return typeof e=="string"?e:e==null?void 0:e.message}function Ri(e,t,n){var l,o,c,f,m,h;const a={...e,path:e.path??[]};if(!e.message){const y=Nd((c=(o=(l=e.inst)==null?void 0:l._zod.def)==null?void 0:o.error)==null?void 0:c.call(o,e))??Nd((f=t==null?void 0:t.error)==null?void 0:f.call(t,e))??Nd((m=n.customError)==null?void 0:m.call(n,e))??Nd((h=n.localeError)==null?void 0:h.call(n,e))??"Invalid input";a.message=y}return delete a.inst,delete a.continue,t!=null&&t.reportInput||delete a.input,a}function jy(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Tu(...e){const[t,n,a]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:a}:{...t}}const iC=(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,jg,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},lC=se("$ZodError",iC),sC=se("$ZodError",iC,{Parent:Error});function TM(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 AM(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(c=>a({issues:c}));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 c=n,f=0;for(;f<o.path.length;){const m=o.path[f];f===o.path.length-1?(c[m]=c[m]||{_errors:[]},c[m]._errors.push(t(o))):c[m]=c[m]||{_errors:[]},c=c[m],f++}}};return a(e),n}const Cy=e=>(t,n,a,l)=>{const o=a?Object.assign(a,{async:!1}):{async:!1},c=t._zod.run({value:n,issues:[]},o);if(c instanceof Promise)throw new Ns;if(c.issues.length){const f=new((l==null?void 0:l.Err)??e)(c.issues.map(m=>Ri(m,o,Ai())));throw rC(f,l==null?void 0:l.callee),f}return c.value},Ey=e=>async(t,n,a,l)=>{const o=a?Object.assign(a,{async:!0}):{async:!0};let c=t._zod.run({value:n,issues:[]},o);if(c instanceof Promise&&(c=await c),c.issues.length){const f=new((l==null?void 0:l.Err)??e)(c.issues.map(m=>Ri(m,o,Ai())));throw rC(f,l==null?void 0:l.callee),f}return c.value},Cf=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 Ns;return o.issues.length?{success:!1,error:new(e??lC)(o.issues.map(c=>Ri(c,l,Ai())))}:{success:!0,data:o.value}},RM=Cf(sC),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(c=>Ri(c,l,Ai())))}:{success:!0,data:o.value}},zM=Ef(sC),OM=e=>(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Cy(e)(t,n,l)},DM=e=>(t,n,a)=>Cy(e)(t,n,a),MM=e=>async(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Ey(e)(t,n,l)},LM=e=>async(t,n,a)=>Ey(e)(t,n,a),IM=e=>(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Cf(e)(t,n,l)},UM=e=>(t,n,a)=>Cf(e)(t,n,a),PM=e=>async(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Ef(e)(t,n,l)},BM=e=>async(t,n,a)=>Ef(e)(t,n,a),$M=/^[cC][^\s-]{8,}$/,FM=/^[0-9a-z]+$/,qM=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,HM=/^[0-9a-vA-V]{20}$/,ZM=/^[A-Za-z0-9]{27}$/,VM=/^[a-zA-Z0-9_-]{21}$/,QM=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,GM=/^([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})$/,nw=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)$/,KM=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,YM="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function XM(){return new RegExp(YM,"u")}const JM=/^(?:(?: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])$/,WM=/^(([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}|:))$/,e4=/^((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])$/,t4=/^(([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])$/,n4=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,oC=/^[A-Za-z0-9_-]*$/,r4=/^\+[1-9]\d{6,14}$/,uC="(?:(?:\\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])))",a4=new RegExp(`^${uC}$`);function cC(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 i4(e){return new RegExp(`^${cC(e)}$`)}function l4(e){const t=cC({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(`^${uC}T(?:${a})$`)}const s4=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}$`)},o4=/^-?\d+$/,dC=/^-?\d+(?:\.\d+)?$/,u4=/^(?:true|false)$/i,c4=/^[^A-Z]*$/,d4=/^[^a-z]*$/,Kn=se("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),fC={number:"number",bigint:"bigint",object:"date"},hC=se("$ZodCheckLessThan",(e,t)=>{Kn.init(e,t);const n=fC[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})}}),mC=se("$ZodCheckGreaterThan",(e,t)=>{Kn.init(e,t);const n=fC[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})}}),f4=se("$ZodCheckMultipleOf",(e,t)=>{Kn.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):gM(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})}}),h4=se("$ZodCheckNumberFormat",(e,t)=>{var c;Kn.init(e,t),t.format=t.format||"float64";const n=(c=t.format)==null?void 0:c.includes("int"),a=n?"int":"number",[l,o]=wM[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=o4)}),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})}}),m4=se("$ZodCheckMaxLength",(e,t)=>{var n;Kn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const l=a.value;return!Sy(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 c=jy(l);a.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:l,inst:e,continue:!t.abort})}}),p4=se("$ZodCheckMinLength",(e,t)=>{var n;Kn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const l=a.value;return!Sy(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 c=jy(l);a.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:l,inst:e,continue:!t.abort})}}),g4=se("$ZodCheckLengthEquals",(e,t)=>{var n;Kn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const l=a.value;return!Sy(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 c=jy(l),f=o>t.length;a.issues.push({origin:c,...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})}}),Nf=se("$ZodCheckStringFormat",(e,t)=>{var n,a;Kn.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=()=>{})}),y4=se("$ZodCheckRegex",(e,t)=>{Nf.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})}}),v4=se("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=c4),Nf.init(e,t)}),b4=se("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=d4),Nf.init(e,t)}),x4=se("$ZodCheckIncludes",(e,t)=>{Kn.init(e,t);const n=Vs(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})}}),w4=se("$ZodCheckStartsWith",(e,t)=>{Kn.init(e,t);const n=new RegExp(`^${Vs(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})}}),S4=se("$ZodCheckEndsWith",(e,t)=>{Kn.init(e,t);const n=new RegExp(`.*${Vs(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})}}),k4=se("$ZodCheckOverwrite",(e,t)=>{Kn.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class j4{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(`
|
|
320
|
+
`).filter(c=>c),l=Math.min(...a.map(c=>c.length-c.trimStart().length)),o=a.map(c=>c.slice(l)).map(c=>" ".repeat(this.indent*2)+c);for(const c of o)this.content.push(c)}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(`
|
|
321
|
+
`))}}const C4={major:4,minor:3,patch:6},Ot=se("$ZodType",(e,t)=>{var l;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=C4;const a=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&a.unshift(e);for(const o of a)for(const c of o._zod.onattach)c(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 y=Ss(f),g;for(const b of m){if(b._zod.def.when){if(!b._zod.def.when(f))continue}else if(y)continue;const w=f.issues.length,k=b._zod.check(f);if(k instanceof Promise&&(h==null?void 0:h.async)===!1)throw new Ns;if(g||k instanceof Promise)g=(g??Promise.resolve()).then(async()=>{await k,f.issues.length!==w&&(y||(y=Ss(f,w)))});else{if(f.issues.length===w)continue;y||(y=Ss(f,w))}}return g?g.then(()=>f):f},c=(f,m,h)=>{if(Ss(f))return f.aborted=!0,f;const y=o(m,a,h);if(y instanceof Promise){if(h.async===!1)throw new Ns;return y.then(g=>e._zod.parse(g,h))}return e._zod.parse(y,h)};e._zod.run=(f,m)=>{if(m.skipChecks)return e._zod.parse(f,m);if(m.direction==="backward"){const y=e._zod.parse({value:f.value,issues:[]},{...m,skipChecks:!0});return y instanceof Promise?y.then(g=>c(g,f,m)):c(y,f,m)}const h=e._zod.parse(f,m);if(h instanceof Promise){if(m.async===!1)throw new Ns;return h.then(y=>o(y,a,m))}return o(h,a,m)}}mt(e,"~standard",()=>({validate:o=>{var c;try{const f=RM(e,o);return f.success?{value:f.data}:{issues:(c=f.error)==null?void 0:c.issues}}catch{return zM(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}))}),Ny=se("$ZodString",(e,t)=>{var n;Ot.init(e,t),e._zod.pattern=[...((n=e==null?void 0:e._zod.bag)==null?void 0:n.patterns)??[]].pop()??s4(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}}),Rt=se("$ZodStringFormat",(e,t)=>{Nf.init(e,t),Ny.init(e,t)}),E4=se("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=GM),Rt.init(e,t)}),N4=se("$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=nw(a))}else t.pattern??(t.pattern=nw());Rt.init(e,t)}),_4=se("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=KM),Rt.init(e,t)}),T4=se("$ZodURL",(e,t)=>{Rt.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})}}}),A4=se("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=XM()),Rt.init(e,t)}),R4=se("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=VM),Rt.init(e,t)}),z4=se("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=$M),Rt.init(e,t)}),O4=se("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=FM),Rt.init(e,t)}),D4=se("$ZodULID",(e,t)=>{t.pattern??(t.pattern=qM),Rt.init(e,t)}),M4=se("$ZodXID",(e,t)=>{t.pattern??(t.pattern=HM),Rt.init(e,t)}),L4=se("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=ZM),Rt.init(e,t)}),I4=se("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=l4(t)),Rt.init(e,t)}),U4=se("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=a4),Rt.init(e,t)}),P4=se("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=i4(t)),Rt.init(e,t)}),B4=se("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=QM),Rt.init(e,t)}),$4=se("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=JM),Rt.init(e,t),e._zod.bag.format="ipv4"}),F4=se("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=WM),Rt.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})}}}),q4=se("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=e4),Rt.init(e,t)}),H4=se("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=t4),Rt.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 c=Number(o);if(`${c}`!==o)throw new Error;if(c<0||c>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 pC(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Z4=se("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=n4),Rt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{pC(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function V4(e){if(!oC.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return pC(n)}const Q4=se("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=oC),Rt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{V4(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),G4=se("$ZodE164",(e,t)=>{t.pattern??(t.pattern=r4),Rt.init(e,t)});function K4(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 Y4=se("$ZodJWT",(e,t)=>{Rt.init(e,t),e._zod.check=n=>{K4(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),gC=se("$ZodNumber",(e,t)=>{Ot.init(e,t),e._zod.pattern=e._zod.bag.pattern??dC,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}}),X4=se("$ZodNumberFormat",(e,t)=>{h4.init(e,t),gC.init(e,t)}),J4=se("$ZodBoolean",(e,t)=>{Ot.init(e,t),e._zod.pattern=u4,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}}),W4=se("$ZodUnknown",(e,t)=>{Ot.init(e,t),e._zod.parse=n=>n}),e5=se("$ZodNever",(e,t)=>{Ot.init(e,t),e._zod.parse=(n,a)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function rw(e,t,n){e.issues.length&&t.issues.push(...ks(n,e.issues)),t.value[n]=e.value}const t5=se("$ZodArray",(e,t)=>{Ot.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 c=0;c<l.length;c++){const f=l[c],m=t.element._zod.run({value:f,issues:[]},a);m instanceof Promise?o.push(m.then(h=>rw(h,n,c))):rw(m,n,c)}return o.length?Promise.all(o).then(()=>n):n}});function Wd(e,t,n,a,l){if(e.issues.length){if(l&&!(n in a))return;t.issues.push(...ks(n,e.issues))}e.value===void 0?n in a&&(t.value[n]=void 0):t.value[n]=e.value}function yC(e){var a,l,o,c;const t=Object.keys(e.shape);for(const f of t)if(!((c=(o=(l=(a=e.shape)==null?void 0:a[f])==null?void 0:l._zod)==null?void 0:o.traits)!=null&&c.has("$ZodType")))throw new Error(`Invalid element at key "${f}": expected a Zod schema`);const n=xM(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function vC(e,t,n,a,l,o){const c=[],f=l.keySet,m=l.catchall._zod,h=m.def.type,y=m.optout==="optional";for(const g in t){if(f.has(g))continue;if(h==="never"){c.push(g);continue}const b=m.run({value:t[g],issues:[]},a);b instanceof Promise?e.push(b.then(w=>Wd(w,n,g,t,y))):Wd(b,n,g,t,y)}return c.length&&n.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:o}),e.length?Promise.all(e).then(()=>n):n}const n5=se("$ZodObject",(e,t)=>{Ot.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=jf(()=>yC(t));mt(e._zod,"propValues",()=>{const f=t.shape,m={};for(const h in f){const y=f[h]._zod;if(y.values){m[h]??(m[h]=new Set);for(const g of y.values)m[h].add(g)}}return m});const l=_u,o=t.catchall;let c;e._zod.parse=(f,m)=>{c??(c=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 y=[],g=c.shape;for(const b of c.keys){const w=g[b],k=w._zod.optout==="optional",j=w._zod.run({value:h[b],issues:[]},m);j instanceof Promise?y.push(j.then(E=>Wd(E,f,b,h,k))):Wd(j,f,b,h,k)}return o?vC(y,h,f,m,a.value,e):y.length?Promise.all(y).then(()=>f):f}}),r5=se("$ZodObjectJIT",(e,t)=>{n5.init(e,t);const n=e._zod.parse,a=jf(()=>yC(t)),l=b=>{var z;const w=new j4(["shape","payload","ctx"]),k=a.value,j=U=>{const D=tw(U);return`shape[${D}]._zod.run({ value: input[${D}], issues: [] }, ctx)`};w.write("const input = payload.value;");const E=Object.create(null);let C=0;for(const U of k.keys)E[U]=`key_${C++}`;w.write("const newResult = {};");for(const U of k.keys){const D=E[U],O=tw(U),M=b[U],I=((z=M==null?void 0:M._zod)==null?void 0:z.optout)==="optional";w.write(`const ${D} = ${j(U)};`),I?w.write(`
|
|
322
|
+
if (${D}.issues.length) {
|
|
323
|
+
if (${O} in input) {
|
|
324
|
+
payload.issues = payload.issues.concat(${D}.issues.map(iss => ({
|
|
325
|
+
...iss,
|
|
326
|
+
path: iss.path ? [${O}, ...iss.path] : [${O}]
|
|
327
|
+
})));
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
if (${D}.value === undefined) {
|
|
332
|
+
if (${O} in input) {
|
|
333
|
+
newResult[${O}] = undefined;
|
|
334
|
+
}
|
|
335
|
+
} else {
|
|
336
|
+
newResult[${O}] = ${D}.value;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
`):w.write(`
|
|
340
|
+
if (${D}.issues.length) {
|
|
341
|
+
payload.issues = payload.issues.concat(${D}.issues.map(iss => ({
|
|
342
|
+
...iss,
|
|
343
|
+
path: iss.path ? [${O}, ...iss.path] : [${O}]
|
|
344
|
+
})));
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
if (${D}.value === undefined) {
|
|
348
|
+
if (${O} in input) {
|
|
349
|
+
newResult[${O}] = undefined;
|
|
350
|
+
}
|
|
351
|
+
} else {
|
|
352
|
+
newResult[${O}] = ${D}.value;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
`)}w.write("payload.value = newResult;"),w.write("return payload;");const N=w.compile();return(U,D)=>N(b,U,D)};let o;const c=_u,f=!tC.jitless,h=f&&vM.value,y=t.catchall;let g;e._zod.parse=(b,w)=>{g??(g=a.value);const k=b.value;return c(k)?f&&h&&(w==null?void 0:w.async)===!1&&w.jitless!==!0?(o||(o=l(t.shape)),b=o(b,w),y?vC([],k,b,w,g,e):b):n(b,w):(b.issues.push({expected:"object",code:"invalid_type",input:k,inst:e}),b)}});function aw(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=>!Ss(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(c=>Ri(c,a,Ai())))}),t)}const bC=se("$ZodUnion",(e,t)=>{Ot.init(e,t),mt(e._zod,"optin",()=>t.options.some(l=>l._zod.optin==="optional")?"optional":void 0),mt(e._zod,"optout",()=>t.options.some(l=>l._zod.optout==="optional")?"optional":void 0),mt(e._zod,"values",()=>{if(t.options.every(l=>l._zod.values))return new Set(t.options.flatMap(l=>Array.from(l._zod.values)))}),mt(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=>ky(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 c=!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),c=!0;else{if(h.issues.length===0)return h;f.push(h)}}return c?Promise.all(f).then(m=>aw(m,l,e,o)):aw(f,l,e,o)}}),a5=se("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,bC.init(e,t);const n=e._zod.parse;mt(e._zod,"propValues",()=>{const l={};for(const o of t.options){const c=o._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(const[f,m]of Object.entries(c)){l[f]||(l[f]=new Set);for(const h of m)l[f].add(h)}}return l});const a=jf(()=>{var c;const l=t.options,o=new Map;for(const f of l){const m=(c=f._zod.propValues)==null?void 0:c[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 c=l.value;if(!_u(c))return l.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),l;const f=a.value.get(c==null?void 0:c[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:c,path:[t.discriminator],inst:e}),l)}}),i5=se("$ZodIntersection",(e,t)=>{Ot.init(e,t),e._zod.parse=(n,a)=>{const l=n.value,o=t.left._zod.run({value:l,issues:[]},a),c=t.right._zod.run({value:l,issues:[]},a);return o instanceof Promise||c instanceof Promise?Promise.all([o,c]).then(([m,h])=>iw(n,m,h)):iw(n,o,c)}});function Cg(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(Zs(e)&&Zs(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 c=Cg(e[o],t[o]);if(!c.valid)return{valid:!1,mergeErrorPath:[o,...c.mergeErrorPath]};l[o]=c.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],c=Cg(l,o);if(!c.valid)return{valid:!1,mergeErrorPath:[a,...c.mergeErrorPath]};n.push(c.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function iw(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}),Ss(e))return e;const c=Cg(t.value,n.value);if(!c.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`);return e.value=c.data,e}const l5=se("$ZodRecord",(e,t)=>{Ot.init(e,t),e._zod.parse=(n,a)=>{const l=n.value;if(!Zs(l))return n.issues.push({expected:"record",code:"invalid_type",input:l,inst:e}),n;const o=[],c=t.keyType._zod.values;if(c){n.value={};const f=new Set;for(const h of c)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){f.add(typeof h=="number"?h.toString():h);const y=t.valueType._zod.run({value:l[h],issues:[]},a);y instanceof Promise?o.push(y.then(g=>{g.issues.length&&n.issues.push(...ks(h,g.issues)),n.value[h]=g.value})):(y.issues.length&&n.issues.push(...ks(h,y.issues)),n.value[h]=y.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"&&dC.test(f)&&m.issues.length){const g=t.keyType._zod.run({value:Number(f),issues:[]},a);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");g.issues.length===0&&(m=g)}if(m.issues.length){t.mode==="loose"?n.value[f]=l[f]:n.issues.push({code:"invalid_key",origin:"record",issues:m.issues.map(g=>Ri(g,a,Ai())),input:f,path:[f],inst:e});continue}const y=t.valueType._zod.run({value:l[f],issues:[]},a);y instanceof Promise?o.push(y.then(g=>{g.issues.length&&n.issues.push(...ks(f,g.issues)),n.value[m.value]=g.value})):(y.issues.length&&n.issues.push(...ks(f,y.issues)),n.value[m.value]=y.value)}}return o.length?Promise.all(o).then(()=>n):n}}),s5=se("$ZodEnum",(e,t)=>{Ot.init(e,t);const n=nC(t.entries),a=new Set(n);e._zod.values=a,e._zod.pattern=new RegExp(`^(${n.filter(l=>bM.has(typeof l)).map(l=>typeof l=="string"?Vs(l):l.toString()).join("|")})$`),e._zod.parse=(l,o)=>{const c=l.value;return a.has(c)||l.issues.push({code:"invalid_value",values:n,input:c,inst:e}),l}}),o5=se("$ZodLiteral",(e,t)=>{if(Ot.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"?Vs(a):a?Vs(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}}),u5=se("$ZodTransform",(e,t)=>{Ot.init(e,t),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new eC(e.constructor.name);const l=t.transform(n.value,n);if(a.async)return(l instanceof Promise?l:Promise.resolve(l)).then(c=>(n.value=c,n));if(l instanceof Promise)throw new Ns;return n.value=l,n}});function lw(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const xC=se("$ZodOptional",(e,t)=>{Ot.init(e,t),e._zod.optin="optional",e._zod.optout="optional",mt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),mt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${ky(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=>lw(o,n.value)):lw(l,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,a)}}),c5=se("$ZodExactOptional",(e,t)=>{xC.init(e,t),mt(e._zod,"values",()=>t.innerType._zod.values),mt(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,a)=>t.innerType._zod.run(n,a)}),d5=se("$ZodNullable",(e,t)=>{Ot.init(e,t),mt(e._zod,"optin",()=>t.innerType._zod.optin),mt(e._zod,"optout",()=>t.innerType._zod.optout),mt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${ky(n.source)}|null)$`):void 0}),mt(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)}),f5=se("$ZodDefault",(e,t)=>{Ot.init(e,t),e._zod.optin="optional",mt(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=>sw(o,t)):sw(l,t)}});function sw(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const h5=se("$ZodPrefault",(e,t)=>{Ot.init(e,t),e._zod.optin="optional",mt(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))}),m5=se("$ZodNonOptional",(e,t)=>{Ot.init(e,t),mt(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=>ow(o,e)):ow(l,e)}});function ow(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 p5=se("$ZodCatch",(e,t)=>{Ot.init(e,t),mt(e._zod,"optin",()=>t.innerType._zod.optin),mt(e._zod,"optout",()=>t.innerType._zod.optout),mt(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(c=>Ri(c,a,Ai()))},input:n.value}),n.issues=[]),n)):(n.value=l.value,l.issues.length&&(n.value=t.catchValue({...n,error:{issues:l.issues.map(o=>Ri(o,a,Ai()))},input:n.value}),n.issues=[]),n)}}),g5=se("$ZodPipe",(e,t)=>{Ot.init(e,t),mt(e._zod,"values",()=>t.in._zod.values),mt(e._zod,"optin",()=>t.in._zod.optin),mt(e._zod,"optout",()=>t.out._zod.optout),mt(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(c=>_d(c,t.in,a)):_d(o,t.in,a)}const l=t.in._zod.run(n,a);return l instanceof Promise?l.then(o=>_d(o,t.out,a)):_d(l,t.out,a)}});function _d(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const y5=se("$ZodReadonly",(e,t)=>{Ot.init(e,t),mt(e._zod,"propValues",()=>t.innerType._zod.propValues),mt(e._zod,"values",()=>t.innerType._zod.values),mt(e._zod,"optin",()=>{var n,a;return(a=(n=t.innerType)==null?void 0:n._zod)==null?void 0:a.optin}),mt(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(uw):uw(l)}});function uw(e){return e.value=Object.freeze(e.value),e}const v5=se("$ZodCustom",(e,t)=>{Kn.init(e,t),Ot.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=>cw(o,n,a,e));cw(l,n,a,e)}});function cw(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(Tu(l))}}var dw;class b5{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 x5(){return new b5}(dw=globalThis).__zod_globalRegistry??(dw.__zod_globalRegistry=x5());const mu=globalThis.__zod_globalRegistry;function w5(e,t){return new e({type:"string",...Re(t)})}function S5(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Re(t)})}function fw(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Re(t)})}function k5(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Re(t)})}function j5(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Re(t)})}function C5(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Re(t)})}function E5(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Re(t)})}function N5(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Re(t)})}function _5(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Re(t)})}function T5(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Re(t)})}function A5(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Re(t)})}function R5(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Re(t)})}function z5(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Re(t)})}function O5(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Re(t)})}function D5(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Re(t)})}function M5(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Re(t)})}function L5(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Re(t)})}function I5(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Re(t)})}function U5(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Re(t)})}function P5(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Re(t)})}function B5(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Re(t)})}function $5(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Re(t)})}function F5(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Re(t)})}function q5(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Re(t)})}function H5(e,t){return new e({type:"string",format:"date",check:"string_format",...Re(t)})}function Z5(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Re(t)})}function V5(e,t){return new e({type:"string",format:"duration",check:"string_format",...Re(t)})}function Q5(e,t){return new e({type:"number",checks:[],...Re(t)})}function G5(e,t){return new e({type:"number",coerce:!0,checks:[],...Re(t)})}function K5(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Re(t)})}function Y5(e,t){return new e({type:"boolean",...Re(t)})}function X5(e){return new e({type:"unknown"})}function J5(e,t){return new e({type:"never",...Re(t)})}function hw(e,t){return new hC({check:"less_than",...Re(t),value:e,inclusive:!1})}function yp(e,t){return new hC({check:"less_than",...Re(t),value:e,inclusive:!0})}function mw(e,t){return new mC({check:"greater_than",...Re(t),value:e,inclusive:!1})}function vp(e,t){return new mC({check:"greater_than",...Re(t),value:e,inclusive:!0})}function pw(e,t){return new f4({check:"multiple_of",...Re(t),value:e})}function wC(e,t){return new m4({check:"max_length",...Re(t),maximum:e})}function ef(e,t){return new p4({check:"min_length",...Re(t),minimum:e})}function SC(e,t){return new g4({check:"length_equals",...Re(t),length:e})}function W5(e,t){return new y4({check:"string_format",format:"regex",...Re(t),pattern:e})}function eL(e){return new v4({check:"string_format",format:"lowercase",...Re(e)})}function tL(e){return new b4({check:"string_format",format:"uppercase",...Re(e)})}function nL(e,t){return new x4({check:"string_format",format:"includes",...Re(t),includes:e})}function rL(e,t){return new w4({check:"string_format",format:"starts_with",...Re(t),prefix:e})}function aL(e,t){return new S4({check:"string_format",format:"ends_with",...Re(t),suffix:e})}function no(e){return new k4({check:"overwrite",tx:e})}function iL(e){return no(t=>t.normalize(e))}function lL(){return no(e=>e.trim())}function sL(){return no(e=>e.toLowerCase())}function oL(){return no(e=>e.toUpperCase())}function uL(){return no(e=>yM(e))}function cL(e,t,n){return new e({type:"array",element:t,...Re(n)})}function dL(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Re(n)})}function fL(e){const t=hL(n=>(n.addIssue=a=>{if(typeof a=="string")n.issues.push(Tu(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(Tu(l))}},e(n.value,n)));return t}function hL(e,t){const n=new Kn({check:"custom",...Re(t)});return n._zod.check=e,n}function kC(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)??mu,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 en(e,t,n={path:[],schemaPath:[]}){var y,g;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 c={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,c);const f=(g=(y=e._zod).toJSONSchema)==null?void 0:g.call(y);if(f)c.schema=f;else{const b={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,c.schema,b);else{const k=c.schema,j=t.processors[l.type];if(!j)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${l.type}`);j(e,t,k,b)}const w=e._zod.parent;w&&(c.ref||(c.ref=w),en(w,t,b),t.seen.get(w).isParent=!0)}const m=t.metadataRegistry.get(e);return m&&Object.assign(c.schema,m),t.io==="input"&&zn(e)&&(delete c.schema.examples,delete c.schema.default),t.io==="input"&&c.schema._prefault&&((a=c.schema).default??(a.default=c.schema._prefault)),delete c.schema._prefault,t.seen.get(e).schema}function jC(e,t){var c,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 y of e.seen.entries()){const g=(c=e.metadataRegistry.get(y[0]))==null?void 0:c.id;if(g){const b=a.get(g);if(b&&b!==y[0])throw new Error(`Duplicate schema id "${g}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(g,y[0])}}const l=y=>{var j;const g=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const E=(j=e.external.registry.get(y[0]))==null?void 0:j.id,C=e.external.uri??(z=>z);if(E)return{ref:C(E)};const N=y[1].defId??y[1].schema.id??`schema${e.counter++}`;return y[1].defId=N,{defId:N,ref:`${C("__shared")}#/${g}/${N}`}}if(y[1]===n)return{ref:"#"};const w=`#/${g}/`,k=y[1].schema.id??`__schema${e.counter++}`;return{defId:k,ref:w+k}},o=y=>{if(y[1].schema.$ref)return;const g=y[1],{ref:b,defId:w}=l(y);g.def={...g.schema},w&&(g.defId=w);const k=g.schema;for(const j in k)delete k[j];k.$ref=b};if(e.cycles==="throw")for(const y of e.seen.entries()){const g=y[1];if(g.cycle)throw new Error(`Cycle detected: #/${(f=g.cycle)==null?void 0:f.join("/")}/<root>
|
|
356
|
+
|
|
357
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const y of e.seen.entries()){const g=y[1];if(t===y[0]){o(y);continue}if(e.external){const w=(m=e.external.registry.get(y[0]))==null?void 0:m.id;if(t!==y[0]&&w){o(y);continue}}if((h=e.metadataRegistry.get(y[0]))==null?void 0:h.id){o(y);continue}if(g.cycle){o(y);continue}if(g.count>1&&e.reused==="ref"){o(y);continue}}}function CC(e,t){var c,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 y=e.seen.get(h);if(y.ref===null)return;const g=y.def??y.schema,b={...g},w=y.ref;if(y.ref=null,w){a(w);const j=e.seen.get(w),E=j.schema;if(E.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(g.allOf=g.allOf??[],g.allOf.push(E)):Object.assign(g,E),Object.assign(g,b),h._zod.parent===w)for(const N in g)N==="$ref"||N==="allOf"||N in b||delete g[N];if(E.$ref&&j.def)for(const N in g)N==="$ref"||N==="allOf"||N in j.def&&JSON.stringify(g[N])===JSON.stringify(j.def[N])&&delete g[N]}const k=h._zod.parent;if(k&&k!==w){a(k);const j=e.seen.get(k);if(j!=null&&j.schema.$ref&&(g.$ref=j.schema.$ref,j.def))for(const E in g)E==="$ref"||E==="allOf"||E in j.def&&JSON.stringify(g[E])===JSON.stringify(j.def[E])&&delete g[E]}e.override({zodSchema:h,jsonSchema:g,path:y.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,(c=e.external)!=null&&c.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 y=h[1];y.def&&y.defId&&(o[y.defId]=y.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:tf(t,"input",e.processors),output:tf(t,"output",e.processors)}},enumerable:!1,writable:!1}),h}catch{throw new Error("Error converting schema to JSON.")}}function zn(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 zn(a.element,n);if(a.type==="set")return zn(a.valueType,n);if(a.type==="lazy")return zn(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 zn(a.innerType,n);if(a.type==="intersection")return zn(a.left,n)||zn(a.right,n);if(a.type==="record"||a.type==="map")return zn(a.keyType,n)||zn(a.valueType,n);if(a.type==="pipe")return zn(a.in,n)||zn(a.out,n);if(a.type==="object"){for(const l in a.shape)if(zn(a.shape[l],n))return!0;return!1}if(a.type==="union"){for(const l of a.options)if(zn(l,n))return!0;return!1}if(a.type==="tuple"){for(const l of a.items)if(zn(l,n))return!0;return!!(a.rest&&zn(a.rest,n))}return!1}const mL=(e,t={})=>n=>{const a=kC({...n,processors:t});return en(e,a),jC(a,e),CC(a,e)},tf=(e,t,n={})=>a=>{const{libraryOptions:l,target:o}=a??{},c=kC({...l??{},target:o,io:t,processors:n});return en(e,c),jC(c,e),CC(c,e)},pL={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},gL=(e,t,n,a)=>{const l=n;l.type="string";const{minimum:o,maximum:c,format:f,patterns:m,contentEncoding:h}=e._zod.bag;if(typeof o=="number"&&(l.minLength=o),typeof c=="number"&&(l.maxLength=c),f&&(l.format=pL[f]??f,l.format===""&&delete l.format,f==="time"&&delete l.format),h&&(l.contentEncoding=h),m&&m.size>0){const y=[...m];y.length===1?l.pattern=y[0].source:y.length>1&&(l.allOf=[...y.map(g=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:g.source}))])}},yL=(e,t,n,a)=>{const l=n,{minimum:o,maximum:c,format:f,multipleOf:m,exclusiveMaximum:h,exclusiveMinimum:y}=e._zod.bag;typeof f=="string"&&f.includes("int")?l.type="integer":l.type="number",typeof y=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(l.minimum=y,l.exclusiveMinimum=!0):l.exclusiveMinimum=y),typeof o=="number"&&(l.minimum=o,typeof y=="number"&&t.target!=="draft-04"&&(y>=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 c=="number"&&(l.maximum=c,typeof h=="number"&&t.target!=="draft-04"&&(h<=c?delete l.maximum:delete l.exclusiveMaximum)),typeof m=="number"&&(l.multipleOf=m)},vL=(e,t,n,a)=>{n.type="boolean"},bL=(e,t,n,a)=>{n.not={}},xL=(e,t,n,a)=>{},wL=(e,t,n,a)=>{const l=e._zod.def,o=nC(l.entries);o.every(c=>typeof c=="number")&&(n.type="number"),o.every(c=>typeof c=="string")&&(n.type="string"),n.enum=o},SL=(e,t,n,a)=>{const l=e._zod.def,o=[];for(const c of l.values)if(c===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof c=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(c))}else o.push(c);if(o.length!==0)if(o.length===1){const c=o[0];n.type=c===null?"null":typeof c,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[c]:n.const=c}else o.every(c=>typeof c=="number")&&(n.type="number"),o.every(c=>typeof c=="string")&&(n.type="string"),o.every(c=>typeof c=="boolean")&&(n.type="boolean"),o.every(c=>c===null)&&(n.type="null"),n.enum=o},kL=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},jL=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},CL=(e,t,n,a)=>{const l=n,o=e._zod.def,{minimum:c,maximum:f}=e._zod.bag;typeof c=="number"&&(l.minItems=c),typeof f=="number"&&(l.maxItems=f),l.type="array",l.items=en(o.element,t,{...a,path:[...a.path,"items"]})},EL=(e,t,n,a)=>{var h;const l=n,o=e._zod.def;l.type="object",l.properties={};const c=o.shape;for(const y in c)l.properties[y]=en(c[y],t,{...a,path:[...a.path,"properties",y]});const f=new Set(Object.keys(c)),m=new Set([...f].filter(y=>{const g=o.shape[y]._zod;return t.io==="input"?g.optin===void 0:g.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=en(o.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(l.additionalProperties=!1)},NL=(e,t,n,a)=>{const l=e._zod.def,o=l.inclusive===!1,c=l.options.map((f,m)=>en(f,t,{...a,path:[...a.path,o?"oneOf":"anyOf",m]}));o?n.oneOf=c:n.anyOf=c},_L=(e,t,n,a)=>{const l=e._zod.def,o=en(l.left,t,{...a,path:[...a.path,"allOf",0]}),c=en(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(c)?c.allOf:[c]];n.allOf=m},TL=(e,t,n,a)=>{const l=n,o=e._zod.def;l.type="object";const c=o.keyType,f=c._zod.bag,m=f==null?void 0:f.patterns;if(o.mode==="loose"&&m&&m.size>0){const y=en(o.valueType,t,{...a,path:[...a.path,"patternProperties","*"]});l.patternProperties={};for(const g of m)l.patternProperties[g.source]=y}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(l.propertyNames=en(o.keyType,t,{...a,path:[...a.path,"propertyNames"]})),l.additionalProperties=en(o.valueType,t,{...a,path:[...a.path,"additionalProperties"]});const h=c._zod.values;if(h){const y=[...h].filter(g=>typeof g=="string"||typeof g=="number");y.length>0&&(l.required=y)}},AL=(e,t,n,a)=>{const l=e._zod.def,o=en(l.innerType,t,a),c=t.seen.get(e);t.target==="openapi-3.0"?(c.ref=l.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}]},RL=(e,t,n,a)=>{const l=e._zod.def;en(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType},zL=(e,t,n,a)=>{const l=e._zod.def;en(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType,n.default=JSON.parse(JSON.stringify(l.defaultValue))},OL=(e,t,n,a)=>{const l=e._zod.def;en(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)))},DL=(e,t,n,a)=>{const l=e._zod.def;en(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType;let c;try{c=l.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=c},ML=(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;en(o,t,a);const c=t.seen.get(e);c.ref=o},LL=(e,t,n,a)=>{const l=e._zod.def;en(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType,n.readOnly=!0},EC=(e,t,n,a)=>{const l=e._zod.def;en(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType},IL=se("ZodISODateTime",(e,t)=>{I4.init(e,t),Mt.init(e,t)});function UL(e){return q5(IL,e)}const PL=se("ZodISODate",(e,t)=>{U4.init(e,t),Mt.init(e,t)});function BL(e){return H5(PL,e)}const $L=se("ZodISOTime",(e,t)=>{P4.init(e,t),Mt.init(e,t)});function FL(e){return Z5($L,e)}const qL=se("ZodISODuration",(e,t)=>{B4.init(e,t),Mt.init(e,t)});function HL(e){return V5(qL,e)}const ZL=(e,t)=>{lC.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>AM(e,n)},flatten:{value:n=>TM(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,jg,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,jg,2)}},isEmpty:{get(){return e.issues.length===0}}})},Tr=se("ZodError",ZL,{Parent:Error}),VL=Cy(Tr),QL=Ey(Tr),GL=Cf(Tr),KL=Ef(Tr),YL=OM(Tr),XL=DM(Tr),JL=MM(Tr),WL=LM(Tr),eI=IM(Tr),tI=UM(Tr),nI=PM(Tr),rI=BM(Tr),Dt=se("ZodType",(e,t)=>(Ot.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:tf(e,"input"),output:tf(e,"output")}}),e.toJSONSchema=mL(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Oi(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)=>Di(e,n,a),e.brand=()=>e,e.register=((n,a)=>(n.add(e,a),e)),e.parse=(n,a)=>VL(e,n,a,{callee:e.parse}),e.safeParse=(n,a)=>GL(e,n,a),e.parseAsync=async(n,a)=>QL(e,n,a,{callee:e.parseAsync}),e.safeParseAsync=async(n,a)=>KL(e,n,a),e.spa=e.safeParseAsync,e.encode=(n,a)=>YL(e,n,a),e.decode=(n,a)=>XL(e,n,a),e.encodeAsync=async(n,a)=>JL(e,n,a),e.decodeAsync=async(n,a)=>WL(e,n,a),e.safeEncode=(n,a)=>eI(e,n,a),e.safeDecode=(n,a)=>tI(e,n,a),e.safeEncodeAsync=async(n,a)=>nI(e,n,a),e.safeDecodeAsync=async(n,a)=>rI(e,n,a),e.refine=(n,a)=>e.check(KI(n,a)),e.superRefine=n=>e.check(YI(n)),e.overwrite=n=>e.check(no(n)),e.optional=()=>vw(e),e.exactOptional=()=>LI(e),e.nullable=()=>bw(e),e.nullish=()=>vw(bw(e)),e.nonoptional=n=>FI(e,n),e.array=()=>Qn(e),e.or=n=>TC([e,n]),e.and=n=>RI(e,n),e.transform=n=>Ng(e,AC(n)),e.default=n=>PI(e,n),e.prefault=n=>$I(e,n),e.catch=n=>HI(e,n),e.pipe=n=>Ng(e,n),e.readonly=()=>QI(e),e.describe=n=>{const a=e.clone();return mu.add(a,{description:n}),a},Object.defineProperty(e,"description",{get(){var n;return(n=mu.get(e))==null?void 0:n.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return mu.get(e);const a=e.clone();return mu.add(a,n[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),NC=se("_ZodString",(e,t)=>{Ny.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(a,l,o)=>gL(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(W5(...a)),e.includes=(...a)=>e.check(nL(...a)),e.startsWith=(...a)=>e.check(rL(...a)),e.endsWith=(...a)=>e.check(aL(...a)),e.min=(...a)=>e.check(ef(...a)),e.max=(...a)=>e.check(wC(...a)),e.length=(...a)=>e.check(SC(...a)),e.nonempty=(...a)=>e.check(ef(1,...a)),e.lowercase=a=>e.check(eL(a)),e.uppercase=a=>e.check(tL(a)),e.trim=()=>e.check(lL()),e.normalize=(...a)=>e.check(iL(...a)),e.toLowerCase=()=>e.check(sL()),e.toUpperCase=()=>e.check(oL()),e.slugify=()=>e.check(uL())}),aI=se("ZodString",(e,t)=>{Ny.init(e,t),NC.init(e,t),e.email=n=>e.check(S5(iI,n)),e.url=n=>e.check(N5(lI,n)),e.jwt=n=>e.check(F5(wI,n)),e.emoji=n=>e.check(_5(sI,n)),e.guid=n=>e.check(fw(gw,n)),e.uuid=n=>e.check(k5(Td,n)),e.uuidv4=n=>e.check(j5(Td,n)),e.uuidv6=n=>e.check(C5(Td,n)),e.uuidv7=n=>e.check(E5(Td,n)),e.nanoid=n=>e.check(T5(oI,n)),e.guid=n=>e.check(fw(gw,n)),e.cuid=n=>e.check(A5(uI,n)),e.cuid2=n=>e.check(R5(cI,n)),e.ulid=n=>e.check(z5(dI,n)),e.base64=n=>e.check(P5(vI,n)),e.base64url=n=>e.check(B5(bI,n)),e.xid=n=>e.check(O5(fI,n)),e.ksuid=n=>e.check(D5(hI,n)),e.ipv4=n=>e.check(M5(mI,n)),e.ipv6=n=>e.check(L5(pI,n)),e.cidrv4=n=>e.check(I5(gI,n)),e.cidrv6=n=>e.check(U5(yI,n)),e.e164=n=>e.check($5(xI,n)),e.datetime=n=>e.check(UL(n)),e.date=n=>e.check(BL(n)),e.time=n=>e.check(FL(n)),e.duration=n=>e.check(HL(n))});function R(e){return w5(aI,e)}const Mt=se("ZodStringFormat",(e,t)=>{Rt.init(e,t),NC.init(e,t)}),iI=se("ZodEmail",(e,t)=>{_4.init(e,t),Mt.init(e,t)}),gw=se("ZodGUID",(e,t)=>{E4.init(e,t),Mt.init(e,t)}),Td=se("ZodUUID",(e,t)=>{N4.init(e,t),Mt.init(e,t)}),lI=se("ZodURL",(e,t)=>{T4.init(e,t),Mt.init(e,t)}),sI=se("ZodEmoji",(e,t)=>{A4.init(e,t),Mt.init(e,t)}),oI=se("ZodNanoID",(e,t)=>{R4.init(e,t),Mt.init(e,t)}),uI=se("ZodCUID",(e,t)=>{z4.init(e,t),Mt.init(e,t)}),cI=se("ZodCUID2",(e,t)=>{O4.init(e,t),Mt.init(e,t)}),dI=se("ZodULID",(e,t)=>{D4.init(e,t),Mt.init(e,t)}),fI=se("ZodXID",(e,t)=>{M4.init(e,t),Mt.init(e,t)}),hI=se("ZodKSUID",(e,t)=>{L4.init(e,t),Mt.init(e,t)}),mI=se("ZodIPv4",(e,t)=>{$4.init(e,t),Mt.init(e,t)}),pI=se("ZodIPv6",(e,t)=>{F4.init(e,t),Mt.init(e,t)}),gI=se("ZodCIDRv4",(e,t)=>{q4.init(e,t),Mt.init(e,t)}),yI=se("ZodCIDRv6",(e,t)=>{H4.init(e,t),Mt.init(e,t)}),vI=se("ZodBase64",(e,t)=>{Z4.init(e,t),Mt.init(e,t)}),bI=se("ZodBase64URL",(e,t)=>{Q4.init(e,t),Mt.init(e,t)}),xI=se("ZodE164",(e,t)=>{G4.init(e,t),Mt.init(e,t)}),wI=se("ZodJWT",(e,t)=>{Y4.init(e,t),Mt.init(e,t)}),_y=se("ZodNumber",(e,t)=>{gC.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(a,l,o)=>yL(e,a,l),e.gt=(a,l)=>e.check(mw(a,l)),e.gte=(a,l)=>e.check(vp(a,l)),e.min=(a,l)=>e.check(vp(a,l)),e.lt=(a,l)=>e.check(hw(a,l)),e.lte=(a,l)=>e.check(yp(a,l)),e.max=(a,l)=>e.check(yp(a,l)),e.int=a=>e.check(yw(a)),e.safe=a=>e.check(yw(a)),e.positive=a=>e.check(mw(0,a)),e.nonnegative=a=>e.check(vp(0,a)),e.negative=a=>e.check(hw(0,a)),e.nonpositive=a=>e.check(yp(0,a)),e.multipleOf=(a,l)=>e.check(pw(a,l)),e.step=(a,l)=>e.check(pw(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 Ke(e){return Q5(_y,e)}const SI=se("ZodNumberFormat",(e,t)=>{X4.init(e,t),_y.init(e,t)});function yw(e){return K5(SI,e)}const kI=se("ZodBoolean",(e,t)=>{J4.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>vL(e,n,a)});function Wr(e){return Y5(kI,e)}const jI=se("ZodUnknown",(e,t)=>{W4.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>xL()});function St(){return X5(jI)}const CI=se("ZodNever",(e,t)=>{e5.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>bL(e,n,a)});function EI(e){return J5(CI,e)}const NI=se("ZodArray",(e,t)=>{t5.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>CL(e,n,a,l),e.element=t.element,e.min=(n,a)=>e.check(ef(n,a)),e.nonempty=n=>e.check(ef(1,n)),e.max=(n,a)=>e.check(wC(n,a)),e.length=(n,a)=>e.check(SC(n,a)),e.unwrap=()=>e.element});function Qn(e,t){return cL(NI,e,t)}const _I=se("ZodObject",(e,t)=>{r5.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>EL(e,n,a,l),mt(e,"shape",()=>t.shape),e.keyof=()=>Ge(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:St()}),e.loose=()=>e.clone({...e._zod.def,catchall:St()}),e.strict=()=>e.clone({...e._zod.def,catchall:EI()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>jM(e,n),e.safeExtend=n=>CM(e,n),e.merge=n=>EM(e,n),e.pick=n=>SM(e,n),e.omit=n=>kM(e,n),e.partial=(...n)=>NM(RC,e,n[0]),e.required=(...n)=>_M(zC,e,n[0])});function fe(e,t){const n={type:"object",shape:e??{},...Re(t)};return new _I(n)}const _C=se("ZodUnion",(e,t)=>{bC.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>NL(e,n,a,l),e.options=t.options});function TC(e,t){return new _C({type:"union",options:e,...Re(t)})}const TI=se("ZodDiscriminatedUnion",(e,t)=>{_C.init(e,t),a5.init(e,t)});function Ty(e,t,n){return new TI({type:"union",options:t,discriminator:e,...Re(n)})}const AI=se("ZodIntersection",(e,t)=>{i5.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>_L(e,n,a,l)});function RI(e,t){return new AI({type:"intersection",left:e,right:t})}const zI=se("ZodRecord",(e,t)=>{l5.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>TL(e,n,a,l),e.keyType=t.keyType,e.valueType=t.valueType});function Ht(e,t,n){return new zI({type:"record",keyType:e,valueType:t,...Re(n)})}const Eg=se("ZodEnum",(e,t)=>{s5.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(a,l,o)=>wL(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 c of a)if(n.has(c))o[c]=t.entries[c];else throw new Error(`Key ${c} not found in enum`);return new Eg({...t,checks:[],...Re(l),entries:o})},e.exclude=(a,l)=>{const o={...t.entries};for(const c of a)if(n.has(c))delete o[c];else throw new Error(`Key ${c} not found in enum`);return new Eg({...t,checks:[],...Re(l),entries:o})}});function Ge(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new Eg({type:"enum",entries:n,...Re(t)})}const OI=se("ZodLiteral",(e,t)=>{o5.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>SL(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 ln(e,t){return new OI({type:"literal",values:Array.isArray(e)?e:[e],...Re(t)})}const DI=se("ZodTransform",(e,t)=>{u5.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>jL(e,n),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new eC(e.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(Tu(o,n.value,t));else{const c=o;c.fatal&&(c.continue=!1),c.code??(c.code="custom"),c.input??(c.input=n.value),c.inst??(c.inst=e),n.issues.push(Tu(c))}};const l=t.transform(n.value,n);return l instanceof Promise?l.then(o=>(n.value=o,n)):(n.value=l,n)}});function AC(e){return new DI({type:"transform",transform:e})}const RC=se("ZodOptional",(e,t)=>{xC.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>EC(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function vw(e){return new RC({type:"optional",innerType:e})}const MI=se("ZodExactOptional",(e,t)=>{c5.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>EC(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function LI(e){return new MI({type:"optional",innerType:e})}const II=se("ZodNullable",(e,t)=>{d5.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>AL(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function bw(e){return new II({type:"nullable",innerType:e})}const UI=se("ZodDefault",(e,t)=>{f5.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>zL(e,n,a,l),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function PI(e,t){return new UI({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():aC(t)}})}const BI=se("ZodPrefault",(e,t)=>{h5.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>OL(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function $I(e,t){return new BI({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():aC(t)}})}const zC=se("ZodNonOptional",(e,t)=>{m5.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>RL(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function FI(e,t){return new zC({type:"nonoptional",innerType:e,...Re(t)})}const qI=se("ZodCatch",(e,t)=>{p5.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>DL(e,n,a,l),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function HI(e,t){return new qI({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const ZI=se("ZodPipe",(e,t)=>{g5.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>ML(e,n,a,l),e.in=t.in,e.out=t.out});function Ng(e,t){return new ZI({type:"pipe",in:e,out:t})}const VI=se("ZodReadonly",(e,t)=>{y5.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>LL(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function QI(e){return new VI({type:"readonly",innerType:e})}const GI=se("ZodCustom",(e,t)=>{v5.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>kL(e,n)});function KI(e,t={}){return dL(GI,e,t)}function YI(e){return fL(e)}function XI(e,t){return Ng(AC(e),t)}const bp={custom:"custom"};function _f(e){return G5(_y,e)}const JI=new RegExp("(?<![A-Za-z0-9_.@-])@([A-Za-z0-9][A-Za-z0-9_-]{0,63})\\b","g");function WI(e){return e.replace(/```[\s\S]*?```/g,"").replace(/~~~[\s\S]*?~~~/g,"").replace(/`[^`\n]+`/g,"")}function e6(e,t){const n=WI(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(JI)){const c=o[1];if(!c)continue;const f=a.get(c.toLowerCase());f&&l.add(f)}return[...l]}const t6=/^\/(?![/\\])[A-Za-z0-9_\-./?=&%#]*$/,xw="/";function OC(e){return!e||typeof e!="string"||e.length>256||!t6.test(e)?"/":e}const n6={FEISHU:"feishu",SLACK:"slack",KAEL:"kael"},DC=Ge(["feishu","slack","kael"]),MC=Ge(["active","inactive"]);fe({platform:DC,agentId:R().min(1),credentials:Ht(R(),St()),status:MC.default("active")});fe({agentId:R().min(1).optional(),credentials:Ht(R(),St()).optional(),status:MC.optional()});fe({id:Ke(),platform:R(),agentId:R(),hasCredentials:Wr(),status:R(),createdAt:R(),updatedAt:R()});const r6=Ge(["code","reverse_token","oauth","manual"]);fe({appId:R().min(1),appSecret:R().min(1)});fe({platform:DC,externalUserId:R().min(1),agentId:R().min(1),boundVia:r6.default("manual"),displayName:R().max(200).optional()});fe({id:Ke(),platform:R(),externalUserId:R(),agentId:R(),boundVia:R().nullable(),displayName:R().nullable(),createdAt:R()});fe({feishuUserId:R().min(1),displayName:R().max(200).optional()});fe({configId:Ke(),platform:R(),agentId:R(),appId:R(),connected:Wr(),lastActiveAt:R().nullable()});const LC=Ge(["online","offline"]),IC=Ge(["idle","working","blocked","error"]);Ge(["active","suspended","evicted"]);const a6=Ge(["active","suspended"]);fe({chatId:R().min(1),state:a6});fe({runtimeState:IC});fe({agentId:R().min(1),runtimeType:R().max(50),runtimeVersion:R().max(50).optional()});Ge(["wrong_client","not_owned","agent_suspended","wrong_org","unknown_agent","runtime_provider_mismatch"]);fe({agentId:R(),status:LC,connectedAt:R().nullable(),lastSeenAt:R(),clientId:R().nullable().optional(),runtimeType:R().nullable().optional(),runtimeVersion:R().nullable().optional(),runtimeState:IC.nullable().optional(),activeSessions:Ke().int().nullable().optional(),totalSessions:Ke().int().nullable().optional(),runtimeUpdatedAt:R().nullable().optional()});fe({total:Ke().int(),running:Ke().int(),byState:fe({idle:Ke().int(),working:Ke().int(),blocked:Ke().int(),error:Ke().int()}),clients:Ke().int()});const nf={CLAUDE_CODE:"claude-code",CODEX:"codex"},Tf=Ge(["claude-code","codex"]),i6={HUMAN:"human",PERSONAL_ASSISTANT:"personal_assistant",AUTONOMOUS_AGENT:"autonomous_agent"},Af=Ge(["human","personal_assistant","autonomous_agent"]),ww={PRIVATE:"private",ORGANIZATION:"organization"},Ay=Ge(["private","organization"]),l6=Ge(["admin-api","portal"]);Ge(["active","suspended"]);const _g=/^[a-z0-9][a-z0-9_-]{0,63}$/,js=64,s6=["admin","agent","first-tree","hub","me","null","system","undefined"],o6=new Set(s6);function Tg(e){return o6.has(e)}fe({name:R().min(1).max(64).regex(_g,"Must start with a letter or digit and contain only lowercase letters, digits, hyphens (-), and underscores (_). Max 64 chars.").refine(e=>!Tg(e),{message:"That agent name is reserved — pick a different one."}).optional(),type:Af,displayName:R().min(1).max(200).optional(),delegateMention:R().max(100).optional(),organizationId:R().max(100).optional(),source:l6.optional(),visibility:Ay.optional(),metadata:Ht(R(),St()).optional(),managerId:R().optional(),clientId:R().min(1).max(100).optional(),runtimeProvider:Tf.optional()});fe({type:Af.optional(),displayName:R().min(1).max(200).optional(),delegateMention:R().max(100).nullable().optional(),visibility:Ay.optional(),metadata:Ht(R(),St()).optional(),managerId:R().nullable().optional(),clientId:R().min(1).max(100).nullable().optional()});fe({clientId:R().min(1).max(100),runtimeProvider:Tf,force:Wr().optional()});fe({uuid:R(),name:R().nullable(),organizationId:R(),type:Af,displayName:R(),delegateMention:R().nullable(),inboxId:R(),status:R(),source:R().nullable().optional(),visibility:Ay,metadata:Ht(R(),St()),managerId:R().nullable(),clientId:R().nullable(),runtimeProvider:Tf,presenceStatus:LC.optional(),createdAt:R(),updatedAt:R()});fe({repo:R().nullable(),branch:R().nullable()});fe({type:ln("agent:pinned"),agentId:R(),name:R().nullable(),displayName:R(),agentType:Af,runtimeProvider:Tf});const u6=32e3,Ry=/^[a-z0-9][a-z0-9_-]{0,63}$/i,c6=/^[A-Z][A-Z0-9_]*$/,d6=fe({append:R().max(u6).default("")}),f6=fe({name:R().regex(Ry,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:ln("stdio"),command:R().min(1),args:Qn(R()).optional()}),h6=fe({name:R().regex(Ry,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:ln("http"),url:R().url(),headers:Ht(R(),R()).optional()}),m6=fe({name:R().regex(Ry,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:ln("sse"),url:R().url(),headers:Ht(R(),R()).optional()}),p6=Ty("transport",[f6,h6,m6]),g6=fe({key:R().regex(c6,"Env key must match /^[A-Z][A-Z0-9_]*$/"),value:R(),sensitive:Wr().default(!1)}),y6=fe({url:R().min(1),ref:R().min(1).optional(),localPath:R().min(1).optional()}),Rf=fe({prompt:d6.default({append:""}),model:R().default("opus"),mcpServers:Qn(p6).default([]),env:Qn(g6).default([]),gitRepos:Qn(y6).default([])}),v6=Rf.extend({kind:ln("claude-code")}),b6=Rf.extend({kind:ln("codex")}),x6=Ty("kind",[v6,b6]),w6=(e,t)=>{const n=new Set;e.mcpServers.forEach((o,c)=>{const f=o.name.toLowerCase();n.has(f)&&t.addIssue({code:bp.custom,path:["mcpServers",c,"name"],message:`Duplicate MCP server name "${o.name}"`}),n.add(f)});const a=new Set;e.env.forEach((o,c)=>{a.has(o.key)&&t.addIssue({code:bp.custom,path:["env",c,"key"],message:`Duplicate env key "${o.key}"`}),a.add(o.key)});const l=new Set;e.gitRepos.forEach((o,c)=>{const f=o.localPath??af(o.url);f&&(l.has(f)&&t.addIssue({code:bp.custom,path:["gitRepos",c,"localPath"],message:`Duplicate git repo local path "${f}"`}),l.add(f))})},UC=XI(e=>e&&typeof e=="object"&&!Array.isArray(e)&&!("kind"in e)?{...e,kind:"claude-code"}:e,x6).superRefine((e,t)=>{w6(e,t)}),S6=fe({agentId:R(),version:Ke().int().positive(),payload:UC,updatedAt:R(),updatedBy:R()});fe({expectedVersion:Ke().int().positive(),payload:Rf.partial()});fe({payload:Rf.partial()});fe({current:S6,next:UC,diff:Qn(fe({path:R(),op:Ge(["add","remove","replace"]),before:St().optional(),after:St().optional()}))});const rf="***";function af(e){const t=e.trim();return t?((t.split(/[?#]/)[0]??"").split(/[/:]/).filter(Boolean).pop()??"").replace(/\.git$/i,""):""}fe({username:R().min(1),password:R().min(1)});fe({accessToken:R(),refreshToken:R()});fe({refreshToken:R().min(1)});fe({token:R().min(1)});fe({token:R(),expiresIn:Ke(),command:R()});const k6=Ge(["direct","group","thread"]);fe({type:k6,topic:R().max(500).optional(),participantIds:Qn(R()).min(1),metadata:Ht(R(),St()).optional()});const PC=fe({agentId:R(),role:R(),mode:R(),joinedAt:R()});PC.extend({name:R().nullable(),displayName:R(),type:R()});const j6=fe({id:R(),organizationId:R(),type:R(),topic:R().nullable(),lifecyclePolicy:R().nullable().optional(),metadata:Ht(R(),St()),createdAt:R(),updatedAt:R()});j6.extend({participants:Qn(PC)});fe({topic:R().trim().max(500).nullable()});fe({agentId:R().min(1),mode:Ge(["full","mention_only"]).default("full")});fe({agentId:R().min(1)});const C6=Ge(["connected","disconnected"]);fe({id:R(),userId:R().nullable(),status:C6,sdkVersion:R().max(50).nullable(),hostname:R().max(100).nullable(),os:R().max(50).nullable(),agentCount:Ke().int().min(0),connectedAt:R().nullable(),lastSeenAt:R(),metadata:Ht(R(),St()).nullable()});const E6=fe({wsInboxDeliver:Wr().default(!1)}).partial();fe({clientId:R().min(1).max(100),hostname:R().max(100).optional(),os:R().max(50).optional(),sdkVersion:R().max(50).optional(),wireCapabilities:E6.optional()});const N6=Ge(["ok","missing","unauthenticated","error"]),_6=Ge(["api_key","oauth","auth_json","none"]),T6=fe({state:N6,available:Wr(),authenticated:Wr(),sdkVersion:R().nullable().optional(),authMethod:_6,error:R().nullable().optional(),detectedAt:R()}),A6=Ht(R(),T6);fe({capabilities:A6});fe({limit:_f().int().min(1).max(100).default(20),cursor:R().optional()});const R6=["image/png","image/jpeg","image/gif","image/webp"],zy=Ge(R6);fe({data:R().min(1),mimeType:zy,filename:R().min(1),size:Ke().int().nonnegative().optional(),imageId:R().uuid().optional()});fe({imageId:R().uuid(),mimeType:zy,filename:R().min(1),size:Ke().int().nonnegative().optional()});fe({type:ln("image_payload"),imageId:R().uuid(),chatId:R(),base64:R().min(1),mimeType:zy,filename:R().min(1),size:Ke().int().nonnegative().optional()});const Oy=Ge(["hub_ui","cli","feishu","github","api"]),BC=Ge(["text","markdown","card","reference","file","task"]);fe({format:BC.default("text"),content:St(),metadata:Ht(R(),St()).optional(),inReplyTo:R().optional(),replyToInbox:R().optional(),replyToChat:R().optional(),source:Oy.optional()});fe({format:BC.default("text"),content:St(),metadata:Ht(R(),St()).optional(),replyToInbox:R().optional(),replyToChat:R().optional(),source:Oy.optional()});const z6=fe({id:R(),chatId:R(),senderId:R(),format:R(),content:St(),metadata:Ht(R(),St()),replyToInbox:R().nullable(),replyToChat:R().nullable(),inReplyTo:R().nullable(),source:Oy.nullable(),createdAt:R()}),O6=fe({senderId:R(),chatId:R(),replyToChat:R().nullable()}).nullable(),D6=Ge(["full","mention_only"]),M6=fe({id:R(),senderId:R(),format:R(),content:St(),metadata:Ht(R(),St()).default({}),createdAt:R()}),$C=z6.extend({configVersion:Ke().int().positive(),recipientMode:D6.default("full"),inReplyToSnapshot:O6.default(null),precedingMessages:Qn(M6).default([])});Ge(["pending","delivered","acked","failed"]);const L6=fe({id:Ke(),inboxId:R(),messageId:R(),chatId:R().nullable(),status:R(),retryCount:Ke(),createdAt:R(),deliveredAt:R().nullable(),ackedAt:R().nullable()});L6.extend({message:$C});fe({limit:_f().int().min(1).max(50).default(10)});fe({type:ln("inbox:deliver"),entryId:Ke().int().nonnegative(),inboxId:R().min(1),chatId:R().nullable(),message:$C}).passthrough();fe({type:ln("inbox:ack"),entryId:Ke().int().nonnegative()});const I6=7;fe({organizationId:R(),organizationName:R(),organizationDisplayName:R(),role:R(),expiresAt:R().nullable()});fe({id:R(),organizationId:R(),token:R(),inviteUrl:R(),role:R(),createdAt:R(),expiresAt:R().nullable()});fe({token:R().min(1)});fe({}).optional();Ge(["connect","create_agent","completed"]);fe({id:R(),name:R(),displayName:R(),role:Ge(["admin","member"])});fe({name:R().min(2).max(50).regex(/^[a-z0-9][a-z0-9-]*$/),displayName:R().min(1).max(200)});fe({organizationId:R().min(1)});const U6={ADMIN:"admin",MEMBER:"member"},Dy=Ge(["admin","member"]),P6=fe({id:R(),userId:R(),organizationId:R(),agentId:R(),role:Dy,createdAt:R()});fe({username:R().min(1).max(100),displayName:R().min(1).max(200),role:Dy.default("member")});fe({role:Dy.optional(),displayName:R().min(1).max(200).optional()});P6.extend({username:R(),displayName:R(),password:R()});const B6=Ge(["agent_error","session_error","agent_needs_decision","agent_blocked","agent_stale","agent_disconnected","agent_connected","session_completed"]),FC=Ge(["high","medium","low"]);fe({id:R(),organizationId:R(),type:B6,severity:FC,agentId:R().nullable(),chatId:R().nullable(),message:R(),read:Wr(),createdAt:R()});fe({limit:_f().int().min(1).max(100).default(20),cursor:R().optional(),severity:FC.optional(),read:Ge(["true","false"]).transform(e=>e==="true").optional(),agentId:R().optional()});fe({next:R().max(256).optional()});fe({code:R().min(1),state:R().min(1)});fe({githubId:R().min(1),login:R().min(1),email:R().email().optional(),displayName:R().optional(),next:R().max(256).optional()});const qC=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;fe({name:R().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=>!qC.test(e),"Name must not be a UUID format"),displayName:R().min(1).max(200),maxAgents:Ke().int().min(0).default(0),maxMessagesPerMinute:Ke().int().min(0).default(0),features:Ht(R(),St()).default({})});fe({name:R().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=>!qC.test(e),"Name must not be a UUID format").optional(),displayName:R().min(1).max(200).optional(),maxAgents:Ke().int().min(0).optional(),maxMessagesPerMinute:Ke().int().min(0).optional(),features:Ht(R(),St()).optional()});fe({id:R(),name:R(),displayName:R(),maxAgents:Ke(),maxMessagesPerMinute:Ke(),features:Ht(R(),St()),createdAt:R(),updatedAt:R()});const $6=fe({workingCount:Ke().int().nonnegative(),errorMask:Wr()}),F6=fe({type:ln("pulse:tick"),organizationId:R(),agents:Ht(R(),Qn($6).length(32))}),q6=Ge(["tool_call","error","assistant_text","thinking","turn_end"]),HC=fe({toolUseId:R(),name:R(),args:St(),status:Ge(["pending","ok","error"]),durationMs:Ke().int().nonnegative().optional(),resultPreview:R().max(400).optional()}),ZC=fe({source:Ge(["sdk","runtime","tool"]),message:R().max(2e3)}),VC=fe({text:R().max(8e3)}),QC=fe({}),GC=fe({status:Ge(["success","error"])}),H6=Ty("kind",[fe({kind:ln("tool_call"),payload:HC}),fe({kind:ln("error"),payload:ZC}),fe({kind:ln("assistant_text"),payload:VC}),fe({kind:ln("thinking"),payload:QC}),fe({kind:ln("turn_end"),payload:GC})]);fe({id:R(),agentId:R(),chatId:R(),seq:Ke().int().positive(),kind:q6,payload:TC([HC,ZC,VC,QC,GC]),createdAt:R()});fe({agentId:R(),chatId:R(),event:H6});fe({agentId:R(),chatId:R()});fe({type:ln("session:reconcile"),agentId:R().min(1),chatIds:Qn(R().min(1)).max(500)});fe({type:ln("session:reconcile:result"),agentId:R().min(1),staleChatIds:Qn(R().min(1))});const Z6=fe({organizationId:R(),agentCount:Ke(),chatCount:Ke(),messageCount:Ke()});fe({totalAgents:Ke(),totalChats:Ke(),totalMessages:Ke(),byOrganization:Qn(Z6)});fe({key:R(),value:St(),updatedAt:R()});Ht(R(),St());const ji={INBOX_TIMEOUT_SECONDS:"inbox_timeout_seconds",MAX_RETRY_COUNT:"max_retry_count",POLLING_INTERVAL_SECONDS:"polling_interval_seconds",PRESENCE_CLEANUP_SECONDS:"presence_cleanup_seconds"},Hd={[ji.INBOX_TIMEOUT_SECONDS]:300,[ji.MAX_RETRY_COUNT]:3,[ji.POLLING_INTERVAL_SECONDS]:5,[ji.PRESENCE_CLEANUP_SECONDS]:60},Au=Ge(["pending","assigned","working","completed","failed","cancelled"]),Sw=Ge(["agent","admin"]),V6=Ge(["assigned","status_changed","cancelled"]);fe({taskId:R(),event:V6,title:R(),body:R().default(""),status:Au,fromStatus:Au.optional(),originRef:R().nullable().optional()});const Q6=fe({title:R().min(1).max(500),body:R().optional(),assigneeAgentId:R().optional(),originRef:R().max(500).optional(),metadata:Ht(R(),St()).optional()});Q6.extend({organizationId:R().optional()});fe({status:Ge(["working","completed","failed"]),result:R().optional()});fe({assigneeAgentId:R().nullable().optional(),status:Au.optional(),result:R().optional()});fe({chatId:R().min(1)});const G6=fe({id:R(),organizationId:R(),title:R(),body:R(),status:Au,assigneeAgentId:R().nullable(),createdByType:Sw,createdById:R(),originRef:R().nullable(),result:R().nullable(),metadata:Ht(R(),St()),createdAt:R(),updatedAt:R(),cancelledAt:R().nullable(),cancelledByType:Sw.nullable(),cancelledById:R().nullable()}),K6=fe({taskId:R(),chatId:R(),linkedByAgentId:R().nullable(),linkedAt:R()});G6.extend({chats:Qn(K6)});fe({status:Au.optional(),assigneeAgentId:R().optional(),originRef:R().optional(),limit:_f().int().min(1).max(100).default(20),cursor:R().optional()});const Y6=Ge(["normal","idle_island","awaiting_reply","no_chat","not_applicable"]);fe({taskId:R(),signal:Y6,reason:R()});const X6=Ge(["active","suspended"]);fe({id:R(),username:R(),displayName:R(),avatarUrl:R().nullable(),status:X6,createdAt:R(),updatedAt:R()});fe({username:R().min(1).max(100),displayName:R().min(1).max(200),password:R().min(8).max(200)});fe({displayName:R().min(1).max(200).optional(),password:R().min(8).max(200).optional()});fe({type:ln("auth"),token:R().min(1)});const J6=fe({wsInboxDeliver:Wr().default(!1)}).partial();fe({type:ln("server:welcome"),serverCommandVersion:R().min(1),serverTimeMs:Ke().int().nonnegative(),capabilities:J6.optional()}).passthrough();const KC=Array.from({length:32},()=>({workingCount:0,errorMask:!1}));function W6(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 eU=2e3,tU=3e4;let hi=null,lf=!1,xp=0,yu=null;const Ag=new Set;let pu=null,Cs=0;function nU(e){for(const t of Ag)try{t(e)}catch{}pu&&(e.type==="notification"?pu.invalidateQueries({queryKey:["notifications"]}):e.type==="session:state"&&(pu.invalidateQueries({queryKey:["activity"]}),pu.invalidateQueries({queryKey:["sessions"]})))}function YC(){const e=sy();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);hi=a,a.onmessage=l=>{if(a===hi)try{const o=JSON.parse(l.data);nU(o)}catch{}},a.onopen=()=>{a===hi&&(xp=0)},a.onclose=()=>{if(a!==hi||(hi=null,lf||Cs===0))return;xp++;const l=Math.min(eU*2**(xp-1),tU);yu=setTimeout(()=>{yu=null,!lf&&Cs>0&&YC()},l)}}function rU(){lf=!0,yu&&(clearTimeout(yu),yu=null),hi&&(hi.close(1e3,"unmount"),hi=null)}function XC(e){const{onMessage:t,enabled:n=!0}=e??{},a=jn(),l=x.useRef(t);l.current=t,x.useEffect(()=>{pu=a},[a]),x.useEffect(()=>{if(!n)return;const o=c=>{var f;return(f=l.current)==null?void 0:f.call(l,c)};return Ag.add(o),Cs++,Cs===1&&(lf=!1,YC()),()=>{Ag.delete(o),Cs--,Cs===0&&rU()}},[n])}const JC=x.createContext({aggregated:KC,agents:{},receivedAtMs:null,stale:!0});function aU({children:e}){const[t,n]=x.useState({aggregated:KC,agents:{},receivedAtMs:null}),[a,l]=x.useState(()=>Date.now());XC({onMessage:c=>{const f=F6.safeParse(c);f.success&&n({aggregated:W6(f.data.agents),agents:f.data.agents,receivedAtMs:Date.now()})}}),x.useEffect(()=>{const c=setInterval(()=>l(Date.now()),1e4);return()=>clearInterval(c)},[]);const o=x.useMemo(()=>({...t,stale:t.receivedAtMs===null||a-t.receivedAtMs>3e4}),[t,a]);return u.jsx(JC.Provider,{value:o,children:e})}function iU(){return x.useContext(JC)}function zf({title:e,subtitle:t,right:n,className:a,style:l,...o}){return u.jsxs("div",{className:Ae("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:[u.jsx("h1",{className:"m-0 text-title",style:{color:"var(--fg)"},children:e}),t&&u.jsx("span",{className:"text-label",style:{color:"var(--fg-3)"},children:t}),u.jsx("div",{style:{flex:1}}),n]})}function WC({className:e,style:t,...n}){return u.jsx("div",{className:Ae("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 eE({active:e,onClick:t,children:n}){return u.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 lU={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 Sn({tone:e="neutral",className:t,style:n,...a}){const l=lU[e],o={background:l.bg,color:l.fg,border:`var(--hairline) solid ${l.bd}`,...n};return u.jsx("span",{className:Ae("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 vl=x.forwardRef(({className:e,...t},n)=>u.jsx("table",{ref:n,className:Ae("w-full",e),style:{borderCollapse:"separate",borderSpacing:0},...t}));vl.displayName="DenseTable";const bl=x.forwardRef(({className:e,...t},n)=>u.jsx("thead",{ref:n,className:e,...t}));bl.displayName="DenseTableHeader";const xl=x.forwardRef(({className:e,...t},n)=>u.jsx("tbody",{ref:n,className:e,...t}));xl.displayName="DenseTableBody";const or=x.forwardRef(({className:e,interactive:t,selected:n,style:a,...l},o)=>u.jsx("tr",{ref:o,className:Ae("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}));or.displayName="DenseTableRow";const qe=x.forwardRef(({className:e,style:t,...n},a)=>u.jsx("th",{ref:a,className:Ae("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}));qe.displayName="DenseTableHead";const Be=x.forwardRef(({className:e,style:t,...n},a)=>u.jsx("td",{ref:a,className:Ae("align-middle text-body",e),style:{padding:"var(--sp-2_25) var(--sp-3)",borderBottom:"var(--hairline) solid var(--border-faint)",...t},...n}));Be.displayName="DenseTableCell";const sn=x.forwardRef(({className:e,style:t,...n},a)=>u.jsx("div",{ref:a,className:Ae("overflow-hidden",e),style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)",...t},...n}));sn.displayName="Panel";const Ar=x.forwardRef(({className:e,style:t,...n},a)=>u.jsx("div",{ref:a,className:Ae("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}));Ar.displayName="PanelHeader";const Rr=x.forwardRef(({className:e,style:t,...n},a)=>u.jsx("div",{ref:a,className:Ae("inline-flex items-center gap-2 text-body font-semibold",e),style:{color:"var(--fg)",...t},...n}));Rr.displayName="PanelTitle";const ea=x.forwardRef(({className:e,style:t,...n},a)=>u.jsx("div",{ref:a,className:Ae(e),style:{padding:"var(--sp-3) var(--sp-3_5)",...t},...n}));ea.displayName="PanelBody";function Qs({children:e,right:t,className:n,style:a,...l}){return u.jsxs("div",{className:Ae("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:[u.jsx("span",{children:e}),t]})}function Yu({className:e,style:t,...n}){return u.jsx("span",{className:Ae("mono uppercase text-caption",e),style:{color:"var(--fg-3)",...t},...n})}function My(){return ke.get("/members")}function sU(e){return ke.post("/members",e)}function oU(e,t){return ke.patch(`/members/${encodeURIComponent(e)}`,t)}function uU(e){return ke.delete(`/members/${encodeURIComponent(e)}`)}function Ly(){const{data:e}=He({queryKey:["members","name-map"],queryFn:My,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 cU(){const e=dn(),t=Ly(),{data:n,isLoading:a,error:l}=He({queryKey:["admin-all-agents"],queryFn:()=>PD({limit:100})});return u.jsxs("div",{children:[u.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."}),u.jsxs(sn,{children:[u.jsxs(Qs,{children:["All agents · ",(n==null?void 0:n.items.length)??0]}),a?u.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):l?u.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?u.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"No agents"}):u.jsxs(vl,{children:[u.jsx(bl,{children:u.jsxs(or,{children:[u.jsx(qe,{children:"Display name"}),u.jsx(qe,{children:"Agent name"}),u.jsx(qe,{children:"Type"}),u.jsx(qe,{children:"Visibility"}),u.jsx(qe,{children:"Owner"}),u.jsx(qe,{children:"Status"}),u.jsx(qe,{children:"Created"})]})}),u.jsx(xl,{children:n.items.map(o=>u.jsxs(or,{interactive:!0,onClick:()=>e(`/agents/${encodeURIComponent(o.uuid)}`),children:[u.jsx(Be,{children:u.jsx("span",{className:"font-medium",children:o.displayName})}),u.jsx(Be,{children:o.name?u.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-3)"},children:["@",o.name]}):u.jsx("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:o.uuid.slice(0,8)})}),u.jsx(Be,{children:u.jsx(Sn,{tone:o.type==="autonomous_agent"?"accent":"neutral",children:o.type})}),u.jsx(Be,{children:u.jsx(Sn,{tone:o.visibility==="organization"?"accent":"outline",children:o.visibility})}),u.jsx(Be,{className:"text-label",style:{color:"var(--fg-2)"},children:o.managerId?t(o.managerId):"—"}),u.jsx(Be,{children:u.jsx(Sn,{tone:o.status==="active"?"accent":"neutral",children:o.status})}),u.jsx(Be,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Ni(o.createdAt)})]},o.uuid))})]})]})]})}const ro=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:Ae("rounded-[var(--radius-panel)] border bg-card text-card-foreground shadow-sm",e),...t}));ro.displayName="Card";const ao=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:Ae("flex flex-col space-y-1.5 p-6",e),...t}));ao.displayName="CardHeader";const Xu=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:Ae("text-subtitle leading-none",e),...t}));Xu.displayName="CardTitle";const tE=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:Ae("text-body text-muted-foreground",e),...t}));tE.displayName="CardDescription";const io=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:Ae("p-6 pt-0",e),...t}));io.displayName="CardContent";const dU=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:Ae("flex items-center p-6 pt-0",e),...t}));dU.displayName="CardFooter";function fU(e){const t=new Date(e),n=Date.now(),a=t.getTime()-n;if(a<=0)return`expired ${t.toLocaleDateString()}`;const l=Math.ceil(a/(1440*60*1e3));return`expires ${l===1?"in less than a day":`in ${l} days`} · ${t.toLocaleDateString()}`}function hU(){const{organizationId:e}=qt(),[t,n]=x.useState(null),[a,l]=x.useState(null),[o,c]=x.useState(!1),[f,m]=x.useState(!1);x.useEffect(()=>{e&&(async()=>{try{const y=await ke.get(`/admin/organizations/${e}/invitations`);n(y)}catch(y){l(y instanceof Error?y.message:"Failed to load invite link")}})()},[e]);const h=async()=>{if(e){c(!0),l(null);try{const y=await ke.post(`/admin/organizations/${e}/invitations/rotate`);n(y)}catch(y){l(y instanceof Error?y.message:"Failed to rotate invite link")}finally{c(!1)}}};return u.jsxs(ro,{children:[u.jsxs(ao,{children:[u.jsx(Xu,{children:"Invite link"}),u.jsxs(tE,{children:["Anyone with this link can join your team as a member. Links expire after ",I6," days; rotating revokes the old link instantly and resets the timer."]})]}),u.jsxs(io,{className:"space-y-3",children:[a&&u.jsx("div",{className:"rounded-md bg-destructive/10 p-2 text-label text-destructive",children:a}),t?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex gap-2",children:[u.jsx("input",{readOnly:!0,className:"flex-1 rounded-md border bg-muted px-2 py-1 text-label font-mono",value:t.inviteUrl}),u.jsx(me,{size:"sm",variant:"outline",onClick:()=>{navigator.clipboard.writeText(t.inviteUrl),m(!0),setTimeout(()=>m(!1),1500)},children:f?"Copied!":"Copy"}),u.jsx(me,{size:"sm",onClick:h,disabled:o,children:o?"Rotating…":"Rotate"})]}),u.jsxs("p",{className:"text-label text-muted-foreground",children:["Created ",new Date(t.createdAt).toLocaleString(),t.expiresAt?` · ${fU(t.expiresAt)}`:" · no expiry"]})]}):u.jsx("p",{className:"text-label text-muted-foreground",children:"Loading…"})]})]})}var mU="Label",nE=x.forwardRef((e,t)=>u.jsx(Oa.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())}}));nE.displayName=mU;var pU=nE;const st=x.forwardRef(({className:e,...t},n)=>u.jsx(pU,{ref:n,className:Ae("text-label leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...t}));st.displayName="Label";const rE=Object.values(U6);function gU(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 yU(){const e=jn(),{memberId:t}=qt(),[n,a]=x.useState(!1),[l,o]=x.useState({username:"",displayName:"",role:"member"}),[c,f]=x.useState(null),[m,h]=x.useState(null),{data:y,isLoading:g,error:b}=He({queryKey:["members"],queryFn:My}),w=wt({mutationFn:()=>sU({username:l.username,displayName:l.displayName,role:l.role}),onSuccess:N=>{e.invalidateQueries({queryKey:["members"]}),f(N.password)}}),k=wt({mutationFn:uU,onSuccess:()=>e.invalidateQueries({queryKey:["members"]})});function j(){a(!1),o({username:"",displayName:"",role:"member"}),f(null)}function E(N){N.preventDefault(),w.mutate()}function C(N){window.confirm("Delete this member? Their human agent will also be deactivated.")&&k.mutate(N)}return u.jsxs(u.Fragment,{children:[u.jsxs(sn,{children:[u.jsxs(Qs,{right:u.jsxs($t,{open:n,onOpenChange:N=>N?a(!0):j(),children:[u.jsx(LD,{asChild:!0,children:u.jsxs(me,{size:"xs",className:"normal-case tracking-normal",children:[u.jsx(Jr,{className:"h-3 w-3"}),"Add member"]})}),u.jsxs(zt,{children:[u.jsx(Gt,{children:u.jsx(Ft,{children:c?"Member Created":"Create Member"})}),c?u.jsxs("div",{className:"space-y-4",children:[u.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Member created. Share the password below — it will only be shown once."}),u.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:[u.jsx("code",{className:"flex-1 text-body mono",children:c}),u.jsx(me,{variant:"ghost",size:"icon",onClick:()=>navigator.clipboard.writeText(c),title:"Copy password",children:u.jsx(yf,{className:"h-4 w-4"})})]}),u.jsx(tn,{children:u.jsx(me,{onClick:j,children:"Done"})})]}):u.jsxs("form",{onSubmit:E,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{htmlFor:"member-username",children:"Username"}),u.jsx(jt,{id:"member-username",type:"text",value:l.username,onChange:N=>o({...l,username:N.target.value}),required:!0})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{htmlFor:"member-name",children:"Display Name"}),u.jsx(jt,{id:"member-name",value:l.displayName,onChange:N=>o({...l,displayName:N.target.value}),required:!0})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{htmlFor:"member-role",children:"Role"}),u.jsx("select",{id:"member-role",value:l.role,onChange:N=>o({...l,role: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 transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:rE.map(N=>u.jsx("option",{value:N,children:N},N))})]}),w.error instanceof Error&&u.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:w.error.message}),u.jsx(tn,{children:u.jsx(me,{type:"submit",disabled:w.isPending,children:w.isPending?"Creating...":"Create"})})]})]})]}),children:["Members · ",(y==null?void 0:y.length)??0]}),g?u.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):b?u.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"]}):(y==null?void 0:y.length)===0?u.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"No members"}):u.jsxs(vl,{children:[u.jsx(bl,{children:u.jsxs(or,{children:[u.jsx(qe,{style:{width:30}}),u.jsx(qe,{children:"Username"}),u.jsx(qe,{children:"Name"}),u.jsx(qe,{children:"Role"}),u.jsx(qe,{children:"Created"}),u.jsx(qe,{style:{width:1}})]})}),u.jsx(xl,{children:y==null?void 0:y.map(N=>{const z=t===N.id;return u.jsxs(or,{children:[u.jsx(Be,{children:u.jsx("span",{className:"mono inline-flex items-center justify-center text-caption font-semibold",style:{width:22,height:22,borderRadius:"var(--radius-input)",background:z?"var(--accent-bg)":"var(--bg-active)",border:"var(--hairline) solid var(--border-strong)",color:z?"var(--accent-dim)":"var(--fg-2)"},children:gU(N.displayName,N.username)})}),u.jsxs(Be,{children:[u.jsx("span",{className:"mono font-medium",children:N.username}),z&&u.jsx(Yu,{style:{marginLeft:6},children:"you"})]}),u.jsx(Be,{style:{color:"var(--fg-2)"},children:N.displayName}),u.jsx(Be,{children:u.jsx(Sn,{tone:N.role==="admin"?"accent":"neutral",children:N.role})}),u.jsx(Be,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Ni(N.createdAt)}),u.jsx(Be,{style:{whiteSpace:"nowrap"},children:u.jsxs("div",{className:"flex gap-0.5 justify-end",children:[u.jsx(me,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>h({id:N.id,username:N.username,displayName:N.displayName,role:N.role}),title:"Edit",children:u.jsx(Vu,{className:"h-3.5 w-3.5"})}),u.jsx(me,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>C(N.id),disabled:k.isPending,title:"Delete",style:{color:"var(--fg-4)"},children:u.jsx(Hs,{className:"h-3.5 w-3.5"})})]})})]},N.id)})})]})]}),u.jsx(vU,{target:m,onClose:()=>h(null),onSaved:()=>{h(null),e.invalidateQueries({queryKey:["members"]})}})]})}function vU({target:e,onClose:t,onSaved:n}){const[a,l]=x.useState(""),[o,c]=x.useState("member"),[f,m]=x.useState(null);x.useEffect(()=>{e&&(l(e.displayName),c(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:oU(e.id,b)},onSuccess:()=>{m(null),n()},onError:b=>{m(b instanceof Error?b.message:String(b))}});function y(b){b.preventDefault(),h.mutate()}const g=e!==null;return u.jsx($t,{open:g,onOpenChange:b=>b?void 0:t(),children:u.jsxs(zt,{children:[u.jsx(Gt,{children:u.jsx(Ft,{children:"Edit Member"})}),e&&u.jsxs("form",{onSubmit:y,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{children:"Username"}),u.jsx(jt,{value:e.username,disabled:!0,className:"font-mono"}),u.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:"Username is permanent after creation."})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{htmlFor:"edit-member-display",children:"Display Name"}),u.jsx(jt,{id:"edit-member-display",value:a,onChange:b=>l(b.target.value),required:!0,maxLength:200})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{htmlFor:"edit-member-role",children:"Role"}),u.jsx("select",{id:"edit-member-role",value:o,onChange:b=>c(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:rE.map(b=>u.jsx("option",{value:b,children:b},b))}),u.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&&u.jsx("p",{className:"text-body",style:{color:"var(--state-error)"},children:f}),u.jsxs(tn,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:t,disabled:h.isPending,children:"Cancel"}),u.jsx(me,{type:"submit",disabled:h.isPending,children:h.isPending?"Saving…":"Save"})]})]})]})})}function bU(){return ke.get("/admin/system/config")}function xU(e){return ke.patch("/admin/system/config",e)}function wU(e){return ke.get(`/admin/organizations/${encodeURIComponent(e)}`)}function SU(e,t){return ke.patch(`/admin/organizations/${encodeURIComponent(e)}`,t)}function kU(){return ke.post("/me/organizations/leave")}function jU(){const{organizationId:e}=qt(),t=jn(),n=He({queryKey:["organization",e],queryFn:()=>e?wU(e):Promise.reject(new Error("no org")),enabled:!!e}),[a,l]=x.useState(""),[o,c]=x.useState(""),[f,m]=x.useState(!1);x.useEffect(()=>{n.data&&(l(n.data.displayName),c(n.data.name))},[n.data]);const h=wt({mutationFn:()=>{if(!e||!n.data)throw new Error("organization not loaded");const g={},b=a.trim(),w=o.trim();return b&&b!==n.data.displayName&&(g.displayName=b),w&&w!==n.data.name&&(g.name=w),Object.keys(g).length===0?Promise.resolve(n.data):SU(e,g)},onSuccess:g=>{t.setQueryData(["organization",e],g),t.invalidateQueries({queryKey:["me-organizations"]}),m(!0),setTimeout(()=>m(!1),2e3)}}),y=g=>{g.preventDefault(),h.mutate()};return u.jsxs(sn,{children:[u.jsxs(Ar,{children:[u.jsx(Rr,{children:"Team identity"}),u.jsxs("div",{className:"flex items-center gap-1.5",children:[f&&u.jsx("span",{className:"mono text-caption",style:{color:"var(--accent-dim)"},children:"saved"}),u.jsxs(me,{type:"submit",form:"team-identity-form",size:"xs",disabled:h.isPending||!n.data,children:[u.jsx(cr,{className:"h-3 w-3"}),h.isPending?"Saving…":"Save"]})]})]}),u.jsx(ea,{children:n.isLoading?u.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):n.error?u.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:n.error instanceof Error?n.error.message:"Failed to load team"}):u.jsxs("form",{id:"team-identity-form",onSubmit:y,children:[u.jsx(kw,{label:"Team name",hint:"Shown in the team switcher and dashboard header.",value:a,onChange:l}),u.jsx(kw,{label:"URL slug",hint:"Lowercase letters, digits, hyphens. Used in invite URLs.",value:o,onChange:g=>c(g.toLowerCase()),mono:!0,pattern:"[a-z0-9][a-z0-9-]*"}),h.error instanceof Error&&u.jsx("div",{className:"text-body",style:{color:"var(--state-error)",marginTop:"var(--sp-2)"},children:h.error.message})]})})]})}function kw({label:e,hint:t,value:n,onChange:a,mono:l,pattern:o}){return u.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:[u.jsxs("div",{children:[u.jsx("div",{className:"text-body font-medium",style:{color:"var(--fg)"},children:e}),u.jsx("div",{className:"text-label",style:{color:"var(--fg-3)",marginTop:2},children:t})]}),u.jsx("input",{value:n,onChange:c=>a(c.target.value),pattern:o,className:`w-full outline-none text-body ${l?"mono":""}`,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)"}})]})}const aE=[{key:ji.INBOX_TIMEOUT_SECONDS,label:"Inbox timeout",description:"How long an agent waits for inbound messages before sleeping.",unit:"seconds"},{key:ji.MAX_RETRY_COUNT,label:"Max retry count",description:"Delivery attempts before a message is marked failed.",unit:null},{key:ji.POLLING_INTERVAL_SECONDS,label:"Polling interval",description:"Runtime heartbeat cadence for offline detection.",unit:"seconds"},{key:ji.PRESENCE_CLEANUP_SECONDS,label:"Presence cleanup",description:"When presence rows expire after disconnect.",unit:"seconds"}],jw=aE.map(e=>e.key);function CU(){const e=jn(),{data:t,isLoading:n}=He({queryKey:["system-config"],queryFn:bU}),[a,l]=x.useState({}),[o,c]=x.useState(!1);x.useEffect(()=>{if(!t)return;const y={};for(const g of jw){const b=t[g]??Hd[g]??"";y[g]=String(b)}l(y)},[t]);const f=wt({mutationFn:()=>{const y={};for(const[g,b]of Object.entries(a)){const w=b.trim();if(w==="")y[g]=Hd[g]??0;else{const k=Number(w);y[g]=Number.isNaN(k)?w:k}}return xU(y)},onSuccess:()=>{e.invalidateQueries({queryKey:["system-config"]}),c(!0),setTimeout(()=>c(!1),2e3)}});function m(){const y={};for(const g of jw)y[g]=String(Hd[g]??"");l(y)}function h(y){y.preventDefault(),f.mutate()}return u.jsxs("div",{className:"space-y-4",children:[u.jsx(jU,{}),u.jsx("form",{onSubmit:h,children:u.jsxs(sn,{children:[u.jsxs(Ar,{children:[u.jsx(Rr,{children:"System configuration"}),u.jsxs("div",{className:"flex items-center gap-1.5",children:[o&&u.jsx("span",{className:"mono text-caption",style:{color:"var(--accent-dim)"},children:"saved"}),u.jsx(me,{type:"button",variant:"ghost",size:"xs",onClick:m,disabled:f.isPending,children:"Reset defaults"}),u.jsxs(me,{type:"submit",size:"xs",disabled:f.isPending,children:[u.jsx(cr,{className:"h-3 w-3"}),f.isPending?"Saving…":"Save changes"]})]})]}),u.jsxs("div",{style:{padding:"var(--sp-1) var(--sp-4) var(--sp-3_5)"},children:[n?u.jsx("div",{className:"py-6 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):aE.map(y=>u.jsx(EU,{field:y,value:a[y.key]??"",onChange:g=>l({...a,[y.key]:g})},y.key)),f.error instanceof Error&&u.jsx("div",{className:"text-body pt-2",style:{color:"var(--state-error)"},children:f.error.message})]})]})})]})}function EU({field:e,value:t,onChange:n}){const a=String(Hd[e.key]??"—");return u.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:[u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-baseline gap-2",children:[u.jsx("span",{className:"text-body font-medium",style:{color:"var(--fg)"},children:e.label}),u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:e.key})]}),u.jsx("div",{className:"text-label",style:{color:"var(--fg-3)",marginTop:2},children:e.description}),u.jsxs(Yu,{style:{marginTop:4,display:"block"},children:["default"," ",u.jsx("span",{className:"mono normal-case tracking-normal",style:{color:"var(--fg-3)"},children:a})]})]}),u.jsxs("div",{style:{position:"relative"},children:[u.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&&u.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 Cw=[{key:"members",label:"Members"},{key:"invite",label:"Invite link"},{key:"all-agents",label:"All agents"},{key:"settings",label:"Org settings"}];function NU(){const{role:e}=qt(),t=Mn(),n=dn();if(e===null)return u.jsx("div",{className:"text-body",style:{padding:20,color:"var(--fg-3)"},children:"Loading…"});if(e!=="admin")return u.jsx(mf,{to:"/settings",replace:!0});const a=t.hash.replace("#",""),l=Cw.some(c=>c.key===a)?a:"members",o=c=>{n({hash:c},{replace:!0})};return u.jsxs("div",{className:"-m-6",children:[u.jsx(zf,{title:"Admin",subtitle:"Organization-wide controls"}),u.jsx(WC,{children:Cw.map(c=>u.jsx(eE,{active:l===c.key,onClick:()=>o(c.key),children:c.label},c.key))}),u.jsxs("div",{style:{padding:"var(--sp-4) var(--sp-5) var(--sp-7)"},children:[l==="members"&&u.jsx(yU,{}),l==="invite"&&u.jsx(hU,{}),l==="all-agents"&&u.jsx(cU,{}),l==="settings"&&u.jsx(CU,{})]})]})}function _U(e){return ke.get(`/admin/agents/${e}/config`)}function TU(e,t){return ke.patch(`/admin/agents/${e}/config`,t)}function AU(e,t){return ke.post(`/admin/agents/${e}/config/dry-run`,{payload:t})}function RU(e){return ke.get(`/admin/agents/${e}/client-status`)}function zU({className:e,style:t,...n}){return u.jsx("div",{className:Ae("flex items-center text-body",e),style:{gap:6,color:"var(--fg-3)",...t},...n})}function OU({onClick:e,children:t}){return u.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 DU(){return u.jsx("span",{style:{color:"var(--fg-4)"},children:"/"})}function MU({children:e,mono:t}){return u.jsx("span",{className:Ae("font-medium",t&&"mono"),style:{color:"var(--fg)"},children:e})}function Xr({state:e,size:t=8,className:n}){const a={width:t,height:t,display:"inline-block",position:"relative",flexShrink:0};return e==="working"?u.jsxs("span",{className:Ae("shrink-0",n),style:a,role:"img","aria-label":"working",children:[u.jsx("span",{style:{position:"absolute",inset:0,borderRadius:"50%",background:"var(--state-working)"}}),u.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"?u.jsx("span",{className:Ae("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:u.jsx("span",{style:{position:"absolute",inset:2,borderRadius:"50%",background:"var(--state-blocked)"}})}):e==="error"?u.jsx("span",{className:Ae("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"?u.jsx("span",{className:Ae("shrink-0",n),style:{...a,borderRadius:"50%",background:"var(--state-idle)"},role:"img","aria-label":"idle"}):u.jsx("span",{className:Ae("shrink-0",n),style:{...a,borderRadius:"50%",border:"var(--hairline) solid var(--state-offline)",background:"transparent"},role:"img","aria-label":"offline"})}function LU(e){return e==="idle"||e==="working"||e==="blocked"||e==="error"||e==="offline"}function Gs({state:e,className:t}){const n=e!==null&&LU(e)?e:"offline",a=n==="offline"?"var(--fg-3)":`var(--state-${n})`;return u.jsxs("span",{className:Ae("mono inline-flex items-center gap-1.5 uppercase text-caption",t),style:{color:a},children:[u.jsx(Xr,{state:n,size:7}),n]})}function Ad({label:e,value:t,accent:n}){return u.jsxs("div",{style:{padding:"var(--sp-2) var(--sp-2_5)",background:"var(--bg-sunken)",borderRadius:"var(--radius-input)",cursor:"default"},children:[u.jsx("div",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-4)"},children:e}),u.jsx("div",{className:"mono text-subtitle font-semibold",style:{color:n??"var(--fg)",marginTop:"var(--sp-px)"},children:t})]})}function IU({runtimeLabel:e,computerLabel:t,visible:n=!0}){return n?u.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:u.jsxs("div",{className:"mono text-caption flex items-center gap-2",style:{color:"var(--fg-3)"},children:[u.jsxs("span",{children:["Runs on ",u.jsx("span",{style:{color:"var(--fg-2)"},children:e})]}),t&&u.jsxs(u.Fragment,{children:[u.jsx("span",{style:{color:"var(--fg-4)"},"aria-hidden":!0,children:"@"}),u.jsx("span",{style:{color:"var(--fg-2)"},children:t})]})]})}):null}function UU(e){const{agent:t}=e,[n,a]=x.useState(!1),[l,o]=x.useState(!1),c=t.displayName||t.name||t.uuid;return u.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:[u.jsxs("header",{className:"flex items-center gap-2",style:{padding:"var(--sp-2_5) var(--sp-3_5)"},children:[u.jsx(fy,{className:"h-3.5 w-3.5",style:{color:"var(--state-error)"}}),u.jsx("h3",{className:"text-body font-semibold",style:{color:"var(--state-error)"},children:"Danger zone"})]}),u.jsxs("div",{children:[t.status==="active"?u.jsx(wp,{title:"Suspend agent",body:"Pause all active sessions. You can reactivate later; tokens stay revoked until then.",action:u.jsx(me,{variant:"outline",size:"xs",onClick:()=>o(!0),disabled:e.suspendPending,children:e.suspendPending?"Suspending…":"Suspend"})}):u.jsx(wp,{title:"Reactivate agent",body:"Resume sessions. Tokens must be recreated — they are not restored.",action:u.jsx(me,{variant:"outline",size:"xs",onClick:e.onReactivate,disabled:e.reactivatePending,children:e.reactivatePending?"Reactivating…":"Reactivate"})}),u.jsx(wp,{title:"Delete agent",body:"Permanent. Configuration, bindings, tokens, and session history are all dropped.",action:u.jsxs(me,{variant:"destructive",size:"xs",onClick:()=>a(!0),disabled:e.deletePending,children:[u.jsx(Hs,{className:"h-3 w-3"}),"Delete"]})})]}),u.jsx(PU,{open:l,onOpenChange:o,label:c,onConfirm:()=>{o(!1),e.onSuspend()},pending:e.suspendPending}),u.jsx(BU,{open:n,onOpenChange:a,expected:c,onDelete:()=>{a(!1),e.onDelete()},deleting:e.deletePending})]})}function wp(e){return u.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:[u.jsxs("div",{children:[u.jsx("p",{className:"font-medium",style:{color:"var(--fg)"},children:e.title}),u.jsx("p",{className:"text-label font-normal",style:{color:"var(--fg-3)"},children:e.body})]}),u.jsx("div",{children:e.action})]})}function PU({open:e,onOpenChange:t,label:n,onConfirm:a,pending:l}){return u.jsx($t,{open:e,onOpenChange:t,children:u.jsxs(zt,{children:[u.jsx(Gt,{children:u.jsxs(Ft,{children:['Suspend "',n,'"?']})}),u.jsx("div",{className:"space-y-3",children:u.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."})}),u.jsxs(tn,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>t(!1),disabled:l,children:"Cancel"}),u.jsx(me,{type:"button",variant:"destructive",onClick:a,disabled:l,children:l?"Suspending…":"Suspend"})]})]})})}function BU({open:e,onOpenChange:t,expected:n,onDelete:a,deleting:l}){const[o,c]=x.useState("");function f(m){m.preventDefault(),o===n&&a()}return u.jsx($t,{open:e,onOpenChange:m=>{t(m),m||c("")},children:u.jsxs(zt,{children:[u.jsx(Gt,{children:u.jsxs(Ft,{children:['Delete "',n,'"?']})}),u.jsxs("form",{onSubmit:f,className:"space-y-4",children:[u.jsxs("p",{className:"text-body text-muted-foreground",children:["This action cannot be undone. Type ",u.jsx("span",{className:"font-mono font-medium text-foreground",children:n})," ","to confirm."]}),u.jsx(jt,{value:o,onChange:m=>c(m.target.value),autoFocus:!0,placeholder:n,className:"font-mono"}),u.jsxs(tn,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>t(!1),disabled:l,children:"Cancel"}),u.jsx(me,{type:"submit",variant:"destructive",disabled:o!==n||l,children:l?"Deleting…":"Delete"})]})]})]})})}const $U={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 Iy({status:e,onEdit:t,onDelete:n,onUndo:a,children:l,disabled:o}){const c=$U[e],f=e==="deleted";return u.jsxs("div",{className:Ae("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:[u.jsx("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:l}),c.label&&u.jsx("span",{className:Ae("text-caption rounded px-1.5 py-0.5 whitespace-nowrap",c.tone),children:c.label}),!o&&(f?u.jsxs(me,{size:"sm",variant:"ghost",onClick:a,children:[u.jsx(gz,{className:"h-3.5 w-3.5 mr-1"}),"Undo"]}):u.jsxs("div",{className:"flex gap-1 shrink-0",children:[u.jsxs(me,{size:"icon",variant:"ghost",className:"h-7 w-7",onClick:t,title:"Edit",children:[u.jsx(Vu,{className:"h-3.5 w-3.5"}),u.jsx("span",{className:"sr-only",children:"Edit"})]}),u.jsxs(me,{size:"icon",variant:"ghost",className:"h-7 w-7",onClick:n,title:"Delete",children:[u.jsx(Hs,{className:"h-3.5 w-3.5"}),u.jsx("span",{className:"sr-only",children:"Delete"})]})]}))]})}function FU(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}),c=e.items.filter(f=>f.status!=="deleted").length;return u.jsxs(sn,{children:[u.jsxs(Ar,{children:[u.jsxs(Rr,{children:["Environment variables (",c,")"]}),!e.disabled&&u.jsxs(me,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[u.jsx(Jr,{className:"h-3 w-3"})," Add"]})]}),u.jsx(ea,{className:"space-y-2",children:e.items.length===0?u.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===rf,y=m&&!h&&!!f.value.value,g=a.has(f.key);let b;return m?y&&g?b=f.value.value:b="••••••":b=f.value.value||u.jsx("em",{children:"(empty)"}),u.jsxs(Iy,{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:[u.jsx("span",{className:"font-mono font-medium",children:f.value.key}),u.jsx("span",{className:"font-mono text-caption text-muted-foreground truncate max-w-xs",children:b}),m&&u.jsx(Dk,{className:"h-3 w-3 text-muted-foreground","aria-hidden":!0}),m&&u.jsx("button",{type:"button",onClick:()=>y&&o(f.key),className:"bg-transparent border-0 cursor-pointer inline-flex items-center text-muted-foreground",title:y?g?"Hide value":"Reveal value":"Saved sensitive values can't be revealed. Edit to set a new value.","aria-label":g?"Hide value":"Reveal value",disabled:!y,style:{padding:0,opacity:y?1:.4},children:g?u.jsx(LR,{className:"h-3.5 w-3.5"}):u.jsx(UR,{className:"h-3.5 w-3.5"})})]},f.key)})}),t&&u.jsx(qU,{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 qU({open:e,onOpenChange:t,initial:n,forbiddenKeys:a,onSubmit:l}){const[o,c]=x.useState((n==null?void 0:n.key)??""),[f,m]=x.useState(n!=null&&n.sensitive?"":(n==null?void 0:n.value)??""),[h,y]=x.useState((n==null?void 0:n.sensitive)??!1),[g,b]=x.useState(null);x.useEffect(()=>{e&&(c((n==null?void 0:n.key)??""),m(n!=null&&n.sensitive?"":(n==null?void 0:n.value)??""),y((n==null?void 0:n.sensitive)??!1),b(null))},[e,n]);function w(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=rf),!h&&!n&&!f){b("Value is required for non-sensitive entries.");return}l({key:o,value:j,sensitive:h})}return u.jsx($t,{open:e,onOpenChange:t,children:u.jsxs(zt,{children:[u.jsx(Gt,{children:u.jsx(Ft,{children:n?"Edit environment variable":"Add environment variable"})}),u.jsxs("form",{onSubmit:w,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{htmlFor:"env-key",children:"Key"}),u.jsx(jt,{id:"env-key",value:o,onChange:k=>c(k.target.value.toUpperCase()),placeholder:"OPENAI_API_KEY",className:"font-mono",disabled:!!n}),n&&u.jsx("p",{className:"text-caption text-muted-foreground",children:"Key can't be renamed — delete and re-add."})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{htmlFor:"env-value",children:"Value"}),u.jsx(jt,{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"})]}),u.jsxs("label",{className:"flex items-center gap-2 text-body",children:[u.jsx("input",{type:"checkbox",checked:h,onChange:k=>y(k.target.checked),className:"h-4 w-4",disabled:!!n&&n.sensitive}),"Mark as sensitive (encrypted at rest, never displayed again)"]}),u.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."}),g&&u.jsx("p",{className:"text-body text-destructive",children:g}),u.jsxs(tn,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),u.jsx(me,{type:"submit",children:n?"Done":"Add"})]})]})]})})}function HU(e){const[t,n]=x.useState(null),a=e.items.filter(l=>l.status!=="deleted").length;return u.jsxs(sn,{children:[u.jsxs(Ar,{children:[u.jsxs(Rr,{children:["Git repositories (",a,")"]}),!e.disabled&&u.jsxs(me,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[u.jsx(Jr,{className:"h-3 w-3"})," Add"]})]}),u.jsx(ea,{className:"space-y-2",children:e.items.length===0?u.jsx("p",{className:"text-body text-muted-foreground",children:"No Git repositories."}):e.items.map(l=>{const o=l.value.localPath??af(l.value.url);return u.jsxs(Iy,{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:[u.jsx("span",{className:"font-mono text-caption",children:l.value.url}),l.value.ref&&u.jsxs("span",{className:"text-caption text-muted-foreground",children:["@ ",l.value.ref]}),u.jsxs("span",{className:"text-caption text-muted-foreground",children:["→ ",o||"./"]})]},l.key)})}),t&&u.jsx(ZU,{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 ZU({open:e,onOpenChange:t,initial:n,forbiddenPaths:a,onSubmit:l}){const[o,c]=x.useState((n==null?void 0:n.url)??""),[f,m]=x.useState((n==null?void 0:n.ref)??""),[h,y]=x.useState((n==null?void 0:n.localPath)??""),[g,b]=x.useState(null);x.useEffect(()=>{e&&(c((n==null?void 0:n.url)??""),m((n==null?void 0:n.ref)??""),y((n==null?void 0:n.localPath)??""),b(null))},[e,n]);function w(k){k.preventDefault();const j=o.trim();if(!j){b("URL is required.");return}const E=h.trim()||af(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 u.jsx($t,{open:e,onOpenChange:t,children:u.jsxs(zt,{children:[u.jsx(Gt,{children:u.jsx(Ft,{children:n?"Edit Git repository":"Add Git repository"})}),u.jsxs("form",{onSubmit:w,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{htmlFor:"git-url",children:"URL"}),u.jsx(jt,{id:"git-url",value:o,onChange:k=>c(k.target.value),placeholder:"git@github.com:org/repo.git",className:"font-mono"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{htmlFor:"git-ref",children:"Ref (branch / tag / sha, optional)"}),u.jsx(jt,{id:"git-ref",value:f,onChange:k=>m(k.target.value),placeholder:"main",className:"font-mono"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{htmlFor:"git-path",children:"Local path (optional)"}),u.jsx(jt,{id:"git-path",value:h,onChange:k=>y(k.target.value),placeholder:af(o)||"repo-name",className:"font-mono"}),u.jsx("p",{className:"text-caption text-muted-foreground",children:"Relative to the session working directory. Leave empty to derive from the URL."})]}),g&&u.jsx("p",{className:"text-body text-destructive",children:g}),u.jsxs(tn,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),u.jsx(me,{type:"submit",children:n?"Done":"Add"})]})]})]})})}function iE({name:e,displayName:t,variant:n="inline",tone:a="neutral",emptyLabel:l="—",className:o,style:c,title:f}){const m=typeof e=="string"&&e.length>0,h=typeof t=="string"&&t.length>0;if(!m&&!h)return u.jsx("span",{className:Ae("mono text-label",o),style:{color:"var(--fg-4)",...c},title:f,children:l});const y=f??(m&&h?`${t} (@${e})`:h?t:`@${e}`),g=a==="accent"?"var(--accent-dim)":void 0,b=a==="accent"?"var(--accent-dim)":"var(--fg-3)";return n==="stacked"?u.jsxs("span",{className:Ae("inline-flex flex-col leading-tight",o),style:{gap:1,...c},title:y??void 0,children:[h&&u.jsx("span",{className:"text-body",style:{color:g},children:t}),m&&u.jsxs("span",{className:"mono text-caption",style:{color:b},children:["@",e]})]}):u.jsxs("span",{className:Ae("inline-flex items-baseline gap-1.5",o),style:c,title:y??void 0,children:[h&&u.jsx("span",{style:{color:g},children:t}),m&&u.jsxs("span",{className:"mono text-caption",style:{color:b},children:["@",e]})]})}function VU({agent:e,onSave:t}){const[n,a]=x.useState(!1),l=wy(),o=Ly(),c=e.metadata,f=c==null?void 0:c.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"):[],y=e.managerId?o(e.managerId):null,g=e.delegateMention?l(e.delegateMention):null;return u.jsxs(sn,{children:[u.jsxs(Ar,{children:[u.jsx(Rr,{children:"Profile"}),e.status==="active"&&u.jsxs(me,{size:"xs",variant:"outline",onClick:()=>a(!0),children:[u.jsx(Vu,{className:"h-3 w-3"})," Edit"]})]}),u.jsxs(ea,{className:"text-body space-y-1",children:[u.jsxs("div",{children:[u.jsx("span",{className:"font-semibold",children:e.displayName}),e.name&&u.jsxs("span",{className:"ml-2 font-mono text-caption text-muted-foreground",children:["@",e.name]}),g&&u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"mx-2 text-muted-foreground",children:"·"}),u.jsxs("span",{className:"text-muted-foreground",children:["delegate ",u.jsx(iE,{name:g.name,displayName:g.displayName})]})]})]}),u.jsxs("div",{className:"text-caption text-muted-foreground flex flex-wrap items-center gap-x-3 gap-y-1",children:[u.jsxs("span",{children:["owner ",u.jsx("span",{className:"text-foreground",children:y??"—"})]}),m&&u.jsxs("span",{children:["role ",u.jsx("span",{className:"text-foreground",children:m})]}),u.jsxs("span",{children:["type ",u.jsx(Sn,{tone:e.type==="autonomous_agent"?"accent":"neutral",children:e.type})]}),u.jsxs("span",{children:["visibility"," ",u.jsx(Sn,{tone:e.visibility==="organization"?"accent":"outline",children:e.visibility})]}),h.length>0&&u.jsxs("span",{children:["domains"," ",u.jsx("span",{className:"inline-flex flex-wrap gap-1 align-middle",children:h.map(b=>u.jsx(Sn,{tone:"outline",children:b},b))})]})]})]}),u.jsx(QU,{agent:e,open:n,onOpenChange:a,onSave:t})]})}function QU({agent:e,open:t,onOpenChange:n,onSave:a}){var U;const{memberId:l,role:o}=qt(),[c,f]=x.useState(e.displayName),[m,h]=x.useState(e.delegateMention??""),[y,g]=x.useState(e.visibility),[b,w]=x.useState(!1),[k,j]=x.useState(null);x.useEffect(()=>{t&&(f(e.displayName),h(e.delegateMention??""),g(e.visibility),j(null))},[t,e]);const E=e.type==="human",C=o==="admin"||e.managerId===l,N=He({queryKey:["agents-for-delegate"],queryFn:async()=>(await Ku({limit:100})).items.filter(O=>O.type==="personal_assistant"&&O.status==="active"),enabled:t&&E});async function z(D){D.preventDefault(),j(null);const O=c.trim();if(!O){j("Display name is required.");return}w(!0);try{const M={displayName:O,delegateMention:m||null};y!==e.visibility&&(M.visibility=y),await a(M),n(!1)}catch(M){j(M instanceof Error?M.message:String(M))}finally{w(!1)}}return u.jsx($t,{open:t,onOpenChange:n,children:u.jsxs(zt,{children:[u.jsx(Gt,{children:u.jsx(Ft,{children:"Edit Identity"})}),u.jsxs("form",{onSubmit:z,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{children:"Agent name"}),u.jsx(jt,{value:e.name?`@${e.name}`:"",disabled:!0,className:"font-mono"}),u.jsx("p",{className:"text-caption text-muted-foreground",children:"Agent name is permanent after creation — used in @mentions and CLI commands."})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{htmlFor:"id-display",children:"Display Name"}),u.jsx(jt,{id:"id-display",value:c,onChange:D=>f(D.target.value),placeholder:"How teammates see this agent",maxLength:200})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{htmlFor:"id-visibility",children:"Visibility"}),u.jsxs("select",{id:"id-visibility",value:y,onChange:D=>g(D.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:[u.jsx("option",{value:ww.PRIVATE,children:"Private — only the manager"}),u.jsx("option",{value:ww.ORGANIZATION,children:"Organization — all members"})]}),u.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&&u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{htmlFor:"id-delegate",children:"Delegate Mention"}),u.jsxs("select",{id:"id-delegate",value:m,onChange:D=>h(D.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:[u.jsx("option",{value:"",children:"None"}),(U=N.data)==null?void 0:U.map(D=>u.jsx("option",{value:D.uuid,children:D.displayName?`${D.displayName} (@${D.name??D.uuid})`:D.name?`@${D.name}`:D.uuid},D.uuid))]}),u.jsx("p",{className:"text-caption text-muted-foreground",children:"Assistant that acts on behalf of this agent."})]}),k&&u.jsx("p",{className:"text-body text-destructive",children:k}),u.jsxs(tn,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>n(!1),disabled:b,children:"Cancel"}),u.jsx(me,{type:"submit",disabled:b,children:b?"Saving…":"Save"})]})]})]})})}function GU(e){return e==="working"?"accent":e==="error"?"error":"outline"}function KU(e){const[t,n]=x.useState(null),a=e.items.filter(l=>l.status!=="deleted").length;return u.jsxs(sn,{children:[u.jsxs(Ar,{children:[u.jsxs(Rr,{children:["MCP servers (",a,")"]}),!e.disabled&&u.jsxs(me,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[u.jsx(Jr,{className:"h-3 w-3"})," Add"]})]}),u.jsx(ea,{className:"space-y-2",children:e.items.length===0?u.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 u.jsxs(Iy,{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:[u.jsx("span",{className:"text-caption rounded bg-muted px-1.5 py-0.5 font-mono",children:l.value.transport}),u.jsx("span",{className:"font-medium font-mono",children:l.value.name}),u.jsx(Sn,{tone:GU(o),children:o}),u.jsx("span",{className:"text-caption text-muted-foreground truncate",children:YU(l.value)})]},l.key)})}),t&&u.jsx(XU,{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 YU(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 XU({open:e,onOpenChange:t,initial:n,forbiddenNames:a,onSubmit:l}){const[o,c]=x.useState((n==null?void 0:n.transport)??"stdio"),[f,m]=x.useState((n==null?void 0:n.name)??""),[h,y]=x.useState((n==null?void 0:n.transport)==="stdio"?n.command:""),[g,b]=x.useState((n==null?void 0:n.transport)==="stdio"&&n.args?n.args.join(" "):""),[w,k]=x.useState(n&&(n.transport==="http"||n.transport==="sse")?n.url:""),[j,E]=x.useState(null);x.useEffect(()=>{e&&(c((n==null?void 0:n.transport)??"stdio"),m((n==null?void 0:n.name)??""),y((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(N){if(N.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 z;if(o==="stdio"){if(!h.trim()){E("stdio transport requires a command.");return}const U=g.trim().split(/\s+/).filter(D=>D.length>0);z={name:f,transport:"stdio",command:h.trim(),...U.length?{args:U}:{}}}else{const U=w.trim();try{new URL(U)}catch{E("URL is not valid.");return}z={name:f,transport:o,url:U}}l(z)}return u.jsx($t,{open:e,onOpenChange:t,children:u.jsxs(zt,{children:[u.jsx(Gt,{children:u.jsx(Ft,{children:n?"Edit MCP server":"Add MCP server"})}),u.jsxs("form",{onSubmit:C,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{htmlFor:"mcp-transport",children:"Transport"}),u.jsxs("select",{id:"mcp-transport",value:o,onChange:N=>c(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:[u.jsx("option",{value:"stdio",children:"stdio (local subprocess)"}),u.jsx("option",{value:"http",children:"http"}),u.jsx("option",{value:"sse",children:"sse"})]})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{htmlFor:"mcp-name",children:"Name"}),u.jsx(jt,{id:"mcp-name",value:f,onChange:N=>m(N.target.value),placeholder:"playwright",className:"font-mono"})]}),o==="stdio"?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{htmlFor:"mcp-command",children:"Command"}),u.jsx(jt,{id:"mcp-command",value:h,onChange:N=>y(N.target.value),placeholder:"/usr/local/bin/playwright-mcp",className:"font-mono"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{htmlFor:"mcp-args",children:"Args (space-separated, optional)"}),u.jsx(jt,{id:"mcp-args",value:g,onChange:N=>b(N.target.value),placeholder:"--port 3000",className:"font-mono"})]})]}):u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{htmlFor:"mcp-url",children:"URL"}),u.jsx(jt,{id:"mcp-url",value:w,onChange:N=>k(N.target.value),placeholder:"https://internal.api/mcp",className:"font-mono"})]}),j&&u.jsx("p",{className:"text-body text-destructive",children:j}),u.jsxs(tn,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),u.jsx(me,{type:"submit",children:n?"Done":"Add"})]})]})]})})}const JU=[{value:"opus",label:"opus",hint:"most capable"},{value:"sonnet",label:"sonnet",hint:"balanced"},{value:"haiku",label:"haiku",hint:"fastest"}],WU=[{value:"gpt-5.5",label:"gpt-5.5",hint:"latest"},{value:"gpt-5.4",label:"gpt-5.4"},{value:"gpt-5.4-mini",label:"gpt-5.4-mini",hint:"fastest"},{value:"gpt-5.3-codex",label:"gpt-5.3-codex",hint:"coding-specialized"},{value:"gpt-5.2",label:"gpt-5.2"}],eP={"claude-code":JU,codex:WU},tP={"claude-code":"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 ~/.claude/settings.json model preference, then the CLI default.",codex:"Pick a Codex model. Slugs come from the Codex CLI bundled with @openai/codex-sdk; ChatGPT-account auth currently only accepts gpt-5.5, while API-key auth accepts the wider set. Applies to new sessions immediately; active sessions switch on their next message. Unset lets the codex CLI choose a model that matches the user's auth mode."},nP={value:"",label:"(unset — inherits local)"};function rP({value:e,baseline:t,onChange:n,onRevert:a,disabled:l,provider:o="claude-code"}){const c=e!==t,f=eP[o],m=x.useMemo(()=>{const h=[nP,...f];return e!==""&&!f.some(y=>y.value===e)&&h.push({value:e,label:e,hint:"custom"}),h},[f,e]);return u.jsxs(sn,{style:{borderColor:c?"color-mix(in oklch, var(--state-blocked) 70%, transparent)":void 0},children:[u.jsxs(Ar,{children:[u.jsxs(Rr,{children:["Model",c&&u.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"})]}),c&&u.jsx(me,{size:"xs",variant:"ghost",onClick:a,disabled:l,children:"Revert"})]}),u.jsxs(ea,{className:"space-y-2",children:[u.jsx(aP,{items:m,value:e,onChange:n,disabled:l}),u.jsx("p",{className:"text-caption text-muted-foreground",children:tP[o]})]})]})}function aP({items:e,value:t,onChange:n,disabled:a}){const[l,o]=x.useState(!1),[c,f]=x.useState(null),m=x.useRef(null),h=x.useRef(null),y=e.find(b=>b.value===t)??e[0],g=x.useCallback(()=>{const b=m.current;if(!b)return;const w=b.getBoundingClientRect();f({top:w.bottom+4,left:w.left,width:w.width})},[]);return x.useLayoutEffect(()=>{l&&g()},[l,g]),x.useEffect(()=>{if(!l)return;const b=j=>{var C,N;const E=j.target;(C=m.current)!=null&&C.contains(E)||(N=h.current)!=null&&N.contains(E)||o(!1)},w=j=>{var E;j.key==="Escape"&&(o(!1),(E=m.current)==null||E.focus())},k=()=>g();return document.addEventListener("pointerdown",b),document.addEventListener("keydown",w),window.addEventListener("scroll",k,!0),window.addEventListener("resize",k),()=>{document.removeEventListener("pointerdown",b),document.removeEventListener("keydown",w),window.removeEventListener("scroll",k,!0),window.removeEventListener("resize",k)}},[l,g]),u.jsxs("div",{className:"max-w-md",children:[u.jsxs("button",{ref:m,type:"button",disabled:a,onClick:()=>o(b=>!b),className:"mono flex h-9 w-full items-center justify-between rounded-[var(--radius-input)] border border-input bg-transparent pl-3 pr-2 py-1 text-body shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50 hover:border-ring transition-colors cursor-pointer","aria-haspopup":"listbox","aria-expanded":l,children:[u.jsx("span",{className:"truncate",style:{color:(y==null?void 0:y.value)===""?"var(--fg-3)":void 0},children:(y==null?void 0:y.label)??t}),u.jsx(zk,{className:"ml-2 h-3.5 w-3.5 transition-transform",style:{color:"var(--fg-3)",transform:l?"rotate(180deg)":void 0}})]}),l&&c&&gy.createPortal(u.jsx("div",{ref:h,className:"fixed z-50 overflow-hidden rounded-[var(--radius-input)] py-1",style:{top:c.top,left:c.left,width:c.width,background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",boxShadow:"var(--shadow-md)",maxHeight:280,overflowY:"auto"},children:e.map(b=>{const w=b.value===t;return u.jsxs("button",{type:"button",onClick:()=>{n(b.value),o(!1)},className:"mono flex w-full items-center gap-2 cursor-pointer px-3 py-1.5 text-body text-left hover:bg-accent/40 transition-colors focus-visible:outline-none focus-visible:bg-accent/40",style:{background:w?"var(--bg-hover)":void 0,color:b.value===""?"var(--fg-3)":void 0},children:[u.jsx(cr,{className:"h-3.5 w-3.5 flex-shrink-0",style:{visibility:w?"visible":"hidden",color:"var(--state-idle)"}}),u.jsx("span",{className:"flex-1 truncate",children:b.label}),b.hint&&u.jsx("span",{className:"text-caption",style:{color:"var(--fg-4)"},children:b.hint})]},b.value||"__unset")})}),document.body)]})}function iP(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const lP=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,sP=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,oP={};function Ew(e,t){return(oP.jsx?sP:lP).test(e)}const uP=/[ \t\n\f\r]/g;function cP(e){return typeof e=="object"?e.type==="text"?Nw(e.value):!1:Nw(e)}function Nw(e){return e.replace(uP,"")===""}class Ju{constructor(t,n,a){this.normal=n,this.property=t,a&&(this.space=a)}}Ju.prototype.normal={};Ju.prototype.property={};Ju.prototype.space=void 0;function lE(e,t){const n={},a={};for(const l of e)Object.assign(n,l.property),Object.assign(a,l.normal);return new Ju(n,a,t)}function Rg(e){return e.toLowerCase()}class Yn{constructor(t,n){this.attribute=n,this.property=t}}Yn.prototype.attribute="";Yn.prototype.booleanish=!1;Yn.prototype.boolean=!1;Yn.prototype.commaOrSpaceSeparated=!1;Yn.prototype.commaSeparated=!1;Yn.prototype.defined=!1;Yn.prototype.mustUseProperty=!1;Yn.prototype.number=!1;Yn.prototype.overloadedBoolean=!1;Yn.prototype.property="";Yn.prototype.spaceSeparated=!1;Yn.prototype.space=void 0;let dP=0;const Qe=Nl(),Wt=Nl(),zg=Nl(),ge=Nl(),Et=Nl(),_s=Nl(),ir=Nl();function Nl(){return 2**++dP}const Og=Object.freeze(Object.defineProperty({__proto__:null,boolean:Qe,booleanish:Wt,commaOrSpaceSeparated:ir,commaSeparated:_s,number:ge,overloadedBoolean:zg,spaceSeparated:Et},Symbol.toStringTag,{value:"Module"})),Sp=Object.keys(Og);class Uy extends Yn{constructor(t,n,a,l){let o=-1;if(super(t,n),_w(this,"space",l),typeof a=="number")for(;++o<Sp.length;){const c=Sp[o];_w(this,Sp[o],(a&Og[c])===Og[c])}}}Uy.prototype.defined=!0;function _w(e,t,n){n&&(e[t]=n)}function lo(e){const t={},n={};for(const[a,l]of Object.entries(e.properties)){const o=new Uy(a,e.transform(e.attributes||{},a),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(o.mustUseProperty=!0),t[a]=o,n[Rg(a)]=a,n[Rg(o.attribute)]=a}return new Ju(t,n,e.space)}const sE=lo({properties:{ariaActiveDescendant:null,ariaAtomic:Wt,ariaAutoComplete:null,ariaBusy:Wt,ariaChecked:Wt,ariaColCount:ge,ariaColIndex:ge,ariaColSpan:ge,ariaControls:Et,ariaCurrent:null,ariaDescribedBy:Et,ariaDetails:null,ariaDisabled:Wt,ariaDropEffect:Et,ariaErrorMessage:null,ariaExpanded:Wt,ariaFlowTo:Et,ariaGrabbed:Wt,ariaHasPopup:null,ariaHidden:Wt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Et,ariaLevel:ge,ariaLive:null,ariaModal:Wt,ariaMultiLine:Wt,ariaMultiSelectable:Wt,ariaOrientation:null,ariaOwns:Et,ariaPlaceholder:null,ariaPosInSet:ge,ariaPressed:Wt,ariaReadOnly:Wt,ariaRelevant:null,ariaRequired:Wt,ariaRoleDescription:Et,ariaRowCount:ge,ariaRowIndex:ge,ariaRowSpan:ge,ariaSelected:Wt,ariaSetSize:ge,ariaSort:null,ariaValueMax:ge,ariaValueMin:ge,ariaValueNow:ge,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function oE(e,t){return t in e?e[t]:t}function uE(e,t){return oE(e,t.toLowerCase())}const fP=lo({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:_s,acceptCharset:Et,accessKey:Et,action:null,allow:null,allowFullScreen:Qe,allowPaymentRequest:Qe,allowUserMedia:Qe,alt:null,as:null,async:Qe,autoCapitalize:null,autoComplete:Et,autoFocus:Qe,autoPlay:Qe,blocking:Et,capture:null,charSet:null,checked:Qe,cite:null,className:Et,cols:ge,colSpan:null,content:null,contentEditable:Wt,controls:Qe,controlsList:Et,coords:ge|_s,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Qe,defer:Qe,dir:null,dirName:null,disabled:Qe,download:zg,draggable:Wt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Qe,formTarget:null,headers:Et,height:ge,hidden:zg,high:ge,href:null,hrefLang:null,htmlFor:Et,httpEquiv:Et,id:null,imageSizes:null,imageSrcSet:null,inert:Qe,inputMode:null,integrity:null,is:null,isMap:Qe,itemId:null,itemProp:Et,itemRef:Et,itemScope:Qe,itemType:Et,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Qe,low:ge,manifest:null,max:null,maxLength:ge,media:null,method:null,min:null,minLength:ge,multiple:Qe,muted:Qe,name:null,nonce:null,noModule:Qe,noValidate:Qe,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:Qe,optimum:ge,pattern:null,ping:Et,placeholder:null,playsInline:Qe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Qe,referrerPolicy:null,rel:Et,required:Qe,reversed:Qe,rows:ge,rowSpan:ge,sandbox:Et,scope:null,scoped:Qe,seamless:Qe,selected:Qe,shadowRootClonable:Qe,shadowRootDelegatesFocus:Qe,shadowRootMode:null,shape:null,size:ge,sizes:null,slot:null,span:ge,spellCheck:Wt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ge,step:null,style:null,tabIndex:ge,target:null,title:null,translate:null,type:null,typeMustMatch:Qe,useMap:null,value:Wt,width:ge,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Et,axis:null,background:null,bgColor:null,border:ge,borderColor:null,bottomMargin:ge,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Qe,declare:Qe,event:null,face:null,frame:null,frameBorder:null,hSpace:ge,leftMargin:ge,link:null,longDesc:null,lowSrc:null,marginHeight:ge,marginWidth:ge,noResize:Qe,noHref:Qe,noShade:Qe,noWrap:Qe,object:null,profile:null,prompt:null,rev:null,rightMargin:ge,rules:null,scheme:null,scrolling:Wt,standby:null,summary:null,text:null,topMargin:ge,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ge,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Qe,disableRemotePlayback:Qe,prefix:null,property:null,results:ge,security:null,unselectable:null},space:"html",transform:uE}),hP=lo({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:ir,accentHeight:ge,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ge,amplitude:ge,arabicForm:null,ascent:ge,attributeName:null,attributeType:null,azimuth:ge,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ge,by:null,calcMode:null,capHeight:ge,className:Et,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:ge,diffuseConstant:ge,direction:null,display:null,dur:null,divisor:ge,dominantBaseline:null,download:Qe,dx:null,dy:null,edgeMode:null,editable:null,elevation:ge,enableBackground:null,end:null,event:null,exponent:ge,externalResourcesRequired:null,fill:null,fillOpacity:ge,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:_s,g2:_s,glyphName:_s,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ge,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ge,horizOriginX:ge,horizOriginY:ge,id:null,ideographic:ge,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ge,k:ge,k1:ge,k2:ge,k3:ge,k4:ge,kernelMatrix:ir,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ge,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:ge,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:ge,overlineThickness:ge,paintOrder:null,panose1:null,path:null,pathLength:ge,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Et,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ge,pointsAtY:ge,pointsAtZ:ge,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ir,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ir,rev:ir,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ir,requiredFeatures:ir,requiredFonts:ir,requiredFormats:ir,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:ge,specularExponent:ge,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ge,strikethroughThickness:ge,string:null,stroke:null,strokeDashArray:ir,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ge,strokeOpacity:ge,strokeWidth:null,style:null,surfaceScale:ge,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ir,tabIndex:ge,tableValues:null,target:null,targetX:ge,targetY:ge,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ir,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ge,underlineThickness:ge,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ge,values:null,vAlphabetic:ge,vMathematical:ge,vectorEffect:null,vHanging:ge,vIdeographic:ge,version:null,vertAdvY:ge,vertOriginX:ge,vertOriginY:ge,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ge,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:oE}),cE=lo({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()}}),dE=lo({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:uE}),fE=lo({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),mP={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"},pP=/[A-Z]/g,Tw=/-[a-z]/g,gP=/^data[-\w.:]+$/i;function yP(e,t){const n=Rg(t);let a=t,l=Yn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&gP.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Tw,bP);a="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Tw.test(o)){let c=o.replace(pP,vP);c.charAt(0)!=="-"&&(c="-"+c),t="data"+c}}l=Uy}return new l(a,t)}function vP(e){return"-"+e.toLowerCase()}function bP(e){return e.charAt(1).toUpperCase()}const xP=lE([sE,fP,cE,dE,fE],"html"),Py=lE([sE,hP,cE,dE,fE],"svg");function wP(e){return e.join(" ").trim()}var gs={},kp,Aw;function SP(){if(Aw)return kp;Aw=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,f=/^\s+|\s+$/g,m=`
|
|
358
|
+
`,h="/",y="*",g="",b="comment",w="declaration";function k(E,C){if(typeof E!="string")throw new TypeError("First argument must be a string");if(!E)return[];C=C||{};var N=1,z=1;function U(he){var ne=he.match(t);ne&&(N+=ne.length);var Z=he.lastIndexOf(m);z=~Z?he.length-Z:z+he.length}function D(){var he={line:N,column:z};return function(ne){return ne.position=new O(he),X(),ne}}function O(he){this.start=he,this.end={line:N,column:z},this.source=C.source}O.prototype.content=E;function M(he){var ne=new Error(C.source+":"+N+":"+z+": "+he);if(ne.reason=he,ne.filename=C.source,ne.line=N,ne.column=z,ne.source=E,!C.silent)throw ne}function I(he){var ne=he.exec(E);if(ne){var Z=ne[0];return U(Z),E=E.slice(Z.length),ne}}function X(){I(n)}function F(he){var ne;for(he=he||[];ne=W();)ne!==!1&&he.push(ne);return he}function W(){var he=D();if(!(h!=E.charAt(0)||y!=E.charAt(1))){for(var ne=2;g!=E.charAt(ne)&&(y!=E.charAt(ne)||h!=E.charAt(ne+1));)++ne;if(ne+=2,g===E.charAt(ne-1))return M("End of comment missing");var Z=E.slice(2,ne-2);return z+=2,U(Z),E=E.slice(ne),z+=2,he({type:b,comment:Z})}}function ee(){var he=D(),ne=I(a);if(ne){if(W(),!I(l))return M("property missing ':'");var Z=I(o),te=he({type:w,property:j(ne[0].replace(e,g)),value:Z?j(Z[0].replace(e,g)):g});return I(c),te}}function ye(){var he=[];F(he);for(var ne;ne=ee();)ne!==!1&&(he.push(ne),F(he));return he}return X(),ye()}function j(E){return E?E.replace(f,g):g}return kp=k,kp}var Rw;function kP(){if(Rw)return gs;Rw=1;var e=gs&&gs.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(gs,"__esModule",{value:!0}),gs.default=n;const t=e(SP());function n(a,l){let o=null;if(!a||typeof a!="string")return o;const c=(0,t.default)(a),f=typeof l=="function";return c.forEach(m=>{if(m.type!=="declaration")return;const{property:h,value:y}=m;f?l(h,y,m):y&&(o=o||{},o[h]=y)}),o}return gs}var ou={},zw;function jP(){if(zw)return ou;zw=1,Object.defineProperty(ou,"__esModule",{value:!0}),ou.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)},c=function(h,y){return y.toUpperCase()},f=function(h,y){return"".concat(y,"-")},m=function(h,y){return y===void 0&&(y={}),o(h)?h:(h=h.toLowerCase(),y.reactCompat?h=h.replace(l,f):h=h.replace(a,f),h.replace(t,c))};return ou.camelCase=m,ou}var uu,Ow;function CP(){if(Ow)return uu;Ow=1;var e=uu&&uu.__importDefault||function(l){return l&&l.__esModule?l:{default:l}},t=e(kP()),n=jP();function a(l,o){var c={};return!l||typeof l!="string"||(0,t.default)(l,function(f,m){f&&m&&(c[(0,n.camelCase)(f,o)]=m)}),c}return a.default=a,uu=a,uu}var EP=CP();const NP=df(EP),hE=mE("end"),By=mE("start");function mE(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 _P(e){const t=By(e),n=hE(e);if(t&&n)return{start:t,end:n}}function vu(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Dw(e.position):"start"in e||"end"in e?Dw(e):"line"in e||"column"in e?Dg(e):""}function Dg(e){return Mw(e&&e.line)+":"+Mw(e&&e.column)}function Dw(e){return Dg(e&&e.start)+"-"+Dg(e&&e.end)}function Mw(e){return e&&typeof e=="number"?e:1}class An extends Error{constructor(t,n,a){super(),typeof n=="string"&&(a=n,n=void 0);let l="",o={},c=!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&&(c=!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=vu(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=c&&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}}An.prototype.file="";An.prototype.name="";An.prototype.reason="";An.prototype.message="";An.prototype.stack="";An.prototype.column=void 0;An.prototype.line=void 0;An.prototype.ancestors=void 0;An.prototype.cause=void 0;An.prototype.fatal=void 0;An.prototype.place=void 0;An.prototype.ruleId=void 0;An.prototype.source=void 0;const $y={}.hasOwnProperty,TP=new Map,AP=/[A-Z]/g,RP=new Set(["table","tbody","thead","tfoot","tr"]),zP=new Set(["td","th"]),pE="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function OP(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=$P(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=BP(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"?Py:xP,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=gE(l,e,void 0);return o&&typeof o!="string"?o:l.create(e,l.Fragment,{children:o||void 0},void 0)}function gE(e,t,n){if(t.type==="element")return DP(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return MP(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return IP(e,t,n);if(t.type==="mdxjsEsm")return LP(e,t);if(t.type==="root")return UP(e,t,n);if(t.type==="text")return PP(e,t)}function DP(e,t,n){const a=e.schema;let l=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(l=Py,e.schema=l),e.ancestors.push(t);const o=vE(e,t.tagName,!1),c=FP(e,t);let f=qy(e,t);return RP.has(t.tagName)&&(f=f.filter(function(m){return typeof m=="string"?!cP(m):!0})),yE(e,c,o,t),Fy(c,f),e.ancestors.pop(),e.schema=a,e.create(t,o,c,n)}function MP(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)}Ru(e,t.position)}function LP(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ru(e,t.position)}function IP(e,t,n){const a=e.schema;let l=a;t.name==="svg"&&a.space==="html"&&(l=Py,e.schema=l),e.ancestors.push(t);const o=t.name===null?e.Fragment:vE(e,t.name,!0),c=qP(e,t),f=qy(e,t);return yE(e,c,o,t),Fy(c,f),e.ancestors.pop(),e.schema=a,e.create(t,o,c,n)}function UP(e,t,n){const a={};return Fy(a,qy(e,t)),e.create(t,e.Fragment,a,n)}function PP(e,t){return t.value}function yE(e,t,n,a){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=a)}function Fy(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function BP(e,t,n){return a;function a(l,o,c,f){const h=Array.isArray(c.children)?n:t;return f?h(o,c,f):h(o,c)}}function $P(e,t){return n;function n(a,l,o,c){const f=Array.isArray(o.children),m=By(a);return t(l,o,c,f,{columnNumber:m?m.column-1:void 0,fileName:e,lineNumber:m?m.line:void 0},void 0)}}function FP(e,t){const n={};let a,l;for(l in t.properties)if(l!=="children"&&$y.call(t.properties,l)){const o=HP(e,l,t.properties[l]);if(o){const[c,f]=o;e.tableCellAlignToStyle&&c==="align"&&typeof f=="string"&&zP.has(t.tagName)?a=f:n[c]=f}}if(a){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return n}function qP(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 c=o.expression;c.type;const f=c.properties[0];f.type,Object.assign(n,e.evaluater.evaluateExpression(f.argument))}else Ru(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 Ru(e,t.position);else o=a.value===null?!0:a.value;n[l]=o}return n}function qy(e,t){const n=[];let a=-1;const l=e.passKeys?new Map:TP;for(;++a<t.children.length;){const o=t.children[a];let c;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;c=m+"-"+h,l.set(m,h+1)}}const f=gE(e,o,c);f!==void 0&&n.push(f)}return n}function HP(e,t,n){const a=yP(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=a.commaSeparated?iP(n):wP(n)),a.property==="style"){let l=typeof n=="object"?n:ZP(e,String(n));return e.stylePropertyNameCase==="css"&&(l=VP(l)),["style",l]}return[e.elementAttributeNameCase==="react"&&a.space?mP[a.property]||a.property:a.attribute,n]}}function ZP(e,t){try{return NP(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const a=n,l=new An("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=pE+"#cannot-parse-style-attribute",l}}function vE(e,t,n){let a;if(!n)a={type:"Literal",value:t};else if(t.includes(".")){const l=t.split(".");let o=-1,c;for(;++o<l.length;){const f=Ew(l[o])?{type:"Identifier",name:l[o]}:{type:"Literal",value:l[o]};c=c?{type:"MemberExpression",object:c,property:f,computed:!!(o&&f.type==="Literal"),optional:!1}:f}a=c}else a=Ew(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(a.type==="Literal"){const l=a.value;return $y.call(e.components,l)?e.components[l]:l}if(e.evaluater)return e.evaluater.evaluateExpression(a);Ru(e)}function Ru(e,t){const n=new An("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=pE+"#cannot-handle-mdx-estrees-without-createevaluater",n}function VP(e){const t={};let n;for(n in e)$y.call(e,n)&&(t[QP(n)]=e[n]);return t}function QP(e){let t=e.replace(AP,GP);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function GP(e){return"-"+e.toLowerCase()}const jp={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"]},KP={};function Hy(e,t){const n=KP,a=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,l=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return bE(e,a,l)}function bE(e,t,n){if(YP(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 Lw(e.children,t,n)}return Array.isArray(e)?Lw(e,t,n):""}function Lw(e,t,n){const a=[];let l=-1;for(;++l<e.length;)a[l]=bE(e[l],t,n);return a.join("")}function YP(e){return!!(e&&typeof e=="object")}const Iw=document.createElement("i");function Zy(e){const t="&"+e+";";Iw.innerHTML=t;const n=Iw.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ur(e,t,n,a){const l=e.length;let o=0,c;if(t<0?t=-t>l?0:l+t:t=t>l?l:t,n=n>0?n:0,a.length<1e4)c=Array.from(a),c.unshift(t,n),e.splice(...c);else for(n&&e.splice(t,n);o<a.length;)c=a.slice(o,o+1e4),c.unshift(t,0),e.splice(...c),o+=1e4,t+=1e4}function Er(e,t){return e.length>0?(ur(e,e.length,0,t),e):t}const Uw={}.hasOwnProperty;function xE(e){const t={};let n=-1;for(;++n<e.length;)XP(t,e[n]);return t}function XP(e,t){let n;for(n in t){const l=(Uw.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let c;if(o)for(c in o){Uw.call(l,c)||(l[c]=[]);const f=o[c];JP(l[c],Array.isArray(f)?f:f?[f]:[])}}}function JP(e,t){let n=-1;const a=[];for(;++n<t.length;)(t[n].add==="after"?e:a).push(t[n]);ur(e,0,0,a)}function wE(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 Ir(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Dn=Mi(/[A-Za-z]/),Tn=Mi(/[\dA-Za-z]/),WP=Mi(/[#-'*+\--9=?A-Z^-~]/);function sf(e){return e!==null&&(e<32||e===127)}const Mg=Mi(/\d/),e9=Mi(/[\dA-Fa-f]/),t9=Mi(/[!-/:-@[-`{-~]/);function Oe(e){return e!==null&&e<-2}function Ct(e){return e!==null&&(e<0||e===32)}function tt(e){return e===-2||e===-1||e===32}const Of=Mi(new RegExp("\\p{P}|\\p{S}","u")),wl=Mi(/\s/);function Mi(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function so(e){const t=[];let n=-1,a=0,l=0;for(;++n<e.length;){const o=e.charCodeAt(n);let c="";if(o===37&&Tn(e.charCodeAt(n+1))&&Tn(e.charCodeAt(n+2)))l=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(c=String.fromCharCode(o));else if(o>55295&&o<57344){const f=e.charCodeAt(n+1);o<56320&&f>56319&&f<57344?(c=String.fromCharCode(o,f),l=1):c="�"}else c=String.fromCharCode(o);c&&(t.push(e.slice(a,n),encodeURIComponent(c)),a=n+l+1,c=""),l&&(n+=l,l=0)}return t.join("")+e.slice(a)}function ut(e,t,n,a){const l=a?a-1:Number.POSITIVE_INFINITY;let o=0;return c;function c(m){return tt(m)?(e.enter(n),f(m)):t(m)}function f(m){return tt(m)&&o++<l?(e.consume(m),f):(e.exit(n),t(m))}}const n9={tokenize:r9};function r9(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"),ut(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,c(f)}function c(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return Oe(f)?(e.consume(f),e.exit("chunkText"),o):(e.consume(f),c)}}const a9={tokenize:i9},Pw={tokenize:l9};function i9(e){const t=this,n=[];let a=0,l,o,c;return f;function f(z){if(a<n.length){const U=n[a];return t.containerState=U[1],e.attempt(U[0].continuation,m,h)(z)}return h(z)}function m(z){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,l&&N();const U=t.events.length;let D=U,O;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){O=t.events[D][1].end;break}C(a);let M=U;for(;M<t.events.length;)t.events[M][1].end={...O},M++;return ur(t.events,D+1,0,t.events.slice(U)),t.events.length=M,h(z)}return f(z)}function h(z){if(a===n.length){if(!l)return b(z);if(l.currentConstruct&&l.currentConstruct.concrete)return k(z);t.interrupt=!!(l.currentConstruct&&!l._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Pw,y,g)(z)}function y(z){return l&&N(),C(a),b(z)}function g(z){return t.parser.lazy[t.now().line]=a!==n.length,c=t.now().offset,k(z)}function b(z){return t.containerState={},e.attempt(Pw,w,k)(z)}function w(z){return a++,n.push([t.currentConstruct,t.containerState]),b(z)}function k(z){if(z===null){l&&N(),C(0),e.consume(z);return}return l=l||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:l,contentType:"flow",previous:o}),j(z)}function j(z){if(z===null){E(e.exit("chunkFlow"),!0),C(0),e.consume(z);return}return Oe(z)?(e.consume(z),E(e.exit("chunkFlow")),a=0,t.interrupt=void 0,f):(e.consume(z),j)}function E(z,U){const D=t.sliceStream(z);if(U&&D.push(null),z.previous=o,o&&(o.next=z),o=z,l.defineSkip(z.start),l.write(D),t.parser.lazy[z.start.line]){let O=l.events.length;for(;O--;)if(l.events[O][1].start.offset<c&&(!l.events[O][1].end||l.events[O][1].end.offset>c))return;const M=t.events.length;let I=M,X,F;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){if(X){F=t.events[I][1].end;break}X=!0}for(C(a),O=M;O<t.events.length;)t.events[O][1].end={...F},O++;ur(t.events,I+1,0,t.events.slice(M)),t.events.length=O}}function C(z){let U=n.length;for(;U-- >z;){const D=n[U];t.containerState=D[1],D[0].exit.call(t,e)}n.length=z}function N(){l.write([null]),o=void 0,l=void 0,t.containerState._closeFlow=void 0}}function l9(e,t,n){return ut(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ks(e){if(e===null||Ct(e)||wl(e))return 1;if(Of(e))return 2}function Df(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 Lg={name:"attention",resolveAll:s9,tokenize:o9};function s9(e,t){let n=-1,a,l,o,c,f,m,h,y;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 g={...e[a][1].end},b={...e[n][1].start};Bw(g,-m),Bw(b,m),c={type:m>1?"strongSequence":"emphasisSequence",start:g,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:{...c.start},end:{...f.end}},e[a][1].end={...c.start},e[n][1].start={...f.end},h=[],e[a][1].end.offset-e[a][1].start.offset&&(h=Er(h,[["enter",e[a][1],t],["exit",e[a][1],t]])),h=Er(h,[["enter",l,t],["enter",c,t],["exit",c,t],["enter",o,t]]),h=Er(h,Df(t.parser.constructs.insideSpan.null,e.slice(a+1,n),t)),h=Er(h,[["exit",o,t],["enter",f,t],["exit",f,t],["exit",l,t]]),e[n][1].end.offset-e[n][1].start.offset?(y=2,h=Er(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):y=0,ur(e,a-1,n-a+3,h),n=a+h.length-y-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function o9(e,t){const n=this.parser.constructs.attentionMarkers.null,a=this.previous,l=Ks(a);let o;return c;function c(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"),y=Ks(m),g=!y||y===2&&l||n.includes(m),b=!l||l===2&&y||n.includes(a);return h._open=!!(o===42?g:g&&(l||!b)),h._close=!!(o===42?b:b&&(y||!g)),t(m)}}function Bw(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const u9={name:"autolink",tokenize:c9};function c9(e,t,n){let a=0;return l;function l(w){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(w){return Dn(w)?(e.consume(w),c):w===64?n(w):h(w)}function c(w){return w===43||w===45||w===46||Tn(w)?(a=1,f(w)):h(w)}function f(w){return w===58?(e.consume(w),a=0,m):(w===43||w===45||w===46||Tn(w))&&a++<32?(e.consume(w),f):(a=0,h(w))}function m(w){return w===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),t):w===null||w===32||w===60||sf(w)?n(w):(e.consume(w),m)}function h(w){return w===64?(e.consume(w),y):WP(w)?(e.consume(w),h):n(w)}function y(w){return Tn(w)?g(w):n(w)}function g(w){return w===46?(e.consume(w),a=0,y):w===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),t):b(w)}function b(w){if((w===45||Tn(w))&&a++<63){const k=w===45?b:g;return e.consume(w),k}return n(w)}}const Wu={partial:!0,tokenize:d9};function d9(e,t,n){return a;function a(o){return tt(o)?ut(e,l,"linePrefix")(o):l(o)}function l(o){return o===null||Oe(o)?t(o):n(o)}}const SE={continuation:{tokenize:h9},exit:m9,name:"blockQuote",tokenize:f9};function f9(e,t,n){const a=this;return l;function l(c){if(c===62){const f=a.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(c),e.exit("blockQuoteMarker"),o}return n(c)}function o(c){return tt(c)?(e.enter("blockQuotePrefixWhitespace"),e.consume(c),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(c))}}function h9(e,t,n){const a=this;return l;function l(c){return tt(c)?ut(e,o,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):o(c)}function o(c){return e.attempt(SE,t,n)(c)}}function m9(e){e.exit("blockQuote")}const kE={name:"characterEscape",tokenize:p9};function p9(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 t9(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const jE={name:"characterReference",tokenize:g9};function g9(e,t,n){const a=this;let l=0,o,c;return f;function f(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),m}function m(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),o=31,c=Tn,y(g))}function h(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,c=e9,y):(e.enter("characterReferenceValue"),o=7,c=Mg,y(g))}function y(g){if(g===59&&l){const b=e.exit("characterReferenceValue");return c===Tn&&!Zy(a.sliceSerialize(b))?n(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return c(g)&&l++<o?(e.consume(g),y):n(g)}}const $w={partial:!0,tokenize:v9},Fw={concrete:!0,name:"codeFenced",tokenize:y9};function y9(e,t,n){const a=this,l={partial:!0,tokenize:D};let o=0,c=0,f;return m;function m(O){return h(O)}function h(O){const M=a.events[a.events.length-1];return o=M&&M[1].type==="linePrefix"?M[2].sliceSerialize(M[1],!0).length:0,f=O,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),y(O)}function y(O){return O===f?(c++,e.consume(O),y):c<3?n(O):(e.exit("codeFencedFenceSequence"),tt(O)?ut(e,g,"whitespace")(O):g(O))}function g(O){return O===null||Oe(O)?(e.exit("codeFencedFence"),a.interrupt?t(O):e.check($w,j,U)(O)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(O))}function b(O){return O===null||Oe(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(O)):tt(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ut(e,w,"whitespace")(O)):O===96&&O===f?n(O):(e.consume(O),b)}function w(O){return O===null||Oe(O)?g(O):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),k(O))}function k(O){return O===null||Oe(O)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(O)):O===96&&O===f?n(O):(e.consume(O),k)}function j(O){return e.attempt(l,U,E)(O)}function E(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),C}function C(O){return o>0&&tt(O)?ut(e,N,"linePrefix",o+1)(O):N(O)}function N(O){return O===null||Oe(O)?e.check($w,j,U)(O):(e.enter("codeFlowValue"),z(O))}function z(O){return O===null||Oe(O)?(e.exit("codeFlowValue"),N(O)):(e.consume(O),z)}function U(O){return e.exit("codeFenced"),t(O)}function D(O,M,I){let X=0;return F;function F(ne){return O.enter("lineEnding"),O.consume(ne),O.exit("lineEnding"),W}function W(ne){return O.enter("codeFencedFence"),tt(ne)?ut(O,ee,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ne):ee(ne)}function ee(ne){return ne===f?(O.enter("codeFencedFenceSequence"),ye(ne)):I(ne)}function ye(ne){return ne===f?(X++,O.consume(ne),ye):X>=c?(O.exit("codeFencedFenceSequence"),tt(ne)?ut(O,he,"whitespace")(ne):he(ne)):I(ne)}function he(ne){return ne===null||Oe(ne)?(O.exit("codeFencedFence"),M(ne)):I(ne)}}}function v9(e,t,n){const a=this;return l;function l(c){return c===null?n(c):(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o)}function o(c){return a.parser.lazy[a.now().line]?n(c):t(c)}}const Cp={name:"codeIndented",tokenize:x9},b9={partial:!0,tokenize:w9};function x9(e,t,n){const a=this;return l;function l(h){return e.enter("codeIndented"),ut(e,o,"linePrefix",5)(h)}function o(h){const y=a.events[a.events.length-1];return y&&y[1].type==="linePrefix"&&y[2].sliceSerialize(y[1],!0).length>=4?c(h):n(h)}function c(h){return h===null?m(h):Oe(h)?e.attempt(b9,c,m)(h):(e.enter("codeFlowValue"),f(h))}function f(h){return h===null||Oe(h)?(e.exit("codeFlowValue"),c(h)):(e.consume(h),f)}function m(h){return e.exit("codeIndented"),t(h)}}function w9(e,t,n){const a=this;return l;function l(c){return a.parser.lazy[a.now().line]?n(c):Oe(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),l):ut(e,o,"linePrefix",5)(c)}function o(c){const f=a.events[a.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(c):Oe(c)?l(c):n(c)}}const S9={name:"codeText",previous:j9,resolve:k9,tokenize:C9};function k9(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 j9(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function C9(e,t,n){let a=0,l,o;return c;function c(g){return e.enter("codeText"),e.enter("codeTextSequence"),f(g)}function f(g){return g===96?(e.consume(g),a++,f):(e.exit("codeTextSequence"),m(g))}function m(g){return g===null?n(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),m):g===96?(o=e.enter("codeTextSequence"),l=0,y(g)):Oe(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),m):(e.enter("codeTextData"),h(g))}function h(g){return g===null||g===32||g===96||Oe(g)?(e.exit("codeTextData"),m(g)):(e.consume(g),h)}function y(g){return g===96?(e.consume(g),l++,y):l===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(g)):(o.type="codeTextData",h(g))}}class E9{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&&cu(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),cu(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),cu(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);cu(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);cu(this.left,n.reverse())}}}function cu(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 CE(e){const t={};let n=-1,a,l,o,c,f,m,h;const y=new E9(e);for(;++n<y.length;){for(;n in t;)n=t[n];if(a=y.get(n),n&&a[1].type==="chunkFlow"&&y.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,N9(y,n)),n=t[n],h=!0);else if(a[1]._container){for(o=n,l=void 0;o--;)if(c=y.get(o),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(l&&(y.get(l)[1].type="lineEndingBlank"),c[1].type="lineEnding",l=o);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;l&&(a[1].end={...y.get(l)[1].start},f=y.slice(l,n),f.unshift(a),y.splice(l,n-l+1,f))}}return ur(e,0,Number.POSITIVE_INFINITY,y.slice(0)),!h}function N9(e,t){const n=e.get(t)[1],a=e.get(t)[2];let l=t-1;const o=[];let c=n._tokenizer;c||(c=a.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const f=c.events,m=[],h={};let y,g,b=-1,w=n,k=0,j=0;const E=[j];for(;w;){for(;e.get(++l)[1]!==w;);o.push(l),w._tokenizer||(y=a.sliceStream(w),w.next||y.push(null),g&&c.defineSkip(w.start),w._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(y),w._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),g=w,w=w.next}for(w=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),w._tokenizer=void 0,w.previous=void 0,w=w.next);for(c.events=[],w?(w._tokenizer=void 0,w.previous=void 0):E.pop(),b=E.length;b--;){const C=f.slice(E[b],E[b+1]),N=o.pop();m.push([N,N+C.length-1]),e.splice(N,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 _9={resolve:A9,tokenize:R9},T9={partial:!0,tokenize:z9};function A9(e){return CE(e),e}function R9(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):Oe(f)?e.check(T9,c,o)(f):(e.consume(f),l)}function o(f){return e.exit("chunkContent"),e.exit("content"),t(f)}function c(f){return e.consume(f),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,l}}function z9(e,t,n){const a=this;return l;function l(c){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),ut(e,o,"linePrefix")}function o(c){if(c===null||Oe(c))return n(c);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(c):e.interrupt(a.parser.constructs.flow,n,t)(c)}}function EE(e,t,n,a,l,o,c,f,m){const h=m||Number.POSITIVE_INFINITY;let y=0;return g;function g(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||sf(C)?n(C):(e.enter(a),e.enter(c),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"}),w(C))}function w(C){return C===62?(e.exit("chunkString"),e.exit(f),b(C)):C===null||C===60||Oe(C)?n(C):(e.consume(C),C===92?k:w)}function k(C){return C===60||C===62||C===92?(e.consume(C),w):w(C)}function j(C){return!y&&(C===null||C===41||Ct(C))?(e.exit("chunkString"),e.exit(f),e.exit(c),e.exit(a),t(C)):y<h&&C===40?(e.consume(C),y++,j):C===41?(e.consume(C),y--,j):C===null||C===32||C===40||sf(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 NE(e,t,n,a,l,o){const c=this;let f=0,m;return h;function h(w){return e.enter(a),e.enter(l),e.consume(w),e.exit(l),e.enter(o),y}function y(w){return f>999||w===null||w===91||w===93&&!m||w===94&&!f&&"_hiddenFootnoteSupport"in c.parser.constructs?n(w):w===93?(e.exit(o),e.enter(l),e.consume(w),e.exit(l),e.exit(a),t):Oe(w)?(e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),y):(e.enter("chunkString",{contentType:"string"}),g(w))}function g(w){return w===null||w===91||w===93||Oe(w)||f++>999?(e.exit("chunkString"),y(w)):(e.consume(w),m||(m=!tt(w)),w===92?b:g)}function b(w){return w===91||w===92||w===93?(e.consume(w),f++,g):g(w)}}function _E(e,t,n,a,l,o){let c;return f;function f(b){return b===34||b===39||b===40?(e.enter(a),e.enter(l),e.consume(b),e.exit(l),c=b===40?41:b,m):n(b)}function m(b){return b===c?(e.enter(l),e.consume(b),e.exit(l),e.exit(a),t):(e.enter(o),h(b))}function h(b){return b===c?(e.exit(o),m(c)):b===null?n(b):Oe(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),ut(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),y(b))}function y(b){return b===c||b===null||Oe(b)?(e.exit("chunkString"),h(b)):(e.consume(b),b===92?g:y)}function g(b){return b===c||b===92?(e.consume(b),y):y(b)}}function bu(e,t){let n;return a;function a(l){return Oe(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n=!0,a):tt(l)?ut(e,a,n?"linePrefix":"lineSuffix")(l):t(l)}}const O9={name:"definition",tokenize:M9},D9={partial:!0,tokenize:L9};function M9(e,t,n){const a=this;let l;return o;function o(w){return e.enter("definition"),c(w)}function c(w){return NE.call(a,e,f,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(w)}function f(w){return l=Ir(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),m):n(w)}function m(w){return Ct(w)?bu(e,h)(w):h(w)}function h(w){return EE(e,y,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(w)}function y(w){return e.attempt(D9,g,g)(w)}function g(w){return tt(w)?ut(e,b,"whitespace")(w):b(w)}function b(w){return w===null||Oe(w)?(e.exit("definition"),a.parser.defined.push(l),t(w)):n(w)}}function L9(e,t,n){return a;function a(f){return Ct(f)?bu(e,l)(f):n(f)}function l(f){return _E(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function o(f){return tt(f)?ut(e,c,"whitespace")(f):c(f)}function c(f){return f===null||Oe(f)?t(f):n(f)}}const I9={name:"hardBreakEscape",tokenize:U9};function U9(e,t,n){return a;function a(o){return e.enter("hardBreakEscape"),e.consume(o),l}function l(o){return Oe(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const P9={name:"headingAtx",resolve:B9,tokenize:$9};function B9(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"},ur(e,a,n-a+1,[["enter",l,t],["enter",o,t],["exit",o,t],["exit",l,t]])),e}function $9(e,t,n){let a=0;return l;function l(y){return e.enter("atxHeading"),o(y)}function o(y){return e.enter("atxHeadingSequence"),c(y)}function c(y){return y===35&&a++<6?(e.consume(y),c):y===null||Ct(y)?(e.exit("atxHeadingSequence"),f(y)):n(y)}function f(y){return y===35?(e.enter("atxHeadingSequence"),m(y)):y===null||Oe(y)?(e.exit("atxHeading"),t(y)):tt(y)?ut(e,f,"whitespace")(y):(e.enter("atxHeadingText"),h(y))}function m(y){return y===35?(e.consume(y),m):(e.exit("atxHeadingSequence"),f(y))}function h(y){return y===null||y===35||Ct(y)?(e.exit("atxHeadingText"),f(y)):(e.consume(y),h)}}const F9=["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"],qw=["pre","script","style","textarea"],q9={concrete:!0,name:"htmlFlow",resolveTo:V9,tokenize:Q9},H9={partial:!0,tokenize:K9},Z9={partial:!0,tokenize:G9};function V9(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 Q9(e,t,n){const a=this;let l,o,c,f,m;return h;function h(T){return y(T)}function y(T){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(T),g}function g(T){return T===33?(e.consume(T),b):T===47?(e.consume(T),o=!0,j):T===63?(e.consume(T),l=3,a.interrupt?t:A):Dn(T)?(e.consume(T),c=String.fromCharCode(T),E):n(T)}function b(T){return T===45?(e.consume(T),l=2,w):T===91?(e.consume(T),l=5,f=0,k):Dn(T)?(e.consume(T),l=4,a.interrupt?t:A):n(T)}function w(T){return T===45?(e.consume(T),a.interrupt?t:A):n(T)}function k(T){const q="CDATA[";return T===q.charCodeAt(f++)?(e.consume(T),f===q.length?a.interrupt?t:ee:k):n(T)}function j(T){return Dn(T)?(e.consume(T),c=String.fromCharCode(T),E):n(T)}function E(T){if(T===null||T===47||T===62||Ct(T)){const q=T===47,K=c.toLowerCase();return!q&&!o&&qw.includes(K)?(l=1,a.interrupt?t(T):ee(T)):F9.includes(c.toLowerCase())?(l=6,q?(e.consume(T),C):a.interrupt?t(T):ee(T)):(l=7,a.interrupt&&!a.parser.lazy[a.now().line]?n(T):o?N(T):z(T))}return T===45||Tn(T)?(e.consume(T),c+=String.fromCharCode(T),E):n(T)}function C(T){return T===62?(e.consume(T),a.interrupt?t:ee):n(T)}function N(T){return tt(T)?(e.consume(T),N):F(T)}function z(T){return T===47?(e.consume(T),F):T===58||T===95||Dn(T)?(e.consume(T),U):tt(T)?(e.consume(T),z):F(T)}function U(T){return T===45||T===46||T===58||T===95||Tn(T)?(e.consume(T),U):D(T)}function D(T){return T===61?(e.consume(T),O):tt(T)?(e.consume(T),D):z(T)}function O(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),m=T,M):tt(T)?(e.consume(T),O):I(T)}function M(T){return T===m?(e.consume(T),m=null,X):T===null||Oe(T)?n(T):(e.consume(T),M)}function I(T){return T===null||T===34||T===39||T===47||T===60||T===61||T===62||T===96||Ct(T)?D(T):(e.consume(T),I)}function X(T){return T===47||T===62||tt(T)?z(T):n(T)}function F(T){return T===62?(e.consume(T),W):n(T)}function W(T){return T===null||Oe(T)?ee(T):tt(T)?(e.consume(T),W):n(T)}function ee(T){return T===45&&l===2?(e.consume(T),Z):T===60&&l===1?(e.consume(T),te):T===62&&l===4?(e.consume(T),P):T===63&&l===3?(e.consume(T),A):T===93&&l===5?(e.consume(T),ue):Oe(T)&&(l===6||l===7)?(e.exit("htmlFlowData"),e.check(H9,B,ye)(T)):T===null||Oe(T)?(e.exit("htmlFlowData"),ye(T)):(e.consume(T),ee)}function ye(T){return e.check(Z9,he,B)(T)}function he(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),ne}function ne(T){return T===null||Oe(T)?ye(T):(e.enter("htmlFlowData"),ee(T))}function Z(T){return T===45?(e.consume(T),A):ee(T)}function te(T){return T===47?(e.consume(T),c="",ie):ee(T)}function ie(T){if(T===62){const q=c.toLowerCase();return qw.includes(q)?(e.consume(T),P):ee(T)}return Dn(T)&&c.length<8?(e.consume(T),c+=String.fromCharCode(T),ie):ee(T)}function ue(T){return T===93?(e.consume(T),A):ee(T)}function A(T){return T===62?(e.consume(T),P):T===45&&l===2?(e.consume(T),A):ee(T)}function P(T){return T===null||Oe(T)?(e.exit("htmlFlowData"),B(T)):(e.consume(T),P)}function B(T){return e.exit("htmlFlow"),t(T)}}function G9(e,t,n){const a=this;return l;function l(c){return Oe(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o):n(c)}function o(c){return a.parser.lazy[a.now().line]?n(c):t(c)}}function K9(e,t,n){return a;function a(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),e.attempt(Wu,t,n)}}const Y9={name:"htmlText",tokenize:X9};function X9(e,t,n){const a=this;let l,o,c;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),D):A===63?(e.consume(A),z):Dn(A)?(e.consume(A),I):n(A)}function h(A){return A===45?(e.consume(A),y):A===91?(e.consume(A),o=0,k):Dn(A)?(e.consume(A),N):n(A)}function y(A){return A===45?(e.consume(A),w):n(A)}function g(A){return A===null?n(A):A===45?(e.consume(A),b):Oe(A)?(c=g,te(A)):(e.consume(A),g)}function b(A){return A===45?(e.consume(A),w):g(A)}function w(A){return A===62?Z(A):A===45?b(A):g(A)}function k(A){const P="CDATA[";return A===P.charCodeAt(o++)?(e.consume(A),o===P.length?j:k):n(A)}function j(A){return A===null?n(A):A===93?(e.consume(A),E):Oe(A)?(c=j,te(A)):(e.consume(A),j)}function E(A){return A===93?(e.consume(A),C):j(A)}function C(A){return A===62?Z(A):A===93?(e.consume(A),C):j(A)}function N(A){return A===null||A===62?Z(A):Oe(A)?(c=N,te(A)):(e.consume(A),N)}function z(A){return A===null?n(A):A===63?(e.consume(A),U):Oe(A)?(c=z,te(A)):(e.consume(A),z)}function U(A){return A===62?Z(A):z(A)}function D(A){return Dn(A)?(e.consume(A),O):n(A)}function O(A){return A===45||Tn(A)?(e.consume(A),O):M(A)}function M(A){return Oe(A)?(c=M,te(A)):tt(A)?(e.consume(A),M):Z(A)}function I(A){return A===45||Tn(A)?(e.consume(A),I):A===47||A===62||Ct(A)?X(A):n(A)}function X(A){return A===47?(e.consume(A),Z):A===58||A===95||Dn(A)?(e.consume(A),F):Oe(A)?(c=X,te(A)):tt(A)?(e.consume(A),X):Z(A)}function F(A){return A===45||A===46||A===58||A===95||Tn(A)?(e.consume(A),F):W(A)}function W(A){return A===61?(e.consume(A),ee):Oe(A)?(c=W,te(A)):tt(A)?(e.consume(A),W):X(A)}function ee(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),l=A,ye):Oe(A)?(c=ee,te(A)):tt(A)?(e.consume(A),ee):(e.consume(A),he)}function ye(A){return A===l?(e.consume(A),l=void 0,ne):A===null?n(A):Oe(A)?(c=ye,te(A)):(e.consume(A),ye)}function he(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||Ct(A)?X(A):(e.consume(A),he)}function ne(A){return A===47||A===62||Ct(A)?X(A):n(A)}function Z(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):n(A)}function te(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),ie}function ie(A){return tt(A)?ut(e,ue,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):ue(A)}function ue(A){return e.enter("htmlTextData"),c(A)}}const Vy={name:"labelEnd",resolveAll:t8,resolveTo:n8,tokenize:r8},J9={tokenize:a8},W9={tokenize:i8},e8={tokenize:l8};function t8(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&&ur(e,0,e.length,n),e}function n8(e,t){let n=e.length,a=0,l,o,c,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(c){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"&&(c=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[c][1].end}},y={type:"labelText",start:{...e[o+a+2][1].end},end:{...e[c-2][1].start}};return f=[["enter",m,t],["enter",h,t]],f=Er(f,e.slice(o+1,o+a+3)),f=Er(f,[["enter",y,t]]),f=Er(f,Df(t.parser.constructs.insideSpan.null,e.slice(o+a+4,c-3),t)),f=Er(f,[["exit",y,t],e[c-2],e[c-1],["exit",h,t]]),f=Er(f,e.slice(c+1)),f=Er(f,[["exit",m,t]]),ur(e,o,e.length,f),e}function r8(e,t,n){const a=this;let l=a.events.length,o,c;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?g(b):(c=a.parser.defined.includes(Ir(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(J9,y,c?y:g)(b):b===91?e.attempt(W9,y,c?h:g)(b):c?y(b):g(b)}function h(b){return e.attempt(e8,y,g)(b)}function y(b){return t(b)}function g(b){return o._balanced=!0,n(b)}}function a8(e,t,n){return a;function a(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),l}function l(g){return Ct(g)?bu(e,o)(g):o(g)}function o(g){return g===41?y(g):EE(e,c,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function c(g){return Ct(g)?bu(e,m)(g):y(g)}function f(g){return n(g)}function m(g){return g===34||g===39||g===40?_E(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):y(g)}function h(g){return Ct(g)?bu(e,y)(g):y(g)}function y(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),t):n(g)}}function i8(e,t,n){const a=this;return l;function l(f){return NE.call(a,e,o,c,"reference","referenceMarker","referenceString")(f)}function o(f){return a.parser.defined.includes(Ir(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?t(f):n(f)}function c(f){return n(f)}}function l8(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 s8={name:"labelStartImage",resolveAll:Vy.resolveAll,tokenize:o8};function o8(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"),c):n(f)}function c(f){return f===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(f):t(f)}}const u8={name:"labelStartLink",resolveAll:Vy.resolveAll,tokenize:c8};function c8(e,t,n){const a=this;return l;function l(c){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelLink"),o}function o(c){return c===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(c):t(c)}}const Ep={name:"lineEnding",tokenize:d8};function d8(e,t){return n;function n(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),ut(e,t,"linePrefix")}}const Zd={name:"thematicBreak",tokenize:f8};function f8(e,t,n){let a=0,l;return o;function o(h){return e.enter("thematicBreak"),c(h)}function c(h){return l=h,f(h)}function f(h){return h===l?(e.enter("thematicBreakSequence"),m(h)):a>=3&&(h===null||Oe(h))?(e.exit("thematicBreak"),t(h)):n(h)}function m(h){return h===l?(e.consume(h),a++,m):(e.exit("thematicBreakSequence"),tt(h)?ut(e,f,"whitespace")(h):f(h))}}const Hn={continuation:{tokenize:g8},exit:v8,name:"list",tokenize:p8},h8={partial:!0,tokenize:b8},m8={partial:!0,tokenize:y8};function p8(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,c=0;return f;function f(w){const k=a.containerState.type||(w===42||w===43||w===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!a.containerState.marker||w===a.containerState.marker:Mg(w)){if(a.containerState.type||(a.containerState.type=k,e.enter(k,{_container:!0})),k==="listUnordered")return e.enter("listItemPrefix"),w===42||w===45?e.check(Zd,n,h)(w):h(w);if(!a.interrupt||w===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),m(w)}return n(w)}function m(w){return Mg(w)&&++c<10?(e.consume(w),m):(!a.interrupt||c<2)&&(a.containerState.marker?w===a.containerState.marker:w===41||w===46)?(e.exit("listItemValue"),h(w)):n(w)}function h(w){return e.enter("listItemMarker"),e.consume(w),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||w,e.check(Wu,a.interrupt?n:y,e.attempt(h8,b,g))}function y(w){return a.containerState.initialBlankLine=!0,o++,b(w)}function g(w){return tt(w)?(e.enter("listItemPrefixWhitespace"),e.consume(w),e.exit("listItemPrefixWhitespace"),b):n(w)}function b(w){return a.containerState.size=o+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(w)}}function g8(e,t,n){const a=this;return a.containerState._closeFlow=void 0,e.check(Wu,l,o);function l(f){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,ut(e,t,"listItemIndent",a.containerState.size+1)(f)}function o(f){return a.containerState.furtherBlankLines||!tt(f)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,c(f)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt(m8,t,c)(f))}function c(f){return a.containerState._closeFlow=!0,a.interrupt=void 0,ut(e,e.attempt(Hn,t,n),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function y8(e,t,n){const a=this;return ut(e,l,"listItemIndent",a.containerState.size+1);function l(o){const c=a.events[a.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===a.containerState.size?t(o):n(o)}}function v8(e){e.exit(this.containerState.type)}function b8(e,t,n){const a=this;return ut(e,l,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function l(o){const c=a.events[a.events.length-1];return!tt(o)&&c&&c[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Hw={name:"setextUnderline",resolveTo:x8,tokenize:w8};function x8(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 c={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",c,t]),e.splice(o+1,0,["exit",e[a][1],t]),e[a][1].end={...e[o][1].end}):e[a][1]=c,e.push(["exit",c,t]),e}function w8(e,t,n){const a=this;let l;return o;function o(h){let y=a.events.length,g;for(;y--;)if(a.events[y][1].type!=="lineEnding"&&a.events[y][1].type!=="linePrefix"&&a.events[y][1].type!=="content"){g=a.events[y][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||g)?(e.enter("setextHeadingLine"),l=h,c(h)):n(h)}function c(h){return e.enter("setextHeadingLineSequence"),f(h)}function f(h){return h===l?(e.consume(h),f):(e.exit("setextHeadingLineSequence"),tt(h)?ut(e,m,"lineSuffix")(h):m(h))}function m(h){return h===null||Oe(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const S8={tokenize:k8};function k8(e){const t=this,n=e.attempt(Wu,a,e.attempt(this.parser.constructs.flowInitial,l,ut(e,e.attempt(this.parser.constructs.flow,l,e.attempt(_9,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 j8={resolveAll:AE()},C8=TE("string"),E8=TE("text");function TE(e){return{resolveAll:AE(e==="text"?N8:void 0),tokenize:t};function t(n){const a=this,l=this.parser.constructs[e],o=n.attempt(l,c,f);return c;function c(y){return h(y)?o(y):f(y)}function f(y){if(y===null){n.consume(y);return}return n.enter("data"),n.consume(y),m}function m(y){return h(y)?(n.exit("data"),o(y)):(n.consume(y),m)}function h(y){if(y===null)return!0;const g=l[y];let b=-1;if(g)for(;++b<g.length;){const w=g[b];if(!w.previous||w.previous.call(a,a.previous))return!0}return!1}}}function AE(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 N8(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,c=-1,f=0,m;for(;o--;){const h=l[o];if(typeof h=="string"){for(c=h.length;h.charCodeAt(c-1)===32;)f++,c--;if(c)break;c=-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?c:a.start._bufferIndex+c,_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 _8={42:Hn,43:Hn,45:Hn,48:Hn,49:Hn,50:Hn,51:Hn,52:Hn,53:Hn,54:Hn,55:Hn,56:Hn,57:Hn,62:SE},T8={91:O9},A8={[-2]:Cp,[-1]:Cp,32:Cp},R8={35:P9,42:Zd,45:[Hw,Zd],60:q9,61:Hw,95:Zd,96:Fw,126:Fw},z8={38:jE,92:kE},O8={[-5]:Ep,[-4]:Ep,[-3]:Ep,33:s8,38:jE,42:Lg,60:[u9,Y9],91:u8,92:[I9,kE],93:Vy,95:Lg,96:S9},D8={null:[Lg,j8]},M8={null:[42,95]},L8={null:[]},I8=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:M8,contentInitial:T8,disable:L8,document:_8,flow:R8,flowInitial:A8,insideSpan:D8,string:z8,text:O8},Symbol.toStringTag,{value:"Module"}));function U8(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 c=[],f=[];const m={attempt:M(D),check:M(O),consume:N,enter:z,exit:U,interrupt:M(O,{interrupt:!0})},h={code:null,containerState:{},defineSkip:j,events:[],now:k,parser:e,previous:null,sliceSerialize:b,sliceStream:w,write:g};let y=t.tokenize.call(h,m);return t.resolveAll&&o.push(t),h;function g(W){return c=Er(c,W),E(),c[c.length-1]!==null?[]:(I(t,0),h.events=Df(o,h.events,h),h.events)}function b(W,ee){return B8(w(W),ee)}function w(W){return P8(c,W)}function k(){const{_bufferIndex:W,_index:ee,line:ye,column:he,offset:ne}=a;return{_bufferIndex:W,_index:ee,line:ye,column:he,offset:ne}}function j(W){l[W.line]=W.column,F()}function E(){let W;for(;a._index<c.length;){const ee=c[a._index];if(typeof ee=="string")for(W=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===W&&a._bufferIndex<ee.length;)C(ee.charCodeAt(a._bufferIndex));else C(ee)}}function C(W){y=y(W)}function N(W){Oe(W)?(a.line++,a.column=1,a.offset+=W===-3?2:1,F()):W!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===c[a._index].length&&(a._bufferIndex=-1,a._index++)),h.previous=W}function z(W,ee){const ye=ee||{};return ye.type=W,ye.start=k(),h.events.push(["enter",ye,h]),f.push(ye),ye}function U(W){const ee=f.pop();return ee.end=k(),h.events.push(["exit",ee,h]),ee}function D(W,ee){I(W,ee.from)}function O(W,ee){ee.restore()}function M(W,ee){return ye;function ye(he,ne,Z){let te,ie,ue,A;return Array.isArray(he)?B(he):"tokenize"in he?B([he]):P(he);function P(ce){return xe;function xe(we){const pe=we!==null&&ce[we],Xe=we!==null&&ce.null,Le=[...Array.isArray(pe)?pe:pe?[pe]:[],...Array.isArray(Xe)?Xe:Xe?[Xe]:[]];return B(Le)(we)}}function B(ce){return te=ce,ie=0,ce.length===0?Z:T(ce[ie])}function T(ce){return xe;function xe(we){return A=X(),ue=ce,ce.partial||(h.currentConstruct=ce),ce.name&&h.parser.constructs.disable.null.includes(ce.name)?K():ce.tokenize.call(ee?Object.assign(Object.create(h),ee):h,m,q,K)(we)}}function q(ce){return W(ue,A),ne}function K(ce){return A.restore(),++ie<te.length?T(te[ie]):Z}}}function I(W,ee){W.resolveAll&&!o.includes(W)&&o.push(W),W.resolve&&ur(h.events,ee,h.events.length-ee,W.resolve(h.events.slice(ee),h)),W.resolveTo&&(h.events=W.resolveTo(h.events,h))}function X(){const W=k(),ee=h.previous,ye=h.currentConstruct,he=h.events.length,ne=Array.from(f);return{from:he,restore:Z};function Z(){a=W,h.previous=ee,h.currentConstruct=ye,h.events.length=he,f=ne,F()}}function F(){a.line in l&&a.column<2&&(a.column=l[a.line],a.offset+=l[a.line]-1)}}function P8(e,t){const n=t.start._index,a=t.start._bufferIndex,l=t.end._index,o=t.end._bufferIndex;let c;if(n===l)c=[e[n].slice(a,o)];else{if(c=e.slice(n,l),a>-1){const f=c[0];typeof f=="string"?c[0]=f.slice(a):c.shift()}o>0&&c.push(e[l].slice(0,o))}return c}function B8(e,t){let n=-1;const a=[];let l;for(;++n<e.length;){const o=e[n];let c;if(typeof o=="string")c=o;else switch(o){case-5:{c="\r";break}case-4:{c=`
|
|
359
|
+
`;break}case-3:{c=`\r
|
|
360
|
+
`;break}case-2:{c=t?" ":" ";break}case-1:{if(!t&&l)continue;c=" ";break}default:c=String.fromCharCode(o)}l=o===-2,a.push(c)}return a.join("")}function $8(e){const a={constructs:xE([I8,...(e||{}).extensions||[]]),content:l(n9),defined:[],document:l(a9),flow:l(S8),lazy:{},string:l(C8),text:l(E8)};return a;function l(o){return c;function c(f){return U8(a,o,f)}}}function F8(e){for(;!CE(e););return e}const Zw=/[\0\t\n\r]/g;function q8(){let e=1,t="",n=!0,a;return l;function l(o,c,f){const m=[];let h,y,g,b,w;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(c||void 0).decode(o)),g=0,t="",n&&(o.charCodeAt(0)===65279&&g++,n=void 0);g<o.length;){if(Zw.lastIndex=g,h=Zw.exec(o),b=h&&h.index!==void 0?h.index:o.length,w=o.charCodeAt(b),!h){t=o.slice(g);break}if(w===10&&g===b&&a)m.push(-3),a=void 0;else switch(a&&(m.push(-5),a=void 0),g<b&&(m.push(o.slice(g,b)),e+=b-g),w){case 0:{m.push(65533),e++;break}case 9:{for(y=Math.ceil(e/4)*4,m.push(-2);e++<y;)m.push(-1);break}case 10:{m.push(-4),e=1;break}default:a=!0,e=1}g=b+1}return f&&(a&&m.push(-5),t&&m.push(t),m.push(null)),m}}const H8=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Z8(e){return e.replace(H8,V8)}function V8(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const l=n.charCodeAt(1),o=l===120||l===88;return wE(n.slice(o?2:1),o?16:10)}return Zy(n)||e}const RE={}.hasOwnProperty;function Q8(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),G8(n)(F8($8(n).document().write(q8()(e,t,!0))))}function G8(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Ma),autolinkProtocol:X,autolinkEmail:X,atxHeading:o(Pe),blockQuote:o(Xe),characterEscape:X,characterReference:X,codeFenced:o(Le),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:o(Le,c),codeText:o(re,c),codeTextData:X,data:X,codeFlowValue:X,definition:o(Ee),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:o(Ie),hardBreakEscape:o(Lt),hardBreakTrailing:o(Lt),htmlFlow:o(fn,c),htmlFlowData:X,htmlText:o(fn,c),htmlTextData:X,image:o(_l),label:c,link:o(Ma),listItem:o(na),listItemValue:b,listOrdered:o(La,g),listUnordered:o(La),paragraph:o(oo),reference:T,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:o(Pe),strong:o(uo),thematicBreak:o(co)},exit:{atxHeading:m(),atxHeadingSequence:D,autolink:m(),autolinkEmail:pe,autolinkProtocol:we,blockQuote:m(),characterEscapeValue:F,characterReferenceMarkerHexadecimal:K,characterReferenceMarkerNumeric:K,characterReferenceValue:ce,characterReference:xe,codeFenced:m(E),codeFencedFence:j,codeFencedFenceInfo:w,codeFencedFenceMeta:k,codeFlowValue:F,codeIndented:m(C),codeText:m(ne),codeTextData:F,data:F,definition:m(),definitionDestinationString:U,definitionLabelString:N,definitionTitleString:z,emphasis:m(),hardBreakEscape:m(ee),hardBreakTrailing:m(ee),htmlFlow:m(ye),htmlFlowData:F,htmlText:m(he),htmlTextData:F,image:m(te),label:ue,labelText:ie,lineEnding:W,link:m(Z),listItem:m(),listOrdered:m(),listUnordered:m(),paragraph:m(),referenceString:q,resourceDestinationString:A,resourceTitleString:P,resource:B,setextHeading:m(I),setextHeadingLineSequence:M,setextHeadingText:O,strong:m(),thematicBreak:m()}};zE(t,(e||{}).mdastExtensions||[]);const n={};return a;function a(le){let be={type:"root",children:[]};const Ue={stack:[be],tokenStack:[],config:t,enter:f,exit:h,buffer:c,resume:y,data:n},$e=[];let at=-1;for(;++at<le.length;)if(le[at][1].type==="listOrdered"||le[at][1].type==="listUnordered")if(le[at][0]==="enter")$e.push(at);else{const mn=$e.pop();at=l(le,mn,at)}for(at=-1;++at<le.length;){const mn=t[le[at][0]];RE.call(mn,le[at][1].type)&&mn[le[at][1].type].call(Object.assign({sliceSerialize:le[at][2].sliceSerialize},Ue),le[at][1])}if(Ue.tokenStack.length>0){const mn=Ue.tokenStack[Ue.tokenStack.length-1];(mn[1]||Vw).call(Ue,void 0,mn[0])}for(be.position={start:ci(le.length>0?le[0][1].start:{line:1,column:1,offset:0}),end:ci(le.length>0?le[le.length-2][1].end:{line:1,column:1,offset:0})},at=-1;++at<t.transforms.length;)be=t.transforms[at](be)||be;return be}function l(le,be,Ue){let $e=be-1,at=-1,mn=!1,fr,nn,Zt,pn;for(;++$e<=Ue;){const ht=le[$e];switch(ht[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ht[0]==="enter"?at++:at--,pn=void 0;break}case"lineEndingBlank":{ht[0]==="enter"&&(fr&&!pn&&!at&&!Zt&&(Zt=$e),pn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:pn=void 0}if(!at&&ht[0]==="enter"&&ht[1].type==="listItemPrefix"||at===-1&&ht[0]==="exit"&&(ht[1].type==="listUnordered"||ht[1].type==="listOrdered")){if(fr){let zr=$e;for(nn=void 0;zr--;){const Ln=le[zr];if(Ln[1].type==="lineEnding"||Ln[1].type==="lineEndingBlank"){if(Ln[0]==="exit")continue;nn&&(le[nn][1].type="lineEndingBlank",mn=!0),Ln[1].type="lineEnding",nn=zr}else if(!(Ln[1].type==="linePrefix"||Ln[1].type==="blockQuotePrefix"||Ln[1].type==="blockQuotePrefixWhitespace"||Ln[1].type==="blockQuoteMarker"||Ln[1].type==="listItemIndent"))break}Zt&&(!nn||Zt<nn)&&(fr._spread=!0),fr.end=Object.assign({},nn?le[nn][1].start:ht[1].end),le.splice(nn||$e,0,["exit",fr,ht[2]]),$e++,Ue++}if(ht[1].type==="listItemPrefix"){const zr={type:"listItem",_spread:!1,start:Object.assign({},ht[1].start),end:void 0};fr=zr,le.splice($e,0,["enter",zr,ht[2]]),$e++,Ue++,Zt=void 0,pn=!0}}}return le[be][1]._spread=mn,Ue}function o(le,be){return Ue;function Ue($e){f.call(this,le($e),$e),be&&be.call(this,$e)}}function c(){this.stack.push({type:"fragment",children:[]})}function f(le,be,Ue){this.stack[this.stack.length-1].children.push(le),this.stack.push(le),this.tokenStack.push([be,Ue||void 0]),le.position={start:ci(be.start),end:void 0}}function m(le){return be;function be(Ue){le&&le.call(this,Ue),h.call(this,Ue)}}function h(le,be){const Ue=this.stack.pop(),$e=this.tokenStack.pop();if($e)$e[0].type!==le.type&&(be?be.call(this,le,$e[0]):($e[1]||Vw).call(this,le,$e[0]));else throw new Error("Cannot close `"+le.type+"` ("+vu({start:le.start,end:le.end})+"): it’s not open");Ue.position.end=ci(le.end)}function y(){return Hy(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function b(le){if(this.data.expectingFirstListItemValue){const be=this.stack[this.stack.length-2];be.start=Number.parseInt(this.sliceSerialize(le),10),this.data.expectingFirstListItemValue=void 0}}function w(){const le=this.resume(),be=this.stack[this.stack.length-1];be.lang=le}function k(){const le=this.resume(),be=this.stack[this.stack.length-1];be.meta=le}function j(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function E(){const le=this.resume(),be=this.stack[this.stack.length-1];be.value=le.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function C(){const le=this.resume(),be=this.stack[this.stack.length-1];be.value=le.replace(/(\r?\n|\r)$/g,"")}function N(le){const be=this.resume(),Ue=this.stack[this.stack.length-1];Ue.label=be,Ue.identifier=Ir(this.sliceSerialize(le)).toLowerCase()}function z(){const le=this.resume(),be=this.stack[this.stack.length-1];be.title=le}function U(){const le=this.resume(),be=this.stack[this.stack.length-1];be.url=le}function D(le){const be=this.stack[this.stack.length-1];if(!be.depth){const Ue=this.sliceSerialize(le).length;be.depth=Ue}}function O(){this.data.setextHeadingSlurpLineEnding=!0}function M(le){const be=this.stack[this.stack.length-1];be.depth=this.sliceSerialize(le).codePointAt(0)===61?1:2}function I(){this.data.setextHeadingSlurpLineEnding=void 0}function X(le){const Ue=this.stack[this.stack.length-1].children;let $e=Ue[Ue.length-1];(!$e||$e.type!=="text")&&($e=hn(),$e.position={start:ci(le.start),end:void 0},Ue.push($e)),this.stack.push($e)}function F(le){const be=this.stack.pop();be.value+=this.sliceSerialize(le),be.position.end=ci(le.end)}function W(le){const be=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ue=be.children[be.children.length-1];Ue.position.end=ci(le.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(be.type)&&(X.call(this,le),F.call(this,le))}function ee(){this.data.atHardBreak=!0}function ye(){const le=this.resume(),be=this.stack[this.stack.length-1];be.value=le}function he(){const le=this.resume(),be=this.stack[this.stack.length-1];be.value=le}function ne(){const le=this.resume(),be=this.stack[this.stack.length-1];be.value=le}function Z(){const le=this.stack[this.stack.length-1];if(this.data.inReference){const be=this.data.referenceType||"shortcut";le.type+="Reference",le.referenceType=be,delete le.url,delete le.title}else delete le.identifier,delete le.label;this.data.referenceType=void 0}function te(){const le=this.stack[this.stack.length-1];if(this.data.inReference){const be=this.data.referenceType||"shortcut";le.type+="Reference",le.referenceType=be,delete le.url,delete le.title}else delete le.identifier,delete le.label;this.data.referenceType=void 0}function ie(le){const be=this.sliceSerialize(le),Ue=this.stack[this.stack.length-2];Ue.label=Z8(be),Ue.identifier=Ir(be).toLowerCase()}function ue(){const le=this.stack[this.stack.length-1],be=this.resume(),Ue=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ue.type==="link"){const $e=le.children;Ue.children=$e}else Ue.alt=be}function A(){const le=this.resume(),be=this.stack[this.stack.length-1];be.url=le}function P(){const le=this.resume(),be=this.stack[this.stack.length-1];be.title=le}function B(){this.data.inReference=void 0}function T(){this.data.referenceType="collapsed"}function q(le){const be=this.resume(),Ue=this.stack[this.stack.length-1];Ue.label=be,Ue.identifier=Ir(this.sliceSerialize(le)).toLowerCase(),this.data.referenceType="full"}function K(le){this.data.characterReferenceType=le.type}function ce(le){const be=this.sliceSerialize(le),Ue=this.data.characterReferenceType;let $e;Ue?($e=wE(be,Ue==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):$e=Zy(be);const at=this.stack[this.stack.length-1];at.value+=$e}function xe(le){const be=this.stack.pop();be.position.end=ci(le.end)}function we(le){F.call(this,le);const be=this.stack[this.stack.length-1];be.url=this.sliceSerialize(le)}function pe(le){F.call(this,le);const be=this.stack[this.stack.length-1];be.url="mailto:"+this.sliceSerialize(le)}function Xe(){return{type:"blockquote",children:[]}}function Le(){return{type:"code",lang:null,meta:null,value:""}}function re(){return{type:"inlineCode",value:""}}function Ee(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ie(){return{type:"emphasis",children:[]}}function Pe(){return{type:"heading",depth:0,children:[]}}function Lt(){return{type:"break"}}function fn(){return{type:"html",value:""}}function _l(){return{type:"image",title:null,url:"",alt:null}}function Ma(){return{type:"link",title:null,url:"",children:[]}}function La(le){return{type:"list",ordered:le.type==="listOrdered",start:null,spread:le._spread,children:[]}}function na(le){return{type:"listItem",spread:le._spread,checked:null,children:[]}}function oo(){return{type:"paragraph",children:[]}}function uo(){return{type:"strong",children:[]}}function hn(){return{type:"text",value:""}}function co(){return{type:"thematicBreak"}}}function ci(e){return{line:e.line,column:e.column,offset:e.offset}}function zE(e,t){let n=-1;for(;++n<t.length;){const a=t[n];Array.isArray(a)?zE(e,a):K8(e,a)}}function K8(e,t){let n;for(n in t)if(RE.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 Vw(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+vu({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+vu({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+vu({start:t.start,end:t.end})+") is still open")}function Y8(e){const t=this;t.parser=n;function n(a){return Q8(a,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function X8(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 J8(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
361
|
+
`}]}function W8(e,t){const n=t.value?t.value+`
|
|
362
|
+
`:"",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 eB(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function tB(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function nB(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),l=so(a.toLowerCase()),o=e.footnoteOrder.indexOf(a);let c,f=e.footnoteCounts.get(a);f===void 0?(f=0,e.footnoteOrder.push(a),c=e.footnoteOrder.length):c=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(c)}]};e.patch(t,m);const h={type:"element",tagName:"sup",properties:{},children:[m]};return e.patch(t,h),e.applyData(t,h)}function rB(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 aB(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function OE(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 c=l[l.length-1];return c&&c.type==="text"?c.value+=a:l.push({type:"text",value:a}),l}function iB(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return OE(e,t);const l={src:so(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 lB(e,t){const n={src:so(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 sB(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 oB(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return OE(e,t);const l={href:so(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 uB(e,t){const n={href:so(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 cB(e,t,n){const a=e.all(t),l=n?dB(n):DE(t),o={},c=[];if(typeof t.checked=="boolean"){const y=a[0];let g;y&&y.type==="element"&&y.tagName==="p"?g=y:(g={type:"element",tagName:"p",properties:{},children:[]},a.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.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 y=a[f];(l||f!==0||y.type!=="element"||y.tagName!=="p")&&c.push({type:"text",value:`
|
|
363
|
+
`}),y.type==="element"&&y.tagName==="p"&&!l?c.push(...y.children):c.push(y)}const m=a[a.length-1];m&&(l||m.type!=="element"||m.tagName!=="p")&&c.push({type:"text",value:`
|
|
364
|
+
`});const h={type:"element",tagName:"li",properties:o,children:c};return e.patch(t,h),e.applyData(t,h)}function dB(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=DE(n[a])}return t}function DE(e){const t=e.spread;return t??e.children.length>1}function fB(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 c=a[l];if(c.type==="element"&&c.tagName==="li"&&c.properties&&Array.isArray(c.properties.className)&&c.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 hB(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function mB(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function pB(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function gB(e,t){const n=e.all(t),a=n.shift(),l=[];if(a){const c={type:"element",tagName:"thead",properties:{},children:e.wrap([a],!0)};e.patch(t.children[0],c),l.push(c)}if(n.length>0){const c={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},f=By(t.children[1]),m=hE(t.children[t.children.length-1]);f&&m&&(c.position={start:f,end:m}),l.push(c)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(l,!0)};return e.patch(t,o),e.applyData(t,o)}function yB(e,t,n){const a=n?n.children:void 0,o=(a?a.indexOf(t):1)===0?"th":"td",c=n&&n.type==="table"?n.align:void 0,f=c?c.length:t.children.length;let m=-1;const h=[];for(;++m<f;){const g=t.children[m],b={},w=c?c[m]:void 0;w&&(b.align=w);let k={type:"element",tagName:o,properties:b,children:[]};g&&(k.children=e.all(g),e.patch(g,k),k=e.applyData(g,k)),h.push(k)}const y={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,y),e.applyData(t,y)}function vB(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Qw=9,Gw=32;function bB(e){const t=String(e),n=/\r?\n|\r/g;let a=n.exec(t),l=0;const o=[];for(;a;)o.push(Kw(t.slice(l,a.index),l>0,!0),a[0]),l=a.index+a[0].length,a=n.exec(t);return o.push(Kw(t.slice(l),l>0,!1)),o.join("")}function Kw(e,t,n){let a=0,l=e.length;if(t){let o=e.codePointAt(a);for(;o===Qw||o===Gw;)a++,o=e.codePointAt(a)}if(n){let o=e.codePointAt(l-1);for(;o===Qw||o===Gw;)l--,o=e.codePointAt(l-1)}return l>a?e.slice(a,l):""}function xB(e,t){const n={type:"text",value:bB(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function wB(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const SB={blockquote:X8,break:J8,code:W8,delete:eB,emphasis:tB,footnoteReference:nB,heading:rB,html:aB,imageReference:iB,image:lB,inlineCode:sB,linkReference:oB,link:uB,listItem:cB,list:fB,paragraph:hB,root:mB,strong:pB,table:gB,tableCell:vB,tableRow:yB,text:xB,thematicBreak:wB,toml:Rd,yaml:Rd,definition:Rd,footnoteDefinition:Rd};function Rd(){}const ME=-1,Mf=0,xu=1,of=2,Qy=3,Gy=4,Ky=5,Yy=6,LE=7,IE=8,Yw=typeof self=="object"?self:globalThis,kB=(e,t)=>{const n=(l,o)=>(e.set(o,l),l),a=l=>{if(e.has(l))return e.get(l);const[o,c]=t[l];switch(o){case Mf:case ME:return n(c,l);case xu:{const f=n([],l);for(const m of c)f.push(a(m));return f}case of:{const f=n({},l);for(const[m,h]of c)f[a(m)]=a(h);return f}case Qy:return n(new Date(c),l);case Gy:{const{source:f,flags:m}=c;return n(new RegExp(f,m),l)}case Ky:{const f=n(new Map,l);for(const[m,h]of c)f.set(a(m),a(h));return f}case Yy:{const f=n(new Set,l);for(const m of c)f.add(a(m));return f}case LE:{const{name:f,message:m}=c;return n(new Yw[f](m),l)}case IE:return n(BigInt(c),l);case"BigInt":return n(Object(BigInt(c)),l);case"ArrayBuffer":return n(new Uint8Array(c).buffer,c);case"DataView":{const{buffer:f}=new Uint8Array(c);return n(new DataView(f),c)}}return n(new Yw[o](c),l)};return a},Xw=e=>kB(new Map,e)(0),ys="",{toString:jB}={},{keys:CB}=Object,du=e=>{const t=typeof e;if(t!=="object"||!e)return[Mf,t];const n=jB.call(e).slice(8,-1);switch(n){case"Array":return[xu,ys];case"Object":return[of,ys];case"Date":return[Qy,ys];case"RegExp":return[Gy,ys];case"Map":return[Ky,ys];case"Set":return[Yy,ys];case"DataView":return[xu,n]}return n.includes("Array")?[xu,n]:n.includes("Error")?[LE,n]:[of,n]},zd=([e,t])=>e===Mf&&(t==="function"||t==="symbol"),EB=(e,t,n,a)=>{const l=(c,f)=>{const m=a.push(c)-1;return n.set(f,m),m},o=c=>{if(n.has(c))return n.get(c);let[f,m]=du(c);switch(f){case Mf:{let y=c;switch(m){case"bigint":f=IE,y=c.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+m);y=null;break;case"undefined":return l([ME],c)}return l([f,y],c)}case xu:{if(m){let b=c;return m==="DataView"?b=new Uint8Array(c.buffer):m==="ArrayBuffer"&&(b=new Uint8Array(c)),l([m,[...b]],c)}const y=[],g=l([f,y],c);for(const b of c)y.push(o(b));return g}case of:{if(m)switch(m){case"BigInt":return l([m,c.toString()],c);case"Boolean":case"Number":case"String":return l([m,c.valueOf()],c)}if(t&&"toJSON"in c)return o(c.toJSON());const y=[],g=l([f,y],c);for(const b of CB(c))(e||!zd(du(c[b])))&&y.push([o(b),o(c[b])]);return g}case Qy:return l([f,c.toISOString()],c);case Gy:{const{source:y,flags:g}=c;return l([f,{source:y,flags:g}],c)}case Ky:{const y=[],g=l([f,y],c);for(const[b,w]of c)(e||!(zd(du(b))||zd(du(w))))&&y.push([o(b),o(w)]);return g}case Yy:{const y=[],g=l([f,y],c);for(const b of c)(e||!zd(du(b)))&&y.push(o(b));return g}}const{message:h}=c;return l([f,{name:m,message:h}],c)};return o},Jw=(e,{json:t,lossy:n}={})=>{const a=[];return EB(!(t||n),!!t,new Map,a)(e),a},uf=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Xw(Jw(e,t)):structuredClone(e):(e,t)=>Xw(Jw(e,t));function NB(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 _B(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function TB(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||NB,a=e.options.footnoteBackLabel||_B,l=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",c=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 y=e.all(h),g=String(h.identifier).toUpperCase(),b=so(g.toLowerCase());let w=0;const k=[],j=e.footnoteCounts.get(g);for(;j!==void 0&&++w<=j;){k.length>0&&k.push({type:"text",value:" "});let N=typeof n=="string"?n:n(m,w);typeof N=="string"&&(N={type:"text",value:N}),k.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+b+(w>1?"-"+w:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(m,w),className:["data-footnote-backref"]},children:Array.isArray(N)?N:[N]})}const E=y[y.length-1];if(E&&E.type==="element"&&E.tagName==="p"){const N=E.children[E.children.length-1];N&&N.type==="text"?N.value+=" ":E.children.push({type:"text",value:" "}),E.children.push(...k)}else y.push(...k);const C={type:"element",tagName:"li",properties:{id:t+"fn-"+b},children:e.wrap(y,!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:{...uf(c),id:"footnote-label"},children:[{type:"text",value:l}]},{type:"text",value:`
|
|
365
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
|
|
366
|
+
`}]}}const Lf=(function(e){if(e==null)return OB;if(typeof e=="function")return If(e);if(typeof e=="object")return Array.isArray(e)?AB(e):RB(e);if(typeof e=="string")return zB(e);throw new Error("Expected function, string, or object as test")});function AB(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Lf(e[n]);return If(a);function a(...l){let o=-1;for(;++o<t.length;)if(t[o].apply(this,l))return!0;return!1}}function RB(e){const t=e;return If(n);function n(a){const l=a;let o;for(o in e)if(l[o]!==t[o])return!1;return!0}}function zB(e){return If(t);function t(n){return n&&n.type===e}}function If(e){return t;function t(n,a,l){return!!(DB(n)&&e.call(this,n,typeof a=="number"?a:void 0,l||void 0))}}function OB(){return!0}function DB(e){return e!==null&&typeof e=="object"&&"type"in e}const UE=[],MB=!0,Ig=!1,LB="skip";function PE(e,t,n,a){let l;typeof t=="function"&&typeof n!="function"?(a=n,n=t):l=t;const o=Lf(l),c=a?-1:1;f(e,void 0,[])();function f(m,h,y){const g=m&&typeof m=="object"?m:{};if(typeof g.type=="string"){const w=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(m.type+(w?"<"+w+">":""))+")"})}return b;function b(){let w=UE,k,j,E;if((!t||o(m,h,y[y.length-1]||void 0))&&(w=IB(n(m,y)),w[0]===Ig))return w;if("children"in m&&m.children){const C=m;if(C.children&&w[0]!==LB)for(j=(a?C.children.length:-1)+c,E=y.concat(C);j>-1&&j<C.children.length;){const N=C.children[j];if(k=f(N,j,E)(),k[0]===Ig)return k;j=typeof k[1]=="number"?k[1]:j+c}}return w}}}function IB(e){return Array.isArray(e)?e:typeof e=="number"?[MB,e]:e==null?UE:[e]}function Xy(e,t,n,a){let l,o,c;typeof t=="function"&&typeof n!="function"?(o=void 0,c=t,l=n):(o=t,c=n,l=a),PE(e,o,f,l);function f(m,h){const y=h[h.length-1],g=y?y.children.indexOf(m):void 0;return c(m,g,y)}}const Ug={}.hasOwnProperty,UB={};function PB(e,t){const n=t||UB,a=new Map,l=new Map,o=new Map,c={...SB,...n.handlers},f={all:h,applyData:$B,definitionById:a,footnoteById:l,footnoteCounts:o,footnoteOrder:[],handlers:c,one:m,options:n,patch:BB,wrap:qB};return Xy(e,function(y){if(y.type==="definition"||y.type==="footnoteDefinition"){const g=y.type==="definition"?a:l,b=String(y.identifier).toUpperCase();g.has(b)||g.set(b,y)}}),f;function m(y,g){const b=y.type,w=f.handlers[b];if(Ug.call(f.handlers,b)&&w)return w(f,y,g);if(f.options.passThrough&&f.options.passThrough.includes(b)){if("children"in y){const{children:j,...E}=y,C=uf(E);return C.children=f.all(y),C}return uf(y)}return(f.options.unknownHandler||FB)(f,y,g)}function h(y){const g=[];if("children"in y){const b=y.children;let w=-1;for(;++w<b.length;){const k=f.one(b[w],y);if(k){if(w&&b[w-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=Ww(k.value)),!Array.isArray(k)&&k.type==="element")){const j=k.children[0];j&&j.type==="text"&&(j.value=Ww(j.value))}Array.isArray(k)?g.push(...k):g.push(k)}}}return g}}function BB(e,t){e.position&&(t.position=_P(e))}function $B(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 c="children"in n?n.children:[n];n={type:"element",tagName:a,properties:{},children:c}}n.type==="element"&&o&&Object.assign(n.properties,uf(o)),"children"in n&&n.children&&l!==null&&l!==void 0&&(n.children=l)}return n}function FB(e,t){const n=t.data||{},a="value"in t&&!(Ug.call(n,"hProperties")||Ug.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 qB(e,t){const n=[];let a=-1;for(t&&n.push({type:"text",value:`
|
|
367
|
+
`});++a<e.length;)a&&n.push({type:"text",value:`
|
|
368
|
+
`}),n.push(e[a]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
369
|
+
`}),n}function Ww(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function eS(e,t){const n=PB(e,t),a=n.one(e,void 0),l=TB(n),o=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return l&&o.children.push({type:"text",value:`
|
|
370
|
+
`},l),o}function HB(e,t){return e&&"run"in e?async function(n,a){const l=eS(n,{file:a,...t});await e.run(l,a)}:function(n,a){return eS(n,{file:a,...e||t})}}function tS(e){if(e)throw e}var Np,nS;function ZB(){if(nS)return Np;nS=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 y=e.call(h,"constructor"),g=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!y&&!g)return!1;var b;for(b in h);return typeof b>"u"||e.call(h,b)},c=function(h,y){n&&y.name==="__proto__"?n(h,y.name,{enumerable:!0,configurable:!0,value:y.newValue,writable:!0}):h[y.name]=y.newValue},f=function(h,y){if(y==="__proto__")if(e.call(h,y)){if(a)return a(h,y).value}else return;return h[y]};return Np=function m(){var h,y,g,b,w,k,j=arguments[0],E=1,C=arguments.length,N=!1;for(typeof j=="boolean"&&(N=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(y in h)g=f(j,y),b=f(h,y),j!==b&&(N&&b&&(o(b)||(w=l(b)))?(w?(w=!1,k=g&&l(g)?g:[]):k=g&&o(g)?g:{},c(j,{name:y,newValue:m(N,k,b)})):typeof b<"u"&&c(j,{name:y,newValue:b}));return j},Np}var VB=ZB();const _p=df(VB);function Pg(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 QB(){const e=[],t={run:n,use:a};return t;function n(...l){let o=-1;const c=l.pop();if(typeof c!="function")throw new TypeError("Expected function as last argument, not "+c);f(null,...l);function f(m,...h){const y=e[++o];let g=-1;if(m){c(m);return}for(;++g<l.length;)(h[g]===null||h[g]===void 0)&&(h[g]=l[g]);l=h,y?GB(y,f)(...h):c(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 GB(e,t){let n;return a;function a(...c){const f=e.length>c.length;let m;f&&c.push(l);try{m=e.apply(this,c)}catch(h){const y=h;if(f&&n)throw y;return l(y)}f||(m&&m.then&&typeof m.then=="function"?m.then(o,l):m instanceof Error?l(m):o(m))}function l(c,...f){n||(n=!0,t(c,...f))}function o(c){l(null,c)}}const Hr={basename:KB,dirname:YB,extname:XB,join:JB,sep:"/"};function KB(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ec(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 c=-1,f=t.length-1;for(;l--;)if(e.codePointAt(l)===47){if(o){n=l+1;break}}else c<0&&(o=!0,c=l+1),f>-1&&(e.codePointAt(l)===t.codePointAt(f--)?f<0&&(a=l):(f=-1,a=c));return n===a?a=c:a<0&&(a=e.length),e.slice(n,a)}function YB(e){if(ec(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 XB(e){ec(e);let t=e.length,n=-1,a=0,l=-1,o=0,c;for(;t--;){const f=e.codePointAt(t);if(f===47){if(c){a=t+1;break}continue}n<0&&(c=!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 JB(...e){let t=-1,n;for(;++t<e.length;)ec(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":WB(n)}function WB(e){ec(e);const t=e.codePointAt(0)===47;let n=e$(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function e$(e,t){let n="",a=0,l=-1,o=0,c=-1,f,m;for(;++c<=e.length;){if(c<e.length)f=e.codePointAt(c);else{if(f===47)break;f=47}if(f===47){if(!(l===c-1||o===1))if(l!==c-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=c,o=0;continue}}else if(n.length>0){n="",a=0,l=c,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",a=2)}else n.length>0?n+="/"+e.slice(l+1,c):n=e.slice(l+1,c),a=c-l-1;l=c,o=0}else f===46&&o>-1?o++:o=-1}return n}function ec(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const t$={cwd:n$};function n$(){return"/"}function Bg(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function r$(e){if(typeof e=="string")e=new URL(e);else if(!Bg(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 a$(e)}function a$(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 Tp=["history","path","basename","stem","extname","dirname"];class BE{constructor(t){let n;t?Bg(t)?n={path:t}:typeof t=="string"||i$(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":t$.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<Tp.length;){const o=Tp[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)Tp.includes(l)||(this[l]=n[l])}get basename(){return typeof this.path=="string"?Hr.basename(this.path):void 0}set basename(t){Rp(t,"basename"),Ap(t,"basename"),this.path=Hr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Hr.dirname(this.path):void 0}set dirname(t){rS(this.basename,"dirname"),this.path=Hr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Hr.extname(this.path):void 0}set extname(t){if(Ap(t,"extname"),rS(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=Hr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Bg(t)&&(t=r$(t)),Rp(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Hr.basename(this.path,this.extname):void 0}set stem(t){Rp(t,"stem"),Ap(t,"stem"),this.path=Hr.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 An(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 Ap(e,t){if(e&&e.includes(Hr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Hr.sep+"`")}function Rp(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function rS(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function i$(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const l$=(function(e){const a=this.constructor.prototype,l=a[e],o=function(){return l.apply(o,arguments)};return Object.setPrototypeOf(o,a),o}),s$={}.hasOwnProperty;class Jy extends l${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=QB()}copy(){const t=new Jy;let n=-1;for(;++n<this.attachers.length;){const a=this.attachers[n];t.use(...a)}return t.data(_p(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Dp("data",this.frozen),this.namespace[t]=n,this):s$.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Dp("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=Od(t),a=this.parser||this.Parser;return zp("parse",a),a(String(n),n)}process(t,n){const a=this;return this.freeze(),zp("process",this.parser||this.Parser),Op("process",this.compiler||this.Compiler),n?l(void 0,n):new Promise(l);function l(o,c){const f=Od(t),m=a.parse(f);a.run(m,f,function(y,g,b){if(y||!g||!b)return h(y);const w=g,k=a.stringify(w,b);c$(k)?b.value=k:b.result=k,h(y,b)});function h(y,g){y||!g?c(y):o?o(g):n(void 0,g)}}}processSync(t){let n=!1,a;return this.freeze(),zp("processSync",this.parser||this.Parser),Op("processSync",this.compiler||this.Compiler),this.process(t,l),iS("processSync","process",n),a;function l(o,c){n=!0,tS(o),a=c}}run(t,n,a){aS(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(c,f){const m=Od(n);l.run(t,m,h);function h(y,g,b){const w=g||t;y?f(y):c?c(w):a(void 0,w,b)}}}runSync(t,n){let a=!1,l;return this.run(t,n,o),iS("runSync","run",a),l;function o(c,f){tS(c),l=f,a=!0}}stringify(t,n){this.freeze();const a=Od(n),l=this.compiler||this.Compiler;return Op("stringify",l),aS(t),l(t,a)}use(t,...n){const a=this.attachers,l=this.namespace;if(Dp("use",this.frozen),t!=null)if(typeof t=="function")m(t,n);else if(typeof t=="object")Array.isArray(t)?f(t):c(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[y,...g]=h;m(y,g)}else c(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function c(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=_p(!0,l.settings,h.settings))}function f(h){let y=-1;if(h!=null)if(Array.isArray(h))for(;++y<h.length;){const g=h[y];o(g)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function m(h,y){let g=-1,b=-1;for(;++g<a.length;)if(a[g][0]===h){b=g;break}if(b===-1)a.push([h,...y]);else if(y.length>0){let[w,...k]=y;const j=a[b][1];Pg(j)&&Pg(w)&&(w=_p(!0,j,w)),a[b]=[h,w,...k]}}}}const o$=new Jy().freeze();function zp(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 Dp(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 aS(e){if(!Pg(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function iS(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Od(e){return u$(e)?e:new BE(e)}function u$(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function c$(e){return typeof e=="string"||d$(e)}function d$(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const f$="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",lS=[],sS={allowDangerousHtml:!0},h$=/^(https?|ircs?|mailto|xmpp)$/i,m$=[{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 p$(e){const t=g$(e),n=y$(e);return v$(t.runSync(t.parse(n),n),e)}function g$(e){const t=e.rehypePlugins||lS,n=e.remarkPlugins||lS,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...sS}:sS;return o$().use(Y8).use(n).use(HB,a).use(t)}function y$(e){const t=e.children||"",n=new BE;return typeof t=="string"&&(n.value=t),n}function v$(e,t){const n=t.allowedElements,a=t.allowElement,l=t.components,o=t.disallowedElements,c=t.skipHtml,f=t.unwrapDisallowed,m=t.urlTransform||b$;for(const y of m$)Object.hasOwn(t,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+f$+y.id,void 0);return Xy(e,h),OP(e,{Fragment:u.Fragment,components:l,ignoreInvalidStyle:!0,jsx:u.jsx,jsxs:u.jsxs,passKeys:!0,passNode:!0});function h(y,g,b){if(y.type==="raw"&&b&&typeof g=="number")return c?b.children.splice(g,1):b.children[g]={type:"text",value:y.value},g;if(y.type==="element"){let w;for(w in jp)if(Object.hasOwn(jp,w)&&Object.hasOwn(y.properties,w)){const k=y.properties[w],j=jp[w];(j===null||j.includes(y.tagName))&&(y.properties[w]=m(String(k||""),w,y))}}if(y.type==="element"){let w=n?!n.includes(y.tagName):o?o.includes(y.tagName):!1;if(!w&&a&&typeof g=="number"&&(w=!a(y,g,b)),w&&b&&typeof g=="number")return f&&y.children?b.children.splice(g,1,...y.children):b.children.splice(g,1),g}}}function b$(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||h$.test(e.slice(0,t))?e:""}function x$(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function $E(e,t,n){const l=Lf((n||{}).ignore||[]),o=w$(t);let c=-1;for(;++c<o.length;)PE(e,"text",f);function f(h,y){let g=-1,b;for(;++g<y.length;){const w=y[g],k=b?b.children:void 0;if(l(w,k?k.indexOf(w):void 0,b))return;b=w}if(b)return m(h,y)}function m(h,y){const g=y[y.length-1],b=o[c][0],w=o[c][1];let k=0;const E=g.children.indexOf(h);let C=!1,N=[];b.lastIndex=0;let z=b.exec(h.value);for(;z;){const U=z.index,D={index:z.index,input:z.input,stack:[...y,h]};let O=w(...z,D);if(typeof O=="string"&&(O=O.length>0?{type:"text",value:O}:void 0),O===!1?b.lastIndex=U+1:(k!==U&&N.push({type:"text",value:h.value.slice(k,U)}),Array.isArray(O)?N.push(...O):O&&N.push(O),k=U+z[0].length,C=!0),!b.global)break;z=b.exec(h.value)}return C?(k<h.value.length&&N.push({type:"text",value:h.value.slice(k)}),g.children.splice(E,1,...N)):N=[h],E+N.length}}function w$(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([S$(l[0]),k$(l[1])])}return t}function S$(e){return typeof e=="string"?new RegExp(x$(e),"g"):e}function k$(e){return typeof e=="function"?e:function(){return e}}function j$(e){$E(e,[/\r?\n|\r/g,C$])}function C$(){return{type:"break"}}function E$(){return function(e){j$(e)}}function oS(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 Mp="phrasing",Lp=["autolink","link","image","label"];function N$(){return{transforms:[D$],enter:{literalAutolink:T$,literalAutolinkEmail:Ip,literalAutolinkHttp:Ip,literalAutolinkWww:Ip},exit:{literalAutolink:O$,literalAutolinkEmail:z$,literalAutolinkHttp:A$,literalAutolinkWww:R$}}}function _$(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Mp,notInConstruct:Lp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Mp,notInConstruct:Lp},{character:":",before:"[ps]",after:"\\/",inConstruct:Mp,notInConstruct:Lp}]}}function T$(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Ip(e){this.config.enter.autolinkProtocol.call(this,e)}function A$(e){this.config.exit.autolinkProtocol.call(this,e)}function R$(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 z$(e){this.config.exit.autolinkEmail.call(this,e)}function O$(e){this.exit(e)}function D$(e){$E(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,M$],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),L$]],{ignore:["link","linkReference"]})}function M$(e,t,n,a,l){let o="";if(!FE(l)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!I$(n)))return!1;const c=U$(n+a);if(!c[0])return!1;const f={type:"link",title:null,url:o+t+c[0],children:[{type:"text",value:t+c[0]}]};return c[1]?[f,{type:"text",value:c[1]}]:f}function L$(e,t,n,a){return!FE(a,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function I$(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 U$(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=oS(e,"(");let o=oS(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 FE(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||wl(n)||Of(n))&&(!t||n!==47)}qE.peek=Q$;function P$(){this.buffer()}function B$(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function $$(){this.buffer()}function F$(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function q$(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ir(this.sliceSerialize(e)).toLowerCase(),n.label=t}function H$(e){this.exit(e)}function Z$(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ir(this.sliceSerialize(e)).toLowerCase(),n.label=t}function V$(e){this.exit(e)}function Q$(){return"["}function qE(e,t,n,a){const l=n.createTracker(a);let o=l.move("[^");const c=n.enter("footnoteReference"),f=n.enter("reference");return o+=l.move(n.safe(n.associationId(e),{after:"]",before:o})),f(),c(),o+=l.move("]"),o}function G$(){return{enter:{gfmFootnoteCallString:P$,gfmFootnoteCall:B$,gfmFootnoteDefinitionLabelString:$$,gfmFootnoteDefinition:F$},exit:{gfmFootnoteCallString:q$,gfmFootnoteCall:H$,gfmFootnoteDefinitionLabelString:Z$,gfmFootnoteDefinition:V$}}}function K$(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:qE},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(a,l,o,c){const f=o.createTracker(c);let m=f.move("[^");const h=o.enter("footnoteDefinition"),y=o.enter("label");return m+=f.move(o.safe(o.associationId(a),{before:m,after:"]"})),y(),m+=f.move("]:"),a.children&&a.children.length>0&&(f.shift(4),m+=f.move((t?`
|
|
371
|
+
`:" ")+o.indentLines(o.containerFlow(a,f.current()),t?HE:Y$))),h(),m}}function Y$(e,t,n){return t===0?e:HE(e,t,n)}function HE(e,t,n){return(n?"":" ")+e}const X$=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];ZE.peek=nF;function J$(){return{canContainEols:["delete"],enter:{strikethrough:eF},exit:{strikethrough:tF}}}function W$(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:X$}],handlers:{delete:ZE}}}function eF(e){this.enter({type:"delete",children:[]},e)}function tF(e){this.exit(e)}function ZE(e,t,n,a){const l=n.createTracker(a),o=n.enter("strikethrough");let c=l.move("~~");return c+=n.containerPhrasing(e,{...l.current(),before:c,after:"~"}),c+=l.move("~~"),o(),c}function nF(){return"~"}function rF(e){return e.length}function aF(e,t){const n=t||{},a=(n.align||[]).concat(),l=n.stringLength||rF,o=[],c=[],f=[],m=[];let h=0,y=-1;for(;++y<e.length;){const j=[],E=[];let C=-1;for(e[y].length>h&&(h=e[y].length);++C<e[y].length;){const N=iF(e[y][C]);if(n.alignDelimiters!==!1){const z=l(N);E[C]=z,(m[C]===void 0||z>m[C])&&(m[C]=z)}j.push(N)}c[y]=j,f[y]=E}let g=-1;if(typeof a=="object"&&"length"in a)for(;++g<h;)o[g]=uS(a[g]);else{const j=uS(a);for(;++g<h;)o[g]=j}g=-1;const b=[],w=[];for(;++g<h;){const j=o[g];let E="",C="";j===99?(E=":",C=":"):j===108?E=":":j===114&&(C=":");let N=n.alignDelimiters===!1?1:Math.max(1,m[g]-E.length-C.length);const z=E+"-".repeat(N)+C;n.alignDelimiters!==!1&&(N=E.length+N+C.length,N>m[g]&&(m[g]=N),w[g]=N),b[g]=z}c.splice(1,0,b),f.splice(1,0,w),y=-1;const k=[];for(;++y<c.length;){const j=c[y],E=f[y];g=-1;const C=[];for(;++g<h;){const N=j[g]||"";let z="",U="";if(n.alignDelimiters!==!1){const D=m[g]-(E[g]||0),O=o[g];O===114?z=" ".repeat(D):O===99?D%2?(z=" ".repeat(D/2+.5),U=" ".repeat(D/2-.5)):(z=" ".repeat(D/2),U=z):U=" ".repeat(D)}n.delimiterStart!==!1&&!g&&C.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&N==="")&&(n.delimiterStart!==!1||g)&&C.push(" "),n.alignDelimiters!==!1&&C.push(z),C.push(N),n.alignDelimiters!==!1&&C.push(U),n.padding!==!1&&C.push(" "),(n.delimiterEnd!==!1||g!==h-1)&&C.push("|")}k.push(n.delimiterEnd===!1?C.join("").replace(/ +$/,""):C.join(""))}return k.join(`
|
|
372
|
+
`)}function iF(e){return e==null?"":String(e)}function uS(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 lF(e,t,n,a){const l=n.enter("blockquote"),o=n.createTracker(a);o.move("> "),o.shift(2);const c=n.indentLines(n.containerFlow(e,o.current()),sF);return l(),c}function sF(e,t,n){return">"+(n?"":" ")+e}function oF(e,t){return cS(e,t.inConstruct,!0)&&!cS(e,t.notInConstruct,!1)}function cS(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 dS(e,t,n,a){let l=-1;for(;++l<n.unsafe.length;)if(n.unsafe[l].character===`
|
|
373
|
+
`&&oF(n.stack,n.unsafe[l]))return/[ \t]/.test(a.before)?"":" ";return`\\
|
|
374
|
+
`}function uF(e,t){const n=String(e);let a=n.indexOf(t),l=a,o=0,c=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;a!==-1;)a===l?++o>c&&(c=o):o=1,l=a+t.length,a=n.indexOf(t,l);return c}function cF(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 dF(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 fF(e,t,n,a){const l=dF(n),o=e.value||"",c=l==="`"?"GraveAccent":"Tilde";if(cF(e,n)){const g=n.enter("codeIndented"),b=n.indentLines(o,hF);return g(),b}const f=n.createTracker(a),m=l.repeat(Math.max(uF(o,l)+1,3)),h=n.enter("codeFenced");let y=f.move(m);if(e.lang){const g=n.enter(`codeFencedLang${c}`);y+=f.move(n.safe(e.lang,{before:y,after:" ",encode:["`"],...f.current()})),g()}if(e.lang&&e.meta){const g=n.enter(`codeFencedMeta${c}`);y+=f.move(" "),y+=f.move(n.safe(e.meta,{before:y,after:`
|
|
375
|
+
`,encode:["`"],...f.current()})),g()}return y+=f.move(`
|
|
376
|
+
`),o&&(y+=f.move(o+`
|
|
377
|
+
`)),y+=f.move(m),h(),y}function hF(e,t,n){return(n?"":" ")+e}function Wy(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 mF(e,t,n,a){const l=Wy(n),o=l==='"'?"Quote":"Apostrophe",c=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?" ":`
|
|
378
|
+
`,...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()),c(),h}function pF(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 zu(e){return"&#x"+e.toString(16).toUpperCase()+";"}function cf(e,t,n){const a=Ks(e),l=Ks(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}}VE.peek=gF;function VE(e,t,n,a){const l=pF(n),o=n.enter("emphasis"),c=n.createTracker(a),f=c.move(l);let m=c.move(n.containerPhrasing(e,{after:l,before:f,...c.current()}));const h=m.charCodeAt(0),y=cf(a.before.charCodeAt(a.before.length-1),h,l);y.inside&&(m=zu(h)+m.slice(1));const g=m.charCodeAt(m.length-1),b=cf(a.after.charCodeAt(0),g,l);b.inside&&(m=m.slice(0,-1)+zu(g));const w=c.move(l);return o(),n.attentionEncodeSurroundingInfo={after:b.outside,before:y.outside},f+m+w}function gF(e,t,n){return n.options.emphasis||"*"}function yF(e,t){let n=!1;return Xy(e,function(a){if("value"in a&&/\r?\n|\r/.test(a.value)||a.type==="break")return n=!0,Ig}),!!((!e.depth||e.depth<3)&&Hy(e)&&(t.options.setext||n))}function vF(e,t,n,a){const l=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(a);if(yF(e,n)){const y=n.enter("headingSetext"),g=n.enter("phrasing"),b=n.containerPhrasing(e,{...o.current(),before:`
|
|
379
|
+
`,after:`
|
|
380
|
+
`});return g(),y(),b+`
|
|
381
|
+
`+(l===1?"=":"-").repeat(b.length-(Math.max(b.lastIndexOf("\r"),b.lastIndexOf(`
|
|
382
|
+
`))+1))}const c="#".repeat(l),f=n.enter("headingAtx"),m=n.enter("phrasing");o.move(c+" ");let h=n.containerPhrasing(e,{before:"# ",after:`
|
|
383
|
+
`,...o.current()});return/^[\t ]/.test(h)&&(h=zu(h.charCodeAt(0))+h.slice(1)),h=h?c+" "+h:c,n.options.closeAtx&&(h+=" "+c),m(),f(),h}QE.peek=bF;function QE(e){return e.value||""}function bF(){return"<"}GE.peek=xF;function GE(e,t,n,a){const l=Wy(n),o=l==='"'?"Quote":"Apostrophe",c=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(")"),c(),h}function xF(){return"!"}KE.peek=wF;function KE(e,t,n,a){const l=e.referenceType,o=n.enter("imageReference");let c=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+"]["),c();const y=n.stack;n.stack=[],c=n.enter("reference");const g=n.safe(n.associationId(e),{before:m,after:"]",...f.current()});return c(),n.stack=y,o(),l==="full"||!h||h!==g?m+=f.move(g+"]"):l==="shortcut"?m=m.slice(0,-1):m+=f.move("]"),m}function wF(){return"!"}YE.peek=SF;function YE(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 c=n.unsafe[o],f=n.compilePattern(c);let m;if(c.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 SF(){return"`"}function XE(e,t){const n=Hy(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))}JE.peek=kF;function JE(e,t,n,a){const l=Wy(n),o=l==='"'?"Quote":"Apostrophe",c=n.createTracker(a);let f,m;if(XE(e,n)){const y=n.stack;n.stack=[],f=n.enter("autolink");let g=c.move("<");return g+=c.move(n.containerPhrasing(e,{before:g,after:">",...c.current()})),g+=c.move(">"),f(),n.stack=y,g}f=n.enter("link"),m=n.enter("label");let h=c.move("[");return h+=c.move(n.containerPhrasing(e,{before:h,after:"](",...c.current()})),h+=c.move("]("),m(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(m=n.enter("destinationLiteral"),h+=c.move("<"),h+=c.move(n.safe(e.url,{before:h,after:">",...c.current()})),h+=c.move(">")):(m=n.enter("destinationRaw"),h+=c.move(n.safe(e.url,{before:h,after:e.title?" ":")",...c.current()}))),m(),e.title&&(m=n.enter(`title${o}`),h+=c.move(" "+l),h+=c.move(n.safe(e.title,{before:h,after:l,...c.current()})),h+=c.move(l),m()),h+=c.move(")"),f(),h}function kF(e,t,n){return XE(e,n)?"<":"["}WE.peek=jF;function WE(e,t,n,a){const l=e.referenceType,o=n.enter("linkReference");let c=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+"]["),c();const y=n.stack;n.stack=[],c=n.enter("reference");const g=n.safe(n.associationId(e),{before:m,after:"]",...f.current()});return c(),n.stack=y,o(),l==="full"||!h||h!==g?m+=f.move(g+"]"):l==="shortcut"?m=m.slice(0,-1):m+=f.move("]"),m}function jF(){return"["}function ev(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 CF(e){const t=ev(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 EF(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 eN(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 NF(e,t,n,a){const l=n.enter("list"),o=n.bulletCurrent;let c=e.ordered?EF(n):ev(n);const f=e.ordered?c==="."?")":".":CF(n);let m=t&&n.bulletLastUsed?c===n.bulletLastUsed:!1;if(!e.ordered){const y=e.children?e.children[0]:void 0;if((c==="*"||c==="-")&&y&&(!y.children||!y.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),eN(n)===c&&y){let g=-1;for(;++g<e.children.length;){const b=e.children[g];if(b&&b.type==="listItem"&&b.children&&b.children[0]&&b.children[0].type==="thematicBreak"){m=!0;break}}}}m&&(c=f),n.bulletCurrent=c;const h=n.containerFlow(e,a);return n.bulletLastUsed=c,n.bulletCurrent=o,l(),h}function _F(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 TF(e,t,n,a){const l=_F(n);let o=n.bulletCurrent||ev(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 c=o.length+1;(l==="tab"||l==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(c=Math.ceil(c/4)*4);const f=n.createTracker(a);f.move(o+" ".repeat(c-o.length)),f.shift(c);const m=n.enter("listItem"),h=n.indentLines(n.containerFlow(e,f.current()),y);return m(),h;function y(g,b,w){return b?(w?"":" ".repeat(c))+g:(w?o:o+" ".repeat(c-o.length))+g}}function AF(e,t,n,a){const l=n.enter("paragraph"),o=n.enter("phrasing"),c=n.containerPhrasing(e,a);return o(),l(),c}const RF=Lf(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function zF(e,t,n,a){return(e.children.some(function(c){return RF(c)})?n.containerPhrasing:n.containerFlow).call(n,e,a)}function OF(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}tN.peek=DF;function tN(e,t,n,a){const l=OF(n),o=n.enter("strong"),c=n.createTracker(a),f=c.move(l+l);let m=c.move(n.containerPhrasing(e,{after:l,before:f,...c.current()}));const h=m.charCodeAt(0),y=cf(a.before.charCodeAt(a.before.length-1),h,l);y.inside&&(m=zu(h)+m.slice(1));const g=m.charCodeAt(m.length-1),b=cf(a.after.charCodeAt(0),g,l);b.inside&&(m=m.slice(0,-1)+zu(g));const w=c.move(l+l);return o(),n.attentionEncodeSurroundingInfo={after:b.outside,before:y.outside},f+m+w}function DF(e,t,n){return n.options.strong||"*"}function MF(e,t,n,a){return n.safe(e.value,a)}function LF(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 IF(e,t,n){const a=(eN(n)+(n.options.ruleSpaces?" ":"")).repeat(LF(n));return n.options.ruleSpaces?a.slice(0,-1):a}const nN={blockquote:lF,break:dS,code:fF,definition:mF,emphasis:VE,hardBreak:dS,heading:vF,html:QE,image:GE,imageReference:KE,inlineCode:YE,link:JE,linkReference:WE,list:NF,listItem:TF,paragraph:AF,root:zF,strong:tN,text:MF,thematicBreak:IF};function UF(){return{enter:{table:PF,tableData:fS,tableHeader:fS,tableRow:$F},exit:{codeText:FF,table:BF,tableData:Up,tableHeader:Up,tableRow:Up}}}function PF(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 BF(e){this.exit(e),this.data.inTable=void 0}function $F(e){this.enter({type:"tableRow",children:[]},e)}function Up(e){this.exit(e)}function fS(e){this.enter({type:"tableCell",children:[]},e)}function FF(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,qF));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function qF(e,t){return t==="|"?t:e}function HF(e){const t=e||{},n=t.tableCellPadding,a=t.tablePipeAlign,l=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
384
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:b,table:c,tableCell:m,tableRow:f}};function c(w,k,j,E){return h(y(w,j,E),w.align)}function f(w,k,j,E){const C=g(w,j,E),N=h([C]);return N.slice(0,N.indexOf(`
|
|
385
|
+
`))}function m(w,k,j,E){const C=j.enter("tableCell"),N=j.enter("phrasing"),z=j.containerPhrasing(w,{...E,before:o,after:o});return N(),C(),z}function h(w,k){return aF(w,{align:k,alignDelimiters:a,padding:n,stringLength:l})}function y(w,k,j){const E=w.children;let C=-1;const N=[],z=k.enter("table");for(;++C<E.length;)N[C]=g(E[C],k,j);return z(),N}function g(w,k,j){const E=w.children;let C=-1;const N=[],z=k.enter("tableRow");for(;++C<E.length;)N[C]=m(E[C],w,k,j);return z(),N}function b(w,k,j){let E=nN.inlineCode(w,k,j);return j.stack.includes("tableCell")&&(E=E.replace(/\|/g,"\\$&")),E}}function ZF(){return{exit:{taskListCheckValueChecked:hS,taskListCheckValueUnchecked:hS,paragraph:QF}}}function VF(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:GF}}}function hS(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function QF(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,c;for(;++o<l.length;){const f=l[o];if(f.type==="paragraph"){c=f;break}}c===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 GF(e,t,n,a){const l=e.children[0],o=typeof e.checked=="boolean"&&l&&l.type==="paragraph",c="["+(e.checked?"x":" ")+"] ",f=n.createTracker(a);o&&f.move(c);let m=nN.listItem(e,t,n,{...a,...f.current()});return o&&(m=m.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),m;function h(y){return y+c}}function KF(){return[N$(),G$(),J$(),UF(),ZF()]}function YF(e){return{extensions:[_$(),K$(e),W$(),HF(e),VF()]}}const XF={tokenize:rq,partial:!0},rN={tokenize:aq,partial:!0},aN={tokenize:iq,partial:!0},iN={tokenize:lq,partial:!0},JF={tokenize:sq,partial:!0},lN={name:"wwwAutolink",tokenize:tq,previous:oN},sN={name:"protocolAutolink",tokenize:nq,previous:uN},Da={name:"emailAutolink",tokenize:eq,previous:cN},ta={};function WF(){return{text:ta}}let al=48;for(;al<123;)ta[al]=Da,al++,al===58?al=65:al===91&&(al=97);ta[43]=Da;ta[45]=Da;ta[46]=Da;ta[95]=Da;ta[72]=[Da,sN];ta[104]=[Da,sN];ta[87]=[Da,lN];ta[119]=[Da,lN];function eq(e,t,n){const a=this;let l,o;return c;function c(g){return!$g(g)||!cN.call(a,a.previous)||tv(a.events)?n(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(g))}function f(g){return $g(g)?(e.consume(g),f):g===64?(e.consume(g),m):n(g)}function m(g){return g===46?e.check(JF,y,h)(g):g===45||g===95||Tn(g)?(o=!0,e.consume(g),m):y(g)}function h(g){return e.consume(g),l=!0,m}function y(g){return o&&l&&Dn(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(g)):n(g)}}function tq(e,t,n){const a=this;return l;function l(c){return c!==87&&c!==119||!oN.call(a,a.previous)||tv(a.events)?n(c):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(XF,e.attempt(rN,e.attempt(aN,o),n),n)(c))}function o(c){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(c)}}function nq(e,t,n){const a=this;let l="",o=!1;return c;function c(g){return(g===72||g===104)&&uN.call(a,a.previous)&&!tv(a.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),l+=String.fromCodePoint(g),e.consume(g),f):n(g)}function f(g){if(Dn(g)&&l.length<5)return l+=String.fromCodePoint(g),e.consume(g),f;if(g===58){const b=l.toLowerCase();if(b==="http"||b==="https")return e.consume(g),m}return n(g)}function m(g){return g===47?(e.consume(g),o?h:(o=!0,m)):n(g)}function h(g){return g===null||sf(g)||Ct(g)||wl(g)||Of(g)?n(g):e.attempt(rN,e.attempt(aN,y),n)(g)}function y(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(g)}}function rq(e,t,n){let a=0;return l;function l(c){return(c===87||c===119)&&a<3?(a++,e.consume(c),l):c===46&&a===3?(e.consume(c),o):n(c)}function o(c){return c===null?n(c):t(c)}}function aq(e,t,n){let a,l,o;return c;function c(h){return h===46||h===95?e.check(iN,m,f)(h):h===null||Ct(h)||wl(h)||h!==45&&Of(h)?m(h):(o=!0,e.consume(h),c)}function f(h){return h===95?a=!0:(l=a,a=void 0),e.consume(h),c}function m(h){return l||a||!o?n(h):t(h)}}function iq(e,t){let n=0,a=0;return l;function l(c){return c===40?(n++,e.consume(c),l):c===41&&a<n?o(c):c===33||c===34||c===38||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===60||c===63||c===93||c===95||c===126?e.check(iN,t,o)(c):c===null||Ct(c)||wl(c)?t(c):(e.consume(c),l)}function o(c){return c===41&&a++,e.consume(c),l}}function lq(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||Ct(f)||wl(f)?t(f):n(f)}function l(f){return f===null||f===40||f===91||Ct(f)||wl(f)?t(f):a(f)}function o(f){return Dn(f)?c(f):n(f)}function c(f){return f===59?(e.consume(f),a):Dn(f)?(e.consume(f),c):n(f)}}function sq(e,t,n){return a;function a(o){return e.consume(o),l}function l(o){return Tn(o)?n(o):t(o)}}function oN(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Ct(e)}function uN(e){return!Dn(e)}function cN(e){return!(e===47||$g(e))}function $g(e){return e===43||e===45||e===46||e===95||Tn(e)}function tv(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 oq={tokenize:gq,partial:!0};function uq(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:hq,continuation:{tokenize:mq},exit:pq}},text:{91:{name:"gfmFootnoteCall",tokenize:fq},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:cq,resolveTo:dq}}}}function cq(e,t,n){const a=this;let l=a.events.length;const o=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let c;for(;l--;){const m=a.events[l][1];if(m.type==="labelImage"){c=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(!c||!c._balanced)return n(m);const h=Ir(a.sliceSerialize({start:c.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 dq(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)},c={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",c,t],["exit",c,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 fq(e,t,n){const a=this,l=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o=0,c;return f;function f(g){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),m}function m(g){return g!==94?n(g):(e.enter("gfmFootnoteCallMarker"),e.consume(g),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(g){if(o>999||g===93&&!c||g===null||g===91||Ct(g))return n(g);if(g===93){e.exit("chunkString");const b=e.exit("gfmFootnoteCallString");return l.includes(Ir(a.sliceSerialize(b)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(g)}return Ct(g)||(c=!0),o++,e.consume(g),g===92?y:h}function y(g){return g===91||g===92||g===93?(e.consume(g),o++,h):h(g)}}function hq(e,t,n){const a=this,l=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o,c=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",y):n(k)}function y(k){if(c>999||k===93&&!f||k===null||k===91||Ct(k))return n(k);if(k===93){e.exit("chunkString");const j=e.exit("gfmFootnoteDefinitionLabelString");return o=Ir(a.sliceSerialize(j)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),b}return Ct(k)||(f=!0),c++,e.consume(k),k===92?g:y}function g(k){return k===91||k===92||k===93?(e.consume(k),c++,y):y(k)}function b(k){return k===58?(e.enter("definitionMarker"),e.consume(k),e.exit("definitionMarker"),l.includes(o)||l.push(o),ut(e,w,"gfmFootnoteDefinitionWhitespace")):n(k)}function w(k){return t(k)}}function mq(e,t,n){return e.check(Wu,t,e.attempt(oq,t,n))}function pq(e){e.exit("gfmFootnoteDefinition")}function gq(e,t,n){const a=this;return ut(e,l,"gfmFootnoteDefinitionIndent",5);function l(o){const c=a.events[a.events.length-1];return c&&c[1].type==="gfmFootnoteDefinitionIndent"&&c[2].sliceSerialize(c[1],!0).length===4?t(o):n(o)}}function yq(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(c,f){let m=-1;for(;++m<c.length;)if(c[m][0]==="enter"&&c[m][1].type==="strikethroughSequenceTemporary"&&c[m][1]._close){let h=m;for(;h--;)if(c[h][0]==="exit"&&c[h][1].type==="strikethroughSequenceTemporary"&&c[h][1]._open&&c[m][1].end.offset-c[m][1].start.offset===c[h][1].end.offset-c[h][1].start.offset){c[m][1].type="strikethroughSequence",c[h][1].type="strikethroughSequence";const y={type:"strikethrough",start:Object.assign({},c[h][1].start),end:Object.assign({},c[m][1].end)},g={type:"strikethroughText",start:Object.assign({},c[h][1].end),end:Object.assign({},c[m][1].start)},b=[["enter",y,f],["enter",c[h][1],f],["exit",c[h][1],f],["enter",g,f]],w=f.parser.constructs.insideSpan.null;w&&ur(b,b.length,0,Df(w,c.slice(h+1,m),f)),ur(b,b.length,0,[["exit",g,f],["enter",c[m][1],f],["exit",c[m][1],f],["exit",y,f]]),ur(c,h-1,m-h+3,b),m=h+b.length-2;break}}for(m=-1;++m<c.length;)c[m][1].type==="strikethroughSequenceTemporary"&&(c[m][1].type="data");return c}function o(c,f,m){const h=this.previous,y=this.events;let g=0;return b;function b(k){return h===126&&y[y.length-1][1].type!=="characterEscape"?m(k):(c.enter("strikethroughSequenceTemporary"),w(k))}function w(k){const j=Ks(h);if(k===126)return g>1?m(k):(c.consume(k),g++,w);if(g<2&&!n)return m(k);const E=c.exit("strikethroughSequenceTemporary"),C=Ks(k);return E._open=!C||C===2&&!!j,E._close=!j||j===2&&!!C,f(k)}}}class vq{constructor(){this.map=[]}add(t,n,a){bq(this,t,n,a)}consume(t){if(this.map.sort(function(o,c){return o[0]-c[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 bq(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 xq(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 wq(){return{flow:{null:{name:"table",tokenize:Sq,resolveAll:kq}}}}function Sq(e,t,n){const a=this;let l=0,o=0,c;return f;function f(F){let W=a.events.length-1;for(;W>-1;){const he=a.events[W][1].type;if(he==="lineEnding"||he==="linePrefix")W--;else break}const ee=W>-1?a.events[W][1].type:null,ye=ee==="tableHead"||ee==="tableRow"?O:m;return ye===O&&a.parser.lazy[a.now().line]?n(F):ye(F)}function m(F){return e.enter("tableHead"),e.enter("tableRow"),h(F)}function h(F){return F===124||(c=!0,o+=1),y(F)}function y(F){return F===null?n(F):Oe(F)?o>1?(o=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(F),e.exit("lineEnding"),w):n(F):tt(F)?ut(e,y,"whitespace")(F):(o+=1,c&&(c=!1,l+=1),F===124?(e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),c=!0,y):(e.enter("data"),g(F)))}function g(F){return F===null||F===124||Ct(F)?(e.exit("data"),y(F)):(e.consume(F),F===92?b:g)}function b(F){return F===92||F===124?(e.consume(F),g):g(F)}function w(F){return a.interrupt=!1,a.parser.lazy[a.now().line]?n(F):(e.enter("tableDelimiterRow"),c=!1,tt(F)?ut(e,k,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):k(F))}function k(F){return F===45||F===58?E(F):F===124?(c=!0,e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),j):D(F)}function j(F){return tt(F)?ut(e,E,"whitespace")(F):E(F)}function E(F){return F===58?(o+=1,c=!0,e.enter("tableDelimiterMarker"),e.consume(F),e.exit("tableDelimiterMarker"),C):F===45?(o+=1,C(F)):F===null||Oe(F)?U(F):D(F)}function C(F){return F===45?(e.enter("tableDelimiterFiller"),N(F)):D(F)}function N(F){return F===45?(e.consume(F),N):F===58?(c=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(F),e.exit("tableDelimiterMarker"),z):(e.exit("tableDelimiterFiller"),z(F))}function z(F){return tt(F)?ut(e,U,"whitespace")(F):U(F)}function U(F){return F===124?k(F):F===null||Oe(F)?!c||l!==o?D(F):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(F)):D(F)}function D(F){return n(F)}function O(F){return e.enter("tableRow"),M(F)}function M(F){return F===124?(e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),M):F===null||Oe(F)?(e.exit("tableRow"),t(F)):tt(F)?ut(e,M,"whitespace")(F):(e.enter("data"),I(F))}function I(F){return F===null||F===124||Ct(F)?(e.exit("data"),M(F)):(e.consume(F),F===92?X:I)}function X(F){return F===92||F===124?(e.consume(F),I):I(F)}}function kq(e,t){let n=-1,a=!0,l=0,o=[0,0,0,0],c=[0,0,0,0],f=!1,m=0,h,y,g;const b=new vq;for(;++n<e.length;){const w=e[n],k=w[1];w[0]==="enter"?k.type==="tableHead"?(f=!1,m!==0&&(mS(b,t,m,h,y),y=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,g=void 0,o=[0,0,0,0],c=[0,n+1,0,0],f&&(f=!1,y={type:"tableBody",start:Object.assign({},k.start),end:Object.assign({},k.end)},b.add(n,0,[["enter",y,t]])),l=k.type==="tableDelimiterRow"?2:y?3:1):l&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")?(a=!1,c[2]===0&&(o[1]!==0&&(c[0]=c[1],g=Dd(b,t,o,l,void 0,g),o=[0,0,0,0]),c[2]=n)):k.type==="tableCellDivider"&&(a?a=!1:(o[1]!==0&&(c[0]=c[1],g=Dd(b,t,o,l,void 0,g)),o=c,c=[o[1],n,0,0])):k.type==="tableHead"?(f=!0,m=n):k.type==="tableRow"||k.type==="tableDelimiterRow"?(m=n,o[1]!==0?(c[0]=c[1],g=Dd(b,t,o,l,n,g)):c[1]!==0&&(g=Dd(b,t,c,l,n,g)),l=0):l&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(c[3]=n)}for(m!==0&&mS(b,t,m,h,y),b.consume(t.events),n=-1;++n<t.events.length;){const w=t.events[n];w[0]==="enter"&&w[1].type==="table"&&(w[1]._align=xq(t.events,n))}return e}function Dd(e,t,n,a,l,o){const c=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",f="tableContent";n[0]!==0&&(o.end=Object.assign({},ws(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const m=ws(t.events,n[1]);if(o={type:c,start:Object.assign({},m),end:Object.assign({},m)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const h=ws(t.events,n[2]),y=ws(t.events,n[3]),g={type:f,start:Object.assign({},h),end:Object.assign({},y)};if(e.add(n[2],0,[["enter",g,t]]),a!==2){const b=t.events[n[2]],w=t.events[n[3]];if(b[1].end=Object.assign({},w[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",g,t]])}return l!==void 0&&(o.end=Object.assign({},ws(t.events,l)),e.add(l,0,[["exit",o,t]]),o=void 0),o}function mS(e,t,n,a,l){const o=[],c=ws(t.events,n);l&&(l.end=Object.assign({},c),o.push(["exit",l,t])),a.end=Object.assign({},c),o.push(["exit",a,t]),e.add(n+1,0,o)}function ws(e,t){const n=e[t],a=n[0]==="enter"?"start":"end";return n[1][a]}const jq={name:"tasklistCheck",tokenize:Eq};function Cq(){return{text:{91:jq}}}function Eq(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 Ct(m)?(e.enter("taskListCheckValueUnchecked"),e.consume(m),e.exit("taskListCheckValueUnchecked"),c):m===88||m===120?(e.enter("taskListCheckValueChecked"),e.consume(m),e.exit("taskListCheckValueChecked"),c):n(m)}function c(m){return m===93?(e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):n(m)}function f(m){return Oe(m)?t(m):tt(m)?e.check({tokenize:Nq},t,n)(m):n(m)}}function Nq(e,t,n){return ut(e,a,"whitespace");function a(l){return l===null?n(l):t(l)}}function _q(e){return xE([WF(),uq(),yq(e),wq(),Cq()])}const Tq={};function Aq(e){const t=this,n=e||Tq,a=t.data(),l=a.micromarkExtensions||(a.micromarkExtensions=[]),o=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),c=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);l.push(_q(n)),o.push(KF()),c.push(YF(n))}function dN({children:e,className:t}){return u.jsx("div",{className:Ae("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:u.jsx(p$,{remarkPlugins:[Aq,E$],children:e})})}function Rq({value:e,baseline:t,onChange:n,onRevert:a,disabled:l}){const[o,c]=x.useState(!1),f=x.useRef(null),m=e!==t;return x.useEffect(()=>{var h;o&&((h=f.current)==null||h.focus())},[o]),u.jsxs(sn,{style:{borderColor:m?"color-mix(in oklch, var(--state-blocked) 70%, transparent)":void 0},children:[u.jsxs(Ar,{children:[u.jsxs(Rr,{children:["System prompt append",m&&u.jsx(zq,{})]}),!o&&!l&&u.jsxs(me,{size:"xs",variant:"outline",onClick:()=>c(!0),children:[u.jsx(Vu,{className:"h-3 w-3"})," Edit"]})]}),u.jsx(ea,{children:o?u.jsxs("div",{className:"space-y-2",children:[u.jsx("textarea",{ref:f,value:e,onChange:h=>n(h.target.value),onKeyDown:h=>{h.key==="Escape"&&(h.preventDefault(),c(!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}),u.jsxs("div",{className:"flex justify-end gap-2",children:[u.jsx(me,{size:"xs",variant:"ghost",onClick:()=>{a(),c(!1)},disabled:!m,children:"Revert"}),u.jsx(me,{size:"xs",onClick:()=>c(!1),children:"Done"})]}),u.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."})]}):u.jsx("div",{className:"rounded bg-muted p-3 text-body max-h-64 overflow-auto min-h-8",children:e?u.jsx(dN,{children:e}):u.jsx("span",{className:"text-muted-foreground italic",children:"No prompt append."})})})]})}function zq(){return u.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 fN={"claude-code":"Claude Code",codex:"Codex"},Oq=[nf.CLAUDE_CODE,nf.CODEX];function Dq({open:e,onOpenChange:t,agent:n}){const a=jn(),l=n.clientId,o=n.runtimeProvider,[c,f]=x.useState(l),[m,h]=x.useState(o),[y,g]=x.useState(!1),w=He({queryKey:["clients-rebind"],queryFn:Ra,enabled:e}).data??[],k=xT({queries:w.map(I=>({queryKey:["client-capabilities",I.id],queryFn:()=>py(I.id),enabled:e}))}),j=x.useMemo(()=>{const I=new Map;return k.forEach((X,F)=>{const W=w[F];if(!W)return;const ee=X.data;ee!=null&&ee.capabilities&&I.set(W.id,ee.capabilities)}),I},[k,w]);x.useEffect(()=>{e||(f(l),h(o),g(!1))},[e,l,o]);const E=c?j.get(c)??null:null,C=(E==null?void 0:E[m])??null,N=!C||C.state==="missing"||C.state==="error",z=!!c&&(c!==l||m!==o)&&(!N||y),U=m!==o,D=c!==l,O=wt({mutationFn:()=>{if(!c)throw new Error("clientId required");return FD(n.uuid,{clientId:c,runtimeProvider:m,force:N&&y?!0:void 0})},onSuccess:()=>{a.invalidateQueries({queryKey:["agent",n.uuid]}),a.invalidateQueries({queryKey:["agents"]}),t(!1)}}),M=O.error instanceof Zu||O.error instanceof Error?O.error.message:null;return u.jsx($t,{open:e,onOpenChange:t,children:u.jsxs(zt,{className:"max-w-lg",children:[u.jsx(Gt,{children:u.jsx(Ft,{children:"Re-bind agent"})}),u.jsxs("div",{className:"space-y-4",children:[u.jsxs("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:["Currently:"," ",u.jsx("span",{className:"mono",children:Lq(l,w,o)})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{children:"Computer"}),u.jsx("select",{value:c??"",onChange:I=>f(I.target.value||null),className:"w-full rounded-[var(--radius-input)] border border-input bg-background px-3 py-2 text-body",children:w.map(I=>u.jsx("option",{value:I.id,children:Mq(I)},I.id))})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{children:"Runtime"}),u.jsx("div",{className:"space-y-2",children:Oq.map(I=>{const X=(E==null?void 0:E[I])??null,F=!!X&&X.state!=="missing",W=m===I;return u.jsxs("label",{className:W?"flex items-start gap-3 rounded-md border border-primary bg-primary/5 p-3 cursor-pointer":F?"flex items-start gap-3 rounded-md border border-border p-3 cursor-pointer hover:bg-accent/30":"flex items-start gap-3 rounded-md border border-border p-3 opacity-60",children:[u.jsx("input",{type:"radio",name:"rebind-runtime",checked:W,onChange:()=>h(I),className:"mt-1"}),u.jsxs("div",{children:[u.jsx("div",{className:"text-body font-medium",children:fN[I]}),u.jsx("div",{className:"text-caption",style:{color:"var(--fg-3)"},children:Uq(X,I)})]})]},I)})})]}),(D||U)&&u.jsxs("div",{className:"rounded-md border border-border bg-muted/30 px-3 py-2 text-caption space-y-1",children:[u.jsxs("p",{children:[u.jsx("span",{className:"font-medium",children:"Heads up:"})," active sessions on the previous computer are suspended at re-bind. Chat history is preserved."]}),U&&u.jsx("p",{children:"Some configuration fields don't transfer between providers (e.g. claude permission_mode is dropped; codex sandboxMode resets to default)."})]}),N&&u.jsxs("label",{className:"flex items-start gap-2 text-caption",style:{color:"var(--fg-2)"},children:[u.jsx("input",{type:"checkbox",checked:y,onChange:I=>g(I.target.checked),className:"mt-0.5"}),u.jsx("span",{children:"Override capability check — pick this if the destination computer is offline or the SDK was just installed and capabilities haven't refreshed yet."})]}),M&&u.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-body text-destructive",children:M})]}),u.jsxs(tn,{children:[u.jsx(me,{variant:"outline",onClick:()=>t(!1),disabled:O.isPending,children:"Cancel"}),u.jsx(me,{onClick:()=>O.mutate(),disabled:!z||O.isPending,children:O.isPending?"Re-binding…":"Re-bind"})]})]})})}function Mq(e){return`${e.hostname??e.id} · ${e.status}`}function Lq(e,t,n){const a=e?t.find(o=>o.id===e):null;return`${(a==null?void 0:a.hostname)??e??"(unbound)"} · ${fN[n]}`}const Iq={"claude-code":"Run `claude login` (or set ANTHROPIC_API_KEY) on the computer.",codex:"Run `codex login` (or set CODEX_API_KEY) on the computer."};function Uq(e,t){if(!e)return"Not reported on this computer.";switch(e.state){case"ok":return`Installed${e.sdkVersion?` v${e.sdkVersion}`:""}, authenticated.`;case"unauthenticated":return`Installed${e.sdkVersion?` v${e.sdkVersion}`:""}, not authenticated. ${Iq[t]}`;case"missing":return"SDK not installed on this computer.";case"error":return e.error?`Probe error: ${e.error}`:"Probe error."}}const Pq={prompt:"Prompt",model:"Model",mcp:"MCP",env:"Env",git:"Git"};function Bq(e){if(!e.summary.anyDirty&&!e.conflictMessage&&!e.errorMessage&&!e.justSaved)return null;const t=e.summary.dirtySections.length;return u.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:u.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[u.jsxs("div",{className:"flex flex-col gap-1 text-body min-w-0",children:[e.summary.anyDirty&&u.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[u.jsx(Xr,{state:"blocked",size:8}),u.jsxs("span",{className:"font-medium",children:[t," section",t===1?"":"s"," with unsaved changes"]}),u.jsx("span",{style:{color:"var(--fg-4)"},"aria-hidden":!0,children:"·"}),u.jsx("span",{className:"flex flex-wrap gap-1",children:e.summary.dirtySections.map(n=>u.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:Pq[n]},n))})]}),e.justSaved&&!e.summary.anyDirty&&!e.errorMessage&&!e.conflictMessage&&u.jsxs("div",{className:"inline-flex items-center gap-1.5 text-body font-medium",style:{color:"var(--state-idle)"},children:[u.jsx(cr,{className:"h-3.5 w-3.5"}),"Saved"]}),e.saveHint&&u.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:e.saveHint}),e.conflictMessage&&u.jsx("p",{className:"text-caption font-medium",style:{color:"var(--state-blocked)"},children:e.conflictMessage}),e.errorMessage&&u.jsx("p",{className:"text-caption font-medium",style:{color:"var(--state-error)"},children:e.errorMessage})]}),u.jsxs("div",{className:"flex gap-2 shrink-0",children:[e.conflictMessage&&u.jsx(me,{variant:"outline",size:"sm",onClick:e.onReloadRemote,children:"Discard mine, load latest"}),u.jsx(me,{variant:"ghost",size:"sm",onClick:e.onDiscard,disabled:e.saving,children:"Discard changes"}),u.jsx(me,{size:"sm",onClick:e.onSave,disabled:e.saving||!e.summary.anyDirty,children:e.saving?u.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[u.jsx(HR,{className:"h-3 w-3 animate-spin","aria-hidden":!0}),"Saving…"]}):"Save"})]})]})})}function wu(e){return`agent-cfg-${e}`}function fu({anchorId:e,title:t,caption:n,right:a,children:l,className:o,sectionProps:c}){return u.jsxs("section",{id:e,className:Ae("space-y-3",o),...c,children:[u.jsxs("div",{className:"flex items-end justify-between gap-3",children:[u.jsxs("div",{children:[u.jsx("h2",{className:"text-subtitle",style:{color:"var(--fg)"},children:t}),n&&u.jsx("div",{className:"text-caption",style:{color:"var(--fg-3)"},children:n})]}),a]}),u.jsx("div",{className:"space-y-3",children:l})]})}function $q(){return u.jsx("hr",{"aria-hidden":!0,style:{border:0,borderTop:"var(--hairline) solid var(--border)",margin:"var(--sp-2) 0"}})}const Fq={"claude-code":{name:"Claude Code",caption:"Anthropic's Claude Code runtime. Re-bind via the agent's settings to switch computer or runtime."},codex:{name:"Codex",caption:"OpenAI's Codex CLI runtime. Re-bind via the agent's settings to switch computer or runtime."}};function qq(e){const t=Fq[e.runtimeProvider];return u.jsxs("div",{className:"space-y-3",children:[u.jsx(Hq,{name:t.name,caption:t.caption,locked:!0}),u.jsx(Zq,{computerLabel:e.computerLabel,canBindComputer:e.canBindComputer,bindPending:e.bindComputerPending??!1,onBindComputer:e.onBindComputer,onRebind:e.onRebind}),e.modelSlot]})}function Hq({name:e,caption:t,locked:n}){return u.jsxs(sn,{children:[u.jsx(Ar,{children:u.jsxs(Rr,{children:["Where it runs",n&&u.jsxs("span",{className:"mono uppercase text-caption inline-flex items-center gap-1",style:{color:"var(--fg-4)"},children:[u.jsx(Dk,{className:"h-3 w-3","aria-hidden":!0})," locked"]})]})}),u.jsxs(ea,{className:"space-y-1 text-body",children:[u.jsxs("div",{className:"inline-flex items-center gap-2",children:[u.jsx(Mk,{className:"h-3.5 w-3.5","aria-hidden":!0,style:{color:"var(--accent)"}}),u.jsx("span",{className:"font-medium",children:e})]}),u.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:t})]})]})}function Zq(e){const t=!!e.computerLabel;return u.jsxs(sn,{children:[u.jsxs(Ar,{children:[u.jsx(Rr,{children:"Bound computer"}),e.canBindComputer&&e.onBindComputer&&!t&&u.jsxs(me,{size:"xs",variant:"outline",onClick:e.onBindComputer,disabled:e.bindPending,children:[u.jsx(gg,{className:"h-3 w-3"}),e.bindPending?"Binding…":"Bind computer"]}),t&&e.onRebind&&u.jsxs(me,{size:"xs",variant:"outline",onClick:e.onRebind,children:[u.jsx(gg,{className:"h-3 w-3"}),"Re-bind"]})]}),u.jsx(ea,{className:"text-body",children:t?u.jsx("div",{className:"mono",style:{color:"var(--fg-2)"},children:e.computerLabel}):u.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 Vq(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 Qq(e,t){let n=t.size+1;for(;t.has(`${e}-${n}`);)n++;return`${e}-${n}`}function Gq(e,t){return JSON.stringify(e)===JSON.stringify(t)}function Pp(e,t){return e.map((n,a)=>({key:`${t}-${a+1}`,value:n,baseline:n,status:"unchanged"}))}function pS(e){return e.map(t=>t.status==="deleted"?t:t.baseline==null?{...t,status:"added"}:Gq(t.value,t.baseline)?{...t,status:"unchanged"}:{...t,status:"modified"})}function Bp(e,t){const n=e;return{add:a=>t(l=>{const o=l[e],c=new Set(o.map(h=>h.key)),f=Qq(n,c),m=[...o,{key:f,value:a,baseline:null,status:"added"}];return{...l,[e]:pS(m)}}),update:(a,l)=>t(o=>{const f=o[e].map(m=>m.key===a?{...m,value:l}:m);return{...o,[e]:pS(f)}}),remove:a=>t(l=>{const c=l[e].map(f=>f.key!==a?f:f.baseline==null?null:{...f,status:"deleted"}).filter(f=>f!==null);return{...l,[e]:c}}),undo:a=>t(l=>{const c=l[e].map(f=>f.key!==a||f.baseline==null?f:{...f,value:f.baseline,status:"unchanged"});return{...l,[e]:c}})}}function Kq(e){return{promptAppend:e.payload.prompt.append,model:e.payload.model,mcp:Pp(e.payload.mcpServers,"mcp"),env:Pp(e.payload.env,"env"),git:Pp(e.payload.gitRepos,"git")}}function Yq(e){const[t,n]=x.useState(null);x.useEffect(()=>{e&&t===null&&n(Kq(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)??"",c=a.promptAppend!==l,f=a.model!==o,m=x.useMemo(()=>{const z=[],U=I=>I.reduce((X,F)=>F.status==="unchanged"?X:X+1,0),D=U(a.mcp),O=U(a.env),M=U(a.git);return c&&z.push("prompt"),f&&z.push("model"),D>0&&z.push("mcp"),O>0&&z.push("env"),M>0&&z.push("git"),{anyDirty:z.length>0,dirtySections:z,counts:{prompt:c?1:0,model:f?1:0,mcp:D,env:O,git:M}}},[a,c,f]),h=x.useCallback(z=>{n(U=>U&&z(U))},[]),y=x.useCallback(z=>h(U=>({...U,promptAppend:z})),[h]),g=x.useCallback(()=>h(z=>({...z,promptAppend:l})),[h,l]),b=x.useCallback(z=>h(U=>({...U,model:z})),[h]),w=x.useCallback(()=>h(z=>({...z,model:o})),[h,o]),k=x.useMemo(()=>Bp("mcp",h),[h]),j=x.useMemo(()=>Bp("env",h),[h]),E=x.useMemo(()=>Bp("git",h),[h]),C=x.useCallback(()=>{n(null)},[]),N=x.useCallback(()=>{if(!t||!e)return{};const z={};c&&(z.prompt={append:t.promptAppend}),f&&(z.model=t.model);const U=m.counts.mcp>0,D=m.counts.env>0,O=m.counts.git>0;return U&&(z.mcpServers=t.mcp.filter(M=>M.status!=="deleted").map(M=>M.value)),D&&(z.env=t.env.filter(M=>M.status!=="deleted").map(M=>{const I=M.value;return I.sensitive&&I.value===rf?{key:I.key,value:rf,sensitive:!0}:I})),O&&(z.gitRepos=t.git.filter(M=>M.status!=="deleted").map(M=>M.value)),z},[t,e,c,f,m]);return{draft:a,summary:m,promptDirty:c,modelDirty:f,setPromptAppend:y,revertPrompt:g,setModel:b,revertModel:w,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:N}}const Nn={overview:"ad-overview",setup:"ad-setup",prompt:wu("prompt"),tools:wu("mcp"),advanced:"ad-advanced",danger:"ad-danger"};function Xq(e){const t=[{key:"overview",label:"Profile",anchor:Nn.overview}];return e||t.push({key:"setup",label:"Setup",anchor:Nn.setup},{key:"prompt",label:"Prompt",anchor:Nn.prompt},{key:"tools",label:"Tools",anchor:Nn.tools},{key:"advanced",label:"Advanced",anchor:Nn.advanced}),t.push({key:"danger",label:"Danger zone",anchor:Nn.danger,divider:!0,danger:!0}),t}function Jq(){var pn,ht,zr,Ln,tc,Li,Ii,Ui,Pr,Pi,Ia,nc;const t=vk().uuid??"",n=dn(),a=jn(),l=He({queryKey:["agent",t],queryFn:()=>Xj(t),enabled:!!t}),o=He({queryKey:["agent-config",t],queryFn:()=>_U(t),enabled:!!t&&((pn=l.data)==null?void 0:pn.type)!=="human"}),c=He({queryKey:["agent-client-status",t],queryFn:()=>RU(t),enabled:!!t&&((ht=l.data)==null?void 0:ht.type)!=="human"}),f=He({queryKey:["agent-sessions-active",t],queryFn:()=>eo(t,{state:"active"}),enabled:!!t&&((zr=l.data)==null?void 0:zr.type)!=="human"}),m=He({queryKey:["clients"],queryFn:Ra,enabled:!!t&&((Ln=l.data)==null?void 0:Ln.type)!=="human",refetchInterval:3e4}),h=Yq(o.data),[y,g]=x.useState(null),[b,w]=x.useState(null),[k,j]=x.useState(!1),E=wt({mutationFn:async()=>{if(!o.data)throw new Error("config not loaded");const Se=h.buildPayloadPatch();return TU(t,{expectedVersion:o.data.version,payload:Se})},onSuccess:Se=>{a.setQueryData(["agent-config",t],Se),g(null),w(null),j(!0)},onError:Se=>{if(j(!1),Se instanceof Zu&&Se.status===409){w("Someone else saved a newer version while you were editing."),g(null);return}g(Se instanceof Error?Se.message:String(Se))}});x.useEffect(()=>{if(!k)return;const Se=setTimeout(()=>j(!1),2500);return()=>clearTimeout(Se)},[k]),x.useEffect(()=>{h.summary.anyDirty&&j(!1)},[h.summary.anyDirty]);const C=x.useCallback(()=>{w(null),g(null),a.invalidateQueries({queryKey:["agent-config",t]}),h.resetAll()},[a,t,h]),N=x.useCallback(Se=>{const Je=document.getElementById(Se);Je&&Je.scrollIntoView({behavior:"smooth",block:"start"})},[]),z=wt({mutationFn:Se=>K1(t,Se),onSuccess:()=>{a.invalidateQueries({queryKey:["agent",t]}),a.invalidateQueries({queryKey:["agents"]})}}),U=wt({mutationFn:()=>HD(t),onSuccess:()=>a.invalidateQueries({queryKey:["agent",t]})}),D=wt({mutationFn:()=>ZD(t),onSuccess:()=>a.invalidateQueries({queryKey:["agent",t]})}),O=wt({mutationFn:()=>qD(t),onSuccess:()=>n("/agents")}),M=wt({mutationFn:()=>VD(t)}),[I,X]=x.useState(!1),[F,W]=x.useState(""),[ee,ye]=x.useState(null),[he,ne]=x.useState(!1),Z=He({queryKey:["clients"],queryFn:Ra,enabled:I}),te=wt({mutationFn:Se=>K1(t,{clientId:Se}),onSuccess:()=>{a.invalidateQueries({queryKey:["agent",t]}),a.invalidateQueries({queryKey:["agent-client-status",t]}),a.invalidateQueries({queryKey:["agents"]}),X(!1),W(""),ye(null)},onError:Se=>ye(Se instanceof Error?Se.message:String(Se))}),[ie,ue]=x.useState(!1),[A,P]=x.useState(null),B=wt({mutationFn:()=>AU(t,h.buildPayloadPatch()),onSuccess:Se=>{const Je=Se.diff.length?Se.diff.map(gn=>`${gn.op} ${gn.path}`).join(`
|
|
386
|
+
`):"(no changes)";P(Je)},onError:Se=>P(`Dry run failed: ${Se instanceof Error?Se.message:String(Se)}`)});x.useEffect(()=>{if(!h.summary.anyDirty)return;const Se=Je=>{Je.preventDefault(),Je.returnValue=""};return window.addEventListener("beforeunload",Se),()=>window.removeEventListener("beforeunload",Se)},[h.summary.anyDirty]);const T=((tc=l.data)==null?void 0:tc.type)==="human",q=x.useMemo(()=>Xq(T),[T]),K=x.useRef(null),[ce,xe]=x.useState(!1);x.useEffect(()=>{if(T)return;const Se=K.current;if(!Se||typeof IntersectionObserver>"u")return;const Je=new IntersectionObserver(gn=>{const ra=gn[0];ra&&xe(!ra.isIntersecting&&ra.boundingClientRect.top<0)},{threshold:0});return Je.observe(Se),()=>Je.disconnect()},[T]);const[we,pe]=x.useState(Nn.overview);x.useEffect(()=>{if(typeof IntersectionObserver>"u")return;const Se=[];for(const Je of q){const gn=document.getElementById(Je.anchor);if(!gn)continue;const ra=new IntersectionObserver(fo=>{for(const rc of fo)rc.isIntersecting&&pe(Je.anchor)},{rootMargin:"0% 0% -70% 0%",threshold:0});ra.observe(gn),Se.push(ra)}return()=>{for(const Je of Se)Je.disconnect()}},[q]);const Xe=x.useMemo(()=>{const Se=new Set;for(const Je of h.summary.dirtySections)Je==="prompt"&&Se.add(Nn.prompt),Je==="model"&&Se.add(Nn.setup),Je==="mcp"&&Se.add(Nn.tools),(Je==="env"||Je==="git")&&Se.add(Nn.advanced);return Se},[h.summary.dirtySections]);if(l.isLoading)return u.jsx("div",{className:"-m-6 flex",style:{minHeight:"100%"},children:u.jsx("div",{className:"p-6 text-body",style:{color:"var(--fg-3)"},children:"Loading…"})});if(l.error)return u.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 Le=l.data;if(!Le)return u.jsx("div",{className:"-m-6 p-6 text-body",style:{color:"var(--fg-3)"},children:"Agent not found"});const re=Le.type==="human",Ee=c.data,Ie=((Li=f.data)==null?void 0:Li.length)??0,Pe=!re&&!(Ee!=null&&Ee.clientId),Lt=!re&&Ee?!Ee.online&&!!Ee.clientId:!1,fn=Le,_l=fn.runtimeState??null,Ma=fn.runtimeType??null,La=fn.totalSessions??null,na=Le.uuid.slice(0,8),oo=Vq({activeSessions:Ie,isUnclaimed:Pe,isOffline:Lt}),uo=h.draft.mcp.filter(Se=>Se.status!=="deleted"),hn=h.draft.env.filter(Se=>Se.status!=="deleted"),co=h.draft.git.filter(Se=>Se.status!=="deleted"),le=Se=>new Set(uo.filter(Je=>Je.key!==Se).map(Je=>Je.value.name.toLowerCase())),be=Se=>new Set(hn.filter(Je=>Je.key!==Se).map(Je=>Je.value.key)),Ue=Se=>new Set(co.filter(Je=>Je.key!==Se).map(Je=>{const{value:gn}=Je;return gn.localPath?gn.localPath:((gn.url.split(/[?#]/)[0]??"").split(/[/:]/).filter(Boolean).pop()??"").replace(/\.git$/i,"")}).filter(Boolean)),$e={sessions:La??"—",active:Ie,runtime:Ma??(re?"human":"—"),model:((Ui=(Ii=o.data)==null?void 0:Ii.payload.model)==null?void 0:Ui.trim())||"—"},at=(Ee==null?void 0:Ee.clientId)??null,mn=at?((Pr=m.data)==null?void 0:Pr.find(Se=>Se.id===at))??null:null,fr=at?(mn==null?void 0:mn.hostname)??at:null,nn=Le.runtimeProvider??"claude-code",Zt=nn==="codex"?"Codex":"Claude Code";return u.jsxs("div",{className:"-m-6 flex",style:{minHeight:"calc(100vh - var(--sp-10))"},children:[u.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:[u.jsx(Yu,{style:{display:"block",padding:"var(--sp-1) var(--sp-4) var(--sp-2)"},children:"Agent"}),q.map(Se=>u.jsxs("div",{children:[Se.divider&&u.jsx("div",{"aria-hidden":!0,style:{margin:"var(--sp-2) var(--sp-3_5)",borderTop:"var(--hairline) solid var(--border)"}}),u.jsx(Wq,{label:Se.label,active:we===Se.anchor,danger:Se.danger??!1,dirty:Xe.has(Se.anchor),onClick:()=>N(Se.anchor)})]},Se.key))]}),u.jsxs("div",{className:"flex-1 min-w-0 overflow-auto",style:{background:"var(--bg)"},children:[u.jsxs("div",{style:{padding:"var(--sp-3_5) var(--sp-5)",borderBottom:"var(--hairline) solid var(--border-faint)",background:"var(--bg-raised)"},children:[u.jsxs(zU,{style:{marginBottom:"var(--sp-2)"},children:[u.jsx(OU,{onClick:()=>n("/agents"),children:"Agents"}),u.jsx(DU,{}),u.jsx(MU,{mono:!0,children:Le.name??na})]}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.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:u.jsx(to,{width:18,height:20,style:{color:"var(--accent)"}})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsxs("div",{className:"flex items-baseline gap-2",children:[u.jsx("span",{className:"text-title",title:`agt_${na}`,children:Le.displayName}),u.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:["@",Le.name??na]})]}),u.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 text-caption",style:{color:"var(--fg-4)"},children:[u.jsx(Sn,{tone:Le.type==="autonomous_agent"?"accent":"neutral",children:Le.type}),Le.visibility&&u.jsx(Sn,{tone:Le.visibility==="organization"?"accent":"outline",children:Le.visibility}),(Ee==null?void 0:Ee.offlineSince)&&u.jsxs("span",{className:"mono",children:["offline since ",Ni(Ee.offlineSince)]})]})]}),u.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[u.jsx(Gs,{state:_l}),u.jsxs(me,{variant:"ghost",size:"xs",onClick:()=>n(`/?a=${Le.uuid}`),children:[u.jsx(dy,{className:"h-3 w-3"})," Open chat"]}),!re&&Le.status==="active"&&u.jsxs(me,{variant:"outline",size:"xs",onClick:()=>{M.reset(),M.mutate()},disabled:M.isPending,children:[u.jsx(Mk,{className:"h-3 w-3"}),M.isPending?"Testing…":"Test"]})]})]}),u.jsxs("div",{className:"grid gap-1.5 mt-3",style:{gridTemplateColumns:"repeat(4, 1fr)"},children:[u.jsx(Ad,{label:"sessions",value:$e.sessions}),u.jsx(Ad,{label:"active",value:$e.active,accent:typeof $e.active=="number"&&$e.active>0?"var(--accent)":void 0}),u.jsx(Ad,{label:"runtime",value:$e.runtime}),u.jsx(Ad,{label:"model",value:$e.model})]})]}),u.jsx("div",{ref:K,"aria-hidden":!0,style:{height:0}}),!re&&u.jsx(IU,{runtimeLabel:Zt,computerLabel:fr,visible:ce}),u.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:[(M.data||M.error)&&u.jsx(i7,{result:M.data??{status:"error",message:"Failed to reach server"},onDismiss:()=>M.reset()}),u.jsx(fu,{anchorId:Nn.overview,title:"Profile",right:u.jsxs(me,{variant:"outline",size:"xs",onClick:()=>n(`/settings?agent=${Le.uuid}`),title:"Manage platform bindings in Settings",children:[u.jsx(gg,{className:"h-3 w-3"}),"Manage bindings"]}),children:u.jsx(VU,{agent:Le,onSave:async Se=>{await z.mutateAsync(Se)}})}),!re&&u.jsxs(u.Fragment,{children:[u.jsxs(fu,{anchorId:Nn.setup,title:"Setup",caption:((Pi=o.data)==null?void 0:Pi.version)!=null?u.jsxs("span",{className:"mono",children:["config v",o.data.version,h.summary.anyDirty&&u.jsxs(u.Fragment,{children:[" · ",u.jsx("span",{style:{color:"var(--state-blocked)"},children:"draft"})]})]}):null,children:[o.isLoading&&u.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Loading configuration…"}),o.error&&u.jsxs("div",{className:"text-body",style:{color:"var(--state-error)"},children:["Failed to load configuration: ",String(o.error)]}),o.data&&u.jsx(qq,{runtimeProvider:nn,computerLabel:fr,canBindComputer:Pe&&Le.status==="active",bindComputerPending:te.isPending,onBindComputer:()=>X(!0),onRebind:Le.clientId?()=>ne(!0):void 0,modelSlot:u.jsx(rP,{value:h.draft.model,baseline:((Ia=o.data)==null?void 0:Ia.payload.model)??"",onChange:h.setModel,onRevert:h.revertModel,disabled:Le.status!=="active",provider:nn})})]}),u.jsx(fu,{anchorId:Nn.prompt,title:"Prompt",children:o.data?u.jsx(Rq,{value:h.draft.promptAppend,baseline:((nc=o.data)==null?void 0:nc.payload.prompt.append)??"",onChange:h.setPromptAppend,onRevert:h.revertPrompt,disabled:Le.status!=="active"}):null}),u.jsx(fu,{anchorId:Nn.tools,title:"Tools",caption:"MCP servers available to this agent",children:o.data?u.jsx(KU,{items:h.draft.mcp,otherNames:le,onAdd:h.addMcp,onUpdate:h.updateMcp,onDelete:h.deleteMcp,onUndoDelete:h.undoDeleteMcp,disabled:Le.status!=="active"}):null}),u.jsx(fu,{anchorId:Nn.advanced,title:"Advanced",caption:"Environment variables and git repositories the runtime clones into each session.",children:o.data&&u.jsxs("div",{className:"space-y-4",children:[u.jsx("div",{id:wu("env"),children:u.jsx(FU,{items:h.draft.env,otherKeys:be,onAdd:h.addEnv,onUpdate:h.updateEnv,onDelete:h.deleteEnv,onUndoDelete:h.undoDeleteEnv,disabled:Le.status!=="active"})}),u.jsx("div",{id:wu("git"),children:u.jsx(HU,{items:h.draft.git,otherPaths:Ue,onAdd:h.addGit,onUpdate:h.updateGit,onDelete:h.deleteGit,onUndoDelete:h.undoDeleteGit,disabled:Le.status!=="active"})}),A&&u.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:A}),h.summary.anyDirty&&u.jsx("div",{className:"text-label",style:{color:"var(--fg-3)"},children:u.jsx("button",{type:"button",onClick:()=>B.mutate(),className:"underline bg-transparent border-0 cursor-pointer",style:{color:"var(--fg-3)"},disabled:B.isPending,children:B.isPending?"Computing dry-run…":"Preview server-side diff"})})]})})]}),u.jsx($q,{}),u.jsx(UU,{agent:Le,suspendPending:U.isPending,reactivatePending:D.isPending,deletePending:O.isPending,onSuspend:()=>U.mutate(),onReactivate:()=>D.mutate(),onDelete:()=>O.mutate()})]}),!re&&u.jsx(Bq,{summary:h.summary,saveHint:oo,conflictMessage:b,errorMessage:y,saving:E.isPending,justSaved:k,onSave:()=>E.mutate(),onDiscard:()=>{h.summary.anyDirty&&ue(!0)},onReloadRemote:C,onJumpTo:Se=>N(wu(Se))})]}),u.jsx(e7,{open:ie,onOpenChange:ue,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(),g(null),w(null),ue(!1)}}),u.jsx($t,{open:I,onOpenChange:Se=>{X(Se),Se||(W(""),ye(null),te.reset())},children:u.jsxs(zt,{children:[u.jsx(Gt,{children:u.jsx(Ft,{children:"Bind computer"})}),u.jsxs("div",{className:"space-y-4",children:[u.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."}),Z.isLoading?u.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Loading computers…"}):Z.error?u.jsxs("div",{className:"text-body",style:{color:"var(--state-error)"},children:["Failed to load computers: ",Z.error instanceof Error?Z.error.message:"Unknown"]}):u.jsx(t7,{clients:Z.data??[],selected:F,onSelect:W}),ee&&u.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:ee})]}),u.jsxs(tn,{children:[u.jsx(me,{variant:"outline",onClick:()=>X(!1),children:"Cancel"}),u.jsx(me,{disabled:!F||te.isPending,onClick:()=>{ye(null),te.mutate(F)},children:te.isPending?"Binding…":"Bind"})]})]})}),u.jsx(Dq,{open:he,onOpenChange:ne,agent:Le})]})}function Wq({label:e,active:t,danger:n,dirty:a,onClick:l}){return u.jsx("button",{type:"button",onClick:l,className:Ae("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:u.jsxs("span",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"flex-1 truncate",children:e}),a&&u.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&&u.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 e7(e){return u.jsx($t,{open:e.open,onOpenChange:e.onOpenChange,children:u.jsxs(zt,{children:[u.jsx(Gt,{children:u.jsx(Ft,{children:e.title})}),u.jsx("div",{className:"space-y-3 text-body",style:{color:"var(--fg-2)"},children:e.description}),u.jsxs(tn,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>e.onOpenChange(!1),disabled:e.pending,children:"Cancel"}),u.jsx(me,{type:"button",variant:e.destructive?"destructive":"default",onClick:e.onConfirm,disabled:e.pending,children:e.pending?"Working…":e.confirmLabel})]})]})})}function t7({clients:e,selected:t,onSelect:n}){const a=e.filter(l=>l.status==="connected");return a.length===0?u.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"," ",u.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."]}):u.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,c=l.status==="online"||l.status==="active";return u.jsx("li",{style:{borderTop:"var(--hairline) solid var(--border-faint)"},children:u.jsxs("button",{type:"button",onClick:()=>n(l.id),className:Ae("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:[u.jsx("span",{className:Ae("inline-block h-2 w-2 rounded-full shrink-0"),style:{background:c?"var(--state-idle)":"var(--fg-4)"},"aria-hidden":!0}),u.jsxs("span",{className:"flex-1 min-w-0",children:[u.jsx("span",{className:"block text-body truncate font-medium",children:l.hostname??l.id}),u.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}`:""]})]}),u.jsx("span",{className:"text-label",style:{color:"var(--fg-3)"},children:l.status})]})},l.id)})})}const n7={success:"Connected",timeout:"Timed out",offline:"Offline",stale:"Stale",error:"Error"},r7={success:"var(--state-idle)",timeout:"var(--state-blocked)",offline:"var(--state-offline)",stale:"var(--state-blocked)",error:"var(--state-error)"},a7={success:"accent",timeout:"warn",stale:"warn",error:"error",offline:"neutral"};function i7({result:e,onDismiss:t}){const n=r7[e.status],a=a7[e.status],l=e.connection;return u.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:u.jsxs("div",{className:"flex items-start justify-between gap-3",children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Sn,{tone:a,children:n7[e.status]}),e.responseTime!=null&&u.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:[(e.responseTime/1e3).toFixed(1),"s"]})]}),e.message&&u.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:e.message}),l&&u.jsxs("div",{className:"text-label",style:{color:"var(--fg-3)",borderTop:"var(--hairline) solid var(--border-faint)",paddingTop:6,marginTop:2},children:[u.jsx("div",{children:l.runtimeState&&u.jsxs("span",{className:"mono",children:["runtime: ",l.runtimeState]})}),l.client?u.jsxs("div",{children:["Computer: ",l.client.hostname??l.client.id,l.client.os&&` (${l.client.os})`,l.client.sdkVersion&&` · SDK ${l.client.sdkVersion}`]}):u.jsx("div",{children:"No computer bound"}),l.lastSeenAt&&u.jsxs("div",{children:["Last seen: ",new Date(l.lastSeenAt).toLocaleString()]})]}),e.responseContent&&u.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})]}),u.jsx(me,{variant:"ghost",size:"sm",onClick:t,children:"Dismiss"})]})})}function l7(e){return/^[A-Za-z0-9_./:=-]+$/.test(e)?e:`'${e.replace(/'/g,"'\\''")}'`}function s7({agent:e,open:t,onClose:n,onBound:a}){var g;const[l,o]=x.useState(!1),c=He({queryKey:["connect-token",e.uuid],queryFn:()=>Jk(),enabled:t,staleTime:6e4}),f=He({queryKey:["agent-poll",e.uuid],queryFn:()=>Xj(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=((g=c.data)==null?void 0:g.command)??"",h=m&&e.name?`npm install -g @agent-team-foundation/first-tree-hub && first-tree-hub agent add ${l7(e.name)} --agent-id ${e.uuid} && `+m:m;function y(){h&&(navigator.clipboard.writeText(h),o(!0),setTimeout(()=>o(!1),2e3))}return u.jsx($t,{open:t,onOpenChange:b=>!b&&n(),children:u.jsxs(zt,{className:"max-w-lg",children:[u.jsx(Gt,{children:u.jsx(Ft,{children:"Last step — connect your computer"})}),u.jsxs("div",{className:"space-y-4",children:[u.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."}),u.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-border bg-muted p-3",children:[u.jsx("code",{className:"flex-1 text-caption font-mono break-all select-all",children:h||"Generating command…"}),u.jsx(me,{variant:"outline",size:"icon",className:"shrink-0",onClick:y,disabled:!h,children:l?u.jsx(cr,{className:"h-4 w-4",style:{color:"var(--state-idle)"}}):u.jsx(yf,{className:"h-4 w-4"})})]}),u.jsxs("div",{className:"flex items-center gap-2 text-body text-muted-foreground",children:[u.jsx(Xr,{state:"working",size:8}),u.jsx("span",{children:"Waiting for your computer to connect…"})]}),u.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."})]}),u.jsx(tn,{children:u.jsx(me,{variant:"outline",onClick:n,children:"Skip for now"})})]})})}function Fg(e){return e.normalize("NFKD").replace(new RegExp("\\p{M}+","gu"),"").toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^[-_]+|[-_]+$/g,"").slice(0,js)}const $p=200;function o7(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 u7(e){return e.toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^[-_]+/,"").slice(0,js)}function c7(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 d7({open:e,onOpenChange:t,onCreated:n}){const a=jn(),{refreshMe:l}=qt(),[o,c]=x.useState(""),[f,m]=x.useState(""),[h,y]=x.useState(!1),[g,b]=x.useState("claude-code"),[w,k]=x.useState("form"),[j,E]=x.useState([]),[C,N]=x.useState(null),[z,U]=x.useState(!1),[D,O]=x.useState({}),[M,I]=x.useState({status:"idle"});x.useEffect(()=>{e&&(c(""),m(""),y(!1),b("claude-code"),k("form"),E([]),N(null),U(!1),O({}),I({status:"idle"}))},[e]),x.useEffect(()=>{h||m(Fg(o))},[o,h]);const X=x.useRef(0);x.useEffect(()=>{if(!e||!f){I({status:"idle"});return}if(!_g.test(f)){I({status:"bad",reason:"invalid"});return}if(Tg(f)){I({status:"bad",reason:"reserved"});return}const ue=++X.current;I({status:"checking"});const A=window.setTimeout(()=>{$D(f).then(P=>{ue===X.current&&(P.available?I({status:"ok"}):I({status:"bad",reason:P.reason}))}).catch(()=>{ue===X.current&&I({status:"idle"})})},300);return()=>window.clearTimeout(A)},[f,e]);const F=wt({mutationFn:async ue=>{const A=o.trim()||f.trim()||"Untitled assistant";return BD({name:f||void 0,type:"personal_assistant",displayName:A,clientId:ue.clientId,runtimeProvider:g})},onSuccess:ue=>{a.invalidateQueries({queryKey:["agents"]}),a.invalidateQueries({queryKey:["activity"]}),l(),n(ue,g)}}),W=x.useMemo(()=>{const ue=F.error;if(!ue)return{};if(ue instanceof Zu){const A=o7(ue.issues);return Object.keys(A).length>0?A:ue.status===409?{name:"That agent name is already in use in this organization. Pick a different one."}:{_root:ue.message}}return ue instanceof Error?{_root:ue.message}:{}},[F.error]),ee=M.status==="bad"?c7(M.reason):void 0,ye={...ee?{name:ee}:{},...W,...D};function he(){const ue={};return f?f.length>js?ue.name=`Agent name must be at most ${js} characters (got ${f.length}).`:_g.test(f)?Tg(f)&&(ue.name="That agent name is reserved — pick a different one."):ue.name="Agent name must start with a letter or digit and contain only lowercase letters, digits, hyphens (-), and underscores (_).":o.trim().length>0&&(ue.name="Agent name must contain at least one letter or digit (e.g. a-z, 0-9)."),o.length>$p&&(ue.displayName=`Display name must be at most ${$p} characters (got ${o.length}).`),ue}async function ne(ue){var P,B;ue.preventDefault();const A=he();if(O(A),!(Object.keys(A).length>0)&&M.status!=="bad"){U(!0);try{const q=(await Ra()).filter(ce=>ce.status==="connected");if(q.length===0){F.mutate({clientId:void 0});return}if(q.length===1){F.mutate({clientId:(P=q[0])==null?void 0:P.id});return}const K=[...q].sort((ce,xe)=>xe.lastSeenAt.localeCompare(ce.lastSeenAt));E(K),N(((B=K[0])==null?void 0:B.id)??null),k("pick-computer")}catch{F.mutate({clientId:void 0})}finally{U(!1)}}}function Z(){C&&F.mutate({clientId:C})}const te=M.status==="bad",ie=o.trim().length>0&&!te&&!F.isPending&&!z;return w==="pick-computer"?u.jsx($t,{open:e,onOpenChange:t,children:u.jsxs(zt,{className:"max-w-lg",children:[u.jsx(Gt,{children:u.jsx(Ft,{children:"Choose a computer"})}),u.jsxs("div",{className:"space-y-4",children:[u.jsxs("p",{className:"text-body text-muted-foreground",children:["Multiple computers are online. Pick where ",u.jsx("span",{className:"font-medium",children:o||f})," ","should run:"]}),u.jsx("div",{className:"space-y-2",children:j.map(ue=>{const A=C===ue.id;return u.jsxs("label",{className:A?"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:[u.jsx("input",{type:"radio",name:"target-computer",checked:A,onChange:()=>N(ue.id),className:"mt-1"}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-body font-medium truncate",children:ue.hostname??ue.id}),u.jsxs("div",{className:"text-caption text-muted-foreground",children:[ue.os??"unknown OS"," · last seen ",new Date(ue.lastSeenAt).toLocaleString()]})]})]},ue.id)})}),ye.clientId&&u.jsx("p",{className:"text-body text-destructive",children:ye.clientId}),ye._root&&u.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-body text-destructive",children:ye._root})]}),u.jsxs(tn,{children:[u.jsx(me,{variant:"outline",onClick:()=>k("form"),disabled:F.isPending,children:"Back"}),u.jsx(me,{onClick:Z,disabled:!C||F.isPending,children:F.isPending?"Creating…":"Create"})]})]})}):u.jsx($t,{open:e,onOpenChange:t,children:u.jsxs(zt,{className:"max-w-lg",children:[u.jsx(Gt,{children:u.jsx(Ft,{children:"New Agent"})}),u.jsxs("form",{onSubmit:ne,className:"space-y-5",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{htmlFor:"new-agent-display-name",children:"Display name"}),u.jsx(jt,{id:"new-agent-display-name",value:o,onChange:ue=>{c(ue.target.value),D.displayName&&O(A=>({...A,displayName:void 0}))},placeholder:"My Dev Assistant",autoFocus:!0,maxLength:$p,"aria-invalid":ye.displayName?!0:void 0,"aria-describedby":"new-agent-display-name-help new-agent-display-name-error"}),u.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."}),ye.displayName&&u.jsx("p",{id:"new-agent-display-name-error",className:"text-caption text-destructive",children:ye.displayName})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{htmlFor:"new-agent-name",children:"Agent name"}),u.jsxs("div",{className:"flex items-stretch",children:[u.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:"@"}),u.jsx(jt,{id:"new-agent-name",value:f,onChange:ue=>{const A=u7(ue.target.value);m(A),y(!0),D.name&&O(P=>({...P,name:void 0}))},onBlur:ue=>{const A=Fg(ue.target.value);A!==f&&m(A)},placeholder:"my-dev-assistant",className:"rounded-l-none font-mono",maxLength:js,"aria-invalid":ye.name?!0:void 0,"aria-describedby":"new-agent-name-help new-agent-name-error new-agent-name-status"})]}),u.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"," ",js," characters. Permanent after creation."]}),f&&!ye.name&&M.status!=="idle"&&u.jsxs("p",{id:"new-agent-name-status",className:"text-caption",style:{color:M.status==="ok"?"var(--state-idle)":M.status==="checking"?"var(--fg-3)":"var(--fg-4)"},children:[M.status==="checking"&&"Checking availability…",M.status==="ok"&&"Available."]}),ye.name&&u.jsx("p",{id:"new-agent-name-error",className:"text-caption text-destructive",children:ye.name})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{children:"Where it runs"}),u.jsxs("div",{className:"space-y-2",children:[u.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:[u.jsx("input",{type:"radio",name:"runtime",checked:g==="claude-code",onChange:()=>b("claude-code"),className:"mt-1"}),u.jsxs("div",{children:[u.jsx("div",{className:"text-body font-medium",children:"Claude Code"}),u.jsx("div",{className:"text-caption text-muted-foreground",children:"Anthropic's Claude Code on the bound computer. (default)"})]})]}),u.jsxs("label",{className:g==="codex"?"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:[u.jsx("input",{type:"radio",name:"runtime",checked:g==="codex",onChange:()=>b("codex"),className:"mt-1"}),u.jsxs("div",{children:[u.jsx("div",{className:"text-body font-medium",children:"Codex"}),u.jsxs("div",{className:"text-caption text-muted-foreground",children:["OpenAI Codex CLI on the bound computer. Run ",u.jsx("code",{children:"codex login"})," on the host once."]})]})]})]})]}),ye._root&&u.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-body text-destructive",children:ye._root}),u.jsx(tn,{children:u.jsx(me,{type:"submit",disabled:!ie,children:z?"Checking computers…":F.isPending?"Creating…":"Create"})})]})]})})}function gu({active:e,count:t,warn:n,className:a,children:l,style:o,...c}){return u.jsxs("button",{type:"button",className:Ae("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},...c,children:[l,t!==void 0&&u.jsx("span",{className:"mono",style:{color:n&&typeof t=="number"&&t>0?"var(--state-error)":"var(--fg-4)"},children:t})]})}const f7=Object.values(i6);function gS(e){return[...e].sort((t,n)=>{const a=(t.displayName||t.name||"").toLowerCase(),l=(n.displayName||n.name||"").toLowerCase();return a.localeCompare(l)})}function h7(e,t){const n=t.get(e.uuid);return{runtimeState:(n==null?void 0:n.runtimeState)??null}}function vs(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 m7(){const e=dn(),{memberId:t}=qt(),[n,a]=x.useState(),[l,o]=x.useState(""),[c,f]=x.useState(!1),[m,h]=x.useState(null),[y,g]=x.useState("all"),[b,w]=x.useState(""),k=Cl(),j=wy(),E=Ly(),{data:C,isLoading:N,error:z}=He({queryKey:["agents",n,l],queryFn:()=>Ku({limit:100,cursor:n,type:l||void 0})}),{data:U}=He({queryKey:["activity"],queryFn:Qu,refetchInterval:1e4}),D=x.useMemo(()=>{const ie=new Map;for(const ue of(U==null?void 0:U.agents)??[])ie.set(ue.agentId,ue);return ie},[U==null?void 0:U.agents]),{myAgents:O,teamAgents:M}=x.useMemo(()=>{if(!(C!=null&&C.items))return{myAgents:[],teamAgents:[]};const ie=[],ue=[];for(const A of C.items)t&&A.managerId===t?ie.push(A):ue.push(A);return{myAgents:gS(ie),teamAgents:gS(ue)}},[C,t]),I=(C==null?void 0:C.items.length)??0,X=O.length,F=M.length,W=x.useMemo(()=>((C==null?void 0:C.items)??[]).filter(ie=>{var ue;return((ue=D.get(ie.uuid))==null?void 0:ue.runtimeState)==="working"}).length,[C==null?void 0:C.items,D]),ee=x.useMemo(()=>((C==null?void 0:C.items)??[]).filter(ie=>{var A;const ue=(A=D.get(ie.uuid))==null?void 0:A.runtimeState;return ue==="blocked"||ue==="error"}).length,[C==null?void 0:C.items,D]);function ye(ie){var A;const ue=(A=D.get(ie.uuid))==null?void 0:A.runtimeState;return y==="mine"?t!=null&&ie.managerId===t:y==="running"?ue==="working":y==="attn"?ue==="blocked"||ue==="error":!0}function he(ie){if(!b.trim())return!0;const ue=b.toLowerCase(),A=ie.delegateMention?k(ie.delegateMention):"",P=E(ie.managerId);return(ie.name??"").toLowerCase().includes(ue)||ie.displayName.toLowerCase().includes(ue)||A.toLowerCase().includes(ue)||P.toLowerCase().includes(ue)}const ne=O.filter(ie=>ye(ie)&&he(ie)),Z=M.filter(ie=>ye(ie)&&he(ie));function te(ie,ue){if(f(!1),ie.clientId){e(`/?a=${ie.uuid}`);return}if(ue==="claude-code"||ue==="codex"){h(ie);return}e(`/?a=${ie.uuid}`)}return u.jsxs("div",{className:"-m-6",children:[u.jsx(zf,{title:"Agents",subtitle:I>0?u.jsxs(u.Fragment,{children:[I," total · ",X," mine · ",F," team"]}):null,right:u.jsx("div",{className:"flex items-center gap-1.5",children:u.jsxs(me,{size:"xs",onClick:()=>f(!0),children:[u.jsx(Jr,{className:"h-3 w-3"}),"New agent"]})})}),u.jsxs("div",{style:{padding:"var(--sp-3_5) var(--sp-5) var(--sp-7)"},children:[u.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:[u.jsxs("div",{className:"relative",style:{width:240},children:[u.jsx(vf,{className:"absolute pointer-events-none",style:{left:8,top:"50%",transform:"translateY(-50%)",color:"var(--fg-4)"},size:13}),u.jsx("input",{value:b,onChange:ie=>w(ie.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)"}})]}),u.jsxs("div",{className:"flex gap-1",children:[u.jsx(gu,{active:y==="all",count:I,onClick:()=>g("all"),children:"all"}),u.jsx(gu,{active:y==="mine",count:X,onClick:()=>g("mine"),children:"mine"}),u.jsx(gu,{active:y==="running",count:W,onClick:()=>g("running"),children:"running"}),u.jsx(gu,{active:y==="attn",count:ee,warn:!0,onClick:()=>g("attn"),children:"attn"})]}),u.jsx("div",{style:{flex:1}}),u.jsxs("select",{value:l,onChange:ie=>{o(ie.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:[u.jsx("option",{value:"",children:"all types"}),f7.map(ie=>u.jsx("option",{value:ie,children:ie},ie))]})]}),N?u.jsx("div",{className:"text-center py-8",style:{color:"var(--fg-3)"},children:"Loading…"}):z?u.jsxs("div",{className:"text-center py-8",style:{color:"var(--state-error)"},children:["Failed to load agents: ",z instanceof Error?z.message:"Unknown error"]}):u.jsxs(u.Fragment,{children:[u.jsx(yS,{title:`My agents · ${ne.length}`,agents:ne,runtimeMap:D,resolveAgentIdentity:j,resolveMemberName:E,navigate:e,showOwner:!1,emptyLabel:O.length===0?"No agents yet — create one to get started":"No agents match the current filter",breakdown:u.jsx(vS,{items:[{state:"working",count:vs(O,D,"working")},{state:"blocked",count:vs(O,D,"blocked")},{state:"error",count:vs(O,D,"error")}]}),className:"mb-4"}),M.length>0&&u.jsx(yS,{title:`Team agents · ${Z.length}`,agents:Z,runtimeMap:D,resolveAgentIdentity:j,resolveMemberName:E,navigate:e,showOwner:!0,emptyLabel:"No agents match the current filter",breakdown:u.jsx(vS,{items:[{state:"working",count:vs(M,D,"working")},{state:"blocked",count:vs(M,D,"blocked")},{state:"error",count:vs(M,D,"error")}]})})]}),(C==null?void 0:C.nextCursor)&&u.jsx("div",{className:"flex justify-end mt-4",children:u.jsx(me,{variant:"outline",size:"xs",onClick:()=>a(C.nextCursor??void 0),children:"Next page"})})]}),u.jsx(d7,{open:c,onOpenChange:f,onCreated:te}),m&&u.jsx(s7,{agent:m,open:m!==null,onClose:()=>{const ie=m.uuid;h(null),e(`/?a=${ie}`)},onBound:ie=>{h(null),e(`/?a=${ie.uuid}`)}})]})}function yS({title:e,agents:t,runtimeMap:n,resolveAgentIdentity:a,resolveMemberName:l,navigate:o,emptyLabel:c,breakdown:f,className:m,showOwner:h}){return u.jsxs(sn,{className:m,children:[u.jsx(Qs,{right:f,children:e}),t.length===0?u.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:c}):u.jsxs(vl,{children:[u.jsx(bl,{children:u.jsxs(or,{children:[u.jsx(qe,{children:"Display name"}),u.jsx(qe,{children:"Agent name"}),u.jsx(qe,{children:"Type"}),u.jsx(qe,{children:"Delegate"}),h&&u.jsx(qe,{children:"Owner"}),u.jsx(qe,{children:"Runtime"}),u.jsx(qe,{children:"Status"}),u.jsx(qe,{children:"Created"})]})}),u.jsx(xl,{children:t.map(y=>u.jsx(p7,{agent:y,runtime:h7(y,n),resolveAgentIdentity:a,resolveMemberName:l,navigate:o,showOwner:h},y.uuid))})]})]})}function vS({items:e}){const t=e.filter(n=>n.count>0);return t.length===0?null:u.jsx("span",{className:"inline-flex items-center",children:t.map((n,a)=>u.jsxs("span",{className:"inline-flex items-center",children:[a>0&&u.jsx("span",{style:{color:"var(--fg-4)",margin:"0 var(--sp-1_5)"},"aria-hidden":!0,children:"·"}),u.jsxs("span",{className:"mono inline-flex items-center gap-1 text-caption",style:{color:`var(--state-${n.state})`},children:[u.jsx("span",{"aria-hidden":!0,children:"●"}),n.count," ",n.label??n.state]})]},n.state))})}function p7({agent:e,runtime:t,resolveAgentIdentity:n,resolveMemberName:a,navigate:l,showOwner:o}){const{runtimeState:c}=t,f=c==="idle"||c==="working"||c==="blocked"||c==="error"||c==="offline",m=e.delegateMention?n(e.delegateMention):null;return u.jsxs(or,{interactive:!0,onClick:()=>l(`/agents/${e.uuid}`),children:[u.jsx(Be,{children:u.jsx("span",{className:"font-medium",children:e.displayName})}),u.jsx(Be,{children:e.name?u.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-3)"},children:["@",e.name]}):u.jsx("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:"—"})}),u.jsx(Be,{children:u.jsx(Sn,{tone:e.type==="autonomous_agent"?"accent":"neutral",children:e.type})}),u.jsx(Be,{children:e.delegateMention?u.jsx(iE,{name:(m==null?void 0:m.name)??null,displayName:(m==null?void 0:m.displayName)??null,tone:"accent"}):u.jsx("span",{style:{color:"var(--fg-4)"},children:"—"})}),o&&u.jsx(Be,{className:"text-label",style:{color:"var(--fg-2)"},children:a(e.managerId)}),u.jsx(Be,{children:c&&f?u.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[u.jsx(Xr,{state:c,size:7}),u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-3)"},children:c})]}):u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:"—"})}),u.jsx(Be,{children:u.jsx(Sn,{tone:e.status==="active"?"accent":"outline",children:e.status})}),u.jsx(Be,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Ni(e.createdAt)})]})}function g7(){const{data:e}=He({queryKey:["members","user-name-map"],queryFn:My,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])}const y7=1500;function v7({command:e,expiresInSeconds:t,phase:n,copyLabel:a={idle:"Copy",done:"Copied"},waitingText:l="Waiting for your computer to connect…",successContent:o,errorContent:c,caption:f="Single-use · regenerates the previous one.",copyButtonPlacement:m="right"}){const[h,y]=x.useState(!1),g=async()=>{e&&(await navigator.clipboard.writeText(e),y(!0),setTimeout(()=>y(!1),y7))},b=t!==void 0?Math.max(1,Math.round(t/60)):null,w=u.jsx("pre",{className:"mono text-label",style:{margin:0,padding:"var(--sp-2_5) var(--sp-3)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)",borderRadius:"var(--radius-input)",color:"var(--fg-2)",whiteSpace:"pre-wrap",wordBreak:"break-all",overflowWrap:"anywhere",minWidth:0,flex:m==="right"?1:void 0},title:e??"",children:e?u.jsxs(u.Fragment,{children:[e,b!==null&&u.jsxs("span",{style:{color:"var(--fg-4)"},children:[" # expires in ",b,"m"]})]}):"Generating token…"}),k=u.jsxs(me,{type:"button",variant:"outline",size:"sm",onClick:g,disabled:!e,style:{alignSelf:"flex-start"},children:[h?u.jsx(cr,{className:"h-3.5 w-3.5"}):u.jsx(yf,{className:"h-3.5 w-3.5"}),h?a.done:a.idle]});return u.jsxs("div",{className:"flex flex-col",style:{gap:"var(--sp-2)"},children:[m==="right"?u.jsxs("div",{className:"flex",style:{gap:"var(--sp-2)",alignItems:"stretch"},children:[w,k]}):u.jsxs(u.Fragment,{children:[w,k]}),f&&u.jsx("p",{className:"text-label",style:{color:"var(--fg-4)",margin:0},children:f}),n==="waiting"&&u.jsxs("div",{className:"flex items-center text-body",style:{gap:"var(--sp-2_5)",padding:"var(--sp-2_5) var(--sp-3)",background:"color-mix(in oklch, var(--state-blocked) 14%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-blocked) 35%, transparent)",borderRadius:"var(--radius-input)",color:"color-mix(in oklch, var(--state-blocked) 35%, var(--fg))"},children:[u.jsx(b7,{}),l]}),n==="success"&&o&&u.jsxs("div",{className:"flex items-center text-body",style:{gap:"var(--sp-2_5)",padding:"var(--sp-2_5) var(--sp-3)",background:"color-mix(in oklch, var(--state-idle) 14%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-idle) 35%, transparent)",borderRadius:"var(--radius-input)",color:"color-mix(in oklch, var(--state-idle) 45%, var(--fg))"},children:[u.jsx(cr,{className:"h-3.5 w-3.5",style:{flexShrink:0}}),u.jsx("span",{style:{minWidth:0},children:o})]}),n==="error"&&c&&u.jsx("div",{className:"text-body",style:{padding:"var(--sp-2_5) var(--sp-3)",background:"color-mix(in oklch, var(--state-error) 12%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-error) 28%, transparent)",borderRadius:"var(--radius-input)",color:"var(--state-error)"},children:c})]})}function b7(){return u.jsx("span",{"aria-hidden":"true",style:{width:12,height:12,flexShrink:0,borderRadius:"50%",border:"var(--hairline-bold) solid color-mix(in oklch, var(--state-blocked) 30%, transparent)",borderTopColor:"var(--state-blocked)",animation:"spin 0.85s linear infinite"}})}const x7=3e3,w7=1200;function S7({open:e,onOpenChange:t}){const n=jn(),{user:a}=qt(),[l,o]=x.useState("loading"),[c,f]=x.useState(null),[m,h]=x.useState(null),[y,g]=x.useState(null),b=x.useRef(new Set);return x.useEffect(()=>{if(!e){o("loading"),f(null),h(null),g(null),b.current=new Set;return}let w=!1;const k=(n.getQueryData(["clients"])??[]).map(j=>j.id);return b.current=new Set(k),(async()=>{try{const j=await Jk();if(w)return;f(j),o("waiting")}catch(j){if(w)return;h(j instanceof Error?j.message:"Failed to generate connect token"),o("error")}})(),()=>{w=!0}},[e,n]),x.useEffect(()=>{if(!e||l!=="waiting"||!a)return;const k=setInterval(async()=>{try{const j=await n.fetchQuery({queryKey:["clients"],queryFn:Ra}),E=b.current,C=j.find(N=>!E.has(N.id)&&N.status==="connected"&&N.userId===a.id);C&&(g(C.hostname??null),o("success"))}catch{}},x7);return()=>clearInterval(k)},[e,l,n,a]),x.useEffect(()=>{if(l!=="success")return;const w=setTimeout(()=>{n.invalidateQueries({queryKey:["clients"]}),t(!1)},w7);return()=>clearTimeout(w)},[l,t,n]),u.jsx($t,{open:e,onOpenChange:t,children:u.jsxs(zt,{children:[u.jsxs(Gt,{children:[u.jsx(Ft,{children:"Connect a new computer"}),u.jsx(kf,{children:"Run this command on the machine you want to pair with this Hub."})]}),u.jsx(v7,{command:(c==null?void 0:c.command)??null,expiresInSeconds:c==null?void 0:c.expiresIn,phase:l,successContent:u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"font-semibold",children:y??"Computer"})," connected. Closing…"]}),errorContent:m}),u.jsx("div",{className:"flex justify-end",style:{gap:"var(--sp-2)"},children:u.jsx(me,{variant:"ghost",size:"sm",onClick:()=>t(!1),children:"Cancel"})})]})})}function k7(){const e=jn(),t=Cl(),n=g7(),{role:a}=qt(),l=a==="admin",[o,c]=x.useState(null),[f,m]=x.useState(null),[h,y]=x.useState(null),[g,b]=x.useState(null),[w,k]=x.useState(!1),{data:j}=He({queryKey:["clients"],queryFn:Ra,refetchInterval:1e4}),{data:E}=He({queryKey:["activity"],queryFn:Qu,refetchInterval:1e4}),C=wt({mutationFn:m3,onSuccess:()=>{m(null),e.invalidateQueries({queryKey:["clients"]}),e.invalidateQueries({queryKey:["activity"]})}}),N=wt({mutationFn:h3,onSuccess:()=>{y(null),b(null),e.invalidateQueries({queryKey:["clients"]}),e.invalidateQueries({queryKey:["activity"]})},onError:M=>{M instanceof Zu?b(M.message):b(M instanceof Error?M.message:String(M))}}),z=x.useMemo(()=>{const M=new Map;for(const I of(E==null?void 0:E.agents)??[]){if(!I.clientId)continue;const X=M.get(I.clientId)??[];X.push(I),M.set(I.clientId,X)}return M},[E==null?void 0:E.agents]),U=M=>z.get(M)??[],D=(j??[]).filter(M=>M.status==="connected").length,O=(j??[]).reduce((M,I)=>M+I.agentCount,0);return u.jsxs("div",{className:"-m-6",children:[u.jsx(zf,{title:"Computers",subtitle:j&&j.length>0?u.jsxs(u.Fragment,{children:[j.length," total · ",D," connected · ",O," agents bound"]}):null,right:u.jsx("div",{className:"flex items-center gap-1.5",children:u.jsxs(me,{size:"xs",onClick:()=>k(!0),children:[u.jsx(Jr,{className:"h-3 w-3"}),"New Connection"]})})}),u.jsxs("div",{style:{padding:"var(--sp-3_5) var(--sp-5) var(--sp-7)"},children:[u.jsx(S7,{open:w,onOpenChange:k}),h&&u.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-overlay-scrim",children:u.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:[u.jsx("h3",{className:"text-subtitle mb-2",children:"Retire Computer"}),u.jsxs("p",{className:"text-body mb-3",style:{color:"var(--fg-3)"},children:["Permanently remove"," ",u.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)."]}),U(h.id).length>0&&u.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:[u.jsx("div",{className:"text-label mb-1",children:"Agents currently bound to this computer (delete them first):"}),u.jsx("ul",{className:"text-body space-y-0.5",children:U(h.id).map(M=>u.jsx("li",{className:"font-medium",children:t(M.agentId)},M.agentId))})]}),g&&u.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:g}),u.jsxs("div",{className:"flex justify-end gap-2",children:[u.jsx(me,{variant:"outline",size:"sm",onClick:()=>{y(null),b(null)},children:"Cancel"}),u.jsx(me,{variant:"destructive",size:"sm",onClick:()=>N.mutate(h.id),disabled:N.isPending,children:N.isPending?"Retiring…":"Retire"})]})]})}),f&&u.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-overlay-scrim",children:u.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:[u.jsx("h3",{className:"text-subtitle mb-2",children:"Disconnect Computer"}),u.jsxs("p",{className:"text-body mb-3",style:{color:"var(--fg-3)"},children:["This will disconnect"," ",u.jsx("span",{className:"font-medium",style:{color:"var(--fg)"},children:f.hostname??f.id.slice(0,8)})," ","and affect all bound agents:"]}),u.jsx("ul",{className:"mb-4 space-y-1",children:U(f.id).length===0?u.jsx("li",{className:"text-body",style:{color:"var(--fg-3)"},children:"No bound agents"}):U(f.id).map(M=>u.jsxs("li",{className:"text-body flex items-center gap-2",children:[u.jsx("span",{className:"font-medium",children:t(M.agentId)}),u.jsx(Gs,{state:M.runtimeState})]},M.agentId))}),u.jsxs("div",{className:"flex justify-end gap-2",children:[u.jsx(me,{variant:"outline",size:"sm",onClick:()=>m(null),children:"Cancel"}),u.jsx(me,{variant:"destructive",size:"sm",onClick:()=>C.mutate(f.id),disabled:C.isPending,children:C.isPending?"Disconnecting…":"Disconnect"})]})]})}),!j||j.length===0?u.jsx(sn,{children:u.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."})}):u.jsxs(sn,{children:[u.jsxs(Qs,{right:u.jsx("span",{className:"mono text-caption normal-case tracking-normal",style:{color:"var(--fg-3)"},children:"click a row to expand"}),children:["Registered · ",j.length]}),u.jsxs(vl,{children:[u.jsx(bl,{children:u.jsxs(or,{children:[u.jsx(qe,{style:{width:16}}),u.jsx(qe,{children:"Hostname"}),l&&u.jsx(qe,{children:"Owner"}),u.jsx(qe,{children:"OS"}),u.jsx(qe,{children:"SDK"}),u.jsx(qe,{children:"Agents"}),u.jsx(qe,{children:"Connected"}),u.jsx(qe,{children:"Status"}),u.jsx(qe,{})]})}),u.jsx(xl,{children:j.map(M=>{const I=o===M.id,X=U(M.id);return u.jsx(T7,{client:M,boundAgents:X,isExpanded:I,agentName:t,showOwner:l,ownerName:n,onToggle:()=>c(I?null:M.id),onDisconnect:()=>m(M),onRetire:()=>{b(null),y(M)}},M.id)})})]})]})]})]})}const j7={"claude-code":"Claude Code",codex:"Codex"},C7=[nf.CLAUDE_CODE,nf.CODEX],bS={"claude-code":"Run `npm install -g @anthropic-ai/claude-code` on this computer.",codex:"Install the OpenAI Codex CLI on this computer."},E7={"claude-code":"Run `claude login` (or set ANTHROPIC_API_KEY) on the computer.",codex:"Run `codex login` (or set CODEX_API_KEY) on the computer."};function N7({clientId:e,enabled:t}){const{data:n,isLoading:a}=He({queryKey:["client-capabilities",e],queryFn:()=>py(e),enabled:t}),l=(n==null?void 0:n.capabilities)??null;return u.jsxs(u.Fragment,{children:[u.jsx(Yu,{style:{display:"block",marginBottom:6},children:"Runtimes"}),a&&!l?u.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):l&&Object.keys(l).length===0?u.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Capabilities not yet reported. Reconnect this computer to refresh."}):u.jsx("div",{className:"flex flex-col gap-1",children:C7.map(o=>u.jsx(_7,{provider:o,entry:l?l[o]??null:null},o))})]})}function _7({provider:e,entry:t}){const n=j7[e];if(!t)return u.jsxs("div",{className:"flex items-center gap-2.5 text-body",style:{opacity:.7},children:[u.jsx("span",{className:"mono font-medium",style:{minWidth:180},children:n}),u.jsxs("span",{className:"text-caption",style:{color:"var(--fg-4)"},children:["not reported · ",bS[e]]})]});switch(t.state){case"ok":return u.jsxs("div",{className:"flex items-center gap-2.5 text-body",children:[u.jsx("span",{className:"mono font-medium",style:{minWidth:180},children:n}),u.jsxs("span",{className:"text-caption",style:{color:"var(--state-idle)"},children:["✓ ",t.sdkVersion?`v${t.sdkVersion} · `:"","authenticated (",t.authMethod,")"]})]});case"unauthenticated":return u.jsxs("div",{className:"flex items-center gap-2.5 text-body",children:[u.jsx("span",{className:"mono font-medium",style:{minWidth:180},children:n}),u.jsxs("span",{className:"text-caption",style:{color:"var(--state-blocked)"},children:["⚠ installed",t.sdkVersion?` v${t.sdkVersion}`:"",", not authenticated ·"," ",E7[e]]})]});case"missing":return u.jsxs("div",{className:"flex items-center gap-2.5 text-body",style:{opacity:.7},children:[u.jsx("span",{className:"mono font-medium",style:{minWidth:180},children:n}),u.jsxs("span",{className:"text-caption",style:{color:"var(--fg-4)"},children:["✗ not installed · ",bS[e]]})]});case"error":return u.jsxs("div",{className:"flex items-center gap-2.5 text-body",children:[u.jsx("span",{className:"mono font-medium",style:{minWidth:180},children:n}),u.jsxs("span",{className:"text-caption",style:{color:"var(--state-error)"},children:["error · ",t.error??"probe failed"]})]})}}function T7({client:e,boundAgents:t,isExpanded:n,agentName:a,showOwner:l,ownerName:o,onToggle:c,onDisconnect:f,onRetire:m}){const h=l?9:8,y=e.status==="connected"?"idle":"offline";return u.jsxs(u.Fragment,{children:[u.jsxs(or,{interactive:!0,selected:n,onClick:c,children:[u.jsx(Be,{style:{width:16},children:u.jsx("span",{style:{color:"var(--fg-4)",display:"inline-flex"},children:n?u.jsx(zk,{className:"h-3.5 w-3.5"}):u.jsx(OR,{className:"h-3.5 w-3.5"})})}),u.jsx(Be,{className:"font-medium",children:e.hostname??"—"}),l&&u.jsx(Be,{style:{color:"var(--fg-2)"},children:o(e.userId)}),u.jsx(Be,{style:{color:"var(--fg-3)"},children:e.os??"—"}),u.jsx(Be,{className:"mono text-label",style:{color:"var(--fg-3)"},children:e.sdkVersion??"—"}),u.jsx(Be,{children:u.jsx("span",{className:"mono tnum text-label",children:e.agentCount})}),u.jsx(Be,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:e.connectedAt?Ni(e.connectedAt):"—"}),u.jsx(Be,{children:u.jsx(Gs,{state:y})}),u.jsx(Be,{style:{width:1,whiteSpace:"nowrap"},children:u.jsxs("div",{className:"flex gap-1 justify-end",children:[u.jsxs(me,{variant:"ghost",size:"xs",className:"text-label",onClick:g=>{g.stopPropagation(),f()},children:[u.jsx(vz,{className:"h-3 w-3"})," Disconnect"]}),u.jsxs(me,{variant:"ghost",size:"xs",className:"text-label",style:{color:"var(--fg-4)"},onClick:g=>{g.stopPropagation(),m()},children:[u.jsx(Hs,{className:"h-3 w-3"})," Retire"]})]})})]}),n&&u.jsxs("tr",{style:{background:"var(--bg-sunken)"},children:[u.jsx(Be,{}),u.jsxs(Be,{colSpan:h-1,style:{padding:"var(--sp-2_5) var(--sp-3) var(--sp-3_5)"},children:[u.jsx(N7,{clientId:e.id,enabled:n}),u.jsxs(Yu,{style:{display:"block",marginTop:"var(--sp-3)",marginBottom:6},children:["Bound agents · ",t.length]}),t.length===0?u.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"No agents bound to this computer"}):u.jsx("div",{className:"flex flex-col gap-1",children:t.map(g=>u.jsxs("div",{className:"flex items-center gap-2.5 text-body",children:[u.jsx("span",{className:"mono font-medium",style:{minWidth:180},children:a(g.agentId)}),u.jsx(Gs,{state:g.runtimeState}),g.activeSessions!==null&&u.jsxs("span",{className:"mono tnum text-caption",style:{color:"var(--fg-3)"},children:[g.activeSessions," / ",g.totalSessions??0," sessions"]})]},g.agentId))})]})]})]})}function A7(){const{token:e}=vk(),t=dn(),{isAuthenticated:n,adoptTokens:a}=qt(),[l,o]=x.useState(null),[c,f]=x.useState(null),[m,h]=x.useState(!1),[y,g]=x.useState(null);if(x.useEffect(()=>{e&&(async()=>{try{const E=await fetch(`/api/v1/invite/${encodeURIComponent(e)}/preview`);if(!E.ok){f("This invitation is no longer valid");return}o(await E.json())}catch{f("Network error while loading invitation")}})()},[e]),x.useEffect(()=>{n&&(async()=>{try{const E=await ke.get("/me/organizations"),C=await ke.get("/me"),N=E.find(z=>z.id===C.member.organizationId);g((N==null?void 0:N.displayName)??null)}catch{}})()},[n]),!e)return u.jsx(xS,{message:"Bad invitation URL"});if(c)return u.jsx(xS,{message:"This invitation is no longer valid"});if(!l)return u.jsx(R7,{});const b=async()=>{h(!0);try{const E=await ke.post("/me/organizations/join",{token:e});await a(E.tokens),Tk("invite"),t("/",{replace:!0})}catch(E){f(E instanceof Error?E.message:"Failed to join team")}finally{h(!1)}},w=`/api/v1/auth/github/start?next=${encodeURIComponent(`/invite/${e}`)}`,k=n&&y&&y!==l.organizationDisplayName,j=z7(l.expiresAt);return u.jsx(nv,{children:u.jsxs(ro,{className:"w-full max-w-sm",children:[u.jsx(ao,{className:"text-center",children:u.jsxs(Xu,{className:"text-title",children:["You're invited to join",u.jsx("br",{}),l.organizationDisplayName]})}),u.jsxs(io,{className:"space-y-4",children:[k&&u.jsxs("div",{className:"flex items-start gap-2 rounded-md p-3 text-label",style:{background:"var(--bg-sunken)",color:"var(--fg-2)"},children:[u.jsx(fy,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),u.jsxs("span",{children:["You'll switch from ",u.jsx("span",{className:"font-medium",children:y})," to"," ",u.jsx("span",{className:"font-medium",children:l.organizationDisplayName}),"."]})]}),n?u.jsx(me,{className:"w-full",disabled:m,onClick:b,children:m?"Joining…":`Join ${l.organizationDisplayName}`}):u.jsx(me,{asChild:!0,className:"w-full",children:u.jsxs("a",{href:w,children:[u.jsx(Ok,{className:"h-4 w-4"}),"Continue with GitHub to join"]})}),j&&u.jsx("p",{className:"text-center text-label",style:{color:j.urgent?"var(--destructive)":"var(--fg-3)"},children:j.text}),u.jsxs("p",{className:"text-center text-label text-muted-foreground",children:["By continuing you agree to our"," ",u.jsx("a",{href:"/terms",className:"underline underline-offset-2 transition-colors hover:text-foreground",children:"Terms"})," ","·"," ",u.jsx("a",{href:"/privacy",className:"underline underline-offset-2 transition-colors hover:text-foreground",children:"Privacy"})]})]})]})})}function nv({children:e}){return u.jsxs("div",{className:"flex min-h-screen flex-col bg-background",children:[u.jsx("header",{className:"px-4 py-3",children:u.jsxs(Hu,{to:"/",className:"inline-flex items-center gap-1.5 rounded-[var(--radius-input)] px-2 py-1 text-body text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",children:[u.jsx(cy,{className:"h-3.5 w-3.5"}),"Back to home"]})}),u.jsx("div",{className:"flex flex-1 items-center justify-center px-4 pb-16",children:e})]})}function R7(){return u.jsx(nv,{children:u.jsxs(ro,{className:"w-full max-w-sm",children:[u.jsxs(ao,{className:"text-center",children:[u.jsx("div",{className:"mx-auto h-5 w-2/3 rounded-md",style:{background:"var(--bg-sunken)"}}),u.jsx("div",{className:"mx-auto mt-2 h-5 w-1/2 rounded-md",style:{background:"var(--bg-sunken)"}})]}),u.jsxs(io,{className:"space-y-4",children:[u.jsx("div",{className:"h-9 w-full rounded-md",style:{background:"var(--bg-sunken)"}}),u.jsx("div",{className:"mx-auto h-3 w-1/3 rounded-md",style:{background:"var(--bg-sunken)"}})]})]})})}function xS({message:e}){return u.jsx(nv,{children:u.jsxs(ro,{className:"w-full max-w-sm",children:[u.jsxs(ao,{className:"text-center",children:[u.jsx("div",{className:"mb-2 flex justify-center text-fg-3",children:u.jsx(fy,{className:"h-6 w-6"})}),u.jsx(Xu,{className:"text-title",children:e})]}),u.jsxs(io,{className:"space-y-4",children:[u.jsx("p",{className:"text-center text-body text-muted-foreground",children:"It may have expired or been revoked. Ask the team admin for a fresh link."}),u.jsx(me,{asChild:!0,variant:"outline",className:"w-full",children:u.jsxs(Hu,{to:"/",children:[u.jsx(cy,{className:"h-3.5 w-3.5"}),"Back to home"]})})]})]})})}function z7(e){if(!e)return null;const t=new Date(e).getTime();if(!Number.isFinite(t))return null;const n=t-Date.now();if(n<=0)return null;const a=Math.floor(n/6e4),l=Math.floor(a/60),o=Math.floor(l/24);return o>7?null:o>=1?{text:`Expires in ${o} ${o===1?"day":"days"}`,urgent:!1}:l>=1?{text:`Expires in ${l} ${l===1?"hour":"hours"}`,urgent:!0}:{text:`Expires in ${Math.max(1,a)} ${a===1?"minute":"minutes"}`,urgent:!0}}function O7(e){if(typeof e!="object"||e===null||!("from"in e))return null;const t=e.from;if(typeof t!="object"||t===null||!("pathname"in t)||typeof t.pathname!="string"||t.pathname==="/login")return null;const n="search"in t&&typeof t.search=="string"?t.search:"",a="hash"in t&&typeof t.hash=="string"?t.hash:"",l=`${t.pathname}${n}${a}`,o=OC(l);return o===xw&&l!==xw?null:o}function D7(){const{isAuthenticated:e}=qt(),t=Mn(),n=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),a=O7(t.state)??"/",l=a==="/"?"/api/v1/auth/github/start":`/api/v1/auth/github/start?next=${encodeURIComponent(a)}`,o="/api/v1/auth/github/dev-callback?githubId=1&login=devuser&displayName=Dev+User";return e?u.jsx(mf,{to:a,replace:!0}):u.jsxs("div",{className:"flex min-h-screen flex-col bg-background",children:[u.jsx("header",{className:"px-4 py-3",children:u.jsxs(Hu,{to:"/",className:"inline-flex items-center gap-1.5 rounded-[var(--radius-input)] px-2 py-1 text-body text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",children:[u.jsx(cy,{className:"h-3.5 w-3.5"}),"Back to home"]})}),u.jsx("div",{className:"flex flex-1 items-center justify-center px-4 pb-16",children:u.jsxs(ro,{className:"w-full max-w-sm",children:[u.jsxs(ao,{className:"text-center",children:[u.jsx("div",{className:"mb-2 flex justify-center text-foreground",children:u.jsx(to,{width:28,height:32})}),u.jsxs(Xu,{className:"text-title",children:["First Tree ",u.jsx("span",{className:"font-normal text-muted-foreground",children:"Hub"})]})]}),u.jsxs(io,{className:"space-y-4",children:[u.jsx(me,{asChild:!0,className:"w-full",children:u.jsxs("a",{href:l,children:[u.jsx(Ok,{className:"h-4 w-4"}),"Continue with GitHub"]})}),u.jsxs("p",{className:"text-center text-label text-muted-foreground",children:["By continuing you agree to our"," ",u.jsx("a",{href:"/terms",className:"underline underline-offset-2 transition-colors hover:text-foreground",children:"Terms"})," ","·"," ",u.jsx("a",{href:"/privacy",className:"underline underline-offset-2 transition-colors hover:text-foreground",children:"Privacy"})]}),n&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"relative my-2 text-center text-label text-muted-foreground",children:[u.jsx("span",{className:"relative z-10 bg-card px-2",children:"localhost only"}),u.jsx("div",{className:"absolute inset-x-0 top-1/2 h-px bg-border"})]}),u.jsx(me,{asChild:!0,variant:"outline",className:"w-full",children:u.jsxs("a",{href:o,children:[u.jsx(kz,{className:"h-4 w-4"}),"Dev: skip GitHub"]})})]})]})]})})]})}function M7(){const e=dn(),{adoptTokens:t}=qt(),[n,a]=x.useState(null);return x.useEffect(()=>{const l=window.location.hash.startsWith("#")?window.location.hash.slice(1):window.location.hash,o=new URLSearchParams(l),c=o.get("access"),f=o.get("refresh"),m=OC(o.get("next")),h=o.get("joinPath");if(!c||!f){a("Sign-in did not complete. Please try again.");return}(h==="solo"||h==="invite")&&Tk(h),window.history.replaceState(null,"",window.location.pathname),(async()=>(await t({accessToken:c,refreshToken:f}),e(m,{replace:!0})))()},[t,e]),u.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background text-body text-muted-foreground",children:n??"Signing you in…"})}function L7(){return ke.get("/admin/adapter-mappings")}function I7(e){return ke.post("/admin/adapter-mappings",e)}function U7(e){return ke.delete(`/admin/adapter-mappings/${e}`)}function P7(){return ke.get("/admin/adapters/status")}function B7(){return ke.get("/admin/adapters")}function $7(e){return ke.post("/admin/adapters",e)}function F7(e,t){return ke.patch(`/admin/adapters/${e}`,t)}function q7(e){return ke.delete(`/admin/adapters/${e}`)}const H7=Object.values(n6),wS={platform:"feishu",feishuAppId:"",feishuAppSecret:"",credentialsJson:"{}",status:"active",externalUserId:"",displayName:"",kaelUserId:"",kaelProjectId:""};function SS(e){const[t,n]=x.useState(wS),[a,l]=x.useState("");x.useEffect(()=>{e.open&&(n({...wS,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=Z7(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 c=e.kind==="user"?`Bind external user → ${e.agentLabel}`:e.editingId?`Edit bot binding · ${e.agentLabel}`:`Bind bot → ${e.agentLabel}`;return u.jsx($t,{open:e.open,onOpenChange:e.onOpenChange,children:u.jsxs(zt,{children:[u.jsx(Gt,{children:u.jsx(Ft,{children:c})}),u.jsxs("form",{onSubmit:o,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{htmlFor:"binding-platform",children:"Platform"}),u.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:H7.map(f=>u.jsx("option",{value:f,children:f},f))})]}),e.kind==="user"?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{htmlFor:"binding-ext-id",children:"External user ID"}),u.jsx(jt,{id:"binding-ext-id",value:t.externalUserId,onChange:f=>n({...t,externalUserId:f.target.value}),placeholder:"ou_xxxxxxxx...",className:"font-mono",required:!0})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{htmlFor:"binding-name",children:"Display name (optional)"}),u.jsx(jt,{id:"binding-name",value:t.displayName,onChange:f=>n({...t,displayName:f.target.value})})]})]}):u.jsxs(u.Fragment,{children:[t.platform==="feishu"?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"space-y-2",children:[u.jsxs(st,{htmlFor:"feishu-app-id",children:["App ID",e.editingId?" — leave empty to keep existing":""]}),u.jsx(jt,{id:"feishu-app-id",value:t.feishuAppId,onChange:f=>n({...t,feishuAppId:f.target.value}),placeholder:"cli_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsxs(st,{htmlFor:"feishu-app-secret",children:["App Secret",e.editingId?" — leave empty to keep existing":""]}),u.jsx(jt,{id:"feishu-app-secret",type:"password",autoComplete:"new-password",value:t.feishuAppSecret,onChange:f=>n({...t,feishuAppSecret:f.target.value}),placeholder:"••••••••"})]})]}):t.platform==="kael"?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"space-y-2",children:[u.jsxs(st,{htmlFor:"kael-user-id",children:["User ID",e.editingId?" — leave empty to keep existing":""]}),u.jsx(jt,{id:"kael-user-id",value:t.kaelUserId,onChange:f=>n({...t,kaelUserId:f.target.value}),placeholder:"user_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsxs(st,{htmlFor:"kael-project-id",children:["Project ID",e.editingId?" — leave empty to keep existing":""]}),u.jsx(jt,{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&&u.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Agent Token will be created automatically when you save."})]}):u.jsxs("div",{className:"space-y-2",children:[u.jsxs(st,{htmlFor:"binding-creds",children:["Credentials (JSON)",e.editingId?" — leave empty to keep existing":""]}),u.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&&u.jsx("p",{className:"text-body",style:{color:"var(--state-error)"},children:a}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{htmlFor:"binding-status",children:"Status"}),u.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:[u.jsx("option",{value:"active",children:"active"}),u.jsx("option",{value:"inactive",children:"inactive"})]})]})]}),e.errorMessage&&u.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:e.errorMessage}),u.jsxs(tn,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>e.onOpenChange(!1),disabled:e.pending,children:"Cancel"}),u.jsx(me,{type:"submit",disabled:e.pending,children:e.pending?"Saving…":e.editingId?"Update":"Create"})]})]})]})})}function Z7(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 V7(){var T;const e=dn(),t=jn(),[n,a]=gf(),l=n.get("agent"),o=Cl(),c=He({queryKey:["adapters"],queryFn:B7}),f=He({queryKey:["adapter-mappings"],queryFn:L7}),m=He({queryKey:["adapter-statuses"],queryFn:P7,refetchInterval:15e3}),y=((T=He({queryKey:["agents","name-map"],queryFn:()=>Ku({limit:100}),staleTime:3e4}).data)==null?void 0:T.items)??[],g=x.useMemo(()=>{const q=new Map;for(const K of m.data??[])q.set(K.configId,K);return q},[m.data]),b=x.useMemo(()=>{const q=c.data??[];return l?q.filter(K=>K.agentId===l):q},[c.data,l]),w=x.useMemo(()=>{const q=f.data??[];return l?q.filter(K=>K.agentId===l):q},[f.data,l]),k=b.reduce((q,K)=>{var ce;return q+((ce=g.get(K.id))!=null&&ce.connected?1:0)},0),j=b.length-k,E=c.isLoading||f.isLoading,[C,N]=x.useState(null),[z,U]=x.useState(""),[D,O]=x.useState(null),[M,I]=x.useState(null),[X,F]=x.useState(null),[W,ee]=x.useState(null),ye=wt({mutationFn:q=>$7({platform:q.platform,agentId:q.agentId,credentials:q.credentials,status:q.status}),onSuccess:()=>{t.invalidateQueries({queryKey:["adapters"]}),O(null)}}),he=wt({mutationFn:q=>{const K={status:q.status};return q.credentials&&(K.credentials=q.credentials),F7(q.id,K)},onSuccess:()=>{t.invalidateQueries({queryKey:["adapters"]}),O(null)}}),ne=wt({mutationFn:q7,onSuccess:()=>t.invalidateQueries({queryKey:["adapters"]})}),Z=wt({mutationFn:q=>I7({platform:q.platform,externalUserId:q.externalUserId,agentId:q.agentId,boundVia:"manual",displayName:q.displayName??void 0}),onSuccess:()=>{t.invalidateQueries({queryKey:["adapter-mappings"]}),I(null)}}),te=wt({mutationFn:U7,onSuccess:()=>t.invalidateQueries({queryKey:["adapter-mappings"]})});function ie(q){if(l){q==="bot"?O({agentId:l,editingId:null}):I({agentId:l});return}U(""),N({kind:q})}function ue(){!C||!z||(C.kind==="bot"?O({agentId:z,editingId:null}):I({agentId:z}),N(null))}function A(q){if(D){if(q.kind==="bot-create")ye.mutate({agentId:D.agentId,platform:q.draft.platform,status:q.draft.status,credentials:q.draft.credentials});else if(q.kind==="bot-update"){if(!D.editingId)return;he.mutate({id:D.editingId,status:q.status,credentials:q.credentials})}}}function P(q){!M||q.kind!=="user-create"||Z.mutate({agentId:M.agentId,platform:q.draft.platform,externalUserId:q.draft.externalUserId,displayName:q.draft.displayName})}const B=l?y.find(q=>q.uuid===l):null;return u.jsxs(u.Fragment,{children:[u.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&&u.jsxs("div",{className:"flex items-center gap-2",style:{padding:"0 var(--sp-0_5) var(--sp-3)"},children:[u.jsx("span",{className:"text-caption",style:{color:"var(--fg-3)"},children:"Filtered to"}),u.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:[(B==null?void 0:B.displayName)??l,u.jsx("button",{type:"button",onClick:()=>{const q=new URLSearchParams(n);q.delete("agent"),a(q,{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:u.jsx(Gd,{className:"h-3 w-3"})})]})]}),u.jsxs(sn,{className:"mb-3.5",children:[u.jsxs(Qs,{right:u.jsxs("span",{className:"inline-flex items-center gap-2",children:[u.jsxs("span",{className:"inline-flex items-center gap-3 text-caption",children:[u.jsxs("span",{className:"mono inline-flex items-center gap-1",style:{color:"var(--state-idle)"},children:[u.jsx(Xr,{state:"idle",size:6})," ",k," online"]}),u.jsxs("span",{className:"mono inline-flex items-center gap-1",style:{color:"var(--fg-4)"},children:[u.jsx(Xr,{state:"offline",size:6})," ",j," offline"]})]}),u.jsxs(me,{size:"xs",variant:"outline",onClick:()=>ie("bot"),children:[u.jsx(Jr,{className:"h-3 w-3"})," Bot binding"]})]}),children:["Bot bindings · ",b.length]}),E?u.jsx(Md,{children:"Loading…"}):b.length?u.jsxs(vl,{children:[u.jsx(bl,{children:u.jsxs(or,{children:[u.jsx(qe,{children:"Agent"}),u.jsx(qe,{children:"Platform"}),u.jsx(qe,{children:"Status"}),u.jsx(qe,{children:"Connection"}),u.jsx(qe,{children:"Created"}),u.jsx(qe,{style:{width:96,textAlign:"right"}})]})}),u.jsx(xl,{children:b.map(q=>{var ce;const K=((ce=g.get(q.id))==null?void 0:ce.connected)??!1;return u.jsxs(or,{interactive:!0,onClick:()=>e(`/agents/${q.agentId}`),children:[u.jsx(Be,{children:u.jsx("span",{className:"mono font-medium",children:o(q.agentId)})}),u.jsx(Be,{children:u.jsx(Sn,{children:q.platform})}),u.jsx(Be,{children:u.jsx(Sn,{tone:q.status==="active"?"accent":"outline",children:q.status})}),u.jsx(Be,{children:u.jsxs("span",{className:"inline-flex items-center gap-1.5 text-label",children:[u.jsx(Xr,{state:K?"idle":"offline",size:7}),u.jsx("span",{style:{color:"var(--fg-3)"},children:K?"Online":"Offline"})]})}),u.jsx(Be,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Ni(q.createdAt)}),u.jsxs(Be,{style:{textAlign:"right",whiteSpace:"nowrap"},onClick:xe=>xe.stopPropagation(),children:[u.jsx(me,{variant:"ghost",size:"xs",className:"text-label",onClick:()=>O({agentId:q.agentId,editingId:q.id,initialPlatform:Q7(q.platform),initialStatus:G7(q.status)}),children:"Edit"}),u.jsx(me,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>F(q.id),disabled:ne.isPending,title:"Delete",children:u.jsx(Hs,{className:"h-3.5 w-3.5"})})]})]},q.id)})})]}):u.jsx(Md,{children:l?"No bot bindings for this agent yet.":"No bot bindings"})]}),u.jsxs(sn,{children:[u.jsxs(Qs,{right:u.jsxs(me,{size:"xs",variant:"outline",onClick:()=>ie("user"),children:[u.jsx(Jr,{className:"h-3 w-3"})," User binding"]}),children:["User bindings · ",w.length]}),E?u.jsx(Md,{children:"Loading…"}):w.length?u.jsxs(vl,{children:[u.jsx(bl,{children:u.jsxs(or,{children:[u.jsx(qe,{children:"Agent"}),u.jsx(qe,{children:"Platform"}),u.jsx(qe,{children:"External user ID"}),u.jsx(qe,{children:"Display name"}),u.jsx(qe,{children:"Bound via"}),u.jsx(qe,{children:"Created"}),u.jsx(qe,{style:{width:32}})]})}),u.jsx(xl,{children:w.map(q=>u.jsxs(or,{interactive:!0,onClick:()=>e(`/agents/${q.agentId}`),children:[u.jsx(Be,{children:u.jsx("span",{className:"mono font-medium",style:{color:"var(--accent-dim)"},children:o(q.agentId)})}),u.jsx(Be,{children:u.jsx(Sn,{children:q.platform})}),u.jsx(Be,{children:u.jsx("span",{className:"mono text-label",style:{color:"var(--fg-2)"},children:q.externalUserId})}),u.jsx(Be,{style:{color:"var(--fg-2)"},children:q.displayName??"—"}),u.jsx(Be,{children:u.jsx(Sn,{tone:"outline",children:q.boundVia??"—"})}),u.jsx(Be,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Ni(q.createdAt)}),u.jsx(Be,{onClick:K=>K.stopPropagation(),children:u.jsx(me,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>ee(q.id),disabled:te.isPending,title:"Delete",children:u.jsx(Hs,{className:"h-3.5 w-3.5"})})})]},q.id))})]}):u.jsx(Md,{children:l?"No user bindings for this agent yet.":"No user bindings"})]}),u.jsx(K7,{open:C!=null,kind:(C==null?void 0:C.kind)??"bot",agents:y,agentId:z,onAgentChange:U,onCancel:()=>N(null),onConfirm:ue}),u.jsx(SS,{open:D!=null,kind:"bot",editingId:(D==null?void 0:D.editingId)??null,initialPlatform:D==null?void 0:D.initialPlatform,initialStatus:D==null?void 0:D.initialStatus,agentLabel:D?o(D.agentId):"",pending:ye.isPending||he.isPending,errorMessage:(ye.error??he.error)instanceof Error?(ye.error??he.error).message:null,onOpenChange:q=>{q||(O(null),ye.reset(),he.reset())},onSubmit:A}),u.jsx(SS,{open:M!=null,kind:"user",editingId:null,agentLabel:M?o(M.agentId):"",pending:Z.isPending,errorMessage:Z.error instanceof Error?Z.error.message:null,onOpenChange:q=>{q||(I(null),Z.reset())},onSubmit:P}),u.jsx(kS,{open:X!=null,onOpenChange:q=>!q&&F(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:ne.isPending,onConfirm:()=>{X!=null&&(ne.mutate(X),F(null))}}),u.jsx(kS,{open:W!=null,onOpenChange:q=>!q&&ee(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:te.isPending,onConfirm:()=>{W!=null&&(te.mutate(W),ee(null))}})]})}function Q7(e){return e==="feishu"||e==="slack"||e==="kael"?e:"feishu"}function G7(e){return e==="inactive"?"inactive":"active"}function Md({children:e}){return u.jsx("div",{className:"text-center py-6 text-body",style:{color:"var(--fg-3)"},children:e})}function K7(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 u.jsx($t,{open:e.open,onOpenChange:n=>!n&&e.onCancel(),children:u.jsxs(zt,{children:[u.jsx(Gt,{children:u.jsx(Ft,{children:e.kind==="bot"?"Bind a bot":"Bind an external user"})}),u.jsxs("div",{className:"space-y-3",children:[u.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Pick the agent this binding routes to."}),u.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:[u.jsx("option",{value:"",children:"Select an agent…"}),t.map(n=>u.jsxs("option",{value:n.uuid,children:[n.displayName," ",n.name?`(@${n.name})`:""]},n.uuid))]})]}),u.jsxs(tn,{children:[u.jsx(me,{variant:"ghost",onClick:e.onCancel,children:"Cancel"}),u.jsx(me,{onClick:e.onConfirm,disabled:!e.agentId,children:"Continue"})]})]})})}function kS(e){return u.jsx($t,{open:e.open,onOpenChange:e.onOpenChange,children:u.jsxs(zt,{children:[u.jsx(Gt,{children:u.jsx(Ft,{children:e.title})}),u.jsx("div",{className:"space-y-3 text-body",style:{color:"var(--fg-2)"},children:e.description}),u.jsxs(tn,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>e.onOpenChange(!1),disabled:e.pending,children:"Cancel"}),u.jsx(me,{type:"button",variant:"destructive",onClick:e.onConfirm,disabled:e.pending,children:e.pending?"Working…":e.confirmLabel})]})]})})}function Y7(){const{organizationId:e,adoptTokens:t,logout:n}=qt(),[a,l]=x.useState([]),[o,c]=x.useState(!1),[f,m]=x.useState(!1),[h,y]=x.useState(null);x.useEffect(()=>{(async()=>{try{const k=await ke.get("/me/organizations");l(k)}catch{}})()},[]);const g=a.find(k=>k.id===e),b=(g==null?void 0:g.displayName)??"this team",w=async()=>{m(!0),y(null);try{await kU();const j=(await ke.get("/me/organizations").catch(()=>[])).find(E=>E.id!==e);if(j){const E=await ke.post("/auth/switch-org",{organizationId:j.id});await t(E)}else n()}catch(k){y(k instanceof Error?k.message:"Failed to leave team"),m(!1)}};return u.jsxs(u.Fragment,{children:[u.jsxs(sn,{children:[u.jsx(Ar,{children:u.jsx(Rr,{children:"Membership"})}),u.jsxs("div",{style:{padding:"var(--sp-3) var(--sp-4) var(--sp-4)"},children:[u.jsxs("div",{className:"text-body",style:{color:"var(--fg)"},children:["You're a member of ",u.jsx("span",{className:"font-medium",children:b}),"."]}),u.jsx("div",{className:"text-label text-muted-foreground",style:{marginTop:4},children:"Leaving removes your access immediately. Your agents stay in the team for history; you can re-join later if an admin shares an invite link."}),u.jsx("div",{style:{marginTop:"var(--sp-3)"},children:u.jsx(me,{variant:"destructive",size:"sm",onClick:()=>c(!0),disabled:f,children:f?"Leaving…":"Leave team"})}),h&&u.jsx("div",{className:"text-body",style:{color:"var(--state-error)",marginTop:"var(--sp-2)"},children:h})]})]}),u.jsx($t,{open:o,onOpenChange:k=>!f&&c(k),children:u.jsxs(zt,{children:[u.jsxs(Gt,{children:[u.jsxs(Ft,{children:["Leave ",b,"?"]}),u.jsx(kf,{children:"You'll lose access to this team's agents and chats. Your historical messages stay, but you won't be able to read or send new ones until an admin re-invites you."})]}),u.jsxs(tn,{children:[u.jsx(me,{variant:"outline",size:"sm",onClick:()=>c(!1),disabled:f,children:"Cancel"}),u.jsx(me,{variant:"destructive",size:"sm",onClick:()=>void w(),disabled:f,children:f?"Leaving…":"Leave team"})]})]})})]})}const jS=[{key:"bindings",label:"Bindings"},{key:"membership",label:"Membership"}];function X7(){const e=Mn(),t=dn(),n=e.hash.replace("#",""),a=jS.some(o=>o.key===n)?n:"bindings",l=o=>{t({hash:o},{replace:!0})};return u.jsxs("div",{className:"-m-6",children:[u.jsx(zf,{title:"Settings",subtitle:"Per-member controls"}),u.jsx(WC,{children:jS.map(o=>u.jsx(eE,{active:a===o.key,onClick:()=>l(o.key),children:o.label},o.key))}),u.jsxs("div",{style:{padding:"var(--sp-4) var(--sp-5) var(--sp-7)"},children:[a==="bindings"&&u.jsx(V7,{}),a==="membership"&&u.jsx(Y7,{})]})]})}function J7(e){return ke.get(`/admin/chats/${encodeURIComponent(e)}`)}function W7(e,t){return ke.patch(`/admin/chats/${encodeURIComponent(e)}`,{topic:t})}function CS(e,t){return ke.post(`/admin/chats/${encodeURIComponent(e)}/messages`,{format:"text",content:t})}function eH(e,t){return ke.post(`/admin/chats/${encodeURIComponent(e)}/messages`,{format:"file",content:t})}function tH(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 hN(e){return ke.post(`/admin/agents/${encodeURIComponent(e)}/chats`,{})}function nH(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 ke.get(`/admin/chats/${encodeURIComponent(e)}/messages${a?`?${a}`:""}`)}const rH="first-tree-hub-images",aH=1,Ys="images";let Ld=null;function mN(){return Ld||(Ld=new Promise(e=>{if(typeof indexedDB>"u"){e(null);return}const t=indexedDB.open(rH,aH);t.onupgradeneeded=()=>{const n=t.result;n.objectStoreNames.contains(Ys)||n.createObjectStore(Ys,{keyPath:"imageId"})},t.onsuccess=()=>e(t.result),t.onerror=()=>e(null),t.onblocked=()=>e(null)}),Ld)}async function iH(e){const t=await mN();if(!t)throw new Error("Image storage unavailable (IndexedDB disabled or blocked)");await new Promise((n,a)=>{const l=t.transaction(Ys,"readwrite"),o=l.objectStore(Ys),c={imageId:e.imageId,base64:e.base64,mimeType:e.mimeType,createdAt:Date.now()};o.put(c),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 lH(e){const t=await mN();return t?new Promise(n=>{const o=t.transaction(Ys,"readonly").objectStore(Ys).get(e);o.onsuccess=()=>{const c=o.result;if(!c){n(null);return}n({base64:c.base64,mimeType:c.mimeType})},o.onerror=()=>n(null)}):null}function sH(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 oH(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 c=1/0;l.startsWith(t)?c=0:o.startsWith(t)?c=1:o.includes(t)&&(c=2),c!==1/0&&n.push({c:a,score:c})}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 uH(e,t,n,a){if(!a.name)return null;const l=e.slice(0,t.triggerIndex),o=e.slice(n),c=`@${a.name}`,f=o.length===0||!/\s/.test(o[0]??""),m=f?` ${o}`:o,h=`${l}${c}${m}`,y=l.length+c.length+(f?1:0);return{text:h,cursor:y}}function cH({value:e,cursor:t,candidates:n,onSelect:a,disabled:l}){const[o,c]=x.useState(0),[f,m]=x.useState(null),h=x.useMemo(()=>l?null:sH(e,t),[e,t,l]),y=x.useMemo(()=>h?oH(n,h.query):[],[h,n]),g=h?`${h.triggerIndex}:${h.query}`:"";x.useEffect(()=>{c(0)},[g]),x.useEffect(()=>{h===null&&f!==null&&m(null)},[h,f]);const b=f!==null&&h!==null&&f===h.triggerIndex,w=h!==null&&y.length>0&&!b;function k(){m((h==null?void 0:h.triggerIndex)??null)}function j(C){if(!h)return;const N=uH(e,h,t,C);N&&a(N)}return{trigger:w?h:null,results:w?y:[],highlightIndex:o,handleKey:C=>{if(!w||!h)return!1;if(C.key==="ArrowDown")return C.preventDefault(),c(N=>y.length===0?0:(N+1)%y.length),!0;if(C.key==="ArrowUp")return C.preventDefault(),c(N=>y.length===0?0:(N-1+y.length)%y.length),!0;if(C.key==="Enter"||C.key==="Tab"){const N=y[o]??y[0];return N?(C.preventDefault(),j(N),!0):!1}return C.key==="Escape"?(C.preventDefault(),k(),!0):!1},pick:j,dismiss:k}}function dH({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:u.jsx("div",{ref:o,role:"listbox","aria-label":"Mention suggestions",className:Ae("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 u.jsxs("button",{type:"button",role:"option","aria-selected":h,"data-mention-index":m,onMouseDown:y=>{y.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:[u.jsx("span",{className:"font-medium",children:f.displayName??(f.name?`@${f.name}`:"—")}),f.name&&f.displayName&&u.jsxs("span",{className:"mono text-caption",style:{color:"var(--fg-3)"},children:["@",f.name]})]},f.agentId)})})}function pN(e,t){return t&&(e==="idle"||e==="working"||e==="blocked"||e==="error")?e:"offline"}function fH(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=ES(l.payload);if(!o)continue;const c=a.get(o)??-1;l.seq>c&&a.set(o,l.seq)}return n.filter(l=>{if(l.kind!=="tool_call")return!0;const o=ES(l.payload);return o?a.get(o)===l.seq:!0})}function ES(e){if(typeof e!="object"||e===null)return;const t=e.toolUseId;return typeof t=="string"?t:void 0}function Uf(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(c=>c.type===l))==null?void 0:o.value)??""};return`${a("month")}/${a("day")} ${a("hour")}:${a("minute")}`}function gN(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 hH(e){return e>=1e3?`${(e/1e3).toFixed(1)}s`:`${e}ms`}function NS(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return"…"}}function mH({msg:e,myAgentId:t}){if(!t||e.senderId!==t)return null;const n=e.deliveryStatus??"sent";return n==="acked"?u.jsx("span",{className:"mono text-caption",style:{color:"var(--accent)"},title:"Agent has started processing",children:"✓✓ read"}):n==="delivered"?u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-3)"},title:"Delivered to agent inbox",children:"✓✓"}):u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},title:"Sent",children:"✓ sent"})}function pH({agentId:e,chatId:t,session:n}){const a=jn(),[,l]=gf(),[o,c]=x.useState(!1),[f,m]=x.useState(null),h=Wk(e,t),y=Yd(e),g=E=>{a.setQueryData(h,C=>C&&{...C,state:E}),a.setQueryData(y,C=>C&&C.map(N=>N.chatId===t?{...N,state:E}:N))},b=wt({mutationFn:()=>b3(e,t),onMutate:async()=>{await a.cancelQueries({queryKey:h}),await a.cancelQueries({queryKey:y});const E=a.getQueryData(h),C=a.getQueryData(y);return g("suspended"),{previousSession:E,previousList:C}},onError:(E,C,N)=>{N!=null&&N.previousSession&&a.setQueryData(h,N.previousSession),N!=null&&N.previousList&&a.setQueryData(y,N.previousList)},onSuccess:E=>{g(E.state)}}),w=wt({mutationFn:()=>x3(e,t),onMutate:async()=>{await a.cancelQueries({queryKey:h}),await a.cancelQueries({queryKey:y});const E=a.getQueryData(h),C=a.getQueryData(y);return a.setQueryData(y,N=>N&&N.filter(z=>z.chatId!==t)),{previousSession:E,previousList:C}},onError:(E,C,N)=>{N!=null&&N.previousSession&&a.setQueryData(h,N.previousSession),N!=null&&N.previousList&&a.setQueryData(y,N.previousList),m(E instanceof Error?E.message:"Terminate failed")},onSuccess:(E,C,N)=>{if(E.state!=="evicted"){N!=null&&N.previousList&&a.setQueryData(y,N.previousList),g(E.state),m(`Session is ${E.state}; terminate only applies to suspended sessions.`);return}m(null),c(!1),l({a:e})}}),k=(n==null?void 0:n.state)==="active",j=(n==null?void 0:n.state)==="suspended";return!k&&!j?null:u.jsxs(u.Fragment,{children:[u.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&&u.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:[u.jsx(ez,{className:"h-3 w-3"})," Suspend",u.jsx("span",{className:"kbd",style:{marginLeft:2},children:"⌘⇧P"})]}),j&&u.jsxs("button",{type:"button",onClick:()=>{m(null),c(!0)},disabled:w.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:[u.jsx(cz,{className:"h-3 w-3"})," Terminate"]})]}),u.jsx(gH,{open:o,onOpenChange:E=>{w.isPending||c(E),E||m(null)},session:n,chatId:t,error:f,pending:w.isPending,onConfirm:()=>w.mutate()})]})}function gH(e){const{open:t,onOpenChange:n,session:a,chatId:l,pending:o,error:c,onConfirm:f}=e;function m(y){y.preventDefault(),o||f()}const h=l.slice(0,8);return u.jsx($t,{open:t,onOpenChange:n,children:u.jsxs(zt,{children:[u.jsx(Gt,{children:u.jsx(Ft,{children:"Terminate session?"})}),u.jsxs("form",{onSubmit:m,className:"space-y-4",children:[u.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."}),u.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:[u.jsxs("span",{children:["chat: ",u.jsxs("span",{className:"font-medium",children:[h,"…"]})]}),(a==null?void 0:a.lastActivityAt)&&u.jsxs("span",{children:["last activity: ",gN(a.lastActivityAt)]}),typeof(a==null?void 0:a.messageCount)=="number"&&u.jsxs("span",{children:["messages: ",a.messageCount]})]}),c&&u.jsx("p",{className:"mono text-label",style:{color:"var(--state-error)"},children:c}),u.jsxs(tn,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>n(!1),disabled:o,children:"Cancel"}),u.jsx(me,{type:"submit",variant:"destructive",disabled:o,children:o?"Terminating…":"Terminate"})]})]})]})})}function yH({event:e}){const t=p3(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 u.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?u.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}}):u.jsx("span",{"aria-hidden":!0,style:{color:l,flexShrink:0},children:n?"⚠":"↳"}),u.jsxs("span",{className:"flex items-baseline",style:{color:"var(--fg-3)",minWidth:0,flex:1},title:t.args!==void 0&&t.args!==null?NS(t.args):void 0,children:[u.jsxs("span",{style:{whiteSpace:"nowrap",flexShrink:0},children:[o," ",u.jsx("span",{style:{color:"var(--fg-2)"},children:t.name})]}),t.args!==void 0&&t.args!==null?u.jsxs("span",{className:"truncate",style:{color:"var(--fg-4)",minWidth:0,flex:1},children:["(",NS(t.args),")"]}):null,t.durationMs!==void 0&&!a?u.jsxs("span",{className:"text-caption",style:{color:"var(--fg-4)",marginLeft:6,whiteSpace:"nowrap",flexShrink:0},children:["· ",hH(t.durationMs)]}):null]})]})}function vH({event:e,agentNameFn:t,agentId:n}){const a=y3(e.payload);if(!a||a.text.length===0)return null;const l=t(n);return u.jsxs("div",{className:"grid",style:{gridTemplateColumns:"var(--sp-5) 1fr",columnGap:8,padding:"var(--sp-1) 0",opacity:.85},children:[u.jsx(yN,{name:l,isSelf:!1}),u.jsxs("div",{className:"min-w-0",children:[u.jsxs("div",{className:"flex items-baseline",style:{gap:8},children:[u.jsx("span",{className:"mono text-label font-semibold",style:{color:"var(--accent)"},children:l}),u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Uf(e.createdAt)}),u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:"· streaming"})]}),u.jsx("div",{className:"text-body",style:{color:"var(--fg-2)",whiteSpace:"pre-wrap",marginTop:2},children:a.text})]})]})}function bH({event:e}){return u.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:[u.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}}),u.jsx("span",{style:{color:"var(--fg-3)"},children:"thinking…"}),u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Uf(e.createdAt)})]})}function xH({event:e}){const t=g3(e.payload),n=Uf(e.createdAt);return u.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:[u.jsxs("div",{className:"mono uppercase text-caption",style:{color:"var(--state-error)"},children:["error · ",(t==null?void 0:t.source)??"unknown"," · ",n]}),u.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 yN({name:e,isSelf:t}){const n=e.slice(0,2).toUpperCase();return u.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:u.jsx(to,{width:9,height:10,style:{color:"var(--accent)"}})})}function wH({msg:e,myAgentId:t,agentNameFn:n}){const a=n(e.senderId),l=t===e.senderId;return u.jsxs("div",{className:"grid",style:{gridTemplateColumns:"var(--sp-5) 1fr",columnGap:8,padding:"var(--sp-1_5) 0"},children:[u.jsx(yN,{name:a,isSelf:l}),u.jsxs("div",{className:"min-w-0",children:[u.jsxs("div",{className:"flex items-baseline",style:{gap:8},children:[u.jsx("span",{className:"mono text-body font-semibold",style:{color:l?"var(--fg)":"var(--accent)"},children:a}),u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Uf(e.createdAt)}),u.jsx("span",{style:{marginLeft:"auto"},children:u.jsx(mH,{msg:e,myAgentId:t})})]}),u.jsx("div",{className:"text-body",style:{color:"var(--fg)",marginTop:2},children:e.format==="file"&&SH(e.content)?u.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"&&kH(e.content)?u.jsx(jH,{content:e.content}):e.format==="text"?u.jsx(dN,{children:typeof e.content=="string"?e.content:JSON.stringify(e.content)}):u.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 SH(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 kH(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 jH({content:e}){const[t,n]=x.useState({kind:"loading"});return x.useEffect(()=>{let a=!1;return lH(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"?u.jsx("img",{src:t.src,alt:e.filename,style:{maxWidth:320,borderRadius:"var(--radius-panel)",marginTop:4}}):t.kind==="miss"?u.jsxs("span",{className:"text-label",style:{color:"var(--fg-3)",fontStyle:"italic"},children:['[Image "',e.filename,'" not available on this device]']}):u.jsx("span",{className:"text-label",style:{color:"var(--fg-4)"},children:"…"})}function CH({agentId:e,chatId:t}){var Le;const n=jn(),a=Cl(),l=wy(),{agentId:o}=qt(),[c,f]=x.useState(""),[m,h]=x.useState(0),[y,g]=x.useState([]),[b,w]=x.useState(!1),[k,j]=x.useState(null),E=x.useRef(null),C=x.useRef(null),N=x.useRef(null),z=x.useRef(!1),U=x.useRef(new Set);x.useEffect(()=>{z.current=!1},[t]);const{data:D}=He({queryKey:["chat-messages",t],queryFn:()=>nH(t,{limit:50}),refetchInterval:5e3}),{data:O}=He({queryKey:["session-events",e,t],queryFn:()=>v3(e,t,{limit:200,direction:"desc"}),refetchInterval:5e3}),{data:M}=He({queryKey:Wk(e,t),queryFn:()=>eo(e).then(re=>re.find(Ee=>Ee.chatId===t)??null),refetchInterval:5e3}),{data:I}=He({queryKey:["chat-detail",t],queryFn:()=>J7(t),enabled:!!t}),X=wt({mutationFn:re=>CS(t,re),onSuccess:()=>{f(""),n.invalidateQueries({queryKey:["chat-messages",t]}),n.invalidateQueries({queryKey:Yd(e)})}}),F=x.useCallback(re=>{const Ie=re.filter(fn=>fn.type.startsWith("image/"));if(Ie.length===0)return;const Pe=Ie.find(fn=>fn.size>5242880);if(Pe){j(`Image too large (${(Pe.size/1024/1024).toFixed(1)}MB). Maximum ${5242880/1024/1024}MB per image.`);return}const Lt=Ie.map(fn=>({id:crypto.randomUUID(),file:fn,previewUrl:URL.createObjectURL(fn)}));g(fn=>[...fn,...Lt]),j(null)},[]),W=x.useCallback(re=>{g(Ee=>{const Ie=Ee.find(Pe=>Pe.id===re);return Ie&&URL.revokeObjectURL(Ie.previewUrl),Ee.filter(Pe=>Pe.id!==re)})},[]),ee=async()=>{const re=c.trim(),Ee=y;if(!(!re&&Ee.length===0)&&!b&&!(K&&ce.length===0)){if(Ee.length>0){w(!0),j(null);try{for(const Ie of Ee){const Pe=await tH(Ie.file),Lt=crypto.randomUUID();await iH({imageId:Lt,base64:Pe,mimeType:Ie.file.type}),await eH(t,{data:Pe,mimeType:Ie.file.type,filename:Ie.file.name,size:Ie.file.size,imageId:Lt}),URL.revokeObjectURL(Ie.previewUrl)}g([]),re&&await CS(t,re),f(""),n.invalidateQueries({queryKey:["chat-messages",t]}),n.invalidateQueries({queryKey:Yd(e)})}catch(Ie){j(Ie instanceof Error?Ie.message:"Failed to send image")}finally{w(!1)}return}X.mutate(re)}},[ye,he]=x.useState(!1),[ne,Z]=x.useState(""),te=x.useRef(null);x.useEffect(()=>{var re;ye&&((re=te.current)==null||re.focus())},[ye]);const ie=wt({mutationFn:re=>W7(t,re),onSuccess:()=>{he(!1),n.invalidateQueries({queryKey:["chat-detail",t]}),n.invalidateQueries({queryKey:["agent-sessions",e]}),n.invalidateQueries({queryKey:["session",e,t]})}}),ue=()=>{const re=ne.trim();ie.mutate(re.length>0?re:null)},A=x.useMemo(()=>{const re=(D==null?void 0:D.items)??[],Ee=fH((O==null?void 0:O.items)??[]),Ie=[...re.map(Pe=>({kind:"message",at:Pe.createdAt,key:`m-${Pe.id}`,data:Pe})),...Ee.map(Pe=>({kind:"event",at:Pe.createdAt,key:`e-${Pe.id}`,data:Pe}))];return Ie.sort((Pe,Lt)=>Pe.at.localeCompare(Lt.at)),Ie},[D,O]),P=A.length;x.useEffect(()=>{var re;P>0&&((re=N.current)==null||re.scrollIntoView({behavior:"smooth"}))},[P]);const B=I!=null&&I.participants?I.participants.map(re=>{const Ee=a(re.agentId);return`@${Ee.length>20?`${Ee.slice(0,17)}…`:Ee}`}).join(" "):`@${a(e)}`,T=a(e),q=x.useMemo(()=>{var Ie;const re=((Ie=I==null?void 0:I.participants)==null?void 0:Ie.map(Pe=>Pe.agentId))??[e],Ee=[];for(const Pe of re){if(Pe===o)continue;const Lt=l(Pe);!Lt||!Lt.name||Ee.push({agentId:Pe,name:Lt.name,displayName:Lt.displayName})}return Ee},[I==null?void 0:I.participants,e,l,o]),K=x.useMemo(()=>{if(!I)return!1;if(I.type==="group")return!0;const re=I.participants.some(Ee=>Ee.agentId===o);return I.type==="direct"&&!re&&I.participants.length>=2},[I,o]);x.useEffect(()=>{if(U.current.has(t)||!D||!O||!I||A.length>0||c.length>0||K||T===e)return;const re=`Hi ${T}! What can you help with?`;f(re),h(re.length),U.current.add(t),requestAnimationFrame(()=>{const Ee=C.current;Ee&&(Ee.focus(),Ee.setSelectionRange(re.length,re.length))})},[t,e,D,O,I,A.length,c.length,T,K]);const ce=x.useMemo(()=>{if(!K)return[];const re=q.map(Ee=>({agentId:Ee.agentId,name:Ee.name}));return e6(c,re)},[c,q,K]),xe=cH({value:c,cursor:m,candidates:q,disabled:X.isPending||b,onSelect:re=>{f(re.text),h(re.cursor),requestAnimationFrame(()=>{const Ee=C.current;Ee&&(Ee.focus(),Ee.setSelectionRange(re.cursor,re.cursor))})}}),we=(M==null?void 0:M.runtimeState)??"idle",pe=pN((M==null?void 0:M.runtimeState)??null,e?"connected":null),Xe=(M==null?void 0:M.messageCount)??((Le=D==null?void 0:D.items)==null?void 0:Le.length)??0;return u.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[u.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:[u.jsxs("div",{className:"min-w-0",children:[u.jsxs("div",{className:"flex items-center",style:{gap:8},children:[u.jsx(Xr,{state:pe,size:8}),ye?u.jsxs(u.Fragment,{children:[u.jsx("input",{ref:te,value:ne,onChange:re=>Z(re.target.value),onKeyDown:re=>{re.key==="Enter"?(re.preventDefault(),ue()):re.key==="Escape"&&(re.preventDefault(),he(!1))},disabled:ie.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)"}}),u.jsx("button",{type:"button",onClick:ue,disabled:ie.isPending,title:"Save",className:"inline-flex items-center",style:{color:"var(--accent)",padding:2},children:u.jsx(cr,{className:"h-3.5 w-3.5"})}),u.jsx("button",{type:"button",onClick:()=>he(!1),disabled:ie.isPending,title:"Cancel",className:"inline-flex items-center",style:{color:"var(--fg-3)",padding:2},children:u.jsx(Gd,{className:"h-3.5 w-3.5"})})]}):u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"truncate text-subtitle",style:{color:"var(--fg)"},children:(I==null?void 0:I.topic)||(M==null?void 0:M.summary)||`Chat · ${t.slice(0,8)}`}),u.jsx("button",{type:"button",onClick:()=>{Z((I==null?void 0:I.topic)??""),he(!0)},title:"Rename chat",className:"inline-flex items-center transition-colors",style:{color:"var(--fg-4)",padding:2},onMouseEnter:re=>re.currentTarget.style.color="var(--fg-2)",onMouseLeave:re=>re.currentTarget.style.color="var(--fg-4)",children:u.jsx(Vu,{className:"h-3 w-3"})})]}),u.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})]}),u.jsxs("div",{className:"flex items-center text-caption",style:{color:"var(--fg-3)",marginTop:4,gap:10},children:[u.jsx("span",{className:"mono",children:B}),u.jsx("span",{children:"·"}),u.jsxs("span",{children:["started ",gN((M==null?void 0:M.startedAt)??null)]}),u.jsx("span",{children:"·"}),u.jsxs("span",{children:[Xe," msgs"]}),u.jsx("span",{children:"·"}),u.jsxs("span",{children:["runtime"," ",u.jsx("span",{className:"mono",style:{color:pe==="error"?"var(--state-error)":"var(--fg-2)"},children:we})]})]})]}),u.jsx(pH,{agentId:e,chatId:t,session:M??null})]}),u.jsxs("div",{className:"flex-1 overflow-y-auto relative",style:{padding:"var(--sp-2_5) var(--sp-3_5)"},children:[P===0&&u.jsxs("div",{className:"flex flex-col items-center text-body",style:{color:"var(--fg-3)",padding:"var(--sp-8) 0",gap:6},children:[u.jsx(dy,{className:"h-8 w-8",style:{opacity:.3}}),"Send a message to start the conversation"]}),u.jsx("div",{className:"flex flex-col",style:{gap:4},children:A.map(re=>{if(re.kind==="event"){const Ee=re.data;switch(Ee.kind){case"tool_call":return u.jsx(yH,{event:Ee},re.key);case"assistant_text":return u.jsx(vH,{event:Ee,agentId:e,agentNameFn:a},re.key);case"thinking":return u.jsx(bH,{event:Ee},re.key);case"error":return u.jsx(xH,{event:Ee},re.key);default:return null}}return u.jsx(wH,{msg:re.data,myAgentId:o,agentNameFn:a},re.key)})}),u.jsx("div",{ref:N})]}),u.jsxs("div",{className:"shrink-0",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderTop:"var(--hairline) solid var(--border)"},children:[u.jsxs("div",{style:{position:"relative",border:"var(--hairline) solid var(--border)",borderRadius:6,background:"var(--bg-sunken)"},onDragOver:re=>re.preventDefault(),onDrop:re=>{re.preventDefault(),F(Array.from(re.dataTransfer.files))},children:[y.length>0&&u.jsx("div",{className:"flex items-center",style:{gap:6,padding:"var(--sp-1_5) var(--sp-2_5) 0",overflowX:"auto"},children:y.map(re=>u.jsxs("div",{style:{position:"relative",flexShrink:0,borderRadius:4,border:"var(--hairline) solid var(--border)",overflow:"hidden"},children:[u.jsx("img",{src:re.previewUrl,alt:re.file.name,style:{height:32,width:"auto",display:"block",objectFit:"cover"}}),u.jsx("button",{type:"button",onClick:()=>W(re.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:u.jsx(Gd,{className:"h-2 w-2"})})]},re.id))}),u.jsxs("div",{style:{position:"relative"},children:[u.jsx(dH,{trigger:xe.trigger,results:xe.results,highlightIndex:xe.highlightIndex,anchorRef:C,onPick:xe.pick}),u.jsx("textarea",{ref:C,value:c,onChange:re=>{f(re.target.value),h(re.target.selectionStart??re.target.value.length)},onSelect:re=>{h(re.currentTarget.selectionStart??c.length)},onFocus:()=>{K&&(z.current||c.length>0||q.length===0||(z.current=!0,f("@"),h(1),requestAnimationFrame(()=>{const re=C.current;re&&re.setSelectionRange(1,1)})))},onPaste:re=>{const Ee=Array.from(re.clipboardData.files);Ee.length>0&&(re.preventDefault(),F(Ee))},placeholder:K?"Type @ to pick a recipient, then your message":`Message @${T} · / for commands · @ to mention`,rows:2,onKeyDown:re=>{xe.handleKey(re)||re.key==="Enter"&&!re.shiftKey&&(re.preventDefault(),ee())},disabled:X.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)"}})]}),u.jsxs("div",{className:"flex items-center justify-between text-caption",style:{position:"absolute",bottom:6,left:10,right:10,color:"var(--fg-4)"},children:[u.jsxs("span",{className:"mono flex items-center",style:{gap:8},children:[u.jsx("button",{type:"button",onClick:()=>{var re;return(re=E.current)==null?void 0:re.click()},title:"Attach image",style:{background:"none",border:"none",cursor:"pointer",color:"var(--fg-3)",padding:0,display:"inline-flex",alignItems:"center"},children:u.jsx(JR,{className:"h-3.5 w-3.5"})}),u.jsx("input",{ref:E,type:"file",accept:"image/*",multiple:!0,style:{display:"none"},onChange:re=>{re.target.files&&(F(Array.from(re.target.files)),re.target.value="")}}),u.jsx("span",{children:"/suspend"}),u.jsx("span",{children:"/resume"}),u.jsx("span",{children:"/branch"}),u.jsx("span",{children:"/promote"})]}),u.jsxs("span",{className:"flex items-center",style:{gap:8},children:[b&&u.jsx("span",{className:"mono text-caption",style:{color:"var(--accent)"},children:"uploading…"}),u.jsxs("span",{children:[u.jsx("span",{className:"kbd",children:"⏎"})," send ",u.jsx("span",{className:"kbd",children:"⇧⏎"})," new line"]}),u.jsxs("button",{type:"button",onClick:ee,disabled:X.isPending||b||!c.trim()&&y.length===0||K&&ce.length===0,title:K&&ce.length===0?"Pick at least one recipient with @ before sending in a group chat":void 0,className:Ae("inline-flex items-center transition-colors text-label font-semibold",(X.isPending||b||!c.trim()&&y.length===0||K&&ce.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:[u.jsx(lz,{className:"h-3 w-3"})," Send"]})]})]})]}),(X.isError||k)&&u.jsx("p",{className:"mono text-label",style:{color:"var(--state-error)",padding:"var(--sp-1_5) var(--sp-0_5) 0"},children:k??(X.error instanceof Error?X.error.message:"Failed to send")})]})]})}function EH(){return u.jsx("div",{className:"flex-1 flex items-center justify-center p-8",children:u.jsxs("div",{className:"text-center max-w-sm",children:[u.jsx(to,{width:36,height:40,className:"mx-auto mb-3 text-primary opacity-60"}),u.jsx("div",{className:"text-subtitle mb-1",children:"Select a chat"}),u.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."})]})})}const NH=3e4,_H=1e3,TH=3e3;function AH(e){return e==="claude-code"?"Claude Code":e==="codex"?"Codex":e}function RH(){var xe;const{refreshMe:e,organizationId:t,memberId:n}=qt(),a=dn(),l=lR(t,n),o=oR(l),c=o!=null&&o.connectToken&&o.connectTokenExpiresAt&&o.connectTokenExpiresAt>Date.now()?o.connectToken:null,f=c?(o==null?void 0:o.connectTokenExpiresAt)??null:null,[m,h]=x.useState(()=>(o==null?void 0:o.displayName)??""),[y,g]=x.useState(()=>(o==null?void 0:o.selectedRuntime)??null),[b,w]=x.useState(null),[k,j]=x.useState(null),[E,C]=x.useState(null),[N,z]=x.useState(()=>c),[U,D]=x.useState(()=>f),[O,M]=x.useState([]),[I,X]=x.useState("form"),[F,W]=x.useState(null),[ee]=x.useState(()=>aR()),ye=x.useRef(null),he=x.useRef(null),ne=x.useRef(null),Z=x.useRef(0);x.useEffect(()=>()=>{he.current&&(he.current.cancelled=!0)},[]),x.useEffect(()=>{uR(l,{displayName:m,selectedRuntime:y,connectToken:N,connectTokenExpiresAt:U})},[l,m,y,N,U]),x.useEffect(()=>{(async()=>{try{const we=await ke.get("/me/organizations");M(we)}catch{}})()},[]),x.useEffect(()=>{if(I!=="form")return;let we=!1;const pe=async()=>{const Le=++Z.current;try{const re=await Ra();if(we||Le!==Z.current)return;const Ie=re.filter(Pe=>Pe.status==="connected").sort((Pe,Lt)=>Lt.lastSeenAt.localeCompare(Pe.lastSeenAt))[0]??null;if(w(Pe=>(Pe==null?void 0:Pe.id)===(Ie==null?void 0:Ie.id)?Pe:Ie),Ie){ne.current!==Ie.id&&(ne.current=null,C(null),j(null));try{const Pe=await py(Ie.id);if(we||Le!==Z.current)return;ne.current=Ie.id,C(Ie.id),j(Pe.capabilities)}catch{}}else ne.current=null,C(null),j(null)}catch{}};pe();const Xe=setInterval(pe,TH);return()=>{we=!0,clearInterval(Xe)}},[I]),x.useEffect(()=>{if(b)return;if(N&&U&&U>Date.now()){const pe=Math.max(U-Date.now(),0),Xe=window.setTimeout(()=>{z(null),D(null)},pe);return()=>window.clearTimeout(Xe)}N&&(z(null),D(null));let we=!1;return(async()=>{try{const pe=await ke.post("/connect-tokens",{});we||(z(pe.token),D(Date.now()+pe.expiresIn*1e3))}catch(pe){we||W(pe instanceof Error?pe.message:"Failed to generate connect token")}})(),()=>{we=!0}},[b,N,U]);const te=b&&E===b.id?k:null;x.useEffect(()=>{g(we=>{if(!te)return we;const pe=Object.entries(te).filter(([,Xe])=>Xe.state==="ok").map(([Xe])=>Xe);return we&&pe.includes(we)?we:pe[0]??null})},[te]);const ie=te?Object.entries(te).filter(([,we])=>we.state==="ok").map(([we])=>we):[],ue=((xe=O.find(we=>we.id===t))==null?void 0:xe.displayName)??"",A=m.trim(),P=A||"your agent",B=N?`npm install -g @agent-team-foundation/first-tree-hub
|
|
387
|
+
first-tree-hub connect ${N}`:null,T=x.useCallback(async we=>{he.current&&(he.current.cancelled=!0);const pe={cancelled:!1};he.current=pe;const Xe=Date.now();for(;!pe.cancelled;){let Le=!1;try{const re=await ke.get(`/admin/agents/${encodeURIComponent(we)}/client-status`);if(pe.cancelled)return;Le=re.online===!0}catch{if(pe.cancelled)return}if(Le){try{const re=await hN(we);if(pe.cancelled||(cR(l),await e(),pe.cancelled))return;a(`/?a=${encodeURIComponent(we)}&c=${encodeURIComponent(re.id)}`,{replace:!0})}catch(re){if(pe.cancelled)return;W(re instanceof Error?re.message:"Failed to open chat"),X("timeout")}return}if(Date.now()-Xe>NH){pe.cancelled||X("timeout");return}await new Promise(re=>setTimeout(re,_H))}},[l,e,a]),q=!!(A&&b&&y&&ie.includes(y)&&I==="form"),K=x.useCallback(async()=>{if(!b||!y||!A)return;W(null),X("creating");const we=Fg(A);let pe;try{pe=(await ke.post("/admin/agents",{type:"personal_assistant",displayName:A,...we?{name:we}:{},clientId:b.id,runtimeProvider:y})).uuid,ye.current=pe}catch(Xe){W(Xe instanceof Error?Xe.message:"Failed to create agent"),X("form");return}await T(pe)},[A,b,y,T]),ce=x.useCallback(async()=>{const we=ye.current;we&&(W(null),X("creating"),await T(we))},[T]);return u.jsx("div",{className:"flex-1 overflow-auto",style:{display:"flex",justifyContent:"center",padding:"clamp(var(--sp-16), 12vh, var(--sp-45)) var(--sp-4) var(--sp-12)"},children:u.jsxs("div",{style:{width:"100%",maxWidth:560},children:[I==="form"&&u.jsx(zH,{joinPath:ee,teamName:ue,displayName:m,setDisplayName:h,trimmedName:A,connectedClient:b,cliCommand:B,okRuntimes:ie,selectedRuntime:y,setSelectedRuntime:g,capabilitiesLoaded:te!==null,error:F,canCreate:q,onCreate:K}),I==="creating"&&u.jsx(PH,{nameOrFallback:P}),I==="timeout"&&u.jsx(BH,{nameOrFallback:P,hostname:(b==null?void 0:b.hostname)??null,error:F,onRetry:ce})]})})}function zH({joinPath:e,teamName:t,displayName:n,setDisplayName:a,trimmedName:l,connectedClient:o,cliCommand:c,okRuntimes:f,selectedRuntime:m,setSelectedRuntime:h,capabilitiesLoaded:y,error:g,canCreate:b,onCreate:w}){const k=x.useRef(null),E=e==="invite"&&t?`Welcome — you've joined ${t}`:"Welcome to First Tree Hub",C=l?o?m?"Ready to create.":"Next: choose a runtime.":"Next: connect the computer where they'll work.":"Next: name your agent.";return x.useEffect(()=>{var N;l||(N=k.current)==null||N.focus()},[l]),u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex flex-col items-start",style:{gap:"var(--sp-4)",paddingTop:0},children:[u.jsxs("p",{className:"text-label",style:{margin:0,color:"var(--fg-3)",maxWidth:420},children:[u.jsx("span",{style:{color:"var(--fg-2)"},children:E}),u.jsx("span",{style:{color:"var(--fg-4)"},children:" · "}),"Where agents and humans work as one team."]}),u.jsx("h1",{className:"text-title font-semibold",style:{margin:0,color:"var(--fg)"},children:"Let's create your first agent."})]}),u.jsxs("div",{style:{marginTop:"var(--sp-5)",position:"relative"},children:[u.jsx(OH,{}),u.jsx(_S,{number:"01",state:l?"complete":"active",children:u.jsxs("div",{className:"flex items-baseline",style:{gap:"var(--sp-2)",flexWrap:"wrap"},children:[u.jsx("label",{htmlFor:"onboarding-name",className:"text-body font-normal",style:{color:"var(--fg-2)",whiteSpace:"nowrap"},children:"What should we call this agent?"}),u.jsx("input",{ref:k,id:"onboarding-name","aria-label":"Agent display name",value:n,onChange:N=>a(N.target.value),placeholder:"e.g. Code Reviewer",maxLength:200,className:"onboarding-name-input text-body font-medium",style:{flex:"0 1 28ch",minWidth:"22ch",maxWidth:"30ch",padding:"var(--sp-0_5) 0",background:"transparent",border:0,borderBottom:"var(--hairline) solid var(--border-faint)",borderRadius:0,boxShadow:"none",color:"var(--fg)",outline:"none",caretColor:"var(--accent)",transition:"border-color 160ms ease, color 160ms ease"},onFocus:N=>{N.currentTarget.style.borderBottomColor="var(--accent)"},onBlur:N=>{N.currentTarget.style.borderBottomColor="var(--border-faint)"}})]})}),u.jsx(_S,{number:"02",state:b?"complete":l?"active":"idle",children:u.jsxs("div",{style:{animation:l?"subtle-fade 200ms ease-out":void 0},children:[u.jsxs("h2",{className:"text-subtitle font-semibold",style:{color:l?"var(--fg)":"var(--fg-4)",fontWeight:l?600:500},children:["Where will ",l||"this agent"," run?"]}),l?u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"text-body",style:{color:"var(--fg-3)",marginTop:"var(--sp-1)"},children:o?`This computer will run ${l} and keep it connected to Hub.`:"This agent needs a computer to do its work. Connect the one it should use."}),!o&&u.jsx("p",{className:"text-label",style:{color:"var(--fg-4)",marginTop:"var(--sp-2)"},children:"Open Terminal on that computer and run this command."}),o?u.jsx(LH,{hostname:o.hostname??o.id}):u.jsxs(u.Fragment,{children:[u.jsx(DH,{command:c}),u.jsx(MH,{})]}),o&&u.jsx(IH,{runtimes:f,selected:m,onSelect:h,capabilitiesLoaded:y})]}):null]})})]}),g&&u.jsx("div",{className:"text-body",style:{marginTop:"var(--sp-4)",padding:"var(--sp-2_5) var(--sp-3)",background:"color-mix(in oklch, var(--state-error) 12%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-error) 28%, transparent)",borderRadius:"var(--radius-input)",color:"var(--state-error)"},children:g}),l&&u.jsxs("div",{style:{marginTop:b?"var(--sp-4)":"var(--sp-5)",marginLeft:"calc(var(--sp-5) + var(--sp-3))",animation:"subtle-fade 180ms ease-out"},children:[!b&&u.jsx("p",{className:"text-label",style:{margin:0,color:"var(--fg-4)"},children:C}),b&&u.jsxs(me,{type:"button",size:"default",style:{marginTop:0,border:"var(--hairline) solid color-mix(in oklch, var(--accent) 32%, transparent)",background:"var(--accent)",boxShadow:"var(--shadow-md)",color:"var(--primary-foreground, var(--color-primary-foreground))",opacity:1,transform:"translateZ(0)",transition:"box-shadow 160ms ease, transform 160ms ease"},onClick:w,onMouseEnter:N=>{N.currentTarget.style.transform="scale(1.01)",N.currentTarget.style.boxShadow="var(--shadow-md)"},onMouseLeave:N=>{N.currentTarget.style.transform="scale(1)",N.currentTarget.style.boxShadow="var(--shadow-md)"},children:[u.jsxs("span",{children:["Create ",l]}),u.jsx(CR,{className:"h-4 w-4"})]}),u.jsx("p",{className:"text-caption",style:{margin:b?"var(--sp-2) 0 0":"var(--sp-0_5) 0 0",color:"var(--fg-4)"},children:"You can customize this agent after setup."})]})]})}function OH(){return u.jsx("div",{"aria-hidden":"true",style:{position:"absolute",top:"var(--sp-5)",bottom:"var(--sp-5)",left:"calc(var(--sp-2_5) - var(--hairline))",width:"var(--hairline)",background:"color-mix(in oklch, var(--border-faint) 56%, transparent)"}})}function _S({number:e,state:t,children:n}){const a=t==="active",l=t==="complete";return u.jsxs("section",{className:"grid",style:{gridTemplateColumns:"var(--sp-5) 1fr",columnGap:"var(--sp-3)",marginTop:e==="01"?0:"var(--sp-5)",position:"relative"},children:[u.jsx("div",{className:"mono text-caption flex items-center justify-center",style:{width:"var(--sp-5)",height:"var(--sp-5)",borderRadius:999,background:a||l?"color-mix(in oklch, var(--accent) 8%, var(--bg))":"var(--bg)",border:a||l?"var(--hairline) solid var(--accent)":"var(--hairline) solid var(--border-faint)",color:a||l?"var(--accent)":"var(--fg-4)",zIndex:1},children:l?u.jsx(cr,{className:"h-3 w-3"}):e}),u.jsx("div",{style:{minHeight:"var(--sp-6)",paddingBottom:"var(--sp-1)"},children:n})]})}function DH({command:e}){const[t,n]=x.useState(!1),l=(e?e.split(`
|
|
388
|
+
`):[]).find(m=>m.startsWith("first-tree-hub"))??"",o="first-tree-hub connect ",c=l.startsWith(o)?`${o}${l.slice(o.length,o.length+22)}…`:l.length>52?`${l.slice(0,52)}…`:l,f=async()=>{e&&(await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500))};return u.jsx("div",{style:{marginTop:"var(--sp-2)"},children:u.jsxs("div",{className:"flex",style:{gap:"var(--sp-2)",alignItems:"stretch"},children:[u.jsx("pre",{className:"mono text-label",title:l,style:{flex:1,minHeight:38,margin:0,padding:"var(--sp-2_5) var(--sp-3)",background:"color-mix(in oklch, var(--bg-sunken) 42%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--border-faint) 58%, transparent)",borderRadius:"var(--radius-input)",color:"var(--fg-2)",whiteSpace:"nowrap",overflow:"hidden",minWidth:0},children:c||"Generating token…"}),u.jsxs(me,{type:"button",variant:"outline",size:"sm",onClick:f,disabled:!e,style:{alignSelf:"stretch",background:"color-mix(in oklch, var(--bg-raised) 48%, transparent)",borderColor:"color-mix(in oklch, var(--border) 58%, transparent)",boxShadow:"none",height:"auto",minHeight:38},children:[t?u.jsx(cr,{className:"h-3.5 w-3.5"}):u.jsx(yf,{className:"h-3.5 w-3.5"}),t?"Copied":"Copy"]})]})})}function MH(){return u.jsxs("div",{className:"flex items-center text-body",style:{gap:"var(--sp-2)",marginTop:"var(--sp-2_5)",color:"color-mix(in oklch, var(--accent) 24%, var(--fg-3))"},children:[u.jsx(UH,{}),u.jsx("span",{children:"Waiting for your computer…"})]})}function LH({hostname:e}){return u.jsxs("div",{className:"inline-flex items-center text-body",style:{gap:"var(--sp-2)",marginTop:"var(--sp-2_5)",padding:"var(--sp-1_5) var(--sp-2_5)",borderRadius:999,background:"color-mix(in oklch, var(--accent) 10%, transparent)",color:"color-mix(in oklch, var(--accent) 26%, var(--fg))",animation:"onboarding-pop 260ms cubic-bezier(0.2, 0.9, 0.2, 1.15)"},children:[u.jsx(cr,{className:"h-3.5 w-3.5"}),u.jsxs("span",{children:[u.jsx("span",{className:"mono font-semibold",children:e})," connected"]})]})}function IH({runtimes:e,selected:t,onSelect:n,capabilitiesLoaded:a}){return e.length===0?u.jsx("p",{className:"text-label",style:{marginTop:"var(--sp-3)",color:"var(--fg-3)"},children:a?"No runtime ready on this computer. Install Claude Code or Codex, then check back.":"Detecting installed runtimes…"}):u.jsxs("div",{style:{marginTop:"var(--sp-3)"},children:[u.jsx("p",{className:"text-label",style:{color:"var(--fg-3)",marginBottom:"var(--sp-1)"},children:"Powered by"}),u.jsxs("fieldset",{className:"flex",style:{gap:"var(--sp-4)",flexWrap:"wrap",margin:0,padding:0,border:0},children:[u.jsx("legend",{className:"sr-only",children:"Runtime provider"}),e.map((l,o)=>{const c=t===l;return u.jsxs("label",{className:"onboarding-runtime-option inline-flex items-center text-body",style:{gap:"var(--sp-1_5)",padding:"var(--sp-1) 0",cursor:"pointer",color:c?"color-mix(in oklch, var(--accent) 30%, var(--fg))":"var(--fg)",fontWeight:c?600:400,animation:`onboarding-rise 220ms ease-out ${o*80}ms both`,transition:"color 160ms ease, opacity 160ms ease, transform 160ms ease"},children:[u.jsx("input",{type:"radio",name:"onboarding-runtime",value:l,checked:c,onChange:()=>n(l),className:"sr-only"}),u.jsx("span",{"aria-hidden":"true",className:"inline-flex items-center justify-center",style:{width:14,height:14,borderRadius:"50%",border:c?"var(--hairline) solid var(--accent)":"var(--hairline) solid var(--border-strong)",background:c?"color-mix(in oklch, var(--accent) 8%, transparent)":"transparent",boxShadow:c?"0 0 0 var(--sp-0_5) color-mix(in oklch, var(--accent) 10%, transparent)":"none",transition:"border-color 160ms ease, background 160ms ease, box-shadow 160ms ease"},children:c&&u.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:"var(--accent)"}})}),AH(l)]},l)})]})]})}function UH(){return u.jsxs("span",{"aria-hidden":"true",style:{position:"relative",display:"inline-block",width:8,height:8,flexShrink:0},children:[u.jsx("span",{style:{position:"absolute",inset:0,borderRadius:"50%",background:"var(--accent)"}}),u.jsx("span",{style:{position:"absolute",inset:-3,borderRadius:"50%",border:"var(--hairline) solid var(--accent)",animation:"ring-pulse 1.8s infinite",opacity:.55}})]})}function PH({nameOrFallback:e}){return u.jsxs("div",{className:"flex flex-col items-center text-center",style:{paddingTop:"var(--sp-12)",gap:"var(--sp-4)"},children:[u.jsxs("p",{className:"text-title",style:{color:"var(--fg)"},children:["Creating ",e,"…"]}),u.jsx($H,{}),u.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Usually takes ~10 seconds"})]})}function BH({nameOrFallback:e,hostname:t,error:n,onRetry:a}){const l=t??"your computer";return u.jsxs("div",{className:"flex flex-col",style:{paddingTop:"var(--sp-8)",gap:"var(--sp-4)"},children:[u.jsxs("p",{className:"text-title",style:{color:"var(--fg)"},children:[e," is taking longer than expected."]}),n?u.jsx("div",{className:"text-body",style:{padding:"var(--sp-2_5) var(--sp-3)",background:"color-mix(in oklch, var(--state-error) 10%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-error) 25%, transparent)",borderRadius:"var(--radius-input)",color:"var(--state-error)"},children:n}):u.jsxs("div",{className:"text-body",style:{color:"var(--fg-2)"},children:[u.jsx("p",{children:"This usually means:"}),u.jsxs("ul",{style:{paddingLeft:"var(--sp-4)",listStyle:"disc",marginTop:"var(--sp-1_5)"},children:[u.jsxs("li",{children:["The runtime can't start on ",l," (missing API key, etc.)"]}),u.jsxs("li",{children:["The connection to ",l," dropped"]})]}),u.jsxs("p",{style:{marginTop:"var(--sp-2)"},children:["Fix it on ",l,", then click ",u.jsx("span",{className:"font-semibold",children:"Try again"}),"."]})]}),u.jsx("div",{className:"flex",style:{gap:"var(--sp-2)"},children:u.jsx(me,{onClick:a,children:"Try again"})})]})}function $H(){return u.jsxs("span",{className:"flex items-center",style:{gap:6},children:[u.jsx(Fp,{delayMs:0}),u.jsx(Fp,{delayMs:160}),u.jsx(Fp,{delayMs:320})]})}function Fp({delayMs:e}){return u.jsx("span",{"aria-hidden":"true",style:{width:8,height:8,borderRadius:"50%",background:"var(--accent)",animation:"heartbeat-pulse 1.2s ease-in-out infinite",animationDelay:`${e}ms`,display:"inline-block"}})}function FH({selectedAgentId:e,selectedChatId:t}){const{wizardStep:n}=qt();return t&&e?u.jsx(CH,{agentId:e,chatId:t}):n!==null&&n!=="completed"?u.jsx(RH,{}):u.jsx(EH,{})}function vN(){const{data:e}=He({queryKey:["clients"],queryFn:Ra,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 qg({children:e}){return u.jsx("div",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-4)",marginBottom:8},children:e})}function bN({children:e}){return u.jsx("div",{className:"grid text-body",style:{gridTemplateColumns:"auto 1fr",columnGap:10,rowGap:4},children:e})}function Kr({label:e,children:t}){return u.jsxs(u.Fragment,{children:[u.jsx("div",{style:{color:"var(--fg-3)"},children:e}),u.jsx("div",{className:"text-right truncate",style:{color:"var(--fg)",overflow:"hidden",textOverflow:"ellipsis"},children:t})]})}function TS(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 AS(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 qp({label:e,value:t,accent:n}){return u.jsxs("div",{style:{padding:"var(--sp-1_5) var(--sp-2)",background:"var(--bg-sunken)",borderRadius:"var(--radius-input)"},children:[u.jsx("div",{className:"mono uppercase text-caption",style:{color:"var(--fg-4)"},children:e}),u.jsx("div",{className:"mono text-subtitle",style:{color:n??"var(--fg)"},children:t})]})}function qH({notifications:e,agentId:t}){const[,n]=gf(),a=jn(),l=wt({mutationFn:o=>Jj(o),onSuccess:()=>{a.invalidateQueries({queryKey:["notifications"]})}});return u.jsx("div",{className:"flex flex-col",style:{gap:4},children:e.map(o=>u.jsx(Wj,{notification:o,clickable:!!o.chatId,onClick:()=>{o.read||l.mutate(o.id),o.chatId&&n({a:t,c:o.chatId})}},o.id))})}function xN({agentId:e}){var h;const t=Cl(),{resolve:n}=vN(),{data:a}=He({queryKey:["activity"],queryFn:Qu,refetchInterval:1e4}),l=(h=a==null?void 0:a.agents)==null?void 0:h.find(y=>y.agentId===e),o=n(l==null?void 0:l.clientId),{data:c}=He({queryKey:["notifications","agent",e],queryFn:()=>kg({agentId:e,limit:3}),refetchInterval:3e4}),f=t(e),m=(l==null?void 0:l.runtimeState)??"offline";return u.jsxs("div",{className:"flex-1 overflow-y-auto",children:[u.jsxs("div",{style:{padding:"var(--sp-3) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[u.jsxs("div",{className:"flex items-center",style:{gap:10},children:[u.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:u.jsx(to,{width:14,height:16,style:{color:"var(--accent)"}})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-subtitle",style:{color:"var(--fg)"},children:f}),u.jsx("div",{className:"mono truncate text-body",style:{color:"var(--fg-4)"},children:e})]}),u.jsx(Gs,{state:m})]}),u.jsxs("div",{className:"grid",style:{gridTemplateColumns:"repeat(3, 1fr)",gap:4,marginTop:10},children:[u.jsx(qp,{label:"sessions",value:(l==null?void 0:l.totalSessions)??0,accent:((l==null?void 0:l.totalSessions)??0)>0?"var(--fg)":"var(--fg-4)"}),u.jsx(qp,{label:"active",value:(l==null?void 0:l.activeSessions)??0,accent:((l==null?void 0:l.activeSessions)??0)>0?"var(--accent)":"var(--fg-4)"}),u.jsx(qp,{label:"uptime",value:AS((o==null?void 0:o.connectedAt)??null)})]})]}),u.jsxs("div",{style:{padding:"var(--sp-3) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[u.jsx(qg,{children:"Computer · runtime"}),u.jsxs(bN,{children:[u.jsx(Kr,{label:"host",children:u.jsx("span",{className:"mono text-label",children:(o==null?void 0:o.hostname)??"—"})}),u.jsx(Kr,{label:"os",children:u.jsx("span",{className:"mono text-label",children:(o==null?void 0:o.os)??"—"})}),u.jsx(Kr,{label:"runtime",children:u.jsx("span",{className:"mono",children:(l==null?void 0:l.runtimeType)??"—"})}),u.jsx(Kr,{label:"sdk",children:u.jsx("span",{className:"mono text-label",children:(o==null?void 0:o.sdkVersion)??"—"})}),u.jsx(Kr,{label:"connected",children:u.jsx("span",{className:"mono text-label",children:AS((o==null?void 0:o.connectedAt)??null)})})]})]}),u.jsxs("div",{style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},className:"flex flex-col",children:[u.jsx("a",{href:`/agents/${e}`,style:{color:"var(--accent)"},className:"hover:underline text-label",children:"Manage agent →"}),u.jsx("a",{href:"/clients",style:{color:"var(--accent)",marginTop:4},className:"hover:underline text-label",children:"Computers →"})]}),u.jsxs("div",{style:{padding:"var(--sp-3) var(--sp-3_5)"},children:[u.jsx(qg,{children:"Notifications"}),!(c!=null&&c.items)||c.items.length===0?u.jsx("div",{className:"text-center text-label",style:{color:"var(--fg-3)",padding:"var(--sp-3) 0"},children:"No notifications for this agent"}):u.jsx(qH,{notifications:c.items,agentId:e})]})]})}function HH({agentId:e,chatId:t}){const{data:n}=He({queryKey:["session",e,t],queryFn:()=>eo(e).then(a=>a.find(l=>l.chatId===t)??null),refetchInterval:5e3});return u.jsxs("div",{className:"flex flex-col overflow-hidden flex-1",children:[u.jsxs("div",{style:{padding:"var(--sp-3) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[u.jsx(qg,{children:"Session"}),u.jsxs(bN,{children:[u.jsx(Kr,{label:"state",children:u.jsx(Gs,{state:(n==null?void 0:n.runtimeState)??(n==null?void 0:n.state)??null})}),u.jsx(Kr,{label:"chat",children:u.jsx("span",{className:"mono text-body",children:t.slice(0,12)})}),u.jsx(Kr,{label:"started",children:TS((n==null?void 0:n.startedAt)??null)}),u.jsx(Kr,{label:"last",children:TS((n==null?void 0:n.lastActivityAt)??null)}),u.jsx(Kr,{label:"messages",children:u.jsx("span",{className:"mono",children:(n==null?void 0:n.messageCount)??0})})]})]}),u.jsx(xN,{agentId:e})]})}function ZH({selectedAgentId:e,selectedChatId:t}){return t&&e?u.jsx(HH,{agentId:e,chatId:t}):e?u.jsx(xN,{agentId:e}):null}const VH=32;function QH({aggregated:e,stale:t,className:n}){const a=Math.max(1,...e.map(l=>l.workingCount));return u.jsx("div",{className:Ae("flex items-end gap-[var(--sp-0_5)]",t&&"opacity-40",n),style:{height:22},"aria-hidden":!0,children:Array.from({length:VH}).map((l,o)=>{const c=e[o]??{workingCount:0,errorMask:!1},f=c.workingCount===0?.08:c.workingCount/a,m=.25+f*.7,h=c.errorMask?"var(--state-error)":"var(--accent)";return u.jsx("span",{className:"flex-1",style:{height:`${Math.max(12,f*100)}%`,background:h,opacity:m,borderRadius:.5}},o)})})}const GH={error:0,blocked:1,working:2,idle:3};function KH(e,t){return t?e?GH[e]??4:4:5}function YH(e,t){return t==="all"?!0:t==="active"?e.runtimeState==="working":e.runtimeState==="blocked"||e.runtimeState==="error"}function XH({selectedAgentId:e,selectedChatId:t,onSelectAgent:n,onSelectChat:a}){const l=Cl(),{resolve:o}=vN(),c=iU(),[f,m]=x.useState(""),[h,y]=x.useState("all"),{data:g}=He({queryKey:["activity"],queryFn:Qu,refetchInterval:1e4}),{data:b}=He({queryKey:e?Yd(e):["agent-sessions",null],queryFn:()=>e?eo(e):Promise.resolve([]),enabled:!!e,refetchInterval:1e4}),w=wt({mutationFn:D=>hN(D),onSuccess:(D,O)=>{a(O,D.id)}}),{humans:k,agents:j,totalAll:E}=x.useMemo(()=>{const D=(g==null?void 0:g.agents)??[],O=f.trim().toLowerCase(),M=D.filter(W=>{var he;if(!YH(W,h))return!1;if(!O)return!0;const ee=l(W.agentId).toLowerCase(),ye=W.clientId?(((he=o(W.clientId))==null?void 0:he.hostname)??"").toLowerCase():"";return ee.includes(O)||ye.includes(O)||W.agentId.toLowerCase().includes(O)}),I=W=>KH(W.runtimeState,W.clientId),X=[],F=[];for(const W of M)(W.type==="human"?X:F).push(W);return X.sort((W,ee)=>I(W)-I(ee)),F.sort((W,ee)=>I(W)-I(ee)),{humans:X,agents:F,totalAll:D.length}},[g,f,h,l,o]),C=x.useMemo(()=>{const D=(g==null?void 0:g.agents)??[];return{working:D.filter(O=>O.runtimeState==="working").length,blocked:D.filter(O=>O.runtimeState==="blocked").length,error:D.filter(O=>O.runtimeState==="error").length}},[g]),N=[{value:"all",label:"all",count:E},{value:"active",label:"active",count:C.working},{value:"attn",label:"attn",count:C.blocked+C.error,warn:C.blocked+C.error>0}],z=D=>{var W;const O=e===D.agentId,M=pN(D.runtimeState,D.clientId),I=D.clientId?((W=o(D.clientId))==null?void 0:W.hostname)??D.clientId.slice(0,8):null,X=D.activeSessions??0,F=D.totalSessions??0;return u.jsxs("div",{style:{borderBottom:"var(--hairline) solid var(--border-faint)"},children:[u.jsxs("button",{type:"button",onClick:()=>n(O?null:D.agentId),className:Ae("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:O?"var(--bg-active)":"transparent",borderLeft:`var(--hairline-bold) solid ${O?"var(--accent)":"transparent"}`},children:[u.jsx(Xr,{state:M,size:8}),u.jsxs("div",{className:"min-w-0",children:[u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx("span",{className:"mono truncate text-body font-medium",style:{color:"var(--fg)"},children:l(D.agentId)}),D.type==="human"&&u.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"})]}),u.jsx("div",{className:"truncate text-body",style:{color:"var(--fg-3)"},children:M==="offline"?"disconnected":I||"—"})]}),u.jsx("div",{className:"flex flex-col items-end gap-0.5",children:F>0&&u.jsxs("span",{className:"mono tnum text-label",style:{color:"var(--fg-3)"},children:[X,u.jsxs("span",{style:{color:"var(--fg-4)"},children:[" / ",F]})]})})]}),O&&u.jsxs("div",{style:{background:"var(--bg-sunken)",paddingBottom:4},children:[(!b||b.length===0)&&u.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"}),b==null?void 0:b.filter(ee=>ee.state!=="evicted").map(ee=>{const ye=ee.state==="active"?"working":"idle";return u.jsxs("button",{type:"button",onClick:()=>a(D.agentId,ee.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===ee.chatId?"var(--bg-hover)":"transparent",color:ee.state==="active"?"var(--fg-2)":"var(--fg-3)"},onMouseEnter:he=>{t!==ee.chatId&&(he.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:he=>{t!==ee.chatId&&(he.currentTarget.style.background="transparent")},children:[u.jsx(Xr,{state:ye,size:6}),u.jsx("span",{className:"truncate text-body",style:{color:ee.topic||ee.summary?"var(--fg-2)":"var(--fg-4)"},children:ee.topic||ee.summary||`Chat · ${ee.chatId.slice(0,8)}`})]},ee.chatId)}),u.jsxs("button",{type:"button",onClick:()=>w.mutate(D.agentId),disabled:w.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:ee=>{ee.currentTarget.style.background="var(--bg-hover)"},onMouseLeave:ee=>{ee.currentTarget.style.background="transparent"},children:[u.jsx(Jr,{className:"h-3 w-3"}),"New chat"]})]})]},D.agentId)},U=k.length+j.length;return u.jsxs("aside",{className:"shrink-0 flex flex-col overflow-hidden",style:{width:268,background:"var(--bg-raised)",borderRight:"var(--hairline) solid var(--border)"},children:[u.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:[u.jsx("div",{style:{marginBottom:8},children:u.jsxs("span",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-3)"},children:[E," members"]})}),u.jsxs("div",{className:"relative",children:[u.jsx(vf,{className:"h-3.5 w-3.5 absolute pointer-events-none",style:{left:8,top:"50%",transform:"translateY(-50%)",color:"var(--fg-4)"}}),u.jsx("input",{value:f,onChange:D=>m(D.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)"}})]}),u.jsx("div",{className:"flex gap-1",style:{marginTop:8},children:N.map(D=>u.jsx(gu,{active:h===D.value,count:D.count,warn:D.warn,onClick:()=>y(D.value),children:D.label},D.value))})]}),u.jsxs("div",{className:"shrink-0",style:{padding:"var(--sp-2) var(--sp-3)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[u.jsxs("div",{className:"flex items-center justify-between",style:{marginBottom:4},children:[u.jsxs("span",{className:"mono flex items-center gap-1.5 text-eyebrow",style:{color:"var(--fg-3)"},children:[u.jsx(JH,{}),"5m"]}),u.jsx("span",{className:"mono text-body",style:{color:"var(--fg-4)"},children:c.stale?"stale":"live"})]}),u.jsx(QH,{aggregated:c.aggregated,stale:c.stale}),u.jsxs("div",{className:"flex justify-between text-body",style:{marginTop:6},children:[u.jsxs("span",{className:"mono",style:{color:"var(--state-working)"},children:[C.working," working"]}),u.jsxs("span",{className:"mono",style:{color:"var(--state-blocked)"},children:[C.blocked," blocked"]}),u.jsxs("span",{className:"mono",style:{color:"var(--state-error)"},children:[C.error," error"]})]})]}),u.jsxs("div",{className:"flex-1 overflow-y-auto",children:[U===0&&u.jsx("div",{className:"text-center text-body",style:{padding:"var(--sp-6) var(--sp-3)",color:"var(--fg-3)"},children:f||h!=="all"?"No matches":u.jsxs(u.Fragment,{children:[u.jsx("p",{style:{margin:0},children:"No agents"}),u.jsx("p",{className:"text-label",style:{margin:"var(--sp-1) 0 0",color:"var(--fg-4)"},children:"Your first agent will appear here."})]})}),j.length>0&&u.jsxs("div",{children:[u.jsx(RS,{label:"Agents",count:j.length}),j.map(z)]}),k.length>0&&u.jsxs("div",{children:[u.jsx(RS,{label:"Humans",count:k.length}),k.map(z)]})]})]})}function RS({label:e,count:t}){return u.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 JH(){return u.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",focusable:"false",style:{color:"var(--accent)"},children:[u.jsx("title",{children:"pulse"}),u.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 WH(){const[e,t]=gf(),n=e.get("a"),a=e.get("c");XC();const l=x.useCallback(f=>{t(f?{a:f}:{})},[t]),o=x.useCallback((f,m)=>{t({a:f,c:m})},[t]),{data:c}=He({queryKey:["agent-sessions",n],queryFn:()=>n?eo(n):Promise.resolve([]),enabled:!!n&&!a});return x.useEffect(()=>{if(!n||a||!c||c.length===0)return;const f=[...c].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,c,t]),u.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[u.jsx(XH,{selectedAgentId:n,selectedChatId:a,onSelectAgent:l,onSelectChat:o}),u.jsx("main",{className:"flex-1 flex flex-col overflow-hidden min-w-0",style:{background:"var(--bg)"},children:u.jsx(FH,{selectedAgentId:n,selectedChatId:a})}),n&&u.jsx("aside",{className:"shrink-0 flex flex-col overflow-hidden",style:{width:290,borderLeft:"var(--hairline) solid var(--border)",background:"var(--bg-raised)"},children:u.jsx(ZH,{selectedAgentId:n,selectedChatId:a})})]})}const eZ=new pT({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}});function tZ(){return u.jsx(gT,{client:eZ,children:u.jsx(dR,{children:u.jsx(ZA,{children:u.jsxs(xA,{children:[u.jsx(ar,{path:"/login",element:u.jsx(D7,{})}),u.jsx(ar,{path:"/signup",element:u.jsx(mf,{to:"/login",replace:!0})}),u.jsx(ar,{path:"/auth/github/complete",element:u.jsx(M7,{})}),u.jsx(ar,{path:"/invite/:token",element:u.jsx(A7,{})}),u.jsx(ar,{element:u.jsx(yR,{}),children:u.jsxs(ar,{element:u.jsx(aU,{children:u.jsx(pM,{})}),children:[u.jsx(ar,{index:!0,element:u.jsx(WH,{})}),u.jsx(ar,{path:"agents",element:u.jsx(m7,{})}),u.jsx(ar,{path:"agents/:uuid",element:u.jsx(Jq,{})}),u.jsx(ar,{path:"clients",element:u.jsx(k7,{})}),u.jsx(ar,{path:"settings",element:u.jsx(X7,{})}),u.jsx(ar,{path:"admin",element:u.jsx(NU,{})})]})})]})})})})}const wN=document.getElementById("root");if(!wN)throw new Error("Root element not found");q2.createRoot(wN).render(u.jsx(x.StrictMode,{children:u.jsx(tZ,{})}));export{CR as A,to as F,Hu as L,ot as c,u as j,x as r};
|