agentdog 1.1.0 → 1.2.0
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/README.md +12 -12
- package/dist/adapters/http-sse-adapter.js +1 -1
- package/dist/adapters/http-sse-adapter.js.map +1 -1
- package/dist/adapters/stdio-adapter.js +1 -1
- package/dist/adapters/stdio-adapter.js.map +1 -1
- package/dist/adapters/streamable-http-adapter.js +1 -1
- package/dist/adapters/streamable-http-adapter.js.map +1 -1
- package/dist/ai-gateway/integration.test.js +1 -1
- package/dist/ai-gateway/integration.test.js.map +1 -1
- package/dist/cli/cli-main.d.ts +1 -1
- package/dist/cli/cli-main.js +1 -1
- package/dist/cli/cli-utils.js +5 -5
- package/dist/cli/cli-utils.js.map +1 -1
- package/dist/cli/commands/audit-commands.js +2 -2
- package/dist/cli/commands/audit-commands.js.map +1 -1
- package/dist/cli/commands/autostart-command.js +17 -17
- package/dist/cli/commands/autostart-command.js.map +1 -1
- package/dist/cli/commands/autostart-command.test.js +6 -6
- package/dist/cli/commands/autostart-command.test.js.map +1 -1
- package/dist/cli/commands/config-commands.js +17 -17
- package/dist/cli/commands/config-commands.js.map +1 -1
- package/dist/cli/commands/daemon-commands.d.ts +4 -4
- package/dist/cli/commands/daemon-commands.d.ts.map +1 -1
- package/dist/cli/commands/daemon-commands.js +19 -19
- package/dist/cli/commands/daemon-commands.js.map +1 -1
- package/dist/cli/commands/proxy-command.d.ts +2 -2
- package/dist/cli/commands/proxy-command.d.ts.map +1 -1
- package/dist/cli/commands/proxy-command.js +15 -15
- package/dist/cli/commands/proxy-command.js.map +1 -1
- package/dist/cli/commands/start-command.js +16 -16
- package/dist/cli/commands/start-command.js.map +1 -1
- package/dist/config/config-manager.d.ts +7 -7
- package/dist/config/config-manager.d.ts.map +1 -1
- package/dist/config/config-manager.js +15 -5
- package/dist/config/config-manager.js.map +1 -1
- package/dist/config/config-manager.test.js +5 -5
- package/dist/config/config-manager.test.js.map +1 -1
- package/dist/core/agentdog-server.d.ts +49 -0
- package/dist/core/agentdog-server.d.ts.map +1 -0
- package/dist/core/agentdog-server.js +552 -0
- package/dist/core/agentdog-server.js.map +1 -0
- package/dist/core/auto-config-generator.js +3 -3
- package/dist/core/auto-config-generator.js.map +1 -1
- package/dist/core/protocol-detector.d.ts.map +1 -1
- package/dist/core/protocol-detector.js +2 -2
- package/dist/core/protocol-detector.js.map +1 -1
- package/dist/daemon/agentdog-daemon.d.ts +42 -0
- package/dist/daemon/agentdog-daemon.d.ts.map +1 -0
- package/dist/daemon/agentdog-daemon.js +302 -0
- package/dist/daemon/agentdog-daemon.js.map +1 -0
- package/dist/daemon/daemon-client.d.ts +2 -2
- package/dist/daemon/daemon-client.js +3 -3
- package/dist/daemon/daemon-client.js.map +1 -1
- package/dist/daemon/daemon-client.test.js +2 -2
- package/dist/daemon/daemon-client.test.js.map +1 -1
- package/dist/daemon/daemon-info.test.js +1 -1
- package/dist/daemon/daemon-info.test.js.map +1 -1
- package/dist/daemon/daemon-web-server.ai.test.js +1 -1
- package/dist/daemon/daemon-web-server.ai.test.js.map +1 -1
- package/dist/daemon/daemon-web-server.d.ts +2 -2
- package/dist/daemon/daemon-web-server.d.ts.map +1 -1
- package/dist/daemon/daemon-web-server.js +2 -2
- package/dist/daemon/daemon-web-server.js.map +1 -1
- package/dist/daemon/daemon-web-server.test.js +2 -2
- package/dist/daemon/daemon-web-server.test.js.map +1 -1
- package/dist/daemon/stdio-proxy.js +3 -3
- package/dist/daemon/stdio-proxy.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -10
- package/dist/index.js.map +1 -1
- package/dist/intent-analyzer.js +3 -3
- package/dist/intent-analyzer.js.map +1 -1
- package/dist/mock-tool-database.js +1 -1
- package/dist/mock-tool-database.js.map +1 -1
- package/dist/proxy-server-manager.js +9 -9
- package/dist/proxy-server-manager.js.map +1 -1
- package/dist/router/tool-router.js +3 -3
- package/dist/router/tool-router.js.map +1 -1
- package/dist/streamable-http-server.d.ts.map +1 -1
- package/dist/streamable-http-server.js +6 -6
- package/dist/streamable-http-server.js.map +1 -1
- package/dist/types/index.d.ts +3 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/web/web-server.d.ts +2 -2
- package/dist/web/web-server.d.ts.map +1 -1
- package/dist/web/web-server.js +8 -8
- package/dist/web/web-server.js.map +1 -1
- package/package.json +2 -2
- package/web/dist/assets/index-BdEVyQ8g.js +118 -0
- package/web/dist/assets/index-BdEVyQ8g.js.map +1 -0
- package/web/dist/assets/index-Bsl7BWhF.css +1 -0
- package/web/dist/index.html +2 -2
- package/web/dist/assets/index-DMVhVtNU.css +0 -1
- package/web/dist/assets/index-VMXIgcOH.js +0 -92
- package/web/dist/assets/index-VMXIgcOH.js.map +0 -1
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
var Lf=Object.defineProperty;var Of=(e,t,n)=>t in e?Lf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var sa=(e,t,n)=>Of(e,typeof t!="symbol"?t+"":t,n);function Af(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const l=Object.getOwnPropertyDescriptor(r,s);l&&Object.defineProperty(e,s,l.get?l:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const i of l.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerPolicy&&(l.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?l.credentials="include":s.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(s){if(s.ep)return;s.ep=!0;const l=n(s);fetch(s.href,l)}})();function Mu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Iu={exports:{}},qs={},zu={exports:{}},z={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its 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 Lr=Symbol.for("react.element"),Mf=Symbol.for("react.portal"),If=Symbol.for("react.fragment"),zf=Symbol.for("react.strict_mode"),$f=Symbol.for("react.profiler"),Df=Symbol.for("react.provider"),Bf=Symbol.for("react.context"),Uf=Symbol.for("react.forward_ref"),Ff=Symbol.for("react.suspense"),Vf=Symbol.for("react.memo"),Wf=Symbol.for("react.lazy"),la=Symbol.iterator;function Hf(e){return e===null||typeof e!="object"?null:(e=la&&e[la]||e["@@iterator"],typeof e=="function"?e:null)}var $u={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Du=Object.assign,Bu={};function In(e,t,n){this.props=e,this.context=t,this.refs=Bu,this.updater=n||$u}In.prototype.isReactComponent={};In.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};In.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Uu(){}Uu.prototype=In.prototype;function ei(e,t,n){this.props=e,this.context=t,this.refs=Bu,this.updater=n||$u}var ti=ei.prototype=new Uu;ti.constructor=ei;Du(ti,In.prototype);ti.isPureReactComponent=!0;var oa=Array.isArray,Fu=Object.prototype.hasOwnProperty,ni={current:null},Vu={key:!0,ref:!0,__self:!0,__source:!0};function Wu(e,t,n){var r,s={},l=null,i=null;if(t!=null)for(r in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(l=""+t.key),t)Fu.call(t,r)&&!Vu.hasOwnProperty(r)&&(s[r]=t[r]);var a=arguments.length-2;if(a===1)s.children=n;else if(1<a){for(var u=Array(a),f=0;f<a;f++)u[f]=arguments[f+2];s.children=u}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)s[r]===void 0&&(s[r]=a[r]);return{$$typeof:Lr,type:e,key:l,ref:i,props:s,_owner:ni.current}}function qf(e,t){return{$$typeof:Lr,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function ri(e){return typeof e=="object"&&e!==null&&e.$$typeof===Lr}function Kf(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var ia=/\/+/g;function gl(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Kf(""+e.key):t.toString(36)}function ns(e,t,n,r,s){var l=typeof e;(l==="undefined"||l==="boolean")&&(e=null);var i=!1;if(e===null)i=!0;else switch(l){case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case Lr:case Mf:i=!0}}if(i)return i=e,s=s(i),e=r===""?"."+gl(i,0):r,oa(s)?(n="",e!=null&&(n=e.replace(ia,"$&/")+"/"),ns(s,t,n,"",function(f){return f})):s!=null&&(ri(s)&&(s=qf(s,n+(!s.key||i&&i.key===s.key?"":(""+s.key).replace(ia,"$&/")+"/")+e)),t.push(s)),1;if(i=0,r=r===""?".":r+":",oa(e))for(var a=0;a<e.length;a++){l=e[a];var u=r+gl(l,a);i+=ns(l,t,n,u,s)}else if(u=Hf(e),typeof u=="function")for(e=u.call(e),a=0;!(l=e.next()).done;)l=l.value,u=r+gl(l,a++),i+=ns(l,t,n,u,s);else if(l==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return i}function zr(e,t,n){if(e==null)return e;var r=[],s=0;return ns(e,r,"","",function(l){return t.call(n,l,s++)}),r}function Qf(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Se={current:null},rs={transition:null},Jf={ReactCurrentDispatcher:Se,ReactCurrentBatchConfig:rs,ReactCurrentOwner:ni};function Hu(){throw Error("act(...) is not supported in production builds of React.")}z.Children={map:zr,forEach:function(e,t,n){zr(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return zr(e,function(){t++}),t},toArray:function(e){return zr(e,function(t){return t})||[]},only:function(e){if(!ri(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};z.Component=In;z.Fragment=If;z.Profiler=$f;z.PureComponent=ei;z.StrictMode=zf;z.Suspense=Ff;z.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Jf;z.act=Hu;z.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=Du({},e.props),s=e.key,l=e.ref,i=e._owner;if(t!=null){if(t.ref!==void 0&&(l=t.ref,i=ni.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(u in t)Fu.call(t,u)&&!Vu.hasOwnProperty(u)&&(r[u]=t[u]===void 0&&a!==void 0?a[u]:t[u])}var u=arguments.length-2;if(u===1)r.children=n;else if(1<u){a=Array(u);for(var f=0;f<u;f++)a[f]=arguments[f+2];r.children=a}return{$$typeof:Lr,type:e.type,key:s,ref:l,props:r,_owner:i}};z.createContext=function(e){return e={$$typeof:Bf,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Df,_context:e},e.Consumer=e};z.createElement=Wu;z.createFactory=function(e){var t=Wu.bind(null,e);return t.type=e,t};z.createRef=function(){return{current:null}};z.forwardRef=function(e){return{$$typeof:Uf,render:e}};z.isValidElement=ri;z.lazy=function(e){return{$$typeof:Wf,_payload:{_status:-1,_result:e},_init:Qf}};z.memo=function(e,t){return{$$typeof:Vf,type:e,compare:t===void 0?null:t}};z.startTransition=function(e){var t=rs.transition;rs.transition={};try{e()}finally{rs.transition=t}};z.unstable_act=Hu;z.useCallback=function(e,t){return Se.current.useCallback(e,t)};z.useContext=function(e){return Se.current.useContext(e)};z.useDebugValue=function(){};z.useDeferredValue=function(e){return Se.current.useDeferredValue(e)};z.useEffect=function(e,t){return Se.current.useEffect(e,t)};z.useId=function(){return Se.current.useId()};z.useImperativeHandle=function(e,t,n){return Se.current.useImperativeHandle(e,t,n)};z.useInsertionEffect=function(e,t){return Se.current.useInsertionEffect(e,t)};z.useLayoutEffect=function(e,t){return Se.current.useLayoutEffect(e,t)};z.useMemo=function(e,t){return Se.current.useMemo(e,t)};z.useReducer=function(e,t,n){return Se.current.useReducer(e,t,n)};z.useRef=function(e){return Se.current.useRef(e)};z.useState=function(e){return Se.current.useState(e)};z.useSyncExternalStore=function(e,t,n){return Se.current.useSyncExternalStore(e,t,n)};z.useTransition=function(){return Se.current.useTransition()};z.version="18.3.1";zu.exports=z;var S=zu.exports;const Ks=Mu(S),Gf=Af({__proto__:null,default:Ks},[S]);/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its 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 Yf=S,Xf=Symbol.for("react.element"),Zf=Symbol.for("react.fragment"),eh=Object.prototype.hasOwnProperty,th=Yf.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,nh={key:!0,ref:!0,__self:!0,__source:!0};function qu(e,t,n){var r,s={},l=null,i=null;n!==void 0&&(l=""+n),t.key!==void 0&&(l=""+t.key),t.ref!==void 0&&(i=t.ref);for(r in t)eh.call(t,r)&&!nh.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)s[r]===void 0&&(s[r]=t[r]);return{$$typeof:Xf,type:e,key:l,ref:i,props:s,_owner:th.current}}qs.Fragment=Zf;qs.jsx=qu;qs.jsxs=qu;Iu.exports=qs;var o=Iu.exports,Gl={},Ku={exports:{}},Le={},Qu={exports:{}},Ju={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its 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
|
+
*/(function(e){function t(v,N){var j=v.length;v.push(N);e:for(;0<j;){var P=j-1>>>1,L=v[P];if(0<s(L,N))v[P]=N,v[j]=L,j=P;else break e}}function n(v){return v.length===0?null:v[0]}function r(v){if(v.length===0)return null;var N=v[0],j=v.pop();if(j!==N){v[0]=j;e:for(var P=0,L=v.length,M=L>>>1;P<M;){var U=2*(P+1)-1,G=v[U],H=U+1,he=v[H];if(0>s(G,j))H<L&&0>s(he,G)?(v[P]=he,v[H]=j,P=H):(v[P]=G,v[U]=j,P=U);else if(H<L&&0>s(he,j))v[P]=he,v[H]=j,P=H;else break e}}return N}function s(v,N){var j=v.sortIndex-N.sortIndex;return j!==0?j:v.id-N.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var i=Date,a=i.now();e.unstable_now=function(){return i.now()-a}}var u=[],f=[],m=1,p=null,c=3,x=!1,y=!1,w=!1,b=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,d=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function h(v){for(var N=n(f);N!==null;){if(N.callback===null)r(f);else if(N.startTime<=v)r(f),N.sortIndex=N.expirationTime,t(u,N);else break;N=n(f)}}function k(v){if(w=!1,h(v),!y)if(n(u)!==null)y=!0,gt(E);else{var N=n(f);N!==null&&T(k,N.startTime-v)}}function E(v,N){y=!1,w&&(w=!1,g(A),A=-1),x=!0;var j=c;try{for(h(N),p=n(u);p!==null&&(!(p.expirationTime>N)||v&&!ie());){var P=p.callback;if(typeof P=="function"){p.callback=null,c=p.priorityLevel;var L=P(p.expirationTime<=N);N=e.unstable_now(),typeof L=="function"?p.callback=L:p===n(u)&&r(u),h(N)}else r(u);p=n(u)}if(p!==null)var M=!0;else{var U=n(f);U!==null&&T(k,U.startTime-N),M=!1}return M}finally{p=null,c=j,x=!1}}var _=!1,R=null,A=-1,F=5,I=-1;function ie(){return!(e.unstable_now()-I<F)}function Je(){if(R!==null){var v=e.unstable_now();I=v;var N=!0;try{N=R(!0,v)}finally{N?rt():(_=!1,R=null)}}else _=!1}var rt;if(typeof d=="function")rt=function(){d(Je)};else if(typeof MessageChannel<"u"){var on=new MessageChannel,Vn=on.port2;on.port1.onmessage=Je,rt=function(){Vn.postMessage(null)}}else rt=function(){b(Je,0)};function gt(v){R=v,_||(_=!0,rt())}function T(v,N){A=b(function(){v(e.unstable_now())},N)}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(v){v.callback=null},e.unstable_continueExecution=function(){y||x||(y=!0,gt(E))},e.unstable_forceFrameRate=function(v){0>v||125<v?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<v?Math.floor(1e3/v):5},e.unstable_getCurrentPriorityLevel=function(){return c},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(v){switch(c){case 1:case 2:case 3:var N=3;break;default:N=c}var j=c;c=N;try{return v()}finally{c=j}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(v,N){switch(v){case 1:case 2:case 3:case 4:case 5:break;default:v=3}var j=c;c=v;try{return N()}finally{c=j}},e.unstable_scheduleCallback=function(v,N,j){var P=e.unstable_now();switch(typeof j=="object"&&j!==null?(j=j.delay,j=typeof j=="number"&&0<j?P+j:P):j=P,v){case 1:var L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=j+L,v={id:m++,callback:N,priorityLevel:v,startTime:j,expirationTime:L,sortIndex:-1},j>P?(v.sortIndex=j,t(f,v),n(u)===null&&v===n(f)&&(w?(g(A),A=-1):w=!0,T(k,j-P))):(v.sortIndex=L,t(u,v),y||x||(y=!0,gt(E))),v},e.unstable_shouldYield=ie,e.unstable_wrapCallback=function(v){var N=c;return function(){var j=c;c=N;try{return v.apply(this,arguments)}finally{c=j}}}})(Ju);Qu.exports=Ju;var rh=Qu.exports;/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.min.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Facebook, Inc. and its 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 sh=S,Re=rh;function C(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Gu=new Set,hr={};function sn(e,t){En(e,t),En(e+"Capture",t)}function En(e,t){for(hr[e]=t,e=0;e<t.length;e++)Gu.add(t[e])}var ut=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Yl=Object.prototype.hasOwnProperty,lh=/^[: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]*$/,aa={},ua={};function oh(e){return Yl.call(ua,e)?!0:Yl.call(aa,e)?!1:lh.test(e)?ua[e]=!0:(aa[e]=!0,!1)}function ih(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function ah(e,t,n,r){if(t===null||typeof t>"u"||ih(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Ne(e,t,n,r,s,l,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=l,this.removeEmptyString=i}var fe={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){fe[e]=new Ne(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];fe[t]=new Ne(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){fe[e]=new Ne(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){fe[e]=new Ne(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){fe[e]=new Ne(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){fe[e]=new Ne(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){fe[e]=new Ne(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){fe[e]=new Ne(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){fe[e]=new Ne(e,5,!1,e.toLowerCase(),null,!1,!1)});var si=/[\-:]([a-z])/g;function li(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(si,li);fe[t]=new Ne(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(si,li);fe[t]=new Ne(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(si,li);fe[t]=new Ne(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){fe[e]=new Ne(e,1,!1,e.toLowerCase(),null,!1,!1)});fe.xlinkHref=new Ne("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){fe[e]=new Ne(e,1,!1,e.toLowerCase(),null,!0,!0)});function oi(e,t,n,r){var s=fe.hasOwnProperty(t)?fe[t]:null;(s!==null?s.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(ah(t,n,s,r)&&(n=null),r||s===null?oh(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):s.mustUseProperty?e[s.propertyName]=n===null?s.type===3?!1:"":n:(t=s.attributeName,r=s.attributeNamespace,n===null?e.removeAttribute(t):(s=s.type,n=s===3||s===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var ht=sh.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,$r=Symbol.for("react.element"),un=Symbol.for("react.portal"),cn=Symbol.for("react.fragment"),ii=Symbol.for("react.strict_mode"),Xl=Symbol.for("react.profiler"),Yu=Symbol.for("react.provider"),Xu=Symbol.for("react.context"),ai=Symbol.for("react.forward_ref"),Zl=Symbol.for("react.suspense"),eo=Symbol.for("react.suspense_list"),ui=Symbol.for("react.memo"),xt=Symbol.for("react.lazy"),Zu=Symbol.for("react.offscreen"),ca=Symbol.iterator;function Wn(e){return e===null||typeof e!="object"?null:(e=ca&&e[ca]||e["@@iterator"],typeof e=="function"?e:null)}var ee=Object.assign,vl;function Zn(e){if(vl===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);vl=t&&t[1]||""}return`
|
|
34
|
+
`+vl+e}var yl=!1;function xl(e,t){if(!e||yl)return"";yl=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(f){var r=f}Reflect.construct(e,[],t)}else{try{t.call()}catch(f){r=f}e.call(t.prototype)}else{try{throw Error()}catch(f){r=f}e()}}catch(f){if(f&&r&&typeof f.stack=="string"){for(var s=f.stack.split(`
|
|
35
|
+
`),l=r.stack.split(`
|
|
36
|
+
`),i=s.length-1,a=l.length-1;1<=i&&0<=a&&s[i]!==l[a];)a--;for(;1<=i&&0<=a;i--,a--)if(s[i]!==l[a]){if(i!==1||a!==1)do if(i--,a--,0>a||s[i]!==l[a]){var u=`
|
|
37
|
+
`+s[i].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=i&&0<=a);break}}}finally{yl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Zn(e):""}function uh(e){switch(e.tag){case 5:return Zn(e.type);case 16:return Zn("Lazy");case 13:return Zn("Suspense");case 19:return Zn("SuspenseList");case 0:case 2:case 15:return e=xl(e.type,!1),e;case 11:return e=xl(e.type.render,!1),e;case 1:return e=xl(e.type,!0),e;default:return""}}function to(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case cn:return"Fragment";case un:return"Portal";case Xl:return"Profiler";case ii:return"StrictMode";case Zl:return"Suspense";case eo:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Xu:return(e.displayName||"Context")+".Consumer";case Yu:return(e._context.displayName||"Context")+".Provider";case ai:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ui:return t=e.displayName||null,t!==null?t:to(e.type)||"Memo";case xt:t=e._payload,e=e._init;try{return to(e(t))}catch{}}return null}function ch(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return to(t);case 8:return t===ii?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function It(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ec(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function dh(e){var t=ec(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,l=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(i){r=""+i,l.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Dr(e){e._valueTracker||(e._valueTracker=dh(e))}function tc(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=ec(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ys(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function no(e,t){var n=t.checked;return ee({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function da(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=It(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function nc(e,t){t=t.checked,t!=null&&oi(e,"checked",t,!1)}function ro(e,t){nc(e,t);var n=It(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?so(e,t.type,n):t.hasOwnProperty("defaultValue")&&so(e,t.type,It(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function fa(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function so(e,t,n){(t!=="number"||ys(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var er=Array.isArray;function Sn(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&r&&(e[n].defaultSelected=!0)}else{for(n=""+It(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,r&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function lo(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(C(91));return ee({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ha(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(C(92));if(er(n)){if(1<n.length)throw Error(C(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:It(n)}}function rc(e,t){var n=It(t.value),r=It(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function pa(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function sc(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function oo(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?sc(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Br,lc=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,s){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Br=Br||document.createElement("div"),Br.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Br.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function pr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var sr={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},fh=["Webkit","ms","Moz","O"];Object.keys(sr).forEach(function(e){fh.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),sr[t]=sr[e]})});function oc(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||sr.hasOwnProperty(e)&&sr[e]?(""+t).trim():t+"px"}function ic(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=oc(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var hh=ee({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function io(e,t){if(t){if(hh[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(C(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(C(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(C(61))}if(t.style!=null&&typeof t.style!="object")throw Error(C(62))}}function ao(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){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 uo=null;function ci(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var co=null,Nn=null,kn=null;function ma(e){if(e=Mr(e)){if(typeof co!="function")throw Error(C(280));var t=e.stateNode;t&&(t=Xs(t),co(e.stateNode,e.type,t))}}function ac(e){Nn?kn?kn.push(e):kn=[e]:Nn=e}function uc(){if(Nn){var e=Nn,t=kn;if(kn=Nn=null,ma(e),t)for(e=0;e<t.length;e++)ma(t[e])}}function cc(e,t){return e(t)}function dc(){}var wl=!1;function fc(e,t,n){if(wl)return e(t,n);wl=!0;try{return cc(e,t,n)}finally{wl=!1,(Nn!==null||kn!==null)&&(dc(),uc())}}function mr(e,t){var n=e.stateNode;if(n===null)return null;var r=Xs(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(C(231,t,typeof n));return n}var fo=!1;if(ut)try{var Hn={};Object.defineProperty(Hn,"passive",{get:function(){fo=!0}}),window.addEventListener("test",Hn,Hn),window.removeEventListener("test",Hn,Hn)}catch{fo=!1}function ph(e,t,n,r,s,l,i,a,u){var f=Array.prototype.slice.call(arguments,3);try{t.apply(n,f)}catch(m){this.onError(m)}}var lr=!1,xs=null,ws=!1,ho=null,mh={onError:function(e){lr=!0,xs=e}};function gh(e,t,n,r,s,l,i,a,u){lr=!1,xs=null,ph.apply(mh,arguments)}function vh(e,t,n,r,s,l,i,a,u){if(gh.apply(this,arguments),lr){if(lr){var f=xs;lr=!1,xs=null}else throw Error(C(198));ws||(ws=!0,ho=f)}}function ln(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function hc(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function ga(e){if(ln(e)!==e)throw Error(C(188))}function yh(e){var t=e.alternate;if(!t){if(t=ln(e),t===null)throw Error(C(188));return t!==e?null:e}for(var n=e,r=t;;){var s=n.return;if(s===null)break;var l=s.alternate;if(l===null){if(r=s.return,r!==null){n=r;continue}break}if(s.child===l.child){for(l=s.child;l;){if(l===n)return ga(s),e;if(l===r)return ga(s),t;l=l.sibling}throw Error(C(188))}if(n.return!==r.return)n=s,r=l;else{for(var i=!1,a=s.child;a;){if(a===n){i=!0,n=s,r=l;break}if(a===r){i=!0,r=s,n=l;break}a=a.sibling}if(!i){for(a=l.child;a;){if(a===n){i=!0,n=l,r=s;break}if(a===r){i=!0,r=l,n=s;break}a=a.sibling}if(!i)throw Error(C(189))}}if(n.alternate!==r)throw Error(C(190))}if(n.tag!==3)throw Error(C(188));return n.stateNode.current===n?e:t}function pc(e){return e=yh(e),e!==null?mc(e):null}function mc(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=mc(e);if(t!==null)return t;e=e.sibling}return null}var gc=Re.unstable_scheduleCallback,va=Re.unstable_cancelCallback,xh=Re.unstable_shouldYield,wh=Re.unstable_requestPaint,ne=Re.unstable_now,Sh=Re.unstable_getCurrentPriorityLevel,di=Re.unstable_ImmediatePriority,vc=Re.unstable_UserBlockingPriority,Ss=Re.unstable_NormalPriority,Nh=Re.unstable_LowPriority,yc=Re.unstable_IdlePriority,Qs=null,Ze=null;function kh(e){if(Ze&&typeof Ze.onCommitFiberRoot=="function")try{Ze.onCommitFiberRoot(Qs,e,void 0,(e.current.flags&128)===128)}catch{}}var qe=Math.clz32?Math.clz32:Ch,jh=Math.log,bh=Math.LN2;function Ch(e){return e>>>=0,e===0?32:31-(jh(e)/bh|0)|0}var Ur=64,Fr=4194304;function tr(e){switch(e&-e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ns(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,l=e.pingedLanes,i=n&268435455;if(i!==0){var a=i&~s;a!==0?r=tr(a):(l&=i,l!==0&&(r=tr(l)))}else i=n&~s,i!==0?r=tr(i):l!==0&&(r=tr(l));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,l=t&-t,s>=l||s===16&&(l&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-qe(t),s=1<<n,r|=e[n],t&=~s;return r}function Eh(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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 t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function _h(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,l=e.pendingLanes;0<l;){var i=31-qe(l),a=1<<i,u=s[i];u===-1?(!(a&n)||a&r)&&(s[i]=Eh(a,t)):u<=t&&(e.expiredLanes|=a),l&=~a}}function po(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function xc(){var e=Ur;return Ur<<=1,!(Ur&4194240)&&(Ur=64),e}function Sl(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Or(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-qe(t),e[t]=n}function Th(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var s=31-qe(n),l=1<<s;t[s]=0,r[s]=-1,e[s]=-1,n&=~l}}function fi(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-qe(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}var V=0;function wc(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Sc,hi,Nc,kc,jc,mo=!1,Vr=[],Ct=null,Et=null,_t=null,gr=new Map,vr=new Map,St=[],Ph="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 submit".split(" ");function ya(e,t){switch(e){case"focusin":case"focusout":Ct=null;break;case"dragenter":case"dragleave":Et=null;break;case"mouseover":case"mouseout":_t=null;break;case"pointerover":case"pointerout":gr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":vr.delete(t.pointerId)}}function qn(e,t,n,r,s,l){return e===null||e.nativeEvent!==l?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:l,targetContainers:[s]},t!==null&&(t=Mr(t),t!==null&&hi(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function Rh(e,t,n,r,s){switch(t){case"focusin":return Ct=qn(Ct,e,t,n,r,s),!0;case"dragenter":return Et=qn(Et,e,t,n,r,s),!0;case"mouseover":return _t=qn(_t,e,t,n,r,s),!0;case"pointerover":var l=s.pointerId;return gr.set(l,qn(gr.get(l)||null,e,t,n,r,s)),!0;case"gotpointercapture":return l=s.pointerId,vr.set(l,qn(vr.get(l)||null,e,t,n,r,s)),!0}return!1}function bc(e){var t=Wt(e.target);if(t!==null){var n=ln(t);if(n!==null){if(t=n.tag,t===13){if(t=hc(n),t!==null){e.blockedOn=t,jc(e.priority,function(){Nc(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ss(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=go(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);uo=r,n.target.dispatchEvent(r),uo=null}else return t=Mr(n),t!==null&&hi(t),e.blockedOn=n,!1;t.shift()}return!0}function xa(e,t,n){ss(e)&&n.delete(t)}function Lh(){mo=!1,Ct!==null&&ss(Ct)&&(Ct=null),Et!==null&&ss(Et)&&(Et=null),_t!==null&&ss(_t)&&(_t=null),gr.forEach(xa),vr.forEach(xa)}function Kn(e,t){e.blockedOn===t&&(e.blockedOn=null,mo||(mo=!0,Re.unstable_scheduleCallback(Re.unstable_NormalPriority,Lh)))}function yr(e){function t(s){return Kn(s,e)}if(0<Vr.length){Kn(Vr[0],e);for(var n=1;n<Vr.length;n++){var r=Vr[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Ct!==null&&Kn(Ct,e),Et!==null&&Kn(Et,e),_t!==null&&Kn(_t,e),gr.forEach(t),vr.forEach(t),n=0;n<St.length;n++)r=St[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<St.length&&(n=St[0],n.blockedOn===null);)bc(n),n.blockedOn===null&&St.shift()}var jn=ht.ReactCurrentBatchConfig,ks=!0;function Oh(e,t,n,r){var s=V,l=jn.transition;jn.transition=null;try{V=1,pi(e,t,n,r)}finally{V=s,jn.transition=l}}function Ah(e,t,n,r){var s=V,l=jn.transition;jn.transition=null;try{V=4,pi(e,t,n,r)}finally{V=s,jn.transition=l}}function pi(e,t,n,r){if(ks){var s=go(e,t,n,r);if(s===null)Rl(e,t,r,js,n),ya(e,r);else if(Rh(s,e,t,n,r))r.stopPropagation();else if(ya(e,r),t&4&&-1<Ph.indexOf(e)){for(;s!==null;){var l=Mr(s);if(l!==null&&Sc(l),l=go(e,t,n,r),l===null&&Rl(e,t,r,js,n),l===s)break;s=l}s!==null&&r.stopPropagation()}else Rl(e,t,r,null,n)}}var js=null;function go(e,t,n,r){if(js=null,e=ci(r),e=Wt(e),e!==null)if(t=ln(e),t===null)e=null;else if(n=t.tag,n===13){if(e=hc(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return js=e,null}function Cc(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Sh()){case di:return 1;case vc:return 4;case Ss:case Nh:return 16;case yc:return 536870912;default:return 16}default:return 16}}var kt=null,mi=null,ls=null;function Ec(){if(ls)return ls;var e,t=mi,n=t.length,r,s="value"in kt?kt.value:kt.textContent,l=s.length;for(e=0;e<n&&t[e]===s[e];e++);var i=n-e;for(r=1;r<=i&&t[n-r]===s[l-r];r++);return ls=s.slice(e,1<r?1-r:void 0)}function os(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Wr(){return!0}function wa(){return!1}function Oe(e){function t(n,r,s,l,i){this._reactName=n,this._targetInst=s,this.type=r,this.nativeEvent=l,this.target=i,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(l):l[a]);return this.isDefaultPrevented=(l.defaultPrevented!=null?l.defaultPrevented:l.returnValue===!1)?Wr:wa,this.isPropagationStopped=wa,this}return ee(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Wr)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Wr)},persist:function(){},isPersistent:Wr}),t}var zn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},gi=Oe(zn),Ar=ee({},zn,{view:0,detail:0}),Mh=Oe(Ar),Nl,kl,Qn,Js=ee({},Ar,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:vi,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Qn&&(Qn&&e.type==="mousemove"?(Nl=e.screenX-Qn.screenX,kl=e.screenY-Qn.screenY):kl=Nl=0,Qn=e),Nl)},movementY:function(e){return"movementY"in e?e.movementY:kl}}),Sa=Oe(Js),Ih=ee({},Js,{dataTransfer:0}),zh=Oe(Ih),$h=ee({},Ar,{relatedTarget:0}),jl=Oe($h),Dh=ee({},zn,{animationName:0,elapsedTime:0,pseudoElement:0}),Bh=Oe(Dh),Uh=ee({},zn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Fh=Oe(Uh),Vh=ee({},zn,{data:0}),Na=Oe(Vh),Wh={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Hh={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"},qh={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Kh(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=qh[e])?!!t[e]:!1}function vi(){return Kh}var Qh=ee({},Ar,{key:function(e){if(e.key){var t=Wh[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=os(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Hh[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:vi,charCode:function(e){return e.type==="keypress"?os(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?os(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Jh=Oe(Qh),Gh=ee({},Js,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ka=Oe(Gh),Yh=ee({},Ar,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:vi}),Xh=Oe(Yh),Zh=ee({},zn,{propertyName:0,elapsedTime:0,pseudoElement:0}),ep=Oe(Zh),tp=ee({},Js,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),np=Oe(tp),rp=[9,13,27,32],yi=ut&&"CompositionEvent"in window,or=null;ut&&"documentMode"in document&&(or=document.documentMode);var sp=ut&&"TextEvent"in window&&!or,_c=ut&&(!yi||or&&8<or&&11>=or),ja=" ",ba=!1;function Tc(e,t){switch(e){case"keyup":return rp.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Pc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var dn=!1;function lp(e,t){switch(e){case"compositionend":return Pc(t);case"keypress":return t.which!==32?null:(ba=!0,ja);case"textInput":return e=t.data,e===ja&&ba?null:e;default:return null}}function op(e,t){if(dn)return e==="compositionend"||!yi&&Tc(e,t)?(e=Ec(),ls=mi=kt=null,dn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return _c&&t.locale!=="ko"?null:t.data;default:return null}}var ip={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 Ca(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ip[e.type]:t==="textarea"}function Rc(e,t,n,r){ac(r),t=bs(t,"onChange"),0<t.length&&(n=new gi("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var ir=null,xr=null;function ap(e){Fc(e,0)}function Gs(e){var t=pn(e);if(tc(t))return e}function up(e,t){if(e==="change")return t}var Lc=!1;if(ut){var bl;if(ut){var Cl="oninput"in document;if(!Cl){var Ea=document.createElement("div");Ea.setAttribute("oninput","return;"),Cl=typeof Ea.oninput=="function"}bl=Cl}else bl=!1;Lc=bl&&(!document.documentMode||9<document.documentMode)}function _a(){ir&&(ir.detachEvent("onpropertychange",Oc),xr=ir=null)}function Oc(e){if(e.propertyName==="value"&&Gs(xr)){var t=[];Rc(t,xr,e,ci(e)),fc(ap,t)}}function cp(e,t,n){e==="focusin"?(_a(),ir=t,xr=n,ir.attachEvent("onpropertychange",Oc)):e==="focusout"&&_a()}function dp(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Gs(xr)}function fp(e,t){if(e==="click")return Gs(t)}function hp(e,t){if(e==="input"||e==="change")return Gs(t)}function pp(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Qe=typeof Object.is=="function"?Object.is:pp;function wr(e,t){if(Qe(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var s=n[r];if(!Yl.call(t,s)||!Qe(e[s],t[s]))return!1}return!0}function Ta(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Pa(e,t){var n=Ta(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Ta(n)}}function Ac(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ac(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Mc(){for(var e=window,t=ys();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ys(e.document)}return t}function xi(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function mp(e){var t=Mc(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Ac(n.ownerDocument.documentElement,n)){if(r!==null&&xi(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,l=Math.min(r.start,s);r=r.end===void 0?l:Math.min(r.end,s),!e.extend&&l>r&&(s=r,r=l,l=s),s=Pa(n,l);var i=Pa(n,r);s&&i&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),l>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var gp=ut&&"documentMode"in document&&11>=document.documentMode,fn=null,vo=null,ar=null,yo=!1;function Ra(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;yo||fn==null||fn!==ys(r)||(r=fn,"selectionStart"in r&&xi(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ar&&wr(ar,r)||(ar=r,r=bs(vo,"onSelect"),0<r.length&&(t=new gi("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=fn)))}function Hr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var hn={animationend:Hr("Animation","AnimationEnd"),animationiteration:Hr("Animation","AnimationIteration"),animationstart:Hr("Animation","AnimationStart"),transitionend:Hr("Transition","TransitionEnd")},El={},Ic={};ut&&(Ic=document.createElement("div").style,"AnimationEvent"in window||(delete hn.animationend.animation,delete hn.animationiteration.animation,delete hn.animationstart.animation),"TransitionEvent"in window||delete hn.transitionend.transition);function Ys(e){if(El[e])return El[e];if(!hn[e])return e;var t=hn[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Ic)return El[e]=t[n];return e}var zc=Ys("animationend"),$c=Ys("animationiteration"),Dc=Ys("animationstart"),Bc=Ys("transitionend"),Uc=new Map,La="abort auxClick 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(" ");function $t(e,t){Uc.set(e,t),sn(t,[e])}for(var _l=0;_l<La.length;_l++){var Tl=La[_l],vp=Tl.toLowerCase(),yp=Tl[0].toUpperCase()+Tl.slice(1);$t(vp,"on"+yp)}$t(zc,"onAnimationEnd");$t($c,"onAnimationIteration");$t(Dc,"onAnimationStart");$t("dblclick","onDoubleClick");$t("focusin","onFocus");$t("focusout","onBlur");$t(Bc,"onTransitionEnd");En("onMouseEnter",["mouseout","mouseover"]);En("onMouseLeave",["mouseout","mouseover"]);En("onPointerEnter",["pointerout","pointerover"]);En("onPointerLeave",["pointerout","pointerover"]);sn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));sn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));sn("onBeforeInput",["compositionend","keypress","textInput","paste"]);sn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));sn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));sn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var nr="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(" "),xp=new Set("cancel close invalid load scroll toggle".split(" ").concat(nr));function Oa(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,vh(r,t,void 0,e),e.currentTarget=null}function Fc(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],s=r.event;r=r.listeners;e:{var l=void 0;if(t)for(var i=r.length-1;0<=i;i--){var a=r[i],u=a.instance,f=a.currentTarget;if(a=a.listener,u!==l&&s.isPropagationStopped())break e;Oa(s,a,f),l=u}else for(i=0;i<r.length;i++){if(a=r[i],u=a.instance,f=a.currentTarget,a=a.listener,u!==l&&s.isPropagationStopped())break e;Oa(s,a,f),l=u}}}if(ws)throw e=ho,ws=!1,ho=null,e}function K(e,t){var n=t[ko];n===void 0&&(n=t[ko]=new Set);var r=e+"__bubble";n.has(r)||(Vc(t,e,2,!1),n.add(r))}function Pl(e,t,n){var r=0;t&&(r|=4),Vc(n,e,r,t)}var qr="_reactListening"+Math.random().toString(36).slice(2);function Sr(e){if(!e[qr]){e[qr]=!0,Gu.forEach(function(n){n!=="selectionchange"&&(xp.has(n)||Pl(n,!1,e),Pl(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[qr]||(t[qr]=!0,Pl("selectionchange",!1,t))}}function Vc(e,t,n,r){switch(Cc(t)){case 1:var s=Oh;break;case 4:s=Ah;break;default:s=pi}n=s.bind(null,t,n,e),s=void 0,!fo||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),r?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}function Rl(e,t,n,r,s){var l=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var i=r.tag;if(i===3||i===4){var a=r.stateNode.containerInfo;if(a===s||a.nodeType===8&&a.parentNode===s)break;if(i===4)for(i=r.return;i!==null;){var u=i.tag;if((u===3||u===4)&&(u=i.stateNode.containerInfo,u===s||u.nodeType===8&&u.parentNode===s))return;i=i.return}for(;a!==null;){if(i=Wt(a),i===null)return;if(u=i.tag,u===5||u===6){r=l=i;continue e}a=a.parentNode}}r=r.return}fc(function(){var f=l,m=ci(n),p=[];e:{var c=Uc.get(e);if(c!==void 0){var x=gi,y=e;switch(e){case"keypress":if(os(n)===0)break e;case"keydown":case"keyup":x=Jh;break;case"focusin":y="focus",x=jl;break;case"focusout":y="blur",x=jl;break;case"beforeblur":case"afterblur":x=jl;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":x=Sa;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":x=zh;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":x=Xh;break;case zc:case $c:case Dc:x=Bh;break;case Bc:x=ep;break;case"scroll":x=Mh;break;case"wheel":x=np;break;case"copy":case"cut":case"paste":x=Fh;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":x=ka}var w=(t&4)!==0,b=!w&&e==="scroll",g=w?c!==null?c+"Capture":null:c;w=[];for(var d=f,h;d!==null;){h=d;var k=h.stateNode;if(h.tag===5&&k!==null&&(h=k,g!==null&&(k=mr(d,g),k!=null&&w.push(Nr(d,k,h)))),b)break;d=d.return}0<w.length&&(c=new x(c,y,null,n,m),p.push({event:c,listeners:w}))}}if(!(t&7)){e:{if(c=e==="mouseover"||e==="pointerover",x=e==="mouseout"||e==="pointerout",c&&n!==uo&&(y=n.relatedTarget||n.fromElement)&&(Wt(y)||y[ct]))break e;if((x||c)&&(c=m.window===m?m:(c=m.ownerDocument)?c.defaultView||c.parentWindow:window,x?(y=n.relatedTarget||n.toElement,x=f,y=y?Wt(y):null,y!==null&&(b=ln(y),y!==b||y.tag!==5&&y.tag!==6)&&(y=null)):(x=null,y=f),x!==y)){if(w=Sa,k="onMouseLeave",g="onMouseEnter",d="mouse",(e==="pointerout"||e==="pointerover")&&(w=ka,k="onPointerLeave",g="onPointerEnter",d="pointer"),b=x==null?c:pn(x),h=y==null?c:pn(y),c=new w(k,d+"leave",x,n,m),c.target=b,c.relatedTarget=h,k=null,Wt(m)===f&&(w=new w(g,d+"enter",y,n,m),w.target=h,w.relatedTarget=b,k=w),b=k,x&&y)t:{for(w=x,g=y,d=0,h=w;h;h=an(h))d++;for(h=0,k=g;k;k=an(k))h++;for(;0<d-h;)w=an(w),d--;for(;0<h-d;)g=an(g),h--;for(;d--;){if(w===g||g!==null&&w===g.alternate)break t;w=an(w),g=an(g)}w=null}else w=null;x!==null&&Aa(p,c,x,w,!1),y!==null&&b!==null&&Aa(p,b,y,w,!0)}}e:{if(c=f?pn(f):window,x=c.nodeName&&c.nodeName.toLowerCase(),x==="select"||x==="input"&&c.type==="file")var E=up;else if(Ca(c))if(Lc)E=hp;else{E=dp;var _=cp}else(x=c.nodeName)&&x.toLowerCase()==="input"&&(c.type==="checkbox"||c.type==="radio")&&(E=fp);if(E&&(E=E(e,f))){Rc(p,E,n,m);break e}_&&_(e,c,f),e==="focusout"&&(_=c._wrapperState)&&_.controlled&&c.type==="number"&&so(c,"number",c.value)}switch(_=f?pn(f):window,e){case"focusin":(Ca(_)||_.contentEditable==="true")&&(fn=_,vo=f,ar=null);break;case"focusout":ar=vo=fn=null;break;case"mousedown":yo=!0;break;case"contextmenu":case"mouseup":case"dragend":yo=!1,Ra(p,n,m);break;case"selectionchange":if(gp)break;case"keydown":case"keyup":Ra(p,n,m)}var R;if(yi)e:{switch(e){case"compositionstart":var A="onCompositionStart";break e;case"compositionend":A="onCompositionEnd";break e;case"compositionupdate":A="onCompositionUpdate";break e}A=void 0}else dn?Tc(e,n)&&(A="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(A="onCompositionStart");A&&(_c&&n.locale!=="ko"&&(dn||A!=="onCompositionStart"?A==="onCompositionEnd"&&dn&&(R=Ec()):(kt=m,mi="value"in kt?kt.value:kt.textContent,dn=!0)),_=bs(f,A),0<_.length&&(A=new Na(A,e,null,n,m),p.push({event:A,listeners:_}),R?A.data=R:(R=Pc(n),R!==null&&(A.data=R)))),(R=sp?lp(e,n):op(e,n))&&(f=bs(f,"onBeforeInput"),0<f.length&&(m=new Na("onBeforeInput","beforeinput",null,n,m),p.push({event:m,listeners:f}),m.data=R))}Fc(p,t)})}function Nr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function bs(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,l=s.stateNode;s.tag===5&&l!==null&&(s=l,l=mr(e,n),l!=null&&r.unshift(Nr(e,l,s)),l=mr(e,t),l!=null&&r.push(Nr(e,l,s))),e=e.return}return r}function an(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Aa(e,t,n,r,s){for(var l=t._reactName,i=[];n!==null&&n!==r;){var a=n,u=a.alternate,f=a.stateNode;if(u!==null&&u===r)break;a.tag===5&&f!==null&&(a=f,s?(u=mr(n,l),u!=null&&i.unshift(Nr(n,u,a))):s||(u=mr(n,l),u!=null&&i.push(Nr(n,u,a)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var wp=/\r\n?/g,Sp=/\u0000|\uFFFD/g;function Ma(e){return(typeof e=="string"?e:""+e).replace(wp,`
|
|
38
|
+
`).replace(Sp,"")}function Kr(e,t,n){if(t=Ma(t),Ma(e)!==t&&n)throw Error(C(425))}function Cs(){}var xo=null,wo=null;function So(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var No=typeof setTimeout=="function"?setTimeout:void 0,Np=typeof clearTimeout=="function"?clearTimeout:void 0,Ia=typeof Promise=="function"?Promise:void 0,kp=typeof queueMicrotask=="function"?queueMicrotask:typeof Ia<"u"?function(e){return Ia.resolve(null).then(e).catch(jp)}:No;function jp(e){setTimeout(function(){throw e})}function Ll(e,t){var n=t,r=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(r===0){e.removeChild(s),yr(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);yr(t)}function Tt(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function za(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var $n=Math.random().toString(36).slice(2),Xe="__reactFiber$"+$n,kr="__reactProps$"+$n,ct="__reactContainer$"+$n,ko="__reactEvents$"+$n,bp="__reactListeners$"+$n,Cp="__reactHandles$"+$n;function Wt(e){var t=e[Xe];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ct]||n[Xe]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=za(e);e!==null;){if(n=e[Xe])return n;e=za(e)}return t}e=n,n=e.parentNode}return null}function Mr(e){return e=e[Xe]||e[ct],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function pn(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(C(33))}function Xs(e){return e[kr]||null}var jo=[],mn=-1;function Dt(e){return{current:e}}function Q(e){0>mn||(e.current=jo[mn],jo[mn]=null,mn--)}function q(e,t){mn++,jo[mn]=e.current,e.current=t}var zt={},ve=Dt(zt),be=Dt(!1),Yt=zt;function _n(e,t){var n=e.type.contextTypes;if(!n)return zt;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},l;for(l in n)s[l]=t[l];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function Ce(e){return e=e.childContextTypes,e!=null}function Es(){Q(be),Q(ve)}function $a(e,t,n){if(ve.current!==zt)throw Error(C(168));q(ve,t),q(be,n)}function Wc(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(C(108,ch(e)||"Unknown",s));return ee({},n,r)}function _s(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||zt,Yt=ve.current,q(ve,e),q(be,be.current),!0}function Da(e,t,n){var r=e.stateNode;if(!r)throw Error(C(169));n?(e=Wc(e,t,Yt),r.__reactInternalMemoizedMergedChildContext=e,Q(be),Q(ve),q(ve,e)):Q(be),q(be,n)}var lt=null,Zs=!1,Ol=!1;function Hc(e){lt===null?lt=[e]:lt.push(e)}function Ep(e){Zs=!0,Hc(e)}function Bt(){if(!Ol&<!==null){Ol=!0;var e=0,t=V;try{var n=lt;for(V=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}lt=null,Zs=!1}catch(s){throw lt!==null&&(lt=lt.slice(e+1)),gc(di,Bt),s}finally{V=t,Ol=!1}}return null}var gn=[],vn=0,Ts=null,Ps=0,Ae=[],Me=0,Xt=null,ot=1,it="";function Ft(e,t){gn[vn++]=Ps,gn[vn++]=Ts,Ts=e,Ps=t}function qc(e,t,n){Ae[Me++]=ot,Ae[Me++]=it,Ae[Me++]=Xt,Xt=e;var r=ot;e=it;var s=32-qe(r)-1;r&=~(1<<s),n+=1;var l=32-qe(t)+s;if(30<l){var i=s-s%5;l=(r&(1<<i)-1).toString(32),r>>=i,s-=i,ot=1<<32-qe(t)+s|n<<s|r,it=l+e}else ot=1<<l|n<<s|r,it=e}function wi(e){e.return!==null&&(Ft(e,1),qc(e,1,0))}function Si(e){for(;e===Ts;)Ts=gn[--vn],gn[vn]=null,Ps=gn[--vn],gn[vn]=null;for(;e===Xt;)Xt=Ae[--Me],Ae[Me]=null,it=Ae[--Me],Ae[Me]=null,ot=Ae[--Me],Ae[Me]=null}var Pe=null,Te=null,J=!1,He=null;function Kc(e,t){var n=ze(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Ba(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Pe=e,Te=Tt(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Pe=e,Te=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Xt!==null?{id:ot,overflow:it}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=ze(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Pe=e,Te=null,!0):!1;default:return!1}}function bo(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Co(e){if(J){var t=Te;if(t){var n=t;if(!Ba(e,t)){if(bo(e))throw Error(C(418));t=Tt(n.nextSibling);var r=Pe;t&&Ba(e,t)?Kc(r,n):(e.flags=e.flags&-4097|2,J=!1,Pe=e)}}else{if(bo(e))throw Error(C(418));e.flags=e.flags&-4097|2,J=!1,Pe=e}}}function Ua(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Pe=e}function Qr(e){if(e!==Pe)return!1;if(!J)return Ua(e),J=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!So(e.type,e.memoizedProps)),t&&(t=Te)){if(bo(e))throw Qc(),Error(C(418));for(;t;)Kc(e,t),t=Tt(t.nextSibling)}if(Ua(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(C(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Te=Tt(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Te=null}}else Te=Pe?Tt(e.stateNode.nextSibling):null;return!0}function Qc(){for(var e=Te;e;)e=Tt(e.nextSibling)}function Tn(){Te=Pe=null,J=!1}function Ni(e){He===null?He=[e]:He.push(e)}var _p=ht.ReactCurrentBatchConfig;function Jn(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(C(309));var r=n.stateNode}if(!r)throw Error(C(147,e));var s=r,l=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===l?t.ref:(t=function(i){var a=s.refs;i===null?delete a[l]:a[l]=i},t._stringRef=l,t)}if(typeof e!="string")throw Error(C(284));if(!n._owner)throw Error(C(290,e))}return e}function Jr(e,t){throw e=Object.prototype.toString.call(t),Error(C(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Fa(e){var t=e._init;return t(e._payload)}function Jc(e){function t(g,d){if(e){var h=g.deletions;h===null?(g.deletions=[d],g.flags|=16):h.push(d)}}function n(g,d){if(!e)return null;for(;d!==null;)t(g,d),d=d.sibling;return null}function r(g,d){for(g=new Map;d!==null;)d.key!==null?g.set(d.key,d):g.set(d.index,d),d=d.sibling;return g}function s(g,d){return g=Ot(g,d),g.index=0,g.sibling=null,g}function l(g,d,h){return g.index=h,e?(h=g.alternate,h!==null?(h=h.index,h<d?(g.flags|=2,d):h):(g.flags|=2,d)):(g.flags|=1048576,d)}function i(g){return e&&g.alternate===null&&(g.flags|=2),g}function a(g,d,h,k){return d===null||d.tag!==6?(d=Bl(h,g.mode,k),d.return=g,d):(d=s(d,h),d.return=g,d)}function u(g,d,h,k){var E=h.type;return E===cn?m(g,d,h.props.children,k,h.key):d!==null&&(d.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===xt&&Fa(E)===d.type)?(k=s(d,h.props),k.ref=Jn(g,d,h),k.return=g,k):(k=hs(h.type,h.key,h.props,null,g.mode,k),k.ref=Jn(g,d,h),k.return=g,k)}function f(g,d,h,k){return d===null||d.tag!==4||d.stateNode.containerInfo!==h.containerInfo||d.stateNode.implementation!==h.implementation?(d=Ul(h,g.mode,k),d.return=g,d):(d=s(d,h.children||[]),d.return=g,d)}function m(g,d,h,k,E){return d===null||d.tag!==7?(d=Qt(h,g.mode,k,E),d.return=g,d):(d=s(d,h),d.return=g,d)}function p(g,d,h){if(typeof d=="string"&&d!==""||typeof d=="number")return d=Bl(""+d,g.mode,h),d.return=g,d;if(typeof d=="object"&&d!==null){switch(d.$$typeof){case $r:return h=hs(d.type,d.key,d.props,null,g.mode,h),h.ref=Jn(g,null,d),h.return=g,h;case un:return d=Ul(d,g.mode,h),d.return=g,d;case xt:var k=d._init;return p(g,k(d._payload),h)}if(er(d)||Wn(d))return d=Qt(d,g.mode,h,null),d.return=g,d;Jr(g,d)}return null}function c(g,d,h,k){var E=d!==null?d.key:null;if(typeof h=="string"&&h!==""||typeof h=="number")return E!==null?null:a(g,d,""+h,k);if(typeof h=="object"&&h!==null){switch(h.$$typeof){case $r:return h.key===E?u(g,d,h,k):null;case un:return h.key===E?f(g,d,h,k):null;case xt:return E=h._init,c(g,d,E(h._payload),k)}if(er(h)||Wn(h))return E!==null?null:m(g,d,h,k,null);Jr(g,h)}return null}function x(g,d,h,k,E){if(typeof k=="string"&&k!==""||typeof k=="number")return g=g.get(h)||null,a(d,g,""+k,E);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case $r:return g=g.get(k.key===null?h:k.key)||null,u(d,g,k,E);case un:return g=g.get(k.key===null?h:k.key)||null,f(d,g,k,E);case xt:var _=k._init;return x(g,d,h,_(k._payload),E)}if(er(k)||Wn(k))return g=g.get(h)||null,m(d,g,k,E,null);Jr(d,k)}return null}function y(g,d,h,k){for(var E=null,_=null,R=d,A=d=0,F=null;R!==null&&A<h.length;A++){R.index>A?(F=R,R=null):F=R.sibling;var I=c(g,R,h[A],k);if(I===null){R===null&&(R=F);break}e&&R&&I.alternate===null&&t(g,R),d=l(I,d,A),_===null?E=I:_.sibling=I,_=I,R=F}if(A===h.length)return n(g,R),J&&Ft(g,A),E;if(R===null){for(;A<h.length;A++)R=p(g,h[A],k),R!==null&&(d=l(R,d,A),_===null?E=R:_.sibling=R,_=R);return J&&Ft(g,A),E}for(R=r(g,R);A<h.length;A++)F=x(R,g,A,h[A],k),F!==null&&(e&&F.alternate!==null&&R.delete(F.key===null?A:F.key),d=l(F,d,A),_===null?E=F:_.sibling=F,_=F);return e&&R.forEach(function(ie){return t(g,ie)}),J&&Ft(g,A),E}function w(g,d,h,k){var E=Wn(h);if(typeof E!="function")throw Error(C(150));if(h=E.call(h),h==null)throw Error(C(151));for(var _=E=null,R=d,A=d=0,F=null,I=h.next();R!==null&&!I.done;A++,I=h.next()){R.index>A?(F=R,R=null):F=R.sibling;var ie=c(g,R,I.value,k);if(ie===null){R===null&&(R=F);break}e&&R&&ie.alternate===null&&t(g,R),d=l(ie,d,A),_===null?E=ie:_.sibling=ie,_=ie,R=F}if(I.done)return n(g,R),J&&Ft(g,A),E;if(R===null){for(;!I.done;A++,I=h.next())I=p(g,I.value,k),I!==null&&(d=l(I,d,A),_===null?E=I:_.sibling=I,_=I);return J&&Ft(g,A),E}for(R=r(g,R);!I.done;A++,I=h.next())I=x(R,g,A,I.value,k),I!==null&&(e&&I.alternate!==null&&R.delete(I.key===null?A:I.key),d=l(I,d,A),_===null?E=I:_.sibling=I,_=I);return e&&R.forEach(function(Je){return t(g,Je)}),J&&Ft(g,A),E}function b(g,d,h,k){if(typeof h=="object"&&h!==null&&h.type===cn&&h.key===null&&(h=h.props.children),typeof h=="object"&&h!==null){switch(h.$$typeof){case $r:e:{for(var E=h.key,_=d;_!==null;){if(_.key===E){if(E=h.type,E===cn){if(_.tag===7){n(g,_.sibling),d=s(_,h.props.children),d.return=g,g=d;break e}}else if(_.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===xt&&Fa(E)===_.type){n(g,_.sibling),d=s(_,h.props),d.ref=Jn(g,_,h),d.return=g,g=d;break e}n(g,_);break}else t(g,_);_=_.sibling}h.type===cn?(d=Qt(h.props.children,g.mode,k,h.key),d.return=g,g=d):(k=hs(h.type,h.key,h.props,null,g.mode,k),k.ref=Jn(g,d,h),k.return=g,g=k)}return i(g);case un:e:{for(_=h.key;d!==null;){if(d.key===_)if(d.tag===4&&d.stateNode.containerInfo===h.containerInfo&&d.stateNode.implementation===h.implementation){n(g,d.sibling),d=s(d,h.children||[]),d.return=g,g=d;break e}else{n(g,d);break}else t(g,d);d=d.sibling}d=Ul(h,g.mode,k),d.return=g,g=d}return i(g);case xt:return _=h._init,b(g,d,_(h._payload),k)}if(er(h))return y(g,d,h,k);if(Wn(h))return w(g,d,h,k);Jr(g,h)}return typeof h=="string"&&h!==""||typeof h=="number"?(h=""+h,d!==null&&d.tag===6?(n(g,d.sibling),d=s(d,h),d.return=g,g=d):(n(g,d),d=Bl(h,g.mode,k),d.return=g,g=d),i(g)):n(g,d)}return b}var Pn=Jc(!0),Gc=Jc(!1),Rs=Dt(null),Ls=null,yn=null,ki=null;function ji(){ki=yn=Ls=null}function bi(e){var t=Rs.current;Q(Rs),e._currentValue=t}function Eo(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function bn(e,t){Ls=e,ki=yn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(je=!0),e.firstContext=null)}function De(e){var t=e._currentValue;if(ki!==e)if(e={context:e,memoizedValue:t,next:null},yn===null){if(Ls===null)throw Error(C(308));yn=e,Ls.dependencies={lanes:0,firstContext:e}}else yn=yn.next=e;return t}var Ht=null;function Ci(e){Ht===null?Ht=[e]:Ht.push(e)}function Yc(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,Ci(t)):(n.next=s.next,s.next=n),t.interleaved=n,dt(e,r)}function dt(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var wt=!1;function Ei(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Xc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function at(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Pt(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,D&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,dt(e,n)}return s=r.interleaved,s===null?(t.next=t,Ci(r)):(t.next=s.next,s.next=t),r.interleaved=t,dt(e,n)}function is(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,fi(e,n)}}function Va(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,l=null;if(n=n.firstBaseUpdate,n!==null){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};l===null?s=l=i:l=l.next=i,n=n.next}while(n!==null);l===null?s=l=t:l=l.next=t}else s=l=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:l,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Os(e,t,n,r){var s=e.updateQueue;wt=!1;var l=s.firstBaseUpdate,i=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var u=a,f=u.next;u.next=null,i===null?l=f:i.next=f,i=u;var m=e.alternate;m!==null&&(m=m.updateQueue,a=m.lastBaseUpdate,a!==i&&(a===null?m.firstBaseUpdate=f:a.next=f,m.lastBaseUpdate=u))}if(l!==null){var p=s.baseState;i=0,m=f=u=null,a=l;do{var c=a.lane,x=a.eventTime;if((r&c)===c){m!==null&&(m=m.next={eventTime:x,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var y=e,w=a;switch(c=t,x=n,w.tag){case 1:if(y=w.payload,typeof y=="function"){p=y.call(x,p,c);break e}p=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=w.payload,c=typeof y=="function"?y.call(x,p,c):y,c==null)break e;p=ee({},p,c);break e;case 2:wt=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,c=s.effects,c===null?s.effects=[a]:c.push(a))}else x={eventTime:x,lane:c,tag:a.tag,payload:a.payload,callback:a.callback,next:null},m===null?(f=m=x,u=p):m=m.next=x,i|=c;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;c=a,a=c.next,c.next=null,s.lastBaseUpdate=c,s.shared.pending=null}}while(!0);if(m===null&&(u=p),s.baseState=u,s.firstBaseUpdate=f,s.lastBaseUpdate=m,t=s.shared.interleaved,t!==null){s=t;do i|=s.lane,s=s.next;while(s!==t)}else l===null&&(s.shared.lanes=0);en|=i,e.lanes=i,e.memoizedState=p}}function Wa(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],s=r.callback;if(s!==null){if(r.callback=null,r=n,typeof s!="function")throw Error(C(191,s));s.call(r)}}}var Ir={},et=Dt(Ir),jr=Dt(Ir),br=Dt(Ir);function qt(e){if(e===Ir)throw Error(C(174));return e}function _i(e,t){switch(q(br,t),q(jr,e),q(et,Ir),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:oo(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=oo(t,e)}Q(et),q(et,t)}function Rn(){Q(et),Q(jr),Q(br)}function Zc(e){qt(br.current);var t=qt(et.current),n=oo(t,e.type);t!==n&&(q(jr,e),q(et,n))}function Ti(e){jr.current===e&&(Q(et),Q(jr))}var Y=Dt(0);function As(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Al=[];function Pi(){for(var e=0;e<Al.length;e++)Al[e]._workInProgressVersionPrimary=null;Al.length=0}var as=ht.ReactCurrentDispatcher,Ml=ht.ReactCurrentBatchConfig,Zt=0,X=null,le=null,ae=null,Ms=!1,ur=!1,Cr=0,Tp=0;function pe(){throw Error(C(321))}function Ri(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Qe(e[n],t[n]))return!1;return!0}function Li(e,t,n,r,s,l){if(Zt=l,X=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,as.current=e===null||e.memoizedState===null?Op:Ap,e=n(r,s),ur){l=0;do{if(ur=!1,Cr=0,25<=l)throw Error(C(301));l+=1,ae=le=null,t.updateQueue=null,as.current=Mp,e=n(r,s)}while(ur)}if(as.current=Is,t=le!==null&&le.next!==null,Zt=0,ae=le=X=null,Ms=!1,t)throw Error(C(300));return e}function Oi(){var e=Cr!==0;return Cr=0,e}function Ye(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ae===null?X.memoizedState=ae=e:ae=ae.next=e,ae}function Be(){if(le===null){var e=X.alternate;e=e!==null?e.memoizedState:null}else e=le.next;var t=ae===null?X.memoizedState:ae.next;if(t!==null)ae=t,le=e;else{if(e===null)throw Error(C(310));le=e,e={memoizedState:le.memoizedState,baseState:le.baseState,baseQueue:le.baseQueue,queue:le.queue,next:null},ae===null?X.memoizedState=ae=e:ae=ae.next=e}return ae}function Er(e,t){return typeof t=="function"?t(e):t}function Il(e){var t=Be(),n=t.queue;if(n===null)throw Error(C(311));n.lastRenderedReducer=e;var r=le,s=r.baseQueue,l=n.pending;if(l!==null){if(s!==null){var i=s.next;s.next=l.next,l.next=i}r.baseQueue=s=l,n.pending=null}if(s!==null){l=s.next,r=r.baseState;var a=i=null,u=null,f=l;do{var m=f.lane;if((Zt&m)===m)u!==null&&(u=u.next={lane:0,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null}),r=f.hasEagerState?f.eagerState:e(r,f.action);else{var p={lane:m,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null};u===null?(a=u=p,i=r):u=u.next=p,X.lanes|=m,en|=m}f=f.next}while(f!==null&&f!==l);u===null?i=r:u.next=a,Qe(r,t.memoizedState)||(je=!0),t.memoizedState=r,t.baseState=i,t.baseQueue=u,n.lastRenderedState=r}if(e=n.interleaved,e!==null){s=e;do l=s.lane,X.lanes|=l,en|=l,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function zl(e){var t=Be(),n=t.queue;if(n===null)throw Error(C(311));n.lastRenderedReducer=e;var r=n.dispatch,s=n.pending,l=t.memoizedState;if(s!==null){n.pending=null;var i=s=s.next;do l=e(l,i.action),i=i.next;while(i!==s);Qe(l,t.memoizedState)||(je=!0),t.memoizedState=l,t.baseQueue===null&&(t.baseState=l),n.lastRenderedState=l}return[l,r]}function ed(){}function td(e,t){var n=X,r=Be(),s=t(),l=!Qe(r.memoizedState,s);if(l&&(r.memoizedState=s,je=!0),r=r.queue,Ai(sd.bind(null,n,r,e),[e]),r.getSnapshot!==t||l||ae!==null&&ae.memoizedState.tag&1){if(n.flags|=2048,_r(9,rd.bind(null,n,r,s,t),void 0,null),ue===null)throw Error(C(349));Zt&30||nd(n,t,s)}return s}function nd(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=X.updateQueue,t===null?(t={lastEffect:null,stores:null},X.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function rd(e,t,n,r){t.value=n,t.getSnapshot=r,ld(t)&&od(e)}function sd(e,t,n){return n(function(){ld(t)&&od(e)})}function ld(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Qe(e,n)}catch{return!0}}function od(e){var t=dt(e,1);t!==null&&Ke(t,e,1,-1)}function Ha(e){var t=Ye();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Er,lastRenderedState:e},t.queue=e,e=e.dispatch=Lp.bind(null,X,e),[t.memoizedState,e]}function _r(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=X.updateQueue,t===null?(t={lastEffect:null,stores:null},X.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function id(){return Be().memoizedState}function us(e,t,n,r){var s=Ye();X.flags|=e,s.memoizedState=_r(1|t,n,void 0,r===void 0?null:r)}function el(e,t,n,r){var s=Be();r=r===void 0?null:r;var l=void 0;if(le!==null){var i=le.memoizedState;if(l=i.destroy,r!==null&&Ri(r,i.deps)){s.memoizedState=_r(t,n,l,r);return}}X.flags|=e,s.memoizedState=_r(1|t,n,l,r)}function qa(e,t){return us(8390656,8,e,t)}function Ai(e,t){return el(2048,8,e,t)}function ad(e,t){return el(4,2,e,t)}function ud(e,t){return el(4,4,e,t)}function cd(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function dd(e,t,n){return n=n!=null?n.concat([e]):null,el(4,4,cd.bind(null,t,e),n)}function Mi(){}function fd(e,t){var n=Be();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Ri(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function hd(e,t){var n=Be();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Ri(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function pd(e,t,n){return Zt&21?(Qe(n,t)||(n=xc(),X.lanes|=n,en|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,je=!0),e.memoizedState=n)}function Pp(e,t){var n=V;V=n!==0&&4>n?n:4,e(!0);var r=Ml.transition;Ml.transition={};try{e(!1),t()}finally{V=n,Ml.transition=r}}function md(){return Be().memoizedState}function Rp(e,t,n){var r=Lt(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},gd(e))vd(t,n);else if(n=Yc(e,t,n,r),n!==null){var s=we();Ke(n,e,r,s),yd(n,t,r)}}function Lp(e,t,n){var r=Lt(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(gd(e))vd(t,s);else{var l=e.alternate;if(e.lanes===0&&(l===null||l.lanes===0)&&(l=t.lastRenderedReducer,l!==null))try{var i=t.lastRenderedState,a=l(i,n);if(s.hasEagerState=!0,s.eagerState=a,Qe(a,i)){var u=t.interleaved;u===null?(s.next=s,Ci(t)):(s.next=u.next,u.next=s),t.interleaved=s;return}}catch{}finally{}n=Yc(e,t,s,r),n!==null&&(s=we(),Ke(n,e,r,s),yd(n,t,r))}}function gd(e){var t=e.alternate;return e===X||t!==null&&t===X}function vd(e,t){ur=Ms=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function yd(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,fi(e,n)}}var Is={readContext:De,useCallback:pe,useContext:pe,useEffect:pe,useImperativeHandle:pe,useInsertionEffect:pe,useLayoutEffect:pe,useMemo:pe,useReducer:pe,useRef:pe,useState:pe,useDebugValue:pe,useDeferredValue:pe,useTransition:pe,useMutableSource:pe,useSyncExternalStore:pe,useId:pe,unstable_isNewReconciler:!1},Op={readContext:De,useCallback:function(e,t){return Ye().memoizedState=[e,t===void 0?null:t],e},useContext:De,useEffect:qa,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,us(4194308,4,cd.bind(null,t,e),n)},useLayoutEffect:function(e,t){return us(4194308,4,e,t)},useInsertionEffect:function(e,t){return us(4,2,e,t)},useMemo:function(e,t){var n=Ye();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ye();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Rp.bind(null,X,e),[r.memoizedState,e]},useRef:function(e){var t=Ye();return e={current:e},t.memoizedState=e},useState:Ha,useDebugValue:Mi,useDeferredValue:function(e){return Ye().memoizedState=e},useTransition:function(){var e=Ha(!1),t=e[0];return e=Pp.bind(null,e[1]),Ye().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=X,s=Ye();if(J){if(n===void 0)throw Error(C(407));n=n()}else{if(n=t(),ue===null)throw Error(C(349));Zt&30||nd(r,t,n)}s.memoizedState=n;var l={value:n,getSnapshot:t};return s.queue=l,qa(sd.bind(null,r,l,e),[e]),r.flags|=2048,_r(9,rd.bind(null,r,l,n,t),void 0,null),n},useId:function(){var e=Ye(),t=ue.identifierPrefix;if(J){var n=it,r=ot;n=(r&~(1<<32-qe(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Cr++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Tp++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Ap={readContext:De,useCallback:fd,useContext:De,useEffect:Ai,useImperativeHandle:dd,useInsertionEffect:ad,useLayoutEffect:ud,useMemo:hd,useReducer:Il,useRef:id,useState:function(){return Il(Er)},useDebugValue:Mi,useDeferredValue:function(e){var t=Be();return pd(t,le.memoizedState,e)},useTransition:function(){var e=Il(Er)[0],t=Be().memoizedState;return[e,t]},useMutableSource:ed,useSyncExternalStore:td,useId:md,unstable_isNewReconciler:!1},Mp={readContext:De,useCallback:fd,useContext:De,useEffect:Ai,useImperativeHandle:dd,useInsertionEffect:ad,useLayoutEffect:ud,useMemo:hd,useReducer:zl,useRef:id,useState:function(){return zl(Er)},useDebugValue:Mi,useDeferredValue:function(e){var t=Be();return le===null?t.memoizedState=e:pd(t,le.memoizedState,e)},useTransition:function(){var e=zl(Er)[0],t=Be().memoizedState;return[e,t]},useMutableSource:ed,useSyncExternalStore:td,useId:md,unstable_isNewReconciler:!1};function Fe(e,t){if(e&&e.defaultProps){t=ee({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function _o(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:ee({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var tl={isMounted:function(e){return(e=e._reactInternals)?ln(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=we(),s=Lt(e),l=at(r,s);l.payload=t,n!=null&&(l.callback=n),t=Pt(e,l,s),t!==null&&(Ke(t,e,s,r),is(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=we(),s=Lt(e),l=at(r,s);l.tag=1,l.payload=t,n!=null&&(l.callback=n),t=Pt(e,l,s),t!==null&&(Ke(t,e,s,r),is(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=we(),r=Lt(e),s=at(n,r);s.tag=2,t!=null&&(s.callback=t),t=Pt(e,s,r),t!==null&&(Ke(t,e,r,n),is(t,e,r))}};function Ka(e,t,n,r,s,l,i){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,l,i):t.prototype&&t.prototype.isPureReactComponent?!wr(n,r)||!wr(s,l):!0}function xd(e,t,n){var r=!1,s=zt,l=t.contextType;return typeof l=="object"&&l!==null?l=De(l):(s=Ce(t)?Yt:ve.current,r=t.contextTypes,l=(r=r!=null)?_n(e,s):zt),t=new t(n,l),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=tl,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=l),t}function Qa(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&tl.enqueueReplaceState(t,t.state,null)}function To(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},Ei(e);var l=t.contextType;typeof l=="object"&&l!==null?s.context=De(l):(l=Ce(t)?Yt:ve.current,s.context=_n(e,l)),s.state=e.memoizedState,l=t.getDerivedStateFromProps,typeof l=="function"&&(_o(e,t,l,n),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&tl.enqueueReplaceState(s,s.state,null),Os(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function Ln(e,t){try{var n="",r=t;do n+=uh(r),r=r.return;while(r);var s=n}catch(l){s=`
|
|
39
|
+
Error generating stack: `+l.message+`
|
|
40
|
+
`+l.stack}return{value:e,source:t,stack:s,digest:null}}function $l(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Po(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Ip=typeof WeakMap=="function"?WeakMap:Map;function wd(e,t,n){n=at(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){$s||($s=!0,Bo=r),Po(e,t)},n}function Sd(e,t,n){n=at(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var s=t.value;n.payload=function(){return r(s)},n.callback=function(){Po(e,t)}}var l=e.stateNode;return l!==null&&typeof l.componentDidCatch=="function"&&(n.callback=function(){Po(e,t),typeof r!="function"&&(Rt===null?Rt=new Set([this]):Rt.add(this));var i=t.stack;this.componentDidCatch(t.value,{componentStack:i!==null?i:""})}),n}function Ja(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ip;var s=new Set;r.set(t,s)}else s=r.get(t),s===void 0&&(s=new Set,r.set(t,s));s.has(n)||(s.add(n),e=Gp.bind(null,e,t,n),t.then(e,e))}function Ga(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Ya(e,t,n,r,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=at(-1,1),t.tag=2,Pt(n,t,1))),n.lanes|=1),e)}var zp=ht.ReactCurrentOwner,je=!1;function ye(e,t,n,r){t.child=e===null?Gc(t,null,n,r):Pn(t,e.child,n,r)}function Xa(e,t,n,r,s){n=n.render;var l=t.ref;return bn(t,s),r=Li(e,t,n,r,l,s),n=Oi(),e!==null&&!je?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,ft(e,t,s)):(J&&n&&wi(t),t.flags|=1,ye(e,t,r,s),t.child)}function Za(e,t,n,r,s){if(e===null){var l=n.type;return typeof l=="function"&&!Vi(l)&&l.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=l,Nd(e,t,l,r,s)):(e=hs(n.type,null,r,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(l=e.child,!(e.lanes&s)){var i=l.memoizedProps;if(n=n.compare,n=n!==null?n:wr,n(i,r)&&e.ref===t.ref)return ft(e,t,s)}return t.flags|=1,e=Ot(l,r),e.ref=t.ref,e.return=t,t.child=e}function Nd(e,t,n,r,s){if(e!==null){var l=e.memoizedProps;if(wr(l,r)&&e.ref===t.ref)if(je=!1,t.pendingProps=r=l,(e.lanes&s)!==0)e.flags&131072&&(je=!0);else return t.lanes=e.lanes,ft(e,t,s)}return Ro(e,t,n,r,s)}function kd(e,t,n){var r=t.pendingProps,s=r.children,l=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},q(wn,_e),_e|=n;else{if(!(n&1073741824))return e=l!==null?l.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,q(wn,_e),_e|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=l!==null?l.baseLanes:n,q(wn,_e),_e|=r}else l!==null?(r=l.baseLanes|n,t.memoizedState=null):r=n,q(wn,_e),_e|=r;return ye(e,t,s,n),t.child}function jd(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Ro(e,t,n,r,s){var l=Ce(n)?Yt:ve.current;return l=_n(t,l),bn(t,s),n=Li(e,t,n,r,l,s),r=Oi(),e!==null&&!je?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,ft(e,t,s)):(J&&r&&wi(t),t.flags|=1,ye(e,t,n,s),t.child)}function eu(e,t,n,r,s){if(Ce(n)){var l=!0;_s(t)}else l=!1;if(bn(t,s),t.stateNode===null)cs(e,t),xd(t,n,r),To(t,n,r,s),r=!0;else if(e===null){var i=t.stateNode,a=t.memoizedProps;i.props=a;var u=i.context,f=n.contextType;typeof f=="object"&&f!==null?f=De(f):(f=Ce(n)?Yt:ve.current,f=_n(t,f));var m=n.getDerivedStateFromProps,p=typeof m=="function"||typeof i.getSnapshotBeforeUpdate=="function";p||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(a!==r||u!==f)&&Qa(t,i,r,f),wt=!1;var c=t.memoizedState;i.state=c,Os(t,r,i,s),u=t.memoizedState,a!==r||c!==u||be.current||wt?(typeof m=="function"&&(_o(t,n,m,r),u=t.memoizedState),(a=wt||Ka(t,n,a,r,c,u,f))?(p||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),i.props=r,i.state=u,i.context=f,r=a):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,Xc(e,t),a=t.memoizedProps,f=t.type===t.elementType?a:Fe(t.type,a),i.props=f,p=t.pendingProps,c=i.context,u=n.contextType,typeof u=="object"&&u!==null?u=De(u):(u=Ce(n)?Yt:ve.current,u=_n(t,u));var x=n.getDerivedStateFromProps;(m=typeof x=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(a!==p||c!==u)&&Qa(t,i,r,u),wt=!1,c=t.memoizedState,i.state=c,Os(t,r,i,s);var y=t.memoizedState;a!==p||c!==y||be.current||wt?(typeof x=="function"&&(_o(t,n,x,r),y=t.memoizedState),(f=wt||Ka(t,n,f,r,c,y,u)||!1)?(m||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(r,y,u),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(r,y,u)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||a===e.memoizedProps&&c===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&c===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=y),i.props=r,i.state=y,i.context=u,r=f):(typeof i.componentDidUpdate!="function"||a===e.memoizedProps&&c===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&c===e.memoizedState||(t.flags|=1024),r=!1)}return Lo(e,t,n,r,l,s)}function Lo(e,t,n,r,s,l){jd(e,t);var i=(t.flags&128)!==0;if(!r&&!i)return s&&Da(t,n,!1),ft(e,t,l);r=t.stateNode,zp.current=t;var a=i&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&i?(t.child=Pn(t,e.child,null,l),t.child=Pn(t,null,a,l)):ye(e,t,a,l),t.memoizedState=r.state,s&&Da(t,n,!0),t.child}function bd(e){var t=e.stateNode;t.pendingContext?$a(e,t.pendingContext,t.pendingContext!==t.context):t.context&&$a(e,t.context,!1),_i(e,t.containerInfo)}function tu(e,t,n,r,s){return Tn(),Ni(s),t.flags|=256,ye(e,t,n,r),t.child}var Oo={dehydrated:null,treeContext:null,retryLane:0};function Ao(e){return{baseLanes:e,cachePool:null,transitions:null}}function Cd(e,t,n){var r=t.pendingProps,s=Y.current,l=!1,i=(t.flags&128)!==0,a;if((a=i)||(a=e!==null&&e.memoizedState===null?!1:(s&2)!==0),a?(l=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),q(Y,s&1),e===null)return Co(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(i=r.children,e=r.fallback,l?(r=t.mode,l=t.child,i={mode:"hidden",children:i},!(r&1)&&l!==null?(l.childLanes=0,l.pendingProps=i):l=sl(i,r,0,null),e=Qt(e,r,n,null),l.return=t,e.return=t,l.sibling=e,t.child=l,t.child.memoizedState=Ao(n),t.memoizedState=Oo,e):Ii(t,i));if(s=e.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return $p(e,t,i,r,a,s,n);if(l){l=r.fallback,i=t.mode,s=e.child,a=s.sibling;var u={mode:"hidden",children:r.children};return!(i&1)&&t.child!==s?(r=t.child,r.childLanes=0,r.pendingProps=u,t.deletions=null):(r=Ot(s,u),r.subtreeFlags=s.subtreeFlags&14680064),a!==null?l=Ot(a,l):(l=Qt(l,i,n,null),l.flags|=2),l.return=t,r.return=t,r.sibling=l,t.child=r,r=l,l=t.child,i=e.child.memoizedState,i=i===null?Ao(n):{baseLanes:i.baseLanes|n,cachePool:null,transitions:i.transitions},l.memoizedState=i,l.childLanes=e.childLanes&~n,t.memoizedState=Oo,r}return l=e.child,e=l.sibling,r=Ot(l,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Ii(e,t){return t=sl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Gr(e,t,n,r){return r!==null&&Ni(r),Pn(t,e.child,null,n),e=Ii(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function $p(e,t,n,r,s,l,i){if(n)return t.flags&256?(t.flags&=-257,r=$l(Error(C(422))),Gr(e,t,i,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(l=r.fallback,s=t.mode,r=sl({mode:"visible",children:r.children},s,0,null),l=Qt(l,s,i,null),l.flags|=2,r.return=t,l.return=t,r.sibling=l,t.child=r,t.mode&1&&Pn(t,e.child,null,i),t.child.memoizedState=Ao(i),t.memoizedState=Oo,l);if(!(t.mode&1))return Gr(e,t,i,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var a=r.dgst;return r=a,l=Error(C(419)),r=$l(l,r,void 0),Gr(e,t,i,r)}if(a=(i&e.childLanes)!==0,je||a){if(r=ue,r!==null){switch(i&-i){case 4:s=2;break;case 16:s=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(r.suspendedLanes|i)?0:s,s!==0&&s!==l.retryLane&&(l.retryLane=s,dt(e,s),Ke(r,e,s,-1))}return Fi(),r=$l(Error(C(421))),Gr(e,t,i,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=Yp.bind(null,e),s._reactRetry=t,null):(e=l.treeContext,Te=Tt(s.nextSibling),Pe=t,J=!0,He=null,e!==null&&(Ae[Me++]=ot,Ae[Me++]=it,Ae[Me++]=Xt,ot=e.id,it=e.overflow,Xt=t),t=Ii(t,r.children),t.flags|=4096,t)}function nu(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Eo(e.return,t,n)}function Dl(e,t,n,r,s){var l=e.memoizedState;l===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(l.isBackwards=t,l.rendering=null,l.renderingStartTime=0,l.last=r,l.tail=n,l.tailMode=s)}function Ed(e,t,n){var r=t.pendingProps,s=r.revealOrder,l=r.tail;if(ye(e,t,r.children,n),r=Y.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&nu(e,n,t);else if(e.tag===19)nu(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(q(Y,r),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&As(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),Dl(t,!1,s,n,l);break;case"backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&As(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}Dl(t,!0,n,null,l);break;case"together":Dl(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function cs(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ft(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),en|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(C(153));if(t.child!==null){for(e=t.child,n=Ot(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ot(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Dp(e,t,n){switch(t.tag){case 3:bd(t),Tn();break;case 5:Zc(t);break;case 1:Ce(t.type)&&_s(t);break;case 4:_i(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;q(Rs,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(q(Y,Y.current&1),t.flags|=128,null):n&t.child.childLanes?Cd(e,t,n):(q(Y,Y.current&1),e=ft(e,t,n),e!==null?e.sibling:null);q(Y,Y.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Ed(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),q(Y,Y.current),r)break;return null;case 22:case 23:return t.lanes=0,kd(e,t,n)}return ft(e,t,n)}var _d,Mo,Td,Pd;_d=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&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;n=n.return}n.sibling.return=n.return,n=n.sibling}};Mo=function(){};Td=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,qt(et.current);var l=null;switch(n){case"input":s=no(e,s),r=no(e,r),l=[];break;case"select":s=ee({},s,{value:void 0}),r=ee({},r,{value:void 0}),l=[];break;case"textarea":s=lo(e,s),r=lo(e,r),l=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Cs)}io(n,r);var i;n=null;for(f in s)if(!r.hasOwnProperty(f)&&s.hasOwnProperty(f)&&s[f]!=null)if(f==="style"){var a=s[f];for(i in a)a.hasOwnProperty(i)&&(n||(n={}),n[i]="")}else f!=="dangerouslySetInnerHTML"&&f!=="children"&&f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&f!=="autoFocus"&&(hr.hasOwnProperty(f)?l||(l=[]):(l=l||[]).push(f,null));for(f in r){var u=r[f];if(a=s!=null?s[f]:void 0,r.hasOwnProperty(f)&&u!==a&&(u!=null||a!=null))if(f==="style")if(a){for(i in a)!a.hasOwnProperty(i)||u&&u.hasOwnProperty(i)||(n||(n={}),n[i]="");for(i in u)u.hasOwnProperty(i)&&a[i]!==u[i]&&(n||(n={}),n[i]=u[i])}else n||(l||(l=[]),l.push(f,n)),n=u;else f==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,a=a?a.__html:void 0,u!=null&&a!==u&&(l=l||[]).push(f,u)):f==="children"?typeof u!="string"&&typeof u!="number"||(l=l||[]).push(f,""+u):f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&(hr.hasOwnProperty(f)?(u!=null&&f==="onScroll"&&K("scroll",e),l||a===u||(l=[])):(l=l||[]).push(f,u))}n&&(l=l||[]).push("style",n);var f=l;(t.updateQueue=f)&&(t.flags|=4)}};Pd=function(e,t,n,r){n!==r&&(t.flags|=4)};function Gn(e,t){if(!J)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function me(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Bp(e,t,n){var r=t.pendingProps;switch(Si(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return me(t),null;case 1:return Ce(t.type)&&Es(),me(t),null;case 3:return r=t.stateNode,Rn(),Q(be),Q(ve),Pi(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Qr(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,He!==null&&(Vo(He),He=null))),Mo(e,t),me(t),null;case 5:Ti(t);var s=qt(br.current);if(n=t.type,e!==null&&t.stateNode!=null)Td(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(C(166));return me(t),null}if(e=qt(et.current),Qr(t)){r=t.stateNode,n=t.type;var l=t.memoizedProps;switch(r[Xe]=t,r[kr]=l,e=(t.mode&1)!==0,n){case"dialog":K("cancel",r),K("close",r);break;case"iframe":case"object":case"embed":K("load",r);break;case"video":case"audio":for(s=0;s<nr.length;s++)K(nr[s],r);break;case"source":K("error",r);break;case"img":case"image":case"link":K("error",r),K("load",r);break;case"details":K("toggle",r);break;case"input":da(r,l),K("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!l.multiple},K("invalid",r);break;case"textarea":ha(r,l),K("invalid",r)}io(n,l),s=null;for(var i in l)if(l.hasOwnProperty(i)){var a=l[i];i==="children"?typeof a=="string"?r.textContent!==a&&(l.suppressHydrationWarning!==!0&&Kr(r.textContent,a,e),s=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(l.suppressHydrationWarning!==!0&&Kr(r.textContent,a,e),s=["children",""+a]):hr.hasOwnProperty(i)&&a!=null&&i==="onScroll"&&K("scroll",r)}switch(n){case"input":Dr(r),fa(r,l,!0);break;case"textarea":Dr(r),pa(r);break;case"select":case"option":break;default:typeof l.onClick=="function"&&(r.onclick=Cs)}r=s,t.updateQueue=r,r!==null&&(t.flags|=4)}else{i=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=sc(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=i.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[Xe]=t,e[kr]=r,_d(e,t,!1,!1),t.stateNode=e;e:{switch(i=ao(n,r),n){case"dialog":K("cancel",e),K("close",e),s=r;break;case"iframe":case"object":case"embed":K("load",e),s=r;break;case"video":case"audio":for(s=0;s<nr.length;s++)K(nr[s],e);s=r;break;case"source":K("error",e),s=r;break;case"img":case"image":case"link":K("error",e),K("load",e),s=r;break;case"details":K("toggle",e),s=r;break;case"input":da(e,r),s=no(e,r),K("invalid",e);break;case"option":s=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=ee({},r,{value:void 0}),K("invalid",e);break;case"textarea":ha(e,r),s=lo(e,r),K("invalid",e);break;default:s=r}io(n,s),a=s;for(l in a)if(a.hasOwnProperty(l)){var u=a[l];l==="style"?ic(e,u):l==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&lc(e,u)):l==="children"?typeof u=="string"?(n!=="textarea"||u!=="")&&pr(e,u):typeof u=="number"&&pr(e,""+u):l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&l!=="autoFocus"&&(hr.hasOwnProperty(l)?u!=null&&l==="onScroll"&&K("scroll",e):u!=null&&oi(e,l,u,i))}switch(n){case"input":Dr(e),fa(e,r,!1);break;case"textarea":Dr(e),pa(e);break;case"option":r.value!=null&&e.setAttribute("value",""+It(r.value));break;case"select":e.multiple=!!r.multiple,l=r.value,l!=null?Sn(e,!!r.multiple,l,!1):r.defaultValue!=null&&Sn(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=Cs)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return me(t),null;case 6:if(e&&t.stateNode!=null)Pd(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(C(166));if(n=qt(br.current),qt(et.current),Qr(t)){if(r=t.stateNode,n=t.memoizedProps,r[Xe]=t,(l=r.nodeValue!==n)&&(e=Pe,e!==null))switch(e.tag){case 3:Kr(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Kr(r.nodeValue,n,(e.mode&1)!==0)}l&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Xe]=t,t.stateNode=r}return me(t),null;case 13:if(Q(Y),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(J&&Te!==null&&t.mode&1&&!(t.flags&128))Qc(),Tn(),t.flags|=98560,l=!1;else if(l=Qr(t),r!==null&&r.dehydrated!==null){if(e===null){if(!l)throw Error(C(318));if(l=t.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(C(317));l[Xe]=t}else Tn(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;me(t),l=!1}else He!==null&&(Vo(He),He=null),l=!0;if(!l)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Y.current&1?oe===0&&(oe=3):Fi())),t.updateQueue!==null&&(t.flags|=4),me(t),null);case 4:return Rn(),Mo(e,t),e===null&&Sr(t.stateNode.containerInfo),me(t),null;case 10:return bi(t.type._context),me(t),null;case 17:return Ce(t.type)&&Es(),me(t),null;case 19:if(Q(Y),l=t.memoizedState,l===null)return me(t),null;if(r=(t.flags&128)!==0,i=l.rendering,i===null)if(r)Gn(l,!1);else{if(oe!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=As(e),i!==null){for(t.flags|=128,Gn(l,!1),r=i.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)l=n,e=r,l.flags&=14680066,i=l.alternate,i===null?(l.childLanes=0,l.lanes=e,l.child=null,l.subtreeFlags=0,l.memoizedProps=null,l.memoizedState=null,l.updateQueue=null,l.dependencies=null,l.stateNode=null):(l.childLanes=i.childLanes,l.lanes=i.lanes,l.child=i.child,l.subtreeFlags=0,l.deletions=null,l.memoizedProps=i.memoizedProps,l.memoizedState=i.memoizedState,l.updateQueue=i.updateQueue,l.type=i.type,e=i.dependencies,l.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return q(Y,Y.current&1|2),t.child}e=e.sibling}l.tail!==null&&ne()>On&&(t.flags|=128,r=!0,Gn(l,!1),t.lanes=4194304)}else{if(!r)if(e=As(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Gn(l,!0),l.tail===null&&l.tailMode==="hidden"&&!i.alternate&&!J)return me(t),null}else 2*ne()-l.renderingStartTime>On&&n!==1073741824&&(t.flags|=128,r=!0,Gn(l,!1),t.lanes=4194304);l.isBackwards?(i.sibling=t.child,t.child=i):(n=l.last,n!==null?n.sibling=i:t.child=i,l.last=i)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=ne(),t.sibling=null,n=Y.current,q(Y,r?n&1|2:n&1),t):(me(t),null);case 22:case 23:return Ui(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?_e&1073741824&&(me(t),t.subtreeFlags&6&&(t.flags|=8192)):me(t),null;case 24:return null;case 25:return null}throw Error(C(156,t.tag))}function Up(e,t){switch(Si(t),t.tag){case 1:return Ce(t.type)&&Es(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Rn(),Q(be),Q(ve),Pi(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ti(t),null;case 13:if(Q(Y),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(C(340));Tn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Q(Y),null;case 4:return Rn(),null;case 10:return bi(t.type._context),null;case 22:case 23:return Ui(),null;case 24:return null;default:return null}}var Yr=!1,ge=!1,Fp=typeof WeakSet=="function"?WeakSet:Set,O=null;function xn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){te(e,t,r)}else n.current=null}function Io(e,t,n){try{n()}catch(r){te(e,t,r)}}var ru=!1;function Vp(e,t){if(xo=ks,e=Mc(),xi(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,l=r.focusNode;r=r.focusOffset;try{n.nodeType,l.nodeType}catch{n=null;break e}var i=0,a=-1,u=-1,f=0,m=0,p=e,c=null;t:for(;;){for(var x;p!==n||s!==0&&p.nodeType!==3||(a=i+s),p!==l||r!==0&&p.nodeType!==3||(u=i+r),p.nodeType===3&&(i+=p.nodeValue.length),(x=p.firstChild)!==null;)c=p,p=x;for(;;){if(p===e)break t;if(c===n&&++f===s&&(a=i),c===l&&++m===r&&(u=i),(x=p.nextSibling)!==null)break;p=c,c=p.parentNode}p=x}n=a===-1||u===-1?null:{start:a,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(wo={focusedElem:e,selectionRange:n},ks=!1,O=t;O!==null;)if(t=O,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,O=e;else for(;O!==null;){t=O;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var w=y.memoizedProps,b=y.memoizedState,g=t.stateNode,d=g.getSnapshotBeforeUpdate(t.elementType===t.type?w:Fe(t.type,w),b);g.__reactInternalSnapshotBeforeUpdate=d}break;case 3:var h=t.stateNode.containerInfo;h.nodeType===1?h.textContent="":h.nodeType===9&&h.documentElement&&h.removeChild(h.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(C(163))}}catch(k){te(t,t.return,k)}if(e=t.sibling,e!==null){e.return=t.return,O=e;break}O=t.return}return y=ru,ru=!1,y}function cr(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var l=s.destroy;s.destroy=void 0,l!==void 0&&Io(t,n,l)}s=s.next}while(s!==r)}}function nl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function zo(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Rd(e){var t=e.alternate;t!==null&&(e.alternate=null,Rd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Xe],delete t[kr],delete t[ko],delete t[bp],delete t[Cp])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Ld(e){return e.tag===5||e.tag===3||e.tag===4}function su(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ld(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function $o(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Cs));else if(r!==4&&(e=e.child,e!==null))for($o(e,t,n),e=e.sibling;e!==null;)$o(e,t,n),e=e.sibling}function Do(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Do(e,t,n),e=e.sibling;e!==null;)Do(e,t,n),e=e.sibling}var ce=null,Ve=!1;function vt(e,t,n){for(n=n.child;n!==null;)Od(e,t,n),n=n.sibling}function Od(e,t,n){if(Ze&&typeof Ze.onCommitFiberUnmount=="function")try{Ze.onCommitFiberUnmount(Qs,n)}catch{}switch(n.tag){case 5:ge||xn(n,t);case 6:var r=ce,s=Ve;ce=null,vt(e,t,n),ce=r,Ve=s,ce!==null&&(Ve?(e=ce,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ce.removeChild(n.stateNode));break;case 18:ce!==null&&(Ve?(e=ce,n=n.stateNode,e.nodeType===8?Ll(e.parentNode,n):e.nodeType===1&&Ll(e,n),yr(e)):Ll(ce,n.stateNode));break;case 4:r=ce,s=Ve,ce=n.stateNode.containerInfo,Ve=!0,vt(e,t,n),ce=r,Ve=s;break;case 0:case 11:case 14:case 15:if(!ge&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var l=s,i=l.destroy;l=l.tag,i!==void 0&&(l&2||l&4)&&Io(n,t,i),s=s.next}while(s!==r)}vt(e,t,n);break;case 1:if(!ge&&(xn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){te(n,t,a)}vt(e,t,n);break;case 21:vt(e,t,n);break;case 22:n.mode&1?(ge=(r=ge)||n.memoizedState!==null,vt(e,t,n),ge=r):vt(e,t,n);break;default:vt(e,t,n)}}function lu(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Fp),t.forEach(function(r){var s=Xp.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function Ue(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];try{var l=e,i=t,a=i;e:for(;a!==null;){switch(a.tag){case 5:ce=a.stateNode,Ve=!1;break e;case 3:ce=a.stateNode.containerInfo,Ve=!0;break e;case 4:ce=a.stateNode.containerInfo,Ve=!0;break e}a=a.return}if(ce===null)throw Error(C(160));Od(l,i,s),ce=null,Ve=!1;var u=s.alternate;u!==null&&(u.return=null),s.return=null}catch(f){te(s,t,f)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Ad(t,e),t=t.sibling}function Ad(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Ue(t,e),Ge(e),r&4){try{cr(3,e,e.return),nl(3,e)}catch(w){te(e,e.return,w)}try{cr(5,e,e.return)}catch(w){te(e,e.return,w)}}break;case 1:Ue(t,e),Ge(e),r&512&&n!==null&&xn(n,n.return);break;case 5:if(Ue(t,e),Ge(e),r&512&&n!==null&&xn(n,n.return),e.flags&32){var s=e.stateNode;try{pr(s,"")}catch(w){te(e,e.return,w)}}if(r&4&&(s=e.stateNode,s!=null)){var l=e.memoizedProps,i=n!==null?n.memoizedProps:l,a=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{a==="input"&&l.type==="radio"&&l.name!=null&&nc(s,l),ao(a,i);var f=ao(a,l);for(i=0;i<u.length;i+=2){var m=u[i],p=u[i+1];m==="style"?ic(s,p):m==="dangerouslySetInnerHTML"?lc(s,p):m==="children"?pr(s,p):oi(s,m,p,f)}switch(a){case"input":ro(s,l);break;case"textarea":rc(s,l);break;case"select":var c=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!l.multiple;var x=l.value;x!=null?Sn(s,!!l.multiple,x,!1):c!==!!l.multiple&&(l.defaultValue!=null?Sn(s,!!l.multiple,l.defaultValue,!0):Sn(s,!!l.multiple,l.multiple?[]:"",!1))}s[kr]=l}catch(w){te(e,e.return,w)}}break;case 6:if(Ue(t,e),Ge(e),r&4){if(e.stateNode===null)throw Error(C(162));s=e.stateNode,l=e.memoizedProps;try{s.nodeValue=l}catch(w){te(e,e.return,w)}}break;case 3:if(Ue(t,e),Ge(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{yr(t.containerInfo)}catch(w){te(e,e.return,w)}break;case 4:Ue(t,e),Ge(e);break;case 13:Ue(t,e),Ge(e),s=e.child,s.flags&8192&&(l=s.memoizedState!==null,s.stateNode.isHidden=l,!l||s.alternate!==null&&s.alternate.memoizedState!==null||(Di=ne())),r&4&&lu(e);break;case 22:if(m=n!==null&&n.memoizedState!==null,e.mode&1?(ge=(f=ge)||m,Ue(t,e),ge=f):Ue(t,e),Ge(e),r&8192){if(f=e.memoizedState!==null,(e.stateNode.isHidden=f)&&!m&&e.mode&1)for(O=e,m=e.child;m!==null;){for(p=O=m;O!==null;){switch(c=O,x=c.child,c.tag){case 0:case 11:case 14:case 15:cr(4,c,c.return);break;case 1:xn(c,c.return);var y=c.stateNode;if(typeof y.componentWillUnmount=="function"){r=c,n=c.return;try{t=r,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(w){te(r,n,w)}}break;case 5:xn(c,c.return);break;case 22:if(c.memoizedState!==null){iu(p);continue}}x!==null?(x.return=c,O=x):iu(p)}m=m.sibling}e:for(m=null,p=e;;){if(p.tag===5){if(m===null){m=p;try{s=p.stateNode,f?(l=s.style,typeof l.setProperty=="function"?l.setProperty("display","none","important"):l.display="none"):(a=p.stateNode,u=p.memoizedProps.style,i=u!=null&&u.hasOwnProperty("display")?u.display:null,a.style.display=oc("display",i))}catch(w){te(e,e.return,w)}}}else if(p.tag===6){if(m===null)try{p.stateNode.nodeValue=f?"":p.memoizedProps}catch(w){te(e,e.return,w)}}else if((p.tag!==22&&p.tag!==23||p.memoizedState===null||p===e)&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===e)break e;for(;p.sibling===null;){if(p.return===null||p.return===e)break e;m===p&&(m=null),p=p.return}m===p&&(m=null),p.sibling.return=p.return,p=p.sibling}}break;case 19:Ue(t,e),Ge(e),r&4&&lu(e);break;case 21:break;default:Ue(t,e),Ge(e)}}function Ge(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Ld(n)){var r=n;break e}n=n.return}throw Error(C(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(pr(s,""),r.flags&=-33);var l=su(e);Do(e,l,s);break;case 3:case 4:var i=r.stateNode.containerInfo,a=su(e);$o(e,a,i);break;default:throw Error(C(161))}}catch(u){te(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Wp(e,t,n){O=e,Md(e)}function Md(e,t,n){for(var r=(e.mode&1)!==0;O!==null;){var s=O,l=s.child;if(s.tag===22&&r){var i=s.memoizedState!==null||Yr;if(!i){var a=s.alternate,u=a!==null&&a.memoizedState!==null||ge;a=Yr;var f=ge;if(Yr=i,(ge=u)&&!f)for(O=s;O!==null;)i=O,u=i.child,i.tag===22&&i.memoizedState!==null?au(s):u!==null?(u.return=i,O=u):au(s);for(;l!==null;)O=l,Md(l),l=l.sibling;O=s,Yr=a,ge=f}ou(e)}else s.subtreeFlags&8772&&l!==null?(l.return=s,O=l):ou(e)}}function ou(e){for(;O!==null;){var t=O;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:ge||nl(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!ge)if(n===null)r.componentDidMount();else{var s=t.elementType===t.type?n.memoizedProps:Fe(t.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var l=t.updateQueue;l!==null&&Wa(t,l,r);break;case 3:var i=t.updateQueue;if(i!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Wa(t,i,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&n.focus();break;case"img":u.src&&(n.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var f=t.alternate;if(f!==null){var m=f.memoizedState;if(m!==null){var p=m.dehydrated;p!==null&&yr(p)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(C(163))}ge||t.flags&512&&zo(t)}catch(c){te(t,t.return,c)}}if(t===e){O=null;break}if(n=t.sibling,n!==null){n.return=t.return,O=n;break}O=t.return}}function iu(e){for(;O!==null;){var t=O;if(t===e){O=null;break}var n=t.sibling;if(n!==null){n.return=t.return,O=n;break}O=t.return}}function au(e){for(;O!==null;){var t=O;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{nl(4,t)}catch(u){te(t,n,u)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var s=t.return;try{r.componentDidMount()}catch(u){te(t,s,u)}}var l=t.return;try{zo(t)}catch(u){te(t,l,u)}break;case 5:var i=t.return;try{zo(t)}catch(u){te(t,i,u)}}}catch(u){te(t,t.return,u)}if(t===e){O=null;break}var a=t.sibling;if(a!==null){a.return=t.return,O=a;break}O=t.return}}var Hp=Math.ceil,zs=ht.ReactCurrentDispatcher,zi=ht.ReactCurrentOwner,$e=ht.ReactCurrentBatchConfig,D=0,ue=null,re=null,de=0,_e=0,wn=Dt(0),oe=0,Tr=null,en=0,rl=0,$i=0,dr=null,ke=null,Di=0,On=1/0,st=null,$s=!1,Bo=null,Rt=null,Xr=!1,jt=null,Ds=0,fr=0,Uo=null,ds=-1,fs=0;function we(){return D&6?ne():ds!==-1?ds:ds=ne()}function Lt(e){return e.mode&1?D&2&&de!==0?de&-de:_p.transition!==null?(fs===0&&(fs=xc()),fs):(e=V,e!==0||(e=window.event,e=e===void 0?16:Cc(e.type)),e):1}function Ke(e,t,n,r){if(50<fr)throw fr=0,Uo=null,Error(C(185));Or(e,n,r),(!(D&2)||e!==ue)&&(e===ue&&(!(D&2)&&(rl|=n),oe===4&&Nt(e,de)),Ee(e,r),n===1&&D===0&&!(t.mode&1)&&(On=ne()+500,Zs&&Bt()))}function Ee(e,t){var n=e.callbackNode;_h(e,t);var r=Ns(e,e===ue?de:0);if(r===0)n!==null&&va(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&va(n),t===1)e.tag===0?Ep(uu.bind(null,e)):Hc(uu.bind(null,e)),kp(function(){!(D&6)&&Bt()}),n=null;else{switch(wc(r)){case 1:n=di;break;case 4:n=vc;break;case 16:n=Ss;break;case 536870912:n=yc;break;default:n=Ss}n=Vd(n,Id.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Id(e,t){if(ds=-1,fs=0,D&6)throw Error(C(327));var n=e.callbackNode;if(Cn()&&e.callbackNode!==n)return null;var r=Ns(e,e===ue?de:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Bs(e,r);else{t=r;var s=D;D|=2;var l=$d();(ue!==e||de!==t)&&(st=null,On=ne()+500,Kt(e,t));do try{Qp();break}catch(a){zd(e,a)}while(!0);ji(),zs.current=l,D=s,re!==null?t=0:(ue=null,de=0,t=oe)}if(t!==0){if(t===2&&(s=po(e),s!==0&&(r=s,t=Fo(e,s))),t===1)throw n=Tr,Kt(e,0),Nt(e,r),Ee(e,ne()),n;if(t===6)Nt(e,r);else{if(s=e.current.alternate,!(r&30)&&!qp(s)&&(t=Bs(e,r),t===2&&(l=po(e),l!==0&&(r=l,t=Fo(e,l))),t===1))throw n=Tr,Kt(e,0),Nt(e,r),Ee(e,ne()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(C(345));case 2:Vt(e,ke,st);break;case 3:if(Nt(e,r),(r&130023424)===r&&(t=Di+500-ne(),10<t)){if(Ns(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){we(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=No(Vt.bind(null,e,ke,st),t);break}Vt(e,ke,st);break;case 4:if(Nt(e,r),(r&4194240)===r)break;for(t=e.eventTimes,s=-1;0<r;){var i=31-qe(r);l=1<<i,i=t[i],i>s&&(s=i),r&=~l}if(r=s,r=ne()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Hp(r/1960))-r,10<r){e.timeoutHandle=No(Vt.bind(null,e,ke,st),r);break}Vt(e,ke,st);break;case 5:Vt(e,ke,st);break;default:throw Error(C(329))}}}return Ee(e,ne()),e.callbackNode===n?Id.bind(null,e):null}function Fo(e,t){var n=dr;return e.current.memoizedState.isDehydrated&&(Kt(e,t).flags|=256),e=Bs(e,t),e!==2&&(t=ke,ke=n,t!==null&&Vo(t)),e}function Vo(e){ke===null?ke=e:ke.push.apply(ke,e)}function qp(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var s=n[r],l=s.getSnapshot;s=s.value;try{if(!Qe(l(),s))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Nt(e,t){for(t&=~$i,t&=~rl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-qe(t),r=1<<n;e[n]=-1,t&=~r}}function uu(e){if(D&6)throw Error(C(327));Cn();var t=Ns(e,0);if(!(t&1))return Ee(e,ne()),null;var n=Bs(e,t);if(e.tag!==0&&n===2){var r=po(e);r!==0&&(t=r,n=Fo(e,r))}if(n===1)throw n=Tr,Kt(e,0),Nt(e,t),Ee(e,ne()),n;if(n===6)throw Error(C(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Vt(e,ke,st),Ee(e,ne()),null}function Bi(e,t){var n=D;D|=1;try{return e(t)}finally{D=n,D===0&&(On=ne()+500,Zs&&Bt())}}function tn(e){jt!==null&&jt.tag===0&&!(D&6)&&Cn();var t=D;D|=1;var n=$e.transition,r=V;try{if($e.transition=null,V=1,e)return e()}finally{V=r,$e.transition=n,D=t,!(D&6)&&Bt()}}function Ui(){_e=wn.current,Q(wn)}function Kt(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Np(n)),re!==null)for(n=re.return;n!==null;){var r=n;switch(Si(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Es();break;case 3:Rn(),Q(be),Q(ve),Pi();break;case 5:Ti(r);break;case 4:Rn();break;case 13:Q(Y);break;case 19:Q(Y);break;case 10:bi(r.type._context);break;case 22:case 23:Ui()}n=n.return}if(ue=e,re=e=Ot(e.current,null),de=_e=t,oe=0,Tr=null,$i=rl=en=0,ke=dr=null,Ht!==null){for(t=0;t<Ht.length;t++)if(n=Ht[t],r=n.interleaved,r!==null){n.interleaved=null;var s=r.next,l=n.pending;if(l!==null){var i=l.next;l.next=s,r.next=i}n.pending=r}Ht=null}return e}function zd(e,t){do{var n=re;try{if(ji(),as.current=Is,Ms){for(var r=X.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}Ms=!1}if(Zt=0,ae=le=X=null,ur=!1,Cr=0,zi.current=null,n===null||n.return===null){oe=1,Tr=t,re=null;break}e:{var l=e,i=n.return,a=n,u=t;if(t=de,a.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var f=u,m=a,p=m.tag;if(!(m.mode&1)&&(p===0||p===11||p===15)){var c=m.alternate;c?(m.updateQueue=c.updateQueue,m.memoizedState=c.memoizedState,m.lanes=c.lanes):(m.updateQueue=null,m.memoizedState=null)}var x=Ga(i);if(x!==null){x.flags&=-257,Ya(x,i,a,l,t),x.mode&1&&Ja(l,f,t),t=x,u=f;var y=t.updateQueue;if(y===null){var w=new Set;w.add(u),t.updateQueue=w}else y.add(u);break e}else{if(!(t&1)){Ja(l,f,t),Fi();break e}u=Error(C(426))}}else if(J&&a.mode&1){var b=Ga(i);if(b!==null){!(b.flags&65536)&&(b.flags|=256),Ya(b,i,a,l,t),Ni(Ln(u,a));break e}}l=u=Ln(u,a),oe!==4&&(oe=2),dr===null?dr=[l]:dr.push(l),l=i;do{switch(l.tag){case 3:l.flags|=65536,t&=-t,l.lanes|=t;var g=wd(l,u,t);Va(l,g);break e;case 1:a=u;var d=l.type,h=l.stateNode;if(!(l.flags&128)&&(typeof d.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(Rt===null||!Rt.has(h)))){l.flags|=65536,t&=-t,l.lanes|=t;var k=Sd(l,a,t);Va(l,k);break e}}l=l.return}while(l!==null)}Bd(n)}catch(E){t=E,re===n&&n!==null&&(re=n=n.return);continue}break}while(!0)}function $d(){var e=zs.current;return zs.current=Is,e===null?Is:e}function Fi(){(oe===0||oe===3||oe===2)&&(oe=4),ue===null||!(en&268435455)&&!(rl&268435455)||Nt(ue,de)}function Bs(e,t){var n=D;D|=2;var r=$d();(ue!==e||de!==t)&&(st=null,Kt(e,t));do try{Kp();break}catch(s){zd(e,s)}while(!0);if(ji(),D=n,zs.current=r,re!==null)throw Error(C(261));return ue=null,de=0,oe}function Kp(){for(;re!==null;)Dd(re)}function Qp(){for(;re!==null&&!xh();)Dd(re)}function Dd(e){var t=Fd(e.alternate,e,_e);e.memoizedProps=e.pendingProps,t===null?Bd(e):re=t,zi.current=null}function Bd(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Up(n,t),n!==null){n.flags&=32767,re=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{oe=6,re=null;return}}else if(n=Bp(n,t,_e),n!==null){re=n;return}if(t=t.sibling,t!==null){re=t;return}re=t=e}while(t!==null);oe===0&&(oe=5)}function Vt(e,t,n){var r=V,s=$e.transition;try{$e.transition=null,V=1,Jp(e,t,n,r)}finally{$e.transition=s,V=r}return null}function Jp(e,t,n,r){do Cn();while(jt!==null);if(D&6)throw Error(C(327));n=e.finishedWork;var s=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(C(177));e.callbackNode=null,e.callbackPriority=0;var l=n.lanes|n.childLanes;if(Th(e,l),e===ue&&(re=ue=null,de=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Xr||(Xr=!0,Vd(Ss,function(){return Cn(),null})),l=(n.flags&15990)!==0,n.subtreeFlags&15990||l){l=$e.transition,$e.transition=null;var i=V;V=1;var a=D;D|=4,zi.current=null,Vp(e,n),Ad(n,e),mp(wo),ks=!!xo,wo=xo=null,e.current=n,Wp(n),wh(),D=a,V=i,$e.transition=l}else e.current=n;if(Xr&&(Xr=!1,jt=e,Ds=s),l=e.pendingLanes,l===0&&(Rt=null),kh(n.stateNode),Ee(e,ne()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)s=t[n],r(s.value,{componentStack:s.stack,digest:s.digest});if($s)throw $s=!1,e=Bo,Bo=null,e;return Ds&1&&e.tag!==0&&Cn(),l=e.pendingLanes,l&1?e===Uo?fr++:(fr=0,Uo=e):fr=0,Bt(),null}function Cn(){if(jt!==null){var e=wc(Ds),t=$e.transition,n=V;try{if($e.transition=null,V=16>e?16:e,jt===null)var r=!1;else{if(e=jt,jt=null,Ds=0,D&6)throw Error(C(331));var s=D;for(D|=4,O=e.current;O!==null;){var l=O,i=l.child;if(O.flags&16){var a=l.deletions;if(a!==null){for(var u=0;u<a.length;u++){var f=a[u];for(O=f;O!==null;){var m=O;switch(m.tag){case 0:case 11:case 15:cr(8,m,l)}var p=m.child;if(p!==null)p.return=m,O=p;else for(;O!==null;){m=O;var c=m.sibling,x=m.return;if(Rd(m),m===f){O=null;break}if(c!==null){c.return=x,O=c;break}O=x}}}var y=l.alternate;if(y!==null){var w=y.child;if(w!==null){y.child=null;do{var b=w.sibling;w.sibling=null,w=b}while(w!==null)}}O=l}}if(l.subtreeFlags&2064&&i!==null)i.return=l,O=i;else e:for(;O!==null;){if(l=O,l.flags&2048)switch(l.tag){case 0:case 11:case 15:cr(9,l,l.return)}var g=l.sibling;if(g!==null){g.return=l.return,O=g;break e}O=l.return}}var d=e.current;for(O=d;O!==null;){i=O;var h=i.child;if(i.subtreeFlags&2064&&h!==null)h.return=i,O=h;else e:for(i=d;O!==null;){if(a=O,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:nl(9,a)}}catch(E){te(a,a.return,E)}if(a===i){O=null;break e}var k=a.sibling;if(k!==null){k.return=a.return,O=k;break e}O=a.return}}if(D=s,Bt(),Ze&&typeof Ze.onPostCommitFiberRoot=="function")try{Ze.onPostCommitFiberRoot(Qs,e)}catch{}r=!0}return r}finally{V=n,$e.transition=t}}return!1}function cu(e,t,n){t=Ln(n,t),t=wd(e,t,1),e=Pt(e,t,1),t=we(),e!==null&&(Or(e,1,t),Ee(e,t))}function te(e,t,n){if(e.tag===3)cu(e,e,n);else for(;t!==null;){if(t.tag===3){cu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Rt===null||!Rt.has(r))){e=Ln(n,e),e=Sd(t,e,1),t=Pt(t,e,1),e=we(),t!==null&&(Or(t,1,e),Ee(t,e));break}}t=t.return}}function Gp(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=we(),e.pingedLanes|=e.suspendedLanes&n,ue===e&&(de&n)===n&&(oe===4||oe===3&&(de&130023424)===de&&500>ne()-Di?Kt(e,0):$i|=n),Ee(e,t)}function Ud(e,t){t===0&&(e.mode&1?(t=Fr,Fr<<=1,!(Fr&130023424)&&(Fr=4194304)):t=1);var n=we();e=dt(e,t),e!==null&&(Or(e,t,n),Ee(e,n))}function Yp(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ud(e,n)}function Xp(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(C(314))}r!==null&&r.delete(t),Ud(e,n)}var Fd;Fd=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||be.current)je=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return je=!1,Dp(e,t,n);je=!!(e.flags&131072)}else je=!1,J&&t.flags&1048576&&qc(t,Ps,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;cs(e,t),e=t.pendingProps;var s=_n(t,ve.current);bn(t,n),s=Li(null,t,r,e,s,n);var l=Oi();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ce(r)?(l=!0,_s(t)):l=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Ei(t),s.updater=tl,t.stateNode=s,s._reactInternals=t,To(t,r,e,n),t=Lo(null,t,r,!0,l,n)):(t.tag=0,J&&l&&wi(t),ye(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(cs(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=em(r),e=Fe(r,e),s){case 0:t=Ro(null,t,r,e,n);break e;case 1:t=eu(null,t,r,e,n);break e;case 11:t=Xa(null,t,r,e,n);break e;case 14:t=Za(null,t,r,Fe(r.type,e),n);break e}throw Error(C(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Fe(r,s),Ro(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Fe(r,s),eu(e,t,r,s,n);case 3:e:{if(bd(t),e===null)throw Error(C(387));r=t.pendingProps,l=t.memoizedState,s=l.element,Xc(e,t),Os(t,r,null,n);var i=t.memoizedState;if(r=i.element,l.isDehydrated)if(l={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=l,t.memoizedState=l,t.flags&256){s=Ln(Error(C(423)),t),t=tu(e,t,r,n,s);break e}else if(r!==s){s=Ln(Error(C(424)),t),t=tu(e,t,r,n,s);break e}else for(Te=Tt(t.stateNode.containerInfo.firstChild),Pe=t,J=!0,He=null,n=Gc(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Tn(),r===s){t=ft(e,t,n);break e}ye(e,t,r,n)}t=t.child}return t;case 5:return Zc(t),e===null&&Co(t),r=t.type,s=t.pendingProps,l=e!==null?e.memoizedProps:null,i=s.children,So(r,s)?i=null:l!==null&&So(r,l)&&(t.flags|=32),jd(e,t),ye(e,t,i,n),t.child;case 6:return e===null&&Co(t),null;case 13:return Cd(e,t,n);case 4:return _i(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Pn(t,null,r,n):ye(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Fe(r,s),Xa(e,t,r,s,n);case 7:return ye(e,t,t.pendingProps,n),t.child;case 8:return ye(e,t,t.pendingProps.children,n),t.child;case 12:return ye(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,l=t.memoizedProps,i=s.value,q(Rs,r._currentValue),r._currentValue=i,l!==null)if(Qe(l.value,i)){if(l.children===s.children&&!be.current){t=ft(e,t,n);break e}}else for(l=t.child,l!==null&&(l.return=t);l!==null;){var a=l.dependencies;if(a!==null){i=l.child;for(var u=a.firstContext;u!==null;){if(u.context===r){if(l.tag===1){u=at(-1,n&-n),u.tag=2;var f=l.updateQueue;if(f!==null){f=f.shared;var m=f.pending;m===null?u.next=u:(u.next=m.next,m.next=u),f.pending=u}}l.lanes|=n,u=l.alternate,u!==null&&(u.lanes|=n),Eo(l.return,n,t),a.lanes|=n;break}u=u.next}}else if(l.tag===10)i=l.type===t.type?null:l.child;else if(l.tag===18){if(i=l.return,i===null)throw Error(C(341));i.lanes|=n,a=i.alternate,a!==null&&(a.lanes|=n),Eo(i,n,t),i=l.sibling}else i=l.child;if(i!==null)i.return=l;else for(i=l;i!==null;){if(i===t){i=null;break}if(l=i.sibling,l!==null){l.return=i.return,i=l;break}i=i.return}l=i}ye(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,bn(t,n),s=De(s),r=r(s),t.flags|=1,ye(e,t,r,n),t.child;case 14:return r=t.type,s=Fe(r,t.pendingProps),s=Fe(r.type,s),Za(e,t,r,s,n);case 15:return Nd(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Fe(r,s),cs(e,t),t.tag=1,Ce(r)?(e=!0,_s(t)):e=!1,bn(t,n),xd(t,r,s),To(t,r,s,n),Lo(null,t,r,!0,e,n);case 19:return Ed(e,t,n);case 22:return kd(e,t,n)}throw Error(C(156,t.tag))};function Vd(e,t){return gc(e,t)}function Zp(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ze(e,t,n,r){return new Zp(e,t,n,r)}function Vi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function em(e){if(typeof e=="function")return Vi(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ai)return 11;if(e===ui)return 14}return 2}function Ot(e,t){var n=e.alternate;return n===null?(n=ze(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function hs(e,t,n,r,s,l){var i=2;if(r=e,typeof e=="function")Vi(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case cn:return Qt(n.children,s,l,t);case ii:i=8,s|=8;break;case Xl:return e=ze(12,n,t,s|2),e.elementType=Xl,e.lanes=l,e;case Zl:return e=ze(13,n,t,s),e.elementType=Zl,e.lanes=l,e;case eo:return e=ze(19,n,t,s),e.elementType=eo,e.lanes=l,e;case Zu:return sl(n,s,l,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Yu:i=10;break e;case Xu:i=9;break e;case ai:i=11;break e;case ui:i=14;break e;case xt:i=16,r=null;break e}throw Error(C(130,e==null?e:typeof e,""))}return t=ze(i,n,t,s),t.elementType=e,t.type=r,t.lanes=l,t}function Qt(e,t,n,r){return e=ze(7,e,r,t),e.lanes=n,e}function sl(e,t,n,r){return e=ze(22,e,r,t),e.elementType=Zu,e.lanes=n,e.stateNode={isHidden:!1},e}function Bl(e,t,n){return e=ze(6,e,null,t),e.lanes=n,e}function Ul(e,t,n){return t=ze(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function tm(e,t,n,r,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Sl(0),this.expirationTimes=Sl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Sl(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Wi(e,t,n,r,s,l,i,a,u){return e=new tm(e,t,n,a,u),t===1?(t=1,l===!0&&(t|=8)):t=0,l=ze(3,null,null,t),e.current=l,l.stateNode=e,l.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ei(l),e}function nm(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:un,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Wd(e){if(!e)return zt;e=e._reactInternals;e:{if(ln(e)!==e||e.tag!==1)throw Error(C(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ce(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(C(171))}if(e.tag===1){var n=e.type;if(Ce(n))return Wc(e,n,t)}return t}function Hd(e,t,n,r,s,l,i,a,u){return e=Wi(n,r,!0,e,s,l,i,a,u),e.context=Wd(null),n=e.current,r=we(),s=Lt(n),l=at(r,s),l.callback=t??null,Pt(n,l,s),e.current.lanes=s,Or(e,s,r),Ee(e,r),e}function ll(e,t,n,r){var s=t.current,l=we(),i=Lt(s);return n=Wd(n),t.context===null?t.context=n:t.pendingContext=n,t=at(l,i),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Pt(s,t,i),e!==null&&(Ke(e,s,i,l),is(e,s,i)),i}function Us(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function du(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Hi(e,t){du(e,t),(e=e.alternate)&&du(e,t)}function rm(){return null}var qd=typeof reportError=="function"?reportError:function(e){console.error(e)};function qi(e){this._internalRoot=e}ol.prototype.render=qi.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(C(409));ll(e,t,null,null)};ol.prototype.unmount=qi.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;tn(function(){ll(null,e,null,null)}),t[ct]=null}};function ol(e){this._internalRoot=e}ol.prototype.unstable_scheduleHydration=function(e){if(e){var t=kc();e={blockedOn:null,target:e,priority:t};for(var n=0;n<St.length&&t!==0&&t<St[n].priority;n++);St.splice(n,0,e),n===0&&bc(e)}};function Ki(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function il(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function fu(){}function sm(e,t,n,r,s){if(s){if(typeof r=="function"){var l=r;r=function(){var f=Us(i);l.call(f)}}var i=Hd(t,r,e,0,null,!1,!1,"",fu);return e._reactRootContainer=i,e[ct]=i.current,Sr(e.nodeType===8?e.parentNode:e),tn(),i}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var a=r;r=function(){var f=Us(u);a.call(f)}}var u=Wi(e,0,!1,null,null,!1,!1,"",fu);return e._reactRootContainer=u,e[ct]=u.current,Sr(e.nodeType===8?e.parentNode:e),tn(function(){ll(t,u,n,r)}),u}function al(e,t,n,r,s){var l=n._reactRootContainer;if(l){var i=l;if(typeof s=="function"){var a=s;s=function(){var u=Us(i);a.call(u)}}ll(t,i,e,s)}else i=sm(n,t,e,s,r);return Us(i)}Sc=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=tr(t.pendingLanes);n!==0&&(fi(t,n|1),Ee(t,ne()),!(D&6)&&(On=ne()+500,Bt()))}break;case 13:tn(function(){var r=dt(e,1);if(r!==null){var s=we();Ke(r,e,1,s)}}),Hi(e,1)}};hi=function(e){if(e.tag===13){var t=dt(e,134217728);if(t!==null){var n=we();Ke(t,e,134217728,n)}Hi(e,134217728)}};Nc=function(e){if(e.tag===13){var t=Lt(e),n=dt(e,t);if(n!==null){var r=we();Ke(n,e,t,r)}Hi(e,t)}};kc=function(){return V};jc=function(e,t){var n=V;try{return V=e,t()}finally{V=n}};co=function(e,t,n){switch(t){case"input":if(ro(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var s=Xs(r);if(!s)throw Error(C(90));tc(r),ro(r,s)}}}break;case"textarea":rc(e,n);break;case"select":t=n.value,t!=null&&Sn(e,!!n.multiple,t,!1)}};cc=Bi;dc=tn;var lm={usingClientEntryPoint:!1,Events:[Mr,pn,Xs,ac,uc,Bi]},Yn={findFiberByHostInstance:Wt,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},om={bundleType:Yn.bundleType,version:Yn.version,rendererPackageName:Yn.rendererPackageName,rendererConfig:Yn.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ht.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=pc(e),e===null?null:e.stateNode},findFiberByHostInstance:Yn.findFiberByHostInstance||rm,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Zr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Zr.isDisabled&&Zr.supportsFiber)try{Qs=Zr.inject(om),Ze=Zr}catch{}}Le.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=lm;Le.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ki(t))throw Error(C(200));return nm(e,t,null,n)};Le.createRoot=function(e,t){if(!Ki(e))throw Error(C(299));var n=!1,r="",s=qd;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=Wi(e,1,!1,null,null,n,!1,r,s),e[ct]=t.current,Sr(e.nodeType===8?e.parentNode:e),new qi(t)};Le.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(C(188)):(e=Object.keys(e).join(","),Error(C(268,e)));return e=pc(t),e=e===null?null:e.stateNode,e};Le.flushSync=function(e){return tn(e)};Le.hydrate=function(e,t,n){if(!il(t))throw Error(C(200));return al(null,e,t,!0,n)};Le.hydrateRoot=function(e,t,n){if(!Ki(e))throw Error(C(405));var r=n!=null&&n.hydratedSources||null,s=!1,l="",i=qd;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onRecoverableError!==void 0&&(i=n.onRecoverableError)),t=Hd(t,null,e,1,n??null,s,!1,l,i),e[ct]=t.current,Sr(e),r)for(e=0;e<r.length;e++)n=r[e],s=n._getVersion,s=s(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,s]:t.mutableSourceEagerHydrationData.push(n,s);return new ol(t)};Le.render=function(e,t,n){if(!il(t))throw Error(C(200));return al(null,e,t,!1,n)};Le.unmountComponentAtNode=function(e){if(!il(e))throw Error(C(40));return e._reactRootContainer?(tn(function(){al(null,null,e,!1,function(){e._reactRootContainer=null,e[ct]=null})}),!0):!1};Le.unstable_batchedUpdates=Bi;Le.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!il(n))throw Error(C(200));if(e==null||e._reactInternals===void 0)throw Error(C(38));return al(e,t,n,!1,r)};Le.version="18.3.1-next-f1338f8080-20240426";function Kd(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Kd)}catch(e){console.error(e)}}Kd(),Ku.exports=Le;var im=Ku.exports,hu=im;Gl.createRoot=hu.createRoot,Gl.hydrateRoot=hu.hydrateRoot;/**
|
|
41
|
+
* @remix-run/router v1.23.4
|
|
42
|
+
*
|
|
43
|
+
* Copyright (c) Remix Software Inc.
|
|
44
|
+
*
|
|
45
|
+
* This source code is licensed under the MIT license found in the
|
|
46
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
47
|
+
*
|
|
48
|
+
* @license MIT
|
|
49
|
+
*/function Pr(){return Pr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Pr.apply(null,arguments)}var bt;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(bt||(bt={}));const pu="popstate";function am(e){e===void 0&&(e={});function t(r,s){let{pathname:l,search:i,hash:a}=r.location;return Wo("",{pathname:l,search:i,hash:a},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:Fs(s)}return cm(t,n,null,e)}function Z(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Qd(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function um(){return Math.random().toString(36).substr(2,8)}function mu(e,t){return{usr:e.state,key:e.key,idx:t}}function Wo(e,t,n,r){return n===void 0&&(n=null),Pr({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Dn(t):t,{state:n,key:t&&t.key||r||um()})}function Fs(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Dn(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function cm(e,t,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:l=!1}=r,i=s.history,a=bt.Pop,u=null,f=m();f==null&&(f=0,i.replaceState(Pr({},i.state,{idx:f}),""));function m(){return(i.state||{idx:null}).idx}function p(){a=bt.Pop;let b=m(),g=b==null?null:b-f;f=b,u&&u({action:a,location:w.location,delta:g})}function c(b,g){a=bt.Push;let d=Wo(w.location,b,g);f=m()+1;let h=mu(d,f),k=w.createHref(d);try{i.pushState(h,"",k)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;s.location.assign(k)}l&&u&&u({action:a,location:w.location,delta:1})}function x(b,g){a=bt.Replace;let d=Wo(w.location,b,g);f=m();let h=mu(d,f),k=w.createHref(d);i.replaceState(h,"",k),l&&u&&u({action:a,location:w.location,delta:0})}function y(b){let g=s.location.origin!=="null"?s.location.origin:s.location.href,d=typeof b=="string"?b:Fs(b);return d=d.replace(/ $/,"%20"),Z(g,"No window.location.(origin|href) available to create URL for href: "+d),new URL(d,g)}let w={get action(){return a},get location(){return e(s,i)},listen(b){if(u)throw new Error("A history only accepts one active listener");return s.addEventListener(pu,p),u=b,()=>{s.removeEventListener(pu,p),u=null}},createHref(b){return t(s,b)},createURL:y,encodeLocation(b){let g=y(b);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:c,replace:x,go(b){return i.go(b)}};return w}var gu;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(gu||(gu={}));function dm(e,t,n){return n===void 0&&(n="/"),fm(e,t,n)}function fm(e,t,n,r){let s=typeof t=="string"?Dn(t):t,l=An(s.pathname||"/",n);if(l==null)return null;let i=Jd(e);hm(i);let a=null,u=jm(l);for(let f=0;a==null&&f<i.length;++f)a=Nm(i[f],u);return a}function Jd(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let s=(l,i,a)=>{let u={relativePath:a===void 0?l.path||"":a,caseSensitive:l.caseSensitive===!0,childrenIndex:i,route:l};u.relativePath.startsWith("/")&&(Z(u.relativePath.startsWith(r),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(r.length));let f=At([r,u.relativePath]),m=n.concat(u);l.children&&l.children.length>0&&(Z(l.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+f+'".')),Jd(l.children,t,m,f)),!(l.path==null&&!l.index)&&t.push({path:f,score:wm(f,l.index),routesMeta:m})};return e.forEach((l,i)=>{var a;if(l.path===""||!((a=l.path)!=null&&a.includes("?")))s(l,i);else for(let u of Gd(l.path))s(l,i,u)}),t}function Gd(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),l=n.replace(/\?$/,"");if(r.length===0)return s?[l,""]:[l];let i=Gd(r.join("/")),a=[];return a.push(...i.map(u=>u===""?l:[l,u].join("/"))),s&&a.push(...i),a.map(u=>e.startsWith("/")&&u===""?"/":u)}function hm(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Sm(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const pm=/^:[\w-]+$/,mm=3,gm=2,vm=1,ym=10,xm=-2,vu=e=>e==="*";function wm(e,t){let n=e.split("/"),r=n.length;return n.some(vu)&&(r+=xm),t&&(r+=gm),n.filter(s=>!vu(s)).reduce((s,l)=>s+(pm.test(l)?mm:l===""?vm:ym),r)}function Sm(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function Nm(e,t,n){let{routesMeta:r}=e,s={},l="/",i=[];for(let a=0;a<r.length;++a){let u=r[a],f=a===r.length-1,m=l==="/"?t:t.slice(l.length)||"/",p=Ho({path:u.relativePath,caseSensitive:u.caseSensitive,end:f},m),c=u.route;if(!p)return null;Object.assign(s,p.params),i.push({params:s,pathname:At([l,p.pathname]),pathnameBase:Em(At([l,p.pathnameBase])),route:c}),p.pathnameBase!=="/"&&(l=At([l,p.pathnameBase]))}return i}function Ho(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=km(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let l=s[0],i=l.replace(/(.)\/+$/,"$1"),a=s.slice(1);return{params:r.reduce((f,m,p)=>{let{paramName:c,isOptional:x}=m;if(c==="*"){let w=a[p]||"";i=l.slice(0,l.length-w.length).replace(/(.)\/+$/,"$1")}const y=a[p];return x&&!y?f[c]=void 0:f[c]=(y||"").replace(/%2F/g,"/"),f},{}),pathname:l,pathnameBase:i,pattern:e}}function km(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Qd(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 r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,a,u)=>(r.push({paramName:a,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function jm(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Qd(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function An(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function bm(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?Dn(e):e,l;return n?(n=Yd(n),n.startsWith("/")?l=yu(n.substring(1),"/"):l=yu(n,t)):l=t,{pathname:l,search:_m(r),hash:Tm(s)}}function yu(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function Fl(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Cm(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Qi(e,t){let n=Cm(e);return t?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Ji(e,t,n,r){r===void 0&&(r=!1);let s;typeof e=="string"?s=Dn(e):(s=Pr({},e),Z(!s.pathname||!s.pathname.includes("?"),Fl("?","pathname","search",s)),Z(!s.pathname||!s.pathname.includes("#"),Fl("#","pathname","hash",s)),Z(!s.search||!s.search.includes("#"),Fl("#","search","hash",s)));let l=e===""||s.pathname==="",i=l?"/":s.pathname,a;if(i==null)a=n;else{let p=t.length-1;if(!r&&i.startsWith("..")){let c=i.split("/");for(;c[0]==="..";)c.shift(),p-=1;s.pathname=c.join("/")}a=p>=0?t[p]:"/"}let u=bm(s,a),f=i&&i!=="/"&&i.endsWith("/"),m=(l||i===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(f||m)&&(u.pathname+="/"),u}const Yd=e=>e.replace(/\/\/+/g,"/"),At=e=>Yd(e.join("/")),Em=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),_m=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Tm=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Pm(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Xd=["post","put","patch","delete"];new Set(Xd);const Rm=["get",...Xd];new Set(Rm);/**
|
|
50
|
+
* React Router v6.30.6
|
|
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
|
+
*/function Rr(){return Rr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Rr.apply(null,arguments)}const ul=S.createContext(null),Zd=S.createContext(null),pt=S.createContext(null),cl=S.createContext(null),mt=S.createContext({outlet:null,matches:[],isDataRoute:!1}),ef=S.createContext(null);function Lm(e,t){let{relative:n}=t===void 0?{}:t;Bn()||Z(!1);let{basename:r,navigator:s}=S.useContext(pt),{hash:l,pathname:i,search:a}=dl(e,{relative:n}),u=i;return r!=="/"&&(u=i==="/"?r:At([r,i])),s.createHref({pathname:u,search:a,hash:l})}function Bn(){return S.useContext(cl)!=null}function Un(){return Bn()||Z(!1),S.useContext(cl).location}function tf(e){S.useContext(pt).static||S.useLayoutEffect(e)}function Gi(){let{isDataRoute:e}=S.useContext(mt);return e?Km():Om()}function Om(){Bn()||Z(!1);let e=S.useContext(ul),{basename:t,future:n,navigator:r}=S.useContext(pt),{matches:s}=S.useContext(mt),{pathname:l}=Un(),i=JSON.stringify(Qi(s,n.v7_relativeSplatPath)),a=S.useRef(!1);return tf(()=>{a.current=!0}),S.useCallback(function(f,m){if(m===void 0&&(m={}),!a.current)return;if(typeof f=="number"){r.go(f);return}let p=Ji(f,JSON.parse(i),l,m.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:At([t,p.pathname])),(m.replace?r.replace:r.push)(p,m.state,m)},[t,r,i,l,e])}const nf=S.createContext(null);function Am(){return S.useContext(nf)}function Mm(e){let t=S.useContext(mt).outlet;return t&&S.createElement(nf.Provider,{value:e},t)}function dl(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=S.useContext(pt),{matches:s}=S.useContext(mt),{pathname:l}=Un(),i=JSON.stringify(Qi(s,r.v7_relativeSplatPath));return S.useMemo(()=>Ji(e,JSON.parse(i),l,n==="path"),[e,i,l,n])}function Im(e,t){return zm(e,t)}function zm(e,t,n,r){Bn()||Z(!1);let{navigator:s}=S.useContext(pt),{matches:l}=S.useContext(mt),i=l[l.length-1],a=i?i.params:{};i&&i.pathname;let u=i?i.pathnameBase:"/";i&&i.route;let f=Un(),m;if(t){var p;let b=typeof t=="string"?Dn(t):t;u==="/"||(p=b.pathname)!=null&&p.startsWith(u)||Z(!1),m=b}else m=f;let c=m.pathname||"/",x=c;if(u!=="/"){let b=u.replace(/^\//,"").split("/");x="/"+c.replace(/^\//,"").split("/").slice(b.length).join("/")}let y=dm(e,{pathname:x}),w=Fm(y&&y.map(b=>Object.assign({},b,{params:Object.assign({},a,b.params),pathname:At([u,s.encodeLocation?s.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?u:At([u,s.encodeLocation?s.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),l,n,r);return t&&w?S.createElement(cl.Provider,{value:{location:Rr({pathname:"/",search:"",hash:"",state:null,key:"default"},m),navigationType:bt.Pop}},w):w}function $m(){let e=qm(),t=Pm(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return S.createElement(S.Fragment,null,S.createElement("h2",null,"Unexpected Application Error!"),S.createElement("h3",{style:{fontStyle:"italic"}},t),n?S.createElement("pre",{style:s},n):null,null)}const Dm=S.createElement($m,null);class Bm extends S.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?S.createElement(mt.Provider,{value:this.props.routeContext},S.createElement(ef.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Um(e){let{routeContext:t,match:n,children:r}=e,s=S.useContext(ul);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),S.createElement(mt.Provider,{value:t},r)}function Fm(e,t,n,r){var s;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var l;if(!n)return null;if(n.errors)e=n.matches;else if((l=r)!=null&&l.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let i=e,a=(s=n)==null?void 0:s.errors;if(a!=null){let m=i.findIndex(p=>p.route.id&&(a==null?void 0:a[p.route.id])!==void 0);m>=0||Z(!1),i=i.slice(0,Math.min(i.length,m+1))}let u=!1,f=-1;if(n&&r&&r.v7_partialHydration)for(let m=0;m<i.length;m++){let p=i[m];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(f=m),p.route.id){let{loaderData:c,errors:x}=n,y=p.route.loader&&c[p.route.id]===void 0&&(!x||x[p.route.id]===void 0);if(p.route.lazy||y){u=!0,f>=0?i=i.slice(0,f+1):i=[i[0]];break}}}return i.reduceRight((m,p,c)=>{let x,y=!1,w=null,b=null;n&&(x=a&&p.route.id?a[p.route.id]:void 0,w=p.route.errorElement||Dm,u&&(f<0&&c===0?(Qm("route-fallback"),y=!0,b=null):f===c&&(y=!0,b=p.route.hydrateFallbackElement||null)));let g=t.concat(i.slice(0,c+1)),d=()=>{let h;return x?h=w:y?h=b:p.route.Component?h=S.createElement(p.route.Component,null):p.route.element?h=p.route.element:h=m,S.createElement(Um,{match:p,routeContext:{outlet:m,matches:g,isDataRoute:n!=null},children:h})};return n&&(p.route.ErrorBoundary||p.route.errorElement||c===0)?S.createElement(Bm,{location:n.location,revalidation:n.revalidation,component:w,error:x,children:d(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):d()},null)}var rf=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(rf||{}),sf=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(sf||{});function Vm(e){let t=S.useContext(ul);return t||Z(!1),t}function Wm(e){let t=S.useContext(Zd);return t||Z(!1),t}function Hm(e){let t=S.useContext(mt);return t||Z(!1),t}function lf(e){let t=Hm(),n=t.matches[t.matches.length-1];return n.route.id||Z(!1),n.route.id}function qm(){var e;let t=S.useContext(ef),n=Wm(),r=lf();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function Km(){let{router:e}=Vm(rf.UseNavigateStable),t=lf(sf.UseNavigateStable),n=S.useRef(!1);return tf(()=>{n.current=!0}),S.useCallback(function(s,l){l===void 0&&(l={}),n.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,Rr({fromRouteId:t},l)))},[e,t])}const xu={};function Qm(e,t,n){xu[e]||(xu[e]=!0)}function Jm(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function wu(e){let{to:t,replace:n,state:r,relative:s}=e;Bn()||Z(!1);let{future:l,static:i}=S.useContext(pt),{matches:a}=S.useContext(mt),{pathname:u}=Un(),f=Gi(),m=Ji(t,Qi(a,l.v7_relativeSplatPath),u,s==="path"),p=JSON.stringify(m);return S.useEffect(()=>f(JSON.parse(p),{replace:n,state:r,relative:s}),[f,p,s,n,r]),null}function Gm(e){return Mm(e.context)}function yt(e){Z(!1)}function Ym(e){let{basename:t="/",children:n=null,location:r,navigationType:s=bt.Pop,navigator:l,static:i=!1,future:a}=e;Bn()&&Z(!1);let u=t.replace(/^\/*/,"/"),f=S.useMemo(()=>({basename:u,navigator:l,static:i,future:Rr({v7_relativeSplatPath:!1},a)}),[u,a,l,i]);typeof r=="string"&&(r=Dn(r));let{pathname:m="/",search:p="",hash:c="",state:x=null,key:y="default"}=r,w=S.useMemo(()=>{let b=An(m,u);return b==null?null:{location:{pathname:b,search:p,hash:c,state:x,key:y},navigationType:s}},[u,m,p,c,x,y,s]);return w==null?null:S.createElement(pt.Provider,{value:f},S.createElement(cl.Provider,{children:n,value:w}))}function Xm(e){let{children:t,location:n}=e;return Im(qo(t),n)}new Promise(()=>{});function qo(e,t){t===void 0&&(t=[]);let n=[];return S.Children.forEach(e,(r,s)=>{if(!S.isValidElement(r))return;let l=[...t,s];if(r.type===S.Fragment){n.push.apply(n,qo(r.props.children,l));return}r.type!==yt&&Z(!1),!r.props.index||!r.props.children||Z(!1);let i={id:r.props.id||l.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(i.children=qo(r.props.children,l)),n.push(i)}),n}/**
|
|
59
|
+
* React Router DOM v6.30.6
|
|
60
|
+
*
|
|
61
|
+
* Copyright (c) Remix Software Inc.
|
|
62
|
+
*
|
|
63
|
+
* This source code is licensed under the MIT license found in the
|
|
64
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
65
|
+
*
|
|
66
|
+
* @license MIT
|
|
67
|
+
*/function Vs(){return Vs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Vs.apply(null,arguments)}function of(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Zm(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function eg(e,t){return e.button===0&&(!t||t==="_self")&&!Zm(e)}const tg=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],ng=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],rg="6";try{window.__reactRouterVersion=rg}catch{}const sg=S.createContext({isTransitioning:!1}),lg="startTransition",Su=Gf[lg];function og(e){let{basename:t,children:n,future:r,window:s}=e,l=S.useRef();l.current==null&&(l.current=am({window:s,v5Compat:!0}));let i=l.current,[a,u]=S.useState({action:i.action,location:i.location}),{v7_startTransition:f}=r||{},m=S.useCallback(p=>{f&&Su?Su(()=>u(p)):u(p)},[u,f]);return S.useLayoutEffect(()=>i.listen(m),[i,m]),S.useEffect(()=>Jm(r),[r]),S.createElement(Ym,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:i,future:r})}const ig=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ag=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ug=S.forwardRef(function(t,n){let{onClick:r,relative:s,reloadDocument:l,replace:i,state:a,target:u,to:f,preventScrollReset:m,viewTransition:p}=t,c=of(t,tg),{basename:x}=S.useContext(pt),y,w=!1;if(typeof f=="string"&&ag.test(f)&&(y=f,ig))try{let h=new URL(window.location.href),k=f.startsWith("//")?new URL(h.protocol+f):new URL(f),E=An(k.pathname,x);k.origin===h.origin&&E!=null?f=E+k.search+k.hash:w=!0}catch{}let b=Lm(f,{relative:s}),g=dg(f,{replace:i,state:a,target:u,preventScrollReset:m,relative:s,viewTransition:p});function d(h){r&&r(h),h.defaultPrevented||g(h)}return S.createElement("a",Vs({},c,{href:y||b,onClick:w||l?r:d,ref:n,target:u}))}),Nu=S.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:s=!1,className:l="",end:i=!1,style:a,to:u,viewTransition:f,children:m}=t,p=of(t,ng),c=dl(u,{relative:p.relative}),x=Un(),y=S.useContext(Zd),{navigator:w,basename:b}=S.useContext(pt),g=y!=null&&fg(c)&&f===!0,d=w.encodeLocation?w.encodeLocation(c).pathname:c.pathname,h=x.pathname,k=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;s||(h=h.toLowerCase(),k=k?k.toLowerCase():null,d=d.toLowerCase()),k&&b&&(k=An(k,b)||k);const E=d!=="/"&&d.endsWith("/")?d.length-1:d.length;let _=h===d||!i&&h.startsWith(d)&&h.charAt(E)==="/",R=k!=null&&(k===d||!i&&k.startsWith(d)&&k.charAt(d.length)==="/"),A={isActive:_,isPending:R,isTransitioning:g},F=_?r:void 0,I;typeof l=="function"?I=l(A):I=[l,_?"active":null,R?"pending":null,g?"transitioning":null].filter(Boolean).join(" ");let ie=typeof a=="function"?a(A):a;return S.createElement(ug,Vs({},p,{"aria-current":F,className:I,ref:n,style:ie,to:u,viewTransition:f}),typeof m=="function"?m(A):m)});var Ko;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Ko||(Ko={}));var ku;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(ku||(ku={}));function cg(e){let t=S.useContext(ul);return t||Z(!1),t}function dg(e,t){let{target:n,replace:r,state:s,preventScrollReset:l,relative:i,viewTransition:a}=t===void 0?{}:t,u=Gi(),f=Un(),m=dl(e,{relative:i});return S.useCallback(p=>{if(eg(p,n)){p.preventDefault();let c=r!==void 0?r:Fs(f)===Fs(m);u(e,{replace:c,state:s,preventScrollReset:l,relative:i,viewTransition:a})}},[f,u,m,r,s,n,e,l,i,a])}function fg(e,t){t===void 0&&(t={});let n=S.useContext(sg);n==null&&Z(!1);let{basename:r}=cg(Ko.useViewTransitionState),s=dl(e,{relative:t.relative});if(!n.isTransitioning)return!1;let l=An(n.currentLocation.pathname,r)||n.currentLocation.pathname,i=An(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Ho(s.pathname,i)!=null||Ho(s.pathname,l)!=null}const nt=Object.create(null);nt.open="0";nt.close="1";nt.ping="2";nt.pong="3";nt.message="4";nt.upgrade="5";nt.noop="6";const ps=Object.create(null);Object.keys(nt).forEach(e=>{ps[nt[e]]=e});const Qo={type:"error",data:"parser error"},af=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",uf=typeof ArrayBuffer=="function",cf=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Yi=({type:e,data:t},n,r)=>af&&t instanceof Blob?n?r(t):ju(t,r):uf&&(t instanceof ArrayBuffer||cf(t))?n?r(t):ju(new Blob([t]),r):r(nt[e]+(t||"")),ju=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function bu(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Vl;function hg(e,t){if(af&&e.data instanceof Blob)return e.data.arrayBuffer().then(bu).then(t);if(uf&&(e.data instanceof ArrayBuffer||cf(e.data)))return t(bu(e.data));Yi(e,!1,n=>{Vl||(Vl=new TextEncoder),t(Vl.encode(n))})}const Cu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",rr=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<Cu.length;e++)rr[Cu.charCodeAt(e)]=e;const pg=e=>{let t=e.length*.75,n=e.length,r,s=0,l,i,a,u;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const f=new ArrayBuffer(t),m=new Uint8Array(f);for(r=0;r<n;r+=4)l=rr[e.charCodeAt(r)],i=rr[e.charCodeAt(r+1)],a=rr[e.charCodeAt(r+2)],u=rr[e.charCodeAt(r+3)],m[s++]=l<<2|i>>4,m[s++]=(i&15)<<4|a>>2,m[s++]=(a&3)<<6|u&63;return f},mg=typeof ArrayBuffer=="function",Xi=(e,t)=>{if(typeof e!="string")return{type:"message",data:df(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:gg(e.substring(1),t)}:ps[n]?e.length>1?{type:ps[n],data:e.substring(1)}:{type:ps[n]}:Qo},gg=(e,t)=>{if(mg){const n=pg(e);return df(n,t)}else return{base64:!0,data:e}},df=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},ff="",vg=(e,t)=>{const n=e.length,r=new Array(n);let s=0;e.forEach((l,i)=>{Yi(l,!1,a=>{r[i]=a,++s===n&&t(r.join(ff))})})},yg=(e,t)=>{const n=e.split(ff),r=[];for(let s=0;s<n.length;s++){const l=Xi(n[s],t);if(r.push(l),l.type==="error")break}return r};function xg(){return new TransformStream({transform(e,t){hg(e,n=>{const r=n.length;let s;if(r<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,r);else if(r<65536){s=new Uint8Array(3);const l=new DataView(s.buffer);l.setUint8(0,126),l.setUint16(1,r)}else{s=new Uint8Array(9);const l=new DataView(s.buffer);l.setUint8(0,127),l.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(s[0]|=128),t.enqueue(s),t.enqueue(n)})}})}let Wl;function es(e){return e.reduce((t,n)=>t+n.length,0)}function ts(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let s=0;s<t;s++)n[s]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function wg(e,t){Wl||(Wl=new TextDecoder);const n=[];let r=0,s=-1,l=!1;return new TransformStream({transform(i,a){for(n.push(i);;){if(r===0){if(es(n)<1)break;const u=ts(n,1);l=(u[0]&128)===128,s=u[0]&127,s<126?r=3:s===126?r=1:r=2}else if(r===1){if(es(n)<2)break;const u=ts(n,2);s=new DataView(u.buffer,u.byteOffset,u.length).getUint16(0),r=3}else if(r===2){if(es(n)<8)break;const u=ts(n,8),f=new DataView(u.buffer,u.byteOffset,u.length),m=f.getUint32(0);if(m>Math.pow(2,21)-1){a.enqueue(Qo);break}s=m*Math.pow(2,32)+f.getUint32(4),r=3}else{if(es(n)<s)break;const u=ts(n,s);a.enqueue(Xi(l?u:Wl.decode(u),t)),r=0}if(s===0||s>e){a.enqueue(Qo);break}}}})}const hf=4;function se(e){if(e)return Sg(e)}function Sg(e){for(var t in se.prototype)e[t]=se.prototype[t];return e}se.prototype.on=se.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};se.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};se.prototype.off=se.prototype.removeListener=se.prototype.removeAllListeners=se.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,s=0;s<n.length;s++)if(r=n[s],r===t||r.fn===t){n.splice(s,1);break}return n.length===0&&delete this._callbacks["$"+e],this};se.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,s=n.length;r<s;++r)n[r].apply(this,t)}return this};se.prototype.emitReserved=se.prototype.emit;se.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};se.prototype.hasListeners=function(e){return!!this.listeners(e).length};const fl=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),Ie=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),Ng="arraybuffer";function pf(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const kg=Ie.setTimeout,jg=Ie.clearTimeout;function hl(e,t){t.useNativeTimers?(e.setTimeoutFn=kg.bind(Ie),e.clearTimeoutFn=jg.bind(Ie)):(e.setTimeoutFn=Ie.setTimeout.bind(Ie),e.clearTimeoutFn=Ie.clearTimeout.bind(Ie))}const bg=1.33;function Cg(e){return typeof e=="string"?Eg(e):Math.ceil((e.byteLength||e.size)*bg)}function Eg(e){let t=0,n=0;for(let r=0,s=e.length;r<s;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function mf(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function _g(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function Tg(e){let t={},n=e.split("&");for(let r=0,s=n.length;r<s;r++){let l=n[r].split("=");t[decodeURIComponent(l[0])]=decodeURIComponent(l[1])}return t}class Pg extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class Zi extends se{constructor(t){super(),this.writable=!1,hl(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new Pg(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=Xi(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=_g(t);return n.length?"?"+n:""}}class Rg extends Zi{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};yg(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,vg(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=mf()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let gf=!1;try{gf=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Lg=gf;function Og(){}class Ag extends Rg{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(s,l)=>{this.onError("xhr post error",s,l)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class tt extends se{constructor(t,n,r){super(),this.createRequest=t,hl(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=pf(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let s in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(s)&&r.setRequestHeader(s,this._opts.extraHeaders[s])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var s;r.readyState===3&&((s=this._opts.cookieJar)===null||s===void 0||s.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(s){this.setTimeoutFn(()=>{this._onError(s)},0);return}typeof document<"u"&&(this._index=tt.requestsCount++,tt.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Og,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete tt.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}tt.requestsCount=0;tt.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Eu);else if(typeof addEventListener=="function"){const e="onpagehide"in Ie?"pagehide":"unload";addEventListener(e,Eu,!1)}}function Eu(){for(let e in tt.requests)tt.requests.hasOwnProperty(e)&&tt.requests[e].abort()}const Mg=function(){const e=vf({xdomain:!1});return e&&e.responseType!==null}();class Ig extends Ag{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=Mg&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new tt(vf,this.uri(),t)}}function vf(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||Lg))return new XMLHttpRequest}catch{}if(!t)try{return new Ie[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const yf=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class zg extends Zi{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=yf?{}:pf(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(s){return this.emitReserved("error",s)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],s=n===t.length-1;Yi(r,this.supportsBinary,l=>{try{this.doWrite(r,l)}catch{}s&&fl(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=mf()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Hl=Ie.WebSocket||Ie.MozWebSocket;class $g extends zg{createSocket(t,n,r){return yf?new Hl(t,n,r):n?new Hl(t,n):new Hl(t)}doWrite(t,n){this.ws.send(n)}}class Dg extends Zi{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=wg(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),s=xg();s.readable.pipeTo(t.writable),this._writer=s.writable.getWriter();const l=()=>{r.read().then(({done:a,value:u})=>{a||(this.onPacket(u),l())}).catch(a=>{})};l();const i={type:"open"};this.query.sid&&(i.data=`{"sid":"${this.query.sid}"}`),this._writer.write(i).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],s=n===t.length-1;this._writer.write(r).then(()=>{s&&fl(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const Bg={websocket:$g,webtransport:Dg,polling:Ig},Ug=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Fg=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Jo(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let s=Ug.exec(e||""),l={},i=14;for(;i--;)l[Fg[i]]=s[i]||"";return n!=-1&&r!=-1&&(l.source=t,l.host=l.host.substring(1,l.host.length-1).replace(/;/g,":"),l.authority=l.authority.replace("[","").replace("]","").replace(/;/g,":"),l.ipv6uri=!0),l.pathNames=Vg(l,l.path),l.queryKey=Wg(l,l.query),l}function Vg(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function Wg(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,s,l){s&&(n[s]=l)}),n}const Go=typeof addEventListener=="function"&&typeof removeEventListener=="function",ms=[];Go&&addEventListener("offline",()=>{ms.forEach(e=>e())},!1);class Mt extends se{constructor(t,n){if(super(),this.binaryType=Ng,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=Jo(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=Jo(n.host).host);hl(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const s=r.prototype.name;this.transports.push(s),this._transportsByName[s]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Tg(this.opts.query)),Go&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},ms.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=hf,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&Mt.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",Mt.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const s=this.writeBuffer[r].data;if(s&&(n+=Cg(s)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,fl(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,s){if(typeof n=="function"&&(s=n,n=void 0),typeof r=="function"&&(s=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const l={type:t,data:n,options:r};this.emitReserved("packetCreate",l),this.writeBuffer.push(l),s&&this.once("flush",s),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(Mt.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Go&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=ms.indexOf(this._offlineEventListener);r!==-1&&ms.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Mt.protocol=hf;class Hg extends Mt{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;Mt.priorWebsocketSuccess=!1;const s=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",p=>{if(!r)if(p.type==="pong"&&p.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Mt.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(m(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const c=new Error("probe error");c.transport=n.name,this.emitReserved("upgradeError",c)}}))};function l(){r||(r=!0,m(),n.close(),n=null)}const i=p=>{const c=new Error("probe error: "+p);c.transport=n.name,l(),this.emitReserved("upgradeError",c)};function a(){i("transport closed")}function u(){i("socket closed")}function f(p){n&&p.name!==n.name&&l()}const m=()=>{n.removeListener("open",s),n.removeListener("error",i),n.removeListener("close",a),this.off("close",u),this.off("upgrading",f)};n.once("open",s),n.once("error",i),n.once("close",a),this.once("close",u),this.once("upgrading",f),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let qg=class extends Hg{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(s=>Bg[s]).filter(s=>!!s)),super(t,r)}};function Kg(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=Jo(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const l=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+l+":"+r.port+t,r.href=r.protocol+"://"+l+(n&&n.port===r.port?"":":"+r.port),r}const Qg=typeof ArrayBuffer=="function",Jg=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,xf=Object.prototype.toString,Gg=typeof Blob=="function"||typeof Blob<"u"&&xf.call(Blob)==="[object BlobConstructor]",Yg=typeof File=="function"||typeof File<"u"&&xf.call(File)==="[object FileConstructor]";function ea(e){return Qg&&(e instanceof ArrayBuffer||Jg(e))||Gg&&e instanceof Blob||Yg&&e instanceof File}function gs(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(gs(e[n]))return!0;return!1}if(ea(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return gs(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&gs(e[n]))return!0;return!1}function Xg(e){const t=[],n=e.data,r=e;return r.data=Yo(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Yo(e,t){if(!e)return e;if(ea(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Yo(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Yo(e[r],t));return n}return e}function Zg(e,t){return e.data=Xo(e.data,t),delete e.attachments,e}function Xo(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Xo(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Xo(e[n],t));return e}const ev=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],tv=5;var $;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})($||($={}));class nv{constructor(t){this.replacer=t}encode(t){return(t.type===$.EVENT||t.type===$.ACK)&&gs(t)?this.encodeAsBinary({type:t.type===$.EVENT?$.BINARY_EVENT:$.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===$.BINARY_EVENT||t.type===$.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=Xg(t),r=this.encodeAsString(n.packet),s=n.buffers;return s.unshift(r),s}}function _u(e){return Object.prototype.toString.call(e)==="[object Object]"}class ta extends se{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===$.BINARY_EVENT;r||n.type===$.BINARY_ACK?(n.type=r?$.EVENT:$.ACK,this.reconstructor=new rv(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(ea(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if($[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===$.BINARY_EVENT||r.type===$.BINARY_ACK){const l=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const i=t.substring(l,n);if(i!=Number(i)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(i)}if(t.charAt(n+1)==="/"){const l=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(l,n)}else r.nsp="/";const s=t.charAt(n+1);if(s!==""&&Number(s)==s){const l=n+1;for(;++n;){const i=t.charAt(n);if(i==null||Number(i)!=i){--n;break}if(n===t.length)break}r.id=Number(t.substring(l,n+1))}if(t.charAt(++n)){const l=this.tryParse(t.substr(n));if(ta.isPayloadValid(r.type,l))r.data=l;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case $.CONNECT:return _u(n);case $.DISCONNECT:return n===void 0;case $.CONNECT_ERROR:return typeof n=="string"||_u(n);case $.EVENT:case $.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&ev.indexOf(n[0])===-1);case $.ACK:case $.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class rv{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=Zg(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const sv=Object.freeze(Object.defineProperty({__proto__:null,Decoder:ta,Encoder:nv,get PacketType(){return $},protocol:tv},Symbol.toStringTag,{value:"Module"}));function We(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const lv=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class wf extends se{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[We(t,"open",this.onopen.bind(this)),We(t,"packet",this.onpacket.bind(this)),We(t,"error",this.onerror.bind(this)),We(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,s,l;if(lv.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const i={type:$.EVENT,data:n};if(i.options={},i.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const m=this.ids++,p=n.pop();this._registerAckCallback(m,p),i.id=m}const a=(s=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||s===void 0?void 0:s.writable,u=this.connected&&!(!((l=this.io.engine)===null||l===void 0)&&l._hasPingExpired());return this.flags.volatile&&!a||(u?(this.notifyOutgoingListeners(i),this.packet(i)):this.sendBuffer.push(i)),this.flags={},this}_registerAckCallback(t,n){var r;const s=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(s===void 0){this.acks[t]=n;return}const l=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===t&&this.sendBuffer.splice(a,1);n.call(this,new Error("operation has timed out"))},s),i=(...a)=>{this.io.clearTimeoutFn(l),n.apply(this,a)};i.withError=!0,this.acks[t]=i}emitWithAck(t,...n){return new Promise((r,s)=>{const l=(i,a)=>i?s(i):r(a);l.withError=!0,n.push(l),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((s,...l)=>r!==this._queue[0]?void 0:(s!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(s)):(this._queue.shift(),n&&n(null,...l)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:$.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case $.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case $.EVENT:case $.BINARY_EVENT:this.onevent(t);break;case $.ACK:case $.BINARY_ACK:this.onack(t);break;case $.DISCONNECT:this.ondisconnect();break;case $.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...s){r||(r=!0,n.packet({type:$.ACK,id:t,data:s}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:$.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function Fn(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Fn.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};Fn.prototype.reset=function(){this.attempts=0};Fn.prototype.setMin=function(e){this.ms=e};Fn.prototype.setMax=function(e){this.max=e};Fn.prototype.setJitter=function(e){this.jitter=e};class Zo extends se{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,hl(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Fn({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const s=n.parser||sv;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new qg(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const s=We(n,"open",function(){r.onopen(),t&&t()}),l=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},i=We(n,"error",l);if(this._timeout!==!1){const a=this._timeout,u=this.setTimeoutFn(()=>{s(),l(new Error("timeout")),n.close()},a);this.opts.autoUnref&&u.unref(),this.subs.push(()=>{this.clearTimeoutFn(u)})}return this.subs.push(s),this.subs.push(i),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(We(t,"ping",this.onping.bind(this)),We(t,"data",this.ondata.bind(this)),We(t,"error",this.onerror.bind(this)),We(t,"close",this.onclose.bind(this)),We(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){fl(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new wf(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(s=>{s?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",s)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Xn={};function vs(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=Kg(e,t.path||"/socket.io"),r=n.source,s=n.id,l=n.path,i=Xn[s]&&l in Xn[s].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||i;let u;return a?u=new Zo(r,t):(Xn[s]||(Xn[s]=new Zo(r,t)),u=Xn[s]),n.query&&!t.query&&(t.query=n.queryKey),u.socket(n.path,t)}Object.assign(vs,{Manager:Zo,Socket:wf,io:vs,connect:vs});const ov={},Tu=e=>{let t;const n=new Set,r=(m,p)=>{const c=typeof m=="function"?m(t):m;if(!Object.is(c,t)){const x=t;t=p??(typeof c!="object"||c===null)?c:Object.assign({},t,c),n.forEach(y=>y(t,x))}},s=()=>t,u={setState:r,getState:s,getInitialState:()=>f,subscribe:m=>(n.add(m),()=>n.delete(m)),destroy:()=>{(ov?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},f=t=e(r,s,u);return u},iv=e=>e?Tu(e):Tu;var Sf={exports:{}},Nf={},kf={exports:{}},jf={};/**
|
|
68
|
+
* @license React
|
|
69
|
+
* use-sync-external-store-shim.production.js
|
|
70
|
+
*
|
|
71
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
72
|
+
*
|
|
73
|
+
* This source code is licensed under the MIT license found in the
|
|
74
|
+
* LICENSE file in the root directory of this source tree.
|
|
75
|
+
*/var Mn=S;function av(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var uv=typeof Object.is=="function"?Object.is:av,cv=Mn.useState,dv=Mn.useEffect,fv=Mn.useLayoutEffect,hv=Mn.useDebugValue;function pv(e,t){var n=t(),r=cv({inst:{value:n,getSnapshot:t}}),s=r[0].inst,l=r[1];return fv(function(){s.value=n,s.getSnapshot=t,ql(s)&&l({inst:s})},[e,n,t]),dv(function(){return ql(s)&&l({inst:s}),e(function(){ql(s)&&l({inst:s})})},[e]),hv(n),n}function ql(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!uv(e,n)}catch{return!0}}function mv(e,t){return t()}var gv=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?mv:pv;jf.useSyncExternalStore=Mn.useSyncExternalStore!==void 0?Mn.useSyncExternalStore:gv;kf.exports=jf;var vv=kf.exports;/**
|
|
76
|
+
* @license React
|
|
77
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
78
|
+
*
|
|
79
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
80
|
+
*
|
|
81
|
+
* This source code is licensed under the MIT license found in the
|
|
82
|
+
* LICENSE file in the root directory of this source tree.
|
|
83
|
+
*/var pl=S,yv=vv;function xv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var wv=typeof Object.is=="function"?Object.is:xv,Sv=yv.useSyncExternalStore,Nv=pl.useRef,kv=pl.useEffect,jv=pl.useMemo,bv=pl.useDebugValue;Nf.useSyncExternalStoreWithSelector=function(e,t,n,r,s){var l=Nv(null);if(l.current===null){var i={hasValue:!1,value:null};l.current=i}else i=l.current;l=jv(function(){function u(x){if(!f){if(f=!0,m=x,x=r(x),s!==void 0&&i.hasValue){var y=i.value;if(s(y,x))return p=y}return p=x}if(y=p,wv(m,x))return y;var w=r(x);return s!==void 0&&s(y,w)?(m=x,y):(m=x,p=w)}var f=!1,m,p,c=n===void 0?null:n;return[function(){return u(t())},c===null?void 0:function(){return u(c())}]},[t,n,r,s]);var a=Sv(e,l[0],l[1]);return kv(function(){i.hasValue=!0,i.value=a},[a]),bv(a),a};Sf.exports=Nf;var Cv=Sf.exports;const Ev=Mu(Cv),bf={},{useDebugValue:_v}=Ks,{useSyncExternalStoreWithSelector:Tv}=Ev;let Pu=!1;const Pv=e=>e;function Rv(e,t=Pv,n){(bf?"production":void 0)!=="production"&&n&&!Pu&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Pu=!0);const r=Tv(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return _v(r),r}const Ru=e=>{(bf?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?iv(e):e,n=(r,s)=>Rv(t,r,s);return Object.assign(n,t),n},na=e=>e?Ru(e):Ru;class Lv{constructor(){sa(this,"baseURL");this.baseURL=window.location.origin}getAuthHeaders(){const t=localStorage.getItem("agentdog_token"),n={"Content-Type":"application/json"};return t&&(n.Authorization=`Bearer ${t}`),n}async handleResponse(t){if(t.status===401)throw localStorage.removeItem("agentdog_token"),new Error("需要身份验证");if(!t.ok){const n=await t.json().catch(()=>({error:"未知错误"}));throw new Error(n.error||`HTTP error! status: ${t.status}`)}return t.json()}async get(t){const n=await fetch(`${this.baseURL}${t}`,{method:"GET",headers:this.getAuthHeaders()});return this.handleResponse(n)}async post(t,n){const r=await fetch(`${this.baseURL}${t}`,{method:"POST",headers:this.getAuthHeaders(),body:n?JSON.stringify(n):void 0});return this.handleResponse(r)}async put(t,n){const r=await fetch(`${this.baseURL}${t}`,{method:"PUT",headers:this.getAuthHeaders(),body:n?JSON.stringify(n):void 0});return this.handleResponse(r)}async delete(t){const n=await fetch(`${this.baseURL}${t}`,{method:"DELETE",headers:this.getAuthHeaders()});return this.handleResponse(n)}isAuthenticated(){return!!localStorage.getItem("agentdog_token")}getToken(){return localStorage.getItem("agentdog_token")}logout(){localStorage.removeItem("agentdog_token"),window.location.reload()}async checkAuthStatus(){try{return await(await fetch(`${this.baseURL}/api/auth/status`,{method:"GET",headers:this.getAuthHeaders()})).json()}catch{return{authenticated:!1,required:!1}}}async login(t){const n=await fetch(`${this.baseURL}/api/auth/login`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:t})});if(!n.ok){const r=await n.json().catch(()=>({error:"登录失败"}));throw new Error(r.error||"登录失败")}localStorage.setItem("agentdog_token",t)}getGatewayStatus(){return this.get("/api/ai-gateway/status")}updateGatewaySettings(t){return this.put("/api/ai-gateway/settings",t)}getAIProviders(){return this.get("/api/ai-providers")}addAIProvider(t){return this.post("/api/ai-providers",t)}updateAIProvider(t,n){return this.put(`/api/ai-providers/${t}`,n)}deleteAIProvider(t){return this.delete(`/api/ai-providers/${t}`)}testAIProvider(t,n){return this.post(`/api/ai-providers/${t}/test`,n?{apiKey:n}:void 0)}fetchProviderModels(t,n){return this.post(`/api/ai-providers/${t}/models`,n?{apiKey:n}:void 0)}}const W=new Lv,xe=na((e,t)=>({config:null,servers:[],selectedServer:null,loading:!1,saving:!1,error:null,authRequired:!1,authToken:null,showAddServerModal:!1,showClientConfigModal:!1,loadConfig:async()=>{console.log("[ConfigStore] Loading config..."),e({loading:!0,error:null});try{const n=await W.get("/api/config");console.log("[ConfigStore] Fetched config:",n);const r=await W.get("/api/servers");console.log("[ConfigStore] Fetched servers:",r),e({config:n,servers:r,loading:!1}),console.log("[ConfigStore] Config and servers loaded successfully.")}catch(n){console.error("[ConfigStore] Failed to load config:",n),e({error:n.message,loading:!1})}},saveConfig:async()=>{const{config:n}=t();if(n){console.log("[ConfigStore] Saving config...",n),e({saving:!0,error:null});try{await W.put("/api/config",n),e({saving:!1}),console.log("[ConfigStore] Config saved successfully.")}catch(r){console.error("[ConfigStore] Failed to save config:",r),e({error:r.message,saving:!1})}}},updateServerConfig:(n,r)=>{console.log("[ConfigStore] Updating server config:",n,r),e(s=>({servers:s.servers.map(l=>l.name===n?{...l,...r}:l)}))},toggleServer:async(n,r)=>{console.log("[ConfigStore] Toggling server:",n);try{const{servers:s}=t(),l=s.find(i=>i.name===n);if(l){const i=!l.enabled;console.log("[ConfigStore] Local state update for toggle:",n,"enabled:",i),e(a=>({servers:a.servers.map(u=>{var f,m;return u.name===n?{...u,enabled:i,connected:i?u.connected:!1,toolCount:i?u.toolCount:0,enabledToolCount:i&&((f=u.tools)==null?void 0:f.filter(p=>p.enabled).length)||0,tools:i?u.tools:((m=u.tools)==null?void 0:m.map(p=>({...p,enabled:!1})))||[]}:u})}))}console.log("[ConfigStore] Sending toggle API request for",n);try{const i=await W.post(`/api/servers/${n}/toggle`);console.log("[ConfigStore] Server toggle API response:",i),l&&!l.enabled&&r&&(console.log("[ConfigStore] Server was enabled, scheduling tool refresh"),setTimeout(()=>{r()},1500))}catch(i){throw console.error("[ConfigStore] Toggle API request failed for",n),l&&e(a=>({servers:a.servers.map(u=>u.name===n?{...u,enabled:l.enabled,connected:l.connected,toolCount:l.toolCount,enabledToolCount:l.enabledToolCount,tools:l.tools}:u)})),i}}catch(s){throw console.error("[ConfigStore] Error toggling server:",s),e({error:s.message}),s}},toggleServerTool:async(n,r)=>{console.log("[ConfigStore] Toggling tool:",r,"for server:",n);try{const s=await W.post(`/api/servers/${n}/tools/${r}/toggle`);console.log("[ConfigStore] Tool toggle API response:",s),e(l=>({servers:l.servers.map(i=>{var a,u;return i.name===n?{...i,tools:(a=i.tools)==null?void 0:a.map(f=>f.name===r?{...f,enabled:!f.enabled}:f),enabledToolCount:((u=i.tools)==null?void 0:u.map(f=>f.name===r?{...f,enabled:!f.enabled}:f).filter(f=>f.enabled).length)||0}:i})})),console.log("[ConfigStore] Tool toggle state updated locally")}catch(s){throw console.error("[ConfigStore] Error toggling tool:",s),e({error:s.message}),s}},addServer:async(n,r)=>{console.log("[ConfigStore] Adding server:",n,r),e({saving:!0,error:null});try{const s=await W.post("/api/servers",{name:n,config:r});console.log("[ConfigStore] Add server API response:",s),e(l=>({servers:[...l.servers,{...r,name:n,connected:!1,toolCount:0,enabledToolCount:0,tools:[]}],saving:!1,showAddServerModal:!1})),console.log("[ConfigStore] Server added to local state.")}catch(s){throw console.error("[ConfigStore] Error adding server:",s),e({error:s.message,saving:!1}),s}},removeServer:async n=>{console.log("[ConfigStore] Removing server:",n),e({saving:!0,error:null});try{const r=await W.delete(`/api/servers/${n}`);console.log("[ConfigStore] Remove server API response:",r),e(s=>({servers:s.servers.filter(l=>l.name!==n),saving:!1,selectedServer:s.selectedServer===n?null:s.selectedServer})),console.log("[ConfigStore] Server removed from local state.")}catch(r){throw console.error("[ConfigStore] Error removing server:",r),e({error:r.message,saving:!1}),r}},updateServerTools:async(n,r)=>{console.log("[ConfigStore] Updating server tools for",n,r);try{const s=await W.put(`/api/servers/${n}/tools`,{toolsConfig:r});console.log("[ConfigStore] Update server tools API response:",s),t().updateServerConfig(n,{toolsConfig:r}),console.log("[ConfigStore] Server tools updated locally.")}catch(s){console.error("[ConfigStore] Error updating server tools:",s),e({error:s.message})}},syncServerStatus:(n,r)=>{console.log("[ConfigStore] Syncing server status for",n,r),e(s=>({servers:s.servers.map(l=>l.name===n&&(r.connected!==void 0&&r.connected!==l.connected||r.toolCount!==void 0&&r.toolCount!==l.toolCount||r.enabledToolCount!==void 0&&r.enabledToolCount!==l.enabledToolCount)?{...l,connected:r.connected!==void 0?r.connected:l.connected,toolCount:r.toolCount!==void 0?r.toolCount:l.toolCount,enabledToolCount:r.enabledToolCount!==void 0?r.enabledToolCount:l.enabledToolCount}:l)})),console.log("[ConfigStore] Server status synced locally.")},setServers:n=>{console.log("[ConfigStore] Setting servers:",n),e({servers:n})},setSelectedServer:n=>{console.log("[ConfigStore] Setting selected server:",n),e({selectedServer:n})},showAddServer:()=>{console.log("[ConfigStore] Showing add server modal."),e({showAddServerModal:!0})},hideAddServer:()=>{console.log("[ConfigStore] Hiding add server modal."),e({showAddServerModal:!1})},showClientConfig:()=>{console.log("[ConfigStore] Showing client config modal."),e({showClientConfigModal:!0})},hideClientConfig:()=>{console.log("[ConfigStore] Hiding client config modal."),e({showClientConfigModal:!1})},generateClientConfig:(n,r)=>{console.log("[ConfigStore] Generating client config for",n);const{config:s}=t();if(!s)throw new Error("没有可用的配置");const l=r||Object.keys(s.servers),i={};switch(l.forEach(a=>{const u=s.servers[a];u&&u.enabled&&(u.transport==="stdio"?i[a]={command:u.command,args:u.args||[],env:u.env}:u.transport==="http-sse"&&(i[a]={type:"sse",url:u.endpoint}))}),n){case"claude-desktop":return{type:"claude-desktop",name:"Claude Desktop 配置",config:{mcpServers:i},instructions:["1. 打开 Claude Desktop 应用","2. 进入 设置 -> 开发者",'3. 找到 "编辑配置" 按钮',"4. 将配置粘贴到 mcpServers 段中","5. 重启 Claude Desktop"]};case"cursor":return{type:"cursor",name:"Cursor 配置",config:{mcp:{mcpServers:i}},instructions:["1. 打开 Cursor 编辑器","2. 按 Cmd/Ctrl + Shift + P 打开命令面板",'3. 搜索 "Preferences: Open Settings (JSON)"',"4. 将配置添加到设置文件中","5. 重启 Cursor"]};default:throw new Error(`不支持的客户端类型: ${n}`)}},setAuthState:(n,r)=>{console.log("[ConfigStore] Setting auth state:",{required:n,hasToken:!!r}),e({authRequired:n,authToken:r||localStorage.getItem("agentdog_token")})}})),nn=na((e,t)=>({connected:!1,systemStatus:null,tools:[],events:[],selectedServer:null,selectedTool:null,serverLogs:{},setConnected:n=>{e({connected:n})},addServerLog:n=>{e(r=>{const l=[...r.serverLogs[n.serverName]||[],n].slice(-100);return{serverLogs:{...r.serverLogs,[n.serverName]:l}}})},setSystemStatus:n=>{e({systemStatus:n}),n.servers.forEach(r=>{xe.getState().syncServerStatus(r.name,{connected:r.connected,toolCount:r.toolCount,enabledToolCount:r.enabledToolCount})})},setTools:n=>{e({tools:n})},addEvent:n=>{const{events:r}=t(),s=[n,...r].slice(0,100);e({events:s})},setSelectedServer:n=>{e({selectedServer:n})},setSelectedTool:n=>{e({selectedTool:n})}})),Ov=e=>{const t=S.useRef(null),n=S.useRef(null),{setConnected:r,setSystemStatus:s,addEvent:l,addServerLog:i}=nn(),{loadConfig:a}=xe();S.useEffect(()=>{n.current=i},[i]);const u=p=>{console.log("[WebSocket] Updating server status only:",p);const{setServers:c}=xe.getState();c(p)};S.useEffect(()=>{t.current=vs(e,{transports:["websocket"],autoConnect:!0});const p=t.current;return p.on("connect",()=>{console.log("WebSocket 已连接"),r(!0),p.emit("request-status")}),p.on("disconnect",()=>{console.log("WebSocket 已断开"),r(!1)}),p.on("status-update",c=>{console.log("[WebSocket] Status update received:",c),s(c),console.log("[WebSocket] setSystemStatus called with:",c)}),p.on("config-changed",c=>{console.log("[WebSocket] Config changed event received:",c),!c.context||c.context.changeType!=="server-toggle"?a().then(()=>{console.log("[WebSocket] Config reloaded successfully after config-changed event")}).catch(x=>{console.error("[WebSocket] Failed to reload config after config-changed event:",x)}):console.log("[WebSocket] Skipping config reload for server toggle to avoid page flicker"),p.emit("request-status"),l({type:"config-changed",data:c,timestamp:new Date().toISOString()})}),p.on("server-updated",c=>{console.log("[WebSocket] Server updated event received:",c),l({type:"server-updated",data:c,timestamp:c.timestamp||new Date().toISOString()})}),p.on("server-started",()=>{console.log("[WebSocket] Server started event received"),p.emit("request-status")}),p.on("server-stopped",()=>{console.log("[WebSocket] Server stopped event received"),p.emit("request-status")}),p.on("routes-updated",c=>{console.log("[WebSocket] Routes updated event received:",c),c.isReconnection||p.emit("request-status"),l({type:"routes-updated",data:c,timestamp:new Date().toISOString()})}),p.on("tool-called",c=>{console.log("工具调用:",c),l({type:"tool-called",data:c,timestamp:c.timestamp||new Date().toISOString()})}),p.on("server-status-changed",c=>{if(console.log("[WebSocket] Server status changed event received:",c),c.systemStatus){console.log("[WebSocket] Using embedded system status from server-status-changed event");const{servers:x}=c.systemStatus;x&&!c.event?u(x):s(c.systemStatus)}if(c.event==="server-connected"||c.event==="server-enabled"){if(console.log("[WebSocket] Server enabled/connected, updating state smoothly"),c.event==="server-enabled"){console.log("[WebSocket] Server enabled, waiting for connection event");return}if(c.event==="server-connected"&&(console.log("[WebSocket] Server connected, updating tool state"),c.systemStatus&&c.systemStatus.servers)){const{servers:x}=c.systemStatus,y=x.find(w=>w.name===c.serverName);if(y){console.log("[WebSocket] Updating server state for connected server:",y.name);const{setServers:w}=xe.getState(),g=xe.getState().servers.map(d=>d.name===y.name?{...d,connected:y.connected,toolCount:y.toolCount,enabledToolCount:y.enabledToolCount,tools:d.tools||[]}:d);w(g),console.log("[WebSocket] Server state updated smoothly without loadConfig")}}}l({type:c.event,data:c.originalData,timestamp:c.timestamp})}),p.on("server-connected",c=>{console.log("[WebSocket] Legacy server connected event received:",c),setTimeout(()=>{console.log("[WebSocket] Requesting delayed status update after server connection"),p.emit("request-status")},500),setTimeout(()=>{console.log("[WebSocket] Requesting second delayed status update after server connection"),p.emit("request-status")},1500),l({type:"server-connected",data:c,timestamp:c.timestamp||new Date().toISOString()})}),p.on("server-disconnected",c=>{console.log("[WebSocket] Server disconnected event received:",c),p.emit("request-status"),l({type:"server-disconnected",data:c,timestamp:c.timestamp||new Date().toISOString()})}),p.on("server-error",c=>{console.log("[WebSocket] Server error event received:",c),l({type:"server-error",data:c,timestamp:c.timestamp||new Date().toISOString()})}),p.on("error",c=>{console.error("WebSocket 错误:",c),l({type:"error",data:c,timestamp:c.timestamp||new Date().toISOString()})}),p.on("server-log",c=>{n.current&&n.current(c)}),p.on("enhanced-log-added",c=>{console.log("[WebSocket] Enhanced log received:",c),n.current&&!c.logEntry.message.startsWith("Received: {")&&!c.logEntry.message.match(/^\{.*\}$/)&&n.current({serverName:c.serverName,stream:c.logEntry.source||"system",data:`[${c.logEntry.level.toUpperCase()}] ${c.logEntry.message}`,timestamp:c.logEntry.timestamp})}),p.on("server-log-error",c=>{console.log("[WebSocket] Server log error:",c),l({type:"server-error",data:c,timestamp:c.timestamp||new Date().toISOString()})}),p.on("server-connection-status",c=>{console.log("[WebSocket] Server connection status changed:",c),l({type:c.isConnected?"server-connected":"server-disconnected",data:c,timestamp:new Date().toISOString()})}),()=>{p&&p.disconnect()}},[e,r,s,l,a]);const f=p=>{var c;(c=t.current)!=null&&c.connected&&(console.log(`[WebSocket] Manually refreshing tools for server: ${p||"all servers"}`),t.current.emit("request-status"))},m=()=>{var p;(p=t.current)!=null&&p.connected&&t.current.emit("request-status")};return{socket:t.current,requestStatus:m,refreshServerTools:f}},Cf=S.createContext(void 0);function Kl({children:e}){const[t,n]=S.useState(()=>{if(typeof window<"u"){const l=localStorage.getItem("agentdog-theme");if(l==="light"||l==="dark")return l}return"dark"});S.useEffect(()=>{document.documentElement.setAttribute("data-theme",t),localStorage.setItem("agentdog-theme",t)},[t]);const s={theme:t,toggleTheme:()=>{n(l=>l==="light"?"dark":"light")},setTheme:n};return o.jsx(Cf.Provider,{value:s,children:e})}function Av(){const e=S.useContext(Cf);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e}var Mv={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Iv=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),zv=(e,t)=>{const n=S.forwardRef(({color:r="currentColor",size:s=24,strokeWidth:l=2,absoluteStrokeWidth:i,children:a,...u},f)=>S.createElement("svg",{ref:f,...Mv,width:s,height:s,stroke:r,strokeWidth:i?Number(l)*24/Number(s):l,className:`lucide lucide-${Iv(e)}`,...u},[...t.map(([m,p])=>S.createElement(m,p)),...(Array.isArray(a)?a:[a])||[]]));return n.displayName=`${e}`,n};var B=zv;const $v=B("AlertCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),Lu=B("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),Dv=B("Check",[["polyline",{points:"20 6 9 17 4 12",key:"10jjfj"}]]),ra=B("Copy",[["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"}]]),Bv=B("Dog",[["path",{d:"M10 5.172C10 3.782 8.423 2.679 6.5 3c-2.823.47-4.113 6.006-4 7 .08.703 1.725 1.722 3.656 1 1.261-.472 1.96-1.45 2.344-2.5",key:"19br0u"}],["path",{d:"M14.267 5.172c0-1.39 1.577-2.493 3.5-2.172 2.823.47 4.113 6.006 4 7-.08.703-1.725 1.722-3.656 1-1.261-.472-1.855-1.45-2.239-2.5",key:"11n1an"}],["path",{d:"M8 14v.5",key:"1nzgdb"}],["path",{d:"M16 14v.5",key:"1lajdz"}],["path",{d:"M11.25 16.25h1.5L12 17l-.75-.75Z",key:"12kq1m"}],["path",{d:"M4.42 11.247A13.152 13.152 0 0 0 4 14.556C4 18.728 7.582 21 12 21s8-2.272 8-6.444c0-1.061-.162-2.2-.493-3.309m-9.243-6.082A8.801 8.801 0 0 1 12 5c.78 0 1.5.108 2.161.306",key:"wsu29d"}]]),Uv=B("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]),Fv=B("ExternalLink",[["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}],["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["line",{x1:"10",x2:"21",y1:"14",y2:"3",key:"18c3s4"}]]),Vv=B("FileCog",[["path",{d:"M4 6V4a2 2 0 0 1 2-2h8.5L20 7.5V20a2 2 0 0 1-2 2H4",key:"dba9qu"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["circle",{cx:"6",cy:"14",r:"3",key:"a1xfv6"}],["path",{d:"M6 10v1",key:"xs0f9j"}],["path",{d:"M6 17v1",key:"idyhc0"}],["path",{d:"M10 14H9",key:"m5fm2q"}],["path",{d:"M3 14H2",key:"19ot09"}],["path",{d:"m9 11-.88.88",key:"lhul2b"}],["path",{d:"M3.88 16.12 3 17",key:"169z9n"}],["path",{d:"m9 17-.88-.88",key:"5io96w"}],["path",{d:"M3.88 11.88 3 11",key:"1ynhy1"}]]),Wv=B("FileText",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["line",{x1:"16",x2:"8",y1:"13",y2:"13",key:"14keom"}],["line",{x1:"16",x2:"8",y1:"17",y2:"17",key:"17nazh"}],["line",{x1:"10",x2:"8",y1:"9",y2:"9",key:"1a5vjj"}]]),Hv=B("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]),qv=B("LayoutDashboard",[["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"}]]),Kv=B("ListTree",[["path",{d:"M21 12h-8",key:"1bmf0i"}],["path",{d:"M21 6H8",key:"1pqkrb"}],["path",{d:"M21 18h-8",key:"1tm79t"}],["path",{d:"M3 6v4c0 1.1.9 2 2 2h3",key:"1ywdgy"}],["path",{d:"M3 10v6c0 1.1.9 2 2 2h3",key:"2wc746"}]]),Ou=B("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),Qv=B("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]),Jv=B("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]),Gv=B("Pencil",[["path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z",key:"5qss01"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]),Yv=B("PlugZap",[["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:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m18 3-4 4h6l-4 4",key:"16psg9"}]]),rn=B("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),Ws=B("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]),Au=B("Save",[["path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z",key:"1owoqh"}],["polyline",{points:"17 21 17 13 7 13 7 21",key:"1md35c"}],["polyline",{points:"7 3 7 8 15 8",key:"8nz8an"}]]),Xv=B("ScrollText",[["path",{d:"M8 21h12a2 2 0 0 0 2-2v-2H10v2a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v3h4",key:"13a6an"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M15 12h-5",key:"r7krc0"}]]),Ef=B("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]),Hs=B("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),_f=B("Sparkles",[["path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z",key:"17u4zn"}],["path",{d:"M5 3v4",key:"bklmnn"}],["path",{d:"M19 17v4",key:"iiml17"}],["path",{d:"M3 5h4",key:"nem4j1"}],["path",{d:"M17 19h4",key:"lbex7p"}]]),Zv=B("Sun",[["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"}]]),ey=B("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]),Tf=B("ToggleLeft",[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"6",ry:"6",key:"f2vt7d"}],["circle",{cx:"8",cy:"12",r:"2",key:"1nvbw3"}]]),Pf=B("ToggleRight",[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"6",ry:"6",key:"f2vt7d"}],["circle",{cx:"16",cy:"12",r:"2",key:"4ma0v8"}]]),Jt=B("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]),ty=B("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]),ml=B("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Rf=B("Zap",[["polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2",key:"45s27k"}]]),ny=({className:e=""})=>{const{theme:t,toggleTheme:n}=Av();return o.jsx("button",{onClick:n,className:`btn btn-ghost btn-sm btn-circle ${e}`,title:t==="light"?"切换到深色模式":"切换到浅色模式",children:t==="light"?o.jsx(Jv,{className:"h-4 w-4"}):o.jsx(Zv,{className:"h-4 w-4"})})},ry="https://github.com/lzm04521/Agent-Dog",sy=({outletContext:e})=>{const[t,n]=S.useState(""),[r,s]=S.useState(""),{connected:l}=nn();S.useEffect(()=>{W.get("/api/system/info").then(a=>{a!=null&&a.version&&n(String(a.version)),a!=null&&a.configPath&&s(String(a.configPath))}).catch(()=>{})},[]);const i=[{to:"/dashboard",label:"Dashboard",icon:qv},{to:"/mcp",label:"MCP 服务器",icon:Ef},{to:"/providers",label:"AI 供应商",icon:_f},{to:"/logs",label:"全局日志",icon:Xv}];return o.jsxs("div",{className:"min-h-screen bg-base-200 text-base-content",children:[o.jsxs("header",{className:"glass sticky top-0 z-30 flex items-center gap-3 px-4 lg:px-6 py-2.5 border-b border-base-300",children:[o.jsx("div",{className:"w-9 h-9 rounded-xl bg-gradient-to-br from-primary to-accent flex items-center justify-center text-primary-content shadow-md shrink-0",children:o.jsx(Bv,{className:"w-5 h-5"})}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("div",{className:"text-base font-bold leading-tight",children:"AgentDog"}),o.jsx("div",{className:"hidden sm:block text-[11px] text-base-content/50",children:"MCP 网关 + AI API 网关"})]}),r&&o.jsxs("div",{className:"hidden xl:flex items-center gap-1.5 ml-2 pl-3 border-l border-base-300 text-[11px] font-mono text-base-content/40 max-w-[340px] cursor-default",title:r,children:[o.jsx(Vv,{className:"w-3.5 h-3.5 shrink-0"}),o.jsx("span",{className:"truncate",children:r})]}),o.jsxs("div",{className:"ml-auto flex items-center gap-1.5",children:[o.jsxs("span",{className:`badge badge-sm gap-1.5 ${l?"badge-success badge-outline":"badge-warning badge-outline"}`,title:r||void 0,children:[o.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${l?"bg-success":"bg-warning"}`}),l?"运行中":"已断开",t&&o.jsxs("span",{children:["· v",t]})]}),o.jsx(ny,{}),o.jsx("a",{href:ry,target:"_blank",rel:"noreferrer",title:"GitHub 仓库",className:"btn btn-ghost btn-sm btn-square",children:o.jsx(Hv,{className:"w-4 h-4"})})]})]}),o.jsxs("div",{className:"flex gap-4 lg:gap-6 max-w-[1600px] mx-auto p-4 lg:p-6 items-start",children:[o.jsx("aside",{className:"glass w-[240px] shrink-0 sticky top-[4.5rem] hidden md:flex flex-col gap-1 p-3 rounded-box border border-base-300 shadow-sm",children:i.map(({to:a,label:u,icon:f})=>o.jsxs(Nu,{to:a,className:({isActive:m})=>`flex items-center gap-2.5 px-3 py-2 rounded-field text-sm font-medium transition-colors ${m?"bg-primary/10 text-primary font-semibold":"text-base-content/60 hover:bg-base-100 hover:text-base-content"}`,children:[o.jsx(f,{className:"w-[18px] h-[18px] shrink-0"}),u]},a))}),o.jsx("nav",{className:"md:hidden fixed bottom-3 left-1/2 -translate-x-1/2 z-30 glass flex gap-1 p-1.5 rounded-full border border-base-300 shadow-md",children:i.map(({to:a,label:u,icon:f})=>o.jsx(Nu,{to:a,title:u,className:({isActive:m})=>`flex items-center justify-center w-10 h-10 rounded-full transition-colors ${m?"bg-primary/10 text-primary":"text-base-content/60"}`,children:o.jsx(f,{className:"w-[18px] h-[18px]"})},a))}),o.jsx("main",{className:"flex-1 min-w-0 page-fade pb-24 md:pb-6",children:o.jsx(Gm,{context:e})})]})]})},ly=Ks.memo(({server:e,selectedServer:t,setSelectedServer:n})=>{console.log(`[ServerListItem] Rendering: ${e.name}`);const r=t===e.name;return o.jsxs("div",{className:`p-4 cursor-pointer transition-colors relative ${r?"bg-primary/15 ring-1 ring-inset ring-primary/50":"hover:bg-base-200"}`,onClick:()=>n(e.name),children:[r&&o.jsx("div",{className:"absolute top-0 right-0 bottom-0 w-1 bg-primary"}),o.jsxs("div",{className:"flex items-center space-x-3 mb-2",children:[o.jsx("div",{className:`w-3 h-3 rounded-full ${e!=null&&e.connected?"bg-green-500":e!=null&&e.enabled?"bg-yellow-500":"bg-gray-400"}`}),o.jsx("h3",{className:`truncate ${r?"font-semibold text-primary":"font-medium text-base-content"}`,children:(e==null?void 0:e.name)||"未知"})]}),o.jsx("div",{className:"text-sm text-base-content/70 mb-2",children:(e==null?void 0:e.description)||"无描述"}),o.jsxs("div",{className:"flex items-center justify-between text-xs",children:[o.jsx("div",{className:"flex items-center space-x-3",children:(e==null?void 0:e.enabled)&&o.jsx("span",{className:"text-base-content/70",children:e!=null&&e.connected?`${(e==null?void 0:e.enabledToolCount)||0}/${(e==null?void 0:e.toolCount)||0} 个工具`:`${(e==null?void 0:e.toolCount)||0} 个工具`})}),o.jsx("span",{className:`badge ${e!=null&&e.connected?"badge-success":e!=null&&e.enabled?"badge-warning":"badge-neutral"}`,children:e!=null&&e.connected?"已连接":e!=null&&e.enabled?"等待连接":"已禁用"})]})]},e.name)}),oy=({server:e})=>{const[t,n]=S.useState([]),[r,s]=S.useState((e==null?void 0:e.toolsConfig)||{mode:"all"}),[l,i]=S.useState(!0),[a]=S.useState(!0),[u,f]=S.useState(""),{toggleServerTool:m,updateServerTools:p}=xe();S.useEffect(()=>{if(!(e!=null&&e.name)){i(!1),n([]);return}c().then(()=>{y()})},[e==null?void 0:e.name,e==null?void 0:e.connected,e==null?void 0:e.toolCount]);const c=async()=>{if(!(e!=null&&e.name)){i(!1),n([]);return}i(!0);try{const h=await W.get(`/api/servers/${e==null?void 0:e.name}/tools`);n(h.tools),s(h.toolsConfig)}catch(h){console.error("加载服务器工具失败:",h),n([])}finally{i(!1)}},x=async h=>{if(!(e!=null&&e.name)){console.warn("无法切换工具: 未找到服务器");return}n(k=>k.map(E=>E.name===h?{...E,enabled:!E.enabled}:E));try{await m((e==null?void 0:e.name)||"",h),console.log("工具切换成功,跳过重载以避免界面闪烁")}catch(k){console.error("切换工具状态失败:",k),n(E=>E.map(_=>_.name===h?{..._,enabled:!_.enabled}:_))}},y=async()=>{if(e!=null&&e.name&&r.mode!=="blacklist"){const h={...r,mode:"blacklist"};s(h);try{await p((e==null?void 0:e.name)||"",h),await c()}catch(k){console.warn(`Failed to update tools config for ${e==null?void 0:e.name}:`,k)}}},w=async h=>{if(!(e!=null&&e.name)){console.warn("无法批量切换工具: 未找到服务器");return}const k=b();for(const E of k)E.enabled!==h&&await m((e==null?void 0:e.name)||"",E.name);await c()},b=()=>{let h=t;return u&&(h=h.filter(k=>k.name.toLowerCase().includes(u.toLowerCase())||k.description.toLowerCase().includes(u.toLowerCase()))),h},g=t.filter(h=>h.enabled).length,d=b();return l?o.jsx("div",{className:"p-6 flex items-center justify-center",children:o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"loading loading-spinner loading-lg text-primary"}),o.jsx("p",{className:"text-base-content/70",children:"正在加载工具列表..."})]})}):o.jsxs("div",{className:"p-6",children:[t.length>0&&o.jsx("div",{className:"mb-6 alert alert-info",children:o.jsxs("div",{className:"flex items-start space-x-3",children:[o.jsx($v,{className:"h-5 w-5"}),o.jsxs("div",{className:"text-sm",children:[o.jsx("p",{className:"font-medium mb-1",children:"关于工具控制"}),o.jsxs("ul",{className:"list-disc list-inside space-y-1",children:[o.jsx("li",{children:"已启用的工具将对 MCP 客户端可见可用"}),o.jsx("li",{children:"已禁用的工具将从 MCP 客户端隐藏"}),o.jsx("li",{children:"更改工具状态后,MCP 客户端可能需要重新连接才能看到变化"}),o.jsx("li",{children:"某些工具可能依赖其他工具,请谨慎禁用"})]})]})]})}),o.jsxs("div",{className:"flex items-center justify-between mb-6",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-medium text-base-content",children:"工具列表"}),o.jsxs("p",{className:"text-sm text-base-content/70 mt-1",children:["查看并管理 ",e==null?void 0:e.name," 服务器提供的工具,可禁用不需要的工具"]})]}),o.jsx("div",{className:"flex items-center space-x-2",children:o.jsxs("button",{onClick:c,className:"btn btn-outline btn-sm flex items-center space-x-2",children:[o.jsx(Ws,{className:"h-4 w-4"}),o.jsx("span",{children:"刷新"})]})})]}),o.jsx("div",{className:"bg-base-200 p-4 rounded-lg mb-6",children:o.jsx("div",{className:"flex items-center justify-between mb-4",children:o.jsxs("div",{className:"flex items-center space-x-6",children:[o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"text-2xl font-bold text-primary",children:t.length}),o.jsx("div",{className:"text-sm text-base-content/70",children:"工具总数"})]}),o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"text-2xl font-bold text-success",children:g}),o.jsx("div",{className:"text-sm text-base-content/70",children:"已启用"})]}),o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"text-2xl font-bold text-error",children:t.length-g}),o.jsx("div",{className:"text-sm text-base-content/70",children:"已禁用"})]})]})})}),o.jsxs("div",{className:"flex items-center justify-between mb-6",children:[o.jsx("div",{className:"flex items-center space-x-4",children:o.jsxs("div",{className:"relative",children:[o.jsx("input",{type:"text",placeholder:"搜索工具...",value:u,onChange:h=>f(h.target.value),className:"input input-bordered w-full max-w-xs"}),u&&o.jsx("button",{onClick:()=>f(""),className:"absolute right-3 top-2.5 text-base-content/40 hover:text-base-content/60",children:"×"})]})}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx("button",{onClick:()=>w(!0),className:"btn btn-outline btn-sm",children:"全部启用"}),o.jsx("button",{onClick:()=>w(!1),className:"btn btn-outline btn-sm",children:"全部禁用"})]})]}),o.jsx("div",{className:"space-y-3",children:d.length===0?o.jsxs("div",{className:"text-center py-8 text-base-content/70",children:[o.jsx(Rf,{className:"h-12 w-12 mx-auto mb-4 text-base-content/30"}),o.jsx("p",{className:"mb-2",children:u?"未找到匹配的工具":a?"该服务器未提供任何工具":"没有已启用的工具"}),u&&o.jsx("button",{onClick:()=>f(""),className:"text-primary hover:text-primary-focus text-sm",children:"清除搜索"})]}):d.map(h=>o.jsx("div",{className:`card border transition-all p-4 ${h.enabled?"border-success/30 bg-success/10":"border-base-300 bg-base-100"}`,children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex-1",children:[o.jsxs("div",{className:"flex items-center space-x-3 mb-2",children:[o.jsx("h4",{className:"font-medium text-base-content",children:h.name}),o.jsx("span",{className:`badge badge-sm ${h.enabled?"badge-success":"badge-ghost"}`,children:h.enabled?"已启用":"已禁用"})]}),o.jsx("p",{className:"text-sm text-base-content/80 mb-3",children:h.description}),h.inputSchema&&o.jsxs("details",{className:"text-xs",children:[o.jsx("summary",{className:"cursor-pointer text-base-content/70 hover:text-base-content",children:"查看参数结构"}),o.jsx("pre",{className:"bg-base-100 p-2 rounded border border-base-300 mt-2 overflow-x-auto text-base-content",children:JSON.stringify(h.inputSchema,null,2)})]})]}),o.jsx("div",{className:"flex items-center space-x-3",children:o.jsx("button",{onClick:()=>x(h.name),className:`btn btn-ghost btn-sm ${h.enabled?"text-success hover:bg-success/20":"text-base-content/40 hover:bg-base-200"}`,title:h.enabled?"禁用该工具":"启用该工具",children:h.enabled?o.jsx(Pf,{className:"h-6 w-6"}):o.jsx(Tf,{className:"h-6 w-6"})})})]})},h.name))})]})},iy=({serverName:e})=>{const t=nn(c=>c.serverLogs[e]||[]),n=nn(c=>c.addServerLog),[r,s]=S.useState("all"),[l,i]=S.useState(!1),[a,u]=S.useState(!1);console.log(`[ServerLogs] Rendering for server: ${e}, logs count: ${t.length}`,t),S.useEffect(()=>{(async()=>{if(!(t.length>0)){u(!0);try{const x=await fetch(`/api/logs/${e}?limit=100`);if(x.ok){const y=await x.json();console.log(`[ServerLogs] Loaded ${y.length} historical logs for ${e}`),y.forEach(w=>{n({serverName:e,stream:w.source||"system",data:`[${w.level.toUpperCase()}] ${w.message}`,timestamp:w.timestamp})})}else console.warn(`[ServerLogs] Failed to load historical logs for ${e}: ${x.status}`)}catch(x){console.error(`[ServerLogs] Error loading historical logs for ${e}:`,x)}finally{u(!1)}}})()},[e,t.length,n]);const f=t.filter(c=>{var x,y;return!l&&((x=c.data)!=null&&x.includes("[DEBUG]"))?!1:r==="all"?!0:(y=c.data)==null?void 0:y.includes(`[${r.toUpperCase()}]`)}),m=(c,x)=>c!=null&&c.includes("[ERROR]")||x==="stderr"?"text-error":c!=null&&c.includes("[WARN]")?"text-warning":c!=null&&c.includes("[DEBUG]")?"text-base-content/60":c!=null&&c.includes("[INFO]")?"text-success":"text-base-content",p=c=>{switch(c){case"stderr":return"🔴";case"stdout":return"🔵";case"system":return"⚙️";default:return"📝"}};return o.jsxs("div",{className:"card bg-base-200 h-full flex flex-col",children:[o.jsxs("div",{className:"p-3 border-b border-base-300 flex items-center justify-between flex-shrink-0",children:[o.jsxs("div",{className:"flex items-center space-x-4",children:[o.jsxs("select",{value:r,onChange:c=>s(c.target.value),className:"select select-sm bg-base-100 text-base-content",children:[o.jsx("option",{value:"all",children:"全部级别"}),o.jsx("option",{value:"info",children:"信息"}),o.jsx("option",{value:"warn",children:"警告"}),o.jsx("option",{value:"error",children:"错误"}),o.jsx("option",{value:"debug",children:"调试"})]}),o.jsxs("label",{className:"label cursor-pointer space-x-2",children:[o.jsx("input",{type:"checkbox",checked:l,onChange:c=>i(c.target.checked),className:"checkbox checkbox-sm"}),o.jsx("span",{className:"label-text",children:"显示调试日志"})]})]}),o.jsxs("div",{className:"text-sm text-base-content/60",children:[f.length," / ",t.length," 条日志"]})]}),o.jsx("div",{className:"font-mono text-sm p-4 flex-1 min-h-0 overflow-y-auto bg-base-100",children:a?o.jsxs("div",{className:"text-center py-8 text-base-content/60",children:[o.jsx("p",{className:"mb-2",children:"📥 正在加载历史日志..."}),o.jsxs("div",{className:"loading loading-dots loading-md",children:["正在为 ",e," 加载服务器日志..."]})]}):f.length===0?o.jsxs("div",{className:"text-center py-8 text-base-content/60",children:[o.jsx("p",{children:"暂无日志记录"}),o.jsx("p",{className:"text-xs mt-2",children:"MCP 服务器连接后运行日志将显示在这里"})]}):f.map((c,x)=>o.jsxs("div",{className:`flex items-start mb-1 ${m(c.data,c.stream)}`,children:[o.jsx("span",{className:"flex-shrink-0 mr-2 text-xs text-base-content/50",children:new Date(c.timestamp).toLocaleTimeString()}),o.jsx("span",{className:"flex-shrink-0 mr-2 text-xs",children:p(c.stream)}),o.jsx("span",{className:"whitespace-pre-wrap break-all",children:c.data})]},x))})]})},Ql=/^[a-zA-Z0-9\-_]+$/,ay=({server:e,refreshServerTools:t})=>{var T;const[n,r]=S.useState("tools"),[s,l]=S.useState(!1),[i,a]=S.useState(e),[u,f]=S.useState(!1),[m,p]=S.useState(!1),[c,x]=S.useState({valid:!0}),{updateServerConfig:y,toggleServer:w,removeServer:b,saving:g}=xe();S.useEffect(()=>{a(e),l(!1),x({valid:!0}),r("tools")},[e.name]),S.useEffect(()=>{n==="config"&&l(!0)},[n]);const d=v=>!v||v.trim()===""?{valid:!1,error:"服务器名称不能为空"}:v.length>50?{valid:!1,error:"服务器名称过长(最多 50 个字符)"}:Ql.test(v)?{valid:!0}:{valid:!1,error:"服务器名称只能包含字母、数字、连字符和下划线",suggestions:h(v)},h=v=>{const N=[];let j=v.replace(/[^a-zA-Z0-9\-_]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"");j&&Ql.test(j)&&N.push(j);let P=v.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9\-_]/g,"");return P&&Ql.test(P)&&N.push(P),N.slice(0,3)},k=async()=>{f(!0);try{await w((e==null?void 0:e.name)||"",()=>t(e==null?void 0:e.name))}catch(v){console.error("切换服务器状态失败:",v)}finally{setTimeout(()=>{f(!1)},1500)}},E=async()=>{if(!(!(e!=null&&e.name)||m)){p(!0);try{e.enabled&&await w((e==null?void 0:e.name)||""),await w((e==null?void 0:e.name)||"",()=>t(e==null?void 0:e.name))}catch(v){console.error("重试连接失败:",v),alert(`重试连接失败: ${v.message}`)}finally{setTimeout(()=>{p(!1)},1500)}}},_=async()=>{if(i.name!==e.name){const N=d(i.name);if(!N.valid){alert(`服务器名称无效: ${N.error}`);return}try{const j=await W.get("/api/servers");if(Object.keys(j).filter(M=>M!==e.name).includes(i.name)){alert(`服务器名称 "${i.name}" 已存在`);return}}catch(j){console.warn("无法检查服务器名称冲突:",j)}}if(i.env&&i.transport==="stdio"){const N=Object.entries(i.env),j=N.filter(([M])=>!M.trim()||!F(M)),P=N.map(([M])=>M),L=P.filter((M,U)=>P.indexOf(M)!==U);if(j.length>0){alert("请修正无效的环境变量名称");return}if(L.length>0){alert("环境变量名称不能重复");return}}const v={...i};if(v.env){const N={};Object.entries(v.env).forEach(([j,P])=>{j.trim()&&F(j)&&(N[j]=String(P))}),v.env=Object.keys(N).length>0?N:void 0}try{console.log("[ServerPanel] Saving server config:",e==null?void 0:e.name,v),console.log("[ServerPanel] Environment variables:",v.env);const N=await W.put(`/api/servers/${e==null?void 0:e.name}`,v);console.log("[ServerPanel] Server updated successfully:",N),N.server&&y((e==null?void 0:e.name)||"",N.server),console.log("[ServerPanel] Config saved successfully"),l(!1)}catch(N){console.error("更新服务器配置失败:",N),alert(`❌ 保存配置失败:
|
|
84
|
+
|
|
85
|
+
${N.message}`)}},R=(v,N)=>{const j={...i,[v]:N};a(j),v==="name"&&x(d(N))},A=(v,N,j)=>{var M,U,G;const P=i.env||{},L=Object.entries(P);if(N==="key"){const H=(M=L[v])==null?void 0:M[0],he=((U=L[v])==null?void 0:U[1])||"",Ut={...P};H&&delete Ut[H],j.trim()&&F(j)&&(Ut[j]=he),a({...i,env:Ut})}else{const H=(G=L[v])==null?void 0:G[0];H&&a({...i,env:{...P,[H]:j}})}},F=v=>/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(v),I=()=>{const v=i.env||{};let N="NEW_VAR",j=1;for(;v[N];)N=`NEW_VAR_${j}`,j++;const P={...v,[N]:""};a({...i,env:P})},ie=v=>{var L;const N=i.env||{},P=(L=Object.entries(N)[v])==null?void 0:L[0];if(P!==void 0){const M={...N};delete M[P],a({...i,env:M})}},Je=(v,N,j)=>{var M,U,G;const P=i.headers||{},L=Object.entries(P);if(N==="key"){const H=(M=L[v])==null?void 0:M[0],he=((U=L[v])==null?void 0:U[1])||"",Ut={...P};H&&delete Ut[H],j.trim()&&(Ut[j]=he),a({...i,headers:Ut})}else{const H=(G=L[v])==null?void 0:G[0];H&&a({...i,headers:{...P,[H]:j}})}},rt=()=>{const v=i.headers||{};let N="Header-Name",j=1;for(;v[N];)N=`Header-Name-${j}`,j++;const P={...v,[N]:""};a({...i,headers:P})},on=v=>{var L;const N=i.headers||{},P=(L=Object.entries(N)[v])==null?void 0:L[0];if(P){const M={...N};delete M[P],a({...i,headers:Object.keys(M).length>0?M:void 0})}},Vn=async()=>{if(confirm(`确定要删除服务器 "${e==null?void 0:e.name}" 吗?`))try{await b((e==null?void 0:e.name)||""),console.log("[ServerPanel] 服务器删除成功")}catch(v){console.error("删除服务器失败:",v),alert(`删除服务器失败: ${v.message}`)}},gt=i.transport==="stdio";return o.jsxs("div",{className:"flex flex-col h-full",children:[o.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-base-300 bg-base-100",children:[o.jsx("div",{className:"flex items-center space-x-4",children:o.jsxs("div",{children:[o.jsxs("h2",{className:"text-xl font-bold text-base-content flex items-center gap-3",children:[e==null?void 0:e.name,o.jsx("span",{className:`badge ${(e==null?void 0:e.transport)==="stdio"?"badge-info":(e==null?void 0:e.transport)==="http-sse"?"badge-success":"badge-secondary"}`,children:(e==null?void 0:e.transport)||"未知"})]}),o.jsx("p",{className:"text-sm text-base-content/70 mt-1",children:(e==null?void 0:e.description)||"无描述"})]})}),o.jsxs("div",{className:"flex items-center space-x-2",children:[(e==null?void 0:e.adminUrl)&&o.jsx("a",{href:e.adminUrl,target:"_blank",rel:"noopener noreferrer",onClick:v=>v.stopPropagation(),title:"打开该 MCP 自带的管理界面",className:"btn btn-ghost btn-square",children:o.jsx(Fv,{className:"h-5 w-5"})}),o.jsx("button",{onClick:E,className:"btn btn-ghost btn-square",title:"重试连接",disabled:m,children:m?o.jsx(Ou,{className:"h-5 w-5 animate-spin"}):o.jsx(Ws,{className:"h-5 w-5"})}),o.jsx("button",{onClick:Vn,className:"btn btn-ghost btn-square text-error",title:"删除该 MCP",children:o.jsx(Jt,{className:"h-5 w-5"})}),o.jsx("button",{onClick:k,className:`btn btn-ghost btn-square ${e!=null&&e.enabled?"text-success":"text-base-content/40"}`,title:e!=null&&e.enabled?"禁用该 MCP":"启用该 MCP",disabled:u,children:u?o.jsx(Ou,{className:"h-5 w-5 animate-spin"}):e!=null&&e.enabled?o.jsx(Pf,{className:"h-5 w-5"}):o.jsx(Tf,{className:"h-5 w-5"})})]})]}),o.jsx("div",{className:"border-b border-base-300",children:o.jsx("div",{className:"tabs tabs-bordered px-6",children:[{id:"tools",label:"工具列表",icon:Rf},{id:"config",label:"服务器配置",icon:Hs},{id:"logs",label:"运行日志",icon:Ws}].map(({id:v,label:N,icon:j})=>o.jsxs("button",{onClick:()=>r(v),className:`tab tab-bordered flex items-center gap-2 ${n===v?"tab-active":""}`,children:[o.jsx(j,{className:"h-4 w-4"}),o.jsx("span",{children:N})]},v))})}),o.jsxs("div",{className:"flex-1 overflow-y-auto",children:[n==="config"&&o.jsxs("div",{className:"p-6",children:[o.jsxs("div",{className:"flex items-center justify-between mb-6",children:[o.jsx("h3",{className:"text-lg font-medium text-base-content",children:"服务器配置"}),o.jsx("div",{className:"flex items-center space-x-2",children:s?o.jsxs("button",{onClick:_,disabled:g||!c.valid,className:"btn btn-primary btn-sm flex items-center gap-2",children:[o.jsx(Au,{className:"h-4 w-4"}),o.jsx("span",{children:g?"保存中...":"保存"})]}):o.jsx("button",{onClick:()=>l(!0),className:"btn btn-primary btn-sm",children:"编辑配置"})})]}),o.jsxs("div",{className:"space-y-6",children:[o.jsx("div",{className:"card bg-base-200",children:o.jsxs("div",{className:"card-body",children:[o.jsx("h4",{className:"card-title text-base-content",children:"基本信息"}),o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{className:"form-control",children:[o.jsx("label",{className:"label",children:o.jsx("span",{className:"label-text",children:"服务器名称"})}),o.jsx("input",{type:"text",value:i.name,onChange:v=>R("name",v.target.value),disabled:!s,className:`input input-bordered w-full ${c.valid?"":"input-error"}`}),!c.valid&&s&&o.jsx("label",{className:"label",children:o.jsx("span",{className:"label-text-alt text-error",children:c.error})})]}),o.jsxs("div",{className:"form-control",children:[o.jsx("label",{className:"label",children:o.jsx("span",{className:"label-text",children:"传输协议"})}),o.jsxs("select",{value:i.transport,onChange:v=>R("transport",v.target.value),disabled:!s,className:"select select-bordered w-full",children:[o.jsx("option",{value:"stdio",children:"Stdio"}),o.jsx("option",{value:"http-sse",children:"HTTP SSE"}),o.jsx("option",{value:"streamable-http",children:"Streamable HTTP"})]})]}),o.jsxs("div",{className:"col-span-2 form-control",children:[o.jsx("label",{className:"label",children:o.jsx("span",{className:"label-text",children:"描述"})}),o.jsx("textarea",{value:i.description||"",onChange:v=>R("description",v.target.value),disabled:!s,rows:2,className:"textarea textarea-bordered w-full",placeholder:"服务器描述..."})]}),o.jsxs("div",{className:"col-span-2 form-control",children:[o.jsx("label",{className:"label",children:o.jsx("span",{className:"label-text",children:"管理界面地址(可选)"})}),o.jsx("input",{type:"url",value:i.adminUrl||"",onChange:v=>R("adminUrl",v.target.value),disabled:!s,className:"input input-bordered w-full",placeholder:"如 http://127.0.0.1:61823/admin/ —— 该 MCP 自带管理界面的地址"}),o.jsx("label",{className:"label",children:o.jsx("span",{className:"label-text-alt",children:'设置后,服务器标题旁会出现"打开管理页"按钮,直达该 MCP 自带的管理界面'})})]})]})]})}),o.jsx("div",{className:"card bg-base-200",children:o.jsxs("div",{className:"card-body",children:[o.jsx("h4",{className:"card-title text-base-content",children:"连接配置"}),gt?o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"form-control",children:[o.jsx("label",{className:"label",children:o.jsx("span",{className:"label-text",children:"命令"})}),o.jsx("input",{type:"text",value:i.command||"",onChange:v=>R("command",v.target.value),disabled:!s,className:"input input-bordered w-full",placeholder:"例如:npx, node, python"})]}),o.jsxs("div",{className:"form-control",children:[o.jsx("label",{className:"label",children:o.jsx("span",{className:"label-text",children:"参数(每行一个)"})}),o.jsx("textarea",{value:((T=i.args)==null?void 0:T.join(`
|
|
86
|
+
`))||"",onChange:v=>R("args",v.target.value.split(`
|
|
87
|
+
`).filter(Boolean)),disabled:!s,rows:3,className:"textarea textarea-bordered w-full",placeholder:"例如:\\n@modelcontextprotocol/server-filesystem\\n/path/to/directory"})]}),o.jsxs("div",{className:"form-control",children:[o.jsx("label",{className:"label",children:o.jsx("span",{className:"label-text",children:"环境变量"})}),o.jsxs("div",{className:"space-y-2",children:[Object.entries(i.env||{}).map(([v,N],j)=>o.jsxs("div",{className:"flex gap-2",children:[o.jsx("input",{type:"text",value:v,onChange:P=>A(j,"key",P.target.value),disabled:!s,className:"input input-bordered input-sm flex-1",placeholder:"变量名"}),o.jsx("input",{type:"text",value:String(N),onChange:P=>A(j,"value",P.target.value),disabled:!s,className:"input input-bordered input-sm flex-1",placeholder:"值"}),s&&o.jsx("button",{type:"button",onClick:()=>ie(j),className:"btn btn-ghost btn-sm btn-square text-error",children:o.jsx(Jt,{className:"h-4 w-4"})})]},j)),s&&o.jsxs("button",{type:"button",onClick:I,className:"btn btn-ghost btn-sm text-primary",children:[o.jsx(rn,{className:"h-4 w-4"}),"添加环境变量"]})]})]})]}):o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"form-control",children:[o.jsx("label",{className:"label",children:o.jsx("span",{className:"label-text",children:"URL"})}),o.jsx("input",{type:"url",value:i.url||i.endpoint||"",onChange:v=>R("url",v.target.value),disabled:!s,className:"input input-bordered w-full",placeholder:"例如:https://api.example.com/mcp"})]}),o.jsxs("div",{className:"form-control",children:[o.jsx("label",{className:"label",children:o.jsx("span",{className:"label-text",children:"请求头"})}),o.jsxs("div",{className:"space-y-2",children:[Object.entries(i.headers||{}).map(([v,N],j)=>o.jsxs("div",{className:"flex gap-2",children:[o.jsx("input",{type:"text",value:v,onChange:P=>Je(j,"key",P.target.value),disabled:!s,className:"input input-bordered input-sm flex-1",placeholder:"Header 名称"}),o.jsx("input",{type:"text",value:N,onChange:P=>Je(j,"value",P.target.value),disabled:!s,className:"input input-bordered input-sm flex-1",placeholder:"Header 值"}),s&&o.jsx("button",{type:"button",onClick:()=>on(j),className:"btn btn-ghost btn-sm btn-square text-error",children:o.jsx(Jt,{className:"h-4 w-4"})})]},j)),s&&o.jsxs("button",{type:"button",onClick:rt,className:"btn btn-ghost btn-sm text-primary",children:[o.jsx(rn,{className:"h-4 w-4"}),"添加请求头"]})]})]})]})]})}),o.jsx("div",{className:"card bg-base-200",children:o.jsxs("div",{className:"card-body",children:[o.jsx("h4",{className:"card-title text-base-content",children:"高级选项"}),o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{className:"form-control",children:[o.jsx("label",{className:"label",children:o.jsx("span",{className:"label-text",children:"超时(毫秒)"})}),o.jsx("input",{type:"number",value:i.timeout||"",onChange:v=>R("timeout",v.target.value?parseInt(v.target.value):void 0),disabled:!s,className:"input input-bordered w-full",placeholder:"30000"})]}),o.jsxs("div",{className:"form-control",children:[o.jsx("label",{className:"label",children:o.jsx("span",{className:"label-text",children:"重试次数"})}),o.jsx("input",{type:"number",value:i.retries||"",onChange:v=>R("retries",v.target.value?parseInt(v.target.value):void 0),disabled:!s,className:"input input-bordered w-full",placeholder:"3"})]})]})]})}),s&&o.jsx("div",{className:"flex justify-end pt-4 border-t border-base-300",children:o.jsxs("button",{onClick:_,disabled:g||!c.valid,className:"btn btn-primary btn-sm flex items-center gap-2",children:[o.jsx(Au,{className:"h-4 w-4"}),o.jsx("span",{children:g?"保存中...":"保存"})]})})]})]}),n==="tools"&&o.jsx(oy,{server:e}),n==="logs"&&o.jsx(iy,{serverName:e==null?void 0:e.name})]})]})},Jl=/^[a-zA-Z0-9\-_]+$/,uy=()=>{var gt;const[e,t]=S.useState("json"),[n,r]=S.useState(""),[s,l]=S.useState(""),[i,a]=S.useState({enabled:!0,transport:"stdio",toolsConfig:{mode:"all"}}),[u,f]=S.useState(""),[m,p]=S.useState(!1),[c,x]=S.useState({valid:!0}),{hideAddServer:y,addServer:w,saving:b}=xe(),g=T=>!T||T.trim()===""?{valid:!1,error:"服务器名称不能为空"}:T.length>50?{valid:!1,error:"服务器名称过长(最多 50 个字符)"}:Jl.test(T)?{valid:!0}:{valid:!1,error:"服务器名称只能包含字母、数字、连字符和下划线",suggestions:d(T)},d=T=>{const v=[];let N=T.replace(/[^a-zA-Z0-9\-_]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"");N&&Jl.test(N)&&v.push(N);let j=T.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9\-_]/g,"");return j&&Jl.test(j)&&v.push(j),v.slice(0,3)},h=T=>{l(T),x(g(T))},k=T=>{if(f(""),!T.trim())return f("请输入配置 JSON"),null;try{const v=JSON.parse(T);let N={};if(v.mcpServers)N=v.mcpServers;else if(v.servers)N=v.servers;else if(typeof v=="object"&&!Array.isArray(v))N=v;else return f("配置格式无效。请提供有效的 MCP 服务器配置 JSON"),null;const j=Object.entries(N);return j.length===0?(f("配置中未找到任何服务器"),null):j.map(([P,L])=>({name:P,config:L}))}catch(v){return f(`JSON 解析错误: ${v.message}`),null}},E=(T,v)=>{const N=[],j=g(T);return j.valid||N.push(`服务器名称 "${T}": ${j.error}`),!v.command&&!v.endpoint&&!v.url&&N.push(`服务器 "${T}" 缺少命令或 URL 字段`),v.args&&!Array.isArray(v.args)&&N.push(`服务器 "${T}" 的 args 必须是数组`),v.env&&typeof v.env!="object"&&N.push(`服务器 "${T}" 的 env 必须是对象`),N},_=(T,v)=>{a(N=>({...N,[T]:v}))},R=(T,v,N)=>{var L,M,U;const j=i.env||{},P=Object.entries(j);if(v==="key"){const G=(L=P[T])==null?void 0:L[0],H=((M=P[T])==null?void 0:M[1])||"",he={...j};G&&delete he[G],N.trim()&&A(N)&&(he[N]=H),_("env",he)}else{const G=(U=P[T])==null?void 0:U[0];G&&_("env",{...j,[G]:N})}},A=T=>/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(T),F=()=>{const T=i.env||{};let v="NEW_VAR",N=1;for(;T[v];)v=`NEW_VAR_${N}`,N++;const j={...T,[v]:""};_("env",j)},I=T=>{var P;const v=i.env||{},j=(P=Object.entries(v)[T])==null?void 0:P[0];if(j!==void 0){const L={...v};delete L[j],_("env",L)}},ie=(T,v,N)=>{var L,M,U;const j=i.headers||{},P=Object.entries(j);if(v==="key"){const G=(L=P[T])==null?void 0:L[0],H=((M=P[T])==null?void 0:M[1])||"",he={...j};G&&delete he[G],N.trim()&&(he[N]=H),_("headers",he)}else{const G=(U=P[T])==null?void 0:U[0];G&&_("headers",{...j,[G]:N})}},Je=()=>{const T=i.headers||{};let v="Header-Name",N=1;for(;T[v];)v=`Header-Name-${N}`,N++;const j={...T,[v]:""};_("headers",j)},rt=T=>{var P;const v=i.headers||{},j=(P=Object.entries(v)[T])==null?void 0:P[0];if(j){const L={...v};delete L[j],_("headers",Object.keys(L).length>0?L:void 0)}},on=async T=>{if(T.preventDefault(),e==="json"){const v=k(n);if(!v)return;let N=[];try{const L=await W.get("/api/servers");N=Object.keys(L)}catch(L){console.warn("无法检查服务器名称重复:",L)}const j=[],P=[];for(const{name:L,config:M}of v){const U=E(L,M);j.push(...U),N.includes(L)&&P.push(L)}if(P.length>0){f(`❌ 检测到服务器名称冲突!
|
|
88
|
+
|
|
89
|
+
以下服务器名称已存在:
|
|
90
|
+
${P.map(L=>`• ${L}`).join(`
|
|
91
|
+
`)}
|
|
92
|
+
|
|
93
|
+
请为这些服务器选择其他名称。`);return}if(j.length>0){f(`❌ 发现配置错误:
|
|
94
|
+
|
|
95
|
+
${j.join(`
|
|
96
|
+
`)}`);return}try{for(const{name:L,config:M}of v){let U=M.transport;U||(M.url||M.endpoint?M.type==="sse"||M.transport==="http-sse"?U="http-sse":U="streamable-http":(M.command,U="stdio"));const G=M.enabled!==void 0?M.enabled:!0,H={...M,name:L,enabled:G,transport:U,toolsConfig:{mode:"all"}};console.log("[AddServerModal] Adding server from JSON:",L,H),await w(L,H)}console.log("[AddServerModal] All servers added successfully"),y()}catch(L){console.error("添加服务器失败:",L);const M=L.message;M.includes("already exists")?f(`❌ 服务器名称冲突!
|
|
97
|
+
|
|
98
|
+
已存在同名服务器。请选择其他名称。`):f(`❌ 添加服务器失败:
|
|
99
|
+
|
|
100
|
+
${M}`)}}else{if(!s.trim()){alert("请输入服务器名称");return}if(!c.valid){alert(`服务器名称无效: ${c.error}`);return}try{const N=await W.get("/api/servers");if(Object.keys(N).includes(s.trim())){alert(`❌ 服务器名称 "${s.trim()}" 已存在!
|
|
101
|
+
|
|
102
|
+
请选择其他名称。`);return}}catch(N){console.warn("无法检查服务器名称重复:",N)}const v={name:s,...i};try{console.log("[AddServerModal] 通过表单添加服务器:",s,v),await w(s,v),console.log("[AddServerModal] 服务器添加成功"),y()}catch(N){console.error("添加服务器失败:",N);const j=N.message;j.includes("already exists")?alert(`❌ 服务器名称冲突!
|
|
103
|
+
|
|
104
|
+
已存在名为 "${s}" 的服务器。请选择其他名称。`):alert(`❌ 添加服务器失败:
|
|
105
|
+
|
|
106
|
+
${j}`)}}},Vn=i.transport==="stdio";return o.jsx("div",{className:"modal modal-open",children:o.jsxs("div",{className:"modal-box w-full max-w-4xl h-[90vh] max-h-none bg-base-100",children:[o.jsxs("div",{className:"flex items-center justify-between pb-6 border-b border-base-300",children:[o.jsxs("div",{children:[o.jsx("h2",{className:"text-xl font-bold text-base-content",children:"添加 MCP 服务器"}),o.jsx("p",{className:"text-sm text-base-content/70 mt-1",children:"配置一个新的 MCP 服务器"})]}),o.jsx("button",{onClick:y,className:"btn btn-ghost btn-sm btn-circle",children:o.jsx(ml,{className:"h-6 w-6"})})]}),o.jsxs("div",{className:"py-6 max-h-[600px] overflow-y-auto",children:[o.jsxs("div",{className:"tabs tabs-boxed mb-6",children:[o.jsxs("button",{type:"button",onClick:()=>t("json"),className:`tab flex items-center gap-2 ${e==="json"?"tab-active":""}`,children:[o.jsx(Wv,{className:"h-4 w-4"}),o.jsx("span",{children:"JSON 配置"})]}),o.jsxs("button",{type:"button",onClick:()=>t("form"),className:`tab flex items-center gap-2 ${e==="form"?"tab-active":""}`,children:[o.jsx(Hs,{className:"h-4 w-4"}),o.jsx("span",{children:"表单配置"})]})]}),e==="json"?o.jsx("div",{className:"space-y-4",children:o.jsxs("div",{children:[o.jsx("label",{className:"label",children:o.jsx("span",{className:"label-text font-medium",children:"服务器配置(JSON)"})}),o.jsx("textarea",{value:n,onChange:T=>r(T.target.value),rows:12,className:"textarea textarea-bordered w-full font-mono text-sm",placeholder:`{
|
|
107
|
+
"mcpServers": {
|
|
108
|
+
"memory": {
|
|
109
|
+
"command": "npx",
|
|
110
|
+
"args": ["-y", "@modelcontextprotocol/server-memory"]
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}`}),u&&o.jsx("div",{className:"alert alert-error mt-2",children:o.jsx("div",{className:"text-sm whitespace-pre-wrap",children:u})})]})}):o.jsxs("div",{className:"space-y-6",children:[o.jsx("div",{className:"card bg-base-200",children:o.jsxs("div",{className:"card-body",children:[o.jsx("h4",{className:"card-title text-base",children:"基本信息"}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:"label",children:o.jsx("span",{className:"label-text font-medium",children:"服务器名称 *"})}),o.jsx("input",{type:"text",value:s,onChange:T=>h(T.target.value),className:`input input-bordered w-full ${c.valid?"":"input-error"}`,placeholder:"例如:playwright, filesystem-server"}),!c.valid&&o.jsxs("div",{className:"mt-2 text-error text-sm",children:[c.error,c.suggestions&&c.suggestions.length>0&&o.jsxs("div",{className:"mt-1",children:[o.jsx("span",{className:"text-base-content/70",children:"建议: "}),c.suggestions.map((T,v)=>o.jsx("button",{type:"button",onClick:()=>h(T),className:"btn btn-link btn-xs p-0 mr-2",children:T},v))]})]}),o.jsx("div",{className:"label",children:o.jsx("span",{className:"label-text-alt",children:"仅允许字母、数字、连字符和下划线"})})]}),o.jsxs("div",{children:[o.jsx("label",{className:"label",children:o.jsx("span",{className:"label-text font-medium",children:"传输协议"})}),o.jsxs("select",{value:i.transport,onChange:T=>_("transport",T.target.value),className:"select select-bordered w-full",children:[o.jsx("option",{value:"stdio",children:"Stdio"}),o.jsx("option",{value:"http-sse",children:"HTTP SSE"}),o.jsx("option",{value:"streamable-http",children:"Streamable HTTP"})]})]}),o.jsxs("div",{children:[o.jsx("label",{className:"label",children:o.jsx("span",{className:"label-text font-medium",children:"描述"})}),o.jsx("textarea",{value:i.description||"",onChange:T=>_("description",T.target.value),rows:2,className:"textarea textarea-bordered w-full",placeholder:"可选的服务器描述..."})]})]})]})}),o.jsx("div",{className:"card bg-base-200",children:o.jsxs("div",{className:"card-body",children:[o.jsx("h4",{className:"card-title text-base",children:"连接配置"}),Vn?o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:"label",children:o.jsx("span",{className:"label-text font-medium",children:"命令 *"})}),o.jsx("input",{type:"text",value:i.command||"",onChange:T=>_("command",T.target.value),className:"input input-bordered w-full",placeholder:"例如:npx, node, python"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"label",children:o.jsx("span",{className:"label-text font-medium",children:"参数(每行一个)"})}),o.jsx("textarea",{value:((gt=i.args)==null?void 0:gt.join(`
|
|
114
|
+
`))||"",onChange:T=>_("args",T.target.value.split(`
|
|
115
|
+
`).filter(Boolean)),rows:3,className:"textarea textarea-bordered w-full",placeholder:"例如:\\n@modelcontextprotocol/server-filesystem\\n/path/to/directory"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"label",children:o.jsx("span",{className:"label-text font-medium",children:"环境变量"})}),o.jsxs("div",{className:"space-y-2",children:[Object.entries(i.env||{}).map(([T,v],N)=>o.jsxs("div",{className:"flex gap-2",children:[o.jsx("input",{type:"text",value:T,onChange:j=>R(N,"key",j.target.value),className:"input input-bordered input-sm flex-1",placeholder:"变量名"}),o.jsx("input",{type:"text",value:v,onChange:j=>R(N,"value",j.target.value),className:"input input-bordered input-sm flex-1",placeholder:"值"}),o.jsx("button",{type:"button",onClick:()=>I(N),className:"btn btn-ghost btn-sm btn-square text-error",children:o.jsx(Jt,{className:"h-4 w-4"})})]},N)),o.jsxs("button",{type:"button",onClick:F,className:"btn btn-ghost btn-sm gap-2",children:[o.jsx(rn,{className:"h-4 w-4"}),o.jsx("span",{children:"添加环境变量"})]})]})]})]}):o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:"label",children:o.jsx("span",{className:"label-text font-medium",children:"URL *"})}),o.jsx("input",{type:"url",value:i.url||i.endpoint||"",onChange:T=>_("url",T.target.value),className:"input input-bordered w-full",placeholder:"例如:https://api.example.com/mcp"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"label",children:o.jsx("span",{className:"label-text font-medium",children:"请求头"})}),o.jsxs("div",{className:"space-y-2",children:[Object.entries(i.headers||{}).map(([T,v],N)=>o.jsxs("div",{className:"flex gap-2",children:[o.jsx("input",{type:"text",value:T,onChange:j=>ie(N,"key",j.target.value),className:"input input-bordered input-sm flex-1",placeholder:"Header 名称"}),o.jsx("input",{type:"text",value:v,onChange:j=>ie(N,"value",j.target.value),className:"input input-bordered input-sm flex-1",placeholder:"Header 值"}),o.jsx("button",{type:"button",onClick:()=>rt(N),className:"btn btn-ghost btn-sm btn-square text-error",children:o.jsx(Jt,{className:"h-4 w-4"})})]},N)),o.jsxs("button",{type:"button",onClick:Je,className:"btn btn-ghost btn-sm gap-2",children:[o.jsx(rn,{className:"h-4 w-4"}),o.jsx("span",{children:"添加请求头"})]})]})]})]})]})}),o.jsx("div",{className:"card bg-base-200",children:o.jsxs("div",{className:"card-body",children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsx("h4",{className:"card-title text-base",children:"高级选项"}),o.jsxs("button",{type:"button",onClick:()=>p(!m),className:"btn btn-ghost btn-sm",children:[m?"隐藏":"显示","高级"]})]}),m&&o.jsx("div",{className:"space-y-4",children:o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:"label",children:o.jsx("span",{className:"label-text font-medium",children:"超时(毫秒)"})}),o.jsx("input",{type:"number",value:i.timeout||"",onChange:T=>_("timeout",T.target.value?parseInt(T.target.value):void 0),className:"input input-bordered w-full",placeholder:"30000"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"label",children:o.jsx("span",{className:"label-text font-medium",children:"重试次数"})}),o.jsx("input",{type:"number",value:i.retries||"",onChange:T=>_("retries",T.target.value?parseInt(T.target.value):void 0),className:"input input-bordered w-full",placeholder:"3"})]})]})})]})})]}),o.jsxs("div",{className:"modal-action pt-6 border-t border-base-300",children:[o.jsx("button",{type:"button",onClick:y,className:"btn btn-ghost",children:"取消"}),o.jsx("button",{type:"submit",onClick:on,disabled:b||e==="form"&&!c.valid,className:"btn btn-primary",children:b?"添加中...":"添加服务器"})]})]})]})})},cy=()=>{const[e,t]=S.useState(null),[n,r]=S.useState("stdio"),{hideClientConfig:s,authRequired:l,authToken:i}=xe(),a=l&&i,u=async(x,y)=>{try{await navigator.clipboard.writeText(x),t(y),setTimeout(()=>t(null),2e3)}catch(w){console.error("复制到剪贴板失败:",w)}},f={mcpServers:{agentdog:{command:"npx",args:["agentdog@latest"]}}},m={mcpServers:{"agentdog-http":{type:"streamable-http",url:"http://localhost:4000",...a&&{headers:{Authorization:`Bearer ${i}`}}}}},c={stdio:{title:"STDIO 连接",description:"标准输入输出连接,适用于 Claude Desktop 等 MCP 客户端",config:JSON.stringify(f,null,2)},http:{title:"HTTP Streamable 连接",description:"基于 HTTP 的流式传输连接",config:JSON.stringify(m,null,2)}}[n];return o.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:o.jsxs("div",{className:"bg-base-100 rounded-lg shadow-xl w-full max-w-4xl max-h-[90vh] overflow-hidden",children:[o.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-base-300",children:[o.jsxs("div",{children:[o.jsx("h2",{className:"text-xl font-bold text-base-content",children:"连接 AGENTDOG"}),o.jsx("p",{className:"text-sm text-base-content/70 mt-1",children:"使用以下 JSON 配置将你的 MCP 客户端连接到 AgentDog"})]}),o.jsx("button",{onClick:s,className:"btn btn-ghost btn-sm btn-circle",children:o.jsx(ml,{className:"h-6 w-6"})})]}),o.jsxs("div",{className:"p-6 overflow-y-auto max-h-[80vh]",children:[o.jsxs("div",{className:"tabs tabs-boxed justify-center mb-6",children:[o.jsx("button",{className:`tab ${n==="stdio"?"tab-active":""}`,onClick:()=>r("stdio"),children:"STDIO 连接"}),o.jsx("button",{className:`tab ${n==="http"?"tab-active":""}`,onClick:()=>r("http"),children:"HTTP Streamable"})]}),o.jsx("div",{className:"card bg-base-100 border border-base-300",children:o.jsxs("div",{className:"card-body",children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"card-title text-base-content",children:c.title}),o.jsx("p",{className:"text-sm text-base-content/70 mt-1",children:c.description})]}),o.jsx("button",{onClick:()=>u(c.config,n),className:"btn btn-outline btn-sm",children:e===n?o.jsxs(o.Fragment,{children:[o.jsx(Dv,{className:"h-4 w-4 mr-2"}),"已复制"]}):o.jsxs(o.Fragment,{children:[o.jsx(ra,{className:"h-4 w-4 mr-2"}),"复制"]})})]}),o.jsx("div",{className:"mockup-code",children:o.jsx("pre",{className:"text-sm",children:o.jsx("code",{children:c.config})})})]})})]})]})})},dy=({refreshServerTools:e,onLogout:t})=>{const{servers:n,selectedServer:r,setSelectedServer:s,loading:l,error:i,showAddServer:a,showClientConfig:u,showAddServerModal:f,showClientConfigModal:m,loadConfig:p}=xe();S.useEffect(()=>{p()},[p]);const{systemStatus:c}=nn(),x=(c==null?void 0:c.servers)||[],y=n.map(d=>{const h=x.find(k=>k.name===d.name);return{...d,connected:(h==null?void 0:h.connected)??d.connected,toolCount:(h==null?void 0:h.toolCount)??d.toolCount,enabledToolCount:(h==null?void 0:h.enabledToolCount)??d.enabledToolCount,tools:(h==null?void 0:h.tools)??d.tools}}).sort((d,h)=>d.name.localeCompare(h.name,"en",{sensitivity:"base"}));if(l)return o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsxs("div",{className:"text-center",children:[o.jsx("span",{className:"loading loading-spinner loading-lg text-primary mb-4"}),o.jsx("p",{className:"text-base-content/70",children:"正在加载配置..."})]})});if(i)return o.jsxs("div",{className:"alert alert-error",children:[o.jsx("svg",{className:"stroke-current shrink-0 h-6 w-6",fill:"none",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"})}),o.jsxs("div",{children:[o.jsx("h3",{className:"font-medium",children:"配置加载失败"}),o.jsx("p",{className:"text-sm mt-1",children:i})]})]});const w=y.filter(d=>d==null?void 0:d.connected).length,b=y.filter(d=>d==null?void 0:d.enabled).length,g=y.reduce((d,h)=>!(h!=null&&h.enabled)||!(h!=null&&h.connected)||!(h!=null&&h.tools)?d:d+h.tools.filter(k=>k.enabled).length,0);return o.jsxs("div",{className:"h-full flex flex-col",children:[o.jsx("div",{className:"bg-base-100 border border-base-300 rounded-box shadow-sm px-4 lg:px-6 py-3",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("div",{children:o.jsxs("div",{className:"flex items-center space-x-6 text-sm text-base-content/70",children:[o.jsxs("span",{children:["总计: ",o.jsx("span",{className:"font-semibold text-secondary",children:y.length})," 个服务器"]}),o.jsxs("span",{children:["已启用: ",o.jsx("span",{className:"font-semibold text-accent",children:b})]}),o.jsxs("span",{children:["已连接: ",o.jsx("span",{className:"font-semibold text-info",children:w})]}),o.jsxs("span",{children:["已启用工具: ",o.jsx("span",{className:"font-semibold text-warning",children:g})]})]})}),o.jsxs("div",{className:"flex items-center space-x-3",children:[t&&o.jsxs("button",{onClick:t,className:"btn btn-outline btn-error btn-sm flex items-center space-x-2",children:[o.jsx(Qv,{className:"h-4 w-4"}),o.jsx("span",{children:"退出登录"})]}),o.jsxs("button",{onClick:u,className:"btn btn-outline btn-sm flex items-center space-x-2",children:[o.jsx(ra,{className:"h-4 w-4"}),o.jsx("span",{children:"连接 AGENTDOG"})]}),o.jsxs("button",{onClick:a,className:"btn btn-primary btn-sm flex items-center space-x-2",children:[o.jsx(rn,{className:"h-4 w-4"}),o.jsx("span",{children:"添加服务器"})]})]})]})}),o.jsxs("div",{className:"flex-1 min-h-0 mt-4 flex overflow-hidden bg-base-100 border border-base-300 rounded-box shadow-sm",children:[o.jsxs("div",{className:"w-80 bg-base-100 border-r border-base-300 flex flex-col",children:[o.jsx("div",{className:"p-4 border-b border-base-300",children:o.jsx("h2",{className:"font-medium text-base-content",children:"服务器列表"})}),o.jsx("div",{className:"flex-1 overflow-y-auto",children:y.length===0?o.jsxs("div",{className:"p-6 text-center text-base-content/70",children:[o.jsx(Hs,{className:"h-12 w-12 mx-auto mb-4 text-base-content/40"}),o.jsx("p",{className:"mb-2",children:"还没有配置服务器"}),o.jsx("p",{className:"text-sm mb-4",children:"添加你的第一个 MCP 服务器开始使用"}),o.jsx("button",{onClick:a,className:"btn btn-primary btn-sm",children:"添加服务器"})]}):o.jsx("div",{className:"divide-y divide-base-300",children:y.map(d=>o.jsx(ly,{server:d,selectedServer:r,setSelectedServer:s},d.name))})})]}),o.jsx("div",{className:"flex-1 flex flex-col",children:r&&y.find(d=>d.name===r)?o.jsx(ay,{server:y.find(d=>d.name===r),refreshServerTools:e}):o.jsx("div",{className:"flex-1 flex items-center justify-center bg-base-200",children:o.jsxs("div",{className:"text-center text-base-content/70",children:[o.jsx(Hs,{className:"h-16 w-16 mx-auto mb-4 text-base-content/40"}),o.jsx("h3",{className:"text-lg font-medium mb-2",children:"选择一个服务器"}),o.jsx("p",{className:"text-sm",children:"从左侧列表选择一个服务器来查看和编辑其配置"}),y.length===0&&o.jsx("div",{className:"mt-8",children:o.jsx("button",{onClick:a,className:"btn btn-primary",children:"添加服务器"})})]})})})]}),f&&o.jsx(uy,{}),m&&o.jsx(cy,{})]})},fy=()=>Am(),hy=()=>{const{refreshServerTools:e,onLogout:t}=fy();return o.jsx("div",{className:"h-[calc(100vh-7.5rem)] min-h-[480px] flex flex-col",children:o.jsx(dy,{refreshServerTools:e,onLogout:t})})},Gt=na((e,t)=>({providers:[],gatewayStatus:null,loading:!1,error:null,testingId:null,showProviderModal:!1,editingProvider:null,modelsPanelProviderId:null,loadAll:async()=>{e({loading:!0,error:null});try{const[n,r]=await Promise.all([W.getAIProviders(),W.getGatewayStatus()]);e({providers:n,gatewayStatus:r,loading:!1})}catch(n){e({error:n.message,loading:!1})}},addProvider:async n=>{await W.addAIProvider(n),await t().loadAll()},updateProvider:async(n,r)=>{await W.updateAIProvider(n,r),await t().loadAll()},removeProvider:async n=>{await W.deleteAIProvider(n),await t().loadAll()},toggleProvider:async(n,r)=>{await W.updateAIProvider(n,{enabled:r}),await t().loadAll()},testProvider:async(n,r)=>{e({testingId:n});try{return await W.testAIProvider(n,r)}finally{e({testingId:null})}},fetchModels:async(n,r)=>(await W.fetchProviderModels(n,r)).models,updateGateway:async n=>{await W.updateGatewaySettings(n),await t().loadAll()},setShowProviderModal:(n,r=null)=>{e({showProviderModal:n,editingProvider:r})},setModelsPanelProvider:n=>{e({modelsPanelProviderId:n})}})),py=()=>{const{gatewayStatus:e,updateGateway:t}=Gt(),[n,r]=S.useState(!1);if(!e)return null;const s=`http://${e.host}:${e.port}`,l=async()=>{await t({enabled:!e.enabled})},i=async()=>{if(window.confirm("重置后旧 apiKey 立即失效,已接入的客户端需要更新配置。继续?")){r(!0);try{await t({resetApiKey:!0})}finally{r(!1)}}},a=async()=>{await navigator.clipboard.writeText(e.apiKey)};return o.jsx("div",{className:"card bg-base-100 border border-base-300 shadow-sm",children:o.jsxs("div",{className:"card-body p-4 flex flex-wrap items-center gap-x-6 gap-y-3 justify-between",children:[o.jsxs("div",{className:"min-w-0",title:"Anthropic Messages 兼容端点,统一接入任意上游供应商",children:[o.jsx("h2",{className:"card-title text-base",children:"AI API 网关"}),o.jsx("p",{className:"text-xs text-base-content/50 mt-0.5",children:"Anthropic Messages 兼容端点,模型按 slug:modelId 寻址"})]}),e.enabled&&o.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[o.jsxs("div",{className:"form-control",children:[o.jsx("label",{className:"label py-1",children:o.jsx("span",{className:"label-text text-xs",children:"监听地址"})}),o.jsx("input",{className:"input input-bordered input-sm font-mono w-52",value:s,readOnly:!0})]}),o.jsxs("div",{className:"form-control",children:[o.jsx("label",{className:"label py-1",children:o.jsx("span",{className:"label-text text-xs",children:"对外 API Key"})}),o.jsxs("div",{className:"join",children:[o.jsx("input",{className:"input input-bordered input-sm join-item w-52 font-mono",value:e.apiKey,readOnly:!0}),o.jsx("button",{className:"btn btn-ghost btn-sm join-item",onClick:a,title:"复制 apiKey",children:o.jsx(ra,{className:"w-4 h-4"})}),o.jsx("button",{className:"btn btn-ghost btn-sm join-item text-warning",onClick:i,disabled:n,title:"重置 apiKey",children:n?o.jsx("span",{className:"loading loading-spinner loading-xs"}):o.jsx(Ws,{className:"w-4 h-4"})})]})]})]}),o.jsxs("div",{className:"flex items-center gap-3",children:[e.enabled&&o.jsx("span",{className:`badge ${e.running?"badge-success":"badge-warning"} badge-sm`,children:e.running?"运行中":"已启用(未运行)"}),o.jsx("input",{type:"checkbox",className:"toggle toggle-primary",checked:e.enabled,onChange:l})]})]})})},my=/^[a-z0-9][a-z0-9-]*$/,gy=()=>{const{showProviderModal:e,editingProvider:t,providers:n,setShowProviderModal:r,addProvider:s,updateProvider:l}=Gt(),i=!!t,[a,u]=S.useState(()=>({slug:(t==null?void 0:t.slug)||"",name:(t==null?void 0:t.name)||"",dialect:(t==null?void 0:t.dialect)||"openai",baseUrl:(t==null?void 0:t.baseUrl)||"",apiKey:"",enabled:(t==null?void 0:t.enabled)??!0,headersText:t!=null&&t.headers?JSON.stringify(t.headers,null,2):""})),[f,m]=S.useState(!1),[p,c]=S.useState(null);if(!e)return null;const x=n.some(d=>d.slug===a.slug&&d.id!==(t==null?void 0:t.id)),y=a.slug!==""&&!my.test(a.slug),w=a.headersText.trim()!==""&&(()=>{try{const d=JSON.parse(a.headersText);return typeof d!="object"||d===null||Array.isArray(d)}catch{return!0}})(),b=a.slug&&!y&&!x&&a.baseUrl&&a.dialect&&(!i||a.apiKey!==void 0)&&(i||a.apiKey!=="")&&!w,g=async d=>{d.preventDefault(),m(!0),c(null);try{const h=a.headersText.trim()?JSON.parse(a.headersText):void 0;i&&t?await l(t.id,{slug:a.slug,name:a.name||void 0,dialect:a.dialect,baseUrl:a.baseUrl,...a.apiKey?{apiKey:a.apiKey}:{},enabled:a.enabled,...h!==void 0?{headers:h}:{}}):await s({slug:a.slug,name:a.name||void 0,dialect:a.dialect,baseUrl:a.baseUrl,apiKey:a.apiKey,enabled:a.enabled,...h!==void 0?{headers:h}:{}}),r(!1)}catch(h){c(h.message)}finally{m(!1)}};return o.jsxs("div",{className:"modal modal-open",children:[o.jsxs("div",{className:"modal-box max-w-lg",children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsx("h3",{className:"font-bold text-lg",children:i?"编辑供应商":"新增供应商"}),o.jsx("button",{className:"btn btn-ghost btn-sm btn-square",onClick:()=>r(!1),children:o.jsx(ml,{className:"w-4 h-4"})})]}),o.jsxs("form",{onSubmit:g,children:[o.jsxs("div",{className:"grid gap-3",children:[o.jsxs("div",{className:"form-control",children:[o.jsx("label",{className:"label py-1",children:o.jsx("span",{className:"label-text",children:"slug(寻址名,不可与其他重复)"})}),o.jsx("input",{className:`input input-bordered input-sm font-mono ${y||x?"input-error":a.slug?"input-success":""}`,value:a.slug,onChange:d=>u({...a,slug:d.target.value}),placeholder:"deepseek",disabled:!1}),o.jsx("label",{className:"label py-1",children:o.jsx("span",{className:"label-text-alt text-error",children:y?"格式:小写字母/数字开头,仅 a-z 0-9 -":x?"该 slug 已被占用":"模型寻址格式:slug:modelId"})})]}),o.jsxs("div",{className:"form-control",children:[o.jsx("label",{className:"label py-1",children:o.jsx("span",{className:"label-text",children:"显示名(可选)"})}),o.jsx("input",{className:"input input-bordered input-sm",value:a.name,onChange:d=>u({...a,name:d.target.value}),placeholder:"深度求索"})]}),o.jsxs("div",{className:"form-control",children:[o.jsx("label",{className:"label py-1",children:o.jsx("span",{className:"label-text",children:"上游方言"})}),o.jsxs("select",{className:"select select-bordered select-sm",value:a.dialect,onChange:d=>u({...a,dialect:d.target.value}),children:[o.jsx("option",{value:"openai",children:"openai 兼容"}),o.jsx("option",{value:"anthropic",children:"anthropic(直通)"}),o.jsx("option",{value:"gemini",children:"gemini"})]})]}),o.jsxs("div",{className:"form-control",children:[o.jsx("label",{className:"label py-1",children:o.jsx("span",{className:"label-text",children:"Base URL"})}),o.jsx("input",{className:"input input-bordered input-sm font-mono",value:a.baseUrl,onChange:d=>u({...a,baseUrl:d.target.value}),placeholder:"https://api.deepseek.com"})]}),o.jsxs("div",{className:"form-control",children:[o.jsx("label",{className:"label py-1",children:o.jsxs("span",{className:"label-text",children:["API Key ",i&&"(留空 = 不修改)"]})}),o.jsx("input",{type:"password",className:"input input-bordered input-sm font-mono",value:a.apiKey,onChange:d=>u({...a,apiKey:d.target.value}),placeholder:i?"不修改则留空":"sk-..."})]}),o.jsxs("div",{className:"form-control",children:[o.jsx("label",{className:"label py-1",children:o.jsx("span",{className:"label-text",children:"自定义请求头(可选,JSON)"})}),o.jsx("textarea",{className:`textarea textarea-bordered textarea-sm font-mono ${w?"textarea-error":""}`,rows:3,value:a.headersText,onChange:d=>u({...a,headersText:d.target.value}),placeholder:`{
|
|
116
|
+
"x-custom": "value"
|
|
117
|
+
}`})]}),o.jsxs("label",{className:"label cursor-pointer justify-start gap-3 py-1",children:[o.jsx("input",{type:"checkbox",className:"toggle toggle-sm toggle-primary",checked:a.enabled,onChange:d=>u({...a,enabled:d.target.checked})}),o.jsx("span",{className:"label-text",children:"启用"})]})]}),p&&o.jsx("div",{className:"alert alert-error mt-3 py-2 text-sm",children:p}),o.jsxs("div",{className:"modal-action",children:[o.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:()=>r(!1),children:"取消"}),o.jsx("button",{type:"submit",className:"btn btn-primary btn-sm",disabled:!b||f,children:f?o.jsx("span",{className:"loading loading-spinner loading-xs"}):i?"保存":"创建"})]})]})]}),o.jsx("div",{className:"modal-backdrop",onClick:()=>r(!1)})]})},vy=()=>{var d;const{providers:e,modelsPanelProviderId:t,setModelsPanelProvider:n,fetchModels:r,updateProvider:s}=Gt(),[l,i]=S.useState(null),[a,u]=S.useState(!1),[f,m]=S.useState(null),[p,c]=S.useState(""),x=e.find(h=>h.id===t);if(S.useEffect(()=>{i(null),m(null)},[t]),!t||!x)return null;const y=async()=>{u(!0),m(null);try{i(await r(x.id))}catch(h){m(h.message)}finally{u(!1)}},w=async h=>{await s(x.id,{models:h})},b=async()=>{var k;const h=p.trim();!h||(k=x.models)!=null&&k.includes(h)||(await w([...x.models||[],h]),c(""))},g=async h=>{await w((x.models||[]).filter(k=>k!==h))};return o.jsxs("div",{className:"modal modal-open",children:[o.jsxs("div",{className:"modal-box max-w-xl",children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"font-bold text-lg",children:"模型管理"}),o.jsxs("p",{className:"text-sm text-base-content/60",children:[x.name||x.slug,"(",x.slug,")"]})]}),o.jsx("button",{className:"btn btn-ghost btn-sm btn-square",onClick:()=>n(null),children:o.jsx(ml,{className:"w-4 h-4"})})]}),o.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[o.jsxs("button",{className:"btn btn-outline btn-sm",onClick:y,disabled:a,children:[a?o.jsx("span",{className:"loading loading-spinner loading-xs"}):o.jsx(Uv,{className:"w-4 h-4"}),"拉取上游模型"]}),l&&l.length>0&&o.jsxs("button",{className:"btn btn-primary btn-sm",onClick:()=>w(l),children:["写回(",l.length," 个)"]})]}),f&&o.jsx("div",{className:"alert alert-error py-2 text-sm mb-3",children:f}),l&&o.jsxs("div",{className:"mb-4",children:[o.jsxs("div",{className:"text-sm font-medium mb-1",children:["上游列表(",l.length,")"]}),o.jsx("div",{className:"max-h-32 overflow-y-auto rounded border border-base-300/50 bg-base-200/40 p-2 text-xs font-mono",children:l.map(h=>o.jsx("div",{className:"py-0.5",children:h},h))})]}),o.jsxs("div",{className:"text-sm font-medium mb-1",children:["已声明模型(",((d=x.models)==null?void 0:d.length)||0,")"]}),o.jsxs("div",{className:"flex gap-2 mb-3",children:[o.jsx("input",{className:"input input-bordered input-sm flex-1 font-mono",value:p,onChange:h=>c(h.target.value),onKeyDown:h=>h.key==="Enter"&&b(),placeholder:"手工添加模型 Id"}),o.jsx("button",{className:"btn btn-sm btn-primary",onClick:b,disabled:!p.trim(),children:o.jsx(rn,{className:"w-4 h-4"})})]}),o.jsxs("div",{className:"max-h-40 overflow-y-auto",children:[(x.models||[]).length===0&&o.jsx("p",{className:"text-sm text-base-content/50",children:"暂无。拉取失败时手工声明可作兜底。"}),(x.models||[]).map(h=>o.jsxs("div",{className:"flex items-center justify-between rounded px-2 py-1 hover:bg-base-200/60",children:[o.jsx("span",{className:"text-sm font-mono",children:h}),o.jsx("button",{className:"btn btn-ghost btn-xs text-error",onClick:()=>g(h),children:o.jsx(Jt,{className:"w-3.5 h-3.5"})})]},h))]})]}),o.jsx("div",{className:"modal-backdrop",onClick:()=>n(null)})]})},yy={openai:"badge-info",anthropic:"badge-secondary",gemini:"badge-success"},xy=()=>{const{providers:e,loading:t,error:n,testingId:r,loadAll:s,toggleProvider:l,removeProvider:i,testProvider:a,setShowProviderModal:u,setModelsPanelProvider:f}=Gt(),[m,p]=S.useState({});if(S.useEffect(()=>{s()},[s]),t&&e.length===0)return o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx("span",{className:"loading loading-spinner loading-lg text-primary"})});if(n&&e.length===0)return o.jsxs("div",{className:"alert alert-error",children:["加载失败:",n]});const c=async y=>{try{const w=await a(y.id);p(b=>({...b,[y.id]:{ok:w.ok,message:w.ok?`连通(${w.modelCount} 个模型)`:w.message}}))}catch(w){p(b=>({...b,[y.id]:{ok:!1,message:w.message}}))}},x=async y=>{window.confirm(`确认删除供应商 ${y.name||y.slug}?`)&&await i(y.id)};return o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[o.jsx("h1",{className:"text-xl font-bold",children:"AI 供应商"}),o.jsx("span",{className:"badge badge-ghost badge-sm",children:e.length}),o.jsx("span",{className:"hidden sm:block text-xs text-base-content/50",children:"Claude Code 等客户端经网关以 slug:modelId 寻址访问任意上游"}),o.jsxs("button",{className:"btn btn-primary btn-sm ml-auto",onClick:()=>u(!0),children:[o.jsx(rn,{className:"w-4 h-4"})," 新增供应商"]})]}),o.jsx(py,{}),e.length===0&&o.jsx("div",{className:"alert",children:o.jsxs("span",{className:"text-sm",children:["暂无供应商。新增后客户端通过 ",o.jsx("code",{className:"font-mono",children:"slug:modelId"})," 寻址访问任意上游。"]})}),o.jsx("div",{className:"grid gap-3 md:grid-cols-2",children:e.map(y=>{var b;const w=m[y.id];return o.jsx("div",{className:`card bg-base-100 shadow-sm border ${y.enabled?"border-base-300":"border-base-300/60 opacity-70"}`,children:o.jsxs("div",{className:"card-body p-4",children:[o.jsxs("div",{className:"flex items-start justify-between gap-2",children:[o.jsxs("div",{className:"min-w-0",children:[o.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[o.jsx("span",{className:"font-mono font-medium",children:y.slug}),y.name&&o.jsx("span",{className:"text-sm text-base-content/60",children:y.name}),o.jsx("span",{className:`badge ${yy[y.dialect]||"badge-ghost"} badge-sm`,children:y.dialect}),!y.enabled&&o.jsx("span",{className:"badge badge-ghost badge-sm",children:"已禁用"})]}),o.jsx("div",{className:"text-xs font-mono text-base-content/50 mt-1 truncate",title:y.baseUrl,children:y.baseUrl}),o.jsxs("div",{className:"text-xs text-base-content/50 mt-0.5",children:["模型 ",((b=y.models)==null?void 0:b.length)||0," · key ",y.apiKey]})]}),o.jsx("input",{type:"checkbox",className:"toggle toggle-primary toggle-sm",checked:y.enabled,onChange:g=>l(y.id,g.target.checked)})]}),w&&o.jsxs("div",{className:`text-xs mt-1 ${w.ok?"text-success":"text-error"} truncate`,title:w.message,children:[w.ok?"✓ ":"✕ ",w.message]}),o.jsxs("div",{className:"card-actions justify-end mt-2",children:[o.jsxs("button",{className:"btn btn-ghost btn-xs",onClick:()=>f(y.id),title:"模型管理",children:[o.jsx(Kv,{className:"w-3.5 h-3.5"})," 模型"]}),o.jsxs("button",{className:"btn btn-ghost btn-xs",onClick:()=>c(y),disabled:r===y.id,title:"连通性测试",children:[r===y.id?o.jsx("span",{className:"loading loading-spinner loading-xs"}):o.jsx(Yv,{className:"w-3.5 h-3.5"})," 测试"]}),o.jsx("button",{className:"btn btn-ghost btn-xs",onClick:()=>u(!0,y),title:"编辑",children:o.jsx(Gv,{className:"w-3.5 h-3.5"})}),o.jsx("button",{className:"btn btn-ghost btn-xs text-error",onClick:()=>x(y),title:"删除",children:o.jsx(Jt,{className:"w-3.5 h-3.5"})})]})]})},y.id)})}),o.jsx(gy,{}),o.jsx(vy,{})]})},wy=()=>o.jsx("div",{children:o.jsx(xy,{})}),Sy=()=>{var b,g;const e=Gi(),{systemStatus:t,events:n}=nn(),r=xe(d=>d.servers),s=Gt(d=>d.providers),l=Gt(d=>d.gatewayStatus),[i,a]=S.useState({});S.useEffect(()=>{xe.getState().servers.length===0&&xe.getState().loadConfig().catch(()=>{}),W.get("/api/system/info").then(d=>a(d||{})).catch(()=>{}),Gt.getState().loadAll().catch(()=>{})},[]);const u=r.filter(d=>d.enabled),f=u.filter(d=>d.connected).length,m=(t==null?void 0:t.totalTools)??r.reduce((d,h)=>d+(h.toolCount||0),0),p=s.filter(d=>d.enabled).length,c=(b=t==null?void 0:t.daemon)==null?void 0:b.uptime,x=i.webPort??(typeof window<"u"&&Number(window.location.port)||void 0),y=c==null?"—":c<60?`${Math.floor(c)}秒`:c<3600?`${Math.floor(c/60)}分`:`${Math.floor(c/86400)}天 ${Math.floor(c%86400/3600)}时 ${Math.floor(c%3600/60)}分`,w=n.slice(0,8);return o.jsxs("div",{className:"flex flex-col gap-4 lg:gap-6",children:[o.jsxs("div",{className:"flex items-baseline gap-3",children:[o.jsx("h1",{className:"text-xl font-bold",children:"Dashboard"}),o.jsx("span",{className:"text-xs text-base-content/50",children:"系统概览与运行状态"})]}),o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-4 gap-4",children:[o.jsx("div",{className:"stats bg-base-100 border border-base-300 shadow-sm cursor-pointer",onClick:()=>e("/mcp"),children:o.jsxs("div",{className:"stat p-4",children:[o.jsxs("div",{className:"stat-title text-xs flex items-center gap-1.5",children:[o.jsx(Ef,{className:"w-3.5 h-3.5"})," MCP 服务器"]}),o.jsxs("div",{className:"stat-value text-2xl",children:[f,o.jsxs("span",{className:"text-base font-normal text-base-content/40",children:[" / ",r.length]})]}),o.jsxs("div",{className:"stat-desc",children:[u.length," 个启用"]})]})}),o.jsx("div",{className:"stats bg-base-100 border border-base-300 shadow-sm cursor-pointer",onClick:()=>e("/mcp"),children:o.jsxs("div",{className:"stat p-4",children:[o.jsxs("div",{className:"stat-title text-xs flex items-center gap-1.5",children:[o.jsx(ty,{className:"w-3.5 h-3.5"})," 聚合工具"]}),o.jsx("div",{className:"stat-value text-2xl",children:m}),o.jsxs("div",{className:"stat-desc",children:["启用 ",(t==null?void 0:t.enabledTools)??r.reduce((d,h)=>d+(h.enabledToolCount||0),0)," 个"]})]})}),o.jsx("div",{className:"stats bg-base-100 border border-base-300 shadow-sm cursor-pointer",onClick:()=>e("/providers"),children:o.jsxs("div",{className:"stat p-4",children:[o.jsxs("div",{className:"stat-title text-xs flex items-center gap-1.5",children:[o.jsx(_f,{className:"w-3.5 h-3.5"})," AI 供应商"]}),o.jsxs("div",{className:"stat-value text-2xl",children:[p,o.jsxs("span",{className:"text-base font-normal text-base-content/40",children:[" / ",s.length]})]}),o.jsx("div",{className:"stat-desc",children:l!=null&&l.running?`网关运行中 · ${l.port}`:l!=null&&l.enabled?"网关启动中":"网关未启用"})]})}),o.jsx("div",{className:"stats bg-base-100 border border-base-300 shadow-sm",children:o.jsxs("div",{className:"stat p-4",children:[o.jsxs("div",{className:"stat-title text-xs flex items-center gap-1.5",children:[o.jsx(ey,{className:"w-3.5 h-3.5"})," 运行时长"]}),o.jsx("div",{className:"stat-value text-2xl",children:y}),o.jsx("div",{className:"stat-desc",children:t?((g=t.daemon)==null?void 0:g.isRunning)===!1?"daemon 未运行":"状态实时推送中":"等待状态推送…"})]})})]}),o.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-4 lg:gap-6",children:[o.jsx("div",{className:"card bg-base-100 border border-base-300 shadow-sm",children:o.jsxs("div",{className:"card-body p-5 gap-0",children:[o.jsx("h2",{className:"card-title text-sm mb-2",children:"系统信息"}),[["版本",i.version??"—"],["运行模式",i.mode??"daemon"],["Web 端口",x?`${x} (localhost)`:"—"],["配置路径",i.configPath??"—"]].map(([d,h])=>o.jsxs("div",{className:"flex justify-between py-1.5 text-sm border-b border-dashed border-base-300 last:border-0",children:[o.jsx("span",{className:"text-base-content/60",children:d}),o.jsx("span",{className:"font-medium font-mono text-xs truncate max-w-[60%]",title:h,children:h})]},d))]})}),o.jsx("div",{className:"card bg-base-100 border border-base-300 shadow-sm",children:o.jsxs("div",{className:"card-body p-5",children:[o.jsxs("h2",{className:"card-title text-sm justify-between",children:["服务器状态",o.jsxs("button",{className:"btn btn-ghost btn-xs",onClick:()=>e("/mcp"),children:["管理 ",o.jsx(Lu,{className:"w-3 h-3"})]})]}),r.length===0?o.jsxs("div",{className:"text-sm text-base-content/40 min-h-[120px] flex items-center justify-center text-center",children:["暂无服务器,",o.jsx("span",{className:"text-primary cursor-pointer",onClick:()=>e("/mcp"),children:"去添加"})]}):o.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:r.map(d=>o.jsxs("div",{className:"flex items-center gap-2 p-2.5 rounded-field border border-base-300 hover:border-primary hover:bg-primary/5 transition-colors cursor-pointer",onClick:()=>e("/mcp"),children:[o.jsx("span",{className:`w-2 h-2 rounded-full shrink-0 ${d.enabled?d.connected?"bg-success":"bg-warning":"bg-base-content/20"}`}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("div",{className:"text-xs font-semibold truncate",children:d.name}),o.jsxs("div",{className:"text-[11px] text-base-content/40",children:[d.transport," · ",d.enabled?`${d.toolCount} 工具`:"已停用"]})]})]},d.name))})]})})]}),o.jsx("div",{className:"card bg-base-100 border border-base-300 shadow-sm",children:o.jsxs("div",{className:"card-body p-5",children:[o.jsxs("h2",{className:"card-title text-sm justify-between",children:["实时事件",o.jsxs("button",{className:"btn btn-ghost btn-xs",onClick:()=>e("/logs"),children:["查看全部 ",o.jsx(Lu,{className:"w-3 h-3"})]})]}),w.length===0?o.jsx("div",{className:"text-sm text-base-content/40 py-4 text-center",children:"暂无事件,等待实时推送…"}):o.jsx("div",{className:"log-terminal max-h-56 overflow-y-auto scrollbar-thin",children:w.map((d,h)=>{var k,E;return o.jsxs("div",{className:"flex gap-3",children:[o.jsx("span",{className:"log-time shrink-0",children:new Date(d.timestamp).toLocaleTimeString("zh-CN")}),o.jsxs("span",{className:d.type==="server-error"||d.type==="error"?"log-err":d.type==="server-connected"||d.type==="tool-called"?"log-ok":"log-info",children:["[",d.type,"]"]}),o.jsx("span",{className:"truncate",children:((k=d.data)==null?void 0:k.serverName)||((E=d.data)==null?void 0:E.toolName)||JSON.stringify(d.data).slice(0,80)})]},`${d.timestamp}-${h}`)})})]})})]})},Ny=()=>{const{events:e,serverLogs:t}=nn(),n=xe(p=>p.servers),[r,s]=S.useState("all"),[l,i]=S.useState(!1),[a,u]=S.useState(!0),f=S.useRef(null),m=S.useMemo(()=>{const p=e.map(y=>{var w,b,g;return{time:new Date(y.timestamp).toLocaleTimeString("zh-CN"),level:y.type==="server-error"||y.type==="error"?"err":y.type==="server-disconnected"?"warn":"info",tag:y.type,message:(w=y.data)!=null&&w.serverName?`${y.data.serverName}${(b=y.data)!=null&&b.toolName?` · ${y.data.toolName}`:""}`:JSON.stringify(y.data).slice(0,120),server:((g=y.data)==null?void 0:g.serverName)||"system"}}),c=Object.entries(t).flatMap(([y,w])=>w.map(b=>({time:new Date(b.timestamp).toLocaleTimeString("zh-CN"),level:b.stream==="stderr"?"err":"info",tag:b.stream,message:b.data.replace(/\n$/,""),server:y}))),x=[...p,...c];return r!=="all"?x.filter(y=>y.server===r):x},[e,t,r]);return S.useEffect(()=>{a&&!l&&f.current&&(f.current.scrollTop=0)},[m,a,l]),o.jsxs("div",{className:"flex flex-col gap-4 lg:gap-6",children:[o.jsxs("div",{className:"flex items-baseline gap-3 flex-wrap",children:[o.jsx("h1",{className:"text-xl font-bold",children:"全局日志"}),o.jsx("span",{className:"text-xs text-base-content/50",children:"实时事件与服务器输出(最近 100 条)"})]}),o.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[o.jsxs("select",{className:"select select-bordered select-sm w-48",value:r,onChange:p=>s(p.target.value),children:[o.jsx("option",{value:"all",children:"全部来源"}),n.map(p=>o.jsx("option",{value:p.name,children:p.name},p.name))]}),o.jsx("button",{className:`btn btn-sm ${l?"btn-primary":"btn-outline"}`,onClick:()=>i(p=>!p),children:l?"继续刷新":"暂停刷新"}),o.jsxs("label",{className:"label cursor-pointer gap-2 text-sm text-base-content/60 py-0",children:[o.jsx("input",{type:"checkbox",className:"toggle toggle-sm toggle-primary",checked:a,onChange:p=>u(p.target.checked)}),"自动滚动"]})]}),o.jsx("div",{ref:f,className:"log-terminal min-h-[400px] max-h-[calc(100vh-16rem)] overflow-y-auto scrollbar-thin",children:m.length===0?o.jsx("div",{className:"text-center py-8 opacity-40",children:"暂无日志,等待实时推送…"}):m.map((p,c)=>o.jsxs("div",{className:"flex gap-3 whitespace-nowrap",children:[o.jsx("span",{className:"log-time shrink-0",children:p.time}),o.jsxs("span",{className:`shrink-0 ${p.level==="err"?"log-err":p.level==="warn"?"log-warn":p.level==="ok"?"log-ok":"log-info"}`,children:["[",p.tag,"]"]}),o.jsx("span",{className:"truncate",title:p.message,children:p.message})]},c))},l?"paused":"live")]})};function ky(){const{setAuthState:e}=xe(),[t,n]=S.useState({loading:!0,authenticated:!1,required:!1}),{refreshServerTools:r}=Ov(window.location.origin);S.useEffect(()=>{s()},[]);const s=async()=>{try{const u=await W.checkAuthStatus();n({loading:!1,authenticated:u.authenticated,required:u.required}),e(u.required,u.authenticated?localStorage.getItem("agentdog_token"):null)}catch(u){console.error("认证状态检查失败:",u),n({loading:!1,authenticated:!1,required:!1}),e(!1,null)}},l=async u=>{try{await W.login(u),n(f=>({...f,authenticated:!0})),e(!0,u)}catch(f){throw f}},i=()=>{W.logout(),n(u=>({...u,authenticated:!1})),e(!0,null)};if(t.loading)return o.jsx(Kl,{children:o.jsx("div",{className:"min-h-screen bg-base-200 flex items-center justify-center",children:o.jsxs("div",{className:"text-center",children:[o.jsx("span",{className:"loading loading-spinner loading-lg text-primary"}),o.jsx("p",{className:"mt-2 text-base-content",children:"加载中..."})]})})});if(t.required&&!t.authenticated)return o.jsx(Kl,{children:o.jsx(jy,{onLogin:l})});const a={refreshServerTools:r,onLogout:t.required?i:void 0};return o.jsx(Kl,{children:o.jsx(og,{children:o.jsx(Xm,{children:o.jsxs(yt,{element:o.jsx(sy,{outletContext:a}),children:[o.jsx(yt,{index:!0,element:o.jsx(wu,{to:"/dashboard",replace:!0})}),o.jsx(yt,{path:"dashboard",element:o.jsx(Sy,{})}),o.jsx(yt,{path:"mcp",element:o.jsx(hy,{})}),o.jsx(yt,{path:"providers",element:o.jsx(wy,{})}),o.jsx(yt,{path:"logs",element:o.jsx(Ny,{})}),o.jsx(yt,{path:"*",element:o.jsx(wu,{to:"/dashboard",replace:!0})})]})})})})}function jy({onLogin:e}){const[t,n]=S.useState(""),[r,s]=S.useState(!1),[l,i]=S.useState(""),a=async u=>{if(u.preventDefault(),!t.trim()){i("请输入访问令牌");return}s(!0),i("");try{await e(t.trim())}catch(f){i(f.message||"登录失败")}finally{s(!1)}};return o.jsx("div",{className:"min-h-screen bg-base-200 flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8",children:o.jsx("div",{className:"max-w-md w-full",children:o.jsxs("div",{className:"card bg-base-100 border border-base-300 shadow-sm rounded-2xl p-8",children:[o.jsxs("div",{className:"text-center mb-8",children:[o.jsx("div",{className:"w-12 h-12 mx-auto rounded-2xl bg-gradient-to-br from-primary to-accent flex items-center justify-center text-primary-content text-2xl shadow-md",children:"🐶"}),o.jsx("h2",{className:"mt-4 text-2xl font-bold text-base-content",children:"AgentDog 身份验证"}),o.jsx("p",{className:"mt-2 text-sm text-base-content/60",children:"请输入你的身份验证令牌以继续"})]}),o.jsxs("form",{className:"space-y-5",onSubmit:a,children:[o.jsxs("div",{children:[o.jsx("label",{htmlFor:"token",className:"sr-only",children:"身份验证令牌"}),o.jsx("input",{id:"token",name:"token",type:"password",required:!0,className:"input input-bordered w-full",placeholder:"请输入身份验证令牌",value:t,onChange:u=>n(u.target.value),disabled:r})]}),l&&o.jsx("div",{className:"alert alert-error",children:l}),o.jsx("div",{children:o.jsx("button",{type:"submit",disabled:r,className:"btn btn-primary w-full",children:r?o.jsxs("div",{className:"flex items-center",children:[o.jsx("span",{className:"loading loading-spinner loading-sm mr-2"}),"登录中..."]}):"登录"})})]})]})})})}Gl.createRoot(document.getElementById("root")).render(o.jsx(Ks.StrictMode,{children:o.jsx(ky,{})}));
|
|
118
|
+
//# sourceMappingURL=index-BdEVyQ8g.js.map
|