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

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.
Files changed (24) hide show
  1. package/dist/{bootstrap-CtVqQA8a.mjs → bootstrap-Ca5Fiqz6.mjs} +10 -1
  2. package/dist/cli/index.mjs +9 -19
  3. package/dist/{feishu-DEmwoNn_.mjs → dist-CLiN7cVS.mjs} +88 -51
  4. package/dist/drizzle/0026_saas_onboarding.sql +153 -0
  5. package/dist/drizzle/meta/_journal.json +7 -0
  6. package/dist/feishu-FTWnoOsc.mjs +52 -0
  7. package/dist/{getMachineId-bsd-BB-fnFLA.mjs → getMachineId-bsd-D0w3uAZa.mjs} +1 -1
  8. package/dist/{getMachineId-darwin-DAYWNsYK.mjs → getMachineId-darwin-DOoYFb2_.mjs} +1 -1
  9. package/dist/{getMachineId-win-H5RT49ov.mjs → getMachineId-win-B6hY8edq.mjs} +1 -1
  10. package/dist/index.mjs +7 -5
  11. package/dist/invitation-BTlGMy0o-dIoR8JRj.mjs +3 -0
  12. package/dist/invitation-C_zAhB8x-8Khychlu.mjs +258 -0
  13. package/dist/{observability-DDkJwSKv.mjs → observability-C08jUFsJ.mjs} +1 -1
  14. package/dist/{observability-DV_fQKqV-oxfXX6Z2.mjs → observability-DPyf745N-BSc8QNcR.mjs} +6 -6
  15. package/dist/{core-BgiFGT7Y.mjs → saas-connect-idjpoPTk.mjs} +1111 -153
  16. package/dist/web/assets/index-CEAPwdg7.js +377 -0
  17. package/dist/web/assets/index-CzWeWItA.css +1 -0
  18. package/dist/web/index.html +2 -2
  19. package/package.json +1 -1
  20. package/dist/web/assets/index-Cd290Lq6.css +0 -1
  21. package/dist/web/assets/index-xi7JmCtW.js +0 -361
  22. /package/dist/{execAsync-CP8iWV5b.mjs → execAsync-XMc-nFn-.mjs} +0 -0
  23. /package/dist/{getMachineId-linux-BU7Fi6S0.mjs → getMachineId-linux-MlY63Zsw.mjs} +0 -0
  24. /package/dist/{getMachineId-unsupported-BhWCxKBo.mjs → getMachineId-unsupported-BS652RIy.mjs} +0 -0
@@ -0,0 +1,377 @@
1
+ var v0=e=>{throw TypeError(e)};var Om=(e,t,n)=>t.has(e)||v0("Cannot "+n);var B=(e,t,n)=>(Om(e,t,"read from private field"),n?n.call(e):t.get(e)),Ae=(e,t,n)=>t.has(e)?v0("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),xe=(e,t,n,a)=>(Om(e,t,"write to private field"),a?a.call(e,n):t.set(e,n),n),qe=(e,t,n)=>(Om(e,t,"access private method"),n);var Kc=(e,t,n,a)=>({set _(l){xe(e,t,l,n)},get _(){return B(e,t,a)}});function K_(e,t){for(var n=0;n<t.length;n++){const a=t[n];if(typeof a!="string"&&!Array.isArray(a)){for(const l in a)if(l!=="default"&&!(l in e)){const o=Object.getOwnPropertyDescriptor(a,l);o&&Object.defineProperty(e,l,o.get?o:{enumerable:!0,get:()=>a[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))a(l);new MutationObserver(l=>{for(const o of l)if(o.type==="childList")for(const u of o.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&a(u)}).observe(document,{childList:!0,subtree:!0});function n(l){const o={};return l.integrity&&(o.integrity=l.integrity),l.referrerPolicy&&(o.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?o.credentials="include":l.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function a(l){if(l.ep)return;l.ep=!0;const o=n(l);fetch(l.href,o)}})();function $d(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Dm={exports:{}},qo={};/**
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 b0;function Y_(){if(b0)return qo;b0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(a,l,o){var u=null;if(o!==void 0&&(u=""+o),l.key!==void 0&&(u=""+l.key),"key"in l){o={};for(var f in l)f!=="key"&&(o[f]=l[f])}else o=l;return l=o.ref,{$$typeof:e,type:a,key:u,ref:l!==void 0?l:null,props:o}}return qo.Fragment=t,qo.jsx=n,qo.jsxs=n,qo}var x0;function X_(){return x0||(x0=1,Dm.exports=Y_()),Dm.exports}var c=X_(),Mm={exports:{}},Ie={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var S0;function J_(){if(S0)return Ie;S0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),b=Symbol.iterator;function S(U){return U===null||typeof U!="object"?null:(U=b&&U[b]||U["@@iterator"],typeof U=="function"?U:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,E={};function C(U,P,_){this.props=U,this.context=P,this.refs=E,this.updater=_||k}C.prototype.isReactComponent={},C.prototype.setState=function(U,P){if(typeof U!="object"&&typeof U!="function"&&U!=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,U,P,"setState")},C.prototype.forceUpdate=function(U){this.updater.enqueueForceUpdate(this,U,"forceUpdate")};function A(){}A.prototype=C.prototype;function O(U,P,_){this.props=U,this.context=P,this.refs=E,this.updater=_||k}var M=O.prototype=new A;M.constructor=O,j(M,C.prototype),M.isPureReactComponent=!0;var D=Array.isArray;function z(){}var L={H:null,A:null,T:null,S:null},Z=Object.prototype.hasOwnProperty;function te(U,P,_){var $=_.ref;return{$$typeof:e,type:U,key:P,ref:$!==void 0?$:null,props:_}}function q(U,P){return te(U.type,P,U.props)}function oe(U){return typeof U=="object"&&U!==null&&U.$$typeof===e}function W(U){var P={"=":"=0",":":"=2"};return"$"+U.replace(/[=:]/g,function(_){return P[_]})}var me=/\/+/g;function fe(U,P){return typeof U=="object"&&U!==null&&U.key!=null?W(""+U.key):P.toString(36)}function ee(U){switch(U.status){case"fulfilled":return U.value;case"rejected":throw U.reason;default:switch(typeof U.status=="string"?U.then(z,z):(U.status="pending",U.then(function(P){U.status==="pending"&&(U.status="fulfilled",U.value=P)},function(P){U.status==="pending"&&(U.status="rejected",U.reason=P)})),U.status){case"fulfilled":return U.value;case"rejected":throw U.reason}}throw U}function H(U,P,_,$,X){var ue=typeof U;(ue==="undefined"||ue==="boolean")&&(U=null);var Se=!1;if(U===null)Se=!0;else switch(ue){case"bigint":case"string":case"number":Se=!0;break;case"object":switch(U.$$typeof){case e:case t:Se=!0;break;case g:return Se=U._init,H(Se(U._payload),P,_,$,X)}}if(Se)return X=X(U),Se=$===""?"."+fe(U,0):$,D(X)?(_="",Se!=null&&(_=Se.replace(me,"$&/")+"/"),H(X,P,_,"",function(ct){return ct})):X!=null&&(oe(X)&&(X=q(X,_+(X.key==null||U&&U.key===X.key?"":(""+X.key).replace(me,"$&/")+"/")+Se)),P.push(X)),1;Se=0;var Me=$===""?".":$+":";if(D(U))for(var ye=0;ye<U.length;ye++)$=U[ye],ue=Me+fe($,ye),Se+=H($,P,_,ue,X);else if(ye=S(U),typeof ye=="function")for(U=ye.call(U),ye=0;!($=U.next()).done;)$=$.value,ue=Me+fe($,ye++),Se+=H($,P,_,ue,X);else if(ue==="object"){if(typeof U.then=="function")return H(ee(U),P,_,$,X);throw P=String(U),Error("Objects are not valid as a React child (found: "+(P==="[object Object]"?"object with keys {"+Object.keys(U).join(", ")+"}":P)+"). If you meant to render a collection of children, use an array instead.")}return Se}function re(U,P,_){if(U==null)return U;var $=[],X=0;return H(U,$,"","",function(ue){return P.call(_,ue,X++)}),$}function K(U){if(U._status===-1){var P=U._result;P=P(),P.then(function(_){(U._status===0||U._status===-1)&&(U._status=1,U._result=_)},function(_){(U._status===0||U._status===-1)&&(U._status=2,U._result=_)}),U._status===-1&&(U._status=0,U._result=P)}if(U._status===1)return U._result.default;throw U._result}var he=typeof reportError=="function"?reportError:function(U){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var P=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof U=="object"&&U!==null&&typeof U.message=="string"?String(U.message):String(U),error:U});if(!window.dispatchEvent(P))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",U);return}console.error(U)},T={map:re,forEach:function(U,P,_){re(U,function(){P.apply(this,arguments)},_)},count:function(U){var P=0;return re(U,function(){P++}),P},toArray:function(U){return re(U,function(P){return P})||[]},only:function(U){if(!oe(U))throw Error("React.Children.only expected to receive a single React element child.");return U}};return Ie.Activity=y,Ie.Children=T,Ie.Component=C,Ie.Fragment=n,Ie.Profiler=l,Ie.PureComponent=O,Ie.StrictMode=a,Ie.Suspense=m,Ie.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,Ie.__COMPILER_RUNTIME={__proto__:null,c:function(U){return L.H.useMemoCache(U)}},Ie.cache=function(U){return function(){return U.apply(null,arguments)}},Ie.cacheSignal=function(){return null},Ie.cloneElement=function(U,P,_){if(U==null)throw Error("The argument must be a React element, but you passed "+U+".");var $=j({},U.props),X=U.key;if(P!=null)for(ue in P.key!==void 0&&(X=""+P.key),P)!Z.call(P,ue)||ue==="key"||ue==="__self"||ue==="__source"||ue==="ref"&&P.ref===void 0||($[ue]=P[ue]);var ue=arguments.length-2;if(ue===1)$.children=_;else if(1<ue){for(var Se=Array(ue),Me=0;Me<ue;Me++)Se[Me]=arguments[Me+2];$.children=Se}return te(U.type,X,$)},Ie.createContext=function(U){return U={$$typeof:u,_currentValue:U,_currentValue2:U,_threadCount:0,Provider:null,Consumer:null},U.Provider=U,U.Consumer={$$typeof:o,_context:U},U},Ie.createElement=function(U,P,_){var $,X={},ue=null;if(P!=null)for($ in P.key!==void 0&&(ue=""+P.key),P)Z.call(P,$)&&$!=="key"&&$!=="__self"&&$!=="__source"&&(X[$]=P[$]);var Se=arguments.length-2;if(Se===1)X.children=_;else if(1<Se){for(var Me=Array(Se),ye=0;ye<Se;ye++)Me[ye]=arguments[ye+2];X.children=Me}if(U&&U.defaultProps)for($ in Se=U.defaultProps,Se)X[$]===void 0&&(X[$]=Se[$]);return te(U,ue,X)},Ie.createRef=function(){return{current:null}},Ie.forwardRef=function(U){return{$$typeof:f,render:U}},Ie.isValidElement=oe,Ie.lazy=function(U){return{$$typeof:g,_payload:{_status:-1,_result:U},_init:K}},Ie.memo=function(U,P){return{$$typeof:h,type:U,compare:P===void 0?null:P}},Ie.startTransition=function(U){var P=L.T,_={};L.T=_;try{var $=U(),X=L.S;X!==null&&X(_,$),typeof $=="object"&&$!==null&&typeof $.then=="function"&&$.then(z,he)}catch(ue){he(ue)}finally{P!==null&&_.types!==null&&(P.types=_.types),L.T=P}},Ie.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},Ie.use=function(U){return L.H.use(U)},Ie.useActionState=function(U,P,_){return L.H.useActionState(U,P,_)},Ie.useCallback=function(U,P){return L.H.useCallback(U,P)},Ie.useContext=function(U){return L.H.useContext(U)},Ie.useDebugValue=function(){},Ie.useDeferredValue=function(U,P){return L.H.useDeferredValue(U,P)},Ie.useEffect=function(U,P){return L.H.useEffect(U,P)},Ie.useEffectEvent=function(U){return L.H.useEffectEvent(U)},Ie.useId=function(){return L.H.useId()},Ie.useImperativeHandle=function(U,P,_){return L.H.useImperativeHandle(U,P,_)},Ie.useInsertionEffect=function(U,P){return L.H.useInsertionEffect(U,P)},Ie.useLayoutEffect=function(U,P){return L.H.useLayoutEffect(U,P)},Ie.useMemo=function(U,P){return L.H.useMemo(U,P)},Ie.useOptimistic=function(U,P){return L.H.useOptimistic(U,P)},Ie.useReducer=function(U,P,_){return L.H.useReducer(U,P,_)},Ie.useRef=function(U){return L.H.useRef(U)},Ie.useState=function(U){return L.H.useState(U)},Ie.useSyncExternalStore=function(U,P,_){return L.H.useSyncExternalStore(U,P,_)},Ie.useTransition=function(){return L.H.useTransition()},Ie.version="19.2.4",Ie}var w0;function xg(){return w0||(w0=1,Mm.exports=J_()),Mm.exports}var x=xg();const W_=$d(x),Sg=K_({__proto__:null,default:W_},[x]);var Lm={exports:{}},Ho={},Im={exports:{}},Um={};/**
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 k0;function e2(){return k0||(k0=1,(function(e){function t(H,re){var K=H.length;H.push(re);e:for(;0<K;){var he=K-1>>>1,T=H[he];if(0<l(T,re))H[he]=re,H[K]=T,K=he;else break e}}function n(H){return H.length===0?null:H[0]}function a(H){if(H.length===0)return null;var re=H[0],K=H.pop();if(K!==re){H[0]=K;e:for(var he=0,T=H.length,U=T>>>1;he<U;){var P=2*(he+1)-1,_=H[P],$=P+1,X=H[$];if(0>l(_,K))$<T&&0>l(X,_)?(H[he]=X,H[$]=K,he=$):(H[he]=_,H[P]=K,he=P);else if($<T&&0>l(X,K))H[he]=X,H[$]=K,he=$;else break e}}return re}function l(H,re){var K=H.sortIndex-re.sortIndex;return K!==0?K:H.id-re.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var m=[],h=[],g=1,y=null,b=3,S=!1,k=!1,j=!1,E=!1,C=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function M(H){for(var re=n(h);re!==null;){if(re.callback===null)a(h);else if(re.startTime<=H)a(h),re.sortIndex=re.expirationTime,t(m,re);else break;re=n(h)}}function D(H){if(j=!1,M(H),!k)if(n(m)!==null)k=!0,z||(z=!0,W());else{var re=n(h);re!==null&&ee(D,re.startTime-H)}}var z=!1,L=-1,Z=5,te=-1;function q(){return E?!0:!(e.unstable_now()-te<Z)}function oe(){if(E=!1,z){var H=e.unstable_now();te=H;var re=!0;try{e:{k=!1,j&&(j=!1,A(L),L=-1),S=!0;var K=b;try{t:{for(M(H),y=n(m);y!==null&&!(y.expirationTime>H&&q());){var he=y.callback;if(typeof he=="function"){y.callback=null,b=y.priorityLevel;var T=he(y.expirationTime<=H);if(H=e.unstable_now(),typeof T=="function"){y.callback=T,M(H),re=!0;break t}y===n(m)&&a(m),M(H)}else a(m);y=n(m)}if(y!==null)re=!0;else{var U=n(h);U!==null&&ee(D,U.startTime-H),re=!1}}break e}finally{y=null,b=K,S=!1}re=void 0}}finally{re?W():z=!1}}}var W;if(typeof O=="function")W=function(){O(oe)};else if(typeof MessageChannel<"u"){var me=new MessageChannel,fe=me.port2;me.port1.onmessage=oe,W=function(){fe.postMessage(null)}}else W=function(){C(oe,0)};function ee(H,re){L=C(function(){H(e.unstable_now())},re)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(H){H.callback=null},e.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Z=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(H){switch(b){case 1:case 2:case 3:var re=3;break;default:re=b}var K=b;b=re;try{return H()}finally{b=K}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(H,re){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var K=b;b=H;try{return re()}finally{b=K}},e.unstable_scheduleCallback=function(H,re,K){var he=e.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?he+K:he):K=he,H){case 1:var T=-1;break;case 2:T=250;break;case 5:T=1073741823;break;case 4:T=1e4;break;default:T=5e3}return T=K+T,H={id:g++,callback:re,priorityLevel:H,startTime:K,expirationTime:T,sortIndex:-1},K>he?(H.sortIndex=K,t(h,H),n(m)===null&&H===n(h)&&(j?(A(L),L=-1):j=!0,ee(D,K-he))):(H.sortIndex=T,t(m,H),k||S||(k=!0,z||(z=!0,W()))),H},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(H){var re=b;return function(){var K=b;b=re;try{return H.apply(this,arguments)}finally{b=K}}}})(Um)),Um}var j0;function t2(){return j0||(j0=1,Im.exports=e2()),Im.exports}var Pm={exports:{}},bn={};/**
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 C0;function n2(){if(C0)return bn;C0=1;var e=xg();function t(m){var h="https://react.dev/errors/"+m;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)h+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+m+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var a={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},l=Symbol.for("react.portal");function o(m,h,g){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:y==null?null:""+y,children:m,containerInfo:h,implementation:g}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(m,h){if(m==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return bn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,bn.createPortal=function(m,h){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return o(m,h,null,g)},bn.flushSync=function(m){var h=u.T,g=a.p;try{if(u.T=null,a.p=2,m)return m()}finally{u.T=h,a.p=g,a.d.f()}},bn.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))},bn.prefetchDNS=function(m){typeof m=="string"&&a.d.D(m)},bn.preinit=function(m,h){if(typeof m=="string"&&h&&typeof h.as=="string"){var g=h.as,y=f(g,h.crossOrigin),b=typeof h.integrity=="string"?h.integrity:void 0,S=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;g==="style"?a.d.S(m,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:y,integrity:b,fetchPriority:S}):g==="script"&&a.d.X(m,{crossOrigin:y,integrity:b,fetchPriority:S,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},bn.preinitModule=function(m,h){if(typeof m=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var g=f(h.as,h.crossOrigin);a.d.M(m,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&a.d.M(m)},bn.preload=function(m,h){if(typeof m=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var g=h.as,y=f(g,h.crossOrigin);a.d.L(m,g,{crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},bn.preloadModule=function(m,h){if(typeof m=="string")if(h){var g=f(h.as,h.crossOrigin);a.d.m(m,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else a.d.m(m)},bn.requestFormReset=function(m){a.d.r(m)},bn.unstable_batchedUpdates=function(m,h){return m(h)},bn.useFormState=function(m,h,g){return u.H.useFormState(m,h,g)},bn.useFormStatus=function(){return u.H.useHostTransitionStatus()},bn.version="19.2.4",bn}var E0;function cw(){if(E0)return Pm.exports;E0=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(),Pm.exports=n2(),Pm.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 N0;function r2(){if(N0)return Ho;N0=1;var e=t2(),t=xg(),n=cw();function a(r){var i="https://react.dev/errors/"+r;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)i+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+r+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function o(r){var i=r,s=r;if(r.alternate)for(;i.return;)i=i.return;else{r=i;do i=r,(i.flags&4098)!==0&&(s=i.return),r=i.return;while(r)}return i.tag===3?s:null}function u(r){if(r.tag===13){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function f(r){if(r.tag===31){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function m(r){if(o(r)!==r)throw Error(a(188))}function h(r){var i=r.alternate;if(!i){if(i=o(r),i===null)throw Error(a(188));return i!==r?null:r}for(var s=r,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 w=!1,N=p.child;N;){if(N===s){w=!0,s=p,d=v;break}if(N===d){w=!0,d=p,s=v;break}N=N.sibling}if(!w){for(N=v.child;N;){if(N===s){w=!0,s=v,d=p;break}if(N===d){w=!0,d=v,s=p;break}N=N.sibling}if(!w)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 g(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r;for(r=r.child;r!==null;){if(i=g(r),i!==null)return i;r=r.sibling}return null}var y=Object.assign,b=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),O=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),Z=Symbol.for("react.lazy"),te=Symbol.for("react.activity"),q=Symbol.for("react.memo_cache_sentinel"),oe=Symbol.iterator;function W(r){return r===null||typeof r!="object"?null:(r=oe&&r[oe]||r["@@iterator"],typeof r=="function"?r:null)}var me=Symbol.for("react.client.reference");function fe(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===me?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case j:return"Fragment";case C:return"Profiler";case E:return"StrictMode";case D:return"Suspense";case z:return"SuspenseList";case te:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case k:return"Portal";case O:return r.displayName||"Context";case A:return(r._context.displayName||"Context")+".Consumer";case M:var i=r.render;return r=r.displayName,r||(r=i.displayName||i.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case L:return i=r.displayName||null,i!==null?i:fe(r.type)||"Memo";case Z:i=r._payload,r=r._init;try{return fe(r(i))}catch{}}return null}var ee=Array.isArray,H=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K={pending:!1,data:null,method:null,action:null},he=[],T=-1;function U(r){return{current:r}}function P(r){0>T||(r.current=he[T],he[T]=null,T--)}function _(r,i){T++,he[T]=r.current,r.current=i}var $=U(null),X=U(null),ue=U(null),Se=U(null);function Me(r,i){switch(_(ue,i),_(X,r),_($,null),i.nodeType){case 9:case 11:r=(r=i.documentElement)&&(r=r.namespaceURI)?$x(r):0;break;default:if(r=i.tagName,i=i.namespaceURI)i=$x(i),r=Fx(i,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}P($),_($,r)}function ye(){P($),P(X),P(ue)}function ct(r){r.memoizedState!==null&&_(Se,r);var i=$.current,s=Fx(i,r.type);i!==s&&(_(X,r),_($,s))}function ae(r){X.current===r&&(P($),P(X)),Se.current===r&&(P(Se),Po._currentValue=K)}var De,at;function Pe(r){if(De===void 0)try{throw Error()}catch(s){var i=s.stack.trim().match(/\n( *(at )?)/);De=i&&i[1]||"",at=-1<s.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+De+r+at}var Dt=!1;function un(r,i){if(!r||Dt)return"";Dt=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(i){var ce=function(){throw Error()};if(Object.defineProperty(ce.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ce,[])}catch(J){var Y=J}Reflect.construct(r,[],ce)}else{try{ce.call()}catch(J){Y=J}r.call(ce.prototype)}}else{try{throw Error()}catch(J){Y=J}(ce=r())&&typeof ce.catch=="function"&&ce.catch(function(){})}}catch(J){if(J&&Y&&typeof J.stack=="string")return[J.stack,Y.stack]}return[null,null]}};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(),w=v[0],N=v[1];if(w&&N){var I=w.split(`
44
+ `),G=N.split(`
45
+ `);for(p=d=0;d<I.length&&!I[d].includes("DetermineComponentFrameRoot");)d++;for(;p<G.length&&!G[p].includes("DetermineComponentFrameRoot");)p++;if(d===I.length||p===G.length)for(d=I.length-1,p=G.length-1;1<=d&&0<=p&&I[d]!==G[p];)p--;for(;1<=d&&0<=p;d--,p--)if(I[d]!==G[p]){if(d!==1||p!==1)do if(d--,p--,0>p||I[d]!==G[p]){var ne=`
46
+ `+I[d].replace(" at new "," at ");return r.displayName&&ne.includes("<anonymous>")&&(ne=ne.replace("<anonymous>",r.displayName)),ne}while(1<=d&&0<=p);break}}}finally{Dt=!1,Error.prepareStackTrace=s}return(s=r?r.displayName||r.name:"")?Pe(s):""}function _a(r,i){switch(r.tag){case 26:case 27:case 5:return Pe(r.type);case 16:return Pe("Lazy");case 13:return r.child!==i&&i!==null?Pe("Suspense Fallback"):Pe("Suspense");case 19:return Pe("SuspenseList");case 0:case 15:return un(r.type,!1);case 11:return un(r.type.render,!1);case 1:return un(r.type,!0);case 31:return Pe("Activity");default:return""}}function Sl(r){try{var i="",s=null;do i+=_a(r,s),s=r,r=r.return;while(r);return i}catch(d){return`
47
+ Error generating stack: `+d.message+`
48
+ `+d.stack}}var Mr=Object.prototype.hasOwnProperty,Aa=e.unstable_scheduleCallback,Ai=e.unstable_cancelCallback,Ys=e.unstable_shouldYield,Xs=e.unstable_requestPaint,cn=e.unstable_now,Js=e.unstable_getCurrentPriorityLevel,ie=e.unstable_ImmediatePriority,ve=e.unstable_UserBlockingPriority,ze=e.unstable_NormalPriority,$e=e.unstable_LowPriority,lt=e.unstable_IdlePriority,dn=e.log,Er=e.unstable_setDisableYieldValue,an=null,Mt=null;function fn(r){if(typeof dn=="function"&&Er(r),Mt&&typeof Mt.setStrictMode=="function")try{Mt.setStrictMode(an,r)}catch{}}var ft=Math.clz32?Math.clz32:Lu,Nr=Math.log,Rn=Math.LN2;function Lu(r){return r>>>=0,r===0?32:31-(Nr(r)/Rn|0)|0}var Ti=256,zi=262144,Ri=4194304;function Lr(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 Oi(r,i,s){var d=r.pendingLanes;if(d===0)return 0;var p=0,v=r.suspendedLanes,w=r.pingedLanes;r=r.warmLanes;var N=d&134217727;return N!==0?(d=N&~v,d!==0?p=Lr(d):(w&=N,w!==0?p=Lr(w):s||(s=N&~r,s!==0&&(p=Lr(s))))):(N=d&~v,N!==0?p=Lr(N):w!==0?p=Lr(w):s||(s=d&~r,s!==0&&(p=Lr(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 be(r,i){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&i)===0}function et(r,i){switch(r){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function On(){var r=Ri;return Ri<<=1,(Ri&62914560)===0&&(Ri=4194304),r}function _r(r){for(var i=[],s=0;31>s;s++)i.push(r);return i}function Ta(r,i){r.pendingLanes|=i,i!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function Sf(r,i,s,d,p,v){var w=r.pendingLanes;r.pendingLanes=s,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=s,r.entangledLanes&=s,r.errorRecoveryDisabledLanes&=s,r.shellSuspendCounter=0;var N=r.entanglements,I=r.expirationTimes,G=r.hiddenUpdates;for(s=w&~s;0<s;){var ne=31-ft(s),ce=1<<ne;N[ne]=0,I[ne]=-1;var Y=G[ne];if(Y!==null)for(G[ne]=null,ne=0;ne<Y.length;ne++){var J=Y[ne];J!==null&&(J.lane&=-536870913)}s&=~ce}d!==0&&ky(r,d,0),v!==0&&p===0&&r.tag!==0&&(r.suspendedLanes|=v&~(w&~i))}function ky(r,i,s){r.pendingLanes|=i,r.suspendedLanes&=~i;var d=31-ft(i);r.entangledLanes|=i,r.entanglements[d]=r.entanglements[d]|1073741824|s&261930}function jy(r,i){var s=r.entangledLanes|=i;for(r=r.entanglements;s;){var d=31-ft(s),p=1<<d;p&i|r[d]&i&&(r[d]|=i),s&=~p}}function Cy(r,i){var s=i&-i;return s=(s&42)!==0?1:wf(s),(s&(r.suspendedLanes|i))!==0?0:s}function wf(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 kf(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function Ey(){var r=re.p;return r!==0?r:(r=window.event,r===void 0?32:d0(r.type))}function Ny(r,i){var s=re.p;try{return re.p=r,i()}finally{re.p=s}}var za=Math.random().toString(36).slice(2),hn="__reactFiber$"+za,Dn="__reactProps$"+za,wl="__reactContainer$"+za,jf="__reactEvents$"+za,UE="__reactListeners$"+za,PE="__reactHandles$"+za,_y="__reactResources$"+za,Ws="__reactMarker$"+za;function Cf(r){delete r[hn],delete r[Dn],delete r[jf],delete r[UE],delete r[PE]}function kl(r){var i=r[hn];if(i)return i;for(var s=r.parentNode;s;){if(i=s[wl]||s[hn]){if(s=i.alternate,i.child!==null||s!==null&&s.child!==null)for(r=Kx(r);r!==null;){if(s=r[hn])return s;r=Kx(r)}return i}r=s,s=r.parentNode}return null}function jl(r){if(r=r[hn]||r[wl]){var i=r.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return r}return null}function eo(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r.stateNode;throw Error(a(33))}function Cl(r){var i=r[_y];return i||(i=r[_y]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function ln(r){r[Ws]=!0}var Ay=new Set,Ty={};function Di(r,i){El(r,i),El(r+"Capture",i)}function El(r,i){for(Ty[r]=i,r=0;r<i.length;r++)Ay.add(i[r])}var BE=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]*$"),zy={},Ry={};function $E(r){return Mr.call(Ry,r)?!0:Mr.call(zy,r)?!1:BE.test(r)?Ry[r]=!0:(zy[r]=!0,!1)}function Iu(r,i,s){if($E(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 Uu(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 Xr(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 or(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function Oy(r){var i=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function FE(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(w){s=""+w,v.call(this,w)}}),Object.defineProperty(r,i,{enumerable:d.enumerable}),{getValue:function(){return s},setValue:function(w){s=""+w},stopTracking:function(){r._valueTracker=null,delete r[i]}}}}function Ef(r){if(!r._valueTracker){var i=Oy(r)?"checked":"value";r._valueTracker=FE(r,i,""+r[i])}}function Dy(r){if(!r)return!1;var i=r._valueTracker;if(!i)return!0;var s=i.getValue(),d="";return r&&(d=Oy(r)?r.checked?"true":"false":r.value),r=d,r!==s?(i.setValue(r),!0):!1}function Pu(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 qE=/[\n"\\]/g;function ur(r){return r.replace(qE,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Nf(r,i,s,d,p,v,w,N){r.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?r.type=w:r.removeAttribute("type"),i!=null?w==="number"?(i===0&&r.value===""||r.value!=i)&&(r.value=""+or(i)):r.value!==""+or(i)&&(r.value=""+or(i)):w!=="submit"&&w!=="reset"||r.removeAttribute("value"),i!=null?_f(r,w,or(i)):s!=null?_f(r,w,or(s)):d!=null&&r.removeAttribute("value"),p==null&&v!=null&&(r.defaultChecked=!!v),p!=null&&(r.checked=p&&typeof p!="function"&&typeof p!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?r.name=""+or(N):r.removeAttribute("name")}function My(r,i,s,d,p,v,w,N){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(r.type=v),i!=null||s!=null){if(!(v!=="submit"&&v!=="reset"||i!=null)){Ef(r);return}s=s!=null?""+or(s):"",i=i!=null?""+or(i):s,N||i===r.value||(r.value=i),r.defaultValue=i}d=d??p,d=typeof d!="function"&&typeof d!="symbol"&&!!d,r.checked=N?r.checked:!!d,r.defaultChecked=!!d,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(r.name=w),Ef(r)}function _f(r,i,s){i==="number"&&Pu(r.ownerDocument)===r||r.defaultValue===""+s||(r.defaultValue=""+s)}function Nl(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=""+or(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 Ly(r,i,s){if(i!=null&&(i=""+or(i),i!==r.value&&(r.value=i),s==null)){r.defaultValue!==i&&(r.defaultValue=i);return}r.defaultValue=s!=null?""+or(s):""}function Iy(r,i,s,d){if(i==null){if(d!=null){if(s!=null)throw Error(a(92));if(ee(d)){if(1<d.length)throw Error(a(93));d=d[0]}s=d}s==null&&(s=""),i=s}s=or(i),r.defaultValue=s,d=r.textContent,d===s&&d!==""&&d!==null&&(r.value=d),Ef(r)}function _l(r,i){if(i){var s=r.firstChild;if(s&&s===r.lastChild&&s.nodeType===3){s.nodeValue=i;return}}r.textContent=i}var HE=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 Uy(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||HE.has(i)?i==="float"?r.cssFloat=s:r[i]=(""+s).trim():r[i]=s+"px"}function Py(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&&Uy(r,p,d)}else for(var v in i)i.hasOwnProperty(v)&&Uy(r,v,i[v])}function Af(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 ZE=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"]]),VE=/^[\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 Bu(r){return VE.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function Jr(){}var Tf=null;function zf(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Al=null,Tl=null;function By(r){var i=jl(r);if(i&&(r=i.stateNode)){var s=r[Dn]||null;e:switch(r=i.stateNode,i.type){case"input":if(Nf(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="'+ur(""+i)+'"][type="radio"]'),i=0;i<s.length;i++){var d=s[i];if(d!==r&&d.form===r.form){var p=d[Dn]||null;if(!p)throw Error(a(90));Nf(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&&Dy(d)}break e;case"textarea":Ly(r,s.value,s.defaultValue);break e;case"select":i=s.value,i!=null&&Nl(r,!!s.multiple,i,!1)}}}var Rf=!1;function $y(r,i,s){if(Rf)return r(i,s);Rf=!0;try{var d=r(i);return d}finally{if(Rf=!1,(Al!==null||Tl!==null)&&(Nc(),Al&&(i=Al,r=Tl,Tl=Al=null,By(i),r)))for(i=0;i<r.length;i++)By(r[i])}}function to(r,i){var s=r.stateNode;if(s===null)return null;var d=s[Dn]||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 Wr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Of=!1;if(Wr)try{var no={};Object.defineProperty(no,"passive",{get:function(){Of=!0}}),window.addEventListener("test",no,no),window.removeEventListener("test",no,no)}catch{Of=!1}var Ra=null,Df=null,$u=null;function Fy(){if($u)return $u;var r,i=Df,s=i.length,d,p="value"in Ra?Ra.value:Ra.textContent,v=p.length;for(r=0;r<s&&i[r]===p[r];r++);var w=s-r;for(d=1;d<=w&&i[s-d]===p[v-d];d++);return $u=p.slice(r,1<d?1-d:void 0)}function Fu(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 qu(){return!0}function qy(){return!1}function Mn(r){function i(s,d,p,v,w){this._reactName=s,this._targetInst=p,this.type=d,this.nativeEvent=v,this.target=w,this.currentTarget=null;for(var N in r)r.hasOwnProperty(N)&&(s=r[N],this[N]=s?s(v):v[N]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?qu:qy,this.isPropagationStopped=qy,this}return y(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=qu)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=qu)},persist:function(){},isPersistent:qu}),i}var Mi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Hu=Mn(Mi),ro=y({},Mi,{view:0,detail:0}),QE=Mn(ro),Mf,Lf,ao,Zu=y({},ro,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Uf,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!==ao&&(ao&&r.type==="mousemove"?(Mf=r.screenX-ao.screenX,Lf=r.screenY-ao.screenY):Lf=Mf=0,ao=r),Mf)},movementY:function(r){return"movementY"in r?r.movementY:Lf}}),Hy=Mn(Zu),GE=y({},Zu,{dataTransfer:0}),KE=Mn(GE),YE=y({},ro,{relatedTarget:0}),If=Mn(YE),XE=y({},Mi,{animationName:0,elapsedTime:0,pseudoElement:0}),JE=Mn(XE),WE=y({},Mi,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),eN=Mn(WE),tN=y({},Mi,{data:0}),Zy=Mn(tN),nN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},rN={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"},aN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function iN(r){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(r):(r=aN[r])?!!i[r]:!1}function Uf(){return iN}var lN=y({},ro,{key:function(r){if(r.key){var i=nN[r.key]||r.key;if(i!=="Unidentified")return i}return r.type==="keypress"?(r=Fu(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?rN[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Uf,charCode:function(r){return r.type==="keypress"?Fu(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?Fu(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),sN=Mn(lN),oN=y({},Zu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Vy=Mn(oN),uN=y({},ro,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Uf}),cN=Mn(uN),dN=y({},Mi,{propertyName:0,elapsedTime:0,pseudoElement:0}),fN=Mn(dN),hN=y({},Zu,{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}),mN=Mn(hN),pN=y({},Mi,{newState:0,oldState:0}),gN=Mn(pN),yN=[9,13,27,32],Pf=Wr&&"CompositionEvent"in window,io=null;Wr&&"documentMode"in document&&(io=document.documentMode);var vN=Wr&&"TextEvent"in window&&!io,Qy=Wr&&(!Pf||io&&8<io&&11>=io),Gy=" ",Ky=!1;function Yy(r,i){switch(r){case"keyup":return yN.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Xy(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var zl=!1;function bN(r,i){switch(r){case"compositionend":return Xy(i);case"keypress":return i.which!==32?null:(Ky=!0,Gy);case"textInput":return r=i.data,r===Gy&&Ky?null:r;default:return null}}function xN(r,i){if(zl)return r==="compositionend"||!Pf&&Yy(r,i)?(r=Fy(),$u=Df=Ra=null,zl=!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 Qy&&i.locale!=="ko"?null:i.data;default:return null}}var SN={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Jy(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i==="input"?!!SN[r.type]:i==="textarea"}function Wy(r,i,s,d){Al?Tl?Tl.push(d):Tl=[d]:Al=d,i=Dc(i,"onChange"),0<i.length&&(s=new Hu("onChange","change",null,s,d),r.push({event:s,listeners:i}))}var lo=null,so=null;function wN(r){Mx(r,0)}function Vu(r){var i=eo(r);if(Dy(i))return r}function ev(r,i){if(r==="change")return i}var tv=!1;if(Wr){var Bf;if(Wr){var $f="oninput"in document;if(!$f){var nv=document.createElement("div");nv.setAttribute("oninput","return;"),$f=typeof nv.oninput=="function"}Bf=$f}else Bf=!1;tv=Bf&&(!document.documentMode||9<document.documentMode)}function rv(){lo&&(lo.detachEvent("onpropertychange",av),so=lo=null)}function av(r){if(r.propertyName==="value"&&Vu(so)){var i=[];Wy(i,so,r,zf(r)),$y(wN,i)}}function kN(r,i,s){r==="focusin"?(rv(),lo=i,so=s,lo.attachEvent("onpropertychange",av)):r==="focusout"&&rv()}function jN(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return Vu(so)}function CN(r,i){if(r==="click")return Vu(i)}function EN(r,i){if(r==="input"||r==="change")return Vu(i)}function NN(r,i){return r===i&&(r!==0||1/r===1/i)||r!==r&&i!==i}var Gn=typeof Object.is=="function"?Object.is:NN;function oo(r,i){if(Gn(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(!Mr.call(i,p)||!Gn(r[p],i[p]))return!1}return!0}function iv(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function lv(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 sv(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?sv(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function ov(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var i=Pu(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=Pu(r.document)}return i}function Ff(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 _N=Wr&&"documentMode"in document&&11>=document.documentMode,Rl=null,qf=null,uo=null,Hf=!1;function uv(r,i,s){var d=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Hf||Rl==null||Rl!==Pu(d)||(d=Rl,"selectionStart"in d&&Ff(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}),uo&&oo(uo,d)||(uo=d,d=Dc(qf,"onSelect"),0<d.length&&(i=new Hu("onSelect","select",null,i,s),r.push({event:i,listeners:d}),i.target=Rl)))}function Li(r,i){var s={};return s[r.toLowerCase()]=i.toLowerCase(),s["Webkit"+r]="webkit"+i,s["Moz"+r]="moz"+i,s}var Ol={animationend:Li("Animation","AnimationEnd"),animationiteration:Li("Animation","AnimationIteration"),animationstart:Li("Animation","AnimationStart"),transitionrun:Li("Transition","TransitionRun"),transitionstart:Li("Transition","TransitionStart"),transitioncancel:Li("Transition","TransitionCancel"),transitionend:Li("Transition","TransitionEnd")},Zf={},cv={};Wr&&(cv=document.createElement("div").style,"AnimationEvent"in window||(delete Ol.animationend.animation,delete Ol.animationiteration.animation,delete Ol.animationstart.animation),"TransitionEvent"in window||delete Ol.transitionend.transition);function Ii(r){if(Zf[r])return Zf[r];if(!Ol[r])return r;var i=Ol[r],s;for(s in i)if(i.hasOwnProperty(s)&&s in cv)return Zf[r]=i[s];return r}var dv=Ii("animationend"),fv=Ii("animationiteration"),hv=Ii("animationstart"),AN=Ii("transitionrun"),TN=Ii("transitionstart"),zN=Ii("transitioncancel"),mv=Ii("transitionend"),pv=new Map,Vf="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(" ");Vf.push("scrollEnd");function Ar(r,i){pv.set(r,i),Di(i,[r])}var Qu=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)},cr=[],Dl=0,Qf=0;function Gu(){for(var r=Dl,i=Qf=Dl=0;i<r;){var s=cr[i];cr[i++]=null;var d=cr[i];cr[i++]=null;var p=cr[i];cr[i++]=null;var v=cr[i];if(cr[i++]=null,d!==null&&p!==null){var w=d.pending;w===null?p.next=p:(p.next=w.next,w.next=p),d.pending=p}v!==0&&gv(s,p,v)}}function Ku(r,i,s,d){cr[Dl++]=r,cr[Dl++]=i,cr[Dl++]=s,cr[Dl++]=d,Qf|=d,r.lanes|=d,r=r.alternate,r!==null&&(r.lanes|=d)}function Gf(r,i,s,d){return Ku(r,i,s,d),Yu(r)}function Ui(r,i){return Ku(r,null,null,i),Yu(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-ft(s),r=v.hiddenUpdates,d=r[p],d===null?r[p]=[i]:d.push(i),i.lane=s|536870912),v):null}function Yu(r){if(50<Ro)throw Ro=0,rm=null,Error(a(185));for(var i=r.return;i!==null;)r=i,i=r.return;return r.tag===3?r.stateNode:null}var Ml={};function RN(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 Kn(r,i,s,d){return new RN(r,i,s,d)}function Kf(r){return r=r.prototype,!(!r||!r.isReactComponent)}function ea(r,i){var s=r.alternate;return s===null?(s=Kn(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 yv(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 Xu(r,i,s,d,p,v){var w=0;if(d=r,typeof r=="function")Kf(r)&&(w=1);else if(typeof r=="string")w=I_(r,s,$.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case te:return r=Kn(31,s,i,p),r.elementType=te,r.lanes=v,r;case j:return Pi(s.children,p,v,i);case E:w=8,p|=24;break;case C:return r=Kn(12,s,i,p|2),r.elementType=C,r.lanes=v,r;case D:return r=Kn(13,s,i,p),r.elementType=D,r.lanes=v,r;case z:return r=Kn(19,s,i,p),r.elementType=z,r.lanes=v,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case O:w=10;break e;case A:w=9;break e;case M:w=11;break e;case L:w=14;break e;case Z:w=16,d=null;break e}w=29,s=Error(a(130,r===null?"null":typeof r,"")),d=null}return i=Kn(w,s,i,p),i.elementType=r,i.type=d,i.lanes=v,i}function Pi(r,i,s,d){return r=Kn(7,r,d,i),r.lanes=s,r}function Yf(r,i,s){return r=Kn(6,r,null,i),r.lanes=s,r}function vv(r){var i=Kn(18,null,null,0);return i.stateNode=r,i}function Xf(r,i,s){return i=Kn(4,r.children!==null?r.children:[],r.key,i),i.lanes=s,i.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},i}var bv=new WeakMap;function dr(r,i){if(typeof r=="object"&&r!==null){var s=bv.get(r);return s!==void 0?s:(i={value:r,source:i,stack:Sl(i)},bv.set(r,i),i)}return{value:r,source:i,stack:Sl(i)}}var Ll=[],Il=0,Ju=null,co=0,fr=[],hr=0,Oa=null,Ir=1,Ur="";function ta(r,i){Ll[Il++]=co,Ll[Il++]=Ju,Ju=r,co=i}function xv(r,i,s){fr[hr++]=Ir,fr[hr++]=Ur,fr[hr++]=Oa,Oa=r;var d=Ir;r=Ur;var p=32-ft(d)-1;d&=~(1<<p),s+=1;var v=32-ft(i)+p;if(30<v){var w=p-p%5;v=(d&(1<<w)-1).toString(32),d>>=w,p-=w,Ir=1<<32-ft(i)+p|s<<p|d,Ur=v+r}else Ir=1<<v|s<<p|d,Ur=r}function Jf(r){r.return!==null&&(ta(r,1),xv(r,1,0))}function Wf(r){for(;r===Ju;)Ju=Ll[--Il],Ll[Il]=null,co=Ll[--Il],Ll[Il]=null;for(;r===Oa;)Oa=fr[--hr],fr[hr]=null,Ur=fr[--hr],fr[hr]=null,Ir=fr[--hr],fr[hr]=null}function Sv(r,i){fr[hr++]=Ir,fr[hr++]=Ur,fr[hr++]=Oa,Ir=i.id,Ur=i.overflow,Oa=r}var mn=null,Et=null,tt=!1,Da=null,mr=!1,eh=Error(a(519));function Ma(r){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw fo(dr(i,r)),eh}function wv(r){var i=r.stateNode,s=r.type,d=r.memoizedProps;switch(i[hn]=r,i[Dn]=d,s){case"dialog":Ye("cancel",i),Ye("close",i);break;case"iframe":case"object":case"embed":Ye("load",i);break;case"video":case"audio":for(s=0;s<Do.length;s++)Ye(Do[s],i);break;case"source":Ye("error",i);break;case"img":case"image":case"link":Ye("error",i),Ye("load",i);break;case"details":Ye("toggle",i);break;case"input":Ye("invalid",i),My(i,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0);break;case"select":Ye("invalid",i);break;case"textarea":Ye("invalid",i),Iy(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||Px(i.textContent,s)?(d.popover!=null&&(Ye("beforetoggle",i),Ye("toggle",i)),d.onScroll!=null&&Ye("scroll",i),d.onScrollEnd!=null&&Ye("scrollend",i),d.onClick!=null&&(i.onclick=Jr),i=!0):i=!1,i||Ma(r,!0)}function kv(r){for(mn=r.return;mn;)switch(mn.tag){case 5:case 31:case 13:mr=!1;return;case 27:case 3:mr=!0;return;default:mn=mn.return}}function Ul(r){if(r!==mn)return!1;if(!tt)return kv(r),tt=!0,!1;var i=r.tag,s;if((s=i!==3&&i!==27)&&((s=i===5)&&(s=r.type,s=!(s!=="form"&&s!=="button")||vm(r.type,r.memoizedProps)),s=!s),s&&Et&&Ma(r),kv(r),i===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));Et=Gx(r)}else if(i===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));Et=Gx(r)}else i===27?(i=Et,Ka(r.type)?(r=km,km=null,Et=r):Et=i):Et=mn?gr(r.stateNode.nextSibling):null;return!0}function Bi(){Et=mn=null,tt=!1}function th(){var r=Da;return r!==null&&(Pn===null?Pn=r:Pn.push.apply(Pn,r),Da=null),r}function fo(r){Da===null?Da=[r]:Da.push(r)}var nh=U(null),$i=null,na=null;function La(r,i,s){_(nh,i._currentValue),i._currentValue=s}function ra(r){r._currentValue=nh.current,P(nh)}function rh(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 ah(r,i,s,d){var p=r.child;for(p!==null&&(p.return=r);p!==null;){var v=p.dependencies;if(v!==null){var w=p.child;v=v.firstContext;e:for(;v!==null;){var N=v;v=p;for(var I=0;I<i.length;I++)if(N.context===i[I]){v.lanes|=s,N=v.alternate,N!==null&&(N.lanes|=s),rh(v.return,s,r),d||(w=null);break e}v=N.next}}else if(p.tag===18){if(w=p.return,w===null)throw Error(a(341));w.lanes|=s,v=w.alternate,v!==null&&(v.lanes|=s),rh(w,s,r),w=null}else w=p.child;if(w!==null)w.return=p;else for(w=p;w!==null;){if(w===r){w=null;break}if(p=w.sibling,p!==null){p.return=w.return,w=p;break}w=w.return}p=w}}function Pl(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 w=p.alternate;if(w===null)throw Error(a(387));if(w=w.memoizedProps,w!==null){var N=p.type;Gn(p.pendingProps.value,w.value)||(r!==null?r.push(N):r=[N])}}else if(p===Se.current){if(w=p.alternate,w===null)throw Error(a(387));w.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(r!==null?r.push(Po):r=[Po])}p=p.return}r!==null&&ah(i,r,s,d),i.flags|=262144}function Wu(r){for(r=r.firstContext;r!==null;){if(!Gn(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function Fi(r){$i=r,na=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function pn(r){return jv($i,r)}function ec(r,i){return $i===null&&Fi(r),jv(r,i)}function jv(r,i){var s=i._currentValue;if(i={context:i,memoizedValue:s,next:null},na===null){if(r===null)throw Error(a(308));na=i,r.dependencies={lanes:0,firstContext:i},r.flags|=524288}else na=na.next=i;return s}var ON=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()})}},DN=e.unstable_scheduleCallback,MN=e.unstable_NormalPriority,Zt={$$typeof:O,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ih(){return{controller:new ON,data:new Map,refCount:0}}function ho(r){r.refCount--,r.refCount===0&&DN(MN,function(){r.controller.abort()})}var mo=null,lh=0,Bl=0,$l=null;function LN(r,i){if(mo===null){var s=mo=[];lh=0,Bl=um(),$l={status:"pending",value:void 0,then:function(d){s.push(d)}}}return lh++,i.then(Cv,Cv),i}function Cv(){if(--lh===0&&mo!==null){$l!==null&&($l.status="fulfilled");var r=mo;mo=null,Bl=0,$l=null;for(var i=0;i<r.length;i++)(0,r[i])()}}function IN(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 Ev=H.S;H.S=function(r,i){ux=cn(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&LN(r,i),Ev!==null&&Ev(r,i)};var qi=U(null);function sh(){var r=qi.current;return r!==null?r:kt.pooledCache}function tc(r,i){i===null?_(qi,qi.current):_(qi,i.pool)}function Nv(){var r=sh();return r===null?null:{parent:Zt._currentValue,pool:r}}var Fl=Error(a(460)),oh=Error(a(474)),nc=Error(a(542)),rc={then:function(){}};function _v(r){return r=r.status,r==="fulfilled"||r==="rejected"}function Av(r,i,s){switch(s=r[s],s===void 0?r.push(i):s!==i&&(i.then(Jr,Jr),i=s),i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,zv(r),r;default:if(typeof i.status=="string")i.then(Jr,Jr);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,zv(r),r}throw Zi=i,Fl}}function Hi(r){try{var i=r._init;return i(r._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Zi=s,Fl):s}}var Zi=null;function Tv(){if(Zi===null)throw Error(a(459));var r=Zi;return Zi=null,r}function zv(r){if(r===Fl||r===nc)throw Error(a(483))}var ql=null,po=0;function ac(r){var i=po;return po+=1,ql===null&&(ql=[]),Av(ql,r,i)}function go(r,i){i=i.props.ref,r.ref=i!==void 0?i:null}function ic(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 Rv(r){function i(V,F){if(r){var Q=V.deletions;Q===null?(V.deletions=[F],V.flags|=16):Q.push(F)}}function s(V,F){if(!r)return null;for(;F!==null;)i(V,F),F=F.sibling;return null}function d(V){for(var F=new Map;V!==null;)V.key!==null?F.set(V.key,V):F.set(V.index,V),V=V.sibling;return F}function p(V,F){return V=ea(V,F),V.index=0,V.sibling=null,V}function v(V,F,Q){return V.index=Q,r?(Q=V.alternate,Q!==null?(Q=Q.index,Q<F?(V.flags|=67108866,F):Q):(V.flags|=67108866,F)):(V.flags|=1048576,F)}function w(V){return r&&V.alternate===null&&(V.flags|=67108866),V}function N(V,F,Q,se){return F===null||F.tag!==6?(F=Yf(Q,V.mode,se),F.return=V,F):(F=p(F,Q),F.return=V,F)}function I(V,F,Q,se){var Te=Q.type;return Te===j?ne(V,F,Q.props.children,se,Q.key):F!==null&&(F.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===Z&&Hi(Te)===F.type)?(F=p(F,Q.props),go(F,Q),F.return=V,F):(F=Xu(Q.type,Q.key,Q.props,null,V.mode,se),go(F,Q),F.return=V,F)}function G(V,F,Q,se){return F===null||F.tag!==4||F.stateNode.containerInfo!==Q.containerInfo||F.stateNode.implementation!==Q.implementation?(F=Xf(Q,V.mode,se),F.return=V,F):(F=p(F,Q.children||[]),F.return=V,F)}function ne(V,F,Q,se,Te){return F===null||F.tag!==7?(F=Pi(Q,V.mode,se,Te),F.return=V,F):(F=p(F,Q),F.return=V,F)}function ce(V,F,Q){if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return F=Yf(""+F,V.mode,Q),F.return=V,F;if(typeof F=="object"&&F!==null){switch(F.$$typeof){case S:return Q=Xu(F.type,F.key,F.props,null,V.mode,Q),go(Q,F),Q.return=V,Q;case k:return F=Xf(F,V.mode,Q),F.return=V,F;case Z:return F=Hi(F),ce(V,F,Q)}if(ee(F)||W(F))return F=Pi(F,V.mode,Q,null),F.return=V,F;if(typeof F.then=="function")return ce(V,ac(F),Q);if(F.$$typeof===O)return ce(V,ec(V,F),Q);ic(V,F)}return null}function Y(V,F,Q,se){var Te=F!==null?F.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Te!==null?null:N(V,F,""+Q,se);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case S:return Q.key===Te?I(V,F,Q,se):null;case k:return Q.key===Te?G(V,F,Q,se):null;case Z:return Q=Hi(Q),Y(V,F,Q,se)}if(ee(Q)||W(Q))return Te!==null?null:ne(V,F,Q,se,null);if(typeof Q.then=="function")return Y(V,F,ac(Q),se);if(Q.$$typeof===O)return Y(V,F,ec(V,Q),se);ic(V,Q)}return null}function J(V,F,Q,se,Te){if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return V=V.get(Q)||null,N(F,V,""+se,Te);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case S:return V=V.get(se.key===null?Q:se.key)||null,I(F,V,se,Te);case k:return V=V.get(se.key===null?Q:se.key)||null,G(F,V,se,Te);case Z:return se=Hi(se),J(V,F,Q,se,Te)}if(ee(se)||W(se))return V=V.get(Q)||null,ne(F,V,se,Te,null);if(typeof se.then=="function")return J(V,F,Q,ac(se),Te);if(se.$$typeof===O)return J(V,F,Q,ec(F,se),Te);ic(F,se)}return null}function we(V,F,Q,se){for(var Te=null,ot=null,Ee=F,Fe=F=0,We=null;Ee!==null&&Fe<Q.length;Fe++){Ee.index>Fe?(We=Ee,Ee=null):We=Ee.sibling;var ut=Y(V,Ee,Q[Fe],se);if(ut===null){Ee===null&&(Ee=We);break}r&&Ee&&ut.alternate===null&&i(V,Ee),F=v(ut,F,Fe),ot===null?Te=ut:ot.sibling=ut,ot=ut,Ee=We}if(Fe===Q.length)return s(V,Ee),tt&&ta(V,Fe),Te;if(Ee===null){for(;Fe<Q.length;Fe++)Ee=ce(V,Q[Fe],se),Ee!==null&&(F=v(Ee,F,Fe),ot===null?Te=Ee:ot.sibling=Ee,ot=Ee);return tt&&ta(V,Fe),Te}for(Ee=d(Ee);Fe<Q.length;Fe++)We=J(Ee,V,Fe,Q[Fe],se),We!==null&&(r&&We.alternate!==null&&Ee.delete(We.key===null?Fe:We.key),F=v(We,F,Fe),ot===null?Te=We:ot.sibling=We,ot=We);return r&&Ee.forEach(function(ei){return i(V,ei)}),tt&&ta(V,Fe),Te}function Oe(V,F,Q,se){if(Q==null)throw Error(a(151));for(var Te=null,ot=null,Ee=F,Fe=F=0,We=null,ut=Q.next();Ee!==null&&!ut.done;Fe++,ut=Q.next()){Ee.index>Fe?(We=Ee,Ee=null):We=Ee.sibling;var ei=Y(V,Ee,ut.value,se);if(ei===null){Ee===null&&(Ee=We);break}r&&Ee&&ei.alternate===null&&i(V,Ee),F=v(ei,F,Fe),ot===null?Te=ei:ot.sibling=ei,ot=ei,Ee=We}if(ut.done)return s(V,Ee),tt&&ta(V,Fe),Te;if(Ee===null){for(;!ut.done;Fe++,ut=Q.next())ut=ce(V,ut.value,se),ut!==null&&(F=v(ut,F,Fe),ot===null?Te=ut:ot.sibling=ut,ot=ut);return tt&&ta(V,Fe),Te}for(Ee=d(Ee);!ut.done;Fe++,ut=Q.next())ut=J(Ee,V,Fe,ut.value,se),ut!==null&&(r&&ut.alternate!==null&&Ee.delete(ut.key===null?Fe:ut.key),F=v(ut,F,Fe),ot===null?Te=ut:ot.sibling=ut,ot=ut);return r&&Ee.forEach(function(G_){return i(V,G_)}),tt&&ta(V,Fe),Te}function xt(V,F,Q,se){if(typeof Q=="object"&&Q!==null&&Q.type===j&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case S:e:{for(var Te=Q.key;F!==null;){if(F.key===Te){if(Te=Q.type,Te===j){if(F.tag===7){s(V,F.sibling),se=p(F,Q.props.children),se.return=V,V=se;break e}}else if(F.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===Z&&Hi(Te)===F.type){s(V,F.sibling),se=p(F,Q.props),go(se,Q),se.return=V,V=se;break e}s(V,F);break}else i(V,F);F=F.sibling}Q.type===j?(se=Pi(Q.props.children,V.mode,se,Q.key),se.return=V,V=se):(se=Xu(Q.type,Q.key,Q.props,null,V.mode,se),go(se,Q),se.return=V,V=se)}return w(V);case k:e:{for(Te=Q.key;F!==null;){if(F.key===Te)if(F.tag===4&&F.stateNode.containerInfo===Q.containerInfo&&F.stateNode.implementation===Q.implementation){s(V,F.sibling),se=p(F,Q.children||[]),se.return=V,V=se;break e}else{s(V,F);break}else i(V,F);F=F.sibling}se=Xf(Q,V.mode,se),se.return=V,V=se}return w(V);case Z:return Q=Hi(Q),xt(V,F,Q,se)}if(ee(Q))return we(V,F,Q,se);if(W(Q)){if(Te=W(Q),typeof Te!="function")throw Error(a(150));return Q=Te.call(Q),Oe(V,F,Q,se)}if(typeof Q.then=="function")return xt(V,F,ac(Q),se);if(Q.$$typeof===O)return xt(V,F,ec(V,Q),se);ic(V,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,F!==null&&F.tag===6?(s(V,F.sibling),se=p(F,Q),se.return=V,V=se):(s(V,F),se=Yf(Q,V.mode,se),se.return=V,V=se),w(V)):s(V,F)}return function(V,F,Q,se){try{po=0;var Te=xt(V,F,Q,se);return ql=null,Te}catch(Ee){if(Ee===Fl||Ee===nc)throw Ee;var ot=Kn(29,Ee,null,V.mode);return ot.lanes=se,ot.return=V,ot}finally{}}}var Vi=Rv(!0),Ov=Rv(!1),Ia=!1;function uh(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ch(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 Ua(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function Pa(r,i,s){var d=r.updateQueue;if(d===null)return null;if(d=d.shared,(dt&2)!==0){var p=d.pending;return p===null?i.next=i:(i.next=p.next,p.next=i),d.pending=i,i=Yu(r),gv(r,null,s),i}return Ku(r,d,i,s),Yu(r)}function yo(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,jy(r,s)}}function dh(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 w={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};v===null?p=v=w:v=v.next=w,s=s.next}while(s!==null);v===null?p=v=i:v=v.next=i}else p=v=i;s={baseState: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 fh=!1;function vo(){if(fh){var r=$l;if(r!==null)throw r}}function bo(r,i,s,d){fh=!1;var p=r.updateQueue;Ia=!1;var v=p.firstBaseUpdate,w=p.lastBaseUpdate,N=p.shared.pending;if(N!==null){p.shared.pending=null;var I=N,G=I.next;I.next=null,w===null?v=G:w.next=G,w=I;var ne=r.alternate;ne!==null&&(ne=ne.updateQueue,N=ne.lastBaseUpdate,N!==w&&(N===null?ne.firstBaseUpdate=G:N.next=G,ne.lastBaseUpdate=I))}if(v!==null){var ce=p.baseState;w=0,ne=G=I=null,N=v;do{var Y=N.lane&-536870913,J=Y!==N.lane;if(J?(Je&Y)===Y:(d&Y)===Y){Y!==0&&Y===Bl&&(fh=!0),ne!==null&&(ne=ne.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var we=r,Oe=N;Y=i;var xt=s;switch(Oe.tag){case 1:if(we=Oe.payload,typeof we=="function"){ce=we.call(xt,ce,Y);break e}ce=we;break e;case 3:we.flags=we.flags&-65537|128;case 0:if(we=Oe.payload,Y=typeof we=="function"?we.call(xt,ce,Y):we,Y==null)break e;ce=y({},ce,Y);break e;case 2:Ia=!0}}Y=N.callback,Y!==null&&(r.flags|=64,J&&(r.flags|=8192),J=p.callbacks,J===null?p.callbacks=[Y]:J.push(Y))}else J={lane:Y,tag:N.tag,payload:N.payload,callback:N.callback,next:null},ne===null?(G=ne=J,I=ce):ne=ne.next=J,w|=Y;if(N=N.next,N===null){if(N=p.shared.pending,N===null)break;J=N,N=J.next,J.next=null,p.lastBaseUpdate=J,p.shared.pending=null}}while(!0);ne===null&&(I=ce),p.baseState=I,p.firstBaseUpdate=G,p.lastBaseUpdate=ne,v===null&&(p.shared.lanes=0),Ha|=w,r.lanes=w,r.memoizedState=ce}}function Dv(r,i){if(typeof r!="function")throw Error(a(191,r));r.call(i)}function Mv(r,i){var s=r.callbacks;if(s!==null)for(r.callbacks=null,r=0;r<s.length;r++)Dv(s[r],i)}var Hl=U(null),lc=U(0);function Lv(r,i){r=fa,_(lc,r),_(Hl,i),fa=r|i.baseLanes}function hh(){_(lc,fa),_(Hl,Hl.current)}function mh(){fa=lc.current,P(Hl),P(lc)}var Yn=U(null),pr=null;function Ba(r){var i=r.alternate;_(Bt,Bt.current&1),_(Yn,r),pr===null&&(i===null||Hl.current!==null||i.memoizedState!==null)&&(pr=r)}function ph(r){_(Bt,Bt.current),_(Yn,r),pr===null&&(pr=r)}function Iv(r){r.tag===22?(_(Bt,Bt.current),_(Yn,r),pr===null&&(pr=r)):$a()}function $a(){_(Bt,Bt.current),_(Yn,Yn.current)}function Xn(r){P(Yn),pr===r&&(pr=null),P(Bt)}var Bt=U(0);function sc(r){for(var i=r;i!==null;){if(i.tag===13){var s=i.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Sm(s)||wm(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 aa=0,Be=null,vt=null,Vt=null,oc=!1,Zl=!1,Qi=!1,uc=0,xo=0,Vl=null,UN=0;function Lt(){throw Error(a(321))}function gh(r,i){if(i===null)return!1;for(var s=0;s<i.length&&s<r.length;s++)if(!Gn(r[s],i[s]))return!1;return!0}function yh(r,i,s,d,p,v){return aa=v,Be=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,H.H=r===null||r.memoizedState===null?xb:Rh,Qi=!1,v=s(d,p),Qi=!1,Zl&&(v=Pv(i,s,d,p)),Uv(r),v}function Uv(r){H.H=ko;var i=vt!==null&&vt.next!==null;if(aa=0,Vt=vt=Be=null,oc=!1,xo=0,Vl=null,i)throw Error(a(300));r===null||Qt||(r=r.dependencies,r!==null&&Wu(r)&&(Qt=!0))}function Pv(r,i,s,d){Be=r;var p=0;do{if(Zl&&(Vl=null),xo=0,Zl=!1,25<=p)throw Error(a(301));if(p+=1,Vt=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)}H.H=Sb,v=i(s,d)}while(Zl);return v}function PN(){var r=H.H,i=r.useState()[0];return i=typeof i.then=="function"?So(i):i,r=r.useState()[0],(vt!==null?vt.memoizedState:null)!==r&&(Be.flags|=1024),i}function vh(){var r=uc!==0;return uc=0,r}function bh(r,i,s){i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~s}function xh(r){if(oc){for(r=r.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}oc=!1}aa=0,Vt=vt=Be=null,Zl=!1,xo=uc=0,Vl=null}function Cn(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Vt===null?Be.memoizedState=Vt=r:Vt=Vt.next=r,Vt}function $t(){if(vt===null){var r=Be.alternate;r=r!==null?r.memoizedState:null}else r=vt.next;var i=Vt===null?Be.memoizedState:Vt.next;if(i!==null)Vt=i,vt=r;else{if(r===null)throw Be.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},Vt===null?Be.memoizedState=Vt=r:Vt=Vt.next=r}return Vt}function cc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function So(r){var i=xo;return xo+=1,Vl===null&&(Vl=[]),r=Av(Vl,r,i),i=Be,(Vt===null?i.memoizedState:Vt.next)===null&&(i=i.alternate,H.H=i===null||i.memoizedState===null?xb:Rh),r}function dc(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return So(r);if(r.$$typeof===O)return pn(r)}throw Error(a(438,String(r)))}function Sh(r){var i=null,s=Be.updateQueue;if(s!==null&&(i=s.memoCache),i==null){var d=Be.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=cc(),Be.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]=q;return i.index++,s}function ia(r,i){return typeof i=="function"?i(r):i}function fc(r){var i=$t();return wh(i,vt,r)}function wh(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 w=p.next;p.next=v.next,v.next=w}i.baseQueue=p=v,d.pending=null}if(v=r.baseState,p===null)r.memoizedState=v;else{i=p.next;var N=w=null,I=null,G=i,ne=!1;do{var ce=G.lane&-536870913;if(ce!==G.lane?(Je&ce)===ce:(aa&ce)===ce){var Y=G.revertLane;if(Y===0)I!==null&&(I=I.next={lane:0,revertLane:0,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null}),ce===Bl&&(ne=!0);else if((aa&Y)===Y){G=G.next,Y===Bl&&(ne=!0);continue}else ce={lane:0,revertLane:G.revertLane,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},I===null?(N=I=ce,w=v):I=I.next=ce,Be.lanes|=Y,Ha|=Y;ce=G.action,Qi&&s(v,ce),v=G.hasEagerState?G.eagerState:s(v,ce)}else Y={lane:ce,revertLane:G.revertLane,gesture:G.gesture,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},I===null?(N=I=Y,w=v):I=I.next=Y,Be.lanes|=ce,Ha|=ce;G=G.next}while(G!==null&&G!==i);if(I===null?w=v:I.next=N,!Gn(v,r.memoizedState)&&(Qt=!0,ne&&(s=$l,s!==null)))throw s;r.memoizedState=v,r.baseState=w,r.baseQueue=I,d.lastRenderedState=v}return p===null&&(d.lanes=0),[r.memoizedState,d.dispatch]}function kh(r){var i=$t(),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 w=p=p.next;do v=r(v,w.action),w=w.next;while(w!==p);Gn(v,i.memoizedState)||(Qt=!0),i.memoizedState=v,i.baseQueue===null&&(i.baseState=v),s.lastRenderedState=v}return[v,d]}function Bv(r,i,s){var d=Be,p=$t(),v=tt;if(v){if(s===void 0)throw Error(a(407));s=s()}else s=i();var w=!Gn((vt||p).memoizedState,s);if(w&&(p.memoizedState=s,Qt=!0),p=p.queue,Eh(qv.bind(null,d,p,r),[r]),p.getSnapshot!==i||w||Vt!==null&&Vt.memoizedState.tag&1){if(d.flags|=2048,Ql(9,{destroy:void 0},Fv.bind(null,d,p,s,i),null),kt===null)throw Error(a(349));v||(aa&127)!==0||$v(d,i,s)}return s}function $v(r,i,s){r.flags|=16384,r={getSnapshot:i,value:s},i=Be.updateQueue,i===null?(i=cc(),Be.updateQueue=i,i.stores=[r]):(s=i.stores,s===null?i.stores=[r]:s.push(r))}function Fv(r,i,s,d){i.value=s,i.getSnapshot=d,Hv(i)&&Zv(r)}function qv(r,i,s){return s(function(){Hv(i)&&Zv(r)})}function Hv(r){var i=r.getSnapshot;r=r.value;try{var s=i();return!Gn(r,s)}catch{return!0}}function Zv(r){var i=Ui(r,2);i!==null&&Bn(i,r,2)}function jh(r){var i=Cn();if(typeof r=="function"){var s=r;if(r=s(),Qi){fn(!0);try{s()}finally{fn(!1)}}}return i.memoizedState=i.baseState=r,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ia,lastRenderedState:r},i}function Vv(r,i,s,d){return r.baseState=s,wh(r,vt,typeof d=="function"?d:ia)}function BN(r,i,s,d,p){if(pc(r))throw Error(a(485));if(r=i.action,r!==null){var v={payload:p,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(w){v.listeners.push(w)}};H.T!==null?s(!0):v.isTransition=!1,d(v),s=i.pending,s===null?(v.next=i.pending=v,Qv(i,v)):(v.next=s.next,i.pending=s.next=v)}}function Qv(r,i){var s=i.action,d=i.payload,p=r.state;if(i.isTransition){var v=H.T,w={};H.T=w;try{var N=s(p,d),I=H.S;I!==null&&I(w,N),Gv(r,i,N)}catch(G){Ch(r,i,G)}finally{v!==null&&w.types!==null&&(v.types=w.types),H.T=v}}else try{v=s(p,d),Gv(r,i,v)}catch(G){Ch(r,i,G)}}function Gv(r,i,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(d){Kv(r,i,d)},function(d){return Ch(r,i,d)}):Kv(r,i,s)}function Kv(r,i,s){i.status="fulfilled",i.value=s,Yv(i),r.state=s,i=r.pending,i!==null&&(s=i.next,s===i?r.pending=null:(s=s.next,i.next=s,Qv(r,s)))}function Ch(r,i,s){var d=r.pending;if(r.pending=null,d!==null){d=d.next;do i.status="rejected",i.reason=s,Yv(i),i=i.next;while(i!==d)}r.action=null}function Yv(r){r=r.listeners;for(var i=0;i<r.length;i++)(0,r[i])()}function Xv(r,i){return i}function Jv(r,i){if(tt){var s=kt.formState;if(s!==null){e:{var d=Be;if(tt){if(Et){t:{for(var p=Et,v=mr;p.nodeType!==8;){if(!v){p=null;break t}if(p=gr(p.nextSibling),p===null){p=null;break t}}v=p.data,p=v==="F!"||v==="F"?p:null}if(p){Et=gr(p.nextSibling),d=p.data==="F!";break e}}Ma(d)}d=!1}d&&(i=s[0])}}return s=Cn(),s.memoizedState=s.baseState=i,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xv,lastRenderedState:i},s.queue=d,s=yb.bind(null,Be,d),d.dispatch=s,d=jh(!1),v=zh.bind(null,Be,!1,d.queue),d=Cn(),p={state:i,dispatch:null,action:r,pending:null},d.queue=p,s=BN.bind(null,Be,p,v,s),p.dispatch=s,d.memoizedState=r,[i,s,!1]}function Wv(r){var i=$t();return eb(i,vt,r)}function eb(r,i,s){if(i=wh(r,i,Xv)[0],r=fc(ia)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var d=So(i)}catch(w){throw w===Fl?nc:w}else d=i;i=$t();var p=i.queue,v=p.dispatch;return s!==i.memoizedState&&(Be.flags|=2048,Ql(9,{destroy:void 0},$N.bind(null,p,s),null)),[d,v,r]}function $N(r,i){r.action=i}function tb(r){var i=$t(),s=vt;if(s!==null)return eb(i,s,r);$t(),i=i.memoizedState,s=$t();var d=s.queue.dispatch;return s.memoizedState=r,[i,d,!1]}function Ql(r,i,s,d){return r={tag:r,create:s,deps:d,inst:i,next:null},i=Be.updateQueue,i===null&&(i=cc(),Be.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 nb(){return $t().memoizedState}function hc(r,i,s,d){var p=Cn();Be.flags|=r,p.memoizedState=Ql(1|i,{destroy:void 0},s,d===void 0?null:d)}function mc(r,i,s,d){var p=$t();d=d===void 0?null:d;var v=p.memoizedState.inst;vt!==null&&d!==null&&gh(d,vt.memoizedState.deps)?p.memoizedState=Ql(i,v,s,d):(Be.flags|=r,p.memoizedState=Ql(1|i,v,s,d))}function rb(r,i){hc(8390656,8,r,i)}function Eh(r,i){mc(2048,8,r,i)}function FN(r){Be.flags|=4;var i=Be.updateQueue;if(i===null)i=cc(),Be.updateQueue=i,i.events=[r];else{var s=i.events;s===null?i.events=[r]:s.push(r)}}function ab(r){var i=$t().memoizedState;return FN({ref:i,nextImpl:r}),function(){if((dt&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function ib(r,i){return mc(4,2,r,i)}function lb(r,i){return mc(4,4,r,i)}function sb(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 ob(r,i,s){s=s!=null?s.concat([r]):null,mc(4,4,sb.bind(null,i,r),s)}function Nh(){}function ub(r,i){var s=$t();i=i===void 0?null:i;var d=s.memoizedState;return i!==null&&gh(i,d[1])?d[0]:(s.memoizedState=[r,i],r)}function cb(r,i){var s=$t();i=i===void 0?null:i;var d=s.memoizedState;if(i!==null&&gh(i,d[1]))return d[0];if(d=r(),Qi){fn(!0);try{r()}finally{fn(!1)}}return s.memoizedState=[d,i],d}function _h(r,i,s){return s===void 0||(aa&1073741824)!==0&&(Je&261930)===0?r.memoizedState=i:(r.memoizedState=s,r=dx(),Be.lanes|=r,Ha|=r,s)}function db(r,i,s,d){return Gn(s,i)?s:Hl.current!==null?(r=_h(r,s,d),Gn(r,i)||(Qt=!0),r):(aa&42)===0||(aa&1073741824)!==0&&(Je&261930)===0?(Qt=!0,r.memoizedState=s):(r=dx(),Be.lanes|=r,Ha|=r,i)}function fb(r,i,s,d,p){var v=re.p;re.p=v!==0&&8>v?v:8;var w=H.T,N={};H.T=N,zh(r,!1,i,s);try{var I=p(),G=H.S;if(G!==null&&G(N,I),I!==null&&typeof I=="object"&&typeof I.then=="function"){var ne=IN(I,d);wo(r,i,ne,er(r))}else wo(r,i,d,er(r))}catch(ce){wo(r,i,{then:function(){},status:"rejected",reason:ce},er())}finally{re.p=v,w!==null&&N.types!==null&&(w.types=N.types),H.T=w}}function qN(){}function Ah(r,i,s,d){if(r.tag!==5)throw Error(a(476));var p=hb(r).queue;fb(r,p,i,K,s===null?qN:function(){return mb(r),s(d)})}function hb(r){var i=r.memoizedState;if(i!==null)return i;i={memoizedState:K,baseState:K,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ia,lastRenderedState:K},next:null};var s={};return i.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ia,lastRenderedState:s},next:null},r.memoizedState=i,r=r.alternate,r!==null&&(r.memoizedState=i),i}function mb(r){var i=hb(r);i.next===null&&(i=r.alternate.memoizedState),wo(r,i.next.queue,{},er())}function Th(){return pn(Po)}function pb(){return $t().memoizedState}function gb(){return $t().memoizedState}function HN(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var s=er();r=Ua(s);var d=Pa(i,r,s);d!==null&&(Bn(d,i,s),yo(d,i,s)),i={cache:ih()},r.payload=i;return}i=i.return}}function ZN(r,i,s){var d=er();s={lane:d,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},pc(r)?vb(i,s):(s=Gf(r,i,s,d),s!==null&&(Bn(s,r,d),bb(s,i,d)))}function yb(r,i,s){var d=er();wo(r,i,s,d)}function wo(r,i,s,d){var p={lane:d,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(pc(r))vb(i,p);else{var v=r.alternate;if(r.lanes===0&&(v===null||v.lanes===0)&&(v=i.lastRenderedReducer,v!==null))try{var w=i.lastRenderedState,N=v(w,s);if(p.hasEagerState=!0,p.eagerState=N,Gn(N,w))return Ku(r,i,p,0),kt===null&&Gu(),!1}catch{}finally{}if(s=Gf(r,i,p,d),s!==null)return Bn(s,r,d),bb(s,i,d),!0}return!1}function zh(r,i,s,d){if(d={lane:2,revertLane:um(),gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},pc(r)){if(i)throw Error(a(479))}else i=Gf(r,s,d,2),i!==null&&Bn(i,r,2)}function pc(r){var i=r.alternate;return r===Be||i!==null&&i===Be}function vb(r,i){Zl=oc=!0;var s=r.pending;s===null?i.next=i:(i.next=s.next,s.next=i),r.pending=i}function bb(r,i,s){if((s&4194048)!==0){var d=i.lanes;d&=r.pendingLanes,s|=d,i.lanes=s,jy(r,s)}}var ko={readContext:pn,use:dc,useCallback:Lt,useContext:Lt,useEffect:Lt,useImperativeHandle:Lt,useLayoutEffect:Lt,useInsertionEffect:Lt,useMemo:Lt,useReducer:Lt,useRef:Lt,useState:Lt,useDebugValue:Lt,useDeferredValue:Lt,useTransition:Lt,useSyncExternalStore:Lt,useId:Lt,useHostTransitionStatus:Lt,useFormState:Lt,useActionState:Lt,useOptimistic:Lt,useMemoCache:Lt,useCacheRefresh:Lt};ko.useEffectEvent=Lt;var xb={readContext:pn,use:dc,useCallback:function(r,i){return Cn().memoizedState=[r,i===void 0?null:i],r},useContext:pn,useEffect:rb,useImperativeHandle:function(r,i,s){s=s!=null?s.concat([r]):null,hc(4194308,4,sb.bind(null,i,r),s)},useLayoutEffect:function(r,i){return hc(4194308,4,r,i)},useInsertionEffect:function(r,i){hc(4,2,r,i)},useMemo:function(r,i){var s=Cn();i=i===void 0?null:i;var d=r();if(Qi){fn(!0);try{r()}finally{fn(!1)}}return s.memoizedState=[d,i],d},useReducer:function(r,i,s){var d=Cn();if(s!==void 0){var p=s(i);if(Qi){fn(!0);try{s(i)}finally{fn(!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=ZN.bind(null,Be,r),[d.memoizedState,r]},useRef:function(r){var i=Cn();return r={current:r},i.memoizedState=r},useState:function(r){r=jh(r);var i=r.queue,s=yb.bind(null,Be,i);return i.dispatch=s,[r.memoizedState,s]},useDebugValue:Nh,useDeferredValue:function(r,i){var s=Cn();return _h(s,r,i)},useTransition:function(){var r=jh(!1);return r=fb.bind(null,Be,r.queue,!0,!1),Cn().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,i,s){var d=Be,p=Cn();if(tt){if(s===void 0)throw Error(a(407));s=s()}else{if(s=i(),kt===null)throw Error(a(349));(Je&127)!==0||$v(d,i,s)}p.memoizedState=s;var v={value:s,getSnapshot:i};return p.queue=v,rb(qv.bind(null,d,v,r),[r]),d.flags|=2048,Ql(9,{destroy:void 0},Fv.bind(null,d,v,s,i),null),s},useId:function(){var r=Cn(),i=kt.identifierPrefix;if(tt){var s=Ur,d=Ir;s=(d&~(1<<32-ft(d)-1)).toString(32)+s,i="_"+i+"R_"+s,s=uc++,0<s&&(i+="H"+s.toString(32)),i+="_"}else s=UN++,i="_"+i+"r_"+s.toString(32)+"_";return r.memoizedState=i},useHostTransitionStatus:Th,useFormState:Jv,useActionState:Jv,useOptimistic:function(r){var i=Cn();i.memoizedState=i.baseState=r;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=s,i=zh.bind(null,Be,!0,s),s.dispatch=i,[r,i]},useMemoCache:Sh,useCacheRefresh:function(){return Cn().memoizedState=HN.bind(null,Be)},useEffectEvent:function(r){var i=Cn(),s={impl:r};return i.memoizedState=s,function(){if((dt&2)!==0)throw Error(a(440));return s.impl.apply(void 0,arguments)}}},Rh={readContext:pn,use:dc,useCallback:ub,useContext:pn,useEffect:Eh,useImperativeHandle:ob,useInsertionEffect:ib,useLayoutEffect:lb,useMemo:cb,useReducer:fc,useRef:nb,useState:function(){return fc(ia)},useDebugValue:Nh,useDeferredValue:function(r,i){var s=$t();return db(s,vt.memoizedState,r,i)},useTransition:function(){var r=fc(ia)[0],i=$t().memoizedState;return[typeof r=="boolean"?r:So(r),i]},useSyncExternalStore:Bv,useId:pb,useHostTransitionStatus:Th,useFormState:Wv,useActionState:Wv,useOptimistic:function(r,i){var s=$t();return Vv(s,vt,r,i)},useMemoCache:Sh,useCacheRefresh:gb};Rh.useEffectEvent=ab;var Sb={readContext:pn,use:dc,useCallback:ub,useContext:pn,useEffect:Eh,useImperativeHandle:ob,useInsertionEffect:ib,useLayoutEffect:lb,useMemo:cb,useReducer:kh,useRef:nb,useState:function(){return kh(ia)},useDebugValue:Nh,useDeferredValue:function(r,i){var s=$t();return vt===null?_h(s,r,i):db(s,vt.memoizedState,r,i)},useTransition:function(){var r=kh(ia)[0],i=$t().memoizedState;return[typeof r=="boolean"?r:So(r),i]},useSyncExternalStore:Bv,useId:pb,useHostTransitionStatus:Th,useFormState:tb,useActionState:tb,useOptimistic:function(r,i){var s=$t();return vt!==null?Vv(s,vt,r,i):(s.baseState=r,[r,s.queue.dispatch])},useMemoCache:Sh,useCacheRefresh:gb};Sb.useEffectEvent=ab;function Oh(r,i,s,d){i=r.memoizedState,s=s(d,i),s=s==null?i:y({},i,s),r.memoizedState=s,r.lanes===0&&(r.updateQueue.baseState=s)}var Dh={enqueueSetState:function(r,i,s){r=r._reactInternals;var d=er(),p=Ua(d);p.payload=i,s!=null&&(p.callback=s),i=Pa(r,p,d),i!==null&&(Bn(i,r,d),yo(i,r,d))},enqueueReplaceState:function(r,i,s){r=r._reactInternals;var d=er(),p=Ua(d);p.tag=1,p.payload=i,s!=null&&(p.callback=s),i=Pa(r,p,d),i!==null&&(Bn(i,r,d),yo(i,r,d))},enqueueForceUpdate:function(r,i){r=r._reactInternals;var s=er(),d=Ua(s);d.tag=2,i!=null&&(d.callback=i),i=Pa(r,d,s),i!==null&&(Bn(i,r,s),yo(i,r,s))}};function wb(r,i,s,d,p,v,w){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(d,v,w):i.prototype&&i.prototype.isPureReactComponent?!oo(s,d)||!oo(p,v):!0}function kb(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&&Dh.enqueueReplaceState(i,i.state,null)}function Gi(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=y({},s));for(var p in r)s[p]===void 0&&(s[p]=r[p])}return s}function jb(r){Qu(r)}function Cb(r){console.error(r)}function Eb(r){Qu(r)}function gc(r,i){try{var s=r.onUncaughtError;s(i.value,{componentStack:i.stack})}catch(d){setTimeout(function(){throw d})}}function Nb(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 Mh(r,i,s){return s=Ua(s),s.tag=3,s.payload={element:null},s.callback=function(){gc(r,i)},s}function _b(r){return r=Ua(r),r.tag=3,r}function Ab(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(){Nb(i,s,d)}}var w=s.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(r.callback=function(){Nb(i,s,d),typeof p!="function"&&(Za===null?Za=new Set([this]):Za.add(this));var N=d.stack;this.componentDidCatch(d.value,{componentStack:N!==null?N:""})})}function VN(r,i,s,d,p){if(s.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(i=s.alternate,i!==null&&Pl(i,s,p,!0),s=Yn.current,s!==null){switch(s.tag){case 31:case 13:return pr===null?_c():s.alternate===null&&It===0&&(It=3),s.flags&=-257,s.flags|=65536,s.lanes=p,d===rc?s.flags|=16384:(i=s.updateQueue,i===null?s.updateQueue=new Set([d]):i.add(d),lm(r,d,p)),!1;case 22:return s.flags|=65536,d===rc?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)),lm(r,d,p)),!1}throw Error(a(435,s.tag))}return lm(r,d,p),_c(),!1}if(tt)return i=Yn.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=p,d!==eh&&(r=Error(a(422),{cause:d}),fo(dr(r,s)))):(d!==eh&&(i=Error(a(423),{cause:d}),fo(dr(i,s))),r=r.current.alternate,r.flags|=65536,p&=-p,r.lanes|=p,d=dr(d,s),p=Mh(r.stateNode,d,p),dh(r,p),It!==4&&(It=2)),!1;var v=Error(a(520),{cause:d});if(v=dr(v,s),zo===null?zo=[v]:zo.push(v),It!==4&&(It=2),i===null)return!0;d=dr(d,s),s=i;do{switch(s.tag){case 3:return s.flags|=65536,r=p&-p,s.lanes|=r,r=Mh(s.stateNode,d,r),dh(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"&&(Za===null||!Za.has(v))))return s.flags|=65536,p&=-p,s.lanes|=p,p=_b(p),Ab(p,r,s,d),dh(s,p),!1}s=s.return}while(s!==null);return!1}var Lh=Error(a(461)),Qt=!1;function gn(r,i,s,d){i.child=r===null?Ov(i,null,s,d):Vi(i,r.child,s,d)}function Tb(r,i,s,d,p){s=s.render;var v=i.ref;if("ref"in d){var w={};for(var N in d)N!=="ref"&&(w[N]=d[N])}else w=d;return Fi(i),d=yh(r,i,s,w,v,p),N=vh(),r!==null&&!Qt?(bh(r,i,p),la(r,i,p)):(tt&&N&&Jf(i),i.flags|=1,gn(r,i,d,p),i.child)}function zb(r,i,s,d,p){if(r===null){var v=s.type;return typeof v=="function"&&!Kf(v)&&v.defaultProps===void 0&&s.compare===null?(i.tag=15,i.type=v,Rb(r,i,v,d,p)):(r=Xu(s.type,null,d,i,i.mode,p),r.ref=i.ref,r.return=i,i.child=r)}if(v=r.child,!Hh(r,p)){var w=v.memoizedProps;if(s=s.compare,s=s!==null?s:oo,s(w,d)&&r.ref===i.ref)return la(r,i,p)}return i.flags|=1,r=ea(v,d),r.ref=i.ref,r.return=i,i.child=r}function Rb(r,i,s,d,p){if(r!==null){var v=r.memoizedProps;if(oo(v,d)&&r.ref===i.ref)if(Qt=!1,i.pendingProps=d=v,Hh(r,p))(r.flags&131072)!==0&&(Qt=!0);else return i.lanes=r.lanes,la(r,i,p)}return Ih(r,i,s,d,p)}function Ob(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 Db(r,i,v,s,d)}if((s&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},r!==null&&tc(i,v!==null?v.cachePool:null),v!==null?Lv(i,v):hh(),Iv(i);else return d=i.lanes=536870912,Db(r,i,v!==null?v.baseLanes|s:s,s,d)}else v!==null?(tc(i,v.cachePool),Lv(i,v),$a(),i.memoizedState=null):(r!==null&&tc(i,null),hh(),$a());return gn(r,i,p,s),i.child}function jo(r,i){return r!==null&&r.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function Db(r,i,s,d,p){var v=sh();return v=v===null?null:{parent:Zt._currentValue,pool:v},i.memoizedState={baseLanes:s,cachePool:v},r!==null&&tc(i,null),hh(),Iv(i),r!==null&&Pl(r,i,d,!0),i.childLanes=p,null}function yc(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 Mb(r,i,s){return Vi(i,r.child,null,s),r=yc(i,i.pendingProps),r.flags|=2,Xn(i),i.memoizedState=null,r}function QN(r,i,s){var d=i.pendingProps,p=(i.flags&128)!==0;if(i.flags&=-129,r===null){if(tt){if(d.mode==="hidden")return r=yc(i,d),i.lanes=536870912,jo(null,r);if(ph(i),(r=Et)?(r=Qx(r,mr),r=r!==null&&r.data==="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:Oa!==null?{id:Ir,overflow:Ur}:null,retryLane:536870912,hydrationErrors:null},s=vv(r),s.return=i,i.child=s,mn=i,Et=null)):r=null,r===null)throw Ma(i);return i.lanes=536870912,null}return yc(i,d)}var v=r.memoizedState;if(v!==null){var w=v.dehydrated;if(ph(i),p)if(i.flags&256)i.flags&=-257,i=Mb(r,i,s);else if(i.memoizedState!==null)i.child=r.child,i.flags|=128,i=null;else throw Error(a(558));else if(Qt||Pl(r,i,s,!1),p=(s&r.childLanes)!==0,Qt||p){if(d=kt,d!==null&&(w=Cy(d,s),w!==0&&w!==v.retryLane))throw v.retryLane=w,Ui(r,w),Bn(d,r,w),Lh;_c(),i=Mb(r,i,s)}else r=v.treeContext,Et=gr(w.nextSibling),mn=i,tt=!0,Da=null,mr=!1,r!==null&&Sv(i,r),i=yc(i,d),i.flags|=4096;return i}return r=ea(r.child,{mode:d.mode,children:d.children}),r.ref=i.ref,i.child=r,r.return=i,r}function vc(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 Ih(r,i,s,d,p){return Fi(i),s=yh(r,i,s,d,void 0,p),d=vh(),r!==null&&!Qt?(bh(r,i,p),la(r,i,p)):(tt&&d&&Jf(i),i.flags|=1,gn(r,i,s,p),i.child)}function Lb(r,i,s,d,p,v){return Fi(i),i.updateQueue=null,s=Pv(i,d,s,p),Uv(r),d=vh(),r!==null&&!Qt?(bh(r,i,v),la(r,i,v)):(tt&&d&&Jf(i),i.flags|=1,gn(r,i,s,v),i.child)}function Ib(r,i,s,d,p){if(Fi(i),i.stateNode===null){var v=Ml,w=s.contextType;typeof w=="object"&&w!==null&&(v=pn(w)),v=new s(d,v),i.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=Dh,i.stateNode=v,v._reactInternals=i,v=i.stateNode,v.props=d,v.state=i.memoizedState,v.refs={},uh(i),w=s.contextType,v.context=typeof w=="object"&&w!==null?pn(w):Ml,v.state=i.memoizedState,w=s.getDerivedStateFromProps,typeof w=="function"&&(Oh(i,s,w,d),v.state=i.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(w=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),w!==v.state&&Dh.enqueueReplaceState(v,v.state,null),bo(i,d,v,p),vo(),v.state=i.memoizedState),typeof v.componentDidMount=="function"&&(i.flags|=4194308),d=!0}else if(r===null){v=i.stateNode;var N=i.memoizedProps,I=Gi(s,N);v.props=I;var G=v.context,ne=s.contextType;w=Ml,typeof ne=="object"&&ne!==null&&(w=pn(ne));var ce=s.getDerivedStateFromProps;ne=typeof ce=="function"||typeof v.getSnapshotBeforeUpdate=="function",N=i.pendingProps!==N,ne||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(N||G!==w)&&kb(i,v,d,w),Ia=!1;var Y=i.memoizedState;v.state=Y,bo(i,d,v,p),vo(),G=i.memoizedState,N||Y!==G||Ia?(typeof ce=="function"&&(Oh(i,s,ce,d),G=i.memoizedState),(I=Ia||wb(i,s,I,d,Y,G,w))?(ne||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(i.flags|=4194308)):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=d,i.memoizedState=G),v.props=d,v.state=G,v.context=w,d=I):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),d=!1)}else{v=i.stateNode,ch(r,i),w=i.memoizedProps,ne=Gi(s,w),v.props=ne,ce=i.pendingProps,Y=v.context,G=s.contextType,I=Ml,typeof G=="object"&&G!==null&&(I=pn(G)),N=s.getDerivedStateFromProps,(G=typeof N=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(w!==ce||Y!==I)&&kb(i,v,d,I),Ia=!1,Y=i.memoizedState,v.state=Y,bo(i,d,v,p),vo();var J=i.memoizedState;w!==ce||Y!==J||Ia||r!==null&&r.dependencies!==null&&Wu(r.dependencies)?(typeof N=="function"&&(Oh(i,s,N,d),J=i.memoizedState),(ne=Ia||wb(i,s,ne,d,Y,J,I)||r!==null&&r.dependencies!==null&&Wu(r.dependencies))?(G||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(d,J,I),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(d,J,I)),typeof v.componentDidUpdate=="function"&&(i.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof v.componentDidUpdate!="function"||w===r.memoizedProps&&Y===r.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||w===r.memoizedProps&&Y===r.memoizedState||(i.flags|=1024),i.memoizedProps=d,i.memoizedState=J),v.props=d,v.state=J,v.context=I,d=ne):(typeof v.componentDidUpdate!="function"||w===r.memoizedProps&&Y===r.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||w===r.memoizedProps&&Y===r.memoizedState||(i.flags|=1024),d=!1)}return v=d,vc(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=Vi(i,r.child,null,p),i.child=Vi(i,null,s,p)):gn(r,i,s,p),i.memoizedState=v.state,r=i.child):r=la(r,i,p),r}function Ub(r,i,s,d){return Bi(),i.flags|=256,gn(r,i,s,d),i.child}var Uh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ph(r){return{baseLanes:r,cachePool:Nv()}}function Bh(r,i,s){return r=r!==null?r.childLanes&~s:0,i&&(r|=Wn),r}function Pb(r,i,s){var d=i.pendingProps,p=!1,v=(i.flags&128)!==0,w;if((w=v)||(w=r!==null&&r.memoizedState===null?!1:(Bt.current&2)!==0),w&&(p=!0,i.flags&=-129),w=(i.flags&32)!==0,i.flags&=-33,r===null){if(tt){if(p?Ba(i):$a(),(r=Et)?(r=Qx(r,mr),r=r!==null&&r.data!=="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:Oa!==null?{id:Ir,overflow:Ur}:null,retryLane:536870912,hydrationErrors:null},s=vv(r),s.return=i,i.child=s,mn=i,Et=null)):r=null,r===null)throw Ma(i);return wm(r)?i.lanes=32:i.lanes=536870912,null}var N=d.children;return d=d.fallback,p?($a(),p=i.mode,N=bc({mode:"hidden",children:N},p),d=Pi(d,p,s,null),N.return=i,d.return=i,N.sibling=d,i.child=N,d=i.child,d.memoizedState=Ph(s),d.childLanes=Bh(r,w,s),i.memoizedState=Uh,jo(null,d)):(Ba(i),$h(i,N))}var I=r.memoizedState;if(I!==null&&(N=I.dehydrated,N!==null)){if(v)i.flags&256?(Ba(i),i.flags&=-257,i=Fh(r,i,s)):i.memoizedState!==null?($a(),i.child=r.child,i.flags|=128,i=null):($a(),N=d.fallback,p=i.mode,d=bc({mode:"visible",children:d.children},p),N=Pi(N,p,s,null),N.flags|=2,d.return=i,N.return=i,d.sibling=N,i.child=d,Vi(i,r.child,null,s),d=i.child,d.memoizedState=Ph(s),d.childLanes=Bh(r,w,s),i.memoizedState=Uh,i=jo(null,d));else if(Ba(i),wm(N)){if(w=N.nextSibling&&N.nextSibling.dataset,w)var G=w.dgst;w=G,d=Error(a(419)),d.stack="",d.digest=w,fo({value:d,source:null,stack:null}),i=Fh(r,i,s)}else if(Qt||Pl(r,i,s,!1),w=(s&r.childLanes)!==0,Qt||w){if(w=kt,w!==null&&(d=Cy(w,s),d!==0&&d!==I.retryLane))throw I.retryLane=d,Ui(r,d),Bn(w,r,d),Lh;Sm(N)||_c(),i=Fh(r,i,s)}else Sm(N)?(i.flags|=192,i.child=r.child,i=null):(r=I.treeContext,Et=gr(N.nextSibling),mn=i,tt=!0,Da=null,mr=!1,r!==null&&Sv(i,r),i=$h(i,d.children),i.flags|=4096);return i}return p?($a(),N=d.fallback,p=i.mode,I=r.child,G=I.sibling,d=ea(I,{mode:"hidden",children:d.children}),d.subtreeFlags=I.subtreeFlags&65011712,G!==null?N=ea(G,N):(N=Pi(N,p,s,null),N.flags|=2),N.return=i,d.return=i,d.sibling=N,i.child=d,jo(null,d),d=i.child,N=r.child.memoizedState,N===null?N=Ph(s):(p=N.cachePool,p!==null?(I=Zt._currentValue,p=p.parent!==I?{parent:I,pool:I}:p):p=Nv(),N={baseLanes:N.baseLanes|s,cachePool:p}),d.memoizedState=N,d.childLanes=Bh(r,w,s),i.memoizedState=Uh,jo(r.child,d)):(Ba(i),s=r.child,r=s.sibling,s=ea(s,{mode:"visible",children:d.children}),s.return=i,s.sibling=null,r!==null&&(w=i.deletions,w===null?(i.deletions=[r],i.flags|=16):w.push(r)),i.child=s,i.memoizedState=null,s)}function $h(r,i){return i=bc({mode:"visible",children:i},r.mode),i.return=r,r.child=i}function bc(r,i){return r=Kn(22,r,null,i),r.lanes=0,r}function Fh(r,i,s){return Vi(i,r.child,null,s),r=$h(i,i.pendingProps.children),r.flags|=2,i.memoizedState=null,r}function Bb(r,i,s){r.lanes|=i;var d=r.alternate;d!==null&&(d.lanes|=i),rh(r.return,i,s)}function qh(r,i,s,d,p,v){var w=r.memoizedState;w===null?r.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:d,tail:s,tailMode:p,treeForkCount:v}:(w.isBackwards=i,w.rendering=null,w.renderingStartTime=0,w.last=d,w.tail=s,w.tailMode=p,w.treeForkCount=v)}function $b(r,i,s){var d=i.pendingProps,p=d.revealOrder,v=d.tail;d=d.children;var w=Bt.current,N=(w&2)!==0;if(N?(w=w&1|2,i.flags|=128):w&=1,_(Bt,w),gn(r,i,d,s),d=tt?co:0,!N&&r!==null&&(r.flags&128)!==0)e:for(r=i.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&Bb(r,s,i);else if(r.tag===19)Bb(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&&sc(r)===null&&(p=s),s=s.sibling;s=p,s===null?(p=i.child,i.child=null):(p=s.sibling,s.sibling=null),qh(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&&sc(r)===null){i.child=p;break}r=p.sibling,p.sibling=s,s=p,p=r}qh(i,!0,s,null,v,d);break;case"together":qh(i,!1,null,null,void 0,d);break;default:i.memoizedState=null}return i.child}function la(r,i,s){if(r!==null&&(i.dependencies=r.dependencies),Ha|=i.lanes,(s&i.childLanes)===0)if(r!==null){if(Pl(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=ea(r,r.pendingProps),i.child=s,s.return=i;r.sibling!==null;)r=r.sibling,s=s.sibling=ea(r,r.pendingProps),s.return=i;s.sibling=null}return i.child}function Hh(r,i){return(r.lanes&i)!==0?!0:(r=r.dependencies,!!(r!==null&&Wu(r)))}function GN(r,i,s){switch(i.tag){case 3:Me(i,i.stateNode.containerInfo),La(i,Zt,r.memoizedState.cache),Bi();break;case 27:case 5:ct(i);break;case 4:Me(i,i.stateNode.containerInfo);break;case 10:La(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,ph(i),null;break;case 13:var d=i.memoizedState;if(d!==null)return d.dehydrated!==null?(Ba(i),i.flags|=128,null):(s&i.child.childLanes)!==0?Pb(r,i,s):(Ba(i),r=la(r,i,s),r!==null?r.sibling:null);Ba(i);break;case 19:var p=(r.flags&128)!==0;if(d=(s&i.childLanes)!==0,d||(Pl(r,i,s,!1),d=(s&i.childLanes)!==0),p){if(d)return $b(r,i,s);i.flags|=128}if(p=i.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),_(Bt,Bt.current),d)break;return null;case 22:return i.lanes=0,Ob(r,i,s,i.pendingProps);case 24:La(i,Zt,r.memoizedState.cache)}return la(r,i,s)}function Fb(r,i,s){if(r!==null)if(r.memoizedProps!==i.pendingProps)Qt=!0;else{if(!Hh(r,s)&&(i.flags&128)===0)return Qt=!1,GN(r,i,s);Qt=(r.flags&131072)!==0}else Qt=!1,tt&&(i.flags&1048576)!==0&&xv(i,co,i.index);switch(i.lanes=0,i.tag){case 16:e:{var d=i.pendingProps;if(r=Hi(i.elementType),i.type=r,typeof r=="function")Kf(r)?(d=Gi(r,d),i.tag=1,i=Ib(null,i,r,d,s)):(i.tag=0,i=Ih(null,i,r,d,s));else{if(r!=null){var p=r.$$typeof;if(p===M){i.tag=11,i=Tb(null,i,r,d,s);break e}else if(p===L){i.tag=14,i=zb(null,i,r,d,s);break e}}throw i=fe(r)||r,Error(a(306,i,""))}}return i;case 0:return Ih(r,i,i.type,i.pendingProps,s);case 1:return d=i.type,p=Gi(d,i.pendingProps),Ib(r,i,d,p,s);case 3:e:{if(Me(i,i.stateNode.containerInfo),r===null)throw Error(a(387));d=i.pendingProps;var v=i.memoizedState;p=v.element,ch(r,i),bo(i,d,null,s);var w=i.memoizedState;if(d=w.cache,La(i,Zt,d),d!==v.cache&&ah(i,[Zt],s,!0),vo(),d=w.element,v.isDehydrated)if(v={element:d,isDehydrated:!1,cache:w.cache},i.updateQueue.baseState=v,i.memoizedState=v,i.flags&256){i=Ub(r,i,d,s);break e}else if(d!==p){p=dr(Error(a(424)),i),fo(p),i=Ub(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(Et=gr(r.firstChild),mn=i,tt=!0,Da=null,mr=!0,s=Ov(i,null,d,s),i.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(Bi(),d===p){i=la(r,i,s);break e}gn(r,i,d,s)}i=i.child}return i;case 26:return vc(r,i),r===null?(s=Wx(i.type,null,i.pendingProps,null))?i.memoizedState=s:tt||(s=i.type,r=i.pendingProps,d=Mc(ue.current).createElement(s),d[hn]=i,d[Dn]=r,yn(d,s,r),ln(d),i.stateNode=d):i.memoizedState=Wx(i.type,r.memoizedProps,i.pendingProps,r.memoizedState),null;case 27:return ct(i),r===null&&tt&&(d=i.stateNode=Yx(i.type,i.pendingProps,ue.current),mn=i,mr=!0,p=Et,Ka(i.type)?(km=p,Et=gr(d.firstChild)):Et=p),gn(r,i,i.pendingProps.children,s),vc(r,i),r===null&&(i.flags|=4194304),i.child;case 5:return r===null&&tt&&((p=d=Et)&&(d=j_(d,i.type,i.pendingProps,mr),d!==null?(i.stateNode=d,mn=i,Et=gr(d.firstChild),mr=!1,p=!0):p=!1),p||Ma(i)),ct(i),p=i.type,v=i.pendingProps,w=r!==null?r.memoizedProps:null,d=v.children,vm(p,v)?d=null:w!==null&&vm(p,w)&&(i.flags|=32),i.memoizedState!==null&&(p=yh(r,i,PN,null,null,s),Po._currentValue=p),vc(r,i),gn(r,i,d,s),i.child;case 6:return r===null&&tt&&((r=s=Et)&&(s=C_(s,i.pendingProps,mr),s!==null?(i.stateNode=s,mn=i,Et=null,r=!0):r=!1),r||Ma(i)),null;case 13:return Pb(r,i,s);case 4:return Me(i,i.stateNode.containerInfo),d=i.pendingProps,r===null?i.child=Vi(i,null,d,s):gn(r,i,d,s),i.child;case 11:return Tb(r,i,i.type,i.pendingProps,s);case 7:return gn(r,i,i.pendingProps,s),i.child;case 8:return gn(r,i,i.pendingProps.children,s),i.child;case 12:return gn(r,i,i.pendingProps.children,s),i.child;case 10:return d=i.pendingProps,La(i,i.type,d.value),gn(r,i,d.children,s),i.child;case 9:return p=i.type._context,d=i.pendingProps.children,Fi(i),p=pn(p),d=d(p),i.flags|=1,gn(r,i,d,s),i.child;case 14:return zb(r,i,i.type,i.pendingProps,s);case 15:return Rb(r,i,i.type,i.pendingProps,s);case 19:return $b(r,i,s);case 31:return QN(r,i,s);case 22:return Ob(r,i,s,i.pendingProps);case 24:return Fi(i),d=pn(Zt),r===null?(p=sh(),p===null&&(p=kt,v=ih(),p.pooledCache=v,v.refCount++,v!==null&&(p.pooledCacheLanes|=s),p=v),i.memoizedState={parent:d,cache:p},uh(i),La(i,Zt,p)):((r.lanes&s)!==0&&(ch(r,i),bo(i,null,null,s),vo()),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),La(i,Zt,d)):(d=v.cache,La(i,Zt,d),d!==p.cache&&ah(i,[Zt],s,!0))),gn(r,i,i.pendingProps.children,s),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function sa(r){r.flags|=4}function Zh(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(px())r.flags|=8192;else throw Zi=rc,oh}else r.flags&=-16777217}function qb(r,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!a0(i))if(px())r.flags|=8192;else throw Zi=rc,oh}function xc(r,i){i!==null&&(r.flags|=4),r.flags&16384&&(i=r.tag!==22?On():536870912,r.lanes|=i,Xl|=i)}function Co(r,i){if(!tt)switch(r.tailMode){case"hidden":i=r.tail;for(var s=null;i!==null;)i.alternate!==null&&(s=i),i=i.sibling;s===null?r.tail=null:s.sibling=null;break;case"collapsed":s=r.tail;for(var 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 Nt(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 KN(r,i,s){var d=i.pendingProps;switch(Wf(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Nt(i),null;case 1:return Nt(i),null;case 3:return s=i.stateNode,d=null,r!==null&&(d=r.memoizedState.cache),i.memoizedState.cache!==d&&(i.flags|=2048),ra(Zt),ye(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(r===null||r.child===null)&&(Ul(i)?sa(i):r===null||r.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,th())),Nt(i),null;case 26:var p=i.type,v=i.memoizedState;return r===null?(sa(i),v!==null?(Nt(i),qb(i,v)):(Nt(i),Zh(i,p,null,d,s))):v?v!==r.memoizedState?(sa(i),Nt(i),qb(i,v)):(Nt(i),i.flags&=-16777217):(r=r.memoizedProps,r!==d&&sa(i),Nt(i),Zh(i,p,r,d,s)),null;case 27:if(ae(i),s=ue.current,p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==d&&sa(i);else{if(!d){if(i.stateNode===null)throw Error(a(166));return Nt(i),null}r=$.current,Ul(i)?wv(i):(r=Yx(p,d,s),i.stateNode=r,sa(i))}return Nt(i),null;case 5:if(ae(i),p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==d&&sa(i);else{if(!d){if(i.stateNode===null)throw Error(a(166));return Nt(i),null}if(v=$.current,Ul(i))wv(i);else{var w=Mc(ue.current);switch(v){case 1:v=w.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:v=w.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":v=w.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":v=w.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":v=w.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof d.is=="string"?w.createElement("select",{is:d.is}):w.createElement("select"),d.multiple?v.multiple=!0:d.size&&(v.size=d.size);break;default:v=typeof d.is=="string"?w.createElement(p,{is:d.is}):w.createElement(p)}}v[hn]=i,v[Dn]=d;e:for(w=i.child;w!==null;){if(w.tag===5||w.tag===6)v.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===i)break e;for(;w.sibling===null;){if(w.return===null||w.return===i)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}i.stateNode=v;e:switch(yn(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&&sa(i)}}return Nt(i),Zh(i,i.type,r===null?null:r.memoizedProps,i.pendingProps,s),null;case 6:if(r&&i.stateNode!=null)r.memoizedProps!==d&&sa(i);else{if(typeof d!="string"&&i.stateNode===null)throw Error(a(166));if(r=ue.current,Ul(i)){if(r=i.stateNode,s=i.memoizedProps,d=null,p=mn,p!==null)switch(p.tag){case 27:case 5:d=p.memoizedProps}r[hn]=i,r=!!(r.nodeValue===s||d!==null&&d.suppressHydrationWarning===!0||Px(r.nodeValue,s)),r||Ma(i,!0)}else r=Mc(r).createTextNode(d),r[hn]=i,i.stateNode=r}return Nt(i),null;case 31:if(s=i.memoizedState,r===null||r.memoizedState!==null){if(d=Ul(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[hn]=i}else Bi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Nt(i),r=!1}else s=th(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=s),r=!0;if(!r)return i.flags&256?(Xn(i),i):(Xn(i),null);if((i.flags&128)!==0)throw Error(a(558))}return Nt(i),null;case 13:if(d=i.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(p=Ul(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[hn]=i}else Bi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Nt(i),p=!1}else p=th(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=p),p=!0;if(!p)return i.flags&256?(Xn(i),i):(Xn(i),null)}return Xn(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),xc(i,i.updateQueue),Nt(i),null);case 4:return ye(),r===null&&hm(i.stateNode.containerInfo),Nt(i),null;case 10:return ra(i.type),Nt(i),null;case 19:if(P(Bt),d=i.memoizedState,d===null)return Nt(i),null;if(p=(i.flags&128)!==0,v=d.rendering,v===null)if(p)Co(d,!1);else{if(It!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(v=sc(r),v!==null){for(i.flags|=128,Co(d,!1),r=v.updateQueue,i.updateQueue=r,xc(i,r),i.subtreeFlags=0,r=s,s=i.child;s!==null;)yv(s,r),s=s.sibling;return _(Bt,Bt.current&1|2),tt&&ta(i,d.treeForkCount),i.child}r=r.sibling}d.tail!==null&&cn()>Cc&&(i.flags|=128,p=!0,Co(d,!1),i.lanes=4194304)}else{if(!p)if(r=sc(v),r!==null){if(i.flags|=128,p=!0,r=r.updateQueue,i.updateQueue=r,xc(i,r),Co(d,!0),d.tail===null&&d.tailMode==="hidden"&&!v.alternate&&!tt)return Nt(i),null}else 2*cn()-d.renderingStartTime>Cc&&s!==536870912&&(i.flags|=128,p=!0,Co(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=cn(),r.sibling=null,s=Bt.current,_(Bt,p?s&1|2:s&1),tt&&ta(i,d.treeForkCount),r):(Nt(i),null);case 22:case 23:return Xn(i),mh(),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&&(Nt(i),i.subtreeFlags&6&&(i.flags|=8192)):Nt(i),s=i.updateQueue,s!==null&&xc(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&&P(qi),null;case 24:return s=null,r!==null&&(s=r.memoizedState.cache),i.memoizedState.cache!==s&&(i.flags|=2048),ra(Zt),Nt(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function YN(r,i){switch(Wf(i),i.tag){case 1:return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return ra(Zt),ye(),r=i.flags,(r&65536)!==0&&(r&128)===0?(i.flags=r&-65537|128,i):null;case 26:case 27:case 5:return ae(i),null;case 31:if(i.memoizedState!==null){if(Xn(i),i.alternate===null)throw Error(a(340));Bi()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 13:if(Xn(i),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(a(340));Bi()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return P(Bt),null;case 4:return ye(),null;case 10:return ra(i.type),null;case 22:case 23:return Xn(i),mh(),r!==null&&P(qi),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 24:return ra(Zt),null;case 25:return null;default:return null}}function Hb(r,i){switch(Wf(i),i.tag){case 3:ra(Zt),ye();break;case 26:case 27:case 5:ae(i);break;case 4:ye();break;case 31:i.memoizedState!==null&&Xn(i);break;case 13:Xn(i);break;case 19:P(Bt);break;case 10:ra(i.type);break;case 22:case 23:Xn(i),mh(),r!==null&&P(qi);break;case 24:ra(Zt)}}function Eo(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,w=s.inst;d=v(),w.destroy=d}s=s.next}while(s!==p)}}catch(N){yt(i,i.return,N)}}function Fa(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 w=d.inst,N=w.destroy;if(N!==void 0){w.destroy=void 0,p=i;var I=s,G=N;try{G()}catch(ne){yt(p,I,ne)}}}d=d.next}while(d!==v)}}catch(ne){yt(i,i.return,ne)}}function Zb(r){var i=r.updateQueue;if(i!==null){var s=r.stateNode;try{Mv(i,s)}catch(d){yt(r,r.return,d)}}}function Vb(r,i,s){s.props=Gi(r.type,r.memoizedProps),s.state=r.memoizedState;try{s.componentWillUnmount()}catch(d){yt(r,i,d)}}function No(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 Pr(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 Qb(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 Vh(r,i,s){try{var d=r.stateNode;v_(d,r.type,s,i),d[Dn]=i}catch(p){yt(r,r.return,p)}}function Gb(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&Ka(r.type)||r.tag===4}function Qh(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||Gb(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&&Ka(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 Gh(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=Jr));else if(d!==4&&(d===27&&Ka(r.type)&&(s=r.stateNode,i=null),r=r.child,r!==null))for(Gh(r,i,s),r=r.sibling;r!==null;)Gh(r,i,s),r=r.sibling}function Sc(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&&Ka(r.type)&&(s=r.stateNode),r=r.child,r!==null))for(Sc(r,i,s),r=r.sibling;r!==null;)Sc(r,i,s),r=r.sibling}function Kb(r){var i=r.stateNode,s=r.memoizedProps;try{for(var d=r.type,p=i.attributes;p.length;)i.removeAttributeNode(p[0]);yn(i,d,s),i[hn]=r,i[Dn]=s}catch(v){yt(r,r.return,v)}}var oa=!1,Gt=!1,Kh=!1,Yb=typeof WeakSet=="function"?WeakSet:Set,sn=null;function XN(r,i){if(r=r.containerInfo,gm=Fc,r=ov(r),Ff(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 w=0,N=-1,I=-1,G=0,ne=0,ce=r,Y=null;t:for(;;){for(var J;ce!==s||p!==0&&ce.nodeType!==3||(N=w+p),ce!==v||d!==0&&ce.nodeType!==3||(I=w+d),ce.nodeType===3&&(w+=ce.nodeValue.length),(J=ce.firstChild)!==null;)Y=ce,ce=J;for(;;){if(ce===r)break t;if(Y===s&&++G===p&&(N=w),Y===v&&++ne===d&&(I=w),(J=ce.nextSibling)!==null)break;ce=Y,Y=ce.parentNode}ce=J}s=N===-1||I===-1?null:{start:N,end:I}}else s=null}s=s||{start:0,end:0}}else s=null;for(ym={focusedElem:r,selectionRange:s},Fc=!1,sn=i;sn!==null;)if(i=sn,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,sn=r;else for(;sn!==null;){switch(i=sn,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 we=Gi(s.type,p);r=d.getSnapshotBeforeUpdate(we,v),d.__reactInternalSnapshotBeforeUpdate=r}catch(Oe){yt(s,s.return,Oe)}}break;case 3:if((r&1024)!==0){if(r=i.stateNode.containerInfo,s=r.nodeType,s===9)xm(r);else if(s===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":xm(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,sn=r;break}sn=i.return}}function Xb(r,i,s){var d=s.flags;switch(s.tag){case 0:case 11:case 15:ca(r,s),d&4&&Eo(5,s);break;case 1:if(ca(r,s),d&4)if(r=s.stateNode,i===null)try{r.componentDidMount()}catch(w){yt(s,s.return,w)}else{var p=Gi(s.type,i.memoizedProps);i=i.memoizedState;try{r.componentDidUpdate(p,i,r.__reactInternalSnapshotBeforeUpdate)}catch(w){yt(s,s.return,w)}}d&64&&Zb(s),d&512&&No(s,s.return);break;case 3:if(ca(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{Mv(r,i)}catch(w){yt(s,s.return,w)}}break;case 27:i===null&&d&4&&Kb(s);case 26:case 5:ca(r,s),i===null&&d&4&&Qb(s),d&512&&No(s,s.return);break;case 12:ca(r,s);break;case 31:ca(r,s),d&4&&ex(r,s);break;case 13:ca(r,s),d&4&&tx(r,s),d&64&&(r=s.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(s=l_.bind(null,s),E_(r,s))));break;case 22:if(d=s.memoizedState!==null||oa,!d){i=i!==null&&i.memoizedState!==null||Gt,p=oa;var v=Gt;oa=d,(Gt=i)&&!v?da(r,s,(s.subtreeFlags&8772)!==0):ca(r,s),oa=p,Gt=v}break;case 30:break;default:ca(r,s)}}function Jb(r){var i=r.alternate;i!==null&&(r.alternate=null,Jb(i)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(i=r.stateNode,i!==null&&Cf(i)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var _t=null,Ln=!1;function ua(r,i,s){for(s=s.child;s!==null;)Wb(r,i,s),s=s.sibling}function Wb(r,i,s){if(Mt&&typeof Mt.onCommitFiberUnmount=="function")try{Mt.onCommitFiberUnmount(an,s)}catch{}switch(s.tag){case 26:Gt||Pr(s,i),ua(r,i,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Gt||Pr(s,i);var d=_t,p=Ln;Ka(s.type)&&(_t=s.stateNode,Ln=!1),ua(r,i,s),Lo(s.stateNode),_t=d,Ln=p;break;case 5:Gt||Pr(s,i);case 6:if(d=_t,p=Ln,_t=null,ua(r,i,s),_t=d,Ln=p,_t!==null)if(Ln)try{(_t.nodeType===9?_t.body:_t.nodeName==="HTML"?_t.ownerDocument.body:_t).removeChild(s.stateNode)}catch(v){yt(s,i,v)}else try{_t.removeChild(s.stateNode)}catch(v){yt(s,i,v)}break;case 18:_t!==null&&(Ln?(r=_t,Zx(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,s.stateNode),is(r)):Zx(_t,s.stateNode));break;case 4:d=_t,p=Ln,_t=s.stateNode.containerInfo,Ln=!0,ua(r,i,s),_t=d,Ln=p;break;case 0:case 11:case 14:case 15:Fa(2,s,i),Gt||Fa(4,s,i),ua(r,i,s);break;case 1:Gt||(Pr(s,i),d=s.stateNode,typeof d.componentWillUnmount=="function"&&Vb(s,i,d)),ua(r,i,s);break;case 21:ua(r,i,s);break;case 22:Gt=(d=Gt)||s.memoizedState!==null,ua(r,i,s),Gt=d;break;default:ua(r,i,s)}}function ex(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{is(r)}catch(s){yt(i,i.return,s)}}}function tx(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{is(r)}catch(s){yt(i,i.return,s)}}function JN(r){switch(r.tag){case 31:case 13:case 19:var i=r.stateNode;return i===null&&(i=r.stateNode=new Yb),i;case 22:return r=r.stateNode,i=r._retryCache,i===null&&(i=r._retryCache=new Yb),i;default:throw Error(a(435,r.tag))}}function wc(r,i){var s=JN(r);i.forEach(function(d){if(!s.has(d)){s.add(d);var p=s_.bind(null,r,d);d.then(p,p)}})}function In(r,i){var s=i.deletions;if(s!==null)for(var d=0;d<s.length;d++){var p=s[d],v=r,w=i,N=w;e:for(;N!==null;){switch(N.tag){case 27:if(Ka(N.type)){_t=N.stateNode,Ln=!1;break e}break;case 5:_t=N.stateNode,Ln=!1;break e;case 3:case 4:_t=N.stateNode.containerInfo,Ln=!0;break e}N=N.return}if(_t===null)throw Error(a(160));Wb(v,w,p),_t=null,Ln=!1,v=p.alternate,v!==null&&(v.return=null),p.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)nx(i,r),i=i.sibling}var Tr=null;function nx(r,i){var s=r.alternate,d=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:In(i,r),Un(r),d&4&&(Fa(3,r,r.return),Eo(3,r),Fa(5,r,r.return));break;case 1:In(i,r),Un(r),d&512&&(Gt||s===null||Pr(s,s.return)),d&64&&oa&&(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=Tr;if(In(i,r),Un(r),d&512&&(Gt||s===null||Pr(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[Ws]||v[hn]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=p.createElement(d),p.head.insertBefore(v,p.querySelector("head > title"))),yn(v,d,s),v[hn]=r,ln(v),d=v;break e;case"link":var w=n0("link","href",p).get(d+(s.href||""));if(w){for(var N=0;N<w.length;N++)if(v=w[N],v.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&v.getAttribute("rel")===(s.rel==null?null:s.rel)&&v.getAttribute("title")===(s.title==null?null:s.title)&&v.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){w.splice(N,1);break t}}v=p.createElement(d),yn(v,d,s),p.head.appendChild(v);break;case"meta":if(w=n0("meta","content",p).get(d+(s.content||""))){for(N=0;N<w.length;N++)if(v=w[N],v.getAttribute("content")===(s.content==null?null:""+s.content)&&v.getAttribute("name")===(s.name==null?null:s.name)&&v.getAttribute("property")===(s.property==null?null:s.property)&&v.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&v.getAttribute("charset")===(s.charSet==null?null:s.charSet)){w.splice(N,1);break t}}v=p.createElement(d),yn(v,d,s),p.head.appendChild(v);break;default:throw Error(a(468,d))}v[hn]=r,ln(v),d=v}r.stateNode=d}else r0(p,r.type,r.stateNode);else r.stateNode=t0(p,d,r.memoizedProps);else v!==d?(v===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):v.count--,d===null?r0(p,r.type,r.stateNode):t0(p,d,r.memoizedProps)):d===null&&r.stateNode!==null&&Vh(r,r.memoizedProps,s.memoizedProps)}break;case 27:In(i,r),Un(r),d&512&&(Gt||s===null||Pr(s,s.return)),s!==null&&d&4&&Vh(r,r.memoizedProps,s.memoizedProps);break;case 5:if(In(i,r),Un(r),d&512&&(Gt||s===null||Pr(s,s.return)),r.flags&32){p=r.stateNode;try{_l(p,"")}catch(we){yt(r,r.return,we)}}d&4&&r.stateNode!=null&&(p=r.memoizedProps,Vh(r,p,s!==null?s.memoizedProps:p)),d&1024&&(Kh=!0);break;case 6:if(In(i,r),Un(r),d&4){if(r.stateNode===null)throw Error(a(162));d=r.memoizedProps,s=r.stateNode;try{s.nodeValue=d}catch(we){yt(r,r.return,we)}}break;case 3:if(Uc=null,p=Tr,Tr=Lc(i.containerInfo),In(i,r),Tr=p,Un(r),d&4&&s!==null&&s.memoizedState.isDehydrated)try{is(i.containerInfo)}catch(we){yt(r,r.return,we)}Kh&&(Kh=!1,rx(r));break;case 4:d=Tr,Tr=Lc(r.stateNode.containerInfo),In(i,r),Un(r),Tr=d;break;case 12:In(i,r),Un(r);break;case 31:In(i,r),Un(r),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,wc(r,d)));break;case 13:In(i,r),Un(r),r.child.flags&8192&&r.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(jc=cn()),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,wc(r,d)));break;case 22:p=r.memoizedState!==null;var I=s!==null&&s.memoizedState!==null,G=oa,ne=Gt;if(oa=G||p,Gt=ne||I,In(i,r),Gt=ne,oa=G,Un(r),d&8192)e:for(i=r.stateNode,i._visibility=p?i._visibility&-2:i._visibility|1,p&&(s===null||I||oa||Gt||Ki(r)),s=null,i=r;;){if(i.tag===5||i.tag===26){if(s===null){I=s=i;try{if(v=I.stateNode,p)w=v.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none";else{N=I.stateNode;var ce=I.memoizedProps.style,Y=ce!=null&&ce.hasOwnProperty("display")?ce.display:null;N.style.display=Y==null||typeof Y=="boolean"?"":(""+Y).trim()}}catch(we){yt(I,I.return,we)}}}else if(i.tag===6){if(s===null){I=i;try{I.stateNode.nodeValue=p?"":I.memoizedProps}catch(we){yt(I,I.return,we)}}}else if(i.tag===18){if(s===null){I=i;try{var J=I.stateNode;p?Vx(J,!0):Vx(I.stateNode,!1)}catch(we){yt(I,I.return,we)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===r)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break e;for(;i.sibling===null;){if(i.return===null||i.return===r)break e;s===i&&(s=null),i=i.return}s===i&&(s=null),i.sibling.return=i.return,i=i.sibling}d&4&&(d=r.updateQueue,d!==null&&(s=d.retryQueue,s!==null&&(d.retryQueue=null,wc(r,s))));break;case 19:In(i,r),Un(r),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,wc(r,d)));break;case 30:break;case 21:break;default:In(i,r),Un(r)}}function Un(r){var i=r.flags;if(i&2){try{for(var s,d=r.return;d!==null;){if(Gb(d)){s=d;break}d=d.return}if(s==null)throw Error(a(160));switch(s.tag){case 27:var p=s.stateNode,v=Qh(r);Sc(r,v,p);break;case 5:var w=s.stateNode;s.flags&32&&(_l(w,""),s.flags&=-33);var N=Qh(r);Sc(r,N,w);break;case 3:case 4:var I=s.stateNode.containerInfo,G=Qh(r);Gh(r,G,I);break;default:throw Error(a(161))}}catch(ne){yt(r,r.return,ne)}r.flags&=-3}i&4096&&(r.flags&=-4097)}function rx(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var i=r;rx(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),r=r.sibling}}function ca(r,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)Xb(r,i.alternate,i),i=i.sibling}function Ki(r){for(r=r.child;r!==null;){var i=r;switch(i.tag){case 0:case 11:case 14:case 15:Fa(4,i,i.return),Ki(i);break;case 1:Pr(i,i.return);var s=i.stateNode;typeof s.componentWillUnmount=="function"&&Vb(i,i.return,s),Ki(i);break;case 27:Lo(i.stateNode);case 26:case 5:Pr(i,i.return),Ki(i);break;case 22:i.memoizedState===null&&Ki(i);break;case 30:Ki(i);break;default:Ki(i)}r=r.sibling}}function da(r,i,s){for(s=s&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var d=i.alternate,p=r,v=i,w=v.flags;switch(v.tag){case 0:case 11:case 15:da(p,v,s),Eo(4,v);break;case 1:if(da(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 N=d.stateNode;try{var I=p.shared.hiddenCallbacks;if(I!==null)for(p.shared.hiddenCallbacks=null,p=0;p<I.length;p++)Dv(I[p],N)}catch(G){yt(d,d.return,G)}}s&&w&64&&Zb(v),No(v,v.return);break;case 27:Kb(v);case 26:case 5:da(p,v,s),s&&d===null&&w&4&&Qb(v),No(v,v.return);break;case 12:da(p,v,s);break;case 31:da(p,v,s),s&&w&4&&ex(p,v);break;case 13:da(p,v,s),s&&w&4&&tx(p,v);break;case 22:v.memoizedState===null&&da(p,v,s),No(v,v.return);break;case 30:break;default:da(p,v,s)}i=i.sibling}}function Yh(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&&ho(s))}function Xh(r,i){r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&ho(r))}function zr(r,i,s,d){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)ax(r,i,s,d),i=i.sibling}function ax(r,i,s,d){var p=i.flags;switch(i.tag){case 0:case 11:case 15:zr(r,i,s,d),p&2048&&Eo(9,i);break;case 1:zr(r,i,s,d);break;case 3:zr(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&&ho(r)));break;case 12:if(p&2048){zr(r,i,s,d),r=i.stateNode;try{var v=i.memoizedProps,w=v.id,N=v.onPostCommit;typeof N=="function"&&N(w,i.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(I){yt(i,i.return,I)}}else zr(r,i,s,d);break;case 31:zr(r,i,s,d);break;case 13:zr(r,i,s,d);break;case 23:break;case 22:v=i.stateNode,w=i.alternate,i.memoizedState!==null?v._visibility&2?zr(r,i,s,d):_o(r,i):v._visibility&2?zr(r,i,s,d):(v._visibility|=2,Gl(r,i,s,d,(i.subtreeFlags&10256)!==0||!1)),p&2048&&Yh(w,i);break;case 24:zr(r,i,s,d),p&2048&&Xh(i.alternate,i);break;default:zr(r,i,s,d)}}function Gl(r,i,s,d,p){for(p=p&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var v=r,w=i,N=s,I=d,G=w.flags;switch(w.tag){case 0:case 11:case 15:Gl(v,w,N,I,p),Eo(8,w);break;case 23:break;case 22:var ne=w.stateNode;w.memoizedState!==null?ne._visibility&2?Gl(v,w,N,I,p):_o(v,w):(ne._visibility|=2,Gl(v,w,N,I,p)),p&&G&2048&&Yh(w.alternate,w);break;case 24:Gl(v,w,N,I,p),p&&G&2048&&Xh(w.alternate,w);break;default:Gl(v,w,N,I,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&&Yh(d.alternate,d);break;case 24:_o(s,d),p&2048&&Xh(d.alternate,d);break;default:_o(s,d)}i=i.sibling}}var Ao=8192;function Kl(r,i,s){if(r.subtreeFlags&Ao)for(r=r.child;r!==null;)ix(r,i,s),r=r.sibling}function ix(r,i,s){switch(r.tag){case 26:Kl(r,i,s),r.flags&Ao&&r.memoizedState!==null&&U_(s,Tr,r.memoizedState,r.memoizedProps);break;case 5:Kl(r,i,s);break;case 3:case 4:var d=Tr;Tr=Lc(r.stateNode.containerInfo),Kl(r,i,s),Tr=d;break;case 22:r.memoizedState===null&&(d=r.alternate,d!==null&&d.memoizedState!==null?(d=Ao,Ao=16777216,Kl(r,i,s),Ao=d):Kl(r,i,s));break;default:Kl(r,i,s)}}function lx(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 To(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];sn=d,ox(d,r)}lx(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)sx(r),r=r.sibling}function sx(r){switch(r.tag){case 0:case 11:case 15:To(r),r.flags&2048&&Fa(9,r,r.return);break;case 3:To(r);break;case 12:To(r);break;case 22:var i=r.stateNode;r.memoizedState!==null&&i._visibility&2&&(r.return===null||r.return.tag!==13)?(i._visibility&=-3,kc(r)):To(r);break;default:To(r)}}function kc(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];sn=d,ox(d,r)}lx(r)}for(r=r.child;r!==null;){switch(i=r,i.tag){case 0:case 11:case 15:Fa(8,i,i.return),kc(i);break;case 22:s=i.stateNode,s._visibility&2&&(s._visibility&=-3,kc(i));break;default:kc(i)}r=r.sibling}}function ox(r,i){for(;sn!==null;){var s=sn;switch(s.tag){case 0:case 11:case 15:Fa(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:ho(s.memoizedState.cache)}if(d=s.child,d!==null)d.return=s,sn=d;else e:for(s=r;sn!==null;){d=sn;var p=d.sibling,v=d.return;if(Jb(d),d===s){sn=null;break e}if(p!==null){p.return=v,sn=p;break e}sn=v}}}var WN={getCacheForType:function(r){var i=pn(Zt),s=i.data.get(r);return s===void 0&&(s=r(),i.data.set(r,s)),s},cacheSignal:function(){return pn(Zt).controller.signal}},e_=typeof WeakMap=="function"?WeakMap:Map,dt=0,kt=null,Ke=null,Je=0,gt=0,Jn=null,qa=!1,Yl=!1,Jh=!1,fa=0,It=0,Ha=0,Yi=0,Wh=0,Wn=0,Xl=0,zo=null,Pn=null,em=!1,jc=0,ux=0,Cc=1/0,Ec=null,Za=null,Jt=0,Va=null,Jl=null,ha=0,tm=0,nm=null,cx=null,Ro=0,rm=null;function er(){return(dt&2)!==0&&Je!==0?Je&-Je:H.T!==null?um():Ey()}function dx(){if(Wn===0)if((Je&536870912)===0||tt){var r=zi;zi<<=1,(zi&3932160)===0&&(zi=262144),Wn=r}else Wn=536870912;return r=Yn.current,r!==null&&(r.flags|=32),Wn}function Bn(r,i,s){(r===kt&&(gt===2||gt===9)||r.cancelPendingCommit!==null)&&(Wl(r,0),Qa(r,Je,Wn,!1)),Ta(r,s),((dt&2)===0||r!==kt)&&(r===kt&&((dt&2)===0&&(Yi|=s),It===4&&Qa(r,Je,Wn,!1)),Br(r))}function fx(r,i,s){if((dt&6)!==0)throw Error(a(327));var d=!s&&(i&127)===0&&(i&r.expiredLanes)===0||be(r,i),p=d?r_(r,i):im(r,i,!0),v=d;do{if(p===0){Yl&&!d&&Qa(r,i,0,!1);break}else{if(s=r.current.alternate,v&&!t_(s)){p=im(r,i,!1),v=!1;continue}if(p===2){if(v=i,r.errorRecoveryDisabledLanes&v)var w=0;else w=r.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){i=w;e:{var N=r;p=zo;var I=N.current.memoizedState.isDehydrated;if(I&&(Wl(N,w).flags|=256),w=im(N,w,!1),w!==2){if(Jh&&!I){N.errorRecoveryDisabledLanes|=v,Yi|=v,p=4;break e}v=Pn,Pn=p,v!==null&&(Pn===null?Pn=v:Pn.push.apply(Pn,v))}p=w}if(v=!1,p!==2)continue}}if(p===1){Wl(r,0),Qa(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:Qa(d,i,Wn,!qa);break e;case 2:Pn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(p=jc+300-cn(),10<p)){if(Qa(d,i,Wn,!qa),Oi(d,0,!0)!==0)break e;ha=i,d.timeoutHandle=qx(hx.bind(null,d,s,Pn,Ec,em,i,Wn,Yi,Xl,qa,v,"Throttled",-0,0),p);break e}hx(d,s,Pn,Ec,em,i,Wn,Yi,Xl,qa,v,null,-0,0)}}break}while(!0);Br(r)}function hx(r,i,s,d,p,v,w,N,I,G,ne,ce,Y,J){if(r.timeoutHandle=-1,ce=i.subtreeFlags,ce&8192||(ce&16785408)===16785408){ce={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Jr},ix(i,v,ce);var we=(v&62914560)===v?jc-cn():(v&4194048)===v?ux-cn():0;if(we=P_(ce,we),we!==null){ha=v,r.cancelPendingCommit=we(Sx.bind(null,r,i,v,s,d,p,w,N,I,ne,ce,null,Y,J)),Qa(r,v,w,!G);return}}Sx(r,i,v,s,d,p,w,N,I)}function t_(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(!Gn(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 Qa(r,i,s,d){i&=~Wh,i&=~Yi,r.suspendedLanes|=i,r.pingedLanes&=~i,d&&(r.warmLanes|=i),d=r.expirationTimes;for(var p=i;0<p;){var v=31-ft(p),w=1<<v;d[v]=-1,p&=~w}s!==0&&ky(r,s,i)}function Nc(){return(dt&6)===0?(Oo(0),!1):!0}function am(){if(Ke!==null){if(gt===0)var r=Ke.return;else r=Ke,na=$i=null,xh(r),ql=null,po=0,r=Ke;for(;r!==null;)Hb(r.alternate,r),r=r.return;Ke=null}}function Wl(r,i){var s=r.timeoutHandle;s!==-1&&(r.timeoutHandle=-1,S_(s)),s=r.cancelPendingCommit,s!==null&&(r.cancelPendingCommit=null,s()),ha=0,am(),kt=r,Ke=s=ea(r.current,null),Je=i,gt=0,Jn=null,qa=!1,Yl=be(r,i),Jh=!1,Xl=Wn=Wh=Yi=Ha=It=0,Pn=zo=null,em=!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-ft(d),v=1<<p;i|=r[p],d&=~v}return fa=i,Gu(),s}function mx(r,i){Be=null,H.H=ko,i===Fl||i===nc?(i=Tv(),gt=3):i===oh?(i=Tv(),gt=4):gt=i===Lh?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Jn=i,Ke===null&&(It=1,gc(r,dr(i,r.current)))}function px(){var r=Yn.current;return r===null?!0:(Je&4194048)===Je?pr===null:(Je&62914560)===Je||(Je&536870912)!==0?r===pr:!1}function gx(){var r=H.H;return H.H=ko,r===null?ko:r}function yx(){var r=H.A;return H.A=WN,r}function _c(){It=4,qa||(Je&4194048)!==Je&&Yn.current!==null||(Yl=!0),(Ha&134217727)===0&&(Yi&134217727)===0||kt===null||Qa(kt,Je,Wn,!1)}function im(r,i,s){var d=dt;dt|=2;var p=gx(),v=yx();(kt!==r||Je!==i)&&(Ec=null,Wl(r,i)),i=!1;var w=It;e:do try{if(gt!==0&&Ke!==null){var N=Ke,I=Jn;switch(gt){case 8:am(),w=6;break e;case 3:case 2:case 9:case 6:Yn.current===null&&(i=!0);var G=gt;if(gt=0,Jn=null,es(r,N,I,G),s&&Yl){w=0;break e}break;default:G=gt,gt=0,Jn=null,es(r,N,I,G)}}n_(),w=It;break}catch(ne){mx(r,ne)}while(!0);return i&&r.shellSuspendCounter++,na=$i=null,dt=d,H.H=p,H.A=v,Ke===null&&(kt=null,Je=0,Gu()),w}function n_(){for(;Ke!==null;)vx(Ke)}function r_(r,i){var s=dt;dt|=2;var d=gx(),p=yx();kt!==r||Je!==i?(Ec=null,Cc=cn()+500,Wl(r,i)):Yl=be(r,i);e:do try{if(gt!==0&&Ke!==null){i=Ke;var v=Jn;t:switch(gt){case 1:gt=0,Jn=null,es(r,i,v,1);break;case 2:case 9:if(_v(v)){gt=0,Jn=null,bx(i);break}i=function(){gt!==2&&gt!==9||kt!==r||(gt=7),Br(r)},v.then(i,i);break e;case 3:gt=7;break e;case 4:gt=5;break e;case 7:_v(v)?(gt=0,Jn=null,bx(i)):(gt=0,Jn=null,es(r,i,v,7));break;case 5:var w=null;switch(Ke.tag){case 26:w=Ke.memoizedState;case 5:case 27:var N=Ke;if(w?a0(w):N.stateNode.complete){gt=0,Jn=null;var I=N.sibling;if(I!==null)Ke=I;else{var G=N.return;G!==null?(Ke=G,Ac(G)):Ke=null}break t}}gt=0,Jn=null,es(r,i,v,5);break;case 6:gt=0,Jn=null,es(r,i,v,6);break;case 8:am(),It=6;break e;default:throw Error(a(462))}}a_();break}catch(ne){mx(r,ne)}while(!0);return na=$i=null,H.H=d,H.A=p,dt=s,Ke!==null?0:(kt=null,Je=0,Gu(),It)}function a_(){for(;Ke!==null&&!Ys();)vx(Ke)}function vx(r){var i=Fb(r.alternate,r,fa);r.memoizedProps=r.pendingProps,i===null?Ac(r):Ke=i}function bx(r){var i=r,s=i.alternate;switch(i.tag){case 15:case 0:i=Lb(s,i,i.pendingProps,i.type,void 0,Je);break;case 11:i=Lb(s,i,i.pendingProps,i.type.render,i.ref,Je);break;case 5:xh(i);default:Hb(s,i),i=Ke=yv(i,fa),i=Fb(s,i,fa)}r.memoizedProps=r.pendingProps,i===null?Ac(r):Ke=i}function es(r,i,s,d){na=$i=null,xh(i),ql=null,po=0;var p=i.return;try{if(VN(r,p,i,s,Je)){It=1,gc(r,dr(s,r.current)),Ke=null;return}}catch(v){if(p!==null)throw Ke=p,v;It=1,gc(r,dr(s,r.current)),Ke=null;return}i.flags&32768?(tt||d===1?r=!0:Yl||(Je&536870912)!==0?r=!1:(qa=r=!0,(d===2||d===9||d===3||d===6)&&(d=Yn.current,d!==null&&d.tag===13&&(d.flags|=16384))),xx(i,r)):Ac(i)}function Ac(r){var i=r;do{if((i.flags&32768)!==0){xx(i,qa);return}r=i.return;var s=KN(i.alternate,i,fa);if(s!==null){Ke=s;return}if(i=i.sibling,i!==null){Ke=i;return}Ke=i=r}while(i!==null);It===0&&(It=5)}function xx(r,i){do{var s=YN(r.alternate,r);if(s!==null){s.flags&=32767,Ke=s;return}if(s=r.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!i&&(r=r.sibling,r!==null)){Ke=r;return}Ke=r=s}while(r!==null);It=6,Ke=null}function Sx(r,i,s,d,p,v,w,N,I){r.cancelPendingCommit=null;do Tc();while(Jt!==0);if((dt&6)!==0)throw Error(a(327));if(i!==null){if(i===r.current)throw Error(a(177));if(v=i.lanes|i.childLanes,v|=Qf,Sf(r,s,v,w,N,I),r===kt&&(Ke=kt=null,Je=0),Jl=i,Va=r,ha=s,tm=v,nm=p,cx=d,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,o_(ze,function(){return Ex(),null})):(r.callbackNode=null,r.callbackPriority=0),d=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||d){d=H.T,H.T=null,p=re.p,re.p=2,w=dt,dt|=4;try{XN(r,i,s)}finally{dt=w,re.p=p,H.T=d}}Jt=1,wx(),kx(),jx()}}function wx(){if(Jt===1){Jt=0;var r=Va,i=Jl,s=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||s){s=H.T,H.T=null;var d=re.p;re.p=2;var p=dt;dt|=4;try{nx(i,r);var v=ym,w=ov(r.containerInfo),N=v.focusedElem,I=v.selectionRange;if(w!==N&&N&&N.ownerDocument&&sv(N.ownerDocument.documentElement,N)){if(I!==null&&Ff(N)){var G=I.start,ne=I.end;if(ne===void 0&&(ne=G),"selectionStart"in N)N.selectionStart=G,N.selectionEnd=Math.min(ne,N.value.length);else{var ce=N.ownerDocument||document,Y=ce&&ce.defaultView||window;if(Y.getSelection){var J=Y.getSelection(),we=N.textContent.length,Oe=Math.min(I.start,we),xt=I.end===void 0?Oe:Math.min(I.end,we);!J.extend&&Oe>xt&&(w=xt,xt=Oe,Oe=w);var V=lv(N,Oe),F=lv(N,xt);if(V&&F&&(J.rangeCount!==1||J.anchorNode!==V.node||J.anchorOffset!==V.offset||J.focusNode!==F.node||J.focusOffset!==F.offset)){var Q=ce.createRange();Q.setStart(V.node,V.offset),J.removeAllRanges(),Oe>xt?(J.addRange(Q),J.extend(F.node,F.offset)):(Q.setEnd(F.node,F.offset),J.addRange(Q))}}}}for(ce=[],J=N;J=J.parentNode;)J.nodeType===1&&ce.push({element:J,left:J.scrollLeft,top:J.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<ce.length;N++){var se=ce[N];se.element.scrollLeft=se.left,se.element.scrollTop=se.top}}Fc=!!gm,ym=gm=null}finally{dt=p,re.p=d,H.T=s}}r.current=i,Jt=2}}function kx(){if(Jt===2){Jt=0;var r=Va,i=Jl,s=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||s){s=H.T,H.T=null;var d=re.p;re.p=2;var p=dt;dt|=4;try{Xb(r,i.alternate,i)}finally{dt=p,re.p=d,H.T=s}}Jt=3}}function jx(){if(Jt===4||Jt===3){Jt=0,Xs();var r=Va,i=Jl,s=ha,d=cx;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Jt=5:(Jt=0,Jl=Va=null,Cx(r,r.pendingLanes));var p=r.pendingLanes;if(p===0&&(Za=null),kf(s),i=i.stateNode,Mt&&typeof Mt.onCommitFiberRoot=="function")try{Mt.onCommitFiberRoot(an,i,void 0,(i.current.flags&128)===128)}catch{}if(d!==null){i=H.T,p=re.p,re.p=2,H.T=null;try{for(var v=r.onRecoverableError,w=0;w<d.length;w++){var N=d[w];v(N.value,{componentStack:N.stack})}}finally{H.T=i,re.p=p}}(ha&3)!==0&&Tc(),Br(r),p=r.pendingLanes,(s&261930)!==0&&(p&42)!==0?r===rm?Ro++:(Ro=0,rm=r):Ro=0,Oo(0)}}function Cx(r,i){(r.pooledCacheLanes&=i)===0&&(i=r.pooledCache,i!=null&&(r.pooledCache=null,ho(i)))}function Tc(){return wx(),kx(),jx(),Ex()}function Ex(){if(Jt!==5)return!1;var r=Va,i=tm;tm=0;var s=kf(ha),d=H.T,p=re.p;try{re.p=32>s?32:s,H.T=null,s=nm,nm=null;var v=Va,w=ha;if(Jt=0,Jl=Va=null,ha=0,(dt&6)!==0)throw Error(a(331));var N=dt;if(dt|=4,sx(v.current),ax(v,v.current,w,s),dt=N,Oo(0,!1),Mt&&typeof Mt.onPostCommitFiberRoot=="function")try{Mt.onPostCommitFiberRoot(an,v)}catch{}return!0}finally{re.p=p,H.T=d,Cx(r,i)}}function Nx(r,i,s){i=dr(s,i),i=Mh(r.stateNode,i,2),r=Pa(r,i,2),r!==null&&(Ta(r,2),Br(r))}function yt(r,i,s){if(r.tag===3)Nx(r,r,s);else for(;i!==null;){if(i.tag===3){Nx(i,r,s);break}else if(i.tag===1){var d=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(Za===null||!Za.has(d))){r=dr(s,r),s=_b(2),d=Pa(i,s,2),d!==null&&(Ab(s,d,i,r),Ta(d,2),Br(d));break}}i=i.return}}function lm(r,i,s){var d=r.pingCache;if(d===null){d=r.pingCache=new e_;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)||(Jh=!0,p.add(s),r=i_.bind(null,r,i,s),i.then(r,r))}function i_(r,i,s){var d=r.pingCache;d!==null&&d.delete(i),r.pingedLanes|=r.suspendedLanes&s,r.warmLanes&=~s,kt===r&&(Je&s)===s&&(It===4||It===3&&(Je&62914560)===Je&&300>cn()-jc?(dt&2)===0&&Wl(r,0):Wh|=s,Xl===Je&&(Xl=0)),Br(r)}function _x(r,i){i===0&&(i=On()),r=Ui(r,i),r!==null&&(Ta(r,i),Br(r))}function l_(r){var i=r.memoizedState,s=0;i!==null&&(s=i.retryLane),_x(r,s)}function s_(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),_x(r,s)}function o_(r,i){return Aa(r,i)}var zc=null,ts=null,sm=!1,Rc=!1,om=!1,Ga=0;function Br(r){r!==ts&&r.next===null&&(ts===null?zc=ts=r:ts=ts.next=r),Rc=!0,sm||(sm=!0,c_())}function Oo(r,i){if(!om&&Rc){om=!0;do for(var s=!1,d=zc;d!==null;){if(r!==0){var p=d.pendingLanes;if(p===0)var v=0;else{var w=d.suspendedLanes,N=d.pingedLanes;v=(1<<31-ft(42|r)+1)-1,v&=p&~(w&~N),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(s=!0,Rx(d,v))}else v=Je,v=Oi(d,d===kt?v:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(v&3)===0||be(d,v)||(s=!0,Rx(d,v));d=d.next}while(s);om=!1}}function u_(){Ax()}function Ax(){Rc=sm=!1;var r=0;Ga!==0&&x_()&&(r=Ga);for(var i=cn(),s=null,d=zc;d!==null;){var p=d.next,v=Tx(d,i);v===0?(d.next=null,s===null?zc=p:s.next=p,p===null&&(ts=s)):(s=d,(r!==0||(v&3)!==0)&&(Rc=!0)),d=p}Jt!==0&&Jt!==5||Oo(r),Ga!==0&&(Ga=0)}function Tx(r,i){for(var s=r.suspendedLanes,d=r.pingedLanes,p=r.expirationTimes,v=r.pendingLanes&-62914561;0<v;){var w=31-ft(v),N=1<<w,I=p[w];I===-1?((N&s)===0||(N&d)!==0)&&(p[w]=et(N,i)):I<=i&&(r.expiredLanes|=N),v&=~N}if(i=kt,s=Je,s=Oi(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&&Ai(d),r.callbackNode=null,r.callbackPriority=0;if((s&3)===0||be(r,s)){if(i=s&-s,i===r.callbackPriority)return i;switch(d!==null&&Ai(d),kf(s)){case 2:case 8:s=ve;break;case 32:s=ze;break;case 268435456:s=lt;break;default:s=ze}return d=zx.bind(null,r),s=Aa(s,d),r.callbackPriority=i,r.callbackNode=s,i}return d!==null&&d!==null&&Ai(d),r.callbackPriority=2,r.callbackNode=null,2}function zx(r,i){if(Jt!==0&&Jt!==5)return r.callbackNode=null,r.callbackPriority=0,null;var s=r.callbackNode;if(Tc()&&r.callbackNode!==s)return null;var d=Je;return d=Oi(r,r===kt?d:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),d===0?null:(fx(r,d,i),Tx(r,cn()),r.callbackNode!=null&&r.callbackNode===s?zx.bind(null,r):null)}function Rx(r,i){if(Tc())return null;fx(r,i,!0)}function c_(){w_(function(){(dt&6)!==0?Aa(ie,u_):Ax()})}function um(){if(Ga===0){var r=Bl;r===0&&(r=Ti,Ti<<=1,(Ti&261888)===0&&(Ti=256)),Ga=r}return Ga}function Ox(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:Bu(""+r)}function Dx(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 d_(r,i,s,d,p){if(i==="submit"&&s&&s.stateNode===p){var v=Ox((p[Dn]||null).action),w=d.submitter;w&&(i=(i=w[Dn]||null)?Ox(i.formAction):w.getAttribute("formAction"),i!==null&&(v=i,w=null));var N=new Hu("action","action",null,d,p);r.push({event:N,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(Ga!==0){var I=w?Dx(p,w):new FormData(p);Ah(s,{pending:!0,data:I,method:p.method,action:v},null,I)}}else typeof v=="function"&&(N.preventDefault(),I=w?Dx(p,w):new FormData(p),Ah(s,{pending:!0,data:I,method:p.method,action:v},v,I))},currentTarget:p}]})}}for(var cm=0;cm<Vf.length;cm++){var dm=Vf[cm],f_=dm.toLowerCase(),h_=dm[0].toUpperCase()+dm.slice(1);Ar(f_,"on"+h_)}Ar(dv,"onAnimationEnd"),Ar(fv,"onAnimationIteration"),Ar(hv,"onAnimationStart"),Ar("dblclick","onDoubleClick"),Ar("focusin","onFocus"),Ar("focusout","onBlur"),Ar(AN,"onTransitionRun"),Ar(TN,"onTransitionStart"),Ar(zN,"onTransitionCancel"),Ar(mv,"onTransitionEnd"),El("onMouseEnter",["mouseout","mouseover"]),El("onMouseLeave",["mouseout","mouseover"]),El("onPointerEnter",["pointerout","pointerover"]),El("onPointerLeave",["pointerout","pointerover"]),Di("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Di("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Di("onBeforeInput",["compositionend","keypress","textInput","paste"]),Di("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Di("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Di("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Do="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(" "),m_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Do));function Mx(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 w=d.length-1;0<=w;w--){var N=d[w],I=N.instance,G=N.currentTarget;if(N=N.listener,I!==v&&p.isPropagationStopped())break e;v=N,p.currentTarget=G;try{v(p)}catch(ne){Qu(ne)}p.currentTarget=null,v=I}else for(w=0;w<d.length;w++){if(N=d[w],I=N.instance,G=N.currentTarget,N=N.listener,I!==v&&p.isPropagationStopped())break e;v=N,p.currentTarget=G;try{v(p)}catch(ne){Qu(ne)}p.currentTarget=null,v=I}}}}function Ye(r,i){var s=i[jf];s===void 0&&(s=i[jf]=new Set);var d=r+"__bubble";s.has(d)||(Lx(i,r,2,!1),s.add(d))}function fm(r,i,s){var d=0;i&&(d|=4),Lx(s,r,d,i)}var Oc="_reactListening"+Math.random().toString(36).slice(2);function hm(r){if(!r[Oc]){r[Oc]=!0,Ay.forEach(function(s){s!=="selectionchange"&&(m_.has(s)||fm(s,!1,r),fm(s,!0,r))});var i=r.nodeType===9?r:r.ownerDocument;i===null||i[Oc]||(i[Oc]=!0,fm("selectionchange",!1,i))}}function Lx(r,i,s,d){switch(d0(i)){case 2:var p=F_;break;case 8:p=q_;break;default:p=_m}s=p.bind(null,i,s,r),p=void 0,!Of||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 mm(r,i,s,d,p){var v=d;if((i&1)===0&&(i&2)===0&&d!==null)e:for(;;){if(d===null)return;var w=d.tag;if(w===3||w===4){var N=d.stateNode.containerInfo;if(N===p)break;if(w===4)for(w=d.return;w!==null;){var I=w.tag;if((I===3||I===4)&&w.stateNode.containerInfo===p)return;w=w.return}for(;N!==null;){if(w=kl(N),w===null)return;if(I=w.tag,I===5||I===6||I===26||I===27){d=v=w;continue e}N=N.parentNode}}d=d.return}$y(function(){var G=v,ne=zf(s),ce=[];e:{var Y=pv.get(r);if(Y!==void 0){var J=Hu,we=r;switch(r){case"keypress":if(Fu(s)===0)break e;case"keydown":case"keyup":J=sN;break;case"focusin":we="focus",J=If;break;case"focusout":we="blur",J=If;break;case"beforeblur":case"afterblur":J=If;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=Hy;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":J=KE;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":J=cN;break;case dv:case fv:case hv:J=JE;break;case mv:J=fN;break;case"scroll":case"scrollend":J=QE;break;case"wheel":J=mN;break;case"copy":case"cut":case"paste":J=eN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":J=Vy;break;case"toggle":case"beforetoggle":J=gN}var Oe=(i&4)!==0,xt=!Oe&&(r==="scroll"||r==="scrollend"),V=Oe?Y!==null?Y+"Capture":null:Y;Oe=[];for(var F=G,Q;F!==null;){var se=F;if(Q=se.stateNode,se=se.tag,se!==5&&se!==26&&se!==27||Q===null||V===null||(se=to(F,V),se!=null&&Oe.push(Mo(F,se,Q))),xt)break;F=F.return}0<Oe.length&&(Y=new J(Y,we,null,s,ne),ce.push({event:Y,listeners:Oe}))}}if((i&7)===0){e:{if(Y=r==="mouseover"||r==="pointerover",J=r==="mouseout"||r==="pointerout",Y&&s!==Tf&&(we=s.relatedTarget||s.fromElement)&&(kl(we)||we[wl]))break e;if((J||Y)&&(Y=ne.window===ne?ne:(Y=ne.ownerDocument)?Y.defaultView||Y.parentWindow:window,J?(we=s.relatedTarget||s.toElement,J=G,we=we?kl(we):null,we!==null&&(xt=o(we),Oe=we.tag,we!==xt||Oe!==5&&Oe!==27&&Oe!==6)&&(we=null)):(J=null,we=G),J!==we)){if(Oe=Hy,se="onMouseLeave",V="onMouseEnter",F="mouse",(r==="pointerout"||r==="pointerover")&&(Oe=Vy,se="onPointerLeave",V="onPointerEnter",F="pointer"),xt=J==null?Y:eo(J),Q=we==null?Y:eo(we),Y=new Oe(se,F+"leave",J,s,ne),Y.target=xt,Y.relatedTarget=Q,se=null,kl(ne)===G&&(Oe=new Oe(V,F+"enter",we,s,ne),Oe.target=Q,Oe.relatedTarget=xt,se=Oe),xt=se,J&&we)t:{for(Oe=p_,V=J,F=we,Q=0,se=V;se;se=Oe(se))Q++;se=0;for(var Te=F;Te;Te=Oe(Te))se++;for(;0<Q-se;)V=Oe(V),Q--;for(;0<se-Q;)F=Oe(F),se--;for(;Q--;){if(V===F||F!==null&&V===F.alternate){Oe=V;break t}V=Oe(V),F=Oe(F)}Oe=null}else Oe=null;J!==null&&Ix(ce,Y,J,Oe,!1),we!==null&&xt!==null&&Ix(ce,xt,we,Oe,!0)}}e:{if(Y=G?eo(G):window,J=Y.nodeName&&Y.nodeName.toLowerCase(),J==="select"||J==="input"&&Y.type==="file")var ot=ev;else if(Jy(Y))if(tv)ot=EN;else{ot=jN;var Ee=kN}else J=Y.nodeName,!J||J.toLowerCase()!=="input"||Y.type!=="checkbox"&&Y.type!=="radio"?G&&Af(G.elementType)&&(ot=ev):ot=CN;if(ot&&(ot=ot(r,G))){Wy(ce,ot,s,ne);break e}Ee&&Ee(r,Y,G),r==="focusout"&&G&&Y.type==="number"&&G.memoizedProps.value!=null&&_f(Y,"number",Y.value)}switch(Ee=G?eo(G):window,r){case"focusin":(Jy(Ee)||Ee.contentEditable==="true")&&(Rl=Ee,qf=G,uo=null);break;case"focusout":uo=qf=Rl=null;break;case"mousedown":Hf=!0;break;case"contextmenu":case"mouseup":case"dragend":Hf=!1,uv(ce,s,ne);break;case"selectionchange":if(_N)break;case"keydown":case"keyup":uv(ce,s,ne)}var Fe;if(Pf)e:{switch(r){case"compositionstart":var We="onCompositionStart";break e;case"compositionend":We="onCompositionEnd";break e;case"compositionupdate":We="onCompositionUpdate";break e}We=void 0}else zl?Yy(r,s)&&(We="onCompositionEnd"):r==="keydown"&&s.keyCode===229&&(We="onCompositionStart");We&&(Qy&&s.locale!=="ko"&&(zl||We!=="onCompositionStart"?We==="onCompositionEnd"&&zl&&(Fe=Fy()):(Ra=ne,Df="value"in Ra?Ra.value:Ra.textContent,zl=!0)),Ee=Dc(G,We),0<Ee.length&&(We=new Zy(We,r,null,s,ne),ce.push({event:We,listeners:Ee}),Fe?We.data=Fe:(Fe=Xy(s),Fe!==null&&(We.data=Fe)))),(Fe=vN?bN(r,s):xN(r,s))&&(We=Dc(G,"onBeforeInput"),0<We.length&&(Ee=new Zy("onBeforeInput","beforeinput",null,s,ne),ce.push({event:Ee,listeners:We}),Ee.data=Fe)),d_(ce,r,G,s,ne)}Mx(ce,i)})}function Mo(r,i,s){return{instance:r,listener:i,currentTarget:s}}function Dc(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=to(r,s),p!=null&&d.unshift(Mo(r,p,v)),p=to(r,i),p!=null&&d.push(Mo(r,p,v))),r.tag===3)return d;r=r.return}return[]}function p_(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function Ix(r,i,s,d,p){for(var v=i._reactName,w=[];s!==null&&s!==d;){var N=s,I=N.alternate,G=N.stateNode;if(N=N.tag,I!==null&&I===d)break;N!==5&&N!==26&&N!==27||G===null||(I=G,p?(G=to(s,v),G!=null&&w.unshift(Mo(s,G,I))):p||(G=to(s,v),G!=null&&w.push(Mo(s,G,I)))),s=s.return}w.length!==0&&r.push({event:i,listeners:w})}var g_=/\r\n?/g,y_=/\u0000|\uFFFD/g;function Ux(r){return(typeof r=="string"?r:""+r).replace(g_,`
49
+ `).replace(y_,"")}function Px(r,i){return i=Ux(i),Ux(r)===i}function bt(r,i,s,d,p,v){switch(s){case"children":typeof d=="string"?i==="body"||i==="textarea"&&d===""||_l(r,d):(typeof d=="number"||typeof d=="bigint")&&i!=="body"&&_l(r,""+d);break;case"className":Uu(r,"class",d);break;case"tabIndex":Uu(r,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":Uu(r,s,d);break;case"style":Py(r,d,v);break;case"data":if(i!=="object"){Uu(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=Bu(""+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=Bu(""+d),r.setAttribute(s,d);break;case"onClick":d!=null&&(r.onclick=Jr);break;case"onScroll":d!=null&&Ye("scroll",r);break;case"onScrollEnd":d!=null&&Ye("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=Bu(""+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":Ye("beforetoggle",r),Ye("toggle",r),Iu(r,"popover",d);break;case"xlinkActuate":Xr(r,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":Xr(r,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":Xr(r,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":Xr(r,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":Xr(r,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":Xr(r,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":Xr(r,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":Xr(r,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":Xr(r,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":Iu(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=ZE.get(s)||s,Iu(r,s,d))}}function pm(r,i,s,d,p,v){switch(s){case"style":Py(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"?_l(r,d):(typeof d=="number"||typeof d=="bigint")&&_l(r,""+d);break;case"onScroll":d!=null&&Ye("scroll",r);break;case"onScrollEnd":d!=null&&Ye("scrollend",r);break;case"onClick":d!=null&&(r.onclick=Jr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ty.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[Dn]||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,""):Iu(r,s,d)}}}function yn(r,i,s){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ye("error",r),Ye("load",r);var d=!1,p=!1,v;for(v in s)if(s.hasOwnProperty(v)){var w=s[v];if(w!=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,w,s,null)}}p&&bt(r,i,"srcSet",s.srcSet,s,null),d&&bt(r,i,"src",s.src,s,null);return;case"input":Ye("invalid",r);var N=v=w=p=null,I=null,G=null;for(d in s)if(s.hasOwnProperty(d)){var ne=s[d];if(ne!=null)switch(d){case"name":p=ne;break;case"type":w=ne;break;case"checked":I=ne;break;case"defaultChecked":G=ne;break;case"value":v=ne;break;case"defaultValue":N=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(a(137,i));break;default:bt(r,i,d,ne,s,null)}}My(r,v,N,I,G,w,p,!1);return;case"select":Ye("invalid",r),d=w=v=null;for(p in s)if(s.hasOwnProperty(p)&&(N=s[p],N!=null))switch(p){case"value":v=N;break;case"defaultValue":w=N;break;case"multiple":d=N;default:bt(r,i,p,N,s,null)}i=v,s=w,r.multiple=!!d,i!=null?Nl(r,!!d,i,!1):s!=null&&Nl(r,!!d,s,!0);return;case"textarea":Ye("invalid",r),v=p=d=null;for(w in s)if(s.hasOwnProperty(w)&&(N=s[w],N!=null))switch(w){case"value":d=N;break;case"defaultValue":p=N;break;case"children":v=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(a(91));break;default:bt(r,i,w,N,s,null)}Iy(r,d,p,v);return;case"option":for(I in s)if(s.hasOwnProperty(I)&&(d=s[I],d!=null))switch(I){case"selected":r.selected=d&&typeof d!="function"&&typeof d!="symbol";break;default:bt(r,i,I,d,s,null)}return;case"dialog":Ye("beforetoggle",r),Ye("toggle",r),Ye("cancel",r),Ye("close",r);break;case"iframe":case"object":Ye("load",r);break;case"video":case"audio":for(d=0;d<Do.length;d++)Ye(Do[d],r);break;case"image":Ye("error",r),Ye("load",r);break;case"details":Ye("toggle",r);break;case"embed":case"source":case"link":Ye("error",r),Ye("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(Af(i)){for(ne in s)s.hasOwnProperty(ne)&&(d=s[ne],d!==void 0&&pm(r,i,ne,d,s,void 0));return}}for(N in s)s.hasOwnProperty(N)&&(d=s[N],d!=null&&bt(r,i,N,d,s,null))}function v_(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,w=null,N=null,I=null,G=null,ne=null;for(J in s){var ce=s[J];if(s.hasOwnProperty(J)&&ce!=null)switch(J){case"checked":break;case"value":break;case"defaultValue":I=ce;default:d.hasOwnProperty(J)||bt(r,i,J,null,d,ce)}}for(var Y in d){var J=d[Y];if(ce=s[Y],d.hasOwnProperty(Y)&&(J!=null||ce!=null))switch(Y){case"type":v=J;break;case"name":p=J;break;case"checked":G=J;break;case"defaultChecked":ne=J;break;case"value":w=J;break;case"defaultValue":N=J;break;case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(a(137,i));break;default:J!==ce&&bt(r,i,Y,J,d,ce)}}Nf(r,w,N,I,G,ne,v,p);return;case"select":J=w=N=Y=null;for(v in s)if(I=s[v],s.hasOwnProperty(v)&&I!=null)switch(v){case"value":break;case"multiple":J=I;default:d.hasOwnProperty(v)||bt(r,i,v,null,d,I)}for(p in d)if(v=d[p],I=s[p],d.hasOwnProperty(p)&&(v!=null||I!=null))switch(p){case"value":Y=v;break;case"defaultValue":N=v;break;case"multiple":w=v;default:v!==I&&bt(r,i,p,v,d,I)}i=N,s=w,d=J,Y!=null?Nl(r,!!s,Y,!1):!!d!=!!s&&(i!=null?Nl(r,!!s,i,!0):Nl(r,!!s,s?[]:"",!1));return;case"textarea":J=Y=null;for(N in s)if(p=s[N],s.hasOwnProperty(N)&&p!=null&&!d.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:bt(r,i,N,null,d,p)}for(w in d)if(p=d[w],v=s[w],d.hasOwnProperty(w)&&(p!=null||v!=null))switch(w){case"value":Y=p;break;case"defaultValue":J=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(a(91));break;default:p!==v&&bt(r,i,w,p,d,v)}Ly(r,Y,J);return;case"option":for(var we in s)if(Y=s[we],s.hasOwnProperty(we)&&Y!=null&&!d.hasOwnProperty(we))switch(we){case"selected":r.selected=!1;break;default:bt(r,i,we,null,d,Y)}for(I in d)if(Y=d[I],J=s[I],d.hasOwnProperty(I)&&Y!==J&&(Y!=null||J!=null))switch(I){case"selected":r.selected=Y&&typeof Y!="function"&&typeof Y!="symbol";break;default:bt(r,i,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 Oe in s)Y=s[Oe],s.hasOwnProperty(Oe)&&Y!=null&&!d.hasOwnProperty(Oe)&&bt(r,i,Oe,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(Af(i)){for(var xt in s)Y=s[xt],s.hasOwnProperty(xt)&&Y!==void 0&&!d.hasOwnProperty(xt)&&pm(r,i,xt,void 0,d,Y);for(ne in d)Y=d[ne],J=s[ne],!d.hasOwnProperty(ne)||Y===J||Y===void 0&&J===void 0||pm(r,i,ne,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(ce in d)Y=d[ce],J=s[ce],!d.hasOwnProperty(ce)||Y===J||Y==null&&J==null||bt(r,i,ce,Y,d,J)}function Bx(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function b_(){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,w=p.initiatorType,N=p.duration;if(v&&N&&Bx(w)){for(w=0,N=p.responseEnd,d+=1;d<s.length;d++){var I=s[d],G=I.startTime;if(G>N)break;var ne=I.transferSize,ce=I.initiatorType;ne&&Bx(ce)&&(I=I.responseEnd,w+=ne*(I<N?1:(N-G)/(I-G)))}if(--d,i+=8*(v+w)/(p.duration/1e3),r++,10<r)break}}if(0<r)return i/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var gm=null,ym=null;function Mc(r){return r.nodeType===9?r:r.ownerDocument}function $x(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 Fx(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 vm(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 bm=null;function x_(){var r=window.event;return r&&r.type==="popstate"?r===bm?!1:(bm=r,!0):(bm=null,!1)}var qx=typeof setTimeout=="function"?setTimeout:void 0,S_=typeof clearTimeout=="function"?clearTimeout:void 0,Hx=typeof Promise=="function"?Promise:void 0,w_=typeof queueMicrotask=="function"?queueMicrotask:typeof Hx<"u"?function(r){return Hx.resolve(null).then(r).catch(k_)}:qx;function k_(r){setTimeout(function(){throw r})}function Ka(r){return r==="head"}function Zx(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),is(i);return}d--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")d++;else if(s==="html")Lo(r.ownerDocument.documentElement);else if(s==="head"){s=r.ownerDocument.head,Lo(s);for(var v=s.firstChild;v;){var w=v.nextSibling,N=v.nodeName;v[Ws]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&v.rel.toLowerCase()==="stylesheet"||s.removeChild(v),v=w}}else s==="body"&&Lo(r.ownerDocument.body);s=p}while(s);is(i)}function Vx(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 xm(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":xm(s),Cf(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}r.removeChild(s)}}function j_(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[Ws])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=gr(r.nextSibling),r===null)break}return null}function C_(r,i,s){if(i==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!s||(r=gr(r.nextSibling),r===null))return null;return r}function Qx(r,i){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!i||(r=gr(r.nextSibling),r===null))return null;return r}function Sm(r){return r.data==="$?"||r.data==="$~"}function wm(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function E_(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 gr(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 km=null;function Gx(r){r=r.nextSibling;for(var i=0;r;){if(r.nodeType===8){var s=r.data;if(s==="/$"||s==="/&"){if(i===0)return gr(r.nextSibling);i--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||i++}r=r.nextSibling}return null}function Kx(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 Yx(r,i,s){switch(i=Mc(s),r){case"html":if(r=i.documentElement,!r)throw Error(a(452));return r;case"head":if(r=i.head,!r)throw Error(a(453));return r;case"body":if(r=i.body,!r)throw Error(a(454));return r;default:throw Error(a(451))}}function Lo(r){for(var i=r.attributes;i.length;)r.removeAttributeNode(i[0]);Cf(r)}var yr=new Map,Xx=new Set;function Lc(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var ma=re.d;re.d={f:N_,r:__,D:A_,C:T_,L:z_,m:R_,X:D_,S:O_,M:M_};function N_(){var r=ma.f(),i=Nc();return r||i}function __(r){var i=jl(r);i!==null&&i.tag===5&&i.type==="form"?mb(i):ma.r(r)}var ns=typeof document>"u"?null:document;function Jx(r,i,s){var d=ns;if(d&&typeof i=="string"&&i){var p=ur(i);p='link[rel="'+r+'"][href="'+p+'"]',typeof s=="string"&&(p+='[crossorigin="'+s+'"]'),Xx.has(p)||(Xx.add(p),r={rel:r,crossOrigin:s,href:i},d.querySelector(p)===null&&(i=d.createElement("link"),yn(i,"link",r),ln(i),d.head.appendChild(i)))}}function A_(r){ma.D(r),Jx("dns-prefetch",r,null)}function T_(r,i){ma.C(r,i),Jx("preconnect",r,i)}function z_(r,i,s){ma.L(r,i,s);var d=ns;if(d&&r&&i){var p='link[rel="preload"][as="'+ur(i)+'"]';i==="image"&&s&&s.imageSrcSet?(p+='[imagesrcset="'+ur(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(p+='[imagesizes="'+ur(s.imageSizes)+'"]')):p+='[href="'+ur(r)+'"]';var v=p;switch(i){case"style":v=rs(r);break;case"script":v=as(r)}yr.has(v)||(r=y({rel:"preload",href:i==="image"&&s&&s.imageSrcSet?void 0:r,as:i},s),yr.set(v,r),d.querySelector(p)!==null||i==="style"&&d.querySelector(Io(v))||i==="script"&&d.querySelector(Uo(v))||(i=d.createElement("link"),yn(i,"link",r),ln(i),d.head.appendChild(i)))}}function R_(r,i){ma.m(r,i);var s=ns;if(s&&r){var d=i&&typeof i.as=="string"?i.as:"script",p='link[rel="modulepreload"][as="'+ur(d)+'"][href="'+ur(r)+'"]',v=p;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=as(r)}if(!yr.has(v)&&(r=y({rel:"modulepreload",href:r},i),yr.set(v,r),s.querySelector(p)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Uo(v)))return}d=s.createElement("link"),yn(d,"link",r),ln(d),s.head.appendChild(d)}}}function O_(r,i,s){ma.S(r,i,s);var d=ns;if(d&&r){var p=Cl(d).hoistableStyles,v=rs(r);i=i||"default";var w=p.get(v);if(!w){var N={loading:0,preload:null};if(w=d.querySelector(Io(v)))N.loading=5;else{r=y({rel:"stylesheet",href:r,"data-precedence":i},s),(s=yr.get(v))&&jm(r,s);var I=w=d.createElement("link");ln(I),yn(I,"link",r),I._p=new Promise(function(G,ne){I.onload=G,I.onerror=ne}),I.addEventListener("load",function(){N.loading|=1}),I.addEventListener("error",function(){N.loading|=2}),N.loading|=4,Ic(w,i,d)}w={type:"stylesheet",instance:w,count:1,state:N},p.set(v,w)}}}function D_(r,i){ma.X(r,i);var s=ns;if(s&&r){var d=Cl(s).hoistableScripts,p=as(r),v=d.get(p);v||(v=s.querySelector(Uo(p)),v||(r=y({src:r,async:!0},i),(i=yr.get(p))&&Cm(r,i),v=s.createElement("script"),ln(v),yn(v,"link",r),s.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},d.set(p,v))}}function M_(r,i){ma.M(r,i);var s=ns;if(s&&r){var d=Cl(s).hoistableScripts,p=as(r),v=d.get(p);v||(v=s.querySelector(Uo(p)),v||(r=y({src:r,async:!0,type:"module"},i),(i=yr.get(p))&&Cm(r,i),v=s.createElement("script"),ln(v),yn(v,"link",r),s.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},d.set(p,v))}}function Wx(r,i,s,d){var p=(p=ue.current)?Lc(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=rs(s.href),s=Cl(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=rs(s.href);var v=Cl(p).hoistableStyles,w=v.get(r);if(w||(p=p.ownerDocument||p,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(r,w),(v=p.querySelector(Io(r)))&&!v._p&&(w.instance=v,w.state.loading=5),yr.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},yr.set(r,s),v||L_(p,r,s,w.state))),i&&d===null)throw Error(a(528,""));return w}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=as(s),s=Cl(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 rs(r){return'href="'+ur(r)+'"'}function Io(r){return'link[rel="stylesheet"]['+r+"]"}function e0(r){return y({},r,{"data-precedence":r.precedence,precedence:null})}function L_(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}),yn(i,"link",s),ln(i),r.head.appendChild(i))}function as(r){return'[src="'+ur(r)+'"]'}function Uo(r){return"script[async]"+r}function t0(r,i,s){if(i.count++,i.instance===null)switch(i.type){case"style":var d=r.querySelector('style[data-href~="'+ur(s.href)+'"]');if(d)return i.instance=d,ln(d),d;var p=y({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return d=(r.ownerDocument||r).createElement("style"),ln(d),yn(d,"style",p),Ic(d,s.precedence,r),i.instance=d;case"stylesheet":p=rs(s.href);var v=r.querySelector(Io(p));if(v)return i.state.loading|=4,i.instance=v,ln(v),v;d=e0(s),(p=yr.get(p))&&jm(d,p),v=(r.ownerDocument||r).createElement("link"),ln(v);var w=v;return w._p=new Promise(function(N,I){w.onload=N,w.onerror=I}),yn(v,"link",d),i.state.loading|=4,Ic(v,s.precedence,r),i.instance=v;case"script":return v=as(s.src),(p=r.querySelector(Uo(v)))?(i.instance=p,ln(p),p):(d=s,(p=yr.get(v))&&(d=y({},s),Cm(d,p)),r=r.ownerDocument||r,p=r.createElement("script"),ln(p),yn(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,Ic(d,s.precedence,r));return i.instance}function Ic(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,w=0;w<d.length;w++){var N=d[w];if(N.dataset.precedence===i)v=N;else if(v!==p)break}v?v.parentNode.insertBefore(r,v.nextSibling):(i=s.nodeType===9?s.head:s,i.insertBefore(r,i.firstChild))}function jm(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.title==null&&(r.title=i.title)}function Cm(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.integrity==null&&(r.integrity=i.integrity)}var Uc=null;function n0(r,i,s){if(Uc===null){var d=new Map,p=Uc=new Map;p.set(s,d)}else p=Uc,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[Ws]||v[hn]||r==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var w=v.getAttribute(i)||"";w=r+w;var N=d.get(w);N?N.push(v):d.set(w,[v])}}return d}function r0(r,i,s){r=r.ownerDocument||r,r.head.insertBefore(s,i==="title"?r.querySelector("head > title"):null)}function I_(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 a0(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function U_(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=rs(d.href),v=i.querySelector(Io(p));if(v){i=v._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(r.count++,r=Pc.bind(r),i.then(r,r)),s.state.loading|=4,s.instance=v,ln(v);return}v=i.ownerDocument||i,d=e0(d),(p=yr.get(p))&&jm(d,p),v=v.createElement("link"),ln(v);var w=v;w._p=new Promise(function(N,I){w.onload=N,w.onerror=I}),yn(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=Pc.bind(r),i.addEventListener("load",s),i.addEventListener("error",s))}}var Em=0;function P_(r,i){return r.stylesheets&&r.count===0&&$c(r,r.stylesheets),0<r.count||0<r.imgCount?function(s){var d=setTimeout(function(){if(r.stylesheets&&$c(r,r.stylesheets),r.unsuspend){var v=r.unsuspend;r.unsuspend=null,v()}},6e4+i);0<r.imgBytes&&Em===0&&(Em=62500*b_());var p=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&$c(r,r.stylesheets),r.unsuspend)){var v=r.unsuspend;r.unsuspend=null,v()}},(r.imgBytes>Em?50:800)+i);return r.unsuspend=s,function(){r.unsuspend=null,clearTimeout(d),clearTimeout(p)}}:null}function Pc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)$c(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var Bc=null;function $c(r,i){r.stylesheets=null,r.unsuspend!==null&&(r.count++,Bc=new Map,i.forEach(B_,r),Bc=null,Pc.call(r))}function B_(r,i){if(!(i.state.loading&4)){var s=Bc.get(r);if(s)var d=s.get(null);else{s=new Map,Bc.set(r,s);for(var p=r.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<p.length;v++){var w=p[v];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(s.set(w.dataset.precedence,w),d=w)}d&&s.set(null,d)}p=i.instance,w=p.getAttribute("data-precedence"),v=s.get(w)||d,v===d&&s.set(null,p),s.set(w,p),this.count++,d=Pc.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 Po={$$typeof:O,Provider:null,Consumer:null,_currentValue:K,_currentValue2:K,_threadCount:0};function $_(r,i,s,d,p,v,w,N,I){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=_r(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_r(0),this.hiddenUpdates=_r(null),this.identifierPrefix=d,this.onUncaughtError=p,this.onCaughtError=v,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=I,this.incompleteTransitions=new Map}function i0(r,i,s,d,p,v,w,N,I,G,ne,ce){return r=new $_(r,i,s,w,I,G,ne,ce,N),i=1,v===!0&&(i|=24),v=Kn(3,null,null,i),r.current=v,v.stateNode=r,i=ih(),i.refCount++,r.pooledCache=i,i.refCount++,v.memoizedState={element:d,isDehydrated:s,cache:i},uh(v),r}function l0(r){return r?(r=Ml,r):Ml}function s0(r,i,s,d,p,v){p=l0(p),d.context===null?d.context=p:d.pendingContext=p,d=Ua(i),d.payload={element:s},v=v===void 0?null:v,v!==null&&(d.callback=v),s=Pa(r,d,i),s!==null&&(Bn(s,r,i),yo(s,r,i))}function o0(r,i){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var s=r.retryLane;r.retryLane=s!==0&&s<i?s:i}}function Nm(r,i){o0(r,i),(r=r.alternate)&&o0(r,i)}function u0(r){if(r.tag===13||r.tag===31){var i=Ui(r,67108864);i!==null&&Bn(i,r,67108864),Nm(r,67108864)}}function c0(r){if(r.tag===13||r.tag===31){var i=er();i=wf(i);var s=Ui(r,i);s!==null&&Bn(s,r,i),Nm(r,i)}}var Fc=!0;function F_(r,i,s,d){var p=H.T;H.T=null;var v=re.p;try{re.p=2,_m(r,i,s,d)}finally{re.p=v,H.T=p}}function q_(r,i,s,d){var p=H.T;H.T=null;var v=re.p;try{re.p=8,_m(r,i,s,d)}finally{re.p=v,H.T=p}}function _m(r,i,s,d){if(Fc){var p=Am(d);if(p===null)mm(r,i,d,qc,s),f0(r,d);else if(Z_(p,r,i,s,d))d.stopPropagation();else if(f0(r,d),i&4&&-1<H_.indexOf(r)){for(;p!==null;){var v=jl(p);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var w=Lr(v.pendingLanes);if(w!==0){var N=v;for(N.pendingLanes|=2,N.entangledLanes|=2;w;){var I=1<<31-ft(w);N.entanglements[1]|=I,w&=~I}Br(v),(dt&6)===0&&(Cc=cn()+500,Oo(0))}}break;case 31:case 13:N=Ui(v,2),N!==null&&Bn(N,v,2),Nc(),Nm(v,2)}if(v=Am(d),v===null&&mm(r,i,d,qc,s),v===p)break;p=v}p!==null&&d.stopPropagation()}else mm(r,i,d,null,s)}}function Am(r){return r=zf(r),Tm(r)}var qc=null;function Tm(r){if(qc=null,r=kl(r),r!==null){var i=o(r);if(i===null)r=null;else{var s=i.tag;if(s===13){if(r=u(i),r!==null)return r;r=null}else if(s===31){if(r=f(i),r!==null)return r;r=null}else if(s===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;r=null}else i!==r&&(r=null)}}return qc=r,null}function d0(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(Js()){case ie:return 2;case ve:return 8;case ze:case $e:return 32;case lt:return 268435456;default:return 32}default:return 32}}var zm=!1,Ya=null,Xa=null,Ja=null,Bo=new Map,$o=new Map,Wa=[],H_="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 f0(r,i){switch(r){case"focusin":case"focusout":Ya=null;break;case"dragenter":case"dragleave":Xa=null;break;case"mouseover":case"mouseout":Ja=null;break;case"pointerover":case"pointerout":Bo.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":$o.delete(i.pointerId)}}function Fo(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=jl(i),i!==null&&u0(i)),r):(r.eventSystemFlags|=d,i=r.targetContainers,p!==null&&i.indexOf(p)===-1&&i.push(p),r)}function Z_(r,i,s,d,p){switch(i){case"focusin":return Ya=Fo(Ya,r,i,s,d,p),!0;case"dragenter":return Xa=Fo(Xa,r,i,s,d,p),!0;case"mouseover":return Ja=Fo(Ja,r,i,s,d,p),!0;case"pointerover":var v=p.pointerId;return Bo.set(v,Fo(Bo.get(v)||null,r,i,s,d,p)),!0;case"gotpointercapture":return v=p.pointerId,$o.set(v,Fo($o.get(v)||null,r,i,s,d,p)),!0}return!1}function h0(r){var i=kl(r.target);if(i!==null){var s=o(i);if(s!==null){if(i=s.tag,i===13){if(i=u(s),i!==null){r.blockedOn=i,Ny(r.priority,function(){c0(s)});return}}else if(i===31){if(i=f(s),i!==null){r.blockedOn=i,Ny(r.priority,function(){c0(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 Hc(r){if(r.blockedOn!==null)return!1;for(var i=r.targetContainers;0<i.length;){var s=Am(r.nativeEvent);if(s===null){s=r.nativeEvent;var d=new s.constructor(s.type,s);Tf=d,s.target.dispatchEvent(d),Tf=null}else return i=jl(s),i!==null&&u0(i),r.blockedOn=s,!1;i.shift()}return!0}function m0(r,i,s){Hc(r)&&s.delete(i)}function V_(){zm=!1,Ya!==null&&Hc(Ya)&&(Ya=null),Xa!==null&&Hc(Xa)&&(Xa=null),Ja!==null&&Hc(Ja)&&(Ja=null),Bo.forEach(m0),$o.forEach(m0)}function Zc(r,i){r.blockedOn===i&&(r.blockedOn=null,zm||(zm=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,V_)))}var Vc=null;function p0(r){Vc!==r&&(Vc=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Vc===r&&(Vc=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(Tm(d||s)===null)continue;break}var v=jl(s);v!==null&&(r.splice(i,3),i-=3,Ah(v,{pending:!0,data:p,method:s.method,action:d},d,p))}}))}function is(r){function i(I){return Zc(I,r)}Ya!==null&&Zc(Ya,r),Xa!==null&&Zc(Xa,r),Ja!==null&&Zc(Ja,r),Bo.forEach(i),$o.forEach(i);for(var s=0;s<Wa.length;s++){var d=Wa[s];d.blockedOn===r&&(d.blockedOn=null)}for(;0<Wa.length&&(s=Wa[0],s.blockedOn===null);)h0(s),s.blockedOn===null&&Wa.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],w=p[Dn]||null;if(typeof v=="function")w||p0(s);else if(w){var N=null;if(v&&v.hasAttribute("formAction")){if(p=v,w=v[Dn]||null)N=w.formAction;else if(Tm(p)!==null)continue}else N=w.action;typeof N=="function"?s[d+1]=N:(s.splice(d,3),d-=3),p0(s)}}}function g0(){function r(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(w){return p=w})},focusReset:"manual",scroll:"manual"})}function i(){p!==null&&(p(),p=null),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 Rm(r){this._internalRoot=r}Qc.prototype.render=Rm.prototype.render=function(r){var i=this._internalRoot;if(i===null)throw Error(a(409));var s=i.current,d=er();s0(s,d,r,i,null,null)},Qc.prototype.unmount=Rm.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var i=r.containerInfo;s0(r.current,2,null,r,null,null),Nc(),i[wl]=null}};function Qc(r){this._internalRoot=r}Qc.prototype.unstable_scheduleHydration=function(r){if(r){var i=Ey();r={blockedOn:null,target:r,priority:i};for(var s=0;s<Wa.length&&i!==0&&i<Wa[s].priority;s++);Wa.splice(s,0,r),s===0&&h0(r)}};var y0=t.version;if(y0!=="19.2.4")throw Error(a(527,y0,"19.2.4"));re.findDOMNode=function(r){var i=r._reactInternals;if(i===void 0)throw typeof r.render=="function"?Error(a(188)):(r=Object.keys(r).join(","),Error(a(268,r)));return r=h(i),r=r!==null?g(r):null,r=r===null?null:r.stateNode,r};var Q_={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Gc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Gc.isDisabled&&Gc.supportsFiber)try{an=Gc.inject(Q_),Mt=Gc}catch{}}return Ho.createRoot=function(r,i){if(!l(r))throw Error(a(299));var s=!1,d="",p=jb,v=Cb,w=Eb;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&&(w=i.onRecoverableError)),i=i0(r,1,!1,null,null,s,d,null,p,v,w,g0),r[wl]=i.current,hm(r),new Rm(i)},Ho.hydrateRoot=function(r,i,s){if(!l(r))throw Error(a(299));var d=!1,p="",v=jb,w=Cb,N=Eb,I=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&&(w=s.onCaughtError),s.onRecoverableError!==void 0&&(N=s.onRecoverableError),s.formState!==void 0&&(I=s.formState)),i=i0(r,1,!0,i,s??null,d,p,I,v,w,N,g0),i.context=l0(null),s=i.current,d=er(),d=wf(d),p=Ua(d),p.callback=null,Pa(s,p,d),s=d,i.current.lanes=s,Ta(i,s),Br(i),r[wl]=i.current,hm(r),new Qc(i)},Ho.version="19.2.4",Ho}var _0;function a2(){if(_0)return Lm.exports;_0=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(),Lm.exports=r2(),Lm.exports}var i2=a2(),Fs=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(){}},el,si,ws,WS,l2=(WS=class extends Fs{constructor(){super();Ae(this,el);Ae(this,si);Ae(this,ws);xe(this,ws,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){B(this,si)||this.setEventListener(B(this,ws))}onUnsubscribe(){var t;this.hasListeners()||((t=B(this,si))==null||t.call(this),xe(this,si,void 0))}setEventListener(t){var n;xe(this,ws,t),(n=B(this,si))==null||n.call(this),xe(this,si,t(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()}))}setFocused(t){B(this,el)!==t&&(xe(this,el,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof B(this,el)=="boolean"?B(this,el):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},el=new WeakMap,si=new WeakMap,ws=new WeakMap,WS),wg=new l2,s2={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},oi,bg,ew,o2=(ew=class{constructor(){Ae(this,oi,s2);Ae(this,bg,!1)}setTimeoutProvider(e){xe(this,oi,e)}setTimeout(e,t){return B(this,oi).setTimeout(e,t)}clearTimeout(e){B(this,oi).clearTimeout(e)}setInterval(e,t){return B(this,oi).setInterval(e,t)}clearInterval(e){B(this,oi).clearInterval(e)}},oi=new WeakMap,bg=new WeakMap,ew),Wi=new o2;function u2(e){setTimeout(e,0)}var c2=typeof window>"u"||"Deno"in globalThis;function _n(){}function d2(e,t){return typeof e=="function"?e(t):e}function _p(e){return typeof e=="number"&&e>=0&&e!==1/0}function dw(e,t){return Math.max(e+(t||0)-Date.now(),0)}function yi(e,t){return typeof e=="function"?e(t):e}function br(e,t){return typeof e=="function"?e(t):e}function A0(e,t){const{type:n="all",exact:a,fetchStatus:l,predicate:o,queryKey:u,stale:f}=e;if(u){if(a){if(t.queryHash!==kg(u,t.options))return!1}else if(!uu(t.queryKey,u))return!1}if(n!=="all"){const m=t.isActive();if(n==="active"&&!m||n==="inactive"&&m)return!1}return!(typeof f=="boolean"&&t.isStale()!==f||l&&l!==t.state.fetchStatus||o&&!o(t))}function T0(e,t){const{exact:n,status:a,predicate:l,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(ul(t.options.mutationKey)!==ul(o))return!1}else if(!uu(t.options.mutationKey,o))return!1}return!(a&&t.state.status!==a||l&&!l(t))}function kg(e,t){return((t==null?void 0:t.queryKeyHashFn)||ul)(e)}function ul(e){return JSON.stringify(e,(t,n)=>Ap(n)?Object.keys(n).sort().reduce((a,l)=>(a[l]=n[l],a),{}):n)}function uu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>uu(e[n],t[n])):!1}var f2=Object.prototype.hasOwnProperty;function fw(e,t,n=0){if(e===t)return e;if(n>500)return t;const a=z0(e)&&z0(t);if(!a&&!(Ap(e)&&Ap(t)))return t;const o=(a?e:Object.keys(e)).length,u=a?t:Object.keys(t),f=u.length,m=a?new Array(f):{};let h=0;for(let g=0;g<f;g++){const y=a?g:u[g],b=e[y],S=t[y];if(b===S){m[y]=b,(a?g<o:f2.call(e,y))&&h++;continue}if(b===null||S===null||typeof b!="object"||typeof S!="object"){m[y]=S;continue}const k=fw(b,S,n+1);m[y]=k,k===b&&h++}return o===f&&h===o?e:m}function Cd(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 z0(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ap(e){if(!R0(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!R0(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function R0(e){return Object.prototype.toString.call(e)==="[object Object]"}function h2(e){return new Promise(t=>{Wi.setTimeout(t,e)})}function Tp(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?fw(e,t):t}function m2(e,t,n=0){const a=[...e,t];return n&&a.length>n?a.slice(1):a}function p2(e,t,n=0){const a=[t,...e];return n&&a.length>n?a.slice(0,-1):a}var jg=Symbol();function hw(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===jg?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Cg(e,t){return typeof e=="function"?e(...t):!!e}function g2(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 cu=(()=>{let e=()=>c2;return{isServer(){return e()},setIsServer(t){e=t}}})();function zp(){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 y2=u2;function v2(){let e=[],t=0,n=f=>{f()},a=f=>{f()},l=y2;const o=f=>{t?e.push(f):l(()=>{n(f)})},u=()=>{const f=e;e=[],f.length&&l(()=>{a(()=>{f.forEach(m=>{n(m)})})})};return{batch:f=>{let m;t++;try{m=f()}finally{t--,t||u()}return m},batchCalls:f=>(...m)=>{o(()=>{f(...m)})},schedule:o,setNotifyFunction:f=>{n=f},setBatchNotifyFunction:f=>{a=f},setScheduler:f=>{l=f}}}var en=v2(),ks,ui,js,tw,b2=(tw=class extends Fs{constructor(){super();Ae(this,ks,!0);Ae(this,ui);Ae(this,js);xe(this,js,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(){B(this,ui)||this.setEventListener(B(this,js))}onUnsubscribe(){var t;this.hasListeners()||((t=B(this,ui))==null||t.call(this),xe(this,ui,void 0))}setEventListener(t){var n;xe(this,js,t),(n=B(this,ui))==null||n.call(this),xe(this,ui,t(this.setOnline.bind(this)))}setOnline(t){B(this,ks)!==t&&(xe(this,ks,t),this.listeners.forEach(a=>{a(t)}))}isOnline(){return B(this,ks)}},ks=new WeakMap,ui=new WeakMap,js=new WeakMap,tw),Ed=new b2;function x2(e){return Math.min(1e3*2**e,3e4)}function mw(e){return(e??"online")==="online"?Ed.isOnline():!0}var Rp=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function pw(e){let t=!1,n=0,a;const l=zp(),o=()=>l.status!=="pending",u=j=>{var E;if(!o()){const C=new Rp(j);b(C),(E=e.onCancel)==null||E.call(e,C)}},f=()=>{t=!0},m=()=>{t=!1},h=()=>wg.isFocused()&&(e.networkMode==="always"||Ed.isOnline())&&e.canRun(),g=()=>mw(e.networkMode)&&e.canRun(),y=j=>{o()||(a==null||a(),l.resolve(j))},b=j=>{o()||(a==null||a(),l.reject(j))},S=()=>new Promise(j=>{var E;a=C=>{(o()||h())&&j(C)},(E=e.onPause)==null||E.call(e)}).then(()=>{var j;a=void 0,o()||(j=e.onContinue)==null||j.call(e)}),k=()=>{if(o())return;let j;const E=n===0?e.initialPromise:void 0;try{j=E??e.fn()}catch(C){j=Promise.reject(C)}Promise.resolve(j).then(y).catch(C=>{var z;if(o())return;const A=e.retry??(cu.isServer()?0:3),O=e.retryDelay??x2,M=typeof O=="function"?O(n,C):O,D=A===!0||typeof A=="number"&&n<A||typeof A=="function"&&A(n,C);if(t||!D){b(C);return}n++,(z=e.onFail)==null||z.call(e,n,C),h2(M).then(()=>h()?void 0:S()).then(()=>{t?b(C):k()})})};return{promise:l,status:()=>l.status,cancel:u,continue:()=>(a==null||a(),l),cancelRetry:f,continueRetry:m,canStart:g,start:()=>(g()?k():S().then(k),l)}}var tl,nw,gw=(nw=class{constructor(){Ae(this,tl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),_p(this.gcTime)&&xe(this,tl,Wi.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(cu.isServer()?1/0:300*1e3))}clearGcTimeout(){B(this,tl)&&(Wi.clearTimeout(B(this,tl)),xe(this,tl,void 0))}},tl=new WeakMap,nw),nl,Cs,vr,rl,on,Su,al,rr,yw,ga,rw,S2=(rw=class extends gw{constructor(t){super();Ae(this,rr);Ae(this,nl);Ae(this,Cs);Ae(this,vr);Ae(this,rl);Ae(this,on);Ae(this,Su);Ae(this,al);xe(this,al,!1),xe(this,Su,t.defaultOptions),this.setOptions(t.options),this.observers=[],xe(this,rl,t.client),xe(this,vr,B(this,rl).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,xe(this,nl,D0(this.options)),this.state=t.state??B(this,nl),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=B(this,on))==null?void 0:t.promise}setOptions(t){if(this.options={...B(this,Su),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=D0(this.options);n.data!==void 0&&(this.setState(O0(n.data,n.dataUpdatedAt)),xe(this,nl,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&B(this,vr).remove(this)}setData(t,n){const a=Tp(this.state.data,t,this.options);return qe(this,rr,ga).call(this,{data:a,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),a}setState(t,n){qe(this,rr,ga).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var a,l;const n=(a=B(this,on))==null?void 0:a.promise;return(l=B(this,on))==null||l.cancel(t),n?n.then(_n).catch(_n):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return B(this,nl)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>br(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===jg||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>yi(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:!dw(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(a=>a.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=B(this,on))==null||n.continue()}onOnline(){var n;const t=this.observers.find(a=>a.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=B(this,on))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),B(this,vr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(B(this,on)&&(B(this,al)||qe(this,rr,yw).call(this)?B(this,on).cancel({revert:!0}):B(this,on).cancelRetry()),this.scheduleGc()),B(this,vr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||qe(this,rr,ga).call(this,{type:"invalidate"})}async fetch(t,n){var m,h,g,y,b,S,k,j,E,C,A,O;if(this.state.fetchStatus!=="idle"&&((m=B(this,on))==null?void 0:m.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(B(this,on))return B(this,on).continueRetry(),B(this,on).promise}if(t&&this.setOptions(t),!this.options.queryFn){const M=this.observers.find(D=>D.options.queryFn);M&&this.setOptions(M.options)}const a=new AbortController,l=M=>{Object.defineProperty(M,"signal",{enumerable:!0,get:()=>(xe(this,al,!0),a.signal)})},o=()=>{const M=hw(this.options,n),z=(()=>{const L={client:B(this,rl),queryKey:this.queryKey,meta:this.meta};return l(L),L})();return xe(this,al,!1),this.options.persister?this.options.persister(M,z,this):M(z)},f=(()=>{const M={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:B(this,rl),state:this.state,fetchFn:o};return l(M),M})();(h=this.options.behavior)==null||h.onFetch(f,this),xe(this,Cs,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((g=f.fetchOptions)==null?void 0:g.meta))&&qe(this,rr,ga).call(this,{type:"fetch",meta:(y=f.fetchOptions)==null?void 0:y.meta}),xe(this,on,pw({initialPromise:n==null?void 0:n.initialPromise,fn:f.fetchFn,onCancel:M=>{M instanceof Rp&&M.revert&&this.setState({...B(this,Cs),fetchStatus:"idle"}),a.abort()},onFail:(M,D)=>{qe(this,rr,ga).call(this,{type:"failed",failureCount:M,error:D})},onPause:()=>{qe(this,rr,ga).call(this,{type:"pause"})},onContinue:()=>{qe(this,rr,ga).call(this,{type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.options.networkMode,canRun:()=>!0}));try{const M=await B(this,on).start();if(M===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(M),(S=(b=B(this,vr).config).onSuccess)==null||S.call(b,M,this),(j=(k=B(this,vr).config).onSettled)==null||j.call(k,M,this.state.error,this),M}catch(M){if(M instanceof Rp){if(M.silent)return B(this,on).promise;if(M.revert){if(this.state.data===void 0)throw M;return this.state.data}}throw qe(this,rr,ga).call(this,{type:"error",error:M}),(C=(E=B(this,vr).config).onError)==null||C.call(E,M,this),(O=(A=B(this,vr).config).onSettled)==null||O.call(A,this.state.data,M,this),M}finally{this.scheduleGc()}}},nl=new WeakMap,Cs=new WeakMap,vr=new WeakMap,rl=new WeakMap,on=new WeakMap,Su=new WeakMap,al=new WeakMap,rr=new WeakSet,yw=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},ga=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,...vw(a.data,this.options),fetchMeta:t.meta??null};case"success":const l={...a,...O0(t.data,t.dataUpdatedAt),dataUpdateCount:a.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return xe(this,Cs,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),en.batch(()=>{this.observers.forEach(a=>{a.onQueryUpdate()}),B(this,vr).notify({query:this,type:"updated",action:t})})},rw);function vw(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:mw(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function O0(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function D0(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 Fn,nt,wu,Nn,il,Es,ya,ci,ku,Ns,_s,ll,sl,di,As,pt,eu,Op,Dp,Mp,Lp,Ip,Up,Pp,bw,aw,w2=(aw=class extends Fs{constructor(t,n){super();Ae(this,pt);Ae(this,Fn);Ae(this,nt);Ae(this,wu);Ae(this,Nn);Ae(this,il);Ae(this,Es);Ae(this,ya);Ae(this,ci);Ae(this,ku);Ae(this,Ns);Ae(this,_s);Ae(this,ll);Ae(this,sl);Ae(this,di);Ae(this,As,new Set);this.options=n,xe(this,Fn,t),xe(this,ci,null),xe(this,ya,zp()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(B(this,nt).addObserver(this),M0(B(this,nt),this.options)?qe(this,pt,eu).call(this):this.updateResult(),qe(this,pt,Lp).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Bp(B(this,nt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Bp(B(this,nt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,qe(this,pt,Ip).call(this),qe(this,pt,Up).call(this),B(this,nt).removeObserver(this)}setOptions(t){const n=this.options,a=B(this,nt);if(this.options=B(this,Fn).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof br(this.options.enabled,B(this,nt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");qe(this,pt,Pp).call(this),B(this,nt).setOptions(this.options),n._defaulted&&!Cd(this.options,n)&&B(this,Fn).getQueryCache().notify({type:"observerOptionsUpdated",query:B(this,nt),observer:this});const l=this.hasListeners();l&&L0(B(this,nt),a,this.options,n)&&qe(this,pt,eu).call(this),this.updateResult(),l&&(B(this,nt)!==a||br(this.options.enabled,B(this,nt))!==br(n.enabled,B(this,nt))||yi(this.options.staleTime,B(this,nt))!==yi(n.staleTime,B(this,nt)))&&qe(this,pt,Op).call(this);const o=qe(this,pt,Dp).call(this);l&&(B(this,nt)!==a||br(this.options.enabled,B(this,nt))!==br(n.enabled,B(this,nt))||o!==B(this,di))&&qe(this,pt,Mp).call(this,o)}getOptimisticResult(t){const n=B(this,Fn).getQueryCache().build(B(this,Fn),t),a=this.createResult(n,t);return j2(this,a)&&(xe(this,Nn,a),xe(this,Es,this.options),xe(this,il,B(this,nt).state)),a}getCurrentResult(){return B(this,Nn)}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&&B(this,ya).status==="pending"&&B(this,ya).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(a,l))})}trackProp(t){B(this,As).add(t)}getCurrentQuery(){return B(this,nt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=B(this,Fn).defaultQueryOptions(t),a=B(this,Fn).getQueryCache().build(B(this,Fn),n);return a.fetch().then(()=>this.createResult(a,n))}fetch(t){return qe(this,pt,eu).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),B(this,Nn)))}createResult(t,n){var te;const a=B(this,nt),l=this.options,o=B(this,Nn),u=B(this,il),f=B(this,Es),h=t!==a?t.state:B(this,wu),{state:g}=t;let y={...g},b=!1,S;if(n._optimisticResults){const q=this.hasListeners(),oe=!q&&M0(t,n),W=q&&L0(t,a,n,l);(oe||W)&&(y={...y,...vw(g.data,t.options)}),n._optimisticResults==="isRestoring"&&(y.fetchStatus="idle")}let{error:k,errorUpdatedAt:j,status:E}=y;S=y.data;let C=!1;if(n.placeholderData!==void 0&&S===void 0&&E==="pending"){let q;o!=null&&o.isPlaceholderData&&n.placeholderData===(f==null?void 0:f.placeholderData)?(q=o.data,C=!0):q=typeof n.placeholderData=="function"?n.placeholderData((te=B(this,_s))==null?void 0:te.state.data,B(this,_s)):n.placeholderData,q!==void 0&&(E="success",S=Tp(o==null?void 0:o.data,q,n),b=!0)}if(n.select&&S!==void 0&&!C)if(o&&S===(u==null?void 0:u.data)&&n.select===B(this,ku))S=B(this,Ns);else try{xe(this,ku,n.select),S=n.select(S),S=Tp(o==null?void 0:o.data,S,n),xe(this,Ns,S),xe(this,ci,null)}catch(q){xe(this,ci,q)}B(this,ci)&&(k=B(this,ci),S=B(this,Ns),j=Date.now(),E="error");const A=y.fetchStatus==="fetching",O=E==="pending",M=E==="error",D=O&&A,z=S!==void 0,Z={status:E,fetchStatus:y.fetchStatus,isPending:O,isSuccess:E==="success",isError:M,isInitialLoading:D,isLoading:D,data:S,dataUpdatedAt:y.dataUpdatedAt,error:k,errorUpdatedAt:j,failureCount:y.fetchFailureCount,failureReason:y.fetchFailureReason,errorUpdateCount:y.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:y.dataUpdateCount>h.dataUpdateCount||y.errorUpdateCount>h.errorUpdateCount,isFetching:A,isRefetching:A&&!O,isLoadingError:M&&!z,isPaused:y.fetchStatus==="paused",isPlaceholderData:b,isRefetchError:M&&z,isStale:Eg(t,n),refetch:this.refetch,promise:B(this,ya),isEnabled:br(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const q=Z.data!==void 0,oe=Z.status==="error"&&!q,W=ee=>{oe?ee.reject(Z.error):q&&ee.resolve(Z.data)},me=()=>{const ee=xe(this,ya,Z.promise=zp());W(ee)},fe=B(this,ya);switch(fe.status){case"pending":t.queryHash===a.queryHash&&W(fe);break;case"fulfilled":(oe||Z.data!==fe.value)&&me();break;case"rejected":(!oe||Z.error!==fe.reason)&&me();break}}return Z}updateResult(){const t=B(this,Nn),n=this.createResult(B(this,nt),this.options);if(xe(this,il,B(this,nt).state),xe(this,Es,this.options),B(this,il).data!==void 0&&xe(this,_s,B(this,nt)),Cd(n,t))return;xe(this,Nn,n);const a=()=>{if(!t)return!0;const{notifyOnChangeProps:l}=this.options,o=typeof l=="function"?l():l;if(o==="all"||!o&&!B(this,As).size)return!0;const u=new Set(o??B(this,As));return this.options.throwOnError&&u.add("error"),Object.keys(B(this,Nn)).some(f=>{const m=f;return B(this,Nn)[m]!==t[m]&&u.has(m)})};qe(this,pt,bw).call(this,{listeners:a()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&qe(this,pt,Lp).call(this)}},Fn=new WeakMap,nt=new WeakMap,wu=new WeakMap,Nn=new WeakMap,il=new WeakMap,Es=new WeakMap,ya=new WeakMap,ci=new WeakMap,ku=new WeakMap,Ns=new WeakMap,_s=new WeakMap,ll=new WeakMap,sl=new WeakMap,di=new WeakMap,As=new WeakMap,pt=new WeakSet,eu=function(t){qe(this,pt,Pp).call(this);let n=B(this,nt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(_n)),n},Op=function(){qe(this,pt,Ip).call(this);const t=yi(this.options.staleTime,B(this,nt));if(cu.isServer()||B(this,Nn).isStale||!_p(t))return;const a=dw(B(this,Nn).dataUpdatedAt,t)+1;xe(this,ll,Wi.setTimeout(()=>{B(this,Nn).isStale||this.updateResult()},a))},Dp=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(B(this,nt)):this.options.refetchInterval)??!1},Mp=function(t){qe(this,pt,Up).call(this),xe(this,di,t),!(cu.isServer()||br(this.options.enabled,B(this,nt))===!1||!_p(B(this,di))||B(this,di)===0)&&xe(this,sl,Wi.setInterval(()=>{(this.options.refetchIntervalInBackground||wg.isFocused())&&qe(this,pt,eu).call(this)},B(this,di)))},Lp=function(){qe(this,pt,Op).call(this),qe(this,pt,Mp).call(this,qe(this,pt,Dp).call(this))},Ip=function(){B(this,ll)&&(Wi.clearTimeout(B(this,ll)),xe(this,ll,void 0))},Up=function(){B(this,sl)&&(Wi.clearInterval(B(this,sl)),xe(this,sl,void 0))},Pp=function(){const t=B(this,Fn).getQueryCache().build(B(this,Fn),this.options);if(t===B(this,nt))return;const n=B(this,nt);xe(this,nt,t),xe(this,wu,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},bw=function(t){en.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(B(this,Nn))}),B(this,Fn).getQueryCache().notify({query:B(this,nt),type:"observerResultsUpdated"})})},aw);function k2(e,t){return br(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function M0(e,t){return k2(e,t)||e.state.data!==void 0&&Bp(e,t,t.refetchOnMount)}function Bp(e,t,n){if(br(t.enabled,e)!==!1&&yi(t.staleTime,e)!=="static"){const a=typeof n=="function"?n(e):n;return a==="always"||a!==!1&&Eg(e,t)}return!1}function L0(e,t,n,a){return(e!==t||br(a.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Eg(e,n)}function Eg(e,t){return br(t.enabled,e)!==!1&&e.isStaleByTime(yi(t.staleTime,e))}function j2(e,t){return!Cd(e.getCurrentResult(),t)}function I0(e){return{onFetch:(t,n)=>{var g,y,b,S,k;const a=t.options,l=(b=(y=(g=t.fetchOptions)==null?void 0:g.meta)==null?void 0:y.fetchMore)==null?void 0:b.direction,o=((S=t.state.data)==null?void 0:S.pages)||[],u=((k=t.state.data)==null?void 0:k.pageParams)||[];let f={pages:[],pageParams:[]},m=0;const h=async()=>{let j=!1;const E=O=>{g2(O,()=>t.signal,()=>j=!0)},C=hw(t.options,t.fetchOptions),A=async(O,M,D)=>{if(j)return Promise.reject();if(M==null&&O.pages.length)return Promise.resolve(O);const L=(()=>{const oe={client:t.client,queryKey:t.queryKey,pageParam:M,direction:D?"backward":"forward",meta:t.options.meta};return E(oe),oe})(),Z=await C(L),{maxPages:te}=t.options,q=D?p2:m2;return{pages:q(O.pages,Z,te),pageParams:q(O.pageParams,M,te)}};if(l&&o.length){const O=l==="backward",M=O?C2:U0,D={pages:o,pageParams:u},z=M(a,D);f=await A(D,z,O)}else{const O=e??o.length;do{const M=m===0?u[0]??a.initialPageParam:U0(a,f);if(m>0&&M==null)break;f=await A(f,M),m++}while(m<O)}return f};t.options.persister?t.fetchFn=()=>{var j,E;return(E=(j=t.options).persister)==null?void 0:E.call(j,h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=h}}}function U0(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 C2(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 ju,Fr,xn,ol,qr,ai,iw,E2=(iw=class extends gw{constructor(t){super();Ae(this,qr);Ae(this,ju);Ae(this,Fr);Ae(this,xn);Ae(this,ol);xe(this,ju,t.client),this.mutationId=t.mutationId,xe(this,xn,t.mutationCache),xe(this,Fr,[]),this.state=t.state||xw(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){B(this,Fr).includes(t)||(B(this,Fr).push(t),this.clearGcTimeout(),B(this,xn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){xe(this,Fr,B(this,Fr).filter(n=>n!==t)),this.scheduleGc(),B(this,xn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){B(this,Fr).length||(this.state.status==="pending"?this.scheduleGc():B(this,xn).remove(this))}continue(){var t;return((t=B(this,ol))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var u,f,m,h,g,y,b,S,k,j,E,C,A,O,M,D,z,L;const n=()=>{qe(this,qr,ai).call(this,{type:"continue"})},a={client:B(this,ju),meta:this.options.meta,mutationKey:this.options.mutationKey};xe(this,ol,pw({fn:()=>this.options.mutationFn?this.options.mutationFn(t,a):Promise.reject(new Error("No mutationFn found")),onFail:(Z,te)=>{qe(this,qr,ai).call(this,{type:"failed",failureCount:Z,error:te})},onPause:()=>{qe(this,qr,ai).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>B(this,xn).canRun(this)}));const l=this.state.status==="pending",o=!B(this,ol).canStart();try{if(l)n();else{qe(this,qr,ai).call(this,{type:"pending",variables:t,isPaused:o}),B(this,xn).config.onMutate&&await B(this,xn).config.onMutate(t,this,a);const te=await((f=(u=this.options).onMutate)==null?void 0:f.call(u,t,a));te!==this.state.context&&qe(this,qr,ai).call(this,{type:"pending",context:te,variables:t,isPaused:o})}const Z=await B(this,ol).start();return await((h=(m=B(this,xn).config).onSuccess)==null?void 0:h.call(m,Z,t,this.state.context,this,a)),await((y=(g=this.options).onSuccess)==null?void 0:y.call(g,Z,t,this.state.context,a)),await((S=(b=B(this,xn).config).onSettled)==null?void 0:S.call(b,Z,null,this.state.variables,this.state.context,this,a)),await((j=(k=this.options).onSettled)==null?void 0:j.call(k,Z,null,t,this.state.context,a)),qe(this,qr,ai).call(this,{type:"success",data:Z}),Z}catch(Z){try{await((C=(E=B(this,xn).config).onError)==null?void 0:C.call(E,Z,t,this.state.context,this,a))}catch(te){Promise.reject(te)}try{await((O=(A=this.options).onError)==null?void 0:O.call(A,Z,t,this.state.context,a))}catch(te){Promise.reject(te)}try{await((D=(M=B(this,xn).config).onSettled)==null?void 0:D.call(M,void 0,Z,this.state.variables,this.state.context,this,a))}catch(te){Promise.reject(te)}try{await((L=(z=this.options).onSettled)==null?void 0:L.call(z,void 0,Z,t,this.state.context,a))}catch(te){Promise.reject(te)}throw qe(this,qr,ai).call(this,{type:"error",error:Z}),Z}finally{B(this,xn).runNext(this)}}},ju=new WeakMap,Fr=new WeakMap,xn=new WeakMap,ol=new WeakMap,qr=new WeakSet,ai=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),en.batch(()=>{B(this,Fr).forEach(a=>{a.onMutationUpdate(t)}),B(this,xn).notify({mutation:this,type:"updated",action:t})})},iw);function xw(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var va,Rr,Cu,lw,N2=(lw=class extends Fs{constructor(t={}){super();Ae(this,va);Ae(this,Rr);Ae(this,Cu);this.config=t,xe(this,va,new Set),xe(this,Rr,new Map),xe(this,Cu,0)}build(t,n,a){const l=new E2({client:t,mutationCache:this,mutationId:++Kc(this,Cu)._,options:t.defaultMutationOptions(n),state:a});return this.add(l),l}add(t){B(this,va).add(t);const n=Yc(t);if(typeof n=="string"){const a=B(this,Rr).get(n);a?a.push(t):B(this,Rr).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(B(this,va).delete(t)){const n=Yc(t);if(typeof n=="string"){const a=B(this,Rr).get(n);if(a)if(a.length>1){const l=a.indexOf(t);l!==-1&&a.splice(l,1)}else a[0]===t&&B(this,Rr).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Yc(t);if(typeof n=="string"){const a=B(this,Rr).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=Yc(t);if(typeof n=="string"){const l=(a=B(this,Rr).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(){en.batch(()=>{B(this,va).forEach(t=>{this.notify({type:"removed",mutation:t})}),B(this,va).clear(),B(this,Rr).clear()})}getAll(){return Array.from(B(this,va))}find(t){const n={exact:!0,...t};return this.getAll().find(a=>T0(n,a))}findAll(t={}){return this.getAll().filter(n=>T0(t,n))}notify(t){en.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return en.batch(()=>Promise.all(t.map(n=>n.continue().catch(_n))))}},va=new WeakMap,Rr=new WeakMap,Cu=new WeakMap,lw);function Yc(e){var t;return(t=e.options.scope)==null?void 0:t.id}var ba,fi,qn,xa,wa,gd,$p,sw,_2=(sw=class extends Fs{constructor(n,a){super();Ae(this,wa);Ae(this,ba);Ae(this,fi);Ae(this,qn);Ae(this,xa);xe(this,ba,n),this.setOptions(a),this.bindMethods(),qe(this,wa,gd).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=B(this,ba).defaultMutationOptions(n),Cd(this.options,a)||B(this,ba).getMutationCache().notify({type:"observerOptionsUpdated",mutation:B(this,qn),observer:this}),a!=null&&a.mutationKey&&this.options.mutationKey&&ul(a.mutationKey)!==ul(this.options.mutationKey)?this.reset():((l=B(this,qn))==null?void 0:l.state.status)==="pending"&&B(this,qn).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=B(this,qn))==null||n.removeObserver(this)}onMutationUpdate(n){qe(this,wa,gd).call(this),qe(this,wa,$p).call(this,n)}getCurrentResult(){return B(this,fi)}reset(){var n;(n=B(this,qn))==null||n.removeObserver(this),xe(this,qn,void 0),qe(this,wa,gd).call(this),qe(this,wa,$p).call(this)}mutate(n,a){var l;return xe(this,xa,a),(l=B(this,qn))==null||l.removeObserver(this),xe(this,qn,B(this,ba).getMutationCache().build(B(this,ba),this.options)),B(this,qn).addObserver(this),B(this,qn).execute(n)}},ba=new WeakMap,fi=new WeakMap,qn=new WeakMap,xa=new WeakMap,wa=new WeakSet,gd=function(){var a;const n=((a=B(this,qn))==null?void 0:a.state)??xw();xe(this,fi,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},$p=function(n){en.batch(()=>{var a,l,o,u,f,m,h,g;if(B(this,xa)&&this.hasListeners()){const y=B(this,fi).variables,b=B(this,fi).context,S={client:B(this,ba),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(l=(a=B(this,xa)).onSuccess)==null||l.call(a,n.data,y,b,S)}catch(k){Promise.reject(k)}try{(u=(o=B(this,xa)).onSettled)==null||u.call(o,n.data,null,y,b,S)}catch(k){Promise.reject(k)}}else if((n==null?void 0:n.type)==="error"){try{(m=(f=B(this,xa)).onError)==null||m.call(f,n.error,y,b,S)}catch(k){Promise.reject(k)}try{(g=(h=B(this,xa)).onSettled)==null||g.call(h,void 0,n.error,y,b,S)}catch(k){Promise.reject(k)}}}this.listeners.forEach(y=>{y(B(this,fi))})})},sw),Hr,ow,A2=(ow=class extends Fs{constructor(t={}){super();Ae(this,Hr);this.config=t,xe(this,Hr,new Map)}build(t,n,a){const l=n.queryKey,o=n.queryHash??kg(l,n);let u=this.get(o);return u||(u=new S2({client:t,queryKey:l,queryHash:o,options:t.defaultQueryOptions(n),state:a,defaultOptions:t.getQueryDefaults(l)}),this.add(u)),u}add(t){B(this,Hr).has(t.queryHash)||(B(this,Hr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=B(this,Hr).get(t.queryHash);n&&(t.destroy(),n===t&&B(this,Hr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){en.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return B(this,Hr).get(t)}getAll(){return[...B(this,Hr).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(a=>A0(n,a))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(a=>A0(t,a)):n}notify(t){en.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){en.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){en.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Hr=new WeakMap,ow),Ut,hi,mi,Ts,zs,pi,Rs,Os,uw,T2=(uw=class{constructor(e={}){Ae(this,Ut);Ae(this,hi);Ae(this,mi);Ae(this,Ts);Ae(this,zs);Ae(this,pi);Ae(this,Rs);Ae(this,Os);xe(this,Ut,e.queryCache||new A2),xe(this,hi,e.mutationCache||new N2),xe(this,mi,e.defaultOptions||{}),xe(this,Ts,new Map),xe(this,zs,new Map),xe(this,pi,0)}mount(){Kc(this,pi)._++,B(this,pi)===1&&(xe(this,Rs,wg.subscribe(async e=>{e&&(await this.resumePausedMutations(),B(this,Ut).onFocus())})),xe(this,Os,Ed.subscribe(async e=>{e&&(await this.resumePausedMutations(),B(this,Ut).onOnline())})))}unmount(){var e,t;Kc(this,pi)._--,B(this,pi)===0&&((e=B(this,Rs))==null||e.call(this),xe(this,Rs,void 0),(t=B(this,Os))==null||t.call(this),xe(this,Os,void 0))}isFetching(e){return B(this,Ut).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return B(this,hi).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=B(this,Ut).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=B(this,Ut).build(this,t),a=n.state.data;return a===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(yi(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(a))}getQueriesData(e){return B(this,Ut).findAll(e).map(({queryKey:t,state:n})=>{const a=n.data;return[t,a]})}setQueryData(e,t,n){const a=this.defaultQueryOptions({queryKey:e}),l=B(this,Ut).get(a.queryHash),o=l==null?void 0:l.state.data,u=d2(t,o);if(u!==void 0)return B(this,Ut).build(this,a).setData(u,{...n,manual:!0})}setQueriesData(e,t,n){return en.batch(()=>B(this,Ut).findAll(e).map(({queryKey:a})=>[a,this.setQueryData(a,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=B(this,Ut).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=B(this,Ut);en.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=B(this,Ut);return en.batch(()=>(n.findAll(e).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},a=en.batch(()=>B(this,Ut).findAll(e).map(l=>l.cancel(n)));return Promise.all(a).then(_n).catch(_n)}invalidateQueries(e,t={}){return en.batch(()=>(B(this,Ut).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},a=en.batch(()=>B(this,Ut).findAll(e).filter(l=>!l.isDisabled()&&!l.isStatic()).map(l=>{let o=l.fetch(void 0,n);return n.throwOnError||(o=o.catch(_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=B(this,Ut).build(this,t);return n.isStaleByTime(yi(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=I0(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(_n).catch(_n)}ensureInfiniteQueryData(e){return e.behavior=I0(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Ed.isOnline()?B(this,hi).resumePausedMutations():Promise.resolve()}getQueryCache(){return B(this,Ut)}getMutationCache(){return B(this,hi)}getDefaultOptions(){return B(this,mi)}setDefaultOptions(e){xe(this,mi,e)}setQueryDefaults(e,t){B(this,Ts).set(ul(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...B(this,Ts).values()],n={};return t.forEach(a=>{uu(e,a.queryKey)&&Object.assign(n,a.defaultOptions)}),n}setMutationDefaults(e,t){B(this,zs).set(ul(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...B(this,zs).values()],n={};return t.forEach(a=>{uu(e,a.mutationKey)&&Object.assign(n,a.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...B(this,mi).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=kg(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===jg&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...B(this,mi).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){B(this,Ut).clear(),B(this,hi).clear()}},Ut=new WeakMap,hi=new WeakMap,mi=new WeakMap,Ts=new WeakMap,zs=new WeakMap,pi=new WeakMap,Rs=new WeakMap,Os=new WeakMap,uw),Sw=x.createContext(void 0),zn=e=>{const t=x.useContext(Sw);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},z2=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),c.jsx(Sw.Provider,{value:e,children:t})),ww=x.createContext(!1),R2=()=>x.useContext(ww);ww.Provider;function O2(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var D2=x.createContext(O2()),M2=()=>x.useContext(D2),L2=(e,t,n)=>{const a=n!=null&&n.state.error&&typeof e.throwOnError=="function"?Cg(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||a)&&(t.isReset()||(e.retryOnMount=!1))},I2=e=>{x.useEffect(()=>{e.clearReset()},[e])},U2=({result:e,errorResetBoundary:t,throwOnError:n,query:a,suspense:l})=>e.isError&&!t.isReset()&&!e.isFetching&&a&&(l&&e.data===void 0||Cg(n,[e.error,a])),P2=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))}},B2=(e,t)=>e.isLoading&&e.isFetching&&!t,$2=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,P0=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function F2(e,t,n){var b,S,k,j;const a=R2(),l=M2(),o=zn(),u=o.defaultQueryOptions(e);(S=(b=o.getDefaultOptions().queries)==null?void 0:b._experimental_beforeQuery)==null||S.call(b,u);const f=o.getQueryCache().get(u.queryHash);u._optimisticResults=a?"isRestoring":"optimistic",P2(u),L2(u,l,f),I2(l);const m=!o.getQueryCache().get(u.queryHash),[h]=x.useState(()=>new t(o,u)),g=h.getOptimisticResult(u),y=!a&&e.subscribed!==!1;if(x.useSyncExternalStore(x.useCallback(E=>{const C=y?h.subscribe(en.batchCalls(E)):_n;return h.updateResult(),C},[h,y]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),x.useEffect(()=>{h.setOptions(u)},[u,h]),$2(u,g))throw P0(u,h,l);if(U2({result:g,errorResetBoundary:l,throwOnError:u.throwOnError,query:f,suspense:u.suspense}))throw g.error;if((j=(k=o.getDefaultOptions().queries)==null?void 0:k._experimental_afterQuery)==null||j.call(k,u,g),u.experimental_prefetchInRender&&!cu.isServer()&&B2(g,a)){const E=m?P0(u,h,l):f==null?void 0:f.promise;E==null||E.catch(_n).finally(()=>{h.updateResult()})}return u.notifyOnChangeProps?g:h.trackResult(g)}function Ze(e,t){return F2(e,w2)}function St(e,t){const n=zn(),[a]=x.useState(()=>new _2(n,e));x.useEffect(()=>{a.setOptions(e)},[a,e]);const l=x.useSyncExternalStore(x.useCallback(u=>a.subscribe(en.batchCalls(u)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),o=x.useCallback((u,f)=>{a.mutate(u,f).catch(_n)},[a]);if(l.error&&Cg(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 B0="popstate";function $0(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function q2(e={}){function t(a,l){var h;let o=(h=l.state)==null?void 0:h.masked,{pathname:u,search:f,hash:m}=o||a.location;return Fp("",{pathname:u,search:f,hash:m},l.state&&l.state.usr||null,l.state&&l.state.key||"default",o?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function n(a,l){return typeof l=="string"?l:du(l)}return Z2(t,n,null,e)}function At(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Sr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function H2(){return Math.random().toString(36).substring(2,10)}function F0(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 Fp(e,t,n=null,a,l){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?qs(t):t,state:n,key:t&&t.key||a||H2(),unstable_mask:l}}function du({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 qs(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 Z2(e,t,n,a={}){let{window:l=document.defaultView,v5Compat:o=!1}=a,u=l.history,f="POP",m=null,h=g();h==null&&(h=0,u.replaceState({...u.state,idx:h},""));function g(){return(u.state||{idx:null}).idx}function y(){f="POP";let E=g(),C=E==null?null:E-h;h=E,m&&m({action:f,location:j.location,delta:C})}function b(E,C){f="PUSH";let A=$0(E)?E:Fp(j.location,E,C);h=g()+1;let O=F0(A,h),M=j.createHref(A.unstable_mask||A);try{u.pushState(O,"",M)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;l.location.assign(M)}o&&m&&m({action:f,location:j.location,delta:1})}function S(E,C){f="REPLACE";let A=$0(E)?E:Fp(j.location,E,C);h=g();let O=F0(A,h),M=j.createHref(A.unstable_mask||A);u.replaceState(O,"",M),o&&m&&m({action:f,location:j.location,delta:0})}function k(E){return V2(E)}let j={get action(){return f},get location(){return e(l,u)},listen(E){if(m)throw new Error("A history only accepts one active listener");return l.addEventListener(B0,y),m=E,()=>{l.removeEventListener(B0,y),m=null}},createHref(E){return t(l,E)},createURL:k,encodeLocation(E){let C=k(E);return{pathname:C.pathname,search:C.search,hash:C.hash}},push:b,replace:S,go(E){return u.go(E)}};return j}function V2(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:du(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=n+a),new URL(a,n)}function kw(e,t,n="/"){return Q2(e,t,n,!1)}function Q2(e,t,n,a){let l=typeof t=="string"?qs(t):t,o=ka(l.pathname||"/",n);if(o==null)return null;let u=jw(e);G2(u);let f=null;for(let m=0;f==null&&m<u.length;++m){let h=iA(o);f=rA(u[m],h,a)}return f}function jw(e,t=[],n=[],a="",l=!1){let o=(u,f,m=l,h)=>{let g={relativePath:h===void 0?u.path||"":h,caseSensitive:u.caseSensitive===!0,childrenIndex:f,route:u};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(a)&&m)return;At(g.relativePath.startsWith(a),`Absolute route path "${g.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(a.length)}let y=Qr([a,g.relativePath]),b=n.concat(g);u.children&&u.children.length>0&&(At(u.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),jw(u.children,t,b,y,m)),!(u.path==null&&!u.index)&&t.push({path:y,score:tA(y,u.index),routesMeta:b})};return e.forEach((u,f)=>{var m;if(u.path===""||!((m=u.path)!=null&&m.includes("?")))o(u,f);else for(let h of Cw(u.path))o(u,f,!0,h)}),t}function Cw(e){let t=e.split("/");if(t.length===0)return[];let[n,...a]=t,l=n.endsWith("?"),o=n.replace(/\?$/,"");if(a.length===0)return l?[o,""]:[o];let u=Cw(a.join("/")),f=[];return f.push(...u.map(m=>m===""?o:[o,m].join("/"))),l&&f.push(...u),f.map(m=>e.startsWith("/")&&m===""?"/":m)}function G2(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:nA(t.routesMeta.map(a=>a.childrenIndex),n.routesMeta.map(a=>a.childrenIndex)))}var K2=/^:[\w-]+$/,Y2=3,X2=2,J2=1,W2=10,eA=-2,q0=e=>e==="*";function tA(e,t){let n=e.split("/"),a=n.length;return n.some(q0)&&(a+=eA),t&&(a+=X2),n.filter(l=>!q0(l)).reduce((l,o)=>l+(K2.test(o)?Y2:o===""?J2:W2),a)}function nA(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 rA(e,t,n=!1){let{routesMeta:a}=e,l={},o="/",u=[];for(let f=0;f<a.length;++f){let m=a[f],h=f===a.length-1,g=o==="/"?t:t.slice(o.length)||"/",y=Nd({path:m.relativePath,caseSensitive:m.caseSensitive,end:h},g),b=m.route;if(!y&&h&&n&&!a[a.length-1].route.index&&(y=Nd({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},g)),!y)return null;Object.assign(l,y.params),u.push({params:l,pathname:Qr([o,y.pathname]),pathnameBase:uA(Qr([o,y.pathnameBase])),route:b}),y.pathnameBase!=="/"&&(o=Qr([o,y.pathnameBase]))}return u}function Nd(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,a]=aA(e.path,e.caseSensitive,e.end),l=t.match(n);if(!l)return null;let o=l[0],u=o.replace(/(.)\/+$/,"$1"),f=l.slice(1);return{params:a.reduce((h,{paramName:g,isOptional:y},b)=>{if(g==="*"){let k=f[b]||"";u=o.slice(0,o.length-k.length).replace(/(.)\/+$/,"$1")}const S=f[b];return y&&!S?h[g]=void 0:h[g]=(S||"").replace(/%2F/g,"/"),h},{}),pathname:o,pathnameBase:u,pattern:e}}function aA(e,t=!1,n=!0){Sr(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let a=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(u,f,m,h,g)=>{if(a.push({paramName:f,isOptional:m!=null}),m){let y=g.charAt(h+u.length);return y&&y!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),a]}function iA(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Sr(!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 ka(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 lA=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function sA(e,t="/"){let{pathname:n,search:a="",hash:l=""}=typeof e=="string"?qs(e):e,o;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?o=H0(n.substring(1),"/"):o=H0(n,t)):o=t,{pathname:o,search:cA(a),hash:dA(l)}}function H0(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 Bm(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 oA(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Ng(e){let t=oA(e);return t.map((n,a)=>a===t.length-1?n.pathname:n.pathnameBase)}function Fd(e,t,n,a=!1){let l;typeof e=="string"?l=qs(e):(l={...e},At(!l.pathname||!l.pathname.includes("?"),Bm("?","pathname","search",l)),At(!l.pathname||!l.pathname.includes("#"),Bm("#","pathname","hash",l)),At(!l.search||!l.search.includes("#"),Bm("#","search","hash",l)));let o=e===""||l.pathname==="",u=o?"/":l.pathname,f;if(u==null)f=n;else{let y=t.length-1;if(!a&&u.startsWith("..")){let b=u.split("/");for(;b[0]==="..";)b.shift(),y-=1;l.pathname=b.join("/")}f=y>=0?t[y]:"/"}let m=sA(l,f),h=u&&u!=="/"&&u.endsWith("/"),g=(o||u===".")&&n.endsWith("/");return!m.pathname.endsWith("/")&&(h||g)&&(m.pathname+="/"),m}var Qr=e=>e.join("/").replace(/\/\/+/g,"/"),uA=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),cA=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,dA=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,fA=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 hA(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function mA(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Ew=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Nw(e,t){let n=e;if(typeof n!="string"||!lA.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let a=n,l=!1;if(Ew)try{let o=new URL(window.location.href),u=n.startsWith("//")?new URL(o.protocol+n):new URL(n),f=ka(u.pathname,t);u.origin===o.origin&&f!=null?n=f+u.search+u.hash:l=!0}catch{Sr(!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 _w=["POST","PUT","PATCH","DELETE"];new Set(_w);var pA=["GET",..._w];new Set(pA);var Hs=x.createContext(null);Hs.displayName="DataRouter";var qd=x.createContext(null);qd.displayName="DataRouterState";var gA=x.createContext(!1),Aw=x.createContext({isTransitioning:!1});Aw.displayName="ViewTransition";var yA=x.createContext(new Map);yA.displayName="Fetchers";var vA=x.createContext(null);vA.displayName="Await";var lr=x.createContext(null);lr.displayName="Navigation";var Eu=x.createContext(null);Eu.displayName="Location";var wr=x.createContext({outlet:null,matches:[],isDataRoute:!1});wr.displayName="Route";var _g=x.createContext(null);_g.displayName="RouteError";var Tw="REACT_ROUTER_ERROR",bA="REDIRECT",xA="ROUTE_ERROR_RESPONSE";function SA(e){if(e.startsWith(`${Tw}:${bA}:{`))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 wA(e){if(e.startsWith(`${Tw}:${xA}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new fA(t.status,t.statusText,t.data)}catch{}}function kA(e,{relative:t}={}){At(Zs(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:a}=x.useContext(lr),{hash:l,pathname:o,search:u}=Nu(e,{relative:t}),f=o;return n!=="/"&&(f=o==="/"?n:Qr([n,o])),a.createHref({pathname:f,search:u,hash:l})}function Zs(){return x.useContext(Eu)!=null}function sr(){return At(Zs(),"useLocation() may be used only in the context of a <Router> component."),x.useContext(Eu).location}var zw="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Rw(e){x.useContext(lr).static||x.useLayoutEffect(e)}function kn(){let{isDataRoute:e}=x.useContext(wr);return e?UA():jA()}function jA(){At(Zs(),"useNavigate() may be used only in the context of a <Router> component.");let e=x.useContext(Hs),{basename:t,navigator:n}=x.useContext(lr),{matches:a}=x.useContext(wr),{pathname:l}=sr(),o=JSON.stringify(Ng(a)),u=x.useRef(!1);return Rw(()=>{u.current=!0}),x.useCallback((m,h={})=>{if(Sr(u.current,zw),!u.current)return;if(typeof m=="number"){n.go(m);return}let g=Fd(m,JSON.parse(o),l,h.relative==="path");e==null&&t!=="/"&&(g.pathname=g.pathname==="/"?t:Qr([t,g.pathname])),(h.replace?n.replace:n.push)(g,h.state,h)},[t,n,o,l,e])}var CA=x.createContext(null);function EA(e){let t=x.useContext(wr).outlet;return x.useMemo(()=>t&&x.createElement(CA.Provider,{value:e},t),[t,e])}function Ow(){let{matches:e}=x.useContext(wr),t=e[e.length-1];return t?t.params:{}}function Nu(e,{relative:t}={}){let{matches:n}=x.useContext(wr),{pathname:a}=sr(),l=JSON.stringify(Ng(n));return x.useMemo(()=>Fd(e,JSON.parse(l),a,t==="path"),[e,l,a,t])}function NA(e,t){return Dw(e,t)}function Dw(e,t,n){var E;At(Zs(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=x.useContext(lr),{matches:l}=x.useContext(wr),o=l[l.length-1],u=o?o.params:{},f=o?o.pathname:"/",m=o?o.pathnameBase:"/",h=o&&o.route;{let C=h&&h.path||"";Lw(f,!h||C.endsWith("*")||C.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${C}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
59
+
60
+ Please change the parent <Route path="${C}"> to <Route path="${C==="/"?"*":`${C}/*`}">.`)}let g=sr(),y;if(t){let C=typeof t=="string"?qs(t):t;At(m==="/"||((E=C.pathname)==null?void 0:E.startsWith(m)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${m}" but pathname "${C.pathname}" was given in the \`location\` prop.`),y=C}else y=g;let b=y.pathname||"/",S=b;if(m!=="/"){let C=m.replace(/^\//,"").split("/");S="/"+b.replace(/^\//,"").split("/").slice(C.length).join("/")}let k=kw(e,{pathname:S});Sr(h||k!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),Sr(k==null||k[k.length-1].route.element!==void 0||k[k.length-1].route.Component!==void 0||k[k.length-1].route.lazy!==void 0,`Matched leaf route at location "${y.pathname}${y.search}${y.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let j=RA(k&&k.map(C=>Object.assign({},C,{params:Object.assign({},u,C.params),pathname:Qr([m,a.encodeLocation?a.encodeLocation(C.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?m:Qr([m,a.encodeLocation?a.encodeLocation(C.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathnameBase])})),l,n);return t&&j?x.createElement(Eu.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...y},navigationType:"POP"}},j):j}function _A(){let e=IA(),t=hA(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",l={padding:"0.5rem",backgroundColor:a},o={padding:"2px 4px",backgroundColor:a},u=null;return console.error("Error handled by React Router default ErrorBoundary:",e),u=x.createElement(x.Fragment,null,x.createElement("p",null,"💿 Hey developer 👋"),x.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",x.createElement("code",{style:o},"ErrorBoundary")," or"," ",x.createElement("code",{style:o},"errorElement")," prop on your route.")),x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},t),n?x.createElement("pre",{style:l},n):null,u)}var AA=x.createElement(_A,null),Mw=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=wA(e.digest);n&&(e=n)}let t=e!==void 0?x.createElement(wr.Provider,{value:this.props.routeContext},x.createElement(_g.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?x.createElement(TA,{error:e},t):t}};Mw.contextType=gA;var $m=new WeakMap;function TA({children:e,error:t}){let{basename:n}=x.useContext(lr);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=SA(t.digest);if(a){let l=$m.get(t);if(l)throw l;let o=Nw(a.location,n);if(Ew&&!$m.get(t))if(o.isExternal||a.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const u=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:a.replace}));throw $m.set(t,u),u}return x.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function zA({routeContext:e,match:t,children:n}){let a=x.useContext(Hs);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),x.createElement(wr.Provider,{value:e},n)}function RA(e,t=[],n){let a=n==null?void 0:n.state;if(e==null){if(!a)return null;if(a.errors)e=a.matches;else if(t.length===0&&!a.initialized&&a.matches.length>0)e=a.matches;else return null}let l=e,o=a==null?void 0:a.errors;if(o!=null){let g=l.findIndex(y=>y.route.id&&(o==null?void 0:o[y.route.id])!==void 0);At(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),l=l.slice(0,Math.min(l.length,g+1))}let u=!1,f=-1;if(n&&a){u=a.renderFallback;for(let g=0;g<l.length;g++){let y=l[g];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(f=g),y.route.id){let{loaderData:b,errors:S}=a,k=y.route.loader&&!b.hasOwnProperty(y.route.id)&&(!S||S[y.route.id]===void 0);if(y.route.lazy||k){n.isStatic&&(u=!0),f>=0?l=l.slice(0,f+1):l=[l[0]];break}}}}let m=n==null?void 0:n.onError,h=a&&m?(g,y)=>{var b,S;m(g,{location:a.location,params:((S=(b=a.matches)==null?void 0:b[0])==null?void 0:S.params)??{},unstable_pattern:mA(a.matches),errorInfo:y})}:void 0;return l.reduceRight((g,y,b)=>{let S,k=!1,j=null,E=null;a&&(S=o&&y.route.id?o[y.route.id]:void 0,j=y.route.errorElement||AA,u&&(f<0&&b===0?(Lw("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),k=!0,E=null):f===b&&(k=!0,E=y.route.hydrateFallbackElement||null)));let C=t.concat(l.slice(0,b+1)),A=()=>{let O;return S?O=j:k?O=E:y.route.Component?O=x.createElement(y.route.Component,null):y.route.element?O=y.route.element:O=g,x.createElement(zA,{match:y,routeContext:{outlet:g,matches:C,isDataRoute:a!=null},children:O})};return a&&(y.route.ErrorBoundary||y.route.errorElement||b===0)?x.createElement(Mw,{location:a.location,revalidation:a.revalidation,component:j,error:S,children:A(),routeContext:{outlet:null,matches:C,isDataRoute:!0},onError:h}):A()},null)}function Ag(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function OA(e){let t=x.useContext(Hs);return At(t,Ag(e)),t}function DA(e){let t=x.useContext(qd);return At(t,Ag(e)),t}function MA(e){let t=x.useContext(wr);return At(t,Ag(e)),t}function Tg(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 LA(){return Tg("useRouteId")}function IA(){var a;let e=x.useContext(_g),t=DA("useRouteError"),n=Tg("useRouteError");return e!==void 0?e:(a=t.errors)==null?void 0:a[n]}function UA(){let{router:e}=OA("useNavigate"),t=Tg("useNavigate"),n=x.useRef(!1);return Rw(()=>{n.current=!0}),x.useCallback(async(l,o={})=>{Sr(n.current,zw),n.current&&(typeof l=="number"?await e.navigate(l):await e.navigate(l,{fromRouteId:t,...o}))},[e,t])}var Z0={};function Lw(e,t,n){!t&&!Z0[e]&&(Z0[e]=!0,Sr(!1,n))}x.memo(PA);function PA({routes:e,future:t,state:n,isStatic:a,onError:l}){return Dw(e,void 0,{state:n,isStatic:a,onError:l})}function Hd({to:e,replace:t,state:n,relative:a}){At(Zs(),"<Navigate> may be used only in the context of a <Router> component.");let{static:l}=x.useContext(lr);Sr(!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(wr),{pathname:u}=sr(),f=kn(),m=Fd(e,Ng(o),u,a==="path"),h=JSON.stringify(m);return x.useEffect(()=>{f(JSON.parse(h),{replace:t,state:n,relative:a})},[f,h,a,t,n]),null}function qp(e){return EA(e.context)}function tr(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:u}){At(!Zs(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),m=x.useMemo(()=>({basename:f,navigator:l,static:o,unstable_useTransitions:u,future:{}}),[f,l,o,u]);typeof n=="string"&&(n=qs(n));let{pathname:h="/",search:g="",hash:y="",state:b=null,key:S="default",unstable_mask:k}=n,j=x.useMemo(()=>{let E=ka(h,f);return E==null?null:{location:{pathname:E,search:g,hash:y,state:b,key:S,unstable_mask:k},navigationType:a}},[f,h,g,y,b,S,a,k]);return Sr(j!=null,`<Router basename="${f}"> is not able to match the URL "${h}${g}${y}" because it does not start with the basename, so the <Router> won't render anything.`),j==null?null:x.createElement(lr.Provider,{value:m},x.createElement(Eu.Provider,{children:t,value:j}))}function $A({children:e,location:t}){return NA(Hp(e),t)}function Hp(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,Hp(a.props.children,o));return}At(a.type===tr,`[${typeof a.type=="string"?a.type:a.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),At(!a.props.index||!a.props.children,"An index route cannot have child routes.");let u={id:a.props.id||o.join("-"),caseSensitive:a.props.caseSensitive,element:a.props.element,Component:a.props.Component,index:a.props.index,path:a.props.path,middleware:a.props.middleware,loader:a.props.loader,action:a.props.action,hydrateFallbackElement:a.props.hydrateFallbackElement,HydrateFallback:a.props.HydrateFallback,errorElement:a.props.errorElement,ErrorBoundary:a.props.ErrorBoundary,hasErrorBoundary:a.props.hasErrorBoundary===!0||a.props.ErrorBoundary!=null||a.props.errorElement!=null,shouldRevalidate:a.props.shouldRevalidate,handle:a.props.handle,lazy:a.props.lazy};a.props.children&&(u.children=Hp(a.props.children,o)),n.push(u)}),n}var yd="get",vd="application/x-www-form-urlencoded";function Zd(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function FA(e){return Zd(e)&&e.tagName.toLowerCase()==="button"}function qA(e){return Zd(e)&&e.tagName.toLowerCase()==="form"}function HA(e){return Zd(e)&&e.tagName.toLowerCase()==="input"}function ZA(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function VA(e,t){return e.button===0&&(!t||t==="_self")&&!ZA(e)}function Zp(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 QA(e,t){let n=Zp(e);return t&&t.forEach((a,l)=>{n.has(l)||t.getAll(l).forEach(o=>{n.append(l,o)})}),n}var Xc=null;function GA(){if(Xc===null)try{new FormData(document.createElement("form"),0),Xc=!1}catch{Xc=!0}return Xc}var KA=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Fm(e){return e!=null&&!KA.has(e)?(Sr(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${vd}"`),null):e}function YA(e,t){let n,a,l,o,u;if(qA(e)){let f=e.getAttribute("action");a=f?ka(f,t):null,n=e.getAttribute("method")||yd,l=Fm(e.getAttribute("enctype"))||vd,o=new FormData(e)}else if(FA(e)||HA(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?ka(m,t):null,n=e.getAttribute("formmethod")||f.getAttribute("method")||yd,l=Fm(e.getAttribute("formenctype"))||Fm(f.getAttribute("enctype"))||vd,o=new FormData(f,e),!GA()){let{name:h,type:g,value:y}=e;if(g==="image"){let b=h?`${h}.`:"";o.append(`${b}x`,"0"),o.append(`${b}y`,"0")}else h&&o.append(h,y)}}else{if(Zd(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=yd,a=null,l=vd,u=e}return o&&l==="text/plain"&&(u=o,o=void 0),{action:a,method:n.toLowerCase(),encType:l,formData:o,body:u}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function zg(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function XA(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&&ka(l.pathname,t)==="/"?l.pathname=`${t.replace(/\/$/,"")}/_root.${a}`:l.pathname=`${l.pathname.replace(/\/$/,"")}.${a}`,l}async function JA(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 WA(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 eT(e,t,n){let a=await Promise.all(e.map(async l=>{let o=t.routes[l.route.id];if(o){let u=await JA(o,n);return u.links?u.links():[]}return[]}));return aT(a.flat(1).filter(WA).filter(l=>l.rel==="stylesheet"||l.rel==="preload").map(l=>l.rel==="stylesheet"?{...l,rel:"prefetch",as:"style"}:{...l,rel:"prefetch"}))}function V0(e,t,n,a,l,o){let u=(m,h)=>n[h]?m.route.id!==n[h].route.id:!0,f=(m,h)=>{var g;return n[h].pathname!==m.pathname||((g=n[h].route.path)==null?void 0:g.endsWith("*"))&&n[h].params["*"]!==m.params["*"]};return o==="assets"?t.filter((m,h)=>u(m,h)||f(m,h)):o==="data"?t.filter((m,h)=>{var y;let g=a.routes[m.route.id];if(!g||!g.hasLoader)return!1;if(u(m,h)||f(m,h))return!0;if(m.route.shouldRevalidate){let b=m.route.shouldRevalidate({currentUrl:new URL(l.pathname+l.search+l.hash,window.origin),currentParams:((y=n[0])==null?void 0:y.params)||{},nextUrl:new URL(e,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof b=="boolean")return b}return!0}):[]}function tT(e,t,{includeHydrateFallback:n}={}){return nT(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 nT(e){return[...new Set(e)]}function rT(e){let t={},n=Object.keys(e).sort();for(let a of n)t[a]=e[a];return t}function aT(e,t){let n=new Set;return new Set(t),e.reduce((a,l)=>{let o=JSON.stringify(rT(l));return n.has(o)||(n.add(o),a.push({key:o,link:l})),a},[])}function Iw(){let e=x.useContext(Hs);return zg(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function iT(){let e=x.useContext(qd);return zg(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Rg=x.createContext(void 0);Rg.displayName="FrameworkContext";function Uw(){let e=x.useContext(Rg);return zg(e,"You must render this element inside a <HydratedRouter> element"),e}function lT(e,t){let n=x.useContext(Rg),[a,l]=x.useState(!1),[o,u]=x.useState(!1),{onFocus:f,onBlur:m,onMouseEnter:h,onMouseLeave:g,onTouchStart:y}=t,b=x.useRef(null);x.useEffect(()=>{if(e==="render"&&u(!0),e==="viewport"){let j=C=>{C.forEach(A=>{u(A.isIntersecting)})},E=new IntersectionObserver(j,{threshold:.5});return b.current&&E.observe(b.current),()=>{E.disconnect()}}},[e]),x.useEffect(()=>{if(a){let j=setTimeout(()=>{u(!0)},100);return()=>{clearTimeout(j)}}},[a]);let S=()=>{l(!0)},k=()=>{l(!1),u(!1)};return n?e!=="intent"?[o,b,{}]:[o,b,{onFocus:Zo(f,S),onBlur:Zo(m,k),onMouseEnter:Zo(h,S),onMouseLeave:Zo(g,k),onTouchStart:Zo(y,S)}]:[!1,b,{}]}function Zo(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function sT({page:e,...t}){let{router:n}=Iw(),a=x.useMemo(()=>kw(n.routes,e,n.basename),[n.routes,e,n.basename]);return a?x.createElement(uT,{page:e,matches:a,...t}):null}function oT(e){let{manifest:t,routeModules:n}=Uw(),[a,l]=x.useState([]);return x.useEffect(()=>{let o=!1;return eT(e,t,n).then(u=>{o||l(u)}),()=>{o=!0}},[e,t,n]),a}function uT({page:e,matches:t,...n}){let a=sr(),{future:l,manifest:o,routeModules:u}=Uw(),{basename:f}=Iw(),{loaderData:m,matches:h}=iT(),g=x.useMemo(()=>V0(e,t,h,o,a,"data"),[e,t,h,o,a]),y=x.useMemo(()=>V0(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(A=>{var M;let O=o.routes[A.route.id];!O||!O.hasLoader||(!g.some(D=>D.route.id===A.route.id)&&A.route.id in m&&((M=u[A.route.id])!=null&&M.shouldRevalidate)||O.hasClientLoader?E=!0:j.add(A.route.id))}),j.size===0)return[];let C=XA(e,f,l.unstable_trailingSlashAwareDataRequests,"data");return E&&j.size>0&&C.searchParams.set("_routes",t.filter(A=>j.has(A.route.id)).map(A=>A.route.id).join(",")),[C.pathname+C.search]},[f,l.unstable_trailingSlashAwareDataRequests,m,a,o,g,t,e,u]),S=x.useMemo(()=>tT(y,o),[y,o]),k=oT(y);return x.createElement(x.Fragment,null,b.map(j=>x.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...n})),S.map(j=>x.createElement("link",{key:j,rel:"modulepreload",href:j,...n})),k.map(({key:j,link:E})=>x.createElement("link",{key:j,nonce:n.nonce,...E,crossOrigin:E.crossOrigin??n.crossOrigin})))}function cT(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var dT=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{dT&&(window.__reactRouterVersion="7.13.1")}catch{}function fT({basename:e,children:t,unstable_useTransitions:n,window:a}){let l=x.useRef();l.current==null&&(l.current=q2({window:a,v5Compat:!0}));let o=l.current,[u,f]=x.useState({action:o.action,location:o.location}),m=x.useCallback(h=>{n===!1?f(h):x.startTransition(()=>f(h))},[n]);return x.useLayoutEffect(()=>o.listen(m),[o,m]),x.createElement(BA,{basename:e,children:t,location:u.location,navigationType:u.action,navigator:o,unstable_useTransitions:n})}var Pw=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Bw=x.forwardRef(function({onClick:t,discover:n="render",prefetch:a="none",relative:l,reloadDocument:o,replace:u,unstable_mask:f,state:m,target:h,to:g,preventScrollReset:y,viewTransition:b,unstable_defaultShouldRevalidate:S,...k},j){let{basename:E,navigator:C,unstable_useTransitions:A}=x.useContext(lr),O=typeof g=="string"&&Pw.test(g),M=Nw(g,E);g=M.to;let D=kA(g,{relative:l}),z=sr(),L=null;if(f){let ee=Fd(f,[],z.unstable_mask?z.unstable_mask.pathname:"/",!0);E!=="/"&&(ee.pathname=ee.pathname==="/"?E:Qr([E,ee.pathname])),L=C.createHref(ee)}let[Z,te,q]=lT(a,k),oe=pT(g,{replace:u,unstable_mask:f,state:m,target:h,preventScrollReset:y,relative:l,viewTransition:b,unstable_defaultShouldRevalidate:S,unstable_useTransitions:A});function W(ee){t&&t(ee),ee.defaultPrevented||oe(ee)}let me=!(M.isExternal||o),fe=x.createElement("a",{...k,...q,href:(me?L:void 0)||M.absoluteURL||D,onClick:me?W:t,ref:cT(j,te),target:h,"data-discover":!O&&n==="render"?"true":void 0});return Z&&!O?x.createElement(x.Fragment,null,fe,x.createElement(sT,{page:D})):fe});Bw.displayName="Link";var $w=x.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:a="",end:l=!1,style:o,to:u,viewTransition:f,children:m,...h},g){let y=Nu(u,{relative:h.relative}),b=sr(),S=x.useContext(qd),{navigator:k,basename:j}=x.useContext(lr),E=S!=null&&xT(y)&&f===!0,C=k.encodeLocation?k.encodeLocation(y).pathname:y.pathname,A=b.pathname,O=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;n||(A=A.toLowerCase(),O=O?O.toLowerCase():null,C=C.toLowerCase()),O&&j&&(O=ka(O,j)||O);const M=C!=="/"&&C.endsWith("/")?C.length-1:C.length;let D=A===C||!l&&A.startsWith(C)&&A.charAt(M)==="/",z=O!=null&&(O===C||!l&&O.startsWith(C)&&O.charAt(C.length)==="/"),L={isActive:D,isPending:z,isTransitioning:E},Z=D?t:void 0,te;typeof a=="function"?te=a(L):te=[a,D?"active":null,z?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let q=typeof o=="function"?o(L):o;return x.createElement(Bw,{...h,"aria-current":Z,className:te,ref:g,style:q,to:u,viewTransition:f},typeof m=="function"?m(L):m)});$w.displayName="NavLink";var hT=x.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:a,replace:l,state:o,method:u=yd,action:f,onSubmit:m,relative:h,preventScrollReset:g,viewTransition:y,unstable_defaultShouldRevalidate:b,...S},k)=>{let{unstable_useTransitions:j}=x.useContext(lr),E=vT(),C=bT(f,{relative:h}),A=u.toLowerCase()==="get"?"get":"post",O=typeof f=="string"&&Pw.test(f),M=D=>{if(m&&m(D),D.defaultPrevented)return;D.preventDefault();let z=D.nativeEvent.submitter,L=(z==null?void 0:z.getAttribute("formmethod"))||u,Z=()=>E(z||D.currentTarget,{fetcherKey:t,method:L,navigate:n,replace:l,state:o,relative:h,preventScrollReset:g,viewTransition:y,unstable_defaultShouldRevalidate:b});j&&n!==!1?x.startTransition(()=>Z()):Z()};return x.createElement("form",{ref:k,method:A,action:C,onSubmit:a?m:M,...S,"data-discover":!O&&e==="render"?"true":void 0})});hT.displayName="Form";function mT(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Fw(e){let t=x.useContext(Hs);return At(t,mT(e)),t}function pT(e,{target:t,replace:n,unstable_mask:a,state:l,preventScrollReset:o,relative:u,viewTransition:f,unstable_defaultShouldRevalidate:m,unstable_useTransitions:h}={}){let g=kn(),y=sr(),b=Nu(e,{relative:u});return x.useCallback(S=>{if(VA(S,t)){S.preventDefault();let k=n!==void 0?n:du(y)===du(b),j=()=>g(e,{replace:k,unstable_mask:a,state:l,preventScrollReset:o,relative:u,viewTransition:f,unstable_defaultShouldRevalidate:m});h?x.startTransition(()=>j()):j()}},[y,g,b,n,a,l,t,e,o,u,f,m,h])}function Vd(e){Sr(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(Zp(e)),n=x.useRef(!1),a=sr(),l=x.useMemo(()=>QA(a.search,n.current?null:t.current),[a.search]),o=kn(),u=x.useCallback((f,m)=>{const h=Zp(typeof f=="function"?f(new URLSearchParams(l)):f);n.current=!0,o("?"+h,m)},[o,l]);return[l,u]}var gT=0,yT=()=>`__${String(++gT)}__`;function vT(){let{router:e}=Fw("useSubmit"),{basename:t}=x.useContext(lr),n=LA(),a=e.fetch,l=e.navigate;return x.useCallback(async(o,u={})=>{let{action:f,method:m,encType:h,formData:g,body:y}=YA(o,t);if(u.navigate===!1){let b=u.fetcherKey||yT();await a(b,n,u.action||f,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:g,body:y,formMethod:u.method||m,formEncType:u.encType||h,flushSync:u.flushSync})}else await l(u.action||f,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:g,body:y,formMethod:u.method||m,formEncType:u.encType||h,replace:u.replace,state:u.state,fromRouteId:n,flushSync:u.flushSync,viewTransition:u.viewTransition})},[a,l,t,n])}function bT(e,{relative:t}={}){let{basename:n}=x.useContext(lr),a=x.useContext(wr);At(a,"useFormAction must be used inside a RouteContext");let[l]=a.matches.slice(-1),o={...Nu(e||".",{relative:t})},u=sr();if(e==null){o.search=u.search;let f=new URLSearchParams(o.search),m=f.getAll("index");if(m.some(g=>g==="")){f.delete("index"),m.filter(y=>y).forEach(y=>f.append("index",y));let g=f.toString();o.search=g?`?${g}`:""}}return(!e||e===".")&&l.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:Qr([n,o.pathname])),du(o)}function xT(e,{relative:t}={}){let n=x.useContext(Aw);At(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=Fw("useViewTransitionState"),l=Nu(e,{relative:t});if(!n.isTransitioning)return!1;let o=ka(n.currentLocation.pathname,a)||n.currentLocation.pathname,u=ka(n.nextLocation.pathname,a)||n.nextLocation.pathname;return Nd(l.pathname,u)!=null||Nd(l.pathname,o)!=null}const ST="/api/v1";async function wT(e,t){const n=await fetch(`${ST}/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 qw="/api/v1",Og="first-tree-hub:tokens";function Dg(){const e=localStorage.getItem(Og);if(!e)return null;try{return JSON.parse(e)}catch{return null}}function Vp(e){localStorage.setItem(Og,JSON.stringify(e))}function Hw(){localStorage.removeItem(Og)}class Qd extends Error{constructor(t,n,a){super(n),this.status=t,this.issues=a,this.name="ApiError"}}let Vo=null;async function kT(e){return Vo||(Vo=(async()=>{try{const t=await fetch(`${qw}/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 Vp(a),a}catch{return null}finally{Vo=null}})(),Vo)}async function Jc(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(`${qw}${e}`,{method:n,headers:m,body:a!==void 0?JSON.stringify(a):void 0})},o=Dg();let u=await l(o==null?void 0:o.accessToken);if(u.status===401&&(o!=null&&o.refreshToken)){const f=await kT(o.refreshToken);f&&(u=await l(f.accessToken))}if(!u.ok){u.status===401&&(Hw(),window.dispatchEvent(new CustomEvent("auth:logout")));const f=await u.text();let m,h;try{const g=JSON.parse(f);m=g.error??f,Array.isArray(g.details)&&(h=g.details.filter(y=>typeof y=="object"&&y!==null&&Array.isArray(y.path)))}catch{m=f}throw new Qd(u.status,m,h)}if(u.status!==204)return await u.json()}const Ce={get:e=>Jc(e),post:(e,t)=>Jc(e,{method:"POST",body:t}),patch:(e,t)=>Jc(e,{method:"PATCH",body:t}),delete:e=>Jc(e,{method:"DELETE"})},Zw=x.createContext(null);function jT({children:e}){const[t,n]=x.useState(()=>!!Dg()),[a,l]=x.useState(null),[o,u]=x.useState(null),[f,m]=x.useState(null),[h,g]=x.useState(null),[y,b]=x.useState(null),[S,k]=x.useState(null),j=x.useCallback(()=>{Hw(),n(!1),l(null),u(null),m(null),g(null),b(null),k(null)},[]),E=x.useCallback(async()=>{var O;try{const M=await Ce.get("/me");l(M.member.role),u(M.member.id),m(M.member.agentId),g(M.member.organizationId),b(M.user??null),k(((O=M.wizard)==null?void 0:O.step)??null)}catch{}},[]),C=x.useCallback(async(O,M)=>{const D=await wT(O,M);Vp({accessToken:D.accessToken,refreshToken:D.refreshToken}),n(!0),await E()},[E]),A=x.useCallback(async O=>{Vp(O),n(!0),await E()},[E]);return x.useEffect(()=>{t&&!a&&E()},[t,a,E]),x.useEffect(()=>{const O=()=>j();return window.addEventListener("auth:logout",O),()=>window.removeEventListener("auth:logout",O)},[j]),c.jsx(Zw.Provider,{value:{isAuthenticated:t,role:a,memberId:o,agentId:f,organizationId:h,user:y,wizardStep:S,login:C,adoptTokens:A,refreshMe:E,logout:j},children:e})}function rn(){const e=x.useContext(Zw);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}function CT(){const{isAuthenticated:e}=rn();return e?c.jsx(qp,{}):c.jsx(Hd,{to:"/login",replace:!0})}/**
61
+ * @license lucide-react v0.577.0 - ISC
62
+ *
63
+ * This source code is licensed under the ISC license.
64
+ * See the LICENSE file in the root directory of this source tree.
65
+ */const Vw=(...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 ET=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 NT=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 Q0=e=>{const t=NT(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 _T={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 AT=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 TT=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:l="",children:o,iconNode:u,...f},m)=>x.createElement("svg",{ref:m,..._T,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:Vw("lucide",l),...!o&&!AT(f)&&{"aria-hidden":"true"},...f},[...u.map(([h,g])=>x.createElement(h,g)),...Array.isArray(o)?o:[o]]));/**
96
+ * @license lucide-react v0.577.0 - ISC
97
+ *
98
+ * This source code is licensed under the ISC license.
99
+ * See the LICENSE file in the root directory of this source tree.
100
+ */const st=(e,t)=>{const n=x.forwardRef(({className:a,...l},o)=>x.createElement(TT,{ref:o,iconNode:t,className:Vw(`lucide-${ET(Q0(e))}`,`lucide-${e}`,a),...l}));return n.displayName=Q0(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 zT=[["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"}]],RT=st("bell",zT);/**
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 OT=[["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"}]],DT=st("bot",OT);/**
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 MT=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],bi=st("check",MT);/**
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 LT=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],IT=st("chevron-down",LT);/**
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 UT=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],PT=st("chevron-right",UT);/**
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 BT=[["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"}]],Mg=st("copy",BT);/**
131
+ * @license lucide-react v0.577.0 - ISC
132
+ *
133
+ * This source code is licensed under the ISC license.
134
+ * See the LICENSE file in the root directory of this source tree.
135
+ */const $T=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],FT=st("eye-off",$T);/**
136
+ * @license lucide-react v0.577.0 - ISC
137
+ *
138
+ * This source code is licensed under the ISC license.
139
+ * See the LICENSE file in the root directory of this source tree.
140
+ */const qT=[["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"}]],HT=st("eye",qT);/**
141
+ * @license lucide-react v0.577.0 - ISC
142
+ *
143
+ * This source code is licensed under the ISC license.
144
+ * See the LICENSE file in the root directory of this source tree.
145
+ */const ZT=[["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"}]],Qw=st("github",ZT);/**
146
+ * @license lucide-react v0.577.0 - ISC
147
+ *
148
+ * This source code is licensed under the ISC license.
149
+ * See the LICENSE file in the root directory of this source tree.
150
+ */const VT=[["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"}]],QT=st("layout-dashboard",VT);/**
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 GT=[["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"}]],Gw=st("link-2",GT);/**
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 KT=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],YT=st("loader-circle",KT);/**
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 XT=[["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"}]],Kw=st("lock",XT);/**
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 JT=[["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"}]],WT=st("log-out",JT);/**
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 ez=[["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"}]],Lg=st("message-square",ez);/**
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 tz=[["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"}]],nz=st("moon",tz);/**
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 rz=[["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"}]],az=st("paperclip",rz);/**
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 iz=[["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"}]],lz=st("pause",iz);/**
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 sz=[["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"}]],_u=st("pencil",sz);/**
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 oz=[["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"}]],Yw=st("play",oz);/**
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 uz=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ja=st("plus",uz);/**
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 cz=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Gd=st("search",cz);/**
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 dz=[["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"}]],fz=st("send",dz);/**
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 hz=[["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"}]],mz=st("settings",hz);/**
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 pz=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],gz=st("square",pz);/**
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 yz=[["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"}]],vz=st("sun",yz);/**
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 bz=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],xz=st("terminal",bz);/**
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 Sz=[["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"}]],Ds=st("trash-2",Sz);/**
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 wz=[["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"}]],kz=st("triangle-alert",wz);/**
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 jz=[["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"}]],Cz=st("undo-2",jz);/**
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 Ez=[["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"}]],Nz=st("unplug",Ez);/**
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 _z=[["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"}]],Az=st("user-plus",_z);/**
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 Tz=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],fu=st("x",Tz);function Xw(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=Xw(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function Jw(){for(var e,t,n=0,a="",l=arguments.length;n<l;n++)(e=arguments[n])&&(t=Xw(e))&&(a&&(a+=" "),a+=t);return a}const zz=(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},Rz=(e,t)=>({classGroupId:e,validator:t}),Ww=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),_d="-",G0=[],Oz="arbitrary..",Dz=e=>{const t=Lz(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return Mz(u);const f=u.split(_d),m=f[0]===""&&f.length>1?1:0;return ek(f,m,t)},getConflictingClassGroupIds:(u,f)=>{if(f){const m=a[u],h=n[u];return m?h?zz(h,m):m:h||G0}return n[u]||G0}}},ek=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const l=e[t],o=n.nextPart.get(l);if(o){const h=ek(e,t+1,o);if(h)return h}const u=n.validators;if(u===null)return;const f=t===0?e.join(_d):e.slice(t).join(_d),m=u.length;for(let h=0;h<m;h++){const g=u[h];if(g.validator(f))return g.classGroupId}},Mz=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?Oz+a:void 0})(),Lz=e=>{const{theme:t,classGroups:n}=e;return Iz(n,t)},Iz=(e,t)=>{const n=Ww();for(const a in e){const l=e[a];Ig(l,n,a,t)}return n},Ig=(e,t,n,a)=>{const l=e.length;for(let o=0;o<l;o++){const u=e[o];Uz(u,t,n,a)}},Uz=(e,t,n,a)=>{if(typeof e=="string"){Pz(e,t,n);return}if(typeof e=="function"){Bz(e,t,n,a);return}$z(e,t,n,a)},Pz=(e,t,n)=>{const a=e===""?t:tk(t,e);a.classGroupId=n},Bz=(e,t,n,a)=>{if(Fz(e)){Ig(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(Rz(n,e))},$z=(e,t,n,a)=>{const l=Object.entries(e),o=l.length;for(let u=0;u<o;u++){const[f,m]=l[u];Ig(m,tk(t,f),n,a)}},tk=(e,t)=>{let n=e;const a=t.split(_d),l=a.length;for(let o=0;o<l;o++){const u=a[o];let f=n.nextPart.get(u);f||(f=Ww(),n.nextPart.set(u,f)),n=f}return n},Fz=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,qz=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),a=Object.create(null);const l=(o,u)=>{n[o]=u,t++,t>e&&(t=0,a=n,n=Object.create(null))};return{get(o){let u=n[o];if(u!==void 0)return u;if((u=a[o])!==void 0)return l(o,u),u},set(o,u){o in n?n[o]=u:l(o,u)}}},Qp="!",K0=":",Hz=[],Y0=(e,t,n,a,l)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:l}),Zz=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=l=>{const o=[];let u=0,f=0,m=0,h;const g=l.length;for(let j=0;j<g;j++){const E=l[j];if(u===0&&f===0){if(E===K0){o.push(l.slice(m,j)),m=j+1;continue}if(E==="/"){h=j;continue}}E==="["?u++:E==="]"?u--:E==="("?f++:E===")"&&f--}const y=o.length===0?l:l.slice(m);let b=y,S=!1;y.endsWith(Qp)?(b=y.slice(0,-1),S=!0):y.startsWith(Qp)&&(b=y.slice(1),S=!0);const k=h&&h>m?h-m:void 0;return Y0(o,S,b,k)};if(t){const l=t+K0,o=a;a=u=>u.startsWith(l)?o(u.slice(l.length)):Y0(Hz,!1,u,void 0,!0)}if(n){const l=a;a=o=>n({className:o,parseClassName:l})}return a},Vz=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,a)=>{t.set(n,1e6+a)}),n=>{const a=[];let l=[];for(let o=0;o<n.length;o++){const u=n[o],f=u[0]==="[",m=t.has(u);f||m?(l.length>0&&(l.sort(),a.push(...l),l=[]),a.push(u)):l.push(u)}return l.length>0&&(l.sort(),a.push(...l)),a}},Qz=e=>({cache:qz(e.cacheSize),parseClassName:Zz(e),sortModifiers:Vz(e),...Dz(e)}),Gz=/\s+/,Kz=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:l,sortModifiers:o}=t,u=[],f=e.trim().split(Gz);let m="";for(let h=f.length-1;h>=0;h-=1){const g=f[h],{isExternal:y,modifiers:b,hasImportantModifier:S,baseClassName:k,maybePostfixModifierPosition:j}=n(g);if(y){m=g+(m.length>0?" "+m:m);continue}let E=!!j,C=a(E?k.substring(0,j):k);if(!C){if(!E){m=g+(m.length>0?" "+m:m);continue}if(C=a(k),!C){m=g+(m.length>0?" "+m:m);continue}E=!1}const A=b.length===0?"":b.length===1?b[0]:o(b).join(":"),O=S?A+Qp:A,M=O+C;if(u.indexOf(M)>-1)continue;u.push(M);const D=l(C,E);for(let z=0;z<D.length;++z){const L=D[z];u.push(O+L)}m=g+(m.length>0?" "+m:m)}return m},Yz=(...e)=>{let t=0,n,a,l="";for(;t<e.length;)(n=e[t++])&&(a=nk(n))&&(l&&(l+=" "),l+=a);return l},nk=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=nk(e[a]))&&(n&&(n+=" "),n+=t);return n},Xz=(e,...t)=>{let n,a,l,o;const u=m=>{const h=t.reduce((g,y)=>y(g),e());return n=Qz(h),a=n.cache.get,l=n.cache.set,o=f,f(m)},f=m=>{const h=a(m);if(h)return h;const g=Kz(m,n);return l(m,g),g};return o=u,(...m)=>o(Yz(...m))},Jz=[],Wt=e=>{const t=n=>n[e]||Jz;return t.isThemeGetter=!0,t},rk=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ak=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Wz=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,eR=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,tR=/\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$/,nR=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,rR=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,aR=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ti=e=>Wz.test(e),Ve=e=>!!e&&!Number.isNaN(Number(e)),ni=e=>!!e&&Number.isInteger(Number(e)),qm=e=>e.endsWith("%")&&Ve(e.slice(0,-1)),pa=e=>eR.test(e),ik=()=>!0,iR=e=>tR.test(e)&&!nR.test(e),Ug=()=>!1,lR=e=>rR.test(e),sR=e=>aR.test(e),oR=e=>!ke(e)&&!je(e),uR=e=>Ci(e,ok,Ug),ke=e=>rk.test(e),Xi=e=>Ci(e,uk,iR),X0=e=>Ci(e,yR,Ve),cR=e=>Ci(e,dk,ik),dR=e=>Ci(e,ck,Ug),J0=e=>Ci(e,lk,Ug),fR=e=>Ci(e,sk,sR),Wc=e=>Ci(e,fk,lR),je=e=>ak.test(e),Qo=e=>gl(e,uk),hR=e=>gl(e,ck),W0=e=>gl(e,lk),mR=e=>gl(e,ok),pR=e=>gl(e,sk),ed=e=>gl(e,fk,!0),gR=e=>gl(e,dk,!0),Ci=(e,t,n)=>{const a=rk.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},gl=(e,t,n=!1)=>{const a=ak.exec(e);return a?a[1]?t(a[1]):n:!1},lk=e=>e==="position"||e==="percentage",sk=e=>e==="image"||e==="url",ok=e=>e==="length"||e==="size"||e==="bg-size",uk=e=>e==="length",yR=e=>e==="number",ck=e=>e==="family-name",dk=e=>e==="number"||e==="weight",fk=e=>e==="shadow",vR=()=>{const e=Wt("color"),t=Wt("font"),n=Wt("text"),a=Wt("font-weight"),l=Wt("tracking"),o=Wt("leading"),u=Wt("breakpoint"),f=Wt("container"),m=Wt("spacing"),h=Wt("radius"),g=Wt("shadow"),y=Wt("inset-shadow"),b=Wt("text-shadow"),S=Wt("drop-shadow"),k=Wt("blur"),j=Wt("perspective"),E=Wt("aspect"),C=Wt("ease"),A=Wt("animate"),O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...M(),je,ke],z=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto","contain","none"],Z=()=>[je,ke,m],te=()=>[ti,"full","auto",...Z()],q=()=>[ni,"none","subgrid",je,ke],oe=()=>["auto",{span:["full",ni,je,ke]},ni,je,ke],W=()=>[ni,"auto",je,ke],me=()=>["auto","min","max","fr",je,ke],fe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ee=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...Z()],re=()=>[ti,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...Z()],K=()=>[ti,"screen","full","dvw","lvw","svw","min","max","fit",...Z()],he=()=>[ti,"screen","full","lh","dvh","lvh","svh","min","max","fit",...Z()],T=()=>[e,je,ke],U=()=>[...M(),W0,J0,{position:[je,ke]}],P=()=>["no-repeat",{repeat:["","x","y","space","round"]}],_=()=>["auto","cover","contain",mR,uR,{size:[je,ke]}],$=()=>[qm,Qo,Xi],X=()=>["","none","full",h,je,ke],ue=()=>["",Ve,Qo,Xi],Se=()=>["solid","dashed","dotted","double"],Me=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ye=()=>[Ve,qm,W0,J0],ct=()=>["","none",k,je,ke],ae=()=>["none",Ve,je,ke],De=()=>["none",Ve,je,ke],at=()=>[Ve,je,ke],Pe=()=>[ti,"full",...Z()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[pa],breakpoint:[pa],color:[ik],container:[pa],"drop-shadow":[pa],ease:["in","out","in-out"],font:[oR],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[pa],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[pa],shadow:[pa],spacing:["px",Ve],text:[pa],"text-shadow":[pa],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ti,ke,je,E]}],container:["container"],columns:[{columns:[Ve,ke,je,f]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:D()}],overflow:[{overflow:z()}],"overflow-x":[{"overflow-x":z()}],"overflow-y":[{"overflow-y":z()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:te()}],"inset-x":[{"inset-x":te()}],"inset-y":[{"inset-y":te()}],start:[{"inset-s":te(),start:te()}],end:[{"inset-e":te(),end:te()}],"inset-bs":[{"inset-bs":te()}],"inset-be":[{"inset-be":te()}],top:[{top:te()}],right:[{right:te()}],bottom:[{bottom:te()}],left:[{left:te()}],visibility:["visible","invisible","collapse"],z:[{z:[ni,"auto",je,ke]}],basis:[{basis:[ti,"full","auto",f,...Z()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ve,ti,"auto","initial","none",ke]}],grow:[{grow:["",Ve,je,ke]}],shrink:[{shrink:["",Ve,je,ke]}],order:[{order:[ni,"first","last","none",je,ke]}],"grid-cols":[{"grid-cols":q()}],"col-start-end":[{col:oe()}],"col-start":[{"col-start":W()}],"col-end":[{"col-end":W()}],"grid-rows":[{"grid-rows":q()}],"row-start-end":[{row:oe()}],"row-start":[{"row-start":W()}],"row-end":[{"row-end":W()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":me()}],"auto-rows":[{"auto-rows":me()}],gap:[{gap:Z()}],"gap-x":[{"gap-x":Z()}],"gap-y":[{"gap-y":Z()}],"justify-content":[{justify:[...fe(),"normal"]}],"justify-items":[{"justify-items":[...ee(),"normal"]}],"justify-self":[{"justify-self":["auto",...ee()]}],"align-content":[{content:["normal",...fe()]}],"align-items":[{items:[...ee(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ee(),{baseline:["","last"]}]}],"place-content":[{"place-content":fe()}],"place-items":[{"place-items":[...ee(),"baseline"]}],"place-self":[{"place-self":["auto",...ee()]}],p:[{p:Z()}],px:[{px:Z()}],py:[{py:Z()}],ps:[{ps:Z()}],pe:[{pe:Z()}],pbs:[{pbs:Z()}],pbe:[{pbe:Z()}],pt:[{pt:Z()}],pr:[{pr:Z()}],pb:[{pb:Z()}],pl:[{pl:Z()}],m:[{m:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mbs:[{mbs:H()}],mbe:[{mbe:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":Z()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":Z()}],"space-y-reverse":["space-y-reverse"],size:[{size:re()}],"inline-size":[{inline:["auto",...K()]}],"min-inline-size":[{"min-inline":["auto",...K()]}],"max-inline-size":[{"max-inline":["none",...K()]}],"block-size":[{block:["auto",...he()]}],"min-block-size":[{"min-block":["auto",...he()]}],"max-block-size":[{"max-block":["none",...he()]}],w:[{w:[f,"screen",...re()]}],"min-w":[{"min-w":[f,"screen","none",...re()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[u]},...re()]}],h:[{h:["screen","lh",...re()]}],"min-h":[{"min-h":["screen","lh","none",...re()]}],"max-h":[{"max-h":["screen","lh",...re()]}],"font-size":[{text:["base",n,Qo,Xi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,gR,cR]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",qm,ke]}],"font-family":[{font:[hR,dR,t]}],"font-features":[{"font-features":[ke]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[l,je,ke]}],"line-clamp":[{"line-clamp":[Ve,"none",je,X0]}],leading:[{leading:[o,...Z()]}],"list-image":[{"list-image":["none",je,ke]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",je,ke]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:T()}],"text-color":[{text:T()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Se(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ve,"from-font","auto",je,Xi]}],"text-decoration-color":[{decoration:T()}],"underline-offset":[{"underline-offset":[Ve,"auto",je,ke]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:Z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",je,ke]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",je,ke]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:U()}],"bg-repeat":[{bg:P()}],"bg-size":[{bg:_()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ni,je,ke],radial:["",je,ke],conic:[ni,je,ke]},pR,fR]}],"bg-color":[{bg:T()}],"gradient-from-pos":[{from:$()}],"gradient-via-pos":[{via:$()}],"gradient-to-pos":[{to:$()}],"gradient-from":[{from:T()}],"gradient-via":[{via:T()}],"gradient-to":[{to:T()}],rounded:[{rounded:X()}],"rounded-s":[{"rounded-s":X()}],"rounded-e":[{"rounded-e":X()}],"rounded-t":[{"rounded-t":X()}],"rounded-r":[{"rounded-r":X()}],"rounded-b":[{"rounded-b":X()}],"rounded-l":[{"rounded-l":X()}],"rounded-ss":[{"rounded-ss":X()}],"rounded-se":[{"rounded-se":X()}],"rounded-ee":[{"rounded-ee":X()}],"rounded-es":[{"rounded-es":X()}],"rounded-tl":[{"rounded-tl":X()}],"rounded-tr":[{"rounded-tr":X()}],"rounded-br":[{"rounded-br":X()}],"rounded-bl":[{"rounded-bl":X()}],"border-w":[{border:ue()}],"border-w-x":[{"border-x":ue()}],"border-w-y":[{"border-y":ue()}],"border-w-s":[{"border-s":ue()}],"border-w-e":[{"border-e":ue()}],"border-w-bs":[{"border-bs":ue()}],"border-w-be":[{"border-be":ue()}],"border-w-t":[{"border-t":ue()}],"border-w-r":[{"border-r":ue()}],"border-w-b":[{"border-b":ue()}],"border-w-l":[{"border-l":ue()}],"divide-x":[{"divide-x":ue()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ue()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Se(),"hidden","none"]}],"divide-style":[{divide:[...Se(),"hidden","none"]}],"border-color":[{border:T()}],"border-color-x":[{"border-x":T()}],"border-color-y":[{"border-y":T()}],"border-color-s":[{"border-s":T()}],"border-color-e":[{"border-e":T()}],"border-color-bs":[{"border-bs":T()}],"border-color-be":[{"border-be":T()}],"border-color-t":[{"border-t":T()}],"border-color-r":[{"border-r":T()}],"border-color-b":[{"border-b":T()}],"border-color-l":[{"border-l":T()}],"divide-color":[{divide:T()}],"outline-style":[{outline:[...Se(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ve,je,ke]}],"outline-w":[{outline:["",Ve,Qo,Xi]}],"outline-color":[{outline:T()}],shadow:[{shadow:["","none",g,ed,Wc]}],"shadow-color":[{shadow:T()}],"inset-shadow":[{"inset-shadow":["none",y,ed,Wc]}],"inset-shadow-color":[{"inset-shadow":T()}],"ring-w":[{ring:ue()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:T()}],"ring-offset-w":[{"ring-offset":[Ve,Xi]}],"ring-offset-color":[{"ring-offset":T()}],"inset-ring-w":[{"inset-ring":ue()}],"inset-ring-color":[{"inset-ring":T()}],"text-shadow":[{"text-shadow":["none",b,ed,Wc]}],"text-shadow-color":[{"text-shadow":T()}],opacity:[{opacity:[Ve,je,ke]}],"mix-blend":[{"mix-blend":[...Me(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Me()}],"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":[Ve]}],"mask-image-linear-from-pos":[{"mask-linear-from":ye()}],"mask-image-linear-to-pos":[{"mask-linear-to":ye()}],"mask-image-linear-from-color":[{"mask-linear-from":T()}],"mask-image-linear-to-color":[{"mask-linear-to":T()}],"mask-image-t-from-pos":[{"mask-t-from":ye()}],"mask-image-t-to-pos":[{"mask-t-to":ye()}],"mask-image-t-from-color":[{"mask-t-from":T()}],"mask-image-t-to-color":[{"mask-t-to":T()}],"mask-image-r-from-pos":[{"mask-r-from":ye()}],"mask-image-r-to-pos":[{"mask-r-to":ye()}],"mask-image-r-from-color":[{"mask-r-from":T()}],"mask-image-r-to-color":[{"mask-r-to":T()}],"mask-image-b-from-pos":[{"mask-b-from":ye()}],"mask-image-b-to-pos":[{"mask-b-to":ye()}],"mask-image-b-from-color":[{"mask-b-from":T()}],"mask-image-b-to-color":[{"mask-b-to":T()}],"mask-image-l-from-pos":[{"mask-l-from":ye()}],"mask-image-l-to-pos":[{"mask-l-to":ye()}],"mask-image-l-from-color":[{"mask-l-from":T()}],"mask-image-l-to-color":[{"mask-l-to":T()}],"mask-image-x-from-pos":[{"mask-x-from":ye()}],"mask-image-x-to-pos":[{"mask-x-to":ye()}],"mask-image-x-from-color":[{"mask-x-from":T()}],"mask-image-x-to-color":[{"mask-x-to":T()}],"mask-image-y-from-pos":[{"mask-y-from":ye()}],"mask-image-y-to-pos":[{"mask-y-to":ye()}],"mask-image-y-from-color":[{"mask-y-from":T()}],"mask-image-y-to-color":[{"mask-y-to":T()}],"mask-image-radial":[{"mask-radial":[je,ke]}],"mask-image-radial-from-pos":[{"mask-radial-from":ye()}],"mask-image-radial-to-pos":[{"mask-radial-to":ye()}],"mask-image-radial-from-color":[{"mask-radial-from":T()}],"mask-image-radial-to-color":[{"mask-radial-to":T()}],"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":M()}],"mask-image-conic-pos":[{"mask-conic":[Ve]}],"mask-image-conic-from-pos":[{"mask-conic-from":ye()}],"mask-image-conic-to-pos":[{"mask-conic-to":ye()}],"mask-image-conic-from-color":[{"mask-conic-from":T()}],"mask-image-conic-to-color":[{"mask-conic-to":T()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:U()}],"mask-repeat":[{mask:P()}],"mask-size":[{mask:_()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",je,ke]}],filter:[{filter:["","none",je,ke]}],blur:[{blur:ct()}],brightness:[{brightness:[Ve,je,ke]}],contrast:[{contrast:[Ve,je,ke]}],"drop-shadow":[{"drop-shadow":["","none",S,ed,Wc]}],"drop-shadow-color":[{"drop-shadow":T()}],grayscale:[{grayscale:["",Ve,je,ke]}],"hue-rotate":[{"hue-rotate":[Ve,je,ke]}],invert:[{invert:["",Ve,je,ke]}],saturate:[{saturate:[Ve,je,ke]}],sepia:[{sepia:["",Ve,je,ke]}],"backdrop-filter":[{"backdrop-filter":["","none",je,ke]}],"backdrop-blur":[{"backdrop-blur":ct()}],"backdrop-brightness":[{"backdrop-brightness":[Ve,je,ke]}],"backdrop-contrast":[{"backdrop-contrast":[Ve,je,ke]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ve,je,ke]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ve,je,ke]}],"backdrop-invert":[{"backdrop-invert":["",Ve,je,ke]}],"backdrop-opacity":[{"backdrop-opacity":[Ve,je,ke]}],"backdrop-saturate":[{"backdrop-saturate":[Ve,je,ke]}],"backdrop-sepia":[{"backdrop-sepia":["",Ve,je,ke]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":Z()}],"border-spacing-x":[{"border-spacing-x":Z()}],"border-spacing-y":[{"border-spacing-y":Z()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",je,ke]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ve,"initial",je,ke]}],ease:[{ease:["linear","initial",C,je,ke]}],delay:[{delay:[Ve,je,ke]}],animate:[{animate:["none",A,je,ke]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[j,je,ke]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:ae()}],"rotate-x":[{"rotate-x":ae()}],"rotate-y":[{"rotate-y":ae()}],"rotate-z":[{"rotate-z":ae()}],scale:[{scale:De()}],"scale-x":[{"scale-x":De()}],"scale-y":[{"scale-y":De()}],"scale-z":[{"scale-z":De()}],"scale-3d":["scale-3d"],skew:[{skew:at()}],"skew-x":[{"skew-x":at()}],"skew-y":[{"skew-y":at()}],transform:[{transform:[je,ke,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Pe()}],"translate-x":[{"translate-x":Pe()}],"translate-y":[{"translate-y":Pe()}],"translate-z":[{"translate-z":Pe()}],"translate-none":["translate-none"],accent:[{accent:T()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:T()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",je,ke]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":Z()}],"scroll-mx":[{"scroll-mx":Z()}],"scroll-my":[{"scroll-my":Z()}],"scroll-ms":[{"scroll-ms":Z()}],"scroll-me":[{"scroll-me":Z()}],"scroll-mbs":[{"scroll-mbs":Z()}],"scroll-mbe":[{"scroll-mbe":Z()}],"scroll-mt":[{"scroll-mt":Z()}],"scroll-mr":[{"scroll-mr":Z()}],"scroll-mb":[{"scroll-mb":Z()}],"scroll-ml":[{"scroll-ml":Z()}],"scroll-p":[{"scroll-p":Z()}],"scroll-px":[{"scroll-px":Z()}],"scroll-py":[{"scroll-py":Z()}],"scroll-ps":[{"scroll-ps":Z()}],"scroll-pe":[{"scroll-pe":Z()}],"scroll-pbs":[{"scroll-pbs":Z()}],"scroll-pbe":[{"scroll-pbe":Z()}],"scroll-pt":[{"scroll-pt":Z()}],"scroll-pr":[{"scroll-pr":Z()}],"scroll-pb":[{"scroll-pb":Z()}],"scroll-pl":[{"scroll-pl":Z()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",je,ke]}],fill:[{fill:["none",...T()]}],"stroke-w":[{stroke:[Ve,Qo,Xi,X0]}],stroke:[{stroke:["none",...T()]}],"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"]}},bR=Xz(vR);function Ne(...e){return bR(Jw(e))}function xi(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 xR(e){return Ce.delete(`/clients/${encodeURIComponent(e)}`)}function Au(){return Ce.get("/admin/agents/activity")}function hu(){return Ce.get("/clients")}function SR(e){return Ce.post(`/clients/${e}/disconnect`)}function hk(){return Ce.post("/connect-tokens")}const mk=(e,t)=>["session",e,t],Gp=e=>["agent-sessions",e];function wR(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 kR(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 jR(e){if(typeof e!="object"||e===null)return null;const t=e;return typeof t.text!="string"?null:{text:t.text}}function Vs(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 Ce.get(`/admin/sessions/agents/${e}${a?`?${a}`:""}`)}function CR(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 Ce.get(`/admin/sessions/agents/${e}/${t}/events${l?`?${l}`:""}`)}function ER(e,t){return Ce.post(`/admin/sessions/agents/${e}/${t}/suspend`)}function NR(e,t){return Ce.post(`/admin/sessions/agents/${e}/${t}/terminate`)}var e1=1,_R=.9,AR=.8,TR=.17,Hm=.1,Zm=.999,zR=.9999,RR=.99,OR=/[\\\/_+.#"@\[\(\{&]/,DR=/[\\\/_+.#"@\[\(\{&]/g,MR=/[\s-]/,pk=/[\s-]/g;function Kp(e,t,n,a,l,o,u){if(o===t.length)return l===e.length?e1:RR;var f=`${l},${o}`;if(u[f]!==void 0)return u[f];for(var m=a.charAt(o),h=n.indexOf(m,l),g=0,y,b,S,k;h>=0;)y=Kp(e,t,n,a,h+1,o+1,u),y>g&&(h===l?y*=e1:OR.test(e.charAt(h-1))?(y*=AR,S=e.slice(l,h-1).match(DR),S&&l>0&&(y*=Math.pow(Zm,S.length))):MR.test(e.charAt(h-1))?(y*=_R,k=e.slice(l,h-1).match(pk),k&&l>0&&(y*=Math.pow(Zm,k.length))):(y*=TR,l>0&&(y*=Math.pow(Zm,h-l))),e.charAt(h)!==t.charAt(o)&&(y*=zR)),(y<Hm&&n.charAt(h-1)===a.charAt(o+1)||a.charAt(o+1)===a.charAt(o)&&n.charAt(h-1)!==a.charAt(o))&&(b=Kp(e,t,n,a,h+1,o+2,u),b*Hm>y&&(y=b*Hm)),y>g&&(g=y),h=n.indexOf(m,h+1);return u[f]=g,g}function t1(e){return e.toLowerCase().replace(pk," ")}function LR(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Kp(e,t,t1(e),t1(t),0,0,{})}function vi(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 n1(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Si(...e){return t=>{let n=!1;const a=e.map(l=>{const o=n1(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():n1(e[l],null)}}}}function yl(...e){return x.useCallback(Si(...e),e)}function IR(e,t){const n=x.createContext(t),a=o=>{const{children:u,...f}=o,m=x.useMemo(()=>f,Object.values(f));return c.jsx(n.Provider,{value:m,children:u})};a.displayName=e+"Provider";function l(o){const u=x.useContext(n);if(u)return u;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[a,l]}function UR(e,t=[]){let n=[];function a(o,u){const f=x.createContext(u),m=n.length;n=[...n,u];const h=y=>{var C;const{scope:b,children:S,...k}=y,j=((C=b==null?void 0:b[e])==null?void 0:C[m])||f,E=x.useMemo(()=>k,Object.values(k));return c.jsx(j.Provider,{value:E,children:S})};h.displayName=o+"Provider";function g(y,b){var j;const S=((j=b==null?void 0:b[e])==null?void 0:j[m])||f,k=x.useContext(S);if(k)return k;if(u!==void 0)return u;throw new Error(`\`${y}\` must be used within \`${o}\``)}return[h,g]}const l=()=>{const o=n.map(u=>x.createContext(u));return function(f){const m=(f==null?void 0:f[e])||o;return x.useMemo(()=>({[`__scope${e}`]:{...f,[e]:m}}),[f,m])}};return l.scopeName=e,[a,PR(l,...t)]}function PR(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const a=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(o){const u=a.reduce((f,{useScope:m,scopeName:h})=>{const y=m(o)[`__scope${h}`];return{...f,...y}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])}};return n.scopeName=t.scopeName,n}var mu=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},BR=Sg[" useId ".trim().toString()]||(()=>{}),$R=0;function Sa(e){const[t,n]=x.useState(BR());return mu(()=>{n(a=>a??String($R++))},[e]),t?`radix-${t}`:""}var FR=Sg[" useInsertionEffect ".trim().toString()]||mu;function qR({prop:e,defaultProp:t,onChange:n=()=>{},caller:a}){const[l,o,u]=HR({defaultProp:t,onChange:n}),f=e!==void 0,m=f?e:l;{const g=x.useRef(e!==void 0);x.useEffect(()=>{const y=g.current;y!==f&&console.warn(`${a} is changing from ${y?"controlled":"uncontrolled"} to ${f?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),g.current=f},[f,a])}const h=x.useCallback(g=>{var y;if(f){const b=ZR(g)?g(e):g;b!==e&&((y=u.current)==null||y.call(u,b))}else o(g)},[f,e,o,u]);return[m,h]}function HR({defaultProp:e,onChange:t}){const[n,a]=x.useState(e),l=x.useRef(n),o=x.useRef(t);return FR(()=>{o.current=t},[t]),x.useEffect(()=>{var u;l.current!==n&&((u=o.current)==null||u.call(o,n),l.current=n)},[n,l]),[n,a,o]}function ZR(e){return typeof e=="function"}var gk=cw();const VR=$d(gk);function yk(e){const t=QR(e),n=x.forwardRef((a,l)=>{const{children:o,...u}=a,f=x.Children.toArray(o),m=f.find(KR);if(m){const h=m.props.children,g=f.map(y=>y===m?x.Children.count(h)>1?x.Children.only(null):x.isValidElement(h)?h.props.children:null:y);return c.jsx(t,{...u,ref:l,children:x.isValidElement(h)?x.cloneElement(h,void 0,g):null})}return c.jsx(t,{...u,ref:l,children:o})});return n.displayName=`${e}.Slot`,n}function QR(e){const t=x.forwardRef((n,a)=>{const{children:l,...o}=n;if(x.isValidElement(l)){const u=XR(l),f=YR(o,l.props);return l.type!==x.Fragment&&(f.ref=a?Si(a,u):u),x.cloneElement(l,f)}return x.Children.count(l)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var GR=Symbol("radix.slottable");function KR(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===GR}function YR(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 XR(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 JR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ca=JR.reduce((e,t)=>{const n=yk(`Primitive.${t}`),a=x.forwardRef((l,o)=>{const{asChild:u,...f}=l,m=u?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(m,{...f,ref:o})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});function WR(e,t){e&&gk.flushSync(()=>e.dispatchEvent(t))}function pu(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 e3(e,t=globalThis==null?void 0:globalThis.document){const n=pu(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 t3="DismissableLayer",Yp="dismissableLayer.update",n3="dismissableLayer.pointerDownOutside",r3="dismissableLayer.focusOutside",r1,vk=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),bk=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:o,onInteractOutside:u,onDismiss:f,...m}=e,h=x.useContext(vk),[g,y]=x.useState(null),b=(g==null?void 0:g.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,S]=x.useState({}),k=yl(t,L=>y(L)),j=Array.from(h.layers),[E]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),C=j.indexOf(E),A=g?j.indexOf(g):-1,O=h.layersWithOutsidePointerEventsDisabled.size>0,M=A>=C,D=l3(L=>{const Z=L.target,te=[...h.branches].some(q=>q.contains(Z));!M||te||(l==null||l(L),u==null||u(L),L.defaultPrevented||f==null||f())},b),z=s3(L=>{const Z=L.target;[...h.branches].some(q=>q.contains(Z))||(o==null||o(L),u==null||u(L),L.defaultPrevented||f==null||f())},b);return e3(L=>{A===h.layers.size-1&&(a==null||a(L),!L.defaultPrevented&&f&&(L.preventDefault(),f()))},b),x.useEffect(()=>{if(g)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(r1=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(g)),h.layers.add(g),a1(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=r1)}},[g,b,n,h]),x.useEffect(()=>()=>{g&&(h.layers.delete(g),h.layersWithOutsidePointerEventsDisabled.delete(g),a1())},[g,h]),x.useEffect(()=>{const L=()=>S({});return document.addEventListener(Yp,L),()=>document.removeEventListener(Yp,L)},[]),c.jsx(Ca.div,{...m,ref:k,style:{pointerEvents:O?M?"auto":"none":void 0,...e.style},onFocusCapture:vi(e.onFocusCapture,z.onFocusCapture),onBlurCapture:vi(e.onBlurCapture,z.onBlurCapture),onPointerDownCapture:vi(e.onPointerDownCapture,D.onPointerDownCapture)})});bk.displayName=t3;var a3="DismissableLayerBranch",i3=x.forwardRef((e,t)=>{const n=x.useContext(vk),a=x.useRef(null),l=yl(t,a);return x.useEffect(()=>{const o=a.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),c.jsx(Ca.div,{...e,ref:l})});i3.displayName=a3;function l3(e,t=globalThis==null?void 0:globalThis.document){const n=pu(e),a=x.useRef(!1),l=x.useRef(()=>{});return x.useEffect(()=>{const o=f=>{if(f.target&&!a.current){let m=function(){xk(n3,n,h,{discrete:!0})};const h={originalEvent:f};f.pointerType==="touch"?(t.removeEventListener("click",l.current),l.current=m,t.addEventListener("click",l.current,{once:!0})):m()}else t.removeEventListener("click",l.current);a.current=!1},u=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(u),t.removeEventListener("pointerdown",o),t.removeEventListener("click",l.current)}},[t,n]),{onPointerDownCapture:()=>a.current=!0}}function s3(e,t=globalThis==null?void 0:globalThis.document){const n=pu(e),a=x.useRef(!1);return x.useEffect(()=>{const l=o=>{o.target&&!a.current&&xk(r3,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 a1(){const e=new CustomEvent(Yp);document.dispatchEvent(e)}function xk(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?WR(l,o):l.dispatchEvent(o)}var Vm="focusScope.autoFocusOnMount",Qm="focusScope.autoFocusOnUnmount",i1={bubbles:!1,cancelable:!0},o3="FocusScope",Sk=x.forwardRef((e,t)=>{const{loop:n=!1,trapped:a=!1,onMountAutoFocus:l,onUnmountAutoFocus:o,...u}=e,[f,m]=x.useState(null),h=pu(l),g=pu(o),y=x.useRef(null),b=yl(t,j=>m(j)),S=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(a){let j=function(O){if(S.paused||!f)return;const M=O.target;f.contains(M)?y.current=M:ii(y.current,{select:!0})},E=function(O){if(S.paused||!f)return;const M=O.relatedTarget;M!==null&&(f.contains(M)||ii(y.current,{select:!0}))},C=function(O){if(document.activeElement===document.body)for(const D of O)D.removedNodes.length>0&&ii(f)};document.addEventListener("focusin",j),document.addEventListener("focusout",E);const A=new MutationObserver(C);return f&&A.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",j),document.removeEventListener("focusout",E),A.disconnect()}}},[a,f,S.paused]),x.useEffect(()=>{if(f){s1.add(S);const j=document.activeElement;if(!f.contains(j)){const C=new CustomEvent(Vm,i1);f.addEventListener(Vm,h),f.dispatchEvent(C),C.defaultPrevented||(u3(m3(wk(f)),{select:!0}),document.activeElement===j&&ii(f))}return()=>{f.removeEventListener(Vm,h),setTimeout(()=>{const C=new CustomEvent(Qm,i1);f.addEventListener(Qm,g),f.dispatchEvent(C),C.defaultPrevented||ii(j??document.body,{select:!0}),f.removeEventListener(Qm,g),s1.remove(S)},0)}}},[f,h,g,S]);const k=x.useCallback(j=>{if(!n&&!a||S.paused)return;const E=j.key==="Tab"&&!j.altKey&&!j.ctrlKey&&!j.metaKey,C=document.activeElement;if(E&&C){const A=j.currentTarget,[O,M]=c3(A);O&&M?!j.shiftKey&&C===M?(j.preventDefault(),n&&ii(O,{select:!0})):j.shiftKey&&C===O&&(j.preventDefault(),n&&ii(M,{select:!0})):C===A&&j.preventDefault()}},[n,a,S.paused]);return c.jsx(Ca.div,{tabIndex:-1,...u,ref:b,onKeyDown:k})});Sk.displayName=o3;function u3(e,{select:t=!1}={}){const n=document.activeElement;for(const a of e)if(ii(a,{select:t}),document.activeElement!==n)return}function c3(e){const t=wk(e),n=l1(t,e),a=l1(t.reverse(),e);return[n,a]}function wk(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 l1(e,t){for(const n of e)if(!d3(n,{upTo:t}))return n}function d3(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 f3(e){return e instanceof HTMLInputElement&&"select"in e}function ii(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&f3(e)&&t&&e.select()}}var s1=h3();function h3(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=o1(e,t),e.unshift(t)},remove(t){var n;e=o1(e,t),(n=e[0])==null||n.resume()}}}function o1(e,t){const n=[...e],a=n.indexOf(t);return a!==-1&&n.splice(a,1),n}function m3(e){return e.filter(t=>t.tagName!=="A")}var p3="Portal",kk=x.forwardRef((e,t)=>{var f;const{container:n,...a}=e,[l,o]=x.useState(!1);mu(()=>o(!0),[]);const u=n||l&&((f=globalThis==null?void 0:globalThis.document)==null?void 0:f.body);return u?VR.createPortal(c.jsx(Ca.div,{...a,ref:t}),u):null});kk.displayName=p3;function g3(e,t){return x.useReducer((n,a)=>t[n][a]??n,e)}var Kd=e=>{const{present:t,children:n}=e,a=y3(t),l=typeof n=="function"?n({present:a.isPresent}):x.Children.only(n),o=yl(a.ref,v3(l));return typeof n=="function"||a.isPresent?x.cloneElement(l,{ref:o}):null};Kd.displayName="Presence";function y3(e){const[t,n]=x.useState(),a=x.useRef(null),l=x.useRef(e),o=x.useRef("none"),u=e?"mounted":"unmounted",[f,m]=g3(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const h=td(a.current);o.current=f==="mounted"?h:"none"},[f]),mu(()=>{const h=a.current,g=l.current;if(g!==e){const b=o.current,S=td(h);e?m("MOUNT"):S==="none"||(h==null?void 0:h.display)==="none"?m("UNMOUNT"):m(g&&b!==S?"ANIMATION_OUT":"UNMOUNT"),l.current=e}},[e,m]),mu(()=>{if(t){let h;const g=t.ownerDocument.defaultView??window,y=S=>{const j=td(a.current).includes(CSS.escape(S.animationName));if(S.target===t&&j&&(m("ANIMATION_END"),!l.current)){const E=t.style.animationFillMode;t.style.animationFillMode="forwards",h=g.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=E)})}},b=S=>{S.target===t&&(o.current=td(a.current))};return t.addEventListener("animationstart",b),t.addEventListener("animationcancel",y),t.addEventListener("animationend",y),()=>{g.clearTimeout(h),t.removeEventListener("animationstart",b),t.removeEventListener("animationcancel",y),t.removeEventListener("animationend",y)}}else m("ANIMATION_END")},[t,m]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:x.useCallback(h=>{a.current=h?getComputedStyle(h):null,n(h)},[])}}function td(e){return(e==null?void 0:e.animationName)||"none"}function v3(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 Gm=0;function b3(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??u1()),document.body.insertAdjacentElement("beforeend",e[1]??u1()),Gm++,()=>{Gm===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Gm--}},[])}function u1(){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 Zr=function(){return Zr=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},Zr.apply(this,arguments)};function jk(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 x3(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",xd="width-before-scroll-bar",S3="with-scroll-bars-hidden",w3="--removed-body-scroll-bar-size";function Km(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function k3(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 j3=typeof window<"u"?x.useLayoutEffect:x.useEffect,c1=new WeakMap;function C3(e,t){var n=k3(null,function(a){return e.forEach(function(l){return Km(l,a)})});return j3(function(){var a=c1.get(n);if(a){var l=new Set(a),o=new Set(e),u=n.current;l.forEach(function(f){o.has(f)||Km(f,null)}),o.forEach(function(f){l.has(f)||Km(f,u)})}c1.set(n,e)},[e]),n}function E3(e){return e}function N3(e,t){t===void 0&&(t=E3);var n=[],a=!1,l={read:function(){if(a)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var u=t(o,a);return n.push(u),function(){n=n.filter(function(f){return f!==u})}},assignSyncMedium:function(o){for(a=!0;n.length;){var u=n;n=[],u.forEach(o)}n={push:function(f){return o(f)},filter:function(){return n}}},assignMedium:function(o){a=!0;var u=[];if(n.length){var f=n;n=[],f.forEach(o),u=n}var m=function(){var g=u;u=[],g.forEach(o)},h=function(){return Promise.resolve().then(m)};h(),n={push:function(g){u.push(g),h()},filter:function(g){return u=u.filter(g),n}}}};return l}function _3(e){e===void 0&&(e={});var t=N3(null);return t.options=Zr({async:!0,ssr:!1},e),t}var Ck=function(e){var t=e.sideCar,n=jk(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,Zr({},n))};Ck.isSideCarExport=!0;function A3(e,t){return e.useMedium(t),Ck}var Ek=_3(),Ym=function(){},Yd=x.forwardRef(function(e,t){var n=x.useRef(null),a=x.useState({onScrollCapture:Ym,onWheelCapture:Ym,onTouchMoveCapture:Ym}),l=a[0],o=a[1],u=e.forwardProps,f=e.children,m=e.className,h=e.removeScrollBar,g=e.enabled,y=e.shards,b=e.sideCar,S=e.noRelative,k=e.noIsolation,j=e.inert,E=e.allowPinchZoom,C=e.as,A=C===void 0?"div":C,O=e.gapMode,M=jk(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),D=b,z=C3([n,t]),L=Zr(Zr({},M),l);return x.createElement(x.Fragment,null,g&&x.createElement(D,{sideCar:Ek,removeScrollBar:h,shards:y,noRelative:S,noIsolation:k,inert:j,setCallbacks:o,allowPinchZoom:!!E,lockRef:n,gapMode:O}),u?x.cloneElement(x.Children.only(f),Zr(Zr({},L),{ref:z})):x.createElement(A,Zr({},L,{className:m,ref:z}),f))});Yd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Yd.classNames={fullWidth:xd,zeroRight:bd};var T3=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function z3(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=T3();return t&&e.setAttribute("nonce",t),e}function R3(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function O3(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var D3=function(){var e=0,t=null;return{add:function(n){e==0&&(t=z3())&&(R3(t,n),O3(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},M3=function(){var e=D3();return function(t,n){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Nk=function(){var e=M3(),t=function(n){var a=n.styles,l=n.dynamic;return e(a,l),null};return t},L3={left:0,top:0,right:0,gap:0},Xm=function(e){return parseInt(e||"",10)||0},I3=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[Xm(n),Xm(a),Xm(l)]},U3=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return L3;var t=I3(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])}},P3=Nk(),bs="data-scroll-locked",B3=function(e,t,n,a){var l=e.left,o=e.top,u=e.right,f=e.gap;return n===void 0&&(n="margin"),`
266
+ .`.concat(S3,` {
267
+ overflow: hidden `).concat(a,`;
268
+ padding-right: `).concat(f,"px ").concat(a,`;
269
+ }
270
+ body[`).concat(bs,`] {
271
+ overflow: hidden `).concat(a,`;
272
+ overscroll-behavior: contain;
273
+ `).concat([t&&"position: relative ".concat(a,";"),n==="margin"&&`
274
+ padding-left: `.concat(l,`px;
275
+ padding-top: `).concat(o,`px;
276
+ padding-right: `).concat(u,`px;
277
+ margin-left:0;
278
+ margin-top:0;
279
+ margin-right: `).concat(f,"px ").concat(a,`;
280
+ `),n==="padding"&&"padding-right: ".concat(f,"px ").concat(a,";")].filter(Boolean).join(""),`
281
+ }
282
+
283
+ .`).concat(bd,` {
284
+ right: `).concat(f,"px ").concat(a,`;
285
+ }
286
+
287
+ .`).concat(xd,` {
288
+ margin-right: `).concat(f,"px ").concat(a,`;
289
+ }
290
+
291
+ .`).concat(bd," .").concat(bd,` {
292
+ right: 0 `).concat(a,`;
293
+ }
294
+
295
+ .`).concat(xd," .").concat(xd,` {
296
+ margin-right: 0 `).concat(a,`;
297
+ }
298
+
299
+ body[`).concat(bs,`] {
300
+ `).concat(w3,": ").concat(f,`px;
301
+ }
302
+ `)},d1=function(){var e=parseInt(document.body.getAttribute(bs)||"0",10);return isFinite(e)?e:0},$3=function(){x.useEffect(function(){return document.body.setAttribute(bs,(d1()+1).toString()),function(){var e=d1()-1;e<=0?document.body.removeAttribute(bs):document.body.setAttribute(bs,e.toString())}},[])},F3=function(e){var t=e.noRelative,n=e.noImportant,a=e.gapMode,l=a===void 0?"margin":a;$3();var o=x.useMemo(function(){return U3(l)},[l]);return x.createElement(P3,{styles:B3(o,!t,l,n?"":"!important")})},Xp=!1;if(typeof window<"u")try{var nd=Object.defineProperty({},"passive",{get:function(){return Xp=!0,!0}});window.addEventListener("test",nd,nd),window.removeEventListener("test",nd,nd)}catch{Xp=!1}var ls=Xp?{passive:!1}:!1,q3=function(e){return e.tagName==="TEXTAREA"},_k=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!q3(e)&&n[t]==="visible")},H3=function(e){return _k(e,"overflowY")},Z3=function(e){return _k(e,"overflowX")},f1=function(e,t){var n=t.ownerDocument,a=t;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var l=Ak(e,a);if(l){var o=Tk(e,a),u=o[1],f=o[2];if(u>f)return!0}a=a.parentNode}while(a&&a!==n.body);return!1},V3=function(e){var t=e.scrollTop,n=e.scrollHeight,a=e.clientHeight;return[t,n,a]},Q3=function(e){var t=e.scrollLeft,n=e.scrollWidth,a=e.clientWidth;return[t,n,a]},Ak=function(e,t){return e==="v"?H3(t):Z3(t)},Tk=function(e,t){return e==="v"?V3(t):Q3(t)},G3=function(e,t){return e==="h"&&t==="rtl"?-1:1},K3=function(e,t,n,a,l){var o=G3(e,window.getComputedStyle(t).direction),u=o*a,f=n.target,m=t.contains(f),h=!1,g=u>0,y=0,b=0;do{if(!f)break;var S=Tk(e,f),k=S[0],j=S[1],E=S[2],C=j-E-o*k;(k||C)&&Ak(e,f)&&(y+=C,b+=k);var A=f.parentNode;f=A&&A.nodeType===Node.DOCUMENT_FRAGMENT_NODE?A.host:A}while(!m&&f!==document.body||m&&(t.contains(f)||t===f));return(g&&Math.abs(y)<1||!g&&Math.abs(b)<1)&&(h=!0),h},rd=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},h1=function(e){return[e.deltaX,e.deltaY]},m1=function(e){return e&&"current"in e?e.current:e},Y3=function(e,t){return e[0]===t[0]&&e[1]===t[1]},X3=function(e){return`
303
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
304
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
305
+ `)},J3=0,ss=[];function W3(e){var t=x.useRef([]),n=x.useRef([0,0]),a=x.useRef(),l=x.useState(J3++)[0],o=x.useState(Nk)[0],u=x.useRef(e);x.useEffect(function(){u.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(l));var j=x3([e.lockRef.current],(e.shards||[]).map(m1),!0).filter(Boolean);return j.forEach(function(E){return E.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),j.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(l))})}}},[e.inert,e.lockRef.current,e.shards]);var f=x.useCallback(function(j,E){if("touches"in j&&j.touches.length===2||j.type==="wheel"&&j.ctrlKey)return!u.current.allowPinchZoom;var C=rd(j),A=n.current,O="deltaX"in j?j.deltaX:A[0]-C[0],M="deltaY"in j?j.deltaY:A[1]-C[1],D,z=j.target,L=Math.abs(O)>Math.abs(M)?"h":"v";if("touches"in j&&L==="h"&&z.type==="range")return!1;var Z=window.getSelection(),te=Z&&Z.anchorNode,q=te?te===z||te.contains(z):!1;if(q)return!1;var oe=f1(L,z);if(!oe)return!0;if(oe?D=L:(D=L==="v"?"h":"v",oe=f1(L,z)),!oe)return!1;if(!a.current&&"changedTouches"in j&&(O||M)&&(a.current=D),!D)return!0;var W=a.current||D;return K3(W,E,j,W==="h"?O:M)},[]),m=x.useCallback(function(j){var E=j;if(!(!ss.length||ss[ss.length-1]!==o)){var C="deltaY"in E?h1(E):rd(E),A=t.current.filter(function(D){return D.name===E.type&&(D.target===E.target||E.target===D.shadowParent)&&Y3(D.delta,C)})[0];if(A&&A.should){E.cancelable&&E.preventDefault();return}if(!A){var O=(u.current.shards||[]).map(m1).filter(Boolean).filter(function(D){return D.contains(E.target)}),M=O.length>0?f(E,O[0]):!u.current.noIsolation;M&&E.cancelable&&E.preventDefault()}}},[]),h=x.useCallback(function(j,E,C,A){var O={name:j,delta:E,target:C,should:A,shadowParent:eO(C)};t.current.push(O),setTimeout(function(){t.current=t.current.filter(function(M){return M!==O})},1)},[]),g=x.useCallback(function(j){n.current=rd(j),a.current=void 0},[]),y=x.useCallback(function(j){h(j.type,h1(j),j.target,f(j,e.lockRef.current))},[]),b=x.useCallback(function(j){h(j.type,rd(j),j.target,f(j,e.lockRef.current))},[]);x.useEffect(function(){return ss.push(o),e.setCallbacks({onScrollCapture:y,onWheelCapture:y,onTouchMoveCapture:b}),document.addEventListener("wheel",m,ls),document.addEventListener("touchmove",m,ls),document.addEventListener("touchstart",g,ls),function(){ss=ss.filter(function(j){return j!==o}),document.removeEventListener("wheel",m,ls),document.removeEventListener("touchmove",m,ls),document.removeEventListener("touchstart",g,ls)}},[]);var S=e.removeScrollBar,k=e.inert;return x.createElement(x.Fragment,null,k?x.createElement(o,{styles:X3(l)}):null,S?x.createElement(F3,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function eO(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const tO=A3(Ek,W3);var zk=x.forwardRef(function(e,t){return x.createElement(Yd,Zr({},e,{ref:t,sideCar:tO}))});zk.classNames=Yd.classNames;var nO=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},os=new WeakMap,ad=new WeakMap,id={},Jm=0,Rk=function(e){return e&&(e.host||Rk(e.parentNode))},rO=function(e,t){return t.map(function(n){if(e.contains(n))return n;var a=Rk(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})},aO=function(e,t,n,a){var l=rO(t,Array.isArray(e)?e:[e]);id[n]||(id[n]=new WeakMap);var o=id[n],u=[],f=new Set,m=new Set(l),h=function(y){!y||f.has(y)||(f.add(y),h(y.parentNode))};l.forEach(h);var g=function(y){!y||m.has(y)||Array.prototype.forEach.call(y.children,function(b){if(f.has(b))g(b);else try{var S=b.getAttribute(a),k=S!==null&&S!=="false",j=(os.get(b)||0)+1,E=(o.get(b)||0)+1;os.set(b,j),o.set(b,E),u.push(b),j===1&&k&&ad.set(b,!0),E===1&&b.setAttribute(n,"true"),k||b.setAttribute(a,"true")}catch(C){console.error("aria-hidden: cannot operate on ",b,C)}})};return g(t),f.clear(),Jm++,function(){u.forEach(function(y){var b=os.get(y)-1,S=o.get(y)-1;os.set(y,b),o.set(y,S),b||(ad.has(y)||y.removeAttribute(a),ad.delete(y)),S||y.removeAttribute(n)}),Jm--,Jm||(os=new WeakMap,os=new WeakMap,ad=new WeakMap,id={})}},iO=function(e,t,n){n===void 0&&(n="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),l=nO(e);return l?(a.push.apply(a,Array.from(l.querySelectorAll("[aria-live], script"))),aO(a,l,n,"aria-hidden")):function(){return null}},Xd="Dialog",[Ok]=UR(Xd),[lO,Dr]=Ok(Xd),Dk=e=>{const{__scopeDialog:t,children:n,open:a,defaultOpen:l,onOpenChange:o,modal:u=!0}=e,f=x.useRef(null),m=x.useRef(null),[h,g]=qR({prop:a,defaultProp:l??!1,onChange:o,caller:Xd});return c.jsx(lO,{scope:t,triggerRef:f,contentRef:m,contentId:Sa(),titleId:Sa(),descriptionId:Sa(),open:h,onOpenChange:g,onOpenToggle:x.useCallback(()=>g(y=>!y),[g]),modal:u,children:n})};Dk.displayName=Xd;var Mk="DialogTrigger",Lk=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Dr(Mk,n),o=yl(t,l.triggerRef);return c.jsx(Ca.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":$g(l.open),...a,ref:o,onClick:vi(e.onClick,l.onOpenToggle)})});Lk.displayName=Mk;var Pg="DialogPortal",[sO,Ik]=Ok(Pg,{forceMount:void 0}),Uk=e=>{const{__scopeDialog:t,forceMount:n,children:a,container:l}=e,o=Dr(Pg,t);return c.jsx(sO,{scope:t,forceMount:n,children:x.Children.map(a,u=>c.jsx(Kd,{present:n||o.open,children:c.jsx(kk,{asChild:!0,container:l,children:u})}))})};Uk.displayName=Pg;var Ad="DialogOverlay",Pk=x.forwardRef((e,t)=>{const n=Ik(Ad,e.__scopeDialog),{forceMount:a=n.forceMount,...l}=e,o=Dr(Ad,e.__scopeDialog);return o.modal?c.jsx(Kd,{present:a||o.open,children:c.jsx(uO,{...l,ref:t})}):null});Pk.displayName=Ad;var oO=yk("DialogOverlay.RemoveScroll"),uO=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Dr(Ad,n);return c.jsx(zk,{as:oO,allowPinchZoom:!0,shards:[l.contentRef],children:c.jsx(Ca.div,{"data-state":$g(l.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),cl="DialogContent",Bk=x.forwardRef((e,t)=>{const n=Ik(cl,e.__scopeDialog),{forceMount:a=n.forceMount,...l}=e,o=Dr(cl,e.__scopeDialog);return c.jsx(Kd,{present:a||o.open,children:o.modal?c.jsx(cO,{...l,ref:t}):c.jsx(dO,{...l,ref:t})})});Bk.displayName=cl;var cO=x.forwardRef((e,t)=>{const n=Dr(cl,e.__scopeDialog),a=x.useRef(null),l=yl(t,n.contentRef,a);return x.useEffect(()=>{const o=a.current;if(o)return iO(o)},[]),c.jsx($k,{...e,ref:l,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:vi(e.onCloseAutoFocus,o=>{var u;o.preventDefault(),(u=n.triggerRef.current)==null||u.focus()}),onPointerDownOutside:vi(e.onPointerDownOutside,o=>{const u=o.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0;(u.button===2||f)&&o.preventDefault()}),onFocusOutside:vi(e.onFocusOutside,o=>o.preventDefault())})}),dO=x.forwardRef((e,t)=>{const n=Dr(cl,e.__scopeDialog),a=x.useRef(!1),l=x.useRef(!1);return c.jsx($k,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var u,f;(u=e.onCloseAutoFocus)==null||u.call(e,o),o.defaultPrevented||(a.current||(f=n.triggerRef.current)==null||f.focus(),o.preventDefault()),a.current=!1,l.current=!1},onInteractOutside:o=>{var m,h;(m=e.onInteractOutside)==null||m.call(e,o),o.defaultPrevented||(a.current=!0,o.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const u=o.target;((h=n.triggerRef.current)==null?void 0:h.contains(u))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&l.current&&o.preventDefault()}})}),$k=x.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:a,onOpenAutoFocus:l,onCloseAutoFocus:o,...u}=e,f=Dr(cl,n),m=x.useRef(null),h=yl(t,m);return b3(),c.jsxs(c.Fragment,{children:[c.jsx(Sk,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:l,onUnmountAutoFocus:o,children:c.jsx(bk,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":$g(f.open),...u,ref:h,onDismiss:()=>f.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(fO,{titleId:f.titleId}),c.jsx(mO,{contentRef:m,descriptionId:f.descriptionId})]})]})}),Bg="DialogTitle",Fk=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Dr(Bg,n);return c.jsx(Ca.h2,{id:l.titleId,...a,ref:t})});Fk.displayName=Bg;var qk="DialogDescription",Hk=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Dr(qk,n);return c.jsx(Ca.p,{id:l.descriptionId,...a,ref:t})});Hk.displayName=qk;var Zk="DialogClose",Vk=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Dr(Zk,n);return c.jsx(Ca.button,{type:"button",...a,ref:t,onClick:vi(e.onClick,()=>l.onOpenChange(!1))})});Vk.displayName=Zk;function $g(e){return e?"open":"closed"}var Qk="DialogTitleWarning",[x7,Gk]=IR(Qk,{contentName:cl,titleName:Bg,docsSlug:"dialog"}),fO=({titleId:e})=>{const t=Gk(Qk),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
306
+
307
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
308
+
309
+ 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},hO="DialogDescriptionWarning",mO=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Gk(hO).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},Kk=Dk,pO=Lk,Yk=Uk,Xk=Pk,Jk=Bk,gO=Fk,yO=Hk,vO=Vk,bO=Symbol.for("react.lazy"),Td=Sg[" use ".trim().toString()];function xO(e){return typeof e=="object"&&e!==null&&"then"in e}function Wk(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===bO&&"_payload"in e&&xO(e._payload)}function ej(e){const t=wO(e),n=x.forwardRef((a,l)=>{let{children:o,...u}=a;Wk(o)&&typeof Td=="function"&&(o=Td(o._payload));const f=x.Children.toArray(o),m=f.find(jO);if(m){const h=m.props.children,g=f.map(y=>y===m?x.Children.count(h)>1?x.Children.only(null):x.isValidElement(h)?h.props.children:null:y);return c.jsx(t,{...u,ref:l,children:x.isValidElement(h)?x.cloneElement(h,void 0,g):null})}return c.jsx(t,{...u,ref:l,children:o})});return n.displayName=`${e}.Slot`,n}var SO=ej("Slot");function wO(e){const t=x.forwardRef((n,a)=>{let{children:l,...o}=n;if(Wk(l)&&typeof Td=="function"&&(l=Td(l._payload)),x.isValidElement(l)){const u=EO(l),f=CO(o,l.props);return l.type!==x.Fragment&&(f.ref=a?Si(a,u):u),x.cloneElement(l,f)}return x.Children.count(l)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var kO=Symbol("radix.slottable");function jO(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===kO}function CO(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 EO(e){var a,l;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var NO=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ea=NO.reduce((e,t)=>{const n=ej(`Primitive.${t}`),a=x.forwardRef((l,o)=>{const{asChild:u,...f}=l,m=u?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(m,{...f,ref:o})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{}),Go='[cmdk-group=""]',Wm='[cmdk-group-items=""]',_O='[cmdk-group-heading=""]',tj='[cmdk-item=""]',p1=`${tj}:not([aria-disabled="true"])`,Jp="cmdk-item-select",fs="data-value",AO=(e,t,n)=>LR(e,t,n),nj=x.createContext(void 0),Tu=()=>x.useContext(nj),rj=x.createContext(void 0),Fg=()=>x.useContext(rj),aj=x.createContext(void 0),ij=x.forwardRef((e,t)=>{let n=hs(()=>{var P,_;return{search:"",value:(_=(P=e.value)!=null?P:e.defaultValue)!=null?_:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),a=hs(()=>new Set),l=hs(()=>new Map),o=hs(()=>new Map),u=hs(()=>new Set),f=lj(e),{label:m,children:h,value:g,onValueChange:y,filter:b,shouldFilter:S,loop:k,disablePointerSelection:j=!1,vimBindings:E=!0,...C}=e,A=Sa(),O=Sa(),M=Sa(),D=x.useRef(null),z=BO();dl(()=>{if(g!==void 0){let P=g.trim();n.current.value=P,L.emit()}},[g]),dl(()=>{z(6,me)},[]);let L=x.useMemo(()=>({subscribe:P=>(u.current.add(P),()=>u.current.delete(P)),snapshot:()=>n.current,setState:(P,_,$)=>{var X,ue,Se,Me;if(!Object.is(n.current[P],_)){if(n.current[P]=_,P==="search")W(),q(),z(1,oe);else if(P==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ye=document.getElementById(M);ye?ye.focus():(X=document.getElementById(A))==null||X.focus()}if(z(7,()=>{var ye;n.current.selectedItemId=(ye=fe())==null?void 0:ye.id,L.emit()}),$||z(5,me),((ue=f.current)==null?void 0:ue.value)!==void 0){let ye=_??"";(Me=(Se=f.current).onValueChange)==null||Me.call(Se,ye);return}}L.emit()}},emit:()=>{u.current.forEach(P=>P())}}),[]),Z=x.useMemo(()=>({value:(P,_,$)=>{var X;_!==((X=o.current.get(P))==null?void 0:X.value)&&(o.current.set(P,{value:_,keywords:$}),n.current.filtered.items.set(P,te(_,$)),z(2,()=>{q(),L.emit()}))},item:(P,_)=>(a.current.add(P),_&&(l.current.has(_)?l.current.get(_).add(P):l.current.set(_,new Set([P]))),z(3,()=>{W(),q(),n.current.value||oe(),L.emit()}),()=>{o.current.delete(P),a.current.delete(P),n.current.filtered.items.delete(P);let $=fe();z(4,()=>{W(),($==null?void 0:$.getAttribute("id"))===P&&oe(),L.emit()})}),group:P=>(l.current.has(P)||l.current.set(P,new Set),()=>{o.current.delete(P),l.current.delete(P)}),filter:()=>f.current.shouldFilter,label:m||e["aria-label"],getDisablePointerSelection:()=>f.current.disablePointerSelection,listId:A,inputId:M,labelId:O,listInnerRef:D}),[]);function te(P,_){var $,X;let ue=(X=($=f.current)==null?void 0:$.filter)!=null?X:AO;return P?ue(P,n.current.search,_):0}function q(){if(!n.current.search||f.current.shouldFilter===!1)return;let P=n.current.filtered.items,_=[];n.current.filtered.groups.forEach(X=>{let ue=l.current.get(X),Se=0;ue.forEach(Me=>{let ye=P.get(Me);Se=Math.max(ye,Se)}),_.push([X,Se])});let $=D.current;ee().sort((X,ue)=>{var Se,Me;let ye=X.getAttribute("id"),ct=ue.getAttribute("id");return((Se=P.get(ct))!=null?Se:0)-((Me=P.get(ye))!=null?Me:0)}).forEach(X=>{let ue=X.closest(Wm);ue?ue.appendChild(X.parentElement===ue?X:X.closest(`${Wm} > *`)):$.appendChild(X.parentElement===$?X:X.closest(`${Wm} > *`))}),_.sort((X,ue)=>ue[1]-X[1]).forEach(X=>{var ue;let Se=(ue=D.current)==null?void 0:ue.querySelector(`${Go}[${fs}="${encodeURIComponent(X[0])}"]`);Se==null||Se.parentElement.appendChild(Se)})}function oe(){let P=ee().find($=>$.getAttribute("aria-disabled")!=="true"),_=P==null?void 0:P.getAttribute(fs);L.setState("value",_||void 0)}function W(){var P,_,$,X;if(!n.current.search||f.current.shouldFilter===!1){n.current.filtered.count=a.current.size;return}n.current.filtered.groups=new Set;let ue=0;for(let Se of a.current){let Me=(_=(P=o.current.get(Se))==null?void 0:P.value)!=null?_:"",ye=(X=($=o.current.get(Se))==null?void 0:$.keywords)!=null?X:[],ct=te(Me,ye);n.current.filtered.items.set(Se,ct),ct>0&&ue++}for(let[Se,Me]of l.current)for(let ye of Me)if(n.current.filtered.items.get(ye)>0){n.current.filtered.groups.add(Se);break}n.current.filtered.count=ue}function me(){var P,_,$;let X=fe();X&&(((P=X.parentElement)==null?void 0:P.firstChild)===X&&(($=(_=X.closest(Go))==null?void 0:_.querySelector(_O))==null||$.scrollIntoView({block:"nearest"})),X.scrollIntoView({block:"nearest"}))}function fe(){var P;return(P=D.current)==null?void 0:P.querySelector(`${tj}[aria-selected="true"]`)}function ee(){var P;return Array.from(((P=D.current)==null?void 0:P.querySelectorAll(p1))||[])}function H(P){let _=ee()[P];_&&L.setState("value",_.getAttribute(fs))}function re(P){var _;let $=fe(),X=ee(),ue=X.findIndex(Me=>Me===$),Se=X[ue+P];(_=f.current)!=null&&_.loop&&(Se=ue+P<0?X[X.length-1]:ue+P===X.length?X[0]:X[ue+P]),Se&&L.setState("value",Se.getAttribute(fs))}function K(P){let _=fe(),$=_==null?void 0:_.closest(Go),X;for(;$&&!X;)$=P>0?UO($,Go):PO($,Go),X=$==null?void 0:$.querySelector(p1);X?L.setState("value",X.getAttribute(fs)):re(P)}let he=()=>H(ee().length-1),T=P=>{P.preventDefault(),P.metaKey?he():P.altKey?K(1):re(1)},U=P=>{P.preventDefault(),P.metaKey?H(0):P.altKey?K(-1):re(-1)};return x.createElement(Ea.div,{ref:t,tabIndex:-1,...C,"cmdk-root":"",onKeyDown:P=>{var _;(_=C.onKeyDown)==null||_.call(C,P);let $=P.nativeEvent.isComposing||P.keyCode===229;if(!(P.defaultPrevented||$))switch(P.key){case"n":case"j":{E&&P.ctrlKey&&T(P);break}case"ArrowDown":{T(P);break}case"p":case"k":{E&&P.ctrlKey&&U(P);break}case"ArrowUp":{U(P);break}case"Home":{P.preventDefault(),H(0);break}case"End":{P.preventDefault(),he();break}case"Enter":{P.preventDefault();let X=fe();if(X){let ue=new Event(Jp);X.dispatchEvent(ue)}}}}},x.createElement("label",{"cmdk-label":"",htmlFor:Z.inputId,id:Z.labelId,style:FO},m),Jd(e,P=>x.createElement(rj.Provider,{value:L},x.createElement(nj.Provider,{value:Z},P))))}),TO=x.forwardRef((e,t)=>{var n,a;let l=Sa(),o=x.useRef(null),u=x.useContext(aj),f=Tu(),m=lj(e),h=(a=(n=m.current)==null?void 0:n.forceMount)!=null?a:u==null?void 0:u.forceMount;dl(()=>{if(!h)return f.item(l,u==null?void 0:u.id)},[h]);let g=sj(l,o,[e.value,e.children,o],e.keywords),y=Fg(),b=wi(z=>z.value&&z.value===g.current),S=wi(z=>h||f.filter()===!1?!0:z.search?z.filtered.items.get(l)>0:!0);x.useEffect(()=>{let z=o.current;if(!(!z||e.disabled))return z.addEventListener(Jp,k),()=>z.removeEventListener(Jp,k)},[S,e.onSelect,e.disabled]);function k(){var z,L;j(),(L=(z=m.current).onSelect)==null||L.call(z,g.current)}function j(){y.setState("value",g.current,!0)}if(!S)return null;let{disabled:E,value:C,onSelect:A,forceMount:O,keywords:M,...D}=e;return x.createElement(Ea.div,{ref:Si(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)}),zO=x.forwardRef((e,t)=>{let{heading:n,children:a,forceMount:l,...o}=e,u=Sa(),f=x.useRef(null),m=x.useRef(null),h=Sa(),g=Tu(),y=wi(S=>l||g.filter()===!1?!0:S.search?S.filtered.groups.has(u):!0);dl(()=>g.group(u),[]),sj(u,f,[e.value,e.heading,m]);let b=x.useMemo(()=>({id:u,forceMount:l}),[l]);return x.createElement(Ea.div,{ref:Si(f,t),...o,"cmdk-group":"",role:"presentation",hidden:y?void 0:!0},n&&x.createElement("div",{ref:m,"cmdk-group-heading":"","aria-hidden":!0,id:h},n),Jd(e,S=>x.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?h:void 0},x.createElement(aj.Provider,{value:b},S))))}),RO=x.forwardRef((e,t)=>{let{alwaysRender:n,...a}=e,l=x.useRef(null),o=wi(u=>!u.search);return!n&&!o?null:x.createElement(Ea.div,{ref:Si(l,t),...a,"cmdk-separator":"",role:"separator"})}),OO=x.forwardRef((e,t)=>{let{onValueChange:n,...a}=e,l=e.value!=null,o=Fg(),u=wi(h=>h.search),f=wi(h=>h.selectedItemId),m=Tu();return x.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),x.createElement(Ea.input,{ref:t,...a,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":m.listId,"aria-labelledby":m.labelId,"aria-activedescendant":f,id:m.inputId,type:"text",value:l?e.value:u,onChange:h=>{l||o.setState("search",h.target.value),n==null||n(h.target.value)}})}),DO=x.forwardRef((e,t)=>{let{children:n,label:a="Suggestions",...l}=e,o=x.useRef(null),u=x.useRef(null),f=wi(h=>h.selectedItemId),m=Tu();return x.useEffect(()=>{if(u.current&&o.current){let h=u.current,g=o.current,y,b=new ResizeObserver(()=>{y=requestAnimationFrame(()=>{let S=h.offsetHeight;g.style.setProperty("--cmdk-list-height",S.toFixed(1)+"px")})});return b.observe(h),()=>{cancelAnimationFrame(y),b.unobserve(h)}}},[]),x.createElement(Ea.div,{ref:Si(o,t),...l,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":f,"aria-label":a,id:m.listId},Jd(e,h=>x.createElement("div",{ref:Si(u,m.listInnerRef),"cmdk-list-sizer":""},h)))}),MO=x.forwardRef((e,t)=>{let{open:n,onOpenChange:a,overlayClassName:l,contentClassName:o,container:u,...f}=e;return x.createElement(Kk,{open:n,onOpenChange:a},x.createElement(Yk,{container:u},x.createElement(Xk,{"cmdk-overlay":"",className:l}),x.createElement(Jk,{"aria-label":e.label,"cmdk-dialog":"",className:o},x.createElement(ij,{ref:t,...f}))))}),LO=x.forwardRef((e,t)=>wi(n=>n.filtered.count===0)?x.createElement(Ea.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),IO=x.forwardRef((e,t)=>{let{progress:n,children:a,label:l="Loading...",...o}=e;return x.createElement(Ea.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":l},Jd(e,u=>x.createElement("div",{"aria-hidden":!0},u)))}),Zn=Object.assign(ij,{List:DO,Item:TO,Input:OO,Group:zO,Separator:RO,Dialog:MO,Empty:LO,Loading:IO});function UO(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function PO(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function lj(e){let t=x.useRef(e);return dl(()=>{t.current=e}),t}var dl=typeof window>"u"?x.useEffect:x.useLayoutEffect;function hs(e){let t=x.useRef();return t.current===void 0&&(t.current=e()),t}function wi(e){let t=Fg(),n=()=>e(t.snapshot());return x.useSyncExternalStore(t.subscribe,n,n)}function sj(e,t,n,a=[]){let l=x.useRef(),o=Tu();return dl(()=>{var u;let f=(()=>{var h;for(let g of n){if(typeof g=="string")return g.trim();if(typeof g=="object"&&"current"in g)return g.current?(h=g.current.textContent)==null?void 0:h.trim():l.current}})(),m=a.map(h=>h.trim());o.value(e,f,m),(u=t.current)==null||u.setAttribute(fs,f),l.current=f}),l}var BO=()=>{let[e,t]=x.useState(),n=hs(()=>new Map);return dl(()=>{n.current.forEach(a=>a()),n.current=new Map},[e]),(a,l)=>{n.current.set(a,l),t({})}};function $O(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Jd({asChild:e,children:t},n){return e&&x.isValidElement(t)?x.cloneElement($O(t),{ref:t.ref},n(t.props.children)):n(t)}var FO={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Ft=Kk,qO=pO,HO=Yk,oj=x.forwardRef(({className:e,...t},n)=>c.jsx(Xk,{ref:n,className:Ne("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}));oj.displayName="DialogOverlay";const Pt=x.forwardRef(({className:e,children:t,...n},a)=>c.jsxs(HO,{children:[c.jsx(oj,{}),c.jsxs(Jk,{ref:a,className:Ne("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,c.jsxs(vO,{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:[c.jsx(fu,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Pt.displayName="DialogContent";function Xt({className:e,...t}){return c.jsx("div",{className:Ne("flex flex-col space-y-1.5 text-center sm:text-left",e),...t})}function tn({className:e,...t}){return c.jsx("div",{className:Ne("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t})}const qt=x.forwardRef(({className:e,...t},n)=>c.jsx(gO,{ref:n,className:Ne("text-subtitle leading-none tracking-tight",e),...t}));qt.displayName="DialogTitle";const Wd=x.forwardRef(({className:e,...t},n)=>c.jsx(yO,{ref:n,className:Ne("text-body text-muted-foreground",e),...t}));Wd.displayName="DialogDescription";const uj=x.forwardRef(({className:e,...t},n)=>c.jsx(Zn,{ref:n,className:Ne("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));uj.displayName=Zn.displayName;function ZO({open:e,onOpenChange:t,children:n}){return c.jsx(Ft,{open:e,onOpenChange:t,children:c.jsx(Pt,{className:"overflow-hidden p-0 shadow-lg",children:c.jsx(uj,{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 cj=x.forwardRef(({className:e,...t},n)=>c.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[c.jsx(Gd,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),c.jsx(Zn.Input,{ref:n,className:Ne("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})]}));cj.displayName=Zn.Input.displayName;const dj=x.forwardRef(({className:e,...t},n)=>c.jsx(Zn.List,{ref:n,className:Ne("max-h-[var(--sp-75)] overflow-y-auto overflow-x-hidden",e),...t}));dj.displayName=Zn.List.displayName;const fj=x.forwardRef((e,t)=>c.jsx(Zn.Empty,{ref:t,className:"py-6 text-center text-body",...e}));fj.displayName=Zn.Empty.displayName;const Sd=x.forwardRef(({className:e,...t},n)=>c.jsx(Zn.Group,{ref:n,className:Ne("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}));Sd.displayName=Zn.Group.displayName;const Wp=x.forwardRef(({className:e,...t},n)=>c.jsx(Zn.Separator,{ref:n,className:Ne("-mx-1 h-px bg-border",e),...t}));Wp.displayName=Zn.Separator.displayName;const wd=x.forwardRef(({className:e,...t},n)=>c.jsx(Zn.Item,{ref:n,className:Ne("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}));wd.displayName=Zn.Item.displayName;function zu(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 Ce.get(`/admin/agents${n?`?${n}`:""}`)}function VO(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 Ce.get(`/admin/agents/all${n?`?${n}`:""}`)}function hj(e){return Ce.get(`/admin/agents/${encodeURIComponent(e)}`)}function QO(e){return Ce.post("/admin/agents",e)}function GO(e){return Ce.get(`/admin/agents/names/${encodeURIComponent(e)}/availability`)}function g1(e,t){return Ce.patch(`/admin/agents/${encodeURIComponent(e)}`,t)}function KO(e){return Ce.delete(`/admin/agents/${encodeURIComponent(e)}`)}function YO(e){return Ce.post(`/admin/agents/${encodeURIComponent(e)}/suspend`,{})}function XO(e){return Ce.post(`/admin/agents/${encodeURIComponent(e)}/reactivate`,{})}function JO(e){return Ce.post(`/admin/agents/${encodeURIComponent(e)}/test`,{})}function vl(){const{data:e}=Ze({queryKey:["agents","name-map"],queryFn:()=>zu({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 qg(){const{data:e}=Ze({queryKey:["agents","name-map"],queryFn:()=>zu({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 WO=[{path:"/",label:"Workspace"},{path:"/agents",label:"Agents"},{path:"/clients",label:"Computers"},{path:"/settings",label:"Settings"},{path:"/admin",label:"Admin"}];function eD({open:e,onOpenChange:t}){const n=kn(),a=vl(),{data:l}=Ze({queryKey:["activity"],queryFn:Au,enabled:e,staleTime:3e4}),o=(l==null?void 0:l.agents)??[],f=Ze({queryKey:["palette-sessions",o.map(h=>h.agentId).join(",")],queryFn:async()=>{const h=[];for(const g of o)try{const y=await Vs(g.agentId);for(const b of y)h.push({agentId:g.agentId,session:b})}catch{}return h},enabled:e&&o.length>0,staleTime:3e4}).data??[],m=h=>{t(!1),n(h)};return c.jsxs(ZO,{open:e,onOpenChange:t,children:[c.jsx(cj,{placeholder:"Jump to agent, chat, or page…"}),c.jsxs(dj,{children:[c.jsx(fj,{children:"No results"}),o.length>0&&c.jsx(Sd,{heading:"Agents",children:o.map(h=>{const g=a(h.agentId);return c.jsxs(wd,{value:`agent ${g} ${h.agentId}`,onSelect:()=>m(`/?a=${h.agentId}`),children:[c.jsx(DT,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),c.jsx("span",{className:"flex-1 truncate",children:g}),c.jsx("span",{className:"text-caption text-muted-foreground font-mono ml-2",children:h.agentId.slice(0,8)})]},h.agentId)})}),f.length>0&&c.jsxs(c.Fragment,{children:[c.jsx(Wp,{}),c.jsx(Sd,{heading:"Chats",children:f.map(({agentId:h,session:g})=>{const y=a(h);return c.jsxs(wd,{value:`chat ${y} ${g.chatId}`,onSelect:()=>m(`/?a=${h}&c=${g.chatId}`),children:[c.jsx(Lg,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),c.jsx("span",{className:"flex-1 truncate",children:y}),c.jsx("span",{className:"text-caption text-muted-foreground font-mono ml-2",children:g.chatId.slice(0,8)})]},`${h}-${g.chatId}`)})})]}),c.jsx(Wp,{}),c.jsx(Sd,{heading:"Pages",children:WO.map(h=>c.jsxs(wd,{value:`page ${h.label}`,onSelect:()=>m(h.path),children:[c.jsx(QT,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),c.jsx("span",{children:h.label})]},h.path))})]})]})}function Ms(e){return c.jsxs("svg",{viewBox:"0 0 9 10",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",shapeRendering:"crispEdges","aria-hidden":"true",...e,children:[c.jsx("rect",{x:"4",y:"0",width:"1",height:"1"}),c.jsx("rect",{x:"3",y:"1",width:"3",height:"1"}),c.jsx("rect",{x:"2",y:"2",width:"5",height:"1"}),c.jsx("rect",{x:"3",y:"3",width:"3",height:"1"}),c.jsx("rect",{x:"2",y:"4",width:"5",height:"1"}),c.jsx("rect",{x:"1",y:"5",width:"7",height:"1"}),c.jsx("rect",{x:"2",y:"6",width:"5",height:"1"}),c.jsx("rect",{x:"1",y:"7",width:"7",height:"1"}),c.jsx("rect",{x:"0",y:"8",width:"9",height:"1"}),c.jsx("rect",{x:"3",y:"9",width:"3",height:"1"})]})}function eg(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 Ce.get(`/admin/notifications${n?`?${n}`:""}`)}function mj(e){return Ce.post(`/admin/notifications/${e}/read`)}function tD(){return Ce.post("/admin/notifications/read-all")}const nD={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 rD(e){switch(e){case"high":return"var(--state-error)";case"medium":return"var(--state-blocked)";default:return"var(--accent-dim)"}}function pj({notification:e,onClick:t,clickable:n}){const a=(nD[e.type]??e.type).toString(),l=rD(e.severity),o=n??!0;return c.jsxs("button",{type:"button",onClick:t,className:Ne("w-full text-left transition-colors text-body",o?"cursor-pointer":"cursor-default"),style:{padding:"var(--sp-1_5) var(--sp-2)",background:e.read?"transparent":"var(--bg-sunken)",borderLeft:`var(--hairline-bold) solid ${l}`,borderRadius:"0 var(--sp-0_75) var(--sp-0_75) 0"},onMouseEnter:u=>{o&&(u.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:u=>{u.currentTarget.style.background=e.read?"transparent":"var(--bg-sunken)"},children:[c.jsxs("div",{className:"flex items-baseline justify-between",style:{gap:8},children:[c.jsx("span",{className:"mono uppercase text-label",style:{color:e.severity==="high"?"var(--state-error)":"var(--fg-3)"},children:a.replace("_"," ")}),c.jsx("span",{className:"mono text-label",style:{color:"var(--fg-4)",whiteSpace:"nowrap"},children:xi(e.createdAt)})]}),c.jsx("div",{style:{color:"var(--fg-2)",marginTop:1,wordBreak:"break-word"},children:e.message})]})}function aD(){var S;const[e,t]=x.useState(!1),[n,a]=x.useState(null),l=x.useRef(null),o=kn(),u=zn(),{data:f}=Ze({queryKey:["notifications","bell"],queryFn:()=>eg({limit:8}),refetchInterval:1e4}),{data:m}=Ze({queryKey:["notifications","unread-count"],queryFn:()=>eg({read:!1,limit:100}),refetchInterval:1e4}),h=((S=m==null?void 0:m.items)==null?void 0:S.length)??0,g=h>0,y=x.useCallback(async k=>{k.read||(mj(k.id).catch(()=>{}),u.invalidateQueries({queryKey:["notifications"]})),t(!1),k.agentId&&k.chatId?o(`/?a=${k.agentId}&c=${k.chatId}`):k.agentId&&o(`/?a=${k.agentId}`)},[o,u]),b=x.useCallback(async()=>{a(null);try{await tD(),await u.invalidateQueries({queryKey:["notifications"]})}catch(k){a(k instanceof Error?k.message:"Failed to mark all as read")}},[u]);return c.jsxs("div",{className:"relative",children:[c.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:[c.jsx(RT,{className:"h-4 w-4"}),g&&c.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&&c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",className:"fixed inset-0 z-40 cursor-default",onClick:()=>t(!1)}),c.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:[c.jsxs("div",{className:"flex items-center justify-between",style:{padding:"var(--sp-2) var(--sp-3)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[c.jsx("span",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-4)"},children:"Notifications"}),g&&c.jsx("button",{type:"button",onClick:b,className:"hover:underline text-body",style:{color:"var(--accent)"},children:"Mark all read"})]}),n&&c.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}),c.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?c.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=>c.jsx(pj,{notification:k,clickable:!!k.agentId,onClick:()=>y(k)},k.id))})]})]})]})}const gj="onboarding:autoOpen",yj="onboarding:joinPath";function vj(e){typeof window>"u"||(window.sessionStorage.setItem(gj,"1"),window.sessionStorage.setItem(yj,e))}const iD=gj,lD=yj,ep=iD,y1=lD,bj=x.createContext(null);function sD({children:e}){const{wizardStep:t,isAuthenticated:n}=rn(),[a,l]=x.useState(!1),[o,u]=x.useState(()=>{const g=typeof window<"u"?window.sessionStorage.getItem(y1):null;return g==="solo"||g==="invite"?g:null});x.useEffect(()=>{if(!n||t===null||t==="completed")return;window.sessionStorage.getItem(ep)==="1"&&(l(!0),window.sessionStorage.removeItem(ep))},[n,t]),x.useEffect(()=>{t==="completed"&&(l(!1),window.sessionStorage.removeItem(ep),window.sessionStorage.removeItem(y1),u(null))},[t]);const f=x.useCallback(()=>l(!0),[]),m=x.useCallback(()=>l(!1),[]),h=x.useMemo(()=>({isOpen:a,open:f,close:m,joinPath:o,step:t,shouldShowResumeCTA:n&&t!==null&&t!=="completed"&&!a}),[a,f,m,o,t,n]);return c.jsx(bj.Provider,{value:h,children:e})}function xj(){const e=x.useContext(bj);return e||{isOpen:!1,open:()=>{},close:()=>{},joinPath:null,step:null,shouldShowResumeCTA:!1}}const v1=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,b1=Jw,oD=(e,t)=>n=>{var a;if((t==null?void 0:t.variants)==null)return b1(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:l,defaultVariants:o}=t,u=Object.keys(l).map(h=>{const g=n==null?void 0:n[h],y=o==null?void 0:o[h];if(g===null)return null;const b=v1(g)||v1(y);return l[h][b]}),f=n&&Object.entries(n).reduce((h,g)=>{let[y,b]=g;return b===void 0||(h[y]=b),h},{}),m=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((h,g)=>{let{class:y,className:b,...S}=g;return Object.entries(S).every(k=>{let[j,E]=k;return Array.isArray(E)?E.includes({...o,...f}[j]):{...o,...f}[j]===E})?[...h,y,b]:h},[]);return b1(e,u,m,n==null?void 0:n.class,n==null?void 0:n.className)},uD=oD("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"}}),pe=x.forwardRef(({className:e,variant:t,size:n,asChild:a=!1,...l},o)=>{const u=a?SO:"button";return c.jsx(u,{className:Ne(uD({variant:t,size:n,className:e})),ref:o,...l})});pe.displayName="Button";const ht=x.forwardRef(({className:e,type:t,...n},a)=>c.jsx("input",{type:t,className:Ne("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}));ht.displayName="Input";function cD(){const{isOpen:e,close:t,joinPath:n,step:a}=xj(),{refreshMe:l,organizationId:o}=rn(),[u,f]=x.useState([]);x.useEffect(()=>{e&&(async()=>{try{const b=await Ce.get("/me/organizations");f(b)}catch{}})()},[e]);const m=u.find(b=>b.id===o),h=((m==null?void 0:m.displayName)??"").replace(/'s Personal Team$/,"'s team"),g=n==="invite"&&h?`You've joined ${h}.`:"Welcome — let's get you set up.",y=a==="connect"&&n!=="invite";return c.jsx(Ft,{open:e,onOpenChange:b=>!b&&t(),children:c.jsxs(Pt,{children:[c.jsxs(Xt,{children:[c.jsx(qt,{children:g}),c.jsx(Wd,{children:a==="connect"?"Connect a computer, then create your first agent.":a==="create_agent"?"One more step: create your first agent.":"All set!"})]}),y&&c.jsx("p",{className:"text-label text-muted-foreground",style:{margin:0},children:"We've created your personal team. You can rename it, invite teammates, or join an existing team later."}),a==="connect"&&c.jsx(dD,{onAdvance:l}),a==="create_agent"&&c.jsx(fD,{onAdvance:l})]})})}function dD({onAdvance:e}){const[t,n]=x.useState(null),[a,l]=x.useState(!1);x.useEffect(()=>{let u=!1;return(async()=>{try{const f=await Ce.post("/connect-tokens",{});u||n(f.token)}catch{}})(),()=>{u=!0}},[]),x.useEffect(()=>{let u=!1;const m=setInterval(async()=>{u||await e()},3e3);return()=>{u=!0,clearInterval(m)}},[e]);const o=t?`npm install -g @agent-team-foundation/first-tree-hub
310
+ first-tree-hub connect ${t}`:"";return c.jsxs("div",{className:"space-y-3",style:{minWidth:0,maxWidth:"100%"},children:[c.jsx("div",{style:{width:"100%",overflow:"hidden",minWidth:0},children:c.jsx("pre",{className:"rounded-md bg-muted p-3 text-label font-mono",style:{whiteSpace:"pre-wrap",wordBreak:"break-all",overflowWrap:"anywhere",width:"100%",minWidth:0,boxSizing:"border-box",margin:0},children:o||"Generating token…"})}),c.jsx(pe,{variant:"outline",size:"sm",disabled:!o,onClick:()=>{navigator.clipboard.writeText(o),l(!0),setTimeout(()=>l(!1),1500)},children:a?"Copied!":"Copy commands"}),c.jsx("p",{className:"text-label text-muted-foreground",children:"Waiting for your computer to check in…"})]})}function fD({onAdvance:e}){const[t,n]=x.useState(""),[a,l]=x.useState(!1),[o,u]=x.useState(null),f=async m=>{if(m.preventDefault(),!!t.trim()){l(!0),u(null);try{await Ce.post("/admin/agents",{name:t.trim(),type:"autonomous_agent",displayName:t.trim()}),await e()}catch(h){u(h instanceof Error?h.message:"Failed to create agent")}finally{l(!1)}}};return c.jsxs("form",{className:"space-y-3",onSubmit:f,children:[o&&c.jsx("div",{className:"rounded-md bg-destructive/10 p-2 text-label text-destructive",children:o}),c.jsx(ht,{id:"onboarding-agent-name","aria-label":"Agent name",value:t,onChange:m=>n(m.target.value),placeholder:"my-first-agent",autoFocus:!0}),c.jsx(pe,{type:"submit",className:"w-full",disabled:a||!t.trim(),children:a?"Creating…":"Create agent"})]})}function hD(){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 mD(){const[e,t]=x.useState(hD);return x.useEffect(()=>{document.documentElement.classList.toggle("dark",e==="dark"),window.localStorage.setItem("theme",e)},[e]),c.jsx("button",{type:"button",onClick:()=>t(e==="dark"?"light":"dark"),"aria-label":e==="dark"?"Switch to light theme":"Switch to dark theme",className:"flex items-center gap-1.5 rounded-md px-2 py-1.5 text-body text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-colors",children:e==="dark"?c.jsx(vz,{className:"h-4 w-4"}):c.jsx(nz,{className:"h-4 w-4"})})}function pD(e){var n;const t=e.trim();return t?((n=t[0])==null?void 0:n.toUpperCase())??"?":"?"}function x1({src:e,name:t,size:n=28,className:a}){const l=`${n}px`;return e?c.jsx("img",{src:e,alt:t,width:n,height:n,className:a,style:{width:l,height:l,borderRadius:"50%",objectFit:"cover",display:"block"}}):c.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:c.jsx("span",{className:"text-subtitle font-semibold",children:pD(t)})})}function gD({action:e,onClose:t}){const n=e!==null;return c.jsx(Ft,{open:n,onOpenChange:a=>!a&&t(),children:c.jsxs(Pt,{children:[c.jsxs(Xt,{children:[c.jsx(qt,{children:e==="join"?"Join a team":"Create a new team"}),c.jsx(Wd,{children:e==="join"?"Paste the invite token shared with you.":"You'll be the admin. You can rename or invite teammates afterward."})]}),e==="create"&&c.jsx(vD,{onDone:t}),e==="join"&&c.jsx(bD,{onDone:t})]})})}function yD(e){return e.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").slice(0,40)||"team"}function vD({onDone:e}){const{adoptTokens:t}=rn(),n=kn(),[a,l]=x.useState(""),[o,u]=x.useState(null),[f,m]=x.useState(!1);x.useEffect(()=>{l(""),u(null),m(!1)},[]);const h=async g=>{g.preventDefault();const y=a.trim();if(y){m(!0),u(null);try{const b=await Ce.post("/me/organizations",{name:yD(y),displayName:y});await t(b.tokens),e(),n("/",{replace:!0})}catch(b){u(b instanceof Error?b.message:"Failed to create team")}finally{m(!1)}}};return c.jsxs("form",{className:"space-y-3",onSubmit:h,children:[o&&c.jsx("div",{className:"rounded-md bg-destructive/10 p-2 text-label text-destructive",children:o}),c.jsx(ht,{id:"team-display-name","aria-label":"Team name",value:a,onChange:g=>l(g.target.value),placeholder:"Acme Robotics",autoFocus:!0}),c.jsx(pe,{type:"submit",className:"w-full",disabled:f||!a.trim(),children:f?"Creating…":"Create team"})]})}function bD({onDone:e}){const{adoptTokens:t}=rn(),n=kn(),[a,l]=x.useState(""),[o,u]=x.useState(null),[f,m]=x.useState(!1);x.useEffect(()=>{l(""),u(null),m(!1)},[]);const h=async g=>{if(g.preventDefault(),!!a.trim()){m(!0),u(null);try{const y=a.trim(),b=/\/invite\/([^/?#]+)/.exec(y),S=(b==null?void 0:b[1])??y,k=await Ce.post("/me/organizations/join",{token:S});await t(k.tokens),e(),n("/",{replace:!0})}catch(y){u(y instanceof Error?y.message:"Failed to join team")}finally{m(!1)}}};return c.jsxs("form",{className:"space-y-3",onSubmit:h,children:[o&&c.jsx("div",{className:"rounded-md bg-destructive/10 p-2 text-label text-destructive",children:o}),c.jsx(ht,{id:"join-token","aria-label":"Invite token or full URL",value:a,onChange:g=>l(g.target.value),placeholder:"abc123… or https://hub/invite/abc123",autoFocus:!0}),c.jsx(pe,{type:"submit",className:"w-full",disabled:f||!a.trim(),children:f?"Joining…":"Join team"})]})}function xD(){var A;const{organizationId:e,user:t,adoptTokens:n,logout:a}=rn(),l=kn(),[o,u]=x.useState([]),[f,m]=x.useState(!1),[h,g]=x.useState(null),y=x.useRef(null);x.useEffect(()=>{(async()=>{try{const O=await Ce.get("/me/organizations");u(O)}catch{}})()},[]),x.useEffect(()=>{const O=D=>{f&&y.current&&!y.current.contains(D.target)&&m(!1)},M=D=>{f&&D.key==="Escape"&&m(!1)};return window.addEventListener("mousedown",O),window.addEventListener("keydown",M),()=>{window.removeEventListener("mousedown",O),window.removeEventListener("keydown",M)}},[f]);const b=(t==null?void 0:t.displayName)??"User",S=(t==null?void 0:t.username)??"",k=(t==null?void 0:t.avatarUrl)??null,j=async O=>{if(O===e){m(!1);return}try{const M=await Ce.post("/auth/switch-org",{organizationId:O});await n(M),m(!1),l("/",{replace:!0})}catch{}},E=()=>{m(!1),g("create")},C=()=>{m(!1),g("join")};return c.jsxs(c.Fragment,{children:[c.jsxs("div",{ref:y,className:"relative","data-testid":"user-menu",children:[c.jsx("button",{type:"button","aria-label":`User menu, ${b}`,"aria-haspopup":"menu","aria-expanded":f,onClick:()=>m(O=>!O),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:c.jsx(x1,{src:k,name:b,size:28})}),f&&c.jsxs("div",{role:"menu",className:"absolute right-0 z-30 mt-2 rounded-md border bg-popover shadow-md",style:{width:280},children:[c.jsxs("div",{className:"flex items-center gap-3 border-b px-4 py-3",style:{borderColor:"var(--border)"},children:[c.jsx(x1,{src:k,name:b,size:32}),c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"text-subtitle font-medium truncate",style:{color:"var(--fg)"},children:b}),S&&S!==b&&c.jsxs("div",{className:"text-label text-muted-foreground truncate",children:["@",S]})]})]}),o.length>0&&c.jsxs("div",{className:"border-b py-1",style:{borderColor:"var(--border)"},children:[c.jsx("div",{className:"px-4 py-1 text-eyebrow text-muted-foreground",children:"Team"}),o.length===1?c.jsxs("div",{className:"flex w-full items-center gap-2 px-4 py-1.5 text-left text-body",style:{color:"var(--fg)"},children:[c.jsx("span",{style:{width:14,display:"inline-flex"},children:c.jsx(bi,{className:"h-3.5 w-3.5"})}),c.jsx("span",{className:"truncate",children:(A=o[0])==null?void 0:A.displayName})]}):c.jsx("div",{children:o.map(O=>c.jsxs("button",{type:"button",role:"menuitem",onClick:()=>void j(O.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:[c.jsx("span",{style:{width:14,display:"inline-flex"},children:O.id===e?c.jsx(bi,{className:"h-3.5 w-3.5"}):null}),c.jsx("span",{className:"truncate",children:O.displayName})]},O.id))})]}),c.jsxs("div",{className:"border-b py-1",style:{borderColor:"var(--border)"},children:[c.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:[c.jsx(ja,{className:"h-3.5 w-3.5"}),c.jsx("span",{children:"Create new team"})]}),c.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:[c.jsx(Az,{className:"h-3.5 w-3.5"}),c.jsx("span",{children:"Join with invite link"})]})]}),c.jsxs("div",{className:"py-1",children:[c.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:[c.jsx(mz,{className:"h-3.5 w-3.5"}),c.jsx("span",{children:"Settings"})]}),c.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:[c.jsx(WT,{className:"h-3.5 w-3.5"}),c.jsx("span",{children:"Sign out"})]})]})]})]}),c.jsx(gD,{action:h,onClose:()=>g(null)})]})}const S1=[{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"}],SD={to:"/admin",label:"Admin",end:!1,kbd:"⌘5"};function wD(){const{role:e}=rn(),t=e==="admin",[n,a]=x.useState(!1),l=t?[...S1,SD]:S1,o=sr(),u=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)},[]),c.jsxs("div",{className:"flex flex-col overflow-hidden",style:{height:"100vh",background:"var(--bg)"},children:[c.jsxs("header",{className:"relative shrink-0 grid items-center",style:{height:48,gridTemplateColumns:"auto 1fr auto",padding:"0 var(--sp-3)",borderBottom:"var(--hairline) solid var(--border)",background:"var(--bg-raised)"},children:[c.jsxs("div",{className:"flex items-center",style:{gap:10},children:[c.jsx(Ms,{width:16,height:18,style:{color:"var(--fg)"}}),c.jsxs("span",{className:"text-title",style:{color:"var(--fg)"},children:["First Tree"," ",c.jsx("span",{className:"font-normal",style:{color:"var(--fg-3)"},children:"Hub"})]})]}),c.jsx("nav",{className:"flex justify-center",style:{gap:2,pointerEvents:"none"},children:l.map(f=>c.jsx($w,{to:f.to,end:f.end,style:{pointerEvents:"auto"},className:({isActive:m})=>Ne("inline-flex items-center transition-colors",m?"":"hover:text-[var(--fg)]"),children:({isActive:m})=>c.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&&c.jsx("span",{className:"kbd",children:f.kbd})]})},f.to))}),c.jsxs("div",{className:"flex items-center",style:{gap:6},children:[c.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:[c.jsx(Gd,{className:"h-4 w-4"}),c.jsx("span",{children:"Jump to…"}),c.jsx("span",{className:"kbd",children:"⌘K"})]}),c.jsx("span",{style:{width:1,height:18,background:"var(--border)",margin:"0 var(--sp-1)"}}),c.jsx(aD,{}),c.jsx(mD,{}),c.jsx("span",{style:{width:1,height:18,background:"var(--border)",margin:"0 var(--sp-1)"}}),c.jsx(xD,{})]})]}),c.jsx(eD,{open:n,onOpenChange:a}),c.jsx(cD,{}),u?c.jsx(qp,{}):c.jsx("main",{className:"flex-1 overflow-auto",children:c.jsx("div",{className:"p-6 mx-auto",style:{maxWidth:1280},children:c.jsx(qp,{})})})]})}function le(e,t,n){function a(f,m){if(f._zod||Object.defineProperty(f,"_zod",{value:{def:m,constr:u,traits:new Set},enumerable:!1}),f._zod.traits.has(e))return;f._zod.traits.add(e),t(f,m);const h=u.prototype,g=Object.keys(h);for(let y=0;y<g.length;y++){const b=g[y];b in f||(f[b]=h[b].bind(f))}}const l=(n==null?void 0:n.Parent)??Object;class o extends l{}Object.defineProperty(o,"name",{value:e});function u(f){var m;const h=n!=null&&n.Parent?new o:this;a(h,f),(m=h._zod).deferred??(m.deferred=[]);for(const g of h._zod.deferred)g();return h}return Object.defineProperty(u,"init",{value:a}),Object.defineProperty(u,Symbol.hasInstance,{value:f=>{var m,h;return n!=null&&n.Parent&&f instanceof n.Parent?!0:(h=(m=f==null?void 0:f._zod)==null?void 0:m.traits)==null?void 0:h.has(e)}}),Object.defineProperty(u,"name",{value:e}),u}class xs extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Sj extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const wj={};function ki(e){return wj}function kj(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 tg(e,t){return typeof t=="bigint"?t.toString():t}function ef(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Hg(e){return e==null}function Zg(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function kD(e,t){const n=(e.toString().split(".")[1]||"").length,a=t.toString();let l=(a.split(".")[1]||"").length;if(l===0&&/\d?e-\d?/.test(a)){const m=a.match(/\d?e-(\d?)/);m!=null&&m[1]&&(l=Number.parseInt(m[1]))}const o=n>l?n:l,u=Number.parseInt(e.toFixed(o).replace(".","")),f=Number.parseInt(t.toFixed(o).replace(".",""));return u%f/10**o}const w1=Symbol("evaluating");function mt(e,t,n){let a;Object.defineProperty(e,t,{get(){if(a!==w1)return a===void 0&&(a=w1,a=n()),a},set(l){Object.defineProperty(e,t,{value:l})},configurable:!0})}function bl(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ei(...e){const t={};for(const n of e){const a=Object.getOwnPropertyDescriptors(n);Object.assign(t,a)}return Object.defineProperties({},t)}function k1(e){return JSON.stringify(e)}function jD(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const jj="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function gu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const CD=ef(()=>{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 Ls(e){if(gu(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(gu(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Cj(e){return Ls(e)?{...e}:Array.isArray(e)?[...e]:e}const ED=new Set(["string","number","symbol"]);function Is(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ni(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 _e(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 ND(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const _D={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 AD(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=Ei(e._zod.def,{get shape(){const u={};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&(u[f]=n.shape[f])}return bl(this,"shape",u),u},checks:[]});return Ni(e,o)}function TD(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=Ei(e._zod.def,{get shape(){const u={...e._zod.def.shape};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&delete u[f]}return bl(this,"shape",u),u},checks:[]});return Ni(e,o)}function zD(e,t){if(!Ls(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const o=e._zod.def.shape;for(const u in t)if(Object.getOwnPropertyDescriptor(o,u)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const l=Ei(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return bl(this,"shape",o),o}});return Ni(e,l)}function RD(e,t){if(!Ls(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Ei(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return bl(this,"shape",a),a}});return Ni(e,n)}function OD(e,t){const n=Ei(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return bl(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:[]});return Ni(e,n)}function DD(e,t,n){const l=t._zod.def.checks;if(l&&l.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const u=Ei(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 bl(this,"shape",m),m},checks:[]});return Ni(t,u)}function MD(e,t,n){const a=Ei(t._zod.def,{get shape(){const l=t._zod.def.shape,o={...l};if(n)for(const u in n){if(!(u in o))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(o[u]=new e({type:"nonoptional",innerType:l[u]}))}else for(const u in l)o[u]=new e({type:"nonoptional",innerType:l[u]});return bl(this,"shape",o),o}});return Ni(t,a)}function ps(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 gs(e,t){return t.map(n=>{var a;return(a=n).path??(a.path=[]),n.path.unshift(e),n})}function ld(e){return typeof e=="string"?e:e==null?void 0:e.message}function ji(e,t,n){var l,o,u,f,m,h;const a={...e,path:e.path??[]};if(!e.message){const g=ld((u=(o=(l=e.inst)==null?void 0:l._zod.def)==null?void 0:o.error)==null?void 0:u.call(o,e))??ld((f=t==null?void 0:t.error)==null?void 0:f.call(t,e))??ld((m=n.customError)==null?void 0:m.call(n,e))??ld((h=n.localeError)==null?void 0:h.call(n,e))??"Invalid input";a.message=g}return delete a.inst,delete a.continue,t!=null&&t.reportInput||delete a.input,a}function Vg(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function yu(...e){const[t,n,a]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:a}:{...t}}const Ej=(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,tg,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Nj=le("$ZodError",Ej),_j=le("$ZodError",Ej,{Parent:Error});function LD(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 ID(e,t=n=>n.message){const n={_errors:[]},a=l=>{for(const o of l.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(u=>a({issues:u}));else if(o.code==="invalid_key")a({issues:o.issues});else if(o.code==="invalid_element")a({issues:o.issues});else if(o.path.length===0)n._errors.push(t(o));else{let u=n,f=0;for(;f<o.path.length;){const m=o.path[f];f===o.path.length-1?(u[m]=u[m]||{_errors:[]},u[m]._errors.push(t(o))):u[m]=u[m]||{_errors:[]},u=u[m],f++}}};return a(e),n}const Qg=e=>(t,n,a,l)=>{const o=a?Object.assign(a,{async:!1}):{async:!1},u=t._zod.run({value:n,issues:[]},o);if(u instanceof Promise)throw new xs;if(u.issues.length){const f=new((l==null?void 0:l.Err)??e)(u.issues.map(m=>ji(m,o,ki())));throw jj(f,l==null?void 0:l.callee),f}return u.value},Gg=e=>async(t,n,a,l)=>{const o=a?Object.assign(a,{async:!0}):{async:!0};let u=t._zod.run({value:n,issues:[]},o);if(u instanceof Promise&&(u=await u),u.issues.length){const f=new((l==null?void 0:l.Err)??e)(u.issues.map(m=>ji(m,o,ki())));throw jj(f,l==null?void 0:l.callee),f}return u.value},tf=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 xs;return o.issues.length?{success:!1,error:new(e??Nj)(o.issues.map(u=>ji(u,l,ki())))}:{success:!0,data:o.value}},UD=tf(_j),nf=e=>async(t,n,a)=>{const l=a?Object.assign(a,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},l);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(u=>ji(u,l,ki())))}:{success:!0,data:o.value}},PD=nf(_j),BD=e=>(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Qg(e)(t,n,l)},$D=e=>(t,n,a)=>Qg(e)(t,n,a),FD=e=>async(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Gg(e)(t,n,l)},qD=e=>async(t,n,a)=>Gg(e)(t,n,a),HD=e=>(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return tf(e)(t,n,l)},ZD=e=>(t,n,a)=>tf(e)(t,n,a),VD=e=>async(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return nf(e)(t,n,l)},QD=e=>async(t,n,a)=>nf(e)(t,n,a),GD=/^[cC][^\s-]{8,}$/,KD=/^[0-9a-z]+$/,YD=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,XD=/^[0-9a-vA-V]{20}$/,JD=/^[A-Za-z0-9]{27}$/,WD=/^[a-zA-Z0-9_-]{21}$/,eM=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,tM=/^([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})$/,j1=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)$/,nM=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,rM="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function aM(){return new RegExp(rM,"u")}const iM=/^(?:(?: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])$/,lM=/^(([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}|:))$/,sM=/^((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])$/,oM=/^(([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])$/,uM=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Aj=/^[A-Za-z0-9_-]*$/,cM=/^\+[1-9]\d{6,14}$/,Tj="(?:(?:\\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])))",dM=new RegExp(`^${Tj}$`);function zj(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 fM(e){return new RegExp(`^${zj(e)}$`)}function hM(e){const t=zj({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(`^${Tj}T(?:${a})$`)}const mM=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}$`)},pM=/^-?\d+$/,Rj=/^-?\d+(?:\.\d+)?$/,gM=/^(?:true|false)$/i,yM=/^[^A-Z]*$/,vM=/^[^a-z]*$/,Vn=le("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Oj={number:"number",bigint:"bigint",object:"date"},Dj=le("$ZodCheckLessThan",(e,t)=>{Vn.init(e,t);const n=Oj[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})}}),Mj=le("$ZodCheckGreaterThan",(e,t)=>{Vn.init(e,t);const n=Oj[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})}}),bM=le("$ZodCheckMultipleOf",(e,t)=>{Vn.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):kD(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})}}),xM=le("$ZodCheckNumberFormat",(e,t)=>{var u;Vn.init(e,t),t.format=t.format||"float64";const n=(u=t.format)==null?void 0:u.includes("int"),a=n?"int":"number",[l,o]=_D[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=pM)}),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})}}),SM=le("$ZodCheckMaxLength",(e,t)=>{var n;Vn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const l=a.value;return!Hg(l)&&l.length!==void 0}),e._zod.onattach.push(a=>{const l=a._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<l&&(a._zod.bag.maximum=t.maximum)}),e._zod.check=a=>{const l=a.value;if(l.length<=t.maximum)return;const u=Vg(l);a.issues.push({origin:u,code:"too_big",maximum:t.maximum,inclusive:!0,input:l,inst:e,continue:!t.abort})}}),wM=le("$ZodCheckMinLength",(e,t)=>{var n;Vn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const l=a.value;return!Hg(l)&&l.length!==void 0}),e._zod.onattach.push(a=>{const l=a._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>l&&(a._zod.bag.minimum=t.minimum)}),e._zod.check=a=>{const l=a.value;if(l.length>=t.minimum)return;const u=Vg(l);a.issues.push({origin:u,code:"too_small",minimum:t.minimum,inclusive:!0,input:l,inst:e,continue:!t.abort})}}),kM=le("$ZodCheckLengthEquals",(e,t)=>{var n;Vn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const l=a.value;return!Hg(l)&&l.length!==void 0}),e._zod.onattach.push(a=>{const l=a._zod.bag;l.minimum=t.length,l.maximum=t.length,l.length=t.length}),e._zod.check=a=>{const l=a.value,o=l.length;if(o===t.length)return;const u=Vg(l),f=o>t.length;a.issues.push({origin:u,...f?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:a.value,inst:e,continue:!t.abort})}}),rf=le("$ZodCheckStringFormat",(e,t)=>{var n,a;Vn.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=()=>{})}),jM=le("$ZodCheckRegex",(e,t)=>{rf.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})}}),CM=le("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=yM),rf.init(e,t)}),EM=le("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=vM),rf.init(e,t)}),NM=le("$ZodCheckIncludes",(e,t)=>{Vn.init(e,t);const n=Is(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})}}),_M=le("$ZodCheckStartsWith",(e,t)=>{Vn.init(e,t);const n=new RegExp(`^${Is(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})}}),AM=le("$ZodCheckEndsWith",(e,t)=>{Vn.init(e,t);const n=new RegExp(`.*${Is(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})}}),TM=le("$ZodCheckOverwrite",(e,t)=>{Vn.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class zM{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(`
311
+ `).filter(u=>u),l=Math.min(...a.map(u=>u.length-u.trimStart().length)),o=a.map(u=>u.slice(l)).map(u=>" ".repeat(this.indent*2)+u);for(const u of o)this.content.push(u)}compile(){const t=Function,n=this==null?void 0:this.args,l=[...((this==null?void 0:this.content)??[""]).map(o=>` ${o}`)];return new t(...n,l.join(`
312
+ `))}}const RM={major:4,minor:3,patch:6},zt=le("$ZodType",(e,t)=>{var l;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=RM;const a=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&a.unshift(e);for(const o of a)for(const u of o._zod.onattach)u(e);if(a.length===0)(n=e._zod).deferred??(n.deferred=[]),(l=e._zod.deferred)==null||l.push(()=>{e._zod.run=e._zod.parse});else{const o=(f,m,h)=>{let g=ps(f),y;for(const b of m){if(b._zod.def.when){if(!b._zod.def.when(f))continue}else if(g)continue;const S=f.issues.length,k=b._zod.check(f);if(k instanceof Promise&&(h==null?void 0:h.async)===!1)throw new xs;if(y||k instanceof Promise)y=(y??Promise.resolve()).then(async()=>{await k,f.issues.length!==S&&(g||(g=ps(f,S)))});else{if(f.issues.length===S)continue;g||(g=ps(f,S))}}return y?y.then(()=>f):f},u=(f,m,h)=>{if(ps(f))return f.aborted=!0,f;const g=o(m,a,h);if(g instanceof Promise){if(h.async===!1)throw new xs;return g.then(y=>e._zod.parse(y,h))}return e._zod.parse(g,h)};e._zod.run=(f,m)=>{if(m.skipChecks)return e._zod.parse(f,m);if(m.direction==="backward"){const g=e._zod.parse({value:f.value,issues:[]},{...m,skipChecks:!0});return g instanceof Promise?g.then(y=>u(y,f,m)):u(g,f,m)}const h=e._zod.parse(f,m);if(h instanceof Promise){if(m.async===!1)throw new xs;return h.then(g=>o(g,a,m))}return o(h,a,m)}}mt(e,"~standard",()=>({validate:o=>{var u;try{const f=UD(e,o);return f.success?{value:f.data}:{issues:(u=f.error)==null?void 0:u.issues}}catch{return PD(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}))}),Kg=le("$ZodString",(e,t)=>{var n;zt.init(e,t),e._zod.pattern=[...((n=e==null?void 0:e._zod.bag)==null?void 0:n.patterns)??[]].pop()??mM(e._zod.bag),e._zod.parse=(a,l)=>{if(t.coerce)try{a.value=String(a.value)}catch{}return typeof a.value=="string"||a.issues.push({expected:"string",code:"invalid_type",input:a.value,inst:e}),a}}),Tt=le("$ZodStringFormat",(e,t)=>{rf.init(e,t),Kg.init(e,t)}),OM=le("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=tM),Tt.init(e,t)}),DM=le("$ZodUUID",(e,t)=>{if(t.version){const a={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(a===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=j1(a))}else t.pattern??(t.pattern=j1());Tt.init(e,t)}),MM=le("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=nM),Tt.init(e,t)}),LM=le("$ZodURL",(e,t)=>{Tt.init(e,t),e._zod.check=n=>{try{const a=n.value.trim(),l=new URL(a);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(l.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(l.protocol.endsWith(":")?l.protocol.slice(0,-1):l.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=l.href:n.value=a;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),IM=le("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=aM()),Tt.init(e,t)}),UM=le("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=WD),Tt.init(e,t)}),PM=le("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=GD),Tt.init(e,t)}),BM=le("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=KD),Tt.init(e,t)}),$M=le("$ZodULID",(e,t)=>{t.pattern??(t.pattern=YD),Tt.init(e,t)}),FM=le("$ZodXID",(e,t)=>{t.pattern??(t.pattern=XD),Tt.init(e,t)}),qM=le("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=JD),Tt.init(e,t)}),HM=le("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=hM(t)),Tt.init(e,t)}),ZM=le("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=dM),Tt.init(e,t)}),VM=le("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=fM(t)),Tt.init(e,t)}),QM=le("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=eM),Tt.init(e,t)}),GM=le("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=iM),Tt.init(e,t),e._zod.bag.format="ipv4"}),KM=le("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=lM),Tt.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),YM=le("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=sM),Tt.init(e,t)}),XM=le("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=oM),Tt.init(e,t),e._zod.check=n=>{const a=n.value.split("/");try{if(a.length!==2)throw new Error;const[l,o]=a;if(!o)throw new Error;const u=Number(o);if(`${u}`!==o)throw new Error;if(u<0||u>128)throw new Error;new URL(`http://[${l}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function Lj(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const JM=le("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=uM),Tt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{Lj(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function WM(e){if(!Aj.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Lj(n)}const e4=le("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Aj),Tt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{WM(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),t4=le("$ZodE164",(e,t)=>{t.pattern??(t.pattern=cM),Tt.init(e,t)});function n4(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 r4=le("$ZodJWT",(e,t)=>{Tt.init(e,t),e._zod.check=n=>{n4(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Ij=le("$ZodNumber",(e,t)=>{zt.init(e,t),e._zod.pattern=e._zod.bag.pattern??Rj,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}}),a4=le("$ZodNumberFormat",(e,t)=>{xM.init(e,t),Ij.init(e,t)}),i4=le("$ZodBoolean",(e,t)=>{zt.init(e,t),e._zod.pattern=gM,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}}),l4=le("$ZodUnknown",(e,t)=>{zt.init(e,t),e._zod.parse=n=>n}),s4=le("$ZodNever",(e,t)=>{zt.init(e,t),e._zod.parse=(n,a)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function C1(e,t,n){e.issues.length&&t.issues.push(...gs(n,e.issues)),t.value[n]=e.value}const o4=le("$ZodArray",(e,t)=>{zt.init(e,t),e._zod.parse=(n,a)=>{const l=n.value;if(!Array.isArray(l))return n.issues.push({expected:"array",code:"invalid_type",input:l,inst:e}),n;n.value=Array(l.length);const o=[];for(let u=0;u<l.length;u++){const f=l[u],m=t.element._zod.run({value:f,issues:[]},a);m instanceof Promise?o.push(m.then(h=>C1(h,n,u))):C1(m,n,u)}return o.length?Promise.all(o).then(()=>n):n}});function zd(e,t,n,a,l){if(e.issues.length){if(l&&!(n in a))return;t.issues.push(...gs(n,e.issues))}e.value===void 0?n in a&&(t.value[n]=void 0):t.value[n]=e.value}function Uj(e){var a,l,o,u;const t=Object.keys(e.shape);for(const f of t)if(!((u=(o=(l=(a=e.shape)==null?void 0:a[f])==null?void 0:l._zod)==null?void 0:o.traits)!=null&&u.has("$ZodType")))throw new Error(`Invalid element at key "${f}": expected a Zod schema`);const n=ND(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Pj(e,t,n,a,l,o){const u=[],f=l.keySet,m=l.catchall._zod,h=m.def.type,g=m.optout==="optional";for(const y in t){if(f.has(y))continue;if(h==="never"){u.push(y);continue}const b=m.run({value:t[y],issues:[]},a);b instanceof Promise?e.push(b.then(S=>zd(S,n,y,t,g))):zd(b,n,y,t,g)}return u.length&&n.issues.push({code:"unrecognized_keys",keys:u,input:t,inst:o}),e.length?Promise.all(e).then(()=>n):n}const u4=le("$ZodObject",(e,t)=>{zt.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=ef(()=>Uj(t));mt(e._zod,"propValues",()=>{const f=t.shape,m={};for(const h in f){const g=f[h]._zod;if(g.values){m[h]??(m[h]=new Set);for(const y of g.values)m[h].add(y)}}return m});const l=gu,o=t.catchall;let u;e._zod.parse=(f,m)=>{u??(u=a.value);const h=f.value;if(!l(h))return f.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),f;f.value={};const g=[],y=u.shape;for(const b of u.keys){const S=y[b],k=S._zod.optout==="optional",j=S._zod.run({value:h[b],issues:[]},m);j instanceof Promise?g.push(j.then(E=>zd(E,f,b,h,k))):zd(j,f,b,h,k)}return o?Pj(g,h,f,m,a.value,e):g.length?Promise.all(g).then(()=>f):f}}),c4=le("$ZodObjectJIT",(e,t)=>{u4.init(e,t);const n=e._zod.parse,a=ef(()=>Uj(t)),l=b=>{var O;const S=new zM(["shape","payload","ctx"]),k=a.value,j=M=>{const D=k1(M);return`shape[${D}]._zod.run({ value: input[${D}], issues: [] }, ctx)`};S.write("const input = payload.value;");const E=Object.create(null);let C=0;for(const M of k.keys)E[M]=`key_${C++}`;S.write("const newResult = {};");for(const M of k.keys){const D=E[M],z=k1(M),L=b[M],Z=((O=L==null?void 0:L._zod)==null?void 0:O.optout)==="optional";S.write(`const ${D} = ${j(M)};`),Z?S.write(`
313
+ if (${D}.issues.length) {
314
+ if (${z} in input) {
315
+ payload.issues = payload.issues.concat(${D}.issues.map(iss => ({
316
+ ...iss,
317
+ path: iss.path ? [${z}, ...iss.path] : [${z}]
318
+ })));
319
+ }
320
+ }
321
+
322
+ if (${D}.value === undefined) {
323
+ if (${z} in input) {
324
+ newResult[${z}] = undefined;
325
+ }
326
+ } else {
327
+ newResult[${z}] = ${D}.value;
328
+ }
329
+
330
+ `):S.write(`
331
+ if (${D}.issues.length) {
332
+ payload.issues = payload.issues.concat(${D}.issues.map(iss => ({
333
+ ...iss,
334
+ path: iss.path ? [${z}, ...iss.path] : [${z}]
335
+ })));
336
+ }
337
+
338
+ if (${D}.value === undefined) {
339
+ if (${z} in input) {
340
+ newResult[${z}] = undefined;
341
+ }
342
+ } else {
343
+ newResult[${z}] = ${D}.value;
344
+ }
345
+
346
+ `)}S.write("payload.value = newResult;"),S.write("return payload;");const A=S.compile();return(M,D)=>A(b,M,D)};let o;const u=gu,f=!wj.jitless,h=f&&CD.value,g=t.catchall;let y;e._zod.parse=(b,S)=>{y??(y=a.value);const k=b.value;return u(k)?f&&h&&(S==null?void 0:S.async)===!1&&S.jitless!==!0?(o||(o=l(t.shape)),b=o(b,S),g?Pj([],k,b,S,y,e):b):n(b,S):(b.issues.push({expected:"object",code:"invalid_type",input:k,inst:e}),b)}});function E1(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=>!ps(o));return l.length===1?(t.value=l[0].value,l[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(o=>o.issues.map(u=>ji(u,a,ki())))}),t)}const Bj=le("$ZodUnion",(e,t)=>{zt.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=>Zg(o.source)).join("|")})$`)}});const n=t.options.length===1,a=t.options[0]._zod.run;e._zod.parse=(l,o)=>{if(n)return a(l,o);let u=!1;const f=[];for(const m of t.options){const h=m._zod.run({value:l.value,issues:[]},o);if(h instanceof Promise)f.push(h),u=!0;else{if(h.issues.length===0)return h;f.push(h)}}return u?Promise.all(f).then(m=>E1(m,l,e,o)):E1(f,l,e,o)}}),d4=le("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Bj.init(e,t);const n=e._zod.parse;mt(e._zod,"propValues",()=>{const l={};for(const o of t.options){const u=o._zod.propValues;if(!u||Object.keys(u).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(const[f,m]of Object.entries(u)){l[f]||(l[f]=new Set);for(const h of m)l[f].add(h)}}return l});const a=ef(()=>{var u;const l=t.options,o=new Map;for(const f of l){const m=(u=f._zod.propValues)==null?void 0:u[t.discriminator];if(!m||m.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(f)}"`);for(const h of m){if(o.has(h))throw new Error(`Duplicate discriminator value "${String(h)}"`);o.set(h,f)}}return o});e._zod.parse=(l,o)=>{const u=l.value;if(!gu(u))return l.issues.push({code:"invalid_type",expected:"object",input:u,inst:e}),l;const f=a.value.get(u==null?void 0:u[t.discriminator]);return f?f._zod.run(l,o):t.unionFallback?n(l,o):(l.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:u,path:[t.discriminator],inst:e}),l)}}),f4=le("$ZodIntersection",(e,t)=>{zt.init(e,t),e._zod.parse=(n,a)=>{const l=n.value,o=t.left._zod.run({value:l,issues:[]},a),u=t.right._zod.run({value:l,issues:[]},a);return o instanceof Promise||u instanceof Promise?Promise.all([o,u]).then(([m,h])=>N1(n,m,h)):N1(n,o,u)}});function ng(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(Ls(e)&&Ls(t)){const n=Object.keys(t),a=Object.keys(e).filter(o=>n.indexOf(o)!==-1),l={...e,...t};for(const o of a){const u=ng(e[o],t[o]);if(!u.valid)return{valid:!1,mergeErrorPath:[o,...u.mergeErrorPath]};l[o]=u.data}return{valid:!0,data:l}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let a=0;a<e.length;a++){const l=e[a],o=t[a],u=ng(l,o);if(!u.valid)return{valid:!1,mergeErrorPath:[a,...u.mergeErrorPath]};n.push(u.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function N1(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}),ps(e))return e;const u=ng(t.value,n.value);if(!u.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(u.mergeErrorPath)}`);return e.value=u.data,e}const h4=le("$ZodRecord",(e,t)=>{zt.init(e,t),e._zod.parse=(n,a)=>{const l=n.value;if(!Ls(l))return n.issues.push({expected:"record",code:"invalid_type",input:l,inst:e}),n;const o=[],u=t.keyType._zod.values;if(u){n.value={};const f=new Set;for(const h of u)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){f.add(typeof h=="number"?h.toString():h);const g=t.valueType._zod.run({value:l[h],issues:[]},a);g instanceof Promise?o.push(g.then(y=>{y.issues.length&&n.issues.push(...gs(h,y.issues)),n.value[h]=y.value})):(g.issues.length&&n.issues.push(...gs(h,g.issues)),n.value[h]=g.value)}let m;for(const h in l)f.has(h)||(m=m??[],m.push(h));m&&m.length>0&&n.issues.push({code:"unrecognized_keys",input:l,inst:e,keys:m})}else{n.value={};for(const f of Reflect.ownKeys(l)){if(f==="__proto__")continue;let m=t.keyType._zod.run({value:f,issues:[]},a);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof f=="string"&&Rj.test(f)&&m.issues.length){const y=t.keyType._zod.run({value:Number(f),issues:[]},a);if(y instanceof Promise)throw new Error("Async schemas not supported in object keys currently");y.issues.length===0&&(m=y)}if(m.issues.length){t.mode==="loose"?n.value[f]=l[f]:n.issues.push({code:"invalid_key",origin:"record",issues:m.issues.map(y=>ji(y,a,ki())),input:f,path:[f],inst:e});continue}const g=t.valueType._zod.run({value:l[f],issues:[]},a);g instanceof Promise?o.push(g.then(y=>{y.issues.length&&n.issues.push(...gs(f,y.issues)),n.value[m.value]=y.value})):(g.issues.length&&n.issues.push(...gs(f,g.issues)),n.value[m.value]=g.value)}}return o.length?Promise.all(o).then(()=>n):n}}),m4=le("$ZodEnum",(e,t)=>{zt.init(e,t);const n=kj(t.entries),a=new Set(n);e._zod.values=a,e._zod.pattern=new RegExp(`^(${n.filter(l=>ED.has(typeof l)).map(l=>typeof l=="string"?Is(l):l.toString()).join("|")})$`),e._zod.parse=(l,o)=>{const u=l.value;return a.has(u)||l.issues.push({code:"invalid_value",values:n,input:u,inst:e}),l}}),p4=le("$ZodLiteral",(e,t)=>{if(zt.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"?Is(a):a?Is(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}}),g4=le("$ZodTransform",(e,t)=>{zt.init(e,t),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new Sj(e.constructor.name);const l=t.transform(n.value,n);if(a.async)return(l instanceof Promise?l:Promise.resolve(l)).then(u=>(n.value=u,n));if(l instanceof Promise)throw new xs;return n.value=l,n}});function _1(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const $j=le("$ZodOptional",(e,t)=>{zt.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(`^(${Zg(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=>_1(o,n.value)):_1(l,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,a)}}),y4=le("$ZodExactOptional",(e,t)=>{$j.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)}),v4=le("$ZodNullable",(e,t)=>{zt.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(`^(${Zg(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)}),b4=le("$ZodDefault",(e,t)=>{zt.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=>A1(o,t)):A1(l,t)}});function A1(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const x4=le("$ZodPrefault",(e,t)=>{zt.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))}),S4=le("$ZodNonOptional",(e,t)=>{zt.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=>T1(o,e)):T1(l,e)}});function T1(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 w4=le("$ZodCatch",(e,t)=>{zt.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(u=>ji(u,a,ki()))},input:n.value}),n.issues=[]),n)):(n.value=l.value,l.issues.length&&(n.value=t.catchValue({...n,error:{issues:l.issues.map(o=>ji(o,a,ki()))},input:n.value}),n.issues=[]),n)}}),k4=le("$ZodPipe",(e,t)=>{zt.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(u=>sd(u,t.in,a)):sd(o,t.in,a)}const l=t.in._zod.run(n,a);return l instanceof Promise?l.then(o=>sd(o,t.out,a)):sd(l,t.out,a)}});function sd(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const j4=le("$ZodReadonly",(e,t)=>{zt.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(z1):z1(l)}});function z1(e){return e.value=Object.freeze(e.value),e}const C4=le("$ZodCustom",(e,t)=>{Vn.init(e,t),zt.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=>R1(o,n,a,e));R1(l,n,a,e)}});function R1(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(yu(l))}}var O1;class E4{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 N4(){return new E4}(O1=globalThis).__zod_globalRegistry??(O1.__zod_globalRegistry=N4());const tu=globalThis.__zod_globalRegistry;function _4(e,t){return new e({type:"string",..._e(t)})}function A4(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,..._e(t)})}function D1(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,..._e(t)})}function T4(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,..._e(t)})}function z4(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",..._e(t)})}function R4(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",..._e(t)})}function O4(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",..._e(t)})}function D4(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,..._e(t)})}function M4(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,..._e(t)})}function L4(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,..._e(t)})}function I4(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,..._e(t)})}function U4(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,..._e(t)})}function P4(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,..._e(t)})}function B4(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,..._e(t)})}function $4(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,..._e(t)})}function F4(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,..._e(t)})}function q4(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,..._e(t)})}function H4(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,..._e(t)})}function Z4(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,..._e(t)})}function V4(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,..._e(t)})}function Q4(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,..._e(t)})}function G4(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,..._e(t)})}function K4(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,..._e(t)})}function Y4(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,..._e(t)})}function X4(e,t){return new e({type:"string",format:"date",check:"string_format",..._e(t)})}function J4(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,..._e(t)})}function W4(e,t){return new e({type:"string",format:"duration",check:"string_format",..._e(t)})}function e5(e,t){return new e({type:"number",checks:[],..._e(t)})}function t5(e,t){return new e({type:"number",coerce:!0,checks:[],..._e(t)})}function n5(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",..._e(t)})}function r5(e,t){return new e({type:"boolean",..._e(t)})}function a5(e){return new e({type:"unknown"})}function i5(e,t){return new e({type:"never",..._e(t)})}function M1(e,t){return new Dj({check:"less_than",..._e(t),value:e,inclusive:!1})}function tp(e,t){return new Dj({check:"less_than",..._e(t),value:e,inclusive:!0})}function L1(e,t){return new Mj({check:"greater_than",..._e(t),value:e,inclusive:!1})}function np(e,t){return new Mj({check:"greater_than",..._e(t),value:e,inclusive:!0})}function I1(e,t){return new bM({check:"multiple_of",..._e(t),value:e})}function Fj(e,t){return new SM({check:"max_length",..._e(t),maximum:e})}function Rd(e,t){return new wM({check:"min_length",..._e(t),minimum:e})}function qj(e,t){return new kM({check:"length_equals",..._e(t),length:e})}function l5(e,t){return new jM({check:"string_format",format:"regex",..._e(t),pattern:e})}function s5(e){return new CM({check:"string_format",format:"lowercase",..._e(e)})}function o5(e){return new EM({check:"string_format",format:"uppercase",..._e(e)})}function u5(e,t){return new NM({check:"string_format",format:"includes",..._e(t),includes:e})}function c5(e,t){return new _M({check:"string_format",format:"starts_with",..._e(t),prefix:e})}function d5(e,t){return new AM({check:"string_format",format:"ends_with",..._e(t),suffix:e})}function Qs(e){return new TM({check:"overwrite",tx:e})}function f5(e){return Qs(t=>t.normalize(e))}function h5(){return Qs(e=>e.trim())}function m5(){return Qs(e=>e.toLowerCase())}function p5(){return Qs(e=>e.toUpperCase())}function g5(){return Qs(e=>jD(e))}function y5(e,t,n){return new e({type:"array",element:t,..._e(n)})}function v5(e,t,n){return new e({type:"custom",check:"custom",fn:t,..._e(n)})}function b5(e){const t=x5(n=>(n.addIssue=a=>{if(typeof a=="string")n.issues.push(yu(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(yu(l))}},e(n.value,n)));return t}function x5(e,t){const n=new Vn({check:"custom",..._e(t)});return n._zod.check=e,n}function Hj(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)??tu,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 Yt(e,t,n={path:[],schemaPath:[]}){var g,y;var a;const l=e._zod.def,o=t.seen.get(e);if(o)return o.count++,n.schemaPath.includes(e)&&(o.cycle=n.path),o.schema;const u={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,u);const f=(y=(g=e._zod).toJSONSchema)==null?void 0:y.call(g);if(f)u.schema=f;else{const b={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,u.schema,b);else{const k=u.schema,j=t.processors[l.type];if(!j)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${l.type}`);j(e,t,k,b)}const S=e._zod.parent;S&&(u.ref||(u.ref=S),Yt(S,t,b),t.seen.get(S).isParent=!0)}const m=t.metadataRegistry.get(e);return m&&Object.assign(u.schema,m),t.io==="input"&&En(e)&&(delete u.schema.examples,delete u.schema.default),t.io==="input"&&u.schema._prefault&&((a=u.schema).default??(a.default=u.schema._prefault)),delete u.schema._prefault,t.seen.get(e).schema}function Zj(e,t){var u,f,m,h;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=new Map;for(const g of e.seen.entries()){const y=(u=e.metadataRegistry.get(g[0]))==null?void 0:u.id;if(y){const b=a.get(y);if(b&&b!==g[0])throw new Error(`Duplicate schema id "${y}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(y,g[0])}}const l=g=>{var j;const y=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const E=(j=e.external.registry.get(g[0]))==null?void 0:j.id,C=e.external.uri??(O=>O);if(E)return{ref:C(E)};const A=g[1].defId??g[1].schema.id??`schema${e.counter++}`;return g[1].defId=A,{defId:A,ref:`${C("__shared")}#/${y}/${A}`}}if(g[1]===n)return{ref:"#"};const S=`#/${y}/`,k=g[1].schema.id??`__schema${e.counter++}`;return{defId:k,ref:S+k}},o=g=>{if(g[1].schema.$ref)return;const y=g[1],{ref:b,defId:S}=l(g);y.def={...y.schema},S&&(y.defId=S);const k=y.schema;for(const j in k)delete k[j];k.$ref=b};if(e.cycles==="throw")for(const g of e.seen.entries()){const y=g[1];if(y.cycle)throw new Error(`Cycle detected: #/${(f=y.cycle)==null?void 0:f.join("/")}/<root>
347
+
348
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const g of e.seen.entries()){const y=g[1];if(t===g[0]){o(g);continue}if(e.external){const S=(m=e.external.registry.get(g[0]))==null?void 0:m.id;if(t!==g[0]&&S){o(g);continue}}if((h=e.metadataRegistry.get(g[0]))==null?void 0:h.id){o(g);continue}if(y.cycle){o(g);continue}if(y.count>1&&e.reused==="ref"){o(g);continue}}}function Vj(e,t){var u,f,m;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=h=>{const g=e.seen.get(h);if(g.ref===null)return;const y=g.def??g.schema,b={...y},S=g.ref;if(g.ref=null,S){a(S);const j=e.seen.get(S),E=j.schema;if(E.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(y.allOf=y.allOf??[],y.allOf.push(E)):Object.assign(y,E),Object.assign(y,b),h._zod.parent===S)for(const A in y)A==="$ref"||A==="allOf"||A in b||delete y[A];if(E.$ref&&j.def)for(const A in y)A==="$ref"||A==="allOf"||A in j.def&&JSON.stringify(y[A])===JSON.stringify(j.def[A])&&delete y[A]}const k=h._zod.parent;if(k&&k!==S){a(k);const j=e.seen.get(k);if(j!=null&&j.schema.$ref&&(y.$ref=j.schema.$ref,j.def))for(const E in y)E==="$ref"||E==="allOf"||E in j.def&&JSON.stringify(y[E])===JSON.stringify(j.def[E])&&delete y[E]}e.override({zodSchema:h,jsonSchema:y,path:g.path??[]})};for(const h of[...e.seen.entries()].reverse())a(h[0]);const l={};if(e.target==="draft-2020-12"?l.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?l.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?l.$schema="http://json-schema.org/draft-04/schema#":e.target,(u=e.external)!=null&&u.uri){const h=(f=e.external.registry.get(t))==null?void 0:f.id;if(!h)throw new Error("Schema is missing an `id` property");l.$id=e.external.uri(h)}Object.assign(l,n.def??n.schema);const o=((m=e.external)==null?void 0:m.defs)??{};for(const h of e.seen.entries()){const g=h[1];g.def&&g.defId&&(o[g.defId]=g.def)}e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?l.$defs=o:l.definitions=o);try{const h=JSON.parse(JSON.stringify(l));return Object.defineProperty(h,"~standard",{value:{...t["~standard"],jsonSchema:{input:Od(t,"input",e.processors),output:Od(t,"output",e.processors)}},enumerable:!1,writable:!1}),h}catch{throw new Error("Error converting schema to JSON.")}}function En(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 En(a.element,n);if(a.type==="set")return En(a.valueType,n);if(a.type==="lazy")return En(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 En(a.innerType,n);if(a.type==="intersection")return En(a.left,n)||En(a.right,n);if(a.type==="record"||a.type==="map")return En(a.keyType,n)||En(a.valueType,n);if(a.type==="pipe")return En(a.in,n)||En(a.out,n);if(a.type==="object"){for(const l in a.shape)if(En(a.shape[l],n))return!0;return!1}if(a.type==="union"){for(const l of a.options)if(En(l,n))return!0;return!1}if(a.type==="tuple"){for(const l of a.items)if(En(l,n))return!0;return!!(a.rest&&En(a.rest,n))}return!1}const S5=(e,t={})=>n=>{const a=Hj({...n,processors:t});return Yt(e,a),Zj(a,e),Vj(a,e)},Od=(e,t,n={})=>a=>{const{libraryOptions:l,target:o}=a??{},u=Hj({...l??{},target:o,io:t,processors:n});return Yt(e,u),Zj(u,e),Vj(u,e)},w5={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},k5=(e,t,n,a)=>{const l=n;l.type="string";const{minimum:o,maximum:u,format:f,patterns:m,contentEncoding:h}=e._zod.bag;if(typeof o=="number"&&(l.minLength=o),typeof u=="number"&&(l.maxLength=u),f&&(l.format=w5[f]??f,l.format===""&&delete l.format,f==="time"&&delete l.format),h&&(l.contentEncoding=h),m&&m.size>0){const g=[...m];g.length===1?l.pattern=g[0].source:g.length>1&&(l.allOf=[...g.map(y=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:y.source}))])}},j5=(e,t,n,a)=>{const l=n,{minimum:o,maximum:u,format:f,multipleOf:m,exclusiveMaximum:h,exclusiveMinimum:g}=e._zod.bag;typeof f=="string"&&f.includes("int")?l.type="integer":l.type="number",typeof g=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(l.minimum=g,l.exclusiveMinimum=!0):l.exclusiveMinimum=g),typeof o=="number"&&(l.minimum=o,typeof g=="number"&&t.target!=="draft-04"&&(g>=o?delete l.minimum:delete l.exclusiveMinimum)),typeof h=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(l.maximum=h,l.exclusiveMaximum=!0):l.exclusiveMaximum=h),typeof u=="number"&&(l.maximum=u,typeof h=="number"&&t.target!=="draft-04"&&(h<=u?delete l.maximum:delete l.exclusiveMaximum)),typeof m=="number"&&(l.multipleOf=m)},C5=(e,t,n,a)=>{n.type="boolean"},E5=(e,t,n,a)=>{n.not={}},N5=(e,t,n,a)=>{},_5=(e,t,n,a)=>{const l=e._zod.def,o=kj(l.entries);o.every(u=>typeof u=="number")&&(n.type="number"),o.every(u=>typeof u=="string")&&(n.type="string"),n.enum=o},A5=(e,t,n,a)=>{const l=e._zod.def,o=[];for(const u of l.values)if(u===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof u=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(u))}else o.push(u);if(o.length!==0)if(o.length===1){const u=o[0];n.type=u===null?"null":typeof u,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[u]:n.const=u}else o.every(u=>typeof u=="number")&&(n.type="number"),o.every(u=>typeof u=="string")&&(n.type="string"),o.every(u=>typeof u=="boolean")&&(n.type="boolean"),o.every(u=>u===null)&&(n.type="null"),n.enum=o},T5=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},z5=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},R5=(e,t,n,a)=>{const l=n,o=e._zod.def,{minimum:u,maximum:f}=e._zod.bag;typeof u=="number"&&(l.minItems=u),typeof f=="number"&&(l.maxItems=f),l.type="array",l.items=Yt(o.element,t,{...a,path:[...a.path,"items"]})},O5=(e,t,n,a)=>{var h;const l=n,o=e._zod.def;l.type="object",l.properties={};const u=o.shape;for(const g in u)l.properties[g]=Yt(u[g],t,{...a,path:[...a.path,"properties",g]});const f=new Set(Object.keys(u)),m=new Set([...f].filter(g=>{const y=o.shape[g]._zod;return t.io==="input"?y.optin===void 0:y.optout===void 0}));m.size>0&&(l.required=Array.from(m)),((h=o.catchall)==null?void 0:h._zod.def.type)==="never"?l.additionalProperties=!1:o.catchall?o.catchall&&(l.additionalProperties=Yt(o.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(l.additionalProperties=!1)},D5=(e,t,n,a)=>{const l=e._zod.def,o=l.inclusive===!1,u=l.options.map((f,m)=>Yt(f,t,{...a,path:[...a.path,o?"oneOf":"anyOf",m]}));o?n.oneOf=u:n.anyOf=u},M5=(e,t,n,a)=>{const l=e._zod.def,o=Yt(l.left,t,{...a,path:[...a.path,"allOf",0]}),u=Yt(l.right,t,{...a,path:[...a.path,"allOf",1]}),f=h=>"allOf"in h&&Object.keys(h).length===1,m=[...f(o)?o.allOf:[o],...f(u)?u.allOf:[u]];n.allOf=m},L5=(e,t,n,a)=>{const l=n,o=e._zod.def;l.type="object";const u=o.keyType,f=u._zod.bag,m=f==null?void 0:f.patterns;if(o.mode==="loose"&&m&&m.size>0){const g=Yt(o.valueType,t,{...a,path:[...a.path,"patternProperties","*"]});l.patternProperties={};for(const y of m)l.patternProperties[y.source]=g}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(l.propertyNames=Yt(o.keyType,t,{...a,path:[...a.path,"propertyNames"]})),l.additionalProperties=Yt(o.valueType,t,{...a,path:[...a.path,"additionalProperties"]});const h=u._zod.values;if(h){const g=[...h].filter(y=>typeof y=="string"||typeof y=="number");g.length>0&&(l.required=g)}},I5=(e,t,n,a)=>{const l=e._zod.def,o=Yt(l.innerType,t,a),u=t.seen.get(e);t.target==="openapi-3.0"?(u.ref=l.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}]},U5=(e,t,n,a)=>{const l=e._zod.def;Yt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType},P5=(e,t,n,a)=>{const l=e._zod.def;Yt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType,n.default=JSON.parse(JSON.stringify(l.defaultValue))},B5=(e,t,n,a)=>{const l=e._zod.def;Yt(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)))},$5=(e,t,n,a)=>{const l=e._zod.def;Yt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType;let u;try{u=l.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=u},F5=(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;Yt(o,t,a);const u=t.seen.get(e);u.ref=o},q5=(e,t,n,a)=>{const l=e._zod.def;Yt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType,n.readOnly=!0},Qj=(e,t,n,a)=>{const l=e._zod.def;Yt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType},H5=le("ZodISODateTime",(e,t)=>{HM.init(e,t),Ot.init(e,t)});function Z5(e){return Y4(H5,e)}const V5=le("ZodISODate",(e,t)=>{ZM.init(e,t),Ot.init(e,t)});function Q5(e){return X4(V5,e)}const G5=le("ZodISOTime",(e,t)=>{VM.init(e,t),Ot.init(e,t)});function K5(e){return J4(G5,e)}const Y5=le("ZodISODuration",(e,t)=>{QM.init(e,t),Ot.init(e,t)});function X5(e){return W4(Y5,e)}const J5=(e,t)=>{Nj.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>ID(e,n)},flatten:{value:n=>LD(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,tg,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,tg,2)}},isEmpty:{get(){return e.issues.length===0}}})},kr=le("ZodError",J5,{Parent:Error}),W5=Qg(kr),eL=Gg(kr),tL=tf(kr),nL=nf(kr),rL=BD(kr),aL=$D(kr),iL=FD(kr),lL=qD(kr),sL=HD(kr),oL=ZD(kr),uL=VD(kr),cL=QD(kr),Rt=le("ZodType",(e,t)=>(zt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Od(e,"input"),output:Od(e,"output")}}),e.toJSONSchema=S5(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Ei(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)=>Ni(e,n,a),e.brand=()=>e,e.register=((n,a)=>(n.add(e,a),e)),e.parse=(n,a)=>W5(e,n,a,{callee:e.parse}),e.safeParse=(n,a)=>tL(e,n,a),e.parseAsync=async(n,a)=>eL(e,n,a,{callee:e.parseAsync}),e.safeParseAsync=async(n,a)=>nL(e,n,a),e.spa=e.safeParseAsync,e.encode=(n,a)=>rL(e,n,a),e.decode=(n,a)=>aL(e,n,a),e.encodeAsync=async(n,a)=>iL(e,n,a),e.decodeAsync=async(n,a)=>lL(e,n,a),e.safeEncode=(n,a)=>sL(e,n,a),e.safeDecode=(n,a)=>oL(e,n,a),e.safeEncodeAsync=async(n,a)=>uL(e,n,a),e.safeDecodeAsync=async(n,a)=>cL(e,n,a),e.refine=(n,a)=>e.check(r6(n,a)),e.superRefine=n=>e.check(a6(n)),e.overwrite=n=>e.check(Qs(n)),e.optional=()=>B1(e),e.exactOptional=()=>HL(e),e.nullable=()=>$1(e),e.nullish=()=>B1($1(e)),e.nonoptional=n=>YL(e,n),e.array=()=>Hn(e),e.or=n=>Yj([e,n]),e.and=n=>UL(e,n),e.transform=n=>F1(e,FL(n)),e.default=n=>QL(e,n),e.prefault=n=>KL(e,n),e.catch=n=>JL(e,n),e.pipe=n=>F1(e,n),e.readonly=()=>t6(e),e.describe=n=>{const a=e.clone();return tu.add(a,{description:n}),a},Object.defineProperty(e,"description",{get(){var n;return(n=tu.get(e))==null?void 0:n.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return tu.get(e);const a=e.clone();return tu.add(a,n[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),Gj=le("_ZodString",(e,t)=>{Kg.init(e,t),Rt.init(e,t),e._zod.processJSONSchema=(a,l,o)=>k5(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(l5(...a)),e.includes=(...a)=>e.check(u5(...a)),e.startsWith=(...a)=>e.check(c5(...a)),e.endsWith=(...a)=>e.check(d5(...a)),e.min=(...a)=>e.check(Rd(...a)),e.max=(...a)=>e.check(Fj(...a)),e.length=(...a)=>e.check(qj(...a)),e.nonempty=(...a)=>e.check(Rd(1,...a)),e.lowercase=a=>e.check(s5(a)),e.uppercase=a=>e.check(o5(a)),e.trim=()=>e.check(h5()),e.normalize=(...a)=>e.check(f5(...a)),e.toLowerCase=()=>e.check(m5()),e.toUpperCase=()=>e.check(p5()),e.slugify=()=>e.check(g5())}),dL=le("ZodString",(e,t)=>{Kg.init(e,t),Gj.init(e,t),e.email=n=>e.check(A4(fL,n)),e.url=n=>e.check(D4(hL,n)),e.jwt=n=>e.check(K4(_L,n)),e.emoji=n=>e.check(M4(mL,n)),e.guid=n=>e.check(D1(U1,n)),e.uuid=n=>e.check(T4(od,n)),e.uuidv4=n=>e.check(z4(od,n)),e.uuidv6=n=>e.check(R4(od,n)),e.uuidv7=n=>e.check(O4(od,n)),e.nanoid=n=>e.check(L4(pL,n)),e.guid=n=>e.check(D1(U1,n)),e.cuid=n=>e.check(I4(gL,n)),e.cuid2=n=>e.check(U4(yL,n)),e.ulid=n=>e.check(P4(vL,n)),e.base64=n=>e.check(V4(CL,n)),e.base64url=n=>e.check(Q4(EL,n)),e.xid=n=>e.check(B4(bL,n)),e.ksuid=n=>e.check($4(xL,n)),e.ipv4=n=>e.check(F4(SL,n)),e.ipv6=n=>e.check(q4(wL,n)),e.cidrv4=n=>e.check(H4(kL,n)),e.cidrv6=n=>e.check(Z4(jL,n)),e.e164=n=>e.check(G4(NL,n)),e.datetime=n=>e.check(Z5(n)),e.date=n=>e.check(Q5(n)),e.time=n=>e.check(K5(n)),e.duration=n=>e.check(X5(n))});function R(e){return _4(dL,e)}const Ot=le("ZodStringFormat",(e,t)=>{Tt.init(e,t),Gj.init(e,t)}),fL=le("ZodEmail",(e,t)=>{MM.init(e,t),Ot.init(e,t)}),U1=le("ZodGUID",(e,t)=>{OM.init(e,t),Ot.init(e,t)}),od=le("ZodUUID",(e,t)=>{DM.init(e,t),Ot.init(e,t)}),hL=le("ZodURL",(e,t)=>{LM.init(e,t),Ot.init(e,t)}),mL=le("ZodEmoji",(e,t)=>{IM.init(e,t),Ot.init(e,t)}),pL=le("ZodNanoID",(e,t)=>{UM.init(e,t),Ot.init(e,t)}),gL=le("ZodCUID",(e,t)=>{PM.init(e,t),Ot.init(e,t)}),yL=le("ZodCUID2",(e,t)=>{BM.init(e,t),Ot.init(e,t)}),vL=le("ZodULID",(e,t)=>{$M.init(e,t),Ot.init(e,t)}),bL=le("ZodXID",(e,t)=>{FM.init(e,t),Ot.init(e,t)}),xL=le("ZodKSUID",(e,t)=>{qM.init(e,t),Ot.init(e,t)}),SL=le("ZodIPv4",(e,t)=>{GM.init(e,t),Ot.init(e,t)}),wL=le("ZodIPv6",(e,t)=>{KM.init(e,t),Ot.init(e,t)}),kL=le("ZodCIDRv4",(e,t)=>{YM.init(e,t),Ot.init(e,t)}),jL=le("ZodCIDRv6",(e,t)=>{XM.init(e,t),Ot.init(e,t)}),CL=le("ZodBase64",(e,t)=>{JM.init(e,t),Ot.init(e,t)}),EL=le("ZodBase64URL",(e,t)=>{e4.init(e,t),Ot.init(e,t)}),NL=le("ZodE164",(e,t)=>{t4.init(e,t),Ot.init(e,t)}),_L=le("ZodJWT",(e,t)=>{r4.init(e,t),Ot.init(e,t)}),Yg=le("ZodNumber",(e,t)=>{Ij.init(e,t),Rt.init(e,t),e._zod.processJSONSchema=(a,l,o)=>j5(e,a,l),e.gt=(a,l)=>e.check(L1(a,l)),e.gte=(a,l)=>e.check(np(a,l)),e.min=(a,l)=>e.check(np(a,l)),e.lt=(a,l)=>e.check(M1(a,l)),e.lte=(a,l)=>e.check(tp(a,l)),e.max=(a,l)=>e.check(tp(a,l)),e.int=a=>e.check(P1(a)),e.safe=a=>e.check(P1(a)),e.positive=a=>e.check(L1(0,a)),e.nonnegative=a=>e.check(np(0,a)),e.negative=a=>e.check(M1(0,a)),e.nonpositive=a=>e.check(tp(0,a)),e.multipleOf=(a,l)=>e.check(I1(a,l)),e.step=(a,l)=>e.check(I1(a,l)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Qe(e){return e5(Yg,e)}const AL=le("ZodNumberFormat",(e,t)=>{a4.init(e,t),Yg.init(e,t)});function P1(e){return n5(AL,e)}const TL=le("ZodBoolean",(e,t)=>{i4.init(e,t),Rt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>C5(e,n,a)});function Ru(e){return r5(TL,e)}const zL=le("ZodUnknown",(e,t)=>{l4.init(e,t),Rt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>N5()});function wt(){return a5(zL)}const RL=le("ZodNever",(e,t)=>{s4.init(e,t),Rt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>E5(e,n,a)});function OL(e){return i5(RL,e)}const DL=le("ZodArray",(e,t)=>{o4.init(e,t),Rt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>R5(e,n,a,l),e.element=t.element,e.min=(n,a)=>e.check(Rd(n,a)),e.nonempty=n=>e.check(Rd(1,n)),e.max=(n,a)=>e.check(Fj(n,a)),e.length=(n,a)=>e.check(qj(n,a)),e.unwrap=()=>e.element});function Hn(e,t){return y5(DL,e,t)}const ML=le("ZodObject",(e,t)=>{c4.init(e,t),Rt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>O5(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:wt()}),e.loose=()=>e.clone({...e._zod.def,catchall:wt()}),e.strict=()=>e.clone({...e._zod.def,catchall:OL()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>zD(e,n),e.safeExtend=n=>RD(e,n),e.merge=n=>OD(e,n),e.pick=n=>AD(e,n),e.omit=n=>TD(e,n),e.partial=(...n)=>DD(Jj,e,n[0]),e.required=(...n)=>MD(Wj,e,n[0])});function de(e,t){const n={type:"object",shape:e??{},..._e(t)};return new ML(n)}const Kj=le("ZodUnion",(e,t)=>{Bj.init(e,t),Rt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>D5(e,n,a,l),e.options=t.options});function Yj(e,t){return new Kj({type:"union",options:e,..._e(t)})}const LL=le("ZodDiscriminatedUnion",(e,t)=>{Kj.init(e,t),d4.init(e,t)});function Xj(e,t,n){return new LL({type:"union",options:t,discriminator:e,..._e(n)})}const IL=le("ZodIntersection",(e,t)=>{f4.init(e,t),Rt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>M5(e,n,a,l)});function UL(e,t){return new IL({type:"intersection",left:e,right:t})}const PL=le("ZodRecord",(e,t)=>{h4.init(e,t),Rt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>L5(e,n,a,l),e.keyType=t.keyType,e.valueType=t.valueType});function Ht(e,t,n){return new PL({type:"record",keyType:e,valueType:t,..._e(n)})}const rg=le("ZodEnum",(e,t)=>{m4.init(e,t),Rt.init(e,t),e._zod.processJSONSchema=(a,l,o)=>_5(e,a,l),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(a,l)=>{const o={};for(const u of a)if(n.has(u))o[u]=t.entries[u];else throw new Error(`Key ${u} not found in enum`);return new rg({...t,checks:[],..._e(l),entries:o})},e.exclude=(a,l)=>{const o={...t.entries};for(const u of a)if(n.has(u))delete o[u];else throw new Error(`Key ${u} not found in enum`);return new rg({...t,checks:[],..._e(l),entries:o})}});function Ge(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new rg({type:"enum",entries:n,..._e(t)})}const BL=le("ZodLiteral",(e,t)=>{p4.init(e,t),Rt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>A5(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 An(e,t){return new BL({type:"literal",values:Array.isArray(e)?e:[e],..._e(t)})}const $L=le("ZodTransform",(e,t)=>{g4.init(e,t),Rt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>z5(e,n),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new Sj(e.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(yu(o,n.value,t));else{const u=o;u.fatal&&(u.continue=!1),u.code??(u.code="custom"),u.input??(u.input=n.value),u.inst??(u.inst=e),n.issues.push(yu(u))}};const l=t.transform(n.value,n);return l instanceof Promise?l.then(o=>(n.value=o,n)):(n.value=l,n)}});function FL(e){return new $L({type:"transform",transform:e})}const Jj=le("ZodOptional",(e,t)=>{$j.init(e,t),Rt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>Qj(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function B1(e){return new Jj({type:"optional",innerType:e})}const qL=le("ZodExactOptional",(e,t)=>{y4.init(e,t),Rt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>Qj(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function HL(e){return new qL({type:"optional",innerType:e})}const ZL=le("ZodNullable",(e,t)=>{v4.init(e,t),Rt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>I5(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function $1(e){return new ZL({type:"nullable",innerType:e})}const VL=le("ZodDefault",(e,t)=>{b4.init(e,t),Rt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>P5(e,n,a,l),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function QL(e,t){return new VL({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Cj(t)}})}const GL=le("ZodPrefault",(e,t)=>{x4.init(e,t),Rt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>B5(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function KL(e,t){return new GL({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Cj(t)}})}const Wj=le("ZodNonOptional",(e,t)=>{S4.init(e,t),Rt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>U5(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function YL(e,t){return new Wj({type:"nonoptional",innerType:e,..._e(t)})}const XL=le("ZodCatch",(e,t)=>{w4.init(e,t),Rt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>$5(e,n,a,l),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function JL(e,t){return new XL({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const WL=le("ZodPipe",(e,t)=>{k4.init(e,t),Rt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>F5(e,n,a,l),e.in=t.in,e.out=t.out});function F1(e,t){return new WL({type:"pipe",in:e,out:t})}const e6=le("ZodReadonly",(e,t)=>{j4.init(e,t),Rt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>q5(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function t6(e){return new e6({type:"readonly",innerType:e})}const n6=le("ZodCustom",(e,t)=>{C4.init(e,t),Rt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>T5(e,n)});function r6(e,t={}){return v5(n6,e,t)}function a6(e){return b5(e)}const rp={custom:"custom"};function af(e){return t5(Yg,e)}const i6=new RegExp("(?<![A-Za-z0-9_.@-])@([A-Za-z0-9][A-Za-z0-9_-]{0,63})\\b","g");function l6(e){return e.replace(/```[\s\S]*?```/g,"").replace(/~~~[\s\S]*?~~~/g,"").replace(/`[^`\n]+`/g,"")}function s6(e,t){const n=l6(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(i6)){const u=o[1];if(!u)continue;const f=a.get(u.toLowerCase());f&&l.add(f)}return[...l]}const o6=/^\/(?![/\\])[A-Za-z0-9_\-./?=&%#]*$/;function u6(e){return!e||typeof e!="string"||e.length>256||!o6.test(e)?"/":e}const c6={FEISHU:"feishu",SLACK:"slack",KAEL:"kael"},eC=Ge(["feishu","slack","kael"]),tC=Ge(["active","inactive"]);de({platform:eC,agentId:R().min(1),credentials:Ht(R(),wt()),status:tC.default("active")});de({agentId:R().min(1).optional(),credentials:Ht(R(),wt()).optional(),status:tC.optional()});de({id:Qe(),platform:R(),agentId:R(),hasCredentials:Ru(),status:R(),createdAt:R(),updatedAt:R()});const d6=Ge(["code","reverse_token","oauth","manual"]);de({appId:R().min(1),appSecret:R().min(1)});de({platform:eC,externalUserId:R().min(1),agentId:R().min(1),boundVia:d6.default("manual"),displayName:R().max(200).optional()});de({id:Qe(),platform:R(),externalUserId:R(),agentId:R(),boundVia:R().nullable(),displayName:R().nullable(),createdAt:R()});de({feishuUserId:R().min(1),displayName:R().max(200).optional()});de({configId:Qe(),platform:R(),agentId:R(),appId:R(),connected:Ru(),lastActiveAt:R().nullable()});const nC=Ge(["online","offline"]),rC=Ge(["idle","working","blocked","error"]);Ge(["active","suspended","evicted"]);const f6=Ge(["active","suspended"]);de({chatId:R().min(1),state:f6});de({runtimeState:rC});de({agentId:R().min(1),runtimeType:R().max(50),runtimeVersion:R().max(50).optional()});Ge(["wrong_client","not_owned","agent_suspended","wrong_org","unknown_agent"]);de({agentId:R(),status:nC,connectedAt:R().nullable(),lastSeenAt:R(),clientId:R().nullable().optional(),runtimeType:R().nullable().optional(),runtimeVersion:R().nullable().optional(),runtimeState:rC.nullable().optional(),activeSessions:Qe().int().nullable().optional(),totalSessions:Qe().int().nullable().optional(),runtimeUpdatedAt:R().nullable().optional()});de({total:Qe().int(),running:Qe().int(),byState:de({idle:Qe().int(),working:Qe().int(),blocked:Qe().int(),error:Qe().int()}),clients:Qe().int()});const h6={HUMAN:"human",PERSONAL_ASSISTANT:"personal_assistant",AUTONOMOUS_AGENT:"autonomous_agent"},lf=Ge(["human","personal_assistant","autonomous_agent"]),q1={PRIVATE:"private",ORGANIZATION:"organization"},Xg=Ge(["private","organization"]),m6=Ge(["admin-api","portal"]);Ge(["active","suspended"]);const ag=/^[a-z0-9][a-z0-9_-]{0,63}$/,ys=64,p6=["admin","agent","first-tree","hub","me","null","system","undefined"],g6=new Set(p6);function ig(e){return g6.has(e)}de({name:R().min(1).max(64).regex(ag,"Must start with a letter or digit and contain only lowercase letters, digits, hyphens (-), and underscores (_). Max 64 chars.").refine(e=>!ig(e),{message:"That agent name is reserved — pick a different one."}).optional(),type:lf,displayName:R().min(1).max(200).optional(),delegateMention:R().max(100).optional(),organizationId:R().max(100).optional(),source:m6.optional(),visibility:Xg.optional(),metadata:Ht(R(),wt()).optional(),managerId:R().optional(),clientId:R().min(1).max(100).optional()});de({type:lf.optional(),displayName:R().min(1).max(200).optional(),delegateMention:R().max(100).nullable().optional(),visibility:Xg.optional(),metadata:Ht(R(),wt()).optional(),managerId:R().nullable().optional(),clientId:R().min(1).max(100).nullable().optional()});de({uuid:R(),name:R().nullable(),organizationId:R(),type:lf,displayName:R(),delegateMention:R().nullable(),inboxId:R(),status:R(),source:R().nullable().optional(),visibility:Xg,metadata:Ht(R(),wt()),managerId:R().nullable(),clientId:R().nullable(),presenceStatus:nC.optional(),createdAt:R(),updatedAt:R()});de({repo:R().nullable(),branch:R().nullable()});de({type:An("agent:pinned"),agentId:R(),name:R().nullable(),displayName:R(),agentType:lf});const y6=32e3,Jg=/^[a-z0-9][a-z0-9_-]{0,63}$/i,v6=/^[A-Z][A-Z0-9_]*$/,b6=de({append:R().max(y6).default("")}),x6=de({name:R().regex(Jg,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:An("stdio"),command:R().min(1),args:Hn(R()).optional()}),S6=de({name:R().regex(Jg,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:An("http"),url:R().url(),headers:Ht(R(),R()).optional()}),w6=de({name:R().regex(Jg,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:An("sse"),url:R().url(),headers:Ht(R(),R()).optional()}),k6=Xj("transport",[x6,S6,w6]),j6=de({key:R().regex(v6,"Env key must match /^[A-Z][A-Z0-9_]*$/"),value:R(),sensitive:Ru().default(!1)}),C6=de({url:R().min(1),ref:R().min(1).optional(),localPath:R().min(1).optional()}),Wg=de({prompt:b6.default({append:""}),model:R().default("opus"),mcpServers:Hn(k6).default([]),env:Hn(j6).default([]),gitRepos:Hn(C6).default([])}),E6=(e,t)=>{const n=new Set;e.mcpServers.forEach((o,u)=>{const f=o.name.toLowerCase();n.has(f)&&t.addIssue({code:rp.custom,path:["mcpServers",u,"name"],message:`Duplicate MCP server name "${o.name}"`}),n.add(f)});const a=new Set;e.env.forEach((o,u)=>{a.has(o.key)&&t.addIssue({code:rp.custom,path:["env",u,"key"],message:`Duplicate env key "${o.key}"`}),a.add(o.key)});const l=new Set;e.gitRepos.forEach((o,u)=>{const f=o.localPath??Md(o.url);f&&(l.has(f)&&t.addIssue({code:rp.custom,path:["gitRepos",u,"localPath"],message:`Duplicate git repo local path "${f}"`}),l.add(f))})},aC=Wg.superRefine(E6),N6=de({agentId:R(),version:Qe().int().positive(),payload:aC,updatedAt:R(),updatedBy:R()});de({expectedVersion:Qe().int().positive(),payload:Wg.partial()});de({payload:Wg.partial()});de({current:N6,next:aC,diff:Hn(de({path:R(),op:Ge(["add","remove","replace"]),before:wt().optional(),after:wt().optional()}))});const Dd="***";function Md(e){const t=e.trim();return t?((t.split(/[?#]/)[0]??"").split(/[/:]/).filter(Boolean).pop()??"").replace(/\.git$/i,""):""}de({username:R().min(1),password:R().min(1)});de({accessToken:R(),refreshToken:R()});de({refreshToken:R().min(1)});de({token:R().min(1)});de({token:R(),expiresIn:Qe(),command:R()});const _6=Ge(["direct","group","thread"]);de({type:_6,topic:R().max(500).optional(),participantIds:Hn(R()).min(1),metadata:Ht(R(),wt()).optional()});const iC=de({agentId:R(),role:R(),mode:R(),joinedAt:R()});iC.extend({name:R().nullable(),displayName:R(),type:R()});const A6=de({id:R(),organizationId:R(),type:R(),topic:R().nullable(),lifecyclePolicy:R().nullable().optional(),metadata:Ht(R(),wt()),createdAt:R(),updatedAt:R()});A6.extend({participants:Hn(iC)});de({topic:R().trim().max(500).nullable()});de({agentId:R().min(1),mode:Ge(["full","mention_only"]).default("full")});de({agentId:R().min(1)});const T6=Ge(["connected","disconnected"]);de({id:R(),userId:R().nullable(),status:T6,sdkVersion:R().max(50).nullable(),hostname:R().max(100).nullable(),os:R().max(50).nullable(),agentCount:Qe().int().min(0),connectedAt:R().nullable(),lastSeenAt:R(),metadata:Ht(R(),wt()).nullable()});de({clientId:R().min(1).max(100),hostname:R().max(100).optional(),os:R().max(50).optional(),sdkVersion:R().max(50).optional()});de({limit:af().int().min(1).max(100).default(20),cursor:R().optional()});const z6=["image/png","image/jpeg","image/gif","image/webp"],ey=Ge(z6);de({data:R().min(1),mimeType:ey,filename:R().min(1),size:Qe().int().nonnegative().optional(),imageId:R().uuid().optional()});de({imageId:R().uuid(),mimeType:ey,filename:R().min(1),size:Qe().int().nonnegative().optional()});de({type:An("image_payload"),imageId:R().uuid(),chatId:R(),base64:R().min(1),mimeType:ey,filename:R().min(1),size:Qe().int().nonnegative().optional()});const ty=Ge(["hub_ui","cli","feishu","github","api"]),lC=Ge(["text","markdown","card","reference","file","task"]);de({format:lC.default("text"),content:wt(),metadata:Ht(R(),wt()).optional(),inReplyTo:R().optional(),replyToInbox:R().optional(),replyToChat:R().optional(),source:ty.optional()});de({format:lC.default("text"),content:wt(),metadata:Ht(R(),wt()).optional(),replyToInbox:R().optional(),replyToChat:R().optional(),source:ty.optional()});const R6=de({id:R(),chatId:R(),senderId:R(),format:R(),content:wt(),metadata:Ht(R(),wt()),replyToInbox:R().nullable(),replyToChat:R().nullable(),inReplyTo:R().nullable(),source:ty.nullable(),createdAt:R()}),O6=de({senderId:R(),chatId:R(),replyToChat:R().nullable()}).nullable(),D6=Ge(["full","mention_only"]),M6=de({id:R(),senderId:R(),format:R(),content:wt(),metadata:Ht(R(),wt()).default({}),createdAt:R()}),L6=R6.extend({configVersion:Qe().int().positive(),recipientMode:D6.default("full"),inReplyToSnapshot:O6.default(null),precedingMessages:Hn(M6).default([])});Ge(["pending","delivered","acked","failed"]);const I6=de({id:Qe(),inboxId:R(),messageId:R(),chatId:R().nullable(),status:R(),retryCount:Qe(),createdAt:R(),deliveredAt:R().nullable(),ackedAt:R().nullable()});I6.extend({message:L6});de({limit:af().int().min(1).max(50).default(10)});const U6=7;de({organizationId:R(),organizationName:R(),organizationDisplayName:R(),role:R()});de({id:R(),organizationId:R(),token:R(),inviteUrl:R(),role:R(),createdAt:R(),expiresAt:R().nullable()});de({token:R().min(1)});de({}).optional();Ge(["connect","create_agent","completed"]);de({id:R(),name:R(),displayName:R(),role:Ge(["admin","member"])});de({name:R().min(2).max(50).regex(/^[a-z0-9][a-z0-9-]*$/),displayName:R().min(1).max(200)});de({organizationId:R().min(1)});const P6={ADMIN:"admin",MEMBER:"member"},ny=Ge(["admin","member"]),B6=de({id:R(),userId:R(),organizationId:R(),agentId:R(),role:ny,createdAt:R()});de({username:R().min(1).max(100),displayName:R().min(1).max(200),role:ny.default("member")});de({role:ny.optional(),displayName:R().min(1).max(200).optional()});B6.extend({username:R(),displayName:R(),password:R()});const $6=Ge(["agent_error","session_error","agent_needs_decision","agent_blocked","agent_stale","agent_disconnected","agent_connected","session_completed"]),sC=Ge(["high","medium","low"]);de({id:R(),organizationId:R(),type:$6,severity:sC,agentId:R().nullable(),chatId:R().nullable(),message:R(),read:Ru(),createdAt:R()});de({limit:af().int().min(1).max(100).default(20),cursor:R().optional(),severity:sC.optional(),read:Ge(["true","false"]).transform(e=>e==="true").optional(),agentId:R().optional()});de({next:R().max(256).optional()});de({code:R().min(1),state:R().min(1)});de({githubId:R().min(1),login:R().min(1),email:R().email().optional(),displayName:R().optional(),next:R().max(256).optional()});const oC=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;de({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=>!oC.test(e),"Name must not be a UUID format"),displayName:R().min(1).max(200),maxAgents:Qe().int().min(0).default(0),maxMessagesPerMinute:Qe().int().min(0).default(0),features:Ht(R(),wt()).default({})});de({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=>!oC.test(e),"Name must not be a UUID format").optional(),displayName:R().min(1).max(200).optional(),maxAgents:Qe().int().min(0).optional(),maxMessagesPerMinute:Qe().int().min(0).optional(),features:Ht(R(),wt()).optional()});de({id:R(),name:R(),displayName:R(),maxAgents:Qe(),maxMessagesPerMinute:Qe(),features:Ht(R(),wt()),createdAt:R(),updatedAt:R()});const F6=de({workingCount:Qe().int().nonnegative(),errorMask:Ru()}),q6=de({type:An("pulse:tick"),organizationId:R(),agents:Ht(R(),Hn(F6).length(32))}),H6=Ge(["tool_call","error","assistant_text","thinking","turn_end"]),uC=de({toolUseId:R(),name:R(),args:wt(),status:Ge(["pending","ok","error"]),durationMs:Qe().int().nonnegative().optional(),resultPreview:R().max(400).optional()}),cC=de({source:Ge(["sdk","runtime","tool"]),message:R().max(2e3)}),dC=de({text:R().max(8e3)}),fC=de({}),hC=de({status:Ge(["success","error"])}),Z6=Xj("kind",[de({kind:An("tool_call"),payload:uC}),de({kind:An("error"),payload:cC}),de({kind:An("assistant_text"),payload:dC}),de({kind:An("thinking"),payload:fC}),de({kind:An("turn_end"),payload:hC})]);de({id:R(),agentId:R(),chatId:R(),seq:Qe().int().positive(),kind:H6,payload:Yj([uC,cC,dC,fC,hC]),createdAt:R()});de({agentId:R(),chatId:R(),event:Z6});de({agentId:R(),chatId:R()});de({type:An("session:reconcile"),agentId:R().min(1),chatIds:Hn(R().min(1)).max(500)});de({type:An("session:reconcile:result"),agentId:R().min(1),staleChatIds:Hn(R().min(1))});const V6=de({organizationId:R(),agentCount:Qe(),chatCount:Qe(),messageCount:Qe()});de({totalAgents:Qe(),totalChats:Qe(),totalMessages:Qe(),byOrganization:Hn(V6)});de({key:R(),value:wt(),updatedAt:R()});Ht(R(),wt());const gi={INBOX_TIMEOUT_SECONDS:"inbox_timeout_seconds",MAX_RETRY_COUNT:"max_retry_count",POLLING_INTERVAL_SECONDS:"polling_interval_seconds",PRESENCE_CLEANUP_SECONDS:"presence_cleanup_seconds"},kd={[gi.INBOX_TIMEOUT_SECONDS]:300,[gi.MAX_RETRY_COUNT]:3,[gi.POLLING_INTERVAL_SECONDS]:5,[gi.PRESENCE_CLEANUP_SECONDS]:60},vu=Ge(["pending","assigned","working","completed","failed","cancelled"]),H1=Ge(["agent","admin"]),Q6=Ge(["assigned","status_changed","cancelled"]);de({taskId:R(),event:Q6,title:R(),body:R().default(""),status:vu,fromStatus:vu.optional(),originRef:R().nullable().optional()});const G6=de({title:R().min(1).max(500),body:R().optional(),assigneeAgentId:R().optional(),originRef:R().max(500).optional(),metadata:Ht(R(),wt()).optional()});G6.extend({organizationId:R().optional()});de({status:Ge(["working","completed","failed"]),result:R().optional()});de({assigneeAgentId:R().nullable().optional(),status:vu.optional(),result:R().optional()});de({chatId:R().min(1)});const K6=de({id:R(),organizationId:R(),title:R(),body:R(),status:vu,assigneeAgentId:R().nullable(),createdByType:H1,createdById:R(),originRef:R().nullable(),result:R().nullable(),metadata:Ht(R(),wt()),createdAt:R(),updatedAt:R(),cancelledAt:R().nullable(),cancelledByType:H1.nullable(),cancelledById:R().nullable()}),Y6=de({taskId:R(),chatId:R(),linkedByAgentId:R().nullable(),linkedAt:R()});K6.extend({chats:Hn(Y6)});de({status:vu.optional(),assigneeAgentId:R().optional(),originRef:R().optional(),limit:af().int().min(1).max(100).default(20),cursor:R().optional()});const X6=Ge(["normal","idle_island","awaiting_reply","no_chat","not_applicable"]);de({taskId:R(),signal:X6,reason:R()});const J6=Ge(["active","suspended"]);de({id:R(),username:R(),displayName:R(),avatarUrl:R().nullable(),status:J6,createdAt:R(),updatedAt:R()});de({username:R().min(1).max(100),displayName:R().min(1).max(200),password:R().min(8).max(200)});de({displayName:R().min(1).max(200).optional(),password:R().min(8).max(200).optional()});de({type:An("auth"),token:R().min(1)});de({type:An("server:welcome"),serverCommandVersion:R().min(1),serverTimeMs:Qe().int().nonnegative()}).passthrough();const mC=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 eI=2e3,tI=3e4;let li=null,Ld=!1,ap=0,au=null;const lg=new Set;let nu=null,vs=0;function nI(e){for(const t of lg)try{t(e)}catch{}nu&&(e.type==="notification"?nu.invalidateQueries({queryKey:["notifications"]}):e.type==="session:state"&&(nu.invalidateQueries({queryKey:["activity"]}),nu.invalidateQueries({queryKey:["sessions"]})))}function pC(){const e=Dg();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);li=a,a.onmessage=l=>{if(a===li)try{const o=JSON.parse(l.data);nI(o)}catch{}},a.onopen=()=>{a===li&&(ap=0)},a.onclose=()=>{if(a!==li||(li=null,Ld||vs===0))return;ap++;const l=Math.min(eI*2**(ap-1),tI);au=setTimeout(()=>{au=null,!Ld&&vs>0&&pC()},l)}}function rI(){Ld=!0,au&&(clearTimeout(au),au=null),li&&(li.close(1e3,"unmount"),li=null)}function gC(e){const{onMessage:t,enabled:n=!0}=e??{},a=zn(),l=x.useRef(t);l.current=t,x.useEffect(()=>{nu=a},[a]),x.useEffect(()=>{if(!n)return;const o=u=>{var f;return(f=l.current)==null?void 0:f.call(l,u)};return lg.add(o),vs++,vs===1&&(Ld=!1,pC()),()=>{lg.delete(o),vs--,vs===0&&rI()}},[n])}const yC=x.createContext({aggregated:mC,agents:{},receivedAtMs:null,stale:!0});function aI({children:e}){const[t,n]=x.useState({aggregated:mC,agents:{},receivedAtMs:null}),[a,l]=x.useState(()=>Date.now());gC({onMessage:u=>{const f=q6.safeParse(u);f.success&&n({aggregated:W6(f.data.agents),agents:f.data.agents,receivedAtMs:Date.now()})}}),x.useEffect(()=>{const u=setInterval(()=>l(Date.now()),1e4);return()=>clearInterval(u)},[]);const o=x.useMemo(()=>({...t,stale:t.receivedAtMs===null||a-t.receivedAtMs>3e4}),[t,a]);return c.jsx(yC.Provider,{value:o,children:e})}function iI(){return x.useContext(yC)}function sf({title:e,subtitle:t,right:n,className:a,style:l,...o}){return c.jsxs("div",{className:Ne("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:[c.jsx("h1",{className:"m-0 text-title",style:{color:"var(--fg)"},children:e}),t&&c.jsx("span",{className:"text-label",style:{color:"var(--fg-3)"},children:t}),c.jsx("div",{style:{flex:1}}),n]})}function vC({className:e,style:t,...n}){return c.jsx("div",{className:Ne("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 bC({active:e,onClick:t,children:n}){return c.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 lI={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 vn({tone:e="neutral",className:t,style:n,...a}){const l=lI[e],o={background:l.bg,color:l.fg,border:`var(--hairline) solid ${l.bd}`,...n};return c.jsx("span",{className:Ne("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 fl=x.forwardRef(({className:e,...t},n)=>c.jsx("table",{ref:n,className:Ne("w-full",e),style:{borderCollapse:"separate",borderSpacing:0},...t}));fl.displayName="DenseTable";const hl=x.forwardRef(({className:e,...t},n)=>c.jsx("thead",{ref:n,className:e,...t}));hl.displayName="DenseTableHeader";const ml=x.forwardRef(({className:e,...t},n)=>c.jsx("tbody",{ref:n,className:e,...t}));ml.displayName="DenseTableBody";const ar=x.forwardRef(({className:e,interactive:t,selected:n,style:a,...l},o)=>c.jsx("tr",{ref:o,className:Ne("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}));ar.displayName="DenseTableRow";const Ue=x.forwardRef(({className:e,style:t,...n},a)=>c.jsx("th",{ref:a,className:Ne("mono text-left uppercase text-eyebrow whitespace-nowrap",e),style:{padding:"var(--sp-2) var(--sp-3)",color:"var(--fg-4)",background:"var(--bg-sunken)",borderBottom:"var(--hairline) solid var(--border)",...t},...n}));Ue.displayName="DenseTableHead";const Le=x.forwardRef(({className:e,style:t,...n},a)=>c.jsx("td",{ref:a,className:Ne("align-middle text-body",e),style:{padding:"var(--sp-2_25) var(--sp-3)",borderBottom:"var(--hairline) solid var(--border-faint)",...t},...n}));Le.displayName="DenseTableCell";const nn=x.forwardRef(({className:e,style:t,...n},a)=>c.jsx("div",{ref:a,className:Ne("overflow-hidden",e),style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)",...t},...n}));nn.displayName="Panel";const jr=x.forwardRef(({className:e,style:t,...n},a)=>c.jsx("div",{ref:a,className:Ne("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}));jr.displayName="PanelHeader";const Cr=x.forwardRef(({className:e,style:t,...n},a)=>c.jsx("div",{ref:a,className:Ne("inline-flex items-center gap-2 text-body font-semibold",e),style:{color:"var(--fg)",...t},...n}));Cr.displayName="PanelTitle";const Kr=x.forwardRef(({className:e,style:t,...n},a)=>c.jsx("div",{ref:a,className:Ne(e),style:{padding:"var(--sp-3) var(--sp-3_5)",...t},...n}));Kr.displayName="PanelBody";function Us({children:e,right:t,className:n,style:a,...l}){return c.jsxs("div",{className:Ne("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:[c.jsx("span",{children:e}),t]})}function of({className:e,style:t,...n}){return c.jsx("span",{className:Ne("mono uppercase text-caption",e),style:{color:"var(--fg-3)",...t},...n})}function uf(){return Ce.get("/members")}function sI(e){return Ce.post("/members",e)}function oI(e,t){return Ce.patch(`/members/${encodeURIComponent(e)}`,t)}function uI(e){return Ce.delete(`/members/${encodeURIComponent(e)}`)}function ry(){const{data:e}=Ze({queryKey:["members","name-map"],queryFn:uf,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 cI(){const e=kn(),t=ry(),{data:n,isLoading:a,error:l}=Ze({queryKey:["admin-all-agents"],queryFn:()=>VO({limit:100})});return c.jsxs("div",{children:[c.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."}),c.jsxs(nn,{children:[c.jsxs(Us,{children:["All agents · ",(n==null?void 0:n.items.length)??0]}),a?c.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):l?c.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?c.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"No agents"}):c.jsxs(fl,{children:[c.jsx(hl,{children:c.jsxs(ar,{children:[c.jsx(Ue,{children:"Display name"}),c.jsx(Ue,{children:"Agent name"}),c.jsx(Ue,{children:"Type"}),c.jsx(Ue,{children:"Visibility"}),c.jsx(Ue,{children:"Owner"}),c.jsx(Ue,{children:"Status"}),c.jsx(Ue,{children:"Created"})]})}),c.jsx(ml,{children:n.items.map(o=>c.jsxs(ar,{interactive:!0,onClick:()=>e(`/agents/${encodeURIComponent(o.uuid)}`),children:[c.jsx(Le,{children:c.jsx("span",{className:"font-medium",children:o.displayName})}),c.jsx(Le,{children:o.name?c.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-3)"},children:["@",o.name]}):c.jsx("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:o.uuid.slice(0,8)})}),c.jsx(Le,{children:c.jsx(vn,{tone:o.type==="autonomous_agent"?"accent":"neutral",children:o.type})}),c.jsx(Le,{children:c.jsx(vn,{tone:o.visibility==="organization"?"accent":"outline",children:o.visibility})}),c.jsx(Le,{className:"text-label",style:{color:"var(--fg-2)"},children:o.managerId?t(o.managerId):"—"}),c.jsx(Le,{children:c.jsx(vn,{tone:o.status==="active"?"accent":"neutral",children:o.status})}),c.jsx(Le,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:xi(o.createdAt)})]},o.uuid))})]})]})]})}const cf=x.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:Ne("rounded-[var(--radius-panel)] border bg-card text-card-foreground shadow-sm",e),...t}));cf.displayName="Card";const df=x.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:Ne("flex flex-col space-y-1.5 p-6",e),...t}));df.displayName="CardHeader";const ff=x.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:Ne("text-subtitle leading-none",e),...t}));ff.displayName="CardTitle";const hf=x.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:Ne("text-body text-muted-foreground",e),...t}));hf.displayName="CardDescription";const mf=x.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:Ne("p-6 pt-0",e),...t}));mf.displayName="CardContent";const dI=x.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:Ne("flex items-center p-6 pt-0",e),...t}));dI.displayName="CardFooter";function fI(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 hI(){const{organizationId:e}=rn(),[t,n]=x.useState(null),[a,l]=x.useState(null),[o,u]=x.useState(!1),[f,m]=x.useState(!1);x.useEffect(()=>{e&&(async()=>{try{const g=await Ce.get(`/admin/organizations/${e}/invitations`);n(g)}catch(g){l(g instanceof Error?g.message:"Failed to load invite link")}})()},[e]);const h=async()=>{if(e){u(!0),l(null);try{const g=await Ce.post(`/admin/organizations/${e}/invitations/rotate`);n(g)}catch(g){l(g instanceof Error?g.message:"Failed to rotate invite link")}finally{u(!1)}}};return c.jsxs(cf,{children:[c.jsxs(df,{children:[c.jsx(ff,{children:"Invite link"}),c.jsxs(hf,{children:["Anyone with this link can join your team as a member. Links expire after ",U6," days; rotating revokes the old link instantly and resets the timer."]})]}),c.jsxs(mf,{className:"space-y-3",children:[a&&c.jsx("div",{className:"rounded-md bg-destructive/10 p-2 text-label text-destructive",children:a}),t?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex gap-2",children:[c.jsx("input",{readOnly:!0,className:"flex-1 rounded-md border bg-muted px-2 py-1 text-label font-mono",value:t.inviteUrl}),c.jsx(pe,{size:"sm",variant:"outline",onClick:()=>{navigator.clipboard.writeText(t.inviteUrl),m(!0),setTimeout(()=>m(!1),1500)},children:f?"Copied!":"Copy"}),c.jsx(pe,{size:"sm",onClick:h,disabled:o,children:o?"Rotating…":"Rotate"})]}),c.jsxs("p",{className:"text-label text-muted-foreground",children:["Created ",new Date(t.createdAt).toLocaleString(),t.expiresAt?` · ${fI(t.expiresAt)}`:" · no expiry"]})]}):c.jsx("p",{className:"text-label text-muted-foreground",children:"Loading…"})]})]})}var mI="Label",xC=x.forwardRef((e,t)=>c.jsx(Ea.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())}}));xC.displayName=mI;var pI=xC;const rt=x.forwardRef(({className:e,...t},n)=>c.jsx(pI,{ref:n,className:Ne("text-label leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...t}));rt.displayName="Label";const SC=Object.values(P6);function gI(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 yI(){const e=zn(),{memberId:t}=rn(),[n,a]=x.useState(!1),[l,o]=x.useState({username:"",displayName:"",role:"member"}),[u,f]=x.useState(null),[m,h]=x.useState(null),{data:g,isLoading:y,error:b}=Ze({queryKey:["members"],queryFn:uf}),S=St({mutationFn:()=>sI({username:l.username,displayName:l.displayName,role:l.role}),onSuccess:A=>{e.invalidateQueries({queryKey:["members"]}),f(A.password)}}),k=St({mutationFn:uI,onSuccess:()=>e.invalidateQueries({queryKey:["members"]})});function j(){a(!1),o({username:"",displayName:"",role:"member"}),f(null)}function E(A){A.preventDefault(),S.mutate()}function C(A){window.confirm("Delete this member? Their human agent will also be deactivated.")&&k.mutate(A)}return c.jsxs(c.Fragment,{children:[c.jsxs(nn,{children:[c.jsxs(Us,{right:c.jsxs(Ft,{open:n,onOpenChange:A=>A?a(!0):j(),children:[c.jsx(qO,{asChild:!0,children:c.jsxs(pe,{size:"xs",className:"normal-case tracking-normal",children:[c.jsx(ja,{className:"h-3 w-3"}),"Add member"]})}),c.jsxs(Pt,{children:[c.jsx(Xt,{children:c.jsx(qt,{children:u?"Member Created":"Create Member"})}),u?c.jsxs("div",{className:"space-y-4",children:[c.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Member created. Share the password below — it will only be shown once."}),c.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:[c.jsx("code",{className:"flex-1 text-body mono",children:u}),c.jsx(pe,{variant:"ghost",size:"icon",onClick:()=>navigator.clipboard.writeText(u),title:"Copy password",children:c.jsx(Mg,{className:"h-4 w-4"})})]}),c.jsx(tn,{children:c.jsx(pe,{onClick:j,children:"Done"})})]}):c.jsxs("form",{onSubmit:E,className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(rt,{htmlFor:"member-username",children:"Username"}),c.jsx(ht,{id:"member-username",type:"text",value:l.username,onChange:A=>o({...l,username:A.target.value}),required:!0})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(rt,{htmlFor:"member-name",children:"Display Name"}),c.jsx(ht,{id:"member-name",value:l.displayName,onChange:A=>o({...l,displayName:A.target.value}),required:!0})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(rt,{htmlFor:"member-role",children:"Role"}),c.jsx("select",{id:"member-role",value:l.role,onChange:A=>o({...l,role:A.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:SC.map(A=>c.jsx("option",{value:A,children:A},A))})]}),S.error instanceof Error&&c.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:S.error.message}),c.jsx(tn,{children:c.jsx(pe,{type:"submit",disabled:S.isPending,children:S.isPending?"Creating...":"Create"})})]})]})]}),children:["Members · ",(g==null?void 0:g.length)??0]}),y?c.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):b?c.jsxs("div",{className:"text-center py-8 text-body",style:{color:"var(--state-error)"},children:["Failed to load members: ",b instanceof Error?b.message:"Unknown error"]}):(g==null?void 0:g.length)===0?c.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"No members"}):c.jsxs(fl,{children:[c.jsx(hl,{children:c.jsxs(ar,{children:[c.jsx(Ue,{style:{width:30}}),c.jsx(Ue,{children:"Username"}),c.jsx(Ue,{children:"Name"}),c.jsx(Ue,{children:"Role"}),c.jsx(Ue,{children:"Created"}),c.jsx(Ue,{style:{width:1}})]})}),c.jsx(ml,{children:g==null?void 0:g.map(A=>{const O=t===A.id;return c.jsxs(ar,{children:[c.jsx(Le,{children:c.jsx("span",{className:"mono inline-flex items-center justify-center text-caption font-semibold",style:{width:22,height:22,borderRadius:"var(--radius-input)",background:O?"var(--accent-bg)":"var(--bg-active)",border:"var(--hairline) solid var(--border-strong)",color:O?"var(--accent-dim)":"var(--fg-2)"},children:gI(A.displayName,A.username)})}),c.jsxs(Le,{children:[c.jsx("span",{className:"mono font-medium",children:A.username}),O&&c.jsx(of,{style:{marginLeft:6},children:"you"})]}),c.jsx(Le,{style:{color:"var(--fg-2)"},children:A.displayName}),c.jsx(Le,{children:c.jsx(vn,{tone:A.role==="admin"?"accent":"neutral",children:A.role})}),c.jsx(Le,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:xi(A.createdAt)}),c.jsx(Le,{style:{whiteSpace:"nowrap"},children:c.jsxs("div",{className:"flex gap-0.5 justify-end",children:[c.jsx(pe,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>h({id:A.id,username:A.username,displayName:A.displayName,role:A.role}),title:"Edit",children:c.jsx(_u,{className:"h-3.5 w-3.5"})}),c.jsx(pe,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>C(A.id),disabled:k.isPending,title:"Delete",style:{color:"var(--fg-4)"},children:c.jsx(Ds,{className:"h-3.5 w-3.5"})})]})})]},A.id)})})]})]}),c.jsx(vI,{target:m,onClose:()=>h(null),onSaved:()=>{h(null),e.invalidateQueries({queryKey:["members"]})}})]})}function vI({target:e,onClose:t,onSaved:n}){const[a,l]=x.useState(""),[o,u]=x.useState("member"),[f,m]=x.useState(null);x.useEffect(()=>{e&&(l(e.displayName),u(e.role),m(null))},[e]);const h=St({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:oI(e.id,b)},onSuccess:()=>{m(null),n()},onError:b=>{m(b instanceof Error?b.message:String(b))}});function g(b){b.preventDefault(),h.mutate()}const y=e!==null;return c.jsx(Ft,{open:y,onOpenChange:b=>b?void 0:t(),children:c.jsxs(Pt,{children:[c.jsx(Xt,{children:c.jsx(qt,{children:"Edit Member"})}),e&&c.jsxs("form",{onSubmit:g,className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(rt,{children:"Username"}),c.jsx(ht,{value:e.username,disabled:!0,className:"font-mono"}),c.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:"Username is permanent after creation."})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(rt,{htmlFor:"edit-member-display",children:"Display Name"}),c.jsx(ht,{id:"edit-member-display",value:a,onChange:b=>l(b.target.value),required:!0,maxLength:200})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(rt,{htmlFor:"edit-member-role",children:"Role"}),c.jsx("select",{id:"edit-member-role",value:o,onChange:b=>u(b.target.value),className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:SC.map(b=>c.jsx("option",{value:b,children:b},b))}),c.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&&c.jsx("p",{className:"text-body",style:{color:"var(--state-error)"},children:f}),c.jsxs(tn,{children:[c.jsx(pe,{type:"button",variant:"ghost",onClick:t,disabled:h.isPending,children:"Cancel"}),c.jsx(pe,{type:"submit",disabled:h.isPending,children:h.isPending?"Saving…":"Save"})]})]})]})})}function bI(){return Ce.get("/admin/system/config")}function xI(e){return Ce.patch("/admin/system/config",e)}function SI(e){return Ce.get(`/admin/organizations/${encodeURIComponent(e)}`)}function wI(e,t){return Ce.patch(`/admin/organizations/${encodeURIComponent(e)}`,t)}function kI(){return Ce.post("/me/organizations/leave")}const jI="rename-hint:";function CI(){var C,A,O;const{organizationId:e}=rn(),t=zn(),n=Ze({queryKey:["organization",e],queryFn:()=>e?SI(e):Promise.reject(new Error("no org")),enabled:!!e}),a=Ze({queryKey:["members"],queryFn:uf}),[l,o]=x.useState(""),[u,f]=x.useState(""),[m,h]=x.useState(!1);x.useEffect(()=>{n.data&&(o(n.data.displayName),f(n.data.name))},[n.data]);const g=St({mutationFn:()=>{if(!e||!n.data)throw new Error("organization not loaded");const M={},D=l.trim(),z=u.trim();return D&&D!==n.data.displayName&&(M.displayName=D),z&&z!==n.data.name&&(M.name=z),Object.keys(M).length===0?Promise.resolve(n.data):wI(e,M)},onSuccess:M=>{t.setQueryData(["organization",e],M),t.invalidateQueries({queryKey:["me-organizations"]}),h(!0),setTimeout(()=>h(!1),2e3)}}),y=M=>{M.preventDefault(),g.mutate()},b=`${jI}${e??"unknown"}:dismissed`,[S,k]=x.useState(()=>typeof window>"u"?!1:window.localStorage.getItem(b)==="1"),j=()=>{window.localStorage.setItem(b,"1"),k(!0)},E=!S&&!!((C=n.data)!=null&&C.name)&&n.data.name.endsWith("-personal")&&(((A=a.data)==null?void 0:A.length)??0)>=2;return c.jsxs(nn,{children:[c.jsxs(jr,{children:[c.jsx(Cr,{children:"Team identity"}),c.jsxs("div",{className:"flex items-center gap-1.5",children:[m&&c.jsx("span",{className:"mono text-caption",style:{color:"var(--accent-dim)"},children:"saved"}),c.jsxs(pe,{type:"submit",form:"team-identity-form",size:"xs",disabled:g.isPending||!n.data,children:[c.jsx(bi,{className:"h-3 w-3"}),g.isPending?"Saving…":"Save"]})]})]}),c.jsxs(Kr,{children:[E&&c.jsxs("div",{className:"flex items-start justify-between gap-3",style:{padding:"var(--sp-2_5) var(--sp-3)",marginBottom:"var(--sp-3)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)",borderRadius:"var(--radius-input)"},children:[c.jsxs("div",{className:"text-label",style:{color:"var(--fg-2)"},children:["Heads up — this team is still using its auto-generated name (",c.jsx("span",{className:"mono",children:(O=n.data)==null?void 0:O.name}),"). Now that you have teammates, you might want to give it a friendlier name in the form below."]}),c.jsx("button",{type:"button","aria-label":"Dismiss rename hint",onClick:j,className:"shrink-0",style:{color:"var(--fg-3)",padding:2,background:"transparent",border:"none",cursor:"pointer"},children:c.jsx(fu,{className:"h-3.5 w-3.5"})})]}),n.isLoading?c.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):n.error?c.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:n.error instanceof Error?n.error.message:"Failed to load team"}):c.jsxs("form",{id:"team-identity-form",onSubmit:y,children:[c.jsx(Z1,{label:"Team name",hint:"Shown in the team switcher and dashboard header.",value:l,onChange:o}),c.jsx(Z1,{label:"URL slug",hint:"Lowercase letters, digits, hyphens. Used in invite URLs.",value:u,onChange:M=>f(M.toLowerCase()),mono:!0,pattern:"[a-z0-9][a-z0-9-]*"}),g.error instanceof Error&&c.jsx("div",{className:"text-body",style:{color:"var(--state-error)",marginTop:"var(--sp-2)"},children:g.error.message})]})]})]})}function Z1({label:e,hint:t,value:n,onChange:a,mono:l,pattern:o}){return c.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:[c.jsxs("div",{children:[c.jsx("div",{className:"text-body font-medium",style:{color:"var(--fg)"},children:e}),c.jsx("div",{className:"text-label",style:{color:"var(--fg-3)",marginTop:2},children:t})]}),c.jsx("input",{value:n,onChange:u=>a(u.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 wC=[{key:gi.INBOX_TIMEOUT_SECONDS,label:"Inbox timeout",description:"How long an agent waits for inbound messages before sleeping.",unit:"seconds"},{key:gi.MAX_RETRY_COUNT,label:"Max retry count",description:"Delivery attempts before a message is marked failed.",unit:null},{key:gi.POLLING_INTERVAL_SECONDS,label:"Polling interval",description:"Runtime heartbeat cadence for offline detection.",unit:"seconds"},{key:gi.PRESENCE_CLEANUP_SECONDS,label:"Presence cleanup",description:"When presence rows expire after disconnect.",unit:"seconds"}],V1=wC.map(e=>e.key);function EI(){const e=zn(),{data:t,isLoading:n}=Ze({queryKey:["system-config"],queryFn:bI}),[a,l]=x.useState({}),[o,u]=x.useState(!1);x.useEffect(()=>{if(!t)return;const g={};for(const y of V1){const b=t[y]??kd[y]??"";g[y]=String(b)}l(g)},[t]);const f=St({mutationFn:()=>{const g={};for(const[y,b]of Object.entries(a)){const S=b.trim();if(S==="")g[y]=kd[y]??0;else{const k=Number(S);g[y]=Number.isNaN(k)?S:k}}return xI(g)},onSuccess:()=>{e.invalidateQueries({queryKey:["system-config"]}),u(!0),setTimeout(()=>u(!1),2e3)}});function m(){const g={};for(const y of V1)g[y]=String(kd[y]??"");l(g)}function h(g){g.preventDefault(),f.mutate()}return c.jsxs("div",{className:"space-y-4",children:[c.jsx(CI,{}),c.jsx("form",{onSubmit:h,children:c.jsxs(nn,{children:[c.jsxs(jr,{children:[c.jsx(Cr,{children:"System configuration"}),c.jsxs("div",{className:"flex items-center gap-1.5",children:[o&&c.jsx("span",{className:"mono text-caption",style:{color:"var(--accent-dim)"},children:"saved"}),c.jsx(pe,{type:"button",variant:"ghost",size:"xs",onClick:m,disabled:f.isPending,children:"Reset defaults"}),c.jsxs(pe,{type:"submit",size:"xs",disabled:f.isPending,children:[c.jsx(bi,{className:"h-3 w-3"}),f.isPending?"Saving…":"Save changes"]})]})]}),c.jsxs("div",{style:{padding:"var(--sp-1) var(--sp-4) var(--sp-3_5)"},children:[n?c.jsx("div",{className:"py-6 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):wC.map(g=>c.jsx(NI,{field:g,value:a[g.key]??"",onChange:y=>l({...a,[g.key]:y})},g.key)),f.error instanceof Error&&c.jsx("div",{className:"text-body pt-2",style:{color:"var(--state-error)"},children:f.error.message})]})]})})]})}function NI({field:e,value:t,onChange:n}){const a=String(kd[e.key]??"—");return c.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:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-body font-medium",style:{color:"var(--fg)"},children:e.label}),c.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:e.key})]}),c.jsx("div",{className:"text-label",style:{color:"var(--fg-3)",marginTop:2},children:e.description}),c.jsxs(of,{style:{marginTop:4,display:"block"},children:["default"," ",c.jsx("span",{className:"mono normal-case tracking-normal",style:{color:"var(--fg-3)"},children:a})]})]}),c.jsxs("div",{style:{position:"relative"},children:[c.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&&c.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 Q1=[{key:"members",label:"Members"},{key:"invite",label:"Invite link"},{key:"all-agents",label:"All agents"},{key:"settings",label:"Org settings"}];function _I(){const{role:e}=rn(),t=sr(),n=kn();if(e===null)return c.jsx("div",{className:"text-body",style:{padding:20,color:"var(--fg-3)"},children:"Loading…"});if(e!=="admin")return c.jsx(Hd,{to:"/settings",replace:!0});const a=t.hash.replace("#",""),l=Q1.some(u=>u.key===a)?a:"members",o=u=>{n({hash:u},{replace:!0})};return c.jsxs("div",{className:"-m-6",children:[c.jsx(sf,{title:"Admin",subtitle:"Organization-wide controls"}),c.jsx(vC,{children:Q1.map(u=>c.jsx(bC,{active:l===u.key,onClick:()=>o(u.key),children:u.label},u.key))}),c.jsxs("div",{style:{padding:"var(--sp-4) var(--sp-5) var(--sp-7)"},children:[l==="members"&&c.jsx(yI,{}),l==="invite"&&c.jsx(hI,{}),l==="all-agents"&&c.jsx(cI,{}),l==="settings"&&c.jsx(EI,{})]})]})}function AI(e){return Ce.get(`/admin/agents/${e}/config`)}function TI(e,t){return Ce.patch(`/admin/agents/${e}/config`,t)}function zI(e,t){return Ce.post(`/admin/agents/${e}/config/dry-run`,{payload:t})}function RI(e){return Ce.get(`/admin/agents/${e}/client-status`)}function OI({className:e,style:t,...n}){return c.jsx("div",{className:Ne("flex items-center text-body",e),style:{gap:6,color:"var(--fg-3)",...t},...n})}function DI({onClick:e,children:t}){return c.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 MI(){return c.jsx("span",{style:{color:"var(--fg-4)"},children:"/"})}function LI({children:e,mono:t}){return c.jsx("span",{className:Ne("font-medium",t&&"mono"),style:{color:"var(--fg)"},children:e})}function Gr({state:e,size:t=8,className:n}){const a={width:t,height:t,display:"inline-block",position:"relative",flexShrink:0};return e==="working"?c.jsxs("span",{className:Ne("shrink-0",n),style:a,role:"img","aria-label":"working",children:[c.jsx("span",{style:{position:"absolute",inset:0,borderRadius:"50%",background:"var(--state-working)"}}),c.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"?c.jsx("span",{className:Ne("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:c.jsx("span",{style:{position:"absolute",inset:2,borderRadius:"50%",background:"var(--state-blocked)"}})}):e==="error"?c.jsx("span",{className:Ne("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"?c.jsx("span",{className:Ne("shrink-0",n),style:{...a,borderRadius:"50%",background:"var(--state-idle)"},role:"img","aria-label":"idle"}):c.jsx("span",{className:Ne("shrink-0",n),style:{...a,borderRadius:"50%",border:"var(--hairline) solid var(--state-offline)",background:"transparent"},role:"img","aria-label":"offline"})}function II(e){return e==="idle"||e==="working"||e==="blocked"||e==="error"||e==="offline"}function Ps({state:e,className:t}){const n=e!==null&&II(e)?e:"offline",a=n==="offline"?"var(--fg-3)":`var(--state-${n})`;return c.jsxs("span",{className:Ne("mono inline-flex items-center gap-1.5 uppercase text-caption",t),style:{color:a},children:[c.jsx(Gr,{state:n,size:7}),n]})}function ud({label:e,value:t,accent:n}){return c.jsxs("div",{style:{padding:"var(--sp-2) var(--sp-2_5)",background:"var(--bg-sunken)",borderRadius:"var(--radius-input)",cursor:"default"},children:[c.jsx("div",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-4)"},children:e}),c.jsx("div",{className:"mono text-subtitle font-semibold",style:{color:n??"var(--fg)",marginTop:"var(--sp-px)"},children:t})]})}function UI({runtimeLabel:e,computerLabel:t,visible:n=!0}){return n?c.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:c.jsxs("div",{className:"mono text-caption flex items-center gap-2",style:{color:"var(--fg-3)"},children:[c.jsxs("span",{children:["Runs on ",c.jsx("span",{style:{color:"var(--fg-2)"},children:e})]}),t&&c.jsxs(c.Fragment,{children:[c.jsx("span",{style:{color:"var(--fg-4)"},"aria-hidden":!0,children:"@"}),c.jsx("span",{style:{color:"var(--fg-2)"},children:t})]})]})}):null}function PI(e){const{agent:t}=e,[n,a]=x.useState(!1),[l,o]=x.useState(!1),u=t.displayName||t.name||t.uuid;return c.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:[c.jsxs("header",{className:"flex items-center gap-2",style:{padding:"var(--sp-2_5) var(--sp-3_5)"},children:[c.jsx(kz,{className:"h-3.5 w-3.5",style:{color:"var(--state-error)"}}),c.jsx("h3",{className:"text-body font-semibold",style:{color:"var(--state-error)"},children:"Danger zone"})]}),c.jsxs("div",{children:[t.status==="active"?c.jsx(ip,{title:"Suspend agent",body:"Pause all active sessions. You can reactivate later; tokens stay revoked until then.",action:c.jsx(pe,{variant:"outline",size:"xs",onClick:()=>o(!0),disabled:e.suspendPending,children:e.suspendPending?"Suspending…":"Suspend"})}):c.jsx(ip,{title:"Reactivate agent",body:"Resume sessions. Tokens must be recreated — they are not restored.",action:c.jsx(pe,{variant:"outline",size:"xs",onClick:e.onReactivate,disabled:e.reactivatePending,children:e.reactivatePending?"Reactivating…":"Reactivate"})}),c.jsx(ip,{title:"Delete agent",body:"Permanent. Configuration, bindings, tokens, and session history are all dropped.",action:c.jsxs(pe,{variant:"destructive",size:"xs",onClick:()=>a(!0),disabled:e.deletePending,children:[c.jsx(Ds,{className:"h-3 w-3"}),"Delete"]})})]}),c.jsx(BI,{open:l,onOpenChange:o,label:u,onConfirm:()=>{o(!1),e.onSuspend()},pending:e.suspendPending}),c.jsx($I,{open:n,onOpenChange:a,expected:u,onDelete:()=>{a(!1),e.onDelete()},deleting:e.deletePending})]})}function ip(e){return c.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:[c.jsxs("div",{children:[c.jsx("p",{className:"font-medium",style:{color:"var(--fg)"},children:e.title}),c.jsx("p",{className:"text-label font-normal",style:{color:"var(--fg-3)"},children:e.body})]}),c.jsx("div",{children:e.action})]})}function BI({open:e,onOpenChange:t,label:n,onConfirm:a,pending:l}){return c.jsx(Ft,{open:e,onOpenChange:t,children:c.jsxs(Pt,{children:[c.jsx(Xt,{children:c.jsxs(qt,{children:['Suspend "',n,'"?']})}),c.jsx("div",{className:"space-y-3",children:c.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."})}),c.jsxs(tn,{children:[c.jsx(pe,{type:"button",variant:"ghost",onClick:()=>t(!1),disabled:l,children:"Cancel"}),c.jsx(pe,{type:"button",variant:"destructive",onClick:a,disabled:l,children:l?"Suspending…":"Suspend"})]})]})})}function $I({open:e,onOpenChange:t,expected:n,onDelete:a,deleting:l}){const[o,u]=x.useState("");function f(m){m.preventDefault(),o===n&&a()}return c.jsx(Ft,{open:e,onOpenChange:m=>{t(m),m||u("")},children:c.jsxs(Pt,{children:[c.jsx(Xt,{children:c.jsxs(qt,{children:['Delete "',n,'"?']})}),c.jsxs("form",{onSubmit:f,className:"space-y-4",children:[c.jsxs("p",{className:"text-body text-muted-foreground",children:["This action cannot be undone. Type ",c.jsx("span",{className:"font-mono font-medium text-foreground",children:n})," ","to confirm."]}),c.jsx(ht,{value:o,onChange:m=>u(m.target.value),autoFocus:!0,placeholder:n,className:"font-mono"}),c.jsxs(tn,{children:[c.jsx(pe,{type:"button",variant:"ghost",onClick:()=>t(!1),disabled:l,children:"Cancel"}),c.jsx(pe,{type:"submit",variant:"destructive",disabled:o!==n||l,children:l?"Deleting…":"Delete"})]})]})]})})}const FI={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 ay({status:e,onEdit:t,onDelete:n,onUndo:a,children:l,disabled:o}){const u=FI[e],f=e==="deleted";return c.jsxs("div",{className:Ne("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:[c.jsx("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:l}),u.label&&c.jsx("span",{className:Ne("text-caption rounded px-1.5 py-0.5 whitespace-nowrap",u.tone),children:u.label}),!o&&(f?c.jsxs(pe,{size:"sm",variant:"ghost",onClick:a,children:[c.jsx(Cz,{className:"h-3.5 w-3.5 mr-1"}),"Undo"]}):c.jsxs("div",{className:"flex gap-1 shrink-0",children:[c.jsxs(pe,{size:"icon",variant:"ghost",className:"h-7 w-7",onClick:t,title:"Edit",children:[c.jsx(_u,{className:"h-3.5 w-3.5"}),c.jsx("span",{className:"sr-only",children:"Edit"})]}),c.jsxs(pe,{size:"icon",variant:"ghost",className:"h-7 w-7",onClick:n,title:"Delete",children:[c.jsx(Ds,{className:"h-3.5 w-3.5"}),c.jsx("span",{className:"sr-only",children:"Delete"})]})]}))]})}function qI(e){const[t,n]=x.useState(null),[a,l]=x.useState(()=>new Set),o=f=>l(m=>{const h=new Set(m);return h.has(f)?h.delete(f):h.add(f),h}),u=e.items.filter(f=>f.status!=="deleted").length;return c.jsxs(nn,{children:[c.jsxs(jr,{children:[c.jsxs(Cr,{children:["Environment variables (",u,")"]}),!e.disabled&&c.jsxs(pe,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[c.jsx(ja,{className:"h-3 w-3"})," Add"]})]}),c.jsx(Kr,{className:"space-y-2",children:e.items.length===0?c.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===Dd,g=m&&!h&&!!f.value.value,y=a.has(f.key);let b;return m?g&&y?b=f.value.value:b="••••••":b=f.value.value||c.jsx("em",{children:"(empty)"}),c.jsxs(ay,{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:[c.jsx("span",{className:"font-mono font-medium",children:f.value.key}),c.jsx("span",{className:"font-mono text-caption text-muted-foreground truncate max-w-xs",children:b}),m&&c.jsx(Kw,{className:"h-3 w-3 text-muted-foreground","aria-hidden":!0}),m&&c.jsx("button",{type:"button",onClick:()=>g&&o(f.key),className:"bg-transparent border-0 cursor-pointer inline-flex items-center text-muted-foreground",title:g?y?"Hide value":"Reveal value":"Saved sensitive values can't be revealed. Edit to set a new value.","aria-label":y?"Hide value":"Reveal value",disabled:!g,style:{padding:0,opacity:g?1:.4},children:y?c.jsx(FT,{className:"h-3.5 w-3.5"}):c.jsx(HT,{className:"h-3.5 w-3.5"})})]},f.key)})}),t&&c.jsx(HI,{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 HI({open:e,onOpenChange:t,initial:n,forbiddenKeys:a,onSubmit:l}){const[o,u]=x.useState((n==null?void 0:n.key)??""),[f,m]=x.useState(n!=null&&n.sensitive?"":(n==null?void 0:n.value)??""),[h,g]=x.useState((n==null?void 0:n.sensitive)??!1),[y,b]=x.useState(null);x.useEffect(()=>{e&&(u((n==null?void 0:n.key)??""),m(n!=null&&n.sensitive?"":(n==null?void 0:n.value)??""),g((n==null?void 0:n.sensitive)??!1),b(null))},[e,n]);function S(k){if(k.preventDefault(),!o.match(/^[A-Z][A-Z0-9_]*$/)){b("Key must match /^[A-Z][A-Z0-9_]*$/.");return}if(a.has(o)){b(`Another entry already uses key "${o}".`);return}let j=f;if(h&&(n!=null&&n.sensitive)&&!f&&(j=Dd),!h&&!n&&!f){b("Value is required for non-sensitive entries.");return}l({key:o,value:j,sensitive:h})}return c.jsx(Ft,{open:e,onOpenChange:t,children:c.jsxs(Pt,{children:[c.jsx(Xt,{children:c.jsx(qt,{children:n?"Edit environment variable":"Add environment variable"})}),c.jsxs("form",{onSubmit:S,className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(rt,{htmlFor:"env-key",children:"Key"}),c.jsx(ht,{id:"env-key",value:o,onChange:k=>u(k.target.value.toUpperCase()),placeholder:"OPENAI_API_KEY",className:"font-mono",disabled:!!n}),n&&c.jsx("p",{className:"text-caption text-muted-foreground",children:"Key can't be renamed — delete and re-add."})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(rt,{htmlFor:"env-value",children:"Value"}),c.jsx(ht,{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"})]}),c.jsxs("label",{className:"flex items-center gap-2 text-body",children:[c.jsx("input",{type:"checkbox",checked:h,onChange:k=>g(k.target.checked),className:"h-4 w-4",disabled:!!n&&n.sensitive}),"Mark as sensitive (encrypted at rest, never displayed again)"]}),c.jsx("p",{className:"text-caption text-muted-foreground",children:"Sensitive values cannot be viewed after saving. If you need to verify, save a new value."}),y&&c.jsx("p",{className:"text-body text-destructive",children:y}),c.jsxs(tn,{children:[c.jsx(pe,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),c.jsx(pe,{type:"submit",children:n?"Done":"Add"})]})]})]})})}function ZI(e){const[t,n]=x.useState(null),a=e.items.filter(l=>l.status!=="deleted").length;return c.jsxs(nn,{children:[c.jsxs(jr,{children:[c.jsxs(Cr,{children:["Git repositories (",a,")"]}),!e.disabled&&c.jsxs(pe,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[c.jsx(ja,{className:"h-3 w-3"})," Add"]})]}),c.jsx(Kr,{className:"space-y-2",children:e.items.length===0?c.jsx("p",{className:"text-body text-muted-foreground",children:"No Git repositories."}):e.items.map(l=>{const o=l.value.localPath??Md(l.value.url);return c.jsxs(ay,{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:[c.jsx("span",{className:"font-mono text-caption",children:l.value.url}),l.value.ref&&c.jsxs("span",{className:"text-caption text-muted-foreground",children:["@ ",l.value.ref]}),c.jsxs("span",{className:"text-caption text-muted-foreground",children:["→ ",o||"./"]})]},l.key)})}),t&&c.jsx(VI,{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 VI({open:e,onOpenChange:t,initial:n,forbiddenPaths:a,onSubmit:l}){const[o,u]=x.useState((n==null?void 0:n.url)??""),[f,m]=x.useState((n==null?void 0:n.ref)??""),[h,g]=x.useState((n==null?void 0:n.localPath)??""),[y,b]=x.useState(null);x.useEffect(()=>{e&&(u((n==null?void 0:n.url)??""),m((n==null?void 0:n.ref)??""),g((n==null?void 0:n.localPath)??""),b(null))},[e,n]);function S(k){k.preventDefault();const j=o.trim();if(!j){b("URL is required.");return}const E=h.trim()||Md(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 c.jsx(Ft,{open:e,onOpenChange:t,children:c.jsxs(Pt,{children:[c.jsx(Xt,{children:c.jsx(qt,{children:n?"Edit Git repository":"Add Git repository"})}),c.jsxs("form",{onSubmit:S,className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(rt,{htmlFor:"git-url",children:"URL"}),c.jsx(ht,{id:"git-url",value:o,onChange:k=>u(k.target.value),placeholder:"git@github.com:org/repo.git",className:"font-mono"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(rt,{htmlFor:"git-ref",children:"Ref (branch / tag / sha, optional)"}),c.jsx(ht,{id:"git-ref",value:f,onChange:k=>m(k.target.value),placeholder:"main",className:"font-mono"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(rt,{htmlFor:"git-path",children:"Local path (optional)"}),c.jsx(ht,{id:"git-path",value:h,onChange:k=>g(k.target.value),placeholder:Md(o)||"repo-name",className:"font-mono"}),c.jsx("p",{className:"text-caption text-muted-foreground",children:"Relative to the session working directory. Leave empty to derive from the URL."})]}),y&&c.jsx("p",{className:"text-body text-destructive",children:y}),c.jsxs(tn,{children:[c.jsx(pe,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),c.jsx(pe,{type:"submit",children:n?"Done":"Add"})]})]})]})})}function kC({name:e,displayName:t,variant:n="inline",tone:a="neutral",emptyLabel:l="—",className:o,style:u,title:f}){const m=typeof e=="string"&&e.length>0,h=typeof t=="string"&&t.length>0;if(!m&&!h)return c.jsx("span",{className:Ne("mono text-label",o),style:{color:"var(--fg-4)",...u},title:f,children:l});const g=f??(m&&h?`${t} (@${e})`:h?t:`@${e}`),y=a==="accent"?"var(--accent-dim)":void 0,b=a==="accent"?"var(--accent-dim)":"var(--fg-3)";return n==="stacked"?c.jsxs("span",{className:Ne("inline-flex flex-col leading-tight",o),style:{gap:1,...u},title:g??void 0,children:[h&&c.jsx("span",{className:"text-body",style:{color:y},children:t}),m&&c.jsxs("span",{className:"mono text-caption",style:{color:b},children:["@",e]})]}):c.jsxs("span",{className:Ne("inline-flex items-baseline gap-1.5",o),style:u,title:g??void 0,children:[h&&c.jsx("span",{style:{color:y},children:t}),m&&c.jsxs("span",{className:"mono text-caption",style:{color:b},children:["@",e]})]})}function QI({agent:e,onSave:t}){const[n,a]=x.useState(!1),l=qg(),o=ry(),u=e.metadata,f=u==null?void 0:u.tree,m=typeof(f==null?void 0:f.role)=="string"?f.role:null,h=Array.isArray(f==null?void 0:f.domains)?(f==null?void 0:f.domains).filter(b=>typeof b=="string"):[],g=e.managerId?o(e.managerId):null,y=e.delegateMention?l(e.delegateMention):null;return c.jsxs(nn,{children:[c.jsxs(jr,{children:[c.jsx(Cr,{children:"Profile"}),e.status==="active"&&c.jsxs(pe,{size:"xs",variant:"outline",onClick:()=>a(!0),children:[c.jsx(_u,{className:"h-3 w-3"})," Edit"]})]}),c.jsxs(Kr,{className:"text-body space-y-1",children:[c.jsxs("div",{children:[c.jsx("span",{className:"font-semibold",children:e.displayName}),e.name&&c.jsxs("span",{className:"ml-2 font-mono text-caption text-muted-foreground",children:["@",e.name]}),y&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"mx-2 text-muted-foreground",children:"·"}),c.jsxs("span",{className:"text-muted-foreground",children:["delegate ",c.jsx(kC,{name:y.name,displayName:y.displayName})]})]})]}),c.jsxs("div",{className:"text-caption text-muted-foreground flex flex-wrap items-center gap-x-3 gap-y-1",children:[c.jsxs("span",{children:["owner ",c.jsx("span",{className:"text-foreground",children:g??"—"})]}),m&&c.jsxs("span",{children:["role ",c.jsx("span",{className:"text-foreground",children:m})]}),c.jsxs("span",{children:["type ",c.jsx(vn,{tone:e.type==="autonomous_agent"?"accent":"neutral",children:e.type})]}),c.jsxs("span",{children:["visibility"," ",c.jsx(vn,{tone:e.visibility==="organization"?"accent":"outline",children:e.visibility})]}),h.length>0&&c.jsxs("span",{children:["domains"," ",c.jsx("span",{className:"inline-flex flex-wrap gap-1 align-middle",children:h.map(b=>c.jsx(vn,{tone:"outline",children:b},b))})]})]})]}),c.jsx(GI,{agent:e,open:n,onOpenChange:a,onSave:t})]})}function GI({agent:e,open:t,onOpenChange:n,onSave:a}){var M;const{memberId:l,role:o}=rn(),[u,f]=x.useState(e.displayName),[m,h]=x.useState(e.delegateMention??""),[g,y]=x.useState(e.visibility),[b,S]=x.useState(!1),[k,j]=x.useState(null);x.useEffect(()=>{t&&(f(e.displayName),h(e.delegateMention??""),y(e.visibility),j(null))},[t,e]);const E=e.type==="human",C=o==="admin"||e.managerId===l,A=Ze({queryKey:["agents-for-delegate"],queryFn:async()=>(await zu({limit:100})).items.filter(z=>z.type==="personal_assistant"&&z.status==="active"),enabled:t&&E});async function O(D){D.preventDefault(),j(null);const z=u.trim();if(!z){j("Display name is required.");return}S(!0);try{const L={displayName:z,delegateMention:m||null};g!==e.visibility&&(L.visibility=g),await a(L),n(!1)}catch(L){j(L instanceof Error?L.message:String(L))}finally{S(!1)}}return c.jsx(Ft,{open:t,onOpenChange:n,children:c.jsxs(Pt,{children:[c.jsx(Xt,{children:c.jsx(qt,{children:"Edit Identity"})}),c.jsxs("form",{onSubmit:O,className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(rt,{children:"Agent name"}),c.jsx(ht,{value:e.name?`@${e.name}`:"",disabled:!0,className:"font-mono"}),c.jsx("p",{className:"text-caption text-muted-foreground",children:"Agent name is permanent after creation — used in @mentions and CLI commands."})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(rt,{htmlFor:"id-display",children:"Display Name"}),c.jsx(ht,{id:"id-display",value:u,onChange:D=>f(D.target.value),placeholder:"How teammates see this agent",maxLength:200})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(rt,{htmlFor:"id-visibility",children:"Visibility"}),c.jsxs("select",{id:"id-visibility",value:g,onChange:D=>y(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:[c.jsx("option",{value:q1.PRIVATE,children:"Private — only the manager"}),c.jsx("option",{value:q1.ORGANIZATION,children:"Organization — all members"})]}),c.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&&c.jsxs("div",{className:"space-y-2",children:[c.jsx(rt,{htmlFor:"id-delegate",children:"Delegate Mention"}),c.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:[c.jsx("option",{value:"",children:"None"}),(M=A.data)==null?void 0:M.map(D=>c.jsx("option",{value:D.uuid,children:D.displayName?`${D.displayName} (@${D.name??D.uuid})`:D.name?`@${D.name}`:D.uuid},D.uuid))]}),c.jsx("p",{className:"text-caption text-muted-foreground",children:"Assistant that acts on behalf of this agent."})]}),k&&c.jsx("p",{className:"text-body text-destructive",children:k}),c.jsxs(tn,{children:[c.jsx(pe,{type:"button",variant:"ghost",onClick:()=>n(!1),disabled:b,children:"Cancel"}),c.jsx(pe,{type:"submit",disabled:b,children:b?"Saving…":"Save"})]})]})]})})}function KI(e){return e==="working"?"accent":e==="error"?"error":"outline"}function YI(e){const[t,n]=x.useState(null),a=e.items.filter(l=>l.status!=="deleted").length;return c.jsxs(nn,{children:[c.jsxs(jr,{children:[c.jsxs(Cr,{children:["MCP servers (",a,")"]}),!e.disabled&&c.jsxs(pe,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[c.jsx(ja,{className:"h-3 w-3"})," Add"]})]}),c.jsx(Kr,{className:"space-y-2",children:e.items.length===0?c.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 c.jsxs(ay,{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:[c.jsx("span",{className:"text-caption rounded bg-muted px-1.5 py-0.5 font-mono",children:l.value.transport}),c.jsx("span",{className:"font-medium font-mono",children:l.value.name}),c.jsx(vn,{tone:KI(o),children:o}),c.jsx("span",{className:"text-caption text-muted-foreground truncate",children:XI(l.value)})]},l.key)})}),t&&c.jsx(JI,{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 XI(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 JI({open:e,onOpenChange:t,initial:n,forbiddenNames:a,onSubmit:l}){const[o,u]=x.useState((n==null?void 0:n.transport)??"stdio"),[f,m]=x.useState((n==null?void 0:n.name)??""),[h,g]=x.useState((n==null?void 0:n.transport)==="stdio"?n.command:""),[y,b]=x.useState((n==null?void 0:n.transport)==="stdio"&&n.args?n.args.join(" "):""),[S,k]=x.useState(n&&(n.transport==="http"||n.transport==="sse")?n.url:""),[j,E]=x.useState(null);x.useEffect(()=>{e&&(u((n==null?void 0:n.transport)??"stdio"),m((n==null?void 0:n.name)??""),g((n==null?void 0:n.transport)==="stdio"?n.command:""),b((n==null?void 0:n.transport)==="stdio"&&n.args?n.args.join(" "):""),k(n&&(n.transport==="http"||n.transport==="sse")?n.url:""),E(null))},[e,n]);function C(A){if(A.preventDefault(),!f.match(/^[a-z0-9][a-z0-9_-]{0,63}$/i)){E("Name must start alphanumeric and contain only a-z0-9_-.");return}if(a.has(f.toLowerCase())){E(`Another MCP server is already named "${f}".`);return}let O;if(o==="stdio"){if(!h.trim()){E("stdio transport requires a command.");return}const M=y.trim().split(/\s+/).filter(D=>D.length>0);O={name:f,transport:"stdio",command:h.trim(),...M.length?{args:M}:{}}}else{const M=S.trim();try{new URL(M)}catch{E("URL is not valid.");return}O={name:f,transport:o,url:M}}l(O)}return c.jsx(Ft,{open:e,onOpenChange:t,children:c.jsxs(Pt,{children:[c.jsx(Xt,{children:c.jsx(qt,{children:n?"Edit MCP server":"Add MCP server"})}),c.jsxs("form",{onSubmit:C,className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(rt,{htmlFor:"mcp-transport",children:"Transport"}),c.jsxs("select",{id:"mcp-transport",value:o,onChange:A=>u(A.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:[c.jsx("option",{value:"stdio",children:"stdio (local subprocess)"}),c.jsx("option",{value:"http",children:"http"}),c.jsx("option",{value:"sse",children:"sse"})]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(rt,{htmlFor:"mcp-name",children:"Name"}),c.jsx(ht,{id:"mcp-name",value:f,onChange:A=>m(A.target.value),placeholder:"playwright",className:"font-mono"})]}),o==="stdio"?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(rt,{htmlFor:"mcp-command",children:"Command"}),c.jsx(ht,{id:"mcp-command",value:h,onChange:A=>g(A.target.value),placeholder:"/usr/local/bin/playwright-mcp",className:"font-mono"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(rt,{htmlFor:"mcp-args",children:"Args (space-separated, optional)"}),c.jsx(ht,{id:"mcp-args",value:y,onChange:A=>b(A.target.value),placeholder:"--port 3000",className:"font-mono"})]})]}):c.jsxs("div",{className:"space-y-2",children:[c.jsx(rt,{htmlFor:"mcp-url",children:"URL"}),c.jsx(ht,{id:"mcp-url",value:S,onChange:A=>k(A.target.value),placeholder:"https://internal.api/mcp",className:"font-mono"})]}),j&&c.jsx("p",{className:"text-body text-destructive",children:j}),c.jsxs(tn,{children:[c.jsx(pe,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),c.jsx(pe,{type:"submit",children:n?"Done":"Add"})]})]})]})})}const G1=[{value:"opus",label:"opus",hint:"most capable"},{value:"sonnet",label:"sonnet",hint:"balanced"},{value:"haiku",label:"haiku",hint:"fastest"}];function WI({value:e,baseline:t,onChange:n,onRevert:a,disabled:l}){const o=e!==t,u=!G1.some(f=>f.value===e)&&e!=="";return c.jsxs(nn,{style:{borderColor:o?"color-mix(in oklch, var(--state-blocked) 70%, transparent)":void 0},children:[c.jsxs(jr,{children:[c.jsxs(Cr,{children:["Model",o&&c.jsx("span",{className:"mono uppercase text-caption",style:{padding:"var(--hairline) var(--sp-1_5)",borderRadius:"var(--radius-chip)",background:"color-mix(in oklch, var(--state-blocked) 16%, transparent)",color:"color-mix(in oklch, var(--state-blocked) 60%, var(--fg))"},children:"changed"})]}),o&&c.jsx(pe,{size:"xs",variant:"ghost",onClick:a,disabled:l,children:"Revert"})]}),c.jsxs(Kr,{className:"space-y-2",children:[c.jsxs("select",{value:e,onChange:f=>n(f.target.value),disabled:l,className:"flex h-9 w-full max-w-md rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50",children:[e===""&&c.jsx("option",{value:"",children:"(unset — inherits local)"}),G1.map(f=>c.jsxs("option",{value:f.value,children:[f.label,f.hint?` — ${f.hint}`:""]},f.value)),u&&c.jsxs("option",{value:e,children:[e," — custom"]})]}),c.jsxs("p",{className:"text-caption text-muted-foreground",children:["Choose which Claude model powers this agent. Aliases (opus / sonnet / haiku) follow the CLI's latest-in-family mapping and may shift across releases. Applies to new sessions immediately; active sessions switch on their next message. Unset falls back to the operator's local ",c.jsx("code",{children:"~/.claude/settings.json"})," model preference, then the CLI default."]})]})]})}function eU(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const tU=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,nU=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,rU={};function K1(e,t){return(rU.jsx?nU:tU).test(e)}const aU=/[ \t\n\f\r]/g;function iU(e){return typeof e=="object"?e.type==="text"?Y1(e.value):!1:Y1(e)}function Y1(e){return e.replace(aU,"")===""}class Ou{constructor(t,n,a){this.normal=n,this.property=t,a&&(this.space=a)}}Ou.prototype.normal={};Ou.prototype.property={};Ou.prototype.space=void 0;function jC(e,t){const n={},a={};for(const l of e)Object.assign(n,l.property),Object.assign(a,l.normal);return new Ou(n,a,t)}function sg(e){return e.toLowerCase()}class Qn{constructor(t,n){this.attribute=n,this.property=t}}Qn.prototype.attribute="";Qn.prototype.booleanish=!1;Qn.prototype.boolean=!1;Qn.prototype.commaOrSpaceSeparated=!1;Qn.prototype.commaSeparated=!1;Qn.prototype.defined=!1;Qn.prototype.mustUseProperty=!1;Qn.prototype.number=!1;Qn.prototype.overloadedBoolean=!1;Qn.prototype.property="";Qn.prototype.spaceSeparated=!1;Qn.prototype.space=void 0;let lU=0;const He=xl(),Kt=xl(),og=xl(),ge=xl(),Ct=xl(),Ss=xl(),nr=xl();function xl(){return 2**++lU}const ug=Object.freeze(Object.defineProperty({__proto__:null,boolean:He,booleanish:Kt,commaOrSpaceSeparated:nr,commaSeparated:Ss,number:ge,overloadedBoolean:og,spaceSeparated:Ct},Symbol.toStringTag,{value:"Module"})),lp=Object.keys(ug);class iy extends Qn{constructor(t,n,a,l){let o=-1;if(super(t,n),X1(this,"space",l),typeof a=="number")for(;++o<lp.length;){const u=lp[o];X1(this,lp[o],(a&ug[u])===ug[u])}}}iy.prototype.defined=!0;function X1(e,t,n){n&&(e[t]=n)}function Gs(e){const t={},n={};for(const[a,l]of Object.entries(e.properties)){const o=new iy(a,e.transform(e.attributes||{},a),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(o.mustUseProperty=!0),t[a]=o,n[sg(a)]=a,n[sg(o.attribute)]=a}return new Ou(t,n,e.space)}const CC=Gs({properties:{ariaActiveDescendant:null,ariaAtomic:Kt,ariaAutoComplete:null,ariaBusy:Kt,ariaChecked:Kt,ariaColCount:ge,ariaColIndex:ge,ariaColSpan:ge,ariaControls:Ct,ariaCurrent:null,ariaDescribedBy:Ct,ariaDetails:null,ariaDisabled:Kt,ariaDropEffect:Ct,ariaErrorMessage:null,ariaExpanded:Kt,ariaFlowTo:Ct,ariaGrabbed:Kt,ariaHasPopup:null,ariaHidden:Kt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ct,ariaLevel:ge,ariaLive:null,ariaModal:Kt,ariaMultiLine:Kt,ariaMultiSelectable:Kt,ariaOrientation:null,ariaOwns:Ct,ariaPlaceholder:null,ariaPosInSet:ge,ariaPressed:Kt,ariaReadOnly:Kt,ariaRelevant:null,ariaRequired:Kt,ariaRoleDescription:Ct,ariaRowCount:ge,ariaRowIndex:ge,ariaRowSpan:ge,ariaSelected:Kt,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 EC(e,t){return t in e?e[t]:t}function NC(e,t){return EC(e,t.toLowerCase())}const sU=Gs({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ss,acceptCharset:Ct,accessKey:Ct,action:null,allow:null,allowFullScreen:He,allowPaymentRequest:He,allowUserMedia:He,alt:null,as:null,async:He,autoCapitalize:null,autoComplete:Ct,autoFocus:He,autoPlay:He,blocking:Ct,capture:null,charSet:null,checked:He,cite:null,className:Ct,cols:ge,colSpan:null,content:null,contentEditable:Kt,controls:He,controlsList:Ct,coords:ge|Ss,crossOrigin:null,data:null,dateTime:null,decoding:null,default:He,defer:He,dir:null,dirName:null,disabled:He,download:og,draggable:Kt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:He,formTarget:null,headers:Ct,height:ge,hidden:og,high:ge,href:null,hrefLang:null,htmlFor:Ct,httpEquiv:Ct,id:null,imageSizes:null,imageSrcSet:null,inert:He,inputMode:null,integrity:null,is:null,isMap:He,itemId:null,itemProp:Ct,itemRef:Ct,itemScope:He,itemType:Ct,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:He,low:ge,manifest:null,max:null,maxLength:ge,media:null,method:null,min:null,minLength:ge,multiple:He,muted:He,name:null,nonce:null,noModule:He,noValidate:He,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:He,optimum:ge,pattern:null,ping:Ct,placeholder:null,playsInline:He,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:He,referrerPolicy:null,rel:Ct,required:He,reversed:He,rows:ge,rowSpan:ge,sandbox:Ct,scope:null,scoped:He,seamless:He,selected:He,shadowRootClonable:He,shadowRootDelegatesFocus:He,shadowRootMode:null,shape:null,size:ge,sizes:null,slot:null,span:ge,spellCheck:Kt,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:He,useMap:null,value:Kt,width:ge,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ct,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:He,declare:He,event:null,face:null,frame:null,frameBorder:null,hSpace:ge,leftMargin:ge,link:null,longDesc:null,lowSrc:null,marginHeight:ge,marginWidth:ge,noResize:He,noHref:He,noShade:He,noWrap:He,object:null,profile:null,prompt:null,rev:null,rightMargin:ge,rules:null,scheme:null,scrolling:Kt,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:He,disableRemotePlayback:He,prefix:null,property:null,results:ge,security:null,unselectable:null},space:"html",transform:NC}),oU=Gs({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:nr,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:Ct,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ge,diffuseConstant:ge,direction:null,display:null,dur:null,divisor:ge,dominantBaseline:null,download:He,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:Ss,g2:Ss,glyphName:Ss,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:nr,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:Ct,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ge,pointsAtY:ge,pointsAtZ:ge,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:nr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:nr,rev:nr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:nr,requiredFeatures:nr,requiredFonts:nr,requiredFormats:nr,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:nr,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:nr,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:nr,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:EC}),_C=Gs({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()}}),AC=Gs({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:NC}),TC=Gs({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),uU={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"},cU=/[A-Z]/g,J1=/-[a-z]/g,dU=/^data[-\w.:]+$/i;function fU(e,t){const n=sg(t);let a=t,l=Qn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&dU.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(J1,mU);a="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!J1.test(o)){let u=o.replace(cU,hU);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}l=iy}return new l(a,t)}function hU(e){return"-"+e.toLowerCase()}function mU(e){return e.charAt(1).toUpperCase()}const pU=jC([CC,sU,_C,AC,TC],"html"),ly=jC([CC,oU,_C,AC,TC],"svg");function gU(e){return e.join(" ").trim()}var us={},sp,W1;function yU(){if(W1)return sp;W1=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,f=/^\s+|\s+$/g,m=`
349
+ `,h="/",g="*",y="",b="comment",S="declaration";function k(E,C){if(typeof E!="string")throw new TypeError("First argument must be a string");if(!E)return[];C=C||{};var A=1,O=1;function M(fe){var ee=fe.match(t);ee&&(A+=ee.length);var H=fe.lastIndexOf(m);O=~H?fe.length-H:O+fe.length}function D(){var fe={line:A,column:O};return function(ee){return ee.position=new z(fe),te(),ee}}function z(fe){this.start=fe,this.end={line:A,column:O},this.source=C.source}z.prototype.content=E;function L(fe){var ee=new Error(C.source+":"+A+":"+O+": "+fe);if(ee.reason=fe,ee.filename=C.source,ee.line=A,ee.column=O,ee.source=E,!C.silent)throw ee}function Z(fe){var ee=fe.exec(E);if(ee){var H=ee[0];return M(H),E=E.slice(H.length),ee}}function te(){Z(n)}function q(fe){var ee;for(fe=fe||[];ee=oe();)ee!==!1&&fe.push(ee);return fe}function oe(){var fe=D();if(!(h!=E.charAt(0)||g!=E.charAt(1))){for(var ee=2;y!=E.charAt(ee)&&(g!=E.charAt(ee)||h!=E.charAt(ee+1));)++ee;if(ee+=2,y===E.charAt(ee-1))return L("End of comment missing");var H=E.slice(2,ee-2);return O+=2,M(H),E=E.slice(ee),O+=2,fe({type:b,comment:H})}}function W(){var fe=D(),ee=Z(a);if(ee){if(oe(),!Z(l))return L("property missing ':'");var H=Z(o),re=fe({type:S,property:j(ee[0].replace(e,y)),value:H?j(H[0].replace(e,y)):y});return Z(u),re}}function me(){var fe=[];q(fe);for(var ee;ee=W();)ee!==!1&&(fe.push(ee),q(fe));return fe}return te(),me()}function j(E){return E?E.replace(f,y):y}return sp=k,sp}var eS;function vU(){if(eS)return us;eS=1;var e=us&&us.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(us,"__esModule",{value:!0}),us.default=n;const t=e(yU());function n(a,l){let o=null;if(!a||typeof a!="string")return o;const u=(0,t.default)(a),f=typeof l=="function";return u.forEach(m=>{if(m.type!=="declaration")return;const{property:h,value:g}=m;f?l(h,g,m):g&&(o=o||{},o[h]=g)}),o}return us}var Ko={},tS;function bU(){if(tS)return Ko;tS=1,Object.defineProperty(Ko,"__esModule",{value:!0}),Ko.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,l=/^-(ms)-/,o=function(h){return!h||n.test(h)||e.test(h)},u=function(h,g){return g.toUpperCase()},f=function(h,g){return"".concat(g,"-")},m=function(h,g){return g===void 0&&(g={}),o(h)?h:(h=h.toLowerCase(),g.reactCompat?h=h.replace(l,f):h=h.replace(a,f),h.replace(t,u))};return Ko.camelCase=m,Ko}var Yo,nS;function xU(){if(nS)return Yo;nS=1;var e=Yo&&Yo.__importDefault||function(l){return l&&l.__esModule?l:{default:l}},t=e(vU()),n=bU();function a(l,o){var u={};return!l||typeof l!="string"||(0,t.default)(l,function(f,m){f&&m&&(u[(0,n.camelCase)(f,o)]=m)}),u}return a.default=a,Yo=a,Yo}var SU=xU();const wU=$d(SU),zC=RC("end"),sy=RC("start");function RC(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 kU(e){const t=sy(e),n=zC(e);if(t&&n)return{start:t,end:n}}function iu(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?rS(e.position):"start"in e||"end"in e?rS(e):"line"in e||"column"in e?cg(e):""}function cg(e){return aS(e&&e.line)+":"+aS(e&&e.column)}function rS(e){return cg(e&&e.start)+"-"+cg(e&&e.end)}function aS(e){return e&&typeof e=="number"?e:1}class jn extends Error{constructor(t,n,a){super(),typeof n=="string"&&(a=n,n=void 0);let l="",o={},u=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?l=t:!o.cause&&t&&(u=!0,l=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof a=="string"){const m=a.indexOf(":");m===-1?o.ruleId=a:(o.source=a.slice(0,m),o.ruleId=a.slice(m+1))}if(!o.place&&o.ancestors&&o.ancestors){const m=o.ancestors[o.ancestors.length-1];m&&(o.place=m.position)}const f=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=l,this.line=f?f.line:void 0,this.name=iu(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=u&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}jn.prototype.file="";jn.prototype.name="";jn.prototype.reason="";jn.prototype.message="";jn.prototype.stack="";jn.prototype.column=void 0;jn.prototype.line=void 0;jn.prototype.ancestors=void 0;jn.prototype.cause=void 0;jn.prototype.fatal=void 0;jn.prototype.place=void 0;jn.prototype.ruleId=void 0;jn.prototype.source=void 0;const oy={}.hasOwnProperty,jU=new Map,CU=/[A-Z]/g,EU=new Set(["table","tbody","thead","tfoot","tr"]),NU=new Set(["td","th"]),OC="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function _U(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=LU(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=MU(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"?ly:pU,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=DC(l,e,void 0);return o&&typeof o!="string"?o:l.create(e,l.Fragment,{children:o||void 0},void 0)}function DC(e,t,n){if(t.type==="element")return AU(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return TU(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return RU(e,t,n);if(t.type==="mdxjsEsm")return zU(e,t);if(t.type==="root")return OU(e,t,n);if(t.type==="text")return DU(e,t)}function AU(e,t,n){const a=e.schema;let l=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(l=ly,e.schema=l),e.ancestors.push(t);const o=LC(e,t.tagName,!1),u=IU(e,t);let f=cy(e,t);return EU.has(t.tagName)&&(f=f.filter(function(m){return typeof m=="string"?!iU(m):!0})),MC(e,u,o,t),uy(u,f),e.ancestors.pop(),e.schema=a,e.create(t,o,u,n)}function TU(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)}bu(e,t.position)}function zU(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);bu(e,t.position)}function RU(e,t,n){const a=e.schema;let l=a;t.name==="svg"&&a.space==="html"&&(l=ly,e.schema=l),e.ancestors.push(t);const o=t.name===null?e.Fragment:LC(e,t.name,!0),u=UU(e,t),f=cy(e,t);return MC(e,u,o,t),uy(u,f),e.ancestors.pop(),e.schema=a,e.create(t,o,u,n)}function OU(e,t,n){const a={};return uy(a,cy(e,t)),e.create(t,e.Fragment,a,n)}function DU(e,t){return t.value}function MC(e,t,n,a){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=a)}function uy(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function MU(e,t,n){return a;function a(l,o,u,f){const h=Array.isArray(u.children)?n:t;return f?h(o,u,f):h(o,u)}}function LU(e,t){return n;function n(a,l,o,u){const f=Array.isArray(o.children),m=sy(a);return t(l,o,u,f,{columnNumber:m?m.column-1:void 0,fileName:e,lineNumber:m?m.line:void 0},void 0)}}function IU(e,t){const n={};let a,l;for(l in t.properties)if(l!=="children"&&oy.call(t.properties,l)){const o=PU(e,l,t.properties[l]);if(o){const[u,f]=o;e.tableCellAlignToStyle&&u==="align"&&typeof f=="string"&&NU.has(t.tagName)?a=f:n[u]=f}}if(a){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return n}function UU(e,t){const n={};for(const a of t.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&e.evaluater){const o=a.data.estree.body[0];o.type;const u=o.expression;u.type;const f=u.properties[0];f.type,Object.assign(n,e.evaluater.evaluateExpression(f.argument))}else bu(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 bu(e,t.position);else o=a.value===null?!0:a.value;n[l]=o}return n}function cy(e,t){const n=[];let a=-1;const l=e.passKeys?new Map:jU;for(;++a<t.children.length;){const o=t.children[a];let u;if(e.passKeys){const m=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(m){const h=l.get(m)||0;u=m+"-"+h,l.set(m,h+1)}}const f=DC(e,o,u);f!==void 0&&n.push(f)}return n}function PU(e,t,n){const a=fU(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=a.commaSeparated?eU(n):gU(n)),a.property==="style"){let l=typeof n=="object"?n:BU(e,String(n));return e.stylePropertyNameCase==="css"&&(l=$U(l)),["style",l]}return[e.elementAttributeNameCase==="react"&&a.space?uU[a.property]||a.property:a.attribute,n]}}function BU(e,t){try{return wU(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const a=n,l=new jn("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=OC+"#cannot-parse-style-attribute",l}}function LC(e,t,n){let a;if(!n)a={type:"Literal",value:t};else if(t.includes(".")){const l=t.split(".");let o=-1,u;for(;++o<l.length;){const f=K1(l[o])?{type:"Identifier",name:l[o]}:{type:"Literal",value:l[o]};u=u?{type:"MemberExpression",object:u,property:f,computed:!!(o&&f.type==="Literal"),optional:!1}:f}a=u}else a=K1(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(a.type==="Literal"){const l=a.value;return oy.call(e.components,l)?e.components[l]:l}if(e.evaluater)return e.evaluater.evaluateExpression(a);bu(e)}function bu(e,t){const n=new jn("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=OC+"#cannot-handle-mdx-estrees-without-createevaluater",n}function $U(e){const t={};let n;for(n in e)oy.call(e,n)&&(t[FU(n)]=e[n]);return t}function FU(e){let t=e.replace(CU,qU);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function qU(e){return"-"+e.toLowerCase()}const op={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"]},HU={};function dy(e,t){const n=HU,a=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,l=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return IC(e,a,l)}function IC(e,t,n){if(ZU(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 iS(e.children,t,n)}return Array.isArray(e)?iS(e,t,n):""}function iS(e,t,n){const a=[];let l=-1;for(;++l<e.length;)a[l]=IC(e[l],t,n);return a.join("")}function ZU(e){return!!(e&&typeof e=="object")}const lS=document.createElement("i");function fy(e){const t="&"+e+";";lS.innerHTML=t;const n=lS.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ir(e,t,n,a){const l=e.length;let o=0,u;if(t<0?t=-t>l?0:l+t:t=t>l?l:t,n=n>0?n:0,a.length<1e4)u=Array.from(a),u.unshift(t,n),e.splice(...u);else for(n&&e.splice(t,n);o<a.length;)u=a.slice(o,o+1e4),u.unshift(t,0),e.splice(...u),o+=1e4,t+=1e4}function xr(e,t){return e.length>0?(ir(e,e.length,0,t),e):t}const sS={}.hasOwnProperty;function UC(e){const t={};let n=-1;for(;++n<e.length;)VU(t,e[n]);return t}function VU(e,t){let n;for(n in t){const l=(sS.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let u;if(o)for(u in o){sS.call(l,u)||(l[u]=[]);const f=o[u];QU(l[u],Array.isArray(f)?f:f?[f]:[])}}}function QU(e,t){let n=-1;const a=[];for(;++n<t.length;)(t[n].add==="after"?e:a).push(t[n]);ir(e,0,0,a)}function PC(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 Or(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Tn=_i(/[A-Za-z]/),wn=_i(/[\dA-Za-z]/),GU=_i(/[#-'*+\--9=?A-Z^-~]/);function Id(e){return e!==null&&(e<32||e===127)}const dg=_i(/\d/),KU=_i(/[\dA-Fa-f]/),YU=_i(/[!-/:-@[-`{-~]/);function Re(e){return e!==null&&e<-2}function jt(e){return e!==null&&(e<0||e===32)}function Xe(e){return e===-2||e===-1||e===32}const pf=_i(new RegExp("\\p{P}|\\p{S}","u")),pl=_i(/\s/);function _i(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ks(e){const t=[];let n=-1,a=0,l=0;for(;++n<e.length;){const o=e.charCodeAt(n);let u="";if(o===37&&wn(e.charCodeAt(n+1))&&wn(e.charCodeAt(n+2)))l=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(u=String.fromCharCode(o));else if(o>55295&&o<57344){const f=e.charCodeAt(n+1);o<56320&&f>56319&&f<57344?(u=String.fromCharCode(o,f),l=1):u="�"}else u=String.fromCharCode(o);u&&(t.push(e.slice(a,n),encodeURIComponent(u)),a=n+l+1,u=""),l&&(n+=l,l=0)}return t.join("")+e.slice(a)}function it(e,t,n,a){const l=a?a-1:Number.POSITIVE_INFINITY;let o=0;return u;function u(m){return Xe(m)?(e.enter(n),f(m)):t(m)}function f(m){return Xe(m)&&o++<l?(e.consume(m),f):(e.exit(n),t(m))}}const XU={tokenize:JU};function JU(e){const t=e.attempt(this.parser.constructs.contentInitial,a,l);let n;return t;function a(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),it(e,t,"linePrefix")}function l(f){return e.enter("paragraph"),o(f)}function o(f){const m=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=m),n=m,u(f)}function u(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return Re(f)?(e.consume(f),e.exit("chunkText"),o):(e.consume(f),u)}}const WU={tokenize:e9},oS={tokenize:t9};function e9(e){const t=this,n=[];let a=0,l,o,u;return f;function f(O){if(a<n.length){const M=n[a];return t.containerState=M[1],e.attempt(M[0].continuation,m,h)(O)}return h(O)}function m(O){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,l&&A();const M=t.events.length;let D=M,z;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){z=t.events[D][1].end;break}C(a);let L=M;for(;L<t.events.length;)t.events[L][1].end={...z},L++;return ir(t.events,D+1,0,t.events.slice(M)),t.events.length=L,h(O)}return f(O)}function h(O){if(a===n.length){if(!l)return b(O);if(l.currentConstruct&&l.currentConstruct.concrete)return k(O);t.interrupt=!!(l.currentConstruct&&!l._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(oS,g,y)(O)}function g(O){return l&&A(),C(a),b(O)}function y(O){return t.parser.lazy[t.now().line]=a!==n.length,u=t.now().offset,k(O)}function b(O){return t.containerState={},e.attempt(oS,S,k)(O)}function S(O){return a++,n.push([t.currentConstruct,t.containerState]),b(O)}function k(O){if(O===null){l&&A(),C(0),e.consume(O);return}return l=l||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:l,contentType:"flow",previous:o}),j(O)}function j(O){if(O===null){E(e.exit("chunkFlow"),!0),C(0),e.consume(O);return}return Re(O)?(e.consume(O),E(e.exit("chunkFlow")),a=0,t.interrupt=void 0,f):(e.consume(O),j)}function E(O,M){const D=t.sliceStream(O);if(M&&D.push(null),O.previous=o,o&&(o.next=O),o=O,l.defineSkip(O.start),l.write(D),t.parser.lazy[O.start.line]){let z=l.events.length;for(;z--;)if(l.events[z][1].start.offset<u&&(!l.events[z][1].end||l.events[z][1].end.offset>u))return;const L=t.events.length;let Z=L,te,q;for(;Z--;)if(t.events[Z][0]==="exit"&&t.events[Z][1].type==="chunkFlow"){if(te){q=t.events[Z][1].end;break}te=!0}for(C(a),z=L;z<t.events.length;)t.events[z][1].end={...q},z++;ir(t.events,Z+1,0,t.events.slice(L)),t.events.length=z}}function C(O){let M=n.length;for(;M-- >O;){const D=n[M];t.containerState=D[1],D[0].exit.call(t,e)}n.length=O}function A(){l.write([null]),o=void 0,l=void 0,t.containerState._closeFlow=void 0}}function t9(e,t,n){return it(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Bs(e){if(e===null||jt(e)||pl(e))return 1;if(pf(e))return 2}function gf(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 fg={name:"attention",resolveAll:n9,tokenize:r9};function n9(e,t){let n=-1,a,l,o,u,f,m,h,g;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(a=n;a--;)if(e[a][0]==="exit"&&e[a][1].type==="attentionSequence"&&e[a][1]._open&&t.sliceSerialize(e[a][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[a][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[a][1].end.offset-e[a][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;m=e[a][1].end.offset-e[a][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const y={...e[a][1].end},b={...e[n][1].start};uS(y,-m),uS(b,m),u={type:m>1?"strongSequence":"emphasisSequence",start:y,end:{...e[a][1].end}},f={type:m>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:b},o={type:m>1?"strongText":"emphasisText",start:{...e[a][1].end},end:{...e[n][1].start}},l={type:m>1?"strong":"emphasis",start:{...u.start},end:{...f.end}},e[a][1].end={...u.start},e[n][1].start={...f.end},h=[],e[a][1].end.offset-e[a][1].start.offset&&(h=xr(h,[["enter",e[a][1],t],["exit",e[a][1],t]])),h=xr(h,[["enter",l,t],["enter",u,t],["exit",u,t],["enter",o,t]]),h=xr(h,gf(t.parser.constructs.insideSpan.null,e.slice(a+1,n),t)),h=xr(h,[["exit",o,t],["enter",f,t],["exit",f,t],["exit",l,t]]),e[n][1].end.offset-e[n][1].start.offset?(g=2,h=xr(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):g=0,ir(e,a-1,n-a+3,h),n=a+h.length-g-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function r9(e,t){const n=this.parser.constructs.attentionMarkers.null,a=this.previous,l=Bs(a);let o;return u;function u(m){return o=m,e.enter("attentionSequence"),f(m)}function f(m){if(m===o)return e.consume(m),f;const h=e.exit("attentionSequence"),g=Bs(m),y=!g||g===2&&l||n.includes(m),b=!l||l===2&&g||n.includes(a);return h._open=!!(o===42?y:y&&(l||!b)),h._close=!!(o===42?b:b&&(g||!y)),t(m)}}function uS(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const a9={name:"autolink",tokenize:i9};function i9(e,t,n){let a=0;return l;function l(S){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(S),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(S){return Tn(S)?(e.consume(S),u):S===64?n(S):h(S)}function u(S){return S===43||S===45||S===46||wn(S)?(a=1,f(S)):h(S)}function f(S){return S===58?(e.consume(S),a=0,m):(S===43||S===45||S===46||wn(S))&&a++<32?(e.consume(S),f):(a=0,h(S))}function m(S){return S===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(S),e.exit("autolinkMarker"),e.exit("autolink"),t):S===null||S===32||S===60||Id(S)?n(S):(e.consume(S),m)}function h(S){return S===64?(e.consume(S),g):GU(S)?(e.consume(S),h):n(S)}function g(S){return wn(S)?y(S):n(S)}function y(S){return S===46?(e.consume(S),a=0,g):S===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(S),e.exit("autolinkMarker"),e.exit("autolink"),t):b(S)}function b(S){if((S===45||wn(S))&&a++<63){const k=S===45?b:y;return e.consume(S),k}return n(S)}}const Du={partial:!0,tokenize:l9};function l9(e,t,n){return a;function a(o){return Xe(o)?it(e,l,"linePrefix")(o):l(o)}function l(o){return o===null||Re(o)?t(o):n(o)}}const BC={continuation:{tokenize:o9},exit:u9,name:"blockQuote",tokenize:s9};function s9(e,t,n){const a=this;return l;function l(u){if(u===62){const f=a.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(u),e.exit("blockQuoteMarker"),o}return n(u)}function o(u){return Xe(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(u))}}function o9(e,t,n){const a=this;return l;function l(u){return Xe(u)?it(e,o,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):o(u)}function o(u){return e.attempt(BC,t,n)(u)}}function u9(e){e.exit("blockQuote")}const $C={name:"characterEscape",tokenize:c9};function c9(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 YU(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const FC={name:"characterReference",tokenize:d9};function d9(e,t,n){const a=this;let l=0,o,u;return f;function f(y){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(y),e.exit("characterReferenceMarker"),m}function m(y){return y===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(y),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),o=31,u=wn,g(y))}function h(y){return y===88||y===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(y),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,u=KU,g):(e.enter("characterReferenceValue"),o=7,u=dg,g(y))}function g(y){if(y===59&&l){const b=e.exit("characterReferenceValue");return u===wn&&!fy(a.sliceSerialize(b))?n(y):(e.enter("characterReferenceMarker"),e.consume(y),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return u(y)&&l++<o?(e.consume(y),g):n(y)}}const cS={partial:!0,tokenize:h9},dS={concrete:!0,name:"codeFenced",tokenize:f9};function f9(e,t,n){const a=this,l={partial:!0,tokenize:D};let o=0,u=0,f;return m;function m(z){return h(z)}function h(z){const L=a.events[a.events.length-1];return o=L&&L[1].type==="linePrefix"?L[2].sliceSerialize(L[1],!0).length:0,f=z,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(z)}function g(z){return z===f?(u++,e.consume(z),g):u<3?n(z):(e.exit("codeFencedFenceSequence"),Xe(z)?it(e,y,"whitespace")(z):y(z))}function y(z){return z===null||Re(z)?(e.exit("codeFencedFence"),a.interrupt?t(z):e.check(cS,j,M)(z)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(z))}function b(z){return z===null||Re(z)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),y(z)):Xe(z)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),it(e,S,"whitespace")(z)):z===96&&z===f?n(z):(e.consume(z),b)}function S(z){return z===null||Re(z)?y(z):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),k(z))}function k(z){return z===null||Re(z)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),y(z)):z===96&&z===f?n(z):(e.consume(z),k)}function j(z){return e.attempt(l,M,E)(z)}function E(z){return e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),C}function C(z){return o>0&&Xe(z)?it(e,A,"linePrefix",o+1)(z):A(z)}function A(z){return z===null||Re(z)?e.check(cS,j,M)(z):(e.enter("codeFlowValue"),O(z))}function O(z){return z===null||Re(z)?(e.exit("codeFlowValue"),A(z)):(e.consume(z),O)}function M(z){return e.exit("codeFenced"),t(z)}function D(z,L,Z){let te=0;return q;function q(ee){return z.enter("lineEnding"),z.consume(ee),z.exit("lineEnding"),oe}function oe(ee){return z.enter("codeFencedFence"),Xe(ee)?it(z,W,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ee):W(ee)}function W(ee){return ee===f?(z.enter("codeFencedFenceSequence"),me(ee)):Z(ee)}function me(ee){return ee===f?(te++,z.consume(ee),me):te>=u?(z.exit("codeFencedFenceSequence"),Xe(ee)?it(z,fe,"whitespace")(ee):fe(ee)):Z(ee)}function fe(ee){return ee===null||Re(ee)?(z.exit("codeFencedFence"),L(ee)):Z(ee)}}}function h9(e,t,n){const a=this;return l;function l(u){return u===null?n(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o)}function o(u){return a.parser.lazy[a.now().line]?n(u):t(u)}}const up={name:"codeIndented",tokenize:p9},m9={partial:!0,tokenize:g9};function p9(e,t,n){const a=this;return l;function l(h){return e.enter("codeIndented"),it(e,o,"linePrefix",5)(h)}function o(h){const g=a.events[a.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?u(h):n(h)}function u(h){return h===null?m(h):Re(h)?e.attempt(m9,u,m)(h):(e.enter("codeFlowValue"),f(h))}function f(h){return h===null||Re(h)?(e.exit("codeFlowValue"),u(h)):(e.consume(h),f)}function m(h){return e.exit("codeIndented"),t(h)}}function g9(e,t,n){const a=this;return l;function l(u){return a.parser.lazy[a.now().line]?n(u):Re(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l):it(e,o,"linePrefix",5)(u)}function o(u){const f=a.events[a.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(u):Re(u)?l(u):n(u)}}const y9={name:"codeText",previous:b9,resolve:v9,tokenize:x9};function v9(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 b9(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function x9(e,t,n){let a=0,l,o;return u;function u(y){return e.enter("codeText"),e.enter("codeTextSequence"),f(y)}function f(y){return y===96?(e.consume(y),a++,f):(e.exit("codeTextSequence"),m(y))}function m(y){return y===null?n(y):y===32?(e.enter("space"),e.consume(y),e.exit("space"),m):y===96?(o=e.enter("codeTextSequence"),l=0,g(y)):Re(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),m):(e.enter("codeTextData"),h(y))}function h(y){return y===null||y===32||y===96||Re(y)?(e.exit("codeTextData"),m(y)):(e.consume(y),h)}function g(y){return y===96?(e.consume(y),l++,g):l===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(y)):(o.type="codeTextData",h(y))}}class S9{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&&Xo(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),Xo(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Xo(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);Xo(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Xo(this.left,n.reverse())}}}function Xo(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 qC(e){const t={};let n=-1,a,l,o,u,f,m,h;const g=new S9(e);for(;++n<g.length;){for(;n in t;)n=t[n];if(a=g.get(n),n&&a[1].type==="chunkFlow"&&g.get(n-1)[1].type==="listItemPrefix"&&(m=a[1]._tokenizer.events,o=0,o<m.length&&m[o][1].type==="lineEndingBlank"&&(o+=2),o<m.length&&m[o][1].type==="content"))for(;++o<m.length&&m[o][1].type!=="content";)m[o][1].type==="chunkText"&&(m[o][1]._isInFirstContentOfListItem=!0,o++);if(a[0]==="enter")a[1].contentType&&(Object.assign(t,w9(g,n)),n=t[n],h=!0);else if(a[1]._container){for(o=n,l=void 0;o--;)if(u=g.get(o),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(l&&(g.get(l)[1].type="lineEndingBlank"),u[1].type="lineEnding",l=o);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;l&&(a[1].end={...g.get(l)[1].start},f=g.slice(l,n),f.unshift(a),g.splice(l,n-l+1,f))}}return ir(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!h}function w9(e,t){const n=e.get(t)[1],a=e.get(t)[2];let l=t-1;const o=[];let u=n._tokenizer;u||(u=a.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const f=u.events,m=[],h={};let g,y,b=-1,S=n,k=0,j=0;const E=[j];for(;S;){for(;e.get(++l)[1]!==S;);o.push(l),S._tokenizer||(g=a.sliceStream(S),S.next||g.push(null),y&&u.defineSkip(S.start),S._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(g),S._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),y=S,S=S.next}for(S=n;++b<f.length;)f[b][0]==="exit"&&f[b-1][0]==="enter"&&f[b][1].type===f[b-1][1].type&&f[b][1].start.line!==f[b][1].end.line&&(j=b+1,E.push(j),S._tokenizer=void 0,S.previous=void 0,S=S.next);for(u.events=[],S?(S._tokenizer=void 0,S.previous=void 0):E.pop(),b=E.length;b--;){const C=f.slice(E[b],E[b+1]),A=o.pop();m.push([A,A+C.length-1]),e.splice(A,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 k9={resolve:C9,tokenize:E9},j9={partial:!0,tokenize:N9};function C9(e){return qC(e),e}function E9(e,t){let n;return a;function a(f){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),l(f)}function l(f){return f===null?o(f):Re(f)?e.check(j9,u,o)(f):(e.consume(f),l)}function o(f){return e.exit("chunkContent"),e.exit("content"),t(f)}function u(f){return e.consume(f),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,l}}function N9(e,t,n){const a=this;return l;function l(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),it(e,o,"linePrefix")}function o(u){if(u===null||Re(u))return n(u);const f=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(u):e.interrupt(a.parser.constructs.flow,n,t)(u)}}function HC(e,t,n,a,l,o,u,f,m){const h=m||Number.POSITIVE_INFINITY;let g=0;return y;function y(C){return C===60?(e.enter(a),e.enter(l),e.enter(o),e.consume(C),e.exit(o),b):C===null||C===32||C===41||Id(C)?n(C):(e.enter(a),e.enter(u),e.enter(f),e.enter("chunkString",{contentType:"string"}),j(C))}function b(C){return C===62?(e.enter(o),e.consume(C),e.exit(o),e.exit(l),e.exit(a),t):(e.enter(f),e.enter("chunkString",{contentType:"string"}),S(C))}function S(C){return C===62?(e.exit("chunkString"),e.exit(f),b(C)):C===null||C===60||Re(C)?n(C):(e.consume(C),C===92?k:S)}function k(C){return C===60||C===62||C===92?(e.consume(C),S):S(C)}function j(C){return!g&&(C===null||C===41||jt(C))?(e.exit("chunkString"),e.exit(f),e.exit(u),e.exit(a),t(C)):g<h&&C===40?(e.consume(C),g++,j):C===41?(e.consume(C),g--,j):C===null||C===32||C===40||Id(C)?n(C):(e.consume(C),C===92?E:j)}function E(C){return C===40||C===41||C===92?(e.consume(C),j):j(C)}}function ZC(e,t,n,a,l,o){const u=this;let f=0,m;return h;function h(S){return e.enter(a),e.enter(l),e.consume(S),e.exit(l),e.enter(o),g}function g(S){return f>999||S===null||S===91||S===93&&!m||S===94&&!f&&"_hiddenFootnoteSupport"in u.parser.constructs?n(S):S===93?(e.exit(o),e.enter(l),e.consume(S),e.exit(l),e.exit(a),t):Re(S)?(e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),y(S))}function y(S){return S===null||S===91||S===93||Re(S)||f++>999?(e.exit("chunkString"),g(S)):(e.consume(S),m||(m=!Xe(S)),S===92?b:y)}function b(S){return S===91||S===92||S===93?(e.consume(S),f++,y):y(S)}}function VC(e,t,n,a,l,o){let u;return f;function f(b){return b===34||b===39||b===40?(e.enter(a),e.enter(l),e.consume(b),e.exit(l),u=b===40?41:b,m):n(b)}function m(b){return b===u?(e.enter(l),e.consume(b),e.exit(l),e.exit(a),t):(e.enter(o),h(b))}function h(b){return b===u?(e.exit(o),m(u)):b===null?n(b):Re(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),it(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(b))}function g(b){return b===u||b===null||Re(b)?(e.exit("chunkString"),h(b)):(e.consume(b),b===92?y:g)}function y(b){return b===u||b===92?(e.consume(b),g):g(b)}}function lu(e,t){let n;return a;function a(l){return Re(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n=!0,a):Xe(l)?it(e,a,n?"linePrefix":"lineSuffix")(l):t(l)}}const _9={name:"definition",tokenize:T9},A9={partial:!0,tokenize:z9};function T9(e,t,n){const a=this;let l;return o;function o(S){return e.enter("definition"),u(S)}function u(S){return ZC.call(a,e,f,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(S)}function f(S){return l=Or(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),S===58?(e.enter("definitionMarker"),e.consume(S),e.exit("definitionMarker"),m):n(S)}function m(S){return jt(S)?lu(e,h)(S):h(S)}function h(S){return HC(e,g,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(S)}function g(S){return e.attempt(A9,y,y)(S)}function y(S){return Xe(S)?it(e,b,"whitespace")(S):b(S)}function b(S){return S===null||Re(S)?(e.exit("definition"),a.parser.defined.push(l),t(S)):n(S)}}function z9(e,t,n){return a;function a(f){return jt(f)?lu(e,l)(f):n(f)}function l(f){return VC(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function o(f){return Xe(f)?it(e,u,"whitespace")(f):u(f)}function u(f){return f===null||Re(f)?t(f):n(f)}}const R9={name:"hardBreakEscape",tokenize:O9};function O9(e,t,n){return a;function a(o){return e.enter("hardBreakEscape"),e.consume(o),l}function l(o){return Re(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const D9={name:"headingAtx",resolve:M9,tokenize:L9};function M9(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"},ir(e,a,n-a+1,[["enter",l,t],["enter",o,t],["exit",o,t],["exit",l,t]])),e}function L9(e,t,n){let a=0;return l;function l(g){return e.enter("atxHeading"),o(g)}function o(g){return e.enter("atxHeadingSequence"),u(g)}function u(g){return g===35&&a++<6?(e.consume(g),u):g===null||jt(g)?(e.exit("atxHeadingSequence"),f(g)):n(g)}function f(g){return g===35?(e.enter("atxHeadingSequence"),m(g)):g===null||Re(g)?(e.exit("atxHeading"),t(g)):Xe(g)?it(e,f,"whitespace")(g):(e.enter("atxHeadingText"),h(g))}function m(g){return g===35?(e.consume(g),m):(e.exit("atxHeadingSequence"),f(g))}function h(g){return g===null||g===35||jt(g)?(e.exit("atxHeadingText"),f(g)):(e.consume(g),h)}}const I9=["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"],fS=["pre","script","style","textarea"],U9={concrete:!0,name:"htmlFlow",resolveTo:$9,tokenize:F9},P9={partial:!0,tokenize:H9},B9={partial:!0,tokenize:q9};function $9(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 F9(e,t,n){const a=this;let l,o,u,f,m;return h;function h(_){return g(_)}function g(_){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(_),y}function y(_){return _===33?(e.consume(_),b):_===47?(e.consume(_),o=!0,j):_===63?(e.consume(_),l=3,a.interrupt?t:T):Tn(_)?(e.consume(_),u=String.fromCharCode(_),E):n(_)}function b(_){return _===45?(e.consume(_),l=2,S):_===91?(e.consume(_),l=5,f=0,k):Tn(_)?(e.consume(_),l=4,a.interrupt?t:T):n(_)}function S(_){return _===45?(e.consume(_),a.interrupt?t:T):n(_)}function k(_){const $="CDATA[";return _===$.charCodeAt(f++)?(e.consume(_),f===$.length?a.interrupt?t:W:k):n(_)}function j(_){return Tn(_)?(e.consume(_),u=String.fromCharCode(_),E):n(_)}function E(_){if(_===null||_===47||_===62||jt(_)){const $=_===47,X=u.toLowerCase();return!$&&!o&&fS.includes(X)?(l=1,a.interrupt?t(_):W(_)):I9.includes(u.toLowerCase())?(l=6,$?(e.consume(_),C):a.interrupt?t(_):W(_)):(l=7,a.interrupt&&!a.parser.lazy[a.now().line]?n(_):o?A(_):O(_))}return _===45||wn(_)?(e.consume(_),u+=String.fromCharCode(_),E):n(_)}function C(_){return _===62?(e.consume(_),a.interrupt?t:W):n(_)}function A(_){return Xe(_)?(e.consume(_),A):q(_)}function O(_){return _===47?(e.consume(_),q):_===58||_===95||Tn(_)?(e.consume(_),M):Xe(_)?(e.consume(_),O):q(_)}function M(_){return _===45||_===46||_===58||_===95||wn(_)?(e.consume(_),M):D(_)}function D(_){return _===61?(e.consume(_),z):Xe(_)?(e.consume(_),D):O(_)}function z(_){return _===null||_===60||_===61||_===62||_===96?n(_):_===34||_===39?(e.consume(_),m=_,L):Xe(_)?(e.consume(_),z):Z(_)}function L(_){return _===m?(e.consume(_),m=null,te):_===null||Re(_)?n(_):(e.consume(_),L)}function Z(_){return _===null||_===34||_===39||_===47||_===60||_===61||_===62||_===96||jt(_)?D(_):(e.consume(_),Z)}function te(_){return _===47||_===62||Xe(_)?O(_):n(_)}function q(_){return _===62?(e.consume(_),oe):n(_)}function oe(_){return _===null||Re(_)?W(_):Xe(_)?(e.consume(_),oe):n(_)}function W(_){return _===45&&l===2?(e.consume(_),H):_===60&&l===1?(e.consume(_),re):_===62&&l===4?(e.consume(_),U):_===63&&l===3?(e.consume(_),T):_===93&&l===5?(e.consume(_),he):Re(_)&&(l===6||l===7)?(e.exit("htmlFlowData"),e.check(P9,P,me)(_)):_===null||Re(_)?(e.exit("htmlFlowData"),me(_)):(e.consume(_),W)}function me(_){return e.check(B9,fe,P)(_)}function fe(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),ee}function ee(_){return _===null||Re(_)?me(_):(e.enter("htmlFlowData"),W(_))}function H(_){return _===45?(e.consume(_),T):W(_)}function re(_){return _===47?(e.consume(_),u="",K):W(_)}function K(_){if(_===62){const $=u.toLowerCase();return fS.includes($)?(e.consume(_),U):W(_)}return Tn(_)&&u.length<8?(e.consume(_),u+=String.fromCharCode(_),K):W(_)}function he(_){return _===93?(e.consume(_),T):W(_)}function T(_){return _===62?(e.consume(_),U):_===45&&l===2?(e.consume(_),T):W(_)}function U(_){return _===null||Re(_)?(e.exit("htmlFlowData"),P(_)):(e.consume(_),U)}function P(_){return e.exit("htmlFlow"),t(_)}}function q9(e,t,n){const a=this;return l;function l(u){return Re(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o):n(u)}function o(u){return a.parser.lazy[a.now().line]?n(u):t(u)}}function H9(e,t,n){return a;function a(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),e.attempt(Du,t,n)}}const Z9={name:"htmlText",tokenize:V9};function V9(e,t,n){const a=this;let l,o,u;return f;function f(T){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(T),m}function m(T){return T===33?(e.consume(T),h):T===47?(e.consume(T),D):T===63?(e.consume(T),O):Tn(T)?(e.consume(T),Z):n(T)}function h(T){return T===45?(e.consume(T),g):T===91?(e.consume(T),o=0,k):Tn(T)?(e.consume(T),A):n(T)}function g(T){return T===45?(e.consume(T),S):n(T)}function y(T){return T===null?n(T):T===45?(e.consume(T),b):Re(T)?(u=y,re(T)):(e.consume(T),y)}function b(T){return T===45?(e.consume(T),S):y(T)}function S(T){return T===62?H(T):T===45?b(T):y(T)}function k(T){const U="CDATA[";return T===U.charCodeAt(o++)?(e.consume(T),o===U.length?j:k):n(T)}function j(T){return T===null?n(T):T===93?(e.consume(T),E):Re(T)?(u=j,re(T)):(e.consume(T),j)}function E(T){return T===93?(e.consume(T),C):j(T)}function C(T){return T===62?H(T):T===93?(e.consume(T),C):j(T)}function A(T){return T===null||T===62?H(T):Re(T)?(u=A,re(T)):(e.consume(T),A)}function O(T){return T===null?n(T):T===63?(e.consume(T),M):Re(T)?(u=O,re(T)):(e.consume(T),O)}function M(T){return T===62?H(T):O(T)}function D(T){return Tn(T)?(e.consume(T),z):n(T)}function z(T){return T===45||wn(T)?(e.consume(T),z):L(T)}function L(T){return Re(T)?(u=L,re(T)):Xe(T)?(e.consume(T),L):H(T)}function Z(T){return T===45||wn(T)?(e.consume(T),Z):T===47||T===62||jt(T)?te(T):n(T)}function te(T){return T===47?(e.consume(T),H):T===58||T===95||Tn(T)?(e.consume(T),q):Re(T)?(u=te,re(T)):Xe(T)?(e.consume(T),te):H(T)}function q(T){return T===45||T===46||T===58||T===95||wn(T)?(e.consume(T),q):oe(T)}function oe(T){return T===61?(e.consume(T),W):Re(T)?(u=oe,re(T)):Xe(T)?(e.consume(T),oe):te(T)}function W(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),l=T,me):Re(T)?(u=W,re(T)):Xe(T)?(e.consume(T),W):(e.consume(T),fe)}function me(T){return T===l?(e.consume(T),l=void 0,ee):T===null?n(T):Re(T)?(u=me,re(T)):(e.consume(T),me)}function fe(T){return T===null||T===34||T===39||T===60||T===61||T===96?n(T):T===47||T===62||jt(T)?te(T):(e.consume(T),fe)}function ee(T){return T===47||T===62||jt(T)?te(T):n(T)}function H(T){return T===62?(e.consume(T),e.exit("htmlTextData"),e.exit("htmlText"),t):n(T)}function re(T){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),K}function K(T){return Xe(T)?it(e,he,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):he(T)}function he(T){return e.enter("htmlTextData"),u(T)}}const hy={name:"labelEnd",resolveAll:Y9,resolveTo:X9,tokenize:J9},Q9={tokenize:W9},G9={tokenize:eP},K9={tokenize:tP};function Y9(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&&ir(e,0,e.length,n),e}function X9(e,t){let n=e.length,a=0,l,o,u,f;for(;n--;)if(l=e[n][1],o){if(l.type==="link"||l.type==="labelLink"&&l._inactive)break;e[n][0]==="enter"&&l.type==="labelLink"&&(l._inactive=!0)}else if(u){if(e[n][0]==="enter"&&(l.type==="labelImage"||l.type==="labelLink")&&!l._balanced&&(o=n,l.type!=="labelLink")){a=2;break}}else l.type==="labelEnd"&&(u=n);const m={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[o][1].start},end:{...e[u][1].end}},g={type:"labelText",start:{...e[o+a+2][1].end},end:{...e[u-2][1].start}};return f=[["enter",m,t],["enter",h,t]],f=xr(f,e.slice(o+1,o+a+3)),f=xr(f,[["enter",g,t]]),f=xr(f,gf(t.parser.constructs.insideSpan.null,e.slice(o+a+4,u-3),t)),f=xr(f,[["exit",g,t],e[u-2],e[u-1],["exit",h,t]]),f=xr(f,e.slice(u+1)),f=xr(f,[["exit",m,t]]),ir(e,o,e.length,f),e}function J9(e,t,n){const a=this;let l=a.events.length,o,u;for(;l--;)if((a.events[l][1].type==="labelImage"||a.events[l][1].type==="labelLink")&&!a.events[l][1]._balanced){o=a.events[l][1];break}return f;function f(b){return o?o._inactive?y(b):(u=a.parser.defined.includes(Or(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(Q9,g,u?g:y)(b):b===91?e.attempt(G9,g,u?h:y)(b):u?g(b):y(b)}function h(b){return e.attempt(K9,g,y)(b)}function g(b){return t(b)}function y(b){return o._balanced=!0,n(b)}}function W9(e,t,n){return a;function a(y){return e.enter("resource"),e.enter("resourceMarker"),e.consume(y),e.exit("resourceMarker"),l}function l(y){return jt(y)?lu(e,o)(y):o(y)}function o(y){return y===41?g(y):HC(e,u,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(y)}function u(y){return jt(y)?lu(e,m)(y):g(y)}function f(y){return n(y)}function m(y){return y===34||y===39||y===40?VC(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(y):g(y)}function h(y){return jt(y)?lu(e,g)(y):g(y)}function g(y){return y===41?(e.enter("resourceMarker"),e.consume(y),e.exit("resourceMarker"),e.exit("resource"),t):n(y)}}function eP(e,t,n){const a=this;return l;function l(f){return ZC.call(a,e,o,u,"reference","referenceMarker","referenceString")(f)}function o(f){return a.parser.defined.includes(Or(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?t(f):n(f)}function u(f){return n(f)}}function tP(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 nP={name:"labelStartImage",resolveAll:hy.resolveAll,tokenize:rP};function rP(e,t,n){const a=this;return l;function l(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),o}function o(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),u):n(f)}function u(f){return f===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(f):t(f)}}const aP={name:"labelStartLink",resolveAll:hy.resolveAll,tokenize:iP};function iP(e,t,n){const a=this;return l;function l(u){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelLink"),o}function o(u){return u===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(u):t(u)}}const cp={name:"lineEnding",tokenize:lP};function lP(e,t){return n;function n(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),it(e,t,"linePrefix")}}const jd={name:"thematicBreak",tokenize:sP};function sP(e,t,n){let a=0,l;return o;function o(h){return e.enter("thematicBreak"),u(h)}function u(h){return l=h,f(h)}function f(h){return h===l?(e.enter("thematicBreakSequence"),m(h)):a>=3&&(h===null||Re(h))?(e.exit("thematicBreak"),t(h)):n(h)}function m(h){return h===l?(e.consume(h),a++,m):(e.exit("thematicBreakSequence"),Xe(h)?it(e,f,"whitespace")(h):f(h))}}const $n={continuation:{tokenize:dP},exit:hP,name:"list",tokenize:cP},oP={partial:!0,tokenize:mP},uP={partial:!0,tokenize:fP};function cP(e,t,n){const a=this,l=a.events[a.events.length-1];let o=l&&l[1].type==="linePrefix"?l[2].sliceSerialize(l[1],!0).length:0,u=0;return f;function f(S){const k=a.containerState.type||(S===42||S===43||S===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!a.containerState.marker||S===a.containerState.marker:dg(S)){if(a.containerState.type||(a.containerState.type=k,e.enter(k,{_container:!0})),k==="listUnordered")return e.enter("listItemPrefix"),S===42||S===45?e.check(jd,n,h)(S):h(S);if(!a.interrupt||S===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),m(S)}return n(S)}function m(S){return dg(S)&&++u<10?(e.consume(S),m):(!a.interrupt||u<2)&&(a.containerState.marker?S===a.containerState.marker:S===41||S===46)?(e.exit("listItemValue"),h(S)):n(S)}function h(S){return e.enter("listItemMarker"),e.consume(S),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||S,e.check(Du,a.interrupt?n:g,e.attempt(oP,b,y))}function g(S){return a.containerState.initialBlankLine=!0,o++,b(S)}function y(S){return Xe(S)?(e.enter("listItemPrefixWhitespace"),e.consume(S),e.exit("listItemPrefixWhitespace"),b):n(S)}function b(S){return a.containerState.size=o+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(S)}}function dP(e,t,n){const a=this;return a.containerState._closeFlow=void 0,e.check(Du,l,o);function l(f){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,it(e,t,"listItemIndent",a.containerState.size+1)(f)}function o(f){return a.containerState.furtherBlankLines||!Xe(f)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,u(f)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt(uP,t,u)(f))}function u(f){return a.containerState._closeFlow=!0,a.interrupt=void 0,it(e,e.attempt($n,t,n),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function fP(e,t,n){const a=this;return it(e,l,"listItemIndent",a.containerState.size+1);function l(o){const u=a.events[a.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===a.containerState.size?t(o):n(o)}}function hP(e){e.exit(this.containerState.type)}function mP(e,t,n){const a=this;return it(e,l,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function l(o){const u=a.events[a.events.length-1];return!Xe(o)&&u&&u[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const hS={name:"setextUnderline",resolveTo:pP,tokenize:gP};function pP(e,t){let n=e.length,a,l,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){a=n;break}e[n][1].type==="paragraph"&&(l=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const u={type:"setextHeading",start:{...e[a][1].start},end:{...e[e.length-1][1].end}};return e[l][1].type="setextHeadingText",o?(e.splice(l,0,["enter",u,t]),e.splice(o+1,0,["exit",e[a][1],t]),e[a][1].end={...e[o][1].end}):e[a][1]=u,e.push(["exit",u,t]),e}function gP(e,t,n){const a=this;let l;return o;function o(h){let g=a.events.length,y;for(;g--;)if(a.events[g][1].type!=="lineEnding"&&a.events[g][1].type!=="linePrefix"&&a.events[g][1].type!=="content"){y=a.events[g][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||y)?(e.enter("setextHeadingLine"),l=h,u(h)):n(h)}function u(h){return e.enter("setextHeadingLineSequence"),f(h)}function f(h){return h===l?(e.consume(h),f):(e.exit("setextHeadingLineSequence"),Xe(h)?it(e,m,"lineSuffix")(h):m(h))}function m(h){return h===null||Re(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const yP={tokenize:vP};function vP(e){const t=this,n=e.attempt(Du,a,e.attempt(this.parser.constructs.flowInitial,l,it(e,e.attempt(this.parser.constructs.flow,l,e.attempt(k9,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 bP={resolveAll:GC()},xP=QC("string"),SP=QC("text");function QC(e){return{resolveAll:GC(e==="text"?wP:void 0),tokenize:t};function t(n){const a=this,l=this.parser.constructs[e],o=n.attempt(l,u,f);return u;function u(g){return h(g)?o(g):f(g)}function f(g){if(g===null){n.consume(g);return}return n.enter("data"),n.consume(g),m}function m(g){return h(g)?(n.exit("data"),o(g)):(n.consume(g),m)}function h(g){if(g===null)return!0;const y=l[g];let b=-1;if(y)for(;++b<y.length;){const S=y[b];if(!S.previous||S.previous.call(a,a.previous))return!0}return!1}}}function GC(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 wP(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const a=e[n-1][1],l=t.sliceStream(a);let o=l.length,u=-1,f=0,m;for(;o--;){const h=l[o];if(typeof h=="string"){for(u=h.length;h.charCodeAt(u-1)===32;)f++,u--;if(u)break;u=-1}else if(h===-2)m=!0,f++;else if(h!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(f=0),f){const h={type:n===e.length||m||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?u:a.start._bufferIndex+u,_index:a.start._index+o,line:a.end.line,column:a.end.column-f,offset:a.end.offset-f},end:{...a.end}};a.end={...h.start},a.start.offset===a.end.offset?Object.assign(a,h):(e.splice(n,0,["enter",h,t],["exit",h,t]),n+=2)}n++}return e}const kP={42:$n,43:$n,45:$n,48:$n,49:$n,50:$n,51:$n,52:$n,53:$n,54:$n,55:$n,56:$n,57:$n,62:BC},jP={91:_9},CP={[-2]:up,[-1]:up,32:up},EP={35:D9,42:jd,45:[hS,jd],60:U9,61:hS,95:jd,96:dS,126:dS},NP={38:FC,92:$C},_P={[-5]:cp,[-4]:cp,[-3]:cp,33:nP,38:FC,42:fg,60:[a9,Z9],91:aP,92:[R9,$C],93:hy,95:fg,96:y9},AP={null:[fg,bP]},TP={null:[42,95]},zP={null:[]},RP=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:TP,contentInitial:jP,disable:zP,document:kP,flow:EP,flowInitial:CP,insideSpan:AP,string:NP,text:_P},Symbol.toStringTag,{value:"Module"}));function OP(e,t,n){let a={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const l={},o=[];let u=[],f=[];const m={attempt:L(D),check:L(z),consume:A,enter:O,exit:M,interrupt:L(z,{interrupt:!0})},h={code:null,containerState:{},defineSkip:j,events:[],now:k,parser:e,previous:null,sliceSerialize:b,sliceStream:S,write:y};let g=t.tokenize.call(h,m);return t.resolveAll&&o.push(t),h;function y(oe){return u=xr(u,oe),E(),u[u.length-1]!==null?[]:(Z(t,0),h.events=gf(o,h.events,h),h.events)}function b(oe,W){return MP(S(oe),W)}function S(oe){return DP(u,oe)}function k(){const{_bufferIndex:oe,_index:W,line:me,column:fe,offset:ee}=a;return{_bufferIndex:oe,_index:W,line:me,column:fe,offset:ee}}function j(oe){l[oe.line]=oe.column,q()}function E(){let oe;for(;a._index<u.length;){const W=u[a._index];if(typeof W=="string")for(oe=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===oe&&a._bufferIndex<W.length;)C(W.charCodeAt(a._bufferIndex));else C(W)}}function C(oe){g=g(oe)}function A(oe){Re(oe)?(a.line++,a.column=1,a.offset+=oe===-3?2:1,q()):oe!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===u[a._index].length&&(a._bufferIndex=-1,a._index++)),h.previous=oe}function O(oe,W){const me=W||{};return me.type=oe,me.start=k(),h.events.push(["enter",me,h]),f.push(me),me}function M(oe){const W=f.pop();return W.end=k(),h.events.push(["exit",W,h]),W}function D(oe,W){Z(oe,W.from)}function z(oe,W){W.restore()}function L(oe,W){return me;function me(fe,ee,H){let re,K,he,T;return Array.isArray(fe)?P(fe):"tokenize"in fe?P([fe]):U(fe);function U(ue){return Se;function Se(Me){const ye=Me!==null&&ue[Me],ct=Me!==null&&ue.null,ae=[...Array.isArray(ye)?ye:ye?[ye]:[],...Array.isArray(ct)?ct:ct?[ct]:[]];return P(ae)(Me)}}function P(ue){return re=ue,K=0,ue.length===0?H:_(ue[K])}function _(ue){return Se;function Se(Me){return T=te(),he=ue,ue.partial||(h.currentConstruct=ue),ue.name&&h.parser.constructs.disable.null.includes(ue.name)?X():ue.tokenize.call(W?Object.assign(Object.create(h),W):h,m,$,X)(Me)}}function $(ue){return oe(he,T),ee}function X(ue){return T.restore(),++K<re.length?_(re[K]):H}}}function Z(oe,W){oe.resolveAll&&!o.includes(oe)&&o.push(oe),oe.resolve&&ir(h.events,W,h.events.length-W,oe.resolve(h.events.slice(W),h)),oe.resolveTo&&(h.events=oe.resolveTo(h.events,h))}function te(){const oe=k(),W=h.previous,me=h.currentConstruct,fe=h.events.length,ee=Array.from(f);return{from:fe,restore:H};function H(){a=oe,h.previous=W,h.currentConstruct=me,h.events.length=fe,f=ee,q()}}function q(){a.line in l&&a.column<2&&(a.column=l[a.line],a.offset+=l[a.line]-1)}}function DP(e,t){const n=t.start._index,a=t.start._bufferIndex,l=t.end._index,o=t.end._bufferIndex;let u;if(n===l)u=[e[n].slice(a,o)];else{if(u=e.slice(n,l),a>-1){const f=u[0];typeof f=="string"?u[0]=f.slice(a):u.shift()}o>0&&u.push(e[l].slice(0,o))}return u}function MP(e,t){let n=-1;const a=[];let l;for(;++n<e.length;){const o=e[n];let u;if(typeof o=="string")u=o;else switch(o){case-5:{u="\r";break}case-4:{u=`
350
+ `;break}case-3:{u=`\r
351
+ `;break}case-2:{u=t?" ":" ";break}case-1:{if(!t&&l)continue;u=" ";break}default:u=String.fromCharCode(o)}l=o===-2,a.push(u)}return a.join("")}function LP(e){const a={constructs:UC([RP,...(e||{}).extensions||[]]),content:l(XU),defined:[],document:l(WU),flow:l(yP),lazy:{},string:l(xP),text:l(SP)};return a;function l(o){return u;function u(f){return OP(a,o,f)}}}function IP(e){for(;!qC(e););return e}const mS=/[\0\t\n\r]/g;function UP(){let e=1,t="",n=!0,a;return l;function l(o,u,f){const m=[];let h,g,y,b,S;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(u||void 0).decode(o)),y=0,t="",n&&(o.charCodeAt(0)===65279&&y++,n=void 0);y<o.length;){if(mS.lastIndex=y,h=mS.exec(o),b=h&&h.index!==void 0?h.index:o.length,S=o.charCodeAt(b),!h){t=o.slice(y);break}if(S===10&&y===b&&a)m.push(-3),a=void 0;else switch(a&&(m.push(-5),a=void 0),y<b&&(m.push(o.slice(y,b)),e+=b-y),S){case 0:{m.push(65533),e++;break}case 9:{for(g=Math.ceil(e/4)*4,m.push(-2);e++<g;)m.push(-1);break}case 10:{m.push(-4),e=1;break}default:a=!0,e=1}y=b+1}return f&&(a&&m.push(-5),t&&m.push(t),m.push(null)),m}}const PP=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function BP(e){return e.replace(PP,$P)}function $P(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const l=n.charCodeAt(1),o=l===120||l===88;return PC(n.slice(o?2:1),o?16:10)}return fy(n)||e}const KC={}.hasOwnProperty;function FP(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),qP(n)(IP(LP(n).document().write(UP()(e,t,!0))))}function qP(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Mr),autolinkProtocol:te,autolinkEmail:te,atxHeading:o(Dt),blockQuote:o(ct),characterEscape:te,characterReference:te,codeFenced:o(ae),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:o(ae,u),codeText:o(De,u),codeTextData:te,data:te,codeFlowValue:te,definition:o(at),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:o(Pe),hardBreakEscape:o(un),hardBreakTrailing:o(un),htmlFlow:o(_a,u),htmlFlowData:te,htmlText:o(_a,u),htmlTextData:te,image:o(Sl),label:u,link:o(Mr),listItem:o(Ai),listItemValue:b,listOrdered:o(Aa,y),listUnordered:o(Aa),paragraph:o(Ys),reference:_,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:o(Dt),strong:o(Xs),thematicBreak:o(Js)},exit:{atxHeading:m(),atxHeadingSequence:D,autolink:m(),autolinkEmail:ye,autolinkProtocol:Me,blockQuote:m(),characterEscapeValue:q,characterReferenceMarkerHexadecimal:X,characterReferenceMarkerNumeric:X,characterReferenceValue:ue,characterReference:Se,codeFenced:m(E),codeFencedFence:j,codeFencedFenceInfo:S,codeFencedFenceMeta:k,codeFlowValue:q,codeIndented:m(C),codeText:m(ee),codeTextData:q,data:q,definition:m(),definitionDestinationString:M,definitionLabelString:A,definitionTitleString:O,emphasis:m(),hardBreakEscape:m(W),hardBreakTrailing:m(W),htmlFlow:m(me),htmlFlowData:q,htmlText:m(fe),htmlTextData:q,image:m(re),label:he,labelText:K,lineEnding:oe,link:m(H),listItem:m(),listOrdered:m(),listUnordered:m(),paragraph:m(),referenceString:$,resourceDestinationString:T,resourceTitleString:U,resource:P,setextHeading:m(Z),setextHeadingLineSequence:L,setextHeadingText:z,strong:m(),thematicBreak:m()}};YC(t,(e||{}).mdastExtensions||[]);const n={};return a;function a(ie){let ve={type:"root",children:[]};const ze={stack:[ve],tokenStack:[],config:t,enter:f,exit:h,buffer:u,resume:g,data:n},$e=[];let lt=-1;for(;++lt<ie.length;)if(ie[lt][1].type==="listOrdered"||ie[lt][1].type==="listUnordered")if(ie[lt][0]==="enter")$e.push(lt);else{const dn=$e.pop();lt=l(ie,dn,lt)}for(lt=-1;++lt<ie.length;){const dn=t[ie[lt][0]];KC.call(dn,ie[lt][1].type)&&dn[ie[lt][1].type].call(Object.assign({sliceSerialize:ie[lt][2].sliceSerialize},ze),ie[lt][1])}if(ze.tokenStack.length>0){const dn=ze.tokenStack[ze.tokenStack.length-1];(dn[1]||pS).call(ze,void 0,dn[0])}for(ve.position={start:ri(ie.length>0?ie[0][1].start:{line:1,column:1,offset:0}),end:ri(ie.length>0?ie[ie.length-2][1].end:{line:1,column:1,offset:0})},lt=-1;++lt<t.transforms.length;)ve=t.transforms[lt](ve)||ve;return ve}function l(ie,ve,ze){let $e=ve-1,lt=-1,dn=!1,Er,an,Mt,fn;for(;++$e<=ze;){const ft=ie[$e];switch(ft[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ft[0]==="enter"?lt++:lt--,fn=void 0;break}case"lineEndingBlank":{ft[0]==="enter"&&(Er&&!fn&&!lt&&!Mt&&(Mt=$e),fn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:fn=void 0}if(!lt&&ft[0]==="enter"&&ft[1].type==="listItemPrefix"||lt===-1&&ft[0]==="exit"&&(ft[1].type==="listUnordered"||ft[1].type==="listOrdered")){if(Er){let Nr=$e;for(an=void 0;Nr--;){const Rn=ie[Nr];if(Rn[1].type==="lineEnding"||Rn[1].type==="lineEndingBlank"){if(Rn[0]==="exit")continue;an&&(ie[an][1].type="lineEndingBlank",dn=!0),Rn[1].type="lineEnding",an=Nr}else if(!(Rn[1].type==="linePrefix"||Rn[1].type==="blockQuotePrefix"||Rn[1].type==="blockQuotePrefixWhitespace"||Rn[1].type==="blockQuoteMarker"||Rn[1].type==="listItemIndent"))break}Mt&&(!an||Mt<an)&&(Er._spread=!0),Er.end=Object.assign({},an?ie[an][1].start:ft[1].end),ie.splice(an||$e,0,["exit",Er,ft[2]]),$e++,ze++}if(ft[1].type==="listItemPrefix"){const Nr={type:"listItem",_spread:!1,start:Object.assign({},ft[1].start),end:void 0};Er=Nr,ie.splice($e,0,["enter",Nr,ft[2]]),$e++,ze++,Mt=void 0,fn=!0}}}return ie[ve][1]._spread=dn,ze}function o(ie,ve){return ze;function ze($e){f.call(this,ie($e),$e),ve&&ve.call(this,$e)}}function u(){this.stack.push({type:"fragment",children:[]})}function f(ie,ve,ze){this.stack[this.stack.length-1].children.push(ie),this.stack.push(ie),this.tokenStack.push([ve,ze||void 0]),ie.position={start:ri(ve.start),end:void 0}}function m(ie){return ve;function ve(ze){ie&&ie.call(this,ze),h.call(this,ze)}}function h(ie,ve){const ze=this.stack.pop(),$e=this.tokenStack.pop();if($e)$e[0].type!==ie.type&&(ve?ve.call(this,ie,$e[0]):($e[1]||pS).call(this,ie,$e[0]));else throw new Error("Cannot close `"+ie.type+"` ("+iu({start:ie.start,end:ie.end})+"): it’s not open");ze.position.end=ri(ie.end)}function g(){return dy(this.stack.pop())}function y(){this.data.expectingFirstListItemValue=!0}function b(ie){if(this.data.expectingFirstListItemValue){const ve=this.stack[this.stack.length-2];ve.start=Number.parseInt(this.sliceSerialize(ie),10),this.data.expectingFirstListItemValue=void 0}}function S(){const ie=this.resume(),ve=this.stack[this.stack.length-1];ve.lang=ie}function k(){const ie=this.resume(),ve=this.stack[this.stack.length-1];ve.meta=ie}function j(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function E(){const ie=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ie.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function C(){const ie=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ie.replace(/(\r?\n|\r)$/g,"")}function A(ie){const ve=this.resume(),ze=this.stack[this.stack.length-1];ze.label=ve,ze.identifier=Or(this.sliceSerialize(ie)).toLowerCase()}function O(){const ie=this.resume(),ve=this.stack[this.stack.length-1];ve.title=ie}function M(){const ie=this.resume(),ve=this.stack[this.stack.length-1];ve.url=ie}function D(ie){const ve=this.stack[this.stack.length-1];if(!ve.depth){const ze=this.sliceSerialize(ie).length;ve.depth=ze}}function z(){this.data.setextHeadingSlurpLineEnding=!0}function L(ie){const ve=this.stack[this.stack.length-1];ve.depth=this.sliceSerialize(ie).codePointAt(0)===61?1:2}function Z(){this.data.setextHeadingSlurpLineEnding=void 0}function te(ie){const ze=this.stack[this.stack.length-1].children;let $e=ze[ze.length-1];(!$e||$e.type!=="text")&&($e=cn(),$e.position={start:ri(ie.start),end:void 0},ze.push($e)),this.stack.push($e)}function q(ie){const ve=this.stack.pop();ve.value+=this.sliceSerialize(ie),ve.position.end=ri(ie.end)}function oe(ie){const ve=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ze=ve.children[ve.children.length-1];ze.position.end=ri(ie.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ve.type)&&(te.call(this,ie),q.call(this,ie))}function W(){this.data.atHardBreak=!0}function me(){const ie=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ie}function fe(){const ie=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ie}function ee(){const ie=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ie}function H(){const ie=this.stack[this.stack.length-1];if(this.data.inReference){const ve=this.data.referenceType||"shortcut";ie.type+="Reference",ie.referenceType=ve,delete ie.url,delete ie.title}else delete ie.identifier,delete ie.label;this.data.referenceType=void 0}function re(){const ie=this.stack[this.stack.length-1];if(this.data.inReference){const ve=this.data.referenceType||"shortcut";ie.type+="Reference",ie.referenceType=ve,delete ie.url,delete ie.title}else delete ie.identifier,delete ie.label;this.data.referenceType=void 0}function K(ie){const ve=this.sliceSerialize(ie),ze=this.stack[this.stack.length-2];ze.label=BP(ve),ze.identifier=Or(ve).toLowerCase()}function he(){const ie=this.stack[this.stack.length-1],ve=this.resume(),ze=this.stack[this.stack.length-1];if(this.data.inReference=!0,ze.type==="link"){const $e=ie.children;ze.children=$e}else ze.alt=ve}function T(){const ie=this.resume(),ve=this.stack[this.stack.length-1];ve.url=ie}function U(){const ie=this.resume(),ve=this.stack[this.stack.length-1];ve.title=ie}function P(){this.data.inReference=void 0}function _(){this.data.referenceType="collapsed"}function $(ie){const ve=this.resume(),ze=this.stack[this.stack.length-1];ze.label=ve,ze.identifier=Or(this.sliceSerialize(ie)).toLowerCase(),this.data.referenceType="full"}function X(ie){this.data.characterReferenceType=ie.type}function ue(ie){const ve=this.sliceSerialize(ie),ze=this.data.characterReferenceType;let $e;ze?($e=PC(ve,ze==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):$e=fy(ve);const lt=this.stack[this.stack.length-1];lt.value+=$e}function Se(ie){const ve=this.stack.pop();ve.position.end=ri(ie.end)}function Me(ie){q.call(this,ie);const ve=this.stack[this.stack.length-1];ve.url=this.sliceSerialize(ie)}function ye(ie){q.call(this,ie);const ve=this.stack[this.stack.length-1];ve.url="mailto:"+this.sliceSerialize(ie)}function ct(){return{type:"blockquote",children:[]}}function ae(){return{type:"code",lang:null,meta:null,value:""}}function De(){return{type:"inlineCode",value:""}}function at(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Pe(){return{type:"emphasis",children:[]}}function Dt(){return{type:"heading",depth:0,children:[]}}function un(){return{type:"break"}}function _a(){return{type:"html",value:""}}function Sl(){return{type:"image",title:null,url:"",alt:null}}function Mr(){return{type:"link",title:null,url:"",children:[]}}function Aa(ie){return{type:"list",ordered:ie.type==="listOrdered",start:null,spread:ie._spread,children:[]}}function Ai(ie){return{type:"listItem",spread:ie._spread,checked:null,children:[]}}function Ys(){return{type:"paragraph",children:[]}}function Xs(){return{type:"strong",children:[]}}function cn(){return{type:"text",value:""}}function Js(){return{type:"thematicBreak"}}}function ri(e){return{line:e.line,column:e.column,offset:e.offset}}function YC(e,t){let n=-1;for(;++n<t.length;){const a=t[n];Array.isArray(a)?YC(e,a):HP(e,a)}}function HP(e,t){let n;for(n in t)if(KC.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 pS(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+iu({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+iu({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+iu({start:t.start,end:t.end})+") is still open")}function ZP(e){const t=this;t.parser=n;function n(a){return FP(a,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function VP(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 QP(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
352
+ `}]}function GP(e,t){const n=t.value?t.value+`
353
+ `:"",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 KP(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function YP(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function XP(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),l=Ks(a.toLowerCase()),o=e.footnoteOrder.indexOf(a);let u,f=e.footnoteCounts.get(a);f===void 0?(f=0,e.footnoteOrder.push(a),u=e.footnoteOrder.length):u=o+1,f+=1,e.footnoteCounts.set(a,f);const m={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+l,id:n+"fnref-"+l+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(u)}]};e.patch(t,m);const h={type:"element",tagName:"sup",properties:{},children:[m]};return e.patch(t,h),e.applyData(t,h)}function JP(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 WP(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function XC(e,t){const n=t.referenceType;let a="]";if(n==="collapsed"?a+="[]":n==="full"&&(a+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+a}];const l=e.all(t),o=l[0];o&&o.type==="text"?o.value="["+o.value:l.unshift({type:"text",value:"["});const u=l[l.length-1];return u&&u.type==="text"?u.value+=a:l.push({type:"text",value:a}),l}function e8(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return XC(e,t);const l={src:Ks(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 t8(e,t){const n={src:Ks(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 n8(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 r8(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return XC(e,t);const l={href:Ks(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 a8(e,t){const n={href:Ks(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 i8(e,t,n){const a=e.all(t),l=n?l8(n):JC(t),o={},u=[];if(typeof t.checked=="boolean"){const g=a[0];let y;g&&g.type==="element"&&g.tagName==="p"?y=g:(y={type:"element",tagName:"p",properties:{},children:[]},a.unshift(y)),y.children.length>0&&y.children.unshift({type:"text",value:" "}),y.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let f=-1;for(;++f<a.length;){const g=a[f];(l||f!==0||g.type!=="element"||g.tagName!=="p")&&u.push({type:"text",value:`
354
+ `}),g.type==="element"&&g.tagName==="p"&&!l?u.push(...g.children):u.push(g)}const m=a[a.length-1];m&&(l||m.type!=="element"||m.tagName!=="p")&&u.push({type:"text",value:`
355
+ `});const h={type:"element",tagName:"li",properties:o,children:u};return e.patch(t,h),e.applyData(t,h)}function l8(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=JC(n[a])}return t}function JC(e){const t=e.spread;return t??e.children.length>1}function s8(e,t){const n={},a=e.all(t);let l=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++l<a.length;){const u=a[l];if(u.type==="element"&&u.tagName==="li"&&u.properties&&Array.isArray(u.properties.className)&&u.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(a,!0)};return e.patch(t,o),e.applyData(t,o)}function o8(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function u8(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function c8(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function d8(e,t){const n=e.all(t),a=n.shift(),l=[];if(a){const u={type:"element",tagName:"thead",properties:{},children:e.wrap([a],!0)};e.patch(t.children[0],u),l.push(u)}if(n.length>0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},f=sy(t.children[1]),m=zC(t.children[t.children.length-1]);f&&m&&(u.position={start:f,end:m}),l.push(u)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(l,!0)};return e.patch(t,o),e.applyData(t,o)}function f8(e,t,n){const a=n?n.children:void 0,o=(a?a.indexOf(t):1)===0?"th":"td",u=n&&n.type==="table"?n.align:void 0,f=u?u.length:t.children.length;let m=-1;const h=[];for(;++m<f;){const y=t.children[m],b={},S=u?u[m]:void 0;S&&(b.align=S);let k={type:"element",tagName:o,properties:b,children:[]};y&&(k.children=e.all(y),e.patch(y,k),k=e.applyData(y,k)),h.push(k)}const g={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,g),e.applyData(t,g)}function h8(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const gS=9,yS=32;function m8(e){const t=String(e),n=/\r?\n|\r/g;let a=n.exec(t),l=0;const o=[];for(;a;)o.push(vS(t.slice(l,a.index),l>0,!0),a[0]),l=a.index+a[0].length,a=n.exec(t);return o.push(vS(t.slice(l),l>0,!1)),o.join("")}function vS(e,t,n){let a=0,l=e.length;if(t){let o=e.codePointAt(a);for(;o===gS||o===yS;)a++,o=e.codePointAt(a)}if(n){let o=e.codePointAt(l-1);for(;o===gS||o===yS;)l--,o=e.codePointAt(l-1)}return l>a?e.slice(a,l):""}function p8(e,t){const n={type:"text",value:m8(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function g8(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const y8={blockquote:VP,break:QP,code:GP,delete:KP,emphasis:YP,footnoteReference:XP,heading:JP,html:WP,imageReference:e8,image:t8,inlineCode:n8,linkReference:r8,link:a8,listItem:i8,list:s8,paragraph:o8,root:u8,strong:c8,table:d8,tableCell:h8,tableRow:f8,text:p8,thematicBreak:g8,toml:cd,yaml:cd,definition:cd,footnoteDefinition:cd};function cd(){}const WC=-1,yf=0,su=1,Ud=2,my=3,py=4,gy=5,yy=6,eE=7,tE=8,bS=typeof self=="object"?self:globalThis,v8=(e,t)=>{const n=(l,o)=>(e.set(o,l),l),a=l=>{if(e.has(l))return e.get(l);const[o,u]=t[l];switch(o){case yf:case WC:return n(u,l);case su:{const f=n([],l);for(const m of u)f.push(a(m));return f}case Ud:{const f=n({},l);for(const[m,h]of u)f[a(m)]=a(h);return f}case my:return n(new Date(u),l);case py:{const{source:f,flags:m}=u;return n(new RegExp(f,m),l)}case gy:{const f=n(new Map,l);for(const[m,h]of u)f.set(a(m),a(h));return f}case yy:{const f=n(new Set,l);for(const m of u)f.add(a(m));return f}case eE:{const{name:f,message:m}=u;return n(new bS[f](m),l)}case tE:return n(BigInt(u),l);case"BigInt":return n(Object(BigInt(u)),l);case"ArrayBuffer":return n(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:f}=new Uint8Array(u);return n(new DataView(f),u)}}return n(new bS[o](u),l)};return a},xS=e=>v8(new Map,e)(0),cs="",{toString:b8}={},{keys:x8}=Object,Jo=e=>{const t=typeof e;if(t!=="object"||!e)return[yf,t];const n=b8.call(e).slice(8,-1);switch(n){case"Array":return[su,cs];case"Object":return[Ud,cs];case"Date":return[my,cs];case"RegExp":return[py,cs];case"Map":return[gy,cs];case"Set":return[yy,cs];case"DataView":return[su,n]}return n.includes("Array")?[su,n]:n.includes("Error")?[eE,n]:[Ud,n]},dd=([e,t])=>e===yf&&(t==="function"||t==="symbol"),S8=(e,t,n,a)=>{const l=(u,f)=>{const m=a.push(u)-1;return n.set(f,m),m},o=u=>{if(n.has(u))return n.get(u);let[f,m]=Jo(u);switch(f){case yf:{let g=u;switch(m){case"bigint":f=tE,g=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+m);g=null;break;case"undefined":return l([WC],u)}return l([f,g],u)}case su:{if(m){let b=u;return m==="DataView"?b=new Uint8Array(u.buffer):m==="ArrayBuffer"&&(b=new Uint8Array(u)),l([m,[...b]],u)}const g=[],y=l([f,g],u);for(const b of u)g.push(o(b));return y}case Ud:{if(m)switch(m){case"BigInt":return l([m,u.toString()],u);case"Boolean":case"Number":case"String":return l([m,u.valueOf()],u)}if(t&&"toJSON"in u)return o(u.toJSON());const g=[],y=l([f,g],u);for(const b of x8(u))(e||!dd(Jo(u[b])))&&g.push([o(b),o(u[b])]);return y}case my:return l([f,u.toISOString()],u);case py:{const{source:g,flags:y}=u;return l([f,{source:g,flags:y}],u)}case gy:{const g=[],y=l([f,g],u);for(const[b,S]of u)(e||!(dd(Jo(b))||dd(Jo(S))))&&g.push([o(b),o(S)]);return y}case yy:{const g=[],y=l([f,g],u);for(const b of u)(e||!dd(Jo(b)))&&g.push(o(b));return y}}const{message:h}=u;return l([f,{name:m,message:h}],u)};return o},SS=(e,{json:t,lossy:n}={})=>{const a=[];return S8(!(t||n),!!t,new Map,a)(e),a},Pd=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?xS(SS(e,t)):structuredClone(e):(e,t)=>xS(SS(e,t));function w8(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 k8(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function j8(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||w8,a=e.options.footnoteBackLabel||k8,l=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",u=e.options.footnoteLabelProperties||{className:["sr-only"]},f=[];let m=-1;for(;++m<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[m]);if(!h)continue;const g=e.all(h),y=String(h.identifier).toUpperCase(),b=Ks(y.toLowerCase());let S=0;const k=[],j=e.footnoteCounts.get(y);for(;j!==void 0&&++S<=j;){k.length>0&&k.push({type:"text",value:" "});let A=typeof n=="string"?n:n(m,S);typeof A=="string"&&(A={type:"text",value:A}),k.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+b+(S>1?"-"+S:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(m,S),className:["data-footnote-backref"]},children:Array.isArray(A)?A:[A]})}const E=g[g.length-1];if(E&&E.type==="element"&&E.tagName==="p"){const A=E.children[E.children.length-1];A&&A.type==="text"?A.value+=" ":E.children.push({type:"text",value:" "}),E.children.push(...k)}else g.push(...k);const C={type:"element",tagName:"li",properties:{id:t+"fn-"+b},children:e.wrap(g,!0)};e.patch(h,C),f.push(C)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Pd(u),id:"footnote-label"},children:[{type:"text",value:l}]},{type:"text",value:`
356
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
357
+ `}]}}const vf=(function(e){if(e==null)return _8;if(typeof e=="function")return bf(e);if(typeof e=="object")return Array.isArray(e)?C8(e):E8(e);if(typeof e=="string")return N8(e);throw new Error("Expected function, string, or object as test")});function C8(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=vf(e[n]);return bf(a);function a(...l){let o=-1;for(;++o<t.length;)if(t[o].apply(this,l))return!0;return!1}}function E8(e){const t=e;return bf(n);function n(a){const l=a;let o;for(o in e)if(l[o]!==t[o])return!1;return!0}}function N8(e){return bf(t);function t(n){return n&&n.type===e}}function bf(e){return t;function t(n,a,l){return!!(A8(n)&&e.call(this,n,typeof a=="number"?a:void 0,l||void 0))}}function _8(){return!0}function A8(e){return e!==null&&typeof e=="object"&&"type"in e}const nE=[],T8=!0,hg=!1,z8="skip";function rE(e,t,n,a){let l;typeof t=="function"&&typeof n!="function"?(a=n,n=t):l=t;const o=vf(l),u=a?-1:1;f(e,void 0,[])();function f(m,h,g){const y=m&&typeof m=="object"?m:{};if(typeof y.type=="string"){const S=typeof y.tagName=="string"?y.tagName:typeof y.name=="string"?y.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(m.type+(S?"<"+S+">":""))+")"})}return b;function b(){let S=nE,k,j,E;if((!t||o(m,h,g[g.length-1]||void 0))&&(S=R8(n(m,g)),S[0]===hg))return S;if("children"in m&&m.children){const C=m;if(C.children&&S[0]!==z8)for(j=(a?C.children.length:-1)+u,E=g.concat(C);j>-1&&j<C.children.length;){const A=C.children[j];if(k=f(A,j,E)(),k[0]===hg)return k;j=typeof k[1]=="number"?k[1]:j+u}}return S}}}function R8(e){return Array.isArray(e)?e:typeof e=="number"?[T8,e]:e==null?nE:[e]}function vy(e,t,n,a){let l,o,u;typeof t=="function"&&typeof n!="function"?(o=void 0,u=t,l=n):(o=t,u=n,l=a),rE(e,o,f,l);function f(m,h){const g=h[h.length-1],y=g?g.children.indexOf(m):void 0;return u(m,y,g)}}const mg={}.hasOwnProperty,O8={};function D8(e,t){const n=t||O8,a=new Map,l=new Map,o=new Map,u={...y8,...n.handlers},f={all:h,applyData:L8,definitionById:a,footnoteById:l,footnoteCounts:o,footnoteOrder:[],handlers:u,one:m,options:n,patch:M8,wrap:U8};return vy(e,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const y=g.type==="definition"?a:l,b=String(g.identifier).toUpperCase();y.has(b)||y.set(b,g)}}),f;function m(g,y){const b=g.type,S=f.handlers[b];if(mg.call(f.handlers,b)&&S)return S(f,g,y);if(f.options.passThrough&&f.options.passThrough.includes(b)){if("children"in g){const{children:j,...E}=g,C=Pd(E);return C.children=f.all(g),C}return Pd(g)}return(f.options.unknownHandler||I8)(f,g,y)}function h(g){const y=[];if("children"in g){const b=g.children;let S=-1;for(;++S<b.length;){const k=f.one(b[S],g);if(k){if(S&&b[S-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=wS(k.value)),!Array.isArray(k)&&k.type==="element")){const j=k.children[0];j&&j.type==="text"&&(j.value=wS(j.value))}Array.isArray(k)?y.push(...k):y.push(k)}}}return y}}function M8(e,t){e.position&&(t.position=kU(e))}function L8(e,t){let n=t;if(e&&e.data){const a=e.data.hName,l=e.data.hChildren,o=e.data.hProperties;if(typeof a=="string")if(n.type==="element")n.tagName=a;else{const u="children"in n?n.children:[n];n={type:"element",tagName:a,properties:{},children:u}}n.type==="element"&&o&&Object.assign(n.properties,Pd(o)),"children"in n&&n.children&&l!==null&&l!==void 0&&(n.children=l)}return n}function I8(e,t){const n=t.data||{},a="value"in t&&!(mg.call(n,"hProperties")||mg.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 U8(e,t){const n=[];let a=-1;for(t&&n.push({type:"text",value:`
358
+ `});++a<e.length;)a&&n.push({type:"text",value:`
359
+ `}),n.push(e[a]);return t&&e.length>0&&n.push({type:"text",value:`
360
+ `}),n}function wS(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function kS(e,t){const n=D8(e,t),a=n.one(e,void 0),l=j8(n),o=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return l&&o.children.push({type:"text",value:`
361
+ `},l),o}function P8(e,t){return e&&"run"in e?async function(n,a){const l=kS(n,{file:a,...t});await e.run(l,a)}:function(n,a){return kS(n,{file:a,...e||t})}}function jS(e){if(e)throw e}var dp,CS;function B8(){if(CS)return dp;CS=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,a=Object.getOwnPropertyDescriptor,l=function(h){return typeof Array.isArray=="function"?Array.isArray(h):t.call(h)==="[object Array]"},o=function(h){if(!h||t.call(h)!=="[object Object]")return!1;var g=e.call(h,"constructor"),y=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!g&&!y)return!1;var b;for(b in h);return typeof b>"u"||e.call(h,b)},u=function(h,g){n&&g.name==="__proto__"?n(h,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):h[g.name]=g.newValue},f=function(h,g){if(g==="__proto__")if(e.call(h,g)){if(a)return a(h,g).value}else return;return h[g]};return dp=function m(){var h,g,y,b,S,k,j=arguments[0],E=1,C=arguments.length,A=!1;for(typeof j=="boolean"&&(A=j,j=arguments[1]||{},E=2),(j==null||typeof j!="object"&&typeof j!="function")&&(j={});E<C;++E)if(h=arguments[E],h!=null)for(g in h)y=f(j,g),b=f(h,g),j!==b&&(A&&b&&(o(b)||(S=l(b)))?(S?(S=!1,k=y&&l(y)?y:[]):k=y&&o(y)?y:{},u(j,{name:g,newValue:m(A,k,b)})):typeof b<"u"&&u(j,{name:g,newValue:b}));return j},dp}var $8=B8();const fp=$d($8);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 F8(){const e=[],t={run:n,use:a};return t;function n(...l){let o=-1;const u=l.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);f(null,...l);function f(m,...h){const g=e[++o];let y=-1;if(m){u(m);return}for(;++y<l.length;)(h[y]===null||h[y]===void 0)&&(h[y]=l[y]);l=h,g?q8(g,f)(...h):u(null,...h)}}function a(l){if(typeof l!="function")throw new TypeError("Expected `middelware` to be a function, not "+l);return e.push(l),t}}function q8(e,t){let n;return a;function a(...u){const f=e.length>u.length;let m;f&&u.push(l);try{m=e.apply(this,u)}catch(h){const g=h;if(f&&n)throw g;return l(g)}f||(m&&m.then&&typeof m.then=="function"?m.then(o,l):m instanceof Error?l(m):o(m))}function l(u,...f){n||(n=!0,t(u,...f))}function o(u){l(null,u)}}const $r={basename:H8,dirname:Z8,extname:V8,join:Q8,sep:"/"};function H8(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Mu(e);let n=0,a=-1,l=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;l--;)if(e.codePointAt(l)===47){if(o){n=l+1;break}}else a<0&&(o=!0,a=l+1);return a<0?"":e.slice(n,a)}if(t===e)return"";let u=-1,f=t.length-1;for(;l--;)if(e.codePointAt(l)===47){if(o){n=l+1;break}}else u<0&&(o=!0,u=l+1),f>-1&&(e.codePointAt(l)===t.codePointAt(f--)?f<0&&(a=l):(f=-1,a=u));return n===a?a=u:a<0&&(a=e.length),e.slice(n,a)}function Z8(e){if(Mu(e),e.length===0)return".";let t=-1,n=e.length,a;for(;--n;)if(e.codePointAt(n)===47){if(a){t=n;break}}else a||(a=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function V8(e){Mu(e);let t=e.length,n=-1,a=0,l=-1,o=0,u;for(;t--;){const f=e.codePointAt(t);if(f===47){if(u){a=t+1;break}continue}n<0&&(u=!0,n=t+1),f===46?l<0?l=t:o!==1&&(o=1):l>-1&&(o=-1)}return l<0||n<0||o===0||o===1&&l===n-1&&l===a+1?"":e.slice(l,n)}function Q8(...e){let t=-1,n;for(;++t<e.length;)Mu(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":G8(n)}function G8(e){Mu(e);const t=e.codePointAt(0)===47;let n=K8(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function K8(e,t){let n="",a=0,l=-1,o=0,u=-1,f,m;for(;++u<=e.length;){if(u<e.length)f=e.codePointAt(u);else{if(f===47)break;f=47}if(f===47){if(!(l===u-1||o===1))if(l!==u-1&&o===2){if(n.length<2||a!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(m=n.lastIndexOf("/"),m!==n.length-1){m<0?(n="",a=0):(n=n.slice(0,m),a=n.length-1-n.lastIndexOf("/")),l=u,o=0;continue}}else if(n.length>0){n="",a=0,l=u,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",a=2)}else n.length>0?n+="/"+e.slice(l+1,u):n=e.slice(l+1,u),a=u-l-1;l=u,o=0}else f===46&&o>-1?o++:o=-1}return n}function Mu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Y8={cwd:X8};function X8(){return"/"}function gg(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function J8(e){if(typeof e=="string")e=new URL(e);else if(!gg(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 W8(e)}function W8(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 hp=["history","path","basename","stem","extname","dirname"];class aE{constructor(t){let n;t?gg(t)?n={path:t}:typeof t=="string"||eB(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Y8.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<hp.length;){const o=hp[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)hp.includes(l)||(this[l]=n[l])}get basename(){return typeof this.path=="string"?$r.basename(this.path):void 0}set basename(t){pp(t,"basename"),mp(t,"basename"),this.path=$r.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?$r.dirname(this.path):void 0}set dirname(t){ES(this.basename,"dirname"),this.path=$r.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?$r.extname(this.path):void 0}set extname(t){if(mp(t,"extname"),ES(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=$r.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){gg(t)&&(t=J8(t)),pp(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?$r.basename(this.path,this.extname):void 0}set stem(t){pp(t,"stem"),mp(t,"stem"),this.path=$r.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 jn(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 mp(e,t){if(e&&e.includes($r.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+$r.sep+"`")}function pp(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function ES(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function eB(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const tB=(function(e){const a=this.constructor.prototype,l=a[e],o=function(){return l.apply(o,arguments)};return Object.setPrototypeOf(o,a),o}),nB={}.hasOwnProperty;class by extends tB{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=F8()}copy(){const t=new by;let n=-1;for(;++n<this.attachers.length;){const a=this.attachers[n];t.use(...a)}return t.data(fp(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(vp("data",this.frozen),this.namespace[t]=n,this):nB.call(this.namespace,t)&&this.namespace[t]||void 0:t?(vp("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=fd(t),a=this.parser||this.Parser;return gp("parse",a),a(String(n),n)}process(t,n){const a=this;return this.freeze(),gp("process",this.parser||this.Parser),yp("process",this.compiler||this.Compiler),n?l(void 0,n):new Promise(l);function l(o,u){const f=fd(t),m=a.parse(f);a.run(m,f,function(g,y,b){if(g||!y||!b)return h(g);const S=y,k=a.stringify(S,b);iB(k)?b.value=k:b.result=k,h(g,b)});function h(g,y){g||!y?u(g):o?o(y):n(void 0,y)}}}processSync(t){let n=!1,a;return this.freeze(),gp("processSync",this.parser||this.Parser),yp("processSync",this.compiler||this.Compiler),this.process(t,l),_S("processSync","process",n),a;function l(o,u){n=!0,jS(o),a=u}}run(t,n,a){NS(t),this.freeze();const l=this.transformers;return!a&&typeof n=="function"&&(a=n,n=void 0),a?o(void 0,a):new Promise(o);function o(u,f){const m=fd(n);l.run(t,m,h);function h(g,y,b){const S=y||t;g?f(g):u?u(S):a(void 0,S,b)}}}runSync(t,n){let a=!1,l;return this.run(t,n,o),_S("runSync","run",a),l;function o(u,f){jS(u),l=f,a=!0}}stringify(t,n){this.freeze();const a=fd(n),l=this.compiler||this.Compiler;return yp("stringify",l),NS(t),l(t,a)}use(t,...n){const a=this.attachers,l=this.namespace;if(vp("use",this.frozen),t!=null)if(typeof t=="function")m(t,n);else if(typeof t=="object")Array.isArray(t)?f(t):u(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(h){if(typeof h=="function")m(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[g,...y]=h;m(g,y)}else u(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function u(h){if(!("plugins"in h)&&!("settings"in h))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");f(h.plugins),h.settings&&(l.settings=fp(!0,l.settings,h.settings))}function f(h){let g=-1;if(h!=null)if(Array.isArray(h))for(;++g<h.length;){const y=h[g];o(y)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function m(h,g){let y=-1,b=-1;for(;++y<a.length;)if(a[y][0]===h){b=y;break}if(b===-1)a.push([h,...g]);else if(g.length>0){let[S,...k]=g;const j=a[b][1];pg(j)&&pg(S)&&(S=fp(!0,j,S)),a[b]=[h,S,...k]}}}}const rB=new by().freeze();function gp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function yp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function vp(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 NS(e){if(!pg(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function _S(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function fd(e){return aB(e)?e:new aE(e)}function aB(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function iB(e){return typeof e=="string"||lB(e)}function lB(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const sB="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",AS=[],TS={allowDangerousHtml:!0},oB=/^(https?|ircs?|mailto|xmpp)$/i,uB=[{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 cB(e){const t=dB(e),n=fB(e);return hB(t.runSync(t.parse(n),n),e)}function dB(e){const t=e.rehypePlugins||AS,n=e.remarkPlugins||AS,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...TS}:TS;return rB().use(ZP).use(n).use(P8,a).use(t)}function fB(e){const t=e.children||"",n=new aE;return typeof t=="string"&&(n.value=t),n}function hB(e,t){const n=t.allowedElements,a=t.allowElement,l=t.components,o=t.disallowedElements,u=t.skipHtml,f=t.unwrapDisallowed,m=t.urlTransform||mB;for(const g of uB)Object.hasOwn(t,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+sB+g.id,void 0);return vy(e,h),_U(e,{Fragment:c.Fragment,components:l,ignoreInvalidStyle:!0,jsx:c.jsx,jsxs:c.jsxs,passKeys:!0,passNode:!0});function h(g,y,b){if(g.type==="raw"&&b&&typeof y=="number")return u?b.children.splice(y,1):b.children[y]={type:"text",value:g.value},y;if(g.type==="element"){let S;for(S in op)if(Object.hasOwn(op,S)&&Object.hasOwn(g.properties,S)){const k=g.properties[S],j=op[S];(j===null||j.includes(g.tagName))&&(g.properties[S]=m(String(k||""),S,g))}}if(g.type==="element"){let S=n?!n.includes(g.tagName):o?o.includes(g.tagName):!1;if(!S&&a&&typeof y=="number"&&(S=!a(g,y,b)),S&&b&&typeof y=="number")return f&&g.children?b.children.splice(y,1,...g.children):b.children.splice(y,1),y}}}function mB(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||oB.test(e.slice(0,t))?e:""}function pB(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function iE(e,t,n){const l=vf((n||{}).ignore||[]),o=gB(t);let u=-1;for(;++u<o.length;)rE(e,"text",f);function f(h,g){let y=-1,b;for(;++y<g.length;){const S=g[y],k=b?b.children:void 0;if(l(S,k?k.indexOf(S):void 0,b))return;b=S}if(b)return m(h,g)}function m(h,g){const y=g[g.length-1],b=o[u][0],S=o[u][1];let k=0;const E=y.children.indexOf(h);let C=!1,A=[];b.lastIndex=0;let O=b.exec(h.value);for(;O;){const M=O.index,D={index:O.index,input:O.input,stack:[...g,h]};let z=S(...O,D);if(typeof z=="string"&&(z=z.length>0?{type:"text",value:z}:void 0),z===!1?b.lastIndex=M+1:(k!==M&&A.push({type:"text",value:h.value.slice(k,M)}),Array.isArray(z)?A.push(...z):z&&A.push(z),k=M+O[0].length,C=!0),!b.global)break;O=b.exec(h.value)}return C?(k<h.value.length&&A.push({type:"text",value:h.value.slice(k)}),y.children.splice(E,1,...A)):A=[h],E+A.length}}function gB(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([yB(l[0]),vB(l[1])])}return t}function yB(e){return typeof e=="string"?new RegExp(pB(e),"g"):e}function vB(e){return typeof e=="function"?e:function(){return e}}function bB(e){iE(e,[/\r?\n|\r/g,xB])}function xB(){return{type:"break"}}function SB(){return function(e){bB(e)}}function zS(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 bp="phrasing",xp=["autolink","link","image","label"];function wB(){return{transforms:[AB],enter:{literalAutolink:jB,literalAutolinkEmail:Sp,literalAutolinkHttp:Sp,literalAutolinkWww:Sp},exit:{literalAutolink:_B,literalAutolinkEmail:NB,literalAutolinkHttp:CB,literalAutolinkWww:EB}}}function kB(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:bp,notInConstruct:xp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:bp,notInConstruct:xp},{character:":",before:"[ps]",after:"\\/",inConstruct:bp,notInConstruct:xp}]}}function jB(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Sp(e){this.config.enter.autolinkProtocol.call(this,e)}function CB(e){this.config.exit.autolinkProtocol.call(this,e)}function EB(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 NB(e){this.config.exit.autolinkEmail.call(this,e)}function _B(e){this.exit(e)}function AB(e){iE(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,TB],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),zB]],{ignore:["link","linkReference"]})}function TB(e,t,n,a,l){let o="";if(!lE(l)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!RB(n)))return!1;const u=OB(n+a);if(!u[0])return!1;const f={type:"link",title:null,url:o+t+u[0],children:[{type:"text",value:t+u[0]}]};return u[1]?[f,{type:"text",value:u[1]}]:f}function zB(e,t,n,a){return!lE(a,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function RB(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 OB(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=zS(e,"(");let o=zS(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 lE(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||pl(n)||pf(n))&&(!t||n!==47)}sE.peek=FB;function DB(){this.buffer()}function MB(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function LB(){this.buffer()}function IB(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function UB(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Or(this.sliceSerialize(e)).toLowerCase(),n.label=t}function PB(e){this.exit(e)}function BB(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Or(this.sliceSerialize(e)).toLowerCase(),n.label=t}function $B(e){this.exit(e)}function FB(){return"["}function sE(e,t,n,a){const l=n.createTracker(a);let o=l.move("[^");const u=n.enter("footnoteReference"),f=n.enter("reference");return o+=l.move(n.safe(n.associationId(e),{after:"]",before:o})),f(),u(),o+=l.move("]"),o}function qB(){return{enter:{gfmFootnoteCallString:DB,gfmFootnoteCall:MB,gfmFootnoteDefinitionLabelString:LB,gfmFootnoteDefinition:IB},exit:{gfmFootnoteCallString:UB,gfmFootnoteCall:PB,gfmFootnoteDefinitionLabelString:BB,gfmFootnoteDefinition:$B}}}function HB(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:sE},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(a,l,o,u){const f=o.createTracker(u);let m=f.move("[^");const h=o.enter("footnoteDefinition"),g=o.enter("label");return m+=f.move(o.safe(o.associationId(a),{before:m,after:"]"})),g(),m+=f.move("]:"),a.children&&a.children.length>0&&(f.shift(4),m+=f.move((t?`
362
+ `:" ")+o.indentLines(o.containerFlow(a,f.current()),t?oE:ZB))),h(),m}}function ZB(e,t,n){return t===0?e:oE(e,t,n)}function oE(e,t,n){return(n?"":" ")+e}const VB=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];uE.peek=XB;function QB(){return{canContainEols:["delete"],enter:{strikethrough:KB},exit:{strikethrough:YB}}}function GB(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:VB}],handlers:{delete:uE}}}function KB(e){this.enter({type:"delete",children:[]},e)}function YB(e){this.exit(e)}function uE(e,t,n,a){const l=n.createTracker(a),o=n.enter("strikethrough");let u=l.move("~~");return u+=n.containerPhrasing(e,{...l.current(),before:u,after:"~"}),u+=l.move("~~"),o(),u}function XB(){return"~"}function JB(e){return e.length}function WB(e,t){const n=t||{},a=(n.align||[]).concat(),l=n.stringLength||JB,o=[],u=[],f=[],m=[];let h=0,g=-1;for(;++g<e.length;){const j=[],E=[];let C=-1;for(e[g].length>h&&(h=e[g].length);++C<e[g].length;){const A=e$(e[g][C]);if(n.alignDelimiters!==!1){const O=l(A);E[C]=O,(m[C]===void 0||O>m[C])&&(m[C]=O)}j.push(A)}u[g]=j,f[g]=E}let y=-1;if(typeof a=="object"&&"length"in a)for(;++y<h;)o[y]=RS(a[y]);else{const j=RS(a);for(;++y<h;)o[y]=j}y=-1;const b=[],S=[];for(;++y<h;){const j=o[y];let E="",C="";j===99?(E=":",C=":"):j===108?E=":":j===114&&(C=":");let A=n.alignDelimiters===!1?1:Math.max(1,m[y]-E.length-C.length);const O=E+"-".repeat(A)+C;n.alignDelimiters!==!1&&(A=E.length+A+C.length,A>m[y]&&(m[y]=A),S[y]=A),b[y]=O}u.splice(1,0,b),f.splice(1,0,S),g=-1;const k=[];for(;++g<u.length;){const j=u[g],E=f[g];y=-1;const C=[];for(;++y<h;){const A=j[y]||"";let O="",M="";if(n.alignDelimiters!==!1){const D=m[y]-(E[y]||0),z=o[y];z===114?O=" ".repeat(D):z===99?D%2?(O=" ".repeat(D/2+.5),M=" ".repeat(D/2-.5)):(O=" ".repeat(D/2),M=O):M=" ".repeat(D)}n.delimiterStart!==!1&&!y&&C.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&A==="")&&(n.delimiterStart!==!1||y)&&C.push(" "),n.alignDelimiters!==!1&&C.push(O),C.push(A),n.alignDelimiters!==!1&&C.push(M),n.padding!==!1&&C.push(" "),(n.delimiterEnd!==!1||y!==h-1)&&C.push("|")}k.push(n.delimiterEnd===!1?C.join("").replace(/ +$/,""):C.join(""))}return k.join(`
363
+ `)}function e$(e){return e==null?"":String(e)}function RS(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 t$(e,t,n,a){const l=n.enter("blockquote"),o=n.createTracker(a);o.move("> "),o.shift(2);const u=n.indentLines(n.containerFlow(e,o.current()),n$);return l(),u}function n$(e,t,n){return">"+(n?"":" ")+e}function r$(e,t){return OS(e,t.inConstruct,!0)&&!OS(e,t.notInConstruct,!1)}function OS(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===`
364
+ `&&r$(n.stack,n.unsafe[l]))return/[ \t]/.test(a.before)?"":" ";return`\\
365
+ `}function a$(e,t){const n=String(e);let a=n.indexOf(t),l=a,o=0,u=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;a!==-1;)a===l?++o>u&&(u=o):o=1,l=a+t.length,a=n.indexOf(t,l);return u}function i$(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 l$(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 s$(e,t,n,a){const l=l$(n),o=e.value||"",u=l==="`"?"GraveAccent":"Tilde";if(i$(e,n)){const y=n.enter("codeIndented"),b=n.indentLines(o,o$);return y(),b}const f=n.createTracker(a),m=l.repeat(Math.max(a$(o,l)+1,3)),h=n.enter("codeFenced");let g=f.move(m);if(e.lang){const y=n.enter(`codeFencedLang${u}`);g+=f.move(n.safe(e.lang,{before:g,after:" ",encode:["`"],...f.current()})),y()}if(e.lang&&e.meta){const y=n.enter(`codeFencedMeta${u}`);g+=f.move(" "),g+=f.move(n.safe(e.meta,{before:g,after:`
366
+ `,encode:["`"],...f.current()})),y()}return g+=f.move(`
367
+ `),o&&(g+=f.move(o+`
368
+ `)),g+=f.move(m),h(),g}function o$(e,t,n){return(n?"":" ")+e}function xy(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 u$(e,t,n,a){const l=xy(n),o=l==='"'?"Quote":"Apostrophe",u=n.enter("definition");let f=n.enter("label");const m=n.createTracker(a);let h=m.move("[");return h+=m.move(n.safe(n.associationId(e),{before:h,after:"]",...m.current()})),h+=m.move("]: "),f(),!e.url||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),h+=m.move("<"),h+=m.move(n.safe(e.url,{before:h,after:">",...m.current()})),h+=m.move(">")):(f=n.enter("destinationRaw"),h+=m.move(n.safe(e.url,{before:h,after:e.title?" ":`
369
+ `,...m.current()}))),f(),e.title&&(f=n.enter(`title${o}`),h+=m.move(" "+l),h+=m.move(n.safe(e.title,{before:h,after:l,...m.current()})),h+=m.move(l),f()),u(),h}function c$(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 xu(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Bd(e,t,n){const a=Bs(e),l=Bs(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}}cE.peek=d$;function cE(e,t,n,a){const l=c$(n),o=n.enter("emphasis"),u=n.createTracker(a),f=u.move(l);let m=u.move(n.containerPhrasing(e,{after:l,before:f,...u.current()}));const h=m.charCodeAt(0),g=Bd(a.before.charCodeAt(a.before.length-1),h,l);g.inside&&(m=xu(h)+m.slice(1));const y=m.charCodeAt(m.length-1),b=Bd(a.after.charCodeAt(0),y,l);b.inside&&(m=m.slice(0,-1)+xu(y));const S=u.move(l);return o(),n.attentionEncodeSurroundingInfo={after:b.outside,before:g.outside},f+m+S}function d$(e,t,n){return n.options.emphasis||"*"}function f$(e,t){let n=!1;return vy(e,function(a){if("value"in a&&/\r?\n|\r/.test(a.value)||a.type==="break")return n=!0,hg}),!!((!e.depth||e.depth<3)&&dy(e)&&(t.options.setext||n))}function h$(e,t,n,a){const l=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(a);if(f$(e,n)){const g=n.enter("headingSetext"),y=n.enter("phrasing"),b=n.containerPhrasing(e,{...o.current(),before:`
370
+ `,after:`
371
+ `});return y(),g(),b+`
372
+ `+(l===1?"=":"-").repeat(b.length-(Math.max(b.lastIndexOf("\r"),b.lastIndexOf(`
373
+ `))+1))}const u="#".repeat(l),f=n.enter("headingAtx"),m=n.enter("phrasing");o.move(u+" ");let h=n.containerPhrasing(e,{before:"# ",after:`
374
+ `,...o.current()});return/^[\t ]/.test(h)&&(h=xu(h.charCodeAt(0))+h.slice(1)),h=h?u+" "+h:u,n.options.closeAtx&&(h+=" "+u),m(),f(),h}dE.peek=m$;function dE(e){return e.value||""}function m$(){return"<"}fE.peek=p$;function fE(e,t,n,a){const l=xy(n),o=l==='"'?"Quote":"Apostrophe",u=n.enter("image");let f=n.enter("label");const m=n.createTracker(a);let h=m.move("![");return h+=m.move(n.safe(e.alt,{before:h,after:"]",...m.current()})),h+=m.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),h+=m.move("<"),h+=m.move(n.safe(e.url,{before:h,after:">",...m.current()})),h+=m.move(">")):(f=n.enter("destinationRaw"),h+=m.move(n.safe(e.url,{before:h,after:e.title?" ":")",...m.current()}))),f(),e.title&&(f=n.enter(`title${o}`),h+=m.move(" "+l),h+=m.move(n.safe(e.title,{before:h,after:l,...m.current()})),h+=m.move(l),f()),h+=m.move(")"),u(),h}function p$(){return"!"}hE.peek=g$;function hE(e,t,n,a){const l=e.referenceType,o=n.enter("imageReference");let u=n.enter("label");const f=n.createTracker(a);let m=f.move("![");const h=n.safe(e.alt,{before:m,after:"]",...f.current()});m+=f.move(h+"]["),u();const g=n.stack;n.stack=[],u=n.enter("reference");const y=n.safe(n.associationId(e),{before:m,after:"]",...f.current()});return u(),n.stack=g,o(),l==="full"||!h||h!==y?m+=f.move(y+"]"):l==="shortcut"?m=m.slice(0,-1):m+=f.move("]"),m}function g$(){return"!"}mE.peek=y$;function mE(e,t,n){let a=e.value||"",l="`",o=-1;for(;new RegExp("(^|[^`])"+l+"([^`]|$)").test(a);)l+="`";for(/[^ \r\n]/.test(a)&&(/^[ \r\n]/.test(a)&&/[ \r\n]$/.test(a)||/^`|`$/.test(a))&&(a=" "+a+" ");++o<n.unsafe.length;){const u=n.unsafe[o],f=n.compilePattern(u);let m;if(u.atBreak)for(;m=f.exec(a);){let h=m.index;a.charCodeAt(h)===10&&a.charCodeAt(h-1)===13&&h--,a=a.slice(0,h)+" "+a.slice(m.index+1)}}return l+a+l}function y$(){return"`"}function pE(e,t){const n=dy(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))}gE.peek=v$;function gE(e,t,n,a){const l=xy(n),o=l==='"'?"Quote":"Apostrophe",u=n.createTracker(a);let f,m;if(pE(e,n)){const g=n.stack;n.stack=[],f=n.enter("autolink");let y=u.move("<");return y+=u.move(n.containerPhrasing(e,{before:y,after:">",...u.current()})),y+=u.move(">"),f(),n.stack=g,y}f=n.enter("link"),m=n.enter("label");let h=u.move("[");return h+=u.move(n.containerPhrasing(e,{before:h,after:"](",...u.current()})),h+=u.move("]("),m(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(m=n.enter("destinationLiteral"),h+=u.move("<"),h+=u.move(n.safe(e.url,{before:h,after:">",...u.current()})),h+=u.move(">")):(m=n.enter("destinationRaw"),h+=u.move(n.safe(e.url,{before:h,after:e.title?" ":")",...u.current()}))),m(),e.title&&(m=n.enter(`title${o}`),h+=u.move(" "+l),h+=u.move(n.safe(e.title,{before:h,after:l,...u.current()})),h+=u.move(l),m()),h+=u.move(")"),f(),h}function v$(e,t,n){return pE(e,n)?"<":"["}yE.peek=b$;function yE(e,t,n,a){const l=e.referenceType,o=n.enter("linkReference");let u=n.enter("label");const f=n.createTracker(a);let m=f.move("[");const h=n.containerPhrasing(e,{before:m,after:"]",...f.current()});m+=f.move(h+"]["),u();const g=n.stack;n.stack=[],u=n.enter("reference");const y=n.safe(n.associationId(e),{before:m,after:"]",...f.current()});return u(),n.stack=g,o(),l==="full"||!h||h!==y?m+=f.move(y+"]"):l==="shortcut"?m=m.slice(0,-1):m+=f.move("]"),m}function b$(){return"["}function Sy(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 x$(e){const t=Sy(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 S$(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 vE(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 w$(e,t,n,a){const l=n.enter("list"),o=n.bulletCurrent;let u=e.ordered?S$(n):Sy(n);const f=e.ordered?u==="."?")":".":x$(n);let m=t&&n.bulletLastUsed?u===n.bulletLastUsed:!1;if(!e.ordered){const g=e.children?e.children[0]:void 0;if((u==="*"||u==="-")&&g&&(!g.children||!g.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(m=!0),vE(n)===u&&g){let y=-1;for(;++y<e.children.length;){const b=e.children[y];if(b&&b.type==="listItem"&&b.children&&b.children[0]&&b.children[0].type==="thematicBreak"){m=!0;break}}}}m&&(u=f),n.bulletCurrent=u;const h=n.containerFlow(e,a);return n.bulletLastUsed=u,n.bulletCurrent=o,l(),h}function k$(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 j$(e,t,n,a){const l=k$(n);let o=n.bulletCurrent||Sy(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let u=o.length+1;(l==="tab"||l==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(u=Math.ceil(u/4)*4);const f=n.createTracker(a);f.move(o+" ".repeat(u-o.length)),f.shift(u);const m=n.enter("listItem"),h=n.indentLines(n.containerFlow(e,f.current()),g);return m(),h;function g(y,b,S){return b?(S?"":" ".repeat(u))+y:(S?o:o+" ".repeat(u-o.length))+y}}function C$(e,t,n,a){const l=n.enter("paragraph"),o=n.enter("phrasing"),u=n.containerPhrasing(e,a);return o(),l(),u}const E$=vf(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function N$(e,t,n,a){return(e.children.some(function(u){return E$(u)})?n.containerPhrasing:n.containerFlow).call(n,e,a)}function _$(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}bE.peek=A$;function bE(e,t,n,a){const l=_$(n),o=n.enter("strong"),u=n.createTracker(a),f=u.move(l+l);let m=u.move(n.containerPhrasing(e,{after:l,before:f,...u.current()}));const h=m.charCodeAt(0),g=Bd(a.before.charCodeAt(a.before.length-1),h,l);g.inside&&(m=xu(h)+m.slice(1));const y=m.charCodeAt(m.length-1),b=Bd(a.after.charCodeAt(0),y,l);b.inside&&(m=m.slice(0,-1)+xu(y));const S=u.move(l+l);return o(),n.attentionEncodeSurroundingInfo={after:b.outside,before:g.outside},f+m+S}function A$(e,t,n){return n.options.strong||"*"}function T$(e,t,n,a){return n.safe(e.value,a)}function z$(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 R$(e,t,n){const a=(vE(n)+(n.options.ruleSpaces?" ":"")).repeat(z$(n));return n.options.ruleSpaces?a.slice(0,-1):a}const xE={blockquote:t$,break:DS,code:s$,definition:u$,emphasis:cE,hardBreak:DS,heading:h$,html:dE,image:fE,imageReference:hE,inlineCode:mE,link:gE,linkReference:yE,list:w$,listItem:j$,paragraph:C$,root:N$,strong:bE,text:T$,thematicBreak:R$};function O$(){return{enter:{table:D$,tableData:MS,tableHeader:MS,tableRow:L$},exit:{codeText:I$,table:M$,tableData:wp,tableHeader:wp,tableRow:wp}}}function D$(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 M$(e){this.exit(e),this.data.inTable=void 0}function L$(e){this.enter({type:"tableRow",children:[]},e)}function wp(e){this.exit(e)}function MS(e){this.enter({type:"tableCell",children:[]},e)}function I$(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,U$));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function U$(e,t){return t==="|"?t:e}function P$(e){const t=e||{},n=t.tableCellPadding,a=t.tablePipeAlign,l=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
375
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:b,table:u,tableCell:m,tableRow:f}};function u(S,k,j,E){return h(g(S,j,E),S.align)}function f(S,k,j,E){const C=y(S,j,E),A=h([C]);return A.slice(0,A.indexOf(`
376
+ `))}function m(S,k,j,E){const C=j.enter("tableCell"),A=j.enter("phrasing"),O=j.containerPhrasing(S,{...E,before:o,after:o});return A(),C(),O}function h(S,k){return WB(S,{align:k,alignDelimiters:a,padding:n,stringLength:l})}function g(S,k,j){const E=S.children;let C=-1;const A=[],O=k.enter("table");for(;++C<E.length;)A[C]=y(E[C],k,j);return O(),A}function y(S,k,j){const E=S.children;let C=-1;const A=[],O=k.enter("tableRow");for(;++C<E.length;)A[C]=m(E[C],S,k,j);return O(),A}function b(S,k,j){let E=xE.inlineCode(S,k,j);return j.stack.includes("tableCell")&&(E=E.replace(/\|/g,"\\$&")),E}}function B$(){return{exit:{taskListCheckValueChecked:LS,taskListCheckValueUnchecked:LS,paragraph:F$}}}function $$(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:q$}}}function LS(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function F$(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const a=n.children[0];if(a&&a.type==="text"){const l=t.children;let o=-1,u;for(;++o<l.length;){const f=l[o];if(f.type==="paragraph"){u=f;break}}u===n&&(a.value=a.value.slice(1),a.value.length===0?n.children.shift():n.position&&a.position&&typeof a.position.start.offset=="number"&&(a.position.start.column++,a.position.start.offset++,n.position.start=Object.assign({},a.position.start)))}}this.exit(e)}function q$(e,t,n,a){const l=e.children[0],o=typeof e.checked=="boolean"&&l&&l.type==="paragraph",u="["+(e.checked?"x":" ")+"] ",f=n.createTracker(a);o&&f.move(u);let m=xE.listItem(e,t,n,{...a,...f.current()});return o&&(m=m.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),m;function h(g){return g+u}}function H$(){return[wB(),qB(),QB(),O$(),B$()]}function Z$(e){return{extensions:[kB(),HB(e),GB(),P$(e),$$()]}}const V$={tokenize:J$,partial:!0},SE={tokenize:W$,partial:!0},wE={tokenize:eF,partial:!0},kE={tokenize:tF,partial:!0},Q$={tokenize:nF,partial:!0},jE={name:"wwwAutolink",tokenize:Y$,previous:EE},CE={name:"protocolAutolink",tokenize:X$,previous:NE},Na={name:"emailAutolink",tokenize:K$,previous:_E},Yr={};function G$(){return{text:Yr}}let Ji=48;for(;Ji<123;)Yr[Ji]=Na,Ji++,Ji===58?Ji=65:Ji===91&&(Ji=97);Yr[43]=Na;Yr[45]=Na;Yr[46]=Na;Yr[95]=Na;Yr[72]=[Na,CE];Yr[104]=[Na,CE];Yr[87]=[Na,jE];Yr[119]=[Na,jE];function K$(e,t,n){const a=this;let l,o;return u;function u(y){return!yg(y)||!_E.call(a,a.previous)||wy(a.events)?n(y):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(y))}function f(y){return yg(y)?(e.consume(y),f):y===64?(e.consume(y),m):n(y)}function m(y){return y===46?e.check(Q$,g,h)(y):y===45||y===95||wn(y)?(o=!0,e.consume(y),m):g(y)}function h(y){return e.consume(y),l=!0,m}function g(y){return o&&l&&Tn(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(y)):n(y)}}function Y$(e,t,n){const a=this;return l;function l(u){return u!==87&&u!==119||!EE.call(a,a.previous)||wy(a.events)?n(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(V$,e.attempt(SE,e.attempt(wE,o),n),n)(u))}function o(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(u)}}function X$(e,t,n){const a=this;let l="",o=!1;return u;function u(y){return(y===72||y===104)&&NE.call(a,a.previous)&&!wy(a.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),l+=String.fromCodePoint(y),e.consume(y),f):n(y)}function f(y){if(Tn(y)&&l.length<5)return l+=String.fromCodePoint(y),e.consume(y),f;if(y===58){const b=l.toLowerCase();if(b==="http"||b==="https")return e.consume(y),m}return n(y)}function m(y){return y===47?(e.consume(y),o?h:(o=!0,m)):n(y)}function h(y){return y===null||Id(y)||jt(y)||pl(y)||pf(y)?n(y):e.attempt(SE,e.attempt(wE,g),n)(y)}function g(y){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(y)}}function J$(e,t,n){let a=0;return l;function l(u){return(u===87||u===119)&&a<3?(a++,e.consume(u),l):u===46&&a===3?(e.consume(u),o):n(u)}function o(u){return u===null?n(u):t(u)}}function W$(e,t,n){let a,l,o;return u;function u(h){return h===46||h===95?e.check(kE,m,f)(h):h===null||jt(h)||pl(h)||h!==45&&pf(h)?m(h):(o=!0,e.consume(h),u)}function f(h){return h===95?a=!0:(l=a,a=void 0),e.consume(h),u}function m(h){return l||a||!o?n(h):t(h)}}function eF(e,t){let n=0,a=0;return l;function l(u){return u===40?(n++,e.consume(u),l):u===41&&a<n?o(u):u===33||u===34||u===38||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===60||u===63||u===93||u===95||u===126?e.check(kE,t,o)(u):u===null||jt(u)||pl(u)?t(u):(e.consume(u),l)}function o(u){return u===41&&a++,e.consume(u),l}}function tF(e,t,n){return a;function a(f){return f===33||f===34||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===63||f===95||f===126?(e.consume(f),a):f===38?(e.consume(f),o):f===93?(e.consume(f),l):f===60||f===null||jt(f)||pl(f)?t(f):n(f)}function l(f){return f===null||f===40||f===91||jt(f)||pl(f)?t(f):a(f)}function o(f){return Tn(f)?u(f):n(f)}function u(f){return f===59?(e.consume(f),a):Tn(f)?(e.consume(f),u):n(f)}}function nF(e,t,n){return a;function a(o){return e.consume(o),l}function l(o){return wn(o)?n(o):t(o)}}function EE(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||jt(e)}function NE(e){return!Tn(e)}function _E(e){return!(e===47||yg(e))}function yg(e){return e===43||e===45||e===46||e===95||wn(e)}function wy(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 rF={tokenize:dF,partial:!0};function aF(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:oF,continuation:{tokenize:uF},exit:cF}},text:{91:{name:"gfmFootnoteCall",tokenize:sF},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:iF,resolveTo:lF}}}}function iF(e,t,n){const a=this;let l=a.events.length;const o=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let u;for(;l--;){const m=a.events[l][1];if(m.type==="labelImage"){u=m;break}if(m.type==="gfmFootnoteCall"||m.type==="labelLink"||m.type==="label"||m.type==="image"||m.type==="link")break}return f;function f(m){if(!u||!u._balanced)return n(m);const h=Or(a.sliceSerialize({start:u.end,end:a.now()}));return h.codePointAt(0)!==94||!o.includes(h.slice(1))?n(m):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),t(m))}}function lF(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const a={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},l={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};l.end.column++,l.end.offset++,l.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},l.end),end:Object.assign({},e[e.length-1][1].start)},u={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},f=[e[n+1],e[n+2],["enter",a,t],e[n+3],e[n+4],["enter",l,t],["exit",l,t],["enter",o,t],["enter",u,t],["exit",u,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",a,t]];return e.splice(n,e.length-n+1,...f),e}function sF(e,t,n){const a=this,l=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o=0,u;return f;function f(y){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(y),e.exit("gfmFootnoteCallLabelMarker"),m}function m(y){return y!==94?n(y):(e.enter("gfmFootnoteCallMarker"),e.consume(y),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(y){if(o>999||y===93&&!u||y===null||y===91||jt(y))return n(y);if(y===93){e.exit("chunkString");const b=e.exit("gfmFootnoteCallString");return l.includes(Or(a.sliceSerialize(b)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(y),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(y)}return jt(y)||(u=!0),o++,e.consume(y),y===92?g:h}function g(y){return y===91||y===92||y===93?(e.consume(y),o++,h):h(y)}}function oF(e,t,n){const a=this,l=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o,u=0,f;return m;function m(k){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(k){return k===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",g):n(k)}function g(k){if(u>999||k===93&&!f||k===null||k===91||jt(k))return n(k);if(k===93){e.exit("chunkString");const j=e.exit("gfmFootnoteDefinitionLabelString");return o=Or(a.sliceSerialize(j)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),b}return jt(k)||(f=!0),u++,e.consume(k),k===92?y:g}function y(k){return k===91||k===92||k===93?(e.consume(k),u++,g):g(k)}function b(k){return k===58?(e.enter("definitionMarker"),e.consume(k),e.exit("definitionMarker"),l.includes(o)||l.push(o),it(e,S,"gfmFootnoteDefinitionWhitespace")):n(k)}function S(k){return t(k)}}function uF(e,t,n){return e.check(Du,t,e.attempt(rF,t,n))}function cF(e){e.exit("gfmFootnoteDefinition")}function dF(e,t,n){const a=this;return it(e,l,"gfmFootnoteDefinitionIndent",5);function l(o){const u=a.events[a.events.length-1];return u&&u[1].type==="gfmFootnoteDefinitionIndent"&&u[2].sliceSerialize(u[1],!0).length===4?t(o):n(o)}}function fF(e){let n=(e||{}).singleTilde;const a={name:"strikethrough",tokenize:o,resolveAll:l};return n==null&&(n=!0),{text:{126:a},insideSpan:{null:[a]},attentionMarkers:{null:[126]}};function l(u,f){let m=-1;for(;++m<u.length;)if(u[m][0]==="enter"&&u[m][1].type==="strikethroughSequenceTemporary"&&u[m][1]._close){let h=m;for(;h--;)if(u[h][0]==="exit"&&u[h][1].type==="strikethroughSequenceTemporary"&&u[h][1]._open&&u[m][1].end.offset-u[m][1].start.offset===u[h][1].end.offset-u[h][1].start.offset){u[m][1].type="strikethroughSequence",u[h][1].type="strikethroughSequence";const g={type:"strikethrough",start:Object.assign({},u[h][1].start),end:Object.assign({},u[m][1].end)},y={type:"strikethroughText",start:Object.assign({},u[h][1].end),end:Object.assign({},u[m][1].start)},b=[["enter",g,f],["enter",u[h][1],f],["exit",u[h][1],f],["enter",y,f]],S=f.parser.constructs.insideSpan.null;S&&ir(b,b.length,0,gf(S,u.slice(h+1,m),f)),ir(b,b.length,0,[["exit",y,f],["enter",u[m][1],f],["exit",u[m][1],f],["exit",g,f]]),ir(u,h-1,m-h+3,b),m=h+b.length-2;break}}for(m=-1;++m<u.length;)u[m][1].type==="strikethroughSequenceTemporary"&&(u[m][1].type="data");return u}function o(u,f,m){const h=this.previous,g=this.events;let y=0;return b;function b(k){return h===126&&g[g.length-1][1].type!=="characterEscape"?m(k):(u.enter("strikethroughSequenceTemporary"),S(k))}function S(k){const j=Bs(h);if(k===126)return y>1?m(k):(u.consume(k),y++,S);if(y<2&&!n)return m(k);const E=u.exit("strikethroughSequenceTemporary"),C=Bs(k);return E._open=!C||C===2&&!!j,E._close=!j||j===2&&!!C,f(k)}}}class hF{constructor(){this.map=[]}add(t,n,a){mF(this,t,n,a)}consume(t){if(this.map.sort(function(o,u){return o[0]-u[0]}),this.map.length===0)return;let n=this.map.length;const a=[];for(;n>0;)n-=1,a.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];a.push(t.slice()),t.length=0;let l=a.pop();for(;l;){for(const o of l)t.push(o);l=a.pop()}this.map.length=0}}function mF(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 pF(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 gF(){return{flow:{null:{name:"table",tokenize:yF,resolveAll:vF}}}}function yF(e,t,n){const a=this;let l=0,o=0,u;return f;function f(q){let oe=a.events.length-1;for(;oe>-1;){const fe=a.events[oe][1].type;if(fe==="lineEnding"||fe==="linePrefix")oe--;else break}const W=oe>-1?a.events[oe][1].type:null,me=W==="tableHead"||W==="tableRow"?z:m;return me===z&&a.parser.lazy[a.now().line]?n(q):me(q)}function m(q){return e.enter("tableHead"),e.enter("tableRow"),h(q)}function h(q){return q===124||(u=!0,o+=1),g(q)}function g(q){return q===null?n(q):Re(q)?o>1?(o=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(q),e.exit("lineEnding"),S):n(q):Xe(q)?it(e,g,"whitespace")(q):(o+=1,u&&(u=!1,l+=1),q===124?(e.enter("tableCellDivider"),e.consume(q),e.exit("tableCellDivider"),u=!0,g):(e.enter("data"),y(q)))}function y(q){return q===null||q===124||jt(q)?(e.exit("data"),g(q)):(e.consume(q),q===92?b:y)}function b(q){return q===92||q===124?(e.consume(q),y):y(q)}function S(q){return a.interrupt=!1,a.parser.lazy[a.now().line]?n(q):(e.enter("tableDelimiterRow"),u=!1,Xe(q)?it(e,k,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(q):k(q))}function k(q){return q===45||q===58?E(q):q===124?(u=!0,e.enter("tableCellDivider"),e.consume(q),e.exit("tableCellDivider"),j):D(q)}function j(q){return Xe(q)?it(e,E,"whitespace")(q):E(q)}function E(q){return q===58?(o+=1,u=!0,e.enter("tableDelimiterMarker"),e.consume(q),e.exit("tableDelimiterMarker"),C):q===45?(o+=1,C(q)):q===null||Re(q)?M(q):D(q)}function C(q){return q===45?(e.enter("tableDelimiterFiller"),A(q)):D(q)}function A(q){return q===45?(e.consume(q),A):q===58?(u=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(q),e.exit("tableDelimiterMarker"),O):(e.exit("tableDelimiterFiller"),O(q))}function O(q){return Xe(q)?it(e,M,"whitespace")(q):M(q)}function M(q){return q===124?k(q):q===null||Re(q)?!u||l!==o?D(q):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(q)):D(q)}function D(q){return n(q)}function z(q){return e.enter("tableRow"),L(q)}function L(q){return q===124?(e.enter("tableCellDivider"),e.consume(q),e.exit("tableCellDivider"),L):q===null||Re(q)?(e.exit("tableRow"),t(q)):Xe(q)?it(e,L,"whitespace")(q):(e.enter("data"),Z(q))}function Z(q){return q===null||q===124||jt(q)?(e.exit("data"),L(q)):(e.consume(q),q===92?te:Z)}function te(q){return q===92||q===124?(e.consume(q),Z):Z(q)}}function vF(e,t){let n=-1,a=!0,l=0,o=[0,0,0,0],u=[0,0,0,0],f=!1,m=0,h,g,y;const b=new hF;for(;++n<e.length;){const S=e[n],k=S[1];S[0]==="enter"?k.type==="tableHead"?(f=!1,m!==0&&(IS(b,t,m,h,g),g=void 0,m=0),h={type:"table",start:Object.assign({},k.start),end:Object.assign({},k.end)},b.add(n,0,[["enter",h,t]])):k.type==="tableRow"||k.type==="tableDelimiterRow"?(a=!0,y=void 0,o=[0,0,0,0],u=[0,n+1,0,0],f&&(f=!1,g={type:"tableBody",start:Object.assign({},k.start),end:Object.assign({},k.end)},b.add(n,0,[["enter",g,t]])),l=k.type==="tableDelimiterRow"?2:g?3:1):l&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")?(a=!1,u[2]===0&&(o[1]!==0&&(u[0]=u[1],y=hd(b,t,o,l,void 0,y),o=[0,0,0,0]),u[2]=n)):k.type==="tableCellDivider"&&(a?a=!1:(o[1]!==0&&(u[0]=u[1],y=hd(b,t,o,l,void 0,y)),o=u,u=[o[1],n,0,0])):k.type==="tableHead"?(f=!0,m=n):k.type==="tableRow"||k.type==="tableDelimiterRow"?(m=n,o[1]!==0?(u[0]=u[1],y=hd(b,t,o,l,n,y)):u[1]!==0&&(y=hd(b,t,u,l,n,y)),l=0):l&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(u[3]=n)}for(m!==0&&IS(b,t,m,h,g),b.consume(t.events),n=-1;++n<t.events.length;){const S=t.events[n];S[0]==="enter"&&S[1].type==="table"&&(S[1]._align=pF(t.events,n))}return e}function hd(e,t,n,a,l,o){const u=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",f="tableContent";n[0]!==0&&(o.end=Object.assign({},ms(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const m=ms(t.events,n[1]);if(o={type:u,start:Object.assign({},m),end:Object.assign({},m)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const h=ms(t.events,n[2]),g=ms(t.events,n[3]),y={type:f,start:Object.assign({},h),end:Object.assign({},g)};if(e.add(n[2],0,[["enter",y,t]]),a!==2){const b=t.events[n[2]],S=t.events[n[3]];if(b[1].end=Object.assign({},S[1].end),b[1].type="chunkText",b[1].contentType="text",n[3]>n[2]+1){const k=n[2]+1,j=n[3]-n[2]-1;e.add(k,j,[])}}e.add(n[3]+1,0,[["exit",y,t]])}return l!==void 0&&(o.end=Object.assign({},ms(t.events,l)),e.add(l,0,[["exit",o,t]]),o=void 0),o}function IS(e,t,n,a,l){const o=[],u=ms(t.events,n);l&&(l.end=Object.assign({},u),o.push(["exit",l,t])),a.end=Object.assign({},u),o.push(["exit",a,t]),e.add(n+1,0,o)}function ms(e,t){const n=e[t],a=n[0]==="enter"?"start":"end";return n[1][a]}const bF={name:"tasklistCheck",tokenize:SF};function xF(){return{text:{91:bF}}}function SF(e,t,n){const a=this;return l;function l(m){return a.previous!==null||!a._gfmTasklistFirstContentOfListItem?n(m):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),o)}function o(m){return jt(m)?(e.enter("taskListCheckValueUnchecked"),e.consume(m),e.exit("taskListCheckValueUnchecked"),u):m===88||m===120?(e.enter("taskListCheckValueChecked"),e.consume(m),e.exit("taskListCheckValueChecked"),u):n(m)}function u(m){return m===93?(e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):n(m)}function f(m){return Re(m)?t(m):Xe(m)?e.check({tokenize:wF},t,n)(m):n(m)}}function wF(e,t,n){return it(e,a,"whitespace");function a(l){return l===null?n(l):t(l)}}function kF(e){return UC([G$(),aF(),fF(e),gF(),xF()])}const jF={};function CF(e){const t=this,n=e||jF,a=t.data(),l=a.micromarkExtensions||(a.micromarkExtensions=[]),o=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),u=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);l.push(kF(n)),o.push(H$()),u.push(Z$(n))}function AE({children:e,className:t}){return c.jsx("div",{className:Ne("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:c.jsx(cB,{remarkPlugins:[CF,SB],children:e})})}function EF({value:e,baseline:t,onChange:n,onRevert:a,disabled:l}){const[o,u]=x.useState(!1),f=x.useRef(null),m=e!==t;return x.useEffect(()=>{var h;o&&((h=f.current)==null||h.focus())},[o]),c.jsxs(nn,{style:{borderColor:m?"color-mix(in oklch, var(--state-blocked) 70%, transparent)":void 0},children:[c.jsxs(jr,{children:[c.jsxs(Cr,{children:["System prompt append",m&&c.jsx(NF,{})]}),!o&&!l&&c.jsxs(pe,{size:"xs",variant:"outline",onClick:()=>u(!0),children:[c.jsx(_u,{className:"h-3 w-3"})," Edit"]})]}),c.jsx(Kr,{children:o?c.jsxs("div",{className:"space-y-2",children:[c.jsx("textarea",{ref:f,value:e,onChange:h=>n(h.target.value),onKeyDown:h=>{h.key==="Escape"&&(h.preventDefault(),u(!1))},rows:10,className:"w-full rounded border bg-transparent p-2 font-mono text-body shadow-sm focus:outline-none focus:ring-1 focus:ring-ring",placeholder:"Appended to Claude Code's default system prompt.",maxLength:32e3,spellCheck:!1}),c.jsxs("div",{className:"flex justify-end gap-2",children:[c.jsx(pe,{size:"xs",variant:"ghost",onClick:()=>{a(),u(!1)},disabled:!m,children:"Revert"}),c.jsx(pe,{size:"xs",onClick:()=>u(!1),children:"Done"})]}),c.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."})]}):c.jsx("div",{className:"rounded bg-muted p-3 text-body max-h-64 overflow-auto min-h-8",children:e?c.jsx(AE,{children:e}):c.jsx("span",{className:"text-muted-foreground italic",children:"No prompt append."})})})]})}function NF(){return c.jsx("span",{className:"mono uppercase text-caption",style:{padding:"var(--hairline) var(--sp-1_5)",borderRadius:"var(--radius-chip)",background:"color-mix(in oklch, var(--state-blocked) 16%, transparent)",color:"color-mix(in oklch, var(--state-blocked) 60%, var(--fg))"},children:"changed"})}const _F={prompt:"Prompt",model:"Model",mcp:"MCP",env:"Env",git:"Git"};function AF(e){if(!e.summary.anyDirty&&!e.conflictMessage&&!e.errorMessage&&!e.justSaved)return null;const t=e.summary.dirtySections.length;return c.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:c.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[c.jsxs("div",{className:"flex flex-col gap-1 text-body min-w-0",children:[e.summary.anyDirty&&c.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[c.jsx(Gr,{state:"blocked",size:8}),c.jsxs("span",{className:"font-medium",children:[t," section",t===1?"":"s"," with unsaved changes"]}),c.jsx("span",{style:{color:"var(--fg-4)"},"aria-hidden":!0,children:"·"}),c.jsx("span",{className:"flex flex-wrap gap-1",children:e.summary.dirtySections.map(n=>c.jsx("button",{type:"button",onClick:()=>e.onJumpTo(n),className:"text-caption transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",style:{padding:"var(--sp-0_5) var(--sp-1_5)",borderRadius:"var(--radius-chip)",background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",color:"var(--fg-2)",cursor:"pointer"},children:_F[n]},n))})]}),e.justSaved&&!e.summary.anyDirty&&!e.errorMessage&&!e.conflictMessage&&c.jsxs("div",{className:"inline-flex items-center gap-1.5 text-body font-medium",style:{color:"var(--state-idle)"},children:[c.jsx(bi,{className:"h-3.5 w-3.5"}),"Saved"]}),e.saveHint&&c.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:e.saveHint}),e.conflictMessage&&c.jsx("p",{className:"text-caption font-medium",style:{color:"var(--state-blocked)"},children:e.conflictMessage}),e.errorMessage&&c.jsx("p",{className:"text-caption font-medium",style:{color:"var(--state-error)"},children:e.errorMessage})]}),c.jsxs("div",{className:"flex gap-2 shrink-0",children:[e.conflictMessage&&c.jsx(pe,{variant:"outline",size:"sm",onClick:e.onReloadRemote,children:"Discard mine, load latest"}),c.jsx(pe,{variant:"ghost",size:"sm",onClick:e.onDiscard,disabled:e.saving,children:"Discard changes"}),c.jsx(pe,{size:"sm",onClick:e.onSave,disabled:e.saving||!e.summary.anyDirty,children:e.saving?c.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[c.jsx(YT,{className:"h-3 w-3 animate-spin","aria-hidden":!0}),"Saving…"]}):"Save"})]})]})})}function ou(e){return`agent-cfg-${e}`}function Wo({anchorId:e,title:t,caption:n,right:a,children:l,className:o,sectionProps:u}){return c.jsxs("section",{id:e,className:Ne("space-y-3",o),...u,children:[c.jsxs("div",{className:"flex items-end justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-subtitle",style:{color:"var(--fg)"},children:t}),n&&c.jsx("div",{className:"text-caption",style:{color:"var(--fg-3)"},children:n})]}),a]}),c.jsx("div",{className:"space-y-3",children:l})]})}function TF(){return c.jsx("hr",{"aria-hidden":!0,style:{border:0,borderTop:"var(--hairline) solid var(--border)",margin:"var(--sp-2) 0"}})}const zF={"claude-code":{name:"Claude Code",caption:"Anthropic's Claude Code runtime. Fixed after creation — create a new agent to switch."},kael:{name:"Kael",caption:"Kael runtime (coming soon). Fixed after creation — create a new agent to switch."}};function RF(e){const t=zF[e.runtimeKind];return c.jsxs("div",{className:"space-y-3",children:[c.jsx(OF,{name:t.name,caption:t.caption,locked:!0}),c.jsx(DF,{computerLabel:e.computerLabel,canBindComputer:e.canBindComputer,bindPending:e.bindComputerPending??!1,onBindComputer:e.onBindComputer}),e.modelSlot]})}function OF({name:e,caption:t,locked:n}){return c.jsxs(nn,{children:[c.jsx(jr,{children:c.jsxs(Cr,{children:["Where it runs",n&&c.jsxs("span",{className:"mono uppercase text-caption inline-flex items-center gap-1",style:{color:"var(--fg-4)"},children:[c.jsx(Kw,{className:"h-3 w-3","aria-hidden":!0})," locked"]})]})}),c.jsxs(Kr,{className:"space-y-1 text-body",children:[c.jsxs("div",{className:"inline-flex items-center gap-2",children:[c.jsx(Yw,{className:"h-3.5 w-3.5","aria-hidden":!0,style:{color:"var(--accent)"}}),c.jsx("span",{className:"font-medium",children:e})]}),c.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:t})]})]})}function DF(e){const t=!!e.computerLabel;return c.jsxs(nn,{children:[c.jsxs(jr,{children:[c.jsx(Cr,{children:"Bound computer"}),e.canBindComputer&&e.onBindComputer&&!t&&c.jsxs(pe,{size:"xs",variant:"outline",onClick:e.onBindComputer,disabled:e.bindPending,children:[c.jsx(Gw,{className:"h-3 w-3"}),e.bindPending?"Binding…":"Bind computer"]})]}),c.jsx(Kr,{className:"text-body",children:t?c.jsx("div",{className:"mono",style:{color:"var(--fg-2)"},children:e.computerLabel}):c.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 MF(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 LF(e,t){let n=t.size+1;for(;t.has(`${e}-${n}`);)n++;return`${e}-${n}`}function IF(e,t){return JSON.stringify(e)===JSON.stringify(t)}function kp(e,t){return e.map((n,a)=>({key:`${t}-${a+1}`,value:n,baseline:n,status:"unchanged"}))}function US(e){return e.map(t=>t.status==="deleted"?t:t.baseline==null?{...t,status:"added"}:IF(t.value,t.baseline)?{...t,status:"unchanged"}:{...t,status:"modified"})}function jp(e,t){const n=e;return{add:a=>t(l=>{const o=l[e],u=new Set(o.map(h=>h.key)),f=LF(n,u),m=[...o,{key:f,value:a,baseline:null,status:"added"}];return{...l,[e]:US(m)}}),update:(a,l)=>t(o=>{const f=o[e].map(m=>m.key===a?{...m,value:l}:m);return{...o,[e]:US(f)}}),remove:a=>t(l=>{const u=l[e].map(f=>f.key!==a?f:f.baseline==null?null:{...f,status:"deleted"}).filter(f=>f!==null);return{...l,[e]:u}}),undo:a=>t(l=>{const u=l[e].map(f=>f.key!==a||f.baseline==null?f:{...f,value:f.baseline,status:"unchanged"});return{...l,[e]:u}})}}function UF(e){return{promptAppend:e.payload.prompt.append,model:e.payload.model,mcp:kp(e.payload.mcpServers,"mcp"),env:kp(e.payload.env,"env"),git:kp(e.payload.gitRepos,"git")}}function PF(e){const[t,n]=x.useState(null);x.useEffect(()=>{e&&t===null&&n(UF(e))},[e,t]);const a=t??{promptAppend:"",model:"",mcp:[],env:[],git:[]},l=(e==null?void 0:e.payload.prompt.append)??"",o=(e==null?void 0:e.payload.model)??"",u=a.promptAppend!==l,f=a.model!==o,m=x.useMemo(()=>{const O=[],M=Z=>Z.reduce((te,q)=>q.status==="unchanged"?te:te+1,0),D=M(a.mcp),z=M(a.env),L=M(a.git);return u&&O.push("prompt"),f&&O.push("model"),D>0&&O.push("mcp"),z>0&&O.push("env"),L>0&&O.push("git"),{anyDirty:O.length>0,dirtySections:O,counts:{prompt:u?1:0,model:f?1:0,mcp:D,env:z,git:L}}},[a,u,f]),h=x.useCallback(O=>{n(M=>M&&O(M))},[]),g=x.useCallback(O=>h(M=>({...M,promptAppend:O})),[h]),y=x.useCallback(()=>h(O=>({...O,promptAppend:l})),[h,l]),b=x.useCallback(O=>h(M=>({...M,model:O})),[h]),S=x.useCallback(()=>h(O=>({...O,model:o})),[h,o]),k=x.useMemo(()=>jp("mcp",h),[h]),j=x.useMemo(()=>jp("env",h),[h]),E=x.useMemo(()=>jp("git",h),[h]),C=x.useCallback(()=>{n(null)},[]),A=x.useCallback(()=>{if(!t||!e)return{};const O={};u&&(O.prompt={append:t.promptAppend}),f&&(O.model=t.model);const M=m.counts.mcp>0,D=m.counts.env>0,z=m.counts.git>0;return M&&(O.mcpServers=t.mcp.filter(L=>L.status!=="deleted").map(L=>L.value)),D&&(O.env=t.env.filter(L=>L.status!=="deleted").map(L=>{const Z=L.value;return Z.sensitive&&Z.value===Dd?{key:Z.key,value:Dd,sensitive:!0}:Z})),z&&(O.gitRepos=t.git.filter(L=>L.status!=="deleted").map(L=>L.value)),O},[t,e,u,f,m]);return{draft:a,summary:m,promptDirty:u,modelDirty:f,setPromptAppend:g,revertPrompt:y,setModel:b,revertModel:S,addMcp:k.add,updateMcp:k.update,deleteMcp:k.remove,undoDeleteMcp:k.undo,addEnv:j.add,updateEnv:j.update,deleteEnv:j.remove,undoDeleteEnv:j.undo,addGit:E.add,updateGit:E.update,deleteGit:E.remove,undoDeleteGit:E.undo,resetAll:C,buildPayloadPatch:A}}const Sn={overview:"ad-overview",setup:"ad-setup",prompt:ou("prompt"),tools:ou("mcp"),advanced:"ad-advanced",danger:"ad-danger"};function BF(e){const t=[{key:"overview",label:"Profile",anchor:Sn.overview}];return e||t.push({key:"setup",label:"Setup",anchor:Sn.setup},{key:"prompt",label:"Prompt",anchor:Sn.prompt},{key:"tools",label:"Tools",anchor:Sn.tools},{key:"advanced",label:"Advanced",anchor:Sn.advanced}),t.push({key:"danger",label:"Danger zone",anchor:Sn.danger,divider:!0,danger:!0}),t}function $F(){var an,Mt,fn,ft,Nr,Rn,Lu,Ti,zi,Ri,Lr,Oi;const t=Ow().uuid??"",n=kn(),a=zn(),l=Ze({queryKey:["agent",t],queryFn:()=>hj(t),enabled:!!t}),o=Ze({queryKey:["agent-config",t],queryFn:()=>AI(t),enabled:!!t&&((an=l.data)==null?void 0:an.type)!=="human"}),u=Ze({queryKey:["agent-client-status",t],queryFn:()=>RI(t),enabled:!!t&&((Mt=l.data)==null?void 0:Mt.type)!=="human"}),f=Ze({queryKey:["agent-sessions-active",t],queryFn:()=>Vs(t,{state:"active"}),enabled:!!t&&((fn=l.data)==null?void 0:fn.type)!=="human"}),m=Ze({queryKey:["clients"],queryFn:hu,enabled:!!t&&((ft=l.data)==null?void 0:ft.type)!=="human",refetchInterval:3e4}),h=PF(o.data),[g,y]=x.useState(null),[b,S]=x.useState(null),[k,j]=x.useState(!1),E=St({mutationFn:async()=>{if(!o.data)throw new Error("config not loaded");const be=h.buildPayloadPatch();return TI(t,{expectedVersion:o.data.version,payload:be})},onSuccess:be=>{a.setQueryData(["agent-config",t],be),y(null),S(null),j(!0)},onError:be=>{if(j(!1),be instanceof Qd&&be.status===409){S("Someone else saved a newer version while you were editing."),y(null);return}y(be instanceof Error?be.message:String(be))}});x.useEffect(()=>{if(!k)return;const be=setTimeout(()=>j(!1),2500);return()=>clearTimeout(be)},[k]),x.useEffect(()=>{h.summary.anyDirty&&j(!1)},[h.summary.anyDirty]);const C=x.useCallback(()=>{S(null),y(null),a.invalidateQueries({queryKey:["agent-config",t]}),h.resetAll()},[a,t,h]),A=x.useCallback(be=>{const et=document.getElementById(be);et&&et.scrollIntoView({behavior:"smooth",block:"start"})},[]),O=St({mutationFn:be=>g1(t,be),onSuccess:()=>{a.invalidateQueries({queryKey:["agent",t]}),a.invalidateQueries({queryKey:["agents"]})}}),M=St({mutationFn:()=>YO(t),onSuccess:()=>a.invalidateQueries({queryKey:["agent",t]})}),D=St({mutationFn:()=>XO(t),onSuccess:()=>a.invalidateQueries({queryKey:["agent",t]})}),z=St({mutationFn:()=>KO(t),onSuccess:()=>n("/agents")}),L=St({mutationFn:()=>JO(t)}),[Z,te]=x.useState(!1),[q,oe]=x.useState(""),[W,me]=x.useState(null),fe=Ze({queryKey:["clients"],queryFn:hu,enabled:Z}),ee=St({mutationFn:be=>g1(t,{clientId:be}),onSuccess:()=>{a.invalidateQueries({queryKey:["agent",t]}),a.invalidateQueries({queryKey:["agent-client-status",t]}),a.invalidateQueries({queryKey:["agents"]}),te(!1),oe(""),me(null)},onError:be=>me(be instanceof Error?be.message:String(be))}),[H,re]=x.useState(!1),[K,he]=x.useState(null),T=St({mutationFn:()=>zI(t,h.buildPayloadPatch()),onSuccess:be=>{const et=be.diff.length?be.diff.map(On=>`${On.op} ${On.path}`).join(`
377
+ `):"(no changes)";he(et)},onError:be=>he(`Dry run failed: ${be instanceof Error?be.message:String(be)}`)});x.useEffect(()=>{if(!h.summary.anyDirty)return;const be=et=>{et.preventDefault(),et.returnValue=""};return window.addEventListener("beforeunload",be),()=>window.removeEventListener("beforeunload",be)},[h.summary.anyDirty]);const U=((Nr=l.data)==null?void 0:Nr.type)==="human",P=x.useMemo(()=>BF(U),[U]),_=x.useRef(null),[$,X]=x.useState(!1);x.useEffect(()=>{if(U)return;const be=_.current;if(!be||typeof IntersectionObserver>"u")return;const et=new IntersectionObserver(On=>{const _r=On[0];_r&&X(!_r.isIntersecting&&_r.boundingClientRect.top<0)},{threshold:0});return et.observe(be),()=>et.disconnect()},[U]);const[ue,Se]=x.useState(Sn.overview);x.useEffect(()=>{if(typeof IntersectionObserver>"u")return;const be=[];for(const et of P){const On=document.getElementById(et.anchor);if(!On)continue;const _r=new IntersectionObserver(Ta=>{for(const Sf of Ta)Sf.isIntersecting&&Se(et.anchor)},{rootMargin:"0% 0% -70% 0%",threshold:0});_r.observe(On),be.push(_r)}return()=>{for(const et of be)et.disconnect()}},[P]);const Me=x.useMemo(()=>{const be=new Set;for(const et of h.summary.dirtySections)et==="prompt"&&be.add(Sn.prompt),et==="model"&&be.add(Sn.setup),et==="mcp"&&be.add(Sn.tools),(et==="env"||et==="git")&&be.add(Sn.advanced);return be},[h.summary.dirtySections]);if(l.isLoading)return c.jsx("div",{className:"-m-6 flex",style:{minHeight:"100%"},children:c.jsx("div",{className:"p-6 text-body",style:{color:"var(--fg-3)"},children:"Loading…"})});if(l.error)return c.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 ye=l.data;if(!ye)return c.jsx("div",{className:"-m-6 p-6 text-body",style:{color:"var(--fg-3)"},children:"Agent not found"});const ct=ye.type==="human",ae=u.data,De=((Rn=f.data)==null?void 0:Rn.length)??0,at=!ct&&!(ae!=null&&ae.clientId),Pe=!ct&&ae?!ae.online&&!!ae.clientId:!1,Dt=ye,un=Dt.runtimeState??null,_a=Dt.runtimeType??null,Sl=Dt.totalSessions??null,Mr=ye.uuid.slice(0,8),Aa=MF({activeSessions:De,isUnclaimed:at,isOffline:Pe}),Ai=h.draft.mcp.filter(be=>be.status!=="deleted"),Ys=h.draft.env.filter(be=>be.status!=="deleted"),Xs=h.draft.git.filter(be=>be.status!=="deleted"),cn=be=>new Set(Ai.filter(et=>et.key!==be).map(et=>et.value.name.toLowerCase())),Js=be=>new Set(Ys.filter(et=>et.key!==be).map(et=>et.value.key)),ie=be=>new Set(Xs.filter(et=>et.key!==be).map(et=>{const{value:On}=et;return On.localPath?On.localPath:((On.url.split(/[?#]/)[0]??"").split(/[/:]/).filter(Boolean).pop()??"").replace(/\.git$/i,"")}).filter(Boolean)),ve={sessions:Sl??"—",active:De,runtime:_a??(ct?"human":"—"),model:((Ti=(Lu=o.data)==null?void 0:Lu.payload.model)==null?void 0:Ti.trim())||"—"},ze=(ae==null?void 0:ae.clientId)??null,$e=ze?((zi=m.data)==null?void 0:zi.find(be=>be.id===ze))??null:null,lt=ze?($e==null?void 0:$e.hostname)??ze:null,dn=_a==="kael"?"kael":"claude-code",Er=dn==="kael"?"Kael":dn==="claude-code"?"Claude Code":_a??"—";return c.jsxs("div",{className:"-m-6 flex",style:{minHeight:"calc(100vh - var(--sp-10))"},children:[c.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:[c.jsx(of,{style:{display:"block",padding:"var(--sp-1) var(--sp-4) var(--sp-2)"},children:"Agent"}),P.map(be=>c.jsxs("div",{children:[be.divider&&c.jsx("div",{"aria-hidden":!0,style:{margin:"var(--sp-2) var(--sp-3_5)",borderTop:"var(--hairline) solid var(--border)"}}),c.jsx(FF,{label:be.label,active:ue===be.anchor,danger:be.danger??!1,dirty:Me.has(be.anchor),onClick:()=>A(be.anchor)})]},be.key))]}),c.jsxs("div",{className:"flex-1 min-w-0 overflow-auto",style:{background:"var(--bg)"},children:[c.jsxs("div",{style:{padding:"var(--sp-3_5) var(--sp-5)",borderBottom:"var(--hairline) solid var(--border-faint)",background:"var(--bg-raised)"},children:[c.jsxs(OI,{style:{marginBottom:"var(--sp-2)"},children:[c.jsx(DI,{onClick:()=>n("/agents"),children:"Agents"}),c.jsx(MI,{}),c.jsx(LI,{mono:!0,children:ye.name??Mr})]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.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:c.jsx(Ms,{width:18,height:20,style:{color:"var(--accent)"}})}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-title",title:`agt_${Mr}`,children:ye.displayName}),c.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:["@",ye.name??Mr]})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 text-caption",style:{color:"var(--fg-4)"},children:[c.jsx(vn,{tone:ye.type==="autonomous_agent"?"accent":"neutral",children:ye.type}),ye.visibility&&c.jsx(vn,{tone:ye.visibility==="organization"?"accent":"outline",children:ye.visibility}),(ae==null?void 0:ae.offlineSince)&&c.jsxs("span",{className:"mono",children:["offline since ",xi(ae.offlineSince)]})]})]}),c.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[c.jsx(Ps,{state:un}),c.jsxs(pe,{variant:"ghost",size:"xs",onClick:()=>n(`/?a=${ye.uuid}`),children:[c.jsx(Lg,{className:"h-3 w-3"})," Open chat"]}),!ct&&ye.status==="active"&&c.jsxs(pe,{variant:"outline",size:"xs",onClick:()=>{L.reset(),L.mutate()},disabled:L.isPending,children:[c.jsx(Yw,{className:"h-3 w-3"}),L.isPending?"Testing…":"Test"]})]})]}),c.jsxs("div",{className:"grid gap-1.5 mt-3",style:{gridTemplateColumns:"repeat(4, 1fr)"},children:[c.jsx(ud,{label:"sessions",value:ve.sessions}),c.jsx(ud,{label:"active",value:ve.active,accent:typeof ve.active=="number"&&ve.active>0?"var(--accent)":void 0}),c.jsx(ud,{label:"runtime",value:ve.runtime}),c.jsx(ud,{label:"model",value:ve.model})]})]}),c.jsx("div",{ref:_,"aria-hidden":!0,style:{height:0}}),!ct&&c.jsx(UI,{runtimeLabel:Er,computerLabel:lt,visible:$}),c.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:[(L.data||L.error)&&c.jsx(GF,{result:L.data??{status:"error",message:"Failed to reach server"},onDismiss:()=>L.reset()}),c.jsx(Wo,{anchorId:Sn.overview,title:"Profile",right:c.jsxs(pe,{variant:"outline",size:"xs",onClick:()=>n(`/settings?agent=${ye.uuid}`),title:"Manage platform bindings in Settings",children:[c.jsx(Gw,{className:"h-3 w-3"}),"Manage bindings"]}),children:c.jsx(QI,{agent:ye,onSave:async be=>{await O.mutateAsync(be)}})}),!ct&&c.jsxs(c.Fragment,{children:[c.jsxs(Wo,{anchorId:Sn.setup,title:"Setup",caption:((Ri=o.data)==null?void 0:Ri.version)!=null?c.jsxs("span",{className:"mono",children:["config v",o.data.version,h.summary.anyDirty&&c.jsxs(c.Fragment,{children:[" · ",c.jsx("span",{style:{color:"var(--state-blocked)"},children:"draft"})]})]}):null,children:[o.isLoading&&c.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Loading configuration…"}),o.error&&c.jsxs("div",{className:"text-body",style:{color:"var(--state-error)"},children:["Failed to load configuration: ",String(o.error)]}),o.data&&c.jsx(RF,{runtimeKind:dn,computerLabel:lt,canBindComputer:at&&ye.status==="active",bindComputerPending:ee.isPending,onBindComputer:()=>te(!0),modelSlot:c.jsx(WI,{value:h.draft.model,baseline:((Lr=o.data)==null?void 0:Lr.payload.model)??"",onChange:h.setModel,onRevert:h.revertModel,disabled:ye.status!=="active"})})]}),c.jsx(Wo,{anchorId:Sn.prompt,title:"Prompt",children:o.data?c.jsx(EF,{value:h.draft.promptAppend,baseline:((Oi=o.data)==null?void 0:Oi.payload.prompt.append)??"",onChange:h.setPromptAppend,onRevert:h.revertPrompt,disabled:ye.status!=="active"}):null}),c.jsx(Wo,{anchorId:Sn.tools,title:"Tools",caption:"MCP servers available to this agent",children:o.data?c.jsx(YI,{items:h.draft.mcp,otherNames:cn,onAdd:h.addMcp,onUpdate:h.updateMcp,onDelete:h.deleteMcp,onUndoDelete:h.undoDeleteMcp,disabled:ye.status!=="active"}):null}),c.jsx(Wo,{anchorId:Sn.advanced,title:"Advanced",caption:"Environment variables and git repositories the runtime clones into each session.",children:o.data&&c.jsxs("div",{className:"space-y-4",children:[c.jsx("div",{id:ou("env"),children:c.jsx(qI,{items:h.draft.env,otherKeys:Js,onAdd:h.addEnv,onUpdate:h.updateEnv,onDelete:h.deleteEnv,onUndoDelete:h.undoDeleteEnv,disabled:ye.status!=="active"})}),c.jsx("div",{id:ou("git"),children:c.jsx(ZI,{items:h.draft.git,otherPaths:ie,onAdd:h.addGit,onUpdate:h.updateGit,onDelete:h.deleteGit,onUndoDelete:h.undoDeleteGit,disabled:ye.status!=="active"})}),K&&c.jsx("pre",{className:"whitespace-pre-wrap mono text-label",style:{padding:"var(--sp-2)",borderRadius:"var(--radius-input)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)",color:"var(--fg-2)"},children:K}),h.summary.anyDirty&&c.jsx("div",{className:"text-label",style:{color:"var(--fg-3)"},children:c.jsx("button",{type:"button",onClick:()=>T.mutate(),className:"underline bg-transparent border-0 cursor-pointer",style:{color:"var(--fg-3)"},disabled:T.isPending,children:T.isPending?"Computing dry-run…":"Preview server-side diff"})})]})})]}),c.jsx(TF,{}),c.jsx(PI,{agent:ye,suspendPending:M.isPending,reactivatePending:D.isPending,deletePending:z.isPending,onSuspend:()=>M.mutate(),onReactivate:()=>D.mutate(),onDelete:()=>z.mutate()})]}),!ct&&c.jsx(AF,{summary:h.summary,saveHint:Aa,conflictMessage:b,errorMessage:g,saving:E.isPending,justSaved:k,onSave:()=>E.mutate(),onDiscard:()=>{h.summary.anyDirty&&re(!0)},onReloadRemote:C,onJumpTo:be=>A(ou(be))})]}),c.jsx(qF,{open:H,onOpenChange:re,title:"Discard unsaved changes?",description:"Your edits to Prompt / Model / Tools / Advanced will be reverted to the last saved baseline.",confirmLabel:"Discard changes",destructive:!0,onConfirm:()=>{h.resetAll(),y(null),S(null),re(!1)}}),c.jsx(Ft,{open:Z,onOpenChange:be=>{te(be),be||(oe(""),me(null),ee.reset())},children:c.jsxs(Pt,{children:[c.jsx(Xt,{children:c.jsx(qt,{children:"Bind computer"})}),c.jsxs("div",{className:"space-y-4",children:[c.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."}),fe.isLoading?c.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Loading computers…"}):fe.error?c.jsxs("div",{className:"text-body",style:{color:"var(--state-error)"},children:["Failed to load computers: ",fe.error instanceof Error?fe.error.message:"Unknown"]}):c.jsx(HF,{clients:fe.data??[],selected:q,onSelect:oe}),W&&c.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:W})]}),c.jsxs(tn,{children:[c.jsx(pe,{variant:"outline",onClick:()=>te(!1),children:"Cancel"}),c.jsx(pe,{disabled:!q||ee.isPending,onClick:()=>{me(null),ee.mutate(q)},children:ee.isPending?"Binding…":"Bind"})]})]})})]})}function FF({label:e,active:t,danger:n,dirty:a,onClick:l}){return c.jsx("button",{type:"button",onClick:l,className:Ne("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:c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"flex-1 truncate",children:e}),a&&c.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&&c.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 qF(e){return c.jsx(Ft,{open:e.open,onOpenChange:e.onOpenChange,children:c.jsxs(Pt,{children:[c.jsx(Xt,{children:c.jsx(qt,{children:e.title})}),c.jsx("div",{className:"space-y-3 text-body",style:{color:"var(--fg-2)"},children:e.description}),c.jsxs(tn,{children:[c.jsx(pe,{type:"button",variant:"ghost",onClick:()=>e.onOpenChange(!1),disabled:e.pending,children:"Cancel"}),c.jsx(pe,{type:"button",variant:e.destructive?"destructive":"default",onClick:e.onConfirm,disabled:e.pending,children:e.pending?"Working…":e.confirmLabel})]})]})})}function HF({clients:e,selected:t,onSelect:n}){const a=e.filter(l=>l.status==="connected");return a.length===0?c.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"," ",c.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."]}):c.jsx("ul",{className:"max-h-64 overflow-y-auto",style:{border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",margin:0,padding:0,listStyle:"none"},children:a.map(l=>{const o=l.id===t,u=l.status==="online"||l.status==="active";return c.jsx("li",{style:{borderTop:"var(--hairline) solid var(--border-faint)"},children:c.jsxs("button",{type:"button",onClick:()=>n(l.id),className:Ne("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:[c.jsx("span",{className:Ne("inline-block h-2 w-2 rounded-full shrink-0"),style:{background:u?"var(--state-idle)":"var(--fg-4)"},"aria-hidden":!0}),c.jsxs("span",{className:"flex-1 min-w-0",children:[c.jsx("span",{className:"block text-body truncate font-medium",children:l.hostname??l.id}),c.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}`:""]})]}),c.jsx("span",{className:"text-label",style:{color:"var(--fg-3)"},children:l.status})]})},l.id)})})}const ZF={success:"Connected",timeout:"Timed out",offline:"Offline",stale:"Stale",error:"Error"},VF={success:"var(--state-idle)",timeout:"var(--state-blocked)",offline:"var(--state-offline)",stale:"var(--state-blocked)",error:"var(--state-error)"},QF={success:"accent",timeout:"warn",stale:"warn",error:"error",offline:"neutral"};function GF({result:e,onDismiss:t}){const n=VF[e.status],a=QF[e.status],l=e.connection;return c.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:c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{className:"space-y-1.5",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(vn,{tone:a,children:ZF[e.status]}),e.responseTime!=null&&c.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:[(e.responseTime/1e3).toFixed(1),"s"]})]}),e.message&&c.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:e.message}),l&&c.jsxs("div",{className:"text-label",style:{color:"var(--fg-3)",borderTop:"var(--hairline) solid var(--border-faint)",paddingTop:6,marginTop:2},children:[c.jsx("div",{children:l.runtimeState&&c.jsxs("span",{className:"mono",children:["runtime: ",l.runtimeState]})}),l.client?c.jsxs("div",{children:["Computer: ",l.client.hostname??l.client.id,l.client.os&&` (${l.client.os})`,l.client.sdkVersion&&` · SDK ${l.client.sdkVersion}`]}):c.jsx("div",{children:"No computer bound"}),l.lastSeenAt&&c.jsxs("div",{children:["Last seen: ",new Date(l.lastSeenAt).toLocaleString()]})]}),e.responseContent&&c.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})]}),c.jsx(pe,{variant:"ghost",size:"sm",onClick:t,children:"Dismiss"})]})})}function KF(e){return/^[A-Za-z0-9_./:=-]+$/.test(e)?e:`'${e.replace(/'/g,"'\\''")}'`}function YF({agent:e,open:t,onClose:n,onBound:a}){var y;const[l,o]=x.useState(!1),u=Ze({queryKey:["connect-token",e.uuid],queryFn:()=>hk(),enabled:t,staleTime:6e4}),f=Ze({queryKey:["agent-poll",e.uuid],queryFn:()=>hj(e.uuid),enabled:t&&!e.clientId,refetchInterval:2e3});x.useEffect(()=>{const b=f.data;b!=null&&b.clientId&&a(b)},[f.data,a]);const m=((y=u.data)==null?void 0:y.command)??"",h=m&&e.name?`npm install -g @agent-team-foundation/first-tree-hub && first-tree-hub agent add ${KF(e.name)} --agent-id ${e.uuid} && `+m:m;function g(){h&&(navigator.clipboard.writeText(h),o(!0),setTimeout(()=>o(!1),2e3))}return c.jsx(Ft,{open:t,onOpenChange:b=>!b&&n(),children:c.jsxs(Pt,{className:"max-w-lg",children:[c.jsx(Xt,{children:c.jsx(qt,{children:"Last step — connect your computer"})}),c.jsxs("div",{className:"space-y-4",children:[c.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."}),c.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-border bg-muted p-3",children:[c.jsx("code",{className:"flex-1 text-caption font-mono break-all select-all",children:h||"Generating command…"}),c.jsx(pe,{variant:"outline",size:"icon",className:"shrink-0",onClick:g,disabled:!h,children:l?c.jsx(bi,{className:"h-4 w-4",style:{color:"var(--state-idle)"}}):c.jsx(Mg,{className:"h-4 w-4"})})]}),c.jsxs("div",{className:"flex items-center gap-2 text-body text-muted-foreground",children:[c.jsx(Gr,{state:"working",size:8}),c.jsx("span",{children:"Waiting for your computer to connect…"})]}),c.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."})]}),c.jsx(tn,{children:c.jsx(pe,{variant:"outline",onClick:n,children:"Skip for now"})})]})})}const Cp=200;function XF(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 PS(e){return e.toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^[-_]+|[-_]+$/g,"").slice(0,ys)}function JF(e){return e.toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^[-_]+/,"").slice(0,ys)}function WF(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 eq({open:e,onOpenChange:t,onCreated:n}){const a=zn(),[l,o]=x.useState(""),[u,f]=x.useState(""),[m,h]=x.useState(!1),[g,y]=x.useState("claude-code"),[b,S]=x.useState("form"),[k,j]=x.useState([]),[E,C]=x.useState(null),[A,O]=x.useState(!1),[M,D]=x.useState({}),[z,L]=x.useState({status:"idle"});x.useEffect(()=>{e&&(o(""),f(""),h(!1),y("claude-code"),S("form"),j([]),C(null),O(!1),D({}),L({status:"idle"}))},[e]),x.useEffect(()=>{m||f(PS(l))},[l,m]);const Z=x.useRef(0);x.useEffect(()=>{if(!e||!u){L({status:"idle"});return}if(!ag.test(u)){L({status:"bad",reason:"invalid"});return}if(ig(u)){L({status:"bad",reason:"reserved"});return}const K=++Z.current;L({status:"checking"});const he=window.setTimeout(()=>{GO(u).then(T=>{K===Z.current&&(T.available?L({status:"ok"}):L({status:"bad",reason:T.reason}))}).catch(()=>{K===Z.current&&L({status:"idle"})})},300);return()=>window.clearTimeout(he)},[u,e]);const te=St({mutationFn:async K=>{const he=l.trim()||u.trim()||"Untitled assistant";return QO({name:u||void 0,type:"personal_assistant",displayName:he,clientId:K.clientId})},onSuccess:K=>{a.invalidateQueries({queryKey:["agents"]}),a.invalidateQueries({queryKey:["activity"]}),n(K,g)}}),q=x.useMemo(()=>{const K=te.error;if(!K)return{};if(K instanceof Qd){const he=XF(K.issues);return Object.keys(he).length>0?he:K.status===409?{name:"That agent name is already in use in this organization. Pick a different one."}:{_root:K.message}}return K instanceof Error?{_root:K.message}:{}},[te.error]),oe=z.status==="bad"?WF(z.reason):void 0,W={...oe?{name:oe}:{},...q,...M};function me(){const K={};return u?u.length>ys?K.name=`Agent name must be at most ${ys} characters (got ${u.length}).`:ag.test(u)?ig(u)&&(K.name="That agent name is reserved — pick a different one."):K.name="Agent name must start with a letter or digit and contain only lowercase letters, digits, hyphens (-), and underscores (_).":l.trim().length>0&&(K.name="Agent name must contain at least one letter or digit (e.g. a-z, 0-9)."),l.length>Cp&&(K.displayName=`Display name must be at most ${Cp} characters (got ${l.length}).`),K}async function fe(K){var T,U;K.preventDefault();const he=me();if(D(he),!(Object.keys(he).length>0)&&z.status!=="bad"){if(g!=="claude-code"){te.mutate({clientId:void 0});return}O(!0);try{const _=(await hu()).filter(X=>X.status==="connected");if(_.length===0){te.mutate({clientId:void 0});return}if(_.length===1){te.mutate({clientId:(T=_[0])==null?void 0:T.id});return}const $=[..._].sort((X,ue)=>ue.lastSeenAt.localeCompare(X.lastSeenAt));j($),C(((U=$[0])==null?void 0:U.id)??null),S("pick-computer")}catch{te.mutate({clientId:void 0})}finally{O(!1)}}}function ee(){E&&te.mutate({clientId:E})}const H=z.status==="bad",re=l.trim().length>0&&!H&&!te.isPending&&!A;return b==="pick-computer"?c.jsx(Ft,{open:e,onOpenChange:t,children:c.jsxs(Pt,{className:"max-w-lg",children:[c.jsx(Xt,{children:c.jsx(qt,{children:"Choose a computer"})}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("p",{className:"text-body text-muted-foreground",children:["Multiple computers are online. Pick where ",c.jsx("span",{className:"font-medium",children:l||u})," ","should run:"]}),c.jsx("div",{className:"space-y-2",children:k.map(K=>{const he=E===K.id;return c.jsxs("label",{className:he?"flex items-start gap-3 rounded-md border border-primary bg-primary/5 p-3 cursor-pointer":"flex items-start gap-3 rounded-md border border-border p-3 cursor-pointer hover:bg-accent/30",children:[c.jsx("input",{type:"radio",name:"target-computer",checked:he,onChange:()=>C(K.id),className:"mt-1"}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("div",{className:"text-body font-medium truncate",children:K.hostname??K.id}),c.jsxs("div",{className:"text-caption text-muted-foreground",children:[K.os??"unknown OS"," · last seen ",new Date(K.lastSeenAt).toLocaleString()]})]})]},K.id)})}),W.clientId&&c.jsx("p",{className:"text-body text-destructive",children:W.clientId}),W._root&&c.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-body text-destructive",children:W._root})]}),c.jsxs(tn,{children:[c.jsx(pe,{variant:"outline",onClick:()=>S("form"),disabled:te.isPending,children:"Back"}),c.jsx(pe,{onClick:ee,disabled:!E||te.isPending,children:te.isPending?"Creating…":"Create"})]})]})}):c.jsx(Ft,{open:e,onOpenChange:t,children:c.jsxs(Pt,{className:"max-w-lg",children:[c.jsx(Xt,{children:c.jsx(qt,{children:"New Agent"})}),c.jsxs("form",{onSubmit:fe,className:"space-y-5",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(rt,{htmlFor:"new-agent-display-name",children:"Display name"}),c.jsx(ht,{id:"new-agent-display-name",value:l,onChange:K=>{o(K.target.value),M.displayName&&D(he=>({...he,displayName:void 0}))},placeholder:"My Dev Assistant",autoFocus:!0,maxLength:Cp,"aria-invalid":W.displayName?!0:void 0,"aria-describedby":"new-agent-display-name-help new-agent-display-name-error"}),c.jsx("p",{id:"new-agent-display-name-help",className:"text-caption text-muted-foreground",children:"How teammates see this agent in chats and lists. Can be changed anytime."}),W.displayName&&c.jsx("p",{id:"new-agent-display-name-error",className:"text-caption text-destructive",children:W.displayName})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(rt,{htmlFor:"new-agent-name",children:"Agent name"}),c.jsxs("div",{className:"flex items-stretch",children:[c.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:"@"}),c.jsx(ht,{id:"new-agent-name",value:u,onChange:K=>{const he=JF(K.target.value);f(he),h(!0),M.name&&D(T=>({...T,name:void 0}))},onBlur:K=>{const he=PS(K.target.value);he!==u&&f(he)},placeholder:"my-dev-assistant",className:"rounded-l-none font-mono",maxLength:ys,"aria-invalid":W.name?!0:void 0,"aria-describedby":"new-agent-name-help new-agent-name-error new-agent-name-status"})]}),c.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"," ",ys," characters. Permanent after creation."]}),u&&!W.name&&z.status!=="idle"&&c.jsxs("p",{id:"new-agent-name-status",className:"text-caption",style:{color:z.status==="ok"?"var(--state-idle)":z.status==="checking"?"var(--fg-3)":"var(--fg-4)"},children:[z.status==="checking"&&"Checking availability…",z.status==="ok"&&"Available."]}),W.name&&c.jsx("p",{id:"new-agent-name-error",className:"text-caption text-destructive",children:W.name})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(rt,{children:"Where it runs"}),c.jsxs("div",{className:"space-y-2",children:[c.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:[c.jsx("input",{type:"radio",name:"runtime",checked:g==="claude-code",onChange:()=>y("claude-code"),className:"mt-1"}),c.jsxs("div",{children:[c.jsx("div",{className:"text-body font-medium",children:"Claude Code"}),c.jsx("div",{className:"text-caption text-muted-foreground",children:"Runs on your computer, can access your local files. (default)"})]})]}),c.jsxs("label",{className:"flex items-start gap-3 rounded-md border border-border p-3 cursor-not-allowed opacity-60",title:"Coming soon",children:[c.jsx("input",{type:"radio",name:"runtime",disabled:!0,className:"mt-1"}),c.jsxs("div",{children:[c.jsxs("div",{className:"text-body font-medium",children:["Kael ",c.jsx("span",{className:"ml-1 text-caption font-normal text-muted-foreground",children:"— coming soon"})]}),c.jsx("div",{className:"text-caption text-muted-foreground",children:"Ready to go, runs in the cloud."})]})]})]})]}),W._root&&c.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-body text-destructive",children:W._root}),c.jsx(tn,{children:c.jsx(pe,{type:"submit",disabled:!re,children:A?"Checking computers…":te.isPending?"Creating…":"Create"})})]})]})})}function ru({active:e,count:t,warn:n,className:a,children:l,style:o,...u}){return c.jsxs("button",{type:"button",className:Ne("mono inline-flex items-center gap-1 text-caption leading-[1.6]",a),style:{padding:"var(--sp-0_5) var(--sp-1_75)",borderRadius:3,border:`var(--hairline) solid ${e?"var(--border-strong)":"var(--border)"}`,background:e?"var(--bg-active)":"transparent",color:e?"var(--fg)":"var(--fg-3)",cursor:"pointer",...o},...u,children:[l,t!==void 0&&c.jsx("span",{className:"mono",style:{color:n&&typeof t=="number"&&t>0?"var(--state-error)":"var(--fg-4)"},children:t})]})}const tq=Object.values(h6);function BS(e){return[...e].sort((t,n)=>{const a=(t.displayName||t.name||"").toLowerCase(),l=(n.displayName||n.name||"").toLowerCase();return a.localeCompare(l)})}function nq(e,t){const n=t.get(e.uuid);return{runtimeState:(n==null?void 0:n.runtimeState)??null}}function ds(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 rq(){const e=kn(),{memberId:t}=rn(),[n,a]=x.useState(),[l,o]=x.useState(""),[u,f]=x.useState(!1),[m,h]=x.useState(null),[g,y]=x.useState("all"),[b,S]=x.useState(""),k=vl(),j=qg(),E=ry(),{data:C,isLoading:A,error:O}=Ze({queryKey:["agents",n,l],queryFn:()=>zu({limit:100,cursor:n,type:l||void 0})}),{data:M}=Ze({queryKey:["activity"],queryFn:Au,refetchInterval:1e4}),D=x.useMemo(()=>{const K=new Map;for(const he of(M==null?void 0:M.agents)??[])K.set(he.agentId,he);return K},[M==null?void 0:M.agents]),{myAgents:z,teamAgents:L}=x.useMemo(()=>{if(!(C!=null&&C.items))return{myAgents:[],teamAgents:[]};const K=[],he=[];for(const T of C.items)t&&T.managerId===t?K.push(T):he.push(T);return{myAgents:BS(K),teamAgents:BS(he)}},[C,t]),Z=(C==null?void 0:C.items.length)??0,te=z.length,q=L.length,oe=x.useMemo(()=>((C==null?void 0:C.items)??[]).filter(K=>{var he;return((he=D.get(K.uuid))==null?void 0:he.runtimeState)==="working"}).length,[C==null?void 0:C.items,D]),W=x.useMemo(()=>((C==null?void 0:C.items)??[]).filter(K=>{var T;const he=(T=D.get(K.uuid))==null?void 0:T.runtimeState;return he==="blocked"||he==="error"}).length,[C==null?void 0:C.items,D]);function me(K){var T;const he=(T=D.get(K.uuid))==null?void 0:T.runtimeState;return g==="mine"?t!=null&&K.managerId===t:g==="running"?he==="working":g==="attn"?he==="blocked"||he==="error":!0}function fe(K){if(!b.trim())return!0;const he=b.toLowerCase(),T=K.delegateMention?k(K.delegateMention):"",U=E(K.managerId);return(K.name??"").toLowerCase().includes(he)||K.displayName.toLowerCase().includes(he)||T.toLowerCase().includes(he)||U.toLowerCase().includes(he)}const ee=z.filter(K=>me(K)&&fe(K)),H=L.filter(K=>me(K)&&fe(K));function re(K,he){if(f(!1),K.clientId){e(`/?a=${K.uuid}`);return}if(he==="claude-code"){h(K);return}e(`/?a=${K.uuid}`)}return c.jsxs("div",{className:"-m-6",children:[c.jsx(sf,{title:"Agents",subtitle:Z>0?c.jsxs(c.Fragment,{children:[Z," total · ",te," mine · ",q," team"]}):null,right:c.jsx("div",{className:"flex items-center gap-1.5",children:c.jsxs(pe,{size:"xs",onClick:()=>f(!0),children:[c.jsx(ja,{className:"h-3 w-3"}),"New agent"]})})}),c.jsxs("div",{style:{padding:"var(--sp-3_5) var(--sp-5) var(--sp-7)"},children:[c.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:[c.jsxs("div",{className:"relative",style:{width:240},children:[c.jsx(Gd,{className:"absolute pointer-events-none",style:{left:8,top:"50%",transform:"translateY(-50%)",color:"var(--fg-4)"},size:13}),c.jsx("input",{value:b,onChange:K=>S(K.target.value),placeholder:"Filter by name, delegate, owner…",className:"w-full outline-none text-body",style:{padding:"var(--sp-1_25) var(--sp-2_5) var(--sp-1_25) var(--sp-7)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",color:"var(--fg)"}})]}),c.jsxs("div",{className:"flex gap-1",children:[c.jsx(ru,{active:g==="all",count:Z,onClick:()=>y("all"),children:"all"}),c.jsx(ru,{active:g==="mine",count:te,onClick:()=>y("mine"),children:"mine"}),c.jsx(ru,{active:g==="running",count:oe,onClick:()=>y("running"),children:"running"}),c.jsx(ru,{active:g==="attn",count:W,warn:!0,onClick:()=>y("attn"),children:"attn"})]}),c.jsx("div",{style:{flex:1}}),c.jsxs("select",{value:l,onChange:K=>{o(K.target.value),a(void 0)},className:"outline-none text-label",style:{padding:"var(--sp-1_25) var(--sp-2_5)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",color:"var(--fg)"},children:[c.jsx("option",{value:"",children:"all types"}),tq.map(K=>c.jsx("option",{value:K,children:K},K))]})]}),A?c.jsx("div",{className:"text-center py-8",style:{color:"var(--fg-3)"},children:"Loading…"}):O?c.jsxs("div",{className:"text-center py-8",style:{color:"var(--state-error)"},children:["Failed to load agents: ",O instanceof Error?O.message:"Unknown error"]}):c.jsxs(c.Fragment,{children:[c.jsx($S,{title:`My agents · ${ee.length}`,agents:ee,runtimeMap:D,resolveAgentIdentity:j,resolveMemberName:E,navigate:e,showOwner:!1,emptyLabel:z.length===0?"No agents yet — create one to get started":"No agents match the current filter",breakdown:c.jsx(FS,{items:[{state:"working",count:ds(z,D,"working")},{state:"blocked",count:ds(z,D,"blocked")},{state:"error",count:ds(z,D,"error")}]}),className:"mb-4"}),L.length>0&&c.jsx($S,{title:`Team agents · ${H.length}`,agents:H,runtimeMap:D,resolveAgentIdentity:j,resolveMemberName:E,navigate:e,showOwner:!0,emptyLabel:"No agents match the current filter",breakdown:c.jsx(FS,{items:[{state:"working",count:ds(L,D,"working")},{state:"blocked",count:ds(L,D,"blocked")},{state:"error",count:ds(L,D,"error")}]})})]}),(C==null?void 0:C.nextCursor)&&c.jsx("div",{className:"flex justify-end mt-4",children:c.jsx(pe,{variant:"outline",size:"xs",onClick:()=>a(C.nextCursor??void 0),children:"Next page"})})]}),c.jsx(eq,{open:u,onOpenChange:f,onCreated:re}),m&&c.jsx(YF,{agent:m,open:m!==null,onClose:()=>{const K=m.uuid;h(null),e(`/?a=${K}`)},onBound:K=>{h(null),e(`/?a=${K.uuid}`)}})]})}function $S({title:e,agents:t,runtimeMap:n,resolveAgentIdentity:a,resolveMemberName:l,navigate:o,emptyLabel:u,breakdown:f,className:m,showOwner:h}){return c.jsxs(nn,{className:m,children:[c.jsx(Us,{right:f,children:e}),t.length===0?c.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:u}):c.jsxs(fl,{children:[c.jsx(hl,{children:c.jsxs(ar,{children:[c.jsx(Ue,{children:"Display name"}),c.jsx(Ue,{children:"Agent name"}),c.jsx(Ue,{children:"Type"}),c.jsx(Ue,{children:"Delegate"}),h&&c.jsx(Ue,{children:"Owner"}),c.jsx(Ue,{children:"Runtime"}),c.jsx(Ue,{children:"Status"}),c.jsx(Ue,{children:"Created"})]})}),c.jsx(ml,{children:t.map(g=>c.jsx(aq,{agent:g,runtime:nq(g,n),resolveAgentIdentity:a,resolveMemberName:l,navigate:o,showOwner:h},g.uuid))})]})]})}function FS({items:e}){const t=e.filter(n=>n.count>0);return t.length===0?null:c.jsx("span",{className:"inline-flex items-center",children:t.map((n,a)=>c.jsxs("span",{className:"inline-flex items-center",children:[a>0&&c.jsx("span",{style:{color:"var(--fg-4)",margin:"0 var(--sp-1_5)"},"aria-hidden":!0,children:"·"}),c.jsxs("span",{className:"mono inline-flex items-center gap-1 text-caption",style:{color:`var(--state-${n.state})`},children:[c.jsx("span",{"aria-hidden":!0,children:"●"}),n.count," ",n.label??n.state]})]},n.state))})}function aq({agent:e,runtime:t,resolveAgentIdentity:n,resolveMemberName:a,navigate:l,showOwner:o}){const{runtimeState:u}=t,f=u==="idle"||u==="working"||u==="blocked"||u==="error"||u==="offline",m=e.delegateMention?n(e.delegateMention):null;return c.jsxs(ar,{interactive:!0,onClick:()=>l(`/agents/${e.uuid}`),children:[c.jsx(Le,{children:c.jsx("span",{className:"font-medium",children:e.displayName})}),c.jsx(Le,{children:e.name?c.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-3)"},children:["@",e.name]}):c.jsx("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:"—"})}),c.jsx(Le,{children:c.jsx(vn,{tone:e.type==="autonomous_agent"?"accent":"neutral",children:e.type})}),c.jsx(Le,{children:e.delegateMention?c.jsx(kC,{name:(m==null?void 0:m.name)??null,displayName:(m==null?void 0:m.displayName)??null,tone:"accent"}):c.jsx("span",{style:{color:"var(--fg-4)"},children:"—"})}),o&&c.jsx(Le,{className:"text-label",style:{color:"var(--fg-2)"},children:a(e.managerId)}),c.jsx(Le,{children:u&&f?c.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[c.jsx(Gr,{state:u,size:7}),c.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-3)"},children:u})]}):c.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:"—"})}),c.jsx(Le,{children:c.jsx(vn,{tone:e.status==="active"?"accent":"outline",children:e.status})}),c.jsx(Le,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:xi(e.createdAt)})]})}function iq(){const{data:e}=Ze({queryKey:["members","user-name-map"],queryFn:uf,staleTime:3e4});return x.useMemo(()=>{const t=new Map;if(e)for(const n of e)t.set(n.userId,n.displayName||n.username);return n=>n?t.get(n)??n:"—"},[e])}function lq(){const[e,t]=x.useState(null),[n,a]=x.useState(!1),l=St({mutationFn:hk,onSuccess:u=>{t(u),a(!1)}}),o=async()=>{e&&(await navigator.clipboard.writeText(e.command),a(!0),setTimeout(()=>a(!1),2e3))};return c.jsxs("div",{className:"grid items-center gap-2.5 mb-3.5",style:{gridTemplateColumns:"auto 1fr auto auto",padding:"var(--sp-2) var(--sp-3)",background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)"},children:[c.jsxs("span",{className:"inline-flex items-center gap-2 text-body",style:{color:"var(--fg-2)"},children:[c.jsx(xz,{className:"h-3.5 w-3.5"}),"Connect a computer"]}),e?c.jsxs("code",{className:"mono whitespace-nowrap overflow-hidden text-ellipsis text-label",style:{padding:"var(--sp-1_25) var(--sp-2_5)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)",borderRadius:"var(--radius-input)",color:"var(--fg-2)"},title:e.command,children:[e.command," ",c.jsxs("span",{style:{color:"var(--fg-4)"},children:["# expires in ",Math.round(e.expiresIn/60),"m"]})]}):c.jsx("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:"Generate a single-use command to pair a new machine with this Hub."}),c.jsxs(pe,{variant:"outline",size:"xs",onClick:o,disabled:!e,children:[n?c.jsx(bi,{className:"h-3 w-3"}):c.jsx(Mg,{className:"h-3 w-3"}),n?"Copied":"Copy"]}),c.jsx(pe,{variant:"outline",size:"xs",onClick:()=>l.mutate(),disabled:l.isPending,children:l.isPending?"Generating…":e?"Regenerate":"Generate"})]})}function sq(){const e=zn(),t=vl(),n=iq(),{role:a}=rn(),l=a==="admin",[o,u]=x.useState(null),[f,m]=x.useState(null),[h,g]=x.useState(null),[y,b]=x.useState(null),{data:S}=Ze({queryKey:["clients"],queryFn:hu,refetchInterval:1e4}),{data:k}=Ze({queryKey:["activity"],queryFn:Au,refetchInterval:1e4}),j=St({mutationFn:SR,onSuccess:()=>{m(null),e.invalidateQueries({queryKey:["clients"]}),e.invalidateQueries({queryKey:["activity"]})}}),E=St({mutationFn:xR,onSuccess:()=>{g(null),b(null),e.invalidateQueries({queryKey:["clients"]}),e.invalidateQueries({queryKey:["activity"]})},onError:D=>{D instanceof Qd?b(D.message):b(D instanceof Error?D.message:String(D))}}),C=x.useMemo(()=>{const D=new Map;for(const z of(k==null?void 0:k.agents)??[]){if(!z.clientId)continue;const L=D.get(z.clientId)??[];L.push(z),D.set(z.clientId,L)}return D},[k==null?void 0:k.agents]),A=D=>C.get(D)??[],O=(S??[]).filter(D=>D.status==="connected").length,M=(S??[]).reduce((D,z)=>D+z.agentCount,0);return c.jsxs("div",{className:"-m-6",children:[c.jsx(sf,{title:"Computers",subtitle:S&&S.length>0?c.jsxs(c.Fragment,{children:[S.length," total · ",O," connected · ",M," agents bound"]}):null}),c.jsxs("div",{style:{padding:"var(--sp-3_5) var(--sp-5) var(--sp-7)"},children:[c.jsx(lq,{}),h&&c.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-overlay-scrim",children:c.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:[c.jsx("h3",{className:"text-subtitle mb-2",children:"Retire Computer"}),c.jsxs("p",{className:"text-body mb-3",style:{color:"var(--fg-3)"},children:["Permanently remove"," ",c.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)."]}),A(h.id).length>0&&c.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:[c.jsx("div",{className:"text-label mb-1",children:"Agents currently bound to this computer (delete them first):"}),c.jsx("ul",{className:"text-body space-y-0.5",children:A(h.id).map(D=>c.jsx("li",{className:"font-medium",children:t(D.agentId)},D.agentId))})]}),y&&c.jsx("div",{className:"mb-3 p-2 rounded text-body",style:{background:"color-mix(in oklch, var(--state-error) 12%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-error) 28%, transparent)",color:"var(--state-error)"},children:y}),c.jsxs("div",{className:"flex justify-end gap-2",children:[c.jsx(pe,{variant:"outline",size:"sm",onClick:()=>{g(null),b(null)},children:"Cancel"}),c.jsx(pe,{variant:"destructive",size:"sm",onClick:()=>E.mutate(h.id),disabled:E.isPending,children:E.isPending?"Retiring…":"Retire"})]})]})}),f&&c.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-overlay-scrim",children:c.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:[c.jsx("h3",{className:"text-subtitle mb-2",children:"Disconnect Computer"}),c.jsxs("p",{className:"text-body mb-3",style:{color:"var(--fg-3)"},children:["This will disconnect"," ",c.jsx("span",{className:"font-medium",style:{color:"var(--fg)"},children:f.hostname??f.id.slice(0,8)})," ","and affect all bound agents:"]}),c.jsx("ul",{className:"mb-4 space-y-1",children:A(f.id).length===0?c.jsx("li",{className:"text-body",style:{color:"var(--fg-3)"},children:"No bound agents"}):A(f.id).map(D=>c.jsxs("li",{className:"text-body flex items-center gap-2",children:[c.jsx("span",{className:"font-medium",children:t(D.agentId)}),c.jsx(Ps,{state:D.runtimeState})]},D.agentId))}),c.jsxs("div",{className:"flex justify-end gap-2",children:[c.jsx(pe,{variant:"outline",size:"sm",onClick:()=>m(null),children:"Cancel"}),c.jsx(pe,{variant:"destructive",size:"sm",onClick:()=>j.mutate(f.id),disabled:j.isPending,children:j.isPending?"Disconnecting…":"Disconnect"})]})]})}),!S||S.length===0?c.jsx(nn,{children:c.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."})}):c.jsxs(nn,{children:[c.jsxs(Us,{right:c.jsx("span",{className:"mono text-caption normal-case tracking-normal",style:{color:"var(--fg-3)"},children:"click a row to expand"}),children:["Registered · ",S.length]}),c.jsxs(fl,{children:[c.jsx(hl,{children:c.jsxs(ar,{children:[c.jsx(Ue,{style:{width:16}}),c.jsx(Ue,{children:"Hostname"}),l&&c.jsx(Ue,{children:"Owner"}),c.jsx(Ue,{children:"OS"}),c.jsx(Ue,{children:"SDK"}),c.jsx(Ue,{children:"Agents"}),c.jsx(Ue,{children:"Connected"}),c.jsx(Ue,{children:"Status"}),c.jsx(Ue,{})]})}),c.jsx(ml,{children:S.map(D=>{const z=o===D.id,L=A(D.id);return c.jsx(oq,{client:D,boundAgents:L,isExpanded:z,agentName:t,showOwner:l,ownerName:n,onToggle:()=>u(z?null:D.id),onDisconnect:()=>m(D),onRetire:()=>{b(null),g(D)}},D.id)})})]})]})]})]})}function oq({client:e,boundAgents:t,isExpanded:n,agentName:a,showOwner:l,ownerName:o,onToggle:u,onDisconnect:f,onRetire:m}){const h=l?9:8,g=e.status==="connected"?"idle":"offline";return c.jsxs(c.Fragment,{children:[c.jsxs(ar,{interactive:!0,selected:n,onClick:u,children:[c.jsx(Le,{style:{width:16},children:c.jsx("span",{style:{color:"var(--fg-4)",display:"inline-flex"},children:n?c.jsx(IT,{className:"h-3.5 w-3.5"}):c.jsx(PT,{className:"h-3.5 w-3.5"})})}),c.jsx(Le,{className:"font-medium",children:e.hostname??"—"}),l&&c.jsx(Le,{style:{color:"var(--fg-2)"},children:o(e.userId)}),c.jsx(Le,{style:{color:"var(--fg-3)"},children:e.os??"—"}),c.jsx(Le,{className:"mono text-label",style:{color:"var(--fg-3)"},children:e.sdkVersion??"—"}),c.jsx(Le,{children:c.jsx("span",{className:"mono tnum text-label",children:e.agentCount})}),c.jsx(Le,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:e.connectedAt?xi(e.connectedAt):"—"}),c.jsx(Le,{children:c.jsx(Ps,{state:g})}),c.jsx(Le,{style:{width:1,whiteSpace:"nowrap"},children:c.jsxs("div",{className:"flex gap-1 justify-end",children:[c.jsxs(pe,{variant:"ghost",size:"xs",className:"text-label",onClick:y=>{y.stopPropagation(),f()},children:[c.jsx(Nz,{className:"h-3 w-3"})," Disconnect"]}),c.jsxs(pe,{variant:"ghost",size:"xs",className:"text-label",style:{color:"var(--fg-4)"},onClick:y=>{y.stopPropagation(),m()},children:[c.jsx(Ds,{className:"h-3 w-3"})," Retire"]})]})})]}),n&&c.jsxs("tr",{style:{background:"var(--bg-sunken)"},children:[c.jsx(Le,{}),c.jsxs(Le,{colSpan:h-1,style:{padding:"var(--sp-2_5) var(--sp-3) var(--sp-3_5)"},children:[c.jsxs(of,{style:{display:"block",marginBottom:6},children:["Bound agents · ",t.length]}),t.length===0?c.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"No agents bound to this computer"}):c.jsx("div",{className:"flex flex-col gap-1",children:t.map(y=>c.jsxs("div",{className:"flex items-center gap-2.5 text-body",children:[c.jsx("span",{className:"mono font-medium",style:{minWidth:180},children:a(y.agentId)}),c.jsx(Ps,{state:y.runtimeState}),y.activeSessions!==null&&c.jsxs("span",{className:"mono tnum text-caption",style:{color:"var(--fg-3)"},children:[y.activeSessions," / ",y.totalSessions??0," sessions"]})]},y.agentId))})]})]})]})}function uq(){const{token:e}=Ow(),t=kn(),{isAuthenticated:n,adoptTokens:a}=rn(),[l,o]=x.useState(null),[u,f]=x.useState(null),[m,h]=x.useState(!1);if(x.useEffect(()=>{e&&(async()=>{try{const b=await fetch(`/api/v1/invite/${encodeURIComponent(e)}/preview`);if(!b.ok){const S=await b.json().catch(()=>({}));f(S.error??"This invitation is no longer valid");return}o(await b.json())}catch{f("Network error while loading invitation")}})()},[e]),!e)return c.jsx(Ep,{children:"Bad invitation URL"});if(u)return c.jsx(Ep,{children:u});if(!l)return c.jsx(Ep,{children:"Loading…"});const g=async()=>{if(e){h(!0);try{const b=await Ce.post("/me/organizations/join",{token:e});await a(b.tokens),vj("invite"),t("/",{replace:!0})}catch(b){f(b instanceof Error?b.message:"Failed to join team")}finally{h(!1)}}},y=`/api/v1/auth/github/start?next=${encodeURIComponent(`/invite/${e}`)}`;return c.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:c.jsxs(cf,{className:"w-full max-w-md",children:[c.jsxs(df,{className:"text-center",children:[c.jsxs(ff,{className:"text-title",children:["Join ",l.organizationDisplayName]}),c.jsxs(hf,{children:["You've been invited as a ",l.role,".",c.jsx("br",{}),c.jsxs("span",{className:"text-muted-foreground",children:["team: ",l.organizationName]})]})]}),c.jsx(mf,{className:"space-y-4",children:n?c.jsx(pe,{className:"w-full",disabled:m,onClick:g,children:m?"Joining…":`Join ${l.organizationDisplayName}`}):c.jsx(pe,{asChild:!0,className:"w-full",children:c.jsxs("a",{href:y,children:[c.jsx(Qw,{className:"h-4 w-4"}),"Continue with GitHub to join"]})})})]})})}function Ep({children:e}){return c.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background text-body text-muted-foreground",children:e})}function cq(){const{isAuthenticated:e,login:t}=rn(),[n,a]=x.useState(""),[l,o]=x.useState(""),[u,f]=x.useState(null),[m,h]=x.useState(!1);if(e)return c.jsx(Hd,{to:"/",replace:!0});const g=async y=>{y.preventDefault(),f(null),h(!0);try{await t(n,l)}catch(b){f(b instanceof Error?b.message:"Login failed")}finally{h(!1)}};return c.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:c.jsxs(cf,{className:"w-full max-w-sm",children:[c.jsxs(df,{className:"text-center",children:[c.jsx(ff,{className:"text-title",children:"First Tree"}),c.jsx(hf,{children:"Sign in to your workspace"})]}),c.jsxs(mf,{className:"space-y-4",children:[c.jsx(pe,{asChild:!0,variant:"outline",className:"w-full",children:c.jsxs("a",{href:"/api/v1/auth/github/start",children:[c.jsx(Qw,{className:"h-4 w-4"}),"Continue with GitHub"]})}),c.jsxs("div",{className:"relative my-2 text-center text-label text-muted-foreground",children:[c.jsx("span",{className:"bg-card px-2 relative z-10",children:"or sign in with username"}),c.jsx("div",{className:"absolute inset-x-0 top-1/2 h-px bg-border"})]}),c.jsxs("form",{onSubmit:g,className:"space-y-4",children:[u&&c.jsx("div",{className:"rounded-md bg-destructive/10 p-3 text-body text-destructive",children:u}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(rt,{htmlFor:"username",children:"Username"}),c.jsx(ht,{id:"username",value:n,onChange:y=>a(y.target.value),required:!0,autoFocus:!0})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(rt,{htmlFor:"password",children:"Password"}),c.jsx(ht,{id:"password",type:"password",value:l,onChange:y=>o(y.target.value),required:!0})]}),c.jsx(pe,{type:"submit",className:"w-full",disabled:m,children:m?"Signing in...":"Sign in"})]})]})]})})}function dq(){const e=kn(),{adoptTokens:t}=rn(),[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),u=o.get("access"),f=o.get("refresh"),m=u6(o.get("next")),h=o.get("joinPath");if(!u||!f){a("Sign-in did not complete. Please try again.");return}(h==="solo"||h==="invite")&&vj(h),window.history.replaceState(null,"",window.location.pathname),(async()=>(await t({accessToken:u,refreshToken:f}),e(m,{replace:!0})))()},[t,e]),c.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background text-body text-muted-foreground",children:n??"Signing you in…"})}function fq(){return Ce.get("/admin/adapter-mappings")}function hq(e){return Ce.post("/admin/adapter-mappings",e)}function mq(e){return Ce.delete(`/admin/adapter-mappings/${e}`)}function pq(){return Ce.get("/admin/adapters/status")}function gq(){return Ce.get("/admin/adapters")}function yq(e){return Ce.post("/admin/adapters",e)}function vq(e,t){return Ce.patch(`/admin/adapters/${e}`,t)}function bq(e){return Ce.delete(`/admin/adapters/${e}`)}const xq=Object.values(c6),qS={platform:"feishu",feishuAppId:"",feishuAppSecret:"",credentialsJson:"{}",status:"active",externalUserId:"",displayName:"",kaelUserId:"",kaelProjectId:""};function HS(e){const[t,n]=x.useState(qS),[a,l]=x.useState("");x.useEffect(()=>{e.open&&(n({...qS,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=Sq(t);if(!e.editingId&&!m){l("Credentials are required");return}if(e.editingId)e.onSubmit({kind:"bot-update",status:t.status,...m?{credentials:m}:{}});else{if(!m)return;e.onSubmit({kind:"bot-create",draft:{platform:t.platform,status:t.status,credentials:m}})}}const u=e.kind==="user"?`Bind external user → ${e.agentLabel}`:e.editingId?`Edit bot binding · ${e.agentLabel}`:`Bind bot → ${e.agentLabel}`;return c.jsx(Ft,{open:e.open,onOpenChange:e.onOpenChange,children:c.jsxs(Pt,{children:[c.jsx(Xt,{children:c.jsx(qt,{children:u})}),c.jsxs("form",{onSubmit:o,className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(rt,{htmlFor:"binding-platform",children:"Platform"}),c.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:xq.map(f=>c.jsx("option",{value:f,children:f},f))})]}),e.kind==="user"?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(rt,{htmlFor:"binding-ext-id",children:"External user ID"}),c.jsx(ht,{id:"binding-ext-id",value:t.externalUserId,onChange:f=>n({...t,externalUserId:f.target.value}),placeholder:"ou_xxxxxxxx...",className:"font-mono",required:!0})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(rt,{htmlFor:"binding-name",children:"Display name (optional)"}),c.jsx(ht,{id:"binding-name",value:t.displayName,onChange:f=>n({...t,displayName:f.target.value})})]})]}):c.jsxs(c.Fragment,{children:[t.platform==="feishu"?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"space-y-2",children:[c.jsxs(rt,{htmlFor:"feishu-app-id",children:["App ID",e.editingId?" — leave empty to keep existing":""]}),c.jsx(ht,{id:"feishu-app-id",value:t.feishuAppId,onChange:f=>n({...t,feishuAppId:f.target.value}),placeholder:"cli_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsxs(rt,{htmlFor:"feishu-app-secret",children:["App Secret",e.editingId?" — leave empty to keep existing":""]}),c.jsx(ht,{id:"feishu-app-secret",type:"password",autoComplete:"new-password",value:t.feishuAppSecret,onChange:f=>n({...t,feishuAppSecret:f.target.value}),placeholder:"••••••••"})]})]}):t.platform==="kael"?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"space-y-2",children:[c.jsxs(rt,{htmlFor:"kael-user-id",children:["User ID",e.editingId?" — leave empty to keep existing":""]}),c.jsx(ht,{id:"kael-user-id",value:t.kaelUserId,onChange:f=>n({...t,kaelUserId:f.target.value}),placeholder:"user_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsxs(rt,{htmlFor:"kael-project-id",children:["Project ID",e.editingId?" — leave empty to keep existing":""]}),c.jsx(ht,{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&&c.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Agent Token will be created automatically when you save."})]}):c.jsxs("div",{className:"space-y-2",children:[c.jsxs(rt,{htmlFor:"binding-creds",children:["Credentials (JSON)",e.editingId?" — leave empty to keep existing":""]}),c.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&&c.jsx("p",{className:"text-body",style:{color:"var(--state-error)"},children:a}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(rt,{htmlFor:"binding-status",children:"Status"}),c.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:[c.jsx("option",{value:"active",children:"active"}),c.jsx("option",{value:"inactive",children:"inactive"})]})]})]}),e.errorMessage&&c.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:e.errorMessage}),c.jsxs(tn,{children:[c.jsx(pe,{type:"button",variant:"ghost",onClick:()=>e.onOpenChange(!1),disabled:e.pending,children:"Cancel"}),c.jsx(pe,{type:"submit",disabled:e.pending,children:e.pending?"Saving…":e.editingId?"Update":"Create"})]})]})]})})}function Sq(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 wq(){var _;const e=kn(),t=zn(),[n,a]=Vd(),l=n.get("agent"),o=vl(),u=Ze({queryKey:["adapters"],queryFn:gq}),f=Ze({queryKey:["adapter-mappings"],queryFn:fq}),m=Ze({queryKey:["adapter-statuses"],queryFn:pq,refetchInterval:15e3}),g=((_=Ze({queryKey:["agents","name-map"],queryFn:()=>zu({limit:100}),staleTime:3e4}).data)==null?void 0:_.items)??[],y=x.useMemo(()=>{const $=new Map;for(const X of m.data??[])$.set(X.configId,X);return $},[m.data]),b=x.useMemo(()=>{const $=u.data??[];return l?$.filter(X=>X.agentId===l):$},[u.data,l]),S=x.useMemo(()=>{const $=f.data??[];return l?$.filter(X=>X.agentId===l):$},[f.data,l]),k=b.reduce(($,X)=>{var ue;return $+((ue=y.get(X.id))!=null&&ue.connected?1:0)},0),j=b.length-k,E=u.isLoading||f.isLoading,[C,A]=x.useState(null),[O,M]=x.useState(""),[D,z]=x.useState(null),[L,Z]=x.useState(null),[te,q]=x.useState(null),[oe,W]=x.useState(null),me=St({mutationFn:$=>yq({platform:$.platform,agentId:$.agentId,credentials:$.credentials,status:$.status}),onSuccess:()=>{t.invalidateQueries({queryKey:["adapters"]}),z(null)}}),fe=St({mutationFn:$=>{const X={status:$.status};return $.credentials&&(X.credentials=$.credentials),vq($.id,X)},onSuccess:()=>{t.invalidateQueries({queryKey:["adapters"]}),z(null)}}),ee=St({mutationFn:bq,onSuccess:()=>t.invalidateQueries({queryKey:["adapters"]})}),H=St({mutationFn:$=>hq({platform:$.platform,externalUserId:$.externalUserId,agentId:$.agentId,boundVia:"manual",displayName:$.displayName??void 0}),onSuccess:()=>{t.invalidateQueries({queryKey:["adapter-mappings"]}),Z(null)}}),re=St({mutationFn:mq,onSuccess:()=>t.invalidateQueries({queryKey:["adapter-mappings"]})});function K($){if(l){$==="bot"?z({agentId:l,editingId:null}):Z({agentId:l});return}M(""),A({kind:$})}function he(){!C||!O||(C.kind==="bot"?z({agentId:O,editingId:null}):Z({agentId:O}),A(null))}function T($){if(D){if($.kind==="bot-create")me.mutate({agentId:D.agentId,platform:$.draft.platform,status:$.draft.status,credentials:$.draft.credentials});else if($.kind==="bot-update"){if(!D.editingId)return;fe.mutate({id:D.editingId,status:$.status,credentials:$.credentials})}}}function U($){!L||$.kind!=="user-create"||H.mutate({agentId:L.agentId,platform:$.draft.platform,externalUserId:$.draft.externalUserId,displayName:$.draft.displayName})}const P=l?g.find($=>$.uuid===l):null;return c.jsxs(c.Fragment,{children:[c.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&&c.jsxs("div",{className:"flex items-center gap-2",style:{padding:"0 var(--sp-0_5) var(--sp-3)"},children:[c.jsx("span",{className:"text-caption",style:{color:"var(--fg-3)"},children:"Filtered to"}),c.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:[(P==null?void 0:P.displayName)??l,c.jsx("button",{type:"button",onClick:()=>{const $=new URLSearchParams(n);$.delete("agent"),a($,{replace:!0})},"aria-label":"Clear filter",className:"inline-flex items-center justify-center hover:bg-accent rounded-full",style:{width:14,height:14,border:"none",background:"transparent",cursor:"pointer"},children:c.jsx(fu,{className:"h-3 w-3"})})]})]}),c.jsxs(nn,{className:"mb-3.5",children:[c.jsxs(Us,{right:c.jsxs("span",{className:"inline-flex items-center gap-2",children:[c.jsxs("span",{className:"inline-flex items-center gap-3 text-caption",children:[c.jsxs("span",{className:"mono inline-flex items-center gap-1",style:{color:"var(--state-idle)"},children:[c.jsx(Gr,{state:"idle",size:6})," ",k," online"]}),c.jsxs("span",{className:"mono inline-flex items-center gap-1",style:{color:"var(--fg-4)"},children:[c.jsx(Gr,{state:"offline",size:6})," ",j," offline"]})]}),c.jsxs(pe,{size:"xs",variant:"outline",onClick:()=>K("bot"),children:[c.jsx(ja,{className:"h-3 w-3"})," Bot binding"]})]}),children:["Bot bindings · ",b.length]}),E?c.jsx(md,{children:"Loading…"}):b.length?c.jsxs(fl,{children:[c.jsx(hl,{children:c.jsxs(ar,{children:[c.jsx(Ue,{children:"Agent"}),c.jsx(Ue,{children:"Platform"}),c.jsx(Ue,{children:"Status"}),c.jsx(Ue,{children:"Connection"}),c.jsx(Ue,{children:"Created"}),c.jsx(Ue,{style:{width:96,textAlign:"right"}})]})}),c.jsx(ml,{children:b.map($=>{var ue;const X=((ue=y.get($.id))==null?void 0:ue.connected)??!1;return c.jsxs(ar,{interactive:!0,onClick:()=>e(`/agents/${$.agentId}`),children:[c.jsx(Le,{children:c.jsx("span",{className:"mono font-medium",children:o($.agentId)})}),c.jsx(Le,{children:c.jsx(vn,{children:$.platform})}),c.jsx(Le,{children:c.jsx(vn,{tone:$.status==="active"?"accent":"outline",children:$.status})}),c.jsx(Le,{children:c.jsxs("span",{className:"inline-flex items-center gap-1.5 text-label",children:[c.jsx(Gr,{state:X?"idle":"offline",size:7}),c.jsx("span",{style:{color:"var(--fg-3)"},children:X?"Online":"Offline"})]})}),c.jsx(Le,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:xi($.createdAt)}),c.jsxs(Le,{style:{textAlign:"right",whiteSpace:"nowrap"},onClick:Se=>Se.stopPropagation(),children:[c.jsx(pe,{variant:"ghost",size:"xs",className:"text-label",onClick:()=>z({agentId:$.agentId,editingId:$.id,initialPlatform:kq($.platform),initialStatus:jq($.status)}),children:"Edit"}),c.jsx(pe,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>q($.id),disabled:ee.isPending,title:"Delete",children:c.jsx(Ds,{className:"h-3.5 w-3.5"})})]})]},$.id)})})]}):c.jsx(md,{children:l?"No bot bindings for this agent yet.":"No bot bindings"})]}),c.jsxs(nn,{children:[c.jsxs(Us,{right:c.jsxs(pe,{size:"xs",variant:"outline",onClick:()=>K("user"),children:[c.jsx(ja,{className:"h-3 w-3"})," User binding"]}),children:["User bindings · ",S.length]}),E?c.jsx(md,{children:"Loading…"}):S.length?c.jsxs(fl,{children:[c.jsx(hl,{children:c.jsxs(ar,{children:[c.jsx(Ue,{children:"Agent"}),c.jsx(Ue,{children:"Platform"}),c.jsx(Ue,{children:"External user ID"}),c.jsx(Ue,{children:"Display name"}),c.jsx(Ue,{children:"Bound via"}),c.jsx(Ue,{children:"Created"}),c.jsx(Ue,{style:{width:32}})]})}),c.jsx(ml,{children:S.map($=>c.jsxs(ar,{interactive:!0,onClick:()=>e(`/agents/${$.agentId}`),children:[c.jsx(Le,{children:c.jsx("span",{className:"mono font-medium",style:{color:"var(--accent-dim)"},children:o($.agentId)})}),c.jsx(Le,{children:c.jsx(vn,{children:$.platform})}),c.jsx(Le,{children:c.jsx("span",{className:"mono text-label",style:{color:"var(--fg-2)"},children:$.externalUserId})}),c.jsx(Le,{style:{color:"var(--fg-2)"},children:$.displayName??"—"}),c.jsx(Le,{children:c.jsx(vn,{tone:"outline",children:$.boundVia??"—"})}),c.jsx(Le,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:xi($.createdAt)}),c.jsx(Le,{onClick:X=>X.stopPropagation(),children:c.jsx(pe,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>W($.id),disabled:re.isPending,title:"Delete",children:c.jsx(Ds,{className:"h-3.5 w-3.5"})})})]},$.id))})]}):c.jsx(md,{children:l?"No user bindings for this agent yet.":"No user bindings"})]}),c.jsx(Cq,{open:C!=null,kind:(C==null?void 0:C.kind)??"bot",agents:g,agentId:O,onAgentChange:M,onCancel:()=>A(null),onConfirm:he}),c.jsx(HS,{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:me.isPending||fe.isPending,errorMessage:(me.error??fe.error)instanceof Error?(me.error??fe.error).message:null,onOpenChange:$=>{$||(z(null),me.reset(),fe.reset())},onSubmit:T}),c.jsx(HS,{open:L!=null,kind:"user",editingId:null,agentLabel:L?o(L.agentId):"",pending:H.isPending,errorMessage:H.error instanceof Error?H.error.message:null,onOpenChange:$=>{$||(Z(null),H.reset())},onSubmit:U}),c.jsx(ZS,{open:te!=null,onOpenChange:$=>!$&&q(null),title:"Remove this bot binding?",description:"The bot will stop routing to this agent and any platform credentials stored here will be dropped.",confirmLabel:"Remove binding",pending:ee.isPending,onConfirm:()=>{te!=null&&(ee.mutate(te),q(null))}}),c.jsx(ZS,{open:oe!=null,onOpenChange:$=>!$&&W(null),title:"Remove this binding?",description:"The external user will stop routing to this agent. You can add the mapping again later.",confirmLabel:"Remove binding",pending:re.isPending,onConfirm:()=>{oe!=null&&(re.mutate(oe),W(null))}})]})}function kq(e){return e==="feishu"||e==="slack"||e==="kael"?e:"feishu"}function jq(e){return e==="inactive"?"inactive":"active"}function md({children:e}){return c.jsx("div",{className:"text-center py-6 text-body",style:{color:"var(--fg-3)"},children:e})}function Cq(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 c.jsx(Ft,{open:e.open,onOpenChange:n=>!n&&e.onCancel(),children:c.jsxs(Pt,{children:[c.jsx(Xt,{children:c.jsx(qt,{children:e.kind==="bot"?"Bind a bot":"Bind an external user"})}),c.jsxs("div",{className:"space-y-3",children:[c.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Pick the agent this binding routes to."}),c.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:[c.jsx("option",{value:"",children:"Select an agent…"}),t.map(n=>c.jsxs("option",{value:n.uuid,children:[n.displayName," ",n.name?`(@${n.name})`:""]},n.uuid))]})]}),c.jsxs(tn,{children:[c.jsx(pe,{variant:"ghost",onClick:e.onCancel,children:"Cancel"}),c.jsx(pe,{onClick:e.onConfirm,disabled:!e.agentId,children:"Continue"})]})]})})}function ZS(e){return c.jsx(Ft,{open:e.open,onOpenChange:e.onOpenChange,children:c.jsxs(Pt,{children:[c.jsx(Xt,{children:c.jsx(qt,{children:e.title})}),c.jsx("div",{className:"space-y-3 text-body",style:{color:"var(--fg-2)"},children:e.description}),c.jsxs(tn,{children:[c.jsx(pe,{type:"button",variant:"ghost",onClick:()=>e.onOpenChange(!1),disabled:e.pending,children:"Cancel"}),c.jsx(pe,{type:"button",variant:"destructive",onClick:e.onConfirm,disabled:e.pending,children:e.pending?"Working…":e.confirmLabel})]})]})})}function Eq(){const{organizationId:e,adoptTokens:t,logout:n}=rn(),[a,l]=x.useState([]),[o,u]=x.useState(!1),[f,m]=x.useState(!1),[h,g]=x.useState(null);x.useEffect(()=>{(async()=>{try{const k=await Ce.get("/me/organizations");l(k)}catch{}})()},[]);const y=a.find(k=>k.id===e),b=(y==null?void 0:y.displayName)??"this team",S=async()=>{m(!0),g(null);try{await kI();const j=(await Ce.get("/me/organizations").catch(()=>[])).find(E=>E.id!==e);if(j){const E=await Ce.post("/auth/switch-org",{organizationId:j.id});await t(E)}else n()}catch(k){g(k instanceof Error?k.message:"Failed to leave team"),m(!1)}};return c.jsxs(c.Fragment,{children:[c.jsxs(nn,{children:[c.jsx(jr,{children:c.jsx(Cr,{children:"Membership"})}),c.jsxs("div",{style:{padding:"var(--sp-3) var(--sp-4) var(--sp-4)"},children:[c.jsxs("div",{className:"text-body",style:{color:"var(--fg)"},children:["You're a member of ",c.jsx("span",{className:"font-medium",children:b}),"."]}),c.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."}),c.jsx("div",{style:{marginTop:"var(--sp-3)"},children:c.jsx(pe,{variant:"destructive",size:"sm",onClick:()=>u(!0),disabled:f,children:f?"Leaving…":"Leave team"})}),h&&c.jsx("div",{className:"text-body",style:{color:"var(--state-error)",marginTop:"var(--sp-2)"},children:h})]})]}),c.jsx(Ft,{open:o,onOpenChange:k=>!f&&u(k),children:c.jsxs(Pt,{children:[c.jsxs(Xt,{children:[c.jsxs(qt,{children:["Leave ",b,"?"]}),c.jsx(Wd,{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."})]}),c.jsxs(tn,{children:[c.jsx(pe,{variant:"outline",size:"sm",onClick:()=>u(!1),disabled:f,children:"Cancel"}),c.jsx(pe,{variant:"destructive",size:"sm",onClick:()=>void S(),disabled:f,children:f?"Leaving…":"Leave team"})]})]})})]})}const VS=[{key:"bindings",label:"Bindings"},{key:"membership",label:"Membership"}];function Nq(){const e=sr(),t=kn(),n=e.hash.replace("#",""),a=VS.some(o=>o.key===n)?n:"bindings",l=o=>{t({hash:o},{replace:!0})};return c.jsxs("div",{className:"-m-6",children:[c.jsx(sf,{title:"Settings",subtitle:"Per-member controls"}),c.jsx(vC,{children:VS.map(o=>c.jsx(bC,{active:a===o.key,onClick:()=>l(o.key),children:o.label},o.key))}),c.jsxs("div",{style:{padding:"var(--sp-4) var(--sp-5) var(--sp-7)"},children:[a==="bindings"&&c.jsx(wq,{}),a==="membership"&&c.jsx(Eq,{})]})]})}function _q(e){return Ce.get(`/admin/chats/${encodeURIComponent(e)}`)}function Aq(e,t){return Ce.patch(`/admin/chats/${encodeURIComponent(e)}`,{topic:t})}function QS(e,t){return Ce.post(`/admin/chats/${encodeURIComponent(e)}/messages`,{format:"text",content:t})}function Tq(e,t){return Ce.post(`/admin/chats/${encodeURIComponent(e)}/messages`,{format:"file",content:t})}function zq(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 Rq(e){return Ce.post(`/admin/agents/${encodeURIComponent(e)}/chats`,{})}function Oq(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 Ce.get(`/admin/chats/${encodeURIComponent(e)}/messages${a?`?${a}`:""}`)}const Dq="first-tree-hub-images",Mq=1,$s="images";let pd=null;function TE(){return pd||(pd=new Promise(e=>{if(typeof indexedDB>"u"){e(null);return}const t=indexedDB.open(Dq,Mq);t.onupgradeneeded=()=>{const n=t.result;n.objectStoreNames.contains($s)||n.createObjectStore($s,{keyPath:"imageId"})},t.onsuccess=()=>e(t.result),t.onerror=()=>e(null),t.onblocked=()=>e(null)}),pd)}async function Lq(e){const t=await TE();if(!t)throw new Error("Image storage unavailable (IndexedDB disabled or blocked)");await new Promise((n,a)=>{const l=t.transaction($s,"readwrite"),o=l.objectStore($s),u={imageId:e.imageId,base64:e.base64,mimeType:e.mimeType,createdAt:Date.now()};o.put(u),l.oncomplete=()=>n(),l.onerror=()=>a(l.error??new Error("Image storage write failed")),l.onabort=()=>a(l.error??new Error("Image storage write aborted"))})}async function Iq(e){const t=await TE();return t?new Promise(n=>{const o=t.transaction($s,"readonly").objectStore($s).get(e);o.onsuccess=()=>{const u=o.result;if(!u){n(null);return}n({base64:u.base64,mimeType:u.mimeType})},o.onerror=()=>n(null)}):null}function Uq(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 Pq(e,t){if(!t)return[...e].sort((a,l)=>(a.displayName??a.name??"").localeCompare(l.displayName??l.name??"")).slice(0,8);const n=[];for(const a of e){const l=(a.name??"").toLowerCase(),o=(a.displayName??"").toLowerCase();let u=1/0;l.startsWith(t)?u=0:o.startsWith(t)?u=1:o.includes(t)&&(u=2),u!==1/0&&n.push({c:a,score:u})}return n.sort((a,l)=>a.score-l.score||(a.c.displayName??"").localeCompare(l.c.displayName??"")),n.slice(0,8).map(a=>a.c)}function Bq(e,t,n,a){if(!a.name)return null;const l=e.slice(0,t.triggerIndex),o=e.slice(n),u=`@${a.name}`,f=o.length===0||!/\s/.test(o[0]??""),m=f?` ${o}`:o,h=`${l}${u}${m}`,g=l.length+u.length+(f?1:0);return{text:h,cursor:g}}function $q({value:e,cursor:t,candidates:n,onSelect:a,disabled:l}){const[o,u]=x.useState(0),[f,m]=x.useState(null),h=x.useMemo(()=>l?null:Uq(e,t),[e,t,l]),g=x.useMemo(()=>h?Pq(n,h.query):[],[h,n]),y=h?`${h.triggerIndex}:${h.query}`:"";x.useEffect(()=>{u(0)},[y]),x.useEffect(()=>{h===null&&f!==null&&m(null)},[h,f]);const b=f!==null&&h!==null&&f===h.triggerIndex,S=h!==null&&g.length>0&&!b;function k(){m((h==null?void 0:h.triggerIndex)??null)}function j(C){if(!h)return;const A=Bq(e,h,t,C);A&&a(A)}return{trigger:S?h:null,results:S?g:[],highlightIndex:o,handleKey:C=>{if(!S||!h)return!1;if(C.key==="ArrowDown")return C.preventDefault(),u(A=>g.length===0?0:(A+1)%g.length),!0;if(C.key==="ArrowUp")return C.preventDefault(),u(A=>g.length===0?0:(A-1+g.length)%g.length),!0;if(C.key==="Enter"||C.key==="Tab"){const A=g[o]??g[0];return A?(C.preventDefault(),j(A),!0):!1}return C.key==="Escape"?(C.preventDefault(),k(),!0):!1},pick:j,dismiss:k}}function Fq({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:c.jsx("div",{ref:o,role:"listbox","aria-label":"Mention suggestions",className:Ne("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 c.jsxs("button",{type:"button",role:"option","aria-selected":h,"data-mention-index":m,onMouseDown:g=>{g.preventDefault(),a(f)},className:"flex w-full items-baseline gap-2 px-3 py-1.5 text-left text-body",style:{background:h?"var(--accent-dim)":"transparent",color:"var(--fg)",border:"none",cursor:"pointer"},children:[c.jsx("span",{className:"font-medium",children:f.displayName??(f.name?`@${f.name}`:"—")}),f.name&&f.displayName&&c.jsxs("span",{className:"mono text-caption",style:{color:"var(--fg-3)"},children:["@",f.name]})]},f.agentId)})})}function zE(e,t){return t&&(e==="idle"||e==="working"||e==="blocked"||e==="error")?e:"offline"}function qq(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=GS(l.payload);if(!o)continue;const u=a.get(o)??-1;l.seq>u&&a.set(o,l.seq)}return n.filter(l=>{if(l.kind!=="tool_call")return!0;const o=GS(l.payload);return o?a.get(o)===l.seq:!0})}function GS(e){if(typeof e!="object"||e===null)return;const t=e.toolUseId;return typeof t=="string"?t:void 0}function xf(e){const t=new Date(e),n=new Intl.DateTimeFormat("en-GB",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}).formatToParts(t),a=l=>{var o;return((o=n.find(u=>u.type===l))==null?void 0:o.value)??""};return`${a("month")}/${a("day")} ${a("hour")}:${a("minute")}`}function RE(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 Hq(e){return e>=1e3?`${(e/1e3).toFixed(1)}s`:`${e}ms`}function KS(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return"…"}}function Zq({msg:e,myAgentId:t}){if(!t||e.senderId!==t)return null;const n=e.deliveryStatus??"sent";return n==="acked"?c.jsx("span",{className:"mono text-caption",style:{color:"var(--accent)"},title:"Agent has started processing",children:"✓✓ read"}):n==="delivered"?c.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-3)"},title:"Delivered to agent inbox",children:"✓✓"}):c.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},title:"Sent",children:"✓ sent"})}function Vq({agentId:e,chatId:t,session:n}){const a=zn(),[,l]=Vd(),[o,u]=x.useState(!1),[f,m]=x.useState(null),h=mk(e,t),g=Gp(e),y=E=>{a.setQueryData(h,C=>C&&{...C,state:E}),a.setQueryData(g,C=>C&&C.map(A=>A.chatId===t?{...A,state:E}:A))},b=St({mutationFn:()=>ER(e,t),onMutate:async()=>{await a.cancelQueries({queryKey:h}),await a.cancelQueries({queryKey:g});const E=a.getQueryData(h),C=a.getQueryData(g);return y("suspended"),{previousSession:E,previousList:C}},onError:(E,C,A)=>{A!=null&&A.previousSession&&a.setQueryData(h,A.previousSession),A!=null&&A.previousList&&a.setQueryData(g,A.previousList)},onSuccess:E=>{y(E.state)}}),S=St({mutationFn:()=>NR(e,t),onMutate:async()=>{await a.cancelQueries({queryKey:h}),await a.cancelQueries({queryKey:g});const E=a.getQueryData(h),C=a.getQueryData(g);return a.setQueryData(g,A=>A&&A.filter(O=>O.chatId!==t)),{previousSession:E,previousList:C}},onError:(E,C,A)=>{A!=null&&A.previousSession&&a.setQueryData(h,A.previousSession),A!=null&&A.previousList&&a.setQueryData(g,A.previousList),m(E instanceof Error?E.message:"Terminate failed")},onSuccess:(E,C,A)=>{if(E.state!=="evicted"){A!=null&&A.previousList&&a.setQueryData(g,A.previousList),y(E.state),m(`Session is ${E.state}; terminate only applies to suspended sessions.`);return}m(null),u(!1),l({a:e})}}),k=(n==null?void 0:n.state)==="active",j=(n==null?void 0:n.state)==="suspended";return!k&&!j?null:c.jsxs(c.Fragment,{children:[c.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&&c.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:[c.jsx(lz,{className:"h-3 w-3"})," Suspend",c.jsx("span",{className:"kbd",style:{marginLeft:2},children:"⌘⇧P"})]}),j&&c.jsxs("button",{type:"button",onClick:()=>{m(null),u(!0)},disabled:S.isPending,className:"inline-flex items-center transition-colors text-label font-semibold",style:{gap:6,padding:"var(--sp-1) var(--sp-2_5)",color:"var(--state-error)",background:"color-mix(in oklch, var(--state-error) 18%, transparent)",borderRadius:"var(--radius-input)"},onMouseEnter:E=>E.currentTarget.style.background="color-mix(in oklch, var(--state-error) 28%, transparent)",onMouseLeave:E=>E.currentTarget.style.background="color-mix(in oklch, var(--state-error) 18%, transparent)",children:[c.jsx(gz,{className:"h-3 w-3"})," Terminate"]})]}),c.jsx(Qq,{open:o,onOpenChange:E=>{S.isPending||u(E),E||m(null)},session:n,chatId:t,error:f,pending:S.isPending,onConfirm:()=>S.mutate()})]})}function Qq(e){const{open:t,onOpenChange:n,session:a,chatId:l,pending:o,error:u,onConfirm:f}=e;function m(g){g.preventDefault(),o||f()}const h=l.slice(0,8);return c.jsx(Ft,{open:t,onOpenChange:n,children:c.jsxs(Pt,{children:[c.jsx(Xt,{children:c.jsx(qt,{children:"Terminate session?"})}),c.jsxs("form",{onSubmit:m,className:"space-y-4",children:[c.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."}),c.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:[c.jsxs("span",{children:["chat: ",c.jsxs("span",{className:"font-medium",children:[h,"…"]})]}),(a==null?void 0:a.lastActivityAt)&&c.jsxs("span",{children:["last activity: ",RE(a.lastActivityAt)]}),typeof(a==null?void 0:a.messageCount)=="number"&&c.jsxs("span",{children:["messages: ",a.messageCount]})]}),u&&c.jsx("p",{className:"mono text-label",style:{color:"var(--state-error)"},children:u}),c.jsxs(tn,{children:[c.jsx(pe,{type:"button",variant:"ghost",onClick:()=>n(!1),disabled:o,children:"Cancel"}),c.jsx(pe,{type:"submit",variant:"destructive",disabled:o,children:o?"Terminating…":"Terminate"})]})]})]})})}function Gq({event:e}){const t=wR(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 c.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?c.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}}):c.jsx("span",{"aria-hidden":!0,style:{color:l,flexShrink:0},children:n?"⚠":"↳"}),c.jsxs("span",{className:"flex items-baseline",style:{color:"var(--fg-3)",minWidth:0,flex:1},title:t.args!==void 0&&t.args!==null?KS(t.args):void 0,children:[c.jsxs("span",{style:{whiteSpace:"nowrap",flexShrink:0},children:[o," ",c.jsx("span",{style:{color:"var(--fg-2)"},children:t.name})]}),t.args!==void 0&&t.args!==null?c.jsxs("span",{className:"truncate",style:{color:"var(--fg-4)",minWidth:0,flex:1},children:["(",KS(t.args),")"]}):null,t.durationMs!==void 0&&!a?c.jsxs("span",{className:"text-caption",style:{color:"var(--fg-4)",marginLeft:6,whiteSpace:"nowrap",flexShrink:0},children:["· ",Hq(t.durationMs)]}):null]})]})}function Kq({event:e,agentNameFn:t,agentId:n}){const a=jR(e.payload);if(!a||a.text.length===0)return null;const l=t(n);return c.jsxs("div",{className:"grid",style:{gridTemplateColumns:"var(--sp-5) 1fr",columnGap:8,padding:"var(--sp-1) 0",opacity:.85},children:[c.jsx(OE,{name:l,isSelf:!1}),c.jsxs("div",{className:"min-w-0",children:[c.jsxs("div",{className:"flex items-baseline",style:{gap:8},children:[c.jsx("span",{className:"mono text-label font-semibold",style:{color:"var(--accent)"},children:l}),c.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:xf(e.createdAt)}),c.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:"· streaming"})]}),c.jsx("div",{className:"text-body",style:{color:"var(--fg-2)",whiteSpace:"pre-wrap",marginTop:2},children:a.text})]})]})}function Yq({event:e}){return c.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:[c.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}}),c.jsx("span",{style:{color:"var(--fg-3)"},children:"thinking…"}),c.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:xf(e.createdAt)})]})}function Xq({event:e}){const t=kR(e.payload),n=xf(e.createdAt);return c.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:[c.jsxs("div",{className:"mono uppercase text-caption",style:{color:"var(--state-error)"},children:["error · ",(t==null?void 0:t.source)??"unknown"," · ",n]}),c.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 OE({name:e,isSelf:t}){const n=e.slice(0,2).toUpperCase();return c.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:c.jsx(Ms,{width:9,height:10,style:{color:"var(--accent)"}})})}function Jq({msg:e,myAgentId:t,agentNameFn:n}){const a=n(e.senderId),l=t===e.senderId;return c.jsxs("div",{className:"grid",style:{gridTemplateColumns:"var(--sp-5) 1fr",columnGap:8,padding:"var(--sp-1_5) 0"},children:[c.jsx(OE,{name:a,isSelf:l}),c.jsxs("div",{className:"min-w-0",children:[c.jsxs("div",{className:"flex items-baseline",style:{gap:8},children:[c.jsx("span",{className:"mono text-body font-semibold",style:{color:l?"var(--fg)":"var(--accent)"},children:a}),c.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:xf(e.createdAt)}),c.jsx("span",{style:{marginLeft:"auto"},children:c.jsx(Zq,{msg:e,myAgentId:t})})]}),c.jsx("div",{className:"text-body",style:{color:"var(--fg)",marginTop:2},children:e.format==="file"&&Wq(e.content)?c.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"&&e7(e.content)?c.jsx(t7,{content:e.content}):e.format==="text"?c.jsx(AE,{children:typeof e.content=="string"?e.content:JSON.stringify(e.content)}):c.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 Wq(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 e7(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 t7({content:e}){const[t,n]=x.useState({kind:"loading"});return x.useEffect(()=>{let a=!1;return Iq(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"?c.jsx("img",{src:t.src,alt:e.filename,style:{maxWidth:320,borderRadius:"var(--radius-panel)",marginTop:4}}):t.kind==="miss"?c.jsxs("span",{className:"text-label",style:{color:"var(--fg-3)",fontStyle:"italic"},children:['[Image "',e.filename,'" not available on this device]']}):c.jsx("span",{className:"text-label",style:{color:"var(--fg-4)"},children:"…"})}function n7({agentId:e,chatId:t}){var ct;const n=zn(),a=vl(),l=qg(),{agentId:o}=rn(),[u,f]=x.useState(""),[m,h]=x.useState(0),[g,y]=x.useState([]),[b,S]=x.useState(!1),[k,j]=x.useState(null),E=x.useRef(null),C=x.useRef(null),A=x.useRef(null),O=x.useRef(!1);x.useEffect(()=>{O.current=!1},[t]);const{data:M}=Ze({queryKey:["chat-messages",t],queryFn:()=>Oq(t,{limit:50}),refetchInterval:5e3}),{data:D}=Ze({queryKey:["session-events",e,t],queryFn:()=>CR(e,t,{limit:200,direction:"desc"}),refetchInterval:5e3}),{data:z}=Ze({queryKey:mk(e,t),queryFn:()=>Vs(e).then(ae=>ae.find(De=>De.chatId===t)??null),refetchInterval:5e3}),{data:L}=Ze({queryKey:["chat-detail",t],queryFn:()=>_q(t),enabled:!!t}),Z=St({mutationFn:ae=>QS(t,ae),onSuccess:()=>{f(""),n.invalidateQueries({queryKey:["chat-messages",t]})}}),te=x.useCallback(ae=>{const at=ae.filter(un=>un.type.startsWith("image/"));if(at.length===0)return;const Pe=at.find(un=>un.size>5242880);if(Pe){j(`Image too large (${(Pe.size/1024/1024).toFixed(1)}MB). Maximum ${5242880/1024/1024}MB per image.`);return}const Dt=at.map(un=>({id:crypto.randomUUID(),file:un,previewUrl:URL.createObjectURL(un)}));y(un=>[...un,...Dt]),j(null)},[]),q=x.useCallback(ae=>{y(De=>{const at=De.find(Pe=>Pe.id===ae);return at&&URL.revokeObjectURL(at.previewUrl),De.filter(Pe=>Pe.id!==ae)})},[]),oe=async()=>{const ae=u.trim(),De=g;if(!(!ae&&De.length===0)&&!b&&!($&&X.length===0)){if(De.length>0){S(!0),j(null);try{for(const at of De){const Pe=await zq(at.file),Dt=crypto.randomUUID();await Lq({imageId:Dt,base64:Pe,mimeType:at.file.type}),await Tq(t,{data:Pe,mimeType:at.file.type,filename:at.file.name,size:at.file.size,imageId:Dt}),URL.revokeObjectURL(at.previewUrl)}y([]),ae&&await QS(t,ae),f(""),n.invalidateQueries({queryKey:["chat-messages",t]})}catch(at){j(at instanceof Error?at.message:"Failed to send image")}finally{S(!1)}return}Z.mutate(ae)}},[W,me]=x.useState(!1),[fe,ee]=x.useState(""),H=x.useRef(null);x.useEffect(()=>{var ae;W&&((ae=H.current)==null||ae.focus())},[W]);const re=St({mutationFn:ae=>Aq(t,ae),onSuccess:()=>{me(!1),n.invalidateQueries({queryKey:["chat-detail",t]}),n.invalidateQueries({queryKey:["agent-sessions",e]}),n.invalidateQueries({queryKey:["session",e,t]})}}),K=()=>{const ae=fe.trim();re.mutate(ae.length>0?ae:null)},he=x.useMemo(()=>{const ae=(M==null?void 0:M.items)??[],De=qq((D==null?void 0:D.items)??[]),at=[...ae.map(Pe=>({kind:"message",at:Pe.createdAt,key:`m-${Pe.id}`,data:Pe})),...De.map(Pe=>({kind:"event",at:Pe.createdAt,key:`e-${Pe.id}`,data:Pe}))];return at.sort((Pe,Dt)=>Pe.at.localeCompare(Dt.at)),at},[M,D]),T=he.length;x.useEffect(()=>{var ae;T>0&&((ae=A.current)==null||ae.scrollIntoView({behavior:"smooth"}))},[T]);const U=L!=null&&L.participants?L.participants.map(ae=>{const De=a(ae.agentId);return`@${De.length>20?`${De.slice(0,17)}…`:De}`}).join(" "):`@${a(e)}`,P=a(e),_=x.useMemo(()=>{var at;const ae=((at=L==null?void 0:L.participants)==null?void 0:at.map(Pe=>Pe.agentId))??[e],De=[];for(const Pe of ae){if(Pe===o)continue;const Dt=l(Pe);!Dt||!Dt.name||De.push({agentId:Pe,name:Dt.name,displayName:Dt.displayName})}return De},[L==null?void 0:L.participants,e,l,o]),$=x.useMemo(()=>{if(!L)return!1;if(L.type==="group")return!0;const ae=L.participants.some(De=>De.agentId===o);return L.type==="direct"&&!ae&&L.participants.length>=2},[L,o]),X=x.useMemo(()=>{if(!$)return[];const ae=_.map(De=>({agentId:De.agentId,name:De.name}));return s6(u,ae)},[u,_,$]),ue=$q({value:u,cursor:m,candidates:_,disabled:Z.isPending||b,onSelect:ae=>{f(ae.text),h(ae.cursor),requestAnimationFrame(()=>{const De=C.current;De&&(De.focus(),De.setSelectionRange(ae.cursor,ae.cursor))})}}),Se=(z==null?void 0:z.runtimeState)??"idle",Me=zE((z==null?void 0:z.runtimeState)??null,e?"connected":null),ye=(z==null?void 0:z.messageCount)??((ct=M==null?void 0:M.items)==null?void 0:ct.length)??0;return c.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[c.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:[c.jsxs("div",{className:"min-w-0",children:[c.jsxs("div",{className:"flex items-center",style:{gap:8},children:[c.jsx(Gr,{state:Me,size:8}),W?c.jsxs(c.Fragment,{children:[c.jsx("input",{ref:H,value:fe,onChange:ae=>ee(ae.target.value),onKeyDown:ae=>{ae.key==="Enter"?(ae.preventDefault(),K()):ae.key==="Escape"&&(ae.preventDefault(),me(!1))},disabled:re.isPending,maxLength:500,placeholder:"Chat name",className:"outline-none text-subtitle",style:{flex:1,minWidth:0,color:"var(--fg)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",padding:"var(--sp-0_5) var(--sp-1_5)"}}),c.jsx("button",{type:"button",onClick:K,disabled:re.isPending,title:"Save",className:"inline-flex items-center",style:{color:"var(--accent)",padding:2},children:c.jsx(bi,{className:"h-3.5 w-3.5"})}),c.jsx("button",{type:"button",onClick:()=>me(!1),disabled:re.isPending,title:"Cancel",className:"inline-flex items-center",style:{color:"var(--fg-3)",padding:2},children:c.jsx(fu,{className:"h-3.5 w-3.5"})})]}):c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"truncate text-subtitle",style:{color:"var(--fg)"},children:(L==null?void 0:L.topic)||(z==null?void 0:z.summary)||`Chat · ${t.slice(0,8)}`}),c.jsx("button",{type:"button",onClick:()=>{ee((L==null?void 0:L.topic)??""),me(!0)},title:"Rename chat",className:"inline-flex items-center transition-colors",style:{color:"var(--fg-4)",padding:2},onMouseEnter:ae=>ae.currentTarget.style.color="var(--fg-2)",onMouseLeave:ae=>ae.currentTarget.style.color="var(--fg-4)",children:c.jsx(_u,{className:"h-3 w-3"})})]}),c.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})]}),c.jsxs("div",{className:"flex items-center text-caption",style:{color:"var(--fg-3)",marginTop:4,gap:10},children:[c.jsx("span",{className:"mono",children:U}),c.jsx("span",{children:"·"}),c.jsxs("span",{children:["started ",RE((z==null?void 0:z.startedAt)??null)]}),c.jsx("span",{children:"·"}),c.jsxs("span",{children:[ye," msgs"]}),c.jsx("span",{children:"·"}),c.jsxs("span",{children:["runtime"," ",c.jsx("span",{className:"mono",style:{color:Me==="error"?"var(--state-error)":"var(--fg-2)"},children:Se})]})]})]}),c.jsx(Vq,{agentId:e,chatId:t,session:z??null})]}),c.jsxs("div",{className:"flex-1 overflow-y-auto relative",style:{padding:"var(--sp-2_5) var(--sp-3_5)"},children:[T===0&&c.jsxs("div",{className:"flex flex-col items-center text-body",style:{color:"var(--fg-3)",padding:"var(--sp-8) 0",gap:6},children:[c.jsx(Lg,{className:"h-8 w-8",style:{opacity:.3}}),"Send a message to start the conversation"]}),c.jsx("div",{className:"flex flex-col",style:{gap:4},children:he.map(ae=>{if(ae.kind==="event"){const De=ae.data;switch(De.kind){case"tool_call":return c.jsx(Gq,{event:De},ae.key);case"assistant_text":return c.jsx(Kq,{event:De,agentId:e,agentNameFn:a},ae.key);case"thinking":return c.jsx(Yq,{event:De},ae.key);case"error":return c.jsx(Xq,{event:De},ae.key);default:return null}}return c.jsx(Jq,{msg:ae.data,myAgentId:o,agentNameFn:a},ae.key)})}),c.jsx("div",{ref:A})]}),c.jsxs("div",{className:"shrink-0",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderTop:"var(--hairline) solid var(--border)"},children:[c.jsxs("div",{style:{position:"relative",border:"var(--hairline) solid var(--border)",borderRadius:6,background:"var(--bg-sunken)"},onDragOver:ae=>ae.preventDefault(),onDrop:ae=>{ae.preventDefault(),te(Array.from(ae.dataTransfer.files))},children:[g.length>0&&c.jsx("div",{className:"flex items-center",style:{gap:6,padding:"var(--sp-1_5) var(--sp-2_5) 0",overflowX:"auto"},children:g.map(ae=>c.jsxs("div",{style:{position:"relative",flexShrink:0,borderRadius:4,border:"var(--hairline) solid var(--border)",overflow:"hidden"},children:[c.jsx("img",{src:ae.previewUrl,alt:ae.file.name,style:{height:32,width:"auto",display:"block",objectFit:"cover"}}),c.jsx("button",{type:"button",onClick:()=>q(ae.id),style:{position:"absolute",top:1,right:1,width:14,height:14,borderRadius:"50%",background:"var(--color-overlay-scrim)",border:"none",color:"var(--bg-raised)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",padding:0},children:c.jsx(fu,{className:"h-2 w-2"})})]},ae.id))}),c.jsxs("div",{style:{position:"relative"},children:[c.jsx(Fq,{trigger:ue.trigger,results:ue.results,highlightIndex:ue.highlightIndex,anchorRef:C,onPick:ue.pick}),c.jsx("textarea",{ref:C,value:u,onChange:ae=>{f(ae.target.value),h(ae.target.selectionStart??ae.target.value.length)},onSelect:ae=>{h(ae.currentTarget.selectionStart??u.length)},onFocus:()=>{$&&(O.current||u.length>0||_.length===0||(O.current=!0,f("@"),h(1),requestAnimationFrame(()=>{const ae=C.current;ae&&ae.setSelectionRange(1,1)})))},onPaste:ae=>{const De=Array.from(ae.clipboardData.files);De.length>0&&(ae.preventDefault(),te(De))},placeholder:$?"Type @ to pick a recipient, then your message":`Message @${P} · / for commands · @ to mention`,rows:2,onKeyDown:ae=>{ue.handleKey(ae)||ae.key==="Enter"&&!ae.shiftKey&&(ae.preventDefault(),oe())},disabled:Z.isPending||b,className:"w-full outline-none text-subtitle font-normal",style:{padding:"var(--sp-2_25) var(--sp-3) var(--sp-7_5)",background:"transparent",border:"none",resize:"none",color:"var(--fg)"}})]}),c.jsxs("div",{className:"flex items-center justify-between text-caption",style:{position:"absolute",bottom:6,left:10,right:10,color:"var(--fg-4)"},children:[c.jsxs("span",{className:"mono flex items-center",style:{gap:8},children:[c.jsx("button",{type:"button",onClick:()=>{var ae;return(ae=E.current)==null?void 0:ae.click()},title:"Attach image",style:{background:"none",border:"none",cursor:"pointer",color:"var(--fg-3)",padding:0,display:"inline-flex",alignItems:"center"},children:c.jsx(az,{className:"h-3.5 w-3.5"})}),c.jsx("input",{ref:E,type:"file",accept:"image/*",multiple:!0,style:{display:"none"},onChange:ae=>{ae.target.files&&(te(Array.from(ae.target.files)),ae.target.value="")}}),c.jsx("span",{children:"/suspend"}),c.jsx("span",{children:"/resume"}),c.jsx("span",{children:"/branch"}),c.jsx("span",{children:"/promote"})]}),c.jsxs("span",{className:"flex items-center",style:{gap:8},children:[b&&c.jsx("span",{className:"mono text-caption",style:{color:"var(--accent)"},children:"uploading…"}),c.jsxs("span",{children:[c.jsx("span",{className:"kbd",children:"⏎"})," send ",c.jsx("span",{className:"kbd",children:"⇧⏎"})," new line"]}),c.jsxs("button",{type:"button",onClick:oe,disabled:Z.isPending||b||!u.trim()&&g.length===0||$&&X.length===0,title:$&&X.length===0?"Pick at least one recipient with @ before sending in a group chat":void 0,className:Ne("inline-flex items-center transition-colors text-label font-semibold",(Z.isPending||b||!u.trim()&&g.length===0||$&&X.length===0)&&"opacity-50 cursor-not-allowed"),style:{gap:6,padding:"var(--sp-1) var(--sp-2_5)",color:"oklch(0.14 0.01 150)",background:"var(--accent)",border:"var(--hairline) solid var(--accent)",borderRadius:"var(--radius-input)"},children:[c.jsx(fz,{className:"h-3 w-3"})," Send"]})]})]})]}),(Z.isError||k)&&c.jsx("p",{className:"mono text-label",style:{color:"var(--state-error)",padding:"var(--sp-1_5) var(--sp-0_5) 0"},children:k??(Z.error instanceof Error?Z.error.message:"Failed to send")})]})]})}function r7(){const{shouldShowResumeCTA:e,open:t,step:n}=xj();if(e){const a=n==="connect"?"Connect your computer to create your first agent.":n==="create_agent"?"Create your first agent to start collaborating.":"Finish setup to start collaborating.";return c.jsx("div",{className:"flex-1 flex items-center justify-center p-8",children:c.jsxs("div",{className:"text-center max-w-sm",children:[c.jsx(Ms,{width:36,height:40,className:"mx-auto mb-3 text-primary opacity-60"}),c.jsx("div",{className:"text-subtitle mb-1",children:"No agents yet"}),c.jsx("div",{className:"text-body text-muted-foreground mb-4",children:a}),c.jsx(pe,{onClick:t,children:"Resume setup"})]})})}return c.jsx("div",{className:"flex-1 flex items-center justify-center p-8",children:c.jsxs("div",{className:"text-center max-w-sm",children:[c.jsx(Ms,{width:36,height:40,className:"mx-auto mb-3 text-primary opacity-60"}),c.jsx("div",{className:"text-subtitle mb-1",children:"Select a chat"}),c.jsx("div",{className:"text-body text-muted-foreground",children:"Pick an agent from the roster to view its sessions, or open a chat to start collaborating."})]})})}function a7({selectedAgentId:e,selectedChatId:t}){return t&&e?c.jsx(n7,{agentId:e,chatId:t}):c.jsx(r7,{})}function DE(){const{data:e}=Ze({queryKey:["clients"],queryFn:hu,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 vg({children:e}){return c.jsx("div",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-4)",marginBottom:8},children:e})}function ME({children:e}){return c.jsx("div",{className:"grid text-body",style:{gridTemplateColumns:"auto 1fr",columnGap:10,rowGap:4},children:e})}function Vr({label:e,children:t}){return c.jsxs(c.Fragment,{children:[c.jsx("div",{style:{color:"var(--fg-3)"},children:e}),c.jsx("div",{className:"text-right truncate",style:{color:"var(--fg)",overflow:"hidden",textOverflow:"ellipsis"},children:t})]})}function YS(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 XS(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 Np({label:e,value:t,accent:n}){return c.jsxs("div",{style:{padding:"var(--sp-1_5) var(--sp-2)",background:"var(--bg-sunken)",borderRadius:"var(--radius-input)"},children:[c.jsx("div",{className:"mono uppercase text-caption",style:{color:"var(--fg-4)"},children:e}),c.jsx("div",{className:"mono text-subtitle",style:{color:n??"var(--fg)"},children:t})]})}function i7({notifications:e,agentId:t}){const[,n]=Vd(),a=zn(),l=St({mutationFn:o=>mj(o),onSuccess:()=>{a.invalidateQueries({queryKey:["notifications"]})}});return c.jsx("div",{className:"flex flex-col",style:{gap:4},children:e.map(o=>c.jsx(pj,{notification:o,clickable:!!o.chatId,onClick:()=>{o.read||l.mutate(o.id),o.chatId&&n({a:t,c:o.chatId})}},o.id))})}function LE({agentId:e}){var h;const t=vl(),{resolve:n}=DE(),{data:a}=Ze({queryKey:["activity"],queryFn:Au,refetchInterval:1e4}),l=(h=a==null?void 0:a.agents)==null?void 0:h.find(g=>g.agentId===e),o=n(l==null?void 0:l.clientId),{data:u}=Ze({queryKey:["notifications","agent",e],queryFn:()=>eg({agentId:e,limit:3}),refetchInterval:3e4}),f=t(e),m=(l==null?void 0:l.runtimeState)??"offline";return c.jsxs("div",{className:"flex-1 overflow-y-auto",children:[c.jsxs("div",{style:{padding:"var(--sp-3) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[c.jsxs("div",{className:"flex items-center",style:{gap:10},children:[c.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:c.jsx(Ms,{width:14,height:16,style:{color:"var(--accent)"}})}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("div",{className:"text-subtitle",style:{color:"var(--fg)"},children:f}),c.jsx("div",{className:"mono truncate text-body",style:{color:"var(--fg-4)"},children:e})]}),c.jsx(Ps,{state:m})]}),c.jsxs("div",{className:"grid",style:{gridTemplateColumns:"repeat(3, 1fr)",gap:4,marginTop:10},children:[c.jsx(Np,{label:"sessions",value:(l==null?void 0:l.totalSessions)??0,accent:((l==null?void 0:l.totalSessions)??0)>0?"var(--fg)":"var(--fg-4)"}),c.jsx(Np,{label:"active",value:(l==null?void 0:l.activeSessions)??0,accent:((l==null?void 0:l.activeSessions)??0)>0?"var(--accent)":"var(--fg-4)"}),c.jsx(Np,{label:"uptime",value:XS((o==null?void 0:o.connectedAt)??null)})]})]}),c.jsxs("div",{style:{padding:"var(--sp-3) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[c.jsx(vg,{children:"Computer · runtime"}),c.jsxs(ME,{children:[c.jsx(Vr,{label:"host",children:c.jsx("span",{className:"mono text-label",children:(o==null?void 0:o.hostname)??"—"})}),c.jsx(Vr,{label:"os",children:c.jsx("span",{className:"mono text-label",children:(o==null?void 0:o.os)??"—"})}),c.jsx(Vr,{label:"runtime",children:c.jsx("span",{className:"mono",children:(l==null?void 0:l.runtimeType)??"—"})}),c.jsx(Vr,{label:"sdk",children:c.jsx("span",{className:"mono text-label",children:(o==null?void 0:o.sdkVersion)??"—"})}),c.jsx(Vr,{label:"connected",children:c.jsx("span",{className:"mono text-label",children:XS((o==null?void 0:o.connectedAt)??null)})})]})]}),c.jsxs("div",{style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},className:"flex flex-col",children:[c.jsx("a",{href:`/agents/${e}`,style:{color:"var(--accent)"},className:"hover:underline text-label",children:"Manage agent →"}),c.jsx("a",{href:"/clients",style:{color:"var(--accent)",marginTop:4},className:"hover:underline text-label",children:"Computers →"})]}),c.jsxs("div",{style:{padding:"var(--sp-3) var(--sp-3_5)"},children:[c.jsx(vg,{children:"Notifications"}),!(u!=null&&u.items)||u.items.length===0?c.jsx("div",{className:"text-center text-label",style:{color:"var(--fg-3)",padding:"var(--sp-3) 0"},children:"No notifications for this agent"}):c.jsx(i7,{notifications:u.items,agentId:e})]})]})}function l7({agentId:e,chatId:t}){const{data:n}=Ze({queryKey:["session",e,t],queryFn:()=>Vs(e).then(a=>a.find(l=>l.chatId===t)??null),refetchInterval:5e3});return c.jsxs("div",{className:"flex flex-col overflow-hidden flex-1",children:[c.jsxs("div",{style:{padding:"var(--sp-3) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[c.jsx(vg,{children:"Session"}),c.jsxs(ME,{children:[c.jsx(Vr,{label:"state",children:c.jsx(Ps,{state:(n==null?void 0:n.runtimeState)??(n==null?void 0:n.state)??null})}),c.jsx(Vr,{label:"chat",children:c.jsx("span",{className:"mono text-body",children:t.slice(0,12)})}),c.jsx(Vr,{label:"started",children:YS((n==null?void 0:n.startedAt)??null)}),c.jsx(Vr,{label:"last",children:YS((n==null?void 0:n.lastActivityAt)??null)}),c.jsx(Vr,{label:"messages",children:c.jsx("span",{className:"mono",children:(n==null?void 0:n.messageCount)??0})})]})]}),c.jsx(LE,{agentId:e})]})}function s7({selectedAgentId:e,selectedChatId:t}){return t&&e?c.jsx(l7,{agentId:e,chatId:t}):e?c.jsx(LE,{agentId:e}):null}const o7=32;function u7({aggregated:e,stale:t,className:n}){const a=Math.max(1,...e.map(l=>l.workingCount));return c.jsx("div",{className:Ne("flex items-end gap-[var(--sp-0_5)]",t&&"opacity-40",n),style:{height:22},"aria-hidden":!0,children:Array.from({length:o7}).map((l,o)=>{const u=e[o]??{workingCount:0,errorMask:!1},f=u.workingCount===0?.08:u.workingCount/a,m=.25+f*.7,h=u.errorMask?"var(--state-error)":"var(--accent)";return c.jsx("span",{className:"flex-1",style:{height:`${Math.max(12,f*100)}%`,background:h,opacity:m,borderRadius:.5}},o)})})}const c7={error:0,blocked:1,working:2,idle:3};function d7(e,t){return t?e?c7[e]??4:4:5}function f7(e,t){return t==="all"?!0:t==="active"?e.runtimeState==="working":e.runtimeState==="blocked"||e.runtimeState==="error"}function h7({selectedAgentId:e,selectedChatId:t,onSelectAgent:n,onSelectChat:a}){const l=vl(),{resolve:o}=DE(),u=zn(),f=iI(),[m,h]=x.useState(""),[g,y]=x.useState("all"),{data:b}=Ze({queryKey:["activity"],queryFn:Au,refetchInterval:1e4}),{data:S}=Ze({queryKey:e?Gp(e):["agent-sessions",null],queryFn:()=>e?Vs(e):Promise.resolve([]),enabled:!!e,refetchInterval:1e4}),k=St({mutationFn:z=>Rq(z),onSuccess:(z,L)=>{u.invalidateQueries({queryKey:Gp(L)}),a(L,z.id)}}),{humans:j,agents:E,totalAll:C}=x.useMemo(()=>{const z=(b==null?void 0:b.agents)??[],L=m.trim().toLowerCase(),Z=z.filter(W=>{var ee;if(!f7(W,g))return!1;if(!L)return!0;const me=l(W.agentId).toLowerCase(),fe=W.clientId?(((ee=o(W.clientId))==null?void 0:ee.hostname)??"").toLowerCase():"";return me.includes(L)||fe.includes(L)||W.agentId.toLowerCase().includes(L)}),te=W=>d7(W.runtimeState,W.clientId),q=[],oe=[];for(const W of Z)(W.type==="human"?q:oe).push(W);return q.sort((W,me)=>te(W)-te(me)),oe.sort((W,me)=>te(W)-te(me)),{humans:q,agents:oe,totalAll:z.length}},[b,m,g,l,o]),A=x.useMemo(()=>{const z=(b==null?void 0:b.agents)??[];return{working:z.filter(L=>L.runtimeState==="working").length,blocked:z.filter(L=>L.runtimeState==="blocked").length,error:z.filter(L=>L.runtimeState==="error").length}},[b]),O=[{value:"all",label:"all",count:C},{value:"active",label:"active",count:A.working},{value:"attn",label:"attn",count:A.blocked+A.error,warn:A.blocked+A.error>0}],M=z=>{var W;const L=e===z.agentId,Z=zE(z.runtimeState,z.clientId),te=z.clientId?((W=o(z.clientId))==null?void 0:W.hostname)??z.clientId.slice(0,8):null,q=z.activeSessions??0,oe=z.totalSessions??0;return c.jsxs("div",{style:{borderBottom:"var(--hairline) solid var(--border-faint)"},children:[c.jsxs("button",{type:"button",onClick:()=>n(L?null:z.agentId),className:Ne("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:L?"var(--bg-active)":"transparent",borderLeft:`var(--hairline-bold) solid ${L?"var(--accent)":"transparent"}`},children:[c.jsx(Gr,{state:Z,size:8}),c.jsxs("div",{className:"min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx("span",{className:"mono truncate text-body font-medium",style:{color:"var(--fg)"},children:l(z.agentId)}),z.type==="human"&&c.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"})]}),c.jsx("div",{className:"truncate text-body",style:{color:"var(--fg-3)"},children:Z==="offline"?"disconnected":te||"—"})]}),c.jsx("div",{className:"flex flex-col items-end gap-0.5",children:oe>0&&c.jsxs("span",{className:"mono tnum text-label",style:{color:"var(--fg-3)"},children:[q,c.jsxs("span",{style:{color:"var(--fg-4)"},children:[" / ",oe]})]})})]}),L&&c.jsxs("div",{style:{background:"var(--bg-sunken)",paddingBottom:4},children:[(!S||S.length===0)&&c.jsx("div",{className:"text-body",style:{padding:"var(--sp-1_75) var(--sp-2_5) var(--sp-1_75) var(--sp-7)",color:"var(--fg-4)"},children:"No sessions yet"}),S==null?void 0:S.filter(me=>me.state!=="evicted").map(me=>{const fe=me.state==="active"?"working":"idle";return c.jsxs("button",{type:"button",onClick:()=>a(z.agentId,me.chatId),className:"w-full grid items-center text-left transition-colors",style:{gridTemplateColumns:"var(--sp-3_5) 1fr",columnGap:6,padding:"var(--sp-1_75) var(--sp-2_5) var(--sp-1_75) var(--sp-7)",background:t===me.chatId?"var(--bg-hover)":"transparent",color:me.state==="active"?"var(--fg-2)":"var(--fg-3)"},onMouseEnter:ee=>{t!==me.chatId&&(ee.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:ee=>{t!==me.chatId&&(ee.currentTarget.style.background="transparent")},children:[c.jsx(Gr,{state:fe,size:6}),c.jsx("span",{className:"truncate text-body",style:{color:me.topic||me.summary?"var(--fg-2)":"var(--fg-4)"},children:me.topic||me.summary||`Chat · ${me.chatId.slice(0,8)}`})]},me.chatId)}),c.jsxs("button",{type:"button",onClick:()=>k.mutate(z.agentId),disabled:k.isPending,className:"w-full flex items-center text-left transition-colors text-body",style:{gap:6,padding:"var(--sp-1_75) var(--sp-2_5) var(--sp-1_75) var(--sp-7)",color:"var(--fg-3)"},onMouseEnter:me=>{me.currentTarget.style.background="var(--bg-hover)"},onMouseLeave:me=>{me.currentTarget.style.background="transparent"},children:[c.jsx(ja,{className:"h-3 w-3"}),"New chat"]})]})]},z.agentId)},D=j.length+E.length;return c.jsxs("aside",{className:"shrink-0 flex flex-col overflow-hidden",style:{width:268,background:"var(--bg-raised)",borderRight:"var(--hairline) solid var(--border)"},children:[c.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:[c.jsx("div",{style:{marginBottom:8},children:c.jsxs("span",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-3)"},children:[C," members"]})}),c.jsxs("div",{className:"relative",children:[c.jsx(Gd,{className:"h-3.5 w-3.5 absolute pointer-events-none",style:{left:8,top:"50%",transform:"translateY(-50%)",color:"var(--fg-4)"}}),c.jsx("input",{value:m,onChange:z=>h(z.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)"}})]}),c.jsx("div",{className:"flex gap-1",style:{marginTop:8},children:O.map(z=>c.jsx(ru,{active:g===z.value,count:z.count,warn:z.warn,onClick:()=>y(z.value),children:z.label},z.value))})]}),c.jsxs("div",{className:"shrink-0",style:{padding:"var(--sp-2) var(--sp-3)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[c.jsxs("div",{className:"flex items-center justify-between",style:{marginBottom:4},children:[c.jsxs("span",{className:"mono flex items-center gap-1.5 text-eyebrow",style:{color:"var(--fg-3)"},children:[c.jsx(m7,{}),"5m"]}),c.jsx("span",{className:"mono text-body",style:{color:"var(--fg-4)"},children:f.stale?"stale":"live"})]}),c.jsx(u7,{aggregated:f.aggregated,stale:f.stale}),c.jsxs("div",{className:"flex justify-between text-body",style:{marginTop:6},children:[c.jsxs("span",{className:"mono",style:{color:"var(--state-working)"},children:[A.working," working"]}),c.jsxs("span",{className:"mono",style:{color:"var(--state-blocked)"},children:[A.blocked," blocked"]}),c.jsxs("span",{className:"mono",style:{color:"var(--state-error)"},children:[A.error," error"]})]})]}),c.jsxs("div",{className:"flex-1 overflow-y-auto",children:[D===0&&c.jsx("div",{className:"text-center text-body",style:{padding:"var(--sp-6) var(--sp-3)",color:"var(--fg-3)"},children:m||g!=="all"?"No matches":"No agents"}),E.length>0&&c.jsxs("div",{children:[c.jsx(JS,{label:"Agents",count:E.length}),E.map(M)]}),j.length>0&&c.jsxs("div",{children:[c.jsx(JS,{label:"Humans",count:j.length}),j.map(M)]})]})]})}function JS({label:e,count:t}){return c.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 m7(){return c.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",focusable:"false",style:{color:"var(--accent)"},children:[c.jsx("title",{children:"pulse"}),c.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 p7(){const[e,t]=Vd(),n=e.get("a"),a=e.get("c");gC();const l=x.useCallback(f=>{t(f?{a:f}:{})},[t]),o=x.useCallback((f,m)=>{t({a:f,c:m})},[t]),{data:u}=Ze({queryKey:["agent-sessions",n],queryFn:()=>n?Vs(n):Promise.resolve([]),enabled:!!n&&!a});return x.useEffect(()=>{if(!n||a||!u||u.length===0)return;const f=[...u].filter(m=>m.state!=="evicted").sort((m,h)=>(h.lastActivityAt??"").localeCompare(m.lastActivityAt??""))[0];f&&t({a:n,c:f.chatId},{replace:!0})},[n,a,u,t]),c.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[c.jsx(h7,{selectedAgentId:n,selectedChatId:a,onSelectAgent:l,onSelectChat:o}),c.jsx("main",{className:"flex-1 flex flex-col overflow-hidden min-w-0",style:{background:"var(--bg)"},children:c.jsx(a7,{selectedAgentId:n,selectedChatId:a})}),n&&c.jsx("aside",{className:"shrink-0 flex flex-col overflow-hidden",style:{width:290,borderLeft:"var(--hairline) solid var(--border)",background:"var(--bg-raised)"},children:c.jsx(s7,{selectedAgentId:n,selectedChatId:a})})]})}const g7=new T2({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}});function y7(){return c.jsx(z2,{client:g7,children:c.jsx(jT,{children:c.jsx(fT,{children:c.jsxs($A,{children:[c.jsx(tr,{path:"/login",element:c.jsx(cq,{})}),c.jsx(tr,{path:"/signup",element:c.jsx(Hd,{to:"/login",replace:!0})}),c.jsx(tr,{path:"/auth/github/complete",element:c.jsx(dq,{})}),c.jsx(tr,{path:"/invite/:token",element:c.jsx(uq,{})}),c.jsx(tr,{element:c.jsx(CT,{}),children:c.jsxs(tr,{element:c.jsx(aI,{children:c.jsx(sD,{children:c.jsx(wD,{})})}),children:[c.jsx(tr,{index:!0,element:c.jsx(p7,{})}),c.jsx(tr,{path:"agents",element:c.jsx(rq,{})}),c.jsx(tr,{path:"agents/:uuid",element:c.jsx($F,{})}),c.jsx(tr,{path:"clients",element:c.jsx(sq,{})}),c.jsx(tr,{path:"settings",element:c.jsx(Nq,{})}),c.jsx(tr,{path:"admin",element:c.jsx(_I,{})})]})})]})})})})}const IE=document.getElementById("root");if(!IE)throw new Error("Root element not found");i2.createRoot(IE).render(c.jsx(x.StrictMode,{children:c.jsx(y7,{})}));