cicy-desktop 2.1.367 → 2.1.369

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,490 @@
1
+ (function(){const f=document.createElement("link").relList;if(f&&f.supports&&f.supports("modulepreload"))return;for(const x of document.querySelectorAll('link[rel="modulepreload"]'))d(x);new MutationObserver(x=>{for(const _ of x)if(_.type==="childList")for(const b of _.addedNodes)b.tagName==="LINK"&&b.rel==="modulepreload"&&d(b)}).observe(document,{childList:!0,subtree:!0});function y(x){const _={};return x.integrity&&(_.integrity=x.integrity),x.referrerPolicy&&(_.referrerPolicy=x.referrerPolicy),x.crossOrigin==="use-credentials"?_.credentials="include":x.crossOrigin==="anonymous"?_.credentials="omit":_.credentials="same-origin",_}function d(x){if(x.ep)return;x.ep=!0;const _=y(x);fetch(x.href,_)}})();var oo={exports:{}},Ti={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Cm;function vy(){if(Cm)return Ti;Cm=1;var s=Symbol.for("react.transitional.element"),f=Symbol.for("react.fragment");function y(d,x,_){var b=null;if(_!==void 0&&(b=""+_),x.key!==void 0&&(b=""+x.key),"key"in x){_={};for(var U in x)U!=="key"&&(_[U]=x[U])}else _=x;return x=_.ref,{$$typeof:s,type:d,key:b,ref:x!==void 0?x:null,props:_}}return Ti.Fragment=f,Ti.jsx=y,Ti.jsxs=y,Ti}var Em;function Sy(){return Em||(Em=1,oo.exports=vy()),oo.exports}var c=Sy(),ro={exports:{}},ji={},fo={exports:{}},mo={};/**
10
+ * @license React
11
+ * scheduler.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var zm;function xy(){return zm||(zm=1,(function(s){function f(D,I){var Q=D.length;D.push(I);e:for(;0<Q;){var re=Q-1>>>1,ue=D[re];if(0<x(ue,I))D[re]=I,D[Q]=ue,Q=re;else break e}}function y(D){return D.length===0?null:D[0]}function d(D){if(D.length===0)return null;var I=D[0],Q=D.pop();if(Q!==I){D[0]=Q;e:for(var re=0,ue=D.length,m=ue>>>1;re<m;){var S=2*(re+1)-1,Z=D[S],F=S+1,le=D[F];if(0>x(Z,Q))F<ue&&0>x(le,Z)?(D[re]=le,D[F]=Q,re=F):(D[re]=Z,D[S]=Q,re=S);else if(F<ue&&0>x(le,Q))D[re]=le,D[F]=Q,re=F;else break e}}return I}function x(D,I){var Q=D.sortIndex-I.sortIndex;return Q!==0?Q:D.id-I.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var _=performance;s.unstable_now=function(){return _.now()}}else{var b=Date,U=b.now();s.unstable_now=function(){return b.now()-U}}var j=[],h=[],A=1,T=null,V=3,M=!1,J=!1,B=!1,K=!1,ee=typeof setTimeout=="function"?setTimeout:null,_e=typeof clearTimeout=="function"?clearTimeout:null,me=typeof setImmediate<"u"?setImmediate:null;function ce(D){for(var I=y(h);I!==null;){if(I.callback===null)d(h);else if(I.startTime<=D)d(h),I.sortIndex=I.expirationTime,f(j,I);else break;I=y(h)}}function oe(D){if(B=!1,ce(D),!J)if(y(j)!==null)J=!0,ye||(ye=!0,Te());else{var I=y(h);I!==null&&Ue(oe,I.startTime-D)}}var ye=!1,X=-1,ie=5,$=-1;function se(){return K?!0:!(s.unstable_now()-$<ie)}function Ce(){if(K=!1,ye){var D=s.unstable_now();$=D;var I=!0;try{e:{J=!1,B&&(B=!1,_e(X),X=-1),M=!0;var Q=V;try{t:{for(ce(D),T=y(j);T!==null&&!(T.expirationTime>D&&se());){var re=T.callback;if(typeof re=="function"){T.callback=null,V=T.priorityLevel;var ue=re(T.expirationTime<=D);if(D=s.unstable_now(),typeof ue=="function"){T.callback=ue,ce(D),I=!0;break t}T===y(j)&&d(j),ce(D)}else d(j);T=y(j)}if(T!==null)I=!0;else{var m=y(h);m!==null&&Ue(oe,m.startTime-D),I=!1}}break e}finally{T=null,V=Q,M=!1}I=void 0}}finally{I?Te():ye=!1}}}var Te;if(typeof me=="function")Te=function(){me(Ce)};else if(typeof MessageChannel<"u"){var Ae=new MessageChannel,Oe=Ae.port2;Ae.port1.onmessage=Ce,Te=function(){Oe.postMessage(null)}}else Te=function(){ee(Ce,0)};function Ue(D,I){X=ee(function(){D(s.unstable_now())},I)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(D){D.callback=null},s.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ie=0<D?Math.floor(1e3/D):5},s.unstable_getCurrentPriorityLevel=function(){return V},s.unstable_next=function(D){switch(V){case 1:case 2:case 3:var I=3;break;default:I=V}var Q=V;V=I;try{return D()}finally{V=Q}},s.unstable_requestPaint=function(){K=!0},s.unstable_runWithPriority=function(D,I){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var Q=V;V=D;try{return I()}finally{V=Q}},s.unstable_scheduleCallback=function(D,I,Q){var re=s.unstable_now();switch(typeof Q=="object"&&Q!==null?(Q=Q.delay,Q=typeof Q=="number"&&0<Q?re+Q:re):Q=re,D){case 1:var ue=-1;break;case 2:ue=250;break;case 5:ue=1073741823;break;case 4:ue=1e4;break;default:ue=5e3}return ue=Q+ue,D={id:A++,callback:I,priorityLevel:D,startTime:Q,expirationTime:ue,sortIndex:-1},Q>re?(D.sortIndex=Q,f(h,D),y(j)===null&&D===y(h)&&(B?(_e(X),X=-1):B=!0,Ue(oe,Q-re))):(D.sortIndex=ue,f(j,D),J||M||(J=!0,ye||(ye=!0,Te()))),D},s.unstable_shouldYield=se,s.unstable_wrapCallback=function(D){var I=V;return function(){var Q=V;V=I;try{return D.apply(this,arguments)}finally{V=Q}}}})(mo)),mo}var km;function wy(){return km||(km=1,fo.exports=xy()),fo.exports}var ho={exports:{}},je={};/**
18
+ * @license React
19
+ * react.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var Am;function _y(){if(Am)return je;Am=1;var s=Symbol.for("react.transitional.element"),f=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),b=Symbol.for("react.context"),U=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),T=Symbol.for("react.activity"),V=Symbol.iterator;function M(m){return m===null||typeof m!="object"?null:(m=V&&m[V]||m["@@iterator"],typeof m=="function"?m:null)}var J={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},B=Object.assign,K={};function ee(m,S,Z){this.props=m,this.context=S,this.refs=K,this.updater=Z||J}ee.prototype.isReactComponent={},ee.prototype.setState=function(m,S){if(typeof m!="object"&&typeof m!="function"&&m!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,m,S,"setState")},ee.prototype.forceUpdate=function(m){this.updater.enqueueForceUpdate(this,m,"forceUpdate")};function _e(){}_e.prototype=ee.prototype;function me(m,S,Z){this.props=m,this.context=S,this.refs=K,this.updater=Z||J}var ce=me.prototype=new _e;ce.constructor=me,B(ce,ee.prototype),ce.isPureReactComponent=!0;var oe=Array.isArray;function ye(){}var X={H:null,A:null,T:null,S:null},ie=Object.prototype.hasOwnProperty;function $(m,S,Z){var F=Z.ref;return{$$typeof:s,type:m,key:S,ref:F!==void 0?F:null,props:Z}}function se(m,S){return $(m.type,S,m.props)}function Ce(m){return typeof m=="object"&&m!==null&&m.$$typeof===s}function Te(m){var S={"=":"=0",":":"=2"};return"$"+m.replace(/[=:]/g,function(Z){return S[Z]})}var Ae=/\/+/g;function Oe(m,S){return typeof m=="object"&&m!==null&&m.key!=null?Te(""+m.key):S.toString(36)}function Ue(m){switch(m.status){case"fulfilled":return m.value;case"rejected":throw m.reason;default:switch(typeof m.status=="string"?m.then(ye,ye):(m.status="pending",m.then(function(S){m.status==="pending"&&(m.status="fulfilled",m.value=S)},function(S){m.status==="pending"&&(m.status="rejected",m.reason=S)})),m.status){case"fulfilled":return m.value;case"rejected":throw m.reason}}throw m}function D(m,S,Z,F,le){var ge=typeof m;(ge==="undefined"||ge==="boolean")&&(m=null);var Se=!1;if(m===null)Se=!0;else switch(ge){case"bigint":case"string":case"number":Se=!0;break;case"object":switch(m.$$typeof){case s:case f:Se=!0;break;case A:return Se=m._init,D(Se(m._payload),S,Z,F,le)}}if(Se)return le=le(m),Se=F===""?"."+Oe(m,0):F,oe(le)?(Z="",Se!=null&&(Z=Se.replace(Ae,"$&/")+"/"),D(le,S,Z,"",function(Lt){return Lt})):le!=null&&(Ce(le)&&(le=se(le,Z+(le.key==null||m&&m.key===le.key?"":(""+le.key).replace(Ae,"$&/")+"/")+Se)),S.push(le)),1;Se=0;var et=F===""?".":F+":";if(oe(m))for(var qe=0;qe<m.length;qe++)F=m[qe],ge=et+Oe(F,qe),Se+=D(F,S,Z,ge,le);else if(qe=M(m),typeof qe=="function")for(m=qe.call(m),qe=0;!(F=m.next()).done;)F=F.value,ge=et+Oe(F,qe++),Se+=D(F,S,Z,ge,le);else if(ge==="object"){if(typeof m.then=="function")return D(Ue(m),S,Z,F,le);throw S=String(m),Error("Objects are not valid as a React child (found: "+(S==="[object Object]"?"object with keys {"+Object.keys(m).join(", ")+"}":S)+"). If you meant to render a collection of children, use an array instead.")}return Se}function I(m,S,Z){if(m==null)return m;var F=[],le=0;return D(m,F,"","",function(ge){return S.call(Z,ge,le++)}),F}function Q(m){if(m._status===-1){var S=m._result;S=S(),S.then(function(Z){(m._status===0||m._status===-1)&&(m._status=1,m._result=Z)},function(Z){(m._status===0||m._status===-1)&&(m._status=2,m._result=Z)}),m._status===-1&&(m._status=0,m._result=S)}if(m._status===1)return m._result.default;throw m._result}var re=typeof reportError=="function"?reportError:function(m){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var S=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof m=="object"&&m!==null&&typeof m.message=="string"?String(m.message):String(m),error:m});if(!window.dispatchEvent(S))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",m);return}console.error(m)},ue={map:I,forEach:function(m,S,Z){I(m,function(){S.apply(this,arguments)},Z)},count:function(m){var S=0;return I(m,function(){S++}),S},toArray:function(m){return I(m,function(S){return S})||[]},only:function(m){if(!Ce(m))throw Error("React.Children.only expected to receive a single React element child.");return m}};return je.Activity=T,je.Children=ue,je.Component=ee,je.Fragment=y,je.Profiler=x,je.PureComponent=me,je.StrictMode=d,je.Suspense=j,je.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=X,je.__COMPILER_RUNTIME={__proto__:null,c:function(m){return X.H.useMemoCache(m)}},je.cache=function(m){return function(){return m.apply(null,arguments)}},je.cacheSignal=function(){return null},je.cloneElement=function(m,S,Z){if(m==null)throw Error("The argument must be a React element, but you passed "+m+".");var F=B({},m.props),le=m.key;if(S!=null)for(ge in S.key!==void 0&&(le=""+S.key),S)!ie.call(S,ge)||ge==="key"||ge==="__self"||ge==="__source"||ge==="ref"&&S.ref===void 0||(F[ge]=S[ge]);var ge=arguments.length-2;if(ge===1)F.children=Z;else if(1<ge){for(var Se=Array(ge),et=0;et<ge;et++)Se[et]=arguments[et+2];F.children=Se}return $(m.type,le,F)},je.createContext=function(m){return m={$$typeof:b,_currentValue:m,_currentValue2:m,_threadCount:0,Provider:null,Consumer:null},m.Provider=m,m.Consumer={$$typeof:_,_context:m},m},je.createElement=function(m,S,Z){var F,le={},ge=null;if(S!=null)for(F in S.key!==void 0&&(ge=""+S.key),S)ie.call(S,F)&&F!=="key"&&F!=="__self"&&F!=="__source"&&(le[F]=S[F]);var Se=arguments.length-2;if(Se===1)le.children=Z;else if(1<Se){for(var et=Array(Se),qe=0;qe<Se;qe++)et[qe]=arguments[qe+2];le.children=et}if(m&&m.defaultProps)for(F in Se=m.defaultProps,Se)le[F]===void 0&&(le[F]=Se[F]);return $(m,ge,le)},je.createRef=function(){return{current:null}},je.forwardRef=function(m){return{$$typeof:U,render:m}},je.isValidElement=Ce,je.lazy=function(m){return{$$typeof:A,_payload:{_status:-1,_result:m},_init:Q}},je.memo=function(m,S){return{$$typeof:h,type:m,compare:S===void 0?null:S}},je.startTransition=function(m){var S=X.T,Z={};X.T=Z;try{var F=m(),le=X.S;le!==null&&le(Z,F),typeof F=="object"&&F!==null&&typeof F.then=="function"&&F.then(ye,re)}catch(ge){re(ge)}finally{S!==null&&Z.types!==null&&(S.types=Z.types),X.T=S}},je.unstable_useCacheRefresh=function(){return X.H.useCacheRefresh()},je.use=function(m){return X.H.use(m)},je.useActionState=function(m,S,Z){return X.H.useActionState(m,S,Z)},je.useCallback=function(m,S){return X.H.useCallback(m,S)},je.useContext=function(m){return X.H.useContext(m)},je.useDebugValue=function(){},je.useDeferredValue=function(m,S){return X.H.useDeferredValue(m,S)},je.useEffect=function(m,S){return X.H.useEffect(m,S)},je.useEffectEvent=function(m){return X.H.useEffectEvent(m)},je.useId=function(){return X.H.useId()},je.useImperativeHandle=function(m,S,Z){return X.H.useImperativeHandle(m,S,Z)},je.useInsertionEffect=function(m,S){return X.H.useInsertionEffect(m,S)},je.useLayoutEffect=function(m,S){return X.H.useLayoutEffect(m,S)},je.useMemo=function(m,S){return X.H.useMemo(m,S)},je.useOptimistic=function(m,S){return X.H.useOptimistic(m,S)},je.useReducer=function(m,S,Z){return X.H.useReducer(m,S,Z)},je.useRef=function(m){return X.H.useRef(m)},je.useState=function(m){return X.H.useState(m)},je.useSyncExternalStore=function(m,S,Z){return X.H.useSyncExternalStore(m,S,Z)},je.useTransition=function(){return X.H.useTransition()},je.version="19.2.6",je}var Nm;function No(){return Nm||(Nm=1,ho.exports=_y()),ho.exports}var po={exports:{}},Bt={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var Dm;function Ty(){if(Dm)return Bt;Dm=1;var s=No();function f(j){var h="https://react.dev/errors/"+j;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var A=2;A<arguments.length;A++)h+="&args[]="+encodeURIComponent(arguments[A])}return"Minified React error #"+j+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function y(){}var d={d:{f:y,r:function(){throw Error(f(522))},D:y,C:y,L:y,m:y,X:y,S:y,M:y},p:0,findDOMNode:null},x=Symbol.for("react.portal");function _(j,h,A){var T=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:x,key:T==null?null:""+T,children:j,containerInfo:h,implementation:A}}var b=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function U(j,h){if(j==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Bt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=d,Bt.createPortal=function(j,h){var A=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(f(299));return _(j,h,null,A)},Bt.flushSync=function(j){var h=b.T,A=d.p;try{if(b.T=null,d.p=2,j)return j()}finally{b.T=h,d.p=A,d.d.f()}},Bt.preconnect=function(j,h){typeof j=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,d.d.C(j,h))},Bt.prefetchDNS=function(j){typeof j=="string"&&d.d.D(j)},Bt.preinit=function(j,h){if(typeof j=="string"&&h&&typeof h.as=="string"){var A=h.as,T=U(A,h.crossOrigin),V=typeof h.integrity=="string"?h.integrity:void 0,M=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;A==="style"?d.d.S(j,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:T,integrity:V,fetchPriority:M}):A==="script"&&d.d.X(j,{crossOrigin:T,integrity:V,fetchPriority:M,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Bt.preinitModule=function(j,h){if(typeof j=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var A=U(h.as,h.crossOrigin);d.d.M(j,{crossOrigin:A,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&d.d.M(j)},Bt.preload=function(j,h){if(typeof j=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var A=h.as,T=U(A,h.crossOrigin);d.d.L(j,A,{crossOrigin:T,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Bt.preloadModule=function(j,h){if(typeof j=="string")if(h){var A=U(h.as,h.crossOrigin);d.d.m(j,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:A,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else d.d.m(j)},Bt.requestFormReset=function(j){d.d.r(j)},Bt.unstable_batchedUpdates=function(j,h){return j(h)},Bt.useFormState=function(j,h,A){return b.H.useFormState(j,h,A)},Bt.useFormStatus=function(){return b.H.useHostTransitionStatus()},Bt.version="19.2.6",Bt}var Om;function Pm(){if(Om)return po.exports;Om=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(f){console.error(f)}}return s(),po.exports=Ty(),po.exports}/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var Mm;function jy(){if(Mm)return ji;Mm=1;var s=wy(),f=No(),y=Pm();function d(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}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."}function x(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function _(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function b(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 U(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function j(e){if(_(e)!==e)throw Error(d(188))}function h(e){var t=e.alternate;if(!t){if(t=_(e),t===null)throw Error(d(188));return t!==e?null:e}for(var a=e,n=t;;){var l=a.return;if(l===null)break;var i=l.alternate;if(i===null){if(n=l.return,n!==null){a=n;continue}break}if(l.child===i.child){for(i=l.child;i;){if(i===a)return j(l),e;if(i===n)return j(l),t;i=i.sibling}throw Error(d(188))}if(a.return!==n.return)a=l,n=i;else{for(var u=!1,r=l.child;r;){if(r===a){u=!0,a=l,n=i;break}if(r===n){u=!0,n=l,a=i;break}r=r.sibling}if(!u){for(r=i.child;r;){if(r===a){u=!0,a=i,n=l;break}if(r===n){u=!0,n=i,a=l;break}r=r.sibling}if(!u)throw Error(d(189))}}if(a.alternate!==n)throw Error(d(190))}if(a.tag!==3)throw Error(d(188));return a.stateNode.current===a?e:t}function A(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=A(e),t!==null)return t;e=e.sibling}return null}var T=Object.assign,V=Symbol.for("react.element"),M=Symbol.for("react.transitional.element"),J=Symbol.for("react.portal"),B=Symbol.for("react.fragment"),K=Symbol.for("react.strict_mode"),ee=Symbol.for("react.profiler"),_e=Symbol.for("react.consumer"),me=Symbol.for("react.context"),ce=Symbol.for("react.forward_ref"),oe=Symbol.for("react.suspense"),ye=Symbol.for("react.suspense_list"),X=Symbol.for("react.memo"),ie=Symbol.for("react.lazy"),$=Symbol.for("react.activity"),se=Symbol.for("react.memo_cache_sentinel"),Ce=Symbol.iterator;function Te(e){return e===null||typeof e!="object"?null:(e=Ce&&e[Ce]||e["@@iterator"],typeof e=="function"?e:null)}var Ae=Symbol.for("react.client.reference");function Oe(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Ae?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case B:return"Fragment";case ee:return"Profiler";case K:return"StrictMode";case oe:return"Suspense";case ye:return"SuspenseList";case $:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case J:return"Portal";case me:return e.displayName||"Context";case _e:return(e._context.displayName||"Context")+".Consumer";case ce:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case X:return t=e.displayName||null,t!==null?t:Oe(e.type)||"Memo";case ie:t=e._payload,e=e._init;try{return Oe(e(t))}catch{}}return null}var Ue=Array.isArray,D=f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=y.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q={pending:!1,data:null,method:null,action:null},re=[],ue=-1;function m(e){return{current:e}}function S(e){0>ue||(e.current=re[ue],re[ue]=null,ue--)}function Z(e,t){ue++,re[ue]=e.current,e.current=t}var F=m(null),le=m(null),ge=m(null),Se=m(null);function et(e,t){switch(Z(ge,t),Z(le,e),Z(F,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Kf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Kf(t),e=Wf(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}S(F),Z(F,e)}function qe(){S(F),S(le),S(ge)}function Lt(e){e.memoizedState!==null&&Z(Se,e);var t=F.current,a=Wf(t,e.type);t!==a&&(Z(le,e),Z(F,a))}function pt(e){le.current===e&&(S(F),S(le)),Se.current===e&&(S(Se),Si._currentValue=Q)}var oa,Aa;function Nt(e){if(oa===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);oa=t&&t[1]||"",Aa=-1<a.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+oa+e+Aa}var Xt=!1;function Ht(e,t){if(!e||Xt)return"";Xt=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(t){var G=function(){throw Error()};if(Object.defineProperty(G.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(G,[])}catch(O){var k=O}Reflect.construct(e,[],G)}else{try{G.call()}catch(O){k=O}e.call(G.prototype)}}else{try{throw Error()}catch(O){k=O}(G=e())&&typeof G.catch=="function"&&G.catch(function(){})}}catch(O){if(O&&k&&typeof O.stack=="string")return[O.stack,k.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var l=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");l&&l.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var i=n.DetermineComponentFrameRoot(),u=i[0],r=i[1];if(u&&r){var p=u.split(`
44
+ `),z=r.split(`
45
+ `);for(l=n=0;n<p.length&&!p[n].includes("DetermineComponentFrameRoot");)n++;for(;l<z.length&&!z[l].includes("DetermineComponentFrameRoot");)l++;if(n===p.length||l===z.length)for(n=p.length-1,l=z.length-1;1<=n&&0<=l&&p[n]!==z[l];)l--;for(;1<=n&&0<=l;n--,l--)if(p[n]!==z[l]){if(n!==1||l!==1)do if(n--,l--,0>l||p[n]!==z[l]){var R=`
46
+ `+p[n].replace(" at new "," at ");return e.displayName&&R.includes("<anonymous>")&&(R=R.replace("<anonymous>",e.displayName)),R}while(1<=n&&0<=l);break}}}finally{Xt=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?Nt(a):""}function ja(e,t){switch(e.tag){case 26:case 27:case 5:return Nt(e.type);case 16:return Nt("Lazy");case 13:return e.child!==t&&t!==null?Nt("Suspense Fallback"):Nt("Suspense");case 19:return Nt("SuspenseList");case 0:case 15:return Ht(e.type,!1);case 11:return Ht(e.type.render,!1);case 1:return Ht(e.type,!0);case 31:return Nt("Activity");default:return""}}function qt(e){try{var t="",a=null;do t+=ja(e,a),a=e,e=e.return;while(e);return t}catch(n){return`
47
+ Error generating stack: `+n.message+`
48
+ `+n.stack}}var ut=Object.prototype.hasOwnProperty,Yt=s.unstable_scheduleCallback,Pt=s.unstable_cancelCallback,ot=s.unstable_shouldYield,yt=s.unstable_requestPaint,rt=s.unstable_now,dt=s.unstable_getCurrentPriorityLevel,Qt=s.unstable_ImmediatePriority,ea=s.unstable_UserBlockingPriority,jt=s.unstable_NormalPriority,Ka=s.unstable_LowPriority,St=s.unstable_IdlePriority,L=s.log,C=s.unstable_setDisableYieldValue,N=null,q=null;function W(e){if(typeof L=="function"&&C(e),q&&typeof q.setStrictMode=="function")try{q.setStrictMode(N,e)}catch{}}var te=Math.clz32?Math.clz32:Et,$e=Math.log,ae=Math.LN2;function Et(e){return e>>>=0,e===0?32:31-($e(e)/ae|0)|0}var gt=256,st=262144,Me=4194304;function be(e){var t=e&42;if(t!==0)return t;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ee(e,t,a){var n=e.pendingLanes;if(n===0)return 0;var l=0,i=e.suspendedLanes,u=e.pingedLanes;e=e.warmLanes;var r=n&134217727;return r!==0?(n=r&~i,n!==0?l=be(n):(u&=r,u!==0?l=be(u):a||(a=r&~e,a!==0&&(l=be(a))))):(r=n&~i,r!==0?l=be(r):u!==0?l=be(u):a||(a=n&~e,a!==0&&(l=be(a)))),l===0?0:t!==0&&t!==l&&(t&i)===0&&(i=l&-l,a=t&-t,i>=a||i===32&&(a&4194048)!==0)?t:l}function ft(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ic(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ml(){var e=Me;return Me<<=1,(Me&62914560)===0&&(Me=4194304),e}function xa(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function H(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function P(e,t,a,n,l,i){var u=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var r=e.entanglements,p=e.expirationTimes,z=e.hiddenUpdates;for(a=u&~a;0<a;){var R=31-te(a),G=1<<R;r[R]=0,p[R]=-1;var k=z[R];if(k!==null)for(z[R]=null,R=0;R<k.length;R++){var O=k[R];O!==null&&(O.lane&=-536870913)}a&=~G}n!==0&&ne(e,n,0),i!==0&&l===0&&e.tag!==0&&(e.suspendedLanes|=i&~(u&~t))}function ne(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-te(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|a&261930}function he(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var n=31-te(a),l=1<<n;l&t|e[n]&t&&(e[n]|=t),a&=~l}}function de(e,t){var a=t&-t;return a=(a&42)!==0?1:Ze(a),(a&(e.suspendedLanes|t))!==0?0:a}function Ze(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function ze(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function ta(){var e=I.p;return e!==0?e:(e=window.event,e===void 0?32:vm(e.type))}function zt(e,t){var a=I.p;try{return I.p=e,t()}finally{I.p=a}}var at=Math.random().toString(36).slice(2),Dt="__reactFiber$"+at,Zt="__reactProps$"+at,Gn="__reactContainer$"+at,Pc="__reactEvents$"+at,uh="__reactListeners$"+at,oh="__reactHandles$"+at,Uo="__reactResources$"+at,Ul="__reactMarker$"+at;function es(e){delete e[Dt],delete e[Zt],delete e[Pc],delete e[uh],delete e[oh]}function $n(e){var t=e[Dt];if(t)return t;for(var a=e.parentNode;a;){if(t=a[Gn]||a[Dt]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=nm(e);e!==null;){if(a=e[Dt])return a;e=nm(e)}return t}e=a,a=e.parentNode}return null}function Xn(e){if(e=e[Dt]||e[Gn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Rl(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(d(33))}function Qn(e){var t=e[Uo];return t||(t=e[Uo]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function kt(e){e[Ul]=!0}var Ro=new Set,Ho={};function wn(e,t){Zn(e,t),Zn(e+"Capture",t)}function Zn(e,t){for(Ho[e]=t,e=0;e<t.length;e++)Ro.add(t[e])}var rh=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Bo={},Lo={};function dh(e){return ut.call(Lo,e)?!0:ut.call(Bo,e)?!1:rh.test(e)?Lo[e]=!0:(Bo[e]=!0,!1)}function Mi(e,t,a){if(dh(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var n=t.toLowerCase().slice(0,5);if(n!=="data-"&&n!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function Ui(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function Na(e,t,a,n){if(n===null)e.removeAttribute(a);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+n)}}function ra(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function qo(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function fh(e,t,a){var n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(u){a=""+u,i.call(this,u)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return a},setValue:function(u){a=""+u},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ts(e){if(!e._valueTracker){var t=qo(e)?"checked":"value";e._valueTracker=fh(e,t,""+e[t])}}function Yo(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),n="";return e&&(n=qo(e)?e.checked?"true":"false":e.value),e=n,e!==a?(t.setValue(e),!0):!1}function Ri(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}}var mh=/[\n"\\]/g;function da(e){return e.replace(mh,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function as(e,t,a,n,l,i,u,r){e.name="",u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"?e.type=u:e.removeAttribute("type"),t!=null?u==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+ra(t)):e.value!==""+ra(t)&&(e.value=""+ra(t)):u!=="submit"&&u!=="reset"||e.removeAttribute("value"),t!=null?ns(e,u,ra(t)):a!=null?ns(e,u,ra(a)):n!=null&&e.removeAttribute("value"),l==null&&i!=null&&(e.defaultChecked=!!i),l!=null&&(e.checked=l&&typeof l!="function"&&typeof l!="symbol"),r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"?e.name=""+ra(r):e.removeAttribute("name")}function Go(e,t,a,n,l,i,u,r){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.type=i),t!=null||a!=null){if(!(i!=="submit"&&i!=="reset"||t!=null)){ts(e);return}a=a!=null?""+ra(a):"",t=t!=null?""+ra(t):a,r||t===e.value||(e.value=t),e.defaultValue=t}n=n??l,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=r?e.checked:!!n,e.defaultChecked=!!n,u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.name=u),ts(e)}function ns(e,t,a){t==="number"&&Ri(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Vn(e,t,a,n){if(e=e.options,t){t={};for(var l=0;l<a.length;l++)t["$"+a[l]]=!0;for(a=0;a<e.length;a++)l=t.hasOwnProperty("$"+e[a].value),e[a].selected!==l&&(e[a].selected=l),l&&n&&(e[a].defaultSelected=!0)}else{for(a=""+ra(a),t=null,l=0;l<e.length;l++){if(e[l].value===a){e[l].selected=!0,n&&(e[l].defaultSelected=!0);return}t!==null||e[l].disabled||(t=e[l])}t!==null&&(t.selected=!0)}}function $o(e,t,a){if(t!=null&&(t=""+ra(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+ra(a):""}function Xo(e,t,a,n){if(t==null){if(n!=null){if(a!=null)throw Error(d(92));if(Ue(n)){if(1<n.length)throw Error(d(93));n=n[0]}a=n}a==null&&(a=""),t=a}a=ra(t),e.defaultValue=a,n=e.textContent,n===a&&n!==""&&n!==null&&(e.value=n),ts(e)}function Jn(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var hh=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Qo(e,t,a){var n=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?n?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":n?e.setProperty(t,a):typeof a!="number"||a===0||hh.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function Zo(e,t,a){if(t!=null&&typeof t!="object")throw Error(d(62));if(e=e.style,a!=null){for(var n in a)!a.hasOwnProperty(n)||t!=null&&t.hasOwnProperty(n)||(n.indexOf("--")===0?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="");for(var l in t)n=t[l],t.hasOwnProperty(l)&&a[l]!==n&&Qo(e,l,n)}else for(var i in t)t.hasOwnProperty(i)&&Qo(e,i,t[i])}function ls(e){if(e.indexOf("-")===-1)return!1;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 ph=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),yh=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Hi(e){return yh.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Da(){}var is=null;function cs(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Kn=null,Wn=null;function Vo(e){var t=Xn(e);if(t&&(e=t.stateNode)){var a=e[Zt]||null;e:switch(e=t.stateNode,t.type){case"input":if(as(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+da(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var n=a[t];if(n!==e&&n.form===e.form){var l=n[Zt]||null;if(!l)throw Error(d(90));as(n,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name)}}for(t=0;t<a.length;t++)n=a[t],n.form===e.form&&Yo(n)}break e;case"textarea":$o(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&Vn(e,!!a.multiple,t,!1)}}}var ss=!1;function Jo(e,t,a){if(ss)return e(t,a);ss=!0;try{var n=e(t);return n}finally{if(ss=!1,(Kn!==null||Wn!==null)&&(Tc(),Kn&&(t=Kn,e=Wn,Wn=Kn=null,Vo(t),e)))for(t=0;t<e.length;t++)Vo(e[t])}}function Hl(e,t){var a=e.stateNode;if(a===null)return null;var n=a[Zt]||null;if(n===null)return null;a=n[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":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(d(231,t,typeof a));return a}var Oa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),us=!1;if(Oa)try{var Bl={};Object.defineProperty(Bl,"passive",{get:function(){us=!0}}),window.addEventListener("test",Bl,Bl),window.removeEventListener("test",Bl,Bl)}catch{us=!1}var Wa=null,os=null,Bi=null;function Ko(){if(Bi)return Bi;var e,t=os,a=t.length,n,l="value"in Wa?Wa.value:Wa.textContent,i=l.length;for(e=0;e<a&&t[e]===l[e];e++);var u=a-e;for(n=1;n<=u&&t[a-n]===l[i-n];n++);return Bi=l.slice(e,1<n?1-n:void 0)}function Li(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 qi(){return!0}function Wo(){return!1}function Vt(e){function t(a,n,l,i,u){this._reactName=a,this._targetInst=l,this.type=n,this.nativeEvent=i,this.target=u,this.currentTarget=null;for(var r in e)e.hasOwnProperty(r)&&(a=e[r],this[r]=a?a(i):i[r]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?qi:Wo,this.isPropagationStopped=Wo,this}return T(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=qi)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=qi)},persist:function(){},isPersistent:qi}),t}var _n={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Yi=Vt(_n),Ll=T({},_n,{view:0,detail:0}),gh=Vt(Ll),rs,ds,ql,Gi=T({},Ll,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ms,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!==ql&&(ql&&e.type==="mousemove"?(rs=e.screenX-ql.screenX,ds=e.screenY-ql.screenY):ds=rs=0,ql=e),rs)},movementY:function(e){return"movementY"in e?e.movementY:ds}}),Fo=Vt(Gi),bh=T({},Gi,{dataTransfer:0}),vh=Vt(bh),Sh=T({},Ll,{relatedTarget:0}),fs=Vt(Sh),xh=T({},_n,{animationName:0,elapsedTime:0,pseudoElement:0}),wh=Vt(xh),_h=T({},_n,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Th=Vt(_h),jh=T({},_n,{data:0}),Io=Vt(jh),Ch={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Eh={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"},zh={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function kh(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=zh[e])?!!t[e]:!1}function ms(){return kh}var Ah=T({},Ll,{key:function(e){if(e.key){var t=Ch[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Li(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Eh[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ms,charCode:function(e){return e.type==="keypress"?Li(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Li(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Nh=Vt(Ah),Dh=T({},Gi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Po=Vt(Dh),Oh=T({},Ll,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ms}),Mh=Vt(Oh),Uh=T({},_n,{propertyName:0,elapsedTime:0,pseudoElement:0}),Rh=Vt(Uh),Hh=T({},Gi,{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}),Bh=Vt(Hh),Lh=T({},_n,{newState:0,oldState:0}),qh=Vt(Lh),Yh=[9,13,27,32],hs=Oa&&"CompositionEvent"in window,Yl=null;Oa&&"documentMode"in document&&(Yl=document.documentMode);var Gh=Oa&&"TextEvent"in window&&!Yl,er=Oa&&(!hs||Yl&&8<Yl&&11>=Yl),tr=" ",ar=!1;function nr(e,t){switch(e){case"keyup":return Yh.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function lr(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Fn=!1;function $h(e,t){switch(e){case"compositionend":return lr(t);case"keypress":return t.which!==32?null:(ar=!0,tr);case"textInput":return e=t.data,e===tr&&ar?null:e;default:return null}}function Xh(e,t){if(Fn)return e==="compositionend"||!hs&&nr(e,t)?(e=Ko(),Bi=os=Wa=null,Fn=!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 er&&t.locale!=="ko"?null:t.data;default:return null}}var Qh={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 ir(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Qh[e.type]:t==="textarea"}function cr(e,t,a,n){Kn?Wn?Wn.push(n):Wn=[n]:Kn=n,t=Nc(t,"onChange"),0<t.length&&(a=new Yi("onChange","change",null,a,n),e.push({event:a,listeners:t}))}var Gl=null,$l=null;function Zh(e){$f(e,0)}function $i(e){var t=Rl(e);if(Yo(t))return e}function sr(e,t){if(e==="change")return t}var ur=!1;if(Oa){var ps;if(Oa){var ys="oninput"in document;if(!ys){var or=document.createElement("div");or.setAttribute("oninput","return;"),ys=typeof or.oninput=="function"}ps=ys}else ps=!1;ur=ps&&(!document.documentMode||9<document.documentMode)}function rr(){Gl&&(Gl.detachEvent("onpropertychange",dr),$l=Gl=null)}function dr(e){if(e.propertyName==="value"&&$i($l)){var t=[];cr(t,$l,e,cs(e)),Jo(Zh,t)}}function Vh(e,t,a){e==="focusin"?(rr(),Gl=t,$l=a,Gl.attachEvent("onpropertychange",dr)):e==="focusout"&&rr()}function Jh(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return $i($l)}function Kh(e,t){if(e==="click")return $i(t)}function Wh(e,t){if(e==="input"||e==="change")return $i(t)}function Fh(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var aa=typeof Object.is=="function"?Object.is:Fh;function Xl(e,t){if(aa(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),n=Object.keys(t);if(a.length!==n.length)return!1;for(n=0;n<a.length;n++){var l=a[n];if(!ut.call(t,l)||!aa(e[l],t[l]))return!1}return!0}function fr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function mr(e,t){var a=fr(e);e=0;for(var n;a;){if(a.nodeType===3){if(n=e+a.textContent.length,e<=t&&n>=t)return{node:a,offset:t-e};e=n}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=fr(a)}}function hr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?hr(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function pr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ri(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=Ri(e.document)}return t}function gs(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")}var Ih=Oa&&"documentMode"in document&&11>=document.documentMode,In=null,bs=null,Ql=null,vs=!1;function yr(e,t,a){var n=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;vs||In==null||In!==Ri(n)||(n=In,"selectionStart"in n&&gs(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Ql&&Xl(Ql,n)||(Ql=n,n=Nc(bs,"onSelect"),0<n.length&&(t=new Yi("onSelect","select",null,t,a),e.push({event:t,listeners:n}),t.target=In)))}function Tn(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Pn={animationend:Tn("Animation","AnimationEnd"),animationiteration:Tn("Animation","AnimationIteration"),animationstart:Tn("Animation","AnimationStart"),transitionrun:Tn("Transition","TransitionRun"),transitionstart:Tn("Transition","TransitionStart"),transitioncancel:Tn("Transition","TransitionCancel"),transitionend:Tn("Transition","TransitionEnd")},Ss={},gr={};Oa&&(gr=document.createElement("div").style,"AnimationEvent"in window||(delete Pn.animationend.animation,delete Pn.animationiteration.animation,delete Pn.animationstart.animation),"TransitionEvent"in window||delete Pn.transitionend.transition);function jn(e){if(Ss[e])return Ss[e];if(!Pn[e])return e;var t=Pn[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in gr)return Ss[e]=t[a];return e}var br=jn("animationend"),vr=jn("animationiteration"),Sr=jn("animationstart"),Ph=jn("transitionrun"),ep=jn("transitionstart"),tp=jn("transitioncancel"),xr=jn("transitionend"),wr=new Map,xs="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");xs.push("scrollEnd");function wa(e,t){wr.set(e,t),wn(t,[e])}var Xi=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},fa=[],el=0,_s=0;function Qi(){for(var e=el,t=_s=el=0;t<e;){var a=fa[t];fa[t++]=null;var n=fa[t];fa[t++]=null;var l=fa[t];fa[t++]=null;var i=fa[t];if(fa[t++]=null,n!==null&&l!==null){var u=n.pending;u===null?l.next=l:(l.next=u.next,u.next=l),n.pending=l}i!==0&&_r(a,l,i)}}function Zi(e,t,a,n){fa[el++]=e,fa[el++]=t,fa[el++]=a,fa[el++]=n,_s|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function Ts(e,t,a,n){return Zi(e,t,a,n),Vi(e)}function Cn(e,t){return Zi(e,null,null,t),Vi(e)}function _r(e,t,a){e.lanes|=a;var n=e.alternate;n!==null&&(n.lanes|=a);for(var l=!1,i=e.return;i!==null;)i.childLanes|=a,n=i.alternate,n!==null&&(n.childLanes|=a),i.tag===22&&(e=i.stateNode,e===null||e._visibility&1||(l=!0)),e=i,i=i.return;return e.tag===3?(i=e.stateNode,l&&t!==null&&(l=31-te(a),e=i.hiddenUpdates,n=e[l],n===null?e[l]=[t]:n.push(t),t.lane=a|536870912),i):null}function Vi(e){if(50<mi)throw mi=0,Ou=null,Error(d(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var tl={};function ap(e,t,a,n){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function na(e,t,a,n){return new ap(e,t,a,n)}function js(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ma(e,t){var a=e.alternate;return a===null?(a=na(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function Tr(e,t){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Ji(e,t,a,n,l,i){var u=0;if(n=e,typeof e=="function")js(e)&&(u=1);else if(typeof e=="string")u=sy(e,a,F.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case $:return e=na(31,a,t,l),e.elementType=$,e.lanes=i,e;case B:return En(a.children,l,i,t);case K:u=8,l|=24;break;case ee:return e=na(12,a,t,l|2),e.elementType=ee,e.lanes=i,e;case oe:return e=na(13,a,t,l),e.elementType=oe,e.lanes=i,e;case ye:return e=na(19,a,t,l),e.elementType=ye,e.lanes=i,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case me:u=10;break e;case _e:u=9;break e;case ce:u=11;break e;case X:u=14;break e;case ie:u=16,n=null;break e}u=29,a=Error(d(130,e===null?"null":typeof e,"")),n=null}return t=na(u,a,t,l),t.elementType=e,t.type=n,t.lanes=i,t}function En(e,t,a,n){return e=na(7,e,n,t),e.lanes=a,e}function Cs(e,t,a){return e=na(6,e,null,t),e.lanes=a,e}function jr(e){var t=na(18,null,null,0);return t.stateNode=e,t}function Es(e,t,a){return t=na(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Cr=new WeakMap;function ma(e,t){if(typeof e=="object"&&e!==null){var a=Cr.get(e);return a!==void 0?a:(t={value:e,source:t,stack:qt(t)},Cr.set(e,t),t)}return{value:e,source:t,stack:qt(t)}}var al=[],nl=0,Ki=null,Zl=0,ha=[],pa=0,Fa=null,Ca=1,Ea="";function Ua(e,t){al[nl++]=Zl,al[nl++]=Ki,Ki=e,Zl=t}function Er(e,t,a){ha[pa++]=Ca,ha[pa++]=Ea,ha[pa++]=Fa,Fa=e;var n=Ca;e=Ea;var l=32-te(n)-1;n&=~(1<<l),a+=1;var i=32-te(t)+l;if(30<i){var u=l-l%5;i=(n&(1<<u)-1).toString(32),n>>=u,l-=u,Ca=1<<32-te(t)+l|a<<l|n,Ea=i+e}else Ca=1<<i|a<<l|n,Ea=e}function zs(e){e.return!==null&&(Ua(e,1),Er(e,1,0))}function ks(e){for(;e===Ki;)Ki=al[--nl],al[nl]=null,Zl=al[--nl],al[nl]=null;for(;e===Fa;)Fa=ha[--pa],ha[pa]=null,Ea=ha[--pa],ha[pa]=null,Ca=ha[--pa],ha[pa]=null}function zr(e,t){ha[pa++]=Ca,ha[pa++]=Ea,ha[pa++]=Fa,Ca=t.id,Ea=t.overflow,Fa=e}var Ot=null,nt=null,Ye=!1,Ia=null,ya=!1,As=Error(d(519));function Pa(e){var t=Error(d(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Vl(ma(t,e)),As}function kr(e){var t=e.stateNode,a=e.type,n=e.memoizedProps;switch(t[Dt]=e,t[Zt]=n,a){case"dialog":He("cancel",t),He("close",t);break;case"iframe":case"object":case"embed":He("load",t);break;case"video":case"audio":for(a=0;a<pi.length;a++)He(pi[a],t);break;case"source":He("error",t);break;case"img":case"image":case"link":He("error",t),He("load",t);break;case"details":He("toggle",t);break;case"input":He("invalid",t),Go(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":He("invalid",t);break;case"textarea":He("invalid",t),Xo(t,n.value,n.defaultValue,n.children)}a=n.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||n.suppressHydrationWarning===!0||Vf(t.textContent,a)?(n.popover!=null&&(He("beforetoggle",t),He("toggle",t)),n.onScroll!=null&&He("scroll",t),n.onScrollEnd!=null&&He("scrollend",t),n.onClick!=null&&(t.onclick=Da),t=!0):t=!1,t||Pa(e,!0)}function Ar(e){for(Ot=e.return;Ot;)switch(Ot.tag){case 5:case 31:case 13:ya=!1;return;case 27:case 3:ya=!0;return;default:Ot=Ot.return}}function ll(e){if(e!==Ot)return!1;if(!Ye)return Ar(e),Ye=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Ju(e.type,e.memoizedProps)),a=!a),a&&nt&&Pa(e),Ar(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(d(317));nt=am(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(d(317));nt=am(e)}else t===27?(t=nt,hn(e.type)?(e=Pu,Pu=null,nt=e):nt=t):nt=Ot?ba(e.stateNode.nextSibling):null;return!0}function zn(){nt=Ot=null,Ye=!1}function Ns(){var e=Ia;return e!==null&&(Ft===null?Ft=e:Ft.push.apply(Ft,e),Ia=null),e}function Vl(e){Ia===null?Ia=[e]:Ia.push(e)}var Ds=m(null),kn=null,Ra=null;function en(e,t,a){Z(Ds,t._currentValue),t._currentValue=a}function Ha(e){e._currentValue=Ds.current,S(Ds)}function Os(e,t,a){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===a)break;e=e.return}}function Ms(e,t,a,n){var l=e.child;for(l!==null&&(l.return=e);l!==null;){var i=l.dependencies;if(i!==null){var u=l.child;i=i.firstContext;e:for(;i!==null;){var r=i;i=l;for(var p=0;p<t.length;p++)if(r.context===t[p]){i.lanes|=a,r=i.alternate,r!==null&&(r.lanes|=a),Os(i.return,a,e),n||(u=null);break e}i=r.next}}else if(l.tag===18){if(u=l.return,u===null)throw Error(d(341));u.lanes|=a,i=u.alternate,i!==null&&(i.lanes|=a),Os(u,a,e),u=null}else u=l.child;if(u!==null)u.return=l;else for(u=l;u!==null;){if(u===e){u=null;break}if(l=u.sibling,l!==null){l.return=u.return,u=l;break}u=u.return}l=u}}function il(e,t,a,n){e=null;for(var l=t,i=!1;l!==null;){if(!i){if((l.flags&524288)!==0)i=!0;else if((l.flags&262144)!==0)break}if(l.tag===10){var u=l.alternate;if(u===null)throw Error(d(387));if(u=u.memoizedProps,u!==null){var r=l.type;aa(l.pendingProps.value,u.value)||(e!==null?e.push(r):e=[r])}}else if(l===Se.current){if(u=l.alternate,u===null)throw Error(d(387));u.memoizedState.memoizedState!==l.memoizedState.memoizedState&&(e!==null?e.push(Si):e=[Si])}l=l.return}e!==null&&Ms(t,e,a,n),t.flags|=262144}function Wi(e){for(e=e.firstContext;e!==null;){if(!aa(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function An(e){kn=e,Ra=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Mt(e){return Nr(kn,e)}function Fi(e,t){return kn===null&&An(e),Nr(e,t)}function Nr(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},Ra===null){if(e===null)throw Error(d(308));Ra=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ra=Ra.next=t;return a}var np=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},lp=s.unstable_scheduleCallback,ip=s.unstable_NormalPriority,xt={$$typeof:me,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Us(){return{controller:new np,data:new Map,refCount:0}}function Jl(e){e.refCount--,e.refCount===0&&lp(ip,function(){e.controller.abort()})}var Kl=null,Rs=0,cl=0,sl=null;function cp(e,t){if(Kl===null){var a=Kl=[];Rs=0,cl=Lu(),sl={status:"pending",value:void 0,then:function(n){a.push(n)}}}return Rs++,t.then(Dr,Dr),t}function Dr(){if(--Rs===0&&Kl!==null){sl!==null&&(sl.status="fulfilled");var e=Kl;Kl=null,cl=0,sl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function sp(e,t){var a=[],n={status:"pending",value:null,reason:null,then:function(l){a.push(l)}};return e.then(function(){n.status="fulfilled",n.value=t;for(var l=0;l<a.length;l++)(0,a[l])(t)},function(l){for(n.status="rejected",n.reason=l,l=0;l<a.length;l++)(0,a[l])(void 0)}),n}var Or=D.S;D.S=function(e,t){gf=rt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&cp(e,t),Or!==null&&Or(e,t)};var Nn=m(null);function Hs(){var e=Nn.current;return e!==null?e:tt.pooledCache}function Ii(e,t){t===null?Z(Nn,Nn.current):Z(Nn,t.pool)}function Mr(){var e=Hs();return e===null?null:{parent:xt._currentValue,pool:e}}var ul=Error(d(460)),Bs=Error(d(474)),Pi=Error(d(542)),ec={then:function(){}};function Ur(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Rr(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(Da,Da),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Br(e),e;default:if(typeof t.status=="string")t.then(Da,Da);else{if(e=tt,e!==null&&100<e.shellSuspendCounter)throw Error(d(482));e=t,e.status="pending",e.then(function(n){if(t.status==="pending"){var l=t;l.status="fulfilled",l.value=n}},function(n){if(t.status==="pending"){var l=t;l.status="rejected",l.reason=n}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Br(e),e}throw On=t,ul}}function Dn(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(On=a,ul):a}}var On=null;function Hr(){if(On===null)throw Error(d(459));var e=On;return On=null,e}function Br(e){if(e===ul||e===Pi)throw Error(d(483))}var ol=null,Wl=0;function tc(e){var t=Wl;return Wl+=1,ol===null&&(ol=[]),Rr(ol,e,t)}function Fl(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ac(e,t){throw t.$$typeof===V?Error(d(525)):(e=Object.prototype.toString.call(t),Error(d(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Lr(e){function t(w,g){if(e){var E=w.deletions;E===null?(w.deletions=[g],w.flags|=16):E.push(g)}}function a(w,g){if(!e)return null;for(;g!==null;)t(w,g),g=g.sibling;return null}function n(w){for(var g=new Map;w!==null;)w.key!==null?g.set(w.key,w):g.set(w.index,w),w=w.sibling;return g}function l(w,g){return w=Ma(w,g),w.index=0,w.sibling=null,w}function i(w,g,E){return w.index=E,e?(E=w.alternate,E!==null?(E=E.index,E<g?(w.flags|=67108866,g):E):(w.flags|=67108866,g)):(w.flags|=1048576,g)}function u(w){return e&&w.alternate===null&&(w.flags|=67108866),w}function r(w,g,E,Y){return g===null||g.tag!==6?(g=Cs(E,w.mode,Y),g.return=w,g):(g=l(g,E),g.return=w,g)}function p(w,g,E,Y){var ve=E.type;return ve===B?R(w,g,E.props.children,Y,E.key):g!==null&&(g.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===ie&&Dn(ve)===g.type)?(g=l(g,E.props),Fl(g,E),g.return=w,g):(g=Ji(E.type,E.key,E.props,null,w.mode,Y),Fl(g,E),g.return=w,g)}function z(w,g,E,Y){return g===null||g.tag!==4||g.stateNode.containerInfo!==E.containerInfo||g.stateNode.implementation!==E.implementation?(g=Es(E,w.mode,Y),g.return=w,g):(g=l(g,E.children||[]),g.return=w,g)}function R(w,g,E,Y,ve){return g===null||g.tag!==7?(g=En(E,w.mode,Y,ve),g.return=w,g):(g=l(g,E),g.return=w,g)}function G(w,g,E){if(typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint")return g=Cs(""+g,w.mode,E),g.return=w,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case M:return E=Ji(g.type,g.key,g.props,null,w.mode,E),Fl(E,g),E.return=w,E;case J:return g=Es(g,w.mode,E),g.return=w,g;case ie:return g=Dn(g),G(w,g,E)}if(Ue(g)||Te(g))return g=En(g,w.mode,E,null),g.return=w,g;if(typeof g.then=="function")return G(w,tc(g),E);if(g.$$typeof===me)return G(w,Fi(w,g),E);ac(w,g)}return null}function k(w,g,E,Y){var ve=g!==null?g.key:null;if(typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint")return ve!==null?null:r(w,g,""+E,Y);if(typeof E=="object"&&E!==null){switch(E.$$typeof){case M:return E.key===ve?p(w,g,E,Y):null;case J:return E.key===ve?z(w,g,E,Y):null;case ie:return E=Dn(E),k(w,g,E,Y)}if(Ue(E)||Te(E))return ve!==null?null:R(w,g,E,Y,null);if(typeof E.then=="function")return k(w,g,tc(E),Y);if(E.$$typeof===me)return k(w,g,Fi(w,E),Y);ac(w,E)}return null}function O(w,g,E,Y,ve){if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return w=w.get(E)||null,r(g,w,""+Y,ve);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case M:return w=w.get(Y.key===null?E:Y.key)||null,p(g,w,Y,ve);case J:return w=w.get(Y.key===null?E:Y.key)||null,z(g,w,Y,ve);case ie:return Y=Dn(Y),O(w,g,E,Y,ve)}if(Ue(Y)||Te(Y))return w=w.get(E)||null,R(g,w,Y,ve,null);if(typeof Y.then=="function")return O(w,g,E,tc(Y),ve);if(Y.$$typeof===me)return O(w,g,E,Fi(g,Y),ve);ac(g,Y)}return null}function fe(w,g,E,Y){for(var ve=null,Xe=null,pe=g,Ne=g=0,Le=null;pe!==null&&Ne<E.length;Ne++){pe.index>Ne?(Le=pe,pe=null):Le=pe.sibling;var Qe=k(w,pe,E[Ne],Y);if(Qe===null){pe===null&&(pe=Le);break}e&&pe&&Qe.alternate===null&&t(w,pe),g=i(Qe,g,Ne),Xe===null?ve=Qe:Xe.sibling=Qe,Xe=Qe,pe=Le}if(Ne===E.length)return a(w,pe),Ye&&Ua(w,Ne),ve;if(pe===null){for(;Ne<E.length;Ne++)pe=G(w,E[Ne],Y),pe!==null&&(g=i(pe,g,Ne),Xe===null?ve=pe:Xe.sibling=pe,Xe=pe);return Ye&&Ua(w,Ne),ve}for(pe=n(pe);Ne<E.length;Ne++)Le=O(pe,w,Ne,E[Ne],Y),Le!==null&&(e&&Le.alternate!==null&&pe.delete(Le.key===null?Ne:Le.key),g=i(Le,g,Ne),Xe===null?ve=Le:Xe.sibling=Le,Xe=Le);return e&&pe.forEach(function(vn){return t(w,vn)}),Ye&&Ua(w,Ne),ve}function xe(w,g,E,Y){if(E==null)throw Error(d(151));for(var ve=null,Xe=null,pe=g,Ne=g=0,Le=null,Qe=E.next();pe!==null&&!Qe.done;Ne++,Qe=E.next()){pe.index>Ne?(Le=pe,pe=null):Le=pe.sibling;var vn=k(w,pe,Qe.value,Y);if(vn===null){pe===null&&(pe=Le);break}e&&pe&&vn.alternate===null&&t(w,pe),g=i(vn,g,Ne),Xe===null?ve=vn:Xe.sibling=vn,Xe=vn,pe=Le}if(Qe.done)return a(w,pe),Ye&&Ua(w,Ne),ve;if(pe===null){for(;!Qe.done;Ne++,Qe=E.next())Qe=G(w,Qe.value,Y),Qe!==null&&(g=i(Qe,g,Ne),Xe===null?ve=Qe:Xe.sibling=Qe,Xe=Qe);return Ye&&Ua(w,Ne),ve}for(pe=n(pe);!Qe.done;Ne++,Qe=E.next())Qe=O(pe,w,Ne,Qe.value,Y),Qe!==null&&(e&&Qe.alternate!==null&&pe.delete(Qe.key===null?Ne:Qe.key),g=i(Qe,g,Ne),Xe===null?ve=Qe:Xe.sibling=Qe,Xe=Qe);return e&&pe.forEach(function(by){return t(w,by)}),Ye&&Ua(w,Ne),ve}function Pe(w,g,E,Y){if(typeof E=="object"&&E!==null&&E.type===B&&E.key===null&&(E=E.props.children),typeof E=="object"&&E!==null){switch(E.$$typeof){case M:e:{for(var ve=E.key;g!==null;){if(g.key===ve){if(ve=E.type,ve===B){if(g.tag===7){a(w,g.sibling),Y=l(g,E.props.children),Y.return=w,w=Y;break e}}else if(g.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===ie&&Dn(ve)===g.type){a(w,g.sibling),Y=l(g,E.props),Fl(Y,E),Y.return=w,w=Y;break e}a(w,g);break}else t(w,g);g=g.sibling}E.type===B?(Y=En(E.props.children,w.mode,Y,E.key),Y.return=w,w=Y):(Y=Ji(E.type,E.key,E.props,null,w.mode,Y),Fl(Y,E),Y.return=w,w=Y)}return u(w);case J:e:{for(ve=E.key;g!==null;){if(g.key===ve)if(g.tag===4&&g.stateNode.containerInfo===E.containerInfo&&g.stateNode.implementation===E.implementation){a(w,g.sibling),Y=l(g,E.children||[]),Y.return=w,w=Y;break e}else{a(w,g);break}else t(w,g);g=g.sibling}Y=Es(E,w.mode,Y),Y.return=w,w=Y}return u(w);case ie:return E=Dn(E),Pe(w,g,E,Y)}if(Ue(E))return fe(w,g,E,Y);if(Te(E)){if(ve=Te(E),typeof ve!="function")throw Error(d(150));return E=ve.call(E),xe(w,g,E,Y)}if(typeof E.then=="function")return Pe(w,g,tc(E),Y);if(E.$$typeof===me)return Pe(w,g,Fi(w,E),Y);ac(w,E)}return typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint"?(E=""+E,g!==null&&g.tag===6?(a(w,g.sibling),Y=l(g,E),Y.return=w,w=Y):(a(w,g),Y=Cs(E,w.mode,Y),Y.return=w,w=Y),u(w)):a(w,g)}return function(w,g,E,Y){try{Wl=0;var ve=Pe(w,g,E,Y);return ol=null,ve}catch(pe){if(pe===ul||pe===Pi)throw pe;var Xe=na(29,pe,null,w.mode);return Xe.lanes=Y,Xe.return=w,Xe}finally{}}}var Mn=Lr(!0),qr=Lr(!1),tn=!1;function Ls(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function qs(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function an(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function nn(e,t,a){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(Ve&2)!==0){var l=n.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),n.pending=t,t=Vi(e),_r(e,null,a),t}return Zi(e,n,t,a),Vi(e)}function Il(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,he(e,a)}}function Ys(e,t){var a=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,a===n)){var l=null,i=null;if(a=a.firstBaseUpdate,a!==null){do{var u={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};i===null?l=i=u:i=i.next=u,a=a.next}while(a!==null);i===null?l=i=t:i=i.next=t}else l=i=t;a={baseState:n.baseState,firstBaseUpdate:l,lastBaseUpdate:i,shared:n.shared,callbacks:n.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var Gs=!1;function Pl(){if(Gs){var e=sl;if(e!==null)throw e}}function ei(e,t,a,n){Gs=!1;var l=e.updateQueue;tn=!1;var i=l.firstBaseUpdate,u=l.lastBaseUpdate,r=l.shared.pending;if(r!==null){l.shared.pending=null;var p=r,z=p.next;p.next=null,u===null?i=z:u.next=z,u=p;var R=e.alternate;R!==null&&(R=R.updateQueue,r=R.lastBaseUpdate,r!==u&&(r===null?R.firstBaseUpdate=z:r.next=z,R.lastBaseUpdate=p))}if(i!==null){var G=l.baseState;u=0,R=z=p=null,r=i;do{var k=r.lane&-536870913,O=k!==r.lane;if(O?(Be&k)===k:(n&k)===k){k!==0&&k===cl&&(Gs=!0),R!==null&&(R=R.next={lane:0,tag:r.tag,payload:r.payload,callback:null,next:null});e:{var fe=e,xe=r;k=t;var Pe=a;switch(xe.tag){case 1:if(fe=xe.payload,typeof fe=="function"){G=fe.call(Pe,G,k);break e}G=fe;break e;case 3:fe.flags=fe.flags&-65537|128;case 0:if(fe=xe.payload,k=typeof fe=="function"?fe.call(Pe,G,k):fe,k==null)break e;G=T({},G,k);break e;case 2:tn=!0}}k=r.callback,k!==null&&(e.flags|=64,O&&(e.flags|=8192),O=l.callbacks,O===null?l.callbacks=[k]:O.push(k))}else O={lane:k,tag:r.tag,payload:r.payload,callback:r.callback,next:null},R===null?(z=R=O,p=G):R=R.next=O,u|=k;if(r=r.next,r===null){if(r=l.shared.pending,r===null)break;O=r,r=O.next,O.next=null,l.lastBaseUpdate=O,l.shared.pending=null}}while(!0);R===null&&(p=G),l.baseState=p,l.firstBaseUpdate=z,l.lastBaseUpdate=R,i===null&&(l.shared.lanes=0),on|=u,e.lanes=u,e.memoizedState=G}}function Yr(e,t){if(typeof e!="function")throw Error(d(191,e));e.call(t)}function Gr(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)Yr(a[e],t)}var rl=m(null),nc=m(0);function $r(e,t){e=Za,Z(nc,e),Z(rl,t),Za=e|t.baseLanes}function $s(){Z(nc,Za),Z(rl,rl.current)}function Xs(){Za=nc.current,S(rl),S(nc)}var la=m(null),ga=null;function ln(e){var t=e.alternate;Z(bt,bt.current&1),Z(la,e),ga===null&&(t===null||rl.current!==null||t.memoizedState!==null)&&(ga=e)}function Qs(e){Z(bt,bt.current),Z(la,e),ga===null&&(ga=e)}function Xr(e){e.tag===22?(Z(bt,bt.current),Z(la,e),ga===null&&(ga=e)):cn()}function cn(){Z(bt,bt.current),Z(la,la.current)}function ia(e){S(la),ga===e&&(ga=null),S(bt)}var bt=m(0);function lc(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Fu(a)||Iu(a)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)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 Ba=0,ke=null,Fe=null,wt=null,ic=!1,dl=!1,Un=!1,cc=0,ti=0,fl=null,up=0;function mt(){throw Error(d(321))}function Zs(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!aa(e[a],t[a]))return!1;return!0}function Vs(e,t,a,n,l,i){return Ba=i,ke=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,D.H=e===null||e.memoizedState===null?Ed:uu,Un=!1,i=a(n,l),Un=!1,dl&&(i=Zr(t,a,n,l)),Qr(e),i}function Qr(e){D.H=li;var t=Fe!==null&&Fe.next!==null;if(Ba=0,wt=Fe=ke=null,ic=!1,ti=0,fl=null,t)throw Error(d(300));e===null||_t||(e=e.dependencies,e!==null&&Wi(e)&&(_t=!0))}function Zr(e,t,a,n){ke=e;var l=0;do{if(dl&&(fl=null),ti=0,dl=!1,25<=l)throw Error(d(301));if(l+=1,wt=Fe=null,e.updateQueue!=null){var i=e.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,i.memoCache!=null&&(i.memoCache.index=0)}D.H=zd,i=t(a,n)}while(dl);return i}function op(){var e=D.H,t=e.useState()[0];return t=typeof t.then=="function"?ai(t):t,e=e.useState()[0],(Fe!==null?Fe.memoizedState:null)!==e&&(ke.flags|=1024),t}function Js(){var e=cc!==0;return cc=0,e}function Ks(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Ws(e){if(ic){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ic=!1}Ba=0,wt=Fe=ke=null,dl=!1,ti=cc=0,fl=null}function Gt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return wt===null?ke.memoizedState=wt=e:wt=wt.next=e,wt}function vt(){if(Fe===null){var e=ke.alternate;e=e!==null?e.memoizedState:null}else e=Fe.next;var t=wt===null?ke.memoizedState:wt.next;if(t!==null)wt=t,Fe=e;else{if(e===null)throw ke.alternate===null?Error(d(467)):Error(d(310));Fe=e,e={memoizedState:Fe.memoizedState,baseState:Fe.baseState,baseQueue:Fe.baseQueue,queue:Fe.queue,next:null},wt===null?ke.memoizedState=wt=e:wt=wt.next=e}return wt}function sc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ai(e){var t=ti;return ti+=1,fl===null&&(fl=[]),e=Rr(fl,e,t),t=ke,(wt===null?t.memoizedState:wt.next)===null&&(t=t.alternate,D.H=t===null||t.memoizedState===null?Ed:uu),e}function uc(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return ai(e);if(e.$$typeof===me)return Mt(e)}throw Error(d(438,String(e)))}function Fs(e){var t=null,a=ke.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var n=ke.alternate;n!==null&&(n=n.updateQueue,n!==null&&(n=n.memoCache,n!=null&&(t={data:n.data.map(function(l){return l.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=sc(),ke.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),n=0;n<e;n++)a[n]=se;return t.index++,a}function La(e,t){return typeof t=="function"?t(e):t}function oc(e){var t=vt();return Is(t,Fe,e)}function Is(e,t,a){var n=e.queue;if(n===null)throw Error(d(311));n.lastRenderedReducer=a;var l=e.baseQueue,i=n.pending;if(i!==null){if(l!==null){var u=l.next;l.next=i.next,i.next=u}t.baseQueue=l=i,n.pending=null}if(i=e.baseState,l===null)e.memoizedState=i;else{t=l.next;var r=u=null,p=null,z=t,R=!1;do{var G=z.lane&-536870913;if(G!==z.lane?(Be&G)===G:(Ba&G)===G){var k=z.revertLane;if(k===0)p!==null&&(p=p.next={lane:0,revertLane:0,gesture:null,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null}),G===cl&&(R=!0);else if((Ba&k)===k){z=z.next,k===cl&&(R=!0);continue}else G={lane:0,revertLane:z.revertLane,gesture:null,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null},p===null?(r=p=G,u=i):p=p.next=G,ke.lanes|=k,on|=k;G=z.action,Un&&a(i,G),i=z.hasEagerState?z.eagerState:a(i,G)}else k={lane:G,revertLane:z.revertLane,gesture:z.gesture,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null},p===null?(r=p=k,u=i):p=p.next=k,ke.lanes|=G,on|=G;z=z.next}while(z!==null&&z!==t);if(p===null?u=i:p.next=r,!aa(i,e.memoizedState)&&(_t=!0,R&&(a=sl,a!==null)))throw a;e.memoizedState=i,e.baseState=u,e.baseQueue=p,n.lastRenderedState=i}return l===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function Ps(e){var t=vt(),a=t.queue;if(a===null)throw Error(d(311));a.lastRenderedReducer=e;var n=a.dispatch,l=a.pending,i=t.memoizedState;if(l!==null){a.pending=null;var u=l=l.next;do i=e(i,u.action),u=u.next;while(u!==l);aa(i,t.memoizedState)||(_t=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),a.lastRenderedState=i}return[i,n]}function Vr(e,t,a){var n=ke,l=vt(),i=Ye;if(i){if(a===void 0)throw Error(d(407));a=a()}else a=t();var u=!aa((Fe||l).memoizedState,a);if(u&&(l.memoizedState=a,_t=!0),l=l.queue,au(Wr.bind(null,n,l,e),[e]),l.getSnapshot!==t||u||wt!==null&&wt.memoizedState.tag&1){if(n.flags|=2048,ml(9,{destroy:void 0},Kr.bind(null,n,l,a,t),null),tt===null)throw Error(d(349));i||(Ba&127)!==0||Jr(n,t,a)}return a}function Jr(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=ke.updateQueue,t===null?(t=sc(),ke.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function Kr(e,t,a,n){t.value=a,t.getSnapshot=n,Fr(t)&&Ir(e)}function Wr(e,t,a){return a(function(){Fr(t)&&Ir(e)})}function Fr(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!aa(e,a)}catch{return!0}}function Ir(e){var t=Cn(e,2);t!==null&&It(t,e,2)}function eu(e){var t=Gt();if(typeof e=="function"){var a=e;if(e=a(),Un){W(!0);try{a()}finally{W(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:La,lastRenderedState:e},t}function Pr(e,t,a,n){return e.baseState=a,Is(e,Fe,typeof n=="function"?n:La)}function rp(e,t,a,n,l){if(fc(e))throw Error(d(485));if(e=t.action,e!==null){var i={payload:l,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(u){i.listeners.push(u)}};D.T!==null?a(!0):i.isTransition=!1,n(i),a=t.pending,a===null?(i.next=t.pending=i,ed(t,i)):(i.next=a.next,t.pending=a.next=i)}}function ed(e,t){var a=t.action,n=t.payload,l=e.state;if(t.isTransition){var i=D.T,u={};D.T=u;try{var r=a(l,n),p=D.S;p!==null&&p(u,r),td(e,t,r)}catch(z){tu(e,t,z)}finally{i!==null&&u.types!==null&&(i.types=u.types),D.T=i}}else try{i=a(l,n),td(e,t,i)}catch(z){tu(e,t,z)}}function td(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(n){ad(e,t,n)},function(n){return tu(e,t,n)}):ad(e,t,a)}function ad(e,t,a){t.status="fulfilled",t.value=a,nd(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,ed(e,a)))}function tu(e,t,a){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=a,nd(t),t=t.next;while(t!==n)}e.action=null}function nd(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ld(e,t){return t}function id(e,t){if(Ye){var a=tt.formState;if(a!==null){e:{var n=ke;if(Ye){if(nt){t:{for(var l=nt,i=ya;l.nodeType!==8;){if(!i){l=null;break t}if(l=ba(l.nextSibling),l===null){l=null;break t}}i=l.data,l=i==="F!"||i==="F"?l:null}if(l){nt=ba(l.nextSibling),n=l.data==="F!";break e}}Pa(n)}n=!1}n&&(t=a[0])}}return a=Gt(),a.memoizedState=a.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ld,lastRenderedState:t},a.queue=n,a=Td.bind(null,ke,n),n.dispatch=a,n=eu(!1),i=su.bind(null,ke,!1,n.queue),n=Gt(),l={state:t,dispatch:null,action:e,pending:null},n.queue=l,a=rp.bind(null,ke,l,i,a),l.dispatch=a,n.memoizedState=e,[t,a,!1]}function cd(e){var t=vt();return sd(t,Fe,e)}function sd(e,t,a){if(t=Is(e,t,ld)[0],e=oc(La)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=ai(t)}catch(u){throw u===ul?Pi:u}else n=t;t=vt();var l=t.queue,i=l.dispatch;return a!==t.memoizedState&&(ke.flags|=2048,ml(9,{destroy:void 0},dp.bind(null,l,a),null)),[n,i,e]}function dp(e,t){e.action=t}function ud(e){var t=vt(),a=Fe;if(a!==null)return sd(t,a,e);vt(),t=t.memoizedState,a=vt();var n=a.queue.dispatch;return a.memoizedState=e,[t,n,!1]}function ml(e,t,a,n){return e={tag:e,create:a,deps:n,inst:t,next:null},t=ke.updateQueue,t===null&&(t=sc(),ke.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(n=a.next,a.next=e,e.next=n,t.lastEffect=e),e}function od(){return vt().memoizedState}function rc(e,t,a,n){var l=Gt();ke.flags|=e,l.memoizedState=ml(1|t,{destroy:void 0},a,n===void 0?null:n)}function dc(e,t,a,n){var l=vt();n=n===void 0?null:n;var i=l.memoizedState.inst;Fe!==null&&n!==null&&Zs(n,Fe.memoizedState.deps)?l.memoizedState=ml(t,i,a,n):(ke.flags|=e,l.memoizedState=ml(1|t,i,a,n))}function rd(e,t){rc(8390656,8,e,t)}function au(e,t){dc(2048,8,e,t)}function fp(e){ke.flags|=4;var t=ke.updateQueue;if(t===null)t=sc(),ke.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function dd(e){var t=vt().memoizedState;return fp({ref:t,nextImpl:e}),function(){if((Ve&2)!==0)throw Error(d(440));return t.impl.apply(void 0,arguments)}}function fd(e,t){return dc(4,2,e,t)}function md(e,t){return dc(4,4,e,t)}function hd(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function pd(e,t,a){a=a!=null?a.concat([e]):null,dc(4,4,hd.bind(null,t,e),a)}function nu(){}function yd(e,t){var a=vt();t=t===void 0?null:t;var n=a.memoizedState;return t!==null&&Zs(t,n[1])?n[0]:(a.memoizedState=[e,t],e)}function gd(e,t){var a=vt();t=t===void 0?null:t;var n=a.memoizedState;if(t!==null&&Zs(t,n[1]))return n[0];if(n=e(),Un){W(!0);try{e()}finally{W(!1)}}return a.memoizedState=[n,t],n}function lu(e,t,a){return a===void 0||(Ba&1073741824)!==0&&(Be&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=vf(),ke.lanes|=e,on|=e,a)}function bd(e,t,a,n){return aa(a,t)?a:rl.current!==null?(e=lu(e,a,n),aa(e,t)||(_t=!0),e):(Ba&42)===0||(Ba&1073741824)!==0&&(Be&261930)===0?(_t=!0,e.memoizedState=a):(e=vf(),ke.lanes|=e,on|=e,t)}function vd(e,t,a,n,l){var i=I.p;I.p=i!==0&&8>i?i:8;var u=D.T,r={};D.T=r,su(e,!1,t,a);try{var p=l(),z=D.S;if(z!==null&&z(r,p),p!==null&&typeof p=="object"&&typeof p.then=="function"){var R=sp(p,n);ni(e,t,R,ua(e))}else ni(e,t,n,ua(e))}catch(G){ni(e,t,{then:function(){},status:"rejected",reason:G},ua())}finally{I.p=i,u!==null&&r.types!==null&&(u.types=r.types),D.T=u}}function mp(){}function iu(e,t,a,n){if(e.tag!==5)throw Error(d(476));var l=Sd(e).queue;vd(e,l,t,Q,a===null?mp:function(){return xd(e),a(n)})}function Sd(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Q,baseState:Q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:La,lastRenderedState:Q},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:La,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function xd(e){var t=Sd(e);t.next===null&&(t=e.alternate.memoizedState),ni(e,t.next.queue,{},ua())}function cu(){return Mt(Si)}function wd(){return vt().memoizedState}function _d(){return vt().memoizedState}function hp(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=ua();e=an(a);var n=nn(t,e,a);n!==null&&(It(n,t,a),Il(n,t,a)),t={cache:Us()},e.payload=t;return}t=t.return}}function pp(e,t,a){var n=ua();a={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},fc(e)?jd(t,a):(a=Ts(e,t,a,n),a!==null&&(It(a,e,n),Cd(a,t,n)))}function Td(e,t,a){var n=ua();ni(e,t,a,n)}function ni(e,t,a,n){var l={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(fc(e))jd(t,l);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var u=t.lastRenderedState,r=i(u,a);if(l.hasEagerState=!0,l.eagerState=r,aa(r,u))return Zi(e,t,l,0),tt===null&&Qi(),!1}catch{}finally{}if(a=Ts(e,t,l,n),a!==null)return It(a,e,n),Cd(a,t,n),!0}return!1}function su(e,t,a,n){if(n={lane:2,revertLane:Lu(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},fc(e)){if(t)throw Error(d(479))}else t=Ts(e,a,n,2),t!==null&&It(t,e,2)}function fc(e){var t=e.alternate;return e===ke||t!==null&&t===ke}function jd(e,t){dl=ic=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function Cd(e,t,a){if((a&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,he(e,a)}}var li={readContext:Mt,use:uc,useCallback:mt,useContext:mt,useEffect:mt,useImperativeHandle:mt,useLayoutEffect:mt,useInsertionEffect:mt,useMemo:mt,useReducer:mt,useRef:mt,useState:mt,useDebugValue:mt,useDeferredValue:mt,useTransition:mt,useSyncExternalStore:mt,useId:mt,useHostTransitionStatus:mt,useFormState:mt,useActionState:mt,useOptimistic:mt,useMemoCache:mt,useCacheRefresh:mt};li.useEffectEvent=mt;var Ed={readContext:Mt,use:uc,useCallback:function(e,t){return Gt().memoizedState=[e,t===void 0?null:t],e},useContext:Mt,useEffect:rd,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,rc(4194308,4,hd.bind(null,t,e),a)},useLayoutEffect:function(e,t){return rc(4194308,4,e,t)},useInsertionEffect:function(e,t){rc(4,2,e,t)},useMemo:function(e,t){var a=Gt();t=t===void 0?null:t;var n=e();if(Un){W(!0);try{e()}finally{W(!1)}}return a.memoizedState=[n,t],n},useReducer:function(e,t,a){var n=Gt();if(a!==void 0){var l=a(t);if(Un){W(!0);try{a(t)}finally{W(!1)}}}else l=t;return n.memoizedState=n.baseState=l,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:l},n.queue=e,e=e.dispatch=pp.bind(null,ke,e),[n.memoizedState,e]},useRef:function(e){var t=Gt();return e={current:e},t.memoizedState=e},useState:function(e){e=eu(e);var t=e.queue,a=Td.bind(null,ke,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:nu,useDeferredValue:function(e,t){var a=Gt();return lu(a,e,t)},useTransition:function(){var e=eu(!1);return e=vd.bind(null,ke,e.queue,!0,!1),Gt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var n=ke,l=Gt();if(Ye){if(a===void 0)throw Error(d(407));a=a()}else{if(a=t(),tt===null)throw Error(d(349));(Be&127)!==0||Jr(n,t,a)}l.memoizedState=a;var i={value:a,getSnapshot:t};return l.queue=i,rd(Wr.bind(null,n,i,e),[e]),n.flags|=2048,ml(9,{destroy:void 0},Kr.bind(null,n,i,a,t),null),a},useId:function(){var e=Gt(),t=tt.identifierPrefix;if(Ye){var a=Ea,n=Ca;a=(n&~(1<<32-te(n)-1)).toString(32)+a,t="_"+t+"R_"+a,a=cc++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=up++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:cu,useFormState:id,useActionState:id,useOptimistic:function(e){var t=Gt();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=su.bind(null,ke,!0,a),a.dispatch=t,[e,t]},useMemoCache:Fs,useCacheRefresh:function(){return Gt().memoizedState=hp.bind(null,ke)},useEffectEvent:function(e){var t=Gt(),a={impl:e};return t.memoizedState=a,function(){if((Ve&2)!==0)throw Error(d(440));return a.impl.apply(void 0,arguments)}}},uu={readContext:Mt,use:uc,useCallback:yd,useContext:Mt,useEffect:au,useImperativeHandle:pd,useInsertionEffect:fd,useLayoutEffect:md,useMemo:gd,useReducer:oc,useRef:od,useState:function(){return oc(La)},useDebugValue:nu,useDeferredValue:function(e,t){var a=vt();return bd(a,Fe.memoizedState,e,t)},useTransition:function(){var e=oc(La)[0],t=vt().memoizedState;return[typeof e=="boolean"?e:ai(e),t]},useSyncExternalStore:Vr,useId:wd,useHostTransitionStatus:cu,useFormState:cd,useActionState:cd,useOptimistic:function(e,t){var a=vt();return Pr(a,Fe,e,t)},useMemoCache:Fs,useCacheRefresh:_d};uu.useEffectEvent=dd;var zd={readContext:Mt,use:uc,useCallback:yd,useContext:Mt,useEffect:au,useImperativeHandle:pd,useInsertionEffect:fd,useLayoutEffect:md,useMemo:gd,useReducer:Ps,useRef:od,useState:function(){return Ps(La)},useDebugValue:nu,useDeferredValue:function(e,t){var a=vt();return Fe===null?lu(a,e,t):bd(a,Fe.memoizedState,e,t)},useTransition:function(){var e=Ps(La)[0],t=vt().memoizedState;return[typeof e=="boolean"?e:ai(e),t]},useSyncExternalStore:Vr,useId:wd,useHostTransitionStatus:cu,useFormState:ud,useActionState:ud,useOptimistic:function(e,t){var a=vt();return Fe!==null?Pr(a,Fe,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Fs,useCacheRefresh:_d};zd.useEffectEvent=dd;function ou(e,t,a,n){t=e.memoizedState,a=a(n,t),a=a==null?t:T({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var ru={enqueueSetState:function(e,t,a){e=e._reactInternals;var n=ua(),l=an(n);l.payload=t,a!=null&&(l.callback=a),t=nn(e,l,n),t!==null&&(It(t,e,n),Il(t,e,n))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var n=ua(),l=an(n);l.tag=1,l.payload=t,a!=null&&(l.callback=a),t=nn(e,l,n),t!==null&&(It(t,e,n),Il(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=ua(),n=an(a);n.tag=2,t!=null&&(n.callback=t),t=nn(e,n,a),t!==null&&(It(t,e,a),Il(t,e,a))}};function kd(e,t,a,n,l,i,u){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,i,u):t.prototype&&t.prototype.isPureReactComponent?!Xl(a,n)||!Xl(l,i):!0}function Ad(e,t,a,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,n),t.state!==e&&ru.enqueueReplaceState(t,t.state,null)}function Rn(e,t){var a=t;if("ref"in t){a={};for(var n in t)n!=="ref"&&(a[n]=t[n])}if(e=e.defaultProps){a===t&&(a=T({},a));for(var l in e)a[l]===void 0&&(a[l]=e[l])}return a}function Nd(e){Xi(e)}function Dd(e){console.error(e)}function Od(e){Xi(e)}function mc(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function Md(e,t,a){try{var n=e.onCaughtError;n(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(l){setTimeout(function(){throw l})}}function du(e,t,a){return a=an(a),a.tag=3,a.payload={element:null},a.callback=function(){mc(e,t)},a}function Ud(e){return e=an(e),e.tag=3,e}function Rd(e,t,a,n){var l=a.type.getDerivedStateFromError;if(typeof l=="function"){var i=n.value;e.payload=function(){return l(i)},e.callback=function(){Md(t,a,n)}}var u=a.stateNode;u!==null&&typeof u.componentDidCatch=="function"&&(e.callback=function(){Md(t,a,n),typeof l!="function"&&(rn===null?rn=new Set([this]):rn.add(this));var r=n.stack;this.componentDidCatch(n.value,{componentStack:r!==null?r:""})})}function yp(e,t,a,n,l){if(a.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=a.alternate,t!==null&&il(t,a,l,!0),a=la.current,a!==null){switch(a.tag){case 31:case 13:return ga===null?jc():a.alternate===null&&ht===0&&(ht=3),a.flags&=-257,a.flags|=65536,a.lanes=l,n===ec?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([n]):t.add(n),Ru(e,n,l)),!1;case 22:return a.flags|=65536,n===ec?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([n])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([n]):a.add(n)),Ru(e,n,l)),!1}throw Error(d(435,a.tag))}return Ru(e,n,l),jc(),!1}if(Ye)return t=la.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=l,n!==As&&(e=Error(d(422),{cause:n}),Vl(ma(e,a)))):(n!==As&&(t=Error(d(423),{cause:n}),Vl(ma(t,a))),e=e.current.alternate,e.flags|=65536,l&=-l,e.lanes|=l,n=ma(n,a),l=du(e.stateNode,n,l),Ys(e,l),ht!==4&&(ht=2)),!1;var i=Error(d(520),{cause:n});if(i=ma(i,a),fi===null?fi=[i]:fi.push(i),ht!==4&&(ht=2),t===null)return!0;n=ma(n,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=l&-l,a.lanes|=e,e=du(a.stateNode,n,e),Ys(a,e),!1;case 1:if(t=a.type,i=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||i!==null&&typeof i.componentDidCatch=="function"&&(rn===null||!rn.has(i))))return a.flags|=65536,l&=-l,a.lanes|=l,l=Ud(l),Rd(l,e,a,n),Ys(a,l),!1}a=a.return}while(a!==null);return!1}var fu=Error(d(461)),_t=!1;function Ut(e,t,a,n){t.child=e===null?qr(t,null,a,n):Mn(t,e.child,a,n)}function Hd(e,t,a,n,l){a=a.render;var i=t.ref;if("ref"in n){var u={};for(var r in n)r!=="ref"&&(u[r]=n[r])}else u=n;return An(t),n=Vs(e,t,a,u,i,l),r=Js(),e!==null&&!_t?(Ks(e,t,l),qa(e,t,l)):(Ye&&r&&zs(t),t.flags|=1,Ut(e,t,n,l),t.child)}function Bd(e,t,a,n,l){if(e===null){var i=a.type;return typeof i=="function"&&!js(i)&&i.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=i,Ld(e,t,i,n,l)):(e=Ji(a.type,null,n,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!Su(e,l)){var u=i.memoizedProps;if(a=a.compare,a=a!==null?a:Xl,a(u,n)&&e.ref===t.ref)return qa(e,t,l)}return t.flags|=1,e=Ma(i,n),e.ref=t.ref,e.return=t,t.child=e}function Ld(e,t,a,n,l){if(e!==null){var i=e.memoizedProps;if(Xl(i,n)&&e.ref===t.ref)if(_t=!1,t.pendingProps=n=i,Su(e,l))(e.flags&131072)!==0&&(_t=!0);else return t.lanes=e.lanes,qa(e,t,l)}return mu(e,t,a,n,l)}function qd(e,t,a,n){var l=n.children,i=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.mode==="hidden"){if((t.flags&128)!==0){if(i=i!==null?i.baseLanes|a:a,e!==null){for(n=t.child=e.child,l=0;n!==null;)l=l|n.lanes|n.childLanes,n=n.sibling;n=l&~i}else n=0,t.child=null;return Yd(e,t,i,a,n)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ii(t,i!==null?i.cachePool:null),i!==null?$r(t,i):$s(),Xr(t);else return n=t.lanes=536870912,Yd(e,t,i!==null?i.baseLanes|a:a,a,n)}else i!==null?(Ii(t,i.cachePool),$r(t,i),cn(),t.memoizedState=null):(e!==null&&Ii(t,null),$s(),cn());return Ut(e,t,l,a),t.child}function ii(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Yd(e,t,a,n,l){var i=Hs();return i=i===null?null:{parent:xt._currentValue,pool:i},t.memoizedState={baseLanes:a,cachePool:i},e!==null&&Ii(t,null),$s(),Xr(t),e!==null&&il(e,t,n,!0),t.childLanes=l,null}function hc(e,t){return t=yc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Gd(e,t,a){return Mn(t,e.child,null,a),e=hc(t,t.pendingProps),e.flags|=2,ia(t),t.memoizedState=null,e}function gp(e,t,a){var n=t.pendingProps,l=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ye){if(n.mode==="hidden")return e=hc(t,n),t.lanes=536870912,ii(null,e);if(Qs(t),(e=nt)?(e=tm(e,ya),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Fa!==null?{id:Ca,overflow:Ea}:null,retryLane:536870912,hydrationErrors:null},a=jr(e),a.return=t,t.child=a,Ot=t,nt=null)):e=null,e===null)throw Pa(t);return t.lanes=536870912,null}return hc(t,n)}var i=e.memoizedState;if(i!==null){var u=i.dehydrated;if(Qs(t),l)if(t.flags&256)t.flags&=-257,t=Gd(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(d(558));else if(_t||il(e,t,a,!1),l=(a&e.childLanes)!==0,_t||l){if(n=tt,n!==null&&(u=de(n,a),u!==0&&u!==i.retryLane))throw i.retryLane=u,Cn(e,u),It(n,e,u),fu;jc(),t=Gd(e,t,a)}else e=i.treeContext,nt=ba(u.nextSibling),Ot=t,Ye=!0,Ia=null,ya=!1,e!==null&&zr(t,e),t=hc(t,n),t.flags|=4096;return t}return e=Ma(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function pc(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(d(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function mu(e,t,a,n,l){return An(t),a=Vs(e,t,a,n,void 0,l),n=Js(),e!==null&&!_t?(Ks(e,t,l),qa(e,t,l)):(Ye&&n&&zs(t),t.flags|=1,Ut(e,t,a,l),t.child)}function $d(e,t,a,n,l,i){return An(t),t.updateQueue=null,a=Zr(t,n,a,l),Qr(e),n=Js(),e!==null&&!_t?(Ks(e,t,i),qa(e,t,i)):(Ye&&n&&zs(t),t.flags|=1,Ut(e,t,a,i),t.child)}function Xd(e,t,a,n,l){if(An(t),t.stateNode===null){var i=tl,u=a.contextType;typeof u=="object"&&u!==null&&(i=Mt(u)),i=new a(n,i),t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=ru,t.stateNode=i,i._reactInternals=t,i=t.stateNode,i.props=n,i.state=t.memoizedState,i.refs={},Ls(t),u=a.contextType,i.context=typeof u=="object"&&u!==null?Mt(u):tl,i.state=t.memoizedState,u=a.getDerivedStateFromProps,typeof u=="function"&&(ou(t,a,u,n),i.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(u=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),u!==i.state&&ru.enqueueReplaceState(i,i.state,null),ei(t,n,i,l),Pl(),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){i=t.stateNode;var r=t.memoizedProps,p=Rn(a,r);i.props=p;var z=i.context,R=a.contextType;u=tl,typeof R=="object"&&R!==null&&(u=Mt(R));var G=a.getDerivedStateFromProps;R=typeof G=="function"||typeof i.getSnapshotBeforeUpdate=="function",r=t.pendingProps!==r,R||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(r||z!==u)&&Ad(t,i,n,u),tn=!1;var k=t.memoizedState;i.state=k,ei(t,n,i,l),Pl(),z=t.memoizedState,r||k!==z||tn?(typeof G=="function"&&(ou(t,a,G,n),z=t.memoizedState),(p=tn||kd(t,a,p,n,k,z,u))?(R||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=n,t.memoizedState=z),i.props=n,i.state=z,i.context=u,n=p):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{i=t.stateNode,qs(e,t),u=t.memoizedProps,R=Rn(a,u),i.props=R,G=t.pendingProps,k=i.context,z=a.contextType,p=tl,typeof z=="object"&&z!==null&&(p=Mt(z)),r=a.getDerivedStateFromProps,(z=typeof r=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(u!==G||k!==p)&&Ad(t,i,n,p),tn=!1,k=t.memoizedState,i.state=k,ei(t,n,i,l),Pl();var O=t.memoizedState;u!==G||k!==O||tn||e!==null&&e.dependencies!==null&&Wi(e.dependencies)?(typeof r=="function"&&(ou(t,a,r,n),O=t.memoizedState),(R=tn||kd(t,a,R,n,k,O,p)||e!==null&&e.dependencies!==null&&Wi(e.dependencies))?(z||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(n,O,p),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(n,O,p)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||u===e.memoizedProps&&k===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||u===e.memoizedProps&&k===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=O),i.props=n,i.state=O,i.context=p,n=R):(typeof i.componentDidUpdate!="function"||u===e.memoizedProps&&k===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||u===e.memoizedProps&&k===e.memoizedState||(t.flags|=1024),n=!1)}return i=n,pc(e,t),n=(t.flags&128)!==0,i||n?(i=t.stateNode,a=n&&typeof a.getDerivedStateFromError!="function"?null:i.render(),t.flags|=1,e!==null&&n?(t.child=Mn(t,e.child,null,l),t.child=Mn(t,null,a,l)):Ut(e,t,a,l),t.memoizedState=i.state,e=t.child):e=qa(e,t,l),e}function Qd(e,t,a,n){return zn(),t.flags|=256,Ut(e,t,a,n),t.child}var hu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function pu(e){return{baseLanes:e,cachePool:Mr()}}function yu(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=sa),e}function Zd(e,t,a){var n=t.pendingProps,l=!1,i=(t.flags&128)!==0,u;if((u=i)||(u=e!==null&&e.memoizedState===null?!1:(bt.current&2)!==0),u&&(l=!0,t.flags&=-129),u=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ye){if(l?ln(t):cn(),(e=nt)?(e=tm(e,ya),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Fa!==null?{id:Ca,overflow:Ea}:null,retryLane:536870912,hydrationErrors:null},a=jr(e),a.return=t,t.child=a,Ot=t,nt=null)):e=null,e===null)throw Pa(t);return Iu(e)?t.lanes=32:t.lanes=536870912,null}var r=n.children;return n=n.fallback,l?(cn(),l=t.mode,r=yc({mode:"hidden",children:r},l),n=En(n,l,a,null),r.return=t,n.return=t,r.sibling=n,t.child=r,n=t.child,n.memoizedState=pu(a),n.childLanes=yu(e,u,a),t.memoizedState=hu,ii(null,n)):(ln(t),gu(t,r))}var p=e.memoizedState;if(p!==null&&(r=p.dehydrated,r!==null)){if(i)t.flags&256?(ln(t),t.flags&=-257,t=bu(e,t,a)):t.memoizedState!==null?(cn(),t.child=e.child,t.flags|=128,t=null):(cn(),r=n.fallback,l=t.mode,n=yc({mode:"visible",children:n.children},l),r=En(r,l,a,null),r.flags|=2,n.return=t,r.return=t,n.sibling=r,t.child=n,Mn(t,e.child,null,a),n=t.child,n.memoizedState=pu(a),n.childLanes=yu(e,u,a),t.memoizedState=hu,t=ii(null,n));else if(ln(t),Iu(r)){if(u=r.nextSibling&&r.nextSibling.dataset,u)var z=u.dgst;u=z,n=Error(d(419)),n.stack="",n.digest=u,Vl({value:n,source:null,stack:null}),t=bu(e,t,a)}else if(_t||il(e,t,a,!1),u=(a&e.childLanes)!==0,_t||u){if(u=tt,u!==null&&(n=de(u,a),n!==0&&n!==p.retryLane))throw p.retryLane=n,Cn(e,n),It(u,e,n),fu;Fu(r)||jc(),t=bu(e,t,a)}else Fu(r)?(t.flags|=192,t.child=e.child,t=null):(e=p.treeContext,nt=ba(r.nextSibling),Ot=t,Ye=!0,Ia=null,ya=!1,e!==null&&zr(t,e),t=gu(t,n.children),t.flags|=4096);return t}return l?(cn(),r=n.fallback,l=t.mode,p=e.child,z=p.sibling,n=Ma(p,{mode:"hidden",children:n.children}),n.subtreeFlags=p.subtreeFlags&65011712,z!==null?r=Ma(z,r):(r=En(r,l,a,null),r.flags|=2),r.return=t,n.return=t,n.sibling=r,t.child=n,ii(null,n),n=t.child,r=e.child.memoizedState,r===null?r=pu(a):(l=r.cachePool,l!==null?(p=xt._currentValue,l=l.parent!==p?{parent:p,pool:p}:l):l=Mr(),r={baseLanes:r.baseLanes|a,cachePool:l}),n.memoizedState=r,n.childLanes=yu(e,u,a),t.memoizedState=hu,ii(e.child,n)):(ln(t),a=e.child,e=a.sibling,a=Ma(a,{mode:"visible",children:n.children}),a.return=t,a.sibling=null,e!==null&&(u=t.deletions,u===null?(t.deletions=[e],t.flags|=16):u.push(e)),t.child=a,t.memoizedState=null,a)}function gu(e,t){return t=yc({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function yc(e,t){return e=na(22,e,null,t),e.lanes=0,e}function bu(e,t,a){return Mn(t,e.child,null,a),e=gu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Vd(e,t,a){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Os(e.return,t,a)}function vu(e,t,a,n,l,i){var u=e.memoizedState;u===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:a,tailMode:l,treeForkCount:i}:(u.isBackwards=t,u.rendering=null,u.renderingStartTime=0,u.last=n,u.tail=a,u.tailMode=l,u.treeForkCount=i)}function Jd(e,t,a){var n=t.pendingProps,l=n.revealOrder,i=n.tail;n=n.children;var u=bt.current,r=(u&2)!==0;if(r?(u=u&1|2,t.flags|=128):u&=1,Z(bt,u),Ut(e,t,n,a),n=Ye?Zl:0,!r&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Vd(e,a,t);else if(e.tag===19)Vd(e,a,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}switch(l){case"forwards":for(a=t.child,l=null;a!==null;)e=a.alternate,e!==null&&lc(e)===null&&(l=a),a=a.sibling;a=l,a===null?(l=t.child,t.child=null):(l=a.sibling,a.sibling=null),vu(t,!1,l,a,i,n);break;case"backwards":case"unstable_legacy-backwards":for(a=null,l=t.child,t.child=null;l!==null;){if(e=l.alternate,e!==null&&lc(e)===null){t.child=l;break}e=l.sibling,l.sibling=a,a=l,l=e}vu(t,!0,a,null,i,n);break;case"together":vu(t,!1,null,null,void 0,n);break;default:t.memoizedState=null}return t.child}function qa(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),on|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(il(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(d(153));if(t.child!==null){for(e=t.child,a=Ma(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Ma(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Su(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Wi(e)))}function bp(e,t,a){switch(t.tag){case 3:et(t,t.stateNode.containerInfo),en(t,xt,e.memoizedState.cache),zn();break;case 27:case 5:Lt(t);break;case 4:et(t,t.stateNode.containerInfo);break;case 10:en(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Qs(t),null;break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(ln(t),t.flags|=128,null):(a&t.child.childLanes)!==0?Zd(e,t,a):(ln(t),e=qa(e,t,a),e!==null?e.sibling:null);ln(t);break;case 19:var l=(e.flags&128)!==0;if(n=(a&t.childLanes)!==0,n||(il(e,t,a,!1),n=(a&t.childLanes)!==0),l){if(n)return Jd(e,t,a);t.flags|=128}if(l=t.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),Z(bt,bt.current),n)break;return null;case 22:return t.lanes=0,qd(e,t,a,t.pendingProps);case 24:en(t,xt,e.memoizedState.cache)}return qa(e,t,a)}function Kd(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)_t=!0;else{if(!Su(e,a)&&(t.flags&128)===0)return _t=!1,bp(e,t,a);_t=(e.flags&131072)!==0}else _t=!1,Ye&&(t.flags&1048576)!==0&&Er(t,Zl,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=Dn(t.elementType),t.type=e,typeof e=="function")js(e)?(n=Rn(e,n),t.tag=1,t=Xd(null,t,e,n,a)):(t.tag=0,t=mu(null,t,e,n,a));else{if(e!=null){var l=e.$$typeof;if(l===ce){t.tag=11,t=Hd(null,t,e,n,a);break e}else if(l===X){t.tag=14,t=Bd(null,t,e,n,a);break e}}throw t=Oe(e)||e,Error(d(306,t,""))}}return t;case 0:return mu(e,t,t.type,t.pendingProps,a);case 1:return n=t.type,l=Rn(n,t.pendingProps),Xd(e,t,n,l,a);case 3:e:{if(et(t,t.stateNode.containerInfo),e===null)throw Error(d(387));n=t.pendingProps;var i=t.memoizedState;l=i.element,qs(e,t),ei(t,n,null,a);var u=t.memoizedState;if(n=u.cache,en(t,xt,n),n!==i.cache&&Ms(t,[xt],a,!0),Pl(),n=u.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:u.cache},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){t=Qd(e,t,n,a);break e}else if(n!==l){l=ma(Error(d(424)),t),Vl(l),t=Qd(e,t,n,a);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(nt=ba(e.firstChild),Ot=t,Ye=!0,Ia=null,ya=!0,a=qr(t,null,n,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(zn(),n===l){t=qa(e,t,a);break e}Ut(e,t,n,a)}t=t.child}return t;case 26:return pc(e,t),e===null?(a=sm(t.type,null,t.pendingProps,null))?t.memoizedState=a:Ye||(a=t.type,e=t.pendingProps,n=Dc(ge.current).createElement(a),n[Dt]=t,n[Zt]=e,Rt(n,a,e),kt(n),t.stateNode=n):t.memoizedState=sm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Lt(t),e===null&&Ye&&(n=t.stateNode=lm(t.type,t.pendingProps,ge.current),Ot=t,ya=!0,l=nt,hn(t.type)?(Pu=l,nt=ba(n.firstChild)):nt=l),Ut(e,t,t.pendingProps.children,a),pc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ye&&((l=n=nt)&&(n=Jp(n,t.type,t.pendingProps,ya),n!==null?(t.stateNode=n,Ot=t,nt=ba(n.firstChild),ya=!1,l=!0):l=!1),l||Pa(t)),Lt(t),l=t.type,i=t.pendingProps,u=e!==null?e.memoizedProps:null,n=i.children,Ju(l,i)?n=null:u!==null&&Ju(l,u)&&(t.flags|=32),t.memoizedState!==null&&(l=Vs(e,t,op,null,null,a),Si._currentValue=l),pc(e,t),Ut(e,t,n,a),t.child;case 6:return e===null&&Ye&&((e=a=nt)&&(a=Kp(a,t.pendingProps,ya),a!==null?(t.stateNode=a,Ot=t,nt=null,e=!0):e=!1),e||Pa(t)),null;case 13:return Zd(e,t,a);case 4:return et(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Mn(t,null,n,a):Ut(e,t,n,a),t.child;case 11:return Hd(e,t,t.type,t.pendingProps,a);case 7:return Ut(e,t,t.pendingProps,a),t.child;case 8:return Ut(e,t,t.pendingProps.children,a),t.child;case 12:return Ut(e,t,t.pendingProps.children,a),t.child;case 10:return n=t.pendingProps,en(t,t.type,n.value),Ut(e,t,n.children,a),t.child;case 9:return l=t.type._context,n=t.pendingProps.children,An(t),l=Mt(l),n=n(l),t.flags|=1,Ut(e,t,n,a),t.child;case 14:return Bd(e,t,t.type,t.pendingProps,a);case 15:return Ld(e,t,t.type,t.pendingProps,a);case 19:return Jd(e,t,a);case 31:return gp(e,t,a);case 22:return qd(e,t,a,t.pendingProps);case 24:return An(t),n=Mt(xt),e===null?(l=Hs(),l===null&&(l=tt,i=Us(),l.pooledCache=i,i.refCount++,i!==null&&(l.pooledCacheLanes|=a),l=i),t.memoizedState={parent:n,cache:l},Ls(t),en(t,xt,l)):((e.lanes&a)!==0&&(qs(e,t),ei(t,null,null,a),Pl()),l=e.memoizedState,i=t.memoizedState,l.parent!==n?(l={parent:n,cache:n},t.memoizedState=l,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=l),en(t,xt,n)):(n=i.cache,en(t,xt,n),n!==l.cache&&Ms(t,[xt],a,!0))),Ut(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(d(156,t.tag))}function Ya(e){e.flags|=4}function xu(e,t,a,n,l){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(l&335544128)===l)if(e.stateNode.complete)e.flags|=8192;else if(_f())e.flags|=8192;else throw On=ec,Bs}else e.flags&=-16777217}function Wd(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!fm(t))if(_f())e.flags|=8192;else throw On=ec,Bs}function gc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ml():536870912,e.lanes|=t,gl|=t)}function ci(e,t){if(!Ye)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var n=null;a!==null;)a.alternate!==null&&(n=a),a=a.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function lt(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,n=0;if(t)for(var l=e.child;l!==null;)a|=l.lanes|l.childLanes,n|=l.subtreeFlags&65011712,n|=l.flags&65011712,l.return=e,l=l.sibling;else for(l=e.child;l!==null;)a|=l.lanes|l.childLanes,n|=l.subtreeFlags,n|=l.flags,l.return=e,l=l.sibling;return e.subtreeFlags|=n,e.childLanes=a,t}function vp(e,t,a){var n=t.pendingProps;switch(ks(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return lt(t),null;case 1:return lt(t),null;case 3:return a=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ha(xt),qe(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(ll(t)?Ya(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Ns())),lt(t),null;case 26:var l=t.type,i=t.memoizedState;return e===null?(Ya(t),i!==null?(lt(t),Wd(t,i)):(lt(t),xu(t,l,null,n,a))):i?i!==e.memoizedState?(Ya(t),lt(t),Wd(t,i)):(lt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&Ya(t),lt(t),xu(t,l,e,n,a)),null;case 27:if(pt(t),a=ge.current,l=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Ya(t);else{if(!n){if(t.stateNode===null)throw Error(d(166));return lt(t),null}e=F.current,ll(t)?kr(t):(e=lm(l,n,a),t.stateNode=e,Ya(t))}return lt(t),null;case 5:if(pt(t),l=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Ya(t);else{if(!n){if(t.stateNode===null)throw Error(d(166));return lt(t),null}if(i=F.current,ll(t))kr(t);else{var u=Dc(ge.current);switch(i){case 1:i=u.createElementNS("http://www.w3.org/2000/svg",l);break;case 2:i=u.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;default:switch(l){case"svg":i=u.createElementNS("http://www.w3.org/2000/svg",l);break;case"math":i=u.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;case"script":i=u.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof n.is=="string"?u.createElement("select",{is:n.is}):u.createElement("select"),n.multiple?i.multiple=!0:n.size&&(i.size=n.size);break;default:i=typeof n.is=="string"?u.createElement(l,{is:n.is}):u.createElement(l)}}i[Dt]=t,i[Zt]=n;e:for(u=t.child;u!==null;){if(u.tag===5||u.tag===6)i.appendChild(u.stateNode);else if(u.tag!==4&&u.tag!==27&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===t)break e;for(;u.sibling===null;){if(u.return===null||u.return===t)break e;u=u.return}u.sibling.return=u.return,u=u.sibling}t.stateNode=i;e:switch(Rt(i,l,n),l){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&Ya(t)}}return lt(t),xu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&Ya(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(d(166));if(e=ge.current,ll(t)){if(e=t.stateNode,a=t.memoizedProps,n=null,l=Ot,l!==null)switch(l.tag){case 27:case 5:n=l.memoizedProps}e[Dt]=t,e=!!(e.nodeValue===a||n!==null&&n.suppressHydrationWarning===!0||Vf(e.nodeValue,a)),e||Pa(t,!0)}else e=Dc(e).createTextNode(n),e[Dt]=t,t.stateNode=e}return lt(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(n=ll(t),a!==null){if(e===null){if(!n)throw Error(d(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(d(557));e[Dt]=t}else zn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;lt(t),e=!1}else a=Ns(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(ia(t),t):(ia(t),null);if((t.flags&128)!==0)throw Error(d(558))}return lt(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(l=ll(t),n!==null&&n.dehydrated!==null){if(e===null){if(!l)throw Error(d(318));if(l=t.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(d(317));l[Dt]=t}else zn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;lt(t),l=!1}else l=Ns(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),l=!0;if(!l)return t.flags&256?(ia(t),t):(ia(t),null)}return ia(t),(t.flags&128)!==0?(t.lanes=a,t):(a=n!==null,e=e!==null&&e.memoizedState!==null,a&&(n=t.child,l=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(l=n.alternate.memoizedState.cachePool.pool),i=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(i=n.memoizedState.cachePool.pool),i!==l&&(n.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),gc(t,t.updateQueue),lt(t),null);case 4:return qe(),e===null&&$u(t.stateNode.containerInfo),lt(t),null;case 10:return Ha(t.type),lt(t),null;case 19:if(S(bt),n=t.memoizedState,n===null)return lt(t),null;if(l=(t.flags&128)!==0,i=n.rendering,i===null)if(l)ci(n,!1);else{if(ht!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(i=lc(e),i!==null){for(t.flags|=128,ci(n,!1),e=i.updateQueue,t.updateQueue=e,gc(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)Tr(a,e),a=a.sibling;return Z(bt,bt.current&1|2),Ye&&Ua(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&rt()>wc&&(t.flags|=128,l=!0,ci(n,!1),t.lanes=4194304)}else{if(!l)if(e=lc(i),e!==null){if(t.flags|=128,l=!0,e=e.updateQueue,t.updateQueue=e,gc(t,e),ci(n,!0),n.tail===null&&n.tailMode==="hidden"&&!i.alternate&&!Ye)return lt(t),null}else 2*rt()-n.renderingStartTime>wc&&a!==536870912&&(t.flags|=128,l=!0,ci(n,!1),t.lanes=4194304);n.isBackwards?(i.sibling=t.child,t.child=i):(e=n.last,e!==null?e.sibling=i:t.child=i,n.last=i)}return n.tail!==null?(e=n.tail,n.rendering=e,n.tail=e.sibling,n.renderingStartTime=rt(),e.sibling=null,a=bt.current,Z(bt,l?a&1|2:a&1),Ye&&Ua(t,n.treeForkCount),e):(lt(t),null);case 22:case 23:return ia(t),Xs(),n=t.memoizedState!==null,e!==null?e.memoizedState!==null!==n&&(t.flags|=8192):n&&(t.flags|=8192),n?(a&536870912)!==0&&(t.flags&128)===0&&(lt(t),t.subtreeFlags&6&&(t.flags|=8192)):lt(t),a=t.updateQueue,a!==null&&gc(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),n=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),n!==a&&(t.flags|=2048),e!==null&&S(Nn),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Ha(xt),lt(t),null;case 25:return null;case 30:return null}throw Error(d(156,t.tag))}function Sp(e,t){switch(ks(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ha(xt),qe(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return pt(t),null;case 31:if(t.memoizedState!==null){if(ia(t),t.alternate===null)throw Error(d(340));zn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ia(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(d(340));zn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return S(bt),null;case 4:return qe(),null;case 10:return Ha(t.type),null;case 22:case 23:return ia(t),Xs(),e!==null&&S(Nn),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ha(xt),null;case 25:return null;default:return null}}function Fd(e,t){switch(ks(t),t.tag){case 3:Ha(xt),qe();break;case 26:case 27:case 5:pt(t);break;case 4:qe();break;case 31:t.memoizedState!==null&&ia(t);break;case 13:ia(t);break;case 19:S(bt);break;case 10:Ha(t.type);break;case 22:case 23:ia(t),Xs(),e!==null&&S(Nn);break;case 24:Ha(xt)}}function si(e,t){try{var a=t.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var l=n.next;a=l;do{if((a.tag&e)===e){n=void 0;var i=a.create,u=a.inst;n=i(),u.destroy=n}a=a.next}while(a!==l)}}catch(r){We(t,t.return,r)}}function sn(e,t,a){try{var n=t.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var i=l.next;n=i;do{if((n.tag&e)===e){var u=n.inst,r=u.destroy;if(r!==void 0){u.destroy=void 0,l=t;var p=a,z=r;try{z()}catch(R){We(l,p,R)}}}n=n.next}while(n!==i)}}catch(R){We(t,t.return,R)}}function Id(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{Gr(t,a)}catch(n){We(e,e.return,n)}}}function Pd(e,t,a){a.props=Rn(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(n){We(e,t,n)}}function ui(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var n=e.stateNode;break;case 30:n=e.stateNode;break;default:n=e.stateNode}typeof a=="function"?e.refCleanup=a(n):a.current=n}}catch(l){We(e,t,l)}}function za(e,t){var a=e.ref,n=e.refCleanup;if(a!==null)if(typeof n=="function")try{n()}catch(l){We(e,t,l)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(l){We(e,t,l)}else a.current=null}function ef(e){var t=e.type,a=e.memoizedProps,n=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break e;case"img":a.src?n.src=a.src:a.srcSet&&(n.srcset=a.srcSet)}}catch(l){We(e,e.return,l)}}function wu(e,t,a){try{var n=e.stateNode;Gp(n,e.type,a,t),n[Zt]=t}catch(l){We(e,e.return,l)}}function tf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&hn(e.type)||e.tag===4}function _u(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||tf(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.tag===27&&hn(e.type)||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 Tu(e,t,a){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=Da));else if(n!==4&&(n===27&&hn(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(Tu(e,t,a),e=e.sibling;e!==null;)Tu(e,t,a),e=e.sibling}function bc(e,t,a){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(n!==4&&(n===27&&hn(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(bc(e,t,a),e=e.sibling;e!==null;)bc(e,t,a),e=e.sibling}function af(e){var t=e.stateNode,a=e.memoizedProps;try{for(var n=e.type,l=t.attributes;l.length;)t.removeAttributeNode(l[0]);Rt(t,n,a),t[Dt]=e,t[Zt]=a}catch(i){We(e,e.return,i)}}var Ga=!1,Tt=!1,ju=!1,nf=typeof WeakSet=="function"?WeakSet:Set,At=null;function xp(e,t){if(e=e.containerInfo,Zu=Lc,e=pr(e),gs(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var n=a.getSelection&&a.getSelection();if(n&&n.rangeCount!==0){a=n.anchorNode;var l=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{a.nodeType,i.nodeType}catch{a=null;break e}var u=0,r=-1,p=-1,z=0,R=0,G=e,k=null;t:for(;;){for(var O;G!==a||l!==0&&G.nodeType!==3||(r=u+l),G!==i||n!==0&&G.nodeType!==3||(p=u+n),G.nodeType===3&&(u+=G.nodeValue.length),(O=G.firstChild)!==null;)k=G,G=O;for(;;){if(G===e)break t;if(k===a&&++z===l&&(r=u),k===i&&++R===n&&(p=u),(O=G.nextSibling)!==null)break;G=k,k=G.parentNode}G=O}a=r===-1||p===-1?null:{start:r,end:p}}else a=null}a=a||{start:0,end:0}}else a=null;for(Vu={focusedElem:e,selectionRange:a},Lc=!1,At=t;At!==null;)if(t=At,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,At=e;else for(;At!==null;){switch(t=At,i=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)l=e[a],l.ref.impl=l.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&i!==null){e=void 0,a=t,l=i.memoizedProps,i=i.memoizedState,n=a.stateNode;try{var fe=Rn(a.type,l);e=n.getSnapshotBeforeUpdate(fe,i),n.__reactInternalSnapshotBeforeUpdate=e}catch(xe){We(a,a.return,xe)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)Wu(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Wu(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(d(163))}if(e=t.sibling,e!==null){e.return=t.return,At=e;break}At=t.return}}function lf(e,t,a){var n=a.flags;switch(a.tag){case 0:case 11:case 15:Xa(e,a),n&4&&si(5,a);break;case 1:if(Xa(e,a),n&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(u){We(a,a.return,u)}else{var l=Rn(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(l,t,e.__reactInternalSnapshotBeforeUpdate)}catch(u){We(a,a.return,u)}}n&64&&Id(a),n&512&&ui(a,a.return);break;case 3:if(Xa(e,a),n&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{Gr(e,t)}catch(u){We(a,a.return,u)}}break;case 27:t===null&&n&4&&af(a);case 26:case 5:Xa(e,a),t===null&&n&4&&ef(a),n&512&&ui(a,a.return);break;case 12:Xa(e,a);break;case 31:Xa(e,a),n&4&&uf(e,a);break;case 13:Xa(e,a),n&4&&of(e,a),n&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=Ap.bind(null,a),Wp(e,a))));break;case 22:if(n=a.memoizedState!==null||Ga,!n){t=t!==null&&t.memoizedState!==null||Tt,l=Ga;var i=Tt;Ga=n,(Tt=t)&&!i?Qa(e,a,(a.subtreeFlags&8772)!==0):Xa(e,a),Ga=l,Tt=i}break;case 30:break;default:Xa(e,a)}}function cf(e){var t=e.alternate;t!==null&&(e.alternate=null,cf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&es(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var it=null,Jt=!1;function $a(e,t,a){for(a=a.child;a!==null;)sf(e,t,a),a=a.sibling}function sf(e,t,a){if(q&&typeof q.onCommitFiberUnmount=="function")try{q.onCommitFiberUnmount(N,a)}catch{}switch(a.tag){case 26:Tt||za(a,t),$a(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Tt||za(a,t);var n=it,l=Jt;hn(a.type)&&(it=a.stateNode,Jt=!1),$a(e,t,a),gi(a.stateNode),it=n,Jt=l;break;case 5:Tt||za(a,t);case 6:if(n=it,l=Jt,it=null,$a(e,t,a),it=n,Jt=l,it!==null)if(Jt)try{(it.nodeType===9?it.body:it.nodeName==="HTML"?it.ownerDocument.body:it).removeChild(a.stateNode)}catch(i){We(a,t,i)}else try{it.removeChild(a.stateNode)}catch(i){We(a,t,i)}break;case 18:it!==null&&(Jt?(e=it,Pf(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),jl(e)):Pf(it,a.stateNode));break;case 4:n=it,l=Jt,it=a.stateNode.containerInfo,Jt=!0,$a(e,t,a),it=n,Jt=l;break;case 0:case 11:case 14:case 15:sn(2,a,t),Tt||sn(4,a,t),$a(e,t,a);break;case 1:Tt||(za(a,t),n=a.stateNode,typeof n.componentWillUnmount=="function"&&Pd(a,t,n)),$a(e,t,a);break;case 21:$a(e,t,a);break;case 22:Tt=(n=Tt)||a.memoizedState!==null,$a(e,t,a),Tt=n;break;default:$a(e,t,a)}}function uf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{jl(e)}catch(a){We(t,t.return,a)}}}function of(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{jl(e)}catch(a){We(t,t.return,a)}}function wp(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new nf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new nf),t;default:throw Error(d(435,e.tag))}}function vc(e,t){var a=wp(e);t.forEach(function(n){if(!a.has(n)){a.add(n);var l=Np.bind(null,e,n);n.then(l,l)}})}function Kt(e,t){var a=t.deletions;if(a!==null)for(var n=0;n<a.length;n++){var l=a[n],i=e,u=t,r=u;e:for(;r!==null;){switch(r.tag){case 27:if(hn(r.type)){it=r.stateNode,Jt=!1;break e}break;case 5:it=r.stateNode,Jt=!1;break e;case 3:case 4:it=r.stateNode.containerInfo,Jt=!0;break e}r=r.return}if(it===null)throw Error(d(160));sf(i,u,l),it=null,Jt=!1,i=l.alternate,i!==null&&(i.return=null),l.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)rf(t,e),t=t.sibling}var _a=null;function rf(e,t){var a=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Kt(t,e),Wt(e),n&4&&(sn(3,e,e.return),si(3,e),sn(5,e,e.return));break;case 1:Kt(t,e),Wt(e),n&512&&(Tt||a===null||za(a,a.return)),n&64&&Ga&&(e=e.updateQueue,e!==null&&(n=e.callbacks,n!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?n:a.concat(n))));break;case 26:var l=_a;if(Kt(t,e),Wt(e),n&512&&(Tt||a===null||za(a,a.return)),n&4){var i=a!==null?a.memoizedState:null;if(n=e.memoizedState,a===null)if(n===null)if(e.stateNode===null){e:{n=e.type,a=e.memoizedProps,l=l.ownerDocument||l;t:switch(n){case"title":i=l.getElementsByTagName("title")[0],(!i||i[Ul]||i[Dt]||i.namespaceURI==="http://www.w3.org/2000/svg"||i.hasAttribute("itemprop"))&&(i=l.createElement(n),l.head.insertBefore(i,l.querySelector("head > title"))),Rt(i,n,a),i[Dt]=e,kt(i),n=i;break e;case"link":var u=rm("link","href",l).get(n+(a.href||""));if(u){for(var r=0;r<u.length;r++)if(i=u[r],i.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&i.getAttribute("rel")===(a.rel==null?null:a.rel)&&i.getAttribute("title")===(a.title==null?null:a.title)&&i.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){u.splice(r,1);break t}}i=l.createElement(n),Rt(i,n,a),l.head.appendChild(i);break;case"meta":if(u=rm("meta","content",l).get(n+(a.content||""))){for(r=0;r<u.length;r++)if(i=u[r],i.getAttribute("content")===(a.content==null?null:""+a.content)&&i.getAttribute("name")===(a.name==null?null:a.name)&&i.getAttribute("property")===(a.property==null?null:a.property)&&i.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&i.getAttribute("charset")===(a.charSet==null?null:a.charSet)){u.splice(r,1);break t}}i=l.createElement(n),Rt(i,n,a),l.head.appendChild(i);break;default:throw Error(d(468,n))}i[Dt]=e,kt(i),n=i}e.stateNode=n}else dm(l,e.type,e.stateNode);else e.stateNode=om(l,n,e.memoizedProps);else i!==n?(i===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):i.count--,n===null?dm(l,e.type,e.stateNode):om(l,n,e.memoizedProps)):n===null&&e.stateNode!==null&&wu(e,e.memoizedProps,a.memoizedProps)}break;case 27:Kt(t,e),Wt(e),n&512&&(Tt||a===null||za(a,a.return)),a!==null&&n&4&&wu(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Kt(t,e),Wt(e),n&512&&(Tt||a===null||za(a,a.return)),e.flags&32){l=e.stateNode;try{Jn(l,"")}catch(fe){We(e,e.return,fe)}}n&4&&e.stateNode!=null&&(l=e.memoizedProps,wu(e,l,a!==null?a.memoizedProps:l)),n&1024&&(ju=!0);break;case 6:if(Kt(t,e),Wt(e),n&4){if(e.stateNode===null)throw Error(d(162));n=e.memoizedProps,a=e.stateNode;try{a.nodeValue=n}catch(fe){We(e,e.return,fe)}}break;case 3:if(Uc=null,l=_a,_a=Oc(t.containerInfo),Kt(t,e),_a=l,Wt(e),n&4&&a!==null&&a.memoizedState.isDehydrated)try{jl(t.containerInfo)}catch(fe){We(e,e.return,fe)}ju&&(ju=!1,df(e));break;case 4:n=_a,_a=Oc(e.stateNode.containerInfo),Kt(t,e),Wt(e),_a=n;break;case 12:Kt(t,e),Wt(e);break;case 31:Kt(t,e),Wt(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,vc(e,n)));break;case 13:Kt(t,e),Wt(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(xc=rt()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,vc(e,n)));break;case 22:l=e.memoizedState!==null;var p=a!==null&&a.memoizedState!==null,z=Ga,R=Tt;if(Ga=z||l,Tt=R||p,Kt(t,e),Tt=R,Ga=z,Wt(e),n&8192)e:for(t=e.stateNode,t._visibility=l?t._visibility&-2:t._visibility|1,l&&(a===null||p||Ga||Tt||Hn(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){p=a=t;try{if(i=p.stateNode,l)u=i.style,typeof u.setProperty=="function"?u.setProperty("display","none","important"):u.display="none";else{r=p.stateNode;var G=p.memoizedProps.style,k=G!=null&&G.hasOwnProperty("display")?G.display:null;r.style.display=k==null||typeof k=="boolean"?"":(""+k).trim()}}catch(fe){We(p,p.return,fe)}}}else if(t.tag===6){if(a===null){p=t;try{p.stateNode.nodeValue=l?"":p.memoizedProps}catch(fe){We(p,p.return,fe)}}}else if(t.tag===18){if(a===null){p=t;try{var O=p.stateNode;l?em(O,!0):em(p.stateNode,!1)}catch(fe){We(p,p.return,fe)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}n&4&&(n=e.updateQueue,n!==null&&(a=n.retryQueue,a!==null&&(n.retryQueue=null,vc(e,a))));break;case 19:Kt(t,e),Wt(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,vc(e,n)));break;case 30:break;case 21:break;default:Kt(t,e),Wt(e)}}function Wt(e){var t=e.flags;if(t&2){try{for(var a,n=e.return;n!==null;){if(tf(n)){a=n;break}n=n.return}if(a==null)throw Error(d(160));switch(a.tag){case 27:var l=a.stateNode,i=_u(e);bc(e,i,l);break;case 5:var u=a.stateNode;a.flags&32&&(Jn(u,""),a.flags&=-33);var r=_u(e);bc(e,r,u);break;case 3:case 4:var p=a.stateNode.containerInfo,z=_u(e);Tu(e,z,p);break;default:throw Error(d(161))}}catch(R){We(e,e.return,R)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function df(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;df(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Xa(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)lf(e,t.alternate,t),t=t.sibling}function Hn(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:sn(4,t,t.return),Hn(t);break;case 1:za(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&Pd(t,t.return,a),Hn(t);break;case 27:gi(t.stateNode);case 26:case 5:za(t,t.return),Hn(t);break;case 22:t.memoizedState===null&&Hn(t);break;case 30:Hn(t);break;default:Hn(t)}e=e.sibling}}function Qa(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var n=t.alternate,l=e,i=t,u=i.flags;switch(i.tag){case 0:case 11:case 15:Qa(l,i,a),si(4,i);break;case 1:if(Qa(l,i,a),n=i,l=n.stateNode,typeof l.componentDidMount=="function")try{l.componentDidMount()}catch(z){We(n,n.return,z)}if(n=i,l=n.updateQueue,l!==null){var r=n.stateNode;try{var p=l.shared.hiddenCallbacks;if(p!==null)for(l.shared.hiddenCallbacks=null,l=0;l<p.length;l++)Yr(p[l],r)}catch(z){We(n,n.return,z)}}a&&u&64&&Id(i),ui(i,i.return);break;case 27:af(i);case 26:case 5:Qa(l,i,a),a&&n===null&&u&4&&ef(i),ui(i,i.return);break;case 12:Qa(l,i,a);break;case 31:Qa(l,i,a),a&&u&4&&uf(l,i);break;case 13:Qa(l,i,a),a&&u&4&&of(l,i);break;case 22:i.memoizedState===null&&Qa(l,i,a),ui(i,i.return);break;case 30:break;default:Qa(l,i,a)}t=t.sibling}}function Cu(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&Jl(a))}function Eu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Jl(e))}function Ta(e,t,a,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)ff(e,t,a,n),t=t.sibling}function ff(e,t,a,n){var l=t.flags;switch(t.tag){case 0:case 11:case 15:Ta(e,t,a,n),l&2048&&si(9,t);break;case 1:Ta(e,t,a,n);break;case 3:Ta(e,t,a,n),l&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Jl(e)));break;case 12:if(l&2048){Ta(e,t,a,n),e=t.stateNode;try{var i=t.memoizedProps,u=i.id,r=i.onPostCommit;typeof r=="function"&&r(u,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(p){We(t,t.return,p)}}else Ta(e,t,a,n);break;case 31:Ta(e,t,a,n);break;case 13:Ta(e,t,a,n);break;case 23:break;case 22:i=t.stateNode,u=t.alternate,t.memoizedState!==null?i._visibility&2?Ta(e,t,a,n):oi(e,t):i._visibility&2?Ta(e,t,a,n):(i._visibility|=2,hl(e,t,a,n,(t.subtreeFlags&10256)!==0||!1)),l&2048&&Cu(u,t);break;case 24:Ta(e,t,a,n),l&2048&&Eu(t.alternate,t);break;default:Ta(e,t,a,n)}}function hl(e,t,a,n,l){for(l=l&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var i=e,u=t,r=a,p=n,z=u.flags;switch(u.tag){case 0:case 11:case 15:hl(i,u,r,p,l),si(8,u);break;case 23:break;case 22:var R=u.stateNode;u.memoizedState!==null?R._visibility&2?hl(i,u,r,p,l):oi(i,u):(R._visibility|=2,hl(i,u,r,p,l)),l&&z&2048&&Cu(u.alternate,u);break;case 24:hl(i,u,r,p,l),l&&z&2048&&Eu(u.alternate,u);break;default:hl(i,u,r,p,l)}t=t.sibling}}function oi(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,n=t,l=n.flags;switch(n.tag){case 22:oi(a,n),l&2048&&Cu(n.alternate,n);break;case 24:oi(a,n),l&2048&&Eu(n.alternate,n);break;default:oi(a,n)}t=t.sibling}}var ri=8192;function pl(e,t,a){if(e.subtreeFlags&ri)for(e=e.child;e!==null;)mf(e,t,a),e=e.sibling}function mf(e,t,a){switch(e.tag){case 26:pl(e,t,a),e.flags&ri&&e.memoizedState!==null&&uy(a,_a,e.memoizedState,e.memoizedProps);break;case 5:pl(e,t,a);break;case 3:case 4:var n=_a;_a=Oc(e.stateNode.containerInfo),pl(e,t,a),_a=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=ri,ri=16777216,pl(e,t,a),ri=n):pl(e,t,a));break;default:pl(e,t,a)}}function hf(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function di(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var n=t[a];At=n,yf(n,e)}hf(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)pf(e),e=e.sibling}function pf(e){switch(e.tag){case 0:case 11:case 15:di(e),e.flags&2048&&sn(9,e,e.return);break;case 3:di(e);break;case 12:di(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Sc(e)):di(e);break;default:di(e)}}function Sc(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var n=t[a];At=n,yf(n,e)}hf(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:sn(8,t,t.return),Sc(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Sc(t));break;default:Sc(t)}e=e.sibling}}function yf(e,t){for(;At!==null;){var a=At;switch(a.tag){case 0:case 11:case 15:sn(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var n=a.memoizedState.cachePool.pool;n!=null&&n.refCount++}break;case 24:Jl(a.memoizedState.cache)}if(n=a.child,n!==null)n.return=a,At=n;else e:for(a=e;At!==null;){n=At;var l=n.sibling,i=n.return;if(cf(n),n===a){At=null;break e}if(l!==null){l.return=i,At=l;break e}At=i}}}var _p={getCacheForType:function(e){var t=Mt(xt),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return Mt(xt).controller.signal}},Tp=typeof WeakMap=="function"?WeakMap:Map,Ve=0,tt=null,Re=null,Be=0,Ke=0,ca=null,un=!1,yl=!1,zu=!1,Za=0,ht=0,on=0,Bn=0,ku=0,sa=0,gl=0,fi=null,Ft=null,Au=!1,xc=0,gf=0,wc=1/0,_c=null,rn=null,Ct=0,dn=null,bl=null,Va=0,Nu=0,Du=null,bf=null,mi=0,Ou=null;function ua(){return(Ve&2)!==0&&Be!==0?Be&-Be:D.T!==null?Lu():ta()}function vf(){if(sa===0)if((Be&536870912)===0||Ye){var e=st;st<<=1,(st&3932160)===0&&(st=262144),sa=e}else sa=536870912;return e=la.current,e!==null&&(e.flags|=32),sa}function It(e,t,a){(e===tt&&(Ke===2||Ke===9)||e.cancelPendingCommit!==null)&&(vl(e,0),fn(e,Be,sa,!1)),H(e,a),((Ve&2)===0||e!==tt)&&(e===tt&&((Ve&2)===0&&(Bn|=a),ht===4&&fn(e,Be,sa,!1)),ka(e))}function Sf(e,t,a){if((Ve&6)!==0)throw Error(d(327));var n=!a&&(t&127)===0&&(t&e.expiredLanes)===0||ft(e,t),l=n?Ep(e,t):Uu(e,t,!0),i=n;do{if(l===0){yl&&!n&&fn(e,t,0,!1);break}else{if(a=e.current.alternate,i&&!jp(a)){l=Uu(e,t,!1),i=!1;continue}if(l===2){if(i=t,e.errorRecoveryDisabledLanes&i)var u=0;else u=e.pendingLanes&-536870913,u=u!==0?u:u&536870912?536870912:0;if(u!==0){t=u;e:{var r=e;l=fi;var p=r.current.memoizedState.isDehydrated;if(p&&(vl(r,u).flags|=256),u=Uu(r,u,!1),u!==2){if(zu&&!p){r.errorRecoveryDisabledLanes|=i,Bn|=i,l=4;break e}i=Ft,Ft=l,i!==null&&(Ft===null?Ft=i:Ft.push.apply(Ft,i))}l=u}if(i=!1,l!==2)continue}}if(l===1){vl(e,0),fn(e,t,0,!0);break}e:{switch(n=e,i=l,i){case 0:case 1:throw Error(d(345));case 4:if((t&4194048)!==t)break;case 6:fn(n,t,sa,!un);break e;case 2:Ft=null;break;case 3:case 5:break;default:throw Error(d(329))}if((t&62914560)===t&&(l=xc+300-rt(),10<l)){if(fn(n,t,sa,!un),Ee(n,0,!0)!==0)break e;Va=t,n.timeoutHandle=Ff(xf.bind(null,n,a,Ft,_c,Au,t,sa,Bn,gl,un,i,"Throttled",-0,0),l);break e}xf(n,a,Ft,_c,Au,t,sa,Bn,gl,un,i,null,-0,0)}}break}while(!0);ka(e)}function xf(e,t,a,n,l,i,u,r,p,z,R,G,k,O){if(e.timeoutHandle=-1,G=t.subtreeFlags,G&8192||(G&16785408)===16785408){G={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Da},mf(t,i,G);var fe=(i&62914560)===i?xc-rt():(i&4194048)===i?gf-rt():0;if(fe=oy(G,fe),fe!==null){Va=i,e.cancelPendingCommit=fe(kf.bind(null,e,t,i,a,n,l,u,r,p,R,G,null,k,O)),fn(e,i,u,!z);return}}kf(e,t,i,a,n,l,u,r,p)}function jp(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var n=0;n<a.length;n++){var l=a[n],i=l.getSnapshot;l=l.value;try{if(!aa(i(),l))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;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 fn(e,t,a,n){t&=~ku,t&=~Bn,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var l=t;0<l;){var i=31-te(l),u=1<<i;n[i]=-1,l&=~u}a!==0&&ne(e,a,t)}function Tc(){return(Ve&6)===0?(hi(0),!1):!0}function Mu(){if(Re!==null){if(Ke===0)var e=Re.return;else e=Re,Ra=kn=null,Ws(e),ol=null,Wl=0,e=Re;for(;e!==null;)Fd(e.alternate,e),e=e.return;Re=null}}function vl(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,Qp(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),Va=0,Mu(),tt=e,Re=a=Ma(e.current,null),Be=t,Ke=0,ca=null,un=!1,yl=ft(e,t),zu=!1,gl=sa=ku=Bn=on=ht=0,Ft=fi=null,Au=!1,(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var l=31-te(n),i=1<<l;t|=e[l],n&=~i}return Za=t,Qi(),a}function wf(e,t){ke=null,D.H=li,t===ul||t===Pi?(t=Hr(),Ke=3):t===Bs?(t=Hr(),Ke=4):Ke=t===fu?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,ca=t,Re===null&&(ht=1,mc(e,ma(t,e.current)))}function _f(){var e=la.current;return e===null?!0:(Be&4194048)===Be?ga===null:(Be&62914560)===Be||(Be&536870912)!==0?e===ga:!1}function Tf(){var e=D.H;return D.H=li,e===null?li:e}function jf(){var e=D.A;return D.A=_p,e}function jc(){ht=4,un||(Be&4194048)!==Be&&la.current!==null||(yl=!0),(on&134217727)===0&&(Bn&134217727)===0||tt===null||fn(tt,Be,sa,!1)}function Uu(e,t,a){var n=Ve;Ve|=2;var l=Tf(),i=jf();(tt!==e||Be!==t)&&(_c=null,vl(e,t)),t=!1;var u=ht;e:do try{if(Ke!==0&&Re!==null){var r=Re,p=ca;switch(Ke){case 8:Mu(),u=6;break e;case 3:case 2:case 9:case 6:la.current===null&&(t=!0);var z=Ke;if(Ke=0,ca=null,Sl(e,r,p,z),a&&yl){u=0;break e}break;default:z=Ke,Ke=0,ca=null,Sl(e,r,p,z)}}Cp(),u=ht;break}catch(R){wf(e,R)}while(!0);return t&&e.shellSuspendCounter++,Ra=kn=null,Ve=n,D.H=l,D.A=i,Re===null&&(tt=null,Be=0,Qi()),u}function Cp(){for(;Re!==null;)Cf(Re)}function Ep(e,t){var a=Ve;Ve|=2;var n=Tf(),l=jf();tt!==e||Be!==t?(_c=null,wc=rt()+500,vl(e,t)):yl=ft(e,t);e:do try{if(Ke!==0&&Re!==null){t=Re;var i=ca;t:switch(Ke){case 1:Ke=0,ca=null,Sl(e,t,i,1);break;case 2:case 9:if(Ur(i)){Ke=0,ca=null,Ef(t);break}t=function(){Ke!==2&&Ke!==9||tt!==e||(Ke=7),ka(e)},i.then(t,t);break e;case 3:Ke=7;break e;case 4:Ke=5;break e;case 7:Ur(i)?(Ke=0,ca=null,Ef(t)):(Ke=0,ca=null,Sl(e,t,i,7));break;case 5:var u=null;switch(Re.tag){case 26:u=Re.memoizedState;case 5:case 27:var r=Re;if(u?fm(u):r.stateNode.complete){Ke=0,ca=null;var p=r.sibling;if(p!==null)Re=p;else{var z=r.return;z!==null?(Re=z,Cc(z)):Re=null}break t}}Ke=0,ca=null,Sl(e,t,i,5);break;case 6:Ke=0,ca=null,Sl(e,t,i,6);break;case 8:Mu(),ht=6;break e;default:throw Error(d(462))}}zp();break}catch(R){wf(e,R)}while(!0);return Ra=kn=null,D.H=n,D.A=l,Ve=a,Re!==null?0:(tt=null,Be=0,Qi(),ht)}function zp(){for(;Re!==null&&!ot();)Cf(Re)}function Cf(e){var t=Kd(e.alternate,e,Za);e.memoizedProps=e.pendingProps,t===null?Cc(e):Re=t}function Ef(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=$d(a,t,t.pendingProps,t.type,void 0,Be);break;case 11:t=$d(a,t,t.pendingProps,t.type.render,t.ref,Be);break;case 5:Ws(t);default:Fd(a,t),t=Re=Tr(t,Za),t=Kd(a,t,Za)}e.memoizedProps=e.pendingProps,t===null?Cc(e):Re=t}function Sl(e,t,a,n){Ra=kn=null,Ws(t),ol=null,Wl=0;var l=t.return;try{if(yp(e,l,t,a,Be)){ht=1,mc(e,ma(a,e.current)),Re=null;return}}catch(i){if(l!==null)throw Re=l,i;ht=1,mc(e,ma(a,e.current)),Re=null;return}t.flags&32768?(Ye||n===1?e=!0:yl||(Be&536870912)!==0?e=!1:(un=e=!0,(n===2||n===9||n===3||n===6)&&(n=la.current,n!==null&&n.tag===13&&(n.flags|=16384))),zf(t,e)):Cc(t)}function Cc(e){var t=e;do{if((t.flags&32768)!==0){zf(t,un);return}e=t.return;var a=vp(t.alternate,t,Za);if(a!==null){Re=a;return}if(t=t.sibling,t!==null){Re=t;return}Re=t=e}while(t!==null);ht===0&&(ht=5)}function zf(e,t){do{var a=Sp(e.alternate,e);if(a!==null){a.flags&=32767,Re=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){Re=e;return}Re=e=a}while(e!==null);ht=6,Re=null}function kf(e,t,a,n,l,i,u,r,p){e.cancelPendingCommit=null;do Ec();while(Ct!==0);if((Ve&6)!==0)throw Error(d(327));if(t!==null){if(t===e.current)throw Error(d(177));if(i=t.lanes|t.childLanes,i|=_s,P(e,a,i,u,r,p),e===tt&&(Re=tt=null,Be=0),bl=t,dn=e,Va=a,Nu=i,Du=l,bf=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Dp(jt,function(){return Mf(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=D.T,D.T=null,l=I.p,I.p=2,u=Ve,Ve|=4;try{xp(e,t,a)}finally{Ve=u,I.p=l,D.T=n}}Ct=1,Af(),Nf(),Df()}}function Af(){if(Ct===1){Ct=0;var e=dn,t=bl,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=D.T,D.T=null;var n=I.p;I.p=2;var l=Ve;Ve|=4;try{rf(t,e);var i=Vu,u=pr(e.containerInfo),r=i.focusedElem,p=i.selectionRange;if(u!==r&&r&&r.ownerDocument&&hr(r.ownerDocument.documentElement,r)){if(p!==null&&gs(r)){var z=p.start,R=p.end;if(R===void 0&&(R=z),"selectionStart"in r)r.selectionStart=z,r.selectionEnd=Math.min(R,r.value.length);else{var G=r.ownerDocument||document,k=G&&G.defaultView||window;if(k.getSelection){var O=k.getSelection(),fe=r.textContent.length,xe=Math.min(p.start,fe),Pe=p.end===void 0?xe:Math.min(p.end,fe);!O.extend&&xe>Pe&&(u=Pe,Pe=xe,xe=u);var w=mr(r,xe),g=mr(r,Pe);if(w&&g&&(O.rangeCount!==1||O.anchorNode!==w.node||O.anchorOffset!==w.offset||O.focusNode!==g.node||O.focusOffset!==g.offset)){var E=G.createRange();E.setStart(w.node,w.offset),O.removeAllRanges(),xe>Pe?(O.addRange(E),O.extend(g.node,g.offset)):(E.setEnd(g.node,g.offset),O.addRange(E))}}}}for(G=[],O=r;O=O.parentNode;)O.nodeType===1&&G.push({element:O,left:O.scrollLeft,top:O.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<G.length;r++){var Y=G[r];Y.element.scrollLeft=Y.left,Y.element.scrollTop=Y.top}}Lc=!!Zu,Vu=Zu=null}finally{Ve=l,I.p=n,D.T=a}}e.current=t,Ct=2}}function Nf(){if(Ct===2){Ct=0;var e=dn,t=bl,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=D.T,D.T=null;var n=I.p;I.p=2;var l=Ve;Ve|=4;try{lf(e,t.alternate,t)}finally{Ve=l,I.p=n,D.T=a}}Ct=3}}function Df(){if(Ct===4||Ct===3){Ct=0,yt();var e=dn,t=bl,a=Va,n=bf;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Ct=5:(Ct=0,bl=dn=null,Of(e,e.pendingLanes));var l=e.pendingLanes;if(l===0&&(rn=null),ze(a),t=t.stateNode,q&&typeof q.onCommitFiberRoot=="function")try{q.onCommitFiberRoot(N,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=D.T,l=I.p,I.p=2,D.T=null;try{for(var i=e.onRecoverableError,u=0;u<n.length;u++){var r=n[u];i(r.value,{componentStack:r.stack})}}finally{D.T=t,I.p=l}}(Va&3)!==0&&Ec(),ka(e),l=e.pendingLanes,(a&261930)!==0&&(l&42)!==0?e===Ou?mi++:(mi=0,Ou=e):mi=0,hi(0)}}function Of(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Jl(t)))}function Ec(){return Af(),Nf(),Df(),Mf()}function Mf(){if(Ct!==5)return!1;var e=dn,t=Nu;Nu=0;var a=ze(Va),n=D.T,l=I.p;try{I.p=32>a?32:a,D.T=null,a=Du,Du=null;var i=dn,u=Va;if(Ct=0,bl=dn=null,Va=0,(Ve&6)!==0)throw Error(d(331));var r=Ve;if(Ve|=4,pf(i.current),ff(i,i.current,u,a),Ve=r,hi(0,!1),q&&typeof q.onPostCommitFiberRoot=="function")try{q.onPostCommitFiberRoot(N,i)}catch{}return!0}finally{I.p=l,D.T=n,Of(e,t)}}function Uf(e,t,a){t=ma(a,t),t=du(e.stateNode,t,2),e=nn(e,t,2),e!==null&&(H(e,2),ka(e))}function We(e,t,a){if(e.tag===3)Uf(e,e,a);else for(;t!==null;){if(t.tag===3){Uf(t,e,a);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(rn===null||!rn.has(n))){e=ma(a,e),a=Ud(2),n=nn(t,a,2),n!==null&&(Rd(a,n,t,e),H(n,2),ka(n));break}}t=t.return}}function Ru(e,t,a){var n=e.pingCache;if(n===null){n=e.pingCache=new Tp;var l=new Set;n.set(t,l)}else l=n.get(t),l===void 0&&(l=new Set,n.set(t,l));l.has(a)||(zu=!0,l.add(a),e=kp.bind(null,e,t,a),t.then(e,e))}function kp(e,t,a){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,tt===e&&(Be&a)===a&&(ht===4||ht===3&&(Be&62914560)===Be&&300>rt()-xc?(Ve&2)===0&&vl(e,0):ku|=a,gl===Be&&(gl=0)),ka(e)}function Rf(e,t){t===0&&(t=Ml()),e=Cn(e,t),e!==null&&(H(e,t),ka(e))}function Ap(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Rf(e,a)}function Np(e,t){var a=0;switch(e.tag){case 31:case 13:var n=e.stateNode,l=e.memoizedState;l!==null&&(a=l.retryLane);break;case 19:n=e.stateNode;break;case 22:n=e.stateNode._retryCache;break;default:throw Error(d(314))}n!==null&&n.delete(t),Rf(e,a)}function Dp(e,t){return Yt(e,t)}var zc=null,xl=null,Hu=!1,kc=!1,Bu=!1,mn=0;function ka(e){e!==xl&&e.next===null&&(xl===null?zc=xl=e:xl=xl.next=e),kc=!0,Hu||(Hu=!0,Mp())}function hi(e,t){if(!Bu&&kc){Bu=!0;do for(var a=!1,n=zc;n!==null;){if(e!==0){var l=n.pendingLanes;if(l===0)var i=0;else{var u=n.suspendedLanes,r=n.pingedLanes;i=(1<<31-te(42|e)+1)-1,i&=l&~(u&~r),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(a=!0,qf(n,i))}else i=Be,i=Ee(n,n===tt?i:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(i&3)===0||ft(n,i)||(a=!0,qf(n,i));n=n.next}while(a);Bu=!1}}function Op(){Hf()}function Hf(){kc=Hu=!1;var e=0;mn!==0&&Xp()&&(e=mn);for(var t=rt(),a=null,n=zc;n!==null;){var l=n.next,i=Bf(n,t);i===0?(n.next=null,a===null?zc=l:a.next=l,l===null&&(xl=a)):(a=n,(e!==0||(i&3)!==0)&&(kc=!0)),n=l}Ct!==0&&Ct!==5||hi(e),mn!==0&&(mn=0)}function Bf(e,t){for(var a=e.suspendedLanes,n=e.pingedLanes,l=e.expirationTimes,i=e.pendingLanes&-62914561;0<i;){var u=31-te(i),r=1<<u,p=l[u];p===-1?((r&a)===0||(r&n)!==0)&&(l[u]=Ic(r,t)):p<=t&&(e.expiredLanes|=r),i&=~r}if(t=tt,a=Be,a=Ee(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,a===0||e===t&&(Ke===2||Ke===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&Pt(n),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||ft(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(n!==null&&Pt(n),ze(a)){case 2:case 8:a=ea;break;case 32:a=jt;break;case 268435456:a=St;break;default:a=jt}return n=Lf.bind(null,e),a=Yt(a,n),e.callbackPriority=t,e.callbackNode=a,t}return n!==null&&n!==null&&Pt(n),e.callbackPriority=2,e.callbackNode=null,2}function Lf(e,t){if(Ct!==0&&Ct!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Ec()&&e.callbackNode!==a)return null;var n=Be;return n=Ee(e,e===tt?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(Sf(e,n,t),Bf(e,rt()),e.callbackNode!=null&&e.callbackNode===a?Lf.bind(null,e):null)}function qf(e,t){if(Ec())return null;Sf(e,t,!0)}function Mp(){Zp(function(){(Ve&6)!==0?Yt(Qt,Op):Hf()})}function Lu(){if(mn===0){var e=cl;e===0&&(e=gt,gt<<=1,(gt&261888)===0&&(gt=256)),mn=e}return mn}function Yf(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Hi(""+e)}function Gf(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function Up(e,t,a,n,l){if(t==="submit"&&a&&a.stateNode===l){var i=Yf((l[Zt]||null).action),u=n.submitter;u&&(t=(t=u[Zt]||null)?Yf(t.formAction):u.getAttribute("formAction"),t!==null&&(i=t,u=null));var r=new Yi("action","action",null,n,l);e.push({event:r,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(mn!==0){var p=u?Gf(l,u):new FormData(l);iu(a,{pending:!0,data:p,method:l.method,action:i},null,p)}}else typeof i=="function"&&(r.preventDefault(),p=u?Gf(l,u):new FormData(l),iu(a,{pending:!0,data:p,method:l.method,action:i},i,p))},currentTarget:l}]})}}for(var qu=0;qu<xs.length;qu++){var Yu=xs[qu],Rp=Yu.toLowerCase(),Hp=Yu[0].toUpperCase()+Yu.slice(1);wa(Rp,"on"+Hp)}wa(br,"onAnimationEnd"),wa(vr,"onAnimationIteration"),wa(Sr,"onAnimationStart"),wa("dblclick","onDoubleClick"),wa("focusin","onFocus"),wa("focusout","onBlur"),wa(Ph,"onTransitionRun"),wa(ep,"onTransitionStart"),wa(tp,"onTransitionCancel"),wa(xr,"onTransitionEnd"),Zn("onMouseEnter",["mouseout","mouseover"]),Zn("onMouseLeave",["mouseout","mouseover"]),Zn("onPointerEnter",["pointerout","pointerover"]),Zn("onPointerLeave",["pointerout","pointerover"]),wn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),wn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),wn("onBeforeInput",["compositionend","keypress","textInput","paste"]),wn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),wn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),wn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var pi="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(" "),Bp=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(pi));function $f(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var n=e[a],l=n.event;n=n.listeners;e:{var i=void 0;if(t)for(var u=n.length-1;0<=u;u--){var r=n[u],p=r.instance,z=r.currentTarget;if(r=r.listener,p!==i&&l.isPropagationStopped())break e;i=r,l.currentTarget=z;try{i(l)}catch(R){Xi(R)}l.currentTarget=null,i=p}else for(u=0;u<n.length;u++){if(r=n[u],p=r.instance,z=r.currentTarget,r=r.listener,p!==i&&l.isPropagationStopped())break e;i=r,l.currentTarget=z;try{i(l)}catch(R){Xi(R)}l.currentTarget=null,i=p}}}}function He(e,t){var a=t[Pc];a===void 0&&(a=t[Pc]=new Set);var n=e+"__bubble";a.has(n)||(Xf(t,e,2,!1),a.add(n))}function Gu(e,t,a){var n=0;t&&(n|=4),Xf(a,e,n,t)}var Ac="_reactListening"+Math.random().toString(36).slice(2);function $u(e){if(!e[Ac]){e[Ac]=!0,Ro.forEach(function(a){a!=="selectionchange"&&(Bp.has(a)||Gu(a,!1,e),Gu(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ac]||(t[Ac]=!0,Gu("selectionchange",!1,t))}}function Xf(e,t,a,n){switch(vm(t)){case 2:var l=fy;break;case 8:l=my;break;default:l=lo}a=l.bind(null,t,a,e),l=void 0,!us||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(l=!0),n?l!==void 0?e.addEventListener(t,a,{capture:!0,passive:l}):e.addEventListener(t,a,!0):l!==void 0?e.addEventListener(t,a,{passive:l}):e.addEventListener(t,a,!1)}function Xu(e,t,a,n,l){var i=n;if((t&1)===0&&(t&2)===0&&n!==null)e:for(;;){if(n===null)return;var u=n.tag;if(u===3||u===4){var r=n.stateNode.containerInfo;if(r===l)break;if(u===4)for(u=n.return;u!==null;){var p=u.tag;if((p===3||p===4)&&u.stateNode.containerInfo===l)return;u=u.return}for(;r!==null;){if(u=$n(r),u===null)return;if(p=u.tag,p===5||p===6||p===26||p===27){n=i=u;continue e}r=r.parentNode}}n=n.return}Jo(function(){var z=i,R=cs(a),G=[];e:{var k=wr.get(e);if(k!==void 0){var O=Yi,fe=e;switch(e){case"keypress":if(Li(a)===0)break e;case"keydown":case"keyup":O=Nh;break;case"focusin":fe="focus",O=fs;break;case"focusout":fe="blur",O=fs;break;case"beforeblur":case"afterblur":O=fs;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":O=Fo;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":O=vh;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":O=Mh;break;case br:case vr:case Sr:O=wh;break;case xr:O=Rh;break;case"scroll":case"scrollend":O=gh;break;case"wheel":O=Bh;break;case"copy":case"cut":case"paste":O=Th;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":O=Po;break;case"toggle":case"beforetoggle":O=qh}var xe=(t&4)!==0,Pe=!xe&&(e==="scroll"||e==="scrollend"),w=xe?k!==null?k+"Capture":null:k;xe=[];for(var g=z,E;g!==null;){var Y=g;if(E=Y.stateNode,Y=Y.tag,Y!==5&&Y!==26&&Y!==27||E===null||w===null||(Y=Hl(g,w),Y!=null&&xe.push(yi(g,Y,E))),Pe)break;g=g.return}0<xe.length&&(k=new O(k,fe,null,a,R),G.push({event:k,listeners:xe}))}}if((t&7)===0){e:{if(k=e==="mouseover"||e==="pointerover",O=e==="mouseout"||e==="pointerout",k&&a!==is&&(fe=a.relatedTarget||a.fromElement)&&($n(fe)||fe[Gn]))break e;if((O||k)&&(k=R.window===R?R:(k=R.ownerDocument)?k.defaultView||k.parentWindow:window,O?(fe=a.relatedTarget||a.toElement,O=z,fe=fe?$n(fe):null,fe!==null&&(Pe=_(fe),xe=fe.tag,fe!==Pe||xe!==5&&xe!==27&&xe!==6)&&(fe=null)):(O=null,fe=z),O!==fe)){if(xe=Fo,Y="onMouseLeave",w="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(xe=Po,Y="onPointerLeave",w="onPointerEnter",g="pointer"),Pe=O==null?k:Rl(O),E=fe==null?k:Rl(fe),k=new xe(Y,g+"leave",O,a,R),k.target=Pe,k.relatedTarget=E,Y=null,$n(R)===z&&(xe=new xe(w,g+"enter",fe,a,R),xe.target=E,xe.relatedTarget=Pe,Y=xe),Pe=Y,O&&fe)t:{for(xe=Lp,w=O,g=fe,E=0,Y=w;Y;Y=xe(Y))E++;Y=0;for(var ve=g;ve;ve=xe(ve))Y++;for(;0<E-Y;)w=xe(w),E--;for(;0<Y-E;)g=xe(g),Y--;for(;E--;){if(w===g||g!==null&&w===g.alternate){xe=w;break t}w=xe(w),g=xe(g)}xe=null}else xe=null;O!==null&&Qf(G,k,O,xe,!1),fe!==null&&Pe!==null&&Qf(G,Pe,fe,xe,!0)}}e:{if(k=z?Rl(z):window,O=k.nodeName&&k.nodeName.toLowerCase(),O==="select"||O==="input"&&k.type==="file")var Xe=sr;else if(ir(k))if(ur)Xe=Wh;else{Xe=Jh;var pe=Vh}else O=k.nodeName,!O||O.toLowerCase()!=="input"||k.type!=="checkbox"&&k.type!=="radio"?z&&ls(z.elementType)&&(Xe=sr):Xe=Kh;if(Xe&&(Xe=Xe(e,z))){cr(G,Xe,a,R);break e}pe&&pe(e,k,z),e==="focusout"&&z&&k.type==="number"&&z.memoizedProps.value!=null&&ns(k,"number",k.value)}switch(pe=z?Rl(z):window,e){case"focusin":(ir(pe)||pe.contentEditable==="true")&&(In=pe,bs=z,Ql=null);break;case"focusout":Ql=bs=In=null;break;case"mousedown":vs=!0;break;case"contextmenu":case"mouseup":case"dragend":vs=!1,yr(G,a,R);break;case"selectionchange":if(Ih)break;case"keydown":case"keyup":yr(G,a,R)}var Ne;if(hs)e:{switch(e){case"compositionstart":var Le="onCompositionStart";break e;case"compositionend":Le="onCompositionEnd";break e;case"compositionupdate":Le="onCompositionUpdate";break e}Le=void 0}else Fn?nr(e,a)&&(Le="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Le="onCompositionStart");Le&&(er&&a.locale!=="ko"&&(Fn||Le!=="onCompositionStart"?Le==="onCompositionEnd"&&Fn&&(Ne=Ko()):(Wa=R,os="value"in Wa?Wa.value:Wa.textContent,Fn=!0)),pe=Nc(z,Le),0<pe.length&&(Le=new Io(Le,e,null,a,R),G.push({event:Le,listeners:pe}),Ne?Le.data=Ne:(Ne=lr(a),Ne!==null&&(Le.data=Ne)))),(Ne=Gh?$h(e,a):Xh(e,a))&&(Le=Nc(z,"onBeforeInput"),0<Le.length&&(pe=new Io("onBeforeInput","beforeinput",null,a,R),G.push({event:pe,listeners:Le}),pe.data=Ne)),Up(G,e,z,a,R)}$f(G,t)})}function yi(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Nc(e,t){for(var a=t+"Capture",n=[];e!==null;){var l=e,i=l.stateNode;if(l=l.tag,l!==5&&l!==26&&l!==27||i===null||(l=Hl(e,a),l!=null&&n.unshift(yi(e,l,i)),l=Hl(e,t),l!=null&&n.push(yi(e,l,i))),e.tag===3)return n;e=e.return}return[]}function Lp(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Qf(e,t,a,n,l){for(var i=t._reactName,u=[];a!==null&&a!==n;){var r=a,p=r.alternate,z=r.stateNode;if(r=r.tag,p!==null&&p===n)break;r!==5&&r!==26&&r!==27||z===null||(p=z,l?(z=Hl(a,i),z!=null&&u.unshift(yi(a,z,p))):l||(z=Hl(a,i),z!=null&&u.push(yi(a,z,p)))),a=a.return}u.length!==0&&e.push({event:t,listeners:u})}var qp=/\r\n?/g,Yp=/\u0000|\uFFFD/g;function Zf(e){return(typeof e=="string"?e:""+e).replace(qp,`
49
+ `).replace(Yp,"")}function Vf(e,t){return t=Zf(t),Zf(e)===t}function Ie(e,t,a,n,l,i){switch(a){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||Jn(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&Jn(e,""+n);break;case"className":Ui(e,"class",n);break;case"tabIndex":Ui(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":Ui(e,a,n);break;case"style":Zo(e,n,i);break;case"data":if(t!=="object"){Ui(e,"data",n);break}case"src":case"href":if(n===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(n==null||typeof n=="function"||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=Hi(""+n),e.setAttribute(a,n);break;case"action":case"formAction":if(typeof n=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof i=="function"&&(a==="formAction"?(t!=="input"&&Ie(e,t,"name",l.name,l,null),Ie(e,t,"formEncType",l.formEncType,l,null),Ie(e,t,"formMethod",l.formMethod,l,null),Ie(e,t,"formTarget",l.formTarget,l,null)):(Ie(e,t,"encType",l.encType,l,null),Ie(e,t,"method",l.method,l,null),Ie(e,t,"target",l.target,l,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=Hi(""+n),e.setAttribute(a,n);break;case"onClick":n!=null&&(e.onclick=Da);break;case"onScroll":n!=null&&He("scroll",e);break;case"onScrollEnd":n!=null&&He("scrollend",e);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(d(61));if(a=n.__html,a!=null){if(l.children!=null)throw Error(d(60));e.innerHTML=a}}break;case"multiple":e.multiple=n&&typeof n!="function"&&typeof n!="symbol";break;case"muted":e.muted=n&&typeof n!="function"&&typeof n!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(n==null||typeof n=="function"||typeof n=="boolean"||typeof n=="symbol"){e.removeAttribute("xlink:href");break}a=Hi(""+n),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,""+n):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":n&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":n===!0?e.setAttribute(a,""):n!==!1&&n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,n):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":n!=null&&typeof n!="function"&&typeof n!="symbol"&&!isNaN(n)&&1<=n?e.setAttribute(a,n):e.removeAttribute(a);break;case"rowSpan":case"start":n==null||typeof n=="function"||typeof n=="symbol"||isNaN(n)?e.removeAttribute(a):e.setAttribute(a,n);break;case"popover":He("beforetoggle",e),He("toggle",e),Mi(e,"popover",n);break;case"xlinkActuate":Na(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":Na(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":Na(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":Na(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":Na(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":Na(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":Na(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":Na(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":Na(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":Mi(e,"is",n);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=ph.get(a)||a,Mi(e,a,n))}}function Qu(e,t,a,n,l,i){switch(a){case"style":Zo(e,n,i);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(d(61));if(a=n.__html,a!=null){if(l.children!=null)throw Error(d(60));e.innerHTML=a}}break;case"children":typeof n=="string"?Jn(e,n):(typeof n=="number"||typeof n=="bigint")&&Jn(e,""+n);break;case"onScroll":n!=null&&He("scroll",e);break;case"onScrollEnd":n!=null&&He("scrollend",e);break;case"onClick":n!=null&&(e.onclick=Da);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ho.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(l=a.endsWith("Capture"),t=a.slice(2,l?a.length-7:void 0),i=e[Zt]||null,i=i!=null?i[a]:null,typeof i=="function"&&e.removeEventListener(t,i,l),typeof n=="function")){typeof i!="function"&&i!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,n,l);break e}a in e?e[a]=n:n===!0?e.setAttribute(a,""):Mi(e,a,n)}}}function Rt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":He("error",e),He("load",e);var n=!1,l=!1,i;for(i in a)if(a.hasOwnProperty(i)){var u=a[i];if(u!=null)switch(i){case"src":n=!0;break;case"srcSet":l=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(d(137,t));default:Ie(e,t,i,u,a,null)}}l&&Ie(e,t,"srcSet",a.srcSet,a,null),n&&Ie(e,t,"src",a.src,a,null);return;case"input":He("invalid",e);var r=i=u=l=null,p=null,z=null;for(n in a)if(a.hasOwnProperty(n)){var R=a[n];if(R!=null)switch(n){case"name":l=R;break;case"type":u=R;break;case"checked":p=R;break;case"defaultChecked":z=R;break;case"value":i=R;break;case"defaultValue":r=R;break;case"children":case"dangerouslySetInnerHTML":if(R!=null)throw Error(d(137,t));break;default:Ie(e,t,n,R,a,null)}}Go(e,i,r,p,z,u,l,!1);return;case"select":He("invalid",e),n=u=i=null;for(l in a)if(a.hasOwnProperty(l)&&(r=a[l],r!=null))switch(l){case"value":i=r;break;case"defaultValue":u=r;break;case"multiple":n=r;default:Ie(e,t,l,r,a,null)}t=i,a=u,e.multiple=!!n,t!=null?Vn(e,!!n,t,!1):a!=null&&Vn(e,!!n,a,!0);return;case"textarea":He("invalid",e),i=l=n=null;for(u in a)if(a.hasOwnProperty(u)&&(r=a[u],r!=null))switch(u){case"value":n=r;break;case"defaultValue":l=r;break;case"children":i=r;break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(d(91));break;default:Ie(e,t,u,r,a,null)}Xo(e,n,l,i);return;case"option":for(p in a)if(a.hasOwnProperty(p)&&(n=a[p],n!=null))switch(p){case"selected":e.selected=n&&typeof n!="function"&&typeof n!="symbol";break;default:Ie(e,t,p,n,a,null)}return;case"dialog":He("beforetoggle",e),He("toggle",e),He("cancel",e),He("close",e);break;case"iframe":case"object":He("load",e);break;case"video":case"audio":for(n=0;n<pi.length;n++)He(pi[n],e);break;case"image":He("error",e),He("load",e);break;case"details":He("toggle",e);break;case"embed":case"source":case"link":He("error",e),He("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(z in a)if(a.hasOwnProperty(z)&&(n=a[z],n!=null))switch(z){case"children":case"dangerouslySetInnerHTML":throw Error(d(137,t));default:Ie(e,t,z,n,a,null)}return;default:if(ls(t)){for(R in a)a.hasOwnProperty(R)&&(n=a[R],n!==void 0&&Qu(e,t,R,n,a,void 0));return}}for(r in a)a.hasOwnProperty(r)&&(n=a[r],n!=null&&Ie(e,t,r,n,a,null))}function Gp(e,t,a,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var l=null,i=null,u=null,r=null,p=null,z=null,R=null;for(O in a){var G=a[O];if(a.hasOwnProperty(O)&&G!=null)switch(O){case"checked":break;case"value":break;case"defaultValue":p=G;default:n.hasOwnProperty(O)||Ie(e,t,O,null,n,G)}}for(var k in n){var O=n[k];if(G=a[k],n.hasOwnProperty(k)&&(O!=null||G!=null))switch(k){case"type":i=O;break;case"name":l=O;break;case"checked":z=O;break;case"defaultChecked":R=O;break;case"value":u=O;break;case"defaultValue":r=O;break;case"children":case"dangerouslySetInnerHTML":if(O!=null)throw Error(d(137,t));break;default:O!==G&&Ie(e,t,k,O,n,G)}}as(e,u,r,p,z,R,i,l);return;case"select":O=u=r=k=null;for(i in a)if(p=a[i],a.hasOwnProperty(i)&&p!=null)switch(i){case"value":break;case"multiple":O=p;default:n.hasOwnProperty(i)||Ie(e,t,i,null,n,p)}for(l in n)if(i=n[l],p=a[l],n.hasOwnProperty(l)&&(i!=null||p!=null))switch(l){case"value":k=i;break;case"defaultValue":r=i;break;case"multiple":u=i;default:i!==p&&Ie(e,t,l,i,n,p)}t=r,a=u,n=O,k!=null?Vn(e,!!a,k,!1):!!n!=!!a&&(t!=null?Vn(e,!!a,t,!0):Vn(e,!!a,a?[]:"",!1));return;case"textarea":O=k=null;for(r in a)if(l=a[r],a.hasOwnProperty(r)&&l!=null&&!n.hasOwnProperty(r))switch(r){case"value":break;case"children":break;default:Ie(e,t,r,null,n,l)}for(u in n)if(l=n[u],i=a[u],n.hasOwnProperty(u)&&(l!=null||i!=null))switch(u){case"value":k=l;break;case"defaultValue":O=l;break;case"children":break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(d(91));break;default:l!==i&&Ie(e,t,u,l,n,i)}$o(e,k,O);return;case"option":for(var fe in a)if(k=a[fe],a.hasOwnProperty(fe)&&k!=null&&!n.hasOwnProperty(fe))switch(fe){case"selected":e.selected=!1;break;default:Ie(e,t,fe,null,n,k)}for(p in n)if(k=n[p],O=a[p],n.hasOwnProperty(p)&&k!==O&&(k!=null||O!=null))switch(p){case"selected":e.selected=k&&typeof k!="function"&&typeof k!="symbol";break;default:Ie(e,t,p,k,n,O)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var xe in a)k=a[xe],a.hasOwnProperty(xe)&&k!=null&&!n.hasOwnProperty(xe)&&Ie(e,t,xe,null,n,k);for(z in n)if(k=n[z],O=a[z],n.hasOwnProperty(z)&&k!==O&&(k!=null||O!=null))switch(z){case"children":case"dangerouslySetInnerHTML":if(k!=null)throw Error(d(137,t));break;default:Ie(e,t,z,k,n,O)}return;default:if(ls(t)){for(var Pe in a)k=a[Pe],a.hasOwnProperty(Pe)&&k!==void 0&&!n.hasOwnProperty(Pe)&&Qu(e,t,Pe,void 0,n,k);for(R in n)k=n[R],O=a[R],!n.hasOwnProperty(R)||k===O||k===void 0&&O===void 0||Qu(e,t,R,k,n,O);return}}for(var w in a)k=a[w],a.hasOwnProperty(w)&&k!=null&&!n.hasOwnProperty(w)&&Ie(e,t,w,null,n,k);for(G in n)k=n[G],O=a[G],!n.hasOwnProperty(G)||k===O||k==null&&O==null||Ie(e,t,G,k,n,O)}function Jf(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function $p(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),n=0;n<a.length;n++){var l=a[n],i=l.transferSize,u=l.initiatorType,r=l.duration;if(i&&r&&Jf(u)){for(u=0,r=l.responseEnd,n+=1;n<a.length;n++){var p=a[n],z=p.startTime;if(z>r)break;var R=p.transferSize,G=p.initiatorType;R&&Jf(G)&&(p=p.responseEnd,u+=R*(p<r?1:(r-z)/(p-z)))}if(--n,t+=8*(i+u)/(l.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Zu=null,Vu=null;function Dc(e){return e.nodeType===9?e:e.ownerDocument}function Kf(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Wf(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Ju(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Ku=null;function Xp(){var e=window.event;return e&&e.type==="popstate"?e===Ku?!1:(Ku=e,!0):(Ku=null,!1)}var Ff=typeof setTimeout=="function"?setTimeout:void 0,Qp=typeof clearTimeout=="function"?clearTimeout:void 0,If=typeof Promise=="function"?Promise:void 0,Zp=typeof queueMicrotask=="function"?queueMicrotask:typeof If<"u"?function(e){return If.resolve(null).then(e).catch(Vp)}:Ff;function Vp(e){setTimeout(function(){throw e})}function hn(e){return e==="head"}function Pf(e,t){var a=t,n=0;do{var l=a.nextSibling;if(e.removeChild(a),l&&l.nodeType===8)if(a=l.data,a==="/$"||a==="/&"){if(n===0){e.removeChild(l),jl(t);return}n--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")n++;else if(a==="html")gi(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,gi(a);for(var i=a.firstChild;i;){var u=i.nextSibling,r=i.nodeName;i[Ul]||r==="SCRIPT"||r==="STYLE"||r==="LINK"&&i.rel.toLowerCase()==="stylesheet"||a.removeChild(i),i=u}}else a==="body"&&gi(e.ownerDocument.body);a=l}while(a);jl(t)}function em(e,t){var a=e;e=0;do{var n=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),n&&n.nodeType===8)if(a=n.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=n}while(a)}function Wu(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Wu(a),es(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function Jp(e,t,a,n){for(;e.nodeType===1;){var l=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!n&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(n){if(!e[Ul])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(i=e.getAttribute("rel"),i==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(i!==l.rel||e.getAttribute("href")!==(l.href==null||l.href===""?null:l.href)||e.getAttribute("crossorigin")!==(l.crossOrigin==null?null:l.crossOrigin)||e.getAttribute("title")!==(l.title==null?null:l.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(i=e.getAttribute("src"),(i!==(l.src==null?null:l.src)||e.getAttribute("type")!==(l.type==null?null:l.type)||e.getAttribute("crossorigin")!==(l.crossOrigin==null?null:l.crossOrigin))&&i&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var i=l.name==null?null:""+l.name;if(l.type==="hidden"&&e.getAttribute("name")===i)return e}else return e;if(e=ba(e.nextSibling),e===null)break}return null}function Kp(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=ba(e.nextSibling),e===null))return null;return e}function tm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=ba(e.nextSibling),e===null))return null;return e}function Fu(e){return e.data==="$?"||e.data==="$~"}function Iu(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Wp(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var n=function(){t(),a.removeEventListener("DOMContentLoaded",n)};a.addEventListener("DOMContentLoaded",n),e._reactRetry=n}}function ba(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==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Pu=null;function am(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return ba(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function nm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function lm(e,t,a){switch(t=Dc(a),e){case"html":if(e=t.documentElement,!e)throw Error(d(452));return e;case"head":if(e=t.head,!e)throw Error(d(453));return e;case"body":if(e=t.body,!e)throw Error(d(454));return e;default:throw Error(d(451))}}function gi(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);es(e)}var va=new Map,im=new Set;function Oc(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ja=I.d;I.d={f:Fp,r:Ip,D:Pp,C:ey,L:ty,m:ay,X:ly,S:ny,M:iy};function Fp(){var e=Ja.f(),t=Tc();return e||t}function Ip(e){var t=Xn(e);t!==null&&t.tag===5&&t.type==="form"?xd(t):Ja.r(e)}var wl=typeof document>"u"?null:document;function cm(e,t,a){var n=wl;if(n&&typeof t=="string"&&t){var l=da(t);l='link[rel="'+e+'"][href="'+l+'"]',typeof a=="string"&&(l+='[crossorigin="'+a+'"]'),im.has(l)||(im.add(l),e={rel:e,crossOrigin:a,href:t},n.querySelector(l)===null&&(t=n.createElement("link"),Rt(t,"link",e),kt(t),n.head.appendChild(t)))}}function Pp(e){Ja.D(e),cm("dns-prefetch",e,null)}function ey(e,t){Ja.C(e,t),cm("preconnect",e,t)}function ty(e,t,a){Ja.L(e,t,a);var n=wl;if(n&&e&&t){var l='link[rel="preload"][as="'+da(t)+'"]';t==="image"&&a&&a.imageSrcSet?(l+='[imagesrcset="'+da(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(l+='[imagesizes="'+da(a.imageSizes)+'"]')):l+='[href="'+da(e)+'"]';var i=l;switch(t){case"style":i=_l(e);break;case"script":i=Tl(e)}va.has(i)||(e=T({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),va.set(i,e),n.querySelector(l)!==null||t==="style"&&n.querySelector(bi(i))||t==="script"&&n.querySelector(vi(i))||(t=n.createElement("link"),Rt(t,"link",e),kt(t),n.head.appendChild(t)))}}function ay(e,t){Ja.m(e,t);var a=wl;if(a&&e){var n=t&&typeof t.as=="string"?t.as:"script",l='link[rel="modulepreload"][as="'+da(n)+'"][href="'+da(e)+'"]',i=l;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=Tl(e)}if(!va.has(i)&&(e=T({rel:"modulepreload",href:e},t),va.set(i,e),a.querySelector(l)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(vi(i)))return}n=a.createElement("link"),Rt(n,"link",e),kt(n),a.head.appendChild(n)}}}function ny(e,t,a){Ja.S(e,t,a);var n=wl;if(n&&e){var l=Qn(n).hoistableStyles,i=_l(e);t=t||"default";var u=l.get(i);if(!u){var r={loading:0,preload:null};if(u=n.querySelector(bi(i)))r.loading=5;else{e=T({rel:"stylesheet",href:e,"data-precedence":t},a),(a=va.get(i))&&eo(e,a);var p=u=n.createElement("link");kt(p),Rt(p,"link",e),p._p=new Promise(function(z,R){p.onload=z,p.onerror=R}),p.addEventListener("load",function(){r.loading|=1}),p.addEventListener("error",function(){r.loading|=2}),r.loading|=4,Mc(u,t,n)}u={type:"stylesheet",instance:u,count:1,state:r},l.set(i,u)}}}function ly(e,t){Ja.X(e,t);var a=wl;if(a&&e){var n=Qn(a).hoistableScripts,l=Tl(e),i=n.get(l);i||(i=a.querySelector(vi(l)),i||(e=T({src:e,async:!0},t),(t=va.get(l))&&to(e,t),i=a.createElement("script"),kt(i),Rt(i,"link",e),a.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},n.set(l,i))}}function iy(e,t){Ja.M(e,t);var a=wl;if(a&&e){var n=Qn(a).hoistableScripts,l=Tl(e),i=n.get(l);i||(i=a.querySelector(vi(l)),i||(e=T({src:e,async:!0,type:"module"},t),(t=va.get(l))&&to(e,t),i=a.createElement("script"),kt(i),Rt(i,"link",e),a.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},n.set(l,i))}}function sm(e,t,a,n){var l=(l=ge.current)?Oc(l):null;if(!l)throw Error(d(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=_l(a.href),a=Qn(l).hoistableStyles,n=a.get(t),n||(n={type:"style",instance:null,count:0,state:null},a.set(t,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=_l(a.href);var i=Qn(l).hoistableStyles,u=i.get(e);if(u||(l=l.ownerDocument||l,u={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,u),(i=l.querySelector(bi(e)))&&!i._p&&(u.instance=i,u.state.loading=5),va.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},va.set(e,a),i||cy(l,e,a,u.state))),t&&n===null)throw Error(d(528,""));return u}if(t&&n!==null)throw Error(d(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Tl(a),a=Qn(l).hoistableScripts,n=a.get(t),n||(n={type:"script",instance:null,count:0,state:null},a.set(t,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(d(444,e))}}function _l(e){return'href="'+da(e)+'"'}function bi(e){return'link[rel="stylesheet"]['+e+"]"}function um(e){return T({},e,{"data-precedence":e.precedence,precedence:null})}function cy(e,t,a,n){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?n.loading=1:(t=e.createElement("link"),n.preload=t,t.addEventListener("load",function(){return n.loading|=1}),t.addEventListener("error",function(){return n.loading|=2}),Rt(t,"link",a),kt(t),e.head.appendChild(t))}function Tl(e){return'[src="'+da(e)+'"]'}function vi(e){return"script[async]"+e}function om(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+da(a.href)+'"]');if(n)return t.instance=n,kt(n),n;var l=T({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),kt(n),Rt(n,"style",l),Mc(n,a.precedence,e),t.instance=n;case"stylesheet":l=_l(a.href);var i=e.querySelector(bi(l));if(i)return t.state.loading|=4,t.instance=i,kt(i),i;n=um(a),(l=va.get(l))&&eo(n,l),i=(e.ownerDocument||e).createElement("link"),kt(i);var u=i;return u._p=new Promise(function(r,p){u.onload=r,u.onerror=p}),Rt(i,"link",n),t.state.loading|=4,Mc(i,a.precedence,e),t.instance=i;case"script":return i=Tl(a.src),(l=e.querySelector(vi(i)))?(t.instance=l,kt(l),l):(n=a,(l=va.get(i))&&(n=T({},a),to(n,l)),e=e.ownerDocument||e,l=e.createElement("script"),kt(l),Rt(l,"link",n),e.head.appendChild(l),t.instance=l);case"void":return null;default:throw Error(d(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(n=t.instance,t.state.loading|=4,Mc(n,a.precedence,e));return t.instance}function Mc(e,t,a){for(var n=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),l=n.length?n[n.length-1]:null,i=l,u=0;u<n.length;u++){var r=n[u];if(r.dataset.precedence===t)i=r;else if(i!==l)break}i?i.parentNode.insertBefore(e,i.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function eo(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function to(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Uc=null;function rm(e,t,a){if(Uc===null){var n=new Map,l=Uc=new Map;l.set(a,n)}else l=Uc,n=l.get(a),n||(n=new Map,l.set(a,n));if(n.has(e))return n;for(n.set(e,null),a=a.getElementsByTagName(e),l=0;l<a.length;l++){var i=a[l];if(!(i[Ul]||i[Dt]||e==="link"&&i.getAttribute("rel")==="stylesheet")&&i.namespaceURI!=="http://www.w3.org/2000/svg"){var u=i.getAttribute(t)||"";u=e+u;var r=n.get(u);r?r.push(i):n.set(u,[i])}}return n}function dm(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function sy(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function fm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function uy(e,t,a,n){if(a.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var l=_l(n.href),i=t.querySelector(bi(l));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Rc.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=i,kt(i);return}i=t.ownerDocument||t,n=um(n),(l=va.get(l))&&eo(n,l),i=i.createElement("link"),kt(i);var u=i;u._p=new Promise(function(r,p){u.onload=r,u.onerror=p}),Rt(i,"link",n),a.instance=i}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=Rc.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var ao=0;function oy(e,t){return e.stylesheets&&e.count===0&&Bc(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var n=setTimeout(function(){if(e.stylesheets&&Bc(e,e.stylesheets),e.unsuspend){var i=e.unsuspend;e.unsuspend=null,i()}},6e4+t);0<e.imgBytes&&ao===0&&(ao=62500*$p());var l=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Bc(e,e.stylesheets),e.unsuspend)){var i=e.unsuspend;e.unsuspend=null,i()}},(e.imgBytes>ao?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(l)}}:null}function Rc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Bc(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Hc=null;function Bc(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Hc=new Map,t.forEach(ry,e),Hc=null,Rc.call(e))}function ry(e,t){if(!(t.state.loading&4)){var a=Hc.get(e);if(a)var n=a.get(null);else{a=new Map,Hc.set(e,a);for(var l=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<l.length;i++){var u=l[i];(u.nodeName==="LINK"||u.getAttribute("media")!=="not all")&&(a.set(u.dataset.precedence,u),n=u)}n&&a.set(null,n)}l=t.instance,u=l.getAttribute("data-precedence"),i=a.get(u)||n,i===n&&a.set(null,l),a.set(u,l),this.count++,n=Rc.bind(this),l.addEventListener("load",n),l.addEventListener("error",n),i?i.parentNode.insertBefore(l,i.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(l,e.firstChild)),t.state.loading|=4}}var Si={$$typeof:me,Provider:null,Consumer:null,_currentValue:Q,_currentValue2:Q,_threadCount:0};function dy(e,t,a,n,l,i,u,r,p){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=xa(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xa(0),this.hiddenUpdates=xa(null),this.identifierPrefix=n,this.onUncaughtError=l,this.onCaughtError=i,this.onRecoverableError=u,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=p,this.incompleteTransitions=new Map}function mm(e,t,a,n,l,i,u,r,p,z,R,G){return e=new dy(e,t,a,u,p,z,R,G,r),t=1,i===!0&&(t|=24),i=na(3,null,null,t),e.current=i,i.stateNode=e,t=Us(),t.refCount++,e.pooledCache=t,t.refCount++,i.memoizedState={element:n,isDehydrated:a,cache:t},Ls(i),e}function hm(e){return e?(e=tl,e):tl}function pm(e,t,a,n,l,i){l=hm(l),n.context===null?n.context=l:n.pendingContext=l,n=an(t),n.payload={element:a},i=i===void 0?null:i,i!==null&&(n.callback=i),a=nn(e,n,t),a!==null&&(It(a,e,t),Il(a,e,t))}function ym(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function no(e,t){ym(e,t),(e=e.alternate)&&ym(e,t)}function gm(e){if(e.tag===13||e.tag===31){var t=Cn(e,67108864);t!==null&&It(t,e,67108864),no(e,67108864)}}function bm(e){if(e.tag===13||e.tag===31){var t=ua();t=Ze(t);var a=Cn(e,t);a!==null&&It(a,e,t),no(e,t)}}var Lc=!0;function fy(e,t,a,n){var l=D.T;D.T=null;var i=I.p;try{I.p=2,lo(e,t,a,n)}finally{I.p=i,D.T=l}}function my(e,t,a,n){var l=D.T;D.T=null;var i=I.p;try{I.p=8,lo(e,t,a,n)}finally{I.p=i,D.T=l}}function lo(e,t,a,n){if(Lc){var l=io(n);if(l===null)Xu(e,t,n,qc,a),Sm(e,n);else if(py(l,e,t,a,n))n.stopPropagation();else if(Sm(e,n),t&4&&-1<hy.indexOf(e)){for(;l!==null;){var i=Xn(l);if(i!==null)switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var u=be(i.pendingLanes);if(u!==0){var r=i;for(r.pendingLanes|=2,r.entangledLanes|=2;u;){var p=1<<31-te(u);r.entanglements[1]|=p,u&=~p}ka(i),(Ve&6)===0&&(wc=rt()+500,hi(0))}}break;case 31:case 13:r=Cn(i,2),r!==null&&It(r,i,2),Tc(),no(i,2)}if(i=io(n),i===null&&Xu(e,t,n,qc,a),i===l)break;l=i}l!==null&&n.stopPropagation()}else Xu(e,t,n,null,a)}}function io(e){return e=cs(e),co(e)}var qc=null;function co(e){if(qc=null,e=$n(e),e!==null){var t=_(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=b(t),e!==null)return e;e=null}else if(a===31){if(e=U(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return qc=e,null}function vm(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(dt()){case Qt:return 2;case ea:return 8;case jt:case Ka:return 32;case St:return 268435456;default:return 32}default:return 32}}var so=!1,pn=null,yn=null,gn=null,xi=new Map,wi=new Map,bn=[],hy="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Sm(e,t){switch(e){case"focusin":case"focusout":pn=null;break;case"dragenter":case"dragleave":yn=null;break;case"mouseover":case"mouseout":gn=null;break;case"pointerover":case"pointerout":xi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":wi.delete(t.pointerId)}}function _i(e,t,a,n,l,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:a,eventSystemFlags:n,nativeEvent:i,targetContainers:[l]},t!==null&&(t=Xn(t),t!==null&&gm(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,l!==null&&t.indexOf(l)===-1&&t.push(l),e)}function py(e,t,a,n,l){switch(t){case"focusin":return pn=_i(pn,e,t,a,n,l),!0;case"dragenter":return yn=_i(yn,e,t,a,n,l),!0;case"mouseover":return gn=_i(gn,e,t,a,n,l),!0;case"pointerover":var i=l.pointerId;return xi.set(i,_i(xi.get(i)||null,e,t,a,n,l)),!0;case"gotpointercapture":return i=l.pointerId,wi.set(i,_i(wi.get(i)||null,e,t,a,n,l)),!0}return!1}function xm(e){var t=$n(e.target);if(t!==null){var a=_(t);if(a!==null){if(t=a.tag,t===13){if(t=b(a),t!==null){e.blockedOn=t,zt(e.priority,function(){bm(a)});return}}else if(t===31){if(t=U(a),t!==null){e.blockedOn=t,zt(e.priority,function(){bm(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Yc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=io(e.nativeEvent);if(a===null){a=e.nativeEvent;var n=new a.constructor(a.type,a);is=n,a.target.dispatchEvent(n),is=null}else return t=Xn(a),t!==null&&gm(t),e.blockedOn=a,!1;t.shift()}return!0}function wm(e,t,a){Yc(e)&&a.delete(t)}function yy(){so=!1,pn!==null&&Yc(pn)&&(pn=null),yn!==null&&Yc(yn)&&(yn=null),gn!==null&&Yc(gn)&&(gn=null),xi.forEach(wm),wi.forEach(wm)}function Gc(e,t){e.blockedOn===t&&(e.blockedOn=null,so||(so=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,yy)))}var $c=null;function _m(e){$c!==e&&($c=e,s.unstable_scheduleCallback(s.unstable_NormalPriority,function(){$c===e&&($c=null);for(var t=0;t<e.length;t+=3){var a=e[t],n=e[t+1],l=e[t+2];if(typeof n!="function"){if(co(n||a)===null)continue;break}var i=Xn(a);i!==null&&(e.splice(t,3),t-=3,iu(i,{pending:!0,data:l,method:a.method,action:n},n,l))}}))}function jl(e){function t(p){return Gc(p,e)}pn!==null&&Gc(pn,e),yn!==null&&Gc(yn,e),gn!==null&&Gc(gn,e),xi.forEach(t),wi.forEach(t);for(var a=0;a<bn.length;a++){var n=bn[a];n.blockedOn===e&&(n.blockedOn=null)}for(;0<bn.length&&(a=bn[0],a.blockedOn===null);)xm(a),a.blockedOn===null&&bn.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(n=0;n<a.length;n+=3){var l=a[n],i=a[n+1],u=l[Zt]||null;if(typeof i=="function")u||_m(a);else if(u){var r=null;if(i&&i.hasAttribute("formAction")){if(l=i,u=i[Zt]||null)r=u.formAction;else if(co(l)!==null)continue}else r=u.action;typeof r=="function"?a[n+1]=r:(a.splice(n,3),n-=3),_m(a)}}}function Tm(){function e(i){i.canIntercept&&i.info==="react-transition"&&i.intercept({handler:function(){return new Promise(function(u){return l=u})},focusReset:"manual",scroll:"manual"})}function t(){l!==null&&(l(),l=null),n||setTimeout(a,20)}function a(){if(!n&&!navigation.transition){var i=navigation.currentEntry;i&&i.url!=null&&navigation.navigate(i.url,{state:i.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var n=!1,l=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){n=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),l!==null&&(l(),l=null)}}}function uo(e){this._internalRoot=e}Xc.prototype.render=uo.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(d(409));var a=t.current,n=ua();pm(a,n,e,t,null,null)},Xc.prototype.unmount=uo.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;pm(e.current,2,null,e,null,null),Tc(),t[Gn]=null}};function Xc(e){this._internalRoot=e}Xc.prototype.unstable_scheduleHydration=function(e){if(e){var t=ta();e={blockedOn:null,target:e,priority:t};for(var a=0;a<bn.length&&t!==0&&t<bn[a].priority;a++);bn.splice(a,0,e),a===0&&xm(e)}};var jm=f.version;if(jm!=="19.2.6")throw Error(d(527,jm,"19.2.6"));I.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(d(188)):(e=Object.keys(e).join(","),Error(d(268,e)));return e=h(t),e=e!==null?A(e):null,e=e===null?null:e.stateNode,e};var gy={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:D,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Qc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Qc.isDisabled&&Qc.supportsFiber)try{N=Qc.inject(gy),q=Qc}catch{}}return ji.createRoot=function(e,t){if(!x(e))throw Error(d(299));var a=!1,n="",l=Nd,i=Dd,u=Od;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onUncaughtError!==void 0&&(l=t.onUncaughtError),t.onCaughtError!==void 0&&(i=t.onCaughtError),t.onRecoverableError!==void 0&&(u=t.onRecoverableError)),t=mm(e,1,!1,null,null,a,n,null,l,i,u,Tm),e[Gn]=t.current,$u(e),new uo(t)},ji.hydrateRoot=function(e,t,a){if(!x(e))throw Error(d(299));var n=!1,l="",i=Nd,u=Dd,r=Od,p=null;return a!=null&&(a.unstable_strictMode===!0&&(n=!0),a.identifierPrefix!==void 0&&(l=a.identifierPrefix),a.onUncaughtError!==void 0&&(i=a.onUncaughtError),a.onCaughtError!==void 0&&(u=a.onCaughtError),a.onRecoverableError!==void 0&&(r=a.onRecoverableError),a.formState!==void 0&&(p=a.formState)),t=mm(e,1,!0,t,a??null,n,l,p,i,u,r,Tm),t.context=hm(null),a=t.current,n=ua(),n=Ze(n),l=an(n),l.callback=null,nn(a,l,n),a=n,t.current.lanes=a,H(t,a),ka(t),e[Gn]=t.current,$u(e),new Xc(t)},ji.version="19.2.6",ji}var Um;function Cy(){if(Um)return ro.exports;Um=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(f){console.error(f)}}return s(),ro.exports=jy(),ro.exports}var Ey=Cy(),v=No(),Sa=Pm();const eh="0.2";function zy(s){let f=Rm[s]||Rm.en;for(const y of[`
50
+ ---
51
+
52
+ > **实施备注`,`
53
+ ---
54
+
55
+ > **Implementation notes`]){const d=f.indexOf(y);d!==-1&&(f=f.slice(0,d))}return f=f.replace(/\n>\s*(首次启动展示|Shown on first launch)[\s\S]*?\n---\n/,`
56
+
57
+ `),f=f.replace(/\n##\s*(一眼看懂|At a glance)[\s\S]*?\n---\n/,`
58
+ `),f.trim()}const Rm={"zh-CN":`# CiCy Desktop 用户协议与授权说明
59
+
60
+ > 首次启动展示 · 草案 v0.2 · 2026-06-07
61
+ > **本协议为使用本软件的前提:你必须阅读并点击"同意并继续"后,方可使用 CiCy Desktop。**
62
+ > (内部草案,非最终法律文本;正式发布前须经中、欧两地持牌律师审定。本文同时作为应用内首启条款的内容源。)
63
+
64
+ ---
65
+
66
+ ## 一眼看懂(你点"同意"即代表接受以下要点)
67
+
68
+ 1. **CiCy Desktop 是在你自己电脑上运行的 AI Agent 编排工具**,帮你调度第三方 AI 助手(Claude Code、Codex、Gemini 等)完成工作。
69
+ 2. **第三方 AI 与账号是你和对应厂商之间的事**:用哪个 AI、用谁的账号、产生的用量与费用,由你决定并承担,与 CiCy 无关。
70
+ 3. **为完成工作,本软件需要一系列对你电脑的授权**(运行程序、执行脚本、控制浏览器、访问文件等)。下面第 3 条逐项讲清,**你对经本软件发起的操作负全部责任**。
71
+ 4. **你的数据默认留在本机**,CiCy 不以运营为目的上传你的工作内容。
72
+ 5. **两项高风险能力需要你单独、额外授权**,默认关闭:**(a) HTTPS 流量本地审计(需装证书、需管理员)**、**(b) 本机命令/脚本执行**。整体同意本协议**不等于**开启它们。
73
+ 6. **严禁**用本软件控制未授权设备、违法多账号/刷量、绕过平台风控、违规抓取等。
74
+
75
+ > 不接受以上任一条,请点击"不同意并退出"。**未同意则无法使用本软件。**
76
+
77
+ ---
78
+
79
+ ## 1. 关于 CiCy Desktop
80
+
81
+ 1.1 CiCy Desktop(下称"本软件")是一款在你本地设备运行的 AI Agent 编排与自动化工具,用于组织、调度第三方 AI 命令行/客户端(如 Claude Code、OpenAI Codex、Google Gemini CLI 等,下称"第三方 Agent")协同完成任务。
82
+
83
+ 1.2 本软件本身**不提供大模型推理服务**,也不内置任何用于规避地域限制的跨境网络通道。模型能力由你选择的后端提供。
84
+
85
+ ## 2. 第三方 Agent 与账号(免责)
86
+
87
+ 2.1 你可在本软件中接入第三方 Agent。**你与第三方 Agent 及其模型/服务提供商之间的关系(账号注册、登录、授权、用量、计费、合规)由你与该提供商直接建立并承担,与 CiCy 无关。**
88
+
89
+ 2.2 **官方登录责任自负**:若你以第三方提供商的官方账号登录其 Agent,该行为及其后果(包括是否符合该提供商所在地与你所在地的可用性政策)由你自行负责。CiCy 不引导、不代理、不内置任何专用于规避地域限制的网络通道。
90
+
91
+ 2.3 你须遵守你所接入的每一个第三方 Agent 与模型服务的用户协议与使用政策。
92
+
93
+ ---
94
+
95
+ ## 3. 授权说明(本软件需要你授予的权限)
96
+
97
+ > 为让 AI Agent 替你完成工作,本软件需要下列对你设备的授权。我们按风险高低分为三类,并说明每项的**用途、作用范围、风险、能否撤销**。**透明披露是本协议的核心。**
98
+
99
+ ### 3A. 基础授权(同意本协议即授予,为软件运行所必需)
100
+
101
+ | 授权 | 用途 | 范围与限制 | 可否撤销 |
102
+ |---|---|---|---|
103
+ | **本地文件读写** | 读写工作区、配置、任务历史 | 限于本软件工作目录及你在任务中明确指向的文件 | 卸载软件即终止 |
104
+ | **运行第三方 Agent** | 在你电脑上启动 claude/codex/gemini 等子进程 | 仅运行你已接入的 Agent | 移除对应 Agent |
105
+ | **本地数据存储** | 保存审计/历史/配置于本机 | 数据留本机,不上传 | 可在设置清除 |
106
+ | **读取系统与窗口信息** | 调度、展示运行状态 | OS/硬件概要、窗口列表;不含文件内容 | 卸载即终止 |
107
+ | **本机网络访问** | 代表你向你选择的模型后端/服务发起请求 | 按你的配置出网;不内置规避地域限制的通道 | 可在设置关闭联网功能 |
108
+
109
+ ### 3B. 高风险授权(默认关闭,需你**单独、额外**同意后才启用)
110
+
111
+ > 整体同意本协议**不会**自动开启以下任何一项。每项都需要你在应用内单独操作开启,并可随时关闭。
112
+
113
+ **① 本机命令与脚本执行**
114
+ - **用途**:让 AI Agent 能在你电脑上执行 shell / Python / Node 脚本,以完成自动化任务。
115
+ - **风险(请认真阅读)**:这等同于授予程序在你电脑上**运行代码的能力**。请仅在你信任的任务场景启用。
116
+ - **门控与保护**:仅作用于**本机**;全部执行写入本地审计留痕;对高危命令可设二次确认。
117
+ - **撤销**:可在设置中关闭执行能力。
118
+
119
+ **② 远程编排配对**
120
+ - **用途**:允许你**显式配对**的编排端(可能运行在云端或另一台设备)通过安全信道驱动本机 Agent,实现远程协作调度。
121
+ - **风险**:配对后,远程编排端可触发上述本机能力。
122
+ - **门控与保护**:**仅连接你显式配对、授权令牌可随时吊销**的编排端;绝不静默安装、绝不自我传播;你可解除配对立即断开。
123
+ - **撤销**:解除配对 / 吊销令牌。
124
+
125
+ **③ 系统根证书信任库写入(需管理员授权)**
126
+ - **用途**:为下方第 4 条的 HTTPS 流量本地审计所必需——将一张**仅属于本机**的审计证书装入系统信任库。
127
+ - **风险**:写入系统信任根是高敏感操作,故需管理员授权,且本软件**绝不**预置或分发统一证书(详见第 4 条)。
128
+ - **撤销**:\`uninstall-ca\` 一键卸载并清除同意标记。
129
+
130
+ **④ HTTPS 流量本地审计** —— 见第 4 条专章。
131
+
132
+ ### 3C. 任务执行中按需使用的授权(可在设置中逐项关闭)
133
+
134
+ | 授权 | 用途 | 范围与限制 |
135
+ |---|---|---|
136
+ | **浏览器控制** | 打开/导航网页、在你授权的浏览器会话中读取页面或注入脚本、读写 Cookie | 仅作用于本软件管理或你授权的浏览器会话 |
137
+ | **剪贴板读写** | 在自动化流程中传递文本 | 按任务需要;可关闭 |
138
+ | **屏幕/窗口截图** | 让 Agent"看见"界面以完成操作 | 截图留本机,不上传 |
139
+ | **多账号隔离 + 每账号代理** | 为不同身份隔离 Cookie/存储/出口 IP(如多店运营、多客户隔离交付) | **仅供合法的多账号管理;不得用于违法养号、刷量或对抗平台风控**(见第 5 条) |
140
+
141
+ ---
142
+
143
+ ## 4. HTTPS 流量本地审计(可选 · 默认关闭 · 需显式同意 · 需管理员)
144
+
145
+ 4.1 本软件提供可选的"HTTPS 流量本地审计"功能,用于对**你本机**发往 AI 厂商(如 Claude / OpenAI / DeepSeek / Gemini)的加密请求进行本地安全审计、敏感信息脱敏与策略治理。
146
+
147
+ 4.2 **该功能默认关闭。** 仅当你在应用内主动点击启用、并完成管理员授权后才生效。启用时:
148
+ - 本软件在你本机生成一张**仅属于本机、独一无二**的审计证书(绝不使用预置或跨设备共用的证书),并请求装入本机系统信任库;
149
+ - 安装后,你本机到上述 **AI 厂商域名**的 HTTPS 流量将被本地解密以供审计;**解密范围严格限于这些 AI 厂商域名;其余一切流量(网银、社交、其他网站等)不被解密、不被读取**;
150
+ - **解密后的数据仅保存在你本机**,不上传至任何服务器。
151
+
152
+ 4.3 **可随时撤销**:你可在设置中关闭该功能并卸载证书(\`uninstall-ca\`),撤销后不再解密任何流量,同意标记一并清除。
153
+
154
+ 4.4 **多用户/团队场景的告知义务**:若你将本软件部署于供多人使用的设备或环境,并对他人流量启用审计,则你(部署方)须自行、事先向相关人员明确告知并取得同意,且仅限经营管理之必要范围。该告知与同意义务由你承担。
155
+
156
+ ## 5. 自动化与设备控制的合法使用(用户责任)
157
+
158
+ 5.1 本软件第 3 条所述能力均为通用自动化/RPA 工具能力。
159
+
160
+ 5.2 **授权边界**:这些能力仅可作用于**你本人拥有或已获明确授权**的设备与账号。**严禁**访问或控制你无权限的计算机系统。
161
+
162
+ 5.3 **禁止用途**,包括但不限于:
163
+ - (a) 入侵、非法控制、干扰他人计算机信息系统;
164
+ - (b) 违反平台规则的批量注册、刷量、刷单、薅羊毛及其他违法多账号行为;
165
+ - (c) 绕过、对抗目标平台的风控或技术保护措施;
166
+ - (d) 违反目标网站 robots 协议、用户条款或法律的数据抓取;
167
+ - (e) 无合法依据抓取或处理他人个人信息;
168
+ - (f) 任何违反你所在地或目标对象所在地法律法规的行为。
169
+
170
+ 5.4 **你对经由本软件发起的全部操作及其后果承担全部责任。** CiCy 仅提供通用工具能力,不对你的具体使用方式负责;若你的使用导致第三方索赔或行政/刑事追究,由你承担并使 CiCy 免责。
171
+
172
+ ## 6. 个人信息与隐私
173
+
174
+ 6.1 本软件遵循本地优先、最小必要原则处理数据,不以运营为目的收集上传你的工作内容。
175
+
176
+ 6.2 当你在涉及个人信息的场景使用本软件(对含个人信息的流量审计、抓取或处理),在适用《个人信息保护法》(中国)、GDPR(欧盟)等法律时,**你或你所属组织可能构成个人信息处理者 / 数据控制者**,须自行履行相应义务(告知同意、处理记录、数据主体权利响应、必要时的数据保护影响评估与泄露通报等)。
177
+
178
+ 6.3 涉及欧盟个人数据出境的,须具备 GDPR 第五章要求的合法传输机制(如标准合同条款 SCC)与你的明确同意。
179
+
180
+ 6.4 **按地区选择模型后端**:为符合不同司法辖区法律,本软件按你所在地区选择默认模型后端(例如中国大陆用户默认使用已在中国境内备案的模型服务);跨境传输个人数据须经你单独明确同意。
181
+
182
+ ## 7. AI 生成内容
183
+
184
+ 7.1 你使用本软件及第三方 Agent 生成的内容,须遵守你所在地关于 AI 生成合成内容标识的法律义务(如中国《人工智能生成合成内容标识办法》、欧盟 AI Act 的透明度要求)。CiCy 在适用范围内提供标识/披露能力,但合规使用责任在你。
185
+
186
+ ## 8. 合规与适用法域
187
+
188
+ 8.1 你须遵守你所在地、以及你的操作所指向对象所在地的全部适用法律、法规与平台条款,**尤其包括中国与欧盟的相关规定**。
189
+
190
+ 8.2 本软件按"法域感知"原则对不同地区适用不同默认与限制,但这不免除你自行确保合规的责任。
191
+
192
+ ## 9. 免责声明与责任限制
193
+
194
+ 9.1 本软件按"现状"提供,在适用法律允许的最大范围内,不作适销性、特定用途适用性的默示担保。
195
+
196
+ 9.2 在适用法律允许的最大范围内,对于你违反本条款,或因你使用第三方 Agent / 自动化能力 / 审计功能产生的任何直接或间接损失、第三方索赔、行政或刑事责任,CiCy 不承担责任,且你应使 CiCy 免受相关追偿。
197
+
198
+ 9.3 本条款不排除或限制依强制性法律不可排除的责任(如人身伤害或欺诈责任)。
199
+
200
+ ## 10. 同意与生效
201
+
202
+ 10.1 **本协议是使用本软件的前提。** 点击"同意并继续",即表示你已阅读、理解并接受本协议全部条款;点击"不同意并退出"或不作选择的,**无法使用本软件**。
203
+
204
+ 10.2 第 3B 条高风险授权(本机命令/脚本执行、远程编排配对、根证书写入)与第 4 条 HTTPS 审计,**需你在应用内单独操作开启**;你对本协议的整体同意**不构成**对这些功能的启用。
205
+
206
+ 10.3 你可随时在设置中查看、关闭或撤销第 3 条所列各项授权。
207
+
208
+ ---
209
+
210
+ > **实施备注(非条款,给产品/法务):**
211
+ > - 首启 = 阻断式条款:展示"一眼看懂"6 条 + "同意并继续 / 不同意并退出";未同意不进主界面。完整条款可展开/外链。
212
+ > - **第二道独立同意**:第 4 条审计 = w-10026 的同意卡片三态(未授权/已授权/处理中);第 3B① 执行能力、3B② 远程配对建议也各设独立开关与首用确认。
213
+ > - 后端门控:第 4 条对应 w-10084 的 \`~/cicy-ai/mitm/ca-trust-consent\` flag + \`exec cicy-code mitm install-ca/uninstall-ca\`。
214
+ > - 容器/无头部署:\`CICY_CA_TRUST_CONSENT=1\` 逃生门 = "设置该环境变量即代表部署方代表其环境作出第 4.4 条告知同意",责任落部署方;须写入部署文档。
215
+ > - 正式版:中文 + 英文(欧盟)双语;按法域分版本可能调整第 3C/6/8 条措辞;高风险授权建议保留**用户可撤销的审计日志**作为同意证据。
216
+ `,en:`# CiCy Desktop — Terms of Use & Authorization Notice
217
+
218
+ > Shown on first launch · Draft v0.2 · 2026-06-07
219
+ > **Acceptance of these Terms is a precondition to using the software: you must read and click "Agree and continue" before you can use CiCy Desktop.**
220
+ > (Internal draft, not final legal text; must be reviewed by licensed counsel in both China and the EU before public release. This document also serves as the content source for the in-app first-launch terms.)
221
+
222
+ ---
223
+
224
+ ## At a glance (clicking "Agree" means you accept the following)
225
+
226
+ 1. **CiCy Desktop is an AI agent orchestration tool that runs on your own computer**, helping you coordinate third-party AI assistants (Claude Code, Codex, Gemini, etc.) to get work done.
227
+ 2. **Third-party AI and accounts are between you and the respective provider**: which AI you use, whose account you log in with, and the resulting usage and fees are your decision and your responsibility — not CiCy's.
228
+ 3. **To do the work, the software needs a range of authorizations on your computer** (running programs, executing scripts, controlling the browser, accessing files, etc.). These are explained item by item in Section 3. **You are fully responsible for the operations initiated through the software.**
229
+ 4. **Your data stays on your machine by default.** CiCy does not upload your work content for operational purposes.
230
+ 5. **Two high-risk capabilities require your separate, additional authorization and are off by default**: **(a) local HTTPS traffic auditing (installs a certificate, requires administrator)** and **(b) local command/script execution**. Accepting these Terms as a whole does **not** turn them on.
231
+ 6. **You must not** use the software to control unauthorized devices, conduct unlawful multi-accounting / traffic faking, circumvent platform risk controls, or scrape in violation of terms.
232
+
233
+ > If you do not accept any of the above, please click "Decline and exit." **Without acceptance, you cannot use the software.**
234
+
235
+ ---
236
+
237
+ ## 1. About CiCy Desktop
238
+
239
+ 1.1 CiCy Desktop (the "Software") is an AI agent orchestration and automation tool that runs on your local device, used to organize and coordinate third-party AI command-line tools / clients (such as Claude Code, OpenAI Codex, Google Gemini CLI, etc., the "Third-Party Agents") to complete tasks collaboratively.
240
+
241
+ 1.2 The Software itself **does not provide large-model inference services**, nor does it embed any cross-border network channel designed to circumvent regional restrictions. Model capabilities are provided by the backend you choose.
242
+
243
+ ## 2. Third-Party Agents and Accounts (Disclaimer)
244
+
245
+ 2.1 You may connect Third-Party Agents within the Software. **The relationship between you and a Third-Party Agent and its model/service provider (registration, login, authorization, usage, billing, compliance) is established directly between you and that provider and borne by you — it is unrelated to CiCy.**
246
+
247
+ 2.2 **You are solely responsible for official logins.** If you log in to a Third-Party Agent using that provider's official account, that act and its consequences (including whether it complies with the availability policies of the provider's jurisdiction and your own) are your responsibility. CiCy does not steer you toward, proxy, or embed any channel dedicated to circumventing regional restrictions.
248
+
249
+ 2.3 You must comply with the user agreement, usage policies, and acceptable-use scope of every Third-Party Agent and model service you connect.
250
+
251
+ ---
252
+
253
+ ## 3. Authorization Notice (permissions the Software requires from you)
254
+
255
+ > To let AI agents do work on your behalf, the Software needs the following authorizations on your device. We group them by risk level and explain each one's **purpose, scope, risk, and whether it can be revoked**. **Transparent disclosure is at the heart of these Terms.**
256
+
257
+ ### 3A. Basic authorizations (granted by accepting these Terms; required for the Software to run)
258
+
259
+ | Authorization | Purpose | Scope & limits | Revocable |
260
+ |---|---|---|---|
261
+ | **Local file read/write** | Read/write the workspace, configuration, task history | Limited to the Software's working directory and files you explicitly target in a task | Uninstall to end |
262
+ | **Run Third-Party Agents** | Launch sub-processes such as claude/codex/gemini on your computer | Only the Agents you have connected | Remove the Agent |
263
+ | **Local data storage** | Store audit/history/configuration locally | Data stays on your machine; not uploaded | Clear in settings |
264
+ | **Read system & window info** | Scheduling and status display | OS/hardware summary, window list; no file contents | Uninstall to end |
265
+ | **Local network access** | Make requests to the model backend/service you chose, on your behalf | Outbound per your configuration; no embedded circumvention channel | Disable networking in settings |
266
+
267
+ ### 3B. High-risk authorizations (off by default; enabled only after your **separate, explicit** consent)
268
+
269
+ > Accepting these Terms as a whole will **not** automatically enable any of the following. Each requires a separate action in the app to turn on, and can be turned off at any time.
270
+
271
+ **① Local command and script execution**
272
+ - **Purpose**: Allow AI agents to execute shell / Python / Node scripts on your computer to complete automation tasks.
273
+ - **Risk (please read carefully)**: This is equivalent to granting a program the **ability to run code** on your computer. Enable it only in tasks you trust.
274
+ - **Controls**: Acts on the **local machine** only; all executions are written to a local audit trail; high-risk commands can require secondary confirmation.
275
+ - **Revoke**: Disable execution in settings.
276
+
277
+ **② Remote orchestration pairing**
278
+ - **Purpose**: Allow an orchestrator you have **explicitly paired** (which may run in the cloud or on another device) to drive the local Agents over a secure channel, enabling remote collaborative scheduling.
279
+ - **Risk**: Once paired, the remote orchestrator can trigger the local capabilities above.
280
+ - **Controls**: Connects **only to orchestrators you have explicitly paired, with a token you can revoke at any time**; never installs silently, never self-propagates; you can unpair to disconnect immediately.
281
+ - **Revoke**: Unpair / revoke the token.
282
+
283
+ **③ System root certificate trust store write (requires administrator)**
284
+ - **Purpose**: Required for the HTTPS traffic auditing in Section 4 — installing a **machine-specific** audit certificate into the system trust store.
285
+ - **Risk**: Writing to the system trust root is a highly sensitive operation, so it requires administrator authorization, and the Software **never** pre-installs or distributes a shared certificate (see Section 4).
286
+ - **Revoke**: \`uninstall-ca\` removes it and clears the consent flag in one step.
287
+
288
+ **④ Local HTTPS traffic auditing** — see the dedicated Section 4.
289
+
290
+ ### 3C. Authorizations used on demand during tasks (each can be disabled in settings)
291
+
292
+ | Authorization | Purpose | Scope & limits |
293
+ |---|---|---|
294
+ | **Browser control** | Open/navigate pages, read pages or inject scripts in browser sessions you authorize, read/write cookies | Only browser sessions managed by the Software or authorized by you |
295
+ | **Clipboard read/write** | Pass text within automation flows | As needed by the task; can be disabled |
296
+ | **Screen/window capture** | Let an Agent "see" the interface to complete an operation | Screenshots stay local; not uploaded |
297
+ | **Multi-account isolation + per-account proxy** | Isolate cookies/storage/egress IP per identity (e.g. multi-store operations, multi-client isolated delivery) | **For lawful multi-account management only; must not be used for unlawful account farming, traffic faking, or defeating platform risk controls** (see Section 5) |
298
+
299
+ ---
300
+
301
+ ## 4. Local HTTPS Traffic Auditing (optional · off by default · requires explicit consent · requires administrator)
302
+
303
+ 4.1 The Software offers an optional "Local HTTPS Traffic Auditing" feature, used to perform local security auditing, sensitive-data redaction, and policy governance on encrypted requests sent from **your machine** to AI providers (such as Claude / OpenAI / DeepSeek / Gemini).
304
+
305
+ 4.2 **This feature is off by default.** It takes effect only when you actively click to enable it in the app and complete administrator authorization. When enabled:
306
+ - The Software generates a **machine-specific, unique** audit certificate on your machine (never a pre-installed or cross-device shared certificate) and requests to install it into your system trust store;
307
+ - Once installed, HTTPS traffic from your machine to the **AI provider domains** above is decrypted locally for auditing; **the scope of decryption is strictly limited to those AI provider domains; all other traffic (banking, social, other websites, etc.) is never decrypted or read**;
308
+ - **Decrypted data is stored only on your machine** and is not uploaded to any server.
309
+
310
+ 4.3 **Revocable at any time**: You can disable the feature and uninstall the certificate (\`uninstall-ca\`) in settings; after revocation no traffic is decrypted, and the consent flag is cleared.
311
+
312
+ 4.4 **Disclosure obligation in multi-user/team settings**: If you deploy the Software on a device or environment used by multiple people and enable auditing on others' traffic, then you (the deployer) must, on your own and in advance, clearly inform the affected persons and obtain their consent, limited to what is necessary for business management. This disclosure-and-consent obligation rests with you.
313
+
314
+ ## 5. Lawful Use of Automation and Device Control (User Responsibility)
315
+
316
+ 5.1 The capabilities described in Section 3 are general-purpose automation/RPA tool capabilities.
317
+
318
+ 5.2 **Authorization boundary**: These capabilities may act only on devices and accounts **you own or are expressly authorized to use**. Accessing or controlling computer systems you are not authorized for is **strictly prohibited**.
319
+
320
+ 5.3 **Prohibited uses**, including but not limited to:
321
+ - (a) intruding into, unlawfully controlling, or interfering with others' computer information systems;
322
+ - (b) bulk registration, traffic/order faking, "wool-pulling," and other unlawful multi-accounting in violation of platform rules;
323
+ - (c) circumventing or defeating a target platform's risk controls or technical protection measures;
324
+ - (d) data scraping in violation of a target site's robots protocol, terms of use, or applicable law;
325
+ - (e) collecting or processing others' personal information without a lawful basis;
326
+ - (f) any act that violates the laws and regulations of your jurisdiction or that of the target.
327
+
328
+ 5.4 **You bear full responsibility for all operations initiated through the Software and their consequences.** CiCy provides only general-purpose tool capabilities and is not responsible for your specific manner of use; if your use leads to third-party claims or administrative/criminal liability, you shall bear it and hold CiCy harmless.
329
+
330
+ ## 6. Personal Information and Privacy
331
+
332
+ 6.1 The Software processes data on a local-first, minimum-necessary basis and does not collect or upload your work content for operational purposes.
333
+
334
+ 6.2 When you use the Software in scenarios involving personal information (auditing, scraping, or processing traffic that contains personal information), under applicable laws such as the Personal Information Protection Law (China) and the GDPR (EU), **you or your organization may constitute a personal-information processor / data controller** and must fulfill the corresponding obligations on your own (notice and consent, records of processing, responding to data-subject rights, and where necessary data protection impact assessments and breach notifications).
335
+
336
+ 6.3 Where EU personal data is transferred out of the EU, a lawful transfer mechanism required by Chapter V of the GDPR (such as Standard Contractual Clauses) and your explicit consent are required.
337
+
338
+ 6.4 **Region-based backend selection**: To comply with the laws of different jurisdictions, the Software selects a default model backend based on your region (for example, users in mainland China default to model services filed/registered within China); cross-border transfer of personal data requires your separate, explicit consent.
339
+
340
+ ## 7. AI-Generated Content
341
+
342
+ 7.1 Content you generate using the Software and Third-Party Agents is subject to the AI-generated-content labeling obligations of your jurisdiction (such as China's Measures for Labeling AI-Generated Synthetic Content and the transparency requirements of the EU AI Act). CiCy provides labeling/disclosure capabilities where applicable, but the responsibility for compliant use rests with you.
343
+
344
+ ## 8. Compliance and Applicable Jurisdictions
345
+
346
+ 8.1 You must comply with all applicable laws, regulations, and platform terms of your jurisdiction and of the jurisdiction your operations target, **including in particular those of China and the EU**.
347
+
348
+ 8.2 The Software applies different defaults and restrictions to different regions on a "jurisdiction-aware" basis, but this does not relieve you of your own responsibility to ensure compliance.
349
+
350
+ ## 9. Disclaimer and Limitation of Liability
351
+
352
+ 9.1 The Software is provided "as is"; to the maximum extent permitted by applicable law, no implied warranties of merchantability or fitness for a particular purpose are made.
353
+
354
+ 9.2 To the maximum extent permitted by applicable law, CiCy is not liable for any direct or indirect loss, third-party claim, or administrative or criminal liability arising from your breach of these Terms or from your use of Third-Party Agents / automation capabilities / the auditing feature, and you shall hold CiCy harmless against related claims.
355
+
356
+ 9.3 Nothing in these Terms excludes or limits liability that cannot be excluded under mandatory law (such as liability for personal injury or fraud).
357
+
358
+ ## 10. Consent and Effect
359
+
360
+ 10.1 **These Terms are a precondition to using the Software.** Clicking "Agree and continue" means you have read, understood, and accepted all of these Terms; if you click "Decline and exit" or make no choice, you **cannot use the Software**.
361
+
362
+ 10.2 The high-risk authorizations in Section 3B (local command/script execution, remote orchestration pairing, root certificate write) and the HTTPS auditing in Section 4 **must be enabled by you through separate actions in the app**; your overall acceptance of these Terms does **not** constitute enabling those features.
363
+
364
+ 10.3 You may review, disable, or revoke each authorization listed in Section 3 at any time in settings.
365
+
366
+ ---
367
+
368
+ > **Implementation notes (not part of the Terms; for product/legal):**
369
+ > - First launch = blocking terms: show the 6 "at a glance" points + "Agree and continue / Decline and exit"; no entry to the main UI without acceptance. Full Terms expandable/linked.
370
+ > - **Second, separate consent**: Section 4 auditing = the three-state consent card (not-granted / granted / processing); the Section 3B① execution and 3B② remote-pairing capabilities should likewise have their own switches and first-use confirmation.
371
+ > - Backend gating: Section 4 corresponds to the \`~/cicy-ai/mitm/ca-trust-consent\` flag + \`exec cicy-code mitm install-ca/uninstall-ca\`.
372
+ > - Container/headless deployment: if using the \`CICY_CA_TRUST_CONSENT=1\` escape hatch, "setting this environment variable means the deployer has, on behalf of its environment, given the notice and consent under Section 4.4"; responsibility rests with the deployer and this must be documented.
373
+ > - Production: zh + en (EU) bilingual; wording of Sections 3C/6/8 may be adjusted per jurisdiction; high-risk authorizations should retain a user-revocable audit log as evidence of consent.
374
+ `};function ky(s){return s.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Ln(s){return ky(s).replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>").replace(/`([^`]+)`/g,"<code>$1</code>")}function Hm(s){return s.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(f=>f.trim())}function Ay(s){const f=String(s||"").replace(/\r\n/g,`
375
+ `).split(`
376
+ `),y=[];let d=0;for(;d<f.length;){const x=f[d];if(!x.trim()){d++;continue}if(/^---+\s*$/.test(x)){y.push("<hr/>"),d++;continue}const _=/^(#{1,6})\s+(.*)$/.exec(x);if(_){const b=Math.min(_[1].length,6);y.push(`<h${b}>${Ln(_[2])}</h${b}>`),d++;continue}if(x.trim().startsWith("|")&&d+1<f.length&&/^\s*\|?[\s:|-]+\|?\s*$/.test(f[d+1])&&f[d+1].includes("-")){const b=Hm(x);d+=2;const U=[];for(;d<f.length&&f[d].trim().startsWith("|");)U.push(Hm(f[d])),d++;let j="<table><thead><tr>";j+=b.map(h=>`<th>${Ln(h)}</th>`).join(""),j+="</tr></thead><tbody>";for(const h of U)j+="<tr>"+h.map(A=>`<td>${Ln(A)}</td>`).join("")+"</tr>";j+="</tbody></table>",y.push(j);continue}if(x.trim().startsWith(">")){const b=[];for(;d<f.length&&f[d].trim().startsWith(">");)b.push(f[d].replace(/^\s*>\s?/,"")),d++;y.push(`<blockquote>${b.map(Ln).join("<br/>")}</blockquote>`);continue}if(/^\s*-\s+/.test(x)){const b=[];for(;d<f.length&&/^\s*-\s+/.test(f[d]);)b.push(`<li>${Ln(f[d].replace(/^\s*-\s+/,""))}</li>`),d++;y.push(`<ul>${b.join("")}</ul>`);continue}if(/^\s*\d+\.\s+/.test(x)){const b=[];for(;d<f.length&&/^\s*\d+\.\s+/.test(f[d]);)b.push(`<li>${Ln(f[d].replace(/^\s*\d+\.\s+/,""))}</li>`),d++;y.push(`<ol>${b.join("")}</ol>`);continue}y.push(`<p>${Ln(x)}</p>`),d++}return y.join(`
377
+ `)}function Ny({title:s,url:f}={}){const y=String(s||"").trim();return y?{ok:!0,patch:{name:y,base_url:String(f||"").trim()}}:{ok:!1,error:"title_required"}}const o=(s,f,y)=>{var x,_;const d=b=>y&&typeof b=="string"?b.replace(/\{\{\s*(\w+)\s*\}\}/g,(U,j)=>y[j]!=null?String(y[j]):U):b;try{const b=(_=(x=window.cicyI18n)==null?void 0:x.t)==null?void 0:_.call(x,s,y);return d(b&&b!==s?b:f)}catch{return d(f)}},Cl="cicy_token",Zc="cicy_access_token",Ci="cicy_user_id",Dy="cicy_guest",El="https://cicy-ai.com",_o=new Set;let Oy=0,xn=[];const Ei=new Map;function Bm(){_o.forEach(s=>s(xn))}const we={show(s={}){const f=s.id||`t${++Oy}`,y=xn.find(_=>_.id===f),d={id:f,status:"running",...y,...s};xn=y?xn.map(_=>_.id===f?d:_):[...xn,d],Bm();const x=Ei.get(f);return x&&(clearTimeout(x),Ei.delete(f)),s.ttl&&Ei.set(f,setTimeout(()=>we.dismiss(f),s.ttl)),f},dismiss(s){xn=xn.filter(y=>y.id!==s);const f=Ei.get(s);f&&(clearTimeout(f),Ei.delete(s)),Bm()}};function My(){const[s,f]=v.useState(xn);return v.useEffect(()=>(_o.add(f),()=>{_o.delete(f)}),[]),s.length?c.jsx("div",{className:"toast-host","data-id":"ToastHost",children:s.map(y=>c.jsxs("div",{className:"toast","data-id":`Toast-${y.id}`,"data-status":y.status||"running",children:[c.jsx("button",{type:"button",className:"toast__x","data-id":"Toast-dismiss",onClick:()=>we.dismiss(y.id),"aria-label":"dismiss",children:"×"}),c.jsxs("span",{className:"toast__msg",children:[y.message,Number.isFinite(y.progress)?` ${y.progress}%`:""]}),Number.isFinite(y.progress)&&c.jsx("span",{className:"toast__bar",children:c.jsx("span",{style:{width:`${Math.min(100,y.progress)}%`}})})]},y.id))}):null}const To=new Set;let yo=0,Je=null;function Sn(){To.forEach(s=>s(Je))}function ki(){return new Date().toTimeString().slice(0,8)}const ct={open({teamId:s,fromVer:f,toVer:y,onRetry:d,title:x,kind:_}={}){Je={teamId:s,title:x||null,fromVer:f||null,toVer:y||null,kind:_||"sidecar",status:"running",phase:"download",progress:null,onInstall:null,logs:[],onRetry:d||null,lastAt:Date.now()},Sn()},setProgress(s){Je&&(Je={...Je,status:"running",progress:s||Je.progress,lastAt:Date.now()},Sn())},ready({onInstall:s,message:f}={}){if(!Je)return;const y={id:++yo,t:ki(),phase:"done",status:"done",message:f||o("updateBanner.readyDrawer","下载完成,点「安装」重启更新")};Je={...Je,status:"ready",phase:"done",progress:{...Je.progress||{},percent:100},onInstall:s||null,minimized:!1,logs:[...Je.logs,y],lastAt:Date.now()},Sn()},push(s={}){if(!Je)return;const f={id:++yo,t:ki(),phase:s.phase||Je.phase,status:s.status||"running",message:s.message||""};Je={...Je,phase:s.phase||Je.phase,toVer:s.toVer||Je.toVer,logs:[...Je.logs,f],lastAt:Date.now()},Sn()},minimize(){Je&&(Je={...Je,minimized:!0},Sn())},restore(){Je&&(Je={...Je,minimized:!1},Sn())},finish({ok:s,message:f}={}){if(!Je)return;const y=s?"done":"error",d={id:++yo,t:ki(),phase:"done",status:y,message:f||(s?o("updateDrawer.done","更新完成"):o("updateDrawer.failed","更新失败"))};Je={...Je,status:y,phase:"done",minimized:!1,logs:[...Je.logs,d],lastAt:Date.now()},Sn()},close(){Je=null,Sn()}},go=["download","swap","done"],Lm=s=>({download:o("updateDrawer.phaseDownload","下载"),swap:o("updateDrawer.phaseSwap","切换"),done:o("updateDrawer.phaseDone","完成")})[s]||s;function Uy(){var U;const[s,f]=v.useState(Je);v.useEffect(()=>(To.add(f),()=>{To.delete(f)}),[]);const y=v.useRef(null);v.useEffect(()=>{const j=y.current;j&&(j.scrollTop=j.scrollHeight)},[(U=s==null?void 0:s.logs)==null?void 0:U.length]);const[d,x]=v.useState(!1);if(v.useEffect(()=>{if(!s||s.status!=="running"){x(!1);return}const j=setInterval(()=>x(Date.now()-(s.lastAt||0)>25e3),3e3);return()=>clearInterval(j)},[s==null?void 0:s.lastAt,s==null?void 0:s.status]),!s)return null;const _=s.status==="running",b=go.findIndex(j=>j===s.phase);return s.minimized?c.jsxs("button",{type:"button",className:`drawer-min drawer-min--${s.status}`,"data-id":"UpdateDrawer-restore",onClick:()=>ct.restore(),children:[c.jsx("span",{className:"drawer-min__spark",children:_?c.jsx($t,{}):s.status==="done"?"✓":s.status==="reboot"?"⟳":"!"}),c.jsxs("span",{className:"drawer-min__label",children:[s.title||o("updateDrawer.title","更新 cicy-code"),s.toVer?` · v${s.toVer}`:""]})]}):c.jsx("div",{className:"drawer-scrim","data-id":"UpdateDrawer-scrim",onClick:()=>_?ct.minimize():ct.close(),children:c.jsxs("div",{className:"drawer","data-id":"UpdateDrawer","data-status":s.status,onClick:j=>j.stopPropagation(),children:[c.jsxs("div",{className:"drawer__head",children:[c.jsxs("div",{className:"drawer__title",children:[c.jsx("span",{className:`drawer__spark drawer__spark--${s.status}`,children:_?c.jsx($t,{}):s.status==="done"?"✓":s.status==="reboot"?"⟳":"!"}),c.jsxs("div",{children:[c.jsx("div",{className:"drawer__h",children:s.title||o("updateDrawer.title","更新 cicy-code")}),c.jsxs("div",{className:"drawer__sub",children:[s.fromVer?`v${s.fromVer}`:o("updateDrawer.current","当前")," → ",s.toVer?`v${s.toVer}`:o("updateDrawer.latest","最新版")]})]})]}),c.jsx("div",{className:"drawer__headbtns",children:c.jsx("button",{type:"button",className:"drawer__x","data-id":"UpdateDrawer-min",title:o("updateDrawer.minimize","最小化"),onClick:()=>ct.minimize(),"aria-label":"minimize",children:"‒"})})]}),s.kind!=="app"&&c.jsx("div",{className:"drawer__steps","data-id":"UpdateDrawer-steps",children:go.map((j,h)=>{const A=Lm(j),T=s.status==="done"||h<b,V=h===b&&_,M=s.status==="error"&&h===b;return c.jsxs("div",{className:`drawer__step${V?" is-active":""}${T?" is-done":""}${M?" is-error":""}`,children:[c.jsx("span",{className:"drawer__step-dot",children:T?"✓":M?"!":h+1}),c.jsx("span",{className:"drawer__step-label",children:A}),h<go.length-1&&c.jsx("span",{className:"drawer__step-bar"})]},j)})}),s.progress&&(()=>{const j=s.progress,h=A=>A?(A/1048576).toFixed(1):"0";return c.jsxs("div",{className:"drawer__dl","data-id":"UpdateDrawer-dl",children:[c.jsxs("div",{className:"drawer__dl-head",children:[c.jsxs("span",{className:"drawer__dl-pct",children:[j.percent||0,"%"]}),c.jsxs("span",{className:"drawer__dl-stats",children:[j.total?`${h(j.transferred)} / ${h(j.total)} MB`:`${h(j.transferred)} MB`,j.bytesPerSec?` · ${h(j.bytesPerSec)} MB/s`:"",j.etaSec?` · ${o("updateBanner.eta","剩 {{s}}s",{s:j.etaSec})}`:""]})]}),c.jsx("div",{className:"drawer__dl-track",children:c.jsx("span",{className:"drawer__dl-fill",style:{width:`${j.percent||0}%`}})})]})})(),c.jsx("div",{className:"drawer__log","data-id":"UpdateDrawer-log",ref:y,children:s.logs.length===0?c.jsx("div",{className:"drawer__log-empty",children:o("updateDrawer.preparing","准备中…")}):s.logs.map(j=>c.jsxs("div",{className:"drawer__line","data-status":j.status,children:[c.jsx("span",{className:"drawer__t",children:j.t}),c.jsx("span",{className:`drawer__badge drawer__badge--${j.phase}`,children:Lm(j.phase)}),c.jsx("span",{className:"drawer__linemsg",children:j.message})]},j.id))}),d&&_&&c.jsx("div",{className:"drawer__hint","data-id":"UpdateDrawer-stuck",children:o("updateDrawer.stuckHint","正在等待新版本就绪,耗时比平常久。可以放到后台继续,完成或失败都会提示。")}),c.jsx("div",{className:"drawer__foot",children:_?c.jsx(c.Fragment,{children:c.jsx("span",{className:"drawer__foot-status",children:s.kind==="app"?o("updateBanner.downloading","正在下载更新")+"…":o("updateDrawer.inProgress","更新进行中…")})}):s.status==="ready"?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"drawer__foot-status is-done",children:o("updateBanner.readyShort","下载完成")}),c.jsx("button",{type:"button",className:"drawer__btn is-accent","data-id":"UpdateDrawer-install",onClick:()=>s.onInstall&&s.onInstall(),children:o("updateBanner.installBtn","立即安装")}),c.jsx("button",{type:"button",className:"drawer__btn","data-id":"UpdateDrawer-later",onClick:()=>ct.close(),children:o("updateBanner.later","稍后")})]}):s.status==="error"?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"drawer__foot-status is-error",children:o("updateDrawer.failed","更新失败")}),s.onRetry&&c.jsx("button",{type:"button",className:"drawer__btn is-accent","data-id":"UpdateDrawer-retry",onClick:()=>s.onRetry(),children:o("common.retry","重试")}),c.jsx("button",{type:"button",className:"drawer__btn","data-id":"UpdateDrawer-dismiss",onClick:()=>ct.close(),children:o("common.close","关闭")})]}):c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"drawer__foot-status is-done",children:o("updateDrawer.updatedLatest","已更新到最新")}),c.jsx("button",{type:"button",className:"drawer__btn is-accent","data-id":"UpdateDrawer-finish",onClick:()=>ct.close(),children:o("common.done","完成")})]})})]})})}const th=/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/,Yn="desktop-",ah="limeng9088@gmail.com",Ol=s=>s&&!s.startsWith(Yn)?Yn+s:s||"",qn=s=>String(s||"").replace(new RegExp("^"+Yn),""),qm={flex:"1 1 0%",minWidth:0,maxWidth:"100%",font:"inherit",boxSizing:"border-box",height:22,lineHeight:"20px",padding:"0 6px",borderRadius:6,border:"1px solid transparent"};async function Di(s){var _,b;const f=await((_=window.electronRPC)==null?void 0:_.call(window,"get_windows",{})),y=(f&&f.content||[]).map(U=>U&&U.text).join("");let d=1;try{const U=JSON.parse(y);U&&U.length&&(d=U[0].id)}catch{}const x=await((b=window.electronRPC)==null?void 0:b.call(window,"control_electron_BrowserWindow",{win_id:d,code:s}));return(x&&x.content||[]).map(U=>U&&U.text).join("")}const Ry=`(()=>{const r=process.mainModule.require.bind(process.mainModule);
378
+ const os=r("os"),fs=r("fs"),path=r("path");
379
+ try{const c=JSON.parse(fs.readFileSync(path.join(os.homedir(),"cicy-ai","global.json"),"utf8"));
380
+ return String((c.hubAuth||{}).token||"")}catch(e){return ""}})()`,Hy=`(()=>{const r=process.mainModule.require.bind(process.mainModule);
381
+ const os=r("os"),fs=r("fs"),path=r("path");
382
+ // Identity source, in order:
383
+ // 1) a numeric txt on the operator's Desktop (C:/Users/xs/Desktop/1007.txt) —
384
+ // the machine's number, dropped there by whoever set the box up. This is the
385
+ // ground truth; its filename is the id. Forward slashes only, so this string
386
+ // survives a second eval (a backslash path breaks with "invalid hex escape").
387
+ // 2) ~/cicy-ai/team.txt, 3) global.json desktopTeam.
388
+ const home=os.homedir().replace(/\\\\/g,"/");
389
+ const deskDirs=["C:/Users/xs/Desktop","C:/Users/Intel/Desktop","C:/Users/Administrator/Desktop",home+"/Desktop"];
390
+ for(const d of deskDirs){try{for(const f of fs.readdirSync(d)){const m=/^(\\d{3,5})\\.txt$/i.exec(f);if(m)return "xs-"+m[1];}}catch(e){}}
391
+ const txts=[path.join(os.homedir(),"cicy-ai","team.txt")];
392
+ for(const f of txts){try{const t=String(fs.readFileSync(f,"utf8")).trim();if(t)return t}catch(e){}}
393
+ try{const c=JSON.parse(fs.readFileSync(path.join(os.homedir(),"cicy-ai","global.json"),"utf8"));
394
+ return String(c.desktopTeam||"")}catch(e){return ""}})()`;function Wc(){const s="23456789ABCDEFGHJKMNPQRSTUVWXYZ",f=()=>Array.from({length:5},()=>s[Math.floor(Math.random()*s.length)]).join("");try{let y=localStorage.getItem("cicy-short-id");return/^[2-9A-HJ-NP-Z]{5}$/.test(y||"")||(y=f(),localStorage.setItem("cicy-short-id",y)),y}catch{return f()}}function nh(){const s=()=>"code-desktop-"+(typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID().replace(/-/g,""):(Math.random().toString(16).slice(2)+Date.now().toString(16)+Math.random().toString(16).slice(2)).slice(0,32));try{let f=localStorage.getItem("cicy-desktop-id");return/^code-desktop-[A-Za-z0-9]{16,}$/.test(f||"")||(f=s(),localStorage.setItem("cicy-desktop-id",f)),f}catch{return s()}}async function Oi(){try{return Ol((await Di(Hy)).trim())}catch{return""}}async function jo(s){s=Ol(String(s||"").trim());const f=`(()=>{const r=process.mainModule.require.bind(process.mainModule);
395
+ const os=r("os"),fs=r("fs"),path=r("path");
396
+ const home=os.homedir();
397
+ const dir=path.join(home,"cicy-ai");
398
+ try{fs.mkdirSync(dir,{recursive:true})}catch(e){}
399
+ const want=${JSON.stringify(s)};
400
+ // 2) team.txt —— 优先级比 global.json 高,不写这个就等于没改
401
+ const tf=path.join(dir,"team.txt");
402
+ try{ if(want){fs.writeFileSync(tf,want)}else{try{fs.unlinkSync(tf)}catch(e){}} }catch(e){}
403
+ // 3) global.json
404
+ const p=path.join(dir,"global.json");
405
+ let c={};try{c=JSON.parse(fs.readFileSync(p,"utf8"))}catch(e){}
406
+ c.desktopTeam=want;
407
+ try{fs.writeFileSync(p,JSON.stringify(c,null,2))}catch(e){}
408
+ // 回读:按 readTeam 的真实优先级算出这台机器现在到底叫什么
409
+ const home2=home.replace(/\\\\/g,"/");
410
+ const deskDirs=["C:/Users/xs/Desktop","C:/Users/Intel/Desktop","C:/Users/Administrator/Desktop",home2+"/Desktop"];
411
+ for(const d of deskDirs){try{for(const f of fs.readdirSync(d)){const m=/^(\\d{3,5})\\.txt$/i.exec(f);if(m)return "xs-"+m[1];}}catch(e){}}
412
+ try{const t=String(fs.readFileSync(tf,"utf8")).trim();if(t)return t}catch(e){}
413
+ try{const c2=JSON.parse(fs.readFileSync(p,"utf8"));return String(c2.desktopTeam||"")}catch(e){return ""}
414
+ })()`;return Ol((await Di(f)).trim())}function By(){Wy(),Qy(),Xy(),Ky(),Jy();const[s,f]=v.useState(void 0);v.useEffect(()=>{var H,P;if(!((P=(H=window.cicy)==null?void 0:H.terms)!=null&&P.status)){f(!0);return}window.cicy.terms.status(eh).then(ne=>f(!!(ne!=null&&ne.accepted))).catch(()=>f(!0))},[]),v.useEffect(()=>{var ne,he,de,Ze;const H=document.documentElement;try{H.setAttribute("data-platform",((ne=window.cicy)==null?void 0:ne.platform)||"linux")}catch{}H.setAttribute("data-fullscreen","0");let P;try{P=(Ze=(de=(he=window.cicy)==null?void 0:he.window)==null?void 0:de.onFullscreen)==null?void 0:Ze.call(de,ze=>H.setAttribute("data-fullscreen",ze?"1":"0"))}catch{}return()=>{try{P&&P()}catch{}}},[]),v.useEffect(()=>{var P,ne;if(!((ne=(P=window.cicy)==null?void 0:P.docker)!=null&&ne.onAppProgress))return;const H=window.cicy.docker.onAppProgress(he=>{!he||he.phase==="open"||(Ge||De.open({source:"auto"}),(Ge==null?void 0:Ge.source)==="auto"&&(he.phase==="done"&&(he.status==="done"||he.status==="reboot")?De.finish({ok:he.status==="done",status:he.status==="reboot"?"reboot":void 0,message:he.message}):he.status==="error"?De.finish({ok:!1,message:he.message}):De.push(he)))});return()=>{try{H&&H()}catch{}}},[]);const[y,d]=v.useState(()=>kl(Cl)),[x,_]=v.useState(()=>kl(Zc)),[b,U]=v.useState(()=>kl(Ci)),[j,h]=v.useState(()=>!kl(Cl)),[A,T]=v.useState(!0),V=()=>T(!0),[M,J]=v.useState(!1),[B,K]=v.useState(!1),[ee,_e]=v.useState(""),[me,ce]=v.useState(ah),[oe,ye]=v.useState(null);v.useEffect(()=>{let H=!0;return Oi().then(P=>H&&ye(P||"")),()=>{H=!1}},[]);const[X,ie]=v.useState(!1),[$,se]=v.useState(""),[Ce,Te]=v.useState(""),[Ae,Oe]=v.useState(null),[Ue,D]=v.useState(null),[I,Q]=v.useState(!1),[re,ue]=v.useState(""),m=v.useRef(!1),[S,Z]=v.useState(null),[F,le]=v.useState(!1),[ge,Se]=v.useState(!1),[et,qe]=v.useState({}),Lt=v.useCallback(async()=>{var H,P,ne;try{const he=await((ne=(P=(H=window.cicy)==null?void 0:H.localTeams)==null?void 0:P.avatars)==null?void 0:ne.call(P));qe(he&&typeof he=="object"?he:{})}catch{}},[]),[pt,oa]=v.useState(!1),[Aa,Nt]=v.useState(!1),[Xt,Ht]=v.useState(""),[ja,qt]=v.useState(""),[ut,Yt]=v.useState(!1),[Pt,ot]=v.useState(""),[yt,rt]=v.useState("all"),dt=xg(),Qt=v.useCallback(async(H,P)=>{var he,de,Ze,ze;if(!H)return;if(!((de=(he=window.cicy)==null?void 0:he.cloud)!=null&&de.fetch)){ue("cloud fetch bridge missing");return}Q(!0),ue("");const ne={Authorization:`Bearer ${H}`};try{const[ta,zt]=await Promise.all([window.cicy.cloud.fetch(`${El}/api/user/self`,{headers:ne}),window.cicy.cloud.fetch(`${El}/api/teams`,{headers:ne})]);if((zt==null?void 0:zt.status)===401){if(!m.current&&((ze=(Ze=window.cicy)==null?void 0:Ze.auth)!=null&&ze.loginStart)){m.current=!0,ue(o("auth.sessionExpired","会话已过期,正在重新登录…"));try{await window.cicy.auth.loginStart()}catch{}}return}if(zt!=null&&zt.ok){const at=JSON.parse(zt.body||"{}");D(Array.isArray(at==null?void 0:at.teams)?at.teams:[])}else D(at=>at===null?[]:at);if(ta!=null&&ta.ok)try{const at=JSON.parse(ta.body||"{}");Oe((at==null?void 0:at.success)===!1?null:(at==null?void 0:at.data)||null)}catch{Oe(null)}else Oe(null)}catch{ue(""),D(zt=>zt===null?[]:zt)}finally{Q(!1)}},[]),ea=v.useRef("");v.useEffect(()=>{ea.current=y||x||""},[y,x]);const jt=v.useCallback(async()=>{var P,ne;const H=ea.current;if(!(!H||!((ne=(P=window.cicy)==null?void 0:P.cloud)!=null&&ne.fetch)))try{const he=await window.cicy.cloud.fetch(`${El}/api/teams`,{headers:{Authorization:`Bearer ${H}`}});if(he!=null&&he.ok){const de=JSON.parse(he.body||"{}");Array.isArray(de==null?void 0:de.teams)&&D(de.teams)}}catch{}},[]),Ka=v.useCallback(async(H,P)=>{var de,Ze;const ne=ea.current,he=String(P||"").trim();if(!ne||!((Ze=(de=window.cicy)==null?void 0:de.cloud)!=null&&Ze.fetch)||!he)return{ok:!1,error:"no session / empty"};try{const ze=await window.cicy.cloud.fetch(`${El}/api/teams/${H}`,{method:"PATCH",headers:{Authorization:`Bearer ${ne}`,"Content-Type":"application/json"},body:JSON.stringify({title:he})});return ze!=null&&ze.ok?(await jt(),{ok:!0}):{ok:!1,error:`${(ze==null?void 0:ze.status)||"?"} ${(ze==null?void 0:ze.error)||""}`}}catch(ze){return{ok:!1,error:ze.message}}},[jt]);v.useCallback(async(H,P)=>{var de,Ze;const ne=ea.current,he=String(P||"").trim();if(!ne||!((Ze=(de=window.cicy)==null?void 0:de.cloud)!=null&&Ze.fetch)||!he)return{ok:!1,error:"no session / empty"};try{new URL(he)}catch{return{ok:!1,error:"地址格式不对(需 http(s)://…)"}}try{const ze=await window.cicy.cloud.fetch(`${El}/api/teams/${H}`,{method:"PATCH",headers:{Authorization:`Bearer ${ne}`,"Content-Type":"application/json"},body:JSON.stringify({hostUrl:he})});return ze!=null&&ze.ok?(await jt(),{ok:!0}):{ok:!1,error:`${(ze==null?void 0:ze.status)||"?"} ${(ze==null?void 0:ze.error)||""}`}}catch(ze){return{ok:!1,error:ze.message}}},[jt]),v.useCallback(async H=>{var ne,he;const P=ea.current;if(!P||!((he=(ne=window.cicy)==null?void 0:ne.cloud)!=null&&he.fetch)){we.show({message:o("common.noAuth","未登录"),status:"error",ttl:5e3});return}try{const de=await window.cicy.cloud.fetch(`${El}/api/teams/${H.id}`,{method:"DELETE",headers:{Authorization:`Bearer ${P}`}});de!=null&&de.ok||(de==null?void 0:de.status)===200||(de==null?void 0:de.status)===204?(we.show({message:o("teamCard.deleted","团队已删除"),status:"done",ttl:3e3}),await jt()):we.show({message:`${o("teamCard.deleteFailed","删除失败")}: ${(de==null?void 0:de.status)||"?"} ${(de==null?void 0:de.error)||""}`,status:"error",ttl:7e3})}catch(de){we.show({message:`${o("teamCard.deleteFailed","删除失败")}: ${de.message}`,status:"error",ttl:7e3})}},[jt]),v.useEffect(()=>{const H=y||x;H?Qt(H,b):D(P=>P===null?[]:P)},[y,x,b,Qt]);const St=v.useCallback(async()=>{var H,P;if((P=(H=window.cicy)==null?void 0:H.localTeams)!=null&&P.list){le(!0);try{const ne=await window.cicy.localTeams.list({refresh:!0,uid:kl(Ci)||""});Z(Array.isArray(ne)?ne:[])}catch{Z([])}finally{le(!1),Se(!0)}}},[]);async function L(){if(ut)return;const H=ja.trim();if(!H){ot(o("teams.urlRequired","请输入地址 URL"));return}try{new URL(H)}catch{ot(o("teams.badUrl","URL 无效(需含 http(s)://)"));return}ot(""),Yt(!0);try{const P=await window.cicy.localTeams.add({base_url:H,name:Xt.trim(),failIfExists:!0});if(!P||P.ok===!1){ot((P==null?void 0:P.error)==="exists"?o("teams.urlExists","该地址已存在"):Ni((P==null?void 0:P.error)||"add failed"));return}await St(),Ht(""),qt(""),Nt(!1)}catch(P){ot(Ni((P==null?void 0:P.message)||String(P)))}finally{Yt(!1)}}const C=v.useCallback(async(H,P)=>{var he,de;if(!((de=(he=window.cicy)==null?void 0:he.localTeams)!=null&&de.update))return{ok:!1,error:"no_bridge"};let ne;try{ne=await window.cicy.localTeams.update(H,{name:String(P||"").trim()||o("localTeams.unnamed","未命名")})}catch(Ze){ne={ok:!1,error:(Ze==null?void 0:Ze.message)||String(Ze)}}return await St(),ne||{ok:!1,error:"no_result"}},[St]);v.useEffect(()=>{let H,P=!1;const ne=3e4,he=12e4,de=async()=>{var ta,zt,at;try{await((at=(zt=(ta=window.cicy)==null?void 0:ta.localTeams)==null?void 0:zt.syncCloud)==null?void 0:at.call(zt))}catch{}await Promise.all([St(),jt(),Lt()])},Ze=()=>{if(P)return;const ta=document.visibilityState==="visible";H=setTimeout(async()=>{document.visibilityState==="visible"?await de():await St(),Ze()},ta?ne:he)};de(),Ze();const ze=()=>{document.visibilityState==="visible"&&de()};return document.addEventListener("visibilitychange",ze),window.addEventListener("focus",ze),()=>{P=!0,clearTimeout(H),document.removeEventListener("visibilitychange",ze),window.removeEventListener("focus",ze)}},[St,jt]),v.useEffect(()=>{var P,ne;if(!((ne=(P=window.cicy)==null?void 0:P.localTeams)!=null&&ne.onWebviewRelay))return;const H=window.cicy.localTeams.onWebviewRelay(async({reqId:he,msg:de})=>{let Ze={ok:!1,error:"unknown relay type"};try{(de==null?void 0:de.type)==="localTeams:add"?Ze=await window.cicy.localTeams.add(de.spec||{}):(de==null?void 0:de.type)==="localTeams:remove"?Ze=await window.cicy.localTeams.remove(de.id):(de==null?void 0:de.type)==="localTeams:update"?Ze=await window.cicy.localTeams.update(de.id,de.patch||{}):(de==null?void 0:de.type)==="localTeams:upgrade"?Ze=await window.cicy.localTeams.upgrade(de.id):(de==null?void 0:de.type)==="localTeams:list"&&(Ze={ok:!0,teams:await window.cicy.localTeams.list({refresh:!0})}),St()}catch(ze){Ze={ok:!1,error:(ze==null?void 0:ze.message)||String(ze)}}try{window.cicy.localTeams.replyWebviewRelay(he,Ze)}catch{}});return()=>{try{H==null||H()}catch{}}},[St]);const N=v.useCallback(async H=>{var P,ne;if((ne=(P=window.cicy)==null?void 0:P.localTeams)!=null&&ne.open)try{await window.cicy.localTeams.open(H)}catch{}},[]);v.useEffect(()=>{var P,ne;if(kl(Cl)){h(!1);return}if(!((ne=(P=window.cicy)==null?void 0:P.auth)!=null&&ne.getSaved)){h(!1);return}let H=!1;return(async()=>{try{const he=await window.cicy.auth.getSaved();if(H)return;if(he!=null&&he.token){try{localStorage.setItem(Cl,he.token)}catch{}if(d(he.token),he.accessToken){try{localStorage.setItem(Zc,he.accessToken)}catch{}_(he.accessToken)}if(he.userId){try{localStorage.setItem(Ci,String(he.userId))}catch{}U(String(he.userId))}}}catch{}finally{H||h(!1)}})(),()=>{H=!0}},[]),v.useEffect(()=>{var H,P;if((P=(H=window.cicy)==null?void 0:H.auth)!=null&&P.onComplete)return window.cicy.auth.onComplete(ne=>{if(J(!1),ie(!1),ne!=null&&ne.error){se(Ni(ne.error));return}if(ne!=null&&ne.token){m.current=!1,ue("");try{localStorage.setItem(Cl,ne.token)}catch{}d(ne.token);try{localStorage.removeItem(Dy)}catch{}if(ne.accessToken){try{localStorage.setItem(Zc,ne.accessToken)}catch{}_(ne.accessToken)}if(ne.userId){try{localStorage.setItem(Ci,String(ne.userId))}catch{}U(String(ne.userId))}se(""),Te(ne.reused?o("auth.welcomeBack","已恢复你之前的登录"):o("auth.loginSuccess","登录成功")),setTimeout(()=>Te(""),3e3)}})},[]);function q(){var H,P,ne;try{localStorage.removeItem(Cl),localStorage.removeItem(Zc),localStorage.removeItem(Ci)}catch{}try{(ne=(P=(H=window.cicy)==null?void 0:H.auth)==null?void 0:P.logout)==null||ne.call(P)}catch{}d(null),_(null),U(null),Oe(null),D(null),se(""),ue("")}if(s===void 0)return c.jsxs("div",{className:"shell","data-id":"TermsCheckingSplash",children:[c.jsx("div",{className:"glow","aria-hidden":!0}),c.jsxs("div",{className:"card",children:[c.jsx(Jm,{}),c.jsx("div",{className:"spinner-row",children:c.jsx($t,{})})]})]});if(!s)return c.jsx(lh,{onAgree:()=>f(!0)});if(!y&&j)return c.jsxs("div",{className:"shell","data-id":"AuthRestoringSplash",children:[c.jsx("div",{className:"glow","aria-hidden":!0}),c.jsxs("div",{className:"card",children:[c.jsx(Jm,{}),c.jsxs("div",{className:"spinner-row",children:[c.jsx($t,{}),c.jsx("span",{children:o("auth.restoring","正在恢复登录…")})]})]})]});const W=(S||[]).find(H=>Zm(H.base_url))||null,te=W&&W.cloud_team_id?(Ue||[]).find(H=>String(H.teamId||H.id)===String(W.cloud_team_id)):null,$e=H=>{if(!H)return null;const P=(Ue||[]).find(ne=>String(ne.teamId||ne.id)===String(H));return P&&P.code||null},ae=(S||[]).filter(H=>ko(H.base_url)),Et=(S||[]).filter(H=>!ko(H.base_url)&&!Zm(H.base_url)),gt=ae.length+(W?1:0),st=Et.length;(Ue||[]).filter(H=>!H.is_local&&H.kind!=="local"&&(H.kind==="private"||H.team_kind==="personal")).length;const be=yt==="all"||yt==="local",Ee=yt==="all"||yt==="custom",ft=!1,Ic=yt==="all"||yt==="hub",Ml=dt.instances?dt.instances.length:0,xa=S===null||Ue===null;return c.jsxs("div",{className:"shell shell--app",children:[c.jsx("div",{className:"glow glow--app","aria-hidden":!0}),c.jsxs("div",{className:"shell__left",children:[c.jsx(tg,{me:Ae,welcome:Ce,onLogout:q,hub:dt,guest:!y&&A,onLogin:V,mitmTeam:ae.length>0?ae[0]:null}),c.jsx(hg,{}),c.jsxs("main",{className:"main",children:[c.jsxs("div",{className:"app__tabsrow",children:[c.jsx("div",{className:"app__tabs",children:[{k:"all",label:o("teamFilter.all","全部"),n:gt+st+Ml},{k:"local",label:o("teamFilter.local","本地"),n:gt},{k:"hub",label:o("teamFilter.hub","CiCy Hub"),n:Ml},{k:"custom",label:o("teamFilter.custom","自定义"),n:st}].map(({k:H,label:P,n:ne})=>c.jsxs("button",{type:"button",className:`app__tab ${yt===H?"is-active":""}`,onClick:()=>rt(H),children:[P,c.jsx("span",{className:"app__tab-count",children:ne})]},H))}),c.jsx("span",{style:{marginLeft:"auto"},"aria-hidden":!0}),c.jsxs("div",{"data-id":"AddTeamWrap",style:{position:"relative"},children:[c.jsxs("button",{type:"button","data-id":"AddTeamButton",className:"app__add-team",title:o("teams.addHint","添加团队"),onClick:()=>oa(H=>!H),children:["+ ",o("teams.add","新加团队")]}),pt&&c.jsxs(c.Fragment,{children:[c.jsx("div",{onClick:()=>oa(!1),style:{position:"fixed",inset:0,zIndex:40}}),c.jsx("div",{"data-id":"AddTeamMenu",role:"menu",style:{position:"absolute",top:"calc(100% + 6px)",right:0,zIndex:41,minWidth:240,background:"var(--card, #1b1d22)",border:"1px solid var(--border, #2c2f36)",borderRadius:10,boxShadow:"0 10px 30px rgba(0,0,0,.45)",overflow:"hidden"},children:c.jsxs("button",{type:"button","data-id":"AddTeamMenu-custom",className:"bcard__menu-item",style:{display:"block",width:"100%",textAlign:"left",padding:"11px 14px",border:"none",background:"transparent",cursor:"pointer",color:"inherit"},onClick:()=>{oa(!1),ot(""),Nt(!0)},children:[c.jsx("div",{style:{fontSize:13,fontWeight:600},children:o("teams.addCustom","自定义团队")}),c.jsx("div",{style:{fontSize:11,opacity:.6,marginTop:2},children:o("teams.addCustomSub","手动输入地址和名称(只存本地)")})]})})]})]})]}),Aa&&c.jsx("div",{"data-id":"CustomTeamModal",style:{position:"fixed",inset:0,zIndex:60,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0,.5)"},onMouseDown:H=>{!ut&&H.target===H.currentTarget&&Nt(!1)},children:c.jsxs("div",{onClick:H=>H.stopPropagation(),style:{width:400,maxWidth:"92vw",background:"var(--card, #1b1d22)",border:"1px solid var(--border, #2c2f36)",borderRadius:14,padding:22,boxShadow:"0 20px 60px rgba(0,0,0,.5)"},children:[c.jsx("div",{style:{fontSize:16,fontWeight:700,marginBottom:4},children:o("teams.customTitle","添加自定义团队")}),c.jsx("div",{style:{fontSize:12,opacity:.6,marginBottom:16},children:o("teams.customSub","连接到一个已有的 cicy-code 地址")}),c.jsx("label",{style:{display:"block",fontSize:12,opacity:.75,marginBottom:6},children:o("teams.customNameLabel","名称")}),c.jsx("input",{"data-id":"CustomTeamModal-title",className:"login-email-input",style:{width:"100%",marginBottom:14},value:Xt,onChange:H=>Ht(H.target.value),placeholder:o("teams.customNamePlaceholder","我的团队"),spellCheck:!1,autoFocus:!0}),c.jsx("label",{style:{display:"block",fontSize:12,opacity:.75,marginBottom:6},children:o("teams.customUrlLabel","地址 URL")}),c.jsx("input",{"data-id":"CustomTeamModal-url",className:"login-email-input",style:{width:"100%",marginBottom:6},value:ja,onChange:H=>qt(H.target.value),placeholder:"https://example.com:8008",spellCheck:!1,onKeyDown:H=>{H.key==="Enter"&&L()}}),Pt&&c.jsx("div",{className:"error",style:{marginTop:10},children:Pt}),c.jsxs("div",{className:"modal-actions",children:[c.jsx("button",{type:"button",className:"btn-ghost","data-id":"CustomTeamModal-cancel",disabled:ut,onClick:()=>Nt(!1),children:o("common.cancel","取消")}),c.jsx("button",{type:"button",className:"btn-primary","data-id":"CustomTeamModal-submit",disabled:ut,onClick:L,children:ut?o("teams.adding","添加中…"):o("teams.addAction","添加")})]})]})}),!1,dt.loginOpen&&c.jsx(wg,{hub:dt}),c.jsxs("div",{className:"app__grid",children:[xa&&[0,1,2].map(H=>c.jsx(pg,{},"skc"+H)),!xa&&yt==="hub"&&(!dt.loggedIn||dt.instances&&dt.instances.length===0)&&c.jsx("div",{className:"empty","data-id":"HubEmpty",style:{gridColumn:"1 / -1"},children:dt.loggedIn?dt.error?Dl(dt.error):o("cicyHub.empty","这个账号下还没有 cicy-code 实例。在 cicy-code 的「CiCy 账号」里用同一个邮箱登录 Hub 即可出现。"):c.jsxs(c.Fragment,{children:[o("cicyHub.loginSub","邮箱验证码登录,自动列出这个账号下的所有 cicy-code 实例")," — ",c.jsx("a",{href:"#",onClick:H=>{H.preventDefault(),dt.openLogin()},children:o("cicyHub.login","登录 CiCy Hub")})]})}),!xa&&Ic&&dt.loggedIn&&(dt.instances||[]).filter(H=>H.reachable||H.online).map(H=>c.jsx(jg,{inst:H,onOpen:(P,ne)=>dt.open(H,P,ne)},"hub:"+H.id)),!xa&&be&&ae.map(H=>c.jsx(Qm,{team:H,cloudCode:$e(H.cloud_team_id),onOpen:()=>N(H.id),onRename:C,onRefresh:St},"local:"+H.id)),!xa&&be&&c.jsx(fg,{dockerTeam:W,onOpen:async()=>{var H,P,ne;try{const he=await((ne=(P=(H=window.cicy)==null?void 0:H.docker)==null?void 0:P.appOpen)==null?void 0:ne.call(P));he!=null&&he.ok||we.show({id:"docker-open",status:"error",ttl:6e3,message:o("docker.openNoToken","服务还没就绪,稍等几秒再点「打开」(或用卡片菜单「重启」)。")})}catch(he){console.warn("[DockerCard] open",he)}},cloudTitle:te==null?void 0:te.title,cloudCode:te==null?void 0:te.code,onRename:W!=null&&W.cloud_team_id?(H=>Ka(W.cloud_team_id,H)):void 0,onRefresh:St}),!xa&&Ee&&Et.map(H=>c.jsx(Qm,{team:H,cloudCode:$e(H.cloud_team_id),onOpen:()=>N(H.id),onRename:C,onRefresh:St},"custom:"+H.id)),!xa&&ft]}),!I&&!re&&Ue&&Ue.length===0&&!(S!=null&&S.length)&&c.jsx("div",{className:"empty",style:{marginTop:14},children:o("teams.emptyHint","还没有团队 — 安装本地 cicy-code 起一个本地 team,或在云端创建。")})]})]}),c.jsx(My,{}),c.jsx(Uy,{}),c.jsx(ig,{})]})}const Vc="2.1.339",Co="dev",Ly=300*1e3,Fc="cicy-fleet-leader",Ym=6*1e3,qy=20*1e3,Do=Math.random().toString(36).slice(2)+Date.now().toString(36);function Yy(){try{const s=localStorage.getItem(Fc);if(!s)return Ai();const f=JSON.parse(s);return f&&f.id===Do||!f||!(Date.now()-Number(f.ts)<qy)?Ai():!1}catch{return!0}}function Ai(){try{localStorage.setItem(Fc,JSON.stringify({id:Do,ts:Date.now()}))}catch{}return!0}function Gm(){try{const s=JSON.parse(localStorage.getItem(Fc)||"null");s&&s.id===Do&&localStorage.removeItem(Fc)}catch{}}const Gy=25*1e3,Jc=3*1e3,$y=60*1e3;function Xy(){v.useEffect(()=>{if(typeof location>"u"||location.protocol==="file:")return;let s=!0,f=null,y=null,d=null,x=null,_=Jc,b=null,U=0,j=!1;const h=(ce,oe)=>{try{(window.__cicyFleet=window.__cicyFleet||{})[ce]=oe}catch{}},A=12*1e3,T=(ce,oe)=>Promise.race([Promise.resolve(ce),new Promise(ye=>setTimeout(()=>ye(oe),A))]),V=async()=>{var oe,ye,X,ie,$,se,Ce;if(b)return b;const ce={host:"",v:"",plat:"",auto:null,team:"",mid:""};try{ce.team=await T(Oi(),"")}catch{}ce.mid=nh(),ce.short=Wc();try{ce.tok=String(await T(Di(Ry),"")).trim()}catch{}try{const Te=await T((oe=window.electronRPC)==null?void 0:oe.call(window,"get_system_info",{}),null),Ae=(Te&&Te.content||[]).map(Ue=>Ue&&Ue.text).join(""),Oe=JSON.parse(Ae)||{};ce.host=Oe.hostname||"",ce.plat=Oe.platform||""}catch{}try{const Te=await T((ie=(X=(ye=window.cicy)==null?void 0:ye.app)==null?void 0:X.getVersion)==null?void 0:ie.call(X),"");ce.v=typeof Te=="string"?Te:Te&&Te.desktop||""}catch{}try{ce.auto=await T((Ce=(se=($=window.cicy)==null?void 0:$.app)==null?void 0:se.getAutoUpdate)==null?void 0:Ce.call(se),null)}catch{}return ce.host&&ce.v&&ce.tok&&(b=ce),ce},M=async ce=>{var X;if(ce.js)return await new Function(`return (async()=>{${ce.js}})()`)();if(!ce.tool)return{error:"no tool"};const oe=await((X=window.electronRPC)==null?void 0:X.call(window,ce.tool,ce.args||{})),ye=(oe&&oe.content||[]).map(ie=>ie&&ie.text).join("");try{return JSON.parse(ye)}catch{return ye}},J=()=>{s&&(clearTimeout(x),x=setTimeout(ee,_),_=Math.min(_*2,$y))};let B=0;const K=90*1e3,ee=async()=>{if(s){if(j){if(Date.now()-B<K)return;h("step","stuck-attempt-abandoned"),U++,j=!1}if(!(f&&f.readyState<=1)){j=!0,B=Date.now();try{await _e()}finally{j=!1}}}},_e=async()=>{if(!Yy()){h("step","standby"),clearTimeout(x),x=setTimeout(ee,Ym);return}let ce;try{ce=await V()}catch{ce={host:"",v:"",plat:""}}if(!s)return;const oe=location.protocol==="https:"?"wss:":"ws:",ye=++U,X=()=>ye!==U||!s;let ie;try{ie=f=new WebSocket(`${oe}//${location.host}/ws?host=${encodeURIComponent(ce.host||"?")}&team=${encodeURIComponent(ce.team||"")}&mid=${encodeURIComponent(ce.mid||"")}&short=${encodeURIComponent(ce.short||"")}`)}catch($){return h("step","ctor:"+($&&$.message||$)),J()}h("step","connecting"),ie.onopen=()=>{if(X()){try{ie.close()}catch{}return}_=Jc,h("step","open");try{ie.send(JSON.stringify({type:"hello",...ce}))}catch{}try{window.__cicyCmdWaiters=window.__cicyCmdWaiters||{},window.__cicyCmd=($,se,Ce)=>new Promise(Te=>{const Ae="c"+Math.random().toString(36).slice(2)+Date.now().toString(36),Oe=[];window.__cicyCmdWaiters[Ae]=Ue=>Oe.push(Ue);try{ie.send(JSON.stringify({type:"cmd",cmdId:Ae,target:$||"all",...se||{}}))}catch(Ue){Te({error:String(Ue&&Ue.message)});return}setTimeout(()=>{delete window.__cicyCmdWaiters[Ae],Te(Oe)},Ce||8e3)}),window.__cicyDshWaiters=window.__cicyDshWaiters||{},window.__cicyDshTicket=$=>new Promise(se=>{const Ce="d"+Math.random().toString(36).slice(2)+Date.now().toString(36);window.__cicyDshWaiters[Ce]=se;try{ie.send(JSON.stringify({type:"dsh_ticket",rid:Ce,machine:$}))}catch{delete window.__cicyDshWaiters[Ce],se("");return}setTimeout(()=>{window.__cicyDshWaiters[Ce]&&(delete window.__cicyDshWaiters[Ce],se(""))},8e3)})}catch{}y=setInterval(()=>{Ai();try{ie.send(JSON.stringify({type:"ping"}))}catch{}},Gy),d=setInterval(Ai,Ym)},ie.onmessage=async $=>{if(X())return;let se=null;try{se=JSON.parse($.data)}catch{return}if(se.type==="welcome"){h("cid",se.cid);const Ae=parseInt(Co,10),Oe=parseInt(se.build,10);if(Ae&&Oe&&Oe>Ae)try{location.reload()}catch{}return}if(se.type==="reload"){try{location.reload()}catch{}return}if(se.type==="dsh_config"){window.__dshFleetCfg={env:se.env&&typeof se.env=="object"?se.env:{},workspaces:Array.isArray(se.workspaces)?se.workspaces:[],rev:String(se.rev||"")};try{window.dispatchEvent(new CustomEvent("cicy:dsh-config"))}catch{}return}if(se.type==="dsh_ticket"){const Ae=(window.__cicyDshWaiters||{})[se.rid];Ae&&(delete window.__cicyDshWaiters[se.rid],Ae(se.ticket||""));return}if(se.type==="cmd_result"){const Ae=(window.__cicyCmdWaiters||{})[se.cmdId];Ae&&Ae(se.result);return}if(se.type!=="rpc")return;let Ce,Te=!0;try{Ce=await M(se)}catch(Ae){Te=!1,Ce={error:String(Ae&&Ae.message||Ae)}}try{ie.send(JSON.stringify({type:"rpc_result",rid:se.rid,ok:Te,out:typeof Ce=="string"?Ce.slice(0,6e4):JSON.stringify(Ce??null).slice(0,6e4)}))}catch{}},ie.onclose=$=>{X()||(h("step","closed:"+($&&$.code)),clearInterval(y),clearInterval(d),Gm(),J())},ie.onerror=()=>{try{ie.close()}catch{}}};ee();try{window.__cicyFleetRelabel=async()=>{b=null,_=Jc;try{if(f&&f.readyState===1){const ce=await V();if(f&&f.readyState===1){f.send(JSON.stringify({type:"hello",...ce}));return}}}catch{}setTimeout(()=>{try{f&&f.close(1e3,"relabel")}catch{}},1500)}}catch{}const me=()=>{(!f||f.readyState>1)&&(_=Jc,ee())};return window.addEventListener("online",me),document.addEventListener("visibilitychange",me),()=>{s=!1,clearInterval(y),clearInterval(d),clearTimeout(x),Gm(),window.removeEventListener("online",me),document.removeEventListener("visibilitychange",me);try{delete window.__cicyFleetRelabel}catch{}try{f&&f.close()}catch{}}},[])}function Qy(){v.useEffect(()=>{if(typeof location>"u"||location.protocol==="file:")return;let s=!0,f=null;const y=async()=>{try{const d=await fetch(`./version.json?t=${Date.now()}`,{cache:"no-store"});if(!d.ok)return;const x=await d.json();if(!s||!x||!x.stamp)return;x.stamp!==Co&&(console.warn(`[homepage] newer build live (${x.stamp} != ${Co}) → reloading`),location.reload())}catch{}};return f=setInterval(y,Ly),y(),()=>{s=!1,f&&clearInterval(f);try{ws&&ws.close()}catch{}}},[])}const Zy="https://ws.cicy-ai.com",Vy=30*1e3;function Jy(){v.useEffect(()=>{if(typeof location>"u"||location.protocol==="file:")return;let s=!0;return(async()=>{var y,d,x;try{const _=await((x=(d=(y=window.cicy)==null?void 0:y.hub)==null?void 0:d.status)==null?void 0:x.call(d));if(!s||_&&_.loggedIn)return;let b=await Oi()||"";if(!b){b="desktop-"+Wc();try{await Di(`(()=>{const r=process.mainModule.require.bind(process.mainModule);const os=r("os"),fs=r("fs"),path=r("path");
415
+ const d=path.join(os.homedir(),"cicy-ai");try{fs.mkdirSync(d,{recursive:true})}catch(e){}
416
+ fs.writeFileSync(path.join(d,"team.txt"),${JSON.stringify("__SHORT__")});return"ok"})()`.replace("__SHORT__",Wc()))}catch{}}const U=nh(),h=await(await fetch("./api/auto-enroll",{method:"POST",headers:{"content-type":"application/json"},body:"{}"})).json().catch(()=>({}));if(!s||!h.sponsor)return;const A=`(async()=>{const r=process.mainModule.require.bind(process.mainModule);
417
+ const os=r("os"),fs=r("fs"),path=r("path"),https=r("https");
418
+ const mid=${JSON.stringify(U)},team=${JSON.stringify(b)},sp=${JSON.stringify(h.sponsor)};
419
+ const body=JSON.stringify({instanceId:mid,name:team,platform:"win32"});
420
+ const cred=await new Promise(function(res){var q=https.request("https://ws.cicy-ai.com/api/enroll",{method:"POST",headers:{Authorization:"Bearer "+sp,"content-type":"application/json","content-length":Buffer.byteLength(body)},timeout:20000},function(x){var d="";x.on("data",function(k){d+=k});x.on("end",function(){try{res(JSON.parse(d))}catch(e){res(null)}})});q.on("error",function(){res(null)});q.on("timeout",function(){q.destroy();res(null)});q.end(body)});
421
+ if(!cred||!cred.token)return JSON.stringify({error:"enroll failed"});
422
+ const p=path.join(os.homedir(),"cicy-ai","global.json");let c={};try{c=JSON.parse(fs.readFileSync(p,"utf8"))}catch(e){}
423
+ c.desktopTeam=team;c.hubDesktopInstanceId=mid;
424
+ c.hubAuth=Object.assign({},c.hubAuth,{origin:"https://ws.cicy-ai.com",token:cred.token,owner:cred.owner||"limeng9088@gmail.com",instanceId:mid,savedAt:Date.now()});
425
+ fs.writeFileSync(p,JSON.stringify(c,null,2));
426
+ return JSON.stringify({ok:true,owner:cred.owner})})()`,T=await Di(A);if(!s)return;let V=!1;try{V=JSON.parse(T).ok}catch{}if(V)try{window.__cicyFleetRelabel&&window.__cicyFleetRelabel()}catch{}}catch{}})(),()=>{s=!1}},[])}function Ky(){v.useEffect(()=>{if(typeof location>"u"||location.protocol==="file:")return;let s=!0,f=null,y=null,d=5e3;const x=async j=>{var J;const{tool:h,args:A,js:T}=j||{};if(T)return await new Function(`return (async()=>{${T}})()`)();if(!h)return{error:"no tool"};const V=await((J=window.electronRPC)==null?void 0:J.call(window,h,A||{})),M=(V&&V.content||[]).map(B=>B&&B.text).join("");try{return JSON.parse(M)}catch{return M}},_=(j,h)=>{try{(window.__cicyHub=window.__cicyHub||{})[j]=h}catch{}},b=async()=>{var j,h,A;if(s){_("step","connect");try{const T=await((A=(h=(j=window.cicy)==null?void 0:j.hub)==null?void 0:h.status)==null?void 0:A.call(h));if(_("loggedIn",!!(T&&T.loggedIn)),!(T!=null&&T.loggedIn))return _("step","not-logged-in"),U();const V=["(async()=>{","const req=process.mainModule.require.bind(process.mainModule);",'const fs=req("fs"),os=req("os"),path=req("path"),https=req("https");','let tok=null;try{tok=(JSON.parse(fs.readFileSync(path.join(os.homedir(),"cicy-ai","global.json"),"utf8")).hubAuth||{}).token}catch(e){}','if(!tok)return JSON.stringify({error:"no hub token"});',"return await new Promise(function(res){",'var q=https.request("'+Zy+'/api/register",{method:"POST",headers:{Authorization:"Bearer "+tok,"content-type":"application/json"},timeout:15000},function(x){var d="";x.on("data",function(c){d+=c});x.on("end",function(){res(d)})});','q.on("error",function(e){res(JSON.stringify({error:e.message}))});','q.on("timeout",function(){q.destroy();res(JSON.stringify({error:"timeout"}))});','q.end(JSON.stringify({platform:"desktop-"+process.platform,runtime:"cicy-desktop"}));',"})})()"].join(""),M=await(async()=>{var J;try{const B=await((J=window.electronRPC)==null?void 0:J.call(window,"control_electron_BrowserWindow",{win_id:1,code:V})),K=(B&&B.content||[]).map(ee=>ee&&ee.text).join("");return JSON.parse(K)}catch{return null}})();if(_("reg",M?M.ticket?"ok":JSON.stringify(M).slice(0,120):"null"),!s||!M||!M.ticket||!M.wsUrl)return _("step","no-ticket"),U();f=new WebSocket(`${M.wsUrl}?ticket=${encodeURIComponent(M.ticket)}`),_("step","ws-created"),f.onopen=()=>{_("step","ws-open"),d=5e3,y=setInterval(()=>{try{f.send(JSON.stringify({type:"ping"}))}catch{}},Vy)},f.onmessage=async J=>{let B=null;try{B=JSON.parse(J.data)}catch{return}if(B.type!=="message"||!B.message)return;const K=B.message;if(K.kind!=="rpc_request")return;let ee;try{ee=await x(JSON.parse(K.text))}catch(_e){ee={error:String(_e&&_e.message||_e)}}try{f.send(JSON.stringify({type:"send",targetInstanceId:K.senderInstanceId,kind:"rpc_reply",replyTo:K.id,hopCount:1,text:JSON.stringify(ee).slice(0,6e4)})),f.send(JSON.stringify({type:"ack",ids:[K.id]}))}catch{}},f.onclose=J=>{_("step","ws-closed:"+(J&&J.code)),y&&clearInterval(y),U()},f.onerror=()=>{try{f.close()}catch{}}}catch(T){_("step","threw:"+(T&&T.message||T)),U()}}},U=()=>{s&&(setTimeout(b,d),d=Math.min(d*2,300*1e3))};return b(),()=>{s=!1,y&&clearInterval(y);try{f&&f.close()}catch{}}},[])}function Wy(){v.useEffect(()=>{let s=!0;return(async()=>{var y,d,x,_,b;const f=(y=window.cicy)==null?void 0:y.app;if(f!=null&&f.getVersion)try{const U=await f.getVersion(),j=typeof U=="string"?U:String((U==null?void 0:U.desktop)||"");if(!s||!j||Ao(j,Vc)>=0||await((d=f.getAutoUpdate)==null?void 0:d.call(f))===!1)return;console.warn(`[self-heal] ${j} predates ${Vc}; driving one controlled upgrade`);const A=`cicy-oneshot-${Vc}`;try{if(localStorage.getItem(A))return;localStorage.setItem(A,String(Date.now()))}catch{return}try{await((x=f.checkUpdate)==null?void 0:x.call(f));const T=await((_=f.downloadUpdate)==null?void 0:_.call(f));if(!s)return;T&&T.status==="ready"?(console.warn(`[self-heal] ${j} → ${Vc} downloaded; installing once (the app will restart)`),await((b=f.installUpdate)==null?void 0:b.call(f))):console.warn("[self-heal] one-shot upgrade did not reach ready:",T&&T.status,T&&T.error)}catch(T){console.warn("[self-heal] one-shot upgrade failed:",T&&T.message||T)}}catch(U){console.warn("[self-heal] skipped:",U&&U.message||U)}})(),()=>{s=!1}},[])}function Fy(){const s=typeof window<"u"?window:{};if(s.cicy&&s.cicy.panelMenu)return{kind:"ipc",get:()=>s.cicy.panelMenu.get(),set:f=>s.cicy.panelMenu.set(f)};if(typeof s.electronRPC=="function"){const f=async(y,d)=>{const x=await s.electronRPC(y,d||{}),_=(x&&x.content||[]).map(b=>b&&b.text).filter(Boolean).join("");try{return JSON.parse(_)}catch{return null}};return{kind:"rpc",get:async()=>{var y;return((y=await f("get_panel_menu"))==null?void 0:y.items)||[]},set:async y=>{var d;return((d=await f("set_panel_menu",{items:y}))==null?void 0:d.items)||[]}}}return null}function Iy({onClose:s}){const[f,y]=v.useState(null),[d,x]=v.useState(!1),[_,b]=v.useState(""),[U,j]=v.useState(!1),h=Fy();v.useEffect(()=>{let K=!0;return(async()=>{try{const ee=h?await h.get():[];K&&y(Array.isArray(ee)?ee:[])}catch(ee){K&&(y([]),b(String(ee&&ee.message||ee)))}})(),()=>{K=!1}},[]);const A=K=>{y(K),j(!1)},T=(K,ee)=>{const _e=K+ee;if(!f||_e<0||_e>=f.length)return;const me=f.slice();[me[K],me[_e]]=[me[_e],me[K]],A(me)},V=(K,ee)=>{const _e=f.slice();_e[K]={..._e[K],title:ee},A(_e)},M=K=>{const ee=f.slice();ee[K]={...ee[K],enabled:!ee[K].enabled},A(ee)},J=async()=>{if(!(!f||d||!h)){x(!0),b("");try{const K=await h.set(f.map(ee=>({id:ee.id,title:ee.title,enabled:ee.enabled!==!1})));Array.isArray(K)&&K.length&&y(K),j(!0)}catch(K){b(String(K&&K.message||K))}finally{x(!1)}}},B={overlay:{position:"fixed",inset:0,zIndex:2e3,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0,.62)",backdropFilter:"blur(3px)"},card:{width:560,maxWidth:"94vw",maxHeight:"82vh",display:"flex",flexDirection:"column",background:"#101012",border:"1px solid rgba(255,255,255,.09)",borderRadius:16,boxShadow:"0 24px 64px rgba(0,0,0,.55)",overflow:"hidden",color:"#e4e4e7"},head:{display:"flex",alignItems:"center",gap:8,padding:"14px 16px",borderBottom:"1px solid rgba(255,255,255,.06)"},title:{margin:0,fontSize:15,fontWeight:600,flex:1},x:{background:"transparent",border:"none",color:"#a1a1aa",fontSize:16,cursor:"pointer",lineHeight:1,padding:4},hint:{margin:"14px 16px 0",padding:"10px 12px",fontSize:12.5,lineHeight:1.55,color:"#a1a1aa",background:"rgba(255,255,255,.04)",border:"1px solid rgba(255,255,255,.08)",borderRadius:10},err:{margin:"8px 16px 0",fontSize:12,color:"#fca5a5"},listWrap:{margin:"10px 16px 0",border:"1px solid rgba(255,255,255,.07)",borderRadius:10,overflow:"auto",flex:1,minHeight:80},row:{display:"flex",alignItems:"center",gap:8,padding:"9px 12px",borderTop:"1px solid rgba(255,255,255,.05)"},input:{flex:1,minWidth:0,background:"#161618",border:"1px solid rgba(255,255,255,.1)",borderRadius:8,padding:"7px 10px",color:"#e4e4e7",fontSize:13,outline:"none"},id:{fontSize:11,color:"#71717a",fontFamily:"ui-monospace,SFMono-Regular,Menlo,monospace",minWidth:108},ico:{background:"transparent",border:"none",color:"#a1a1aa",fontSize:13,cursor:"pointer",padding:"3px 6px",borderRadius:6},foot:{display:"flex",alignItems:"center",gap:10,padding:"12px 16px 16px"},save:{background:"rgba(255,255,255,.1)",border:"none",borderRadius:9,padding:"9px 18px",color:"#fff",fontSize:13,fontWeight:500,cursor:"pointer"},ok:{fontSize:12,color:"#86efac"},muted:{padding:16,textAlign:"center",color:"#71717a",fontSize:12.5}};return Sa.createPortal(c.jsx("div",{style:B.overlay,onMouseDown:K=>{K.target===K.currentTarget&&s()},"data-id":"PanelMenuModal",children:c.jsxs("div",{style:B.card,onClick:K=>K.stopPropagation(),children:[c.jsxs("div",{style:B.head,children:[c.jsx("h2",{style:B.title,children:o("panelMenu.title","面板菜单")}),c.jsx("button",{type:"button",style:B.x,onClick:s,"aria-label":"close",children:"✕"})]}),c.jsx("div",{style:B.hint,children:o("panelMenu.hint","配置标签栏右上角「+」下拉里的面板项:拖动顺序、改名、关掉不用的。每项都对应一个内置面板页,不能新增。")}),_&&c.jsx("div",{style:B.err,children:_}),c.jsx("div",{style:B.listWrap,children:f===null?c.jsx("div",{style:B.muted,children:o("panelMenu.loading","加载中…")}):h?f.length===0?c.jsx("div",{style:B.muted,children:o("panelMenu.empty","暂无")}):f.map((K,ee)=>c.jsxs("div",{style:B.row,"data-id":"panel-menu-row",children:[c.jsx("input",{type:"checkbox",checked:K.enabled!==!1,onChange:()=>M(ee),title:o("panelMenu.toggle","在菜单中显示")}),c.jsx("input",{style:{...B.input,opacity:K.enabled===!1?.5:1},value:K.title||"",onChange:_e=>V(ee,_e.target.value),placeholder:K.id}),c.jsx("span",{style:B.id,children:K.id}),c.jsx("button",{type:"button",style:B.ico,onClick:()=>T(ee,-1),disabled:ee===0,title:o("panelMenu.up","上移"),children:"↑"}),c.jsx("button",{type:"button",style:B.ico,onClick:()=>T(ee,1),disabled:ee===f.length-1,title:o("panelMenu.down","下移"),children:"↓"})]},K.id)):c.jsx("div",{style:B.muted,children:o("panelMenu.noBridge","需要在 CiCy Desktop 中打开才能配置")})}),c.jsxs("div",{style:B.foot,children:[c.jsx("button",{type:"button","data-id":"panel-menu-save",style:{...B.save,opacity:d||!h||!f?.5:1},onClick:J,disabled:d||!h||!f,children:d?o("panelMenu.saving","保存中…"):o("panelMenu.save","保存")}),U&&c.jsx("span",{style:B.ok,children:o("panelMenu.saved","已保存,菜单立即生效")})]})]})}),document.body)}function Py({onClose:s}){const[f,y]=v.useState(null),[d,x]=v.useState(""),[_,b]=v.useState(!1),[U,j]=v.useState(""),h=typeof window<"u"&&window.cicy&&window.cicy.trustedOrigins||null,A=v.useCallback(async()=>{try{y(h&&await h.list()||[])}catch{y([])}},[h]);v.useEffect(()=>{A()},[A]);const T=async()=>{const J=d.trim();if(!(!J||_||!h)){b(!0),j("");try{const B=await h.add(J);B&&B.ok===!1?j(B.error||o("trustedSites.addFailed","添加失败")):(x(""),y(B&&B.origins||await h.list()))}catch(B){j(String(B&&B.message||B))}finally{b(!1)}}},V=async J=>{if(!(_||!h)){b(!0),j("");try{const B=await h.remove(J);B&&B.ok===!1?j(B.error||o("trustedSites.removeFailed","删除失败")):y(B&&B.origins||await h.list())}catch(B){j(String(B&&B.message||B))}finally{b(!1)}}},M={overlay:{position:"fixed",inset:0,zIndex:2e3,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0,.62)",backdropFilter:"blur(3px)"},card:{width:560,maxWidth:"94vw",maxHeight:"82vh",display:"flex",flexDirection:"column",background:"#101012",border:"1px solid rgba(255,255,255,.09)",borderRadius:16,boxShadow:"0 24px 64px rgba(0,0,0,.55)",overflow:"hidden",color:"#e4e4e7"},head:{display:"flex",alignItems:"center",gap:8,padding:"14px 16px",borderBottom:"1px solid rgba(255,255,255,.06)"},title:{margin:0,fontSize:15,fontWeight:600,flex:1},x:{background:"transparent",border:"none",color:"#a1a1aa",fontSize:16,cursor:"pointer",lineHeight:1,padding:4},warn:{margin:"14px 16px 0",padding:"10px 12px",fontSize:12.5,lineHeight:1.55,color:"#fca5a5",background:"rgba(239,68,68,.08)",border:"1px solid rgba(239,68,68,.25)",borderRadius:10},addRow:{display:"flex",gap:8,padding:"12px 16px 4px"},input:{flex:1,minWidth:0,background:"#161618",border:"1px solid rgba(255,255,255,.1)",borderRadius:9,padding:"9px 11px",color:"#e4e4e7",fontSize:13,outline:"none"},addBtn:{background:"rgba(255,255,255,.1)",border:"none",borderRadius:9,padding:"0 16px",color:"#fff",fontSize:13,fontWeight:500,cursor:"pointer"},err:{margin:"6px 16px 0",fontSize:12,color:"#fca5a5"},listWrap:{margin:"10px 16px 16px",border:"1px solid rgba(255,255,255,.07)",borderRadius:10,overflow:"auto",flex:1,minHeight:80},row:{display:"flex",alignItems:"center",gap:10,padding:"9px 12px",borderTop:"1px solid rgba(255,255,255,.05)"},host:J=>({flex:1,fontFamily:"ui-monospace,SFMono-Regular,Menlo,monospace",fontSize:13,color:J?"#71717a":"#e4e4e7",wordBreak:"break-all"}),tag:{fontSize:11,color:"#71717a",background:"rgba(255,255,255,.05)",borderRadius:6,padding:"2px 7px"},rm:{background:"transparent",border:"none",color:"#a1a1aa",fontSize:12,cursor:"pointer",padding:"3px 6px",borderRadius:6},muted:{padding:"16px",textAlign:"center",color:"#71717a",fontSize:12.5}};return Sa.createPortal(c.jsx("div",{style:M.overlay,onMouseDown:J=>{J.target===J.currentTarget&&s()},"data-id":"TrustedSitesModal",children:c.jsxs("div",{style:M.card,onClick:J=>J.stopPropagation(),children:[c.jsxs("div",{style:M.head,children:[c.jsx("h2",{style:M.title,children:o("trustedSites.title","受信任站点")}),c.jsx("button",{type:"button",style:M.x,onClick:s,"aria-label":"close",children:"✕"})]}),c.jsx("div",{style:M.warn,children:o("trustedSites.warn","⚠ 列表中的站点可以在你的电脑上执行命令(exec)。只添加你完全信任的地址。")}),c.jsxs("div",{style:M.addRow,children:[c.jsx("input",{"data-id":"trusted-sites-input",style:M.input,value:d,onChange:J=>x(J.target.value),onKeyDown:J=>{J.key==="Enter"&&T()},placeholder:o("trustedSites.placeholder","添加站点,如 app.cicy-ai.com 或 my-cloud.example.org")}),c.jsx("button",{type:"button","data-id":"trusted-sites-add",style:{...M.addBtn,opacity:_||!d.trim()?.5:1},onClick:T,disabled:_||!d.trim(),children:o("trustedSites.add","添加")})]}),U&&c.jsx("div",{style:M.err,children:U}),c.jsx("div",{style:M.listWrap,children:f===null?c.jsx("div",{style:M.muted,children:o("trustedSites.loading","加载中…")}):f.length===0?c.jsx("div",{style:M.muted,children:o("trustedSites.empty","暂无")}):f.map(J=>c.jsxs("div",{style:M.row,"data-id":"trusted-sites-row",children:[c.jsx("span",{style:M.host(J.builtin),children:J.host}),J.builtin?c.jsx("span",{style:M.tag,children:o("trustedSites.builtin","系统")}):c.jsx("button",{type:"button",style:M.rm,onClick:()=>V(J.host),disabled:_,children:o("trustedSites.remove","删除")})]},J.host))})]})}),document.body)}function eg({onClose:s}){const[f,y]=v.useState(null),[d,x]=v.useState(""),[_,b]=v.useState(""),[U,j]=v.useState(!1),h=typeof window<"u"&&window.cicy&&window.cicy.rpcAudit||null,A=v.useCallback(async()=>{j(!0),x("");try{const $=h&&await h.tail(400);!$||$.ok===!1?(x($&&$.error||o("audit.loadFailed","读取失败")),y([])):(y($.entries||[]),b($.path||""))}catch($){x(String($&&$.message||$)),y([])}finally{j(!1)}},[h]);v.useEffect(()=>{A()},[A]);const[T,V]=v.useState("all"),[M,J]=v.useState(""),B=$=>{try{return new Date($).toLocaleString()}catch{return $||""}},K=$=>{if($.kind==="auth"){const se=/deny/.test($.decision||"");return{text:$.decision||"auth",color:se?"#fca5a5":"#86efac",bg:se?"rgba(239,68,68,.14)":"rgba(34,197,94,.14)"}}if($.kind==="rpc"){const se=$.ok!==!1&&!$.error;return{text:se?"ok":"err",color:se?"#86efac":"#fca5a5",bg:se?"rgba(34,197,94,.14)":"rgba(239,68,68,.14)"}}return{text:$.kind||"log",color:"#a1a1aa",bg:"rgba(255,255,255,.06)"}},ee=$=>$.kind==="auth"?`${$.gate||""}${$.decision?" · "+$.decision:""}`:$.kind==="rpc"?`${$.tool||""}${$.dangerous?" ⚠":""}`:$.kind||"",_e=$=>$.error||$.args||($.kind==="rpc"?$.channel:"")||"",me=f||[],ce=M.trim().toLowerCase(),oe=me.filter($=>T!=="all"&&$.kind!==T?!1:ce?[$.origin,$.host,$.tool,$.gate,$.decision,$.channel,$.args,$.error,$.kind].filter(Boolean).join(" ").toLowerCase().includes(ce):!0),ye="186px 104px minmax(160px,1.1fr) minmax(150px,1.1fr) minmax(220px,1.8fr)",X={overlay:{position:"fixed",inset:0,zIndex:2e3,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0,.66)",backdropFilter:"blur(4px)"},card:{width:"96vw",height:"92vh",maxWidth:1480,display:"flex",flexDirection:"column",background:"#0d0d0f",border:"1px solid rgba(255,255,255,.09)",borderRadius:18,boxShadow:"0 32px 80px rgba(0,0,0,.6)",overflow:"hidden",color:"#e4e4e7"},head:{display:"flex",alignItems:"center",gap:14,padding:"20px 24px",borderBottom:"1px solid rgba(255,255,255,.07)"},titleWrap:{flex:1,minWidth:0},title:{margin:0,fontSize:21,fontWeight:650,letterSpacing:.2},subtitle:{margin:"3px 0 0",fontSize:12.5,color:"#71717a",fontFamily:"ui-monospace,SFMono-Regular,Menlo,monospace",wordBreak:"break-all"},count:{fontSize:12.5,color:"#a1a1aa",whiteSpace:"nowrap"},refresh:{background:"rgba(255,255,255,.1)",border:"none",borderRadius:9,padding:"9px 16px",color:"#fff",fontSize:13,fontWeight:500,cursor:"pointer"},x:{background:"transparent",border:"none",color:"#a1a1aa",fontSize:20,cursor:"pointer",lineHeight:1,padding:6},toolbar:{display:"flex",alignItems:"center",gap:10,padding:"14px 24px",borderBottom:"1px solid rgba(255,255,255,.05)"},chips:{display:"flex",gap:6},chip:$=>({background:$?"rgba(255,255,255,.14)":"transparent",border:"1px solid rgba(255,255,255,.12)",borderRadius:999,padding:"6px 16px",color:$?"#fff":"#a1a1aa",fontSize:13,cursor:"pointer"}),search:{flex:1,minWidth:0,background:"#161618",border:"1px solid rgba(255,255,255,.1)",borderRadius:10,padding:"10px 14px",color:"#e4e4e7",fontSize:13.5,outline:"none"},err:{margin:"10px 24px 0",fontSize:12.5,color:"#fca5a5"},tableWrap:{flex:1,overflow:"auto",margin:"0"},theadRow:{position:"sticky",top:0,zIndex:1,display:"grid",gridTemplateColumns:ye,gap:16,padding:"12px 24px",background:"#141417",borderBottom:"1px solid rgba(255,255,255,.08)",fontSize:11.5,letterSpacing:.6,textTransform:"uppercase",color:"#71717a",fontWeight:600},row:{display:"grid",gridTemplateColumns:ye,gap:16,padding:"13px 24px",borderBottom:"1px solid rgba(255,255,255,.045)",alignItems:"center"},time:{fontSize:12.5,color:"#a1a1aa",fontFamily:"ui-monospace,SFMono-Regular,Menlo,monospace",whiteSpace:"nowrap"},badge:$=>({justifySelf:"start",fontSize:11.5,color:$.color,background:$.bg,borderRadius:7,padding:"3px 10px",whiteSpace:"nowrap",fontWeight:500}),cell:{fontSize:13,color:"#d4d4d8",fontFamily:"ui-monospace,SFMono-Regular,Menlo,monospace",wordBreak:"break-all"},detail:{fontSize:12.5,color:"#8b8b93",wordBreak:"break-all"},muted:{padding:"60px 24px",textAlign:"center",color:"#71717a",fontSize:14}},ie=$=>c.jsx("div",{children:$});return Sa.createPortal(c.jsx("div",{style:X.overlay,onMouseDown:$=>{$.target===$.currentTarget&&s()},"data-id":"AuditLogModal",children:c.jsxs("div",{style:X.card,onClick:$=>$.stopPropagation(),children:[c.jsxs("div",{style:X.head,children:[c.jsxs("div",{style:X.titleWrap,children:[c.jsx("h2",{style:X.title,children:o("audit.title","审计日志")}),_&&c.jsx("p",{style:X.subtitle,children:_})]}),c.jsxs("span",{style:X.count,children:[o("audit.count","共")," ",oe.length,T!=="all"||ce?` / ${me.length}`:""]}),c.jsx("button",{type:"button","data-id":"audit-refresh",style:{...X.refresh,opacity:U?.5:1},onClick:A,disabled:U,children:o("audit.refresh","刷新")}),c.jsx("button",{type:"button",style:X.x,onClick:s,"aria-label":"close",children:"✕"})]}),c.jsxs("div",{style:X.toolbar,children:[c.jsxs("div",{style:X.chips,children:[c.jsx("button",{type:"button",style:X.chip(T==="all"),onClick:()=>V("all"),children:o("audit.all","全部")}),c.jsx("button",{type:"button",style:X.chip(T==="rpc"),onClick:()=>V("rpc"),children:o("audit.rpc","RPC 调用")}),c.jsx("button",{type:"button",style:X.chip(T==="auth"),onClick:()=>V("auth"),children:o("audit.auth","授权决定")})]}),c.jsx("input",{"data-id":"audit-search",style:X.search,value:M,onChange:$=>J($.target.value),placeholder:o("audit.search","搜索来源 / 工具 / 命令…")})]}),d&&c.jsx("div",{style:X.err,children:d}),c.jsxs("div",{style:X.tableWrap,children:[c.jsxs("div",{style:X.theadRow,children:[ie(o("audit.colTime","时间")),ie(o("audit.colType","类型")),ie(o("audit.colSource","来源")),ie(o("audit.colOp","操作")),ie(o("audit.colDetail","详情"))]}),f===null?c.jsx("div",{style:X.muted,children:o("audit.loading","加载中…")}):oe.length===0?c.jsx("div",{style:X.muted,children:me.length===0?o("audit.empty","暂无审计记录"):o("audit.noMatch","无匹配记录")}):oe.map(($,se)=>{const Ce=K($);return c.jsxs("div",{style:X.row,"data-id":"audit-row",children:[c.jsx("span",{style:X.time,children:B($.ts)}),c.jsx("span",{style:X.badge(Ce),children:Ce.text}),c.jsx("span",{style:X.cell,children:$.origin||$.host||"—"}),c.jsx("span",{style:X.cell,children:ee($)||"—"}),c.jsx("span",{style:X.detail,children:_e($)||"—"})]},se)})]})]})}),document.body)}function tg({me:s,welcome:f,onLogout:y,mitmTeam:d,guest:x=!1,onLogin:_,hub:b}){const U=!!(b!=null&&b.loggedIn),j=U?String(b.owner||""):"",h=j||"…",A=h.slice(0,1).toUpperCase();x=!U,s=U?{email:j}:null;const[T,V]=v.useState(!1),[M,J]=v.useState("");v.useEffect(()=>{var le,ge;if(!((ge=(le=window.cicy)==null?void 0:le.sidecar)!=null&&ge.tunnelStatus))return;let S=!1;const Z=()=>window.cicy.sidecar.tunnelStatus().then(Se=>{if(S||!(Se!=null&&Se.ok))return;let et=Se.tier;if(!et){const qe=Number(Se.tunnelLimit??Se.tunnel_limit);Number.isFinite(qe)&&(et=qe<0?"enterprise":qe>0?"team":"personal")}et&&J(String(et))}).catch(()=>{});Z();const F=setInterval(Z,6e4);return()=>{S=!0,clearInterval(F)}},[]);const[B,K]=v.useState(!1),[ee,_e]=v.useState(!1),[me,ce]=v.useState(!1),[oe,ye]=v.useState(!1),[X,ie]=v.useState(null);v.useEffect(()=>{if(!T)return;let S=!0;return Oi().then(Z=>S&&ie(Z||"")),()=>{S=!1}},[U,T]),v.useEffect(()=>{b!=null&&b.available&&b.status&&!U&&X&&jo("").then(()=>ie("")).catch(()=>{})},[b==null?void 0:b.available,b==null?void 0:b.status,U,X]);const[$,se]=v.useState(!1),[Ce,Te]=v.useState(!1),Ae=v.useCallback(async S=>{se(!1);const Z=qn(String(S||"").trim()),F=qn(X||"");if(Z===F)return;const le=Se=>we.show({id:"team-rename",status:"error",ttl:6e3,message:Se});if(Z&&!th.test(Z)){le(o("machineName.badFormat","机器名只能用字母、数字和 . _ -"));return}const ge=(b==null?void 0:b.takenNames)||[];if(Z&&ge.length){const Se=Ol(Z).toLowerCase(),et=Ol(F).toLowerCase();if(ge.some(Lt=>{const pt=String(Lt||"").trim().toLowerCase();return pt.startsWith(Yn)?pt!==et&&pt===Se:!1})){le(o("machineName.taken","「{{n}}」已经被另一台机器用了,换一个",{n:Z}));return}}Te(!0);try{const Se=await jo(Z);ie(Se||""),Z&&qn(Se||"")!==Z&&le(o("machineName.overridden","改名没生效:这台机器的名字由桌面上的「{{n}}.txt」决定,当前仍是「{{cur}}」",{n:qn(Se||"").replace(/^xs-/,""),cur:qn(Se||"")}));try{window.__cicyFleetRelabel&&window.__cicyFleetRelabel()}catch{}try{b!=null&&b.refresh&&b.refresh()}catch{}}catch{le(o("machineName.failed","机器名没保存成功"))}finally{Te(!1)}},[X,b]),[Oe,Ue]=v.useState(!1),[D,I]=v.useState(""),Q=v.useRef(null);v.useEffect(()=>{var Z,F,le;let S=!0;return(le=(F=(Z=window.cicy)==null?void 0:Z.app)==null?void 0:F.getVersion)==null||le.call(F).then(ge=>{S&&I(typeof ge=="string"?ge:String((ge==null?void 0:ge.desktop)||""))}).catch(()=>{}),()=>{S=!1}},[]),v.useEffect(()=>{if(!T)return;const S=Z=>{Q.current&&!Q.current.contains(Z.target)&&V(!1)};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[T]);const re=async()=>{var Z,F;const S=String(j||"").trim();if(S)try{(F=(Z=window.cicy)==null?void 0:Z.clipboard)!=null&&F.write?await window.cicy.clipboard.write(S):await navigator.clipboard.writeText(S),V(!1),we.show({message:o("userMenu.emailCopied","邮箱已复制"),status:"done",ttl:2500})}catch{we.show({message:o("userMenu.emailCopyFailed","邮箱复制失败"),status:"error",ttl:3500})}},ue=async()=>{var S,Z,F;V(!1),Ue(!0),we.show({id:"app-update",message:o("updateBanner.checking","正在检查更新…"),status:"running"});try{const le=await((F=(Z=(S=window.cicy)==null?void 0:S.app)==null?void 0:Z.checkUpdate)==null?void 0:F.call(Z));(le==null?void 0:le.status)==="available"?we.show({id:"app-update",message:o("updateBanner.available","发现新版本 v{{v}}",{v:le.version}),status:"done",ttl:4e3}):(le==null?void 0:le.status)==="up-to-date"?we.show({id:"app-update",message:o("updateBanner.upToDate","已是最新版本 v{{v}}",{v:le.version||le.current}),status:"done",ttl:3e3}):we.show({id:"app-update",message:o("updateBanner.error","更新失败")+(le!=null&&le.error?`:${le.error}`:""),status:"error",ttl:5e3})}catch(le){we.show({id:"app-update",message:le.message,status:"error",ttl:5e3})}finally{Ue(!1)}},m=(()=>{const S=String(M||"").toLowerCase().trim();return S?{personal:o("plan.personal","个人版"),team:o("plan.team","团队版"),enterprise:o("plan.enterprise","企业版")}[S]||S:""})();return c.jsxs(c.Fragment,{children:[c.jsx("header",{className:"topbar",children:c.jsxs("div",{className:"user-chip","data-id":"UserChip",ref:Q,children:[f&&c.jsx("span",{className:"welcome",children:f}),m&&c.jsx("span",{"data-id":"UserChip-plan",className:"plan-badge",title:o("plan.hint","当前账号版本"),style:{fontSize:11,fontWeight:600,lineHeight:1.6,padding:"2px 9px",borderRadius:999,whiteSpace:"nowrap",background:"var(--accent-soft, rgba(120,140,255,.16))",color:"var(--accent, #9db0ff)"},children:m}),x?c.jsxs("button",{type:"button","data-id":"UserChip-trigger",className:`user-chip__trigger${T?" is-open":""}`,onClick:()=>V(S=>!S),children:[c.jsx("div",{className:"avatar",style:{background:"var(--border, #2c2f36)",color:"var(--muted, #8b8b92)"},children:"?"}),c.jsx("span",{className:"user-name",children:o("cicyHub.login","登录 CiCy Hub")}),c.jsx("span",{className:"user-chip__caret","aria-hidden":!0,children:"▾"})]}):s?c.jsxs("button",{type:"button","data-id":"UserChip-trigger",className:`user-chip__trigger${T?" is-open":""}`,onClick:()=>V(S=>!S),children:[c.jsx("div",{className:"avatar",children:A}),c.jsx("span",{className:"user-name",children:h}),c.jsx("span",{className:"user-chip__caret","aria-hidden":!0,children:"▾"})]}):c.jsxs("div",{className:"user-chip__trigger user-chip__trigger--skel","data-id":"UserChip-skeleton","aria-hidden":!0,children:[c.jsx("div",{className:"skel skel--avatar"}),c.jsx("div",{className:"skel skel--name"})]}),T&&c.jsxs("div",{className:"user-chip__menu","data-id":"UserChip-menu",role:"menu",children:[!x&&(s==null?void 0:s.email)&&c.jsx("button",{type:"button","data-id":"UserChip-email-copy",className:"user-chip__menu-item",title:o("userMenu.copyEmail","点击复制邮箱"),onClick:re,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s.email}),U&&X!==null&&c.jsxs("div",{"data-id":"UserChip-team",title:o("machineName.hint","这台机器在车队里的名字,点一下就能改"),style:{padding:"0 14px 8px",marginTop:-4,fontSize:12,display:"flex",alignItems:"center",gap:6,minHeight:30,maxWidth:"100%",overflow:"hidden"},children:[c.jsx("span",{style:{opacity:.5,flex:"none"},children:o("machineName.label","机器名")}),$?c.jsx("input",{"data-id":"UserChip-team-input",autoFocus:!0,size:1,defaultValue:qn(X),placeholder:o("machineName.ph","例如 xs-1009"),spellCheck:!1,onClick:S=>S.stopPropagation(),onBlur:S=>Ae(S.target.value),onKeyDown:S=>{S.nativeEvent.isComposing||S.keyCode===229||(S.key==="Enter"?Ae(S.currentTarget.value):S.key==="Escape"&&se(!1))},style:{...qm,borderColor:"#3b82f6",background:"#0d1117",color:"#e6edf3"}}):c.jsx("button",{type:"button","data-id":"UserChip-team-edit",onClick:S=>{S.stopPropagation(),se(!0)},style:{...qm,textAlign:"left",cursor:"text",background:"transparent",color:X?"inherit":"#58a6ff",opacity:X?.7:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Ce?o("machineName.saving","保存中…"):X?qn(X):o("machineName.unset","未命名 · 点击设置")})]}),(b==null?void 0:b.available)&&!U&&c.jsx("button",{type:"button","data-id":"UserChip-hub-login",className:"user-chip__menu-item",onClick:()=>{V(!1),b.openLogin()},children:o("cicyHub.login","登录 CiCy Hub")}),(()=>{let S="";try{S=Wc()}catch{}return S?c.jsxs("div",{"data-id":"UserChip-machine-id",title:o("deviceId.hint","本机 ID"),style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,padding:"6px 14px 8px",fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace"},children:[c.jsx("span",{style:{opacity:.5,fontSize:12},children:"ID"}),c.jsx("span",{style:{fontSize:16,fontWeight:700,letterSpacing:1.5},children:S})]}):null})(),c.jsx("div",{className:"user-chip__menu-sep","aria-hidden":!0}),c.jsx("button",{type:"button","data-id":"UserChip-trusted-sites",className:"user-chip__menu-item",onClick:()=>{V(!1),K(!0)},children:o("trustedSites.menu","受信任站点")}),c.jsx("button",{type:"button","data-id":"UserChip-panel-menu",className:"user-chip__menu-item",onClick:()=>{V(!1),ye(!0)},children:o("panelMenu.menu","面板菜单")}),c.jsx("button",{type:"button","data-id":"UserChip-audit-log",className:"user-chip__menu-item",onClick:()=>{V(!1),_e(!0)},children:o("audit.menu","审计日志")}),c.jsx("button",{type:"button","data-id":"UserChip-terms",className:"user-chip__menu-item",onClick:()=>{V(!1),ce(!0)},children:o("firstRunTerms.menu","用户协议")}),c.jsx("button",{type:"button","data-id":"UserChip-check-update",className:"user-chip__menu-item",disabled:Oe,onClick:ue,children:Oe?o("updateBanner.checkingShort","检查中…"):o("updateBanner.checkBtn","检查更新")}),!1,c.jsx("div",{className:"user-chip__menu-sep","aria-hidden":!0}),U&&c.jsx("button",{type:"button","data-id":"UserChip-hub-logout",className:"user-chip__menu-item is-danger",onClick:()=>{V(!1),b.logout()},children:o("userMenu.logout","退出")}),c.jsxs("div",{className:"user-chip__menu-version","data-id":"UserChip-version",children:["CiCy Desktop ",D?`v${D}`:"…"]})]})]})}),B&&c.jsx(Py,{onClose:()=>K(!1)}),ee&&c.jsx(eg,{onClose:()=>_e(!1)}),oe&&c.jsx(Iy,{onClose:()=>ye(!1)}),me&&c.jsx(lh,{onClose:()=>ce(!1)})]})}function lh({onAgree:s,onClose:f}){var J;const[y,d]=v.useState(!1),[x,_]=v.useState(!1),b=(((J=window.cicyI18n)==null?void 0:J.locale)||"en").startsWith("zh")?"zh-CN":"en",U=(B,K)=>o(`firstRunTerms.${B}`,K),j=!!f,h=v.useMemo(()=>Ay(zy(b)),[b]),A=B=>{const K=B.currentTarget;K.scrollHeight-K.scrollTop-K.clientHeight<24&&d(!0)},T=v.useRef(null);v.useEffect(()=>{const B=T.current;B&&B.scrollHeight<=B.clientHeight+24&&d(!0)},[]);const V=async()=>{var B,K,ee;if(!(x||!y)){_(!0);try{await((ee=(K=(B=window.cicy)==null?void 0:B.terms)==null?void 0:K.agree)==null?void 0:ee.call(K,eh)),s==null||s()}catch{s==null||s()}}},M=()=>{var B,K,ee;try{(ee=(K=(B=window.cicy)==null?void 0:B.terms)==null?void 0:K.decline)==null||ee.call(K)}catch{}};return c.jsxs("div",{className:j?"terms-gate terms-gate--review":"shell terms-gate","data-id":"FirstRunTermsGate",style:j?{position:"fixed",inset:0,zIndex:1e3,background:"rgba(8,9,14,.72)",backdropFilter:"blur(4px)"}:void 0,onClick:j?B=>{B.target===B.currentTarget&&f()}:void 0,children:[c.jsx("div",{className:"glow","aria-hidden":!0}),c.jsxs("div",{className:"terms-gate__panel",children:[c.jsx("h1",{className:"terms-gate__title","data-id":"FirstRunTermsGate-title",children:U("title","用户协议与授权说明")}),c.jsx("p",{className:"terms-gate__subtitle",children:U("subtitle","使用 CiCy Desktop 前,请阅读并同意以下条款")}),c.jsx("div",{className:"terms-gate__body",ref:T,onScroll:A,"data-id":"FirstRunTermsGate-body",children:c.jsx("div",{className:"terms-md","data-id":"FirstRunTermsGate-md",dangerouslySetInnerHTML:{__html:h}})}),j?c.jsx("div",{className:"terms-gate__actions",children:c.jsx("button",{"data-id":"FirstRunTermsGate-close",className:"terms-gate__btn",onClick:f,children:U("close","关闭")})}):c.jsxs(c.Fragment,{children:[!y&&c.jsx("div",{className:"terms-gate__scrollhint","data-id":"FirstRunTermsGate-scrollhint",children:U("scrollHint","请阅读至底部以继续")}),c.jsxs("div",{className:"terms-gate__actions",children:[c.jsx("button",{"data-id":"FirstRunTermsGate-decline",className:"terms-gate__btn terms-gate__btn--ghost",onClick:M,children:U("decline","不同意并退出")}),c.jsx("button",{"data-id":"FirstRunTermsGate-agree",className:"terms-gate__btn",disabled:!y||x,title:y?"":U("mustAgree","未同意则无法使用本软件。"),onClick:V,children:U("agree","同意并继续")})]})]})]})]})}const Eo=new Set;let $m=0,Ge=null;function zl(){Eo.forEach(s=>s(Ge))}const De={open({onRetry:s,kind:f,source:y,title:d,sub:x}={}){Ge={status:"running",phase:"install-docker",kind:f||"install",source:y||"op",title:d||"",sub:x||"",logs:[],bars:{},minimized:!1,onRetry:s||null,lastAt:Date.now()},zl()},minimize(){Ge&&(Ge={...Ge,minimized:!0},zl())},restore(){Ge&&(Ge={...Ge,minimized:!1},zl())},push(s={}){var b;if(!Ge)return;const f=s.phase==="health"?"container":s.phase||Ge.phase,y={...Ge,phase:f,lastAt:Date.now()},d=Number.isFinite(s.progress),x=f==="install-docker"||f==="image";if(x&&(d||s.dest||s.url)){const U=((b=Ge.bars)==null?void 0:b[f])||{},j=d?s.progress:s.status==="skip"||s.status==="done"?100:U.progress;y.bars={...Ge.bars,[f]:{progress:j,received:s.received??U.received,total:s.total??U.total,url:s.url||U.url,dest:s.dest||U.dest,label:s.label||U.label}}}if(!(s.status==="running"&&d&&x)){const U=Ge.logs[Ge.logs.length-1],j=s.status||"running",h=s.message||"";if(!(U&&U.phase===f&&U.status===j&&U.message===h)){const A={id:++$m,t:ki(),phase:f,status:j,message:h};y.logs=[...Ge.logs,A]}}Ge=y,zl()},finish({ok:s,message:f,status:y}={}){if(!Ge||Ge.status!=="running")return;const d=y||(s?"done":"error"),x=d==="error"?Ge.phase:"done",_={id:++$m,t:ki(),phase:x,status:d,message:f||(s?"完成":"失败")};Ge={...Ge,status:d,phase:x,minimized:!1,logs:[...Ge.logs,_],lastAt:Date.now()},zl()},close(){Ge=null,zl()}},bo=[["install-docker","准备环境"],["image","下载运行环境"],["container","启动服务"],["done","完成"]],ag={"install-docker":"准备",image:"下载",container:"启动",health:"启动",done:"完成",open:"打开"},ng={"install-docker":"Docker Desktop",image:"基础镜像"};function Xm(s){return Number.isFinite(s)?s<1024?s+" B":s<1048576?(s/1024).toFixed(0)+" KB":s<1073741824?(s/1048576).toFixed(1)+" MB":(s/1073741824).toFixed(2)+" GB":"?"}function lg({phaseKey:s,bar:f}){const y=Number.isFinite(f==null?void 0:f.progress)?Math.max(0,Math.min(100,f.progress)):0,d=y>=100;return c.jsxs("div",{className:"dlbar","data-id":`DockerDrawer-dlbar-${s}`,children:[c.jsxs("div",{className:"dlbar__head",children:[c.jsx("span",{className:"dlbar__name",children:(f==null?void 0:f.label)||ng[s]||s}),c.jsxs("span",{className:"dlbar__pct",children:[y,"%",f!=null&&f.total?` · ${Xm(f.received)} / ${Xm(f.total)}`:""]})]}),c.jsx("div",{className:"dlbar__track",children:c.jsx("div",{className:`dlbar__fill${d?" is-done":""}`,style:{width:`${y}%`}})}),(f==null?void 0:f.url)&&c.jsxs("div",{className:"dlbar__url",title:f.url,children:[c.jsx("span",{className:"dlbar__urlk",children:"源"})," ",f.url]}),(f==null?void 0:f.dest)&&c.jsxs("div",{className:"dlbar__url",title:f.dest,children:[c.jsx("span",{className:"dlbar__urlk",children:"存"})," ",f.dest]})]})}function ig(){var h;const[s,f]=v.useState(Ge);v.useEffect(()=>(Eo.add(f),()=>{Eo.delete(f)}),[]);const y=v.useRef(null);if(v.useEffect(()=>{const A=y.current;A&&(A.scrollTop=A.scrollHeight)},[(h=s==null?void 0:s.logs)==null?void 0:h.length]),!s)return null;const d=s.status==="running",x=s.kind==="open",_=bo.findIndex(([A])=>A===s.phase),b=x?[]:["install-docker","image"].filter(A=>{var T;return(T=s.bars)==null?void 0:T[A]}),U=s.title||(x?`打开${Al}`:`安装${Al}`),j=s.sub||`127.0.0.1:${Nl}`;if(s.minimized){const A=b.map(V=>{var M;return(M=s.bars[V])==null?void 0:M.progress}).filter(Number.isFinite),T=A.length?Math.round(A.reduce((V,M)=>V+M,0)/A.length):null;return c.jsxs("button",{type:"button",className:`drawer-min drawer-min--${s.status}`,"data-id":"DockerDrawer-restore",onClick:()=>De.restore(),children:[c.jsx("span",{className:"drawer-min__spark",children:d?c.jsx($t,{}):s.status==="done"?"✓":s.status==="reboot"?"⟳":"!"}),c.jsxs("span",{className:"drawer-min__label",children:[U,T!=null?` · ${T}%`:""]})]})}return c.jsx("div",{className:"drawer-scrim","data-id":"DockerDrawer-scrim",onClick:()=>d?De.minimize():De.close(),children:c.jsxs("div",{className:"drawer","data-id":"DockerDrawer","data-status":s.status,onClick:A=>A.stopPropagation(),children:[c.jsxs("div",{className:"drawer__head",children:[c.jsxs("div",{className:"drawer__title",children:[c.jsx("span",{className:`drawer__spark drawer__spark--${s.status}`,children:d?c.jsx($t,{}):s.status==="done"?"✓":s.status==="reboot"?"⟳":"!"}),c.jsxs("div",{children:[c.jsx("div",{className:"drawer__h",children:U}),c.jsx("div",{className:"drawer__sub",children:j})]})]}),c.jsx("div",{className:"drawer__headbtns",children:c.jsx("button",{type:"button",className:"drawer__x","data-id":"DockerDrawer-min",title:o("common.minimize","最小化"),onClick:()=>De.minimize(),"aria-label":"minimize",children:"‒"})})]}),!x&&c.jsx("div",{className:"drawer__steps","data-id":"DockerDrawer-steps",children:bo.map(([A,T],V)=>{const M=s.status==="done"||_>=0&&V<_,J=V===_&&d,B=s.status==="error"&&V===_;return c.jsxs("div",{className:`drawer__step${J?" is-active":""}${M?" is-done":""}${B?" is-error":""}`,children:[c.jsx("span",{className:"drawer__step-dot",children:M?"✓":B?"!":V+1}),c.jsx("span",{className:"drawer__step-label",children:T}),V<bo.length-1&&c.jsx("span",{className:"drawer__step-bar"})]},A)})}),b.length>0&&c.jsx("div",{className:"drawer__dlbars","data-id":"DockerDrawer-dlbars",children:b.map(A=>c.jsx(lg,{phaseKey:A,bar:s.bars[A]},A))}),d&&s.logs.length>0&&c.jsxs("div",{className:"drawer__now","data-id":"DockerDrawer-now",children:[c.jsx($t,{}),c.jsx("span",{children:s.logs[s.logs.length-1].message})]}),c.jsx("div",{className:"drawer__log drawer__log--scroll","data-id":"DockerDrawer-log",ref:y,children:s.logs.length===0?c.jsx("div",{className:"drawer__log-empty",children:o("docker.preparing","准备中…")}):s.logs.map(A=>c.jsxs("div",{className:"drawer__line","data-status":A.status,children:[c.jsx("span",{className:"drawer__t",children:A.t}),c.jsx("span",{className:`drawer__badge drawer__badge--${A.phase}`,children:o(`dockerBadge.${A.phase}`,ag[A.phase]||A.phase)}),c.jsx("span",{className:"drawer__linemsg",children:A.message})]},A.id))}),c.jsx("div",{className:"drawer__foot",children:d?c.jsx(c.Fragment,{children:c.jsx("span",{className:"drawer__foot-status",children:x?o("docker.opening","打开中…"):o("docker.installing2","安装进行中…")})}):s.status==="reboot"?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"drawer__foot-status is-reboot",children:o("docker.rebootAuto","需重启 Windows(90 秒后自动重启,登录后自动继续)")}),c.jsx("button",{type:"button",className:"drawer__btn is-accent","data-id":"DockerDrawer-reboot-now",onClick:()=>{var A,T,V;return(V=(T=(A=window.cicy)==null?void 0:A.docker)==null?void 0:T.rebootNow)==null?void 0:V.call(T)},children:o("docker.rebootNow","立即重启")}),c.jsx("button",{type:"button",className:"drawer__btn","data-id":"DockerDrawer-reboot-cancel",onClick:()=>{var A,T,V;(V=(T=(A=window.cicy)==null?void 0:A.docker)==null?void 0:T.rebootCancel)==null||V.call(T),De.close()},children:o("docker.rebootCancel","取消自动重启")})]}):s.status==="error"?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"drawer__foot-status is-error",children:x?o("docker.openFailed","打开失败"):o("docker.failed","安装失败")}),s.onRetry&&c.jsx("button",{type:"button",className:"drawer__btn is-accent","data-id":"DockerDrawer-retry",onClick:()=>s.onRetry(),children:o("common.retry","重试")}),c.jsx("button",{type:"button",className:"drawer__btn","data-id":"DockerDrawer-dismiss",onClick:()=>De.close(),children:o("common.close","关闭")})]}):c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"drawer__foot-status is-done",children:o("docker.ready","已就绪")}),c.jsx("button",{type:"button",className:"drawer__btn is-accent","data-id":"DockerDrawer-finish",onClick:()=>De.close(),children:o("common.done","完成")})]})})]})})}const cg="v24.19.0",sg=['"%LOCALAPPDATA%\\cicy-node\\node.exe"','"%ProgramFiles%\\nodejs\\node.exe"','"%LOCALAPPDATA%\\Programs\\nodejs\\node.exe"','"%APPDATA%\\nvm\\current\\node.exe"'].map(s=>`(${s} --version 2>nul && echo NODE=${s.slice(1,-1)})`).join(" || ")+" & echo HOME=%USERPROFILE%";function ug(){return`$ErrorActionPreference = 'SilentlyContinue'; $ProgressPreference = 'SilentlyContinue'
427
+ $ver = '${cg}'; $name = "node-$ver-win-x64"
428
+ $dir = "$env:LOCALAPPDATA\\cicy-node"; $tmp = "$env:LOCALAPPDATA\\cicy-node-dl"; $zip = "$tmp\\$name.zip"; $ex = "$tmp\\$name"; $lock = "$tmp\\install.lock"
429
+ $curl = "$env:SystemRoot\\System32\\curl.exe"; $tar = "$env:SystemRoot\\System32\\tar.exe"
430
+ New-Item -ItemType Directory -Force -Path $tmp | Out-Null
431
+ function Good($p) { if (-not (Test-Path "$p\\node.exe")) { return $false }; $v = & "$p\\node.exe" --version 2>$null; return ($v -match '^v(\\d+)\\.' -and [int]$matches[1] -ge 22) }
432
+ # file ops retry: Defender / 360 scan a fresh 37MB zip and hold it for seconds, so tar/move/delete fail with sharing violations
433
+ function Retry($n, $sb) { for ($k = 0; $k -lt $n; $k++) { $ok = $false; try { $ok = [bool](& $sb) } catch { $ok = $false }; if ($ok) { return $true }; Start-Sleep -Seconds 2 }; return $false }
434
+ function ZipOk($z) { if (-not (Test-Path $z)) { return $false }; if ((Get-Item $z).Length -lt 30000000) { return $false }; if (Test-Path $tar) { return (Retry 6 { & $tar -tf $z 2>$null | Out-Null; $LASTEXITCODE -eq 0 }) }; return $true }
435
+ function LockAlive { if (-not (Test-Path $lock)) { return $false }; $id = 0; try { $id = [int](Get-Content $lock -Raw) } catch { return $false }; if ($id -le 0) { return $false }; return ($null -ne (Get-Process -Id $id -ErrorAction SilentlyContinue)) }
436
+ function Main {
437
+ $t0 = Get-Date
438
+ if (Good $dir) { return "NODE=$dir\\node.exe" }
439
+ if (-not (Good $ex)) {
440
+ $urls = @("https://nodejs.org/dist/$ver/$name.zip", "https://cdn.npmmirror.com/binaries/node/$ver/$name.zip", "https://npmmirror.com/mirrors/node/$ver/$name.zip")
441
+ $have = ZipOk $zip
442
+ if (-not $have) {
443
+ Remove-Item $zip -Force
444
+ if (Test-Path $curl) {
445
+ $procs = @(); $i = 0
446
+ foreach ($u in $urls[0..1]) { $i++; $f = "$tmp\\spd$i.txt"; Remove-Item $f -Force; $procs += ,@($u, $f, (Start-Process -FilePath $curl -ArgumentList @('-s','-L','-o','NUL','-w','%{size_download}','--max-time','5',$u) -RedirectStandardOutput $f -WindowStyle Hidden -PassThru)) }
447
+ Start-Sleep -Seconds 6
448
+ $score = @{}
449
+ foreach ($p in $procs) { if (-not $p[2].HasExited) { $p[2].Kill() }; $n = 0; try { $n = [int64]((Get-Content $p[1] -Raw) -replace '[^0-9]', '') } catch { }; $score[$p[0]] = $n; Write-Output "SPD=$n $($p[0])" }
450
+ $urls = @($urls | Sort-Object { $s = 0; if ($score.ContainsKey($_)) { $s = $score[$_] }; -$s })
451
+ foreach ($u in $urls) {
452
+ Write-Output "SRC=$u"
453
+ # resume .part with -C - (same zip on every mirror); give up a source once it drops under 80KB/s for 30s
454
+ & $curl -L -s -S -o "$zip.part" -C - --speed-limit 80000 --speed-time 30 --max-time 900 $u 2>$null
455
+ $code = $LASTEXITCODE; $n = 0; if (Test-Path "$zip.part") { $n = (Get-Item "$zip.part").Length }
456
+ Write-Output "CURL=$code bytes=$n"
457
+ if ($code -eq 0 -and (ZipOk "$zip.part")) { Retry 8 { Move-Item "$zip.part" $zip -Force; (Test-Path $zip) -and -not (Test-Path "$zip.part") } | Out-Null; if (ZipOk $zip) { $have = $true; break } }
458
+ if ($code -eq 0 -or $n -gt 40000000) { Remove-Item "$zip.part" -Force }
459
+ }
460
+ }
461
+ if (-not $have) {
462
+ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
463
+ foreach ($u in $urls) { try { Remove-Item $zip -Force; Write-Output "SRC=$u"; Write-Output "IWR=$u"; Invoke-WebRequest -Uri $u -OutFile $zip -UseBasicParsing -TimeoutSec 300; if (ZipOk $zip) { $have = $true; break } } catch { } }
464
+ }
465
+ if (-not $have) { return 'ERR=download' }
466
+ }
467
+ Retry 5 { Remove-Item $ex -Recurse -Force; -not (Test-Path $ex) } | Out-Null
468
+ if (Test-Path $tar) { Retry 3 { & $tar -xf $zip -C $tmp 2>$null; Good $ex } | Out-Null }
469
+ if (-not (Good $ex)) { Remove-Item $ex -Recurse -Force; Expand-Archive -Path $zip -DestinationPath $tmp -Force }
470
+ if (-not (Good $ex)) { return 'ERR=extract' }
471
+ }
472
+ if (Test-Path $dir) { Retry 8 { Remove-Item $dir -Recurse -Force; -not (Test-Path $dir) } | Out-Null }
473
+ Retry 10 { Move-Item $ex $dir; Good $dir } | Out-Null
474
+ if (-not (Good $dir)) { Copy-Item $ex $dir -Recurse -Force }
475
+ Retry 5 { Remove-Item $zip -Force; Remove-Item "$zip.part" -Force; Remove-Item "$tmp\\spd*.txt" -Force; Remove-Item $ex -Recurse -Force; -not (Test-Path $ex) } | Out-Null
476
+ Write-Output ("SECS=" + [int]((Get-Date) - $t0).TotalSeconds)
477
+ if (Good $dir) { return "NODE=$dir\\node.exe" } else { return 'ERR=move' }
478
+ }
479
+ # install lock: a page reload / second window re-triggers setup; two extractors would trample each other, so wait for the live one
480
+ if (LockAlive) { for ($i = 0; $i -lt 450; $i++) { Start-Sleep -Seconds 2; if (Good $dir) { break }; if (-not (LockAlive)) { break } } }
481
+ if (Good $dir) { Write-Output "NODE=$dir\\node.exe"; exit 0 }
482
+ Set-Content -Path $lock -Value $PID
483
+ $r = @(Main)
484
+ Remove-Item $lock -Force
485
+ $r | ForEach-Object { Write-Output $_ }
486
+ if ($r.Count -gt 0 -and "$($r[-1])" -like 'NODE=*') { exit 0 } else { exit 1 }
487
+ `}const og='for p in /usr/local/bin/node /opt/homebrew/bin/node /usr/bin/node "$HOME"/.nvm/versions/node/*/bin/node "$HOME"/.volta/bin/node; do if [ -x "$p" ]; then v=$("$p" --version 2>/dev/null); case "$v" in v2[2-9].*|v[3-9][0-9].*) echo "NODE=$p"; break;; esac; fi; done; echo "HOME=$HOME"';function ih(s){if(!s)return{ok:!1,stdout:"",stderr:"no response",code:1};const f=(s.content||[]).map(x=>x.text).filter(Boolean).join(`
488
+ `);let y=null;try{y=JSON.parse(f)}catch{}if(!y||typeof y!="object")return{ok:!s.isError,stdout:f,stderr:"",code:s.isError?1:0};const d=Number(y.exitCode??(s.isError?1:0));return{ok:!s.isError&&d===0,stdout:y.stdout||"",stderr:y.stderr||"",code:d}}async function zo(s){var f;return ih(await((f=window.electronRPC)==null?void 0:f.call(window,"exec_shell",{command:s})))}const rg=()=>{var s;return(((s=window.cicy)==null?void 0:s.platform)||"")==="win32"};let zi=null;async function dg({installNode:s=!1}={}){var M;if(zi&&zi.node)return zi;const f=rg(),y=J=>{var B,K,ee;return{node:((B=(J.match(/^NODE=(.+)$/m)||[])[1])==null?void 0:B.trim())||"",home:((K=(J.match(/^HOME=(.+)$/m)||[])[1])==null?void 0:K.trim())||"",err:((ee=(J.match(/^ERR=(.+)$/m)||[])[1])==null?void 0:ee.trim())||"",major:Number((J.match(/^v(\d+)\./m)||[])[1]||0),src:[...J.matchAll(/^SRC=(.+)$/mg)].map(_e=>_e[1].trim()).pop()||"",secs:Number((J.match(/^SECS=(\d+)/m)||[])[1]||0)}};let d=await zo(f?sg:og),x=y((d.stdout||"")+`
489
+ `+(d.stderr||"")),_=x.node,b=x.home,U="",j="",h=0;if(f&&_&&x.major&&x.major<22&&(_=""),!_&&f&&s){const J=`${b}\\cicy-ai\\db\\dsh-node.ps1`;if(!ih(await((M=window.electronRPC)==null?void 0:M.call(window,"file_write",{path:J,content:"\uFEFF"+ug()}))).ok)return{node:"",home:b,error:"ps1_write_failed"};d=await zo(`"%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe" -NoProfile -NonInteractive -ExecutionPolicy Bypass -File "${J}"`);const K=y((d.stdout||"")+`
490
+ `+(d.stderr||""));_=K.node,U=K.err,j=K.src,h=K.secs,!_&&!U&&(U=(d.stderr||d.stdout||"").trim().slice(-300))}if(!_)return{node:"",home:b,error:U};const A=_.replace(/[\\/][^\\/]+$/,""),T=f?`${A}\\npm.cmd`:`${A}/npm`,V=f?`${b}\\cicy-ai\\db\\dsh-ctl.js`:`${b}/cicy-ai/db/dsh-ctl.js`;return zi={node:_,npm:T,home:b,ctl:V,written:!1,src:j,secs:h},zi}const Al="本机团队",vo=s=>!s||/^\s*docker\s*(团队|team)?\s*(:\s*\d+)?\s*$/i.test(String(s));async function So(s){const f=await dg();if(!f.node||!f.home)return{ok:!1,error:"no_node"};const y=await zo(`"${f.node}" "${f.home}\\cicy-ai\\db\\qemu-vm-ctl.js" ${s}`),d=String(y.stdout||"").trim().match(/\{[\s\S]*\}$/);if(d)try{return JSON.parse(d[0])}catch{}return{ok:!1,error:"ctl_no_output",detail:(y.stderr||y.stdout||"").trim().slice(-300)}}function fg({dockerTeam:s,cloudTitle:f,cloudCode:y,onOpen:d,onRename:x,onRefresh:_}){var St;const[b,U]=v.useState(null),[j,h]=v.useState(""),[A,T]=v.useState(!1),[V,M]=v.useState(!1),[J,B]=v.useState(!1),[K,ee]=v.useState(!1),[_e,me]=v.useState([]),[ce,oe]=v.useState(!1),[ye,X]=v.useState(""),[ie,$]=v.useState(!1),[se,Ce]=v.useState(""),Te=vo(f)?Al:f,Ae=v.useRef(!1);v.useEffect(()=>{var L,C,N;Ae.current||!(s!=null&&s.id)||!vo(s.name)||vo(f)&&(Ae.current=!0,Promise.resolve((N=(C=(L=window.cicy)==null?void 0:L.localTeams)==null?void 0:C.update)==null?void 0:N.call(C,s.id,{name:Al})).then(q=>{q!=null&&q.ok&&(_==null||_())}).catch(q=>console.warn("[DockerCard] rename to 本机团队",q)))},[s==null?void 0:s.id,s==null?void 0:s.name,f,_]);const Oe=L=>{var C;(C=L==null?void 0:L.stopPropagation)==null||C.call(L),Ce(Te),$(!0)},Ue=async()=>{$(!1);const L=String(se||"").trim();if(!(!L||L===Te||!x))try{await x(L),_==null||_()}catch{}},[D,I]=v.useState({top:0,left:0}),Q=v.useRef(null),re=v.useRef(null),ue=184,m="#2496ed",S=v.useCallback(async()=>{var L,C,N;try{const q=await((N=(C=(L=window.cicy)==null?void 0:L.docker)==null?void 0:C.appStatus)==null?void 0:N.call(C));q&&Number(q.port)&&(Nl=Number(q.port)),U(q);const W=Date.now()-((Ge==null?void 0:Ge.lastAt)||0)>3e4;q!=null&&q.running&&Ge&&Ge.status==="running"&&(Ge.kind||"install")==="install"&&W&&De.finish({ok:!0,message:"Docker cicy-code 已就绪"})}catch(q){console.warn("[DockerCard]",q)}},[]);v.useEffect(()=>{S();const L=setInterval(()=>{j||S()},12e3);return()=>clearInterval(L)},[S,j]);const Z=v.useCallback(async()=>{var L,C,N;T(!1),X("");try{const q=await((N=(C=(L=window.cicy)==null?void 0:L.docker)==null?void 0:C.getPorts)==null?void 0:N.call(C));me(((q==null?void 0:q.ports)||[]).map(String))}catch{me([])}ee(!0)},[]),F=v.useCallback(async()=>{var q,W,te,$e,ae,Et,gt,st,Me;const L=new Set,C=[];for(const be of _e){const Ee=String(be).trim();if(!Ee)continue;const ft=Number(Ee);if(!Number.isInteger(ft)||ft<1||ft>65535||ft===8008||ft===Nl||L.has(ft)){X(o("docker.ports.invalid","有端口无效(1-65535,不能是 {{p}},不能重复)",{p:Nl}));return}L.add(ft),C.push(ft)}X(""),oe(!0),ee(!1),h("recreate"),De.open({onRetry:F});const N=(te=(W=(q=window.cicy)==null?void 0:q.docker)==null?void 0:W.onAppProgress)==null?void 0:te.call(W,be=>De.push(be));try{const be=await((Et=(ae=($e=window.cicy)==null?void 0:$e.docker)==null?void 0:ae.setPorts)==null?void 0:Et.call(ae,C));if(De.finish({ok:!!(be!=null&&be.ok),message:be!=null&&be.ok?o("docker.ports.save","保存并重建")+" ✅":(be==null?void 0:be.error)||o("docker.opFailed","操作失败")}),be!=null&&be.ok)try{const Ee=await((Me=(st=(gt=window.cicy)==null?void 0:gt.docker)==null?void 0:st.appRedetect)==null?void 0:Me.call(st));Ee&&U(Ee)}catch{}}catch(be){De.finish({ok:!1,message:be.message})}finally{try{N&&N()}catch{}oe(!1),h(""),S()}},[_e,S]);v.useEffect(()=>{if(!A)return;const L=N=>{var q,W;(q=Q.current)!=null&&q.contains(N.target)||(W=re.current)!=null&&W.contains(N.target)||T(!1)},C=N=>{N.key==="Escape"&&T(!1)};return document.addEventListener("mousedown",L),document.addEventListener("keydown",C),()=>{document.removeEventListener("mousedown",L),document.removeEventListener("keydown",C)}},[A]);const le=()=>{if(!A&&Q.current){const L=Q.current.getBoundingClientRect(),C=Math.max(8,Math.min(L.right-ue,window.innerWidth-ue-8));I({top:Math.round(L.bottom+4),left:Math.round(C)})}T(L=>!L)},ge=v.useCallback(async()=>{var C,N,q,W,te,$e;h("bootstrap"),De.open({onRetry:ge});const L=(q=(N=(C=window.cicy)==null?void 0:C.docker)==null?void 0:N.onAppProgress)==null?void 0:q.call(N,ae=>De.push(ae));try{const ae=await(($e=(te=(W=window.cicy)==null?void 0:W.docker)==null?void 0:te.appBootstrap)==null?void 0:$e.call(te));(ae==null?void 0:ae.reason)==="installer_launched"?De.finish({status:"reboot",message:o("docker.installerLaunched","已打开 Docker 安装程序——请完成安装(会装 WSL2、可能需重启),装好后点「重试」")}):(ae==null?void 0:ae.reason)==="wsl_reboot_required"?De.finish({status:"reboot",message:o("docker.rebootNeeded","WSL2 已安装,请【重启 Windows】后回来点「重试」继续")}):De.finish({ok:!!(ae!=null&&ae.ok),message:ae!=null&&ae.ok?o("docker.ready","Docker cicy-code 已就绪"):(ae==null?void 0:ae.error)||o("docker.failed","安装失败")}),ae!=null&&ae.ok&&(_==null||_())}catch(ae){De.finish({ok:!1,message:ae.message})}finally{try{L&&L()}catch{}h(""),S()}},[S,_]),Se=v.useCallback(async()=>{var C,N,q,W,te,$e;h("repair"),De.open({onRetry:Se});const L=(q=(N=(C=window.cicy)==null?void 0:C.docker)==null?void 0:N.onAppProgress)==null?void 0:q.call(N,ae=>De.push(ae));try{const ae=await(($e=(te=(W=window.cicy)==null?void 0:W.docker)==null?void 0:te.appRepairWsl)==null?void 0:$e.call(te));ae!=null&&ae.needsReboot?De.finish({status:"reboot",message:o("docker.wslNeedReboot","WSL 服务卡死,请【重启 Windows】;重启后打开 CiCy 会自动修复(旧数据已改名备份,不删)。")}):ae!=null&&ae.ok?(De.finish({ok:!0,message:o("docker.wslRepaired","WSL 已修复 ✅")}),_==null||_()):De.finish({ok:!1,message:(ae==null?void 0:ae.error)||o("docker.repairFailed","修复失败")})}catch(ae){De.finish({ok:!1,message:ae.message})}finally{try{L&&L()}catch{}h(""),S()}},[S,_]),et=v.useCallback(async()=>{var C,N,q,W,te,$e;T(!1),h("upgrade"),De.open({onRetry:et});const L=(q=(N=(C=window.cicy)==null?void 0:C.docker)==null?void 0:N.onAppProgress)==null?void 0:q.call(N,ae=>De.push(ae));try{const ae=await(($e=(te=(W=window.cicy)==null?void 0:W.docker)==null?void 0:te.appUpgrade)==null?void 0:$e.call(te));(ae==null?void 0:ae.reason)==="wsl_reboot_required"?De.finish({status:"reboot",message:o("docker.rebootNeeded","WSL2 已安装,请【重启 Windows】后回来点「重试」继续")}):De.finish({ok:!!(ae!=null&&ae.ok),message:ae!=null&&ae.ok?o("docker.upgraded","已升级到最新"):(ae==null?void 0:ae.error)||o("docker.upgradeFailed","升级失败")}),ae!=null&&ae.ok&&(_==null||_())}catch(ae){De.finish({ok:!1,message:ae.message})}finally{try{L&&L()}catch{}h(""),S()}},[S,_]),qe=v.useCallback(async()=>{var C,N,q,W,te,$e,ae,Et,gt,st,Me,be;T(!1),h("update"),De.open({onRetry:qe});const L=(q=(N=(C=window.cicy)==null?void 0:C.docker)==null?void 0:N.onAppProgress)==null?void 0:q.call(N,Ee=>De.push(Ee));try{const Ee=await(($e=(te=(W=window.cicy)==null?void 0:W.docker)==null?void 0:te.appUpdate)==null?void 0:$e.call(te));if(De.finish({ok:!!(Ee!=null&&Ee.ok),message:Ee!=null&&Ee.ok?o("docker.updated","cicy-code 已更新到最新"):(Ee==null?void 0:Ee.error)||o("docker.updateFailed","更新失败")}),Ee!=null&&Ee.ok){_==null||_();try{(gt=(Et=(ae=window.cicy)==null?void 0:ae.tabs)==null?void 0:Et.reloadIfOpen)==null||gt.call(Et,xo(),Al)}catch{}try{const ft=await((be=(Me=(st=window.cicy)==null?void 0:st.docker)==null?void 0:Me.appRedetect)==null?void 0:be.call(Me));ft&&U(ft)}catch{}}}catch(Ee){De.finish({ok:!1,message:Ee.message})}finally{try{L&&L()}catch{}h(""),S()}},[S,_]),Lt=Number(b==null?void 0:b.port)===8009,[pt,oa]=v.useState(null);v.useEffect(()=>{A&&Lt&&So("status").then(oa).catch(()=>{})},[A,Lt]);const Aa=async()=>{var C,N,q;T(!1);const L=await So("open");if(!L.ok){we.show({id:"docker-op",status:"error",ttl:6e3,message:o("docker.vmTermNotReady","虚拟机终端还没就绪,稍等再试")});return}await((q=(N=(C=window.cicy)==null?void 0:C.tabs)==null?void 0:N.open)==null?void 0:q.call(N,L.url,o("docker.vmTermTab","Debian 终端"),"",!0))},Nt=async()=>{if(T(!1),!!window.confirm(o("docker.accelConfirm","开启「Windows 虚拟机监控程序平台」(WHPX)需要管理员权限,开启后要重启电脑才生效。继续?"))){h("accel");try{const L=await So("accel");we.show({id:"docker-op",status:L.ok?"done":"error",ttl:L.ok?1e4:6e3,message:L.ok?o("docker.accelDone","已开启,重启电脑后虚拟机自动用硬件加速"):L.error||o("docker.opFailed","操作失败")})}finally{h("")}}},Xt=v.useCallback(async(L,C,N)=>{T(!1),h(L),we.show({id:"docker-op",message:o(`docker.${L}ing`,L==="restart"?"重启中…":L==="reload"?"刷新中…":"停止中…"),status:"running"});try{const q=await C();q!=null&&q.ok?we.show({id:"docker-op",message:N,status:"done",ttl:2500}):we.show({id:"docker-op",message:(q==null?void 0:q.error)||o("docker.opFailed","操作失败"),status:"error",ttl:6e3})}catch(q){we.show({id:"docker-op",message:q.message,status:"error",ttl:6e3})}finally{h(""),S()}},[S]),Ht=v.useCallback(async()=>{T(!1),h("authssh"),we.show({id:"docker-op",message:o("docker.authorizingHost","授权容器访问 Mac(配置 SSH)…"),status:"running"});try{const L=await window.cicy.docker.appAuthorizeHostSsh();L!=null&&L.ok?we.show({id:"docker-op",message:L.verified?o("docker.authorizedHostOk","已授权:容器内 `ssh mac` 可访问 Mac ✅"):o("docker.authorizedHostPartial","公钥已写入 Mac(未验证成功,可在容器内手动 `ssh mac` 试)"),status:L.verified?"done":"error",ttl:5e3}):we.show({id:"docker-op",message:(L==null?void 0:L.error)||o("docker.opFailed","操作失败"),status:"error",ttl:6e3})}catch(L){we.show({id:"docker-op",message:L.message,status:"error",ttl:6e3})}finally{h(""),S()}},[S]),ja=((St=window.cicy)==null?void 0:St.platform)||(b==null?void 0:b.platform);if(ja!=="win32")return null;const qt=b?!!b.running:(s==null?void 0:s.status)==="running",ut=!!(b!=null&&b.dockerRunning),Yt=!!(b!=null&&b.installed),Pt=!!(b!=null&&b.unknown)&&!qt&&!ut&&!Yt,ot=!!(b!=null&&b.wslUnmanaged),yt=!!(b!=null&&b.wslWedged),rt=qt&&!ot,dt=rt?"ok":yt||ot||ut||Yt||Pt?"warn":"off",Qt=!!j;yt?o("docker.wslWedged","WSL 卡死 · 点「修复 WSL」"):ot?o("docker.wslBrokenRepair","WSL 管理异常 · 点「修复 WSL」重装"):qt?o("docker.running","运行中"):ut?o("docker.notRunning","未启动 · 点「启动」"):Yt?o("docker.engineDown","Docker 未运行 · 点启动"):Pt?o("docker.wslUnresponsive","WSL 未响应 · 点「重试检测」"):o("docker.notInstalled","Docker Desktop 未安装");const ea=j==="open"?o("docker.opening","打开中…"):j==="probe"?o("docker.probing","检测中…"):Qt?o("docker.working","处理中…"):rt?o("localTeams.open","打开"):yt||ot?o("docker.repairWsl","修复 WSL"):ut?o("docker.start","启动"):Yt?o("docker.startDocker","启动 Docker"):Pt?o("docker.retryProbe","重试检测"):o("docker.install","下载安装"),jt=async()=>{var L,C,N,q,W,te,$e,ae,Et,gt,st,Me;if(!Qt){if(yt){Se();return}if(ot){ge();return}if(rt){try{const Ee=await((N=(C=(L=window.cicy)==null?void 0:L.tabs)==null?void 0:C.activateIfOpen)==null?void 0:N.call(C,xo()));if(Ee!=null&&Ee.active)return}catch{}h("open");let be=null;try{be=await((te=(W=(q=window.cicy)==null?void 0:q.docker)==null?void 0:W.appOpen)==null?void 0:te.call(W))}catch(Ee){be={ok:!1,hint:(Ee==null?void 0:Ee.message)||o("docker.openFailed","打开失败"),log:[]}}h(""),be&&be.ok===!1&&(De.open({onRetry:jt,kind:"open"}),(be.log||[]).forEach(Ee=>De.push(Ee)),De.finish({ok:!1,message:be.hint||be.error||o("docker.openFailed","打开失败")}));return}if(Pt){h("probe");try{const be=await(((Et=(ae=($e=window.cicy)==null?void 0:$e.docker)==null?void 0:ae.appRedetect)==null?void 0:Et.call(ae))??((Me=(st=(gt=window.cicy)==null?void 0:gt.docker)==null?void 0:st.appStatus)==null?void 0:Me.call(st)));be&&U(be),be!=null&&be.unknown&&we.show({id:"docker-probe",status:"error",message:o("docker.wslStillStuck","WSL 仍无响应 —— 多半要重启 Windows 后再试"),ttl:6e3})}catch{we.show({id:"docker-probe",status:"error",message:o("docker.probeFailed","检测失败,请重试"),ttl:5e3})}finally{h("")}return}ge()}},Ka=qt;return c.jsxs("div",{"data-id":"DockerCard",className:`bcard bcard--docker${qt?" bcard--online":""}`,children:[c.jsx("div",{className:"bcard__accent",style:{background:m}}),c.jsxs("div",{className:"bcard__top",children:[c.jsxs("div",{className:"bcard__pill",style:{color:m},children:[c.jsx("span",{className:"bcard__dot","data-tone":dt}),c.jsx("svg",{style:{width:18,height:18},viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:c.jsx("path",{d:"M21.81 10.25c-.06-.05-.67-.51-1.95-.51-.34 0-.68.03-1.01.09-.25-1.69-1.64-2.51-1.7-2.55l-.34-.2-.22.32a4.5 4.5 0 0 0-.59 1.4c-.23.94-.09 1.83.39 2.59-.58.32-1.51.4-1.7.41H2.62a.61.61 0 0 0-.61.61 9.32 9.32 0 0 0 .57 3.35 4.9 4.9 0 0 0 1.95 2.53c.92.52 2.42.82 4.12.82.77 0 1.54-.07 2.3-.21a9.6 9.6 0 0 0 3-1.09 8.3 8.3 0 0 0 2.05-1.68c.98-1.11 1.56-2.35 1.99-3.45h.17c1.36 0 2.2-.55 2.66-1l.13-.16zM4.7 11.33h1.78a.16.16 0 0 0 .16-.16V9.58a.16.16 0 0 0-.16-.16H4.7a.16.16 0 0 0-.16.16v1.59c0 .09.07.16.16.16m2.46 0h1.78a.16.16 0 0 0 .16-.16V9.58a.16.16 0 0 0-.16-.16H7.16a.16.16 0 0 0-.16.16v1.59c0 .09.07.16.16.16m2.5 0h1.78a.16.16 0 0 0 .16-.16V9.58a.16.16 0 0 0-.16-.16H9.66a.16.16 0 0 0-.16.16v1.59c0 .09.07.16.16.16m2.47 0h1.78a.16.16 0 0 0 .16-.16V9.58a.16.16 0 0 0-.16-.16h-1.78a.16.16 0 0 0-.16.16v1.59c0 .09.07.16.16.16M7.16 9.06h1.78a.16.16 0 0 0 .16-.16V7.31a.16.16 0 0 0-.16-.16H7.16a.16.16 0 0 0-.16.16v1.59c0 .09.07.16.16.16m2.5 0h1.78a.16.16 0 0 0 .16-.16V7.31a.16.16 0 0 0-.16-.16H9.66a.16.16 0 0 0-.16.16v1.59c0 .09.07.16.16.16m2.47 0h1.78a.16.16 0 0 0 .16-.16V7.31a.16.16 0 0 0-.16-.16h-1.78a.16.16 0 0 0-.16.16v1.59c0 .09.07.16.16.16"})})]}),Ka&&c.jsxs("div",{className:"bcard__menuwrap",onClick:L=>L.stopPropagation(),children:[c.jsx("button",{type:"button",ref:Q,"data-id":"DockerCard-menu-btn",className:"bcard__kebab",title:o("docker.manage","管理 Docker cicy-code"),disabled:Qt,onClick:le,children:Qt?c.jsx($t,{}):c.jsx(sh,{})}),A&&Sa.createPortal(c.jsxs("div",{className:"bcard__menu bcard__menu--portal","data-id":"DockerCard-menu",role:"menu",ref:re,style:{position:"fixed",top:D.top,left:D.left,width:ue},onClick:L=>L.stopPropagation(),children:[c.jsx("button",{type:"button","data-id":"DockerCard-update",className:"bcard__menu-item is-accent",onClick:qe,children:o("docker.update","更新 cicy-code")}),c.jsx("button",{type:"button","data-id":"DockerCard-restart",className:"bcard__menu-item",onClick:()=>Xt("restart",()=>window.cicy.docker.appRestart(),o("docker.restarted","已重启 cicy-code")),children:o("docker.restart","重启 cicy-code")}),c.jsx("button",{type:"button","data-id":"DockerCard-stop",className:"bcard__menu-item is-danger",onClick:()=>Xt("stop",()=>window.cicy.docker.appStop(),o("docker.stopped","已停止 cicy-code")),children:o("docker.stop","停止 cicy-code")}),c.jsx("button",{type:"button","data-id":"DockerCard-reload",className:"bcard__menu-item",onClick:L=>{var C,N,q;L.stopPropagation(),T(!1),(q=(N=(C=window.cicy)==null?void 0:C.tabs)==null?void 0:N.reloadIfOpen)==null||q.call(N,xo(),Al)},children:o("docker.reloadWindow","刷新窗口")}),Lt?c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button","data-id":"DockerCard-vm-terminal",className:"bcard__menu-item",title:o("docker.vmTermHint","本机团队所在的 Debian 虚拟机的命令行(用户 cicy,sudo 免密;sudo docker ps 可看到容器)"),onClick:L=>{L.stopPropagation(),Aa()},children:o("docker.vmTerm","打开终端")}),!(pt&&pt.accel==="whpx")&&c.jsx("button",{type:"button","data-id":"DockerCard-vm-accel",className:"bcard__menu-item",title:o("docker.accelHint","开启 Windows 虚拟机监控程序平台(要管理员 + 重启)"),onClick:L=>{L.stopPropagation(),Nt()},children:o("docker.accel","开启硬件加速")})]}):c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button","data-id":"DockerCard-open-dir",className:"bcard__menu-item",onClick:L=>{var C,N,q;L.stopPropagation(),T(!1),(q=(N=(C=window.cicy)==null?void 0:C.docker)==null?void 0:N.openDir)==null||q.call(N)},children:o("docker.openWslDir","打开 WSL 目录")}),c.jsx("button",{type:"button","data-id":"DockerCard-open-projects",className:"bcard__menu-item",onClick:L=>{var C,N,q;L.stopPropagation(),T(!1),(q=(N=(C=window.cicy)==null?void 0:C.docker)==null?void 0:N.openDir)==null||q.call(N,"projects")},children:o("docker.openProjectsDir","打开项目目录")})]}),c.jsx("button",{type:"button","data-id":"DockerCard-dood",className:"bcard__menu-item",title:o("dood.hint","把宿主 Docker + docker 客户端挂进容器,容器内 agent 能直接跑 docker(切换会重建容器,秒生效、无需下载)"),onClick:L=>{L.stopPropagation(),T(!1),M(!0)},children:o("dood.menu","容器内使用 Docker")}),c.jsx("div",{className:"bcard__menu-sep","data-id":"DockerCard-menu-sep",role:"separator","aria-hidden":!0}),ja==="darwin"&&c.jsx("button",{type:"button","data-id":"DockerCard-authorize-host-ssh",className:"bcard__menu-item",title:o("docker.authorizeHostHint","把容器公钥加到 Mac 的 authorized_keys,容器内 `ssh mac` 即可访问本机"),onClick:Ht,children:o("docker.authorizeHost","授权容器访问 Mac")}),c.jsx("button",{type:"button","data-id":"DockerCard-docker-restart",className:"bcard__menu-item",onClick:()=>Xt("restart",()=>window.cicy.docker.appDockerRestart(),o("docker.dockerRestarted","已重启 Docker 容器")),children:o("docker.dockerRestart","重启 Docker")}),c.jsx("button",{type:"button","data-id":"DockerCard-ports",className:"bcard__menu-item",onClick:L=>{L.stopPropagation(),Z()},children:o("docker.ports.menu","端口设置")}),c.jsx("button",{type:"button","data-id":"DockerCard-recreate",className:"bcard__menu-item is-danger",onClick:L=>{L.stopPropagation(),T(!1),B(!0)},children:o("docker.recreate","重建 Docker")})]}),document.body)]})]}),c.jsxs("div",{className:"bcard__body",children:[c.jsxs("div",{style:{height:28,display:"flex",alignItems:"center",gap:8},children:[c.jsx(Oo,{size:24,avatar:s==null?void 0:s.avatar,name:Te,teamId:s==null?void 0:s.id,onChanged:_}),ie?c.jsx("input",{"data-id":"DockerCard-rename-input",autoFocus:!0,value:se,onChange:L=>Ce(L.target.value),onFocus:L=>L.target.select(),onBlur:Ue,onClick:L=>L.stopPropagation(),onKeyDown:L=>{L.nativeEvent.isComposing||L.keyCode===229||(L.key==="Enter"?Ue():L.key==="Escape"&&$(!1))},style:{flex:1,width:"100%",font:"inherit",fontWeight:600,padding:"2px 6px",border:"1px solid #3b82f6",borderRadius:6,background:"#0d1117",color:"#e6edf3",boxSizing:"border-box"}}):c.jsxs("h3",{className:"bcard__name",title:x?o("localTeams.renameHint","点名字或 ✎ 改名"):Te,style:{display:"flex",alignItems:"center",gap:6,flex:1,minWidth:0,margin:0},onDoubleClick:x?Oe:void 0,children:[c.jsx("span",{onClick:x?Oe:void 0,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:x?"text":"default"},children:Te}),x&&c.jsx("button",{type:"button","data-id":"DockerCard-rename-btn",title:o("localTeams.rename","重命名"),onClick:Oe,style:{flex:"none",cursor:"pointer",border:"none",background:"transparent",color:"#8b949e",fontSize:13,padding:0,lineHeight:1},children:"✎"})]})]}),c.jsxs("div",{className:"bcard__meta",children:[c.jsx("span",{className:"bcard__chip",children:"Docker"}),(b==null?void 0:b.version)&&c.jsxs("span",{className:"bcard__ver","data-id":"DockerCard-ver",style:{marginLeft:8,fontSize:11,opacity:.6},children:["v",b.version]})]})]}),c.jsxs("button",{type:"button",className:"bcard__cta","data-id":"DockerCard-cta",disabled:Qt,onClick:jt,style:qt?void 0:{background:m,color:"white"},children:[Qt?c.jsx($t,{}):c.jsx(Mo,{}),c.jsx("span",{children:ea})]}),c.jsx(bg,{open:V,onClose:()=>M(!1),toastId:"docker-op"}),J&&Sa.createPortal(c.jsx("div",{"data-id":"DockerCard-recreate-modal",style:{position:"fixed",inset:0,zIndex:9999,background:"rgba(0,0,0,0.55)",display:"flex",alignItems:"center",justifyContent:"center"},onMouseDown:L=>{L.target===L.currentTarget&&B(!1)},children:c.jsxs("div",{onClick:L=>L.stopPropagation(),style:{width:360,maxWidth:"90vw",background:"#161b22",border:"1px solid #30363d",borderRadius:12,padding:"20px 22px",boxShadow:"0 12px 40px rgba(0,0,0,0.5)"},children:[c.jsx("h3",{style:{margin:"0 0 8px",fontSize:16,color:"#e6edf3"},children:o("docker.recreate","重建 Docker")}),c.jsx("p",{style:{margin:"0 0 18px",fontSize:13,lineHeight:1.6,color:"#9aa4b2"},children:o("docker.recreateConfirm","会删除当前容器并重新创建(volume 数据保留),用于切换为独立 team 的网关 key。确定重建?")}),c.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:10},children:[c.jsx("button",{type:"button","data-id":"DockerCard-recreate-cancel",onClick:()=>B(!1),style:{padding:"7px 16px",borderRadius:8,border:"1px solid #30363d",background:"transparent",color:"#c9d1d9",cursor:"pointer",fontSize:13},children:o("common.cancel","取消")}),c.jsx("button",{type:"button","data-id":"DockerCard-recreate-confirm",onClick:()=>{B(!1),Xt("restart",()=>window.cicy.docker.appRecreate(),o("docker.recreated","已重建 Docker 容器"))},style:{padding:"7px 16px",borderRadius:8,border:"none",background:"#da3633",color:"white",cursor:"pointer",fontSize:13,fontWeight:600},children:o("docker.recreateOk","确定重建")})]})]})}),document.body),K&&Sa.createPortal(c.jsx("div",{"data-id":"DockerCard-ports-modal",style:{position:"fixed",inset:0,zIndex:9999,background:"rgba(0,0,0,0.55)",display:"flex",alignItems:"center",justifyContent:"center"},onMouseDown:L=>{L.target===L.currentTarget&&ee(!1)},children:c.jsxs("div",{onClick:L=>L.stopPropagation(),style:{width:420,maxWidth:"92vw",background:"#161b22",border:"1px solid #30363d",borderRadius:12,padding:"20px 22px",boxShadow:"0 12px 40px rgba(0,0,0,0.5)"},children:[c.jsx("h3",{style:{margin:"0 0 6px",fontSize:16,color:"#e6edf3"},children:o("docker.ports.title","端口设置")}),c.jsx("p",{style:{margin:"0 0 14px",fontSize:12.5,lineHeight:1.6,color:"#9aa4b2"},children:o("docker.ports.sub","除 :8008 外,额外发布、可从 Windows 直达容器内服务的端口")}),c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"8px 10px",marginBottom:10,borderRadius:8,background:"#0d1117",border:"1px solid #21262d",color:"#7d8590",fontSize:13},children:["🔒 ",o("docker.ports.mainFixed",":{{p}} · cicy-code(固定)",{p:Nl})]}),c.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,maxHeight:220,overflowY:"auto"},children:[_e.length===0&&c.jsx("div",{style:{fontSize:12.5,color:"#6e7681",padding:"4px 2px"},children:o("docker.ports.none","暂无额外端口")}),_e.map((L,C)=>c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[c.jsx("input",{"data-id":`DockerCard-port-input-${C}`,type:"text",inputMode:"numeric",value:L,placeholder:o("docker.ports.ph","端口号 1-65535"),onChange:N=>{const q=N.target.value.replace(/[^0-9]/g,"");me(W=>W.map((te,$e)=>$e===C?q:te)),X("")},style:{flex:1,padding:"7px 10px",borderRadius:8,border:"1px solid #30363d",background:"#0d1117",color:"#e6edf3",fontSize:13,fontFamily:"var(--mono)"}}),c.jsx("button",{type:"button","data-id":`DockerCard-port-remove-${C}`,title:o("docker.ports.remove","移除"),onClick:()=>{me(N=>N.filter((q,W)=>W!==C)),X("")},style:{padding:"6px 10px",borderRadius:8,border:"1px solid #30363d",background:"transparent",color:"#da3633",cursor:"pointer",fontSize:14},children:"✕"})]},C))]}),c.jsx("button",{type:"button","data-id":"DockerCard-port-add",onClick:()=>me(L=>[...L,""]),style:{marginTop:10,padding:"7px 12px",borderRadius:8,border:"1px dashed #30363d",background:"transparent",color:"#58a6ff",cursor:"pointer",fontSize:13,width:"100%"},children:o("docker.ports.add","+ 添加端口")}),ye&&c.jsx("div",{style:{marginTop:10,fontSize:12.5,color:"#f85149"},children:ye}),c.jsx("p",{style:{margin:"12px 0 16px",fontSize:11.5,lineHeight:1.5,color:"#6e7681"},children:o("docker.ports.hint","保存会重建容器(volume 数据保留),会有短暂中断")}),c.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:10},children:[c.jsx("button",{type:"button","data-id":"DockerCard-ports-cancel",disabled:ce,onClick:()=>ee(!1),style:{padding:"7px 16px",borderRadius:8,border:"1px solid #30363d",background:"transparent",color:"#c9d1d9",cursor:"pointer",fontSize:13},children:o("docker.ports.cancel","取消")}),c.jsx("button",{type:"button","data-id":"DockerCard-ports-save",disabled:ce,onClick:F,style:{padding:"7px 16px",borderRadius:8,border:"none",background:"#238636",color:"white",cursor:"pointer",fontSize:13,fontWeight:600},children:ce?o("docker.ports.saving","保存中…"):o("docker.ports.save","保存并重建")})]})]})}),document.body)]})}function Qm({team:s,cloudCode:f,onOpen:y,onRename:d,onRefresh:x}){var jt,Ka,St,L;const b=(Vm[s.status]||Vm.error).tone,[U,j]=v.useState(!1),[h,A]=v.useState(s.name||""),[T,V]=v.useState(null),[M,J]=v.useState(""),B=T??s.name;v.useEffect(()=>{T!=null&&s.name===T&&V(null)},[s.name,T]);const K=C=>{var N;(N=C==null?void 0:C.stopPropagation)==null||N.call(C),A(B||""),j(!0)},ee=async()=>{j(!1);const C=String(h||"").trim();if(!d||!C||C===B)return;V(C),J("saving");let N;try{N=await d(s.id,C)}catch(q){N={ok:!1,error:q==null?void 0:q.message}}V(null),N&&N.ok?(J("saved"),setTimeout(()=>J(q=>q==="saved"?"":q),1500)):(J(""),we.show({message:o("localTeams.renameFailed","改名没保存,已恢复"),status:"error",ttl:4e3}))},me=!!((Ka=(jt=window.cicy)==null?void 0:jt.sidecar)!=null&&Ka.restart)&&ko(s.base_url),ce=s.status==="running",[oe,ye]=v.useState(""),[X,ie]=v.useState(!1),[$,se]=v.useState(!1);v.useEffect(()=>{var C,N;!me||!((N=(C=window.cicy)==null?void 0:C.sidecar)!=null&&N.getPublic)||window.cicy.sidecar.getPublic().then(q=>se(!!(q!=null&&q.public))).catch(()=>{})},[me]);const[Ce,Te]=v.useState({running:void 0,latest:null,installed:null}),Ae=Ce.latest,Oe=Ce.running,[Ue,D]=v.useState(!1),I=v.useRef(null),Q=v.useRef(null),re=v.useRef(null),[ue,m]=v.useState({top:0,left:0}),S=184,Z=()=>{if(!X&&Q.current){const C=Q.current.getBoundingClientRect(),N=Math.max(8,Math.min(C.right-S,window.innerWidth-S-8));m({top:Math.round(C.bottom+4),left:Math.round(N)})}ie(C=>!C)},F=v.useCallback(async(C=!1)=>{var N,q;if(!(!me||!((q=(N=window.cicy)==null?void 0:N.sidecar)!=null&&q.versions))){C&&D(!0);try{const W=await window.cicy.sidecar.versions();Te({running:(W==null?void 0:W.running)??null,latest:(W==null?void 0:W.latest)??null,installed:(W==null?void 0:W.installed)??null}),C&&(W!=null&&W.running&&(W!=null&&W.latest)&&Ao(W.latest,W.running)>0?we.show({message:`${o("sidecar.found","发现新版本")} v${W.latest}`,status:"done",ttl:2500}):W!=null&&W.running?we.show({message:`${o("sidecar.upToDate","已是最新")} v${W.running}`,status:"done",ttl:2500}):we.show({message:o("sidecar.notRunning","cicy-code 未运行"),status:"error",ttl:4e3}))}catch{C&&we.show({message:o("sidecar.checkFailed","检查更新失败"),status:"error",ttl:5e3})}finally{C&&D(!1)}}},[me]);v.useEffect(()=>{F(!1)},[F]),v.useEffect(()=>{ce&&F(!1)},[ce,F]);const le=!!(me&&Ae&&Oe&&Ao(Ae,Oe)>0),ge=!me&&!!((L=(St=window.cicy)==null?void 0:St.localTeams)!=null&&L.remove),Se=me||ge,[et,qe]=v.useState(!1),[Lt,pt]=v.useState(!1),[oa,Aa]=v.useState(""),[Nt,Xt]=v.useState(""),[Ht,ja]=v.useState(!1),[qt,ut]=v.useState("");v.useEffect(()=>{if(!X)return;const C=N=>{var q,W;(q=Q.current)!=null&&q.contains(N.target)||(W=re.current)!=null&&W.contains(N.target)||ie(!1)};return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[X]);const Yt=async()=>{var N,q,W;if(Ht)return;const C=Ny({title:oa,url:Nt});if(!C.ok){ut(o("teams.titleRequired","请输入自定义标题"));return}if(!C.patch.base_url){ut(o("teams.urlRequired","请输入地址 URL"));return}try{new URL(C.patch.base_url)}catch{ut(o("teams.badUrl","URL 无效(需含 http(s)://)"));return}if(C.patch.name===(s.name||"")&&C.patch.base_url===(s.base_url||"")){pt(!1);return}ut(""),ja(!0);try{const te=await((W=(q=(N=window.cicy)==null?void 0:N.localTeams)==null?void 0:q.update)==null?void 0:W.call(q,s.id,C.patch));te!=null&&te.ok?(pt(!1),x==null||x()):ut(Ni((te==null?void 0:te.error)||"update failed"))}catch(te){ut(Ni((te==null?void 0:te.message)||String(te)))}ja(!1)},Pt=async()=>{var N,q,W;if(oe)return;qe(!1),ye("remove");const C="op-"+Date.now();we.show({id:C,message:o("localTeams.removing","删除中…"),status:"running"});try{const te=await((W=(q=(N=window.cicy)==null?void 0:N.localTeams)==null?void 0:q.remove)==null?void 0:W.call(q,s.id));te!=null&&te.ok?we.show({id:C,message:o("localTeams.removed","已删除"),status:"done",ttl:3e3}):we.show({id:C,message:o("localTeams.removeFailed","删除失败")+(te!=null&&te.error?": "+te.error:""),status:"error",ttl:7e3})}catch(te){we.show({id:C,message:o("localTeams.removeFailed","删除失败")+": "+((te==null?void 0:te.message)||te),status:"error",ttl:7e3})}ye(""),x==null||x()},ot=`sidecar-op:${s.id}`,yt=async(C,N,q)=>{var $e,ae,Et,gt,st;if(ie(!1),oe)return;ye(C);const W=C==="update";let te=null;W?(ct.open({teamId:s.id,fromVer:Oe,toVer:Ae,onRetry:()=>yt("update",N,q)}),(ae=($e=window.cicy)==null?void 0:$e.sidecar)!=null&&ae.onOpProgress&&(te=window.cicy.sidecar.onOpProgress(Me=>{(Me==null?void 0:Me.op)==="update"&&ct.push(Me)}))):we.show({id:ot,message:rt[C]||`${C}…`,status:"running",progress:void 0});try{const Me=await N(),be=!!(Me!=null&&Me.ok),Ee=Me!=null&&Me.warning?`${q}(${Me.warning})`:q,ft=o("sidecar.failed","操作失败")+(Me!=null&&Me.error?`: ${Me.error}`:"");if(W){if(ct.finish({ok:be,message:be?Ee:ft}),be)try{await((st=(gt=(Et=window.cicy)==null?void 0:Et.localTeams)==null?void 0:gt.reload)==null?void 0:st.call(gt,s.id,{ignoreCache:!0}))}catch{}}else we.show({id:ot,message:be?Ee:ft,progress:void 0,status:be?"done":"error",ttl:be?4e3:8e3})}catch(Me){const be=o("sidecar.failed","操作失败")+`: ${(Me==null?void 0:Me.message)||Me}`;W?ct.finish({ok:!1,message:be}):we.show({id:ot,message:be,progress:void 0,status:"error",ttl:8e3})}finally{try{te&&te()}catch{}ye(""),x==null||x(),(C==="update"||C==="restart"||C==="start")&&F(!1)}},rt={start:o("busy.start","启动中…"),restart:o("busy.restart","重启中…"),update:o("busy.update","更新中…"),stop:o("busy.stop","停止中…")},dt=async()=>{var q,W,te;ye("start"),ct.open({teamId:s.id,title:o("sidecar.startTitle","启动 cicy-code"),onRetry:dt}),ct.push({phase:"download",status:"running",message:o("sidecar.starting","启动 cicy-code(首次需安装 Node + 依赖,日志见下)…")});const C=(te=(W=(q=window.cicy)==null?void 0:q.sidecar)==null?void 0:W.onOpProgress)==null?void 0:te.call(W,$e=>ct.push($e));let N;try{N=await window.cicy.sidecar.start()}catch($e){N={ok:!1,error:($e==null?void 0:$e.message)||String($e)}}try{C==null||C()}catch{}return ye(""),x==null||x(),!(N!=null&&N.ok)||N!=null&&N.warning?(ct.finish({ok:!1,message:o("sidecar.startFailed","启动失败")+(N!=null&&N.error?`: ${N.error}`:N!=null&&N.warning?`: ${N.warning}`:"")}),!1):(ct.finish({ok:!0,message:o("sidecar.startedOk","cicy-code 已就绪")}),!0)},Qt=async()=>{var C,N;oe||!ce&&me&&((N=(C=window.cicy)==null?void 0:C.sidecar)!=null&&N.start)&&!await dt()||y()},ea=ce?o("localTeams.open","打开"):me?o("localTeams.startOpen","启动并打开"):o("localTeams.open","打开");return c.jsxs(c.Fragment,{children:[c.jsxs("div",{"data-id":"LocalTeamCard",className:`bcard ${me?"bcard--local":"bcard--custom"}${b==="ok"?" bcard--online":""}`,children:[c.jsx("div",{className:"bcard__accent"}),c.jsxs("div",{className:"bcard__top",children:[c.jsxs("div",{className:"bcard__pill",children:[c.jsx("span",{className:"bcard__dot","data-tone":b}),c.jsx(ch,{})]}),Se&&c.jsxs("div",{className:"bcard__menuwrap",ref:I,onClick:C=>C.stopPropagation(),children:[c.jsx("button",{type:"button",ref:Q,"data-id":"LocalTeamCard-menu-btn",className:`bcard__kebab${le?" has-dot":""}`,title:me?o("localTeams.manage","管理本地 cicy-code"):o("localTeams.more","更多"),disabled:!!oe,onClick:Z,children:oe?c.jsx($t,{}):c.jsx(sh,{})}),X&&Sa.createPortal(c.jsxs("div",{className:"bcard__menu bcard__menu--portal","data-id":"LocalTeamCard-menu",role:"menu",ref:re,style:{position:"fixed",top:ue.top,left:ue.left,width:S},onClick:C=>C.stopPropagation(),children:[me&&c.jsx("button",{type:"button","data-id":"LocalTeamCard-check-update",className:"bcard__menu-item",disabled:Ue,onClick:C=>{C.stopPropagation(),F(!0)},children:Ue?o("sidecar.checking2","检查中…"):o("sidecar.checkUpdate","检查更新")}),le&&c.jsxs("button",{type:"button","data-id":"LocalTeamCard-update",className:"bcard__menu-item is-accent",onClick:()=>yt("update",()=>window.cicy.sidecar.update(),o("sidecar.updated","已更新到最新")),children:[o("sidecar.updateTo","更新到")," v",Ae]}),s.base_url&&c.jsx("button",{type:"button","data-id":"LocalTeamCard-reload",className:"bcard__menu-item",onClick:C=>{var N,q,W;C.stopPropagation(),ie(!1),(W=(q=(N=window.cicy)==null?void 0:N.tabs)==null?void 0:q.reloadIfOpen)==null||W.call(q,s.base_url,s.name)},children:o("localTeams.reloadWindow","刷新窗口")}),me&&!ce&&c.jsx("button",{type:"button","data-id":"LocalTeamCard-start",className:"bcard__menu-item is-accent",onClick:()=>yt("start",()=>window.cicy.sidecar.start(),o("sidecar.started","已启动")),children:o("sidecar.start","启动")}),me&&ce&&c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button","data-id":"LocalTeamCard-restart",className:"bcard__menu-item",onClick:()=>yt("restart",()=>window.cicy.sidecar.restart(),o("sidecar.restarted","已重启")),children:o("sidecar.restart","重启")}),c.jsx("button",{type:"button","data-id":"LocalTeamCard-stop",className:"bcard__menu-item is-danger",onClick:()=>yt("stop",()=>window.cicy.sidecar.stop(),o("sidecar.stoppedDone","已停止")),children:o("sidecar.stop","停止")}),c.jsxs("button",{type:"button","data-id":"LocalTeamCard-lan",className:"bcard__menu-item",title:o("sidecar.lanHint","开启后同局域网设备可用本机 IP 访问(api_token 仍校验);切换会自动重启 cicy-code"),disabled:oe==="lan",onClick:async()=>{if(oe)return;const C=!$;ie(!1),ye("lan"),se(C),we.show({id:ot,message:C?o("sidecar.lanEnabling","开启局域网访问,重启中…"):o("sidecar.lanDisabling","关闭局域网访问,重启中…"),status:"running",progress:void 0});try{const N=await window.cicy.sidecar.setPublic(C);N!=null&&N.ok?we.show({id:ot,message:C?o("sidecar.lanOn","已开启局域网访问"):o("sidecar.lanOff","已关闭局域网访问"),status:"done",ttl:3e3}):we.show({id:ot,message:o("sidecar.lanFailed","设置失败")+(N!=null&&N.error?`: ${N.error}`:""),status:"error",ttl:7e3})}catch(N){we.show({id:ot,message:o("sidecar.lanFailed","设置失败")+`: ${(N==null?void 0:N.message)||N}`,status:"error",ttl:7e3})}try{const N=await window.cicy.sidecar.getPublic();se(!!(N!=null&&N.public))}catch{}ye(""),x==null||x()},children:[o("sidecar.lanAccess","局域网访问")," · ",$?o("common.on","开"):o("common.off","关")]})]}),ge&&c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button","data-id":"LocalTeamCard-edit-url",className:"bcard__menu-item",onClick:C=>{C.stopPropagation(),ie(!1),pt(!0),Aa(s.name||""),Xt(s.base_url||""),ut("")},children:o("teamCard.editUrl","更改访问地址")}),c.jsx("button",{type:"button","data-id":"LocalTeamCard-remove",className:"bcard__menu-item is-danger",onClick:()=>{ie(!1),qe(!0)},children:o("localTeams.remove","删除")})]}),(Oe||s.version)&&c.jsxs("div",{"data-id":"LocalTeamCard-version",className:"bcard__menu-item",style:{cursor:"default",color:"#8b949e",fontSize:12},children:[o("localTeams.version","版本")," v",Oe||s.version]})]}),document.body)]})]}),c.jsxs("div",{className:"bcard__body",children:[c.jsxs("div",{style:{height:28,display:"flex",alignItems:"center",gap:8},children:[c.jsx(Oo,{size:24,avatar:s==null?void 0:s.avatar,name:s==null?void 0:s.name,teamId:s==null?void 0:s.id,onChanged:x}),U?c.jsx("input",{"data-id":"LocalTeamCard-rename-input",autoFocus:!0,value:h,onChange:C=>A(C.target.value),onFocus:C=>C.target.select(),onBlur:ee,onClick:C=>C.stopPropagation(),onKeyDown:C=>{C.nativeEvent.isComposing||C.keyCode===229||(C.key==="Enter"?ee():C.key==="Escape"&&j(!1))},style:{flex:1,width:"100%",font:"inherit",fontWeight:600,padding:"2px 6px",border:"1px solid #3b82f6",borderRadius:6,background:"#0d1117",color:"#e6edf3",boxSizing:"border-box"}}):c.jsxs("h3",{className:"bcard__name",title:o("localTeams.renameHint","点名字或 ✎ 改名"),style:{display:"flex",alignItems:"center",gap:6,flex:1,minWidth:0,margin:0},onDoubleClick:K,children:[c.jsx("span",{"data-id":"LocalTeamCard-name-text",onClick:K,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:"text"},children:B}),M==="saving"&&c.jsx("span",{"data-id":"LocalTeamCard-save-state",title:o("localTeams.saving","保存中…"),style:{flex:"none",display:"inline-flex"},children:c.jsx($t,{})}),M==="saved"&&c.jsx("span",{"data-id":"LocalTeamCard-save-state",title:o("localTeams.saved","已保存"),style:{flex:"none",color:"#3fb950",fontSize:13,lineHeight:1},children:"✓"}),!M&&c.jsx("button",{type:"button","data-id":"LocalTeamCard-rename-btn",title:o("localTeams.rename","重命名"),onClick:K,style:{flex:"none",cursor:"pointer",border:"none",background:"transparent",color:"#8b949e",fontSize:13,padding:0,lineHeight:1},children:"✎"})]})]}),c.jsx("div",{className:"bcard__meta",children:c.jsx("span",{className:"bcard__chip","data-id":"LocalTeamCard-kind",children:me?o("localTeams.kindLocal","本地"):o("localTeams.kindCustom","自定义")})})]}),c.jsxs("button",{type:"button",className:"bcard__cta","data-id":"LocalTeamCard-open",disabled:!!oe||!s.base_url,onClick:Qt,children:[oe&&oe!=="stop"?c.jsx($t,{}):c.jsx(Mo,{}),c.jsx("span",{children:oe&&rt[oe]||ea})]})]}),Lt&&Sa.createPortal(c.jsx("div",{"data-id":"LocalTeamCard-url-modal",style:{position:"fixed",inset:0,zIndex:65,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0,.5)"},onMouseDown:C=>{!Ht&&C.target===C.currentTarget&&pt(!1)},children:c.jsxs("div",{onClick:C=>C.stopPropagation(),style:{width:400,maxWidth:"92vw",background:"var(--card, #1b1d22)",border:"1px solid var(--border, #2c2f36)",borderRadius:14,padding:22,boxShadow:"0 20px 60px rgba(0,0,0,.5)"},children:[c.jsx("div",{style:{fontSize:16,fontWeight:700,marginBottom:16},children:o("teamCard.editCustom","编辑自定义团队")}),c.jsx("label",{style:{display:"block",fontSize:12,opacity:.75,marginBottom:6},children:o("teams.customNameLabel","自定义标题")}),c.jsx("input",{"data-id":"LocalTeamCard-title-input",autoFocus:!0,className:"login-email-input",style:{width:"100%",marginBottom:14},value:oa,placeholder:o("teams.customNamePlaceholder","我的团队"),spellCheck:!1,disabled:Ht,onChange:C=>Aa(C.target.value),onKeyDown:C=>{C.nativeEvent.isComposing||C.keyCode===229||(C.key==="Enter"?(C.preventDefault(),Yt()):C.key==="Escape"&&pt(!1))}}),c.jsx("label",{style:{display:"block",fontSize:12,opacity:.75,marginBottom:6},children:o("teams.customUrlLabel","地址 URL")}),c.jsx("textarea",{"data-id":"LocalTeamCard-url-input",rows:3,className:"login-email-input",style:{width:"100%",resize:"vertical",lineHeight:1.5,fontFamily:"var(--mono)"},value:Nt,placeholder:"https://example.com:8008",spellCheck:!1,disabled:Ht,onChange:C=>Xt(C.target.value.replace(/[\r\n]+/g,"")),onKeyDown:C=>{C.nativeEvent.isComposing||C.keyCode===229||(C.key==="Enter"?(C.preventDefault(),Yt()):C.key==="Escape"&&pt(!1))}}),qt&&c.jsx("div",{className:"error",style:{marginTop:8,fontSize:12},children:qt}),c.jsxs("div",{className:"modal-actions",children:[c.jsx("button",{type:"button",className:"btn-ghost",disabled:Ht,onClick:()=>pt(!1),children:o("common.cancel","取消")}),c.jsx("button",{type:"button",className:"btn-primary","data-id":"LocalTeamCard-url-save",disabled:Ht,onClick:Yt,children:Ht?o("common.saving","保存中…"):o("common.save","保存")})]})]})}),document.body),c.jsx(mg,{open:et,title:o("localTeams.deleteTitle","删除团队"),message:o("localTeams.deleteMsg","确定删除「{{name}}」?此操作不可撤销。",{name:s.name}),confirmLabel:o("common.delete","删除"),danger:!0,onConfirm:Pt,onCancel:()=>qe(!1)})]})}function ko(s){var f;try{if(((f=window.cicy)==null?void 0:f.platform)==="win32")return!1;const y=new URL(s);return(y.hostname==="127.0.0.1"||y.hostname==="localhost"||y.hostname==="::1")&&(y.port==="8008"||y.port==="")}catch{return!1}}let Nl=8008;const xo=()=>`http://127.0.0.1:${Nl}`;function Zm(s){var f;try{if(((f=window.cicy)==null?void 0:f.platform)!=="win32")return!1;const y=new URL(s);return(y.hostname==="127.0.0.1"||y.hostname==="localhost"||y.hostname==="::1")&&(y.port==="8008"||y.port==="8009")}catch{return!1}}function Ao(s,f){const y=String(s).split("."),d=String(f).split(".");for(let x=0;x<Math.max(y.length,d.length);x++){const _=(parseInt(y[x],10)||0)-(parseInt(d[x],10)||0);if(_)return _>0?1:-1}return 0}const Vm={running:{tone:"ok",label:"running",cta:o("localStatus.open","打开")},stopped:{tone:"off",label:"stopped",cta:o("localStatus.notRunning","未运行")},auth_error:{tone:"warn",label:"auth error",cta:o("localStatus.tokenInvalid","Token 失效")},misconfigured:{tone:"err",label:"bad config",cta:o("localStatus.badUrl","URL 错误")},error:{tone:"err",label:"error",cta:o("localStatus.error","异常")}};function mg({open:s,title:f,message:y,confirmLabel:d,danger:x,onConfirm:_,onCancel:b}){return s?Sa.createPortal(c.jsx("div",{"data-id":"ConfirmModal",style:{position:"fixed",inset:0,zIndex:70,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0,.5)"},onMouseDown:U=>{U.target===U.currentTarget&&(b==null||b())},children:c.jsxs("div",{onClick:U=>U.stopPropagation(),style:{width:360,maxWidth:"92vw",background:"var(--card, #1b1d22)",border:"1px solid var(--border, #2c2f36)",borderRadius:14,padding:22,boxShadow:"0 20px 60px rgba(0,0,0,.5)"},children:[c.jsx("div",{style:{fontSize:16,fontWeight:700,marginBottom:6},children:f}),y&&c.jsx("div",{style:{fontSize:13,opacity:.7,marginBottom:16},children:y}),c.jsxs("div",{className:"modal-actions",children:[c.jsx("button",{type:"button",className:"btn-ghost",onClick:b,children:o("common.cancel","取消")}),c.jsx("button",{type:"button",className:"btn-primary","data-id":"ConfirmModal-ok",style:x?{background:"#dc2626",borderColor:"#dc2626"}:{},onClick:_,children:d||o("common.confirm","确认")})]})]})}),document.body):null}function Jm(){return c.jsxs("div",{className:"brand",children:[c.jsx("div",{className:"brand-mark",children:c.jsx(vg,{})}),c.jsxs("div",{className:"brand-text",children:[c.jsx("div",{className:"brand-name",children:"CiCy Desktop"}),c.jsx("div",{className:"brand-sub",children:o("app.brandSub","团队 AI 协作工作台")})]})]})}function hg(){const[s,f]=v.useState(null),[y,d]=v.useState(!1),[x,_]=v.useState(!1),b=v.useRef(!1),U=A=>{var T,V,M;_(A),(M=(V=(T=window.cicy)==null?void 0:T.app)==null?void 0:V.setAutoUpdate)==null||M.call(V,A).catch(()=>{})};v.useEffect(()=>{var V,M,J,B,K,ee,_e,me,ce;let A=!0;(J=(M=(V=window.cicy)==null?void 0:V.app)==null?void 0:M.updateState)==null||J.call(M).then(oe=>{A&&f(oe)}).catch(()=>{}),(ee=(K=(B=window.cicy)==null?void 0:B.app)==null?void 0:K.getAutoUpdate)==null||ee.call(K).then(oe=>{A&&_(oe===!0)}).catch(()=>{});const T=(ce=(me=(_e=window.cicy)==null?void 0:_e.app)==null?void 0:me.onUpdateState)==null?void 0:ce.call(me,oe=>{f(oe),typeof(oe==null?void 0:oe.autoUpdate)=="boolean"&&_(oe.autoUpdate),oe!=null&&oe.auto&&!b.current&&(oe.status==="downloading"||oe.status==="ready")&&(b.current=!0,d(!0),ct.open({kind:"app",title:o("updateBanner.drawerTitle","应用更新"),fromVer:oe.current,toVer:oe.version,onRetry:()=>{var ye,X,ie;return(ie=(X=(ye=window.cicy)==null?void 0:ye.app)==null?void 0:X.downloadUpdate)==null?void 0:ie.call(X)}}),ct.push({phase:"download",status:"running",message:o("updateBanner.autoDl","已开启自动更新,正在下载安装包…")})),b.current&&(oe.status==="downloading"?ct.setProgress(oe.progress||{}):oe.status==="ready"?ct.ready({onInstall:()=>{var ye,X,ie;return(ie=(X=(ye=window.cicy)==null?void 0:ye.app)==null?void 0:X.installUpdate)==null?void 0:ie.call(X)}}):oe.status==="error"&&(ct.finish({ok:!1,message:oe.error||o("updateBanner.error","更新失败")}),b.current=!1))});return()=>{A=!1;try{T&&T()}catch{}}},[]);const j=s==null?void 0:s.status;v.useEffect(()=>{d(!1)},[j]);const h=()=>{var A,T,V;b.current=!0,d(!0),ct.open({kind:"app",title:o("updateBanner.drawerTitle","应用更新"),fromVer:s==null?void 0:s.current,toVer:s==null?void 0:s.version,onRetry:h}),ct.push({phase:"download",status:"running",message:o("updateBanner.startDl","开始下载安装包…")}),ct.setProgress({percent:0}),(V=(T=(A=window.cicy)==null?void 0:A.app)==null?void 0:T.downloadUpdate)==null||V.call(T)};return j!=="available"||y?null:Sa.createPortal(c.jsx("div",{"data-id":"UpdateBanner",style:{position:"fixed",inset:0,zIndex:1e4,background:"rgba(0,0,0,0.6)",backdropFilter:"blur(3px)",display:"flex",alignItems:"center",justifyContent:"center"},onMouseDown:A=>{A.target===A.currentTarget&&d(!0)},children:c.jsxs("div",{onClick:A=>A.stopPropagation(),style:{width:380,maxWidth:"90vw",background:"#161b22",border:"1px solid #30363d",borderRadius:14,padding:"24px 24px 20px",boxShadow:"0 20px 60px rgba(0,0,0,0.55)",textAlign:"center"},children:[c.jsx("div",{style:{fontSize:34,lineHeight:1,marginBottom:12},"aria-hidden":!0,children:"🚀"}),c.jsx("h3",{style:{margin:"0 0 8px",fontSize:17,color:"#e6edf3"},"data-id":"UpdateBanner-text",children:o("updateBanner.available","发现新版本 v{{v}}",{v:s.version})}),c.jsx("p",{style:{margin:"0 0 14px",fontSize:13,lineHeight:1.6,color:"#9aa4b2"},children:o("updateBanner.modalSub","建议尽快更新到最新版本")}),c.jsxs("label",{"data-id":"UpdateBanner-auto",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:7,margin:"0 0 18px",fontSize:12.5,color:"#c9d1d9",cursor:"pointer",userSelect:"none"},children:[c.jsx("input",{type:"checkbox",checked:x,onChange:A=>U(A.target.checked),style:{accentColor:"#238636",width:15,height:15,margin:0,cursor:"pointer"}}),o("updateBanner.autoNext","以后发现新版本自动更新,不再询问")]}),c.jsxs("div",{style:{display:"flex",gap:10,justifyContent:"center"},children:[c.jsx("button",{type:"button","data-id":"UpdateBanner-later",onClick:()=>d(!0),style:{flex:1,padding:"9px 16px",borderRadius:9,border:"1px solid #30363d",background:"transparent",color:"#c9d1d9",cursor:"pointer",fontSize:14},children:o("updateBanner.later","稍后")}),c.jsx("button",{type:"button","data-id":"UpdateBanner-download",onClick:h,style:{flex:1,padding:"9px 16px",borderRadius:9,border:"none",background:"#238636",color:"white",cursor:"pointer",fontSize:14,fontWeight:600},children:o("updateBanner.updateNow","立即更新")})]})]})}),document.body)}function pg(){return c.jsxs("div",{className:"bcard bcard--skeleton","data-id":"SkeletonCard","aria-hidden":!0,children:[c.jsx("div",{className:"bcard__accent",style:{background:"rgba(255,255,255,.08)",opacity:1}}),c.jsxs("div",{className:"bcard__top",children:[c.jsx("div",{className:"skel",style:{width:84,height:26,borderRadius:999}}),c.jsx("div",{className:"skel",style:{width:22,height:22,borderRadius:6}})]}),c.jsxs("div",{style:{flex:1,minHeight:0,marginTop:14},children:[c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[c.jsx("div",{className:"skel",style:{width:24,height:24,borderRadius:6,flex:"0 0 auto"}}),c.jsx("div",{className:"skel skel--line",style:{width:"55%"}})]}),c.jsx("div",{className:"skel",style:{width:60,height:18,borderRadius:6,marginTop:12}})]}),c.jsx("div",{className:"skel skel--cta",style:{marginTop:0}})]})}const Km=["hsl(2 68% 48%)","hsl(26 72% 46%)","hsl(45 70% 42%)","hsl(96 55% 38%)","hsl(140 58% 40%)","hsl(168 62% 36%)","hsl(192 70% 42%)","hsl(210 72% 50%)","hsl(232 62% 56%)","hsl(266 55% 55%)","hsl(292 58% 50%)","hsl(324 66% 50%)"];function yg(s){s=String(s??"");let f=0;for(let y=0;y<s.length;y++)f=(f*31+s.charCodeAt(y))%100003;return f}function gg(s){return Km[yg(s)%Km.length]}function bg({open:s,onClose:f,toastId:y="dood-op"}){const[d,x]=v.useState(!1),[_,b]=v.useState(""),[U,j]=v.useState(!1),[h,A]=v.useState("");v.useEffect(()=>{var M,J;!s||!((J=(M=window.cicy)==null?void 0:M.sidecar)!=null&&J.getDood)||(b(""),A(""),window.cicy.sidecar.getDood().then(B=>j(!!(B!=null&&B.dood))).catch(()=>{}))},[s]),v.useEffect(()=>{var M,J;if(!(!s||!d||!((J=(M=window.cicy)==null?void 0:M.sidecar)!=null&&J.onOpProgress)))return window.cicy.sidecar.onOpProgress(B=>{B!=null&&B.message&&A(String(B.message))})},[s,d]);const T=async()=>{if(!d){x(!0),b(""),A(""),we.show({id:y,message:U?o("dood.applying","开启容器 Docker 访问,重建容器中…"):o("dood.disabling","关闭中…"),status:"running",progress:void 0});try{const M=await window.cicy.sidecar.setDood(U);M!=null&&M.ok?(f&&f(),we.show({id:y,message:U?o("dood.onDone","容器 Docker 访问已开启"):o("dood.offDone","容器 Docker 访问已关闭"),status:"done",ttl:4e3})):(b((M==null?void 0:M.error)||o("dood.failed","设置失败")),we.show({id:y,message:o("dood.failed","设置失败")+(M!=null&&M.error?`: ${M.error}`:""),status:"error",ttl:6e3}))}catch(M){b((M==null?void 0:M.message)||String(M)),we.show({id:y,message:o("dood.failed","设置失败")+`: ${(M==null?void 0:M.message)||M}`,status:"error",ttl:6e3})}finally{x(!1)}}},V=M=>{f&&f()};return s?c.jsx(c.Fragment,{children:Sa.createPortal(c.jsx("div",{"data-id":"dood-modal",style:{position:"fixed",inset:0,zIndex:66,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0,.5)"},onMouseDown:M=>{!d&&M.target===M.currentTarget&&V()},children:c.jsxs("div",{onClick:M=>M.stopPropagation(),style:{width:440,maxWidth:"92vw",background:"var(--card, #1b1d22)",border:"1px solid var(--border, #2c2f36)",borderRadius:14,padding:22,boxShadow:"0 20px 60px rgba(0,0,0,.5)"},children:[c.jsx("div",{style:{fontSize:16,fontWeight:700,marginBottom:4},children:o("dood.title","容器内使用 Docker")}),c.jsx("div",{style:{fontSize:12,opacity:.6,marginBottom:16},children:o("dood.subtitle","把宿主 Docker + docker 客户端挂进容器,容器内 agent 就能直接跑 docker(秒生效,无需下载)")}),c.jsxs("label",{"data-id":"dood-toggle-row",style:{display:"flex",alignItems:"center",gap:10,cursor:d?"default":"pointer",marginBottom:12},children:[c.jsx("input",{type:"checkbox","data-id":"dood-toggle",checked:U,disabled:d,onChange:M=>j(M.target.checked)}),c.jsx("span",{style:{fontSize:14,fontWeight:600},children:o("dood.enable","允许容器内使用 Docker")})]}),d&&h&&c.jsx("div",{"data-id":"dood-progress",style:{fontSize:11,opacity:.7,fontFamily:"var(--mono)",wordBreak:"break-all",margin:"0 0 8px",maxHeight:60,overflow:"hidden"},children:h}),_&&c.jsx("div",{className:"error",style:{marginTop:8,fontSize:12},children:_}),c.jsxs("div",{className:"modal-actions",children:[c.jsx("button",{type:"button",className:"btn-ghost",disabled:d,onClick:()=>V(),children:o("common.cancel","取消")}),c.jsx("button",{type:"button",className:"btn-primary","data-id":"dood-save",disabled:d,onClick:T,children:d?o("common.saving","保存中…"):o("common.save","保存")})]})]})}),document.body)}):null}function Oo({avatar:s,name:f,teamId:y,onChanged:d,size:x=34}){const _=v.useRef(null),b=((f||"?").trim()[0]||"?").toUpperCase(),U=gg(y||f||""),j=h=>{const A=h.target.files&&h.target.files[0];if(h.target.value="",!A)return;const T=new FileReader;T.onload=async()=>{var V,M,J;try{await((J=(M=(V=window.cicy)==null?void 0:V.localTeams)==null?void 0:M.setAvatar)==null?void 0:J.call(M,y,T.result)),d&&d()}catch{}},T.readAsDataURL(A)};return c.jsxs("div",{"data-id":"TeamAvatar",className:"team-avatar",title:y?o("teamCard.changeAvatar","点击更换头像"):"",onClick:y?h=>{h.stopPropagation(),_.current&&_.current.click()}:void 0,style:{width:x,height:x,borderRadius:9,flex:"none",overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center",cursor:y?"pointer":"default",background:s?"#0d1117":U,color:"#fff",fontWeight:700,fontSize:Math.round(x*.42),userSelect:"none"},children:[s?c.jsx("img",{src:s,alt:"",style:{width:"100%",height:"100%",objectFit:"cover"}}):b,y&&c.jsx("input",{ref:_,type:"file",accept:"image/*",style:{display:"none"},onChange:j})]})}function vg(){return c.jsxs("svg",{width:"22",height:"22",viewBox:"0 0 96 96",fill:"none",children:[c.jsx("path",{d:"M48 11L39.5 33.3L16 29.5L31 48L16 66.5L39.5 62.7L48 85L56.5 62.7L80 66.5L65 48L80 29.5L56.5 33.3Z",stroke:"white",strokeWidth:"10",strokeLinejoin:"round",strokeLinecap:"round"}),c.jsx("circle",{cx:"48",cy:"48",r:"6",fill:"white"})]})}function Mo(){return c.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[c.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),c.jsx("polyline",{points:"12 5 19 12 12 19"})]})}function $t(){return c.jsx("svg",{className:"spin",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",children:c.jsx("path",{d:"M21 12a9 9 0 1 1-6.2-8.55"})})}function ch(){return c.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[c.jsx("rect",{x:"3",y:"4",width:"18",height:"12",rx:"2"}),c.jsx("line",{x1:"2",y1:"20",x2:"22",y2:"20"})]})}function sh(){return c.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:[c.jsx("circle",{cx:"12",cy:"5",r:"1.7"}),c.jsx("circle",{cx:"12",cy:"12",r:"1.7"}),c.jsx("circle",{cx:"12",cy:"19",r:"1.7"})]})}function kl(s){try{return localStorage.getItem(s)||null}catch{return null}}function Ni(s){return s?/timeout/i.test(s)?"登录超时,请重新点击 Login。":/state/i.test(s)?"校验失败,请重新登录。":/no token/i.test(s)?"登录未完成,请重试。":/bridge missing/i.test(s)?"无法连接到登录服务(preload 未就绪)。":s:""}const Sg=3e4;function Dl(s){const f=String(s||"");return{invalid_code:o("cicyHub.codeInvalid","验证码不对或已过期"),rate_limited:o("cicyHub.rateLimited","发送太频繁,稍后再试(每小时最多 5 次)"),mail_failed:o("cicyHub.mailFailed","邮件发送失败"),name_taken:o("cicyHub.nameTaken","名称冲突,换台机器再试"),expired:o("cicyHub.expired","登录已过期,重新发送"),invalid_email:o("auth.badEmail","请输入有效的邮箱地址")}[f]||f}function xg(){var I;const s=typeof window<"u"?(I=window.cicy)==null?void 0:I.hub:null,[f,y]=v.useState(null),[d,x]=v.useState(null),[_,b]=v.useState([]),[U,j]=v.useState(!1),[h,A]=v.useState(""),[T,V]=v.useState(!1),[M,J]=v.useState(ah),[B,K]=v.useState(""),[ee,_e]=v.useState("email"),[me,ce]=v.useState(null);v.useEffect(()=>{let Q=!0;return Oi().then(re=>Q&&ce(re||"")),()=>{Q=!1}},[]);const[oe,ye]=v.useState(!1),[X,ie]=v.useState(""),$=v.useCallback(async()=>{if(!s)return null;try{const Q=await s.status();return y(Q||null),Q}catch{return null}},[s]),se=v.useCallback(async()=>{if(s){j(!0);try{const Q=await s.instances();if(Q!=null&&Q.ok){const re=(Q.instances||[]).filter(ue=>!/^desktop-/i.test(String(ue&&(ue.name||ue.slug)||"")));x(re),b((Q.instances||[]).map(ue=>String(ue&&(ue.name||ue.slug)||"").trim()).filter(Boolean)),A("")}else x([]),A((Q==null?void 0:Q.error)||""),((Q==null?void 0:Q.error)==="unauthorized"||(Q==null?void 0:Q.error)==="not_logged_in")&&$()}catch(Q){A((Q==null?void 0:Q.message)||String(Q))}finally{j(!1)}}},[s,$]);v.useEffect(()=>{var ue;if(!s){y({loggedIn:!1}),x([]);return}let Q=!0;$().then(m=>{Q&&(m!=null&&m.loggedIn)?se():Q&&x([])});const re=(ue=s.onComplete)==null?void 0:ue.call(s,m=>{m!=null&&m.ok?(V(!1),ye(!1),_e("email"),K(""),we.show({id:"hub-login",message:o("auth.loginSuccess","登录成功"),status:"done",ttl:2500}),$().then(()=>se())):m!=null&&m.error&&m.error!=="cancelled"&&(ye(!1),ie(Dl(m.error)),_e("email"))});return()=>{Q=!1;try{re&&re()}catch{}}},[s,se,$]),v.useEffect(()=>{if(!(f!=null&&f.loggedIn))return;const Q=setInterval(se,Sg);return()=>clearInterval(Q)},[f==null?void 0:f.loggedIn,se]);const Ce=Q=>{ie(""),_e("email"),K(""),Q&&!M.trim()&&J(String(Q)),V(!0)},Te=()=>{if(ee==="code")try{s==null||s.cancel()}catch{}V(!1),ye(!1)},Ae=async()=>{const Q=M.trim();if(!/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(Q)){ie(o("auth.badEmail","请输入有效的邮箱地址"));return}const re=String(me||"").trim();if(re&&!th.test(re)){ie(o("cicyHub.teamBadFormat","team 名只能用字母、数字和 . _ -"));return}if(re){const ue=Ol(re).toLowerCase();if((_||[]).some(m=>{const S=String(m||"").trim().toLowerCase();return S.startsWith(Yn)&&S===ue})){ie(o("cicyHub.teamTaken","「"+re+"」已经被另一台机器用了,换一个"));return}}if(ye(!0),ie(""),re)try{await jo(re)}catch{ie(o("cicyHub.teamSaveFailed","无法保存 team 名")),ye(!1);return}try{window.__cicyFleetRelabel&&window.__cicyFleetRelabel()}catch{}try{const ue=await s.loginStart(Q);if(!(ue!=null&&ue.ok)){ie(Dl(ue==null?void 0:ue.error)||o("cicyHub.loginFailed","登录失败"));return}_e("code")}catch(ue){ie((ue==null?void 0:ue.message)||String(ue))}finally{ye(!1)}},Oe=async()=>{const Q=B.replace(/\D/g,"");if(Q.length!==6){ie(o("cicyHub.codeInvalid","验证码不对或已过期"));return}ye(!0),ie("");try{const re=await s.loginCode(Q);re!=null&&re.ok||(ie(Dl(re==null?void 0:re.error)||o("cicyHub.loginFailed","登录失败")),ye(!1))}catch(re){ie((re==null?void 0:re.message)||String(re)),ye(!1)}},Ue=async()=>{try{await(s==null?void 0:s.logout())}catch{}x([]),A(""),$()},D=async(Q,re,ue)=>{try{const m=await s.open(Q.id,ue||Q.name,0,re||"/");m!=null&&m.ok||we.show({id:"hub-open",message:Dl(m==null?void 0:m.error)||o("cicyHub.loginFailed","打开失败"),status:"error",ttl:5e3})}catch(m){we.show({id:"hub-open",message:(m==null?void 0:m.message)||String(m),status:"error",ttl:5e3})}};return{available:!!s,status:f,loggedIn:!!(f!=null&&f.loggedIn),owner:(f==null?void 0:f.owner)||"",instances:d,takenNames:_,loading:U,error:h,refresh:se,logout:Ue,open:D,loginOpen:T,openLogin:Ce,closeLogin:Te,email:M,setEmail:J,code:B,setCode:K,step:ee,busy:oe,loginErr:X,sendCode:Ae,verify:Oe,team:me,setTeam:ce}}function wg({hub:s}){const f=s.step==="code";return Sa.createPortal(c.jsx("div",{"data-id":"HubLoginModal",style:{position:"fixed",inset:0,zIndex:60,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0,.5)"},children:c.jsxs("div",{onClick:y=>y.stopPropagation(),style:{width:400,maxWidth:"92vw",background:"var(--card, #1b1d22)",border:"1px solid var(--border, #2c2f36)",borderRadius:14,padding:22,boxShadow:"0 20px 60px rgba(0,0,0,.5)"},children:[c.jsx("div",{style:{fontSize:16,fontWeight:700,marginBottom:4},children:o("cicyHub.login","登录 CiCy Hub")}),c.jsx("div",{style:{fontSize:12,opacity:.6,marginBottom:16},children:f?o("cicyHub.codeSent","验证码已发到 {{email}},也可以直接点邮件里的链接",{email:s.email.trim()}):o("cicyHub.loginSub","填写本机 team 名 + 邮箱验证码登录。team 名是这台机器的身份,主机名不作数")}),f?c.jsxs(c.Fragment,{children:[c.jsx("label",{style:{display:"block",fontSize:12,opacity:.75,marginBottom:6},children:o("cicyHub.code","6 位验证码")}),c.jsx("input",{"data-id":"HubLoginModal-code",className:"login-email-input",style:{width:"100%",marginBottom:6,letterSpacing:6,fontSize:20,textAlign:"center"},inputMode:"numeric",autoFocus:!0,maxLength:6,value:s.code,onChange:y=>s.setCode(y.target.value.replace(/\D/g,"").slice(0,6)),placeholder:"••••••",onKeyDown:y=>{y.key==="Enter"&&s.verify()}}),s.busy&&c.jsxs("div",{style:{fontSize:12,opacity:.6,display:"flex",alignItems:"center",gap:6},children:[c.jsx($t,{})," ",o("cicyHub.verifying","验证中…")]})]}):c.jsxs(c.Fragment,{children:[c.jsx("label",{style:{display:"block",fontSize:12,opacity:.75,marginBottom:6},children:o("cicyHub.team","本机 team 名(可选)")}),c.jsxs("div",{style:{display:"flex",alignItems:"center",marginBottom:12},children:[c.jsx("span",{style:{fontSize:13,opacity:.55,paddingRight:6,whiteSpace:"nowrap"},children:Yn}),c.jsx("input",{"data-id":"HubLoginModal-team",className:"login-email-input",style:{flex:1,marginBottom:0},type:"text",autoFocus:!0,spellCheck:!1,value:(s.team||"").replace(Yn,""),onChange:y=>s.setTeam(y.target.value),placeholder:o("cicyHub.teamPlaceholder","例如 xs-1001"),onKeyDown:y=>{y.key==="Enter"&&s.sendCode()}})]}),c.jsx("label",{style:{display:"block",fontSize:12,opacity:.75,marginBottom:6},children:o("cicyHub.email","邮箱")}),c.jsx("input",{"data-id":"HubLoginModal-email",className:"login-email-input",style:{width:"100%",marginBottom:6},type:"email",spellCheck:!1,value:s.email,onChange:y=>s.setEmail(y.target.value),placeholder:"you@example.com",onKeyDown:y=>{y.key==="Enter"&&s.sendCode()}})]}),s.loginErr&&c.jsx("div",{className:"error",style:{marginTop:10},children:s.loginErr}),c.jsxs("div",{className:"modal-actions",children:[c.jsx("button",{type:"button",className:"btn-ghost","data-id":"HubLoginModal-cancel",onClick:s.closeLogin,children:o("cicyHub.cancel","取消")}),f?c.jsx("button",{type:"button",className:"btn-primary","data-id":"HubLoginModal-verify",disabled:s.busy||s.code.length!==6,onClick:s.verify,children:s.busy?o("cicyHub.verifying","验证中…"):o("cicyHub.verify","登录")}):c.jsx("button",{type:"button",className:"btn-primary","data-id":"HubLoginModal-send",disabled:s.busy,onClick:s.sendCode,children:s.busy?o("cicyHub.sending","发送中…"):o("cicyHub.sendCode","发送验证码")})]})]})}),document.body)}function wo(s){const f=Number(s);return Number.isFinite(f)?Math.round(f)+"%":"–"}function Kc(s){const f=Number(s);return Number.isFinite(f)&&f>0?(f/1073741824).toFixed(f>=100*1073741824?0:1)+"G":""}function _g(s){const f=String(s.status||"").toLowerCase();return s.working||f==="working"||f==="busy"||f==="running"?"#3b82f6":f==="error"||f==="failed"?"#f87171":f==="active"||f==="idle"||f==="online"||s.online?"#4ade80":"#6b7280"}function Tg({inst:s,onOpen:f}){const[y,d]=v.useState(null);if(v.useEffect(()=>{let _=!0;return(async()=>{var b,U,j;try{const h=await((j=(U=(b=window.cicy)==null?void 0:b.hub)==null?void 0:U.projects)==null?void 0:j.call(U,s.id));if(!_)return;d(h&&h.ok?{projects:h.projects||[]}:{error:h&&h.error||"failed"})}catch(h){_&&d({error:(h==null?void 0:h.message)||String(h)})}})(),()=>{_=!1}},[s.id]),!y)return c.jsxs("div",{"data-id":"HubInstanceTree",style:{padding:"6px 0",fontSize:12,opacity:.6,display:"flex",alignItems:"center",gap:6},children:[c.jsx($t,{})," ",o("cicyHub.loadingProjects","读取项目…")]});if(y.error)return c.jsx("div",{"data-id":"HubInstanceTree",className:"error",style:{fontSize:12},children:Dl(y.error)});if(!y.projects.length)return c.jsx("div",{"data-id":"HubInstanceTree",style:{padding:"6px 0",fontSize:12,opacity:.6},children:o("cicyHub.noAgents","这台机器还没有 Agent")});const x={display:"flex",alignItems:"center",gap:6,padding:"4px 6px",borderRadius:6,cursor:"pointer",fontSize:12,minWidth:0};return c.jsx("div",{"data-id":"HubInstanceTree",style:{display:"flex",flexDirection:"column",gap:2,marginTop:6,maxHeight:260,overflowY:"auto"},children:y.projects.map(_=>c.jsxs("div",{"data-id":"HubProject",children:[c.jsxs("div",{className:"bcard__menu-item",style:{...x,fontWeight:600},title:o("cicyHub.openProject","打开项目"),onClick:b=>{b.stopPropagation(),f(_.slug?`/#/project/${encodeURIComponent(_.slug)}`:"/",_.name||s.name)},children:[c.jsx("span",{style:{opacity:.7},children:"📁"}),c.jsx("span",{style:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:_.name||o("cicyHub.ungrouped","未分组")}),c.jsx("span",{style:{opacity:.5},children:o("cicyHub.agents","{{n}} 个 Agent",{n:_.agents.length})})]}),_.agents.map(b=>c.jsxs("div",{"data-id":"HubAgent",className:"bcard__menu-item",style:{...x,paddingLeft:22},title:`${b.wid}${b.workspace?" · "+b.workspace:""}`,onClick:U=>{U.stopPropagation(),f(`/#/agent/${encodeURIComponent(b.wid)}`,`${b.title||b.wid} · ${s.name}`)},children:[c.jsx("span",{style:{width:7,height:7,borderRadius:4,background:_g(b),flex:"none"}}),c.jsx("span",{style:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:b.title||b.wid}),b.role==="master"&&c.jsx("span",{className:"bcard__chip",style:{fontSize:10},children:"master"}),b.agentType&&c.jsx("span",{style:{opacity:.5,fontSize:10},children:b.agentType})]},b.wid))]},_.id))})}function jg({inst:s,onOpen:f}){const y=s.online?"ok":"off",d=s.resources||null,[x,_]=v.useState(!1),[b,U]=v.useState(!1),j=async(M,J)=>{if(!x){_(!0);try{await f(M,J)}finally{_(!1)}}},h=s.reachable||s.online,A=M=>Number(M)>=90,T=d?[{k:"cpu",t:"CPU "+wo(d.cpu_usage_pct),warn:A(d.cpu_usage_pct)},{k:"mem",t:"内存 "+wo(d.mem_usage_pct),warn:A(d.mem_usage_pct)},{k:"disk",t:"磁盘 "+wo(d.disk_usage_pct),warn:A(d.disk_usage_pct)}]:[],V=d?`内存 ${Kc(d.mem_used_bytes)}/${Kc(d.mem_total_bytes)} · 磁盘 ${Kc(d.disk_used_bytes)}/${Kc(d.disk_total_bytes)}`:"";return c.jsxs("div",{"data-id":"HubInstanceCard",className:`bcard bcard--custom${s.online?" bcard--online":""}`,title:s.host,children:[c.jsx("div",{className:"bcard__accent"}),c.jsxs("div",{className:"bcard__top",children:[c.jsxs("div",{className:"bcard__pill",children:[c.jsx("span",{className:"bcard__dot","data-tone":y}),c.jsx(ch,{})]}),typeof s.agents=="number"&&s.agents>0&&c.jsxs("button",{type:"button","data-id":"HubInstanceCard-agents",className:"btn-ghost",disabled:!h,style:{fontSize:11,color:"#8b949e",padding:"2px 6px",border:"none",background:"transparent",cursor:"pointer"},title:o("cicyHub.toggleTree","展开 / 收起项目与 Agent"),onClick:M=>{M.stopPropagation(),U(J=>!J)},children:[o("cicyHub.agents","{{n}} 个 Agent",{n:s.agents})," ",b?"▾":"▸"]})]}),c.jsxs("div",{className:"bcard__body",children:[c.jsxs("div",{style:{height:28,display:"flex",alignItems:"center",gap:8},children:[c.jsx(Oo,{size:24,name:s.name,teamId:s.id}),c.jsx("h3",{className:"bcard__name",style:{flex:1,minWidth:0,margin:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s.name})]}),c.jsxs("div",{className:"bcard__meta",children:[c.jsx("span",{className:"bcard__chip","data-id":"HubInstanceCard-kind",children:o("cicyHub.kind","Hub")}),s.version&&c.jsxs("span",{className:"bcard__chip","data-id":"HubInstanceCard-version",children:["v",s.version]})]}),T.length>0&&c.jsx("div",{"data-id":"HubInstanceCard-usage",title:V,style:{marginTop:6,fontSize:11,color:"#8b949e",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:T.map((M,J)=>c.jsxs("span",{style:M.warn?{color:"#f87171"}:void 0,children:[J>0?" · ":"",M.t]},M.k))}),b&&h&&c.jsx(Tg,{inst:s,onOpen:j})]}),c.jsxs("button",{type:"button",className:"bcard__cta","data-id":"HubInstanceCard-open",disabled:x||!h,onClick:()=>j("/",s.name),children:[x?c.jsx($t,{}):c.jsx(Mo,{}),c.jsx("span",{children:h?o("cicyHub.open","打开"):o("cicyHub.unreachable","不可达")})]})]})}var Wm;const Cg=((Wm=window.cicy)==null?void 0:Wm.platform)||(()=>{const s=navigator.userAgent||"";return/Mac/i.test(s)?"darwin":/Windows/i.test(s)?"win32":"linux"})();document.documentElement.dataset.platform=Cg;document.documentElement.dataset.fullscreen="0";var Fm,Im;(Im=(Fm=window.cicy)==null?void 0:Fm.window)!=null&&Im.onFullscreen&&window.cicy.window.onFullscreen(s=>{document.documentElement.dataset.fullscreen=s?"1":"0"});Ey.createRoot(document.getElementById("root")).render(c.jsx(By,{}));