@agent-team-foundation/first-tree-hub 0.8.0 → 0.8.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.
- package/dist/{bootstrap-CRDR6NwE.mjs → bootstrap-99vUYmLs.mjs} +55 -21
- package/dist/cli/index.mjs +8 -5
- package/dist/{core-BXS5ppsG.mjs → core-CNR-lUlr.mjs} +649 -322
- package/dist/esm-CYu4tXXn.mjs +1551 -0
- package/dist/execAsync-CP8iWV5b.mjs +10 -0
- package/dist/{feishu-D9JkMZnU.mjs → feishu-BOISS0DK.mjs} +1 -1
- package/dist/getMachineId-bsd-BB-fnFLA.mjs +26 -0
- package/dist/getMachineId-darwin-DAYWNsYK.mjs +23 -0
- package/dist/getMachineId-linux-BU7Fi6S0.mjs +19 -0
- package/dist/getMachineId-unsupported-BhWCxKBo.mjs +14 -0
- package/dist/getMachineId-win-H5RT49ov.mjs +25 -0
- package/dist/index.mjs +5 -3
- package/dist/logger-core-2yeIU1fc-B-__AsQO.mjs +111 -0
- package/dist/observability-CJzDFY_G-CmvgUuzc.mjs +33892 -0
- package/dist/observability-Xi-sEZI7.mjs +4 -0
- package/dist/web/assets/index-7iSpxOWW.js +333 -0
- package/dist/web/assets/index-Cze8BC63.css +1 -0
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/rolldown-runtime-twds-ZHy.mjs +0 -14
- package/dist/web/assets/index-COlVuDVR.css +0 -1
- package/dist/web/assets/index-KhUJU9Uf.js +0 -333
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
var qy=e=>{throw TypeError(e)};var em=(e,a,r)=>a.has(e)||qy("Cannot "+r);var A=(e,a,r)=>(em(e,a,"read from private field"),r?r.call(e):a.get(e)),ye=(e,a,r)=>a.has(e)?qy("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(e):a.set(e,r),ie=(e,a,r,s)=>(em(e,a,"write to private field"),s?s.call(e,r):a.set(e,r),r),Oe=(e,a,r)=>(em(e,a,"access private method"),r);var Zu=(e,a,r,s)=>({set _(o){ie(e,a,o,r)},get _(){return A(e,a,s)}});function lN(e,a){for(var r=0;r<a.length;r++){const s=a[r];if(typeof s!="string"&&!Array.isArray(s)){for(const o in s)if(o!=="default"&&!(o in e)){const c=Object.getOwnPropertyDescriptor(s,o);c&&Object.defineProperty(e,o,c.get?c:{enumerable:!0,get:()=>s[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const c of o)if(c.type==="childList")for(const m of c.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&s(m)}).observe(document,{childList:!0,subtree:!0});function r(o){const c={};return o.integrity&&(c.integrity=o.integrity),o.referrerPolicy&&(c.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?c.credentials="include":o.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function s(o){if(o.ep)return;o.ep=!0;const c=r(o);fetch(o.href,c)}})();function Ox(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var tm={exports:{}},Qi={};/**
|
|
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 Hy;function sN(){if(Hy)return Qi;Hy=1;var e=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function r(s,o,c){var m=null;if(c!==void 0&&(m=""+c),o.key!==void 0&&(m=""+o.key),"key"in o){c={};for(var h in o)h!=="key"&&(c[h]=o[h])}else c=o;return o=c.ref,{$$typeof:e,type:s,key:m,ref:o!==void 0?o:null,props:c}}return Qi.Fragment=a,Qi.jsx=r,Qi.jsxs=r,Qi}var Iy;function iN(){return Iy||(Iy=1,tm.exports=sN()),tm.exports}var u=iN(),nm={exports:{}},Ae={};/**
|
|
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 Qy;function oN(){if(Qy)return Ae;Qy=1;var e=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),m=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),j=Symbol.iterator;function N(T){return T===null||typeof T!="object"?null:(T=j&&T[j]||T["@@iterator"],typeof T=="function"?T:null)}var z={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,E={};function M(T,k,V){this.props=T,this.context=k,this.refs=E,this.updater=V||z}M.prototype.isReactComponent={},M.prototype.setState=function(T,k){if(typeof T!="object"&&typeof T!="function"&&T!=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,T,k,"setState")},M.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function Z(){}Z.prototype=M.prototype;function D(T,k,V){this.props=T,this.context=k,this.refs=E,this.updater=V||z}var O=D.prototype=new Z;O.constructor=D,w(O,M.prototype),O.isPureReactComponent=!0;var P=Array.isArray;function I(){}var L={H:null,A:null,T:null,S:null},K=Object.prototype.hasOwnProperty;function se(T,k,V){var ee=V.ref;return{$$typeof:e,type:T,key:k,ref:ee!==void 0?ee:null,props:V}}function Se(T,k){return se(T.type,k,T.props)}function _e(T){return typeof T=="object"&&T!==null&&T.$$typeof===e}function re(T){var k={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(V){return k[V]})}var ve=/\/+/g;function Te(T,k){return typeof T=="object"&&T!==null&&T.key!=null?re(""+T.key):k.toString(36)}function we(T){switch(T.status){case"fulfilled":return T.value;case"rejected":throw T.reason;default:switch(typeof T.status=="string"?T.then(I,I):(T.status="pending",T.then(function(k){T.status==="pending"&&(T.status="fulfilled",T.value=k)},function(k){T.status==="pending"&&(T.status="rejected",T.reason=k)})),T.status){case"fulfilled":return T.value;case"rejected":throw T.reason}}throw T}function Q(T,k,V,ee,H){var ne=typeof T;(ne==="undefined"||ne==="boolean")&&(T=null);var fe=!1;if(T===null)fe=!0;else switch(ne){case"bigint":case"string":case"number":fe=!0;break;case"object":switch(T.$$typeof){case e:case a:fe=!0;break;case b:return fe=T._init,Q(fe(T._payload),k,V,ee,H)}}if(fe)return H=H(T),fe=ee===""?"."+Te(T,0):ee,P(H)?(V="",fe!=null&&(V=fe.replace(ve,"$&/")+"/"),Q(H,k,V,"",function(Dt){return Dt})):H!=null&&(_e(H)&&(H=Se(H,V+(H.key==null||T&&T.key===H.key?"":(""+H.key).replace(ve,"$&/")+"/")+fe)),k.push(H)),1;fe=0;var Me=ee===""?".":ee+":";if(P(T))for(var pe=0;pe<T.length;pe++)ee=T[pe],ne=Me+Te(ee,pe),fe+=Q(ee,k,V,ne,H);else if(pe=N(T),typeof pe=="function")for(T=pe.call(T),pe=0;!(ee=T.next()).done;)ee=ee.value,ne=Me+Te(ee,pe++),fe+=Q(ee,k,V,ne,H);else if(ne==="object"){if(typeof T.then=="function")return Q(we(T),k,V,ee,H);throw k=String(T),Error("Objects are not valid as a React child (found: "+(k==="[object Object]"?"object with keys {"+Object.keys(T).join(", ")+"}":k)+"). If you meant to render a collection of children, use an array instead.")}return fe}function te(T,k,V){if(T==null)return T;var ee=[],H=0;return Q(T,ee,"","",function(ne){return k.call(V,ne,H++)}),ee}function ce(T){if(T._status===-1){var k=T._result;k=k(),k.then(function(V){(T._status===0||T._status===-1)&&(T._status=1,T._result=V)},function(V){(T._status===0||T._status===-1)&&(T._status=2,T._result=V)}),T._status===-1&&(T._status=0,T._result=k)}if(T._status===1)return T._result.default;throw T._result}var Ce=typeof reportError=="function"?reportError:function(T){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var k=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof T=="object"&&T!==null&&typeof T.message=="string"?String(T.message):String(T),error:T});if(!window.dispatchEvent(k))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",T);return}console.error(T)},ae={map:te,forEach:function(T,k,V){te(T,function(){k.apply(this,arguments)},V)},count:function(T){var k=0;return te(T,function(){k++}),k},toArray:function(T){return te(T,function(k){return k})||[]},only:function(T){if(!_e(T))throw Error("React.Children.only expected to receive a single React element child.");return T}};return Ae.Activity=x,Ae.Children=ae,Ae.Component=M,Ae.Fragment=r,Ae.Profiler=o,Ae.PureComponent=D,Ae.StrictMode=s,Ae.Suspense=g,Ae.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,Ae.__COMPILER_RUNTIME={__proto__:null,c:function(T){return L.H.useMemoCache(T)}},Ae.cache=function(T){return function(){return T.apply(null,arguments)}},Ae.cacheSignal=function(){return null},Ae.cloneElement=function(T,k,V){if(T==null)throw Error("The argument must be a React element, but you passed "+T+".");var ee=w({},T.props),H=T.key;if(k!=null)for(ne in k.key!==void 0&&(H=""+k.key),k)!K.call(k,ne)||ne==="key"||ne==="__self"||ne==="__source"||ne==="ref"&&k.ref===void 0||(ee[ne]=k[ne]);var ne=arguments.length-2;if(ne===1)ee.children=V;else if(1<ne){for(var fe=Array(ne),Me=0;Me<ne;Me++)fe[Me]=arguments[Me+2];ee.children=fe}return se(T.type,H,ee)},Ae.createContext=function(T){return T={$$typeof:m,_currentValue:T,_currentValue2:T,_threadCount:0,Provider:null,Consumer:null},T.Provider=T,T.Consumer={$$typeof:c,_context:T},T},Ae.createElement=function(T,k,V){var ee,H={},ne=null;if(k!=null)for(ee in k.key!==void 0&&(ne=""+k.key),k)K.call(k,ee)&&ee!=="key"&&ee!=="__self"&&ee!=="__source"&&(H[ee]=k[ee]);var fe=arguments.length-2;if(fe===1)H.children=V;else if(1<fe){for(var Me=Array(fe),pe=0;pe<fe;pe++)Me[pe]=arguments[pe+2];H.children=Me}if(T&&T.defaultProps)for(ee in fe=T.defaultProps,fe)H[ee]===void 0&&(H[ee]=fe[ee]);return se(T,ne,H)},Ae.createRef=function(){return{current:null}},Ae.forwardRef=function(T){return{$$typeof:h,render:T}},Ae.isValidElement=_e,Ae.lazy=function(T){return{$$typeof:b,_payload:{_status:-1,_result:T},_init:ce}},Ae.memo=function(T,k){return{$$typeof:p,type:T,compare:k===void 0?null:k}},Ae.startTransition=function(T){var k=L.T,V={};L.T=V;try{var ee=T(),H=L.S;H!==null&&H(V,ee),typeof ee=="object"&&ee!==null&&typeof ee.then=="function"&&ee.then(I,Ce)}catch(ne){Ce(ne)}finally{k!==null&&V.types!==null&&(k.types=V.types),L.T=k}},Ae.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},Ae.use=function(T){return L.H.use(T)},Ae.useActionState=function(T,k,V){return L.H.useActionState(T,k,V)},Ae.useCallback=function(T,k){return L.H.useCallback(T,k)},Ae.useContext=function(T){return L.H.useContext(T)},Ae.useDebugValue=function(){},Ae.useDeferredValue=function(T,k){return L.H.useDeferredValue(T,k)},Ae.useEffect=function(T,k){return L.H.useEffect(T,k)},Ae.useEffectEvent=function(T){return L.H.useEffectEvent(T)},Ae.useId=function(){return L.H.useId()},Ae.useImperativeHandle=function(T,k,V){return L.H.useImperativeHandle(T,k,V)},Ae.useInsertionEffect=function(T,k){return L.H.useInsertionEffect(T,k)},Ae.useLayoutEffect=function(T,k){return L.H.useLayoutEffect(T,k)},Ae.useMemo=function(T,k){return L.H.useMemo(T,k)},Ae.useOptimistic=function(T,k){return L.H.useOptimistic(T,k)},Ae.useReducer=function(T,k,V){return L.H.useReducer(T,k,V)},Ae.useRef=function(T){return L.H.useRef(T)},Ae.useState=function(T){return L.H.useState(T)},Ae.useSyncExternalStore=function(T,k,V){return L.H.useSyncExternalStore(T,k,V)},Ae.useTransition=function(){return L.H.useTransition()},Ae.version="19.2.4",Ae}var Gy;function ch(){return Gy||(Gy=1,nm.exports=oN()),nm.exports}var v=ch();const uN=Ox(v),dh=lN({__proto__:null,default:uN},[v]);var am={exports:{}},Gi={},rm={exports:{}},lm={};/**
|
|
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 Py;function cN(){return Py||(Py=1,(function(e){function a(Q,te){var ce=Q.length;Q.push(te);e:for(;0<ce;){var Ce=ce-1>>>1,ae=Q[Ce];if(0<o(ae,te))Q[Ce]=te,Q[ce]=ae,ce=Ce;else break e}}function r(Q){return Q.length===0?null:Q[0]}function s(Q){if(Q.length===0)return null;var te=Q[0],ce=Q.pop();if(ce!==te){Q[0]=ce;e:for(var Ce=0,ae=Q.length,T=ae>>>1;Ce<T;){var k=2*(Ce+1)-1,V=Q[k],ee=k+1,H=Q[ee];if(0>o(V,ce))ee<ae&&0>o(H,V)?(Q[Ce]=H,Q[ee]=ce,Ce=ee):(Q[Ce]=V,Q[k]=ce,Ce=k);else if(ee<ae&&0>o(H,ce))Q[Ce]=H,Q[ee]=ce,Ce=ee;else break e}}return te}function o(Q,te){var ce=Q.sortIndex-te.sortIndex;return ce!==0?ce:Q.id-te.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var m=Date,h=m.now();e.unstable_now=function(){return m.now()-h}}var g=[],p=[],b=1,x=null,j=3,N=!1,z=!1,w=!1,E=!1,M=typeof setTimeout=="function"?setTimeout:null,Z=typeof clearTimeout=="function"?clearTimeout:null,D=typeof setImmediate<"u"?setImmediate:null;function O(Q){for(var te=r(p);te!==null;){if(te.callback===null)s(p);else if(te.startTime<=Q)s(p),te.sortIndex=te.expirationTime,a(g,te);else break;te=r(p)}}function P(Q){if(w=!1,O(Q),!z)if(r(g)!==null)z=!0,I||(I=!0,re());else{var te=r(p);te!==null&&we(P,te.startTime-Q)}}var I=!1,L=-1,K=5,se=-1;function Se(){return E?!0:!(e.unstable_now()-se<K)}function _e(){if(E=!1,I){var Q=e.unstable_now();se=Q;var te=!0;try{e:{z=!1,w&&(w=!1,Z(L),L=-1),N=!0;var ce=j;try{t:{for(O(Q),x=r(g);x!==null&&!(x.expirationTime>Q&&Se());){var Ce=x.callback;if(typeof Ce=="function"){x.callback=null,j=x.priorityLevel;var ae=Ce(x.expirationTime<=Q);if(Q=e.unstable_now(),typeof ae=="function"){x.callback=ae,O(Q),te=!0;break t}x===r(g)&&s(g),O(Q)}else s(g);x=r(g)}if(x!==null)te=!0;else{var T=r(p);T!==null&&we(P,T.startTime-Q),te=!1}}break e}finally{x=null,j=ce,N=!1}te=void 0}}finally{te?re():I=!1}}}var re;if(typeof D=="function")re=function(){D(_e)};else if(typeof MessageChannel<"u"){var ve=new MessageChannel,Te=ve.port2;ve.port1.onmessage=_e,re=function(){Te.postMessage(null)}}else re=function(){M(_e,0)};function we(Q,te){L=M(function(){Q(e.unstable_now())},te)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(Q){Q.callback=null},e.unstable_forceFrameRate=function(Q){0>Q||125<Q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):K=0<Q?Math.floor(1e3/Q):5},e.unstable_getCurrentPriorityLevel=function(){return j},e.unstable_next=function(Q){switch(j){case 1:case 2:case 3:var te=3;break;default:te=j}var ce=j;j=te;try{return Q()}finally{j=ce}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(Q,te){switch(Q){case 1:case 2:case 3:case 4:case 5:break;default:Q=3}var ce=j;j=Q;try{return te()}finally{j=ce}},e.unstable_scheduleCallback=function(Q,te,ce){var Ce=e.unstable_now();switch(typeof ce=="object"&&ce!==null?(ce=ce.delay,ce=typeof ce=="number"&&0<ce?Ce+ce:Ce):ce=Ce,Q){case 1:var ae=-1;break;case 2:ae=250;break;case 5:ae=1073741823;break;case 4:ae=1e4;break;default:ae=5e3}return ae=ce+ae,Q={id:b++,callback:te,priorityLevel:Q,startTime:ce,expirationTime:ae,sortIndex:-1},ce>Ce?(Q.sortIndex=ce,a(p,Q),r(g)===null&&Q===r(p)&&(w?(Z(L),L=-1):w=!0,we(P,ce-Ce))):(Q.sortIndex=ae,a(g,Q),z||N||(z=!0,I||(I=!0,re()))),Q},e.unstable_shouldYield=Se,e.unstable_wrapCallback=function(Q){var te=j;return function(){var ce=j;j=te;try{return Q.apply(this,arguments)}finally{j=ce}}}})(lm)),lm}var Vy;function dN(){return Vy||(Vy=1,rm.exports=cN()),rm.exports}var sm={exports:{}},Ht={};/**
|
|
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 Ky;function fN(){if(Ky)return Ht;Ky=1;var e=ch();function a(g){var p="https://react.dev/errors/"+g;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)p+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+g+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var s={d:{f:r,r:function(){throw Error(a(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for("react.portal");function c(g,p,b){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:x==null?null:""+x,children:g,containerInfo:p,implementation:b}}var m=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(g,p){if(g==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return Ht.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,Ht.createPortal=function(g,p){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(a(299));return c(g,p,null,b)},Ht.flushSync=function(g){var p=m.T,b=s.p;try{if(m.T=null,s.p=2,g)return g()}finally{m.T=p,s.p=b,s.d.f()}},Ht.preconnect=function(g,p){typeof g=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,s.d.C(g,p))},Ht.prefetchDNS=function(g){typeof g=="string"&&s.d.D(g)},Ht.preinit=function(g,p){if(typeof g=="string"&&p&&typeof p.as=="string"){var b=p.as,x=h(b,p.crossOrigin),j=typeof p.integrity=="string"?p.integrity:void 0,N=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;b==="style"?s.d.S(g,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:x,integrity:j,fetchPriority:N}):b==="script"&&s.d.X(g,{crossOrigin:x,integrity:j,fetchPriority:N,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},Ht.preinitModule=function(g,p){if(typeof g=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var b=h(p.as,p.crossOrigin);s.d.M(g,{crossOrigin:b,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&s.d.M(g)},Ht.preload=function(g,p){if(typeof g=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var b=p.as,x=h(b,p.crossOrigin);s.d.L(g,b,{crossOrigin:x,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},Ht.preloadModule=function(g,p){if(typeof g=="string")if(p){var b=h(p.as,p.crossOrigin);s.d.m(g,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:b,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else s.d.m(g)},Ht.requestFormReset=function(g){s.d.r(g)},Ht.unstable_batchedUpdates=function(g,p){return g(p)},Ht.useFormState=function(g,p,b){return m.H.useFormState(g,p,b)},Ht.useFormStatus=function(){return m.H.useHostTransitionStatus()},Ht.version="19.2.4",Ht}var Yy;function Mx(){if(Yy)return sm.exports;Yy=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(a){console.error(a)}}return e(),sm.exports=fN(),sm.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 Fy;function mN(){if(Fy)return Gi;Fy=1;var e=dN(),a=ch(),r=Mx();function s(t){var n="https://react.dev/errors/"+t;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)n+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+t+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function c(t){var n=t,l=t;if(t.alternate)for(;n.return;)n=n.return;else{t=n;do n=t,(n.flags&4098)!==0&&(l=n.return),t=n.return;while(t)}return n.tag===3?l:null}function m(t){if(t.tag===13){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function h(t){if(t.tag===31){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function g(t){if(c(t)!==t)throw Error(s(188))}function p(t){var n=t.alternate;if(!n){if(n=c(t),n===null)throw Error(s(188));return n!==t?null:t}for(var l=t,i=n;;){var d=l.return;if(d===null)break;var f=d.alternate;if(f===null){if(i=d.return,i!==null){l=i;continue}break}if(d.child===f.child){for(f=d.child;f;){if(f===l)return g(d),t;if(f===i)return g(d),n;f=f.sibling}throw Error(s(188))}if(l.return!==i.return)l=d,i=f;else{for(var y=!1,S=d.child;S;){if(S===l){y=!0,l=d,i=f;break}if(S===i){y=!0,i=d,l=f;break}S=S.sibling}if(!y){for(S=f.child;S;){if(S===l){y=!0,l=f,i=d;break}if(S===i){y=!0,i=f,l=d;break}S=S.sibling}if(!y)throw Error(s(189))}}if(l.alternate!==i)throw Error(s(190))}if(l.tag!==3)throw Error(s(188));return l.stateNode.current===l?t:n}function b(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t;for(t=t.child;t!==null;){if(n=b(t),n!==null)return n;t=t.sibling}return null}var x=Object.assign,j=Symbol.for("react.element"),N=Symbol.for("react.transitional.element"),z=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),Z=Symbol.for("react.consumer"),D=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),K=Symbol.for("react.lazy"),se=Symbol.for("react.activity"),Se=Symbol.for("react.memo_cache_sentinel"),_e=Symbol.iterator;function re(t){return t===null||typeof t!="object"?null:(t=_e&&t[_e]||t["@@iterator"],typeof t=="function"?t:null)}var ve=Symbol.for("react.client.reference");function Te(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===ve?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case w:return"Fragment";case M:return"Profiler";case E:return"StrictMode";case P:return"Suspense";case I:return"SuspenseList";case se:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case z:return"Portal";case D:return t.displayName||"Context";case Z:return(t._context.displayName||"Context")+".Consumer";case O:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case L:return n=t.displayName||null,n!==null?n:Te(t.type)||"Memo";case K:n=t._payload,t=t._init;try{return Te(t(n))}catch{}}return null}var we=Array.isArray,Q=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce={pending:!1,data:null,method:null,action:null},Ce=[],ae=-1;function T(t){return{current:t}}function k(t){0>ae||(t.current=Ce[ae],Ce[ae]=null,ae--)}function V(t,n){ae++,Ce[ae]=t.current,t.current=n}var ee=T(null),H=T(null),ne=T(null),fe=T(null);function Me(t,n){switch(V(ne,n),V(H,t),V(ee,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?cy(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=cy(n),t=dy(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}k(ee),V(ee,t)}function pe(){k(ee),k(H),k(ne)}function Dt(t){t.memoizedState!==null&&V(fe,t);var n=ee.current,l=dy(n,t.type);n!==l&&(V(H,t),V(ee,l))}function jn(t){H.current===t&&(k(ee),k(H)),fe.current===t&&(k(fe),Zi._currentValue=ce)}var wn,da;function Qt(t){if(wn===void 0)try{throw Error()}catch(l){var n=l.stack.trim().match(/\n( *(at )?)/);wn=n&&n[1]||"",da=-1<l.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+wn+t+da}var Ml=!1;function Ir(t,n){if(!t||Ml)return"";Ml=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(n){var J=function(){throw Error()};if(Object.defineProperty(J.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(J,[])}catch(G){var q=G}Reflect.construct(t,[],J)}else{try{J.call()}catch(G){q=G}t.call(J.prototype)}}else{try{throw Error()}catch(G){q=G}(J=t())&&typeof J.catch=="function"&&J.catch(function(){})}}catch(G){if(G&&q&&typeof G.stack=="string")return[G.stack,q.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var d=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");d&&d.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=i.DetermineComponentFrameRoot(),y=f[0],S=f[1];if(y&&S){var C=y.split(`
|
|
44
|
+
`),B=S.split(`
|
|
45
|
+
`);for(d=i=0;i<C.length&&!C[i].includes("DetermineComponentFrameRoot");)i++;for(;d<B.length&&!B[d].includes("DetermineComponentFrameRoot");)d++;if(i===C.length||d===B.length)for(i=C.length-1,d=B.length-1;1<=i&&0<=d&&C[i]!==B[d];)d--;for(;1<=i&&0<=d;i--,d--)if(C[i]!==B[d]){if(i!==1||d!==1)do if(i--,d--,0>d||C[i]!==B[d]){var Y=`
|
|
46
|
+
`+C[i].replace(" at new "," at ");return t.displayName&&Y.includes("<anonymous>")&&(Y=Y.replace("<anonymous>",t.displayName)),Y}while(1<=i&&0<=d);break}}}finally{Ml=!1,Error.prepareStackTrace=l}return(l=t?t.displayName||t.name:"")?Qt(l):""}function xt(t,n){switch(t.tag){case 26:case 27:case 5:return Qt(t.type);case 16:return Qt("Lazy");case 13:return t.child!==n&&n!==null?Qt("Suspense Fallback"):Qt("Suspense");case 19:return Qt("SuspenseList");case 0:case 15:return Ir(t.type,!1);case 11:return Ir(t.type.render,!1);case 1:return Ir(t.type,!0);case 31:return Qt("Activity");default:return""}}function qt(t){try{var n="",l=null;do n+=xt(t,l),l=t,t=t.return;while(t);return n}catch(i){return`
|
|
47
|
+
Error generating stack: `+i.message+`
|
|
48
|
+
`+i.stack}}var Qn=Object.prototype.hasOwnProperty,Dl=e.unstable_scheduleCallback,Ul=e.unstable_cancelCallback,Uc=e.unstable_shouldYield,So=e.unstable_requestPaint,Gt=e.unstable_now,Lc=e.unstable_getCurrentPriorityLevel,Qr=e.unstable_ImmediatePriority,jo=e.unstable_UserBlockingPriority,Ll=e.unstable_NormalPriority,wo=e.unstable_LowPriority,ei=e.unstable_IdlePriority,$c=e.log,Bc=e.unstable_setDisableYieldValue,Gr=null,Pt=null;function Jn(t){if(typeof $c=="function"&&Bc(t),Pt&&typeof Pt.setStrictMode=="function")try{Pt.setStrictMode(Gr,t)}catch{}}var Vt=Math.clz32?Math.clz32:Eo,Zc=Math.log,No=Math.LN2;function Eo(t){return t>>>=0,t===0?32:31-(Zc(t)/No|0)|0}var Pr=256,Vr=262144,Kr=4194304;function Wn(t){var n=t&42;if(n!==0)return n;switch(t&-t){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 t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Yr(t,n,l){var i=t.pendingLanes;if(i===0)return 0;var d=0,f=t.suspendedLanes,y=t.pingedLanes;t=t.warmLanes;var S=i&134217727;return S!==0?(i=S&~f,i!==0?d=Wn(i):(y&=S,y!==0?d=Wn(y):l||(l=S&~t,l!==0&&(d=Wn(l))))):(S=i&~f,S!==0?d=Wn(S):y!==0?d=Wn(y):l||(l=i&~t,l!==0&&(d=Wn(l)))),d===0?0:n!==0&&n!==d&&(n&f)===0&&(f=d&-d,l=n&-n,f>=l||f===32&&(l&4194048)!==0)?n:d}function Ka(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function _o(t,n){switch(t){case 1:case 2:case 4:case 8:case 64:return n+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 n+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 W(){var t=Kr;return Kr<<=1,(Kr&62914560)===0&&(Kr=4194304),t}function $e(t){for(var n=[],l=0;31>l;l++)n.push(t);return n}function Kt(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Co(t,n,l,i,d,f){var y=t.pendingLanes;t.pendingLanes=l,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=l,t.entangledLanes&=l,t.errorRecoveryDisabledLanes&=l,t.shellSuspendCounter=0;var S=t.entanglements,C=t.expirationTimes,B=t.hiddenUpdates;for(l=y&~l;0<l;){var Y=31-Vt(l),J=1<<Y;S[Y]=0,C[Y]=-1;var q=B[Y];if(q!==null)for(B[Y]=null,Y=0;Y<q.length;Y++){var G=q[Y];G!==null&&(G.lane&=-536870913)}l&=~J}i!==0&&qc(t,i,0),f!==0&&d===0&&t.tag!==0&&(t.suspendedLanes|=f&~(y&~n))}function qc(t,n,l){t.pendingLanes|=n,t.suspendedLanes&=~n;var i=31-Vt(n);t.entangledLanes|=n,t.entanglements[i]=t.entanglements[i]|1073741824|l&261930}function Vh(t,n){var l=t.entangledLanes|=n;for(t=t.entanglements;l;){var i=31-Vt(l),d=1<<i;d&n|t[i]&n&&(t[i]|=n),l&=~d}}function Kh(t,n){var l=n&-n;return l=(l&42)!==0?1:Hc(l),(l&(t.suspendedLanes|n))!==0?0:l}function Hc(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function Ic(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Yh(){var t=te.p;return t!==0?t:(t=window.event,t===void 0?32:My(t.type))}function Fh(t,n){var l=te.p;try{return te.p=t,n()}finally{te.p=l}}var Ya=Math.random().toString(36).slice(2),Ut="__reactFiber$"+Ya,en="__reactProps$"+Ya,$l="__reactContainer$"+Ya,Qc="__reactEvents$"+Ya,K1="__reactListeners$"+Ya,Y1="__reactHandles$"+Ya,Xh="__reactResources$"+Ya,ti="__reactMarker$"+Ya;function Gc(t){delete t[Ut],delete t[en],delete t[Qc],delete t[K1],delete t[Y1]}function Bl(t){var n=t[Ut];if(n)return n;for(var l=t.parentNode;l;){if(n=l[$l]||l[Ut]){if(l=n.alternate,n.child!==null||l!==null&&l.child!==null)for(t=yy(t);t!==null;){if(l=t[Ut])return l;t=yy(t)}return n}t=l,l=t.parentNode}return null}function Zl(t){if(t=t[Ut]||t[$l]){var n=t.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return t}return null}function ni(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t.stateNode;throw Error(s(33))}function ql(t){var n=t[Xh];return n||(n=t[Xh]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function Rt(t){t[ti]=!0}var Jh=new Set,Wh={};function Fr(t,n){Hl(t,n),Hl(t+"Capture",n)}function Hl(t,n){for(Wh[t]=n,t=0;t<n.length;t++)Jh.add(n[t])}var F1=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]*$"),ep={},tp={};function X1(t){return Qn.call(tp,t)?!0:Qn.call(ep,t)?!1:F1.test(t)?tp[t]=!0:(ep[t]=!0,!1)}function Ao(t,n,l){if(X1(n))if(l===null)t.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":t.removeAttribute(n);return;case"boolean":var i=n.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){t.removeAttribute(n);return}}t.setAttribute(n,""+l)}}function ko(t,n,l){if(l===null)t.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttribute(n,""+l)}}function fa(t,n,l,i){if(i===null)t.removeAttribute(l);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(l);return}t.setAttributeNS(n,l,""+i)}}function Nn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function np(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function J1(t,n,l){var i=Object.getOwnPropertyDescriptor(t.constructor.prototype,n);if(!t.hasOwnProperty(n)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var d=i.get,f=i.set;return Object.defineProperty(t,n,{configurable:!0,get:function(){return d.call(this)},set:function(y){l=""+y,f.call(this,y)}}),Object.defineProperty(t,n,{enumerable:i.enumerable}),{getValue:function(){return l},setValue:function(y){l=""+y},stopTracking:function(){t._valueTracker=null,delete t[n]}}}}function Pc(t){if(!t._valueTracker){var n=np(t)?"checked":"value";t._valueTracker=J1(t,n,""+t[n])}}function ap(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var l=n.getValue(),i="";return t&&(i=np(t)?t.checked?"true":"false":t.value),t=i,t!==l?(n.setValue(t),!0):!1}function zo(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var W1=/[\n"\\]/g;function En(t){return t.replace(W1,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Vc(t,n,l,i,d,f,y,S){t.name="",y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?t.type=y:t.removeAttribute("type"),n!=null?y==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+Nn(n)):t.value!==""+Nn(n)&&(t.value=""+Nn(n)):y!=="submit"&&y!=="reset"||t.removeAttribute("value"),n!=null?Kc(t,y,Nn(n)):l!=null?Kc(t,y,Nn(l)):i!=null&&t.removeAttribute("value"),d==null&&f!=null&&(t.defaultChecked=!!f),d!=null&&(t.checked=d&&typeof d!="function"&&typeof d!="symbol"),S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?t.name=""+Nn(S):t.removeAttribute("name")}function rp(t,n,l,i,d,f,y,S){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(t.type=f),n!=null||l!=null){if(!(f!=="submit"&&f!=="reset"||n!=null)){Pc(t);return}l=l!=null?""+Nn(l):"",n=n!=null?""+Nn(n):l,S||n===t.value||(t.value=n),t.defaultValue=n}i=i??d,i=typeof i!="function"&&typeof i!="symbol"&&!!i,t.checked=S?t.checked:!!i,t.defaultChecked=!!i,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(t.name=y),Pc(t)}function Kc(t,n,l){n==="number"&&zo(t.ownerDocument)===t||t.defaultValue===""+l||(t.defaultValue=""+l)}function Il(t,n,l,i){if(t=t.options,n){n={};for(var d=0;d<l.length;d++)n["$"+l[d]]=!0;for(l=0;l<t.length;l++)d=n.hasOwnProperty("$"+t[l].value),t[l].selected!==d&&(t[l].selected=d),d&&i&&(t[l].defaultSelected=!0)}else{for(l=""+Nn(l),n=null,d=0;d<t.length;d++){if(t[d].value===l){t[d].selected=!0,i&&(t[d].defaultSelected=!0);return}n!==null||t[d].disabled||(n=t[d])}n!==null&&(n.selected=!0)}}function lp(t,n,l){if(n!=null&&(n=""+Nn(n),n!==t.value&&(t.value=n),l==null)){t.defaultValue!==n&&(t.defaultValue=n);return}t.defaultValue=l!=null?""+Nn(l):""}function sp(t,n,l,i){if(n==null){if(i!=null){if(l!=null)throw Error(s(92));if(we(i)){if(1<i.length)throw Error(s(93));i=i[0]}l=i}l==null&&(l=""),n=l}l=Nn(n),t.defaultValue=l,i=t.textContent,i===l&&i!==""&&i!==null&&(t.value=i),Pc(t)}function Ql(t,n){if(n){var l=t.firstChild;if(l&&l===t.lastChild&&l.nodeType===3){l.nodeValue=n;return}}t.textContent=n}var ej=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 ip(t,n,l){var i=n.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?i?t.setProperty(n,""):n==="float"?t.cssFloat="":t[n]="":i?t.setProperty(n,l):typeof l!="number"||l===0||ej.has(n)?n==="float"?t.cssFloat=l:t[n]=(""+l).trim():t[n]=l+"px"}function op(t,n,l){if(n!=null&&typeof n!="object")throw Error(s(62));if(t=t.style,l!=null){for(var i in l)!l.hasOwnProperty(i)||n!=null&&n.hasOwnProperty(i)||(i.indexOf("--")===0?t.setProperty(i,""):i==="float"?t.cssFloat="":t[i]="");for(var d in n)i=n[d],n.hasOwnProperty(d)&&l[d]!==i&&ip(t,d,i)}else for(var f in n)n.hasOwnProperty(f)&&ip(t,f,n[f])}function Yc(t){if(t.indexOf("-")===-1)return!1;switch(t){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 tj=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"]]),nj=/^[\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 To(t){return nj.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function ma(){}var Fc=null;function Xc(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Gl=null,Pl=null;function up(t){var n=Zl(t);if(n&&(t=n.stateNode)){var l=t[en]||null;e:switch(t=n.stateNode,n.type){case"input":if(Vc(t,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),n=l.name,l.type==="radio"&&n!=null){for(l=t;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+En(""+n)+'"][type="radio"]'),n=0;n<l.length;n++){var i=l[n];if(i!==t&&i.form===t.form){var d=i[en]||null;if(!d)throw Error(s(90));Vc(i,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(n=0;n<l.length;n++)i=l[n],i.form===t.form&&ap(i)}break e;case"textarea":lp(t,l.value,l.defaultValue);break e;case"select":n=l.value,n!=null&&Il(t,!!l.multiple,n,!1)}}}var Jc=!1;function cp(t,n,l){if(Jc)return t(n,l);Jc=!0;try{var i=t(n);return i}finally{if(Jc=!1,(Gl!==null||Pl!==null)&&(yu(),Gl&&(n=Gl,t=Pl,Pl=Gl=null,up(n),t)))for(n=0;n<t.length;n++)up(t[n])}}function ai(t,n){var l=t.stateNode;if(l===null)return null;var i=l[en]||null;if(i===null)return null;l=i[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(t=t.type,i=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!i;break e;default:t=!1}if(t)return null;if(l&&typeof l!="function")throw Error(s(231,n,typeof l));return l}var ha=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Wc=!1;if(ha)try{var ri={};Object.defineProperty(ri,"passive",{get:function(){Wc=!0}}),window.addEventListener("test",ri,ri),window.removeEventListener("test",ri,ri)}catch{Wc=!1}var Fa=null,ed=null,Ro=null;function dp(){if(Ro)return Ro;var t,n=ed,l=n.length,i,d="value"in Fa?Fa.value:Fa.textContent,f=d.length;for(t=0;t<l&&n[t]===d[t];t++);var y=l-t;for(i=1;i<=y&&n[l-i]===d[f-i];i++);return Ro=d.slice(t,1<i?1-i:void 0)}function Oo(t){var n=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&n===13&&(t=13)):t=n,t===10&&(t=13),32<=t||t===13?t:0}function Mo(){return!0}function fp(){return!1}function tn(t){function n(l,i,d,f,y){this._reactName=l,this._targetInst=d,this.type=i,this.nativeEvent=f,this.target=y,this.currentTarget=null;for(var S in t)t.hasOwnProperty(S)&&(l=t[S],this[S]=l?l(f):f[S]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?Mo:fp,this.isPropagationStopped=fp,this}return x(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Mo)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Mo)},persist:function(){},isPersistent:Mo}),n}var Xr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Do=tn(Xr),li=x({},Xr,{view:0,detail:0}),aj=tn(li),td,nd,si,Uo=x({},li,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:rd,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==si&&(si&&t.type==="mousemove"?(td=t.screenX-si.screenX,nd=t.screenY-si.screenY):nd=td=0,si=t),td)},movementY:function(t){return"movementY"in t?t.movementY:nd}}),mp=tn(Uo),rj=x({},Uo,{dataTransfer:0}),lj=tn(rj),sj=x({},li,{relatedTarget:0}),ad=tn(sj),ij=x({},Xr,{animationName:0,elapsedTime:0,pseudoElement:0}),oj=tn(ij),uj=x({},Xr,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),cj=tn(uj),dj=x({},Xr,{data:0}),hp=tn(dj),fj={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},mj={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"},hj={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function pj(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=hj[t])?!!n[t]:!1}function rd(){return pj}var gj=x({},li,{key:function(t){if(t.key){var n=fj[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=Oo(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?mj[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:rd,charCode:function(t){return t.type==="keypress"?Oo(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Oo(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),vj=tn(gj),yj=x({},Uo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),pp=tn(yj),bj=x({},li,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:rd}),xj=tn(bj),Sj=x({},Xr,{propertyName:0,elapsedTime:0,pseudoElement:0}),jj=tn(Sj),wj=x({},Uo,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),Nj=tn(wj),Ej=x({},Xr,{newState:0,oldState:0}),_j=tn(Ej),Cj=[9,13,27,32],ld=ha&&"CompositionEvent"in window,ii=null;ha&&"documentMode"in document&&(ii=document.documentMode);var Aj=ha&&"TextEvent"in window&&!ii,gp=ha&&(!ld||ii&&8<ii&&11>=ii),vp=" ",yp=!1;function bp(t,n){switch(t){case"keyup":return Cj.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function xp(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Vl=!1;function kj(t,n){switch(t){case"compositionend":return xp(n);case"keypress":return n.which!==32?null:(yp=!0,vp);case"textInput":return t=n.data,t===vp&&yp?null:t;default:return null}}function zj(t,n){if(Vl)return t==="compositionend"||!ld&&bp(t,n)?(t=dp(),Ro=ed=Fa=null,Vl=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return gp&&n.locale!=="ko"?null:n.data;default:return null}}var Tj={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 Sp(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!Tj[t.type]:n==="textarea"}function jp(t,n,l,i){Gl?Pl?Pl.push(i):Pl=[i]:Gl=i,n=Eu(n,"onChange"),0<n.length&&(l=new Do("onChange","change",null,l,i),t.push({event:l,listeners:n}))}var oi=null,ui=null;function Rj(t){ry(t,0)}function Lo(t){var n=ni(t);if(ap(n))return t}function wp(t,n){if(t==="change")return n}var Np=!1;if(ha){var sd;if(ha){var id="oninput"in document;if(!id){var Ep=document.createElement("div");Ep.setAttribute("oninput","return;"),id=typeof Ep.oninput=="function"}sd=id}else sd=!1;Np=sd&&(!document.documentMode||9<document.documentMode)}function _p(){oi&&(oi.detachEvent("onpropertychange",Cp),ui=oi=null)}function Cp(t){if(t.propertyName==="value"&&Lo(ui)){var n=[];jp(n,ui,t,Xc(t)),cp(Rj,n)}}function Oj(t,n,l){t==="focusin"?(_p(),oi=n,ui=l,oi.attachEvent("onpropertychange",Cp)):t==="focusout"&&_p()}function Mj(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Lo(ui)}function Dj(t,n){if(t==="click")return Lo(n)}function Uj(t,n){if(t==="input"||t==="change")return Lo(n)}function Lj(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var fn=typeof Object.is=="function"?Object.is:Lj;function ci(t,n){if(fn(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;var l=Object.keys(t),i=Object.keys(n);if(l.length!==i.length)return!1;for(i=0;i<l.length;i++){var d=l[i];if(!Qn.call(n,d)||!fn(t[d],n[d]))return!1}return!0}function Ap(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function kp(t,n){var l=Ap(t);t=0;for(var i;l;){if(l.nodeType===3){if(i=t+l.textContent.length,t<=n&&i>=n)return{node:l,offset:n-t};t=i}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Ap(l)}}function zp(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?zp(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function Tp(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=zo(t.document);n instanceof t.HTMLIFrameElement;){try{var l=typeof n.contentWindow.location.href=="string"}catch{l=!1}if(l)t=n.contentWindow;else break;n=zo(t.document)}return n}function od(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n&&(n==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||n==="textarea"||t.contentEditable==="true")}var $j=ha&&"documentMode"in document&&11>=document.documentMode,Kl=null,ud=null,di=null,cd=!1;function Rp(t,n,l){var i=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;cd||Kl==null||Kl!==zo(i)||(i=Kl,"selectionStart"in i&&od(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),di&&ci(di,i)||(di=i,i=Eu(ud,"onSelect"),0<i.length&&(n=new Do("onSelect","select",null,n,l),t.push({event:n,listeners:i}),n.target=Kl)))}function Jr(t,n){var l={};return l[t.toLowerCase()]=n.toLowerCase(),l["Webkit"+t]="webkit"+n,l["Moz"+t]="moz"+n,l}var Yl={animationend:Jr("Animation","AnimationEnd"),animationiteration:Jr("Animation","AnimationIteration"),animationstart:Jr("Animation","AnimationStart"),transitionrun:Jr("Transition","TransitionRun"),transitionstart:Jr("Transition","TransitionStart"),transitioncancel:Jr("Transition","TransitionCancel"),transitionend:Jr("Transition","TransitionEnd")},dd={},Op={};ha&&(Op=document.createElement("div").style,"AnimationEvent"in window||(delete Yl.animationend.animation,delete Yl.animationiteration.animation,delete Yl.animationstart.animation),"TransitionEvent"in window||delete Yl.transitionend.transition);function Wr(t){if(dd[t])return dd[t];if(!Yl[t])return t;var n=Yl[t],l;for(l in n)if(n.hasOwnProperty(l)&&l in Op)return dd[t]=n[l];return t}var Mp=Wr("animationend"),Dp=Wr("animationiteration"),Up=Wr("animationstart"),Bj=Wr("transitionrun"),Zj=Wr("transitionstart"),qj=Wr("transitioncancel"),Lp=Wr("transitionend"),$p=new Map,fd="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(" ");fd.push("scrollEnd");function Gn(t,n){$p.set(t,n),Fr(n,[t])}var $o=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},_n=[],Fl=0,md=0;function Bo(){for(var t=Fl,n=md=Fl=0;n<t;){var l=_n[n];_n[n++]=null;var i=_n[n];_n[n++]=null;var d=_n[n];_n[n++]=null;var f=_n[n];if(_n[n++]=null,i!==null&&d!==null){var y=i.pending;y===null?d.next=d:(d.next=y.next,y.next=d),i.pending=d}f!==0&&Bp(l,d,f)}}function Zo(t,n,l,i){_n[Fl++]=t,_n[Fl++]=n,_n[Fl++]=l,_n[Fl++]=i,md|=i,t.lanes|=i,t=t.alternate,t!==null&&(t.lanes|=i)}function hd(t,n,l,i){return Zo(t,n,l,i),qo(t)}function el(t,n){return Zo(t,null,null,n),qo(t)}function Bp(t,n,l){t.lanes|=l;var i=t.alternate;i!==null&&(i.lanes|=l);for(var d=!1,f=t.return;f!==null;)f.childLanes|=l,i=f.alternate,i!==null&&(i.childLanes|=l),f.tag===22&&(t=f.stateNode,t===null||t._visibility&1||(d=!0)),t=f,f=f.return;return t.tag===3?(f=t.stateNode,d&&n!==null&&(d=31-Vt(l),t=f.hiddenUpdates,i=t[d],i===null?t[d]=[n]:i.push(n),n.lane=l|536870912),f):null}function qo(t){if(50<Oi)throw Oi=0,Nf=null,Error(s(185));for(var n=t.return;n!==null;)t=n,n=t.return;return t.tag===3?t.stateNode:null}var Xl={};function Hj(t,n,l,i){this.tag=t,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function mn(t,n,l,i){return new Hj(t,n,l,i)}function pd(t){return t=t.prototype,!(!t||!t.isReactComponent)}function pa(t,n){var l=t.alternate;return l===null?(l=mn(t.tag,n,t.key,t.mode),l.elementType=t.elementType,l.type=t.type,l.stateNode=t.stateNode,l.alternate=t,t.alternate=l):(l.pendingProps=n,l.type=t.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=t.flags&65011712,l.childLanes=t.childLanes,l.lanes=t.lanes,l.child=t.child,l.memoizedProps=t.memoizedProps,l.memoizedState=t.memoizedState,l.updateQueue=t.updateQueue,n=t.dependencies,l.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},l.sibling=t.sibling,l.index=t.index,l.ref=t.ref,l.refCleanup=t.refCleanup,l}function Zp(t,n){t.flags&=65011714;var l=t.alternate;return l===null?(t.childLanes=0,t.lanes=n,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=l.childLanes,t.lanes=l.lanes,t.child=l.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=l.memoizedProps,t.memoizedState=l.memoizedState,t.updateQueue=l.updateQueue,t.type=l.type,n=l.dependencies,t.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),t}function Ho(t,n,l,i,d,f){var y=0;if(i=t,typeof t=="function")pd(t)&&(y=1);else if(typeof t=="string")y=Vw(t,l,ee.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case se:return t=mn(31,l,n,d),t.elementType=se,t.lanes=f,t;case w:return tl(l.children,d,f,n);case E:y=8,d|=24;break;case M:return t=mn(12,l,n,d|2),t.elementType=M,t.lanes=f,t;case P:return t=mn(13,l,n,d),t.elementType=P,t.lanes=f,t;case I:return t=mn(19,l,n,d),t.elementType=I,t.lanes=f,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case D:y=10;break e;case Z:y=9;break e;case O:y=11;break e;case L:y=14;break e;case K:y=16,i=null;break e}y=29,l=Error(s(130,t===null?"null":typeof t,"")),i=null}return n=mn(y,l,n,d),n.elementType=t,n.type=i,n.lanes=f,n}function tl(t,n,l,i){return t=mn(7,t,i,n),t.lanes=l,t}function gd(t,n,l){return t=mn(6,t,null,n),t.lanes=l,t}function qp(t){var n=mn(18,null,null,0);return n.stateNode=t,n}function vd(t,n,l){return n=mn(4,t.children!==null?t.children:[],t.key,n),n.lanes=l,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}var Hp=new WeakMap;function Cn(t,n){if(typeof t=="object"&&t!==null){var l=Hp.get(t);return l!==void 0?l:(n={value:t,source:n,stack:qt(n)},Hp.set(t,n),n)}return{value:t,source:n,stack:qt(n)}}var Jl=[],Wl=0,Io=null,fi=0,An=[],kn=0,Xa=null,ea=1,ta="";function ga(t,n){Jl[Wl++]=fi,Jl[Wl++]=Io,Io=t,fi=n}function Ip(t,n,l){An[kn++]=ea,An[kn++]=ta,An[kn++]=Xa,Xa=t;var i=ea;t=ta;var d=32-Vt(i)-1;i&=~(1<<d),l+=1;var f=32-Vt(n)+d;if(30<f){var y=d-d%5;f=(i&(1<<y)-1).toString(32),i>>=y,d-=y,ea=1<<32-Vt(n)+d|l<<d|i,ta=f+t}else ea=1<<f|l<<d|i,ta=t}function yd(t){t.return!==null&&(ga(t,1),Ip(t,1,0))}function bd(t){for(;t===Io;)Io=Jl[--Wl],Jl[Wl]=null,fi=Jl[--Wl],Jl[Wl]=null;for(;t===Xa;)Xa=An[--kn],An[kn]=null,ta=An[--kn],An[kn]=null,ea=An[--kn],An[kn]=null}function Qp(t,n){An[kn++]=ea,An[kn++]=ta,An[kn++]=Xa,ea=n.id,ta=n.overflow,Xa=t}var Lt=null,ot=null,qe=!1,Ja=null,zn=!1,xd=Error(s(519));function Wa(t){var n=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw mi(Cn(n,t)),xd}function Gp(t){var n=t.stateNode,l=t.type,i=t.memoizedProps;switch(n[Ut]=t,n[en]=i,l){case"dialog":Le("cancel",n),Le("close",n);break;case"iframe":case"object":case"embed":Le("load",n);break;case"video":case"audio":for(l=0;l<Di.length;l++)Le(Di[l],n);break;case"source":Le("error",n);break;case"img":case"image":case"link":Le("error",n),Le("load",n);break;case"details":Le("toggle",n);break;case"input":Le("invalid",n),rp(n,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":Le("invalid",n);break;case"textarea":Le("invalid",n),sp(n,i.value,i.defaultValue,i.children)}l=i.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||n.textContent===""+l||i.suppressHydrationWarning===!0||oy(n.textContent,l)?(i.popover!=null&&(Le("beforetoggle",n),Le("toggle",n)),i.onScroll!=null&&Le("scroll",n),i.onScrollEnd!=null&&Le("scrollend",n),i.onClick!=null&&(n.onclick=ma),n=!0):n=!1,n||Wa(t,!0)}function Pp(t){for(Lt=t.return;Lt;)switch(Lt.tag){case 5:case 31:case 13:zn=!1;return;case 27:case 3:zn=!0;return;default:Lt=Lt.return}}function es(t){if(t!==Lt)return!1;if(!qe)return Pp(t),qe=!0,!1;var n=t.tag,l;if((l=n!==3&&n!==27)&&((l=n===5)&&(l=t.type,l=!(l!=="form"&&l!=="button")||Bf(t.type,t.memoizedProps)),l=!l),l&&ot&&Wa(t),Pp(t),n===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));ot=vy(t)}else if(n===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));ot=vy(t)}else n===27?(n=ot,mr(t.type)?(t=Qf,Qf=null,ot=t):ot=n):ot=Lt?Rn(t.stateNode.nextSibling):null;return!0}function nl(){ot=Lt=null,qe=!1}function Sd(){var t=Ja;return t!==null&&(ln===null?ln=t:ln.push.apply(ln,t),Ja=null),t}function mi(t){Ja===null?Ja=[t]:Ja.push(t)}var jd=T(null),al=null,va=null;function er(t,n,l){V(jd,n._currentValue),n._currentValue=l}function ya(t){t._currentValue=jd.current,k(jd)}function wd(t,n,l){for(;t!==null;){var i=t.alternate;if((t.childLanes&n)!==n?(t.childLanes|=n,i!==null&&(i.childLanes|=n)):i!==null&&(i.childLanes&n)!==n&&(i.childLanes|=n),t===l)break;t=t.return}}function Nd(t,n,l,i){var d=t.child;for(d!==null&&(d.return=t);d!==null;){var f=d.dependencies;if(f!==null){var y=d.child;f=f.firstContext;e:for(;f!==null;){var S=f;f=d;for(var C=0;C<n.length;C++)if(S.context===n[C]){f.lanes|=l,S=f.alternate,S!==null&&(S.lanes|=l),wd(f.return,l,t),i||(y=null);break e}f=S.next}}else if(d.tag===18){if(y=d.return,y===null)throw Error(s(341));y.lanes|=l,f=y.alternate,f!==null&&(f.lanes|=l),wd(y,l,t),y=null}else y=d.child;if(y!==null)y.return=d;else for(y=d;y!==null;){if(y===t){y=null;break}if(d=y.sibling,d!==null){d.return=y.return,y=d;break}y=y.return}d=y}}function ts(t,n,l,i){t=null;for(var d=n,f=!1;d!==null;){if(!f){if((d.flags&524288)!==0)f=!0;else if((d.flags&262144)!==0)break}if(d.tag===10){var y=d.alternate;if(y===null)throw Error(s(387));if(y=y.memoizedProps,y!==null){var S=d.type;fn(d.pendingProps.value,y.value)||(t!==null?t.push(S):t=[S])}}else if(d===fe.current){if(y=d.alternate,y===null)throw Error(s(387));y.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(t!==null?t.push(Zi):t=[Zi])}d=d.return}t!==null&&Nd(n,t,l,i),n.flags|=262144}function Qo(t){for(t=t.firstContext;t!==null;){if(!fn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function rl(t){al=t,va=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function $t(t){return Vp(al,t)}function Go(t,n){return al===null&&rl(t),Vp(t,n)}function Vp(t,n){var l=n._currentValue;if(n={context:n,memoizedValue:l,next:null},va===null){if(t===null)throw Error(s(308));va=n,t.dependencies={lanes:0,firstContext:n},t.flags|=524288}else va=va.next=n;return l}var Ij=typeof AbortController<"u"?AbortController:function(){var t=[],n=this.signal={aborted:!1,addEventListener:function(l,i){t.push(i)}};this.abort=function(){n.aborted=!0,t.forEach(function(l){return l()})}},Qj=e.unstable_scheduleCallback,Gj=e.unstable_NormalPriority,wt={$$typeof:D,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ed(){return{controller:new Ij,data:new Map,refCount:0}}function hi(t){t.refCount--,t.refCount===0&&Qj(Gj,function(){t.controller.abort()})}var pi=null,_d=0,ns=0,as=null;function Pj(t,n){if(pi===null){var l=pi=[];_d=0,ns=zf(),as={status:"pending",value:void 0,then:function(i){l.push(i)}}}return _d++,n.then(Kp,Kp),n}function Kp(){if(--_d===0&&pi!==null){as!==null&&(as.status="fulfilled");var t=pi;pi=null,ns=0,as=null;for(var n=0;n<t.length;n++)(0,t[n])()}}function Vj(t,n){var l=[],i={status:"pending",value:null,reason:null,then:function(d){l.push(d)}};return t.then(function(){i.status="fulfilled",i.value=n;for(var d=0;d<l.length;d++)(0,l[d])(n)},function(d){for(i.status="rejected",i.reason=d,d=0;d<l.length;d++)(0,l[d])(void 0)}),i}var Yp=Q.S;Q.S=function(t,n){Rv=Gt(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&Pj(t,n),Yp!==null&&Yp(t,n)};var ll=T(null);function Cd(){var t=ll.current;return t!==null?t:rt.pooledCache}function Po(t,n){n===null?V(ll,ll.current):V(ll,n.pool)}function Fp(){var t=Cd();return t===null?null:{parent:wt._currentValue,pool:t}}var rs=Error(s(460)),Ad=Error(s(474)),Vo=Error(s(542)),Ko={then:function(){}};function Xp(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Jp(t,n,l){switch(l=t[l],l===void 0?t.push(n):l!==n&&(n.then(ma,ma),n=l),n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,eg(t),t;default:if(typeof n.status=="string")n.then(ma,ma);else{if(t=rt,t!==null&&100<t.shellSuspendCounter)throw Error(s(482));t=n,t.status="pending",t.then(function(i){if(n.status==="pending"){var d=n;d.status="fulfilled",d.value=i}},function(i){if(n.status==="pending"){var d=n;d.status="rejected",d.reason=i}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,eg(t),t}throw il=n,rs}}function sl(t){try{var n=t._init;return n(t._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(il=l,rs):l}}var il=null;function Wp(){if(il===null)throw Error(s(459));var t=il;return il=null,t}function eg(t){if(t===rs||t===Vo)throw Error(s(483))}var ls=null,gi=0;function Yo(t){var n=gi;return gi+=1,ls===null&&(ls=[]),Jp(ls,t,n)}function vi(t,n){n=n.props.ref,t.ref=n!==void 0?n:null}function Fo(t,n){throw n.$$typeof===j?Error(s(525)):(t=Object.prototype.toString.call(n),Error(s(31,t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t)))}function tg(t){function n(U,R){if(t){var $=U.deletions;$===null?(U.deletions=[R],U.flags|=16):$.push(R)}}function l(U,R){if(!t)return null;for(;R!==null;)n(U,R),R=R.sibling;return null}function i(U){for(var R=new Map;U!==null;)U.key!==null?R.set(U.key,U):R.set(U.index,U),U=U.sibling;return R}function d(U,R){return U=pa(U,R),U.index=0,U.sibling=null,U}function f(U,R,$){return U.index=$,t?($=U.alternate,$!==null?($=$.index,$<R?(U.flags|=67108866,R):$):(U.flags|=67108866,R)):(U.flags|=1048576,R)}function y(U){return t&&U.alternate===null&&(U.flags|=67108866),U}function S(U,R,$,X){return R===null||R.tag!==6?(R=gd($,U.mode,X),R.return=U,R):(R=d(R,$),R.return=U,R)}function C(U,R,$,X){var be=$.type;return be===w?Y(U,R,$.props.children,X,$.key):R!==null&&(R.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===K&&sl(be)===R.type)?(R=d(R,$.props),vi(R,$),R.return=U,R):(R=Ho($.type,$.key,$.props,null,U.mode,X),vi(R,$),R.return=U,R)}function B(U,R,$,X){return R===null||R.tag!==4||R.stateNode.containerInfo!==$.containerInfo||R.stateNode.implementation!==$.implementation?(R=vd($,U.mode,X),R.return=U,R):(R=d(R,$.children||[]),R.return=U,R)}function Y(U,R,$,X,be){return R===null||R.tag!==7?(R=tl($,U.mode,X,be),R.return=U,R):(R=d(R,$),R.return=U,R)}function J(U,R,$){if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return R=gd(""+R,U.mode,$),R.return=U,R;if(typeof R=="object"&&R!==null){switch(R.$$typeof){case N:return $=Ho(R.type,R.key,R.props,null,U.mode,$),vi($,R),$.return=U,$;case z:return R=vd(R,U.mode,$),R.return=U,R;case K:return R=sl(R),J(U,R,$)}if(we(R)||re(R))return R=tl(R,U.mode,$,null),R.return=U,R;if(typeof R.then=="function")return J(U,Yo(R),$);if(R.$$typeof===D)return J(U,Go(U,R),$);Fo(U,R)}return null}function q(U,R,$,X){var be=R!==null?R.key:null;if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return be!==null?null:S(U,R,""+$,X);if(typeof $=="object"&&$!==null){switch($.$$typeof){case N:return $.key===be?C(U,R,$,X):null;case z:return $.key===be?B(U,R,$,X):null;case K:return $=sl($),q(U,R,$,X)}if(we($)||re($))return be!==null?null:Y(U,R,$,X,null);if(typeof $.then=="function")return q(U,R,Yo($),X);if($.$$typeof===D)return q(U,R,Go(U,$),X);Fo(U,$)}return null}function G(U,R,$,X,be){if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return U=U.get($)||null,S(R,U,""+X,be);if(typeof X=="object"&&X!==null){switch(X.$$typeof){case N:return U=U.get(X.key===null?$:X.key)||null,C(R,U,X,be);case z:return U=U.get(X.key===null?$:X.key)||null,B(R,U,X,be);case K:return X=sl(X),G(U,R,$,X,be)}if(we(X)||re(X))return U=U.get($)||null,Y(R,U,X,be,null);if(typeof X.then=="function")return G(U,R,$,Yo(X),be);if(X.$$typeof===D)return G(U,R,$,Go(R,X),be);Fo(R,X)}return null}function oe(U,R,$,X){for(var be=null,Ge=null,me=R,Re=R=0,Ze=null;me!==null&&Re<$.length;Re++){me.index>Re?(Ze=me,me=null):Ze=me.sibling;var Pe=q(U,me,$[Re],X);if(Pe===null){me===null&&(me=Ze);break}t&&me&&Pe.alternate===null&&n(U,me),R=f(Pe,R,Re),Ge===null?be=Pe:Ge.sibling=Pe,Ge=Pe,me=Ze}if(Re===$.length)return l(U,me),qe&&ga(U,Re),be;if(me===null){for(;Re<$.length;Re++)me=J(U,$[Re],X),me!==null&&(R=f(me,R,Re),Ge===null?be=me:Ge.sibling=me,Ge=me);return qe&&ga(U,Re),be}for(me=i(me);Re<$.length;Re++)Ze=G(me,U,Re,$[Re],X),Ze!==null&&(t&&Ze.alternate!==null&&me.delete(Ze.key===null?Re:Ze.key),R=f(Ze,R,Re),Ge===null?be=Ze:Ge.sibling=Ze,Ge=Ze);return t&&me.forEach(function(yr){return n(U,yr)}),qe&&ga(U,Re),be}function Ee(U,R,$,X){if($==null)throw Error(s(151));for(var be=null,Ge=null,me=R,Re=R=0,Ze=null,Pe=$.next();me!==null&&!Pe.done;Re++,Pe=$.next()){me.index>Re?(Ze=me,me=null):Ze=me.sibling;var yr=q(U,me,Pe.value,X);if(yr===null){me===null&&(me=Ze);break}t&&me&&yr.alternate===null&&n(U,me),R=f(yr,R,Re),Ge===null?be=yr:Ge.sibling=yr,Ge=yr,me=Ze}if(Pe.done)return l(U,me),qe&&ga(U,Re),be;if(me===null){for(;!Pe.done;Re++,Pe=$.next())Pe=J(U,Pe.value,X),Pe!==null&&(R=f(Pe,R,Re),Ge===null?be=Pe:Ge.sibling=Pe,Ge=Pe);return qe&&ga(U,Re),be}for(me=i(me);!Pe.done;Re++,Pe=$.next())Pe=G(me,U,Re,Pe.value,X),Pe!==null&&(t&&Pe.alternate!==null&&me.delete(Pe.key===null?Re:Pe.key),R=f(Pe,R,Re),Ge===null?be=Pe:Ge.sibling=Pe,Ge=Pe);return t&&me.forEach(function(rN){return n(U,rN)}),qe&&ga(U,Re),be}function at(U,R,$,X){if(typeof $=="object"&&$!==null&&$.type===w&&$.key===null&&($=$.props.children),typeof $=="object"&&$!==null){switch($.$$typeof){case N:e:{for(var be=$.key;R!==null;){if(R.key===be){if(be=$.type,be===w){if(R.tag===7){l(U,R.sibling),X=d(R,$.props.children),X.return=U,U=X;break e}}else if(R.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===K&&sl(be)===R.type){l(U,R.sibling),X=d(R,$.props),vi(X,$),X.return=U,U=X;break e}l(U,R);break}else n(U,R);R=R.sibling}$.type===w?(X=tl($.props.children,U.mode,X,$.key),X.return=U,U=X):(X=Ho($.type,$.key,$.props,null,U.mode,X),vi(X,$),X.return=U,U=X)}return y(U);case z:e:{for(be=$.key;R!==null;){if(R.key===be)if(R.tag===4&&R.stateNode.containerInfo===$.containerInfo&&R.stateNode.implementation===$.implementation){l(U,R.sibling),X=d(R,$.children||[]),X.return=U,U=X;break e}else{l(U,R);break}else n(U,R);R=R.sibling}X=vd($,U.mode,X),X.return=U,U=X}return y(U);case K:return $=sl($),at(U,R,$,X)}if(we($))return oe(U,R,$,X);if(re($)){if(be=re($),typeof be!="function")throw Error(s(150));return $=be.call($),Ee(U,R,$,X)}if(typeof $.then=="function")return at(U,R,Yo($),X);if($.$$typeof===D)return at(U,R,Go(U,$),X);Fo(U,$)}return typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint"?($=""+$,R!==null&&R.tag===6?(l(U,R.sibling),X=d(R,$),X.return=U,U=X):(l(U,R),X=gd($,U.mode,X),X.return=U,U=X),y(U)):l(U,R)}return function(U,R,$,X){try{gi=0;var be=at(U,R,$,X);return ls=null,be}catch(me){if(me===rs||me===Vo)throw me;var Ge=mn(29,me,null,U.mode);return Ge.lanes=X,Ge.return=U,Ge}finally{}}}var ol=tg(!0),ng=tg(!1),tr=!1;function kd(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function zd(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function nr(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function ar(t,n,l){var i=t.updateQueue;if(i===null)return null;if(i=i.shared,(Ke&2)!==0){var d=i.pending;return d===null?n.next=n:(n.next=d.next,d.next=n),i.pending=n,n=qo(t),Bp(t,null,l),n}return Zo(t,i,n,l),qo(t)}function yi(t,n,l){if(n=n.updateQueue,n!==null&&(n=n.shared,(l&4194048)!==0)){var i=n.lanes;i&=t.pendingLanes,l|=i,n.lanes=l,Vh(t,l)}}function Td(t,n){var l=t.updateQueue,i=t.alternate;if(i!==null&&(i=i.updateQueue,l===i)){var d=null,f=null;if(l=l.firstBaseUpdate,l!==null){do{var y={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};f===null?d=f=y:f=f.next=y,l=l.next}while(l!==null);f===null?d=f=n:f=f.next=n}else d=f=n;l={baseState:i.baseState,firstBaseUpdate:d,lastBaseUpdate:f,shared:i.shared,callbacks:i.callbacks},t.updateQueue=l;return}t=l.lastBaseUpdate,t===null?l.firstBaseUpdate=n:t.next=n,l.lastBaseUpdate=n}var Rd=!1;function bi(){if(Rd){var t=as;if(t!==null)throw t}}function xi(t,n,l,i){Rd=!1;var d=t.updateQueue;tr=!1;var f=d.firstBaseUpdate,y=d.lastBaseUpdate,S=d.shared.pending;if(S!==null){d.shared.pending=null;var C=S,B=C.next;C.next=null,y===null?f=B:y.next=B,y=C;var Y=t.alternate;Y!==null&&(Y=Y.updateQueue,S=Y.lastBaseUpdate,S!==y&&(S===null?Y.firstBaseUpdate=B:S.next=B,Y.lastBaseUpdate=C))}if(f!==null){var J=d.baseState;y=0,Y=B=C=null,S=f;do{var q=S.lane&-536870913,G=q!==S.lane;if(G?(Be&q)===q:(i&q)===q){q!==0&&q===ns&&(Rd=!0),Y!==null&&(Y=Y.next={lane:0,tag:S.tag,payload:S.payload,callback:null,next:null});e:{var oe=t,Ee=S;q=n;var at=l;switch(Ee.tag){case 1:if(oe=Ee.payload,typeof oe=="function"){J=oe.call(at,J,q);break e}J=oe;break e;case 3:oe.flags=oe.flags&-65537|128;case 0:if(oe=Ee.payload,q=typeof oe=="function"?oe.call(at,J,q):oe,q==null)break e;J=x({},J,q);break e;case 2:tr=!0}}q=S.callback,q!==null&&(t.flags|=64,G&&(t.flags|=8192),G=d.callbacks,G===null?d.callbacks=[q]:G.push(q))}else G={lane:q,tag:S.tag,payload:S.payload,callback:S.callback,next:null},Y===null?(B=Y=G,C=J):Y=Y.next=G,y|=q;if(S=S.next,S===null){if(S=d.shared.pending,S===null)break;G=S,S=G.next,G.next=null,d.lastBaseUpdate=G,d.shared.pending=null}}while(!0);Y===null&&(C=J),d.baseState=C,d.firstBaseUpdate=B,d.lastBaseUpdate=Y,f===null&&(d.shared.lanes=0),or|=y,t.lanes=y,t.memoizedState=J}}function ag(t,n){if(typeof t!="function")throw Error(s(191,t));t.call(n)}function rg(t,n){var l=t.callbacks;if(l!==null)for(t.callbacks=null,t=0;t<l.length;t++)ag(l[t],n)}var ss=T(null),Xo=T(0);function lg(t,n){t=Ca,V(Xo,t),V(ss,n),Ca=t|n.baseLanes}function Od(){V(Xo,Ca),V(ss,ss.current)}function Md(){Ca=Xo.current,k(ss),k(Xo)}var hn=T(null),Tn=null;function rr(t){var n=t.alternate;V(St,St.current&1),V(hn,t),Tn===null&&(n===null||ss.current!==null||n.memoizedState!==null)&&(Tn=t)}function Dd(t){V(St,St.current),V(hn,t),Tn===null&&(Tn=t)}function sg(t){t.tag===22?(V(St,St.current),V(hn,t),Tn===null&&(Tn=t)):lr()}function lr(){V(St,St.current),V(hn,hn.current)}function pn(t){k(hn),Tn===t&&(Tn=null),k(St)}var St=T(0);function Jo(t){for(var n=t;n!==null;){if(n.tag===13){var l=n.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Hf(l)||If(l)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var ba=0,ze=null,tt=null,Nt=null,Wo=!1,is=!1,ul=!1,eu=0,Si=0,os=null,Kj=0;function vt(){throw Error(s(321))}function Ud(t,n){if(n===null)return!1;for(var l=0;l<n.length&&l<t.length;l++)if(!fn(t[l],n[l]))return!1;return!0}function Ld(t,n,l,i,d,f){return ba=f,ze=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,Q.H=t===null||t.memoizedState===null?Ig:Jd,ul=!1,f=l(i,d),ul=!1,is&&(f=og(n,l,i,d)),ig(t),f}function ig(t){Q.H=Ni;var n=tt!==null&&tt.next!==null;if(ba=0,Nt=tt=ze=null,Wo=!1,Si=0,os=null,n)throw Error(s(300));t===null||Et||(t=t.dependencies,t!==null&&Qo(t)&&(Et=!0))}function og(t,n,l,i){ze=t;var d=0;do{if(is&&(os=null),Si=0,is=!1,25<=d)throw Error(s(301));if(d+=1,Nt=tt=null,t.updateQueue!=null){var f=t.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}Q.H=Qg,f=n(l,i)}while(is);return f}function Yj(){var t=Q.H,n=t.useState()[0];return n=typeof n.then=="function"?ji(n):n,t=t.useState()[0],(tt!==null?tt.memoizedState:null)!==t&&(ze.flags|=1024),n}function $d(){var t=eu!==0;return eu=0,t}function Bd(t,n,l){n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~l}function Zd(t){if(Wo){for(t=t.memoizedState;t!==null;){var n=t.queue;n!==null&&(n.pending=null),t=t.next}Wo=!1}ba=0,Nt=tt=ze=null,is=!1,Si=eu=0,os=null}function Yt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Nt===null?ze.memoizedState=Nt=t:Nt=Nt.next=t,Nt}function jt(){if(tt===null){var t=ze.alternate;t=t!==null?t.memoizedState:null}else t=tt.next;var n=Nt===null?ze.memoizedState:Nt.next;if(n!==null)Nt=n,tt=t;else{if(t===null)throw ze.alternate===null?Error(s(467)):Error(s(310));tt=t,t={memoizedState:tt.memoizedState,baseState:tt.baseState,baseQueue:tt.baseQueue,queue:tt.queue,next:null},Nt===null?ze.memoizedState=Nt=t:Nt=Nt.next=t}return Nt}function tu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ji(t){var n=Si;return Si+=1,os===null&&(os=[]),t=Jp(os,t,n),n=ze,(Nt===null?n.memoizedState:Nt.next)===null&&(n=n.alternate,Q.H=n===null||n.memoizedState===null?Ig:Jd),t}function nu(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return ji(t);if(t.$$typeof===D)return $t(t)}throw Error(s(438,String(t)))}function qd(t){var n=null,l=ze.updateQueue;if(l!==null&&(n=l.memoCache),n==null){var i=ze.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(n={data:i.data.map(function(d){return d.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),l===null&&(l=tu(),ze.updateQueue=l),l.memoCache=n,l=n.data[n.index],l===void 0)for(l=n.data[n.index]=Array(t),i=0;i<t;i++)l[i]=Se;return n.index++,l}function xa(t,n){return typeof n=="function"?n(t):n}function au(t){var n=jt();return Hd(n,tt,t)}function Hd(t,n,l){var i=t.queue;if(i===null)throw Error(s(311));i.lastRenderedReducer=l;var d=t.baseQueue,f=i.pending;if(f!==null){if(d!==null){var y=d.next;d.next=f.next,f.next=y}n.baseQueue=d=f,i.pending=null}if(f=t.baseState,d===null)t.memoizedState=f;else{n=d.next;var S=y=null,C=null,B=n,Y=!1;do{var J=B.lane&-536870913;if(J!==B.lane?(Be&J)===J:(ba&J)===J){var q=B.revertLane;if(q===0)C!==null&&(C=C.next={lane:0,revertLane:0,gesture:null,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null}),J===ns&&(Y=!0);else if((ba&q)===q){B=B.next,q===ns&&(Y=!0);continue}else J={lane:0,revertLane:B.revertLane,gesture:null,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null},C===null?(S=C=J,y=f):C=C.next=J,ze.lanes|=q,or|=q;J=B.action,ul&&l(f,J),f=B.hasEagerState?B.eagerState:l(f,J)}else q={lane:J,revertLane:B.revertLane,gesture:B.gesture,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null},C===null?(S=C=q,y=f):C=C.next=q,ze.lanes|=J,or|=J;B=B.next}while(B!==null&&B!==n);if(C===null?y=f:C.next=S,!fn(f,t.memoizedState)&&(Et=!0,Y&&(l=as,l!==null)))throw l;t.memoizedState=f,t.baseState=y,t.baseQueue=C,i.lastRenderedState=f}return d===null&&(i.lanes=0),[t.memoizedState,i.dispatch]}function Id(t){var n=jt(),l=n.queue;if(l===null)throw Error(s(311));l.lastRenderedReducer=t;var i=l.dispatch,d=l.pending,f=n.memoizedState;if(d!==null){l.pending=null;var y=d=d.next;do f=t(f,y.action),y=y.next;while(y!==d);fn(f,n.memoizedState)||(Et=!0),n.memoizedState=f,n.baseQueue===null&&(n.baseState=f),l.lastRenderedState=f}return[f,i]}function ug(t,n,l){var i=ze,d=jt(),f=qe;if(f){if(l===void 0)throw Error(s(407));l=l()}else l=n();var y=!fn((tt||d).memoizedState,l);if(y&&(d.memoizedState=l,Et=!0),d=d.queue,Pd(fg.bind(null,i,d,t),[t]),d.getSnapshot!==n||y||Nt!==null&&Nt.memoizedState.tag&1){if(i.flags|=2048,us(9,{destroy:void 0},dg.bind(null,i,d,l,n),null),rt===null)throw Error(s(349));f||(ba&127)!==0||cg(i,n,l)}return l}function cg(t,n,l){t.flags|=16384,t={getSnapshot:n,value:l},n=ze.updateQueue,n===null?(n=tu(),ze.updateQueue=n,n.stores=[t]):(l=n.stores,l===null?n.stores=[t]:l.push(t))}function dg(t,n,l,i){n.value=l,n.getSnapshot=i,mg(n)&&hg(t)}function fg(t,n,l){return l(function(){mg(n)&&hg(t)})}function mg(t){var n=t.getSnapshot;t=t.value;try{var l=n();return!fn(t,l)}catch{return!0}}function hg(t){var n=el(t,2);n!==null&&sn(n,t,2)}function Qd(t){var n=Yt();if(typeof t=="function"){var l=t;if(t=l(),ul){Jn(!0);try{l()}finally{Jn(!1)}}}return n.memoizedState=n.baseState=t,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xa,lastRenderedState:t},n}function pg(t,n,l,i){return t.baseState=l,Hd(t,tt,typeof i=="function"?i:xa)}function Fj(t,n,l,i,d){if(su(t))throw Error(s(485));if(t=n.action,t!==null){var f={payload:d,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(y){f.listeners.push(y)}};Q.T!==null?l(!0):f.isTransition=!1,i(f),l=n.pending,l===null?(f.next=n.pending=f,gg(n,f)):(f.next=l.next,n.pending=l.next=f)}}function gg(t,n){var l=n.action,i=n.payload,d=t.state;if(n.isTransition){var f=Q.T,y={};Q.T=y;try{var S=l(d,i),C=Q.S;C!==null&&C(y,S),vg(t,n,S)}catch(B){Gd(t,n,B)}finally{f!==null&&y.types!==null&&(f.types=y.types),Q.T=f}}else try{f=l(d,i),vg(t,n,f)}catch(B){Gd(t,n,B)}}function vg(t,n,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(i){yg(t,n,i)},function(i){return Gd(t,n,i)}):yg(t,n,l)}function yg(t,n,l){n.status="fulfilled",n.value=l,bg(n),t.state=l,n=t.pending,n!==null&&(l=n.next,l===n?t.pending=null:(l=l.next,n.next=l,gg(t,l)))}function Gd(t,n,l){var i=t.pending;if(t.pending=null,i!==null){i=i.next;do n.status="rejected",n.reason=l,bg(n),n=n.next;while(n!==i)}t.action=null}function bg(t){t=t.listeners;for(var n=0;n<t.length;n++)(0,t[n])()}function xg(t,n){return n}function Sg(t,n){if(qe){var l=rt.formState;if(l!==null){e:{var i=ze;if(qe){if(ot){t:{for(var d=ot,f=zn;d.nodeType!==8;){if(!f){d=null;break t}if(d=Rn(d.nextSibling),d===null){d=null;break t}}f=d.data,d=f==="F!"||f==="F"?d:null}if(d){ot=Rn(d.nextSibling),i=d.data==="F!";break e}}Wa(i)}i=!1}i&&(n=l[0])}}return l=Yt(),l.memoizedState=l.baseState=n,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xg,lastRenderedState:n},l.queue=i,l=Zg.bind(null,ze,i),i.dispatch=l,i=Qd(!1),f=Xd.bind(null,ze,!1,i.queue),i=Yt(),d={state:n,dispatch:null,action:t,pending:null},i.queue=d,l=Fj.bind(null,ze,d,f,l),d.dispatch=l,i.memoizedState=t,[n,l,!1]}function jg(t){var n=jt();return wg(n,tt,t)}function wg(t,n,l){if(n=Hd(t,n,xg)[0],t=au(xa)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var i=ji(n)}catch(y){throw y===rs?Vo:y}else i=n;n=jt();var d=n.queue,f=d.dispatch;return l!==n.memoizedState&&(ze.flags|=2048,us(9,{destroy:void 0},Xj.bind(null,d,l),null)),[i,f,t]}function Xj(t,n){t.action=n}function Ng(t){var n=jt(),l=tt;if(l!==null)return wg(n,l,t);jt(),n=n.memoizedState,l=jt();var i=l.queue.dispatch;return l.memoizedState=t,[n,i,!1]}function us(t,n,l,i){return t={tag:t,create:l,deps:i,inst:n,next:null},n=ze.updateQueue,n===null&&(n=tu(),ze.updateQueue=n),l=n.lastEffect,l===null?n.lastEffect=t.next=t:(i=l.next,l.next=t,t.next=i,n.lastEffect=t),t}function Eg(){return jt().memoizedState}function ru(t,n,l,i){var d=Yt();ze.flags|=t,d.memoizedState=us(1|n,{destroy:void 0},l,i===void 0?null:i)}function lu(t,n,l,i){var d=jt();i=i===void 0?null:i;var f=d.memoizedState.inst;tt!==null&&i!==null&&Ud(i,tt.memoizedState.deps)?d.memoizedState=us(n,f,l,i):(ze.flags|=t,d.memoizedState=us(1|n,f,l,i))}function _g(t,n){ru(8390656,8,t,n)}function Pd(t,n){lu(2048,8,t,n)}function Jj(t){ze.flags|=4;var n=ze.updateQueue;if(n===null)n=tu(),ze.updateQueue=n,n.events=[t];else{var l=n.events;l===null?n.events=[t]:l.push(t)}}function Cg(t){var n=jt().memoizedState;return Jj({ref:n,nextImpl:t}),function(){if((Ke&2)!==0)throw Error(s(440));return n.impl.apply(void 0,arguments)}}function Ag(t,n){return lu(4,2,t,n)}function kg(t,n){return lu(4,4,t,n)}function zg(t,n){if(typeof n=="function"){t=t();var l=n(t);return function(){typeof l=="function"?l():n(null)}}if(n!=null)return t=t(),n.current=t,function(){n.current=null}}function Tg(t,n,l){l=l!=null?l.concat([t]):null,lu(4,4,zg.bind(null,n,t),l)}function Vd(){}function Rg(t,n){var l=jt();n=n===void 0?null:n;var i=l.memoizedState;return n!==null&&Ud(n,i[1])?i[0]:(l.memoizedState=[t,n],t)}function Og(t,n){var l=jt();n=n===void 0?null:n;var i=l.memoizedState;if(n!==null&&Ud(n,i[1]))return i[0];if(i=t(),ul){Jn(!0);try{t()}finally{Jn(!1)}}return l.memoizedState=[i,n],i}function Kd(t,n,l){return l===void 0||(ba&1073741824)!==0&&(Be&261930)===0?t.memoizedState=n:(t.memoizedState=l,t=Mv(),ze.lanes|=t,or|=t,l)}function Mg(t,n,l,i){return fn(l,n)?l:ss.current!==null?(t=Kd(t,l,i),fn(t,n)||(Et=!0),t):(ba&42)===0||(ba&1073741824)!==0&&(Be&261930)===0?(Et=!0,t.memoizedState=l):(t=Mv(),ze.lanes|=t,or|=t,n)}function Dg(t,n,l,i,d){var f=te.p;te.p=f!==0&&8>f?f:8;var y=Q.T,S={};Q.T=S,Xd(t,!1,n,l);try{var C=d(),B=Q.S;if(B!==null&&B(S,C),C!==null&&typeof C=="object"&&typeof C.then=="function"){var Y=Vj(C,i);wi(t,n,Y,yn(t))}else wi(t,n,i,yn(t))}catch(J){wi(t,n,{then:function(){},status:"rejected",reason:J},yn())}finally{te.p=f,y!==null&&S.types!==null&&(y.types=S.types),Q.T=y}}function Wj(){}function Yd(t,n,l,i){if(t.tag!==5)throw Error(s(476));var d=Ug(t).queue;Dg(t,d,n,ce,l===null?Wj:function(){return Lg(t),l(i)})}function Ug(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:ce,baseState:ce,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xa,lastRenderedState:ce},next:null};var l={};return n.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xa,lastRenderedState:l},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function Lg(t){var n=Ug(t);n.next===null&&(n=t.alternate.memoizedState),wi(t,n.next.queue,{},yn())}function Fd(){return $t(Zi)}function $g(){return jt().memoizedState}function Bg(){return jt().memoizedState}function ew(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var l=yn();t=nr(l);var i=ar(n,t,l);i!==null&&(sn(i,n,l),yi(i,n,l)),n={cache:Ed()},t.payload=n;return}n=n.return}}function tw(t,n,l){var i=yn();l={lane:i,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},su(t)?qg(n,l):(l=hd(t,n,l,i),l!==null&&(sn(l,t,i),Hg(l,n,i)))}function Zg(t,n,l){var i=yn();wi(t,n,l,i)}function wi(t,n,l,i){var d={lane:i,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(su(t))qg(n,d);else{var f=t.alternate;if(t.lanes===0&&(f===null||f.lanes===0)&&(f=n.lastRenderedReducer,f!==null))try{var y=n.lastRenderedState,S=f(y,l);if(d.hasEagerState=!0,d.eagerState=S,fn(S,y))return Zo(t,n,d,0),rt===null&&Bo(),!1}catch{}finally{}if(l=hd(t,n,d,i),l!==null)return sn(l,t,i),Hg(l,n,i),!0}return!1}function Xd(t,n,l,i){if(i={lane:2,revertLane:zf(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},su(t)){if(n)throw Error(s(479))}else n=hd(t,l,i,2),n!==null&&sn(n,t,2)}function su(t){var n=t.alternate;return t===ze||n!==null&&n===ze}function qg(t,n){is=Wo=!0;var l=t.pending;l===null?n.next=n:(n.next=l.next,l.next=n),t.pending=n}function Hg(t,n,l){if((l&4194048)!==0){var i=n.lanes;i&=t.pendingLanes,l|=i,n.lanes=l,Vh(t,l)}}var Ni={readContext:$t,use:nu,useCallback:vt,useContext:vt,useEffect:vt,useImperativeHandle:vt,useLayoutEffect:vt,useInsertionEffect:vt,useMemo:vt,useReducer:vt,useRef:vt,useState:vt,useDebugValue:vt,useDeferredValue:vt,useTransition:vt,useSyncExternalStore:vt,useId:vt,useHostTransitionStatus:vt,useFormState:vt,useActionState:vt,useOptimistic:vt,useMemoCache:vt,useCacheRefresh:vt};Ni.useEffectEvent=vt;var Ig={readContext:$t,use:nu,useCallback:function(t,n){return Yt().memoizedState=[t,n===void 0?null:n],t},useContext:$t,useEffect:_g,useImperativeHandle:function(t,n,l){l=l!=null?l.concat([t]):null,ru(4194308,4,zg.bind(null,n,t),l)},useLayoutEffect:function(t,n){return ru(4194308,4,t,n)},useInsertionEffect:function(t,n){ru(4,2,t,n)},useMemo:function(t,n){var l=Yt();n=n===void 0?null:n;var i=t();if(ul){Jn(!0);try{t()}finally{Jn(!1)}}return l.memoizedState=[i,n],i},useReducer:function(t,n,l){var i=Yt();if(l!==void 0){var d=l(n);if(ul){Jn(!0);try{l(n)}finally{Jn(!1)}}}else d=n;return i.memoizedState=i.baseState=d,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:d},i.queue=t,t=t.dispatch=tw.bind(null,ze,t),[i.memoizedState,t]},useRef:function(t){var n=Yt();return t={current:t},n.memoizedState=t},useState:function(t){t=Qd(t);var n=t.queue,l=Zg.bind(null,ze,n);return n.dispatch=l,[t.memoizedState,l]},useDebugValue:Vd,useDeferredValue:function(t,n){var l=Yt();return Kd(l,t,n)},useTransition:function(){var t=Qd(!1);return t=Dg.bind(null,ze,t.queue,!0,!1),Yt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,l){var i=ze,d=Yt();if(qe){if(l===void 0)throw Error(s(407));l=l()}else{if(l=n(),rt===null)throw Error(s(349));(Be&127)!==0||cg(i,n,l)}d.memoizedState=l;var f={value:l,getSnapshot:n};return d.queue=f,_g(fg.bind(null,i,f,t),[t]),i.flags|=2048,us(9,{destroy:void 0},dg.bind(null,i,f,l,n),null),l},useId:function(){var t=Yt(),n=rt.identifierPrefix;if(qe){var l=ta,i=ea;l=(i&~(1<<32-Vt(i)-1)).toString(32)+l,n="_"+n+"R_"+l,l=eu++,0<l&&(n+="H"+l.toString(32)),n+="_"}else l=Kj++,n="_"+n+"r_"+l.toString(32)+"_";return t.memoizedState=n},useHostTransitionStatus:Fd,useFormState:Sg,useActionState:Sg,useOptimistic:function(t){var n=Yt();n.memoizedState=n.baseState=t;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=l,n=Xd.bind(null,ze,!0,l),l.dispatch=n,[t,n]},useMemoCache:qd,useCacheRefresh:function(){return Yt().memoizedState=ew.bind(null,ze)},useEffectEvent:function(t){var n=Yt(),l={impl:t};return n.memoizedState=l,function(){if((Ke&2)!==0)throw Error(s(440));return l.impl.apply(void 0,arguments)}}},Jd={readContext:$t,use:nu,useCallback:Rg,useContext:$t,useEffect:Pd,useImperativeHandle:Tg,useInsertionEffect:Ag,useLayoutEffect:kg,useMemo:Og,useReducer:au,useRef:Eg,useState:function(){return au(xa)},useDebugValue:Vd,useDeferredValue:function(t,n){var l=jt();return Mg(l,tt.memoizedState,t,n)},useTransition:function(){var t=au(xa)[0],n=jt().memoizedState;return[typeof t=="boolean"?t:ji(t),n]},useSyncExternalStore:ug,useId:$g,useHostTransitionStatus:Fd,useFormState:jg,useActionState:jg,useOptimistic:function(t,n){var l=jt();return pg(l,tt,t,n)},useMemoCache:qd,useCacheRefresh:Bg};Jd.useEffectEvent=Cg;var Qg={readContext:$t,use:nu,useCallback:Rg,useContext:$t,useEffect:Pd,useImperativeHandle:Tg,useInsertionEffect:Ag,useLayoutEffect:kg,useMemo:Og,useReducer:Id,useRef:Eg,useState:function(){return Id(xa)},useDebugValue:Vd,useDeferredValue:function(t,n){var l=jt();return tt===null?Kd(l,t,n):Mg(l,tt.memoizedState,t,n)},useTransition:function(){var t=Id(xa)[0],n=jt().memoizedState;return[typeof t=="boolean"?t:ji(t),n]},useSyncExternalStore:ug,useId:$g,useHostTransitionStatus:Fd,useFormState:Ng,useActionState:Ng,useOptimistic:function(t,n){var l=jt();return tt!==null?pg(l,tt,t,n):(l.baseState=t,[t,l.queue.dispatch])},useMemoCache:qd,useCacheRefresh:Bg};Qg.useEffectEvent=Cg;function Wd(t,n,l,i){n=t.memoizedState,l=l(i,n),l=l==null?n:x({},n,l),t.memoizedState=l,t.lanes===0&&(t.updateQueue.baseState=l)}var ef={enqueueSetState:function(t,n,l){t=t._reactInternals;var i=yn(),d=nr(i);d.payload=n,l!=null&&(d.callback=l),n=ar(t,d,i),n!==null&&(sn(n,t,i),yi(n,t,i))},enqueueReplaceState:function(t,n,l){t=t._reactInternals;var i=yn(),d=nr(i);d.tag=1,d.payload=n,l!=null&&(d.callback=l),n=ar(t,d,i),n!==null&&(sn(n,t,i),yi(n,t,i))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var l=yn(),i=nr(l);i.tag=2,n!=null&&(i.callback=n),n=ar(t,i,l),n!==null&&(sn(n,t,l),yi(n,t,l))}};function Gg(t,n,l,i,d,f,y){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(i,f,y):n.prototype&&n.prototype.isPureReactComponent?!ci(l,i)||!ci(d,f):!0}function Pg(t,n,l,i){t=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(l,i),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(l,i),n.state!==t&&ef.enqueueReplaceState(n,n.state,null)}function cl(t,n){var l=n;if("ref"in n){l={};for(var i in n)i!=="ref"&&(l[i]=n[i])}if(t=t.defaultProps){l===n&&(l=x({},l));for(var d in t)l[d]===void 0&&(l[d]=t[d])}return l}function Vg(t){$o(t)}function Kg(t){console.error(t)}function Yg(t){$o(t)}function iu(t,n){try{var l=t.onUncaughtError;l(n.value,{componentStack:n.stack})}catch(i){setTimeout(function(){throw i})}}function Fg(t,n,l){try{var i=t.onCaughtError;i(l.value,{componentStack:l.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function tf(t,n,l){return l=nr(l),l.tag=3,l.payload={element:null},l.callback=function(){iu(t,n)},l}function Xg(t){return t=nr(t),t.tag=3,t}function Jg(t,n,l,i){var d=l.type.getDerivedStateFromError;if(typeof d=="function"){var f=i.value;t.payload=function(){return d(f)},t.callback=function(){Fg(n,l,i)}}var y=l.stateNode;y!==null&&typeof y.componentDidCatch=="function"&&(t.callback=function(){Fg(n,l,i),typeof d!="function"&&(ur===null?ur=new Set([this]):ur.add(this));var S=i.stack;this.componentDidCatch(i.value,{componentStack:S!==null?S:""})})}function nw(t,n,l,i,d){if(l.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(n=l.alternate,n!==null&&ts(n,l,d,!0),l=hn.current,l!==null){switch(l.tag){case 31:case 13:return Tn===null?bu():l.alternate===null&&yt===0&&(yt=3),l.flags&=-257,l.flags|=65536,l.lanes=d,i===Ko?l.flags|=16384:(n=l.updateQueue,n===null?l.updateQueue=new Set([i]):n.add(i),Cf(t,i,d)),!1;case 22:return l.flags|=65536,i===Ko?l.flags|=16384:(n=l.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([i])},l.updateQueue=n):(l=n.retryQueue,l===null?n.retryQueue=new Set([i]):l.add(i)),Cf(t,i,d)),!1}throw Error(s(435,l.tag))}return Cf(t,i,d),bu(),!1}if(qe)return n=hn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=d,i!==xd&&(t=Error(s(422),{cause:i}),mi(Cn(t,l)))):(i!==xd&&(n=Error(s(423),{cause:i}),mi(Cn(n,l))),t=t.current.alternate,t.flags|=65536,d&=-d,t.lanes|=d,i=Cn(i,l),d=tf(t.stateNode,i,d),Td(t,d),yt!==4&&(yt=2)),!1;var f=Error(s(520),{cause:i});if(f=Cn(f,l),Ri===null?Ri=[f]:Ri.push(f),yt!==4&&(yt=2),n===null)return!0;i=Cn(i,l),l=n;do{switch(l.tag){case 3:return l.flags|=65536,t=d&-d,l.lanes|=t,t=tf(l.stateNode,i,t),Td(l,t),!1;case 1:if(n=l.type,f=l.stateNode,(l.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(ur===null||!ur.has(f))))return l.flags|=65536,d&=-d,l.lanes|=d,d=Xg(d),Jg(d,t,l,i),Td(l,d),!1}l=l.return}while(l!==null);return!1}var nf=Error(s(461)),Et=!1;function Bt(t,n,l,i){n.child=t===null?ng(n,null,l,i):ol(n,t.child,l,i)}function Wg(t,n,l,i,d){l=l.render;var f=n.ref;if("ref"in i){var y={};for(var S in i)S!=="ref"&&(y[S]=i[S])}else y=i;return rl(n),i=Ld(t,n,l,y,f,d),S=$d(),t!==null&&!Et?(Bd(t,n,d),Sa(t,n,d)):(qe&&S&&yd(n),n.flags|=1,Bt(t,n,i,d),n.child)}function ev(t,n,l,i,d){if(t===null){var f=l.type;return typeof f=="function"&&!pd(f)&&f.defaultProps===void 0&&l.compare===null?(n.tag=15,n.type=f,tv(t,n,f,i,d)):(t=Ho(l.type,null,i,n,n.mode,d),t.ref=n.ref,t.return=n,n.child=t)}if(f=t.child,!df(t,d)){var y=f.memoizedProps;if(l=l.compare,l=l!==null?l:ci,l(y,i)&&t.ref===n.ref)return Sa(t,n,d)}return n.flags|=1,t=pa(f,i),t.ref=n.ref,t.return=n,n.child=t}function tv(t,n,l,i,d){if(t!==null){var f=t.memoizedProps;if(ci(f,i)&&t.ref===n.ref)if(Et=!1,n.pendingProps=i=f,df(t,d))(t.flags&131072)!==0&&(Et=!0);else return n.lanes=t.lanes,Sa(t,n,d)}return af(t,n,l,i,d)}function nv(t,n,l,i){var d=i.children,f=t!==null?t.memoizedState:null;if(t===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((n.flags&128)!==0){if(f=f!==null?f.baseLanes|l:l,t!==null){for(i=n.child=t.child,d=0;i!==null;)d=d|i.lanes|i.childLanes,i=i.sibling;i=d&~f}else i=0,n.child=null;return av(t,n,f,l,i)}if((l&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},t!==null&&Po(n,f!==null?f.cachePool:null),f!==null?lg(n,f):Od(),sg(n);else return i=n.lanes=536870912,av(t,n,f!==null?f.baseLanes|l:l,l,i)}else f!==null?(Po(n,f.cachePool),lg(n,f),lr(),n.memoizedState=null):(t!==null&&Po(n,null),Od(),lr());return Bt(t,n,d,l),n.child}function Ei(t,n){return t!==null&&t.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function av(t,n,l,i,d){var f=Cd();return f=f===null?null:{parent:wt._currentValue,pool:f},n.memoizedState={baseLanes:l,cachePool:f},t!==null&&Po(n,null),Od(),sg(n),t!==null&&ts(t,n,i,!0),n.childLanes=d,null}function ou(t,n){return n=cu({mode:n.mode,children:n.children},t.mode),n.ref=t.ref,t.child=n,n.return=t,n}function rv(t,n,l){return ol(n,t.child,null,l),t=ou(n,n.pendingProps),t.flags|=2,pn(n),n.memoizedState=null,t}function aw(t,n,l){var i=n.pendingProps,d=(n.flags&128)!==0;if(n.flags&=-129,t===null){if(qe){if(i.mode==="hidden")return t=ou(n,i),n.lanes=536870912,Ei(null,t);if(Dd(n),(t=ot)?(t=gy(t,zn),t=t!==null&&t.data==="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Xa!==null?{id:ea,overflow:ta}:null,retryLane:536870912,hydrationErrors:null},l=qp(t),l.return=n,n.child=l,Lt=n,ot=null)):t=null,t===null)throw Wa(n);return n.lanes=536870912,null}return ou(n,i)}var f=t.memoizedState;if(f!==null){var y=f.dehydrated;if(Dd(n),d)if(n.flags&256)n.flags&=-257,n=rv(t,n,l);else if(n.memoizedState!==null)n.child=t.child,n.flags|=128,n=null;else throw Error(s(558));else if(Et||ts(t,n,l,!1),d=(l&t.childLanes)!==0,Et||d){if(i=rt,i!==null&&(y=Kh(i,l),y!==0&&y!==f.retryLane))throw f.retryLane=y,el(t,y),sn(i,t,y),nf;bu(),n=rv(t,n,l)}else t=f.treeContext,ot=Rn(y.nextSibling),Lt=n,qe=!0,Ja=null,zn=!1,t!==null&&Qp(n,t),n=ou(n,i),n.flags|=4096;return n}return t=pa(t.child,{mode:i.mode,children:i.children}),t.ref=n.ref,n.child=t,t.return=n,t}function uu(t,n){var l=n.ref;if(l===null)t!==null&&t.ref!==null&&(n.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(s(284));(t===null||t.ref!==l)&&(n.flags|=4194816)}}function af(t,n,l,i,d){return rl(n),l=Ld(t,n,l,i,void 0,d),i=$d(),t!==null&&!Et?(Bd(t,n,d),Sa(t,n,d)):(qe&&i&&yd(n),n.flags|=1,Bt(t,n,l,d),n.child)}function lv(t,n,l,i,d,f){return rl(n),n.updateQueue=null,l=og(n,i,l,d),ig(t),i=$d(),t!==null&&!Et?(Bd(t,n,f),Sa(t,n,f)):(qe&&i&&yd(n),n.flags|=1,Bt(t,n,l,f),n.child)}function sv(t,n,l,i,d){if(rl(n),n.stateNode===null){var f=Xl,y=l.contextType;typeof y=="object"&&y!==null&&(f=$t(y)),f=new l(i,f),n.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=ef,n.stateNode=f,f._reactInternals=n,f=n.stateNode,f.props=i,f.state=n.memoizedState,f.refs={},kd(n),y=l.contextType,f.context=typeof y=="object"&&y!==null?$t(y):Xl,f.state=n.memoizedState,y=l.getDerivedStateFromProps,typeof y=="function"&&(Wd(n,l,y,i),f.state=n.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(y=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),y!==f.state&&ef.enqueueReplaceState(f,f.state,null),xi(n,i,f,d),bi(),f.state=n.memoizedState),typeof f.componentDidMount=="function"&&(n.flags|=4194308),i=!0}else if(t===null){f=n.stateNode;var S=n.memoizedProps,C=cl(l,S);f.props=C;var B=f.context,Y=l.contextType;y=Xl,typeof Y=="object"&&Y!==null&&(y=$t(Y));var J=l.getDerivedStateFromProps;Y=typeof J=="function"||typeof f.getSnapshotBeforeUpdate=="function",S=n.pendingProps!==S,Y||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(S||B!==y)&&Pg(n,f,i,y),tr=!1;var q=n.memoizedState;f.state=q,xi(n,i,f,d),bi(),B=n.memoizedState,S||q!==B||tr?(typeof J=="function"&&(Wd(n,l,J,i),B=n.memoizedState),(C=tr||Gg(n,l,C,i,q,B,y))?(Y||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(n.flags|=4194308)):(typeof f.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=i,n.memoizedState=B),f.props=i,f.state=B,f.context=y,i=C):(typeof f.componentDidMount=="function"&&(n.flags|=4194308),i=!1)}else{f=n.stateNode,zd(t,n),y=n.memoizedProps,Y=cl(l,y),f.props=Y,J=n.pendingProps,q=f.context,B=l.contextType,C=Xl,typeof B=="object"&&B!==null&&(C=$t(B)),S=l.getDerivedStateFromProps,(B=typeof S=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(y!==J||q!==C)&&Pg(n,f,i,C),tr=!1,q=n.memoizedState,f.state=q,xi(n,i,f,d),bi();var G=n.memoizedState;y!==J||q!==G||tr||t!==null&&t.dependencies!==null&&Qo(t.dependencies)?(typeof S=="function"&&(Wd(n,l,S,i),G=n.memoizedState),(Y=tr||Gg(n,l,Y,i,q,G,C)||t!==null&&t.dependencies!==null&&Qo(t.dependencies))?(B||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(i,G,C),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(i,G,C)),typeof f.componentDidUpdate=="function"&&(n.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof f.componentDidUpdate!="function"||y===t.memoizedProps&&q===t.memoizedState||(n.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||y===t.memoizedProps&&q===t.memoizedState||(n.flags|=1024),n.memoizedProps=i,n.memoizedState=G),f.props=i,f.state=G,f.context=C,i=Y):(typeof f.componentDidUpdate!="function"||y===t.memoizedProps&&q===t.memoizedState||(n.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||y===t.memoizedProps&&q===t.memoizedState||(n.flags|=1024),i=!1)}return f=i,uu(t,n),i=(n.flags&128)!==0,f||i?(f=n.stateNode,l=i&&typeof l.getDerivedStateFromError!="function"?null:f.render(),n.flags|=1,t!==null&&i?(n.child=ol(n,t.child,null,d),n.child=ol(n,null,l,d)):Bt(t,n,l,d),n.memoizedState=f.state,t=n.child):t=Sa(t,n,d),t}function iv(t,n,l,i){return nl(),n.flags|=256,Bt(t,n,l,i),n.child}var rf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function lf(t){return{baseLanes:t,cachePool:Fp()}}function sf(t,n,l){return t=t!==null?t.childLanes&~l:0,n&&(t|=vn),t}function ov(t,n,l){var i=n.pendingProps,d=!1,f=(n.flags&128)!==0,y;if((y=f)||(y=t!==null&&t.memoizedState===null?!1:(St.current&2)!==0),y&&(d=!0,n.flags&=-129),y=(n.flags&32)!==0,n.flags&=-33,t===null){if(qe){if(d?rr(n):lr(),(t=ot)?(t=gy(t,zn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Xa!==null?{id:ea,overflow:ta}:null,retryLane:536870912,hydrationErrors:null},l=qp(t),l.return=n,n.child=l,Lt=n,ot=null)):t=null,t===null)throw Wa(n);return If(t)?n.lanes=32:n.lanes=536870912,null}var S=i.children;return i=i.fallback,d?(lr(),d=n.mode,S=cu({mode:"hidden",children:S},d),i=tl(i,d,l,null),S.return=n,i.return=n,S.sibling=i,n.child=S,i=n.child,i.memoizedState=lf(l),i.childLanes=sf(t,y,l),n.memoizedState=rf,Ei(null,i)):(rr(n),of(n,S))}var C=t.memoizedState;if(C!==null&&(S=C.dehydrated,S!==null)){if(f)n.flags&256?(rr(n),n.flags&=-257,n=uf(t,n,l)):n.memoizedState!==null?(lr(),n.child=t.child,n.flags|=128,n=null):(lr(),S=i.fallback,d=n.mode,i=cu({mode:"visible",children:i.children},d),S=tl(S,d,l,null),S.flags|=2,i.return=n,S.return=n,i.sibling=S,n.child=i,ol(n,t.child,null,l),i=n.child,i.memoizedState=lf(l),i.childLanes=sf(t,y,l),n.memoizedState=rf,n=Ei(null,i));else if(rr(n),If(S)){if(y=S.nextSibling&&S.nextSibling.dataset,y)var B=y.dgst;y=B,i=Error(s(419)),i.stack="",i.digest=y,mi({value:i,source:null,stack:null}),n=uf(t,n,l)}else if(Et||ts(t,n,l,!1),y=(l&t.childLanes)!==0,Et||y){if(y=rt,y!==null&&(i=Kh(y,l),i!==0&&i!==C.retryLane))throw C.retryLane=i,el(t,i),sn(y,t,i),nf;Hf(S)||bu(),n=uf(t,n,l)}else Hf(S)?(n.flags|=192,n.child=t.child,n=null):(t=C.treeContext,ot=Rn(S.nextSibling),Lt=n,qe=!0,Ja=null,zn=!1,t!==null&&Qp(n,t),n=of(n,i.children),n.flags|=4096);return n}return d?(lr(),S=i.fallback,d=n.mode,C=t.child,B=C.sibling,i=pa(C,{mode:"hidden",children:i.children}),i.subtreeFlags=C.subtreeFlags&65011712,B!==null?S=pa(B,S):(S=tl(S,d,l,null),S.flags|=2),S.return=n,i.return=n,i.sibling=S,n.child=i,Ei(null,i),i=n.child,S=t.child.memoizedState,S===null?S=lf(l):(d=S.cachePool,d!==null?(C=wt._currentValue,d=d.parent!==C?{parent:C,pool:C}:d):d=Fp(),S={baseLanes:S.baseLanes|l,cachePool:d}),i.memoizedState=S,i.childLanes=sf(t,y,l),n.memoizedState=rf,Ei(t.child,i)):(rr(n),l=t.child,t=l.sibling,l=pa(l,{mode:"visible",children:i.children}),l.return=n,l.sibling=null,t!==null&&(y=n.deletions,y===null?(n.deletions=[t],n.flags|=16):y.push(t)),n.child=l,n.memoizedState=null,l)}function of(t,n){return n=cu({mode:"visible",children:n},t.mode),n.return=t,t.child=n}function cu(t,n){return t=mn(22,t,null,n),t.lanes=0,t}function uf(t,n,l){return ol(n,t.child,null,l),t=of(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function uv(t,n,l){t.lanes|=n;var i=t.alternate;i!==null&&(i.lanes|=n),wd(t.return,n,l)}function cf(t,n,l,i,d,f){var y=t.memoizedState;y===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:i,tail:l,tailMode:d,treeForkCount:f}:(y.isBackwards=n,y.rendering=null,y.renderingStartTime=0,y.last=i,y.tail=l,y.tailMode=d,y.treeForkCount=f)}function cv(t,n,l){var i=n.pendingProps,d=i.revealOrder,f=i.tail;i=i.children;var y=St.current,S=(y&2)!==0;if(S?(y=y&1|2,n.flags|=128):y&=1,V(St,y),Bt(t,n,i,l),i=qe?fi:0,!S&&t!==null&&(t.flags&128)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&uv(t,l,n);else if(t.tag===19)uv(t,l,n);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===n)break e;for(;t.sibling===null;){if(t.return===null||t.return===n)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(d){case"forwards":for(l=n.child,d=null;l!==null;)t=l.alternate,t!==null&&Jo(t)===null&&(d=l),l=l.sibling;l=d,l===null?(d=n.child,n.child=null):(d=l.sibling,l.sibling=null),cf(n,!1,d,l,f,i);break;case"backwards":case"unstable_legacy-backwards":for(l=null,d=n.child,n.child=null;d!==null;){if(t=d.alternate,t!==null&&Jo(t)===null){n.child=d;break}t=d.sibling,d.sibling=l,l=d,d=t}cf(n,!0,l,null,f,i);break;case"together":cf(n,!1,null,null,void 0,i);break;default:n.memoizedState=null}return n.child}function Sa(t,n,l){if(t!==null&&(n.dependencies=t.dependencies),or|=n.lanes,(l&n.childLanes)===0)if(t!==null){if(ts(t,n,l,!1),(l&n.childLanes)===0)return null}else return null;if(t!==null&&n.child!==t.child)throw Error(s(153));if(n.child!==null){for(t=n.child,l=pa(t,t.pendingProps),n.child=l,l.return=n;t.sibling!==null;)t=t.sibling,l=l.sibling=pa(t,t.pendingProps),l.return=n;l.sibling=null}return n.child}function df(t,n){return(t.lanes&n)!==0?!0:(t=t.dependencies,!!(t!==null&&Qo(t)))}function rw(t,n,l){switch(n.tag){case 3:Me(n,n.stateNode.containerInfo),er(n,wt,t.memoizedState.cache),nl();break;case 27:case 5:Dt(n);break;case 4:Me(n,n.stateNode.containerInfo);break;case 10:er(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,Dd(n),null;break;case 13:var i=n.memoizedState;if(i!==null)return i.dehydrated!==null?(rr(n),n.flags|=128,null):(l&n.child.childLanes)!==0?ov(t,n,l):(rr(n),t=Sa(t,n,l),t!==null?t.sibling:null);rr(n);break;case 19:var d=(t.flags&128)!==0;if(i=(l&n.childLanes)!==0,i||(ts(t,n,l,!1),i=(l&n.childLanes)!==0),d){if(i)return cv(t,n,l);n.flags|=128}if(d=n.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),V(St,St.current),i)break;return null;case 22:return n.lanes=0,nv(t,n,l,n.pendingProps);case 24:er(n,wt,t.memoizedState.cache)}return Sa(t,n,l)}function dv(t,n,l){if(t!==null)if(t.memoizedProps!==n.pendingProps)Et=!0;else{if(!df(t,l)&&(n.flags&128)===0)return Et=!1,rw(t,n,l);Et=(t.flags&131072)!==0}else Et=!1,qe&&(n.flags&1048576)!==0&&Ip(n,fi,n.index);switch(n.lanes=0,n.tag){case 16:e:{var i=n.pendingProps;if(t=sl(n.elementType),n.type=t,typeof t=="function")pd(t)?(i=cl(t,i),n.tag=1,n=sv(null,n,t,i,l)):(n.tag=0,n=af(null,n,t,i,l));else{if(t!=null){var d=t.$$typeof;if(d===O){n.tag=11,n=Wg(null,n,t,i,l);break e}else if(d===L){n.tag=14,n=ev(null,n,t,i,l);break e}}throw n=Te(t)||t,Error(s(306,n,""))}}return n;case 0:return af(t,n,n.type,n.pendingProps,l);case 1:return i=n.type,d=cl(i,n.pendingProps),sv(t,n,i,d,l);case 3:e:{if(Me(n,n.stateNode.containerInfo),t===null)throw Error(s(387));i=n.pendingProps;var f=n.memoizedState;d=f.element,zd(t,n),xi(n,i,null,l);var y=n.memoizedState;if(i=y.cache,er(n,wt,i),i!==f.cache&&Nd(n,[wt],l,!0),bi(),i=y.element,f.isDehydrated)if(f={element:i,isDehydrated:!1,cache:y.cache},n.updateQueue.baseState=f,n.memoizedState=f,n.flags&256){n=iv(t,n,i,l);break e}else if(i!==d){d=Cn(Error(s(424)),n),mi(d),n=iv(t,n,i,l);break e}else{switch(t=n.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(ot=Rn(t.firstChild),Lt=n,qe=!0,Ja=null,zn=!0,l=ng(n,null,i,l),n.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(nl(),i===d){n=Sa(t,n,l);break e}Bt(t,n,i,l)}n=n.child}return n;case 26:return uu(t,n),t===null?(l=jy(n.type,null,n.pendingProps,null))?n.memoizedState=l:qe||(l=n.type,t=n.pendingProps,i=_u(ne.current).createElement(l),i[Ut]=n,i[en]=t,Zt(i,l,t),Rt(i),n.stateNode=i):n.memoizedState=jy(n.type,t.memoizedProps,n.pendingProps,t.memoizedState),null;case 27:return Dt(n),t===null&&qe&&(i=n.stateNode=by(n.type,n.pendingProps,ne.current),Lt=n,zn=!0,d=ot,mr(n.type)?(Qf=d,ot=Rn(i.firstChild)):ot=d),Bt(t,n,n.pendingProps.children,l),uu(t,n),t===null&&(n.flags|=4194304),n.child;case 5:return t===null&&qe&&((d=i=ot)&&(i=Mw(i,n.type,n.pendingProps,zn),i!==null?(n.stateNode=i,Lt=n,ot=Rn(i.firstChild),zn=!1,d=!0):d=!1),d||Wa(n)),Dt(n),d=n.type,f=n.pendingProps,y=t!==null?t.memoizedProps:null,i=f.children,Bf(d,f)?i=null:y!==null&&Bf(d,y)&&(n.flags|=32),n.memoizedState!==null&&(d=Ld(t,n,Yj,null,null,l),Zi._currentValue=d),uu(t,n),Bt(t,n,i,l),n.child;case 6:return t===null&&qe&&((t=l=ot)&&(l=Dw(l,n.pendingProps,zn),l!==null?(n.stateNode=l,Lt=n,ot=null,t=!0):t=!1),t||Wa(n)),null;case 13:return ov(t,n,l);case 4:return Me(n,n.stateNode.containerInfo),i=n.pendingProps,t===null?n.child=ol(n,null,i,l):Bt(t,n,i,l),n.child;case 11:return Wg(t,n,n.type,n.pendingProps,l);case 7:return Bt(t,n,n.pendingProps,l),n.child;case 8:return Bt(t,n,n.pendingProps.children,l),n.child;case 12:return Bt(t,n,n.pendingProps.children,l),n.child;case 10:return i=n.pendingProps,er(n,n.type,i.value),Bt(t,n,i.children,l),n.child;case 9:return d=n.type._context,i=n.pendingProps.children,rl(n),d=$t(d),i=i(d),n.flags|=1,Bt(t,n,i,l),n.child;case 14:return ev(t,n,n.type,n.pendingProps,l);case 15:return tv(t,n,n.type,n.pendingProps,l);case 19:return cv(t,n,l);case 31:return aw(t,n,l);case 22:return nv(t,n,l,n.pendingProps);case 24:return rl(n),i=$t(wt),t===null?(d=Cd(),d===null&&(d=rt,f=Ed(),d.pooledCache=f,f.refCount++,f!==null&&(d.pooledCacheLanes|=l),d=f),n.memoizedState={parent:i,cache:d},kd(n),er(n,wt,d)):((t.lanes&l)!==0&&(zd(t,n),xi(n,null,null,l),bi()),d=t.memoizedState,f=n.memoizedState,d.parent!==i?(d={parent:i,cache:i},n.memoizedState=d,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=d),er(n,wt,i)):(i=f.cache,er(n,wt,i),i!==d.cache&&Nd(n,[wt],l,!0))),Bt(t,n,n.pendingProps.children,l),n.child;case 29:throw n.pendingProps}throw Error(s(156,n.tag))}function ja(t){t.flags|=4}function ff(t,n,l,i,d){if((n=(t.mode&32)!==0)&&(n=!1),n){if(t.flags|=16777216,(d&335544128)===d)if(t.stateNode.complete)t.flags|=8192;else if($v())t.flags|=8192;else throw il=Ko,Ad}else t.flags&=-16777217}function fv(t,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Cy(n))if($v())t.flags|=8192;else throw il=Ko,Ad}function du(t,n){n!==null&&(t.flags|=4),t.flags&16384&&(n=t.tag!==22?W():536870912,t.lanes|=n,ms|=n)}function _i(t,n){if(!qe)switch(t.tailMode){case"hidden":n=t.tail;for(var l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?t.tail=null:l.sibling=null;break;case"collapsed":l=t.tail;for(var i=null;l!==null;)l.alternate!==null&&(i=l),l=l.sibling;i===null?n||t.tail===null?t.tail=null:t.tail.sibling=null:i.sibling=null}}function ut(t){var n=t.alternate!==null&&t.alternate.child===t.child,l=0,i=0;if(n)for(var d=t.child;d!==null;)l|=d.lanes|d.childLanes,i|=d.subtreeFlags&65011712,i|=d.flags&65011712,d.return=t,d=d.sibling;else for(d=t.child;d!==null;)l|=d.lanes|d.childLanes,i|=d.subtreeFlags,i|=d.flags,d.return=t,d=d.sibling;return t.subtreeFlags|=i,t.childLanes=l,n}function lw(t,n,l){var i=n.pendingProps;switch(bd(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ut(n),null;case 1:return ut(n),null;case 3:return l=n.stateNode,i=null,t!==null&&(i=t.memoizedState.cache),n.memoizedState.cache!==i&&(n.flags|=2048),ya(wt),pe(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(t===null||t.child===null)&&(es(n)?ja(n):t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Sd())),ut(n),null;case 26:var d=n.type,f=n.memoizedState;return t===null?(ja(n),f!==null?(ut(n),fv(n,f)):(ut(n),ff(n,d,null,i,l))):f?f!==t.memoizedState?(ja(n),ut(n),fv(n,f)):(ut(n),n.flags&=-16777217):(t=t.memoizedProps,t!==i&&ja(n),ut(n),ff(n,d,t,i,l)),null;case 27:if(jn(n),l=ne.current,d=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==i&&ja(n);else{if(!i){if(n.stateNode===null)throw Error(s(166));return ut(n),null}t=ee.current,es(n)?Gp(n):(t=by(d,i,l),n.stateNode=t,ja(n))}return ut(n),null;case 5:if(jn(n),d=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==i&&ja(n);else{if(!i){if(n.stateNode===null)throw Error(s(166));return ut(n),null}if(f=ee.current,es(n))Gp(n);else{var y=_u(ne.current);switch(f){case 1:f=y.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:f=y.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":f=y.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":f=y.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":f=y.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof i.is=="string"?y.createElement("select",{is:i.is}):y.createElement("select"),i.multiple?f.multiple=!0:i.size&&(f.size=i.size);break;default:f=typeof i.is=="string"?y.createElement(d,{is:i.is}):y.createElement(d)}}f[Ut]=n,f[en]=i;e:for(y=n.child;y!==null;){if(y.tag===5||y.tag===6)f.appendChild(y.stateNode);else if(y.tag!==4&&y.tag!==27&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===n)break e;for(;y.sibling===null;){if(y.return===null||y.return===n)break e;y=y.return}y.sibling.return=y.return,y=y.sibling}n.stateNode=f;e:switch(Zt(f,d,i),d){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&ja(n)}}return ut(n),ff(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,l),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==i&&ja(n);else{if(typeof i!="string"&&n.stateNode===null)throw Error(s(166));if(t=ne.current,es(n)){if(t=n.stateNode,l=n.memoizedProps,i=null,d=Lt,d!==null)switch(d.tag){case 27:case 5:i=d.memoizedProps}t[Ut]=n,t=!!(t.nodeValue===l||i!==null&&i.suppressHydrationWarning===!0||oy(t.nodeValue,l)),t||Wa(n,!0)}else t=_u(t).createTextNode(i),t[Ut]=n,n.stateNode=t}return ut(n),null;case 31:if(l=n.memoizedState,t===null||t.memoizedState!==null){if(i=es(n),l!==null){if(t===null){if(!i)throw Error(s(318));if(t=n.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(557));t[Ut]=n}else nl(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;ut(n),t=!1}else l=Sd(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=l),t=!0;if(!t)return n.flags&256?(pn(n),n):(pn(n),null);if((n.flags&128)!==0)throw Error(s(558))}return ut(n),null;case 13:if(i=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(d=es(n),i!==null&&i.dehydrated!==null){if(t===null){if(!d)throw Error(s(318));if(d=n.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(s(317));d[Ut]=n}else nl(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;ut(n),d=!1}else d=Sd(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=d),d=!0;if(!d)return n.flags&256?(pn(n),n):(pn(n),null)}return pn(n),(n.flags&128)!==0?(n.lanes=l,n):(l=i!==null,t=t!==null&&t.memoizedState!==null,l&&(i=n.child,d=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(d=i.alternate.memoizedState.cachePool.pool),f=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(f=i.memoizedState.cachePool.pool),f!==d&&(i.flags|=2048)),l!==t&&l&&(n.child.flags|=8192),du(n,n.updateQueue),ut(n),null);case 4:return pe(),t===null&&Mf(n.stateNode.containerInfo),ut(n),null;case 10:return ya(n.type),ut(n),null;case 19:if(k(St),i=n.memoizedState,i===null)return ut(n),null;if(d=(n.flags&128)!==0,f=i.rendering,f===null)if(d)_i(i,!1);else{if(yt!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(f=Jo(t),f!==null){for(n.flags|=128,_i(i,!1),t=f.updateQueue,n.updateQueue=t,du(n,t),n.subtreeFlags=0,t=l,l=n.child;l!==null;)Zp(l,t),l=l.sibling;return V(St,St.current&1|2),qe&&ga(n,i.treeForkCount),n.child}t=t.sibling}i.tail!==null&&Gt()>gu&&(n.flags|=128,d=!0,_i(i,!1),n.lanes=4194304)}else{if(!d)if(t=Jo(f),t!==null){if(n.flags|=128,d=!0,t=t.updateQueue,n.updateQueue=t,du(n,t),_i(i,!0),i.tail===null&&i.tailMode==="hidden"&&!f.alternate&&!qe)return ut(n),null}else 2*Gt()-i.renderingStartTime>gu&&l!==536870912&&(n.flags|=128,d=!0,_i(i,!1),n.lanes=4194304);i.isBackwards?(f.sibling=n.child,n.child=f):(t=i.last,t!==null?t.sibling=f:n.child=f,i.last=f)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Gt(),t.sibling=null,l=St.current,V(St,d?l&1|2:l&1),qe&&ga(n,i.treeForkCount),t):(ut(n),null);case 22:case 23:return pn(n),Md(),i=n.memoizedState!==null,t!==null?t.memoizedState!==null!==i&&(n.flags|=8192):i&&(n.flags|=8192),i?(l&536870912)!==0&&(n.flags&128)===0&&(ut(n),n.subtreeFlags&6&&(n.flags|=8192)):ut(n),l=n.updateQueue,l!==null&&du(n,l.retryQueue),l=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),i=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(i=n.memoizedState.cachePool.pool),i!==l&&(n.flags|=2048),t!==null&&k(ll),null;case 24:return l=null,t!==null&&(l=t.memoizedState.cache),n.memoizedState.cache!==l&&(n.flags|=2048),ya(wt),ut(n),null;case 25:return null;case 30:return null}throw Error(s(156,n.tag))}function sw(t,n){switch(bd(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return ya(wt),pe(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return jn(n),null;case 31:if(n.memoizedState!==null){if(pn(n),n.alternate===null)throw Error(s(340));nl()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if(pn(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(s(340));nl()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return k(St),null;case 4:return pe(),null;case 10:return ya(n.type),null;case 22:case 23:return pn(n),Md(),t!==null&&k(ll),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return ya(wt),null;case 25:return null;default:return null}}function mv(t,n){switch(bd(n),n.tag){case 3:ya(wt),pe();break;case 26:case 27:case 5:jn(n);break;case 4:pe();break;case 31:n.memoizedState!==null&&pn(n);break;case 13:pn(n);break;case 19:k(St);break;case 10:ya(n.type);break;case 22:case 23:pn(n),Md(),t!==null&&k(ll);break;case 24:ya(wt)}}function Ci(t,n){try{var l=n.updateQueue,i=l!==null?l.lastEffect:null;if(i!==null){var d=i.next;l=d;do{if((l.tag&t)===t){i=void 0;var f=l.create,y=l.inst;i=f(),y.destroy=i}l=l.next}while(l!==d)}}catch(S){et(n,n.return,S)}}function sr(t,n,l){try{var i=n.updateQueue,d=i!==null?i.lastEffect:null;if(d!==null){var f=d.next;i=f;do{if((i.tag&t)===t){var y=i.inst,S=y.destroy;if(S!==void 0){y.destroy=void 0,d=n;var C=l,B=S;try{B()}catch(Y){et(d,C,Y)}}}i=i.next}while(i!==f)}}catch(Y){et(n,n.return,Y)}}function hv(t){var n=t.updateQueue;if(n!==null){var l=t.stateNode;try{rg(n,l)}catch(i){et(t,t.return,i)}}}function pv(t,n,l){l.props=cl(t.type,t.memoizedProps),l.state=t.memoizedState;try{l.componentWillUnmount()}catch(i){et(t,n,i)}}function Ai(t,n){try{var l=t.ref;if(l!==null){switch(t.tag){case 26:case 27:case 5:var i=t.stateNode;break;case 30:i=t.stateNode;break;default:i=t.stateNode}typeof l=="function"?t.refCleanup=l(i):l.current=i}}catch(d){et(t,n,d)}}function na(t,n){var l=t.ref,i=t.refCleanup;if(l!==null)if(typeof i=="function")try{i()}catch(d){et(t,n,d)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(d){et(t,n,d)}else l.current=null}function gv(t){var n=t.type,l=t.memoizedProps,i=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":l.autoFocus&&i.focus();break e;case"img":l.src?i.src=l.src:l.srcSet&&(i.srcset=l.srcSet)}}catch(d){et(t,t.return,d)}}function mf(t,n,l){try{var i=t.stateNode;Aw(i,t.type,l,n),i[en]=n}catch(d){et(t,t.return,d)}}function vv(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&mr(t.type)||t.tag===4}function hf(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||vv(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&mr(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function pf(t,n,l){var i=t.tag;if(i===5||i===6)t=t.stateNode,n?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(t,n):(n=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,n.appendChild(t),l=l._reactRootContainer,l!=null||n.onclick!==null||(n.onclick=ma));else if(i!==4&&(i===27&&mr(t.type)&&(l=t.stateNode,n=null),t=t.child,t!==null))for(pf(t,n,l),t=t.sibling;t!==null;)pf(t,n,l),t=t.sibling}function fu(t,n,l){var i=t.tag;if(i===5||i===6)t=t.stateNode,n?l.insertBefore(t,n):l.appendChild(t);else if(i!==4&&(i===27&&mr(t.type)&&(l=t.stateNode),t=t.child,t!==null))for(fu(t,n,l),t=t.sibling;t!==null;)fu(t,n,l),t=t.sibling}function yv(t){var n=t.stateNode,l=t.memoizedProps;try{for(var i=t.type,d=n.attributes;d.length;)n.removeAttributeNode(d[0]);Zt(n,i,l),n[Ut]=t,n[en]=l}catch(f){et(t,t.return,f)}}var wa=!1,_t=!1,gf=!1,bv=typeof WeakSet=="function"?WeakSet:Set,Ot=null;function iw(t,n){if(t=t.containerInfo,Lf=Ou,t=Tp(t),od(t)){if("selectionStart"in t)var l={start:t.selectionStart,end:t.selectionEnd};else e:{l=(l=t.ownerDocument)&&l.defaultView||window;var i=l.getSelection&&l.getSelection();if(i&&i.rangeCount!==0){l=i.anchorNode;var d=i.anchorOffset,f=i.focusNode;i=i.focusOffset;try{l.nodeType,f.nodeType}catch{l=null;break e}var y=0,S=-1,C=-1,B=0,Y=0,J=t,q=null;t:for(;;){for(var G;J!==l||d!==0&&J.nodeType!==3||(S=y+d),J!==f||i!==0&&J.nodeType!==3||(C=y+i),J.nodeType===3&&(y+=J.nodeValue.length),(G=J.firstChild)!==null;)q=J,J=G;for(;;){if(J===t)break t;if(q===l&&++B===d&&(S=y),q===f&&++Y===i&&(C=y),(G=J.nextSibling)!==null)break;J=q,q=J.parentNode}J=G}l=S===-1||C===-1?null:{start:S,end:C}}else l=null}l=l||{start:0,end:0}}else l=null;for($f={focusedElem:t,selectionRange:l},Ou=!1,Ot=n;Ot!==null;)if(n=Ot,t=n.child,(n.subtreeFlags&1028)!==0&&t!==null)t.return=n,Ot=t;else for(;Ot!==null;){switch(n=Ot,f=n.alternate,t=n.flags,n.tag){case 0:if((t&4)!==0&&(t=n.updateQueue,t=t!==null?t.events:null,t!==null))for(l=0;l<t.length;l++)d=t[l],d.ref.impl=d.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&f!==null){t=void 0,l=n,d=f.memoizedProps,f=f.memoizedState,i=l.stateNode;try{var oe=cl(l.type,d);t=i.getSnapshotBeforeUpdate(oe,f),i.__reactInternalSnapshotBeforeUpdate=t}catch(Ee){et(l,l.return,Ee)}}break;case 3:if((t&1024)!==0){if(t=n.stateNode.containerInfo,l=t.nodeType,l===9)qf(t);else if(l===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":qf(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(s(163))}if(t=n.sibling,t!==null){t.return=n.return,Ot=t;break}Ot=n.return}}function xv(t,n,l){var i=l.flags;switch(l.tag){case 0:case 11:case 15:Ea(t,l),i&4&&Ci(5,l);break;case 1:if(Ea(t,l),i&4)if(t=l.stateNode,n===null)try{t.componentDidMount()}catch(y){et(l,l.return,y)}else{var d=cl(l.type,n.memoizedProps);n=n.memoizedState;try{t.componentDidUpdate(d,n,t.__reactInternalSnapshotBeforeUpdate)}catch(y){et(l,l.return,y)}}i&64&&hv(l),i&512&&Ai(l,l.return);break;case 3:if(Ea(t,l),i&64&&(t=l.updateQueue,t!==null)){if(n=null,l.child!==null)switch(l.child.tag){case 27:case 5:n=l.child.stateNode;break;case 1:n=l.child.stateNode}try{rg(t,n)}catch(y){et(l,l.return,y)}}break;case 27:n===null&&i&4&&yv(l);case 26:case 5:Ea(t,l),n===null&&i&4&&gv(l),i&512&&Ai(l,l.return);break;case 12:Ea(t,l);break;case 31:Ea(t,l),i&4&&wv(t,l);break;case 13:Ea(t,l),i&4&&Nv(t,l),i&64&&(t=l.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(l=gw.bind(null,l),Uw(t,l))));break;case 22:if(i=l.memoizedState!==null||wa,!i){n=n!==null&&n.memoizedState!==null||_t,d=wa;var f=_t;wa=i,(_t=n)&&!f?_a(t,l,(l.subtreeFlags&8772)!==0):Ea(t,l),wa=d,_t=f}break;case 30:break;default:Ea(t,l)}}function Sv(t){var n=t.alternate;n!==null&&(t.alternate=null,Sv(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&Gc(n)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var dt=null,nn=!1;function Na(t,n,l){for(l=l.child;l!==null;)jv(t,n,l),l=l.sibling}function jv(t,n,l){if(Pt&&typeof Pt.onCommitFiberUnmount=="function")try{Pt.onCommitFiberUnmount(Gr,l)}catch{}switch(l.tag){case 26:_t||na(l,n),Na(t,n,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:_t||na(l,n);var i=dt,d=nn;mr(l.type)&&(dt=l.stateNode,nn=!1),Na(t,n,l),Li(l.stateNode),dt=i,nn=d;break;case 5:_t||na(l,n);case 6:if(i=dt,d=nn,dt=null,Na(t,n,l),dt=i,nn=d,dt!==null)if(nn)try{(dt.nodeType===9?dt.body:dt.nodeName==="HTML"?dt.ownerDocument.body:dt).removeChild(l.stateNode)}catch(f){et(l,n,f)}else try{dt.removeChild(l.stateNode)}catch(f){et(l,n,f)}break;case 18:dt!==null&&(nn?(t=dt,hy(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,l.stateNode),Ss(t)):hy(dt,l.stateNode));break;case 4:i=dt,d=nn,dt=l.stateNode.containerInfo,nn=!0,Na(t,n,l),dt=i,nn=d;break;case 0:case 11:case 14:case 15:sr(2,l,n),_t||sr(4,l,n),Na(t,n,l);break;case 1:_t||(na(l,n),i=l.stateNode,typeof i.componentWillUnmount=="function"&&pv(l,n,i)),Na(t,n,l);break;case 21:Na(t,n,l);break;case 22:_t=(i=_t)||l.memoizedState!==null,Na(t,n,l),_t=i;break;default:Na(t,n,l)}}function wv(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Ss(t)}catch(l){et(n,n.return,l)}}}function Nv(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Ss(t)}catch(l){et(n,n.return,l)}}function ow(t){switch(t.tag){case 31:case 13:case 19:var n=t.stateNode;return n===null&&(n=t.stateNode=new bv),n;case 22:return t=t.stateNode,n=t._retryCache,n===null&&(n=t._retryCache=new bv),n;default:throw Error(s(435,t.tag))}}function mu(t,n){var l=ow(t);n.forEach(function(i){if(!l.has(i)){l.add(i);var d=vw.bind(null,t,i);i.then(d,d)}})}function an(t,n){var l=n.deletions;if(l!==null)for(var i=0;i<l.length;i++){var d=l[i],f=t,y=n,S=y;e:for(;S!==null;){switch(S.tag){case 27:if(mr(S.type)){dt=S.stateNode,nn=!1;break e}break;case 5:dt=S.stateNode,nn=!1;break e;case 3:case 4:dt=S.stateNode.containerInfo,nn=!0;break e}S=S.return}if(dt===null)throw Error(s(160));jv(f,y,d),dt=null,nn=!1,f=d.alternate,f!==null&&(f.return=null),d.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)Ev(n,t),n=n.sibling}var Pn=null;function Ev(t,n){var l=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:an(n,t),rn(t),i&4&&(sr(3,t,t.return),Ci(3,t),sr(5,t,t.return));break;case 1:an(n,t),rn(t),i&512&&(_t||l===null||na(l,l.return)),i&64&&wa&&(t=t.updateQueue,t!==null&&(i=t.callbacks,i!==null&&(l=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=l===null?i:l.concat(i))));break;case 26:var d=Pn;if(an(n,t),rn(t),i&512&&(_t||l===null||na(l,l.return)),i&4){var f=l!==null?l.memoizedState:null;if(i=t.memoizedState,l===null)if(i===null)if(t.stateNode===null){e:{i=t.type,l=t.memoizedProps,d=d.ownerDocument||d;t:switch(i){case"title":f=d.getElementsByTagName("title")[0],(!f||f[ti]||f[Ut]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=d.createElement(i),d.head.insertBefore(f,d.querySelector("head > title"))),Zt(f,i,l),f[Ut]=t,Rt(f),i=f;break e;case"link":var y=Ey("link","href",d).get(i+(l.href||""));if(y){for(var S=0;S<y.length;S++)if(f=y[S],f.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&f.getAttribute("rel")===(l.rel==null?null:l.rel)&&f.getAttribute("title")===(l.title==null?null:l.title)&&f.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){y.splice(S,1);break t}}f=d.createElement(i),Zt(f,i,l),d.head.appendChild(f);break;case"meta":if(y=Ey("meta","content",d).get(i+(l.content||""))){for(S=0;S<y.length;S++)if(f=y[S],f.getAttribute("content")===(l.content==null?null:""+l.content)&&f.getAttribute("name")===(l.name==null?null:l.name)&&f.getAttribute("property")===(l.property==null?null:l.property)&&f.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&f.getAttribute("charset")===(l.charSet==null?null:l.charSet)){y.splice(S,1);break t}}f=d.createElement(i),Zt(f,i,l),d.head.appendChild(f);break;default:throw Error(s(468,i))}f[Ut]=t,Rt(f),i=f}t.stateNode=i}else _y(d,t.type,t.stateNode);else t.stateNode=Ny(d,i,t.memoizedProps);else f!==i?(f===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):f.count--,i===null?_y(d,t.type,t.stateNode):Ny(d,i,t.memoizedProps)):i===null&&t.stateNode!==null&&mf(t,t.memoizedProps,l.memoizedProps)}break;case 27:an(n,t),rn(t),i&512&&(_t||l===null||na(l,l.return)),l!==null&&i&4&&mf(t,t.memoizedProps,l.memoizedProps);break;case 5:if(an(n,t),rn(t),i&512&&(_t||l===null||na(l,l.return)),t.flags&32){d=t.stateNode;try{Ql(d,"")}catch(oe){et(t,t.return,oe)}}i&4&&t.stateNode!=null&&(d=t.memoizedProps,mf(t,d,l!==null?l.memoizedProps:d)),i&1024&&(gf=!0);break;case 6:if(an(n,t),rn(t),i&4){if(t.stateNode===null)throw Error(s(162));i=t.memoizedProps,l=t.stateNode;try{l.nodeValue=i}catch(oe){et(t,t.return,oe)}}break;case 3:if(ku=null,d=Pn,Pn=Cu(n.containerInfo),an(n,t),Pn=d,rn(t),i&4&&l!==null&&l.memoizedState.isDehydrated)try{Ss(n.containerInfo)}catch(oe){et(t,t.return,oe)}gf&&(gf=!1,_v(t));break;case 4:i=Pn,Pn=Cu(t.stateNode.containerInfo),an(n,t),rn(t),Pn=i;break;case 12:an(n,t),rn(t);break;case 31:an(n,t),rn(t),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,mu(t,i)));break;case 13:an(n,t),rn(t),t.child.flags&8192&&t.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(pu=Gt()),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,mu(t,i)));break;case 22:d=t.memoizedState!==null;var C=l!==null&&l.memoizedState!==null,B=wa,Y=_t;if(wa=B||d,_t=Y||C,an(n,t),_t=Y,wa=B,rn(t),i&8192)e:for(n=t.stateNode,n._visibility=d?n._visibility&-2:n._visibility|1,d&&(l===null||C||wa||_t||dl(t)),l=null,n=t;;){if(n.tag===5||n.tag===26){if(l===null){C=l=n;try{if(f=C.stateNode,d)y=f.style,typeof y.setProperty=="function"?y.setProperty("display","none","important"):y.display="none";else{S=C.stateNode;var J=C.memoizedProps.style,q=J!=null&&J.hasOwnProperty("display")?J.display:null;S.style.display=q==null||typeof q=="boolean"?"":(""+q).trim()}}catch(oe){et(C,C.return,oe)}}}else if(n.tag===6){if(l===null){C=n;try{C.stateNode.nodeValue=d?"":C.memoizedProps}catch(oe){et(C,C.return,oe)}}}else if(n.tag===18){if(l===null){C=n;try{var G=C.stateNode;d?py(G,!0):py(C.stateNode,!1)}catch(oe){et(C,C.return,oe)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===t)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break e;for(;n.sibling===null;){if(n.return===null||n.return===t)break e;l===n&&(l=null),n=n.return}l===n&&(l=null),n.sibling.return=n.return,n=n.sibling}i&4&&(i=t.updateQueue,i!==null&&(l=i.retryQueue,l!==null&&(i.retryQueue=null,mu(t,l))));break;case 19:an(n,t),rn(t),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,mu(t,i)));break;case 30:break;case 21:break;default:an(n,t),rn(t)}}function rn(t){var n=t.flags;if(n&2){try{for(var l,i=t.return;i!==null;){if(vv(i)){l=i;break}i=i.return}if(l==null)throw Error(s(160));switch(l.tag){case 27:var d=l.stateNode,f=hf(t);fu(t,f,d);break;case 5:var y=l.stateNode;l.flags&32&&(Ql(y,""),l.flags&=-33);var S=hf(t);fu(t,S,y);break;case 3:case 4:var C=l.stateNode.containerInfo,B=hf(t);pf(t,B,C);break;default:throw Error(s(161))}}catch(Y){et(t,t.return,Y)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function _v(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var n=t;_v(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),t=t.sibling}}function Ea(t,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)xv(t,n.alternate,n),n=n.sibling}function dl(t){for(t=t.child;t!==null;){var n=t;switch(n.tag){case 0:case 11:case 14:case 15:sr(4,n,n.return),dl(n);break;case 1:na(n,n.return);var l=n.stateNode;typeof l.componentWillUnmount=="function"&&pv(n,n.return,l),dl(n);break;case 27:Li(n.stateNode);case 26:case 5:na(n,n.return),dl(n);break;case 22:n.memoizedState===null&&dl(n);break;case 30:dl(n);break;default:dl(n)}t=t.sibling}}function _a(t,n,l){for(l=l&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var i=n.alternate,d=t,f=n,y=f.flags;switch(f.tag){case 0:case 11:case 15:_a(d,f,l),Ci(4,f);break;case 1:if(_a(d,f,l),i=f,d=i.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(B){et(i,i.return,B)}if(i=f,d=i.updateQueue,d!==null){var S=i.stateNode;try{var C=d.shared.hiddenCallbacks;if(C!==null)for(d.shared.hiddenCallbacks=null,d=0;d<C.length;d++)ag(C[d],S)}catch(B){et(i,i.return,B)}}l&&y&64&&hv(f),Ai(f,f.return);break;case 27:yv(f);case 26:case 5:_a(d,f,l),l&&i===null&&y&4&&gv(f),Ai(f,f.return);break;case 12:_a(d,f,l);break;case 31:_a(d,f,l),l&&y&4&&wv(d,f);break;case 13:_a(d,f,l),l&&y&4&&Nv(d,f);break;case 22:f.memoizedState===null&&_a(d,f,l),Ai(f,f.return);break;case 30:break;default:_a(d,f,l)}n=n.sibling}}function vf(t,n){var l=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),t=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(t=n.memoizedState.cachePool.pool),t!==l&&(t!=null&&t.refCount++,l!=null&&hi(l))}function yf(t,n){t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&hi(t))}function Vn(t,n,l,i){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Cv(t,n,l,i),n=n.sibling}function Cv(t,n,l,i){var d=n.flags;switch(n.tag){case 0:case 11:case 15:Vn(t,n,l,i),d&2048&&Ci(9,n);break;case 1:Vn(t,n,l,i);break;case 3:Vn(t,n,l,i),d&2048&&(t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&hi(t)));break;case 12:if(d&2048){Vn(t,n,l,i),t=n.stateNode;try{var f=n.memoizedProps,y=f.id,S=f.onPostCommit;typeof S=="function"&&S(y,n.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(C){et(n,n.return,C)}}else Vn(t,n,l,i);break;case 31:Vn(t,n,l,i);break;case 13:Vn(t,n,l,i);break;case 23:break;case 22:f=n.stateNode,y=n.alternate,n.memoizedState!==null?f._visibility&2?Vn(t,n,l,i):ki(t,n):f._visibility&2?Vn(t,n,l,i):(f._visibility|=2,cs(t,n,l,i,(n.subtreeFlags&10256)!==0||!1)),d&2048&&vf(y,n);break;case 24:Vn(t,n,l,i),d&2048&&yf(n.alternate,n);break;default:Vn(t,n,l,i)}}function cs(t,n,l,i,d){for(d=d&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var f=t,y=n,S=l,C=i,B=y.flags;switch(y.tag){case 0:case 11:case 15:cs(f,y,S,C,d),Ci(8,y);break;case 23:break;case 22:var Y=y.stateNode;y.memoizedState!==null?Y._visibility&2?cs(f,y,S,C,d):ki(f,y):(Y._visibility|=2,cs(f,y,S,C,d)),d&&B&2048&&vf(y.alternate,y);break;case 24:cs(f,y,S,C,d),d&&B&2048&&yf(y.alternate,y);break;default:cs(f,y,S,C,d)}n=n.sibling}}function ki(t,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var l=t,i=n,d=i.flags;switch(i.tag){case 22:ki(l,i),d&2048&&vf(i.alternate,i);break;case 24:ki(l,i),d&2048&&yf(i.alternate,i);break;default:ki(l,i)}n=n.sibling}}var zi=8192;function ds(t,n,l){if(t.subtreeFlags&zi)for(t=t.child;t!==null;)Av(t,n,l),t=t.sibling}function Av(t,n,l){switch(t.tag){case 26:ds(t,n,l),t.flags&zi&&t.memoizedState!==null&&Kw(l,Pn,t.memoizedState,t.memoizedProps);break;case 5:ds(t,n,l);break;case 3:case 4:var i=Pn;Pn=Cu(t.stateNode.containerInfo),ds(t,n,l),Pn=i;break;case 22:t.memoizedState===null&&(i=t.alternate,i!==null&&i.memoizedState!==null?(i=zi,zi=16777216,ds(t,n,l),zi=i):ds(t,n,l));break;default:ds(t,n,l)}}function kv(t){var n=t.alternate;if(n!==null&&(t=n.child,t!==null)){n.child=null;do n=t.sibling,t.sibling=null,t=n;while(t!==null)}}function Ti(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var l=0;l<n.length;l++){var i=n[l];Ot=i,Tv(i,t)}kv(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)zv(t),t=t.sibling}function zv(t){switch(t.tag){case 0:case 11:case 15:Ti(t),t.flags&2048&&sr(9,t,t.return);break;case 3:Ti(t);break;case 12:Ti(t);break;case 22:var n=t.stateNode;t.memoizedState!==null&&n._visibility&2&&(t.return===null||t.return.tag!==13)?(n._visibility&=-3,hu(t)):Ti(t);break;default:Ti(t)}}function hu(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var l=0;l<n.length;l++){var i=n[l];Ot=i,Tv(i,t)}kv(t)}for(t=t.child;t!==null;){switch(n=t,n.tag){case 0:case 11:case 15:sr(8,n,n.return),hu(n);break;case 22:l=n.stateNode,l._visibility&2&&(l._visibility&=-3,hu(n));break;default:hu(n)}t=t.sibling}}function Tv(t,n){for(;Ot!==null;){var l=Ot;switch(l.tag){case 0:case 11:case 15:sr(8,l,n);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var i=l.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:hi(l.memoizedState.cache)}if(i=l.child,i!==null)i.return=l,Ot=i;else e:for(l=t;Ot!==null;){i=Ot;var d=i.sibling,f=i.return;if(Sv(i),i===l){Ot=null;break e}if(d!==null){d.return=f,Ot=d;break e}Ot=f}}}var uw={getCacheForType:function(t){var n=$t(wt),l=n.data.get(t);return l===void 0&&(l=t(),n.data.set(t,l)),l},cacheSignal:function(){return $t(wt).controller.signal}},cw=typeof WeakMap=="function"?WeakMap:Map,Ke=0,rt=null,Ue=null,Be=0,We=0,gn=null,ir=!1,fs=!1,bf=!1,Ca=0,yt=0,or=0,fl=0,xf=0,vn=0,ms=0,Ri=null,ln=null,Sf=!1,pu=0,Rv=0,gu=1/0,vu=null,ur=null,kt=0,cr=null,hs=null,Aa=0,jf=0,wf=null,Ov=null,Oi=0,Nf=null;function yn(){return(Ke&2)!==0&&Be!==0?Be&-Be:Q.T!==null?zf():Yh()}function Mv(){if(vn===0)if((Be&536870912)===0||qe){var t=Vr;Vr<<=1,(Vr&3932160)===0&&(Vr=262144),vn=t}else vn=536870912;return t=hn.current,t!==null&&(t.flags|=32),vn}function sn(t,n,l){(t===rt&&(We===2||We===9)||t.cancelPendingCommit!==null)&&(ps(t,0),dr(t,Be,vn,!1)),Kt(t,l),((Ke&2)===0||t!==rt)&&(t===rt&&((Ke&2)===0&&(fl|=l),yt===4&&dr(t,Be,vn,!1)),aa(t))}function Dv(t,n,l){if((Ke&6)!==0)throw Error(s(327));var i=!l&&(n&127)===0&&(n&t.expiredLanes)===0||Ka(t,n),d=i?mw(t,n):_f(t,n,!0),f=i;do{if(d===0){fs&&!i&&dr(t,n,0,!1);break}else{if(l=t.current.alternate,f&&!dw(l)){d=_f(t,n,!1),f=!1;continue}if(d===2){if(f=n,t.errorRecoveryDisabledLanes&f)var y=0;else y=t.pendingLanes&-536870913,y=y!==0?y:y&536870912?536870912:0;if(y!==0){n=y;e:{var S=t;d=Ri;var C=S.current.memoizedState.isDehydrated;if(C&&(ps(S,y).flags|=256),y=_f(S,y,!1),y!==2){if(bf&&!C){S.errorRecoveryDisabledLanes|=f,fl|=f,d=4;break e}f=ln,ln=d,f!==null&&(ln===null?ln=f:ln.push.apply(ln,f))}d=y}if(f=!1,d!==2)continue}}if(d===1){ps(t,0),dr(t,n,0,!0);break}e:{switch(i=t,f=d,f){case 0:case 1:throw Error(s(345));case 4:if((n&4194048)!==n)break;case 6:dr(i,n,vn,!ir);break e;case 2:ln=null;break;case 3:case 5:break;default:throw Error(s(329))}if((n&62914560)===n&&(d=pu+300-Gt(),10<d)){if(dr(i,n,vn,!ir),Yr(i,0,!0)!==0)break e;Aa=n,i.timeoutHandle=fy(Uv.bind(null,i,l,ln,vu,Sf,n,vn,fl,ms,ir,f,"Throttled",-0,0),d);break e}Uv(i,l,ln,vu,Sf,n,vn,fl,ms,ir,f,null,-0,0)}}break}while(!0);aa(t)}function Uv(t,n,l,i,d,f,y,S,C,B,Y,J,q,G){if(t.timeoutHandle=-1,J=n.subtreeFlags,J&8192||(J&16785408)===16785408){J={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ma},Av(n,f,J);var oe=(f&62914560)===f?pu-Gt():(f&4194048)===f?Rv-Gt():0;if(oe=Yw(J,oe),oe!==null){Aa=f,t.cancelPendingCommit=oe(Qv.bind(null,t,n,f,l,i,d,y,S,C,Y,J,null,q,G)),dr(t,f,y,!B);return}}Qv(t,n,f,l,i,d,y,S,C)}function dw(t){for(var n=t;;){var l=n.tag;if((l===0||l===11||l===15)&&n.flags&16384&&(l=n.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var i=0;i<l.length;i++){var d=l[i],f=d.getSnapshot;d=d.value;try{if(!fn(f(),d))return!1}catch{return!1}}if(l=n.child,n.subtreeFlags&16384&&l!==null)l.return=n,n=l;else{if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function dr(t,n,l,i){n&=~xf,n&=~fl,t.suspendedLanes|=n,t.pingedLanes&=~n,i&&(t.warmLanes|=n),i=t.expirationTimes;for(var d=n;0<d;){var f=31-Vt(d),y=1<<f;i[f]=-1,d&=~y}l!==0&&qc(t,l,n)}function yu(){return(Ke&6)===0?(Mi(0),!1):!0}function Ef(){if(Ue!==null){if(We===0)var t=Ue.return;else t=Ue,va=al=null,Zd(t),ls=null,gi=0,t=Ue;for(;t!==null;)mv(t.alternate,t),t=t.return;Ue=null}}function ps(t,n){var l=t.timeoutHandle;l!==-1&&(t.timeoutHandle=-1,Tw(l)),l=t.cancelPendingCommit,l!==null&&(t.cancelPendingCommit=null,l()),Aa=0,Ef(),rt=t,Ue=l=pa(t.current,null),Be=n,We=0,gn=null,ir=!1,fs=Ka(t,n),bf=!1,ms=vn=xf=fl=or=yt=0,ln=Ri=null,Sf=!1,(n&8)!==0&&(n|=n&32);var i=t.entangledLanes;if(i!==0)for(t=t.entanglements,i&=n;0<i;){var d=31-Vt(i),f=1<<d;n|=t[d],i&=~f}return Ca=n,Bo(),l}function Lv(t,n){ze=null,Q.H=Ni,n===rs||n===Vo?(n=Wp(),We=3):n===Ad?(n=Wp(),We=4):We=n===nf?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,gn=n,Ue===null&&(yt=1,iu(t,Cn(n,t.current)))}function $v(){var t=hn.current;return t===null?!0:(Be&4194048)===Be?Tn===null:(Be&62914560)===Be||(Be&536870912)!==0?t===Tn:!1}function Bv(){var t=Q.H;return Q.H=Ni,t===null?Ni:t}function Zv(){var t=Q.A;return Q.A=uw,t}function bu(){yt=4,ir||(Be&4194048)!==Be&&hn.current!==null||(fs=!0),(or&134217727)===0&&(fl&134217727)===0||rt===null||dr(rt,Be,vn,!1)}function _f(t,n,l){var i=Ke;Ke|=2;var d=Bv(),f=Zv();(rt!==t||Be!==n)&&(vu=null,ps(t,n)),n=!1;var y=yt;e:do try{if(We!==0&&Ue!==null){var S=Ue,C=gn;switch(We){case 8:Ef(),y=6;break e;case 3:case 2:case 9:case 6:hn.current===null&&(n=!0);var B=We;if(We=0,gn=null,gs(t,S,C,B),l&&fs){y=0;break e}break;default:B=We,We=0,gn=null,gs(t,S,C,B)}}fw(),y=yt;break}catch(Y){Lv(t,Y)}while(!0);return n&&t.shellSuspendCounter++,va=al=null,Ke=i,Q.H=d,Q.A=f,Ue===null&&(rt=null,Be=0,Bo()),y}function fw(){for(;Ue!==null;)qv(Ue)}function mw(t,n){var l=Ke;Ke|=2;var i=Bv(),d=Zv();rt!==t||Be!==n?(vu=null,gu=Gt()+500,ps(t,n)):fs=Ka(t,n);e:do try{if(We!==0&&Ue!==null){n=Ue;var f=gn;t:switch(We){case 1:We=0,gn=null,gs(t,n,f,1);break;case 2:case 9:if(Xp(f)){We=0,gn=null,Hv(n);break}n=function(){We!==2&&We!==9||rt!==t||(We=7),aa(t)},f.then(n,n);break e;case 3:We=7;break e;case 4:We=5;break e;case 7:Xp(f)?(We=0,gn=null,Hv(n)):(We=0,gn=null,gs(t,n,f,7));break;case 5:var y=null;switch(Ue.tag){case 26:y=Ue.memoizedState;case 5:case 27:var S=Ue;if(y?Cy(y):S.stateNode.complete){We=0,gn=null;var C=S.sibling;if(C!==null)Ue=C;else{var B=S.return;B!==null?(Ue=B,xu(B)):Ue=null}break t}}We=0,gn=null,gs(t,n,f,5);break;case 6:We=0,gn=null,gs(t,n,f,6);break;case 8:Ef(),yt=6;break e;default:throw Error(s(462))}}hw();break}catch(Y){Lv(t,Y)}while(!0);return va=al=null,Q.H=i,Q.A=d,Ke=l,Ue!==null?0:(rt=null,Be=0,Bo(),yt)}function hw(){for(;Ue!==null&&!Uc();)qv(Ue)}function qv(t){var n=dv(t.alternate,t,Ca);t.memoizedProps=t.pendingProps,n===null?xu(t):Ue=n}function Hv(t){var n=t,l=n.alternate;switch(n.tag){case 15:case 0:n=lv(l,n,n.pendingProps,n.type,void 0,Be);break;case 11:n=lv(l,n,n.pendingProps,n.type.render,n.ref,Be);break;case 5:Zd(n);default:mv(l,n),n=Ue=Zp(n,Ca),n=dv(l,n,Ca)}t.memoizedProps=t.pendingProps,n===null?xu(t):Ue=n}function gs(t,n,l,i){va=al=null,Zd(n),ls=null,gi=0;var d=n.return;try{if(nw(t,d,n,l,Be)){yt=1,iu(t,Cn(l,t.current)),Ue=null;return}}catch(f){if(d!==null)throw Ue=d,f;yt=1,iu(t,Cn(l,t.current)),Ue=null;return}n.flags&32768?(qe||i===1?t=!0:fs||(Be&536870912)!==0?t=!1:(ir=t=!0,(i===2||i===9||i===3||i===6)&&(i=hn.current,i!==null&&i.tag===13&&(i.flags|=16384))),Iv(n,t)):xu(n)}function xu(t){var n=t;do{if((n.flags&32768)!==0){Iv(n,ir);return}t=n.return;var l=lw(n.alternate,n,Ca);if(l!==null){Ue=l;return}if(n=n.sibling,n!==null){Ue=n;return}Ue=n=t}while(n!==null);yt===0&&(yt=5)}function Iv(t,n){do{var l=sw(t.alternate,t);if(l!==null){l.flags&=32767,Ue=l;return}if(l=t.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!n&&(t=t.sibling,t!==null)){Ue=t;return}Ue=t=l}while(t!==null);yt=6,Ue=null}function Qv(t,n,l,i,d,f,y,S,C){t.cancelPendingCommit=null;do Su();while(kt!==0);if((Ke&6)!==0)throw Error(s(327));if(n!==null){if(n===t.current)throw Error(s(177));if(f=n.lanes|n.childLanes,f|=md,Co(t,l,f,y,S,C),t===rt&&(Ue=rt=null,Be=0),hs=n,cr=t,Aa=l,jf=f,wf=d,Ov=i,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,yw(Ll,function(){return Yv(),null})):(t.callbackNode=null,t.callbackPriority=0),i=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||i){i=Q.T,Q.T=null,d=te.p,te.p=2,y=Ke,Ke|=4;try{iw(t,n,l)}finally{Ke=y,te.p=d,Q.T=i}}kt=1,Gv(),Pv(),Vv()}}function Gv(){if(kt===1){kt=0;var t=cr,n=hs,l=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||l){l=Q.T,Q.T=null;var i=te.p;te.p=2;var d=Ke;Ke|=4;try{Ev(n,t);var f=$f,y=Tp(t.containerInfo),S=f.focusedElem,C=f.selectionRange;if(y!==S&&S&&S.ownerDocument&&zp(S.ownerDocument.documentElement,S)){if(C!==null&&od(S)){var B=C.start,Y=C.end;if(Y===void 0&&(Y=B),"selectionStart"in S)S.selectionStart=B,S.selectionEnd=Math.min(Y,S.value.length);else{var J=S.ownerDocument||document,q=J&&J.defaultView||window;if(q.getSelection){var G=q.getSelection(),oe=S.textContent.length,Ee=Math.min(C.start,oe),at=C.end===void 0?Ee:Math.min(C.end,oe);!G.extend&&Ee>at&&(y=at,at=Ee,Ee=y);var U=kp(S,Ee),R=kp(S,at);if(U&&R&&(G.rangeCount!==1||G.anchorNode!==U.node||G.anchorOffset!==U.offset||G.focusNode!==R.node||G.focusOffset!==R.offset)){var $=J.createRange();$.setStart(U.node,U.offset),G.removeAllRanges(),Ee>at?(G.addRange($),G.extend(R.node,R.offset)):($.setEnd(R.node,R.offset),G.addRange($))}}}}for(J=[],G=S;G=G.parentNode;)G.nodeType===1&&J.push({element:G,left:G.scrollLeft,top:G.scrollTop});for(typeof S.focus=="function"&&S.focus(),S=0;S<J.length;S++){var X=J[S];X.element.scrollLeft=X.left,X.element.scrollTop=X.top}}Ou=!!Lf,$f=Lf=null}finally{Ke=d,te.p=i,Q.T=l}}t.current=n,kt=2}}function Pv(){if(kt===2){kt=0;var t=cr,n=hs,l=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||l){l=Q.T,Q.T=null;var i=te.p;te.p=2;var d=Ke;Ke|=4;try{xv(t,n.alternate,n)}finally{Ke=d,te.p=i,Q.T=l}}kt=3}}function Vv(){if(kt===4||kt===3){kt=0,So();var t=cr,n=hs,l=Aa,i=Ov;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?kt=5:(kt=0,hs=cr=null,Kv(t,t.pendingLanes));var d=t.pendingLanes;if(d===0&&(ur=null),Ic(l),n=n.stateNode,Pt&&typeof Pt.onCommitFiberRoot=="function")try{Pt.onCommitFiberRoot(Gr,n,void 0,(n.current.flags&128)===128)}catch{}if(i!==null){n=Q.T,d=te.p,te.p=2,Q.T=null;try{for(var f=t.onRecoverableError,y=0;y<i.length;y++){var S=i[y];f(S.value,{componentStack:S.stack})}}finally{Q.T=n,te.p=d}}(Aa&3)!==0&&Su(),aa(t),d=t.pendingLanes,(l&261930)!==0&&(d&42)!==0?t===Nf?Oi++:(Oi=0,Nf=t):Oi=0,Mi(0)}}function Kv(t,n){(t.pooledCacheLanes&=n)===0&&(n=t.pooledCache,n!=null&&(t.pooledCache=null,hi(n)))}function Su(){return Gv(),Pv(),Vv(),Yv()}function Yv(){if(kt!==5)return!1;var t=cr,n=jf;jf=0;var l=Ic(Aa),i=Q.T,d=te.p;try{te.p=32>l?32:l,Q.T=null,l=wf,wf=null;var f=cr,y=Aa;if(kt=0,hs=cr=null,Aa=0,(Ke&6)!==0)throw Error(s(331));var S=Ke;if(Ke|=4,zv(f.current),Cv(f,f.current,y,l),Ke=S,Mi(0,!1),Pt&&typeof Pt.onPostCommitFiberRoot=="function")try{Pt.onPostCommitFiberRoot(Gr,f)}catch{}return!0}finally{te.p=d,Q.T=i,Kv(t,n)}}function Fv(t,n,l){n=Cn(l,n),n=tf(t.stateNode,n,2),t=ar(t,n,2),t!==null&&(Kt(t,2),aa(t))}function et(t,n,l){if(t.tag===3)Fv(t,t,l);else for(;n!==null;){if(n.tag===3){Fv(n,t,l);break}else if(n.tag===1){var i=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(ur===null||!ur.has(i))){t=Cn(l,t),l=Xg(2),i=ar(n,l,2),i!==null&&(Jg(l,i,n,t),Kt(i,2),aa(i));break}}n=n.return}}function Cf(t,n,l){var i=t.pingCache;if(i===null){i=t.pingCache=new cw;var d=new Set;i.set(n,d)}else d=i.get(n),d===void 0&&(d=new Set,i.set(n,d));d.has(l)||(bf=!0,d.add(l),t=pw.bind(null,t,n,l),n.then(t,t))}function pw(t,n,l){var i=t.pingCache;i!==null&&i.delete(n),t.pingedLanes|=t.suspendedLanes&l,t.warmLanes&=~l,rt===t&&(Be&l)===l&&(yt===4||yt===3&&(Be&62914560)===Be&&300>Gt()-pu?(Ke&2)===0&&ps(t,0):xf|=l,ms===Be&&(ms=0)),aa(t)}function Xv(t,n){n===0&&(n=W()),t=el(t,n),t!==null&&(Kt(t,n),aa(t))}function gw(t){var n=t.memoizedState,l=0;n!==null&&(l=n.retryLane),Xv(t,l)}function vw(t,n){var l=0;switch(t.tag){case 31:case 13:var i=t.stateNode,d=t.memoizedState;d!==null&&(l=d.retryLane);break;case 19:i=t.stateNode;break;case 22:i=t.stateNode._retryCache;break;default:throw Error(s(314))}i!==null&&i.delete(n),Xv(t,l)}function yw(t,n){return Dl(t,n)}var ju=null,vs=null,Af=!1,wu=!1,kf=!1,fr=0;function aa(t){t!==vs&&t.next===null&&(vs===null?ju=vs=t:vs=vs.next=t),wu=!0,Af||(Af=!0,xw())}function Mi(t,n){if(!kf&&wu){kf=!0;do for(var l=!1,i=ju;i!==null;){if(t!==0){var d=i.pendingLanes;if(d===0)var f=0;else{var y=i.suspendedLanes,S=i.pingedLanes;f=(1<<31-Vt(42|t)+1)-1,f&=d&~(y&~S),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(l=!0,ty(i,f))}else f=Be,f=Yr(i,i===rt?f:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(f&3)===0||Ka(i,f)||(l=!0,ty(i,f));i=i.next}while(l);kf=!1}}function bw(){Jv()}function Jv(){wu=Af=!1;var t=0;fr!==0&&zw()&&(t=fr);for(var n=Gt(),l=null,i=ju;i!==null;){var d=i.next,f=Wv(i,n);f===0?(i.next=null,l===null?ju=d:l.next=d,d===null&&(vs=l)):(l=i,(t!==0||(f&3)!==0)&&(wu=!0)),i=d}kt!==0&&kt!==5||Mi(t),fr!==0&&(fr=0)}function Wv(t,n){for(var l=t.suspendedLanes,i=t.pingedLanes,d=t.expirationTimes,f=t.pendingLanes&-62914561;0<f;){var y=31-Vt(f),S=1<<y,C=d[y];C===-1?((S&l)===0||(S&i)!==0)&&(d[y]=_o(S,n)):C<=n&&(t.expiredLanes|=S),f&=~S}if(n=rt,l=Be,l=Yr(t,t===n?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i=t.callbackNode,l===0||t===n&&(We===2||We===9)||t.cancelPendingCommit!==null)return i!==null&&i!==null&&Ul(i),t.callbackNode=null,t.callbackPriority=0;if((l&3)===0||Ka(t,l)){if(n=l&-l,n===t.callbackPriority)return n;switch(i!==null&&Ul(i),Ic(l)){case 2:case 8:l=jo;break;case 32:l=Ll;break;case 268435456:l=ei;break;default:l=Ll}return i=ey.bind(null,t),l=Dl(l,i),t.callbackPriority=n,t.callbackNode=l,n}return i!==null&&i!==null&&Ul(i),t.callbackPriority=2,t.callbackNode=null,2}function ey(t,n){if(kt!==0&&kt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var l=t.callbackNode;if(Su()&&t.callbackNode!==l)return null;var i=Be;return i=Yr(t,t===rt?i:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i===0?null:(Dv(t,i,n),Wv(t,Gt()),t.callbackNode!=null&&t.callbackNode===l?ey.bind(null,t):null)}function ty(t,n){if(Su())return null;Dv(t,n,!0)}function xw(){Rw(function(){(Ke&6)!==0?Dl(Qr,bw):Jv()})}function zf(){if(fr===0){var t=ns;t===0&&(t=Pr,Pr<<=1,(Pr&261888)===0&&(Pr=256)),fr=t}return fr}function ny(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:To(""+t)}function ay(t,n){var l=n.ownerDocument.createElement("input");return l.name=n.name,l.value=n.value,t.id&&l.setAttribute("form",t.id),n.parentNode.insertBefore(l,n),t=new FormData(t),l.parentNode.removeChild(l),t}function Sw(t,n,l,i,d){if(n==="submit"&&l&&l.stateNode===d){var f=ny((d[en]||null).action),y=i.submitter;y&&(n=(n=y[en]||null)?ny(n.formAction):y.getAttribute("formAction"),n!==null&&(f=n,y=null));var S=new Do("action","action",null,i,d);t.push({event:S,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(fr!==0){var C=y?ay(d,y):new FormData(d);Yd(l,{pending:!0,data:C,method:d.method,action:f},null,C)}}else typeof f=="function"&&(S.preventDefault(),C=y?ay(d,y):new FormData(d),Yd(l,{pending:!0,data:C,method:d.method,action:f},f,C))},currentTarget:d}]})}}for(var Tf=0;Tf<fd.length;Tf++){var Rf=fd[Tf],jw=Rf.toLowerCase(),ww=Rf[0].toUpperCase()+Rf.slice(1);Gn(jw,"on"+ww)}Gn(Mp,"onAnimationEnd"),Gn(Dp,"onAnimationIteration"),Gn(Up,"onAnimationStart"),Gn("dblclick","onDoubleClick"),Gn("focusin","onFocus"),Gn("focusout","onBlur"),Gn(Bj,"onTransitionRun"),Gn(Zj,"onTransitionStart"),Gn(qj,"onTransitionCancel"),Gn(Lp,"onTransitionEnd"),Hl("onMouseEnter",["mouseout","mouseover"]),Hl("onMouseLeave",["mouseout","mouseover"]),Hl("onPointerEnter",["pointerout","pointerover"]),Hl("onPointerLeave",["pointerout","pointerover"]),Fr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Fr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Fr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Fr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Fr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Fr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Di="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(" "),Nw=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Di));function ry(t,n){n=(n&4)!==0;for(var l=0;l<t.length;l++){var i=t[l],d=i.event;i=i.listeners;e:{var f=void 0;if(n)for(var y=i.length-1;0<=y;y--){var S=i[y],C=S.instance,B=S.currentTarget;if(S=S.listener,C!==f&&d.isPropagationStopped())break e;f=S,d.currentTarget=B;try{f(d)}catch(Y){$o(Y)}d.currentTarget=null,f=C}else for(y=0;y<i.length;y++){if(S=i[y],C=S.instance,B=S.currentTarget,S=S.listener,C!==f&&d.isPropagationStopped())break e;f=S,d.currentTarget=B;try{f(d)}catch(Y){$o(Y)}d.currentTarget=null,f=C}}}}function Le(t,n){var l=n[Qc];l===void 0&&(l=n[Qc]=new Set);var i=t+"__bubble";l.has(i)||(ly(n,t,2,!1),l.add(i))}function Of(t,n,l){var i=0;n&&(i|=4),ly(l,t,i,n)}var Nu="_reactListening"+Math.random().toString(36).slice(2);function Mf(t){if(!t[Nu]){t[Nu]=!0,Jh.forEach(function(l){l!=="selectionchange"&&(Nw.has(l)||Of(l,!1,t),Of(l,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[Nu]||(n[Nu]=!0,Of("selectionchange",!1,n))}}function ly(t,n,l,i){switch(My(n)){case 2:var d=Jw;break;case 8:d=Ww;break;default:d=Yf}l=d.bind(null,n,l,t),d=void 0,!Wc||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(d=!0),i?d!==void 0?t.addEventListener(n,l,{capture:!0,passive:d}):t.addEventListener(n,l,!0):d!==void 0?t.addEventListener(n,l,{passive:d}):t.addEventListener(n,l,!1)}function Df(t,n,l,i,d){var f=i;if((n&1)===0&&(n&2)===0&&i!==null)e:for(;;){if(i===null)return;var y=i.tag;if(y===3||y===4){var S=i.stateNode.containerInfo;if(S===d)break;if(y===4)for(y=i.return;y!==null;){var C=y.tag;if((C===3||C===4)&&y.stateNode.containerInfo===d)return;y=y.return}for(;S!==null;){if(y=Bl(S),y===null)return;if(C=y.tag,C===5||C===6||C===26||C===27){i=f=y;continue e}S=S.parentNode}}i=i.return}cp(function(){var B=f,Y=Xc(l),J=[];e:{var q=$p.get(t);if(q!==void 0){var G=Do,oe=t;switch(t){case"keypress":if(Oo(l)===0)break e;case"keydown":case"keyup":G=vj;break;case"focusin":oe="focus",G=ad;break;case"focusout":oe="blur",G=ad;break;case"beforeblur":case"afterblur":G=ad;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":G=mp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":G=lj;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":G=xj;break;case Mp:case Dp:case Up:G=oj;break;case Lp:G=jj;break;case"scroll":case"scrollend":G=aj;break;case"wheel":G=Nj;break;case"copy":case"cut":case"paste":G=cj;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":G=pp;break;case"toggle":case"beforetoggle":G=_j}var Ee=(n&4)!==0,at=!Ee&&(t==="scroll"||t==="scrollend"),U=Ee?q!==null?q+"Capture":null:q;Ee=[];for(var R=B,$;R!==null;){var X=R;if($=X.stateNode,X=X.tag,X!==5&&X!==26&&X!==27||$===null||U===null||(X=ai(R,U),X!=null&&Ee.push(Ui(R,X,$))),at)break;R=R.return}0<Ee.length&&(q=new G(q,oe,null,l,Y),J.push({event:q,listeners:Ee}))}}if((n&7)===0){e:{if(q=t==="mouseover"||t==="pointerover",G=t==="mouseout"||t==="pointerout",q&&l!==Fc&&(oe=l.relatedTarget||l.fromElement)&&(Bl(oe)||oe[$l]))break e;if((G||q)&&(q=Y.window===Y?Y:(q=Y.ownerDocument)?q.defaultView||q.parentWindow:window,G?(oe=l.relatedTarget||l.toElement,G=B,oe=oe?Bl(oe):null,oe!==null&&(at=c(oe),Ee=oe.tag,oe!==at||Ee!==5&&Ee!==27&&Ee!==6)&&(oe=null)):(G=null,oe=B),G!==oe)){if(Ee=mp,X="onMouseLeave",U="onMouseEnter",R="mouse",(t==="pointerout"||t==="pointerover")&&(Ee=pp,X="onPointerLeave",U="onPointerEnter",R="pointer"),at=G==null?q:ni(G),$=oe==null?q:ni(oe),q=new Ee(X,R+"leave",G,l,Y),q.target=at,q.relatedTarget=$,X=null,Bl(Y)===B&&(Ee=new Ee(U,R+"enter",oe,l,Y),Ee.target=$,Ee.relatedTarget=at,X=Ee),at=X,G&&oe)t:{for(Ee=Ew,U=G,R=oe,$=0,X=U;X;X=Ee(X))$++;X=0;for(var be=R;be;be=Ee(be))X++;for(;0<$-X;)U=Ee(U),$--;for(;0<X-$;)R=Ee(R),X--;for(;$--;){if(U===R||R!==null&&U===R.alternate){Ee=U;break t}U=Ee(U),R=Ee(R)}Ee=null}else Ee=null;G!==null&&sy(J,q,G,Ee,!1),oe!==null&&at!==null&&sy(J,at,oe,Ee,!0)}}e:{if(q=B?ni(B):window,G=q.nodeName&&q.nodeName.toLowerCase(),G==="select"||G==="input"&&q.type==="file")var Ge=wp;else if(Sp(q))if(Np)Ge=Uj;else{Ge=Mj;var me=Oj}else G=q.nodeName,!G||G.toLowerCase()!=="input"||q.type!=="checkbox"&&q.type!=="radio"?B&&Yc(B.elementType)&&(Ge=wp):Ge=Dj;if(Ge&&(Ge=Ge(t,B))){jp(J,Ge,l,Y);break e}me&&me(t,q,B),t==="focusout"&&B&&q.type==="number"&&B.memoizedProps.value!=null&&Kc(q,"number",q.value)}switch(me=B?ni(B):window,t){case"focusin":(Sp(me)||me.contentEditable==="true")&&(Kl=me,ud=B,di=null);break;case"focusout":di=ud=Kl=null;break;case"mousedown":cd=!0;break;case"contextmenu":case"mouseup":case"dragend":cd=!1,Rp(J,l,Y);break;case"selectionchange":if($j)break;case"keydown":case"keyup":Rp(J,l,Y)}var Re;if(ld)e:{switch(t){case"compositionstart":var Ze="onCompositionStart";break e;case"compositionend":Ze="onCompositionEnd";break e;case"compositionupdate":Ze="onCompositionUpdate";break e}Ze=void 0}else Vl?bp(t,l)&&(Ze="onCompositionEnd"):t==="keydown"&&l.keyCode===229&&(Ze="onCompositionStart");Ze&&(gp&&l.locale!=="ko"&&(Vl||Ze!=="onCompositionStart"?Ze==="onCompositionEnd"&&Vl&&(Re=dp()):(Fa=Y,ed="value"in Fa?Fa.value:Fa.textContent,Vl=!0)),me=Eu(B,Ze),0<me.length&&(Ze=new hp(Ze,t,null,l,Y),J.push({event:Ze,listeners:me}),Re?Ze.data=Re:(Re=xp(l),Re!==null&&(Ze.data=Re)))),(Re=Aj?kj(t,l):zj(t,l))&&(Ze=Eu(B,"onBeforeInput"),0<Ze.length&&(me=new hp("onBeforeInput","beforeinput",null,l,Y),J.push({event:me,listeners:Ze}),me.data=Re)),Sw(J,t,B,l,Y)}ry(J,n)})}function Ui(t,n,l){return{instance:t,listener:n,currentTarget:l}}function Eu(t,n){for(var l=n+"Capture",i=[];t!==null;){var d=t,f=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||f===null||(d=ai(t,l),d!=null&&i.unshift(Ui(t,d,f)),d=ai(t,n),d!=null&&i.push(Ui(t,d,f))),t.tag===3)return i;t=t.return}return[]}function Ew(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function sy(t,n,l,i,d){for(var f=n._reactName,y=[];l!==null&&l!==i;){var S=l,C=S.alternate,B=S.stateNode;if(S=S.tag,C!==null&&C===i)break;S!==5&&S!==26&&S!==27||B===null||(C=B,d?(B=ai(l,f),B!=null&&y.unshift(Ui(l,B,C))):d||(B=ai(l,f),B!=null&&y.push(Ui(l,B,C)))),l=l.return}y.length!==0&&t.push({event:n,listeners:y})}var _w=/\r\n?/g,Cw=/\u0000|\uFFFD/g;function iy(t){return(typeof t=="string"?t:""+t).replace(_w,`
|
|
49
|
+
`).replace(Cw,"")}function oy(t,n){return n=iy(n),iy(t)===n}function nt(t,n,l,i,d,f){switch(l){case"children":typeof i=="string"?n==="body"||n==="textarea"&&i===""||Ql(t,i):(typeof i=="number"||typeof i=="bigint")&&n!=="body"&&Ql(t,""+i);break;case"className":ko(t,"class",i);break;case"tabIndex":ko(t,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":ko(t,l,i);break;case"style":op(t,i,f);break;case"data":if(n!=="object"){ko(t,"data",i);break}case"src":case"href":if(i===""&&(n!=="a"||l!=="href")){t.removeAttribute(l);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){t.removeAttribute(l);break}i=To(""+i),t.setAttribute(l,i);break;case"action":case"formAction":if(typeof i=="function"){t.setAttribute(l,"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 f=="function"&&(l==="formAction"?(n!=="input"&&nt(t,n,"name",d.name,d,null),nt(t,n,"formEncType",d.formEncType,d,null),nt(t,n,"formMethod",d.formMethod,d,null),nt(t,n,"formTarget",d.formTarget,d,null)):(nt(t,n,"encType",d.encType,d,null),nt(t,n,"method",d.method,d,null),nt(t,n,"target",d.target,d,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){t.removeAttribute(l);break}i=To(""+i),t.setAttribute(l,i);break;case"onClick":i!=null&&(t.onclick=ma);break;case"onScroll":i!=null&&Le("scroll",t);break;case"onScrollEnd":i!=null&&Le("scrollend",t);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(s(61));if(l=i.__html,l!=null){if(d.children!=null)throw Error(s(60));t.innerHTML=l}}break;case"multiple":t.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":t.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){t.removeAttribute("xlink:href");break}l=To(""+i),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(l,""+i):t.removeAttribute(l);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":i&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(l,""):t.removeAttribute(l);break;case"capture":case"download":i===!0?t.setAttribute(l,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(l,i):t.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?t.setAttribute(l,i):t.removeAttribute(l);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?t.removeAttribute(l):t.setAttribute(l,i);break;case"popover":Le("beforetoggle",t),Le("toggle",t),Ao(t,"popover",i);break;case"xlinkActuate":fa(t,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":fa(t,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":fa(t,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":fa(t,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":fa(t,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":fa(t,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":fa(t,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":fa(t,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":fa(t,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":Ao(t,"is",i);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=tj.get(l)||l,Ao(t,l,i))}}function Uf(t,n,l,i,d,f){switch(l){case"style":op(t,i,f);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(s(61));if(l=i.__html,l!=null){if(d.children!=null)throw Error(s(60));t.innerHTML=l}}break;case"children":typeof i=="string"?Ql(t,i):(typeof i=="number"||typeof i=="bigint")&&Ql(t,""+i);break;case"onScroll":i!=null&&Le("scroll",t);break;case"onScrollEnd":i!=null&&Le("scrollend",t);break;case"onClick":i!=null&&(t.onclick=ma);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Wh.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(d=l.endsWith("Capture"),n=l.slice(2,d?l.length-7:void 0),f=t[en]||null,f=f!=null?f[l]:null,typeof f=="function"&&t.removeEventListener(n,f,d),typeof i=="function")){typeof f!="function"&&f!==null&&(l in t?t[l]=null:t.hasAttribute(l)&&t.removeAttribute(l)),t.addEventListener(n,i,d);break e}l in t?t[l]=i:i===!0?t.setAttribute(l,""):Ao(t,l,i)}}}function Zt(t,n,l){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Le("error",t),Le("load",t);var i=!1,d=!1,f;for(f in l)if(l.hasOwnProperty(f)){var y=l[f];if(y!=null)switch(f){case"src":i=!0;break;case"srcSet":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,n));default:nt(t,n,f,y,l,null)}}d&&nt(t,n,"srcSet",l.srcSet,l,null),i&&nt(t,n,"src",l.src,l,null);return;case"input":Le("invalid",t);var S=f=y=d=null,C=null,B=null;for(i in l)if(l.hasOwnProperty(i)){var Y=l[i];if(Y!=null)switch(i){case"name":d=Y;break;case"type":y=Y;break;case"checked":C=Y;break;case"defaultChecked":B=Y;break;case"value":f=Y;break;case"defaultValue":S=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(s(137,n));break;default:nt(t,n,i,Y,l,null)}}rp(t,f,S,C,B,y,d,!1);return;case"select":Le("invalid",t),i=y=f=null;for(d in l)if(l.hasOwnProperty(d)&&(S=l[d],S!=null))switch(d){case"value":f=S;break;case"defaultValue":y=S;break;case"multiple":i=S;default:nt(t,n,d,S,l,null)}n=f,l=y,t.multiple=!!i,n!=null?Il(t,!!i,n,!1):l!=null&&Il(t,!!i,l,!0);return;case"textarea":Le("invalid",t),f=d=i=null;for(y in l)if(l.hasOwnProperty(y)&&(S=l[y],S!=null))switch(y){case"value":i=S;break;case"defaultValue":d=S;break;case"children":f=S;break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(s(91));break;default:nt(t,n,y,S,l,null)}sp(t,i,d,f);return;case"option":for(C in l)if(l.hasOwnProperty(C)&&(i=l[C],i!=null))switch(C){case"selected":t.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:nt(t,n,C,i,l,null)}return;case"dialog":Le("beforetoggle",t),Le("toggle",t),Le("cancel",t),Le("close",t);break;case"iframe":case"object":Le("load",t);break;case"video":case"audio":for(i=0;i<Di.length;i++)Le(Di[i],t);break;case"image":Le("error",t),Le("load",t);break;case"details":Le("toggle",t);break;case"embed":case"source":case"link":Le("error",t),Le("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(B in l)if(l.hasOwnProperty(B)&&(i=l[B],i!=null))switch(B){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,n));default:nt(t,n,B,i,l,null)}return;default:if(Yc(n)){for(Y in l)l.hasOwnProperty(Y)&&(i=l[Y],i!==void 0&&Uf(t,n,Y,i,l,void 0));return}}for(S in l)l.hasOwnProperty(S)&&(i=l[S],i!=null&&nt(t,n,S,i,l,null))}function Aw(t,n,l,i){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var d=null,f=null,y=null,S=null,C=null,B=null,Y=null;for(G in l){var J=l[G];if(l.hasOwnProperty(G)&&J!=null)switch(G){case"checked":break;case"value":break;case"defaultValue":C=J;default:i.hasOwnProperty(G)||nt(t,n,G,null,i,J)}}for(var q in i){var G=i[q];if(J=l[q],i.hasOwnProperty(q)&&(G!=null||J!=null))switch(q){case"type":f=G;break;case"name":d=G;break;case"checked":B=G;break;case"defaultChecked":Y=G;break;case"value":y=G;break;case"defaultValue":S=G;break;case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(s(137,n));break;default:G!==J&&nt(t,n,q,G,i,J)}}Vc(t,y,S,C,B,Y,f,d);return;case"select":G=y=S=q=null;for(f in l)if(C=l[f],l.hasOwnProperty(f)&&C!=null)switch(f){case"value":break;case"multiple":G=C;default:i.hasOwnProperty(f)||nt(t,n,f,null,i,C)}for(d in i)if(f=i[d],C=l[d],i.hasOwnProperty(d)&&(f!=null||C!=null))switch(d){case"value":q=f;break;case"defaultValue":S=f;break;case"multiple":y=f;default:f!==C&&nt(t,n,d,f,i,C)}n=S,l=y,i=G,q!=null?Il(t,!!l,q,!1):!!i!=!!l&&(n!=null?Il(t,!!l,n,!0):Il(t,!!l,l?[]:"",!1));return;case"textarea":G=q=null;for(S in l)if(d=l[S],l.hasOwnProperty(S)&&d!=null&&!i.hasOwnProperty(S))switch(S){case"value":break;case"children":break;default:nt(t,n,S,null,i,d)}for(y in i)if(d=i[y],f=l[y],i.hasOwnProperty(y)&&(d!=null||f!=null))switch(y){case"value":q=d;break;case"defaultValue":G=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(s(91));break;default:d!==f&&nt(t,n,y,d,i,f)}lp(t,q,G);return;case"option":for(var oe in l)if(q=l[oe],l.hasOwnProperty(oe)&&q!=null&&!i.hasOwnProperty(oe))switch(oe){case"selected":t.selected=!1;break;default:nt(t,n,oe,null,i,q)}for(C in i)if(q=i[C],G=l[C],i.hasOwnProperty(C)&&q!==G&&(q!=null||G!=null))switch(C){case"selected":t.selected=q&&typeof q!="function"&&typeof q!="symbol";break;default:nt(t,n,C,q,i,G)}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 Ee in l)q=l[Ee],l.hasOwnProperty(Ee)&&q!=null&&!i.hasOwnProperty(Ee)&&nt(t,n,Ee,null,i,q);for(B in i)if(q=i[B],G=l[B],i.hasOwnProperty(B)&&q!==G&&(q!=null||G!=null))switch(B){case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(s(137,n));break;default:nt(t,n,B,q,i,G)}return;default:if(Yc(n)){for(var at in l)q=l[at],l.hasOwnProperty(at)&&q!==void 0&&!i.hasOwnProperty(at)&&Uf(t,n,at,void 0,i,q);for(Y in i)q=i[Y],G=l[Y],!i.hasOwnProperty(Y)||q===G||q===void 0&&G===void 0||Uf(t,n,Y,q,i,G);return}}for(var U in l)q=l[U],l.hasOwnProperty(U)&&q!=null&&!i.hasOwnProperty(U)&&nt(t,n,U,null,i,q);for(J in i)q=i[J],G=l[J],!i.hasOwnProperty(J)||q===G||q==null&&G==null||nt(t,n,J,q,i,G)}function uy(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function kw(){if(typeof performance.getEntriesByType=="function"){for(var t=0,n=0,l=performance.getEntriesByType("resource"),i=0;i<l.length;i++){var d=l[i],f=d.transferSize,y=d.initiatorType,S=d.duration;if(f&&S&&uy(y)){for(y=0,S=d.responseEnd,i+=1;i<l.length;i++){var C=l[i],B=C.startTime;if(B>S)break;var Y=C.transferSize,J=C.initiatorType;Y&&uy(J)&&(C=C.responseEnd,y+=Y*(C<S?1:(S-B)/(C-B)))}if(--i,n+=8*(f+y)/(d.duration/1e3),t++,10<t)break}}if(0<t)return n/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Lf=null,$f=null;function _u(t){return t.nodeType===9?t:t.ownerDocument}function cy(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function dy(t,n){if(t===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&n==="foreignObject"?0:t}function Bf(t,n){return t==="textarea"||t==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Zf=null;function zw(){var t=window.event;return t&&t.type==="popstate"?t===Zf?!1:(Zf=t,!0):(Zf=null,!1)}var fy=typeof setTimeout=="function"?setTimeout:void 0,Tw=typeof clearTimeout=="function"?clearTimeout:void 0,my=typeof Promise=="function"?Promise:void 0,Rw=typeof queueMicrotask=="function"?queueMicrotask:typeof my<"u"?function(t){return my.resolve(null).then(t).catch(Ow)}:fy;function Ow(t){setTimeout(function(){throw t})}function mr(t){return t==="head"}function hy(t,n){var l=n,i=0;do{var d=l.nextSibling;if(t.removeChild(l),d&&d.nodeType===8)if(l=d.data,l==="/$"||l==="/&"){if(i===0){t.removeChild(d),Ss(n);return}i--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")i++;else if(l==="html")Li(t.ownerDocument.documentElement);else if(l==="head"){l=t.ownerDocument.head,Li(l);for(var f=l.firstChild;f;){var y=f.nextSibling,S=f.nodeName;f[ti]||S==="SCRIPT"||S==="STYLE"||S==="LINK"&&f.rel.toLowerCase()==="stylesheet"||l.removeChild(f),f=y}}else l==="body"&&Li(t.ownerDocument.body);l=d}while(l);Ss(n)}function py(t,n){var l=t;t=0;do{var i=l.nextSibling;if(l.nodeType===1?n?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(n?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),i&&i.nodeType===8)if(l=i.data,l==="/$"){if(t===0)break;t--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||t++;l=i}while(l)}function qf(t){var n=t.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var l=n;switch(n=n.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":qf(l),Gc(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}t.removeChild(l)}}function Mw(t,n,l,i){for(;t.nodeType===1;){var d=l;if(t.nodeName.toLowerCase()!==n.toLowerCase()){if(!i&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(i){if(!t[ti])switch(n){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(f=t.getAttribute("rel"),f==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(f!==d.rel||t.getAttribute("href")!==(d.href==null||d.href===""?null:d.href)||t.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin)||t.getAttribute("title")!==(d.title==null?null:d.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(f=t.getAttribute("src"),(f!==(d.src==null?null:d.src)||t.getAttribute("type")!==(d.type==null?null:d.type)||t.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&f&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(n==="input"&&t.type==="hidden"){var f=d.name==null?null:""+d.name;if(d.type==="hidden"&&t.getAttribute("name")===f)return t}else return t;if(t=Rn(t.nextSibling),t===null)break}return null}function Dw(t,n,l){if(n==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!l||(t=Rn(t.nextSibling),t===null))return null;return t}function gy(t,n){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=Rn(t.nextSibling),t===null))return null;return t}function Hf(t){return t.data==="$?"||t.data==="$~"}function If(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function Uw(t,n){var l=t.ownerDocument;if(t.data==="$~")t._reactRetry=n;else if(t.data!=="$?"||l.readyState!=="loading")n();else{var i=function(){n(),l.removeEventListener("DOMContentLoaded",i)};l.addEventListener("DOMContentLoaded",i),t._reactRetry=i}}function Rn(t){for(;t!=null;t=t.nextSibling){var n=t.nodeType;if(n===1||n===3)break;if(n===8){if(n=t.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return t}var Qf=null;function vy(t){t=t.nextSibling;for(var n=0;t;){if(t.nodeType===8){var l=t.data;if(l==="/$"||l==="/&"){if(n===0)return Rn(t.nextSibling);n--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||n++}t=t.nextSibling}return null}function yy(t){t=t.previousSibling;for(var n=0;t;){if(t.nodeType===8){var l=t.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(n===0)return t;n--}else l!=="/$"&&l!=="/&"||n++}t=t.previousSibling}return null}function by(t,n,l){switch(n=_u(l),t){case"html":if(t=n.documentElement,!t)throw Error(s(452));return t;case"head":if(t=n.head,!t)throw Error(s(453));return t;case"body":if(t=n.body,!t)throw Error(s(454));return t;default:throw Error(s(451))}}function Li(t){for(var n=t.attributes;n.length;)t.removeAttributeNode(n[0]);Gc(t)}var On=new Map,xy=new Set;function Cu(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var ka=te.d;te.d={f:Lw,r:$w,D:Bw,C:Zw,L:qw,m:Hw,X:Qw,S:Iw,M:Gw};function Lw(){var t=ka.f(),n=yu();return t||n}function $w(t){var n=Zl(t);n!==null&&n.tag===5&&n.type==="form"?Lg(n):ka.r(t)}var ys=typeof document>"u"?null:document;function Sy(t,n,l){var i=ys;if(i&&typeof n=="string"&&n){var d=En(n);d='link[rel="'+t+'"][href="'+d+'"]',typeof l=="string"&&(d+='[crossorigin="'+l+'"]'),xy.has(d)||(xy.add(d),t={rel:t,crossOrigin:l,href:n},i.querySelector(d)===null&&(n=i.createElement("link"),Zt(n,"link",t),Rt(n),i.head.appendChild(n)))}}function Bw(t){ka.D(t),Sy("dns-prefetch",t,null)}function Zw(t,n){ka.C(t,n),Sy("preconnect",t,n)}function qw(t,n,l){ka.L(t,n,l);var i=ys;if(i&&t&&n){var d='link[rel="preload"][as="'+En(n)+'"]';n==="image"&&l&&l.imageSrcSet?(d+='[imagesrcset="'+En(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(d+='[imagesizes="'+En(l.imageSizes)+'"]')):d+='[href="'+En(t)+'"]';var f=d;switch(n){case"style":f=bs(t);break;case"script":f=xs(t)}On.has(f)||(t=x({rel:"preload",href:n==="image"&&l&&l.imageSrcSet?void 0:t,as:n},l),On.set(f,t),i.querySelector(d)!==null||n==="style"&&i.querySelector($i(f))||n==="script"&&i.querySelector(Bi(f))||(n=i.createElement("link"),Zt(n,"link",t),Rt(n),i.head.appendChild(n)))}}function Hw(t,n){ka.m(t,n);var l=ys;if(l&&t){var i=n&&typeof n.as=="string"?n.as:"script",d='link[rel="modulepreload"][as="'+En(i)+'"][href="'+En(t)+'"]',f=d;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=xs(t)}if(!On.has(f)&&(t=x({rel:"modulepreload",href:t},n),On.set(f,t),l.querySelector(d)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Bi(f)))return}i=l.createElement("link"),Zt(i,"link",t),Rt(i),l.head.appendChild(i)}}}function Iw(t,n,l){ka.S(t,n,l);var i=ys;if(i&&t){var d=ql(i).hoistableStyles,f=bs(t);n=n||"default";var y=d.get(f);if(!y){var S={loading:0,preload:null};if(y=i.querySelector($i(f)))S.loading=5;else{t=x({rel:"stylesheet",href:t,"data-precedence":n},l),(l=On.get(f))&&Gf(t,l);var C=y=i.createElement("link");Rt(C),Zt(C,"link",t),C._p=new Promise(function(B,Y){C.onload=B,C.onerror=Y}),C.addEventListener("load",function(){S.loading|=1}),C.addEventListener("error",function(){S.loading|=2}),S.loading|=4,Au(y,n,i)}y={type:"stylesheet",instance:y,count:1,state:S},d.set(f,y)}}}function Qw(t,n){ka.X(t,n);var l=ys;if(l&&t){var i=ql(l).hoistableScripts,d=xs(t),f=i.get(d);f||(f=l.querySelector(Bi(d)),f||(t=x({src:t,async:!0},n),(n=On.get(d))&&Pf(t,n),f=l.createElement("script"),Rt(f),Zt(f,"link",t),l.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},i.set(d,f))}}function Gw(t,n){ka.M(t,n);var l=ys;if(l&&t){var i=ql(l).hoistableScripts,d=xs(t),f=i.get(d);f||(f=l.querySelector(Bi(d)),f||(t=x({src:t,async:!0,type:"module"},n),(n=On.get(d))&&Pf(t,n),f=l.createElement("script"),Rt(f),Zt(f,"link",t),l.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},i.set(d,f))}}function jy(t,n,l,i){var d=(d=ne.current)?Cu(d):null;if(!d)throw Error(s(446));switch(t){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(n=bs(l.href),l=ql(d).hoistableStyles,i=l.get(n),i||(i={type:"style",instance:null,count:0,state:null},l.set(n,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){t=bs(l.href);var f=ql(d).hoistableStyles,y=f.get(t);if(y||(d=d.ownerDocument||d,y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(t,y),(f=d.querySelector($i(t)))&&!f._p&&(y.instance=f,y.state.loading=5),On.has(t)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},On.set(t,l),f||Pw(d,t,l,y.state))),n&&i===null)throw Error(s(528,""));return y}if(n&&i!==null)throw Error(s(529,""));return null;case"script":return n=l.async,l=l.src,typeof l=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=xs(l),l=ql(d).hoistableScripts,i=l.get(n),i||(i={type:"script",instance:null,count:0,state:null},l.set(n,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,t))}}function bs(t){return'href="'+En(t)+'"'}function $i(t){return'link[rel="stylesheet"]['+t+"]"}function wy(t){return x({},t,{"data-precedence":t.precedence,precedence:null})}function Pw(t,n,l,i){t.querySelector('link[rel="preload"][as="style"]['+n+"]")?i.loading=1:(n=t.createElement("link"),i.preload=n,n.addEventListener("load",function(){return i.loading|=1}),n.addEventListener("error",function(){return i.loading|=2}),Zt(n,"link",l),Rt(n),t.head.appendChild(n))}function xs(t){return'[src="'+En(t)+'"]'}function Bi(t){return"script[async]"+t}function Ny(t,n,l){if(n.count++,n.instance===null)switch(n.type){case"style":var i=t.querySelector('style[data-href~="'+En(l.href)+'"]');if(i)return n.instance=i,Rt(i),i;var d=x({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return i=(t.ownerDocument||t).createElement("style"),Rt(i),Zt(i,"style",d),Au(i,l.precedence,t),n.instance=i;case"stylesheet":d=bs(l.href);var f=t.querySelector($i(d));if(f)return n.state.loading|=4,n.instance=f,Rt(f),f;i=wy(l),(d=On.get(d))&&Gf(i,d),f=(t.ownerDocument||t).createElement("link"),Rt(f);var y=f;return y._p=new Promise(function(S,C){y.onload=S,y.onerror=C}),Zt(f,"link",i),n.state.loading|=4,Au(f,l.precedence,t),n.instance=f;case"script":return f=xs(l.src),(d=t.querySelector(Bi(f)))?(n.instance=d,Rt(d),d):(i=l,(d=On.get(f))&&(i=x({},l),Pf(i,d)),t=t.ownerDocument||t,d=t.createElement("script"),Rt(d),Zt(d,"link",i),t.head.appendChild(d),n.instance=d);case"void":return null;default:throw Error(s(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(i=n.instance,n.state.loading|=4,Au(i,l.precedence,t));return n.instance}function Au(t,n,l){for(var i=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=i.length?i[i.length-1]:null,f=d,y=0;y<i.length;y++){var S=i[y];if(S.dataset.precedence===n)f=S;else if(f!==d)break}f?f.parentNode.insertBefore(t,f.nextSibling):(n=l.nodeType===9?l.head:l,n.insertBefore(t,n.firstChild))}function Gf(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.title==null&&(t.title=n.title)}function Pf(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.integrity==null&&(t.integrity=n.integrity)}var ku=null;function Ey(t,n,l){if(ku===null){var i=new Map,d=ku=new Map;d.set(l,i)}else d=ku,i=d.get(l),i||(i=new Map,d.set(l,i));if(i.has(t))return i;for(i.set(t,null),l=l.getElementsByTagName(t),d=0;d<l.length;d++){var f=l[d];if(!(f[ti]||f[Ut]||t==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var y=f.getAttribute(n)||"";y=t+y;var S=i.get(y);S?S.push(f):i.set(y,[f])}}return i}function _y(t,n,l){t=t.ownerDocument||t,t.head.insertBefore(l,n==="title"?t.querySelector("head > title"):null)}function Vw(t,n,l){if(l===1||n.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;switch(n.rel){case"stylesheet":return t=n.disabled,typeof n.precedence=="string"&&t==null;default:return!0}case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function Cy(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function Kw(t,n,l,i){if(l.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var d=bs(i.href),f=n.querySelector($i(d));if(f){n=f._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=zu.bind(t),n.then(t,t)),l.state.loading|=4,l.instance=f,Rt(f);return}f=n.ownerDocument||n,i=wy(i),(d=On.get(d))&&Gf(i,d),f=f.createElement("link"),Rt(f);var y=f;y._p=new Promise(function(S,C){y.onload=S,y.onerror=C}),Zt(f,"link",i),l.instance=f}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(l,n),(n=l.state.preload)&&(l.state.loading&3)===0&&(t.count++,l=zu.bind(t),n.addEventListener("load",l),n.addEventListener("error",l))}}var Vf=0;function Yw(t,n){return t.stylesheets&&t.count===0&&Ru(t,t.stylesheets),0<t.count||0<t.imgCount?function(l){var i=setTimeout(function(){if(t.stylesheets&&Ru(t,t.stylesheets),t.unsuspend){var f=t.unsuspend;t.unsuspend=null,f()}},6e4+n);0<t.imgBytes&&Vf===0&&(Vf=62500*kw());var d=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Ru(t,t.stylesheets),t.unsuspend)){var f=t.unsuspend;t.unsuspend=null,f()}},(t.imgBytes>Vf?50:800)+n);return t.unsuspend=l,function(){t.unsuspend=null,clearTimeout(i),clearTimeout(d)}}:null}function zu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ru(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Tu=null;function Ru(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Tu=new Map,n.forEach(Fw,t),Tu=null,zu.call(t))}function Fw(t,n){if(!(n.state.loading&4)){var l=Tu.get(t);if(l)var i=l.get(null);else{l=new Map,Tu.set(t,l);for(var d=t.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<d.length;f++){var y=d[f];(y.nodeName==="LINK"||y.getAttribute("media")!=="not all")&&(l.set(y.dataset.precedence,y),i=y)}i&&l.set(null,i)}d=n.instance,y=d.getAttribute("data-precedence"),f=l.get(y)||i,f===i&&l.set(null,d),l.set(y,d),this.count++,i=zu.bind(this),d.addEventListener("load",i),d.addEventListener("error",i),f?f.parentNode.insertBefore(d,f.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(d,t.firstChild)),n.state.loading|=4}}var Zi={$$typeof:D,Provider:null,Consumer:null,_currentValue:ce,_currentValue2:ce,_threadCount:0};function Xw(t,n,l,i,d,f,y,S,C){this.tag=1,this.containerInfo=t,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=$e(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=$e(0),this.hiddenUpdates=$e(null),this.identifierPrefix=i,this.onUncaughtError=d,this.onCaughtError=f,this.onRecoverableError=y,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=C,this.incompleteTransitions=new Map}function Ay(t,n,l,i,d,f,y,S,C,B,Y,J){return t=new Xw(t,n,l,y,C,B,Y,J,S),n=1,f===!0&&(n|=24),f=mn(3,null,null,n),t.current=f,f.stateNode=t,n=Ed(),n.refCount++,t.pooledCache=n,n.refCount++,f.memoizedState={element:i,isDehydrated:l,cache:n},kd(f),t}function ky(t){return t?(t=Xl,t):Xl}function zy(t,n,l,i,d,f){d=ky(d),i.context===null?i.context=d:i.pendingContext=d,i=nr(n),i.payload={element:l},f=f===void 0?null:f,f!==null&&(i.callback=f),l=ar(t,i,n),l!==null&&(sn(l,t,n),yi(l,t,n))}function Ty(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var l=t.retryLane;t.retryLane=l!==0&&l<n?l:n}}function Kf(t,n){Ty(t,n),(t=t.alternate)&&Ty(t,n)}function Ry(t){if(t.tag===13||t.tag===31){var n=el(t,67108864);n!==null&&sn(n,t,67108864),Kf(t,67108864)}}function Oy(t){if(t.tag===13||t.tag===31){var n=yn();n=Hc(n);var l=el(t,n);l!==null&&sn(l,t,n),Kf(t,n)}}var Ou=!0;function Jw(t,n,l,i){var d=Q.T;Q.T=null;var f=te.p;try{te.p=2,Yf(t,n,l,i)}finally{te.p=f,Q.T=d}}function Ww(t,n,l,i){var d=Q.T;Q.T=null;var f=te.p;try{te.p=8,Yf(t,n,l,i)}finally{te.p=f,Q.T=d}}function Yf(t,n,l,i){if(Ou){var d=Ff(i);if(d===null)Df(t,n,i,Mu,l),Dy(t,i);else if(tN(d,t,n,l,i))i.stopPropagation();else if(Dy(t,i),n&4&&-1<eN.indexOf(t)){for(;d!==null;){var f=Zl(d);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var y=Wn(f.pendingLanes);if(y!==0){var S=f;for(S.pendingLanes|=2,S.entangledLanes|=2;y;){var C=1<<31-Vt(y);S.entanglements[1]|=C,y&=~C}aa(f),(Ke&6)===0&&(gu=Gt()+500,Mi(0))}}break;case 31:case 13:S=el(f,2),S!==null&&sn(S,f,2),yu(),Kf(f,2)}if(f=Ff(i),f===null&&Df(t,n,i,Mu,l),f===d)break;d=f}d!==null&&i.stopPropagation()}else Df(t,n,i,null,l)}}function Ff(t){return t=Xc(t),Xf(t)}var Mu=null;function Xf(t){if(Mu=null,t=Bl(t),t!==null){var n=c(t);if(n===null)t=null;else{var l=n.tag;if(l===13){if(t=m(n),t!==null)return t;t=null}else if(l===31){if(t=h(n),t!==null)return t;t=null}else if(l===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;t=null}else n!==t&&(t=null)}}return Mu=t,null}function My(t){switch(t){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(Lc()){case Qr:return 2;case jo:return 8;case Ll:case wo:return 32;case ei:return 268435456;default:return 32}default:return 32}}var Jf=!1,hr=null,pr=null,gr=null,qi=new Map,Hi=new Map,vr=[],eN="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 Dy(t,n){switch(t){case"focusin":case"focusout":hr=null;break;case"dragenter":case"dragleave":pr=null;break;case"mouseover":case"mouseout":gr=null;break;case"pointerover":case"pointerout":qi.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Hi.delete(n.pointerId)}}function Ii(t,n,l,i,d,f){return t===null||t.nativeEvent!==f?(t={blockedOn:n,domEventName:l,eventSystemFlags:i,nativeEvent:f,targetContainers:[d]},n!==null&&(n=Zl(n),n!==null&&Ry(n)),t):(t.eventSystemFlags|=i,n=t.targetContainers,d!==null&&n.indexOf(d)===-1&&n.push(d),t)}function tN(t,n,l,i,d){switch(n){case"focusin":return hr=Ii(hr,t,n,l,i,d),!0;case"dragenter":return pr=Ii(pr,t,n,l,i,d),!0;case"mouseover":return gr=Ii(gr,t,n,l,i,d),!0;case"pointerover":var f=d.pointerId;return qi.set(f,Ii(qi.get(f)||null,t,n,l,i,d)),!0;case"gotpointercapture":return f=d.pointerId,Hi.set(f,Ii(Hi.get(f)||null,t,n,l,i,d)),!0}return!1}function Uy(t){var n=Bl(t.target);if(n!==null){var l=c(n);if(l!==null){if(n=l.tag,n===13){if(n=m(l),n!==null){t.blockedOn=n,Fh(t.priority,function(){Oy(l)});return}}else if(n===31){if(n=h(l),n!==null){t.blockedOn=n,Fh(t.priority,function(){Oy(l)});return}}else if(n===3&&l.stateNode.current.memoizedState.isDehydrated){t.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Du(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var l=Ff(t.nativeEvent);if(l===null){l=t.nativeEvent;var i=new l.constructor(l.type,l);Fc=i,l.target.dispatchEvent(i),Fc=null}else return n=Zl(l),n!==null&&Ry(n),t.blockedOn=l,!1;n.shift()}return!0}function Ly(t,n,l){Du(t)&&l.delete(n)}function nN(){Jf=!1,hr!==null&&Du(hr)&&(hr=null),pr!==null&&Du(pr)&&(pr=null),gr!==null&&Du(gr)&&(gr=null),qi.forEach(Ly),Hi.forEach(Ly)}function Uu(t,n){t.blockedOn===n&&(t.blockedOn=null,Jf||(Jf=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,nN)))}var Lu=null;function $y(t){Lu!==t&&(Lu=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Lu===t&&(Lu=null);for(var n=0;n<t.length;n+=3){var l=t[n],i=t[n+1],d=t[n+2];if(typeof i!="function"){if(Xf(i||l)===null)continue;break}var f=Zl(l);f!==null&&(t.splice(n,3),n-=3,Yd(f,{pending:!0,data:d,method:l.method,action:i},i,d))}}))}function Ss(t){function n(C){return Uu(C,t)}hr!==null&&Uu(hr,t),pr!==null&&Uu(pr,t),gr!==null&&Uu(gr,t),qi.forEach(n),Hi.forEach(n);for(var l=0;l<vr.length;l++){var i=vr[l];i.blockedOn===t&&(i.blockedOn=null)}for(;0<vr.length&&(l=vr[0],l.blockedOn===null);)Uy(l),l.blockedOn===null&&vr.shift();if(l=(t.ownerDocument||t).$$reactFormReplay,l!=null)for(i=0;i<l.length;i+=3){var d=l[i],f=l[i+1],y=d[en]||null;if(typeof f=="function")y||$y(l);else if(y){var S=null;if(f&&f.hasAttribute("formAction")){if(d=f,y=f[en]||null)S=y.formAction;else if(Xf(d)!==null)continue}else S=y.action;typeof S=="function"?l[i+1]=S:(l.splice(i,3),i-=3),$y(l)}}}function By(){function t(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(y){return d=y})},focusReset:"manual",scroll:"manual"})}function n(){d!==null&&(d(),d=null),i||setTimeout(l,20)}function l(){if(!i&&!navigation.transition){var f=navigation.currentEntry;f&&f.url!=null&&navigation.navigate(f.url,{state:f.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var i=!1,d=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(l,100),function(){i=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),d!==null&&(d(),d=null)}}}function Wf(t){this._internalRoot=t}$u.prototype.render=Wf.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(s(409));var l=n.current,i=yn();zy(l,i,t,n,null,null)},$u.prototype.unmount=Wf.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;zy(t.current,2,null,t,null,null),yu(),n[$l]=null}};function $u(t){this._internalRoot=t}$u.prototype.unstable_scheduleHydration=function(t){if(t){var n=Yh();t={blockedOn:null,target:t,priority:n};for(var l=0;l<vr.length&&n!==0&&n<vr[l].priority;l++);vr.splice(l,0,t),l===0&&Uy(t)}};var Zy=a.version;if(Zy!=="19.2.4")throw Error(s(527,Zy,"19.2.4"));te.findDOMNode=function(t){var n=t._reactInternals;if(n===void 0)throw typeof t.render=="function"?Error(s(188)):(t=Object.keys(t).join(","),Error(s(268,t)));return t=p(n),t=t!==null?b(t):null,t=t===null?null:t.stateNode,t};var aN={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:Q,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Bu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Bu.isDisabled&&Bu.supportsFiber)try{Gr=Bu.inject(aN),Pt=Bu}catch{}}return Gi.createRoot=function(t,n){if(!o(t))throw Error(s(299));var l=!1,i="",d=Vg,f=Kg,y=Yg;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onUncaughtError!==void 0&&(d=n.onUncaughtError),n.onCaughtError!==void 0&&(f=n.onCaughtError),n.onRecoverableError!==void 0&&(y=n.onRecoverableError)),n=Ay(t,1,!1,null,null,l,i,null,d,f,y,By),t[$l]=n.current,Mf(t),new Wf(n)},Gi.hydrateRoot=function(t,n,l){if(!o(t))throw Error(s(299));var i=!1,d="",f=Vg,y=Kg,S=Yg,C=null;return l!=null&&(l.unstable_strictMode===!0&&(i=!0),l.identifierPrefix!==void 0&&(d=l.identifierPrefix),l.onUncaughtError!==void 0&&(f=l.onUncaughtError),l.onCaughtError!==void 0&&(y=l.onCaughtError),l.onRecoverableError!==void 0&&(S=l.onRecoverableError),l.formState!==void 0&&(C=l.formState)),n=Ay(t,1,!0,n,l??null,i,d,C,f,y,S,By),n.context=ky(null),l=n.current,i=yn(),i=Hc(i),d=nr(i),d.callback=null,ar(l,d,i),l=i,n.current.lanes=l,Kt(n,l),aa(n),t[$l]=n.current,Mf(t),new $u(n)},Gi.version="19.2.4",Gi}var Xy;function hN(){if(Xy)return am.exports;Xy=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(a){console.error(a)}}return e(),am.exports=mN(),am.exports}var pN=hN(),Ks=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(){}},gl,Nr,Rs,jx,gN=(jx=class extends Ks{constructor(){super();ye(this,gl);ye(this,Nr);ye(this,Rs);ie(this,Rs,a=>{if(typeof window<"u"&&window.addEventListener){const r=()=>a();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){A(this,Nr)||this.setEventListener(A(this,Rs))}onUnsubscribe(){var a;this.hasListeners()||((a=A(this,Nr))==null||a.call(this),ie(this,Nr,void 0))}setEventListener(a){var r;ie(this,Rs,a),(r=A(this,Nr))==null||r.call(this),ie(this,Nr,a(s=>{typeof s=="boolean"?this.setFocused(s):this.onFocus()}))}setFocused(a){A(this,gl)!==a&&(ie(this,gl,a),this.onFocus())}onFocus(){const a=this.isFocused();this.listeners.forEach(r=>{r(a)})}isFocused(){var a;return typeof A(this,gl)=="boolean"?A(this,gl):((a=globalThis.document)==null?void 0:a.visibilityState)!=="hidden"}},gl=new WeakMap,Nr=new WeakMap,Rs=new WeakMap,jx),fh=new gN,vN={setTimeout:(e,a)=>setTimeout(e,a),clearTimeout:e=>clearTimeout(e),setInterval:(e,a)=>setInterval(e,a),clearInterval:e=>clearInterval(e)},Er,uh,wx,yN=(wx=class{constructor(){ye(this,Er,vN);ye(this,uh,!1)}setTimeoutProvider(e){ie(this,Er,e)}setTimeout(e,a){return A(this,Er).setTimeout(e,a)}clearTimeout(e){A(this,Er).clearTimeout(e)}setInterval(e,a){return A(this,Er).setInterval(e,a)}clearInterval(e){A(this,Er).clearInterval(e)}},Er=new WeakMap,uh=new WeakMap,wx),pl=new yN;function bN(e){setTimeout(e,0)}var xN=typeof window>"u"||"Deno"in globalThis;function Jt(){}function SN(e,a){return typeof e=="function"?e(a):e}function Rm(e){return typeof e=="number"&&e>=0&&e!==1/0}function Dx(e,a){return Math.max(e+(a||0)-Date.now(),0)}function Or(e,a){return typeof e=="function"?e(a):e}function Dn(e,a){return typeof e=="function"?e(a):e}function Jy(e,a){const{type:r="all",exact:s,fetchStatus:o,predicate:c,queryKey:m,stale:h}=e;if(m){if(s){if(a.queryHash!==mh(m,a.options))return!1}else if(!eo(a.queryKey,m))return!1}if(r!=="all"){const g=a.isActive();if(r==="active"&&!g||r==="inactive"&&g)return!1}return!(typeof h=="boolean"&&a.isStale()!==h||o&&o!==a.state.fetchStatus||c&&!c(a))}function Wy(e,a){const{exact:r,status:s,predicate:o,mutationKey:c}=e;if(c){if(!a.options.mutationKey)return!1;if(r){if(El(a.options.mutationKey)!==El(c))return!1}else if(!eo(a.options.mutationKey,c))return!1}return!(s&&a.state.status!==s||o&&!o(a))}function mh(e,a){return((a==null?void 0:a.queryKeyHashFn)||El)(e)}function El(e){return JSON.stringify(e,(a,r)=>Om(r)?Object.keys(r).sort().reduce((s,o)=>(s[o]=r[o],s),{}):r)}function eo(e,a){return e===a?!0:typeof e!=typeof a?!1:e&&a&&typeof e=="object"&&typeof a=="object"?Object.keys(a).every(r=>eo(e[r],a[r])):!1}var jN=Object.prototype.hasOwnProperty;function Ux(e,a,r=0){if(e===a)return e;if(r>500)return a;const s=eb(e)&&eb(a);if(!s&&!(Om(e)&&Om(a)))return a;const c=(s?e:Object.keys(e)).length,m=s?a:Object.keys(a),h=m.length,g=s?new Array(h):{};let p=0;for(let b=0;b<h;b++){const x=s?b:m[b],j=e[x],N=a[x];if(j===N){g[x]=j,(s?b<c:jN.call(e,x))&&p++;continue}if(j===null||N===null||typeof j!="object"||typeof N!="object"){g[x]=N;continue}const z=Ux(j,N,r+1);g[x]=z,z===j&&p++}return c===h&&p===c?e:g}function ic(e,a){if(!a||Object.keys(e).length!==Object.keys(a).length)return!1;for(const r in e)if(e[r]!==a[r])return!1;return!0}function eb(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Om(e){if(!tb(e))return!1;const a=e.constructor;if(a===void 0)return!0;const r=a.prototype;return!(!tb(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function tb(e){return Object.prototype.toString.call(e)==="[object Object]"}function wN(e){return new Promise(a=>{pl.setTimeout(a,e)})}function Mm(e,a,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,a):r.structuralSharing!==!1?Ux(e,a):a}function NN(e,a,r=0){const s=[...e,a];return r&&s.length>r?s.slice(1):s}function EN(e,a,r=0){const s=[a,...e];return r&&s.length>r?s.slice(0,-1):s}var hh=Symbol();function Lx(e,a){return!e.queryFn&&(a!=null&&a.initialPromise)?()=>a.initialPromise:!e.queryFn||e.queryFn===hh?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ph(e,a){return typeof e=="function"?e(...a):!!e}function _N(e,a,r){let s=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??(o=a()),s||(s=!0,o.aborted?r():o.addEventListener("abort",r,{once:!0})),o)}),e}var to=(()=>{let e=()=>xN;return{isServer(){return e()},setIsServer(a){e=a}}})();function Dm(){let e,a;const r=new Promise((o,c)=>{e=o,a=c});r.status="pending",r.catch(()=>{});function s(o){Object.assign(r,o),delete r.resolve,delete r.reject}return r.resolve=o=>{s({status:"fulfilled",value:o}),e(o)},r.reject=o=>{s({status:"rejected",reason:o}),a(o)},r}var CN=bN;function AN(){let e=[],a=0,r=h=>{h()},s=h=>{h()},o=CN;const c=h=>{a?e.push(h):o(()=>{r(h)})},m=()=>{const h=e;e=[],h.length&&o(()=>{s(()=>{h.forEach(g=>{r(g)})})})};return{batch:h=>{let g;a++;try{g=h()}finally{a--,a||m()}return g},batchCalls:h=>(...g)=>{c(()=>{h(...g)})},schedule:c,setNotifyFunction:h=>{r=h},setBatchNotifyFunction:h=>{s=h},setScheduler:h=>{o=h}}}var Tt=AN(),Os,_r,Ms,Nx,kN=(Nx=class extends Ks{constructor(){super();ye(this,Os,!0);ye(this,_r);ye(this,Ms);ie(this,Ms,a=>{if(typeof window<"u"&&window.addEventListener){const r=()=>a(!0),s=()=>a(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",s)}}})}onSubscribe(){A(this,_r)||this.setEventListener(A(this,Ms))}onUnsubscribe(){var a;this.hasListeners()||((a=A(this,_r))==null||a.call(this),ie(this,_r,void 0))}setEventListener(a){var r;ie(this,Ms,a),(r=A(this,_r))==null||r.call(this),ie(this,_r,a(this.setOnline.bind(this)))}setOnline(a){A(this,Os)!==a&&(ie(this,Os,a),this.listeners.forEach(s=>{s(a)}))}isOnline(){return A(this,Os)}},Os=new WeakMap,_r=new WeakMap,Ms=new WeakMap,Nx),oc=new kN;function zN(e){return Math.min(1e3*2**e,3e4)}function $x(e){return(e??"online")==="online"?oc.isOnline():!0}var Um=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Bx(e){let a=!1,r=0,s;const o=Dm(),c=()=>o.status!=="pending",m=w=>{var E;if(!c()){const M=new Um(w);j(M),(E=e.onCancel)==null||E.call(e,M)}},h=()=>{a=!0},g=()=>{a=!1},p=()=>fh.isFocused()&&(e.networkMode==="always"||oc.isOnline())&&e.canRun(),b=()=>$x(e.networkMode)&&e.canRun(),x=w=>{c()||(s==null||s(),o.resolve(w))},j=w=>{c()||(s==null||s(),o.reject(w))},N=()=>new Promise(w=>{var E;s=M=>{(c()||p())&&w(M)},(E=e.onPause)==null||E.call(e)}).then(()=>{var w;s=void 0,c()||(w=e.onContinue)==null||w.call(e)}),z=()=>{if(c())return;let w;const E=r===0?e.initialPromise:void 0;try{w=E??e.fn()}catch(M){w=Promise.reject(M)}Promise.resolve(w).then(x).catch(M=>{var I;if(c())return;const Z=e.retry??(to.isServer()?0:3),D=e.retryDelay??zN,O=typeof D=="function"?D(r,M):D,P=Z===!0||typeof Z=="number"&&r<Z||typeof Z=="function"&&Z(r,M);if(a||!P){j(M);return}r++,(I=e.onFail)==null||I.call(e,r,M),wN(O).then(()=>p()?void 0:N()).then(()=>{a?j(M):z()})})};return{promise:o,status:()=>o.status,cancel:m,continue:()=>(s==null||s(),o),cancelRetry:h,continueRetry:g,canStart:b,start:()=>(b()?z():N().then(z),o)}}var vl,Ex,Zx=(Ex=class{constructor(){ye(this,vl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Rm(this.gcTime)&&ie(this,vl,pl.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(to.isServer()?1/0:300*1e3))}clearGcTimeout(){A(this,vl)&&(pl.clearTimeout(A(this,vl)),ie(this,vl,void 0))}},vl=new WeakMap,Ex),yl,Ds,Mn,bl,Mt,co,xl,bn,qx,Ta,_x,TN=(_x=class extends Zx{constructor(a){super();ye(this,bn);ye(this,yl);ye(this,Ds);ye(this,Mn);ye(this,bl);ye(this,Mt);ye(this,co);ye(this,xl);ie(this,xl,!1),ie(this,co,a.defaultOptions),this.setOptions(a.options),this.observers=[],ie(this,bl,a.client),ie(this,Mn,A(this,bl).getQueryCache()),this.queryKey=a.queryKey,this.queryHash=a.queryHash,ie(this,yl,ab(this.options)),this.state=a.state??A(this,yl),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var a;return(a=A(this,Mt))==null?void 0:a.promise}setOptions(a){if(this.options={...A(this,co),...a},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=ab(this.options);r.data!==void 0&&(this.setState(nb(r.data,r.dataUpdatedAt)),ie(this,yl,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&A(this,Mn).remove(this)}setData(a,r){const s=Mm(this.state.data,a,this.options);return Oe(this,bn,Ta).call(this,{data:s,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),s}setState(a,r){Oe(this,bn,Ta).call(this,{type:"setState",state:a,setStateOptions:r})}cancel(a){var s,o;const r=(s=A(this,Mt))==null?void 0:s.promise;return(o=A(this,Mt))==null||o.cancel(a),r?r.then(Jt).catch(Jt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return A(this,yl)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(a=>Dn(a.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===hh||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(a=>Or(a.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(a=>a.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(a=0){return this.state.data===void 0?!0:a==="static"?!1:this.state.isInvalidated?!0:!Dx(this.state.dataUpdatedAt,a)}onFocus(){var r;const a=this.observers.find(s=>s.shouldFetchOnWindowFocus());a==null||a.refetch({cancelRefetch:!1}),(r=A(this,Mt))==null||r.continue()}onOnline(){var r;const a=this.observers.find(s=>s.shouldFetchOnReconnect());a==null||a.refetch({cancelRefetch:!1}),(r=A(this,Mt))==null||r.continue()}addObserver(a){this.observers.includes(a)||(this.observers.push(a),this.clearGcTimeout(),A(this,Mn).notify({type:"observerAdded",query:this,observer:a}))}removeObserver(a){this.observers.includes(a)&&(this.observers=this.observers.filter(r=>r!==a),this.observers.length||(A(this,Mt)&&(A(this,xl)||Oe(this,bn,qx).call(this)?A(this,Mt).cancel({revert:!0}):A(this,Mt).cancelRetry()),this.scheduleGc()),A(this,Mn).notify({type:"observerRemoved",query:this,observer:a}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Oe(this,bn,Ta).call(this,{type:"invalidate"})}async fetch(a,r){var g,p,b,x,j,N,z,w,E,M,Z,D;if(this.state.fetchStatus!=="idle"&&((g=A(this,Mt))==null?void 0:g.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(A(this,Mt))return A(this,Mt).continueRetry(),A(this,Mt).promise}if(a&&this.setOptions(a),!this.options.queryFn){const O=this.observers.find(P=>P.options.queryFn);O&&this.setOptions(O.options)}const s=new AbortController,o=O=>{Object.defineProperty(O,"signal",{enumerable:!0,get:()=>(ie(this,xl,!0),s.signal)})},c=()=>{const O=Lx(this.options,r),I=(()=>{const L={client:A(this,bl),queryKey:this.queryKey,meta:this.meta};return o(L),L})();return ie(this,xl,!1),this.options.persister?this.options.persister(O,I,this):O(I)},h=(()=>{const O={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:A(this,bl),state:this.state,fetchFn:c};return o(O),O})();(p=this.options.behavior)==null||p.onFetch(h,this),ie(this,Ds,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((b=h.fetchOptions)==null?void 0:b.meta))&&Oe(this,bn,Ta).call(this,{type:"fetch",meta:(x=h.fetchOptions)==null?void 0:x.meta}),ie(this,Mt,Bx({initialPromise:r==null?void 0:r.initialPromise,fn:h.fetchFn,onCancel:O=>{O instanceof Um&&O.revert&&this.setState({...A(this,Ds),fetchStatus:"idle"}),s.abort()},onFail:(O,P)=>{Oe(this,bn,Ta).call(this,{type:"failed",failureCount:O,error:P})},onPause:()=>{Oe(this,bn,Ta).call(this,{type:"pause"})},onContinue:()=>{Oe(this,bn,Ta).call(this,{type:"continue"})},retry:h.options.retry,retryDelay:h.options.retryDelay,networkMode:h.options.networkMode,canRun:()=>!0}));try{const O=await A(this,Mt).start();if(O===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(O),(N=(j=A(this,Mn).config).onSuccess)==null||N.call(j,O,this),(w=(z=A(this,Mn).config).onSettled)==null||w.call(z,O,this.state.error,this),O}catch(O){if(O instanceof Um){if(O.silent)return A(this,Mt).promise;if(O.revert){if(this.state.data===void 0)throw O;return this.state.data}}throw Oe(this,bn,Ta).call(this,{type:"error",error:O}),(M=(E=A(this,Mn).config).onError)==null||M.call(E,O,this),(D=(Z=A(this,Mn).config).onSettled)==null||D.call(Z,this.state.data,O,this),O}finally{this.scheduleGc()}}},yl=new WeakMap,Ds=new WeakMap,Mn=new WeakMap,bl=new WeakMap,Mt=new WeakMap,co=new WeakMap,xl=new WeakMap,bn=new WeakSet,qx=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Ta=function(a){const r=s=>{switch(a.type){case"failed":return{...s,fetchFailureCount:a.failureCount,fetchFailureReason:a.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...Hx(s.data,this.options),fetchMeta:a.meta??null};case"success":const o={...s,...nb(a.data,a.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!a.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ie(this,Ds,a.manual?o:void 0),o;case"error":const c=a.error;return{...s,error:c,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:c,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...a.state}}};this.state=r(this.state),Tt.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),A(this,Mn).notify({query:this,type:"updated",action:a})})},_x);function Hx(e,a){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:$x(a.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function nb(e,a){return{data:e,dataUpdatedAt:a??Date.now(),error:null,isInvalidated:!1,status:"success"}}function ab(e){const a=typeof e.initialData=="function"?e.initialData():e.initialData,r=a!==void 0,s=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:a,dataUpdateCount:0,dataUpdatedAt:r?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var on,He,fo,Xt,Sl,Us,Oa,Cr,mo,Ls,$s,jl,wl,Ar,Bs,Xe,Fi,Lm,$m,Bm,Zm,qm,Hm,Im,Ix,Cx,RN=(Cx=class extends Ks{constructor(a,r){super();ye(this,Xe);ye(this,on);ye(this,He);ye(this,fo);ye(this,Xt);ye(this,Sl);ye(this,Us);ye(this,Oa);ye(this,Cr);ye(this,mo);ye(this,Ls);ye(this,$s);ye(this,jl);ye(this,wl);ye(this,Ar);ye(this,Bs,new Set);this.options=r,ie(this,on,a),ie(this,Cr,null),ie(this,Oa,Dm()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(A(this,He).addObserver(this),rb(A(this,He),this.options)?Oe(this,Xe,Fi).call(this):this.updateResult(),Oe(this,Xe,Zm).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Qm(A(this,He),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Qm(A(this,He),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Oe(this,Xe,qm).call(this),Oe(this,Xe,Hm).call(this),A(this,He).removeObserver(this)}setOptions(a){const r=this.options,s=A(this,He);if(this.options=A(this,on).defaultQueryOptions(a),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Dn(this.options.enabled,A(this,He))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Oe(this,Xe,Im).call(this),A(this,He).setOptions(this.options),r._defaulted&&!ic(this.options,r)&&A(this,on).getQueryCache().notify({type:"observerOptionsUpdated",query:A(this,He),observer:this});const o=this.hasListeners();o&&lb(A(this,He),s,this.options,r)&&Oe(this,Xe,Fi).call(this),this.updateResult(),o&&(A(this,He)!==s||Dn(this.options.enabled,A(this,He))!==Dn(r.enabled,A(this,He))||Or(this.options.staleTime,A(this,He))!==Or(r.staleTime,A(this,He)))&&Oe(this,Xe,Lm).call(this);const c=Oe(this,Xe,$m).call(this);o&&(A(this,He)!==s||Dn(this.options.enabled,A(this,He))!==Dn(r.enabled,A(this,He))||c!==A(this,Ar))&&Oe(this,Xe,Bm).call(this,c)}getOptimisticResult(a){const r=A(this,on).getQueryCache().build(A(this,on),a),s=this.createResult(r,a);return MN(this,s)&&(ie(this,Xt,s),ie(this,Us,this.options),ie(this,Sl,A(this,He).state)),s}getCurrentResult(){return A(this,Xt)}trackResult(a,r){return new Proxy(a,{get:(s,o)=>(this.trackProp(o),r==null||r(o),o==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&A(this,Oa).status==="pending"&&A(this,Oa).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(s,o))})}trackProp(a){A(this,Bs).add(a)}getCurrentQuery(){return A(this,He)}refetch({...a}={}){return this.fetch({...a})}fetchOptimistic(a){const r=A(this,on).defaultQueryOptions(a),s=A(this,on).getQueryCache().build(A(this,on),r);return s.fetch().then(()=>this.createResult(s,r))}fetch(a){return Oe(this,Xe,Fi).call(this,{...a,cancelRefetch:a.cancelRefetch??!0}).then(()=>(this.updateResult(),A(this,Xt)))}createResult(a,r){var se;const s=A(this,He),o=this.options,c=A(this,Xt),m=A(this,Sl),h=A(this,Us),p=a!==s?a.state:A(this,fo),{state:b}=a;let x={...b},j=!1,N;if(r._optimisticResults){const Se=this.hasListeners(),_e=!Se&&rb(a,r),re=Se&&lb(a,s,r,o);(_e||re)&&(x={...x,...Hx(b.data,a.options)}),r._optimisticResults==="isRestoring"&&(x.fetchStatus="idle")}let{error:z,errorUpdatedAt:w,status:E}=x;N=x.data;let M=!1;if(r.placeholderData!==void 0&&N===void 0&&E==="pending"){let Se;c!=null&&c.isPlaceholderData&&r.placeholderData===(h==null?void 0:h.placeholderData)?(Se=c.data,M=!0):Se=typeof r.placeholderData=="function"?r.placeholderData((se=A(this,$s))==null?void 0:se.state.data,A(this,$s)):r.placeholderData,Se!==void 0&&(E="success",N=Mm(c==null?void 0:c.data,Se,r),j=!0)}if(r.select&&N!==void 0&&!M)if(c&&N===(m==null?void 0:m.data)&&r.select===A(this,mo))N=A(this,Ls);else try{ie(this,mo,r.select),N=r.select(N),N=Mm(c==null?void 0:c.data,N,r),ie(this,Ls,N),ie(this,Cr,null)}catch(Se){ie(this,Cr,Se)}A(this,Cr)&&(z=A(this,Cr),N=A(this,Ls),w=Date.now(),E="error");const Z=x.fetchStatus==="fetching",D=E==="pending",O=E==="error",P=D&&Z,I=N!==void 0,K={status:E,fetchStatus:x.fetchStatus,isPending:D,isSuccess:E==="success",isError:O,isInitialLoading:P,isLoading:P,data:N,dataUpdatedAt:x.dataUpdatedAt,error:z,errorUpdatedAt:w,failureCount:x.fetchFailureCount,failureReason:x.fetchFailureReason,errorUpdateCount:x.errorUpdateCount,isFetched:a.isFetched(),isFetchedAfterMount:x.dataUpdateCount>p.dataUpdateCount||x.errorUpdateCount>p.errorUpdateCount,isFetching:Z,isRefetching:Z&&!D,isLoadingError:O&&!I,isPaused:x.fetchStatus==="paused",isPlaceholderData:j,isRefetchError:O&&I,isStale:gh(a,r),refetch:this.refetch,promise:A(this,Oa),isEnabled:Dn(r.enabled,a)!==!1};if(this.options.experimental_prefetchInRender){const Se=K.data!==void 0,_e=K.status==="error"&&!Se,re=we=>{_e?we.reject(K.error):Se&&we.resolve(K.data)},ve=()=>{const we=ie(this,Oa,K.promise=Dm());re(we)},Te=A(this,Oa);switch(Te.status){case"pending":a.queryHash===s.queryHash&&re(Te);break;case"fulfilled":(_e||K.data!==Te.value)&&ve();break;case"rejected":(!_e||K.error!==Te.reason)&&ve();break}}return K}updateResult(){const a=A(this,Xt),r=this.createResult(A(this,He),this.options);if(ie(this,Sl,A(this,He).state),ie(this,Us,this.options),A(this,Sl).data!==void 0&&ie(this,$s,A(this,He)),ic(r,a))return;ie(this,Xt,r);const s=()=>{if(!a)return!0;const{notifyOnChangeProps:o}=this.options,c=typeof o=="function"?o():o;if(c==="all"||!c&&!A(this,Bs).size)return!0;const m=new Set(c??A(this,Bs));return this.options.throwOnError&&m.add("error"),Object.keys(A(this,Xt)).some(h=>{const g=h;return A(this,Xt)[g]!==a[g]&&m.has(g)})};Oe(this,Xe,Ix).call(this,{listeners:s()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Oe(this,Xe,Zm).call(this)}},on=new WeakMap,He=new WeakMap,fo=new WeakMap,Xt=new WeakMap,Sl=new WeakMap,Us=new WeakMap,Oa=new WeakMap,Cr=new WeakMap,mo=new WeakMap,Ls=new WeakMap,$s=new WeakMap,jl=new WeakMap,wl=new WeakMap,Ar=new WeakMap,Bs=new WeakMap,Xe=new WeakSet,Fi=function(a){Oe(this,Xe,Im).call(this);let r=A(this,He).fetch(this.options,a);return a!=null&&a.throwOnError||(r=r.catch(Jt)),r},Lm=function(){Oe(this,Xe,qm).call(this);const a=Or(this.options.staleTime,A(this,He));if(to.isServer()||A(this,Xt).isStale||!Rm(a))return;const s=Dx(A(this,Xt).dataUpdatedAt,a)+1;ie(this,jl,pl.setTimeout(()=>{A(this,Xt).isStale||this.updateResult()},s))},$m=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(A(this,He)):this.options.refetchInterval)??!1},Bm=function(a){Oe(this,Xe,Hm).call(this),ie(this,Ar,a),!(to.isServer()||Dn(this.options.enabled,A(this,He))===!1||!Rm(A(this,Ar))||A(this,Ar)===0)&&ie(this,wl,pl.setInterval(()=>{(this.options.refetchIntervalInBackground||fh.isFocused())&&Oe(this,Xe,Fi).call(this)},A(this,Ar)))},Zm=function(){Oe(this,Xe,Lm).call(this),Oe(this,Xe,Bm).call(this,Oe(this,Xe,$m).call(this))},qm=function(){A(this,jl)&&(pl.clearTimeout(A(this,jl)),ie(this,jl,void 0))},Hm=function(){A(this,wl)&&(pl.clearInterval(A(this,wl)),ie(this,wl,void 0))},Im=function(){const a=A(this,on).getQueryCache().build(A(this,on),this.options);if(a===A(this,He))return;const r=A(this,He);ie(this,He,a),ie(this,fo,a.state),this.hasListeners()&&(r==null||r.removeObserver(this),a.addObserver(this))},Ix=function(a){Tt.batch(()=>{a.listeners&&this.listeners.forEach(r=>{r(A(this,Xt))}),A(this,on).getQueryCache().notify({query:A(this,He),type:"observerResultsUpdated"})})},Cx);function ON(e,a){return Dn(a.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&a.retryOnMount===!1)}function rb(e,a){return ON(e,a)||e.state.data!==void 0&&Qm(e,a,a.refetchOnMount)}function Qm(e,a,r){if(Dn(a.enabled,e)!==!1&&Or(a.staleTime,e)!=="static"){const s=typeof r=="function"?r(e):r;return s==="always"||s!==!1&&gh(e,a)}return!1}function lb(e,a,r,s){return(e!==a||Dn(s.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&gh(e,r)}function gh(e,a){return Dn(a.enabled,e)!==!1&&e.isStaleByTime(Or(a.staleTime,e))}function MN(e,a){return!ic(e.getCurrentResult(),a)}function sb(e){return{onFetch:(a,r)=>{var b,x,j,N,z;const s=a.options,o=(j=(x=(b=a.fetchOptions)==null?void 0:b.meta)==null?void 0:x.fetchMore)==null?void 0:j.direction,c=((N=a.state.data)==null?void 0:N.pages)||[],m=((z=a.state.data)==null?void 0:z.pageParams)||[];let h={pages:[],pageParams:[]},g=0;const p=async()=>{let w=!1;const E=D=>{_N(D,()=>a.signal,()=>w=!0)},M=Lx(a.options,a.fetchOptions),Z=async(D,O,P)=>{if(w)return Promise.reject();if(O==null&&D.pages.length)return Promise.resolve(D);const L=(()=>{const _e={client:a.client,queryKey:a.queryKey,pageParam:O,direction:P?"backward":"forward",meta:a.options.meta};return E(_e),_e})(),K=await M(L),{maxPages:se}=a.options,Se=P?EN:NN;return{pages:Se(D.pages,K,se),pageParams:Se(D.pageParams,O,se)}};if(o&&c.length){const D=o==="backward",O=D?DN:ib,P={pages:c,pageParams:m},I=O(s,P);h=await Z(P,I,D)}else{const D=e??c.length;do{const O=g===0?m[0]??s.initialPageParam:ib(s,h);if(g>0&&O==null)break;h=await Z(h,O),g++}while(g<D)}return h};a.options.persister?a.fetchFn=()=>{var w,E;return(E=(w=a.options).persister)==null?void 0:E.call(w,p,{client:a.client,queryKey:a.queryKey,meta:a.options.meta,signal:a.signal},r)}:a.fetchFn=p}}}function ib(e,{pages:a,pageParams:r}){const s=a.length-1;return a.length>0?e.getNextPageParam(a[s],a,r[s],r):void 0}function DN(e,{pages:a,pageParams:r}){var s;return a.length>0?(s=e.getPreviousPageParam)==null?void 0:s.call(e,a[0],a,r[0],r):void 0}var ho,ra,It,Nl,la,Sr,Ax,UN=(Ax=class extends Zx{constructor(a){super();ye(this,la);ye(this,ho);ye(this,ra);ye(this,It);ye(this,Nl);ie(this,ho,a.client),this.mutationId=a.mutationId,ie(this,It,a.mutationCache),ie(this,ra,[]),this.state=a.state||Qx(),this.setOptions(a.options),this.scheduleGc()}setOptions(a){this.options=a,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(a){A(this,ra).includes(a)||(A(this,ra).push(a),this.clearGcTimeout(),A(this,It).notify({type:"observerAdded",mutation:this,observer:a}))}removeObserver(a){ie(this,ra,A(this,ra).filter(r=>r!==a)),this.scheduleGc(),A(this,It).notify({type:"observerRemoved",mutation:this,observer:a})}optionalRemove(){A(this,ra).length||(this.state.status==="pending"?this.scheduleGc():A(this,It).remove(this))}continue(){var a;return((a=A(this,Nl))==null?void 0:a.continue())??this.execute(this.state.variables)}async execute(a){var m,h,g,p,b,x,j,N,z,w,E,M,Z,D,O,P,I,L;const r=()=>{Oe(this,la,Sr).call(this,{type:"continue"})},s={client:A(this,ho),meta:this.options.meta,mutationKey:this.options.mutationKey};ie(this,Nl,Bx({fn:()=>this.options.mutationFn?this.options.mutationFn(a,s):Promise.reject(new Error("No mutationFn found")),onFail:(K,se)=>{Oe(this,la,Sr).call(this,{type:"failed",failureCount:K,error:se})},onPause:()=>{Oe(this,la,Sr).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>A(this,It).canRun(this)}));const o=this.state.status==="pending",c=!A(this,Nl).canStart();try{if(o)r();else{Oe(this,la,Sr).call(this,{type:"pending",variables:a,isPaused:c}),A(this,It).config.onMutate&&await A(this,It).config.onMutate(a,this,s);const se=await((h=(m=this.options).onMutate)==null?void 0:h.call(m,a,s));se!==this.state.context&&Oe(this,la,Sr).call(this,{type:"pending",context:se,variables:a,isPaused:c})}const K=await A(this,Nl).start();return await((p=(g=A(this,It).config).onSuccess)==null?void 0:p.call(g,K,a,this.state.context,this,s)),await((x=(b=this.options).onSuccess)==null?void 0:x.call(b,K,a,this.state.context,s)),await((N=(j=A(this,It).config).onSettled)==null?void 0:N.call(j,K,null,this.state.variables,this.state.context,this,s)),await((w=(z=this.options).onSettled)==null?void 0:w.call(z,K,null,a,this.state.context,s)),Oe(this,la,Sr).call(this,{type:"success",data:K}),K}catch(K){try{await((M=(E=A(this,It).config).onError)==null?void 0:M.call(E,K,a,this.state.context,this,s))}catch(se){Promise.reject(se)}try{await((D=(Z=this.options).onError)==null?void 0:D.call(Z,K,a,this.state.context,s))}catch(se){Promise.reject(se)}try{await((P=(O=A(this,It).config).onSettled)==null?void 0:P.call(O,void 0,K,this.state.variables,this.state.context,this,s))}catch(se){Promise.reject(se)}try{await((L=(I=this.options).onSettled)==null?void 0:L.call(I,void 0,K,a,this.state.context,s))}catch(se){Promise.reject(se)}throw Oe(this,la,Sr).call(this,{type:"error",error:K}),K}finally{A(this,It).runNext(this)}}},ho=new WeakMap,ra=new WeakMap,It=new WeakMap,Nl=new WeakMap,la=new WeakSet,Sr=function(a){const r=s=>{switch(a.type){case"failed":return{...s,failureCount:a.failureCount,failureReason:a.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:a.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:a.isPaused,status:"pending",variables:a.variables,submittedAt:Date.now()};case"success":return{...s,data:a.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:a.error,failureCount:s.failureCount+1,failureReason:a.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Tt.batch(()=>{A(this,ra).forEach(s=>{s.onMutationUpdate(a)}),A(this,It).notify({mutation:this,type:"updated",action:a})})},Ax);function Qx(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ma,Kn,po,kx,LN=(kx=class extends Ks{constructor(a={}){super();ye(this,Ma);ye(this,Kn);ye(this,po);this.config=a,ie(this,Ma,new Set),ie(this,Kn,new Map),ie(this,po,0)}build(a,r,s){const o=new UN({client:a,mutationCache:this,mutationId:++Zu(this,po)._,options:a.defaultMutationOptions(r),state:s});return this.add(o),o}add(a){A(this,Ma).add(a);const r=qu(a);if(typeof r=="string"){const s=A(this,Kn).get(r);s?s.push(a):A(this,Kn).set(r,[a])}this.notify({type:"added",mutation:a})}remove(a){if(A(this,Ma).delete(a)){const r=qu(a);if(typeof r=="string"){const s=A(this,Kn).get(r);if(s)if(s.length>1){const o=s.indexOf(a);o!==-1&&s.splice(o,1)}else s[0]===a&&A(this,Kn).delete(r)}}this.notify({type:"removed",mutation:a})}canRun(a){const r=qu(a);if(typeof r=="string"){const s=A(this,Kn).get(r),o=s==null?void 0:s.find(c=>c.state.status==="pending");return!o||o===a}else return!0}runNext(a){var s;const r=qu(a);if(typeof r=="string"){const o=(s=A(this,Kn).get(r))==null?void 0:s.find(c=>c!==a&&c.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Tt.batch(()=>{A(this,Ma).forEach(a=>{this.notify({type:"removed",mutation:a})}),A(this,Ma).clear(),A(this,Kn).clear()})}getAll(){return Array.from(A(this,Ma))}find(a){const r={exact:!0,...a};return this.getAll().find(s=>Wy(r,s))}findAll(a={}){return this.getAll().filter(r=>Wy(a,r))}notify(a){Tt.batch(()=>{this.listeners.forEach(r=>{r(a)})})}resumePausedMutations(){const a=this.getAll().filter(r=>r.state.isPaused);return Tt.batch(()=>Promise.all(a.map(r=>r.continue().catch(Jt))))}},Ma=new WeakMap,Kn=new WeakMap,po=new WeakMap,kx);function qu(e){var a;return(a=e.options.scope)==null?void 0:a.id}var Da,kr,un,Ua,Ba,ec,Gm,zx,$N=(zx=class extends Ks{constructor(r,s){super();ye(this,Ba);ye(this,Da);ye(this,kr);ye(this,un);ye(this,Ua);ie(this,Da,r),this.setOptions(s),this.bindMethods(),Oe(this,Ba,ec).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){var o;const s=this.options;this.options=A(this,Da).defaultMutationOptions(r),ic(this.options,s)||A(this,Da).getMutationCache().notify({type:"observerOptionsUpdated",mutation:A(this,un),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&El(s.mutationKey)!==El(this.options.mutationKey)?this.reset():((o=A(this,un))==null?void 0:o.state.status)==="pending"&&A(this,un).setOptions(this.options)}onUnsubscribe(){var r;this.hasListeners()||(r=A(this,un))==null||r.removeObserver(this)}onMutationUpdate(r){Oe(this,Ba,ec).call(this),Oe(this,Ba,Gm).call(this,r)}getCurrentResult(){return A(this,kr)}reset(){var r;(r=A(this,un))==null||r.removeObserver(this),ie(this,un,void 0),Oe(this,Ba,ec).call(this),Oe(this,Ba,Gm).call(this)}mutate(r,s){var o;return ie(this,Ua,s),(o=A(this,un))==null||o.removeObserver(this),ie(this,un,A(this,Da).getMutationCache().build(A(this,Da),this.options)),A(this,un).addObserver(this),A(this,un).execute(r)}},Da=new WeakMap,kr=new WeakMap,un=new WeakMap,Ua=new WeakMap,Ba=new WeakSet,ec=function(){var s;const r=((s=A(this,un))==null?void 0:s.state)??Qx();ie(this,kr,{...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset})},Gm=function(r){Tt.batch(()=>{var s,o,c,m,h,g,p,b;if(A(this,Ua)&&this.hasListeners()){const x=A(this,kr).variables,j=A(this,kr).context,N={client:A(this,Da),meta:this.options.meta,mutationKey:this.options.mutationKey};if((r==null?void 0:r.type)==="success"){try{(o=(s=A(this,Ua)).onSuccess)==null||o.call(s,r.data,x,j,N)}catch(z){Promise.reject(z)}try{(m=(c=A(this,Ua)).onSettled)==null||m.call(c,r.data,null,x,j,N)}catch(z){Promise.reject(z)}}else if((r==null?void 0:r.type)==="error"){try{(g=(h=A(this,Ua)).onError)==null||g.call(h,r.error,x,j,N)}catch(z){Promise.reject(z)}try{(b=(p=A(this,Ua)).onSettled)==null||b.call(p,void 0,r.error,x,j,N)}catch(z){Promise.reject(z)}}}this.listeners.forEach(x=>{x(A(this,kr))})})},zx),sa,Tx,BN=(Tx=class extends Ks{constructor(a={}){super();ye(this,sa);this.config=a,ie(this,sa,new Map)}build(a,r,s){const o=r.queryKey,c=r.queryHash??mh(o,r);let m=this.get(c);return m||(m=new TN({client:a,queryKey:o,queryHash:c,options:a.defaultQueryOptions(r),state:s,defaultOptions:a.getQueryDefaults(o)}),this.add(m)),m}add(a){A(this,sa).has(a.queryHash)||(A(this,sa).set(a.queryHash,a),this.notify({type:"added",query:a}))}remove(a){const r=A(this,sa).get(a.queryHash);r&&(a.destroy(),r===a&&A(this,sa).delete(a.queryHash),this.notify({type:"removed",query:a}))}clear(){Tt.batch(()=>{this.getAll().forEach(a=>{this.remove(a)})})}get(a){return A(this,sa).get(a)}getAll(){return[...A(this,sa).values()]}find(a){const r={exact:!0,...a};return this.getAll().find(s=>Jy(r,s))}findAll(a={}){const r=this.getAll();return Object.keys(a).length>0?r.filter(s=>Jy(a,s)):r}notify(a){Tt.batch(()=>{this.listeners.forEach(r=>{r(a)})})}onFocus(){Tt.batch(()=>{this.getAll().forEach(a=>{a.onFocus()})})}onOnline(){Tt.batch(()=>{this.getAll().forEach(a=>{a.onOnline()})})}},sa=new WeakMap,Tx),bt,zr,Tr,Zs,qs,Rr,Hs,Is,Rx,ZN=(Rx=class{constructor(e={}){ye(this,bt);ye(this,zr);ye(this,Tr);ye(this,Zs);ye(this,qs);ye(this,Rr);ye(this,Hs);ye(this,Is);ie(this,bt,e.queryCache||new BN),ie(this,zr,e.mutationCache||new LN),ie(this,Tr,e.defaultOptions||{}),ie(this,Zs,new Map),ie(this,qs,new Map),ie(this,Rr,0)}mount(){Zu(this,Rr)._++,A(this,Rr)===1&&(ie(this,Hs,fh.subscribe(async e=>{e&&(await this.resumePausedMutations(),A(this,bt).onFocus())})),ie(this,Is,oc.subscribe(async e=>{e&&(await this.resumePausedMutations(),A(this,bt).onOnline())})))}unmount(){var e,a;Zu(this,Rr)._--,A(this,Rr)===0&&((e=A(this,Hs))==null||e.call(this),ie(this,Hs,void 0),(a=A(this,Is))==null||a.call(this),ie(this,Is,void 0))}isFetching(e){return A(this,bt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return A(this,zr).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const a=this.defaultQueryOptions({queryKey:e});return(r=A(this,bt).get(a.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const a=this.defaultQueryOptions(e),r=A(this,bt).build(this,a),s=r.state.data;return s===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Or(a.staleTime,r))&&this.prefetchQuery(a),Promise.resolve(s))}getQueriesData(e){return A(this,bt).findAll(e).map(({queryKey:a,state:r})=>{const s=r.data;return[a,s]})}setQueryData(e,a,r){const s=this.defaultQueryOptions({queryKey:e}),o=A(this,bt).get(s.queryHash),c=o==null?void 0:o.state.data,m=SN(a,c);if(m!==void 0)return A(this,bt).build(this,s).setData(m,{...r,manual:!0})}setQueriesData(e,a,r){return Tt.batch(()=>A(this,bt).findAll(e).map(({queryKey:s})=>[s,this.setQueryData(s,a,r)]))}getQueryState(e){var r;const a=this.defaultQueryOptions({queryKey:e});return(r=A(this,bt).get(a.queryHash))==null?void 0:r.state}removeQueries(e){const a=A(this,bt);Tt.batch(()=>{a.findAll(e).forEach(r=>{a.remove(r)})})}resetQueries(e,a){const r=A(this,bt);return Tt.batch(()=>(r.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...e},a)))}cancelQueries(e,a={}){const r={revert:!0,...a},s=Tt.batch(()=>A(this,bt).findAll(e).map(o=>o.cancel(r)));return Promise.all(s).then(Jt).catch(Jt)}invalidateQueries(e,a={}){return Tt.batch(()=>(A(this,bt).findAll(e).forEach(r=>{r.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"},a)))}refetchQueries(e,a={}){const r={...a,cancelRefetch:a.cancelRefetch??!0},s=Tt.batch(()=>A(this,bt).findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let c=o.fetch(void 0,r);return r.throwOnError||(c=c.catch(Jt)),o.state.fetchStatus==="paused"?Promise.resolve():c}));return Promise.all(s).then(Jt)}fetchQuery(e){const a=this.defaultQueryOptions(e);a.retry===void 0&&(a.retry=!1);const r=A(this,bt).build(this,a);return r.isStaleByTime(Or(a.staleTime,r))?r.fetch(a):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Jt).catch(Jt)}fetchInfiniteQuery(e){return e.behavior=sb(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Jt).catch(Jt)}ensureInfiniteQueryData(e){return e.behavior=sb(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return oc.isOnline()?A(this,zr).resumePausedMutations():Promise.resolve()}getQueryCache(){return A(this,bt)}getMutationCache(){return A(this,zr)}getDefaultOptions(){return A(this,Tr)}setDefaultOptions(e){ie(this,Tr,e)}setQueryDefaults(e,a){A(this,Zs).set(El(e),{queryKey:e,defaultOptions:a})}getQueryDefaults(e){const a=[...A(this,Zs).values()],r={};return a.forEach(s=>{eo(e,s.queryKey)&&Object.assign(r,s.defaultOptions)}),r}setMutationDefaults(e,a){A(this,qs).set(El(e),{mutationKey:e,defaultOptions:a})}getMutationDefaults(e){const a=[...A(this,qs).values()],r={};return a.forEach(s=>{eo(e,s.mutationKey)&&Object.assign(r,s.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const a={...A(this,Tr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return a.queryHash||(a.queryHash=mh(a.queryKey,a)),a.refetchOnReconnect===void 0&&(a.refetchOnReconnect=a.networkMode!=="always"),a.throwOnError===void 0&&(a.throwOnError=!!a.suspense),!a.networkMode&&a.persister&&(a.networkMode="offlineFirst"),a.queryFn===hh&&(a.enabled=!1),a}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...A(this,Tr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){A(this,bt).clear(),A(this,zr).clear()}},bt=new WeakMap,zr=new WeakMap,Tr=new WeakMap,Zs=new WeakMap,qs=new WeakMap,Rr=new WeakMap,Hs=new WeakMap,Is=new WeakMap,Rx),Gx=v.createContext(void 0),Zn=e=>{const a=v.useContext(Gx);if(!a)throw new Error("No QueryClient set, use QueryClientProvider to set one");return a},qN=({client:e,children:a})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),u.jsx(Gx.Provider,{value:e,children:a})),Px=v.createContext(!1),HN=()=>v.useContext(Px);Px.Provider;function IN(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var QN=v.createContext(IN()),GN=()=>v.useContext(QN),PN=(e,a,r)=>{const s=r!=null&&r.state.error&&typeof e.throwOnError=="function"?ph(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||s)&&(a.isReset()||(e.retryOnMount=!1))},VN=e=>{v.useEffect(()=>{e.clearReset()},[e])},KN=({result:e,errorResetBoundary:a,throwOnError:r,query:s,suspense:o})=>e.isError&&!a.isReset()&&!e.isFetching&&s&&(o&&e.data===void 0||ph(r,[e.error,s])),YN=e=>{if(e.suspense){const r=o=>o==="static"?o:Math.max(o??1e3,1e3),s=e.staleTime;e.staleTime=typeof s=="function"?(...o)=>r(s(...o)):r(s),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},FN=(e,a)=>e.isLoading&&e.isFetching&&!a,XN=(e,a)=>(e==null?void 0:e.suspense)&&a.isPending,ob=(e,a,r)=>a.fetchOptimistic(e).catch(()=>{r.clearReset()});function JN(e,a,r){var j,N,z,w;const s=HN(),o=GN(),c=Zn(),m=c.defaultQueryOptions(e);(N=(j=c.getDefaultOptions().queries)==null?void 0:j._experimental_beforeQuery)==null||N.call(j,m);const h=c.getQueryCache().get(m.queryHash);m._optimisticResults=s?"isRestoring":"optimistic",YN(m),PN(m,o,h),VN(o);const g=!c.getQueryCache().get(m.queryHash),[p]=v.useState(()=>new a(c,m)),b=p.getOptimisticResult(m),x=!s&&e.subscribed!==!1;if(v.useSyncExternalStore(v.useCallback(E=>{const M=x?p.subscribe(Tt.batchCalls(E)):Jt;return p.updateResult(),M},[p,x]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),v.useEffect(()=>{p.setOptions(m)},[m,p]),XN(m,b))throw ob(m,p,o);if(KN({result:b,errorResetBoundary:o,throwOnError:m.throwOnError,query:h,suspense:m.suspense}))throw b.error;if((w=(z=c.getDefaultOptions().queries)==null?void 0:z._experimental_afterQuery)==null||w.call(z,m,b),m.experimental_prefetchInRender&&!to.isServer()&&FN(b,s)){const E=g?ob(m,p,o):h==null?void 0:h.promise;E==null||E.catch(Jt).finally(()=>{p.updateResult()})}return m.notifyOnChangeProps?b:p.trackResult(b)}function Ie(e,a){return JN(e,RN)}function st(e,a){const r=Zn(),[s]=v.useState(()=>new $N(r,e));v.useEffect(()=>{s.setOptions(e)},[s,e]);const o=v.useSyncExternalStore(v.useCallback(m=>s.subscribe(Tt.batchCalls(m)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),c=v.useCallback((m,h)=>{s.mutate(m,h).catch(Jt)},[s]);if(o.error&&ph(s.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:c,mutateAsync:o.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 ub="popstate";function cb(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function WN(e={}){function a(s,o){var p;let c=(p=o.state)==null?void 0:p.masked,{pathname:m,search:h,hash:g}=c||s.location;return Pm("",{pathname:m,search:h,hash:g},o.state&&o.state.usr||null,o.state&&o.state.key||"default",c?{pathname:s.location.pathname,search:s.location.search,hash:s.location.hash}:void 0)}function r(s,o){return typeof o=="string"?o:no(o)}return tE(a,r,null,e)}function ft(e,a){if(e===!1||e===null||typeof e>"u")throw new Error(a)}function Un(e,a){if(!e){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function eE(){return Math.random().toString(36).substring(2,10)}function db(e,a){return{usr:e.state,key:e.key,idx:a,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Pm(e,a,r=null,s,o){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof a=="string"?Ys(a):a,state:r,key:a&&a.key||s||eE(),unstable_mask:o}}function no({pathname:e="/",search:a="",hash:r=""}){return a&&a!=="?"&&(e+=a.charAt(0)==="?"?a:"?"+a),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function Ys(e){let a={};if(e){let r=e.indexOf("#");r>=0&&(a.hash=e.substring(r),e=e.substring(0,r));let s=e.indexOf("?");s>=0&&(a.search=e.substring(s),e=e.substring(0,s)),e&&(a.pathname=e)}return a}function tE(e,a,r,s={}){let{window:o=document.defaultView,v5Compat:c=!1}=s,m=o.history,h="POP",g=null,p=b();p==null&&(p=0,m.replaceState({...m.state,idx:p},""));function b(){return(m.state||{idx:null}).idx}function x(){h="POP";let E=b(),M=E==null?null:E-p;p=E,g&&g({action:h,location:w.location,delta:M})}function j(E,M){h="PUSH";let Z=cb(E)?E:Pm(w.location,E,M);p=b()+1;let D=db(Z,p),O=w.createHref(Z.unstable_mask||Z);try{m.pushState(D,"",O)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;o.location.assign(O)}c&&g&&g({action:h,location:w.location,delta:1})}function N(E,M){h="REPLACE";let Z=cb(E)?E:Pm(w.location,E,M);p=b();let D=db(Z,p),O=w.createHref(Z.unstable_mask||Z);m.replaceState(D,"",O),c&&g&&g({action:h,location:w.location,delta:0})}function z(E){return nE(E)}let w={get action(){return h},get location(){return e(o,m)},listen(E){if(g)throw new Error("A history only accepts one active listener");return o.addEventListener(ub,x),g=E,()=>{o.removeEventListener(ub,x),g=null}},createHref(E){return a(o,E)},createURL:z,encodeLocation(E){let M=z(E);return{pathname:M.pathname,search:M.search,hash:M.hash}},push:j,replace:N,go(E){return m.go(E)}};return w}function nE(e,a=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),ft(r,"No window.location.(origin|href) available to create URL");let s=typeof e=="string"?e:no(e);return s=s.replace(/ $/,"%20"),!a&&s.startsWith("//")&&(s=r+s),new URL(s,r)}function Vx(e,a,r="/"){return aE(e,a,r,!1)}function aE(e,a,r,s){let o=typeof a=="string"?Ys(a):a,c=Za(o.pathname||"/",r);if(c==null)return null;let m=Kx(e);rE(m);let h=null;for(let g=0;h==null&&g<m.length;++g){let p=pE(c);h=mE(m[g],p,s)}return h}function Kx(e,a=[],r=[],s="",o=!1){let c=(m,h,g=o,p)=>{let b={relativePath:p===void 0?m.path||"":p,caseSensitive:m.caseSensitive===!0,childrenIndex:h,route:m};if(b.relativePath.startsWith("/")){if(!b.relativePath.startsWith(s)&&g)return;ft(b.relativePath.startsWith(s),`Absolute route path "${b.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),b.relativePath=b.relativePath.slice(s.length)}let x=ua([s,b.relativePath]),j=r.concat(b);m.children&&m.children.length>0&&(ft(m.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${x}".`),Kx(m.children,a,j,x,g)),!(m.path==null&&!m.index)&&a.push({path:x,score:dE(x,m.index),routesMeta:j})};return e.forEach((m,h)=>{var g;if(m.path===""||!((g=m.path)!=null&&g.includes("?")))c(m,h);else for(let p of Yx(m.path))c(m,h,!0,p)}),a}function Yx(e){let a=e.split("/");if(a.length===0)return[];let[r,...s]=a,o=r.endsWith("?"),c=r.replace(/\?$/,"");if(s.length===0)return o?[c,""]:[c];let m=Yx(s.join("/")),h=[];return h.push(...m.map(g=>g===""?c:[c,g].join("/"))),o&&h.push(...m),h.map(g=>e.startsWith("/")&&g===""?"/":g)}function rE(e){e.sort((a,r)=>a.score!==r.score?r.score-a.score:fE(a.routesMeta.map(s=>s.childrenIndex),r.routesMeta.map(s=>s.childrenIndex)))}var lE=/^:[\w-]+$/,sE=3,iE=2,oE=1,uE=10,cE=-2,fb=e=>e==="*";function dE(e,a){let r=e.split("/"),s=r.length;return r.some(fb)&&(s+=cE),a&&(s+=iE),r.filter(o=>!fb(o)).reduce((o,c)=>o+(lE.test(c)?sE:c===""?oE:uE),s)}function fE(e,a){return e.length===a.length&&e.slice(0,-1).every((s,o)=>s===a[o])?e[e.length-1]-a[a.length-1]:0}function mE(e,a,r=!1){let{routesMeta:s}=e,o={},c="/",m=[];for(let h=0;h<s.length;++h){let g=s[h],p=h===s.length-1,b=c==="/"?a:a.slice(c.length)||"/",x=uc({path:g.relativePath,caseSensitive:g.caseSensitive,end:p},b),j=g.route;if(!x&&p&&r&&!s[s.length-1].route.index&&(x=uc({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},b)),!x)return null;Object.assign(o,x.params),m.push({params:o,pathname:ua([c,x.pathname]),pathnameBase:bE(ua([c,x.pathnameBase])),route:j}),x.pathnameBase!=="/"&&(c=ua([c,x.pathnameBase]))}return m}function uc(e,a){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,s]=hE(e.path,e.caseSensitive,e.end),o=a.match(r);if(!o)return null;let c=o[0],m=c.replace(/(.)\/+$/,"$1"),h=o.slice(1);return{params:s.reduce((p,{paramName:b,isOptional:x},j)=>{if(b==="*"){let z=h[j]||"";m=c.slice(0,c.length-z.length).replace(/(.)\/+$/,"$1")}const N=h[j];return x&&!N?p[b]=void 0:p[b]=(N||"").replace(/%2F/g,"/"),p},{}),pathname:c,pathnameBase:m,pattern:e}}function hE(e,a=!1,r=!0){Un(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 s=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(m,h,g,p,b)=>{if(s.push({paramName:h,isOptional:g!=null}),g){let x=b.charAt(p+m.length);return x&&x!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(s.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,a?void 0:"i"),s]}function pE(e){try{return e.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return Un(!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 (${a}).`),e}}function Za(e,a){if(a==="/")return e;if(!e.toLowerCase().startsWith(a.toLowerCase()))return null;let r=a.endsWith("/")?a.length-1:a.length,s=e.charAt(r);return s&&s!=="/"?null:e.slice(r)||"/"}var gE=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function vE(e,a="/"){let{pathname:r,search:s="",hash:o=""}=typeof e=="string"?Ys(e):e,c;return r?(r=r.replace(/\/\/+/g,"/"),r.startsWith("/")?c=mb(r.substring(1),"/"):c=mb(r,a)):c=a,{pathname:c,search:xE(s),hash:SE(o)}}function mb(e,a){let r=a.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?r.length>1&&r.pop():o!=="."&&r.push(o)}),r.length>1?r.join("/"):"/"}function im(e,a,r,s){return`Cannot include a '${e}' character in a manually specified \`to.${a}\` field [${JSON.stringify(s)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function yE(e){return e.filter((a,r)=>r===0||a.route.path&&a.route.path.length>0)}function vh(e){let a=yE(e);return a.map((r,s)=>s===a.length-1?r.pathname:r.pathnameBase)}function yc(e,a,r,s=!1){let o;typeof e=="string"?o=Ys(e):(o={...e},ft(!o.pathname||!o.pathname.includes("?"),im("?","pathname","search",o)),ft(!o.pathname||!o.pathname.includes("#"),im("#","pathname","hash",o)),ft(!o.search||!o.search.includes("#"),im("#","search","hash",o)));let c=e===""||o.pathname==="",m=c?"/":o.pathname,h;if(m==null)h=r;else{let x=a.length-1;if(!s&&m.startsWith("..")){let j=m.split("/");for(;j[0]==="..";)j.shift(),x-=1;o.pathname=j.join("/")}h=x>=0?a[x]:"/"}let g=vE(o,h),p=m&&m!=="/"&&m.endsWith("/"),b=(c||m===".")&&r.endsWith("/");return!g.pathname.endsWith("/")&&(p||b)&&(g.pathname+="/"),g}var ua=e=>e.join("/").replace(/\/\/+/g,"/"),bE=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),xE=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,SE=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,jE=class{constructor(e,a,r,s=!1){this.status=e,this.statusText=a||"",this.internal=s,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function wE(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function NE(e){return e.map(a=>a.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Fx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Xx(e,a){let r=e;if(typeof r!="string"||!gE.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let s=r,o=!1;if(Fx)try{let c=new URL(window.location.href),m=r.startsWith("//")?new URL(c.protocol+r):new URL(r),h=Za(m.pathname,a);m.origin===c.origin&&h!=null?r=h+m.search+m.hash:o=!0}catch{Un(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:s,isExternal:o,to:r}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Jx=["POST","PUT","PATCH","DELETE"];new Set(Jx);var EE=["GET",...Jx];new Set(EE);var Fs=v.createContext(null);Fs.displayName="DataRouter";var bc=v.createContext(null);bc.displayName="DataRouterState";var _E=v.createContext(!1),Wx=v.createContext({isTransitioning:!1});Wx.displayName="ViewTransition";var CE=v.createContext(new Map);CE.displayName="Fetchers";var AE=v.createContext(null);AE.displayName="Await";var Sn=v.createContext(null);Sn.displayName="Navigation";var go=v.createContext(null);go.displayName="Location";var qn=v.createContext({outlet:null,matches:[],isDataRoute:!1});qn.displayName="Route";var yh=v.createContext(null);yh.displayName="RouteError";var e0="REACT_ROUTER_ERROR",kE="REDIRECT",zE="ROUTE_ERROR_RESPONSE";function TE(e){if(e.startsWith(`${e0}:${kE}:{`))try{let a=JSON.parse(e.slice(28));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.location=="string"&&typeof a.reloadDocument=="boolean"&&typeof a.replace=="boolean")return a}catch{}}function RE(e){if(e.startsWith(`${e0}:${zE}:{`))try{let a=JSON.parse(e.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new jE(a.status,a.statusText,a.data)}catch{}}function OE(e,{relative:a}={}){ft(Xs(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:s}=v.useContext(Sn),{hash:o,pathname:c,search:m}=vo(e,{relative:a}),h=c;return r!=="/"&&(h=c==="/"?r:ua([r,c])),s.createHref({pathname:h,search:m,hash:o})}function Xs(){return v.useContext(go)!=null}function Hn(){return ft(Xs(),"useLocation() may be used only in the context of a <Router> component."),v.useContext(go).location}var t0="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function n0(e){v.useContext(Sn).static||v.useLayoutEffect(e)}function Qa(){let{isDataRoute:e}=v.useContext(qn);return e?YE():ME()}function ME(){ft(Xs(),"useNavigate() may be used only in the context of a <Router> component.");let e=v.useContext(Fs),{basename:a,navigator:r}=v.useContext(Sn),{matches:s}=v.useContext(qn),{pathname:o}=Hn(),c=JSON.stringify(vh(s)),m=v.useRef(!1);return n0(()=>{m.current=!0}),v.useCallback((g,p={})=>{if(Un(m.current,t0),!m.current)return;if(typeof g=="number"){r.go(g);return}let b=yc(g,JSON.parse(c),o,p.relative==="path");e==null&&a!=="/"&&(b.pathname=b.pathname==="/"?a:ua([a,b.pathname])),(p.replace?r.replace:r.push)(b,p.state,p)},[a,r,c,o,e])}var DE=v.createContext(null);function UE(e){let a=v.useContext(qn).outlet;return v.useMemo(()=>a&&v.createElement(DE.Provider,{value:e},a),[a,e])}function LE(){let{matches:e}=v.useContext(qn),a=e[e.length-1];return a?a.params:{}}function vo(e,{relative:a}={}){let{matches:r}=v.useContext(qn),{pathname:s}=Hn(),o=JSON.stringify(vh(r));return v.useMemo(()=>yc(e,JSON.parse(o),s,a==="path"),[e,o,s,a])}function $E(e,a){return a0(e,a)}function a0(e,a,r){var E;ft(Xs(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=v.useContext(Sn),{matches:o}=v.useContext(qn),c=o[o.length-1],m=c?c.params:{},h=c?c.pathname:"/",g=c?c.pathnameBase:"/",p=c&&c.route;{let M=p&&p.path||"";l0(h,!p||M.endsWith("*")||M.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${h}" (under <Route path="${M}">) 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="${M}"> to <Route path="${M==="/"?"*":`${M}/*`}">.`)}let b=Hn(),x;if(a){let M=typeof a=="string"?Ys(a):a;ft(g==="/"||((E=M.pathname)==null?void 0:E.startsWith(g)),`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 "${g}" but pathname "${M.pathname}" was given in the \`location\` prop.`),x=M}else x=b;let j=x.pathname||"/",N=j;if(g!=="/"){let M=g.replace(/^\//,"").split("/");N="/"+j.replace(/^\//,"").split("/").slice(M.length).join("/")}let z=Vx(e,{pathname:N});Un(p||z!=null,`No routes matched location "${x.pathname}${x.search}${x.hash}" `),Un(z==null||z[z.length-1].route.element!==void 0||z[z.length-1].route.Component!==void 0||z[z.length-1].route.lazy!==void 0,`Matched leaf route at location "${x.pathname}${x.search}${x.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 w=IE(z&&z.map(M=>Object.assign({},M,{params:Object.assign({},m,M.params),pathname:ua([g,s.encodeLocation?s.encodeLocation(M.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:M.pathname]),pathnameBase:M.pathnameBase==="/"?g:ua([g,s.encodeLocation?s.encodeLocation(M.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:M.pathnameBase])})),o,r);return a&&w?v.createElement(go.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...x},navigationType:"POP"}},w):w}function BE(){let e=KE(),a=wE(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,s="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:s},c={padding:"2px 4px",backgroundColor:s},m=null;return console.error("Error handled by React Router default ErrorBoundary:",e),m=v.createElement(v.Fragment,null,v.createElement("p",null,"💿 Hey developer 👋"),v.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",v.createElement("code",{style:c},"ErrorBoundary")," or"," ",v.createElement("code",{style:c},"errorElement")," prop on your route.")),v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},a),r?v.createElement("pre",{style:o},r):null,m)}var ZE=v.createElement(BE,null),r0=class extends v.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,a){return a.location!==e.location||a.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:a.error,location:a.location,revalidation:e.revalidation||a.revalidation}}componentDidCatch(e,a){this.props.onError?this.props.onError(e,a):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 r=RE(e.digest);r&&(e=r)}let a=e!==void 0?v.createElement(qn.Provider,{value:this.props.routeContext},v.createElement(yh.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?v.createElement(qE,{error:e},a):a}};r0.contextType=_E;var om=new WeakMap;function qE({children:e,error:a}){let{basename:r}=v.useContext(Sn);if(typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){let s=TE(a.digest);if(s){let o=om.get(a);if(o)throw o;let c=Xx(s.location,r);if(Fx&&!om.get(a))if(c.isExternal||s.reloadDocument)window.location.href=c.absoluteURL||c.to;else{const m=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(c.to,{replace:s.replace}));throw om.set(a,m),m}return v.createElement("meta",{httpEquiv:"refresh",content:`0;url=${c.absoluteURL||c.to}`})}}return e}function HE({routeContext:e,match:a,children:r}){let s=v.useContext(Fs);return s&&s.static&&s.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=a.route.id),v.createElement(qn.Provider,{value:e},r)}function IE(e,a=[],r){let s=r==null?void 0:r.state;if(e==null){if(!s)return null;if(s.errors)e=s.matches;else if(a.length===0&&!s.initialized&&s.matches.length>0)e=s.matches;else return null}let o=e,c=s==null?void 0:s.errors;if(c!=null){let b=o.findIndex(x=>x.route.id&&(c==null?void 0:c[x.route.id])!==void 0);ft(b>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(c).join(",")}`),o=o.slice(0,Math.min(o.length,b+1))}let m=!1,h=-1;if(r&&s){m=s.renderFallback;for(let b=0;b<o.length;b++){let x=o[b];if((x.route.HydrateFallback||x.route.hydrateFallbackElement)&&(h=b),x.route.id){let{loaderData:j,errors:N}=s,z=x.route.loader&&!j.hasOwnProperty(x.route.id)&&(!N||N[x.route.id]===void 0);if(x.route.lazy||z){r.isStatic&&(m=!0),h>=0?o=o.slice(0,h+1):o=[o[0]];break}}}}let g=r==null?void 0:r.onError,p=s&&g?(b,x)=>{var j,N;g(b,{location:s.location,params:((N=(j=s.matches)==null?void 0:j[0])==null?void 0:N.params)??{},unstable_pattern:NE(s.matches),errorInfo:x})}:void 0;return o.reduceRight((b,x,j)=>{let N,z=!1,w=null,E=null;s&&(N=c&&x.route.id?c[x.route.id]:void 0,w=x.route.errorElement||ZE,m&&(h<0&&j===0?(l0("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),z=!0,E=null):h===j&&(z=!0,E=x.route.hydrateFallbackElement||null)));let M=a.concat(o.slice(0,j+1)),Z=()=>{let D;return N?D=w:z?D=E:x.route.Component?D=v.createElement(x.route.Component,null):x.route.element?D=x.route.element:D=b,v.createElement(HE,{match:x,routeContext:{outlet:b,matches:M,isDataRoute:s!=null},children:D})};return s&&(x.route.ErrorBoundary||x.route.errorElement||j===0)?v.createElement(r0,{location:s.location,revalidation:s.revalidation,component:w,error:N,children:Z(),routeContext:{outlet:null,matches:M,isDataRoute:!0},onError:p}):Z()},null)}function bh(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function QE(e){let a=v.useContext(Fs);return ft(a,bh(e)),a}function GE(e){let a=v.useContext(bc);return ft(a,bh(e)),a}function PE(e){let a=v.useContext(qn);return ft(a,bh(e)),a}function xh(e){let a=PE(e),r=a.matches[a.matches.length-1];return ft(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function VE(){return xh("useRouteId")}function KE(){var s;let e=v.useContext(yh),a=GE("useRouteError"),r=xh("useRouteError");return e!==void 0?e:(s=a.errors)==null?void 0:s[r]}function YE(){let{router:e}=QE("useNavigate"),a=xh("useNavigate"),r=v.useRef(!1);return n0(()=>{r.current=!0}),v.useCallback(async(o,c={})=>{Un(r.current,t0),r.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:a,...c}))},[e,a])}var hb={};function l0(e,a,r){!a&&!hb[e]&&(hb[e]=!0,Un(!1,r))}v.memo(FE);function FE({routes:e,future:a,state:r,isStatic:s,onError:o}){return a0(e,void 0,{state:r,isStatic:s,onError:o})}function s0({to:e,replace:a,state:r,relative:s}){ft(Xs(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=v.useContext(Sn);Un(!o,"<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:c}=v.useContext(qn),{pathname:m}=Hn(),h=Qa(),g=yc(e,vh(c),m,s==="path"),p=JSON.stringify(g);return v.useEffect(()=>{h(JSON.parse(p),{replace:a,state:r,relative:s})},[h,p,s,a,r]),null}function Vm(e){return UE(e.context)}function Ra(e){ft(!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 XE({basename:e="/",children:a=null,location:r,navigationType:s="POP",navigator:o,static:c=!1,unstable_useTransitions:m}){ft(!Xs(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let h=e.replace(/^\/*/,"/"),g=v.useMemo(()=>({basename:h,navigator:o,static:c,unstable_useTransitions:m,future:{}}),[h,o,c,m]);typeof r=="string"&&(r=Ys(r));let{pathname:p="/",search:b="",hash:x="",state:j=null,key:N="default",unstable_mask:z}=r,w=v.useMemo(()=>{let E=Za(p,h);return E==null?null:{location:{pathname:E,search:b,hash:x,state:j,key:N,unstable_mask:z},navigationType:s}},[h,p,b,x,j,N,s,z]);return Un(w!=null,`<Router basename="${h}"> is not able to match the URL "${p}${b}${x}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:v.createElement(Sn.Provider,{value:g},v.createElement(go.Provider,{children:a,value:w}))}function JE({children:e,location:a}){return $E(Km(e),a)}function Km(e,a=[]){let r=[];return v.Children.forEach(e,(s,o)=>{if(!v.isValidElement(s))return;let c=[...a,o];if(s.type===v.Fragment){r.push.apply(r,Km(s.props.children,c));return}ft(s.type===Ra,`[${typeof s.type=="string"?s.type:s.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),ft(!s.props.index||!s.props.children,"An index route cannot have child routes.");let m={id:s.props.id||c.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,middleware:s.props.middleware,loader:s.props.loader,action:s.props.action,hydrateFallbackElement:s.props.hydrateFallbackElement,HydrateFallback:s.props.HydrateFallback,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.hasErrorBoundary===!0||s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(m.children=Km(s.props.children,c)),r.push(m)}),r}var tc="get",nc="application/x-www-form-urlencoded";function xc(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function WE(e){return xc(e)&&e.tagName.toLowerCase()==="button"}function e_(e){return xc(e)&&e.tagName.toLowerCase()==="form"}function t_(e){return xc(e)&&e.tagName.toLowerCase()==="input"}function n_(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function a_(e,a){return e.button===0&&(!a||a==="_self")&&!n_(e)}function Ym(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((a,r)=>{let s=e[r];return a.concat(Array.isArray(s)?s.map(o=>[r,o]):[[r,s]])},[]))}function r_(e,a){let r=Ym(e);return a&&a.forEach((s,o)=>{r.has(o)||a.getAll(o).forEach(c=>{r.append(o,c)})}),r}var Hu=null;function l_(){if(Hu===null)try{new FormData(document.createElement("form"),0),Hu=!1}catch{Hu=!0}return Hu}var s_=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function um(e){return e!=null&&!s_.has(e)?(Un(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${nc}"`),null):e}function i_(e,a){let r,s,o,c,m;if(e_(e)){let h=e.getAttribute("action");s=h?Za(h,a):null,r=e.getAttribute("method")||tc,o=um(e.getAttribute("enctype"))||nc,c=new FormData(e)}else if(WE(e)||t_(e)&&(e.type==="submit"||e.type==="image")){let h=e.form;if(h==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let g=e.getAttribute("formaction")||h.getAttribute("action");if(s=g?Za(g,a):null,r=e.getAttribute("formmethod")||h.getAttribute("method")||tc,o=um(e.getAttribute("formenctype"))||um(h.getAttribute("enctype"))||nc,c=new FormData(h,e),!l_()){let{name:p,type:b,value:x}=e;if(b==="image"){let j=p?`${p}.`:"";c.append(`${j}x`,"0"),c.append(`${j}y`,"0")}else p&&c.append(p,x)}}else{if(xc(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=tc,s=null,o=nc,m=e}return c&&o==="text/plain"&&(m=c,c=void 0),{action:s,method:r.toLowerCase(),encType:o,formData:c,body:m}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Sh(e,a){if(e===!1||e===null||typeof e>"u")throw new Error(a)}function o_(e,a,r,s){let o=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${s}`:o.pathname=`${o.pathname}.${s}`:o.pathname==="/"?o.pathname=`_root.${s}`:a&&Za(o.pathname,a)==="/"?o.pathname=`${a.replace(/\/$/,"")}/_root.${s}`:o.pathname=`${o.pathname.replace(/\/$/,"")}.${s}`,o}async function u_(e,a){if(e.id in a)return a[e.id];try{let r=await import(e.module);return a[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function c_(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 d_(e,a,r){let s=await Promise.all(e.map(async o=>{let c=a.routes[o.route.id];if(c){let m=await u_(c,r);return m.links?m.links():[]}return[]}));return p_(s.flat(1).filter(c_).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function pb(e,a,r,s,o,c){let m=(g,p)=>r[p]?g.route.id!==r[p].route.id:!0,h=(g,p)=>{var b;return r[p].pathname!==g.pathname||((b=r[p].route.path)==null?void 0:b.endsWith("*"))&&r[p].params["*"]!==g.params["*"]};return c==="assets"?a.filter((g,p)=>m(g,p)||h(g,p)):c==="data"?a.filter((g,p)=>{var x;let b=s.routes[g.route.id];if(!b||!b.hasLoader)return!1;if(m(g,p)||h(g,p))return!0;if(g.route.shouldRevalidate){let j=g.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:((x=r[0])==null?void 0:x.params)||{},nextUrl:new URL(e,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof j=="boolean")return j}return!0}):[]}function f_(e,a,{includeHydrateFallback:r}={}){return m_(e.map(s=>{let o=a.routes[s.route.id];if(!o)return[];let c=[o.module];return o.clientActionModule&&(c=c.concat(o.clientActionModule)),o.clientLoaderModule&&(c=c.concat(o.clientLoaderModule)),r&&o.hydrateFallbackModule&&(c=c.concat(o.hydrateFallbackModule)),o.imports&&(c=c.concat(o.imports)),c}).flat(1))}function m_(e){return[...new Set(e)]}function h_(e){let a={},r=Object.keys(e).sort();for(let s of r)a[s]=e[s];return a}function p_(e,a){let r=new Set;return new Set(a),e.reduce((s,o)=>{let c=JSON.stringify(h_(o));return r.has(c)||(r.add(c),s.push({key:c,link:o})),s},[])}function i0(){let e=v.useContext(Fs);return Sh(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function g_(){let e=v.useContext(bc);return Sh(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var jh=v.createContext(void 0);jh.displayName="FrameworkContext";function o0(){let e=v.useContext(jh);return Sh(e,"You must render this element inside a <HydratedRouter> element"),e}function v_(e,a){let r=v.useContext(jh),[s,o]=v.useState(!1),[c,m]=v.useState(!1),{onFocus:h,onBlur:g,onMouseEnter:p,onMouseLeave:b,onTouchStart:x}=a,j=v.useRef(null);v.useEffect(()=>{if(e==="render"&&m(!0),e==="viewport"){let w=M=>{M.forEach(Z=>{m(Z.isIntersecting)})},E=new IntersectionObserver(w,{threshold:.5});return j.current&&E.observe(j.current),()=>{E.disconnect()}}},[e]),v.useEffect(()=>{if(s){let w=setTimeout(()=>{m(!0)},100);return()=>{clearTimeout(w)}}},[s]);let N=()=>{o(!0)},z=()=>{o(!1),m(!1)};return r?e!=="intent"?[c,j,{}]:[c,j,{onFocus:Pi(h,N),onBlur:Pi(g,z),onMouseEnter:Pi(p,N),onMouseLeave:Pi(b,z),onTouchStart:Pi(x,N)}]:[!1,j,{}]}function Pi(e,a){return r=>{e&&e(r),r.defaultPrevented||a(r)}}function y_({page:e,...a}){let{router:r}=i0(),s=v.useMemo(()=>Vx(r.routes,e,r.basename),[r.routes,e,r.basename]);return s?v.createElement(x_,{page:e,matches:s,...a}):null}function b_(e){let{manifest:a,routeModules:r}=o0(),[s,o]=v.useState([]);return v.useEffect(()=>{let c=!1;return d_(e,a,r).then(m=>{c||o(m)}),()=>{c=!0}},[e,a,r]),s}function x_({page:e,matches:a,...r}){let s=Hn(),{future:o,manifest:c,routeModules:m}=o0(),{basename:h}=i0(),{loaderData:g,matches:p}=g_(),b=v.useMemo(()=>pb(e,a,p,c,s,"data"),[e,a,p,c,s]),x=v.useMemo(()=>pb(e,a,p,c,s,"assets"),[e,a,p,c,s]),j=v.useMemo(()=>{if(e===s.pathname+s.search+s.hash)return[];let w=new Set,E=!1;if(a.forEach(Z=>{var O;let D=c.routes[Z.route.id];!D||!D.hasLoader||(!b.some(P=>P.route.id===Z.route.id)&&Z.route.id in g&&((O=m[Z.route.id])!=null&&O.shouldRevalidate)||D.hasClientLoader?E=!0:w.add(Z.route.id))}),w.size===0)return[];let M=o_(e,h,o.unstable_trailingSlashAwareDataRequests,"data");return E&&w.size>0&&M.searchParams.set("_routes",a.filter(Z=>w.has(Z.route.id)).map(Z=>Z.route.id).join(",")),[M.pathname+M.search]},[h,o.unstable_trailingSlashAwareDataRequests,g,s,c,b,a,e,m]),N=v.useMemo(()=>f_(x,c),[x,c]),z=b_(x);return v.createElement(v.Fragment,null,j.map(w=>v.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...r})),N.map(w=>v.createElement("link",{key:w,rel:"modulepreload",href:w,...r})),z.map(({key:w,link:E})=>v.createElement("link",{key:w,nonce:r.nonce,...E,crossOrigin:E.crossOrigin??r.crossOrigin})))}function S_(...e){return a=>{e.forEach(r=>{typeof r=="function"?r(a):r!=null&&(r.current=a)})}}var j_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{j_&&(window.__reactRouterVersion="7.13.1")}catch{}function w_({basename:e,children:a,unstable_useTransitions:r,window:s}){let o=v.useRef();o.current==null&&(o.current=WN({window:s,v5Compat:!0}));let c=o.current,[m,h]=v.useState({action:c.action,location:c.location}),g=v.useCallback(p=>{r===!1?h(p):v.startTransition(()=>h(p))},[r]);return v.useLayoutEffect(()=>c.listen(g),[c,g]),v.createElement(XE,{basename:e,children:a,location:m.location,navigationType:m.action,navigator:c,unstable_useTransitions:r})}var u0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,c0=v.forwardRef(function({onClick:a,discover:r="render",prefetch:s="none",relative:o,reloadDocument:c,replace:m,unstable_mask:h,state:g,target:p,to:b,preventScrollReset:x,viewTransition:j,unstable_defaultShouldRevalidate:N,...z},w){let{basename:E,navigator:M,unstable_useTransitions:Z}=v.useContext(Sn),D=typeof b=="string"&&u0.test(b),O=Xx(b,E);b=O.to;let P=OE(b,{relative:o}),I=Hn(),L=null;if(h){let we=yc(h,[],I.unstable_mask?I.unstable_mask.pathname:"/",!0);E!=="/"&&(we.pathname=we.pathname==="/"?E:ua([E,we.pathname])),L=M.createHref(we)}let[K,se,Se]=v_(s,z),_e=__(b,{replace:m,unstable_mask:h,state:g,target:p,preventScrollReset:x,relative:o,viewTransition:j,unstable_defaultShouldRevalidate:N,unstable_useTransitions:Z});function re(we){a&&a(we),we.defaultPrevented||_e(we)}let ve=!(O.isExternal||c),Te=v.createElement("a",{...z,...Se,href:(ve?L:void 0)||O.absoluteURL||P,onClick:ve?re:a,ref:S_(w,se),target:p,"data-discover":!D&&r==="render"?"true":void 0});return K&&!D?v.createElement(v.Fragment,null,Te,v.createElement(y_,{page:P})):Te});c0.displayName="Link";var d0=v.forwardRef(function({"aria-current":a="page",caseSensitive:r=!1,className:s="",end:o=!1,style:c,to:m,viewTransition:h,children:g,...p},b){let x=vo(m,{relative:p.relative}),j=Hn(),N=v.useContext(bc),{navigator:z,basename:w}=v.useContext(Sn),E=N!=null&&T_(x)&&h===!0,M=z.encodeLocation?z.encodeLocation(x).pathname:x.pathname,Z=j.pathname,D=N&&N.navigation&&N.navigation.location?N.navigation.location.pathname:null;r||(Z=Z.toLowerCase(),D=D?D.toLowerCase():null,M=M.toLowerCase()),D&&w&&(D=Za(D,w)||D);const O=M!=="/"&&M.endsWith("/")?M.length-1:M.length;let P=Z===M||!o&&Z.startsWith(M)&&Z.charAt(O)==="/",I=D!=null&&(D===M||!o&&D.startsWith(M)&&D.charAt(M.length)==="/"),L={isActive:P,isPending:I,isTransitioning:E},K=P?a:void 0,se;typeof s=="function"?se=s(L):se=[s,P?"active":null,I?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let Se=typeof c=="function"?c(L):c;return v.createElement(c0,{...p,"aria-current":K,className:se,ref:b,style:Se,to:m,viewTransition:h},typeof g=="function"?g(L):g)});d0.displayName="NavLink";var N_=v.forwardRef(({discover:e="render",fetcherKey:a,navigate:r,reloadDocument:s,replace:o,state:c,method:m=tc,action:h,onSubmit:g,relative:p,preventScrollReset:b,viewTransition:x,unstable_defaultShouldRevalidate:j,...N},z)=>{let{unstable_useTransitions:w}=v.useContext(Sn),E=k_(),M=z_(h,{relative:p}),Z=m.toLowerCase()==="get"?"get":"post",D=typeof h=="string"&&u0.test(h),O=P=>{if(g&&g(P),P.defaultPrevented)return;P.preventDefault();let I=P.nativeEvent.submitter,L=(I==null?void 0:I.getAttribute("formmethod"))||m,K=()=>E(I||P.currentTarget,{fetcherKey:a,method:L,navigate:r,replace:o,state:c,relative:p,preventScrollReset:b,viewTransition:x,unstable_defaultShouldRevalidate:j});w&&r!==!1?v.startTransition(()=>K()):K()};return v.createElement("form",{ref:z,method:Z,action:M,onSubmit:s?g:O,...N,"data-discover":!D&&e==="render"?"true":void 0})});N_.displayName="Form";function E_(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function f0(e){let a=v.useContext(Fs);return ft(a,E_(e)),a}function __(e,{target:a,replace:r,unstable_mask:s,state:o,preventScrollReset:c,relative:m,viewTransition:h,unstable_defaultShouldRevalidate:g,unstable_useTransitions:p}={}){let b=Qa(),x=Hn(),j=vo(e,{relative:m});return v.useCallback(N=>{if(a_(N,a)){N.preventDefault();let z=r!==void 0?r:no(x)===no(j),w=()=>b(e,{replace:z,unstable_mask:s,state:o,preventScrollReset:c,relative:m,viewTransition:h,unstable_defaultShouldRevalidate:g});p?v.startTransition(()=>w()):w()}},[x,b,j,r,s,o,a,e,c,m,h,g,p])}function m0(e){Un(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 a=v.useRef(Ym(e)),r=v.useRef(!1),s=Hn(),o=v.useMemo(()=>r_(s.search,r.current?null:a.current),[s.search]),c=Qa(),m=v.useCallback((h,g)=>{const p=Ym(typeof h=="function"?h(new URLSearchParams(o)):h);r.current=!0,c("?"+p,g)},[c,o]);return[o,m]}var C_=0,A_=()=>`__${String(++C_)}__`;function k_(){let{router:e}=f0("useSubmit"),{basename:a}=v.useContext(Sn),r=VE(),s=e.fetch,o=e.navigate;return v.useCallback(async(c,m={})=>{let{action:h,method:g,encType:p,formData:b,body:x}=i_(c,a);if(m.navigate===!1){let j=m.fetcherKey||A_();await s(j,r,m.action||h,{unstable_defaultShouldRevalidate:m.unstable_defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:b,body:x,formMethod:m.method||g,formEncType:m.encType||p,flushSync:m.flushSync})}else await o(m.action||h,{unstable_defaultShouldRevalidate:m.unstable_defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:b,body:x,formMethod:m.method||g,formEncType:m.encType||p,replace:m.replace,state:m.state,fromRouteId:r,flushSync:m.flushSync,viewTransition:m.viewTransition})},[s,o,a,r])}function z_(e,{relative:a}={}){let{basename:r}=v.useContext(Sn),s=v.useContext(qn);ft(s,"useFormAction must be used inside a RouteContext");let[o]=s.matches.slice(-1),c={...vo(e||".",{relative:a})},m=Hn();if(e==null){c.search=m.search;let h=new URLSearchParams(c.search),g=h.getAll("index");if(g.some(b=>b==="")){h.delete("index"),g.filter(x=>x).forEach(x=>h.append("index",x));let b=h.toString();c.search=b?`?${b}`:""}}return(!e||e===".")&&o.route.index&&(c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(c.pathname=c.pathname==="/"?r:ua([r,c.pathname])),no(c)}function T_(e,{relative:a}={}){let r=v.useContext(Wx);ft(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=f0("useViewTransitionState"),o=vo(e,{relative:a});if(!r.isTransitioning)return!1;let c=Za(r.currentLocation.pathname,s)||r.currentLocation.pathname,m=Za(r.nextLocation.pathname,s)||r.nextLocation.pathname;return uc(o.pathname,m)!=null||uc(o.pathname,c)!=null}const R_="/api/v1";async function O_(e,a){const r=await fetch(`${R_}/auth/login`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:e,password:a})});if(!r.ok){const s=await r.text();let o;try{o=JSON.parse(s).error??s}catch{o=s}throw new Error(o)}return await r.json()}const h0="/api/v1",wh="first-tree-hub:tokens";function Nh(){const e=localStorage.getItem(wh);if(!e)return null;try{return JSON.parse(e)}catch{return null}}function p0(e){localStorage.setItem(wh,JSON.stringify(e))}function g0(){localStorage.removeItem(wh)}class Sc extends Error{constructor(a,r,s){super(r),this.status=a,this.issues=s,this.name="ApiError"}}let Vi=null;async function M_(e){return Vi||(Vi=(async()=>{try{const a=await fetch(`${h0}/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:e})});if(!a.ok)return null;const r=await a.json(),s={accessToken:r.accessToken,refreshToken:r.refreshToken??e};return p0(s),s}catch{return null}finally{Vi=null}})(),Vi)}async function Iu(e,a){const{method:r="GET",body:s}=a??{},o=h=>{const g={};return h&&(g.Authorization=`Bearer ${h}`),s!==void 0&&(g["Content-Type"]="application/json"),fetch(`${h0}${e}`,{method:r,headers:g,body:s!==void 0?JSON.stringify(s):void 0})},c=Nh();let m=await o(c==null?void 0:c.accessToken);if(m.status===401&&(c!=null&&c.refreshToken)){const h=await M_(c.refreshToken);h&&(m=await o(h.accessToken))}if(!m.ok){m.status===401&&(g0(),window.dispatchEvent(new CustomEvent("auth:logout")));const h=await m.text();let g,p;try{const b=JSON.parse(h);g=b.error??h,Array.isArray(b.details)&&(p=b.details.filter(x=>typeof x=="object"&&x!==null&&Array.isArray(x.path)))}catch{g=h}throw new Sc(m.status,g,p)}if(m.status!==204)return await m.json()}const ke={get:e=>Iu(e),post:(e,a)=>Iu(e,{method:"POST",body:a}),patch:(e,a)=>Iu(e,{method:"PATCH",body:a}),delete:e=>Iu(e,{method:"DELETE"})},v0=v.createContext(null);function D_({children:e}){const[a,r]=v.useState(()=>!!Nh()),[s,o]=v.useState(null),[c,m]=v.useState(null),[h,g]=v.useState(null),p=v.useCallback(()=>{g0(),r(!1),o(null),m(null),g(null)},[]),b=v.useCallback(async()=>{try{const j=await ke.get("/me");o(j.member.role),m(j.member.id),g(j.member.agentId)}catch{}},[]),x=v.useCallback(async(j,N)=>{const z=await O_(j,N);p0({accessToken:z.accessToken,refreshToken:z.refreshToken}),r(!0),await ke.get("/me").then(w=>{o(w.member.role),m(w.member.id),g(w.member.agentId)}).catch(()=>{})},[]);return v.useEffect(()=>{a&&!s&&b()},[a,s,b]),v.useEffect(()=>{const j=()=>p();return window.addEventListener("auth:logout",j),()=>window.removeEventListener("auth:logout",j)},[p]),u.jsx(v0.Provider,{value:{isAuthenticated:a,role:s,memberId:c,agentId:h,login:x,logout:p},children:e})}function yo(){const e=v.useContext(v0);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}function U_(){const{isAuthenticated:e}=yo();return e?u.jsx(Vm,{}):u.jsx(s0,{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 y0=(...e)=>e.filter((a,r,s)=>!!a&&a.trim()!==""&&s.indexOf(a)===r).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 L_=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 $_=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,r,s)=>s?s.toUpperCase():r.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 gb=e=>{const a=$_(e);return a.charAt(0).toUpperCase()+a.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 B_={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 Z_=e=>{for(const a in e)if(a.startsWith("aria-")||a==="role"||a==="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 q_=v.forwardRef(({color:e="currentColor",size:a=24,strokeWidth:r=2,absoluteStrokeWidth:s,className:o="",children:c,iconNode:m,...h},g)=>v.createElement("svg",{ref:g,...B_,width:a,height:a,stroke:e,strokeWidth:s?Number(r)*24/Number(a):r,className:y0("lucide",o),...!c&&!Z_(h)&&{"aria-hidden":"true"},...h},[...m.map(([p,b])=>v.createElement(p,b)),...Array.isArray(c)?c:[c]]));/**
|
|
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 Je=(e,a)=>{const r=v.forwardRef(({className:s,...o},c)=>v.createElement(q_,{ref:c,iconNode:a,className:y0(`lucide-${L_(gb(e))}`,`lucide-${e}`,s),...o}));return r.displayName=gb(e),r};/**
|
|
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 H_=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],I_=Je("arrow-left",H_);/**
|
|
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 Q_=[["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"}]],G_=Je("bell",Q_);/**
|
|
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 P_=[["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"}]],V_=Je("bot",P_);/**
|
|
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 K_=[["path",{d:"M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z",key:"trhst0"}],["path",{d:"M17 21v-2",key:"ds4u3f"}],["path",{d:"M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10",key:"1mo9zo"}],["path",{d:"M21 21v-2",key:"eo0ou"}],["path",{d:"M3 5V3",key:"1k5hjh"}],["path",{d:"M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z",key:"1dd30t"}],["path",{d:"M7 5V3",key:"1t1388"}]],Y_=Je("cable",K_);/**
|
|
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 F_=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],b0=Je("check",F_);/**
|
|
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 X_=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],J_=Je("chevron-down",X_);/**
|
|
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 W_=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],e2=Je("chevron-right",W_);/**
|
|
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 t2=[["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"}]],Eh=Je("copy",t2);/**
|
|
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 n2=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],x0=Je("ellipsis",n2);/**
|
|
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 a2=[["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"}]],r2=Je("layout-dashboard",a2);/**
|
|
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 l2=[["path",{d:"M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10Z",key:"nnexq3"}],["path",{d:"M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12",key:"mt58a7"}]],jc=Je("leaf",l2);/**
|
|
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 s2=[["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"}]],vb=Je("link-2",s2);/**
|
|
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 i2=[["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"}]],o2=Je("lock",i2);/**
|
|
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 u2=[["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"}]],c2=Je("log-out",u2);/**
|
|
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 d2=[["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"}]],S0=Je("message-square",d2);/**
|
|
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 f2=[["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"}]],m2=Je("moon",f2);/**
|
|
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 h2=[["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"}]],p2=Je("pause",h2);/**
|
|
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 g2=[["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"}]],j0=Je("pencil",g2);/**
|
|
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 v2=[["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"}]],w0=Je("play",v2);/**
|
|
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 y2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],zl=Je("plus",y2);/**
|
|
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 b2=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],_h=Je("search",b2);/**
|
|
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 x2=[["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"}]],S2=Je("send",x2);/**
|
|
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 j2=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],w2=Je("square",j2);/**
|
|
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 N2=[["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"}]],E2=Je("sun",N2);/**
|
|
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 _2=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],yb=Je("terminal",_2);/**
|
|
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 C2=[["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"}]],ao=Je("trash-2",C2);/**
|
|
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 A2=[["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"}]],k2=Je("triangle-alert",A2);/**
|
|
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 z2=[["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"}]],T2=Je("undo-2",z2);/**
|
|
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 R2=[["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"}]],O2=Je("unplug",R2);/**
|
|
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 M2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],D2=Je("x",M2);function N0(e){var a,r,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(a=0;a<o;a++)e[a]&&(r=N0(e[a]))&&(s&&(s+=" "),s+=r)}else for(r in e)e[r]&&(s&&(s+=" "),s+=r);return s}function E0(){for(var e,a,r=0,s="",o=arguments.length;r<o;r++)(e=arguments[r])&&(a=N0(e))&&(s&&(s+=" "),s+=a);return s}const U2=(e,a)=>{const r=new Array(e.length+a.length);for(let s=0;s<e.length;s++)r[s]=e[s];for(let s=0;s<a.length;s++)r[e.length+s]=a[s];return r},L2=(e,a)=>({classGroupId:e,validator:a}),_0=(e=new Map,a=null,r)=>({nextPart:e,validators:a,classGroupId:r}),cc="-",bb=[],$2="arbitrary..",B2=e=>{const a=q2(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:m=>{if(m.startsWith("[")&&m.endsWith("]"))return Z2(m);const h=m.split(cc),g=h[0]===""&&h.length>1?1:0;return C0(h,g,a)},getConflictingClassGroupIds:(m,h)=>{if(h){const g=s[m],p=r[m];return g?p?U2(p,g):g:p||bb}return r[m]||bb}}},C0=(e,a,r)=>{if(e.length-a===0)return r.classGroupId;const o=e[a],c=r.nextPart.get(o);if(c){const p=C0(e,a+1,c);if(p)return p}const m=r.validators;if(m===null)return;const h=a===0?e.join(cc):e.slice(a).join(cc),g=m.length;for(let p=0;p<g;p++){const b=m[p];if(b.validator(h))return b.classGroupId}},Z2=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const a=e.slice(1,-1),r=a.indexOf(":"),s=a.slice(0,r);return s?$2+s:void 0})(),q2=e=>{const{theme:a,classGroups:r}=e;return H2(r,a)},H2=(e,a)=>{const r=_0();for(const s in e){const o=e[s];Ch(o,r,s,a)}return r},Ch=(e,a,r,s)=>{const o=e.length;for(let c=0;c<o;c++){const m=e[c];I2(m,a,r,s)}},I2=(e,a,r,s)=>{if(typeof e=="string"){Q2(e,a,r);return}if(typeof e=="function"){G2(e,a,r,s);return}P2(e,a,r,s)},Q2=(e,a,r)=>{const s=e===""?a:A0(a,e);s.classGroupId=r},G2=(e,a,r,s)=>{if(V2(e)){Ch(e(s),a,r,s);return}a.validators===null&&(a.validators=[]),a.validators.push(L2(r,e))},P2=(e,a,r,s)=>{const o=Object.entries(e),c=o.length;for(let m=0;m<c;m++){const[h,g]=o[m];Ch(g,A0(a,h),r,s)}},A0=(e,a)=>{let r=e;const s=a.split(cc),o=s.length;for(let c=0;c<o;c++){const m=s[c];let h=r.nextPart.get(m);h||(h=_0(),r.nextPart.set(m,h)),r=h}return r},V2=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,K2=e=>{if(e<1)return{get:()=>{},set:()=>{}};let a=0,r=Object.create(null),s=Object.create(null);const o=(c,m)=>{r[c]=m,a++,a>e&&(a=0,s=r,r=Object.create(null))};return{get(c){let m=r[c];if(m!==void 0)return m;if((m=s[c])!==void 0)return o(c,m),m},set(c,m){c in r?r[c]=m:o(c,m)}}},Fm="!",xb=":",Y2=[],Sb=(e,a,r,s,o)=>({modifiers:e,hasImportantModifier:a,baseClassName:r,maybePostfixModifierPosition:s,isExternal:o}),F2=e=>{const{prefix:a,experimentalParseClassName:r}=e;let s=o=>{const c=[];let m=0,h=0,g=0,p;const b=o.length;for(let w=0;w<b;w++){const E=o[w];if(m===0&&h===0){if(E===xb){c.push(o.slice(g,w)),g=w+1;continue}if(E==="/"){p=w;continue}}E==="["?m++:E==="]"?m--:E==="("?h++:E===")"&&h--}const x=c.length===0?o:o.slice(g);let j=x,N=!1;x.endsWith(Fm)?(j=x.slice(0,-1),N=!0):x.startsWith(Fm)&&(j=x.slice(1),N=!0);const z=p&&p>g?p-g:void 0;return Sb(c,N,j,z)};if(a){const o=a+xb,c=s;s=m=>m.startsWith(o)?c(m.slice(o.length)):Sb(Y2,!1,m,void 0,!0)}if(r){const o=s;s=c=>r({className:c,parseClassName:o})}return s},X2=e=>{const a=new Map;return e.orderSensitiveModifiers.forEach((r,s)=>{a.set(r,1e6+s)}),r=>{const s=[];let o=[];for(let c=0;c<r.length;c++){const m=r[c],h=m[0]==="[",g=a.has(m);h||g?(o.length>0&&(o.sort(),s.push(...o),o=[]),s.push(m)):o.push(m)}return o.length>0&&(o.sort(),s.push(...o)),s}},J2=e=>({cache:K2(e.cacheSize),parseClassName:F2(e),sortModifiers:X2(e),...B2(e)}),W2=/\s+/,eC=(e,a)=>{const{parseClassName:r,getClassGroupId:s,getConflictingClassGroupIds:o,sortModifiers:c}=a,m=[],h=e.trim().split(W2);let g="";for(let p=h.length-1;p>=0;p-=1){const b=h[p],{isExternal:x,modifiers:j,hasImportantModifier:N,baseClassName:z,maybePostfixModifierPosition:w}=r(b);if(x){g=b+(g.length>0?" "+g:g);continue}let E=!!w,M=s(E?z.substring(0,w):z);if(!M){if(!E){g=b+(g.length>0?" "+g:g);continue}if(M=s(z),!M){g=b+(g.length>0?" "+g:g);continue}E=!1}const Z=j.length===0?"":j.length===1?j[0]:c(j).join(":"),D=N?Z+Fm:Z,O=D+M;if(m.indexOf(O)>-1)continue;m.push(O);const P=o(M,E);for(let I=0;I<P.length;++I){const L=P[I];m.push(D+L)}g=b+(g.length>0?" "+g:g)}return g},tC=(...e)=>{let a=0,r,s,o="";for(;a<e.length;)(r=e[a++])&&(s=k0(r))&&(o&&(o+=" "),o+=s);return o},k0=e=>{if(typeof e=="string")return e;let a,r="";for(let s=0;s<e.length;s++)e[s]&&(a=k0(e[s]))&&(r&&(r+=" "),r+=a);return r},nC=(e,...a)=>{let r,s,o,c;const m=g=>{const p=a.reduce((b,x)=>x(b),e());return r=J2(p),s=r.cache.get,o=r.cache.set,c=h,h(g)},h=g=>{const p=s(g);if(p)return p;const b=eC(g,r);return o(g,b),b};return c=m,(...g)=>c(tC(...g))},aC=[],zt=e=>{const a=r=>r[e]||aC;return a.isThemeGetter=!0,a},z0=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,T0=/^\((?:(\w[\w-]*):)?(.+)\)$/i,rC=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,lC=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,sC=/\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$/,iC=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,oC=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,uC=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,br=e=>rC.test(e),De=e=>!!e&&!Number.isNaN(Number(e)),xr=e=>!!e&&Number.isInteger(Number(e)),cm=e=>e.endsWith("%")&&De(e.slice(0,-1)),za=e=>lC.test(e),R0=()=>!0,cC=e=>sC.test(e)&&!iC.test(e),Ah=()=>!1,dC=e=>oC.test(e),fC=e=>uC.test(e),mC=e=>!ue(e)&&!de(e),hC=e=>Zr(e,D0,Ah),ue=e=>z0.test(e),ml=e=>Zr(e,U0,cC),jb=e=>Zr(e,jC,De),pC=e=>Zr(e,$0,R0),gC=e=>Zr(e,L0,Ah),wb=e=>Zr(e,O0,Ah),vC=e=>Zr(e,M0,fC),Qu=e=>Zr(e,B0,dC),de=e=>T0.test(e),Ki=e=>Tl(e,U0),yC=e=>Tl(e,L0),Nb=e=>Tl(e,O0),bC=e=>Tl(e,D0),xC=e=>Tl(e,M0),Gu=e=>Tl(e,B0,!0),SC=e=>Tl(e,$0,!0),Zr=(e,a,r)=>{const s=z0.exec(e);return s?s[1]?a(s[1]):r(s[2]):!1},Tl=(e,a,r=!1)=>{const s=T0.exec(e);return s?s[1]?a(s[1]):r:!1},O0=e=>e==="position"||e==="percentage",M0=e=>e==="image"||e==="url",D0=e=>e==="length"||e==="size"||e==="bg-size",U0=e=>e==="length",jC=e=>e==="number",L0=e=>e==="family-name",$0=e=>e==="number"||e==="weight",B0=e=>e==="shadow",wC=()=>{const e=zt("color"),a=zt("font"),r=zt("text"),s=zt("font-weight"),o=zt("tracking"),c=zt("leading"),m=zt("breakpoint"),h=zt("container"),g=zt("spacing"),p=zt("radius"),b=zt("shadow"),x=zt("inset-shadow"),j=zt("text-shadow"),N=zt("drop-shadow"),z=zt("blur"),w=zt("perspective"),E=zt("aspect"),M=zt("ease"),Z=zt("animate"),D=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],P=()=>[...O(),de,ue],I=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto","contain","none"],K=()=>[de,ue,g],se=()=>[br,"full","auto",...K()],Se=()=>[xr,"none","subgrid",de,ue],_e=()=>["auto",{span:["full",xr,de,ue]},xr,de,ue],re=()=>[xr,"auto",de,ue],ve=()=>["auto","min","max","fr",de,ue],Te=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],we=()=>["start","end","center","stretch","center-safe","end-safe"],Q=()=>["auto",...K()],te=()=>[br,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...K()],ce=()=>[br,"screen","full","dvw","lvw","svw","min","max","fit",...K()],Ce=()=>[br,"screen","full","lh","dvh","lvh","svh","min","max","fit",...K()],ae=()=>[e,de,ue],T=()=>[...O(),Nb,wb,{position:[de,ue]}],k=()=>["no-repeat",{repeat:["","x","y","space","round"]}],V=()=>["auto","cover","contain",bC,hC,{size:[de,ue]}],ee=()=>[cm,Ki,ml],H=()=>["","none","full",p,de,ue],ne=()=>["",De,Ki,ml],fe=()=>["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"],pe=()=>[De,cm,Nb,wb],Dt=()=>["","none",z,de,ue],jn=()=>["none",De,de,ue],wn=()=>["none",De,de,ue],da=()=>[De,de,ue],Qt=()=>[br,"full",...K()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[za],breakpoint:[za],color:[R0],container:[za],"drop-shadow":[za],ease:["in","out","in-out"],font:[mC],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[za],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[za],shadow:[za],spacing:["px",De],text:[za],"text-shadow":[za],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",br,ue,de,E]}],container:["container"],columns:[{columns:[De,ue,de,h]}],"break-after":[{"break-after":D()}],"break-before":[{"break-before":D()}],"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:P()}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:se()}],"inset-x":[{"inset-x":se()}],"inset-y":[{"inset-y":se()}],start:[{"inset-s":se(),start:se()}],end:[{"inset-e":se(),end:se()}],"inset-bs":[{"inset-bs":se()}],"inset-be":[{"inset-be":se()}],top:[{top:se()}],right:[{right:se()}],bottom:[{bottom:se()}],left:[{left:se()}],visibility:["visible","invisible","collapse"],z:[{z:[xr,"auto",de,ue]}],basis:[{basis:[br,"full","auto",h,...K()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[De,br,"auto","initial","none",ue]}],grow:[{grow:["",De,de,ue]}],shrink:[{shrink:["",De,de,ue]}],order:[{order:[xr,"first","last","none",de,ue]}],"grid-cols":[{"grid-cols":Se()}],"col-start-end":[{col:_e()}],"col-start":[{"col-start":re()}],"col-end":[{"col-end":re()}],"grid-rows":[{"grid-rows":Se()}],"row-start-end":[{row:_e()}],"row-start":[{"row-start":re()}],"row-end":[{"row-end":re()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ve()}],"auto-rows":[{"auto-rows":ve()}],gap:[{gap:K()}],"gap-x":[{"gap-x":K()}],"gap-y":[{"gap-y":K()}],"justify-content":[{justify:[...Te(),"normal"]}],"justify-items":[{"justify-items":[...we(),"normal"]}],"justify-self":[{"justify-self":["auto",...we()]}],"align-content":[{content:["normal",...Te()]}],"align-items":[{items:[...we(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...we(),{baseline:["","last"]}]}],"place-content":[{"place-content":Te()}],"place-items":[{"place-items":[...we(),"baseline"]}],"place-self":[{"place-self":["auto",...we()]}],p:[{p:K()}],px:[{px:K()}],py:[{py:K()}],ps:[{ps:K()}],pe:[{pe:K()}],pbs:[{pbs:K()}],pbe:[{pbe:K()}],pt:[{pt:K()}],pr:[{pr:K()}],pb:[{pb:K()}],pl:[{pl:K()}],m:[{m:Q()}],mx:[{mx:Q()}],my:[{my:Q()}],ms:[{ms:Q()}],me:[{me:Q()}],mbs:[{mbs:Q()}],mbe:[{mbe:Q()}],mt:[{mt:Q()}],mr:[{mr:Q()}],mb:[{mb:Q()}],ml:[{ml:Q()}],"space-x":[{"space-x":K()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":K()}],"space-y-reverse":["space-y-reverse"],size:[{size:te()}],"inline-size":[{inline:["auto",...ce()]}],"min-inline-size":[{"min-inline":["auto",...ce()]}],"max-inline-size":[{"max-inline":["none",...ce()]}],"block-size":[{block:["auto",...Ce()]}],"min-block-size":[{"min-block":["auto",...Ce()]}],"max-block-size":[{"max-block":["none",...Ce()]}],w:[{w:[h,"screen",...te()]}],"min-w":[{"min-w":[h,"screen","none",...te()]}],"max-w":[{"max-w":[h,"screen","none","prose",{screen:[m]},...te()]}],h:[{h:["screen","lh",...te()]}],"min-h":[{"min-h":["screen","lh","none",...te()]}],"max-h":[{"max-h":["screen","lh",...te()]}],"font-size":[{text:["base",r,Ki,ml]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,SC,pC]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",cm,ue]}],"font-family":[{font:[yC,gC,a]}],"font-features":[{"font-features":[ue]}],"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:[o,de,ue]}],"line-clamp":[{"line-clamp":[De,"none",de,jb]}],leading:[{leading:[c,...K()]}],"list-image":[{"list-image":["none",de,ue]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",de,ue]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:ae()}],"text-color":[{text:ae()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...fe(),"wavy"]}],"text-decoration-thickness":[{decoration:[De,"from-font","auto",de,ml]}],"text-decoration-color":[{decoration:ae()}],"underline-offset":[{"underline-offset":[De,"auto",de,ue]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:K()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",de,ue]}],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",de,ue]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:T()}],"bg-repeat":[{bg:k()}],"bg-size":[{bg:V()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},xr,de,ue],radial:["",de,ue],conic:[xr,de,ue]},xC,vC]}],"bg-color":[{bg:ae()}],"gradient-from-pos":[{from:ee()}],"gradient-via-pos":[{via:ee()}],"gradient-to-pos":[{to:ee()}],"gradient-from":[{from:ae()}],"gradient-via":[{via:ae()}],"gradient-to":[{to:ae()}],rounded:[{rounded:H()}],"rounded-s":[{"rounded-s":H()}],"rounded-e":[{"rounded-e":H()}],"rounded-t":[{"rounded-t":H()}],"rounded-r":[{"rounded-r":H()}],"rounded-b":[{"rounded-b":H()}],"rounded-l":[{"rounded-l":H()}],"rounded-ss":[{"rounded-ss":H()}],"rounded-se":[{"rounded-se":H()}],"rounded-ee":[{"rounded-ee":H()}],"rounded-es":[{"rounded-es":H()}],"rounded-tl":[{"rounded-tl":H()}],"rounded-tr":[{"rounded-tr":H()}],"rounded-br":[{"rounded-br":H()}],"rounded-bl":[{"rounded-bl":H()}],"border-w":[{border:ne()}],"border-w-x":[{"border-x":ne()}],"border-w-y":[{"border-y":ne()}],"border-w-s":[{"border-s":ne()}],"border-w-e":[{"border-e":ne()}],"border-w-bs":[{"border-bs":ne()}],"border-w-be":[{"border-be":ne()}],"border-w-t":[{"border-t":ne()}],"border-w-r":[{"border-r":ne()}],"border-w-b":[{"border-b":ne()}],"border-w-l":[{"border-l":ne()}],"divide-x":[{"divide-x":ne()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ne()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...fe(),"hidden","none"]}],"divide-style":[{divide:[...fe(),"hidden","none"]}],"border-color":[{border:ae()}],"border-color-x":[{"border-x":ae()}],"border-color-y":[{"border-y":ae()}],"border-color-s":[{"border-s":ae()}],"border-color-e":[{"border-e":ae()}],"border-color-bs":[{"border-bs":ae()}],"border-color-be":[{"border-be":ae()}],"border-color-t":[{"border-t":ae()}],"border-color-r":[{"border-r":ae()}],"border-color-b":[{"border-b":ae()}],"border-color-l":[{"border-l":ae()}],"divide-color":[{divide:ae()}],"outline-style":[{outline:[...fe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[De,de,ue]}],"outline-w":[{outline:["",De,Ki,ml]}],"outline-color":[{outline:ae()}],shadow:[{shadow:["","none",b,Gu,Qu]}],"shadow-color":[{shadow:ae()}],"inset-shadow":[{"inset-shadow":["none",x,Gu,Qu]}],"inset-shadow-color":[{"inset-shadow":ae()}],"ring-w":[{ring:ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:ae()}],"ring-offset-w":[{"ring-offset":[De,ml]}],"ring-offset-color":[{"ring-offset":ae()}],"inset-ring-w":[{"inset-ring":ne()}],"inset-ring-color":[{"inset-ring":ae()}],"text-shadow":[{"text-shadow":["none",j,Gu,Qu]}],"text-shadow-color":[{"text-shadow":ae()}],opacity:[{opacity:[De,de,ue]}],"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":[De]}],"mask-image-linear-from-pos":[{"mask-linear-from":pe()}],"mask-image-linear-to-pos":[{"mask-linear-to":pe()}],"mask-image-linear-from-color":[{"mask-linear-from":ae()}],"mask-image-linear-to-color":[{"mask-linear-to":ae()}],"mask-image-t-from-pos":[{"mask-t-from":pe()}],"mask-image-t-to-pos":[{"mask-t-to":pe()}],"mask-image-t-from-color":[{"mask-t-from":ae()}],"mask-image-t-to-color":[{"mask-t-to":ae()}],"mask-image-r-from-pos":[{"mask-r-from":pe()}],"mask-image-r-to-pos":[{"mask-r-to":pe()}],"mask-image-r-from-color":[{"mask-r-from":ae()}],"mask-image-r-to-color":[{"mask-r-to":ae()}],"mask-image-b-from-pos":[{"mask-b-from":pe()}],"mask-image-b-to-pos":[{"mask-b-to":pe()}],"mask-image-b-from-color":[{"mask-b-from":ae()}],"mask-image-b-to-color":[{"mask-b-to":ae()}],"mask-image-l-from-pos":[{"mask-l-from":pe()}],"mask-image-l-to-pos":[{"mask-l-to":pe()}],"mask-image-l-from-color":[{"mask-l-from":ae()}],"mask-image-l-to-color":[{"mask-l-to":ae()}],"mask-image-x-from-pos":[{"mask-x-from":pe()}],"mask-image-x-to-pos":[{"mask-x-to":pe()}],"mask-image-x-from-color":[{"mask-x-from":ae()}],"mask-image-x-to-color":[{"mask-x-to":ae()}],"mask-image-y-from-pos":[{"mask-y-from":pe()}],"mask-image-y-to-pos":[{"mask-y-to":pe()}],"mask-image-y-from-color":[{"mask-y-from":ae()}],"mask-image-y-to-color":[{"mask-y-to":ae()}],"mask-image-radial":[{"mask-radial":[de,ue]}],"mask-image-radial-from-pos":[{"mask-radial-from":pe()}],"mask-image-radial-to-pos":[{"mask-radial-to":pe()}],"mask-image-radial-from-color":[{"mask-radial-from":ae()}],"mask-image-radial-to-color":[{"mask-radial-to":ae()}],"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":O()}],"mask-image-conic-pos":[{"mask-conic":[De]}],"mask-image-conic-from-pos":[{"mask-conic-from":pe()}],"mask-image-conic-to-pos":[{"mask-conic-to":pe()}],"mask-image-conic-from-color":[{"mask-conic-from":ae()}],"mask-image-conic-to-color":[{"mask-conic-to":ae()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:T()}],"mask-repeat":[{mask:k()}],"mask-size":[{mask:V()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",de,ue]}],filter:[{filter:["","none",de,ue]}],blur:[{blur:Dt()}],brightness:[{brightness:[De,de,ue]}],contrast:[{contrast:[De,de,ue]}],"drop-shadow":[{"drop-shadow":["","none",N,Gu,Qu]}],"drop-shadow-color":[{"drop-shadow":ae()}],grayscale:[{grayscale:["",De,de,ue]}],"hue-rotate":[{"hue-rotate":[De,de,ue]}],invert:[{invert:["",De,de,ue]}],saturate:[{saturate:[De,de,ue]}],sepia:[{sepia:["",De,de,ue]}],"backdrop-filter":[{"backdrop-filter":["","none",de,ue]}],"backdrop-blur":[{"backdrop-blur":Dt()}],"backdrop-brightness":[{"backdrop-brightness":[De,de,ue]}],"backdrop-contrast":[{"backdrop-contrast":[De,de,ue]}],"backdrop-grayscale":[{"backdrop-grayscale":["",De,de,ue]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[De,de,ue]}],"backdrop-invert":[{"backdrop-invert":["",De,de,ue]}],"backdrop-opacity":[{"backdrop-opacity":[De,de,ue]}],"backdrop-saturate":[{"backdrop-saturate":[De,de,ue]}],"backdrop-sepia":[{"backdrop-sepia":["",De,de,ue]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":K()}],"border-spacing-x":[{"border-spacing-x":K()}],"border-spacing-y":[{"border-spacing-y":K()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",de,ue]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[De,"initial",de,ue]}],ease:[{ease:["linear","initial",M,de,ue]}],delay:[{delay:[De,de,ue]}],animate:[{animate:["none",Z,de,ue]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,de,ue]}],"perspective-origin":[{"perspective-origin":P()}],rotate:[{rotate:jn()}],"rotate-x":[{"rotate-x":jn()}],"rotate-y":[{"rotate-y":jn()}],"rotate-z":[{"rotate-z":jn()}],scale:[{scale:wn()}],"scale-x":[{"scale-x":wn()}],"scale-y":[{"scale-y":wn()}],"scale-z":[{"scale-z":wn()}],"scale-3d":["scale-3d"],skew:[{skew:da()}],"skew-x":[{"skew-x":da()}],"skew-y":[{"skew-y":da()}],transform:[{transform:[de,ue,"","none","gpu","cpu"]}],"transform-origin":[{origin:P()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Qt()}],"translate-x":[{"translate-x":Qt()}],"translate-y":[{"translate-y":Qt()}],"translate-z":[{"translate-z":Qt()}],"translate-none":["translate-none"],accent:[{accent:ae()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:ae()}],"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",de,ue]}],"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":K()}],"scroll-mx":[{"scroll-mx":K()}],"scroll-my":[{"scroll-my":K()}],"scroll-ms":[{"scroll-ms":K()}],"scroll-me":[{"scroll-me":K()}],"scroll-mbs":[{"scroll-mbs":K()}],"scroll-mbe":[{"scroll-mbe":K()}],"scroll-mt":[{"scroll-mt":K()}],"scroll-mr":[{"scroll-mr":K()}],"scroll-mb":[{"scroll-mb":K()}],"scroll-ml":[{"scroll-ml":K()}],"scroll-p":[{"scroll-p":K()}],"scroll-px":[{"scroll-px":K()}],"scroll-py":[{"scroll-py":K()}],"scroll-ps":[{"scroll-ps":K()}],"scroll-pe":[{"scroll-pe":K()}],"scroll-pbs":[{"scroll-pbs":K()}],"scroll-pbe":[{"scroll-pbe":K()}],"scroll-pt":[{"scroll-pt":K()}],"scroll-pr":[{"scroll-pr":K()}],"scroll-pb":[{"scroll-pb":K()}],"scroll-pl":[{"scroll-pl":K()}],"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",de,ue]}],fill:[{fill:["none",...ae()]}],"stroke-w":[{stroke:[De,Ki,ml,jb]}],stroke:[{stroke:["none",...ae()]}],"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"]}},NC=nC(wC);function je(...e){return NC(E0(e))}function ca(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 EC(e){return ke.delete(`/clients/${encodeURIComponent(e)}`)}function wc(){return ke.get("/admin/agents/activity")}function Nc(){return ke.get("/clients")}function _C(e){return ke.post(`/clients/${e}/disconnect`)}function Z0(){return ke.post("/connect-tokens")}function CC(e){if(typeof e!="object"||e===null)return null;const a=e;return typeof a.toolUseId!="string"||typeof a.name!="string"||a.status!=="pending"&&a.status!=="ok"&&a.status!=="error"?null:{toolUseId:a.toolUseId,name:a.name,args:a.args,status:a.status,durationMs:typeof a.durationMs=="number"?a.durationMs:void 0,resultPreview:typeof a.resultPreview=="string"?a.resultPreview:void 0}}function AC(e){if(typeof e!="object"||e===null)return null;const a=e;return a.source!=="sdk"&&a.source!=="runtime"&&a.source!=="tool"||typeof a.message!="string"?null:{source:a.source,message:a.message}}function Js(e,a){const r=new URLSearchParams;a!=null&&a.state&&r.set("state",a.state),a!=null&&a.runtimeState&&r.set("runtimeState",a.runtimeState);const s=r.toString();return ke.get(`/admin/sessions/agents/${e}${s?`?${s}`:""}`)}function kC(e,a,r){const s=new URLSearchParams;s.set("limit",String(r.limit)),(r==null?void 0:r.cursor)!==void 0&&s.set("cursor",String(r.cursor));const o=s.toString();return ke.get(`/admin/sessions/agents/${e}/${a}/events${o?`?${o}`:""}`)}function zC(e,a){return ke.post(`/admin/sessions/agents/${e}/${a}/suspend`)}function TC(e,a){return ke.post(`/admin/sessions/agents/${e}/${a}/resume`)}function RC(e,a){return ke.post(`/admin/sessions/agents/${e}/${a}/terminate`)}var Eb=1,OC=.9,MC=.8,DC=.17,dm=.1,fm=.999,UC=.9999,LC=.99,$C=/[\\\/_+.#"@\[\(\{&]/,BC=/[\\\/_+.#"@\[\(\{&]/g,ZC=/[\s-]/,q0=/[\s-]/g;function Xm(e,a,r,s,o,c,m){if(c===a.length)return o===e.length?Eb:LC;var h=`${o},${c}`;if(m[h]!==void 0)return m[h];for(var g=s.charAt(c),p=r.indexOf(g,o),b=0,x,j,N,z;p>=0;)x=Xm(e,a,r,s,p+1,c+1,m),x>b&&(p===o?x*=Eb:$C.test(e.charAt(p-1))?(x*=MC,N=e.slice(o,p-1).match(BC),N&&o>0&&(x*=Math.pow(fm,N.length))):ZC.test(e.charAt(p-1))?(x*=OC,z=e.slice(o,p-1).match(q0),z&&o>0&&(x*=Math.pow(fm,z.length))):(x*=DC,o>0&&(x*=Math.pow(fm,p-o))),e.charAt(p)!==a.charAt(c)&&(x*=UC)),(x<dm&&r.charAt(p-1)===s.charAt(c+1)||s.charAt(c+1)===s.charAt(c)&&r.charAt(p-1)!==s.charAt(c))&&(j=Xm(e,a,r,s,p+1,c+2,m),j*dm>x&&(x=j*dm)),x>b&&(b=x),p=r.indexOf(g,p+1);return m[h]=b,b}function _b(e){return e.toLowerCase().replace(q0," ")}function qC(e,a,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,Xm(e,a,_b(e),_b(a),0,0,{})}function Mr(e,a,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e==null||e(o),r===!1||!o.defaultPrevented)return a==null?void 0:a(o)}}function Cb(e,a){if(typeof e=="function")return e(a);e!=null&&(e.current=a)}function Dr(...e){return a=>{let r=!1;const s=e.map(o=>{const c=Cb(o,a);return!r&&typeof c=="function"&&(r=!0),c});if(r)return()=>{for(let o=0;o<s.length;o++){const c=s[o];typeof c=="function"?c():Cb(e[o],null)}}}}function Rl(...e){return v.useCallback(Dr(...e),e)}function HC(e,a){const r=v.createContext(a),s=c=>{const{children:m,...h}=c,g=v.useMemo(()=>h,Object.values(h));return u.jsx(r.Provider,{value:g,children:m})};s.displayName=e+"Provider";function o(c){const m=v.useContext(r);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${c}\` must be used within \`${e}\``)}return[s,o]}function IC(e,a=[]){let r=[];function s(c,m){const h=v.createContext(m),g=r.length;r=[...r,m];const p=x=>{var M;const{scope:j,children:N,...z}=x,w=((M=j==null?void 0:j[e])==null?void 0:M[g])||h,E=v.useMemo(()=>z,Object.values(z));return u.jsx(w.Provider,{value:E,children:N})};p.displayName=c+"Provider";function b(x,j){var w;const N=((w=j==null?void 0:j[e])==null?void 0:w[g])||h,z=v.useContext(N);if(z)return z;if(m!==void 0)return m;throw new Error(`\`${x}\` must be used within \`${c}\``)}return[p,b]}const o=()=>{const c=r.map(m=>v.createContext(m));return function(h){const g=(h==null?void 0:h[e])||c;return v.useMemo(()=>({[`__scope${e}`]:{...h,[e]:g}}),[h,g])}};return o.scopeName=e,[s,QC(o,...a)]}function QC(...e){const a=e[0];if(e.length===1)return a;const r=()=>{const s=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(c){const m=s.reduce((h,{useScope:g,scopeName:p})=>{const x=g(c)[`__scope${p}`];return{...h,...x}},{});return v.useMemo(()=>({[`__scope${a.scopeName}`]:m}),[m])}};return r.scopeName=a.scopeName,r}var ro=globalThis!=null&&globalThis.document?v.useLayoutEffect:()=>{},GC=dh[" useId ".trim().toString()]||(()=>{}),PC=0;function $a(e){const[a,r]=v.useState(GC());return ro(()=>{r(s=>s??String(PC++))},[e]),a?`radix-${a}`:""}var VC=dh[" useInsertionEffect ".trim().toString()]||ro;function KC({prop:e,defaultProp:a,onChange:r=()=>{},caller:s}){const[o,c,m]=YC({defaultProp:a,onChange:r}),h=e!==void 0,g=h?e:o;{const b=v.useRef(e!==void 0);v.useEffect(()=>{const x=b.current;x!==h&&console.warn(`${s} is changing from ${x?"controlled":"uncontrolled"} to ${h?"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.`),b.current=h},[h,s])}const p=v.useCallback(b=>{var x;if(h){const j=FC(b)?b(e):b;j!==e&&((x=m.current)==null||x.call(m,j))}else c(b)},[h,e,c,m]);return[g,p]}function YC({defaultProp:e,onChange:a}){const[r,s]=v.useState(e),o=v.useRef(r),c=v.useRef(a);return VC(()=>{c.current=a},[a]),v.useEffect(()=>{var m;o.current!==r&&((m=c.current)==null||m.call(c,r),o.current=r)},[r,o]),[r,s,c]}function FC(e){return typeof e=="function"}var H0=Mx();const XC=Ox(H0);function I0(e){const a=JC(e),r=v.forwardRef((s,o)=>{const{children:c,...m}=s,h=v.Children.toArray(c),g=h.find(eA);if(g){const p=g.props.children,b=h.map(x=>x===g?v.Children.count(p)>1?v.Children.only(null):v.isValidElement(p)?p.props.children:null:x);return u.jsx(a,{...m,ref:o,children:v.isValidElement(p)?v.cloneElement(p,void 0,b):null})}return u.jsx(a,{...m,ref:o,children:c})});return r.displayName=`${e}.Slot`,r}function JC(e){const a=v.forwardRef((r,s)=>{const{children:o,...c}=r;if(v.isValidElement(o)){const m=nA(o),h=tA(c,o.props);return o.type!==v.Fragment&&(h.ref=s?Dr(s,m):m),v.cloneElement(o,h)}return v.Children.count(o)>1?v.Children.only(null):null});return a.displayName=`${e}.SlotClone`,a}var WC=Symbol("radix.slottable");function eA(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===WC}function tA(e,a){const r={...a};for(const s in a){const o=e[s],c=a[s];/^on[A-Z]/.test(s)?o&&c?r[s]=(...h)=>{const g=c(...h);return o(...h),g}:o&&(r[s]=o):s==="style"?r[s]={...o,...c}:s==="className"&&(r[s]=[o,c].filter(Boolean).join(" "))}return{...e,...r}}function nA(e){var s,o;let a=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,r=a&&"isReactWarning"in a&&a.isReactWarning;return r?e.ref:(a=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=a&&"isReactWarning"in a&&a.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var aA=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ga=aA.reduce((e,a)=>{const r=I0(`Primitive.${a}`),s=v.forwardRef((o,c)=>{const{asChild:m,...h}=o,g=m?r:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(g,{...h,ref:c})});return s.displayName=`Primitive.${a}`,{...e,[a]:s}},{});function rA(e,a){e&&H0.flushSync(()=>e.dispatchEvent(a))}function lo(e){const a=v.useRef(e);return v.useEffect(()=>{a.current=e}),v.useMemo(()=>(...r)=>{var s;return(s=a.current)==null?void 0:s.call(a,...r)},[])}function lA(e,a=globalThis==null?void 0:globalThis.document){const r=lo(e);v.useEffect(()=>{const s=o=>{o.key==="Escape"&&r(o)};return a.addEventListener("keydown",s,{capture:!0}),()=>a.removeEventListener("keydown",s,{capture:!0})},[r,a])}var sA="DismissableLayer",Jm="dismissableLayer.update",iA="dismissableLayer.pointerDownOutside",oA="dismissableLayer.focusOutside",Ab,Q0=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),G0=v.forwardRef((e,a)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:c,onInteractOutside:m,onDismiss:h,...g}=e,p=v.useContext(Q0),[b,x]=v.useState(null),j=(b==null?void 0:b.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,N]=v.useState({}),z=Rl(a,L=>x(L)),w=Array.from(p.layers),[E]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),M=w.indexOf(E),Z=b?w.indexOf(b):-1,D=p.layersWithOutsidePointerEventsDisabled.size>0,O=Z>=M,P=dA(L=>{const K=L.target,se=[...p.branches].some(Se=>Se.contains(K));!O||se||(o==null||o(L),m==null||m(L),L.defaultPrevented||h==null||h())},j),I=fA(L=>{const K=L.target;[...p.branches].some(Se=>Se.contains(K))||(c==null||c(L),m==null||m(L),L.defaultPrevented||h==null||h())},j);return lA(L=>{Z===p.layers.size-1&&(s==null||s(L),!L.defaultPrevented&&h&&(L.preventDefault(),h()))},j),v.useEffect(()=>{if(b)return r&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(Ab=j.body.style.pointerEvents,j.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(b)),p.layers.add(b),kb(),()=>{r&&p.layersWithOutsidePointerEventsDisabled.size===1&&(j.body.style.pointerEvents=Ab)}},[b,j,r,p]),v.useEffect(()=>()=>{b&&(p.layers.delete(b),p.layersWithOutsidePointerEventsDisabled.delete(b),kb())},[b,p]),v.useEffect(()=>{const L=()=>N({});return document.addEventListener(Jm,L),()=>document.removeEventListener(Jm,L)},[]),u.jsx(Ga.div,{...g,ref:z,style:{pointerEvents:D?O?"auto":"none":void 0,...e.style},onFocusCapture:Mr(e.onFocusCapture,I.onFocusCapture),onBlurCapture:Mr(e.onBlurCapture,I.onBlurCapture),onPointerDownCapture:Mr(e.onPointerDownCapture,P.onPointerDownCapture)})});G0.displayName=sA;var uA="DismissableLayerBranch",cA=v.forwardRef((e,a)=>{const r=v.useContext(Q0),s=v.useRef(null),o=Rl(a,s);return v.useEffect(()=>{const c=s.current;if(c)return r.branches.add(c),()=>{r.branches.delete(c)}},[r.branches]),u.jsx(Ga.div,{...e,ref:o})});cA.displayName=uA;function dA(e,a=globalThis==null?void 0:globalThis.document){const r=lo(e),s=v.useRef(!1),o=v.useRef(()=>{});return v.useEffect(()=>{const c=h=>{if(h.target&&!s.current){let g=function(){P0(iA,r,p,{discrete:!0})};const p={originalEvent:h};h.pointerType==="touch"?(a.removeEventListener("click",o.current),o.current=g,a.addEventListener("click",o.current,{once:!0})):g()}else a.removeEventListener("click",o.current);s.current=!1},m=window.setTimeout(()=>{a.addEventListener("pointerdown",c)},0);return()=>{window.clearTimeout(m),a.removeEventListener("pointerdown",c),a.removeEventListener("click",o.current)}},[a,r]),{onPointerDownCapture:()=>s.current=!0}}function fA(e,a=globalThis==null?void 0:globalThis.document){const r=lo(e),s=v.useRef(!1);return v.useEffect(()=>{const o=c=>{c.target&&!s.current&&P0(oA,r,{originalEvent:c},{discrete:!1})};return a.addEventListener("focusin",o),()=>a.removeEventListener("focusin",o)},[a,r]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function kb(){const e=new CustomEvent(Jm);document.dispatchEvent(e)}function P0(e,a,r,{discrete:s}){const o=r.originalEvent.target,c=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});a&&o.addEventListener(e,a,{once:!0}),s?rA(o,c):o.dispatchEvent(c)}var mm="focusScope.autoFocusOnMount",hm="focusScope.autoFocusOnUnmount",zb={bubbles:!1,cancelable:!0},mA="FocusScope",V0=v.forwardRef((e,a)=>{const{loop:r=!1,trapped:s=!1,onMountAutoFocus:o,onUnmountAutoFocus:c,...m}=e,[h,g]=v.useState(null),p=lo(o),b=lo(c),x=v.useRef(null),j=Rl(a,w=>g(w)),N=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(s){let w=function(D){if(N.paused||!h)return;const O=D.target;h.contains(O)?x.current=O:jr(x.current,{select:!0})},E=function(D){if(N.paused||!h)return;const O=D.relatedTarget;O!==null&&(h.contains(O)||jr(x.current,{select:!0}))},M=function(D){if(document.activeElement===document.body)for(const P of D)P.removedNodes.length>0&&jr(h)};document.addEventListener("focusin",w),document.addEventListener("focusout",E);const Z=new MutationObserver(M);return h&&Z.observe(h,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",E),Z.disconnect()}}},[s,h,N.paused]),v.useEffect(()=>{if(h){Rb.add(N);const w=document.activeElement;if(!h.contains(w)){const M=new CustomEvent(mm,zb);h.addEventListener(mm,p),h.dispatchEvent(M),M.defaultPrevented||(hA(bA(K0(h)),{select:!0}),document.activeElement===w&&jr(h))}return()=>{h.removeEventListener(mm,p),setTimeout(()=>{const M=new CustomEvent(hm,zb);h.addEventListener(hm,b),h.dispatchEvent(M),M.defaultPrevented||jr(w??document.body,{select:!0}),h.removeEventListener(hm,b),Rb.remove(N)},0)}}},[h,p,b,N]);const z=v.useCallback(w=>{if(!r&&!s||N.paused)return;const E=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,M=document.activeElement;if(E&&M){const Z=w.currentTarget,[D,O]=pA(Z);D&&O?!w.shiftKey&&M===O?(w.preventDefault(),r&&jr(D,{select:!0})):w.shiftKey&&M===D&&(w.preventDefault(),r&&jr(O,{select:!0})):M===Z&&w.preventDefault()}},[r,s,N.paused]);return u.jsx(Ga.div,{tabIndex:-1,...m,ref:j,onKeyDown:z})});V0.displayName=mA;function hA(e,{select:a=!1}={}){const r=document.activeElement;for(const s of e)if(jr(s,{select:a}),document.activeElement!==r)return}function pA(e){const a=K0(e),r=Tb(a,e),s=Tb(a.reverse(),e);return[r,s]}function K0(e){const a=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const o=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||o?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)a.push(r.currentNode);return a}function Tb(e,a){for(const r of e)if(!gA(r,{upTo:a}))return r}function gA(e,{upTo:a}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(a!==void 0&&e===a)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function vA(e){return e instanceof HTMLInputElement&&"select"in e}function jr(e,{select:a=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&vA(e)&&a&&e.select()}}var Rb=yA();function yA(){let e=[];return{add(a){const r=e[0];a!==r&&(r==null||r.pause()),e=Ob(e,a),e.unshift(a)},remove(a){var r;e=Ob(e,a),(r=e[0])==null||r.resume()}}}function Ob(e,a){const r=[...e],s=r.indexOf(a);return s!==-1&&r.splice(s,1),r}function bA(e){return e.filter(a=>a.tagName!=="A")}var xA="Portal",Y0=v.forwardRef((e,a)=>{var h;const{container:r,...s}=e,[o,c]=v.useState(!1);ro(()=>c(!0),[]);const m=r||o&&((h=globalThis==null?void 0:globalThis.document)==null?void 0:h.body);return m?XC.createPortal(u.jsx(Ga.div,{...s,ref:a}),m):null});Y0.displayName=xA;function SA(e,a){return v.useReducer((r,s)=>a[r][s]??r,e)}var Ec=e=>{const{present:a,children:r}=e,s=jA(a),o=typeof r=="function"?r({present:s.isPresent}):v.Children.only(r),c=Rl(s.ref,wA(o));return typeof r=="function"||s.isPresent?v.cloneElement(o,{ref:c}):null};Ec.displayName="Presence";function jA(e){const[a,r]=v.useState(),s=v.useRef(null),o=v.useRef(e),c=v.useRef("none"),m=e?"mounted":"unmounted",[h,g]=SA(m,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const p=Pu(s.current);c.current=h==="mounted"?p:"none"},[h]),ro(()=>{const p=s.current,b=o.current;if(b!==e){const j=c.current,N=Pu(p);e?g("MOUNT"):N==="none"||(p==null?void 0:p.display)==="none"?g("UNMOUNT"):g(b&&j!==N?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,g]),ro(()=>{if(a){let p;const b=a.ownerDocument.defaultView??window,x=N=>{const w=Pu(s.current).includes(CSS.escape(N.animationName));if(N.target===a&&w&&(g("ANIMATION_END"),!o.current)){const E=a.style.animationFillMode;a.style.animationFillMode="forwards",p=b.setTimeout(()=>{a.style.animationFillMode==="forwards"&&(a.style.animationFillMode=E)})}},j=N=>{N.target===a&&(c.current=Pu(s.current))};return a.addEventListener("animationstart",j),a.addEventListener("animationcancel",x),a.addEventListener("animationend",x),()=>{b.clearTimeout(p),a.removeEventListener("animationstart",j),a.removeEventListener("animationcancel",x),a.removeEventListener("animationend",x)}}else g("ANIMATION_END")},[a,g]),{isPresent:["mounted","unmountSuspended"].includes(h),ref:v.useCallback(p=>{s.current=p?getComputedStyle(p):null,r(p)},[])}}function Pu(e){return(e==null?void 0:e.animationName)||"none"}function wA(e){var s,o;let a=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,r=a&&"isReactWarning"in a&&a.isReactWarning;return r?e.ref:(a=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=a&&"isReactWarning"in a&&a.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var pm=0;function NA(){v.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Mb()),document.body.insertAdjacentElement("beforeend",e[1]??Mb()),pm++,()=>{pm===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(a=>a.remove()),pm--}},[])}function Mb(){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 ia=function(){return ia=Object.assign||function(a){for(var r,s=1,o=arguments.length;s<o;s++){r=arguments[s];for(var c in r)Object.prototype.hasOwnProperty.call(r,c)&&(a[c]=r[c])}return a},ia.apply(this,arguments)};function F0(e,a){var r={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&a.indexOf(s)<0&&(r[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,s=Object.getOwnPropertySymbols(e);o<s.length;o++)a.indexOf(s[o])<0&&Object.prototype.propertyIsEnumerable.call(e,s[o])&&(r[s[o]]=e[s[o]]);return r}function EA(e,a,r){if(r||arguments.length===2)for(var s=0,o=a.length,c;s<o;s++)(c||!(s in a))&&(c||(c=Array.prototype.slice.call(a,0,s)),c[s]=a[s]);return e.concat(c||Array.prototype.slice.call(a))}var ac="right-scroll-bar-position",rc="width-before-scroll-bar",_A="with-scroll-bars-hidden",CA="--removed-body-scroll-bar-size";function gm(e,a){return typeof e=="function"?e(a):e&&(e.current=a),e}function AA(e,a){var r=v.useState(function(){return{value:e,callback:a,facade:{get current(){return r.value},set current(s){var o=r.value;o!==s&&(r.value=s,r.callback(s,o))}}}})[0];return r.callback=a,r.facade}var kA=typeof window<"u"?v.useLayoutEffect:v.useEffect,Db=new WeakMap;function zA(e,a){var r=AA(null,function(s){return e.forEach(function(o){return gm(o,s)})});return kA(function(){var s=Db.get(r);if(s){var o=new Set(s),c=new Set(e),m=r.current;o.forEach(function(h){c.has(h)||gm(h,null)}),c.forEach(function(h){o.has(h)||gm(h,m)})}Db.set(r,e)},[e]),r}function TA(e){return e}function RA(e,a){a===void 0&&(a=TA);var r=[],s=!1,o={read:function(){if(s)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(c){var m=a(c,s);return r.push(m),function(){r=r.filter(function(h){return h!==m})}},assignSyncMedium:function(c){for(s=!0;r.length;){var m=r;r=[],m.forEach(c)}r={push:function(h){return c(h)},filter:function(){return r}}},assignMedium:function(c){s=!0;var m=[];if(r.length){var h=r;r=[],h.forEach(c),m=r}var g=function(){var b=m;m=[],b.forEach(c)},p=function(){return Promise.resolve().then(g)};p(),r={push:function(b){m.push(b),p()},filter:function(b){return m=m.filter(b),r}}}};return o}function OA(e){e===void 0&&(e={});var a=RA(null);return a.options=ia({async:!0,ssr:!1},e),a}var X0=function(e){var a=e.sideCar,r=F0(e,["sideCar"]);if(!a)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var s=a.read();if(!s)throw new Error("Sidecar medium not found");return v.createElement(s,ia({},r))};X0.isSideCarExport=!0;function MA(e,a){return e.useMedium(a),X0}var J0=OA(),vm=function(){},_c=v.forwardRef(function(e,a){var r=v.useRef(null),s=v.useState({onScrollCapture:vm,onWheelCapture:vm,onTouchMoveCapture:vm}),o=s[0],c=s[1],m=e.forwardProps,h=e.children,g=e.className,p=e.removeScrollBar,b=e.enabled,x=e.shards,j=e.sideCar,N=e.noRelative,z=e.noIsolation,w=e.inert,E=e.allowPinchZoom,M=e.as,Z=M===void 0?"div":M,D=e.gapMode,O=F0(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),P=j,I=zA([r,a]),L=ia(ia({},O),o);return v.createElement(v.Fragment,null,b&&v.createElement(P,{sideCar:J0,removeScrollBar:p,shards:x,noRelative:N,noIsolation:z,inert:w,setCallbacks:c,allowPinchZoom:!!E,lockRef:r,gapMode:D}),m?v.cloneElement(v.Children.only(h),ia(ia({},L),{ref:I})):v.createElement(Z,ia({},L,{className:g,ref:I}),h))});_c.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};_c.classNames={fullWidth:rc,zeroRight:ac};var DA=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function UA(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var a=DA();return a&&e.setAttribute("nonce",a),e}function LA(e,a){e.styleSheet?e.styleSheet.cssText=a:e.appendChild(document.createTextNode(a))}function $A(e){var a=document.head||document.getElementsByTagName("head")[0];a.appendChild(e)}var BA=function(){var e=0,a=null;return{add:function(r){e==0&&(a=UA())&&(LA(a,r),$A(a)),e++},remove:function(){e--,!e&&a&&(a.parentNode&&a.parentNode.removeChild(a),a=null)}}},ZA=function(){var e=BA();return function(a,r){v.useEffect(function(){return e.add(a),function(){e.remove()}},[a&&r])}},W0=function(){var e=ZA(),a=function(r){var s=r.styles,o=r.dynamic;return e(s,o),null};return a},qA={left:0,top:0,right:0,gap:0},ym=function(e){return parseInt(e||"",10)||0},HA=function(e){var a=window.getComputedStyle(document.body),r=a[e==="padding"?"paddingLeft":"marginLeft"],s=a[e==="padding"?"paddingTop":"marginTop"],o=a[e==="padding"?"paddingRight":"marginRight"];return[ym(r),ym(s),ym(o)]},IA=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return qA;var a=HA(e),r=document.documentElement.clientWidth,s=window.innerWidth;return{left:a[0],top:a[1],right:a[2],gap:Math.max(0,s-r+a[2]-a[0])}},QA=W0(),zs="data-scroll-locked",GA=function(e,a,r,s){var o=e.left,c=e.top,m=e.right,h=e.gap;return r===void 0&&(r="margin"),`
|
|
251
|
+
.`.concat(_A,` {
|
|
252
|
+
overflow: hidden `).concat(s,`;
|
|
253
|
+
padding-right: `).concat(h,"px ").concat(s,`;
|
|
254
|
+
}
|
|
255
|
+
body[`).concat(zs,`] {
|
|
256
|
+
overflow: hidden `).concat(s,`;
|
|
257
|
+
overscroll-behavior: contain;
|
|
258
|
+
`).concat([a&&"position: relative ".concat(s,";"),r==="margin"&&`
|
|
259
|
+
padding-left: `.concat(o,`px;
|
|
260
|
+
padding-top: `).concat(c,`px;
|
|
261
|
+
padding-right: `).concat(m,`px;
|
|
262
|
+
margin-left:0;
|
|
263
|
+
margin-top:0;
|
|
264
|
+
margin-right: `).concat(h,"px ").concat(s,`;
|
|
265
|
+
`),r==="padding"&&"padding-right: ".concat(h,"px ").concat(s,";")].filter(Boolean).join(""),`
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.`).concat(ac,` {
|
|
269
|
+
right: `).concat(h,"px ").concat(s,`;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.`).concat(rc,` {
|
|
273
|
+
margin-right: `).concat(h,"px ").concat(s,`;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.`).concat(ac," .").concat(ac,` {
|
|
277
|
+
right: 0 `).concat(s,`;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.`).concat(rc," .").concat(rc,` {
|
|
281
|
+
margin-right: 0 `).concat(s,`;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
body[`).concat(zs,`] {
|
|
285
|
+
`).concat(CA,": ").concat(h,`px;
|
|
286
|
+
}
|
|
287
|
+
`)},Ub=function(){var e=parseInt(document.body.getAttribute(zs)||"0",10);return isFinite(e)?e:0},PA=function(){v.useEffect(function(){return document.body.setAttribute(zs,(Ub()+1).toString()),function(){var e=Ub()-1;e<=0?document.body.removeAttribute(zs):document.body.setAttribute(zs,e.toString())}},[])},VA=function(e){var a=e.noRelative,r=e.noImportant,s=e.gapMode,o=s===void 0?"margin":s;PA();var c=v.useMemo(function(){return IA(o)},[o]);return v.createElement(QA,{styles:GA(c,!a,o,r?"":"!important")})},Wm=!1;if(typeof window<"u")try{var Vu=Object.defineProperty({},"passive",{get:function(){return Wm=!0,!0}});window.addEventListener("test",Vu,Vu),window.removeEventListener("test",Vu,Vu)}catch{Wm=!1}var js=Wm?{passive:!1}:!1,KA=function(e){return e.tagName==="TEXTAREA"},eS=function(e,a){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[a]!=="hidden"&&!(r.overflowY===r.overflowX&&!KA(e)&&r[a]==="visible")},YA=function(e){return eS(e,"overflowY")},FA=function(e){return eS(e,"overflowX")},Lb=function(e,a){var r=a.ownerDocument,s=a;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var o=tS(e,s);if(o){var c=nS(e,s),m=c[1],h=c[2];if(m>h)return!0}s=s.parentNode}while(s&&s!==r.body);return!1},XA=function(e){var a=e.scrollTop,r=e.scrollHeight,s=e.clientHeight;return[a,r,s]},JA=function(e){var a=e.scrollLeft,r=e.scrollWidth,s=e.clientWidth;return[a,r,s]},tS=function(e,a){return e==="v"?YA(a):FA(a)},nS=function(e,a){return e==="v"?XA(a):JA(a)},WA=function(e,a){return e==="h"&&a==="rtl"?-1:1},ek=function(e,a,r,s,o){var c=WA(e,window.getComputedStyle(a).direction),m=c*s,h=r.target,g=a.contains(h),p=!1,b=m>0,x=0,j=0;do{if(!h)break;var N=nS(e,h),z=N[0],w=N[1],E=N[2],M=w-E-c*z;(z||M)&&tS(e,h)&&(x+=M,j+=z);var Z=h.parentNode;h=Z&&Z.nodeType===Node.DOCUMENT_FRAGMENT_NODE?Z.host:Z}while(!g&&h!==document.body||g&&(a.contains(h)||a===h));return(b&&Math.abs(x)<1||!b&&Math.abs(j)<1)&&(p=!0),p},Ku=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},$b=function(e){return[e.deltaX,e.deltaY]},Bb=function(e){return e&&"current"in e?e.current:e},tk=function(e,a){return e[0]===a[0]&&e[1]===a[1]},nk=function(e){return`
|
|
288
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
289
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
290
|
+
`)},ak=0,ws=[];function rk(e){var a=v.useRef([]),r=v.useRef([0,0]),s=v.useRef(),o=v.useState(ak++)[0],c=v.useState(W0)[0],m=v.useRef(e);v.useEffect(function(){m.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var w=EA([e.lockRef.current],(e.shards||[]).map(Bb),!0).filter(Boolean);return w.forEach(function(E){return E.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),w.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var h=v.useCallback(function(w,E){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!m.current.allowPinchZoom;var M=Ku(w),Z=r.current,D="deltaX"in w?w.deltaX:Z[0]-M[0],O="deltaY"in w?w.deltaY:Z[1]-M[1],P,I=w.target,L=Math.abs(D)>Math.abs(O)?"h":"v";if("touches"in w&&L==="h"&&I.type==="range")return!1;var K=window.getSelection(),se=K&&K.anchorNode,Se=se?se===I||se.contains(I):!1;if(Se)return!1;var _e=Lb(L,I);if(!_e)return!0;if(_e?P=L:(P=L==="v"?"h":"v",_e=Lb(L,I)),!_e)return!1;if(!s.current&&"changedTouches"in w&&(D||O)&&(s.current=P),!P)return!0;var re=s.current||P;return ek(re,E,w,re==="h"?D:O)},[]),g=v.useCallback(function(w){var E=w;if(!(!ws.length||ws[ws.length-1]!==c)){var M="deltaY"in E?$b(E):Ku(E),Z=a.current.filter(function(P){return P.name===E.type&&(P.target===E.target||E.target===P.shadowParent)&&tk(P.delta,M)})[0];if(Z&&Z.should){E.cancelable&&E.preventDefault();return}if(!Z){var D=(m.current.shards||[]).map(Bb).filter(Boolean).filter(function(P){return P.contains(E.target)}),O=D.length>0?h(E,D[0]):!m.current.noIsolation;O&&E.cancelable&&E.preventDefault()}}},[]),p=v.useCallback(function(w,E,M,Z){var D={name:w,delta:E,target:M,should:Z,shadowParent:lk(M)};a.current.push(D),setTimeout(function(){a.current=a.current.filter(function(O){return O!==D})},1)},[]),b=v.useCallback(function(w){r.current=Ku(w),s.current=void 0},[]),x=v.useCallback(function(w){p(w.type,$b(w),w.target,h(w,e.lockRef.current))},[]),j=v.useCallback(function(w){p(w.type,Ku(w),w.target,h(w,e.lockRef.current))},[]);v.useEffect(function(){return ws.push(c),e.setCallbacks({onScrollCapture:x,onWheelCapture:x,onTouchMoveCapture:j}),document.addEventListener("wheel",g,js),document.addEventListener("touchmove",g,js),document.addEventListener("touchstart",b,js),function(){ws=ws.filter(function(w){return w!==c}),document.removeEventListener("wheel",g,js),document.removeEventListener("touchmove",g,js),document.removeEventListener("touchstart",b,js)}},[]);var N=e.removeScrollBar,z=e.inert;return v.createElement(v.Fragment,null,z?v.createElement(c,{styles:nk(o)}):null,N?v.createElement(VA,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function lk(e){for(var a=null;e!==null;)e instanceof ShadowRoot&&(a=e.host,e=e.host),e=e.parentNode;return a}const sk=MA(J0,rk);var aS=v.forwardRef(function(e,a){return v.createElement(_c,ia({},e,{ref:a,sideCar:sk}))});aS.classNames=_c.classNames;var ik=function(e){if(typeof document>"u")return null;var a=Array.isArray(e)?e[0]:e;return a.ownerDocument.body},Ns=new WeakMap,Yu=new WeakMap,Fu={},bm=0,rS=function(e){return e&&(e.host||rS(e.parentNode))},ok=function(e,a){return a.map(function(r){if(e.contains(r))return r;var s=rS(r);return s&&e.contains(s)?s:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},uk=function(e,a,r,s){var o=ok(a,Array.isArray(e)?e:[e]);Fu[r]||(Fu[r]=new WeakMap);var c=Fu[r],m=[],h=new Set,g=new Set(o),p=function(x){!x||h.has(x)||(h.add(x),p(x.parentNode))};o.forEach(p);var b=function(x){!x||g.has(x)||Array.prototype.forEach.call(x.children,function(j){if(h.has(j))b(j);else try{var N=j.getAttribute(s),z=N!==null&&N!=="false",w=(Ns.get(j)||0)+1,E=(c.get(j)||0)+1;Ns.set(j,w),c.set(j,E),m.push(j),w===1&&z&&Yu.set(j,!0),E===1&&j.setAttribute(r,"true"),z||j.setAttribute(s,"true")}catch(M){console.error("aria-hidden: cannot operate on ",j,M)}})};return b(a),h.clear(),bm++,function(){m.forEach(function(x){var j=Ns.get(x)-1,N=c.get(x)-1;Ns.set(x,j),c.set(x,N),j||(Yu.has(x)||x.removeAttribute(s),Yu.delete(x)),N||x.removeAttribute(r)}),bm--,bm||(Ns=new WeakMap,Ns=new WeakMap,Yu=new WeakMap,Fu={})}},ck=function(e,a,r){r===void 0&&(r="data-aria-hidden");var s=Array.from(Array.isArray(e)?e:[e]),o=ik(e);return o?(s.push.apply(s,Array.from(o.querySelectorAll("[aria-live], script"))),uk(s,o,r,"aria-hidden")):function(){return null}},Cc="Dialog",[lS]=IC(Cc),[dk,Xn]=lS(Cc),sS=e=>{const{__scopeDialog:a,children:r,open:s,defaultOpen:o,onOpenChange:c,modal:m=!0}=e,h=v.useRef(null),g=v.useRef(null),[p,b]=KC({prop:s,defaultProp:o??!1,onChange:c,caller:Cc});return u.jsx(dk,{scope:a,triggerRef:h,contentRef:g,contentId:$a(),titleId:$a(),descriptionId:$a(),open:p,onOpenChange:b,onOpenToggle:v.useCallback(()=>b(x=>!x),[b]),modal:m,children:r})};sS.displayName=Cc;var iS="DialogTrigger",oS=v.forwardRef((e,a)=>{const{__scopeDialog:r,...s}=e,o=Xn(iS,r),c=Rl(a,o.triggerRef);return u.jsx(Ga.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Th(o.open),...s,ref:c,onClick:Mr(e.onClick,o.onOpenToggle)})});oS.displayName=iS;var kh="DialogPortal",[fk,uS]=lS(kh,{forceMount:void 0}),cS=e=>{const{__scopeDialog:a,forceMount:r,children:s,container:o}=e,c=Xn(kh,a);return u.jsx(fk,{scope:a,forceMount:r,children:v.Children.map(s,m=>u.jsx(Ec,{present:r||c.open,children:u.jsx(Y0,{asChild:!0,container:o,children:m})}))})};cS.displayName=kh;var dc="DialogOverlay",dS=v.forwardRef((e,a)=>{const r=uS(dc,e.__scopeDialog),{forceMount:s=r.forceMount,...o}=e,c=Xn(dc,e.__scopeDialog);return c.modal?u.jsx(Ec,{present:s||c.open,children:u.jsx(hk,{...o,ref:a})}):null});dS.displayName=dc;var mk=I0("DialogOverlay.RemoveScroll"),hk=v.forwardRef((e,a)=>{const{__scopeDialog:r,...s}=e,o=Xn(dc,r);return u.jsx(aS,{as:mk,allowPinchZoom:!0,shards:[o.contentRef],children:u.jsx(Ga.div,{"data-state":Th(o.open),...s,ref:a,style:{pointerEvents:"auto",...s.style}})})}),_l="DialogContent",fS=v.forwardRef((e,a)=>{const r=uS(_l,e.__scopeDialog),{forceMount:s=r.forceMount,...o}=e,c=Xn(_l,e.__scopeDialog);return u.jsx(Ec,{present:s||c.open,children:c.modal?u.jsx(pk,{...o,ref:a}):u.jsx(gk,{...o,ref:a})})});fS.displayName=_l;var pk=v.forwardRef((e,a)=>{const r=Xn(_l,e.__scopeDialog),s=v.useRef(null),o=Rl(a,r.contentRef,s);return v.useEffect(()=>{const c=s.current;if(c)return ck(c)},[]),u.jsx(mS,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Mr(e.onCloseAutoFocus,c=>{var m;c.preventDefault(),(m=r.triggerRef.current)==null||m.focus()}),onPointerDownOutside:Mr(e.onPointerDownOutside,c=>{const m=c.detail.originalEvent,h=m.button===0&&m.ctrlKey===!0;(m.button===2||h)&&c.preventDefault()}),onFocusOutside:Mr(e.onFocusOutside,c=>c.preventDefault())})}),gk=v.forwardRef((e,a)=>{const r=Xn(_l,e.__scopeDialog),s=v.useRef(!1),o=v.useRef(!1);return u.jsx(mS,{...e,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:c=>{var m,h;(m=e.onCloseAutoFocus)==null||m.call(e,c),c.defaultPrevented||(s.current||(h=r.triggerRef.current)==null||h.focus(),c.preventDefault()),s.current=!1,o.current=!1},onInteractOutside:c=>{var g,p;(g=e.onInteractOutside)==null||g.call(e,c),c.defaultPrevented||(s.current=!0,c.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const m=c.target;((p=r.triggerRef.current)==null?void 0:p.contains(m))&&c.preventDefault(),c.detail.originalEvent.type==="focusin"&&o.current&&c.preventDefault()}})}),mS=v.forwardRef((e,a)=>{const{__scopeDialog:r,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:c,...m}=e,h=Xn(_l,r),g=v.useRef(null),p=Rl(a,g);return NA(),u.jsxs(u.Fragment,{children:[u.jsx(V0,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:o,onUnmountAutoFocus:c,children:u.jsx(G0,{role:"dialog",id:h.contentId,"aria-describedby":h.descriptionId,"aria-labelledby":h.titleId,"data-state":Th(h.open),...m,ref:p,onDismiss:()=>h.onOpenChange(!1)})}),u.jsxs(u.Fragment,{children:[u.jsx(vk,{titleId:h.titleId}),u.jsx(bk,{contentRef:g,descriptionId:h.descriptionId})]})]})}),zh="DialogTitle",hS=v.forwardRef((e,a)=>{const{__scopeDialog:r,...s}=e,o=Xn(zh,r);return u.jsx(Ga.h2,{id:o.titleId,...s,ref:a})});hS.displayName=zh;var pS="DialogDescription",gS=v.forwardRef((e,a)=>{const{__scopeDialog:r,...s}=e,o=Xn(pS,r);return u.jsx(Ga.p,{id:o.descriptionId,...s,ref:a})});gS.displayName=pS;var vS="DialogClose",yS=v.forwardRef((e,a)=>{const{__scopeDialog:r,...s}=e,o=Xn(vS,r);return u.jsx(Ga.button,{type:"button",...s,ref:a,onClick:Mr(e.onClick,()=>o.onOpenChange(!1))})});yS.displayName=vS;function Th(e){return e?"open":"closed"}var bS="DialogTitleWarning",[OD,xS]=HC(bS,{contentName:_l,titleName:zh,docsSlug:"dialog"}),vk=({titleId:e})=>{const a=xS(bS),r=`\`${a.contentName}\` requires a \`${a.titleName}\` for the component to be accessible for screen reader users.
|
|
291
|
+
|
|
292
|
+
If you want to hide the \`${a.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
293
|
+
|
|
294
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${a.docsSlug}`;return v.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},yk="DialogDescriptionWarning",bk=({contentRef:e,descriptionId:a})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${xS(yk).contentName}}.`;return v.useEffect(()=>{var c;const o=(c=e.current)==null?void 0:c.getAttribute("aria-describedby");a&&o&&(document.getElementById(a)||console.warn(s))},[s,e,a]),null},SS=sS,xk=oS,jS=cS,wS=dS,NS=fS,Sk=hS,jk=gS,wk=yS,Nk=Symbol.for("react.lazy"),fc=dh[" use ".trim().toString()];function Ek(e){return typeof e=="object"&&e!==null&&"then"in e}function ES(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Nk&&"_payload"in e&&Ek(e._payload)}function _S(e){const a=Ck(e),r=v.forwardRef((s,o)=>{let{children:c,...m}=s;ES(c)&&typeof fc=="function"&&(c=fc(c._payload));const h=v.Children.toArray(c),g=h.find(kk);if(g){const p=g.props.children,b=h.map(x=>x===g?v.Children.count(p)>1?v.Children.only(null):v.isValidElement(p)?p.props.children:null:x);return u.jsx(a,{...m,ref:o,children:v.isValidElement(p)?v.cloneElement(p,void 0,b):null})}return u.jsx(a,{...m,ref:o,children:c})});return r.displayName=`${e}.Slot`,r}var _k=_S("Slot");function Ck(e){const a=v.forwardRef((r,s)=>{let{children:o,...c}=r;if(ES(o)&&typeof fc=="function"&&(o=fc(o._payload)),v.isValidElement(o)){const m=Tk(o),h=zk(c,o.props);return o.type!==v.Fragment&&(h.ref=s?Dr(s,m):m),v.cloneElement(o,h)}return v.Children.count(o)>1?v.Children.only(null):null});return a.displayName=`${e}.SlotClone`,a}var Ak=Symbol("radix.slottable");function kk(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ak}function zk(e,a){const r={...a};for(const s in a){const o=e[s],c=a[s];/^on[A-Z]/.test(s)?o&&c?r[s]=(...h)=>{const g=c(...h);return o(...h),g}:o&&(r[s]=o):s==="style"?r[s]={...o,...c}:s==="className"&&(r[s]=[o,c].filter(Boolean).join(" "))}return{...e,...r}}function Tk(e){var s,o;let a=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,r=a&&"isReactWarning"in a&&a.isReactWarning;return r?e.ref:(a=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=a&&"isReactWarning"in a&&a.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Rk=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Pa=Rk.reduce((e,a)=>{const r=_S(`Primitive.${a}`),s=v.forwardRef((o,c)=>{const{asChild:m,...h}=o,g=m?r:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(g,{...h,ref:c})});return s.displayName=`Primitive.${a}`,{...e,[a]:s}},{}),Yi='[cmdk-group=""]',xm='[cmdk-group-items=""]',Ok='[cmdk-group-heading=""]',CS='[cmdk-item=""]',Zb=`${CS}:not([aria-disabled="true"])`,eh="cmdk-item-select",Es="data-value",Mk=(e,a,r)=>qC(e,a,r),AS=v.createContext(void 0),bo=()=>v.useContext(AS),kS=v.createContext(void 0),Rh=()=>v.useContext(kS),zS=v.createContext(void 0),TS=v.forwardRef((e,a)=>{let r=_s(()=>{var k,V;return{search:"",value:(V=(k=e.value)!=null?k:e.defaultValue)!=null?V:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),s=_s(()=>new Set),o=_s(()=>new Map),c=_s(()=>new Map),m=_s(()=>new Set),h=RS(e),{label:g,children:p,value:b,onValueChange:x,filter:j,shouldFilter:N,loop:z,disablePointerSelection:w=!1,vimBindings:E=!0,...M}=e,Z=$a(),D=$a(),O=$a(),P=v.useRef(null),I=Gk();Cl(()=>{if(b!==void 0){let k=b.trim();r.current.value=k,L.emit()}},[b]),Cl(()=>{I(6,ve)},[]);let L=v.useMemo(()=>({subscribe:k=>(m.current.add(k),()=>m.current.delete(k)),snapshot:()=>r.current,setState:(k,V,ee)=>{var H,ne,fe,Me;if(!Object.is(r.current[k],V)){if(r.current[k]=V,k==="search")re(),Se(),I(1,_e);else if(k==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let pe=document.getElementById(O);pe?pe.focus():(H=document.getElementById(Z))==null||H.focus()}if(I(7,()=>{var pe;r.current.selectedItemId=(pe=Te())==null?void 0:pe.id,L.emit()}),ee||I(5,ve),((ne=h.current)==null?void 0:ne.value)!==void 0){let pe=V??"";(Me=(fe=h.current).onValueChange)==null||Me.call(fe,pe);return}}L.emit()}},emit:()=>{m.current.forEach(k=>k())}}),[]),K=v.useMemo(()=>({value:(k,V,ee)=>{var H;V!==((H=c.current.get(k))==null?void 0:H.value)&&(c.current.set(k,{value:V,keywords:ee}),r.current.filtered.items.set(k,se(V,ee)),I(2,()=>{Se(),L.emit()}))},item:(k,V)=>(s.current.add(k),V&&(o.current.has(V)?o.current.get(V).add(k):o.current.set(V,new Set([k]))),I(3,()=>{re(),Se(),r.current.value||_e(),L.emit()}),()=>{c.current.delete(k),s.current.delete(k),r.current.filtered.items.delete(k);let ee=Te();I(4,()=>{re(),(ee==null?void 0:ee.getAttribute("id"))===k&&_e(),L.emit()})}),group:k=>(o.current.has(k)||o.current.set(k,new Set),()=>{c.current.delete(k),o.current.delete(k)}),filter:()=>h.current.shouldFilter,label:g||e["aria-label"],getDisablePointerSelection:()=>h.current.disablePointerSelection,listId:Z,inputId:O,labelId:D,listInnerRef:P}),[]);function se(k,V){var ee,H;let ne=(H=(ee=h.current)==null?void 0:ee.filter)!=null?H:Mk;return k?ne(k,r.current.search,V):0}function Se(){if(!r.current.search||h.current.shouldFilter===!1)return;let k=r.current.filtered.items,V=[];r.current.filtered.groups.forEach(H=>{let ne=o.current.get(H),fe=0;ne.forEach(Me=>{let pe=k.get(Me);fe=Math.max(pe,fe)}),V.push([H,fe])});let ee=P.current;we().sort((H,ne)=>{var fe,Me;let pe=H.getAttribute("id"),Dt=ne.getAttribute("id");return((fe=k.get(Dt))!=null?fe:0)-((Me=k.get(pe))!=null?Me:0)}).forEach(H=>{let ne=H.closest(xm);ne?ne.appendChild(H.parentElement===ne?H:H.closest(`${xm} > *`)):ee.appendChild(H.parentElement===ee?H:H.closest(`${xm} > *`))}),V.sort((H,ne)=>ne[1]-H[1]).forEach(H=>{var ne;let fe=(ne=P.current)==null?void 0:ne.querySelector(`${Yi}[${Es}="${encodeURIComponent(H[0])}"]`);fe==null||fe.parentElement.appendChild(fe)})}function _e(){let k=we().find(ee=>ee.getAttribute("aria-disabled")!=="true"),V=k==null?void 0:k.getAttribute(Es);L.setState("value",V||void 0)}function re(){var k,V,ee,H;if(!r.current.search||h.current.shouldFilter===!1){r.current.filtered.count=s.current.size;return}r.current.filtered.groups=new Set;let ne=0;for(let fe of s.current){let Me=(V=(k=c.current.get(fe))==null?void 0:k.value)!=null?V:"",pe=(H=(ee=c.current.get(fe))==null?void 0:ee.keywords)!=null?H:[],Dt=se(Me,pe);r.current.filtered.items.set(fe,Dt),Dt>0&&ne++}for(let[fe,Me]of o.current)for(let pe of Me)if(r.current.filtered.items.get(pe)>0){r.current.filtered.groups.add(fe);break}r.current.filtered.count=ne}function ve(){var k,V,ee;let H=Te();H&&(((k=H.parentElement)==null?void 0:k.firstChild)===H&&((ee=(V=H.closest(Yi))==null?void 0:V.querySelector(Ok))==null||ee.scrollIntoView({block:"nearest"})),H.scrollIntoView({block:"nearest"}))}function Te(){var k;return(k=P.current)==null?void 0:k.querySelector(`${CS}[aria-selected="true"]`)}function we(){var k;return Array.from(((k=P.current)==null?void 0:k.querySelectorAll(Zb))||[])}function Q(k){let V=we()[k];V&&L.setState("value",V.getAttribute(Es))}function te(k){var V;let ee=Te(),H=we(),ne=H.findIndex(Me=>Me===ee),fe=H[ne+k];(V=h.current)!=null&&V.loop&&(fe=ne+k<0?H[H.length-1]:ne+k===H.length?H[0]:H[ne+k]),fe&&L.setState("value",fe.getAttribute(Es))}function ce(k){let V=Te(),ee=V==null?void 0:V.closest(Yi),H;for(;ee&&!H;)ee=k>0?Ik(ee,Yi):Qk(ee,Yi),H=ee==null?void 0:ee.querySelector(Zb);H?L.setState("value",H.getAttribute(Es)):te(k)}let Ce=()=>Q(we().length-1),ae=k=>{k.preventDefault(),k.metaKey?Ce():k.altKey?ce(1):te(1)},T=k=>{k.preventDefault(),k.metaKey?Q(0):k.altKey?ce(-1):te(-1)};return v.createElement(Pa.div,{ref:a,tabIndex:-1,...M,"cmdk-root":"",onKeyDown:k=>{var V;(V=M.onKeyDown)==null||V.call(M,k);let ee=k.nativeEvent.isComposing||k.keyCode===229;if(!(k.defaultPrevented||ee))switch(k.key){case"n":case"j":{E&&k.ctrlKey&&ae(k);break}case"ArrowDown":{ae(k);break}case"p":case"k":{E&&k.ctrlKey&&T(k);break}case"ArrowUp":{T(k);break}case"Home":{k.preventDefault(),Q(0);break}case"End":{k.preventDefault(),Ce();break}case"Enter":{k.preventDefault();let H=Te();if(H){let ne=new Event(eh);H.dispatchEvent(ne)}}}}},v.createElement("label",{"cmdk-label":"",htmlFor:K.inputId,id:K.labelId,style:Vk},g),Ac(e,k=>v.createElement(kS.Provider,{value:L},v.createElement(AS.Provider,{value:K},k))))}),Dk=v.forwardRef((e,a)=>{var r,s;let o=$a(),c=v.useRef(null),m=v.useContext(zS),h=bo(),g=RS(e),p=(s=(r=g.current)==null?void 0:r.forceMount)!=null?s:m==null?void 0:m.forceMount;Cl(()=>{if(!p)return h.item(o,m==null?void 0:m.id)},[p]);let b=OS(o,c,[e.value,e.children,c],e.keywords),x=Rh(),j=Ur(I=>I.value&&I.value===b.current),N=Ur(I=>p||h.filter()===!1?!0:I.search?I.filtered.items.get(o)>0:!0);v.useEffect(()=>{let I=c.current;if(!(!I||e.disabled))return I.addEventListener(eh,z),()=>I.removeEventListener(eh,z)},[N,e.onSelect,e.disabled]);function z(){var I,L;w(),(L=(I=g.current).onSelect)==null||L.call(I,b.current)}function w(){x.setState("value",b.current,!0)}if(!N)return null;let{disabled:E,value:M,onSelect:Z,forceMount:D,keywords:O,...P}=e;return v.createElement(Pa.div,{ref:Dr(c,a),...P,id:o,"cmdk-item":"",role:"option","aria-disabled":!!E,"aria-selected":!!j,"data-disabled":!!E,"data-selected":!!j,onPointerMove:E||h.getDisablePointerSelection()?void 0:w,onClick:E?void 0:z},e.children)}),Uk=v.forwardRef((e,a)=>{let{heading:r,children:s,forceMount:o,...c}=e,m=$a(),h=v.useRef(null),g=v.useRef(null),p=$a(),b=bo(),x=Ur(N=>o||b.filter()===!1?!0:N.search?N.filtered.groups.has(m):!0);Cl(()=>b.group(m),[]),OS(m,h,[e.value,e.heading,g]);let j=v.useMemo(()=>({id:m,forceMount:o}),[o]);return v.createElement(Pa.div,{ref:Dr(h,a),...c,"cmdk-group":"",role:"presentation",hidden:x?void 0:!0},r&&v.createElement("div",{ref:g,"cmdk-group-heading":"","aria-hidden":!0,id:p},r),Ac(e,N=>v.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?p:void 0},v.createElement(zS.Provider,{value:j},N))))}),Lk=v.forwardRef((e,a)=>{let{alwaysRender:r,...s}=e,o=v.useRef(null),c=Ur(m=>!m.search);return!r&&!c?null:v.createElement(Pa.div,{ref:Dr(o,a),...s,"cmdk-separator":"",role:"separator"})}),$k=v.forwardRef((e,a)=>{let{onValueChange:r,...s}=e,o=e.value!=null,c=Rh(),m=Ur(p=>p.search),h=Ur(p=>p.selectedItemId),g=bo();return v.useEffect(()=>{e.value!=null&&c.setState("search",e.value)},[e.value]),v.createElement(Pa.input,{ref:a,...s,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":g.listId,"aria-labelledby":g.labelId,"aria-activedescendant":h,id:g.inputId,type:"text",value:o?e.value:m,onChange:p=>{o||c.setState("search",p.target.value),r==null||r(p.target.value)}})}),Bk=v.forwardRef((e,a)=>{let{children:r,label:s="Suggestions",...o}=e,c=v.useRef(null),m=v.useRef(null),h=Ur(p=>p.selectedItemId),g=bo();return v.useEffect(()=>{if(m.current&&c.current){let p=m.current,b=c.current,x,j=new ResizeObserver(()=>{x=requestAnimationFrame(()=>{let N=p.offsetHeight;b.style.setProperty("--cmdk-list-height",N.toFixed(1)+"px")})});return j.observe(p),()=>{cancelAnimationFrame(x),j.unobserve(p)}}},[]),v.createElement(Pa.div,{ref:Dr(c,a),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":h,"aria-label":s,id:g.listId},Ac(e,p=>v.createElement("div",{ref:Dr(m,g.listInnerRef),"cmdk-list-sizer":""},p)))}),Zk=v.forwardRef((e,a)=>{let{open:r,onOpenChange:s,overlayClassName:o,contentClassName:c,container:m,...h}=e;return v.createElement(SS,{open:r,onOpenChange:s},v.createElement(jS,{container:m},v.createElement(wS,{"cmdk-overlay":"",className:o}),v.createElement(NS,{"aria-label":e.label,"cmdk-dialog":"",className:c},v.createElement(TS,{ref:a,...h}))))}),qk=v.forwardRef((e,a)=>Ur(r=>r.filtered.count===0)?v.createElement(Pa.div,{ref:a,...e,"cmdk-empty":"",role:"presentation"}):null),Hk=v.forwardRef((e,a)=>{let{progress:r,children:s,label:o="Loading...",...c}=e;return v.createElement(Pa.div,{ref:a,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},Ac(e,m=>v.createElement("div",{"aria-hidden":!0},m)))}),cn=Object.assign(TS,{List:Bk,Item:Dk,Input:$k,Group:Uk,Separator:Lk,Dialog:Zk,Empty:qk,Loading:Hk});function Ik(e,a){let r=e.nextElementSibling;for(;r;){if(r.matches(a))return r;r=r.nextElementSibling}}function Qk(e,a){let r=e.previousElementSibling;for(;r;){if(r.matches(a))return r;r=r.previousElementSibling}}function RS(e){let a=v.useRef(e);return Cl(()=>{a.current=e}),a}var Cl=typeof window>"u"?v.useEffect:v.useLayoutEffect;function _s(e){let a=v.useRef();return a.current===void 0&&(a.current=e()),a}function Ur(e){let a=Rh(),r=()=>e(a.snapshot());return v.useSyncExternalStore(a.subscribe,r,r)}function OS(e,a,r,s=[]){let o=v.useRef(),c=bo();return Cl(()=>{var m;let h=(()=>{var p;for(let b of r){if(typeof b=="string")return b.trim();if(typeof b=="object"&&"current"in b)return b.current?(p=b.current.textContent)==null?void 0:p.trim():o.current}})(),g=s.map(p=>p.trim());c.value(e,h,g),(m=a.current)==null||m.setAttribute(Es,h),o.current=h}),o}var Gk=()=>{let[e,a]=v.useState(),r=_s(()=>new Map);return Cl(()=>{r.current.forEach(s=>s()),r.current=new Map},[e]),(s,o)=>{r.current.set(s,o),a({})}};function Pk(e){let a=e.type;return typeof a=="function"?a(e.props):"render"in a?a.render(e.props):e}function Ac({asChild:e,children:a},r){return e&&v.isValidElement(a)?v.cloneElement(Pk(a),{ref:a.ref},r(a.props.children)):r(a)}var Vk={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Ln=SS,Kk=xk,Yk=jS,MS=v.forwardRef(({className:e,...a},r)=>u.jsx(wS,{ref:r,className:je("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...a}));MS.displayName="DialogOverlay";const xn=v.forwardRef(({className:e,children:a,...r},s)=>u.jsxs(Yk,{children:[u.jsx(MS,{}),u.jsxs(NS,{ref:s,className:je("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),...r,children:[a,u.jsxs(wk,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[u.jsx(D2,{className:"h-4 w-4"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));xn.displayName="DialogContent";function Fn({className:e,...a}){return u.jsx("div",{className:je("flex flex-col space-y-1.5 text-center sm:text-left",e),...a})}function $n({className:e,...a}){return u.jsx("div",{className:je("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...a})}const Bn=v.forwardRef(({className:e,...a},r)=>u.jsx(Sk,{ref:r,className:je("text-lg font-semibold leading-none tracking-tight",e),...a}));Bn.displayName="DialogTitle";const Fk=v.forwardRef(({className:e,...a},r)=>u.jsx(jk,{ref:r,className:je("text-sm text-muted-foreground",e),...a}));Fk.displayName="DialogDescription";const DS=v.forwardRef(({className:e,...a},r)=>u.jsx(cn,{ref:r,className:je("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...a}));DS.displayName=cn.displayName;function Xk({open:e,onOpenChange:a,children:r}){return u.jsx(Ln,{open:e,onOpenChange:a,children:u.jsx(xn,{className:"overflow-hidden p-0 shadow-lg",children:u.jsx(DS,{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:r})})})}const US=v.forwardRef(({className:e,...a},r)=>u.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[u.jsx(_h,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),u.jsx(cn.Input,{ref:r,className:je("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...a})]}));US.displayName=cn.Input.displayName;const LS=v.forwardRef(({className:e,...a},r)=>u.jsx(cn.List,{ref:r,className:je("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...a}));LS.displayName=cn.List.displayName;const $S=v.forwardRef((e,a)=>u.jsx(cn.Empty,{ref:a,className:"py-6 text-center text-sm",...e}));$S.displayName=cn.Empty.displayName;const lc=v.forwardRef(({className:e,...a},r)=>u.jsx(cn.Group,{ref:r,className:je("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...a}));lc.displayName=cn.Group.displayName;const th=v.forwardRef(({className:e,...a},r)=>u.jsx(cn.Separator,{ref:r,className:je("-mx-1 h-px bg-border",e),...a}));th.displayName=cn.Separator.displayName;const sc=v.forwardRef(({className:e,...a},r)=>u.jsx(cn.Item,{ref:r,className:je("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...a}));sc.displayName=cn.Item.displayName;function Oh(e){const a=new URLSearchParams;e!=null&&e.limit&&a.set("limit",String(e.limit)),e!=null&&e.cursor&&a.set("cursor",e.cursor),e!=null&&e.type&&a.set("type",e.type);const r=a.toString();return ke.get(`/admin/agents${r?`?${r}`:""}`)}function BS(e){return ke.get(`/admin/agents/${encodeURIComponent(e)}`)}function Jk(e){return ke.post("/admin/agents",e)}function qb(e,a){return ke.patch(`/admin/agents/${encodeURIComponent(e)}`,a)}function Wk(e){return ke.delete(`/admin/agents/${encodeURIComponent(e)}`)}function ez(e){return ke.post(`/admin/agents/${encodeURIComponent(e)}/suspend`,{})}function tz(e){return ke.post(`/admin/agents/${encodeURIComponent(e)}/reactivate`,{})}function nz(e){return ke.post(`/admin/agents/${encodeURIComponent(e)}/test`,{})}function Va(){const{data:e}=Ie({queryKey:["agents","name-map"],queryFn:()=>Oh({limit:100}),staleTime:3e4});return v.useMemo(()=>{const a=new Map;if(e!=null&&e.items)for(const r of e.items)a.set(r.uuid,r.name??r.displayName??r.uuid);return r=>r?a.get(r)??r:"—"},[e])}const az=[{path:"/",label:"Workspace"},{path:"/agents",label:"Agents"},{path:"/admin",label:"Admin"}];function rz({open:e,onOpenChange:a}){const r=Qa(),s=Va(),{data:o}=Ie({queryKey:["activity"],queryFn:wc,enabled:e,staleTime:3e4}),c=(o==null?void 0:o.agents)??[],h=Ie({queryKey:["palette-sessions",c.map(p=>p.agentId).join(",")],queryFn:async()=>{const p=[];for(const b of c)try{const x=await Js(b.agentId);for(const j of x)p.push({agentId:b.agentId,session:j})}catch{}return p},enabled:e&&c.length>0,staleTime:3e4}).data??[],g=p=>{a(!1),r(p)};return u.jsxs(Xk,{open:e,onOpenChange:a,children:[u.jsx(US,{placeholder:"Jump to agent, chat, or page…"}),u.jsxs(LS,{children:[u.jsx($S,{children:"No results"}),c.length>0&&u.jsx(lc,{heading:"Agents",children:c.map(p=>{const b=s(p.agentId);return u.jsxs(sc,{value:`agent ${b} ${p.agentId}`,onSelect:()=>g(`/?a=${p.agentId}`),children:[u.jsx(V_,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),u.jsx("span",{className:"flex-1 truncate",children:b}),u.jsx("span",{className:"text-xs text-muted-foreground font-mono ml-2",children:p.agentId.slice(0,8)})]},p.agentId)})}),h.length>0&&u.jsxs(u.Fragment,{children:[u.jsx(th,{}),u.jsx(lc,{heading:"Chats",children:h.map(({agentId:p,session:b})=>{const x=s(p);return u.jsxs(sc,{value:`chat ${x} ${b.chatId}`,onSelect:()=>g(`/?a=${p}&c=${b.chatId}`),children:[u.jsx(S0,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),u.jsx("span",{className:"flex-1 truncate",children:x}),u.jsx("span",{className:"text-xs text-muted-foreground font-mono ml-2",children:b.chatId.slice(0,8)})]},`${p}-${b.chatId}`)})})]}),u.jsx(th,{}),u.jsx(lc,{heading:"Pages",children:az.map(p=>u.jsxs(sc,{value:`page ${p.label}`,onSelect:()=>g(p.path),children:[u.jsx(r2,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),u.jsx("span",{children:p.label})]},p.path))})]})]})}function nh(e){const a=new URLSearchParams;e!=null&&e.limit&&a.set("limit",String(e.limit)),e!=null&&e.cursor&&a.set("cursor",e.cursor),e!=null&&e.severity&&a.set("severity",e.severity),(e==null?void 0:e.read)!==void 0&&a.set("read",String(e.read)),e!=null&&e.agentId&&a.set("agentId",e.agentId);const r=a.toString();return ke.get(`/admin/notifications${r?`?${r}`:""}`)}function ZS(e){return ke.post(`/admin/notifications/${e}/read`)}function lz(){return ke.post("/admin/notifications/read-all")}function sz(e){switch(e){case"high":return"bg-red-500";case"medium":return"bg-yellow-500";default:return"bg-gray-400"}}function iz(e){const a=Date.now()-new Date(e).getTime(),r=Math.floor(a/6e4);if(r<1)return"just now";if(r<60)return`${r}m`;const s=Math.floor(r/60);return s<24?`${s}h`:`${Math.floor(s/24)}d`}function oz(){var x;const[e,a]=v.useState(!1),r=v.useRef(null),s=Qa(),o=Va(),{data:c}=Ie({queryKey:["notifications","bell"],queryFn:()=>nh({limit:5}),refetchInterval:1e4}),{data:m}=Ie({queryKey:["notifications","unread-count"],queryFn:()=>nh({read:!1,limit:100}),refetchInterval:1e4}),h=((x=m==null?void 0:m.items)==null?void 0:x.length)??0,g=h>0,p=v.useCallback(async j=>{j.read||ZS(j.id).catch(()=>{}),a(!1),j.agentId&&j.chatId?s(`/?a=${j.agentId}&c=${j.chatId}`):j.agentId&&s(`/?a=${j.agentId}`)},[s]),b=v.useCallback(()=>{lz().catch(()=>{})},[]);return u.jsxs("div",{className:"relative",children:[u.jsxs("button",{type:"button",onClick:()=>a(!e),className:"relative flex items-center justify-center rounded-md p-1.5 text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-colors",children:[u.jsx(G_,{className:"h-4 w-4"}),g&&u.jsx("span",{className:"absolute -top-0.5 -right-0.5 flex h-4 min-w-4 items-center justify-center rounded-full bg-red-500 px-1 text-[10px] font-medium text-white",children:h>99?"99+":h})]}),e&&u.jsxs(u.Fragment,{children:[u.jsx("button",{type:"button",className:"fixed inset-0 z-40 cursor-default",onClick:()=>a(!1)}),u.jsxs("div",{ref:r,className:"absolute right-0 top-full mt-1 z-50 w-80 rounded-md border border-border bg-card shadow-lg",children:[u.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border",children:[u.jsx("span",{className:"text-sm font-medium",children:"Notifications"}),g&&u.jsx("button",{type:"button",onClick:b,className:"text-xs text-muted-foreground hover:text-foreground",children:"Mark all"})]}),u.jsx("div",{className:"max-h-80 overflow-y-auto",children:!(c!=null&&c.items)||c.items.length===0?u.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"No notifications"}):c.items.map(j=>u.jsxs("button",{type:"button",onClick:()=>p(j),className:je("w-full flex items-start gap-2 px-3 py-2 text-left hover:bg-accent/50 transition-colors",!j.read&&"bg-accent/20"),children:[u.jsx("span",{className:je("mt-1.5 h-2 w-2 shrink-0 rounded-full",sz(j.severity))}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsx("p",{className:je("text-sm truncate",!j.read&&"font-medium"),children:j.message}),u.jsxs("p",{className:"text-xs text-muted-foreground",children:[j.agentId?o(j.agentId):""," ",iz(j.createdAt)]})]})]},j.id))})]})]})]})}function uz(){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 cz(){const[e,a]=v.useState(uz);return v.useEffect(()=>{document.documentElement.classList.toggle("dark",e==="dark"),window.localStorage.setItem("theme",e)},[e]),u.jsx("button",{type:"button",onClick:()=>a(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-sm text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-colors",children:e==="dark"?u.jsx(E2,{className:"h-4 w-4"}):u.jsx(m2,{className:"h-4 w-4"})})}const Hb=[{to:"/",label:"Workspace",end:!0,kbd:"⌘1"},{to:"/agents",label:"Agents",end:!1,kbd:"⌘2"},{to:"/clients",label:"Computers",end:!1,kbd:"⌘3"}],dz={to:"/admin",label:"Admin",end:!1,kbd:"⌘4"};function fz(){const{role:e,logout:a}=yo(),r=e==="admin",[s,o]=v.useState(!1),c=r?[...Hb,dz]:Hb,m=Hn(),h=m.pathname==="/"||m.search.includes("a=");return v.useEffect(()=>{const g=p=>{(p.metaKey||p.ctrlKey)&&p.key.toLowerCase()==="k"&&(p.preventDefault(),o(b=>!b))};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[]),u.jsxs("div",{className:"flex flex-col overflow-hidden",style:{height:"100vh",background:"var(--bg)"},children:[u.jsxs("header",{className:"relative shrink-0 grid items-center",style:{height:40,gridTemplateColumns:"auto 1fr auto",padding:"0 12px",borderBottom:"1px solid var(--border)",background:"var(--bg-raised)"},children:[u.jsxs("div",{className:"flex items-center",style:{gap:10},children:[u.jsx(jc,{className:"h-4 w-4",style:{color:"var(--accent)"}}),u.jsxs("span",{style:{fontWeight:600,fontSize:13,letterSpacing:-.1,color:"var(--fg)"},children:["First Tree ",u.jsx("span",{style:{color:"var(--fg-3)",fontWeight:400},children:"Hub"})]})]}),u.jsx("nav",{className:"flex justify-center",style:{gap:2,pointerEvents:"none"},children:c.map(g=>u.jsx(d0,{to:g.to,end:g.end,style:{pointerEvents:"auto"},className:({isActive:p})=>je("inline-flex items-center transition-colors",p?"":"hover:text-[var(--fg)]"),children:({isActive:p})=>u.jsxs("span",{className:"inline-flex items-center",style:{padding:"5px 12px",fontSize:12,fontWeight:500,gap:6,borderRadius:5,color:p?"var(--fg)":"var(--fg-3)",background:p?"var(--bg-hover)":"transparent"},children:[g.label,p&&u.jsx("span",{className:"kbd",children:g.kbd})]})},g.to))}),u.jsxs("div",{className:"flex items-center",style:{gap:6},children:[u.jsxs("button",{type:"button",onClick:()=>o(!0),"aria-label":"Open command palette",className:"inline-flex items-center transition-colors",style:{gap:8,padding:"4px 8px",fontSize:11,color:"var(--fg-3)",border:"1px solid var(--border)",borderRadius:4,background:"var(--bg-sunken)"},onMouseEnter:g=>{g.currentTarget.style.color="var(--fg)"},onMouseLeave:g=>{g.currentTarget.style.color="var(--fg-3)"},children:[u.jsx(_h,{className:"h-3.5 w-3.5"}),u.jsx("span",{children:"Jump to…"}),u.jsx("span",{className:"kbd",children:"⌘K"})]}),u.jsx("span",{style:{width:1,height:18,background:"var(--border)",margin:"0 4px"}}),u.jsx(oz,{}),u.jsx(cz,{}),u.jsx("span",{style:{width:1,height:18,background:"var(--border)",margin:"0 4px"}}),u.jsx("button",{type:"button",onClick:a,className:"inline-flex items-center transition-colors hover:text-[var(--fg)]",style:{padding:"4px 8px",color:"var(--fg-3)",borderRadius:4,gap:6,fontSize:11},"aria-label":"Log out",children:u.jsx(c2,{className:"h-3.5 w-3.5"})})]})]}),u.jsx(rz,{open:s,onOpenChange:o}),h?u.jsx(Vm,{}):u.jsx("main",{className:"flex-1 overflow-auto",children:u.jsx("div",{className:"p-6 max-w-5xl mx-auto",children:u.jsx(Vm,{})})})]})}function F(e,a,r){function s(h,g){if(h._zod||Object.defineProperty(h,"_zod",{value:{def:g,constr:m,traits:new Set},enumerable:!1}),h._zod.traits.has(e))return;h._zod.traits.add(e),a(h,g);const p=m.prototype,b=Object.keys(p);for(let x=0;x<b.length;x++){const j=b[x];j in h||(h[j]=p[j].bind(h))}}const o=(r==null?void 0:r.Parent)??Object;class c extends o{}Object.defineProperty(c,"name",{value:e});function m(h){var g;const p=r!=null&&r.Parent?new c:this;s(p,h),(g=p._zod).deferred??(g.deferred=[]);for(const b of p._zod.deferred)b();return p}return Object.defineProperty(m,"init",{value:s}),Object.defineProperty(m,Symbol.hasInstance,{value:h=>{var g,p;return r!=null&&r.Parent&&h instanceof r.Parent?!0:(p=(g=h==null?void 0:h._zod)==null?void 0:g.traits)==null?void 0:p.has(e)}}),Object.defineProperty(m,"name",{value:e}),m}class Ts extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class qS extends Error{constructor(a){super(`Encountered unidirectional transform during encode: ${a}`),this.name="ZodEncodeError"}}const HS={};function Lr(e){return HS}function IS(e){const a=Object.values(e).filter(s=>typeof s=="number");return Object.entries(e).filter(([s,o])=>a.indexOf(+s)===-1).map(([s,o])=>o)}function ah(e,a){return typeof a=="bigint"?a.toString():a}function kc(e){return{get value(){{const a=e();return Object.defineProperty(this,"value",{value:a}),a}}}}function Mh(e){return e==null}function Dh(e){const a=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(a,r)}function mz(e,a){const r=(e.toString().split(".")[1]||"").length,s=a.toString();let o=(s.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(s)){const g=s.match(/\d?e-(\d?)/);g!=null&&g[1]&&(o=Number.parseInt(g[1]))}const c=r>o?r:o,m=Number.parseInt(e.toFixed(c).replace(".","")),h=Number.parseInt(a.toFixed(c).replace(".",""));return m%h/10**c}const Ib=Symbol("evaluating");function Fe(e,a,r){let s;Object.defineProperty(e,a,{get(){if(s!==Ib)return s===void 0&&(s=Ib,s=r()),s},set(o){Object.defineProperty(e,a,{value:o})},configurable:!0})}function Ol(e,a,r){Object.defineProperty(e,a,{value:r,writable:!0,enumerable:!0,configurable:!0})}function qr(...e){const a={};for(const r of e){const s=Object.getOwnPropertyDescriptors(r);Object.assign(a,s)}return Object.defineProperties({},a)}function Qb(e){return JSON.stringify(e)}function hz(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const QS="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function so(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const pz=kc(()=>{var e;if(typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const a=Function;return new a(""),!0}catch{return!1}});function Qs(e){if(so(e)===!1)return!1;const a=e.constructor;if(a===void 0||typeof a!="function")return!0;const r=a.prototype;return!(so(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function GS(e){return Qs(e)?{...e}:Array.isArray(e)?[...e]:e}const gz=new Set(["string","number","symbol"]);function Gs(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Hr(e,a,r){const s=new e._zod.constr(a??e._zod.def);return(!a||r!=null&&r.parent)&&(s._zod.parent=e),s}function ge(e){const a=e;if(!a)return{};if(typeof a=="string")return{error:()=>a};if((a==null?void 0:a.message)!==void 0){if((a==null?void 0:a.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");a.error=a.message}return delete a.message,typeof a.error=="string"?{...a,error:()=>a.error}:a}function vz(e){return Object.keys(e).filter(a=>e[a]._zod.optin==="optional"&&e[a]._zod.optout==="optional")}const yz={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 bz(e,a){const r=e._zod.def,s=r.checks;if(s&&s.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const c=qr(e._zod.def,{get shape(){const m={};for(const h in a){if(!(h in r.shape))throw new Error(`Unrecognized key: "${h}"`);a[h]&&(m[h]=r.shape[h])}return Ol(this,"shape",m),m},checks:[]});return Hr(e,c)}function xz(e,a){const r=e._zod.def,s=r.checks;if(s&&s.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const c=qr(e._zod.def,{get shape(){const m={...e._zod.def.shape};for(const h in a){if(!(h in r.shape))throw new Error(`Unrecognized key: "${h}"`);a[h]&&delete m[h]}return Ol(this,"shape",m),m},checks:[]});return Hr(e,c)}function Sz(e,a){if(!Qs(a))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0){const c=e._zod.def.shape;for(const m in a)if(Object.getOwnPropertyDescriptor(c,m)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=qr(e._zod.def,{get shape(){const c={...e._zod.def.shape,...a};return Ol(this,"shape",c),c}});return Hr(e,o)}function jz(e,a){if(!Qs(a))throw new Error("Invalid input to safeExtend: expected a plain object");const r=qr(e._zod.def,{get shape(){const s={...e._zod.def.shape,...a};return Ol(this,"shape",s),s}});return Hr(e,r)}function wz(e,a){const r=qr(e._zod.def,{get shape(){const s={...e._zod.def.shape,...a._zod.def.shape};return Ol(this,"shape",s),s},get catchall(){return a._zod.def.catchall},checks:[]});return Hr(e,r)}function Nz(e,a,r){const o=a._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const m=qr(a._zod.def,{get shape(){const h=a._zod.def.shape,g={...h};if(r)for(const p in r){if(!(p in h))throw new Error(`Unrecognized key: "${p}"`);r[p]&&(g[p]=e?new e({type:"optional",innerType:h[p]}):h[p])}else for(const p in h)g[p]=e?new e({type:"optional",innerType:h[p]}):h[p];return Ol(this,"shape",g),g},checks:[]});return Hr(a,m)}function Ez(e,a,r){const s=qr(a._zod.def,{get shape(){const o=a._zod.def.shape,c={...o};if(r)for(const m in r){if(!(m in c))throw new Error(`Unrecognized key: "${m}"`);r[m]&&(c[m]=new e({type:"nonoptional",innerType:o[m]}))}else for(const m in o)c[m]=new e({type:"nonoptional",innerType:o[m]});return Ol(this,"shape",c),c}});return Hr(a,s)}function Cs(e,a=0){var r;if(e.aborted===!0)return!0;for(let s=a;s<e.issues.length;s++)if(((r=e.issues[s])==null?void 0:r.continue)!==!0)return!0;return!1}function As(e,a){return a.map(r=>{var s;return(s=r).path??(s.path=[]),r.path.unshift(e),r})}function Xu(e){return typeof e=="string"?e:e==null?void 0:e.message}function $r(e,a,r){var o,c,m,h,g,p;const s={...e,path:e.path??[]};if(!e.message){const b=Xu((m=(c=(o=e.inst)==null?void 0:o._zod.def)==null?void 0:c.error)==null?void 0:m.call(c,e))??Xu((h=a==null?void 0:a.error)==null?void 0:h.call(a,e))??Xu((g=r.customError)==null?void 0:g.call(r,e))??Xu((p=r.localeError)==null?void 0:p.call(r,e))??"Invalid input";s.message=b}return delete s.inst,delete s.continue,a!=null&&a.reportInput||delete s.input,s}function Uh(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function io(...e){const[a,r,s]=e;return typeof a=="string"?{message:a,code:"custom",input:r,inst:s}:{...a}}const PS=(e,a)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:a,enumerable:!1}),e.message=JSON.stringify(a,ah,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},VS=F("$ZodError",PS),KS=F("$ZodError",PS,{Parent:Error});function _z(e,a=r=>r.message){const r={},s=[];for(const o of e.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(a(o))):s.push(a(o));return{formErrors:s,fieldErrors:r}}function Cz(e,a=r=>r.message){const r={_errors:[]},s=o=>{for(const c of o.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(m=>s({issues:m}));else if(c.code==="invalid_key")s({issues:c.issues});else if(c.code==="invalid_element")s({issues:c.issues});else if(c.path.length===0)r._errors.push(a(c));else{let m=r,h=0;for(;h<c.path.length;){const g=c.path[h];h===c.path.length-1?(m[g]=m[g]||{_errors:[]},m[g]._errors.push(a(c))):m[g]=m[g]||{_errors:[]},m=m[g],h++}}};return s(e),r}const Lh=e=>(a,r,s,o)=>{const c=s?Object.assign(s,{async:!1}):{async:!1},m=a._zod.run({value:r,issues:[]},c);if(m instanceof Promise)throw new Ts;if(m.issues.length){const h=new((o==null?void 0:o.Err)??e)(m.issues.map(g=>$r(g,c,Lr())));throw QS(h,o==null?void 0:o.callee),h}return m.value},$h=e=>async(a,r,s,o)=>{const c=s?Object.assign(s,{async:!0}):{async:!0};let m=a._zod.run({value:r,issues:[]},c);if(m instanceof Promise&&(m=await m),m.issues.length){const h=new((o==null?void 0:o.Err)??e)(m.issues.map(g=>$r(g,c,Lr())));throw QS(h,o==null?void 0:o.callee),h}return m.value},zc=e=>(a,r,s)=>{const o=s?{...s,async:!1}:{async:!1},c=a._zod.run({value:r,issues:[]},o);if(c instanceof Promise)throw new Ts;return c.issues.length?{success:!1,error:new(e??VS)(c.issues.map(m=>$r(m,o,Lr())))}:{success:!0,data:c.value}},Az=zc(KS),Tc=e=>async(a,r,s)=>{const o=s?Object.assign(s,{async:!0}):{async:!0};let c=a._zod.run({value:r,issues:[]},o);return c instanceof Promise&&(c=await c),c.issues.length?{success:!1,error:new e(c.issues.map(m=>$r(m,o,Lr())))}:{success:!0,data:c.value}},kz=Tc(KS),zz=e=>(a,r,s)=>{const o=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return Lh(e)(a,r,o)},Tz=e=>(a,r,s)=>Lh(e)(a,r,s),Rz=e=>async(a,r,s)=>{const o=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return $h(e)(a,r,o)},Oz=e=>async(a,r,s)=>$h(e)(a,r,s),Mz=e=>(a,r,s)=>{const o=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return zc(e)(a,r,o)},Dz=e=>(a,r,s)=>zc(e)(a,r,s),Uz=e=>async(a,r,s)=>{const o=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return Tc(e)(a,r,o)},Lz=e=>async(a,r,s)=>Tc(e)(a,r,s),$z=/^[cC][^\s-]{8,}$/,Bz=/^[0-9a-z]+$/,Zz=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,qz=/^[0-9a-vA-V]{20}$/,Hz=/^[A-Za-z0-9]{27}$/,Iz=/^[a-zA-Z0-9_-]{21}$/,Qz=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Gz=/^([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})$/,Gb=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)$/,Pz=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Vz="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Kz(){return new RegExp(Vz,"u")}const Yz=/^(?:(?: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])$/,Fz=/^(([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}|:))$/,Xz=/^((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])$/,Jz=/^(([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])$/,Wz=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,YS=/^[A-Za-z0-9_-]*$/,eT=/^\+[1-9]\d{6,14}$/,FS="(?:(?:\\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])))",tT=new RegExp(`^${FS}$`);function XS(e){const a="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${a}`:e.precision===0?`${a}:[0-5]\\d`:`${a}:[0-5]\\d\\.\\d{${e.precision}}`:`${a}(?::[0-5]\\d(?:\\.\\d+)?)?`}function nT(e){return new RegExp(`^${XS(e)}$`)}function aT(e){const a=XS({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const s=`${a}(?:${r.join("|")})`;return new RegExp(`^${FS}T(?:${s})$`)}const rT=e=>{const a=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${a}$`)},lT=/^-?\d+$/,JS=/^-?\d+(?:\.\d+)?$/,sT=/^(?:true|false)$/i,iT=/^[^A-Z]*$/,oT=/^[^a-z]*$/,dn=F("$ZodCheck",(e,a)=>{var r;e._zod??(e._zod={}),e._zod.def=a,(r=e._zod).onattach??(r.onattach=[])}),WS={number:"number",bigint:"bigint",object:"date"},e1=F("$ZodCheckLessThan",(e,a)=>{dn.init(e,a);const r=WS[typeof a.value];e._zod.onattach.push(s=>{const o=s._zod.bag,c=(a.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;a.value<c&&(a.inclusive?o.maximum=a.value:o.exclusiveMaximum=a.value)}),e._zod.check=s=>{(a.inclusive?s.value<=a.value:s.value<a.value)||s.issues.push({origin:r,code:"too_big",maximum:typeof a.value=="object"?a.value.getTime():a.value,input:s.value,inclusive:a.inclusive,inst:e,continue:!a.abort})}}),t1=F("$ZodCheckGreaterThan",(e,a)=>{dn.init(e,a);const r=WS[typeof a.value];e._zod.onattach.push(s=>{const o=s._zod.bag,c=(a.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;a.value>c&&(a.inclusive?o.minimum=a.value:o.exclusiveMinimum=a.value)}),e._zod.check=s=>{(a.inclusive?s.value>=a.value:s.value>a.value)||s.issues.push({origin:r,code:"too_small",minimum:typeof a.value=="object"?a.value.getTime():a.value,input:s.value,inclusive:a.inclusive,inst:e,continue:!a.abort})}}),uT=F("$ZodCheckMultipleOf",(e,a)=>{dn.init(e,a),e._zod.onattach.push(r=>{var s;(s=r._zod.bag).multipleOf??(s.multipleOf=a.value)}),e._zod.check=r=>{if(typeof r.value!=typeof a.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%a.value===BigInt(0):mz(r.value,a.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:a.value,input:r.value,inst:e,continue:!a.abort})}}),cT=F("$ZodCheckNumberFormat",(e,a)=>{var m;dn.init(e,a),a.format=a.format||"float64";const r=(m=a.format)==null?void 0:m.includes("int"),s=r?"int":"number",[o,c]=yz[a.format];e._zod.onattach.push(h=>{const g=h._zod.bag;g.format=a.format,g.minimum=o,g.maximum=c,r&&(g.pattern=lT)}),e._zod.check=h=>{const g=h.value;if(r){if(!Number.isInteger(g)){h.issues.push({expected:s,format:a.format,code:"invalid_type",continue:!1,input:g,inst:e});return}if(!Number.isSafeInteger(g)){g>0?h.issues.push({input:g,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:s,inclusive:!0,continue:!a.abort}):h.issues.push({input:g,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:s,inclusive:!0,continue:!a.abort});return}}g<o&&h.issues.push({origin:"number",input:g,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!a.abort}),g>c&&h.issues.push({origin:"number",input:g,code:"too_big",maximum:c,inclusive:!0,inst:e,continue:!a.abort})}}),dT=F("$ZodCheckMaxLength",(e,a)=>{var r;dn.init(e,a),(r=e._zod.def).when??(r.when=s=>{const o=s.value;return!Mh(o)&&o.length!==void 0}),e._zod.onattach.push(s=>{const o=s._zod.bag.maximum??Number.POSITIVE_INFINITY;a.maximum<o&&(s._zod.bag.maximum=a.maximum)}),e._zod.check=s=>{const o=s.value;if(o.length<=a.maximum)return;const m=Uh(o);s.issues.push({origin:m,code:"too_big",maximum:a.maximum,inclusive:!0,input:o,inst:e,continue:!a.abort})}}),fT=F("$ZodCheckMinLength",(e,a)=>{var r;dn.init(e,a),(r=e._zod.def).when??(r.when=s=>{const o=s.value;return!Mh(o)&&o.length!==void 0}),e._zod.onattach.push(s=>{const o=s._zod.bag.minimum??Number.NEGATIVE_INFINITY;a.minimum>o&&(s._zod.bag.minimum=a.minimum)}),e._zod.check=s=>{const o=s.value;if(o.length>=a.minimum)return;const m=Uh(o);s.issues.push({origin:m,code:"too_small",minimum:a.minimum,inclusive:!0,input:o,inst:e,continue:!a.abort})}}),mT=F("$ZodCheckLengthEquals",(e,a)=>{var r;dn.init(e,a),(r=e._zod.def).when??(r.when=s=>{const o=s.value;return!Mh(o)&&o.length!==void 0}),e._zod.onattach.push(s=>{const o=s._zod.bag;o.minimum=a.length,o.maximum=a.length,o.length=a.length}),e._zod.check=s=>{const o=s.value,c=o.length;if(c===a.length)return;const m=Uh(o),h=c>a.length;s.issues.push({origin:m,...h?{code:"too_big",maximum:a.length}:{code:"too_small",minimum:a.length},inclusive:!0,exact:!0,input:s.value,inst:e,continue:!a.abort})}}),Rc=F("$ZodCheckStringFormat",(e,a)=>{var r,s;dn.init(e,a),e._zod.onattach.push(o=>{const c=o._zod.bag;c.format=a.format,a.pattern&&(c.patterns??(c.patterns=new Set),c.patterns.add(a.pattern))}),a.pattern?(r=e._zod).check??(r.check=o=>{a.pattern.lastIndex=0,!a.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:a.format,input:o.value,...a.pattern?{pattern:a.pattern.toString()}:{},inst:e,continue:!a.abort})}):(s=e._zod).check??(s.check=()=>{})}),hT=F("$ZodCheckRegex",(e,a)=>{Rc.init(e,a),e._zod.check=r=>{a.pattern.lastIndex=0,!a.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:a.pattern.toString(),inst:e,continue:!a.abort})}}),pT=F("$ZodCheckLowerCase",(e,a)=>{a.pattern??(a.pattern=iT),Rc.init(e,a)}),gT=F("$ZodCheckUpperCase",(e,a)=>{a.pattern??(a.pattern=oT),Rc.init(e,a)}),vT=F("$ZodCheckIncludes",(e,a)=>{dn.init(e,a);const r=Gs(a.includes),s=new RegExp(typeof a.position=="number"?`^.{${a.position}}${r}`:r);a.pattern=s,e._zod.onattach.push(o=>{const c=o._zod.bag;c.patterns??(c.patterns=new Set),c.patterns.add(s)}),e._zod.check=o=>{o.value.includes(a.includes,a.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:a.includes,input:o.value,inst:e,continue:!a.abort})}}),yT=F("$ZodCheckStartsWith",(e,a)=>{dn.init(e,a);const r=new RegExp(`^${Gs(a.prefix)}.*`);a.pattern??(a.pattern=r),e._zod.onattach.push(s=>{const o=s._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=s=>{s.value.startsWith(a.prefix)||s.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:a.prefix,input:s.value,inst:e,continue:!a.abort})}}),bT=F("$ZodCheckEndsWith",(e,a)=>{dn.init(e,a);const r=new RegExp(`.*${Gs(a.suffix)}$`);a.pattern??(a.pattern=r),e._zod.onattach.push(s=>{const o=s._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=s=>{s.value.endsWith(a.suffix)||s.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:a.suffix,input:s.value,inst:e,continue:!a.abort})}}),xT=F("$ZodCheckOverwrite",(e,a)=>{dn.init(e,a),e._zod.check=r=>{r.value=a.tx(r.value)}});class ST{constructor(a=[]){this.content=[],this.indent=0,this&&(this.args=a)}indented(a){this.indent+=1,a(this),this.indent-=1}write(a){if(typeof a=="function"){a(this,{execution:"sync"}),a(this,{execution:"async"});return}const s=a.split(`
|
|
295
|
+
`).filter(m=>m),o=Math.min(...s.map(m=>m.length-m.trimStart().length)),c=s.map(m=>m.slice(o)).map(m=>" ".repeat(this.indent*2)+m);for(const m of c)this.content.push(m)}compile(){const a=Function,r=this==null?void 0:this.args,o=[...((this==null?void 0:this.content)??[""]).map(c=>` ${c}`)];return new a(...r,o.join(`
|
|
296
|
+
`))}}const jT={major:4,minor:3,patch:6},ht=F("$ZodType",(e,a)=>{var o;var r;e??(e={}),e._zod.def=a,e._zod.bag=e._zod.bag||{},e._zod.version=jT;const s=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&s.unshift(e);for(const c of s)for(const m of c._zod.onattach)m(e);if(s.length===0)(r=e._zod).deferred??(r.deferred=[]),(o=e._zod.deferred)==null||o.push(()=>{e._zod.run=e._zod.parse});else{const c=(h,g,p)=>{let b=Cs(h),x;for(const j of g){if(j._zod.def.when){if(!j._zod.def.when(h))continue}else if(b)continue;const N=h.issues.length,z=j._zod.check(h);if(z instanceof Promise&&(p==null?void 0:p.async)===!1)throw new Ts;if(x||z instanceof Promise)x=(x??Promise.resolve()).then(async()=>{await z,h.issues.length!==N&&(b||(b=Cs(h,N)))});else{if(h.issues.length===N)continue;b||(b=Cs(h,N))}}return x?x.then(()=>h):h},m=(h,g,p)=>{if(Cs(h))return h.aborted=!0,h;const b=c(g,s,p);if(b instanceof Promise){if(p.async===!1)throw new Ts;return b.then(x=>e._zod.parse(x,p))}return e._zod.parse(b,p)};e._zod.run=(h,g)=>{if(g.skipChecks)return e._zod.parse(h,g);if(g.direction==="backward"){const b=e._zod.parse({value:h.value,issues:[]},{...g,skipChecks:!0});return b instanceof Promise?b.then(x=>m(x,h,g)):m(b,h,g)}const p=e._zod.parse(h,g);if(p instanceof Promise){if(g.async===!1)throw new Ts;return p.then(b=>c(b,s,g))}return c(p,s,g)}}Fe(e,"~standard",()=>({validate:c=>{var m;try{const h=Az(e,c);return h.success?{value:h.data}:{issues:(m=h.error)==null?void 0:m.issues}}catch{return kz(e,c).then(g=>{var p;return g.success?{value:g.data}:{issues:(p=g.error)==null?void 0:p.issues}})}},vendor:"zod",version:1}))}),Bh=F("$ZodString",(e,a)=>{var r;ht.init(e,a),e._zod.pattern=[...((r=e==null?void 0:e._zod.bag)==null?void 0:r.patterns)??[]].pop()??rT(e._zod.bag),e._zod.parse=(s,o)=>{if(a.coerce)try{s.value=String(s.value)}catch{}return typeof s.value=="string"||s.issues.push({expected:"string",code:"invalid_type",input:s.value,inst:e}),s}}),mt=F("$ZodStringFormat",(e,a)=>{Rc.init(e,a),Bh.init(e,a)}),wT=F("$ZodGUID",(e,a)=>{a.pattern??(a.pattern=Gz),mt.init(e,a)}),NT=F("$ZodUUID",(e,a)=>{if(a.version){const s={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[a.version];if(s===void 0)throw new Error(`Invalid UUID version: "${a.version}"`);a.pattern??(a.pattern=Gb(s))}else a.pattern??(a.pattern=Gb());mt.init(e,a)}),ET=F("$ZodEmail",(e,a)=>{a.pattern??(a.pattern=Pz),mt.init(e,a)}),_T=F("$ZodURL",(e,a)=>{mt.init(e,a),e._zod.check=r=>{try{const s=r.value.trim(),o=new URL(s);a.hostname&&(a.hostname.lastIndex=0,a.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:a.hostname.source,input:r.value,inst:e,continue:!a.abort})),a.protocol&&(a.protocol.lastIndex=0,a.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:a.protocol.source,input:r.value,inst:e,continue:!a.abort})),a.normalize?r.value=o.href:r.value=s;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!a.abort})}}}),CT=F("$ZodEmoji",(e,a)=>{a.pattern??(a.pattern=Kz()),mt.init(e,a)}),AT=F("$ZodNanoID",(e,a)=>{a.pattern??(a.pattern=Iz),mt.init(e,a)}),kT=F("$ZodCUID",(e,a)=>{a.pattern??(a.pattern=$z),mt.init(e,a)}),zT=F("$ZodCUID2",(e,a)=>{a.pattern??(a.pattern=Bz),mt.init(e,a)}),TT=F("$ZodULID",(e,a)=>{a.pattern??(a.pattern=Zz),mt.init(e,a)}),RT=F("$ZodXID",(e,a)=>{a.pattern??(a.pattern=qz),mt.init(e,a)}),OT=F("$ZodKSUID",(e,a)=>{a.pattern??(a.pattern=Hz),mt.init(e,a)}),MT=F("$ZodISODateTime",(e,a)=>{a.pattern??(a.pattern=aT(a)),mt.init(e,a)}),DT=F("$ZodISODate",(e,a)=>{a.pattern??(a.pattern=tT),mt.init(e,a)}),UT=F("$ZodISOTime",(e,a)=>{a.pattern??(a.pattern=nT(a)),mt.init(e,a)}),LT=F("$ZodISODuration",(e,a)=>{a.pattern??(a.pattern=Qz),mt.init(e,a)}),$T=F("$ZodIPv4",(e,a)=>{a.pattern??(a.pattern=Yz),mt.init(e,a),e._zod.bag.format="ipv4"}),BT=F("$ZodIPv6",(e,a)=>{a.pattern??(a.pattern=Fz),mt.init(e,a),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!a.abort})}}}),ZT=F("$ZodCIDRv4",(e,a)=>{a.pattern??(a.pattern=Xz),mt.init(e,a)}),qT=F("$ZodCIDRv6",(e,a)=>{a.pattern??(a.pattern=Jz),mt.init(e,a),e._zod.check=r=>{const s=r.value.split("/");try{if(s.length!==2)throw new Error;const[o,c]=s;if(!c)throw new Error;const m=Number(c);if(`${m}`!==c)throw new Error;if(m<0||m>128)throw new Error;new URL(`http://[${o}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!a.abort})}}});function n1(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const HT=F("$ZodBase64",(e,a)=>{a.pattern??(a.pattern=Wz),mt.init(e,a),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{n1(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!a.abort})}});function IT(e){if(!YS.test(e))return!1;const a=e.replace(/[-_]/g,s=>s==="-"?"+":"/"),r=a.padEnd(Math.ceil(a.length/4)*4,"=");return n1(r)}const QT=F("$ZodBase64URL",(e,a)=>{a.pattern??(a.pattern=YS),mt.init(e,a),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{IT(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!a.abort})}}),GT=F("$ZodE164",(e,a)=>{a.pattern??(a.pattern=eT),mt.init(e,a)});function PT(e,a=null){try{const r=e.split(".");if(r.length!==3)return!1;const[s]=r;if(!s)return!1;const o=JSON.parse(atob(s));return!("typ"in o&&(o==null?void 0:o.typ)!=="JWT"||!o.alg||a&&(!("alg"in o)||o.alg!==a))}catch{return!1}}const VT=F("$ZodJWT",(e,a)=>{mt.init(e,a),e._zod.check=r=>{PT(r.value,a.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!a.abort})}}),a1=F("$ZodNumber",(e,a)=>{ht.init(e,a),e._zod.pattern=e._zod.bag.pattern??JS,e._zod.parse=(r,s)=>{if(a.coerce)try{r.value=Number(r.value)}catch{}const o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;const c=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...c?{received:c}:{}}),r}}),KT=F("$ZodNumberFormat",(e,a)=>{cT.init(e,a),a1.init(e,a)}),YT=F("$ZodBoolean",(e,a)=>{ht.init(e,a),e._zod.pattern=sT,e._zod.parse=(r,s)=>{if(a.coerce)try{r.value=!!r.value}catch{}const o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}}),FT=F("$ZodUnknown",(e,a)=>{ht.init(e,a),e._zod.parse=r=>r}),XT=F("$ZodNever",(e,a)=>{ht.init(e,a),e._zod.parse=(r,s)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function Pb(e,a,r){e.issues.length&&a.issues.push(...As(r,e.issues)),a.value[r]=e.value}const JT=F("$ZodArray",(e,a)=>{ht.init(e,a),e._zod.parse=(r,s)=>{const o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);const c=[];for(let m=0;m<o.length;m++){const h=o[m],g=a.element._zod.run({value:h,issues:[]},s);g instanceof Promise?c.push(g.then(p=>Pb(p,r,m))):Pb(g,r,m)}return c.length?Promise.all(c).then(()=>r):r}});function mc(e,a,r,s,o){if(e.issues.length){if(o&&!(r in s))return;a.issues.push(...As(r,e.issues))}e.value===void 0?r in s&&(a.value[r]=void 0):a.value[r]=e.value}function r1(e){var s,o,c,m;const a=Object.keys(e.shape);for(const h of a)if(!((m=(c=(o=(s=e.shape)==null?void 0:s[h])==null?void 0:o._zod)==null?void 0:c.traits)!=null&&m.has("$ZodType")))throw new Error(`Invalid element at key "${h}": expected a Zod schema`);const r=vz(e.shape);return{...e,keys:a,keySet:new Set(a),numKeys:a.length,optionalKeys:new Set(r)}}function l1(e,a,r,s,o,c){const m=[],h=o.keySet,g=o.catchall._zod,p=g.def.type,b=g.optout==="optional";for(const x in a){if(h.has(x))continue;if(p==="never"){m.push(x);continue}const j=g.run({value:a[x],issues:[]},s);j instanceof Promise?e.push(j.then(N=>mc(N,r,x,a,b))):mc(j,r,x,a,b)}return m.length&&r.issues.push({code:"unrecognized_keys",keys:m,input:a,inst:c}),e.length?Promise.all(e).then(()=>r):r}const WT=F("$ZodObject",(e,a)=>{ht.init(e,a);const r=Object.getOwnPropertyDescriptor(a,"shape");if(!(r!=null&&r.get)){const h=a.shape;Object.defineProperty(a,"shape",{get:()=>{const g={...h};return Object.defineProperty(a,"shape",{value:g}),g}})}const s=kc(()=>r1(a));Fe(e._zod,"propValues",()=>{const h=a.shape,g={};for(const p in h){const b=h[p]._zod;if(b.values){g[p]??(g[p]=new Set);for(const x of b.values)g[p].add(x)}}return g});const o=so,c=a.catchall;let m;e._zod.parse=(h,g)=>{m??(m=s.value);const p=h.value;if(!o(p))return h.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),h;h.value={};const b=[],x=m.shape;for(const j of m.keys){const N=x[j],z=N._zod.optout==="optional",w=N._zod.run({value:p[j],issues:[]},g);w instanceof Promise?b.push(w.then(E=>mc(E,h,j,p,z))):mc(w,h,j,p,z)}return c?l1(b,p,h,g,s.value,e):b.length?Promise.all(b).then(()=>h):h}}),eR=F("$ZodObjectJIT",(e,a)=>{WT.init(e,a);const r=e._zod.parse,s=kc(()=>r1(a)),o=j=>{var D;const N=new ST(["shape","payload","ctx"]),z=s.value,w=O=>{const P=Qb(O);return`shape[${P}]._zod.run({ value: input[${P}], issues: [] }, ctx)`};N.write("const input = payload.value;");const E=Object.create(null);let M=0;for(const O of z.keys)E[O]=`key_${M++}`;N.write("const newResult = {};");for(const O of z.keys){const P=E[O],I=Qb(O),L=j[O],K=((D=L==null?void 0:L._zod)==null?void 0:D.optout)==="optional";N.write(`const ${P} = ${w(O)};`),K?N.write(`
|
|
297
|
+
if (${P}.issues.length) {
|
|
298
|
+
if (${I} in input) {
|
|
299
|
+
payload.issues = payload.issues.concat(${P}.issues.map(iss => ({
|
|
300
|
+
...iss,
|
|
301
|
+
path: iss.path ? [${I}, ...iss.path] : [${I}]
|
|
302
|
+
})));
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
if (${P}.value === undefined) {
|
|
307
|
+
if (${I} in input) {
|
|
308
|
+
newResult[${I}] = undefined;
|
|
309
|
+
}
|
|
310
|
+
} else {
|
|
311
|
+
newResult[${I}] = ${P}.value;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
`):N.write(`
|
|
315
|
+
if (${P}.issues.length) {
|
|
316
|
+
payload.issues = payload.issues.concat(${P}.issues.map(iss => ({
|
|
317
|
+
...iss,
|
|
318
|
+
path: iss.path ? [${I}, ...iss.path] : [${I}]
|
|
319
|
+
})));
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
if (${P}.value === undefined) {
|
|
323
|
+
if (${I} in input) {
|
|
324
|
+
newResult[${I}] = undefined;
|
|
325
|
+
}
|
|
326
|
+
} else {
|
|
327
|
+
newResult[${I}] = ${P}.value;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
`)}N.write("payload.value = newResult;"),N.write("return payload;");const Z=N.compile();return(O,P)=>Z(j,O,P)};let c;const m=so,h=!HS.jitless,p=h&&pz.value,b=a.catchall;let x;e._zod.parse=(j,N)=>{x??(x=s.value);const z=j.value;return m(z)?h&&p&&(N==null?void 0:N.async)===!1&&N.jitless!==!0?(c||(c=o(a.shape)),j=c(j,N),b?l1([],z,j,N,x,e):j):r(j,N):(j.issues.push({expected:"object",code:"invalid_type",input:z,inst:e}),j)}});function Vb(e,a,r,s){for(const c of e)if(c.issues.length===0)return a.value=c.value,a;const o=e.filter(c=>!Cs(c));return o.length===1?(a.value=o[0].value,o[0]):(a.issues.push({code:"invalid_union",input:a.value,inst:r,errors:e.map(c=>c.issues.map(m=>$r(m,s,Lr())))}),a)}const s1=F("$ZodUnion",(e,a)=>{ht.init(e,a),Fe(e._zod,"optin",()=>a.options.some(o=>o._zod.optin==="optional")?"optional":void 0),Fe(e._zod,"optout",()=>a.options.some(o=>o._zod.optout==="optional")?"optional":void 0),Fe(e._zod,"values",()=>{if(a.options.every(o=>o._zod.values))return new Set(a.options.flatMap(o=>Array.from(o._zod.values)))}),Fe(e._zod,"pattern",()=>{if(a.options.every(o=>o._zod.pattern)){const o=a.options.map(c=>c._zod.pattern);return new RegExp(`^(${o.map(c=>Dh(c.source)).join("|")})$`)}});const r=a.options.length===1,s=a.options[0]._zod.run;e._zod.parse=(o,c)=>{if(r)return s(o,c);let m=!1;const h=[];for(const g of a.options){const p=g._zod.run({value:o.value,issues:[]},c);if(p instanceof Promise)h.push(p),m=!0;else{if(p.issues.length===0)return p;h.push(p)}}return m?Promise.all(h).then(g=>Vb(g,o,e,c)):Vb(h,o,e,c)}}),tR=F("$ZodDiscriminatedUnion",(e,a)=>{a.inclusive=!1,s1.init(e,a);const r=e._zod.parse;Fe(e._zod,"propValues",()=>{const o={};for(const c of a.options){const m=c._zod.propValues;if(!m||Object.keys(m).length===0)throw new Error(`Invalid discriminated union option at index "${a.options.indexOf(c)}"`);for(const[h,g]of Object.entries(m)){o[h]||(o[h]=new Set);for(const p of g)o[h].add(p)}}return o});const s=kc(()=>{var m;const o=a.options,c=new Map;for(const h of o){const g=(m=h._zod.propValues)==null?void 0:m[a.discriminator];if(!g||g.size===0)throw new Error(`Invalid discriminated union option at index "${a.options.indexOf(h)}"`);for(const p of g){if(c.has(p))throw new Error(`Duplicate discriminator value "${String(p)}"`);c.set(p,h)}}return c});e._zod.parse=(o,c)=>{const m=o.value;if(!so(m))return o.issues.push({code:"invalid_type",expected:"object",input:m,inst:e}),o;const h=s.value.get(m==null?void 0:m[a.discriminator]);return h?h._zod.run(o,c):a.unionFallback?r(o,c):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:a.discriminator,input:m,path:[a.discriminator],inst:e}),o)}}),nR=F("$ZodIntersection",(e,a)=>{ht.init(e,a),e._zod.parse=(r,s)=>{const o=r.value,c=a.left._zod.run({value:o,issues:[]},s),m=a.right._zod.run({value:o,issues:[]},s);return c instanceof Promise||m instanceof Promise?Promise.all([c,m]).then(([g,p])=>Kb(r,g,p)):Kb(r,c,m)}});function rh(e,a){if(e===a)return{valid:!0,data:e};if(e instanceof Date&&a instanceof Date&&+e==+a)return{valid:!0,data:e};if(Qs(e)&&Qs(a)){const r=Object.keys(a),s=Object.keys(e).filter(c=>r.indexOf(c)!==-1),o={...e,...a};for(const c of s){const m=rh(e[c],a[c]);if(!m.valid)return{valid:!1,mergeErrorPath:[c,...m.mergeErrorPath]};o[c]=m.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(a)){if(e.length!==a.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let s=0;s<e.length;s++){const o=e[s],c=a[s],m=rh(o,c);if(!m.valid)return{valid:!1,mergeErrorPath:[s,...m.mergeErrorPath]};r.push(m.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Kb(e,a,r){const s=new Map;let o;for(const h of a.issues)if(h.code==="unrecognized_keys"){o??(o=h);for(const g of h.keys)s.has(g)||s.set(g,{}),s.get(g).l=!0}else e.issues.push(h);for(const h of r.issues)if(h.code==="unrecognized_keys")for(const g of h.keys)s.has(g)||s.set(g,{}),s.get(g).r=!0;else e.issues.push(h);const c=[...s].filter(([,h])=>h.l&&h.r).map(([h])=>h);if(c.length&&o&&e.issues.push({...o,keys:c}),Cs(e))return e;const m=rh(a.value,r.value);if(!m.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(m.mergeErrorPath)}`);return e.value=m.data,e}const aR=F("$ZodRecord",(e,a)=>{ht.init(e,a),e._zod.parse=(r,s)=>{const o=r.value;if(!Qs(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;const c=[],m=a.keyType._zod.values;if(m){r.value={};const h=new Set;for(const p of m)if(typeof p=="string"||typeof p=="number"||typeof p=="symbol"){h.add(typeof p=="number"?p.toString():p);const b=a.valueType._zod.run({value:o[p],issues:[]},s);b instanceof Promise?c.push(b.then(x=>{x.issues.length&&r.issues.push(...As(p,x.issues)),r.value[p]=x.value})):(b.issues.length&&r.issues.push(...As(p,b.issues)),r.value[p]=b.value)}let g;for(const p in o)h.has(p)||(g=g??[],g.push(p));g&&g.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:g})}else{r.value={};for(const h of Reflect.ownKeys(o)){if(h==="__proto__")continue;let g=a.keyType._zod.run({value:h,issues:[]},s);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof h=="string"&&JS.test(h)&&g.issues.length){const x=a.keyType._zod.run({value:Number(h),issues:[]},s);if(x instanceof Promise)throw new Error("Async schemas not supported in object keys currently");x.issues.length===0&&(g=x)}if(g.issues.length){a.mode==="loose"?r.value[h]=o[h]:r.issues.push({code:"invalid_key",origin:"record",issues:g.issues.map(x=>$r(x,s,Lr())),input:h,path:[h],inst:e});continue}const b=a.valueType._zod.run({value:o[h],issues:[]},s);b instanceof Promise?c.push(b.then(x=>{x.issues.length&&r.issues.push(...As(h,x.issues)),r.value[g.value]=x.value})):(b.issues.length&&r.issues.push(...As(h,b.issues)),r.value[g.value]=b.value)}}return c.length?Promise.all(c).then(()=>r):r}}),rR=F("$ZodEnum",(e,a)=>{ht.init(e,a);const r=IS(a.entries),s=new Set(r);e._zod.values=s,e._zod.pattern=new RegExp(`^(${r.filter(o=>gz.has(typeof o)).map(o=>typeof o=="string"?Gs(o):o.toString()).join("|")})$`),e._zod.parse=(o,c)=>{const m=o.value;return s.has(m)||o.issues.push({code:"invalid_value",values:r,input:m,inst:e}),o}}),lR=F("$ZodLiteral",(e,a)=>{if(ht.init(e,a),a.values.length===0)throw new Error("Cannot create literal schema with no valid values");const r=new Set(a.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${a.values.map(s=>typeof s=="string"?Gs(s):s?Gs(s.toString()):String(s)).join("|")})$`),e._zod.parse=(s,o)=>{const c=s.value;return r.has(c)||s.issues.push({code:"invalid_value",values:a.values,input:c,inst:e}),s}}),sR=F("$ZodTransform",(e,a)=>{ht.init(e,a),e._zod.parse=(r,s)=>{if(s.direction==="backward")throw new qS(e.constructor.name);const o=a.transform(r.value,r);if(s.async)return(o instanceof Promise?o:Promise.resolve(o)).then(m=>(r.value=m,r));if(o instanceof Promise)throw new Ts;return r.value=o,r}});function Yb(e,a){return e.issues.length&&a===void 0?{issues:[],value:void 0}:e}const i1=F("$ZodOptional",(e,a)=>{ht.init(e,a),e._zod.optin="optional",e._zod.optout="optional",Fe(e._zod,"values",()=>a.innerType._zod.values?new Set([...a.innerType._zod.values,void 0]):void 0),Fe(e._zod,"pattern",()=>{const r=a.innerType._zod.pattern;return r?new RegExp(`^(${Dh(r.source)})?$`):void 0}),e._zod.parse=(r,s)=>{if(a.innerType._zod.optin==="optional"){const o=a.innerType._zod.run(r,s);return o instanceof Promise?o.then(c=>Yb(c,r.value)):Yb(o,r.value)}return r.value===void 0?r:a.innerType._zod.run(r,s)}}),iR=F("$ZodExactOptional",(e,a)=>{i1.init(e,a),Fe(e._zod,"values",()=>a.innerType._zod.values),Fe(e._zod,"pattern",()=>a.innerType._zod.pattern),e._zod.parse=(r,s)=>a.innerType._zod.run(r,s)}),oR=F("$ZodNullable",(e,a)=>{ht.init(e,a),Fe(e._zod,"optin",()=>a.innerType._zod.optin),Fe(e._zod,"optout",()=>a.innerType._zod.optout),Fe(e._zod,"pattern",()=>{const r=a.innerType._zod.pattern;return r?new RegExp(`^(${Dh(r.source)}|null)$`):void 0}),Fe(e._zod,"values",()=>a.innerType._zod.values?new Set([...a.innerType._zod.values,null]):void 0),e._zod.parse=(r,s)=>r.value===null?r:a.innerType._zod.run(r,s)}),uR=F("$ZodDefault",(e,a)=>{ht.init(e,a),e._zod.optin="optional",Fe(e._zod,"values",()=>a.innerType._zod.values),e._zod.parse=(r,s)=>{if(s.direction==="backward")return a.innerType._zod.run(r,s);if(r.value===void 0)return r.value=a.defaultValue,r;const o=a.innerType._zod.run(r,s);return o instanceof Promise?o.then(c=>Fb(c,a)):Fb(o,a)}});function Fb(e,a){return e.value===void 0&&(e.value=a.defaultValue),e}const cR=F("$ZodPrefault",(e,a)=>{ht.init(e,a),e._zod.optin="optional",Fe(e._zod,"values",()=>a.innerType._zod.values),e._zod.parse=(r,s)=>(s.direction==="backward"||r.value===void 0&&(r.value=a.defaultValue),a.innerType._zod.run(r,s))}),dR=F("$ZodNonOptional",(e,a)=>{ht.init(e,a),Fe(e._zod,"values",()=>{const r=a.innerType._zod.values;return r?new Set([...r].filter(s=>s!==void 0)):void 0}),e._zod.parse=(r,s)=>{const o=a.innerType._zod.run(r,s);return o instanceof Promise?o.then(c=>Xb(c,e)):Xb(o,e)}});function Xb(e,a){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:a}),e}const fR=F("$ZodCatch",(e,a)=>{ht.init(e,a),Fe(e._zod,"optin",()=>a.innerType._zod.optin),Fe(e._zod,"optout",()=>a.innerType._zod.optout),Fe(e._zod,"values",()=>a.innerType._zod.values),e._zod.parse=(r,s)=>{if(s.direction==="backward")return a.innerType._zod.run(r,s);const o=a.innerType._zod.run(r,s);return o instanceof Promise?o.then(c=>(r.value=c.value,c.issues.length&&(r.value=a.catchValue({...r,error:{issues:c.issues.map(m=>$r(m,s,Lr()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=a.catchValue({...r,error:{issues:o.issues.map(c=>$r(c,s,Lr()))},input:r.value}),r.issues=[]),r)}}),mR=F("$ZodPipe",(e,a)=>{ht.init(e,a),Fe(e._zod,"values",()=>a.in._zod.values),Fe(e._zod,"optin",()=>a.in._zod.optin),Fe(e._zod,"optout",()=>a.out._zod.optout),Fe(e._zod,"propValues",()=>a.in._zod.propValues),e._zod.parse=(r,s)=>{if(s.direction==="backward"){const c=a.out._zod.run(r,s);return c instanceof Promise?c.then(m=>Ju(m,a.in,s)):Ju(c,a.in,s)}const o=a.in._zod.run(r,s);return o instanceof Promise?o.then(c=>Ju(c,a.out,s)):Ju(o,a.out,s)}});function Ju(e,a,r){return e.issues.length?(e.aborted=!0,e):a._zod.run({value:e.value,issues:e.issues},r)}const hR=F("$ZodReadonly",(e,a)=>{ht.init(e,a),Fe(e._zod,"propValues",()=>a.innerType._zod.propValues),Fe(e._zod,"values",()=>a.innerType._zod.values),Fe(e._zod,"optin",()=>{var r,s;return(s=(r=a.innerType)==null?void 0:r._zod)==null?void 0:s.optin}),Fe(e._zod,"optout",()=>{var r,s;return(s=(r=a.innerType)==null?void 0:r._zod)==null?void 0:s.optout}),e._zod.parse=(r,s)=>{if(s.direction==="backward")return a.innerType._zod.run(r,s);const o=a.innerType._zod.run(r,s);return o instanceof Promise?o.then(Jb):Jb(o)}});function Jb(e){return e.value=Object.freeze(e.value),e}const pR=F("$ZodCustom",(e,a)=>{dn.init(e,a),ht.init(e,a),e._zod.parse=(r,s)=>r,e._zod.check=r=>{const s=r.value,o=a.fn(s);if(o instanceof Promise)return o.then(c=>Wb(c,r,s,e));Wb(o,r,s,e)}});function Wb(e,a,r,s){if(!e){const o={code:"custom",input:r,inst:s,path:[...s._zod.def.path??[]],continue:!s._zod.def.abort};s._zod.def.params&&(o.params=s._zod.def.params),a.issues.push(io(o))}}var ex;class gR{constructor(){this._map=new WeakMap,this._idmap=new Map}add(a,...r){const s=r[0];return this._map.set(a,s),s&&typeof s=="object"&&"id"in s&&this._idmap.set(s.id,a),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(a){const r=this._map.get(a);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(a),this}get(a){const r=a._zod.parent;if(r){const s={...this.get(r)??{}};delete s.id;const o={...s,...this._map.get(a)};return Object.keys(o).length?o:void 0}return this._map.get(a)}has(a){return this._map.has(a)}}function vR(){return new gR}(ex=globalThis).__zod_globalRegistry??(ex.__zod_globalRegistry=vR());const Xi=globalThis.__zod_globalRegistry;function yR(e,a){return new e({type:"string",...ge(a)})}function bR(e,a){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ge(a)})}function tx(e,a){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ge(a)})}function xR(e,a){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ge(a)})}function SR(e,a){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ge(a)})}function jR(e,a){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ge(a)})}function wR(e,a){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ge(a)})}function NR(e,a){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ge(a)})}function ER(e,a){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ge(a)})}function _R(e,a){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ge(a)})}function CR(e,a){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ge(a)})}function AR(e,a){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ge(a)})}function kR(e,a){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ge(a)})}function zR(e,a){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ge(a)})}function TR(e,a){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ge(a)})}function RR(e,a){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ge(a)})}function OR(e,a){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ge(a)})}function MR(e,a){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ge(a)})}function DR(e,a){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ge(a)})}function UR(e,a){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ge(a)})}function LR(e,a){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ge(a)})}function $R(e,a){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ge(a)})}function BR(e,a){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ge(a)})}function ZR(e,a){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ge(a)})}function qR(e,a){return new e({type:"string",format:"date",check:"string_format",...ge(a)})}function HR(e,a){return new e({type:"string",format:"time",check:"string_format",precision:null,...ge(a)})}function IR(e,a){return new e({type:"string",format:"duration",check:"string_format",...ge(a)})}function QR(e,a){return new e({type:"number",checks:[],...ge(a)})}function GR(e,a){return new e({type:"number",coerce:!0,checks:[],...ge(a)})}function PR(e,a){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ge(a)})}function VR(e,a){return new e({type:"boolean",...ge(a)})}function KR(e){return new e({type:"unknown"})}function YR(e,a){return new e({type:"never",...ge(a)})}function nx(e,a){return new e1({check:"less_than",...ge(a),value:e,inclusive:!1})}function Sm(e,a){return new e1({check:"less_than",...ge(a),value:e,inclusive:!0})}function ax(e,a){return new t1({check:"greater_than",...ge(a),value:e,inclusive:!1})}function jm(e,a){return new t1({check:"greater_than",...ge(a),value:e,inclusive:!0})}function rx(e,a){return new uT({check:"multiple_of",...ge(a),value:e})}function o1(e,a){return new dT({check:"max_length",...ge(a),maximum:e})}function hc(e,a){return new fT({check:"min_length",...ge(a),minimum:e})}function u1(e,a){return new mT({check:"length_equals",...ge(a),length:e})}function FR(e,a){return new hT({check:"string_format",format:"regex",...ge(a),pattern:e})}function XR(e){return new pT({check:"string_format",format:"lowercase",...ge(e)})}function JR(e){return new gT({check:"string_format",format:"uppercase",...ge(e)})}function WR(e,a){return new vT({check:"string_format",format:"includes",...ge(a),includes:e})}function eO(e,a){return new yT({check:"string_format",format:"starts_with",...ge(a),prefix:e})}function tO(e,a){return new bT({check:"string_format",format:"ends_with",...ge(a),suffix:e})}function Ws(e){return new xT({check:"overwrite",tx:e})}function nO(e){return Ws(a=>a.normalize(e))}function aO(){return Ws(e=>e.trim())}function rO(){return Ws(e=>e.toLowerCase())}function lO(){return Ws(e=>e.toUpperCase())}function sO(){return Ws(e=>hz(e))}function iO(e,a,r){return new e({type:"array",element:a,...ge(r)})}function oO(e,a,r){return new e({type:"custom",check:"custom",fn:a,...ge(r)})}function uO(e){const a=cO(r=>(r.addIssue=s=>{if(typeof s=="string")r.issues.push(io(s,r.value,a._zod.def));else{const o=s;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=a),o.continue??(o.continue=!a._zod.def.abort),r.issues.push(io(o))}},e(r.value,r)));return a}function cO(e,a){const r=new dn({check:"custom",...ge(a)});return r._zod.check=e,r}function c1(e){let a=(e==null?void 0:e.target)??"draft-2020-12";return a==="draft-4"&&(a="draft-04"),a==="draft-7"&&(a="draft-07"),{processors:e.processors??{},metadataRegistry:(e==null?void 0:e.metadata)??Xi,target:a,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 Ct(e,a,r={path:[],schemaPath:[]}){var b,x;var s;const o=e._zod.def,c=a.seen.get(e);if(c)return c.count++,r.schemaPath.includes(e)&&(c.cycle=r.path),c.schema;const m={schema:{},count:1,cycle:void 0,path:r.path};a.seen.set(e,m);const h=(x=(b=e._zod).toJSONSchema)==null?void 0:x.call(b);if(h)m.schema=h;else{const j={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(a,m.schema,j);else{const z=m.schema,w=a.processors[o.type];if(!w)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);w(e,a,z,j)}const N=e._zod.parent;N&&(m.ref||(m.ref=N),Ct(N,a,j),a.seen.get(N).isParent=!0)}const g=a.metadataRegistry.get(e);return g&&Object.assign(m.schema,g),a.io==="input"&&Ft(e)&&(delete m.schema.examples,delete m.schema.default),a.io==="input"&&m.schema._prefault&&((s=m.schema).default??(s.default=m.schema._prefault)),delete m.schema._prefault,a.seen.get(e).schema}function d1(e,a){var m,h,g,p;const r=e.seen.get(a);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const s=new Map;for(const b of e.seen.entries()){const x=(m=e.metadataRegistry.get(b[0]))==null?void 0:m.id;if(x){const j=s.get(x);if(j&&j!==b[0])throw new Error(`Duplicate schema id "${x}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);s.set(x,b[0])}}const o=b=>{var w;const x=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const E=(w=e.external.registry.get(b[0]))==null?void 0:w.id,M=e.external.uri??(D=>D);if(E)return{ref:M(E)};const Z=b[1].defId??b[1].schema.id??`schema${e.counter++}`;return b[1].defId=Z,{defId:Z,ref:`${M("__shared")}#/${x}/${Z}`}}if(b[1]===r)return{ref:"#"};const N=`#/${x}/`,z=b[1].schema.id??`__schema${e.counter++}`;return{defId:z,ref:N+z}},c=b=>{if(b[1].schema.$ref)return;const x=b[1],{ref:j,defId:N}=o(b);x.def={...x.schema},N&&(x.defId=N);const z=x.schema;for(const w in z)delete z[w];z.$ref=j};if(e.cycles==="throw")for(const b of e.seen.entries()){const x=b[1];if(x.cycle)throw new Error(`Cycle detected: #/${(h=x.cycle)==null?void 0:h.join("/")}/<root>
|
|
331
|
+
|
|
332
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const b of e.seen.entries()){const x=b[1];if(a===b[0]){c(b);continue}if(e.external){const N=(g=e.external.registry.get(b[0]))==null?void 0:g.id;if(a!==b[0]&&N){c(b);continue}}if((p=e.metadataRegistry.get(b[0]))==null?void 0:p.id){c(b);continue}if(x.cycle){c(b);continue}if(x.count>1&&e.reused==="ref"){c(b);continue}}}function f1(e,a){var m,h,g;const r=e.seen.get(a);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const s=p=>{const b=e.seen.get(p);if(b.ref===null)return;const x=b.def??b.schema,j={...x},N=b.ref;if(b.ref=null,N){s(N);const w=e.seen.get(N),E=w.schema;if(E.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(x.allOf=x.allOf??[],x.allOf.push(E)):Object.assign(x,E),Object.assign(x,j),p._zod.parent===N)for(const Z in x)Z==="$ref"||Z==="allOf"||Z in j||delete x[Z];if(E.$ref&&w.def)for(const Z in x)Z==="$ref"||Z==="allOf"||Z in w.def&&JSON.stringify(x[Z])===JSON.stringify(w.def[Z])&&delete x[Z]}const z=p._zod.parent;if(z&&z!==N){s(z);const w=e.seen.get(z);if(w!=null&&w.schema.$ref&&(x.$ref=w.schema.$ref,w.def))for(const E in x)E==="$ref"||E==="allOf"||E in w.def&&JSON.stringify(x[E])===JSON.stringify(w.def[E])&&delete x[E]}e.override({zodSchema:p,jsonSchema:x,path:b.path??[]})};for(const p of[...e.seen.entries()].reverse())s(p[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,(m=e.external)!=null&&m.uri){const p=(h=e.external.registry.get(a))==null?void 0:h.id;if(!p)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(p)}Object.assign(o,r.def??r.schema);const c=((g=e.external)==null?void 0:g.defs)??{};for(const p of e.seen.entries()){const b=p[1];b.def&&b.defId&&(c[b.defId]=b.def)}e.external||Object.keys(c).length>0&&(e.target==="draft-2020-12"?o.$defs=c:o.definitions=c);try{const p=JSON.parse(JSON.stringify(o));return Object.defineProperty(p,"~standard",{value:{...a["~standard"],jsonSchema:{input:pc(a,"input",e.processors),output:pc(a,"output",e.processors)}},enumerable:!1,writable:!1}),p}catch{throw new Error("Error converting schema to JSON.")}}function Ft(e,a){const r=a??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const s=e._zod.def;if(s.type==="transform")return!0;if(s.type==="array")return Ft(s.element,r);if(s.type==="set")return Ft(s.valueType,r);if(s.type==="lazy")return Ft(s.getter(),r);if(s.type==="promise"||s.type==="optional"||s.type==="nonoptional"||s.type==="nullable"||s.type==="readonly"||s.type==="default"||s.type==="prefault")return Ft(s.innerType,r);if(s.type==="intersection")return Ft(s.left,r)||Ft(s.right,r);if(s.type==="record"||s.type==="map")return Ft(s.keyType,r)||Ft(s.valueType,r);if(s.type==="pipe")return Ft(s.in,r)||Ft(s.out,r);if(s.type==="object"){for(const o in s.shape)if(Ft(s.shape[o],r))return!0;return!1}if(s.type==="union"){for(const o of s.options)if(Ft(o,r))return!0;return!1}if(s.type==="tuple"){for(const o of s.items)if(Ft(o,r))return!0;return!!(s.rest&&Ft(s.rest,r))}return!1}const dO=(e,a={})=>r=>{const s=c1({...r,processors:a});return Ct(e,s),d1(s,e),f1(s,e)},pc=(e,a,r={})=>s=>{const{libraryOptions:o,target:c}=s??{},m=c1({...o??{},target:c,io:a,processors:r});return Ct(e,m),d1(m,e),f1(m,e)},fO={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},mO=(e,a,r,s)=>{const o=r;o.type="string";const{minimum:c,maximum:m,format:h,patterns:g,contentEncoding:p}=e._zod.bag;if(typeof c=="number"&&(o.minLength=c),typeof m=="number"&&(o.maxLength=m),h&&(o.format=fO[h]??h,o.format===""&&delete o.format,h==="time"&&delete o.format),p&&(o.contentEncoding=p),g&&g.size>0){const b=[...g];b.length===1?o.pattern=b[0].source:b.length>1&&(o.allOf=[...b.map(x=>({...a.target==="draft-07"||a.target==="draft-04"||a.target==="openapi-3.0"?{type:"string"}:{},pattern:x.source}))])}},hO=(e,a,r,s)=>{const o=r,{minimum:c,maximum:m,format:h,multipleOf:g,exclusiveMaximum:p,exclusiveMinimum:b}=e._zod.bag;typeof h=="string"&&h.includes("int")?o.type="integer":o.type="number",typeof b=="number"&&(a.target==="draft-04"||a.target==="openapi-3.0"?(o.minimum=b,o.exclusiveMinimum=!0):o.exclusiveMinimum=b),typeof c=="number"&&(o.minimum=c,typeof b=="number"&&a.target!=="draft-04"&&(b>=c?delete o.minimum:delete o.exclusiveMinimum)),typeof p=="number"&&(a.target==="draft-04"||a.target==="openapi-3.0"?(o.maximum=p,o.exclusiveMaximum=!0):o.exclusiveMaximum=p),typeof m=="number"&&(o.maximum=m,typeof p=="number"&&a.target!=="draft-04"&&(p<=m?delete o.maximum:delete o.exclusiveMaximum)),typeof g=="number"&&(o.multipleOf=g)},pO=(e,a,r,s)=>{r.type="boolean"},gO=(e,a,r,s)=>{r.not={}},vO=(e,a,r,s)=>{},yO=(e,a,r,s)=>{const o=e._zod.def,c=IS(o.entries);c.every(m=>typeof m=="number")&&(r.type="number"),c.every(m=>typeof m=="string")&&(r.type="string"),r.enum=c},bO=(e,a,r,s)=>{const o=e._zod.def,c=[];for(const m of o.values)if(m===void 0){if(a.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof m=="bigint"){if(a.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");c.push(Number(m))}else c.push(m);if(c.length!==0)if(c.length===1){const m=c[0];r.type=m===null?"null":typeof m,a.target==="draft-04"||a.target==="openapi-3.0"?r.enum=[m]:r.const=m}else c.every(m=>typeof m=="number")&&(r.type="number"),c.every(m=>typeof m=="string")&&(r.type="string"),c.every(m=>typeof m=="boolean")&&(r.type="boolean"),c.every(m=>m===null)&&(r.type="null"),r.enum=c},xO=(e,a,r,s)=>{if(a.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},SO=(e,a,r,s)=>{if(a.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},jO=(e,a,r,s)=>{const o=r,c=e._zod.def,{minimum:m,maximum:h}=e._zod.bag;typeof m=="number"&&(o.minItems=m),typeof h=="number"&&(o.maxItems=h),o.type="array",o.items=Ct(c.element,a,{...s,path:[...s.path,"items"]})},wO=(e,a,r,s)=>{var p;const o=r,c=e._zod.def;o.type="object",o.properties={};const m=c.shape;for(const b in m)o.properties[b]=Ct(m[b],a,{...s,path:[...s.path,"properties",b]});const h=new Set(Object.keys(m)),g=new Set([...h].filter(b=>{const x=c.shape[b]._zod;return a.io==="input"?x.optin===void 0:x.optout===void 0}));g.size>0&&(o.required=Array.from(g)),((p=c.catchall)==null?void 0:p._zod.def.type)==="never"?o.additionalProperties=!1:c.catchall?c.catchall&&(o.additionalProperties=Ct(c.catchall,a,{...s,path:[...s.path,"additionalProperties"]})):a.io==="output"&&(o.additionalProperties=!1)},NO=(e,a,r,s)=>{const o=e._zod.def,c=o.inclusive===!1,m=o.options.map((h,g)=>Ct(h,a,{...s,path:[...s.path,c?"oneOf":"anyOf",g]}));c?r.oneOf=m:r.anyOf=m},EO=(e,a,r,s)=>{const o=e._zod.def,c=Ct(o.left,a,{...s,path:[...s.path,"allOf",0]}),m=Ct(o.right,a,{...s,path:[...s.path,"allOf",1]}),h=p=>"allOf"in p&&Object.keys(p).length===1,g=[...h(c)?c.allOf:[c],...h(m)?m.allOf:[m]];r.allOf=g},_O=(e,a,r,s)=>{const o=r,c=e._zod.def;o.type="object";const m=c.keyType,h=m._zod.bag,g=h==null?void 0:h.patterns;if(c.mode==="loose"&&g&&g.size>0){const b=Ct(c.valueType,a,{...s,path:[...s.path,"patternProperties","*"]});o.patternProperties={};for(const x of g)o.patternProperties[x.source]=b}else(a.target==="draft-07"||a.target==="draft-2020-12")&&(o.propertyNames=Ct(c.keyType,a,{...s,path:[...s.path,"propertyNames"]})),o.additionalProperties=Ct(c.valueType,a,{...s,path:[...s.path,"additionalProperties"]});const p=m._zod.values;if(p){const b=[...p].filter(x=>typeof x=="string"||typeof x=="number");b.length>0&&(o.required=b)}},CO=(e,a,r,s)=>{const o=e._zod.def,c=Ct(o.innerType,a,s),m=a.seen.get(e);a.target==="openapi-3.0"?(m.ref=o.innerType,r.nullable=!0):r.anyOf=[c,{type:"null"}]},AO=(e,a,r,s)=>{const o=e._zod.def;Ct(o.innerType,a,s);const c=a.seen.get(e);c.ref=o.innerType},kO=(e,a,r,s)=>{const o=e._zod.def;Ct(o.innerType,a,s);const c=a.seen.get(e);c.ref=o.innerType,r.default=JSON.parse(JSON.stringify(o.defaultValue))},zO=(e,a,r,s)=>{const o=e._zod.def;Ct(o.innerType,a,s);const c=a.seen.get(e);c.ref=o.innerType,a.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},TO=(e,a,r,s)=>{const o=e._zod.def;Ct(o.innerType,a,s);const c=a.seen.get(e);c.ref=o.innerType;let m;try{m=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=m},RO=(e,a,r,s)=>{const o=e._zod.def,c=a.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;Ct(c,a,s);const m=a.seen.get(e);m.ref=c},OO=(e,a,r,s)=>{const o=e._zod.def;Ct(o.innerType,a,s);const c=a.seen.get(e);c.ref=o.innerType,r.readOnly=!0},m1=(e,a,r,s)=>{const o=e._zod.def;Ct(o.innerType,a,s);const c=a.seen.get(e);c.ref=o.innerType},MO=F("ZodISODateTime",(e,a)=>{MT.init(e,a),gt.init(e,a)});function DO(e){return ZR(MO,e)}const UO=F("ZodISODate",(e,a)=>{DT.init(e,a),gt.init(e,a)});function LO(e){return qR(UO,e)}const $O=F("ZodISOTime",(e,a)=>{UT.init(e,a),gt.init(e,a)});function BO(e){return HR($O,e)}const ZO=F("ZodISODuration",(e,a)=>{LT.init(e,a),gt.init(e,a)});function qO(e){return IR(ZO,e)}const HO=(e,a)=>{VS.init(e,a),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>Cz(e,r)},flatten:{value:r=>_z(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,ah,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,ah,2)}},isEmpty:{get(){return e.issues.length===0}}})},In=F("ZodError",HO,{Parent:Error}),IO=Lh(In),QO=$h(In),GO=zc(In),PO=Tc(In),VO=zz(In),KO=Tz(In),YO=Rz(In),FO=Oz(In),XO=Mz(In),JO=Dz(In),WO=Uz(In),e4=Lz(In),pt=F("ZodType",(e,a)=>(ht.init(e,a),Object.assign(e["~standard"],{jsonSchema:{input:pc(e,"input"),output:pc(e,"output")}}),e.toJSONSchema=dO(e,{}),e.def=a,e.type=a.type,Object.defineProperty(e,"_def",{value:a}),e.check=(...r)=>e.clone(qr(a,{checks:[...a.checks??[],...r.map(s=>typeof s=="function"?{_zod:{check:s,def:{check:"custom"},onattach:[]}}:s)]}),{parent:!0}),e.with=e.check,e.clone=(r,s)=>Hr(e,r,s),e.brand=()=>e,e.register=((r,s)=>(r.add(e,s),e)),e.parse=(r,s)=>IO(e,r,s,{callee:e.parse}),e.safeParse=(r,s)=>GO(e,r,s),e.parseAsync=async(r,s)=>QO(e,r,s,{callee:e.parseAsync}),e.safeParseAsync=async(r,s)=>PO(e,r,s),e.spa=e.safeParseAsync,e.encode=(r,s)=>VO(e,r,s),e.decode=(r,s)=>KO(e,r,s),e.encodeAsync=async(r,s)=>YO(e,r,s),e.decodeAsync=async(r,s)=>FO(e,r,s),e.safeEncode=(r,s)=>XO(e,r,s),e.safeDecode=(r,s)=>JO(e,r,s),e.safeEncodeAsync=async(r,s)=>WO(e,r,s),e.safeDecodeAsync=async(r,s)=>e4(e,r,s),e.refine=(r,s)=>e.check(V4(r,s)),e.superRefine=r=>e.check(K4(r)),e.overwrite=r=>e.check(Ws(r)),e.optional=()=>ix(e),e.exactOptional=()=>M4(e),e.nullable=()=>ox(e),e.nullish=()=>ix(ox(e)),e.nonoptional=r=>Z4(e,r),e.array=()=>Yn(e),e.or=r=>g1([e,r]),e.and=r=>A4(e,r),e.transform=r=>ux(e,R4(r)),e.default=r=>L4(e,r),e.prefault=r=>B4(e,r),e.catch=r=>H4(e,r),e.pipe=r=>ux(e,r),e.readonly=()=>G4(e),e.describe=r=>{const s=e.clone();return Xi.add(s,{description:r}),s},Object.defineProperty(e,"description",{get(){var r;return(r=Xi.get(e))==null?void 0:r.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return Xi.get(e);const s=e.clone();return Xi.add(s,r[0]),s},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=r=>r(e),e)),h1=F("_ZodString",(e,a)=>{Bh.init(e,a),pt.init(e,a),e._zod.processJSONSchema=(s,o,c)=>mO(e,s,o);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...s)=>e.check(FR(...s)),e.includes=(...s)=>e.check(WR(...s)),e.startsWith=(...s)=>e.check(eO(...s)),e.endsWith=(...s)=>e.check(tO(...s)),e.min=(...s)=>e.check(hc(...s)),e.max=(...s)=>e.check(o1(...s)),e.length=(...s)=>e.check(u1(...s)),e.nonempty=(...s)=>e.check(hc(1,...s)),e.lowercase=s=>e.check(XR(s)),e.uppercase=s=>e.check(JR(s)),e.trim=()=>e.check(aO()),e.normalize=(...s)=>e.check(nO(...s)),e.toLowerCase=()=>e.check(rO()),e.toUpperCase=()=>e.check(lO()),e.slugify=()=>e.check(sO())}),t4=F("ZodString",(e,a)=>{Bh.init(e,a),h1.init(e,a),e.email=r=>e.check(bR(n4,r)),e.url=r=>e.check(NR(a4,r)),e.jwt=r=>e.check(BR(y4,r)),e.emoji=r=>e.check(ER(r4,r)),e.guid=r=>e.check(tx(lx,r)),e.uuid=r=>e.check(xR(Wu,r)),e.uuidv4=r=>e.check(SR(Wu,r)),e.uuidv6=r=>e.check(jR(Wu,r)),e.uuidv7=r=>e.check(wR(Wu,r)),e.nanoid=r=>e.check(_R(l4,r)),e.guid=r=>e.check(tx(lx,r)),e.cuid=r=>e.check(CR(s4,r)),e.cuid2=r=>e.check(AR(i4,r)),e.ulid=r=>e.check(kR(o4,r)),e.base64=r=>e.check(UR(p4,r)),e.base64url=r=>e.check(LR(g4,r)),e.xid=r=>e.check(zR(u4,r)),e.ksuid=r=>e.check(TR(c4,r)),e.ipv4=r=>e.check(RR(d4,r)),e.ipv6=r=>e.check(OR(f4,r)),e.cidrv4=r=>e.check(MR(m4,r)),e.cidrv6=r=>e.check(DR(h4,r)),e.e164=r=>e.check($R(v4,r)),e.datetime=r=>e.check(DO(r)),e.date=r=>e.check(LO(r)),e.time=r=>e.check(BO(r)),e.duration=r=>e.check(qO(r))});function _(e){return yR(t4,e)}const gt=F("ZodStringFormat",(e,a)=>{mt.init(e,a),h1.init(e,a)}),n4=F("ZodEmail",(e,a)=>{ET.init(e,a),gt.init(e,a)}),lx=F("ZodGUID",(e,a)=>{wT.init(e,a),gt.init(e,a)}),Wu=F("ZodUUID",(e,a)=>{NT.init(e,a),gt.init(e,a)}),a4=F("ZodURL",(e,a)=>{_T.init(e,a),gt.init(e,a)}),r4=F("ZodEmoji",(e,a)=>{CT.init(e,a),gt.init(e,a)}),l4=F("ZodNanoID",(e,a)=>{AT.init(e,a),gt.init(e,a)}),s4=F("ZodCUID",(e,a)=>{kT.init(e,a),gt.init(e,a)}),i4=F("ZodCUID2",(e,a)=>{zT.init(e,a),gt.init(e,a)}),o4=F("ZodULID",(e,a)=>{TT.init(e,a),gt.init(e,a)}),u4=F("ZodXID",(e,a)=>{RT.init(e,a),gt.init(e,a)}),c4=F("ZodKSUID",(e,a)=>{OT.init(e,a),gt.init(e,a)}),d4=F("ZodIPv4",(e,a)=>{$T.init(e,a),gt.init(e,a)}),f4=F("ZodIPv6",(e,a)=>{BT.init(e,a),gt.init(e,a)}),m4=F("ZodCIDRv4",(e,a)=>{ZT.init(e,a),gt.init(e,a)}),h4=F("ZodCIDRv6",(e,a)=>{qT.init(e,a),gt.init(e,a)}),p4=F("ZodBase64",(e,a)=>{HT.init(e,a),gt.init(e,a)}),g4=F("ZodBase64URL",(e,a)=>{QT.init(e,a),gt.init(e,a)}),v4=F("ZodE164",(e,a)=>{GT.init(e,a),gt.init(e,a)}),y4=F("ZodJWT",(e,a)=>{VT.init(e,a),gt.init(e,a)}),Zh=F("ZodNumber",(e,a)=>{a1.init(e,a),pt.init(e,a),e._zod.processJSONSchema=(s,o,c)=>hO(e,s,o),e.gt=(s,o)=>e.check(ax(s,o)),e.gte=(s,o)=>e.check(jm(s,o)),e.min=(s,o)=>e.check(jm(s,o)),e.lt=(s,o)=>e.check(nx(s,o)),e.lte=(s,o)=>e.check(Sm(s,o)),e.max=(s,o)=>e.check(Sm(s,o)),e.int=s=>e.check(sx(s)),e.safe=s=>e.check(sx(s)),e.positive=s=>e.check(ax(0,s)),e.nonnegative=s=>e.check(jm(0,s)),e.negative=s=>e.check(nx(0,s)),e.nonpositive=s=>e.check(Sm(0,s)),e.multipleOf=(s,o)=>e.check(rx(s,o)),e.step=(s,o)=>e.check(rx(s,o)),e.finite=()=>e;const r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function Qe(e){return QR(Zh,e)}const b4=F("ZodNumberFormat",(e,a)=>{KT.init(e,a),Zh.init(e,a)});function sx(e){return PR(b4,e)}const x4=F("ZodBoolean",(e,a)=>{YT.init(e,a),pt.init(e,a),e._zod.processJSONSchema=(r,s,o)=>pO(e,r,s)});function xo(e){return VR(x4,e)}const S4=F("ZodUnknown",(e,a)=>{FT.init(e,a),pt.init(e,a),e._zod.processJSONSchema=(r,s,o)=>vO()});function it(){return KR(S4)}const j4=F("ZodNever",(e,a)=>{XT.init(e,a),pt.init(e,a),e._zod.processJSONSchema=(r,s,o)=>gO(e,r,s)});function w4(e){return YR(j4,e)}const N4=F("ZodArray",(e,a)=>{JT.init(e,a),pt.init(e,a),e._zod.processJSONSchema=(r,s,o)=>jO(e,r,s,o),e.element=a.element,e.min=(r,s)=>e.check(hc(r,s)),e.nonempty=r=>e.check(hc(1,r)),e.max=(r,s)=>e.check(o1(r,s)),e.length=(r,s)=>e.check(u1(r,s)),e.unwrap=()=>e.element});function Yn(e,a){return iO(N4,e,a)}const E4=F("ZodObject",(e,a)=>{eR.init(e,a),pt.init(e,a),e._zod.processJSONSchema=(r,s,o)=>wO(e,r,s,o),Fe(e,"shape",()=>a.shape),e.keyof=()=>Ve(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:it()}),e.loose=()=>e.clone({...e._zod.def,catchall:it()}),e.strict=()=>e.clone({...e._zod.def,catchall:w4()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>Sz(e,r),e.safeExtend=r=>jz(e,r),e.merge=r=>wz(e,r),e.pick=r=>bz(e,r),e.omit=r=>xz(e,r),e.partial=(...r)=>Nz(y1,e,r[0]),e.required=(...r)=>Ez(b1,e,r[0])});function le(e,a){const r={type:"object",shape:e??{},...ge(a)};return new E4(r)}const p1=F("ZodUnion",(e,a)=>{s1.init(e,a),pt.init(e,a),e._zod.processJSONSchema=(r,s,o)=>NO(e,r,s,o),e.options=a.options});function g1(e,a){return new p1({type:"union",options:e,...ge(a)})}const _4=F("ZodDiscriminatedUnion",(e,a)=>{p1.init(e,a),tR.init(e,a)});function v1(e,a,r){return new _4({type:"union",options:a,discriminator:e,...ge(r)})}const C4=F("ZodIntersection",(e,a)=>{nR.init(e,a),pt.init(e,a),e._zod.processJSONSchema=(r,s,o)=>EO(e,r,s,o)});function A4(e,a){return new C4({type:"intersection",left:e,right:a})}const k4=F("ZodRecord",(e,a)=>{aR.init(e,a),pt.init(e,a),e._zod.processJSONSchema=(r,s,o)=>_O(e,r,s,o),e.keyType=a.keyType,e.valueType=a.valueType});function At(e,a,r){return new k4({type:"record",keyType:e,valueType:a,...ge(r)})}const lh=F("ZodEnum",(e,a)=>{rR.init(e,a),pt.init(e,a),e._zod.processJSONSchema=(s,o,c)=>yO(e,s,o),e.enum=a.entries,e.options=Object.values(a.entries);const r=new Set(Object.keys(a.entries));e.extract=(s,o)=>{const c={};for(const m of s)if(r.has(m))c[m]=a.entries[m];else throw new Error(`Key ${m} not found in enum`);return new lh({...a,checks:[],...ge(o),entries:c})},e.exclude=(s,o)=>{const c={...a.entries};for(const m of s)if(r.has(m))delete c[m];else throw new Error(`Key ${m} not found in enum`);return new lh({...a,checks:[],...ge(o),entries:c})}});function Ve(e,a){const r=Array.isArray(e)?Object.fromEntries(e.map(s=>[s,s])):e;return new lh({type:"enum",entries:r,...ge(a)})}const z4=F("ZodLiteral",(e,a)=>{lR.init(e,a),pt.init(e,a),e._zod.processJSONSchema=(r,s,o)=>bO(e,r,s),e.values=new Set(a.values),Object.defineProperty(e,"value",{get(){if(a.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return a.values[0]}})});function Br(e,a){return new z4({type:"literal",values:Array.isArray(e)?e:[e],...ge(a)})}const T4=F("ZodTransform",(e,a)=>{sR.init(e,a),pt.init(e,a),e._zod.processJSONSchema=(r,s,o)=>SO(e,r),e._zod.parse=(r,s)=>{if(s.direction==="backward")throw new qS(e.constructor.name);r.addIssue=c=>{if(typeof c=="string")r.issues.push(io(c,r.value,a));else{const m=c;m.fatal&&(m.continue=!1),m.code??(m.code="custom"),m.input??(m.input=r.value),m.inst??(m.inst=e),r.issues.push(io(m))}};const o=a.transform(r.value,r);return o instanceof Promise?o.then(c=>(r.value=c,r)):(r.value=o,r)}});function R4(e){return new T4({type:"transform",transform:e})}const y1=F("ZodOptional",(e,a)=>{i1.init(e,a),pt.init(e,a),e._zod.processJSONSchema=(r,s,o)=>m1(e,r,s,o),e.unwrap=()=>e._zod.def.innerType});function ix(e){return new y1({type:"optional",innerType:e})}const O4=F("ZodExactOptional",(e,a)=>{iR.init(e,a),pt.init(e,a),e._zod.processJSONSchema=(r,s,o)=>m1(e,r,s,o),e.unwrap=()=>e._zod.def.innerType});function M4(e){return new O4({type:"optional",innerType:e})}const D4=F("ZodNullable",(e,a)=>{oR.init(e,a),pt.init(e,a),e._zod.processJSONSchema=(r,s,o)=>CO(e,r,s,o),e.unwrap=()=>e._zod.def.innerType});function ox(e){return new D4({type:"nullable",innerType:e})}const U4=F("ZodDefault",(e,a)=>{uR.init(e,a),pt.init(e,a),e._zod.processJSONSchema=(r,s,o)=>kO(e,r,s,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function L4(e,a){return new U4({type:"default",innerType:e,get defaultValue(){return typeof a=="function"?a():GS(a)}})}const $4=F("ZodPrefault",(e,a)=>{cR.init(e,a),pt.init(e,a),e._zod.processJSONSchema=(r,s,o)=>zO(e,r,s,o),e.unwrap=()=>e._zod.def.innerType});function B4(e,a){return new $4({type:"prefault",innerType:e,get defaultValue(){return typeof a=="function"?a():GS(a)}})}const b1=F("ZodNonOptional",(e,a)=>{dR.init(e,a),pt.init(e,a),e._zod.processJSONSchema=(r,s,o)=>AO(e,r,s,o),e.unwrap=()=>e._zod.def.innerType});function Z4(e,a){return new b1({type:"nonoptional",innerType:e,...ge(a)})}const q4=F("ZodCatch",(e,a)=>{fR.init(e,a),pt.init(e,a),e._zod.processJSONSchema=(r,s,o)=>TO(e,r,s,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function H4(e,a){return new q4({type:"catch",innerType:e,catchValue:typeof a=="function"?a:()=>a})}const I4=F("ZodPipe",(e,a)=>{mR.init(e,a),pt.init(e,a),e._zod.processJSONSchema=(r,s,o)=>RO(e,r,s,o),e.in=a.in,e.out=a.out});function ux(e,a){return new I4({type:"pipe",in:e,out:a})}const Q4=F("ZodReadonly",(e,a)=>{hR.init(e,a),pt.init(e,a),e._zod.processJSONSchema=(r,s,o)=>OO(e,r,s,o),e.unwrap=()=>e._zod.def.innerType});function G4(e){return new Q4({type:"readonly",innerType:e})}const P4=F("ZodCustom",(e,a)=>{pR.init(e,a),pt.init(e,a),e._zod.processJSONSchema=(r,s,o)=>xO(e,r)});function V4(e,a={}){return oO(P4,e,a)}function K4(e){return uO(e)}const wm={custom:"custom"};function Oc(e){return GR(Zh,e)}const Y4={FEISHU:"feishu",SLACK:"slack",KAEL:"kael"},x1=Ve(["feishu","slack","kael"]),S1=Ve(["active","inactive"]);le({platform:x1,agentId:_().min(1),credentials:At(_(),it()),status:S1.default("active")});le({agentId:_().min(1).optional(),credentials:At(_(),it()).optional(),status:S1.optional()});le({id:Qe(),platform:_(),agentId:_(),hasCredentials:xo(),status:_(),createdAt:_(),updatedAt:_()});const F4=Ve(["code","reverse_token","oauth","manual"]);le({appId:_().min(1),appSecret:_().min(1)});le({platform:x1,externalUserId:_().min(1),agentId:_().min(1),boundVia:F4.default("manual"),displayName:_().max(200).optional()});le({id:Qe(),platform:_(),externalUserId:_(),agentId:_(),boundVia:_().nullable(),displayName:_().nullable(),createdAt:_()});le({feishuUserId:_().min(1),displayName:_().max(200).optional()});le({configId:Qe(),platform:_(),agentId:_(),appId:_(),connected:xo(),lastActiveAt:_().nullable()});const j1=Ve(["online","offline"]),w1=Ve(["idle","working","blocked","error"]),X4=Ve(["active","suspended","evicted"]);le({chatId:_().min(1),state:X4});le({runtimeState:w1});le({agentId:_().min(1),runtimeType:_().max(50),runtimeVersion:_().max(50).optional()});Ve(["wrong_client","not_owned","agent_suspended","wrong_org","unknown_agent"]);le({agentId:_(),status:j1,connectedAt:_().nullable(),lastSeenAt:_(),clientId:_().nullable().optional(),runtimeType:_().nullable().optional(),runtimeVersion:_().nullable().optional(),runtimeState:w1.nullable().optional(),activeSessions:Qe().int().nullable().optional(),totalSessions:Qe().int().nullable().optional(),runtimeUpdatedAt:_().nullable().optional()});le({total:Qe().int(),running:Qe().int(),byState:le({idle:Qe().int(),working:Qe().int(),blocked:Qe().int(),error:Qe().int()}),clients:Qe().int()});const J4={HUMAN:"human",PERSONAL_ASSISTANT:"personal_assistant",AUTONOMOUS_AGENT:"autonomous_agent"},Mc=Ve(["human","personal_assistant","autonomous_agent"]),qh=Ve(["private","organization"]),W4=Ve(["admin-api","portal"]);Ve(["active","suspended"]);le({name:_().min(1).max(100).regex(/^[a-z0-9_-]+$/,"Only lowercase alphanumeric, hyphens, and underscores").optional(),type:Mc,displayName:_().max(200).optional(),delegateMention:_().max(100).optional(),organizationId:_().max(100).optional(),source:W4.optional(),visibility:qh.optional(),metadata:At(_(),it()).optional(),managerId:_().optional(),clientId:_().min(1).max(100).optional()});le({type:Mc.optional(),displayName:_().max(200).nullable().optional(),delegateMention:_().max(100).nullable().optional(),visibility:qh.optional(),metadata:At(_(),it()).optional(),managerId:_().nullable().optional(),clientId:_().min(1).max(100).nullable().optional()});le({uuid:_(),name:_().nullable(),organizationId:_(),type:Mc,displayName:_().nullable(),delegateMention:_().nullable(),inboxId:_(),status:_(),source:_().nullable().optional(),cloudUserId:_().nullable().optional(),visibility:qh,metadata:At(_(),it()),managerId:_().nullable(),clientId:_().nullable(),presenceStatus:j1.optional(),createdAt:_(),updatedAt:_()});le({repo:_().nullable(),branch:_().nullable()});le({type:Br("agent:pinned"),agentId:_(),name:_().nullable(),displayName:_().nullable(),agentType:Mc});const eM=32e3,Hh=/^[a-z0-9][a-z0-9_-]{0,63}$/i,tM=/^[A-Z][A-Z0-9_]*$/,nM=le({append:_().max(eM).default("")}),aM=le({name:_().regex(Hh,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:Br("stdio"),command:_().min(1),args:Yn(_()).optional()}),rM=le({name:_().regex(Hh,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:Br("http"),url:_().url(),headers:At(_(),_()).optional()}),lM=le({name:_().regex(Hh,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:Br("sse"),url:_().url(),headers:At(_(),_()).optional()}),sM=v1("transport",[aM,rM,lM]),iM=le({key:_().regex(tM,"Env key must match /^[A-Z][A-Z0-9_]*$/"),value:_(),sensitive:xo().default(!1)}),oM=le({url:_().min(1),ref:_().min(1).optional(),localPath:_().min(1).optional()}),Ih=le({prompt:nM.default({append:""}),model:_().default(""),mcpServers:Yn(sM).default([]),env:Yn(iM).default([]),gitRepos:Yn(oM).default([])}),uM=(e,a)=>{const r=new Set;e.mcpServers.forEach((c,m)=>{const h=c.name.toLowerCase();r.has(h)&&a.addIssue({code:wm.custom,path:["mcpServers",m,"name"],message:`Duplicate MCP server name "${c.name}"`}),r.add(h)});const s=new Set;e.env.forEach((c,m)=>{s.has(c.key)&&a.addIssue({code:wm.custom,path:["env",m,"key"],message:`Duplicate env key "${c.key}"`}),s.add(c.key)});const o=new Set;e.gitRepos.forEach((c,m)=>{const h=c.localPath??gc(c.url);h&&(o.has(h)&&a.addIssue({code:wm.custom,path:["gitRepos",m,"localPath"],message:`Duplicate git repo local path "${h}"`}),o.add(h))})},N1=Ih.superRefine(uM),cM=le({agentId:_(),version:Qe().int().positive(),payload:N1,updatedAt:_(),updatedBy:_()});le({expectedVersion:Qe().int().positive(),payload:Ih.partial()});le({payload:Ih.partial()});le({current:cM,next:N1,diff:Yn(le({path:_(),op:Ve(["add","remove","replace"]),before:it().optional(),after:it().optional()}))});const sh="***";function gc(e){const a=e.trim();return a?((a.split(/[?#]/)[0]??"").split(/[/:]/).filter(Boolean).pop()??"").replace(/\.git$/i,""):""}le({username:_().min(1),password:_().min(1)});le({accessToken:_(),refreshToken:_()});le({refreshToken:_().min(1)});le({token:_().min(1)});le({token:_(),expiresIn:Qe(),command:_()});const dM=Ve(["direct","group","thread"]);le({type:dM,topic:_().max(500).optional(),participantIds:Yn(_()).min(1),metadata:At(_(),it()).optional()});const fM=le({agentId:_(),role:_(),mode:_(),joinedAt:_()}),mM=le({id:_(),organizationId:_(),type:_(),topic:_().nullable(),lifecyclePolicy:_().nullable().optional(),metadata:At(_(),it()),createdAt:_(),updatedAt:_()});mM.extend({participants:Yn(fM)});le({agentId:_().min(1),mode:Ve(["full","mention_only"]).default("full")});le({agentId:_().min(1)});const hM=Ve(["connected","disconnected"]);le({id:_(),userId:_().nullable(),status:hM,sdkVersion:_().max(50).nullable(),hostname:_().max(100).nullable(),os:_().max(50).nullable(),agentCount:Qe().int().min(0),connectedAt:_().nullable(),lastSeenAt:_(),metadata:At(_(),it()).nullable()});le({clientId:_().min(1).max(100),hostname:_().max(100).optional(),os:_().max(50).optional(),sdkVersion:_().max(50).optional()});le({limit:Oc().int().min(1).max(100).default(20),cursor:_().optional()});const Qh=Ve(["hub_ui","cli","feishu","github","api"]),E1=Ve(["text","markdown","card","reference","file","task"]);le({format:E1.default("text"),content:it(),metadata:At(_(),it()).optional(),inReplyTo:_().optional(),replyToInbox:_().optional(),replyToChat:_().optional(),source:Qh.optional()});le({format:E1.default("text"),content:it(),metadata:At(_(),it()).optional(),replyToInbox:_().optional(),replyToChat:_().optional(),source:Qh.optional()});const pM=le({id:_(),chatId:_(),senderId:_(),format:_(),content:it(),metadata:At(_(),it()),replyToInbox:_().nullable(),replyToChat:_().nullable(),inReplyTo:_().nullable(),source:Qh.nullable(),createdAt:_()}),gM=pM.extend({configVersion:Qe().int().positive()});Ve(["pending","delivered","acked","failed"]);const vM=le({id:Qe(),inboxId:_(),messageId:_(),chatId:_().nullable(),status:_(),retryCount:Qe(),createdAt:_(),deliveredAt:_().nullable(),ackedAt:_().nullable()});vM.extend({message:gM});le({limit:Oc().int().min(1).max(50).default(10)});const yM={ADMIN:"admin",MEMBER:"member"},Gh=Ve(["admin","member"]),bM=le({id:_(),userId:_(),organizationId:_(),agentId:_(),role:Gh,createdAt:_()});le({username:_().min(1).max(100),displayName:_().min(1).max(200),role:Gh.default("member")});le({role:Gh.optional()});bM.extend({username:_(),displayName:_(),password:_()});const xM=Ve(["agent_error","session_error","agent_needs_decision","agent_blocked","agent_stale","agent_disconnected","agent_connected","session_completed"]),_1=Ve(["high","medium","low"]);le({id:_(),organizationId:_(),type:xM,severity:_1,agentId:_().nullable(),chatId:_().nullable(),message:_(),read:xo(),createdAt:_()});le({limit:Oc().int().min(1).max(100).default(20),cursor:_().optional(),severity:_1.optional(),read:Ve(["true","false"]).transform(e=>e==="true").optional(),agentId:_().optional()});const C1=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;le({name:_().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=>!C1.test(e),"Name must not be a UUID format"),displayName:_().min(1).max(200),maxAgents:Qe().int().min(0).default(0),maxMessagesPerMinute:Qe().int().min(0).default(0),features:At(_(),it()).default({})});le({name:_().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=>!C1.test(e),"Name must not be a UUID format").optional(),displayName:_().min(1).max(200).optional(),maxAgents:Qe().int().min(0).optional(),maxMessagesPerMinute:Qe().int().min(0).optional(),features:At(_(),it()).optional()});le({id:_(),name:_(),displayName:_(),maxAgents:Qe(),maxMessagesPerMinute:Qe(),features:At(_(),it()),createdAt:_(),updatedAt:_()});const SM=le({workingCount:Qe().int().nonnegative(),errorMask:xo()}),jM=le({type:Br("pulse:tick"),organizationId:_(),agents:At(_(),Yn(SM).length(32))}),wM=Ve(["tool_call","error"]),A1=le({toolUseId:_(),name:_(),args:it(),status:Ve(["pending","ok","error"]),durationMs:Qe().int().nonnegative().optional(),resultPreview:_().max(400).optional()}),k1=le({source:Ve(["sdk","runtime","tool"]),message:_().max(2e3)}),NM=v1("kind",[le({kind:Br("tool_call"),payload:A1}),le({kind:Br("error"),payload:k1})]);le({id:_(),agentId:_(),chatId:_(),seq:Qe().int().positive(),kind:wM,payload:g1([A1,k1]),createdAt:_()});le({agentId:_(),chatId:_(),event:NM});le({agentId:_(),chatId:_()});const EM=le({organizationId:_(),agentCount:Qe(),chatCount:Qe(),messageCount:Qe()});le({totalAgents:Qe(),totalChats:Qe(),totalMessages:Qe(),byOrganization:Yn(EM)});le({key:_(),value:it(),updatedAt:_()});At(_(),it());const La={INBOX_TIMEOUT_SECONDS:"inbox_timeout_seconds",MAX_RETRY_COUNT:"max_retry_count",POLLING_INTERVAL_SECONDS:"polling_interval_seconds",PRESENCE_CLEANUP_SECONDS:"presence_cleanup_seconds"},Nm={[La.INBOX_TIMEOUT_SECONDS]:300,[La.MAX_RETRY_COUNT]:3,[La.POLLING_INTERVAL_SECONDS]:5,[La.PRESENCE_CLEANUP_SECONDS]:60},oo=Ve(["pending","assigned","working","completed","failed","cancelled"]),cx=Ve(["agent","admin"]),_M=Ve(["assigned","status_changed","cancelled"]);le({taskId:_(),event:_M,title:_(),body:_().default(""),status:oo,fromStatus:oo.optional(),originRef:_().nullable().optional()});const CM=le({title:_().min(1).max(500),body:_().optional(),assigneeAgentId:_().optional(),originRef:_().max(500).optional(),metadata:At(_(),it()).optional()});CM.extend({organizationId:_().optional()});le({status:Ve(["working","completed","failed"]),result:_().optional()});le({assigneeAgentId:_().nullable().optional(),status:oo.optional(),result:_().optional()});le({chatId:_().min(1)});const AM=le({id:_(),organizationId:_(),title:_(),body:_(),status:oo,assigneeAgentId:_().nullable(),createdByType:cx,createdById:_(),originRef:_().nullable(),result:_().nullable(),metadata:At(_(),it()),createdAt:_(),updatedAt:_(),cancelledAt:_().nullable(),cancelledByType:cx.nullable(),cancelledById:_().nullable()}),kM=le({taskId:_(),chatId:_(),linkedByAgentId:_().nullable(),linkedAt:_()});AM.extend({chats:Yn(kM)});le({status:oo.optional(),assigneeAgentId:_().optional(),originRef:_().optional(),limit:Oc().int().min(1).max(100).default(20),cursor:_().optional()});const zM=Ve(["normal","idle_island","awaiting_reply","no_chat","not_applicable"]);le({taskId:_(),signal:zM,reason:_()});const TM=Ve(["active","suspended"]);le({id:_(),username:_(),displayName:_(),avatarUrl:_().nullable(),status:TM,createdAt:_(),updatedAt:_()});le({username:_().min(1).max(100),displayName:_().min(1).max(200),password:_().min(8).max(200)});le({displayName:_().min(1).max(200).optional(),password:_().min(8).max(200).optional()});le({type:Br("auth"),token:_().min(1)});const z1=Array.from({length:32},()=>({workingCount:0,errorMask:!1}));function RM(e){const a=Array.from({length:32},()=>({workingCount:0,errorMask:!1}));for(const r of Object.values(e))for(let s=0;s<32&&s<r.length;s++){const o=r[s],c=a[s];!o||!c||(c.workingCount+=o.workingCount,c.errorMask=c.errorMask||o.errorMask)}return a}const OM=2e3,MM=3e4;let wr=null,vc=!1,Em=0,Wi=null;const ih=new Set;let Ji=null,ks=0;function DM(e){for(const a of ih)try{a(e)}catch{}Ji&&(e.type==="notification"?Ji.invalidateQueries({queryKey:["notifications"]}):e.type==="session:state"&&(Ji.invalidateQueries({queryKey:["activity"]}),Ji.invalidateQueries({queryKey:["sessions"]})))}function T1(){const e=Nh();if(!(e!=null&&e.accessToken))return;const r=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/v1/ws/admin?token=${e.accessToken}`,s=new WebSocket(r);wr=s,s.onmessage=o=>{if(s===wr)try{const c=JSON.parse(o.data);DM(c)}catch{}},s.onopen=()=>{s===wr&&(Em=0)},s.onclose=()=>{if(s!==wr||(wr=null,vc||ks===0))return;Em++;const o=Math.min(OM*2**(Em-1),MM);Wi=setTimeout(()=>{Wi=null,!vc&&ks>0&&T1()},o)}}function UM(){vc=!0,Wi&&(clearTimeout(Wi),Wi=null),wr&&(wr.close(1e3,"unmount"),wr=null)}function R1(e){const{onMessage:a,enabled:r=!0}=e??{},s=Zn(),o=v.useRef(a);o.current=a,v.useEffect(()=>{Ji=s},[s]),v.useEffect(()=>{if(!r)return;const c=m=>{var h;return(h=o.current)==null?void 0:h.call(o,m)};return ih.add(c),ks++,ks===1&&(vc=!1,T1()),()=>{ih.delete(c),ks--,ks===0&&UM()}},[r])}const O1=v.createContext({aggregated:z1,agents:{},receivedAtMs:null,stale:!0});function LM({children:e}){const[a,r]=v.useState({aggregated:z1,agents:{},receivedAtMs:null}),[s,o]=v.useState(()=>Date.now());R1({onMessage:m=>{const h=jM.safeParse(m);h.success&&r({aggregated:RM(h.data.agents),agents:h.data.agents,receivedAtMs:Date.now()})}}),v.useEffect(()=>{const m=setInterval(()=>o(Date.now()),1e4);return()=>clearInterval(m)},[]);const c=v.useMemo(()=>({...a,stale:a.receivedAtMs===null||s-a.receivedAtMs>3e4}),[a,s]);return u.jsx(O1.Provider,{value:c,children:e})}function $M(){return v.useContext(O1)}function M1(){return ke.get("/admin/adapter-mappings")}function BM(e){return ke.post("/admin/adapter-mappings",e)}function ZM(e){return ke.delete(`/admin/adapter-mappings/${e}`)}function D1(){return ke.get("/admin/adapters/status")}function U1(){return ke.get("/admin/adapters")}function qM(e){return ke.post("/admin/adapters",e)}function HM(e,a){return ke.patch(`/admin/adapters/${e}`,a)}function IM(e){return ke.delete(`/admin/adapters/${e}`)}const dx=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,fx=E0,L1=(e,a)=>r=>{var s;if((a==null?void 0:a.variants)==null)return fx(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:o,defaultVariants:c}=a,m=Object.keys(o).map(p=>{const b=r==null?void 0:r[p],x=c==null?void 0:c[p];if(b===null)return null;const j=dx(b)||dx(x);return o[p][j]}),h=r&&Object.entries(r).reduce((p,b)=>{let[x,j]=b;return j===void 0||(p[x]=j),p},{}),g=a==null||(s=a.compoundVariants)===null||s===void 0?void 0:s.reduce((p,b)=>{let{class:x,className:j,...N}=b;return Object.entries(N).every(z=>{let[w,E]=z;return Array.isArray(E)?E.includes({...c,...h}[w]):{...c,...h}[w]===E})?[...p,x,j]:p},[]);return fx(e,m,g,r==null?void 0:r.class,r==null?void 0:r.className)},QM=L1("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive/10 text-destructive",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Wt({className:e,variant:a,...r}){return u.jsx("div",{className:je(QM({variant:a}),e),...r})}const Al=v.forwardRef(({className:e,...a},r)=>u.jsx("div",{ref:r,className:je("rounded-xl border bg-card text-card-foreground shadow-sm",e),...a}));Al.displayName="Card";const Ps=v.forwardRef(({className:e,...a},r)=>u.jsx("div",{ref:r,className:je("flex flex-col space-y-1.5 p-6",e),...a}));Ps.displayName="CardHeader";const Vs=v.forwardRef(({className:e,...a},r)=>u.jsx("div",{ref:r,className:je("font-semibold leading-none tracking-tight",e),...a}));Vs.displayName="CardTitle";const $1=v.forwardRef(({className:e,...a},r)=>u.jsx("div",{ref:r,className:je("text-sm text-muted-foreground",e),...a}));$1.displayName="CardDescription";const kl=v.forwardRef(({className:e,...a},r)=>u.jsx("div",{ref:r,className:je("p-6 pt-0",e),...a}));kl.displayName="CardContent";const GM=v.forwardRef(({className:e,...a},r)=>u.jsx("div",{ref:r,className:je("flex items-center p-6 pt-0",e),...a}));GM.displayName="CardFooter";const qa=v.forwardRef(({className:e,...a},r)=>u.jsx("div",{className:"relative w-full overflow-auto",children:u.jsx("table",{ref:r,className:je("w-full caption-bottom text-sm",e),...a})}));qa.displayName="Table";const Ha=v.forwardRef(({className:e,...a},r)=>u.jsx("thead",{ref:r,className:je("[&_tr]:border-b",e),...a}));Ha.displayName="TableHeader";const Ia=v.forwardRef(({className:e,...a},r)=>u.jsx("tbody",{ref:r,className:je("[&_tr:last-child]:border-0",e),...a}));Ia.displayName="TableBody";const lt=v.forwardRef(({className:e,...a},r)=>u.jsx("tr",{ref:r,className:je("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...a}));lt.displayName="TableRow";const Ne=v.forwardRef(({className:e,...a},r)=>u.jsx("th",{ref:r,className:je("h-10 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...a}));Ne.displayName="TableHead";const xe=v.forwardRef(({className:e,...a},r)=>u.jsx("td",{ref:r,className:je("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...a}));xe.displayName="TableCell";function PM(){const e=Qa(),a=Va(),{data:r,isLoading:s}=Ie({queryKey:["adapters"],queryFn:U1}),{data:o,isLoading:c}=Ie({queryKey:["adapter-mappings"],queryFn:M1}),{data:m}=Ie({queryKey:["adapter-statuses"],queryFn:D1,refetchInterval:15e3}),h=s||c;return u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{children:[u.jsx("h1",{className:"text-2xl font-semibold",children:"Platform Bindings"}),u.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Overview of all platform bindings. Manage bindings from each Agent's detail page."})]}),u.jsxs(Al,{children:[u.jsx(Ps,{children:u.jsx(Vs,{children:"Bot Bindings"})}),u.jsx(kl,{children:u.jsxs(qa,{children:[u.jsx(Ha,{children:u.jsxs(lt,{children:[u.jsx(Ne,{children:"Agent"}),u.jsx(Ne,{children:"Platform"}),u.jsx(Ne,{children:"Status"}),u.jsx(Ne,{children:"Connection"}),u.jsx(Ne,{children:"Created"})]})}),u.jsx(Ia,{children:h?u.jsx(lt,{children:u.jsx(xe,{colSpan:5,className:"text-center py-4 text-muted-foreground",children:"Loading..."})}):r!=null&&r.length?r.map(g=>{const p=m==null?void 0:m.find(b=>b.configId===g.id);return u.jsxs(lt,{className:"cursor-pointer",onClick:()=>e(`/agents/${g.agentId}`),children:[u.jsx(xe,{className:"font-mono text-sm",children:a(g.agentId)}),u.jsx(xe,{children:u.jsx(Wt,{variant:"secondary",children:g.platform})}),u.jsx(xe,{children:u.jsx(Wt,{variant:g.status==="active"?"default":"destructive",children:g.status})}),u.jsx(xe,{children:u.jsxs("span",{className:"flex items-center gap-1.5",children:[u.jsx("span",{className:je("inline-block h-2 w-2 rounded-full",p!=null&&p.connected?"bg-green-500":"bg-gray-300")}),u.jsx("span",{className:"text-xs text-muted-foreground",children:p!=null&&p.connected?"Online":"Offline"})]})}),u.jsx(xe,{className:"text-muted-foreground",children:ca(g.createdAt)})]},g.id)}):u.jsx(lt,{children:u.jsx(xe,{colSpan:5,className:"text-center py-4 text-muted-foreground",children:"No bot bindings"})})})]})})]}),u.jsxs(Al,{children:[u.jsx(Ps,{children:u.jsx(Vs,{children:"User Bindings"})}),u.jsx(kl,{children:u.jsxs(qa,{children:[u.jsx(Ha,{children:u.jsxs(lt,{children:[u.jsx(Ne,{children:"Agent"}),u.jsx(Ne,{children:"Platform"}),u.jsx(Ne,{children:"External User ID"}),u.jsx(Ne,{children:"Display Name"}),u.jsx(Ne,{children:"Bound Via"}),u.jsx(Ne,{children:"Created"})]})}),u.jsx(Ia,{children:h?u.jsx(lt,{children:u.jsx(xe,{colSpan:6,className:"text-center py-4 text-muted-foreground",children:"Loading..."})}):o!=null&&o.length?o.map(g=>u.jsxs(lt,{className:"cursor-pointer",onClick:()=>e(`/agents/${g.agentId}`),children:[u.jsx(xe,{className:"font-mono text-sm",children:a(g.agentId)}),u.jsx(xe,{children:u.jsx(Wt,{variant:"secondary",children:g.platform})}),u.jsx(xe,{className:"font-mono text-sm",children:g.externalUserId}),u.jsx(xe,{children:g.displayName??"—"}),u.jsx(xe,{children:u.jsx(Wt,{variant:"outline",children:g.boundVia??"—"})}),u.jsx(xe,{className:"text-muted-foreground",children:ca(g.createdAt)})]},g.id)):u.jsx(lt,{children:u.jsx(xe,{colSpan:6,className:"text-center py-4 text-muted-foreground",children:"No user bindings"})})})]})})]})]})}function B1(){return ke.get("/members")}function VM(e){return ke.post("/members",e)}function KM(e){return ke.delete(`/members/${encodeURIComponent(e)}`)}const YM=L1("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm 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-white 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 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),he=v.forwardRef(({className:e,variant:a,size:r,asChild:s=!1,...o},c)=>{const m=s?_k:"button";return u.jsx(m,{className:je(YM({variant:a,size:r,className:e})),ref:c,...o})});he.displayName="Button";const ct=v.forwardRef(({className:e,type:a,...r},s)=>u.jsx("input",{type:a,className:je("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm 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:s,...r}));ct.displayName="Input";var FM="Label",Z1=v.forwardRef((e,a)=>u.jsx(Pa.label,{...e,ref:a,onMouseDown:r=>{var o;r.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));Z1.displayName=FM;var XM=Z1;const Ye=v.forwardRef(({className:e,...a},r)=>u.jsx(XM,{ref:r,className:je("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...a}));Ye.displayName="Label";const JM=Object.values(yM);function WM(){const e=Zn(),[a,r]=v.useState(!1),[s,o]=v.useState({username:"",displayName:"",role:"member"}),[c,m]=v.useState(null),{data:h,isLoading:g,error:p}=Ie({queryKey:["members"],queryFn:B1}),b=st({mutationFn:()=>VM({username:s.username,displayName:s.displayName,role:s.role}),onSuccess:w=>{e.invalidateQueries({queryKey:["members"]}),m(w.password)}}),x=st({mutationFn:KM,onSuccess:()=>e.invalidateQueries({queryKey:["members"]})});function j(){r(!1),o({username:"",displayName:"",role:"member"}),m(null)}function N(w){w.preventDefault(),b.mutate()}function z(w){window.confirm("Delete this member? Their human agent will also be deactivated.")&&x.mutate(w)}return u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center justify-between mb-6",children:[u.jsx("h1",{className:"text-2xl font-semibold",children:"Members"}),u.jsxs(Ln,{open:a,onOpenChange:w=>w?r(!0):j(),children:[u.jsx(Kk,{asChild:!0,children:u.jsxs(he,{children:[u.jsx(zl,{className:"h-4 w-4 mr-2"}),"Add Member"]})}),u.jsxs(xn,{children:[u.jsx(Fn,{children:u.jsx(Bn,{children:c?"Member Created":"Create Member"})}),c?u.jsxs("div",{className:"space-y-4",children:[u.jsx("p",{className:"text-sm text-muted-foreground",children:"Member created. Share the password below — it will only be shown once."}),u.jsxs("div",{className:"flex items-center gap-2 rounded-md border p-3 bg-muted",children:[u.jsx("code",{className:"flex-1 text-sm font-mono",children:c}),u.jsx(he,{variant:"ghost",size:"icon",onClick:()=>navigator.clipboard.writeText(c),title:"Copy password",children:u.jsx(Eh,{className:"h-4 w-4"})})]}),u.jsx($n,{children:u.jsx(he,{onClick:j,children:"Done"})})]}):u.jsxs("form",{onSubmit:N,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(Ye,{htmlFor:"member-username",children:"Username"}),u.jsx(ct,{id:"member-username",type:"text",value:s.username,onChange:w=>o({...s,username:w.target.value}),required:!0})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(Ye,{htmlFor:"member-name",children:"Display Name"}),u.jsx(ct,{id:"member-name",value:s.displayName,onChange:w=>o({...s,displayName:w.target.value}),required:!0})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(Ye,{htmlFor:"member-role",children:"Role"}),u.jsx("select",{id:"member-role",value:s.role,onChange:w=>o({...s,role:w.target.value}),className:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:JM.map(w=>u.jsx("option",{value:w,children:w},w))})]}),b.error instanceof Error&&u.jsx("div",{className:"text-sm text-destructive",children:b.error.message}),u.jsx($n,{children:u.jsx(he,{type:"submit",disabled:b.isPending,children:b.isPending?"Creating...":"Create"})})]})]})]})]}),u.jsx("div",{className:"border rounded-lg",children:u.jsxs(qa,{children:[u.jsx(Ha,{children:u.jsxs(lt,{children:[u.jsx(Ne,{children:"Username"}),u.jsx(Ne,{children:"Name"}),u.jsx(Ne,{children:"Role"}),u.jsx(Ne,{children:"Created"}),u.jsx(Ne,{className:"w-16"})]})}),u.jsx(Ia,{children:g?u.jsx(lt,{children:u.jsx(xe,{colSpan:5,className:"text-center py-8 text-muted-foreground",children:"Loading..."})}):p?u.jsx(lt,{children:u.jsxs(xe,{colSpan:5,className:"text-center py-8 text-destructive",children:["Failed to load members: ",p instanceof Error?p.message:"Unknown error"]})}):(h==null?void 0:h.length)===0?u.jsx(lt,{children:u.jsx(xe,{colSpan:5,className:"text-center py-8 text-muted-foreground",children:"No members"})}):h==null?void 0:h.map(w=>u.jsxs(lt,{children:[u.jsx(xe,{className:"font-medium",children:w.username}),u.jsx(xe,{children:w.displayName}),u.jsx(xe,{children:u.jsx(Wt,{variant:w.role==="admin"?"default":"secondary",children:w.role})}),u.jsx(xe,{className:"text-muted-foreground",children:ca(w.createdAt)}),u.jsx(xe,{children:u.jsx(he,{variant:"ghost",size:"icon",onClick:()=>z(w.id),disabled:x.isPending,title:"Delete",children:u.jsx(ao,{className:"h-4 w-4"})})})]},w.id))})]})})]})}function e3(){return ke.get("/admin/system/config")}function t3(e){return ke.patch("/admin/system/config",e)}const n3={[La.INBOX_TIMEOUT_SECONDS]:"Inbox Timeout (seconds)",[La.MAX_RETRY_COUNT]:"Max Retry Count",[La.POLLING_INTERVAL_SECONDS]:"Polling Interval (seconds)",[La.PRESENCE_CLEANUP_SECONDS]:"Presence Cleanup (seconds)"},mx=Object.values(La);function a3(){const e=Zn(),{data:a,isLoading:r}=Ie({queryKey:["system-config"],queryFn:e3}),[s,o]=v.useState({}),[c,m]=v.useState(!1);v.useEffect(()=>{if(!a)return;const p={};for(const b of mx){const x=a[b]??Nm[b]??"";p[b]=String(x)}o(p)},[a]);const h=st({mutationFn:()=>{const p={};for(const[b,x]of Object.entries(s)){const j=x.trim();if(j==="")p[b]=Nm[b]??0;else{const N=Number(j);p[b]=Number.isNaN(N)?j:N}}return t3(p)},onSuccess:()=>{e.invalidateQueries({queryKey:["system-config"]}),m(!0),setTimeout(()=>m(!1),2e3)}}),g=p=>{p.preventDefault(),h.mutate()};return r?u.jsx("div",{className:"text-muted-foreground",children:"Loading..."}):u.jsxs("div",{children:[u.jsx("h1",{className:"text-2xl font-semibold mb-6",children:"Settings"}),u.jsxs(Al,{children:[u.jsx(Ps,{children:u.jsx(Vs,{children:"System Configuration"})}),u.jsx(kl,{children:u.jsxs("form",{onSubmit:g,className:"space-y-4",children:[mx.map(p=>u.jsxs("div",{className:"space-y-2",children:[u.jsx(Ye,{htmlFor:p,children:n3[p]??p}),u.jsx(ct,{id:p,value:s[p]??"",onChange:b=>o({...s,[p]:b.target.value})}),u.jsxs("p",{className:"text-xs text-muted-foreground",children:["Default: ",String(Nm[p]??"—")]})]},p)),h.error instanceof Error&&u.jsx("div",{className:"text-sm text-destructive",children:h.error.message}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx(he,{type:"submit",disabled:h.isPending,children:h.isPending?"Saving...":"Save Changes"}),c&&u.jsx("span",{className:"text-sm text-green-600",children:"Saved!"})]})]})})]})]})}const hx=[{key:"members",label:"Members"},{key:"settings",label:"Settings"},{key:"bindings",label:"Bindings"}];function r3(){const e=Hn(),a=Qa(),r=e.hash.replace("#",""),s=hx.some(c=>c.key===r)?r:"members",o=c=>{a({hash:c},{replace:!0})};return u.jsxs("div",{children:[u.jsx("h1",{className:"text-2xl font-semibold mb-4",children:"Admin"}),u.jsx("div",{className:"flex gap-1 border-b border-border mb-6",children:hx.map(c=>u.jsx("button",{type:"button",onClick:()=>o(c.key),className:je("px-4 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",s===c.key?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:c.label},c.key))}),s==="members"&&u.jsx(WM,{}),s==="settings"&&u.jsx(a3,{}),s==="bindings"&&u.jsx(PM,{})]})}function l3(e){return ke.get(`/admin/agents/${e}/config`)}function s3(e,a){return ke.patch(`/admin/agents/${e}/config`,a)}function i3(e,a){return ke.post(`/admin/agents/${e}/config/dry-run`,{payload:a})}function o3(e){return ke.get(`/admin/agents/${e}/client-status`)}function u3(e){const{agent:a}=e,[r,s]=v.useState(!1),o=a.displayName||a.name||a.uuid;return u.jsxs("section",{className:"rounded-md border border-red-200 bg-red-50/40",children:[u.jsxs("header",{className:"flex items-center gap-2 border-b border-red-200 px-4 py-2",children:[u.jsx(k2,{className:"h-4 w-4 text-red-700"}),u.jsx("h3",{className:"text-sm font-medium text-red-800",children:"Danger Zone"})]}),u.jsxs("div",{className:"divide-y divide-red-200",children:[a.status==="active"?u.jsx(_m,{title:"Suspend agent",body:"Pause all active sessions. You can reactivate later; tokens stay revoked until then.",action:u.jsx(he,{variant:"outline",size:"sm",onClick:e.onSuspend,disabled:e.suspendPending,children:e.suspendPending?"Suspending…":"Suspend"})}):u.jsx(_m,{title:"Reactivate agent",body:"Resume sessions. Tokens must be recreated — they are not restored.",action:u.jsx(he,{variant:"outline",size:"sm",onClick:e.onReactivate,disabled:e.reactivatePending,children:e.reactivatePending?"Reactivating…":"Reactivate"})}),u.jsx(_m,{title:"Delete agent",body:"Permanent. Configuration, bindings, tokens, and session history are all dropped.",action:u.jsxs(he,{variant:"destructive",size:"sm",onClick:()=>s(!0),disabled:e.deletePending,children:[u.jsx(ao,{className:"h-3.5 w-3.5 mr-1.5"}),"Delete"]})})]}),u.jsx(c3,{open:r,onOpenChange:s,expected:o,onDelete:()=>{s(!1),e.onDelete()},deleting:e.deletePending})]})}function _m(e){return u.jsxs("div",{className:"flex items-start justify-between gap-4 px-4 py-3 text-sm",children:[u.jsxs("div",{children:[u.jsx("p",{className:"font-medium text-red-900",children:e.title}),u.jsx("p",{className:"text-xs text-red-800/80",children:e.body})]}),u.jsx("div",{children:e.action})]})}function c3({open:e,onOpenChange:a,expected:r,onDelete:s,deleting:o}){const[c,m]=v.useState("");function h(g){g.preventDefault(),c===r&&s()}return u.jsx(Ln,{open:e,onOpenChange:g=>{a(g),g||m("")},children:u.jsxs(xn,{children:[u.jsx(Fn,{children:u.jsxs(Bn,{children:['Delete "',r,'"?']})}),u.jsxs("form",{onSubmit:h,className:"space-y-4",children:[u.jsxs("p",{className:"text-sm text-muted-foreground",children:["This action cannot be undone. Type ",u.jsx("span",{className:"font-mono font-medium text-gray-900",children:r})," ","to confirm."]}),u.jsx(ct,{value:c,onChange:g=>m(g.target.value),autoFocus:!0,placeholder:r,className:"font-mono"}),u.jsxs($n,{children:[u.jsx(he,{type:"button",variant:"ghost",onClick:()=>a(!1),disabled:o,children:"Cancel"}),u.jsx(he,{type:"submit",variant:"destructive",disabled:c!==r||o,children:o?"Deleting…":"Delete"})]})]})]})})}const d3={unchanged:{label:"",tone:""},added:{label:"new",tone:"bg-green-100 text-green-900"},modified:{label:"changed",tone:"bg-amber-100 text-amber-900"},deleted:{label:"will be removed on save",tone:"bg-red-100 text-red-900"}};function Ph({status:e,onEdit:a,onDelete:r,onUndo:s,children:o,disabled:c}){const m=d3[e],h=e==="deleted";return u.jsxs("div",{className:je("flex items-center gap-2 rounded border px-3 py-2 text-sm",h?"bg-red-50 border-red-200 text-red-900 line-through decoration-red-300":"bg-white"),children:[u.jsx("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:o}),m.label&&u.jsx("span",{className:je("text-xs rounded px-1.5 py-0.5 whitespace-nowrap",m.tone),children:m.label}),!c&&(h?u.jsxs(he,{size:"sm",variant:"ghost",onClick:s,children:[u.jsx(T2,{className:"h-3.5 w-3.5 mr-1"}),"Undo"]}):u.jsx(f3,{onEdit:a,onDelete:r}))]})}function f3({onEdit:e,onDelete:a}){return u.jsxs("div",{className:"flex gap-1",children:[u.jsx(he,{size:"sm",variant:"ghost",onClick:e,title:"Edit",children:"Edit"}),u.jsxs(he,{size:"sm",variant:"ghost",onClick:a,title:"Delete",children:[u.jsx(x0,{className:"sr-only h-3.5 w-3.5","aria-hidden":!0}),"Delete"]})]})}function m3(e){const[a,r]=v.useState(null),s=e.items.filter(o=>o.status!=="deleted").length;return u.jsxs("section",{className:"rounded-md border bg-white",children:[u.jsxs("header",{className:"flex items-center justify-between border-b px-4 py-2",children:[u.jsxs("h3",{className:"text-sm font-medium",children:["Environment Variables (",s,")"]}),!e.disabled&&u.jsxs(he,{size:"sm",variant:"outline",onClick:()=>r({mode:"add"}),children:[u.jsx(zl,{className:"h-3.5 w-3.5 mr-1.5"})," Add"]})]}),u.jsx("div",{className:"px-4 py-3 space-y-2",children:e.items.length===0?u.jsx("p",{className:"text-sm text-muted-foreground",children:"No environment variables."}):e.items.map(o=>u.jsxs(Ph,{status:o.status,onEdit:()=>r({mode:"edit",key:o.key,initial:o.value}),onDelete:()=>e.onDelete(o.key),onUndo:()=>e.onUndoDelete(o.key),disabled:e.disabled,children:[u.jsx("span",{className:"font-mono font-medium",children:o.value.key}),u.jsx("span",{className:"font-mono text-xs text-muted-foreground truncate max-w-xs",children:o.value.sensitive?"••••••":o.value.value||u.jsx("em",{children:"(empty)"})}),o.value.sensitive&&u.jsx(o2,{className:"h-3 w-3 text-muted-foreground"})]},o.key))}),a&&u.jsx(h3,{open:!!a,onOpenChange:o=>!o&&r(null),initial:a.mode==="edit"?a.initial:null,forbiddenKeys:e.otherKeys(a.mode==="edit"?a.key:null),onSubmit:o=>{a.mode==="edit"?e.onUpdate(a.key,o):e.onAdd(o),r(null)}})]})}function h3({open:e,onOpenChange:a,initial:r,forbiddenKeys:s,onSubmit:o}){const[c,m]=v.useState((r==null?void 0:r.key)??""),[h,g]=v.useState(r!=null&&r.sensitive?"":(r==null?void 0:r.value)??""),[p,b]=v.useState((r==null?void 0:r.sensitive)??!1),[x,j]=v.useState(null);v.useEffect(()=>{e&&(m((r==null?void 0:r.key)??""),g(r!=null&&r.sensitive?"":(r==null?void 0:r.value)??""),b((r==null?void 0:r.sensitive)??!1),j(null))},[e,r]);function N(z){if(z.preventDefault(),!c.match(/^[A-Z][A-Z0-9_]*$/)){j("Key must match /^[A-Z][A-Z0-9_]*$/.");return}if(s.has(c)){j(`Another entry already uses key "${c}".`);return}let w=h;if(p&&(r!=null&&r.sensitive)&&!h&&(w=sh),!p&&!r&&!h){j("Value is required for non-sensitive entries.");return}o({key:c,value:w,sensitive:p})}return u.jsx(Ln,{open:e,onOpenChange:a,children:u.jsxs(xn,{children:[u.jsx(Fn,{children:u.jsx(Bn,{children:r?"Edit environment variable":"Add environment variable"})}),u.jsxs("form",{onSubmit:N,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(Ye,{htmlFor:"env-key",children:"Key"}),u.jsx(ct,{id:"env-key",value:c,onChange:z=>m(z.target.value.toUpperCase()),placeholder:"OPENAI_API_KEY",className:"font-mono",disabled:!!r}),r&&u.jsx("p",{className:"text-xs text-muted-foreground",children:"Key can't be renamed — delete and re-add."})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(Ye,{htmlFor:"env-value",children:"Value"}),u.jsx(ct,{id:"env-value",type:p?"password":"text",autoComplete:"new-password",value:h,onChange:z=>g(z.target.value),placeholder:r!=null&&r.sensitive?"Leave empty to keep existing value":p?"new secret":"value",className:"font-mono"})]}),u.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[u.jsx("input",{type:"checkbox",checked:p,onChange:z=>b(z.target.checked),className:"h-4 w-4",disabled:!!r&&r.sensitive}),"Mark as sensitive (encrypted at rest, never displayed again)"]}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"Sensitive values cannot be viewed after saving. If you need to verify, save a new value."}),x&&u.jsx("p",{className:"text-sm text-destructive",children:x}),u.jsxs($n,{children:[u.jsx(he,{type:"button",variant:"ghost",onClick:()=>a(!1),children:"Cancel"}),u.jsx(he,{type:"submit",children:r?"Done":"Add"})]})]})]})})}function p3(e){const[a,r]=v.useState(null),s=e.items.filter(o=>o.status!=="deleted").length;return u.jsxs("section",{className:"rounded-md border bg-white",children:[u.jsxs("header",{className:"flex items-center justify-between border-b px-4 py-2",children:[u.jsxs("h3",{className:"text-sm font-medium",children:["Git Repositories (",s,")"]}),!e.disabled&&u.jsxs(he,{size:"sm",variant:"outline",onClick:()=>r({mode:"add"}),children:[u.jsx(zl,{className:"h-3.5 w-3.5 mr-1.5"})," Add"]})]}),u.jsx("div",{className:"px-4 py-3 space-y-2",children:e.items.length===0?u.jsx("p",{className:"text-sm text-muted-foreground",children:"No Git repositories."}):e.items.map(o=>{const c=o.value.localPath??gc(o.value.url);return u.jsxs(Ph,{status:o.status,onEdit:()=>r({mode:"edit",key:o.key,initial:o.value}),onDelete:()=>e.onDelete(o.key),onUndo:()=>e.onUndoDelete(o.key),disabled:e.disabled,children:[u.jsx("span",{className:"font-mono text-xs",children:o.value.url}),o.value.ref&&u.jsxs("span",{className:"text-xs text-muted-foreground",children:["@ ",o.value.ref]}),u.jsxs("span",{className:"text-xs text-muted-foreground",children:["→ ",c||"./"]})]},o.key)})}),a&&u.jsx(g3,{open:!!a,onOpenChange:o=>!o&&r(null),initial:a.mode==="edit"?a.initial:null,forbiddenPaths:e.otherPaths(a.mode==="edit"?a.key:null),onSubmit:o=>{a.mode==="edit"?e.onUpdate(a.key,o):e.onAdd(o),r(null)}})]})}function g3({open:e,onOpenChange:a,initial:r,forbiddenPaths:s,onSubmit:o}){const[c,m]=v.useState((r==null?void 0:r.url)??""),[h,g]=v.useState((r==null?void 0:r.ref)??""),[p,b]=v.useState((r==null?void 0:r.localPath)??""),[x,j]=v.useState(null);v.useEffect(()=>{e&&(m((r==null?void 0:r.url)??""),g((r==null?void 0:r.ref)??""),b((r==null?void 0:r.localPath)??""),j(null))},[e,r]);function N(z){z.preventDefault();const w=c.trim();if(!w){j("URL is required.");return}const E=p.trim()||gc(w);if(E&&s.has(E)){j(`Another repo already occupies local path "${E}".`);return}const M={url:w,...h.trim()?{ref:h.trim()}:{},...p.trim()?{localPath:p.trim()}:{}};o(M)}return u.jsx(Ln,{open:e,onOpenChange:a,children:u.jsxs(xn,{children:[u.jsx(Fn,{children:u.jsx(Bn,{children:r?"Edit Git repository":"Add Git repository"})}),u.jsxs("form",{onSubmit:N,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(Ye,{htmlFor:"git-url",children:"URL"}),u.jsx(ct,{id:"git-url",value:c,onChange:z=>m(z.target.value),placeholder:"git@github.com:org/repo.git",className:"font-mono"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(Ye,{htmlFor:"git-ref",children:"Ref (branch / tag / sha, optional)"}),u.jsx(ct,{id:"git-ref",value:h,onChange:z=>g(z.target.value),placeholder:"main",className:"font-mono"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(Ye,{htmlFor:"git-path",children:"Local path (optional)"}),u.jsx(ct,{id:"git-path",value:p,onChange:z=>b(z.target.value),placeholder:gc(c)||"repo-name",className:"font-mono"}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"Relative to the session working directory. Leave empty to derive from the URL."})]}),x&&u.jsx("p",{className:"text-sm text-destructive",children:x}),u.jsxs($n,{children:[u.jsx(he,{type:"button",variant:"ghost",onClick:()=>a(!1),children:"Cancel"}),u.jsx(he,{type:"submit",children:r?"Done":"Add"})]})]})]})})}function q1(){const{data:e}=Ie({queryKey:["members","name-map"],queryFn:B1,staleTime:3e4});return v.useMemo(()=>{const a=new Map;if(e)for(const r of e)a.set(r.id,r.displayName||r.username);return r=>r?a.get(r)??r:"—"},[e])}function v3({agent:e,onSave:a}){const[r,s]=v.useState(!1),o=Va(),c=q1(),m=e.metadata,h=m==null?void 0:m.tree,g=typeof(h==null?void 0:h.role)=="string"?h.role:null,p=Array.isArray(h==null?void 0:h.domains)?(h==null?void 0:h.domains).filter(j=>typeof j=="string"):[],b=e.managerId?c(e.managerId):null,x=e.delegateMention?o(e.delegateMention):null;return u.jsxs("section",{className:"rounded-md border bg-white",children:[u.jsxs("header",{className:"flex items-center justify-between border-b px-4 py-2",children:[u.jsx("h2",{className:"text-sm font-medium",children:"Identity"}),e.status==="active"&&u.jsxs(he,{size:"sm",variant:"outline",onClick:()=>s(!0),children:[u.jsx(j0,{className:"h-3.5 w-3.5 mr-1.5"})," Edit"]})]}),u.jsxs("div",{className:"px-4 py-3 text-sm space-y-1",children:[u.jsxs("div",{children:[u.jsx("span",{className:"font-mono",children:e.name??e.uuid}),u.jsx("span",{className:"mx-2 text-muted-foreground",children:"·"}),u.jsx("span",{children:e.displayName??u.jsx("span",{className:"text-muted-foreground italic",children:"no display name"})}),x&&u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"mx-2 text-muted-foreground",children:"·"}),u.jsxs("span",{className:"text-muted-foreground",children:["delegate ",u.jsx("span",{className:"font-mono",children:x})]})]})]}),u.jsxs("div",{className:"text-xs text-muted-foreground flex flex-wrap items-center gap-x-3 gap-y-1",children:[u.jsxs("span",{children:["owner ",u.jsx("span",{className:"text-gray-900",children:b??"—"})]}),g&&u.jsxs("span",{children:["role ",u.jsx("span",{className:"text-gray-900",children:g})]}),u.jsxs("span",{children:["type ",u.jsx(Wt,{variant:"secondary",children:e.type})]}),p.length>0&&u.jsxs("span",{children:["domains"," ",u.jsx("span",{className:"inline-flex flex-wrap gap-1 align-middle",children:p.map(j=>u.jsx(Wt,{variant:"outline",children:j},j))})]})]})]}),u.jsx(y3,{agent:e,open:r,onOpenChange:s,onSave:a})]})}function y3({agent:e,open:a,onOpenChange:r,onSave:s}){var w;const[o,c]=v.useState(e.displayName??""),[m,h]=v.useState(e.delegateMention??""),[g,p]=v.useState(!1),[b,x]=v.useState(null);v.useEffect(()=>{a&&(c(e.displayName??""),h(e.delegateMention??""),x(null))},[a,e]);const j=e.type==="human",N=Ie({queryKey:["agents-for-delegate"],queryFn:async()=>(await Oh({limit:100})).items.filter(M=>M.type==="personal_assistant"&&M.status==="active"),enabled:a&&j});async function z(E){E.preventDefault(),x(null),p(!0);try{await s({displayName:o||null,delegateMention:m||null}),r(!1)}catch(M){x(M instanceof Error?M.message:String(M))}finally{p(!1)}}return u.jsx(Ln,{open:a,onOpenChange:r,children:u.jsxs(xn,{children:[u.jsx(Fn,{children:u.jsx(Bn,{children:"Edit Identity"})}),u.jsxs("form",{onSubmit:z,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(Ye,{children:"Name (mention)"}),u.jsx(ct,{value:e.name??"",disabled:!0,className:"font-mono"}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"Name is permanent after creation."})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(Ye,{htmlFor:"id-display",children:"Display Name"}),u.jsx(ct,{id:"id-display",value:o,onChange:E=>c(E.target.value),placeholder:"How teammates see this agent",maxLength:200})]}),j&&u.jsxs("div",{className:"space-y-2",children:[u.jsx(Ye,{htmlFor:"id-delegate",children:"Delegate Mention"}),u.jsxs("select",{id:"id-delegate",value:m,onChange:E=>h(E.target.value),className:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[u.jsx("option",{value:"",children:"None"}),(w=N.data)==null?void 0:w.map(E=>u.jsx("option",{value:E.uuid,children:E.displayName?`${E.displayName} (${E.name??E.uuid})`:E.name??E.uuid},E.uuid))]}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"Assistant that acts on behalf of this agent."})]}),b&&u.jsx("p",{className:"text-sm text-destructive",children:b}),u.jsxs($n,{children:[u.jsx(he,{type:"button",variant:"ghost",onClick:()=>r(!1),disabled:g,children:"Cancel"}),u.jsx(he,{type:"submit",disabled:g,children:g?"Saving…":"Save"})]})]})]})})}function b3(e){const[a,r]=v.useState(null),s=e.items.filter(o=>o.status!=="deleted").length;return u.jsxs("section",{className:"rounded-md border bg-white",children:[u.jsxs("header",{className:"flex items-center justify-between border-b px-4 py-2",children:[u.jsxs("h3",{className:"text-sm font-medium",children:["MCP Servers (",s,")"]}),!e.disabled&&u.jsxs(he,{size:"sm",variant:"outline",onClick:()=>r({mode:"add"}),children:[u.jsx(zl,{className:"h-3.5 w-3.5 mr-1.5"})," Add"]})]}),u.jsx("div",{className:"px-4 py-3 space-y-2",children:e.items.length===0?u.jsx("p",{className:"text-sm text-muted-foreground",children:"No MCP servers. Add one to extend the agent's tools."}):e.items.map(o=>u.jsxs(Ph,{status:o.status,onEdit:()=>r({mode:"edit",key:o.key,initial:o.value}),onDelete:()=>e.onDelete(o.key),onUndo:()=>e.onUndoDelete(o.key),disabled:e.disabled,children:[u.jsx("span",{className:"text-xs rounded bg-gray-100 px-1.5 py-0.5 font-mono",children:o.value.transport}),u.jsx("span",{className:"font-medium font-mono",children:o.value.name}),u.jsx("span",{className:"text-xs text-muted-foreground truncate",children:x3(o.value)})]},o.key))}),a&&u.jsx(S3,{open:!!a,onOpenChange:o=>!o&&r(null),initial:a.mode==="edit"?a.initial:null,forbiddenNames:e.otherNames(a.mode==="edit"?a.key:null),onSubmit:o=>{a.mode==="edit"?e.onUpdate(a.key,o):e.onAdd(o),r(null)}})]})}function x3(e){var a;if(e.transport==="stdio"){const r=(a=e.args)!=null&&a.length?` ${e.args.join(" ")}`:"";return`${e.command}${r}`}return e.url}function S3({open:e,onOpenChange:a,initial:r,forbiddenNames:s,onSubmit:o}){const[c,m]=v.useState((r==null?void 0:r.transport)??"stdio"),[h,g]=v.useState((r==null?void 0:r.name)??""),[p,b]=v.useState((r==null?void 0:r.transport)==="stdio"?r.command:""),[x,j]=v.useState((r==null?void 0:r.transport)==="stdio"&&r.args?r.args.join(" "):""),[N,z]=v.useState(r&&(r.transport==="http"||r.transport==="sse")?r.url:""),[w,E]=v.useState(null);v.useEffect(()=>{e&&(m((r==null?void 0:r.transport)??"stdio"),g((r==null?void 0:r.name)??""),b((r==null?void 0:r.transport)==="stdio"?r.command:""),j((r==null?void 0:r.transport)==="stdio"&&r.args?r.args.join(" "):""),z(r&&(r.transport==="http"||r.transport==="sse")?r.url:""),E(null))},[e,r]);function M(Z){if(Z.preventDefault(),!h.match(/^[a-z0-9][a-z0-9_-]{0,63}$/i)){E("Name must start alphanumeric and contain only a-z0-9_-.");return}if(s.has(h.toLowerCase())){E(`Another MCP server is already named "${h}".`);return}let D;if(c==="stdio"){if(!p.trim()){E("stdio transport requires a command.");return}const O=x.trim().split(/\s+/).filter(P=>P.length>0);D={name:h,transport:"stdio",command:p.trim(),...O.length?{args:O}:{}}}else{const O=N.trim();try{new URL(O)}catch{E("URL is not valid.");return}D={name:h,transport:c,url:O}}o(D)}return u.jsx(Ln,{open:e,onOpenChange:a,children:u.jsxs(xn,{children:[u.jsx(Fn,{children:u.jsx(Bn,{children:r?"Edit MCP server":"Add MCP server"})}),u.jsxs("form",{onSubmit:M,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(Ye,{htmlFor:"mcp-transport",children:"Transport"}),u.jsxs("select",{id:"mcp-transport",value:c,onChange:Z=>m(Z.target.value),className:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[u.jsx("option",{value:"stdio",children:"stdio (local subprocess)"}),u.jsx("option",{value:"http",children:"http"}),u.jsx("option",{value:"sse",children:"sse"})]})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(Ye,{htmlFor:"mcp-name",children:"Name"}),u.jsx(ct,{id:"mcp-name",value:h,onChange:Z=>g(Z.target.value),placeholder:"playwright",className:"font-mono"})]}),c==="stdio"?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(Ye,{htmlFor:"mcp-command",children:"Command"}),u.jsx(ct,{id:"mcp-command",value:p,onChange:Z=>b(Z.target.value),placeholder:"/usr/local/bin/playwright-mcp",className:"font-mono"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(Ye,{htmlFor:"mcp-args",children:"Args (space-separated, optional)"}),u.jsx(ct,{id:"mcp-args",value:x,onChange:Z=>j(Z.target.value),placeholder:"--port 3000",className:"font-mono"})]})]}):u.jsxs("div",{className:"space-y-2",children:[u.jsx(Ye,{htmlFor:"mcp-url",children:"URL"}),u.jsx(ct,{id:"mcp-url",value:N,onChange:Z=>z(Z.target.value),placeholder:"https://internal.api/mcp",className:"font-mono"})]}),w&&u.jsx("p",{className:"text-sm text-destructive",children:w}),u.jsxs($n,{children:[u.jsx(he,{type:"button",variant:"ghost",onClick:()=>a(!1),children:"Cancel"}),u.jsx(he,{type:"submit",children:r?"Done":"Add"})]})]})]})})}const px=[{value:"claude-opus-4-6",label:"claude-opus-4-6",hint:"most capable"},{value:"claude-sonnet-4-6",label:"claude-sonnet-4-6",hint:"default"},{value:"claude-haiku-4-5",label:"claude-haiku-4-5",hint:"fastest"}];function j3({value:e,baseline:a,onChange:r,onRevert:s,disabled:o}){const c=e!==a,m=!px.some(h=>h.value===e)&&e!=="";return u.jsxs("section",{className:`rounded-md border bg-white ${c?"border-amber-300":"border-gray-200"}`,children:[u.jsxs("header",{className:"flex items-center justify-between border-b px-4 py-2",children:[u.jsxs("h3",{className:"text-sm font-medium flex items-center gap-2",children:["Model",c&&u.jsx("span",{className:"text-xs rounded bg-amber-100 px-1.5 py-0.5 text-amber-900",children:"changed"})]}),c&&u.jsx(he,{size:"sm",variant:"ghost",onClick:s,disabled:o,children:"Revert"})]}),u.jsxs("div",{className:"px-4 py-3 space-y-2",children:[u.jsxs("select",{value:e,onChange:h=>r(h.target.value),disabled:o,className:"flex h-9 w-full max-w-md rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50",children:[u.jsx("option",{value:"",children:"(agent default)"}),px.map(h=>u.jsxs("option",{value:h.value,children:[h.label,h.hint?` — ${h.hint}`:""]},h.value)),m&&u.jsxs("option",{value:e,children:[e," — custom"]})]}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"Choose which Claude model powers this agent. Applies to new sessions immediately; active sessions switch on their next message."})]})]})}function w3({value:e,baseline:a,onChange:r,onRevert:s,disabled:o}){const[c,m]=v.useState(!1),h=v.useRef(null),g=e!==a;return v.useEffect(()=>{var p;c&&((p=h.current)==null||p.focus())},[c]),u.jsxs("section",{className:`rounded-md border bg-white ${g?"border-amber-300":"border-gray-200"}`,children:[u.jsxs("header",{className:"flex items-center justify-between border-b px-4 py-2",children:[u.jsxs("h3",{className:"text-sm font-medium flex items-center gap-2",children:["System Prompt Append",g&&u.jsx("span",{className:"text-xs rounded bg-amber-100 px-1.5 py-0.5 text-amber-900",children:"changed"})]}),u.jsx("div",{className:"flex gap-2",children:!c&&!o&&u.jsxs(he,{size:"sm",variant:"outline",onClick:()=>m(!0),children:[u.jsx(j0,{className:"h-3.5 w-3.5 mr-1.5"})," Edit"]})})]}),u.jsx("div",{className:"px-4 py-3",children:c?u.jsxs("div",{className:"space-y-2",children:[u.jsx("textarea",{ref:h,value:e,onChange:p=>r(p.target.value),onKeyDown:p=>{p.key==="Escape"&&(p.preventDefault(),m(!1))},rows:10,className:"w-full rounded border bg-transparent p-2 font-mono text-sm shadow-sm focus:outline-none focus:ring-1 focus:ring-ring",placeholder:"Appended to Claude Code's default system prompt.",maxLength:32e3,spellCheck:!1}),u.jsxs("div",{className:"flex justify-end gap-2",children:[u.jsx(he,{size:"sm",variant:"ghost",onClick:()=>{s(),m(!1)},disabled:!g,children:"Revert"}),u.jsx(he,{size:"sm",onClick:()=>m(!1),children:"Done"})]}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"`Done` collapses this editor. The change is saved only when you click Save in the bar at the bottom of the page."})]}):u.jsx("pre",{className:"whitespace-pre-wrap break-words rounded bg-muted p-3 text-sm font-mono max-h-64 overflow-auto min-h-8",children:e||u.jsx("span",{className:"text-muted-foreground italic font-sans",children:"No prompt append."})})})]})}const N3={prompt:"Prompt",model:"Model",mcp:"MCP",env:"Env",git:"Git"};function E3(e){return!e.summary.anyDirty&&!e.conflictMessage&&!e.errorMessage?null:u.jsx("div",{className:"sticky bottom-0 z-30 -mx-6 border-t bg-yellow-50/95 px-6 py-3 backdrop-blur",children:u.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[u.jsxs("div",{className:"flex flex-col gap-1 text-sm",children:[e.summary.anyDirty&&u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{"aria-hidden":!0,children:"🟡"}),u.jsxs("span",{className:"font-medium",children:[e.summary.dirtySections.length," section",e.summary.dirtySections.length===1?"":"s"," with unsaved changes"]}),u.jsx("span",{className:"text-muted-foreground",children:"·"}),u.jsx("span",{className:"flex flex-wrap gap-1",children:e.summary.dirtySections.map(a=>u.jsx("button",{type:"button",className:"rounded bg-white px-2 py-0.5 text-xs border hover:bg-amber-100",onClick:()=>e.onJumpTo(a),children:N3[a]},a))})]}),u.jsx("p",{className:"text-xs text-muted-foreground",children:e.saveHint}),e.conflictMessage&&u.jsx("p",{className:"text-xs text-amber-900 font-medium",children:e.conflictMessage}),e.errorMessage&&u.jsx("p",{className:"text-xs text-red-800 font-medium",children:e.errorMessage})]}),u.jsxs("div",{className:"flex gap-2",children:[e.conflictMessage&&u.jsx(he,{variant:"outline",size:"sm",onClick:e.onReloadRemote,children:"Discard mine, load latest"}),u.jsx(he,{variant:"ghost",size:"sm",onClick:e.onDiscard,disabled:e.saving,children:"Discard changes"}),u.jsx(he,{size:"sm",onClick:e.onSave,disabled:e.saving||!e.summary.anyDirty,children:e.saving?"Saving…":"Save"})]})]})})}function hl(e){return`agent-cfg-${e}`}function _3(e){switch(e){case"danger":return"border-red-300 bg-red-50 text-red-900";case"warning":return"border-amber-300 bg-amber-50 text-amber-900";case"muted":return"border-gray-300 bg-gray-50 text-gray-700";default:return"border-gray-200 bg-white text-gray-800"}}function C3(e){switch(e){case"danger":return"bg-red-500";case"warning":return"bg-amber-500";case"muted":return"bg-gray-400";default:return"bg-green-500"}}function A3(e){const{agent:a,clientStatus:r,runtimeState:s,isHuman:o}=e;return a.status==="suspended"?{tone:"muted",symbol:"◌",label:"Suspended"}:o?{tone:"neutral",symbol:"●",label:"Active"}:r!=null&&r.offlineSince&&!r.clientId?{tone:"muted",symbol:"○",label:"Unclaimed"}:r&&!r.online?{tone:"warning",symbol:"⚠",label:"Computer offline"}:s==="error"?{tone:"danger",symbol:"●",label:"Error"}:s==="working"?{tone:"neutral",symbol:"●",label:"Working"}:s==="idle"?{tone:"neutral",symbol:"●",label:"Idle"}:{tone:"neutral",symbol:"●",label:"Online"}}function k3(e){if(!e)return"—";const a=new Date(e).getTime(),r=Date.now()-a;if(!Number.isFinite(r)||r<0)return ca(e);const s=Math.floor(r/6e4);if(s<1)return"just now";if(s<60)return`${s}m ago`;const o=Math.floor(s/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}function z3(e){const{agent:a,cfg:r,clientStatus:s,runtimeType:o,activeSessions:c,isHuman:m}=e,h=A3(e),g=[];!m&&o&&g.push(o),!m&&typeof c=="number"&&g.push(`${c} session${c===1?"":"s"}`),r&&g.push(`config v${r.version}`);const p=s==null?void 0:s.offlineSince,b=!m&&s&&!s.online;return u.jsxs("div",{className:je("rounded-md border px-4 py-3 text-sm space-y-1",_3(h.tone)),children:[u.jsxs("div",{className:"flex items-center gap-2 font-medium",children:[u.jsx("span",{className:je("inline-block h-2 w-2 rounded-full",C3(h.tone)),"aria-hidden":!0}),u.jsx("span",{children:h.symbol==="⚠"?h.symbol:null}),u.jsx("span",{children:h.label}),g.length>0&&u.jsxs("span",{className:"text-muted-foreground font-normal",children:["· ",g.join(" · ")]})]}),!m&&u.jsx("div",{className:"text-xs text-muted-foreground",children:s!=null&&s.clientId?u.jsxs(u.Fragment,{children:["Computer ",u.jsx("span",{className:"font-mono",children:s.clientId}),s.online?null:u.jsxs(u.Fragment,{children:[" · offline since ",u.jsx("span",{children:ca(p)})]})]}):u.jsx("span",{children:"No computer bound yet"})}),r&&u.jsxs("div",{className:"text-xs text-muted-foreground",children:["Config updated by ",u.jsx("span",{className:"font-medium",children:r.updatedBy||"—"})," · ",k3(r.updatedAt)]}),b&&u.jsx("p",{className:"mt-1 text-xs text-amber-900",children:"Changes saved here won't take effect until the computer reconnects."}),!m&&!(s!=null&&s.clientId)&&a.status==="active"&&u.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Configure now; it will apply when a computer claims this agent."})]})}function T3(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 R3(e,a){let r=a.size+1;for(;a.has(`${e}-${r}`);)r++;return`${e}-${r}`}function O3(e,a){return JSON.stringify(e)===JSON.stringify(a)}function Cm(e,a){return e.map((r,s)=>({key:`${a}-${s+1}`,value:r,baseline:r,status:"unchanged"}))}function gx(e){return e.map(a=>a.status==="deleted"?a:a.baseline==null?{...a,status:"added"}:O3(a.value,a.baseline)?{...a,status:"unchanged"}:{...a,status:"modified"})}function Am(e,a){const r=e;return{add:s=>a(o=>{const c=o[e],m=new Set(c.map(p=>p.key)),h=R3(r,m),g=[...c,{key:h,value:s,baseline:null,status:"added"}];return{...o,[e]:gx(g)}}),update:(s,o)=>a(c=>{const h=c[e].map(g=>g.key===s?{...g,value:o}:g);return{...c,[e]:gx(h)}}),remove:s=>a(o=>{const m=o[e].map(h=>h.key!==s?h:h.baseline==null?null:{...h,status:"deleted"}).filter(h=>h!==null);return{...o,[e]:m}}),undo:s=>a(o=>{const m=o[e].map(h=>h.key!==s||h.baseline==null?h:{...h,value:h.baseline,status:"unchanged"});return{...o,[e]:m}})}}function M3(e){return{promptAppend:e.payload.prompt.append,model:e.payload.model,mcp:Cm(e.payload.mcpServers,"mcp"),env:Cm(e.payload.env,"env"),git:Cm(e.payload.gitRepos,"git")}}function D3(e){const[a,r]=v.useState(null);v.useEffect(()=>{e&&a===null&&r(M3(e))},[e,a]);const s=a??{promptAppend:"",model:"",mcp:[],env:[],git:[]},o=(e==null?void 0:e.payload.prompt.append)??"",c=(e==null?void 0:e.payload.model)??"",m=s.promptAppend!==o,h=s.model!==c,g=v.useMemo(()=>{const D=[],O=K=>K.reduce((se,Se)=>Se.status==="unchanged"?se:se+1,0),P=O(s.mcp),I=O(s.env),L=O(s.git);return m&&D.push("prompt"),h&&D.push("model"),P>0&&D.push("mcp"),I>0&&D.push("env"),L>0&&D.push("git"),{anyDirty:D.length>0,dirtySections:D,counts:{prompt:m?1:0,model:h?1:0,mcp:P,env:I,git:L}}},[s,m,h]),p=v.useCallback(D=>{r(O=>O&&D(O))},[]),b=v.useCallback(D=>p(O=>({...O,promptAppend:D})),[p]),x=v.useCallback(()=>p(D=>({...D,promptAppend:o})),[p,o]),j=v.useCallback(D=>p(O=>({...O,model:D})),[p]),N=v.useCallback(()=>p(D=>({...D,model:c})),[p,c]),z=v.useMemo(()=>Am("mcp",p),[p]),w=v.useMemo(()=>Am("env",p),[p]),E=v.useMemo(()=>Am("git",p),[p]),M=v.useCallback(()=>{r(null)},[]),Z=v.useCallback(()=>{if(!a||!e)return{};const D={};m&&(D.prompt={append:a.promptAppend}),h&&(D.model=a.model);const O=g.counts.mcp>0,P=g.counts.env>0,I=g.counts.git>0;return O&&(D.mcpServers=a.mcp.filter(L=>L.status!=="deleted").map(L=>L.value)),P&&(D.env=a.env.filter(L=>L.status!=="deleted").map(L=>{const K=L.value;return K.sensitive&&K.value===sh?{key:K.key,value:sh,sensitive:!0}:K})),I&&(D.gitRepos=a.git.filter(L=>L.status!=="deleted").map(L=>L.value)),D},[a,e,m,h,g]);return{draft:s,summary:g,promptDirty:m,modelDirty:h,setPromptAppend:b,revertPrompt:x,setModel:j,revertModel:N,addMcp:z.add,updateMcp:z.update,deleteMcp:z.remove,undoDeleteMcp:z.undo,addEnv:w.add,updateEnv:w.update,deleteEnv:w.remove,undoDeleteEnv:w.undo,addGit:E.add,updateGit:E.update,deleteGit:E.remove,undoDeleteGit:E.undo,resetAll:M,buildPayloadPatch:Z}}const U3=Object.values(Y4);function L3(){var No,Eo,Pr,Vr,Kr,Wn,Yr,Ka,_o;const a=LE().uuid??"",r=Qa(),s=Zn(),o=Ie({queryKey:["agent",a],queryFn:()=>BS(a),enabled:!!a}),c=Ie({queryKey:["agent-config",a],queryFn:()=>l3(a),enabled:!!a&&((No=o.data)==null?void 0:No.type)!=="human"}),m=Ie({queryKey:["agent-client-status",a],queryFn:()=>o3(a),enabled:!!a&&((Eo=o.data)==null?void 0:Eo.type)!=="human"}),h=Ie({queryKey:["agent-sessions-active",a],queryFn:()=>Js(a,{state:"active"}),enabled:!!a&&((Pr=o.data)==null?void 0:Pr.type)!=="human"}),g=Ie({queryKey:["adapters"],queryFn:U1}),p=Ie({queryKey:["adapter-mappings"],queryFn:M1}),{data:b}=Ie({queryKey:["adapter-statuses"],queryFn:D1,refetchInterval:15e3}),x=((Vr=g.data)==null?void 0:Vr.filter(W=>W.agentId===a))??[],j=((Kr=p.data)==null?void 0:Kr.filter(W=>W.agentId===a))??[],N=D3(c.data),[z,w]=v.useState(null),[E,M]=v.useState(null),Z=st({mutationFn:async()=>{if(!c.data)throw new Error("config not loaded");const W=N.buildPayloadPatch();return s3(a,{expectedVersion:c.data.version,payload:W})},onSuccess:W=>{s.setQueryData(["agent-config",a],W),w(null),M(null)},onError:W=>{if(W instanceof Sc&&W.status===409){M("Someone else saved a newer version while you were editing."),w(null);return}w(W instanceof Error?W.message:String(W))}}),D=v.useCallback(()=>{M(null),w(null),s.invalidateQueries({queryKey:["agent-config",a]}),N.resetAll()},[s,a,N]),O=v.useCallback(W=>{const $e=document.getElementById(hl(W));$e&&$e.scrollIntoView({behavior:"smooth",block:"start"})},[]),P=st({mutationFn:W=>qb(a,W),onSuccess:()=>{s.invalidateQueries({queryKey:["agent",a]}),s.invalidateQueries({queryKey:["agents"]})}}),I=st({mutationFn:()=>ez(a),onSuccess:()=>s.invalidateQueries({queryKey:["agent",a]})}),L=st({mutationFn:()=>tz(a),onSuccess:()=>s.invalidateQueries({queryKey:["agent",a]})}),K=st({mutationFn:()=>Wk(a),onSuccess:()=>r("/agents")}),se=st({mutationFn:()=>nz(a)}),[Se,_e]=v.useState(!1),re=v.useRef(null);v.useEffect(()=>{if(!Se)return;function W($e){re.current&&!re.current.contains($e.target)&&_e(!1)}return window.addEventListener("mousedown",W),()=>window.removeEventListener("mousedown",W)},[Se]);const[ve,Te]=v.useState(!1),[we,Q]=v.useState(""),[te,ce]=v.useState(null),Ce=Ie({queryKey:["clients"],queryFn:Nc,enabled:ve}),ae=st({mutationFn:W=>qb(a,{clientId:W}),onSuccess:()=>{s.invalidateQueries({queryKey:["agent",a]}),s.invalidateQueries({queryKey:["agent-client-status",a]}),s.invalidateQueries({queryKey:["agents"]}),Te(!1),Q(""),ce(null)},onError:W=>ce(W instanceof Error?W.message:String(W))}),[T,k]=v.useState(!1),[V,ee]=v.useState(null),[H,ne]=v.useState(km),[fe,Me]=v.useState(""),pe=st({mutationFn:async()=>{const W=vx(H);if(!W)throw new Error("Credentials are required");return qM({platform:H.platform,agentId:a,credentials:W,status:H.status})},onSuccess:()=>{s.invalidateQueries({queryKey:["adapters"]}),Qr()}}),Dt=st({mutationFn:()=>{if(!V)throw new Error("No adapter selected");const W={status:H.status},$e=vx(H);return $e&&(W.credentials=$e),HM(V,W)},onSuccess:()=>{s.invalidateQueries({queryKey:["adapters"]}),Qr()}}),jn=st({mutationFn:IM,onSuccess:()=>s.invalidateQueries({queryKey:["adapters"]})}),wn=st({mutationFn:()=>BM({platform:H.platform,externalUserId:H.externalUserId,agentId:a,boundVia:"manual",displayName:H.displayName||void 0}),onSuccess:()=>{s.invalidateQueries({queryKey:["adapter-mappings"]}),Qr()}}),da=st({mutationFn:ZM,onSuccess:()=>s.invalidateQueries({queryKey:["adapter-mappings"]})}),[Qt,Ml]=v.useState(null),Ir=st({mutationFn:()=>i3(a,N.buildPayloadPatch()),onSuccess:W=>{const $e=W.diff.length?W.diff.map(Kt=>`${Kt.op} ${Kt.path}`).join(`
|
|
333
|
+
`):"(no changes)";Ml($e)},onError:W=>Ml(`Dry run failed: ${W instanceof Error?W.message:String(W)}`)});if(v.useEffect(()=>{if(!N.summary.anyDirty)return;const W=$e=>{$e.preventDefault(),$e.returnValue=""};return window.addEventListener("beforeunload",W),()=>window.removeEventListener("beforeunload",W)},[N.summary.anyDirty]),o.isLoading)return u.jsx("div",{className:"text-muted-foreground",children:"Loading..."});if(o.error)return u.jsxs("div",{className:"text-destructive",children:["Failed to load agent: ",o.error instanceof Error?o.error.message:"Unknown error"]});const xt=o.data;if(!xt)return u.jsx("div",{className:"text-muted-foreground",children:"Agent not found"});const qt=xt.type==="human",Qn=m.data,Dl=((Wn=h.data)==null?void 0:Wn.length)??0,Ul=!qt&&!(Qn!=null&&Qn.clientId),Uc=!qt&&Qn?!Qn.online&&!!Qn.clientId:!1,So=xt,Gt=So.runtimeState??null,Lc=So.runtimeType??null;function Qr(){k(!1),ee(null),ne(km),Me("")}function jo(W){ee(W.id),ne({...km,platform:W.platform,status:W.status}),k(!0)}function Ll(W){if(W.preventDefault(),Me(""),qt){if(!H.externalUserId)return;wn.mutate();return}if(H.platform==="feishu"){if(!V&&(!H.feishuAppId||!H.feishuAppSecret)){Me("App ID and App Secret are required");return}}else if(H.platform==="kael"){if(!V&&(!H.kaelUserId||!H.kaelProjectId)){Me("User ID and Project ID are required");return}}else{const $e=H.credentialsJson.trim();if(!V&&!$e){Me("Credentials are required");return}if($e)try{JSON.parse($e)}catch{Me("Invalid JSON");return}}V?Dt.mutate():pe.mutate()}const wo=pe.error??Dt.error??wn.error,ei=pe.isPending||Dt.isPending||wn.isPending,$c=T3({activeSessions:Dl,isUnclaimed:Ul,isOffline:Uc}),Bc=N.draft.mcp.filter(W=>W.status!=="deleted"),Gr=N.draft.env.filter(W=>W.status!=="deleted"),Pt=N.draft.git.filter(W=>W.status!=="deleted"),Jn=W=>new Set(Bc.filter($e=>$e.key!==W).map($e=>$e.value.name.toLowerCase())),Vt=W=>new Set(Gr.filter($e=>$e.key!==W).map($e=>$e.value.key)),Zc=W=>new Set(Pt.filter($e=>$e.key!==W).map($e=>{const{value:Kt}=$e;return Kt.localPath?Kt.localPath:((Kt.url.split(/[?#]/)[0]??"").split(/[/:]/).filter(Boolean).pop()??"").replace(/\.git$/i,"")}).filter(Boolean));return u.jsxs("div",{className:"space-y-5 pb-24",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx(he,{variant:"ghost",size:"icon",onClick:()=>r("/agents"),children:u.jsx(I_,{className:"h-4 w-4"})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("h1",{className:"text-2xl font-semibold truncate",children:xt.displayName??xt.name}),u.jsxs("p",{className:"text-xs text-muted-foreground font-mono truncate",children:["@",xt.name??xt.uuid," · ",xt.type]})]}),u.jsxs("div",{className:"relative",ref:re,children:[u.jsx(he,{variant:"outline",size:"icon",onClick:()=>_e(W=>!W),title:"More actions",children:u.jsx(x0,{className:"h-4 w-4"})}),Se&&u.jsx("div",{className:"absolute right-0 mt-1 z-40 min-w-48 rounded-md border bg-white shadow-lg text-sm",children:u.jsxs("ul",{className:"py-1",children:[!qt&&xt.status==="active"&&u.jsx("li",{children:u.jsxs("button",{type:"button",onClick:()=>{_e(!1),se.reset(),se.mutate()},className:"w-full text-left px-3 py-1.5 hover:bg-gray-50 flex items-center gap-2",disabled:se.isPending,children:[u.jsx(w0,{className:"h-3.5 w-3.5"}),se.isPending?"Testing…":"Test connection"]})}),xt.status==="active"?u.jsx("li",{children:u.jsx("button",{type:"button",onClick:()=>{_e(!1),confirm("Suspend this agent? All tokens will be revoked.")&&I.mutate()},className:"w-full text-left px-3 py-1.5 hover:bg-gray-50",children:"Suspend"})}):u.jsx("li",{children:u.jsx("button",{type:"button",onClick:()=>{_e(!1),L.mutate()},className:"w-full text-left px-3 py-1.5 hover:bg-gray-50",children:"Reactivate"})}),u.jsx("li",{className:"border-t",children:u.jsx("a",{href:`#${hl("prompt")}`,onClick:()=>_e(!1),className:"block px-3 py-1.5 text-xs text-muted-foreground hover:bg-gray-50",children:"Jump to Behavior"})})]})})]})]}),(se.data||se.error)&&u.jsx(H3,{result:se.data??{status:"error",message:"Failed to reach server"},onDismiss:()=>se.reset()}),u.jsx(z3,{agent:xt,cfg:c.data,clientStatus:Qn,runtimeState:Gt,runtimeType:Lc,activeSessions:Dl,isHuman:qt}),Ul&&xt.status==="active"&&u.jsxs("div",{className:"rounded-md border border-amber-300 bg-amber-50 px-4 py-3 flex items-center justify-between gap-3",children:[u.jsxs("div",{className:"text-sm text-amber-900",children:[u.jsx("div",{className:"font-medium",children:"No computer bound"}),u.jsx("div",{className:"text-xs text-amber-800/80",children:"Bind this agent to a computer so it can run. A computer will also claim it on first WebSocket connect."})]}),u.jsxs(he,{size:"sm",variant:"outline",onClick:()=>Te(!0),children:[u.jsx(vb,{className:"h-4 w-4 mr-2"}),"Bind Computer"]})]}),u.jsx(v3,{agent:xt,onSave:async W=>{await P.mutateAsync(W)}}),!qt&&u.jsxs($3,{loaded:!!c.data,loading:c.isLoading,error:c.error?String(c.error):null,version:((Yr=c.data)==null?void 0:Yr.version)??null,dirty:N.summary.anyDirty,children:[u.jsx("div",{id:hl("prompt"),children:u.jsx(w3,{value:N.draft.promptAppend,baseline:((Ka=c.data)==null?void 0:Ka.payload.prompt.append)??"",onChange:N.setPromptAppend,onRevert:N.revertPrompt,disabled:xt.status!=="active"})}),u.jsx("div",{id:hl("model"),children:u.jsx(j3,{value:N.draft.model,baseline:((_o=c.data)==null?void 0:_o.payload.model)??"",onChange:N.setModel,onRevert:N.revertModel,disabled:xt.status!=="active"})}),u.jsx("div",{id:hl("mcp"),children:u.jsx(b3,{items:N.draft.mcp,otherNames:Jn,onAdd:N.addMcp,onUpdate:N.updateMcp,onDelete:N.deleteMcp,onUndoDelete:N.undoDeleteMcp,disabled:xt.status!=="active"})}),u.jsx("div",{id:hl("env"),children:u.jsx(m3,{items:N.draft.env,otherKeys:Vt,onAdd:N.addEnv,onUpdate:N.updateEnv,onDelete:N.deleteEnv,onUndoDelete:N.undoDeleteEnv,disabled:xt.status!=="active"})}),u.jsx("div",{id:hl("git"),children:u.jsx(p3,{items:N.draft.git,otherPaths:Zc,onAdd:N.addGit,onUpdate:N.updateGit,onDelete:N.deleteGit,onUndoDelete:N.undoDeleteGit,disabled:xt.status!=="active"})}),Qt&&u.jsx("pre",{className:"whitespace-pre-wrap rounded border bg-gray-50 p-2 text-xs",children:Qt})]}),u.jsxs(Al,{children:[u.jsxs(Ps,{className:"flex flex-row items-center justify-between",children:[u.jsxs(Vs,{className:"flex items-center gap-2 text-base",children:[qt?u.jsx(vb,{className:"h-4 w-4"}):u.jsx(Y_,{className:"h-4 w-4"}),"Platform Bindings"]}),u.jsxs(he,{size:"sm",variant:"outline",onClick:()=>k(!0),children:[u.jsx(zl,{className:"h-4 w-4 mr-2"}),qt?"Bind User":"Bind Bot"]})]}),u.jsx(kl,{children:qt?u.jsxs(qa,{children:[u.jsx(Ha,{children:u.jsxs(lt,{children:[u.jsx(Ne,{children:"Platform"}),u.jsx(Ne,{children:"External User ID"}),u.jsx(Ne,{children:"Display Name"}),u.jsx(Ne,{children:"Bound Via"}),u.jsx(Ne,{children:"Created"}),u.jsx(Ne,{className:"w-16"})]})}),u.jsx(Ia,{children:j.length===0?u.jsx(lt,{children:u.jsx(xe,{colSpan:6,className:"text-center py-4 text-muted-foreground",children:"No platform bindings"})}):j.map(W=>u.jsxs(lt,{children:[u.jsx(xe,{children:u.jsx(Wt,{variant:"secondary",children:W.platform})}),u.jsx(xe,{className:"font-mono text-sm",children:W.externalUserId}),u.jsx(xe,{children:W.displayName??"—"}),u.jsx(xe,{children:u.jsx(Wt,{variant:"outline",children:W.boundVia??"—"})}),u.jsx(xe,{className:"text-muted-foreground",children:ca(W.createdAt)}),u.jsx(xe,{children:u.jsx(he,{variant:"ghost",size:"icon",onClick:()=>{confirm("Remove this binding?")&&da.mutate(W.id)},disabled:da.isPending,children:u.jsx(ao,{className:"h-4 w-4"})})})]},W.id))})]}):u.jsxs(qa,{children:[u.jsx(Ha,{children:u.jsxs(lt,{children:[u.jsx(Ne,{children:"Platform"}),u.jsx(Ne,{children:"Status"}),u.jsx(Ne,{children:"Connection"}),u.jsx(Ne,{children:"Created"}),u.jsx(Ne,{className:"w-24"})]})}),u.jsx(Ia,{children:x.length===0?u.jsx(lt,{children:u.jsx(xe,{colSpan:5,className:"text-center py-4 text-muted-foreground",children:"No platform bindings"})}):x.map(W=>{const $e=b==null?void 0:b.find(Co=>Co.configId===W.id),Kt=W.platform==="kael"?W.status==="active":!!($e!=null&&$e.connected);return u.jsxs(lt,{children:[u.jsx(xe,{children:u.jsx(Wt,{variant:"secondary",children:W.platform})}),u.jsx(xe,{children:u.jsx(Wt,{variant:W.status==="active"?"default":"destructive",children:W.status})}),u.jsx(xe,{children:u.jsxs("span",{className:"flex items-center gap-1.5",children:[u.jsx("span",{className:je("inline-block h-2 w-2 rounded-full",Kt?"bg-green-500":"bg-gray-300")}),u.jsx("span",{className:"text-xs text-muted-foreground",children:Kt?"Online":"Offline"})]})}),u.jsx(xe,{className:"text-muted-foreground",children:ca(W.createdAt)}),u.jsx(xe,{children:u.jsxs("div",{className:"flex gap-1",children:[u.jsx(he,{variant:"ghost",size:"icon",onClick:()=>jo(W),title:"Edit",children:"…"}),u.jsx(he,{variant:"ghost",size:"icon",onClick:()=>{confirm("Remove this bot binding?")&&jn.mutate(W.id)},disabled:jn.isPending,title:"Delete",children:u.jsx(ao,{className:"h-4 w-4"})})]})})]},W.id)})})]})})]}),u.jsx(u3,{agent:xt,suspendPending:I.isPending,reactivatePending:L.isPending,deletePending:K.isPending,onSuspend:()=>{confirm("Suspend this agent? Runtime binds and HTTP calls will be refused.")&&I.mutate()},onReactivate:()=>L.mutate(),onDelete:()=>K.mutate()}),!qt&&u.jsx(E3,{summary:N.summary,saveHint:$c,conflictMessage:E,errorMessage:z,saving:Z.isPending,onSave:()=>Z.mutate(),onDiscard:()=>{(!N.summary.anyDirty||confirm("Discard all unsaved changes?"))&&(N.resetAll(),w(null),M(null))},onReloadRemote:D,onJumpTo:O}),!qt&&N.summary.anyDirty&&u.jsx("div",{className:"text-xs text-muted-foreground",children:u.jsx("button",{type:"button",onClick:()=>Ir.mutate(),className:"underline hover:text-gray-900",disabled:Ir.isPending,children:Ir.isPending?"Computing dry-run…":"Preview server-side diff"})}),u.jsx(Ln,{open:ve,onOpenChange:W=>{Te(W),W||(Q(""),ce(null),ae.reset())},children:u.jsxs(xn,{children:[u.jsx(Fn,{children:u.jsx(Bn,{children:"Bind computer"})}),u.jsxs("div",{className:"space-y-4",children:[u.jsx("p",{className:"text-sm text-muted-foreground",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."}),Ce.isLoading?u.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading computers…"}):Ce.error?u.jsxs("div",{className:"text-sm text-destructive",children:["Failed to load computers: ",Ce.error instanceof Error?Ce.error.message:"Unknown"]}):u.jsx(B3,{clients:Ce.data??[],selected:we,onSelect:Q}),te&&u.jsx("div",{className:"text-sm text-destructive",children:te})]}),u.jsxs($n,{children:[u.jsx(he,{variant:"outline",onClick:()=>Te(!1),children:"Cancel"}),u.jsx(he,{disabled:!we||ae.isPending,onClick:()=>{ce(null),ae.mutate(we)},children:ae.isPending?"Binding…":"Bind"})]})]})}),u.jsx(Ln,{open:T,onOpenChange:W=>W?k(!0):Qr(),children:u.jsxs(xn,{children:[u.jsx(Fn,{children:u.jsx(Bn,{children:qt?"Bind External User":V?"Edit Bot Binding":"Bind Bot"})}),u.jsxs("form",{onSubmit:Ll,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(Ye,{htmlFor:"binding-platform",children:"Platform"}),u.jsx("select",{id:"binding-platform",value:H.platform,onChange:W=>ne({...H,platform:W.target.value}),disabled:!!V,className:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50",children:U3.map(W=>u.jsx("option",{value:W,children:W},W))})]}),qt?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(Ye,{htmlFor:"binding-ext-id",children:"External User ID"}),u.jsx(ct,{id:"binding-ext-id",value:H.externalUserId,onChange:W=>ne({...H,externalUserId:W.target.value}),placeholder:"ou_xxxxxxxx...",className:"font-mono",required:!0})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(Ye,{htmlFor:"binding-name",children:"Display Name (optional)"}),u.jsx(ct,{id:"binding-name",value:H.displayName,onChange:W=>ne({...H,displayName:W.target.value})})]})]}):u.jsxs(u.Fragment,{children:[H.platform==="feishu"?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"space-y-2",children:[u.jsxs(Ye,{htmlFor:"feishu-app-id",children:["App ID",V?" — leave empty to keep existing":""]}),u.jsx(ct,{id:"feishu-app-id",value:H.feishuAppId,onChange:W=>ne({...H,feishuAppId:W.target.value}),placeholder:"cli_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsxs(Ye,{htmlFor:"feishu-app-secret",children:["App Secret",V?" — leave empty to keep existing":""]}),u.jsx(ct,{id:"feishu-app-secret",type:"password",autoComplete:"new-password",value:H.feishuAppSecret,onChange:W=>ne({...H,feishuAppSecret:W.target.value}),placeholder:"••••••••"})]})]}):H.platform==="kael"?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"space-y-2",children:[u.jsxs(Ye,{htmlFor:"kael-user-id",children:["User ID",V?" — leave empty to keep existing":""]}),u.jsx(ct,{id:"kael-user-id",value:H.kaelUserId,onChange:W=>ne({...H,kaelUserId:W.target.value}),placeholder:"user_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsxs(Ye,{htmlFor:"kael-project-id",children:["Project ID",V?" — leave empty to keep existing":""]}),u.jsx(ct,{id:"kael-project-id",value:H.kaelProjectId,onChange:W=>ne({...H,kaelProjectId:W.target.value}),placeholder:"proj_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),!V&&u.jsx("p",{className:"text-sm text-muted-foreground",children:"Agent Token will be created automatically when you save."})]}):u.jsxs("div",{className:"space-y-2",children:[u.jsxs(Ye,{htmlFor:"binding-creds",children:["Credentials (JSON)",V?" — leave empty to keep existing":""]}),u.jsx("textarea",{id:"binding-creds",value:H.credentialsJson,onChange:W=>ne({...H,credentialsJson:W.target.value}),rows:4,className:"flex w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm font-mono focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",placeholder:'{"bot_token": "xoxb-...", "signing_secret": "..."}'})]}),fe&&u.jsx("p",{className:"text-sm text-destructive",children:fe}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(Ye,{htmlFor:"binding-status",children:"Status"}),u.jsxs("select",{id:"binding-status",value:H.status,onChange:W=>ne({...H,status:W.target.value}),className:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[u.jsx("option",{value:"active",children:"active"}),u.jsx("option",{value:"inactive",children:"inactive"})]})]})]}),wo instanceof Error&&u.jsx("div",{className:"text-sm text-destructive",children:wo.message}),u.jsx($n,{children:u.jsx(he,{type:"submit",disabled:ei,children:ei?"Saving...":V?"Update":"Create"})})]})]})})]})}function $3(e){return u.jsxs("section",{className:"space-y-3",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("h2",{className:"text-base font-semibold",children:"Behavior"}),u.jsxs("div",{className:"text-xs text-muted-foreground",children:[e.version!=null&&u.jsxs("span",{children:["v",e.version]}),e.dirty&&u.jsx("span",{className:"ml-2 text-amber-700",children:"· draft"})]})]}),e.loading&&u.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading configuration…"}),e.error&&u.jsxs("div",{className:"text-sm text-destructive",children:["Failed to load configuration: ",e.error]}),e.loaded&&u.jsx("div",{className:"space-y-3",children:e.children})]})}const km={platform:"feishu",feishuAppId:"",feishuAppSecret:"",credentialsJson:"{}",status:"active",externalUserId:"",displayName:"",kaelUserId:"",kaelProjectId:"",kaelAgentToken:""};function vx(e){if(e.platform==="feishu"){if(!e.feishuAppId&&!e.feishuAppSecret)return null;if(!e.feishuAppId||!e.feishuAppSecret)throw new Error("Both App ID and App Secret are required");return{app_id:e.feishuAppId,app_secret:e.feishuAppSecret}}if(e.platform==="kael"){if(!e.kaelUserId&&!e.kaelProjectId)return null;if(!e.kaelUserId||!e.kaelProjectId)throw new Error("User ID and Project ID are required");return{kaelUserId:e.kaelUserId,kaelProjectId:e.kaelProjectId}}const a=e.credentialsJson.trim();return a?JSON.parse(a):null}function B3({clients:e,selected:a,onSelect:r}){const s=e.filter(o=>o.status==="connected");return s.length===0?u.jsxs("div",{className:"rounded border bg-muted/40 px-3 py-4 text-sm text-muted-foreground",children:["No connected computers available. Run"," ",u.jsx("code",{className:"font-mono text-xs",children:"first-tree-hub client connect <url>"})," on the computer that should run this agent, then reopen this dialog."]}):u.jsx("ul",{className:"divide-y rounded border max-h-64 overflow-y-auto",children:s.map(o=>{const c=o.id===a,m=o.status==="online"||o.status==="active";return u.jsx("li",{children:u.jsxs("button",{type:"button",onClick:()=>r(o.id),className:je("w-full text-left px-3 py-2 flex items-center gap-3 hover:bg-gray-50",c&&"bg-blue-50"),children:[u.jsx("span",{className:je("inline-block h-2 w-2 rounded-full",m?"bg-green-500":"bg-gray-400"),"aria-hidden":!0}),u.jsxs("span",{className:"flex-1 min-w-0",children:[u.jsx("span",{className:"block text-sm font-medium truncate",children:o.hostname??o.id}),u.jsxs("span",{className:"block text-xs text-muted-foreground font-mono truncate",children:[o.id,o.os?` · ${o.os}`:"",o.sdkVersion?` · SDK ${o.sdkVersion}`:""]})]}),u.jsx("span",{className:"text-xs text-muted-foreground",children:o.status})]})},o.id)})})}const Z3={success:"Connected",timeout:"Timed out",offline:"Offline",stale:"Stale",error:"Error"},q3={connected:{icon:"●",color:"text-green-500",label:"Connected"},stale:{icon:"◐",color:"text-yellow-500",label:"Stale"},disconnected:{icon:"○",color:"text-gray-400",label:"Disconnected"}};function H3({result:e,onDismiss:a}){const r={success:"border-l-green-500",timeout:"border-l-yellow-500",offline:"border-l-gray-400",stale:"border-l-yellow-500",error:"border-l-red-500"}[e.status],s=e.status==="success"?"default":e.status==="timeout"||e.status==="stale"?"secondary":"destructive",o=e.connection,c=o?q3[o.health]:null;return u.jsx(Al,{className:je("border-l-4",r),children:u.jsx(kl,{className:"pt-4",children:u.jsxs("div",{className:"flex items-start justify-between",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Wt,{variant:s,children:Z3[e.status]}),e.responseTime!=null&&u.jsxs("span",{className:"text-xs text-muted-foreground",children:[(e.responseTime/1e3).toFixed(1),"s"]})]}),e.message&&u.jsx("p",{className:"text-sm text-muted-foreground",children:e.message}),o&&u.jsxs("div",{className:"text-xs space-y-1 border-t pt-2 mt-1",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[c&&u.jsxs("span",{className:c.color,children:[c.icon," ",c.label]}),o.runtimeState&&u.jsxs("span",{className:"text-muted-foreground",children:["runtime: ",o.runtimeState]})]}),o.client?u.jsxs("div",{className:"text-muted-foreground",children:["Computer: ",o.client.hostname??o.client.id,o.client.os&&` (${o.client.os})`,o.client.sdkVersion&&` · SDK ${o.client.sdkVersion}`]}):u.jsx("div",{className:"text-muted-foreground",children:"No computer bound"}),o.lastSeenAt&&u.jsxs("div",{className:"text-muted-foreground",children:["Last seen: ",new Date(o.lastSeenAt).toLocaleString()]})]}),e.responseContent&&u.jsx("p",{className:"text-sm mt-2 whitespace-pre-wrap bg-muted rounded p-2 max-h-40 overflow-auto",children:e.responseContent})]}),u.jsx(he,{variant:"ghost",size:"sm",onClick:a,children:"Dismiss"})]})})})}function uo({state:e,size:a=8,className:r}){const s={width:a,height:a,display:"inline-block",position:"relative",flexShrink:0};return e==="working"?u.jsxs("span",{className:je("shrink-0",r),style:s,role:"img","aria-label":"working",children:[u.jsx("span",{style:{position:"absolute",inset:0,borderRadius:"50%",background:"var(--state-working)"}}),u.jsx("span",{style:{position:"absolute",inset:-3,borderRadius:"50%",border:"1px solid var(--state-working)",animation:"ring-pulse 1.8s infinite",opacity:.6}})]}):e==="blocked"?u.jsx("span",{className:je("shrink-0",r),style:{...s,border:"1.5px dashed var(--state-blocked)",borderRadius:"50%",animation:"dash-spin 4s linear infinite"},role:"img","aria-label":"blocked",children:u.jsx("span",{style:{position:"absolute",inset:2,borderRadius:"50%",background:"var(--state-blocked)"}})}):e==="error"?u.jsx("span",{className:je("shrink-0",r),style:{...s,background:"var(--state-error)",clipPath:"polygon(50% 0%, 100% 100%, 0% 100%)",borderRadius:1},role:"img","aria-label":"error"}):e==="idle"?u.jsx("span",{className:je("shrink-0",r),style:{...s,borderRadius:"50%",background:"var(--state-idle)"},role:"img","aria-label":"idle"}):u.jsx("span",{className:je("shrink-0",r),style:{...s,borderRadius:"50%",border:"1px solid var(--state-offline)",background:"transparent"},role:"img","aria-label":"offline"})}function I3(e){return/^[A-Za-z0-9_./:=-]+$/.test(e)?e:`'${e.replace(/'/g,"'\\''")}'`}function Q3({agent:e,open:a,onClose:r,onBound:s}){var x;const[o,c]=v.useState(!1),m=Ie({queryKey:["connect-token",e.uuid],queryFn:()=>Z0(),enabled:a,staleTime:6e4}),h=Ie({queryKey:["agent-poll",e.uuid],queryFn:()=>BS(e.uuid),enabled:a&&!e.clientId,refetchInterval:2e3});v.useEffect(()=>{const j=h.data;j!=null&&j.clientId&&s(j)},[h.data,s]);const g=((x=m.data)==null?void 0:x.command)??"",p=g&&e.name?`npm install -g @agent-team-foundation/first-tree-hub && first-tree-hub agent add ${I3(e.name)} --agent-id ${e.uuid} && `+g:g;function b(){p&&(navigator.clipboard.writeText(p),c(!0),setTimeout(()=>c(!1),2e3))}return u.jsx(Ln,{open:a,onOpenChange:j=>!j&&r(),children:u.jsxs(xn,{className:"max-w-lg",children:[u.jsx(Fn,{children:u.jsx(Bn,{children:"Last step — connect your computer"})}),u.jsxs("div",{className:"space-y-4",children:[u.jsx("p",{className:"text-sm text-muted-foreground",children:"Open a terminal on your computer and run this command. It installs the First Tree Hub CLI, signs your computer in, and keeps it online in the background."}),u.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-border bg-muted p-3",children:[u.jsx("code",{className:"flex-1 text-xs font-mono break-all select-all",children:p||"Generating command…"}),u.jsx(he,{variant:"outline",size:"icon",className:"shrink-0",onClick:b,disabled:!p,children:o?u.jsx(b0,{className:"h-4 w-4",style:{color:"var(--state-idle)"}}):u.jsx(Eh,{className:"h-4 w-4"})})]}),u.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[u.jsx(uo,{state:"working",size:8}),u.jsx("span",{children:"Waiting for your computer to connect…"})]}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"The command is good for 10 minutes. After it runs once, your computer stays online automatically — no need to keep this terminal open."})]}),u.jsx($n,{children:u.jsx(he,{variant:"outline",onClick:r,children:"Skip for now"})})]})})}const G3=/^[a-z0-9_-]+$/,zm=100;function P3(e){if(!e||e.length===0)return{};const a={},r=["name","displayName","clientId"];for(const s of e){const o=s.path[0];if(typeof o=="string"&&r.includes(o)){const c=o;a[c]||(a[c]=s.message)}else a._root=s.message}return a}function V3(e){return e.toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,100)}function K3({open:e,onOpenChange:a,onCreated:r}){const s=Zn(),[o,c]=v.useState(""),[m,h]=v.useState(!1),[g,p]=v.useState("claude-code"),[b,x]=v.useState("form"),[j,N]=v.useState([]),[z,w]=v.useState(null),[E,M]=v.useState(!1),[Z,D]=v.useState({});v.useEffect(()=>{e&&(c(""),h(!1),p("claude-code"),x("form"),N([]),w(null),M(!1),D({}))},[e]);const O=V3(o),P=st({mutationFn:async re=>{const ve=o.trim()||"Untitled assistant";return Jk({name:O||void 0,type:"personal_assistant",displayName:ve,clientId:re.clientId})},onSuccess:re=>{s.invalidateQueries({queryKey:["agents"]}),s.invalidateQueries({queryKey:["activity"]}),r(re,g)}}),L={...v.useMemo(()=>{const re=P.error;if(!re)return{};if(re instanceof Sc){const ve=P3(re.issues);return Object.keys(ve).length>0?ve:{_root:re.message}}return re instanceof Error?{_root:re.message}:{}},[P.error]),...Z};function K(){const re={};return O?O.length>zm?re.name=`Hub ID must be at most ${zm} characters (got ${O.length}).`:G3.test(O)||(re.name="Hub ID must contain only lowercase letters, digits, hyphens (-), and underscores (_)."):o.trim().length>0&&(re.name="Name must contain at least one letter or digit."),re}async function se(re){var Te,we;re.preventDefault();const ve=K();if(D(ve),!(Object.keys(ve).length>0)){if(g!=="claude-code"){P.mutate({clientId:void 0});return}M(!0);try{const te=(await Nc()).filter(Ce=>Ce.status==="connected");if(te.length===0){P.mutate({clientId:void 0});return}if(te.length===1){P.mutate({clientId:(Te=te[0])==null?void 0:Te.id});return}const ce=[...te].sort((Ce,ae)=>ae.lastSeenAt.localeCompare(Ce.lastSeenAt));N(ce),w(((we=ce[0])==null?void 0:we.id)??null),x("pick-computer")}catch{P.mutate({clientId:void 0})}finally{M(!1)}}}function Se(){z&&P.mutate({clientId:z})}const _e=o.trim().length>0&&!P.isPending&&!E;return b==="pick-computer"?u.jsx(Ln,{open:e,onOpenChange:a,children:u.jsxs(xn,{className:"max-w-lg",children:[u.jsx(Fn,{children:u.jsx(Bn,{children:"Choose a computer"})}),u.jsxs("div",{className:"space-y-4",children:[u.jsxs("p",{className:"text-sm text-muted-foreground",children:["Multiple computers are online. Pick where ",u.jsx("span",{className:"font-medium",children:o})," should run:"]}),u.jsx("div",{className:"space-y-2",children:j.map(re=>{const ve=z===re.id;return u.jsxs("label",{className:ve?"flex items-start gap-3 rounded-md border border-primary bg-primary/5 p-3 cursor-pointer":"flex items-start gap-3 rounded-md border border-border p-3 cursor-pointer hover:bg-accent/30",children:[u.jsx("input",{type:"radio",name:"target-computer",checked:ve,onChange:()=>w(re.id),className:"mt-1"}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-sm font-medium truncate",children:re.hostname??re.id}),u.jsxs("div",{className:"text-xs text-muted-foreground",children:[re.os??"unknown OS"," · last seen ",new Date(re.lastSeenAt).toLocaleString()]})]})]},re.id)})}),L.clientId&&u.jsx("p",{className:"text-sm text-destructive",children:L.clientId}),L._root&&u.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-sm text-destructive",children:L._root})]}),u.jsxs($n,{children:[u.jsx(he,{variant:"outline",onClick:()=>x("form"),disabled:P.isPending,children:"Back"}),u.jsx(he,{onClick:Se,disabled:!z||P.isPending,children:P.isPending?"Creating…":"Create"})]})]})}):u.jsx(Ln,{open:e,onOpenChange:a,children:u.jsxs(xn,{className:"max-w-lg",children:[u.jsx(Fn,{children:u.jsx(Bn,{children:"New Agent"})}),u.jsxs("form",{onSubmit:se,className:"space-y-5",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(Ye,{htmlFor:"new-agent-name",children:"Name"}),u.jsx(ct,{id:"new-agent-name",value:o,onChange:re=>{c(re.target.value),h(!0),Z.name&&D(ve=>({...ve,name:void 0}))},placeholder:"My Dev Assistant",autoFocus:!0,maxLength:80,"aria-invalid":L.name?!0:void 0,"aria-describedby":"new-agent-name-help new-agent-name-error"}),u.jsxs("p",{id:"new-agent-name-help",className:"text-xs text-muted-foreground",children:["Any text — we'll derive a hub ID (lowercase letters, digits, hyphens, underscores; up to ",zm," chars) automatically."]}),m&&O&&u.jsxs("p",{className:"text-xs text-muted-foreground",children:["ID on hub: ",u.jsx("span",{className:"font-mono",children:O})]}),L.name&&u.jsx("p",{id:"new-agent-name-error",className:"text-xs text-destructive",children:L.name})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(Ye,{children:"Where it runs"}),u.jsxs("div",{className:"space-y-2",children:[u.jsxs("label",{className:g==="claude-code"?"flex items-start gap-3 rounded-md border border-primary bg-primary/5 p-3 cursor-pointer":"flex items-start gap-3 rounded-md border border-border p-3 cursor-pointer hover:bg-accent/30",children:[u.jsx("input",{type:"radio",name:"runtime",checked:g==="claude-code",onChange:()=>p("claude-code"),className:"mt-1"}),u.jsxs("div",{children:[u.jsx("div",{className:"text-sm font-medium",children:"Claude Code"}),u.jsx("div",{className:"text-xs text-muted-foreground",children:"Runs on your computer, can access your local files. (default)"})]})]}),u.jsxs("label",{className:"flex items-start gap-3 rounded-md border border-border p-3 cursor-not-allowed opacity-60",title:"Coming soon",children:[u.jsx("input",{type:"radio",name:"runtime",disabled:!0,className:"mt-1"}),u.jsxs("div",{children:[u.jsxs("div",{className:"text-sm font-medium",children:["Kael ",u.jsx("span",{className:"ml-1 text-xs font-normal text-muted-foreground",children:"— coming soon"})]}),u.jsx("div",{className:"text-xs text-muted-foreground",children:"Ready to go, runs in the cloud."})]})]})]})]}),L._root&&u.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-sm text-destructive",children:L._root}),u.jsx($n,{children:u.jsx(he,{type:"submit",disabled:!_e,children:E?"Checking computers…":P.isPending?"Creating…":"Create"})})]})]})})}const Y3=Object.values(J4);function yx(e){return[...e].sort((a,r)=>{const s=(a.name??a.displayName??"").toLowerCase(),o=(r.name??r.displayName??"").toLowerCase();return s.localeCompare(o)})}function F3(){const e=Qa(),{memberId:a}=yo(),[r,s]=v.useState(),[o,c]=v.useState(""),[m,h]=v.useState(!1),[g,p]=v.useState(null),b=Va(),x=q1(),{data:j,isLoading:N,error:z}=Ie({queryKey:["agents",r,o],queryFn:()=>Oh({limit:100,cursor:r,type:o||void 0})}),{myAgents:w,teamAgents:E}=v.useMemo(()=>{if(!(j!=null&&j.items))return{myAgents:[],teamAgents:[]};const D=[],O=[];for(const P of j.items)a&&P.managerId===a?D.push(P):O.push(P);return{myAgents:yx(D),teamAgents:yx(O)}},[j,a]);function M(D,O){if(h(!1),D.clientId){e(`/?a=${D.uuid}`);return}if(O==="claude-code"){p(D);return}e(`/?a=${D.uuid}`)}function Z(D){const P=D.runtimeState,I={idle:"bg-green-500",working:"bg-blue-500",error:"bg-red-500"};return u.jsxs(lt,{className:"cursor-pointer",onClick:()=>e(`/agents/${D.uuid}`),children:[u.jsx(xe,{className:"font-mono text-sm",children:D.name}),u.jsx(xe,{children:D.displayName??"—"}),u.jsx(xe,{children:u.jsx(Wt,{variant:"secondary",children:D.type})}),u.jsx(xe,{className:"font-mono text-sm text-muted-foreground",children:D.delegateMention?b(D.delegateMention):"—"}),u.jsx(xe,{className:"text-sm text-muted-foreground",children:x(D.managerId)}),u.jsx(xe,{children:P?u.jsxs("span",{className:"flex items-center gap-1.5",children:[u.jsx("span",{className:je("inline-block h-2 w-2 rounded-full",I[P]??"bg-gray-300")}),u.jsx("span",{className:"text-xs text-muted-foreground",children:P})]}):u.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-gray-300",title:"not running"})}),u.jsx(xe,{children:u.jsx(Wt,{variant:D.status==="active"?"default":"destructive",children:D.status})}),u.jsx(xe,{className:"text-muted-foreground",children:ca(D.createdAt)})]},D.uuid)}return u.jsxs("div",{className:"space-y-8",children:[u.jsxs("div",{className:"flex items-center gap-4",children:[u.jsx("h1",{className:"text-2xl font-semibold",children:"Agents"}),u.jsxs("select",{value:o,onChange:D=>{c(D.target.value),s(void 0)},className:"h-8 rounded-md border border-input bg-transparent px-2 text-sm shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[u.jsx("option",{value:"",children:"All types"}),Y3.map(D=>u.jsx("option",{value:D,children:D},D))]})]}),N?u.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"Loading..."}):z?u.jsxs("div",{className:"text-center py-8 text-destructive",children:["Failed to load agents: ",z instanceof Error?z.message:"Unknown error"]}):u.jsxs(u.Fragment,{children:[u.jsxs("section",{children:[u.jsxs("div",{className:"flex items-center justify-between mb-3",children:[u.jsx("h2",{className:"text-lg font-medium",children:"My Agents"}),u.jsxs(he,{size:"sm",onClick:()=>h(!0),children:[u.jsx(zl,{className:"h-4 w-4 mr-2"}),"New Agent"]})]}),u.jsx("div",{className:"border rounded-lg",children:u.jsxs(qa,{children:[u.jsx(Ha,{children:u.jsxs(lt,{children:[u.jsx(Ne,{children:"Name"}),u.jsx(Ne,{children:"Display Name"}),u.jsx(Ne,{children:"Type"}),u.jsx(Ne,{children:"Delegate"}),u.jsx(Ne,{children:"Owner"}),u.jsx(Ne,{children:"Runtime"}),u.jsx(Ne,{children:"Status"}),u.jsx(Ne,{children:"Created"})]})}),u.jsx(Ia,{children:w.length===0?u.jsx(lt,{children:u.jsx(xe,{colSpan:8,className:"text-center py-8 text-muted-foreground",children:"No agents yet — create one to get started"})}):w.map(D=>Z(D))})]})})]}),E.length>0&&u.jsxs("section",{children:[u.jsx("h2",{className:"text-lg font-medium mb-3",children:"Team Agents"}),u.jsx("div",{className:"border rounded-lg",children:u.jsxs(qa,{children:[u.jsx(Ha,{children:u.jsxs(lt,{children:[u.jsx(Ne,{children:"Name"}),u.jsx(Ne,{children:"Display Name"}),u.jsx(Ne,{children:"Type"}),u.jsx(Ne,{children:"Delegate"}),u.jsx(Ne,{children:"Owner"}),u.jsx(Ne,{children:"Runtime"}),u.jsx(Ne,{children:"Status"}),u.jsx(Ne,{children:"Created"})]})}),u.jsx(Ia,{children:E.map(D=>Z(D))})]})})]})]}),(j==null?void 0:j.nextCursor)&&u.jsx("div",{className:"flex justify-end",children:u.jsx(he,{variant:"outline",onClick:()=>s(j.nextCursor??void 0),children:"Next Page"})}),u.jsx(K3,{open:m,onOpenChange:h,onCreated:M}),g&&u.jsx(Q3,{agent:g,open:g!==null,onClose:()=>{const D=g.uuid;p(null),e(`/?a=${D}`)},onBound:D=>{p(null),e(`/?a=${D.uuid}`)}})]})}function X3(e){return e==="idle"||e==="working"||e==="blocked"||e==="error"||e==="offline"}function Dc({state:e,className:a}){const r=e!==null&&X3(e)?e:"offline",s=r==="offline"?"var(--fg-3)":`var(--state-${r})`;return u.jsxs("span",{className:je("mono inline-flex items-center gap-1.5 uppercase tracking-wider",a),style:{fontSize:10,letterSpacing:.06,color:s},children:[u.jsx(uo,{state:r,size:7}),r]})}function J3(){const[e,a]=v.useState(null),[r,s]=v.useState(!1),o=st({mutationFn:Z0,onSuccess:m=>{a(m),s(!1)}}),c=async()=>{e&&(await navigator.clipboard.writeText(e.command),s(!0),setTimeout(()=>s(!1),2e3))};return e?u.jsxs("div",{className:"mb-4 p-3 border border-border rounded-lg bg-muted/30 space-y-2",children:[u.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[u.jsx(yb,{className:"h-4 w-4 shrink-0"}),u.jsxs("span",{children:["Run this command in your terminal (expires in ",e.expiresIn/60," min):"]})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("code",{className:"flex-1 text-xs bg-background border border-border rounded px-3 py-2 font-mono break-all select-all",children:e.command}),u.jsxs(he,{variant:"outline",size:"sm",onClick:c,className:"shrink-0",children:[r?u.jsx(b0,{className:"h-3 w-3 mr-1"}):u.jsx(Eh,{className:"h-3 w-3 mr-1"}),r?"Copied":"Copy"]})]}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"This token is single-use. Generate a new one if it expires."})]}):u.jsxs("div",{className:"flex items-center gap-3 mb-4 p-3 border border-border rounded-lg bg-muted/30",children:[u.jsx(yb,{className:"h-4 w-4 text-muted-foreground shrink-0"}),u.jsx("span",{className:"text-sm text-muted-foreground",children:"Connect a new computer to this Hub"}),u.jsx(he,{variant:"outline",size:"sm",onClick:()=>o.mutate(),disabled:o.isPending,children:o.isPending?"Generating...":"Generate Connect Command"})]})}function W3(){const e=Zn(),a=Va(),[r,s]=v.useState(null),[o,c]=v.useState(null),[m,h]=v.useState(null),[g,p]=v.useState(null),{data:b}=Ie({queryKey:["clients"],queryFn:Nc,refetchInterval:1e4}),{data:x}=Ie({queryKey:["activity"],queryFn:wc,refetchInterval:1e4}),j=st({mutationFn:_C,onSuccess:()=>{c(null),e.invalidateQueries({queryKey:["clients"]}),e.invalidateQueries({queryKey:["activity"]})}}),N=st({mutationFn:EC,onSuccess:()=>{h(null),p(null),e.invalidateQueries({queryKey:["clients"]}),e.invalidateQueries({queryKey:["activity"]})},onError:E=>{E instanceof Sc?p(E.message):p(E instanceof Error?E.message:String(E))}}),z=v.useMemo(()=>{const E=new Map;for(const M of(x==null?void 0:x.agents)??[]){if(!M.clientId)continue;const Z=E.get(M.clientId)??[];Z.push(M),E.set(M.clientId,Z)}return E},[x==null?void 0:x.agents]),w=E=>z.get(E)??[];return u.jsxs("div",{children:[u.jsx("h1",{className:"text-2xl font-semibold mb-4",children:"Computers"}),u.jsx(J3,{}),m&&u.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:u.jsxs("div",{className:"bg-card border border-border rounded-lg p-6 max-w-md w-full shadow-lg",children:[u.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Retire Computer"}),u.jsxs("p",{className:"text-sm text-muted-foreground mb-3",children:["Permanently remove"," ",u.jsx("span",{className:"font-medium text-foreground",children:m.hostname??m.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)."]}),w(m.id).length>0&&u.jsxs("div",{className:"mb-3 p-2 rounded bg-yellow-50 dark:bg-yellow-950/30 border border-yellow-200 dark:border-yellow-900",children:[u.jsx("div",{className:"text-xs font-medium text-yellow-900 dark:text-yellow-200 mb-1",children:"Agents currently bound to this computer (delete them first):"}),u.jsx("ul",{className:"text-sm space-y-0.5",children:w(m.id).map(E=>u.jsx("li",{className:"font-medium",children:a(E.agentId)},E.agentId))})]}),g&&u.jsx("div",{className:"mb-3 p-2 rounded bg-red-50 dark:bg-red-950/30 border border-red-200 dark:border-red-900 text-sm text-red-900 dark:text-red-200",children:g}),u.jsxs("div",{className:"flex justify-end gap-2",children:[u.jsx(he,{variant:"outline",size:"sm",onClick:()=>{h(null),p(null)},children:"Cancel"}),u.jsx(he,{variant:"destructive",size:"sm",onClick:()=>N.mutate(m.id),disabled:N.isPending,children:N.isPending?"Retiring...":"Retire"})]})]})}),o&&u.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:u.jsxs("div",{className:"bg-card border border-border rounded-lg p-6 max-w-md w-full shadow-lg",children:[u.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Disconnect Computer"}),u.jsxs("p",{className:"text-sm text-muted-foreground mb-3",children:["This will disconnect"," ",u.jsx("span",{className:"font-medium text-foreground",children:o.hostname??o.id.slice(0,8)})," ","and affect all bound agents:"]}),u.jsx("ul",{className:"mb-4 space-y-1",children:w(o.id).length===0?u.jsx("li",{className:"text-sm text-muted-foreground",children:"No bound agents"}):w(o.id).map(E=>u.jsxs("li",{className:"text-sm flex items-center gap-2",children:[u.jsx("span",{className:"font-medium",children:a(E.agentId)}),u.jsx(Dc,{state:E.runtimeState})]},E.agentId))}),u.jsxs("div",{className:"flex justify-end gap-2",children:[u.jsx(he,{variant:"outline",size:"sm",onClick:()=>c(null),children:"Cancel"}),u.jsx(he,{variant:"destructive",size:"sm",onClick:()=>j.mutate(o.id),disabled:j.isPending,children:j.isPending?"Disconnecting...":"Disconnect"})]})]})}),!b||b.length===0?u.jsx("div",{className:"text-center text-muted-foreground py-12",children:"No computers. Use the button above to generate a connect command."}):u.jsx("div",{className:"border rounded-lg overflow-hidden",children:u.jsxs(qa,{children:[u.jsx(Ha,{children:u.jsxs(lt,{children:[u.jsx(Ne,{className:"w-8"}),u.jsx(Ne,{children:"Hostname"}),u.jsx(Ne,{children:"OS"}),u.jsx(Ne,{children:"SDK"}),u.jsx(Ne,{children:"Agents"}),u.jsx(Ne,{children:"Connected"}),u.jsx(Ne,{children:"Status"}),u.jsx(Ne,{})]})}),u.jsx(Ia,{children:b.map(E=>{const M=r===E.id,Z=w(E.id);return u.jsx(eD,{client:E,boundAgents:Z,isExpanded:M,agentName:a,onToggle:()=>s(M?null:E.id),onDisconnect:()=>c(E),onRetire:()=>{p(null),h(E)}},E.id)})})]})})]})}function eD({client:e,boundAgents:a,isExpanded:r,agentName:s,onToggle:o,onDisconnect:c,onRetire:m}){return u.jsxs(u.Fragment,{children:[u.jsxs(lt,{className:"cursor-pointer hover:bg-accent/50",onClick:o,children:[u.jsx(xe,{className:"px-2",children:r?u.jsx(J_,{className:"h-4 w-4"}):u.jsx(e2,{className:"h-4 w-4"})}),u.jsx(xe,{className:"font-medium",children:e.hostname??"—"}),u.jsx(xe,{className:"text-muted-foreground",children:e.os??"—"}),u.jsx(xe,{className:"font-mono text-xs text-muted-foreground",children:e.sdkVersion??"—"}),u.jsx(xe,{children:e.agentCount}),u.jsx(xe,{className:"text-muted-foreground text-sm",children:e.connectedAt?ca(e.connectedAt):"—"}),u.jsx(xe,{children:u.jsx(Wt,{variant:e.status==="connected"?"default":"secondary",children:e.status})}),u.jsx(xe,{children:u.jsxs("div",{className:"flex gap-2 justify-end",children:[u.jsxs(he,{variant:"outline",size:"sm",onClick:h=>{h.stopPropagation(),c()},children:[u.jsx(O2,{className:"h-3 w-3 mr-1"}),"Disconnect"]}),u.jsxs(he,{variant:"outline",size:"sm",onClick:h=>{h.stopPropagation(),m()},children:[u.jsx(ao,{className:"h-3 w-3 mr-1"}),"Retire"]})]})})]}),r&&u.jsx(lt,{children:u.jsxs(xe,{colSpan:8,className:"bg-muted/30 px-8 py-3",children:[u.jsxs("div",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider mb-2",children:["Bound Agents (",a.length,")"]}),a.length===0?u.jsx("div",{className:"text-sm text-muted-foreground",children:"No agents bound to this computer"}):u.jsx("div",{className:"space-y-1",children:a.map(h=>u.jsxs("div",{className:"flex items-center gap-3 text-sm",children:[u.jsx("span",{className:"font-medium",children:s(h.agentId)}),u.jsx(Dc,{state:h.runtimeState}),u.jsx("span",{className:"text-xs text-muted-foreground",children:h.activeSessions!==null?`${h.activeSessions}/${h.totalSessions??0} sessions`:""})]},h.agentId))})]})})]})}function tD(){const{isAuthenticated:e,login:a}=yo(),[r,s]=v.useState(""),[o,c]=v.useState(""),[m,h]=v.useState(null),[g,p]=v.useState(!1);if(e)return u.jsx(s0,{to:"/",replace:!0});const b=async x=>{x.preventDefault(),h(null),p(!0);try{await a(r,o)}catch(j){h(j instanceof Error?j.message:"Login failed")}finally{p(!1)}};return u.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:u.jsxs(Al,{className:"w-full max-w-sm",children:[u.jsxs(Ps,{className:"text-center",children:[u.jsx(Vs,{className:"text-2xl",children:"First Tree"}),u.jsx($1,{children:"Sign in to your workspace"})]}),u.jsx(kl,{children:u.jsxs("form",{onSubmit:b,className:"space-y-4",children:[m&&u.jsx("div",{className:"rounded-md bg-destructive/10 p-3 text-sm text-destructive",children:m}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(Ye,{htmlFor:"username",children:"Username"}),u.jsx(ct,{id:"username",value:r,onChange:x=>s(x.target.value),required:!0,autoFocus:!0})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(Ye,{htmlFor:"password",children:"Password"}),u.jsx(ct,{id:"password",type:"password",value:o,onChange:x=>c(x.target.value),required:!0})]}),u.jsx(he,{type:"submit",className:"w-full",disabled:g,children:g?"Signing in...":"Sign in"})]})})]})})}function nD(e,a){return ke.post(`/admin/chats/${encodeURIComponent(e)}/messages`,{format:"text",content:a})}function aD(e){return ke.post(`/admin/agents/${encodeURIComponent(e)}/chats`,{})}function rD(e,a){const r=new URLSearchParams;r.set("limit",String(a.limit)),a!=null&&a.cursor&&r.set("cursor",a.cursor);const s=r.toString();return ke.get(`/admin/chats/${encodeURIComponent(e)}/messages${s?`?${s}`:""}`)}function H1(e,a){return a&&(e==="idle"||e==="working"||e==="blocked"||e==="error")?e:"offline"}function I1(e){const a=new Date(e);return new Intl.DateTimeFormat("en-GB",{hour:"2-digit",minute:"2-digit",hour12:!1}).format(a)}function lD(e){if(!e)return"—";const a=Date.now()-new Date(e).getTime(),r=Math.round(a/1e3);if(r<60)return`${r}s ago`;const s=Math.round(r/60);if(s<60)return`${s}m ago`;const o=Math.round(s/60);return o<24?`${o}h ago`:`${Math.round(o/24)}d ago`}function sD(e){return e>=1e3?`${(e/1e3).toFixed(1)}s`:`${e}ms`}function iD(e){if(e==null)return"";if(typeof e=="string")return e.length>60?`${e.slice(0,60)}…`:e;try{const a=JSON.stringify(e);return a.length>60?`${a.slice(0,60)}…`:a}catch{return"…"}}function oD({msg:e,myAgentId:a}){if(!a||e.senderId!==a)return null;const r=e.deliveryStatus??"sent";return r==="acked"?u.jsx("span",{className:"mono",style:{fontSize:9,color:"var(--accent)"},title:"Agent has started processing",children:"✓✓ read"}):r==="delivered"?u.jsx("span",{className:"mono",style:{fontSize:9,color:"var(--fg-3)"},title:"Delivered to agent inbox",children:"✓✓"}):u.jsx("span",{className:"mono",style:{fontSize:9,color:"var(--fg-4)"},title:"Sent",children:"✓ sent"})}function uD({agentId:e,chatId:a,session:r}){const s=Zn(),o=()=>s.invalidateQueries({queryKey:["session",e,a]}),c=st({mutationFn:()=>zC(e,a),onSuccess:o}),m=st({mutationFn:()=>TC(e,a),onSuccess:o}),h=st({mutationFn:()=>RC(e,a),onSuccess:o}),g=(r==null?void 0:r.state)==="active",p=(r==null?void 0:r.state)==="suspended",b=(r==null?void 0:r.state)==="evicted";return u.jsxs("div",{className:"inline-flex items-center",style:{gap:4,padding:4,border:"1px solid var(--border)",borderRadius:6,background:"var(--bg-sunken)"},children:[g&&u.jsxs("button",{type:"button",onClick:()=>c.mutate(),disabled:c.isPending,className:"inline-flex items-center transition-colors",style:{gap:6,padding:"4px 10px",fontSize:11,fontWeight:500,color:"var(--fg-2)",borderRadius:4},onMouseEnter:x=>x.currentTarget.style.background="var(--bg-hover)",onMouseLeave:x=>x.currentTarget.style.background="transparent",children:[u.jsx(p2,{className:"h-3 w-3"})," Suspend",u.jsx("span",{className:"kbd",style:{marginLeft:2},children:"⌘⇧P"})]}),p&&u.jsxs("button",{type:"button",onClick:()=>m.mutate(),disabled:m.isPending,className:"inline-flex items-center transition-colors",style:{gap:6,padding:"4px 10px",fontSize:11,fontWeight:500,color:"var(--fg-2)",borderRadius:4},onMouseEnter:x=>x.currentTarget.style.background="var(--bg-hover)",onMouseLeave:x=>x.currentTarget.style.background="transparent",children:[u.jsx(w0,{className:"h-3 w-3"})," Resume"]}),!b&&u.jsxs(u.Fragment,{children:[u.jsx("span",{style:{width:1,height:16,background:"var(--border)"}}),u.jsxs("button",{type:"button",onClick:()=>{window.confirm("Terminate this session?")&&h.mutate()},disabled:h.isPending,className:"inline-flex items-center transition-colors",style:{gap:6,padding:"4px 10px",fontSize:11,fontWeight:600,color:"var(--state-error)",background:"color-mix(in oklch, var(--state-error) 18%, transparent)",borderRadius:4},onMouseEnter:x=>x.currentTarget.style.background="color-mix(in oklch, var(--state-error) 28%, transparent)",onMouseLeave:x=>x.currentTarget.style.background="color-mix(in oklch, var(--state-error) 18%, transparent)",children:[u.jsx(w2,{className:"h-3 w-3"})," Terminate"]})]})]})}function cD({event:e}){const a=CC(e.payload);if(!a)return u.jsx("div",{className:"mono",style:{fontSize:11,color:"var(--fg-4)",padding:"4px 8px"},children:"invalid tool_call"});const r=a.status==="error",s=a.status==="pending",o=r?"var(--state-error)":s?"var(--state-blocked)":"var(--accent-dim)",c=r?"var(--state-error)":s?"var(--state-blocked)":"var(--fg-2)";return u.jsxs("div",{className:"mono grid items-center",style:{gridTemplateColumns:"auto 1fr auto auto",columnGap:10,fontSize:11,padding:"4px 8px",background:"var(--bg-sunken)",borderLeft:`2px solid ${o}`,borderRadius:"0 4px 4px 0"},children:[u.jsx("span",{style:{color:"var(--fg-3)"},children:"↳"}),u.jsxs("span",{className:"truncate",children:[u.jsx("span",{style:{color:"var(--fg)"},children:a.name}),u.jsxs("span",{style:{color:"var(--fg-3)"},children:["(",iD(a.args),")"]})]}),u.jsx("span",{style:{color:c,fontSize:10},children:a.status}),u.jsx("span",{style:{color:"var(--fg-4)",fontSize:10},children:a.durationMs!==void 0?sD(a.durationMs):""})]})}function dD({event:e}){const a=AC(e.payload),r=I1(e.createdAt);return u.jsxs("div",{style:{padding:"6px 10px",borderLeft:"2px solid var(--state-error)",background:"color-mix(in oklch, var(--state-error) 6%, transparent)",borderRadius:"0 4px 4px 0"},children:[u.jsxs("div",{className:"mono uppercase",style:{fontSize:10,letterSpacing:.08,color:"var(--state-error)"},children:["error · ",(a==null?void 0:a.source)??"unknown"," · ",r]}),u.jsx("div",{style:{marginTop:2,fontSize:11.5,color:"var(--fg-2)",whiteSpace:"pre-wrap"},children:(a==null?void 0:a.message)??"(invalid error payload)"})]})}function fD({name:e,isSelf:a}){const r=e.slice(0,2).toUpperCase();return u.jsx("div",{className:"mono",style:{width:20,height:20,borderRadius:4,display:"flex",alignItems:"center",justifyContent:"center",fontSize:9,fontWeight:700,flexShrink:0,background:a?"linear-gradient(135deg, var(--accent), oklch(0.58 0.14 170))":"var(--bg-active)",border:a?"none":"1px solid var(--border-strong)",color:a?"oklch(0.14 0.01 150)":"var(--fg-2)"},children:a?r:u.jsx(jc,{className:"h-3 w-3",style:{color:"var(--accent)"}})})}function mD({msg:e,myAgentId:a,agentNameFn:r}){const s=r(e.senderId),o=a===e.senderId;return u.jsxs("div",{className:"grid",style:{gridTemplateColumns:"20px 1fr",columnGap:8,padding:"6px 0"},children:[u.jsx(fD,{name:s,isSelf:o}),u.jsxs("div",{className:"min-w-0",children:[u.jsxs("div",{className:"flex items-baseline",style:{gap:8},children:[u.jsx("span",{className:"mono",style:{fontSize:12,fontWeight:600,color:o?"var(--fg)":"var(--accent)"},children:s}),u.jsx("span",{className:"mono",style:{fontSize:10,color:"var(--fg-4)"},children:I1(e.createdAt)}),u.jsx("span",{style:{marginLeft:"auto"},children:u.jsx(oD,{msg:e,myAgentId:a})})]}),u.jsx("div",{style:{fontSize:12.5,color:"var(--fg)",whiteSpace:"pre-wrap",marginTop:2,lineHeight:1.55},children:e.format==="text"?typeof e.content=="string"?e.content:JSON.stringify(e.content):u.jsx("pre",{className:"mono",style:{fontSize:11,background:"var(--bg-sunken)",padding:8,borderRadius:4,overflow:"auto",maxHeight:160},children:JSON.stringify(e.content,null,2)})})]})]})}function hD({agentId:e,chatId:a}){var D;const r=Zn(),s=Va(),{agentId:o}=yo(),[c,m]=v.useState(""),h=v.useRef(null),{data:g}=Ie({queryKey:["chat-messages",a],queryFn:()=>rD(a,{limit:50}),refetchInterval:5e3}),{data:p}=Ie({queryKey:["session-events",e,a],queryFn:()=>kC(e,a,{limit:200}),refetchInterval:5e3}),{data:b}=Ie({queryKey:["session",e,a],queryFn:()=>Js(e).then(O=>O.find(P=>P.chatId===a)??null),refetchInterval:5e3}),x=st({mutationFn:O=>nD(a,O),onSuccess:()=>{m(""),r.invalidateQueries({queryKey:["chat-messages",a]})}}),j=()=>{const O=c.trim();O&&x.mutate(O)},N=v.useMemo(()=>{const O=(g==null?void 0:g.items)??[],P=(p==null?void 0:p.items)??[],I=[...O.map(L=>({kind:"message",at:L.createdAt,key:`m-${L.id}`,data:L})),...P.map(L=>({kind:"event",at:L.createdAt,key:`e-${L.id}`,data:L}))];return I.sort((L,K)=>L.at.localeCompare(K.at)),I},[g,p]),z=N.length;v.useEffect(()=>{var O;z>0&&((O=h.current)==null||O.scrollIntoView({behavior:"smooth"}))},[z]);const w=s(e),E=(b==null?void 0:b.runtimeState)??"idle",M=H1((b==null?void 0:b.runtimeState)??null,e?"connected":null),Z=(b==null?void 0:b.messageCount)??((D=g==null?void 0:g.items)==null?void 0:D.length)??0;return u.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[u.jsxs("div",{className:"grid items-center shrink-0",style:{gridTemplateColumns:"1fr auto",gap:10,padding:"10px 14px",borderBottom:"1px solid var(--border)"},children:[u.jsxs("div",{className:"min-w-0",children:[u.jsxs("div",{className:"flex items-center",style:{gap:8},children:[u.jsx(uo,{state:M,size:8}),u.jsxs("span",{style:{fontSize:13,fontWeight:600,color:"var(--fg)"},children:["Chat · ",a.slice(0,8)]}),u.jsx("span",{className:"mono",style:{fontSize:10,color:"var(--fg-4)",padding:"1px 5px",border:"1px solid var(--border)",borderRadius:2},children:a})]}),u.jsxs("div",{className:"flex items-center",style:{fontSize:10.5,color:"var(--fg-3)",marginTop:4,gap:10},children:[u.jsx("span",{className:"mono",children:w}),u.jsx("span",{children:"·"}),u.jsxs("span",{children:["started ",lD((b==null?void 0:b.startedAt)??null)]}),u.jsx("span",{children:"·"}),u.jsxs("span",{children:[Z," msgs"]}),u.jsx("span",{children:"·"}),u.jsxs("span",{children:["runtime"," ",u.jsx("span",{className:"mono",style:{color:M==="error"?"var(--state-error)":"var(--fg-2)"},children:E})]})]})]}),u.jsx(uD,{agentId:e,chatId:a,session:b??null})]}),u.jsxs("div",{className:"flex-1 overflow-y-auto",style:{padding:"10px 14px"},children:[z===0&&u.jsxs("div",{className:"flex flex-col items-center",style:{color:"var(--fg-3)",fontSize:13,padding:"32px 0",gap:6},children:[u.jsx(S0,{className:"h-8 w-8",style:{opacity:.3}}),"Send a message to start the conversation"]}),u.jsx("div",{className:"flex flex-col",style:{gap:4},children:N.map(O=>O.kind==="event"?O.data.kind==="tool_call"?u.jsx(cD,{event:O.data},O.key):u.jsx(dD,{event:O.data},O.key):u.jsx(mD,{msg:O.data,myAgentId:o,agentNameFn:s},O.key))}),u.jsx("div",{ref:h})]}),u.jsxs("div",{className:"shrink-0",style:{padding:"10px 14px",borderTop:"1px solid var(--border)"},children:[u.jsxs("div",{style:{position:"relative",border:"1px solid var(--border)",borderRadius:6,background:"var(--bg-sunken)"},children:[u.jsx("textarea",{value:c,onChange:O=>m(O.target.value),placeholder:`Message @${w} · / for commands · @ to mention`,rows:2,onKeyDown:O=>{O.key==="Enter"&&!O.shiftKey&&(O.preventDefault(),j())},disabled:x.isPending,className:"w-full outline-none",style:{padding:"9px 12px 30px",fontSize:12.5,background:"transparent",border:"none",resize:"none",fontFamily:"var(--font-sans)",color:"var(--fg)"}}),u.jsxs("div",{className:"flex items-center justify-between",style:{position:"absolute",bottom:6,left:10,right:10,fontSize:10,color:"var(--fg-4)"},children:[u.jsxs("span",{className:"mono flex",style:{gap:8},children:[u.jsx("span",{children:"/suspend"}),u.jsx("span",{children:"/resume"}),u.jsx("span",{children:"/branch"}),u.jsx("span",{children:"/promote"})]}),u.jsxs("span",{className:"flex items-center",style:{gap:8},children:[u.jsxs("span",{children:[u.jsx("span",{className:"kbd",children:"⏎"})," send ",u.jsx("span",{className:"kbd",children:"⇧⏎"})," new line"]}),u.jsxs("button",{type:"button",onClick:j,disabled:x.isPending||!c.trim(),className:je("inline-flex items-center transition-colors",(x.isPending||!c.trim())&&"opacity-50 cursor-not-allowed"),style:{gap:6,padding:"4px 10px",fontSize:11,fontWeight:600,color:"oklch(0.14 0.01 150)",background:"var(--accent)",border:"1px solid var(--accent)",borderRadius:5},children:[u.jsx(S2,{className:"h-3 w-3"})," Send"]})]})]})]}),x.isError&&u.jsx("p",{className:"mono",style:{fontSize:11,color:"var(--state-error)",padding:"6px 2px 0"},children:x.error instanceof Error?x.error.message:"Failed to send"})]})]})}function pD(){return u.jsx("div",{className:"flex-1 flex items-center justify-center p-8",children:u.jsxs("div",{className:"text-center max-w-sm",children:[u.jsx(jc,{className:"h-10 w-10 mx-auto mb-3 text-primary opacity-60"}),u.jsx("div",{className:"text-sm font-medium mb-1",children:"Select a chat"}),u.jsx("div",{className:"text-xs text-muted-foreground",children:"Pick an agent from the roster to view its sessions, or open a chat to start collaborating."})]})})}function gD({selectedAgentId:e,selectedChatId:a}){return a&&e?u.jsx(hD,{agentId:e,chatId:a}):u.jsx(pD,{})}function Q1(){const{data:e}=Ie({queryKey:["clients"],queryFn:Nc,staleTime:1e4,refetchInterval:1e4});return v.useMemo(()=>{const a=e??[],r=new Map;for(const s of a)r.set(s.id,s);return{resolve:s=>s?r.get(s)??null:null,clients:a,connectedClients:a.filter(s=>s.status==="connected")}},[e])}function oh({children:e}){return u.jsx("div",{className:"mono uppercase",style:{fontSize:9,letterSpacing:.1,color:"var(--fg-4)",marginBottom:8},children:e})}function G1({children:e}){return u.jsx("div",{className:"grid",style:{gridTemplateColumns:"auto 1fr",columnGap:10,rowGap:4,fontSize:11.5},children:e})}function oa({label:e,children:a}){return u.jsxs(u.Fragment,{children:[u.jsx("div",{style:{color:"var(--fg-3)"},children:e}),u.jsx("div",{className:"text-right truncate",style:{color:"var(--fg)",overflow:"hidden",textOverflow:"ellipsis"},children:a})]})}function bx(e){if(!e)return"—";const a=Date.now()-new Date(e).getTime(),r=Math.round(a/1e3);if(r<60)return`${r}s ago`;const s=Math.round(r/60);if(s<60)return`${s}m ago`;const o=Math.round(s/60);return o<24?`${o}h ago`:`${Math.round(o/24)}d ago`}function xx(e){if(!e)return"—";const a=Date.now()-new Date(e).getTime(),r=Math.floor(a/6e4);if(r<60)return`${r}m`;const s=Math.floor(r/60);return s<24?`${s}h ${r%60}m`:`${Math.floor(s/24)}d ${s%24}h`}const vD={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 Tm({label:e,value:a,accent:r}){return u.jsxs("div",{style:{padding:"6px 8px",background:"var(--bg-sunken)",borderRadius:4},children:[u.jsx("div",{className:"mono uppercase",style:{fontSize:9,color:"var(--fg-4)",letterSpacing:.08},children:e}),u.jsx("div",{className:"mono",style:{fontSize:13,fontWeight:600,color:r??"var(--fg)"},children:a})]})}function yD({notifications:e,agentId:a}){const[,r]=m0(),s=Zn(),o=st({mutationFn:c=>ZS(c),onSuccess:()=>{s.invalidateQueries({queryKey:["notifications","agent",a]})}});return u.jsx("div",{className:"flex flex-col",style:{gap:4},children:e.map(c=>{const m=!!c.chatId,h=(vD[c.type]??c.type).toString(),g=c.severity==="high"?"var(--state-error)":c.severity==="medium"?"var(--state-blocked)":"var(--accent-dim)";return u.jsxs("button",{type:"button",className:je("w-full text-left transition-colors",m&&"cursor-pointer"),style:{padding:"6px 8px",background:c.read?"transparent":"var(--bg-sunken)",borderLeft:`2px solid ${g}`,borderRadius:"0 3px 3px 0",fontSize:11},onMouseEnter:p=>{m&&(p.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:p=>{p.currentTarget.style.background=c.read?"transparent":"var(--bg-sunken)"},onClick:()=>{c.read||o.mutate(c.id),c.chatId&&r({a,c:c.chatId})},children:[u.jsxs("div",{className:"flex items-baseline justify-between",children:[u.jsx("span",{className:"mono uppercase",style:{fontSize:9,letterSpacing:.08,color:c.severity==="high"?"var(--state-error)":"var(--fg-3)"},children:h.replace("_"," ")}),u.jsx("span",{className:"mono",style:{fontSize:9,color:"var(--fg-4)"},children:ca(c.createdAt)})]}),u.jsx("div",{style:{color:"var(--fg-2)",marginTop:1},children:c.message})]},c.id)})})}function P1({agentId:e}){var p;const a=Va(),{resolve:r}=Q1(),{data:s}=Ie({queryKey:["activity"],queryFn:wc,refetchInterval:1e4}),o=(p=s==null?void 0:s.agents)==null?void 0:p.find(b=>b.agentId===e),c=r(o==null?void 0:o.clientId),{data:m}=Ie({queryKey:["notifications","agent",e],queryFn:()=>nh({agentId:e,limit:3}),refetchInterval:3e4}),h=a(e),g=(o==null?void 0:o.runtimeState)??"offline";return u.jsxs("div",{className:"flex-1 overflow-y-auto",children:[u.jsxs("div",{style:{padding:"12px 14px",borderBottom:"1px solid var(--border-faint)"},children:[u.jsxs("div",{className:"flex items-center",style:{gap:10},children:[u.jsx("div",{className:"flex items-center justify-center",style:{width:32,height:32,borderRadius:5,background:"var(--bg-active)",border:"1px solid var(--border-strong)"},children:u.jsx(jc,{className:"h-4 w-4",style:{color:"var(--accent)"}})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{style:{fontSize:13,fontWeight:600,color:"var(--fg)"},children:h}),u.jsx("div",{className:"mono truncate",style:{fontSize:10,color:"var(--fg-4)"},children:e})]}),u.jsx(Dc,{state:g})]}),u.jsxs("div",{className:"grid",style:{gridTemplateColumns:"repeat(3, 1fr)",gap:4,marginTop:10},children:[u.jsx(Tm,{label:"sessions",value:(o==null?void 0:o.totalSessions)??0,accent:((o==null?void 0:o.totalSessions)??0)>0?"var(--fg)":"var(--fg-4)"}),u.jsx(Tm,{label:"active",value:(o==null?void 0:o.activeSessions)??0,accent:((o==null?void 0:o.activeSessions)??0)>0?"var(--accent)":"var(--fg-4)"}),u.jsx(Tm,{label:"uptime",value:xx((c==null?void 0:c.connectedAt)??null)})]})]}),u.jsxs("div",{style:{padding:"12px 14px",borderBottom:"1px solid var(--border-faint)"},children:[u.jsx(oh,{children:"Computer · runtime"}),u.jsxs(G1,{children:[u.jsx(oa,{label:"host",children:u.jsx("span",{className:"mono",style:{fontSize:11},children:(c==null?void 0:c.hostname)??"—"})}),u.jsx(oa,{label:"os",children:u.jsx("span",{className:"mono",style:{fontSize:11},children:(c==null?void 0:c.os)??"—"})}),u.jsx(oa,{label:"runtime",children:u.jsx("span",{className:"mono",children:(o==null?void 0:o.runtimeType)??"—"})}),u.jsx(oa,{label:"sdk",children:u.jsx("span",{className:"mono",style:{fontSize:11},children:(c==null?void 0:c.sdkVersion)??"—"})}),u.jsx(oa,{label:"connected",children:u.jsx("span",{className:"mono",style:{fontSize:11},children:xx((c==null?void 0:c.connectedAt)??null)})})]})]}),u.jsxs("div",{style:{padding:"10px 14px",borderBottom:"1px solid var(--border-faint)"},className:"flex flex-col",children:[u.jsx("a",{href:`/agents/${e}`,style:{fontSize:11,color:"var(--accent)"},className:"hover:underline",children:"Manage agent →"}),u.jsx("a",{href:"/admin#clients",style:{fontSize:11,color:"var(--accent)",marginTop:4},className:"hover:underline",children:"Admin · Computers →"})]}),u.jsxs("div",{style:{padding:"12px 14px"},children:[u.jsx(oh,{children:"Notifications"}),!(m!=null&&m.items)||m.items.length===0?u.jsx("div",{className:"text-center",style:{fontSize:11,color:"var(--fg-3)",padding:"12px 0"},children:"No notifications for this agent"}):u.jsx(yD,{notifications:m.items,agentId:e})]})]})}function bD({agentId:e,chatId:a}){const{data:r}=Ie({queryKey:["session",e,a],queryFn:()=>Js(e).then(s=>s.find(o=>o.chatId===a)??null),refetchInterval:5e3});return u.jsxs("div",{className:"flex flex-col overflow-hidden flex-1",children:[u.jsxs("div",{style:{padding:"12px 14px",borderBottom:"1px solid var(--border-faint)"},children:[u.jsx(oh,{children:"Session"}),u.jsxs(G1,{children:[u.jsx(oa,{label:"state",children:u.jsx(Dc,{state:(r==null?void 0:r.runtimeState)??(r==null?void 0:r.state)??null})}),u.jsx(oa,{label:"chat",children:u.jsx("span",{className:"mono",style:{fontSize:10.5},children:a.slice(0,12)})}),u.jsx(oa,{label:"started",children:bx((r==null?void 0:r.startedAt)??null)}),u.jsx(oa,{label:"last",children:bx((r==null?void 0:r.lastActivityAt)??null)}),u.jsx(oa,{label:"messages",children:u.jsx("span",{className:"mono",children:(r==null?void 0:r.messageCount)??0})})]})]}),u.jsx(P1,{agentId:e})]})}function xD({selectedAgentId:e,selectedChatId:a}){return a&&e?u.jsx(bD,{agentId:e,chatId:a}):e?u.jsx(P1,{agentId:e}):null}const SD=32;function jD({aggregated:e,stale:a,className:r}){const s=Math.max(1,...e.map(o=>o.workingCount));return u.jsx("div",{className:je("flex items-end gap-[2px]",a&&"opacity-40",r),style:{height:22},"aria-hidden":!0,children:Array.from({length:SD}).map((o,c)=>{const m=e[c]??{workingCount:0,errorMask:!1},h=m.workingCount===0?.08:m.workingCount/s,g=.25+h*.7,p=m.errorMask?"var(--state-error)":"var(--accent)";return u.jsx("span",{className:"flex-1",style:{height:`${Math.max(12,h*100)}%`,background:p,opacity:g,borderRadius:.5}},c)})})}const wD={error:0,blocked:1,working:2,idle:3};function ND(e,a){return a?e?wD[e]??4:4:5}function ED(e,a){return a==="all"?!0:a==="active"?e.runtimeState==="working":e.runtimeState==="blocked"||e.runtimeState==="error"}function _D({selectedAgentId:e,selectedChatId:a,onSelectAgent:r,onSelectChat:s}){const o=Va(),{resolve:c}=Q1(),m=Zn(),h=$M(),[g,p]=v.useState(""),[b,x]=v.useState("all"),{data:j}=Ie({queryKey:["activity"],queryFn:wc,refetchInterval:1e4}),{data:N}=Ie({queryKey:["agent-sessions",e],queryFn:()=>e?Js(e):Promise.resolve([]),enabled:!!e,refetchInterval:1e4}),z=st({mutationFn:I=>aD(I),onSuccess:(I,L)=>{m.invalidateQueries({queryKey:["agent-sessions",L]}),s(L,I.id)}}),{humans:w,agents:E,totalAll:M}=v.useMemo(()=>{const I=(j==null?void 0:j.agents)??[],L=g.trim().toLowerCase(),K=I.filter(re=>{var we;if(!ED(re,b))return!1;if(!L)return!0;const ve=o(re.agentId).toLowerCase(),Te=re.clientId?(((we=c(re.clientId))==null?void 0:we.hostname)??"").toLowerCase():"";return ve.includes(L)||Te.includes(L)||re.agentId.toLowerCase().includes(L)}),se=re=>ND(re.runtimeState,re.clientId),Se=[],_e=[];for(const re of K)(re.type==="human"?Se:_e).push(re);return Se.sort((re,ve)=>se(re)-se(ve)),_e.sort((re,ve)=>se(re)-se(ve)),{humans:Se,agents:_e,totalAll:I.length}},[j,g,b,o,c]),Z=v.useMemo(()=>{const I=(j==null?void 0:j.agents)??[];return{working:I.filter(L=>L.runtimeState==="working").length,blocked:I.filter(L=>L.runtimeState==="blocked").length,error:I.filter(L=>L.runtimeState==="error").length}},[j]),D=[{value:"all",label:"all",count:M},{value:"active",label:"active",count:Z.working},{value:"attn",label:"attn",count:Z.blocked+Z.error,warn:Z.blocked+Z.error>0}],O=I=>{var re;const L=e===I.agentId,K=H1(I.runtimeState,I.clientId),se=I.clientId?((re=c(I.clientId))==null?void 0:re.hostname)??I.clientId.slice(0,8):null,Se=I.activeSessions??0,_e=I.totalSessions??0;return u.jsxs("div",{style:{borderBottom:"1px solid var(--border-faint)"},children:[u.jsxs("button",{type:"button",onClick:()=>r(L?null:I.agentId),className:je("w-full text-left transition-colors grid items-center","hover:bg-[var(--bg-hover)]"),style:{gridTemplateColumns:"14px 1fr auto",columnGap:8,padding:"7px 10px 7px 12px",background:L?"var(--bg-active)":"transparent",borderLeft:`2px solid ${L?"var(--accent)":"transparent"}`},children:[u.jsx(uo,{state:K,size:8}),u.jsxs("div",{className:"min-w-0",children:[u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx("span",{className:"mono truncate",style:{fontSize:12,fontWeight:500,color:"var(--fg)",letterSpacing:-.1},children:o(I.agentId)}),I.type==="human"&&u.jsx("span",{className:"mono",style:{fontSize:9,padding:"1px 5px",borderRadius:2,textTransform:"uppercase",letterSpacing:.08,color:"var(--accent)",background:"color-mix(in oklch, var(--accent) 15%, transparent)"},children:"human"})]}),u.jsx("div",{className:"truncate",style:{fontSize:10.5,color:"var(--fg-3)"},children:K==="offline"?"disconnected":se||"—"})]}),u.jsx("div",{className:"flex flex-col items-end gap-0.5",children:_e>0&&u.jsxs("span",{className:"mono tnum",style:{fontSize:9,color:"var(--fg-3)"},children:[Se,u.jsxs("span",{style:{color:"var(--fg-4)"},children:[" / ",_e]})]})})]}),L&&u.jsxs("div",{style:{background:"var(--bg-sunken)",paddingBottom:4},children:[(!N||N.length===0)&&u.jsx("div",{style:{padding:"4px 10px 4px 28px",fontSize:10.5,color:"var(--fg-4)"},children:"No sessions yet"}),N==null?void 0:N.map(ve=>{const Te=ve.state==="active"?"working":ve.state==="suspended"?"idle":"offline";return u.jsxs("button",{type:"button",onClick:()=>s(I.agentId,ve.chatId),className:"w-full grid items-center text-left transition-colors",style:{gridTemplateColumns:"14px 1fr auto",columnGap:6,padding:"4px 10px 4px 28px",background:a===ve.chatId?"var(--bg-hover)":"transparent",color:ve.state==="active"?"var(--fg-2)":"var(--fg-3)"},onMouseEnter:we=>{a!==ve.chatId&&(we.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:we=>{a!==ve.chatId&&(we.currentTarget.style.background="transparent")},children:[u.jsx(uo,{state:Te,size:6}),u.jsx("span",{className:"truncate",style:{fontSize:11},children:ve.chatId.slice(0,8)}),u.jsx("span",{className:"mono",style:{fontSize:9,color:"var(--fg-4)"},children:ve.state})]},ve.chatId)}),u.jsxs("button",{type:"button",onClick:()=>z.mutate(I.agentId),disabled:z.isPending,className:"w-full flex items-center text-left transition-colors",style:{gap:6,padding:"4px 10px 4px 28px",fontSize:10.5,color:"var(--fg-3)"},onMouseEnter:ve=>{ve.currentTarget.style.background="var(--bg-hover)"},onMouseLeave:ve=>{ve.currentTarget.style.background="transparent"},children:[u.jsx(zl,{className:"h-3 w-3"}),"New chat"]})]})]},I.agentId)},P=w.length+E.length;return u.jsxs("aside",{className:"shrink-0 flex flex-col overflow-hidden",style:{width:268,background:"var(--bg-raised)",borderRight:"1px solid var(--border)"},children:[u.jsxs("div",{className:"shrink-0",style:{padding:"10px 12px 8px",borderBottom:"1px solid var(--border-faint)"},children:[u.jsx("div",{style:{marginBottom:8},children:u.jsxs("span",{className:"mono uppercase",style:{fontSize:10,color:"var(--fg-3)",letterSpacing:.08},children:[M," members"]})}),u.jsxs("div",{className:"relative",children:[u.jsx(_h,{className:"h-3.5 w-3.5 absolute pointer-events-none",style:{left:8,top:"50%",transform:"translateY(-50%)",color:"var(--fg-4)"}}),u.jsx("input",{value:g,onChange:I=>p(I.target.value),placeholder:"Filter…",className:"w-full outline-none",style:{padding:"5px 8px 5px 26px",fontSize:12,background:"var(--bg-sunken)",border:"1px solid var(--border)",borderRadius:4,color:"var(--fg)"}})]}),u.jsx("div",{className:"flex gap-1",style:{marginTop:8},children:D.map(I=>{const L=b===I.value;return u.jsxs("button",{type:"button",onClick:()=>x(I.value),className:"inline-flex items-center",style:{fontSize:10,padding:"3px 7px",borderRadius:3,gap:4,color:L?"var(--fg)":"var(--fg-3)",background:L?"var(--bg-active)":"transparent",border:`1px solid ${L?"var(--border-strong)":"var(--border)"}`},children:[I.label,u.jsx("span",{className:"mono",style:{color:I.warn&&I.count>0?"var(--state-error)":"var(--fg-4)"},children:I.count})]},I.value)})})]}),u.jsxs("div",{className:"shrink-0",style:{padding:"8px 12px",borderBottom:"1px solid var(--border-faint)"},children:[u.jsxs("div",{className:"flex items-center justify-between",style:{marginBottom:4},children:[u.jsxs("span",{className:"mono uppercase flex items-center gap-1.5",style:{fontSize:10,color:"var(--fg-3)",letterSpacing:.08},children:[u.jsx(CD,{}),"Pulse · 5m"]}),u.jsx("span",{className:"mono",style:{fontSize:10,color:"var(--fg-4)"},children:h.stale?"stale":"live"})]}),u.jsx(jD,{aggregated:h.aggregated,stale:h.stale}),u.jsxs("div",{className:"flex",style:{gap:10,marginTop:6,fontSize:10},children:[u.jsxs("span",{className:"mono",style:{color:"var(--state-working)"},children:["●",Z.working," working"]}),u.jsxs("span",{className:"mono",style:{color:"var(--state-blocked)"},children:["●",Z.blocked," blocked"]}),u.jsxs("span",{className:"mono",style:{color:"var(--state-error)"},children:["●",Z.error," error"]})]})]}),u.jsxs("div",{className:"flex-1 overflow-y-auto",children:[P===0&&u.jsx("div",{className:"text-center",style:{padding:"24px 12px",fontSize:12,color:"var(--fg-3)"},children:g||b!=="all"?"No matches":"No agents"}),E.length>0&&u.jsxs("div",{children:[u.jsx(Sx,{label:"Agents",count:E.length}),E.map(O)]}),w.length>0&&u.jsxs("div",{children:[u.jsx(Sx,{label:"Humans",count:w.length}),w.map(O)]})]})]})}function Sx({label:e,count:a}){return u.jsxs("div",{className:"mono uppercase sticky top-0 z-10",style:{padding:"5px 12px",fontSize:9,letterSpacing:.12,color:"var(--fg-4)",background:"var(--bg-raised)",borderBottom:"1px solid var(--border-faint)"},children:[e," · ",a]})}function CD(){return u.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",focusable:"false",style:{color:"var(--accent)"},children:[u.jsx("title",{children:"pulse"}),u.jsx("path",{d:"M1 8 h3 l1.5 -4 l3 8 l2 -4 h4.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]})}function AD(){const[e,a]=m0(),r=e.get("a"),s=e.get("c");R1();const o=v.useCallback(h=>{a(h?{a:h}:{})},[a]),c=v.useCallback((h,g)=>{a({a:h,c:g})},[a]),{data:m}=Ie({queryKey:["agent-sessions",r],queryFn:()=>r?Js(r):Promise.resolve([]),enabled:!!r&&!s});return v.useEffect(()=>{if(!r||s||!m||m.length===0)return;const h=[...m].sort((g,p)=>(p.lastActivityAt??"").localeCompare(g.lastActivityAt??""))[0];h&&a({a:r,c:h.chatId},{replace:!0})},[r,s,m,a]),u.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[u.jsx(_D,{selectedAgentId:r,selectedChatId:s,onSelectAgent:o,onSelectChat:c}),u.jsx("main",{className:"flex-1 flex flex-col overflow-hidden min-w-0",style:{background:"var(--bg)"},children:u.jsx(gD,{selectedAgentId:r,selectedChatId:s})}),r&&u.jsx("aside",{className:"shrink-0 flex flex-col overflow-hidden",style:{width:290,borderLeft:"1px solid var(--border)",background:"var(--bg-raised)"},children:u.jsx(xD,{selectedAgentId:r,selectedChatId:s})})]})}const kD=new ZN({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}});function zD(){return u.jsx(qN,{client:kD,children:u.jsx(D_,{children:u.jsx(w_,{children:u.jsxs(JE,{children:[u.jsx(Ra,{path:"/login",element:u.jsx(tD,{})}),u.jsx(Ra,{element:u.jsx(U_,{}),children:u.jsxs(Ra,{element:u.jsx(LM,{children:u.jsx(fz,{})}),children:[u.jsx(Ra,{index:!0,element:u.jsx(AD,{})}),u.jsx(Ra,{path:"agents",element:u.jsx(F3,{})}),u.jsx(Ra,{path:"agents/:uuid",element:u.jsx(L3,{})}),u.jsx(Ra,{path:"clients",element:u.jsx(W3,{})}),u.jsx(Ra,{path:"admin",element:u.jsx(r3,{})})]})})]})})})})}const V1=document.getElementById("root");if(!V1)throw new Error("Root element not found");pN.createRoot(V1).render(u.jsx(v.StrictMode,{children:u.jsx(zD,{})}));
|